vuefinder 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vuefinder.js +1 -1
- package/dist/vuefinder.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/vuefinder.js
CHANGED
|
@@ -2470,7 +2470,7 @@ const _n = Mr.exports, kn = (o, e, t, n, a) => (e = Math, t = e.log, n = 1024, a
|
|
|
2470
2470
|
else
|
|
2471
2471
|
return;
|
|
2472
2472
|
else
|
|
2473
|
-
!T && !h.value ? (i.items.push(m.refresh), i.items.push(m.newfolder), t.emit("vf-context-selected", []), console.log("no files selected")) : M.length > 1 && M.some((L) => L.path === T.path) ? (i.items.push(m.refresh), i.items.push(m.archive), i.items.push(m.delete), t.emit("vf-context-selected", M), console.log(M.length + " selected (more than 1 item.)")) : (T.type == "dir" ? i.items.push(m.open) : i.items.push(m.preview), i.items.push(m.
|
|
2473
|
+
!T && !h.value ? (i.items.push(m.refresh), i.items.push(m.newfolder), t.emit("vf-context-selected", []), console.log("no files selected")) : M.length > 1 && M.some((L) => L.path === T.path) ? (i.items.push(m.refresh), i.items.push(m.archive), i.items.push(m.delete), t.emit("vf-context-selected", M), console.log(M.length + " selected (more than 1 item.)")) : (T.type == "dir" ? i.items.push(m.open) : (i.items.push(m.preview), i.items.push(m.download)), i.items.push(m.rename), T.mime_type == "application/zip" ? i.items.push(m.unarchive) : i.items.push(m.archive), i.items.push(m.delete), t.emit("vf-context-selected", [T]), console.log(T.type + " is selected"));
|
|
2474
2474
|
v(b, A);
|
|
2475
2475
|
}), t.on("vf-contextmenu-hide", () => {
|
|
2476
2476
|
i.active = !1;
|
package/dist/vuefinder.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(e,Ne){typeof exports=="object"&&typeof module<"u"?module.exports=Ne(require("vue"),require("plupload")):typeof define=="function"&&define.amd?define(["vue","plupload"],Ne):(e=typeof globalThis<"u"?globalThis:e||self,e.VueFinder=Ne(e.Vue,e.plupload))})(this,function(e,Ne){"use strict";const qe=(a=>a&&typeof a=="object"&&"default"in a?a:{default:a})(Ne),Ie=(a,{method:t="get",params:r={},json:i=!0})=>{const s={method:t};if(t=="get")a+="?"+new URLSearchParams(r);else{s.headers={};let o=new FormData;for(const[c,m]of Object.entries(r))o.append(c,m);s.body=o}return fetch(a,s).then(o=>o.ok?i?o.json():o.text():Promise.reject(o))};function yr(a){return{all:a=a||new Map,on:function(t,r){var i=a.get(t);i?i.push(r):a.set(t,[r])},off:function(t,r){var i=a.get(t);i&&(r?i.splice(i.indexOf(r)>>>0,1):a.set(t,[]))},emit:function(t,r){var i=a.get(t);i&&i.slice().map(function(s){s(r)}),(i=a.get("*"))&&i.slice().map(function(s){s(t,r)})}}}function Ge(a){let t=localStorage.getItem(a+"_storage");const r=e.ref(JSON.parse(t));e.watch(r,i);function i(){r.value===null||r.value===""?localStorage.removeItem(a+"_storage"):localStorage.setItem(a+"_storage",JSON.stringify(r.value))}function s(m,f){r.value=Object.assign({...r.value},{[m]:f})}function o(){r.value=null}return{getStore:(m,f=null)=>r.value===null||r.value===""?f:r.value.hasOwnProperty(m)?r.value[m]:f,setStore:s,clearStore:o}}const bt=e.ref("");function ce(){function a(t){bt.value=t}return{apiUrl:bt,setApiUrl:a}}const br={class:"border-neutral-300 flex justify-between items-center py-1 text-sm"},vr={key:0,class:"flex text-center"},wr=["aria-label"],_r=[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)],kr=["aria-label"],xr=[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)],Sr=["aria-label"],Dr=[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)],Er=["aria-label"],Nr=[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)],Vr=["aria-label"],Cr=[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)],Mr=["aria-label"],$r=[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)],Br=["aria-label"],Tr=[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)],Ar={key:1,class:"flex text-center"},Or={class:"pl-2"},Pr={class:"dark:bg-gray-700 bg-gray-200 text-xs px-2 py-1 rounded"},jr={class:"flex text-center items-center justify-end"},Ir=["aria-label"],Lr=[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)],zr=["aria-label"],Rr={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"},Hr={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"},Ur={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"},Kr=["aria-label"],Fr={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"},Yr={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"},Wr=Object.assign({name:"VFToolbar"},{props:{data:Object},setup(a){const t=e.inject("emitter"),{getStore:r,setStore:i}=e.inject("storage"),{t:s}=e.inject("i18n"),o=e.ref(r("viewport","grid")),c=e.ref([]),m=e.ref(r("full-screen",!1)),f=e.ref("");t.on("vf-search-query",({newQuery:u})=>{f.value=u});const p=()=>{m.value=!m.value,t.emit("vf-fullscreen-toggle")};return t.on("vf-nodes-selected",u=>{c.value=u}),t.on("vf-view-toggle",u=>{i("viewport",u),o.value=u}),(u,y)=>(e.openBlock(),e.createElementBlock("div",br,[f.value.length?(e.openBlock(),e.createElementBlock("div",Ar,[e.createElementVNode("div",Or,[e.createTextVNode(e.toDisplayString(e.unref(s)("Search results for"))+" ",1),e.createElementVNode("span",Pr,e.toDisplayString(f.value),1)])])):(e.openBlock(),e.createElementBlock("div",vr,[e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("New Folder"),"data-microtip-position":"bottom-right",role:"tooltip",onClick:y[0]||(y[0]=b=>e.unref(t).emit("vf-modal-show",{type:"new-folder",items:c.value}))},_r,8,wr),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("New File"),"data-microtip-position":"bottom",role:"tooltip",onClick:y[1]||(y[1]=b=>e.unref(t).emit("vf-modal-show",{type:"new-file",items:c.value}))},xr,8,kr),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Rename"),"data-microtip-position":"bottom",role:"tooltip",onClick:y[2]||(y[2]=b=>c.value.length!=1||e.unref(t).emit("vf-modal-show",{type:"rename",items:c.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([c.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"},Dr,2))],8,Sr),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Delete"),"data-microtip-position":"bottom",role:"tooltip",onClick:y[3]||(y[3]=b=>!c.value.length||e.unref(t).emit("vf-modal-show",{type:"delete",items:c.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([c.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"},Nr,2))],8,Er),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Upload"),"data-microtip-position":"bottom",role:"tooltip",onClick:y[4]||(y[4]=b=>e.unref(t).emit("vf-modal-show",{type:"upload",items:c.value}))},Cr,8,Vr),c.value.length==1&&c.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:y[5]||(y[5]=b=>!c.value.length||e.unref(t).emit("vf-modal-show",{type:"unarchive",items:c.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([c.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"},$r,2))],8,Mr)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"mx-1.5","aria-label":e.unref(s)("Archive"),"data-microtip-position":"bottom",role:"tooltip",onClick:y[6]||(y[6]=b=>!c.value.length||e.unref(t).emit("vf-modal-show",{type:"archive",items:c.value}))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([c.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"},Tr,2))],8,Br))])),e.createElementVNode("div",jr,[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:y[7]||(y[7]=b=>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"},Lr))],8,Ir),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Toggle Full Screen"),"data-microtip-position":"bottom",role:"tooltip",onClick:p},[(e.openBlock(),e.createElementBlock("svg",Rr,[m.value?(e.openBlock(),e.createElementBlock("path",Hr)):(e.openBlock(),e.createElementBlock("path",Ur))]))],8,zr),e.createElementVNode("div",{class:"mx-1.5","aria-label":e.unref(s)("Change View"),"data-microtip-position":"bottom-left",role:"tooltip",onClick:y[8]||(y[8]=b=>f.value.length||e.unref(t).emit("vf-view-toggle",o.value=="list"?"grid":"list"))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass([f.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"},[o.value=="grid"?(e.openBlock(),e.createElementBlock("path",Fr)):e.createCommentVNode("",!0),o.value=="list"?(e.openBlock(),e.createElementBlock("path",Yr)):e.createCommentVNode("",!0)],2))],8,Kr)])]))}});var Xr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vt={exports:{}};(function(a,t){(function(r,i){a.exports=i()})(Xr,function(){function r(h,l){if(!(h instanceof l))throw new TypeError("Cannot call a class as a function")}function i(h,l){for(var n=0;n<l.length;n++){var g=l[n];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(h,g.key,g)}}function s(h,l,n){return l&&i(h.prototype,l),n&&i(h,n),h}function o(h,l,n){return l in h?Object.defineProperty(h,l,{value:n,enumerable:!0,configurable:!0,writable:!0}):h[l]=n,h}function c(h,l){var n=Object.keys(h);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(h);l&&(g=g.filter(function(d){return Object.getOwnPropertyDescriptor(h,d).enumerable})),n.push.apply(n,g)}return n}function m(h){for(var l=1;l<arguments.length;l++){var n=arguments[l]!=null?arguments[l]:{};l%2?c(Object(n),!0).forEach(function(g){o(h,g,n[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(g){Object.defineProperty(h,g,Object.getOwnPropertyDescriptor(n,g))})}return h}function f(h,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");h.prototype=Object.create(l&&l.prototype,{constructor:{value:h,writable:!0,configurable:!0}}),l&&u(h,l)}function p(h){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},p(h)}function u(h,l){return u=Object.setPrototypeOf||function(g,d){return g.__proto__=d,g},u(h,l)}function y(){if(typeof Reflect>"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(h,l,n){return y()?b=Reflect.construct:b=function(d,v,w){var _=[null];_.push.apply(_,v);var k=Function.bind.apply(d,_),V=new k;return w&&u(V,w.prototype),V},b.apply(null,arguments)}function N(h){return Function.toString.call(h).indexOf("[native code]")!==-1}function S(h){var l=typeof Map=="function"?new Map:void 0;return S=function(g){if(g===null||!N(g))return g;if(typeof g!="function")throw new TypeError("Super expression must either be null or a function");if(typeof l<"u"){if(l.has(g))return l.get(g);l.set(g,d)}function d(){return b(g,arguments,p(this).constructor)}return d.prototype=Object.create(g.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),u(d,g)},S(h)}function E(h){if(h===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h}function B(h,l){return l&&(typeof l=="object"||typeof l=="function")?l:E(h)}function A(h){var l=y();return function(){var g=p(h),d;if(l){var v=p(this).constructor;d=Reflect.construct(g,arguments,v)}else d=g.apply(this,arguments);return B(this,d)}}function O(h,l){for(;!Object.prototype.hasOwnProperty.call(h,l)&&(h=p(h),h!==null););return h}function C(h,l,n){return typeof Reflect<"u"&&Reflect.get?C=Reflect.get:C=function(d,v,w){var _=O(d,v);if(!!_){var k=Object.getOwnPropertyDescriptor(_,v);return k.get?k.get.call(w):k.value}},C(h,l,n||h)}function J(h,l){return R(h)||Q(h,l)||re(h,l)||M()}function K(h){return x(h)||F(h)||re(h)||j()}function x(h){if(Array.isArray(h))return $(h)}function R(h){if(Array.isArray(h))return h}function F(h){if(typeof Symbol<"u"&&Symbol.iterator in Object(h))return Array.from(h)}function Q(h,l){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(h)))){var n=[],g=!0,d=!1,v=void 0;try{for(var w=h[Symbol.iterator](),_;!(g=(_=w.next()).done)&&(n.push(_.value),!(l&&n.length===l));g=!0);}catch(k){d=!0,v=k}finally{try{!g&&w.return!=null&&w.return()}finally{if(d)throw v}}return n}}function re(h,l){if(!!h){if(typeof h=="string")return $(h,l);var n=Object.prototype.toString.call(h).slice(8,-1);if(n==="Object"&&h.constructor&&(n=h.constructor.name),n==="Map"||n==="Set")return Array.from(h);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $(h,l)}}function $(h,l){(l==null||l>h.length)&&(l=h.length);for(var n=0,g=new Array(l);n<l;n++)g[n]=h[n];return g}function j(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function M(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var L=function(l,n,g){var d=l.x,v=l.y,w=g.x,_=g.y,k={"+":{x:d+w,y:v+_},"-":{x:d-w,y:v-_},"*":{x:d*w,y:v*_},"/":{x:d/w,y:v/_}};return k[n]},P=function(l){return{x:l.left,y:l.top}},q=function(l){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return{left:l.x,top:l.y,right:l.x,bottom:l.y,width:n,height:n}},Y=function(l){return{x:l,y:l}},Oe=function(h,l,n){window.addEventListener("resize",l),window.addEventListener("scroll",l),h.forEach(function(g,d){n.observe(g,{childList:d!==0,attributes:!0})})},Pe=function(h){var l=Se(h);return l.x||l.y?!0:h instanceof HTMLDocument?h.body?!!(h.body.scrollTop=1):!!(h.documentElement.scrollTop=1):!!(h.scrollTop=1)},Fe=function(h){var l=document.createElement("div");return l.style.position="fixed",l.style.overflow="hidden",l.style.pointerEvents="none",l.style.zIndex="999999999999999999",l.classList.add(h),l},Ye=function(h){var l=document.createElement("div");return l.style.position="absolute",h||(l.style.background="rgba(0, 0, 255, 0.1)",l.style.border="1px solid rgba(0, 0, 255, 0.45)",l.style.display="none",l.style.pointerEvents="none"),l},We=function(h,l){var n;return function(){for(var g=arguments.length,d=new Array(g),v=0;v<g;v++)d[v]=arguments[v];var w=function(){n=null,h.apply(void 0,d)};clearTimeout(n),n=setTimeout(w,l)}},xe=function(){var h,l,n,g;return{y:((h=document.body)===null||h===void 0?void 0:h.scrollTop)||((l=document.documentElement)===null||l===void 0?void 0:l.scrollTop)||0,x:((n=document.body)===null||n===void 0?void 0:n.scrollLeft)||((g=document.documentElement)===null||g===void 0?void 0:g.scrollLeft)||0}},pt=function(h,l){if(h instanceof Document)return{top:0,left:0,bottom:0,right:0,width:window.innerWidth,height:window.innerHeight};var n=h.getBoundingClientRect();return{top:n.top,left:n.left,bottom:n.bottom,right:n.right,width:(h.clientWidth||n.width)*l,height:(h.clientHeight||n.height)*l}},Se=function(h){return!h||h instanceof Document?xe():{x:h.scrollLeft>=0?h.scrollLeft:xe().x,y:h.scrollTop>=0?h.scrollTop:xe().y}},Jt=function(h){var l=h.elementRect,n=h.containerRect,g=h.tolerance,d=g===void 0?{x:0,y:0}:g,v=[];return l.top-d.y<n.top&&v.push("top"),l.left-d.x<n.left&&v.push("left"),l.bottom+d.y>n.bottom&&v.push("bottom"),l.right+d.y>n.right&&v.push("right"),v},Gs=function(h){var l=h.event;return{x:l.clientX,y:l.clientY}},Js=function(h){var l=h.scrollAmount,n=h.initialPointerPos,g=h.pointerPos,d={};return g.x>n.x-l.x?(d.left=n.x-l.x,d.width=g.x-n.x+l.x):(d.left=g.x,d.width=n.x-g.x-l.x),g.y>n.y-l.y?(d.top=n.y-l.y,d.height=g.y-n.y+l.y):(d.top=g.y,d.height=n.y-g.y-l.y),d},Zt=function(l){var n={x:0,y:0},g=window.getComputedStyle(l);if(!g.transform||g.transform==="none")return n;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(",");n.x=parseInt(w[12])||0,n.y=parseInt(w[13])||0}return n}else{var _=g.transform.trim().match(/matrix\((.*?)\)/);if(_&&_.length){var k,V=(k=_[1])===null||k===void 0?void 0:k.split(",");n.x=parseInt(V[4])||0,n.y=parseInt(V[5])||0}return n}},Zs=function(l){var n=l.style.transform;if(!n||n.indexOf("translate")<0)return Zt(l);var g={x:0,y:0},d=n.trim().match(/translate[3dD]*?\(.*?\)/);if(d){var v,w=(v=d[0])===null||v===void 0?void 0:v.split("(");if(w){var _,k=(_=w[1])===null||_===void 0?void 0:_.split(",");g.x=parseInt(k[0])||0,g.y=parseInt(k[1])||0}}return!g.x&&!g.x?Zt(l):g},Qs=function(l){var n=l.style,g={x:parseInt(n.left)||0,y:parseInt(n.top)||0};if(!g.x&&!g.x){var d=window.getComputedStyle(l);return{x:parseInt(d.left)||0,y:parseInt(d.top)||0}}return g},el=function(h,l){return l?Zs(h):Qs(h)},tl=function(h){var l=h.element,n=h.edges,g=h.elementRect,d=h.containerRect,v=h.elementPos,w=h.useTransform;n.includes("top")&&je(l,{y:v.y+d.top-g.top,x:v.x},w),n.includes("left")&&je(l,{y:v.y,x:v.x+d.left-g.left},w),n.includes("bottom")&&je(l,{y:v.y+d.bottom-g.bottom,x:v.x},w),n.includes("right")&&je(l,{y:v.y,x:v.x+d.right-g.right},w)},Qt=function(h){var l=h.computedStyle,n=h.node,g=l.position,d=g==="absolute"||g==="relative"||g==="fixed";!(n instanceof HTMLDocument)&&!d&&(n.style.position="relative")},rl=function(h){var l=h.shiftKey,n=h.keyboardDragSpeed,g=h.zoom,d=h.key,v=h.dragKeys,w=h.scrollDiff,_=h.canScroll,k=h.scrollCallback,V={x:0,y:0},D=l?n*4*g:n*g;return v.left.includes(d)&&(V.x=w.x||-D,!l&&!w.x&&_&&k(["left"],n)),v.right.includes(d)&&(V.x=w.x||D,!l&&!w.x&&_&&k(["right"],n)),v.up.includes(d)&&(V.y=w.y||-D,!l&&!w.y&&_&&k(["top"],n)),v.down.includes(d)&&(V.y=w.y||D,!l&&!w.y&&_&&k(["bottom"],n)),V},nl=function(h){var l=h.element,n=h.force,g=h.multiSelectionToggle,d=h.SelectedSet,v=h.hoverClassName;l.classList.contains(v)&&!n||(d.has(l)?g&&d.delete(l):d.add(l),l.classList.add(v))},ol=function(h){var l=h.element,n=h.force,g=h.SelectedSet,d=h.PrevSelectedSet,v=h.hoverClassName;if(!l.classList.contains(v)&&!n)return!1;var w=g.has(l),_=d.has(l);w&&!_?g.delete(l):!w&&_&&g.add(l),l.classList.remove(v)},gt=function(h,l){return h.left<l.right&&h.right>l.left&&h.top<l.bottom&&h.bottom>l.top},er=function(h){var l=h.element,n=h.posDirection,g=h.containerRect,d=h.useTransform,v=el(l,d),w=L(v,"+",n);je(l,w,d);var _=l.getBoundingClientRect(),k=Jt({elementRect:_,containerRect:g});tl({element:l,edges:k,elementRect:_,containerRect:g,elementPos:w,useTransform:d})},il=function(h,l){window.removeEventListener("resize",l),window.removeEventListener("scroll",l),h.disconnect()},al=function(h,l,n){if(!!l.length){var g=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,d=h instanceof HTMLDocument?g||document.body:h,v=l.includes("top")&&d.scrollTop>0,w=l.includes("bottom")&&d.scrollTop<d.scrollHeight,_=l.includes("left")&&d.scrollLeft>0,k=l.includes("right")&&d.scrollLeft<d.scrollWidth;v&&(d.scrollTop-=1*n),w&&(d.scrollTop+=1*n),_&&(d.scrollLeft-=1*n),k&&(d.scrollLeft+=1*n)}},je=function(h,l,n){if(n){var g=h.style.transform;h.style.transform="translate3d(".concat(l.x,"px,").concat(l.y,"px,1px) ").concat(g.replace(/translate.*?\)/g,""))}else h.style.left="".concat(l.x,"px"),h.style.top="".concat(l.y,"px");return h},sl=function(h){for(var l=h.subscribe,n=h.publish,g=h.Interaction,d=h.SelectedSet,v={"Selected:added":[{name:"elementselect"}],"Selected:removed":[{name:"elementunselect"}],"Area:scroll":[{name:"autoscroll"}],"Interaction:start":[{name:"dragstart"}],"Interaction:update":[{name:"dragmove",condition:function(D){return D.event}}],"Interaction:end":[{name:"callback"}]},w=function(){var D=J(k[_],2),T=D[0],I=D[1];["pre",!1].forEach(function(W){return l(W?"".concat(T,":").concat(W):T,function(ne){return I.forEach(function(G){return(!G.condition||G.condition(ne))&&n(W?"".concat(W).concat(G.name):G.name,m({items:d.elements,isDragging:g.isDragging},ne))})})})},_=0,k=Object.entries(v);_<k.length;_++)w()},De=function(h){return h?!Array.isArray(h)&&(h instanceof HTMLElement||h instanceof SVGElement)?[h]:K(h):[]},tr=function(h,l){h.style.left="".concat(l.left,"px"),h.style.top="".concat(l.top,"px"),h.style.width="".concat(l.width,"px"),h.style.height="".concat(l.height,"px")},ll=function(){function h(l){var n=this,g=l.area,d=l.PS,v=l.zoom;r(this,h),o(this,"_modificationCallback",void 0),o(this,"_modificationObserver",void 0),o(this,"_zoom",void 0),o(this,"_node",void 0),o(this,"_parentNodes",void 0),o(this,"_computedStyle",void 0),o(this,"_computedBorder",void 0),o(this,"_rect",void 0),o(this,"setArea",function(w){n._node=w,Qt({computedStyle:n.computedStyle,node:n._node}),setTimeout(function(){n.PubSub.publish("Area:modified:pre",{item:n}),n.reset(),n.PubSub.publish("Area:modified",{item:n})})}),o(this,"start",function(){Oe(n.parentNodes,n._modificationCallback,n._modificationObserver)}),o(this,"reset",function(){n._computedStyle=void 0,n._rect=void 0,n._computedBorder=void 0,n._parentNodes=void 0}),o(this,"stop",function(){il(n._modificationObserver,n._modificationCallback),n.reset()}),o(this,"scroll",function(w,_){var k={scroll_directions:w,scroll_multiplier:_};n.PubSub.publish("Area:scroll:pre",k),al(n._node,w,_),n.PubSub.publish("Area:scroll",k)}),this._zoom=v,this.PubSub=d,this.setArea(g),this._modificationCallback=We(function(w){n.PubSub.publish("Area:modified:pre",{event:w,item:n}),n.reset(),n.PubSub.publish("Area:modified",{event:w,item:n})},60),this._modificationObserver=new MutationObserver(this._modificationCallback),this.PubSub.subscribe("Interaction:init",this.start),this.PubSub.subscribe("Interaction:end",this.reset)}return s(h,[{key:"HTMLNode",get:function(){return this._node}},{key:"computedBorder",get:function(){return this._computedBorder?this._computedBorder:{top:parseInt(this.computedStyle.borderTopWidth),bottom:parseInt(this.computedStyle.borderBottomWidth),left:parseInt(this.computedStyle.borderLeftWidth),right:parseInt(this.computedStyle.borderRightWidth)}}},{key:"computedStyle",get:function(){return this._computedStyle?this._computedStyle:this.HTMLNode instanceof HTMLDocument?this._computedStyle=window.getComputedStyle(this.HTMLNode.body||this.HTMLNode.documentElement):this._computedStyle=window.getComputedStyle(this.HTMLNode)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=pt(this.HTMLNode,this._zoom)}},{key:"parentNodes",get:function(){if(this._parentNodes)return this._parentNodes;var n=function g(d){var v,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,_=(v=d[w])===null||v===void 0?void 0:v.parentNode;return _?(d.push(_),w++,g(d,w)):d};return this._parentNodes=n([this.HTMLNode]),this._parentNodes}}]),h}(),cl=function(){function h(l){var n=this,g=l.DS,d=l.dragKeys,v=l.draggability,w=l.keyboardDrag,_=l.keyboardDragSpeed,k=l.useTransform,V=l.zoom;r(this,h),o(this,"_useTransform",void 0),o(this,"_prevCursorPos",void 0),o(this,"_prevScrollPos",void 0),o(this,"_elements",[]),o(this,"_draggability",void 0),o(this,"_dragKeys",void 0),o(this,"_dragKeysFlat",void 0),o(this,"_keyboardDrag",void 0),o(this,"_keyboardDragSpeed",void 0),o(this,"_zoom",void 0),o(this,"keyboardDrag",function(D){var T=D.event,I=D.key;if(!(!n._keyboardDrag||!n._dragKeysFlat.includes(I)||!n.DS.SelectedSet.size||!n._draggability||n.DS.continue)){var W={event:T,isDragging:!0,isDraggingKeyboard:!0};n.DS.publish(["Interaction:start:pre","Interaction:start"],W),n._elements=n.DS.getSelection(),n.handleZIndex(!0);var ne=rl({shiftKey:n.DS.stores.KeyStore.currentValues.includes("shift"),keyboardDragSpeed:n._keyboardDragSpeed,zoom:n._zoom,key:I,scrollCallback:n.DS.Area.scroll,scrollDiff:n._scrollDiff,canScroll:n.DS.stores.ScrollStore.canScroll,dragKeys:n._dragKeys});n._elements.forEach(function(G){return er({element:G,posDirection:ne,containerRect:n.DS.SelectorArea.rect,useTransform:n._useTransform})}),n.DS.publish(["Interaction:update:pre","Interaction:update"],W)}}),o(this,"keyboardEnd",function(D){var T=D.event,I=D.key;if(!(!n._keyboardDrag||!n._dragKeysFlat.includes(I)||!n.DS.SelectedSet.size||!n._draggability)){var W={event:T,isDragging:n._draggability,isDraggingKeyboard:!0};n.DS.publish(["Interaction:end:pre","Interaction:end"],W)}}),o(this,"start",function(D){var T=D.isDragging,I=D.isDraggingKeyboard;!T||I||(n._prevCursorPos=null,n._prevScrollPos=null,n._elements=n.DS.getSelection(),n.handleZIndex(!0))}),o(this,"stop",function(D){D!=null&&D.isKeyboard||(n._prevCursorPos=null,n._prevScrollPos=null,n.handleZIndex(!1),n._elements=[])}),o(this,"update",function(D){var T=D.isDragging,I=D.isDraggingKeyboard;if(!(!T||!n._elements.length||I||n.DS.continue)){var W=L(n._cursorDiff,"+",n._scrollDiff);n._elements.forEach(function(ne){return er({element:ne,posDirection:W,containerRect:n.DS.SelectorArea.rect,useTransform:n._useTransform})})}}),o(this,"handleZIndex",function(D){n._elements.forEach(function(T){return T.style.zIndex="".concat((parseInt(T.style.zIndex)||0)+D?9999:-9998)})}),this.DS=g,this._useTransform=k,this._keyboardDragSpeed=_,this._keyboardDrag=w,this._zoom=V,this._draggability=v,this._dragKeys={up:d.up.map(function(D){return D.toLowerCase()}),down:d.down.map(function(D){return D.toLowerCase()}),left:d.left.map(function(D){return D.toLowerCase()}),right:d.right.map(function(D){return D.toLowerCase()})},this._dragKeysFlat=[].concat(K(this._dragKeys.up),K(this._dragKeys.down),K(this._dragKeys.left),K(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(h,[{key:"_cursorDiff",get:function(){var n=this.DS.stores.PointerStore.currentVal,g=this._prevCursorPos?L(n,"-",this._prevCursorPos):{x:0,y:0};return this._prevCursorPos=n,g}},{key:"_scrollDiff",get:function(){var n=this.DS.stores.ScrollStore.currentVal,g=this._prevScrollPos?L(n,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=n,g}}]),h}(),dl=function(){function h(l){var n=this,g=l.DS,d=l.areaElement,v=l.draggability,w=l.immediateDrag,_=l.selectableClass;r(this,h),o(this,"_areaElement",void 0),o(this,"_draggability",void 0),o(this,"_immediateDrag",void 0),o(this,"_selectableClass",void 0),o(this,"isInteracting",void 0),o(this,"isDragging",void 0),o(this,"init",function(){return n.DS.publish("Interaction:init:pre",{})}),o(this,"_init",function(){n.stop(),n._areaElement.addEventListener("mousedown",n.start),n._areaElement.addEventListener("touchstart",n.start,{passive:!1}),n.DS.publish("Interaction:init",{})}),o(this,"start",function(k){return n.DS.publish("Interaction:start:pre",{event:k,isDragging:n.isDragging})}),o(this,"_start",function(k){k.type==="touchstart"&&k.preventDefault(),n._canInteract(k)&&(n.isInteracting=!0,n.isDragging=n.isDragEvent(k),n.DS.publish("Interaction:start",{event:k,isDragging:n.isDragging}),document.addEventListener("mouseup",n.reset),document.addEventListener("touchend",n.reset))}),o(this,"isDragEvent",function(k){var V=k.target.closest(".".concat(n._selectableClass));return!n._draggability||n.DS.stores.KeyStore.isMultiSelectKeyPressed(k)||!V?!1:(n._immediateDrag&&(n.DS.SelectedSet.size?n.DS.SelectedSet.has(V)||(n.DS.SelectedSet.clear(),n.DS.SelectedSet.add(V)):n.DS.SelectedSet.add(V)),!!n.DS.SelectedSet.has(V))}),o(this,"onClick",function(k){var V=k.event;if(!!n._canInteract(V)&&!(V.detail>0)){var D=n.DS,T=D.stores,I=T.PointerStore,W=T.KeyStore,ne=D.SelectableSet,G=D.SelectedSet;I.start(V);var Ee=V.target;!ne.has(Ee)||(W.isMultiSelectKeyPressed(V)||G.clear(),G.toggle(Ee),n.reset())}}),o(this,"stop",function(){n.isInteracting=!1,n.isDragging=!1,n._areaElement.removeEventListener("mousedown",n.start),n._areaElement.removeEventListener("touchstart",n.start,{passive:!1}),document.removeEventListener("mouseup",n.reset),document.removeEventListener("touchend",n.reset)}),o(this,"update",function(k){var V=k.event,D=k.scroll_directions,T=k.scroll_multiplier;n.isInteracting&&n.DS.publish(["Interaction:update:pre","Interaction:update"],{event:V,scroll_directions:D,scroll_multiplier:T,isDragging:n.isDragging})}),o(this,"reset",function(k){return n.DS.publish("Interaction:end:pre",{event:k,isDragging:n.isDragging})}),o(this,"_reset",function(k){var V=n.isDragging;n.stop(),n.init(),n.DS.publish("Interaction:end",{event:k,isDragging:V})}),this._areaElement=d,this._draggability=v,this._immediateDrag=w,this._selectableClass=_,this.DS=g,this.DS.subscribe("PointerStore:updated",this.update),this.DS.subscribe("Selectable:click",this.onClick),this.DS.subscribe("Selectable:pointer",function(k){var V=k.event;return n.start(V)}),this.DS.subscribe("Interaction:start:pre",function(k){var V=k.event;return n._start(V)}),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",function(k){var V=k.event;return n._reset(V)}),this.DS.subscribe("Area:scroll",this.update)}return s(h,[{key:"_canInteract",value:function(n){var g=n.clientX===0&&n.clientY===0&&n.detail===0&&n.target;return!(n.button===2||this.isInteracting||n.target&&!this.DS.SelectorArea.isInside(n.target)||!g&&!this.DS.SelectorArea.isClicked(n))}}]),h}(),hl=function h(l){var n=this,g=l.DS;r(this,h),o(this,"subscribers",{}),o(this,"subscribe",function(d,v){return Array.isArray(n.subscribers[d])||(n.subscribers[d]=[]),n.subscribers[d].push(v),n.subscribers[d].length-1}),o(this,"unsubscribe",function(d,v,w){w>=0?n.subscribers[d].splice(w,1):v&&(n.subscribers[d]=n.subscribers[d].filter(function(_){return _!==v}))}),o(this,"publish",function(d,v){Array.isArray(d)?d.forEach(function(w){return n._publish(w,v)}):n._publish(d,v)}),o(this,"_publish",function(d,v){var w=n.subscribers[d];!Array.isArray(w)||(d.includes(":pre")?n._handlePrePublish(w,v):n._handlePublish(w,v))}),o(this,"_handlePublish",function(d,v){for(var w=0,_=d.length;w<_;w++){if(n.DS.stopped)return;d[w](v)}}),o(this,"_handlePrePublish",function(d,v){for(var w=d.length;w--;){if(n.DS.stopped)return;d[w](v)}}),this.DS=g},ul=function(h){f(n,h);var l=A(n);function n(g){var d,v=g.elements,w=g.className,_=g.hoverClassName,k=g.draggability,V=g.useTransform,D=g.DS;return r(this,n),d=l.call(this),o(E(d),"_initElements",void 0),o(E(d),"_className",void 0),o(E(d),"_hoverClassName",void 0),o(E(d),"_useTransform",void 0),o(E(d),"_draggability",void 0),o(E(d),"init",function(){return d._initElements.forEach(function(T){return d.add(T)})}),o(E(d),"clear",function(){return d.forEach(function(T){return d.delete(T)})}),o(E(d),"_onClick",function(T){return d.DS.publish(["Selectable:click:pre","Selectable:click"],{event:T})}),o(E(d),"_onPointer",function(T){return d.DS.publish(["Selectable:pointer:pre","Selectable:pointer"],{event:T})}),o(E(d),"addAll",function(T){return T.forEach(function(I){return d.add(I)})}),o(E(d),"deleteAll",function(T){return T.forEach(function(I){return d.delete(I)})}),d.DS=D,d._initElements=De(v),d._className=w,d._hoverClassName=_,d._useTransform=V,d._draggability=k,d.DS.subscribe("Interaction:init",d.init),d}return s(n,[{key:"add",value:function(d){return d.classList.add(this._className),d.addEventListener("click",this._onClick),d.addEventListener("mousedown",this._onPointer),d.addEventListener("touchstart",this._onPointer,{passive:!1}),this._draggability&&!this._useTransform&&Qt({computedStyle:window.getComputedStyle(d),node:d}),C(p(n.prototype),"add",this).call(this,d)}},{key:"delete",value:function(d){return d.classList.remove(this._className),d.classList.remove(this._hoverClassName),d.removeEventListener("click",this._onClick),d.removeEventListener("mousedown",this._onPointer),d.removeEventListener("touchstart",this._onPointer,{passive:!1}),C(p(n.prototype),"delete",this).call(this,d)}},{key:"elements",get:function(){return Array.from(this.values())}}]),n}(S(Set)),ml=function(h){f(n,h);var l=A(n);function n(g){var d,v=g.className,w=g.DS;return r(this,n),d=l.call(this),o(E(d),"_className",void 0),o(E(d),"clear",function(){return d.forEach(function(_){return d.delete(_)})}),o(E(d),"addAll",function(_){return _.forEach(function(k){return d.add(k)})}),o(E(d),"deleteAll",function(_){return _.forEach(function(k){return d.delete(k)})}),d.DS=w,d._className=v,d}return s(n,[{key:"add",value:function(d){if(!C(p(n.prototype),"has",this).call(this,d)){var v={items:this.elements,item:d};return this.DS.publish("Selected:added:pre",v),C(p(n.prototype),"add",this).call(this,d),d.classList.add(this._className),d.style.zIndex="".concat((parseInt(d.style.zIndex)||0)+1),this.DS.publish("Selected:added",v),this}}},{key:"delete",value:function(d){if(!!C(p(n.prototype),"has",this).call(this,d)){var v={items:this.elements,item:d};this.DS.publish("Selected:removed:pre",v);var w=C(p(n.prototype),"delete",this).call(this,d);return d.classList.remove(this._className),d.style.zIndex="".concat((parseInt(d.style.zIndex)||0)-1),this.DS.publish("Selected:removed",v),w}}},{key:"toggle",value:function(d){return this.has(d)?this.delete(d):this.add(d),d}},{key:"elements",get:function(){return Array.from(this.values())}}]),n}(S(Set)),fl=function(){function h(l){var n=this,g=l.DS,d=l.hoverClassName,v=l.multiSelectToggling;r(this,h),o(this,"_prevSelectedSet",void 0),o(this,"_hoverClassName",void 0),o(this,"_multiSelectToggling",void 0),o(this,"start",function(w){var _=w.event,k=w.isDragging;k||(n._storePrevious(_),n._handleInsideSelection(!0,_))}),o(this,"update",function(w){var _=w.isDragging;_||n.DS.continue||n._handleInsideSelection()}),o(this,"_handleInsideSelection",function(w,_){for(var k=n.DS,V=k.SelectableSet,D=k.SelectorArea,T=k.Selector,I=V.elements.map(function(me){return[me,me.getBoundingClientRect()]}),W=[],ne=[],G=0,Ee=I.length;G<Ee;G++)!D.isInside(I[G][0],I[G][1])||(gt(I[G][1],T.rect)?W.push(I[G][0]):ne.push(I[G][0]));var Xe=n.DS.stores.KeyStore.isMultiSelectKeyPressed(_)&&n._multiSelectToggling;n.DS.continue||(W.forEach(function(me){return nl({element:me,force:w,multiSelectionToggle:Xe,SelectedSet:n.DS.SelectedSet,hoverClassName:n._hoverClassName})}),ne.forEach(function(me){return ol({element:me,force:w,SelectedSet:n.DS.SelectedSet,hoverClassName:n._hoverClassName,PrevSelectedSet:n._prevSelectedSet})}))}),this._hoverClassName=d,this._multiSelectToggling=v,this.DS=g,this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update)}return s(h,[{key:"_storePrevious",value:function(n){var g=this.DS,d=g.stores.KeyStore,v=g.SelectedSet;d.isMultiSelectKeyPressed(n)?this._prevSelectedSet=new Set(v):this._prevSelectedSet=new Set}}]),h}(),pl=function(){function h(l){var n=this,g=l.DS,d=l.selector,v=l.selectorClass,w=l.customStyles;r(this,h),o(this,"_rect",void 0),o(this,"start",function(_){var k=_.isDragging;if(!k){var V=n.DS.stores.PointerStore,D=V.initialValArea;tr(n.HTMLNode,q(D,1)),n.HTMLNode.style.display="block",n._rect=null}}),o(this,"stop",function(){n.HTMLNode.style.width="0",n.HTMLNode.style.height="0",n.HTMLNode.style.display="none"}),o(this,"update",function(_){var k=_.isDragging;if(!(k||n.DS.continue)){var V=n.DS.stores,D=V.ScrollStore,T=V.PointerStore,I=Js({scrollAmount:D.scrollAmount,initialPointerPos:T.initialValArea,pointerPos:T.currentValArea});tr(n.HTMLNode,I),n._rect=null}}),this.DS=g,this.HTMLNode=d||Ye(w),this.HTMLNode.classList.add(v),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("Interaction:end",this.stop)}return s(h,[{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),h}(),gl=function(){function h(l){var n=this,g=l.DS,d=l.selectorAreaClass,v=l.autoScrollSpeed,w=l.overflowTolerance;r(this,h),o(this,"_autoScrollSpeed",void 0),o(this,"_scrollInterval",void 0),o(this,"_rect",void 0),o(this,"currentEdges",[]),o(this,"_overflowTolerance",void 0),o(this,"start",function(){return n.applyElements("append")}),o(this,"applyElements",function(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"append",k=document.body?"body":"documentElement",V="".concat(_,"Child");n.HTMLNode[V](n.DS.Selector.HTMLNode),document[k][V](n.HTMLNode)}),o(this,"updatePos",function(){n._rect=null;var _=n.DS.Area.rect,k=n.DS.Area.computedBorder,V=n.HTMLNode.style,D="".concat(_.top+k.top,"px"),T="".concat(_.left+k.left,"px"),I="".concat(_.width,"px"),W="".concat(_.height,"px");V.top!==D&&(V.top=D),V.left!==T&&(V.left=T),V.width!==I&&(V.width=I),V.height!==W&&(V.height=W)}),o(this,"stop",function(_){n.stopAutoScroll(),_&&n.applyElements("remove")}),o(this,"startAutoScroll",function(){n.currentEdges=[],n._scrollInterval=setInterval(function(){return n.handleAutoScroll()},16)}),o(this,"handleAutoScroll",function(){if(!n.DS.continue){var _=n.DS,k=_.stores.PointerStore,V=_.Area;n.currentEdges=Jt({elementRect:q(k.currentVal),containerRect:n.rect,tolerance:n._overflowTolerance}),n.currentEdges.length&&V.scroll(n.currentEdges,n._autoScrollSpeed)}}),o(this,"stopAutoScroll",function(){n.currentEdges=[],clearInterval(n._scrollInterval)}),o(this,"isInside",function(_,k){return n.DS.Area.HTMLNode.contains(_)&&n.DS.stores.ScrollStore.canScroll?!0:gt(n.rect,k||_.getBoundingClientRect())}),this._autoScrollSpeed=v,this._overflowTolerance=w,this.DS=g,this.HTMLNode=Fe(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(){n.updatePos(),n.stopAutoScroll()})}return s(h,[{key:"isClicked",value:function(n){var g=this.DS.stores.PointerStore,d=n?g.getPointerPosition(n):g.initialVal;return gt({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()}}]),h}(),yl=function(){function h(l){var n=this,g=l.DS,d=l.multiSelectKeys,v=l.multiSelectMode;r(this,h),o(this,"_multiSelectMode",void 0),o(this,"_multiSelectKeys",void 0),o(this,"_currentValues",new Set),o(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),o(this,"init",function(){document.addEventListener("keydown",n.keydown),document.addEventListener("keyup",n.keyup),window.addEventListener("blur",n.reset)}),o(this,"keydown",function(w){var _=w.key.toLowerCase();n.DS.publish("KeyStore:down:pre",{event:w,key:_}),n._currentValues.add(_),n.DS.publish("KeyStore:down",{event:w,key:_})}),o(this,"keyup",function(w){var _=w.key.toLowerCase();n.DS.publish("KeyStore:up:pre",{event:w,key:_}),n._currentValues.delete(_),n.DS.publish("KeyStore:up",{event:w,key:_})}),o(this,"stop",function(){document.removeEventListener("keydown",n.keydown),document.removeEventListener("keyup",n.reset),window.removeEventListener("blur",n.reset),n.reset()}),o(this,"reset",function(){return n._currentValues.clear()}),this.DS=g,this._multiSelectMode=v,this._multiSelectKeys=d.map(function(w){var _={ctrlKey:"Control",shiftKey:"Shift",metaKey:"Meta"},k=_[w];return k?(console.warn("[DragSelect] ".concat(w,' is deprecated. Use "').concat(k,'" instead. Act Now!. See docs for more info')),k.toLowerCase()):w.toLowerCase()}),this.DS.subscribe("Interaction:init",this.init)}return s(h,[{key:"isMultiSelectKeyPressed",value:function(n){var g=this;return!!(this._multiSelectMode||this.currentValues.some(function(d){return g._multiSelectKeys.includes(d)})||n&&this._multiSelectKeys.some(function(d){return n[g._keyMapping[d]]}))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),h}(),bl=function(){function h(l){var n=this,g=l.DS;r(this,h),o(this,"_isMouseInteraction",!1),o(this,"_initialValArea",void 0),o(this,"_currentValArea",void 0),o(this,"_lastValArea",void 0),o(this,"_initialVal",void 0),o(this,"_currentVal",void 0),o(this,"_lastVal",void 0),o(this,"_lastTouch",void 0),o(this,"init",function(){document.addEventListener("mousemove",n.update),document.addEventListener("touchmove",n.update,{passive:!1})}),o(this,"getPointerPosition",function(d){return Gs({event:n._normalizedEvent(d)})}),o(this,"update",function(d){!d||(n.DS.publish("PointerStore:updated:pre",{event:d}),n.currentVal=n.getPointerPosition(d),n._isMouseInteraction&&n.DS.publish("PointerStore:updated",{event:d}))}),o(this,"stop",function(){document.removeEventListener("mousemove",n.update),document.removeEventListener("touchmove",n.update,{passive:!1}),setTimeout(function(){return n._isMouseInteraction=!1},100)}),o(this,"reset",function(d){!d||(n.currentVal=n.lastVal=n.getPointerPosition(d),n.stop(),n.init())}),this.DS=g,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(d){var v=d.event;return n.start(v)}),this.DS.subscribe("Interaction:end",function(d){var v=d.event;return n.reset(v)})}return s(h,[{key:"start",value:function(n){!n||(this._isMouseInteraction=!0,this.currentVal=this.initialVal=this.getPointerPosition(n))}},{key:"_normalizedEvent",value:function(n){return"touches"in n&&n.type!=="touchend"&&(this._lastTouch=n),"touches"in n?this._lastTouch.touches[0]:n}},{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(n){this._initialVal=n,this._initialValArea=n&&L(n,"-",L(P(this.DS.Area.rect),"+",P(this.DS.Area.computedBorder)))}},{key:"currentVal",get:function(){return this._currentVal?this._currentVal:{x:0,y:0}},set:function(n){this._currentVal=n,this._currentValArea=n&&L(n,"-",L(P(this.DS.Area.rect),"+",P(this.DS.Area.computedBorder)))}},{key:"lastVal",get:function(){return this._lastVal?this._lastVal:{x:0,y:0}},set:function(n){this._lastVal=n,this._lastValArea=n&&L(n,"-",L(P(this.DS.Area.rect),"+",P(this.DS.Area.computedBorder)))}}]),h}(),vl=function(){function h(l){var n=this,g=l.DS,d=l.areaElement,v=l.zoom;r(this,h),o(this,"_initialVal",void 0),o(this,"_currentVal",void 0),o(this,"_areaElement",void 0),o(this,"_canScroll",void 0),o(this,"init",function(){return n._areaElement.addEventListener("scroll",n.update)}),o(this,"start",function(){n._currentVal=n._initialVal=Se(n._areaElement),n._areaElement.addEventListener("scroll",n.update)}),o(this,"update",function(){return n._currentVal=Se(n._areaElement)}),o(this,"stop",function(){n._areaElement.removeEventListener("scroll",n.update),n._initialVal={x:0,y:0},n._canScroll=null}),o(this,"reset",function(){n.stop(),n.start()}),this._areaElement=d,this.DS=g,this.zoom=v,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(){return n.start()}),this.DS.subscribe("Interaction:end",function(){return n.reset()})}return s(h,[{key:"canScroll",get:function(){return typeof this._canScroll=="boolean"?this._canScroll:this._canScroll=Pe(this._areaElement)}},{key:"scrollAmount",get:function(){var n=L(this.currentVal,"-",this.initialVal),g=Y(this.zoom),d=L(L(n,"*",g),"-",n);return{x:n.x+d.x,y:n.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=Se(this._areaElement)),this._currentVal}}]),h}(),wl=function(){function h(l){var n=this,g=l.area,d=g===void 0?document:g,v=l.selectables,w=v===void 0?[]:v,_=l.autoScrollSpeed,k=_===void 0?5:_,V=l.overflowTolerance,D=V===void 0?{x:25,y:25}:V,T=l.zoom,I=T===void 0?1:T,W=l.customStyles,ne=W===void 0?!1:W,G=l.multiSelectMode,Ee=G===void 0?!1:G,Xe=l.multiSelectToggling,me=Xe===void 0?!0:Xe,rr=l.multiSelectKeys,_l=rr===void 0?["Control","Shift","Meta"]:rr,nr=l.selector,kl=nr===void 0?void 0:nr,or=l.draggability,yt=or===void 0?!0:or,ir=l.immediateDrag,xl=ir===void 0?!0:ir,ar=l.keyboardDrag,Sl=ar===void 0?!0:ar,Dl=l.dragKeys,sr=l.keyboardDragSpeed,El=sr===void 0?10:sr,lr=l.useTransform,cr=lr===void 0?!0:lr,dr=l.hoverClass,hr=dr===void 0?"ds-hover":dr,ur=l.selectableClass,mr=ur===void 0?"ds-selectable":ur,fr=l.selectedClass,Nl=fr===void 0?"ds-selected":fr,pr=l.selectorClass,Vl=pr===void 0?"ds-selector":pr,gr=l.selectorAreaClass,Cl=gr===void 0?"ds-selector-area":gr,Ml=l.callback,$l=l.onDragMove,Bl=l.onDragStartBegin,Tl=l.onDragStart,Al=l.onElementSelect,Ol=l.onElementUnselect;r(this,h),o(this,"continue",!1),o(this,"start",function(){n.stopped=!1,n.Interaction.init()}),o(this,"break",function(){return n.continue=!0}),o(this,"getSelection",function(){return n.SelectedSet.elements}),o(this,"getSelectables",function(){return n.SelectableSet.elements}),o(this,"getInitialCursorPosition",function(){return n.stores.PointerStore.initialVal}),o(this,"getCurrentCursorPosition",function(){return n.stores.PointerStore.currentVal}),o(this,"getPreviousCursorPosition",function(){return n.stores.PointerStore.lastVal}),o(this,"getInitialCursorPositionArea",function(){return n.stores.PointerStore.initialValArea}),o(this,"getCurrentCursorPositionArea",function(){return n.stores.PointerStore.currentValArea}),o(this,"getPreviousCursorPositionArea",function(){return n.stores.PointerStore.lastValArea}),o(this,"isMultiSelect",function(Pl){return n.stores.KeyStore.isMultiSelectKeyPressed(Pl)}),o(this,"isDragging",function(){return n.Interaction.isDragging}),this.PubSub=new hl({DS:this}),this.subscribe=this.PubSub.subscribe,this.unsubscribe=this.PubSub.unsubscribe,this.publish=this.PubSub.publish,this._callbacksTemp({callback:Ml,onDragMove:$l,onDragStart:Tl,onDragStartBegin:Bl,onElementSelect:Al,onElementUnselect:Ol}),this.stores={PointerStore:new bl({DS:this}),ScrollStore:new vl({DS:this,areaElement:d,zoom:I}),KeyStore:new yl({DS:this,multiSelectKeys:_l,multiSelectMode:Ee})},this.Area=new ll({area:d,PS:this.PubSub,zoom:I}),this.Selector=new pl({DS:this,selector:kl,selectorClass:Vl,customStyles:ne}),this.SelectorArea=new gl({DS:this,selectorAreaClass:Cl,autoScrollSpeed:k,overflowTolerance:D}),this.SelectableSet=new ul({elements:w,DS:this,className:mr,hoverClassName:hr,useTransform:cr,draggability:yt}),this.SelectedSet=new ml({DS:this,className:Nl}),this.Selection=new fl({DS:this,hoverClassName:hr,multiSelectToggling:me}),this.Drag=new cl({DS:this,draggability:yt,useTransform:cr,keyboardDrag:Sl,dragKeys:Object.assign({up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},Dl),zoom:I,keyboardDragSpeed:El}),this.Interaction=new dl({areaElement:d,DS:this,draggability:yt,immediateDrag:xl,selectableClass:mr}),sl({subscribe:this.subscribe,publish:this.publish,SelectedSet:this.SelectedSet,Interaction:this.Interaction}),this.subscribe("Interaction:end",function(){return n.continue=!1}),this.start()}return s(h,[{key:"_callbacksTemp",value:function(n){var g=n.callback,d=n.onDragMove,v=n.onDragStart,w=n.onDragStartBegin,_=n.onElementSelect,k=n.onElementUnselect,V=function(T,I){return console.warn("[DragSelect] ".concat(T,' is deprecated. Use DragSelect.subscribe("').concat(I,'", (callbackObject) => {}) instead. Act Now! See docs for more info'))};g&&(V("callback","callback"),this.subscribe("callback",function(D){var T=D.items;D.item;var I=D.event;return g(T,I)})),d&&(V("onDragMove","dragmove"),this.subscribe("dragmove",function(D){D.items,D.item;var T=D.event;return d(T)})),v&&(V("onDragStart","dragstart"),this.subscribe("dragstart",function(D){D.items,D.item;var T=D.event;return v(T)})),w&&(V("onDragStartBegin","dragstart"),this.subscribe("dragstart",function(D){D.items,D.item;var T=D.event;return w(T)})),_&&(V("onElementSelect","elementselect"),this.subscribe("elementselect",function(D){D.items;var T=D.item,I=D.event;return _(T,I)})),k&&(V("onElementUnselect","elementunselect"),this.subscribe("elementunselect",function(D){D.items;var T=D.item,I=D.event;return k(T,I)}))}},{key:"stop",value:function(){var n=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(n),this.stores.KeyStore.stop(),this.stores.PointerStore.stop(),this.stores.ScrollStore.stop(),n&&this.SelectableSet.clear(),g&&this.SelectedSet.clear(),this.stopped=!0}},{key:"addSelection",value:function(n){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(De(n)),d||this.addSelectables(n),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"removeSelection",value:function(n){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(De(n)),d&&this.removeSelectables(n),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(n){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 De(n).forEach(function(w){return g.SelectedSet.has(w)?g.removeSelection(n,d,v):g.addSelection(n,d,v)}),d&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"setSelection",value:function(n){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(n,g,d),this.getSelection()}},{key:"clearSelection",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.SelectedSet.clear(),n&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"addSelectables",value:function(n){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=De(n);return this.SelectableSet.addAll(d),g&&this.SelectedSet.addAll(d),n}},{key:"setSelectables",value:function(n){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(n,g),this.addSelectables(n,d)}},{key:"removeSelectables",value:function(n){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.SelectableSet.deleteAll(De(n)),g&&this.removeSelection(n),n}},{key:"getCursorPositionDifference",value:function(){var n=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=n?g?this.getPreviousCursorPositionArea():this.getPreviousCursorPosition():g?this.getInitialCursorPositionArea():this.getInitialCursorPosition();return L(d,"-",v)}}]),h}();return wl})})(vt);const qr=vt.exports,Gr=(a,t,r,i,s)=>(t=Math,r=t.log,i=1024,s=r(a)/r(i)|0,a/t.pow(i,s)).toFixed(0)+" "+(s?"KMGTPEZY"[--s]+"iB":"B"),Jr=(a,t="en-US")=>new Date(a*1e3).toLocaleString(t),Zr={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},Qr=[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)],en={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},tn=[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)],Le=Object.assign({name:"VFSortIcon"},{props:{direction:String},setup(a){return(t,r)=>(e.openBlock(),e.createElementBlock("div",null,[a.direction=="down"?(e.openBlock(),e.createElementBlock("svg",Zr,Qr)):e.createCommentVNode("",!0),a.direction=="up"?(e.openBlock(),e.createElementBlock("svg",en,tn)):e.createCommentVNode("",!0)]))}}),rn=["onClick"],nn=Object.assign({name:"VFToast.vue"},{setup(a){const t=e.inject("emitter"),{getStore:r}=e.inject("storage"),i=e.ref(r("full-screen",!1)),s=f=>f=="error"?"text-red-400 border-red-400":"text-lime-600 border-lime-600",o=e.ref([]),c=f=>{o.value.splice(f,1)},m=f=>{let p=o.value.findIndex(u=>u.id===f);p!==-1&&c(p)};return t.on("vf-toast-push",f=>{let p=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");f.id=p,o.value.push(f),setTimeout(()=>{m(p)},5e3)}),(f,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([i.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(o.value,(u,y)=>(e.openBlock(),e.createElementBlock("div",{onClick:b=>c(y),key:u,class:e.normalizeClass([s(u.type),"inline-block mx-auto my-0.5 py-0.5 px-2 min-w-max bg-gray-50 border text-xs rounded cursor-pointer"])},e.toDisplayString(u.label),11,rn))),128))]),_:1})],2))}}),fe=a=>Object.entries(a).map(t=>t.map(encodeURIComponent).join("=")).join("&"),{apiUrl:on}=ce(),Je=(a,t)=>on.value+"?"+fe({q:"preview",adapter:a,path:t}),an={class:"relative flex-auto flex flex-col overflow-hidden"},sn={key:0,class:"grid grid-cols-12 border-b border-neutral-300 dark:border-gray-700 text-xs select-none"},ln={class:"absolute"},cn=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),dn={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"},hn=["onDblclick","onTouchstart","onContextmenu","data-type","data-item","data-index"],un={class:"grid grid-cols-12 items-center"},mn={class:"flex col-span-7 items-center"},fn={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"},pn=[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)],gn={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"},yn=[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)],bn={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},vn={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},wn=["onDblclick","onTouchstart","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],_n={class:"grid grid-cols-12 items-center"},kn={class:"flex col-span-7 items-center"},xn={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"},Sn=[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)],Dn={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"},En=[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)],Nn={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Vn={class:"col-span-2 text-center"},Cn={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap"},Mn=["onDblclick","onTouchstart","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],$n={class:"relative"},Bn={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"},Tn=[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)],An=["src"],On={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"},Pn=[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)],jn={key:3,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},In={class:"break-all"},Ln=Object.assign({name:"VFExplorer"},{props:{view:String,data:Object,search:Object},setup(a){const t=a,r=e.inject("emitter"),{setStore:i,getStore:s}=e.inject("storage"),o=$=>$==null?void 0:$.substring(0,3),c=$=>$.replace(/((?=([\w\W]{0,14}))([\w\W]{8,})([\w\W]{8,}))/,"$2..$4"),m=e.ref(null),f=e.ref(null),p=e.ref(0),u=e.ref(null),{t:y}=e.inject("i18n"),b=Math.floor(Math.random()*2**32),N=e.ref(s("full-screen",!1));r.on("vf-fullscreen-toggle",()=>{N.value=!N.value,i("full-screen",N.value)});const S=e.ref("");r.on("vf-search-query",({newQuery:$})=>{S.value=$,$?r.emit("vf-fetch",{q:"search",adapter:t.data.adapter,path:t.data.dirname,filter:$}):r.emit("vf-fetch",{q:"index",adapter:t.data.adapter,path:t.data.dirname})});let E=null;const B=()=>{E&&clearTimeout(E)},A=$=>{E=setTimeout(()=>{O($)},500)},O=$=>{$.type=="dir"?(r.emit("vf-search-exit"),r.emit("vf-fetch",{q:"index",adapter:t.data.adapter,path:$.path})):r.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:$})},C=e.reactive({active:!1,column:"",order:""}),J=($=!0)=>{let j=[...t.data.files],M=C.column,L=C.order=="asc"?1:-1;if(!$)return j;const P=(q,Y)=>typeof q=="string"&&typeof Y=="string"?q.toLowerCase().localeCompare(Y.toLowerCase()):q<Y?-1:q>Y?1:0;return C.active&&(j=j.slice().sort((q,Y)=>P(q[M],Y[M])*L)),j},K=$=>{C.active&&C.column==$?(C.active=C.order=="asc",C.column=$,C.order="desc"):(C.active=!0,C.column=$,C.order="asc")},x=()=>u.value.getSelection().map($=>JSON.parse($.dataset.item)),R=($,j)=>{if($.altKey||$.ctrlKey||$.metaKey)return $.preventDefault(),!1;$.dataTransfer.setDragImage(f.value,0,15),$.dataTransfer.effectAllowed="all",$.dataTransfer.dropEffect="copy",$.dataTransfer.setData("items",JSON.stringify(x()))},F=($,j)=>{$.preventDefault();let M=JSON.parse($.dataTransfer.getData("items"));if(M.find(L=>L.storage!=s("adapter","local"))){alert("Moving items between different storages is not supported yet.");return}r.emit("vf-modal-show",{type:"move",items:{from:M,to:j}})},Q=($,j)=>{$.preventDefault(),!j||j.type!=="dir"||u.value.getSelection().find(M=>M==$.currentTarget)?($.dataTransfer.dropEffect="none",$.dataTransfer.effectAllowed="none"):$.dataTransfer.dropEffect="copy"},re=()=>{u.value=new qr({area:m.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),r.on("vf-explorer-update",()=>e.nextTick(()=>{u.value.clearSelection(),u.value.setSelectables(document.getElementsByClassName("vf-item-"+b))})),u.value.subscribe("predragstart",({event:$,isDragging:j})=>{if(j)p.value=u.value.getSelection().length,u.value.break();else{const M=$.target.offsetWidth-$.offsetX,L=$.target.offsetHeight-$.offsetY;M<15&&L<15&&(u.value.clearSelection(),u.value.break())}}),u.value.subscribe("predragmove",({isDragging:$})=>{$&&u.value.break()}),u.value.subscribe("callback",({items:$,event:j,isDragging:M})=>{r.emit("vf-nodes-selected",x()),p.value=u.value.getSelection().length})};return e.onMounted(re),e.onMounted(()=>{e.watch(()=>t.view,()=>r.emit("vf-explorer-update"))}),($,j)=>(e.openBlock(),e.createElementBlock("div",an,[a.view=="list"||S.value.length?(e.openBlock(),e.createElementBlock("div",sn,[e.createElementVNode("div",{onClick:j[0]||(j[0]=M=>K("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(Le,{direction:C.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,C.active&&C.column=="basename"]])]),S.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:j[1]||(j[1]=M=>K("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(Le,{direction:C.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,C.active&&C.column=="file_size"]])])),S.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:j[2]||(j[2]=M=>K("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(Le,{direction:C.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,C.active&&C.column=="last_modified"]])])),S.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:j[3]||(j[3]=M=>K("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(Le,{direction:C.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,C.active&&C.column=="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",ln,[e.createElementVNode("div",{ref_key:"dragImage",ref:f,class:"absolute -z-50 -top-96"},[cn,e.createElementVNode("div",dn,e.toDisplayString(p.value),1)],512)]),e.createElementVNode("div",{style:e.normalizeStyle(N.value?"height: 100%;":""),class:e.normalizeClass([N.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,onContextmenu:j[7]||(j[7]=e.withModifiers(M=>e.unref(r).emit("vf-contextmenu-show",{event:M,area:m.value,items:x()}),["self","prevent"]))},[S.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(J(),(M,L)=>(e.openBlock(),e.createElementBlock("div",{onDblclick:P=>O(M),onTouchstart:P=>A(M),onTouchend:j[4]||(j[4]=P=>B()),onContextmenu:e.withModifiers(P=>e.unref(r).emit("vf-contextmenu-show",{event:P,area:m.value,items:x(),target:M}),["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":M.type,"data-item":JSON.stringify(M),"data-index":L},[e.createElementVNode("div",un,[e.createElementVNode("div",mn,[M.type=="dir"?(e.openBlock(),e.createElementBlock("svg",fn,pn)):(e.openBlock(),e.createElementBlock("svg",gn,yn)),e.createElementVNode("span",bn,e.toDisplayString(M.basename),1)]),e.createElementVNode("div",vn,e.toDisplayString(M.path),1)])],42,hn))),256)):e.createCommentVNode("",!0),a.view=="list"&&!S.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(J(),(M,L)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:P=>O(M),onTouchstart:P=>A(M),onTouchend:j[5]||(j[5]=P=>B()),onContextmenu:e.withModifiers(P=>e.unref(r).emit("vf-contextmenu-show",{event:P,area:m.value,items:x(),target:M}),["prevent"]),onDragstart:P=>R(P),onDragover:P=>Q(P,M),onDrop:P=>F(P,M),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":M.type,"data-item":JSON.stringify(M),"data-index":L},[e.createElementVNode("div",_n,[e.createElementVNode("div",kn,[M.type=="dir"?(e.openBlock(),e.createElementBlock("svg",xn,Sn)):(e.openBlock(),e.createElementBlock("svg",Dn,En)),e.createElementVNode("span",Nn,e.toDisplayString(M.basename),1)]),e.createElementVNode("div",Vn,e.toDisplayString(M.file_size?e.unref(Gr)(M.file_size):""),1),e.createElementVNode("div",Cn,e.toDisplayString(e.unref(Jr)(M.last_modified)),1)])],42,wn))),256)):e.createCommentVNode("",!0),a.view=="grid"&&!S.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(J(!1),(M,L)=>{var P,q;return e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:Y=>O(M),onTouchstart:Y=>A(M),onTouchend:j[6]||(j[6]=Y=>B()),onContextmenu:e.withModifiers(Y=>e.unref(r).emit("vf-contextmenu-show",{event:Y,area:m.value,items:x(),target:M}),["prevent"]),onDragstart:Y=>R(Y),onDragover:Y=>Q(Y,M),onDrop:Y=>F(Y,M),class:e.normalizeClass(["vf-item-"+e.unref(b),"border border-transparent hover:bg-neutral-50 m-0.5 dark:hover:bg-gray-700 inline-flex w-[5.5rem] h-20 md:w-24 md:h-24 text-center justify-center select-none"]),"data-type":M.type,"data-item":JSON.stringify(M),"data-index":L},[e.createElementVNode("div",null,[e.createElementVNode("div",$n,[M.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Bn,Tn)):((P=M.mime_type)!=null?P:"").startsWith("image")?(e.openBlock(),e.createElementBlock("img",{key:1,class:"h-10 md:h-12 m-auto",src:e.unref(Je)(e.unref(s)("adapter",t.data.adapter),M.path),alt:""},null,8,An)):(e.openBlock(),e.createElementBlock("svg",On,Pn)),((q=M.mime_type)!=null?q:"").startsWith("image")?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",jn,e.toDisplayString(o(M.extension)),1))]),e.createElementVNode("span",In,e.toDisplayString(c(M.basename)),1)])],42,Mn)}),256)):e.createCommentVNode("",!0)],38),e.createVNode(nn)]))}}),zn={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},Rn={class:"flex leading-5 items-center"},Hn=["aria-label"],Un=[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)],Kn=["value"],Fn={class:"ml-3"},Yn={key:0},Wn={class:"ml-1"},Xn={class:"flex leading-5 items-center"},qn={value:"",disabled:""},Gn=e.createElementVNode("option",{value:"tr"},"Turkish",-1),Jn=e.createElementVNode("option",{value:"en"},"English",-1),Zn=e.createElementVNode("option",{value:"fr"},"French",-1),Qn=["aria-label"],eo=[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)],to=Object.assign({name:"VFStatusbar"},{props:{data:Object},setup(a){var b;const t=a,r=e.inject("emitter"),{getStore:i,setStore:s}=e.inject("storage"),o=e.ref(0),c=e.ref((b=i("adapter"))!=null?b:t.data.adapter),{t:m,changeLocale:f}=e.inject("i18n"),p=e.ref(i("locale","")),u=()=>{r.emit("vf-search-exit"),r.emit("vf-fetch",{q:"index",adapter:c.value}),s("adapter",c.value)};r.on("vf-nodes-selected",N=>{o.value=N.length});const y=e.ref("");return r.on("vf-search-query",({newQuery:N})=>{y.value=N}),(N,S)=>(e.openBlock(),e.createElementBlock("div",zn,[e.createElementVNode("div",Rn,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(m)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},Un,8,Hn),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S[0]||(S[0]=E=>c.value=E),onChange:u,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(a.data.storages,E=>(e.openBlock(),e.createElementBlock("option",{value:E},e.toDisplayString(E),9,Kn))),256))],544),[[e.vModelSelect,c.value]]),e.createElementVNode("div",Fn,[y.value.length?(e.openBlock(),e.createElementBlock("span",Yn,e.toDisplayString(a.data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",Wn,e.toDisplayString(o.value>0?o.value+" "+e.unref(m)("item(s) selected."):""),1)])]),e.createElementVNode("div",Xn,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S[1]||(S[1]=E=>p.value=E),onChange:S[2]||(S[2]=E=>e.unref(f)(E.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",qn,e.toDisplayString(e.unref(m)("Language")),1),Gn,Jn,Zn],544),[[e.vModelSelect,p.value]]),e.createElementVNode("span",{"aria-label":e.unref(m)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:S[3]||(S[3]=E=>e.unref(r).emit("vf-modal-show",{type:"message",title:"Vuefinder 1.0",message:e.unref(m)("Vuefinder is a file manager component for vue 3.")}))},eo,8,Qn)])]))}}),ro=(a,t=0,r=!1)=>{let i;return(...s)=>{r&&!i&&a(...s),clearTimeout(i),i=setTimeout(()=>{a(...s)},t)}},no=(a,t,r)=>{const i=e.ref(a);return e.customRef((o,c)=>({get(){return o(),i.value},set:ro(m=>{i.value=m,c()},t,r)}))},oo={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"},io=["aria-label"],ao=[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)],so=["onClick"],lo=[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)],co={class:"flex leading-5"},ho=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),uo=["title","onClick"],mo={key:1,class:"flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full"},fo=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),po=["onKeydown","placeholder"],go=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],yo=Object.assign({name:"VFBreadcrumb"},{props:{data:Object},setup(a){const t=a,r=e.inject("emitter"),{getStore:i}=e.inject("storage"),s=e.ref(null),o=e.ref([]),c=e.ref(!1),m=e.ref(null),{t:f}=e.inject("i18n");r.on("vf-explorer-update",()=>{var O;let B=[],A=[];s.value=(O=t.data.dirname)!=null?O:i("adapter","local")+"://",s.value.length==0&&(o.value=[]),s.value.replace(i("adapter","local")+"://","").split("/").forEach(function(C){B.push(C),B.join("/")!=""&&A.push({basename:C,name:C,path:i("adapter","local")+"://"+B.join("/"),type:"dir"})}),A.length>4&&(A=A.slice(-5),A[0].name=".."),o.value=A});const p=()=>{c.value=!1,y.value=""};r.on("vf-search-exit",()=>{p()});const u=()=>{c.value=!0,e.nextTick(()=>m.value.focus())},y=no("",400);e.watch(y,B=>{r.emit("vf-search-query",{newQuery:B})});const b=()=>o.value.length&&!c.value,N=B=>{var O;B.preventDefault();let A=JSON.parse(B.dataTransfer.getData("items"));if(A.find(C=>C.storage!=i("adapter","local"))){alert("Moving items between different storages is not supported yet.");return}r.emit("vf-modal-show",{type:"move",items:{from:A,to:(O=o.value[o.value.length-2])!=null?O:{path:i("adapter","local")+"://"}}})},S=B=>{B.preventDefault(),b()?B.dataTransfer.dropEffect="copy":(B.dataTransfer.dropEffect="none",B.dataTransfer.effectAllowed="none")},E=()=>{y.value==""&&p()};return(B,A)=>(e.openBlock(),e.createElementBlock("div",oo,[e.createElementVNode("span",{"aria-label":e.unref(f)("Go up a directory"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onDragover:A[0]||(A[0]=O=>S(O)),onDrop:A[1]||(A[1]=O=>N(O)),onClick:A[2]||(A[2]=O=>{var C,J;return!b()||e.unref(r).emit("vf-fetch",{q:"index",adapter:a.data.adapter,path:(J=(C=o.value[o.value.length-2])==null?void 0:C.path)!=null?J:e.unref(i)("adapter","local")+"://"})}),class:e.normalizeClass(["h-6 w-6 p-0.5 rounded",b()?"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"},ao,34))],8,io),c.value?(e.openBlock(),e.createElementBlock("div",mo,[fo,e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:m,onKeydown:e.withKeys(p,["esc"]),onBlur:E,"onUpdate:modelValue":A[4]||(A[4]=O=>e.isRef(y)?y.value=O:null),placeholder:e.unref(f)("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,po),[[e.vModelText,e.unref(y)]]),(e.openBlock(),e.createElementBlock("svg",{class:"w-6 h-6 cursor-pointer",onClick:p,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},go))])):(e.openBlock(),e.createElementBlock("div",{key:0,class:"group flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full",onClick:e.withModifiers(u,["self"])},[(e.openBlock(),e.createElementBlock("svg",{onClick:A[3]||(A[3]=O=>e.unref(r).emit("vf-fetch",{q:"index",adapter:a.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"},lo)),e.createElementVNode("div",co,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(O,C)=>(e.openBlock(),e.createElementBlock("div",{key:C},[ho,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:O.basename,onClick:J=>e.unref(r).emit("vf-fetch",{q:"index",adapter:a.data.adapter,path:O.path})},e.toDisplayString(O.name),9,uo)]))),128))])],8,so))]))}}),bo=["onClick"],vo=e.createElementVNode("span",{class:"px-1"},null,-1),wo=Object.assign({name:"VFContextMenu"},{props:{current:Object},setup(a){const t=a,r=e.inject("emitter"),i=e.ref(null),{apiUrl:s}=ce(),o=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),c=e.ref([]);r.on("vf-context-selected",b=>{c.value=b});const{t:m}=e.inject("i18n"),f={newfolder:{title:()=>m("New Folder"),action:()=>{r.emit("vf-modal-show",{type:"new-folder"})}},delete:{title:()=>m("Delete"),action:()=>{r.emit("vf-modal-show",{type:"delete",items:c})}},refresh:{title:()=>m("Refresh"),action:()=>{r.emit("vf-fetch",{q:"index",adapter:t.current.adapter,path:t.current.dirname})}},preview:{title:()=>m("Preview"),action:()=>{r.emit("vf-modal-show",{type:"preview",adapter:t.current.adapter,item:c.value[0]})}},open:{title:()=>m("Open"),action:()=>{r.emit("vf-search-exit"),r.emit("vf-fetch",{q:"index",adapter:t.current.adapter,path:c.value[0].path})}},openDir:{title:()=>m("Open containing folder"),action:()=>{r.emit("vf-search-exit"),r.emit("vf-fetch",{q:"index",adapter:t.current.adapter,path:c.value[0].dir})}},download:{title:()=>m("Download"),action:()=>{const b=s.value+"?"+fe({q:"download",adapter:c.value[0].adapter,path:c.value[0].path});r.emit("vf-download",b)}},archive:{title:()=>m("Archive"),action:()=>{r.emit("vf-modal-show",{type:"archive",items:c})}},unarchive:{title:()=>m("Unarchive"),action:()=>{r.emit("vf-modal-show",{type:"unarchive",items:c})}},rename:{title:()=>m("Rename"),action:()=>{r.emit("vf-modal-show",{type:"rename",items:c})}}},p=b=>{r.emit("vf-contextmenu-hide"),b.action()},u=e.ref("");r.on("vf-search-query",({newQuery:b})=>{u.value=b}),r.on("vf-contextmenu-show",({event:b,area:N,items:S,target:E=null})=>{if(o.items=[],u.value)if(E)o.items.push(f.openDir),r.emit("vf-context-selected",[E]);else return;else!E&&!u.value?(o.items.push(f.refresh),o.items.push(f.newfolder),r.emit("vf-context-selected",[]),console.log("no files selected")):S.length>1&&S.some(B=>B.path===E.path)?(o.items.push(f.refresh),o.items.push(f.archive),o.items.push(f.delete),r.emit("vf-context-selected",S),console.log(S.length+" selected (more than 1 item.)")):(E.type=="dir"?o.items.push(f.open):o.items.push(f.preview),o.items.push(f.rename),o.items.push(f.download),E.mime_type=="application/zip"?o.items.push(f.unarchive):o.items.push(f.archive),o.items.push(f.delete),r.emit("vf-context-selected",[E]),console.log(E.type+" is selected"));y(b,N)}),r.on("vf-contextmenu-hide",()=>{o.active=!1});const y=(b,N)=>{o.active=!0,e.nextTick(()=>{let S=N.getBoundingClientRect(),E=b.pageX,B=b.pageY,A=i.value.offsetHeight,O=i.value.offsetWidth;E=S.right-b.pageX+window.scrollX<O?E-O:E,B=S.bottom-b.pageY+window.scrollY<A?B-A:B,o.positions={left:E+"px",top:B+"px"}})};return(b,N)=>o.active?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"z-30 absolute text-xs bg-neutral-50 dark:bg-gray-800 dark:text-gray-200 border border-neutral-300 dark:border-gray-600 shadow rounded select-none",ref_key:"contextmenu",ref:i,style:e.normalizeStyle(o.positions)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.items,S=>(e.openBlock(),e.createElementBlock("li",{class:"px-2 py-1.5 cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",key:S.title,onClick:E=>p(S)},[vo,e.createElementVNode("span",null,e.toDisplayString(S.title()),1)],8,bo))),128))],4)):e.createCommentVNode("",!0)}}),_o=(a,t)=>{const r=a[t];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((i,s)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+t)))})};async function ko(a){const t=await _o(Object.assign({"../locales/en.json":()=>Promise.resolve().then(()=>Xs),"../locales/tr.json":()=>Promise.resolve().then(()=>qs)}),`../locales/${a}.json`);return JSON.parse(t.default)}function xo(a,t){const{getStore:r,setStore:i}=Ge(a),s=["en","tr"],o=e.ref({}),c=f=>{s.includes(f)||(console.log("The selected locale is not yet supported. The fallback language is set as 'en'"),f="en"),ko(f).then(p=>{o.value=p,i("locale",f),i("translations",p),console.log(f+" is loaded.")})};r("locale")?o.value=r("translations"):c(t);function m(f){return o.value.hasOwnProperty(f)?o.value[f]:""}return{t:m,support_locales:s,changeLocale:c}}const So=e.createElementVNode("iframe",{id:"download_frame",style:{display:"none"}},null,-1),Do=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"}},setup(a){const t=a,r=yr(),{setStore:i,getStore:s}=Ge(t.id);e.provide("emitter",r),e.provide("storage",Ge(t.id));const o=xo(t.id,t.locale);e.provide("i18n",o);const{apiUrl:c,setApiUrl:m}=ce();m(t.url);const f=e.reactive({adapter:"local",storages:[],dirname:".",files:[]}),p=e.ref(s("viewport","grid")),u=e.ref(s("darkMode",t.dark));r.on("vf-darkMode-toggle",()=>{u.value=!u.value,i("darkMode",u.value)});const y=e.ref(s("full-screen",!1));r.on("vf-fullscreen-toggle",()=>{y.value=!y.value,i("full-screen",y.value)}),r.on("vf-view-toggle",S=>{p.value=S});const b=e.reactive({active:!1,type:"delete",data:{}});r.on("vf-modal-close",()=>{b.active=!1}),r.on("vf-modal-show",S=>{b.active=!0,b.type=S.type,b.data=S});const N=S=>{Object.assign(f,S),r.emit("vf-nodes-selected",{}),r.emit("vf-explorer-update")};return r.on("vf-fetch",S=>{Ie(c.value,{params:S}).then(E=>{r.emit("vf-modal-close"),N(E)})}),r.on("vf-download",S=>{document.getElementById("download_frame").src=S,r.emit("vf-modal-close")}),e.onMounted(()=>{r.emit("vf-fetch",{q:"index",adapter:s("adapter",f.adapter)})}),(S,E)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(u.value?"dark":"")},[e.createElementVNode("div",{class:e.normalizeClass([y.value?"fixed w-screen inset-0 z-20":"relative","border flex flex-col rounded-md 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(y.value?"":"max-height: "+a.maxHeight),onMousedown:E[0]||(E[0]=B=>e.unref(r).emit("vf-contextmenu-hide"))},[e.createVNode(Wr,{data:f},null,8,["data"]),e.createVNode(yo,{data:f},null,8,["data"]),e.createVNode(Ln,{view:p.value,data:f},null,8,["view","data"]),e.createVNode(to,{data:f},null,8,["data"])],38),b.active?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("v-f-modal-"+b.type),{key:0,selection:b.data,current:f},null,8,["selection","current"])):e.createCommentVNode("",!0),e.createVNode(wo,{current:f},null,8,["current"]),So],2))}}),Eo=e.createElementVNode("div",{class:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"},null,-1),No={class:"fixed z-10 inset-0 overflow-y-auto"},Vo={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 sm:w-full"},Co={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Mo={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"},ae={__name:"ModalLayout",setup(a){const t=e.inject("emitter");return e.onMounted(()=>{const r=document.querySelector(".v-f-modal input");r&&r.focus()}),(r,i)=>(e.openBlock(),e.createElementBlock("div",{class:"v-f-modal relative z-30","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",onKeyup:i[1]||(i[1]=e.withKeys(s=>e.unref(t).emit("vf-modal-close"),["esc"])),tabindex:"0"},[Eo,e.createElementVNode("div",No,[e.createElementVNode("div",{class:"flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0",onMousedown:i[0]||(i[0]=e.withModifiers(s=>e.unref(t).emit("vf-modal-close"),["self"]))},[e.createElementVNode("div",Vo,[e.createElementVNode("div",Co,[e.renderSlot(r.$slots,"default")]),e.createElementVNode("div",Mo,[e.renderSlot(r.$slots,"buttons")])])],32)])],32))}},$o={class:"sm:flex sm:items-start"},Bo=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),To={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},Ao={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Oo={class:"mt-2"},Po={class:"text-sm text-gray-500"},jo={class:"flex text-sm text-gray-800 dark:text-gray-400"},Io={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"},Lo=[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)],zo={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"},Ro=[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)],Ho={class:"ml-1.5"},Uo={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},Ko=Object.assign({name:"VFModalDelete"},{props:{selection:Object,current:Object},setup(a){const t=a,r=e.inject("emitter"),{getStore:i}=e.inject("storage"),{t:s}=e.inject("i18n"),o=e.ref(t.selection.items),c=()=>{o.value.length&&r.emit("vf-fetch",{q:"delete",adapter:i("adapter","local"),path:t.current.dirname,items:JSON.stringify(o.value.map(({path:m,type:f})=>({path:m,type:f})))})};return(m,f)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,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[0]||(f[0]=p=>e.unref(r).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",Uo,e.toDisplayString(e.unref(s)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",$o,[Bo,e.createElementVNode("div",To,[e.createElementVNode("h3",Ao,e.toDisplayString(e.unref(s)("Delete files")),1),e.createElementVNode("div",Oo,[e.createElementVNode("p",Po,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(o.value,p=>(e.openBlock(),e.createElementBlock("p",jo,[p.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Io,Lo)):(e.openBlock(),e.createElementBlock("svg",zo,Ro)),e.createElementVNode("span",Ho,e.toDisplayString(p.basename),1)]))),256))])])])]),_:1}))}}),Fo={class:"sm:flex sm:items-start"},Yo=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),Wo={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},Xo={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},qo={class:"mt-2"},Go={class:"text-sm text-gray-500"},Jo=Object.assign({name:"VFModalMessage"},{props:{selection:Object},setup(a){const t=e.inject("emitter"),{t:r}=e.inject("i18n");return(i,s)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:s[0]||(s[0]=o=>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(r)("Close")),1)]),default:e.withCtx(()=>{var o,c,m,f;return[e.createElementVNode("div",Fo,[Yo,e.createElementVNode("div",Wo,[e.createElementVNode("h3",Xo,e.toDisplayString((c=(o=a.selection)==null?void 0:o.title)!=null?c:"Title"),1),e.createElementVNode("div",qo,[e.createElementVNode("p",Go,e.toDisplayString((f=(m=a.selection)==null?void 0:m.message)!=null?f:"Message")+".",1)])])])]}),_:1}))}}),Zo={class:"sm:flex sm:items-start"},Qo=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),ei={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ti={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ri={class:"mt-2"},ni={class:"text-sm text-gray-500"},oi=["onKeyup","placeholder"],ii=Object.assign({name:"VFModalNewFolder"},{props:{selection:Object,current:Object},setup(a){const t=a,r=e.inject("emitter"),{getStore:i}=e.inject("storage"),{t:s}=e.inject("i18n"),o=e.ref(""),c=()=>{o.value!=""&&(r.emit("vf-fetch",{q:"newfolder",adapter:i("adapter","local"),path:t.current.dirname,name:o.value}),r.emit("vf-toast-push",{label:"New Folder is created successfully",type:"success"}))};return(m,f)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,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)("Create")),1),e.createElementVNode("button",{type:"button",onClick:f[1]||(f[1]=p=>e.unref(r).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",Zo,[Qo,e.createElementVNode("div",ei,[e.createElementVNode("h3",ti,e.toDisplayString(e.unref(s)("New Folder")),1),e.createElementVNode("div",ri,[e.createElementVNode("p",ni,e.toDisplayString(e.unref(s)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=p=>o.value=p),onKeyup:e.withKeys(c,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-500 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,oi),[[e.vModelText,o.value]])])])])]),_:1}))}}),ai={class:"sm:flex sm:items-start"},si=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),li={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ci={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},di={class:"mt-2"},hi={class:"text-sm text-gray-500"},ui=["onKeyup","placeholder"],mi=Object.assign({name:"VFModalNewFile"},{props:{selection:Object,current:Object},setup(a){const t=a,r=e.inject("emitter"),{getStore:i}=e.inject("storage"),{t:s}=e.inject("i18n"),o=e.ref(""),c=()=>{o.value!=""&&r.emit("vf-fetch",{q:"newfile",adapter:i("adapter","local"),path:t.current.dirname,name:o.value})};return(m,f)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,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"},"Create!"),e.createElementVNode("button",{type:"button",onClick:f[1]||(f[1]=p=>e.unref(r).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",ai,[si,e.createElementVNode("div",li,[e.createElementVNode("h3",ci,e.toDisplayString(e.unref(s)("New File")),1),e.createElementVNode("div",di,[e.createElementVNode("p",hi,e.toDisplayString(e.unref(s)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=p=>o.value=p),onKeyup:e.withKeys(c,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-500 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,ui),[[e.vModelText,o.value]])])])])]),_:1}))}}),fi={class:"flex"},pi={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},gi={class:"ml-auto mb-2"},yi={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"},bi={key:1},vi={__name:"Text",props:{selection:Object},emits:["load"],setup(a,{emit:t}){const r=a,i=e.ref(""),s=e.ref(""),o=e.ref(null),c=e.ref(!1),{apiUrl:m}=ce(),{t:f}=e.inject("i18n");e.onMounted(()=>{Ie(m.value,{params:{q:"preview",adapter:r.selection.adapter,path:r.selection.item.path},json:!1}).then(y=>{i.value=y,t("load")})});const p=()=>{c.value=!c.value,s.value=i.value,c.value==!0&&e.nextTick(()=>{o.value.focus()})},u=()=>{Ie(m.value,{method:"POST",params:{q:"save",adapter:r.selection.adapter,path:r.selection.item.path,content:s.value},json:!1}).then(y=>{i.value=y,t("load"),c.value=!c.value}).catch(y=>console.log(y.statusText))};return(y,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",fi,[e.createElementVNode("div",pi,e.toDisplayString(a.selection.item.basename),1),e.createElementVNode("div",gi,[c.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:u,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(f)("Save")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:b[0]||(b[0]=N=>p())},e.toDisplayString(c.value?e.unref(f)("Cancel"):e.unref(f)("Edit")),1)])]),e.createElementVNode("div",null,[c.value?(e.openBlock(),e.createElementBlock("div",bi,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:o,"onUpdate:modelValue":b[1]||(b[1]=N=>s.value=N),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] text-xs",name:"text",id:"",cols:"30",rows:"10"},null,512),[[e.vModelText,s.value]])])):(e.openBlock(),e.createElementBlock("pre",yi,e.toDisplayString(i.value),1))])],64))}},vc="";/*!
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var L=function(l,n,g){var d=l.x,v=l.y,w=g.x,_=g.y,k={"+":{x:d+w,y:v+_},"-":{x:d-w,y:v-_},"*":{x:d*w,y:v*_},"/":{x:d/w,y:v/_}};return k[n]},P=function(l){return{x:l.left,y:l.top}},q=function(l){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return{left:l.x,top:l.y,right:l.x,bottom:l.y,width:n,height:n}},Y=function(l){return{x:l,y:l}},Oe=function(h,l,n){window.addEventListener("resize",l),window.addEventListener("scroll",l),h.forEach(function(g,d){n.observe(g,{childList:d!==0,attributes:!0})})},Pe=function(h){var l=Se(h);return l.x||l.y?!0:h instanceof HTMLDocument?h.body?!!(h.body.scrollTop=1):!!(h.documentElement.scrollTop=1):!!(h.scrollTop=1)},Fe=function(h){var l=document.createElement("div");return l.style.position="fixed",l.style.overflow="hidden",l.style.pointerEvents="none",l.style.zIndex="999999999999999999",l.classList.add(h),l},Ye=function(h){var l=document.createElement("div");return l.style.position="absolute",h||(l.style.background="rgba(0, 0, 255, 0.1)",l.style.border="1px solid rgba(0, 0, 255, 0.45)",l.style.display="none",l.style.pointerEvents="none"),l},We=function(h,l){var n;return function(){for(var g=arguments.length,d=new Array(g),v=0;v<g;v++)d[v]=arguments[v];var w=function(){n=null,h.apply(void 0,d)};clearTimeout(n),n=setTimeout(w,l)}},xe=function(){var h,l,n,g;return{y:((h=document.body)===null||h===void 0?void 0:h.scrollTop)||((l=document.documentElement)===null||l===void 0?void 0:l.scrollTop)||0,x:((n=document.body)===null||n===void 0?void 0:n.scrollLeft)||((g=document.documentElement)===null||g===void 0?void 0:g.scrollLeft)||0}},pt=function(h,l){if(h instanceof Document)return{top:0,left:0,bottom:0,right:0,width:window.innerWidth,height:window.innerHeight};var n=h.getBoundingClientRect();return{top:n.top,left:n.left,bottom:n.bottom,right:n.right,width:(h.clientWidth||n.width)*l,height:(h.clientHeight||n.height)*l}},Se=function(h){return!h||h instanceof Document?xe():{x:h.scrollLeft>=0?h.scrollLeft:xe().x,y:h.scrollTop>=0?h.scrollTop:xe().y}},Jt=function(h){var l=h.elementRect,n=h.containerRect,g=h.tolerance,d=g===void 0?{x:0,y:0}:g,v=[];return l.top-d.y<n.top&&v.push("top"),l.left-d.x<n.left&&v.push("left"),l.bottom+d.y>n.bottom&&v.push("bottom"),l.right+d.y>n.right&&v.push("right"),v},Gs=function(h){var l=h.event;return{x:l.clientX,y:l.clientY}},Js=function(h){var l=h.scrollAmount,n=h.initialPointerPos,g=h.pointerPos,d={};return g.x>n.x-l.x?(d.left=n.x-l.x,d.width=g.x-n.x+l.x):(d.left=g.x,d.width=n.x-g.x-l.x),g.y>n.y-l.y?(d.top=n.y-l.y,d.height=g.y-n.y+l.y):(d.top=g.y,d.height=n.y-g.y-l.y),d},Zt=function(l){var n={x:0,y:0},g=window.getComputedStyle(l);if(!g.transform||g.transform==="none")return n;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(",");n.x=parseInt(w[12])||0,n.y=parseInt(w[13])||0}return n}else{var _=g.transform.trim().match(/matrix\((.*?)\)/);if(_&&_.length){var k,V=(k=_[1])===null||k===void 0?void 0:k.split(",");n.x=parseInt(V[4])||0,n.y=parseInt(V[5])||0}return n}},Zs=function(l){var n=l.style.transform;if(!n||n.indexOf("translate")<0)return Zt(l);var g={x:0,y:0},d=n.trim().match(/translate[3dD]*?\(.*?\)/);if(d){var v,w=(v=d[0])===null||v===void 0?void 0:v.split("(");if(w){var _,k=(_=w[1])===null||_===void 0?void 0:_.split(",");g.x=parseInt(k[0])||0,g.y=parseInt(k[1])||0}}return!g.x&&!g.x?Zt(l):g},Qs=function(l){var n=l.style,g={x:parseInt(n.left)||0,y:parseInt(n.top)||0};if(!g.x&&!g.x){var d=window.getComputedStyle(l);return{x:parseInt(d.left)||0,y:parseInt(d.top)||0}}return g},el=function(h,l){return l?Zs(h):Qs(h)},tl=function(h){var l=h.element,n=h.edges,g=h.elementRect,d=h.containerRect,v=h.elementPos,w=h.useTransform;n.includes("top")&&je(l,{y:v.y+d.top-g.top,x:v.x},w),n.includes("left")&&je(l,{y:v.y,x:v.x+d.left-g.left},w),n.includes("bottom")&&je(l,{y:v.y+d.bottom-g.bottom,x:v.x},w),n.includes("right")&&je(l,{y:v.y,x:v.x+d.right-g.right},w)},Qt=function(h){var l=h.computedStyle,n=h.node,g=l.position,d=g==="absolute"||g==="relative"||g==="fixed";!(n instanceof HTMLDocument)&&!d&&(n.style.position="relative")},rl=function(h){var l=h.shiftKey,n=h.keyboardDragSpeed,g=h.zoom,d=h.key,v=h.dragKeys,w=h.scrollDiff,_=h.canScroll,k=h.scrollCallback,V={x:0,y:0},D=l?n*4*g:n*g;return v.left.includes(d)&&(V.x=w.x||-D,!l&&!w.x&&_&&k(["left"],n)),v.right.includes(d)&&(V.x=w.x||D,!l&&!w.x&&_&&k(["right"],n)),v.up.includes(d)&&(V.y=w.y||-D,!l&&!w.y&&_&&k(["top"],n)),v.down.includes(d)&&(V.y=w.y||D,!l&&!w.y&&_&&k(["bottom"],n)),V},nl=function(h){var l=h.element,n=h.force,g=h.multiSelectionToggle,d=h.SelectedSet,v=h.hoverClassName;l.classList.contains(v)&&!n||(d.has(l)?g&&d.delete(l):d.add(l),l.classList.add(v))},ol=function(h){var l=h.element,n=h.force,g=h.SelectedSet,d=h.PrevSelectedSet,v=h.hoverClassName;if(!l.classList.contains(v)&&!n)return!1;var w=g.has(l),_=d.has(l);w&&!_?g.delete(l):!w&&_&&g.add(l),l.classList.remove(v)},gt=function(h,l){return h.left<l.right&&h.right>l.left&&h.top<l.bottom&&h.bottom>l.top},er=function(h){var l=h.element,n=h.posDirection,g=h.containerRect,d=h.useTransform,v=el(l,d),w=L(v,"+",n);je(l,w,d);var _=l.getBoundingClientRect(),k=Jt({elementRect:_,containerRect:g});tl({element:l,edges:k,elementRect:_,containerRect:g,elementPos:w,useTransform:d})},il=function(h,l){window.removeEventListener("resize",l),window.removeEventListener("scroll",l),h.disconnect()},al=function(h,l,n){if(!!l.length){var g=document&&document.documentElement&&document.documentElement.scrollTop&&document.documentElement,d=h instanceof HTMLDocument?g||document.body:h,v=l.includes("top")&&d.scrollTop>0,w=l.includes("bottom")&&d.scrollTop<d.scrollHeight,_=l.includes("left")&&d.scrollLeft>0,k=l.includes("right")&&d.scrollLeft<d.scrollWidth;v&&(d.scrollTop-=1*n),w&&(d.scrollTop+=1*n),_&&(d.scrollLeft-=1*n),k&&(d.scrollLeft+=1*n)}},je=function(h,l,n){if(n){var g=h.style.transform;h.style.transform="translate3d(".concat(l.x,"px,").concat(l.y,"px,1px) ").concat(g.replace(/translate.*?\)/g,""))}else h.style.left="".concat(l.x,"px"),h.style.top="".concat(l.y,"px");return h},sl=function(h){for(var l=h.subscribe,n=h.publish,g=h.Interaction,d=h.SelectedSet,v={"Selected:added":[{name:"elementselect"}],"Selected:removed":[{name:"elementunselect"}],"Area:scroll":[{name:"autoscroll"}],"Interaction:start":[{name:"dragstart"}],"Interaction:update":[{name:"dragmove",condition:function(D){return D.event}}],"Interaction:end":[{name:"callback"}]},w=function(){var D=J(k[_],2),T=D[0],I=D[1];["pre",!1].forEach(function(W){return l(W?"".concat(T,":").concat(W):T,function(ne){return I.forEach(function(G){return(!G.condition||G.condition(ne))&&n(W?"".concat(W).concat(G.name):G.name,m({items:d.elements,isDragging:g.isDragging},ne))})})})},_=0,k=Object.entries(v);_<k.length;_++)w()},De=function(h){return h?!Array.isArray(h)&&(h instanceof HTMLElement||h instanceof SVGElement)?[h]:K(h):[]},tr=function(h,l){h.style.left="".concat(l.left,"px"),h.style.top="".concat(l.top,"px"),h.style.width="".concat(l.width,"px"),h.style.height="".concat(l.height,"px")},ll=function(){function h(l){var n=this,g=l.area,d=l.PS,v=l.zoom;r(this,h),o(this,"_modificationCallback",void 0),o(this,"_modificationObserver",void 0),o(this,"_zoom",void 0),o(this,"_node",void 0),o(this,"_parentNodes",void 0),o(this,"_computedStyle",void 0),o(this,"_computedBorder",void 0),o(this,"_rect",void 0),o(this,"setArea",function(w){n._node=w,Qt({computedStyle:n.computedStyle,node:n._node}),setTimeout(function(){n.PubSub.publish("Area:modified:pre",{item:n}),n.reset(),n.PubSub.publish("Area:modified",{item:n})})}),o(this,"start",function(){Oe(n.parentNodes,n._modificationCallback,n._modificationObserver)}),o(this,"reset",function(){n._computedStyle=void 0,n._rect=void 0,n._computedBorder=void 0,n._parentNodes=void 0}),o(this,"stop",function(){il(n._modificationObserver,n._modificationCallback),n.reset()}),o(this,"scroll",function(w,_){var k={scroll_directions:w,scroll_multiplier:_};n.PubSub.publish("Area:scroll:pre",k),al(n._node,w,_),n.PubSub.publish("Area:scroll",k)}),this._zoom=v,this.PubSub=d,this.setArea(g),this._modificationCallback=We(function(w){n.PubSub.publish("Area:modified:pre",{event:w,item:n}),n.reset(),n.PubSub.publish("Area:modified",{event:w,item:n})},60),this._modificationObserver=new MutationObserver(this._modificationCallback),this.PubSub.subscribe("Interaction:init",this.start),this.PubSub.subscribe("Interaction:end",this.reset)}return s(h,[{key:"HTMLNode",get:function(){return this._node}},{key:"computedBorder",get:function(){return this._computedBorder?this._computedBorder:{top:parseInt(this.computedStyle.borderTopWidth),bottom:parseInt(this.computedStyle.borderBottomWidth),left:parseInt(this.computedStyle.borderLeftWidth),right:parseInt(this.computedStyle.borderRightWidth)}}},{key:"computedStyle",get:function(){return this._computedStyle?this._computedStyle:this.HTMLNode instanceof HTMLDocument?this._computedStyle=window.getComputedStyle(this.HTMLNode.body||this.HTMLNode.documentElement):this._computedStyle=window.getComputedStyle(this.HTMLNode)}},{key:"rect",get:function(){return this._rect?this._rect:this._rect=pt(this.HTMLNode,this._zoom)}},{key:"parentNodes",get:function(){if(this._parentNodes)return this._parentNodes;var n=function g(d){var v,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,_=(v=d[w])===null||v===void 0?void 0:v.parentNode;return _?(d.push(_),w++,g(d,w)):d};return this._parentNodes=n([this.HTMLNode]),this._parentNodes}}]),h}(),cl=function(){function h(l){var n=this,g=l.DS,d=l.dragKeys,v=l.draggability,w=l.keyboardDrag,_=l.keyboardDragSpeed,k=l.useTransform,V=l.zoom;r(this,h),o(this,"_useTransform",void 0),o(this,"_prevCursorPos",void 0),o(this,"_prevScrollPos",void 0),o(this,"_elements",[]),o(this,"_draggability",void 0),o(this,"_dragKeys",void 0),o(this,"_dragKeysFlat",void 0),o(this,"_keyboardDrag",void 0),o(this,"_keyboardDragSpeed",void 0),o(this,"_zoom",void 0),o(this,"keyboardDrag",function(D){var T=D.event,I=D.key;if(!(!n._keyboardDrag||!n._dragKeysFlat.includes(I)||!n.DS.SelectedSet.size||!n._draggability||n.DS.continue)){var W={event:T,isDragging:!0,isDraggingKeyboard:!0};n.DS.publish(["Interaction:start:pre","Interaction:start"],W),n._elements=n.DS.getSelection(),n.handleZIndex(!0);var ne=rl({shiftKey:n.DS.stores.KeyStore.currentValues.includes("shift"),keyboardDragSpeed:n._keyboardDragSpeed,zoom:n._zoom,key:I,scrollCallback:n.DS.Area.scroll,scrollDiff:n._scrollDiff,canScroll:n.DS.stores.ScrollStore.canScroll,dragKeys:n._dragKeys});n._elements.forEach(function(G){return er({element:G,posDirection:ne,containerRect:n.DS.SelectorArea.rect,useTransform:n._useTransform})}),n.DS.publish(["Interaction:update:pre","Interaction:update"],W)}}),o(this,"keyboardEnd",function(D){var T=D.event,I=D.key;if(!(!n._keyboardDrag||!n._dragKeysFlat.includes(I)||!n.DS.SelectedSet.size||!n._draggability)){var W={event:T,isDragging:n._draggability,isDraggingKeyboard:!0};n.DS.publish(["Interaction:end:pre","Interaction:end"],W)}}),o(this,"start",function(D){var T=D.isDragging,I=D.isDraggingKeyboard;!T||I||(n._prevCursorPos=null,n._prevScrollPos=null,n._elements=n.DS.getSelection(),n.handleZIndex(!0))}),o(this,"stop",function(D){D!=null&&D.isKeyboard||(n._prevCursorPos=null,n._prevScrollPos=null,n.handleZIndex(!1),n._elements=[])}),o(this,"update",function(D){var T=D.isDragging,I=D.isDraggingKeyboard;if(!(!T||!n._elements.length||I||n.DS.continue)){var W=L(n._cursorDiff,"+",n._scrollDiff);n._elements.forEach(function(ne){return er({element:ne,posDirection:W,containerRect:n.DS.SelectorArea.rect,useTransform:n._useTransform})})}}),o(this,"handleZIndex",function(D){n._elements.forEach(function(T){return T.style.zIndex="".concat((parseInt(T.style.zIndex)||0)+D?9999:-9998)})}),this.DS=g,this._useTransform=k,this._keyboardDragSpeed=_,this._keyboardDrag=w,this._zoom=V,this._draggability=v,this._dragKeys={up:d.up.map(function(D){return D.toLowerCase()}),down:d.down.map(function(D){return D.toLowerCase()}),left:d.left.map(function(D){return D.toLowerCase()}),right:d.right.map(function(D){return D.toLowerCase()})},this._dragKeysFlat=[].concat(K(this._dragKeys.up),K(this._dragKeys.down),K(this._dragKeys.left),K(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(h,[{key:"_cursorDiff",get:function(){var n=this.DS.stores.PointerStore.currentVal,g=this._prevCursorPos?L(n,"-",this._prevCursorPos):{x:0,y:0};return this._prevCursorPos=n,g}},{key:"_scrollDiff",get:function(){var n=this.DS.stores.ScrollStore.currentVal,g=this._prevScrollPos?L(n,"-",this._prevScrollPos):{x:0,y:0};return this._prevScrollPos=n,g}}]),h}(),dl=function(){function h(l){var n=this,g=l.DS,d=l.areaElement,v=l.draggability,w=l.immediateDrag,_=l.selectableClass;r(this,h),o(this,"_areaElement",void 0),o(this,"_draggability",void 0),o(this,"_immediateDrag",void 0),o(this,"_selectableClass",void 0),o(this,"isInteracting",void 0),o(this,"isDragging",void 0),o(this,"init",function(){return n.DS.publish("Interaction:init:pre",{})}),o(this,"_init",function(){n.stop(),n._areaElement.addEventListener("mousedown",n.start),n._areaElement.addEventListener("touchstart",n.start,{passive:!1}),n.DS.publish("Interaction:init",{})}),o(this,"start",function(k){return n.DS.publish("Interaction:start:pre",{event:k,isDragging:n.isDragging})}),o(this,"_start",function(k){k.type==="touchstart"&&k.preventDefault(),n._canInteract(k)&&(n.isInteracting=!0,n.isDragging=n.isDragEvent(k),n.DS.publish("Interaction:start",{event:k,isDragging:n.isDragging}),document.addEventListener("mouseup",n.reset),document.addEventListener("touchend",n.reset))}),o(this,"isDragEvent",function(k){var V=k.target.closest(".".concat(n._selectableClass));return!n._draggability||n.DS.stores.KeyStore.isMultiSelectKeyPressed(k)||!V?!1:(n._immediateDrag&&(n.DS.SelectedSet.size?n.DS.SelectedSet.has(V)||(n.DS.SelectedSet.clear(),n.DS.SelectedSet.add(V)):n.DS.SelectedSet.add(V)),!!n.DS.SelectedSet.has(V))}),o(this,"onClick",function(k){var V=k.event;if(!!n._canInteract(V)&&!(V.detail>0)){var D=n.DS,T=D.stores,I=T.PointerStore,W=T.KeyStore,ne=D.SelectableSet,G=D.SelectedSet;I.start(V);var Ee=V.target;!ne.has(Ee)||(W.isMultiSelectKeyPressed(V)||G.clear(),G.toggle(Ee),n.reset())}}),o(this,"stop",function(){n.isInteracting=!1,n.isDragging=!1,n._areaElement.removeEventListener("mousedown",n.start),n._areaElement.removeEventListener("touchstart",n.start,{passive:!1}),document.removeEventListener("mouseup",n.reset),document.removeEventListener("touchend",n.reset)}),o(this,"update",function(k){var V=k.event,D=k.scroll_directions,T=k.scroll_multiplier;n.isInteracting&&n.DS.publish(["Interaction:update:pre","Interaction:update"],{event:V,scroll_directions:D,scroll_multiplier:T,isDragging:n.isDragging})}),o(this,"reset",function(k){return n.DS.publish("Interaction:end:pre",{event:k,isDragging:n.isDragging})}),o(this,"_reset",function(k){var V=n.isDragging;n.stop(),n.init(),n.DS.publish("Interaction:end",{event:k,isDragging:V})}),this._areaElement=d,this._draggability=v,this._immediateDrag=w,this._selectableClass=_,this.DS=g,this.DS.subscribe("PointerStore:updated",this.update),this.DS.subscribe("Selectable:click",this.onClick),this.DS.subscribe("Selectable:pointer",function(k){var V=k.event;return n.start(V)}),this.DS.subscribe("Interaction:start:pre",function(k){var V=k.event;return n._start(V)}),this.DS.subscribe("Interaction:init:pre",this._init),this.DS.subscribe("Interaction:end:pre",function(k){var V=k.event;return n._reset(V)}),this.DS.subscribe("Area:scroll",this.update)}return s(h,[{key:"_canInteract",value:function(n){var g=n.clientX===0&&n.clientY===0&&n.detail===0&&n.target;return!(n.button===2||this.isInteracting||n.target&&!this.DS.SelectorArea.isInside(n.target)||!g&&!this.DS.SelectorArea.isClicked(n))}}]),h}(),hl=function h(l){var n=this,g=l.DS;r(this,h),o(this,"subscribers",{}),o(this,"subscribe",function(d,v){return Array.isArray(n.subscribers[d])||(n.subscribers[d]=[]),n.subscribers[d].push(v),n.subscribers[d].length-1}),o(this,"unsubscribe",function(d,v,w){w>=0?n.subscribers[d].splice(w,1):v&&(n.subscribers[d]=n.subscribers[d].filter(function(_){return _!==v}))}),o(this,"publish",function(d,v){Array.isArray(d)?d.forEach(function(w){return n._publish(w,v)}):n._publish(d,v)}),o(this,"_publish",function(d,v){var w=n.subscribers[d];!Array.isArray(w)||(d.includes(":pre")?n._handlePrePublish(w,v):n._handlePublish(w,v))}),o(this,"_handlePublish",function(d,v){for(var w=0,_=d.length;w<_;w++){if(n.DS.stopped)return;d[w](v)}}),o(this,"_handlePrePublish",function(d,v){for(var w=d.length;w--;){if(n.DS.stopped)return;d[w](v)}}),this.DS=g},ul=function(h){f(n,h);var l=A(n);function n(g){var d,v=g.elements,w=g.className,_=g.hoverClassName,k=g.draggability,V=g.useTransform,D=g.DS;return r(this,n),d=l.call(this),o(E(d),"_initElements",void 0),o(E(d),"_className",void 0),o(E(d),"_hoverClassName",void 0),o(E(d),"_useTransform",void 0),o(E(d),"_draggability",void 0),o(E(d),"init",function(){return d._initElements.forEach(function(T){return d.add(T)})}),o(E(d),"clear",function(){return d.forEach(function(T){return d.delete(T)})}),o(E(d),"_onClick",function(T){return d.DS.publish(["Selectable:click:pre","Selectable:click"],{event:T})}),o(E(d),"_onPointer",function(T){return d.DS.publish(["Selectable:pointer:pre","Selectable:pointer"],{event:T})}),o(E(d),"addAll",function(T){return T.forEach(function(I){return d.add(I)})}),o(E(d),"deleteAll",function(T){return T.forEach(function(I){return d.delete(I)})}),d.DS=D,d._initElements=De(v),d._className=w,d._hoverClassName=_,d._useTransform=V,d._draggability=k,d.DS.subscribe("Interaction:init",d.init),d}return s(n,[{key:"add",value:function(d){return d.classList.add(this._className),d.addEventListener("click",this._onClick),d.addEventListener("mousedown",this._onPointer),d.addEventListener("touchstart",this._onPointer,{passive:!1}),this._draggability&&!this._useTransform&&Qt({computedStyle:window.getComputedStyle(d),node:d}),C(p(n.prototype),"add",this).call(this,d)}},{key:"delete",value:function(d){return d.classList.remove(this._className),d.classList.remove(this._hoverClassName),d.removeEventListener("click",this._onClick),d.removeEventListener("mousedown",this._onPointer),d.removeEventListener("touchstart",this._onPointer,{passive:!1}),C(p(n.prototype),"delete",this).call(this,d)}},{key:"elements",get:function(){return Array.from(this.values())}}]),n}(S(Set)),ml=function(h){f(n,h);var l=A(n);function n(g){var d,v=g.className,w=g.DS;return r(this,n),d=l.call(this),o(E(d),"_className",void 0),o(E(d),"clear",function(){return d.forEach(function(_){return d.delete(_)})}),o(E(d),"addAll",function(_){return _.forEach(function(k){return d.add(k)})}),o(E(d),"deleteAll",function(_){return _.forEach(function(k){return d.delete(k)})}),d.DS=w,d._className=v,d}return s(n,[{key:"add",value:function(d){if(!C(p(n.prototype),"has",this).call(this,d)){var v={items:this.elements,item:d};return this.DS.publish("Selected:added:pre",v),C(p(n.prototype),"add",this).call(this,d),d.classList.add(this._className),d.style.zIndex="".concat((parseInt(d.style.zIndex)||0)+1),this.DS.publish("Selected:added",v),this}}},{key:"delete",value:function(d){if(!!C(p(n.prototype),"has",this).call(this,d)){var v={items:this.elements,item:d};this.DS.publish("Selected:removed:pre",v);var w=C(p(n.prototype),"delete",this).call(this,d);return d.classList.remove(this._className),d.style.zIndex="".concat((parseInt(d.style.zIndex)||0)-1),this.DS.publish("Selected:removed",v),w}}},{key:"toggle",value:function(d){return this.has(d)?this.delete(d):this.add(d),d}},{key:"elements",get:function(){return Array.from(this.values())}}]),n}(S(Set)),fl=function(){function h(l){var n=this,g=l.DS,d=l.hoverClassName,v=l.multiSelectToggling;r(this,h),o(this,"_prevSelectedSet",void 0),o(this,"_hoverClassName",void 0),o(this,"_multiSelectToggling",void 0),o(this,"start",function(w){var _=w.event,k=w.isDragging;k||(n._storePrevious(_),n._handleInsideSelection(!0,_))}),o(this,"update",function(w){var _=w.isDragging;_||n.DS.continue||n._handleInsideSelection()}),o(this,"_handleInsideSelection",function(w,_){for(var k=n.DS,V=k.SelectableSet,D=k.SelectorArea,T=k.Selector,I=V.elements.map(function(me){return[me,me.getBoundingClientRect()]}),W=[],ne=[],G=0,Ee=I.length;G<Ee;G++)!D.isInside(I[G][0],I[G][1])||(gt(I[G][1],T.rect)?W.push(I[G][0]):ne.push(I[G][0]));var Xe=n.DS.stores.KeyStore.isMultiSelectKeyPressed(_)&&n._multiSelectToggling;n.DS.continue||(W.forEach(function(me){return nl({element:me,force:w,multiSelectionToggle:Xe,SelectedSet:n.DS.SelectedSet,hoverClassName:n._hoverClassName})}),ne.forEach(function(me){return ol({element:me,force:w,SelectedSet:n.DS.SelectedSet,hoverClassName:n._hoverClassName,PrevSelectedSet:n._prevSelectedSet})}))}),this._hoverClassName=d,this._multiSelectToggling=v,this.DS=g,this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update)}return s(h,[{key:"_storePrevious",value:function(n){var g=this.DS,d=g.stores.KeyStore,v=g.SelectedSet;d.isMultiSelectKeyPressed(n)?this._prevSelectedSet=new Set(v):this._prevSelectedSet=new Set}}]),h}(),pl=function(){function h(l){var n=this,g=l.DS,d=l.selector,v=l.selectorClass,w=l.customStyles;r(this,h),o(this,"_rect",void 0),o(this,"start",function(_){var k=_.isDragging;if(!k){var V=n.DS.stores.PointerStore,D=V.initialValArea;tr(n.HTMLNode,q(D,1)),n.HTMLNode.style.display="block",n._rect=null}}),o(this,"stop",function(){n.HTMLNode.style.width="0",n.HTMLNode.style.height="0",n.HTMLNode.style.display="none"}),o(this,"update",function(_){var k=_.isDragging;if(!(k||n.DS.continue)){var V=n.DS.stores,D=V.ScrollStore,T=V.PointerStore,I=Js({scrollAmount:D.scrollAmount,initialPointerPos:T.initialValArea,pointerPos:T.currentValArea});tr(n.HTMLNode,I),n._rect=null}}),this.DS=g,this.HTMLNode=d||Ye(w),this.HTMLNode.classList.add(v),this.DS.subscribe("Interaction:start",this.start),this.DS.subscribe("Interaction:update",this.update),this.DS.subscribe("Interaction:end",this.stop)}return s(h,[{key:"rect",get:function(){return this._rect?this._rect:this._rect=this.HTMLNode.getBoundingClientRect()}}]),h}(),gl=function(){function h(l){var n=this,g=l.DS,d=l.selectorAreaClass,v=l.autoScrollSpeed,w=l.overflowTolerance;r(this,h),o(this,"_autoScrollSpeed",void 0),o(this,"_scrollInterval",void 0),o(this,"_rect",void 0),o(this,"currentEdges",[]),o(this,"_overflowTolerance",void 0),o(this,"start",function(){return n.applyElements("append")}),o(this,"applyElements",function(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"append",k=document.body?"body":"documentElement",V="".concat(_,"Child");n.HTMLNode[V](n.DS.Selector.HTMLNode),document[k][V](n.HTMLNode)}),o(this,"updatePos",function(){n._rect=null;var _=n.DS.Area.rect,k=n.DS.Area.computedBorder,V=n.HTMLNode.style,D="".concat(_.top+k.top,"px"),T="".concat(_.left+k.left,"px"),I="".concat(_.width,"px"),W="".concat(_.height,"px");V.top!==D&&(V.top=D),V.left!==T&&(V.left=T),V.width!==I&&(V.width=I),V.height!==W&&(V.height=W)}),o(this,"stop",function(_){n.stopAutoScroll(),_&&n.applyElements("remove")}),o(this,"startAutoScroll",function(){n.currentEdges=[],n._scrollInterval=setInterval(function(){return n.handleAutoScroll()},16)}),o(this,"handleAutoScroll",function(){if(!n.DS.continue){var _=n.DS,k=_.stores.PointerStore,V=_.Area;n.currentEdges=Jt({elementRect:q(k.currentVal),containerRect:n.rect,tolerance:n._overflowTolerance}),n.currentEdges.length&&V.scroll(n.currentEdges,n._autoScrollSpeed)}}),o(this,"stopAutoScroll",function(){n.currentEdges=[],clearInterval(n._scrollInterval)}),o(this,"isInside",function(_,k){return n.DS.Area.HTMLNode.contains(_)&&n.DS.stores.ScrollStore.canScroll?!0:gt(n.rect,k||_.getBoundingClientRect())}),this._autoScrollSpeed=v,this._overflowTolerance=w,this.DS=g,this.HTMLNode=Fe(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(){n.updatePos(),n.stopAutoScroll()})}return s(h,[{key:"isClicked",value:function(n){var g=this.DS.stores.PointerStore,d=n?g.getPointerPosition(n):g.initialVal;return gt({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()}}]),h}(),yl=function(){function h(l){var n=this,g=l.DS,d=l.multiSelectKeys,v=l.multiSelectMode;r(this,h),o(this,"_multiSelectMode",void 0),o(this,"_multiSelectKeys",void 0),o(this,"_currentValues",new Set),o(this,"_keyMapping",{control:"ctrlKey",shift:"shiftKey",meta:"metaKey"}),o(this,"init",function(){document.addEventListener("keydown",n.keydown),document.addEventListener("keyup",n.keyup),window.addEventListener("blur",n.reset)}),o(this,"keydown",function(w){var _=w.key.toLowerCase();n.DS.publish("KeyStore:down:pre",{event:w,key:_}),n._currentValues.add(_),n.DS.publish("KeyStore:down",{event:w,key:_})}),o(this,"keyup",function(w){var _=w.key.toLowerCase();n.DS.publish("KeyStore:up:pre",{event:w,key:_}),n._currentValues.delete(_),n.DS.publish("KeyStore:up",{event:w,key:_})}),o(this,"stop",function(){document.removeEventListener("keydown",n.keydown),document.removeEventListener("keyup",n.reset),window.removeEventListener("blur",n.reset),n.reset()}),o(this,"reset",function(){return n._currentValues.clear()}),this.DS=g,this._multiSelectMode=v,this._multiSelectKeys=d.map(function(w){var _={ctrlKey:"Control",shiftKey:"Shift",metaKey:"Meta"},k=_[w];return k?(console.warn("[DragSelect] ".concat(w,' is deprecated. Use "').concat(k,'" instead. Act Now!. See docs for more info')),k.toLowerCase()):w.toLowerCase()}),this.DS.subscribe("Interaction:init",this.init)}return s(h,[{key:"isMultiSelectKeyPressed",value:function(n){var g=this;return!!(this._multiSelectMode||this.currentValues.some(function(d){return g._multiSelectKeys.includes(d)})||n&&this._multiSelectKeys.some(function(d){return n[g._keyMapping[d]]}))}},{key:"currentValues",get:function(){return Array.from(this._currentValues.values())}}]),h}(),bl=function(){function h(l){var n=this,g=l.DS;r(this,h),o(this,"_isMouseInteraction",!1),o(this,"_initialValArea",void 0),o(this,"_currentValArea",void 0),o(this,"_lastValArea",void 0),o(this,"_initialVal",void 0),o(this,"_currentVal",void 0),o(this,"_lastVal",void 0),o(this,"_lastTouch",void 0),o(this,"init",function(){document.addEventListener("mousemove",n.update),document.addEventListener("touchmove",n.update,{passive:!1})}),o(this,"getPointerPosition",function(d){return Gs({event:n._normalizedEvent(d)})}),o(this,"update",function(d){!d||(n.DS.publish("PointerStore:updated:pre",{event:d}),n.currentVal=n.getPointerPosition(d),n._isMouseInteraction&&n.DS.publish("PointerStore:updated",{event:d}))}),o(this,"stop",function(){document.removeEventListener("mousemove",n.update),document.removeEventListener("touchmove",n.update,{passive:!1}),setTimeout(function(){return n._isMouseInteraction=!1},100)}),o(this,"reset",function(d){!d||(n.currentVal=n.lastVal=n.getPointerPosition(d),n.stop(),n.init())}),this.DS=g,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(d){var v=d.event;return n.start(v)}),this.DS.subscribe("Interaction:end",function(d){var v=d.event;return n.reset(v)})}return s(h,[{key:"start",value:function(n){!n||(this._isMouseInteraction=!0,this.currentVal=this.initialVal=this.getPointerPosition(n))}},{key:"_normalizedEvent",value:function(n){return"touches"in n&&n.type!=="touchend"&&(this._lastTouch=n),"touches"in n?this._lastTouch.touches[0]:n}},{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(n){this._initialVal=n,this._initialValArea=n&&L(n,"-",L(P(this.DS.Area.rect),"+",P(this.DS.Area.computedBorder)))}},{key:"currentVal",get:function(){return this._currentVal?this._currentVal:{x:0,y:0}},set:function(n){this._currentVal=n,this._currentValArea=n&&L(n,"-",L(P(this.DS.Area.rect),"+",P(this.DS.Area.computedBorder)))}},{key:"lastVal",get:function(){return this._lastVal?this._lastVal:{x:0,y:0}},set:function(n){this._lastVal=n,this._lastValArea=n&&L(n,"-",L(P(this.DS.Area.rect),"+",P(this.DS.Area.computedBorder)))}}]),h}(),vl=function(){function h(l){var n=this,g=l.DS,d=l.areaElement,v=l.zoom;r(this,h),o(this,"_initialVal",void 0),o(this,"_currentVal",void 0),o(this,"_areaElement",void 0),o(this,"_canScroll",void 0),o(this,"init",function(){return n._areaElement.addEventListener("scroll",n.update)}),o(this,"start",function(){n._currentVal=n._initialVal=Se(n._areaElement),n._areaElement.addEventListener("scroll",n.update)}),o(this,"update",function(){return n._currentVal=Se(n._areaElement)}),o(this,"stop",function(){n._areaElement.removeEventListener("scroll",n.update),n._initialVal={x:0,y:0},n._canScroll=null}),o(this,"reset",function(){n.stop(),n.start()}),this._areaElement=d,this.DS=g,this.zoom=v,this.DS.subscribe("Interaction:init",this.init),this.DS.subscribe("Interaction:start",function(){return n.start()}),this.DS.subscribe("Interaction:end",function(){return n.reset()})}return s(h,[{key:"canScroll",get:function(){return typeof this._canScroll=="boolean"?this._canScroll:this._canScroll=Pe(this._areaElement)}},{key:"scrollAmount",get:function(){var n=L(this.currentVal,"-",this.initialVal),g=Y(this.zoom),d=L(L(n,"*",g),"-",n);return{x:n.x+d.x,y:n.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=Se(this._areaElement)),this._currentVal}}]),h}(),wl=function(){function h(l){var n=this,g=l.area,d=g===void 0?document:g,v=l.selectables,w=v===void 0?[]:v,_=l.autoScrollSpeed,k=_===void 0?5:_,V=l.overflowTolerance,D=V===void 0?{x:25,y:25}:V,T=l.zoom,I=T===void 0?1:T,W=l.customStyles,ne=W===void 0?!1:W,G=l.multiSelectMode,Ee=G===void 0?!1:G,Xe=l.multiSelectToggling,me=Xe===void 0?!0:Xe,rr=l.multiSelectKeys,_l=rr===void 0?["Control","Shift","Meta"]:rr,nr=l.selector,kl=nr===void 0?void 0:nr,or=l.draggability,yt=or===void 0?!0:or,ir=l.immediateDrag,xl=ir===void 0?!0:ir,ar=l.keyboardDrag,Sl=ar===void 0?!0:ar,Dl=l.dragKeys,sr=l.keyboardDragSpeed,El=sr===void 0?10:sr,lr=l.useTransform,cr=lr===void 0?!0:lr,dr=l.hoverClass,hr=dr===void 0?"ds-hover":dr,ur=l.selectableClass,mr=ur===void 0?"ds-selectable":ur,fr=l.selectedClass,Nl=fr===void 0?"ds-selected":fr,pr=l.selectorClass,Vl=pr===void 0?"ds-selector":pr,gr=l.selectorAreaClass,Cl=gr===void 0?"ds-selector-area":gr,Ml=l.callback,$l=l.onDragMove,Bl=l.onDragStartBegin,Tl=l.onDragStart,Al=l.onElementSelect,Ol=l.onElementUnselect;r(this,h),o(this,"continue",!1),o(this,"start",function(){n.stopped=!1,n.Interaction.init()}),o(this,"break",function(){return n.continue=!0}),o(this,"getSelection",function(){return n.SelectedSet.elements}),o(this,"getSelectables",function(){return n.SelectableSet.elements}),o(this,"getInitialCursorPosition",function(){return n.stores.PointerStore.initialVal}),o(this,"getCurrentCursorPosition",function(){return n.stores.PointerStore.currentVal}),o(this,"getPreviousCursorPosition",function(){return n.stores.PointerStore.lastVal}),o(this,"getInitialCursorPositionArea",function(){return n.stores.PointerStore.initialValArea}),o(this,"getCurrentCursorPositionArea",function(){return n.stores.PointerStore.currentValArea}),o(this,"getPreviousCursorPositionArea",function(){return n.stores.PointerStore.lastValArea}),o(this,"isMultiSelect",function(Pl){return n.stores.KeyStore.isMultiSelectKeyPressed(Pl)}),o(this,"isDragging",function(){return n.Interaction.isDragging}),this.PubSub=new hl({DS:this}),this.subscribe=this.PubSub.subscribe,this.unsubscribe=this.PubSub.unsubscribe,this.publish=this.PubSub.publish,this._callbacksTemp({callback:Ml,onDragMove:$l,onDragStart:Tl,onDragStartBegin:Bl,onElementSelect:Al,onElementUnselect:Ol}),this.stores={PointerStore:new bl({DS:this}),ScrollStore:new vl({DS:this,areaElement:d,zoom:I}),KeyStore:new yl({DS:this,multiSelectKeys:_l,multiSelectMode:Ee})},this.Area=new ll({area:d,PS:this.PubSub,zoom:I}),this.Selector=new pl({DS:this,selector:kl,selectorClass:Vl,customStyles:ne}),this.SelectorArea=new gl({DS:this,selectorAreaClass:Cl,autoScrollSpeed:k,overflowTolerance:D}),this.SelectableSet=new ul({elements:w,DS:this,className:mr,hoverClassName:hr,useTransform:cr,draggability:yt}),this.SelectedSet=new ml({DS:this,className:Nl}),this.Selection=new fl({DS:this,hoverClassName:hr,multiSelectToggling:me}),this.Drag=new cl({DS:this,draggability:yt,useTransform:cr,keyboardDrag:Sl,dragKeys:Object.assign({up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},Dl),zoom:I,keyboardDragSpeed:El}),this.Interaction=new dl({areaElement:d,DS:this,draggability:yt,immediateDrag:xl,selectableClass:mr}),sl({subscribe:this.subscribe,publish:this.publish,SelectedSet:this.SelectedSet,Interaction:this.Interaction}),this.subscribe("Interaction:end",function(){return n.continue=!1}),this.start()}return s(h,[{key:"_callbacksTemp",value:function(n){var g=n.callback,d=n.onDragMove,v=n.onDragStart,w=n.onDragStartBegin,_=n.onElementSelect,k=n.onElementUnselect,V=function(T,I){return console.warn("[DragSelect] ".concat(T,' is deprecated. Use DragSelect.subscribe("').concat(I,'", (callbackObject) => {}) instead. Act Now! See docs for more info'))};g&&(V("callback","callback"),this.subscribe("callback",function(D){var T=D.items;D.item;var I=D.event;return g(T,I)})),d&&(V("onDragMove","dragmove"),this.subscribe("dragmove",function(D){D.items,D.item;var T=D.event;return d(T)})),v&&(V("onDragStart","dragstart"),this.subscribe("dragstart",function(D){D.items,D.item;var T=D.event;return v(T)})),w&&(V("onDragStartBegin","dragstart"),this.subscribe("dragstart",function(D){D.items,D.item;var T=D.event;return w(T)})),_&&(V("onElementSelect","elementselect"),this.subscribe("elementselect",function(D){D.items;var T=D.item,I=D.event;return _(T,I)})),k&&(V("onElementUnselect","elementunselect"),this.subscribe("elementunselect",function(D){D.items;var T=D.item,I=D.event;return k(T,I)}))}},{key:"stop",value:function(){var n=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(n),this.stores.KeyStore.stop(),this.stores.PointerStore.stop(),this.stores.ScrollStore.stop(),n&&this.SelectableSet.clear(),g&&this.SelectedSet.clear(),this.stopped=!0}},{key:"addSelection",value:function(n){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(De(n)),d||this.addSelectables(n),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"removeSelection",value:function(n){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(De(n)),d&&this.removeSelectables(n),g&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"toggleSelection",value:function(n){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 De(n).forEach(function(w){return g.SelectedSet.has(w)?g.removeSelection(n,d,v):g.addSelection(n,d,v)}),d&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"setSelection",value:function(n){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(n,g,d),this.getSelection()}},{key:"clearSelection",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.SelectedSet.clear(),n&&this.PubSub.publish("callback",{items:this.getSelection()}),this.getSelection()}},{key:"addSelectables",value:function(n){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=De(n);return this.SelectableSet.addAll(d),g&&this.SelectedSet.addAll(d),n}},{key:"setSelectables",value:function(n){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(n,g),this.addSelectables(n,d)}},{key:"removeSelectables",value:function(n){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.SelectableSet.deleteAll(De(n)),g&&this.removeSelection(n),n}},{key:"getCursorPositionDifference",value:function(){var n=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=n?g?this.getPreviousCursorPositionArea():this.getPreviousCursorPosition():g?this.getInitialCursorPositionArea():this.getInitialCursorPosition();return L(d,"-",v)}}]),h}();return wl})})(vt);const qr=vt.exports,Gr=(a,t,r,i,s)=>(t=Math,r=t.log,i=1024,s=r(a)/r(i)|0,a/t.pow(i,s)).toFixed(0)+" "+(s?"KMGTPEZY"[--s]+"iB":"B"),Jr=(a,t="en-US")=>new Date(a*1e3).toLocaleString(t),Zr={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},Qr=[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)],en={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},tn=[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)],Le=Object.assign({name:"VFSortIcon"},{props:{direction:String},setup(a){return(t,r)=>(e.openBlock(),e.createElementBlock("div",null,[a.direction=="down"?(e.openBlock(),e.createElementBlock("svg",Zr,Qr)):e.createCommentVNode("",!0),a.direction=="up"?(e.openBlock(),e.createElementBlock("svg",en,tn)):e.createCommentVNode("",!0)]))}}),rn=["onClick"],nn=Object.assign({name:"VFToast.vue"},{setup(a){const t=e.inject("emitter"),{getStore:r}=e.inject("storage"),i=e.ref(r("full-screen",!1)),s=f=>f=="error"?"text-red-400 border-red-400":"text-lime-600 border-lime-600",o=e.ref([]),c=f=>{o.value.splice(f,1)},m=f=>{let p=o.value.findIndex(u=>u.id===f);p!==-1&&c(p)};return t.on("vf-toast-push",f=>{let p=new Date().getTime().toString(36).concat(performance.now().toString(),Math.random().toString()).replace(/\./g,"");f.id=p,o.value.push(f),setTimeout(()=>{m(p)},5e3)}),(f,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([i.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(o.value,(u,y)=>(e.openBlock(),e.createElementBlock("div",{onClick:b=>c(y),key:u,class:e.normalizeClass([s(u.type),"inline-block mx-auto my-0.5 py-0.5 px-2 min-w-max bg-gray-50 border text-xs rounded cursor-pointer"])},e.toDisplayString(u.label),11,rn))),128))]),_:1})],2))}}),fe=a=>Object.entries(a).map(t=>t.map(encodeURIComponent).join("=")).join("&"),{apiUrl:on}=ce(),Je=(a,t)=>on.value+"?"+fe({q:"preview",adapter:a,path:t}),an={class:"relative flex-auto flex flex-col overflow-hidden"},sn={key:0,class:"grid grid-cols-12 border-b border-neutral-300 dark:border-gray-700 text-xs select-none"},ln={class:"absolute"},cn=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),dn={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"},hn=["onDblclick","onTouchstart","onContextmenu","data-type","data-item","data-index"],un={class:"grid grid-cols-12 items-center"},mn={class:"flex col-span-7 items-center"},fn={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"},pn=[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)],gn={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"},yn=[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)],bn={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},vn={class:"col-span-5 overflow-ellipsis overflow-hidden whitespace-nowrap"},wn=["onDblclick","onTouchstart","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],_n={class:"grid grid-cols-12 items-center"},kn={class:"flex col-span-7 items-center"},xn={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"},Sn=[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)],Dn={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"},En=[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)],Nn={class:"overflow-ellipsis overflow-hidden whitespace-nowrap"},Vn={class:"col-span-2 text-center"},Cn={class:"col-span-3 overflow-ellipsis overflow-hidden whitespace-nowrap"},Mn=["onDblclick","onTouchstart","onContextmenu","onDragstart","onDragover","onDrop","data-type","data-item","data-index"],$n={class:"relative"},Bn={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"},Tn=[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)],An=["src"],On={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"},Pn=[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)],jn={key:3,class:"absolute hidden md:block top-1/2 w-full text-center text-neutral-500"},In={class:"break-all"},Ln=Object.assign({name:"VFExplorer"},{props:{view:String,data:Object,search:Object},setup(a){const t=a,r=e.inject("emitter"),{setStore:i,getStore:s}=e.inject("storage"),o=$=>$==null?void 0:$.substring(0,3),c=$=>$.replace(/((?=([\w\W]{0,14}))([\w\W]{8,})([\w\W]{8,}))/,"$2..$4"),m=e.ref(null),f=e.ref(null),p=e.ref(0),u=e.ref(null),{t:y}=e.inject("i18n"),b=Math.floor(Math.random()*2**32),N=e.ref(s("full-screen",!1));r.on("vf-fullscreen-toggle",()=>{N.value=!N.value,i("full-screen",N.value)});const S=e.ref("");r.on("vf-search-query",({newQuery:$})=>{S.value=$,$?r.emit("vf-fetch",{q:"search",adapter:t.data.adapter,path:t.data.dirname,filter:$}):r.emit("vf-fetch",{q:"index",adapter:t.data.adapter,path:t.data.dirname})});let E=null;const B=()=>{E&&clearTimeout(E)},A=$=>{E=setTimeout(()=>{O($)},500)},O=$=>{$.type=="dir"?(r.emit("vf-search-exit"),r.emit("vf-fetch",{q:"index",adapter:t.data.adapter,path:$.path})):r.emit("vf-modal-show",{type:"preview",adapter:t.data.adapter,item:$})},C=e.reactive({active:!1,column:"",order:""}),J=($=!0)=>{let j=[...t.data.files],M=C.column,L=C.order=="asc"?1:-1;if(!$)return j;const P=(q,Y)=>typeof q=="string"&&typeof Y=="string"?q.toLowerCase().localeCompare(Y.toLowerCase()):q<Y?-1:q>Y?1:0;return C.active&&(j=j.slice().sort((q,Y)=>P(q[M],Y[M])*L)),j},K=$=>{C.active&&C.column==$?(C.active=C.order=="asc",C.column=$,C.order="desc"):(C.active=!0,C.column=$,C.order="asc")},x=()=>u.value.getSelection().map($=>JSON.parse($.dataset.item)),R=($,j)=>{if($.altKey||$.ctrlKey||$.metaKey)return $.preventDefault(),!1;$.dataTransfer.setDragImage(f.value,0,15),$.dataTransfer.effectAllowed="all",$.dataTransfer.dropEffect="copy",$.dataTransfer.setData("items",JSON.stringify(x()))},F=($,j)=>{$.preventDefault();let M=JSON.parse($.dataTransfer.getData("items"));if(M.find(L=>L.storage!=s("adapter","local"))){alert("Moving items between different storages is not supported yet.");return}r.emit("vf-modal-show",{type:"move",items:{from:M,to:j}})},Q=($,j)=>{$.preventDefault(),!j||j.type!=="dir"||u.value.getSelection().find(M=>M==$.currentTarget)?($.dataTransfer.dropEffect="none",$.dataTransfer.effectAllowed="none"):$.dataTransfer.dropEffect="copy"},re=()=>{u.value=new qr({area:m.value,keyboardDrag:!1,selectedClass:"vf-explorer-selected",selectorClass:"vf-explorer-selector"}),r.on("vf-explorer-update",()=>e.nextTick(()=>{u.value.clearSelection(),u.value.setSelectables(document.getElementsByClassName("vf-item-"+b))})),u.value.subscribe("predragstart",({event:$,isDragging:j})=>{if(j)p.value=u.value.getSelection().length,u.value.break();else{const M=$.target.offsetWidth-$.offsetX,L=$.target.offsetHeight-$.offsetY;M<15&&L<15&&(u.value.clearSelection(),u.value.break())}}),u.value.subscribe("predragmove",({isDragging:$})=>{$&&u.value.break()}),u.value.subscribe("callback",({items:$,event:j,isDragging:M})=>{r.emit("vf-nodes-selected",x()),p.value=u.value.getSelection().length})};return e.onMounted(re),e.onMounted(()=>{e.watch(()=>t.view,()=>r.emit("vf-explorer-update"))}),($,j)=>(e.openBlock(),e.createElementBlock("div",an,[a.view=="list"||S.value.length?(e.openBlock(),e.createElementBlock("div",sn,[e.createElementVNode("div",{onClick:j[0]||(j[0]=M=>K("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(Le,{direction:C.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,C.active&&C.column=="basename"]])]),S.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,onClick:j[1]||(j[1]=M=>K("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(Le,{direction:C.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,C.active&&C.column=="file_size"]])])),S.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:j[2]||(j[2]=M=>K("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(Le,{direction:C.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,C.active&&C.column=="last_modified"]])])),S.value.length?(e.openBlock(),e.createElementBlock("div",{key:2,onClick:j[3]||(j[3]=M=>K("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(Le,{direction:C.order=="asc"?"down":"up"},null,8,["direction"]),[[e.vShow,C.active&&C.column=="path"]])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",ln,[e.createElementVNode("div",{ref_key:"dragImage",ref:f,class:"absolute -z-50 -top-96"},[cn,e.createElementVNode("div",dn,e.toDisplayString(p.value),1)],512)]),e.createElementVNode("div",{style:e.normalizeStyle(N.value?"height: 100%;":""),class:e.normalizeClass([N.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,onContextmenu:j[7]||(j[7]=e.withModifiers(M=>e.unref(r).emit("vf-contextmenu-show",{event:M,area:m.value,items:x()}),["self","prevent"]))},[S.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(J(),(M,L)=>(e.openBlock(),e.createElementBlock("div",{onDblclick:P=>O(M),onTouchstart:P=>A(M),onTouchend:j[4]||(j[4]=P=>B()),onContextmenu:e.withModifiers(P=>e.unref(r).emit("vf-contextmenu-show",{event:P,area:m.value,items:x(),target:M}),["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":M.type,"data-item":JSON.stringify(M),"data-index":L},[e.createElementVNode("div",un,[e.createElementVNode("div",mn,[M.type=="dir"?(e.openBlock(),e.createElementBlock("svg",fn,pn)):(e.openBlock(),e.createElementBlock("svg",gn,yn)),e.createElementVNode("span",bn,e.toDisplayString(M.basename),1)]),e.createElementVNode("div",vn,e.toDisplayString(M.path),1)])],42,hn))),256)):e.createCommentVNode("",!0),a.view=="list"&&!S.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(J(),(M,L)=>(e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:P=>O(M),onTouchstart:P=>A(M),onTouchend:j[5]||(j[5]=P=>B()),onContextmenu:e.withModifiers(P=>e.unref(r).emit("vf-contextmenu-show",{event:P,area:m.value,items:x(),target:M}),["prevent"]),onDragstart:P=>R(P),onDragover:P=>Q(P,M),onDrop:P=>F(P,M),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":M.type,"data-item":JSON.stringify(M),"data-index":L},[e.createElementVNode("div",_n,[e.createElementVNode("div",kn,[M.type=="dir"?(e.openBlock(),e.createElementBlock("svg",xn,Sn)):(e.openBlock(),e.createElementBlock("svg",Dn,En)),e.createElementVNode("span",Nn,e.toDisplayString(M.basename),1)]),e.createElementVNode("div",Vn,e.toDisplayString(M.file_size?e.unref(Gr)(M.file_size):""),1),e.createElementVNode("div",Cn,e.toDisplayString(e.unref(Jr)(M.last_modified)),1)])],42,wn))),256)):e.createCommentVNode("",!0),a.view=="grid"&&!S.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(J(!1),(M,L)=>{var P,q;return e.openBlock(),e.createElementBlock("div",{draggable:"true",onDblclick:Y=>O(M),onTouchstart:Y=>A(M),onTouchend:j[6]||(j[6]=Y=>B()),onContextmenu:e.withModifiers(Y=>e.unref(r).emit("vf-contextmenu-show",{event:Y,area:m.value,items:x(),target:M}),["prevent"]),onDragstart:Y=>R(Y),onDragover:Y=>Q(Y,M),onDrop:Y=>F(Y,M),class:e.normalizeClass(["vf-item-"+e.unref(b),"border border-transparent hover:bg-neutral-50 m-0.5 dark:hover:bg-gray-700 inline-flex w-[5.5rem] h-20 md:w-24 md:h-24 text-center justify-center select-none"]),"data-type":M.type,"data-item":JSON.stringify(M),"data-index":L},[e.createElementVNode("div",null,[e.createElementVNode("div",$n,[M.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Bn,Tn)):((P=M.mime_type)!=null?P:"").startsWith("image")?(e.openBlock(),e.createElementBlock("img",{key:1,class:"h-10 md:h-12 m-auto",src:e.unref(Je)(e.unref(s)("adapter",t.data.adapter),M.path),alt:""},null,8,An)):(e.openBlock(),e.createElementBlock("svg",On,Pn)),((q=M.mime_type)!=null?q:"").startsWith("image")?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",jn,e.toDisplayString(o(M.extension)),1))]),e.createElementVNode("span",In,e.toDisplayString(c(M.basename)),1)])],42,Mn)}),256)):e.createCommentVNode("",!0)],38),e.createVNode(nn)]))}}),zn={class:"p-1 text-xs border-t border-neutral-300 dark:border-gray-700/50 flex justify-between select-none"},Rn={class:"flex leading-5 items-center"},Hn=["aria-label"],Un=[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)],Kn=["value"],Fn={class:"ml-3"},Yn={key:0},Wn={class:"ml-1"},Xn={class:"flex leading-5 items-center"},qn={value:"",disabled:""},Gn=e.createElementVNode("option",{value:"tr"},"Turkish",-1),Jn=e.createElementVNode("option",{value:"en"},"English",-1),Zn=e.createElementVNode("option",{value:"fr"},"French",-1),Qn=["aria-label"],eo=[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)],to=Object.assign({name:"VFStatusbar"},{props:{data:Object},setup(a){var b;const t=a,r=e.inject("emitter"),{getStore:i,setStore:s}=e.inject("storage"),o=e.ref(0),c=e.ref((b=i("adapter"))!=null?b:t.data.adapter),{t:m,changeLocale:f}=e.inject("i18n"),p=e.ref(i("locale","")),u=()=>{r.emit("vf-search-exit"),r.emit("vf-fetch",{q:"index",adapter:c.value}),s("adapter",c.value)};r.on("vf-nodes-selected",N=>{o.value=N.length});const y=e.ref("");return r.on("vf-search-query",({newQuery:N})=>{y.value=N}),(N,S)=>(e.openBlock(),e.createElementBlock("div",zn,[e.createElementVNode("div",Rn,[e.createElementVNode("div",{class:"mx-2","aria-label":e.unref(m)("Storage"),"data-microtip-position":"top-right",role:"tooltip"},Un,8,Hn),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S[0]||(S[0]=E=>c.value=E),onChange:u,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(a.data.storages,E=>(e.openBlock(),e.createElementBlock("option",{value:E},e.toDisplayString(E),9,Kn))),256))],544),[[e.vModelSelect,c.value]]),e.createElementVNode("div",Fn,[y.value.length?(e.openBlock(),e.createElementBlock("span",Yn,e.toDisplayString(a.data.files.length)+" items found. ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",Wn,e.toDisplayString(o.value>0?o.value+" "+e.unref(m)("item(s) selected."):""),1)])]),e.createElementVNode("div",Xn,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S[1]||(S[1]=E=>p.value=E),onChange:S[2]||(S[2]=E=>e.unref(f)(E.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",qn,e.toDisplayString(e.unref(m)("Language")),1),Gn,Jn,Zn],544),[[e.vModelSelect,p.value]]),e.createElementVNode("span",{"aria-label":e.unref(m)("About"),"data-microtip-position":"top-left",role:"tooltip",onClick:S[3]||(S[3]=E=>e.unref(r).emit("vf-modal-show",{type:"message",title:"Vuefinder 1.0",message:e.unref(m)("Vuefinder is a file manager component for vue 3.")}))},eo,8,Qn)])]))}}),ro=(a,t=0,r=!1)=>{let i;return(...s)=>{r&&!i&&a(...s),clearTimeout(i),i=setTimeout(()=>{a(...s)},t)}},no=(a,t,r)=>{const i=e.ref(a);return e.customRef((o,c)=>({get(){return o(),i.value},set:ro(m=>{i.value=m,c()},t,r)}))},oo={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"},io=["aria-label"],ao=[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)],so=["onClick"],lo=[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)],co={class:"flex leading-5"},ho=e.createElementVNode("span",{class:"text-neutral-300 dark:text-gray-600 mx-0.5"},"/",-1),uo=["title","onClick"],mo={key:1,class:"flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full"},fo=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),po=["onKeydown","placeholder"],go=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],yo=Object.assign({name:"VFBreadcrumb"},{props:{data:Object},setup(a){const t=a,r=e.inject("emitter"),{getStore:i}=e.inject("storage"),s=e.ref(null),o=e.ref([]),c=e.ref(!1),m=e.ref(null),{t:f}=e.inject("i18n");r.on("vf-explorer-update",()=>{var O;let B=[],A=[];s.value=(O=t.data.dirname)!=null?O:i("adapter","local")+"://",s.value.length==0&&(o.value=[]),s.value.replace(i("adapter","local")+"://","").split("/").forEach(function(C){B.push(C),B.join("/")!=""&&A.push({basename:C,name:C,path:i("adapter","local")+"://"+B.join("/"),type:"dir"})}),A.length>4&&(A=A.slice(-5),A[0].name=".."),o.value=A});const p=()=>{c.value=!1,y.value=""};r.on("vf-search-exit",()=>{p()});const u=()=>{c.value=!0,e.nextTick(()=>m.value.focus())},y=no("",400);e.watch(y,B=>{r.emit("vf-search-query",{newQuery:B})});const b=()=>o.value.length&&!c.value,N=B=>{var O;B.preventDefault();let A=JSON.parse(B.dataTransfer.getData("items"));if(A.find(C=>C.storage!=i("adapter","local"))){alert("Moving items between different storages is not supported yet.");return}r.emit("vf-modal-show",{type:"move",items:{from:A,to:(O=o.value[o.value.length-2])!=null?O:{path:i("adapter","local")+"://"}}})},S=B=>{B.preventDefault(),b()?B.dataTransfer.dropEffect="copy":(B.dataTransfer.dropEffect="none",B.dataTransfer.effectAllowed="none")},E=()=>{y.value==""&&p()};return(B,A)=>(e.openBlock(),e.createElementBlock("div",oo,[e.createElementVNode("span",{"aria-label":e.unref(f)("Go up a directory"),"data-microtip-position":"bottom-right",role:"tooltip"},[(e.openBlock(),e.createElementBlock("svg",{onDragover:A[0]||(A[0]=O=>S(O)),onDrop:A[1]||(A[1]=O=>N(O)),onClick:A[2]||(A[2]=O=>{var C,J;return!b()||e.unref(r).emit("vf-fetch",{q:"index",adapter:a.data.adapter,path:(J=(C=o.value[o.value.length-2])==null?void 0:C.path)!=null?J:e.unref(i)("adapter","local")+"://"})}),class:e.normalizeClass(["h-6 w-6 p-0.5 rounded",b()?"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"},ao,34))],8,io),c.value?(e.openBlock(),e.createElementBlock("div",mo,[fo,e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:m,onKeydown:e.withKeys(p,["esc"]),onBlur:E,"onUpdate:modelValue":A[4]||(A[4]=O=>e.isRef(y)?y.value=O:null),placeholder:e.unref(f)("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,po),[[e.vModelText,e.unref(y)]]),(e.openBlock(),e.createElementBlock("svg",{class:"w-6 h-6 cursor-pointer",onClick:p,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},go))])):(e.openBlock(),e.createElementBlock("div",{key:0,class:"group flex bg-white dark:bg-gray-700 items-center rounded p-1 ml-2 w-full",onClick:e.withModifiers(u,["self"])},[(e.openBlock(),e.createElementBlock("svg",{onClick:A[3]||(A[3]=O=>e.unref(r).emit("vf-fetch",{q:"index",adapter:a.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"},lo)),e.createElementVNode("div",co,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(O,C)=>(e.openBlock(),e.createElementBlock("div",{key:C},[ho,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:O.basename,onClick:J=>e.unref(r).emit("vf-fetch",{q:"index",adapter:a.data.adapter,path:O.path})},e.toDisplayString(O.name),9,uo)]))),128))])],8,so))]))}}),bo=["onClick"],vo=e.createElementVNode("span",{class:"px-1"},null,-1),wo=Object.assign({name:"VFContextMenu"},{props:{current:Object},setup(a){const t=a,r=e.inject("emitter"),i=e.ref(null),{apiUrl:s}=ce(),o=e.reactive({active:!1,items:[],positions:{left:0,top:0}}),c=e.ref([]);r.on("vf-context-selected",b=>{c.value=b});const{t:m}=e.inject("i18n"),f={newfolder:{title:()=>m("New Folder"),action:()=>{r.emit("vf-modal-show",{type:"new-folder"})}},delete:{title:()=>m("Delete"),action:()=>{r.emit("vf-modal-show",{type:"delete",items:c})}},refresh:{title:()=>m("Refresh"),action:()=>{r.emit("vf-fetch",{q:"index",adapter:t.current.adapter,path:t.current.dirname})}},preview:{title:()=>m("Preview"),action:()=>{r.emit("vf-modal-show",{type:"preview",adapter:t.current.adapter,item:c.value[0]})}},open:{title:()=>m("Open"),action:()=>{r.emit("vf-search-exit"),r.emit("vf-fetch",{q:"index",adapter:t.current.adapter,path:c.value[0].path})}},openDir:{title:()=>m("Open containing folder"),action:()=>{r.emit("vf-search-exit"),r.emit("vf-fetch",{q:"index",adapter:t.current.adapter,path:c.value[0].dir})}},download:{title:()=>m("Download"),action:()=>{const b=s.value+"?"+fe({q:"download",adapter:c.value[0].adapter,path:c.value[0].path});r.emit("vf-download",b)}},archive:{title:()=>m("Archive"),action:()=>{r.emit("vf-modal-show",{type:"archive",items:c})}},unarchive:{title:()=>m("Unarchive"),action:()=>{r.emit("vf-modal-show",{type:"unarchive",items:c})}},rename:{title:()=>m("Rename"),action:()=>{r.emit("vf-modal-show",{type:"rename",items:c})}}},p=b=>{r.emit("vf-contextmenu-hide"),b.action()},u=e.ref("");r.on("vf-search-query",({newQuery:b})=>{u.value=b}),r.on("vf-contextmenu-show",({event:b,area:N,items:S,target:E=null})=>{if(o.items=[],u.value)if(E)o.items.push(f.openDir),r.emit("vf-context-selected",[E]);else return;else!E&&!u.value?(o.items.push(f.refresh),o.items.push(f.newfolder),r.emit("vf-context-selected",[]),console.log("no files selected")):S.length>1&&S.some(B=>B.path===E.path)?(o.items.push(f.refresh),o.items.push(f.archive),o.items.push(f.delete),r.emit("vf-context-selected",S),console.log(S.length+" selected (more than 1 item.)")):(E.type=="dir"?o.items.push(f.open):(o.items.push(f.preview),o.items.push(f.download)),o.items.push(f.rename),E.mime_type=="application/zip"?o.items.push(f.unarchive):o.items.push(f.archive),o.items.push(f.delete),r.emit("vf-context-selected",[E]),console.log(E.type+" is selected"));y(b,N)}),r.on("vf-contextmenu-hide",()=>{o.active=!1});const y=(b,N)=>{o.active=!0,e.nextTick(()=>{let S=N.getBoundingClientRect(),E=b.pageX,B=b.pageY,A=i.value.offsetHeight,O=i.value.offsetWidth;E=S.right-b.pageX+window.scrollX<O?E-O:E,B=S.bottom-b.pageY+window.scrollY<A?B-A:B,o.positions={left:E+"px",top:B+"px"}})};return(b,N)=>o.active?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"z-30 absolute text-xs bg-neutral-50 dark:bg-gray-800 dark:text-gray-200 border border-neutral-300 dark:border-gray-600 shadow rounded select-none",ref_key:"contextmenu",ref:i,style:e.normalizeStyle(o.positions)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.items,S=>(e.openBlock(),e.createElementBlock("li",{class:"px-2 py-1.5 cursor-pointer hover:bg-neutral-200 dark:hover:bg-gray-700",key:S.title,onClick:E=>p(S)},[vo,e.createElementVNode("span",null,e.toDisplayString(S.title()),1)],8,bo))),128))],4)):e.createCommentVNode("",!0)}}),_o=(a,t)=>{const r=a[t];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((i,s)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+t)))})};async function ko(a){const t=await _o(Object.assign({"../locales/en.json":()=>Promise.resolve().then(()=>Xs),"../locales/tr.json":()=>Promise.resolve().then(()=>qs)}),`../locales/${a}.json`);return JSON.parse(t.default)}function xo(a,t){const{getStore:r,setStore:i}=Ge(a),s=["en","tr"],o=e.ref({}),c=f=>{s.includes(f)||(console.log("The selected locale is not yet supported. The fallback language is set as 'en'"),f="en"),ko(f).then(p=>{o.value=p,i("locale",f),i("translations",p),console.log(f+" is loaded.")})};r("locale")?o.value=r("translations"):c(t);function m(f){return o.value.hasOwnProperty(f)?o.value[f]:""}return{t:m,support_locales:s,changeLocale:c}}const So=e.createElementVNode("iframe",{id:"download_frame",style:{display:"none"}},null,-1),Do=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"}},setup(a){const t=a,r=yr(),{setStore:i,getStore:s}=Ge(t.id);e.provide("emitter",r),e.provide("storage",Ge(t.id));const o=xo(t.id,t.locale);e.provide("i18n",o);const{apiUrl:c,setApiUrl:m}=ce();m(t.url);const f=e.reactive({adapter:"local",storages:[],dirname:".",files:[]}),p=e.ref(s("viewport","grid")),u=e.ref(s("darkMode",t.dark));r.on("vf-darkMode-toggle",()=>{u.value=!u.value,i("darkMode",u.value)});const y=e.ref(s("full-screen",!1));r.on("vf-fullscreen-toggle",()=>{y.value=!y.value,i("full-screen",y.value)}),r.on("vf-view-toggle",S=>{p.value=S});const b=e.reactive({active:!1,type:"delete",data:{}});r.on("vf-modal-close",()=>{b.active=!1}),r.on("vf-modal-show",S=>{b.active=!0,b.type=S.type,b.data=S});const N=S=>{Object.assign(f,S),r.emit("vf-nodes-selected",{}),r.emit("vf-explorer-update")};return r.on("vf-fetch",S=>{Ie(c.value,{params:S}).then(E=>{r.emit("vf-modal-close"),N(E)})}),r.on("vf-download",S=>{document.getElementById("download_frame").src=S,r.emit("vf-modal-close")}),e.onMounted(()=>{r.emit("vf-fetch",{q:"index",adapter:s("adapter",f.adapter)})}),(S,E)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(u.value?"dark":"")},[e.createElementVNode("div",{class:e.normalizeClass([y.value?"fixed w-screen inset-0 z-20":"relative","border flex flex-col rounded-md 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(y.value?"":"max-height: "+a.maxHeight),onMousedown:E[0]||(E[0]=B=>e.unref(r).emit("vf-contextmenu-hide"))},[e.createVNode(Wr,{data:f},null,8,["data"]),e.createVNode(yo,{data:f},null,8,["data"]),e.createVNode(Ln,{view:p.value,data:f},null,8,["view","data"]),e.createVNode(to,{data:f},null,8,["data"])],38),b.active?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("v-f-modal-"+b.type),{key:0,selection:b.data,current:f},null,8,["selection","current"])):e.createCommentVNode("",!0),e.createVNode(wo,{current:f},null,8,["current"]),So],2))}}),Eo=e.createElementVNode("div",{class:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"},null,-1),No={class:"fixed z-10 inset-0 overflow-y-auto"},Vo={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 sm:w-full"},Co={class:"bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},Mo={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"},ae={__name:"ModalLayout",setup(a){const t=e.inject("emitter");return e.onMounted(()=>{const r=document.querySelector(".v-f-modal input");r&&r.focus()}),(r,i)=>(e.openBlock(),e.createElementBlock("div",{class:"v-f-modal relative z-30","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",onKeyup:i[1]||(i[1]=e.withKeys(s=>e.unref(t).emit("vf-modal-close"),["esc"])),tabindex:"0"},[Eo,e.createElementVNode("div",No,[e.createElementVNode("div",{class:"flex items-end sm:items-center justify-center min-h-full p-4 text-center sm:p-0",onMousedown:i[0]||(i[0]=e.withModifiers(s=>e.unref(t).emit("vf-modal-close"),["self"]))},[e.createElementVNode("div",Vo,[e.createElementVNode("div",Co,[e.renderSlot(r.$slots,"default")]),e.createElementVNode("div",Mo,[e.renderSlot(r.$slots,"buttons")])])],32)])],32))}},$o={class:"sm:flex sm:items-start"},Bo=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),To={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},Ao={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},Oo={class:"mt-2"},Po={class:"text-sm text-gray-500"},jo={class:"flex text-sm text-gray-800 dark:text-gray-400"},Io={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"},Lo=[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)],zo={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"},Ro=[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)],Ho={class:"ml-1.5"},Uo={class:"m-auto font-bold text-red-500 text-sm dark:text-red-200 text-center"},Ko=Object.assign({name:"VFModalDelete"},{props:{selection:Object,current:Object},setup(a){const t=a,r=e.inject("emitter"),{getStore:i}=e.inject("storage"),{t:s}=e.inject("i18n"),o=e.ref(t.selection.items),c=()=>{o.value.length&&r.emit("vf-fetch",{q:"delete",adapter:i("adapter","local"),path:t.current.dirname,items:JSON.stringify(o.value.map(({path:m,type:f})=>({path:m,type:f})))})};return(m,f)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,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[0]||(f[0]=p=>e.unref(r).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",Uo,e.toDisplayString(e.unref(s)("This action cannot be undone.")),1)]),default:e.withCtx(()=>[e.createElementVNode("div",$o,[Bo,e.createElementVNode("div",To,[e.createElementVNode("h3",Ao,e.toDisplayString(e.unref(s)("Delete files")),1),e.createElementVNode("div",Oo,[e.createElementVNode("p",Po,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(o.value,p=>(e.openBlock(),e.createElementBlock("p",jo,[p.type=="dir"?(e.openBlock(),e.createElementBlock("svg",Io,Lo)):(e.openBlock(),e.createElementBlock("svg",zo,Ro)),e.createElementVNode("span",Ho,e.toDisplayString(p.basename),1)]))),256))])])])]),_:1}))}}),Fo={class:"sm:flex sm:items-start"},Yo=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),Wo={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},Xo={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},qo={class:"mt-2"},Go={class:"text-sm text-gray-500"},Jo=Object.assign({name:"VFModalMessage"},{props:{selection:Object},setup(a){const t=e.inject("emitter"),{t:r}=e.inject("i18n");return(i,s)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:s[0]||(s[0]=o=>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(r)("Close")),1)]),default:e.withCtx(()=>{var o,c,m,f;return[e.createElementVNode("div",Fo,[Yo,e.createElementVNode("div",Wo,[e.createElementVNode("h3",Xo,e.toDisplayString((c=(o=a.selection)==null?void 0:o.title)!=null?c:"Title"),1),e.createElementVNode("div",qo,[e.createElementVNode("p",Go,e.toDisplayString((f=(m=a.selection)==null?void 0:m.message)!=null?f:"Message")+".",1)])])])]}),_:1}))}}),Zo={class:"sm:flex sm:items-start"},Qo=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),ei={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ti={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},ri={class:"mt-2"},ni={class:"text-sm text-gray-500"},oi=["onKeyup","placeholder"],ii=Object.assign({name:"VFModalNewFolder"},{props:{selection:Object,current:Object},setup(a){const t=a,r=e.inject("emitter"),{getStore:i}=e.inject("storage"),{t:s}=e.inject("i18n"),o=e.ref(""),c=()=>{o.value!=""&&(r.emit("vf-fetch",{q:"newfolder",adapter:i("adapter","local"),path:t.current.dirname,name:o.value}),r.emit("vf-toast-push",{label:"New Folder is created successfully",type:"success"}))};return(m,f)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,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)("Create")),1),e.createElementVNode("button",{type:"button",onClick:f[1]||(f[1]=p=>e.unref(r).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",Zo,[Qo,e.createElementVNode("div",ei,[e.createElementVNode("h3",ti,e.toDisplayString(e.unref(s)("New Folder")),1),e.createElementVNode("div",ri,[e.createElementVNode("p",ni,e.toDisplayString(e.unref(s)("Create a new folder")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=p=>o.value=p),onKeyup:e.withKeys(c,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-500 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,oi),[[e.vModelText,o.value]])])])])]),_:1}))}}),ai={class:"sm:flex sm:items-start"},si=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),li={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"},ci={class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},di={class:"mt-2"},hi={class:"text-sm text-gray-500"},ui=["onKeyup","placeholder"],mi=Object.assign({name:"VFModalNewFile"},{props:{selection:Object,current:Object},setup(a){const t=a,r=e.inject("emitter"),{getStore:i}=e.inject("storage"),{t:s}=e.inject("i18n"),o=e.ref(""),c=()=>{o.value!=""&&r.emit("vf-fetch",{q:"newfile",adapter:i("adapter","local"),path:t.current.dirname,name:o.value})};return(m,f)=>(e.openBlock(),e.createBlock(ae,null,{buttons:e.withCtx(()=>[e.createElementVNode("button",{type:"button",onClick:c,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"},"Create!"),e.createElementVNode("button",{type:"button",onClick:f[1]||(f[1]=p=>e.unref(r).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",ai,[si,e.createElementVNode("div",li,[e.createElementVNode("h3",ci,e.toDisplayString(e.unref(s)("New File")),1),e.createElementVNode("div",di,[e.createElementVNode("p",hi,e.toDisplayString(e.unref(s)("Create a new file")),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=p=>o.value=p),onKeyup:e.withKeys(c,["enter"]),class:"px-2 py-1 border rounded dark:bg-gray-500 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,ui),[[e.vModelText,o.value]])])])])]),_:1}))}}),fi={class:"flex"},pi={class:"mb-2 text-lg leading-6 font-medium text-gray-900 dark:text-gray-400",id:"modal-title"},gi={class:"ml-auto mb-2"},yi={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"},bi={key:1},vi={__name:"Text",props:{selection:Object},emits:["load"],setup(a,{emit:t}){const r=a,i=e.ref(""),s=e.ref(""),o=e.ref(null),c=e.ref(!1),{apiUrl:m}=ce(),{t:f}=e.inject("i18n");e.onMounted(()=>{Ie(m.value,{params:{q:"preview",adapter:r.selection.adapter,path:r.selection.item.path},json:!1}).then(y=>{i.value=y,t("load")})});const p=()=>{c.value=!c.value,s.value=i.value,c.value==!0&&e.nextTick(()=>{o.value.focus()})},u=()=>{Ie(m.value,{method:"POST",params:{q:"save",adapter:r.selection.adapter,path:r.selection.item.path,content:s.value},json:!1}).then(y=>{i.value=y,t("load"),c.value=!c.value}).catch(y=>console.log(y.statusText))};return(y,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",fi,[e.createElementVNode("div",pi,e.toDisplayString(a.selection.item.basename),1),e.createElementVNode("div",gi,[c.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:u,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(f)("Save")),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"ml-1 px-2 py-1 text-blue-500",onClick:b[0]||(b[0]=N=>p())},e.toDisplayString(c.value?e.unref(f)("Cancel"):e.unref(f)("Edit")),1)])]),e.createElementVNode("div",null,[c.value?(e.openBlock(),e.createElementBlock("div",bi,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"editInput",ref:o,"onUpdate:modelValue":b[1]||(b[1]=N=>s.value=N),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] text-xs",name:"text",id:"",cols:"30",rows:"10"},null,512),[[e.vModelText,s.value]])])):(e.openBlock(),e.createElementBlock("pre",yi,e.toDisplayString(i.value),1))])],64))}},vc="";/*!
|
|
4
4
|
* Cropper.js v1.5.12
|
|
5
5
|
* https://fengyuanchen.github.io/cropperjs
|
|
6
6
|
*
|