vuefinder 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vuefinder.cjs +1 -2
- package/dist/vuefinder.js +503 -502
- package/package.json +1 -1
package/dist/vuefinder.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use strict";var J=Object.defineProperty;var X=(d,t,o)=>t in d?J(d,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):d[t]=o;var I=(d,t,o)=>(X(d,typeof t!="symbol"?t+"":t,o),o);const e=require("vue"),Q=require("mitt"),Z=require("dragselect"),ee=require("vanilla-lazyload");require("cropperjs/dist/cropper.css");const te=require("cropperjs"),oe=require("@uppy/core"),re=require("@uppy/xhr-upload");require("microtip/microtip.css");var P;const H=(P=document.querySelector('meta[name="csrf-token"]'))==null?void 0:P.getAttribute("content");class ae{constructor(t){I(this,"config");this.config=t}get config(){return this.config}transformRequestParams(t){const o=this.config,a={};H!=null&&H!==""&&(a[o.xsrfHeaderName]=H);const r=Object.assign({},o.headers,a,t.headers),l=Object.assign({},o.params,t.params),c=t.body,s=o.baseUrl+t.url,n=t.method;let i;n!=="get"&&(c instanceof FormData?(i=c,o.body!=null&&Object.entries(this.config.body).forEach(([f,y])=>{i.append(f,y)})):(i={...c},o.body!=null&&Object.assign(i,this.config.body)));const p={url:s,method:n,headers:r,params:l,body:i};if(o.transformRequest!=null){const f=o.transformRequest({url:s,method:n,headers:r,params:l,body:i});f.url!=null&&(p.url=f.url),f.method!=null&&(p.method=f.method),f.params!=null&&(p.params=f.params??{}),f.headers!=null&&(p.headers=f.headers??{}),f.body!=null&&(p.body=f.body)}return p}getDownloadUrl(t,o){if(o.url!=null)return o.url;const a=this.transformRequestParams({url:"",method:"get",params:{q:"download",adapter:t,path:o.path}});return a.url+"?"+new URLSearchParams(a.params).toString()}getPreviewUrl(t,o){if(o.url!=null)return o.url;const a=this.transformRequestParams({url:"",method:"get",params:{q:"preview",adapter:t,path:o.path}});return a.url+"?"+new URLSearchParams(a.params).toString()}async send(t){const o=this.transformRequestParams(t),a=t.responseType||"json",r={method:t.method,headers:o.headers,signal:t.abortSignal},l=o.url+"?"+new URLSearchParams(o.params);if(o.method!=="get"&&o.body!=null){let s;o.body instanceof FormData?s=t.body:(s=JSON.stringify(o.body),r.headers["Content-Type"]="application/json"),r.body=s}const c=await fetch(l,r);if(c.ok)return await c[a]();throw await c.json()}}function ne(d){const t={baseUrl:"",headers:{},params:{},body:{},xsrfHeaderName:"X-CSRF-Token"};return typeof d=="string"?Object.assign(t,{baseUrl:d}):Object.assign(t,d),new ae(t)}function le(d){let t=localStorage.getItem(d+"_storage");const o=e.reactive(JSON.parse(t??"{}"));e.watch(o,a);function a(){Object.keys(o).length?localStorage.setItem(d+"_storage",JSON.stringify(o)):localStorage.removeItem(d+"_storage")}function r(n,i){o[n]=i}function l(n){delete o[n]}function c(){Object.keys(o).map(n=>l(n))}return{getStore:(n,i=null)=>o.hasOwnProperty(n)?o[n]:i,setStore:r,removeStore:l,clearStore:c}}async function se(d,t){const o=t[d];return typeof o=="function"?(await o()).default:o}function ie(d,t,o,a){const{getStore:r,setStore:l}=d,c=e.ref({}),s=e.ref(r("locale",t)),n=(f,y=t)=>{se(f,a).then(h=>{c.value=h,l("locale",f),s.value=f,l("translations",h),Object.values(a).length>1&&(o.emit("vf-toast-push",{label:"The language is set to "+f}),o.emit("vf-language-saved"))}).catch(h=>{y?(o.emit("vf-toast-push",{label:"The selected locale is not yet supported!",type:"error"}),n(y,null)):o.emit("vf-toast-push",{label:"Locale cannot be loaded!",type:"error"})})};!r("locale")&&!a.length?n(t):c.value=r("translations");const i=(f,...y)=>y.length?i(f=f.replace("%s",y.shift()),...y):f;function p(f,...y){return c.value&&c.value.hasOwnProperty(f)?i(c.value[f],...y):i(f,...y)}return{t:p,changeLocale:n,locale:s}}const $={EDIT:"edit",NEW_FILE:"newfile",NEW_FOLDER:"newfolder",PREVIEW:"preview",ARCHIVE:"archive",UNARCHIVE:"unarchive",SEARCH:"search",RENAME:"rename",UPLOAD:"upload",DELETE:"delete",FULL_SCREEN:"fullscreen",DOWNLOAD:"download",LANGUAGE:"language"},ce=Object.values($),de="2.2.0";function W(d,t,o,a,r){return(t=Math,o=t.log,a=1024,r=o(d)/o(a)|0,d/t.pow(a,r)).toFixed(0)+" "+(r?"KMGTPEZY"[--r]+"iB":"B")}function G(d,t,o,a,r){return(t=Math,o=t.log,a=1e3,r=o(d)/o(a)|0,d/t.pow(a,r)).toFixed(0)+" "+(r?"KMGTPEZY"[--r]+"B":"B")}function ue(d){const t={k:1,m:2,g:3,t:4},a=/(\d+(?:\.\d+)?)\s?(k|m|g|t)?b?/i.exec(d);return a[1]*Math.pow(1024,t[a[2].toLowerCase()])}const j={SYSTEM:"system",LIGHT:"light",DARK:"dark"};function me(d,t){const o=e.ref(j.SYSTEM),a=e.ref(j.LIGHT);o.value=d.getStore("theme",t??j.SYSTEM);const r=window.matchMedia("(prefers-color-scheme: dark)"),l=c=>{o.value===j.DARK||o.value===j.SYSTEM&&c.matches?a.value=j.DARK:a.value=j.LIGHT};return l(r),r.addEventListener("change",l),{value:o,actualValue:a,set(c){o.value=c,c!==j.SYSTEM?d.setStore("theme",c):d.removeStore("theme"),l(r)}}}const pe=(d,t)=>{const o=le(d.id),a=Q(),r=o.getStore("metricUnits",!1),l=me(o,d.theme),c=t.i18n,s=d.locale??t.locale,n=e.computed(()=>ie(o,s,a,c)),i=f=>Array.isArray(f)?f:ce,p=d.persist?o.getStore("path",d.path):d.path;return e.reactive({version:de,root:null,debug:d.debug,emitter:a,features:i(d.features),requester:ne(d.request),theme:l,view:o.getStore("viewport","grid"),fullScreen:o.getStore("full-screen",d.fullScreen),selectButton:d.selectButton,metricUnits:r,filesize:r?G:W,maxFileSize:d.maxFileSize,loading:!1,i18n:n,modal:{active:!1,type:"delete",data:{}},adapter:o.getStore("adapter"),path:p,persist:d.persist,storage:o,data:{adapter:o.getStore("adapter"),storages:[],dirname:p,files:[]},selectedItems:[]})},fe={class:"border-neutral-300 flex justify-between items-center py-1 text-sm"},ve={key:0,class:"flex text-center"},he=["aria-label"],ge=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 10.5v6m3-3H9m4.06-7.19l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})],-1),ke=[ge],ye=["aria-label"],_e=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m3.75 9v6m3-3H9m1.5-12H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})],-1),xe=[_e],we=["aria-label"],be=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"},null,-1),Ee=[be],Ve=["aria-label"],Ne=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"},null,-1),$e=[Ne],Be=["aria-label"],Se=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5"})],-1),Ce=[Se],De=["aria-label"],Me=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5m6 4.125l2.25 2.25m0 0l2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"},null,-1),je=[Me],Te=["aria-label"],Fe=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"},null,-1),Le=[Fe],ze={key:1,class:"flex text-center"},Ae={class:"pl-2"},Oe={class:"dark:bg-gray-700 bg-gray-200 text-xs px-2 py-1 rounded"},Ue={key:0,class:"animate-spin p-0.5 h-5 w-5 text-white ml-auto",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},He=e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),qe=e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1),Re=[He,qe],Ie={class:"flex text-center items-center justify-end"},Pe=["aria-label"],We={xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Ge={key:0,"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 9V4.5M9 9H4.5M9 9L3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5l5.25 5.25"},Ye={key:1,"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"},Ke=["aria-label"],Je={key:0,"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6zM3.75 15.75A2.25 2.25 0 016 13.5h2.25a2.25 2.25 0 012.25 2.25V18a2.25 2.25 0 01-2.25 2.25H6A2.25 2.25 0 013.75 18v-2.25zM13.5 6a2.25 2.25 0 012.25-2.25H18A2.25 2.25 0 0120.25 6v2.25A2.25 2.25 0 0118 10.5h-2.25a2.25 2.25 0 01-2.25-2.25V6zM13.5 15.75a2.25 2.25 0 012.25-2.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-2.25A2.25 2.25 0 0113.5 18v-2.25z"},Xe={key:1,"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 010 3.75H5.625a1.875 1.875 0 010-3.75z"},Qe={name:"VFToolbar"},Ze=Object.assign(Qe,{setup(d){const t=e.inject("ServiceContainer"),{setStore:o}=t.storage,{t:a}=t.i18n,r=e.ref([]),l=e.ref("");t.emitter.on("vf-search-query",({newQuery:n})=>{l.value=n});const c=()=>{t.fullScreen=!t.fullScreen,o("full-screen",t.fullScreen),t.emitter.emit("vf-fullscreen-toggle")};t.emitter.on("vf-nodes-selected",n=>{r.value=n});const s=()=>{t.view=t.view==="list"?"grid":"list",o("viewport",t.view)};return(n,i)=>(e.openBlock(),e.createElementBlock("div",fe,[l.value.length?(e.openBlock(),e.createElementBlock("div",ze,[e.createElementVNode("div",Ae,[e.createTextVNode(e.toDisplayString(e.unref(a)("Search results for"))+" ",1),e.createElementVNode("span",Oe,e.toDisplayString(l.value),1)]),e.unref(t).loading?(e.openBlock(),e.createElementBlock("svg",Ue,Re)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",ve,[e.unref(t).features.includes(e.unref($).NEW_FOLDER)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(a)("New Folder"),"data-microtip-position":"bottom-right",role:"tooltip",onClick:i[0]||(i[0]=p=>e.unref(t).emitter.emit("vf-modal-show",{type:"new-folder",items:r.value}))},ke,8,he)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref($).NEW_FILE)?(e.openBlock(),e.createElementBlock("div",{key:1,class:"mx-1.5","aria-label":e.unref(a)("New File"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[1]||(i[1]=p=>e.unref(t).emitter.emit("vf-modal-show",{type:"new-file",items:r.value}))},xe,8,ye)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref($).RENAME)?(e.openBlock(),e.createElementBlock("div",{key:2,class:"mx-1.5","aria-label":e.unref(a)("Rename"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[2]||(i[2]=p=>r.value.length!=1||e.unref(t).emitter.emit("vf-modal-show",{type:"rename",items:r.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([r.value.length==1?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Ee,2))],8,we)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref($).DELETE)?(e.openBlock(),e.createElementBlock("div",{key:3,class:"mx-1.5","aria-label":e.unref(a)("Delete"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[3]||(i[3]=p=>!r.value.length||e.unref(t).emitter.emit("vf-modal-show",{type:"delete",items:r.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([r.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},$e,2))],8,Ve)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref($).UPLOAD)?(e.openBlock(),e.createElementBlock("div",{key:4,class:"mx-1.5","aria-label":e.unref(a)("Upload"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[4]||(i[4]=p=>e.unref(t).emitter.emit("vf-modal-show",{type:"upload",items:r.value}))},Ce,8,Be)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref($).UNARCHIVE)&&r.value.length==1&&r.value[0].mime_type=="application/zip"?(e.openBlock(),e.createElementBlock("div",{key:5,class:"mx-1.5","aria-label":e.unref(a)("Unarchive"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[5]||(i[5]=p=>!r.value.length||e.unref(t).emitter.emit("vf-modal-show",{type:"unarchive",items:r.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([r.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},je,2))],8,De)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref($).ARCHIVE)?(e.openBlock(),e.createElementBlock("div",{key:6,class:"mx-1.5","aria-label":e.unref(a)("Archive"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[6]||(i[6]=p=>!r.value.length||e.unref(t).emitter.emit("vf-modal-show",{type:"archive",items:r.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([r.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Le,2))],8,Te)):e.createCommentVNode("",!0)])),e.createElementVNode("div",Ie,[e.unref(t).features.includes(e.unref($).FULL_SCREEN)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(a)("Toggle Full Screen"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:c},[(e.openBlock(),e.createElementBlock("svg",We,[e.unref(t).fullScreen?(e.openBlock(),e.createElementBlock("path",Ge)):(e.openBlock(),e.createElementBlock("path",Ye))]))],8,Pe)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Change View"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:i[7]||(i[7]=p=>l.value.length||s())},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([l.value.length?"stroke-gray-200 dark:stroke-gray-700":"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.unref(t).view==="grid"?(e.openBlock(),e.createElementBlock("path",Je)):e.createCommentVNode("",!0),e.unref(t).view==="list"?(e.openBlock(),e.createElementBlock("path",Xe)):e.createCommentVNode("",!0)],2))],8,Ke)])]))}}),et=(d,t=0,o=!1)=>{let a;return(...r)=>{o&&!a&&d(...r),clearTimeout(a),a=setTimeout(()=>{d(...r)},t)}},tt=(d,t,o)=>{const a=e.ref(d);return e.customRef((r,l)=>({get(){return r(),a.value},set:et(c=>{a.value=c,l()},t,o)}))},ot={class:"flex p-1.5 bg-neutral-100 dark:bg-gray-800 border-t border-b border-neutral-300 dark:border-gray-700/50 items-center select-none text-sm"},rt=["aria-label"],at=e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 9.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 7.414V15a1 1 0 11-2 0V7.414L6.707 9.707a1 1 0 01-1.414 0z","clip-rule":"evenodd"},null,-1),nt=[at],lt=["aria-label"],st=e.createElementVNode("path",{d:"M463.5 224H472c13.3 0 24-10.7 24-24V72c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8H463.5z"},null,-1),it=[st],ct=["aria-label"],dt=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1),ut=[dt],mt=e.createElementVNode("path",{d:"M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"},null,-1),pt=[mt],ft={class:"flex leading-6"},vt=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),ht=["onDragover","onDragleave","onDrop","title","onClick"],gt={key:0,class:"animate-spin p-1 h-6 w-6 text-white ml-auto",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},kt=e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),yt=e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1),_t=[kt,yt],xt={key:3,class:"relative flex bg-white dark:bg-gray-700 justify-between items-center rounded p-1 ml-2 w-full"},wt=e.createElementVNode("div",null,[e.createElementVNode("svg",{class:"h-6 w-6 p-1 m-auto stroke-gray-400 fill-gray-100 dark:stroke-gray-400 dark:fill-gray-400/20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"})])],-1),bt=["placeholder"],Et=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1),Vt=[Et],Nt={name:"VFBreadcrumb"},$t=Object.assign(Nt,{setup(d){const t=e.ref(null),o=e.ref([]),a=e.ref(!1),r=e.ref(null),l=e.inject("ServiceContainer"),{t:c}=l.i18n;l.emitter.on("vf-explorer-update",()=>{let _=[],v=[];t.value=l.data.dirname??l.adapter+"://",t.value.length==0&&(o.value=[]),t.value.replace(l.adapter+"://","").split("/").forEach(function(m){_.push(m),_.join("/")!=""&&v.push({basename:m,name:m,path:l.adapter+"://"+_.join("/"),type:"dir"})}),v.length>4&&(v=v.slice(-5),v[0].name=".."),o.value=v});const s=()=>{a.value=!1,i.value=""};l.emitter.on("vf-search-exit",()=>{s()});const n=()=>{l.features.includes($.SEARCH)&&(a.value=!0,e.nextTick(()=>r.value.focus()))},i=tt("",400);e.watch(i,_=>{l.emitter.emit("vf-toast-clear"),l.emitter.emit("vf-search-query",{newQuery:_})});const p=()=>o.value.length&&!a.value,f=(_,v=null)=>{_.preventDefault(),h(_),v??(v=o.value.length-2);let m=JSON.parse(_.dataTransfer.getData("items"));if(m.find(N=>N.storage!==l.adapter)){alert("Moving items between different storages is not supported yet.");return}l.emitter.emit("vf-modal-show",{type:"move",items:{from:m,to:o.value[v]??{path:l.adapter+"://"}}})},y=_=>{_.preventDefault(),p()?(_.dataTransfer.dropEffect="copy",_.currentTarget.classList.add("bg-blue-200","dark:bg-slate-500")):(_.dataTransfer.dropEffect="none",_.dataTransfer.effectAllowed="none")},h=_=>{_.preventDefault(),_.currentTarget.classList.remove("bg-blue-200","dark:bg-slate-500"),p()&&_.currentTarget.classList.remove("bg-blue-200","dark:bg-slate-500")},x=()=>{i.value==""&&s()};return(_,v)=>(e.openBlock(),e.createElementBlock("div",ot,[e.createElementVNode("span",{"aria-label":e.unref(c)("Go up a directory"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onDragover:v[0]||(v[0]=m=>y(m)),onDragleave:v[1]||(v[1]=m=>h(m)),onDrop:v[2]||(v[2]=m=>f(m)),onClick:v[3]||(v[3]=m=>{var N;return!p()||e.unref(l).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(l).data.adapter,path:((N=o.value[o.value.length-2])==null?void 0:N.path)??e.unref(l).adapter+"://"}})}),class:e.normalizeClass(["h-6 w-6 p-0.5 rounded",p()?"text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer":"text-gray-400 dark:text-neutral-500"]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},nt,34))],8,rt),e.unref(l).loading?(e.openBlock(),e.createElementBlock("span",{key:1,"aria-label":e.unref(c)("Cancel"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:v[5]||(v[5]=m=>e.unref(l).emitter.emit("vf-fetch-abort")),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer"},ut))],8,ct)):(e.openBlock(),e.createElementBlock("span",{key:0,"aria-label":e.unref(c)("Refresh"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:v[4]||(v[4]=m=>{e.unref(l).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(l).data.adapter,path:e.unref(l).data.dirname}})}),class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer",xmlns:"http://www.w3.org/2000/svg",viewBox:"-40 -40 580 580",fill:"currentColor"},it))],8,lt)),a.value?(e.openBlock(),e.createElementBlock("div",xt,[wt,e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:r,onKeydown:e.withKeys(s,["esc"]),onBlur:x,"onUpdate:modelValue":v[10]||(v[10]=m=>e.isRef(i)?i.value=m:null),placeholder:e.unref(c)("Search anything.."),class:"w-full pb-0 px-1 border-0 text-base ring-0 outline-0 text-gray-600 focus:ring-transparent focus:border-transparent dark:focus:ring-transparent dark:focus:border-transparent dark:text-gray-300 bg-transparent",type:"text"},null,40,bt),[[e.vModelText,e.unref(i)]]),(e.openBlock(),e.createElementBlock("svg",{class:"w-6 h-6 cursor-pointer",onClick:s,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Vt))])):(e.openBlock(),e.createElementBlock("div",{key:2,class:"group flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full",onClick:e.withModifiers(n,["self"])},[(e.openBlock(),e.createElementBlock("svg",{onDragover:v[6]||(v[6]=m=>y(m)),onDragleave:v[7]||(v[7]=m=>h(m)),onDrop:v[8]||(v[8]=m=>f(m,-1)),onClick:v[9]||(v[9]=m=>e.unref(l).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(l).data.adapter}})),class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-gray-800 cursor-pointer",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},pt,32)),e.createElementVNode("div",ft,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(m,N)=>(e.openBlock(),e.createElementBlock("div",{key:N},[vt,e.createElementVNode("span",{onDragover:S=>N===o.value.length-1||y(S),onDragleave:S=>N===o.value.length-1||h(S),onDrop:S=>N===o.value.length-1||f(S,N),class:"px-1.5 py-1 text-slate-700 dark:text-slate-200 hover:bg-neutral-100 dark:hover:bg-gray-800 rounded cursor-pointer",title:m.basename,onClick:S=>e.unref(l).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(l).data.adapter,path:m.path}})},e.toDisplayString(m.name),41,ht)]))),128))]),e.unref(l).loading?(e.openBlock(),e.createElementBlock("svg",gt,_t)):e.createCommentVNode("",!0)]))]))}}),Y=(d,t=null)=>new Date(d*1e3).toLocaleString(t??navigator.language??"en-US"),Bt={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},St=e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1),Ct=[St],Dt={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},Mt=e.createElementVNode("path",{"fill-rule":"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z","clip-rule":"evenodd"},null,-1),jt=[Mt],Tt={name:"VFSortIcon"},O=Object.assign(Tt,{props:{direction:String},setup(d){return(t,o)=>(e.openBlock(),e.createElementBlock("div",null,[d.direction==="down"?(e.openBlock(),e.createElementBlock("svg",Bt,Ct)):e.createCommentVNode("",!0),d.direction==="up"?(e.openBlock(),e.createElementBlock("svg",Dt,jt)):e.createCommentVNode("",!0)]))}}),Ft=["onClick"],Lt={name:"VFToast.vue"},zt=Object.assign(Lt,{setup(d){const t=e.inject("ServiceContainer"),{getStore:o}=t.storage,a=e.ref(o("full-screen",!1)),r=e.ref([]),l=n=>n==="error"?"text-red-400 border-red-400 dark:text-red-300 dark:border-red-300":"text-lime-600 border-lime-600 dark:text-lime-300 dark:border-lime-1300",c=n=>{r.value.splice(n,1)},s=n=>{let i=r.value.findIndex(p=>p.id===n);i!==-1&&c(i)};return t.emitter.on("vf-toast-clear",()=>{r.value=[]}),t.emitter.on("vf-toast-push",n=>{let i=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");n.id=i,r.value.push(n),setTimeout(()=>{s(i)},5e3)}),(n,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([a.value.value?"fixed":"absolute","bottom-0 max-w-fit flex flex-col bottom-0 left-1/2 -translate-x-1/2"])},[e.createVNode(e.TransitionGroup,{name:"vf-toast-item","leave-active-class":"transition-all duration-1000","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(p,f)=>(e.openBlock(),e.createElementBlock("div",{onClick:y=>c(f),key:p,class:e.normalizeClass([l(p.type),"inline-block mx-auto my-0.5 py-0.5 px-2 min-w-max bg-gray-50 dark:bg-gray-600 border text-xs sm:text-sm rounded cursor-pointer"])},e.toDisplayString(p.label),11,Ft))),128))]),_:1})],2))}});function R(d,t=14){let o=`((?=([\\w\\W]{0,${t}}))([\\w\\W]{${t+1},})([\\w\\W]{8,}))`;return d.replace(new RegExp(o),"$2..$4")}const At={class:"relative flex-auto flex flex-col overflow-hidden"},Ot={key:0,class:"grid grid-cols-12 border-b border-neutral-300 border-gray-200 dark:border-gray-700 text-xs select-none"},Ut={class:"absolute"},Ht=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"absolute h-6 w-6 md:h-12 md:w-12 m-auto stroke-neutral-500 fill-white dark:fill-gray-700 dark:stroke-gray-600 z-10",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})],-1),qt={class:"text-neutral-700 dark:text-neutral-300 p-1 absolute text-center top-4 right-[-2rem] md:top-5 md:right-[-2.4rem] z-20 text-xs"},Rt=["onDblclick","onContextmenu","data-type","data-item","data-index"],It={class:"grid grid-cols-12 items-center"},Pt={class:"flex col-span-7 items-center"},Wt={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Gt=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),Yt=[Gt],Kt={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Jt=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),Xt=[Jt],Qt={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Zt={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},eo=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],to={class:"grid grid-cols-12 items-center"},oo={class:"flex col-span-7 items-center"},ro={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},ao=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),no=[ao],lo={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},so=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),io=[so],co={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},uo={class:"col-span-2 text-center"},mo={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap"},po=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],fo={class:"relative"},vo={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-10 w-10 md:h-12 md:w-12 m-auto fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},ho=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),go=[ho],ko=["data-src","alt"],yo={key:2,xmlns:"http://www.w3.org/2000/svg",class:"h-10 w-10 md:h-12 md:w-12 m-auto text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},_o=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),xo=[_o],wo={key:3,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},bo={class:"break-all"},Eo={name:"VFExplorer"},Vo=Object.assign(Eo,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n;t.storage;const a=k=>k==null?void 0:k.substring(0,3),r=e.ref(null),l=e.ref(null),c=e.ref(0),s=e.ref(null),n=Math.floor(Math.random()*2**32),i=e.ref("");let p;t.emitter.on("vf-fullscreen-toggle",()=>{r.value.style.height=null}),t.emitter.on("vf-search-query",({newQuery:k})=>{i.value=k,k?t.emitter.emit("vf-fetch",{params:{q:"search",adapter:t.data.adapter,path:t.data.dirname,filter:k},onSuccess:b=>{b.files.length||t.emitter.emit("vf-toast-push",{label:o("No search result found.")})}}):t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname}})});let f=null;const y=()=>{f&&clearTimeout(f)},h=e.ref(!0),x=k=>{k.touches.length>1&&(h.value?(s.value.stop(),t.emitter.emit("vf-toast-push",{label:o("Drag&Drop: off")})):(s.value.start(),t.emitter.emit("vf-toast-push",{label:o("Drag&Drop: on")}),t.emitter.emit("vf-explorer-update")),h.value=!h.value)},_=k=>{f=setTimeout(()=>{const b=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!1,view:window,button:2,buttons:0,clientX:k.target.getBoundingClientRect().x,clientY:k.target.getBoundingClientRect().y});k.target.dispatchEvent(b)},500)},v=k=>{k.type==="dir"?(t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:k.path}})):t.emitter.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:k})},m=e.reactive({active:!1,column:"",order:""}),N=(k=!0)=>{let b=[...t.data.files],u=m.column,E=m.order=="asc"?1:-1;if(!k)return b;const g=(w,V)=>typeof w=="string"&&typeof V=="string"?w.toLowerCase().localeCompare(V.toLowerCase()):w<V?-1:w>V?1:0;return m.active&&(b=b.slice().sort((w,V)=>g(w[u],V[u])*E)),b},S=k=>{m.active&&m.column==k?(m.active=m.order=="asc",m.column=k,m.order="desc"):(m.active=!0,m.column=k,m.order="asc")},M=()=>s.value.getSelection().map(k=>JSON.parse(k.dataset.item)),F=(k,b)=>{if(k.altKey||k.ctrlKey||k.metaKey)return k.preventDefault(),!1;k.dataTransfer.setDragImage(l.value,0,15),k.dataTransfer.effectAllowed="all",k.dataTransfer.dropEffect="copy",k.dataTransfer.setData("items",JSON.stringify(M()))},L=(k,b)=>{k.preventDefault();let u=JSON.parse(k.dataTransfer.getData("items"));if(u.find(E=>E.storage!==t.adapter)){alert("Moving items between different storages is not supported yet.");return}t.emitter.emit("vf-modal-show",{type:"move",items:{from:u,to:b}})},z=(k,b)=>{k.preventDefault(),!b||b.type!=="dir"||s.value.getSelection().find(u=>u==k.currentTarget)?(k.dataTransfer.dropEffect="none",k.dataTransfer.effectAllowed="none"):k.dataTransfer.dropEffect="copy"},A=()=>{s.value=new Z({area:r.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),t.emitter.on("vf-explorer-update",()=>e.nextTick(()=>{s.value.clearSelection(),s.value.setSettings({selectables:document.getElementsByClassName("vf-item-"+n)})})),s.value.subscribe("predragstart",({event:k,isDragging:b})=>{if(b)c.value=s.value.getSelection().length,s.value.break();else{const u=k.target.offsetWidth-k.offsetX,E=k.target.offsetHeight-k.offsetY;u<15&&E<15&&(s.value.clearSelection(),s.value.break())}}),s.value.subscribe("predragmove",({isDragging:k})=>{k&&s.value.break()}),s.value.subscribe("callback",({items:k,event:b,isDragging:u})=>{t.emitter.emit("vf-nodes-selected",M()),c.value=s.value.getSelection().length})};return e.onMounted(()=>{p=new ee(r.value),A()}),e.onUpdated(()=>{s.value.Area.reset(),s.value.SelectorArea.updatePos(),p.update()}),e.onMounted(()=>{e.watch(()=>t.view,()=>t.emitter.emit("vf-explorer-update"))}),e.onBeforeUnmount(()=>{p.destroy()}),(k,b)=>(e.openBlock(),e.createElementBlock("div",At,[e.unref(t).view=="list"||i.value.length?(e.openBlock(),e.createElementBlock("div",Ot,[e.createElementVNode("div",{onClick:b[0]||(b[0]=u=>S("basename")),class:"col-span-7 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center pl-1"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Name"))+" ",1),e.withDirectives(e.createVNode(O,{direction:m.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,m.active&&m.column=="basename"]])]),i.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:b[1]||(b[1]=u=>S("file_size")),class:"col-span-2 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center border-l border-r dark:border-gray-700"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Size"))+" ",1),e.withDirectives(e.createVNode(O,{direction:m.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,m.active&&m.column=="file_size"]])])),i.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:b[2]||(b[2]=u=>S("last_modified")),class:"col-span-3 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Date"))+" ",1),e.withDirectives(e.createVNode(O,{direction:m.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,m.active&&m.column=="last_modified"]])])),i.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:b[3]||(b[3]=u=>S("path")),class:"col-span-5 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center border-l dark:border-gray-700"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Filepath"))+" ",1),e.withDirectives(e.createVNode(O,{direction:m.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,m.active&&m.column=="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ut,[e.createElementVNode("div",{ref_key:"dragImage",ref:l,class:"absolute -z-50 -top-96"},[Ht,e.createElementVNode("div",qt,e.toDisplayString(c.value),1)],512)]),e.createElementVNode("div",{onTouchstart:x,onContextmenu:b[10]||(b[10]=e.withModifiers(u=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:u,area:r.value,items:M()}),["self","prevent"])),class:e.normalizeClass([e.unref(t).fullScreen?"":"resize-y","h-full w-full text-xs vf-selector-area vf-scrollbar min-h-[150px] overflow-auto p-1 z-0"]),ref_key:"selectorArea",ref:r},[i.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(N(),(u,E)=>(e.openBlock(),e.createElementBlock("div",{onDblclick:g=>v(u),onTouchstart:b[4]||(b[4]=g=>_(g)),onTouchend:b[5]||(b[5]=g=>y()),onContextmenu:e.withModifiers(g=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:g,area:r.value,items:M(),target:u}),["prevent"]),class:e.normalizeClass(["vf-item-"+e.unref(n),"grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),"data-type":u.type,"data-item":JSON.stringify(u),"data-index":E},[e.createElementVNode("div",It,[e.createElementVNode("div",Pt,[u.type==="dir"?(e.openBlock(),e.createElementBlock("svg",Wt,Yt)):(e.openBlock(),e.createElementBlock("svg",Kt,Xt)),e.createElementVNode("span",Qt,e.toDisplayString(u.basename),1)]),e.createElementVNode("div",Zt,e.toDisplayString(u.path),1)])],42,Rt))),256)):e.createCommentVNode("",!0),e.unref(t).view==="list"&&!i.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(N(),(u,E)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:g=>v(u),onTouchstart:b[6]||(b[6]=g=>_(g)),onTouchend:b[7]||(b[7]=g=>y()),onContextmenu:e.withModifiers(g=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:g,area:r.value,items:M(),target:u}),["prevent"]),onDragstart:g=>F(g),onDragover:g=>z(g,u),onDrop:g=>L(g,u),class:e.normalizeClass(["vf-item-"+e.unref(n),"grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),"data-type":u.type,"data-item":JSON.stringify(u),"data-index":E},[e.createElementVNode("div",to,[e.createElementVNode("div",oo,[u.type==="dir"?(e.openBlock(),e.createElementBlock("svg",ro,no)):(e.openBlock(),e.createElementBlock("svg",lo,io)),e.createElementVNode("span",co,e.toDisplayString(u.basename),1)]),e.createElementVNode("div",uo,e.toDisplayString(u.file_size?e.unref(t).filesize(u.file_size):""),1),e.createElementVNode("div",mo,e.toDisplayString(e.unref(Y)(u.last_modified)),1)])],42,eo))),256)):e.createCommentVNode("",!0),e.unref(t).view==="grid"&&!i.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(N(!1),(u,E)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:g=>v(u),onTouchstart:b[8]||(b[8]=g=>_(g)),onTouchend:b[9]||(b[9]=g=>y()),onContextmenu:e.withModifiers(g=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:g,area:r.value,items:M(),target:u}),["prevent"]),onDragstart:g=>F(g),onDragover:g=>z(g,u),onDrop:g=>L(g,u),class:e.normalizeClass(["vf-item-"+e.unref(n),"border border-transparent hover:bg-neutral-50 m-1 dark:hover:bg-gray-700 inline-flex w-[5.5rem] h-20 md:w-24 text-center justify-center select-none"]),"data-type":u.type,"data-item":JSON.stringify(u),"data-index":E},[e.createElementVNode("div",null,[e.createElementVNode("div",fo,[u.type==="dir"?(e.openBlock(),e.createElementBlock("svg",vo,go)):(u.mime_type??"").startsWith("image")?(e.openBlock(),e.createElementBlock("img",{key:1,class:"lazy h-10 md:h-12 m-auto","data-src":e.unref(t).requester.getPreviewUrl(e.unref(t).adapter,u),alt:u.basename},null,8,ko)):(e.openBlock(),e.createElementBlock("svg",yo,xo)),!(u.mime_type??"").startsWith("image")&&u.type!="dir"?(e.openBlock(),e.createElementBlock("div",wo,e.toDisplayString(a(u.extension)),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",bo,e.toDisplayString(e.unref(R)(u.basename)),1)])],42,po))),256)):e.createCommentVNode("",!0)],34),e.createVNode(zt)]))}}),No=["onClick"],$o=["href","download"],Bo=e.createElementVNode("span",{class:"px-1"},null,-1),So=e.createElementVNode("span",{class:"px-1"},null,-1),Co={name:"VFContextMenu"},Do=Object.assign(Co,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,a=e.ref(null),r=e.ref([]),l=e.ref(""),c=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),s=e.computed(()=>c.items.filter(f=>f.key==null||t.features.includes(f.key)));t.emitter.on("vf-context-selected",f=>{r.value=f});const n={newfolder:{key:$.NEW_FOLDER,title:()=>o("New Folder"),action:()=>{t.emitter.emit("vf-modal-show",{type:"new-folder"})}},delete:{key:$.DELETE,title:()=>o("Delete"),action:()=>{t.emitter.emit("vf-modal-show",{type:"delete",items:r})}},refresh:{title:()=>o("Refresh"),action:()=>{t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname}})}},preview:{key:$.PREVIEW,title:()=>o("Preview"),action:()=>{t.emitter.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:r.value[0]})}},open:{title:()=>o("Open"),action:()=>{t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:r.value[0].path}})}},openDir:{title:()=>o("Open containing folder"),action:()=>{t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:r.value[0].dir}})}},download:{key:$.DOWNLOAD,link:e.computed(()=>t.requester.getDownloadUrl(t.data.adapter,r.value[0])),title:()=>o("Download"),action:()=>{const f=t.requester.getDownloadUrl(t.data.adapter,r.value[0]);t.emitter.emit("vf-download",f)}},archive:{key:$.ARCHIVE,title:()=>o("Archive"),action:()=>{t.emitter.emit("vf-modal-show",{type:"archive",items:r})}},unarchive:{key:$.UNARCHIVE,title:()=>o("Unarchive"),action:()=>{t.emitter.emit("vf-modal-show",{type:"unarchive",items:r})}},rename:{key:$.RENAME,title:()=>o("Rename"),action:()=>{t.emitter.emit("vf-modal-show",{type:"rename",items:r})}}},i=f=>{t.emitter.emit("vf-contextmenu-hide"),f.action()};t.emitter.on("vf-search-query",({newQuery:f})=>{l.value=f}),t.emitter.on("vf-contextmenu-show",({event:f,area:y,items:h,target:x=null})=>{if(c.items=[],l.value)if(x)c.items.push(n.openDir),t.emitter.emit("vf-context-selected",[x]);else return;else!x&&!l.value?(c.items.push(n.refresh),c.items.push(n.newfolder),t.emitter.emit("vf-context-selected",[])):h.length>1&&h.some(_=>_.path===x.path)?(c.items.push(n.refresh),c.items.push(n.archive),c.items.push(n.delete),t.emitter.emit("vf-context-selected",h)):(x.type=="dir"?c.items.push(n.open):(c.items.push(n.preview),c.items.push(n.download)),c.items.push(n.rename),x.mime_type=="application/zip"?c.items.push(n.unarchive):c.items.push(n.archive),c.items.push(n.delete),t.emitter.emit("vf-context-selected",[x]));p(f,y)}),t.emitter.on("vf-contextmenu-hide",()=>{c.active=!1});const p=(f,y)=>{c.active=!0,e.nextTick(()=>{const h=t.root.getBoundingClientRect(),x=y.getBoundingClientRect();let _=f.pageX-h.left,v=f.pageY-h.top,m=a.value.offsetHeight,N=a.value.offsetWidth;_=x.right-f.pageX+window.scrollX<N?_-N:_,v=x.bottom-f.pageY+window.scrollY<m?v-m:v,c.positions={left:_+"px",top:v+"px"}})};return(f,y)=>c.active?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"z-30 absolute text-xs bg-neutral-50 dark:bg-gray-800 text-gray-700 dark:text-gray-200 border border-neutral-300 dark:border-gray-600 shadow rounded select-none",ref_key:"contextmenu",ref:a,style:e.normalizeStyle(c.positions)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,h=>(e.openBlock(),e.createElementBlock("li",{class:"px-2 py-1.5 cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",key:h.title,onClick:x=>i(h)},[h.link?(e.openBlock(),e.createElementBlock("a",{key:0,target:"_blank",href:h.link,download:h.link},[Bo,e.createElementVNode("span",null,e.toDisplayString(h.title()),1)],8,$o)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[So,e.createElementVNode("span",null,e.toDisplayString(h.title()),1)],64))],8,No))),128))],4)):e.createCommentVNode("",!0)}}),Mo={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},jo={class:"flex leading-5 items-center"},To=["aria-label"],Fo=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"})],-1),Lo=[Fo],zo=["value"],Ao={class:"ml-3"},Oo={key:0},Uo={class:"ml-1"},Ho={class:"flex leading-5 items-center justify-end"},qo=["disabled"],Ro=["aria-label"],Io=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 stroke-slate-500 cursor-pointer",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),Po=[Io],Wo={name:"VFStatusbar"},Go=Object.assign(Wo,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,{setStore:a}=t.storage,r=e.ref(0),l=()=>{t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.adapter}}),a("adapter",t.adapter)};t.emitter.on("vf-nodes-selected",n=>{r.value=n.length});const c=e.ref("");t.emitter.on("vf-search-query",({newQuery:n})=>{c.value=n});const s=e.computed(()=>{const n=t.selectButton.multiple?t.selectedItems.length>0:t.selectedItems.length===1;return t.selectButton.active&&n});return(n,i)=>(e.openBlock(),e.createElementBlock("div",Mo,[e.createElementVNode("div",jo,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(o)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},Lo,8,To),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":i[0]||(i[0]=p=>e.unref(t).adapter=p),onChange:l,class:"py-0.5 text-sm text-slate-500 border dark:border-gray-600 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).data.storages,p=>(e.openBlock(),e.createElementBlock("option",{value:p},e.toDisplayString(p),9,zo))),256))],544),[[e.vModelSelect,e.unref(t).adapter]]),e.createElementVNode("div",Ao,[c.value.length?(e.openBlock(),e.createElementBlock("span",Oo,e.toDisplayString(e.unref(t).data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",Uo,e.toDisplayString(r.value>0?e.unref(o)("%s item(s) selected.",r.value):""),1)])]),e.createElementVNode("div",Ho,[e.unref(t).selectButton.active?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["vf-btn py-0 vf-btn-primary",{disabled:!s.value}]),disabled:!s.value,onClick:i[1]||(i[1]=p=>e.unref(t).selectButton.click(e.unref(t).selectedItems,p))},e.toDisplayString(e.unref(o)("Select")),11,qo)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:"mr-1","aria-label":e.unref(o)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:i[2]||(i[2]=p=>e.unref(t).emitter.emit("vf-modal-show",{type:"about"}))},Po,8,Ro)])]))}}),Yo={name:"VueFinder"},Ko=Object.assign(Yo,{props:{id:{type:String,default:"vf"},request:{type:[String,Object],required:!0},persist:{type:Boolean,default:!1},path:{type:String,default:"."},features:{type:[Array,Boolean],default:!0},debug:{type:Boolean,default:!1},theme:{type:String,default:"system"},locale:{type:String,default:null},maxHeight:{type:String,default:"600px"},maxFileSize:{type:String,default:"10mb"},fullScreen:{type:Boolean,default:!1},selectButton:{type:Object,default(d){return{active:!1,multiple:!1,click:t=>{},...d}}}},emits:["select"],setup(d,{emit:t}){const o=t,r=pe(d,e.inject("VueFinderOptions"));e.provide("ServiceContainer",r);const{setStore:l}=r.storage,c=e.ref(null);r.root=c,r.i18n,r.emitter.on("vf-modal-close",()=>{r.modal.active=!1}),r.emitter.on("vf-modal-show",i=>{r.modal.active=!0,r.modal.type=i.type,r.modal.data=i});const s=i=>{Object.assign(r.data,i),r.emitter.emit("vf-nodes-selected",{}),r.emitter.emit("vf-explorer-update")};r.emitter.on("vf-nodes-selected",i=>{r.selectedItems=i,o("select",i)});let n;return r.emitter.on("vf-fetch-abort",()=>{n.abort(),r.loading=!1}),r.emitter.on("vf-fetch",({params:i,body:p=null,onSuccess:f=null,onError:y=null,noCloseModal:h=!1})=>{["index","search"].includes(i.q)&&(n&&n.abort(),r.loading=!0),n=new AbortController;const x=n.signal;r.requester.send({url:"",method:i.m||"get",params:i,body:p,abortSignal:x}).then(_=>{r.adapter=_.adapter,r.persist&&(r.path=_.dirname,l("path",r.path)),["index","search"].includes(i.q)&&(r.loading=!1),h||r.emitter.emit("vf-modal-close"),s(_),f&&f(_)}).catch(_=>{console.error(_),y&&y(_)})}),r.emitter.on("vf-download",i=>{const p=document.createElement("a");p.style.display="none",p.target="_blank",p.href=i,p.download=i,r.root.appendChild(p),p.click(),p.remove()}),e.onMounted(()=>{let i={};r.path.includes("://")&&(i={adapter:r.path.split("://")[0],path:r.path}),r.emitter.emit("vf-fetch",{params:{q:"index",adapter:r.adapter,...i}})}),(i,p)=>(e.openBlock(),e.createElementBlock("div",{class:"vuefinder",ref_key:"root",ref:c},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(r).theme.actualValue==="dark"?"dark":"")},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(r).fullScreen?"fixed w-screen inset-0 z-20":"relative rounded-md","border flex flex-col bg-white dark:bg-gray-800 text-gray-700 dark:text-neutral-400 border-neutral-300 dark:border-gray-900 min-w-min select-none"]),style:e.normalizeStyle(e.unref(r).fullScreen?"":"max-height: "+d.maxHeight),onMousedown:p[0]||(p[0]=f=>e.unref(r).emitter.emit("vf-contextmenu-hide")),onTouchstart:p[1]||(p[1]=f=>e.unref(r).emitter.emit("vf-contextmenu-hide"))},[e.createVNode(Ze),e.createVNode($t),e.createVNode(Vo),e.createVNode(Go)],38),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[e.unref(r).modal.active?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("v-f-modal-"+e.unref(r).modal.type),{key:0})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(Do)],2)],512))}}),Jo=e.createElementVNode("div",{class:"fixed inset-0 bg-gray-500 dark:bg-gray-600 dark:bg-opacity-75 bg-opacity-75 transition-opacity"},null,-1),Xo={class:"fixed z-10 inset-0 overflow-hidden"},Qo={class:"relative bg-white dark:bg-gray-800 rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:max-w-4xl md:max-w-2xl lg:max-w-3xl xl:max-w-5xl w-full"},Zo={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},er={class:"bg-gray-50 dark:bg-gray-800 dark:border-t dark:border-gray-700 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},C={__name:"ModalLayout",setup(d){const t=e.inject("ServiceContainer");return e.onMounted(()=>{const o=document.querySelector(".v-f-modal input");o&&o.focus()}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:"v-f-modal relative z-30","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",onKeyup:a[1]||(a[1]=e.withKeys(r=>e.unref(t).emitter.emit("vf-modal-close"),["esc"])),tabindex:"0"},[Jo,e.createElementVNode("div",Xo,[e.createElementVNode("div",{class:"flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0",onMousedown:a[0]||(a[0]=e.withModifiers(r=>e.unref(t).emitter.emit("vf-modal-close"),["self"]))},[e.createElementVNode("div",Qo,[e.createElementVNode("div",Zo,[e.renderSlot(o.$slots,"default")]),e.createElementVNode("div",er,[e.renderSlot(o.$slots,"buttons")])])],32)])],32))}},tr=["aria-label"],or=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1),rr=[or],ar={name:"Message"},D=Object.assign(ar,{props:{error:{type:Boolean,default:!1}},emits:["hidden"],setup(d,{emit:t}){var i;const o=t,a=e.inject("ServiceContainer"),{t:r}=a.i18n,l=e.ref(!1),c=e.ref(null),s=e.ref((i=c.value)==null?void 0:i.strMessage);e.watch(s,()=>l.value=!1);const n=()=>{o("hidden"),l.value=!0};return(p,f)=>(e.openBlock(),e.createElementBlock("div",null,[l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"strMessage",ref:c,class:e.normalizeClass(["flex mt-2 p-1 px-2 rounded text-sm break-all dark:opacity-75",d.error?"bg-red-100 text-red-600 ":"bg-emerald-100 text-emerald-600"])},[e.renderSlot(p.$slots,"default"),e.createElementVNode("div",{class:"ml-auto cursor-pointer",onClick:n,"aria-label":e.unref(r)("Close"),"data-microtip-position":"top-left",role:"tooltip"},rr,8,tr)],2))]))}}),nr={class:"sm:flex sm:items-start"},lr=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-red-600 dark:stroke-red-200",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})])],-1),sr={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ir={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},cr={class:"mt-2"},dr={class:"text-sm text-gray-500"},ur={class:"text-gray-500 text-sm mb-1 overflow-auto vf-scrollbar",style:{"max-height":"200px"}},mr={class:"flex text-sm text-gray-800 dark:text-gray-400"},pr={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},fr=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),vr=[fr],hr={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},gr=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),kr=[gr],yr={class:"ml-1.5"},_r={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},xr={name:"VFModalDelete"},wr=Object.assign(xr,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(t.modal.data.items),r=e.ref(""),l=()=>{a.value.length&&t.emitter.emit("vf-fetch",{params:{q:"delete",m:"post",adapter:t.adapter,path:t.data.dirname},body:{items:a.value.map(({path:c,type:s})=>({path:c,type:s}))},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("Files deleted.")})},onError:c=>{r.value=o(c.message)}})};return(c,s)=>(e.openBlock(),e.createBlock(C,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l,class:"vf-btn vf-btn-danger"},e.toDisplayString(e.unref(o)("Yes, Delete!")),1),e.createElementVNode("button",{type:"button",onClick:s[1]||(s[1]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1),e.createElementVNode("div",_r,e.toDisplayString(e.unref(o)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",nr,[lr,e.createElementVNode("div",sr,[e.createElementVNode("h3",ir,e.toDisplayString(e.unref(o)("Delete files")),1),e.createElementVNode("div",cr,[e.createElementVNode("p",dr,e.toDisplayString(e.unref(o)("Are you sure you want to delete these files?")),1),e.createElementVNode("div",ur,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,n=>(e.openBlock(),e.createElementBlock("p",mr,[n.type==="dir"?(e.openBlock(),e.createElementBlock("svg",pr,vr)):(e.openBlock(),e.createElementBlock("svg",hr,kr)),e.createElementVNode("span",yr,e.toDisplayString(n.basename),1)]))),256))]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:s[0]||(s[0]=n=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),br={class:"sm:flex sm:items-start"},Er=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1),Vr={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Nr={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},$r={class:"mt-2"},Br={class:"text-sm text-gray-500"},Sr={name:"VFModalMessage"},Cr=Object.assign(Sr,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n;return(a,r)=>(e.openBlock(),e.createBlock(C,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:r[0]||(r[0]=l=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Close")),1)]),default:e.withCtx(()=>{var l,c;return[e.createElementVNode("div",br,[Er,e.createElementVNode("div",Vr,[e.createElementVNode("h3",Nr,e.toDisplayString(((l=e.unref(t).modal.data)==null?void 0:l.title)??"Title"),1),e.createElementVNode("div",$r,[e.createElementVNode("p",Br,e.toDisplayString(((c=e.unref(t).modal.data)==null?void 0:c.message)??"Message"),1)])])])]}),_:1}))}}),Dr={class:"sm:flex sm:items-start"},Mr=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})])],-1),jr={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Tr={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Fr={class:"mt-2"},Lr={class:"text-sm text-gray-500"},zr=["placeholder"],Ar={name:"VFModalNewFolder"},Or=Object.assign(Ar,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(""),r=e.ref(""),l=()=>{a.value!=""&&t.emitter.emit("vf-fetch",{params:{q:"newfolder",m:"post",adapter:t.adapter,path:t.data.dirname},body:{name:a.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("%s is created.",a.value)})},onError:c=>{r.value=o(c.message)}})};return(c,s)=>(e.openBlock(),e.createBlock(C,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Create")),1),e.createElementVNode("button",{type:"button",onClick:s[2]||(s[2]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Dr,[Mr,e.createElementVNode("div",jr,[e.createElementVNode("h3",Tr,e.toDisplayString(e.unref(o)("New Folder")),1),e.createElementVNode("div",Fr,[e.createElementVNode("p",Lr,e.toDisplayString(e.unref(o)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=n=>a.value=n),onKeyup:e.withKeys(l,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(o)("Folder Name"),type:"text"},null,40,zr),[[e.vModelText,a.value]]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:s[1]||(s[1]=n=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Ur={class:"sm:flex sm:items-start"},Hr=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})])],-1),qr={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Rr={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ir={class:"mt-2"},Pr={class:"text-sm text-gray-500"},Wr=["placeholder"],Gr={name:"VFModalNewFile"},Yr=Object.assign(Gr,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(""),r=e.ref(""),l=()=>{a.value!=""&&t.emitter.emit("vf-fetch",{params:{q:"newfile",m:"post",adapter:t.adapter,path:t.data.dirname},body:{name:a.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("%s is created.",a.value)})},onError:c=>{r.value=o(c.message)}})};return(c,s)=>(e.openBlock(),e.createBlock(C,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Create")),1),e.createElementVNode("button",{type:"button",onClick:s[2]||(s[2]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Ur,[Hr,e.createElementVNode("div",qr,[e.createElementVNode("h3",Rr,e.toDisplayString(e.unref(o)("New File")),1),e.createElementVNode("div",Ir,[e.createElementVNode("p",Pr,e.toDisplayString(e.unref(o)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=n=>a.value=n),onKeyup:e.withKeys(l,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(o)("File Name"),type:"text"},null,40,Wr),[[e.vModelText,a.value]]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:s[1]||(s[1]=n=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Kr={class:"flex"},Jr=["aria-label"],Xr={class:"ml-auto mb-2"},Qr={key:0,class:"p-2 border font-normal whitespace-pre-wrap border-gray-200 dark:border-gray-700/50 dark:text-gray-200 rounded min-h-[200px] max-h-[60vh] text-xs overflow-auto"},Zr={key:1},ea={__name:"Text",emits:["success"],setup(d,{emit:t}){const o=t,a=e.ref(""),r=e.ref(""),l=e.ref(null),c=e.ref(!1),s=e.ref(""),n=e.ref(!1),i=e.inject("ServiceContainer"),{t:p}=i.i18n;e.onMounted(()=>{i.requester.send({url:"",method:"get",params:{q:"preview",adapter:i.modal.data.adapter,path:i.modal.data.item.path},responseType:"text"}).then(h=>{a.value=h,o("success")})});const f=()=>{c.value=!c.value,r.value=a.value,c.value==!0&&e.nextTick(()=>{l.value.focus()})},y=()=>{s.value="",n.value=!1,i.requester.send({url:"",method:"post",params:{q:"save",adapter:i.modal.data.adapter,path:i.modal.data.item.path},body:{content:r.value},responseType:"text"}).then(h=>{s.value=p("Updated."),a.value=h,o("success"),c.value=!c.value}).catch(h=>{s.value=p(h.message),n.value=!0})};return(h,x)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Kr,[e.createElementVNode("div",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(i).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(i).modal.data.item.basename),9,Jr),e.createElementVNode("div",Xr,[c.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:y,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(p)("Save")),1)):e.createCommentVNode("",!0),e.unref(i).features.includes(e.unref($).EDIT)?(e.openBlock(),e.createElementBlock("button",{key:1,class:"ml-1 px-2 py-1 text-blue-500",onClick:x[0]||(x[0]=_=>f())},e.toDisplayString(c.value?e.unref(p)("Cancel"):e.unref(p)("Edit")),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",null,[c.value?(e.openBlock(),e.createElementBlock("div",Zr,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:l,"onUpdate:modelValue":x[1]||(x[1]=_=>r.value=_),class:"w-full p-2 rounded dark:bg-gray-700 dark:text-gray-200 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:selection:bg-gray-500 min-h-[200px] max-h-[60vh] text-xs",name:"text",id:"",cols:"30",rows:"10"},null,512),[[e.vModelText,r.value]])])):(e.openBlock(),e.createElementBlock("pre",Qr,e.toDisplayString(a.value),1)),s.value.length?(e.openBlock(),e.createBlock(D,{key:2,onHidden:x[2]||(x[2]=_=>s.value=""),error:n.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)])],64))}},ta={class:"flex"},oa=["aria-label"],ra={class:"ml-auto mb-2"},aa={class:"w-full flex justify-center"},na=["src"],la={__name:"Image",emits:["success"],setup(d,{emit:t}){const o=t,a=e.inject("ServiceContainer"),{t:r}=a.i18n,l=e.ref(null),c=e.ref(null),s=e.ref(!1),n=e.ref(""),i=e.ref(!1),p=()=>{s.value=!s.value,s.value?c.value=new te(l.value,{crop(y){}}):c.value.destroy()},f=()=>{c.value.getCroppedCanvas({width:795,height:341}).toBlob(y=>{n.value="",i.value=!1;const h=new FormData;h.set("file",y),a.requester.send({url:"",method:"post",params:{q:"upload",adapter:a.modal.data.adapter,path:a.modal.data.item.path},body:h}).then(x=>{n.value=r("Updated."),l.value.src=a.requester.getPreviewUrl(a.modal.data.adapter,a.modal.data.item),p(),o("success")}).catch(x=>{n.value=r(x.message),i.value=!0})})};return e.onMounted(()=>{o("success")}),(y,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",ta,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(a).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(a).modal.data.item.basename),9,oa),e.createElementVNode("div",ra,[s.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:f,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(r)("Crop")),1)):e.createCommentVNode("",!0),e.unref(a).features.includes(e.unref($).EDIT)?(e.openBlock(),e.createElementBlock("button",{key:1,class:"ml-1 px-2 py-1 text-blue-500",onClick:h[0]||(h[0]=x=>p())},e.toDisplayString(s.value?e.unref(r)("Cancel"):e.unref(r)("Edit")),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",aa,[e.createElementVNode("img",{ref_key:"image",ref:l,class:"max-w-[50vh] max-h-[50vh]",src:e.unref(a).requester.getPreviewUrl(e.unref(a).modal.data.adapter,e.unref(a).modal.data.item),alt:""},null,8,na)]),n.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:h[1]||(h[1]=x=>n.value=""),error:i.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)],64))}},sa={class:"flex"},ia=["aria-label"],ca=e.createElementVNode("div",null,null,-1),da={__name:"Default",emits:["success"],setup(d,{emit:t}){const o=e.inject("ServiceContainer"),a=t;return e.onMounted(()=>{a("success")}),(r,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",sa,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(o).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(o).modal.data.item.basename),9,ia)]),ca],64))}},ua=["aria-label"],ma={class:"w-full",preload:"",controls:""},pa=["src"],fa={__name:"Video",emits:["success"],setup(d,{emit:t}){const o=e.inject("ServiceContainer"),a=t,r=()=>o.requester.getPreviewUrl(o.modal.data.adapter,o.modal.data.item);return e.onMounted(()=>{a("success")}),(l,c)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(o).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(o).modal.data.item.basename),9,ua),e.createElementVNode("div",null,[e.createElementVNode("video",ma,[e.createElementVNode("source",{src:r(),type:"video/mp4"},null,8,pa),e.createTextVNode(" Your browser does not support the video tag. ")])])]))}},va=["aria-label"],ha={class:"w-full",controls:""},ga=["src"],ka={__name:"Audio",emits:["success"],setup(d,{emit:t}){const o=t,a=e.inject("ServiceContainer"),r=()=>a.requester.getPreviewUrl(a.modal.data.adapter,a.modal.data.item);return e.onMounted(()=>{o("success")}),(l,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(a).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(a).modal.data.item.basename),9,va),e.createElementVNode("div",null,[e.createElementVNode("audio",ha,[e.createElementVNode("source",{src:r(),type:"audio/mpeg"},null,8,ga),e.createTextVNode(" Your browser does not support the audio element. ")])])],64))}},ya=["aria-label"],_a=["data"],xa=["src"],wa=e.createElementVNode("p",null,[e.createTextVNode(" Your browser does not support PDFs. "),e.createElementVNode("a",{href:"https://example.com/test.pdf"},"Download the PDF"),e.createTextVNode(" . ")],-1),ba=[wa],Ea={__name:"Pdf",emits:["success"],setup(d,{emit:t}){const o=e.inject("ServiceContainer"),a=t,r=()=>o.requester.getPreviewUrl(o.modal.data.adapter,o.modal.data.item);return e.onMounted(()=>{a("success")}),(l,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(o).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(o).modal.data.item.basename),9,ya),e.createElementVNode("div",null,[e.createElementVNode("object",{class:"h-[60vh]",data:r(),type:"application/pdf",width:"100%",height:"100%"},[e.createElementVNode("iframe",{class:"border-0",src:r(),width:"100%",height:"100%"},ba,8,xa)],8,_a)])],64))}},Va={class:"sm:flex sm:items-start"},Na={class:"mt-3 text-center sm:mt-0 sm:text-left w-full"},$a={key:0},Ba={class:"text-gray-700 dark:text-gray-200 text-sm"},Sa={key:0,class:"flex leading-5"},Ca=e.createElementVNode("svg",{class:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1),Da={class:"py-2 flex font-normal break-all dark:text-gray-200 rounded text-xs"},Ma={class:"font-bold"},ja={class:"font-bold pl-2"},Ta={key:0,class:"text-xs text-gray-600 dark:text-gray-400"},Fa=["download","href"],La={name:"VFModalPreview"},za=Object.assign(La,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,a=e.ref(!1),r=c=>(t.modal.data.item.mime_type??"").startsWith(c),l=t.features.includes($.PREVIEW);return l||(a.value=!0),(c,s)=>(e.openBlock(),e.createBlock(C,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:s[6]||(s[6]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Close")),1),e.unref(t).features.includes(e.unref($).DOWNLOAD)?(e.openBlock(),e.createElementBlock("a",{key:0,target:"_blank",class:"vf-btn vf-btn-primary",download:e.unref(t).requester.getDownloadUrl(e.unref(t).modal.data.adapter,e.unref(t).modal.data.item),href:e.unref(t).requester.getDownloadUrl(e.unref(t).modal.data.adapter,e.unref(t).modal.data.item)},e.toDisplayString(e.unref(o)("Download")),9,Fa)):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("div",Va,[e.createElementVNode("div",Na,[e.unref(l)?(e.openBlock(),e.createElementBlock("div",$a,[r("text")?(e.openBlock(),e.createBlock(ea,{key:0,onSuccess:s[0]||(s[0]=n=>a.value=!0)})):r("image")?(e.openBlock(),e.createBlock(la,{key:1,onSuccess:s[1]||(s[1]=n=>a.value=!0)})):r("video")?(e.openBlock(),e.createBlock(fa,{key:2,onSuccess:s[2]||(s[2]=n=>a.value=!0)})):r("audio")?(e.openBlock(),e.createBlock(ka,{key:3,onSuccess:s[3]||(s[3]=n=>a.value=!0)})):r("application/pdf")?(e.openBlock(),e.createBlock(Ea,{key:4,onSuccess:s[4]||(s[4]=n=>a.value=!0)})):(e.openBlock(),e.createBlock(da,{key:5,onSuccess:s[5]||(s[5]=n=>a.value=!0)}))])):e.createCommentVNode("",!0),e.createElementVNode("div",Ba,[a.value===!1?(e.openBlock(),e.createElementBlock("div",Sa,[Ca,e.createElementVNode("span",null,e.toDisplayString(e.unref(o)("Loading")),1)])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",Da,[e.createElementVNode("div",null,[e.createElementVNode("span",Ma,e.toDisplayString(e.unref(o)("File Size"))+": ",1),e.createTextVNode(e.toDisplayString(e.unref(t).filesize(e.unref(t).modal.data.item.file_size)),1)]),e.createElementVNode("div",null,[e.createElementVNode("span",ja,e.toDisplayString(e.unref(o)("Last Modified"))+": ",1),e.createTextVNode(" "+e.toDisplayString(e.unref(Y)(e.unref(t).modal.data.item.last_modified)),1)])]),e.unref(t).features.includes(e.unref($).DOWNLOAD)?(e.openBlock(),e.createElementBlock("div",Ta,[e.createElementVNode("span",null,e.toDisplayString(e.unref(o)(`Download doesn't work? You can try right-click "Download" button, select "Save link as...".`)),1)])):e.createCommentVNode("",!0)]),_:1}))}}),Aa={class:"sm:flex sm:items-start"},Oa=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})])],-1),Ua={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ha={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},qa={class:"mt-2"},Ra={class:"flex text-sm text-gray-800 dark:text-gray-400 py-2"},Ia={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Pa=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),Wa=[Pa],Ga={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Ya=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),Ka=[Ya],Ja={class:"ml-1.5"},Xa={name:"VFModalRename"},Qa=Object.assign(Xa,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(t.modal.data.items[0]),r=e.ref(t.modal.data.items[0].basename),l=e.ref(""),c=()=>{r.value!=""&&t.emitter.emit("vf-fetch",{params:{q:"rename",m:"post",adapter:t.adapter,path:t.data.dirname},body:{item:a.value.path,name:r.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("%s is renamed.",r.value)})},onError:s=>{l.value=o(s.message)}})};return(s,n)=>(e.openBlock(),e.createBlock(C,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Rename")),1),e.createElementVNode("button",{type:"button",onClick:n[2]||(n[2]=i=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Aa,[Oa,e.createElementVNode("div",Ua,[e.createElementVNode("h3",Ha,e.toDisplayString(e.unref(o)("Rename")),1),e.createElementVNode("div",qa,[e.createElementVNode("p",Ra,[a.value.type==="dir"?(e.openBlock(),e.createElementBlock("svg",Ia,Wa)):(e.openBlock(),e.createElementBlock("svg",Ga,Ka)),e.createElementVNode("span",Ja,e.toDisplayString(a.value.basename),1)]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=i=>r.value=i),onKeyup:e.withKeys(c,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:"Name",type:"text"},null,544),[[e.vModelText,r.value]]),l.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:n[1]||(n[1]=i=>l.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Za={class:"sm:flex sm:items-start"},en=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})])],-1),tn={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},on={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},rn={class:"mt-2"},an={key:0,class:"pointer-events-none"},nn={key:1,class:"pointer-events-none"},ln=["disabled"],sn=["disabled"],cn={class:"text-gray-500 text-sm mb-1 pr-1 max-h-[200px] overflow-y-auto vf-scrollbar"},dn={class:"rounded flex flex-shrink-0 w-6 h-6 border bg-gray-50 text-xs cursor-default dark:border-gray-700 dark:bg-gray-800 dark:text-gray-50"},un=["textContent"],mn={class:"ml-1 w-full h-fit"},pn={class:"text-left hidden md:block"},fn={class:"text-left md:hidden"},vn={key:0,class:"ml-auto"},hn=["title","disabled","onClick"],gn=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1),kn=[gn],yn={key:0,class:"py-2"},_n=["disabled"],xn={name:"VFModalUpload"},wn=Object.assign(xn,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,a=o("uppy"),r={PENDING:0,CANCELED:1,UPLOADING:2,ERROR:3,DONE:10},l=e.ref({QUEUE_ENTRY_STATUS:r}),c=e.ref(null),s=e.ref(null),n=e.ref(null),i=e.ref(null),p=e.ref(null),f=e.ref(null),y=e.ref([]),h=e.ref(""),x=e.ref(!1),_=e.ref(!1);let v;function m(u){return y.value.findIndex(E=>E.id===u)}function N(u,E=null){E=E??(u.webkitRelativePath||u.name),v.addFile({name:E,type:u.type,data:u,source:"Local"})}function S(u){switch(u.status){case r.DONE:return"text-green-600";case r.ERROR:return"text-red-600";case r.CANCELED:return"text-red-600";case r.PENDING:default:return""}}const M=u=>{switch(u.status){case r.DONE:return"✓";case r.ERROR:case r.CANCELED:return"!";case r.PENDING:default:return"..."}};function F(){i.value.click()}function L(){if(!x.value){if(!y.value.filter(u=>u.status!==r.DONE).length){h.value=o("Please select file to upload first.");return}h.value="",v.retryAll(),v.upload()}}function z(){v.cancelAll({reason:"user"}),y.value.forEach(u=>{u.status!==r.DONE&&(u.status=r.CANCELED,u.statusName=o("Canceled"))}),x.value=!1}function A(u){x.value||(v.removeFile(u.id,"removed-by-user"),y.value.splice(m(u.id),1))}function k(u){if(!x.value){if(v.cancelAll({reason:"user"}),u){const E=[];y.value.forEach(g=>{g.status!==r.DONE&&E.push(g)}),y.value=[],E.forEach(g=>{N(g.originalFile,g.name)});return}y.value.splice(0)}}function b(){t.emitter.emit("vf-modal-close")}return e.onMounted(async()=>{v=new oe({debug:t.debug,restrictions:{maxFileSize:ue(t.maxFileSize)},locale:a,onBeforeFileAdded(w,V){if(V[w.id]!=null){const T=m(w.id);y.value[T].status===r.PENDING&&(h.value=v.i18n("noDuplicates",{fileName:w.name})),y.value=y.value.filter(U=>U.id!==w.id)}return y.value.push({id:w.id,name:w.name,size:t.filesize(w.size),status:r.PENDING,statusName:o("Pending upload"),percent:null,originalFile:w.data}),!0}});const u=t.requester.transformRequestParams({url:"",method:"post",params:{q:"upload",adapter:t.data.adapter,path:t.data.dirname}});t.debug&&u.body!=null&&(u.body instanceof FormData||Object.keys(u.body).length>0)&&console.warn(`Cannot set body on upload, make sure request.transformRequest didn't set body when upload.
|
|
2
|
-
Will ignore for now.`),v.use(re,{method:u.method,endpoint:u.url+"?"+new URLSearchParams(u.params),headers:u.headers,limit:5,timeout:0,getResponseError(w,V){let B;try{B=JSON.parse(w).message}catch{B=o("Cannot parse server response.")}return new Error(B)}}),v.on("restriction-failed",(w,V)=>{const B=y.value[m(w.id)];A(B),h.value=V.message}),v.on("upload",()=>{x.value=!0,y.value.forEach(w=>{w.status!==r.DONE&&(w.percent=null,w.status=r.UPLOADING,w.statusName=o("Pending upload"))})}),v.on("upload-progress",(w,V)=>{const B=Math.floor(V.bytesUploaded/V.bytesTotal*100);y.value[m(w.id)].percent=`${B}%`}),v.on("upload-success",w=>{const V=y.value[m(w.id)];V.status=r.DONE,V.statusName=o("Done")}),v.on("upload-error",(w,V)=>{const B=y.value[m(w.id)];B.percent=null,B.status=r.ERROR,V.isNetworkError?B.statusName=o("Network Error, Unable establish connection to the server or interrupted."):B.statusName=V?V.message:o("Unknown Error")}),v.on("error",w=>{h.value=w.message,x.value=!1,t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname},noCloseModal:!0})}),v.on("complete",()=>{x.value=!1,t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname},noCloseModal:!0})}),i.value.addEventListener("click",()=>{s.value.click()}),p.value.addEventListener("click",()=>{n.value.click()}),f.value.addEventListener("dragover",w=>{w.preventDefault(),_.value=!0}),f.value.addEventListener("dragleave",w=>{w.preventDefault(),_.value=!1});function E(w,V){V.isFile&&V.file(B=>w(V,B)),V.isDirectory&&V.createReader().readEntries(B=>{B.forEach(T=>{E(w,T)})})}f.value.addEventListener("drop",w=>{w.preventDefault(),_.value=!1;const V=/^[/\\](.+)/;[...w.dataTransfer.items].forEach(B=>{B.kind==="file"&&E((T,U)=>{const K=V.exec(T.fullPath);N(U,K[1])},B.webkitGetAsEntry())})});const g=({target:w})=>{const V=w.files;for(const B of V)N(B);w.value=""};s.value.addEventListener("change",g),n.value.addEventListener("change",g)}),e.onBeforeUnmount(()=>{v==null||v.close({reason:"unmount"})}),(u,E)=>(e.openBlock(),e.createBlock(C,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["vf-btn vf-btn-primary",x.value?"bg-blue-200 hover:bg-blue-200 dark:bg-gray-700/50 dark:hover:bg-gray-700/50 dark:text-gray-500":"bg-blue-600 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-500"]),disabled:x.value,onClick:e.withModifiers(L,["prevent"])},e.toDisplayString(e.unref(o)("Upload")),11,_n),x.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"vf-btn vf-btn-secondary",onClick:e.withModifiers(z,["prevent"])},e.toDisplayString(e.unref(o)("Cancel")),1)):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"vf-btn vf-btn-secondary",onClick:e.withModifiers(b,["prevent"])},e.toDisplayString(e.unref(o)("Close")),1))]),default:e.withCtx(()=>[e.createElementVNode("div",Za,[en,e.createElementVNode("div",tn,[e.createElementVNode("h3",on,e.toDisplayString(e.unref(o)("Upload Files")),1),e.createElementVNode("div",rn,[e.createElementVNode("div",{ref_key:"dropArea",ref:f,class:"flex items-center justify-center text-lg mb-4 text-gray-500 border-2 border-gray-300 rounded border-dashed select-none cursor-pointer dark:border-gray-600 h-[120px]",onClick:F},[_.value?(e.openBlock(),e.createElementBlock("div",an,e.toDisplayString(e.unref(o)("Release to drop these files.")),1)):(e.openBlock(),e.createElementBlock("div",nn,e.toDisplayString(e.unref(o)("Drag and drop the files/folders to here or click here.")),1))],512),e.createElementVNode("div",{ref_key:"container",ref:c,class:"text-gray-500 mb-1"},[e.createElementVNode("button",{ref_key:"pickFiles",ref:i,type:"button",class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Select Files")),513),e.createElementVNode("button",{ref_key:"pickFolders",ref:p,type:"button",class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Select Folders")),513),e.createElementVNode("button",{type:"button",class:"vf-btn vf-btn-secondary",disabled:x.value,onClick:E[0]||(E[0]=g=>k(!1))},e.toDisplayString(e.unref(o)("Clear all")),9,ln),e.createElementVNode("button",{type:"button",class:"vf-btn vf-btn-secondary",disabled:x.value,onClick:E[1]||(E[1]=g=>k(!0))},e.toDisplayString(e.unref(o)("Clear only successful")),9,sn)],512),e.createElementVNode("div",cn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,g=>(e.openBlock(),e.createElementBlock("div",{class:"flex hover:bg-gray-100 dark:hover:bg-gray-800 dark:hover:text-gray-300",key:g.id},[e.createElementVNode("span",dn,[e.createElementVNode("span",{class:e.normalizeClass(["text-base m-auto",S(g)]),textContent:e.toDisplayString(M(g))},null,10,un)]),e.createElementVNode("div",mn,[e.createElementVNode("div",pn,e.toDisplayString(e.unref(R)(g.name,40))+" ("+e.toDisplayString(g.size)+")",1),e.createElementVNode("div",fn,e.toDisplayString(e.unref(R)(g.name,16))+" ("+e.toDisplayString(g.size)+")",1),e.createElementVNode("div",{class:e.normalizeClass(["flex break-all text-left",S(g)])},[e.createTextVNode(e.toDisplayString(g.statusName)+" ",1),g.status===l.value.QUEUE_ENTRY_STATUS.UPLOADING?(e.openBlock(),e.createElementBlock("b",vn,e.toDisplayString(g.percent),1)):e.createCommentVNode("",!0)],2)]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["rounded w-5 h-5 border-1 text-base leading-none font-medium focus:outline-none dark:border-gray-200 dark:text-gray-400 dark:hover:text-gray-200 dark:bg-gray-600 ml-auto sm:text-xs hover:text-red-600",x.value?"disabled:bg-gray-100 text-white text-opacity-50":"bg-gray-100"]),title:e.unref(o)("Delete"),disabled:x.value,onClick:w=>A(g)},kn,10,hn)]))),128)),y.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",yn,e.toDisplayString(e.unref(o)("No files selected!")),1))]),h.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:E[2]||(E[2]=g=>h.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.value),1)]),_:1})):e.createCommentVNode("",!0)])])]),e.createElementVNode("input",{ref_key:"internalFileInput",ref:s,type:"file",multiple:"",class:"hidden"},null,512),e.createElementVNode("input",{ref_key:"internalFolderInput",ref:n,type:"file",multiple:"",webkitdirectory:"",class:"hidden"},null,512)]),_:1}))}}),bn={class:"sm:flex sm:items-start"},En=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"})])],-1),Vn={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Nn={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},$n={class:"mt-2"},Bn={class:"text-gray-500 text-sm mb-1 overflow-auto vf-scrollbar",style:{"max-height":"200px"}},Sn={class:"flex text-sm text-gray-800 dark:text-gray-400"},Cn={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Dn=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),Mn=[Dn],jn={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Tn=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),Fn=[Tn],Ln={class:"ml-1.5"},zn=["placeholder"],An={name:"VFModalArchive"},On=Object.assign(An,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(""),r=e.ref(""),l=e.ref(t.modal.data.items),c=()=>{l.value.length&&t.emitter.emit("vf-fetch",{params:{q:"archive",m:"post",adapter:t.adapter,path:t.data.dirname},body:{items:l.value.map(({path:s,type:n})=>({path:s,type:n})),name:a.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("The file(s) archived.")})},onError:s=>{r.value=o(s.message)}})};return(s,n)=>(e.openBlock(),e.createBlock(C,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Archive")),1),e.createElementVNode("button",{type:"button",onClick:n[2]||(n[2]=i=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",bn,[En,e.createElementVNode("div",Vn,[e.createElementVNode("h3",Nn,e.toDisplayString(e.unref(o)("Archive the files")),1),e.createElementVNode("div",$n,[e.createElementVNode("div",Bn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,i=>(e.openBlock(),e.createElementBlock("p",Sn,[i.type==="dir"?(e.openBlock(),e.createElementBlock("svg",Cn,Mn)):(e.openBlock(),e.createElementBlock("svg",jn,Fn)),e.createElementVNode("span",Ln,e.toDisplayString(i.basename),1)]))),256))]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=i=>a.value=i),onKeyup:e.withKeys(c,["enter"]),class:"my-1 px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(o)("Archive name. (.zip file will be created)"),type:"text"},null,40,zn),[[e.vModelText,a.value]]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:n[1]||(n[1]=i=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Un={class:"sm:flex sm:items-start"},Hn=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5m6 4.125l2.25 2.25m0 0l2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"})])],-1),qn={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Rn={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},In={class:"mt-2"},Pn={class:"flex text-sm text-gray-800 dark:text-gray-400"},Wn={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Gn=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),Yn=[Gn],Kn={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Jn=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),Xn=[Jn],Qn={class:"ml-1.5"},Zn={class:"my-1 text-sm text-gray-500"},el={name:"VFModalUnarchive"},tl=Object.assign(el,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n;e.ref("");const a=e.ref(t.modal.data.items[0]),r=e.ref(""),l=e.ref([]),c=()=>{t.emitter.emit("vf-fetch",{params:{q:"unarchive",m:"post",adapter:t.adapter,path:t.data.dirname},body:{item:a.value.path},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("The file unarchived.")})},onError:s=>{r.value=o(s.message)}})};return(s,n)=>(e.openBlock(),e.createBlock(C,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Unarchive")),1),e.createElementVNode("button",{type:"button",onClick:n[1]||(n[1]=i=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Un,[Hn,e.createElementVNode("div",qn,[e.createElementVNode("h3",Rn,e.toDisplayString(e.unref(o)("Unarchive")),1),e.createElementVNode("div",In,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,i=>(e.openBlock(),e.createElementBlock("p",Pn,[i.type==="dir"?(e.openBlock(),e.createElementBlock("svg",Wn,Yn)):(e.openBlock(),e.createElementBlock("svg",Kn,Xn)),e.createElementVNode("span",Qn,e.toDisplayString(i.basename),1)]))),256)),e.createElementVNode("p",Zn,e.toDisplayString(e.unref(o)("The archive will be unarchived at"))+" ("+e.toDisplayString(s.current.dirname)+")",1),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:n[0]||(n[0]=i=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),ol={class:"sm:flex sm:items-start"},rl=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})])],-1),al={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},nl={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ll={class:"text-sm text-gray-500 pb-1"},sl={class:"max-h-[200px] overflow-y-auto vf-scrollbar text-left"},il={class:"flex text-sm text-gray-800 dark:text-gray-400"},cl={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},dl=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),ul=[dl],ml={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},pl=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),fl=[pl],vl={class:"ml-1.5"},hl={class:"font-bold text-xs text-gray-700 dark:text-gray-500 mt-3 tracking-wider"},gl={class:"flex text-sm text-gray-800 dark:text-gray-400 border dark:border-gray-700 p-1 rounded"},kl=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})],-1),yl={class:"ml-1.5 overflow-auto"},_l={class:"m-1 mr-auto font-bold text-gray-500 text-sm dark:text-gray-200 self-center"},xl={name:"VFModalMove"},wl=Object.assign(xl,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n;t.storage;const a=e.ref(t.modal.data.items.from),r=e.ref(""),l=()=>{a.value.length&&t.emitter.emit("vf-fetch",{params:{q:"move",m:"post",adapter:t.adapter,path:t.data.dirname},body:{items:a.value.map(({path:c,type:s})=>({path:c,type:s})),item:t.modal.data.items.to.path},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("Files moved.",t.modal.data.items.to.name)})},onError:c=>{r.value=o(c.message)}})};return(c,s)=>(e.openBlock(),e.createBlock(C,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Yes, Move!")),1),e.createElementVNode("button",{type:"button",onClick:s[1]||(s[1]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1),e.createElementVNode("div",_l,e.toDisplayString(e.unref(o)("%s item(s) selected.",a.value.length)),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ol,[rl,e.createElementVNode("div",al,[e.createElementVNode("h3",nl,e.toDisplayString(e.unref(o)("Move files")),1),e.createElementVNode("p",ll,e.toDisplayString(e.unref(o)("Are you sure you want to move these files?")),1),e.createElementVNode("div",sl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,n=>(e.openBlock(),e.createElementBlock("div",il,[e.createElementVNode("div",null,[n.type==="dir"?(e.openBlock(),e.createElementBlock("svg",cl,ul)):(e.openBlock(),e.createElementBlock("svg",ml,fl))]),e.createElementVNode("div",vl,e.toDisplayString(n.path),1)]))),256))]),e.createElementVNode("h4",hl,e.toDisplayString(e.unref(o)("Target Directory")),1),e.createElementVNode("p",gl,[kl,e.createElementVNode("span",yl,e.toDisplayString(e.unref(t).modal.data.items.to.path),1)]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:s[0]||(s[0]=n=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])]),_:1}))}}),bl=(d,t)=>{const o=d.__vccOpts||d;for(const[a,r]of t)o[a]=r;return o},El={props:{on:{type:String,required:!0}},setup(d,{emit:t,slots:o}){const a=e.inject("ServiceContainer"),r=e.ref(!1),{t:l}=a.i18n;let c=null;const s=()=>{clearTimeout(c),r.value=!0,c=setTimeout(()=>{r.value=!1},2e3)};return e.onMounted(()=>{a.emitter.on(d.on,s)}),e.onUnmounted(()=>{clearTimeout(c)}),{shown:r,t:l}}},Vl={key:1};function Nl(d,t,o,a,r,l){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["text-sm text-green-600 dark:text-green-600 transition-opacity duration-500 ease-out",[{"opacity-0":!a.shown}]])},[d.$slots.default?e.renderSlot(d.$slots,"default",{key:0}):(e.openBlock(),e.createElementBlock("span",Vl,e.toDisplayString(a.t("Saved.")),1))],2)}const q=bl(El,[["render",Nl]]),$l={class:"sm:flex sm:items-start"},Bl=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})])],-1),Sl={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Cl={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Dl={class:"mt-2"},Ml={class:"text-sm text-gray-500"},jl={class:"text-sm font-semibold mt-5 text-gray-900 dark:text-gray-400 tracking-wider"},Tl={class:"mt-3 text-left"},Fl={class:"space-y-2"},Ll={class:"flex relative gap-x-3"},zl={class:"h-6 items-center"},Al={class:"flex-1 block text-sm"},Ol={for:"metric_unit",class:"flex w-full font-medium text-gray-900 dark:text-gray-400"},Ul={class:"flex relative gap-x-3"},Hl={class:"h-6 items-center"},ql={for:"theme",class:"flex w-full font-medium text-gray-900 dark:text-gray-400 text-sm"},Rl={class:"flex text-sm"},Il=["label"],Pl=["value"],Wl={key:0,class:"flex relative gap-x-3"},Gl={class:"h-6 items-center"},Yl={for:"language",class:"flex w-full font-medium text-gray-900 dark:text-gray-400 text-sm text-nowrap"},Kl={class:"flex text-sm"},Jl=["label"],Xl=["value"],Ql={name:"VFModalAbout"},Zl=Object.assign(Ql,{setup(d){const t=e.inject("ServiceContainer"),{getStore:o,setStore:a,clearStore:r}=t.storage,{t:l,changeLocale:c,locale:s}=t.i18n;e.ref(""),e.ref("");const n=async()=>{r(),location.reload()},i=_=>{t.theme.set(_),t.emitter.emit("vf-theme-saved")},p=()=>{t.metricUnits=!t.metricUnits,t.filesize=t.metricUnits?G:W,a("metricUnits",t.metricUnits),t.emitter.emit("vf-metric-units-saved")},{i18n:f}=e.inject("VueFinderOptions"),h=Object.fromEntries(Object.entries({en:"English",fr:"French (Français)",de:"German (Deutsch)",fa:"Persian (فارسی)",he:"Hebrew (עִברִית)",hi:"Hindi (हिंदी)",ru:"Russian (Pусский)",sv:"Swedish (Svenska)",tr:"Turkish (Türkçe)",zhCN:"Simplified Chinese (简体中文)",zhTW:"Traditional Chinese (繁體中文)"}).filter(([_])=>Object.keys(f).includes(_))),x=e.computed(()=>({system:l("System"),light:l("Light"),dark:l("Dark")}));return(_,v)=>(e.openBlock(),e.createBlock(C,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:v[5]||(v[5]=m=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(l)("Close")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",$l,[Bl,e.createElementVNode("div",Sl,[e.createElementVNode("h3",Cl,e.toDisplayString(e.unref(l)("About %s","Vuefinder "+e.unref(t).version)),1),e.createElementVNode("div",Dl,[e.createElementVNode("p",Ml,e.toDisplayString(e.unref(l)("Vuefinder is a file manager component for vue 3.")),1),e.createElementVNode("div",null,[e.createElementVNode("h3",jl,e.toDisplayString(e.unref(l)("Settings")),1)]),e.createElementVNode("div",Tl,[e.createElementVNode("fieldset",null,[e.createElementVNode("div",Fl,[e.createElementVNode("div",Ll,[e.createElementVNode("div",zl,[e.withDirectives(e.createElementVNode("input",{id:"metric_unit",name:"metric_unit",type:"checkbox","onUpdate:modelValue":v[0]||(v[0]=m=>e.unref(t).metricUnits=m),onClick:p,class:"h-4 w-4 rounded border-gray-300 text-indigo-600 dark:accent-slate-400 focus:ring-indigo-600"},null,512),[[e.vModelCheckbox,e.unref(t).metricUnits]])]),e.createElementVNode("div",Al,[e.createElementVNode("label",Ol,[e.createTextVNode(e.toDisplayString(e.unref(l)("Use Metric Units"))+" ",1),e.createVNode(q,{class:"ms-3",on:"vf-metric-units-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("Saved.")),1)]),_:1})])])]),e.createElementVNode("div",Ul,[e.createElementVNode("div",Hl,[e.createElementVNode("label",ql,e.toDisplayString(e.unref(l)("Theme")),1)]),e.createElementVNode("div",Rl,[e.withDirectives(e.createElementVNode("select",{id:"theme","onUpdate:modelValue":v[1]||(v[1]=m=>e.unref(t).theme.value=m),onChange:v[2]||(v[2]=m=>i(m.target.value)),class:"flex-shrink-0 w-full text-sm text-slate-500 border dark:border-gray-600 dark:text-neutral-50 dark:bg-gray-700 rounded"},[e.createElementVNode("optgroup",{label:e.unref(l)("Theme")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(m,N)=>(e.openBlock(),e.createElementBlock("option",{value:N},e.toDisplayString(m),9,Pl))),256))],8,Il)],544),[[e.vModelSelect,e.unref(t).theme.value]]),e.createVNode(q,{class:"ms-3 flex-shrink-0 flex-grow basis-full",on:"vf-theme-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("Saved.")),1)]),_:1})])]),e.unref(t).features.includes(e.unref($).LANGUAGE)&&Object.keys(e.unref(h)).length>1?(e.openBlock(),e.createElementBlock("div",Wl,[e.createElementVNode("div",Gl,[e.createElementVNode("label",Yl,e.toDisplayString(e.unref(l)("Language")),1)]),e.createElementVNode("div",Kl,[e.withDirectives(e.createElementVNode("select",{id:"language","onUpdate:modelValue":v[3]||(v[3]=m=>e.isRef(s)?s.value=m:null),onChange:v[4]||(v[4]=m=>e.unref(c)(m.target.value)),class:"flex-shrink-0 w-1/2 sm:w-full text-sm text-slate-500 border dark:border-gray-600 dark:text-neutral-50 dark:bg-gray-700 rounded"},[e.createElementVNode("optgroup",{label:e.unref(l)("Language")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(h),(m,N)=>(e.openBlock(),e.createElementBlock("option",{value:N},e.toDisplayString(m),9,Xl))),256))],8,Jl)],544),[[e.vModelSelect,e.unref(s)]]),e.createVNode(q,{class:"ms-3 flex-shrink-0 flex-grow basis-full",on:"vf-language-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("Saved.")),1)]),_:1})])])):e.createCommentVNode("",!0),e.createElementVNode("button",{onClick:n,type:"button",class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(l)("Reset Settings")),1)])])])])])])]),_:1}))}}),es=Object.freeze(Object.defineProperty({__proto__:null,ModalAbout:Zl,ModalArchive:On,ModalDelete:wr,ModalMessage:Cr,ModalMove:wl,ModalNewFile:Yr,ModalNewFolder:Or,ModalPreview:za,ModalRename:Qa,ModalUnarchive:tl,ModalUpload:wn},Symbol.toStringTag,{value:"Module"})),ts={install(d,t={}){d.component("VueFinder",Ko);for(const a of Object.values(es))d.component(a.name,a);t.i18n=t.i18n??{};let[o]=Object.keys(t.i18n);t.locale=t.locale??o??"en",d.provide("VueFinderOptions",t)}};module.exports=ts;
|
|
1
|
+
"use strict";var J=Object.defineProperty;var X=(d,t,o)=>t in d?J(d,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):d[t]=o;var I=(d,t,o)=>(X(d,typeof t!="symbol"?t+"":t,o),o);const e=require("vue"),Q=require("mitt"),Z=require("dragselect"),ee=require("vanilla-lazyload");require("cropperjs/dist/cropper.css");const te=require("cropperjs"),oe=require("@uppy/core"),re=require("@uppy/xhr-upload");require("microtip/microtip.css");var P;const H=(P=document.querySelector('meta[name="csrf-token"]'))==null?void 0:P.getAttribute("content");class ae{constructor(t){I(this,"config");this.config=t}get config(){return this.config}transformRequestParams(t){const o=this.config,a={};H!=null&&H!==""&&(a[o.xsrfHeaderName]=H);const r=Object.assign({},o.headers,a,t.headers),l=Object.assign({},o.params,t.params),c=t.body,s=o.baseUrl+t.url,n=t.method;let i;n!=="get"&&(c instanceof FormData?(i=c,o.body!=null&&Object.entries(this.config.body).forEach(([f,k])=>{i.append(f,k)})):(i={...c},o.body!=null&&Object.assign(i,this.config.body)));const p={url:s,method:n,headers:r,params:l,body:i};if(o.transformRequest!=null){const f=o.transformRequest({url:s,method:n,headers:r,params:l,body:i});f.url!=null&&(p.url=f.url),f.method!=null&&(p.method=f.method),f.params!=null&&(p.params=f.params??{}),f.headers!=null&&(p.headers=f.headers??{}),f.body!=null&&(p.body=f.body)}return p}getDownloadUrl(t,o){if(o.url!=null)return o.url;const a=this.transformRequestParams({url:"",method:"get",params:{q:"download",adapter:t,path:o.path}});return a.url+"?"+new URLSearchParams(a.params).toString()}getPreviewUrl(t,o){if(o.url!=null)return o.url;const a=this.transformRequestParams({url:"",method:"get",params:{q:"preview",adapter:t,path:o.path}});return a.url+"?"+new URLSearchParams(a.params).toString()}async send(t){const o=this.transformRequestParams(t),a=t.responseType||"json",r={method:t.method,headers:o.headers,signal:t.abortSignal},l=o.url+"?"+new URLSearchParams(o.params);if(o.method!=="get"&&o.body!=null){let s;o.body instanceof FormData?s=t.body:(s=JSON.stringify(o.body),r.headers["Content-Type"]="application/json"),r.body=s}const c=await fetch(l,r);if(c.ok)return await c[a]();throw await c.json()}}function ne(d){const t={baseUrl:"",headers:{},params:{},body:{},xsrfHeaderName:"X-CSRF-Token"};return typeof d=="string"?Object.assign(t,{baseUrl:d}):Object.assign(t,d),new ae(t)}function le(d){let t=localStorage.getItem(d+"_storage");const o=e.reactive(JSON.parse(t??"{}"));e.watch(o,a);function a(){Object.keys(o).length?localStorage.setItem(d+"_storage",JSON.stringify(o)):localStorage.removeItem(d+"_storage")}function r(n,i){o[n]=i}function l(n){delete o[n]}function c(){Object.keys(o).map(n=>l(n))}return{getStore:(n,i=null)=>o.hasOwnProperty(n)?o[n]:i,setStore:r,removeStore:l,clearStore:c}}async function se(d,t){const o=t[d];return typeof o=="function"?(await o()).default:o}function ie(d,t,o,a){const{getStore:r,setStore:l}=d,c=e.ref({}),s=e.ref(r("locale",t)),n=(f,k=t)=>{se(f,a).then(h=>{c.value=h,l("locale",f),s.value=f,l("translations",h),Object.values(a).length>1&&(o.emit("vf-toast-push",{label:"The language is set to "+f}),o.emit("vf-language-saved"))}).catch(h=>{k?(o.emit("vf-toast-push",{label:"The selected locale is not yet supported!",type:"error"}),n(k,null)):o.emit("vf-toast-push",{label:"Locale cannot be loaded!",type:"error"})})};!r("locale")&&!a.length?n(t):c.value=r("translations");const i=(f,...k)=>k.length?i(f=f.replace("%s",k.shift()),...k):f;function p(f,...k){return c.value&&c.value.hasOwnProperty(f)?i(c.value[f],...k):i(f,...k)}return{t:p,changeLocale:n,locale:s}}const B={EDIT:"edit",NEW_FILE:"newfile",NEW_FOLDER:"newfolder",PREVIEW:"preview",ARCHIVE:"archive",UNARCHIVE:"unarchive",SEARCH:"search",RENAME:"rename",UPLOAD:"upload",DELETE:"delete",FULL_SCREEN:"fullscreen",DOWNLOAD:"download",LANGUAGE:"language"},ce=Object.values(B),de="2.2.1";function W(d,t,o,a,r){return(t=Math,o=t.log,a=1024,r=o(d)/o(a)|0,d/t.pow(a,r)).toFixed(0)+" "+(r?"KMGTPEZY"[--r]+"iB":"B")}function G(d,t,o,a,r){return(t=Math,o=t.log,a=1e3,r=o(d)/o(a)|0,d/t.pow(a,r)).toFixed(0)+" "+(r?"KMGTPEZY"[--r]+"B":"B")}function ue(d){const t={k:1,m:2,g:3,t:4},a=/(\d+(?:\.\d+)?)\s?(k|m|g|t)?b?/i.exec(d);return a[1]*Math.pow(1024,t[a[2].toLowerCase()])}const j={SYSTEM:"system",LIGHT:"light",DARK:"dark"};function me(d,t){const o=e.ref(j.SYSTEM),a=e.ref(j.LIGHT);o.value=d.getStore("theme",t??j.SYSTEM);const r=window.matchMedia("(prefers-color-scheme: dark)"),l=c=>{o.value===j.DARK||o.value===j.SYSTEM&&c.matches?a.value=j.DARK:a.value=j.LIGHT};return l(r),r.addEventListener("change",l),{value:o,actualValue:a,set(c){o.value=c,c!==j.SYSTEM?d.setStore("theme",c):d.removeStore("theme"),l(r)}}}const pe=(d,t)=>{const o=le(d.id),a=Q(),r=o.getStore("metricUnits",!1),l=me(o,d.theme),c=t.i18n,s=d.locale??t.locale,n=e.computed(()=>ie(o,s,a,c)),i=f=>Array.isArray(f)?f:ce,p=d.persist?o.getStore("path",d.path):d.path;return e.reactive({version:de,root:null,debug:d.debug,emitter:a,features:i(d.features),requester:ne(d.request),theme:l,view:o.getStore("viewport","grid"),fullScreen:o.getStore("full-screen",d.fullScreen),selectButton:d.selectButton,metricUnits:r,filesize:r?G:W,maxFileSize:d.maxFileSize,loading:!1,i18n:n,modal:{active:!1,type:"delete",data:{}},adapter:o.getStore("adapter"),path:p,persist:d.persist,storage:o,data:{adapter:o.getStore("adapter"),storages:[],dirname:p,files:[]},selectedItems:[]})},fe={class:"border-neutral-300 flex justify-between items-center py-1 text-sm"},ve={key:0,class:"flex text-center"},he=["aria-label"],ge=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 10.5v6m3-3H9m4.06-7.19l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})],-1),ke=[ge],ye=["aria-label"],_e=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m3.75 9v6m3-3H9m1.5-12H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})],-1),xe=[_e],we=["aria-label"],be=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"},null,-1),Ee=[be],Ve=["aria-label"],Ne=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"},null,-1),$e=[Ne],Be=["aria-label"],Se=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5"})],-1),Ce=[Se],De=["aria-label"],Me=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5m6 4.125l2.25 2.25m0 0l2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"},null,-1),je=[Me],Te=["aria-label"],Le=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"},null,-1),Fe=[Le],ze={key:1,class:"flex text-center"},Ae={class:"pl-2"},Oe={class:"dark:bg-gray-700 bg-gray-200 text-xs px-2 py-1 rounded"},Ue={key:0,class:"animate-spin p-0.5 h-5 w-5 text-white ml-auto",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},He=e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),qe=e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1),Re=[He,qe],Ie={class:"flex text-center items-center justify-end"},Pe=["aria-label"],We={xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 md:h-8 md:w-8 m-auto cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Ge={key:0,"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 9V4.5M9 9H4.5M9 9L3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5l5.25 5.25"},Ye={key:1,"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"},Ke=["aria-label"],Je={key:0,"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6zM3.75 15.75A2.25 2.25 0 016 13.5h2.25a2.25 2.25 0 012.25 2.25V18a2.25 2.25 0 01-2.25 2.25H6A2.25 2.25 0 013.75 18v-2.25zM13.5 6a2.25 2.25 0 012.25-2.25H18A2.25 2.25 0 0120.25 6v2.25A2.25 2.25 0 0118 10.5h-2.25a2.25 2.25 0 01-2.25-2.25V6zM13.5 15.75a2.25 2.25 0 012.25-2.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-2.25A2.25 2.25 0 0113.5 18v-2.25z"},Xe={key:1,"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 010 3.75H5.625a1.875 1.875 0 010-3.75z"},Qe={name:"VFToolbar"},Ze=Object.assign(Qe,{setup(d){const t=e.inject("ServiceContainer"),{setStore:o}=t.storage,{t:a}=t.i18n,r=e.ref([]),l=e.ref("");t.emitter.on("vf-search-query",({newQuery:n})=>{l.value=n});const c=()=>{t.fullScreen=!t.fullScreen,o("full-screen",t.fullScreen),t.emitter.emit("vf-fullscreen-toggle")};t.emitter.on("vf-nodes-selected",n=>{r.value=n});const s=()=>{t.view=t.view==="list"?"grid":"list",o("viewport",t.view)};return(n,i)=>(e.openBlock(),e.createElementBlock("div",fe,[l.value.length?(e.openBlock(),e.createElementBlock("div",ze,[e.createElementVNode("div",Ae,[e.createTextVNode(e.toDisplayString(e.unref(a)("Search results for"))+" ",1),e.createElementVNode("span",Oe,e.toDisplayString(l.value),1)]),e.unref(t).loading?(e.openBlock(),e.createElementBlock("svg",Ue,Re)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",ve,[e.unref(t).features.includes(e.unref(B).NEW_FOLDER)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(a)("New Folder"),"data-microtip-position":"bottom-right",role:"tooltip",onClick:i[0]||(i[0]=p=>e.unref(t).emitter.emit("vf-modal-show",{type:"new-folder",items:r.value}))},ke,8,he)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref(B).NEW_FILE)?(e.openBlock(),e.createElementBlock("div",{key:1,class:"mx-1.5","aria-label":e.unref(a)("New File"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[1]||(i[1]=p=>e.unref(t).emitter.emit("vf-modal-show",{type:"new-file",items:r.value}))},xe,8,ye)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref(B).RENAME)?(e.openBlock(),e.createElementBlock("div",{key:2,class:"mx-1.5","aria-label":e.unref(a)("Rename"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[2]||(i[2]=p=>r.value.length!=1||e.unref(t).emitter.emit("vf-modal-show",{type:"rename",items:r.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([r.value.length==1?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Ee,2))],8,we)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref(B).DELETE)?(e.openBlock(),e.createElementBlock("div",{key:3,class:"mx-1.5","aria-label":e.unref(a)("Delete"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[3]||(i[3]=p=>!r.value.length||e.unref(t).emitter.emit("vf-modal-show",{type:"delete",items:r.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([r.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},$e,2))],8,Ve)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref(B).UPLOAD)?(e.openBlock(),e.createElementBlock("div",{key:4,class:"mx-1.5","aria-label":e.unref(a)("Upload"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[4]||(i[4]=p=>e.unref(t).emitter.emit("vf-modal-show",{type:"upload",items:r.value}))},Ce,8,Be)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref(B).UNARCHIVE)&&r.value.length==1&&r.value[0].mime_type=="application/zip"?(e.openBlock(),e.createElementBlock("div",{key:5,class:"mx-1.5","aria-label":e.unref(a)("Unarchive"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[5]||(i[5]=p=>!r.value.length||e.unref(t).emitter.emit("vf-modal-show",{type:"unarchive",items:r.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([r.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},je,2))],8,De)):e.createCommentVNode("",!0),e.unref(t).features.includes(e.unref(B).ARCHIVE)?(e.openBlock(),e.createElementBlock("div",{key:6,class:"mx-1.5","aria-label":e.unref(a)("Archive"),"data-microtip-position":"bottom",role:"tooltip",onClick:i[6]||(i[6]=p=>!r.value.length||e.unref(t).emitter.emit("vf-modal-show",{type:"archive",items:r.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([r.value.length?"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300":"stroke-gray-200 dark:stroke-gray-700","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},Fe,2))],8,Te)):e.createCommentVNode("",!0)])),e.createElementVNode("div",Ie,[e.unref(t).features.includes(e.unref(B).FULL_SCREEN)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(a)("Toggle Full Screen"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:c},[(e.openBlock(),e.createElementBlock("svg",We,[e.unref(t).fullScreen?(e.openBlock(),e.createElementBlock("path",Ge)):(e.openBlock(),e.createElementBlock("path",Ye))]))],8,Pe)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(a)("Change View"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:i[7]||(i[7]=p=>l.value.length||s())},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([l.value.length?"stroke-gray-200 dark:stroke-gray-700":"cursor-pointer stroke-gray-500 hover:stroke-cyan-700 dark:stroke-gray-400 dark:hover:stroke-gray-300","h-6 w-6 md:h-8 md:w-8 m-auto"]),fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.unref(t).view==="grid"?(e.openBlock(),e.createElementBlock("path",Je)):e.createCommentVNode("",!0),e.unref(t).view==="list"?(e.openBlock(),e.createElementBlock("path",Xe)):e.createCommentVNode("",!0)],2))],8,Ke)])]))}}),et=(d,t=0,o=!1)=>{let a;return(...r)=>{o&&!a&&d(...r),clearTimeout(a),a=setTimeout(()=>{d(...r)},t)}},tt=(d,t,o)=>{const a=e.ref(d);return e.customRef((r,l)=>({get(){return r(),a.value},set:et(c=>{a.value=c,l()},t,o)}))},ot={class:"flex p-1.5 bg-neutral-100 dark:bg-gray-800 border-t border-b border-neutral-300 dark:border-gray-700/50 items-center select-none text-sm"},rt=["aria-label"],at=e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 9.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 7.414V15a1 1 0 11-2 0V7.414L6.707 9.707a1 1 0 01-1.414 0z","clip-rule":"evenodd"},null,-1),nt=[at],lt=["aria-label"],st=e.createElementVNode("path",{d:"M463.5 224H472c13.3 0 24-10.7 24-24V72c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8H463.5z"},null,-1),it=[st],ct=["aria-label"],dt=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1),ut=[dt],mt=e.createElementVNode("path",{d:"M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"},null,-1),pt=[mt],ft={class:"flex leading-6"},vt=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),ht=["onDragover","onDragleave","onDrop","title","onClick"],gt={key:0,class:"animate-spin p-1 h-6 w-6 text-white ml-auto",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},kt=e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),yt=e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1),_t=[kt,yt],xt={key:3,class:"relative flex bg-white dark:bg-gray-700 justify-between items-center rounded p-1 ml-2 w-full"},wt=e.createElementVNode("div",null,[e.createElementVNode("svg",{class:"h-6 w-6 p-1 m-auto stroke-gray-400 fill-gray-100 dark:stroke-gray-400 dark:fill-gray-400/20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"})])],-1),bt=["placeholder"],Et=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1),Vt=[Et],Nt={name:"VFBreadcrumb"},$t=Object.assign(Nt,{setup(d){const t=e.ref(null),o=e.ref([]),a=e.ref(!1),r=e.ref(null),l=e.inject("ServiceContainer"),{t:c}=l.i18n;l.emitter.on("vf-explorer-update",()=>{let y=[],m=[];t.value=l.data.dirname??l.adapter+"://",t.value.length==0&&(o.value=[]),t.value.replace(l.adapter+"://","").split("/").forEach(function(u){y.push(u),y.join("/")!=""&&m.push({basename:u,name:u,path:l.adapter+"://"+y.join("/"),type:"dir"})}),m.length>4&&(m=m.slice(-5),m[0].name=".."),o.value=m});const s=()=>{a.value=!1,i.value=""};l.emitter.on("vf-search-exit",()=>{s()});const n=()=>{l.features.includes(B.SEARCH)&&(a.value=!0,e.nextTick(()=>r.value.focus()))},i=tt("",400);e.watch(i,y=>{l.emitter.emit("vf-toast-clear"),l.emitter.emit("vf-search-query",{newQuery:y})});const p=()=>o.value.length&&!a.value,f=(y,m=null)=>{y.preventDefault(),h(y),m??(m=o.value.length-2);let u=JSON.parse(y.dataTransfer.getData("items"));if(u.find($=>$.storage!==l.adapter)){alert("Moving items between different storages is not supported yet.");return}l.emitter.emit("vf-modal-show",{type:"move",items:{from:u,to:o.value[m]??{path:l.adapter+"://"}}})},k=y=>{y.preventDefault(),p()?(y.dataTransfer.dropEffect="copy",y.currentTarget.classList.add("bg-blue-200","dark:bg-slate-500")):(y.dataTransfer.dropEffect="none",y.dataTransfer.effectAllowed="none")},h=y=>{y.preventDefault(),y.currentTarget.classList.remove("bg-blue-200","dark:bg-slate-500"),p()&&y.currentTarget.classList.remove("bg-blue-200","dark:bg-slate-500")},w=()=>{i.value==""&&s()};return(y,m)=>(e.openBlock(),e.createElementBlock("div",ot,[e.createElementVNode("span",{"aria-label":e.unref(c)("Go up a directory"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onDragover:m[0]||(m[0]=u=>k(u)),onDragleave:m[1]||(m[1]=u=>h(u)),onDrop:m[2]||(m[2]=u=>f(u)),onClick:m[3]||(m[3]=u=>{var $;return!p()||e.unref(l).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(l).data.adapter,path:(($=o.value[o.value.length-2])==null?void 0:$.path)??e.unref(l).adapter+"://"}})}),class:e.normalizeClass(["h-6 w-6 p-0.5 rounded",p()?"text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer":"text-gray-400 dark:text-neutral-500"]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},nt,34))],8,rt),e.unref(l).loading?(e.openBlock(),e.createElementBlock("span",{key:1,"aria-label":e.unref(c)("Cancel"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:m[5]||(m[5]=u=>e.unref(l).emitter.emit("vf-fetch-abort")),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer"},ut))],8,ct)):(e.openBlock(),e.createElementBlock("span",{key:0,"aria-label":e.unref(c)("Refresh"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:m[4]||(m[4]=u=>{e.unref(l).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(l).data.adapter,path:e.unref(l).data.dirname}})}),class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-300 dark:text-neutral-200 dark:hover:bg-gray-700 cursor-pointer",xmlns:"http://www.w3.org/2000/svg",viewBox:"-40 -40 580 580",fill:"currentColor"},it))],8,lt)),a.value?(e.openBlock(),e.createElementBlock("div",xt,[wt,e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:r,onKeydown:e.withKeys(s,["esc"]),onBlur:w,"onUpdate:modelValue":m[10]||(m[10]=u=>e.isRef(i)?i.value=u:null),placeholder:e.unref(c)("Search anything.."),class:"w-full pb-0 px-1 border-0 text-base ring-0 outline-0 text-gray-600 focus:ring-transparent focus:border-transparent dark:focus:ring-transparent dark:focus:border-transparent dark:text-gray-300 bg-transparent",type:"text"},null,40,bt),[[e.vModelText,e.unref(i)]]),(e.openBlock(),e.createElementBlock("svg",{class:"w-6 h-6 cursor-pointer",onClick:s,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Vt))])):(e.openBlock(),e.createElementBlock("div",{key:2,class:"group flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full",onClick:e.withModifiers(n,["self"])},[(e.openBlock(),e.createElementBlock("svg",{onDragover:m[6]||(m[6]=u=>k(u)),onDragleave:m[7]||(m[7]=u=>h(u)),onDrop:m[8]||(m[8]=u=>f(u,-1)),onClick:m[9]||(m[9]=u=>e.unref(l).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(l).data.adapter}})),class:"h-6 w-6 p-1 rounded text-slate-700 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-gray-800 cursor-pointer",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},pt,32)),e.createElementVNode("div",ft,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(u,$)=>(e.openBlock(),e.createElementBlock("div",{key:$},[vt,e.createElementVNode("span",{onDragover:S=>$===o.value.length-1||k(S),onDragleave:S=>$===o.value.length-1||h(S),onDrop:S=>$===o.value.length-1||f(S,$),class:"px-1.5 py-1 text-slate-700 dark:text-slate-200 hover:bg-neutral-100 dark:hover:bg-gray-800 rounded cursor-pointer",title:u.basename,onClick:S=>e.unref(l).emitter.emit("vf-fetch",{params:{q:"index",adapter:e.unref(l).data.adapter,path:u.path}})},e.toDisplayString(u.name),41,ht)]))),128))]),e.unref(l).loading?(e.openBlock(),e.createElementBlock("svg",gt,_t)):e.createCommentVNode("",!0)]))]))}}),Y=(d,t=null)=>new Date(d*1e3).toLocaleString(t??navigator.language??"en-US"),Bt={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},St=e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1),Ct=[St],Dt={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},Mt=e.createElementVNode("path",{"fill-rule":"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z","clip-rule":"evenodd"},null,-1),jt=[Mt],Tt={name:"VFSortIcon"},O=Object.assign(Tt,{props:{direction:String},setup(d){return(t,o)=>(e.openBlock(),e.createElementBlock("div",null,[d.direction==="down"?(e.openBlock(),e.createElementBlock("svg",Bt,Ct)):e.createCommentVNode("",!0),d.direction==="up"?(e.openBlock(),e.createElementBlock("svg",Dt,jt)):e.createCommentVNode("",!0)]))}}),Lt=["onClick"],Ft={name:"VFToast.vue"},zt=Object.assign(Ft,{setup(d){const t=e.inject("ServiceContainer"),{getStore:o}=t.storage,a=e.ref(o("full-screen",!1)),r=e.ref([]),l=n=>n==="error"?"text-red-400 border-red-400 dark:text-red-300 dark:border-red-300":"text-lime-600 border-lime-600 dark:text-lime-300 dark:border-lime-1300",c=n=>{r.value.splice(n,1)},s=n=>{let i=r.value.findIndex(p=>p.id===n);i!==-1&&c(i)};return t.emitter.on("vf-toast-clear",()=>{r.value=[]}),t.emitter.on("vf-toast-push",n=>{let i=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");n.id=i,r.value.push(n),setTimeout(()=>{s(i)},5e3)}),(n,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([a.value.value?"fixed":"absolute","bottom-0 max-w-fit flex flex-col bottom-0 left-1/2 -translate-x-1/2"])},[e.createVNode(e.TransitionGroup,{name:"vf-toast-item","leave-active-class":"transition-all duration-1000","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(p,f)=>(e.openBlock(),e.createElementBlock("div",{onClick:k=>c(f),key:p,class:e.normalizeClass([l(p.type),"inline-block mx-auto my-0.5 py-0.5 px-2 min-w-max bg-gray-50 dark:bg-gray-600 border text-xs sm:text-sm rounded cursor-pointer"])},e.toDisplayString(p.label),11,Lt))),128))]),_:1})],2))}});function R(d,t=14){let o=`((?=([\\w\\W]{0,${t}}))([\\w\\W]{${t+1},})([\\w\\W]{8,}))`;return d.replace(new RegExp(o),"$2..$4")}const At={class:"relative flex-auto flex flex-col overflow-hidden"},Ot={key:0,class:"grid grid-cols-12 border-b border-neutral-300 border-gray-200 dark:border-gray-700 text-xs select-none"},Ut={class:"absolute"},Ht=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"absolute h-6 w-6 md:h-12 md:w-12 m-auto stroke-neutral-500 fill-white dark:fill-gray-700 dark:stroke-gray-600 z-10",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})],-1),qt={class:"text-neutral-700 dark:text-neutral-300 p-1 absolute text-center top-4 right-[-2rem] md:top-5 md:right-[-2.4rem] z-20 text-xs"},Rt=["onDblclick","onContextmenu","data-type","data-item","data-index"],It={class:"grid grid-cols-12 items-center"},Pt={class:"flex col-span-7 items-center"},Wt={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Gt=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),Yt=[Gt],Kt={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Jt=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),Xt=[Jt],Qt={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Zt={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},eo=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],to={class:"grid grid-cols-12 items-center"},oo={class:"flex col-span-7 items-center"},ro={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},ao=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),no=[ao],lo={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},so=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),io=[so],co={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},uo={class:"col-span-2 text-center"},mo={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap"},po=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],fo={class:"relative"},vo={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-10 w-10 md:h-12 md:w-12 m-auto fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},ho=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),go=[ho],ko=["data-src","alt"],yo={key:2,xmlns:"http://www.w3.org/2000/svg",class:"h-10 w-10 md:h-12 md:w-12 m-auto text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},_o=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),xo=[_o],wo={key:3,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},bo={class:"break-all"},Eo={name:"VFExplorer"},Vo=Object.assign(Eo,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n;t.storage;const a=g=>g==null?void 0:g.substring(0,3),r=e.ref(null),l=e.ref(null),c=e.ref(0),s=e.ref(null),n=Math.floor(Math.random()*2**32),i=e.ref("");let p;t.emitter.on("vf-fullscreen-toggle",()=>{r.value.style.height=null}),t.emitter.on("vf-search-query",({newQuery:g})=>{i.value=g,g?t.emitter.emit("vf-fetch",{params:{q:"search",adapter:t.data.adapter,path:t.data.dirname,filter:g},onSuccess:b=>{b.files.length||t.emitter.emit("vf-toast-push",{label:o("No search result found.")})}}):t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname}})});let f=null;const k=()=>{f&&clearTimeout(f)},h=e.ref(!0),w=g=>{g.touches.length>1&&(h.value?(s.value.stop(),t.emitter.emit("vf-toast-push",{label:o("Drag&Drop: off")})):(s.value.start(),t.emitter.emit("vf-toast-push",{label:o("Drag&Drop: on")}),t.emitter.emit("vf-explorer-update")),h.value=!h.value)},y=g=>{f=setTimeout(()=>{const b=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!1,view:window,button:2,buttons:0,clientX:g.target.getBoundingClientRect().x,clientY:g.target.getBoundingClientRect().y});g.target.dispatchEvent(b)},500)},m=g=>{g.type==="dir"?(t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:g.path}})):t.emitter.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:g})},u=e.reactive({active:!1,column:"",order:""}),$=(g=!0)=>{let b=[...t.data.files],_=u.column,E=u.order=="asc"?1:-1;if(!g)return b;const x=(v,V)=>typeof v=="string"&&typeof V=="string"?v.toLowerCase().localeCompare(V.toLowerCase()):v<V?-1:v>V?1:0;return u.active&&(b=b.slice().sort((v,V)=>x(v[_],V[_])*E)),b},S=g=>{u.active&&u.column==g?(u.active=u.order=="asc",u.column=g,u.order="desc"):(u.active=!0,u.column=g,u.order="asc")},M=()=>s.value.getSelection().map(g=>JSON.parse(g.dataset.item)),L=(g,b)=>{if(g.altKey||g.ctrlKey||g.metaKey)return g.preventDefault(),!1;g.dataTransfer.setDragImage(l.value,0,15),g.dataTransfer.effectAllowed="all",g.dataTransfer.dropEffect="copy",g.dataTransfer.setData("items",JSON.stringify(M()))},F=(g,b)=>{g.preventDefault();let _=JSON.parse(g.dataTransfer.getData("items"));if(_.find(E=>E.storage!==t.adapter)){alert("Moving items between different storages is not supported yet.");return}t.emitter.emit("vf-modal-show",{type:"move",items:{from:_,to:b}})},z=(g,b)=>{g.preventDefault(),!b||b.type!=="dir"||s.value.getSelection().find(_=>_==g.currentTarget)?(g.dataTransfer.dropEffect="none",g.dataTransfer.effectAllowed="none"):g.dataTransfer.dropEffect="copy"},A=()=>{s.value=new Z({area:r.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),t.emitter.on("vf-explorer-update",()=>e.nextTick(()=>{s.value.clearSelection(),s.value.setSettings({selectables:document.getElementsByClassName("vf-item-"+n)})})),s.value.subscribe("predragstart",({event:g,isDragging:b})=>{if(b)c.value=s.value.getSelection().length,s.value.break();else{const _=g.target.offsetWidth-g.offsetX,E=g.target.offsetHeight-g.offsetY;_<15&&E<15&&(s.value.clearSelection(),s.value.break())}}),s.value.subscribe("predragmove",({isDragging:g})=>{g&&s.value.break()}),s.value.subscribe("callback",({items:g,event:b,isDragging:_})=>{t.emitter.emit("vf-nodes-selected",M()),c.value=s.value.getSelection().length})};return e.onMounted(()=>{p=new ee(r.value),A()}),e.onUpdated(()=>{s.value.Area.reset(),s.value.SelectorArea.updatePos(),p.update()}),e.onMounted(()=>{e.watch(()=>t.view,()=>t.emitter.emit("vf-explorer-update"))}),e.onBeforeUnmount(()=>{p.destroy()}),(g,b)=>(e.openBlock(),e.createElementBlock("div",At,[e.unref(t).view=="list"||i.value.length?(e.openBlock(),e.createElementBlock("div",Ot,[e.createElementVNode("div",{onClick:b[0]||(b[0]=_=>S("basename")),class:"col-span-7 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center pl-1"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Name"))+" ",1),e.withDirectives(e.createVNode(O,{direction:u.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,u.active&&u.column=="basename"]])]),i.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:b[1]||(b[1]=_=>S("file_size")),class:"col-span-2 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center border-l border-r dark:border-gray-700"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Size"))+" ",1),e.withDirectives(e.createVNode(O,{direction:u.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,u.active&&u.column=="file_size"]])])),i.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:b[2]||(b[2]=_=>S("last_modified")),class:"col-span-3 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Date"))+" ",1),e.withDirectives(e.createVNode(O,{direction:u.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,u.active&&u.column=="last_modified"]])])),i.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:b[3]||(b[3]=_=>S("path")),class:"col-span-5 py-1 leading-6 hover:bg-neutral-100 bg-neutral-50 dark:bg-gray-800 dark:hover:bg-gray-700/10 flex items-center justify-center border-l dark:border-gray-700"},[e.createTextVNode(e.toDisplayString(e.unref(o)("Filepath"))+" ",1),e.withDirectives(e.createVNode(O,{direction:u.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,u.active&&u.column=="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ut,[e.createElementVNode("div",{ref_key:"dragImage",ref:l,class:"absolute -z-50 -top-96"},[Ht,e.createElementVNode("div",qt,e.toDisplayString(c.value),1)],512)]),e.createElementVNode("div",{onTouchstart:w,onContextmenu:b[10]||(b[10]=e.withModifiers(_=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:_,area:r.value,items:M()}),["self","prevent"])),class:e.normalizeClass([e.unref(t).fullScreen?"":"resize-y","h-full w-full text-xs vf-selector-area vf-scrollbar min-h-[150px] overflow-auto p-1 z-0"]),ref_key:"selectorArea",ref:r},[i.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList($(),(_,E)=>(e.openBlock(),e.createElementBlock("div",{onDblclick:x=>m(_),onTouchstart:b[4]||(b[4]=x=>y(x)),onTouchend:b[5]||(b[5]=x=>k()),onContextmenu:e.withModifiers(x=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:x,area:r.value,items:M(),target:_}),["prevent"]),class:e.normalizeClass(["vf-item-"+e.unref(n),"grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),"data-type":_.type,"data-item":JSON.stringify(_),"data-index":E},[e.createElementVNode("div",It,[e.createElementVNode("div",Pt,[_.type==="dir"?(e.openBlock(),e.createElementBlock("svg",Wt,Yt)):(e.openBlock(),e.createElementBlock("svg",Kt,Xt)),e.createElementVNode("span",Qt,e.toDisplayString(_.basename),1)]),e.createElementVNode("div",Zt,e.toDisplayString(_.path),1)])],42,Rt))),256)):e.createCommentVNode("",!0),e.unref(t).view==="list"&&!i.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList($(),(_,E)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:x=>m(_),onTouchstart:b[6]||(b[6]=x=>y(x)),onTouchend:b[7]||(b[7]=x=>k()),onContextmenu:e.withModifiers(x=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:x,area:r.value,items:M(),target:_}),["prevent"]),onDragstart:x=>L(x),onDragover:x=>z(x,_),onDrop:x=>F(x,_),class:e.normalizeClass(["vf-item-"+e.unref(n),"grid grid-cols-1 border hover:bg-neutral-50 dark:hover:bg-gray-700 border-transparent my-0.5 w-full select-none"]),"data-type":_.type,"data-item":JSON.stringify(_),"data-index":E},[e.createElementVNode("div",to,[e.createElementVNode("div",oo,[_.type==="dir"?(e.openBlock(),e.createElementBlock("svg",ro,no)):(e.openBlock(),e.createElementBlock("svg",lo,io)),e.createElementVNode("span",co,e.toDisplayString(_.basename),1)]),e.createElementVNode("div",uo,e.toDisplayString(_.file_size?e.unref(t).filesize(_.file_size):""),1),e.createElementVNode("div",mo,e.toDisplayString(e.unref(Y)(_.last_modified)),1)])],42,eo))),256)):e.createCommentVNode("",!0),e.unref(t).view==="grid"&&!i.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList($(!1),(_,E)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:x=>m(_),onTouchstart:b[8]||(b[8]=x=>y(x)),onTouchend:b[9]||(b[9]=x=>k()),onContextmenu:e.withModifiers(x=>e.unref(t).emitter.emit("vf-contextmenu-show",{event:x,area:r.value,items:M(),target:_}),["prevent"]),onDragstart:x=>L(x),onDragover:x=>z(x,_),onDrop:x=>F(x,_),class:e.normalizeClass(["vf-item-"+e.unref(n),"border border-transparent hover:bg-neutral-50 m-1 dark:hover:bg-gray-700 inline-flex w-[5.5rem] h-20 md:w-24 text-center justify-center select-none"]),"data-type":_.type,"data-item":JSON.stringify(_),"data-index":E},[e.createElementVNode("div",null,[e.createElementVNode("div",fo,[_.type==="dir"?(e.openBlock(),e.createElementBlock("svg",vo,go)):(_.mime_type??"").startsWith("image")?(e.openBlock(),e.createElementBlock("img",{key:1,class:"lazy h-10 md:h-12 m-auto","data-src":e.unref(t).requester.getPreviewUrl(e.unref(t).adapter,_),alt:_.basename},null,8,ko)):(e.openBlock(),e.createElementBlock("svg",yo,xo)),!(_.mime_type??"").startsWith("image")&&_.type!="dir"?(e.openBlock(),e.createElementBlock("div",wo,e.toDisplayString(a(_.extension)),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",bo,e.toDisplayString(e.unref(R)(_.basename)),1)])],42,po))),256)):e.createCommentVNode("",!0)],34),e.createVNode(zt)]))}}),No=["onClick"],$o=["href","download"],Bo=e.createElementVNode("span",{class:"px-1"},null,-1),So=e.createElementVNode("span",{class:"px-1"},null,-1),Co={name:"VFContextMenu"},Do=Object.assign(Co,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,a=e.ref(null),r=e.ref([]),l=e.ref(""),c=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),s=e.computed(()=>c.items.filter(f=>f.key==null||t.features.includes(f.key)));t.emitter.on("vf-context-selected",f=>{r.value=f});const n={newfolder:{key:B.NEW_FOLDER,title:()=>o("New Folder"),action:()=>{t.emitter.emit("vf-modal-show",{type:"new-folder"})}},delete:{key:B.DELETE,title:()=>o("Delete"),action:()=>{t.emitter.emit("vf-modal-show",{type:"delete",items:r})}},refresh:{title:()=>o("Refresh"),action:()=>{t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname}})}},preview:{key:B.PREVIEW,title:()=>o("Preview"),action:()=>{t.emitter.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:r.value[0]})}},open:{title:()=>o("Open"),action:()=>{t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:r.value[0].path}})}},openDir:{title:()=>o("Open containing folder"),action:()=>{t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:r.value[0].dir}})}},download:{key:B.DOWNLOAD,link:e.computed(()=>t.requester.getDownloadUrl(t.data.adapter,r.value[0])),title:()=>o("Download"),action:()=>{const f=t.requester.getDownloadUrl(t.data.adapter,r.value[0]);t.emitter.emit("vf-download",f)}},archive:{key:B.ARCHIVE,title:()=>o("Archive"),action:()=>{t.emitter.emit("vf-modal-show",{type:"archive",items:r})}},unarchive:{key:B.UNARCHIVE,title:()=>o("Unarchive"),action:()=>{t.emitter.emit("vf-modal-show",{type:"unarchive",items:r})}},rename:{key:B.RENAME,title:()=>o("Rename"),action:()=>{t.emitter.emit("vf-modal-show",{type:"rename",items:r})}}},i=f=>{t.emitter.emit("vf-contextmenu-hide"),f.action()};t.emitter.on("vf-search-query",({newQuery:f})=>{l.value=f}),t.emitter.on("vf-contextmenu-show",({event:f,area:k,items:h,target:w=null})=>{if(c.items=[],l.value)if(w)c.items.push(n.openDir),t.emitter.emit("vf-context-selected",[w]);else return;else!w&&!l.value?(c.items.push(n.refresh),c.items.push(n.newfolder),t.emitter.emit("vf-context-selected",[])):h.length>1&&h.some(y=>y.path===w.path)?(c.items.push(n.refresh),c.items.push(n.archive),c.items.push(n.delete),t.emitter.emit("vf-context-selected",h)):(w.type=="dir"?c.items.push(n.open):(c.items.push(n.preview),c.items.push(n.download)),c.items.push(n.rename),w.mime_type=="application/zip"?c.items.push(n.unarchive):c.items.push(n.archive),c.items.push(n.delete),t.emitter.emit("vf-context-selected",[w]));p(f,k)}),t.emitter.on("vf-contextmenu-hide",()=>{c.active=!1});const p=(f,k)=>{c.active=!0,e.nextTick(()=>{const h=t.root.getBoundingClientRect(),w=k.getBoundingClientRect();let y=f.pageX-h.left,m=f.pageY-h.top,u=a.value.offsetHeight,$=a.value.offsetWidth;y=w.right-f.pageX+window.scrollX<$?y-$:y,m=w.bottom-f.pageY+window.scrollY<u?m-u:m,c.positions={left:y+"px",top:m+"px"}})};return(f,k)=>c.active?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"z-30 absolute text-xs bg-neutral-50 dark:bg-gray-800 text-gray-700 dark:text-gray-200 border border-neutral-300 dark:border-gray-600 shadow rounded select-none",ref_key:"contextmenu",ref:a,style:e.normalizeStyle(c.positions)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,h=>(e.openBlock(),e.createElementBlock("li",{class:"px-2 py-1.5 cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",key:h.title,onClick:w=>i(h)},[h.link?(e.openBlock(),e.createElementBlock("a",{key:0,target:"_blank",href:h.link,download:h.link},[Bo,e.createElementVNode("span",null,e.toDisplayString(h.title()),1)],8,$o)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[So,e.createElementVNode("span",null,e.toDisplayString(h.title()),1)],64))],8,No))),128))],4)):e.createCommentVNode("",!0)}}),Mo={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},jo={class:"flex leading-5 items-center"},To=["aria-label"],Lo=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"})],-1),Fo=[Lo],zo=["value"],Ao={class:"ml-3"},Oo={key:0},Uo={class:"ml-1"},Ho={class:"flex leading-5 items-center justify-end"},qo=["disabled"],Ro=["aria-label"],Io=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 stroke-slate-500 cursor-pointer",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),Po=[Io],Wo={name:"VFStatusbar"},Go=Object.assign(Wo,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,{setStore:a}=t.storage,r=e.ref(0),l=()=>{t.emitter.emit("vf-search-exit"),t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.adapter}}),a("adapter",t.adapter)};t.emitter.on("vf-nodes-selected",n=>{r.value=n.length});const c=e.ref("");t.emitter.on("vf-search-query",({newQuery:n})=>{c.value=n});const s=e.computed(()=>{const n=t.selectButton.multiple?t.selectedItems.length>0:t.selectedItems.length===1;return t.selectButton.active&&n});return(n,i)=>(e.openBlock(),e.createElementBlock("div",Mo,[e.createElementVNode("div",jo,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(o)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},Fo,8,To),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":i[0]||(i[0]=p=>e.unref(t).adapter=p),onChange:l,class:"py-0.5 text-sm text-slate-500 border dark:border-gray-600 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).data.storages,p=>(e.openBlock(),e.createElementBlock("option",{value:p},e.toDisplayString(p),9,zo))),256))],544),[[e.vModelSelect,e.unref(t).adapter]]),e.createElementVNode("div",Ao,[c.value.length?(e.openBlock(),e.createElementBlock("span",Oo,e.toDisplayString(e.unref(t).data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",Uo,e.toDisplayString(r.value>0?e.unref(o)("%s item(s) selected.",r.value):""),1)])]),e.createElementVNode("div",Ho,[e.unref(t).selectButton.active?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["vf-btn py-0 vf-btn-primary",{disabled:!s.value}]),disabled:!s.value,onClick:i[1]||(i[1]=p=>e.unref(t).selectButton.click(e.unref(t).selectedItems,p))},e.toDisplayString(e.unref(o)("Select")),11,qo)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:"mr-1","aria-label":e.unref(o)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:i[2]||(i[2]=p=>e.unref(t).emitter.emit("vf-modal-show",{type:"about"}))},Po,8,Ro)])]))}}),Yo={name:"VueFinder"},Ko=Object.assign(Yo,{props:{id:{type:String,default:"vf"},request:{type:[String,Object],required:!0},persist:{type:Boolean,default:!1},path:{type:String,default:"."},features:{type:[Array,Boolean],default:!0},debug:{type:Boolean,default:!1},theme:{type:String,default:"system"},locale:{type:String,default:null},maxHeight:{type:String,default:"600px"},maxFileSize:{type:String,default:"10mb"},fullScreen:{type:Boolean,default:!1},selectButton:{type:Object,default(d){return{active:!1,multiple:!1,click:t=>{},...d}}}},emits:["select"],setup(d,{emit:t}){const o=t,r=pe(d,e.inject("VueFinderOptions"));e.provide("ServiceContainer",r);const{setStore:l}=r.storage,c=e.ref(null);r.root=c,r.i18n,r.emitter.on("vf-modal-close",()=>{r.modal.active=!1}),r.emitter.on("vf-modal-show",i=>{r.modal.active=!0,r.modal.type=i.type,r.modal.data=i});const s=i=>{Object.assign(r.data,i),r.emitter.emit("vf-nodes-selected",{}),r.emitter.emit("vf-explorer-update")};r.emitter.on("vf-nodes-selected",i=>{r.selectedItems=i,o("select",i)});let n;return r.emitter.on("vf-fetch-abort",()=>{n.abort(),r.loading=!1}),r.emitter.on("vf-fetch",({params:i,body:p=null,onSuccess:f=null,onError:k=null,noCloseModal:h=!1})=>{["index","search"].includes(i.q)&&(n&&n.abort(),r.loading=!0),n=new AbortController;const w=n.signal;r.requester.send({url:"",method:i.m||"get",params:i,body:p,abortSignal:w}).then(y=>{r.adapter=y.adapter,r.persist&&(r.path=y.dirname,l("path",r.path)),["index","search"].includes(i.q)&&(r.loading=!1),h||r.emitter.emit("vf-modal-close"),s(y),f&&f(y)}).catch(y=>{console.error(y),k&&k(y)})}),r.emitter.on("vf-download",i=>{const p=document.createElement("a");p.style.display="none",p.target="_blank",p.href=i,p.download=i,r.root.appendChild(p),p.click(),p.remove()}),e.onMounted(()=>{let i={};r.path.includes("://")&&(i={adapter:r.path.split("://")[0],path:r.path}),r.emitter.emit("vf-fetch",{params:{q:"index",adapter:r.adapter,...i}})}),(i,p)=>(e.openBlock(),e.createElementBlock("div",{class:"vuefinder",ref_key:"root",ref:c},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(r).theme.actualValue==="dark"?"dark":"")},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(r).fullScreen?"fixed w-screen inset-0 z-20":"relative rounded-md","border flex flex-col bg-white dark:bg-gray-800 text-gray-700 dark:text-neutral-400 border-neutral-300 dark:border-gray-900 min-w-min select-none"]),style:e.normalizeStyle(e.unref(r).fullScreen?"":"max-height: "+d.maxHeight),onMousedown:p[0]||(p[0]=f=>e.unref(r).emitter.emit("vf-contextmenu-hide")),onTouchstart:p[1]||(p[1]=f=>e.unref(r).emitter.emit("vf-contextmenu-hide"))},[e.createVNode(Ze),e.createVNode($t),e.createVNode(Vo),e.createVNode(Go)],38),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[e.unref(r).modal.active?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("v-f-modal-"+e.unref(r).modal.type),{key:0})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(Do)],2)],512))}}),Jo=e.createElementVNode("div",{class:"fixed inset-0 bg-gray-500 dark:bg-gray-600 dark:bg-opacity-75 bg-opacity-75 transition-opacity"},null,-1),Xo={class:"fixed z-10 inset-0 overflow-hidden"},Qo={class:"relative bg-white dark:bg-gray-800 rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:max-w-4xl md:max-w-2xl lg:max-w-3xl xl:max-w-5xl w-full"},Zo={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},er={class:"bg-gray-50 dark:bg-gray-800 dark:border-t dark:border-gray-700 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"},C={__name:"ModalLayout",setup(d){const t=e.inject("ServiceContainer");return e.onMounted(()=>{const o=document.querySelector(".v-f-modal input");o&&o.focus()}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:"v-f-modal relative z-30","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",onKeyup:a[1]||(a[1]=e.withKeys(r=>e.unref(t).emitter.emit("vf-modal-close"),["esc"])),tabindex:"0"},[Jo,e.createElementVNode("div",Xo,[e.createElementVNode("div",{class:"flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0",onMousedown:a[0]||(a[0]=e.withModifiers(r=>e.unref(t).emitter.emit("vf-modal-close"),["self"]))},[e.createElementVNode("div",Qo,[e.createElementVNode("div",Zo,[e.renderSlot(o.$slots,"default")]),e.createElementVNode("div",er,[e.renderSlot(o.$slots,"buttons")])])],32)])],32))}},tr=["aria-label"],or=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1),rr=[or],ar={name:"Message"},D=Object.assign(ar,{props:{error:{type:Boolean,default:!1}},emits:["hidden"],setup(d,{emit:t}){var i;const o=t,a=e.inject("ServiceContainer"),{t:r}=a.i18n,l=e.ref(!1),c=e.ref(null),s=e.ref((i=c.value)==null?void 0:i.strMessage);e.watch(s,()=>l.value=!1);const n=()=>{o("hidden"),l.value=!0};return(p,f)=>(e.openBlock(),e.createElementBlock("div",null,[l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"strMessage",ref:c,class:e.normalizeClass(["flex mt-2 p-1 px-2 rounded text-sm break-all dark:opacity-75",d.error?"bg-red-100 text-red-600 ":"bg-emerald-100 text-emerald-600"])},[e.renderSlot(p.$slots,"default"),e.createElementVNode("div",{class:"ml-auto cursor-pointer",onClick:n,"aria-label":e.unref(r)("Close"),"data-microtip-position":"top-left",role:"tooltip"},rr,8,tr)],2))]))}}),nr={class:"sm:flex sm:items-start"},lr=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-red-600 dark:stroke-red-200",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})])],-1),sr={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ir={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},cr={class:"mt-2"},dr={class:"text-sm text-gray-500"},ur={class:"text-gray-500 text-sm mb-1 overflow-auto vf-scrollbar",style:{"max-height":"200px"}},mr={class:"flex text-sm text-gray-800 dark:text-gray-400"},pr={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},fr=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),vr=[fr],hr={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},gr=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),kr=[gr],yr={class:"ml-1.5"},_r={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},xr={name:"VFModalDelete"},wr=Object.assign(xr,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(t.modal.data.items),r=e.ref(""),l=()=>{a.value.length&&t.emitter.emit("vf-fetch",{params:{q:"delete",m:"post",adapter:t.adapter,path:t.data.dirname},body:{items:a.value.map(({path:c,type:s})=>({path:c,type:s}))},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("Files deleted.")})},onError:c=>{r.value=o(c.message)}})};return(c,s)=>(e.openBlock(),e.createBlock(C,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l,class:"vf-btn vf-btn-danger"},e.toDisplayString(e.unref(o)("Yes, Delete!")),1),e.createElementVNode("button",{type:"button",onClick:s[1]||(s[1]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1),e.createElementVNode("div",_r,e.toDisplayString(e.unref(o)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",nr,[lr,e.createElementVNode("div",sr,[e.createElementVNode("h3",ir,e.toDisplayString(e.unref(o)("Delete files")),1),e.createElementVNode("div",cr,[e.createElementVNode("p",dr,e.toDisplayString(e.unref(o)("Are you sure you want to delete these files?")),1),e.createElementVNode("div",ur,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,n=>(e.openBlock(),e.createElementBlock("p",mr,[n.type==="dir"?(e.openBlock(),e.createElementBlock("svg",pr,vr)):(e.openBlock(),e.createElementBlock("svg",hr,kr)),e.createElementVNode("span",yr,e.toDisplayString(n.basename),1)]))),256))]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:s[0]||(s[0]=n=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),br={class:"sm:flex sm:items-start"},Er=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1),Vr={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Nr={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},$r={class:"mt-2"},Br={class:"text-sm text-gray-500"},Sr={name:"VFModalMessage"},Cr=Object.assign(Sr,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n;return(a,r)=>(e.openBlock(),e.createBlock(C,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:r[0]||(r[0]=l=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Close")),1)]),default:e.withCtx(()=>{var l,c;return[e.createElementVNode("div",br,[Er,e.createElementVNode("div",Vr,[e.createElementVNode("h3",Nr,e.toDisplayString(((l=e.unref(t).modal.data)==null?void 0:l.title)??"Title"),1),e.createElementVNode("div",$r,[e.createElementVNode("p",Br,e.toDisplayString(((c=e.unref(t).modal.data)==null?void 0:c.message)??"Message"),1)])])])]}),_:1}))}}),Dr={class:"sm:flex sm:items-start"},Mr=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})])],-1),jr={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Tr={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Lr={class:"mt-2"},Fr={class:"text-sm text-gray-500"},zr=["placeholder"],Ar={name:"VFModalNewFolder"},Or=Object.assign(Ar,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(""),r=e.ref(""),l=()=>{a.value!=""&&t.emitter.emit("vf-fetch",{params:{q:"newfolder",m:"post",adapter:t.adapter,path:t.data.dirname},body:{name:a.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("%s is created.",a.value)})},onError:c=>{r.value=o(c.message)}})};return(c,s)=>(e.openBlock(),e.createBlock(C,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Create")),1),e.createElementVNode("button",{type:"button",onClick:s[2]||(s[2]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Dr,[Mr,e.createElementVNode("div",jr,[e.createElementVNode("h3",Tr,e.toDisplayString(e.unref(o)("New Folder")),1),e.createElementVNode("div",Lr,[e.createElementVNode("p",Fr,e.toDisplayString(e.unref(o)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=n=>a.value=n),onKeyup:e.withKeys(l,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(o)("Folder Name"),type:"text"},null,40,zr),[[e.vModelText,a.value]]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:s[1]||(s[1]=n=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Ur={class:"sm:flex sm:items-start"},Hr=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})])],-1),qr={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Rr={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Ir={class:"mt-2"},Pr={class:"text-sm text-gray-500"},Wr=["placeholder"],Gr={name:"VFModalNewFile"},Yr=Object.assign(Gr,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(""),r=e.ref(""),l=()=>{a.value!=""&&t.emitter.emit("vf-fetch",{params:{q:"newfile",m:"post",adapter:t.adapter,path:t.data.dirname},body:{name:a.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("%s is created.",a.value)})},onError:c=>{r.value=o(c.message)}})};return(c,s)=>(e.openBlock(),e.createBlock(C,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Create")),1),e.createElementVNode("button",{type:"button",onClick:s[2]||(s[2]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Ur,[Hr,e.createElementVNode("div",qr,[e.createElementVNode("h3",Rr,e.toDisplayString(e.unref(o)("New File")),1),e.createElementVNode("div",Ir,[e.createElementVNode("p",Pr,e.toDisplayString(e.unref(o)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=n=>a.value=n),onKeyup:e.withKeys(l,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(o)("File Name"),type:"text"},null,40,Wr),[[e.vModelText,a.value]]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:s[1]||(s[1]=n=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Kr={class:"flex"},Jr=["aria-label"],Xr={class:"ml-auto mb-2"},Qr={key:0,class:"p-2 border font-normal whitespace-pre-wrap border-gray-200 dark:border-gray-700/50 dark:text-gray-200 rounded min-h-[200px] max-h-[60vh] text-xs overflow-auto"},Zr={key:1},ea={__name:"Text",emits:["success"],setup(d,{emit:t}){const o=t,a=e.ref(""),r=e.ref(""),l=e.ref(null),c=e.ref(!1),s=e.ref(""),n=e.ref(!1),i=e.inject("ServiceContainer"),{t:p}=i.i18n;e.onMounted(()=>{i.requester.send({url:"",method:"get",params:{q:"preview",adapter:i.modal.data.adapter,path:i.modal.data.item.path},responseType:"text"}).then(h=>{a.value=h,o("success")})});const f=()=>{c.value=!c.value,r.value=a.value,c.value==!0&&e.nextTick(()=>{l.value.focus()})},k=()=>{s.value="",n.value=!1,i.requester.send({url:"",method:"post",params:{q:"save",adapter:i.modal.data.adapter,path:i.modal.data.item.path},body:{content:r.value},responseType:"text"}).then(h=>{s.value=p("Updated."),a.value=h,o("success"),c.value=!c.value}).catch(h=>{s.value=p(h.message),n.value=!0})};return(h,w)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Kr,[e.createElementVNode("div",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(i).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(i).modal.data.item.basename),9,Jr),e.createElementVNode("div",Xr,[c.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:k,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(p)("Save")),1)):e.createCommentVNode("",!0),e.unref(i).features.includes(e.unref(B).EDIT)?(e.openBlock(),e.createElementBlock("button",{key:1,class:"ml-1 px-2 py-1 text-blue-500",onClick:w[0]||(w[0]=y=>f())},e.toDisplayString(c.value?e.unref(p)("Cancel"):e.unref(p)("Edit")),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",null,[c.value?(e.openBlock(),e.createElementBlock("div",Zr,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:l,"onUpdate:modelValue":w[1]||(w[1]=y=>r.value=y),class:"w-full p-2 rounded dark:bg-gray-700 dark:text-gray-200 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:selection:bg-gray-500 min-h-[200px] max-h-[60vh] text-xs",name:"text",id:"",cols:"30",rows:"10"},null,512),[[e.vModelText,r.value]])])):(e.openBlock(),e.createElementBlock("pre",Qr,e.toDisplayString(a.value),1)),s.value.length?(e.openBlock(),e.createBlock(D,{key:2,onHidden:w[2]||(w[2]=y=>s.value=""),error:n.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)])],64))}},ta={class:"flex"},oa=["aria-label"],ra={class:"ml-auto mb-2"},aa={class:"w-full flex justify-center"},na=["src"],la={__name:"Image",emits:["success"],setup(d,{emit:t}){const o=t,a=e.inject("ServiceContainer"),{t:r}=a.i18n,l=e.ref(null),c=e.ref(null),s=e.ref(!1),n=e.ref(""),i=e.ref(!1),p=()=>{s.value=!s.value,s.value?c.value=new te(l.value,{crop(k){}}):c.value.destroy()},f=()=>{c.value.getCroppedCanvas({width:795,height:341}).toBlob(k=>{n.value="",i.value=!1;const h=new FormData;h.set("file",k),a.requester.send({url:"",method:"post",params:{q:"upload",adapter:a.modal.data.adapter,path:a.modal.data.item.path},body:h}).then(w=>{n.value=r("Updated."),l.value.src=a.requester.getPreviewUrl(a.modal.data.adapter,a.modal.data.item),p(),o("success")}).catch(w=>{n.value=r(w.message),i.value=!0})})};return e.onMounted(()=>{o("success")}),(k,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",ta,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(a).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(a).modal.data.item.basename),9,oa),e.createElementVNode("div",ra,[s.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:f,class:"ml-1 px-2 py-1 rounded border border-transparent shadow-sm bg-blue-700/75 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-700/50 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(r)("Crop")),1)):e.createCommentVNode("",!0),e.unref(a).features.includes(e.unref(B).EDIT)?(e.openBlock(),e.createElementBlock("button",{key:1,class:"ml-1 px-2 py-1 text-blue-500",onClick:h[0]||(h[0]=w=>p())},e.toDisplayString(s.value?e.unref(r)("Cancel"):e.unref(r)("Edit")),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",aa,[e.createElementVNode("img",{ref_key:"image",ref:l,class:"max-w-[50vh] max-h-[50vh]",src:e.unref(a).requester.getPreviewUrl(e.unref(a).modal.data.adapter,e.unref(a).modal.data.item),alt:""},null,8,na)]),n.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:h[1]||(h[1]=w=>n.value=""),error:i.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)],64))}},sa={class:"flex"},ia=["aria-label"],ca=e.createElementVNode("div",null,null,-1),da={__name:"Default",emits:["success"],setup(d,{emit:t}){const o=e.inject("ServiceContainer"),a=t;return e.onMounted(()=>{a("success")}),(r,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",sa,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(o).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(o).modal.data.item.basename),9,ia)]),ca],64))}},ua=["aria-label"],ma={class:"w-full",preload:"",controls:""},pa=["src"],fa={__name:"Video",emits:["success"],setup(d,{emit:t}){const o=e.inject("ServiceContainer"),a=t,r=()=>o.requester.getPreviewUrl(o.modal.data.adapter,o.modal.data.item);return e.onMounted(()=>{a("success")}),(l,c)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(o).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(o).modal.data.item.basename),9,ua),e.createElementVNode("div",null,[e.createElementVNode("video",ma,[e.createElementVNode("source",{src:r(),type:"video/mp4"},null,8,pa),e.createTextVNode(" Your browser does not support the video tag. ")])])]))}},va=["aria-label"],ha={class:"w-full",controls:""},ga=["src"],ka={__name:"Audio",emits:["success"],setup(d,{emit:t}){const o=t,a=e.inject("ServiceContainer"),r=()=>a.requester.getPreviewUrl(a.modal.data.adapter,a.modal.data.item);return e.onMounted(()=>{o("success")}),(l,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(a).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(a).modal.data.item.basename),9,va),e.createElementVNode("div",null,[e.createElementVNode("audio",ha,[e.createElementVNode("source",{src:r(),type:"audio/mpeg"},null,8,ga),e.createTextVNode(" Your browser does not support the audio element. ")])])],64))}},ya=["aria-label"],_a=["data"],xa=["src"],wa=e.createElementVNode("p",null,[e.createTextVNode(" Your browser does not support PDFs. "),e.createElementVNode("a",{href:"https://example.com/test.pdf"},"Download the PDF"),e.createTextVNode(" . ")],-1),ba=[wa],Ea={__name:"Pdf",emits:["success"],setup(d,{emit:t}){const o=e.inject("ServiceContainer"),a=t,r=()=>o.requester.getPreviewUrl(o.modal.data.adapter,o.modal.data.item);return e.onMounted(()=>{a("success")}),(l,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("h3",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":e.unref(o).modal.data.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(e.unref(o).modal.data.item.basename),9,ya),e.createElementVNode("div",null,[e.createElementVNode("object",{class:"h-[60vh]",data:r(),type:"application/pdf",width:"100%",height:"100%"},[e.createElementVNode("iframe",{class:"border-0",src:r(),width:"100%",height:"100%"},ba,8,xa)],8,_a)])],64))}},Va={class:"sm:flex sm:items-start"},Na={class:"mt-3 text-center sm:mt-0 sm:text-left w-full"},$a={key:0},Ba={class:"text-gray-700 dark:text-gray-200 text-sm"},Sa={key:0,class:"flex leading-5"},Ca=e.createElementVNode("svg",{class:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-25 stroke-blue-900 dark:stroke-blue-100",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1),Da={class:"py-2 flex font-normal break-all dark:text-gray-200 rounded text-xs"},Ma={class:"font-bold"},ja={class:"font-bold pl-2"},Ta={key:0,class:"text-xs text-gray-600 dark:text-gray-400"},La=["download","href"],Fa={name:"VFModalPreview"},za=Object.assign(Fa,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,a=e.ref(!1),r=c=>(t.modal.data.item.mime_type??"").startsWith(c),l=t.features.includes(B.PREVIEW);return l||(a.value=!0),(c,s)=>(e.openBlock(),e.createBlock(C,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:s[6]||(s[6]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Close")),1),e.unref(t).features.includes(e.unref(B).DOWNLOAD)?(e.openBlock(),e.createElementBlock("a",{key:0,target:"_blank",class:"vf-btn vf-btn-primary",download:e.unref(t).requester.getDownloadUrl(e.unref(t).modal.data.adapter,e.unref(t).modal.data.item),href:e.unref(t).requester.getDownloadUrl(e.unref(t).modal.data.adapter,e.unref(t).modal.data.item)},e.toDisplayString(e.unref(o)("Download")),9,La)):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("div",Va,[e.createElementVNode("div",Na,[e.unref(l)?(e.openBlock(),e.createElementBlock("div",$a,[r("text")?(e.openBlock(),e.createBlock(ea,{key:0,onSuccess:s[0]||(s[0]=n=>a.value=!0)})):r("image")?(e.openBlock(),e.createBlock(la,{key:1,onSuccess:s[1]||(s[1]=n=>a.value=!0)})):r("video")?(e.openBlock(),e.createBlock(fa,{key:2,onSuccess:s[2]||(s[2]=n=>a.value=!0)})):r("audio")?(e.openBlock(),e.createBlock(ka,{key:3,onSuccess:s[3]||(s[3]=n=>a.value=!0)})):r("application/pdf")?(e.openBlock(),e.createBlock(Ea,{key:4,onSuccess:s[4]||(s[4]=n=>a.value=!0)})):(e.openBlock(),e.createBlock(da,{key:5,onSuccess:s[5]||(s[5]=n=>a.value=!0)}))])):e.createCommentVNode("",!0),e.createElementVNode("div",Ba,[a.value===!1?(e.openBlock(),e.createElementBlock("div",Sa,[Ca,e.createElementVNode("span",null,e.toDisplayString(e.unref(o)("Loading")),1)])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",Da,[e.createElementVNode("div",null,[e.createElementVNode("span",Ma,e.toDisplayString(e.unref(o)("File Size"))+": ",1),e.createTextVNode(e.toDisplayString(e.unref(t).filesize(e.unref(t).modal.data.item.file_size)),1)]),e.createElementVNode("div",null,[e.createElementVNode("span",ja,e.toDisplayString(e.unref(o)("Last Modified"))+": ",1),e.createTextVNode(" "+e.toDisplayString(e.unref(Y)(e.unref(t).modal.data.item.last_modified)),1)])]),e.unref(t).features.includes(e.unref(B).DOWNLOAD)?(e.openBlock(),e.createElementBlock("div",Ta,[e.createElementVNode("span",null,e.toDisplayString(e.unref(o)(`Download doesn't work? You can try right-click "Download" button, select "Save link as...".`)),1)])):e.createCommentVNode("",!0)]),_:1}))}}),Aa={class:"sm:flex sm:items-start"},Oa=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})])],-1),Ua={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ha={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},qa={class:"mt-2"},Ra={class:"flex text-sm text-gray-800 dark:text-gray-400 py-2"},Ia={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Pa=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),Wa=[Pa],Ga={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Ya=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),Ka=[Ya],Ja={class:"ml-1.5"},Xa={name:"VFModalRename"},Qa=Object.assign(Xa,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(t.modal.data.items[0]),r=e.ref(t.modal.data.items[0].basename),l=e.ref(""),c=()=>{r.value!=""&&t.emitter.emit("vf-fetch",{params:{q:"rename",m:"post",adapter:t.adapter,path:t.data.dirname},body:{item:a.value.path,name:r.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("%s is renamed.",r.value)})},onError:s=>{l.value=o(s.message)}})};return(s,n)=>(e.openBlock(),e.createBlock(C,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Rename")),1),e.createElementVNode("button",{type:"button",onClick:n[2]||(n[2]=i=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Aa,[Oa,e.createElementVNode("div",Ua,[e.createElementVNode("h3",Ha,e.toDisplayString(e.unref(o)("Rename")),1),e.createElementVNode("div",qa,[e.createElementVNode("p",Ra,[a.value.type==="dir"?(e.openBlock(),e.createElementBlock("svg",Ia,Wa)):(e.openBlock(),e.createElementBlock("svg",Ga,Ka)),e.createElementVNode("span",Ja,e.toDisplayString(a.value.basename),1)]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=i=>r.value=i),onKeyup:e.withKeys(c,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:"Name",type:"text"},null,544),[[e.vModelText,r.value]]),l.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:n[1]||(n[1]=i=>l.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Za={class:"sm:flex sm:items-start"},en=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})])],-1),tn={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},on={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},rn={class:"mt-2"},an={key:0,class:"pointer-events-none"},nn={key:1,class:"pointer-events-none"},ln=["disabled"],sn=["disabled"],cn={class:"text-gray-500 text-sm mb-1 pr-1 max-h-[200px] overflow-y-auto vf-scrollbar"},dn={class:"rounded flex flex-shrink-0 w-6 h-6 border bg-gray-50 text-xs cursor-default dark:border-gray-700 dark:bg-gray-800 dark:text-gray-50"},un=["textContent"],mn={class:"ml-1 w-full h-fit"},pn={class:"text-left hidden md:block"},fn={class:"text-left md:hidden"},vn={key:0,class:"ml-auto"},hn=["title","disabled","onClick"],gn=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-5 h-5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1),kn=[gn],yn={key:0,class:"py-2"},_n=["disabled"],xn={name:"VFModalUpload"},wn=Object.assign(xn,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n,a=o("uppy"),r={PENDING:0,CANCELED:1,UPLOADING:2,ERROR:3,DONE:10},l=e.ref({QUEUE_ENTRY_STATUS:r}),c=e.ref(null),s=e.ref(null),n=e.ref(null),i=e.ref(null),p=e.ref(null),f=e.ref(null),k=e.ref([]),h=e.ref(""),w=e.ref(!1),y=e.ref(!1);let m;function u(E){return k.value.findIndex(x=>x.id===E)}function $(E,x=null){x=x??(E.webkitRelativePath||E.name),m.addFile({name:x,type:E.type,data:E,source:"Local"})}function S(E){switch(E.status){case r.DONE:return"text-green-600";case r.ERROR:return"text-red-600";case r.CANCELED:return"text-red-600";case r.PENDING:default:return""}}const M=E=>{switch(E.status){case r.DONE:return"✓";case r.ERROR:case r.CANCELED:return"!";case r.PENDING:default:return"..."}};function L(){i.value.click()}function F(){if(!w.value){if(!k.value.filter(E=>E.status!==r.DONE).length){h.value=o("Please select file to upload first.");return}h.value="",m.retryAll(),m.upload()}}function z(){m.cancelAll({reason:"user"}),k.value.forEach(E=>{E.status!==r.DONE&&(E.status=r.CANCELED,E.statusName=o("Canceled"))}),w.value=!1}function A(E){w.value||(m.removeFile(E.id,"removed-by-user"),k.value.splice(u(E.id),1))}function g(E){if(!w.value){if(m.cancelAll({reason:"user"}),E){const x=[];k.value.forEach(v=>{v.status!==r.DONE&&x.push(v)}),k.value=[],x.forEach(v=>{$(v.originalFile,v.name)});return}k.value.splice(0)}}function b(){t.emitter.emit("vf-modal-close")}function _(){return t.requester.transformRequestParams({url:"",method:"post",params:{q:"upload",adapter:t.data.adapter,path:t.data.dirname}})}return e.onMounted(async()=>{m=new oe({debug:t.debug,restrictions:{maxFileSize:ue(t.maxFileSize)},locale:a,onBeforeFileAdded(v,V){if(V[v.id]!=null){const T=u(v.id);k.value[T].status===r.PENDING&&(h.value=m.i18n("noDuplicates",{fileName:v.name})),k.value=k.value.filter(U=>U.id!==v.id)}return k.value.push({id:v.id,name:v.name,size:t.filesize(v.size),status:r.PENDING,statusName:o("Pending upload"),percent:null,originalFile:v.data}),!0}}),m.use(re,{endpoint:"WILL_BE_REPLACED_BEFORE_UPLOAD",limit:5,timeout:0,getResponseError(v,V){let N;try{N=JSON.parse(v).message}catch{N=o("Cannot parse server response.")}return new Error(N)}}),m.on("restriction-failed",(v,V)=>{const N=k.value[u(v.id)];A(N),h.value=V.message}),m.on("upload",()=>{const v=_();m.setMeta({...v.body});const V=m.getPlugin("XHRUpload");V.opts.method=v.method,V.opts.endpoint=v.url+"?"+new URLSearchParams(v.params),V.opts.headers=v.headers,w.value=!0,k.value.forEach(N=>{N.status!==r.DONE&&(N.percent=null,N.status=r.UPLOADING,N.statusName=o("Pending upload"))})}),m.on("upload-progress",(v,V)=>{const N=Math.floor(V.bytesUploaded/V.bytesTotal*100);k.value[u(v.id)].percent=`${N}%`}),m.on("upload-success",v=>{const V=k.value[u(v.id)];V.status=r.DONE,V.statusName=o("Done")}),m.on("upload-error",(v,V)=>{const N=k.value[u(v.id)];N.percent=null,N.status=r.ERROR,V.isNetworkError?N.statusName=o("Network Error, Unable establish connection to the server or interrupted."):N.statusName=V?V.message:o("Unknown Error")}),m.on("error",v=>{h.value=v.message,w.value=!1,t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname},noCloseModal:!0})}),m.on("complete",()=>{w.value=!1,t.emitter.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname},noCloseModal:!0})}),i.value.addEventListener("click",()=>{s.value.click()}),p.value.addEventListener("click",()=>{n.value.click()}),f.value.addEventListener("dragover",v=>{v.preventDefault(),y.value=!0}),f.value.addEventListener("dragleave",v=>{v.preventDefault(),y.value=!1});function E(v,V){V.isFile&&V.file(N=>v(V,N)),V.isDirectory&&V.createReader().readEntries(N=>{N.forEach(T=>{E(v,T)})})}f.value.addEventListener("drop",v=>{v.preventDefault(),y.value=!1;const V=/^[/\\](.+)/;[...v.dataTransfer.items].forEach(N=>{N.kind==="file"&&E((T,U)=>{const K=V.exec(T.fullPath);$(U,K[1])},N.webkitGetAsEntry())})});const x=({target:v})=>{const V=v.files;for(const N of V)$(N);v.value=""};s.value.addEventListener("change",x),n.value.addEventListener("change",x)}),e.onBeforeUnmount(()=>{m==null||m.close({reason:"unmount"})}),(E,x)=>(e.openBlock(),e.createBlock(C,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["vf-btn vf-btn-primary",w.value?"bg-blue-200 hover:bg-blue-200 dark:bg-gray-700/50 dark:hover:bg-gray-700/50 dark:text-gray-500":"bg-blue-600 hover:bg-blue-700 dark:bg-gray-700 dark:hover:bg-gray-500"]),disabled:w.value,onClick:e.withModifiers(F,["prevent"])},e.toDisplayString(e.unref(o)("Upload")),11,_n),w.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"vf-btn vf-btn-secondary",onClick:e.withModifiers(z,["prevent"])},e.toDisplayString(e.unref(o)("Cancel")),1)):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"vf-btn vf-btn-secondary",onClick:e.withModifiers(b,["prevent"])},e.toDisplayString(e.unref(o)("Close")),1))]),default:e.withCtx(()=>[e.createElementVNode("div",Za,[en,e.createElementVNode("div",tn,[e.createElementVNode("h3",on,e.toDisplayString(e.unref(o)("Upload Files")),1),e.createElementVNode("div",rn,[e.createElementVNode("div",{ref_key:"dropArea",ref:f,class:"flex items-center justify-center text-lg mb-4 text-gray-500 border-2 border-gray-300 rounded border-dashed select-none cursor-pointer dark:border-gray-600 h-[120px]",onClick:L},[y.value?(e.openBlock(),e.createElementBlock("div",an,e.toDisplayString(e.unref(o)("Release to drop these files.")),1)):(e.openBlock(),e.createElementBlock("div",nn,e.toDisplayString(e.unref(o)("Drag and drop the files/folders to here or click here.")),1))],512),e.createElementVNode("div",{ref_key:"container",ref:c,class:"text-gray-500 mb-1"},[e.createElementVNode("button",{ref_key:"pickFiles",ref:i,type:"button",class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Select Files")),513),e.createElementVNode("button",{ref_key:"pickFolders",ref:p,type:"button",class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Select Folders")),513),e.createElementVNode("button",{type:"button",class:"vf-btn vf-btn-secondary",disabled:w.value,onClick:x[0]||(x[0]=v=>g(!1))},e.toDisplayString(e.unref(o)("Clear all")),9,ln),e.createElementVNode("button",{type:"button",class:"vf-btn vf-btn-secondary",disabled:w.value,onClick:x[1]||(x[1]=v=>g(!0))},e.toDisplayString(e.unref(o)("Clear only successful")),9,sn)],512),e.createElementVNode("div",cn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,v=>(e.openBlock(),e.createElementBlock("div",{class:"flex hover:bg-gray-100 dark:hover:bg-gray-800 dark:hover:text-gray-300",key:v.id},[e.createElementVNode("span",dn,[e.createElementVNode("span",{class:e.normalizeClass(["text-base m-auto",S(v)]),textContent:e.toDisplayString(M(v))},null,10,un)]),e.createElementVNode("div",mn,[e.createElementVNode("div",pn,e.toDisplayString(e.unref(R)(v.name,40))+" ("+e.toDisplayString(v.size)+")",1),e.createElementVNode("div",fn,e.toDisplayString(e.unref(R)(v.name,16))+" ("+e.toDisplayString(v.size)+")",1),e.createElementVNode("div",{class:e.normalizeClass(["flex break-all text-left",S(v)])},[e.createTextVNode(e.toDisplayString(v.statusName)+" ",1),v.status===l.value.QUEUE_ENTRY_STATUS.UPLOADING?(e.openBlock(),e.createElementBlock("b",vn,e.toDisplayString(v.percent),1)):e.createCommentVNode("",!0)],2)]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["rounded w-5 h-5 border-1 text-base leading-none font-medium focus:outline-none dark:border-gray-200 dark:text-gray-400 dark:hover:text-gray-200 dark:bg-gray-600 ml-auto sm:text-xs hover:text-red-600",w.value?"disabled:bg-gray-100 text-white text-opacity-50":"bg-gray-100"]),title:e.unref(o)("Delete"),disabled:w.value,onClick:V=>A(v)},kn,10,hn)]))),128)),k.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",yn,e.toDisplayString(e.unref(o)("No files selected!")),1))]),h.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:x[2]||(x[2]=v=>h.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.value),1)]),_:1})):e.createCommentVNode("",!0)])])]),e.createElementVNode("input",{ref_key:"internalFileInput",ref:s,type:"file",multiple:"",class:"hidden"},null,512),e.createElementVNode("input",{ref_key:"internalFolderInput",ref:n,type:"file",multiple:"",webkitdirectory:"",class:"hidden"},null,512)]),_:1}))}}),bn={class:"sm:flex sm:items-start"},En=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"})])],-1),Vn={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Nn={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},$n={class:"mt-2"},Bn={class:"text-gray-500 text-sm mb-1 overflow-auto vf-scrollbar",style:{"max-height":"200px"}},Sn={class:"flex text-sm text-gray-800 dark:text-gray-400"},Cn={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Dn=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),Mn=[Dn],jn={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Tn=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),Ln=[Tn],Fn={class:"ml-1.5"},zn=["placeholder"],An={name:"VFModalArchive"},On=Object.assign(An,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n,a=e.ref(""),r=e.ref(""),l=e.ref(t.modal.data.items),c=()=>{l.value.length&&t.emitter.emit("vf-fetch",{params:{q:"archive",m:"post",adapter:t.adapter,path:t.data.dirname},body:{items:l.value.map(({path:s,type:n})=>({path:s,type:n})),name:a.value},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("The file(s) archived.")})},onError:s=>{r.value=o(s.message)}})};return(s,n)=>(e.openBlock(),e.createBlock(C,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Archive")),1),e.createElementVNode("button",{type:"button",onClick:n[2]||(n[2]=i=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",bn,[En,e.createElementVNode("div",Vn,[e.createElementVNode("h3",Nn,e.toDisplayString(e.unref(o)("Archive the files")),1),e.createElementVNode("div",$n,[e.createElementVNode("div",Bn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,i=>(e.openBlock(),e.createElementBlock("p",Sn,[i.type==="dir"?(e.openBlock(),e.createElementBlock("svg",Cn,Mn)):(e.openBlock(),e.createElementBlock("svg",jn,Ln)),e.createElementVNode("span",Fn,e.toDisplayString(i.basename),1)]))),256))]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=i=>a.value=i),onKeyup:e.withKeys(c,["enter"]),class:"my-1 px-2 py-1 border rounded dark:bg-gray-700/25 dark:focus:ring-gray-600 dark:focus:border-gray-600 dark:text-gray-100 w-full",placeholder:e.unref(o)("Archive name. (.zip file will be created)"),type:"text"},null,40,zn),[[e.vModelText,a.value]]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:n[1]||(n[1]=i=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Un={class:"sm:flex sm:items-start"},Hn=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24",stroke:"none","stroke-width":"1.5"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5m6 4.125l2.25 2.25m0 0l2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"})])],-1),qn={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Rn={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},In={class:"mt-2"},Pn={class:"flex text-sm text-gray-800 dark:text-gray-400"},Wn={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Gn=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),Yn=[Gn],Kn={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Jn=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),Xn=[Jn],Qn={class:"ml-1.5"},Zn={class:"my-1 text-sm text-gray-500"},el={name:"VFModalUnarchive"},tl=Object.assign(el,{setup(d){const t=e.inject("ServiceContainer");t.storage;const{t:o}=t.i18n;e.ref("");const a=e.ref(t.modal.data.items[0]),r=e.ref(""),l=e.ref([]),c=()=>{t.emitter.emit("vf-fetch",{params:{q:"unarchive",m:"post",adapter:t.adapter,path:t.data.dirname},body:{item:a.value.path},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("The file unarchived.")})},onError:s=>{r.value=o(s.message)}})};return(s,n)=>(e.openBlock(),e.createBlock(C,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Unarchive")),1),e.createElementVNode("button",{type:"button",onClick:n[1]||(n[1]=i=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Un,[Hn,e.createElementVNode("div",qn,[e.createElementVNode("h3",Rn,e.toDisplayString(e.unref(o)("Unarchive")),1),e.createElementVNode("div",In,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,i=>(e.openBlock(),e.createElementBlock("p",Pn,[i.type==="dir"?(e.openBlock(),e.createElementBlock("svg",Wn,Yn)):(e.openBlock(),e.createElementBlock("svg",Kn,Xn)),e.createElementVNode("span",Qn,e.toDisplayString(i.basename),1)]))),256)),e.createElementVNode("p",Zn,e.toDisplayString(e.unref(o)("The archive will be unarchived at"))+" ("+e.toDisplayString(s.current.dirname)+")",1),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:n[0]||(n[0]=i=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),ol={class:"sm:flex sm:items-start"},rl=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})])],-1),al={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},nl={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ll={class:"text-sm text-gray-500 pb-1"},sl={class:"max-h-[200px] overflow-y-auto vf-scrollbar text-left"},il={class:"flex text-sm text-gray-800 dark:text-gray-400"},cl={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},dl=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1),ul=[dl],ml={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},pl=e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1),fl=[pl],vl={class:"ml-1.5"},hl={class:"font-bold text-xs text-gray-700 dark:text-gray-500 mt-3 tracking-wider"},gl={class:"flex text-sm text-gray-800 dark:text-gray-400 border dark:border-gray-700 p-1 rounded"},kl=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-neutral-500 fill-sky-500 stroke-sky-500 dark:fill-slate-500 dark:stroke-slate-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})],-1),yl={class:"ml-1.5 overflow-auto"},_l={class:"m-1 mr-auto font-bold text-gray-500 text-sm dark:text-gray-200 self-center"},xl={name:"VFModalMove"},wl=Object.assign(xl,{setup(d){const t=e.inject("ServiceContainer"),{t:o}=t.i18n;t.storage;const a=e.ref(t.modal.data.items.from),r=e.ref(""),l=()=>{a.value.length&&t.emitter.emit("vf-fetch",{params:{q:"move",m:"post",adapter:t.adapter,path:t.data.dirname},body:{items:a.value.map(({path:c,type:s})=>({path:c,type:s})),item:t.modal.data.items.to.path},onSuccess:()=>{t.emitter.emit("vf-toast-push",{label:o("Files moved.",t.modal.data.items.to.name)})},onError:c=>{r.value=o(c.message)}})};return(c,s)=>(e.openBlock(),e.createBlock(C,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:l,class:"vf-btn vf-btn-primary"},e.toDisplayString(e.unref(o)("Yes, Move!")),1),e.createElementVNode("button",{type:"button",onClick:s[1]||(s[1]=n=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(o)("Cancel")),1),e.createElementVNode("div",_l,e.toDisplayString(e.unref(o)("%s item(s) selected.",a.value.length)),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ol,[rl,e.createElementVNode("div",al,[e.createElementVNode("h3",nl,e.toDisplayString(e.unref(o)("Move files")),1),e.createElementVNode("p",ll,e.toDisplayString(e.unref(o)("Are you sure you want to move these files?")),1),e.createElementVNode("div",sl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,n=>(e.openBlock(),e.createElementBlock("div",il,[e.createElementVNode("div",null,[n.type==="dir"?(e.openBlock(),e.createElementBlock("svg",cl,ul)):(e.openBlock(),e.createElementBlock("svg",ml,fl))]),e.createElementVNode("div",vl,e.toDisplayString(n.path),1)]))),256))]),e.createElementVNode("h4",hl,e.toDisplayString(e.unref(o)("Target Directory")),1),e.createElementVNode("p",gl,[kl,e.createElementVNode("span",yl,e.toDisplayString(e.unref(t).modal.data.items.to.path),1)]),r.value.length?(e.openBlock(),e.createBlock(D,{key:0,onHidden:s[0]||(s[0]=n=>r.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("",!0)])])]),_:1}))}}),bl=(d,t)=>{const o=d.__vccOpts||d;for(const[a,r]of t)o[a]=r;return o},El={props:{on:{type:String,required:!0}},setup(d,{emit:t,slots:o}){const a=e.inject("ServiceContainer"),r=e.ref(!1),{t:l}=a.i18n;let c=null;const s=()=>{clearTimeout(c),r.value=!0,c=setTimeout(()=>{r.value=!1},2e3)};return e.onMounted(()=>{a.emitter.on(d.on,s)}),e.onUnmounted(()=>{clearTimeout(c)}),{shown:r,t:l}}},Vl={key:1};function Nl(d,t,o,a,r,l){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["text-sm text-green-600 dark:text-green-600 transition-opacity duration-500 ease-out",[{"opacity-0":!a.shown}]])},[d.$slots.default?e.renderSlot(d.$slots,"default",{key:0}):(e.openBlock(),e.createElementBlock("span",Vl,e.toDisplayString(a.t("Saved.")),1))],2)}const q=bl(El,[["render",Nl]]),$l={class:"sm:flex sm:items-start"},Bl=e.createElementVNode("div",{class:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-50 dark:bg-gray-500 sm:mx-0 sm:h-10 sm:w-10"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6 stroke-blue-600 dark:stroke-blue-100",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})])],-1),Sl={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Cl={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Dl={class:"mt-2"},Ml={class:"text-sm text-gray-500"},jl={class:"text-sm font-semibold mt-5 text-gray-900 dark:text-gray-400 tracking-wider"},Tl={class:"mt-3 text-left"},Ll={class:"space-y-2"},Fl={class:"flex relative gap-x-3"},zl={class:"h-6 items-center"},Al={class:"flex-1 block text-sm"},Ol={for:"metric_unit",class:"flex w-full font-medium text-gray-900 dark:text-gray-400"},Ul={class:"flex relative gap-x-3"},Hl={class:"h-6 items-center"},ql={for:"theme",class:"flex w-full font-medium text-gray-900 dark:text-gray-400 text-sm"},Rl={class:"flex text-sm"},Il=["label"],Pl=["value"],Wl={key:0,class:"flex relative gap-x-3"},Gl={class:"h-6 items-center"},Yl={for:"language",class:"flex w-full font-medium text-gray-900 dark:text-gray-400 text-sm text-nowrap"},Kl={class:"flex text-sm"},Jl=["label"],Xl=["value"],Ql={name:"VFModalAbout"},Zl=Object.assign(Ql,{setup(d){const t=e.inject("ServiceContainer"),{getStore:o,setStore:a,clearStore:r}=t.storage,{t:l,changeLocale:c,locale:s}=t.i18n;e.ref(""),e.ref("");const n=async()=>{r(),location.reload()},i=y=>{t.theme.set(y),t.emitter.emit("vf-theme-saved")},p=()=>{t.metricUnits=!t.metricUnits,t.filesize=t.metricUnits?G:W,a("metricUnits",t.metricUnits),t.emitter.emit("vf-metric-units-saved")},{i18n:f}=e.inject("VueFinderOptions"),h=Object.fromEntries(Object.entries({en:"English",fr:"French (Français)",de:"German (Deutsch)",fa:"Persian (فارسی)",he:"Hebrew (עִברִית)",hi:"Hindi (हिंदी)",ru:"Russian (Pусский)",sv:"Swedish (Svenska)",tr:"Turkish (Türkçe)",zhCN:"Simplified Chinese (简体中文)",zhTW:"Traditional Chinese (繁體中文)"}).filter(([y])=>Object.keys(f).includes(y))),w=e.computed(()=>({system:l("System"),light:l("Light"),dark:l("Dark")}));return(y,m)=>(e.openBlock(),e.createBlock(C,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m[5]||(m[5]=u=>e.unref(t).emitter.emit("vf-modal-close")),class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(l)("Close")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",$l,[Bl,e.createElementVNode("div",Sl,[e.createElementVNode("h3",Cl,e.toDisplayString(e.unref(l)("About %s","Vuefinder "+e.unref(t).version)),1),e.createElementVNode("div",Dl,[e.createElementVNode("p",Ml,e.toDisplayString(e.unref(l)("Vuefinder is a file manager component for vue 3.")),1),e.createElementVNode("div",null,[e.createElementVNode("h3",jl,e.toDisplayString(e.unref(l)("Settings")),1)]),e.createElementVNode("div",Tl,[e.createElementVNode("fieldset",null,[e.createElementVNode("div",Ll,[e.createElementVNode("div",Fl,[e.createElementVNode("div",zl,[e.withDirectives(e.createElementVNode("input",{id:"metric_unit",name:"metric_unit",type:"checkbox","onUpdate:modelValue":m[0]||(m[0]=u=>e.unref(t).metricUnits=u),onClick:p,class:"h-4 w-4 rounded border-gray-300 text-indigo-600 dark:accent-slate-400 focus:ring-indigo-600"},null,512),[[e.vModelCheckbox,e.unref(t).metricUnits]])]),e.createElementVNode("div",Al,[e.createElementVNode("label",Ol,[e.createTextVNode(e.toDisplayString(e.unref(l)("Use Metric Units"))+" ",1),e.createVNode(q,{class:"ms-3",on:"vf-metric-units-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("Saved.")),1)]),_:1})])])]),e.createElementVNode("div",Ul,[e.createElementVNode("div",Hl,[e.createElementVNode("label",ql,e.toDisplayString(e.unref(l)("Theme")),1)]),e.createElementVNode("div",Rl,[e.withDirectives(e.createElementVNode("select",{id:"theme","onUpdate:modelValue":m[1]||(m[1]=u=>e.unref(t).theme.value=u),onChange:m[2]||(m[2]=u=>i(u.target.value)),class:"flex-shrink-0 w-full text-sm text-slate-500 border dark:border-gray-600 dark:text-neutral-50 dark:bg-gray-700 rounded"},[e.createElementVNode("optgroup",{label:e.unref(l)("Theme")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(u,$)=>(e.openBlock(),e.createElementBlock("option",{value:$},e.toDisplayString(u),9,Pl))),256))],8,Il)],544),[[e.vModelSelect,e.unref(t).theme.value]]),e.createVNode(q,{class:"ms-3 flex-shrink-0 flex-grow basis-full",on:"vf-theme-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("Saved.")),1)]),_:1})])]),e.unref(t).features.includes(e.unref(B).LANGUAGE)&&Object.keys(e.unref(h)).length>1?(e.openBlock(),e.createElementBlock("div",Wl,[e.createElementVNode("div",Gl,[e.createElementVNode("label",Yl,e.toDisplayString(e.unref(l)("Language")),1)]),e.createElementVNode("div",Kl,[e.withDirectives(e.createElementVNode("select",{id:"language","onUpdate:modelValue":m[3]||(m[3]=u=>e.isRef(s)?s.value=u:null),onChange:m[4]||(m[4]=u=>e.unref(c)(u.target.value)),class:"flex-shrink-0 w-1/2 sm:w-full text-sm text-slate-500 border dark:border-gray-600 dark:text-neutral-50 dark:bg-gray-700 rounded"},[e.createElementVNode("optgroup",{label:e.unref(l)("Language")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(h),(u,$)=>(e.openBlock(),e.createElementBlock("option",{value:$},e.toDisplayString(u),9,Xl))),256))],8,Jl)],544),[[e.vModelSelect,e.unref(s)]]),e.createVNode(q,{class:"ms-3 flex-shrink-0 flex-grow basis-full",on:"vf-language-saved"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("Saved.")),1)]),_:1})])])):e.createCommentVNode("",!0),e.createElementVNode("button",{onClick:n,type:"button",class:"vf-btn vf-btn-secondary"},e.toDisplayString(e.unref(l)("Reset Settings")),1)])])])])])])]),_:1}))}}),es=Object.freeze(Object.defineProperty({__proto__:null,ModalAbout:Zl,ModalArchive:On,ModalDelete:wr,ModalMessage:Cr,ModalMove:wl,ModalNewFile:Yr,ModalNewFolder:Or,ModalPreview:za,ModalRename:Qa,ModalUnarchive:tl,ModalUpload:wn},Symbol.toStringTag,{value:"Module"})),ts={install(d,t={}){d.component("VueFinder",Ko);for(const a of Object.values(es))d.component(a.name,a);t.i18n=t.i18n??{};let[o]=Object.keys(t.i18n);t.locale=t.locale??o??"en",d.provide("VueFinderOptions",t)}};module.exports=ts;
|