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