@saltcorn/filemanager 1.5.0-beta.1 → 1.5.0-beta.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/package.json +1 -1
- package/public/build/bundle.css +1 -1
- package/public/build/bundle.js +2 -2
- package/public/build/bundle.js.map +1 -1
- package/src/Picker.svelte +7 -3
- package/src/main.js +2 -0
package/package.json
CHANGED
package/public/build/bundle.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
tr.selected.svelte-
|
|
1
|
+
tr.selected.svelte-16rl54v.svelte-16rl54v{background-color:rgb(213, 237, 255)}img.file-preview.svelte-16rl54v.svelte-16rl54v{max-height:200px;max-width:100%}div.file-actions.svelte-16rl54v select.svelte-16rl54v{width:unset;display:inline;max-width:33%}div.filelist.svelte-16rl54v.svelte-16rl54v{max-height:90vh;overflow-y:scroll}tr.selected.svelte-8hihfi{background-color:rgb(213, 237, 255)}div.filelist.svelte-8hihfi{max-height:90vh;overflow-y:scroll}.spin.svelte-1cj2gr0{animation:svelte-1cj2gr0-spin 2s 0s infinite linear}.pulse.svelte-1cj2gr0{animation:svelte-1cj2gr0-spin 1s infinite steps(8)}@keyframes svelte-1cj2gr0-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}
|
package/public/build/bundle.js
CHANGED
|
@@ -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 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
|
|
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 _(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function y(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 x(e,t,n){e.classList.toggle(t,!!n)}let z;function C(e){z=e}function k(e){(function(){if(!z)throw new Error("Function called outside component initialization");return z})().$$.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=z;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 F;function W(){F={r:0,c:[],p:F}}function B(){F.r||l(F.c),F=F.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),F.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=z;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(),_(l,"transform",e[12]),_(n,"transform",o="translate("+e[10][0]/2+" "+e[10][1]/2+")"),_(n,"transform-origin",i=e[10][0]/4+" 0"),_(t,"id",r=e[1]||void 0),_(t,"class",c="svelte-fa "+e[0]+" svelte-1cj2gr0"),_(t,"style",e[11]),_(t,"viewBox",a="0 0 "+e[10][0]+" "+e[10][1]),_(t,"aria-hidden","true"),_(t,"role","img"),_(t,"xmlns","http://www.w3.org/2000/svg"),x(t,"pulse",e[4]),x(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&&_(l,"transform",e[12]),1024&s&&o!==(o="translate("+e[10][0]/2+" "+e[10][1]/2+")")&&_(n,"transform",o),1024&s&&i!==(i=e[10][0]/4+" 0")&&_(n,"transform-origin",i),2&s&&r!==(r=e[1]||void 0)&&_(t,"id",r),1&s&&c!==(c="svelte-fa "+e[0]+" svelte-1cj2gr0")&&_(t,"class",c),2048&s&&_(t,"style",e[11]),1024&s&&a!==(a="0 0 "+e[10][0]+" "+e[10][1])&&_(t,"viewBox",a),17&s&&x(t,"pulse",e[4]),9&s&&x(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"),_(t,"d",n=e[10][4][0]),_(t,"fill",l=e[6]||e[2]||"currentColor"),_(t,"fill-opacity",o=0!=e[9]?e[7]:e[8]),_(t,"transform",i="translate("+e[10][0]/-2+" "+e[10][1]/-2+")"),_(r,"d",c=e[10][4][1]),_(r,"fill",a=e[5]||e[2]||"currentColor"),_(r,"fill-opacity",s=0!=e[9]?e[8]:e[7]),_(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])&&_(t,"d",n),68&f&&l!==(l=e[6]||e[2]||"currentColor")&&_(t,"fill",l),896&f&&o!==(o=0!=e[9]?e[7]:e[8])&&_(t,"fill-opacity",o),1024&f&&i!==(i="translate("+e[10][0]/-2+" "+e[10][1]/-2+")")&&_(t,"transform",i),1024&f&&c!==(c=e[10][4][1])&&_(r,"d",c),36&f&&a!==(a=e[5]||e[2]||"currentColor")&&_(r,"fill",a),896&f&&s!==(s=0!=e[9]?e[8]:e[7])&&_(r,"fill-opacity",s),1024&f&&d!==(d="translate("+e[10][0]/-2+" "+e[10][1]/-2+")")&&_(r,"transform",d)},d(e){e&&(u(t),u(r))}}}function te(e){let t,n,l,o;return{c(){t=p("path"),_(t,"d",n=e[10][4]),_(t,"fill",l=e[2]||e[5]||"currentColor"),_(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])&&_(t,"d",n),36&i&&l!==(l=e[2]||e[5]||"currentColor")&&_(t,"fill",l),1024&i&&o!==(o="translate("+e[10][0]/-2+" "+e[10][1]/-2+")")&&_(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:_=!1}=t,{pulse:y=!1}=t,{primaryColor:w=""}=t,{secondaryColor:b=""}=t,{primaryOpacity:x=1}=t,{secondaryOpacity:z=.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,_=e.spin),"pulse"in e&&n(4,y=e.pulse),"primaryColor"in e&&n(5,w=e.primaryColor),"secondaryColor"in e&&n(6,b=e.secondaryColor),"primaryOpacity"in e&&n(7,x=e.primaryOpacity),"secondaryOpacity"in e&&n(8,z=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,x,z,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
3
|
* Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com
|
|
4
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}();
|
|
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:_e}=a;function ye(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 xe(e,t,n){const l=e.slice();return l[53]=t[n],l}function ze(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+"")&&y(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,ze],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(),_(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(),P(p[c],1,1,()=>{p[c]=null}),B(),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+"")&&y(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+"")&&y(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])+"")&&y(n,l)},d(e){e&&u(t)}}}function De(e){let t,n,o,i,r,c,a,d,p,$,w,z,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 F=E(e),W=F(e),B=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"),W.c(),c=g(),B&&B.c(),a=g(),d=m("td"),p=h(R),$=g(),w=m("td"),z=h(N),C=g(),k=m("td"),H=h(O),L=g(),V=m("td"),M=h(j),b(w,"text-align","right"),_(t,"class","svelte-16rl54v"),x(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),W.m(r,null),s(t,c),B&&B.m(t,null),s(t,a),s(t,d),s(d,p),s(t,$),s(t,w),s(w,z),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),F===(F=E(e))&&W?W.p(e,l):(W.d(1),W=F(e),W&&(W.c(),W.m(r,null))),e[12]?B?B.p(e,l):(B=Me(e),B.c(),B.m(t,a)):B&&(B.d(1),B=null),(!D||2&l[0])&&R!==(R=e[50].mimetype+"")&&y(p,R),(!D||2&l[0])&&N!==(N=(e[50].isDirectory?"":e[50].size_kb)+"")&&y(z,N),(!D||10&l[0])&&O!==(O=e[3][e[50].min_role_read]+"")&&y(H,O),(!D||2&l[0])&&j!==(j=new Date(e[50].uploaded_at).toLocaleString()+"")&&y(M,j),(!D||18&l[0])&&x(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),W.d(),B&&B.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,x,z,C,k,H,L,V,M,D,S,A,R,N,O,j,E,F,W,B,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),_e=e[7].length>1&&Ee(e),be=U(e[8]),xe=[];for(let t=0;t<be.length;t+=1)xe[t]=Fe(we(e,be,t));let ze=U(e[2]),Ce=[];for(let t=0;t<ze.length;t+=1)Ce[t]=We(ye(e,ze,t));let ke=1===e[7].length&&Be(),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",x=g(),z=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"),F=m("a"),W=h("Link"),I=h("\n | \n "),P=m("a"),T=h("Download"),q=g(),_e&&_e.c(),K=g(),Y=m("div"),Z=m("select"),J=m("option"),J.textContent="Set access";for(let e=0;e<xe.length;e+=1)xe[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=$(),_(A,"class","pe-1"),_(F,"href",B=`/files/serve/${e[9].location}`),_(P,"href",X=`/files/download/${e[9].location}`),J.__value="",w(J,J.__value),J.disabled=!0,J.selected=!0,_(Z,"id","setRoleSelectId"),_(Z,"class","form-select svelte-16rl54v"),ee.__value="",w(ee,ee.__value),ee.disabled=!0,ee.selected=!0,_(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),_(ne,"class","form-select svelte-16rl54v"),_(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,x),s(p,z),ve.m(z,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,F),s(F,W),s(E,I),s(E,P),s(P,T),f(l,q,u),_e&&_e.m(l,u),f(l,K,u),f(l,Y,u),s(Y,Z),s(Z,J);for(let e=0;e<xe.length;e+=1)xe[e]&&xe[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+"")&&y(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(z,null))),512&t[0]&&ue!==(ue=new Date(e[9].uploaded_at).toLocaleString()+"")&&y(M,ue),520&t[0]&&de!==(de=e[3][e[9].min_role_read]+"")&&y(O,de),512&t[0]&&B!==(B=`/files/serve/${e[9].location}`)&&_(F,"href",B),512&t[0]&&X!==(X=`/files/download/${e[9].location}`)&&_(P,"href",X),e[7].length>1?_e?_e.p(e,t):(_e=Ee(e),_e.c(),_e.m(K.parentNode,K)):_e&&(_e.d(1),_e=null),256&t[0]){let n;for(be=U(e[8]),n=0;n<be.length;n+=1){const l=we(e,be,n);xe[n]?xe[n].p(l,t):(xe[n]=Fe(l),xe[n].c(),xe[n].m(Z,null))}for(;n<xe.length;n+=1)xe[n].d(1);xe.length=be.length}if(4&t[0]){let n;for(ze=U(e[2]),n=0;n<ze.length;n+=1){const l=ye(e,ze,n);Ce[n]?Ce[n].p(l,t):(Ce[n]=We(l),Ce[n].c(),Ce[n].m(Q,null))}for(;n<Ce.length;n+=1)Ce[n].d(1);Ce.length=ze.length}1===e[7].length?ke||(ke=Be(),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(),_e&&_e.d(e),d(xe,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"),_(t,"class","file-preview my-2 svelte-16rl54v"),c(t.src,n=`/files/serve/${e[9].location}`)||_(t,"src",n),_(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}`)&&_(t,"src",n),512&o[0]&&l!==(l=e[9].filename)&&_(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+"")&&y(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+"")&&y(t,o),512&n[0]&&i!==(i=e[9].mime_sub+"")&&y(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+"")&&y(l,c),128&t[0]&&a!==(a=e[7].length>2?"s":"")&&y(i,a)},d(e){e&&u(t)}}}function Fe(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+"")&&y(n,o),256&i[0]&&l!==(l=e[47].id)&&(t.__value=l,w(t,t.__value))},d(e){e&&u(t)}}}function We(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||"/")+"")&&y(n,o),4&i[0]&&l!==(l=e[44].location||"/")&&(t.__value=l,w(t,t.__value))},d(e){e&&u(t)}}}function Be(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',_(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,$,y,w,x,z,C,k,H,L,V,M,D,S,A,R,N,O,j,E,F,K,Y,Z,J,G,Q,ee,te,ne,le,ie,re,ce,ae,se,fe,ue,de,me,pe,he,ge,ve,ye,we,ze,Ce,Le,Ve,Me,Re=U(e[5]),Ne=[];for(let t=0;t<Re.length;t+=1)Ne[t]=ke(xe(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]),Fe=[];for(let t=0;t<Ee.length;t+=1)Fe[t]=De(be(e,Ee,t));const We=e=>P(Fe[e],1,1,()=>{Fe[e]=null});fe=new oe({props:{size:"lg",icon:$e}});let Be=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>',y=g(),w=m("input"),x=g(),z=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(),F=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<Fe.length;e+=1)Fe[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(),Be&&Be.c(),pe=g(),he=m("td"),ge=g(),ve=m("td"),ye=g(),we=m("td"),ze=g(),Ce=m("div"),Ie&&Ie.c(),_(c,"class","breadcrumb"),_(r,"aria-label","breadcrumb"),_($,"class","btn btn-outline-secondary search-bar"),_($,"type","submit"),_($,"id","button-search-submit"),_(w,"type","search"),_(w,"class","form-control search-bar"),_(w,"placeholder","Search Files"),_(w,"aria-label","Search"),_(w,"aria-describedby","button-search-submit"),_(p,"class","input-group search-bar mb-3"),b(F,"text-align","right"),_(C,"class","table table-sm table-hover"),_(z,"class","filelist svelte-16rl54v"),_(o,"class","col-8"),_(Ce,"class","col-4"),_(n,"id","drop-zone"),_(n,"ondragover","return false"),_(n,"class","row"),_(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,y),s(p,w),s(o,x),s(o,z),s(z,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,F),X(K,F,null),s(F,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<Fe.length;e+=1)Fe[e]&&Fe[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),Be&&Be.m(ae,null),s(ae,pe),s(ae,he),s(ae,ge),s(ae,ve),s(ae,ye),s(ae,we),s(n,ze),s(n,Ce),Ie&&Ie.m(Ce,null),Le=!0,Ve||(Me=[v(_e,"keydown",e[15]),v(_e,"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(F,"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=xe(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(W(),n=Re.length;n<Ne.length;n+=1)Oe(n);B()}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);Fe[n]?(Fe[n].p(l,t),I(Fe[n],1)):(Fe[n]=De(l),Fe[n].c(),I(Fe[n],1),Fe[n].m(re,ce))}for(W(),n=Ee.length;n<Fe.length;n+=1)We(n);B()}e[12]?Be||(Be=Se(),Be.c(),Be.m(ae,pe)):Be&&(Be.d(1),Be=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(Fe[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),Fe=Fe.filter(Boolean);for(let e=0;e<Fe.length;e+=1)P(Fe[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(Fe,e),q(fe),Be&&Be.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){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";return void n.click()}return await o}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(),y(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 _=[];function y(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,_=[{icon:ve,location:"/"}]):(n(5,_=s.split("/").map((e,t)=>({name:e,location:s.split("/").slice(0,t+1).join("/")}))),_.unshift({icon:ve,location:"/"})))},[s,r,c,a,d,_,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},y,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)},()=>y("filename"),()=>y("mimetype"),()=>y("size_kb"),()=>y("min_role_read"),()=>y("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[26]=t[n],l}function Ye(e,t,n){const l=e.slice();return l[29]=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();_(l,"class","breadcrumb"),_(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[0]){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(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)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[29].name+"";return{c(){n=h(l)},m(e,t){f(e,n,t)},p(e,t){2&t[0]&&l!==(l=e[29].name+"")&&y(n,l)},i:e,o:e,d(e){e&&u(n)}}}function Ge(e){let t,n;return t=new oe({props:{icon:e[29].icon}}),{c(){T(t.$$.fragment)},m(e,l){X(t,e,l),n=!0},p(e,n){const l={};2&n[0]&&(l.icon=e[29].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[29].icon?0:1}return n=h(e),l=p[n]=d[n](e),{c(){t=m("li"),l.c(),i=g(),_(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[29].location))&&e[7](e[29].location).apply(this,arguments)}),c=!0)},p(o,r){let c=n;n=h(e=o),n===c?p[n].p(e,r):(W(),P(p[c],1,1,()=>{p[c]=null}),B(),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[26].filename+"";return{c(){t=h(n)},m(e,n){f(e,t,n)},p(e,l){4&l[0]&&n!==(n=e[26].filename+"")&&y(t,n)},d(e){e&&u(t)}}}function tt(e){let t,n,l=e[26].filename+"";return{c(){t=h(l),n=h("/")},m(e,l){f(e,t,l),f(e,n,l)},p(e,n){4&n[0]&&l!==(l=e[26].filename+"")&&y(t,l)},d(e){e&&(u(t),u(n))}}}function nt(e){let t,n,o,i,r,c,a,d,p,$,w,z,C,k,H,L,V,M,D,S,A,R=e[26].mimetype+"",N=(e[26].isDirectory?"":e[26].size_kb)+"",O=e[3][e[26].min_role_read]+"",j=new Date(e[26].uploaded_at).toLocaleString()+"";function E(e,t){return e[26].isDirectory?tt:et}o=new oe({props:{size:"lg",icon:e[8](e[26])}});let F=E(e),W=F(e);function B(...t){return e[21](e[26],...t)}function U(){return e[22](e[26])}return{c(){t=m("tr"),n=m("td"),T(o.$$.fragment),i=g(),r=m("td"),W.c(),c=g(),a=m("td"),d=h(R),p=g(),$=m("td"),w=h(N),z=g(),C=m("td"),k=h(O),H=g(),L=m("td"),V=h(j),M=g(),b($,"text-align","right"),_(t,"class","svelte-8hihfi"),x(t,"selected",e[6]?.filename===e[26].filename)},m(e,l){f(e,t,l),s(t,n),X(o,n,null),s(t,i),s(t,r),W.m(r,null),s(t,c),s(t,a),s(a,d),s(t,p),s(t,$),s($,w),s(t,z),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",B),v(t,"dblclick",U)],S=!0)},p(n,l){e=n;const i={};4&l[0]&&(i.icon=e[8](e[26])),o.$set(i),F===(F=E(e))&&W?W.p(e,l):(W.d(1),W=F(e),W&&(W.c(),W.m(r,null))),(!D||4&l[0])&&R!==(R=e[26].mimetype+"")&&y(d,R),(!D||4&l[0])&&N!==(N=(e[26].isDirectory?"":e[26].size_kb)+"")&&y(w,N),(!D||12&l[0])&&O!==(O=e[3][e[26].min_role_read]+"")&&y(k,O),(!D||4&l[0])&&j!==(j=new Date(e[26].uploaded_at).toLocaleString()+"")&&y(V,j),(!D||68&l[0])&&x(t,"selected",e[6]?.filename===e[26].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),W.d(),S=!1,l(A)}}}function lt(e){let t,n,o,i,r,c,a,p,$,y,w,x,z,C,k,H,L,V,M,D,S,A,R,N,O,j,E,F,K,Y,Z,J,G,Q,ee,te,ne=!e[0]&&Ze(e);z=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"),y=g(),w=m("th"),x=h("Filename\n "),T(z.$$.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"),F=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"),_(c,"class","table table-sm table-hover"),_(r,"class","filelist svelte-8hihfi"),_(o,"class","col-12"),_(n,"class","row"),_(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,y),s(p,w),s(w,x),X(z,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,F),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[16]),v(k,"click",e[17]),v(M,"click",e[18]),v(R,"click",e[19]),v(E,"click",e[20]),v(G,"click",e[23])],ee=!0)},p(e,t){e[0]?ne&&(W(),P(ne,1,1,()=>{ne=null}),B()):ne?(ne.p(e,t),1&t[0]&&I(ne,1)):(ne=Ze(e),ne.c(),I(ne,1),ne.m(o,i));const n={};48&t[0]&&(n.icon=e[10]("filename",e[4],e[5])),z.$set(n);const l={};48&t[0]&&(l.icon=e[10]("mimetype",e[4],e[5])),L.$set(l);const r={};48&t[0]&&(r.icon=e[10]("size_kb",e[4],e[5])),D.$set(r);const c={};48&t[0]&&(c.icon=e[10]("min_role_read",e[4],e[5])),O.$set(c);const a={};if(48&t[0]&&(a.icon=e[10]("uploaded_at",e[4],e[5])),K.$set(a),6604&t[0]){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(W(),n=le.length;n<ie.length;n+=1)re(n);B()}},i(e){if(!Q){I(ne),I(z.$$.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(z.$$.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(z),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,{file_exts:r=null}=t,{inputId:c=""}=t,a=[],s={},f=!1,u=null;k(async()=>{await d()});const d=async function(){const e=`/files/visible_entries?dir=${encodeURIComponent(o)}${i?"&no_subdirs=true":""}${r?"&file_exts="+r:""}`;console.log(2,{currentFolder:o,file_exts:r,noSubdirs:i,url:e});const t=await fetch(e,{headers:{"X-Requested-With":"XMLHttpRequest"}}),c=await t.json();n(2,a=c.files);for(const e of a)e.mimetype=e.mime_sub&&e.mime_super?`${e.mime_super}/${e.mime_sub}`:"";c.directories;for(const e of c.roles)n(3,s[e.id]=e.role,s);window.emptyAlerts(),h(l||"filename",!0)};function m(e){n(13,o=e),n(6,u=null),d()}let p=[];function h(e,t){l!==e||t?l!==e&&(n(4,l=e),n(5,f=!1)):n(5,f=!f);let o=e=>e[l];"uploaded_at"===l&&(o=e=>new Date(e[l])),"filename"===l&&(o=e=>(e[l]||"").toLowerCase());n(2,a=a.sort((e,t)=>o(e)<o(t)?f?1:-1:o(e)>o(t)?f?-1:1:0))}function g(e){n(6,u=e)}function $(e){if(e){const t=document.getElementById(c);t&&(t.value=e.location),window.closeModal();const n=document.getElementById(`${c}-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),"file_exts"in e&&n(14,r=e.file_exts),"inputId"in e&&n(15,c=e.inputId)},e.$$.update=()=>{8195&e.$$.dirty[0]&&("/"===o||""===o?n(1,p=[{icon:ve,location:"/"}]):(n(1,p=o.split("/").map((e,t)=>({name:e,location:o.split("/").slice(0,t+1).join("/")}))),i||p.unshift({icon:ve,location:"/"})))},[i,p,a,s,l,f,u,m,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},h,function(e){return e!==l?null:f?ie:re},g,$,o,r,c,()=>h("filename"),()=>h("mimetype"),()=>h("size_kb"),()=>h("min_role_read"),()=>h("uploaded_at"),(e,t)=>g(e),e=>{e.isDirectory?m(e.location):$(e)},()=>$(u)]}class it extends Z{constructor(e){super(),Y(this,e,ot,lt,i,{currentFolder:13,noSubdirs:0,file_exts:14,inputId:15},null,[-1,-1])}}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"),l=rt?.getAttribute("file_exts");console.log(1,{currentFolder:e,file_exts:l}),ct=new it({target:rt,props:{currentFolder:e,inputId:t,noSubdirs:n,file_exts:l}})}return ct}();
|
|
6
6
|
//# sourceMappingURL=bundle.js.map
|