import{r as e,c as l,d as t,e as s,F as a,f as r,g as n,h as u,C as o,t as i,T as c,m as f}from"./index.1711290598880.js";const p={class:"w-full h-full"},d={class:"flex flex-wrap"},h={style:{width:"150px"}},x=["src"],m={key:0,class:"flex h-full flex-col items-center justify-center"},v={class:"relative bg-blue-500 rounded-full text-white py-2 px-4 cursor-pointer"},g=s("span",null,"上传浏览器导出书签文件",-1),w={__name:"browserImport",setup(w){const y=e([]);const b=e=>{const l=e.target.files;if(l.length>=0){const e=l[0],t=new FileReader;t.onload=e=>{y.value=function(e){let l=(new DOMParser).parseFromString(e,"text/html").querySelectorAll("a"),t=[];return l.forEach((e=>{var l,s;console.log(e);const{href:a,icon:r,text:n}=e;let u={name:n,src:null==(s=null==(l=e.attributes)?void 0:l.icon)?void 0:s.value,url:a};t.push(u)})),t}(e.target.result)},t.readAsText(e)}};return(e,w)=>(l(),t("div",p,[s("div",d,[(l(!0),t(a,null,r(y.value,(e=>(l(),n(c,null,{default:u((()=>[s("div",h,[s("img",{src:e.src,style:{width:"50px",height:"50px"}},null,8,x),o(" "+i(e.name),1)])])),_:2},1024)))),256))]),0===y.value.length?(l(),t("div",m,[s("button",v,[s("input",{class:"inset-0 cursor-pointer absolute w-full h-full opacity-0",onChange:b,type:"file",accept:"text/html",name:"file"},null,32),g])])):f("",!0)]))}};export{w as default};