import{aH as k,aD as A,J as c}from"./vendor-ui-CGT0cG1n.js";import{S as D,d as L,m as u,p as w,x as R,G as y}from"./index-D88CvPWT.js";import{v as N,aA as S,aC as B,af as o,a7 as G,aj as I,ab as f,l as z,j as T,X as V,k as $,g as d,Y as b}from"./vendor-core-BKehvho7.js";const j={class:"size-full"},X=N({__name:"index",emits:["select"],setup(H,{emit:v}){const{locale:m,t:l}=S(),h={zh:"zhCN",en:"en"},p=d(()=>h[m.value]),t=o(null),n=o(!0),_=B(),r=k(`${D}_${_.path}`,""),g=v,E=A(),F=`${R()}/api/v1/vuefinder`,P=new L({baseURL:F,url:{list:"/list"}}),i=o(r.value||u.FILE_MANAGER_DIRNAME),x=d(()=>({selectionMode:"single",driver:P,features:{search:!1,upload:!1,delete:!1,rename:!1,preview:!1,edit:!1,archive:!1,unarchive:!1,newfile:!1,newfolder:!1,fullscreen:!1,download:!1,language:!0,move:!1,copy:!1,history:!1,theme:!1,pinned:!1},contextMenuItems:[...y,{id:"select-folder",title:()=>l("file.select"),action:(a,e)=>{if(e.length>1){c.error(l("file.multiSelect"));return}const{type:s="dir"}=e[0];if(s!=="dir"){c.error(l("file.onlyDir"));return}g("select",e[0])},show:(a,e)=>{const{target:s,items:M}=e;return M.length>1?!1:s?.type==="dir"}}],config:{initialPath:i.value,theme:E.value?"valorite":"silver"}}));function C(a){r.value=a,!a&&t.value&&(n.value=!1,b(()=>{n.value=!0,i.value=u.FILE_MANAGER_DIRNAME,t.value?.refresh()}))}return G(()=>{t.value=w("vueFinder")}),(a,e)=>{const s=I("VueFinder");return f(),z("div",j,[n.value?(f(),T(s,V({key:0,id:"vueFinder",locale:p.value},x.value,{onPathChange:C}),null,16,["locale"])):$("",!0)])}}});export{X as default};
