From 092433ccb5899cc1737ed1a4bec3089f43ca87ac Mon Sep 17 00:00:00 2001 From: Yusuf Date: Sat, 8 Oct 2022 20:12:14 +0300 Subject: [PATCH] update version --- README.md | 2 +- dist/vuefinder.js | 2 +- dist/vuefinder.umd.cjs | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fff05a60..d2b01a7f 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ Html - [ ] transfer items between adapters ### Known Issues -- [ ] Viewport height issue on mobile browsers +- [x] Viewport height issue on mobile browsers (fixed) - [ ] Scrolling issue on ios devices (forced hidden scrollbar) - [ ] Default storage naming error if not 'local' exists diff --git a/dist/vuefinder.js b/dist/vuefinder.js index 7db0bf7e..acb377bd 100644 --- a/dist/vuefinder.js +++ b/dist/vuefinder.js @@ -2507,7 +2507,7 @@ const ln = { class: "relative flex-auto flex flex-col overflow-hidden" }, cn = { _e(Zs) ])); } -}), qn = "1.1.12", Gn = { class: "p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none" }, Jn = { class: "flex leading-5 items-center" }, Zn = ["aria-label"], Qn = /* @__PURE__ */ u("svg", { +}), qn = "1.1.13", Gn = { class: "p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none" }, Jn = { class: "flex leading-5 items-center" }, Zn = ["aria-label"], Qn = /* @__PURE__ */ u("svg", { xmlns: "http://www.w3.org/2000/svg", class: "h-5 w-5", fill: "none", diff --git a/dist/vuefinder.umd.cjs b/dist/vuefinder.umd.cjs index c5d0ebf1..3bf642a4 100644 --- a/dist/vuefinder.umd.cjs +++ b/dist/vuefinder.umd.cjs @@ -1,6 +1,6 @@ (function(e,Pe){typeof exports=="object"&&typeof module<"u"?module.exports=Pe(require("vue"),require("plupload")):typeof define=="function"&&define.amd?define(["vue","plupload"],Pe):(e=typeof globalThis<"u"?globalThis:e||self,e.VueFinder=Pe(e.Vue,e.plupload))})(this,function(e,Pe){var uo;"use strict";const gt=(r=>r&&typeof r=="object"&&"default"in r?r:{default:r})(Pe),Qe=(uo=document.querySelector('meta[name="csrf-token"]'))==null?void 0:uo.getAttribute("content"),et=(r,{method:t="get",params:o={},json:n=!0,signal:s=null})=>{const a={method:t};if(a.signal=s,t=="get")r+="?"+new URLSearchParams(o);else{a.headers={},Qe&&(a.headers["X-CSRF-Token"]=Qe);let l=new FormData;for(const[m,p]of Object.entries(o))l.append(m,p);a.body=l}return fetch(r,a).then(l=>l.ok?n?l.json():l.text():l.json().then(Promise.reject.bind(Promise)))};function To(r){return{all:r=r||new Map,on:function(t,o){var n=r.get(t);n?n.push(o):r.set(t,[o])},off:function(t,o){var n=r.get(t);n&&(o?n.splice(n.indexOf(o)>>>0,1):r.set(t,[]))},emit:function(t,o){var n=r.get(t);n&&n.slice().map(function(s){s(o)}),(n=r.get("*"))&&n.slice().map(function(s){s(t,o)})}}}function yt(r){let t=localStorage.getItem(r+"_storage");const o=e.ref(JSON.parse(t));e.watch(o,n);function n(){o.value===null||o.value===""?localStorage.removeItem(r+"_storage"):localStorage.setItem(r+"_storage",JSON.stringify(o.value))}function s(m,p){o.value=Object.assign({...o.value},{[m]:p})}function a(){o.value=null}return{getStore:(m,p=null)=>o.value===null||o.value===""?p:o.value.hasOwnProperty(m)?o.value[m]:p,setStore:s,clearStore:a}}const Jt=e.ref("");function le(){function r(t){Jt.value=t}return{apiUrl:Jt,setApiUrl:r}}const Ao={class:"border-neutral-300 flex justify-between items-center py-1 text-sm"},Oo={key:0,class:"flex text-center"},Lo=["aria-label"],Io=[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)],jo=["aria-label"],Po=[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)],zo=["aria-label"],Ro=[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)],Ho=["aria-label"],Fo=[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)],Uo=["aria-label"],Ko=[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)],Yo=["aria-label"],Wo=[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)],Xo=["aria-label"],qo=[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)],Go={key:1,class:"flex text-center"},Jo={class:"pl-2"},Zo={class:"dark:bg-gray-700 bg-gray-200 text-xs px-2 py-1 rounded"},Qo={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"},en=[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),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)],tn={class:"flex text-center items-center justify-end"},rn=["aria-label"],on=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z"},null,-1)],nn=["aria-label"],an={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"},sn={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"},ln={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"},cn=["aria-label"],dn={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"},hn={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"},un=Object.assign({name:"VFToolbar"},{props:{data:Object},setup(r){const t=e.inject("emitter"),{getStore:o,setStore:n}=e.inject("storage"),{t:s}=e.inject("i18n"),a=e.ref(o("viewport","grid")),l=e.ref([]),m=e.ref(o("full-screen",!1)),p=e.ref("");t.on("vf-search-query",({newQuery:b})=>{p.value=b});const f=e.inject("loadingState"),h=()=>f.value,y=()=>{m.value=!m.value,t.emit("vf-fullscreen-toggle")};return t.on("vf-nodes-selected",b=>{l.value=b}),t.on("vf-view-toggle",b=>{n("viewport",b),a.value=b}),(b,D)=>(e.openBlock(),e.createElementBlock("div",Ao,[p.value.length?(e.openBlock(),e.createElementBlock("div",Go,[e.createElementVNode("div",Jo,[e.createTextVNode(e.toDisplayString(e.unref(s)("Search results for"))+" ",1),e.createElementVNode("span",Zo,e.toDisplayString(p.value),1)]),h()?(e.openBlock(),e.createElementBlock("svg",Qo,en)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Oo,[e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("New Folder"),"data-microtip-position":"bottom-right",role:"tooltip",onClick:D[0]||(D[0]=_=>e.unref(t).emit("vf-modal-show",{type:"new-folder",items:l.value}))},Io,8,Lo),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("New File"),"data-microtip-position":"bottom",role:"tooltip",onClick:D[1]||(D[1]=_=>e.unref(t).emit("vf-modal-show",{type:"new-file",items:l.value}))},Po,8,jo),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Rename"),"data-microtip-position":"bottom",role:"tooltip",onClick:D[2]||(D[2]=_=>l.value.length!=1||e.unref(t).emit("vf-modal-show",{type:"rename",items:l.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([l.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"},Ro,2))],8,zo),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Delete"),"data-microtip-position":"bottom",role:"tooltip",onClick:D[3]||(D[3]=_=>!l.value.length||e.unref(t).emit("vf-modal-show",{type:"delete",items:l.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([l.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"},Fo,2))],8,Ho),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Upload"),"data-microtip-position":"bottom",role:"tooltip",onClick:D[4]||(D[4]=_=>e.unref(t).emit("vf-modal-show",{type:"upload",items:l.value}))},Ko,8,Uo),l.value.length==1&&l.value[0].mime_type=="application/zip"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mx-1.5","aria-label":e.unref(s)("Unrchive"),"data-microtip-position":"bottom",role:"tooltip",onClick:D[5]||(D[5]=_=>!l.value.length||e.unref(t).emit("vf-modal-show",{type:"unarchive",items:l.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([l.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"},Wo,2))],8,Yo)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"mx-1.5","aria-label":e.unref(s)("Archive"),"data-microtip-position":"bottom",role:"tooltip",onClick:D[6]||(D[6]=_=>!l.value.length||e.unref(t).emit("vf-modal-show",{type:"archive",items:l.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([l.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"},qo,2))],8,Xo))])),e.createElementVNode("div",tn,[e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Dark Mode"),"data-microtip-position":"bottom",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:D[7]||(D[7]=_=>e.unref(t).emit("vf-darkMode-toggle")),viewBox:"0 0 24 24","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"h-6 w-6 m-auto cursor-pointer stroke-sky-500 fill-sky-100 hover:stroke-sky-600 dark:stroke-gray-400 dark:fill-gray-400/20 dark:hover:stroke-gray-300"},on))],8,rn),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Toggle Full Screen"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:y},[(e.openBlock(),e.createElementBlock("svg",an,[m.value?(e.openBlock(),e.createElementBlock("path",sn)):(e.openBlock(),e.createElementBlock("path",ln))]))],8,nn),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Change View"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:D[8]||(D[8]=_=>p.value.length||e.unref(t).emit("vf-view-toggle",a.value=="list"?"grid":"list"))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([p.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"},[a.value=="grid"?(e.openBlock(),e.createElementBlock("path",dn)):e.createCommentVNode("",!0),a.value=="list"?(e.openBlock(),e.createElementBlock("path",hn)):e.createCommentVNode("",!0)],2))],8,cn)])]))}});var mn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Zt={exports:{}};(function(r,t){(function(o,n){r.exports=n()})(mn,function(){function o(u,c){if(!(u instanceof c))throw new TypeError("Cannot call a class as a function")}function n(u,c){for(var i=0;i"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function b(u,c,i){return y()?b=Reflect.construct:b=function(d,v,w){var x=[null];x.push.apply(x,v);var E=Function.bind.apply(d,x),V=new E;return w&&h(V,w.prototype),V},b.apply(null,arguments)}function D(u){return Function.toString.call(u).indexOf("[native code]")!==-1}function _(u){var c=typeof Map=="function"?new Map:void 0;return _=function(g){if(g===null||!D(g))return g;if(typeof g!="function")throw new TypeError("Super expression must either be null or a function");if(typeof c<"u"){if(c.has(g))return c.get(g);c.set(g,d)}function d(){return b(g,arguments,f(this).constructor)}return d.prototype=Object.create(g.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),h(d,g)},_(u)}function k(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function $(u,c){return c&&(typeof c=="object"||typeof c=="function")?c:k(u)}function P(u){var c=y();return function(){var g=f(u),d;if(c){var v=f(this).constructor;d=Reflect.construct(g,arguments,v)}else d=g.apply(this,arguments);return $(this,d)}}function L(u,c){for(;!Object.prototype.hasOwnProperty.call(u,c)&&(u=f(u),u!==null););return u}function B(u,c,i){return typeof Reflect<"u"&&Reflect.get?B=Reflect.get:B=function(d,v,w){var x=L(d,v);if(!!x){var E=Object.getOwnPropertyDescriptor(x,v);return E.get?E.get.call(w):E.value}},B(u,c,i||u)}function T(u,c){return j(u)||Z(u,c)||ee(u,c)||O()}function R(u){return S(u)||Y(u)||ee(u)||M()}function S(u){if(Array.isArray(u))return ne(u)}function j(u){if(Array.isArray(u))return u}function Y(u){if(typeof Symbol<"u"&&Symbol.iterator in Object(u))return Array.from(u)}function Z(u,c){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(u)))){var i=[],g=!0,d=!1,v=void 0;try{for(var w=u[Symbol.iterator](),x;!(g=(x=w.next()).done)&&(i.push(x.value),!(c&&i.length===c));g=!0);}catch(E){d=!0,v=E}finally{try{!g&&w.return!=null&&w.return()}finally{if(d)throw v}}return i}}function ee(u,c){if(!!u){if(typeof u=="string")return ne(u,c);var i=Object.prototype.toString.call(u).slice(8,-1);if(i==="Object"&&u.constructor&&(i=u.constructor.name),i==="Map"||i==="Set")return Array.from(u);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return ne(u,c)}}function ne(u,c){(c==null||c>u.length)&&(c=u.length);for(var i=0,g=new Array(c);i1&&arguments[1]!==void 0?arguments[1]:0;return{left:c.x,top:c.y,right:c.x,bottom:c.y,width:i,height:i}},Q=function(c){return{x:c,y:c}},W=function(u,c,i){window.addEventListener("resize",c),window.addEventListener("scroll",c),u.forEach(function(g,d){i.observe(g,{childList:d!==0,attributes:!0})})},Je=function(u){var c=Le(u);return c.x||c.y?!0:u instanceof HTMLDocument?u.body?!!(u.body.scrollTop=1):!!(u.documentElement.scrollTop=1):!!(u.scrollTop=1)},ut=function(u){var c=document.createElement("div");return c.style.position="fixed",c.style.overflow="hidden",c.style.pointerEvents="none",c.style.zIndex="999999999999999999",c.classList.add(u),c},mt=function(u){var c=document.createElement("div");return c.style.position="absolute",u||(c.style.background="rgba(0, 0, 255, 0.1)",c.style.border="1px solid rgba(0, 0, 255, 0.45)",c.style.display="none",c.style.pointerEvents="none"),c},ft=function(u,c){var i;return function(){for(var g=arguments.length,d=new Array(g),v=0;v=0?u.scrollLeft:Oe().x,y:u.scrollTop>=0?u.scrollTop:Oe().y}},mo=function(u){var c=u.elementRect,i=u.containerRect,g=u.tolerance,d=g===void 0?{x:0,y:0}:g,v=[];return c.top-d.yi.bottom&&v.push("bottom"),c.right+d.y>i.right&&v.push("right"),v},Vd=function(u){var c=u.event;return{x:c.clientX,y:c.clientY}},$d=function(u){var c=u.scrollAmount,i=u.initialPointerPos,g=u.pointerPos,d={};return g.x>i.x-c.x?(d.left=i.x-c.x,d.width=g.x-i.x+c.x):(d.left=g.x,d.width=i.x-g.x-c.x),g.y>i.y-c.y?(d.top=i.y-c.y,d.height=g.y-i.y+c.y):(d.top=g.y,d.height=i.y-g.y-c.y),d},fo=function(c){var i={x:0,y:0},g=window.getComputedStyle(c);if(!g.transform||g.transform==="none")return i;if(g.transform.indexOf("3d")>=0){var d=g.transform.trim().match(/matrix3d\((.*?)\)/);if(d&&d.length){var v,w=(v=d[1])===null||v===void 0?void 0:v.split(",");i.x=parseInt(w[12])||0,i.y=parseInt(w[13])||0}return i}else{var x=g.transform.trim().match(/matrix\((.*?)\)/);if(x&&x.length){var E,V=(E=x[1])===null||E===void 0?void 0:E.split(",");i.x=parseInt(V[4])||0,i.y=parseInt(V[5])||0}return i}},Md=function(c){var i=c.style.transform;if(!i||i.indexOf("translate")<0)return fo(c);var g={x:0,y:0},d=i.trim().match(/translate[3dD]*?\(.*?\)/);if(d){var v,w=(v=d[0])===null||v===void 0?void 0:v.split("(");if(w){var x,E=(x=w[1])===null||x===void 0?void 0:x.split(",");g.x=parseInt(E[0])||0,g.y=parseInt(E[1])||0}}return!g.x&&!g.x?fo(c):g},Bd=function(c){var i=c.style,g={x:parseInt(i.left)||0,y:parseInt(i.top)||0};if(!g.x&&!g.x){var d=window.getComputedStyle(c);return{x:parseInt(d.left)||0,y:parseInt(d.top)||0}}return g},Td=function(u,c){return c?Md(u):Bd(u)},Ad=function(u){var c=u.element,i=u.edges,g=u.elementRect,d=u.containerRect,v=u.elementPos,w=u.useTransform;i.includes("top")&&Ze(c,{y:v.y+d.top-g.top,x:v.x},w),i.includes("left")&&Ze(c,{y:v.y,x:v.x+d.left-g.left},w),i.includes("bottom")&&Ze(c,{y:v.y+d.bottom-g.bottom,x:v.x},w),i.includes("right")&&Ze(c,{y:v.y,x:v.x+d.right-g.right},w)},po=function(u){var c=u.computedStyle,i=u.node,g=c.position,d=g==="absolute"||g==="relative"||g==="fixed";!(i instanceof HTMLDocument)&&!d&&(i.style.position="relative")},Od=function(u){var c=u.shiftKey,i=u.keyboardDragSpeed,g=u.zoom,d=u.key,v=u.dragKeys,w=u.scrollDiff,x=u.canScroll,E=u.scrollCallback,V={x:0,y:0},N=c?i*4*g:i*g;return v.left.includes(d)&&(V.x=w.x||-N,!c&&!w.x&&x&&E(["left"],i)),v.right.includes(d)&&(V.x=w.x||N,!c&&!w.x&&x&&E(["right"],i)),v.up.includes(d)&&(V.y=w.y||-N,!c&&!w.y&&x&&E(["top"],i)),v.down.includes(d)&&(V.y=w.y||N,!c&&!w.y&&x&&E(["bottom"],i)),V},Ld=function(u){var c=u.element,i=u.force,g=u.multiSelectionToggle,d=u.SelectedSet,v=u.hoverClassName;c.classList.contains(v)&&!i||(d.has(c)?g&&d.delete(c):d.add(c),c.classList.add(v))},Id=function(u){var c=u.element,i=u.force,g=u.SelectedSet,d=u.PrevSelectedSet,v=u.hoverClassName;if(!c.classList.contains(v)&&!i)return!1;var w=g.has(c),x=d.has(c);w&&!x?g.delete(c):!w&&x&&g.add(c),c.classList.remove(v)},qt=function(u,c){return u.leftc.left&&u.topc.top},go=function(u){var c=u.element,i=u.posDirection,g=u.containerRect,d=u.useTransform,v=Td(c,d),w=C(v,"+",i);Ze(c,w,d);var x=c.getBoundingClientRect(),E=mo({elementRect:x,containerRect:g});Ad({element:c,edges:E,elementRect:x,containerRect:g,elementPos:w,useTransform:d})},jd=function(u,c){window.removeEventListener("resize",c),window.removeEventListener("scroll",c),u.disconnect()},Pd=function(u,c,i){if(!!c.length){var g=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,d=u instanceof HTMLDocument?g||document.body:u,v=c.includes("top")&&d.scrollTop>0,w=c.includes("bottom")&&d.scrollTop0,E=c.includes("right")&&d.scrollLeft1&&arguments[1]!==void 0?arguments[1]:0,x=(v=d[w])===null||v===void 0?void 0:v.parentNode;return x?(d.push(x),w++,g(d,w)):d};return this._parentNodes=i([this.HTMLNode]),this._parentNodes}}]),u}(),Hd=function(){function u(c){var i=this,g=c.DS,d=c.dragKeys,v=c.draggability,w=c.keyboardDrag,x=c.keyboardDragSpeed,E=c.useTransform,V=c.zoom;o(this,u),a(this,"_useTransform",void 0),a(this,"_prevCursorPos",void 0),a(this,"_prevScrollPos",void 0),a(this,"_elements",[]),a(this,"_draggability",void 0),a(this,"_dragKeys",void 0),a(this,"_dragKeysFlat",void 0),a(this,"_keyboardDrag",void 0),a(this,"_keyboardDragSpeed",void 0),a(this,"_zoom",void 0),a(this,"keyboardDrag",function(N){var A=N.event,I=N.key;if(!(!i._keyboardDrag||!i._dragKeysFlat.includes(I)||!i.DS.SelectedSet.size||!i._draggability||i.DS.continue)){var X={event:A,isDragging:!0,isDraggingKeyboard:!0};i.DS.publish(["Interaction:start:pre","Interaction:start"],X),i._elements=i.DS.getSelection(),i.handleZIndex(!0);var ae=Od({shiftKey:i.DS.stores.KeyStore.currentValues.includes("shift"),keyboardDragSpeed:i._keyboardDragSpeed,zoom:i._zoom,key:I,scrollCallback:i.DS.Area.scroll,scrollDiff:i._scrollDiff,canScroll:i.DS.stores.ScrollStore.canScroll,dragKeys:i._dragKeys});i._elements.forEach(function(G){return go({element:G,posDirection:ae,containerRect:i.DS.SelectorArea.rect,useTransform:i._useTransform})}),i.DS.publish(["Interaction:update:pre","Interaction:update"],X)}}),a(this,"keyboardEnd",function(N){var A=N.event,I=N.key;if(!(!i._keyboardDrag||!i._dragKeysFlat.includes(I)||!i.DS.SelectedSet.size||!i._draggability)){var X={event:A,isDragging:i._draggability,isDraggingKeyboard:!0};i.DS.publish(["Interaction:end:pre","Interaction:end"],X)}}),a(this,"start",function(N){var A=N.isDragging,I=N.isDraggingKeyboard;!A||I||(i._prevCursorPos=null,i._prevScrollPos=null,i._elements=i.DS.getSelection(),i.handleZIndex(!0))}),a(this,"stop",function(N){N!=null&&N.isKeyboard||(i._prevCursorPos=null,i._prevScrollPos=null,i.handleZIndex(!1),i._elements=[])}),a(this,"update",function(N){var A=N.isDragging,I=N.isDraggingKeyboard;if(!(!A||!i._elements.length||I||i.DS.continue)){var X=C(i._cursorDiff,"+",i._scrollDiff);i._elements.forEach(function(ae){return go({element:ae,posDirection:X,containerRect:i.DS.SelectorArea.rect,useTransform:i._useTransform})})}}),a(this,"handleZIndex",function(N){i._elements.forEach(function(A){return A.style.zIndex="".concat((parseInt(A.style.zIndex)||0)+N?9999:-9998)})}),this.DS=g,this._useTransform=E,this._keyboardDragSpeed=x,this._keyboardDrag=w,this._zoom=V,this._draggability=v,this._dragKeys={up:d.up.map(function(N){return N.toLowerCase()}),down:d.down.map(function(N){return N.toLowerCase()}),left:d.left.map(function(N){return N.toLowerCase()}),right:d.right.map(function(N){return N.toLowerCase()})},this._dragKeysFlat=[].concat(R(this._dragKeys.up),R(this._dragKeys.down),R(this._dragKeys.left),R(this._dragKeys.right)),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("KeyStore:down",this.keyboardDrag),this.DS.subscribe("KeyStore:up",this.keyboardEnd)}return s(u,[{key:"_cursorDiff",get:function(){var i=this.DS.stores.PointerStore.currentVal,g=this._prevCursorPos?C(i,"-",this._prevCursorPos):{x:0,y:0};return this._prevCursorPos=i,g}},{key:"_scrollDiff",get:function(){var i=this.DS.stores.ScrollStore.currentVal,g=this._prevScrollPos?C(i,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=i,g}}]),u}(),Fd=function(){function u(c){var i=this,g=c.DS,d=c.areaElement,v=c.draggability,w=c.immediateDrag,x=c.selectableClass;o(this,u),a(this,"_areaElement",void 0),a(this,"_draggability",void 0),a(this,"_immediateDrag",void 0),a(this,"_selectableClass",void 0),a(this,"isInteracting",void 0),a(this,"isDragging",void 0),a(this,"init",function(){return i.DS.publish("Interaction:init:pre",{})}),a(this,"_init",function(){i.stop(),i._areaElement.addEventListener("mousedown",i.start),i._areaElement.addEventListener("touchstart",i.start,{passive:!1}),i.DS.publish("Interaction:init",{})}),a(this,"start",function(E){return i.DS.publish("Interaction:start:pre",{event:E,isDragging:i.isDragging})}),a(this,"_start",function(E){E.type==="touchstart"&&E.preventDefault(),i._canInteract(E)&&(i.isInteracting=!0,i.isDragging=i.isDragEvent(E),i.DS.publish("Interaction:start",{event:E,isDragging:i.isDragging}),document.addEventListener("mouseup",i.reset),document.addEventListener("touchend",i.reset))}),a(this,"isDragEvent",function(E){var V=E.target.closest(".".concat(i._selectableClass));return!i._draggability||i.DS.stores.KeyStore.isMultiSelectKeyPressed(E)||!V?!1:(i._immediateDrag&&(i.DS.SelectedSet.size?i.DS.SelectedSet.has(V)||(i.DS.SelectedSet.clear(),i.DS.SelectedSet.add(V)):i.DS.SelectedSet.add(V)),!!i.DS.SelectedSet.has(V))}),a(this,"onClick",function(E){var V=E.event;if(!!i._canInteract(V)&&!(V.detail>0)){var N=i.DS,A=N.stores,I=A.PointerStore,X=A.KeyStore,ae=N.SelectableSet,G=N.SelectedSet;I.start(V);var je=V.target;!ae.has(je)||(X.isMultiSelectKeyPressed(V)||G.clear(),G.toggle(je),i.reset())}}),a(this,"stop",function(){i.isInteracting=!1,i.isDragging=!1,i._areaElement.removeEventListener("mousedown",i.start),i._areaElement.removeEventListener("touchstart",i.start,{passive:!1}),document.removeEventListener("mouseup",i.reset),document.removeEventListener("touchend",i.reset)}),a(this,"update",function(E){var V=E.event,N=E.scroll_directions,A=E.scroll_multiplier;i.isInteracting&&i.DS.publish(["Interaction:update:pre","Interaction:update"],{event:V,scroll_directions:N,scroll_multiplier:A,isDragging:i.isDragging})}),a(this,"reset",function(E){return i.DS.publish("Interaction:end:pre",{event:E,isDragging:i.isDragging})}),a(this,"_reset",function(E){var V=i.isDragging;i.stop(),i.init(),i.DS.publish("Interaction:end",{event:E,isDragging:V})}),this._areaElement=d,this._draggability=v,this._immediateDrag=w,this._selectableClass=x,this.DS=g,this.DS.subscribe("PointerStore:updated",this.update),this.DS.subscribe("Selectable:click",this.onClick),this.DS.subscribe("Selectable:pointer",function(E){var V=E.event;return i.start(V)}),this.DS.subscribe("Interaction:start:pre",function(E){var V=E.event;return i._start(V)}),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",function(E){var V=E.event;return i._reset(V)}),this.DS.subscribe("Area:scroll",this.update)}return s(u,[{key:"_canInteract",value:function(i){var g=i.clientX===0&&i.clientY===0&&i.detail===0&&i.target;return!(i.button===2||this.isInteracting||i.target&&!this.DS.SelectorArea.isInside(i.target)||!g&&!this.DS.SelectorArea.isClicked(i))}}]),u}(),Ud=function u(c){var i=this,g=c.DS;o(this,u),a(this,"subscribers",{}),a(this,"subscribe",function(d,v){return Array.isArray(i.subscribers[d])||(i.subscribers[d]=[]),i.subscribers[d].push(v),i.subscribers[d].length-1}),a(this,"unsubscribe",function(d,v,w){w>=0?i.subscribers[d].splice(w,1):v&&(i.subscribers[d]=i.subscribers[d].filter(function(x){return x!==v}))}),a(this,"publish",function(d,v){Array.isArray(d)?d.forEach(function(w){return i._publish(w,v)}):i._publish(d,v)}),a(this,"_publish",function(d,v){var w=i.subscribers[d];!Array.isArray(w)||(d.includes(":pre")?i._handlePrePublish(w,v):i._handlePublish(w,v))}),a(this,"_handlePublish",function(d,v){for(var w=0,x=d.length;w0&&arguments[0]!==void 0?arguments[0]:"append",E=document.body?"body":"documentElement",V="".concat(x,"Child");i.HTMLNode[V](i.DS.Selector.HTMLNode),document[E][V](i.HTMLNode)}),a(this,"updatePos",function(){i._rect=null;var x=i.DS.Area.rect,E=i.DS.Area.computedBorder,V=i.HTMLNode.style,N="".concat(x.top+E.top,"px"),A="".concat(x.left+E.left,"px"),I="".concat(x.width,"px"),X="".concat(x.height,"px");V.top!==N&&(V.top=N),V.left!==A&&(V.left=A),V.width!==I&&(V.width=I),V.height!==X&&(V.height=X)}),a(this,"stop",function(x){i.stopAutoScroll(),x&&i.applyElements("remove")}),a(this,"startAutoScroll",function(){i.currentEdges=[],i._scrollInterval=setInterval(function(){return i.handleAutoScroll()},16)}),a(this,"handleAutoScroll",function(){if(!i.DS.continue){var x=i.DS,E=x.stores.PointerStore,V=x.Area;i.currentEdges=mo({elementRect:F(E.currentVal),containerRect:i.rect,tolerance:i._overflowTolerance}),i.currentEdges.length&&V.scroll(i.currentEdges,i._autoScrollSpeed)}}),a(this,"stopAutoScroll",function(){i.currentEdges=[],clearInterval(i._scrollInterval)}),a(this,"isInside",function(x,E){return i.DS.Area.HTMLNode.contains(x)&&i.DS.stores.ScrollStore.canScroll?!0:qt(i.rect,E||x.getBoundingClientRect())}),this._autoScrollSpeed=v,this._overflowTolerance=w,this.DS=g,this.HTMLNode=ut(d),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Interaction:init",this.start),this.DS.subscribe("Interaction:start",this.startAutoScroll),this.DS.subscribe("Interaction:end",function(){i.updatePos(),i.stopAutoScroll()})}return s(u,[{key:"isClicked",value:function(i){var g=this.DS.stores.PointerStore,d=i?g.getPointerPosition(i):g.initialVal;return qt({left:d.x,top:d.y,right:d.x,bottom:d.y},this.rect)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),u}(),Gd=function(){function u(c){var i=this,g=c.DS,d=c.multiSelectKeys,v=c.multiSelectMode;o(this,u),a(this,"_multiSelectMode",void 0),a(this,"_multiSelectKeys",void 0),a(this,"_currentValues",new Set),a(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),a(this,"init",function(){document.addEventListener("keydown",i.keydown),document.addEventListener("keyup",i.keyup),window.addEventListener("blur",i.reset)}),a(this,"keydown",function(w){var x=w.key.toLowerCase();i.DS.publish("KeyStore:down:pre",{event:w,key:x}),i._currentValues.add(x),i.DS.publish("KeyStore:down",{event:w,key:x})}),a(this,"keyup",function(w){var x=w.key.toLowerCase();i.DS.publish("KeyStore:up:pre",{event:w,key:x}),i._currentValues.delete(x),i.DS.publish("KeyStore:up",{event:w,key:x})}),a(this,"stop",function(){document.removeEventListener("keydown",i.keydown),document.removeEventListener("keyup",i.reset),window.removeEventListener("blur",i.reset),i.reset()}),a(this,"reset",function(){return i._currentValues.clear()}),this.DS=g,this._multiSelectMode=v,this._multiSelectKeys=d.map(function(w){var x={ctrlKey:"Control",shiftKey:"Shift",metaKey:"Meta"},E=x[w];return E?(console.warn("[DragSelect] ".concat(w,' is deprecated. Use "').concat(E,'" instead. Act Now!. See docs for more info')),E.toLowerCase()):w.toLowerCase()}),this.DS.subscribe("Interaction:init",this.init)}return s(u,[{key:"isMultiSelectKeyPressed",value:function(i){var g=this;return!!(this._multiSelectMode||this.currentValues.some(function(d){return g._multiSelectKeys.includes(d)})||i&&this._multiSelectKeys.some(function(d){return i[g._keyMapping[d]]}))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),u}(),Jd=function(){function u(c){var i=this,g=c.DS;o(this,u),a(this,"_isMouseInteraction",!1),a(this,"_initialValArea",void 0),a(this,"_currentValArea",void 0),a(this,"_lastValArea",void 0),a(this,"_initialVal",void 0),a(this,"_currentVal",void 0),a(this,"_lastVal",void 0),a(this,"_lastTouch",void 0),a(this,"init",function(){document.addEventListener("mousemove",i.update),document.addEventListener("touchmove",i.update,{passive:!1})}),a(this,"getPointerPosition",function(d){return Vd({event:i._normalizedEvent(d)})}),a(this,"update",function(d){!d||(i.DS.publish("PointerStore:updated:pre",{event:d}),i.currentVal=i.getPointerPosition(d),i._isMouseInteraction&&i.DS.publish("PointerStore:updated",{event:d}))}),a(this,"stop",function(){document.removeEventListener("mousemove",i.update),document.removeEventListener("touchmove",i.update,{passive:!1}),setTimeout(function(){return i._isMouseInteraction=!1},100)}),a(this,"reset",function(d){!d||(i.currentVal=i.lastVal=i.getPointerPosition(d),i.stop(),i.init())}),this.DS=g,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(d){var v=d.event;return i.start(v)}),this.DS.subscribe("Interaction:end",function(d){var v=d.event;return i.reset(v)})}return s(u,[{key:"start",value:function(i){!i||(this._isMouseInteraction=!0,this.currentVal=this.initialVal=this.getPointerPosition(i))}},{key:"_normalizedEvent",value:function(i){return"touches"in i&&i.type!=="touchend"&&(this._lastTouch=i),"touches"in i?this._lastTouch.touches[0]:i}},{key:"initialValArea",get:function(){return this._initialValArea?this._initialValArea:{x:0,y:0}}},{key:"currentValArea",get:function(){return this._currentValArea?this._currentValArea:{x:0,y:0}}},{key:"lastValArea",get:function(){return this._lastValArea?this._lastValArea:{x:0,y:0}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}},set:function(i){this._initialVal=i,this._initialValArea=i&&C(i,"-",C(H(this.DS.Area.rect),"+",H(this.DS.Area.computedBorder)))}},{key:"currentVal",get:function(){return this._currentVal?this._currentVal:{x:0,y:0}},set:function(i){this._currentVal=i,this._currentValArea=i&&C(i,"-",C(H(this.DS.Area.rect),"+",H(this.DS.Area.computedBorder)))}},{key:"lastVal",get:function(){return this._lastVal?this._lastVal:{x:0,y:0}},set:function(i){this._lastVal=i,this._lastValArea=i&&C(i,"-",C(H(this.DS.Area.rect),"+",H(this.DS.Area.computedBorder)))}}]),u}(),Zd=function(){function u(c){var i=this,g=c.DS,d=c.areaElement,v=c.zoom;o(this,u),a(this,"_initialVal",void 0),a(this,"_currentVal",void 0),a(this,"_areaElement",void 0),a(this,"_canScroll",void 0),a(this,"init",function(){return i._areaElement.addEventListener("scroll",i.update)}),a(this,"start",function(){i._currentVal=i._initialVal=Le(i._areaElement),i._areaElement.addEventListener("scroll",i.update)}),a(this,"update",function(){return i._currentVal=Le(i._areaElement)}),a(this,"stop",function(){i._areaElement.removeEventListener("scroll",i.update),i._initialVal={x:0,y:0},i._canScroll=null}),a(this,"reset",function(){i.stop(),i.start()}),this._areaElement=d,this.DS=g,this.zoom=v,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(){return i.start()}),this.DS.subscribe("Interaction:end",function(){return i.reset()})}return s(u,[{key:"canScroll",get:function(){return typeof this._canScroll=="boolean"?this._canScroll:this._canScroll=Je(this._areaElement)}},{key:"scrollAmount",get:function(){var i=C(this.currentVal,"-",this.initialVal),g=Q(this.zoom),d=C(C(i,"*",g),"-",i);return{x:i.x+d.x,y:i.y+d.y}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}}},{key:"currentVal",get:function(){return this._currentVal||(this._currentVal=Le(this._areaElement)),this._currentVal}}]),u}(),Qd=function(){function u(c){var i=this,g=c.area,d=g===void 0?document:g,v=c.selectables,w=v===void 0?[]:v,x=c.autoScrollSpeed,E=x===void 0?5:x,V=c.overflowTolerance,N=V===void 0?{x:25,y:25}:V,A=c.zoom,I=A===void 0?1:A,X=c.customStyles,ae=X===void 0?!1:X,G=c.multiSelectMode,je=G===void 0?!1:G,pt=c.multiSelectToggling,_e=pt===void 0?!0:pt,bo=c.multiSelectKeys,eh=bo===void 0?["Control","Shift","Meta"]:bo,vo=c.selector,th=vo===void 0?void 0:vo,wo=c.draggability,Gt=wo===void 0?!0:wo,_o=c.immediateDrag,rh=_o===void 0?!0:_o,ko=c.keyboardDrag,oh=ko===void 0?!0:ko,nh=c.dragKeys,xo=c.keyboardDragSpeed,ah=xo===void 0?10:xo,So=c.useTransform,Eo=So===void 0?!0:So,Do=c.hoverClass,No=Do===void 0?"ds-hover":Do,Co=c.selectableClass,Vo=Co===void 0?"ds-selectable":Co,$o=c.selectedClass,ih=$o===void 0?"ds-selected":$o,Mo=c.selectorClass,sh=Mo===void 0?"ds-selector":Mo,Bo=c.selectorAreaClass,lh=Bo===void 0?"ds-selector-area":Bo,ch=c.callback,dh=c.onDragMove,hh=c.onDragStartBegin,uh=c.onDragStart,mh=c.onElementSelect,fh=c.onElementUnselect;o(this,u),a(this,"continue",!1),a(this,"start",function(){i.stopped=!1,i.Interaction.init()}),a(this,"break",function(){return i.continue=!0}),a(this,"getSelection",function(){return i.SelectedSet.elements}),a(this,"getSelectables",function(){return i.SelectableSet.elements}),a(this,"getInitialCursorPosition",function(){return i.stores.PointerStore.initialVal}),a(this,"getCurrentCursorPosition",function(){return i.stores.PointerStore.currentVal}),a(this,"getPreviousCursorPosition",function(){return i.stores.PointerStore.lastVal}),a(this,"getInitialCursorPositionArea",function(){return i.stores.PointerStore.initialValArea}),a(this,"getCurrentCursorPositionArea",function(){return i.stores.PointerStore.currentValArea}),a(this,"getPreviousCursorPositionArea",function(){return i.stores.PointerStore.lastValArea}),a(this,"isMultiSelect",function(ph){return i.stores.KeyStore.isMultiSelectKeyPressed(ph)}),a(this,"isDragging",function(){return i.Interaction.isDragging}),this.PubSub=new Ud({DS:this}),this.subscribe=this.PubSub.subscribe,this.unsubscribe=this.PubSub.unsubscribe,this.publish=this.PubSub.publish,this._callbacksTemp({callback:ch,onDragMove:dh,onDragStart:uh,onDragStartBegin:hh,onElementSelect:mh,onElementUnselect:fh}),this.stores={PointerStore:new Jd({DS:this}),ScrollStore:new Zd({DS:this,areaElement:d,zoom:I}),KeyStore:new Gd({DS:this,multiSelectKeys:eh,multiSelectMode:je})},this.Area=new Rd({area:d,PS:this.PubSub,zoom:I}),this.Selector=new Xd({DS:this,selector:th,selectorClass:sh,customStyles:ae}),this.SelectorArea=new qd({DS:this,selectorAreaClass:lh,autoScrollSpeed:E,overflowTolerance:N}),this.SelectableSet=new Kd({elements:w,DS:this,className:Vo,hoverClassName:No,useTransform:Eo,draggability:Gt}),this.SelectedSet=new Yd({DS:this,className:ih}),this.Selection=new Wd({DS:this,hoverClassName:No,multiSelectToggling:_e}),this.Drag=new Hd({DS:this,draggability:Gt,useTransform:Eo,keyboardDrag:oh,dragKeys:Object.assign({up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},nh),zoom:I,keyboardDragSpeed:ah}),this.Interaction=new Fd({areaElement:d,DS:this,draggability:Gt,immediateDrag:rh,selectableClass:Vo}),zd({subscribe:this.subscribe,publish:this.publish,SelectedSet:this.SelectedSet,Interaction:this.Interaction}),this.subscribe("Interaction:end",function(){return i.continue=!1}),this.start()}return s(u,[{key:"_callbacksTemp",value:function(i){var g=i.callback,d=i.onDragMove,v=i.onDragStart,w=i.onDragStartBegin,x=i.onElementSelect,E=i.onElementUnselect,V=function(A,I){return console.warn("[DragSelect] ".concat(A,' is deprecated. Use DragSelect.subscribe("').concat(I,'", (callbackObject) => {}) instead. Act Now! See docs for more info'))};g&&(V("callback","callback"),this.subscribe("callback",function(N){var A=N.items;N.item;var I=N.event;return g(A,I)})),d&&(V("onDragMove","dragmove"),this.subscribe("dragmove",function(N){N.items,N.item;var A=N.event;return d(A)})),v&&(V("onDragStart","dragstart"),this.subscribe("dragstart",function(N){N.items,N.item;var A=N.event;return v(A)})),w&&(V("onDragStartBegin","dragstart"),this.subscribe("dragstart",function(N){N.items,N.item;var A=N.event;return w(A)})),x&&(V("onElementSelect","elementselect"),this.subscribe("elementselect",function(N){N.items;var A=N.item,I=N.event;return x(A,I)})),E&&(V("onElementUnselect","elementunselect"),this.subscribe("elementunselect",function(N){N.items;var A=N.item,I=N.event;return E(A,I)}))}},{key:"stop",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;d&&this.publish("callback",{items:this.getSelection()}),this.Interaction.stop(),this.Area.stop(),this.Drag.stop(),this.Selector.stop(),this.SelectorArea.stop(i),this.stores.KeyStore.stop(),this.stores.PointerStore.stop(),this.stores.ScrollStore.stop(),i&&this.SelectableSet.clear(),g&&this.SelectedSet.clear(),this.stopped=!0}},{key:"addSelection",value:function(i){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.addAll(Ie(i)),d||this.addSelectables(i),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"removeSelection",value:function(i){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.deleteAll(Ie(i)),d&&this.removeSelectables(i),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(i){var g=this,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Ie(i).forEach(function(w){return g.SelectedSet.has(w)?g.removeSelection(i,d,v):g.addSelection(i,d,v)}),d&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"setSelection",value:function(i){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.clearSelection(),this.addSelection(i,g,d),this.getSelection()}},{key:"clearSelection",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.SelectedSet.clear(),i&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"addSelectables",value:function(i){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=Ie(i);return this.SelectableSet.addAll(d),g&&this.SelectedSet.addAll(d),i}},{key:"setSelectables",value:function(i){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.removeSelectables(i,g),this.addSelectables(i,d)}},{key:"removeSelectables",value:function(i){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.SelectableSet.deleteAll(Ie(i)),g&&this.removeSelection(i),i}},{key:"getCursorPositionDifference",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;console.warn("[DragSelect] Using .getCursorPositionDifference is deprecated. Calculate yourself instead. i.e. `.getCurrentCursorPosition().x - .getInitialCursorPosition().x`");var d=g?this.getCurrentCursorPositionArea():this.getCurrentCursorPosition(),v=i?g?this.getPreviousCursorPositionArea():this.getPreviousCursorPosition():g?this.getInitialCursorPositionArea():this.getInitialCursorPosition();return C(d,"-",v)}}]),u}();return Qd})})(Zt);const fn=Zt.exports,Qt=(r,t,o,n,s)=>(t=Math,o=t.log,n=1024,s=o(r)/o(n)|0,r/t.pow(n,s)).toFixed(0)+" "+(s?"KMGTPEZY"[--s]+"iB":"B"),er=(r,t=null)=>{var o;return new Date(r*1e3).toLocaleString((o=t!=null?t:navigator.language)!=null?o:"en-US")},pn={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},gn=[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)],yn={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},bn=[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)],tt=Object.assign({name:"VFSortIcon"},{props:{direction:String},setup(r){return(t,o)=>(e.openBlock(),e.createElementBlock("div",null,[r.direction=="down"?(e.openBlock(),e.createElementBlock("svg",pn,gn)):e.createCommentVNode("",!0),r.direction=="up"?(e.openBlock(),e.createElementBlock("svg",yn,bn)):e.createCommentVNode("",!0)]))}}),vn=["onClick"],wn=Object.assign({name:"VFToast.vue"},{setup(r){const t=e.inject("emitter"),{getStore:o}=e.inject("storage"),n=e.ref(o("full-screen",!1)),s=p=>p=="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",a=e.ref([]),l=p=>{a.value.splice(p,1)},m=p=>{let f=a.value.findIndex(h=>h.id===p);f!==-1&&l(f)};return t.on("vf-toast-clear",()=>{a.value=[]}),t.on("vf-toast-push",p=>{let f=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");p.id=f,a.value.push(p),setTimeout(()=>{m(f)},5e3)}),(p,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([n.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(a.value,(h,y)=>(e.openBlock(),e.createElementBlock("div",{onClick:b=>l(y),key:h,class:e.normalizeClass([s(h.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(h.label),11,vn))),128))]),_:1})],2))}}),ke=r=>Object.entries(r).map(t=>t.map(encodeURIComponent).join("=")).join("&"),{apiUrl:_n}=le(),bt=(r,t)=>_n.value+"?"+ke({q:"preview",adapter:r,path:t}),pe=typeof window<"u",tr=pe&&!("onscroll"in window)||typeof navigator<"u"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),rr=pe&&"IntersectionObserver"in window,or=pe&&"classList"in document.createElement("p"),nr=pe&&window.devicePixelRatio>1,kn={elements_selector:".lazy",container:tr||pe?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},ar=r=>Object.assign({},kn,r),ir=function(r,t){let o;const n="LazyLoad::Initialized",s=new r(t);try{o=new CustomEvent(n,{detail:{instance:s}})}catch{o=document.createEvent("CustomEvent"),o.initCustomEvent(n,!1,!1,{instance:s})}window.dispatchEvent(o)},xn=(r,t)=>{if(!!t)if(!t.length)ir(r,t);else for(let o=0,n;n=t[o];o+=1)ir(r,n)},fe="src",vt="srcset",wt="sizes",sr="poster",ze="llOriginalAttrs",lr="data",_t="loading",cr="loaded",dr="applied",Sn="entered",kt="error",hr="native",ur="data-",mr="ll-status",te=(r,t)=>r.getAttribute(ur+t),En=(r,t,o)=>{var n=ur+t;if(o===null){r.removeAttribute(n);return}r.setAttribute(n,o)},Re=r=>te(r,mr),xe=(r,t)=>En(r,mr,t),rt=r=>xe(r,null),xt=r=>Re(r)===null,Dn=r=>Re(r)===_t,Nn=r=>Re(r)===kt,St=r=>Re(r)===hr,Cn=[_t,cr,dr,kt],Vn=r=>Cn.indexOf(Re(r))>=0,ge=(r,t,o,n)=>{if(!!r){if(n!==void 0){r(t,o,n);return}if(o!==void 0){r(t,o);return}r(t)}},Ce=(r,t)=>{if(or){r.classList.add(t);return}r.className+=(r.className?" ":"")+t},ce=(r,t)=>{if(or){r.classList.remove(t);return}r.className=r.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},$n=r=>{r.llTempImage=document.createElement("IMG")},Mn=r=>{delete r.llTempImage},fr=r=>r.llTempImage,ot=(r,t)=>{if(!t)return;const o=t._observer;!o||o.unobserve(r)},Bn=r=>{r.disconnect()},Tn=(r,t,o)=>{t.unobserve_entered&&ot(r,o)},Et=(r,t)=>{!r||(r.loadingCount+=t)},An=r=>{!r||(r.toLoadCount-=1)},pr=(r,t)=>{!r||(r.toLoadCount=t)},On=r=>r.loadingCount>0,Ln=r=>r.toLoadCount>0,gr=r=>{let t=[];for(let o=0,n;n=r.children[o];o+=1)n.tagName==="SOURCE"&&t.push(n);return t},Dt=(r,t)=>{const o=r.parentNode;if(!o||o.tagName!=="PICTURE")return;gr(o).forEach(t)},yr=(r,t)=>{gr(r).forEach(t)},nt=[fe],br=[fe,sr],He=[fe,vt,wt],vr=[lr],at=r=>!!r[ze],wr=r=>r[ze],_r=r=>delete r[ze],Ve=(r,t)=>{if(at(r))return;const o={};t.forEach(n=>{o[n]=r.getAttribute(n)}),r[ze]=o},In=r=>{at(r)||(r[ze]={backgroundImage:r.style.backgroundImage})},jn=(r,t,o)=>{if(!o){r.removeAttribute(t);return}r.setAttribute(t,o)},Se=(r,t)=>{if(!at(r))return;const o=wr(r);t.forEach(n=>{jn(r,n,o[n])})},Pn=r=>{if(!at(r))return;const t=wr(r);r.style.backgroundImage=t.backgroundImage},kr=(r,t,o)=>{Ce(r,t.class_applied),xe(r,dr),o&&(t.unobserve_completed&&ot(r,t),ge(t.callback_applied,r,o))},xr=(r,t,o)=>{Ce(r,t.class_loading),xe(r,_t),o&&(Et(o,1),ge(t.callback_loading,r,o))},ye=(r,t,o)=>{!o||r.setAttribute(t,o)},Sr=(r,t)=>{ye(r,wt,te(r,t.data_sizes)),ye(r,vt,te(r,t.data_srcset)),ye(r,fe,te(r,t.data_src))},zn=(r,t)=>{Dt(r,o=>{Ve(o,He),Sr(o,t)}),Ve(r,He),Sr(r,t)},Rn=(r,t)=>{Ve(r,nt),ye(r,fe,te(r,t.data_src))},Hn=(r,t)=>{yr(r,o=>{Ve(o,nt),ye(o,fe,te(o,t.data_src))}),Ve(r,br),ye(r,sr,te(r,t.data_poster)),ye(r,fe,te(r,t.data_src)),r.load()},Fn=(r,t)=>{Ve(r,vr),ye(r,lr,te(r,t.data_src))},Un=(r,t,o)=>{const n=te(r,t.data_bg),s=te(r,t.data_bg_hidpi),a=nr&&s?s:n;!a||(r.style.backgroundImage=`url("${a}")`,fr(r).setAttribute(fe,a),xr(r,t,o))},Kn=(r,t,o)=>{const n=te(r,t.data_bg_multi),s=te(r,t.data_bg_multi_hidpi),a=nr&&s?s:n;!a||(r.style.backgroundImage=a,kr(r,t,o))},Yn=(r,t,o)=>{const n=te(r,t.data_bg_set);if(!n)return;const s=n.split("|");let a=s.map(l=>`image-set(${l})`);r.style.backgroundImage=a.join(),r.style.backgroundImage===""&&(a=s.map(l=>`-webkit-image-set(${l})`),r.style.backgroundImage=a.join()),kr(r,t,o)},Er={IMG:zn,IFRAME:Rn,VIDEO:Hn,OBJECT:Fn},Wn=(r,t)=>{const o=Er[r.tagName];!o||o(r,t)},Xn=(r,t,o)=>{const n=Er[r.tagName];!n||(n(r,t),xr(r,t,o))},qn=["IMG","IFRAME","VIDEO","OBJECT"],Gn=r=>qn.indexOf(r.tagName)>-1,Dr=(r,t)=>{t&&!On(t)&&!Ln(t)&&ge(r.callback_finish,t)},Nr=(r,t,o)=>{r.addEventListener(t,o),r.llEvLisnrs[t]=o},Jn=(r,t,o)=>{r.removeEventListener(t,o)},Nt=r=>!!r.llEvLisnrs,Zn=(r,t,o)=>{Nt(r)||(r.llEvLisnrs={});const n=r.tagName==="VIDEO"?"loadeddata":"load";Nr(r,n,t),Nr(r,"error",o)},Ct=r=>{if(!Nt(r))return;const t=r.llEvLisnrs;for(let o in t){const n=t[o];Jn(r,o,n)}delete r.llEvLisnrs},Cr=(r,t,o)=>{Mn(r),Et(o,-1),An(o),ce(r,t.class_loading),t.unobserve_completed&&ot(r,o)},Qn=(r,t,o,n)=>{const s=St(t);Cr(t,o,n),Ce(t,o.class_loaded),xe(t,cr),ge(o.callback_loaded,t,n),s||Dr(o,n)},ea=(r,t,o,n)=>{const s=St(t);Cr(t,o,n),Ce(t,o.class_error),xe(t,kt),ge(o.callback_error,t,n),o.restore_on_error&&Se(t,He),s||Dr(o,n)},Vt=(r,t,o)=>{const n=fr(r)||r;if(Nt(n))return;Zn(n,l=>{Qn(l,r,t,o),Ct(n)},l=>{ea(l,r,t,o),Ct(n)})},ta=(r,t,o)=>{$n(r),Vt(r,t,o),In(r),Un(r,t,o),Kn(r,t,o),Yn(r,t,o)},ra=(r,t,o)=>{Vt(r,t,o),Xn(r,t,o)},$t=(r,t,o)=>{Gn(r)?ra(r,t,o):ta(r,t,o)},oa=(r,t,o)=>{r.setAttribute("loading","lazy"),Vt(r,t,o),Wn(r,t),xe(r,hr)},Vr=r=>{r.removeAttribute(fe),r.removeAttribute(vt),r.removeAttribute(wt)},na=r=>{Dt(r,t=>{Vr(t)}),Vr(r)},$r=r=>{Dt(r,t=>{Se(t,He)}),Se(r,He)},aa={IMG:$r,IFRAME:r=>{Se(r,nt)},VIDEO:r=>{yr(r,t=>{Se(t,nt)}),Se(r,br),r.load()},OBJECT:r=>{Se(r,vr)}},ia=r=>{const t=aa[r.tagName];if(!t){Pn(r);return}t(r)},sa=(r,t)=>{xt(r)||St(r)||(ce(r,t.class_entered),ce(r,t.class_exited),ce(r,t.class_applied),ce(r,t.class_loading),ce(r,t.class_loaded),ce(r,t.class_error))},la=(r,t)=>{ia(r),sa(r,t),rt(r),_r(r)},ca=(r,t,o,n)=>{!o.cancel_on_exit||!Dn(r)||r.tagName==="IMG"&&(Ct(r),na(r),$r(r),ce(r,o.class_loading),Et(n,-1),rt(r),ge(o.callback_cancel,r,t,n))},da=(r,t,o,n)=>{const s=Vn(r);xe(r,Sn),Ce(r,o.class_entered),ce(r,o.class_exited),Tn(r,o,n),ge(o.callback_enter,r,t,n),!s&&$t(r,o,n)},ha=(r,t,o,n)=>{xt(r)||(Ce(r,o.class_exited),ca(r,t,o,n),ge(o.callback_exit,r,t,n))},ua=["IMG","IFRAME","VIDEO"],Mr=r=>r.use_native&&"loading"in HTMLImageElement.prototype,ma=(r,t,o)=>{r.forEach(n=>{ua.indexOf(n.tagName)!==-1&&oa(n,t,o)}),pr(o,0)},fa=r=>r.isIntersecting||r.intersectionRatio>0,pa=r=>({root:r.container===document?null:r.container,rootMargin:r.thresholds||r.threshold+"px"}),ga=(r,t,o)=>{r.forEach(n=>fa(n)?da(n.target,n,t,o):ha(n.target,n,t,o))},ya=(r,t)=>{t.forEach(o=>{r.observe(o)})},ba=(r,t)=>{Bn(r),ya(r,t)},va=(r,t)=>{!rr||Mr(r)||(t._observer=new IntersectionObserver(o=>{ga(o,r,t)},pa(r)))},Br=r=>Array.prototype.slice.call(r),it=r=>r.container.querySelectorAll(r.elements_selector),wa=r=>Br(r).filter(xt),_a=r=>Nn(r),ka=r=>Br(r).filter(_a),Tr=(r,t)=>wa(r||it(t)),xa=(r,t)=>{ka(it(r)).forEach(n=>{ce(n,r.class_error),rt(n)}),t.update()},Sa=(r,t)=>{!pe||(t._onlineHandler=()=>{xa(r,t)},window.addEventListener("online",t._onlineHandler))},Ea=r=>{!pe||window.removeEventListener("online",r._onlineHandler)},Fe=function(r,t){const o=ar(r);this._settings=o,this.loadingCount=0,va(o,this),Sa(o,this),this.update(t)};Fe.prototype={update:function(r){const t=this._settings,o=Tr(r,t);if(pr(this,o.length),tr||!rr){this.loadAll(o);return}if(Mr(t)){ma(o,t,this);return}ba(this._observer,o)},destroy:function(){this._observer&&this._observer.disconnect(),Ea(this),it(this._settings).forEach(r=>{_r(r)}),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(r){const t=this._settings;Tr(r,t).forEach(n=>{ot(n,this),$t(n,t,this)})},restoreAll:function(){const r=this._settings;it(r).forEach(t=>{la(t,r)})}},Fe.load=(r,t)=>{const o=ar(t);$t(r,o)},Fe.resetStatus=r=>{rt(r)},pe&&xn(Fe,window.lazyLoadOptions);const Da={class:"relative flex-auto flex flex-col overflow-hidden"},Na={key:0,class:"grid grid-cols-12 border-b border-neutral-300 border-gray-200 dark:border-gray-700 text-xs select-none"},Ca={class:"absolute"},Va=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),$a={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"},Ma=["onDblclick","onContextmenu","data-type","data-item","data-index"],Ba={class:"grid grid-cols-12 items-center"},Ta={class:"flex col-span-7 items-center"},Aa={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"},Oa=[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)],La={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"},Ia=[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)],ja={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Pa={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},za=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],Ra={class:"grid grid-cols-12 items-center"},Ha={class:"flex col-span-7 items-center"},Fa={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"},Ua=[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)],Ka={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)],Wa={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Xa={class:"col-span-2 text-center"},qa={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap"},Ga=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],Ja={class:"relative"},Za={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"},Qa=[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)],ei=["data-src","alt"],ti={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"},ri=[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)],oi={key:3,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},ni={class:"break-all"},ai=Object.assign({name:"VFExplorer"},{props:{view:String,data:Object,search:Object},setup(r){const t=r,o=e.inject("emitter"),{setStore:n,getStore:s}=e.inject("storage"),a=M=>M==null?void 0:M.substring(0,3),l=M=>M.replace(/((?=([\w\W]{0,14}))([\w\W]{8,})([\w\W]{8,}))/,"$2..$4"),m=e.ref(null),p=e.ref(null),f=e.ref(0),h=e.ref(null),{t:y}=e.inject("i18n"),b=Math.floor(Math.random()*2**32),D=e.ref(s("full-screen",!1)),_=new Fe;o.on("vf-fullscreen-toggle",()=>{D.value=!D.value,n("full-screen",D.value)});const k=e.ref("");o.on("vf-search-query",({newQuery:M})=>{k.value=M,M?o.emit("vf-fetch",{params:{q:"search",adapter:t.data.adapter,path:t.data.dirname,filter:M},onSuccess:O=>{O.files.length||o.emit("vf-toast-push",{label:y("No search result found.")})}}):o.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname}})});let $=null;const P=()=>{$&&clearTimeout($)},L=M=>{$=setTimeout(()=>{const O=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!1,view:window,button:2,buttons:0,clientX:M.target.getBoundingClientRect().x,clientY:M.target.getBoundingClientRect().y});M.target.dispatchEvent(O)},500)},B=M=>{M.type=="dir"?(o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:M.path}})):o.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:M})},T=e.reactive({active:!1,column:"",order:""}),R=(M=!0)=>{let O=[...t.data.files],C=T.column,H=T.order=="asc"?1:-1;if(!M)return O;const F=(Q,W)=>typeof Q=="string"&&typeof W=="string"?Q.toLowerCase().localeCompare(W.toLowerCase()):QW?1:0;return T.active&&(O=O.slice().sort((Q,W)=>F(Q[C],W[C])*H)),O},S=M=>{T.active&&T.column==M?(T.active=T.order=="asc",T.column=M,T.order="desc"):(T.active=!0,T.column=M,T.order="asc")},j=()=>h.value.getSelection().map(M=>JSON.parse(M.dataset.item)),Y=(M,O)=>{if(M.altKey||M.ctrlKey||M.metaKey)return M.preventDefault(),!1;M.dataTransfer.setDragImage(p.value,0,15),M.dataTransfer.effectAllowed="all",M.dataTransfer.dropEffect="copy",M.dataTransfer.setData("items",JSON.stringify(j()))},Z=(M,O)=>{M.preventDefault();let C=JSON.parse(M.dataTransfer.getData("items"));if(C.find(H=>H.storage!=s("adapter","local"))){alert("Moving items between different storages is not supported yet.");return}o.emit("vf-modal-show",{type:"move",items:{from:C,to:O}})},ee=(M,O)=>{M.preventDefault(),!O||O.type!=="dir"||h.value.getSelection().find(C=>C==M.currentTarget)?(M.dataTransfer.dropEffect="none",M.dataTransfer.effectAllowed="none"):M.dataTransfer.dropEffect="copy"},ne=()=>{h.value=new fn({area:m.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),o.on("vf-explorer-update",()=>e.nextTick(()=>{h.value.clearSelection(),h.value.setSelectables(document.getElementsByClassName("vf-item-"+b))})),h.value.subscribe("predragstart",({event:M,isDragging:O})=>{if(O)f.value=h.value.getSelection().length,h.value.break();else{const C=M.target.offsetWidth-M.offsetX,H=M.target.offsetHeight-M.offsetY;C<15&&H<15&&(h.value.clearSelection(),h.value.break())}}),h.value.subscribe("predragmove",({isDragging:M})=>{M&&h.value.break()}),h.value.subscribe("callback",({items:M,event:O,isDragging:C})=>{o.emit("vf-nodes-selected",j()),f.value=h.value.getSelection().length})};return e.onMounted(ne),e.onUpdated(()=>{h.value.Area.reset(),h.value.SelectorArea.updatePos(),_.update()}),e.onMounted(()=>{e.watch(()=>t.view,()=>o.emit("vf-explorer-update"))}),(M,O)=>(e.openBlock(),e.createElementBlock("div",Da,[r.view=="list"||k.value.length?(e.openBlock(),e.createElementBlock("div",Na,[e.createElementVNode("div",{onClick:O[0]||(O[0]=C=>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(y)("Name"))+" ",1),e.withDirectives(e.createVNode(tt,{direction:T.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,T.active&&T.column=="basename"]])]),k.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:O[1]||(O[1]=C=>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(y)("Size"))+" ",1),e.withDirectives(e.createVNode(tt,{direction:T.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,T.active&&T.column=="file_size"]])])),k.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:O[2]||(O[2]=C=>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(y)("Date"))+" ",1),e.withDirectives(e.createVNode(tt,{direction:T.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,T.active&&T.column=="last_modified"]])])),k.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:O[3]||(O[3]=C=>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(y)("Filepath"))+" ",1),e.withDirectives(e.createVNode(tt,{direction:T.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,T.active&&T.column=="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ca,[e.createElementVNode("div",{ref_key:"dragImage",ref:p,class:"absolute -z-50 -top-96"},[Va,e.createElementVNode("div",$a,e.toDisplayString(f.value),1)],512)]),e.createElementVNode("div",{onContextmenu:O[10]||(O[10]=e.withModifiers(C=>e.unref(o).emit("vf-contextmenu-show",{event:C,area:m.value,items:j()}),["self","prevent"])),class:e.normalizeClass([D.value?"":"resize-y","h-full w-full text-xs vf-selector-area min-h-[150px] overflow-auto p-1 z-0"]),ref_key:"selectorArea",ref:m},[k.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(R(),(C,H)=>(e.openBlock(),e.createElementBlock("div",{onDblclick:F=>B(C),onTouchstart:O[4]||(O[4]=F=>L(F)),onTouchend:O[5]||(O[5]=F=>P()),onContextmenu:e.withModifiers(F=>e.unref(o).emit("vf-contextmenu-show",{event:F,area:m.value,items:j(),target:C}),["prevent"]),class:e.normalizeClass(["vf-item-"+e.unref(b),"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":C.type,"data-item":JSON.stringify(C),"data-index":H},[e.createElementVNode("div",Ba,[e.createElementVNode("div",Ta,[C.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Aa,Oa)):(e.openBlock(),e.createElementBlock("svg",La,Ia)),e.createElementVNode("span",ja,e.toDisplayString(C.basename),1)]),e.createElementVNode("div",Pa,e.toDisplayString(C.path),1)])],42,Ma))),256)):e.createCommentVNode("",!0),r.view=="list"&&!k.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(R(),(C,H)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:F=>B(C),onTouchstart:O[6]||(O[6]=F=>L(F)),onTouchend:O[7]||(O[7]=F=>P()),onContextmenu:e.withModifiers(F=>e.unref(o).emit("vf-contextmenu-show",{event:F,area:m.value,items:j(),target:C}),["prevent"]),onDragstart:F=>Y(F),onDragover:F=>ee(F,C),onDrop:F=>Z(F,C),class:e.normalizeClass(["vf-item-"+e.unref(b),"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":C.type,"data-item":JSON.stringify(C),"data-index":H},[e.createElementVNode("div",Ra,[e.createElementVNode("div",Ha,[C.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Fa,Ua)):(e.openBlock(),e.createElementBlock("svg",Ka,Ya)),e.createElementVNode("span",Wa,e.toDisplayString(C.basename),1)]),e.createElementVNode("div",Xa,e.toDisplayString(C.file_size?e.unref(Qt)(C.file_size):""),1),e.createElementVNode("div",qa,e.toDisplayString(e.unref(er)(C.last_modified)),1)])],42,za))),256)):e.createCommentVNode("",!0),r.view=="grid"&&!k.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(R(!1),(C,H)=>{var F,Q;return e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:W=>B(C),onTouchstart:O[8]||(O[8]=W=>L(W)),onTouchend:O[9]||(O[9]=W=>P()),onContextmenu:e.withModifiers(W=>e.unref(o).emit("vf-contextmenu-show",{event:W,area:m.value,items:j(),target:C}),["prevent"]),onDragstart:W=>Y(W),onDragover:W=>ee(W,C),onDrop:W=>Z(W,C),class:e.normalizeClass(["vf-item-"+e.unref(b),"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":C.type,"data-item":JSON.stringify(C),"data-index":H},[e.createElementVNode("div",null,[e.createElementVNode("div",Ja,[C.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Za,Qa)):((F=C.mime_type)!=null?F:"").startsWith("image")?(e.openBlock(),e.createElementBlock("img",{key:1,class:"lazy h-10 md:h-12 m-auto","data-src":e.unref(bt)(e.unref(s)("adapter",t.data.adapter),C.path),alt:C.basename},null,8,ei)):(e.openBlock(),e.createElementBlock("svg",ti,ri)),!((Q=C.mime_type)!=null?Q:"").startsWith("image")&&C.type!="dir"?(e.openBlock(),e.createElementBlock("div",oi,e.toDisplayString(a(C.extension)),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",ni,e.toDisplayString(l(C.basename)),1)])],42,Ga)}),256)):e.createCommentVNode("",!0)],34),e.createVNode(wn)]))}}),ii="1.1.12",si={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},li={class:"flex leading-5 items-center"},ci=["aria-label"],di=[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)],hi=["value"],ui={class:"ml-3"},mi={key:0},fi={class:"ml-1"},pi={class:"flex leading-5 items-center"},gi={value:"",disabled:""},yi=e.createElementVNode("option",{value:"en"},"English",-1),bi=e.createElementVNode("option",{value:"fr"},"French",-1),vi=e.createElementVNode("option",{value:"ru"},"Russian",-1),wi=e.createElementVNode("option",{value:"tr"},"Turkish",-1),_i=["aria-label"],ki=[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)],xi=Object.assign({name:"VFStatusbar"},{props:{data:Object},setup(r){var b;const t=r,o=e.inject("emitter"),{getStore:n,setStore:s}=e.inject("storage"),a=e.ref(0),l=e.ref((b=n("adapter"))!=null?b:t.data.adapter),{t:m,changeLocale:p}=e.inject("i18n"),f=e.ref(n("locale","")),h=()=>{o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:l.value}}),s("adapter",l.value)};o.on("vf-nodes-selected",D=>{a.value=D.length});const y=e.ref("");return o.on("vf-search-query",({newQuery:D})=>{y.value=D}),(D,_)=>(e.openBlock(),e.createElementBlock("div",si,[e.createElementVNode("div",li,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(m)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},di,8,ci),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":_[0]||(_[0]=k=>l.value=k),onChange:h,class:"py-0.5 text-sm text-slate-500 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.data.storages,k=>(e.openBlock(),e.createElementBlock("option",{value:k},e.toDisplayString(k),9,hi))),256))],544),[[e.vModelSelect,l.value]]),e.createElementVNode("div",ui,[y.value.length?(e.openBlock(),e.createElementBlock("span",mi,e.toDisplayString(r.data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",fi,e.toDisplayString(a.value>0?a.value+" "+e.unref(m)("item(s) selected."):""),1)])]),e.createElementVNode("div",pi,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":_[1]||(_[1]=k=>f.value=k),onChange:_[2]||(_[2]=k=>e.unref(p)(k.target.value)),class:"py-0.5 text-sm text-slate-500 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8 mr-3"},[e.createElementVNode("option",gi,e.toDisplayString(e.unref(m)("Language")),1),yi,bi,vi,wi],544),[[e.vModelSelect,f.value]]),e.createElementVNode("span",{class:"mr-1","aria-label":e.unref(m)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:_[3]||(_[3]=k=>e.unref(o).emit("vf-modal-show",{type:"message",title:"Vuefinder "+e.unref(ii),message:e.unref(m)("Vuefinder is a file manager component for vue 3.")}))},ki,8,_i)])]))}}),Si=(r,t=0,o=!1)=>{let n;return(...s)=>{o&&!n&&r(...s),clearTimeout(n),n=setTimeout(()=>{r(...s)},t)}},Ei=(r,t,o)=>{const n=e.ref(r);return e.customRef((a,l)=>({get(){return a(),n.value},set:Si(m=>{n.value=m,l()},t,o)}))},Di={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-xs"},Ni=["aria-label"],Ci=[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)],Vi=["aria-label"],$i=[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)],Mi={key:1,"aria-label":"Cancel","data-microtip-position":"bottom-right",role:"tooltip"},Bi=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],Ti=["onClick"],Ai=[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)],Oi={class:"flex leading-5"},Li=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),Ii=["title","onClick"],ji={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"},Pi=[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),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)],zi={key:3,class:"flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full"},Ri=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),Hi=["onKeydown","placeholder"],Fi=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],Ui=Object.assign({name:"VFBreadcrumb"},{props:{data:Object},setup(r){const t=r,o=e.inject("emitter"),{getStore:n}=e.inject("storage"),s=e.ref(null),a=e.ref([]),l=e.ref(!1),m=e.ref(null),{t:p}=e.inject("i18n"),f=e.inject("loadingState");o.on("vf-explorer-update",()=>{var T;let L=[],B=[];s.value=(T=t.data.dirname)!=null?T:n("adapter","local")+"://",s.value.length==0&&(a.value=[]),s.value.replace(n("adapter","local")+"://","").split("/").forEach(function(R){L.push(R),L.join("/")!=""&&B.push({basename:R,name:R,path:n("adapter","local")+"://"+L.join("/"),type:"dir"})}),B.length>4&&(B=B.slice(-5),B[0].name=".."),a.value=B});const h=()=>{l.value=!1,b.value=""};o.on("vf-search-exit",()=>{h()});const y=()=>{l.value=!0,e.nextTick(()=>m.value.focus())},b=Ei("",400),D=()=>f.value;e.watch(b,L=>{o.emit("vf-toast-clear"),o.emit("vf-search-query",{newQuery:L})});const _=()=>a.value.length&&!l.value,k=L=>{var T;L.preventDefault();let B=JSON.parse(L.dataTransfer.getData("items"));if(B.find(R=>R.storage!=n("adapter","local"))){alert("Moving items between different storages is not supported yet.");return}o.emit("vf-modal-show",{type:"move",items:{from:B,to:(T=a.value[a.value.length-2])!=null?T:{path:n("adapter","local")+"://"}}})},$=L=>{L.preventDefault(),_()?L.dataTransfer.dropEffect="copy":(L.dataTransfer.dropEffect="none",L.dataTransfer.effectAllowed="none")},P=()=>{b.value==""&&h()};return(L,B)=>(e.openBlock(),e.createElementBlock("div",Di,[e.createElementVNode("span",{"aria-label":e.unref(p)("Go up a directory"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onDragover:B[0]||(B[0]=T=>$(T)),onDrop:B[1]||(B[1]=T=>k(T)),onClick:B[2]||(B[2]=T=>{var R,S;return!_()||e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:r.data.adapter,path:(S=(R=a.value[a.value.length-2])==null?void 0:R.path)!=null?S:e.unref(n)("adapter","local")+"://"}})}),class:e.normalizeClass(["h-6 w-6 p-0.5 rounded",_()?"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"},Ci,34))],8,Ni),D()?(e.openBlock(),e.createElementBlock("span",Mi,[(e.openBlock(),e.createElementBlock("svg",{onClick:B[4]||(B[4]=T=>e.unref(o).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"},Bi))])):(e.openBlock(),e.createElementBlock("span",{key:0,"aria-label":e.unref(p)("Refresh"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:B[3]||(B[3]=T=>{e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:r.data.adapter,path:r.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"},$i))],8,Vi)),l.value?(e.openBlock(),e.createElementBlock("div",zi,[Ri,e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:m,onKeydown:e.withKeys(h,["esc"]),onBlur:P,"onUpdate:modelValue":B[6]||(B[6]=T=>e.isRef(b)?b.value=T:null),placeholder:e.unref(p)("Search anything.."),class:"py-0 px-2 w-full border-0 ring-0 outline-0 text-sm 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,Hi),[[e.vModelText,e.unref(b)]]),(e.openBlock(),e.createElementBlock("svg",{class:"w-6 h-6 cursor-pointer",onClick:h,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Fi))])):(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(y,["self"])},[(e.openBlock(),e.createElementBlock("svg",{onClick:B[5]||(B[5]=T=>e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:r.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"},Ai)),e.createElementVNode("div",Oi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(T,R)=>(e.openBlock(),e.createElementBlock("div",{key:R},[Li,e.createElementVNode("span",{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:T.basename,onClick:S=>e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:r.data.adapter,path:T.path}})},e.toDisplayString(T.name),9,Ii)]))),128))]),D()?(e.openBlock(),e.createElementBlock("svg",ji,Pi)):e.createCommentVNode("",!0)],8,Ti))]))}}),Ki=["onClick"],Yi=e.createElementVNode("span",{class:"px-1"},null,-1),Wi=Object.assign({name:"VFContextMenu"},{props:{current:Object},setup(r){const t=r,o=e.inject("emitter"),n=e.ref(null),{apiUrl:s}=le(),a=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),l=e.ref([]);o.on("vf-context-selected",b=>{l.value=b});const{t:m}=e.inject("i18n"),p={newfolder:{title:()=>m("New Folder"),action:()=>{o.emit("vf-modal-show",{type:"new-folder"})}},delete:{title:()=>m("Delete"),action:()=>{o.emit("vf-modal-show",{type:"delete",items:l})}},refresh:{title:()=>m("Refresh"),action:()=>{o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:t.current.dirname}})}},preview:{title:()=>m("Preview"),action:()=>{o.emit("vf-modal-show",{type:"preview",adapter:t.current.adapter,item:l.value[0]})}},open:{title:()=>m("Open"),action:()=>{o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:l.value[0].path}})}},openDir:{title:()=>m("Open containing folder"),action:()=>{o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:l.value[0].dir}})}},download:{title:()=>m("Download"),action:()=>{const b=s.value+"?"+ke({q:"download",adapter:t.current.adapter,path:l.value[0].path});o.emit("vf-download",b)}},archive:{title:()=>m("Archive"),action:()=>{o.emit("vf-modal-show",{type:"archive",items:l})}},unarchive:{title:()=>m("Unarchive"),action:()=>{o.emit("vf-modal-show",{type:"unarchive",items:l})}},rename:{title:()=>m("Rename"),action:()=>{o.emit("vf-modal-show",{type:"rename",items:l})}}},f=b=>{o.emit("vf-contextmenu-hide"),b.action()},h=e.ref("");o.on("vf-search-query",({newQuery:b})=>{h.value=b}),o.on("vf-contextmenu-show",({event:b,area:D,items:_,target:k=null})=>{if(a.items=[],h.value)if(k)a.items.push(p.openDir),o.emit("vf-context-selected",[k]);else return;else!k&&!h.value?(a.items.push(p.refresh),a.items.push(p.newfolder),o.emit("vf-context-selected",[])):_.length>1&&_.some($=>$.path===k.path)?(a.items.push(p.refresh),a.items.push(p.archive),a.items.push(p.delete),o.emit("vf-context-selected",_)):(k.type=="dir"?a.items.push(p.open):(a.items.push(p.preview),a.items.push(p.download)),a.items.push(p.rename),k.mime_type=="application/zip"?a.items.push(p.unarchive):a.items.push(p.archive),a.items.push(p.delete),o.emit("vf-context-selected",[k]));y(b,D)}),o.on("vf-contextmenu-hide",()=>{a.active=!1});const y=(b,D)=>{a.active=!0,e.nextTick(()=>{let _=D.getBoundingClientRect(),k=b.pageX,$=b.pageY,P=n.value.offsetHeight,L=n.value.offsetWidth;k=_.right-b.pageX+window.scrollXa.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:n,style:e.normalizeStyle(a.positions)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.items,_=>(e.openBlock(),e.createElementBlock("li",{class:"px-2 py-1.5 cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",key:_.title,onClick:k=>f(_)},[Yi,e.createElementVNode("span",null,e.toDisplayString(_.title()),1)],8,Ki))),128))],4)):e.createCommentVNode("",!0)}}),Xi=(r,t)=>{const o=r[t];return o?typeof o=="function"?o():Promise.resolve(o):new Promise((n,s)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+t)))})};async function qi(r){const t=await Xi(Object.assign({"../locales/en.json":()=>Promise.resolve().then(()=>Dd),"../locales/ru.json":()=>Promise.resolve().then(()=>Nd),"../locales/tr.json":()=>Promise.resolve().then(()=>Cd)}),`../locales/${r}.json`);return JSON.parse(t.default)}function Gi(r,t,o){const{getStore:n,setStore:s}=yt(r),a=e.ref({}),l=f=>{qi(f).then(h=>{a.value=h,s("locale",f),s("translations",h),o.emit("vf-toast-push",{label:"The language is set to "+f})}).catch(h=>{o.emit("vf-toast-push",{label:"The selected locale is not yet supported!",type:"error"}),l("en")})};n("locale")?a.value=n("translations"):l(t);const m=(f,...h)=>h.length?m(f=f.replace("%s",h.shift()),...h):f;function p(f,...h){return a.value.hasOwnProperty(f)?m(a.value[f],...h):f}return{t:p,changeLocale:l}}const Ji={class:"vuefinder"},Zi=e.createElementVNode("iframe",{id:"download_frame",style:{display:"none"}},null,-1),Qi=Object.assign({name:"VueFinder"},{props:{url:{type:[String]},id:{type:String,default:"vf"},dark:{type:Boolean,default:!1},locale:{type:String,default:"en"},maxHeight:{type:String,default:"600px"},postData:{type:Object,default:{}}},setup(r){const t=r,o=To(),{setStore:n,getStore:s}=yt(t.id);e.provide("emitter",o),e.provide("storage",yt(t.id)),e.provide("postData",t.postData);const a=Gi(t.id,t.locale,o);e.provide("i18n",a);const{apiUrl:l,setApiUrl:m}=le();m(t.url);const p=e.reactive({adapter:"local",storages:[],dirname:".",files:[]}),f=e.ref(s("viewport","grid")),h=e.ref(s("darkMode",t.dark));o.on("vf-darkMode-toggle",()=>{h.value=!h.value,n("darkMode",h.value)});const y=e.ref(!1);e.provide("loadingState",y);const b=e.ref(s("full-screen",!1));o.on("vf-fullscreen-toggle",()=>{b.value=!b.value,n("full-screen",b.value)}),o.on("vf-view-toggle",$=>{f.value=$});const D=e.reactive({active:!1,type:"delete",data:{}});o.on("vf-modal-close",()=>{D.active=!1}),o.on("vf-modal-show",$=>{D.active=!0,D.type=$.type,D.data=$});const _=$=>{Object.assign(p,$),o.emit("vf-nodes-selected",{}),o.emit("vf-explorer-update")};let k;return o.on("vf-fetch-abort",()=>{k.abort(),y.value=!1}),o.on("vf-fetch",({params:$,onSuccess:P=null,onError:L=null})=>{["index","search"].includes($.q)&&(k&&k.abort(),y.value=!0),k=new AbortController;const B=k.signal;et(l.value,{params:$,signal:B}).then(T=>{["index","search"].includes($.q)&&(y.value=!1),o.emit("vf-modal-close"),_(T),P(T)}).catch(T=>{L&&L(T)}).finally(()=>{})}),o.on("vf-download",$=>{document.getElementById("download_frame").src=$,o.emit("vf-modal-close")}),e.onMounted(()=>{o.emit("vf-fetch",{params:{q:"index",adapter:s("adapter",p.adapter)}})}),($,P)=>(e.openBlock(),e.createElementBlock("div",Ji,[e.createElementVNode("div",{class:e.normalizeClass(h.value?"dark":"")},[e.createElementVNode("div",{class:e.normalizeClass([b.value?"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(b.value?"":"max-height: "+r.maxHeight),onMousedown:P[0]||(P[0]=L=>e.unref(o).emit("vf-contextmenu-hide")),onTouchstart:P[1]||(P[1]=L=>e.unref(o).emit("vf-contextmenu-hide"))},[e.createVNode(un,{data:p},null,8,["data"]),e.createVNode(Ui,{data:p},null,8,["data"]),e.createVNode(ai,{view:f.value,data:p},null,8,["view","data"]),e.createVNode(xi,{data:p},null,8,["data"])],38),D.active?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("v-f-modal-"+D.type),{key:0,selection:D.data,current:p},null,8,["selection","current"])):e.createCommentVNode("",!0),e.createVNode(Wi,{current:p},null,8,["current"]),Zi],2)]))}}),es=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),ts={class:"fixed z-10 inset-0 overflow-hidden"},rs={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"},os={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},ns={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"},de={__name:"ModalLayout",setup(r){const t=e.inject("emitter");return e.onMounted(()=>{const o=document.querySelector(".v-f-modal input");o&&o.focus()}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:"v-f-modal relative z-30","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",onKeyup:n[1]||(n[1]=e.withKeys(s=>e.unref(t).emit("vf-modal-close"),["esc"])),tabindex:"0"},[es,e.createElementVNode("div",ts,[e.createElementVNode("div",{class:"flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0",onMousedown:n[0]||(n[0]=e.withModifiers(s=>e.unref(t).emit("vf-modal-close"),["self"]))},[e.createElementVNode("div",rs,[e.createElementVNode("div",os,[e.renderSlot(o.$slots,"default")]),e.createElementVNode("div",ns,[e.renderSlot(o.$slots,"buttons")])])],32)])],32))}},as=["aria-label"],is=[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)],he=Object.assign({name:"Message"},{props:{error:{type:Boolean,default:!1}},emits:["hidden"],setup(r,{emit:t}){var m;const{t:o}=e.inject("i18n"),n=e.ref(!1),s=e.ref(null),a=e.ref((m=s.value)==null?void 0:m.strMessage);e.watch(a,()=>n.value=!1);const l=()=>{t("hidden"),n.value=!0};return(p,f)=>(e.openBlock(),e.createElementBlock("div",null,[n.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"strMessage",ref:s,class:e.normalizeClass(["flex mt-1 p-1 px-2 rounded text-sm",r.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:l,"aria-label":e.unref(o)("Close"),"data-microtip-position":"top-left",role:"tooltip"},is,8,as)],2))]))}}),ss={class:"sm:flex sm:items-start"},ls=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),cs={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ds={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},hs={class:"mt-2"},us={class:"text-sm text-gray-500"},ms={class:"flex text-sm text-gray-800 dark:text-gray-400"},fs={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"},ps=[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)],gs={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"},ys=[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)],bs={class:"ml-1.5"},vs={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},ws=Object.assign({name:"VFModalDelete"},{props:{selection:Object,current:Object},setup(r){const t=r,o=e.inject("emitter"),{getStore:n}=e.inject("storage"),{t:s}=e.inject("i18n"),a=e.ref(t.selection.items),l=e.ref(""),m=()=>{a.value.length&&o.emit("vf-fetch",{params:{q:"delete",adapter:n("adapter","local"),path:t.current.dirname,items:JSON.stringify(a.value.map(({path:p,type:f})=>({path:p,type:f})))},onSuccess:()=>{o.emit("vf-toast-push",{label:s("Files deleted.")})},onError:p=>{l.value=s(p.message)}})};return(p,f)=>(e.openBlock(),e.createBlock(de,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Yes, Delete!")),1),e.createElementVNode("button",{type:"button",onClick:f[1]||(f[1]=h=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Cancel")),1),e.createElementVNode("div",vs,e.toDisplayString(e.unref(s)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ss,[ls,e.createElementVNode("div",cs,[e.createElementVNode("h3",ds,e.toDisplayString(e.unref(s)("Delete files")),1),e.createElementVNode("div",hs,[e.createElementVNode("p",us,e.toDisplayString(e.unref(s)("Are you sure you want to delete these files?")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,h=>(e.openBlock(),e.createElementBlock("p",ms,[h.type=="dir"?(e.openBlock(),e.createElementBlock("svg",fs,ps)):(e.openBlock(),e.createElementBlock("svg",gs,ys)),e.createElementVNode("span",bs,e.toDisplayString(h.basename),1)]))),256)),l.value.length?(e.openBlock(),e.createBlock(he,{key:0,onHidden:f[0]||(f[0]=h=>l.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),_s={class:"sm:flex sm:items-start"},ks=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),xs={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ss={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Es={class:"mt-2"},Ds={class:"text-sm text-gray-500"},Ns=Object.assign({name:"VFModalMessage"},{props:{selection:Object},setup(r){const t=e.inject("emitter"),{t:o}=e.inject("i18n");return(n,s)=>(e.openBlock(),e.createBlock(de,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:s[0]||(s[0]=a=>e.unref(t).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(o)("Close")),1)]),default:e.withCtx(()=>{var a,l,m,p;return[e.createElementVNode("div",_s,[ks,e.createElementVNode("div",xs,[e.createElementVNode("h3",Ss,e.toDisplayString((l=(a=r.selection)==null?void 0:a.title)!=null?l:"Title"),1),e.createElementVNode("div",Es,[e.createElementVNode("p",Ds,e.toDisplayString((p=(m=r.selection)==null?void 0:m.message)!=null?p:"Message")+".",1)])])])]}),_:1}))}}),Cs={class:"sm:flex sm:items-start"},Vs=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),$s={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ms={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Bs={class:"mt-2"},Ts={class:"text-sm text-gray-500"},As=["onKeyup","placeholder"],Os=Object.assign({name:"VFModalNewFolder"},{props:{selection:Object,current:Object},setup(r){const t=r,o=e.inject("emitter"),{getStore:n}=e.inject("storage"),{t:s}=e.inject("i18n"),a=e.ref(""),l=e.ref(""),m=()=>{a.value!=""&&o.emit("vf-fetch",{params:{q:"newfolder",adapter:n("adapter","local"),path:t.current.dirname,name:a.value},onSuccess:()=>{o.emit("vf-toast-push",{label:s("%s is created.",a.value)})},onError:p=>{l.value=s(p.message)}})};return(p,f)=>(e.openBlock(),e.createBlock(de,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Create")),1),e.createElementVNode("button",{type:"button",onClick:f[2]||(f[2]=h=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Cs,[Vs,e.createElementVNode("div",$s,[e.createElementVNode("h3",Ms,e.toDisplayString(e.unref(s)("New Folder")),1),e.createElementVNode("div",Bs,[e.createElementVNode("p",Ts,e.toDisplayString(e.unref(s)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=h=>a.value=h),onKeyup:e.withKeys(m,["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(s)("Folder Name"),type:"text"},null,40,As),[[e.vModelText,a.value]]),l.value.length?(e.openBlock(),e.createBlock(he,{key:0,onHidden:f[1]||(f[1]=h=>l.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Ls={class:"sm:flex sm:items-start"},Is=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),js={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ps={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},zs={class:"mt-2"},Rs={class:"text-sm text-gray-500"},Hs=["onKeyup","placeholder"],Fs=Object.assign({name:"VFModalNewFile"},{props:{selection:Object,current:Object},setup(r){const t=r,o=e.inject("emitter"),{getStore:n}=e.inject("storage"),{t:s}=e.inject("i18n"),a=e.ref(""),l=e.ref(""),m=()=>{a.value!=""&&o.emit("vf-fetch",{params:{q:"newfile",adapter:n("adapter","local"),path:t.current.dirname,name:a.value},onSuccess:()=>{o.emit("vf-toast-push",{label:s("%s is created.",a.value)})},onError:p=>{l.value=s(p.message)}})};return(p,f)=>(e.openBlock(),e.createBlock(de,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},"Create!"),e.createElementVNode("button",{type:"button",onClick:f[2]||(f[2]=h=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},"Cancel")]),default:e.withCtx(()=>[e.createElementVNode("div",Ls,[Is,e.createElementVNode("div",js,[e.createElementVNode("h3",Ps,e.toDisplayString(e.unref(s)("New File")),1),e.createElementVNode("div",zs,[e.createElementVNode("p",Rs,e.toDisplayString(e.unref(s)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=h=>a.value=h),onKeyup:e.withKeys(m,["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(s)("File Name"),type:"text"},null,40,Hs),[[e.vModelText,a.value]]),l.value.length?(e.openBlock(),e.createBlock(he,{key:0,onHidden:f[1]||(f[1]=h=>l.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Us={class:"flex"},Ks=["aria-label"],Ys={class:"ml-auto mb-2"},Ws={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"},Xs={key:1},qs={__name:"Text",props:{selection:Object},emits:["load"],setup(r,{emit:t}){const o=r,n=e.ref(""),s=e.ref(""),a=e.ref(null),l=e.ref(!1),{apiUrl:m}=le(),p=e.ref(""),f=e.ref(!1),{t:h}=e.inject("i18n");e.onMounted(()=>{et(m.value,{params:{q:"preview",adapter:o.selection.adapter,path:o.selection.item.path},json:!1}).then(_=>{n.value=_,t("load")})});const y=()=>{l.value=!l.value,s.value=n.value,l.value==!0&&e.nextTick(()=>{a.value.focus()})},b=e.inject("postData"),D=()=>{p.value="",f.value=!1,et(m.value,{method:"POST",params:Object.assign(b,{q:"save",adapter:o.selection.adapter,path:o.selection.item.path,content:s.value}),json:!1}).then(_=>{p.value=h("Updated."),n.value=_,t("load"),l.value=!l.value}).catch(_=>{p.value=h(_.message),f.value=!0})};return(_,k)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Us,[e.createElementVNode("div",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":r.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(r.selection.item.basename),9,Ks),e.createElementVNode("div",Ys,[l.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:D,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(h)("Save")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:k[0]||(k[0]=$=>y())},e.toDisplayString(l.value?e.unref(h)("Cancel"):e.unref(h)("Edit")),1)])]),e.createElementVNode("div",null,[l.value?(e.openBlock(),e.createElementBlock("div",Xs,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:a,"onUpdate:modelValue":k[1]||(k[1]=$=>s.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,s.value]])])):(e.openBlock(),e.createElementBlock("pre",Ws,e.toDisplayString(n.value),1)),p.value.length?(e.openBlock(),e.createBlock(he,{key:2,onHidden:k[2]||(k[2]=$=>p.value=""),error:f.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)])],64))}},cu="";/*! +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var C=function(c,i,g){var d=c.x,v=c.y,w=g.x,x=g.y,E={"+":{x:d+w,y:v+x},"-":{x:d-w,y:v-x},"*":{x:d*w,y:v*x},"/":{x:d/w,y:v/x}};return E[i]},H=function(c){return{x:c.left,y:c.top}},F=function(c){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return{left:c.x,top:c.y,right:c.x,bottom:c.y,width:i,height:i}},Q=function(c){return{x:c,y:c}},W=function(u,c,i){window.addEventListener("resize",c),window.addEventListener("scroll",c),u.forEach(function(g,d){i.observe(g,{childList:d!==0,attributes:!0})})},Je=function(u){var c=Le(u);return c.x||c.y?!0:u instanceof HTMLDocument?u.body?!!(u.body.scrollTop=1):!!(u.documentElement.scrollTop=1):!!(u.scrollTop=1)},ut=function(u){var c=document.createElement("div");return c.style.position="fixed",c.style.overflow="hidden",c.style.pointerEvents="none",c.style.zIndex="999999999999999999",c.classList.add(u),c},mt=function(u){var c=document.createElement("div");return c.style.position="absolute",u||(c.style.background="rgba(0, 0, 255, 0.1)",c.style.border="1px solid rgba(0, 0, 255, 0.45)",c.style.display="none",c.style.pointerEvents="none"),c},ft=function(u,c){var i;return function(){for(var g=arguments.length,d=new Array(g),v=0;v=0?u.scrollLeft:Oe().x,y:u.scrollTop>=0?u.scrollTop:Oe().y}},mo=function(u){var c=u.elementRect,i=u.containerRect,g=u.tolerance,d=g===void 0?{x:0,y:0}:g,v=[];return c.top-d.yi.bottom&&v.push("bottom"),c.right+d.y>i.right&&v.push("right"),v},Vd=function(u){var c=u.event;return{x:c.clientX,y:c.clientY}},$d=function(u){var c=u.scrollAmount,i=u.initialPointerPos,g=u.pointerPos,d={};return g.x>i.x-c.x?(d.left=i.x-c.x,d.width=g.x-i.x+c.x):(d.left=g.x,d.width=i.x-g.x-c.x),g.y>i.y-c.y?(d.top=i.y-c.y,d.height=g.y-i.y+c.y):(d.top=g.y,d.height=i.y-g.y-c.y),d},fo=function(c){var i={x:0,y:0},g=window.getComputedStyle(c);if(!g.transform||g.transform==="none")return i;if(g.transform.indexOf("3d")>=0){var d=g.transform.trim().match(/matrix3d\((.*?)\)/);if(d&&d.length){var v,w=(v=d[1])===null||v===void 0?void 0:v.split(",");i.x=parseInt(w[12])||0,i.y=parseInt(w[13])||0}return i}else{var x=g.transform.trim().match(/matrix\((.*?)\)/);if(x&&x.length){var E,V=(E=x[1])===null||E===void 0?void 0:E.split(",");i.x=parseInt(V[4])||0,i.y=parseInt(V[5])||0}return i}},Md=function(c){var i=c.style.transform;if(!i||i.indexOf("translate")<0)return fo(c);var g={x:0,y:0},d=i.trim().match(/translate[3dD]*?\(.*?\)/);if(d){var v,w=(v=d[0])===null||v===void 0?void 0:v.split("(");if(w){var x,E=(x=w[1])===null||x===void 0?void 0:x.split(",");g.x=parseInt(E[0])||0,g.y=parseInt(E[1])||0}}return!g.x&&!g.x?fo(c):g},Bd=function(c){var i=c.style,g={x:parseInt(i.left)||0,y:parseInt(i.top)||0};if(!g.x&&!g.x){var d=window.getComputedStyle(c);return{x:parseInt(d.left)||0,y:parseInt(d.top)||0}}return g},Td=function(u,c){return c?Md(u):Bd(u)},Ad=function(u){var c=u.element,i=u.edges,g=u.elementRect,d=u.containerRect,v=u.elementPos,w=u.useTransform;i.includes("top")&&Ze(c,{y:v.y+d.top-g.top,x:v.x},w),i.includes("left")&&Ze(c,{y:v.y,x:v.x+d.left-g.left},w),i.includes("bottom")&&Ze(c,{y:v.y+d.bottom-g.bottom,x:v.x},w),i.includes("right")&&Ze(c,{y:v.y,x:v.x+d.right-g.right},w)},po=function(u){var c=u.computedStyle,i=u.node,g=c.position,d=g==="absolute"||g==="relative"||g==="fixed";!(i instanceof HTMLDocument)&&!d&&(i.style.position="relative")},Od=function(u){var c=u.shiftKey,i=u.keyboardDragSpeed,g=u.zoom,d=u.key,v=u.dragKeys,w=u.scrollDiff,x=u.canScroll,E=u.scrollCallback,V={x:0,y:0},N=c?i*4*g:i*g;return v.left.includes(d)&&(V.x=w.x||-N,!c&&!w.x&&x&&E(["left"],i)),v.right.includes(d)&&(V.x=w.x||N,!c&&!w.x&&x&&E(["right"],i)),v.up.includes(d)&&(V.y=w.y||-N,!c&&!w.y&&x&&E(["top"],i)),v.down.includes(d)&&(V.y=w.y||N,!c&&!w.y&&x&&E(["bottom"],i)),V},Ld=function(u){var c=u.element,i=u.force,g=u.multiSelectionToggle,d=u.SelectedSet,v=u.hoverClassName;c.classList.contains(v)&&!i||(d.has(c)?g&&d.delete(c):d.add(c),c.classList.add(v))},Id=function(u){var c=u.element,i=u.force,g=u.SelectedSet,d=u.PrevSelectedSet,v=u.hoverClassName;if(!c.classList.contains(v)&&!i)return!1;var w=g.has(c),x=d.has(c);w&&!x?g.delete(c):!w&&x&&g.add(c),c.classList.remove(v)},qt=function(u,c){return u.leftc.left&&u.topc.top},go=function(u){var c=u.element,i=u.posDirection,g=u.containerRect,d=u.useTransform,v=Td(c,d),w=C(v,"+",i);Ze(c,w,d);var x=c.getBoundingClientRect(),E=mo({elementRect:x,containerRect:g});Ad({element:c,edges:E,elementRect:x,containerRect:g,elementPos:w,useTransform:d})},jd=function(u,c){window.removeEventListener("resize",c),window.removeEventListener("scroll",c),u.disconnect()},Pd=function(u,c,i){if(!!c.length){var g=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,d=u instanceof HTMLDocument?g||document.body:u,v=c.includes("top")&&d.scrollTop>0,w=c.includes("bottom")&&d.scrollTop0,E=c.includes("right")&&d.scrollLeft1&&arguments[1]!==void 0?arguments[1]:0,x=(v=d[w])===null||v===void 0?void 0:v.parentNode;return x?(d.push(x),w++,g(d,w)):d};return this._parentNodes=i([this.HTMLNode]),this._parentNodes}}]),u}(),Hd=function(){function u(c){var i=this,g=c.DS,d=c.dragKeys,v=c.draggability,w=c.keyboardDrag,x=c.keyboardDragSpeed,E=c.useTransform,V=c.zoom;o(this,u),a(this,"_useTransform",void 0),a(this,"_prevCursorPos",void 0),a(this,"_prevScrollPos",void 0),a(this,"_elements",[]),a(this,"_draggability",void 0),a(this,"_dragKeys",void 0),a(this,"_dragKeysFlat",void 0),a(this,"_keyboardDrag",void 0),a(this,"_keyboardDragSpeed",void 0),a(this,"_zoom",void 0),a(this,"keyboardDrag",function(N){var A=N.event,I=N.key;if(!(!i._keyboardDrag||!i._dragKeysFlat.includes(I)||!i.DS.SelectedSet.size||!i._draggability||i.DS.continue)){var X={event:A,isDragging:!0,isDraggingKeyboard:!0};i.DS.publish(["Interaction:start:pre","Interaction:start"],X),i._elements=i.DS.getSelection(),i.handleZIndex(!0);var ae=Od({shiftKey:i.DS.stores.KeyStore.currentValues.includes("shift"),keyboardDragSpeed:i._keyboardDragSpeed,zoom:i._zoom,key:I,scrollCallback:i.DS.Area.scroll,scrollDiff:i._scrollDiff,canScroll:i.DS.stores.ScrollStore.canScroll,dragKeys:i._dragKeys});i._elements.forEach(function(G){return go({element:G,posDirection:ae,containerRect:i.DS.SelectorArea.rect,useTransform:i._useTransform})}),i.DS.publish(["Interaction:update:pre","Interaction:update"],X)}}),a(this,"keyboardEnd",function(N){var A=N.event,I=N.key;if(!(!i._keyboardDrag||!i._dragKeysFlat.includes(I)||!i.DS.SelectedSet.size||!i._draggability)){var X={event:A,isDragging:i._draggability,isDraggingKeyboard:!0};i.DS.publish(["Interaction:end:pre","Interaction:end"],X)}}),a(this,"start",function(N){var A=N.isDragging,I=N.isDraggingKeyboard;!A||I||(i._prevCursorPos=null,i._prevScrollPos=null,i._elements=i.DS.getSelection(),i.handleZIndex(!0))}),a(this,"stop",function(N){N!=null&&N.isKeyboard||(i._prevCursorPos=null,i._prevScrollPos=null,i.handleZIndex(!1),i._elements=[])}),a(this,"update",function(N){var A=N.isDragging,I=N.isDraggingKeyboard;if(!(!A||!i._elements.length||I||i.DS.continue)){var X=C(i._cursorDiff,"+",i._scrollDiff);i._elements.forEach(function(ae){return go({element:ae,posDirection:X,containerRect:i.DS.SelectorArea.rect,useTransform:i._useTransform})})}}),a(this,"handleZIndex",function(N){i._elements.forEach(function(A){return A.style.zIndex="".concat((parseInt(A.style.zIndex)||0)+N?9999:-9998)})}),this.DS=g,this._useTransform=E,this._keyboardDragSpeed=x,this._keyboardDrag=w,this._zoom=V,this._draggability=v,this._dragKeys={up:d.up.map(function(N){return N.toLowerCase()}),down:d.down.map(function(N){return N.toLowerCase()}),left:d.left.map(function(N){return N.toLowerCase()}),right:d.right.map(function(N){return N.toLowerCase()})},this._dragKeysFlat=[].concat(R(this._dragKeys.up),R(this._dragKeys.down),R(this._dragKeys.left),R(this._dragKeys.right)),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:end",this.stop),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("KeyStore:down",this.keyboardDrag),this.DS.subscribe("KeyStore:up",this.keyboardEnd)}return s(u,[{key:"_cursorDiff",get:function(){var i=this.DS.stores.PointerStore.currentVal,g=this._prevCursorPos?C(i,"-",this._prevCursorPos):{x:0,y:0};return this._prevCursorPos=i,g}},{key:"_scrollDiff",get:function(){var i=this.DS.stores.ScrollStore.currentVal,g=this._prevScrollPos?C(i,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=i,g}}]),u}(),Fd=function(){function u(c){var i=this,g=c.DS,d=c.areaElement,v=c.draggability,w=c.immediateDrag,x=c.selectableClass;o(this,u),a(this,"_areaElement",void 0),a(this,"_draggability",void 0),a(this,"_immediateDrag",void 0),a(this,"_selectableClass",void 0),a(this,"isInteracting",void 0),a(this,"isDragging",void 0),a(this,"init",function(){return i.DS.publish("Interaction:init:pre",{})}),a(this,"_init",function(){i.stop(),i._areaElement.addEventListener("mousedown",i.start),i._areaElement.addEventListener("touchstart",i.start,{passive:!1}),i.DS.publish("Interaction:init",{})}),a(this,"start",function(E){return i.DS.publish("Interaction:start:pre",{event:E,isDragging:i.isDragging})}),a(this,"_start",function(E){E.type==="touchstart"&&E.preventDefault(),i._canInteract(E)&&(i.isInteracting=!0,i.isDragging=i.isDragEvent(E),i.DS.publish("Interaction:start",{event:E,isDragging:i.isDragging}),document.addEventListener("mouseup",i.reset),document.addEventListener("touchend",i.reset))}),a(this,"isDragEvent",function(E){var V=E.target.closest(".".concat(i._selectableClass));return!i._draggability||i.DS.stores.KeyStore.isMultiSelectKeyPressed(E)||!V?!1:(i._immediateDrag&&(i.DS.SelectedSet.size?i.DS.SelectedSet.has(V)||(i.DS.SelectedSet.clear(),i.DS.SelectedSet.add(V)):i.DS.SelectedSet.add(V)),!!i.DS.SelectedSet.has(V))}),a(this,"onClick",function(E){var V=E.event;if(!!i._canInteract(V)&&!(V.detail>0)){var N=i.DS,A=N.stores,I=A.PointerStore,X=A.KeyStore,ae=N.SelectableSet,G=N.SelectedSet;I.start(V);var je=V.target;!ae.has(je)||(X.isMultiSelectKeyPressed(V)||G.clear(),G.toggle(je),i.reset())}}),a(this,"stop",function(){i.isInteracting=!1,i.isDragging=!1,i._areaElement.removeEventListener("mousedown",i.start),i._areaElement.removeEventListener("touchstart",i.start,{passive:!1}),document.removeEventListener("mouseup",i.reset),document.removeEventListener("touchend",i.reset)}),a(this,"update",function(E){var V=E.event,N=E.scroll_directions,A=E.scroll_multiplier;i.isInteracting&&i.DS.publish(["Interaction:update:pre","Interaction:update"],{event:V,scroll_directions:N,scroll_multiplier:A,isDragging:i.isDragging})}),a(this,"reset",function(E){return i.DS.publish("Interaction:end:pre",{event:E,isDragging:i.isDragging})}),a(this,"_reset",function(E){var V=i.isDragging;i.stop(),i.init(),i.DS.publish("Interaction:end",{event:E,isDragging:V})}),this._areaElement=d,this._draggability=v,this._immediateDrag=w,this._selectableClass=x,this.DS=g,this.DS.subscribe("PointerStore:updated",this.update),this.DS.subscribe("Selectable:click",this.onClick),this.DS.subscribe("Selectable:pointer",function(E){var V=E.event;return i.start(V)}),this.DS.subscribe("Interaction:start:pre",function(E){var V=E.event;return i._start(V)}),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",function(E){var V=E.event;return i._reset(V)}),this.DS.subscribe("Area:scroll",this.update)}return s(u,[{key:"_canInteract",value:function(i){var g=i.clientX===0&&i.clientY===0&&i.detail===0&&i.target;return!(i.button===2||this.isInteracting||i.target&&!this.DS.SelectorArea.isInside(i.target)||!g&&!this.DS.SelectorArea.isClicked(i))}}]),u}(),Ud=function u(c){var i=this,g=c.DS;o(this,u),a(this,"subscribers",{}),a(this,"subscribe",function(d,v){return Array.isArray(i.subscribers[d])||(i.subscribers[d]=[]),i.subscribers[d].push(v),i.subscribers[d].length-1}),a(this,"unsubscribe",function(d,v,w){w>=0?i.subscribers[d].splice(w,1):v&&(i.subscribers[d]=i.subscribers[d].filter(function(x){return x!==v}))}),a(this,"publish",function(d,v){Array.isArray(d)?d.forEach(function(w){return i._publish(w,v)}):i._publish(d,v)}),a(this,"_publish",function(d,v){var w=i.subscribers[d];!Array.isArray(w)||(d.includes(":pre")?i._handlePrePublish(w,v):i._handlePublish(w,v))}),a(this,"_handlePublish",function(d,v){for(var w=0,x=d.length;w0&&arguments[0]!==void 0?arguments[0]:"append",E=document.body?"body":"documentElement",V="".concat(x,"Child");i.HTMLNode[V](i.DS.Selector.HTMLNode),document[E][V](i.HTMLNode)}),a(this,"updatePos",function(){i._rect=null;var x=i.DS.Area.rect,E=i.DS.Area.computedBorder,V=i.HTMLNode.style,N="".concat(x.top+E.top,"px"),A="".concat(x.left+E.left,"px"),I="".concat(x.width,"px"),X="".concat(x.height,"px");V.top!==N&&(V.top=N),V.left!==A&&(V.left=A),V.width!==I&&(V.width=I),V.height!==X&&(V.height=X)}),a(this,"stop",function(x){i.stopAutoScroll(),x&&i.applyElements("remove")}),a(this,"startAutoScroll",function(){i.currentEdges=[],i._scrollInterval=setInterval(function(){return i.handleAutoScroll()},16)}),a(this,"handleAutoScroll",function(){if(!i.DS.continue){var x=i.DS,E=x.stores.PointerStore,V=x.Area;i.currentEdges=mo({elementRect:F(E.currentVal),containerRect:i.rect,tolerance:i._overflowTolerance}),i.currentEdges.length&&V.scroll(i.currentEdges,i._autoScrollSpeed)}}),a(this,"stopAutoScroll",function(){i.currentEdges=[],clearInterval(i._scrollInterval)}),a(this,"isInside",function(x,E){return i.DS.Area.HTMLNode.contains(x)&&i.DS.stores.ScrollStore.canScroll?!0:qt(i.rect,E||x.getBoundingClientRect())}),this._autoScrollSpeed=v,this._overflowTolerance=w,this.DS=g,this.HTMLNode=ut(d),this.DS.subscribe("Area:modified",this.updatePos),this.DS.subscribe("Interaction:init",this.start),this.DS.subscribe("Interaction:start",this.startAutoScroll),this.DS.subscribe("Interaction:end",function(){i.updatePos(),i.stopAutoScroll()})}return s(u,[{key:"isClicked",value:function(i){var g=this.DS.stores.PointerStore,d=i?g.getPointerPosition(i):g.initialVal;return qt({left:d.x,top:d.y,right:d.x,bottom:d.y},this.rect)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),u}(),Gd=function(){function u(c){var i=this,g=c.DS,d=c.multiSelectKeys,v=c.multiSelectMode;o(this,u),a(this,"_multiSelectMode",void 0),a(this,"_multiSelectKeys",void 0),a(this,"_currentValues",new Set),a(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),a(this,"init",function(){document.addEventListener("keydown",i.keydown),document.addEventListener("keyup",i.keyup),window.addEventListener("blur",i.reset)}),a(this,"keydown",function(w){var x=w.key.toLowerCase();i.DS.publish("KeyStore:down:pre",{event:w,key:x}),i._currentValues.add(x),i.DS.publish("KeyStore:down",{event:w,key:x})}),a(this,"keyup",function(w){var x=w.key.toLowerCase();i.DS.publish("KeyStore:up:pre",{event:w,key:x}),i._currentValues.delete(x),i.DS.publish("KeyStore:up",{event:w,key:x})}),a(this,"stop",function(){document.removeEventListener("keydown",i.keydown),document.removeEventListener("keyup",i.reset),window.removeEventListener("blur",i.reset),i.reset()}),a(this,"reset",function(){return i._currentValues.clear()}),this.DS=g,this._multiSelectMode=v,this._multiSelectKeys=d.map(function(w){var x={ctrlKey:"Control",shiftKey:"Shift",metaKey:"Meta"},E=x[w];return E?(console.warn("[DragSelect] ".concat(w,' is deprecated. Use "').concat(E,'" instead. Act Now!. See docs for more info')),E.toLowerCase()):w.toLowerCase()}),this.DS.subscribe("Interaction:init",this.init)}return s(u,[{key:"isMultiSelectKeyPressed",value:function(i){var g=this;return!!(this._multiSelectMode||this.currentValues.some(function(d){return g._multiSelectKeys.includes(d)})||i&&this._multiSelectKeys.some(function(d){return i[g._keyMapping[d]]}))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),u}(),Jd=function(){function u(c){var i=this,g=c.DS;o(this,u),a(this,"_isMouseInteraction",!1),a(this,"_initialValArea",void 0),a(this,"_currentValArea",void 0),a(this,"_lastValArea",void 0),a(this,"_initialVal",void 0),a(this,"_currentVal",void 0),a(this,"_lastVal",void 0),a(this,"_lastTouch",void 0),a(this,"init",function(){document.addEventListener("mousemove",i.update),document.addEventListener("touchmove",i.update,{passive:!1})}),a(this,"getPointerPosition",function(d){return Vd({event:i._normalizedEvent(d)})}),a(this,"update",function(d){!d||(i.DS.publish("PointerStore:updated:pre",{event:d}),i.currentVal=i.getPointerPosition(d),i._isMouseInteraction&&i.DS.publish("PointerStore:updated",{event:d}))}),a(this,"stop",function(){document.removeEventListener("mousemove",i.update),document.removeEventListener("touchmove",i.update,{passive:!1}),setTimeout(function(){return i._isMouseInteraction=!1},100)}),a(this,"reset",function(d){!d||(i.currentVal=i.lastVal=i.getPointerPosition(d),i.stop(),i.init())}),this.DS=g,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(d){var v=d.event;return i.start(v)}),this.DS.subscribe("Interaction:end",function(d){var v=d.event;return i.reset(v)})}return s(u,[{key:"start",value:function(i){!i||(this._isMouseInteraction=!0,this.currentVal=this.initialVal=this.getPointerPosition(i))}},{key:"_normalizedEvent",value:function(i){return"touches"in i&&i.type!=="touchend"&&(this._lastTouch=i),"touches"in i?this._lastTouch.touches[0]:i}},{key:"initialValArea",get:function(){return this._initialValArea?this._initialValArea:{x:0,y:0}}},{key:"currentValArea",get:function(){return this._currentValArea?this._currentValArea:{x:0,y:0}}},{key:"lastValArea",get:function(){return this._lastValArea?this._lastValArea:{x:0,y:0}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}},set:function(i){this._initialVal=i,this._initialValArea=i&&C(i,"-",C(H(this.DS.Area.rect),"+",H(this.DS.Area.computedBorder)))}},{key:"currentVal",get:function(){return this._currentVal?this._currentVal:{x:0,y:0}},set:function(i){this._currentVal=i,this._currentValArea=i&&C(i,"-",C(H(this.DS.Area.rect),"+",H(this.DS.Area.computedBorder)))}},{key:"lastVal",get:function(){return this._lastVal?this._lastVal:{x:0,y:0}},set:function(i){this._lastVal=i,this._lastValArea=i&&C(i,"-",C(H(this.DS.Area.rect),"+",H(this.DS.Area.computedBorder)))}}]),u}(),Zd=function(){function u(c){var i=this,g=c.DS,d=c.areaElement,v=c.zoom;o(this,u),a(this,"_initialVal",void 0),a(this,"_currentVal",void 0),a(this,"_areaElement",void 0),a(this,"_canScroll",void 0),a(this,"init",function(){return i._areaElement.addEventListener("scroll",i.update)}),a(this,"start",function(){i._currentVal=i._initialVal=Le(i._areaElement),i._areaElement.addEventListener("scroll",i.update)}),a(this,"update",function(){return i._currentVal=Le(i._areaElement)}),a(this,"stop",function(){i._areaElement.removeEventListener("scroll",i.update),i._initialVal={x:0,y:0},i._canScroll=null}),a(this,"reset",function(){i.stop(),i.start()}),this._areaElement=d,this.DS=g,this.zoom=v,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(){return i.start()}),this.DS.subscribe("Interaction:end",function(){return i.reset()})}return s(u,[{key:"canScroll",get:function(){return typeof this._canScroll=="boolean"?this._canScroll:this._canScroll=Je(this._areaElement)}},{key:"scrollAmount",get:function(){var i=C(this.currentVal,"-",this.initialVal),g=Q(this.zoom),d=C(C(i,"*",g),"-",i);return{x:i.x+d.x,y:i.y+d.y}}},{key:"initialVal",get:function(){return this._initialVal?this._initialVal:{x:0,y:0}}},{key:"currentVal",get:function(){return this._currentVal||(this._currentVal=Le(this._areaElement)),this._currentVal}}]),u}(),Qd=function(){function u(c){var i=this,g=c.area,d=g===void 0?document:g,v=c.selectables,w=v===void 0?[]:v,x=c.autoScrollSpeed,E=x===void 0?5:x,V=c.overflowTolerance,N=V===void 0?{x:25,y:25}:V,A=c.zoom,I=A===void 0?1:A,X=c.customStyles,ae=X===void 0?!1:X,G=c.multiSelectMode,je=G===void 0?!1:G,pt=c.multiSelectToggling,_e=pt===void 0?!0:pt,bo=c.multiSelectKeys,eh=bo===void 0?["Control","Shift","Meta"]:bo,vo=c.selector,th=vo===void 0?void 0:vo,wo=c.draggability,Gt=wo===void 0?!0:wo,_o=c.immediateDrag,rh=_o===void 0?!0:_o,ko=c.keyboardDrag,oh=ko===void 0?!0:ko,nh=c.dragKeys,xo=c.keyboardDragSpeed,ah=xo===void 0?10:xo,So=c.useTransform,Eo=So===void 0?!0:So,Do=c.hoverClass,No=Do===void 0?"ds-hover":Do,Co=c.selectableClass,Vo=Co===void 0?"ds-selectable":Co,$o=c.selectedClass,ih=$o===void 0?"ds-selected":$o,Mo=c.selectorClass,sh=Mo===void 0?"ds-selector":Mo,Bo=c.selectorAreaClass,lh=Bo===void 0?"ds-selector-area":Bo,ch=c.callback,dh=c.onDragMove,hh=c.onDragStartBegin,uh=c.onDragStart,mh=c.onElementSelect,fh=c.onElementUnselect;o(this,u),a(this,"continue",!1),a(this,"start",function(){i.stopped=!1,i.Interaction.init()}),a(this,"break",function(){return i.continue=!0}),a(this,"getSelection",function(){return i.SelectedSet.elements}),a(this,"getSelectables",function(){return i.SelectableSet.elements}),a(this,"getInitialCursorPosition",function(){return i.stores.PointerStore.initialVal}),a(this,"getCurrentCursorPosition",function(){return i.stores.PointerStore.currentVal}),a(this,"getPreviousCursorPosition",function(){return i.stores.PointerStore.lastVal}),a(this,"getInitialCursorPositionArea",function(){return i.stores.PointerStore.initialValArea}),a(this,"getCurrentCursorPositionArea",function(){return i.stores.PointerStore.currentValArea}),a(this,"getPreviousCursorPositionArea",function(){return i.stores.PointerStore.lastValArea}),a(this,"isMultiSelect",function(ph){return i.stores.KeyStore.isMultiSelectKeyPressed(ph)}),a(this,"isDragging",function(){return i.Interaction.isDragging}),this.PubSub=new Ud({DS:this}),this.subscribe=this.PubSub.subscribe,this.unsubscribe=this.PubSub.unsubscribe,this.publish=this.PubSub.publish,this._callbacksTemp({callback:ch,onDragMove:dh,onDragStart:uh,onDragStartBegin:hh,onElementSelect:mh,onElementUnselect:fh}),this.stores={PointerStore:new Jd({DS:this}),ScrollStore:new Zd({DS:this,areaElement:d,zoom:I}),KeyStore:new Gd({DS:this,multiSelectKeys:eh,multiSelectMode:je})},this.Area=new Rd({area:d,PS:this.PubSub,zoom:I}),this.Selector=new Xd({DS:this,selector:th,selectorClass:sh,customStyles:ae}),this.SelectorArea=new qd({DS:this,selectorAreaClass:lh,autoScrollSpeed:E,overflowTolerance:N}),this.SelectableSet=new Kd({elements:w,DS:this,className:Vo,hoverClassName:No,useTransform:Eo,draggability:Gt}),this.SelectedSet=new Yd({DS:this,className:ih}),this.Selection=new Wd({DS:this,hoverClassName:No,multiSelectToggling:_e}),this.Drag=new Hd({DS:this,draggability:Gt,useTransform:Eo,keyboardDrag:oh,dragKeys:Object.assign({up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},nh),zoom:I,keyboardDragSpeed:ah}),this.Interaction=new Fd({areaElement:d,DS:this,draggability:Gt,immediateDrag:rh,selectableClass:Vo}),zd({subscribe:this.subscribe,publish:this.publish,SelectedSet:this.SelectedSet,Interaction:this.Interaction}),this.subscribe("Interaction:end",function(){return i.continue=!1}),this.start()}return s(u,[{key:"_callbacksTemp",value:function(i){var g=i.callback,d=i.onDragMove,v=i.onDragStart,w=i.onDragStartBegin,x=i.onElementSelect,E=i.onElementUnselect,V=function(A,I){return console.warn("[DragSelect] ".concat(A,' is deprecated. Use DragSelect.subscribe("').concat(I,'", (callbackObject) => {}) instead. Act Now! See docs for more info'))};g&&(V("callback","callback"),this.subscribe("callback",function(N){var A=N.items;N.item;var I=N.event;return g(A,I)})),d&&(V("onDragMove","dragmove"),this.subscribe("dragmove",function(N){N.items,N.item;var A=N.event;return d(A)})),v&&(V("onDragStart","dragstart"),this.subscribe("dragstart",function(N){N.items,N.item;var A=N.event;return v(A)})),w&&(V("onDragStartBegin","dragstart"),this.subscribe("dragstart",function(N){N.items,N.item;var A=N.event;return w(A)})),x&&(V("onElementSelect","elementselect"),this.subscribe("elementselect",function(N){N.items;var A=N.item,I=N.event;return x(A,I)})),E&&(V("onElementUnselect","elementunselect"),this.subscribe("elementunselect",function(N){N.items;var A=N.item,I=N.event;return E(A,I)}))}},{key:"stop",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;d&&this.publish("callback",{items:this.getSelection()}),this.Interaction.stop(),this.Area.stop(),this.Drag.stop(),this.Selector.stop(),this.SelectorArea.stop(i),this.stores.KeyStore.stop(),this.stores.PointerStore.stop(),this.stores.ScrollStore.stop(),i&&this.SelectableSet.clear(),g&&this.SelectedSet.clear(),this.stopped=!0}},{key:"addSelection",value:function(i){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.addAll(Ie(i)),d||this.addSelectables(i),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"removeSelection",value:function(i){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.SelectedSet.deleteAll(Ie(i)),d&&this.removeSelectables(i),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(i){var g=this,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Ie(i).forEach(function(w){return g.SelectedSet.has(w)?g.removeSelection(i,d,v):g.addSelection(i,d,v)}),d&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"setSelection",value:function(i){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.clearSelection(),this.addSelection(i,g,d),this.getSelection()}},{key:"clearSelection",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.SelectedSet.clear(),i&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"addSelectables",value:function(i){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=Ie(i);return this.SelectableSet.addAll(d),g&&this.SelectedSet.addAll(d),i}},{key:"setSelectables",value:function(i){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this.removeSelectables(i,g),this.addSelectables(i,d)}},{key:"removeSelectables",value:function(i){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.SelectableSet.deleteAll(Ie(i)),g&&this.removeSelection(i),i}},{key:"getCursorPositionDifference",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;console.warn("[DragSelect] Using .getCursorPositionDifference is deprecated. Calculate yourself instead. i.e. `.getCurrentCursorPosition().x - .getInitialCursorPosition().x`");var d=g?this.getCurrentCursorPositionArea():this.getCurrentCursorPosition(),v=i?g?this.getPreviousCursorPositionArea():this.getPreviousCursorPosition():g?this.getInitialCursorPositionArea():this.getInitialCursorPosition();return C(d,"-",v)}}]),u}();return Qd})})(Zt);const fn=Zt.exports,Qt=(r,t,o,n,s)=>(t=Math,o=t.log,n=1024,s=o(r)/o(n)|0,r/t.pow(n,s)).toFixed(0)+" "+(s?"KMGTPEZY"[--s]+"iB":"B"),er=(r,t=null)=>{var o;return new Date(r*1e3).toLocaleString((o=t!=null?t:navigator.language)!=null?o:"en-US")},pn={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},gn=[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)],yn={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},bn=[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)],tt=Object.assign({name:"VFSortIcon"},{props:{direction:String},setup(r){return(t,o)=>(e.openBlock(),e.createElementBlock("div",null,[r.direction=="down"?(e.openBlock(),e.createElementBlock("svg",pn,gn)):e.createCommentVNode("",!0),r.direction=="up"?(e.openBlock(),e.createElementBlock("svg",yn,bn)):e.createCommentVNode("",!0)]))}}),vn=["onClick"],wn=Object.assign({name:"VFToast.vue"},{setup(r){const t=e.inject("emitter"),{getStore:o}=e.inject("storage"),n=e.ref(o("full-screen",!1)),s=p=>p=="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",a=e.ref([]),l=p=>{a.value.splice(p,1)},m=p=>{let f=a.value.findIndex(h=>h.id===p);f!==-1&&l(f)};return t.on("vf-toast-clear",()=>{a.value=[]}),t.on("vf-toast-push",p=>{let f=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");p.id=f,a.value.push(p),setTimeout(()=>{m(f)},5e3)}),(p,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([n.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(a.value,(h,y)=>(e.openBlock(),e.createElementBlock("div",{onClick:b=>l(y),key:h,class:e.normalizeClass([s(h.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(h.label),11,vn))),128))]),_:1})],2))}}),ke=r=>Object.entries(r).map(t=>t.map(encodeURIComponent).join("=")).join("&"),{apiUrl:_n}=le(),bt=(r,t)=>_n.value+"?"+ke({q:"preview",adapter:r,path:t}),pe=typeof window<"u",tr=pe&&!("onscroll"in window)||typeof navigator<"u"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),rr=pe&&"IntersectionObserver"in window,or=pe&&"classList"in document.createElement("p"),nr=pe&&window.devicePixelRatio>1,kn={elements_selector:".lazy",container:tr||pe?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},ar=r=>Object.assign({},kn,r),ir=function(r,t){let o;const n="LazyLoad::Initialized",s=new r(t);try{o=new CustomEvent(n,{detail:{instance:s}})}catch{o=document.createEvent("CustomEvent"),o.initCustomEvent(n,!1,!1,{instance:s})}window.dispatchEvent(o)},xn=(r,t)=>{if(!!t)if(!t.length)ir(r,t);else for(let o=0,n;n=t[o];o+=1)ir(r,n)},fe="src",vt="srcset",wt="sizes",sr="poster",ze="llOriginalAttrs",lr="data",_t="loading",cr="loaded",dr="applied",Sn="entered",kt="error",hr="native",ur="data-",mr="ll-status",te=(r,t)=>r.getAttribute(ur+t),En=(r,t,o)=>{var n=ur+t;if(o===null){r.removeAttribute(n);return}r.setAttribute(n,o)},Re=r=>te(r,mr),xe=(r,t)=>En(r,mr,t),rt=r=>xe(r,null),xt=r=>Re(r)===null,Dn=r=>Re(r)===_t,Nn=r=>Re(r)===kt,St=r=>Re(r)===hr,Cn=[_t,cr,dr,kt],Vn=r=>Cn.indexOf(Re(r))>=0,ge=(r,t,o,n)=>{if(!!r){if(n!==void 0){r(t,o,n);return}if(o!==void 0){r(t,o);return}r(t)}},Ce=(r,t)=>{if(or){r.classList.add(t);return}r.className+=(r.className?" ":"")+t},ce=(r,t)=>{if(or){r.classList.remove(t);return}r.className=r.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},$n=r=>{r.llTempImage=document.createElement("IMG")},Mn=r=>{delete r.llTempImage},fr=r=>r.llTempImage,ot=(r,t)=>{if(!t)return;const o=t._observer;!o||o.unobserve(r)},Bn=r=>{r.disconnect()},Tn=(r,t,o)=>{t.unobserve_entered&&ot(r,o)},Et=(r,t)=>{!r||(r.loadingCount+=t)},An=r=>{!r||(r.toLoadCount-=1)},pr=(r,t)=>{!r||(r.toLoadCount=t)},On=r=>r.loadingCount>0,Ln=r=>r.toLoadCount>0,gr=r=>{let t=[];for(let o=0,n;n=r.children[o];o+=1)n.tagName==="SOURCE"&&t.push(n);return t},Dt=(r,t)=>{const o=r.parentNode;if(!o||o.tagName!=="PICTURE")return;gr(o).forEach(t)},yr=(r,t)=>{gr(r).forEach(t)},nt=[fe],br=[fe,sr],He=[fe,vt,wt],vr=[lr],at=r=>!!r[ze],wr=r=>r[ze],_r=r=>delete r[ze],Ve=(r,t)=>{if(at(r))return;const o={};t.forEach(n=>{o[n]=r.getAttribute(n)}),r[ze]=o},In=r=>{at(r)||(r[ze]={backgroundImage:r.style.backgroundImage})},jn=(r,t,o)=>{if(!o){r.removeAttribute(t);return}r.setAttribute(t,o)},Se=(r,t)=>{if(!at(r))return;const o=wr(r);t.forEach(n=>{jn(r,n,o[n])})},Pn=r=>{if(!at(r))return;const t=wr(r);r.style.backgroundImage=t.backgroundImage},kr=(r,t,o)=>{Ce(r,t.class_applied),xe(r,dr),o&&(t.unobserve_completed&&ot(r,t),ge(t.callback_applied,r,o))},xr=(r,t,o)=>{Ce(r,t.class_loading),xe(r,_t),o&&(Et(o,1),ge(t.callback_loading,r,o))},ye=(r,t,o)=>{!o||r.setAttribute(t,o)},Sr=(r,t)=>{ye(r,wt,te(r,t.data_sizes)),ye(r,vt,te(r,t.data_srcset)),ye(r,fe,te(r,t.data_src))},zn=(r,t)=>{Dt(r,o=>{Ve(o,He),Sr(o,t)}),Ve(r,He),Sr(r,t)},Rn=(r,t)=>{Ve(r,nt),ye(r,fe,te(r,t.data_src))},Hn=(r,t)=>{yr(r,o=>{Ve(o,nt),ye(o,fe,te(o,t.data_src))}),Ve(r,br),ye(r,sr,te(r,t.data_poster)),ye(r,fe,te(r,t.data_src)),r.load()},Fn=(r,t)=>{Ve(r,vr),ye(r,lr,te(r,t.data_src))},Un=(r,t,o)=>{const n=te(r,t.data_bg),s=te(r,t.data_bg_hidpi),a=nr&&s?s:n;!a||(r.style.backgroundImage=`url("${a}")`,fr(r).setAttribute(fe,a),xr(r,t,o))},Kn=(r,t,o)=>{const n=te(r,t.data_bg_multi),s=te(r,t.data_bg_multi_hidpi),a=nr&&s?s:n;!a||(r.style.backgroundImage=a,kr(r,t,o))},Yn=(r,t,o)=>{const n=te(r,t.data_bg_set);if(!n)return;const s=n.split("|");let a=s.map(l=>`image-set(${l})`);r.style.backgroundImage=a.join(),r.style.backgroundImage===""&&(a=s.map(l=>`-webkit-image-set(${l})`),r.style.backgroundImage=a.join()),kr(r,t,o)},Er={IMG:zn,IFRAME:Rn,VIDEO:Hn,OBJECT:Fn},Wn=(r,t)=>{const o=Er[r.tagName];!o||o(r,t)},Xn=(r,t,o)=>{const n=Er[r.tagName];!n||(n(r,t),xr(r,t,o))},qn=["IMG","IFRAME","VIDEO","OBJECT"],Gn=r=>qn.indexOf(r.tagName)>-1,Dr=(r,t)=>{t&&!On(t)&&!Ln(t)&&ge(r.callback_finish,t)},Nr=(r,t,o)=>{r.addEventListener(t,o),r.llEvLisnrs[t]=o},Jn=(r,t,o)=>{r.removeEventListener(t,o)},Nt=r=>!!r.llEvLisnrs,Zn=(r,t,o)=>{Nt(r)||(r.llEvLisnrs={});const n=r.tagName==="VIDEO"?"loadeddata":"load";Nr(r,n,t),Nr(r,"error",o)},Ct=r=>{if(!Nt(r))return;const t=r.llEvLisnrs;for(let o in t){const n=t[o];Jn(r,o,n)}delete r.llEvLisnrs},Cr=(r,t,o)=>{Mn(r),Et(o,-1),An(o),ce(r,t.class_loading),t.unobserve_completed&&ot(r,o)},Qn=(r,t,o,n)=>{const s=St(t);Cr(t,o,n),Ce(t,o.class_loaded),xe(t,cr),ge(o.callback_loaded,t,n),s||Dr(o,n)},ea=(r,t,o,n)=>{const s=St(t);Cr(t,o,n),Ce(t,o.class_error),xe(t,kt),ge(o.callback_error,t,n),o.restore_on_error&&Se(t,He),s||Dr(o,n)},Vt=(r,t,o)=>{const n=fr(r)||r;if(Nt(n))return;Zn(n,l=>{Qn(l,r,t,o),Ct(n)},l=>{ea(l,r,t,o),Ct(n)})},ta=(r,t,o)=>{$n(r),Vt(r,t,o),In(r),Un(r,t,o),Kn(r,t,o),Yn(r,t,o)},ra=(r,t,o)=>{Vt(r,t,o),Xn(r,t,o)},$t=(r,t,o)=>{Gn(r)?ra(r,t,o):ta(r,t,o)},oa=(r,t,o)=>{r.setAttribute("loading","lazy"),Vt(r,t,o),Wn(r,t),xe(r,hr)},Vr=r=>{r.removeAttribute(fe),r.removeAttribute(vt),r.removeAttribute(wt)},na=r=>{Dt(r,t=>{Vr(t)}),Vr(r)},$r=r=>{Dt(r,t=>{Se(t,He)}),Se(r,He)},aa={IMG:$r,IFRAME:r=>{Se(r,nt)},VIDEO:r=>{yr(r,t=>{Se(t,nt)}),Se(r,br),r.load()},OBJECT:r=>{Se(r,vr)}},ia=r=>{const t=aa[r.tagName];if(!t){Pn(r);return}t(r)},sa=(r,t)=>{xt(r)||St(r)||(ce(r,t.class_entered),ce(r,t.class_exited),ce(r,t.class_applied),ce(r,t.class_loading),ce(r,t.class_loaded),ce(r,t.class_error))},la=(r,t)=>{ia(r),sa(r,t),rt(r),_r(r)},ca=(r,t,o,n)=>{!o.cancel_on_exit||!Dn(r)||r.tagName==="IMG"&&(Ct(r),na(r),$r(r),ce(r,o.class_loading),Et(n,-1),rt(r),ge(o.callback_cancel,r,t,n))},da=(r,t,o,n)=>{const s=Vn(r);xe(r,Sn),Ce(r,o.class_entered),ce(r,o.class_exited),Tn(r,o,n),ge(o.callback_enter,r,t,n),!s&&$t(r,o,n)},ha=(r,t,o,n)=>{xt(r)||(Ce(r,o.class_exited),ca(r,t,o,n),ge(o.callback_exit,r,t,n))},ua=["IMG","IFRAME","VIDEO"],Mr=r=>r.use_native&&"loading"in HTMLImageElement.prototype,ma=(r,t,o)=>{r.forEach(n=>{ua.indexOf(n.tagName)!==-1&&oa(n,t,o)}),pr(o,0)},fa=r=>r.isIntersecting||r.intersectionRatio>0,pa=r=>({root:r.container===document?null:r.container,rootMargin:r.thresholds||r.threshold+"px"}),ga=(r,t,o)=>{r.forEach(n=>fa(n)?da(n.target,n,t,o):ha(n.target,n,t,o))},ya=(r,t)=>{t.forEach(o=>{r.observe(o)})},ba=(r,t)=>{Bn(r),ya(r,t)},va=(r,t)=>{!rr||Mr(r)||(t._observer=new IntersectionObserver(o=>{ga(o,r,t)},pa(r)))},Br=r=>Array.prototype.slice.call(r),it=r=>r.container.querySelectorAll(r.elements_selector),wa=r=>Br(r).filter(xt),_a=r=>Nn(r),ka=r=>Br(r).filter(_a),Tr=(r,t)=>wa(r||it(t)),xa=(r,t)=>{ka(it(r)).forEach(n=>{ce(n,r.class_error),rt(n)}),t.update()},Sa=(r,t)=>{!pe||(t._onlineHandler=()=>{xa(r,t)},window.addEventListener("online",t._onlineHandler))},Ea=r=>{!pe||window.removeEventListener("online",r._onlineHandler)},Fe=function(r,t){const o=ar(r);this._settings=o,this.loadingCount=0,va(o,this),Sa(o,this),this.update(t)};Fe.prototype={update:function(r){const t=this._settings,o=Tr(r,t);if(pr(this,o.length),tr||!rr){this.loadAll(o);return}if(Mr(t)){ma(o,t,this);return}ba(this._observer,o)},destroy:function(){this._observer&&this._observer.disconnect(),Ea(this),it(this._settings).forEach(r=>{_r(r)}),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(r){const t=this._settings;Tr(r,t).forEach(n=>{ot(n,this),$t(n,t,this)})},restoreAll:function(){const r=this._settings;it(r).forEach(t=>{la(t,r)})}},Fe.load=(r,t)=>{const o=ar(t);$t(r,o)},Fe.resetStatus=r=>{rt(r)},pe&&xn(Fe,window.lazyLoadOptions);const Da={class:"relative flex-auto flex flex-col overflow-hidden"},Na={key:0,class:"grid grid-cols-12 border-b border-neutral-300 border-gray-200 dark:border-gray-700 text-xs select-none"},Ca={class:"absolute"},Va=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),$a={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"},Ma=["onDblclick","onContextmenu","data-type","data-item","data-index"],Ba={class:"grid grid-cols-12 items-center"},Ta={class:"flex col-span-7 items-center"},Aa={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"},Oa=[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)],La={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"},Ia=[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)],ja={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Pa={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},za=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],Ra={class:"grid grid-cols-12 items-center"},Ha={class:"flex col-span-7 items-center"},Fa={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"},Ua=[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)],Ka={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)],Wa={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Xa={class:"col-span-2 text-center"},qa={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap"},Ga=["onDblclick","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],Ja={class:"relative"},Za={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"},Qa=[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)],ei=["data-src","alt"],ti={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"},ri=[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)],oi={key:3,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},ni={class:"break-all"},ai=Object.assign({name:"VFExplorer"},{props:{view:String,data:Object,search:Object},setup(r){const t=r,o=e.inject("emitter"),{setStore:n,getStore:s}=e.inject("storage"),a=M=>M==null?void 0:M.substring(0,3),l=M=>M.replace(/((?=([\w\W]{0,14}))([\w\W]{8,})([\w\W]{8,}))/,"$2..$4"),m=e.ref(null),p=e.ref(null),f=e.ref(0),h=e.ref(null),{t:y}=e.inject("i18n"),b=Math.floor(Math.random()*2**32),D=e.ref(s("full-screen",!1)),_=new Fe;o.on("vf-fullscreen-toggle",()=>{D.value=!D.value,n("full-screen",D.value)});const k=e.ref("");o.on("vf-search-query",({newQuery:M})=>{k.value=M,M?o.emit("vf-fetch",{params:{q:"search",adapter:t.data.adapter,path:t.data.dirname,filter:M},onSuccess:O=>{O.files.length||o.emit("vf-toast-push",{label:y("No search result found.")})}}):o.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:t.data.dirname}})});let $=null;const P=()=>{$&&clearTimeout($)},L=M=>{$=setTimeout(()=>{const O=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!1,view:window,button:2,buttons:0,clientX:M.target.getBoundingClientRect().x,clientY:M.target.getBoundingClientRect().y});M.target.dispatchEvent(O)},500)},B=M=>{M.type=="dir"?(o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.data.adapter,path:M.path}})):o.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:M})},T=e.reactive({active:!1,column:"",order:""}),R=(M=!0)=>{let O=[...t.data.files],C=T.column,H=T.order=="asc"?1:-1;if(!M)return O;const F=(Q,W)=>typeof Q=="string"&&typeof W=="string"?Q.toLowerCase().localeCompare(W.toLowerCase()):QW?1:0;return T.active&&(O=O.slice().sort((Q,W)=>F(Q[C],W[C])*H)),O},S=M=>{T.active&&T.column==M?(T.active=T.order=="asc",T.column=M,T.order="desc"):(T.active=!0,T.column=M,T.order="asc")},j=()=>h.value.getSelection().map(M=>JSON.parse(M.dataset.item)),Y=(M,O)=>{if(M.altKey||M.ctrlKey||M.metaKey)return M.preventDefault(),!1;M.dataTransfer.setDragImage(p.value,0,15),M.dataTransfer.effectAllowed="all",M.dataTransfer.dropEffect="copy",M.dataTransfer.setData("items",JSON.stringify(j()))},Z=(M,O)=>{M.preventDefault();let C=JSON.parse(M.dataTransfer.getData("items"));if(C.find(H=>H.storage!=s("adapter","local"))){alert("Moving items between different storages is not supported yet.");return}o.emit("vf-modal-show",{type:"move",items:{from:C,to:O}})},ee=(M,O)=>{M.preventDefault(),!O||O.type!=="dir"||h.value.getSelection().find(C=>C==M.currentTarget)?(M.dataTransfer.dropEffect="none",M.dataTransfer.effectAllowed="none"):M.dataTransfer.dropEffect="copy"},ne=()=>{h.value=new fn({area:m.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),o.on("vf-explorer-update",()=>e.nextTick(()=>{h.value.clearSelection(),h.value.setSelectables(document.getElementsByClassName("vf-item-"+b))})),h.value.subscribe("predragstart",({event:M,isDragging:O})=>{if(O)f.value=h.value.getSelection().length,h.value.break();else{const C=M.target.offsetWidth-M.offsetX,H=M.target.offsetHeight-M.offsetY;C<15&&H<15&&(h.value.clearSelection(),h.value.break())}}),h.value.subscribe("predragmove",({isDragging:M})=>{M&&h.value.break()}),h.value.subscribe("callback",({items:M,event:O,isDragging:C})=>{o.emit("vf-nodes-selected",j()),f.value=h.value.getSelection().length})};return e.onMounted(ne),e.onUpdated(()=>{h.value.Area.reset(),h.value.SelectorArea.updatePos(),_.update()}),e.onMounted(()=>{e.watch(()=>t.view,()=>o.emit("vf-explorer-update"))}),(M,O)=>(e.openBlock(),e.createElementBlock("div",Da,[r.view=="list"||k.value.length?(e.openBlock(),e.createElementBlock("div",Na,[e.createElementVNode("div",{onClick:O[0]||(O[0]=C=>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(y)("Name"))+" ",1),e.withDirectives(e.createVNode(tt,{direction:T.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,T.active&&T.column=="basename"]])]),k.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:O[1]||(O[1]=C=>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(y)("Size"))+" ",1),e.withDirectives(e.createVNode(tt,{direction:T.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,T.active&&T.column=="file_size"]])])),k.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:O[2]||(O[2]=C=>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(y)("Date"))+" ",1),e.withDirectives(e.createVNode(tt,{direction:T.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,T.active&&T.column=="last_modified"]])])),k.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:O[3]||(O[3]=C=>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(y)("Filepath"))+" ",1),e.withDirectives(e.createVNode(tt,{direction:T.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,T.active&&T.column=="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ca,[e.createElementVNode("div",{ref_key:"dragImage",ref:p,class:"absolute -z-50 -top-96"},[Va,e.createElementVNode("div",$a,e.toDisplayString(f.value),1)],512)]),e.createElementVNode("div",{onContextmenu:O[10]||(O[10]=e.withModifiers(C=>e.unref(o).emit("vf-contextmenu-show",{event:C,area:m.value,items:j()}),["self","prevent"])),class:e.normalizeClass([D.value?"":"resize-y","h-full w-full text-xs vf-selector-area min-h-[150px] overflow-auto p-1 z-0"]),ref_key:"selectorArea",ref:m},[k.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(R(),(C,H)=>(e.openBlock(),e.createElementBlock("div",{onDblclick:F=>B(C),onTouchstart:O[4]||(O[4]=F=>L(F)),onTouchend:O[5]||(O[5]=F=>P()),onContextmenu:e.withModifiers(F=>e.unref(o).emit("vf-contextmenu-show",{event:F,area:m.value,items:j(),target:C}),["prevent"]),class:e.normalizeClass(["vf-item-"+e.unref(b),"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":C.type,"data-item":JSON.stringify(C),"data-index":H},[e.createElementVNode("div",Ba,[e.createElementVNode("div",Ta,[C.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Aa,Oa)):(e.openBlock(),e.createElementBlock("svg",La,Ia)),e.createElementVNode("span",ja,e.toDisplayString(C.basename),1)]),e.createElementVNode("div",Pa,e.toDisplayString(C.path),1)])],42,Ma))),256)):e.createCommentVNode("",!0),r.view=="list"&&!k.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(R(),(C,H)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:F=>B(C),onTouchstart:O[6]||(O[6]=F=>L(F)),onTouchend:O[7]||(O[7]=F=>P()),onContextmenu:e.withModifiers(F=>e.unref(o).emit("vf-contextmenu-show",{event:F,area:m.value,items:j(),target:C}),["prevent"]),onDragstart:F=>Y(F),onDragover:F=>ee(F,C),onDrop:F=>Z(F,C),class:e.normalizeClass(["vf-item-"+e.unref(b),"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":C.type,"data-item":JSON.stringify(C),"data-index":H},[e.createElementVNode("div",Ra,[e.createElementVNode("div",Ha,[C.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Fa,Ua)):(e.openBlock(),e.createElementBlock("svg",Ka,Ya)),e.createElementVNode("span",Wa,e.toDisplayString(C.basename),1)]),e.createElementVNode("div",Xa,e.toDisplayString(C.file_size?e.unref(Qt)(C.file_size):""),1),e.createElementVNode("div",qa,e.toDisplayString(e.unref(er)(C.last_modified)),1)])],42,za))),256)):e.createCommentVNode("",!0),r.view=="grid"&&!k.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(R(!1),(C,H)=>{var F,Q;return e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:W=>B(C),onTouchstart:O[8]||(O[8]=W=>L(W)),onTouchend:O[9]||(O[9]=W=>P()),onContextmenu:e.withModifiers(W=>e.unref(o).emit("vf-contextmenu-show",{event:W,area:m.value,items:j(),target:C}),["prevent"]),onDragstart:W=>Y(W),onDragover:W=>ee(W,C),onDrop:W=>Z(W,C),class:e.normalizeClass(["vf-item-"+e.unref(b),"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":C.type,"data-item":JSON.stringify(C),"data-index":H},[e.createElementVNode("div",null,[e.createElementVNode("div",Ja,[C.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Za,Qa)):((F=C.mime_type)!=null?F:"").startsWith("image")?(e.openBlock(),e.createElementBlock("img",{key:1,class:"lazy h-10 md:h-12 m-auto","data-src":e.unref(bt)(e.unref(s)("adapter",t.data.adapter),C.path),alt:C.basename},null,8,ei)):(e.openBlock(),e.createElementBlock("svg",ti,ri)),!((Q=C.mime_type)!=null?Q:"").startsWith("image")&&C.type!="dir"?(e.openBlock(),e.createElementBlock("div",oi,e.toDisplayString(a(C.extension)),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",ni,e.toDisplayString(l(C.basename)),1)])],42,Ga)}),256)):e.createCommentVNode("",!0)],34),e.createVNode(wn)]))}}),ii="1.1.13",si={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},li={class:"flex leading-5 items-center"},ci=["aria-label"],di=[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)],hi=["value"],ui={class:"ml-3"},mi={key:0},fi={class:"ml-1"},pi={class:"flex leading-5 items-center"},gi={value:"",disabled:""},yi=e.createElementVNode("option",{value:"en"},"English",-1),bi=e.createElementVNode("option",{value:"fr"},"French",-1),vi=e.createElementVNode("option",{value:"ru"},"Russian",-1),wi=e.createElementVNode("option",{value:"tr"},"Turkish",-1),_i=["aria-label"],ki=[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)],xi=Object.assign({name:"VFStatusbar"},{props:{data:Object},setup(r){var b;const t=r,o=e.inject("emitter"),{getStore:n,setStore:s}=e.inject("storage"),a=e.ref(0),l=e.ref((b=n("adapter"))!=null?b:t.data.adapter),{t:m,changeLocale:p}=e.inject("i18n"),f=e.ref(n("locale","")),h=()=>{o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:l.value}}),s("adapter",l.value)};o.on("vf-nodes-selected",D=>{a.value=D.length});const y=e.ref("");return o.on("vf-search-query",({newQuery:D})=>{y.value=D}),(D,_)=>(e.openBlock(),e.createElementBlock("div",si,[e.createElementVNode("div",li,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(m)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},di,8,ci),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":_[0]||(_[0]=k=>l.value=k),onChange:h,class:"py-0.5 text-sm text-slate-500 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.data.storages,k=>(e.openBlock(),e.createElementBlock("option",{value:k},e.toDisplayString(k),9,hi))),256))],544),[[e.vModelSelect,l.value]]),e.createElementVNode("div",ui,[y.value.length?(e.openBlock(),e.createElementBlock("span",mi,e.toDisplayString(r.data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",fi,e.toDisplayString(a.value>0?a.value+" "+e.unref(m)("item(s) selected."):""),1)])]),e.createElementVNode("div",pi,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":_[1]||(_[1]=k=>f.value=k),onChange:_[2]||(_[2]=k=>e.unref(p)(k.target.value)),class:"py-0.5 text-sm text-slate-500 dark:text-neutral-50 dark:bg-gray-700 rounded pl-2 pr-8 mr-3"},[e.createElementVNode("option",gi,e.toDisplayString(e.unref(m)("Language")),1),yi,bi,vi,wi],544),[[e.vModelSelect,f.value]]),e.createElementVNode("span",{class:"mr-1","aria-label":e.unref(m)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:_[3]||(_[3]=k=>e.unref(o).emit("vf-modal-show",{type:"message",title:"Vuefinder "+e.unref(ii),message:e.unref(m)("Vuefinder is a file manager component for vue 3.")}))},ki,8,_i)])]))}}),Si=(r,t=0,o=!1)=>{let n;return(...s)=>{o&&!n&&r(...s),clearTimeout(n),n=setTimeout(()=>{r(...s)},t)}},Ei=(r,t,o)=>{const n=e.ref(r);return e.customRef((a,l)=>({get(){return a(),n.value},set:Si(m=>{n.value=m,l()},t,o)}))},Di={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-xs"},Ni=["aria-label"],Ci=[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)],Vi=["aria-label"],$i=[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)],Mi={key:1,"aria-label":"Cancel","data-microtip-position":"bottom-right",role:"tooltip"},Bi=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],Ti=["onClick"],Ai=[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)],Oi={class:"flex leading-5"},Li=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),Ii=["title","onClick"],ji={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"},Pi=[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),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)],zi={key:3,class:"flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full"},Ri=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),Hi=["onKeydown","placeholder"],Fi=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],Ui=Object.assign({name:"VFBreadcrumb"},{props:{data:Object},setup(r){const t=r,o=e.inject("emitter"),{getStore:n}=e.inject("storage"),s=e.ref(null),a=e.ref([]),l=e.ref(!1),m=e.ref(null),{t:p}=e.inject("i18n"),f=e.inject("loadingState");o.on("vf-explorer-update",()=>{var T;let L=[],B=[];s.value=(T=t.data.dirname)!=null?T:n("adapter","local")+"://",s.value.length==0&&(a.value=[]),s.value.replace(n("adapter","local")+"://","").split("/").forEach(function(R){L.push(R),L.join("/")!=""&&B.push({basename:R,name:R,path:n("adapter","local")+"://"+L.join("/"),type:"dir"})}),B.length>4&&(B=B.slice(-5),B[0].name=".."),a.value=B});const h=()=>{l.value=!1,b.value=""};o.on("vf-search-exit",()=>{h()});const y=()=>{l.value=!0,e.nextTick(()=>m.value.focus())},b=Ei("",400),D=()=>f.value;e.watch(b,L=>{o.emit("vf-toast-clear"),o.emit("vf-search-query",{newQuery:L})});const _=()=>a.value.length&&!l.value,k=L=>{var T;L.preventDefault();let B=JSON.parse(L.dataTransfer.getData("items"));if(B.find(R=>R.storage!=n("adapter","local"))){alert("Moving items between different storages is not supported yet.");return}o.emit("vf-modal-show",{type:"move",items:{from:B,to:(T=a.value[a.value.length-2])!=null?T:{path:n("adapter","local")+"://"}}})},$=L=>{L.preventDefault(),_()?L.dataTransfer.dropEffect="copy":(L.dataTransfer.dropEffect="none",L.dataTransfer.effectAllowed="none")},P=()=>{b.value==""&&h()};return(L,B)=>(e.openBlock(),e.createElementBlock("div",Di,[e.createElementVNode("span",{"aria-label":e.unref(p)("Go up a directory"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onDragover:B[0]||(B[0]=T=>$(T)),onDrop:B[1]||(B[1]=T=>k(T)),onClick:B[2]||(B[2]=T=>{var R,S;return!_()||e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:r.data.adapter,path:(S=(R=a.value[a.value.length-2])==null?void 0:R.path)!=null?S:e.unref(n)("adapter","local")+"://"}})}),class:e.normalizeClass(["h-6 w-6 p-0.5 rounded",_()?"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"},Ci,34))],8,Ni),D()?(e.openBlock(),e.createElementBlock("span",Mi,[(e.openBlock(),e.createElementBlock("svg",{onClick:B[4]||(B[4]=T=>e.unref(o).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"},Bi))])):(e.openBlock(),e.createElementBlock("span",{key:0,"aria-label":e.unref(p)("Refresh"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onClick:B[3]||(B[3]=T=>{e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:r.data.adapter,path:r.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"},$i))],8,Vi)),l.value?(e.openBlock(),e.createElementBlock("div",zi,[Ri,e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:m,onKeydown:e.withKeys(h,["esc"]),onBlur:P,"onUpdate:modelValue":B[6]||(B[6]=T=>e.isRef(b)?b.value=T:null),placeholder:e.unref(p)("Search anything.."),class:"py-0 px-2 w-full border-0 ring-0 outline-0 text-sm 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,Hi),[[e.vModelText,e.unref(b)]]),(e.openBlock(),e.createElementBlock("svg",{class:"w-6 h-6 cursor-pointer",onClick:h,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Fi))])):(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(y,["self"])},[(e.openBlock(),e.createElementBlock("svg",{onClick:B[5]||(B[5]=T=>e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:r.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"},Ai)),e.createElementVNode("div",Oi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(T,R)=>(e.openBlock(),e.createElementBlock("div",{key:R},[Li,e.createElementVNode("span",{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:T.basename,onClick:S=>e.unref(o).emit("vf-fetch",{params:{q:"index",adapter:r.data.adapter,path:T.path}})},e.toDisplayString(T.name),9,Ii)]))),128))]),D()?(e.openBlock(),e.createElementBlock("svg",ji,Pi)):e.createCommentVNode("",!0)],8,Ti))]))}}),Ki=["onClick"],Yi=e.createElementVNode("span",{class:"px-1"},null,-1),Wi=Object.assign({name:"VFContextMenu"},{props:{current:Object},setup(r){const t=r,o=e.inject("emitter"),n=e.ref(null),{apiUrl:s}=le(),a=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),l=e.ref([]);o.on("vf-context-selected",b=>{l.value=b});const{t:m}=e.inject("i18n"),p={newfolder:{title:()=>m("New Folder"),action:()=>{o.emit("vf-modal-show",{type:"new-folder"})}},delete:{title:()=>m("Delete"),action:()=>{o.emit("vf-modal-show",{type:"delete",items:l})}},refresh:{title:()=>m("Refresh"),action:()=>{o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:t.current.dirname}})}},preview:{title:()=>m("Preview"),action:()=>{o.emit("vf-modal-show",{type:"preview",adapter:t.current.adapter,item:l.value[0]})}},open:{title:()=>m("Open"),action:()=>{o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:l.value[0].path}})}},openDir:{title:()=>m("Open containing folder"),action:()=>{o.emit("vf-search-exit"),o.emit("vf-fetch",{params:{q:"index",adapter:t.current.adapter,path:l.value[0].dir}})}},download:{title:()=>m("Download"),action:()=>{const b=s.value+"?"+ke({q:"download",adapter:t.current.adapter,path:l.value[0].path});o.emit("vf-download",b)}},archive:{title:()=>m("Archive"),action:()=>{o.emit("vf-modal-show",{type:"archive",items:l})}},unarchive:{title:()=>m("Unarchive"),action:()=>{o.emit("vf-modal-show",{type:"unarchive",items:l})}},rename:{title:()=>m("Rename"),action:()=>{o.emit("vf-modal-show",{type:"rename",items:l})}}},f=b=>{o.emit("vf-contextmenu-hide"),b.action()},h=e.ref("");o.on("vf-search-query",({newQuery:b})=>{h.value=b}),o.on("vf-contextmenu-show",({event:b,area:D,items:_,target:k=null})=>{if(a.items=[],h.value)if(k)a.items.push(p.openDir),o.emit("vf-context-selected",[k]);else return;else!k&&!h.value?(a.items.push(p.refresh),a.items.push(p.newfolder),o.emit("vf-context-selected",[])):_.length>1&&_.some($=>$.path===k.path)?(a.items.push(p.refresh),a.items.push(p.archive),a.items.push(p.delete),o.emit("vf-context-selected",_)):(k.type=="dir"?a.items.push(p.open):(a.items.push(p.preview),a.items.push(p.download)),a.items.push(p.rename),k.mime_type=="application/zip"?a.items.push(p.unarchive):a.items.push(p.archive),a.items.push(p.delete),o.emit("vf-context-selected",[k]));y(b,D)}),o.on("vf-contextmenu-hide",()=>{a.active=!1});const y=(b,D)=>{a.active=!0,e.nextTick(()=>{let _=D.getBoundingClientRect(),k=b.pageX,$=b.pageY,P=n.value.offsetHeight,L=n.value.offsetWidth;k=_.right-b.pageX+window.scrollXa.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:n,style:e.normalizeStyle(a.positions)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.items,_=>(e.openBlock(),e.createElementBlock("li",{class:"px-2 py-1.5 cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",key:_.title,onClick:k=>f(_)},[Yi,e.createElementVNode("span",null,e.toDisplayString(_.title()),1)],8,Ki))),128))],4)):e.createCommentVNode("",!0)}}),Xi=(r,t)=>{const o=r[t];return o?typeof o=="function"?o():Promise.resolve(o):new Promise((n,s)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+t)))})};async function qi(r){const t=await Xi(Object.assign({"../locales/en.json":()=>Promise.resolve().then(()=>Dd),"../locales/ru.json":()=>Promise.resolve().then(()=>Nd),"../locales/tr.json":()=>Promise.resolve().then(()=>Cd)}),`../locales/${r}.json`);return JSON.parse(t.default)}function Gi(r,t,o){const{getStore:n,setStore:s}=yt(r),a=e.ref({}),l=f=>{qi(f).then(h=>{a.value=h,s("locale",f),s("translations",h),o.emit("vf-toast-push",{label:"The language is set to "+f})}).catch(h=>{o.emit("vf-toast-push",{label:"The selected locale is not yet supported!",type:"error"}),l("en")})};n("locale")?a.value=n("translations"):l(t);const m=(f,...h)=>h.length?m(f=f.replace("%s",h.shift()),...h):f;function p(f,...h){return a.value.hasOwnProperty(f)?m(a.value[f],...h):f}return{t:p,changeLocale:l}}const Ji={class:"vuefinder"},Zi=e.createElementVNode("iframe",{id:"download_frame",style:{display:"none"}},null,-1),Qi=Object.assign({name:"VueFinder"},{props:{url:{type:[String]},id:{type:String,default:"vf"},dark:{type:Boolean,default:!1},locale:{type:String,default:"en"},maxHeight:{type:String,default:"600px"},postData:{type:Object,default:{}}},setup(r){const t=r,o=To(),{setStore:n,getStore:s}=yt(t.id);e.provide("emitter",o),e.provide("storage",yt(t.id)),e.provide("postData",t.postData);const a=Gi(t.id,t.locale,o);e.provide("i18n",a);const{apiUrl:l,setApiUrl:m}=le();m(t.url);const p=e.reactive({adapter:"local",storages:[],dirname:".",files:[]}),f=e.ref(s("viewport","grid")),h=e.ref(s("darkMode",t.dark));o.on("vf-darkMode-toggle",()=>{h.value=!h.value,n("darkMode",h.value)});const y=e.ref(!1);e.provide("loadingState",y);const b=e.ref(s("full-screen",!1));o.on("vf-fullscreen-toggle",()=>{b.value=!b.value,n("full-screen",b.value)}),o.on("vf-view-toggle",$=>{f.value=$});const D=e.reactive({active:!1,type:"delete",data:{}});o.on("vf-modal-close",()=>{D.active=!1}),o.on("vf-modal-show",$=>{D.active=!0,D.type=$.type,D.data=$});const _=$=>{Object.assign(p,$),o.emit("vf-nodes-selected",{}),o.emit("vf-explorer-update")};let k;return o.on("vf-fetch-abort",()=>{k.abort(),y.value=!1}),o.on("vf-fetch",({params:$,onSuccess:P=null,onError:L=null})=>{["index","search"].includes($.q)&&(k&&k.abort(),y.value=!0),k=new AbortController;const B=k.signal;et(l.value,{params:$,signal:B}).then(T=>{["index","search"].includes($.q)&&(y.value=!1),o.emit("vf-modal-close"),_(T),P(T)}).catch(T=>{L&&L(T)}).finally(()=>{})}),o.on("vf-download",$=>{document.getElementById("download_frame").src=$,o.emit("vf-modal-close")}),e.onMounted(()=>{o.emit("vf-fetch",{params:{q:"index",adapter:s("adapter",p.adapter)}})}),($,P)=>(e.openBlock(),e.createElementBlock("div",Ji,[e.createElementVNode("div",{class:e.normalizeClass(h.value?"dark":"")},[e.createElementVNode("div",{class:e.normalizeClass([b.value?"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(b.value?"":"max-height: "+r.maxHeight),onMousedown:P[0]||(P[0]=L=>e.unref(o).emit("vf-contextmenu-hide")),onTouchstart:P[1]||(P[1]=L=>e.unref(o).emit("vf-contextmenu-hide"))},[e.createVNode(un,{data:p},null,8,["data"]),e.createVNode(Ui,{data:p},null,8,["data"]),e.createVNode(ai,{view:f.value,data:p},null,8,["view","data"]),e.createVNode(xi,{data:p},null,8,["data"])],38),D.active?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("v-f-modal-"+D.type),{key:0,selection:D.data,current:p},null,8,["selection","current"])):e.createCommentVNode("",!0),e.createVNode(Wi,{current:p},null,8,["current"]),Zi],2)]))}}),es=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),ts={class:"fixed z-10 inset-0 overflow-hidden"},rs={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"},os={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},ns={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"},de={__name:"ModalLayout",setup(r){const t=e.inject("emitter");return e.onMounted(()=>{const o=document.querySelector(".v-f-modal input");o&&o.focus()}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:"v-f-modal relative z-30","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",onKeyup:n[1]||(n[1]=e.withKeys(s=>e.unref(t).emit("vf-modal-close"),["esc"])),tabindex:"0"},[es,e.createElementVNode("div",ts,[e.createElementVNode("div",{class:"flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0",onMousedown:n[0]||(n[0]=e.withModifiers(s=>e.unref(t).emit("vf-modal-close"),["self"]))},[e.createElementVNode("div",rs,[e.createElementVNode("div",os,[e.renderSlot(o.$slots,"default")]),e.createElementVNode("div",ns,[e.renderSlot(o.$slots,"buttons")])])],32)])],32))}},as=["aria-label"],is=[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)],he=Object.assign({name:"Message"},{props:{error:{type:Boolean,default:!1}},emits:["hidden"],setup(r,{emit:t}){var m;const{t:o}=e.inject("i18n"),n=e.ref(!1),s=e.ref(null),a=e.ref((m=s.value)==null?void 0:m.strMessage);e.watch(a,()=>n.value=!1);const l=()=>{t("hidden"),n.value=!0};return(p,f)=>(e.openBlock(),e.createElementBlock("div",null,[n.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"strMessage",ref:s,class:e.normalizeClass(["flex mt-1 p-1 px-2 rounded text-sm",r.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:l,"aria-label":e.unref(o)("Close"),"data-microtip-position":"top-left",role:"tooltip"},is,8,as)],2))]))}}),ss={class:"sm:flex sm:items-start"},ls=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),cs={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ds={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},hs={class:"mt-2"},us={class:"text-sm text-gray-500"},ms={class:"flex text-sm text-gray-800 dark:text-gray-400"},fs={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"},ps=[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)],gs={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"},ys=[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)],bs={class:"ml-1.5"},vs={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},ws=Object.assign({name:"VFModalDelete"},{props:{selection:Object,current:Object},setup(r){const t=r,o=e.inject("emitter"),{getStore:n}=e.inject("storage"),{t:s}=e.inject("i18n"),a=e.ref(t.selection.items),l=e.ref(""),m=()=>{a.value.length&&o.emit("vf-fetch",{params:{q:"delete",adapter:n("adapter","local"),path:t.current.dirname,items:JSON.stringify(a.value.map(({path:p,type:f})=>({path:p,type:f})))},onSuccess:()=>{o.emit("vf-toast-push",{label:s("Files deleted.")})},onError:p=>{l.value=s(p.message)}})};return(p,f)=>(e.openBlock(),e.createBlock(de,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Yes, Delete!")),1),e.createElementVNode("button",{type:"button",onClick:f[1]||(f[1]=h=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Cancel")),1),e.createElementVNode("div",vs,e.toDisplayString(e.unref(s)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ss,[ls,e.createElementVNode("div",cs,[e.createElementVNode("h3",ds,e.toDisplayString(e.unref(s)("Delete files")),1),e.createElementVNode("div",hs,[e.createElementVNode("p",us,e.toDisplayString(e.unref(s)("Are you sure you want to delete these files?")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,h=>(e.openBlock(),e.createElementBlock("p",ms,[h.type=="dir"?(e.openBlock(),e.createElementBlock("svg",fs,ps)):(e.openBlock(),e.createElementBlock("svg",gs,ys)),e.createElementVNode("span",bs,e.toDisplayString(h.basename),1)]))),256)),l.value.length?(e.openBlock(),e.createBlock(he,{key:0,onHidden:f[0]||(f[0]=h=>l.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),_s={class:"sm:flex sm:items-start"},ks=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),xs={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ss={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Es={class:"mt-2"},Ds={class:"text-sm text-gray-500"},Ns=Object.assign({name:"VFModalMessage"},{props:{selection:Object},setup(r){const t=e.inject("emitter"),{t:o}=e.inject("i18n");return(n,s)=>(e.openBlock(),e.createBlock(de,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:s[0]||(s[0]=a=>e.unref(t).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(o)("Close")),1)]),default:e.withCtx(()=>{var a,l,m,p;return[e.createElementVNode("div",_s,[ks,e.createElementVNode("div",xs,[e.createElementVNode("h3",Ss,e.toDisplayString((l=(a=r.selection)==null?void 0:a.title)!=null?l:"Title"),1),e.createElementVNode("div",Es,[e.createElementVNode("p",Ds,e.toDisplayString((p=(m=r.selection)==null?void 0:m.message)!=null?p:"Message")+".",1)])])])]}),_:1}))}}),Cs={class:"sm:flex sm:items-start"},Vs=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),$s={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ms={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Bs={class:"mt-2"},Ts={class:"text-sm text-gray-500"},As=["onKeyup","placeholder"],Os=Object.assign({name:"VFModalNewFolder"},{props:{selection:Object,current:Object},setup(r){const t=r,o=e.inject("emitter"),{getStore:n}=e.inject("storage"),{t:s}=e.inject("i18n"),a=e.ref(""),l=e.ref(""),m=()=>{a.value!=""&&o.emit("vf-fetch",{params:{q:"newfolder",adapter:n("adapter","local"),path:t.current.dirname,name:a.value},onSuccess:()=>{o.emit("vf-toast-push",{label:s("%s is created.",a.value)})},onError:p=>{l.value=s(p.message)}})};return(p,f)=>(e.openBlock(),e.createBlock(de,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Create")),1),e.createElementVNode("button",{type:"button",onClick:f[2]||(f[2]=h=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},e.toDisplayString(e.unref(s)("Cancel")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Cs,[Vs,e.createElementVNode("div",$s,[e.createElementVNode("h3",Ms,e.toDisplayString(e.unref(s)("New Folder")),1),e.createElementVNode("div",Bs,[e.createElementVNode("p",Ts,e.toDisplayString(e.unref(s)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=h=>a.value=h),onKeyup:e.withKeys(m,["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(s)("Folder Name"),type:"text"},null,40,As),[[e.vModelText,a.value]]),l.value.length?(e.openBlock(),e.createBlock(he,{key:0,onHidden:f[1]||(f[1]=h=>l.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Ls={class:"sm:flex sm:items-start"},Is=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),js={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},Ps={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},zs={class:"mt-2"},Rs={class:"text-sm text-gray-500"},Hs=["onKeyup","placeholder"],Fs=Object.assign({name:"VFModalNewFile"},{props:{selection:Object,current:Object},setup(r){const t=r,o=e.inject("emitter"),{getStore:n}=e.inject("storage"),{t:s}=e.inject("i18n"),a=e.ref(""),l=e.ref(""),m=()=>{a.value!=""&&o.emit("vf-fetch",{params:{q:"newfile",adapter:n("adapter","local"),path:t.current.dirname,name:a.value},onSuccess:()=>{o.emit("vf-toast-push",{label:s("%s is created.",a.value)})},onError:p=>{l.value=s(p.message)}})};return(p,f)=>(e.openBlock(),e.createBlock(de,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:m,class:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 dark:bg-gray-700 dark:hover:bg-gray-600/75 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},"Create!"),e.createElementVNode("button",{type:"button",onClick:f[2]||(f[2]=h=>e.unref(o).emit("vf-modal-close")),class:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"},"Cancel")]),default:e.withCtx(()=>[e.createElementVNode("div",Ls,[Is,e.createElementVNode("div",js,[e.createElementVNode("h3",Ps,e.toDisplayString(e.unref(s)("New File")),1),e.createElementVNode("div",zs,[e.createElementVNode("p",Rs,e.toDisplayString(e.unref(s)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=h=>a.value=h),onKeyup:e.withKeys(m,["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(s)("File Name"),type:"text"},null,40,Hs),[[e.vModelText,a.value]]),l.value.length?(e.openBlock(),e.createBlock(he,{key:0,onHidden:f[1]||(f[1]=h=>l.value=""),error:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value),1)]),_:1})):e.createCommentVNode("",!0)])])])]),_:1}))}}),Us={class:"flex"},Ks=["aria-label"],Ys={class:"ml-auto mb-2"},Ws={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"},Xs={key:1},qs={__name:"Text",props:{selection:Object},emits:["load"],setup(r,{emit:t}){const o=r,n=e.ref(""),s=e.ref(""),a=e.ref(null),l=e.ref(!1),{apiUrl:m}=le(),p=e.ref(""),f=e.ref(!1),{t:h}=e.inject("i18n");e.onMounted(()=>{et(m.value,{params:{q:"preview",adapter:o.selection.adapter,path:o.selection.item.path},json:!1}).then(_=>{n.value=_,t("load")})});const y=()=>{l.value=!l.value,s.value=n.value,l.value==!0&&e.nextTick(()=>{a.value.focus()})},b=e.inject("postData"),D=()=>{p.value="",f.value=!1,et(m.value,{method:"POST",params:Object.assign(b,{q:"save",adapter:o.selection.adapter,path:o.selection.item.path,content:s.value}),json:!1}).then(_=>{p.value=h("Updated."),n.value=_,t("load"),l.value=!l.value}).catch(_=>{p.value=h(_.message),f.value=!0})};return(_,k)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Us,[e.createElementVNode("div",{class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title","aria-label":r.selection.item.path,"data-microtip-position":"bottom-right",role:"tooltip"},e.toDisplayString(r.selection.item.basename),9,Ks),e.createElementVNode("div",Ys,[l.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:D,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(h)("Save")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:k[0]||(k[0]=$=>y())},e.toDisplayString(l.value?e.unref(h)("Cancel"):e.unref(h)("Edit")),1)])]),e.createElementVNode("div",null,[l.value?(e.openBlock(),e.createElementBlock("div",Xs,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:a,"onUpdate:modelValue":k[1]||(k[1]=$=>s.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,s.value]])])):(e.openBlock(),e.createElementBlock("pre",Ws,e.toDisplayString(n.value),1)),p.value.length?(e.openBlock(),e.createBlock(he,{key:2,onHidden:k[2]||(k[2]=$=>p.value=""),error:f.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.value),1)]),_:1},8,["error"])):e.createCommentVNode("",!0)])],64))}},cu="";/*! * Cropper.js v1.5.12 * https://fengyuanchen.github.io/cropperjs * diff --git a/package.json b/package.json index faea0161..c7fce7b2 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vuefinder", - "version": "1.1.12", + "version": "1.1.13", "description": "Vuefinder is a file manager component for vuejs.", "type": "module", "files": [