@saltcorn/filemanager 1.1.2-beta.8 → 1.1.2-beta.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saltcorn/filemanager",
3
- "version": "1.1.2-beta.8",
3
+ "version": "1.1.2-beta.9",
4
4
  "scripts": {
5
5
  "build": "rollup -c",
6
6
  "dev": "rollup -c -w",
@@ -17,7 +17,7 @@
17
17
  "rollup-plugin-livereload": "^2.0.0",
18
18
  "rollup-plugin-svelte": "^7.0.0",
19
19
  "@rollup/plugin-terser": "0.4.4",
20
- "svelte": "^3.0.0",
20
+ "svelte": "^4.2.19",
21
21
  "svelte-fa": "^3.0.3"
22
22
  },
23
23
  "dependencies": {
@@ -1,6 +1,6 @@
1
- var app=function(){"use strict";function e(){}function t(e){return e()}function n(){return Object.create(null)}function l(e){e.forEach(t)}function o(e){return"function"==typeof e}function i(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}let r;function c(e,t){return r||(r=document.createElement("a")),r.href=t,e===r.href}const a="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function s(e,t){e.appendChild(t)}function f(e,t,n){e.insertBefore(t,n||null)}function u(e){e.parentNode&&e.parentNode.removeChild(e)}function d(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function m(e){return document.createElement(e)}function p(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function h(e){return document.createTextNode(e)}function g(){return h(" ")}function $(){return h("")}function v(e,t,n,l){return e.addEventListener(t,n,l),()=>e.removeEventListener(t,n,l)}function y(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function _(e,t){t=""+t,e.data!==t&&(e.data=t)}function w(e,t,n,l){null==n?e.style.removeProperty(t):e.style.setProperty(t,n,l?"important":"")}function b(e,t,n){e.classList[n?"add":"remove"](t)}let z;function x(e){z=e}function C(e){(function(){if(!z)throw new Error("Function called outside component initialization");return z})().$$.on_mount.push(e)}const k=[],H=[];let L=[];const V=[],M=Promise.resolve();let D=!1;function S(e){L.push(e)}const A=new Set;let R=0;function N(){if(0!==R)return;const e=z;do{try{for(;R<k.length;){const e=k[R];R++,x(e),O(e.$$)}}catch(e){throw k.length=0,R=0,e}for(x(null),k.length=0,R=0;H.length;)H.pop()();for(let e=0;e<L.length;e+=1){const t=L[e];A.has(t)||(A.add(t),t())}L.length=0}while(k.length);for(;V.length;)V.pop()();D=!1,A.clear(),x(e)}function O(e){if(null!==e.fragment){e.update(),l(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(S)}}const E=new Set;let j;function W(){j={r:0,c:[],p:j}}function B(){j.r||l(j.c),j=j.p}function F(e,t){e&&e.i&&(E.delete(e),e.i(t))}function I(e,t,n,l){if(e&&e.o){if(E.has(e))return;E.add(e),j.c.push((()=>{E.delete(e),l&&(n&&e.d(1),l())})),e.o(t)}else l&&l()}function P(e){e&&e.c()}function U(e,n,i,r){const{fragment:c,after_update:a}=e.$$;c&&c.m(n,i),r||S((()=>{const n=e.$$.on_mount.map(t).filter(o);e.$$.on_destroy?e.$$.on_destroy.push(...n):l(n),e.$$.on_mount=[]})),a.forEach(S)}function T(e,t){const n=e.$$;null!==n.fragment&&(!function(e){const t=[],n=[];L.forEach((l=>-1===e.indexOf(l)?t.push(l):n.push(l))),n.forEach((e=>e())),L=t}(n.after_update),l(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function X(e,t){-1===e.$$.dirty[0]&&(k.push(e),D||(D=!0,M.then(N)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function q(t,o,i,r,c,a,s,f=[-1]){const d=z;x(t);const m=t.$$={fragment:null,ctx:[],props:a,update:e,not_equal:c,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(o.context||(d?d.$$.context:[])),callbacks:n(),dirty:f,skip_bound:!1,root:o.target||d.$$.root};s&&s(m.root);let p=!1;if(m.ctx=i?i(t,o.props||{},((e,n,...l)=>{const o=l.length?l[0]:n;return m.ctx&&c(m.ctx[e],m.ctx[e]=o)&&(!m.skip_bound&&m.bound[e]&&m.bound[e](o),p&&X(t,e)),n})):[],m.update(),p=!0,l(m.before_update),m.fragment=!!r&&r(m.ctx),o.target){if(o.hydrate){const e=function(e){return Array.from(e.childNodes)}(o.target);m.fragment&&m.fragment.l(e),e.forEach(u)}else m.fragment&&m.fragment.c();o.intro&&F(t.$$.fragment),U(t,o.target,o.anchor,o.customElement),N()}x(d)}class K{$destroy(){T(this,1),this.$destroy=e}$on(t,n){if(!o(n))return e;const l=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return l.push(n),()=>{const e=l.indexOf(n);-1!==e&&l.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Y=parseFloat;function Z(e,t=";"){let n;if(Array.isArray(e))n=e.filter((e=>e));else{n=[];for(const t in e)e[t]&&n.push(`${t}:${e[t]}`)}return n.join(t)}function J(e){let t,n,l,o,i,r,c,a;function d(e,t){return"string"==typeof e[10][4]?Q:G}let m=d(e),h=m(e);return{c(){t=p("svg"),n=p("g"),l=p("g"),h.c(),y(l,"transform",e[12]),y(n,"transform",o="translate("+e[10][0]/2+" "+e[10][1]/2+")"),y(n,"transform-origin",i=e[10][0]/4+" 0"),y(t,"id",r=e[1]||void 0),y(t,"class",c="svelte-fa "+e[0]+" svelte-1cj2gr0"),y(t,"style",e[11]),y(t,"viewBox",a="0 0 "+e[10][0]+" "+e[10][1]),y(t,"aria-hidden","true"),y(t,"role","img"),y(t,"xmlns","http://www.w3.org/2000/svg"),b(t,"pulse",e[4]),b(t,"spin",e[3])},m(e,o){f(e,t,o),s(t,n),s(n,l),h.m(l,null)},p(e,s){m===(m=d(e))&&h?h.p(e,s):(h.d(1),h=m(e),h&&(h.c(),h.m(l,null))),4096&s&&y(l,"transform",e[12]),1024&s&&o!==(o="translate("+e[10][0]/2+" "+e[10][1]/2+")")&&y(n,"transform",o),1024&s&&i!==(i=e[10][0]/4+" 0")&&y(n,"transform-origin",i),2&s&&r!==(r=e[1]||void 0)&&y(t,"id",r),1&s&&c!==(c="svelte-fa "+e[0]+" svelte-1cj2gr0")&&y(t,"class",c),2048&s&&y(t,"style",e[11]),1024&s&&a!==(a="0 0 "+e[10][0]+" "+e[10][1])&&y(t,"viewBox",a),17&s&&b(t,"pulse",e[4]),9&s&&b(t,"spin",e[3])},d(e){e&&u(t),h.d()}}}function G(e){let t,n,l,o,i,r,c,a,s,d;return{c(){t=p("path"),r=p("path"),y(t,"d",n=e[10][4][0]),y(t,"fill",l=e[6]||e[2]||"currentColor"),y(t,"fill-opacity",o=0!=e[9]?e[7]:e[8]),y(t,"transform",i="translate("+e[10][0]/-2+" "+e[10][1]/-2+")"),y(r,"d",c=e[10][4][1]),y(r,"fill",a=e[5]||e[2]||"currentColor"),y(r,"fill-opacity",s=0!=e[9]?e[8]:e[7]),y(r,"transform",d="translate("+e[10][0]/-2+" "+e[10][1]/-2+")")},m(e,n){f(e,t,n),f(e,r,n)},p(e,f){1024&f&&n!==(n=e[10][4][0])&&y(t,"d",n),68&f&&l!==(l=e[6]||e[2]||"currentColor")&&y(t,"fill",l),896&f&&o!==(o=0!=e[9]?e[7]:e[8])&&y(t,"fill-opacity",o),1024&f&&i!==(i="translate("+e[10][0]/-2+" "+e[10][1]/-2+")")&&y(t,"transform",i),1024&f&&c!==(c=e[10][4][1])&&y(r,"d",c),36&f&&a!==(a=e[5]||e[2]||"currentColor")&&y(r,"fill",a),896&f&&s!==(s=0!=e[9]?e[8]:e[7])&&y(r,"fill-opacity",s),1024&f&&d!==(d="translate("+e[10][0]/-2+" "+e[10][1]/-2+")")&&y(r,"transform",d)},d(e){e&&u(t),e&&u(r)}}}function Q(e){let t,n,l,o;return{c(){t=p("path"),y(t,"d",n=e[10][4]),y(t,"fill",l=e[2]||e[5]||"currentColor"),y(t,"transform",o="translate("+e[10][0]/-2+" "+e[10][1]/-2+")")},m(e,n){f(e,t,n)},p(e,i){1024&i&&n!==(n=e[10][4])&&y(t,"d",n),36&i&&l!==(l=e[2]||e[5]||"currentColor")&&y(t,"fill",l),1024&i&&o!==(o="translate("+e[10][0]/-2+" "+e[10][1]/-2+")")&&y(t,"transform",o)},d(e){e&&u(t)}}}function ee(t){let n,l=t[10][4]&&J(t);return{c(){l&&l.c(),n=$()},m(e,t){l&&l.m(e,t),f(e,n,t)},p(e,[t]){e[10][4]?l?l.p(e,t):(l=J(e),l.c(),l.m(n.parentNode,n)):l&&(l.d(1),l=null)},i:e,o:e,d(e){l&&l.d(e),e&&u(n)}}}function te(e,t,n){let l,o,i,{class:r=""}=t,{id:c=""}=t,{style:a=""}=t,{icon:s}=t,{size:f=""}=t,{color:u=""}=t,{fw:d=!1}=t,{pull:m=""}=t,{scale:p=1}=t,{translateX:h=0}=t,{translateY:g=0}=t,{rotate:$=""}=t,{flip:v=!1}=t,{spin:y=!1}=t,{pulse:_=!1}=t,{primaryColor:w=""}=t,{secondaryColor:b=""}=t,{primaryOpacity:z=1}=t,{secondaryOpacity:x=.4}=t,{swapOpacity:C=!1}=t;return e.$$set=e=>{"class"in e&&n(0,r=e.class),"id"in e&&n(1,c=e.id),"style"in e&&n(13,a=e.style),"icon"in e&&n(14,s=e.icon),"size"in e&&n(15,f=e.size),"color"in e&&n(2,u=e.color),"fw"in e&&n(16,d=e.fw),"pull"in e&&n(17,m=e.pull),"scale"in e&&n(18,p=e.scale),"translateX"in e&&n(19,h=e.translateX),"translateY"in e&&n(20,g=e.translateY),"rotate"in e&&n(21,$=e.rotate),"flip"in e&&n(22,v=e.flip),"spin"in e&&n(3,y=e.spin),"pulse"in e&&n(4,_=e.pulse),"primaryColor"in e&&n(5,w=e.primaryColor),"secondaryColor"in e&&n(6,b=e.secondaryColor),"primaryOpacity"in e&&n(7,z=e.primaryOpacity),"secondaryOpacity"in e&&n(8,x=e.secondaryOpacity),"swapOpacity"in e&&n(9,C=e.swapOpacity)},e.$$.update=()=>{16384&e.$$.dirty&&n(10,l=s&&s.icon||[0,0,"",[],""]),237568&e.$$.dirty&&n(11,o=function(e,t,n,l){let o,i,r,c,a,s="-.125em";return l&&(a="center",i="1.25em"),n&&(o=n),t&&("lg"==t?(c="1.33333em",r=".75em",s="-.225em"):c="xs"==t?".75em":"sm"==t?".875em":t.replace("x","em")),Z([Z({float:o,width:i,height:"1em","line-height":r,"font-size":c,"text-align":a,"vertical-align":s,"transform-origin":"center",overflow:"visible"}),e])}(a,f,m,d)),8126464&e.$$.dirty&&n(12,i=function(e,t,n,l,o,i=1,r="",c=""){let a=1,s=1;return o&&("horizontal"==o?a=-1:"vertical"==o?s=-1:a=s=-1),Z([`translate(${Y(t)*i}${r},${Y(n)*i}${r})`,`scale(${a*Y(e)},${s*Y(e)})`,l&&`rotate(${l}${c})`]," ")}(p,h,g,$,v,512))},[r,c,u,y,_,w,b,z,x,C,l,o,i,a,s,f,d,m,p,h,g,$,v]}class ne extends K{constructor(e){super(),q(this,e,te,ee,i,{class:0,id:1,style:13,icon:14,size:15,color:2,fw:16,pull:17,scale:18,translateX:19,translateY:20,rotate:21,flip:22,spin:3,pulse:4,primaryColor:5,secondaryColor:6,primaryOpacity:7,secondaryOpacity:8,swapOpacity:9})}}
1
+ var app=function(){"use strict";function e(){}function t(e){return e()}function n(){return Object.create(null)}function l(e){e.forEach(t)}function o(e){return"function"==typeof e}function i(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}let r;function c(e,t){return e===t||(r||(r=document.createElement("a")),r.href=t,e===r.href)}const a="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function s(e,t){e.appendChild(t)}function f(e,t,n){e.insertBefore(t,n||null)}function u(e){e.parentNode&&e.parentNode.removeChild(e)}function d(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function m(e){return document.createElement(e)}function p(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function h(e){return document.createTextNode(e)}function g(){return h(" ")}function $(){return h("")}function v(e,t,n,l){return e.addEventListener(t,n,l),()=>e.removeEventListener(t,n,l)}function y(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function _(e,t){t=""+t,e.data!==t&&(e.data=t)}function w(e,t){e.value=null==t?"":t}function b(e,t,n,l){null==n?e.style.removeProperty(t):e.style.setProperty(t,n,l?"important":"")}function z(e,t,n){e.classList.toggle(t,!!n)}let x;function C(e){x=e}function k(e){(function(){if(!x)throw new Error("Function called outside component initialization");return x})().$$.on_mount.push(e)}const H=[],L=[];let V=[];const M=[],D=Promise.resolve();let S=!1;function A(e){V.push(e)}const R=new Set;let N=0;function O(){if(0!==N)return;const e=x;do{try{for(;N<H.length;){const e=H[N];N++,C(e),j(e.$$)}}catch(e){throw H.length=0,N=0,e}for(C(null),H.length=0,N=0;L.length;)L.pop()();for(let e=0;e<V.length;e+=1){const t=V[e];R.has(t)||(R.add(t),t())}V.length=0}while(H.length);for(;M.length;)M.pop()();S=!1,R.clear(),C(e)}function j(e){if(null!==e.fragment){e.update(),l(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(A)}}const E=new Set;let W;function B(){W={r:0,c:[],p:W}}function F(){W.r||l(W.c),W=W.p}function I(e,t){e&&e.i&&(E.delete(e),e.i(t))}function P(e,t,n,l){if(e&&e.o){if(E.has(e))return;E.add(e),W.c.push((()=>{E.delete(e),l&&(n&&e.d(1),l())})),e.o(t)}else l&&l()}function U(e){return void 0!==e?.length?e:Array.from(e)}function T(e){e&&e.c()}function X(e,n,i){const{fragment:r,after_update:c}=e.$$;r&&r.m(n,i),A((()=>{const n=e.$$.on_mount.map(t).filter(o);e.$$.on_destroy?e.$$.on_destroy.push(...n):l(n),e.$$.on_mount=[]})),c.forEach(A)}function q(e,t){const n=e.$$;null!==n.fragment&&(!function(e){const t=[],n=[];V.forEach((l=>-1===e.indexOf(l)?t.push(l):n.push(l))),n.forEach((e=>e())),V=t}(n.after_update),l(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function K(e,t){-1===e.$$.dirty[0]&&(H.push(e),S||(S=!0,D.then(O)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function Y(t,o,i,r,c,a,s=null,f=[-1]){const d=x;C(t);const m=t.$$={fragment:null,ctx:[],props:a,update:e,not_equal:c,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(o.context||(d?d.$$.context:[])),callbacks:n(),dirty:f,skip_bound:!1,root:o.target||d.$$.root};s&&s(m.root);let p=!1;if(m.ctx=i?i(t,o.props||{},((e,n,...l)=>{const o=l.length?l[0]:n;return m.ctx&&c(m.ctx[e],m.ctx[e]=o)&&(!m.skip_bound&&m.bound[e]&&m.bound[e](o),p&&K(t,e)),n})):[],m.update(),p=!0,l(m.before_update),m.fragment=!!r&&r(m.ctx),o.target){if(o.hydrate){const e=function(e){return Array.from(e.childNodes)}(o.target);m.fragment&&m.fragment.l(e),e.forEach(u)}else m.fragment&&m.fragment.c();o.intro&&I(t.$$.fragment),X(t,o.target,o.anchor),O()}C(d)}class Z{$$=void 0;$$set=void 0;$destroy(){q(this,1),this.$destroy=e}$on(t,n){if(!o(n))return e;const l=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return l.push(n),()=>{const e=l.indexOf(n);-1!==e&&l.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}"undefined"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4");const J=parseFloat;function G(e,t=";"){let n;if(Array.isArray(e))n=e.filter((e=>e));else{n=[];for(const t in e)e[t]&&n.push(`${t}:${e[t]}`)}return n.join(t)}function Q(e){let t,n,l,o,i,r,c,a;function d(e,t){return"string"==typeof e[10][4]?te:ee}let m=d(e),h=m(e);return{c(){t=p("svg"),n=p("g"),l=p("g"),h.c(),y(l,"transform",e[12]),y(n,"transform",o="translate("+e[10][0]/2+" "+e[10][1]/2+")"),y(n,"transform-origin",i=e[10][0]/4+" 0"),y(t,"id",r=e[1]||void 0),y(t,"class",c="svelte-fa "+e[0]+" svelte-1cj2gr0"),y(t,"style",e[11]),y(t,"viewBox",a="0 0 "+e[10][0]+" "+e[10][1]),y(t,"aria-hidden","true"),y(t,"role","img"),y(t,"xmlns","http://www.w3.org/2000/svg"),z(t,"pulse",e[4]),z(t,"spin",e[3])},m(e,o){f(e,t,o),s(t,n),s(n,l),h.m(l,null)},p(e,s){m===(m=d(e))&&h?h.p(e,s):(h.d(1),h=m(e),h&&(h.c(),h.m(l,null))),4096&s&&y(l,"transform",e[12]),1024&s&&o!==(o="translate("+e[10][0]/2+" "+e[10][1]/2+")")&&y(n,"transform",o),1024&s&&i!==(i=e[10][0]/4+" 0")&&y(n,"transform-origin",i),2&s&&r!==(r=e[1]||void 0)&&y(t,"id",r),1&s&&c!==(c="svelte-fa "+e[0]+" svelte-1cj2gr0")&&y(t,"class",c),2048&s&&y(t,"style",e[11]),1024&s&&a!==(a="0 0 "+e[10][0]+" "+e[10][1])&&y(t,"viewBox",a),17&s&&z(t,"pulse",e[4]),9&s&&z(t,"spin",e[3])},d(e){e&&u(t),h.d()}}}function ee(e){let t,n,l,o,i,r,c,a,s,d;return{c(){t=p("path"),r=p("path"),y(t,"d",n=e[10][4][0]),y(t,"fill",l=e[6]||e[2]||"currentColor"),y(t,"fill-opacity",o=0!=e[9]?e[7]:e[8]),y(t,"transform",i="translate("+e[10][0]/-2+" "+e[10][1]/-2+")"),y(r,"d",c=e[10][4][1]),y(r,"fill",a=e[5]||e[2]||"currentColor"),y(r,"fill-opacity",s=0!=e[9]?e[8]:e[7]),y(r,"transform",d="translate("+e[10][0]/-2+" "+e[10][1]/-2+")")},m(e,n){f(e,t,n),f(e,r,n)},p(e,f){1024&f&&n!==(n=e[10][4][0])&&y(t,"d",n),68&f&&l!==(l=e[6]||e[2]||"currentColor")&&y(t,"fill",l),896&f&&o!==(o=0!=e[9]?e[7]:e[8])&&y(t,"fill-opacity",o),1024&f&&i!==(i="translate("+e[10][0]/-2+" "+e[10][1]/-2+")")&&y(t,"transform",i),1024&f&&c!==(c=e[10][4][1])&&y(r,"d",c),36&f&&a!==(a=e[5]||e[2]||"currentColor")&&y(r,"fill",a),896&f&&s!==(s=0!=e[9]?e[8]:e[7])&&y(r,"fill-opacity",s),1024&f&&d!==(d="translate("+e[10][0]/-2+" "+e[10][1]/-2+")")&&y(r,"transform",d)},d(e){e&&(u(t),u(r))}}}function te(e){let t,n,l,o;return{c(){t=p("path"),y(t,"d",n=e[10][4]),y(t,"fill",l=e[2]||e[5]||"currentColor"),y(t,"transform",o="translate("+e[10][0]/-2+" "+e[10][1]/-2+")")},m(e,n){f(e,t,n)},p(e,i){1024&i&&n!==(n=e[10][4])&&y(t,"d",n),36&i&&l!==(l=e[2]||e[5]||"currentColor")&&y(t,"fill",l),1024&i&&o!==(o="translate("+e[10][0]/-2+" "+e[10][1]/-2+")")&&y(t,"transform",o)},d(e){e&&u(t)}}}function ne(t){let n,l=t[10][4]&&Q(t);return{c(){l&&l.c(),n=$()},m(e,t){l&&l.m(e,t),f(e,n,t)},p(e,[t]){e[10][4]?l?l.p(e,t):(l=Q(e),l.c(),l.m(n.parentNode,n)):l&&(l.d(1),l=null)},i:e,o:e,d(e){e&&u(n),l&&l.d(e)}}}function le(e,t,n){let l,o,i,{class:r=""}=t,{id:c=""}=t,{style:a=""}=t,{icon:s}=t,{size:f=""}=t,{color:u=""}=t,{fw:d=!1}=t,{pull:m=""}=t,{scale:p=1}=t,{translateX:h=0}=t,{translateY:g=0}=t,{rotate:$=""}=t,{flip:v=!1}=t,{spin:y=!1}=t,{pulse:_=!1}=t,{primaryColor:w=""}=t,{secondaryColor:b=""}=t,{primaryOpacity:z=1}=t,{secondaryOpacity:x=.4}=t,{swapOpacity:C=!1}=t;return e.$$set=e=>{"class"in e&&n(0,r=e.class),"id"in e&&n(1,c=e.id),"style"in e&&n(13,a=e.style),"icon"in e&&n(14,s=e.icon),"size"in e&&n(15,f=e.size),"color"in e&&n(2,u=e.color),"fw"in e&&n(16,d=e.fw),"pull"in e&&n(17,m=e.pull),"scale"in e&&n(18,p=e.scale),"translateX"in e&&n(19,h=e.translateX),"translateY"in e&&n(20,g=e.translateY),"rotate"in e&&n(21,$=e.rotate),"flip"in e&&n(22,v=e.flip),"spin"in e&&n(3,y=e.spin),"pulse"in e&&n(4,_=e.pulse),"primaryColor"in e&&n(5,w=e.primaryColor),"secondaryColor"in e&&n(6,b=e.secondaryColor),"primaryOpacity"in e&&n(7,z=e.primaryOpacity),"secondaryOpacity"in e&&n(8,x=e.secondaryOpacity),"swapOpacity"in e&&n(9,C=e.swapOpacity)},e.$$.update=()=>{16384&e.$$.dirty&&n(10,l=s&&s.icon||[0,0,"",[],""]),237568&e.$$.dirty&&n(11,o=function(e,t,n,l){let o,i,r,c,a,s="-.125em";return l&&(a="center",i="1.25em"),n&&(o=n),t&&("lg"==t?(c="1.33333em",r=".75em",s="-.225em"):c="xs"==t?".75em":"sm"==t?".875em":t.replace("x","em")),G([G({float:o,width:i,height:"1em","line-height":r,"font-size":c,"text-align":a,"vertical-align":s,"transform-origin":"center",overflow:"visible"}),e])}(a,f,m,d)),8126464&e.$$.dirty&&n(12,i=function(e,t,n,l,o,i=1,r="",c=""){let a=1,s=1;return o&&("horizontal"==o?a=-1:"vertical"==o?s=-1:a=s=-1),G([`translate(${J(t)*i}${r},${J(n)*i}${r})`,`scale(${a*J(e)},${s*J(e)})`,l&&`rotate(${l}${c})`]," ")}(p,h,g,$,v,512))},[r,c,u,y,_,w,b,z,x,C,l,o,i,a,s,f,d,m,p,h,g,$,v]}class oe extends Z{constructor(e){super(),Y(this,e,le,ne,i,{class:0,id:1,style:13,icon:14,size:15,color:2,fw:16,pull:17,scale:18,translateX:19,translateY:20,rotate:21,flip:22,spin:3,pulse:4,primaryColor:5,secondaryColor:6,primaryOpacity:7,secondaryOpacity:8,swapOpacity:9})}}
2
2
  /*!
3
- * Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com
4
- * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
5
- */var le={prefix:"fas",iconName:"caret-down",icon:[320,512,[],"f0d7","M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"]},oe={prefix:"fas",iconName:"caret-up",icon:[320,512,[],"f0d8","M288.662 352H31.338c-17.818 0-26.741-21.543-14.142-34.142l128.662-128.662c7.81-7.81 20.474-7.81 28.284 0l128.662 128.662c12.6 12.599 3.676 34.142-14.142 34.142z"]},ie={prefix:"fas",iconName:"file",icon:[384,512,[],"f15b","M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm160-14.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"]},re={prefix:"fas",iconName:"file-alt",icon:[384,512,[],"f15c","M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm64 236c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12v8zm0-64c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12v8zm0-72v8c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12zm96-114.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"]},ce={prefix:"fas",iconName:"file-audio",icon:[384,512,[],"f1c7","M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm-64 268c0 10.7-12.9 16-20.5 8.5L104 376H76c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h28l35.5-36.5c7.6-7.6 20.5-2.2 20.5 8.5v136zm33.2-47.6c9.1-9.3 9.1-24.1 0-33.4-22.1-22.8 12.2-56.2 34.4-33.5 27.2 27.9 27.2 72.4 0 100.4-21.8 22.3-56.9-10.4-34.4-33.5zm86-117.1c54.4 55.9 54.4 144.8 0 200.8-21.8 22.4-57-10.3-34.4-33.5 36.2-37.2 36.3-96.5 0-133.8-22.1-22.8 12.3-56.3 34.4-33.5zM384 121.9v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"]},ae={prefix:"fas",iconName:"file-csv",icon:[384,512,[],"f6dd","M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm-96 144c0 4.42-3.58 8-8 8h-8c-8.84 0-16 7.16-16 16v32c0 8.84 7.16 16 16 16h8c4.42 0 8 3.58 8 8v16c0 4.42-3.58 8-8 8h-8c-26.51 0-48-21.49-48-48v-32c0-26.51 21.49-48 48-48h8c4.42 0 8 3.58 8 8v16zm44.27 104H160c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h12.27c5.95 0 10.41-3.5 10.41-6.62 0-1.3-.75-2.66-2.12-3.84l-21.89-18.77c-8.47-7.22-13.33-17.48-13.33-28.14 0-21.3 19.02-38.62 42.41-38.62H200c4.42 0 8 3.58 8 8v16c0 4.42-3.58 8-8 8h-12.27c-5.95 0-10.41 3.5-10.41 6.62 0 1.3.75 2.66 2.12 3.84l21.89 18.77c8.47 7.22 13.33 17.48 13.33 28.14.01 21.29-19 38.62-42.39 38.62zM256 264v20.8c0 20.27 5.7 40.17 16 56.88 10.3-16.7 16-36.61 16-56.88V264c0-4.42 3.58-8 8-8h16c4.42 0 8 3.58 8 8v20.8c0 35.48-12.88 68.89-36.28 94.09-3.02 3.25-7.27 5.11-11.72 5.11s-8.7-1.86-11.72-5.11c-23.4-25.2-36.28-58.61-36.28-94.09V264c0-4.42 3.58-8 8-8h16c4.42 0 8 3.58 8 8zm121-159L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128v-6.1c0-6.3-2.5-12.4-7-16.9z"]},se={prefix:"fas",iconName:"file-excel",icon:[384,512,[],"f1c3","M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm60.1 106.5L224 336l60.1 93.5c5.1 8-.6 18.5-10.1 18.5h-34.9c-4.4 0-8.5-2.4-10.6-6.3C208.9 405.5 192 373 192 373c-6.4 14.8-10 20-36.6 68.8-2.1 3.9-6.1 6.3-10.5 6.3H110c-9.5 0-15.2-10.5-10.1-18.5l60.3-93.5-60.3-93.5c-5.2-8 .6-18.5 10.1-18.5h34.8c4.4 0 8.5 2.4 10.6 6.3 26.1 48.8 20 33.6 36.6 68.5 0 0 6.1-11.7 36.6-68.5 2.1-3.9 6.2-6.3 10.6-6.3H274c9.5-.1 15.2 10.4 10.1 18.4zM384 121.9v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"]},fe={prefix:"fas",iconName:"file-image",icon:[384,512,[],"f1c5","M384 121.941V128H256V0h6.059a24 24 0 0 1 16.97 7.029l97.941 97.941a24.002 24.002 0 0 1 7.03 16.971zM248 160c-13.2 0-24-10.8-24-24V0H24C10.745 0 0 10.745 0 24v464c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24V160H248zm-135.455 16c26.51 0 48 21.49 48 48s-21.49 48-48 48-48-21.49-48-48 21.491-48 48-48zm208 240h-256l.485-48.485L104.545 328c4.686-4.686 11.799-4.201 16.485.485L160.545 368 264.06 264.485c4.686-4.686 12.284-4.686 16.971 0L320.545 304v112z"]},ue={prefix:"fas",iconName:"file-pdf",icon:[384,512,[],"f1c1","M181.9 256.1c-5-16-4.9-46.9-2-46.9 8.4 0 7.6 36.9 2 46.9zm-1.7 47.2c-7.7 20.2-17.3 43.3-28.4 62.7 18.3-7 39-17.2 62.9-21.9-12.7-9.6-24.9-23.4-34.5-40.8zM86.1 428.1c0 .8 13.2-5.4 34.9-40.2-6.7 6.3-29.1 24.5-34.9 40.2zM248 160h136v328c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V24C0 10.7 10.7 0 24 0h200v136c0 13.2 10.8 24 24 24zm-8 171.8c-20-12.2-33.3-29-42.7-53.8 4.5-18.5 11.6-46.6 6.2-64.2-4.7-29.4-42.4-26.5-47.8-6.8-5 18.3-.4 44.1 8.1 77-11.6 27.6-28.7 64.6-40.8 85.8-.1 0-.1.1-.2.1-27.1 13.9-73.6 44.5-54.5 68 5.6 6.9 16 10 21.5 10 17.9 0 35.7-18 61.1-61.8 25.8-8.5 54.1-19.1 79-23.2 21.7 11.8 47.1 19.5 64 19.5 29.2 0 31.2-32 19.7-43.4-13.9-13.6-54.3-9.7-73.6-7.2zM377 105L279 7c-4.5-4.5-10.6-7-17-7h-6v128h128v-6.1c0-6.3-2.5-12.4-7-16.9zm-74.1 255.3c4.1-2.7-2.5-11.9-42.8-9 37.1 15.8 42.8 9 42.8 9z"]},de={prefix:"fas",iconName:"file-video",icon:[384,512,[],"f1c8","M384 121.941V128H256V0h6.059c6.365 0 12.47 2.529 16.971 7.029l97.941 97.941A24.005 24.005 0 0 1 384 121.941zM224 136V0H24C10.745 0 0 10.745 0 24v464c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24V160H248c-13.2 0-24-10.8-24-24zm96 144.016v111.963c0 21.445-25.943 31.998-40.971 16.971L224 353.941V392c0 13.255-10.745 24-24 24H88c-13.255 0-24-10.745-24-24V280c0-13.255 10.745-24 24-24h112c13.255 0 24 10.745 24 24v38.059l55.029-55.013c15.011-15.01 40.971-4.491 40.971 16.97z"]},me={prefix:"fas",iconName:"file-word",icon:[384,512,[],"f1c2","M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm57.1 120H305c7.7 0 13.4 7.1 11.7 14.7l-38 168c-1.2 5.5-6.1 9.3-11.7 9.3h-38c-5.5 0-10.3-3.8-11.6-9.1-25.8-103.5-20.8-81.2-25.6-110.5h-.5c-1.1 14.3-2.4 17.4-25.6 110.5-1.3 5.3-6.1 9.1-11.6 9.1H117c-5.6 0-10.5-3.9-11.7-9.4l-37.8-168c-1.7-7.5 4-14.6 11.7-14.6h24.5c5.7 0 10.7 4 11.8 9.7 15.6 78 20.1 109.5 21 122.2 1.6-10.2 7.3-32.7 29.4-122.7 1.3-5.4 6.1-9.1 11.7-9.1h29.1c5.6 0 10.4 3.8 11.7 9.2 24 100.4 28.8 124 29.6 129.4-.2-11.2-2.6-17.8 21.6-129.2 1-5.6 5.9-9.5 11.5-9.5zM384 121.9v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"]},pe={prefix:"fas",iconName:"folder",icon:[512,512,[],"f07b","M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z"]},he={prefix:"fas",iconName:"folder-plus",icon:[512,512,[],"f65e","M464,128H272L208,64H48A48,48,0,0,0,0,112V400a48,48,0,0,0,48,48H464a48,48,0,0,0,48-48V176A48,48,0,0,0,464,128ZM359.5,296a16,16,0,0,1-16,16h-64v64a16,16,0,0,1-16,16h-16a16,16,0,0,1-16-16V312h-64a16,16,0,0,1-16-16V280a16,16,0,0,1,16-16h64V200a16,16,0,0,1,16-16h16a16,16,0,0,1,16,16v64h64a16,16,0,0,1,16,16Z"]},ge={prefix:"fas",iconName:"home",icon:[576,512,[],"f015","M280.37 148.26L96 300.11V464a16 16 0 0 0 16 16l112.06-.29a16 16 0 0 0 15.92-16V368a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16v95.64a16 16 0 0 0 16 16.05L464 480a16 16 0 0 0 16-16V300L295.67 148.26a12.19 12.19 0 0 0-15.3 0zM571.6 251.47L488 182.56V44.05a12 12 0 0 0-12-12h-56a12 12 0 0 0-12 12v72.61L318.47 43a48 48 0 0 0-61 0L4.34 251.47a12 12 0 0 0-1.6 16.9l25.5 31A12 12 0 0 0 45.15 301l235.22-193.74a12.19 12.19 0 0 1 15.3 0L530.9 301a12 12 0 0 0 16.9-1.6l25.5-31a12 12 0 0 0-1.7-16.93z"]};const{window:$e}=a;function ve(e,t,n){const l=e.slice();return l[44]=t[n],l}function ye(e,t,n){const l=e.slice();return l[47]=t[n],l}function _e(e,t,n){const l=e.slice();return l[50]=t[n],l}function we(e,t,n){const l=e.slice();return l[53]=t[n],l}function be(t){let n,l=t[53].name+"";return{c(){n=h(l)},m(e,t){f(e,n,t)},p(e,t){32&t[0]&&l!==(l=e[53].name+"")&&_(n,l)},i:e,o:e,d(e){e&&u(n)}}}function ze(e){let t,n;return t=new ne({props:{icon:e[53].icon}}),{c(){P(t.$$.fragment)},m(e,l){U(t,e,l),n=!0},p(e,n){const l={};32&n[0]&&(l.icon=e[53].icon),t.$set(l)},i(e){n||(F(t.$$.fragment,e),n=!0)},o(e){I(t.$$.fragment,e),n=!1},d(e){T(t,e)}}}function xe(e){let t,n,l,i,r,c,a;const d=[ze,be],p=[];function h(e,t){return e[53].icon?0:1}return n=h(e),l=p[n]=d[n](e),{c(){t=m("li"),l.c(),i=g(),y(t,"class","breadcrumb-item")},m(l,u){f(l,t,u),p[n].m(t,null),s(t,i),r=!0,c||(a=v(t,"click",(function(){o(e[21](e[53].location))&&e[21](e[53].location).apply(this,arguments)})),c=!0)},p(o,r){let c=n;n=h(e=o),n===c?p[n].p(e,r):(W(),I(p[c],1,1,(()=>{p[c]=null})),B(),l=p[n],l?l.p(e,r):(l=p[n]=d[n](e),l.c()),F(l,1),l.m(t,i))},i(e){r||(F(l),r=!0)},o(e){I(l),r=!1},d(e){e&&u(t),p[n].d(),c=!1,a()}}}function Ce(e){let t;return{c(){t=m("th"),t.textContent="Location"},m(e,n){f(e,t,n)},d(e){e&&u(t)}}}function ke(e){let t,n=e[50].filename+"";return{c(){t=h(n)},m(e,n){f(e,t,n)},p(e,l){2&l[0]&&n!==(n=e[50].filename+"")&&_(t,n)},d(e){e&&u(t)}}}function He(e){let t,n,l=e[50].filename+"";return{c(){t=h(l),n=h("/")},m(e,l){f(e,t,l),f(e,n,l)},p(e,n){2&n[0]&&l!==(l=e[50].filename+"")&&_(t,l)},d(e){e&&u(t),e&&u(n)}}}function Le(e){let t,n,l=e[25](e[50])+"";return{c(){t=m("td"),n=h(l)},m(e,l){f(e,t,l),s(t,n)},p(e,t){2&t[0]&&l!==(l=e[25](e[50])+"")&&_(n,l)},d(e){e&&u(t)}}}function Ve(e){let t,n,o,i,r,c,a,d,p,$,z,x,C,k,H,L,V,M,D,S,A,R=e[50].mimetype+"",N=(e[50].isDirectory?"":e[50].size_kb)+"",O=e[3][e[50].min_role_read]+"",E=new Date(e[50].uploaded_at).toLocaleString()+"";function j(e,t){return e[50].isDirectory?He:ke}o=new ne({props:{size:"lg",icon:e[22](e[50])}});let W=j(e),B=W(e),X=e[12]&&Le(e);function q(...t){return e[36](e[50],...t)}function K(){return e[37](e[50])}return{c(){t=m("tr"),n=m("td"),P(o.$$.fragment),i=g(),r=m("td"),B.c(),c=g(),X&&X.c(),a=g(),d=m("td"),p=h(R),$=g(),z=m("td"),x=h(N),C=g(),k=m("td"),H=h(O),L=g(),V=m("td"),M=h(E),w(z,"text-align","right"),y(t,"class","svelte-16rl54v"),b(t,"selected",e[4][e[50].filename])},m(e,l){f(e,t,l),s(t,n),U(o,n,null),s(t,i),s(t,r),B.m(r,null),s(t,c),X&&X.m(t,null),s(t,a),s(t,d),s(d,p),s(t,$),s(t,z),s(z,x),s(t,C),s(t,k),s(k,H),s(t,L),s(t,V),s(V,M),D=!0,S||(A=[v(t,"click",q),v(t,"dblclick",K)],S=!0)},p(n,l){e=n;const i={};2&l[0]&&(i.icon=e[22](e[50])),o.$set(i),W===(W=j(e))&&B?B.p(e,l):(B.d(1),B=W(e),B&&(B.c(),B.m(r,null))),e[12]?X?X.p(e,l):(X=Le(e),X.c(),X.m(t,a)):X&&(X.d(1),X=null),(!D||2&l[0])&&R!==(R=e[50].mimetype+"")&&_(p,R),(!D||2&l[0])&&N!==(N=(e[50].isDirectory?"":e[50].size_kb)+"")&&_(x,N),(!D||10&l[0])&&O!==(O=e[3][e[50].min_role_read]+"")&&_(H,O),(!D||2&l[0])&&E!==(E=new Date(e[50].uploaded_at).toLocaleString()+"")&&_(M,E),(!D||18&l[0])&&b(t,"selected",e[4][e[50].filename])},i(e){D||(F(o.$$.fragment,e),D=!0)},o(e){I(o.$$.fragment,e),D=!1},d(e){e&&u(t),T(o),B.d(),X&&X.d(),S=!1,l(A)}}}function Me(e){let t;return{c(){t=m("td")},m(e,n){f(e,t,n)},d(e){e&&u(t)}}}function De(e){let t,n,o,i,r,c,a,p,w,b,z,x,C,k,H,L,V,M,D,S,A,R,N,O,E,j,W,B,F,I,P,U,T,X,q,K,Y,Z,J,G,Q,ee,te,ne,le,oe,ie,re,ce,ae=e[9].filename+"",se=new Date(e[9].uploaded_at).toLocaleString()+"",fe=e[3][e[9].min_role_read]+"",ue=1===e[7].length&&e[9].filename.endsWith(".zip"),de="image"===e[9].mime_super&&Se(e),me=!e[9].isDirectory&&Ae(e);function pe(e,t){return e[9].isDirectory?Ne:Re}let he=pe(e),ge=he(e),$e=e[7].length>1&&Oe(e),_e=e[8],we=[];for(let t=0;t<_e.length;t+=1)we[t]=Ee(ye(e,_e,t));let be=e[2],ze=[];for(let t=0;t<be.length;t+=1)ze[t]=je(ve(e,be,t));let xe=1===e[7].length&&We(),Ce=ue&&Be(),ke=e[7].length>1&&Fe(e);return{c(){t=m("h5"),n=h(ae),o=g(),de&&de.c(),i=g(),r=m("table"),c=m("tbody"),me&&me.c(),a=g(),p=m("tr"),w=m("th"),w.textContent="MIME type",b=g(),z=m("td"),ge.c(),x=g(),C=m("tr"),k=m("th"),k.textContent="Created",H=g(),L=m("td"),V=h(se),M=g(),D=m("tr"),S=m("th"),S.textContent="Role to access",A=g(),R=m("td"),N=h(fe),O=g(),E=m("div"),j=m("a"),W=h("Link"),F=h("\n  | \n "),I=m("a"),P=h("Download"),T=g(),$e&&$e.c(),X=g(),q=m("div"),K=m("select"),Y=m("option"),Y.textContent="Set access";for(let e=0;e<we.length;e+=1)we[e].c();Z=g(),J=m("select"),G=m("option"),G.textContent="Move to...";for(let e=0;e<ze.length;e+=1)ze[e].c();Q=g(),ee=m("select"),te=m("option"),te.textContent="Action...",ne=m("option"),ne.textContent="Delete",xe&&xe.c(),le=$(),Ce&&Ce.c(),oe=g(),ke&&ke.c(),ie=$(),y(S,"class","pe-1"),y(j,"href",B=`/files/serve/${e[9].location}`),y(I,"href",U=`/files/download/${e[9].location}`),Y.__value="",Y.value=Y.__value,Y.disabled=!0,Y.selected=!0,y(K,"id","setRoleSelectId"),y(K,"class","form-select svelte-16rl54v"),G.__value="",G.value=G.__value,G.disabled=!0,G.selected=!0,y(J,"class","form-select svelte-16rl54v"),te.__value="",te.value=te.__value,te.disabled=!0,te.selected=!0,ne.__value="Delete",ne.value=ne.__value,y(ee,"class","form-select svelte-16rl54v"),y(q,"class","file-actions d-flex svelte-16rl54v")},m(l,u){f(l,t,u),s(t,n),f(l,o,u),de&&de.m(l,u),f(l,i,u),f(l,r,u),s(r,c),me&&me.m(c,null),s(c,a),s(c,p),s(p,w),s(p,b),s(p,z),ge.m(z,null),s(c,x),s(c,C),s(C,k),s(C,H),s(C,L),s(L,V),s(c,M),s(c,D),s(D,S),s(D,A),s(D,R),s(R,N),f(l,O,u),f(l,E,u),s(E,j),s(j,W),s(E,F),s(E,I),s(I,P),f(l,T,u),$e&&$e.m(l,u),f(l,X,u),f(l,q,u),s(q,K),s(K,Y);for(let e=0;e<we.length;e+=1)we[e]&&we[e].m(K,null);s(q,Z),s(q,J),s(J,G);for(let e=0;e<ze.length;e+=1)ze[e]&&ze[e].m(J,null);s(q,Q),s(q,ee),s(ee,te),s(ee,ne),xe&&xe.m(ee,null),s(ee,le),Ce&&Ce.m(ee,null),f(l,oe,u),ke&&ke.m(l,u),f(l,ie,u),re||(ce=[v(K,"change",e[18]),v(J,"change",e[20]),v(ee,"change",e[17])],re=!0)},p(e,t){if(512&t[0]&&ae!==(ae=e[9].filename+"")&&_(n,ae),"image"===e[9].mime_super?de?de.p(e,t):(de=Se(e),de.c(),de.m(i.parentNode,i)):de&&(de.d(1),de=null),e[9].isDirectory?me&&(me.d(1),me=null):me?me.p(e,t):(me=Ae(e),me.c(),me.m(c,a)),he===(he=pe(e))&&ge?ge.p(e,t):(ge.d(1),ge=he(e),ge&&(ge.c(),ge.m(z,null))),512&t[0]&&se!==(se=new Date(e[9].uploaded_at).toLocaleString()+"")&&_(V,se),520&t[0]&&fe!==(fe=e[3][e[9].min_role_read]+"")&&_(N,fe),512&t[0]&&B!==(B=`/files/serve/${e[9].location}`)&&y(j,"href",B),512&t[0]&&U!==(U=`/files/download/${e[9].location}`)&&y(I,"href",U),e[7].length>1?$e?$e.p(e,t):($e=Oe(e),$e.c(),$e.m(X.parentNode,X)):$e&&($e.d(1),$e=null),256&t[0]){let n;for(_e=e[8],n=0;n<_e.length;n+=1){const l=ye(e,_e,n);we[n]?we[n].p(l,t):(we[n]=Ee(l),we[n].c(),we[n].m(K,null))}for(;n<we.length;n+=1)we[n].d(1);we.length=_e.length}if(4&t[0]){let n;for(be=e[2],n=0;n<be.length;n+=1){const l=ve(e,be,n);ze[n]?ze[n].p(l,t):(ze[n]=je(l),ze[n].c(),ze[n].m(J,null))}for(;n<ze.length;n+=1)ze[n].d(1);ze.length=be.length}1===e[7].length?xe||(xe=We(),xe.c(),xe.m(ee,le)):xe&&(xe.d(1),xe=null),640&t[0]&&(ue=1===e[7].length&&e[9].filename.endsWith(".zip")),ue?Ce||(Ce=Be(),Ce.c(),Ce.m(ee,null)):Ce&&(Ce.d(1),Ce=null),e[7].length>1?ke?ke.p(e,t):(ke=Fe(e),ke.c(),ke.m(ie.parentNode,ie)):ke&&(ke.d(1),ke=null)},d(e){e&&u(t),e&&u(o),de&&de.d(e),e&&u(i),e&&u(r),me&&me.d(),ge.d(),e&&u(O),e&&u(E),e&&u(T),$e&&$e.d(e),e&&u(X),e&&u(q),d(we,e),d(ze,e),xe&&xe.d(),Ce&&Ce.d(),e&&u(oe),ke&&ke.d(e),e&&u(ie),re=!1,l(ce)}}}function Se(e){let t,n,l;return{c(){t=m("img"),y(t,"class","file-preview my-2 svelte-16rl54v"),c(t.src,n=`/files/serve/${e[9].location}`)||y(t,"src",n),y(t,"alt",l=e[9].filename)},m(e,n){f(e,t,n)},p(e,o){512&o[0]&&!c(t.src,n=`/files/serve/${e[9].location}`)&&y(t,"src",n),512&o[0]&&l!==(l=e[9].filename)&&y(t,"alt",l)},d(e){e&&u(t)}}}function Ae(e){let t,n,l,o,i,r,c=e[9].size_kb+"";return{c(){t=m("tr"),n=m("th"),n.textContent="Size",l=g(),o=m("td"),i=h(c),r=h(" KB")},m(e,c){f(e,t,c),s(t,n),s(t,l),s(t,o),s(o,i),s(o,r)},p(e,t){512&t[0]&&c!==(c=e[9].size_kb+"")&&_(i,c)},d(e){e&&u(t)}}}function Re(e){let t,n,l,o=e[9].mime_super+"",i=e[9].mime_sub+"";return{c(){t=h(o),n=h("/"),l=h(i)},m(e,o){f(e,t,o),f(e,n,o),f(e,l,o)},p(e,n){512&n[0]&&o!==(o=e[9].mime_super+"")&&_(t,o),512&n[0]&&i!==(i=e[9].mime_sub+"")&&_(l,i)},d(e){e&&u(t),e&&u(n),e&&u(l)}}}function Ne(t){let n;return{c(){n=h("Directory")},m(e,t){f(e,n,t)},p:e,d(e){e&&u(n)}}}function Oe(e){let t,n,l,o,i,r,c=e[7].length-1+"",a=e[7].length>2?"s":"";return{c(){t=m("strong"),n=h("and "),l=h(c),o=h(" other file"),i=h(a),r=h(":")},m(e,c){f(e,t,c),s(t,n),s(t,l),s(t,o),s(t,i),s(t,r)},p(e,t){128&t[0]&&c!==(c=e[7].length-1+"")&&_(l,c),128&t[0]&&a!==(a=e[7].length>2?"s":"")&&_(i,a)},d(e){e&&u(t)}}}function Ee(e){let t,n,l,o=e[47].role+"";return{c(){t=m("option"),n=h(o),t.__value=l=e[47].id,t.value=t.__value},m(e,l){f(e,t,l),s(t,n)},p(e,i){256&i[0]&&o!==(o=e[47].role+"")&&_(n,o),256&i[0]&&l!==(l=e[47].id)&&(t.__value=l,t.value=t.__value)},d(e){e&&u(t)}}}function je(e){let t,n,l,o=(e[44].location||"/")+"";return{c(){t=m("option"),n=h(o),t.__value=l=e[44].location||"/",t.value=t.__value},m(e,l){f(e,t,l),s(t,n)},p(e,i){4&i[0]&&o!==(o=(e[44].location||"/")+"")&&_(n,o),4&i[0]&&l!==(l=e[44].location||"/")&&(t.__value=l,t.value=t.__value)},d(e){e&&u(t)}}}function We(e){let t;return{c(){t=m("option"),t.textContent="Rename",t.__value="Rename",t.value=t.__value},m(e,n){f(e,t,n)},d(e){e&&u(t)}}}function Be(e){let t;return{c(){t=m("option"),t.textContent="Unzip",t.__value="Unzip",t.value=t.__value},m(e,n){f(e,t,n)},d(e){e&&u(t)}}}function Fe(t){let n,l,o;return{c(){n=m("button"),n.innerHTML='<i class="fas fa-file-archive"></i>\n Download Zip Archive',y(n,"class","btn btn-outline-secondary mt-2")},m(e,i){f(e,n,i),l||(o=v(n,"click",t[19]),l=!0)},p:e,d(e){e&&u(n),l=!1,o()}}}function Ie(e){let t,n,o,i,r,c,a,p,$,_,b,z,x,C,k,H,L,V,M,D,S,A,R,N,O,E,j,X,q,K,Y,Z,J,G,Q,ee,te,le,oe,ie,re,ce,ae,se,fe,ue,de,me,pe,ge,ve,ye,be,ze,ke,He,Le,Se,Ae=e[5],Re=[];for(let t=0;t<Ae.length;t+=1)Re[t]=xe(we(e,Ae,t));const Ne=e=>I(Re[e],1,1,(()=>{Re[e]=null}));S=new ne({props:{icon:e[24]("filename",e[10],e[11])}});let Oe=e[12]&&Ce();E=new ne({props:{icon:e[24]("mimetype",e[10],e[11])}}),q=new ne({props:{icon:e[24]("size_kb",e[10],e[11])}}),G=new ne({props:{icon:e[24]("min_role_read",e[10],e[11])}}),le=new ne({props:{icon:e[24]("uploaded_at",e[10],e[11])}});let Ee=e[1],je=[];for(let t=0;t<Ee.length;t+=1)je[t]=Ve(_e(e,Ee,t));const We=e=>I(je[e],1,1,(()=>{je[e]=null}));se=new ne({props:{size:"lg",icon:he}});let Be=e[12]&&Me(),Fe=e[7].length>0&&De(e);return{c(){t=m("main"),n=m("div"),o=m("div"),i=m("div"),r=m("nav"),c=m("ol");for(let e=0;e<Re.length;e+=1)Re[e].c();a=g(),p=m("div"),$=m("button"),$.innerHTML='<i class="fas fa-search"></i>',_=g(),b=m("input"),z=g(),x=m("div"),C=m("table"),k=m("thead"),H=m("tr"),L=m("th"),V=g(),M=m("th"),D=h("Filename\n "),P(S.$$.fragment),A=g(),Oe&&Oe.c(),R=g(),N=m("th"),O=h("Media type\n "),P(E.$$.fragment),j=g(),X=m("th"),P(q.$$.fragment),K=h("\n Size (KiB)"),Y=g(),Z=m("th"),J=h("Role to access\n "),P(G.$$.fragment),Q=g(),ee=m("th"),te=h("Created\n "),P(le.$$.fragment),oe=g(),ie=m("tbody");for(let e=0;e<je.length;e+=1)je[e].c();re=g(),ce=m("tr"),ae=m("td"),P(se.$$.fragment),fe=g(),ue=m("td"),ue.textContent="Create new folder...",de=g(),Be&&Be.c(),me=g(),pe=m("td"),ge=g(),ve=m("td"),ye=g(),be=m("td"),ze=g(),ke=m("div"),Fe&&Fe.c(),y(c,"class","breadcrumb"),y(r,"aria-label","breadcrumb"),y($,"class","btn btn-outline-secondary search-bar"),y($,"type","submit"),y($,"id","button-search-submit"),y(b,"type","search"),y(b,"class","form-control search-bar"),y(b,"placeholder","Search Files"),y(b,"aria-label","Search"),y(b,"aria-describedby","button-search-submit"),y(p,"class","input-group search-bar mb-3"),w(X,"text-align","right"),y(C,"class","table table-sm table-hover"),y(x,"class","filelist svelte-16rl54v"),y(o,"class","col-8"),y(ke,"class","col-4"),y(n,"id","drop-zone"),y(n,"ondragover","return false"),y(n,"class","row")},m(l,u){f(l,t,u),s(t,n),s(n,o),s(o,i),s(i,r),s(r,c);for(let e=0;e<Re.length;e+=1)Re[e]&&Re[e].m(c,null);s(o,a),s(o,p),s(p,$),s(p,_),s(p,b),s(o,z),s(o,x),s(x,C),s(C,k),s(k,H),s(H,L),s(H,V),s(H,M),s(M,D),U(S,M,null),s(H,A),Oe&&Oe.m(H,null),s(H,R),s(H,N),s(N,O),U(E,N,null),s(H,j),s(H,X),U(q,X,null),s(X,K),s(H,Y),s(H,Z),s(Z,J),U(G,Z,null),s(H,Q),s(H,ee),s(ee,te),U(le,ee,null),s(C,oe),s(C,ie);for(let e=0;e<je.length;e+=1)je[e]&&je[e].m(ie,null);s(ie,re),s(ie,ce),s(ce,ae),U(se,ae,null),s(ce,fe),s(ce,ue),s(ce,de),Be&&Be.m(ce,null),s(ce,me),s(ce,pe),s(ce,ge),s(ce,ve),s(ce,ye),s(ce,be),s(n,ze),s(n,ke),Fe&&Fe.m(ke,null),He=!0,Le||(Se=[v($e,"keydown",e[15]),v($e,"keyup",e[16]),v($,"click",e[27]),v(b,"change",e[28]),v(b,"focus",e[29]),v(b,"blur",e[30]),v(M,"click",e[31]),v(N,"click",e[32]),v(X,"click",e[33]),v(Z,"click",e[34]),v(ee,"click",e[35]),v(ce,"click",e[38]),v(n,"drop",e[26])],Le=!0)},p(e,t){if(2097184&t[0]){let n;for(Ae=e[5],n=0;n<Ae.length;n+=1){const l=we(e,Ae,n);Re[n]?(Re[n].p(l,t),F(Re[n],1)):(Re[n]=xe(l),Re[n].c(),F(Re[n],1),Re[n].m(c,null))}for(W(),n=Ae.length;n<Re.length;n+=1)Ne(n);B()}const n={};3072&t[0]&&(n.icon=e[24]("filename",e[10],e[11])),S.$set(n),e[12]?Oe||(Oe=Ce(),Oe.c(),Oe.m(H,R)):Oe&&(Oe.d(1),Oe=null);const l={};3072&t[0]&&(l.icon=e[24]("mimetype",e[10],e[11])),E.$set(l);const o={};3072&t[0]&&(o.icon=e[24]("size_kb",e[10],e[11])),q.$set(o);const i={};3072&t[0]&&(i.icon=e[24]("min_role_read",e[10],e[11])),G.$set(i);const r={};if(3072&t[0]&&(r.icon=e[24]("uploaded_at",e[10],e[11])),le.$set(r),39866394&t[0]){let n;for(Ee=e[1],n=0;n<Ee.length;n+=1){const l=_e(e,Ee,n);je[n]?(je[n].p(l,t),F(je[n],1)):(je[n]=Ve(l),je[n].c(),F(je[n],1),je[n].m(ie,re))}for(W(),n=Ee.length;n<je.length;n+=1)We(n);B()}e[12]?Be||(Be=Me(),Be.c(),Be.m(ce,me)):Be&&(Be.d(1),Be=null),e[7].length>0?Fe?Fe.p(e,t):(Fe=De(e),Fe.c(),Fe.m(ke,null)):Fe&&(Fe.d(1),Fe=null)},i(e){if(!He){for(let e=0;e<Ae.length;e+=1)F(Re[e]);F(S.$$.fragment,e),F(E.$$.fragment,e),F(q.$$.fragment,e),F(G.$$.fragment,e),F(le.$$.fragment,e);for(let e=0;e<Ee.length;e+=1)F(je[e]);F(se.$$.fragment,e),He=!0}},o(e){Re=Re.filter(Boolean);for(let e=0;e<Re.length;e+=1)I(Re[e]);I(S.$$.fragment,e),I(E.$$.fragment,e),I(q.$$.fragment,e),I(G.$$.fragment,e),I(le.$$.fragment,e),je=je.filter(Boolean);for(let e=0;e<je.length;e+=1)I(je[e]);I(se.$$.fragment,e),He=!1},d(e){e&&u(t),d(Re,e),T(S),Oe&&Oe.d(),T(E),T(q),T(G),T(le),d(je,e),T(se),Be&&Be.d(),Fe&&Fe.d(),Le=!1,l(Se)}}}async function Pe(e,t,n,l){const o=fetch(e,{headers:{"X-Requested-With":"XMLHttpRequest","CSRF-Token":window._sc_globalCsrf,...l?{}:{"Content-Type":"application/json"}},method:"POST",body:l?t:JSON.stringify(t||{})});if(!n)return await o;{const e=await o,t=await e.blob(),n=document.createElement("a");n.href=window.URL.createObjectURL(t);const l=e.headers.get("Content-Disposition");if(l){let e=l.split(";")[1].split("=")[1].replaceAll('"',"");n.download=e}else n.target="_blank";n.click()}}function Ue(e,t,n){let l,o,i,{files:r=[]}=t,{directories:c=[]}=t,{roles:a={}}=t,{currentFolder:s="/"}=t,f=!1,u=[],d={},m=!1,p="";const h=async function(e,t){const f=await fetch(`/files?dir=${encodeURIComponent(s)}${p?`&search=${encodeURIComponent(p)}`:""}`,{headers:{"X-Requested-With":"XMLHttpRequest"}}),m=await f.json();n(1,r=m.files);for(const e of r)e.mimetype=e.mime_sub&&e.mime_super?`${e.mime_super}/${e.mime_sub}`:"";n(2,c=m.directories),n(8,l=m.roles);for(const e of m.roles)n(3,a[e.id]=e.role,a);e?o&&n(9,o=r.find((e=>e.filename===o.filename))):(n(7,u=[]),n(4,d={}),n(9,o=null)),t||emptyAlerts(),_(i||"filename",!0)};function g(e,t){if(".."==e.filename)return;e.selected=!0;const l=d[e.filename];if(t.shiftKey||n(4,d={}),n(4,d[e.filename]=!l,d),l){const e=Object.entries(d).findLast((([e,t])=>t));n(9,o=e?r.find((t=>t.filename===e[0])):null)}else n(9,o=e);document.getSelection().removeAllRanges();const i=document.getElementById("setRoleSelectId");i&&(i.value=""),console.log(o)}C((async()=>{(()=>{const e=new URL(window.location);n(10,i=e.searchParams.get("sortBy")),n(11,m="on"===e.searchParams.get("sortDesc"));const t=e.searchParams.get("dir");t&&n(0,s=t)})(),await h(!1,!0)}));let $=!1;function v(e){n(0,s=e),(()=>{const e=new URL(window.location);e.searchParams.get("dir")!==s&&(e.searchParams.set("dir",s),window.history.replaceState(null,"",e.toString()))})(),h()}let y=[];function _(e,t){i!==e||t?i!==e&&(n(10,i=e),n(11,m=!1)):n(11,m=!m);let l=e=>e[i];"uploaded_at"===i&&(l=e=>new Date(e[i])),"filename"===i&&(l=e=>(e[i]||"").toLowerCase());n(1,r=r.sort(((e,t)=>l(e)<l(t)?m?1:-1:l(e)>l(t)?m?-1:1:0))),(()=>{const e=new URL(window.location);e.searchParams.set("sortBy",i),m?e.searchParams.set("sortDesc","on"):e.searchParams.delete("sortDesc"),window.history.replaceState(null,"",e.toString())})()}return e.$$set=e=>{"files"in e&&n(1,r=e.files),"directories"in e&&n(2,c=e.directories),"roles"in e&&n(3,a=e.roles),"currentFolder"in e&&n(0,s=e.currentFolder)},e.$$.update=()=>{16&e.$$.dirty[0]&&n(7,u=Object.entries(d).filter((([e,t])=>t)).map((([e,t])=>e))),33&e.$$.dirty[0]&&("/"===s||""===s?n(5,y=[{icon:ge,location:"/"}]):(n(5,y=s.split("/").map(((e,t)=>({name:e,location:s.split("/").slice(0,t+1).join("/")})))),y.unshift({icon:ge,location:"/"})))},[s,r,c,a,d,y,f,u,l,o,i,m,p,h,g,function(e){if(17===e.keyCode)$=!0;else if($&&65===e.keyCode&&!f){e.preventDefault();const t=Object.values(d).filter((e=>e)).length,l=r.filter((e=>".."!==e.filename)),i=t!==l.length;i||n(9,o=void 0);for(const e of l)e.selected=i,n(4,d[e.filename]=i,d);i&&!o&&n(9,o=l[l.length-1])}},function(e){17===e.keyCode&&($=!1)},async function(e){const t=e?.target.value;if(t)switch(t){case"Delete":if(!confirm(`Delete files: ${u.join()}`))return;const e=[];for(const t of u){const n=r.find((e=>e.filename===t)),l=await Pe(`/files/delete/${n.location}`),o=await l.json();o.error&&e.push({type:"danger",text:o.error})}await h();for(const t of e)notifyAlert(t);break;case"Rename":const t=window.prompt(`Rename ${o.filename} to:`,o.filename);if(!t)return;await Pe(`/files/setname/${o.location}`,{value:t}),await h();break;case"Unzip":await Pe(`/files/unzip/${o.location}`,{}),await h()}},async function(e){const t=e.target.value;for(const e of u){const n=r.find((t=>t.filename===e));await Pe(`/files/setrole/${n.location}`,{role:t})}await h(!0)},async function(){const e=[];for(const t of u)e.push(t);await Pe("/files/download-zip",{files:e,location:s},!0)},async function(e){for(const t of u){const n=e.target.value;if(!n)return;const l=r.find((e=>e.filename===t));await Pe(`/files/move/${l.location}`,{new_path:n})}await h()},v,function(e){if("image"===e.mime_super)return fe;if("audio"===e.mime_super)return ce;if("video"===e.mime_super)return de;if("pdf"===e.mime_sub)return ue;if(e.isDirectory)return pe;const t=e.filename.toLowerCase();return t.endsWith(".csv")?ae:t.endsWith(".xls")||t.endsWith(".xlsx")?se:t.endsWith(".doc")||t.endsWith(".docx")?me:t.endsWith(".txt")?re:ie},_,function(e){return e!==i?null:m?le:oe},function(e){let t="/"===s?e.location:e.location.substr(s.length);return t.startsWith("/")&&(t=t.substr(1)),t.substr(0,t.length-e.filename.length)},function(e){e.preventDefault(),e.dataTransfer?.files?.length>0&&async function(e){try{const t=new FormData;for(const n of e)t.append("file",n);t.append("folder",s);const n=await Pe("/files/upload",t,!1,!0);if(200===n?.status){await h();const e=await n.json();notifyAlert({type:"success",text:e?.success?.msg||"Success"})}else notifyAlert({type:"warning",text:"Unable to upload"})}catch(e){notifyAlert({type:"danger",text:e.message?e.message:"An error occured."})}}(e.dataTransfer.files)},async e=>{await h()},async e=>{n(12,p=e.target.value),await h()},()=>{n(6,f=!0)},()=>{n(6,f=!1)},()=>_("filename"),()=>_("mimetype"),()=>_("size_kb"),()=>_("min_role_read"),()=>_("uploaded_at"),(e,t)=>g(e,t),e=>{e.isDirectory?v(e.location):window.open(`/files/serve/${e.location}`)},()=>window.create_new_folder(s)]}class Te extends K{constructor(e){super(),q(this,e,Ue,Ie,i,{files:1,directories:2,roles:3,currentFolder:0},null,[-1,-1])}}function Xe(e,t,n){const l=e.slice();return l[25]=t[n],l}function qe(e,t,n){const l=e.slice();return l[28]=t[n],l}function Ke(e){let t,n,l,o,i=e[1],r=[];for(let t=0;t<i.length;t+=1)r[t]=Je(qe(e,i,t));const c=e=>I(r[e],1,1,(()=>{r[e]=null}));return{c(){t=m("div"),n=m("nav"),l=m("ol");for(let e=0;e<r.length;e+=1)r[e].c();y(l,"class","breadcrumb"),y(n,"aria-label","breadcrumb")},m(e,i){f(e,t,i),s(t,n),s(n,l);for(let e=0;e<r.length;e+=1)r[e]&&r[e].m(l,null);o=!0},p(e,t){if(130&t){let n;for(i=e[1],n=0;n<i.length;n+=1){const o=qe(e,i,n);r[n]?(r[n].p(o,t),F(r[n],1)):(r[n]=Je(o),r[n].c(),F(r[n],1),r[n].m(l,null))}for(W(),n=i.length;n<r.length;n+=1)c(n);B()}},i(e){if(!o){for(let e=0;e<i.length;e+=1)F(r[e]);o=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)I(r[e]);o=!1},d(e){e&&u(t),d(r,e)}}}function Ye(t){let n,l=t[28].name+"";return{c(){n=h(l)},m(e,t){f(e,n,t)},p(e,t){2&t&&l!==(l=e[28].name+"")&&_(n,l)},i:e,o:e,d(e){e&&u(n)}}}function Ze(e){let t,n;return t=new ne({props:{icon:e[28].icon}}),{c(){P(t.$$.fragment)},m(e,l){U(t,e,l),n=!0},p(e,n){const l={};2&n&&(l.icon=e[28].icon),t.$set(l)},i(e){n||(F(t.$$.fragment,e),n=!0)},o(e){I(t.$$.fragment,e),n=!1},d(e){T(t,e)}}}function Je(e){let t,n,l,i,r,c,a;const d=[Ze,Ye],p=[];function h(e,t){return e[28].icon?0:1}return n=h(e),l=p[n]=d[n](e),{c(){t=m("li"),l.c(),i=g(),y(t,"class","breadcrumb-item")},m(l,u){f(l,t,u),p[n].m(t,null),s(t,i),r=!0,c||(a=v(t,"click",(function(){o(e[7](e[28].location))&&e[7](e[28].location).apply(this,arguments)})),c=!0)},p(o,r){let c=n;n=h(e=o),n===c?p[n].p(e,r):(W(),I(p[c],1,1,(()=>{p[c]=null})),B(),l=p[n],l?l.p(e,r):(l=p[n]=d[n](e),l.c()),F(l,1),l.m(t,i))},i(e){r||(F(l),r=!0)},o(e){I(l),r=!1},d(e){e&&u(t),p[n].d(),c=!1,a()}}}function Ge(e){let t,n=e[25].filename+"";return{c(){t=h(n)},m(e,n){f(e,t,n)},p(e,l){4&l&&n!==(n=e[25].filename+"")&&_(t,n)},d(e){e&&u(t)}}}function Qe(e){let t,n,l=e[25].filename+"";return{c(){t=h(l),n=h("/")},m(e,l){f(e,t,l),f(e,n,l)},p(e,n){4&n&&l!==(l=e[25].filename+"")&&_(t,l)},d(e){e&&u(t),e&&u(n)}}}function et(e){let t,n,o,i,r,c,a,d,p,$,z,x,C,k,H,L,V,M,D,S,A,R=e[25].mimetype+"",N=(e[25].isDirectory?"":e[25].size_kb)+"",O=e[3][e[25].min_role_read]+"",E=new Date(e[25].uploaded_at).toLocaleString()+"";function j(e,t){return e[25].isDirectory?Qe:Ge}o=new ne({props:{size:"lg",icon:e[8](e[25])}});let W=j(e),B=W(e);function X(...t){return e[20](e[25],...t)}function q(){return e[21](e[25])}return{c(){t=m("tr"),n=m("td"),P(o.$$.fragment),i=g(),r=m("td"),B.c(),c=g(),a=m("td"),d=h(R),p=g(),$=m("td"),z=h(N),x=g(),C=m("td"),k=h(O),H=g(),L=m("td"),V=h(E),M=g(),w($,"text-align","right"),y(t,"class","svelte-8hihfi"),b(t,"selected",e[6]?.filename===e[25].filename)},m(e,l){f(e,t,l),s(t,n),U(o,n,null),s(t,i),s(t,r),B.m(r,null),s(t,c),s(t,a),s(a,d),s(t,p),s(t,$),s($,z),s(t,x),s(t,C),s(C,k),s(t,H),s(t,L),s(L,V),s(t,M),D=!0,S||(A=[v(t,"click",X),v(t,"dblclick",q)],S=!0)},p(n,l){e=n;const i={};4&l&&(i.icon=e[8](e[25])),o.$set(i),W===(W=j(e))&&B?B.p(e,l):(B.d(1),B=W(e),B&&(B.c(),B.m(r,null))),(!D||4&l)&&R!==(R=e[25].mimetype+"")&&_(d,R),(!D||4&l)&&N!==(N=(e[25].isDirectory?"":e[25].size_kb)+"")&&_(z,N),(!D||12&l)&&O!==(O=e[3][e[25].min_role_read]+"")&&_(k,O),(!D||4&l)&&E!==(E=new Date(e[25].uploaded_at).toLocaleString()+"")&&_(V,E),(!D||68&l)&&b(t,"selected",e[6]?.filename===e[25].filename)},i(e){D||(F(o.$$.fragment,e),D=!0)},o(e){I(o.$$.fragment,e),D=!1},d(e){e&&u(t),T(o),B.d(),S=!1,l(A)}}}function tt(e){let t,n,o,i,r,c,a,p,$,_,b,z,x,C,k,H,L,V,M,D,S,A,R,N,O,E,j,X,q,K,Y,Z,J,G,Q,ee,te=!e[0]&&Ke(e);x=new ne({props:{icon:e[10]("filename",e[4],e[5])}}),L=new ne({props:{icon:e[10]("mimetype",e[4],e[5])}}),D=new ne({props:{icon:e[10]("size_kb",e[4],e[5])}}),O=new ne({props:{icon:e[10]("min_role_read",e[4],e[5])}}),q=new ne({props:{icon:e[10]("uploaded_at",e[4],e[5])}});let le=e[2],oe=[];for(let t=0;t<le.length;t+=1)oe[t]=et(Xe(e,le,t));const ie=e=>I(oe[e],1,1,(()=>{oe[e]=null}));return{c(){t=m("main"),n=m("div"),o=m("div"),te&&te.c(),i=g(),r=m("div"),c=m("table"),a=m("thead"),p=m("tr"),$=m("th"),_=g(),b=m("th"),z=h("Filename\n "),P(x.$$.fragment),C=g(),k=m("th"),H=h("Media type\n "),P(L.$$.fragment),V=g(),M=m("th"),P(D.$$.fragment),S=h("\n Size (KiB)"),A=g(),R=m("th"),N=h("Role to access\n "),P(O.$$.fragment),E=g(),j=m("th"),X=h("Created\n "),P(q.$$.fragment),K=g(),Y=m("tbody");for(let e=0;e<oe.length;e+=1)oe[e].c();Z=g(),J=m("button"),J.textContent="Select",w(M,"text-align","right"),y(c,"class","table table-sm table-hover"),y(r,"class","filelist svelte-8hihfi"),y(o,"class","col-12"),y(n,"class","row"),y(J,"class","btn btn-primary")},m(l,u){f(l,t,u),s(t,n),s(n,o),te&&te.m(o,null),s(o,i),s(o,r),s(r,c),s(c,a),s(a,p),s(p,$),s(p,_),s(p,b),s(b,z),U(x,b,null),s(p,C),s(p,k),s(k,H),U(L,k,null),s(p,V),s(p,M),U(D,M,null),s(M,S),s(p,A),s(p,R),s(R,N),U(O,R,null),s(p,E),s(p,j),s(j,X),U(q,j,null),s(c,K),s(c,Y);for(let e=0;e<oe.length;e+=1)oe[e]&&oe[e].m(Y,null);s(t,Z),s(t,J),G=!0,Q||(ee=[v(b,"click",e[15]),v(k,"click",e[16]),v(M,"click",e[17]),v(R,"click",e[18]),v(j,"click",e[19]),v(J,"click",e[22])],Q=!0)},p(e,[t]){e[0]?te&&(W(),I(te,1,1,(()=>{te=null})),B()):te?(te.p(e,t),1&t&&F(te,1)):(te=Ke(e),te.c(),F(te,1),te.m(o,i));const n={};48&t&&(n.icon=e[10]("filename",e[4],e[5])),x.$set(n);const l={};48&t&&(l.icon=e[10]("mimetype",e[4],e[5])),L.$set(l);const r={};48&t&&(r.icon=e[10]("size_kb",e[4],e[5])),D.$set(r);const c={};48&t&&(c.icon=e[10]("min_role_read",e[4],e[5])),O.$set(c);const a={};if(48&t&&(a.icon=e[10]("uploaded_at",e[4],e[5])),q.$set(a),6604&t){let n;for(le=e[2],n=0;n<le.length;n+=1){const l=Xe(e,le,n);oe[n]?(oe[n].p(l,t),F(oe[n],1)):(oe[n]=et(l),oe[n].c(),F(oe[n],1),oe[n].m(Y,null))}for(W(),n=le.length;n<oe.length;n+=1)ie(n);B()}},i(e){if(!G){F(te),F(x.$$.fragment,e),F(L.$$.fragment,e),F(D.$$.fragment,e),F(O.$$.fragment,e),F(q.$$.fragment,e);for(let e=0;e<le.length;e+=1)F(oe[e]);G=!0}},o(e){I(te),I(x.$$.fragment,e),I(L.$$.fragment,e),I(D.$$.fragment,e),I(O.$$.fragment,e),I(q.$$.fragment,e),oe=oe.filter(Boolean);for(let e=0;e<oe.length;e+=1)I(oe[e]);G=!1},d(e){e&&u(t),te&&te.d(),T(x),T(L),T(D),T(O),T(q),d(oe,e),Q=!1,l(ee)}}}function nt(e,t,n){let l,{currentFolder:o="/"}=t,{noSubdirs:i=!1}=t,{inputId:r=""}=t,c=[],a={},s=!1,f=null;C((async()=>{await u()}));const u=async function(){const e=await fetch(`/files/visible_entries?dir=${encodeURIComponent(o)}${i?"&no_subdirs=true":""}`,{headers:{"X-Requested-With":"XMLHttpRequest"}}),t=await e.json();n(2,c=t.files);for(const e of c)e.mimetype=e.mime_sub&&e.mime_super?`${e.mime_super}/${e.mime_sub}`:"";t.directories;for(const e of t.roles)n(3,a[e.id]=e.role,a);window.emptyAlerts(),p(l||"filename",!0)};function d(e){n(13,o=e),n(6,f=null),u()}let m=[];function p(e,t){l!==e||t?l!==e&&(n(4,l=e),n(5,s=!1)):n(5,s=!s);let o=e=>e[l];"uploaded_at"===l&&(o=e=>new Date(e[l])),"filename"===l&&(o=e=>(e[l]||"").toLowerCase());n(2,c=c.sort(((e,t)=>o(e)<o(t)?s?1:-1:o(e)>o(t)?s?-1:1:0)))}function h(e){n(6,f=e)}function g(e){if(e){const t=document.getElementById(r);t&&(t.value=e.location),window.closeModal();const n=document.getElementById(`${r}-custom-text`);n&&(n.innerText=e.filename)}}return e.$$set=e=>{"currentFolder"in e&&n(13,o=e.currentFolder),"noSubdirs"in e&&n(0,i=e.noSubdirs),"inputId"in e&&n(14,r=e.inputId)},e.$$.update=()=>{8195&e.$$.dirty&&("/"===o||""===o?n(1,m=[{icon:ge,location:"/"}]):(n(1,m=o.split("/").map(((e,t)=>({name:e,location:o.split("/").slice(0,t+1).join("/")})))),i||m.unshift({icon:ge,location:"/"})))},[i,m,c,a,l,s,f,d,function(e){if("image"===e.mime_super)return fe;if("audio"===e.mime_super)return ce;if("video"===e.mime_super)return de;if("pdf"===e.mime_sub)return ue;if(e.isDirectory)return pe;const t=e.filename.toLowerCase();return t.endsWith(".csv")?ae:t.endsWith(".xls")||t.endsWith(".xlsx")?se:t.endsWith(".doc")||t.endsWith(".docx")?me:t.endsWith(".txt")?re:ie},p,function(e){return e!==l?null:s?le:oe},h,g,o,r,()=>p("filename"),()=>p("mimetype"),()=>p("size_kb"),()=>p("min_role_read"),()=>p("uploaded_at"),(e,t)=>h(e),e=>{e.isDirectory?d(e.location):g(e)},()=>g(f)]}class lt extends K{constructor(e){super(),q(this,e,nt,tt,i,{currentFolder:13,noSubdirs:0,inputId:14})}}var ot=document.getElementById("saltcorn-file-manager");let it=null;if("true"===ot?.getAttribute("full_manager"))it=new Te({target:ot});else{const e=ot?.getAttribute("folder")||"/",t=ot?.getAttribute("input_id"),n="true"===ot?.getAttribute("no_subdirs");it=new lt({target:ot,props:{currentFolder:e,inputId:t,noSubdirs:n}})}return it}();
3
+ * Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com
4
+ * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
5
+ */var ie={prefix:"fas",iconName:"caret-down",icon:[320,512,[],"f0d7","M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"]},re={prefix:"fas",iconName:"caret-up",icon:[320,512,[],"f0d8","M288.662 352H31.338c-17.818 0-26.741-21.543-14.142-34.142l128.662-128.662c7.81-7.81 20.474-7.81 28.284 0l128.662 128.662c12.6 12.599 3.676 34.142-14.142 34.142z"]},ce={prefix:"fas",iconName:"file",icon:[384,512,[],"f15b","M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm160-14.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"]},ae={prefix:"fas",iconName:"file-alt",icon:[384,512,[],"f15c","M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm64 236c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12v8zm0-64c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12v8zm0-72v8c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12zm96-114.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"]},se={prefix:"fas",iconName:"file-audio",icon:[384,512,[],"f1c7","M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm-64 268c0 10.7-12.9 16-20.5 8.5L104 376H76c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h28l35.5-36.5c7.6-7.6 20.5-2.2 20.5 8.5v136zm33.2-47.6c9.1-9.3 9.1-24.1 0-33.4-22.1-22.8 12.2-56.2 34.4-33.5 27.2 27.9 27.2 72.4 0 100.4-21.8 22.3-56.9-10.4-34.4-33.5zm86-117.1c54.4 55.9 54.4 144.8 0 200.8-21.8 22.4-57-10.3-34.4-33.5 36.2-37.2 36.3-96.5 0-133.8-22.1-22.8 12.3-56.3 34.4-33.5zM384 121.9v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"]},fe={prefix:"fas",iconName:"file-csv",icon:[384,512,[],"f6dd","M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm-96 144c0 4.42-3.58 8-8 8h-8c-8.84 0-16 7.16-16 16v32c0 8.84 7.16 16 16 16h8c4.42 0 8 3.58 8 8v16c0 4.42-3.58 8-8 8h-8c-26.51 0-48-21.49-48-48v-32c0-26.51 21.49-48 48-48h8c4.42 0 8 3.58 8 8v16zm44.27 104H160c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h12.27c5.95 0 10.41-3.5 10.41-6.62 0-1.3-.75-2.66-2.12-3.84l-21.89-18.77c-8.47-7.22-13.33-17.48-13.33-28.14 0-21.3 19.02-38.62 42.41-38.62H200c4.42 0 8 3.58 8 8v16c0 4.42-3.58 8-8 8h-12.27c-5.95 0-10.41 3.5-10.41 6.62 0 1.3.75 2.66 2.12 3.84l21.89 18.77c8.47 7.22 13.33 17.48 13.33 28.14.01 21.29-19 38.62-42.39 38.62zM256 264v20.8c0 20.27 5.7 40.17 16 56.88 10.3-16.7 16-36.61 16-56.88V264c0-4.42 3.58-8 8-8h16c4.42 0 8 3.58 8 8v20.8c0 35.48-12.88 68.89-36.28 94.09-3.02 3.25-7.27 5.11-11.72 5.11s-8.7-1.86-11.72-5.11c-23.4-25.2-36.28-58.61-36.28-94.09V264c0-4.42 3.58-8 8-8h16c4.42 0 8 3.58 8 8zm121-159L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128v-6.1c0-6.3-2.5-12.4-7-16.9z"]},ue={prefix:"fas",iconName:"file-excel",icon:[384,512,[],"f1c3","M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm60.1 106.5L224 336l60.1 93.5c5.1 8-.6 18.5-10.1 18.5h-34.9c-4.4 0-8.5-2.4-10.6-6.3C208.9 405.5 192 373 192 373c-6.4 14.8-10 20-36.6 68.8-2.1 3.9-6.1 6.3-10.5 6.3H110c-9.5 0-15.2-10.5-10.1-18.5l60.3-93.5-60.3-93.5c-5.2-8 .6-18.5 10.1-18.5h34.8c4.4 0 8.5 2.4 10.6 6.3 26.1 48.8 20 33.6 36.6 68.5 0 0 6.1-11.7 36.6-68.5 2.1-3.9 6.2-6.3 10.6-6.3H274c9.5-.1 15.2 10.4 10.1 18.4zM384 121.9v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"]},de={prefix:"fas",iconName:"file-image",icon:[384,512,[],"f1c5","M384 121.941V128H256V0h6.059a24 24 0 0 1 16.97 7.029l97.941 97.941a24.002 24.002 0 0 1 7.03 16.971zM248 160c-13.2 0-24-10.8-24-24V0H24C10.745 0 0 10.745 0 24v464c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24V160H248zm-135.455 16c26.51 0 48 21.49 48 48s-21.49 48-48 48-48-21.49-48-48 21.491-48 48-48zm208 240h-256l.485-48.485L104.545 328c4.686-4.686 11.799-4.201 16.485.485L160.545 368 264.06 264.485c4.686-4.686 12.284-4.686 16.971 0L320.545 304v112z"]},me={prefix:"fas",iconName:"file-pdf",icon:[384,512,[],"f1c1","M181.9 256.1c-5-16-4.9-46.9-2-46.9 8.4 0 7.6 36.9 2 46.9zm-1.7 47.2c-7.7 20.2-17.3 43.3-28.4 62.7 18.3-7 39-17.2 62.9-21.9-12.7-9.6-24.9-23.4-34.5-40.8zM86.1 428.1c0 .8 13.2-5.4 34.9-40.2-6.7 6.3-29.1 24.5-34.9 40.2zM248 160h136v328c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V24C0 10.7 10.7 0 24 0h200v136c0 13.2 10.8 24 24 24zm-8 171.8c-20-12.2-33.3-29-42.7-53.8 4.5-18.5 11.6-46.6 6.2-64.2-4.7-29.4-42.4-26.5-47.8-6.8-5 18.3-.4 44.1 8.1 77-11.6 27.6-28.7 64.6-40.8 85.8-.1 0-.1.1-.2.1-27.1 13.9-73.6 44.5-54.5 68 5.6 6.9 16 10 21.5 10 17.9 0 35.7-18 61.1-61.8 25.8-8.5 54.1-19.1 79-23.2 21.7 11.8 47.1 19.5 64 19.5 29.2 0 31.2-32 19.7-43.4-13.9-13.6-54.3-9.7-73.6-7.2zM377 105L279 7c-4.5-4.5-10.6-7-17-7h-6v128h128v-6.1c0-6.3-2.5-12.4-7-16.9zm-74.1 255.3c4.1-2.7-2.5-11.9-42.8-9 37.1 15.8 42.8 9 42.8 9z"]},pe={prefix:"fas",iconName:"file-video",icon:[384,512,[],"f1c8","M384 121.941V128H256V0h6.059c6.365 0 12.47 2.529 16.971 7.029l97.941 97.941A24.005 24.005 0 0 1 384 121.941zM224 136V0H24C10.745 0 0 10.745 0 24v464c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24V160H248c-13.2 0-24-10.8-24-24zm96 144.016v111.963c0 21.445-25.943 31.998-40.971 16.971L224 353.941V392c0 13.255-10.745 24-24 24H88c-13.255 0-24-10.745-24-24V280c0-13.255 10.745-24 24-24h112c13.255 0 24 10.745 24 24v38.059l55.029-55.013c15.011-15.01 40.971-4.491 40.971 16.97z"]},he={prefix:"fas",iconName:"file-word",icon:[384,512,[],"f1c2","M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm57.1 120H305c7.7 0 13.4 7.1 11.7 14.7l-38 168c-1.2 5.5-6.1 9.3-11.7 9.3h-38c-5.5 0-10.3-3.8-11.6-9.1-25.8-103.5-20.8-81.2-25.6-110.5h-.5c-1.1 14.3-2.4 17.4-25.6 110.5-1.3 5.3-6.1 9.1-11.6 9.1H117c-5.6 0-10.5-3.9-11.7-9.4l-37.8-168c-1.7-7.5 4-14.6 11.7-14.6h24.5c5.7 0 10.7 4 11.8 9.7 15.6 78 20.1 109.5 21 122.2 1.6-10.2 7.3-32.7 29.4-122.7 1.3-5.4 6.1-9.1 11.7-9.1h29.1c5.6 0 10.4 3.8 11.7 9.2 24 100.4 28.8 124 29.6 129.4-.2-11.2-2.6-17.8 21.6-129.2 1-5.6 5.9-9.5 11.5-9.5zM384 121.9v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"]},ge={prefix:"fas",iconName:"folder",icon:[512,512,[],"f07b","M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z"]},$e={prefix:"fas",iconName:"folder-plus",icon:[512,512,[],"f65e","M464,128H272L208,64H48A48,48,0,0,0,0,112V400a48,48,0,0,0,48,48H464a48,48,0,0,0,48-48V176A48,48,0,0,0,464,128ZM359.5,296a16,16,0,0,1-16,16h-64v64a16,16,0,0,1-16,16h-16a16,16,0,0,1-16-16V312h-64a16,16,0,0,1-16-16V280a16,16,0,0,1,16-16h64V200a16,16,0,0,1,16-16h16a16,16,0,0,1,16,16v64h64a16,16,0,0,1,16,16Z"]},ve={prefix:"fas",iconName:"home",icon:[576,512,[],"f015","M280.37 148.26L96 300.11V464a16 16 0 0 0 16 16l112.06-.29a16 16 0 0 0 15.92-16V368a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16v95.64a16 16 0 0 0 16 16.05L464 480a16 16 0 0 0 16-16V300L295.67 148.26a12.19 12.19 0 0 0-15.3 0zM571.6 251.47L488 182.56V44.05a12 12 0 0 0-12-12h-56a12 12 0 0 0-12 12v72.61L318.47 43a48 48 0 0 0-61 0L4.34 251.47a12 12 0 0 0-1.6 16.9l25.5 31A12 12 0 0 0 45.15 301l235.22-193.74a12.19 12.19 0 0 1 15.3 0L530.9 301a12 12 0 0 0 16.9-1.6l25.5-31a12 12 0 0 0-1.7-16.93z"]};const{window:ye}=a;function _e(e,t,n){const l=e.slice();return l[44]=t[n],l}function we(e,t,n){const l=e.slice();return l[47]=t[n],l}function be(e,t,n){const l=e.slice();return l[50]=t[n],l}function ze(e,t,n){const l=e.slice();return l[53]=t[n],l}function xe(t){let n,l=t[53].name+"";return{c(){n=h(l)},m(e,t){f(e,n,t)},p(e,t){32&t[0]&&l!==(l=e[53].name+"")&&_(n,l)},i:e,o:e,d(e){e&&u(n)}}}function Ce(e){let t,n;return t=new oe({props:{icon:e[53].icon}}),{c(){T(t.$$.fragment)},m(e,l){X(t,e,l),n=!0},p(e,n){const l={};32&n[0]&&(l.icon=e[53].icon),t.$set(l)},i(e){n||(I(t.$$.fragment,e),n=!0)},o(e){P(t.$$.fragment,e),n=!1},d(e){q(t,e)}}}function ke(e){let t,n,l,i,r,c,a;const d=[Ce,xe],p=[];function h(e,t){return e[53].icon?0:1}return n=h(e),l=p[n]=d[n](e),{c(){t=m("li"),l.c(),i=g(),y(t,"class","breadcrumb-item")},m(l,u){f(l,t,u),p[n].m(t,null),s(t,i),r=!0,c||(a=v(t,"click",(function(){o(e[21](e[53].location))&&e[21](e[53].location).apply(this,arguments)})),c=!0)},p(o,r){let c=n;n=h(e=o),n===c?p[n].p(e,r):(B(),P(p[c],1,1,(()=>{p[c]=null})),F(),l=p[n],l?l.p(e,r):(l=p[n]=d[n](e),l.c()),I(l,1),l.m(t,i))},i(e){r||(I(l),r=!0)},o(e){P(l),r=!1},d(e){e&&u(t),p[n].d(),c=!1,a()}}}function He(e){let t;return{c(){t=m("th"),t.textContent="Location"},m(e,n){f(e,t,n)},d(e){e&&u(t)}}}function Le(e){let t,n=e[50].filename+"";return{c(){t=h(n)},m(e,n){f(e,t,n)},p(e,l){2&l[0]&&n!==(n=e[50].filename+"")&&_(t,n)},d(e){e&&u(t)}}}function Ve(e){let t,n,l=e[50].filename+"";return{c(){t=h(l),n=h("/")},m(e,l){f(e,t,l),f(e,n,l)},p(e,n){2&n[0]&&l!==(l=e[50].filename+"")&&_(t,l)},d(e){e&&(u(t),u(n))}}}function Me(e){let t,n,l=e[25](e[50])+"";return{c(){t=m("td"),n=h(l)},m(e,l){f(e,t,l),s(t,n)},p(e,t){2&t[0]&&l!==(l=e[25](e[50])+"")&&_(n,l)},d(e){e&&u(t)}}}function De(e){let t,n,o,i,r,c,a,d,p,$,w,x,C,k,H,L,V,M,D,S,A,R=e[50].mimetype+"",N=(e[50].isDirectory?"":e[50].size_kb)+"",O=e[3][e[50].min_role_read]+"",j=new Date(e[50].uploaded_at).toLocaleString()+"";function E(e,t){return e[50].isDirectory?Ve:Le}o=new oe({props:{size:"lg",icon:e[22](e[50])}});let W=E(e),B=W(e),F=e[12]&&Me(e);function U(...t){return e[36](e[50],...t)}function K(){return e[37](e[50])}return{c(){t=m("tr"),n=m("td"),T(o.$$.fragment),i=g(),r=m("td"),B.c(),c=g(),F&&F.c(),a=g(),d=m("td"),p=h(R),$=g(),w=m("td"),x=h(N),C=g(),k=m("td"),H=h(O),L=g(),V=m("td"),M=h(j),b(w,"text-align","right"),y(t,"class","svelte-16rl54v"),z(t,"selected",e[4][e[50].filename])},m(e,l){f(e,t,l),s(t,n),X(o,n,null),s(t,i),s(t,r),B.m(r,null),s(t,c),F&&F.m(t,null),s(t,a),s(t,d),s(d,p),s(t,$),s(t,w),s(w,x),s(t,C),s(t,k),s(k,H),s(t,L),s(t,V),s(V,M),D=!0,S||(A=[v(t,"click",U),v(t,"dblclick",K)],S=!0)},p(n,l){e=n;const i={};2&l[0]&&(i.icon=e[22](e[50])),o.$set(i),W===(W=E(e))&&B?B.p(e,l):(B.d(1),B=W(e),B&&(B.c(),B.m(r,null))),e[12]?F?F.p(e,l):(F=Me(e),F.c(),F.m(t,a)):F&&(F.d(1),F=null),(!D||2&l[0])&&R!==(R=e[50].mimetype+"")&&_(p,R),(!D||2&l[0])&&N!==(N=(e[50].isDirectory?"":e[50].size_kb)+"")&&_(x,N),(!D||10&l[0])&&O!==(O=e[3][e[50].min_role_read]+"")&&_(H,O),(!D||2&l[0])&&j!==(j=new Date(e[50].uploaded_at).toLocaleString()+"")&&_(M,j),(!D||18&l[0])&&z(t,"selected",e[4][e[50].filename])},i(e){D||(I(o.$$.fragment,e),D=!0)},o(e){P(o.$$.fragment,e),D=!1},d(e){e&&u(t),q(o),B.d(),F&&F.d(),S=!1,l(A)}}}function Se(e){let t;return{c(){t=m("td")},m(e,n){f(e,t,n)},d(e){e&&u(t)}}}function Ae(e){let t,n,o,i,r,c,a,p,b,z,x,C,k,H,L,V,M,D,S,A,R,N,O,j,E,W,B,F,I,P,T,X,q,K,Y,Z,J,G,Q,ee,te,ne,le,oe,ie,re,ce,ae,se,fe=e[9].filename+"",ue=new Date(e[9].uploaded_at).toLocaleString()+"",de=e[3][e[9].min_role_read]+"",me=1===e[7].length&&e[9].filename.endsWith(".zip"),pe="image"===e[9].mime_super&&Re(e),he=!e[9].isDirectory&&Ne(e);function ge(e,t){return e[9].isDirectory?je:Oe}let $e=ge(e),ve=$e(e),ye=e[7].length>1&&Ee(e),be=U(e[8]),ze=[];for(let t=0;t<be.length;t+=1)ze[t]=We(we(e,be,t));let xe=U(e[2]),Ce=[];for(let t=0;t<xe.length;t+=1)Ce[t]=Be(_e(e,xe,t));let ke=1===e[7].length&&Fe(),He=me&&Ie(),Le=e[7].length>1&&Pe(e);return{c(){t=m("h5"),n=h(fe),o=g(),pe&&pe.c(),i=g(),r=m("table"),c=m("tbody"),he&&he.c(),a=g(),p=m("tr"),b=m("th"),b.textContent="MIME type",z=g(),x=m("td"),ve.c(),C=g(),k=m("tr"),H=m("th"),H.textContent="Created",L=g(),V=m("td"),M=h(ue),D=g(),S=m("tr"),A=m("th"),A.textContent="Role to access",R=g(),N=m("td"),O=h(de),j=g(),E=m("div"),W=m("a"),B=h("Link"),I=h("\n  | \n "),P=m("a"),T=h("Download"),q=g(),ye&&ye.c(),K=g(),Y=m("div"),Z=m("select"),J=m("option"),J.textContent="Set access";for(let e=0;e<ze.length;e+=1)ze[e].c();G=g(),Q=m("select"),ee=m("option"),ee.textContent="Move to...";for(let e=0;e<Ce.length;e+=1)Ce[e].c();te=g(),ne=m("select"),le=m("option"),le.textContent="Action...",oe=m("option"),oe.textContent="Delete",ke&&ke.c(),ie=$(),He&&He.c(),re=g(),Le&&Le.c(),ce=$(),y(A,"class","pe-1"),y(W,"href",F=`/files/serve/${e[9].location}`),y(P,"href",X=`/files/download/${e[9].location}`),J.__value="",w(J,J.__value),J.disabled=!0,J.selected=!0,y(Z,"id","setRoleSelectId"),y(Z,"class","form-select svelte-16rl54v"),ee.__value="",w(ee,ee.__value),ee.disabled=!0,ee.selected=!0,y(Q,"class","form-select svelte-16rl54v"),le.__value="",w(le,le.__value),le.disabled=!0,le.selected=!0,oe.__value="Delete",w(oe,oe.__value),y(ne,"class","form-select svelte-16rl54v"),y(Y,"class","file-actions d-flex svelte-16rl54v")},m(l,u){f(l,t,u),s(t,n),f(l,o,u),pe&&pe.m(l,u),f(l,i,u),f(l,r,u),s(r,c),he&&he.m(c,null),s(c,a),s(c,p),s(p,b),s(p,z),s(p,x),ve.m(x,null),s(c,C),s(c,k),s(k,H),s(k,L),s(k,V),s(V,M),s(c,D),s(c,S),s(S,A),s(S,R),s(S,N),s(N,O),f(l,j,u),f(l,E,u),s(E,W),s(W,B),s(E,I),s(E,P),s(P,T),f(l,q,u),ye&&ye.m(l,u),f(l,K,u),f(l,Y,u),s(Y,Z),s(Z,J);for(let e=0;e<ze.length;e+=1)ze[e]&&ze[e].m(Z,null);s(Y,G),s(Y,Q),s(Q,ee);for(let e=0;e<Ce.length;e+=1)Ce[e]&&Ce[e].m(Q,null);s(Y,te),s(Y,ne),s(ne,le),s(ne,oe),ke&&ke.m(ne,null),s(ne,ie),He&&He.m(ne,null),f(l,re,u),Le&&Le.m(l,u),f(l,ce,u),ae||(se=[v(Z,"change",e[18]),v(Q,"change",e[20]),v(ne,"change",e[17])],ae=!0)},p(e,t){if(512&t[0]&&fe!==(fe=e[9].filename+"")&&_(n,fe),"image"===e[9].mime_super?pe?pe.p(e,t):(pe=Re(e),pe.c(),pe.m(i.parentNode,i)):pe&&(pe.d(1),pe=null),e[9].isDirectory?he&&(he.d(1),he=null):he?he.p(e,t):(he=Ne(e),he.c(),he.m(c,a)),$e===($e=ge(e))&&ve?ve.p(e,t):(ve.d(1),ve=$e(e),ve&&(ve.c(),ve.m(x,null))),512&t[0]&&ue!==(ue=new Date(e[9].uploaded_at).toLocaleString()+"")&&_(M,ue),520&t[0]&&de!==(de=e[3][e[9].min_role_read]+"")&&_(O,de),512&t[0]&&F!==(F=`/files/serve/${e[9].location}`)&&y(W,"href",F),512&t[0]&&X!==(X=`/files/download/${e[9].location}`)&&y(P,"href",X),e[7].length>1?ye?ye.p(e,t):(ye=Ee(e),ye.c(),ye.m(K.parentNode,K)):ye&&(ye.d(1),ye=null),256&t[0]){let n;for(be=U(e[8]),n=0;n<be.length;n+=1){const l=we(e,be,n);ze[n]?ze[n].p(l,t):(ze[n]=We(l),ze[n].c(),ze[n].m(Z,null))}for(;n<ze.length;n+=1)ze[n].d(1);ze.length=be.length}if(4&t[0]){let n;for(xe=U(e[2]),n=0;n<xe.length;n+=1){const l=_e(e,xe,n);Ce[n]?Ce[n].p(l,t):(Ce[n]=Be(l),Ce[n].c(),Ce[n].m(Q,null))}for(;n<Ce.length;n+=1)Ce[n].d(1);Ce.length=xe.length}1===e[7].length?ke||(ke=Fe(),ke.c(),ke.m(ne,ie)):ke&&(ke.d(1),ke=null),640&t[0]&&(me=1===e[7].length&&e[9].filename.endsWith(".zip")),me?He||(He=Ie(),He.c(),He.m(ne,null)):He&&(He.d(1),He=null),e[7].length>1?Le?Le.p(e,t):(Le=Pe(e),Le.c(),Le.m(ce.parentNode,ce)):Le&&(Le.d(1),Le=null)},d(e){e&&(u(t),u(o),u(i),u(r),u(j),u(E),u(q),u(K),u(Y),u(re),u(ce)),pe&&pe.d(e),he&&he.d(),ve.d(),ye&&ye.d(e),d(ze,e),d(Ce,e),ke&&ke.d(),He&&He.d(),Le&&Le.d(e),ae=!1,l(se)}}}function Re(e){let t,n,l;return{c(){t=m("img"),y(t,"class","file-preview my-2 svelte-16rl54v"),c(t.src,n=`/files/serve/${e[9].location}`)||y(t,"src",n),y(t,"alt",l=e[9].filename)},m(e,n){f(e,t,n)},p(e,o){512&o[0]&&!c(t.src,n=`/files/serve/${e[9].location}`)&&y(t,"src",n),512&o[0]&&l!==(l=e[9].filename)&&y(t,"alt",l)},d(e){e&&u(t)}}}function Ne(e){let t,n,l,o,i,r,c=e[9].size_kb+"";return{c(){t=m("tr"),n=m("th"),n.textContent="Size",l=g(),o=m("td"),i=h(c),r=h(" KB")},m(e,c){f(e,t,c),s(t,n),s(t,l),s(t,o),s(o,i),s(o,r)},p(e,t){512&t[0]&&c!==(c=e[9].size_kb+"")&&_(i,c)},d(e){e&&u(t)}}}function Oe(e){let t,n,l,o=e[9].mime_super+"",i=e[9].mime_sub+"";return{c(){t=h(o),n=h("/"),l=h(i)},m(e,o){f(e,t,o),f(e,n,o),f(e,l,o)},p(e,n){512&n[0]&&o!==(o=e[9].mime_super+"")&&_(t,o),512&n[0]&&i!==(i=e[9].mime_sub+"")&&_(l,i)},d(e){e&&(u(t),u(n),u(l))}}}function je(t){let n;return{c(){n=h("Directory")},m(e,t){f(e,n,t)},p:e,d(e){e&&u(n)}}}function Ee(e){let t,n,l,o,i,r,c=e[7].length-1+"",a=e[7].length>2?"s":"";return{c(){t=m("strong"),n=h("and "),l=h(c),o=h(" other file"),i=h(a),r=h(":")},m(e,c){f(e,t,c),s(t,n),s(t,l),s(t,o),s(t,i),s(t,r)},p(e,t){128&t[0]&&c!==(c=e[7].length-1+"")&&_(l,c),128&t[0]&&a!==(a=e[7].length>2?"s":"")&&_(i,a)},d(e){e&&u(t)}}}function We(e){let t,n,l,o=e[47].role+"";return{c(){t=m("option"),n=h(o),t.__value=l=e[47].id,w(t,t.__value)},m(e,l){f(e,t,l),s(t,n)},p(e,i){256&i[0]&&o!==(o=e[47].role+"")&&_(n,o),256&i[0]&&l!==(l=e[47].id)&&(t.__value=l,w(t,t.__value))},d(e){e&&u(t)}}}function Be(e){let t,n,l,o=(e[44].location||"/")+"";return{c(){t=m("option"),n=h(o),t.__value=l=e[44].location||"/",w(t,t.__value)},m(e,l){f(e,t,l),s(t,n)},p(e,i){4&i[0]&&o!==(o=(e[44].location||"/")+"")&&_(n,o),4&i[0]&&l!==(l=e[44].location||"/")&&(t.__value=l,w(t,t.__value))},d(e){e&&u(t)}}}function Fe(e){let t;return{c(){t=m("option"),t.textContent="Rename",t.__value="Rename",w(t,t.__value)},m(e,n){f(e,t,n)},d(e){e&&u(t)}}}function Ie(e){let t;return{c(){t=m("option"),t.textContent="Unzip",t.__value="Unzip",w(t,t.__value)},m(e,n){f(e,t,n)},d(e){e&&u(t)}}}function Pe(t){let n,l,o;return{c(){n=m("button"),n.innerHTML='<i class="fas fa-file-archive"></i>\n Download Zip Archive',y(n,"class","btn btn-outline-secondary mt-2")},m(e,i){f(e,n,i),l||(o=v(n,"click",t[19]),l=!0)},p:e,d(e){e&&u(n),l=!1,o()}}}function Ue(e){let t,n,o,i,r,c,a,p,$,_,w,z,x,C,k,H,L,V,M,D,S,A,R,N,O,j,E,W,K,Y,Z,J,G,Q,ee,te,ne,le,ie,re,ce,ae,se,fe,ue,de,me,pe,he,ge,ve,_e,we,xe,Ce,Le,Ve,Me,Re=U(e[5]),Ne=[];for(let t=0;t<Re.length;t+=1)Ne[t]=ke(ze(e,Re,t));const Oe=e=>P(Ne[e],1,1,(()=>{Ne[e]=null}));S=new oe({props:{icon:e[24]("filename",e[10],e[11])}});let je=e[12]&&He();j=new oe({props:{icon:e[24]("mimetype",e[10],e[11])}}),K=new oe({props:{icon:e[24]("size_kb",e[10],e[11])}}),Q=new oe({props:{icon:e[24]("min_role_read",e[10],e[11])}}),le=new oe({props:{icon:e[24]("uploaded_at",e[10],e[11])}});let Ee=U(e[1]),We=[];for(let t=0;t<Ee.length;t+=1)We[t]=De(be(e,Ee,t));const Be=e=>P(We[e],1,1,(()=>{We[e]=null}));fe=new oe({props:{size:"lg",icon:$e}});let Fe=e[12]&&Se(),Ie=e[7].length>0&&Ae(e);return{c(){t=m("main"),n=m("div"),o=m("div"),i=m("div"),r=m("nav"),c=m("ol");for(let e=0;e<Ne.length;e+=1)Ne[e].c();a=g(),p=m("div"),$=m("button"),$.innerHTML='<i class="fas fa-search"></i>',_=g(),w=m("input"),z=g(),x=m("div"),C=m("table"),k=m("thead"),H=m("tr"),L=m("th"),V=g(),M=m("th"),D=h("Filename\n "),T(S.$$.fragment),A=g(),je&&je.c(),R=g(),N=m("th"),O=h("Media type\n "),T(j.$$.fragment),E=g(),W=m("th"),T(K.$$.fragment),Y=h("\n Size (KiB)"),Z=g(),J=m("th"),G=h("Role to access\n "),T(Q.$$.fragment),ee=g(),te=m("th"),ne=h("Created\n "),T(le.$$.fragment),ie=g(),re=m("tbody");for(let e=0;e<We.length;e+=1)We[e].c();ce=g(),ae=m("tr"),se=m("td"),T(fe.$$.fragment),ue=g(),de=m("td"),de.textContent="Create new folder...",me=g(),Fe&&Fe.c(),pe=g(),he=m("td"),ge=g(),ve=m("td"),_e=g(),we=m("td"),xe=g(),Ce=m("div"),Ie&&Ie.c(),y(c,"class","breadcrumb"),y(r,"aria-label","breadcrumb"),y($,"class","btn btn-outline-secondary search-bar"),y($,"type","submit"),y($,"id","button-search-submit"),y(w,"type","search"),y(w,"class","form-control search-bar"),y(w,"placeholder","Search Files"),y(w,"aria-label","Search"),y(w,"aria-describedby","button-search-submit"),y(p,"class","input-group search-bar mb-3"),b(W,"text-align","right"),y(C,"class","table table-sm table-hover"),y(x,"class","filelist svelte-16rl54v"),y(o,"class","col-8"),y(Ce,"class","col-4"),y(n,"id","drop-zone"),y(n,"ondragover","return false"),y(n,"class","row"),y(n,"role","region")},m(l,u){f(l,t,u),s(t,n),s(n,o),s(o,i),s(i,r),s(r,c);for(let e=0;e<Ne.length;e+=1)Ne[e]&&Ne[e].m(c,null);s(o,a),s(o,p),s(p,$),s(p,_),s(p,w),s(o,z),s(o,x),s(x,C),s(C,k),s(k,H),s(H,L),s(H,V),s(H,M),s(M,D),X(S,M,null),s(H,A),je&&je.m(H,null),s(H,R),s(H,N),s(N,O),X(j,N,null),s(H,E),s(H,W),X(K,W,null),s(W,Y),s(H,Z),s(H,J),s(J,G),X(Q,J,null),s(H,ee),s(H,te),s(te,ne),X(le,te,null),s(C,ie),s(C,re);for(let e=0;e<We.length;e+=1)We[e]&&We[e].m(re,null);s(re,ce),s(re,ae),s(ae,se),X(fe,se,null),s(ae,ue),s(ae,de),s(ae,me),Fe&&Fe.m(ae,null),s(ae,pe),s(ae,he),s(ae,ge),s(ae,ve),s(ae,_e),s(ae,we),s(n,xe),s(n,Ce),Ie&&Ie.m(Ce,null),Le=!0,Ve||(Me=[v(ye,"keydown",e[15]),v(ye,"keyup",e[16]),v($,"click",e[27]),v(w,"change",e[28]),v(w,"focus",e[29]),v(w,"blur",e[30]),v(M,"click",e[31]),v(N,"click",e[32]),v(W,"click",e[33]),v(J,"click",e[34]),v(te,"click",e[35]),v(ae,"click",e[38]),v(n,"drop",e[26])],Ve=!0)},p(e,t){if(2097184&t[0]){let n;for(Re=U(e[5]),n=0;n<Re.length;n+=1){const l=ze(e,Re,n);Ne[n]?(Ne[n].p(l,t),I(Ne[n],1)):(Ne[n]=ke(l),Ne[n].c(),I(Ne[n],1),Ne[n].m(c,null))}for(B(),n=Re.length;n<Ne.length;n+=1)Oe(n);F()}const n={};3072&t[0]&&(n.icon=e[24]("filename",e[10],e[11])),S.$set(n),e[12]?je||(je=He(),je.c(),je.m(H,R)):je&&(je.d(1),je=null);const l={};3072&t[0]&&(l.icon=e[24]("mimetype",e[10],e[11])),j.$set(l);const o={};3072&t[0]&&(o.icon=e[24]("size_kb",e[10],e[11])),K.$set(o);const i={};3072&t[0]&&(i.icon=e[24]("min_role_read",e[10],e[11])),Q.$set(i);const r={};if(3072&t[0]&&(r.icon=e[24]("uploaded_at",e[10],e[11])),le.$set(r),39866394&t[0]){let n;for(Ee=U(e[1]),n=0;n<Ee.length;n+=1){const l=be(e,Ee,n);We[n]?(We[n].p(l,t),I(We[n],1)):(We[n]=De(l),We[n].c(),I(We[n],1),We[n].m(re,ce))}for(B(),n=Ee.length;n<We.length;n+=1)Be(n);F()}e[12]?Fe||(Fe=Se(),Fe.c(),Fe.m(ae,pe)):Fe&&(Fe.d(1),Fe=null),e[7].length>0?Ie?Ie.p(e,t):(Ie=Ae(e),Ie.c(),Ie.m(Ce,null)):Ie&&(Ie.d(1),Ie=null)},i(e){if(!Le){for(let e=0;e<Re.length;e+=1)I(Ne[e]);I(S.$$.fragment,e),I(j.$$.fragment,e),I(K.$$.fragment,e),I(Q.$$.fragment,e),I(le.$$.fragment,e);for(let e=0;e<Ee.length;e+=1)I(We[e]);I(fe.$$.fragment,e),Le=!0}},o(e){Ne=Ne.filter(Boolean);for(let e=0;e<Ne.length;e+=1)P(Ne[e]);P(S.$$.fragment,e),P(j.$$.fragment,e),P(K.$$.fragment,e),P(Q.$$.fragment,e),P(le.$$.fragment,e),We=We.filter(Boolean);for(let e=0;e<We.length;e+=1)P(We[e]);P(fe.$$.fragment,e),Le=!1},d(e){e&&u(t),d(Ne,e),q(S),je&&je.d(),q(j),q(K),q(Q),q(le),d(We,e),q(fe),Fe&&Fe.d(),Ie&&Ie.d(),Ve=!1,l(Me)}}}async function Te(e,t,n,l){const o=fetch(e,{headers:{"X-Requested-With":"XMLHttpRequest","CSRF-Token":window._sc_globalCsrf,...l?{}:{"Content-Type":"application/json"}},method:"POST",body:l?t:JSON.stringify(t||{})});if(!n)return await o;{const e=await o,t=await e.blob(),n=document.createElement("a");n.href=window.URL.createObjectURL(t);const l=e.headers.get("Content-Disposition");if(l){let e=l.split(";")[1].split("=")[1].replaceAll('"',"");n.download=e}else n.target="_blank";n.click()}}function Xe(e,t,n){let l,o,i,{files:r=[]}=t,{directories:c=[]}=t,{roles:a={}}=t,{currentFolder:s="/"}=t,f=!1,u=[],d={},m=!1,p="";const h=async function(e,t){const f=await fetch(`/files?dir=${encodeURIComponent(s)}${p?`&search=${encodeURIComponent(p)}`:""}`,{headers:{"X-Requested-With":"XMLHttpRequest"}}),m=await f.json();n(1,r=m.files);for(const e of r)e.mimetype=e.mime_sub&&e.mime_super?`${e.mime_super}/${e.mime_sub}`:"";n(2,c=m.directories),n(8,l=m.roles);for(const e of m.roles)n(3,a[e.id]=e.role,a);e?o&&n(9,o=r.find((e=>e.filename===o.filename))):(n(7,u=[]),n(4,d={}),n(9,o=null)),t||emptyAlerts(),_(i||"filename",!0)};function g(e,t){if(".."==e.filename)return;e.selected=!0;const l=d[e.filename];if(t.shiftKey||n(4,d={}),n(4,d[e.filename]=!l,d),l){const e=Object.entries(d).findLast((([e,t])=>t));n(9,o=e?r.find((t=>t.filename===e[0])):null)}else n(9,o=e);document.getSelection().removeAllRanges();const i=document.getElementById("setRoleSelectId");i&&(i.value=""),console.log(o)}k((async()=>{(()=>{const e=new URL(window.location);n(10,i=e.searchParams.get("sortBy")),n(11,m="on"===e.searchParams.get("sortDesc"));const t=e.searchParams.get("dir");t&&n(0,s=t)})(),await h(!1,!0)}));let $=!1;function v(e){n(0,s=e),(()=>{const e=new URL(window.location);e.searchParams.get("dir")!==s&&(e.searchParams.set("dir",s),window.history.replaceState(null,"",e.toString()))})(),h()}let y=[];function _(e,t){i!==e||t?i!==e&&(n(10,i=e),n(11,m=!1)):n(11,m=!m);let l=e=>e[i];"uploaded_at"===i&&(l=e=>new Date(e[i])),"filename"===i&&(l=e=>(e[i]||"").toLowerCase());n(1,r=r.sort(((e,t)=>l(e)<l(t)?m?1:-1:l(e)>l(t)?m?-1:1:0))),(()=>{const e=new URL(window.location);e.searchParams.set("sortBy",i),m?e.searchParams.set("sortDesc","on"):e.searchParams.delete("sortDesc"),window.history.replaceState(null,"",e.toString())})()}return e.$$set=e=>{"files"in e&&n(1,r=e.files),"directories"in e&&n(2,c=e.directories),"roles"in e&&n(3,a=e.roles),"currentFolder"in e&&n(0,s=e.currentFolder)},e.$$.update=()=>{16&e.$$.dirty[0]&&n(7,u=Object.entries(d).filter((([e,t])=>t)).map((([e,t])=>e))),33&e.$$.dirty[0]&&("/"===s||""===s?n(5,y=[{icon:ve,location:"/"}]):(n(5,y=s.split("/").map(((e,t)=>({name:e,location:s.split("/").slice(0,t+1).join("/")})))),y.unshift({icon:ve,location:"/"})))},[s,r,c,a,d,y,f,u,l,o,i,m,p,h,g,function(e){if(17===e.keyCode)$=!0;else if($&&65===e.keyCode&&!f){e.preventDefault();const t=Object.values(d).filter((e=>e)).length,l=r.filter((e=>".."!==e.filename)),i=t!==l.length;i||n(9,o=void 0);for(const e of l)e.selected=i,n(4,d[e.filename]=i,d);i&&!o&&n(9,o=l[l.length-1])}},function(e){17===e.keyCode&&($=!1)},async function(e){const t=e?.target.value;if(t)switch(t){case"Delete":if(!confirm(`Delete files: ${u.join()}`))return;const e=[];for(const t of u){const n=r.find((e=>e.filename===t)),l=await Te(`/files/delete/${n.location}`),o=await l.json();o.error&&e.push({type:"danger",text:o.error})}await h();for(const t of e)notifyAlert(t);break;case"Rename":const t=window.prompt(`Rename ${o.filename} to:`,o.filename);if(!t)return;await Te(`/files/setname/${o.location}`,{value:t}),await h();break;case"Unzip":await Te(`/files/unzip/${o.location}`,{}),await h()}},async function(e){const t=e.target.value;for(const e of u){const n=r.find((t=>t.filename===e));await Te(`/files/setrole/${n.location}`,{role:t})}await h(!0)},async function(){const e=[];for(const t of u)e.push(t);await Te("/files/download-zip",{files:e,location:s},!0)},async function(e){for(const t of u){const n=e.target.value;if(!n)return;const l=r.find((e=>e.filename===t));await Te(`/files/move/${l.location}`,{new_path:n})}await h()},v,function(e){if("image"===e.mime_super)return de;if("audio"===e.mime_super)return se;if("video"===e.mime_super)return pe;if("pdf"===e.mime_sub)return me;if(e.isDirectory)return ge;const t=e.filename.toLowerCase();return t.endsWith(".csv")?fe:t.endsWith(".xls")||t.endsWith(".xlsx")?ue:t.endsWith(".doc")||t.endsWith(".docx")?he:t.endsWith(".txt")?ae:ce},_,function(e){return e!==i?null:m?ie:re},function(e){let t="/"===s?e.location:e.location.substr(s.length);return t.startsWith("/")&&(t=t.substr(1)),t.substr(0,t.length-e.filename.length)},function(e){e.preventDefault(),e.dataTransfer?.files?.length>0&&async function(e){try{const t=new FormData;for(const n of e)t.append("file",n);t.append("folder",s);const n=await Te("/files/upload",t,!1,!0);if(200===n?.status){await h();const e=await n.json();notifyAlert({type:"success",text:e?.success?.msg||"Success"})}else notifyAlert({type:"warning",text:"Unable to upload"})}catch(e){notifyAlert({type:"danger",text:e.message?e.message:"An error occured."})}}(e.dataTransfer.files)},async e=>{await h()},async e=>{n(12,p=e.target.value),await h()},()=>{n(6,f=!0)},()=>{n(6,f=!1)},()=>_("filename"),()=>_("mimetype"),()=>_("size_kb"),()=>_("min_role_read"),()=>_("uploaded_at"),(e,t)=>g(e,t),e=>{e.isDirectory?v(e.location):window.open(`/files/serve/${e.location}`)},()=>window.create_new_folder(s)]}class qe extends Z{constructor(e){super(),Y(this,e,Xe,Ue,i,{files:1,directories:2,roles:3,currentFolder:0},null,[-1,-1])}}function Ke(e,t,n){const l=e.slice();return l[25]=t[n],l}function Ye(e,t,n){const l=e.slice();return l[28]=t[n],l}function Ze(e){let t,n,l,o,i=U(e[1]),r=[];for(let t=0;t<i.length;t+=1)r[t]=Qe(Ye(e,i,t));const c=e=>P(r[e],1,1,(()=>{r[e]=null}));return{c(){t=m("div"),n=m("nav"),l=m("ol");for(let e=0;e<r.length;e+=1)r[e].c();y(l,"class","breadcrumb"),y(n,"aria-label","breadcrumb")},m(e,i){f(e,t,i),s(t,n),s(n,l);for(let e=0;e<r.length;e+=1)r[e]&&r[e].m(l,null);o=!0},p(e,t){if(130&t){let n;for(i=U(e[1]),n=0;n<i.length;n+=1){const o=Ye(e,i,n);r[n]?(r[n].p(o,t),I(r[n],1)):(r[n]=Qe(o),r[n].c(),I(r[n],1),r[n].m(l,null))}for(B(),n=i.length;n<r.length;n+=1)c(n);F()}},i(e){if(!o){for(let e=0;e<i.length;e+=1)I(r[e]);o=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)P(r[e]);o=!1},d(e){e&&u(t),d(r,e)}}}function Je(t){let n,l=t[28].name+"";return{c(){n=h(l)},m(e,t){f(e,n,t)},p(e,t){2&t&&l!==(l=e[28].name+"")&&_(n,l)},i:e,o:e,d(e){e&&u(n)}}}function Ge(e){let t,n;return t=new oe({props:{icon:e[28].icon}}),{c(){T(t.$$.fragment)},m(e,l){X(t,e,l),n=!0},p(e,n){const l={};2&n&&(l.icon=e[28].icon),t.$set(l)},i(e){n||(I(t.$$.fragment,e),n=!0)},o(e){P(t.$$.fragment,e),n=!1},d(e){q(t,e)}}}function Qe(e){let t,n,l,i,r,c,a;const d=[Ge,Je],p=[];function h(e,t){return e[28].icon?0:1}return n=h(e),l=p[n]=d[n](e),{c(){t=m("li"),l.c(),i=g(),y(t,"class","breadcrumb-item")},m(l,u){f(l,t,u),p[n].m(t,null),s(t,i),r=!0,c||(a=v(t,"click",(function(){o(e[7](e[28].location))&&e[7](e[28].location).apply(this,arguments)})),c=!0)},p(o,r){let c=n;n=h(e=o),n===c?p[n].p(e,r):(B(),P(p[c],1,1,(()=>{p[c]=null})),F(),l=p[n],l?l.p(e,r):(l=p[n]=d[n](e),l.c()),I(l,1),l.m(t,i))},i(e){r||(I(l),r=!0)},o(e){P(l),r=!1},d(e){e&&u(t),p[n].d(),c=!1,a()}}}function et(e){let t,n=e[25].filename+"";return{c(){t=h(n)},m(e,n){f(e,t,n)},p(e,l){4&l&&n!==(n=e[25].filename+"")&&_(t,n)},d(e){e&&u(t)}}}function tt(e){let t,n,l=e[25].filename+"";return{c(){t=h(l),n=h("/")},m(e,l){f(e,t,l),f(e,n,l)},p(e,n){4&n&&l!==(l=e[25].filename+"")&&_(t,l)},d(e){e&&(u(t),u(n))}}}function nt(e){let t,n,o,i,r,c,a,d,p,$,w,x,C,k,H,L,V,M,D,S,A,R=e[25].mimetype+"",N=(e[25].isDirectory?"":e[25].size_kb)+"",O=e[3][e[25].min_role_read]+"",j=new Date(e[25].uploaded_at).toLocaleString()+"";function E(e,t){return e[25].isDirectory?tt:et}o=new oe({props:{size:"lg",icon:e[8](e[25])}});let W=E(e),B=W(e);function F(...t){return e[20](e[25],...t)}function U(){return e[21](e[25])}return{c(){t=m("tr"),n=m("td"),T(o.$$.fragment),i=g(),r=m("td"),B.c(),c=g(),a=m("td"),d=h(R),p=g(),$=m("td"),w=h(N),x=g(),C=m("td"),k=h(O),H=g(),L=m("td"),V=h(j),M=g(),b($,"text-align","right"),y(t,"class","svelte-8hihfi"),z(t,"selected",e[6]?.filename===e[25].filename)},m(e,l){f(e,t,l),s(t,n),X(o,n,null),s(t,i),s(t,r),B.m(r,null),s(t,c),s(t,a),s(a,d),s(t,p),s(t,$),s($,w),s(t,x),s(t,C),s(C,k),s(t,H),s(t,L),s(L,V),s(t,M),D=!0,S||(A=[v(t,"click",F),v(t,"dblclick",U)],S=!0)},p(n,l){e=n;const i={};4&l&&(i.icon=e[8](e[25])),o.$set(i),W===(W=E(e))&&B?B.p(e,l):(B.d(1),B=W(e),B&&(B.c(),B.m(r,null))),(!D||4&l)&&R!==(R=e[25].mimetype+"")&&_(d,R),(!D||4&l)&&N!==(N=(e[25].isDirectory?"":e[25].size_kb)+"")&&_(w,N),(!D||12&l)&&O!==(O=e[3][e[25].min_role_read]+"")&&_(k,O),(!D||4&l)&&j!==(j=new Date(e[25].uploaded_at).toLocaleString()+"")&&_(V,j),(!D||68&l)&&z(t,"selected",e[6]?.filename===e[25].filename)},i(e){D||(I(o.$$.fragment,e),D=!0)},o(e){P(o.$$.fragment,e),D=!1},d(e){e&&u(t),q(o),B.d(),S=!1,l(A)}}}function lt(e){let t,n,o,i,r,c,a,p,$,_,w,z,x,C,k,H,L,V,M,D,S,A,R,N,O,j,E,W,K,Y,Z,J,G,Q,ee,te,ne=!e[0]&&Ze(e);x=new oe({props:{icon:e[10]("filename",e[4],e[5])}}),L=new oe({props:{icon:e[10]("mimetype",e[4],e[5])}}),D=new oe({props:{icon:e[10]("size_kb",e[4],e[5])}}),O=new oe({props:{icon:e[10]("min_role_read",e[4],e[5])}}),K=new oe({props:{icon:e[10]("uploaded_at",e[4],e[5])}});let le=U(e[2]),ie=[];for(let t=0;t<le.length;t+=1)ie[t]=nt(Ke(e,le,t));const re=e=>P(ie[e],1,1,(()=>{ie[e]=null}));return{c(){t=m("main"),n=m("div"),o=m("div"),ne&&ne.c(),i=g(),r=m("div"),c=m("table"),a=m("thead"),p=m("tr"),$=m("th"),_=g(),w=m("th"),z=h("Filename\n "),T(x.$$.fragment),C=g(),k=m("th"),H=h("Media type\n "),T(L.$$.fragment),V=g(),M=m("th"),T(D.$$.fragment),S=h("\n Size (KiB)"),A=g(),R=m("th"),N=h("Role to access\n "),T(O.$$.fragment),j=g(),E=m("th"),W=h("Created\n "),T(K.$$.fragment),Y=g(),Z=m("tbody");for(let e=0;e<ie.length;e+=1)ie[e].c();J=g(),G=m("button"),G.textContent="Select",b(M,"text-align","right"),y(c,"class","table table-sm table-hover"),y(r,"class","filelist svelte-8hihfi"),y(o,"class","col-12"),y(n,"class","row"),y(G,"class","btn btn-primary")},m(l,u){f(l,t,u),s(t,n),s(n,o),ne&&ne.m(o,null),s(o,i),s(o,r),s(r,c),s(c,a),s(a,p),s(p,$),s(p,_),s(p,w),s(w,z),X(x,w,null),s(p,C),s(p,k),s(k,H),X(L,k,null),s(p,V),s(p,M),X(D,M,null),s(M,S),s(p,A),s(p,R),s(R,N),X(O,R,null),s(p,j),s(p,E),s(E,W),X(K,E,null),s(c,Y),s(c,Z);for(let e=0;e<ie.length;e+=1)ie[e]&&ie[e].m(Z,null);s(t,J),s(t,G),Q=!0,ee||(te=[v(w,"click",e[15]),v(k,"click",e[16]),v(M,"click",e[17]),v(R,"click",e[18]),v(E,"click",e[19]),v(G,"click",e[22])],ee=!0)},p(e,[t]){e[0]?ne&&(B(),P(ne,1,1,(()=>{ne=null})),F()):ne?(ne.p(e,t),1&t&&I(ne,1)):(ne=Ze(e),ne.c(),I(ne,1),ne.m(o,i));const n={};48&t&&(n.icon=e[10]("filename",e[4],e[5])),x.$set(n);const l={};48&t&&(l.icon=e[10]("mimetype",e[4],e[5])),L.$set(l);const r={};48&t&&(r.icon=e[10]("size_kb",e[4],e[5])),D.$set(r);const c={};48&t&&(c.icon=e[10]("min_role_read",e[4],e[5])),O.$set(c);const a={};if(48&t&&(a.icon=e[10]("uploaded_at",e[4],e[5])),K.$set(a),6604&t){let n;for(le=U(e[2]),n=0;n<le.length;n+=1){const l=Ke(e,le,n);ie[n]?(ie[n].p(l,t),I(ie[n],1)):(ie[n]=nt(l),ie[n].c(),I(ie[n],1),ie[n].m(Z,null))}for(B(),n=le.length;n<ie.length;n+=1)re(n);F()}},i(e){if(!Q){I(ne),I(x.$$.fragment,e),I(L.$$.fragment,e),I(D.$$.fragment,e),I(O.$$.fragment,e),I(K.$$.fragment,e);for(let e=0;e<le.length;e+=1)I(ie[e]);Q=!0}},o(e){P(ne),P(x.$$.fragment,e),P(L.$$.fragment,e),P(D.$$.fragment,e),P(O.$$.fragment,e),P(K.$$.fragment,e),ie=ie.filter(Boolean);for(let e=0;e<ie.length;e+=1)P(ie[e]);Q=!1},d(e){e&&u(t),ne&&ne.d(),q(x),q(L),q(D),q(O),q(K),d(ie,e),ee=!1,l(te)}}}function ot(e,t,n){let l,{currentFolder:o="/"}=t,{noSubdirs:i=!1}=t,{inputId:r=""}=t,c=[],a={},s=!1,f=null;k((async()=>{await u()}));const u=async function(){const e=await fetch(`/files/visible_entries?dir=${encodeURIComponent(o)}${i?"&no_subdirs=true":""}`,{headers:{"X-Requested-With":"XMLHttpRequest"}}),t=await e.json();n(2,c=t.files);for(const e of c)e.mimetype=e.mime_sub&&e.mime_super?`${e.mime_super}/${e.mime_sub}`:"";t.directories;for(const e of t.roles)n(3,a[e.id]=e.role,a);window.emptyAlerts(),p(l||"filename",!0)};function d(e){n(13,o=e),n(6,f=null),u()}let m=[];function p(e,t){l!==e||t?l!==e&&(n(4,l=e),n(5,s=!1)):n(5,s=!s);let o=e=>e[l];"uploaded_at"===l&&(o=e=>new Date(e[l])),"filename"===l&&(o=e=>(e[l]||"").toLowerCase());n(2,c=c.sort(((e,t)=>o(e)<o(t)?s?1:-1:o(e)>o(t)?s?-1:1:0)))}function h(e){n(6,f=e)}function g(e){if(e){const t=document.getElementById(r);t&&(t.value=e.location),window.closeModal();const n=document.getElementById(`${r}-custom-text`);n&&(n.innerText=e.filename)}}return e.$$set=e=>{"currentFolder"in e&&n(13,o=e.currentFolder),"noSubdirs"in e&&n(0,i=e.noSubdirs),"inputId"in e&&n(14,r=e.inputId)},e.$$.update=()=>{8195&e.$$.dirty&&("/"===o||""===o?n(1,m=[{icon:ve,location:"/"}]):(n(1,m=o.split("/").map(((e,t)=>({name:e,location:o.split("/").slice(0,t+1).join("/")})))),i||m.unshift({icon:ve,location:"/"})))},[i,m,c,a,l,s,f,d,function(e){if("image"===e.mime_super)return de;if("audio"===e.mime_super)return se;if("video"===e.mime_super)return pe;if("pdf"===e.mime_sub)return me;if(e.isDirectory)return ge;const t=e.filename.toLowerCase();return t.endsWith(".csv")?fe:t.endsWith(".xls")||t.endsWith(".xlsx")?ue:t.endsWith(".doc")||t.endsWith(".docx")?he:t.endsWith(".txt")?ae:ce},p,function(e){return e!==l?null:s?ie:re},h,g,o,r,()=>p("filename"),()=>p("mimetype"),()=>p("size_kb"),()=>p("min_role_read"),()=>p("uploaded_at"),(e,t)=>h(e),e=>{e.isDirectory?d(e.location):g(e)},()=>g(f)]}class it extends Z{constructor(e){super(),Y(this,e,ot,lt,i,{currentFolder:13,noSubdirs:0,inputId:14})}}var rt=document.getElementById("saltcorn-file-manager");let ct=null;if("true"===rt?.getAttribute("full_manager"))ct=new qe({target:rt});else{const e=rt?.getAttribute("folder")||"/",t=rt?.getAttribute("input_id"),n="true"===rt?.getAttribute("no_subdirs");ct=new it({target:rt,props:{currentFolder:e,inputId:t,noSubdirs:n}})}return ct}();
6
6
  //# sourceMappingURL=bundle.js.map