@opencloud-eu/web-pkg 5.0.0-alpha.1 → 5.1.0

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.
Files changed (47) hide show
  1. package/dist/{TextEditor-uEaAtt7z.js → TextEditor-CXSedGM4.js} +1 -1
  2. package/dist/assets/worker-22sDKzz_.js +21 -0
  3. package/dist/assets/worker-BSCY2vwA.js +21 -0
  4. package/dist/assets/worker-DH8D29Kr.js +21 -0
  5. package/dist/index-CEJcEmbf.js +25419 -0
  6. package/dist/src/components/AppBar/AppBar.vue.d.ts +1 -9
  7. package/dist/src/components/AppTemplates/AppWrapper.vue.d.ts +1 -1
  8. package/dist/src/components/FilesList/ResourceName.vue.d.ts +11 -139
  9. package/dist/src/components/FilesList/ResourceStatusIndicators.vue.d.ts +1 -1
  10. package/dist/src/components/FilesList/ResourceTable.vue.d.ts +0 -1
  11. package/dist/src/components/FilesList/ResourceTiles.vue.d.ts +2 -2
  12. package/dist/src/components/PortalTarget.vue.d.ts +1 -40
  13. package/dist/src/components/SideBar/FileSideBar.vue.d.ts +2 -12
  14. package/dist/src/components/SideBar/SideBar.vue.d.ts +3 -9
  15. package/dist/src/components/SideBar/SideBarPanels.vue.d.ts +38 -0
  16. package/dist/src/components/SideBar/Spaces/SpaceInfo.vue.d.ts +1 -4
  17. package/dist/src/components/SideBar/index.d.ts +1 -0
  18. package/dist/src/composables/actions/files/index.d.ts +1 -0
  19. package/dist/src/composables/actions/files/useFileActionFallbackToDownload.d.ts +4 -0
  20. package/dist/src/composables/filesList/useResourceRouteResolver.d.ts +1 -4
  21. package/dist/src/composables/folderLink/useFolderLink.d.ts +1 -1
  22. package/dist/src/composables/index.d.ts +0 -2
  23. package/dist/src/composables/piniaStores/avatars.d.ts +1 -1
  24. package/dist/src/composables/piniaStores/capabilities.d.ts +1 -13
  25. package/dist/src/composables/piniaStores/index.d.ts +4 -3
  26. package/dist/src/composables/piniaStores/sideBar.d.ts +46 -0
  27. package/dist/src/composables/piniaStores/user.d.ts +1 -1
  28. package/dist/src/composables/resources/index.d.ts +1 -0
  29. package/dist/src/composables/resources/useResourceIndicators.d.ts +19 -0
  30. package/dist/src/composables/resources/useResourceViewHelpers.d.ts +1 -0
  31. package/dist/src/composables/sort/useSort.d.ts +1 -5
  32. package/dist/src/helpers/statusIndicators.d.ts +3 -14
  33. package/dist/src/services/cache.d.ts +0 -5
  34. package/dist/src/services/client/client.d.ts +0 -4
  35. package/dist/src/ui/types.d.ts +0 -2
  36. package/dist/web-pkg.js +79 -78
  37. package/dist/web-pkg.umd.cjs +19 -51
  38. package/package.json +4 -5
  39. package/dist/assets/worker-Br2EoHIh.js +0 -40
  40. package/dist/assets/worker-CL8AMTxB.js +0 -40
  41. package/dist/assets/worker-SrzUf4Ns.js +0 -40
  42. package/dist/index-BwyOzVbn.js +0 -33881
  43. package/dist/src/composables/clipboard/index.d.ts +0 -1
  44. package/dist/src/composables/clipboard/useClipboard.d.ts +0 -6
  45. package/dist/src/composables/sideBar/eventTopics.d.ts +0 -7
  46. package/dist/src/composables/sideBar/index.d.ts +0 -2
  47. package/dist/src/composables/sideBar/useSideBar.d.ts +0 -12
@@ -1,68 +1,36 @@
1
- (function($,re){typeof exports=="object"&&typeof module<"u"?re(exports,require("@opencloud-eu/web-client"),require("@casl/vue"),require("vue3-gettext"),require("fuse.js"),require("lodash-es"),require("axios"),require("uuid"),require("@microsoft/fetch-event-source"),require("vue-concurrency"),require("luxon"),require("filesize"),require("qs"),require("password-sheriff"),require("@uppy/core"),require("@uppy/tus"),require("@uppy/xhr-upload"),require("@uppy/utils"),require("pinia"),require("oidc-client-ts"),require("@vueuse/core"),require("deepmerge"),require("portal-vue"),require("dompurify"),require("mark.js"),require("p-queue"),require("cropperjs"),require("vue-router"),require("@vue/shared"),require("md-editor-v3"),require("zod"),require("@sentry/vue"),require("screenfull"),require("@codemirror/view")):typeof define=="function"&&define.amd?define(["exports","@opencloud-eu/web-client","@casl/vue","vue3-gettext","fuse.js","lodash-es","axios","uuid","@microsoft/fetch-event-source","vue-concurrency","luxon","filesize","qs","password-sheriff","@uppy/core","@uppy/tus","@uppy/xhr-upload","@uppy/utils","pinia","oidc-client-ts","@vueuse/core","deepmerge","portal-vue","dompurify","mark.js","p-queue","cropperjs","vue-router","@vue/shared","md-editor-v3","zod","@sentry/vue","screenfull","@codemirror/view"],re):($=typeof globalThis<"u"?globalThis:$||self,re($["web-pkg"]={},$.webClient,$.vue,$.vue3Gettext,$.Fuse,$.lodashEs,$.globalAxios,$.uuid,$.fetchEventSource,$.vueConcurrency,$.luxon,$.filesize,$.qs,$.passwordSheriff,$.Uppy,$.Tus,$.XHRUpload,$.utils,$.pinia,$.oidcClientTs,$.core,$.merge$1,$.portalVue,$.DOMPurify,$.Mark,$.PQueue,$.Cropper,$.vueRouter,$.shared,$.mdEditorV3,$.zod,$.vue$1,$.screenfull,$.view))})(this,(function($,re,ES,Oe,Hd,At,fs,Gt,TS,rn,jt,AS,xS,CS,Kd,RS,kS,Gd,Me,PS,Vn,Qd,ds,Xd,Yd,Lr,ol,ps,q,so,fe,IS,OS,FS){"use strict";const _S=e=>e;function Jd(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function DS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Zd={exports:{}},Lt=Zd.exports={},Zn,er;function sl(){throw new Error("setTimeout has not been defined")}function al(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Zn=setTimeout:Zn=sl}catch{Zn=sl}try{typeof clearTimeout=="function"?er=clearTimeout:er=al}catch{er=al}})();function ep(e){if(Zn===setTimeout)return setTimeout(e,0);if((Zn===sl||!Zn)&&setTimeout)return Zn=setTimeout,setTimeout(e,0);try{return Zn(e,0)}catch{try{return Zn.call(null,e,0)}catch{return Zn.call(this,e,0)}}}function NS(e){if(er===clearTimeout)return clearTimeout(e);if((er===al||!er)&&clearTimeout)return er=clearTimeout,clearTimeout(e);try{return er(e)}catch{try{return er.call(null,e)}catch{return er.call(this,e)}}}var gr=[],Ti=!1,Jr,hs=-1;function LS(){!Ti||!Jr||(Ti=!1,Jr.length?gr=Jr.concat(gr):hs=-1,gr.length&&tp())}function tp(){if(!Ti){var e=ep(LS);Ti=!0;for(var t=gr.length;t;){for(Jr=gr,gr=[];++hs<t;)Jr&&Jr[hs].run();hs=-1,t=gr.length}Jr=null,Ti=!1,NS(e)}}Lt.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];gr.push(new np(e,t)),gr.length===1&&!Ti&&ep(tp)};function np(e,t){this.fun=e,this.array=t}np.prototype.run=function(){this.fun.apply(null,this.array)},Lt.title="browser",Lt.browser=!0,Lt.env={},Lt.argv=[],Lt.version="",Lt.versions={};function yr(){}Lt.on=yr,Lt.addListener=yr,Lt.once=yr,Lt.off=yr,Lt.removeListener=yr,Lt.removeAllListeners=yr,Lt.emit=yr,Lt.prependListener=yr,Lt.prependOnceListener=yr,Lt.listeners=function(e){return[]},Lt.binding=function(e){throw new Error("process.binding is not supported")},Lt.cwd=function(){return"/"},Lt.chdir=function(e){throw new Error("process.chdir is not supported")},Lt.umask=function(){return 0};var $S=Zd.exports;const be=DS($S);function tr(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let lt;const ll=new WeakSet;class MS{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ll.has(this)&&(ll.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ip(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,cp(this),op(this);const t=lt,n=qn;lt=this,qn=!0;try{return this.fn()}finally{be.env.NODE_ENV!=="production"&&lt!==this&&tr("Active effect was not restored correctly - this is likely a Vue internal bug."),sp(this),lt=t,qn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)dl(t);this.deps=this.depsTail=void 0,cp(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ll.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){fl(this)&&this.run()}get dirty(){return fl(this)}}let rp=0,ao,lo;function ip(e,t=!1){if(e.flags|=8,t){e.next=lo,lo=e;return}e.next=ao,ao=e}function cl(){rp++}function ul(){if(--rp>0)return;if(lo){let t=lo;for(lo=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;ao;){let t=ao;for(ao=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function op(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function sp(e){let t,n=e.depsTail,r=n;for(;r;){const i=r.prevDep;r.version===-1?(r===n&&(n=i),dl(r),BS(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}e.deps=t,e.depsTail=n}function fl(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(ap(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function ap(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===co)||(e.globalVersion=co,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!fl(e))))return;e.flags|=2;const t=e.dep,n=lt,r=qn;lt=e,qn=!0;try{op(e);const i=e.fn(e._value);(t.version===0||q.hasChanged(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{lt=n,qn=r,sp(e),e.flags&=-3}}function dl(e,t=!1){const{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),be.env.NODE_ENV!=="production"&&n.subsHead===e&&(n.subsHead=i),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)dl(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function BS(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let qn=!0;const lp=[];function Ai(){lp.push(qn),qn=!1}function xi(){const e=lp.pop();qn=e===void 0?!0:e}function cp(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=lt;lt=void 0;try{t()}finally{lt=n}}}let co=0;class jS{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class ms{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0,be.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(t){if(!lt||!qn||lt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==lt)n=this.activeLink=new jS(lt,this),lt.deps?(n.prevDep=lt.depsTail,lt.depsTail.nextDep=n,lt.depsTail=n):lt.deps=lt.depsTail=n,up(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=lt.depsTail,n.nextDep=void 0,lt.depsTail.nextDep=n,lt.depsTail=n,lt.deps===n&&(lt.deps=r)}return be.env.NODE_ENV!=="production"&&lt.onTrack&&lt.onTrack(q.extend({effect:lt},t)),n}trigger(t){this.version++,co++,this.notify(t)}notify(t){cl();try{if(be.env.NODE_ENV!=="production")for(let n=this.subsHead;n;n=n.nextSub)n.sub.onTrigger&&!(n.sub.flags&8)&&n.sub.onTrigger(q.extend({effect:n.sub},t));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{ul()}}}function up(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)up(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),be.env.NODE_ENV!=="production"&&e.dep.subsHead===void 0&&(e.dep.subsHead=e),e.dep.subs=e}}const gs=new WeakMap,Zr=Symbol(be.env.NODE_ENV!=="production"?"Object iterate":""),pl=Symbol(be.env.NODE_ENV!=="production"?"Map keys iterate":""),uo=Symbol(be.env.NODE_ENV!=="production"?"Array iterate":"");function Yt(e,t,n){if(qn&&lt){let r=gs.get(e);r||gs.set(e,r=new Map);let i=r.get(n);i||(r.set(n,i=new ms),i.map=r,i.key=n),be.env.NODE_ENV!=="production"?i.track({target:e,type:t,key:n}):i.track()}}function $r(e,t,n,r,i,o){const s=gs.get(e);if(!s){co++;return}const a=l=>{l&&(be.env.NODE_ENV!=="production"?l.trigger({target:e,type:t,key:n,newValue:r,oldValue:i,oldTarget:o}):l.trigger())};if(cl(),t==="clear")s.forEach(a);else{const l=q.isArray(e),u=l&&q.isIntegerKey(n);if(l&&n==="length"){const c=Number(r);s.forEach((d,p)=>{(p==="length"||p===uo||!q.isSymbol(p)&&p>=c)&&a(d)})}else switch((n!==void 0||s.has(void 0))&&a(s.get(n)),u&&a(s.get(uo)),t){case"add":l?u&&a(s.get("length")):(a(s.get(Zr)),q.isMap(e)&&a(s.get(pl)));break;case"delete":l||(a(s.get(Zr)),q.isMap(e)&&a(s.get(pl)));break;case"set":q.isMap(e)&&a(s.get(Zr));break}}ul()}function US(e,t){const n=gs.get(e);return n&&n.get(t)}function Ci(e){const t=rt(e);return t===e?t:(Yt(t,"iterate",uo),on(e)?t:t.map(Wn))}function ys(e){return Yt(e=rt(e),"iterate",uo),e}function Mr(e,t){return zn(e)?Br(e)?Ri(Wn(t)):Ri(t):Wn(t)}const VS={__proto__:null,[Symbol.iterator](){return hl(this,Symbol.iterator,e=>Mr(this,e))},concat(...e){return Ci(this).concat(...e.map(t=>q.isArray(t)?Ci(t):t))},entries(){return hl(this,"entries",e=>(e[1]=Mr(this,e[1]),e))},every(e,t){return vr(this,"every",e,t,void 0,arguments)},filter(e,t){return vr(this,"filter",e,t,n=>n.map(r=>Mr(this,r)),arguments)},find(e,t){return vr(this,"find",e,t,n=>Mr(this,n),arguments)},findIndex(e,t){return vr(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return vr(this,"findLast",e,t,n=>Mr(this,n),arguments)},findLastIndex(e,t){return vr(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return vr(this,"forEach",e,t,void 0,arguments)},includes(...e){return ml(this,"includes",e)},indexOf(...e){return ml(this,"indexOf",e)},join(e){return Ci(this).join(e)},lastIndexOf(...e){return ml(this,"lastIndexOf",e)},map(e,t){return vr(this,"map",e,t,void 0,arguments)},pop(){return fo(this,"pop")},push(...e){return fo(this,"push",e)},reduce(e,...t){return fp(this,"reduce",e,t)},reduceRight(e,...t){return fp(this,"reduceRight",e,t)},shift(){return fo(this,"shift")},some(e,t){return vr(this,"some",e,t,void 0,arguments)},splice(...e){return fo(this,"splice",e)},toReversed(){return Ci(this).toReversed()},toSorted(e){return Ci(this).toSorted(e)},toSpliced(...e){return Ci(this).toSpliced(...e)},unshift(...e){return fo(this,"unshift",e)},values(){return hl(this,"values",e=>Mr(this,e))}};function hl(e,t,n){const r=ys(e),i=r[t]();return r!==e&&!on(e)&&(i._next=i.next,i.next=()=>{const o=i._next();return o.done||(o.value=n(o.value)),o}),i}const qS=Array.prototype;function vr(e,t,n,r,i,o){const s=ys(e),a=s!==e&&!on(e),l=s[t];if(l!==qS[t]){const d=l.apply(e,o);return a?Wn(d):d}let u=n;s!==e&&(a?u=function(d,p){return n.call(this,Mr(e,d),p,e)}:n.length>2&&(u=function(d,p){return n.call(this,d,p,e)}));const c=l.call(s,u,r);return a&&i?i(c):c}function fp(e,t,n,r){const i=ys(e);let o=n;return i!==e&&(on(e)?n.length>3&&(o=function(s,a,l){return n.call(this,s,a,l,e)}):o=function(s,a,l){return n.call(this,s,Mr(e,a),l,e)}),i[t](o,...r)}function ml(e,t,n){const r=rt(e);Yt(r,"iterate",uo);const i=r[t](...n);return(i===-1||i===!1)&&po(n[0])?(n[0]=rt(n[0]),r[t](...n)):i}function fo(e,t,n=[]){Ai(),cl();const r=rt(e)[t].apply(e,n);return ul(),xi(),r}const zS=q.makeMap("__proto__,__v_isRef,__isVue"),dp=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(q.isSymbol));function WS(e){q.isSymbol(e)||(e=String(e));const t=rt(this);return Yt(t,"has",e),t.hasOwnProperty(e)}class pp{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const i=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(i?o?vp:yp:o?t1:gp).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const s=q.isArray(t);if(!i){let l;if(s&&(l=VS[n]))return l;if(n==="hasOwnProperty")return WS}const a=Reflect.get(t,n,_t(t)?t:r);if((q.isSymbol(n)?dp.has(n):zS(n))||(i||Yt(t,"get",n),o))return a;if(_t(a)){const l=s&&q.isIntegerKey(n)?a:a.value;return i&&q.isObject(l)?nr(l):l}return q.isObject(a)?i?nr(a):vl(a):a}}class HS extends pp{constructor(t=!1){super(!1,t)}set(t,n,r,i){let o=t[n];const s=q.isArray(t)&&q.isIntegerKey(n);if(!this._isShallow){const u=zn(o);if(!on(r)&&!zn(r)&&(o=rt(o),r=rt(r)),!s&&_t(o)&&!_t(r))return u?(be.env.NODE_ENV!=="production"&&tr(`Set operation on key "${String(n)}" failed: target is readonly.`,t[n]),!0):(o.value=r,!0)}const a=s?Number(n)<t.length:q.hasOwn(t,n),l=Reflect.set(t,n,r,_t(t)?t:i);return t===rt(i)&&(a?q.hasChanged(r,o)&&$r(t,"set",n,r,o):$r(t,"add",n,r)),l}deleteProperty(t,n){const r=q.hasOwn(t,n),i=t[n],o=Reflect.deleteProperty(t,n);return o&&r&&$r(t,"delete",n,void 0,i),o}has(t,n){const r=Reflect.has(t,n);return(!q.isSymbol(n)||!dp.has(n))&&Yt(t,"has",n),r}ownKeys(t){return Yt(t,"iterate",q.isArray(t)?"length":Zr),Reflect.ownKeys(t)}}class hp extends pp{constructor(t=!1){super(!0,t)}set(t,n){return be.env.NODE_ENV!=="production"&&tr(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return be.env.NODE_ENV!=="production"&&tr(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const KS=new HS,GS=new hp,QS=new hp(!0),gl=e=>e,vs=e=>Reflect.getPrototypeOf(e);function XS(e,t,n){return function(...r){const i=this.__v_raw,o=rt(i),s=q.isMap(o),a=e==="entries"||e===Symbol.iterator&&s,l=e==="keys"&&s,u=i[e](...r),c=n?gl:t?Ri:Wn;return!t&&Yt(o,"iterate",l?pl:Zr),{next(){const{value:d,done:p}=u.next();return p?{value:d,done:p}:{value:a?[c(d[0]),c(d[1])]:c(d),done:p}},[Symbol.iterator](){return this}}}}function bs(e){return function(...t){if(be.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";tr(`${q.capitalize(e)} operation ${n}failed: target is readonly.`,rt(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function YS(e,t){const n={get(i){const o=this.__v_raw,s=rt(o),a=rt(i);e||(q.hasChanged(i,a)&&Yt(s,"get",i),Yt(s,"get",a));const{has:l}=vs(s),u=t?gl:e?Ri:Wn;if(l.call(s,i))return u(o.get(i));if(l.call(s,a))return u(o.get(a));o!==s&&o.get(i)},get size(){const i=this.__v_raw;return!e&&Yt(rt(i),"iterate",Zr),i.size},has(i){const o=this.__v_raw,s=rt(o),a=rt(i);return e||(q.hasChanged(i,a)&&Yt(s,"has",i),Yt(s,"has",a)),i===a?o.has(i):o.has(i)||o.has(a)},forEach(i,o){const s=this,a=s.__v_raw,l=rt(a),u=t?gl:e?Ri:Wn;return!e&&Yt(l,"iterate",Zr),a.forEach((c,d)=>i.call(o,u(c),u(d),s))}};return q.extend(n,e?{add:bs("add"),set:bs("set"),delete:bs("delete"),clear:bs("clear")}:{add(i){!t&&!on(i)&&!zn(i)&&(i=rt(i));const o=rt(this);return vs(o).has.call(o,i)||(o.add(i),$r(o,"add",i,i)),this},set(i,o){!t&&!on(o)&&!zn(o)&&(o=rt(o));const s=rt(this),{has:a,get:l}=vs(s);let u=a.call(s,i);u?be.env.NODE_ENV!=="production"&&mp(s,a,i):(i=rt(i),u=a.call(s,i));const c=l.call(s,i);return s.set(i,o),u?q.hasChanged(o,c)&&$r(s,"set",i,o,c):$r(s,"add",i,o),this},delete(i){const o=rt(this),{has:s,get:a}=vs(o);let l=s.call(o,i);l?be.env.NODE_ENV!=="production"&&mp(o,s,i):(i=rt(i),l=s.call(o,i));const u=a?a.call(o,i):void 0,c=o.delete(i);return l&&$r(o,"delete",i,void 0,u),c},clear(){const i=rt(this),o=i.size!==0,s=be.env.NODE_ENV!=="production"?q.isMap(i)?new Map(i):new Set(i):void 0,a=i.clear();return o&&$r(i,"clear",void 0,void 0,s),a}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=XS(i,e,t)}),n}function yl(e,t){const n=YS(e,t);return(r,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?r:Reflect.get(q.hasOwn(n,i)&&i in r?n:r,i,o)}const JS={get:yl(!1,!1)},ZS={get:yl(!0,!1)},e1={get:yl(!0,!0)};function mp(e,t,n){const r=rt(n);if(r!==n&&t.call(e,r)){const i=q.toRawType(e);tr(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const gp=new WeakMap,t1=new WeakMap,yp=new WeakMap,vp=new WeakMap;function n1(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function r1(e){return e.__v_skip||!Object.isExtensible(e)?0:n1(q.toRawType(e))}function vl(e){return zn(e)?e:bl(e,!1,KS,JS,gp)}function nr(e){return bl(e,!0,GS,ZS,yp)}function ws(e){return bl(e,!0,QS,e1,vp)}function bl(e,t,n,r,i){if(!q.isObject(e))return be.env.NODE_ENV!=="production"&&tr(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=r1(e);if(o===0)return e;const s=i.get(e);if(s)return s;const a=new Proxy(e,o===2?r:n);return i.set(e,a),a}function Br(e){return zn(e)?Br(e.__v_raw):!!(e&&e.__v_isReactive)}function zn(e){return!!(e&&e.__v_isReadonly)}function on(e){return!!(e&&e.__v_isShallow)}function po(e){return e?!!e.__v_raw:!1}function rt(e){const t=e&&e.__v_raw;return t?rt(t):e}function bp(e){return!q.hasOwn(e,"__v_skip")&&Object.isExtensible(e)&&q.def(e,"__v_skip",!0),e}const Wn=e=>q.isObject(e)?vl(e):e,Ri=e=>q.isObject(e)?nr(e):e;function _t(e){return e?e.__v_isRef===!0:!1}function ae(e){return wp(e,!1)}function i1(e){return wp(e,!0)}function wp(e,t){return _t(e)?e:new o1(e,t)}class o1{constructor(t,n){this.dep=new ms,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:rt(t),this._value=n?t:Wn(t),this.__v_isShallow=n}get value(){return be.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||on(t)||zn(t);t=r?t:rt(t),q.hasChanged(t,n)&&(this._rawValue=t,this._value=r?t:Wn(t),be.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:t,oldValue:n}):this.dep.trigger())}}function f(e){return _t(e)?e.value:e}const s1={get:(e,t,n)=>t==="__v_raw"?e:f(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const i=e[t];return _t(i)&&!_t(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function a1(e){return Br(e)?e:new Proxy(e,s1)}class l1{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new ms,{get:r,set:i}=t(n.track.bind(n),n.trigger.bind(n));this._get=r,this._set=i}get value(){return this._value=this._get()}set value(t){this._set(t)}}function c1(e){return new l1(e)}class u1{constructor(t,n,r){this._object=t,this._key=n,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0,this._raw=rt(t);let i=!0,o=t;if(!q.isArray(t)||!q.isIntegerKey(String(n)))do i=!po(o)||on(o);while(i&&(o=o.__v_raw));this._shallow=i}get value(){let t=this._object[this._key];return this._shallow&&(t=f(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&_t(this._raw[this._key])){const n=this._object[this._key];if(_t(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return US(this._raw,this._key)}}class f1{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function d1(e,t,n){return _t(e)?e:q.isFunction(e)?new f1(e):q.isObject(e)&&arguments.length>1?p1(e,t,n):ae(e)}function p1(e,t,n){return new u1(e,t,n)}class h1{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new ms(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=co-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&lt!==this)return ip(this,!0),!0;be.env.NODE_ENV}get value(){const t=be.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return ap(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter?this.setter(t):be.env.NODE_ENV!=="production"&&tr("Write operation failed: computed value is readonly")}}function m1(e,t,n=!1){let r,i;q.isFunction(e)?r=e:(r=e.get,i=e.set);const o=new h1(r,i,n);return be.env.NODE_ENV,o}const Ss={},Es=new WeakMap;let ei;function g1(e,t=!1,n=ei){if(n){let r=Es.get(n);r||Es.set(n,r=[]),r.push(e)}else be.env.NODE_ENV!=="production"&&!t&&tr("onWatcherCleanup() was called when there was no active watcher to associate with.")}function y1(e,t,n=q.EMPTY_OBJ){const{immediate:r,deep:i,once:o,scheduler:s,augmentJob:a,call:l}=n,u=h=>{(n.onWarn||tr)("Invalid watch source: ",h,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},c=h=>i?h:on(h)||i===!1||i===0?br(h,1):br(h);let d,p,m,b,w=!1,S=!1;if(_t(e)?(p=()=>e.value,w=on(e)):Br(e)?(p=()=>c(e),w=!0):q.isArray(e)?(S=!0,w=e.some(h=>Br(h)||on(h)),p=()=>e.map(h=>{if(_t(h))return h.value;if(Br(h))return c(h);if(q.isFunction(h))return l?l(h,2):h();be.env.NODE_ENV!=="production"&&u(h)})):q.isFunction(e)?t?p=l?()=>l(e,2):e:p=()=>{if(m){Ai();try{m()}finally{xi()}}const h=ei;ei=d;try{return l?l(e,3,[b]):e(b)}finally{ei=h}}:(p=q.NOOP,be.env.NODE_ENV!=="production"&&u(e)),t&&i){const h=p,E=i===!0?1/0:i;p=()=>br(h(),E)}const y=()=>{d.stop()};if(o&&t){const h=t;t=(...E)=>{h(...E),y()}}let g=S?new Array(e.length).fill(Ss):Ss;const v=h=>{if(!(!(d.flags&1)||!d.dirty&&!h))if(t){const E=d.run();if(i||w||(S?E.some((T,R)=>q.hasChanged(T,g[R])):q.hasChanged(E,g))){m&&m();const T=ei;ei=d;try{const R=[E,g===Ss?void 0:S&&g[0]===Ss?[]:g,b];g=E,l?l(t,3,R):t(...R)}finally{ei=T}}}else d.run()};return a&&a(v),d=new MS(p),d.scheduler=s?()=>s(v,!1):v,b=h=>g1(h,!1,d),m=d.onStop=()=>{const h=Es.get(d);if(h){if(l)l(h,4);else for(const E of h)E();Es.delete(d)}},be.env.NODE_ENV!=="production"&&(d.onTrack=n.onTrack,d.onTrigger=n.onTrigger),t?r?v(!0):g=d.run():s?s(v.bind(null,!0),!0):d.run(),y.pause=d.pause.bind(d),y.resume=d.resume.bind(d),y.stop=y,y}function br(e,t=1/0,n){if(t<=0||!q.isObject(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,_t(e))br(e.value,t,n);else if(q.isArray(e))for(let r=0;r<e.length;r++)br(e[r],t,n);else if(q.isSet(e)||q.isMap(e))e.forEach(r=>{br(r,t,n)});else if(q.isPlainObject(e)){for(const r in e)br(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&br(e[r],t,n)}return e}const ti=[];function v1(e){ti.push(e)}function b1(){ti.pop()}let wl=!1;function et(e,...t){if(wl)return;wl=!0,Ai();const n=ti.length?ti[ti.length-1].component:null,r=n&&n.appContext.config.warnHandler,i=w1();if(r)Ts(r,n,11,[e+t.map(o=>{var s,a;return(a=(s=o.toString)==null?void 0:s.call(o))!=null?a:JSON.stringify(o)}).join(""),n&&n.proxy,i.map(({vnode:o})=>`at <${ah(n,o.type)}>`).join(`
2
- `),i]);else{const o=[`[Vue warn]: ${e}`,...t];i.length&&o.push(`
3
- `,...S1(i)),console.warn(...o)}xi(),wl=!1}function w1(){let e=ti[ti.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const r=e.component&&e.component.parent;e=r&&r.vnode}return t}function S1(e){const t=[];return e.forEach((n,r)=>{t.push(...r===0?[]:[`
4
- `],...E1(n))}),t}function E1({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",r=e.component?e.component.parent==null:!1,i=` at <${ah(e.component,e.type,r)}`,o=">"+n;return e.props?[i,...T1(e.props),o]:[i+o]}function T1(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(r=>{t.push(...Sp(r,e[r]))}),n.length>3&&t.push(" ..."),t}function Sp(e,t,n){return q.isString(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:_t(t)?(t=Sp(e,rt(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):q.isFunction(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=rt(t),n?t:[`${e}=`,t])}const Sl={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Ts(e,t,n,r){try{return r?e(...r):e()}catch(i){As(i,t,n)}}function El(e,t,n,r){if(q.isFunction(e)){const i=Ts(e,t,n,r);return i&&q.isPromise(i)&&i.catch(o=>{As(o,t,n)}),i}if(q.isArray(e)){const i=[];for(let o=0;o<e.length;o++)i.push(El(e[o],t,n,r));return i}else be.env.NODE_ENV!=="production"&&et(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function As(e,t,n,r=!0){const i=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||q.EMPTY_OBJ;if(t){let a=t.parent;const l=t.proxy,u=be.env.NODE_ENV!=="production"?Sl[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const c=a.ec;if(c){for(let d=0;d<c.length;d++)if(c[d](e,l,u)===!1)return}a=a.parent}if(o){Ai(),Ts(o,null,10,[e,l,u]),xi();return}}A1(e,n,i,r,s)}function A1(e,t,n,r=!0,i=!1){if(be.env.NODE_ENV!=="production"){const o=Sl[t];if(n&&v1(n),et(`Unhandled error${o?` during execution of ${o}`:""}`),n&&b1(),r)throw e;console.error(e)}else{if(i)throw e;console.error(e)}}const In=[];let wr=-1;const ki=[];let jr=null,Pi=0;const Ep=Promise.resolve();let xs=null;const x1=100;function Vt(e){const t=xs||Ep;return e?t.then(this?e.bind(this):e):t}function C1(e){let t=wr+1,n=In.length;for(;t<n;){const r=t+n>>>1,i=In[r],o=ho(i);o<e||o===e&&i.flags&2?t=r+1:n=r}return t}function Tl(e){if(!(e.flags&1)){const t=ho(e),n=In[In.length-1];!n||!(e.flags&2)&&t>=ho(n)?In.push(e):In.splice(C1(t),0,e),e.flags|=1,Tp()}}function Tp(){xs||(xs=Ep.then(xp))}function Ap(e){q.isArray(e)?ki.push(...e):jr&&e.id===-1?jr.splice(Pi+1,0,e):e.flags&1||(ki.push(e),e.flags|=1),Tp()}function R1(e){if(ki.length){const t=[...new Set(ki)].sort((n,r)=>ho(n)-ho(r));if(ki.length=0,jr){jr.push(...t);return}for(jr=t,be.env.NODE_ENV!=="production"&&(e=e||new Map),Pi=0;Pi<jr.length;Pi++){const n=jr[Pi];be.env.NODE_ENV!=="production"&&Cp(e,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}jr=null,Pi=0}}const ho=e=>e.id==null?e.flags&2?-1:1/0:e.id;function xp(e){be.env.NODE_ENV!=="production"&&(e=e||new Map);const t=be.env.NODE_ENV!=="production"?n=>Cp(e,n):q.NOOP;try{for(wr=0;wr<In.length;wr++){const n=In[wr];if(n&&!(n.flags&8)){if(be.env.NODE_ENV!=="production"&&t(n))continue;n.flags&4&&(n.flags&=-2),Ts(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;wr<In.length;wr++){const n=In[wr];n&&(n.flags&=-2)}wr=-1,In.length=0,R1(e),xs=null,(In.length||ki.length)&&xp(e)}}function Cp(e,t){const n=e.get(t)||0;if(n>x1){const r=t.i,i=r&&Bs(r.type);return As(`Maximum recursive updates exceeded${i?` in component <${i}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return e.set(t,n+1),!1}let mo=!1;const Al=new Map;be.env.NODE_ENV!=="production"&&(q.getGlobalThis().__VUE_HMR_RUNTIME__={createRecord:xl(k1),rerender:xl(P1),reload:xl(I1)});const Cs=new Map;function k1(e,t){return Cs.has(e)?!1:(Cs.set(e,{initialDef:Rs(t),instances:new Set}),!0)}function Rs(e){return lh(e)?e.__vccOpts:e}function P1(e,t){const n=Cs.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(r=>{t&&(r.render=t,Rs(r.type).render=t),r.renderCache=[],mo=!0,r.job.flags&8||r.update(),mo=!1}))}function I1(e,t){const n=Cs.get(e);if(!n)return;t=Rs(t),Rp(n.initialDef,t);const r=[...n.instances];for(let i=0;i<r.length;i++){const o=r[i],s=Rs(o.type);let a=Al.get(s);a||(s!==n.initialDef&&Rp(s,t),Al.set(s,a=new Set)),a.add(o),o.appContext.propsCache.delete(o.type),o.appContext.emitsCache.delete(o.type),o.appContext.optionsCache.delete(o.type),o.ceReload?(a.add(o),o.ceReload(t.styles),a.delete(o)):o.parent?Tl(()=>{o.job.flags&8||(mo=!0,o.parent.update(),mo=!1,a.delete(o))}):o.appContext.reload?o.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),o.root.ce&&o!==o.root&&o.root.ce._removeChildStyle(s)}Ap(()=>{Al.clear()})}function Rp(e,t){q.extend(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function xl(e){return(t,n)=>{try{return e(t,n)}catch(r){console.error(r),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let Ur,go=[],Cl=!1;function O1(e,...t){Ur?Ur.emit(e,...t):Cl||go.push({event:e,args:t})}function kp(e,t){var n,r;Ur=e,Ur?(Ur.enabled=!0,go.forEach(({event:i,args:o})=>Ur.emit(i,...o)),go=[]):typeof window<"u"&&window.HTMLElement&&!((r=(n=window.navigator)==null?void 0:n.userAgent)!=null&&r.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(o=>{kp(o,t)}),setTimeout(()=>{Ur||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Cl=!0,go=[])},3e3)):(Cl=!0,go=[])}const F1=_1("component:updated");function _1(e){return t=>{O1(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}let Jt=null,Pp=null;function Ip(e){const t=Jt;return Jt=e,Pp=e&&e.type.__scopeId||null,t}function ve(e,t=Jt,n){if(!t||e._n)return e;const r=(...i)=>{r._d&&Ns(-1);const o=Ip(t);let s;try{s=e(...i)}finally{Ip(o),r._d&&Ns(1)}return be.env.NODE_ENV!=="production"&&F1(t),s};return r._n=!0,r._c=!0,r._d=!0,r}function it(e,t){if(Jt===null)return be.env.NODE_ENV!=="production"&&et("withDirectives can only be used inside render functions."),e;const n=sh(Jt),r=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[o,s,a,l=q.EMPTY_OBJ]=t[i];o&&(q.isFunction(o)&&(o={mounted:o,updated:o}),o.deep&&br(s),r.push({dir:o,instance:n,value:s,oldValue:void 0,arg:a,modifiers:l}))}return e}function ni(e,t){if(be.env.NODE_ENV!=="production"&&(!un||un.isMounted)&&et("provide() can only be used inside setup()."),un){let n=un.provides;const r=un.parent&&un.parent.provides;r===n&&(n=un.provides=Object.create(r)),n[e]=t}}function Sr(e,t,n=!1){const r=Ms();if(r||eE){let i=r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&q.isFunction(t)?t.call(r&&r.proxy):t;be.env.NODE_ENV!=="production"&&et(`injection "${String(e)}" not found.`)}else be.env.NODE_ENV!=="production"&&et("inject() can only be used inside setup() or functional components.")}const D1=Symbol.for("v-scx"),N1=()=>{{const e=Sr(D1);return e||be.env.NODE_ENV!=="production"&&et("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function ot(e,t,n){return be.env.NODE_ENV!=="production"&&!q.isFunction(t)&&et("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),Op(e,t,n)}function Op(e,t,n=q.EMPTY_OBJ){const{immediate:r,deep:i,flush:o,once:s}=n;be.env.NODE_ENV!=="production"&&!t&&(r!==void 0&&et('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&et('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),s!==void 0&&et('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const a=q.extend({},n);be.env.NODE_ENV!=="production"&&(a.onWarn=et);const l=t&&r||!t&&o!=="post";let u;if(Fi){if(o==="sync"){const m=N1();u=m.__watcherHandles||(m.__watcherHandles=[])}else if(!l){const m=()=>{};return m.stop=q.NOOP,m.resume=q.NOOP,m.pause=q.NOOP,m}}const c=un;a.call=(m,b,w)=>El(m,c,b,w);let d=!1;o==="post"?a.scheduler=m=>{Dl(m,c&&c.suspense)}:o!=="sync"&&(d=!0,a.scheduler=(m,b)=>{b?m():Tl(m)}),a.augmentJob=m=>{t&&(m.flags|=4),d&&(m.flags|=2,c&&(m.id=c.uid,m.i=c))};const p=y1(e,t,a);return Fi&&(u?u.push(p):l&&p()),p}function L1(e,t,n){const r=this.proxy,i=q.isString(e)?e.includes(".")?$1(r,e):()=>r[e]:e.bind(r,r);let o;q.isFunction(t)?o=t:(o=t.handler,n=t);const s=ih(this),a=Op(i,o.bind(r),n);return s(),a}function $1(e,t){const n=t.split(".");return()=>{let r=e;for(let i=0;i<n.length&&r;i++)r=r[n[i]];return r}}const M1=Symbol("_vte"),B1=e=>e.__isTeleport,ri=e=>e&&(e.disabled||e.disabled===""),Fp=e=>e&&(e.defer||e.defer===""),_p=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Dp=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Rl=(e,t)=>{const n=e&&e.to;if(q.isString(n))if(t){const r=t(n);return be.env.NODE_ENV!=="production"&&!r&&!ri(e)&&et(`Failed to locate Teleport target with selector "${n}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`),r}else return be.env.NODE_ENV!=="production"&&et("Current renderer does not support string target for Teleports. (missing querySelector renderer option)"),null;else return be.env.NODE_ENV!=="production"&&!n&&!ri(e)&&et(`Invalid Teleport target: ${n}`),n},Np={name:"Teleport",__isTeleport:!0,process(e,t,n,r,i,o,s,a,l,u){const{mc:c,pc:d,pbc:p,o:{insert:m,querySelector:b,createText:w,createComment:S}}=u,y=ri(t.props);let{shapeFlag:g,children:v,dynamicChildren:h}=t;if(be.env.NODE_ENV!=="production"&&mo&&(l=!1,h=null),e==null){const E=t.el=be.env.NODE_ENV!=="production"?S("teleport start"):w(""),T=t.anchor=be.env.NODE_ENV!=="production"?S("teleport end"):w("");m(E,n,r),m(T,n,r);const R=(A,D)=>{g&16&&c(v,A,D,i,o,s,a,l)},C=()=>{const A=t.target=Rl(t.props,b),D=$p(A,t,w,m);A?(s!=="svg"&&_p(A)?s="svg":s!=="mathml"&&Dp(A)&&(s="mathml"),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(A),y||(R(A,D),Ps(t,!1))):be.env.NODE_ENV!=="production"&&!y&&et("Invalid Teleport target on mount:",A,`(${typeof A})`)};y&&(R(n,T),Ps(t,!0)),Fp(t.props)?(t.el.__isMounted=!1,Dl(()=>{C(),delete t.el.__isMounted},o)):C()}else{if(Fp(t.props)&&e.el.__isMounted===!1){Dl(()=>{Np.process(e,t,n,r,i,o,s,a,l,u)},o);return}t.el=e.el,t.targetStart=e.targetStart;const E=t.anchor=e.anchor,T=t.target=e.target,R=t.targetAnchor=e.targetAnchor,C=ri(e.props),A=C?n:T,D=C?E:R;if(s==="svg"||_p(T)?s="svg":(s==="mathml"||Dp(T))&&(s="mathml"),h?(p(e.dynamicChildren,h,A,i,o,s,a),Yp(e,t,be.env.NODE_ENV==="production")):l||d(e,t,A,D,i,o,s,a,!1),y)C?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):ks(t,n,E,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const V=t.target=Rl(t.props,b);V?ks(t,V,null,u,0):be.env.NODE_ENV!=="production"&&et("Invalid Teleport target on update:",T,`(${typeof T})`)}else C&&ks(t,T,R,u,1);Ps(t,y)}},remove(e,t,n,{um:r,o:{remove:i}},o){const{shapeFlag:s,children:a,anchor:l,targetStart:u,targetAnchor:c,target:d,props:p}=e;if(d&&(i(u),i(c)),o&&i(l),s&16){const m=o||!ri(p);for(let b=0;b<a.length;b++){const w=a[b];r(w,t,n,m,!!w.dynamicChildren)}}},move:ks,hydrate:j1};function ks(e,t,n,{o:{insert:r},m:i},o=2){o===0&&r(e.targetAnchor,t,n);const{el:s,anchor:a,shapeFlag:l,children:u,props:c}=e,d=o===2;if(d&&r(s,t,n),(!d||ri(c))&&l&16)for(let p=0;p<u.length;p++)i(u[p],t,n,2);d&&r(a,t,n)}function j1(e,t,n,r,i,o,{o:{nextSibling:s,parentNode:a,querySelector:l,insert:u,createText:c}},d){function p(w,S,y,g){S.anchor=d(s(w),S,a(w),n,r,i,o),S.targetStart=y,S.targetAnchor=g}const m=t.target=Rl(t.props,l),b=ri(t.props);if(m){const w=m._lpa||m.firstChild;if(t.shapeFlag&16)if(b)p(e,t,w,w&&s(w));else{t.anchor=s(e);let S=w;for(;S;){if(S&&S.nodeType===8){if(S.data==="teleport start anchor")t.targetStart=S;else if(S.data==="teleport anchor"){t.targetAnchor=S,m._lpa=t.targetAnchor&&s(t.targetAnchor);break}}S=s(S)}t.targetAnchor||$p(m,t,c,u),d(w&&s(w),t,m,n,r,i,o)}Ps(t,b)}else b&&t.shapeFlag&16&&p(e,t,e,s(e));return t.anchor&&s(t.anchor)}const Lp=Np;function Ps(e,t){const n=e.ctx;if(n&&n.ut){let r,i;for(t?(r=e.el,i=e.anchor):(r=e.targetStart,i=e.targetAnchor);r&&r!==i;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function $p(e,t,n,r){const i=t.targetStart=n(""),o=t.targetAnchor=n("");return i[M1]=o,e&&(r(i,e),r(o,e)),o}function Mp(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Mp(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Fe(e,t){return q.isFunction(e)?q.extend({name:e.name},t,{setup:e}):e}function U1(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const V1=new WeakSet;function An(e){const t=Ms(),n=i1(null);if(t){const i=t.refs===q.EMPTY_OBJ?t.refs={}:t.refs;let o;be.env.NODE_ENV!=="production"&&(o=Object.getOwnPropertyDescriptor(i,e))&&!o.configurable?et(`useTemplateRef('${e}') already exists.`):Object.defineProperty(i,e,{enumerable:!0,get:()=>n.value,set:s=>n.value=s})}else be.env.NODE_ENV!=="production"&&et("useTemplateRef() is called when there is no active component instance to be associated with.");const r=be.env.NODE_ENV!=="production"?nr(n):n;return be.env.NODE_ENV!=="production"&&V1.add(r),r}const Bp=e=>e.nodeType===8;q.getGlobalThis().requestIdleCallback,q.getGlobalThis().cancelIdleCallback;function q1(e,t){if(Bp(e)&&e.data==="["){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(Bp(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else t(e)}const z1=e=>!!e.type.__asyncLoader;function W1(e){q.isFunction(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:o,timeout:s,suspensible:a=!0,onError:l}=e;let u=null,c,d=0;const p=()=>(d++,u=null,m()),m=()=>{let b;return u||(b=u=t().catch(w=>{if(w=w instanceof Error?w:new Error(String(w)),l)return new Promise((S,y)=>{l(w,()=>S(p()),()=>y(w),d+1)});throw w}).then(w=>{if(b!==u&&u)return u;if(be.env.NODE_ENV!=="production"&&!w&&et("Async component loader resolved to undefined. If you are using retry(), make sure to return its return value."),w&&(w.__esModule||w[Symbol.toStringTag]==="Module")&&(w=w.default),be.env.NODE_ENV!=="production"&&w&&!q.isObject(w)&&!q.isFunction(w))throw new Error(`Invalid async component load result: ${w}`);return c=w,w}))};return Fe({name:"AsyncComponentWrapper",__asyncLoader:m,__asyncHydrate(b,w,S){let y=!1;(w.bu||(w.bu=[])).push(()=>y=!0);const g=()=>{if(y){be.env.NODE_ENV!=="production"&&et(`Skipping lazy hydration for component '${Bs(c)||c.__file}': it was updated before lazy hydration performed.`);return}S()},v=o?()=>{const h=o(g,E=>q1(b,E));h&&(w.bum||(w.bum=[])).push(h)}:g;c?v():m().then(()=>!w.isUnmounted&&v())},get __asyncResolved(){return c},setup(){const b=un;if(U1(b),c)return()=>Is(c,b);const w=v=>{u=null,As(v,b,13,!r)};if(a&&b.suspense||Fi)return m().then(v=>()=>Is(v,b)).catch(v=>(w(v),()=>r?me(r,{error:v}):null));const S=ae(!1),y=ae(),g=ae(!!i);return i&&setTimeout(()=>{g.value=!1},i),s!=null&&setTimeout(()=>{if(!S.value&&!y.value){const v=new Error(`Async component timed out after ${s}ms.`);w(v),y.value=v}},s),m().then(()=>{S.value=!0,b.parent&&H1(b.parent.vnode)&&b.parent.update()}).catch(v=>{w(v),y.value=v}),()=>{if(S.value&&c)return Is(c,b);if(y.value&&r)return me(r,{error:y.value});if(n&&!g.value)return Is(n,b)}}})}function Is(e,t){const{ref:n,props:r,children:i,ce:o}=t.vnode,s=me(e,r,i);return s.ref=n,s.ce=o,delete t.vnode.ce,s}const H1=e=>e.type.__isKeepAlive;function K1(e,t,n=un,r=!1){if(n){const i=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...s)=>{Ai();const a=ih(n),l=El(t,n,e,s);return a(),xi(),l});return r?i.unshift(o):i.push(o),o}else if(be.env.NODE_ENV!=="production"){const i=q.toHandlerKey(Sl[e].replace(/ hook$/,""));et(`${i} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}}const kl=e=>(t,n=un)=>{(!Fi||e==="sp")&&K1(e,(...r)=>t(...r),n)},$t=kl("m"),xn=kl("bum"),Pl=kl("um"),Os="components",G1="directives";function Ee(e,t){return Il(Os,e,!0,t)||e}const jp=Symbol.for("v-ndc");function On(e){return q.isString(e)?Il(Os,e,!1)||e:e||jp}function sn(e){return Il(G1,e)}function Il(e,t,n=!0,r=!1){const i=Jt||un;if(i){const o=i.type;if(e===Os){const a=Bs(o,!1);if(a&&(a===t||a===q.camelize(t)||a===q.capitalize(q.camelize(t))))return o}const s=Up(i[e]||o[e],t)||Up(i.appContext[e],t);if(!s&&r)return o;if(be.env.NODE_ENV!=="production"&&n&&!s){const a=e===Os?`
5
- If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`:"";et(`Failed to resolve ${e.slice(0,-1)}: ${t}${a}`)}return s}else be.env.NODE_ENV!=="production"&&et(`resolve${q.capitalize(e.slice(0,-1))} can only be used in render() or setup().`)}function Up(e,t){return e&&(e[t]||e[q.camelize(t)]||e[q.capitalize(q.camelize(t))])}function dt(e,t,n,r){let i;const o=n,s=q.isArray(e);if(s||q.isString(e)){const a=s&&Br(e);let l=!1,u=!1;a&&(l=!on(e),u=zn(e),e=ys(e)),i=new Array(e.length);for(let c=0,d=e.length;c<d;c++)i[c]=t(l?u?Ri(Wn(e[c])):Wn(e[c]):e[c],c,void 0,o)}else if(typeof e=="number"){be.env.NODE_ENV!=="production"&&!Number.isInteger(e)&&et(`The v-for range expect an integer value but got ${e}.`),i=new Array(e);for(let a=0;a<e;a++)i[a]=t(a+1,a,void 0,o)}else if(q.isObject(e))if(e[Symbol.iterator])i=Array.from(e,(a,l)=>t(a,l,void 0,o));else{const a=Object.keys(e);i=new Array(a.length);for(let l=0,u=a.length;l<u;l++){const c=a[l];i[l]=t(e[c],c,l,o)}}else i=[];return i}function Vp(e,t){for(let n=0;n<t.length;n++){const r=t[n];if(q.isArray(r))for(let i=0;i<r.length;i++)e[r[i].name]=r[i].fn;else r&&(e[r.name]=r.key?(...i)=>{const o=r.fn(...i);return o&&(o.key=r.key),o}:r.fn)}return e}function Ve(e,t,n={},r,i){if(Jt.ce||Jt.parent&&z1(Jt.parent)&&Jt.parent.ce){const u=Object.keys(n).length>0;return t!=="default"&&(n.name=t),Y(),Te(je,null,[me("slot",n,r&&r())],u?-2:64)}let o=e[t];be.env.NODE_ENV!=="production"&&o&&o.length>1&&(et("SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template."),o=()=>[]),o&&o._c&&(o._d=!1),Y();const s=o&&qp(o(n)),a=n.key||s&&s.key,l=Te(je,{key:(a&&!q.isSymbol(a)?a:`_${t}`)+(!s&&r?"_fb":"")},s||(r?r():[]),s&&e._===1?64:-2);return!i&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),o&&o._c&&(o._d=!0),l}function qp(e){return e.some(t=>Ls(t)?!(t.type===Ii||t.type===je&&!qp(t.children)):!0)?e:null}function Fs(e,t){const n={};if(be.env.NODE_ENV!=="production"&&!q.isObject(e))return et("v-on with no argument expects an object value."),n;for(const r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:q.toHandlerKey(r)]=e[r];return n}const Ol=e=>e?aE(e)?sh(e):Ol(e.parent):null,Fl=q.extend(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>be.env.NODE_ENV!=="production"?ws(e.props):e.props,$attrs:e=>be.env.NODE_ENV!=="production"?ws(e.attrs):e.attrs,$slots:e=>be.env.NODE_ENV!=="production"?ws(e.slots):e.slots,$refs:e=>be.env.NODE_ENV!=="production"?ws(e.refs):e.refs,$parent:e=>Ol(e.parent),$root:e=>Ol(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>X1(e),$forceUpdate:e=>e.f||(e.f=()=>{Tl(e.update)}),$nextTick:e=>e.n||(e.n=Vt.bind(e.proxy)),$watch:e=>L1.bind(e)}),Q1={};be.env.NODE_ENV!=="production"&&(Q1.ownKeys=e=>(et("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));function zp(){return Wp("useSlots").slots}function _l(){return Wp("useAttrs").attrs}function Wp(e){const t=Ms();return be.env.NODE_ENV!=="production"&&!t&&et(`${e}() called without active instance.`),t.setupContext||(t.setupContext=cE(t))}function Hp(e){return q.isArray(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function X1(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:o,config:{optionMergeStrategies:s}}=e.appContext,a=o.get(t);let l;return a?l=a:!i.length&&!n&&!r?l=t:(l={},i.length&&i.forEach(u=>_s(l,u,s,!0)),_s(l,t,s)),q.isObject(t)&&o.set(t,l),l}function _s(e,t,n,r=!1){const{mixins:i,extends:o}=t;o&&_s(e,o,n,!0),i&&i.forEach(s=>_s(e,s,n,!0));for(const s in t)if(r&&s==="expose")be.env.NODE_ENV!=="production"&&et('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const a=Y1[s]||n&&n[s];e[s]=a?a(e[s],t[s]):t[s]}return e}const Y1={data:Kp,props:Qp,emits:Qp,methods:yo,computed:yo,beforeCreate:cn,created:cn,beforeMount:cn,mounted:cn,beforeUpdate:cn,updated:cn,beforeDestroy:cn,beforeUnmount:cn,destroyed:cn,unmounted:cn,activated:cn,deactivated:cn,errorCaptured:cn,serverPrefetch:cn,components:yo,directives:yo,watch:Z1,provide:Kp,inject:J1};function Kp(e,t){return t?e?function(){return q.extend(q.isFunction(e)?e.call(this,this):e,q.isFunction(t)?t.call(this,this):t)}:t:e}function J1(e,t){return yo(Gp(e),Gp(t))}function Gp(e){if(q.isArray(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function cn(e,t){return e?[...new Set([].concat(e,t))]:t}function yo(e,t){return e?q.extend(Object.create(null),e,t):t}function Qp(e,t){return e?q.isArray(e)&&q.isArray(t)?[...new Set([...e,...t])]:q.extend(Object.create(null),Hp(e),Hp(t??{})):t}function Z1(e,t){if(!e)return t;if(!t)return e;const n=q.extend(Object.create(null),e);for(const r in t)n[r]=cn(e[r],t[r]);return n}let eE=null;const tE={},Xp=e=>Object.getPrototypeOf(e)===tE,Dl=rE;function Yp(e,t,n=!1){const r=e.children,i=t.children;if(q.isArray(r)&&q.isArray(i))for(let o=0;o<r.length;o++){const s=r[o];let a=i[o];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[o]=sE(i[o]),a.el=s.el),!n&&a.patchFlag!==-2&&Yp(s,a)),a.type===Jp&&(a.patchFlag!==-1?a.el=s.el:a.__elIndex=o+(e.type===je?1:0)),a.type===Ii&&!a.el&&(a.el=s.el),be.env.NODE_ENV!=="production"&&a.el&&(a.el.__vnode=a)}}const nE=e=>e.__isSuspense;function rE(e,t){t&&t.pendingBranch?q.isArray(e)?t.effects.push(...e):t.effects.push(e):Ap(e)}const je=Symbol.for("v-fgt"),Jp=Symbol.for("v-txt"),Ii=Symbol.for("v-cmt"),Ds=[];let Cn=null;function Y(e=!1){Ds.push(Cn=e?null:[])}function iE(){Ds.pop(),Cn=Ds[Ds.length-1]||null}let vo=1;function Ns(e,t=!1){vo+=e,e<0&&Cn&&t&&(Cn.hasOnce=!0)}function Zp(e){return e.dynamicChildren=vo>0?Cn||q.EMPTY_ARR:null,iE(),vo>0&&Cn&&Cn.push(e),e}function pe(e,t,n,r,i,o){return Zp(ue(e,t,n,r,i,o,!0))}function Te(e,t,n,r,i){return Zp(me(e,t,n,r,i,!0))}function Ls(e){return e?e.__v_isVNode===!0:!1}const oE=(...e)=>th(...e),eh=({key:e})=>e??null,$s=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?q.isString(e)||_t(e)||q.isFunction(e)?{i:Jt,r:e,k:t,f:!!n}:e:null);function ue(e,t=null,n=null,r=0,i=null,o=e===je?0:1,s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&eh(t),ref:t&&$s(t),scopeId:Pp,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Jt};return a?(Nl(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=q.isString(n)?8:16),be.env.NODE_ENV!=="production"&&l.key!==l.key&&et("VNode created with invalid key (NaN). VNode type:",l.type),vo>0&&!s&&Cn&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&Cn.push(l),l}const me=be.env.NODE_ENV!=="production"?oE:th;function th(e,t=null,n=null,r=0,i=null,o=!1){if((!e||e===jp)&&(be.env.NODE_ENV!=="production"&&!e&&et(`Invalid vnode type when creating vnode: ${e}.`),e=Ii),Ls(e)){const a=Oi(e,t,!0);return n&&Nl(a,n),vo>0&&!o&&Cn&&(a.shapeFlag&6?Cn[Cn.indexOf(e)]=a:Cn.push(a)),a.patchFlag=-2,a}if(lh(e)&&(e=e.__vccOpts),t){t=nh(t);let{class:a,style:l}=t;a&&!q.isString(a)&&(t.class=q.normalizeClass(a)),q.isObject(l)&&(po(l)&&!q.isArray(l)&&(l=q.extend({},l)),t.style=q.normalizeStyle(l))}const s=q.isString(e)?1:nE(e)?128:B1(e)?64:q.isObject(e)?4:q.isFunction(e)?2:0;return be.env.NODE_ENV!=="production"&&s&4&&po(e)&&(e=rt(e),et("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
6
- Component that was made reactive: `,e)),ue(e,t,n,r,i,s,o,!0)}function nh(e){return e?po(e)||Xp(e)?q.extend({},e):e:null}function Oi(e,t,n=!1,r=!1){const{props:i,ref:o,patchFlag:s,children:a,transition:l}=e,u=t?Mt(i||{},t):i,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&eh(u),ref:t&&t.ref?n&&o?q.isArray(o)?o.concat($s(t)):[o,$s(t)]:$s(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:be.env.NODE_ENV!=="production"&&s===-1&&q.isArray(a)?a.map(rh):a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==je?s===-1?16:s|16:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Oi(e.ssContent),ssFallback:e.ssFallback&&Oi(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&Mp(c,l.clone(c)),c}function rh(e){const t=Oi(e);return q.isArray(e.children)&&(t.children=e.children.map(rh)),t}function kt(e=" ",t=0){return me(Jp,null,e,t)}function ke(e="",t=!1){return t?(Y(),Te(Ii,null,e)):me(Ii,null,e)}function sE(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Oi(e)}function Nl(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(q.isArray(t))n=16;else if(typeof t=="object")if(r&65){const i=t.default;i&&(i._c&&(i._d=!1),Nl(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!Xp(t)?t._ctx=Jt:i===3&&Jt&&(Jt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else q.isFunction(t)?(t={default:t,_ctx:Jt},n=32):(t=String(t),r&64?(n=16,t=[kt(t)]):n=8);e.children=t,e.shapeFlag|=n}function Mt(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const i in r)if(i==="class")t.class!==r.class&&(t.class=q.normalizeClass([t.class,r.class]));else if(i==="style")t.style=q.normalizeStyle([t.style,r.style]);else if(q.isOn(i)){const o=t[i],s=r[i];s&&o!==s&&!(q.isArray(o)&&o.includes(s))&&(t[i]=o?[].concat(o,s):s)}else i!==""&&(t[i]=r[i])}return t}let un=null;const Ms=()=>un||Jt;let Ll;{const e=q.getGlobalThis(),t=(n,r)=>{let i;return(i=e[n])||(i=e[n]=[]),i.push(r),o=>{i.length>1?i.forEach(s=>s(o)):i[0](o)}};Ll=t("__VUE_INSTANCE_SETTERS__",n=>un=n),t("__VUE_SSR_SETTERS__",n=>Fi=n)}const ih=e=>{const t=un;return Ll(e),e.scope.on(),()=>{e.scope.off(),Ll(t)}};function aE(e){return e.vnode.shapeFlag&4}let Fi=!1;const oh=be.env.NODE_ENV!=="production"?{get(e,t){return Yt(e,"get",""),e[t]},set(){return et("setupContext.attrs is readonly."),!1},deleteProperty(){return et("setupContext.attrs is readonly."),!1}}:{get(e,t){return Yt(e,"get",""),e[t]}};function lE(e){return new Proxy(e.slots,{get(t,n){return Yt(e,"get","$slots"),t[n]}})}function cE(e){const t=n=>{if(be.env.NODE_ENV!=="production"&&(e.exposed&&et("expose() should be called only once per setup()."),n!=null)){let r=typeof n;r==="object"&&(q.isArray(n)?r="array":_t(n)&&(r="ref")),r!=="object"&&et(`expose() should be passed a plain object, received ${r}.`)}e.exposed=n||{}};if(be.env.NODE_ENV!=="production"){let n,r;return Object.freeze({get attrs(){return n||(n=new Proxy(e.attrs,oh))},get slots(){return r||(r=lE(e))},get emit(){return(i,...o)=>e.emit(i,...o)},expose:t})}else return{attrs:new Proxy(e.attrs,oh),slots:e.slots,emit:e.emit,expose:t}}function sh(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(a1(bp(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Fl)return Fl[n](e)},has(t,n){return n in t||n in Fl}})):e.proxy}const uE=/(?:^|[-_])\w/g,fE=e=>e.replace(uE,t=>t.toUpperCase()).replace(/[-_]/g,"");function Bs(e,t=!0){return q.isFunction(e)?e.displayName||e.name:e.name||t&&e.__name}function ah(e,t,n=!1){let r=Bs(t);if(!r&&t.__file){const i=t.__file.match(/([^/\\]+)\.\w+$/);i&&(r=i[1])}if(!r&&e){const i=o=>{for(const s in o)if(o[s]===t)return s};r=i(e.components)||e.parent&&i(e.parent.type.components)||i(e.appContext.components)}return r?fE(r):n?"App":"Anonymous"}function lh(e){return q.isFunction(e)&&"__vccOpts"in e}const M=(e,t)=>{const n=m1(e,t,Fi);if(be.env.NODE_ENV!=="production"){const r=Ms();r&&r.appContext.config.warnRecursiveComputed&&(n._warnRecursive=!0)}return n};function $l(e,t,n){try{Ns(-1);const r=arguments.length;return r===2?q.isObject(t)&&!q.isArray(t)?Ls(t)?me(e,null,[t]):me(e,t):me(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Ls(n)&&(n=[n]),me(e,t,n))}finally{Ns(1)}}function dE(){if(be.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},n={style:"color:#f5222d"},r={style:"color:#eb2f96"},i={__vue_custom_formatter:!0,header(d){if(!q.isObject(d))return null;if(d.__isVue)return["div",e,"VueInstance"];if(_t(d)){Ai();const p=d.value;return xi(),["div",{},["span",e,c(d)],"<",a(p),">"]}else{if(Br(d))return["div",{},["span",e,on(d)?"ShallowReactive":"Reactive"],"<",a(d),`>${zn(d)?" (readonly)":""}`];if(zn(d))return["div",{},["span",e,on(d)?"ShallowReadonly":"Readonly"],"<",a(d),">"]}return null},hasBody(d){return d&&d.__isVue},body(d){if(d&&d.__isVue)return["div",{},...o(d.$)]}};function o(d){const p=[];d.type.props&&d.props&&p.push(s("props",rt(d.props))),d.setupState!==q.EMPTY_OBJ&&p.push(s("setup",d.setupState)),d.data!==q.EMPTY_OBJ&&p.push(s("data",rt(d.data)));const m=l(d,"computed");m&&p.push(s("computed",m));const b=l(d,"inject");return b&&p.push(s("injected",b)),p.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:d}]]),p}function s(d,p){return p=q.extend({},p),Object.keys(p).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},d],["div",{style:"padding-left:1.25em"},...Object.keys(p).map(m=>["div",{},["span",r,m+": "],a(p[m],!1)])]]:["span",{}]}function a(d,p=!0){return typeof d=="number"?["span",t,d]:typeof d=="string"?["span",n,JSON.stringify(d)]:typeof d=="boolean"?["span",r,d]:q.isObject(d)?["object",{object:p?rt(d):d}]:["span",n,String(d)]}function l(d,p){const m=d.type;if(q.isFunction(m))return;const b={};for(const w in d.ctx)u(m,w,p)&&(b[w]=d.ctx[w]);return b}function u(d,p,m){const b=d[m];if(q.isArray(b)&&b.includes(p)||q.isObject(b)&&p in b||d.extends&&u(d.extends,p,m)||d.mixins&&d.mixins.some(w=>u(w,p,m)))return!0}function c(d){return on(d)?"ShallowRef":d.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(i):window.devtoolsFormatters=[i]}const ch=be.env.NODE_ENV!=="production"?et:q.NOOP;be.env.NODE_ENV,be.env.NODE_ENV;let pE;const uh=typeof window<"u"&&window.trustedTypes;if(uh)try{pE=uh.createPolicy("vue",{createHTML:e=>e})}catch(e){be.env.NODE_ENV!=="production"&&ch(`Error creating trusted types policy: ${e}`)}const fh=Symbol("_vod"),hE=Symbol("_vsh"),dh={name:"show",beforeMount(e,{value:t},{transition:n}){e[fh]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):bo(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),bo(e,!0),r.enter(e)):r.leave(e,()=>{bo(e,!1)}):bo(e,t))},beforeUnmount(e,{value:t}){bo(e,t)}};function bo(e,t){e.style.display=t?e[fh]:"none",e[hE]=!t}be.env.NODE_ENV;function Vr(e,t,n,r){e.addEventListener(t,n,r)}const qr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return q.isArray(t)?n=>q.invokeArrayFns(t,n):t};function mE(e){e.target.composing=!0}function ph(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Fn=Symbol("_assign");function hh(e,t,n){return t&&(e=e.trim()),n&&(e=q.looseToNumber(e)),e}const Ml={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[Fn]=qr(i);const o=r||i.props&&i.props.type==="number";Vr(e,t?"change":"input",s=>{s.target.composing||e[Fn](hh(e.value,n,o))}),(n||o)&&Vr(e,"change",()=>{e.value=hh(e.value,n,o)}),t||(Vr(e,"compositionstart",mE),Vr(e,"compositionend",ph),Vr(e,"change",ph))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:o}},s){if(e[Fn]=qr(s),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?q.looseToNumber(e.value):e.value,l=t??"";a!==l&&(document.activeElement===e&&e.type!=="range"&&(r&&t===n||i&&e.value.trim()===l)||(e.value=l))}},gE={deep:!0,created(e,t,n){e[Fn]=qr(n),Vr(e,"change",()=>{const r=e._modelValue,i=_i(e),o=e.checked,s=e[Fn];if(q.isArray(r)){const a=q.looseIndexOf(r,i),l=a!==-1;if(o&&!l)s(r.concat(i));else if(!o&&l){const u=[...r];u.splice(a,1),s(u)}}else if(q.isSet(r)){const a=new Set(r);o?a.add(i):a.delete(i),s(a)}else s(yh(e,o))})},mounted:mh,beforeUpdate(e,t,n){e[Fn]=qr(n),mh(e,t,n)}};function mh(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(q.isArray(t))i=q.looseIndexOf(t,r.props.value)>-1;else if(q.isSet(t))i=t.has(r.props.value);else{if(t===n)return;i=q.looseEqual(t,yh(e,!0))}e.checked!==i&&(e.checked=i)}const yE={created(e,{value:t},n){e.checked=q.looseEqual(t,n.props.value),e[Fn]=qr(n),Vr(e,"change",()=>{e[Fn](_i(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Fn]=qr(r),t!==n&&(e.checked=q.looseEqual(t,r.props.value))}},vE={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const i=q.isSet(t);Vr(e,"change",()=>{const o=Array.prototype.filter.call(e.options,s=>s.selected).map(s=>n?q.looseToNumber(_i(s)):_i(s));e[Fn](e.multiple?i?new Set(o):o:o[0]),e._assigning=!0,Vt(()=>{e._assigning=!1})}),e[Fn]=qr(r)},mounted(e,{value:t}){gh(e,t)},beforeUpdate(e,t,n){e[Fn]=qr(n)},updated(e,{value:t}){e._assigning||gh(e,t)}};function gh(e,t){const n=e.multiple,r=q.isArray(t);if(n&&!r&&!q.isSet(t)){be.env.NODE_ENV!=="production"&&ch(`<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(t).slice(8,-1)}.`);return}for(let i=0,o=e.options.length;i<o;i++){const s=e.options[i],a=_i(s);if(n)if(r){const l=typeof a;l==="string"||l==="number"?s.selected=t.some(u=>String(u)===String(a)):s.selected=q.looseIndexOf(t,a)>-1}else s.selected=t.has(a);else if(q.looseEqual(_i(s),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}function _i(e){return"_value"in e?e._value:e.value}function yh(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const bE={created(e,t,n){js(e,t,n,null,"created")},mounted(e,t,n){js(e,t,n,null,"mounted")},beforeUpdate(e,t,n,r){js(e,t,n,r,"beforeUpdate")},updated(e,t,n,r){js(e,t,n,r,"updated")}};function wE(e,t){switch(e){case"SELECT":return vE;case"TEXTAREA":return Ml;default:switch(t){case"checkbox":return gE;case"radio":return yE;default:return Ml}}}function js(e,t,n,r,i){const s=wE(e.tagName,n.props&&n.props.type)[i];s&&s(e,t,n,r)}const SE=["ctrl","shift","alt","meta"],EE={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>SE.some(n=>e[`${n}Key`]&&!t.includes(n))},qt=(e,t)=>{const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((i,...o)=>{for(let s=0;s<t.length;s++){const a=EE[t[s]];if(a&&a(i,t))return}return e(i,...o)}))},TE={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},wo=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(i=>{if(!("key"in i))return;const o=q.hyphenate(i.key);if(t.some(s=>s===o||TE[s]===o))return e(i)}))};function AE(){dE()}be.env.NODE_ENV!=="production"&&AE();const fn=()=>ES.useAbility();function vh(e){if(e===void 0)throw new Error('cloneStateObject: cannot clone "undefined"');return JSON.parse(JSON.stringify(e))}const So=(e,t)=>!e||!t?!1:e.id===t.id;var zr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xE(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bl,bh;function CE(){if(bh)return Bl;bh=1;function e(i){if(typeof i!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(i))}function t(i,o){for(var s="",a=0,l=-1,u=0,c,d=0;d<=i.length;++d){if(d<i.length)c=i.charCodeAt(d);else{if(c===47)break;c=47}if(c===47){if(!(l===d-1||u===1))if(l!==d-1&&u===2){if(s.length<2||a!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var p=s.lastIndexOf("/");if(p!==s.length-1){p===-1?(s="",a=0):(s=s.slice(0,p),a=s.length-1-s.lastIndexOf("/")),l=d,u=0;continue}}else if(s.length===2||s.length===1){s="",a=0,l=d,u=0;continue}}o&&(s.length>0?s+="/..":s="..",a=2)}else s.length>0?s+="/"+i.slice(l+1,d):s=i.slice(l+1,d),a=d-l-1;l=d,u=0}else c===46&&u!==-1?++u:u=-1}return s}function n(i,o){var s=o.dir||o.root,a=o.base||(o.name||"")+(o.ext||"");return s?s===o.root?s+a:s+i+a:a}var r={resolve:function(){for(var o="",s=!1,a,l=arguments.length-1;l>=-1&&!s;l--){var u;l>=0?u=arguments[l]:(a===void 0&&(a=be.cwd()),u=a),e(u),u.length!==0&&(o=u+"/"+o,s=u.charCodeAt(0)===47)}return o=t(o,!s),s?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(o){if(e(o),o.length===0)return".";var s=o.charCodeAt(0)===47,a=o.charCodeAt(o.length-1)===47;return o=t(o,!s),o.length===0&&!s&&(o="."),o.length>0&&a&&(o+="/"),s?"/"+o:o},isAbsolute:function(o){return e(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var o,s=0;s<arguments.length;++s){var a=arguments[s];e(a),a.length>0&&(o===void 0?o=a:o+="/"+a)}return o===void 0?".":r.normalize(o)},relative:function(o,s){if(e(o),e(s),o===s||(o=r.resolve(o),s=r.resolve(s),o===s))return"";for(var a=1;a<o.length&&o.charCodeAt(a)===47;++a);for(var l=o.length,u=l-a,c=1;c<s.length&&s.charCodeAt(c)===47;++c);for(var d=s.length,p=d-c,m=u<p?u:p,b=-1,w=0;w<=m;++w){if(w===m){if(p>m){if(s.charCodeAt(c+w)===47)return s.slice(c+w+1);if(w===0)return s.slice(c+w)}else u>m&&(o.charCodeAt(a+w)===47?b=w:w===0&&(b=0));break}var S=o.charCodeAt(a+w),y=s.charCodeAt(c+w);if(S!==y)break;S===47&&(b=w)}var g="";for(w=a+b+1;w<=l;++w)(w===l||o.charCodeAt(w)===47)&&(g.length===0?g+="..":g+="/..");return g.length>0?g+s.slice(c+b):(c+=b,s.charCodeAt(c)===47&&++c,s.slice(c))},_makeLong:function(o){return o},dirname:function(o){if(e(o),o.length===0)return".";for(var s=o.charCodeAt(0),a=s===47,l=-1,u=!0,c=o.length-1;c>=1;--c)if(s=o.charCodeAt(c),s===47){if(!u){l=c;break}}else u=!1;return l===-1?a?"/":".":a&&l===1?"//":o.slice(0,l)},basename:function(o,s){if(s!==void 0&&typeof s!="string")throw new TypeError('"ext" argument must be a string');e(o);var a=0,l=-1,u=!0,c;if(s!==void 0&&s.length>0&&s.length<=o.length){if(s.length===o.length&&s===o)return"";var d=s.length-1,p=-1;for(c=o.length-1;c>=0;--c){var m=o.charCodeAt(c);if(m===47){if(!u){a=c+1;break}}else p===-1&&(u=!1,p=c+1),d>=0&&(m===s.charCodeAt(d)?--d===-1&&(l=c):(d=-1,l=p))}return a===l?l=p:l===-1&&(l=o.length),o.slice(a,l)}else{for(c=o.length-1;c>=0;--c)if(o.charCodeAt(c)===47){if(!u){a=c+1;break}}else l===-1&&(u=!1,l=c+1);return l===-1?"":o.slice(a,l)}},extname:function(o){e(o);for(var s=-1,a=0,l=-1,u=!0,c=0,d=o.length-1;d>=0;--d){var p=o.charCodeAt(d);if(p===47){if(!u){a=d+1;break}continue}l===-1&&(u=!1,l=d+1),p===46?s===-1?s=d:c!==1&&(c=1):s!==-1&&(c=-1)}return s===-1||l===-1||c===0||c===1&&s===l-1&&s===a+1?"":o.slice(s,l)},format:function(o){if(o===null||typeof o!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof o);return n("/",o)},parse:function(o){e(o);var s={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return s;var a=o.charCodeAt(0),l=a===47,u;l?(s.root="/",u=1):u=0;for(var c=-1,d=0,p=-1,m=!0,b=o.length-1,w=0;b>=u;--b){if(a=o.charCodeAt(b),a===47){if(!m){d=b+1;break}continue}p===-1&&(m=!1,p=b+1),a===46?c===-1?c=b:w!==1&&(w=1):c!==-1&&(w=-1)}return c===-1||p===-1||w===0||w===1&&c===p-1&&c===d+1?p!==-1&&(d===0&&l?s.base=s.name=o.slice(1,p):s.base=s.name=o.slice(d,p)):(d===0&&l?(s.name=o.slice(1,c),s.base=o.slice(1,p)):(s.name=o.slice(d,c),s.base=o.slice(d,p)),s.ext=o.slice(c,p)),d>0?s.dir=o.slice(0,d-1):l&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return r.posix=r,Bl=r,Bl}var ct=CE();const jl=xE(ct),RE=Fe({name:"SpaceMoveInfoModal",props:{modal:{type:Object,required:!0}}}),Xe=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},kE=["textContent"],PE=["textContent"];function IE(e,t,n,r,i,o){return Y(),pe(je,null,[ue("p",{class:"mt-0",textContent:q.toDisplayString(e.$gettext("Moving files from one space to another is not possible. Do you want to copy instead?"))},null,8,kE),ue("p",{class:"mb-0",textContent:q.toDisplayString(e.$gettext("Note: Links and shares of the original file are not copied."))},null,8,PE)],64)}const wh=Xe(RE,[["render",IE]]),OE=Fe({name:"ResourceConflictModal",props:{modal:{type:Object,required:!0},resource:{type:Object,required:!0},conflictCount:{type:Number,required:!0},callbackFn:{type:Function,required:!0},suggestMerge:{type:Boolean,default:!0},separateSkipHandling:{type:Boolean,default:!1},confirmSecondaryTextOverwrite:{type:String,default:null}},setup(e){const{removeModal:t}=ft(),{$gettext:n}=Oe.useGettext(),r=ae(!1),i=M(()=>e.conflictCount<2?"":e.separateSkipHandling?e.resource.isFolder?n("Apply to all %{count} folders",{count:e.conflictCount.toString()},!0):n("Apply to all %{count} files",{count:e.conflictCount.toString()},!0):n("Apply to all %{count} conflicts",{count:e.conflictCount.toString()},!0)),o=M(()=>e.resource.isFolder?n("Folder with name »%{name}« already exists.",{name:e.resource.name},!0):n("File with name »%{name}« already exists.",{name:e.resource.name},!0)),s=M(()=>e.confirmSecondaryTextOverwrite||n("Replace"));return{message:o,checkboxValue:r,checkboxLabel:i,confirmSecondaryText:s,onConfirm:()=>{t(e.modal.id),e.callbackFn({strategy:Kn.KEEP_BOTH,doForAllConflicts:f(r)})},onConfirmSecondary:()=>{t(e.modal.id);const c=e.suggestMerge?Kn.MERGE:Kn.REPLACE;e.callbackFn({strategy:c,doForAllConflicts:f(r)})},onCancel:()=>{t(e.modal.id),e.callbackFn({strategy:Kn.SKIP,doForAllConflicts:f(r)})}}}}),FE=["textContent"],_E={class:"my-4"},DE={class:"flex justify-end items-center mt-4"},NE={class:"oc-modal-body-actions-grid"};function LE(e,t,n,r,i,o){const s=Ee("oc-checkbox"),a=Ee("oc-button");return Y(),pe(je,null,[ue("span",{class:"inline-block mb-4",textContent:q.toDisplayString(e.message)},null,8,FE),ue("div",_E,[e.conflictCount>1?(Y(),Te(s,{key:0,modelValue:e.checkboxValue,"onUpdate:modelValue":t[0]||(t[0]=l=>e.checkboxValue=l),size:"medium",label:e.checkboxLabel,"aria-label":e.checkboxLabel},null,8,["modelValue","label","aria-label"])):ke("",!0)]),ue("div",DE,[ue("div",NE,[me(a,{class:"oc-modal-body-actions-cancel ml-2",onClick:e.onCancel},{default:ve(()=>[kt(q.toDisplayString(e.$gettext("Skip")),1)]),_:1},8,["onClick"]),me(a,{class:"oc-modal-body-actions-secondary ml-2",onClick:e.onConfirmSecondary},{default:ve(()=>[kt(q.toDisplayString(e.confirmSecondaryText),1)]),_:1},8,["onClick"]),me(a,{class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:e.onConfirm},{default:ve(()=>[kt(q.toDisplayString(e.$gettext("Keep both")),1)]),_:1},8,["onClick"])])])],64)}const Sh=Xe(OE,[["render",LE]]);class Ul{constructor(t,n){this.$gettext=t,this.$ngettext=n}async resolveAllConflicts(t,n,r){const i=[];for(const u of t){const c=ct.join(n.path,u.name);r.some(p=>p.path===c)&&i.push({resource:u,strategy:null})}let o=0,s=!1,a=null;const l=[];for(const u of i){if(s){u.strategy=a,l.push(u);continue}const c=i.length-o,d=await this.resolveFileExists(u.resource,c);u.strategy=d.strategy,l.push(u),o+=1,d.doForAllConflicts&&(s=!0,a=d.strategy)}return l}resolveFileExists(t,n,r=!1,i=!1){const{dispatchModal:o}=ft();return new Promise(s=>{o({title:t.isFolder?this.$gettext("Folder already exists"):this.$gettext("File already exists"),hideActions:!0,customComponent:Sh,customComponentAttrs:()=>({resource:t,conflictCount:n,suggestMerge:r,separateSkipHandling:i,callbackFn:a=>{s(a)}})})})}resolveDoCopyInsteadOfMoveForSpaces(){const{dispatchModal:t}=ft();return new Promise(n=>{t({title:this.$gettext("Copy here?"),customComponent:wh,confirmText:this.$gettext("Copy here"),onCancel:()=>{n(!1)},onConfirm:()=>Promise.resolve(n(!0))})})}}const Hn=(e,t,n,r=1)=>{let i;return t?i=`${re.extractNameWithoutExtension({name:e,extension:t})} (${r}).${t}`:i=`${e} (${r})`,n.some(s=>s.name===i)?Hn(e,t,n,r+1):i},Eh=(e,t,n,r)=>e.id===n.id&&ct.dirname(t.path)===r.path;var Kn=(e=>(e[e.SKIP=0]="SKIP",e[e.REPLACE=1]="REPLACE",e[e.KEEP_BOTH=2]="KEEP_BOTH",e[e.MERGE=3]="MERGE",e))(Kn||{}),Er=(e=>(e[e.COPY=0]="COPY",e[e.MOVE=1]="MOVE",e))(Er||{});class Th extends Ul{constructor(t,n,r,i,o,s,a,l){super(a,l),this.sourceSpace=t,this.resourcesToMove=n,this.targetSpace=r,this.targetFolder=i,this.currentFolder=o,this.clientService=s}hasRecursion(){return this.sourceSpace.id!==this.targetSpace.id?!1:this.resourcesToMove.some(t=>this.targetFolder.path===t.path)}showRecursionErrorMessage(){const t=this.resourcesToMove.length,n=this.$ngettext("You can't paste the selected file at this location because you can't paste an item into itself.","You can't paste the selected files at this location because you can't paste an item into itself.",t);tt().showErrorMessage({title:n})}showResultMessage(t,n,r){if(t.length===0){const a=n.length;if(a===0)return;const l=r===Er.COPY?this.$ngettext("%{count} item was copied successfully","%{count} items were copied successfully",a,{count:a.toString()},!0):this.$ngettext("%{count} item was moved successfully","%{count} items were moved successfully",a,{count:a.toString()},!0);tt().showMessage({title:l,status:"success"});return}let i=r===Er.COPY?this.$gettext("Failed to copy %{count} resources",{count:t.length.toString()},!0):this.$gettext("Failed to move %{count} resources",{count:t.length.toString()},!0);t.length===1&&(i=r===Er.COPY?this.$gettext("Failed to copy »%{name}«",{name:t[0]?.resourceName},!0):this.$gettext("Failed to move »%{name}«",{name:t[0]?.resourceName},!0));let o="";t.some(({error:a})=>a instanceof re.HttpError&&a.statusCode===507)&&(o=this.$gettext("Insufficient quota")),tt().showErrorMessage({title:i,...o&&{desc:o},errors:t.map(({error:a})=>a)})}async getTransferData(t){if(this.hasRecursion())return this.showRecursionErrorMessage(),[];if(this.sourceSpace.id!==this.targetSpace.id&&t===Er.MOVE){if(!await this.resolveDoCopyInsteadOfMoveForSpaces())return[];t=Er.COPY}const n=(await this.clientService.webdav.listFiles(this.targetSpace,this.targetFolder)).children,r=await this.resolveAllConflicts(this.resourcesToMove,this.targetFolder,n),i=[];for(const o of this.resourcesToMove){const s={...o},{id:a,name:l,extension:u}=s,c=r.some(m=>m.resource.id===a);let d=l,p=!1;if(c){const m=r.find(b=>b.resource.id===a)?.strategy;if(m===Kn.SKIP)continue;if(m===Kn.REPLACE){if(this.isOverwritingParentFolder(s,this.targetFolder,n)){const b=new Error;this.showResultMessage([{error:b,resourceName:l}],[],t);continue}p=!0}m===Kn.KEEP_BOTH&&(d=Hn(l,u,n),s.name=d)}Eh(this.sourceSpace,s,this.targetSpace,this.targetFolder)&&p||i.push({resource:s,sourceSpace:this.sourceSpace,targetSpace:this.targetSpace,targetFolder:this.targetFolder,path:ct.join(this.targetFolder.path,d),overwrite:p,transferType:t})}return i}isOverwritingParentFolder(t,n,r){if(t.type!=="folder")return!1;const i=f(this.currentFolder)?.path;if(!i||n.path===i)return!1;const o=ct.basename(t.path),s=ct.join(n.path,o);return i.split("/").length<s.split("/").length?!1:r.some(a=>a.path===s)}}const Vl={ignoreLocation:!0,threshold:0,useExtendedSearch:!0},$E=(e,t,n)=>new Hd(e,{...Vl,keys:["name","type","icon","extension","tags"]}).search(t,{limit:n}).map(i=>i.item),Ah="oc-resource-icon-mapping",ME={archive:{icon:{name:"resource-type-archive",color:"var(--oc-color-icon-archive)"},extensions:["7z","apk","bz2","deb","gz","gzip","rar","tar","tar.bz2","tar.gz","tar.xz","tbz2","tgz","zip"]},audio:{icon:{name:"resource-type-audio",color:"var(--oc-color-icon-audio)"},extensions:["3gp","8svx","aa","aac","aax","act","aiff","alac","amr","ape","au","awb","cda","dss","dvf","flac","gsm","iklax","ivs","m4a","m4b","m4p","mmf","mogg","movpkg","mp3","mpc","msv","nmf","oga","ogga","opus","ra","raw","rf64","rm","sln","tta","voc","vox","wav","wma","wv"]},code:{icon:{name:"resource-type-code",color:"var(--oc-role-on-surface)"},extensions:["bash","c++","c","cc","cpp","css","feature","go","h","hh","hpp","htm","html","java","js","json","php","pl","py","scss","sh","sh-lib","sql","ts","xml","yaml","yml"]},default:{icon:{name:"resource-type-file",color:"var(--oc-role-on-surface)"},extensions:["accdb","rss","swf"]},drawio:{icon:{name:"resource-type-drawio",color:"var(--oc-color-icon-drawio)"},extensions:["drawio"]},document:{icon:{name:"resource-type-document",color:"var(--oc-color-icon-document)"},extensions:["doc","docm","docx","dot","dotx","lwp","odt","one","vsd","wpd"]},ifc:{icon:{name:"resource-type-ifc",color:"var(--oc-color-icon-ifc)"},extensions:["ifc"]},ipynb:{icon:{name:"resource-type-jupyter",color:"var(--oc-color-icon-jupyter)"},extensions:["ipynb"]},image:{icon:{name:"resource-type-image",color:"var(--oc-color-icon-image)"},extensions:["ai","cdr","eot","eps","gif","jpeg","jpg","otf","pfb","png","ps","psd","svg","ttf","webp","woff","xcf"]},form:{icon:{name:"resource-type-form",color:"var(--oc-color-icon-form)"},extensions:["docf","docxf","oform"]},markdown:{icon:{name:"resource-type-markdown",color:"var(--oc-color-icon-markdown)"},extensions:["md","markdown"]},odg:{icon:{name:"resource-type-graphic",color:"var(--oc-color-icon-graphic)"},extensions:["odg"]},pdf:{icon:{name:"resource-type-pdf",color:"var(--oc-color-icon-pdf)"},extensions:["pdf"]},presentation:{icon:{name:"resource-type-presentation",color:"var(--oc-color-icon-presentation)"},extensions:["odp","otp","pot","potm","potx","ppa","ppam","pps","ppsm","ppsx","ppt","pptm","pptx"]},root:{icon:{name:"resource-type-root",color:"var(--oc-color-icon-root)"},extensions:["root"]},spreadsheet:{icon:{name:"resource-type-spreadsheet",color:"var(--oc-color-icon-spreadsheet)"},extensions:["csv","ods","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx"]},text:{icon:{name:"resource-type-text",color:"var(--oc-role-on-surface)"},extensions:["cb7","cba","cbr","cbt","cbtc","cbz","cvbdl","eml","mdb","tex","txt"]},url:{icon:{name:"resource-type-url",color:"var(--oc-role-on-surface)"},extensions:["url"]},video:{icon:{name:"resource-type-video",color:"var(--oc-color-icon-video)"},extensions:["mov","mp4","webm","wmv"]},epub:{icon:{name:"resource-type-book",color:"var(--oc-color-icon-epub)"},extensions:["epub"]},board:{icon:{name:"resource-type-board"},extensions:["ggs"]},notes:{icon:{name:"resource-type-sticky-note",color:"var(--oc-color-icon-notes)"},extensions:["ocnb"]}};function xh(){const e={};return Object.values(ME).forEach(t=>{t.extensions.forEach(n=>{e[n]=t.icon})}),e}const Ch=({resourcesStore:e,parentFolderId:t})=>{const n=e.currentFolder;if(!n||!n.id)return!1;if(re.extractNodeId(n.id)){if(n.id!==t)return!1}else{const r=n.id.split("$")[1];if(`${n.id}!${r}`!==t)return!1}return!0};function ql(e,t,n){return t.name=ct.basename(n),t.path=n,t.webDavPath=ct.join(e.webDavPath,n),t.extension=re.extractExtensionFromFile(t),t}function BE(){this.__data__=[],this.size=0}function Eo(e,t){return e===t||e!==e&&t!==t}function Us(e,t){for(var n=e.length;n--;)if(Eo(e[n][0],t))return n;return-1}var jE=Array.prototype,UE=jE.splice;function VE(e){var t=this.__data__,n=Us(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():UE.call(t,n,1),--this.size,!0}function qE(e){var t=this.__data__,n=Us(t,e);return n<0?void 0:t[n][1]}function zE(e){return Us(this.__data__,e)>-1}function WE(e,t){var n=this.__data__,r=Us(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Tr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Tr.prototype.clear=BE,Tr.prototype.delete=VE,Tr.prototype.get=qE,Tr.prototype.has=zE,Tr.prototype.set=WE;function HE(){this.__data__=new Tr,this.size=0}function KE(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function GE(e){return this.__data__.get(e)}function QE(e){return this.__data__.has(e)}const Wr=globalThis||void 0||self;var Rh=typeof Wr=="object"&&Wr&&Wr.Object===Object&&Wr,XE=typeof self=="object"&&self&&self.Object===Object&&self,rr=Rh||XE||Function("return this")(),_n=rr.Symbol,kh=Object.prototype,YE=kh.hasOwnProperty,JE=kh.toString,To=_n?_n.toStringTag:void 0;function ZE(e){var t=YE.call(e,To),n=e[To];try{e[To]=void 0;var r=!0}catch{}var i=JE.call(e);return r&&(t?e[To]=n:delete e[To]),i}var eT=Object.prototype,tT=eT.toString;function nT(e){return tT.call(e)}var rT="[object Null]",iT="[object Undefined]",Ph=_n?_n.toStringTag:void 0;function ii(e){return e==null?e===void 0?iT:rT:Ph&&Ph in Object(e)?ZE(e):nT(e)}function ir(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var oT="[object AsyncFunction]",sT="[object Function]",aT="[object GeneratorFunction]",lT="[object Proxy]";function zl(e){if(!ir(e))return!1;var t=ii(e);return t==sT||t==aT||t==oT||t==lT}var Wl=rr["__core-js_shared__"],Ih=(function(){var e=/[^.]+$/.exec(Wl&&Wl.keys&&Wl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function cT(e){return!!Ih&&Ih in e}var uT=Function.prototype,fT=uT.toString;function oi(e){if(e!=null){try{return fT.call(e)}catch{}try{return e+""}catch{}}return""}var dT=/[\\^$.*+?()[\]{}|]/g,pT=/^\[object .+?Constructor\]$/,hT=Function.prototype,mT=Object.prototype,gT=hT.toString,yT=mT.hasOwnProperty,vT=RegExp("^"+gT.call(yT).replace(dT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function bT(e){if(!ir(e)||cT(e))return!1;var t=zl(e)?vT:pT;return t.test(oi(e))}function wT(e,t){return e?.[t]}function si(e,t){var n=wT(e,t);return bT(n)?n:void 0}var Ao=si(rr,"Map"),xo=si(Object,"create");function ST(){this.__data__=xo?xo(null):{},this.size=0}function ET(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var TT="__lodash_hash_undefined__",AT=Object.prototype,xT=AT.hasOwnProperty;function CT(e){var t=this.__data__;if(xo){var n=t[e];return n===TT?void 0:n}return xT.call(t,e)?t[e]:void 0}var RT=Object.prototype,kT=RT.hasOwnProperty;function PT(e){var t=this.__data__;return xo?t[e]!==void 0:kT.call(t,e)}var IT="__lodash_hash_undefined__";function OT(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=xo&&t===void 0?IT:t,this}function ai(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ai.prototype.clear=ST,ai.prototype.delete=ET,ai.prototype.get=CT,ai.prototype.has=PT,ai.prototype.set=OT;function FT(){this.size=0,this.__data__={hash:new ai,map:new(Ao||Tr),string:new ai}}function _T(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Vs(e,t){var n=e.__data__;return _T(t)?n[typeof t=="string"?"string":"hash"]:n.map}function DT(e){var t=Vs(this,e).delete(e);return this.size-=t?1:0,t}function NT(e){return Vs(this,e).get(e)}function LT(e){return Vs(this,e).has(e)}function $T(e,t){var n=Vs(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Ar(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ar.prototype.clear=FT,Ar.prototype.delete=DT,Ar.prototype.get=NT,Ar.prototype.has=LT,Ar.prototype.set=$T;var MT=200;function BT(e,t){var n=this.__data__;if(n instanceof Tr){var r=n.__data__;if(!Ao||r.length<MT-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ar(r)}return n.set(e,t),this.size=n.size,this}function or(e){var t=this.__data__=new Tr(e);this.size=t.size}or.prototype.clear=HE,or.prototype.delete=KE,or.prototype.get=GE,or.prototype.has=QE,or.prototype.set=BT;var qs=(function(){try{var e=si(Object,"defineProperty");return e({},"",{}),e}catch{}})();function Hl(e,t,n){t=="__proto__"&&qs?qs(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Kl(e,t,n){(n!==void 0&&!Eo(e[t],n)||n===void 0&&!(t in e))&&Hl(e,t,n)}function jT(e){return function(t,n,r){for(var i=-1,o=Object(t),s=r(t),a=s.length;a--;){var l=s[++i];if(n(o[l],l,o)===!1)break}return t}}var UT=jT(),Oh=typeof $=="object"&&$&&!$.nodeType&&$,Fh=Oh&&typeof module=="object"&&module&&!module.nodeType&&module,VT=Fh&&Fh.exports===Oh,_h=VT?rr.Buffer:void 0,Dh=_h?_h.allocUnsafe:void 0;function Nh(e,t){if(t)return e.slice();var n=e.length,r=Dh?Dh(n):new e.constructor(n);return e.copy(r),r}var zs=rr.Uint8Array;function Gl(e){var t=new e.constructor(e.byteLength);return new zs(t).set(new zs(e)),t}function Lh(e,t){var n=t?Gl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function qT(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var $h=Object.create,zT=(function(){function e(){}return function(t){if(!ir(t))return{};if($h)return $h(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})();function Mh(e,t){return function(n){return e(t(n))}}var Ql=Mh(Object.getPrototypeOf,Object),WT=Object.prototype;function Xl(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||WT;return e===n}function HT(e){return typeof e.constructor=="function"&&!Xl(e)?zT(Ql(e)):{}}function sr(e){return e!=null&&typeof e=="object"}var KT="[object Arguments]";function Bh(e){return sr(e)&&ii(e)==KT}var jh=Object.prototype,GT=jh.hasOwnProperty,QT=jh.propertyIsEnumerable,Ws=Bh((function(){return arguments})())?Bh:function(e){return sr(e)&&GT.call(e,"callee")&&!QT.call(e,"callee")},Gn=Array.isArray,XT=9007199254740991;function Uh(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=XT}function Hs(e){return e!=null&&Uh(e.length)&&!zl(e)}function YT(e){return sr(e)&&Hs(e)}function JT(){return!1}var Vh=typeof $=="object"&&$&&!$.nodeType&&$,qh=Vh&&typeof module=="object"&&module&&!module.nodeType&&module,ZT=qh&&qh.exports===Vh,zh=ZT?rr.Buffer:void 0,eA=zh?zh.isBuffer:void 0,Co=eA||JT,tA="[object Object]",nA=Function.prototype,rA=Object.prototype,Wh=nA.toString,iA=rA.hasOwnProperty,oA=Wh.call(Object);function Yl(e){if(!sr(e)||ii(e)!=tA)return!1;var t=Ql(e);if(t===null)return!0;var n=iA.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Wh.call(n)==oA}var sA="[object Arguments]",aA="[object Array]",lA="[object Boolean]",cA="[object Date]",uA="[object Error]",fA="[object Function]",dA="[object Map]",pA="[object Number]",hA="[object Object]",mA="[object RegExp]",gA="[object Set]",yA="[object String]",vA="[object WeakMap]",bA="[object ArrayBuffer]",wA="[object DataView]",SA="[object Float32Array]",EA="[object Float64Array]",TA="[object Int8Array]",AA="[object Int16Array]",xA="[object Int32Array]",CA="[object Uint8Array]",RA="[object Uint8ClampedArray]",kA="[object Uint16Array]",PA="[object Uint32Array]",xt={};xt[SA]=xt[EA]=xt[TA]=xt[AA]=xt[xA]=xt[CA]=xt[RA]=xt[kA]=xt[PA]=!0,xt[sA]=xt[aA]=xt[bA]=xt[lA]=xt[wA]=xt[cA]=xt[uA]=xt[fA]=xt[dA]=xt[pA]=xt[hA]=xt[mA]=xt[gA]=xt[yA]=xt[vA]=!1;function IA(e){return sr(e)&&Uh(e.length)&&!!xt[ii(e)]}function Jl(e){return function(t){return e(t)}}var Hh=typeof $=="object"&&$&&!$.nodeType&&$,Ro=Hh&&typeof module=="object"&&module&&!module.nodeType&&module,OA=Ro&&Ro.exports===Hh,Zl=OA&&Rh.process,Di=(function(){try{var e=Ro&&Ro.require&&Ro.require("util").types;return e||Zl&&Zl.binding&&Zl.binding("util")}catch{}})(),Kh=Di&&Di.isTypedArray,ec=Kh?Jl(Kh):IA;function tc(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var FA=Object.prototype,_A=FA.hasOwnProperty;function Gh(e,t,n){var r=e[t];(!(_A.call(e,t)&&Eo(r,n))||n===void 0&&!(t in e))&&Hl(e,t,n)}function Qh(e,t,n,r){var i=!n;n||(n={});for(var o=-1,s=t.length;++o<s;){var a=t[o],l=void 0;l===void 0&&(l=e[a]),i?Hl(n,a,l):Gh(n,a,l)}return n}function DA(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var NA=9007199254740991,LA=/^(?:0|[1-9]\d*)$/;function Xh(e,t){var n=typeof e;return t=t??NA,!!t&&(n=="number"||n!="symbol"&&LA.test(e))&&e>-1&&e%1==0&&e<t}var $A=Object.prototype,MA=$A.hasOwnProperty;function Yh(e,t){var n=Gn(e),r=!n&&Ws(e),i=!n&&!r&&Co(e),o=!n&&!r&&!i&&ec(e),s=n||r||i||o,a=s?DA(e.length,String):[],l=a.length;for(var u in e)(t||MA.call(e,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Xh(u,l)))&&a.push(u);return a}function BA(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var jA=Object.prototype,UA=jA.hasOwnProperty;function VA(e){if(!ir(e))return BA(e);var t=Xl(e),n=[];for(var r in e)r=="constructor"&&(t||!UA.call(e,r))||n.push(r);return n}function nc(e){return Hs(e)?Yh(e,!0):VA(e)}function qA(e){return Qh(e,nc(e))}function zA(e,t,n,r,i,o,s){var a=tc(e,n),l=tc(t,n),u=s.get(l);if(u){Kl(e,n,u);return}var c=o?o(a,l,n+"",e,t,s):void 0,d=c===void 0;if(d){var p=Gn(l),m=!p&&Co(l),b=!p&&!m&&ec(l);c=l,p||m||b?Gn(a)?c=a:YT(a)?c=qT(a):m?(d=!1,c=Nh(l,!0)):b?(d=!1,c=Lh(l,!0)):c=[]:Yl(l)||Ws(l)?(c=a,Ws(a)?c=qA(a):(!ir(a)||zl(a))&&(c=HT(l))):d=!1}d&&(s.set(l,c),i(c,l,r,o,s),s.delete(l)),Kl(e,n,c)}function Jh(e,t,n,r,i){e!==t&&UT(t,function(o,s){if(i||(i=new or),ir(o))zA(e,t,s,n,Jh,r,i);else{var a=r?r(tc(e,s),o,s+"",e,t,i):void 0;a===void 0&&(a=o),Kl(e,s,a)}},nc)}function Zh(e){return e}function WA(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var em=Math.max;function tm(e,t,n){return t=em(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=em(r.length-t,0),s=Array(o);++i<o;)s[i]=r[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=r[i];return a[t]=n(s),WA(e,this,a)}}function HA(e){return function(){return e}}var KA=qs?function(e,t){return qs(e,"toString",{configurable:!0,enumerable:!1,value:HA(t),writable:!0})}:Zh,GA=800,QA=16,XA=Date.now;function YA(e){var t=0,n=0;return function(){var r=XA(),i=QA-(r-n);if(n=r,i>0){if(++t>=GA)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var nm=YA(KA);function JA(e,t){return nm(tm(e,t,Zh),e+"")}function ZA(e,t,n){if(!ir(n))return!1;var r=typeof t;return(r=="number"?Hs(n)&&Xh(t,n.length):r=="string"&&t in n)?Eo(n[t],e):!1}function ex(e){return JA(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,s&&ZA(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),t=Object(t);++r<i;){var a=n[r];a&&e(t,a,r,o)}return t})}var ko=ex(function(e,t,n){Jh(e,t,n)});const rc=(e,...t)=>{const{href:n}=e.resolve(f(e.currentRoute));return t.map(r=>{const{href:i}=e.resolve({...r});return i==="/"||i==="#/"?!1:n.startsWith(i)}).some(Boolean)},Ni=(...e)=>(t,...n)=>{if(!n.length)return rc(t,...e);const[r,...i]=n.map(o=>{const s=e.find(a=>a.name===o);if(!s)throw new Error(`unknown comparative '${o}'`);return s});return rc(t,r,...i)};function T8(e){return e}const Li=(e,...t)=>ko({},{name:e},...t.map(n=>({...n.params&&{params:n.params},...n.query&&{query:n.query}}))),$i=(e,t={})=>Li(e,t),rm=$i("files-common-favorites"),im=$i("files-common-search"),It=Ni(rm,im),tx=e=>[{path:"/search",component:e.App,children:[{name:im.name,path:"list/:page?",component:e.SearchResults,meta:{authContext:"user",title:"Search results",contextQueryItems:["term","provider","q_tags","q_lastModified","q_titleOnly","q_mediaType","scope","useScope"]}}]},{path:"/favorites",component:e.App,children:[{name:rm.name,path:"",component:e.Favorites,meta:{authContext:"user",title:"Favorite files"}}]}],Qn=(e,t={})=>Li(e,t),om=Qn("files-spaces-projects"),ic=Qn("files-spaces-generic"),pt=Ni(om,ic),nx=e=>[{path:"/spaces",component:e.App,children:[{path:"projects",name:om.name,component:e.Spaces.Projects,meta:{authContext:"user",title:"Spaces"}},{path:":driveAliasAndItem(.*)?",name:ic.name,component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0,contextQueryItems:["sort-by","sort-dir"]}}]}],Dn=(e,t={})=>Li(e,t),rx=Dn("files-shares"),Ks=Dn("files-shares-with-me"),oc=Dn("files-shares-with-others"),sc=Dn("files-shares-via-link"),Bt=Ni(Ks,oc,sc),ix=e=>[{name:rx.name,path:"/shares",component:e.App,redirect:Ks,children:[{name:Ks.name,path:"with-me",component:e.Shares.SharedWithMe,meta:{authContext:"user",title:"Files shared with me"}},{name:oc.name,path:"with-others",component:e.Shares.SharedWithOthers,meta:{authContext:"user",title:"Files shared with others"}},{name:sc.name,path:"via-link",component:e.Shares.SharedViaLink,meta:{authContext:"user",title:"Files shared via link"}}]}],Mi=(e,t={})=>Li(e,t),ac=Mi("files-public-link"),lc=Mi("files-public-upload"),Rn=Ni(ac,lc),ox=e=>[{path:"/link",component:e.App,meta:{auth:!1},children:[{name:ac.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"publicLink",patchCleanPath:!0}}]},{path:"/upload",component:e.App,meta:{auth:!1},children:[{name:lc.name,path:":token?",component:e.FilesDrop,meta:{authContext:"publicLink",title:"Public file upload"}}]}],Hr=(e,t={})=>Li(e,t),sm=Hr("files-trash-generic"),am=Hr("files-trash-overview"),dn=Ni(sm,am),sx=e=>[{path:"/trash",component:e.App,children:[{path:"overview",name:am.name,component:e.Trash.Overview,meta:{authContext:"user",title:"Trash overview"}},{name:sm.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0}}]}];function lm(e){return{applicationConfig:M(()=>e.appsStore.externalAppConfig[e.applicationId]||{})}}const ax=["anonymous","user","idp","publicLink","hybrid"],xr=e=>Sr(e),ze=()=>xr("$router"),zt=()=>ze().currentRoute,cc=e=>e.path.split("/")[1],lx=()=>{const e=zt();return M(()=>cc(f(e)))},ar=(e,t={},n)=>{const r=n?.configStore||ut();return{params:{driveAliasAndItem:e.getDriveAliasAndItem({path:t.path||""})},query:{...re.isShareSpaceResource(e)&&{shareId:e.id},...r?.options?.routing?.idBased&&!At.isUndefined(t.fileId)&&{fileId:`${t.fileId}`}}}},cx=(e,t)=>{const n=document.querySelector("base"),r=!!n,i=new URL(window.location.href.split("#")[0]);return i.search="",r?i.pathname=new URL(n.href).pathname:i.pathname.endsWith("/index.html")&&(i.pathname=i.pathname.split("/").slice(0,-1).filter(Boolean).join("/")),/\.(html?)$/i.test(t)?i.pathname=[...i.pathname.split("/"),...t.split("/")].filter(Boolean).join("/"):i[r?"pathname":"hash"]=e.resolve(t).href,i.href},lr=Me.defineStore("apps",()=>{const e=ae({}),t=ae({}),n=ae([]),r=M(()=>Object.keys(f(e))),i=(l,u)=>{l.id&&(l.extensions&&l.extensions.forEach(c=>{o({appId:l.id,data:c})}),f(e)[l.id]={defaultExtension:l.defaultExtension||"",icon:"check_box_outline_blank",name:l.name||l.id,translations:u,...l})},o=({appId:l,data:u})=>{f(n).push({...u,app:l,hasPriority:u.hasPriority||f(t)?.[l]?.priorityExtensions?.includes(u.extension)||!1,secureView:u.secureView||!1})};return{apps:e,externalAppConfig:t,appIds:r,fileExtensions:n,registerApp:i,registerFileExtension:o,loadExternalAppConfig:({appId:l,config:u})=>{t.value={...f(t),[l]:u}},isAppEnabled:l=>f(r).includes(l)}}),li=Me.defineStore("auth",()=>{const e=ae(),t=ae(!1),n=ae(!1),r=ae(),i=ae(),o=ae(),s=ae(!1),a=m=>{e.value=m},l=m=>{t.value=m},u=m=>{n.value=m},c=m=>{r.value=m.publicLinkToken,i.value=m.publicLinkPassword,o.value=m.publicLinkType,s.value=m.publicLinkContextReady};return{accessToken:e,idpContextReady:t,userContextReady:n,publicLinkToken:r,publicLinkPassword:i,publicLinkType:o,publicLinkContextReady:s,setAccessToken:a,setIdpContextReady:l,setUserContextReady:u,setPublicLinkContext:c,clearUserContext:()=>{a(null),l(null),u(null)},clearPublicLinkContext:()=>{c({publicLinkToken:null,publicLinkPassword:null,publicLinkType:null,publicLinkContextReady:!1})}}}),cm={core:{"support-sse":!1,"support-url-signing":!1},dav:{},files:{app_providers:[],favorites:!1,permanent_deletion:!0,tags:!1,privateLinks:!1,tus_support:{extension:"",http_method_override:!1,max_chunk_size:0}},files_sharing:{allow_custom:!0,api_enabled:!0,can_rename:!0,deny_access:!1,public:{alias:!1,can_contribute:!0,can_edit:!1,default_permissions:re.SharePermissionBit.Read,enabled:!0,password:{enforced_for:{read_only:!1,upload_only:!1,read_write:!1}}}},graph:{"personal-data-export":!1,users:{change_password_self_disabled:!0,create_disabled:!1,delete_disabled:!1,read_only_attributes:[],edit_login_allowed_disabled:!1}},notifications:{"ocs-endpoints":[]},password_policy:{},search:{property:{mediatype:{},mtime:{}}},spaces:{enabled:!1,max_quota:0,projects:!1}},Zt=Me.defineStore("capabilities",()=>{const e=ae(!1),t=ae(cm),n=F=>{t.value=ko({...cm},F.capabilities),e.value=!0},r=M(()=>f(t).core["support-url-signing"]),i=M(()=>f(t).core["support-sse"]),o=M(()=>f(t).core["support-radicale"]),s=M(()=>f(t).graph["personal-data-export"]),a=M(()=>f(t).core.status),l=M(()=>f(t).dav.reports),u=M(()=>f(t).dav.trashbin),c=M(()=>f(t).spaces.max_quota),d=M(()=>f(t).spaces.projects),p=M(()=>f(t).graph.users.create_disabled),m=M(()=>f(t).graph.users.delete_disabled),b=M(()=>f(t).graph.users.change_password_self_disabled),w=M(()=>f(t).graph.users.read_only_attributes),S=M(()=>f(t).graph.users.edit_login_allowed_disabled),y=M(()=>f(t).files.app_providers),g=M(()=>f(t).files.favorites),v=M(()=>f(t).files.archivers),h=M(()=>f(t).files.privateLinks),E=M(()=>f(t).files.permanent_deletion),T=M(()=>f(t).files.tags),R=M(()=>f(t).files.undelete),C=M(()=>f(t).files_sharing.api_enabled),A=M(()=>f(t).files_sharing.can_rename),D=M(()=>f(t).files_sharing.allow_custom),V=M(()=>f(t).files_sharing.public?.enabled),O=M(()=>f(t).files_sharing.public?.can_edit),N=M(()=>f(t).files_sharing.public?.can_contribute),W=M(()=>f(t).files_sharing.public?.alias),L=M(()=>f(t).files_sharing.public?.default_permissions),ee=M(()=>f(t).files_sharing.public?.password.enforced_for),J=M(()=>f(t).files_sharing.search_min_length),se=M(()=>f(t).files_sharing.user?.profile_picture),he=M(()=>f(t).files.tus_support?.max_chunk_size),oe=M(()=>f(t).files.tus_support?.extension),we=M(()=>f(t).files.tus_support?.http_method_override),X=M(()=>f(t).notifications["ocs-endpoints"]),ie=M(()=>f(t).password_policy),le=M(()=>f(t).search.property?.mtime),Ae=M(()=>f(t).search.property?.mediatype),te=M(()=>f(t).search.property?.content);return{isInitialized:e,capabilities:t,setCapabilities:n,status:a,supportUrlSigning:r,supportSSE:i,supportRadicale:o,personalDataExport:s,davReports:l,davTrashbin:u,spacesMaxQuota:c,spacesProjects:d,graphUsersCreateDisabled:p,graphUsersDeleteDisabled:m,graphUsersChangeSelfPasswordDisabled:b,graphUsersEditLoginAllowedDisabled:S,graphUsersReadOnlyAttributes:w,filesAppProviders:y,filesFavorites:g,filesArchivers:v,filesPrivateLinks:h,filesPermanentDeletion:E,filesTags:T,filesUndelete:R,sharingApiEnabled:C,sharingCanRename:A,sharingAllowCustom:D,sharingPublicEnabled:V,sharingPublicCanEdit:O,sharingPublicCanContribute:N,sharingPublicAlias:W,sharingPublicDefaultPermissions:L,sharingPublicPasswordEnforcedFor:ee,sharingSearchMinLength:J,sharingUserProfilePicture:se,tusMaxChunkSize:he,tusExtension:oe,tusHttpMethodOverride:we,notificationsOcsEndpoints:X,passwordPolicy:ie,searchLastMofifiedDate:le,searchMediaType:Ae,searchContent:te}});class ux{value;expires;constructor(t,n){this.value=t,this.expires=n?new Date().getTime()+n:0}get expired(){return this.expires>0&&this.expires<new Date().getTime()}}class uc{map;ttl;capacity;constructor(t){this.ttl=t.ttl||0,this.capacity=t.capacity||0,this.map=new Map}set(t,n,r){return this.evict(),this.map.set(t,new ux(n,isNaN(r)?this.ttl:r)),n}get(t){this.evict();const n=this.map.get(t);if(n)return n.value}delete(t){return this.map.delete(t)}clear(){return this.map.clear()}entries(){return this.evict(),[...this.map.entries()].map(t=>[t[0],t[1].value])}keys(){return this.evict(),[...this.map.keys()]}has(t){return this.evict(),this.map.has(t)}values(){return this.evict(),[...this.map.values()].map(t=>t.value)}evict(){if(this.map.forEach((t,n)=>{t.expired&&this.delete(n)}),!!this.capacity)for(const[t]of[...this.map.entries()]){if(this.map.size<=this.capacity)break;this.delete(t)}}}const Gs=async({graphClient:e,spacesStore:t,space:n,signal:r})=>{const i=await t.getMountPointForSpace({graphClient:e,space:n,signal:r});if(!i)return null;const{id:o}=i;return e.driveItems.getDriveItem(o.split("!")[0],o)},fx=({sharedAncestor:e,matchingSpace:t})=>t?Qn("files-spaces-generic",ar(t,{path:e.path,fileId:e.id})):{},um=({sharesStore:e,spacesStore:t,space:n,sharedDriveItem:r})=>{const i=r?.remoteItem?.permissions||[];if(!i.length)return;const o=[];i.forEach(s=>{if(s["@libre.graph.permissions.actions"]){o.push(...s["@libre.graph.permissions.actions"]);return}const a=e.graphRoles[s.roles[0]];if(!a)return;const l=a.rolePermissions.flatMap(u=>u.allowedResourceActions);o.push(...l)}),t.updateSpaceField({id:n.id,field:"graphPermissions",value:[...new Set(o)]})},dx=e=>{const t=document.querySelectorAll(`[data-item-id="${e}"] input[type=checkbox]`)?.[0];t&&t.focus()};class Po{static sortByQueryName="sort-by";static sortDirQueryName="sort-dir"}var px="[object Symbol]";function Qs(e){return typeof e=="symbol"||sr(e)&&ii(e)==px}var hx=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,mx=/^\w*$/;function gx(e,t){if(Gn(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Qs(e)?!0:mx.test(e)||!hx.test(e)||t!=null&&e in Object(t)}var yx="Expected a function";function fc(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(yx);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(fc.Cache||Ar),n}fc.Cache=Ar;var vx=500;function bx(e){var t=fc(e,function(r){return n.size===vx&&n.clear(),r}),n=t.cache;return t}var wx=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Sx=/\\(\\)?/g,Ex=bx(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(wx,function(n,r,i,o){t.push(i?o.replace(Sx,"$1"):r||n)}),t});function fm(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var dm=_n?_n.prototype:void 0,pm=dm?dm.toString:void 0;function hm(e){if(typeof e=="string")return e;if(Gn(e))return fm(e,hm)+"";if(Qs(e))return pm?pm.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function dc(e){return e==null?"":hm(e)}function pc(e,t){return Gn(e)?e:gx(e,t)?[e]:Ex(dc(e))}function mm(e){if(typeof e=="string"||Qs(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function gm(e,t){t=pc(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[mm(t[n++])];return n&&n==r?e:void 0}function hc(e,t,n){var r=e==null?void 0:gm(e,t);return r===void 0?n:r}var Qt=(e=>(e.Desc="desc",e.Asc="asc",e))(Qt||{});function Tx(e){const t=ze(),n=Ax(e),r=xx(e),i=M(()=>vm(f(n))||f(mc(f(s))?.name)),o=M(()=>Rx(f(r))||Cx(f(i),f(s))),s=e.fields;return{items:M(()=>{const u=f(e.items);return f(i)?ym(u,f(s),f(i),f(o)):u}),sortBy:i,sortDir:o,handleSort:({sortBy:u,sortDir:c})=>t.replace({query:{...f(t.currentRoute).query,[f(e.sortByQueryName)||Po.sortByQueryName]:u,[f(e.sortDirQueryName)||Po.sortDirQueryName]:c}})}}function Ax(e){return e.sortBy?_t(e.sortBy)?e.sortBy:ae(e.sortBy):Pr({name:f(e.sortByQueryName)||Po.sortByQueryName,defaultValue:f(mc(f(e.fields))?.name),storagePrefix:f(e.routeName)||f(Jf())})}function xx(e){return e.sortDir?_t(e.sortDir)?e.sortDir:ae(e.sortDir):Pr({name:f(e.sortDirQueryName)||Po.sortDirQueryName,defaultValue:f(mc(f(e.fields))?.sortDir),storagePrefix:f(e.routeName)||f(Jf())})}const mc=e=>{const t=e.filter(n=>n.sortable);return t?t[0]:null},Cx=(e,t)=>{const n=t.find(r=>r.name===e);return n&&n.sortDir?f(n.sortDir):"desc"},ym=(e,t,n,r)=>{const i=t.find(a=>a.name===n);if(!i)return e;const{sortable:o}=i,s=new Intl.Collator(navigator.language,{sensitivity:"base",numeric:!0});if(n==="name"){const a=c=>c.type==="folder"&&!c.extension,l=[...e.filter(c=>a(c))].sort((c,d)=>gc(c,d,s,n,r,o)),u=[...e.filter(c=>!a(c))].sort((c,d)=>gc(c,d,s,n,r,o));return r==="asc"?l.concat(u):u.concat(l)}return[...e].sort((a,l)=>gc(a,l,s,i.prop||i.name,r,o))},gc=(e,t,n,r,i,o)=>{let s=hc(e,r),a=hc(t,r);const l=i==="asc"?1:-1;if(o)if(typeof o=="string"){const c=d=>d.map(p=>p[o]).join("");s=c(s),a=c(a)}else typeof o=="function"&&(s=o(s),a=o(a));return!isNaN(s)&&!isNaN(a)?(s-a)*l:n.compare((s||"").toString(),(a||"").toString())*l},vm=e=>Array.isArray(e)?e[0]:e,Rx=e=>{switch(vm(e)){case"asc":return"asc";case"desc":return"desc"}return null},bm=e=>e?[{name:"name",sortable:!0,sortDir:Qt.Asc},{name:"size",sortable:!0,sortDir:Qt.Desc},{name:"sharedWith",sortable:t=>t.length>0?t.sort((n,r)=>n.shareType!==r.shareType?n.shareType<r.shareType?-1:1:n.displayName<r.displayName?-1:1).map(n=>n.displayName).join():!1,sortDir:Qt.Asc},{name:"owner",sortable:"displayName",sortDir:Qt.Asc},{name:"mdate",sortable:t=>new Date(t).valueOf(),sortDir:Qt.Desc},{name:"sdate",sortable:t=>new Date(t).valueOf(),sortDir:Qt.Desc},{name:"ddate",sortable:t=>new Date(t).valueOf(),sortDir:Qt.Desc}].filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[];function A8(e){return e}const wm=[{label:"A-Z",name:"name",sortable:!0,sortDir:Qt.Asc},{label:"Z-A",name:"name",sortable:!0,sortDir:Qt.Desc},{label:"Newest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:Qt.Desc},{label:"Oldest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:Qt.Asc},{label:"Largest",name:"size",sortable:!0,sortDir:Qt.Desc},{label:"Smallest",name:"size",sortable:!0,sortDir:Qt.Asc},{label:"Remaining quota",name:"remainingQuota",prop:"spaceQuota.remaining",sortable:!0,sortDir:Qt.Desc},{label:"Total quota",name:"totalQuota",prop:"spaceQuota.total",sortable:!0,sortDir:Qt.Desc},{label:"Used quota",name:"usedQuota",prop:"spaceQuota.used",sortable:!0,sortDir:Qt.Desc}],kx=e=>e?wm.filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[],Px=(e,{$gettext:t})=>e.map(n=>({...n,label:t(n.label)})),Ix=fe.z.object({icon:fe.z.string(),name:fe.z.string(),secure_view:fe.z.boolean().optional().default(!1),target_ext:fe.z.string().optional()}),Ox=fe.z.object({allow_creation:fe.z.boolean().optional(),app_providers:fe.z.array(Ix),default_application:fe.z.string().optional(),description:fe.z.string().optional(),ext:fe.z.string().optional(),mime_type:fe.z.string(),name:fe.z.string().optional()}),Sm=fe.z.object({"mime-types":fe.z.array(Ox)});class Fx{_mimeTypes=ae([]);serverUrl;clientService;constructor(t,n){this.serverUrl=t,this.clientService=n}async loadData(){const t=re.urlJoin(this.serverUrl,"app","list"),{data:{"mime-types":n}}=await this.clientService.httpUnAuthenticated.get(t,{schema:Sm});this._mimeTypes.value=n}set mimeTypes(t){this._mimeTypes.value=t}get mimeTypes(){return f(this._mimeTypes)}get templateMimeTypes(){return f(this._mimeTypes).filter(t=>!!t.app_providers.some(n=>!!n.target_ext))}get appNames(){return[...new Set(f(this._mimeTypes).flatMap(t=>t.app_providers.map(n=>n.name)))]}getMimeTypesByAppName(t){return f(this._mimeTypes).filter(n=>n.app_providers.some(r=>r.name===t))}}var Em={},Xs={};Xs.byteLength=Nx,Xs.toByteArray=$x,Xs.fromByteArray=jx;for(var cr=[],Nn=[],_x=typeof Uint8Array<"u"?Uint8Array:Array,yc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Bi=0,Dx=yc.length;Bi<Dx;++Bi)cr[Bi]=yc[Bi],Nn[yc.charCodeAt(Bi)]=Bi;Nn[45]=62,Nn[95]=63;function Tm(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function Nx(e){var t=Tm(e),n=t[0],r=t[1];return(n+r)*3/4-r}function Lx(e,t,n){return(t+n)*3/4-n}function $x(e){var t,n=Tm(e),r=n[0],i=n[1],o=new _x(Lx(e,r,i)),s=0,a=i>0?r-4:r,l;for(l=0;l<a;l+=4)t=Nn[e.charCodeAt(l)]<<18|Nn[e.charCodeAt(l+1)]<<12|Nn[e.charCodeAt(l+2)]<<6|Nn[e.charCodeAt(l+3)],o[s++]=t>>16&255,o[s++]=t>>8&255,o[s++]=t&255;return i===2&&(t=Nn[e.charCodeAt(l)]<<2|Nn[e.charCodeAt(l+1)]>>4,o[s++]=t&255),i===1&&(t=Nn[e.charCodeAt(l)]<<10|Nn[e.charCodeAt(l+1)]<<4|Nn[e.charCodeAt(l+2)]>>2,o[s++]=t>>8&255,o[s++]=t&255),o}function Mx(e){return cr[e>>18&63]+cr[e>>12&63]+cr[e>>6&63]+cr[e&63]}function Bx(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),i.push(Mx(r));return i.join("")}function jx(e){for(var t,n=e.length,r=n%3,i=[],o=16383,s=0,a=n-r;s<a;s+=o)i.push(Bx(e,s,s+o>a?a:s+o));return r===1?(t=e[n-1],i.push(cr[t>>2]+cr[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],i.push(cr[t>>10]+cr[t>>4&63]+cr[t<<2&63]+"=")),i.join("")}var vc={};vc.read=function(e,t,n,r,i){var o,s,a=i*8-r-1,l=(1<<a)-1,u=l>>1,c=-7,d=n?i-1:0,p=n?-1:1,m=e[t+d];for(d+=p,o=m&(1<<-c)-1,m>>=-c,c+=a;c>0;o=o*256+e[t+d],d+=p,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=r;c>0;s=s*256+e[t+d],d+=p,c-=8);if(o===0)o=1-u;else{if(o===l)return s?NaN:(m?-1:1)*(1/0);s=s+Math.pow(2,r),o=o-u}return(m?-1:1)*s*Math.pow(2,o-r)},vc.write=function(e,t,n,r,i,o){var s,a,l,u=o*8-i-1,c=(1<<u)-1,d=c>>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:o-1,b=r?1:-1,w=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+d>=1?t+=p/l:t+=p*Math.pow(2,1-d),t*l>=2&&(s++,l/=2),s+d>=c?(a=0,s=c):s+d>=1?(a=(t*l-1)*Math.pow(2,i),s=s+d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[n+m]=a&255,m+=b,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[n+m]=s&255,m+=b,s/=256,u-=8);e[n+m-b]|=w*128};(function(e){const t=Xs,n=vc,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=E,e.INSPECT_MAX_BYTES=50;const i=2147483647;e.kMaxLength=i;const{Uint8Array:o,ArrayBuffer:s,SharedArrayBuffer:a}=globalThis;c.TYPED_ARRAY_SUPPORT=l(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function l(){try{const U=new o(1),k={foo:function(){return 42}};return Object.setPrototypeOf(k,o.prototype),Object.setPrototypeOf(U,k),U.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function u(U){if(U>i)throw new RangeError('The value "'+U+'" is invalid for option "size"');const k=new o(U);return Object.setPrototypeOf(k,c.prototype),k}function c(U,k,P){if(typeof U=="number"){if(typeof k=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return b(U)}return d(U,k,P)}c.poolSize=8192;function d(U,k,P){if(typeof U=="string")return w(U,k);if(s.isView(U))return y(U);if(U==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U);if(St(U,s)||U&&St(U.buffer,s)||typeof a<"u"&&(St(U,a)||U&&St(U.buffer,a)))return g(U,k,P);if(typeof U=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Q=U.valueOf&&U.valueOf();if(Q!=null&&Q!==U)return c.from(Q,k,P);const K=v(U);if(K)return K;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof U[Symbol.toPrimitive]=="function")return c.from(U[Symbol.toPrimitive]("string"),k,P);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U)}c.from=function(U,k,P){return d(U,k,P)},Object.setPrototypeOf(c.prototype,o.prototype),Object.setPrototypeOf(c,o);function p(U){if(typeof U!="number")throw new TypeError('"size" argument must be of type number');if(U<0)throw new RangeError('The value "'+U+'" is invalid for option "size"')}function m(U,k,P){return p(U),U<=0?u(U):k!==void 0?typeof P=="string"?u(U).fill(k,P):u(U).fill(k):u(U)}c.alloc=function(U,k,P){return m(U,k,P)};function b(U){return p(U),u(U<0?0:h(U)|0)}c.allocUnsafe=function(U){return b(U)},c.allocUnsafeSlow=function(U){return b(U)};function w(U,k){if((typeof k!="string"||k==="")&&(k="utf8"),!c.isEncoding(k))throw new TypeError("Unknown encoding: "+k);const P=T(U,k)|0;let Q=u(P);const K=Q.write(U,k);return K!==P&&(Q=Q.slice(0,K)),Q}function S(U){const k=U.length<0?0:h(U.length)|0,P=u(k);for(let Q=0;Q<k;Q+=1)P[Q]=U[Q]&255;return P}function y(U){if(St(U,o)){const k=new o(U);return g(k.buffer,k.byteOffset,k.byteLength)}return S(U)}function g(U,k,P){if(k<0||U.byteLength<k)throw new RangeError('"offset" is outside of buffer bounds');if(U.byteLength<k+(P||0))throw new RangeError('"length" is outside of buffer bounds');let Q;return k===void 0&&P===void 0?Q=new o(U):P===void 0?Q=new o(U,k):Q=new o(U,k,P),Object.setPrototypeOf(Q,c.prototype),Q}function v(U){if(c.isBuffer(U)){const k=h(U.length)|0,P=u(k);return P.length===0||U.copy(P,0,0,k),P}if(U.length!==void 0)return typeof U.length!="number"||Et(U.length)?u(0):S(U);if(U.type==="Buffer"&&Array.isArray(U.data))return S(U.data)}function h(U){if(U>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return U|0}function E(U){return+U!=U&&(U=0),c.alloc(+U)}c.isBuffer=function(k){return k!=null&&k._isBuffer===!0&&k!==c.prototype},c.compare=function(k,P){if(St(k,o)&&(k=c.from(k,k.offset,k.byteLength)),St(P,o)&&(P=c.from(P,P.offset,P.byteLength)),!c.isBuffer(k)||!c.isBuffer(P))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(k===P)return 0;let Q=k.length,K=P.length;for(let ne=0,de=Math.min(Q,K);ne<de;++ne)if(k[ne]!==P[ne]){Q=k[ne],K=P[ne];break}return Q<K?-1:K<Q?1:0},c.isEncoding=function(k){switch(String(k).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(k,P){if(!Array.isArray(k))throw new TypeError('"list" argument must be an Array of Buffers');if(k.length===0)return c.alloc(0);let Q;if(P===void 0)for(P=0,Q=0;Q<k.length;++Q)P+=k[Q].length;const K=c.allocUnsafe(P);let ne=0;for(Q=0;Q<k.length;++Q){let de=k[Q];if(St(de,o))ne+de.length>K.length?(c.isBuffer(de)||(de=c.from(de)),de.copy(K,ne)):o.prototype.set.call(K,de,ne);else if(c.isBuffer(de))de.copy(K,ne);else throw new TypeError('"list" argument must be an Array of Buffers');ne+=de.length}return K};function T(U,k){if(c.isBuffer(U))return U.length;if(s.isView(U)||St(U,s))return U.byteLength;if(typeof U!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof U);const P=U.length,Q=arguments.length>2&&arguments[2]===!0;if(!Q&&P===0)return 0;let K=!1;for(;;)switch(k){case"ascii":case"latin1":case"binary":return P;case"utf8":case"utf-8":return Ke(U).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P*2;case"hex":return P>>>1;case"base64":return Ze(U).length;default:if(K)return Q?-1:Ke(U).length;k=(""+k).toLowerCase(),K=!0}}c.byteLength=T;function R(U,k,P){let Q=!1;if((k===void 0||k<0)&&(k=0),k>this.length||((P===void 0||P>this.length)&&(P=this.length),P<=0)||(P>>>=0,k>>>=0,P<=k))return"";for(U||(U="utf8");;)switch(U){case"hex":return X(this,k,P);case"utf8":case"utf-8":return J(this,k,P);case"ascii":return oe(this,k,P);case"latin1":case"binary":return we(this,k,P);case"base64":return ee(this,k,P);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ie(this,k,P);default:if(Q)throw new TypeError("Unknown encoding: "+U);U=(U+"").toLowerCase(),Q=!0}}c.prototype._isBuffer=!0;function C(U,k,P){const Q=U[k];U[k]=U[P],U[P]=Q}c.prototype.swap16=function(){const k=this.length;if(k%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let P=0;P<k;P+=2)C(this,P,P+1);return this},c.prototype.swap32=function(){const k=this.length;if(k%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let P=0;P<k;P+=4)C(this,P,P+3),C(this,P+1,P+2);return this},c.prototype.swap64=function(){const k=this.length;if(k%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let P=0;P<k;P+=8)C(this,P,P+7),C(this,P+1,P+6),C(this,P+2,P+5),C(this,P+3,P+4);return this},c.prototype.toString=function(){const k=this.length;return k===0?"":arguments.length===0?J(this,0,k):R.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(k){if(!c.isBuffer(k))throw new TypeError("Argument must be a Buffer");return this===k?!0:c.compare(this,k)===0},c.prototype.inspect=function(){let k="";const P=e.INSPECT_MAX_BYTES;return k=this.toString("hex",0,P).replace(/(.{2})/g,"$1 ").trim(),this.length>P&&(k+=" ... "),"<Buffer "+k+">"},r&&(c.prototype[r]=c.prototype.inspect),c.prototype.compare=function(k,P,Q,K,ne){if(St(k,o)&&(k=c.from(k,k.offset,k.byteLength)),!c.isBuffer(k))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof k);if(P===void 0&&(P=0),Q===void 0&&(Q=k?k.length:0),K===void 0&&(K=0),ne===void 0&&(ne=this.length),P<0||Q>k.length||K<0||ne>this.length)throw new RangeError("out of range index");if(K>=ne&&P>=Q)return 0;if(K>=ne)return-1;if(P>=Q)return 1;if(P>>>=0,Q>>>=0,K>>>=0,ne>>>=0,this===k)return 0;let de=ne-K,_e=Q-P;const Ne=Math.min(de,_e),xe=this.slice(K,ne),Be=k.slice(P,Q);for(let Qe=0;Qe<Ne;++Qe)if(xe[Qe]!==Be[Qe]){de=xe[Qe],_e=Be[Qe];break}return de<_e?-1:_e<de?1:0};function A(U,k,P,Q,K){if(U.length===0)return-1;if(typeof P=="string"?(Q=P,P=0):P>2147483647?P=2147483647:P<-2147483648&&(P=-2147483648),P=+P,Et(P)&&(P=K?0:U.length-1),P<0&&(P=U.length+P),P>=U.length){if(K)return-1;P=U.length-1}else if(P<0)if(K)P=0;else return-1;if(typeof k=="string"&&(k=c.from(k,Q)),c.isBuffer(k))return k.length===0?-1:D(U,k,P,Q,K);if(typeof k=="number")return k=k&255,typeof o.prototype.indexOf=="function"?K?o.prototype.indexOf.call(U,k,P):o.prototype.lastIndexOf.call(U,k,P):D(U,[k],P,Q,K);throw new TypeError("val must be string, number or Buffer")}function D(U,k,P,Q,K){let ne=1,de=U.length,_e=k.length;if(Q!==void 0&&(Q=String(Q).toLowerCase(),Q==="ucs2"||Q==="ucs-2"||Q==="utf16le"||Q==="utf-16le")){if(U.length<2||k.length<2)return-1;ne=2,de/=2,_e/=2,P/=2}function Ne(Be,Qe){return ne===1?Be[Qe]:Be.readUInt16BE(Qe*ne)}let xe;if(K){let Be=-1;for(xe=P;xe<de;xe++)if(Ne(U,xe)===Ne(k,Be===-1?0:xe-Be)){if(Be===-1&&(Be=xe),xe-Be+1===_e)return Be*ne}else Be!==-1&&(xe-=xe-Be),Be=-1}else for(P+_e>de&&(P=de-_e),xe=P;xe>=0;xe--){let Be=!0;for(let Qe=0;Qe<_e;Qe++)if(Ne(U,xe+Qe)!==Ne(k,Qe)){Be=!1;break}if(Be)return xe}return-1}c.prototype.includes=function(k,P,Q){return this.indexOf(k,P,Q)!==-1},c.prototype.indexOf=function(k,P,Q){return A(this,k,P,Q,!0)},c.prototype.lastIndexOf=function(k,P,Q){return A(this,k,P,Q,!1)};function V(U,k,P,Q){P=Number(P)||0;const K=U.length-P;Q?(Q=Number(Q),Q>K&&(Q=K)):Q=K;const ne=k.length;Q>ne/2&&(Q=ne/2);let de;for(de=0;de<Q;++de){const _e=parseInt(k.substr(de*2,2),16);if(Et(_e))return de;U[P+de]=_e}return de}function O(U,k,P,Q){return wt(Ke(k,U.length-P),U,P,Q)}function N(U,k,P,Q){return wt(Ge(k),U,P,Q)}function W(U,k,P,Q){return wt(Ze(k),U,P,Q)}function L(U,k,P,Q){return wt(Ye(k,U.length-P),U,P,Q)}c.prototype.write=function(k,P,Q,K){if(P===void 0)K="utf8",Q=this.length,P=0;else if(Q===void 0&&typeof P=="string")K=P,Q=this.length,P=0;else if(isFinite(P))P=P>>>0,isFinite(Q)?(Q=Q>>>0,K===void 0&&(K="utf8")):(K=Q,Q=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ne=this.length-P;if((Q===void 0||Q>ne)&&(Q=ne),k.length>0&&(Q<0||P<0)||P>this.length)throw new RangeError("Attempt to write outside buffer bounds");K||(K="utf8");let de=!1;for(;;)switch(K){case"hex":return V(this,k,P,Q);case"utf8":case"utf-8":return O(this,k,P,Q);case"ascii":case"latin1":case"binary":return N(this,k,P,Q);case"base64":return W(this,k,P,Q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,k,P,Q);default:if(de)throw new TypeError("Unknown encoding: "+K);K=(""+K).toLowerCase(),de=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ee(U,k,P){return k===0&&P===U.length?t.fromByteArray(U):t.fromByteArray(U.slice(k,P))}function J(U,k,P){P=Math.min(U.length,P);const Q=[];let K=k;for(;K<P;){const ne=U[K];let de=null,_e=ne>239?4:ne>223?3:ne>191?2:1;if(K+_e<=P){let Ne,xe,Be,Qe;switch(_e){case 1:ne<128&&(de=ne);break;case 2:Ne=U[K+1],(Ne&192)===128&&(Qe=(ne&31)<<6|Ne&63,Qe>127&&(de=Qe));break;case 3:Ne=U[K+1],xe=U[K+2],(Ne&192)===128&&(xe&192)===128&&(Qe=(ne&15)<<12|(Ne&63)<<6|xe&63,Qe>2047&&(Qe<55296||Qe>57343)&&(de=Qe));break;case 4:Ne=U[K+1],xe=U[K+2],Be=U[K+3],(Ne&192)===128&&(xe&192)===128&&(Be&192)===128&&(Qe=(ne&15)<<18|(Ne&63)<<12|(xe&63)<<6|Be&63,Qe>65535&&Qe<1114112&&(de=Qe))}}de===null?(de=65533,_e=1):de>65535&&(de-=65536,Q.push(de>>>10&1023|55296),de=56320|de&1023),Q.push(de),K+=_e}return he(Q)}const se=4096;function he(U){const k=U.length;if(k<=se)return String.fromCharCode.apply(String,U);let P="",Q=0;for(;Q<k;)P+=String.fromCharCode.apply(String,U.slice(Q,Q+=se));return P}function oe(U,k,P){let Q="";P=Math.min(U.length,P);for(let K=k;K<P;++K)Q+=String.fromCharCode(U[K]&127);return Q}function we(U,k,P){let Q="";P=Math.min(U.length,P);for(let K=k;K<P;++K)Q+=String.fromCharCode(U[K]);return Q}function X(U,k,P){const Q=U.length;(!k||k<0)&&(k=0),(!P||P<0||P>Q)&&(P=Q);let K="";for(let ne=k;ne<P;++ne)K+=Tt[U[ne]];return K}function ie(U,k,P){const Q=U.slice(k,P);let K="";for(let ne=0;ne<Q.length-1;ne+=2)K+=String.fromCharCode(Q[ne]+Q[ne+1]*256);return K}c.prototype.slice=function(k,P){const Q=this.length;k=~~k,P=P===void 0?Q:~~P,k<0?(k+=Q,k<0&&(k=0)):k>Q&&(k=Q),P<0?(P+=Q,P<0&&(P=0)):P>Q&&(P=Q),P<k&&(P=k);const K=this.subarray(k,P);return Object.setPrototypeOf(K,c.prototype),K};function le(U,k,P){if(U%1!==0||U<0)throw new RangeError("offset is not uint");if(U+k>P)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(k,P,Q){k=k>>>0,P=P>>>0,Q||le(k,P,this.length);let K=this[k],ne=1,de=0;for(;++de<P&&(ne*=256);)K+=this[k+de]*ne;return K},c.prototype.readUintBE=c.prototype.readUIntBE=function(k,P,Q){k=k>>>0,P=P>>>0,Q||le(k,P,this.length);let K=this[k+--P],ne=1;for(;P>0&&(ne*=256);)K+=this[k+--P]*ne;return K},c.prototype.readUint8=c.prototype.readUInt8=function(k,P){return k=k>>>0,P||le(k,1,this.length),this[k]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(k,P){return k=k>>>0,P||le(k,2,this.length),this[k]|this[k+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(k,P){return k=k>>>0,P||le(k,2,this.length),this[k]<<8|this[k+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(k,P){return k=k>>>0,P||le(k,4,this.length),(this[k]|this[k+1]<<8|this[k+2]<<16)+this[k+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(k,P){return k=k>>>0,P||le(k,4,this.length),this[k]*16777216+(this[k+1]<<16|this[k+2]<<8|this[k+3])},c.prototype.readBigUInt64LE=at(function(k){k=k>>>0,Ce(k,"offset");const P=this[k],Q=this[k+7];(P===void 0||Q===void 0)&&Ie(k,this.length-8);const K=P+this[++k]*2**8+this[++k]*2**16+this[++k]*2**24,ne=this[++k]+this[++k]*2**8+this[++k]*2**16+Q*2**24;return BigInt(K)+(BigInt(ne)<<BigInt(32))}),c.prototype.readBigUInt64BE=at(function(k){k=k>>>0,Ce(k,"offset");const P=this[k],Q=this[k+7];(P===void 0||Q===void 0)&&Ie(k,this.length-8);const K=P*2**24+this[++k]*2**16+this[++k]*2**8+this[++k],ne=this[++k]*2**24+this[++k]*2**16+this[++k]*2**8+Q;return(BigInt(K)<<BigInt(32))+BigInt(ne)}),c.prototype.readIntLE=function(k,P,Q){k=k>>>0,P=P>>>0,Q||le(k,P,this.length);let K=this[k],ne=1,de=0;for(;++de<P&&(ne*=256);)K+=this[k+de]*ne;return ne*=128,K>=ne&&(K-=Math.pow(2,8*P)),K},c.prototype.readIntBE=function(k,P,Q){k=k>>>0,P=P>>>0,Q||le(k,P,this.length);let K=P,ne=1,de=this[k+--K];for(;K>0&&(ne*=256);)de+=this[k+--K]*ne;return ne*=128,de>=ne&&(de-=Math.pow(2,8*P)),de},c.prototype.readInt8=function(k,P){return k=k>>>0,P||le(k,1,this.length),this[k]&128?(255-this[k]+1)*-1:this[k]},c.prototype.readInt16LE=function(k,P){k=k>>>0,P||le(k,2,this.length);const Q=this[k]|this[k+1]<<8;return Q&32768?Q|4294901760:Q},c.prototype.readInt16BE=function(k,P){k=k>>>0,P||le(k,2,this.length);const Q=this[k+1]|this[k]<<8;return Q&32768?Q|4294901760:Q},c.prototype.readInt32LE=function(k,P){return k=k>>>0,P||le(k,4,this.length),this[k]|this[k+1]<<8|this[k+2]<<16|this[k+3]<<24},c.prototype.readInt32BE=function(k,P){return k=k>>>0,P||le(k,4,this.length),this[k]<<24|this[k+1]<<16|this[k+2]<<8|this[k+3]},c.prototype.readBigInt64LE=at(function(k){k=k>>>0,Ce(k,"offset");const P=this[k],Q=this[k+7];(P===void 0||Q===void 0)&&Ie(k,this.length-8);const K=this[k+4]+this[k+5]*2**8+this[k+6]*2**16+(Q<<24);return(BigInt(K)<<BigInt(32))+BigInt(P+this[++k]*2**8+this[++k]*2**16+this[++k]*2**24)}),c.prototype.readBigInt64BE=at(function(k){k=k>>>0,Ce(k,"offset");const P=this[k],Q=this[k+7];(P===void 0||Q===void 0)&&Ie(k,this.length-8);const K=(P<<24)+this[++k]*2**16+this[++k]*2**8+this[++k];return(BigInt(K)<<BigInt(32))+BigInt(this[++k]*2**24+this[++k]*2**16+this[++k]*2**8+Q)}),c.prototype.readFloatLE=function(k,P){return k=k>>>0,P||le(k,4,this.length),n.read(this,k,!0,23,4)},c.prototype.readFloatBE=function(k,P){return k=k>>>0,P||le(k,4,this.length),n.read(this,k,!1,23,4)},c.prototype.readDoubleLE=function(k,P){return k=k>>>0,P||le(k,8,this.length),n.read(this,k,!0,52,8)},c.prototype.readDoubleBE=function(k,P){return k=k>>>0,P||le(k,8,this.length),n.read(this,k,!1,52,8)};function Ae(U,k,P,Q,K,ne){if(!c.isBuffer(U))throw new TypeError('"buffer" argument must be a Buffer instance');if(k>K||k<ne)throw new RangeError('"value" argument is out of bounds');if(P+Q>U.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(k,P,Q,K){if(k=+k,P=P>>>0,Q=Q>>>0,!K){const _e=Math.pow(2,8*Q)-1;Ae(this,k,P,Q,_e,0)}let ne=1,de=0;for(this[P]=k&255;++de<Q&&(ne*=256);)this[P+de]=k/ne&255;return P+Q},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(k,P,Q,K){if(k=+k,P=P>>>0,Q=Q>>>0,!K){const _e=Math.pow(2,8*Q)-1;Ae(this,k,P,Q,_e,0)}let ne=Q-1,de=1;for(this[P+ne]=k&255;--ne>=0&&(de*=256);)this[P+ne]=k/de&255;return P+Q},c.prototype.writeUint8=c.prototype.writeUInt8=function(k,P,Q){return k=+k,P=P>>>0,Q||Ae(this,k,P,1,255,0),this[P]=k&255,P+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(k,P,Q){return k=+k,P=P>>>0,Q||Ae(this,k,P,2,65535,0),this[P]=k&255,this[P+1]=k>>>8,P+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(k,P,Q){return k=+k,P=P>>>0,Q||Ae(this,k,P,2,65535,0),this[P]=k>>>8,this[P+1]=k&255,P+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(k,P,Q){return k=+k,P=P>>>0,Q||Ae(this,k,P,4,4294967295,0),this[P+3]=k>>>24,this[P+2]=k>>>16,this[P+1]=k>>>8,this[P]=k&255,P+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(k,P,Q){return k=+k,P=P>>>0,Q||Ae(this,k,P,4,4294967295,0),this[P]=k>>>24,this[P+1]=k>>>16,this[P+2]=k>>>8,this[P+3]=k&255,P+4};function te(U,k,P,Q,K){De(k,Q,K,U,P,7);let ne=Number(k&BigInt(4294967295));U[P++]=ne,ne=ne>>8,U[P++]=ne,ne=ne>>8,U[P++]=ne,ne=ne>>8,U[P++]=ne;let de=Number(k>>BigInt(32)&BigInt(4294967295));return U[P++]=de,de=de>>8,U[P++]=de,de=de>>8,U[P++]=de,de=de>>8,U[P++]=de,P}function F(U,k,P,Q,K){De(k,Q,K,U,P,7);let ne=Number(k&BigInt(4294967295));U[P+7]=ne,ne=ne>>8,U[P+6]=ne,ne=ne>>8,U[P+5]=ne,ne=ne>>8,U[P+4]=ne;let de=Number(k>>BigInt(32)&BigInt(4294967295));return U[P+3]=de,de=de>>8,U[P+2]=de,de=de>>8,U[P+1]=de,de=de>>8,U[P]=de,P+8}c.prototype.writeBigUInt64LE=at(function(k,P=0){return te(this,k,P,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=at(function(k,P=0){return F(this,k,P,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(k,P,Q,K){if(k=+k,P=P>>>0,!K){const Ne=Math.pow(2,8*Q-1);Ae(this,k,P,Q,Ne-1,-Ne)}let ne=0,de=1,_e=0;for(this[P]=k&255;++ne<Q&&(de*=256);)k<0&&_e===0&&this[P+ne-1]!==0&&(_e=1),this[P+ne]=(k/de>>0)-_e&255;return P+Q},c.prototype.writeIntBE=function(k,P,Q,K){if(k=+k,P=P>>>0,!K){const Ne=Math.pow(2,8*Q-1);Ae(this,k,P,Q,Ne-1,-Ne)}let ne=Q-1,de=1,_e=0;for(this[P+ne]=k&255;--ne>=0&&(de*=256);)k<0&&_e===0&&this[P+ne+1]!==0&&(_e=1),this[P+ne]=(k/de>>0)-_e&255;return P+Q},c.prototype.writeInt8=function(k,P,Q){return k=+k,P=P>>>0,Q||Ae(this,k,P,1,127,-128),k<0&&(k=255+k+1),this[P]=k&255,P+1},c.prototype.writeInt16LE=function(k,P,Q){return k=+k,P=P>>>0,Q||Ae(this,k,P,2,32767,-32768),this[P]=k&255,this[P+1]=k>>>8,P+2},c.prototype.writeInt16BE=function(k,P,Q){return k=+k,P=P>>>0,Q||Ae(this,k,P,2,32767,-32768),this[P]=k>>>8,this[P+1]=k&255,P+2},c.prototype.writeInt32LE=function(k,P,Q){return k=+k,P=P>>>0,Q||Ae(this,k,P,4,2147483647,-2147483648),this[P]=k&255,this[P+1]=k>>>8,this[P+2]=k>>>16,this[P+3]=k>>>24,P+4},c.prototype.writeInt32BE=function(k,P,Q){return k=+k,P=P>>>0,Q||Ae(this,k,P,4,2147483647,-2147483648),k<0&&(k=4294967295+k+1),this[P]=k>>>24,this[P+1]=k>>>16,this[P+2]=k>>>8,this[P+3]=k&255,P+4},c.prototype.writeBigInt64LE=at(function(k,P=0){return te(this,k,P,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=at(function(k,P=0){return F(this,k,P,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function x(U,k,P,Q,K,ne){if(P+Q>U.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("Index out of range")}function G(U,k,P,Q,K){return k=+k,P=P>>>0,K||x(U,k,P,4),n.write(U,k,P,Q,23,4),P+4}c.prototype.writeFloatLE=function(k,P,Q){return G(this,k,P,!0,Q)},c.prototype.writeFloatBE=function(k,P,Q){return G(this,k,P,!1,Q)};function H(U,k,P,Q,K){return k=+k,P=P>>>0,K||x(U,k,P,8),n.write(U,k,P,Q,52,8),P+8}c.prototype.writeDoubleLE=function(k,P,Q){return H(this,k,P,!0,Q)},c.prototype.writeDoubleBE=function(k,P,Q){return H(this,k,P,!1,Q)},c.prototype.copy=function(k,P,Q,K){if(!c.isBuffer(k))throw new TypeError("argument should be a Buffer");if(Q||(Q=0),!K&&K!==0&&(K=this.length),P>=k.length&&(P=k.length),P||(P=0),K>0&&K<Q&&(K=Q),K===Q||k.length===0||this.length===0)return 0;if(P<0)throw new RangeError("targetStart out of bounds");if(Q<0||Q>=this.length)throw new RangeError("Index out of range");if(K<0)throw new RangeError("sourceEnd out of bounds");K>this.length&&(K=this.length),k.length-P<K-Q&&(K=k.length-P+Q);const ne=K-Q;return this===k&&typeof o.prototype.copyWithin=="function"?this.copyWithin(P,Q,K):o.prototype.set.call(k,this.subarray(Q,K),P),ne},c.prototype.fill=function(k,P,Q,K){if(typeof k=="string"){if(typeof P=="string"?(K=P,P=0,Q=this.length):typeof Q=="string"&&(K=Q,Q=this.length),K!==void 0&&typeof K!="string")throw new TypeError("encoding must be a string");if(typeof K=="string"&&!c.isEncoding(K))throw new TypeError("Unknown encoding: "+K);if(k.length===1){const de=k.charCodeAt(0);(K==="utf8"&&de<128||K==="latin1")&&(k=de)}}else typeof k=="number"?k=k&255:typeof k=="boolean"&&(k=Number(k));if(P<0||this.length<P||this.length<Q)throw new RangeError("Out of range index");if(Q<=P)return this;P=P>>>0,Q=Q===void 0?this.length:Q>>>0,k||(k=0);let ne;if(typeof k=="number")for(ne=P;ne<Q;++ne)this[ne]=k;else{const de=c.isBuffer(k)?k:c.from(k,K),_e=de.length;if(_e===0)throw new TypeError('The value "'+k+'" is invalid for argument "value"');for(ne=0;ne<Q-P;++ne)this[ne+P]=de[ne%_e]}return this};const B={};function z(U,k,P){B[U]=class extends P{constructor(){super(),Object.defineProperty(this,"message",{value:k.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${U}]`,this.stack,delete this.name}get code(){return U}set code(K){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:K,writable:!0})}toString(){return`${this.name} [${U}]: ${this.message}`}}}z("ERR_BUFFER_OUT_OF_BOUNDS",function(U){return U?`${U} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),z("ERR_INVALID_ARG_TYPE",function(U,k){return`The "${U}" argument must be of type number. Received type ${typeof k}`},TypeError),z("ERR_OUT_OF_RANGE",function(U,k,P){let Q=`The value of "${U}" is out of range.`,K=P;return Number.isInteger(P)&&Math.abs(P)>2**32?K=ge(String(P)):typeof P=="bigint"&&(K=String(P),(P>BigInt(2)**BigInt(32)||P<-(BigInt(2)**BigInt(32)))&&(K=ge(K)),K+="n"),Q+=` It must be ${k}. Received ${K}`,Q},RangeError);function ge(U){let k="",P=U.length;const Q=U[0]==="-"?1:0;for(;P>=Q+4;P-=3)k=`_${U.slice(P-3,P)}${k}`;return`${U.slice(0,P)}${k}`}function Re(U,k,P){Ce(k,"offset"),(U[k]===void 0||U[k+P]===void 0)&&Ie(k,U.length-(P+1))}function De(U,k,P,Q,K,ne){if(U>P||U<k){const de=typeof k=="bigint"?"n":"";let _e;throw k===0||k===BigInt(0)?_e=`>= 0${de} and < 2${de} ** ${(ne+1)*8}${de}`:_e=`>= -(2${de} ** ${(ne+1)*8-1}${de}) and < 2 ** ${(ne+1)*8-1}${de}`,new B.ERR_OUT_OF_RANGE("value",_e,U)}Re(Q,K,ne)}function Ce(U,k){if(typeof U!="number")throw new B.ERR_INVALID_ARG_TYPE(k,"number",U)}function Ie(U,k,P){throw Math.floor(U)!==U?(Ce(U,P),new B.ERR_OUT_OF_RANGE("offset","an integer",U)):k<0?new B.ERR_BUFFER_OUT_OF_BOUNDS:new B.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${k}`,U)}const $e=/[^+/0-9A-Za-z-_]/g;function ye(U){if(U=U.split("=")[0],U=U.trim().replace($e,""),U.length<2)return"";for(;U.length%4!==0;)U=U+"=";return U}function Ke(U,k){k=k||1/0;let P;const Q=U.length;let K=null;const ne=[];for(let de=0;de<Q;++de){if(P=U.charCodeAt(de),P>55295&&P<57344){if(!K){if(P>56319){(k-=3)>-1&&ne.push(239,191,189);continue}else if(de+1===Q){(k-=3)>-1&&ne.push(239,191,189);continue}K=P;continue}if(P<56320){(k-=3)>-1&&ne.push(239,191,189),K=P;continue}P=(K-55296<<10|P-56320)+65536}else K&&(k-=3)>-1&&ne.push(239,191,189);if(K=null,P<128){if((k-=1)<0)break;ne.push(P)}else if(P<2048){if((k-=2)<0)break;ne.push(P>>6|192,P&63|128)}else if(P<65536){if((k-=3)<0)break;ne.push(P>>12|224,P>>6&63|128,P&63|128)}else if(P<1114112){if((k-=4)<0)break;ne.push(P>>18|240,P>>12&63|128,P>>6&63|128,P&63|128)}else throw new Error("Invalid code point")}return ne}function Ge(U){const k=[];for(let P=0;P<U.length;++P)k.push(U.charCodeAt(P)&255);return k}function Ye(U,k){let P,Q,K;const ne=[];for(let de=0;de<U.length&&!((k-=2)<0);++de)P=U.charCodeAt(de),Q=P>>8,K=P%256,ne.push(K),ne.push(Q);return ne}function Ze(U){return t.toByteArray(ye(U))}function wt(U,k,P,Q){let K;for(K=0;K<Q&&!(K+P>=k.length||K>=U.length);++K)k[K+P]=U[K];return K}function St(U,k){return U instanceof k||U!=null&&U.constructor!=null&&U.constructor.name!=null&&U.constructor.name===k.name}function Et(U){return U!==U}const Tt=(function(){const U="0123456789abcdef",k=new Array(256);for(let P=0;P<16;++P){const Q=P*16;for(let K=0;K<16;++K)k[Q+K]=U[P]+U[K]}return k})();function at(U){return typeof BigInt>"u"?vn:U}function vn(){throw new Error("BigInt not supported")}})(Em);const Kr=Em.Buffer;class ji extends Error{name="RuntimeError";constructor(t,...n){super([t,...n].filter(Boolean).join(", ")),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class Ux extends ji{name="ApiError"}const bc=(e,t="")=>{const n=document.createElement("a");n.style.display="none",document.body.appendChild(n),n.href=e,n.setAttribute("download",t),n.click(),document.body.removeChild(n)},wc=(e="")=>e.split("/").map(encodeURIComponent).join("/"),Vx=e=>{const t=[],n=(r,i="")=>Object.keys(r).forEach(o=>{Yl(r[o])?n(r[o],`${i}${o}.`):t.push(`${i}${o}`)});return n(e),t},Sc=e=>{const t=e.startsWith("v")?e.slice(1):e,[n,r]=t.split("-"),[i,o,s]=n.split(".").map(Number);return{major:i,minor:o,patch:s,pre:r}},Ec=(e,t)=>{const n=Sc(e),r=Sc(t);return n.major!==r.major?n.major-r.major:n.minor!==r.minor?n.minor-r.minor:n.patch!==r.patch?n.patch-r.patch:n.pre&&!r.pre?-1:!n.pre&&r.pre?1:n.pre&&r.pre?n.pre.localeCompare(r.pre):0};class qx{clientService;userStore;serverUrl;capability;available;constructor(t,n,r,i=ae([])){this.clientService=t,this.userStore=n,this.serverUrl=r,this.capability=M(()=>{const o=f(i).filter(s=>s.enabled).sort((s,a)=>Ec(a.version,s.version));return o.length?o[0]:null}),this.available=M(()=>!!f(this.capability)?.version)}async triggerDownload(t){if(!f(this.available))throw new ji("no archiver available");if((t.fileIds?.length||0)+(t.files?.length||0)===0)throw new ji("requested archive with empty list of resources");const n=this.buildDownloadUrl({...t});if(!n)throw new ji("download url could not be built");let r=t.publicToken?n:await this.clientService.ocs.signUrl(n,this.userStore.user?.onPremisesSamAccountName),i;if(t.publicLinkPassword)try{const o=await fetch(r,{headers:{...this.clientService.getRequestHeaders({useAuth:!1}),Authorization:"Basic "+Kr.from(["public",t.publicLinkPassword].join(":")).toString("base64")}});if(!o.ok)throw new re.HttpError("",o);const s=await o.blob();r=URL.createObjectURL(s),i=decodeURI(o.headers.get("content-disposition")?.split('"')[1])}catch{throw new Error("archive could not be fetched")}return bc(r,i),r}buildDownloadUrl(t){const n=[];return t.publicToken&&n.push(`public-token=${t.publicToken}`),n.push(...t.fileIds.map(r=>`id=${r}`)),this.url+"?"+n.join("&")}get url(){if(!this.available)throw new ji("no archiver available");const t=f(this.capability);return/^https?:\/\//i.test(t.archiver_url)?t.archiver_url:re.urlJoin(this.serverUrl,t.archiver_url)}}const zx=new uc({ttl:10*1e3,capacity:250}),Wx=new uc({ttl:10*1e3,capacity:250});class Hx{get avatarUrl(){return Wx}get filePreview(){return zx}}const Tc=new Hx;class Ac{accessToken;publicLinkToken;publicLinkPassword;constructor(t={}){this.accessToken=t.accessToken,this.publicLinkToken=t.publicLinkToken,this.publicLinkPassword=t.publicLinkPassword}getHeaders(){return{...this.publicLinkToken&&{"public-token":this.publicLinkToken},...this.publicLinkPassword&&{Authorization:"Basic "+Kr.from(["public",this.publicLinkPassword].join(":")).toString("base64")},...this.accessToken&&!this.publicLinkPassword&&!this.publicLinkToken&&{Authorization:"Bearer "+this.accessToken}}}}class xc{instance;cancelToken;constructor(t,n){this.cancelToken=fs.CancelToken.source(),this.instance=fs.create(t),n&&this.instance.interceptors.request.use(n)}cancel(t){this.cancelToken.cancel(t)}async delete(t,n,r){return await this.internalRequestWithData("delete",t,n,r)}get(t,n){return this.internalRequest("get",t,n)}head(t,n){return this.internalRequest("head",t,n)}options(t,n){return this.internalRequest("options",t,n)}patch(t,n,r){return this.internalRequestWithData("patch",t,n,r)}post(t,n,r){return this.internalRequestWithData("post",t,n,r)}put(t,n,r){return this.internalRequestWithData("put",t,n,r)}async request(t){const n=await this.instance.request(this.obtainConfig(t));return this.processResponse(n,t)}obtainConfig(t){return ko({cancelToken:this.cancelToken.token},t)}processResponse(t,n){if(n?.schema){const r=n.schema.parse(t.data);return{...t,data:r}}return t}async internalRequest(t,n,r){const i=await this.instance[t](n,this.obtainConfig(r));return this.processResponse(i,r)}async internalRequestWithData(t,n,r,i){const o=await this.instance[t](n,r,this.obtainConfig(i));return this.processResponse(o,i)}}class Kx extends Error{name="RetriableError"}const Gx=15e3;class Qx{url;fetchOptions;abortController;eventListenerMap;readyState;withCredentials;CONNECTING;OPEN;CLOSED;onerror;onmessage;onopen;constructor(t,n){this.url=t,this.fetchOptions=n,this.abortController=new AbortController,this.eventListenerMap={},this.readyState=this.CONNECTING,this.connect()}connect(){return TS.fetchEventSource(this.url,{openWhenHidden:!0,signal:this.abortController.signal,fetch:this.fetchProvider.bind(this),onopen:async()=>{const t=new Event("open");this.onopen?.bind(this)(t),this.readyState=this.OPEN},onmessage:t=>{const n=new MessageEvent("message",{data:t.data});this.onmessage?.bind(this)(n);const r=t.event;this.eventListenerMap[r]?.forEach(o=>o(n))},onclose:()=>{throw this.readyState=this.CLOSED,new Kx},onerror:t=>{console.error(t);const n=new CustomEvent("error",{detail:t});return this.onerror?.bind(this)(n),3e4+Math.floor(Math.random()*Gx)}})}fetchProvider(...t){const[n,r]=t,i={...r,...this.fetchOptions};return window.fetch(n,i)}close(){this.abortController.abort("closed")}addEventListener(t,n){this.eventListenerMap[t]=this.eventListenerMap[t]||[],this.eventListenerMap[t].push(n)}removeEventListener(t,n){this.eventListenerMap[t]=this.eventListenerMap[t]?.filter(r=>r!==n)}dispatchEvent(){throw new Error("Method not implemented.")}updateAccessToken(t){this.fetchOptions.headers.Authorization=`Bearer ${t}`}updateLanguage(t){this.fetchOptions.headers["Accept-Language"]=t,this.close(),this.connect()}}let Cc=null;const Xx=(e,t)=>(Cc||(Cc=new Qx(new URL("ocs/v2.php/apps/notifications/api/v1/notifications/sse",e).href,t)),Cc),Yx=(e,t)=>({headers:{Authorization:`Bearer ${e.accessToken}`,"Accept-Language":t,"X-Request-ID":Gt.v4(),"X-Requested-With":"XMLHttpRequest"}});class Jx{configStore;language;authStore;httpAuthenticatedClient;httpUnAuthenticatedClient;graphClient;ocsClient;webDavClient;initiatorId=Gt.v4();staticHeaders={"Initiator-ID":this.initiatorId,"X-Requested-With":"XMLHttpRequest"};constructor(t){this.configStore=t.configStore,this.language=t.language,this.authStore=t.authStore,this.initGraphClient(),this.initOcsClient(),this.initWebDavClient(),this.httpAuthenticatedClient=new xc({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.httpUnAuthenticatedClient=new xc({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},n=>(Object.assign(n.headers,this.getDynamicHeaders({useAuth:!1})),n))}get httpAuthenticated(){return this.httpAuthenticatedClient}get httpUnAuthenticated(){return this.httpUnAuthenticatedClient}get graphAuthenticated(){return this.graphClient}get sseAuthenticated(){return Xx(this.configStore.serverUrl,Yx({accessToken:this.authStore.accessToken},this.currentLanguage))}get ocs(){return this.ocsClient}get ocsUserContext(){return this.ocs}ocsPublicLinkContext(t){return this.ocs}get webdav(){return this.webDavClient}get currentLanguage(){return this.language.current}getRequestHeaders=({useAuth:t=!0}={})=>({...this.staticHeaders,...this.getDynamicHeaders({useAuth:t})});initGraphClient(){const t=fs.create({headers:this.staticHeaders});t.interceptors.request.use(n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.graphClient=re.graph(this.configStore.serverUrl,t)}initOcsClient(){const t=fs.create({headers:this.staticHeaders});t.interceptors.request.use(n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.ocsClient=re.ocs(this.configStore.serverUrl,t)}initWebDavClient(){this.webDavClient=re.webdav(this.configStore.serverUrl,()=>{const t={...this.staticHeaders,...this.getDynamicHeaders()};return this.authStore.publicLinkToken&&(t["public-token"]=this.authStore.publicLinkToken),this.authStore.publicLinkPassword&&(t.Authorization="Basic "+Kr.from(["public",this.authStore.publicLinkPassword].join(":")).toString("base64")),t})}getDynamicHeaders({useAuth:t=!0}={}){return{"Accept-Language":this.currentLanguage,"X-Request-ID":Gt.v4(),...t&&{Authorization:"Bearer "+this.authStore.accessToken}}}}class Am{topics;constructor(){this.topics=new Map}subscribe(t,n){const r={token:Gt.v4(),callback:n},i=[r,...this.topics.get(t)||[]];return this.topics.set(t,i),r.token}publish(t,n){(this.topics.get(t)||[]).forEach(i=>i.callback(n))}unsubscribe(t,n){this.topics.has(t)&&this.topics.set(t,this.topics.get(t).filter(r=>r.token!==n))}}const Je=new Am;class xm{static Shared="S";static Shareable="R";static Mounted="M";static Deletable="D";static Renameable="N";static Moveable="V";static Updateable="NV";static FileUpdateable="W";static FolderCreateable="CK";static Deny="Z";static SecureView="X"}const Ys=e=>({value:e,type:null}),Zx=e=>Ys(e),ht=e=>Ys(e),Js=e=>Ys(e),eC=e=>Ys(e),tC={Permissions:ht("permissions"),IsFavorite:Js("favorite"),FileId:ht("fileid"),FileParent:ht("file-parent"),Name:ht("name"),OwnerId:ht("owner-id"),OwnerDisplayName:ht("owner-display-name"),PrivateLink:ht("privatelink"),ContentLength:Js("getcontentlength"),ContentSize:Js("size"),LastModifiedDate:ht("getlastmodified"),Tags:Zx("tags"),Audio:{value:"audio",type:null},Location:{value:"location",type:null},Image:{value:"image",type:null},Photo:{value:"photo",type:null},ETag:ht("getetag"),MimeType:ht("getcontenttype"),ResourceType:eC("resourcetype"),LockDiscovery:{value:"lockdiscovery",type:null},LockOwner:ht("owner"),LockTime:ht("locktime"),ActiveLock:{value:"activelock",type:null},DownloadURL:ht("downloadURL"),Highlights:ht("highlights"),MetaPathForUser:ht("meta-path-for-user"),RemoteItemId:ht("remote-item-id"),HasPreview:Js("has-preview"),ShareId:ht("shareid"),ShareRoot:ht("shareroot"),ShareTypes:{value:"share-types",type:null},SharePermissions:ht("share-permissions"),TrashbinOriginalFilename:ht("trashbin-original-filename"),TrashbinOriginalLocation:ht("trashbin-original-location"),TrashbinDeletedDate:ht("trashbin-delete-datetime"),PublicLinkItemType:ht("public-link-item-type"),PublicLinkPermission:ht("public-link-permission"),PublicLinkExpiration:ht("public-link-expiration"),PublicLinkShareDate:ht("public-link-share-datetime"),PublicLinkShareOwner:ht("public-link-share-owner")},qe=Object.fromEntries(Object.entries(tC).map(([e,t])=>[e,t.value]));class Io{static Default=[qe.Permissions,qe.IsFavorite,qe.FileId,qe.FileParent,qe.Name,qe.LockDiscovery,qe.ActiveLock,qe.OwnerId,qe.OwnerDisplayName,qe.RemoteItemId,qe.ShareRoot,qe.ShareTypes,qe.PrivateLink,qe.ContentLength,qe.ContentSize,qe.LastModifiedDate,qe.ETag,qe.MimeType,qe.ResourceType,qe.Tags,qe.Audio,qe.Location,qe.Image,qe.Photo,qe.HasPreview];static PublicLink=Io.Default.concat([qe.PublicLinkItemType,qe.PublicLinkPermission,qe.PublicLinkExpiration,qe.PublicLinkShareDate,qe.PublicLinkShareOwner]);static Trashbin=[qe.ContentLength,qe.ResourceType,qe.TrashbinOriginalLocation,qe.TrashbinOriginalFilename,qe.TrashbinDeletedDate,qe.Permissions,qe.FileParent];static DavNamespace=[qe.ContentLength,qe.LastModifiedDate,qe.ETag,qe.MimeType,qe.ResourceType,qe.LockDiscovery,qe.ActiveLock]}var Rc={},Zs={exports:{}},Cm;function kc(){if(Cm)return Zs.exports;Cm=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(E,T,R){return Function.prototype.apply.call(E,T,R)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(E){return Object.getOwnPropertyNames(E).concat(Object.getOwnPropertySymbols(E))}:n=function(E){return Object.getOwnPropertyNames(E)};function r(h){console&&console.warn&&console.warn(h)}var i=Number.isNaN||function(E){return E!==E};function o(){o.init.call(this)}Zs.exports=o,Zs.exports.once=y,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(h){if(typeof h!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof h)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(h){if(typeof h!="number"||h<0||i(h))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+h+".");s=h}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(E){if(typeof E!="number"||E<0||i(E))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+E+".");return this._maxListeners=E,this};function l(h){return h._maxListeners===void 0?o.defaultMaxListeners:h._maxListeners}o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(E){for(var T=[],R=1;R<arguments.length;R++)T.push(arguments[R]);var C=E==="error",A=this._events;if(A!==void 0)C=C&&A.error===void 0;else if(!C)return!1;if(C){var D;if(T.length>0&&(D=T[0]),D instanceof Error)throw D;var V=new Error("Unhandled error."+(D?" ("+D.message+")":""));throw V.context=D,V}var O=A[E];if(O===void 0)return!1;if(typeof O=="function")t(O,this,T);else for(var N=O.length,W=b(O,N),R=0;R<N;++R)t(W[R],this,T);return!0};function u(h,E,T,R){var C,A,D;if(a(T),A=h._events,A===void 0?(A=h._events=Object.create(null),h._eventsCount=0):(A.newListener!==void 0&&(h.emit("newListener",E,T.listener?T.listener:T),A=h._events),D=A[E]),D===void 0)D=A[E]=T,++h._eventsCount;else if(typeof D=="function"?D=A[E]=R?[T,D]:[D,T]:R?D.unshift(T):D.push(T),C=l(h),C>0&&D.length>C&&!D.warned){D.warned=!0;var V=new Error("Possible EventEmitter memory leak detected. "+D.length+" "+String(E)+" listeners added. Use emitter.setMaxListeners() to increase limit");V.name="MaxListenersExceededWarning",V.emitter=h,V.type=E,V.count=D.length,r(V)}return h}o.prototype.addListener=function(E,T){return u(this,E,T,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(E,T){return u(this,E,T,!0)};function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(h,E,T){var R={fired:!1,wrapFn:void 0,target:h,type:E,listener:T},C=c.bind(R);return C.listener=T,R.wrapFn=C,C}o.prototype.once=function(E,T){return a(T),this.on(E,d(this,E,T)),this},o.prototype.prependOnceListener=function(E,T){return a(T),this.prependListener(E,d(this,E,T)),this},o.prototype.removeListener=function(E,T){var R,C,A,D,V;if(a(T),C=this._events,C===void 0)return this;if(R=C[E],R===void 0)return this;if(R===T||R.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete C[E],C.removeListener&&this.emit("removeListener",E,R.listener||T));else if(typeof R!="function"){for(A=-1,D=R.length-1;D>=0;D--)if(R[D]===T||R[D].listener===T){V=R[D].listener,A=D;break}if(A<0)return this;A===0?R.shift():w(R,A),R.length===1&&(C[E]=R[0]),C.removeListener!==void 0&&this.emit("removeListener",E,V||T)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(E){var T,R,C;if(R=this._events,R===void 0)return this;if(R.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):R[E]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete R[E]),this;if(arguments.length===0){var A=Object.keys(R),D;for(C=0;C<A.length;++C)D=A[C],D!=="removeListener"&&this.removeAllListeners(D);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=R[E],typeof T=="function")this.removeListener(E,T);else if(T!==void 0)for(C=T.length-1;C>=0;C--)this.removeListener(E,T[C]);return this};function p(h,E,T){var R=h._events;if(R===void 0)return[];var C=R[E];return C===void 0?[]:typeof C=="function"?T?[C.listener||C]:[C]:T?S(C):b(C,C.length)}o.prototype.listeners=function(E){return p(this,E,!0)},o.prototype.rawListeners=function(E){return p(this,E,!1)},o.listenerCount=function(h,E){return typeof h.listenerCount=="function"?h.listenerCount(E):m.call(h,E)},o.prototype.listenerCount=m;function m(h){var E=this._events;if(E!==void 0){var T=E[h];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function b(h,E){for(var T=new Array(E),R=0;R<E;++R)T[R]=h[R];return T}function w(h,E){for(;E+1<h.length;E++)h[E]=h[E+1];h.pop()}function S(h){for(var E=new Array(h.length),T=0;T<E.length;++T)E[T]=h[T].listener||h[T];return E}function y(h,E){return new Promise(function(T,R){function C(D){h.removeListener(E,A),R(D)}function A(){typeof h.removeListener=="function"&&h.removeListener("error",C),T([].slice.call(arguments))}v(h,E,A,{once:!0}),E!=="error"&&g(h,C,{once:!0})})}function g(h,E,T){typeof h.on=="function"&&v(h,"error",E,T)}function v(h,E,T,R){if(typeof h.on=="function")R.once?h.once(E,T):h.on(E,T);else if(typeof h.addEventListener=="function")h.addEventListener(E,function C(A){R.once&&h.removeEventListener(E,C),T(A)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof h)}return Zs.exports}var ea={exports:{}},Rm;function ci(){return Rm||(Rm=1,typeof Object.create=="function"?ea.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:ea.exports=function(t,n){if(n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t}}),ea.exports}var Pc,km;function Pm(){return km||(km=1,Pc=kc().EventEmitter),Pc}var Ic={},Im;function ta(){return Im||(Im=1,(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t={},n={};n.byteLength=c,n.toByteArray=p,n.fromByteArray=w;for(var r=[],i=[],o=typeof Uint8Array<"u"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=s.length;a<l;++a)r[a]=s[a],i[s.charCodeAt(a)]=a;i[45]=62,i[95]=63;function u(g){var v=g.length;if(v%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var h=g.indexOf("=");h===-1&&(h=v);var E=h===v?0:4-h%4;return[h,E]}function c(g){var v=u(g),h=v[0],E=v[1];return(h+E)*3/4-E}function d(g,v,h){return(v+h)*3/4-h}function p(g){var v,h=u(g),E=h[0],T=h[1],R=new o(d(g,E,T)),C=0,A=T>0?E-4:E,D;for(D=0;D<A;D+=4)v=i[g.charCodeAt(D)]<<18|i[g.charCodeAt(D+1)]<<12|i[g.charCodeAt(D+2)]<<6|i[g.charCodeAt(D+3)],R[C++]=v>>16&255,R[C++]=v>>8&255,R[C++]=v&255;return T===2&&(v=i[g.charCodeAt(D)]<<2|i[g.charCodeAt(D+1)]>>4,R[C++]=v&255),T===1&&(v=i[g.charCodeAt(D)]<<10|i[g.charCodeAt(D+1)]<<4|i[g.charCodeAt(D+2)]>>2,R[C++]=v>>8&255,R[C++]=v&255),R}function m(g){return r[g>>18&63]+r[g>>12&63]+r[g>>6&63]+r[g&63]}function b(g,v,h){for(var E,T=[],R=v;R<h;R+=3)E=(g[R]<<16&16711680)+(g[R+1]<<8&65280)+(g[R+2]&255),T.push(m(E));return T.join("")}function w(g){for(var v,h=g.length,E=h%3,T=[],R=16383,C=0,A=h-E;C<A;C+=R)T.push(b(g,C,C+R>A?A:C+R));return E===1?(v=g[h-1],T.push(r[v>>2]+r[v<<4&63]+"==")):E===2&&(v=(g[h-2]<<8)+g[h-1],T.push(r[v>>10]+r[v>>4&63]+r[v<<2&63]+"=")),T.join("")}var S={};S.read=function(g,v,h,E,T){var R,C,A=T*8-E-1,D=(1<<A)-1,V=D>>1,O=-7,N=h?T-1:0,W=h?-1:1,L=g[v+N];for(N+=W,R=L&(1<<-O)-1,L>>=-O,O+=A;O>0;R=R*256+g[v+N],N+=W,O-=8);for(C=R&(1<<-O)-1,R>>=-O,O+=E;O>0;C=C*256+g[v+N],N+=W,O-=8);if(R===0)R=1-V;else{if(R===D)return C?NaN:(L?-1:1)*(1/0);C=C+Math.pow(2,E),R=R-V}return(L?-1:1)*C*Math.pow(2,R-E)},S.write=function(g,v,h,E,T,R){var C,A,D,V=R*8-T-1,O=(1<<V)-1,N=O>>1,W=T===23?Math.pow(2,-24)-Math.pow(2,-77):0,L=E?0:R-1,ee=E?1:-1,J=v<0||v===0&&1/v<0?1:0;for(v=Math.abs(v),isNaN(v)||v===1/0?(A=isNaN(v)?1:0,C=O):(C=Math.floor(Math.log(v)/Math.LN2),v*(D=Math.pow(2,-C))<1&&(C--,D*=2),C+N>=1?v+=W/D:v+=W*Math.pow(2,1-N),v*D>=2&&(C++,D/=2),C+N>=O?(A=0,C=O):C+N>=1?(A=(v*D-1)*Math.pow(2,T),C=C+N):(A=v*Math.pow(2,N-1)*Math.pow(2,T),C=0));T>=8;g[h+L]=A&255,L+=ee,A/=256,T-=8);for(C=C<<T|A,V+=T;V>0;g[h+L]=C&255,L+=ee,C/=256,V-=8);g[h+L-ee]|=J*128};(function(g){const v=n,h=S,E=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;g.Buffer=O,g.SlowBuffer=ie,g.INSPECT_MAX_BYTES=50;const T=2147483647;g.kMaxLength=T;const{Uint8Array:R,ArrayBuffer:C,SharedArrayBuffer:A}=globalThis;O.TYPED_ARRAY_SUPPORT=D(),!O.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function D(){try{const j=new R(1),I={foo:function(){return 42}};return Object.setPrototypeOf(I,R.prototype),Object.setPrototypeOf(j,I),j.foo()===42}catch{return!1}}Object.defineProperty(O.prototype,"parent",{enumerable:!0,get:function(){if(O.isBuffer(this))return this.buffer}}),Object.defineProperty(O.prototype,"offset",{enumerable:!0,get:function(){if(O.isBuffer(this))return this.byteOffset}});function V(j){if(j>T)throw new RangeError('The value "'+j+'" is invalid for option "size"');const I=new R(j);return Object.setPrototypeOf(I,O.prototype),I}function O(j,I,_){if(typeof j=="number"){if(typeof I=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return ee(j)}return N(j,I,_)}O.poolSize=8192;function N(j,I,_){if(typeof j=="string")return J(j,I);if(C.isView(j))return he(j);if(j==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof j);if(Ut(j,C)||j&&Ut(j.buffer,C)||typeof A<"u"&&(Ut(j,A)||j&&Ut(j.buffer,A)))return oe(j,I,_);if(typeof j=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Z=j.valueOf&&j.valueOf();if(Z!=null&&Z!==j)return O.from(Z,I,_);const ce=we(j);if(ce)return ce;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof j[Symbol.toPrimitive]=="function")return O.from(j[Symbol.toPrimitive]("string"),I,_);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof j)}O.from=function(j,I,_){return N(j,I,_)},Object.setPrototypeOf(O.prototype,R.prototype),Object.setPrototypeOf(O,R);function W(j){if(typeof j!="number")throw new TypeError('"size" argument must be of type number');if(j<0)throw new RangeError('The value "'+j+'" is invalid for option "size"')}function L(j,I,_){return W(j),j<=0?V(j):I!==void 0?typeof _=="string"?V(j).fill(I,_):V(j).fill(I):V(j)}O.alloc=function(j,I,_){return L(j,I,_)};function ee(j){return W(j),V(j<0?0:X(j)|0)}O.allocUnsafe=function(j){return ee(j)},O.allocUnsafeSlow=function(j){return ee(j)};function J(j,I){if((typeof I!="string"||I==="")&&(I="utf8"),!O.isEncoding(I))throw new TypeError("Unknown encoding: "+I);const _=le(j,I)|0;let Z=V(_);const ce=Z.write(j,I);return ce!==_&&(Z=Z.slice(0,ce)),Z}function se(j){const I=j.length<0?0:X(j.length)|0,_=V(I);for(let Z=0;Z<I;Z+=1)_[Z]=j[Z]&255;return _}function he(j){if(Ut(j,R)){const I=new R(j);return oe(I.buffer,I.byteOffset,I.byteLength)}return se(j)}function oe(j,I,_){if(I<0||j.byteLength<I)throw new RangeError('"offset" is outside of buffer bounds');if(j.byteLength<I+(_||0))throw new RangeError('"length" is outside of buffer bounds');let Z;return I===void 0&&_===void 0?Z=new R(j):_===void 0?Z=new R(j,I):Z=new R(j,I,_),Object.setPrototypeOf(Z,O.prototype),Z}function we(j){if(O.isBuffer(j)){const I=X(j.length)|0,_=V(I);return _.length===0||j.copy(_,0,0,I),_}if(j.length!==void 0)return typeof j.length!="number"||Nr(j.length)?V(0):se(j);if(j.type==="Buffer"&&Array.isArray(j.data))return se(j.data)}function X(j){if(j>=T)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+T.toString(16)+" bytes");return j|0}function ie(j){return+j!=j&&(j=0),O.alloc(+j)}O.isBuffer=function(I){return I!=null&&I._isBuffer===!0&&I!==O.prototype},O.compare=function(I,_){if(Ut(I,R)&&(I=O.from(I,I.offset,I.byteLength)),Ut(_,R)&&(_=O.from(_,_.offset,_.byteLength)),!O.isBuffer(I)||!O.isBuffer(_))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(I===_)return 0;let Z=I.length,ce=_.length;for(let Se=0,Pe=Math.min(Z,ce);Se<Pe;++Se)if(I[Se]!==_[Se]){Z=I[Se],ce=_[Se];break}return Z<ce?-1:ce<Z?1:0},O.isEncoding=function(I){switch(String(I).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},O.concat=function(I,_){if(!Array.isArray(I))throw new TypeError('"list" argument must be an Array of Buffers');if(I.length===0)return O.alloc(0);let Z;if(_===void 0)for(_=0,Z=0;Z<I.length;++Z)_+=I[Z].length;const ce=O.allocUnsafe(_);let Se=0;for(Z=0;Z<I.length;++Z){let Pe=I[Z];if(Ut(Pe,R))Se+Pe.length>ce.length?(O.isBuffer(Pe)||(Pe=O.from(Pe)),Pe.copy(ce,Se)):R.prototype.set.call(ce,Pe,Se);else if(O.isBuffer(Pe))Pe.copy(ce,Se);else throw new TypeError('"list" argument must be an Array of Buffers');Se+=Pe.length}return ce};function le(j,I){if(O.isBuffer(j))return j.length;if(C.isView(j)||Ut(j,C))return j.byteLength;if(typeof j!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof j);const _=j.length,Z=arguments.length>2&&arguments[2]===!0;if(!Z&&_===0)return 0;let ce=!1;for(;;)switch(I){case"ascii":case"latin1":case"binary":return _;case"utf8":case"utf-8":return Ne(j).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _*2;case"hex":return _>>>1;case"base64":return Qe(j).length;default:if(ce)return Z?-1:Ne(j).length;I=(""+I).toLowerCase(),ce=!0}}O.byteLength=le;function Ae(j,I,_){let Z=!1;if((I===void 0||I<0)&&(I=0),I>this.length||((_===void 0||_>this.length)&&(_=this.length),_<=0)||(_>>>=0,I>>>=0,_<=I))return"";for(j||(j="utf8");;)switch(j){case"hex":return Ke(this,I,_);case"utf8":case"utf-8":return De(this,I,_);case"ascii":return $e(this,I,_);case"latin1":case"binary":return ye(this,I,_);case"base64":return Re(this,I,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ge(this,I,_);default:if(Z)throw new TypeError("Unknown encoding: "+j);j=(j+"").toLowerCase(),Z=!0}}O.prototype._isBuffer=!0;function te(j,I,_){const Z=j[I];j[I]=j[_],j[_]=Z}O.prototype.swap16=function(){const I=this.length;if(I%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let _=0;_<I;_+=2)te(this,_,_+1);return this},O.prototype.swap32=function(){const I=this.length;if(I%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let _=0;_<I;_+=4)te(this,_,_+3),te(this,_+1,_+2);return this},O.prototype.swap64=function(){const I=this.length;if(I%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let _=0;_<I;_+=8)te(this,_,_+7),te(this,_+1,_+6),te(this,_+2,_+5),te(this,_+3,_+4);return this},O.prototype.toString=function(){const I=this.length;return I===0?"":arguments.length===0?De(this,0,I):Ae.apply(this,arguments)},O.prototype.toLocaleString=O.prototype.toString,O.prototype.equals=function(I){if(!O.isBuffer(I))throw new TypeError("Argument must be a Buffer");return this===I?!0:O.compare(this,I)===0},O.prototype.inspect=function(){let I="";const _=g.INSPECT_MAX_BYTES;return I=this.toString("hex",0,_).replace(/(.{2})/g,"$1 ").trim(),this.length>_&&(I+=" ... "),"<Buffer "+I+">"},E&&(O.prototype[E]=O.prototype.inspect),O.prototype.compare=function(I,_,Z,ce,Se){if(Ut(I,R)&&(I=O.from(I,I.offset,I.byteLength)),!O.isBuffer(I))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof I);if(_===void 0&&(_=0),Z===void 0&&(Z=I?I.length:0),ce===void 0&&(ce=0),Se===void 0&&(Se=this.length),_<0||Z>I.length||ce<0||Se>this.length)throw new RangeError("out of range index");if(ce>=Se&&_>=Z)return 0;if(ce>=Se)return-1;if(_>=Z)return 1;if(_>>>=0,Z>>>=0,ce>>>=0,Se>>>=0,this===I)return 0;let Pe=Se-ce,nt=Z-_;const Dt=Math.min(Pe,nt),Pt=this.slice(ce,Se),Nt=I.slice(_,Z);for(let vt=0;vt<Dt;++vt)if(Pt[vt]!==Nt[vt]){Pe=Pt[vt],nt=Nt[vt];break}return Pe<nt?-1:nt<Pe?1:0};function F(j,I,_,Z,ce){if(j.length===0)return-1;if(typeof _=="string"?(Z=_,_=0):_>2147483647?_=2147483647:_<-2147483648&&(_=-2147483648),_=+_,Nr(_)&&(_=ce?0:j.length-1),_<0&&(_=j.length+_),_>=j.length){if(ce)return-1;_=j.length-1}else if(_<0)if(ce)_=0;else return-1;if(typeof I=="string"&&(I=O.from(I,Z)),O.isBuffer(I))return I.length===0?-1:x(j,I,_,Z,ce);if(typeof I=="number")return I=I&255,typeof R.prototype.indexOf=="function"?ce?R.prototype.indexOf.call(j,I,_):R.prototype.lastIndexOf.call(j,I,_):x(j,[I],_,Z,ce);throw new TypeError("val must be string, number or Buffer")}function x(j,I,_,Z,ce){let Se=1,Pe=j.length,nt=I.length;if(Z!==void 0&&(Z=String(Z).toLowerCase(),Z==="ucs2"||Z==="ucs-2"||Z==="utf16le"||Z==="utf-16le")){if(j.length<2||I.length<2)return-1;Se=2,Pe/=2,nt/=2,_/=2}function Dt(Nt,vt){return Se===1?Nt[vt]:Nt.readUInt16BE(vt*Se)}let Pt;if(ce){let Nt=-1;for(Pt=_;Pt<Pe;Pt++)if(Dt(j,Pt)===Dt(I,Nt===-1?0:Pt-Nt)){if(Nt===-1&&(Nt=Pt),Pt-Nt+1===nt)return Nt*Se}else Nt!==-1&&(Pt-=Pt-Nt),Nt=-1}else for(_+nt>Pe&&(_=Pe-nt),Pt=_;Pt>=0;Pt--){let Nt=!0;for(let vt=0;vt<nt;vt++)if(Dt(j,Pt+vt)!==Dt(I,vt)){Nt=!1;break}if(Nt)return Pt}return-1}O.prototype.includes=function(I,_,Z){return this.indexOf(I,_,Z)!==-1},O.prototype.indexOf=function(I,_,Z){return F(this,I,_,Z,!0)},O.prototype.lastIndexOf=function(I,_,Z){return F(this,I,_,Z,!1)};function G(j,I,_,Z){_=Number(_)||0;const ce=j.length-_;Z?(Z=Number(Z),Z>ce&&(Z=ce)):Z=ce;const Se=I.length;Z>Se/2&&(Z=Se/2);let Pe;for(Pe=0;Pe<Z;++Pe){const nt=parseInt(I.substr(Pe*2,2),16);if(Nr(nt))return Pe;j[_+Pe]=nt}return Pe}function H(j,I,_,Z){return nn(Ne(I,j.length-_),j,_,Z)}function B(j,I,_,Z){return nn(xe(I),j,_,Z)}function z(j,I,_,Z){return nn(Qe(I),j,_,Z)}function ge(j,I,_,Z){return nn(Be(I,j.length-_),j,_,Z)}O.prototype.write=function(I,_,Z,ce){if(_===void 0)ce="utf8",Z=this.length,_=0;else if(Z===void 0&&typeof _=="string")ce=_,Z=this.length,_=0;else if(isFinite(_))_=_>>>0,isFinite(Z)?(Z=Z>>>0,ce===void 0&&(ce="utf8")):(ce=Z,Z=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Se=this.length-_;if((Z===void 0||Z>Se)&&(Z=Se),I.length>0&&(Z<0||_<0)||_>this.length)throw new RangeError("Attempt to write outside buffer bounds");ce||(ce="utf8");let Pe=!1;for(;;)switch(ce){case"hex":return G(this,I,_,Z);case"utf8":case"utf-8":return H(this,I,_,Z);case"ascii":case"latin1":case"binary":return B(this,I,_,Z);case"base64":return z(this,I,_,Z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ge(this,I,_,Z);default:if(Pe)throw new TypeError("Unknown encoding: "+ce);ce=(""+ce).toLowerCase(),Pe=!0}},O.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Re(j,I,_){return I===0&&_===j.length?v.fromByteArray(j):v.fromByteArray(j.slice(I,_))}function De(j,I,_){_=Math.min(j.length,_);const Z=[];let ce=I;for(;ce<_;){const Se=j[ce];let Pe=null,nt=Se>239?4:Se>223?3:Se>191?2:1;if(ce+nt<=_){let Dt,Pt,Nt,vt;switch(nt){case 1:Se<128&&(Pe=Se);break;case 2:Dt=j[ce+1],(Dt&192)===128&&(vt=(Se&31)<<6|Dt&63,vt>127&&(Pe=vt));break;case 3:Dt=j[ce+1],Pt=j[ce+2],(Dt&192)===128&&(Pt&192)===128&&(vt=(Se&15)<<12|(Dt&63)<<6|Pt&63,vt>2047&&(vt<55296||vt>57343)&&(Pe=vt));break;case 4:Dt=j[ce+1],Pt=j[ce+2],Nt=j[ce+3],(Dt&192)===128&&(Pt&192)===128&&(Nt&192)===128&&(vt=(Se&15)<<18|(Dt&63)<<12|(Pt&63)<<6|Nt&63,vt>65535&&vt<1114112&&(Pe=vt))}}Pe===null?(Pe=65533,nt=1):Pe>65535&&(Pe-=65536,Z.push(Pe>>>10&1023|55296),Pe=56320|Pe&1023),Z.push(Pe),ce+=nt}return Ie(Z)}const Ce=4096;function Ie(j){const I=j.length;if(I<=Ce)return String.fromCharCode.apply(String,j);let _="",Z=0;for(;Z<I;)_+=String.fromCharCode.apply(String,j.slice(Z,Z+=Ce));return _}function $e(j,I,_){let Z="";_=Math.min(j.length,_);for(let ce=I;ce<_;++ce)Z+=String.fromCharCode(j[ce]&127);return Z}function ye(j,I,_){let Z="";_=Math.min(j.length,_);for(let ce=I;ce<_;++ce)Z+=String.fromCharCode(j[ce]);return Z}function Ke(j,I,_){const Z=j.length;(!I||I<0)&&(I=0),(!_||_<0||_>Z)&&(_=Z);let ce="";for(let Se=I;Se<_;++Se)ce+=Le[j[Se]];return ce}function Ge(j,I,_){const Z=j.slice(I,_);let ce="";for(let Se=0;Se<Z.length-1;Se+=2)ce+=String.fromCharCode(Z[Se]+Z[Se+1]*256);return ce}O.prototype.slice=function(I,_){const Z=this.length;I=~~I,_=_===void 0?Z:~~_,I<0?(I+=Z,I<0&&(I=0)):I>Z&&(I=Z),_<0?(_+=Z,_<0&&(_=0)):_>Z&&(_=Z),_<I&&(_=I);const ce=this.subarray(I,_);return Object.setPrototypeOf(ce,O.prototype),ce};function Ye(j,I,_){if(j%1!==0||j<0)throw new RangeError("offset is not uint");if(j+I>_)throw new RangeError("Trying to access beyond buffer length")}O.prototype.readUintLE=O.prototype.readUIntLE=function(I,_,Z){I=I>>>0,_=_>>>0,Z||Ye(I,_,this.length);let ce=this[I],Se=1,Pe=0;for(;++Pe<_&&(Se*=256);)ce+=this[I+Pe]*Se;return ce},O.prototype.readUintBE=O.prototype.readUIntBE=function(I,_,Z){I=I>>>0,_=_>>>0,Z||Ye(I,_,this.length);let ce=this[I+--_],Se=1;for(;_>0&&(Se*=256);)ce+=this[I+--_]*Se;return ce},O.prototype.readUint8=O.prototype.readUInt8=function(I,_){return I=I>>>0,_||Ye(I,1,this.length),this[I]},O.prototype.readUint16LE=O.prototype.readUInt16LE=function(I,_){return I=I>>>0,_||Ye(I,2,this.length),this[I]|this[I+1]<<8},O.prototype.readUint16BE=O.prototype.readUInt16BE=function(I,_){return I=I>>>0,_||Ye(I,2,this.length),this[I]<<8|this[I+1]},O.prototype.readUint32LE=O.prototype.readUInt32LE=function(I,_){return I=I>>>0,_||Ye(I,4,this.length),(this[I]|this[I+1]<<8|this[I+2]<<16)+this[I+3]*16777216},O.prototype.readUint32BE=O.prototype.readUInt32BE=function(I,_){return I=I>>>0,_||Ye(I,4,this.length),this[I]*16777216+(this[I+1]<<16|this[I+2]<<8|this[I+3])},O.prototype.readBigUInt64LE=Ue(function(I){I=I>>>0,K(I,"offset");const _=this[I],Z=this[I+7];(_===void 0||Z===void 0)&&ne(I,this.length-8);const ce=_+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24,Se=this[++I]+this[++I]*2**8+this[++I]*2**16+Z*2**24;return BigInt(ce)+(BigInt(Se)<<BigInt(32))}),O.prototype.readBigUInt64BE=Ue(function(I){I=I>>>0,K(I,"offset");const _=this[I],Z=this[I+7];(_===void 0||Z===void 0)&&ne(I,this.length-8);const ce=_*2**24+this[++I]*2**16+this[++I]*2**8+this[++I],Se=this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+Z;return(BigInt(ce)<<BigInt(32))+BigInt(Se)}),O.prototype.readIntLE=function(I,_,Z){I=I>>>0,_=_>>>0,Z||Ye(I,_,this.length);let ce=this[I],Se=1,Pe=0;for(;++Pe<_&&(Se*=256);)ce+=this[I+Pe]*Se;return Se*=128,ce>=Se&&(ce-=Math.pow(2,8*_)),ce},O.prototype.readIntBE=function(I,_,Z){I=I>>>0,_=_>>>0,Z||Ye(I,_,this.length);let ce=_,Se=1,Pe=this[I+--ce];for(;ce>0&&(Se*=256);)Pe+=this[I+--ce]*Se;return Se*=128,Pe>=Se&&(Pe-=Math.pow(2,8*_)),Pe},O.prototype.readInt8=function(I,_){return I=I>>>0,_||Ye(I,1,this.length),this[I]&128?(255-this[I]+1)*-1:this[I]},O.prototype.readInt16LE=function(I,_){I=I>>>0,_||Ye(I,2,this.length);const Z=this[I]|this[I+1]<<8;return Z&32768?Z|4294901760:Z},O.prototype.readInt16BE=function(I,_){I=I>>>0,_||Ye(I,2,this.length);const Z=this[I+1]|this[I]<<8;return Z&32768?Z|4294901760:Z},O.prototype.readInt32LE=function(I,_){return I=I>>>0,_||Ye(I,4,this.length),this[I]|this[I+1]<<8|this[I+2]<<16|this[I+3]<<24},O.prototype.readInt32BE=function(I,_){return I=I>>>0,_||Ye(I,4,this.length),this[I]<<24|this[I+1]<<16|this[I+2]<<8|this[I+3]},O.prototype.readBigInt64LE=Ue(function(I){I=I>>>0,K(I,"offset");const _=this[I],Z=this[I+7];(_===void 0||Z===void 0)&&ne(I,this.length-8);const ce=this[I+4]+this[I+5]*2**8+this[I+6]*2**16+(Z<<24);return(BigInt(ce)<<BigInt(32))+BigInt(_+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24)}),O.prototype.readBigInt64BE=Ue(function(I){I=I>>>0,K(I,"offset");const _=this[I],Z=this[I+7];(_===void 0||Z===void 0)&&ne(I,this.length-8);const ce=(_<<24)+this[++I]*2**16+this[++I]*2**8+this[++I];return(BigInt(ce)<<BigInt(32))+BigInt(this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+Z)}),O.prototype.readFloatLE=function(I,_){return I=I>>>0,_||Ye(I,4,this.length),h.read(this,I,!0,23,4)},O.prototype.readFloatBE=function(I,_){return I=I>>>0,_||Ye(I,4,this.length),h.read(this,I,!1,23,4)},O.prototype.readDoubleLE=function(I,_){return I=I>>>0,_||Ye(I,8,this.length),h.read(this,I,!0,52,8)},O.prototype.readDoubleBE=function(I,_){return I=I>>>0,_||Ye(I,8,this.length),h.read(this,I,!1,52,8)};function Ze(j,I,_,Z,ce,Se){if(!O.isBuffer(j))throw new TypeError('"buffer" argument must be a Buffer instance');if(I>ce||I<Se)throw new RangeError('"value" argument is out of bounds');if(_+Z>j.length)throw new RangeError("Index out of range")}O.prototype.writeUintLE=O.prototype.writeUIntLE=function(I,_,Z,ce){if(I=+I,_=_>>>0,Z=Z>>>0,!ce){const nt=Math.pow(2,8*Z)-1;Ze(this,I,_,Z,nt,0)}let Se=1,Pe=0;for(this[_]=I&255;++Pe<Z&&(Se*=256);)this[_+Pe]=I/Se&255;return _+Z},O.prototype.writeUintBE=O.prototype.writeUIntBE=function(I,_,Z,ce){if(I=+I,_=_>>>0,Z=Z>>>0,!ce){const nt=Math.pow(2,8*Z)-1;Ze(this,I,_,Z,nt,0)}let Se=Z-1,Pe=1;for(this[_+Se]=I&255;--Se>=0&&(Pe*=256);)this[_+Se]=I/Pe&255;return _+Z},O.prototype.writeUint8=O.prototype.writeUInt8=function(I,_,Z){return I=+I,_=_>>>0,Z||Ze(this,I,_,1,255,0),this[_]=I&255,_+1},O.prototype.writeUint16LE=O.prototype.writeUInt16LE=function(I,_,Z){return I=+I,_=_>>>0,Z||Ze(this,I,_,2,65535,0),this[_]=I&255,this[_+1]=I>>>8,_+2},O.prototype.writeUint16BE=O.prototype.writeUInt16BE=function(I,_,Z){return I=+I,_=_>>>0,Z||Ze(this,I,_,2,65535,0),this[_]=I>>>8,this[_+1]=I&255,_+2},O.prototype.writeUint32LE=O.prototype.writeUInt32LE=function(I,_,Z){return I=+I,_=_>>>0,Z||Ze(this,I,_,4,4294967295,0),this[_+3]=I>>>24,this[_+2]=I>>>16,this[_+1]=I>>>8,this[_]=I&255,_+4},O.prototype.writeUint32BE=O.prototype.writeUInt32BE=function(I,_,Z){return I=+I,_=_>>>0,Z||Ze(this,I,_,4,4294967295,0),this[_]=I>>>24,this[_+1]=I>>>16,this[_+2]=I>>>8,this[_+3]=I&255,_+4};function wt(j,I,_,Z,ce){Q(I,Z,ce,j,_,7);let Se=Number(I&BigInt(4294967295));j[_++]=Se,Se=Se>>8,j[_++]=Se,Se=Se>>8,j[_++]=Se,Se=Se>>8,j[_++]=Se;let Pe=Number(I>>BigInt(32)&BigInt(4294967295));return j[_++]=Pe,Pe=Pe>>8,j[_++]=Pe,Pe=Pe>>8,j[_++]=Pe,Pe=Pe>>8,j[_++]=Pe,_}function St(j,I,_,Z,ce){Q(I,Z,ce,j,_,7);let Se=Number(I&BigInt(4294967295));j[_+7]=Se,Se=Se>>8,j[_+6]=Se,Se=Se>>8,j[_+5]=Se,Se=Se>>8,j[_+4]=Se;let Pe=Number(I>>BigInt(32)&BigInt(4294967295));return j[_+3]=Pe,Pe=Pe>>8,j[_+2]=Pe,Pe=Pe>>8,j[_+1]=Pe,Pe=Pe>>8,j[_]=Pe,_+8}O.prototype.writeBigUInt64LE=Ue(function(I,_=0){return wt(this,I,_,BigInt(0),BigInt("0xffffffffffffffff"))}),O.prototype.writeBigUInt64BE=Ue(function(I,_=0){return St(this,I,_,BigInt(0),BigInt("0xffffffffffffffff"))}),O.prototype.writeIntLE=function(I,_,Z,ce){if(I=+I,_=_>>>0,!ce){const Dt=Math.pow(2,8*Z-1);Ze(this,I,_,Z,Dt-1,-Dt)}let Se=0,Pe=1,nt=0;for(this[_]=I&255;++Se<Z&&(Pe*=256);)I<0&&nt===0&&this[_+Se-1]!==0&&(nt=1),this[_+Se]=(I/Pe>>0)-nt&255;return _+Z},O.prototype.writeIntBE=function(I,_,Z,ce){if(I=+I,_=_>>>0,!ce){const Dt=Math.pow(2,8*Z-1);Ze(this,I,_,Z,Dt-1,-Dt)}let Se=Z-1,Pe=1,nt=0;for(this[_+Se]=I&255;--Se>=0&&(Pe*=256);)I<0&&nt===0&&this[_+Se+1]!==0&&(nt=1),this[_+Se]=(I/Pe>>0)-nt&255;return _+Z},O.prototype.writeInt8=function(I,_,Z){return I=+I,_=_>>>0,Z||Ze(this,I,_,1,127,-128),I<0&&(I=255+I+1),this[_]=I&255,_+1},O.prototype.writeInt16LE=function(I,_,Z){return I=+I,_=_>>>0,Z||Ze(this,I,_,2,32767,-32768),this[_]=I&255,this[_+1]=I>>>8,_+2},O.prototype.writeInt16BE=function(I,_,Z){return I=+I,_=_>>>0,Z||Ze(this,I,_,2,32767,-32768),this[_]=I>>>8,this[_+1]=I&255,_+2},O.prototype.writeInt32LE=function(I,_,Z){return I=+I,_=_>>>0,Z||Ze(this,I,_,4,2147483647,-2147483648),this[_]=I&255,this[_+1]=I>>>8,this[_+2]=I>>>16,this[_+3]=I>>>24,_+4},O.prototype.writeInt32BE=function(I,_,Z){return I=+I,_=_>>>0,Z||Ze(this,I,_,4,2147483647,-2147483648),I<0&&(I=4294967295+I+1),this[_]=I>>>24,this[_+1]=I>>>16,this[_+2]=I>>>8,this[_+3]=I&255,_+4},O.prototype.writeBigInt64LE=Ue(function(I,_=0){return wt(this,I,_,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),O.prototype.writeBigInt64BE=Ue(function(I,_=0){return St(this,I,_,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Et(j,I,_,Z,ce,Se){if(_+Z>j.length)throw new RangeError("Index out of range");if(_<0)throw new RangeError("Index out of range")}function Tt(j,I,_,Z,ce){return I=+I,_=_>>>0,ce||Et(j,I,_,4),h.write(j,I,_,Z,23,4),_+4}O.prototype.writeFloatLE=function(I,_,Z){return Tt(this,I,_,!0,Z)},O.prototype.writeFloatBE=function(I,_,Z){return Tt(this,I,_,!1,Z)};function at(j,I,_,Z,ce){return I=+I,_=_>>>0,ce||Et(j,I,_,8),h.write(j,I,_,Z,52,8),_+8}O.prototype.writeDoubleLE=function(I,_,Z){return at(this,I,_,!0,Z)},O.prototype.writeDoubleBE=function(I,_,Z){return at(this,I,_,!1,Z)},O.prototype.copy=function(I,_,Z,ce){if(!O.isBuffer(I))throw new TypeError("argument should be a Buffer");if(Z||(Z=0),!ce&&ce!==0&&(ce=this.length),_>=I.length&&(_=I.length),_||(_=0),ce>0&&ce<Z&&(ce=Z),ce===Z||I.length===0||this.length===0)return 0;if(_<0)throw new RangeError("targetStart out of bounds");if(Z<0||Z>=this.length)throw new RangeError("Index out of range");if(ce<0)throw new RangeError("sourceEnd out of bounds");ce>this.length&&(ce=this.length),I.length-_<ce-Z&&(ce=I.length-_+Z);const Se=ce-Z;return this===I&&typeof R.prototype.copyWithin=="function"?this.copyWithin(_,Z,ce):R.prototype.set.call(I,this.subarray(Z,ce),_),Se},O.prototype.fill=function(I,_,Z,ce){if(typeof I=="string"){if(typeof _=="string"?(ce=_,_=0,Z=this.length):typeof Z=="string"&&(ce=Z,Z=this.length),ce!==void 0&&typeof ce!="string")throw new TypeError("encoding must be a string");if(typeof ce=="string"&&!O.isEncoding(ce))throw new TypeError("Unknown encoding: "+ce);if(I.length===1){const Pe=I.charCodeAt(0);(ce==="utf8"&&Pe<128||ce==="latin1")&&(I=Pe)}}else typeof I=="number"?I=I&255:typeof I=="boolean"&&(I=Number(I));if(_<0||this.length<_||this.length<Z)throw new RangeError("Out of range index");if(Z<=_)return this;_=_>>>0,Z=Z===void 0?this.length:Z>>>0,I||(I=0);let Se;if(typeof I=="number")for(Se=_;Se<Z;++Se)this[Se]=I;else{const Pe=O.isBuffer(I)?I:O.from(I,ce),nt=Pe.length;if(nt===0)throw new TypeError('The value "'+I+'" is invalid for argument "value"');for(Se=0;Se<Z-_;++Se)this[Se+_]=Pe[Se%nt]}return this};const vn={};function U(j,I,_){vn[j]=class extends _{constructor(){super(),Object.defineProperty(this,"message",{value:I.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${j}]`,this.stack,delete this.name}get code(){return j}set code(ce){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ce,writable:!0})}toString(){return`${this.name} [${j}]: ${this.message}`}}}U("ERR_BUFFER_OUT_OF_BOUNDS",function(j){return j?`${j} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),U("ERR_INVALID_ARG_TYPE",function(j,I){return`The "${j}" argument must be of type number. Received type ${typeof I}`},TypeError),U("ERR_OUT_OF_RANGE",function(j,I,_){let Z=`The value of "${j}" is out of range.`,ce=_;return Number.isInteger(_)&&Math.abs(_)>2**32?ce=k(String(_)):typeof _=="bigint"&&(ce=String(_),(_>BigInt(2)**BigInt(32)||_<-(BigInt(2)**BigInt(32)))&&(ce=k(ce)),ce+="n"),Z+=` It must be ${I}. Received ${ce}`,Z},RangeError);function k(j){let I="",_=j.length;const Z=j[0]==="-"?1:0;for(;_>=Z+4;_-=3)I=`_${j.slice(_-3,_)}${I}`;return`${j.slice(0,_)}${I}`}function P(j,I,_){K(I,"offset"),(j[I]===void 0||j[I+_]===void 0)&&ne(I,j.length-(_+1))}function Q(j,I,_,Z,ce,Se){if(j>_||j<I){const Pe=typeof I=="bigint"?"n":"";let nt;throw I===0||I===BigInt(0)?nt=`>= 0${Pe} and < 2${Pe} ** ${(Se+1)*8}${Pe}`:nt=`>= -(2${Pe} ** ${(Se+1)*8-1}${Pe}) and < 2 ** ${(Se+1)*8-1}${Pe}`,new vn.ERR_OUT_OF_RANGE("value",nt,j)}P(Z,ce,Se)}function K(j,I){if(typeof j!="number")throw new vn.ERR_INVALID_ARG_TYPE(I,"number",j)}function ne(j,I,_){throw Math.floor(j)!==j?(K(j,_),new vn.ERR_OUT_OF_RANGE("offset","an integer",j)):I<0?new vn.ERR_BUFFER_OUT_OF_BOUNDS:new vn.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${I}`,j)}const de=/[^+/0-9A-Za-z-_]/g;function _e(j){if(j=j.split("=")[0],j=j.trim().replace(de,""),j.length<2)return"";for(;j.length%4!==0;)j=j+"=";return j}function Ne(j,I){I=I||1/0;let _;const Z=j.length;let ce=null;const Se=[];for(let Pe=0;Pe<Z;++Pe){if(_=j.charCodeAt(Pe),_>55295&&_<57344){if(!ce){if(_>56319){(I-=3)>-1&&Se.push(239,191,189);continue}else if(Pe+1===Z){(I-=3)>-1&&Se.push(239,191,189);continue}ce=_;continue}if(_<56320){(I-=3)>-1&&Se.push(239,191,189),ce=_;continue}_=(ce-55296<<10|_-56320)+65536}else ce&&(I-=3)>-1&&Se.push(239,191,189);if(ce=null,_<128){if((I-=1)<0)break;Se.push(_)}else if(_<2048){if((I-=2)<0)break;Se.push(_>>6|192,_&63|128)}else if(_<65536){if((I-=3)<0)break;Se.push(_>>12|224,_>>6&63|128,_&63|128)}else if(_<1114112){if((I-=4)<0)break;Se.push(_>>18|240,_>>12&63|128,_>>6&63|128,_&63|128)}else throw new Error("Invalid code point")}return Se}function xe(j){const I=[];for(let _=0;_<j.length;++_)I.push(j.charCodeAt(_)&255);return I}function Be(j,I){let _,Z,ce;const Se=[];for(let Pe=0;Pe<j.length&&!((I-=2)<0);++Pe)_=j.charCodeAt(Pe),Z=_>>8,ce=_%256,Se.push(ce),Se.push(Z);return Se}function Qe(j){return v.toByteArray(_e(j))}function nn(j,I,_,Z){let ce;for(ce=0;ce<Z&&!(ce+_>=I.length||ce>=j.length);++ce)I[ce+_]=j[ce];return ce}function Ut(j,I){return j instanceof I||j!=null&&j.constructor!=null&&j.constructor.name!=null&&j.constructor.name===I.name}function Nr(j){return j!==j}const Le=(function(){const j="0123456789abcdef",I=new Array(256);for(let _=0;_<16;++_){const Z=_*16;for(let ce=0;ce<16;++ce)I[Z+ce]=j[_]+j[ce]}return I})();function Ue(j){return typeof BigInt>"u"?yt:j}function yt(){throw new Error("BigInt not supported")}})(t);const y=t.Buffer;e.Blob=t.Blob,e.BlobOptions=t.BlobOptions,e.Buffer=t.Buffer,e.File=t.File,e.FileOptions=t.FileOptions,e.INSPECT_MAX_BYTES=t.INSPECT_MAX_BYTES,e.SlowBuffer=t.SlowBuffer,e.TranscodeEncoding=t.TranscodeEncoding,e.atob=t.atob,e.btoa=t.btoa,e.constants=t.constants,e.default=y,e.isAscii=t.isAscii,e.isUtf8=t.isUtf8,e.kMaxLength=t.kMaxLength,e.kStringMaxLength=t.kStringMaxLength,e.resolveObjectURL=t.resolveObjectURL,e.transcode=t.transcode})(Ic)),Ic}var Oc={},Fc={},_c,Om;function Fm(){return Om||(Om=1,_c=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;t[n]=i;for(var o in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var s=Object.getOwnPropertySymbols(t);if(s.length!==1||s[0]!==n||!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,n);if(a.value!==i||a.enumerable!==!0)return!1}return!0}),_c}var Dc,_m;function na(){if(_m)return Dc;_m=1;var e=Fm();return Dc=function(){return e()&&!!Symbol.toStringTag},Dc}var Nc,Dm;function Nm(){return Dm||(Dm=1,Nc=Object),Nc}var Lc,Lm;function nC(){return Lm||(Lm=1,Lc=Error),Lc}var $c,$m;function rC(){return $m||($m=1,$c=EvalError),$c}var Mc,Mm;function iC(){return Mm||(Mm=1,Mc=RangeError),Mc}var Bc,Bm;function oC(){return Bm||(Bm=1,Bc=ReferenceError),Bc}var jc,jm;function Um(){return jm||(jm=1,jc=SyntaxError),jc}var Uc,Vm;function Oo(){return Vm||(Vm=1,Uc=TypeError),Uc}var Vc,qm;function sC(){return qm||(qm=1,Vc=URIError),Vc}var qc,zm;function aC(){return zm||(zm=1,qc=Math.abs),qc}var zc,Wm;function lC(){return Wm||(Wm=1,zc=Math.floor),zc}var Wc,Hm;function cC(){return Hm||(Hm=1,Wc=Math.max),Wc}var Hc,Km;function uC(){return Km||(Km=1,Hc=Math.min),Hc}var Kc,Gm;function fC(){return Gm||(Gm=1,Kc=Math.pow),Kc}var Gc,Qm;function dC(){return Qm||(Qm=1,Gc=Math.round),Gc}var Qc,Xm;function pC(){return Xm||(Xm=1,Qc=Number.isNaN||function(t){return t!==t}),Qc}var Xc,Ym;function hC(){if(Ym)return Xc;Ym=1;var e=pC();return Xc=function(n){return e(n)||n===0?n:n<0?-1:1},Xc}var Yc,Jm;function mC(){return Jm||(Jm=1,Yc=Object.getOwnPropertyDescriptor),Yc}var Jc,Zm;function Ui(){if(Zm)return Jc;Zm=1;var e=mC();if(e)try{e([],"length")}catch{e=null}return Jc=e,Jc}var Zc,eg;function ra(){if(eg)return Zc;eg=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Zc=e,Zc}var eu,tg;function gC(){if(tg)return eu;tg=1;var e=typeof Symbol<"u"&&Symbol,t=Fm();return eu=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},eu}var tu,ng;function rg(){return ng||(ng=1,tu=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),tu}var nu,ig;function og(){if(ig)return nu;ig=1;var e=Nm();return nu=e.getPrototypeOf||null,nu}var ru,sg;function yC(){if(sg)return ru;sg=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,n=Math.max,r="[object Function]",i=function(l,u){for(var c=[],d=0;d<l.length;d+=1)c[d]=l[d];for(var p=0;p<u.length;p+=1)c[p+l.length]=u[p];return c},o=function(l,u){for(var c=[],d=u,p=0;d<l.length;d+=1,p+=1)c[p]=l[d];return c},s=function(a,l){for(var u="",c=0;c<a.length;c+=1)u+=a[c],c+1<a.length&&(u+=l);return u};return ru=function(l){var u=this;if(typeof u!="function"||t.apply(u)!==r)throw new TypeError(e+u);for(var c=o(arguments,1),d,p=function(){if(this instanceof d){var y=u.apply(this,i(c,arguments));return Object(y)===y?y:this}return u.apply(l,i(c,arguments))},m=n(0,u.length-c.length),b=[],w=0;w<m;w++)b[w]="$"+w;if(d=Function("binder","return function ("+s(b,",")+"){ return binder.apply(this,arguments); }")(p),u.prototype){var S=function(){};S.prototype=u.prototype,d.prototype=new S,S.prototype=null}return d},ru}var iu,ag;function Fo(){if(ag)return iu;ag=1;var e=yC();return iu=Function.prototype.bind||e,iu}var ou,lg;function su(){return lg||(lg=1,ou=Function.prototype.call),ou}var au,cg;function lu(){return cg||(cg=1,au=Function.prototype.apply),au}var cu,ug;function vC(){return ug||(ug=1,cu=typeof Reflect<"u"&&Reflect&&Reflect.apply),cu}var uu,fg;function dg(){if(fg)return uu;fg=1;var e=Fo(),t=lu(),n=su(),r=vC();return uu=r||e.call(n,t),uu}var fu,pg;function du(){if(pg)return fu;pg=1;var e=Fo(),t=Oo(),n=su(),r=dg();return fu=function(o){if(o.length<1||typeof o[0]!="function")throw new t("a function is required");return r(e,n,o)},fu}var pu,hg;function bC(){if(hg)return pu;hg=1;var e=du(),t=Ui(),n;try{n=[].__proto__===Array.prototype}catch(s){if(!s||typeof s!="object"||!("code"in s)||s.code!=="ERR_PROTO_ACCESS")throw s}var r=!!n&&t&&t(Object.prototype,"__proto__"),i=Object,o=i.getPrototypeOf;return pu=r&&typeof r.get=="function"?e([r.get]):typeof o=="function"?function(a){return o(a==null?a:i(a))}:!1,pu}var hu,mg;function mu(){if(mg)return hu;mg=1;var e=rg(),t=og(),n=bC();return hu=e?function(i){return e(i)}:t?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return t(i)}:n?function(i){return n(i)}:null,hu}var gu,gg;function yg(){if(gg)return gu;gg=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,n=Fo();return gu=n.call(e,t),gu}var yu,vg;function bg(){if(vg)return yu;vg=1;var e,t=Nm(),n=nC(),r=rC(),i=iC(),o=oC(),s=Um(),a=Oo(),l=sC(),u=aC(),c=lC(),d=cC(),p=uC(),m=fC(),b=dC(),w=hC(),S=Function,y=function(G){try{return S('"use strict"; return ('+G+").constructor;")()}catch{}},g=Ui(),v=ra(),h=function(){throw new a},E=g?(function(){try{return arguments.callee,h}catch{try{return g(arguments,"callee").get}catch{return h}}})():h,T=gC()(),R=mu(),C=og(),A=rg(),D=lu(),V=su(),O={},N=typeof Uint8Array>"u"||!R?e:R(Uint8Array),W={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":T&&R?R([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":O,"%AsyncGenerator%":O,"%AsyncGeneratorFunction%":O,"%AsyncIteratorPrototype%":O,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":r,"%Float16Array%":typeof Float16Array>"u"?e:Float16Array,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":S,"%GeneratorFunction%":O,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":T&&R?R(R([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!T||!R?e:R(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":g,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":i,"%ReferenceError%":o,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!T||!R?e:R(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":T&&R?R(""[Symbol.iterator]()):e,"%Symbol%":T?Symbol:e,"%SyntaxError%":s,"%ThrowTypeError%":E,"%TypedArray%":N,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":V,"%Function.prototype.apply%":D,"%Object.defineProperty%":v,"%Object.getPrototypeOf%":C,"%Math.abs%":u,"%Math.floor%":c,"%Math.max%":d,"%Math.min%":p,"%Math.pow%":m,"%Math.round%":b,"%Math.sign%":w,"%Reflect.getPrototypeOf%":A};if(R)try{null.error}catch(G){var L=R(R(G));W["%Error.prototype%"]=L}var ee=function G(H){var B;if(H==="%AsyncFunction%")B=y("async function () {}");else if(H==="%GeneratorFunction%")B=y("function* () {}");else if(H==="%AsyncGeneratorFunction%")B=y("async function* () {}");else if(H==="%AsyncGenerator%"){var z=G("%AsyncGeneratorFunction%");z&&(B=z.prototype)}else if(H==="%AsyncIteratorPrototype%"){var ge=G("%AsyncGenerator%");ge&&R&&(B=R(ge.prototype))}return W[H]=B,B},J={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},se=Fo(),he=yg(),oe=se.call(V,Array.prototype.concat),we=se.call(D,Array.prototype.splice),X=se.call(V,String.prototype.replace),ie=se.call(V,String.prototype.slice),le=se.call(V,RegExp.prototype.exec),Ae=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,te=/\\(\\)?/g,F=function(H){var B=ie(H,0,1),z=ie(H,-1);if(B==="%"&&z!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(z==="%"&&B!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var ge=[];return X(H,Ae,function(Re,De,Ce,Ie){ge[ge.length]=Ce?X(Ie,te,"$1"):De||Re}),ge},x=function(H,B){var z=H,ge;if(he(J,z)&&(ge=J[z],z="%"+ge[0]+"%"),he(W,z)){var Re=W[z];if(Re===O&&(Re=ee(z)),typeof Re>"u"&&!B)throw new a("intrinsic "+H+" exists, but is not available. Please file an issue!");return{alias:ge,name:z,value:Re}}throw new s("intrinsic "+H+" does not exist!")};return yu=function(H,B){if(typeof H!="string"||H.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof B!="boolean")throw new a('"allowMissing" argument must be a boolean');if(le(/^%?[^%]*%?$/,H)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var z=F(H),ge=z.length>0?z[0]:"",Re=x("%"+ge+"%",B),De=Re.name,Ce=Re.value,Ie=!1,$e=Re.alias;$e&&(ge=$e[0],we(z,oe([0,1],$e)));for(var ye=1,Ke=!0;ye<z.length;ye+=1){var Ge=z[ye],Ye=ie(Ge,0,1),Ze=ie(Ge,-1);if((Ye==='"'||Ye==="'"||Ye==="`"||Ze==='"'||Ze==="'"||Ze==="`")&&Ye!==Ze)throw new s("property names with quotes must have matching quotes");if((Ge==="constructor"||!Ke)&&(Ie=!0),ge+="."+Ge,De="%"+ge+"%",he(W,De))Ce=W[De];else if(Ce!=null){if(!(Ge in Ce)){if(!B)throw new a("base intrinsic for "+H+" exists, but the property is not available.");return}if(g&&ye+1>=z.length){var wt=g(Ce,Ge);Ke=!!wt,Ke&&"get"in wt&&!("originalValue"in wt.get)?Ce=wt.get:Ce=Ce[Ge]}else Ke=he(Ce,Ge),Ce=Ce[Ge];Ke&&!Ie&&(W[De]=Ce)}}return Ce},yu}var vu,wg;function _o(){if(wg)return vu;wg=1;var e=bg(),t=du(),n=t([e("%String.prototype.indexOf%")]);return vu=function(i,o){var s=e(i,!!o);return typeof s=="function"&&n(i,".prototype.")>-1?t([s]):s},vu}var bu,Sg;function wC(){if(Sg)return bu;Sg=1;var e=na()(),t=_o(),n=t("Object.prototype.toString"),r=function(a){return e&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:n(a)==="[object Arguments]"},i=function(a){return r(a)?!0:a!==null&&typeof a=="object"&&"length"in a&&typeof a.length=="number"&&a.length>=0&&n(a)!=="[object Array]"&&"callee"in a&&n(a.callee)==="[object Function]"},o=(function(){return r(arguments)})();return r.isLegacyArguments=i,bu=o?r:i,bu}var wu,Eg;function SC(){if(Eg)return wu;Eg=1;var e=_o(),t=na()(),n=yg(),r=Ui(),i;if(t){var o=e("RegExp.prototype.exec"),s={},a=function(){throw s},l={toString:a,valueOf:a};typeof Symbol.toPrimitive=="symbol"&&(l[Symbol.toPrimitive]=a),i=function(p){if(!p||typeof p!="object")return!1;var m=r(p,"lastIndex"),b=m&&n(m,"value");if(!b)return!1;try{o(p,l)}catch(w){return w===s}}}else{var u=e("Object.prototype.toString"),c="[object RegExp]";i=function(p){return!p||typeof p!="object"&&typeof p!="function"?!1:u(p)===c}}return wu=i,wu}var Su,Tg;function EC(){if(Tg)return Su;Tg=1;var e=_o(),t=SC(),n=e("RegExp.prototype.exec"),r=Oo();return Su=function(o){if(!t(o))throw new r("`regex` must be a RegExp");return function(a){return n(o,a)!==null}},Su}var Eu,Ag;function TC(){if(Ag)return Eu;Ag=1;var e=_o(),t=EC(),n=t(/^\s*(?:function)?\*/),r=na()(),i=mu(),o=e("Object.prototype.toString"),s=e("Function.prototype.toString"),a=function(){if(!r)return!1;try{return Function("return function*() {}")()}catch{}},l;return Eu=function(c){if(typeof c!="function")return!1;if(n(s(c)))return!0;if(!r){var d=o(c);return d==="[object GeneratorFunction]"}if(!i)return!1;if(typeof l>"u"){var p=a();l=p?i(p):!1}return i(c)===l},Eu}var Tu,xg;function AC(){if(xg)return Tu;xg=1;var e=Function.prototype.toString,t=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,n,r;if(typeof t=="function"&&typeof Object.defineProperty=="function")try{n=Object.defineProperty({},"length",{get:function(){throw r}}),r={},t(function(){throw 42},null,n)}catch(g){g!==r&&(t=null)}else t=null;var i=/^\s*class\b/,o=function(v){try{var h=e.call(v);return i.test(h)}catch{return!1}},s=function(v){try{return o(v)?!1:(e.call(v),!0)}catch{return!1}},a=Object.prototype.toString,l="[object Object]",u="[object Function]",c="[object GeneratorFunction]",d="[object HTMLAllCollection]",p="[object HTML document.all class]",m="[object HTMLCollection]",b=typeof Symbol=="function"&&!!Symbol.toStringTag,w=!(0 in[,]),S=function(){return!1};if(typeof document=="object"){var y=document.all;a.call(y)===a.call(document.all)&&(S=function(v){if((w||!v)&&(typeof v>"u"||typeof v=="object"))try{var h=a.call(v);return(h===d||h===p||h===m||h===l)&&v("")==null}catch{}return!1})}return Tu=t?function(v){if(S(v))return!0;if(!v||typeof v!="function"&&typeof v!="object")return!1;try{t(v,null,n)}catch(h){if(h!==r)return!1}return!o(v)&&s(v)}:function(v){if(S(v))return!0;if(!v||typeof v!="function"&&typeof v!="object")return!1;if(b)return s(v);if(o(v))return!1;var h=a.call(v);return h!==u&&h!==c&&!/^\[object HTML/.test(h)?!1:s(v)},Tu}var Au,Cg;function xC(){if(Cg)return Au;Cg=1;var e=AC(),t=Object.prototype.toString,n=Object.prototype.hasOwnProperty,r=function(l,u,c){for(var d=0,p=l.length;d<p;d++)n.call(l,d)&&(c==null?u(l[d],d,l):u.call(c,l[d],d,l))},i=function(l,u,c){for(var d=0,p=l.length;d<p;d++)c==null?u(l.charAt(d),d,l):u.call(c,l.charAt(d),d,l)},o=function(l,u,c){for(var d in l)n.call(l,d)&&(c==null?u(l[d],d,l):u.call(c,l[d],d,l))};function s(a){return t.call(a)==="[object Array]"}return Au=function(l,u,c){if(!e(u))throw new TypeError("iterator must be a function");var d;arguments.length>=3&&(d=c),s(l)?r(l,u,d):typeof l=="string"?i(l,u,d):o(l,u,d)},Au}var xu,Rg;function CC(){return Rg||(Rg=1,xu=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),xu}var Cu,kg;function RC(){if(kg)return Cu;kg=1;var e=CC(),t=typeof globalThis>"u"?zr:globalThis;return Cu=function(){for(var r=[],i=0;i<e.length;i++)typeof t[e[i]]=="function"&&(r[r.length]=e[i]);return r},Cu}var Ru={exports:{}},ku,Pg;function kC(){if(Pg)return ku;Pg=1;var e=ra(),t=Um(),n=Oo(),r=Ui();return ku=function(o,s,a){if(!o||typeof o!="object"&&typeof o!="function")throw new n("`obj` must be an object or a function`");if(typeof s!="string"&&typeof s!="symbol")throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new n("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,d=arguments.length>6?arguments[6]:!1,p=!!r&&r(o,s);if(e)e(o,s,{configurable:c===null&&p?p.configurable:!c,enumerable:l===null&&p?p.enumerable:!l,value:a,writable:u===null&&p?p.writable:!u});else if(d||!l&&!u&&!c)o[s]=a;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},ku}var Pu,Ig;function PC(){if(Ig)return Pu;Ig=1;var e=ra(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},Pu=t,Pu}var Iu,Og;function IC(){if(Og)return Iu;Og=1;var e=bg(),t=kC(),n=PC()(),r=Ui(),i=Oo(),o=e("%Math.floor%");return Iu=function(a,l){if(typeof a!="function")throw new i("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||o(l)!==l)throw new i("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],c=!0,d=!0;if("length"in a&&r){var p=r(a,"length");p&&!p.configurable&&(c=!1),p&&!p.writable&&(d=!1)}return(c||d||!u)&&(n?t(a,"length",l,!0,!0):t(a,"length",l)),a},Iu}var Ou,Fg;function OC(){if(Fg)return Ou;Fg=1;var e=Fo(),t=lu(),n=dg();return Ou=function(){return n(e,t,arguments)},Ou}var _g;function FC(){return _g||(_g=1,(function(e){var t=IC(),n=ra(),r=du(),i=OC();e.exports=function(s){var a=r(arguments),l=s.length-(arguments.length-1);return t(a,1+(l>0?l:0),!0)},n?n(e.exports,"apply",{value:i}):e.exports.apply=i})(Ru)),Ru.exports}var Fu,Dg;function Ng(){if(Dg)return Fu;Dg=1;var e=xC(),t=RC(),n=FC(),r=_o(),i=Ui(),o=mu(),s=r("Object.prototype.toString"),a=na()(),l=typeof globalThis>"u"?zr:globalThis,u=t(),c=r("String.prototype.slice"),d=r("Array.prototype.indexOf",!0)||function(S,y){for(var g=0;g<S.length;g+=1)if(S[g]===y)return g;return-1},p={__proto__:null};a&&i&&o?e(u,function(w){var S=new l[w];if(Symbol.toStringTag in S&&o){var y=o(S),g=i(y,Symbol.toStringTag);if(!g&&y){var v=o(y);g=i(v,Symbol.toStringTag)}p["$"+w]=n(g.get)}}):e(u,function(w){var S=new l[w],y=S.slice||S.set;y&&(p["$"+w]=n(y))});var m=function(S){var y=!1;return e(p,function(g,v){if(!y)try{"$"+g(S)===v&&(y=c(v,1))}catch{}}),y},b=function(S){var y=!1;return e(p,function(g,v){if(!y)try{g(S),y=c(v,1)}catch{}}),y};return Fu=function(S){if(!S||typeof S!="object")return!1;if(!a){var y=c(s(S),8,-1);return d(u,y)>-1?y:y!=="Object"?!1:b(S)}return i?m(S):null},Fu}var _u,Lg;function _C(){if(Lg)return _u;Lg=1;var e=Ng();return _u=function(n){return!!e(n)},_u}var $g;function DC(){return $g||($g=1,(function(e){var t=wC(),n=TC(),r=Ng(),i=_C();function o(ye){return ye.call.bind(ye)}var s=typeof BigInt<"u",a=typeof Symbol<"u",l=o(Object.prototype.toString),u=o(Number.prototype.valueOf),c=o(String.prototype.valueOf),d=o(Boolean.prototype.valueOf);if(s)var p=o(BigInt.prototype.valueOf);if(a)var m=o(Symbol.prototype.valueOf);function b(ye,Ke){if(typeof ye!="object")return!1;try{return Ke(ye),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=n,e.isTypedArray=i;function w(ye){return typeof Promise<"u"&&ye instanceof Promise||ye!==null&&typeof ye=="object"&&typeof ye.then=="function"&&typeof ye.catch=="function"}e.isPromise=w;function S(ye){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(ye):i(ye)||ie(ye)}e.isArrayBufferView=S;function y(ye){return r(ye)==="Uint8Array"}e.isUint8Array=y;function g(ye){return r(ye)==="Uint8ClampedArray"}e.isUint8ClampedArray=g;function v(ye){return r(ye)==="Uint16Array"}e.isUint16Array=v;function h(ye){return r(ye)==="Uint32Array"}e.isUint32Array=h;function E(ye){return r(ye)==="Int8Array"}e.isInt8Array=E;function T(ye){return r(ye)==="Int16Array"}e.isInt16Array=T;function R(ye){return r(ye)==="Int32Array"}e.isInt32Array=R;function C(ye){return r(ye)==="Float32Array"}e.isFloat32Array=C;function A(ye){return r(ye)==="Float64Array"}e.isFloat64Array=A;function D(ye){return r(ye)==="BigInt64Array"}e.isBigInt64Array=D;function V(ye){return r(ye)==="BigUint64Array"}e.isBigUint64Array=V;function O(ye){return l(ye)==="[object Map]"}O.working=typeof Map<"u"&&O(new Map);function N(ye){return typeof Map>"u"?!1:O.working?O(ye):ye instanceof Map}e.isMap=N;function W(ye){return l(ye)==="[object Set]"}W.working=typeof Set<"u"&&W(new Set);function L(ye){return typeof Set>"u"?!1:W.working?W(ye):ye instanceof Set}e.isSet=L;function ee(ye){return l(ye)==="[object WeakMap]"}ee.working=typeof WeakMap<"u"&&ee(new WeakMap);function J(ye){return typeof WeakMap>"u"?!1:ee.working?ee(ye):ye instanceof WeakMap}e.isWeakMap=J;function se(ye){return l(ye)==="[object WeakSet]"}se.working=typeof WeakSet<"u"&&se(new WeakSet);function he(ye){return se(ye)}e.isWeakSet=he;function oe(ye){return l(ye)==="[object ArrayBuffer]"}oe.working=typeof ArrayBuffer<"u"&&oe(new ArrayBuffer);function we(ye){return typeof ArrayBuffer>"u"?!1:oe.working?oe(ye):ye instanceof ArrayBuffer}e.isArrayBuffer=we;function X(ye){return l(ye)==="[object DataView]"}X.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&X(new DataView(new ArrayBuffer(1),0,1));function ie(ye){return typeof DataView>"u"?!1:X.working?X(ye):ye instanceof DataView}e.isDataView=ie;var le=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Ae(ye){return l(ye)==="[object SharedArrayBuffer]"}function te(ye){return typeof le>"u"?!1:(typeof Ae.working>"u"&&(Ae.working=Ae(new le)),Ae.working?Ae(ye):ye instanceof le)}e.isSharedArrayBuffer=te;function F(ye){return l(ye)==="[object AsyncFunction]"}e.isAsyncFunction=F;function x(ye){return l(ye)==="[object Map Iterator]"}e.isMapIterator=x;function G(ye){return l(ye)==="[object Set Iterator]"}e.isSetIterator=G;function H(ye){return l(ye)==="[object Generator]"}e.isGeneratorObject=H;function B(ye){return l(ye)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=B;function z(ye){return b(ye,u)}e.isNumberObject=z;function ge(ye){return b(ye,c)}e.isStringObject=ge;function Re(ye){return b(ye,d)}e.isBooleanObject=Re;function De(ye){return s&&b(ye,p)}e.isBigIntObject=De;function Ce(ye){return a&&b(ye,m)}e.isSymbolObject=Ce;function Ie(ye){return z(ye)||ge(ye)||Re(ye)||De(ye)||Ce(ye)}e.isBoxedPrimitive=Ie;function $e(ye){return typeof Uint8Array<"u"&&(we(ye)||te(ye))}e.isAnyArrayBuffer=$e,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(ye){Object.defineProperty(e,ye,{enumerable:!1,value:function(){throw new Error(ye+" is not supported in userland")}})})})(Fc)),Fc}var Du,Mg;function NC(){return Mg||(Mg=1,Du=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),Du}var Bg;function jg(){return Bg||(Bg=1,(function(e){var t=Object.getOwnPropertyDescriptors||function(ie){for(var le=Object.keys(ie),Ae={},te=0;te<le.length;te++)Ae[le[te]]=Object.getOwnPropertyDescriptor(ie,le[te]);return Ae},n=/%[sdj%]/g;e.format=function(X){if(!E(X)){for(var ie=[],le=0;le<arguments.length;le++)ie.push(s(arguments[le]));return ie.join(" ")}for(var le=1,Ae=arguments,te=Ae.length,F=String(X).replace(n,function(G){if(G==="%%")return"%";if(le>=te)return G;switch(G){case"%s":return String(Ae[le++]);case"%d":return Number(Ae[le++]);case"%j":try{return JSON.stringify(Ae[le++])}catch{return"[Circular]"}default:return G}}),x=Ae[le];le<te;x=Ae[++le])g(x)||!A(x)?F+=" "+x:F+=" "+s(x);return F},e.deprecate=function(X,ie){if(typeof be<"u"&&be.noDeprecation===!0)return X;if(typeof be>"u")return function(){return e.deprecate(X,ie).apply(this,arguments)};var le=!1;function Ae(){if(!le){if(be.throwDeprecation)throw new Error(ie);be.traceDeprecation?console.trace(ie):console.error(ie),le=!0}return X.apply(this,arguments)}return Ae};var r={},i=/^$/;if(be.env.NODE_DEBUG){var o=be.env.NODE_DEBUG;o=o.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),i=new RegExp("^"+o+"$","i")}e.debuglog=function(X){if(X=X.toUpperCase(),!r[X])if(i.test(X)){var ie=be.pid;r[X]=function(){var le=e.format.apply(e,arguments);console.error("%s %d: %s",X,ie,le)}}else r[X]=function(){};return r[X]};function s(X,ie){var le={seen:[],stylize:l};return arguments.length>=3&&(le.depth=arguments[2]),arguments.length>=4&&(le.colors=arguments[3]),y(ie)?le.showHidden=ie:ie&&e._extend(le,ie),R(le.showHidden)&&(le.showHidden=!1),R(le.depth)&&(le.depth=2),R(le.colors)&&(le.colors=!1),R(le.customInspect)&&(le.customInspect=!0),le.colors&&(le.stylize=a),c(le,X,le.depth)}e.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function a(X,ie){var le=s.styles[ie];return le?"\x1B["+s.colors[le][0]+"m"+X+"\x1B["+s.colors[le][1]+"m":X}function l(X,ie){return X}function u(X){var ie={};return X.forEach(function(le,Ae){ie[le]=!0}),ie}function c(X,ie,le){if(X.customInspect&&ie&&O(ie.inspect)&&ie.inspect!==e.inspect&&!(ie.constructor&&ie.constructor.prototype===ie)){var Ae=ie.inspect(le,X);return E(Ae)||(Ae=c(X,Ae,le)),Ae}var te=d(X,ie);if(te)return te;var F=Object.keys(ie),x=u(F);if(X.showHidden&&(F=Object.getOwnPropertyNames(ie)),V(ie)&&(F.indexOf("message")>=0||F.indexOf("description")>=0))return p(ie);if(F.length===0){if(O(ie)){var G=ie.name?": "+ie.name:"";return X.stylize("[Function"+G+"]","special")}if(C(ie))return X.stylize(RegExp.prototype.toString.call(ie),"regexp");if(D(ie))return X.stylize(Date.prototype.toString.call(ie),"date");if(V(ie))return p(ie)}var H="",B=!1,z=["{","}"];if(S(ie)&&(B=!0,z=["[","]"]),O(ie)){var ge=ie.name?": "+ie.name:"";H=" [Function"+ge+"]"}if(C(ie)&&(H=" "+RegExp.prototype.toString.call(ie)),D(ie)&&(H=" "+Date.prototype.toUTCString.call(ie)),V(ie)&&(H=" "+p(ie)),F.length===0&&(!B||ie.length==0))return z[0]+H+z[1];if(le<0)return C(ie)?X.stylize(RegExp.prototype.toString.call(ie),"regexp"):X.stylize("[Object]","special");X.seen.push(ie);var Re;return B?Re=m(X,ie,le,x,F):Re=F.map(function(De){return b(X,ie,le,x,De,B)}),X.seen.pop(),w(Re,H,z)}function d(X,ie){if(R(ie))return X.stylize("undefined","undefined");if(E(ie)){var le="'"+JSON.stringify(ie).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return X.stylize(le,"string")}if(h(ie))return X.stylize(""+ie,"number");if(y(ie))return X.stylize(""+ie,"boolean");if(g(ie))return X.stylize("null","null")}function p(X){return"["+Error.prototype.toString.call(X)+"]"}function m(X,ie,le,Ae,te){for(var F=[],x=0,G=ie.length;x<G;++x)se(ie,String(x))?F.push(b(X,ie,le,Ae,String(x),!0)):F.push("");return te.forEach(function(H){H.match(/^\d+$/)||F.push(b(X,ie,le,Ae,H,!0))}),F}function b(X,ie,le,Ae,te,F){var x,G,H;if(H=Object.getOwnPropertyDescriptor(ie,te)||{value:ie[te]},H.get?H.set?G=X.stylize("[Getter/Setter]","special"):G=X.stylize("[Getter]","special"):H.set&&(G=X.stylize("[Setter]","special")),se(Ae,te)||(x="["+te+"]"),G||(X.seen.indexOf(H.value)<0?(g(le)?G=c(X,H.value,null):G=c(X,H.value,le-1),G.indexOf(`
7
- `)>-1&&(F?G=G.split(`
8
- `).map(function(B){return" "+B}).join(`
9
- `).slice(2):G=`
10
- `+G.split(`
11
- `).map(function(B){return" "+B}).join(`
12
- `))):G=X.stylize("[Circular]","special")),R(x)){if(F&&te.match(/^\d+$/))return G;x=JSON.stringify(""+te),x.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(x=x.slice(1,-1),x=X.stylize(x,"name")):(x=x.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),x=X.stylize(x,"string"))}return x+": "+G}function w(X,ie,le){var Ae=X.reduce(function(te,F){return F.indexOf(`
13
- `)>=0,te+F.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Ae>60?le[0]+(ie===""?"":ie+`
14
- `)+" "+X.join(`,
15
- `)+" "+le[1]:le[0]+ie+" "+X.join(", ")+" "+le[1]}e.types=DC();function S(X){return Array.isArray(X)}e.isArray=S;function y(X){return typeof X=="boolean"}e.isBoolean=y;function g(X){return X===null}e.isNull=g;function v(X){return X==null}e.isNullOrUndefined=v;function h(X){return typeof X=="number"}e.isNumber=h;function E(X){return typeof X=="string"}e.isString=E;function T(X){return typeof X=="symbol"}e.isSymbol=T;function R(X){return X===void 0}e.isUndefined=R;function C(X){return A(X)&&W(X)==="[object RegExp]"}e.isRegExp=C,e.types.isRegExp=C;function A(X){return typeof X=="object"&&X!==null}e.isObject=A;function D(X){return A(X)&&W(X)==="[object Date]"}e.isDate=D,e.types.isDate=D;function V(X){return A(X)&&(W(X)==="[object Error]"||X instanceof Error)}e.isError=V,e.types.isNativeError=V;function O(X){return typeof X=="function"}e.isFunction=O;function N(X){return X===null||typeof X=="boolean"||typeof X=="number"||typeof X=="string"||typeof X=="symbol"||typeof X>"u"}e.isPrimitive=N,e.isBuffer=NC();function W(X){return Object.prototype.toString.call(X)}function L(X){return X<10?"0"+X.toString(10):X.toString(10)}var ee=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function J(){var X=new Date,ie=[L(X.getHours()),L(X.getMinutes()),L(X.getSeconds())].join(":");return[X.getDate(),ee[X.getMonth()],ie].join(" ")}e.log=function(){console.log("%s - %s",J(),e.format.apply(e,arguments))},e.inherits=ci(),e._extend=function(X,ie){if(!ie||!A(ie))return X;for(var le=Object.keys(ie),Ae=le.length;Ae--;)X[le[Ae]]=ie[le[Ae]];return X};function se(X,ie){return Object.prototype.hasOwnProperty.call(X,ie)}var he=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(ie){if(typeof ie!="function")throw new TypeError('The "original" argument must be of type Function');if(he&&ie[he]){var le=ie[he];if(typeof le!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(le,he,{value:le,enumerable:!1,writable:!1,configurable:!0}),le}function le(){for(var Ae,te,F=new Promise(function(H,B){Ae=H,te=B}),x=[],G=0;G<arguments.length;G++)x.push(arguments[G]);x.push(function(H,B){H?te(H):Ae(B)});try{ie.apply(this,x)}catch(H){te(H)}return F}return Object.setPrototypeOf(le,Object.getPrototypeOf(ie)),he&&Object.defineProperty(le,he,{value:le,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(le,t(ie))},e.promisify.custom=he;function oe(X,ie){if(!X){var le=new Error("Promise was rejected with a falsy value");le.reason=X,X=le}return ie(X)}function we(X){if(typeof X!="function")throw new TypeError('The "original" argument must be of type Function');function ie(){for(var le=[],Ae=0;Ae<arguments.length;Ae++)le.push(arguments[Ae]);var te=le.pop();if(typeof te!="function")throw new TypeError("The last argument must be of type Function");var F=this,x=function(){return te.apply(F,arguments)};X.apply(this,le).then(function(G){be.nextTick(x.bind(null,null,G))},function(G){be.nextTick(oe.bind(null,G,x))})}return Object.setPrototypeOf(ie,Object.getPrototypeOf(X)),Object.defineProperties(ie,t(X)),ie}e.callbackify=we})(Oc)),Oc}var Nu,Ug;function LC(){if(Ug)return Nu;Ug=1;function e(b,w){var S=Object.keys(b);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(b);w&&(y=y.filter(function(g){return Object.getOwnPropertyDescriptor(b,g).enumerable})),S.push.apply(S,y)}return S}function t(b){for(var w=1;w<arguments.length;w++){var S=arguments[w]!=null?arguments[w]:{};w%2?e(Object(S),!0).forEach(function(y){n(b,y,S[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(S)):e(Object(S)).forEach(function(y){Object.defineProperty(b,y,Object.getOwnPropertyDescriptor(S,y))})}return b}function n(b,w,S){return w=s(w),w in b?Object.defineProperty(b,w,{value:S,enumerable:!0,configurable:!0,writable:!0}):b[w]=S,b}function r(b,w){if(!(b instanceof w))throw new TypeError("Cannot call a class as a function")}function i(b,w){for(var S=0;S<w.length;S++){var y=w[S];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(b,s(y.key),y)}}function o(b,w,S){return w&&i(b.prototype,w),Object.defineProperty(b,"prototype",{writable:!1}),b}function s(b){var w=a(b,"string");return typeof w=="symbol"?w:String(w)}function a(b,w){if(typeof b!="object"||b===null)return b;var S=b[Symbol.toPrimitive];if(S!==void 0){var y=S.call(b,w);if(typeof y!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(b)}var l=ta(),u=l.Buffer,c=jg(),d=c.inspect,p=d&&d.custom||"inspect";function m(b,w,S){u.prototype.copy.call(b,w,S)}return Nu=(function(){function b(){r(this,b),this.head=null,this.tail=null,this.length=0}return o(b,[{key:"push",value:function(S){var y={data:S,next:null};this.length>0?this.tail.next=y:this.head=y,this.tail=y,++this.length}},{key:"unshift",value:function(S){var y={data:S,next:this.head};this.length===0&&(this.tail=y),this.head=y,++this.length}},{key:"shift",value:function(){if(this.length!==0){var S=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,S}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(S){if(this.length===0)return"";for(var y=this.head,g=""+y.data;y=y.next;)g+=S+y.data;return g}},{key:"concat",value:function(S){if(this.length===0)return u.alloc(0);for(var y=u.allocUnsafe(S>>>0),g=this.head,v=0;g;)m(g.data,y,v),v+=g.data.length,g=g.next;return y}},{key:"consume",value:function(S,y){var g;return S<this.head.data.length?(g=this.head.data.slice(0,S),this.head.data=this.head.data.slice(S)):S===this.head.data.length?g=this.shift():g=y?this._getString(S):this._getBuffer(S),g}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(S){var y=this.head,g=1,v=y.data;for(S-=v.length;y=y.next;){var h=y.data,E=S>h.length?h.length:S;if(E===h.length?v+=h:v+=h.slice(0,S),S-=E,S===0){E===h.length?(++g,y.next?this.head=y.next:this.head=this.tail=null):(this.head=y,y.data=h.slice(E));break}++g}return this.length-=g,v}},{key:"_getBuffer",value:function(S){var y=u.allocUnsafe(S),g=this.head,v=1;for(g.data.copy(y),S-=g.data.length;g=g.next;){var h=g.data,E=S>h.length?h.length:S;if(h.copy(y,y.length-S,0,E),S-=E,S===0){E===h.length?(++v,g.next?this.head=g.next:this.head=this.tail=null):(this.head=g,g.data=h.slice(E));break}++v}return this.length-=v,y}},{key:p,value:function(S,y){return d(this,t(t({},y),{},{depth:0,customInspect:!1}))}}]),b})(),Nu}var Lu,Vg;function qg(){if(Vg)return Lu;Vg=1;function e(s,a){var l=this,u=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return u||c?(a?a(s):s&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,be.nextTick(i,this,s)):be.nextTick(i,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(d){!a&&d?l._writableState?l._writableState.errorEmitted?be.nextTick(n,l):(l._writableState.errorEmitted=!0,be.nextTick(t,l,d)):be.nextTick(t,l,d):a?(be.nextTick(n,l),a(d)):be.nextTick(n,l)}),this)}function t(s,a){i(s,a),n(s)}function n(s){s._writableState&&!s._writableState.emitClose||s._readableState&&!s._readableState.emitClose||s.emit("close")}function r(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function i(s,a){s.emit("error",a)}function o(s,a){var l=s._readableState,u=s._writableState;l&&l.autoDestroy||u&&u.autoDestroy?s.destroy(a):s.emit("error",a)}return Lu={destroy:e,undestroy:r,errorOrDestroy:o},Lu}var $u={},zg;function Vi(){if(zg)return $u;zg=1;function e(a,l){a.prototype=Object.create(l.prototype),a.prototype.constructor=a,a.__proto__=l}var t={};function n(a,l,u){u||(u=Error);function c(p,m,b){return typeof l=="string"?l:l(p,m,b)}var d=(function(p){e(m,p);function m(b,w,S){return p.call(this,c(b,w,S))||this}return m})(u);d.prototype.name=u.name,d.prototype.code=a,t[a]=d}function r(a,l){if(Array.isArray(a)){var u=a.length;return a=a.map(function(c){return String(c)}),u>2?"one of ".concat(l," ").concat(a.slice(0,u-1).join(", "),", or ")+a[u-1]:u===2?"one of ".concat(l," ").concat(a[0]," or ").concat(a[1]):"of ".concat(l," ").concat(a[0])}else return"of ".concat(l," ").concat(String(a))}function i(a,l,u){return a.substr(0,l.length)===l}function o(a,l,u){return(u===void 0||u>a.length)&&(u=a.length),a.substring(u-l.length,u)===l}function s(a,l,u){return typeof u!="number"&&(u=0),u+l.length>a.length?!1:a.indexOf(l,u)!==-1}return n("ERR_INVALID_OPT_VALUE",function(a,l){return'The value "'+l+'" is invalid for option "'+a+'"'},TypeError),n("ERR_INVALID_ARG_TYPE",function(a,l,u){var c;typeof l=="string"&&i(l,"not ")?(c="must not be",l=l.replace(/^not /,"")):c="must be";var d;if(o(a," argument"))d="The ".concat(a," ").concat(c," ").concat(r(l,"type"));else{var p=s(a,".")?"property":"argument";d='The "'.concat(a,'" ').concat(p," ").concat(c," ").concat(r(l,"type"))}return d+=". Received type ".concat(typeof u),d},TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",function(a){return"The "+a+" method is not implemented"}),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",function(a){return"Cannot call "+a+" after a stream was destroyed"}),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",function(a){return"Unknown encoding: "+a},TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),$u.codes=t,$u}var Mu,Wg;function Hg(){if(Wg)return Mu;Wg=1;var e=Vi().codes.ERR_INVALID_OPT_VALUE;function t(r,i,o){return r.highWaterMark!=null?r.highWaterMark:i?r[o]:null}function n(r,i,o,s){var a=t(i,s,o);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var l=s?o:"highWaterMark";throw new e(l,a)}return Math.floor(a)}return r.objectMode?16:16*1024}return Mu={getHighWaterMark:n},Mu}var Bu,Kg;function $C(){if(Kg)return Bu;Kg=1,Bu=e;function e(n,r){if(t("noDeprecation"))return n;var i=!1;function o(){if(!i){if(t("throwDeprecation"))throw new Error(r);t("traceDeprecation")?console.trace(r):console.warn(r),i=!0}return n.apply(this,arguments)}return o}function t(n){try{if(!zr.localStorage)return!1}catch{return!1}var r=zr.localStorage[n];return r==null?!1:String(r).toLowerCase()==="true"}return Bu}var ju,Gg;function Qg(){if(Gg)return ju;Gg=1,ju=C;function e(te){var F=this;this.next=null,this.entry=null,this.finish=function(){Ae(F,te)}}var t;C.WritableState=T;var n={deprecate:$C()},r=Pm(),i=ta().Buffer,o=(typeof zr<"u"?zr:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(te){return i.from(te)}function a(te){return i.isBuffer(te)||te instanceof o}var l=qg(),u=Hg(),c=u.getHighWaterMark,d=Vi().codes,p=d.ERR_INVALID_ARG_TYPE,m=d.ERR_METHOD_NOT_IMPLEMENTED,b=d.ERR_MULTIPLE_CALLBACK,w=d.ERR_STREAM_CANNOT_PIPE,S=d.ERR_STREAM_DESTROYED,y=d.ERR_STREAM_NULL_VALUES,g=d.ERR_STREAM_WRITE_AFTER_END,v=d.ERR_UNKNOWN_ENCODING,h=l.errorOrDestroy;ci()(C,r);function E(){}function T(te,F,x){t=t||qi(),te=te||{},typeof x!="boolean"&&(x=F instanceof t),this.objectMode=!!te.objectMode,x&&(this.objectMode=this.objectMode||!!te.writableObjectMode),this.highWaterMark=c(this,te,"writableHighWaterMark",x),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var G=te.decodeStrings===!1;this.decodeStrings=!G,this.defaultEncoding=te.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(H){ee(F,H)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=te.emitClose!==!1,this.autoDestroy=!!te.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}T.prototype.getBuffer=function(){for(var F=this.bufferedRequest,x=[];F;)x.push(F),F=F.next;return x},(function(){try{Object.defineProperty(T.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var R;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(R=Function.prototype[Symbol.hasInstance],Object.defineProperty(C,Symbol.hasInstance,{value:function(F){return R.call(this,F)?!0:this!==C?!1:F&&F._writableState instanceof T}})):R=function(F){return F instanceof this};function C(te){t=t||qi();var F=this instanceof t;if(!F&&!R.call(C,this))return new C(te);this._writableState=new T(te,this,F),this.writable=!0,te&&(typeof te.write=="function"&&(this._write=te.write),typeof te.writev=="function"&&(this._writev=te.writev),typeof te.destroy=="function"&&(this._destroy=te.destroy),typeof te.final=="function"&&(this._final=te.final)),r.call(this)}C.prototype.pipe=function(){h(this,new w)};function A(te,F){var x=new g;h(te,x),be.nextTick(F,x)}function D(te,F,x,G){var H;return x===null?H=new y:typeof x!="string"&&!F.objectMode&&(H=new p("chunk",["string","Buffer"],x)),H?(h(te,H),be.nextTick(G,H),!1):!0}C.prototype.write=function(te,F,x){var G=this._writableState,H=!1,B=!G.objectMode&&a(te);return B&&!i.isBuffer(te)&&(te=s(te)),typeof F=="function"&&(x=F,F=null),B?F="buffer":F||(F=G.defaultEncoding),typeof x!="function"&&(x=E),G.ending?A(this,x):(B||D(this,G,te,x))&&(G.pendingcb++,H=O(this,G,B,te,F,x)),H},C.prototype.cork=function(){this._writableState.corked++},C.prototype.uncork=function(){var te=this._writableState;te.corked&&(te.corked--,!te.writing&&!te.corked&&!te.bufferProcessing&&te.bufferedRequest&&he(this,te))},C.prototype.setDefaultEncoding=function(F){if(typeof F=="string"&&(F=F.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((F+"").toLowerCase())>-1))throw new v(F);return this._writableState.defaultEncoding=F,this},Object.defineProperty(C.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function V(te,F,x){return!te.objectMode&&te.decodeStrings!==!1&&typeof F=="string"&&(F=i.from(F,x)),F}Object.defineProperty(C.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function O(te,F,x,G,H,B){if(!x){var z=V(F,G,H);G!==z&&(x=!0,H="buffer",G=z)}var ge=F.objectMode?1:G.length;F.length+=ge;var Re=F.length<F.highWaterMark;if(Re||(F.needDrain=!0),F.writing||F.corked){var De=F.lastBufferedRequest;F.lastBufferedRequest={chunk:G,encoding:H,isBuf:x,callback:B,next:null},De?De.next=F.lastBufferedRequest:F.bufferedRequest=F.lastBufferedRequest,F.bufferedRequestCount+=1}else N(te,F,!1,ge,G,H,B);return Re}function N(te,F,x,G,H,B,z){F.writelen=G,F.writecb=z,F.writing=!0,F.sync=!0,F.destroyed?F.onwrite(new S("write")):x?te._writev(H,F.onwrite):te._write(H,B,F.onwrite),F.sync=!1}function W(te,F,x,G,H){--F.pendingcb,x?(be.nextTick(H,G),be.nextTick(ie,te,F),te._writableState.errorEmitted=!0,h(te,G)):(H(G),te._writableState.errorEmitted=!0,h(te,G),ie(te,F))}function L(te){te.writing=!1,te.writecb=null,te.length-=te.writelen,te.writelen=0}function ee(te,F){var x=te._writableState,G=x.sync,H=x.writecb;if(typeof H!="function")throw new b;if(L(x),F)W(te,x,G,F,H);else{var B=oe(x)||te.destroyed;!B&&!x.corked&&!x.bufferProcessing&&x.bufferedRequest&&he(te,x),G?be.nextTick(J,te,x,B,H):J(te,x,B,H)}}function J(te,F,x,G){x||se(te,F),F.pendingcb--,G(),ie(te,F)}function se(te,F){F.length===0&&F.needDrain&&(F.needDrain=!1,te.emit("drain"))}function he(te,F){F.bufferProcessing=!0;var x=F.bufferedRequest;if(te._writev&&x&&x.next){var G=F.bufferedRequestCount,H=new Array(G),B=F.corkedRequestsFree;B.entry=x;for(var z=0,ge=!0;x;)H[z]=x,x.isBuf||(ge=!1),x=x.next,z+=1;H.allBuffers=ge,N(te,F,!0,F.length,H,"",B.finish),F.pendingcb++,F.lastBufferedRequest=null,B.next?(F.corkedRequestsFree=B.next,B.next=null):F.corkedRequestsFree=new e(F),F.bufferedRequestCount=0}else{for(;x;){var Re=x.chunk,De=x.encoding,Ce=x.callback,Ie=F.objectMode?1:Re.length;if(N(te,F,!1,Ie,Re,De,Ce),x=x.next,F.bufferedRequestCount--,F.writing)break}x===null&&(F.lastBufferedRequest=null)}F.bufferedRequest=x,F.bufferProcessing=!1}C.prototype._write=function(te,F,x){x(new m("_write()"))},C.prototype._writev=null,C.prototype.end=function(te,F,x){var G=this._writableState;return typeof te=="function"?(x=te,te=null,F=null):typeof F=="function"&&(x=F,F=null),te!=null&&this.write(te,F),G.corked&&(G.corked=1,this.uncork()),G.ending||le(this,G,x),this},Object.defineProperty(C.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function oe(te){return te.ending&&te.length===0&&te.bufferedRequest===null&&!te.finished&&!te.writing}function we(te,F){te._final(function(x){F.pendingcb--,x&&h(te,x),F.prefinished=!0,te.emit("prefinish"),ie(te,F)})}function X(te,F){!F.prefinished&&!F.finalCalled&&(typeof te._final=="function"&&!F.destroyed?(F.pendingcb++,F.finalCalled=!0,be.nextTick(we,te,F)):(F.prefinished=!0,te.emit("prefinish")))}function ie(te,F){var x=oe(F);if(x&&(X(te,F),F.pendingcb===0&&(F.finished=!0,te.emit("finish"),F.autoDestroy))){var G=te._readableState;(!G||G.autoDestroy&&G.endEmitted)&&te.destroy()}return x}function le(te,F,x){F.ending=!0,ie(te,F),x&&(F.finished?be.nextTick(x):te.once("finish",x)),F.ended=!0,te.writable=!1}function Ae(te,F,x){var G=te.entry;for(te.entry=null;G;){var H=G.callback;F.pendingcb--,H(x),G=G.next}F.corkedRequestsFree.next=te}return Object.defineProperty(C.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(F){this._writableState&&(this._writableState.destroyed=F)}}),C.prototype.destroy=l.destroy,C.prototype._undestroy=l.undestroy,C.prototype._destroy=function(te,F){F(te)},ju}var Uu,Xg;function qi(){if(Xg)return Uu;Xg=1;var e=Object.keys||function(u){var c=[];for(var d in u)c.push(d);return c};Uu=s;var t=ry(),n=Qg();ci()(s,t);for(var r=e(n.prototype),i=0;i<r.length;i++){var o=r[i];s.prototype[o]||(s.prototype[o]=n.prototype[o])}function s(u){if(!(this instanceof s))return new s(u);t.call(this,u),n.call(this,u),this.allowHalfOpen=!0,u&&(u.readable===!1&&(this.readable=!1),u.writable===!1&&(this.writable=!1),u.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",a)))}Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function a(){this._writableState.ended||be.nextTick(l,this)}function l(u){u.end()}return Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(c){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=c,this._writableState.destroyed=c)}}),Uu}var Vu={},ia={exports:{}};var Yg;function MC(){return Yg||(Yg=1,(function(e,t){var n=ta(),r=n.Buffer;function i(s,a){for(var l in s)a[l]=s[l]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=o);function o(s,a,l){return r(s,a,l)}o.prototype=Object.create(r.prototype),i(r,o),o.from=function(s,a,l){if(typeof s=="number")throw new TypeError("Argument must not be a number");return r(s,a,l)},o.alloc=function(s,a,l){if(typeof s!="number")throw new TypeError("Argument must be a number");var u=r(s);return a!==void 0?typeof l=="string"?u.fill(a,l):u.fill(a):u.fill(0),u},o.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r(s)},o.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(s)}})(ia,ia.exports)),ia.exports}var Jg;function qu(){if(Jg)return Vu;Jg=1;var e=MC().Buffer,t=e.isEncoding||function(y){switch(y=""+y,y&&y.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(y){if(!y)return"utf8";for(var g;;)switch(y){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return y;default:if(g)return;y=(""+y).toLowerCase(),g=!0}}function r(y){var g=n(y);if(typeof g!="string"&&(e.isEncoding===t||!t(y)))throw new Error("Unknown encoding: "+y);return g||y}Vu.StringDecoder=i;function i(y){this.encoding=r(y);var g;switch(this.encoding){case"utf16le":this.text=d,this.end=p,g=4;break;case"utf8":this.fillLast=l,g=4;break;case"base64":this.text=m,this.end=b,g=3;break;default:this.write=w,this.end=S;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(g)}i.prototype.write=function(y){if(y.length===0)return"";var g,v;if(this.lastNeed){if(g=this.fillLast(y),g===void 0)return"";v=this.lastNeed,this.lastNeed=0}else v=0;return v<y.length?g?g+this.text(y,v):this.text(y,v):g||""},i.prototype.end=c,i.prototype.text=u,i.prototype.fillLast=function(y){if(this.lastNeed<=y.length)return y.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);y.copy(this.lastChar,this.lastTotal-this.lastNeed,0,y.length),this.lastNeed-=y.length};function o(y){return y<=127?0:y>>5===6?2:y>>4===14?3:y>>3===30?4:y>>6===2?-1:-2}function s(y,g,v){var h=g.length-1;if(h<v)return 0;var E=o(g[h]);return E>=0?(E>0&&(y.lastNeed=E-1),E):--h<v||E===-2?0:(E=o(g[h]),E>=0?(E>0&&(y.lastNeed=E-2),E):--h<v||E===-2?0:(E=o(g[h]),E>=0?(E>0&&(E===2?E=0:y.lastNeed=E-3),E):0))}function a(y,g,v){if((g[0]&192)!==128)return y.lastNeed=0,"�";if(y.lastNeed>1&&g.length>1){if((g[1]&192)!==128)return y.lastNeed=1,"�";if(y.lastNeed>2&&g.length>2&&(g[2]&192)!==128)return y.lastNeed=2,"�"}}function l(y){var g=this.lastTotal-this.lastNeed,v=a(this,y);if(v!==void 0)return v;if(this.lastNeed<=y.length)return y.copy(this.lastChar,g,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);y.copy(this.lastChar,g,0,y.length),this.lastNeed-=y.length}function u(y,g){var v=s(this,y,g);if(!this.lastNeed)return y.toString("utf8",g);this.lastTotal=v;var h=y.length-(v-this.lastNeed);return y.copy(this.lastChar,0,h),y.toString("utf8",g,h)}function c(y){var g=y&&y.length?this.write(y):"";return this.lastNeed?g+"�":g}function d(y,g){if((y.length-g)%2===0){var v=y.toString("utf16le",g);if(v){var h=v.charCodeAt(v.length-1);if(h>=55296&&h<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=y[y.length-2],this.lastChar[1]=y[y.length-1],v.slice(0,-1)}return v}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=y[y.length-1],y.toString("utf16le",g,y.length-1)}function p(y){var g=y&&y.length?this.write(y):"";if(this.lastNeed){var v=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,v)}return g}function m(y,g){var v=(y.length-g)%3;return v===0?y.toString("base64",g):(this.lastNeed=3-v,this.lastTotal=3,v===1?this.lastChar[0]=y[y.length-1]:(this.lastChar[0]=y[y.length-2],this.lastChar[1]=y[y.length-1]),y.toString("base64",g,y.length-v))}function b(y){var g=y&&y.length?this.write(y):"";return this.lastNeed?g+this.lastChar.toString("base64",0,3-this.lastNeed):g}function w(y){return y.toString(this.encoding)}function S(y){return y&&y.length?this.write(y):""}return Vu}var zu,Zg;function Wu(){if(Zg)return zu;Zg=1;var e=Vi().codes.ERR_STREAM_PREMATURE_CLOSE;function t(o){var s=!1;return function(){if(!s){s=!0;for(var a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u];o.apply(this,l)}}}function n(){}function r(o){return o.setHeader&&typeof o.abort=="function"}function i(o,s,a){if(typeof s=="function")return i(o,null,s);s||(s={}),a=t(a||n);var l=s.readable||s.readable!==!1&&o.readable,u=s.writable||s.writable!==!1&&o.writable,c=function(){o.writable||p()},d=o._writableState&&o._writableState.finished,p=function(){u=!1,d=!0,l||a.call(o)},m=o._readableState&&o._readableState.endEmitted,b=function(){l=!1,m=!0,u||a.call(o)},w=function(v){a.call(o,v)},S=function(){var v;if(l&&!m)return(!o._readableState||!o._readableState.ended)&&(v=new e),a.call(o,v);if(u&&!d)return(!o._writableState||!o._writableState.ended)&&(v=new e),a.call(o,v)},y=function(){o.req.on("finish",p)};return r(o)?(o.on("complete",p),o.on("abort",S),o.req?y():o.on("request",y)):u&&!o._writableState&&(o.on("end",c),o.on("close",c)),o.on("end",b),o.on("finish",p),s.error!==!1&&o.on("error",w),o.on("close",S),function(){o.removeListener("complete",p),o.removeListener("abort",S),o.removeListener("request",y),o.req&&o.req.removeListener("finish",p),o.removeListener("end",c),o.removeListener("close",c),o.removeListener("finish",p),o.removeListener("end",b),o.removeListener("error",w),o.removeListener("close",S)}}return zu=i,zu}var Hu,ey;function BC(){if(ey)return Hu;ey=1;var e;function t(v,h,E){return h=n(h),h in v?Object.defineProperty(v,h,{value:E,enumerable:!0,configurable:!0,writable:!0}):v[h]=E,v}function n(v){var h=r(v,"string");return typeof h=="symbol"?h:String(h)}function r(v,h){if(typeof v!="object"||v===null)return v;var E=v[Symbol.toPrimitive];if(E!==void 0){var T=E.call(v,h);if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(v)}var i=Wu(),o=Symbol("lastResolve"),s=Symbol("lastReject"),a=Symbol("error"),l=Symbol("ended"),u=Symbol("lastPromise"),c=Symbol("handlePromise"),d=Symbol("stream");function p(v,h){return{value:v,done:h}}function m(v){var h=v[o];if(h!==null){var E=v[d].read();E!==null&&(v[u]=null,v[o]=null,v[s]=null,h(p(E,!1)))}}function b(v){be.nextTick(m,v)}function w(v,h){return function(E,T){v.then(function(){if(h[l]){E(p(void 0,!0));return}h[c](E,T)},T)}}var S=Object.getPrototypeOf(function(){}),y=Object.setPrototypeOf((e={get stream(){return this[d]},next:function(){var h=this,E=this[a];if(E!==null)return Promise.reject(E);if(this[l])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise(function(A,D){be.nextTick(function(){h[a]?D(h[a]):A(p(void 0,!0))})});var T=this[u],R;if(T)R=new Promise(w(T,this));else{var C=this[d].read();if(C!==null)return Promise.resolve(p(C,!1));R=new Promise(this[c])}return this[u]=R,R}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var h=this;return new Promise(function(E,T){h[d].destroy(null,function(R){if(R){T(R);return}E(p(void 0,!0))})})}),e),S),g=function(h){var E,T=Object.create(y,(E={},t(E,d,{value:h,writable:!0}),t(E,o,{value:null,writable:!0}),t(E,s,{value:null,writable:!0}),t(E,a,{value:null,writable:!0}),t(E,l,{value:h._readableState.endEmitted,writable:!0}),t(E,c,{value:function(C,A){var D=T[d].read();D?(T[u]=null,T[o]=null,T[s]=null,C(p(D,!1))):(T[o]=C,T[s]=A)},writable:!0}),E));return T[u]=null,i(h,function(R){if(R&&R.code!=="ERR_STREAM_PREMATURE_CLOSE"){var C=T[s];C!==null&&(T[u]=null,T[o]=null,T[s]=null,C(R)),T[a]=R;return}var A=T[o];A!==null&&(T[u]=null,T[o]=null,T[s]=null,A(p(void 0,!0))),T[l]=!0}),h.on("readable",b.bind(null,T)),T};return Hu=g,Hu}var Ku,ty;function jC(){return ty||(ty=1,Ku=function(){throw new Error("Readable.from is not available in the browser")}),Ku}var Gu,ny;function ry(){if(ny)return Gu;ny=1,Gu=A;var e;A.ReadableState=C,kc().EventEmitter;var t=function(z,ge){return z.listeners(ge).length},n=Pm(),r=ta().Buffer,i=(typeof zr<"u"?zr:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(B){return r.from(B)}function s(B){return r.isBuffer(B)||B instanceof i}var a=jg(),l;a&&a.debuglog?l=a.debuglog("stream"):l=function(){};var u=LC(),c=qg(),d=Hg(),p=d.getHighWaterMark,m=Vi().codes,b=m.ERR_INVALID_ARG_TYPE,w=m.ERR_STREAM_PUSH_AFTER_EOF,S=m.ERR_METHOD_NOT_IMPLEMENTED,y=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,g,v,h;ci()(A,n);var E=c.errorOrDestroy,T=["error","close","destroy","pause","resume"];function R(B,z,ge){if(typeof B.prependListener=="function")return B.prependListener(z,ge);!B._events||!B._events[z]?B.on(z,ge):Array.isArray(B._events[z])?B._events[z].unshift(ge):B._events[z]=[ge,B._events[z]]}function C(B,z,ge){e=e||qi(),B=B||{},typeof ge!="boolean"&&(ge=z instanceof e),this.objectMode=!!B.objectMode,ge&&(this.objectMode=this.objectMode||!!B.readableObjectMode),this.highWaterMark=p(this,B,"readableHighWaterMark",ge),this.buffer=new u,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=B.emitClose!==!1,this.autoDestroy=!!B.autoDestroy,this.destroyed=!1,this.defaultEncoding=B.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,B.encoding&&(g||(g=qu().StringDecoder),this.decoder=new g(B.encoding),this.encoding=B.encoding)}function A(B){if(e=e||qi(),!(this instanceof A))return new A(B);var z=this instanceof e;this._readableState=new C(B,this,z),this.readable=!0,B&&(typeof B.read=="function"&&(this._read=B.read),typeof B.destroy=="function"&&(this._destroy=B.destroy)),n.call(this)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(z){this._readableState&&(this._readableState.destroyed=z)}}),A.prototype.destroy=c.destroy,A.prototype._undestroy=c.undestroy,A.prototype._destroy=function(B,z){z(B)},A.prototype.push=function(B,z){var ge=this._readableState,Re;return ge.objectMode?Re=!0:typeof B=="string"&&(z=z||ge.defaultEncoding,z!==ge.encoding&&(B=r.from(B,z),z=""),Re=!0),D(this,B,z,!1,Re)},A.prototype.unshift=function(B){return D(this,B,null,!0,!1)};function D(B,z,ge,Re,De){l("readableAddChunk",z);var Ce=B._readableState;if(z===null)Ce.reading=!1,ee(B,Ce);else{var Ie;if(De||(Ie=O(Ce,z)),Ie)E(B,Ie);else if(Ce.objectMode||z&&z.length>0)if(typeof z!="string"&&!Ce.objectMode&&Object.getPrototypeOf(z)!==r.prototype&&(z=o(z)),Re)Ce.endEmitted?E(B,new y):V(B,Ce,z,!0);else if(Ce.ended)E(B,new w);else{if(Ce.destroyed)return!1;Ce.reading=!1,Ce.decoder&&!ge?(z=Ce.decoder.write(z),Ce.objectMode||z.length!==0?V(B,Ce,z,!1):he(B,Ce)):V(B,Ce,z,!1)}else Re||(Ce.reading=!1,he(B,Ce))}return!Ce.ended&&(Ce.length<Ce.highWaterMark||Ce.length===0)}function V(B,z,ge,Re){z.flowing&&z.length===0&&!z.sync?(z.awaitDrain=0,B.emit("data",ge)):(z.length+=z.objectMode?1:ge.length,Re?z.buffer.unshift(ge):z.buffer.push(ge),z.needReadable&&J(B)),he(B,z)}function O(B,z){var ge;return!s(z)&&typeof z!="string"&&z!==void 0&&!B.objectMode&&(ge=new b("chunk",["string","Buffer","Uint8Array"],z)),ge}A.prototype.isPaused=function(){return this._readableState.flowing===!1},A.prototype.setEncoding=function(B){g||(g=qu().StringDecoder);var z=new g(B);this._readableState.decoder=z,this._readableState.encoding=this._readableState.decoder.encoding;for(var ge=this._readableState.buffer.head,Re="";ge!==null;)Re+=z.write(ge.data),ge=ge.next;return this._readableState.buffer.clear(),Re!==""&&this._readableState.buffer.push(Re),this._readableState.length=Re.length,this};var N=1073741824;function W(B){return B>=N?B=N:(B--,B|=B>>>1,B|=B>>>2,B|=B>>>4,B|=B>>>8,B|=B>>>16,B++),B}function L(B,z){return B<=0||z.length===0&&z.ended?0:z.objectMode?1:B!==B?z.flowing&&z.length?z.buffer.head.data.length:z.length:(B>z.highWaterMark&&(z.highWaterMark=W(B)),B<=z.length?B:z.ended?z.length:(z.needReadable=!0,0))}A.prototype.read=function(B){l("read",B),B=parseInt(B,10);var z=this._readableState,ge=B;if(B!==0&&(z.emittedReadable=!1),B===0&&z.needReadable&&((z.highWaterMark!==0?z.length>=z.highWaterMark:z.length>0)||z.ended))return l("read: emitReadable",z.length,z.ended),z.length===0&&z.ended?x(this):J(this),null;if(B=L(B,z),B===0&&z.ended)return z.length===0&&x(this),null;var Re=z.needReadable;l("need readable",Re),(z.length===0||z.length-B<z.highWaterMark)&&(Re=!0,l("length less than watermark",Re)),z.ended||z.reading?(Re=!1,l("reading or ended",Re)):Re&&(l("do read"),z.reading=!0,z.sync=!0,z.length===0&&(z.needReadable=!0),this._read(z.highWaterMark),z.sync=!1,z.reading||(B=L(ge,z)));var De;return B>0?De=F(B,z):De=null,De===null?(z.needReadable=z.length<=z.highWaterMark,B=0):(z.length-=B,z.awaitDrain=0),z.length===0&&(z.ended||(z.needReadable=!0),ge!==B&&z.ended&&x(this)),De!==null&&this.emit("data",De),De};function ee(B,z){if(l("onEofChunk"),!z.ended){if(z.decoder){var ge=z.decoder.end();ge&&ge.length&&(z.buffer.push(ge),z.length+=z.objectMode?1:ge.length)}z.ended=!0,z.sync?J(B):(z.needReadable=!1,z.emittedReadable||(z.emittedReadable=!0,se(B)))}}function J(B){var z=B._readableState;l("emitReadable",z.needReadable,z.emittedReadable),z.needReadable=!1,z.emittedReadable||(l("emitReadable",z.flowing),z.emittedReadable=!0,be.nextTick(se,B))}function se(B){var z=B._readableState;l("emitReadable_",z.destroyed,z.length,z.ended),!z.destroyed&&(z.length||z.ended)&&(B.emit("readable"),z.emittedReadable=!1),z.needReadable=!z.flowing&&!z.ended&&z.length<=z.highWaterMark,te(B)}function he(B,z){z.readingMore||(z.readingMore=!0,be.nextTick(oe,B,z))}function oe(B,z){for(;!z.reading&&!z.ended&&(z.length<z.highWaterMark||z.flowing&&z.length===0);){var ge=z.length;if(l("maybeReadMore read 0"),B.read(0),ge===z.length)break}z.readingMore=!1}A.prototype._read=function(B){E(this,new S("_read()"))},A.prototype.pipe=function(B,z){var ge=this,Re=this._readableState;switch(Re.pipesCount){case 0:Re.pipes=B;break;case 1:Re.pipes=[Re.pipes,B];break;default:Re.pipes.push(B);break}Re.pipesCount+=1,l("pipe count=%d opts=%j",Re.pipesCount,z);var De=(!z||z.end!==!1)&&B!==be.stdout&&B!==be.stderr,Ce=De?$e:Et;Re.endEmitted?be.nextTick(Ce):ge.once("end",Ce),B.on("unpipe",Ie);function Ie(Tt,at){l("onunpipe"),Tt===ge&&at&&at.hasUnpiped===!1&&(at.hasUnpiped=!0,Ge())}function $e(){l("onend"),B.end()}var ye=we(ge);B.on("drain",ye);var Ke=!1;function Ge(){l("cleanup"),B.removeListener("close",wt),B.removeListener("finish",St),B.removeListener("drain",ye),B.removeListener("error",Ze),B.removeListener("unpipe",Ie),ge.removeListener("end",$e),ge.removeListener("end",Et),ge.removeListener("data",Ye),Ke=!0,Re.awaitDrain&&(!B._writableState||B._writableState.needDrain)&&ye()}ge.on("data",Ye);function Ye(Tt){l("ondata");var at=B.write(Tt);l("dest.write",at),at===!1&&((Re.pipesCount===1&&Re.pipes===B||Re.pipesCount>1&&H(Re.pipes,B)!==-1)&&!Ke&&(l("false write response, pause",Re.awaitDrain),Re.awaitDrain++),ge.pause())}function Ze(Tt){l("onerror",Tt),Et(),B.removeListener("error",Ze),t(B,"error")===0&&E(B,Tt)}R(B,"error",Ze);function wt(){B.removeListener("finish",St),Et()}B.once("close",wt);function St(){l("onfinish"),B.removeListener("close",wt),Et()}B.once("finish",St);function Et(){l("unpipe"),ge.unpipe(B)}return B.emit("pipe",ge),Re.flowing||(l("pipe resume"),ge.resume()),B};function we(B){return function(){var ge=B._readableState;l("pipeOnDrain",ge.awaitDrain),ge.awaitDrain&&ge.awaitDrain--,ge.awaitDrain===0&&t(B,"data")&&(ge.flowing=!0,te(B))}}A.prototype.unpipe=function(B){var z=this._readableState,ge={hasUnpiped:!1};if(z.pipesCount===0)return this;if(z.pipesCount===1)return B&&B!==z.pipes?this:(B||(B=z.pipes),z.pipes=null,z.pipesCount=0,z.flowing=!1,B&&B.emit("unpipe",this,ge),this);if(!B){var Re=z.pipes,De=z.pipesCount;z.pipes=null,z.pipesCount=0,z.flowing=!1;for(var Ce=0;Ce<De;Ce++)Re[Ce].emit("unpipe",this,{hasUnpiped:!1});return this}var Ie=H(z.pipes,B);return Ie===-1?this:(z.pipes.splice(Ie,1),z.pipesCount-=1,z.pipesCount===1&&(z.pipes=z.pipes[0]),B.emit("unpipe",this,ge),this)},A.prototype.on=function(B,z){var ge=n.prototype.on.call(this,B,z),Re=this._readableState;return B==="data"?(Re.readableListening=this.listenerCount("readable")>0,Re.flowing!==!1&&this.resume()):B==="readable"&&!Re.endEmitted&&!Re.readableListening&&(Re.readableListening=Re.needReadable=!0,Re.flowing=!1,Re.emittedReadable=!1,l("on readable",Re.length,Re.reading),Re.length?J(this):Re.reading||be.nextTick(ie,this)),ge},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(B,z){var ge=n.prototype.removeListener.call(this,B,z);return B==="readable"&&be.nextTick(X,this),ge},A.prototype.removeAllListeners=function(B){var z=n.prototype.removeAllListeners.apply(this,arguments);return(B==="readable"||B===void 0)&&be.nextTick(X,this),z};function X(B){var z=B._readableState;z.readableListening=B.listenerCount("readable")>0,z.resumeScheduled&&!z.paused?z.flowing=!0:B.listenerCount("data")>0&&B.resume()}function ie(B){l("readable nexttick read 0"),B.read(0)}A.prototype.resume=function(){var B=this._readableState;return B.flowing||(l("resume"),B.flowing=!B.readableListening,le(this,B)),B.paused=!1,this};function le(B,z){z.resumeScheduled||(z.resumeScheduled=!0,be.nextTick(Ae,B,z))}function Ae(B,z){l("resume",z.reading),z.reading||B.read(0),z.resumeScheduled=!1,B.emit("resume"),te(B),z.flowing&&!z.reading&&B.read(0)}A.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function te(B){var z=B._readableState;for(l("flow",z.flowing);z.flowing&&B.read()!==null;);}A.prototype.wrap=function(B){var z=this,ge=this._readableState,Re=!1;B.on("end",function(){if(l("wrapped end"),ge.decoder&&!ge.ended){var Ie=ge.decoder.end();Ie&&Ie.length&&z.push(Ie)}z.push(null)}),B.on("data",function(Ie){if(l("wrapped data"),ge.decoder&&(Ie=ge.decoder.write(Ie)),!(ge.objectMode&&Ie==null)&&!(!ge.objectMode&&(!Ie||!Ie.length))){var $e=z.push(Ie);$e||(Re=!0,B.pause())}});for(var De in B)this[De]===void 0&&typeof B[De]=="function"&&(this[De]=(function($e){return function(){return B[$e].apply(B,arguments)}})(De));for(var Ce=0;Ce<T.length;Ce++)B.on(T[Ce],this.emit.bind(this,T[Ce]));return this._read=function(Ie){l("wrapped _read",Ie),Re&&(Re=!1,B.resume())},this},typeof Symbol=="function"&&(A.prototype[Symbol.asyncIterator]=function(){return v===void 0&&(v=BC()),v(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(z){this._readableState&&(this._readableState.flowing=z)}}),A._fromList=F,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function F(B,z){if(z.length===0)return null;var ge;return z.objectMode?ge=z.buffer.shift():!B||B>=z.length?(z.decoder?ge=z.buffer.join(""):z.buffer.length===1?ge=z.buffer.first():ge=z.buffer.concat(z.length),z.buffer.clear()):ge=z.buffer.consume(B,z.decoder),ge}function x(B){var z=B._readableState;l("endReadable",z.endEmitted),z.endEmitted||(z.ended=!0,be.nextTick(G,z,B))}function G(B,z){if(l("endReadableNT",B.endEmitted,B.length),!B.endEmitted&&B.length===0&&(B.endEmitted=!0,z.readable=!1,z.emit("end"),B.autoDestroy)){var ge=z._writableState;(!ge||ge.autoDestroy&&ge.finished)&&z.destroy()}}typeof Symbol=="function"&&(A.from=function(B,z){return h===void 0&&(h=jC()),h(A,B,z)});function H(B,z){for(var ge=0,Re=B.length;ge<Re;ge++)if(B[ge]===z)return ge;return-1}return Gu}var Qu,iy;function oy(){if(iy)return Qu;iy=1,Qu=a;var e=Vi().codes,t=e.ERR_METHOD_NOT_IMPLEMENTED,n=e.ERR_MULTIPLE_CALLBACK,r=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,i=e.ERR_TRANSFORM_WITH_LENGTH_0,o=qi();ci()(a,o);function s(c,d){var p=this._transformState;p.transforming=!1;var m=p.writecb;if(m===null)return this.emit("error",new n);p.writechunk=null,p.writecb=null,d!=null&&this.push(d),m(c);var b=this._readableState;b.reading=!1,(b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark)}function a(c){if(!(this instanceof a))return new a(c);o.call(this,c),this._transformState={afterTransform:s.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,c&&(typeof c.transform=="function"&&(this._transform=c.transform),typeof c.flush=="function"&&(this._flush=c.flush)),this.on("prefinish",l)}function l(){var c=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(d,p){u(c,d,p)}):u(this,null,null)}a.prototype.push=function(c,d){return this._transformState.needTransform=!1,o.prototype.push.call(this,c,d)},a.prototype._transform=function(c,d,p){p(new t("_transform()"))},a.prototype._write=function(c,d,p){var m=this._transformState;if(m.writecb=p,m.writechunk=c,m.writeencoding=d,!m.transforming){var b=this._readableState;(m.needTransform||b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark)}},a.prototype._read=function(c){var d=this._transformState;d.writechunk!==null&&!d.transforming?(d.transforming=!0,this._transform(d.writechunk,d.writeencoding,d.afterTransform)):d.needTransform=!0},a.prototype._destroy=function(c,d){o.prototype._destroy.call(this,c,function(p){d(p)})};function u(c,d,p){if(d)return c.emit("error",d);if(p!=null&&c.push(p),c._writableState.length)throw new i;if(c._transformState.transforming)throw new r;return c.push(null)}return Qu}var Xu,sy;function UC(){if(sy)return Xu;sy=1,Xu=t;var e=oy();ci()(t,e);function t(n){if(!(this instanceof t))return new t(n);e.call(this,n)}return t.prototype._transform=function(n,r,i){i(null,n)},Xu}var Yu,ay;function VC(){if(ay)return Yu;ay=1;var e;function t(p){var m=!1;return function(){m||(m=!0,p.apply(void 0,arguments))}}var n=Vi().codes,r=n.ERR_MISSING_ARGS,i=n.ERR_STREAM_DESTROYED;function o(p){if(p)throw p}function s(p){return p.setHeader&&typeof p.abort=="function"}function a(p,m,b,w){w=t(w);var S=!1;p.on("close",function(){S=!0}),e===void 0&&(e=Wu()),e(p,{readable:m,writable:b},function(g){if(g)return w(g);S=!0,w()});var y=!1;return function(g){if(!S&&!y){if(y=!0,s(p))return p.abort();if(typeof p.destroy=="function")return p.destroy();w(g||new i("pipe"))}}}function l(p){p()}function u(p,m){return p.pipe(m)}function c(p){return!p.length||typeof p[p.length-1]!="function"?o:p.pop()}function d(){for(var p=arguments.length,m=new Array(p),b=0;b<p;b++)m[b]=arguments[b];var w=c(m);if(Array.isArray(m[0])&&(m=m[0]),m.length<2)throw new r("streams");var S,y=m.map(function(g,v){var h=v<m.length-1,E=v>0;return a(g,h,E,function(T){S||(S=T),T&&y.forEach(l),!h&&(y.forEach(l),w(S))})});return m.reduce(u)}return Yu=d,Yu}var Ju,ly;function qC(){if(ly)return Ju;ly=1,Ju=n;var e=kc().EventEmitter,t=ci();t(n,e),n.Readable=ry(),n.Writable=Qg(),n.Duplex=qi(),n.Transform=oy(),n.PassThrough=UC(),n.finished=Wu(),n.pipeline=VC(),n.Stream=n;function n(){e.call(this)}return n.prototype.pipe=function(r,i){var o=this;function s(m){r.writable&&r.write(m)===!1&&o.pause&&o.pause()}o.on("data",s);function a(){o.readable&&o.resume&&o.resume()}r.on("drain",a),!r._isStdio&&(!i||i.end!==!1)&&(o.on("end",u),o.on("close",c));var l=!1;function u(){l||(l=!0,r.end())}function c(){l||(l=!0,typeof r.destroy=="function"&&r.destroy())}function d(m){if(p(),e.listenerCount(this,"error")===0)throw m}o.on("error",d),r.on("error",d);function p(){o.removeListener("data",s),r.removeListener("drain",a),o.removeListener("end",u),o.removeListener("close",c),o.removeListener("error",d),r.removeListener("error",d),o.removeListener("end",p),o.removeListener("close",p),r.removeListener("close",p)}return o.on("end",p),o.on("close",p),r.on("close",p),r.emit("pipe",o),r},Ju}var cy;function zC(){return cy||(cy=1,(function(e){(function(t){t.parser=function(F,x){return new r(F,x)},t.SAXParser=r,t.SAXStream=c,t.createStream=u,t.MAX_BUFFER_LENGTH=64*1024;var n=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function r(F,x){if(!(this instanceof r))return new r(F,x);var G=this;o(G),G.q=G.c="",G.bufferCheckPosition=t.MAX_BUFFER_LENGTH,G.opt=x||{},G.opt.lowercase=G.opt.lowercase||G.opt.lowercasetags,G.looseCase=G.opt.lowercase?"toLowerCase":"toUpperCase",G.tags=[],G.closed=G.closedRoot=G.sawRoot=!1,G.tag=G.error=null,G.strict=!!F,G.noscript=!!(F||G.opt.noscript),G.state=A.BEGIN,G.strictEntities=G.opt.strictEntities,G.ENTITIES=G.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),G.attribList=[],G.opt.xmlns&&(G.ns=Object.create(w)),G.opt.unquotedAttributeValues===void 0&&(G.opt.unquotedAttributeValues=!F),G.trackPosition=G.opt.position!==!1,G.trackPosition&&(G.position=G.line=G.column=0),V(G,"onready")}Object.create||(Object.create=function(F){function x(){}x.prototype=F;var G=new x;return G}),Object.keys||(Object.keys=function(F){var x=[];for(var G in F)F.hasOwnProperty(G)&&x.push(G);return x});function i(F){for(var x=Math.max(t.MAX_BUFFER_LENGTH,10),G=0,H=0,B=n.length;H<B;H++){var z=F[n[H]].length;if(z>x)switch(n[H]){case"textNode":N(F);break;case"cdata":O(F,"oncdata",F.cdata),F.cdata="";break;case"script":O(F,"onscript",F.script),F.script="";break;default:L(F,"Max buffer length exceeded: "+n[H])}G=Math.max(G,z)}var ge=t.MAX_BUFFER_LENGTH-G;F.bufferCheckPosition=ge+F.position}function o(F){for(var x=0,G=n.length;x<G;x++)F[n[x]]=""}function s(F){N(F),F.cdata!==""&&(O(F,"oncdata",F.cdata),F.cdata=""),F.script!==""&&(O(F,"onscript",F.script),F.script="")}r.prototype={end:function(){ee(this)},write:te,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){s(this)}};var a;try{a=qC().Stream}catch{a=function(){}}a||(a=function(){});var l=t.EVENTS.filter(function(F){return F!=="error"&&F!=="end"});function u(F,x){return new c(F,x)}function c(F,x){if(!(this instanceof c))return new c(F,x);a.apply(this),this._parser=new r(F,x),this.writable=!0,this.readable=!0;var G=this;this._parser.onend=function(){G.emit("end")},this._parser.onerror=function(H){G.emit("error",H),G._parser.error=null},this._decoder=null,l.forEach(function(H){Object.defineProperty(G,"on"+H,{get:function(){return G._parser["on"+H]},set:function(B){if(!B)return G.removeAllListeners(H),G._parser["on"+H]=B,B;G.on(H,B)},enumerable:!0,configurable:!1})})}c.prototype=Object.create(a.prototype,{constructor:{value:c}}),c.prototype.write=function(F){if(typeof Kr=="function"&&typeof Kr.isBuffer=="function"&&Kr.isBuffer(F)){if(!this._decoder){var x=qu().StringDecoder;this._decoder=new x("utf8")}F=this._decoder.write(F)}return this._parser.write(F.toString()),this.emit("data",F),!0},c.prototype.end=function(F){return F&&F.length&&this.write(F),this._parser.end(),!0},c.prototype.on=function(F,x){var G=this;return!G._parser["on"+F]&&l.indexOf(F)!==-1&&(G._parser["on"+F]=function(){var H=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);H.splice(0,0,F),G.emit.apply(G,H)}),a.prototype.on.call(G,F,x)};var d="[CDATA[",p="DOCTYPE",m="http://www.w3.org/XML/1998/namespace",b="http://www.w3.org/2000/xmlns/",w={xml:m,xmlns:b},S=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,y=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,g=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,v=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function h(F){return F===" "||F===`
16
- `||F==="\r"||F===" "}function E(F){return F==='"'||F==="'"}function T(F){return F===">"||h(F)}function R(F,x){return F.test(x)}function C(F,x){return!R(F,x)}var A=0;t.STATE={BEGIN:A++,BEGIN_WHITESPACE:A++,TEXT:A++,TEXT_ENTITY:A++,OPEN_WAKA:A++,SGML_DECL:A++,SGML_DECL_QUOTED:A++,DOCTYPE:A++,DOCTYPE_QUOTED:A++,DOCTYPE_DTD:A++,DOCTYPE_DTD_QUOTED:A++,COMMENT_STARTING:A++,COMMENT:A++,COMMENT_ENDING:A++,COMMENT_ENDED:A++,CDATA:A++,CDATA_ENDING:A++,CDATA_ENDING_2:A++,PROC_INST:A++,PROC_INST_BODY:A++,PROC_INST_ENDING:A++,OPEN_TAG:A++,OPEN_TAG_SLASH:A++,ATTRIB:A++,ATTRIB_NAME:A++,ATTRIB_NAME_SAW_WHITE:A++,ATTRIB_VALUE:A++,ATTRIB_VALUE_QUOTED:A++,ATTRIB_VALUE_CLOSED:A++,ATTRIB_VALUE_UNQUOTED:A++,ATTRIB_VALUE_ENTITY_Q:A++,ATTRIB_VALUE_ENTITY_U:A++,CLOSE_TAG:A++,CLOSE_TAG_SAW_WHITE:A++,SCRIPT:A++,SCRIPT_ENDING:A++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach(function(F){var x=t.ENTITIES[F],G=typeof x=="number"?String.fromCharCode(x):x;t.ENTITIES[F]=G});for(var D in t.STATE)t.STATE[t.STATE[D]]=D;A=t.STATE;function V(F,x,G){F[x]&&F[x](G)}function O(F,x,G){F.textNode&&N(F),V(F,x,G)}function N(F){F.textNode=W(F.opt,F.textNode),F.textNode&&V(F,"ontext",F.textNode),F.textNode=""}function W(F,x){return F.trim&&(x=x.trim()),F.normalize&&(x=x.replace(/\s+/g," ")),x}function L(F,x){return N(F),F.trackPosition&&(x+=`
17
- Line: `+F.line+`
18
- Column: `+F.column+`
19
- Char: `+F.c),x=new Error(x),F.error=x,V(F,"onerror",x),F}function ee(F){return F.sawRoot&&!F.closedRoot&&J(F,"Unclosed root tag"),F.state!==A.BEGIN&&F.state!==A.BEGIN_WHITESPACE&&F.state!==A.TEXT&&L(F,"Unexpected end"),N(F),F.c="",F.closed=!0,V(F,"onend"),r.call(F,F.strict,F.opt),F}function J(F,x){if(typeof F!="object"||!(F instanceof r))throw new Error("bad call to strictFail");F.strict&&L(F,x)}function se(F){F.strict||(F.tagName=F.tagName[F.looseCase]());var x=F.tags[F.tags.length-1]||F,G=F.tag={name:F.tagName,attributes:{}};F.opt.xmlns&&(G.ns=x.ns),F.attribList.length=0,O(F,"onopentagstart",G)}function he(F,x){var G=F.indexOf(":"),H=G<0?["",F]:F.split(":"),B=H[0],z=H[1];return x&&F==="xmlns"&&(B="xmlns",z=""),{prefix:B,local:z}}function oe(F){if(F.strict||(F.attribName=F.attribName[F.looseCase]()),F.attribList.indexOf(F.attribName)!==-1||F.tag.attributes.hasOwnProperty(F.attribName)){F.attribName=F.attribValue="";return}if(F.opt.xmlns){var x=he(F.attribName,!0),G=x.prefix,H=x.local;if(G==="xmlns")if(H==="xml"&&F.attribValue!==m)J(F,"xml: prefix must be bound to "+m+`
20
- Actual: `+F.attribValue);else if(H==="xmlns"&&F.attribValue!==b)J(F,"xmlns: prefix must be bound to "+b+`
21
- Actual: `+F.attribValue);else{var B=F.tag,z=F.tags[F.tags.length-1]||F;B.ns===z.ns&&(B.ns=Object.create(z.ns)),B.ns[H]=F.attribValue}F.attribList.push([F.attribName,F.attribValue])}else F.tag.attributes[F.attribName]=F.attribValue,O(F,"onattribute",{name:F.attribName,value:F.attribValue});F.attribName=F.attribValue=""}function we(F,x){if(F.opt.xmlns){var G=F.tag,H=he(F.tagName);G.prefix=H.prefix,G.local=H.local,G.uri=G.ns[H.prefix]||"",G.prefix&&!G.uri&&(J(F,"Unbound namespace prefix: "+JSON.stringify(F.tagName)),G.uri=H.prefix);var B=F.tags[F.tags.length-1]||F;G.ns&&B.ns!==G.ns&&Object.keys(G.ns).forEach(function(Ye){O(F,"onopennamespace",{prefix:Ye,uri:G.ns[Ye]})});for(var z=0,ge=F.attribList.length;z<ge;z++){var Re=F.attribList[z],De=Re[0],Ce=Re[1],Ie=he(De,!0),$e=Ie.prefix,ye=Ie.local,Ke=$e===""?"":G.ns[$e]||"",Ge={name:De,value:Ce,prefix:$e,local:ye,uri:Ke};$e&&$e!=="xmlns"&&!Ke&&(J(F,"Unbound namespace prefix: "+JSON.stringify($e)),Ge.uri=$e),F.tag.attributes[De]=Ge,O(F,"onattribute",Ge)}F.attribList.length=0}F.tag.isSelfClosing=!!x,F.sawRoot=!0,F.tags.push(F.tag),O(F,"onopentag",F.tag),x||(!F.noscript&&F.tagName.toLowerCase()==="script"?F.state=A.SCRIPT:F.state=A.TEXT,F.tag=null,F.tagName=""),F.attribName=F.attribValue="",F.attribList.length=0}function X(F){if(!F.tagName){J(F,"Weird empty close tag."),F.textNode+="</>",F.state=A.TEXT;return}if(F.script){if(F.tagName!=="script"){F.script+="</"+F.tagName+">",F.tagName="",F.state=A.SCRIPT;return}O(F,"onscript",F.script),F.script=""}var x=F.tags.length,G=F.tagName;F.strict||(G=G[F.looseCase]());for(var H=G;x--;){var B=F.tags[x];if(B.name!==H)J(F,"Unexpected close tag");else break}if(x<0){J(F,"Unmatched closing tag: "+F.tagName),F.textNode+="</"+F.tagName+">",F.state=A.TEXT;return}F.tagName=G;for(var z=F.tags.length;z-- >x;){var ge=F.tag=F.tags.pop();F.tagName=F.tag.name,O(F,"onclosetag",F.tagName);var Re={};for(var De in ge.ns)Re[De]=ge.ns[De];var Ce=F.tags[F.tags.length-1]||F;F.opt.xmlns&&ge.ns!==Ce.ns&&Object.keys(ge.ns).forEach(function(Ie){var $e=ge.ns[Ie];O(F,"onclosenamespace",{prefix:Ie,uri:$e})})}x===0&&(F.closedRoot=!0),F.tagName=F.attribValue=F.attribName="",F.attribList.length=0,F.state=A.TEXT}function ie(F){var x=F.entity,G=x.toLowerCase(),H,B="";return F.ENTITIES[x]?F.ENTITIES[x]:F.ENTITIES[G]?F.ENTITIES[G]:(x=G,x.charAt(0)==="#"&&(x.charAt(1)==="x"?(x=x.slice(2),H=parseInt(x,16),B=H.toString(16)):(x=x.slice(1),H=parseInt(x,10),B=H.toString(10))),x=x.replace(/^0+/,""),isNaN(H)||B.toLowerCase()!==x?(J(F,"Invalid character entity"),"&"+F.entity+";"):String.fromCodePoint(H))}function le(F,x){x==="<"?(F.state=A.OPEN_WAKA,F.startTagPosition=F.position):h(x)||(J(F,"Non-whitespace before first tag."),F.textNode=x,F.state=A.TEXT)}function Ae(F,x){var G="";return x<F.length&&(G=F.charAt(x)),G}function te(F){var x=this;if(this.error)throw this.error;if(x.closed)return L(x,"Cannot write after close. Assign an onready handler.");if(F===null)return ee(x);typeof F=="object"&&(F=F.toString());for(var G=0,H="";H=Ae(F,G++),x.c=H,!!H;)switch(x.trackPosition&&(x.position++,H===`
22
- `?(x.line++,x.column=0):x.column++),x.state){case A.BEGIN:if(x.state=A.BEGIN_WHITESPACE,H==="\uFEFF")continue;le(x,H);continue;case A.BEGIN_WHITESPACE:le(x,H);continue;case A.TEXT:if(x.sawRoot&&!x.closedRoot){for(var B=G-1;H&&H!=="<"&&H!=="&";)H=Ae(F,G++),H&&x.trackPosition&&(x.position++,H===`
23
- `?(x.line++,x.column=0):x.column++);x.textNode+=F.substring(B,G-1)}H==="<"&&!(x.sawRoot&&x.closedRoot&&!x.strict)?(x.state=A.OPEN_WAKA,x.startTagPosition=x.position):(!h(H)&&(!x.sawRoot||x.closedRoot)&&J(x,"Text data outside of root node."),H==="&"?x.state=A.TEXT_ENTITY:x.textNode+=H);continue;case A.SCRIPT:H==="<"?x.state=A.SCRIPT_ENDING:x.script+=H;continue;case A.SCRIPT_ENDING:H==="/"?x.state=A.CLOSE_TAG:(x.script+="<"+H,x.state=A.SCRIPT);continue;case A.OPEN_WAKA:if(H==="!")x.state=A.SGML_DECL,x.sgmlDecl="";else if(!h(H))if(R(S,H))x.state=A.OPEN_TAG,x.tagName=H;else if(H==="/")x.state=A.CLOSE_TAG,x.tagName="";else if(H==="?")x.state=A.PROC_INST,x.procInstName=x.procInstBody="";else{if(J(x,"Unencoded <"),x.startTagPosition+1<x.position){var z=x.position-x.startTagPosition;H=new Array(z).join(" ")+H}x.textNode+="<"+H,x.state=A.TEXT}continue;case A.SGML_DECL:if(x.sgmlDecl+H==="--"){x.state=A.COMMENT,x.comment="",x.sgmlDecl="";continue}x.doctype&&x.doctype!==!0&&x.sgmlDecl?(x.state=A.DOCTYPE_DTD,x.doctype+="<!"+x.sgmlDecl+H,x.sgmlDecl=""):(x.sgmlDecl+H).toUpperCase()===d?(O(x,"onopencdata"),x.state=A.CDATA,x.sgmlDecl="",x.cdata=""):(x.sgmlDecl+H).toUpperCase()===p?(x.state=A.DOCTYPE,(x.doctype||x.sawRoot)&&J(x,"Inappropriately located doctype declaration"),x.doctype="",x.sgmlDecl=""):H===">"?(O(x,"onsgmldeclaration",x.sgmlDecl),x.sgmlDecl="",x.state=A.TEXT):(E(H)&&(x.state=A.SGML_DECL_QUOTED),x.sgmlDecl+=H);continue;case A.SGML_DECL_QUOTED:H===x.q&&(x.state=A.SGML_DECL,x.q=""),x.sgmlDecl+=H;continue;case A.DOCTYPE:H===">"?(x.state=A.TEXT,O(x,"ondoctype",x.doctype),x.doctype=!0):(x.doctype+=H,H==="["?x.state=A.DOCTYPE_DTD:E(H)&&(x.state=A.DOCTYPE_QUOTED,x.q=H));continue;case A.DOCTYPE_QUOTED:x.doctype+=H,H===x.q&&(x.q="",x.state=A.DOCTYPE);continue;case A.DOCTYPE_DTD:H==="]"?(x.doctype+=H,x.state=A.DOCTYPE):H==="<"?(x.state=A.OPEN_WAKA,x.startTagPosition=x.position):E(H)?(x.doctype+=H,x.state=A.DOCTYPE_DTD_QUOTED,x.q=H):x.doctype+=H;continue;case A.DOCTYPE_DTD_QUOTED:x.doctype+=H,H===x.q&&(x.state=A.DOCTYPE_DTD,x.q="");continue;case A.COMMENT:H==="-"?x.state=A.COMMENT_ENDING:x.comment+=H;continue;case A.COMMENT_ENDING:H==="-"?(x.state=A.COMMENT_ENDED,x.comment=W(x.opt,x.comment),x.comment&&O(x,"oncomment",x.comment),x.comment=""):(x.comment+="-"+H,x.state=A.COMMENT);continue;case A.COMMENT_ENDED:H!==">"?(J(x,"Malformed comment"),x.comment+="--"+H,x.state=A.COMMENT):x.doctype&&x.doctype!==!0?x.state=A.DOCTYPE_DTD:x.state=A.TEXT;continue;case A.CDATA:H==="]"?x.state=A.CDATA_ENDING:x.cdata+=H;continue;case A.CDATA_ENDING:H==="]"?x.state=A.CDATA_ENDING_2:(x.cdata+="]"+H,x.state=A.CDATA);continue;case A.CDATA_ENDING_2:H===">"?(x.cdata&&O(x,"oncdata",x.cdata),O(x,"onclosecdata"),x.cdata="",x.state=A.TEXT):H==="]"?x.cdata+="]":(x.cdata+="]]"+H,x.state=A.CDATA);continue;case A.PROC_INST:H==="?"?x.state=A.PROC_INST_ENDING:h(H)?x.state=A.PROC_INST_BODY:x.procInstName+=H;continue;case A.PROC_INST_BODY:if(!x.procInstBody&&h(H))continue;H==="?"?x.state=A.PROC_INST_ENDING:x.procInstBody+=H;continue;case A.PROC_INST_ENDING:H===">"?(O(x,"onprocessinginstruction",{name:x.procInstName,body:x.procInstBody}),x.procInstName=x.procInstBody="",x.state=A.TEXT):(x.procInstBody+="?"+H,x.state=A.PROC_INST_BODY);continue;case A.OPEN_TAG:R(y,H)?x.tagName+=H:(se(x),H===">"?we(x):H==="/"?x.state=A.OPEN_TAG_SLASH:(h(H)||J(x,"Invalid character in tag name"),x.state=A.ATTRIB));continue;case A.OPEN_TAG_SLASH:H===">"?(we(x,!0),X(x)):(J(x,"Forward-slash in opening tag not followed by >"),x.state=A.ATTRIB);continue;case A.ATTRIB:if(h(H))continue;H===">"?we(x):H==="/"?x.state=A.OPEN_TAG_SLASH:R(S,H)?(x.attribName=H,x.attribValue="",x.state=A.ATTRIB_NAME):J(x,"Invalid attribute name");continue;case A.ATTRIB_NAME:H==="="?x.state=A.ATTRIB_VALUE:H===">"?(J(x,"Attribute without value"),x.attribValue=x.attribName,oe(x),we(x)):h(H)?x.state=A.ATTRIB_NAME_SAW_WHITE:R(y,H)?x.attribName+=H:J(x,"Invalid attribute name");continue;case A.ATTRIB_NAME_SAW_WHITE:if(H==="=")x.state=A.ATTRIB_VALUE;else{if(h(H))continue;J(x,"Attribute without value"),x.tag.attributes[x.attribName]="",x.attribValue="",O(x,"onattribute",{name:x.attribName,value:""}),x.attribName="",H===">"?we(x):R(S,H)?(x.attribName=H,x.state=A.ATTRIB_NAME):(J(x,"Invalid attribute name"),x.state=A.ATTRIB)}continue;case A.ATTRIB_VALUE:if(h(H))continue;E(H)?(x.q=H,x.state=A.ATTRIB_VALUE_QUOTED):(x.opt.unquotedAttributeValues||L(x,"Unquoted attribute value"),x.state=A.ATTRIB_VALUE_UNQUOTED,x.attribValue=H);continue;case A.ATTRIB_VALUE_QUOTED:if(H!==x.q){H==="&"?x.state=A.ATTRIB_VALUE_ENTITY_Q:x.attribValue+=H;continue}oe(x),x.q="",x.state=A.ATTRIB_VALUE_CLOSED;continue;case A.ATTRIB_VALUE_CLOSED:h(H)?x.state=A.ATTRIB:H===">"?we(x):H==="/"?x.state=A.OPEN_TAG_SLASH:R(S,H)?(J(x,"No whitespace between attributes"),x.attribName=H,x.attribValue="",x.state=A.ATTRIB_NAME):J(x,"Invalid attribute name");continue;case A.ATTRIB_VALUE_UNQUOTED:if(!T(H)){H==="&"?x.state=A.ATTRIB_VALUE_ENTITY_U:x.attribValue+=H;continue}oe(x),H===">"?we(x):x.state=A.ATTRIB;continue;case A.CLOSE_TAG:if(x.tagName)H===">"?X(x):R(y,H)?x.tagName+=H:x.script?(x.script+="</"+x.tagName,x.tagName="",x.state=A.SCRIPT):(h(H)||J(x,"Invalid tagname in closing tag"),x.state=A.CLOSE_TAG_SAW_WHITE);else{if(h(H))continue;C(S,H)?x.script?(x.script+="</"+H,x.state=A.SCRIPT):J(x,"Invalid tagname in closing tag."):x.tagName=H}continue;case A.CLOSE_TAG_SAW_WHITE:if(h(H))continue;H===">"?X(x):J(x,"Invalid characters in closing tag");continue;case A.TEXT_ENTITY:case A.ATTRIB_VALUE_ENTITY_Q:case A.ATTRIB_VALUE_ENTITY_U:var ge,Re;switch(x.state){case A.TEXT_ENTITY:ge=A.TEXT,Re="textNode";break;case A.ATTRIB_VALUE_ENTITY_Q:ge=A.ATTRIB_VALUE_QUOTED,Re="attribValue";break;case A.ATTRIB_VALUE_ENTITY_U:ge=A.ATTRIB_VALUE_UNQUOTED,Re="attribValue";break}if(H===";"){var De=ie(x);x.opt.unparsedEntities&&!Object.values(t.XML_ENTITIES).includes(De)?(x.entity="",x.state=ge,x.write(De)):(x[Re]+=De,x.entity="",x.state=ge)}else R(x.entity.length?v:g,H)?x.entity+=H:(J(x,"Invalid character in entity name"),x[Re]+="&"+x.entity+H,x.entity="",x.state=ge);continue;default:throw new Error(x,"Unknown state: "+x.state)}return x.position>=x.bufferCheckPosition&&i(x),x}String.fromCodePoint||(function(){var F=String.fromCharCode,x=Math.floor,G=function(){var H=16384,B=[],z,ge,Re=-1,De=arguments.length;if(!De)return"";for(var Ce="";++Re<De;){var Ie=Number(arguments[Re]);if(!isFinite(Ie)||Ie<0||Ie>1114111||x(Ie)!==Ie)throw RangeError("Invalid code point: "+Ie);Ie<=65535?B.push(Ie):(Ie-=65536,z=(Ie>>10)+55296,ge=Ie%1024+56320,B.push(z,ge)),(Re+1===De||B.length>H)&&(Ce+=F.apply(null,B),B.length=0)}return Ce};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:G,configurable:!0,writable:!0}):String.fromCodePoint=G})()})(e)})(Rc)),Rc}var Zu,uy;function ef(){return uy||(uy=1,Zu={isArray:function(e){return Array.isArray?Array.isArray(e):Object.prototype.toString.call(e)==="[object Array]"}}),Zu}var tf,fy;function nf(){if(fy)return tf;fy=1;var e=ef().isArray;return tf={copyOptions:function(t){var n,r={};for(n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);return r},ensureFlagExists:function(t,n){(!(t in n)||typeof n[t]!="boolean")&&(n[t]=!1)},ensureSpacesExists:function(t){(!("spaces"in t)||typeof t.spaces!="number"&&typeof t.spaces!="string")&&(t.spaces=0)},ensureAlwaysArrayExists:function(t){(!("alwaysArray"in t)||typeof t.alwaysArray!="boolean"&&!e(t.alwaysArray))&&(t.alwaysArray=!1)},ensureKeyExists:function(t,n){(!(t+"Key"in n)||typeof n[t+"Key"]!="string")&&(n[t+"Key"]=n.compact?"_"+t:t)},checkFnExists:function(t,n){return t+"Fn"in n}},tf}var rf,dy;function py(){if(dy)return rf;dy=1;var e=zC(),t=nf(),n=ef().isArray,r,i;function o(y){return r=t.copyOptions(y),t.ensureFlagExists("ignoreDeclaration",r),t.ensureFlagExists("ignoreInstruction",r),t.ensureFlagExists("ignoreAttributes",r),t.ensureFlagExists("ignoreText",r),t.ensureFlagExists("ignoreComment",r),t.ensureFlagExists("ignoreCdata",r),t.ensureFlagExists("ignoreDoctype",r),t.ensureFlagExists("compact",r),t.ensureFlagExists("alwaysChildren",r),t.ensureFlagExists("addParent",r),t.ensureFlagExists("trim",r),t.ensureFlagExists("nativeType",r),t.ensureFlagExists("nativeTypeAttributes",r),t.ensureFlagExists("sanitize",r),t.ensureFlagExists("instructionHasAttributes",r),t.ensureFlagExists("captureSpacesBetweenElements",r),t.ensureAlwaysArrayExists(r),t.ensureKeyExists("declaration",r),t.ensureKeyExists("instruction",r),t.ensureKeyExists("attributes",r),t.ensureKeyExists("text",r),t.ensureKeyExists("comment",r),t.ensureKeyExists("cdata",r),t.ensureKeyExists("doctype",r),t.ensureKeyExists("type",r),t.ensureKeyExists("name",r),t.ensureKeyExists("elements",r),t.ensureKeyExists("parent",r),t.checkFnExists("doctype",r),t.checkFnExists("instruction",r),t.checkFnExists("cdata",r),t.checkFnExists("comment",r),t.checkFnExists("text",r),t.checkFnExists("instructionName",r),t.checkFnExists("elementName",r),t.checkFnExists("attributeName",r),t.checkFnExists("attributeValue",r),t.checkFnExists("attributes",r),r}function s(y){var g=Number(y);if(!isNaN(g))return g;var v=y.toLowerCase();return v==="true"?!0:v==="false"?!1:y}function a(y,g){var v;if(r.compact){if(!i[r[y+"Key"]]&&(n(r.alwaysArray)?r.alwaysArray.indexOf(r[y+"Key"])!==-1:r.alwaysArray)&&(i[r[y+"Key"]]=[]),i[r[y+"Key"]]&&!n(i[r[y+"Key"]])&&(i[r[y+"Key"]]=[i[r[y+"Key"]]]),y+"Fn"in r&&typeof g=="string"&&(g=r[y+"Fn"](g,i)),y==="instruction"&&("instructionFn"in r||"instructionNameFn"in r)){for(v in g)if(g.hasOwnProperty(v))if("instructionFn"in r)g[v]=r.instructionFn(g[v],v,i);else{var h=g[v];delete g[v],g[r.instructionNameFn(v,h,i)]=h}}n(i[r[y+"Key"]])?i[r[y+"Key"]].push(g):i[r[y+"Key"]]=g}else{i[r.elementsKey]||(i[r.elementsKey]=[]);var E={};if(E[r.typeKey]=y,y==="instruction"){for(v in g)if(g.hasOwnProperty(v))break;E[r.nameKey]="instructionNameFn"in r?r.instructionNameFn(v,g,i):v,r.instructionHasAttributes?(E[r.attributesKey]=g[v][r.attributesKey],"instructionFn"in r&&(E[r.attributesKey]=r.instructionFn(E[r.attributesKey],v,i))):("instructionFn"in r&&(g[v]=r.instructionFn(g[v],v,i)),E[r.instructionKey]=g[v])}else y+"Fn"in r&&(g=r[y+"Fn"](g,i)),E[r[y+"Key"]]=g;r.addParent&&(E[r.parentKey]=i),i[r.elementsKey].push(E)}}function l(y){if("attributesFn"in r&&y&&(y=r.attributesFn(y,i)),(r.trim||"attributeValueFn"in r||"attributeNameFn"in r||r.nativeTypeAttributes)&&y){var g;for(g in y)if(y.hasOwnProperty(g)&&(r.trim&&(y[g]=y[g].trim()),r.nativeTypeAttributes&&(y[g]=s(y[g])),"attributeValueFn"in r&&(y[g]=r.attributeValueFn(y[g],g,i)),"attributeNameFn"in r)){var v=y[g];delete y[g],y[r.attributeNameFn(g,y[g],i)]=v}}return y}function u(y){var g={};if(y.body&&(y.name.toLowerCase()==="xml"||r.instructionHasAttributes)){for(var v=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g,h;(h=v.exec(y.body))!==null;)g[h[1]]=h[2]||h[3]||h[4];g=l(g)}if(y.name.toLowerCase()==="xml"){if(r.ignoreDeclaration)return;i[r.declarationKey]={},Object.keys(g).length&&(i[r.declarationKey][r.attributesKey]=g),r.addParent&&(i[r.declarationKey][r.parentKey]=i)}else{if(r.ignoreInstruction)return;r.trim&&(y.body=y.body.trim());var E={};r.instructionHasAttributes&&Object.keys(g).length?(E[y.name]={},E[y.name][r.attributesKey]=g):E[y.name]=y.body,a("instruction",E)}}function c(y,g){var v;if(typeof y=="object"&&(g=y.attributes,y=y.name),g=l(g),"elementNameFn"in r&&(y=r.elementNameFn(y,i)),r.compact){if(v={},!r.ignoreAttributes&&g&&Object.keys(g).length){v[r.attributesKey]={};var h;for(h in g)g.hasOwnProperty(h)&&(v[r.attributesKey][h]=g[h])}!(y in i)&&(n(r.alwaysArray)?r.alwaysArray.indexOf(y)!==-1:r.alwaysArray)&&(i[y]=[]),i[y]&&!n(i[y])&&(i[y]=[i[y]]),n(i[y])?i[y].push(v):i[y]=v}else i[r.elementsKey]||(i[r.elementsKey]=[]),v={},v[r.typeKey]="element",v[r.nameKey]=y,!r.ignoreAttributes&&g&&Object.keys(g).length&&(v[r.attributesKey]=g),r.alwaysChildren&&(v[r.elementsKey]=[]),i[r.elementsKey].push(v);v[r.parentKey]=i,i=v}function d(y){r.ignoreText||!y.trim()&&!r.captureSpacesBetweenElements||(r.trim&&(y=y.trim()),r.nativeType&&(y=s(y)),r.sanitize&&(y=y.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")),a("text",y))}function p(y){r.ignoreComment||(r.trim&&(y=y.trim()),a("comment",y))}function m(y){var g=i[r.parentKey];r.addParent||delete i[r.parentKey],i=g}function b(y){r.ignoreCdata||(r.trim&&(y=y.trim()),a("cdata",y))}function w(y){r.ignoreDoctype||(y=y.replace(/^ /,""),r.trim&&(y=y.trim()),a("doctype",y))}function S(y){y.note=y}return rf=function(y,g){var v=e.parser(!0,{}),h={};if(i=h,r=o(g),v.opt={strictEntities:!0},v.onopentag=c,v.ontext=d,v.oncomment=p,v.onclosetag=m,v.onerror=S,v.oncdata=b,v.ondoctype=w,v.onprocessinginstruction=u,v.write(y).close(),h[r.elementsKey]){var E=h[r.elementsKey];delete h[r.elementsKey],h[r.elementsKey]=E,delete h.text}return h},rf}var of,hy;function WC(){if(hy)return of;hy=1;var e=nf(),t=py();function n(r){var i=e.copyOptions(r);return e.ensureSpacesExists(i),i}return of=function(r,i){var o,s,a,l;return o=n(i),s=t(r,o),l="compact"in o&&o.compact?"_parent":"parent","addParent"in o&&o.addParent?a=JSON.stringify(s,function(u,c){return u===l?"_":c},o.spaces):a=JSON.stringify(s,null,o.spaces),a.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")},of}var sf,my;function gy(){if(my)return sf;my=1;var e=nf(),t=ef().isArray,n,r;function i(v){var h=e.copyOptions(v);return e.ensureFlagExists("ignoreDeclaration",h),e.ensureFlagExists("ignoreInstruction",h),e.ensureFlagExists("ignoreAttributes",h),e.ensureFlagExists("ignoreText",h),e.ensureFlagExists("ignoreComment",h),e.ensureFlagExists("ignoreCdata",h),e.ensureFlagExists("ignoreDoctype",h),e.ensureFlagExists("compact",h),e.ensureFlagExists("indentText",h),e.ensureFlagExists("indentCdata",h),e.ensureFlagExists("indentAttributes",h),e.ensureFlagExists("indentInstruction",h),e.ensureFlagExists("fullTagEmptyElement",h),e.ensureFlagExists("noQuotesForNativeAttributes",h),e.ensureSpacesExists(h),typeof h.spaces=="number"&&(h.spaces=Array(h.spaces+1).join(" ")),e.ensureKeyExists("declaration",h),e.ensureKeyExists("instruction",h),e.ensureKeyExists("attributes",h),e.ensureKeyExists("text",h),e.ensureKeyExists("comment",h),e.ensureKeyExists("cdata",h),e.ensureKeyExists("doctype",h),e.ensureKeyExists("type",h),e.ensureKeyExists("name",h),e.ensureKeyExists("elements",h),e.checkFnExists("doctype",h),e.checkFnExists("instruction",h),e.checkFnExists("cdata",h),e.checkFnExists("comment",h),e.checkFnExists("text",h),e.checkFnExists("instructionName",h),e.checkFnExists("elementName",h),e.checkFnExists("attributeName",h),e.checkFnExists("attributeValue",h),e.checkFnExists("attributes",h),e.checkFnExists("fullTagEmptyElement",h),h}function o(v,h,E){return(!E&&v.spaces?`
24
- `:"")+Array(h+1).join(v.spaces)}function s(v,h,E){if(h.ignoreAttributes)return"";"attributesFn"in h&&(v=h.attributesFn(v,r,n));var T,R,C,A,D=[];for(T in v)v.hasOwnProperty(T)&&v[T]!==null&&v[T]!==void 0&&(A=h.noQuotesForNativeAttributes&&typeof v[T]!="string"?"":'"',R=""+v[T],R=R.replace(/"/g,"&quot;"),C="attributeNameFn"in h?h.attributeNameFn(T,R,r,n):T,D.push(h.spaces&&h.indentAttributes?o(h,E+1,!1):" "),D.push(C+"="+A+("attributeValueFn"in h?h.attributeValueFn(R,T,r,n):R)+A));return v&&Object.keys(v).length&&h.spaces&&h.indentAttributes&&D.push(o(h,E,!1)),D.join("")}function a(v,h,E){return n=v,r="xml",h.ignoreDeclaration?"":"<?xml"+s(v[h.attributesKey],h,E)+"?>"}function l(v,h,E){if(h.ignoreInstruction)return"";var T;for(T in v)if(v.hasOwnProperty(T))break;var R="instructionNameFn"in h?h.instructionNameFn(T,v[T],r,n):T;if(typeof v[T]=="object")return n=v,r=R,"<?"+R+s(v[T][h.attributesKey],h,E)+"?>";var C=v[T]?v[T]:"";return"instructionFn"in h&&(C=h.instructionFn(C,T,r,n)),"<?"+R+(C?" "+C:"")+"?>"}function u(v,h){return h.ignoreComment?"":"<!--"+("commentFn"in h?h.commentFn(v,r,n):v)+"-->"}function c(v,h){return h.ignoreCdata?"":"<![CDATA["+("cdataFn"in h?h.cdataFn(v,r,n):v.replace("]]>","]]]]><![CDATA[>"))+"]]>"}function d(v,h){return h.ignoreDoctype?"":"<!DOCTYPE "+("doctypeFn"in h?h.doctypeFn(v,r,n):v)+">"}function p(v,h){return h.ignoreText?"":(v=""+v,v=v.replace(/&amp;/g,"&"),v=v.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"textFn"in h?h.textFn(v,r,n):v)}function m(v,h){var E;if(v.elements&&v.elements.length)for(E=0;E<v.elements.length;++E)switch(v.elements[E][h.typeKey]){case"text":if(h.indentText)return!0;break;case"cdata":if(h.indentCdata)return!0;break;case"instruction":if(h.indentInstruction)return!0;break;case"doctype":case"comment":case"element":return!0;default:return!0}return!1}function b(v,h,E){n=v,r=v.name;var T=[],R="elementNameFn"in h?h.elementNameFn(v.name,v):v.name;T.push("<"+R),v[h.attributesKey]&&T.push(s(v[h.attributesKey],h,E));var C=v[h.elementsKey]&&v[h.elementsKey].length||v[h.attributesKey]&&v[h.attributesKey]["xml:space"]==="preserve";return C||("fullTagEmptyElementFn"in h?C=h.fullTagEmptyElementFn(v.name,v):C=h.fullTagEmptyElement),C?(T.push(">"),v[h.elementsKey]&&v[h.elementsKey].length&&(T.push(w(v[h.elementsKey],h,E+1)),n=v,r=v.name),T.push(h.spaces&&m(v,h)?`
25
- `+Array(E+1).join(h.spaces):""),T.push("</"+R+">")):T.push("/>"),T.join("")}function w(v,h,E,T){return v.reduce(function(R,C){var A=o(h,E,T&&!R);switch(C.type){case"element":return R+A+b(C,h,E);case"comment":return R+A+u(C[h.commentKey],h);case"doctype":return R+A+d(C[h.doctypeKey],h);case"cdata":return R+(h.indentCdata?A:"")+c(C[h.cdataKey],h);case"text":return R+(h.indentText?A:"")+p(C[h.textKey],h);case"instruction":var D={};return D[C[h.nameKey]]=C[h.attributesKey]?C:C[h.instructionKey],R+(h.indentInstruction?A:"")+l(D,h,E)}},"")}function S(v,h,E){var T;for(T in v)if(v.hasOwnProperty(T))switch(T){case h.parentKey:case h.attributesKey:break;case h.textKey:if(h.indentText||E)return!0;break;case h.cdataKey:if(h.indentCdata||E)return!0;break;case h.instructionKey:if(h.indentInstruction||E)return!0;break;case h.doctypeKey:case h.commentKey:return!0;default:return!0}return!1}function y(v,h,E,T,R){n=v,r=h;var C="elementNameFn"in E?E.elementNameFn(h,v):h;if(typeof v>"u"||v===null||v==="")return"fullTagEmptyElementFn"in E&&E.fullTagEmptyElementFn(h,v)||E.fullTagEmptyElement?"<"+C+"></"+C+">":"<"+C+"/>";var A=[];if(h){if(A.push("<"+C),typeof v!="object")return A.push(">"+p(v,E)+"</"+C+">"),A.join("");v[E.attributesKey]&&A.push(s(v[E.attributesKey],E,T));var D=S(v,E,!0)||v[E.attributesKey]&&v[E.attributesKey]["xml:space"]==="preserve";if(D||("fullTagEmptyElementFn"in E?D=E.fullTagEmptyElementFn(h,v):D=E.fullTagEmptyElement),D)A.push(">");else return A.push("/>"),A.join("")}return A.push(g(v,E,T+1,!1)),n=v,r=h,h&&A.push((R?o(E,T,!1):"")+"</"+C+">"),A.join("")}function g(v,h,E,T){var R,C,A,D=[];for(C in v)if(v.hasOwnProperty(C))for(A=t(v[C])?v[C]:[v[C]],R=0;R<A.length;++R){switch(C){case h.declarationKey:D.push(a(A[R],h,E));break;case h.instructionKey:D.push((h.indentInstruction?o(h,E,T):"")+l(A[R],h,E));break;case h.attributesKey:case h.parentKey:break;case h.textKey:D.push((h.indentText?o(h,E,T):"")+p(A[R],h));break;case h.cdataKey:D.push((h.indentCdata?o(h,E,T):"")+c(A[R],h));break;case h.doctypeKey:D.push(o(h,E,T)+d(A[R],h));break;case h.commentKey:D.push(o(h,E,T)+u(A[R],h));break;default:D.push(o(h,E,T)+y(A[R],C,h,E,S(A[R],h)))}T=T&&!D.length}return D.join("")}return sf=function(v,h){h=i(h);var E=[];return n=v,r="_root_",h.compact?E.push(g(v,h,0,!0)):(v[h.declarationKey]&&E.push(a(v[h.declarationKey],h,0)),v[h.elementsKey]&&v[h.elementsKey].length&&E.push(w(v[h.elementsKey],h,0,!E.length))),E.join("")},sf}var af,yy;function HC(){if(yy)return af;yy=1;var e=gy();return af=function(t,n){t instanceof Kr&&(t=t.toString());var r=null;if(typeof t=="string")try{r=JSON.parse(t)}catch{throw new Error("The JSON structure is invalid")}else r=t;return e(r,n)},af}var lf,vy;function KC(){if(vy)return lf;vy=1;var e=py(),t=WC(),n=gy(),r=HC();return lf={xml2js:e,xml2json:t,js2xml:n,json2xml:r},lf}KC();var GC={2:e=>{function t(i,o,s){i instanceof RegExp&&(i=n(i,s)),o instanceof RegExp&&(o=n(o,s));var a=r(i,o,s);return a&&{start:a[0],end:a[1],pre:s.slice(0,a[0]),body:s.slice(a[0]+i.length,a[1]),post:s.slice(a[1]+o.length)}}function n(i,o){var s=o.match(i);return s?s[0]:null}function r(i,o,s){var a,l,u,c,d,p=s.indexOf(i),m=s.indexOf(o,p+1),b=p;if(p>=0&&m>0){for(a=[],u=s.length;b>=0&&!d;)b==p?(a.push(b),p=s.indexOf(i,b+1)):a.length==1?d=[a.pop(),m]:((l=a.pop())<u&&(u=l,c=m),m=s.indexOf(o,b+1)),b=p<m&&p>=0?p:m;a.length&&(d=[u,c])}return d}e.exports=t,t.range=r},101:function(e,t,n){var r;e=n.nmd(e),(function(i){var o=(e&&e.exports,typeof Wr=="object"&&Wr);o.global!==o&&o.window;var s=function(d){this.message=d};(s.prototype=new Error).name="InvalidCharacterError";var a=function(d){throw new s(d)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,c={encode:function(d){d=String(d),/[^\0-\xFF]/.test(d)&&a("The string to be encoded contains characters outside of the Latin1 range.");for(var p,m,b,w,S=d.length%3,y="",g=-1,v=d.length-S;++g<v;)p=d.charCodeAt(g)<<16,m=d.charCodeAt(++g)<<8,b=d.charCodeAt(++g),y+=l.charAt((w=p+m+b)>>18&63)+l.charAt(w>>12&63)+l.charAt(w>>6&63)+l.charAt(63&w);return S==2?(p=d.charCodeAt(g)<<8,m=d.charCodeAt(++g),y+=l.charAt((w=p+m)>>10)+l.charAt(w>>4&63)+l.charAt(w<<2&63)+"="):S==1&&(w=d.charCodeAt(g),y+=l.charAt(w>>2)+l.charAt(w<<4&63)+"=="),y},decode:function(d){var p=(d=String(d).replace(u,"")).length;p%4==0&&(p=(d=d.replace(/==?$/,"")).length),(p%4==1||/[^+a-zA-Z0-9/]/.test(d))&&a("Invalid character: the string to be decoded is not correctly encoded.");for(var m,b,w=0,S="",y=-1;++y<p;)b=l.indexOf(d.charAt(y)),m=w%4?64*m+b:b,w++%4&&(S+=String.fromCharCode(255&m>>(-2*w&6)));return S},version:"1.0.0"};(r=(function(){return c}).call(t,n,t,e))===void 0||(e.exports=r)})()},172:(e,t)=>{t.d=function(n){if(!n)return 0;for(var r=(n=n.toString()).length,i=n.length;i--;){var o=n.charCodeAt(i);56320<=o&&o<=57343&&i--,127<o&&o<=2047?r++:2047<o&&o<=65535&&(r+=2)}return r}},526:e=>{var t={utf8:{stringToBytes:function(n){return t.bin.stringToBytes(unescape(encodeURIComponent(n)))},bytesToString:function(n){return decodeURIComponent(escape(t.bin.bytesToString(n)))}},bin:{stringToBytes:function(n){for(var r=[],i=0;i<n.length;i++)r.push(255&n.charCodeAt(i));return r},bytesToString:function(n){for(var r=[],i=0;i<n.length;i++)r.push(String.fromCharCode(n[i]));return r.join("")}}};e.exports=t},298:e=>{var t,n;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(r,i){return r<<i|r>>>32-i},rotr:function(r,i){return r<<32-i|r>>>i},endian:function(r){if(r.constructor==Number)return 16711935&n.rotl(r,8)|4278255360&n.rotl(r,24);for(var i=0;i<r.length;i++)r[i]=n.endian(r[i]);return r},randomBytes:function(r){for(var i=[];r>0;r--)i.push(Math.floor(256*Math.random()));return i},bytesToWords:function(r){for(var i=[],o=0,s=0;o<r.length;o++,s+=8)i[s>>>5]|=r[o]<<24-s%32;return i},wordsToBytes:function(r){for(var i=[],o=0;o<32*r.length;o+=8)i.push(r[o>>>5]>>>24-o%32&255);return i},bytesToHex:function(r){for(var i=[],o=0;o<r.length;o++)i.push((r[o]>>>4).toString(16)),i.push((15&r[o]).toString(16));return i.join("")},hexToBytes:function(r){for(var i=[],o=0;o<r.length;o+=2)i.push(parseInt(r.substr(o,2),16));return i},bytesToBase64:function(r){for(var i=[],o=0;o<r.length;o+=3)for(var s=r[o]<<16|r[o+1]<<8|r[o+2],a=0;a<4;a++)8*o+6*a<=8*r.length?i.push(t.charAt(s>>>6*(3-a)&63)):i.push("=");return i.join("")},base64ToBytes:function(r){r=r.replace(/[^A-Z0-9+\/]/gi,"");for(var i=[],o=0,s=0;o<r.length;s=++o%4)s!=0&&i.push((t.indexOf(r.charAt(o-1))&Math.pow(2,-2*s+8)-1)<<2*s|t.indexOf(r.charAt(o))>>>6-2*s);return i}},e.exports=n},635:(e,t,n)=>{const r=n(31),i=n(338),o=n(221);e.exports={XMLParser:i,XMLValidator:r,XMLBuilder:o}},118:e=>{e.exports=function(t){return typeof t=="function"?t:Array.isArray(t)?n=>{for(const r of t)if(typeof r=="string"&&n===r||r instanceof RegExp&&r.test(n))return!0}:()=>!1}},705:(e,t)=>{const n=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",r="["+n+"]["+n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",i=new RegExp("^"+r+"$");t.isExist=function(o){return o!==void 0},t.isEmptyObject=function(o){return Object.keys(o).length===0},t.merge=function(o,s,a){if(s){const l=Object.keys(s),u=l.length;for(let c=0;c<u;c++)o[l[c]]=a==="strict"?[s[l[c]]]:s[l[c]]}},t.getValue=function(o){return t.isExist(o)?o:""},t.isName=function(o){return i.exec(o)!=null},t.getAllMatches=function(o,s){const a=[];let l=s.exec(o);for(;l;){const u=[];u.startIndex=s.lastIndex-l[0].length;const c=l.length;for(let d=0;d<c;d++)u.push(l[d]);a.push(u),l=s.exec(o)}return a},t.nameRegexp=r},31:(e,t,n)=>{const r=n(705),i={allowBooleanAttributes:!1,unpairedTags:[]};function o(g){return g===" "||g===" "||g===`
26
- `||g==="\r"}function s(g,v){const h=v;for(;v<g.length;v++)if(!(g[v]!="?"&&g[v]!=" ")){const E=g.substr(h,v-h);if(v>5&&E==="xml")return b("InvalidXml","XML declaration allowed only at the start of the document.",S(g,v));if(g[v]=="?"&&g[v+1]==">"){v++;break}}return v}function a(g,v){if(g.length>v+5&&g[v+1]==="-"&&g[v+2]==="-"){for(v+=3;v<g.length;v++)if(g[v]==="-"&&g[v+1]==="-"&&g[v+2]===">"){v+=2;break}}else if(g.length>v+8&&g[v+1]==="D"&&g[v+2]==="O"&&g[v+3]==="C"&&g[v+4]==="T"&&g[v+5]==="Y"&&g[v+6]==="P"&&g[v+7]==="E"){let h=1;for(v+=8;v<g.length;v++)if(g[v]==="<")h++;else if(g[v]===">"&&(h--,h===0))break}else if(g.length>v+9&&g[v+1]==="["&&g[v+2]==="C"&&g[v+3]==="D"&&g[v+4]==="A"&&g[v+5]==="T"&&g[v+6]==="A"&&g[v+7]==="["){for(v+=8;v<g.length;v++)if(g[v]==="]"&&g[v+1]==="]"&&g[v+2]===">"){v+=2;break}}return v}t.validate=function(g,v){v=Object.assign({},i,v);const h=[];let E=!1,T=!1;g[0]==="\uFEFF"&&(g=g.substr(1));for(let C=0;C<g.length;C++)if(g[C]==="<"&&g[C+1]==="?"){if(C+=2,C=s(g,C),C.err)return C}else{if(g[C]!=="<"){if(o(g[C]))continue;return b("InvalidChar","char '"+g[C]+"' is not expected.",S(g,C))}{let A=C;if(C++,g[C]==="!"){C=a(g,C);continue}{let D=!1;g[C]==="/"&&(D=!0,C++);let V="";for(;C<g.length&&g[C]!==">"&&g[C]!==" "&&g[C]!==" "&&g[C]!==`
27
- `&&g[C]!=="\r";C++)V+=g[C];if(V=V.trim(),V[V.length-1]==="/"&&(V=V.substring(0,V.length-1),C--),R=V,!r.isName(R)){let W;return W=V.trim().length===0?"Invalid space after '<'.":"Tag '"+V+"' is an invalid name.",b("InvalidTag",W,S(g,C))}const O=c(g,C);if(O===!1)return b("InvalidAttr","Attributes for '"+V+"' have open quote.",S(g,C));let N=O.value;if(C=O.index,N[N.length-1]==="/"){const W=C-N.length;N=N.substring(0,N.length-1);const L=p(N,v);if(L!==!0)return b(L.err.code,L.err.msg,S(g,W+L.err.line));E=!0}else if(D){if(!O.tagClosed)return b("InvalidTag","Closing tag '"+V+"' doesn't have proper closing.",S(g,C));if(N.trim().length>0)return b("InvalidTag","Closing tag '"+V+"' can't have attributes or invalid starting.",S(g,A));if(h.length===0)return b("InvalidTag","Closing tag '"+V+"' has not been opened.",S(g,A));{const W=h.pop();if(V!==W.tagName){let L=S(g,W.tagStartPos);return b("InvalidTag","Expected closing tag '"+W.tagName+"' (opened in line "+L.line+", col "+L.col+") instead of closing tag '"+V+"'.",S(g,A))}h.length==0&&(T=!0)}}else{const W=p(N,v);if(W!==!0)return b(W.err.code,W.err.msg,S(g,C-N.length+W.err.line));if(T===!0)return b("InvalidXml","Multiple possible root nodes found.",S(g,C));v.unpairedTags.indexOf(V)!==-1||h.push({tagName:V,tagStartPos:A}),E=!0}for(C++;C<g.length;C++)if(g[C]==="<"){if(g[C+1]==="!"){C++,C=a(g,C);continue}if(g[C+1]!=="?")break;if(C=s(g,++C),C.err)return C}else if(g[C]==="&"){const W=m(g,C);if(W==-1)return b("InvalidChar","char '&' is not expected.",S(g,C));C=W}else if(T===!0&&!o(g[C]))return b("InvalidXml","Extra text at the end",S(g,C));g[C]==="<"&&C--}}}var R;return E?h.length==1?b("InvalidTag","Unclosed tag '"+h[0].tagName+"'.",S(g,h[0].tagStartPos)):!(h.length>0)||b("InvalidXml","Invalid '"+JSON.stringify(h.map((C=>C.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):b("InvalidXml","Start tag expected.",1)};const l='"',u="'";function c(g,v){let h="",E="",T=!1;for(;v<g.length;v++){if(g[v]===l||g[v]===u)E===""?E=g[v]:E!==g[v]||(E="");else if(g[v]===">"&&E===""){T=!0;break}h+=g[v]}return E===""&&{value:h,index:v,tagClosed:T}}const d=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function p(g,v){const h=r.getAllMatches(g,d),E={};for(let T=0;T<h.length;T++){if(h[T][1].length===0)return b("InvalidAttr","Attribute '"+h[T][2]+"' has no space in starting.",y(h[T]));if(h[T][3]!==void 0&&h[T][4]===void 0)return b("InvalidAttr","Attribute '"+h[T][2]+"' is without value.",y(h[T]));if(h[T][3]===void 0&&!v.allowBooleanAttributes)return b("InvalidAttr","boolean attribute '"+h[T][2]+"' is not allowed.",y(h[T]));const R=h[T][2];if(!w(R))return b("InvalidAttr","Attribute '"+R+"' is an invalid name.",y(h[T]));if(E.hasOwnProperty(R))return b("InvalidAttr","Attribute '"+R+"' is repeated.",y(h[T]));E[R]=1}return!0}function m(g,v){if(g[++v]===";")return-1;if(g[v]==="#")return(function(E,T){let R=/\d/;for(E[T]==="x"&&(T++,R=/[\da-fA-F]/);T<E.length;T++){if(E[T]===";")return T;if(!E[T].match(R))break}return-1})(g,++v);let h=0;for(;v<g.length;v++,h++)if(!(g[v].match(/\w/)&&h<20)){if(g[v]===";")break;return-1}return v}function b(g,v,h){return{err:{code:g,msg:v,line:h.line||h,col:h.col}}}function w(g){return r.isName(g)}function S(g,v){const h=g.substring(0,v).split(/\r?\n/);return{line:h.length,col:h[h.length-1].length+1}}function y(g){return g.startIndex+g[1].length}},221:(e,t,n)=>{const r=n(87),i=n(118),o={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(c,d){return d},attributeValueProcessor:function(c,d){return d},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function s(c){this.options=Object.assign({},o,c),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=i(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=u),this.processTextOrObjNode=a,this.options.format?(this.indentate=l,this.tagEndChar=`>
28
- `,this.newLine=`
29
- `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function a(c,d,p,m){const b=this.j2x(c,p+1,m.concat(d));return c[this.options.textNodeName]!==void 0&&Object.keys(c).length===1?this.buildTextValNode(c[this.options.textNodeName],d,b.attrStr,p):this.buildObjectNode(b.val,d,b.attrStr,p)}function l(c){return this.options.indentBy.repeat(c)}function u(c){return!(!c.startsWith(this.options.attributeNamePrefix)||c===this.options.textNodeName)&&c.substr(this.attrPrefixLen)}s.prototype.build=function(c){return this.options.preserveOrder?r(c,this.options):(Array.isArray(c)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(c={[this.options.arrayNodeName]:c}),this.j2x(c,0,[]).val)},s.prototype.j2x=function(c,d,p){let m="",b="";const w=p.join(".");for(let S in c)if(Object.prototype.hasOwnProperty.call(c,S))if(c[S]===void 0)this.isAttribute(S)&&(b+="");else if(c[S]===null)this.isAttribute(S)?b+="":S[0]==="?"?b+=this.indentate(d)+"<"+S+"?"+this.tagEndChar:b+=this.indentate(d)+"<"+S+"/"+this.tagEndChar;else if(c[S]instanceof Date)b+=this.buildTextValNode(c[S],S,"",d);else if(typeof c[S]!="object"){const y=this.isAttribute(S);if(y&&!this.ignoreAttributesFn(y,w))m+=this.buildAttrPairStr(y,""+c[S]);else if(!y)if(S===this.options.textNodeName){let g=this.options.tagValueProcessor(S,""+c[S]);b+=this.replaceEntitiesValue(g)}else b+=this.buildTextValNode(c[S],S,"",d)}else if(Array.isArray(c[S])){const y=c[S].length;let g="",v="";for(let h=0;h<y;h++){const E=c[S][h];if(E!==void 0)if(E===null)S[0]==="?"?b+=this.indentate(d)+"<"+S+"?"+this.tagEndChar:b+=this.indentate(d)+"<"+S+"/"+this.tagEndChar;else if(typeof E=="object")if(this.options.oneListGroup){const T=this.j2x(E,d+1,p.concat(S));g+=T.val,this.options.attributesGroupName&&E.hasOwnProperty(this.options.attributesGroupName)&&(v+=T.attrStr)}else g+=this.processTextOrObjNode(E,S,d,p);else if(this.options.oneListGroup){let T=this.options.tagValueProcessor(S,E);T=this.replaceEntitiesValue(T),g+=T}else g+=this.buildTextValNode(E,S,"",d)}this.options.oneListGroup&&(g=this.buildObjectNode(g,S,v,d)),b+=g}else if(this.options.attributesGroupName&&S===this.options.attributesGroupName){const y=Object.keys(c[S]),g=y.length;for(let v=0;v<g;v++)m+=this.buildAttrPairStr(y[v],""+c[S][y[v]])}else b+=this.processTextOrObjNode(c[S],S,d,p);return{attrStr:m,val:b}},s.prototype.buildAttrPairStr=function(c,d){return d=this.options.attributeValueProcessor(c,""+d),d=this.replaceEntitiesValue(d),this.options.suppressBooleanAttributes&&d==="true"?" "+c:" "+c+'="'+d+'"'},s.prototype.buildObjectNode=function(c,d,p,m){if(c==="")return d[0]==="?"?this.indentate(m)+"<"+d+p+"?"+this.tagEndChar:this.indentate(m)+"<"+d+p+this.closeTag(d)+this.tagEndChar;{let b="</"+d+this.tagEndChar,w="";return d[0]==="?"&&(w="?",b=""),!p&&p!==""||c.indexOf("<")!==-1?this.options.commentPropName!==!1&&d===this.options.commentPropName&&w.length===0?this.indentate(m)+`<!--${c}-->`+this.newLine:this.indentate(m)+"<"+d+p+w+this.tagEndChar+c+this.indentate(m)+b:this.indentate(m)+"<"+d+p+w+">"+c+b}},s.prototype.closeTag=function(c){let d="";return this.options.unpairedTags.indexOf(c)!==-1?this.options.suppressUnpairedNode||(d="/"):d=this.options.suppressEmptyNode?"/":`></${c}`,d},s.prototype.buildTextValNode=function(c,d,p,m){if(this.options.cdataPropName!==!1&&d===this.options.cdataPropName)return this.indentate(m)+`<![CDATA[${c}]]>`+this.newLine;if(this.options.commentPropName!==!1&&d===this.options.commentPropName)return this.indentate(m)+`<!--${c}-->`+this.newLine;if(d[0]==="?")return this.indentate(m)+"<"+d+p+"?"+this.tagEndChar;{let b=this.options.tagValueProcessor(d,c);return b=this.replaceEntitiesValue(b),b===""?this.indentate(m)+"<"+d+p+this.closeTag(d)+this.tagEndChar:this.indentate(m)+"<"+d+p+">"+b+"</"+d+this.tagEndChar}},s.prototype.replaceEntitiesValue=function(c){if(c&&c.length>0&&this.options.processEntities)for(let d=0;d<this.options.entities.length;d++){const p=this.options.entities[d];c=c.replace(p.regex,p.val)}return c},e.exports=s},87:e=>{function t(s,a,l,u){let c="",d=!1;for(let p=0;p<s.length;p++){const m=s[p],b=n(m);if(b===void 0)continue;let w="";if(w=l.length===0?b:`${l}.${b}`,b===a.textNodeName){let v=m[b];i(w,a)||(v=a.tagValueProcessor(b,v),v=o(v,a)),d&&(c+=u),c+=v,d=!1;continue}if(b===a.cdataPropName){d&&(c+=u),c+=`<![CDATA[${m[b][0][a.textNodeName]}]]>`,d=!1;continue}if(b===a.commentPropName){c+=u+`<!--${m[b][0][a.textNodeName]}-->`,d=!0;continue}if(b[0]==="?"){const v=r(m[":@"],a),h=b==="?xml"?"":u;let E=m[b][0][a.textNodeName];E=E.length!==0?" "+E:"",c+=h+`<${b}${E}${v}?>`,d=!0;continue}let S=u;S!==""&&(S+=a.indentBy);const y=u+`<${b}${r(m[":@"],a)}`,g=t(m[b],a,w,S);a.unpairedTags.indexOf(b)!==-1?a.suppressUnpairedNode?c+=y+">":c+=y+"/>":g&&g.length!==0||!a.suppressEmptyNode?g&&g.endsWith(">")?c+=y+`>${g}${u}</${b}>`:(c+=y+">",g&&u!==""&&(g.includes("/>")||g.includes("</"))?c+=u+a.indentBy+g+u:c+=g,c+=`</${b}>`):c+=y+"/>",d=!0}return c}function n(s){const a=Object.keys(s);for(let l=0;l<a.length;l++){const u=a[l];if(s.hasOwnProperty(u)&&u!==":@")return u}}function r(s,a){let l="";if(s&&!a.ignoreAttributes)for(let u in s){if(!s.hasOwnProperty(u))continue;let c=a.attributeValueProcessor(u,s[u]);c=o(c,a),c===!0&&a.suppressBooleanAttributes?l+=` ${u.substr(a.attributeNamePrefix.length)}`:l+=` ${u.substr(a.attributeNamePrefix.length)}="${c}"`}return l}function i(s,a){let l=(s=s.substr(0,s.length-a.textNodeName.length-1)).substr(s.lastIndexOf(".")+1);for(let u in a.stopNodes)if(a.stopNodes[u]===s||a.stopNodes[u]==="*."+l)return!0;return!1}function o(s,a){if(s&&s.length>0&&a.processEntities)for(let l=0;l<a.entities.length;l++){const u=a.entities[l];s=s.replace(u.regex,u.val)}return s}e.exports=function(s,a){let l="";return a.format&&a.indentBy.length>0&&(l=`
30
- `),t(s,a,"",l)}},193:(e,t,n)=>{const r=n(705);function i(d,p){let m="";for(;p<d.length&&d[p]!=="'"&&d[p]!=='"';p++)m+=d[p];if(m=m.trim(),m.indexOf(" ")!==-1)throw new Error("External entites are not supported");const b=d[p++];let w="";for(;p<d.length&&d[p]!==b;p++)w+=d[p];return[m,w,p]}function o(d,p){return d[p+1]==="!"&&d[p+2]==="-"&&d[p+3]==="-"}function s(d,p){return d[p+1]==="!"&&d[p+2]==="E"&&d[p+3]==="N"&&d[p+4]==="T"&&d[p+5]==="I"&&d[p+6]==="T"&&d[p+7]==="Y"}function a(d,p){return d[p+1]==="!"&&d[p+2]==="E"&&d[p+3]==="L"&&d[p+4]==="E"&&d[p+5]==="M"&&d[p+6]==="E"&&d[p+7]==="N"&&d[p+8]==="T"}function l(d,p){return d[p+1]==="!"&&d[p+2]==="A"&&d[p+3]==="T"&&d[p+4]==="T"&&d[p+5]==="L"&&d[p+6]==="I"&&d[p+7]==="S"&&d[p+8]==="T"}function u(d,p){return d[p+1]==="!"&&d[p+2]==="N"&&d[p+3]==="O"&&d[p+4]==="T"&&d[p+5]==="A"&&d[p+6]==="T"&&d[p+7]==="I"&&d[p+8]==="O"&&d[p+9]==="N"}function c(d){if(r.isName(d))return d;throw new Error(`Invalid entity name ${d}`)}e.exports=function(d,p){const m={};if(d[p+3]!=="O"||d[p+4]!=="C"||d[p+5]!=="T"||d[p+6]!=="Y"||d[p+7]!=="P"||d[p+8]!=="E")throw new Error("Invalid Tag instead of DOCTYPE");{p+=9;let b=1,w=!1,S=!1,y="";for(;p<d.length;p++)if(d[p]!=="<"||S)if(d[p]===">"){if(S?d[p-1]==="-"&&d[p-2]==="-"&&(S=!1,b--):b--,b===0)break}else d[p]==="["?w=!0:y+=d[p];else{if(w&&s(d,p)){let g,v;p+=7,[g,v,p]=i(d,p+1),v.indexOf("&")===-1&&(m[c(g)]={regx:RegExp(`&${g};`,"g"),val:v})}else if(w&&a(d,p))p+=8;else if(w&&l(d,p))p+=8;else if(w&&u(d,p))p+=9;else{if(!o)throw new Error("Invalid DOCTYPE");S=!0}b++,y=""}if(b!==0)throw new Error("Unclosed DOCTYPE")}return{entities:m,i:p}}},63:(e,t)=>{const n={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(r,i){return i},attributeValueProcessor:function(r,i){return i},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(r,i,o){return r}};t.buildOptions=function(r){return Object.assign({},n,r)},t.defaultOptions=n},299:(e,t,n)=>{const r=n(705),i=n(365),o=n(193),s=n(494),a=n(118);function l(T){const R=Object.keys(T);for(let C=0;C<R.length;C++){const A=R[C];this.lastEntities[A]={regex:new RegExp("&"+A+";","g"),val:T[A]}}}function u(T,R,C,A,D,V,O){if(T!==void 0&&(this.options.trimValues&&!A&&(T=T.trim()),T.length>0)){O||(T=this.replaceEntitiesValue(T));const N=this.options.tagValueProcessor(R,T,C,D,V);return N==null?T:typeof N!=typeof T||N!==T?N:this.options.trimValues||T.trim()===T?E(T,this.options.parseTagValue,this.options.numberParseOptions):T}}function c(T){if(this.options.removeNSPrefix){const R=T.split(":"),C=T.charAt(0)==="/"?"/":"";if(R[0]==="xmlns")return"";R.length===2&&(T=C+R[1])}return T}const d=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function p(T,R,C){if(this.options.ignoreAttributes!==!0&&typeof T=="string"){const A=r.getAllMatches(T,d),D=A.length,V={};for(let O=0;O<D;O++){const N=this.resolveNameSpace(A[O][1]);if(this.ignoreAttributesFn(N,R))continue;let W=A[O][4],L=this.options.attributeNamePrefix+N;if(N.length)if(this.options.transformAttributeName&&(L=this.options.transformAttributeName(L)),L==="__proto__"&&(L="#__proto__"),W!==void 0){this.options.trimValues&&(W=W.trim()),W=this.replaceEntitiesValue(W);const ee=this.options.attributeValueProcessor(N,W,R);V[L]=ee==null?W:typeof ee!=typeof W||ee!==W?ee:E(W,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(V[L]=!0)}if(!Object.keys(V).length)return;if(this.options.attributesGroupName){const O={};return O[this.options.attributesGroupName]=V,O}return V}}const m=function(T){T=T.replace(/\r\n?/g,`
31
- `);const R=new i("!xml");let C=R,A="",D="";for(let V=0;V<T.length;V++)if(T[V]==="<")if(T[V+1]==="/"){const O=g(T,">",V,"Closing Tag is not closed.");let N=T.substring(V+2,O).trim();if(this.options.removeNSPrefix){const ee=N.indexOf(":");ee!==-1&&(N=N.substr(ee+1))}this.options.transformTagName&&(N=this.options.transformTagName(N)),C&&(A=this.saveTextToParentTag(A,C,D));const W=D.substring(D.lastIndexOf(".")+1);if(N&&this.options.unpairedTags.indexOf(N)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${N}>`);let L=0;W&&this.options.unpairedTags.indexOf(W)!==-1?(L=D.lastIndexOf(".",D.lastIndexOf(".")-1),this.tagsNodeStack.pop()):L=D.lastIndexOf("."),D=D.substring(0,L),C=this.tagsNodeStack.pop(),A="",V=O}else if(T[V+1]==="?"){let O=v(T,V,!1,"?>");if(!O)throw new Error("Pi Tag is not closed.");if(A=this.saveTextToParentTag(A,C,D),!(this.options.ignoreDeclaration&&O.tagName==="?xml"||this.options.ignorePiTags)){const N=new i(O.tagName);N.add(this.options.textNodeName,""),O.tagName!==O.tagExp&&O.attrExpPresent&&(N[":@"]=this.buildAttributesMap(O.tagExp,D,O.tagName)),this.addChild(C,N,D)}V=O.closeIndex+1}else if(T.substr(V+1,3)==="!--"){const O=g(T,"-->",V+4,"Comment is not closed.");if(this.options.commentPropName){const N=T.substring(V+4,O-2);A=this.saveTextToParentTag(A,C,D),C.add(this.options.commentPropName,[{[this.options.textNodeName]:N}])}V=O}else if(T.substr(V+1,2)==="!D"){const O=o(T,V);this.docTypeEntities=O.entities,V=O.i}else if(T.substr(V+1,2)==="!["){const O=g(T,"]]>",V,"CDATA is not closed.")-2,N=T.substring(V+9,O);A=this.saveTextToParentTag(A,C,D);let W=this.parseTextData(N,C.tagname,D,!0,!1,!0,!0);W==null&&(W=""),this.options.cdataPropName?C.add(this.options.cdataPropName,[{[this.options.textNodeName]:N}]):C.add(this.options.textNodeName,W),V=O+2}else{let O=v(T,V,this.options.removeNSPrefix),N=O.tagName;const W=O.rawTagName;let L=O.tagExp,ee=O.attrExpPresent,J=O.closeIndex;this.options.transformTagName&&(N=this.options.transformTagName(N)),C&&A&&C.tagname!=="!xml"&&(A=this.saveTextToParentTag(A,C,D,!1));const se=C;if(se&&this.options.unpairedTags.indexOf(se.tagname)!==-1&&(C=this.tagsNodeStack.pop(),D=D.substring(0,D.lastIndexOf("."))),N!==R.tagname&&(D+=D?"."+N:N),this.isItStopNode(this.options.stopNodes,D,N)){let he="";if(L.length>0&&L.lastIndexOf("/")===L.length-1)N[N.length-1]==="/"?(N=N.substr(0,N.length-1),D=D.substr(0,D.length-1),L=N):L=L.substr(0,L.length-1),V=O.closeIndex;else if(this.options.unpairedTags.indexOf(N)!==-1)V=O.closeIndex;else{const we=this.readStopNodeData(T,W,J+1);if(!we)throw new Error(`Unexpected end of ${W}`);V=we.i,he=we.tagContent}const oe=new i(N);N!==L&&ee&&(oe[":@"]=this.buildAttributesMap(L,D,N)),he&&(he=this.parseTextData(he,N,D,!0,ee,!0,!0)),D=D.substr(0,D.lastIndexOf(".")),oe.add(this.options.textNodeName,he),this.addChild(C,oe,D)}else{if(L.length>0&&L.lastIndexOf("/")===L.length-1){N[N.length-1]==="/"?(N=N.substr(0,N.length-1),D=D.substr(0,D.length-1),L=N):L=L.substr(0,L.length-1),this.options.transformTagName&&(N=this.options.transformTagName(N));const he=new i(N);N!==L&&ee&&(he[":@"]=this.buildAttributesMap(L,D,N)),this.addChild(C,he,D),D=D.substr(0,D.lastIndexOf("."))}else{const he=new i(N);this.tagsNodeStack.push(C),N!==L&&ee&&(he[":@"]=this.buildAttributesMap(L,D,N)),this.addChild(C,he,D),C=he}A="",V=J}}else A+=T[V];return R.child};function b(T,R,C){const A=this.options.updateTag(R.tagname,C,R[":@"]);A===!1||(typeof A=="string"&&(R.tagname=A),T.addChild(R))}const w=function(T){if(this.options.processEntities){for(let R in this.docTypeEntities){const C=this.docTypeEntities[R];T=T.replace(C.regx,C.val)}for(let R in this.lastEntities){const C=this.lastEntities[R];T=T.replace(C.regex,C.val)}if(this.options.htmlEntities)for(let R in this.htmlEntities){const C=this.htmlEntities[R];T=T.replace(C.regex,C.val)}T=T.replace(this.ampEntity.regex,this.ampEntity.val)}return T};function S(T,R,C,A){return T&&(A===void 0&&(A=Object.keys(R.child).length===0),(T=this.parseTextData(T,R.tagname,C,!1,!!R[":@"]&&Object.keys(R[":@"]).length!==0,A))!==void 0&&T!==""&&R.add(this.options.textNodeName,T),T=""),T}function y(T,R,C){const A="*."+C;for(const D in T){const V=T[D];if(A===V||R===V)return!0}return!1}function g(T,R,C,A){const D=T.indexOf(R,C);if(D===-1)throw new Error(A);return D+R.length-1}function v(T,R,C){const A=(function(ee,J){let se,he=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",oe="";for(let we=J;we<ee.length;we++){let X=ee[we];if(se)X===se&&(se="");else if(X==='"'||X==="'")se=X;else if(X===he[0]){if(!he[1])return{data:oe,index:we};if(ee[we+1]===he[1])return{data:oe,index:we}}else X===" "&&(X=" ");oe+=X}})(T,R+1,arguments.length>3&&arguments[3]!==void 0?arguments[3]:">");if(!A)return;let D=A.data;const V=A.index,O=D.search(/\s/);let N=D,W=!0;O!==-1&&(N=D.substring(0,O),D=D.substring(O+1).trimStart());const L=N;if(C){const ee=N.indexOf(":");ee!==-1&&(N=N.substr(ee+1),W=N!==A.data.substr(ee+1))}return{tagName:N,tagExp:D,closeIndex:V,attrExpPresent:W,rawTagName:L}}function h(T,R,C){const A=C;let D=1;for(;C<T.length;C++)if(T[C]==="<")if(T[C+1]==="/"){const V=g(T,">",C,`${R} is not closed`);if(T.substring(C+2,V).trim()===R&&(D--,D===0))return{tagContent:T.substring(A,C),i:V};C=V}else if(T[C+1]==="?")C=g(T,"?>",C+1,"StopNode is not closed.");else if(T.substr(C+1,3)==="!--")C=g(T,"-->",C+3,"StopNode is not closed.");else if(T.substr(C+1,2)==="![")C=g(T,"]]>",C,"StopNode is not closed.")-2;else{const V=v(T,C,">");V&&((V&&V.tagName)===R&&V.tagExp[V.tagExp.length-1]!=="/"&&D++,C=V.closeIndex)}}function E(T,R,C){if(R&&typeof T=="string"){const A=T.trim();return A==="true"||A!=="false"&&s(T,C)}return r.isExist(T)?T:""}e.exports=class{constructor(T){this.options=T,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(R,C)=>String.fromCharCode(Number.parseInt(C,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(R,C)=>String.fromCharCode(Number.parseInt(C,16))}},this.addExternalEntities=l,this.parseXml=m,this.parseTextData=u,this.resolveNameSpace=c,this.buildAttributesMap=p,this.isItStopNode=y,this.replaceEntitiesValue=w,this.readStopNodeData=h,this.saveTextToParentTag=S,this.addChild=b,this.ignoreAttributesFn=a(this.options.ignoreAttributes)}}},338:(e,t,n)=>{const{buildOptions:r}=n(63),i=n(299),{prettify:o}=n(728),s=n(31);e.exports=class{constructor(a){this.externalEntities={},this.options=r(a)}parse(a,l){if(typeof a!="string"){if(!a.toString)throw new Error("XML data is accepted in String or Bytes[] form.");a=a.toString()}if(l){l===!0&&(l={});const d=s.validate(a,l);if(d!==!0)throw Error(`${d.err.msg}:${d.err.line}:${d.err.col}`)}const u=new i(this.options);u.addExternalEntities(this.externalEntities);const c=u.parseXml(a);return this.options.preserveOrder||c===void 0?c:o(c,this.options)}addEntity(a,l){if(l.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(a.indexOf("&")!==-1||a.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(l==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[a]=l}}},728:(e,t)=>{function n(s,a,l){let u;const c={};for(let d=0;d<s.length;d++){const p=s[d],m=r(p);let b="";if(b=l===void 0?m:l+"."+m,m===a.textNodeName)u===void 0?u=p[m]:u+=""+p[m];else{if(m===void 0)continue;if(p[m]){let w=n(p[m],a,b);const S=o(w,a);p[":@"]?i(w,p[":@"],b,a):Object.keys(w).length!==1||w[a.textNodeName]===void 0||a.alwaysCreateTextNode?Object.keys(w).length===0&&(a.alwaysCreateTextNode?w[a.textNodeName]="":w=""):w=w[a.textNodeName],c[m]!==void 0&&c.hasOwnProperty(m)?(Array.isArray(c[m])||(c[m]=[c[m]]),c[m].push(w)):a.isArray(m,b,S)?c[m]=[w]:c[m]=w}}}return typeof u=="string"?u.length>0&&(c[a.textNodeName]=u):u!==void 0&&(c[a.textNodeName]=u),c}function r(s){const a=Object.keys(s);for(let l=0;l<a.length;l++){const u=a[l];if(u!==":@")return u}}function i(s,a,l,u){if(a){const c=Object.keys(a),d=c.length;for(let p=0;p<d;p++){const m=c[p];u.isArray(m,l+"."+m,!0,!0)?s[m]=[a[m]]:s[m]=a[m]}}}function o(s,a){const{textNodeName:l}=a,u=Object.keys(s).length;return u===0||!(u!==1||!s[l]&&typeof s[l]!="boolean"&&s[l]!==0)}t.prettify=function(s,a){return n(s,a)}},365:e=>{e.exports=class{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,n){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:n})}addChild(t){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}},135:e=>{function t(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}e.exports=function(n){return n!=null&&(t(n)||(function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&t(r.slice(0,0))})(n)||!!n._isBuffer)}},542:(e,t,n)=>{(function(){var r=n(298),i=n(526).utf8,o=n(135),s=n(526).bin,a=function(l,u){l.constructor==String?l=u&&u.encoding==="binary"?s.stringToBytes(l):i.stringToBytes(l):o(l)?l=Array.prototype.slice.call(l,0):Array.isArray(l)||l.constructor===Uint8Array||(l=l.toString());for(var c=r.bytesToWords(l),d=8*l.length,p=1732584193,m=-271733879,b=-1732584194,w=271733878,S=0;S<c.length;S++)c[S]=16711935&(c[S]<<8|c[S]>>>24)|4278255360&(c[S]<<24|c[S]>>>8);c[d>>>5]|=128<<d%32,c[14+(d+64>>>9<<4)]=d;var y=a._ff,g=a._gg,v=a._hh,h=a._ii;for(S=0;S<c.length;S+=16){var E=p,T=m,R=b,C=w;p=y(p,m,b,w,c[S+0],7,-680876936),w=y(w,p,m,b,c[S+1],12,-389564586),b=y(b,w,p,m,c[S+2],17,606105819),m=y(m,b,w,p,c[S+3],22,-1044525330),p=y(p,m,b,w,c[S+4],7,-176418897),w=y(w,p,m,b,c[S+5],12,1200080426),b=y(b,w,p,m,c[S+6],17,-1473231341),m=y(m,b,w,p,c[S+7],22,-45705983),p=y(p,m,b,w,c[S+8],7,1770035416),w=y(w,p,m,b,c[S+9],12,-1958414417),b=y(b,w,p,m,c[S+10],17,-42063),m=y(m,b,w,p,c[S+11],22,-1990404162),p=y(p,m,b,w,c[S+12],7,1804603682),w=y(w,p,m,b,c[S+13],12,-40341101),b=y(b,w,p,m,c[S+14],17,-1502002290),p=g(p,m=y(m,b,w,p,c[S+15],22,1236535329),b,w,c[S+1],5,-165796510),w=g(w,p,m,b,c[S+6],9,-1069501632),b=g(b,w,p,m,c[S+11],14,643717713),m=g(m,b,w,p,c[S+0],20,-373897302),p=g(p,m,b,w,c[S+5],5,-701558691),w=g(w,p,m,b,c[S+10],9,38016083),b=g(b,w,p,m,c[S+15],14,-660478335),m=g(m,b,w,p,c[S+4],20,-405537848),p=g(p,m,b,w,c[S+9],5,568446438),w=g(w,p,m,b,c[S+14],9,-1019803690),b=g(b,w,p,m,c[S+3],14,-187363961),m=g(m,b,w,p,c[S+8],20,1163531501),p=g(p,m,b,w,c[S+13],5,-1444681467),w=g(w,p,m,b,c[S+2],9,-51403784),b=g(b,w,p,m,c[S+7],14,1735328473),p=v(p,m=g(m,b,w,p,c[S+12],20,-1926607734),b,w,c[S+5],4,-378558),w=v(w,p,m,b,c[S+8],11,-2022574463),b=v(b,w,p,m,c[S+11],16,1839030562),m=v(m,b,w,p,c[S+14],23,-35309556),p=v(p,m,b,w,c[S+1],4,-1530992060),w=v(w,p,m,b,c[S+4],11,1272893353),b=v(b,w,p,m,c[S+7],16,-155497632),m=v(m,b,w,p,c[S+10],23,-1094730640),p=v(p,m,b,w,c[S+13],4,681279174),w=v(w,p,m,b,c[S+0],11,-358537222),b=v(b,w,p,m,c[S+3],16,-722521979),m=v(m,b,w,p,c[S+6],23,76029189),p=v(p,m,b,w,c[S+9],4,-640364487),w=v(w,p,m,b,c[S+12],11,-421815835),b=v(b,w,p,m,c[S+15],16,530742520),p=h(p,m=v(m,b,w,p,c[S+2],23,-995338651),b,w,c[S+0],6,-198630844),w=h(w,p,m,b,c[S+7],10,1126891415),b=h(b,w,p,m,c[S+14],15,-1416354905),m=h(m,b,w,p,c[S+5],21,-57434055),p=h(p,m,b,w,c[S+12],6,1700485571),w=h(w,p,m,b,c[S+3],10,-1894986606),b=h(b,w,p,m,c[S+10],15,-1051523),m=h(m,b,w,p,c[S+1],21,-2054922799),p=h(p,m,b,w,c[S+8],6,1873313359),w=h(w,p,m,b,c[S+15],10,-30611744),b=h(b,w,p,m,c[S+6],15,-1560198380),m=h(m,b,w,p,c[S+13],21,1309151649),p=h(p,m,b,w,c[S+4],6,-145523070),w=h(w,p,m,b,c[S+11],10,-1120210379),b=h(b,w,p,m,c[S+2],15,718787259),m=h(m,b,w,p,c[S+9],21,-343485551),p=p+E>>>0,m=m+T>>>0,b=b+R>>>0,w=w+C>>>0}return r.endian([p,m,b,w])};a._ff=function(l,u,c,d,p,m,b){var w=l+(u&c|~u&d)+(p>>>0)+b;return(w<<m|w>>>32-m)+u},a._gg=function(l,u,c,d,p,m,b){var w=l+(u&d|c&~d)+(p>>>0)+b;return(w<<m|w>>>32-m)+u},a._hh=function(l,u,c,d,p,m,b){var w=l+(u^c^d)+(p>>>0)+b;return(w<<m|w>>>32-m)+u},a._ii=function(l,u,c,d,p,m,b){var w=l+(c^(u|~d))+(p>>>0)+b;return(w<<m|w>>>32-m)+u},a._blocksize=16,a._digestsize=16,e.exports=function(l,u){if(l==null)throw new Error("Illegal argument "+l);var c=r.wordsToBytes(a(l,u));return u&&u.asBytes?c:u&&u.asString?s.bytesToString(c):r.bytesToHex(c)}})()},285:(e,t,n)=>{var r=n(2);e.exports=function(y){return y?(y.substr(0,2)==="{}"&&(y="\\{\\}"+y.substr(2)),S((function(g){return g.split("\\\\").join(i).split("\\{").join(o).split("\\}").join(s).split("\\,").join(a).split("\\.").join(l)})(y),!0).map(c)):[]};var i="\0SLASH"+Math.random()+"\0",o="\0OPEN"+Math.random()+"\0",s="\0CLOSE"+Math.random()+"\0",a="\0COMMA"+Math.random()+"\0",l="\0PERIOD"+Math.random()+"\0";function u(y){return parseInt(y,10)==y?parseInt(y,10):y.charCodeAt(0)}function c(y){return y.split(i).join("\\").split(o).join("{").split(s).join("}").split(a).join(",").split(l).join(".")}function d(y){if(!y)return[""];var g=[],v=r("{","}",y);if(!v)return y.split(",");var h=v.pre,E=v.body,T=v.post,R=h.split(",");R[R.length-1]+="{"+E+"}";var C=d(T);return T.length&&(R[R.length-1]+=C.shift(),R.push.apply(R,C)),g.push.apply(g,R),g}function p(y){return"{"+y+"}"}function m(y){return/^-?0\d/.test(y)}function b(y,g){return y<=g}function w(y,g){return y>=g}function S(y,g){var v=[],h=r("{","}",y);if(!h)return[y];var E=h.pre,T=h.post.length?S(h.post,!1):[""];if(/\$$/.test(h.pre))for(var R=0;R<T.length;R++){var C=E+"{"+h.body+"}"+T[R];v.push(C)}else{var A,D,V=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(h.body),O=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(h.body),N=V||O,W=h.body.indexOf(",")>=0;if(!N&&!W)return h.post.match(/,.*\}/)?S(y=h.pre+"{"+h.body+s+h.post):[y];if(N)A=h.body.split(/\.\./);else if((A=d(h.body)).length===1&&(A=S(A[0],!1).map(p)).length===1)return T.map((function(te){return h.pre+A[0]+te}));if(N){var L=u(A[0]),ee=u(A[1]),J=Math.max(A[0].length,A[1].length),se=A.length==3?Math.abs(u(A[2])):1,he=b;ee<L&&(se*=-1,he=w);var oe=A.some(m);D=[];for(var we=L;he(we,ee);we+=se){var X;if(O)(X=String.fromCharCode(we))==="\\"&&(X="");else if(X=String(we),oe){var ie=J-X.length;if(ie>0){var le=new Array(ie+1).join("0");X=we<0?"-"+le+X.slice(1):le+X}}D.push(X)}}else{D=[];for(var Ae=0;Ae<A.length;Ae++)D.push.apply(D,S(A[Ae],!1))}for(Ae=0;Ae<D.length;Ae++)for(R=0;R<T.length;R++)C=E+D[Ae]+T[R],(!g||N||C)&&v.push(C)}return v}},829:e=>{function t(u){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},t(u)}function n(u){var c=typeof Map=="function"?new Map:void 0;return n=function(d){if(d===null||(p=d,Function.toString.call(p).indexOf("[native code]")===-1))return d;var p;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(c!==void 0){if(c.has(d))return c.get(d);c.set(d,m)}function m(){return r(d,arguments,o(this).constructor)}return m.prototype=Object.create(d.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),i(m,d)},n(u)}function r(u,c,d){return r=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch{return!1}})()?Reflect.construct:function(p,m,b){var w=[null];w.push.apply(w,m);var S=new(Function.bind.apply(p,w));return b&&i(S,b.prototype),S},r.apply(null,arguments)}function i(u,c){return i=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},i(u,c)}function o(u){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(c){return c.__proto__||Object.getPrototypeOf(c)},o(u)}var s=(function(u){function c(d){var p;return(function(m,b){if(!(m instanceof b))throw new TypeError("Cannot call a class as a function")})(this,c),(p=(function(m,b){return!b||t(b)!=="object"&&typeof b!="function"?(function(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w})(m):b})(this,o(c).call(this,d))).name="ObjectPrototypeMutationError",p}return(function(d,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(p&&p.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),p&&i(d,p)})(c,u),c})(n(Error));function a(u,c){for(var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},p=c.split("."),m=p.length,b=function(y){var g=p[y];if(!u)return{v:void 0};if(g==="+"){if(Array.isArray(u))return{v:u.map((function(h,E){var T=p.slice(y+1);return T.length>0?a(h,T.join("."),d):d(u,E,p,y)}))};var v=p.slice(0,y).join(".");throw new Error("Object at wildcard (".concat(v,") is not an array"))}u=d(u,g,p,y)},w=0;w<m;w++){var S=b(w);if(t(S)==="object")return S.v}return u}function l(u,c){return u.length===c+1}e.exports={set:function(u,c,d){if(t(u)!="object"||u===null||c===void 0)return u;if(typeof c=="number")return u[c]=d,u[c];try{return a(u,c,(function(p,m,b,w){if(p===Reflect.getPrototypeOf({}))throw new s("Attempting to mutate Object.prototype");if(!p[m]){var S=Number.isInteger(Number(b[w+1])),y=b[w+1]==="+";p[m]=S||y?[]:{}}return l(b,w)&&(p[m]=d),p[m]}))}catch(p){if(p instanceof s)throw p;return u}},get:function(u,c){if(t(u)!="object"||u===null||c===void 0)return u;if(typeof c=="number")return u[c];try{return a(u,c,(function(d,p){return d[p]}))}catch{return u}},has:function(u,c){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(t(u)!="object"||u===null||c===void 0)return!1;if(typeof c=="number")return c in u;try{var p=!1;return a(u,c,(function(m,b,w,S){if(!l(w,S))return m&&m[b];p=d.own?m.hasOwnProperty(b):b in m})),p}catch{return!1}},hasOwn:function(u,c,d){return this.has(u,c,d||{own:!0})},isIn:function(u,c,d){var p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(t(u)!="object"||u===null||c===void 0)return!1;try{var m=!1,b=!1;return a(u,c,(function(w,S,y,g){return m=m||w===d||!!w&&w[S]===d,b=l(y,g)&&t(w)==="object"&&S in w,w&&w[S]})),p.validPath?m&&b:m}catch{return!1}},ObjectPrototypeMutationError:s}},47:(e,t,n)=>{var r=n(410),i=function(u){return typeof u=="string"};function o(u,c){for(var d=[],p=0;p<u.length;p++){var m=u[p];m&&m!=="."&&(m===".."?d.length&&d[d.length-1]!==".."?d.pop():c&&d.push(".."):d.push(m))}return d}var s=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a={};function l(u){return s.exec(u).slice(1)}a.resolve=function(){for(var u="",c=!1,d=arguments.length-1;d>=-1&&!c;d--){var p=d>=0?arguments[d]:be.cwd();if(!i(p))throw new TypeError("Arguments to path.resolve must be strings");p&&(u=p+"/"+u,c=p.charAt(0)==="/")}return(c?"/":"")+(u=o(u.split("/"),!c).join("/"))||"."},a.normalize=function(u){var c=a.isAbsolute(u),d=u.substr(-1)==="/";return(u=o(u.split("/"),!c).join("/"))||c||(u="."),u&&d&&(u+="/"),(c?"/":"")+u},a.isAbsolute=function(u){return u.charAt(0)==="/"},a.join=function(){for(var u="",c=0;c<arguments.length;c++){var d=arguments[c];if(!i(d))throw new TypeError("Arguments to path.join must be strings");d&&(u+=u?"/"+d:d)}return a.normalize(u)},a.relative=function(u,c){function d(g){for(var v=0;v<g.length&&g[v]==="";v++);for(var h=g.length-1;h>=0&&g[h]==="";h--);return v>h?[]:g.slice(v,h+1)}u=a.resolve(u).substr(1),c=a.resolve(c).substr(1);for(var p=d(u.split("/")),m=d(c.split("/")),b=Math.min(p.length,m.length),w=b,S=0;S<b;S++)if(p[S]!==m[S]){w=S;break}var y=[];for(S=w;S<p.length;S++)y.push("..");return(y=y.concat(m.slice(w))).join("/")},a._makeLong=function(u){return u},a.dirname=function(u){var c=l(u),d=c[0],p=c[1];return d||p?(p&&(p=p.substr(0,p.length-1)),d+p):"."},a.basename=function(u,c){var d=l(u)[2];return c&&d.substr(-1*c.length)===c&&(d=d.substr(0,d.length-c.length)),d},a.extname=function(u){return l(u)[3]},a.format=function(u){if(!r.isObject(u))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof u);var c=u.root||"";if(!i(c))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof u.root);return(u.dir?u.dir+a.sep:"")+(u.base||"")},a.parse=function(u){if(!i(u))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof u);var c=l(u);if(!c||c.length!==4)throw new TypeError("Invalid path '"+u+"'");return c[1]=c[1]||"",c[2]=c[2]||"",c[3]=c[3]||"",{root:c[0],dir:c[0]+c[1].slice(0,c[1].length-1),base:c[2],ext:c[3],name:c[2].slice(0,c[2].length-c[3].length)}},a.sep="/",a.delimiter=":",e.exports=a},647:(e,t)=>{var n=Object.prototype.hasOwnProperty;function r(o){try{return decodeURIComponent(o.replace(/\+/g," "))}catch{return null}}function i(o){try{return encodeURIComponent(o)}catch{return null}}t.stringify=function(o,s){s=s||"";var a,l,u=[];for(l in typeof s!="string"&&(s="?"),o)if(n.call(o,l)){if((a=o[l])||a!=null&&!isNaN(a)||(a=""),l=i(l),a=i(a),l===null||a===null)continue;u.push(l+"="+a)}return u.length?s+u.join("&"):""},t.parse=function(o){for(var s,a=/([^=?#&]+)=?([^&]*)/g,l={};s=a.exec(o);){var u=r(s[1]),c=r(s[2]);u===null||c===null||u in l||(l[u]=c)}return l}},670:e=>{e.exports=function(t,n){if(n=n.split(":")[0],!(t=+t))return!1;switch(n){case"http":case"ws":return t!==80;case"https":case"wss":return t!==443;case"ftp":return t!==21;case"gopher":return t!==70;case"file":return!1}return t!==0}},494:e=>{const t=/^[-+]?0x[a-fA-F0-9]+$/,n=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const r={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};e.exports=function(i){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(o=Object.assign({},r,o),!i||typeof i!="string")return i;let s=i.trim();if(o.skipLike!==void 0&&o.skipLike.test(s))return i;if(o.hex&&t.test(s))return Number.parseInt(s,16);{const l=n.exec(s);if(l){const u=l[1],c=l[2];let d=((a=l[3])&&a.indexOf(".")!==-1&&((a=a.replace(/0+$/,""))==="."?a="0":a[0]==="."?a="0"+a:a[a.length-1]==="."&&(a=a.substr(0,a.length-1))),a);const p=l[4]||l[6];if(!o.leadingZeros&&c.length>0&&u&&s[2]!=="."||!o.leadingZeros&&c.length>0&&!u&&s[1]!==".")return i;{const m=Number(s),b=""+m;return b.search(/[eE]/)!==-1||p?o.eNotation?m:i:s.indexOf(".")!==-1?b==="0"&&d===""||b===d||u&&b==="-"+d?m:i:c?d===b||u+d===b?m:i:s===b||s===u+b?m:i}}return i}var a}},737:(e,t,n)=>{var r=n(670),i=n(647),o=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,l=/:\d+$/,u=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,c=/^[a-zA-Z]:/;function d(g){return(g||"").toString().replace(o,"")}var p=[["#","hash"],["?","query"],function(g,v){return w(v.protocol)?g.replace(/\\/g,"/"):g},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],m={hash:1,query:1};function b(g){var v,h=(typeof window<"u"?window:typeof Wr<"u"?Wr:typeof self<"u"?self:{}).location||{},E={},T=typeof(g=g||h);if(g.protocol==="blob:")E=new y(unescape(g.pathname),{});else if(T==="string")for(v in E=new y(g,{}),m)delete E[v];else if(T==="object"){for(v in g)v in m||(E[v]=g[v]);E.slashes===void 0&&(E.slashes=a.test(g.href))}return E}function w(g){return g==="file:"||g==="ftp:"||g==="http:"||g==="https:"||g==="ws:"||g==="wss:"}function S(g,v){g=(g=d(g)).replace(s,""),v=v||{};var h,E=u.exec(g),T=E[1]?E[1].toLowerCase():"",R=!!E[2],C=!!E[3],A=0;return R?C?(h=E[2]+E[3]+E[4],A=E[2].length+E[3].length):(h=E[2]+E[4],A=E[2].length):C?(h=E[3]+E[4],A=E[3].length):h=E[4],T==="file:"?A>=2&&(h=h.slice(2)):w(T)?h=E[4]:T?R&&(h=h.slice(2)):A>=2&&w(v.protocol)&&(h=E[4]),{protocol:T,slashes:R||w(T),slashesCount:A,rest:h}}function y(g,v,h){if(g=(g=d(g)).replace(s,""),!(this instanceof y))return new y(g,v,h);var E,T,R,C,A,D,V=p.slice(),O=typeof v,N=this,W=0;for(O!=="object"&&O!=="string"&&(h=v,v=null),h&&typeof h!="function"&&(h=i.parse),E=!(T=S(g||"",v=b(v))).protocol&&!T.slashes,N.slashes=T.slashes||E&&v.slashes,N.protocol=T.protocol||v.protocol||"",g=T.rest,(T.protocol==="file:"&&(T.slashesCount!==2||c.test(g))||!T.slashes&&(T.protocol||T.slashesCount<2||!w(N.protocol)))&&(V[3]=[/(.*)/,"pathname"]);W<V.length;W++)typeof(C=V[W])!="function"?(R=C[0],D=C[1],R!=R?N[D]=g:typeof R=="string"?~(A=R==="@"?g.lastIndexOf(R):g.indexOf(R))&&(typeof C[2]=="number"?(N[D]=g.slice(0,A),g=g.slice(A+C[2])):(N[D]=g.slice(A),g=g.slice(0,A))):(A=R.exec(g))&&(N[D]=A[1],g=g.slice(0,A.index)),N[D]=N[D]||E&&C[3]&&v[D]||"",C[4]&&(N[D]=N[D].toLowerCase())):g=C(g,N);h&&(N.query=h(N.query)),E&&v.slashes&&N.pathname.charAt(0)!=="/"&&(N.pathname!==""||v.pathname!=="")&&(N.pathname=(function(L,ee){if(L==="")return ee;for(var J=(ee||"/").split("/").slice(0,-1).concat(L.split("/")),se=J.length,he=J[se-1],oe=!1,we=0;se--;)J[se]==="."?J.splice(se,1):J[se]===".."?(J.splice(se,1),we++):we&&(se===0&&(oe=!0),J.splice(se,1),we--);return oe&&J.unshift(""),he!=="."&&he!==".."||J.push(""),J.join("/")})(N.pathname,v.pathname)),N.pathname.charAt(0)!=="/"&&w(N.protocol)&&(N.pathname="/"+N.pathname),r(N.port,N.protocol)||(N.host=N.hostname,N.port=""),N.username=N.password="",N.auth&&(~(A=N.auth.indexOf(":"))?(N.username=N.auth.slice(0,A),N.username=encodeURIComponent(decodeURIComponent(N.username)),N.password=N.auth.slice(A+1),N.password=encodeURIComponent(decodeURIComponent(N.password))):N.username=encodeURIComponent(decodeURIComponent(N.auth)),N.auth=N.password?N.username+":"+N.password:N.username),N.origin=N.protocol!=="file:"&&w(N.protocol)&&N.host?N.protocol+"//"+N.host:"null",N.href=N.toString()}y.prototype={set:function(g,v,h){var E=this;switch(g){case"query":typeof v=="string"&&v.length&&(v=(h||i.parse)(v)),E[g]=v;break;case"port":E[g]=v,r(v,E.protocol)?v&&(E.host=E.hostname+":"+v):(E.host=E.hostname,E[g]="");break;case"hostname":E[g]=v,E.port&&(v+=":"+E.port),E.host=v;break;case"host":E[g]=v,l.test(v)?(v=v.split(":"),E.port=v.pop(),E.hostname=v.join(":")):(E.hostname=v,E.port="");break;case"protocol":E.protocol=v.toLowerCase(),E.slashes=!h;break;case"pathname":case"hash":if(v){var T=g==="pathname"?"/":"#";E[g]=v.charAt(0)!==T?T+v:v}else E[g]=v;break;case"username":case"password":E[g]=encodeURIComponent(v);break;case"auth":var R=v.indexOf(":");~R?(E.username=v.slice(0,R),E.username=encodeURIComponent(decodeURIComponent(E.username)),E.password=v.slice(R+1),E.password=encodeURIComponent(decodeURIComponent(E.password))):E.username=encodeURIComponent(decodeURIComponent(v))}for(var C=0;C<p.length;C++){var A=p[C];A[4]&&(E[A[1]]=E[A[1]].toLowerCase())}return E.auth=E.password?E.username+":"+E.password:E.username,E.origin=E.protocol!=="file:"&&w(E.protocol)&&E.host?E.protocol+"//"+E.host:"null",E.href=E.toString(),E},toString:function(g){g&&typeof g=="function"||(g=i.stringify);var v,h=this,E=h.host,T=h.protocol;T&&T.charAt(T.length-1)!==":"&&(T+=":");var R=T+(h.protocol&&h.slashes||w(h.protocol)?"//":"");return h.username?(R+=h.username,h.password&&(R+=":"+h.password),R+="@"):h.password?(R+=":"+h.password,R+="@"):h.protocol!=="file:"&&w(h.protocol)&&!E&&h.pathname!=="/"&&(R+="@"),(E[E.length-1]===":"||l.test(h.hostname)&&!h.port)&&(E+=":"),R+=E+h.pathname,(v=typeof h.query=="object"?g(h.query):h.query)&&(R+=v.charAt(0)!=="?"?"?"+v:v),h.hash&&(R+=h.hash),R}},y.extractProtocol=S,y.location=b,y.trimLeft=d,y.qs=i,e.exports=y},410:()=>{},388:()=>{},805:()=>{},345:()=>{},800:()=>{}},by={};function mt(e){var t=by[e];if(t!==void 0)return t.exports;var n=by[e]={id:e,loaded:!1,exports:{}};return GC[e].call(n.exports,n,n.exports,mt),n.loaded=!0,n.exports}mt.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return mt.d(t,{a:t}),t},mt.d=(e,t)=>{for(var n in t)mt.o(t,n)&&!mt.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},mt.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),mt.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var Ln={};mt.d(Ln,{hT:()=>hn,O4:()=>Cr,Kd:()=>rR,YK:()=>iR,UU:()=>uk,Gu:()=>Iy,ky:()=>Hy,h4:()=>Mo,ch:()=>da,hq:()=>ui,i5:()=>Ky});var QC=mt(737),XC=mt.n(QC);function cf(e){if(!uf(e))throw new Error("Parameter was not an error")}function uf(e){return!!e&&typeof e=="object"&&(t=e,Object.prototype.toString.call(t)==="[object Error]")||e instanceof Error;var t}class pn extends Error{constructor(t,n){const r=[...arguments],{options:i,shortMessage:o}=(function(a){let l,u="";if(a.length===0)l={};else if(uf(a[0]))l={cause:a[0]},u=a.slice(1).join(" ")||"";else if(a[0]&&typeof a[0]=="object")l=Object.assign({},a[0]),u=a.slice(1).join(" ")||"";else{if(typeof a[0]!="string")throw new Error("Invalid arguments passed to Layerr");l={},u=u=a.join(" ")||""}return{options:l,shortMessage:u}})(r);let s=o;if(i.cause&&(s=`${s}: ${i.cause.message}`),super(s),this.message=s,i.name&&typeof i.name=="string"?this.name=i.name:this.name="Layerr",i.cause&&Object.defineProperty(this,"_cause",{value:i.cause}),Object.defineProperty(this,"_info",{value:{}}),i.info&&typeof i.info=="object"&&Object.assign(this._info,i.info),Error.captureStackTrace){const a=i.constructorOpt||this.constructor;Error.captureStackTrace(this,a)}}static cause(t){return cf(t),t._cause&&uf(t._cause)?t._cause:null}static fullStack(t){cf(t);const n=pn.cause(t);return n?`${t.stack}
32
- caused by: ${pn.fullStack(n)}`:t.stack??""}static info(t){cf(t);const n={},r=pn.cause(t);return r&&Object.assign(n,pn.info(r)),t._info&&Object.assign(n,t._info),n}toString(){let t=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(t=`${t}: ${this.message}`),t}}var YC=mt(47),oa=mt.n(YC);const wy="__PATH_SEPARATOR_POSIX__",Sy="__PATH_SEPARATOR_WINDOWS__";function Ot(e){try{const t=e.replace(/\//g,wy).replace(/\\\\/g,Sy);return encodeURIComponent(t).split(Sy).join("\\\\").split(wy).join("/")}catch(t){throw new pn(t,"Failed encoding path")}}function Ey(e){return e.startsWith("/")?e:"/"+e}function Do(e){let t=e;return t[0]!=="/"&&(t="/"+t),/^.+\/$/.test(t)&&(t=t.substr(0,t.length-1)),t}function JC(e){let t=new(XC())(e).pathname;return t.length<=0&&(t="/"),Do(t)}function Ft(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(function(){return(function(r){var i=[];if(r.length===0)return"";if(typeof r[0]!="string")throw new TypeError("Url must be a string. Received "+r[0]);if(r[0].match(/^[^/:]+:\/*$/)&&r.length>1){var o=r.shift();r[0]=o+r[0]}r[0].match(/^file:\/\/\//)?r[0]=r[0].replace(/^([^/:]+):\/*/,"$1:///"):r[0]=r[0].replace(/^([^/:]+):\/*/,"$1://");for(var s=0;s<r.length;s++){var a=r[s];if(typeof a!="string")throw new TypeError("Url must be a string. Received "+a);a!==""&&(s>0&&(a=a.replace(/^[\/]+/,"")),a=s<r.length-1?a.replace(/[\/]+$/,""):a.replace(/[\/]+$/,"/"),i.push(a))}var l=i.join("/"),u=(l=l.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return u.shift()+(u.length>0?"?":"")+u.join("&")})(typeof arguments[0]=="object"?arguments[0]:[].slice.call(arguments))})(t.reduce(((r,i,o)=>((o===0||i!=="/"||i==="/"&&r[r.length-1]!=="/")&&r.push(i),r)),[]))}var ZC=mt(542),No=mt.n(ZC);const eR="abcdef0123456789";function Ty(e,t){const n=e.url.replace("//",""),r=n.indexOf("/")==-1?"/":n.slice(n.indexOf("/")),i=e.method?e.method.toUpperCase():"GET",o=!!/(^|,)\s*auth\s*($|,)/.test(t.qop)&&"auth",s=`00000000${t.nc}`.slice(-8),a=(function(p,m,b,w,S,y,g){const v=g||No()(`${m}:${b}:${w}`);return p&&p.toLowerCase()==="md5-sess"?No()(`${v}:${S}:${y}`):v})(t.algorithm,t.username,t.realm,t.password,t.nonce,t.cnonce,t.ha1),l=No()(`${i}:${r}`),u=o?No()(`${a}:${t.nonce}:${s}:${t.cnonce}:${o}:${l}`):No()(`${a}:${t.nonce}:${l}`),c={username:t.username,realm:t.realm,nonce:t.nonce,uri:r,qop:o,response:u,nc:s,cnonce:t.cnonce,algorithm:t.algorithm,opaque:t.opaque},d=[];for(const p in c)c[p]&&(p==="qop"||p==="nc"||p==="algorithm"?d.push(`${p}=${c[p]}`):d.push(`${p}="${c[p]}"`));return`Digest ${d.join(", ")}`}function Ay(e){return(e.headers&&e.headers.get("www-authenticate")||"").split(/\s/)[0].toLowerCase()==="digest"}var tR=mt(101),xy=mt.n(tR);function Cy(e){return xy().decode(e)}function Ry(e,t){var n;return`Basic ${n=`${e}:${t}`,xy().encode(n)}`}const sa=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis,nR=sa.fetch.bind(sa),rR=sa.Request,iR=sa.Response;let hn=(function(e){return e.Auto="auto",e.Digest="digest",e.None="none",e.Password="password",e.Token="token",e})({}),Cr=(function(e){return e.DataTypeNoLength="data-type-no-length",e.InvalidAuthType="invalid-auth-type",e.InvalidOutputFormat="invalid-output-format",e.LinkUnsupportedAuthType="link-unsupported-auth",e.InvalidUpdateRange="invalid-update-range",e.NotSupported="not-supported",e})({});function ky(e,t,n,r,i){switch(e.authType){case hn.Auto:t&&n&&(e.headers.Authorization=Ry(t,n));break;case hn.Digest:e.digest=(function(s,a,l){return{username:s,password:a,ha1:l,nc:0,algorithm:"md5",hasDigestAuth:!1}})(t,n,i);break;case hn.None:break;case hn.Password:e.headers.Authorization=Ry(t,n);break;case hn.Token:e.headers.Authorization=`${(o=r).token_type} ${o.access_token}`;break;default:throw new pn({info:{code:Cr.InvalidAuthType}},`Invalid auth type: ${e.authType}`)}var o}mt(345),mt(800);const Py="@@HOTPATCHER",oR=()=>{};function ff(e){return{original:e,methods:[e],final:!1}}class sR{constructor(){this._configuration={registry:{},getEmptyAction:"null"},this.__type__=Py}get configuration(){return this._configuration}get getEmptyAction(){return this.configuration.getEmptyAction}set getEmptyAction(t){this.configuration.getEmptyAction=t}control(t){let n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(!t||t.__type__!==Py)throw new Error("Failed taking control of target HotPatcher instance: Invalid type or object");return Object.keys(t.configuration.registry).forEach((r=>{this.configuration.registry.hasOwnProperty(r)?n&&(this.configuration.registry[r]=Object.assign({},t.configuration.registry[r])):this.configuration.registry[r]=Object.assign({},t.configuration.registry[r])})),t._configuration=this.configuration,this}execute(t){const n=this.get(t)||oR;for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return n(...i)}get(t){const n=this.configuration.registry[t];if(!n)switch(this.getEmptyAction){case"null":return null;case"throw":throw new Error(`Failed handling method request: No method provided for override: ${t}`);default:throw new Error(`Failed handling request which resulted in an empty method: Invalid empty-action specified: ${this.getEmptyAction}`)}return(function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];if(i.length===0)throw new Error("Failed creating sequence: No functions provided");return function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];let u=a;const c=this;for(;i.length>0;)u=[i.shift().apply(c,u)];return u[0]}})(...n.methods)}isPatched(t){return!!this.configuration.registry[t]}patch(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{chain:i=!1}=r;if(this.configuration.registry[t]&&this.configuration.registry[t].final)throw new Error(`Failed patching '${t}': Method marked as being final`);if(typeof n!="function")throw new Error(`Failed patching '${t}': Provided method is not a function`);if(i)this.configuration.registry[t]?this.configuration.registry[t].methods.push(n):this.configuration.registry[t]=ff(n);else if(this.isPatched(t)){const{original:o}=this.configuration.registry[t];this.configuration.registry[t]=Object.assign(ff(n),{original:o})}else this.configuration.registry[t]=ff(n);return this}patchInline(t,n){this.isPatched(t)||this.patch(t,n);for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return this.execute(t,...i)}plugin(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.forEach((o=>{this.patch(t,o,{chain:!0})})),this}restore(t){if(!this.isPatched(t))throw new Error(`Failed restoring method: No method present for key: ${t}`);if(typeof this.configuration.registry[t].original!="function")throw new Error(`Failed restoring method: Original method not found or of invalid type for key: ${t}`);return this.configuration.registry[t].methods=[this.configuration.registry[t].original],this}setFinal(t){if(!this.configuration.registry.hasOwnProperty(t))throw new Error(`Failed marking '${t}' as final: No method found for key`);return this.configuration.registry[t].final=!0,this}}let df=null;function Iy(){return df||(df=new sR),df}function aa(e){return(function(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let n=t;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n})(e)?Object.assign({},e):Object.setPrototypeOf(Object.assign({},e),Object.getPrototypeOf(e))}function Oy(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];let r=null,i=[...t];for(;i.length>0;){const o=i.shift();r=r?Fy(r,o):aa(o)}return r}function Fy(e,t){const n=aa(e);return Object.keys(t).forEach((r=>{n.hasOwnProperty(r)?Array.isArray(t[r])?n[r]=Array.isArray(n[r])?[...n[r],...t[r]]:[...t[r]]:typeof t[r]=="object"&&t[r]?n[r]=typeof n[r]=="object"&&n[r]?Fy(n[r],t[r]):aa(t[r]):n[r]=t[r]:n[r]=t[r]})),n}function aR(e){const t={};for(const n of e.keys())t[n]=e.get(n);return t}function pf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t.length===0)return{};const r={};return t.reduce(((i,o)=>(Object.keys(o).forEach((s=>{const a=s.toLowerCase();r.hasOwnProperty(a)?i[r[a]]=o[s]:(r[a]=s,i[s]=o[s])})),i)),{})}mt(805);const lR=typeof ArrayBuffer=="function",{toString:cR}=Object.prototype;function _y(e){return lR&&(e instanceof ArrayBuffer||cR.call(e)==="[object ArrayBuffer]")}function Dy(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function hf(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}function mf(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const Ny=hf((function(e){const t=e._digest;return delete e._digest,t.hasDigestAuth&&(e=Oy(e,{headers:{Authorization:Ty(e,t)}})),mf(la(e),(function(n){let r=!1;return i=function(s){return r?s:n},(o=(function(){if(n.status==401)return t.hasDigestAuth=(function(s,a){if(!Ay(s))return!1;const l=/([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi;for(;;){const u=s.headers&&s.headers.get("www-authenticate")||"",c=l.exec(u);if(!c)break;a[c[1]]=c[2]||c[3]}return a.nc+=1,a.cnonce=(function(){let u="";for(let c=0;c<32;++c)u=`${u}${eR[Math.floor(16*Math.random())]}`;return u})(),!0})(n,t),(function(){if(t.hasDigestAuth)return mf(la(e=Oy(e,{headers:{Authorization:Ty(e,t)}})),(function(s){return s.status==401?t.hasDigestAuth=!1:t.nc++,r=!0,s}))})();t.nc++})())&&o.then?o.then(i):i(o);var i,o}))})),uR=hf((function(e,t){return mf(la(e),(function(n){return n.ok?(t.authType=hn.Password,n):n.status==401&&Ay(n)?(t.authType=hn.Digest,ky(t,t.username,t.password,void 0,void 0),e._digest=t.digest,Ny(e)):n}))})),Wt=hf((function(e,t){return t.authType===hn.Auto?uR(e,t):e._digest?Ny(e):la(e)}));function Ht(e,t,n){const r=aa(e);return r.headers=pf(t.headers,r.headers||{},n.headers||{}),n.data!==void 0&&(r.data=n.data),n.signal&&(r.signal=n.signal),t.httpAgent&&(r.httpAgent=t.httpAgent),t.httpsAgent&&(r.httpsAgent=t.httpsAgent),t.digest&&(r._digest=t.digest),typeof t.withCredentials=="boolean"&&(r.withCredentials=t.withCredentials),r}function la(e){const t=Iy();return t.patchInline("request",(n=>t.patchInline("fetch",nR,n.url,(function(r){let i={};const o={method:r.method};if(r.headers&&(i=pf(i,r.headers)),r.data!==void 0){const[s,a]=(function(l){if(typeof l=="string")return[l,{}];if(Dy(l))return[l,{}];if(_y(l))return[l,{}];if(l&&typeof l=="object")return[JSON.stringify(l),{"content-type":"application/json"}];throw new Error("Unable to convert request body: Unexpected body type: "+typeof l)})(r.data);o.body=s,i=pf(i,a)}return r.signal&&(o.signal=r.signal),r.withCredentials&&(o.credentials="include"),o.headers=i,o})(n))),e)}var fR=mt(285);const ca=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},dR={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Lo=e=>e.replace(/[[\]\\-]/g,"\\$&"),Ly=e=>e.join(""),pR=(e,t)=>{const n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");const r=[],i=[];let o=n+1,s=!1,a=!1,l=!1,u=!1,c=n,d="";e:for(;o<e.length;){const w=e.charAt(o);if(w!=="!"&&w!=="^"||o!==n+1){if(w==="]"&&s&&!l){c=o+1;break}if(s=!0,w!=="\\"||l){if(w==="["&&!l){for(const[S,[y,g,v]]of Object.entries(dR))if(e.startsWith(S,o)){if(d)return["$.",!1,e.length-n,!0];o+=S.length,v?i.push(y):r.push(y),a=a||g;continue e}}l=!1,d?(w>d?r.push(Lo(d)+"-"+Lo(w)):w===d&&r.push(Lo(w)),d="",o++):e.startsWith("-]",o+1)?(r.push(Lo(w+"-")),o+=2):e.startsWith("-",o+1)?(d=w,o+=2):(r.push(Lo(w)),o++)}else l=!0,o++}else u=!0,o++}if(c<o)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!u)return[(p=r[0].length===2?r[0].slice(-1):r[0],p.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,c-n,!1];var p;const m="["+(u?"^":"")+Ly(r)+"]",b="["+(u?"":"^")+Ly(i)+"]";return[r.length&&i.length?"("+m+"|"+b+")":r.length?m:b,a,c-n,!0]},$o=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")},hR=new Set(["!","?","+","*","@"]),$y=e=>hR.has(e),gf="(?!\\.)",mR=new Set(["[","."]),gR=new Set(["..","."]),yR=new Set("().*{}+?[]^$\\!"),yf="[^/]",My=yf+"*?",By=yf+"+?";class mn{type;#n;#r;#o=!1;#e=[];#t;#s;#l;#a=!1;#i;#c;#f=!1;constructor(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.type=t,t&&(this.#r=!0),this.#t=n,this.#n=this.#t?this.#t.#n:this,this.#i=this.#n===this?r:this.#n.#i,this.#l=this.#n===this?[]:this.#n.#l,t!=="!"||this.#n.#a||this.#l.push(this),this.#s=this.#t?this.#t.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(const t of this.#e)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#e.map((t=>String(t))).join("|")+")":this.#c=this.#e.map((t=>String(t))).join("")}#p(){if(this!==this.#n)throw new Error("should only call on root");if(this.#a)return this;let t;for(this.toString(),this.#a=!0;t=this.#l.pop();){if(t.type!=="!")continue;let n=t,r=n.#t;for(;r;){for(let i=n.#s+1;!r.type&&i<r.#e.length;i++)for(const o of t.#e){if(typeof o=="string")throw new Error("string part in extglob AST??");o.copyIn(r.#e[i])}n=r,r=n.#t}}return this}push(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(const i of n)if(i!==""){if(typeof i!="string"&&!(i instanceof mn&&i.#t===this))throw new Error("invalid part: "+i);this.#e.push(i)}}toJSON(){const t=this.type===null?this.#e.slice().map((n=>typeof n=="string"?n:n.toJSON())):[this.type,...this.#e.map((n=>n.toJSON()))];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#a&&this.#t?.type==="!")&&t.push({}),t}isStart(){if(this.#n===this)return!0;if(!this.#t?.isStart())return!1;if(this.#s===0)return!0;const t=this.#t;for(let n=0;n<this.#s;n++){const r=t.#e[n];if(!(r instanceof mn&&r.type==="!"))return!1}return!0}isEnd(){if(this.#n===this||this.#t?.type==="!")return!0;if(!this.#t?.isEnd())return!1;if(!this.type)return this.#t?.isEnd();const t=this.#t?this.#t.#e.length:0;return this.#s===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const n=new mn(this.type,t);for(const r of this.#e)n.copyIn(r);return n}static#u(t,n,r,i){let o=!1,s=!1,a=-1,l=!1;if(n.type===null){let m=r,b="";for(;m<t.length;){const w=t.charAt(m++);if(o||w==="\\")o=!o,b+=w;else if(s)m===a+1?w!=="^"&&w!=="!"||(l=!0):w!=="]"||m===a+2&&l||(s=!1),b+=w;else if(w!=="[")if(i.noext||!$y(w)||t.charAt(m)!=="(")b+=w;else{n.push(b),b="";const S=new mn(w,n);m=mn.#u(t,S,m,i),n.push(S)}else s=!0,a=m,l=!1,b+=w}return n.push(b),m}let u=r+1,c=new mn(null,n);const d=[];let p="";for(;u<t.length;){const m=t.charAt(u++);if(o||m==="\\")o=!o,p+=m;else if(s)u===a+1?m!=="^"&&m!=="!"||(l=!0):m!=="]"||u===a+2&&l||(s=!1),p+=m;else if(m!=="[")if($y(m)&&t.charAt(u)==="("){c.push(p),p="";const b=new mn(m,c);c.push(b),u=mn.#u(t,b,u,i)}else if(m!=="|"){if(m===")")return p===""&&n.#e.length===0&&(n.#f=!0),c.push(p),p="",n.push(...d,c),u;p+=m}else c.push(p),p="",d.push(c),c=new mn(null,n);else s=!0,a=u,l=!1,p+=m}return n.type=null,n.#r=void 0,n.#e=[t.substring(r-1)],u}static fromGlob(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=new mn(null,void 0,n);return mn.#u(t,r,0,n),r}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();const t=this.toString(),[n,r,i,o]=this.toRegExpSource();if(!(i||this.#r||this.#i.nocase&&!this.#i.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;const s=(this.#i.nocase?"i":"")+(o?"u":"");return Object.assign(new RegExp(`^${n}$`,s),{_src:n,_glob:t})}get options(){return this.#i}toRegExpSource(t){const n=t??!!this.#i.dot;if(this.#n===this&&this.#p(),!this.type){const l=this.isStart()&&this.isEnd(),u=this.#e.map((p=>{const[m,b,w,S]=typeof p=="string"?mn.#h(p,this.#r,l):p.toRegExpSource(t);return this.#r=this.#r||w,this.#o=this.#o||S,m})).join("");let c="";if(this.isStart()&&typeof this.#e[0]=="string"&&(this.#e.length!==1||!gR.has(this.#e[0]))){const p=mR,m=n&&p.has(u.charAt(0))||u.startsWith("\\.")&&p.has(u.charAt(2))||u.startsWith("\\.\\.")&&p.has(u.charAt(4)),b=!n&&!t&&p.has(u.charAt(0));c=m?"(?!(?:^|/)\\.\\.?(?:$|/))":b?gf:""}let d="";return this.isEnd()&&this.#n.#a&&this.#t?.type==="!"&&(d="(?:$|\\/)"),[c+u+d,$o(u),this.#r=!!this.#r,this.#o]}const r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:";let o=this.#d(n);if(this.isStart()&&this.isEnd()&&!o&&this.type!=="!"){const l=this.toString();return this.#e=[l],this.type=null,this.#r=void 0,[l,$o(this.toString()),!1,!1]}let s=!r||t||n?"":this.#d(!0);s===o&&(s=""),s&&(o=`(?:${o})(?:${s})*?`);let a="";return a=this.type==="!"&&this.#f?(this.isStart()&&!n?gf:"")+By:i+o+(this.type==="!"?"))"+(!this.isStart()||n||t?"":gf)+My+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&s?")":this.type==="*"&&s?")?":`)${this.type}`),[a,$o(o),this.#r=!!this.#r,this.#o]}#d(t){return this.#e.map((n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");const[r,i,o,s]=n.toRegExpSource(t);return this.#o=this.#o||s,r})).filter((n=>!(this.isStart()&&this.isEnd()&&!n))).join("|")}static#h(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],i=!1,o="",s=!1;for(let a=0;a<t.length;a++){const l=t.charAt(a);if(i)i=!1,o+=(yR.has(l)?"\\":"")+l;else if(l!=="\\"){if(l==="["){const[u,c,d,p]=pR(t,a);if(d){o+=u,s=s||c,a+=d-1,n=n||p;continue}}l!=="*"?l!=="?"?o+=l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):(o+=yf,n=!0):(o+=r&&t==="*"?By:My,n=!0)}else a===t.length-1?o+="\\\\":i=!0}return[o,$o(t),!!n,s]}}const an=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return ca(t),!(!n.nocomment&&t.charAt(0)==="#")&&new ua(t,n).match(e)},vR=/^\*+([^+@!?\*\[\(]*)$/,bR=e=>t=>!t.startsWith(".")&&t.endsWith(e),wR=e=>t=>t.endsWith(e),SR=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),ER=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),TR=/^\*+\.\*+$/,AR=e=>!e.startsWith(".")&&e.includes("."),xR=e=>e!=="."&&e!==".."&&e.includes("."),CR=/^\.\*+$/,RR=e=>e!=="."&&e!==".."&&e.startsWith("."),kR=/^\*+$/,PR=e=>e.length!==0&&!e.startsWith("."),IR=e=>e.length!==0&&e!=="."&&e!=="..",OR=/^\?+([^+@!?\*\[\(]*)?$/,FR=e=>{let[t,n=""]=e;const r=jy([t]);return n?(n=n.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(n)):r},_R=e=>{let[t,n=""]=e;const r=Uy([t]);return n?(n=n.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(n)):r},DR=e=>{let[t,n=""]=e;const r=Uy([t]);return n?i=>r(i)&&i.endsWith(n):r},NR=e=>{let[t,n=""]=e;const r=jy([t]);return n?i=>r(i)&&i.endsWith(n):r},jy=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&!r.startsWith(".")},Uy=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&r!=="."&&r!==".."},Vy=typeof be=="object"&&be?typeof be.env=="object"&&be.env&&be.env.__MINIMATCH_TESTING_PLATFORM__||be.platform:"posix";an.sep=Vy==="win32"?"\\":"/";const $n=Symbol("globstar **");an.GLOBSTAR=$n,an.filter=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=>an(n,e,t)};const Mn=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},e,t)};an.defaults=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return an;const t=an;return Object.assign((function(n,r){return t(n,r,Mn(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}),{Minimatch:class extends t.Minimatch{constructor(n){super(n,Mn(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(n){return t.defaults(Mn(e,n)).Minimatch}},AST:class extends t.AST{constructor(n,r){super(n,r,Mn(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}static fromGlob(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.AST.fromGlob(n,Mn(e,r))}},unescape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(n,Mn(e,r))},escape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(n,Mn(e,r))},filter:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(n,Mn(e,r))},defaults:n=>t.defaults(Mn(e,n)),makeRe:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(n,Mn(e,r))},braceExpand:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(n,Mn(e,r))},match:function(n,r){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(n,r,Mn(e,i))},sep:t.sep,GLOBSTAR:$n})};const qy=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return ca(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:fR(e)};an.braceExpand=qy,an.makeRe=function(e){return new ua(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},an.match=function(e,t){const n=new ua(t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{});return e=e.filter((r=>n.match(r))),n.options.nonull&&!e.length&&e.push(t),e};const zy=/[?*]|[+@!]\(.*?\)|\[|\]/;class ua{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ca(t),n=n||{},this.options=n,this.pattern=t,this.platform=n.platform||Vy,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!(!this.isWindows||!this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const n of t)if(typeof n!="string")return!0;return!1}debug(){}make(){const t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#")return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=function(){return console.error(...arguments)}),this.debug(this.pattern,this.globSet);const r=this.globSet.map((o=>this.slashSplit(o)));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map(((o,s,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){const l=!(o[0]!==""||o[1]!==""||o[2]!=="?"&&zy.test(o[2])||zy.test(o[3])),u=/^[a-z]:/i.test(o[0]);if(l)return[...o.slice(0,4),...o.slice(4).map((c=>this.parse(c)))];if(u)return[o[0],...o.slice(1).map((c=>this.parse(c)))]}return o.map((l=>this.parse(l)))}));if(this.debug(this.pattern,i),this.set=i.filter((o=>o.indexOf(!1)===-1)),this.isWindows)for(let o=0;o<this.set.length;o++){const s=this.set[o];s[0]===""&&s[1]===""&&this.globParts[o][2]==="?"&&typeof s[3]=="string"&&/^[a-z]:$/i.test(s[3])&&(s[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let r=0;r<t.length;r++)for(let i=0;i<t[r].length;i++)t[r][i]==="**"&&(t[r][i]="*");const{optimizationLevel:n=1}=this.options;return n>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=n>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map((n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let i=r;for(;n[i+1]==="**";)i++;i!==r&&n.splice(r,i-r)}return n}))}levelOneOptimize(t){return t.map((n=>(n=n.reduce(((r,i)=>{const o=r[r.length-1];return i==="**"&&o==="**"?r:i===".."&&o&&o!==".."&&o!=="."&&o!=="**"?(r.pop(),r):(r.push(i),r)}),[])).length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){const o=t[i];i===1&&o===""&&t[0]===""||o!=="."&&o!==""||(n=!0,t.splice(i,1),i--)}t[0]!=="."||t.length!==2||t[1]!=="."&&t[1]!==""||(n=!0,t.pop())}let r=0;for(;(r=t.indexOf("..",r+1))!==-1;){const i=t[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(n=!0,t.splice(r-1,2),r-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let r of t){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let s=i;for(;r[s+1]==="**";)s++;s>i&&r.splice(i+1,s-i);let a=r[i+1];const l=r[i+2],u=r[i+3];if(a!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;n=!0,r.splice(i,1);const c=r.slice(0);c[i]="**",t.push(c),i--}if(!this.preserveMultipleSlashes){for(let s=1;s<r.length-1;s++){const a=r[s];s===1&&a===""&&r[0]===""||a!=="."&&a!==""||(n=!0,r.splice(s,1),s--)}r[0]!=="."||r.length!==2||r[1]!=="."&&r[1]!==""||(n=!0,r.pop())}let o=0;for(;(o=r.indexOf("..",o+1))!==-1;){const s=r[o-1];if(s&&s!=="."&&s!==".."&&s!=="**"){n=!0;const a=o===1&&r[o+1]==="**"?["."]:[];r.splice(o-1,2,...a),r.length===0&&r.push(""),o-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let r=n+1;r<t.length;r++){const i=this.partsMatch(t[n],t[r],!this.preserveMultipleSlashes);if(i){t[n]=[],t[r]=i;break}}return t.filter((n=>n.length))}partsMatch(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],i=0,o=0,s=[],a="";for(;i<t.length&&o<n.length;)if(t[i]===n[o])s.push(a==="b"?n[o]:t[i]),i++,o++;else if(r&&t[i]==="**"&&n[o]===t[i+1])s.push(t[i]),i++;else if(r&&n[o]==="**"&&t[i]===n[o+1])s.push(n[o]),o++;else if(t[i]!=="*"||!n[o]||!this.options.dot&&n[o].startsWith(".")||n[o]==="**"){if(n[o]!=="*"||!t[i]||!this.options.dot&&t[i].startsWith(".")||t[i]==="**"||a==="a")return!1;a="b",s.push(n[o]),i++,o++}else{if(a==="b")return!1;a="a",s.push(t[i]),i++,o++}return t.length===n.length&&s}parseNegate(){if(this.nonegate)return;const t=this.pattern;let n=!1,r=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)n=!n,r++;r&&(this.pattern=t.slice(r)),this.negate=n}matchOne(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const i=this.options;if(this.isWindows){const w=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),S=!w&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),y=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),g=S?3:w?0:void 0,v=!y&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])?3:y?0:void 0;if(typeof g=="number"&&typeof v=="number"){const[h,E]=[t[g],n[v]];h.toLowerCase()===E.toLowerCase()&&(n[v]=h,v>g?n=n.slice(v):g>v&&(t=t.slice(g)))}}const{optimizationLevel:o=1}=this.options;o>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:n}),this.debug("matchOne",t.length,n.length);for(var s=0,a=0,l=t.length,u=n.length;s<l&&a<u;s++,a++){this.debug("matchOne loop");var c=n[a],d=t[s];if(this.debug(n,c,d),c===!1)return!1;if(c===$n){this.debug("GLOBSTAR",[n,c,d]);var p=s,m=a+1;if(m===u){for(this.debug("** at the end");s<l;s++)if(t[s]==="."||t[s]===".."||!i.dot&&t[s].charAt(0)===".")return!1;return!0}for(;p<l;){var b=t[p];if(this.debug(`
33
- globstar while`,t,p,n,m,b),this.matchOne(t.slice(p),n.slice(m),r))return this.debug("globstar found match!",p,l,b),!0;if(b==="."||b===".."||!i.dot&&b.charAt(0)==="."){this.debug("dot detected!",t,p,n,m);break}this.debug("globstar swallow a segment, and continue"),p++}return!(!r||(this.debug(`
34
- >>> no match, partial?`,t,p,n,m),p!==l))}let w;if(typeof c=="string"?(w=d===c,this.debug("string match",c,d,w)):(w=c.test(d),this.debug("pattern match",c,d,w)),!w)return!1}if(s===l&&a===u)return!0;if(s===l)return r;if(a===u)return s===l-1&&t[s]==="";throw new Error("wtf?")}braceExpand(){return qy(this.pattern,this.options)}parse(t){ca(t);const n=this.options;if(t==="**")return $n;if(t==="")return"";let r,i=null;(r=t.match(kR))?i=n.dot?IR:PR:(r=t.match(vR))?i=(n.nocase?n.dot?ER:SR:n.dot?wR:bR)(r[1]):(r=t.match(OR))?i=(n.nocase?n.dot?_R:FR:n.dot?DR:NR)(r):(r=t.match(TR))?i=n.dot?xR:AR:(r=t.match(CR))&&(i=RR);const o=mn.fromGlob(t,this.options).toMMPattern();return i&&typeof o=="object"&&Reflect.defineProperty(o,"test",{value:i}),o}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const n=this.options,r=n.noglobstar?"[^/]*?":n.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",i=new Set(n.nocase?["i"]:[]);let o=t.map((l=>{const u=l.map((c=>{if(c instanceof RegExp)for(const d of c.flags.split(""))i.add(d);return typeof c=="string"?c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):c===$n?$n:c._src}));return u.forEach(((c,d)=>{const p=u[d+1],m=u[d-1];c===$n&&m!==$n&&(m===void 0?p!==void 0&&p!==$n?u[d+1]="(?:\\/|"+r+"\\/)?"+p:u[d]=r:p===void 0?u[d-1]=m+"(?:\\/|"+r+")?":p!==$n&&(u[d-1]=m+"(?:\\/|\\/"+r+"\\/)"+p,u[d+1]=$n))})),u.filter((c=>c!==$n)).join("/")})).join("|");const[s,a]=t.length>1?["(?:",")"]:["",""];o="^"+s+o+a+"$",this.negate&&(o="^(?!"+o+").+$");try{this.regexp=new RegExp(o,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.partial;if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;const r=this.options;this.isWindows&&(t=t.split("\\").join("/"));const i=this.slashSplit(t);this.debug(this.pattern,"split",i);const o=this.set;this.debug(this.pattern,"set",o);let s=i[i.length-1];if(!s)for(let a=i.length-2;!s&&a>=0;a--)s=i[a];for(let a=0;a<o.length;a++){const l=o[a];let u=i;if(r.matchBase&&l.length===1&&(u=[s]),this.matchOne(u,l,n))return!!r.flipNegate||!this.negate}return!r.flipNegate&&this.negate}static defaults(t){return an.defaults(t).Minimatch}}function vf(e){const t=new Error(`${arguments.length>1&&arguments[1]!==void 0?arguments[1]:""}Invalid response: ${e.status} ${e.statusText}`);return t.status=e.status,t.response=e,t}function Kt(e,t){const{status:n}=t;if(n===401&&e.digest)return t;if(n>=400)throw vf(t);return t}function ui(e,t){return arguments.length>2&&arguments[2]!==void 0&&arguments[2]?{data:t,headers:e.headers?aR(e.headers):{},status:e.status,statusText:e.statusText}:t}an.AST=mn,an.Minimatch=ua,an.escape=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")},an.unescape=$o;const LR=(Wy=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=Ht({url:Ft(e.remoteURL,Ot(t)),method:"COPY",headers:{Destination:Ft(e.remoteURL,Ot(n)),Overwrite:r.overwrite===!1?"F":"T",Depth:r.shallow?"0":"infinity"}},e,r);return s=function(a){Kt(e,a)},(o=Wt(i,e))&&o.then||(o=Promise.resolve(o)),s?o.then(s):o;var o,s},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(Wy.apply(this,e))}catch(n){return Promise.reject(n)}});var Wy,bf=mt(635),$R=mt(829),Rr=mt.n($R),zi=(function(e){return e.Array="array",e.Object="object",e.Original="original",e})(zi||{});function fa(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:zi.Original;const r=Rr().get(e,t);return n==="array"&&Array.isArray(r)===!1?[r]:n==="object"&&Array.isArray(r)?r[0]:r}function Mo(e){return new Promise((t=>{t((function(n){const{multistatus:r}=n;if(r==="")return{multistatus:{response:[]}};if(!r)throw new Error("Invalid response: No root multistatus found");const i={multistatus:Array.isArray(r)?r[0]:r};return Rr().set(i,"multistatus.response",fa(i,"multistatus.response",zi.Array)),Rr().set(i,"multistatus.response",Rr().get(i,"multistatus.response").map((o=>(function(s){const a=Object.assign({},s);return a.status?Rr().set(a,"status",fa(a,"status",zi.Object)):(Rr().set(a,"propstat",fa(a,"propstat",zi.Object)),Rr().set(a,"propstat.prop",fa(a,"propstat.prop",zi.Object))),a})(o)))),i})(new bf.XMLParser({allowBooleanAttributes:!0,attributeNamePrefix:"",textNodeName:"text",ignoreAttributes:!1,removeNSPrefix:!0,numberParseOptions:{hex:!0,leadingZeros:!1},attributeValueProcessor:(n,r,i)=>r==="true"||r==="false"?r==="true":r,tagValueProcessor(n,r,i){if(!i.endsWith("propstat.prop.displayname"))return r}}).parse(e)))}))}function da(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const{getlastmodified:r=null,getcontentlength:i="0",resourcetype:o=null,getcontenttype:s=null,getetag:a=null}=e,l=o&&typeof o=="object"&&o.collection!==void 0?"directory":"file",u={filename:t,basename:oa().basename(t),lastmod:r,size:parseInt(i,10),type:l,etag:typeof a=="string"?a.replace(/"/g,""):null};return l==="file"&&(u.mime=s&&typeof s=="string"?s.split(";")[0]:""),n&&(e.displayname!==void 0&&(e.displayname=String(e.displayname)),u.props=e),u}function Hy(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=null;try{e.multistatus.response[0].propstat&&(r=e.multistatus.response[0])}catch{}if(!r)throw new Error("Failed getting item stat: bad response");const{propstat:{prop:i,status:o}}=r,[s,a,l]=o.split(" ",3),u=parseInt(a,10);if(u>=400){const c=new Error(`Invalid response: ${u} ${l}`);throw c.status=u,c}return da(i,Do(t),n)}function Ky(e){switch(String(e)){case"-3":return"unlimited";case"-2":case"-1":return"unknown";default:return parseInt(String(e),10)}}function wf(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const Sf=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{details:r=!1}=n,i=Ht({url:Ft(e.remoteURL,Ot(t)),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,n);return wf(Wt(i,e),(function(o){return Kt(e,o),wf(o.text(),(function(s){return wf(Mo(s),(function(a){const l=Hy(a,t,r);return ui(o,l,r)}))}))}))}));function Gy(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const MR=Qy((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=(function(o){if(!o||o==="/")return[];let s=o;const a=[];do a.push(s),s=oa().dirname(s);while(s&&s!=="/");return a})(Do(t));r.sort(((o,s)=>o.length>s.length?1:s.length>o.length?-1:0));let i=!1;return(function(o,s,a){if(typeof o[Yy]=="function"){let w=function(S){try{for(;!(l=d.next()).done;)if((S=s(l.value))&&S.then){if(!Jy(S))return void S.then(w,c||(c=gn.bind(null,u=new Wi,2)));S=S.v}u?gn(u,1,S):u=S}catch(y){gn(u||(u=new Wi),2,y)}};var l,u,c,d=o[Yy]();if(w(),d.return){var p=function(S){try{l.done||d.return()}catch{}return S};if(u&&u.then)return u.then(p,(function(S){throw p(S)}));p()}return u}if(!("length"in o))throw new TypeError("Object is not iterable");for(var m=[],b=0;b<o.length;b++)m.push(o[b]);return(function(w,S,y){var g,v,h=-1;return(function E(T){try{for(;++h<w.length&&(!y||!y());)if((T=S(h))&&T.then){if(!Jy(T))return void T.then(E,v||(v=gn.bind(null,g=new Wi,2)));T=T.v}g?gn(g,1,T):g=T}catch(R){gn(g||(g=new Wi),2,R)}})(),g})(m,(function(w){return s(m[w])}),a)})(r,(function(o){return s=function(){return(function(l,u){try{var c=Gy(Sf(e,o),(function(d){if(d.type!=="directory")throw new Error(`Path includes a file: ${t}`)}))}catch(d){return u(d)}return c&&c.then?c.then(void 0,u):c})(0,(function(l){const u=l;return(function(){if(u.status===404)return i=!0,Xy(Ef(e,o,{...n,recursive:!1}));throw l})()}))},(a=(function(){if(i)return Xy(Ef(e,o,{...n,recursive:!1}))})())&&a.then?a.then(s):s();var s,a}),(function(){return!1}))}));function Qy(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}function BR(){}function Xy(e,t){return e&&e.then?e.then(BR):Promise.resolve()}const Yy=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function gn(e,t,n){if(!e.s){if(n instanceof Wi){if(!n.s)return void(n.o=gn.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(gn.bind(null,e,t),gn.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}const Wi=(function(){function e(){}return e.prototype.then=function(t,n){const r=new e,i=this.s;if(i){const o=1&i?t:n;if(o){try{gn(r,1,o(this.v))}catch(s){gn(r,2,s)}return r}return this}return this.o=function(o){try{const s=o.v;1&o.s?gn(r,1,t?t(s):s):n?gn(r,1,n(s)):gn(r,2,s)}catch(s){gn(r,2,s)}},r},e})();function Jy(e){return e instanceof Wi&&1&e.s}const Ef=Qy((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(n.recursive===!0)return MR(e,t,n);const r=Ht({url:Ft(e.remoteURL,(i=Ot(t),i.endsWith("/")?i:i+"/")),method:"MKCOL"},e,n);var i;return Gy(Wt(r,e),(function(o){Kt(e,o)}))}));var jR=mt(388),Zy=mt.n(jR);const UR=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r={};if(typeof n.range=="object"&&typeof n.range.start=="number"){let a=`bytes=${n.range.start}-`;typeof n.range.end=="number"&&(a=`${a}${n.range.end}`),r.Range=a}const i=Ht({url:Ft(e.remoteURL,Ot(t)),method:"GET",headers:r},e,n);return s=function(a){if(Kt(e,a),r.Range&&a.status!==206){const l=new Error(`Invalid response code for partial request: ${a.status}`);throw l.status=a.status,l}return n.callback&&setTimeout((()=>{n.callback(a)}),0),a.body},(o=Wt(i,e))&&o.then||(o=Promise.resolve(o)),s?o.then(s):o;var o,s})),VR=()=>{},qR=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t,n){n.url||(n.url=Ft(e.remoteURL,Ot(t)));const r=Ht(n,e,{});return o=function(s){return Kt(e,s),s},(i=Wt(r,e))&&i.then||(i=Promise.resolve(i)),o?i.then(o):i;var i,o})),zR=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Ht({url:Ft(e.remoteURL,Ot(t)),method:"DELETE"},e,n);return o=function(s){Kt(e,s)},(i=Wt(r,e))&&i.then||(i=Promise.resolve(i)),o?i.then(o):i;var i,o})),WR=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return(function(r,i){try{var o=(s=Sf(e,t,n),a=function(){return!0},l?a?a(s):s:(s&&s.then||(s=Promise.resolve(s)),a?s.then(a):s))}catch(u){return i(u)}var s,a,l;return o&&o.then?o.then(void 0,i):o})(0,(function(r){if(r.status===404)return!1;throw r}))}));function Tf(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const HR=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Ht({url:Ft(e.remoteURL,Ot(t),"/"),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:n.deep?"infinity":"1"}},e,n);return Tf(Wt(r,e),(function(i){return Kt(e,i),Tf(i.text(),(function(o){if(!o)throw new Error("Failed parsing directory contents: Empty response");return Tf(Mo(o),(function(s){const a=Ey(t);let l=(function(u,c,d){let p=arguments.length>3&&arguments[3]!==void 0&&arguments[3],m=arguments.length>4&&arguments[4]!==void 0&&arguments[4];const b=oa().join(c,"/"),{multistatus:{response:w}}=u,S=w.map((y=>{const g=(function(h){try{return h.replace(/^https?:\/\/[^\/]+/,"")}catch(E){throw new pn(E,"Failed normalising HREF")}})(y.href),{propstat:{prop:v}}=y;return da(v,b==="/"?decodeURIComponent(Do(g)):Do(oa().relative(decodeURIComponent(b),decodeURIComponent(g))),p)}));return m?S:S.filter((y=>y.basename&&(y.type==="file"||y.filename!==d.replace(/\/$/,""))))})(s,Ey(e.remoteBasePath||e.remotePath),a,n.details,n.includeSelf);return n.glob&&(l=(function(u,c){return u.filter((d=>an(d.filename,c,{matchBase:!0})))})(l,n.glob)),ui(i,l,n.details)}))}))}))}));function Af(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}const KR=Af((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Ht({url:Ft(e.remoteURL,Ot(t)),method:"GET",headers:{Accept:"text/plain"},transformResponse:[XR]},e,n);return pa(Wt(r,e),(function(i){return Kt(e,i),pa(i.text(),(function(o){return ui(i,o,n.details)}))}))}));function pa(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const GR=Af((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Ht({url:Ft(e.remoteURL,Ot(t)),method:"GET"},e,n);return pa(Wt(r,e),(function(i){let o;return Kt(e,i),(function(s,a){var l=s();return l&&l.then?l.then(a):a()})((function(){return pa(i.arrayBuffer(),(function(s){o=s}))}),(function(){return ui(i,o,n.details)}))}))})),QR=Af((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{format:r="binary"}=n;if(r!=="binary"&&r!=="text")throw new pn({info:{code:Cr.InvalidOutputFormat}},`Invalid output format: ${r}`);return r==="text"?KR(e,t,n):GR(e,t,n)})),XR=e=>e;function YR(e){return new bf.XMLBuilder({attributeNamePrefix:"@_",format:!0,ignoreAttributes:!1,suppressEmptyNode:!0}).build(ev({lockinfo:{"@_xmlns:d":"DAV:",lockscope:{exclusive:{}},locktype:{write:{}},owner:{href:e}}},"d"))}function ev(e,t){const n={...e};for(const r in n)n.hasOwnProperty(r)&&(n[r]&&typeof n[r]=="object"&&r.indexOf(":")===-1?(n[`${t}:${r}`]=ev(n[r],t),delete n[r]):/^@_/.test(r)===!1&&(n[`${t}:${r}`]=n[r],delete n[r]));return n}function xf(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function tv(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}const JR=tv((function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=Ht({url:Ft(e.remoteURL,Ot(t)),method:"UNLOCK",headers:{"Lock-Token":n}},e,r);return xf(Wt(i,e),(function(o){if(Kt(e,o),o.status!==204&&o.status!==200)throw vf(o)}))})),ZR=tv((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{refreshToken:r,timeout:i=ek}=n,o={Accept:"text/plain,application/xml",Timeout:i};r&&(o.If=r);const s=Ht({url:Ft(e.remoteURL,Ot(t)),method:"LOCK",headers:o,data:YR(e.contactHref)},e,n);return xf(Wt(s,e),(function(a){return Kt(e,a),xf(a.text(),(function(l){const u=(p=l,new bf.XMLParser({removeNSPrefix:!0,parseAttributeValue:!0,parseTagValue:!0}).parse(p)),c=Rr().get(u,"prop.lockdiscovery.activelock.locktoken.href"),d=Rr().get(u,"prop.lockdiscovery.activelock.timeout");var p;if(!c)throw vf(a,"No lock token received: ");return{token:c,serverTimeout:d}}))}))})),ek="Infinite, Second-4100000000";function Cf(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const tk=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=t.path||"/",r=Ht({url:Ft(e.remoteURL,n),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,t);return Cf(Wt(r,e),(function(i){return Kt(e,i),Cf(i.text(),(function(o){return Cf(Mo(o),(function(s){const a=(function(l){try{const[u]=l.multistatus.response,{propstat:{prop:{"quota-used-bytes":c,"quota-available-bytes":d}}}=u;return c!==void 0&&d!==void 0?{used:parseInt(String(c),10),available:Ky(d)}:null}catch{}return null})(s);return ui(i,a,t.details)}))}))}))}));function Rf(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const nk=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{details:r=!1}=n,i=Ht({url:Ft(e.remoteURL,Ot(t)),method:"SEARCH",headers:{Accept:"text/plain,application/xml","Content-Type":e.headers["Content-Type"]||"application/xml; charset=utf-8"}},e,n);return Rf(Wt(i,e),(function(o){return Kt(e,o),Rf(o.text(),(function(s){return Rf(Mo(s),(function(a){const l=(function(u,c,d){const p={truncated:!1,results:[]};return p.truncated=u.multistatus.response.some((m=>(m.status||m.propstat?.status).split(" ",3)?.[1]==="507"&&m.href.replace(/\/$/,"").endsWith(Ot(c).replace(/\/$/,"")))),u.multistatus.response.forEach((m=>{if(m.propstat===void 0)return;const b=m.href.split("/").map(decodeURIComponent).join("/");p.results.push(da(m.propstat.prop,b,d))})),p})(a,t,r);return ui(o,l,r)}))}))}))})),rk=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=Ht({url:Ft(e.remoteURL,Ot(t)),method:"MOVE",headers:{Destination:Ft(e.remoteURL,Ot(n)),Overwrite:r.overwrite===!1?"F":"T"}},e,r);return s=function(a){Kt(e,a)},(o=Wt(i,e))&&o.then||(o=Promise.resolve(o)),s?o.then(s):o;var o,s}));var ik=mt(172);const ok=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const{contentLength:i=!0,overwrite:o=!0}=r,s={"Content-Type":"application/octet-stream"};i===!1||(s["Content-Length"]=typeof i=="number"?`${i}`:`${(function(c){if(_y(c))return c.byteLength;if(Dy(c))return c.length;if(typeof c=="string")return(0,ik.d)(c);throw new pn({info:{code:Cr.DataTypeNoLength}},"Cannot calculate data length: Invalid type")})(n)}`),o||(s["If-None-Match"]="*");const a=Ht({url:Ft(e.remoteURL,Ot(t)),method:"PUT",headers:s,data:n},e,r);return u=function(c){try{Kt(e,c)}catch(d){const p=d;if(p.status!==412||o)throw p;return!1}return!0},(l=Wt(a,e))&&l.then||(l=Promise.resolve(l)),u?l.then(u):l;var l,u})),nv=(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}})((function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Ht({url:Ft(e.remoteURL,Ot(t)),method:"OPTIONS"},e,n);return o=function(s){try{Kt(e,s)}catch(a){throw a}return{compliance:(s.headers.get("DAV")??"").split(",").map((a=>a.trim())),server:s.headers.get("Server")??""}},(i=Wt(r,e))&&i.then||(i=Promise.resolve(i)),o?i.then(o):i;var i,o}));function Bo(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const sk=kf((function(e,t,n,r,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>r||n<0)throw new pn({info:{code:Cr.InvalidUpdateRange}},`Invalid update range ${n} for partial update`);const s={"Content-Type":"application/octet-stream","Content-Length":""+(r-n+1),"Content-Range":`bytes ${n}-${r}/*`},a=Ht({url:Ft(e.remoteURL,Ot(t)),method:"PUT",headers:s,data:i},e,o);return Bo(Wt(a,e),(function(l){Kt(e,l)}))}));function rv(e,t){var n=e();return n&&n.then?n.then(t):t(n)}const ak=kf((function(e,t,n,r,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>r||n<0)throw new pn({info:{code:Cr.InvalidUpdateRange}},`Invalid update range ${n} for partial update`);const s={"Content-Type":"application/x-sabredav-partialupdate","Content-Length":""+(r-n+1),"X-Update-Range":`bytes=${n}-${r}`},a=Ht({url:Ft(e.remoteURL,Ot(t)),method:"PATCH",headers:s,data:i},e,o);return Bo(Wt(a,e),(function(l){Kt(e,l)}))}));function kf(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(r){return Promise.reject(r)}}}const lk=kf((function(e,t,n,r,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};return Bo(nv(e,t,o),(function(s){let a=!1;return rv((function(){if(s.compliance.includes("sabredav-partialupdate"))return Bo(ak(e,t,n,r,i,o),(function(l){return a=!0,l}))}),(function(l){let u=!1;return a?l:rv((function(){if(s.server.includes("Apache")&&s.compliance.includes("<http://apache.org/dav/propset/fs/1>"))return Bo(sk(e,t,n,r,i,o),(function(c){return u=!0,c}))}),(function(c){if(u)return c;throw new pn({info:{code:Cr.NotSupported}},"Not supported")}))}))}))})),ck="https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";function uk(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{authType:n=null,remoteBasePath:r,contactHref:i=ck,ha1:o,headers:s={},httpAgent:a,httpsAgent:l,password:u,token:c,username:d,withCredentials:p}=t;let m=n;m||(m=d||u?hn.Password:hn.None);const b={authType:m,remoteBasePath:r,contactHref:i,ha1:o,headers:Object.assign({},s),httpAgent:a,httpsAgent:l,password:u,remotePath:JC(e),remoteURL:e,token:c,username:d,withCredentials:p};return ky(b,d,u,c,o),{copyFile:(w,S,y)=>LR(b,w,S,y),createDirectory:(w,S)=>Ef(b,w,S),createReadStream:(w,S)=>(function(y,g){let v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const h=new(Zy()).PassThrough;return UR(y,g,v).then((E=>{E.pipe(h)})).catch((E=>{h.emit("error",E)})),h})(b,w,S),createWriteStream:(w,S,y)=>(function(g,v){let h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:VR;const T=new(Zy()).PassThrough,R={};h.overwrite===!1&&(R["If-None-Match"]="*");const C=Ht({url:Ft(g.remoteURL,Ot(v)),method:"PUT",headers:R,data:T,maxRedirects:0},g,h);return Wt(C,g).then((A=>Kt(g,A))).then((A=>{setTimeout((()=>{E(A)}),0)})).catch((A=>{T.emit("error",A)})),T})(b,w,S,y),customRequest:(w,S)=>qR(b,w,S),deleteFile:(w,S)=>zR(b,w,S),exists:(w,S)=>WR(b,w,S),getDirectoryContents:(w,S)=>HR(b,w,S),getFileContents:(w,S)=>QR(b,w,S),getFileDownloadLink:w=>(function(S,y){let g=Ft(S.remoteURL,Ot(y));const v=/^https:/i.test(g)?"https":"http";switch(S.authType){case hn.None:break;case hn.Password:{const h=Cy(S.headers.Authorization.replace(/^Basic /i,"").trim());g=g.replace(/^https?:\/\//,`${v}://${h}@`);break}default:throw new pn({info:{code:Cr.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${S.authType}`)}return g})(b,w),getFileUploadLink:w=>(function(S,y){let g=`${Ft(S.remoteURL,Ot(y))}?Content-Type=application/octet-stream`;const v=/^https:/i.test(g)?"https":"http";switch(S.authType){case hn.None:break;case hn.Password:{const h=Cy(S.headers.Authorization.replace(/^Basic /i,"").trim());g=g.replace(/^https?:\/\//,`${v}://${h}@`);break}default:throw new pn({info:{code:Cr.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${S.authType}`)}return g})(b,w),getHeaders:()=>Object.assign({},b.headers),getQuota:w=>tk(b,w),lock:(w,S)=>ZR(b,w,S),moveFile:(w,S,y)=>rk(b,w,S,y),putFileContents:(w,S,y)=>ok(b,w,S,y),partialUpdateFileContents:(w,S,y,g,v)=>lk(b,w,S,y,g,v),getDAVCompliance:w=>nv(b,w),search:(w,S)=>nk(b,w,S),setHeaders:w=>{b.headers=Object.assign({},w)},stat:(w,S)=>Sf(b,w,S),unlock:(w,S,y)=>JR(b,w,S,y)}}Ln.hT,Ln.O4,Ln.Kd,Ln.YK,Ln.UU,Ln.Gu,Ln.ky,Ln.h4,Ln.ch,Ln.hq,Ln.i5;var Pf={},If={},iv;function Of(){return iv||(iv=1,(function(e){const t=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n=t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",r="["+t+"]["+n+"]*",i=new RegExp("^"+r+"$"),o=function(a,l){const u=[];let c=l.exec(a);for(;c;){const d=[];d.startIndex=l.lastIndex-c[0].length;const p=c.length;for(let m=0;m<p;m++)d.push(c[m]);u.push(d),c=l.exec(a)}return u},s=function(a){const l=i.exec(a);return!(l===null||typeof l>"u")};e.isExist=function(a){return typeof a<"u"},e.isEmptyObject=function(a){return Object.keys(a).length===0},e.merge=function(a,l,u){if(l){const c=Object.keys(l),d=c.length;for(let p=0;p<d;p++)u==="strict"?a[c[p]]=[l[c[p]]]:a[c[p]]=l[c[p]]}},e.getValue=function(a){return e.isExist(a)?a:""},e.isName=s,e.getAllMatches=o,e.nameRegexp=r})(If)),If}var ov;function sv(){if(ov)return Pf;ov=1;const e=Of(),t={allowBooleanAttributes:!1,unpairedTags:[]};Pf.validate=function(y,g){g=Object.assign({},t,g);const v=[];let h=!1,E=!1;y[0]==="\uFEFF"&&(y=y.substr(1));for(let T=0;T<y.length;T++)if(y[T]==="<"&&y[T+1]==="?"){if(T+=2,T=r(y,T),T.err)return T}else if(y[T]==="<"){let R=T;if(T++,y[T]==="!"){T=i(y,T);continue}else{let C=!1;y[T]==="/"&&(C=!0,T++);let A="";for(;T<y.length&&y[T]!==">"&&y[T]!==" "&&y[T]!==" "&&y[T]!==`
35
- `&&y[T]!=="\r";T++)A+=y[T];if(A=A.trim(),A[A.length-1]==="/"&&(A=A.substring(0,A.length-1),T--),!b(A)){let O;return A.trim().length===0?O="Invalid space after '<'.":O="Tag '"+A+"' is an invalid name.",p("InvalidTag",O,w(y,T))}const D=a(y,T);if(D===!1)return p("InvalidAttr","Attributes for '"+A+"' have open quote.",w(y,T));let V=D.value;if(T=D.index,V[V.length-1]==="/"){const O=T-V.length;V=V.substring(0,V.length-1);const N=u(V,g);if(N===!0)h=!0;else return p(N.err.code,N.err.msg,w(y,O+N.err.line))}else if(C)if(D.tagClosed){if(V.trim().length>0)return p("InvalidTag","Closing tag '"+A+"' can't have attributes or invalid starting.",w(y,R));if(v.length===0)return p("InvalidTag","Closing tag '"+A+"' has not been opened.",w(y,R));{const O=v.pop();if(A!==O.tagName){let N=w(y,O.tagStartPos);return p("InvalidTag","Expected closing tag '"+O.tagName+"' (opened in line "+N.line+", col "+N.col+") instead of closing tag '"+A+"'.",w(y,R))}v.length==0&&(E=!0)}}else return p("InvalidTag","Closing tag '"+A+"' doesn't have proper closing.",w(y,T));else{const O=u(V,g);if(O!==!0)return p(O.err.code,O.err.msg,w(y,T-V.length+O.err.line));if(E===!0)return p("InvalidXml","Multiple possible root nodes found.",w(y,T));g.unpairedTags.indexOf(A)!==-1||v.push({tagName:A,tagStartPos:R}),h=!0}for(T++;T<y.length;T++)if(y[T]==="<")if(y[T+1]==="!"){T++,T=i(y,T);continue}else if(y[T+1]==="?"){if(T=r(y,++T),T.err)return T}else break;else if(y[T]==="&"){const O=d(y,T);if(O==-1)return p("InvalidChar","char '&' is not expected.",w(y,T));T=O}else if(E===!0&&!n(y[T]))return p("InvalidXml","Extra text at the end",w(y,T));y[T]==="<"&&T--}}else{if(n(y[T]))continue;return p("InvalidChar","char '"+y[T]+"' is not expected.",w(y,T))}if(h){if(v.length==1)return p("InvalidTag","Unclosed tag '"+v[0].tagName+"'.",w(y,v[0].tagStartPos));if(v.length>0)return p("InvalidXml","Invalid '"+JSON.stringify(v.map(T=>T.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return p("InvalidXml","Start tag expected.",1);return!0};function n(y){return y===" "||y===" "||y===`
36
- `||y==="\r"}function r(y,g){const v=g;for(;g<y.length;g++)if(y[g]=="?"||y[g]==" "){const h=y.substr(v,g-v);if(g>5&&h==="xml")return p("InvalidXml","XML declaration allowed only at the start of the document.",w(y,g));if(y[g]=="?"&&y[g+1]==">"){g++;break}else continue}return g}function i(y,g){if(y.length>g+5&&y[g+1]==="-"&&y[g+2]==="-"){for(g+=3;g<y.length;g++)if(y[g]==="-"&&y[g+1]==="-"&&y[g+2]===">"){g+=2;break}}else if(y.length>g+8&&y[g+1]==="D"&&y[g+2]==="O"&&y[g+3]==="C"&&y[g+4]==="T"&&y[g+5]==="Y"&&y[g+6]==="P"&&y[g+7]==="E"){let v=1;for(g+=8;g<y.length;g++)if(y[g]==="<")v++;else if(y[g]===">"&&(v--,v===0))break}else if(y.length>g+9&&y[g+1]==="["&&y[g+2]==="C"&&y[g+3]==="D"&&y[g+4]==="A"&&y[g+5]==="T"&&y[g+6]==="A"&&y[g+7]==="["){for(g+=8;g<y.length;g++)if(y[g]==="]"&&y[g+1]==="]"&&y[g+2]===">"){g+=2;break}}return g}const o='"',s="'";function a(y,g){let v="",h="",E=!1;for(;g<y.length;g++){if(y[g]===o||y[g]===s)h===""?h=y[g]:h!==y[g]||(h="");else if(y[g]===">"&&h===""){E=!0;break}v+=y[g]}return h!==""?!1:{value:v,index:g,tagClosed:E}}const l=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function u(y,g){const v=e.getAllMatches(y,l),h={};for(let E=0;E<v.length;E++){if(v[E][1].length===0)return p("InvalidAttr","Attribute '"+v[E][2]+"' has no space in starting.",S(v[E]));if(v[E][3]!==void 0&&v[E][4]===void 0)return p("InvalidAttr","Attribute '"+v[E][2]+"' is without value.",S(v[E]));if(v[E][3]===void 0&&!g.allowBooleanAttributes)return p("InvalidAttr","boolean attribute '"+v[E][2]+"' is not allowed.",S(v[E]));const T=v[E][2];if(!m(T))return p("InvalidAttr","Attribute '"+T+"' is an invalid name.",S(v[E]));if(!h.hasOwnProperty(T))h[T]=1;else return p("InvalidAttr","Attribute '"+T+"' is repeated.",S(v[E]))}return!0}function c(y,g){let v=/\d/;for(y[g]==="x"&&(g++,v=/[\da-fA-F]/);g<y.length;g++){if(y[g]===";")return g;if(!y[g].match(v))break}return-1}function d(y,g){if(g++,y[g]===";")return-1;if(y[g]==="#")return g++,c(y,g);let v=0;for(;g<y.length;g++,v++)if(!(y[g].match(/\w/)&&v<20)){if(y[g]===";")break;return-1}return g}function p(y,g,v){return{err:{code:y,msg:g,line:v.line||v,col:v.col}}}function m(y){return e.isName(y)}function b(y){return e.isName(y)}function w(y,g){const v=y.substring(0,g).split(/\r?\n/);return{line:v.length,col:v[v.length-1].length+1}}function S(y){return y.startIndex+y[1].length}return Pf}var ha={},av;function fk(){if(av)return ha;av=1;const e={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(n,r){return r},attributeValueProcessor:function(n,r){return r},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(n,r,i){return n}},t=function(n){return Object.assign({},e,n)};return ha.buildOptions=t,ha.defaultOptions=e,ha}var Ff,lv;function dk(){if(lv)return Ff;lv=1;class e{constructor(n){this.tagname=n,this.child=[],this[":@"]={}}add(n,r){n==="__proto__"&&(n="#__proto__"),this.child.push({[n]:r})}addChild(n){n.tagname==="__proto__"&&(n.tagname="#__proto__"),n[":@"]&&Object.keys(n[":@"]).length>0?this.child.push({[n.tagname]:n.child,":@":n[":@"]}):this.child.push({[n.tagname]:n.child})}}return Ff=e,Ff}var _f,cv;function pk(){if(cv)return _f;cv=1;const e=Of();function t(u,c){const d={};if(u[c+3]==="O"&&u[c+4]==="C"&&u[c+5]==="T"&&u[c+6]==="Y"&&u[c+7]==="P"&&u[c+8]==="E"){c=c+9;let p=1,m=!1,b=!1,w="";for(;c<u.length;c++)if(u[c]==="<"&&!b){if(m&&i(u,c)){c+=7;let S,y;[S,y,c]=n(u,c+1),y.indexOf("&")===-1&&(d[l(S)]={regx:RegExp(`&${S};`,"g"),val:y})}else if(m&&o(u,c))c+=8;else if(m&&s(u,c))c+=8;else if(m&&a(u,c))c+=9;else if(r)b=!0;else throw new Error("Invalid DOCTYPE");p++,w=""}else if(u[c]===">"){if(b?u[c-1]==="-"&&u[c-2]==="-"&&(b=!1,p--):p--,p===0)break}else u[c]==="["?m=!0:w+=u[c];if(p!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:d,i:c}}function n(u,c){let d="";for(;c<u.length&&u[c]!=="'"&&u[c]!=='"';c++)d+=u[c];if(d=d.trim(),d.indexOf(" ")!==-1)throw new Error("External entites are not supported");const p=u[c++];let m="";for(;c<u.length&&u[c]!==p;c++)m+=u[c];return[d,m,c]}function r(u,c){return u[c+1]==="!"&&u[c+2]==="-"&&u[c+3]==="-"}function i(u,c){return u[c+1]==="!"&&u[c+2]==="E"&&u[c+3]==="N"&&u[c+4]==="T"&&u[c+5]==="I"&&u[c+6]==="T"&&u[c+7]==="Y"}function o(u,c){return u[c+1]==="!"&&u[c+2]==="E"&&u[c+3]==="L"&&u[c+4]==="E"&&u[c+5]==="M"&&u[c+6]==="E"&&u[c+7]==="N"&&u[c+8]==="T"}function s(u,c){return u[c+1]==="!"&&u[c+2]==="A"&&u[c+3]==="T"&&u[c+4]==="T"&&u[c+5]==="L"&&u[c+6]==="I"&&u[c+7]==="S"&&u[c+8]==="T"}function a(u,c){return u[c+1]==="!"&&u[c+2]==="N"&&u[c+3]==="O"&&u[c+4]==="T"&&u[c+5]==="A"&&u[c+6]==="T"&&u[c+7]==="I"&&u[c+8]==="O"&&u[c+9]==="N"}function l(u){if(e.isName(u))return u;throw new Error(`Invalid entity name ${u}`)}return _f=t,_f}var Df,uv;function hk(){if(uv)return Df;uv=1;const e=/^[-+]?0x[a-fA-F0-9]+$/,t=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,n={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function r(s,a={}){if(a=Object.assign({},n,a),!s||typeof s!="string")return s;let l=s.trim();if(a.skipLike!==void 0&&a.skipLike.test(l))return s;if(s==="0")return 0;if(a.hex&&e.test(l))return o(l,16);if(l.search(/[eE]/)!==-1){const u=l.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);if(u){if(a.leadingZeros)l=(u[1]||"")+u[3];else if(!(u[2]==="0"&&u[3][0]==="."))return s;return a.eNotation?Number(l):s}else return s}else{const u=t.exec(l);if(u){const c=u[1],d=u[2];let p=i(u[3]);if(!a.leadingZeros&&d.length>0&&c&&l[2]!==".")return s;if(!a.leadingZeros&&d.length>0&&!c&&l[1]!==".")return s;if(a.leadingZeros&&d===s)return 0;{const m=Number(l),b=""+m;return b.search(/[eE]/)!==-1?a.eNotation?m:s:l.indexOf(".")!==-1?b==="0"&&p===""||b===p||c&&b==="-"+p?m:s:d?p===b||c+p===b?m:s:l===b||l===c+b?m:s}}else return s}}function i(s){return s&&s.indexOf(".")!==-1&&(s=s.replace(/0+$/,""),s==="."?s="0":s[0]==="."?s="0"+s:s[s.length-1]==="."&&(s=s.substr(0,s.length-1))),s}function o(s,a){if(parseInt)return parseInt(s,a);if(Number.parseInt)return Number.parseInt(s,a);if(window&&window.parseInt)return window.parseInt(s,a);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}return Df=r,Df}var Nf,fv;function dv(){if(fv)return Nf;fv=1;function e(t){return typeof t=="function"?t:Array.isArray(t)?n=>{for(const r of t)if(typeof r=="string"&&n===r||r instanceof RegExp&&r.test(n))return!0}:()=>!1}return Nf=e,Nf}var Lf,pv;function mk(){if(pv)return Lf;pv=1;const e=Of(),t=dk(),n=pk(),r=hk(),i=dv();class o{constructor(T){this.options=T,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(R,C)=>String.fromCharCode(Number.parseInt(C,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(R,C)=>String.fromCharCode(Number.parseInt(C,16))}},this.addExternalEntities=s,this.parseXml=d,this.parseTextData=a,this.resolveNameSpace=l,this.buildAttributesMap=c,this.isItStopNode=w,this.replaceEntitiesValue=m,this.readStopNodeData=v,this.saveTextToParentTag=b,this.addChild=p,this.ignoreAttributesFn=i(this.options.ignoreAttributes)}}function s(E){const T=Object.keys(E);for(let R=0;R<T.length;R++){const C=T[R];this.lastEntities[C]={regex:new RegExp("&"+C+";","g"),val:E[C]}}}function a(E,T,R,C,A,D,V){if(E!==void 0&&(this.options.trimValues&&!C&&(E=E.trim()),E.length>0)){V||(E=this.replaceEntitiesValue(E));const O=this.options.tagValueProcessor(T,E,R,A,D);return O==null?E:typeof O!=typeof E||O!==E?O:this.options.trimValues?h(E,this.options.parseTagValue,this.options.numberParseOptions):E.trim()===E?h(E,this.options.parseTagValue,this.options.numberParseOptions):E}}function l(E){if(this.options.removeNSPrefix){const T=E.split(":"),R=E.charAt(0)==="/"?"/":"";if(T[0]==="xmlns")return"";T.length===2&&(E=R+T[1])}return E}const u=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function c(E,T,R){if(this.options.ignoreAttributes!==!0&&typeof E=="string"){const C=e.getAllMatches(E,u),A=C.length,D={};for(let V=0;V<A;V++){const O=this.resolveNameSpace(C[V][1]);if(this.ignoreAttributesFn(O,T))continue;let N=C[V][4],W=this.options.attributeNamePrefix+O;if(O.length)if(this.options.transformAttributeName&&(W=this.options.transformAttributeName(W)),W==="__proto__"&&(W="#__proto__"),N!==void 0){this.options.trimValues&&(N=N.trim()),N=this.replaceEntitiesValue(N);const L=this.options.attributeValueProcessor(O,N,T);L==null?D[W]=N:typeof L!=typeof N||L!==N?D[W]=L:D[W]=h(N,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(D[W]=!0)}if(!Object.keys(D).length)return;if(this.options.attributesGroupName){const V={};return V[this.options.attributesGroupName]=D,V}return D}}const d=function(E){E=E.replace(/\r\n?/g,`
37
- `);const T=new t("!xml");let R=T,C="",A="";for(let D=0;D<E.length;D++)if(E[D]==="<")if(E[D+1]==="/"){const O=y(E,">",D,"Closing Tag is not closed.");let N=E.substring(D+2,O).trim();if(this.options.removeNSPrefix){const ee=N.indexOf(":");ee!==-1&&(N=N.substr(ee+1))}this.options.transformTagName&&(N=this.options.transformTagName(N)),R&&(C=this.saveTextToParentTag(C,R,A));const W=A.substring(A.lastIndexOf(".")+1);if(N&&this.options.unpairedTags.indexOf(N)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${N}>`);let L=0;W&&this.options.unpairedTags.indexOf(W)!==-1?(L=A.lastIndexOf(".",A.lastIndexOf(".")-1),this.tagsNodeStack.pop()):L=A.lastIndexOf("."),A=A.substring(0,L),R=this.tagsNodeStack.pop(),C="",D=O}else if(E[D+1]==="?"){let O=g(E,D,!1,"?>");if(!O)throw new Error("Pi Tag is not closed.");if(C=this.saveTextToParentTag(C,R,A),!(this.options.ignoreDeclaration&&O.tagName==="?xml"||this.options.ignorePiTags)){const N=new t(O.tagName);N.add(this.options.textNodeName,""),O.tagName!==O.tagExp&&O.attrExpPresent&&(N[":@"]=this.buildAttributesMap(O.tagExp,A,O.tagName)),this.addChild(R,N,A)}D=O.closeIndex+1}else if(E.substr(D+1,3)==="!--"){const O=y(E,"-->",D+4,"Comment is not closed.");if(this.options.commentPropName){const N=E.substring(D+4,O-2);C=this.saveTextToParentTag(C,R,A),R.add(this.options.commentPropName,[{[this.options.textNodeName]:N}])}D=O}else if(E.substr(D+1,2)==="!D"){const O=n(E,D);this.docTypeEntities=O.entities,D=O.i}else if(E.substr(D+1,2)==="!["){const O=y(E,"]]>",D,"CDATA is not closed.")-2,N=E.substring(D+9,O);C=this.saveTextToParentTag(C,R,A);let W=this.parseTextData(N,R.tagname,A,!0,!1,!0,!0);W==null&&(W=""),this.options.cdataPropName?R.add(this.options.cdataPropName,[{[this.options.textNodeName]:N}]):R.add(this.options.textNodeName,W),D=O+2}else{let O=g(E,D,this.options.removeNSPrefix),N=O.tagName;const W=O.rawTagName;let L=O.tagExp,ee=O.attrExpPresent,J=O.closeIndex;this.options.transformTagName&&(N=this.options.transformTagName(N)),R&&C&&R.tagname!=="!xml"&&(C=this.saveTextToParentTag(C,R,A,!1));const se=R;if(se&&this.options.unpairedTags.indexOf(se.tagname)!==-1&&(R=this.tagsNodeStack.pop(),A=A.substring(0,A.lastIndexOf("."))),N!==T.tagname&&(A+=A?"."+N:N),this.isItStopNode(this.options.stopNodes,A,N)){let he="";if(L.length>0&&L.lastIndexOf("/")===L.length-1)N[N.length-1]==="/"?(N=N.substr(0,N.length-1),A=A.substr(0,A.length-1),L=N):L=L.substr(0,L.length-1),D=O.closeIndex;else if(this.options.unpairedTags.indexOf(N)!==-1)D=O.closeIndex;else{const we=this.readStopNodeData(E,W,J+1);if(!we)throw new Error(`Unexpected end of ${W}`);D=we.i,he=we.tagContent}const oe=new t(N);N!==L&&ee&&(oe[":@"]=this.buildAttributesMap(L,A,N)),he&&(he=this.parseTextData(he,N,A,!0,ee,!0,!0)),A=A.substr(0,A.lastIndexOf(".")),oe.add(this.options.textNodeName,he),this.addChild(R,oe,A)}else{if(L.length>0&&L.lastIndexOf("/")===L.length-1){N[N.length-1]==="/"?(N=N.substr(0,N.length-1),A=A.substr(0,A.length-1),L=N):L=L.substr(0,L.length-1),this.options.transformTagName&&(N=this.options.transformTagName(N));const he=new t(N);N!==L&&ee&&(he[":@"]=this.buildAttributesMap(L,A,N)),this.addChild(R,he,A),A=A.substr(0,A.lastIndexOf("."))}else{const he=new t(N);this.tagsNodeStack.push(R),N!==L&&ee&&(he[":@"]=this.buildAttributesMap(L,A,N)),this.addChild(R,he,A),R=he}C="",D=J}}else C+=E[D];return T.child};function p(E,T,R){const C=this.options.updateTag(T.tagname,R,T[":@"]);C===!1||(typeof C=="string"&&(T.tagname=C),E.addChild(T))}const m=function(E){if(this.options.processEntities){for(let T in this.docTypeEntities){const R=this.docTypeEntities[T];E=E.replace(R.regx,R.val)}for(let T in this.lastEntities){const R=this.lastEntities[T];E=E.replace(R.regex,R.val)}if(this.options.htmlEntities)for(let T in this.htmlEntities){const R=this.htmlEntities[T];E=E.replace(R.regex,R.val)}E=E.replace(this.ampEntity.regex,this.ampEntity.val)}return E};function b(E,T,R,C){return E&&(C===void 0&&(C=T.child.length===0),E=this.parseTextData(E,T.tagname,R,!1,T[":@"]?Object.keys(T[":@"]).length!==0:!1,C),E!==void 0&&E!==""&&T.add(this.options.textNodeName,E),E=""),E}function w(E,T,R){const C="*."+R;for(const A in E){const D=E[A];if(C===D||T===D)return!0}return!1}function S(E,T,R=">"){let C,A="";for(let D=T;D<E.length;D++){let V=E[D];if(C)V===C&&(C="");else if(V==='"'||V==="'")C=V;else if(V===R[0])if(R[1]){if(E[D+1]===R[1])return{data:A,index:D}}else return{data:A,index:D};else V===" "&&(V=" ");A+=V}}function y(E,T,R,C){const A=E.indexOf(T,R);if(A===-1)throw new Error(C);return A+T.length-1}function g(E,T,R,C=">"){const A=S(E,T+1,C);if(!A)return;let D=A.data;const V=A.index,O=D.search(/\s/);let N=D,W=!0;O!==-1&&(N=D.substring(0,O),D=D.substring(O+1).trimStart());const L=N;if(R){const ee=N.indexOf(":");ee!==-1&&(N=N.substr(ee+1),W=N!==A.data.substr(ee+1))}return{tagName:N,tagExp:D,closeIndex:V,attrExpPresent:W,rawTagName:L}}function v(E,T,R){const C=R;let A=1;for(;R<E.length;R++)if(E[R]==="<")if(E[R+1]==="/"){const D=y(E,">",R,`${T} is not closed`);if(E.substring(R+2,D).trim()===T&&(A--,A===0))return{tagContent:E.substring(C,R),i:D};R=D}else if(E[R+1]==="?")R=y(E,"?>",R+1,"StopNode is not closed.");else if(E.substr(R+1,3)==="!--")R=y(E,"-->",R+3,"StopNode is not closed.");else if(E.substr(R+1,2)==="![")R=y(E,"]]>",R,"StopNode is not closed.")-2;else{const D=g(E,R,">");D&&((D&&D.tagName)===T&&D.tagExp[D.tagExp.length-1]!=="/"&&A++,R=D.closeIndex)}}function h(E,T,R){if(T&&typeof E=="string"){const C=E.trim();return C==="true"?!0:C==="false"?!1:r(E,R)}else return e.isExist(E)?E:""}return Lf=o,Lf}var $f={},hv;function gk(){if(hv)return $f;hv=1;function e(o,s){return t(o,s)}function t(o,s,a){let l;const u={};for(let c=0;c<o.length;c++){const d=o[c],p=n(d);let m="";if(a===void 0?m=p:m=a+"."+p,p===s.textNodeName)l===void 0?l=d[p]:l+=""+d[p];else{if(p===void 0)continue;if(d[p]){let b=t(d[p],s,m);const w=i(b,s);d[":@"]?r(b,d[":@"],m,s):Object.keys(b).length===1&&b[s.textNodeName]!==void 0&&!s.alwaysCreateTextNode?b=b[s.textNodeName]:Object.keys(b).length===0&&(s.alwaysCreateTextNode?b[s.textNodeName]="":b=""),u[p]!==void 0&&u.hasOwnProperty(p)?(Array.isArray(u[p])||(u[p]=[u[p]]),u[p].push(b)):s.isArray(p,m,w)?u[p]=[b]:u[p]=b}}}return typeof l=="string"?l.length>0&&(u[s.textNodeName]=l):l!==void 0&&(u[s.textNodeName]=l),u}function n(o){const s=Object.keys(o);for(let a=0;a<s.length;a++){const l=s[a];if(l!==":@")return l}}function r(o,s,a,l){if(s){const u=Object.keys(s),c=u.length;for(let d=0;d<c;d++){const p=u[d];l.isArray(p,a+"."+p,!0,!0)?o[p]=[s[p]]:o[p]=s[p]}}}function i(o,s){const{textNodeName:a}=s,l=Object.keys(o).length;return!!(l===0||l===1&&(o[a]||typeof o[a]=="boolean"||o[a]===0))}return $f.prettify=e,$f}var Mf,mv;function yk(){if(mv)return Mf;mv=1;const{buildOptions:e}=fk(),t=mk(),{prettify:n}=gk(),r=sv();class i{constructor(s){this.externalEntities={},this.options=e(s)}parse(s,a){if(typeof s!="string")if(s.toString)s=s.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(a){a===!0&&(a={});const c=r.validate(s,a);if(c!==!0)throw Error(`${c.err.msg}:${c.err.line}:${c.err.col}`)}const l=new t(this.options);l.addExternalEntities(this.externalEntities);const u=l.parseXml(s);return this.options.preserveOrder||u===void 0?u:n(u,this.options)}addEntity(s,a){if(a.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(s.indexOf("&")!==-1||s.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(a==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[s]=a}}return Mf=i,Mf}var Bf,gv;function vk(){if(gv)return Bf;gv=1;const e=`
38
- `;function t(a,l){let u="";return l.format&&l.indentBy.length>0&&(u=e),n(a,l,"",u)}function n(a,l,u,c){let d="",p=!1;for(let m=0;m<a.length;m++){const b=a[m],w=r(b);if(w===void 0)continue;let S="";if(u.length===0?S=w:S=`${u}.${w}`,w===l.textNodeName){let E=b[w];o(S,l)||(E=l.tagValueProcessor(w,E),E=s(E,l)),p&&(d+=c),d+=E,p=!1;continue}else if(w===l.cdataPropName){p&&(d+=c),d+=`<![CDATA[${b[w][0][l.textNodeName]}]]>`,p=!1;continue}else if(w===l.commentPropName){d+=c+`<!--${b[w][0][l.textNodeName]}-->`,p=!0;continue}else if(w[0]==="?"){const E=i(b[":@"],l),T=w==="?xml"?"":c;let R=b[w][0][l.textNodeName];R=R.length!==0?" "+R:"",d+=T+`<${w}${R}${E}?>`,p=!0;continue}let y=c;y!==""&&(y+=l.indentBy);const g=i(b[":@"],l),v=c+`<${w}${g}`,h=n(b[w],l,S,y);l.unpairedTags.indexOf(w)!==-1?l.suppressUnpairedNode?d+=v+">":d+=v+"/>":(!h||h.length===0)&&l.suppressEmptyNode?d+=v+"/>":h&&h.endsWith(">")?d+=v+`>${h}${c}</${w}>`:(d+=v+">",h&&c!==""&&(h.includes("/>")||h.includes("</"))?d+=c+l.indentBy+h+c:d+=h,d+=`</${w}>`),p=!0}return d}function r(a){const l=Object.keys(a);for(let u=0;u<l.length;u++){const c=l[u];if(a.hasOwnProperty(c)&&c!==":@")return c}}function i(a,l){let u="";if(a&&!l.ignoreAttributes)for(let c in a){if(!a.hasOwnProperty(c))continue;let d=l.attributeValueProcessor(c,a[c]);d=s(d,l),d===!0&&l.suppressBooleanAttributes?u+=` ${c.substr(l.attributeNamePrefix.length)}`:u+=` ${c.substr(l.attributeNamePrefix.length)}="${d}"`}return u}function o(a,l){a=a.substr(0,a.length-l.textNodeName.length-1);let u=a.substr(a.lastIndexOf(".")+1);for(let c in l.stopNodes)if(l.stopNodes[c]===a||l.stopNodes[c]==="*."+u)return!0;return!1}function s(a,l){if(a&&a.length>0&&l.processEntities)for(let u=0;u<l.entities.length;u++){const c=l.entities[u];a=a.replace(c.regex,c.val)}return a}return Bf=t,Bf}var jf,yv;function bk(){if(yv)return jf;yv=1;const e=vk(),t=dv(),n={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(a,l){return l},attributeValueProcessor:function(a,l){return l},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function r(a){this.options=Object.assign({},n,a),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=t(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=s),this.processTextOrObjNode=i,this.options.format?(this.indentate=o,this.tagEndChar=`>
39
- `,this.newLine=`
40
- `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}r.prototype.build=function(a){return this.options.preserveOrder?e(a,this.options):(Array.isArray(a)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(a={[this.options.arrayNodeName]:a}),this.j2x(a,0,[]).val)},r.prototype.j2x=function(a,l,u){let c="",d="";const p=u.join(".");for(let m in a)if(Object.prototype.hasOwnProperty.call(a,m))if(typeof a[m]>"u")this.isAttribute(m)&&(d+="");else if(a[m]===null)this.isAttribute(m)||m===this.options.cdataPropName?d+="":m[0]==="?"?d+=this.indentate(l)+"<"+m+"?"+this.tagEndChar:d+=this.indentate(l)+"<"+m+"/"+this.tagEndChar;else if(a[m]instanceof Date)d+=this.buildTextValNode(a[m],m,"",l);else if(typeof a[m]!="object"){const b=this.isAttribute(m);if(b&&!this.ignoreAttributesFn(b,p))c+=this.buildAttrPairStr(b,""+a[m]);else if(!b)if(m===this.options.textNodeName){let w=this.options.tagValueProcessor(m,""+a[m]);d+=this.replaceEntitiesValue(w)}else d+=this.buildTextValNode(a[m],m,"",l)}else if(Array.isArray(a[m])){const b=a[m].length;let w="",S="";for(let y=0;y<b;y++){const g=a[m][y];if(!(typeof g>"u"))if(g===null)m[0]==="?"?d+=this.indentate(l)+"<"+m+"?"+this.tagEndChar:d+=this.indentate(l)+"<"+m+"/"+this.tagEndChar;else if(typeof g=="object")if(this.options.oneListGroup){const v=this.j2x(g,l+1,u.concat(m));w+=v.val,this.options.attributesGroupName&&g.hasOwnProperty(this.options.attributesGroupName)&&(S+=v.attrStr)}else w+=this.processTextOrObjNode(g,m,l,u);else if(this.options.oneListGroup){let v=this.options.tagValueProcessor(m,g);v=this.replaceEntitiesValue(v),w+=v}else w+=this.buildTextValNode(g,m,"",l)}this.options.oneListGroup&&(w=this.buildObjectNode(w,m,S,l)),d+=w}else if(this.options.attributesGroupName&&m===this.options.attributesGroupName){const b=Object.keys(a[m]),w=b.length;for(let S=0;S<w;S++)c+=this.buildAttrPairStr(b[S],""+a[m][b[S]])}else d+=this.processTextOrObjNode(a[m],m,l,u);return{attrStr:c,val:d}},r.prototype.buildAttrPairStr=function(a,l){return l=this.options.attributeValueProcessor(a,""+l),l=this.replaceEntitiesValue(l),this.options.suppressBooleanAttributes&&l==="true"?" "+a:" "+a+'="'+l+'"'};function i(a,l,u,c){const d=this.j2x(a,u+1,c.concat(l));return a[this.options.textNodeName]!==void 0&&Object.keys(a).length===1?this.buildTextValNode(a[this.options.textNodeName],l,d.attrStr,u):this.buildObjectNode(d.val,l,d.attrStr,u)}r.prototype.buildObjectNode=function(a,l,u,c){if(a==="")return l[0]==="?"?this.indentate(c)+"<"+l+u+"?"+this.tagEndChar:this.indentate(c)+"<"+l+u+this.closeTag(l)+this.tagEndChar;{let d="</"+l+this.tagEndChar,p="";return l[0]==="?"&&(p="?",d=""),(u||u==="")&&a.indexOf("<")===-1?this.indentate(c)+"<"+l+u+p+">"+a+d:this.options.commentPropName!==!1&&l===this.options.commentPropName&&p.length===0?this.indentate(c)+`<!--${a}-->`+this.newLine:this.indentate(c)+"<"+l+u+p+this.tagEndChar+a+this.indentate(c)+d}},r.prototype.closeTag=function(a){let l="";return this.options.unpairedTags.indexOf(a)!==-1?this.options.suppressUnpairedNode||(l="/"):this.options.suppressEmptyNode?l="/":l=`></${a}`,l},r.prototype.buildTextValNode=function(a,l,u,c){if(this.options.cdataPropName!==!1&&l===this.options.cdataPropName)return this.indentate(c)+`<![CDATA[${a}]]>`+this.newLine;if(this.options.commentPropName!==!1&&l===this.options.commentPropName)return this.indentate(c)+`<!--${a}-->`+this.newLine;if(l[0]==="?")return this.indentate(c)+"<"+l+u+"?"+this.tagEndChar;{let d=this.options.tagValueProcessor(l,a);return d=this.replaceEntitiesValue(d),d===""?this.indentate(c)+"<"+l+u+this.closeTag(l)+this.tagEndChar:this.indentate(c)+"<"+l+u+">"+d+"</"+l+this.tagEndChar}},r.prototype.replaceEntitiesValue=function(a){if(a&&a.length>0&&this.options.processEntities)for(let l=0;l<this.options.entities.length;l++){const u=this.options.entities[l];a=a.replace(u.regex,u.val)}return a};function o(a){return this.options.indentBy.repeat(a)}function s(a){return a.startsWith(this.options.attributeNamePrefix)&&a!==this.options.textNodeName?a.substr(this.attrPrefixLen):!1}return jf=r,jf}var Uf,vv;function wk(){if(vv)return Uf;vv=1;const e=sv(),t=yk(),n=bk();return Uf={XMLParser:t,XMLValidator:e,XMLBuilder:n},Uf}wk();class bv{isEnabled(){return!0}isActive(t){return pt(t,"files-spaces-projects")?!1:pt(t,"files-spaces-generic")||Rn(t,"files-public-link")}getTask(t){const{router:n,clientService:r,resourcesStore:i,authService:o,spacesStore:s,sharesStore:a,configStore:l}=t,{webdav:u,graphAuthenticated:c}=r,{replaceInvalidFileRoute:d}=Aa({router:n});return rn.useTask(function*(p,m,b,w=null,S=null,y={}){try{i.clearResourceList();const g=Io.Default;re.isPublicSpaceResource(b)&&g.push(qe.DownloadURL);let{resource:v,children:h}=yield*re.call(u.listFiles(b,{path:w,fileId:S},{signal:p,davProperties:g}));v.id&&d({space:b,resource:v,path:w,fileId:S});let E;w==="/"&&(re.isShareSpaceResource(b)?(E=yield*re.call(Gs({graphClient:c,spacesStore:s,space:b,signal:p})),E&&(v=re.buildIncomingShareResource({graphRoles:a.graphRoles,driveItem:E,serverUrl:l.serverUrl}))):!re.isPersonalSpaceResource(b)&&!re.isPublicSpaceResource(b)&&(v=b)),yield i.loadAncestorMetaData({folder:v,space:b,client:u,signal:p}),re.isProjectSpaceResource(b)&&(yield s.loadGraphPermissions({ids:[b.id],graphClient:c})),re.isShareSpaceResource(b)&&(h.forEach(T=>T.remoteItemId=b.id),b.graphPermissions===void 0&&(E||(E=yield*re.call(Gs({graphClient:c,spacesStore:s,space:b,signal:p}))),um({sharesStore:a,spacesStore:s,space:b,sharedDriveItem:E}))),i.initResourceList({currentFolder:v,resources:h})}catch(g){if(i.setCurrentFolder(null),console.error(g),g.statusCode===401)return o.handleAuthError(f(n.currentRoute))}}).restartable()}}class wv{isEnabled(){return!0}isActive(t){const n=f(t.currentRoute);return It(t,"files-common-favorites")||n?.query?.contextRouteName==="files-common-favorites"}getTask(t){const{resourcesStore:n,clientService:r,userStore:i}=t;return rn.useTask(function*(o,s){n.clearResourceList(),n.setAncestorMetaData({});let a=yield r.webdav.listFavoriteFiles({username:i.user?.onPremisesSamAccountName,signal:o});a=a.map(re.buildResource),n.initResourceList({currentFolder:null,resources:a})})}}class Sv{isEnabled(){return!0}isActive(t){const n=f(t.currentRoute);return Bt(t,"files-shares-via-link")||n?.query?.contextRouteName==="files-shares-via-link"}getTask(t){const{userStore:n,spacesStore:r,clientService:i,configStore:o,resourcesStore:s}=t;return rn.useTask(function*(a,l){s.clearResourceList(),s.setAncestorMetaData({}),o.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:i.graphAuthenticated,signal:a}));const c=(yield*re.call(i.graphAuthenticated.driveItems.listSharedByMe({expand:new Set(["thumbnails"])},{signal:a}))).filter(d=>d.permissions.some(({link:p})=>!!p)).map(d=>re.buildOutgoingShareResource({driveItem:d,user:n.user,serverUrl:o.serverUrl}));s.initResourceList({currentFolder:null,resources:c})})}}class Ev{isEnabled(){return!0}isActive(t){const n=f(t.currentRoute);return Bt(t,"files-shares-with-me")||n?.query?.contextRouteName==="files-shares-with-me"}getTask(t){const{spacesStore:n,clientService:r,configStore:i,resourcesStore:o,sharesStore:s}=t;return rn.useTask(function*(a,l){o.clearResourceList(),o.setAncestorMetaData({}),i.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:r.graphAuthenticated,signal:a}));const c=(yield*re.call(r.graphAuthenticated.driveItems.listSharedWithMe({expand:new Set(["thumbnails"])},{signal:a}))).map(d=>re.buildIncomingShareResource({driveItem:d,graphRoles:s.graphRoles,serverUrl:i.serverUrl}));o.initResourceList({currentFolder:null,resources:c})})}}class Tv{isEnabled(){return!0}isActive(t){const n=f(t.currentRoute);return Bt(t,"files-shares-with-others")||n?.query?.contextRouteName==="files-shares-with-others"}getTask(t){const{userStore:n,spacesStore:r,clientService:i,configStore:o,resourcesStore:s}=t;return rn.useTask(function*(a,l){s.clearResourceList(),s.setAncestorMetaData({}),o.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:i.graphAuthenticated,signal:a}));const c=(yield*re.call(i.graphAuthenticated.driveItems.listSharedByMe({expand:new Set(["thumbnails"])},{signal:a}))).filter(d=>d.permissions.some(({link:p})=>!p)).map(d=>re.buildOutgoingShareResource({driveItem:d,user:n.user,serverUrl:o.serverUrl}));s.initResourceList({currentFolder:null,resources:c})})}}class Av{isEnabled(){return!0}isActive(t){return dn(t,"files-trash-generic")}getTask(t){const{resourcesStore:n,spacesStore:r,clientService:{webdav:i,graphAuthenticated:o}}=t;return rn.useTask(function*(s,a,l){n.clearResourceList(),n.setAncestorMetaData({});const{resource:u,children:c}=yield i.listFiles(l,{},{depth:1,davProperties:Io.Trashbin,isTrash:!0,signal:s});re.isProjectSpaceResource(l)&&(yield r.loadGraphPermissions({ids:[l.id],graphClient:o})),n.initResourceList({currentFolder:u,resources:c})})}}class xv{loaders;constructor(){this.loaders=[new bv,new wv,new Sv,new Ev,new Tv,new Av]}getTask(){const t=gt(),n=st(),r=Zt(),i=ze(),o=He(),s=ut(),a=We(),l=kr(),u=nd(),c=this.loaders.find(d=>d.isEnabled()&&d.isActive(f(i)));if(!c){console.debug("No folder loader found for route");return}return rn.useTask(function*(...d){const p={clientService:o,configStore:s,userStore:t,spacesStore:n,capabilityStore:r,resourcesStore:a,sharesStore:l,router:i,authService:u};try{yield c.getTask(p).perform(...d)}catch(m){console.error(m)}})}}const Cv=new xv;var Gr=(e=>(e.add="loading-service.add",e.remove="loading-service.remove",e.setProgress="loading-service.set-progress",e))(Gr||{});const Sk=200;class Ek{tasks=[];get isLoading(){return this.tasks.some(t=>t.active)}get currentProgress(){if(this.tasks.some(r=>!r.state&&r.active))return null;const t=this.tasks.filter(r=>!!r.state&&r.active);if(!t.length)return null;const n=t.reduce((r,i)=>(r+=i.state.current/i.state.total,r),0);return Math.round(n/t.length*100)}addTask(t,{debounceTime:n=Sk,indeterminate:r=!0}={}){const i={id:Gt.v4(),active:!1,...!r&&{state:{total:0,current:0}}};return this.tasks.length||window.addEventListener("beforeunload",this.onBeforeUnload),this.tasks.push(i),At.debounce(()=>{i.active=!0,Je.publish("loading-service.add")},n)(),t({setProgress:({total:a,current:l})=>{r||this.setProgress({task:i,total:a,current:l})}}).finally(()=>{this.removeTask(i.id)})}removeTask(t){this.tasks=this.tasks.filter(n=>n.id!==t),this.tasks.length||window.removeEventListener("beforeunload",this.onBeforeUnload),Je.publish("loading-service.remove")}setProgress({task:t,total:n,current:r}){t.state||(t.state={total:0,current:0}),t.state.total=n,t.state.current=r,Je.publish("loading-service.set-progress")}onBeforeUnload(t){t.preventDefault()}}var Tk="__lodash_hash_undefined__";function Ak(e){return this.__data__.set(e,Tk),this}function xk(e){return this.__data__.has(e)}function ma(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Ar;++t<n;)this.add(e[t])}ma.prototype.add=ma.prototype.push=Ak,ma.prototype.has=xk;function Ck(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Rk(e,t){return e.has(t)}var kk=1,Pk=2;function Rv(e,t,n,r,i,o){var s=n&kk,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var u=o.get(e),c=o.get(t);if(u&&c)return u==t&&c==e;var d=-1,p=!0,m=n&Pk?new ma:void 0;for(o.set(e,t),o.set(t,e);++d<a;){var b=e[d],w=t[d];if(r)var S=s?r(w,b,d,t,e,o):r(b,w,d,e,t,o);if(S!==void 0){if(S)continue;p=!1;break}if(m){if(!Ck(t,function(y,g){if(!Rk(m,g)&&(b===y||i(b,y,n,r,o)))return m.push(g)})){p=!1;break}}else if(!(b===w||i(b,w,n,r,o))){p=!1;break}}return o.delete(e),o.delete(t),p}function Ik(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function Ok(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Fk=1,_k=2,Dk="[object Boolean]",Nk="[object Date]",Lk="[object Error]",$k="[object Map]",Mk="[object Number]",Bk="[object RegExp]",jk="[object Set]",Uk="[object String]",Vk="[object Symbol]",qk="[object ArrayBuffer]",zk="[object DataView]",kv=_n?_n.prototype:void 0,Vf=kv?kv.valueOf:void 0;function Wk(e,t,n,r,i,o,s){switch(n){case zk:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case qk:return!(e.byteLength!=t.byteLength||!o(new zs(e),new zs(t)));case Dk:case Nk:case Mk:return Eo(+e,+t);case Lk:return e.name==t.name&&e.message==t.message;case Bk:case Uk:return e==t+"";case $k:var a=Ik;case jk:var l=r&Fk;if(a||(a=Ok),e.size!=t.size&&!l)return!1;var u=s.get(e);if(u)return u==t;r|=_k,s.set(e,t);var c=Rv(a(e),a(t),r,i,o,s);return s.delete(e),c;case Vk:if(Vf)return Vf.call(e)==Vf.call(t)}return!1}function qf(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Pv(e,t,n){var r=t(e);return Gn(e)?r:qf(r,n(e))}function Hk(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function Iv(){return[]}var Kk=Object.prototype,Gk=Kk.propertyIsEnumerable,Ov=Object.getOwnPropertySymbols,Fv=Ov?function(e){return e==null?[]:(e=Object(e),Hk(Ov(e),function(t){return Gk.call(e,t)}))}:Iv,Qk=Mh(Object.keys,Object),Xk=Object.prototype,Yk=Xk.hasOwnProperty;function Jk(e){if(!Xl(e))return Qk(e);var t=[];for(var n in Object(e))Yk.call(e,n)&&n!="constructor"&&t.push(n);return t}function Zk(e){return Hs(e)?Yh(e):Jk(e)}function _v(e){return Pv(e,Zk,Fv)}var eP=1,tP=Object.prototype,nP=tP.hasOwnProperty;function rP(e,t,n,r,i,o){var s=n&eP,a=_v(e),l=a.length,u=_v(t),c=u.length;if(l!=c&&!s)return!1;for(var d=l;d--;){var p=a[d];if(!(s?p in t:nP.call(t,p)))return!1}var m=o.get(e),b=o.get(t);if(m&&b)return m==t&&b==e;var w=!0;o.set(e,t),o.set(t,e);for(var S=s;++d<l;){p=a[d];var y=e[p],g=t[p];if(r)var v=s?r(g,y,p,t,e,o):r(y,g,p,e,t,o);if(!(v===void 0?y===g||i(y,g,n,r,o):v)){w=!1;break}S||(S=p=="constructor")}if(w&&!S){var h=e.constructor,E=t.constructor;h!=E&&"constructor"in e&&"constructor"in t&&!(typeof h=="function"&&h instanceof h&&typeof E=="function"&&E instanceof E)&&(w=!1)}return o.delete(e),o.delete(t),w}var zf=si(rr,"DataView"),Wf=si(rr,"Promise"),Hf=si(rr,"Set"),Kf=si(rr,"WeakMap"),Dv="[object Map]",iP="[object Object]",Nv="[object Promise]",Lv="[object Set]",$v="[object WeakMap]",Mv="[object DataView]",oP=oi(zf),sP=oi(Ao),aP=oi(Wf),lP=oi(Hf),cP=oi(Kf),Xn=ii;(zf&&Xn(new zf(new ArrayBuffer(1)))!=Mv||Ao&&Xn(new Ao)!=Dv||Wf&&Xn(Wf.resolve())!=Nv||Hf&&Xn(new Hf)!=Lv||Kf&&Xn(new Kf)!=$v)&&(Xn=function(e){var t=ii(e),n=t==iP?e.constructor:void 0,r=n?oi(n):"";if(r)switch(r){case oP:return Mv;case sP:return Dv;case aP:return Nv;case lP:return Lv;case cP:return $v}return t});var uP=1,Bv="[object Arguments]",jv="[object Array]",ga="[object Object]",fP=Object.prototype,Uv=fP.hasOwnProperty;function dP(e,t,n,r,i,o){var s=Gn(e),a=Gn(t),l=s?jv:Xn(e),u=a?jv:Xn(t);l=l==Bv?ga:l,u=u==Bv?ga:u;var c=l==ga,d=u==ga,p=l==u;if(p&&Co(e)){if(!Co(t))return!1;s=!0,c=!1}if(p&&!c)return o||(o=new or),s||ec(e)?Rv(e,t,n,r,i,o):Wk(e,t,l,n,r,i,o);if(!(n&uP)){var m=c&&Uv.call(e,"__wrapped__"),b=d&&Uv.call(t,"__wrapped__");if(m||b){var w=m?e.value():e,S=b?t.value():t;return o||(o=new or),i(w,S,n,r,o)}}return p?(o||(o=new or),rP(e,t,n,r,i,o)):!1}function Vv(e,t,n,r,i){return e===t?!0:e==null||t==null||!sr(e)&&!sr(t)?e!==e&&t!==t:dP(e,t,n,r,Vv,i)}function qv(e,t){return Vv(e,t)}class pP{clientService;configStore;userStore;authStore;constructor({clientService:t,userStore:n,authStore:r,configStore:i}){this.clientService=t,this.userStore=n,this.authStore=r,this.configStore=i}get user(){return this.userStore.user}async loadPreview(t,n=!1,r=!0,i){const{space:o,resource:s}=t;if(!s.canDownload()||!s.hasPreview?.())return;const a=re.isPublicSpaceResource(o);if(!(!a&&(!this.configStore.serverUrl||!this.user.onPremisesSamAccountName||!this.authStore.accessToken))){if(a)return this.publicPreviewUrl(t,i);try{return await this.privatePreviewBlob(t,n,r,i)}catch(l){if(r)return;throw l}}}async cacheFactory(t,n,r){const{resource:i,dimensions:o}=t,s=Tc.filePreview.get(i.id.toString());if(s&&s.etag===i.etag&&qv(o,s.dimensions))return s.src;try{const a=await this.privatePreviewBlob(t,!1,!0,r);return Tc.filePreview.set(i.id.toString(),{src:a,etag:i.etag,dimensions:o},0).src}catch(a){if(n)return;throw a}}buildQueryString(t){return xS.stringify({scalingup:t.scalingup||0,preview:Object.hasOwnProperty.call(t,"preview")?t.preview:1,a:Object.hasOwnProperty.call(t,"a")?t.a:1,...t.processor&&{processor:t.processor},...t.etag&&{c:t.etag.replaceAll('"',"")},...t.dimensions&&t.dimensions[0]&&{x:t.dimensions[0]},...t.dimensions&&t.dimensions[1]&&{y:t.dimensions[1]}})}async privatePreviewBlob(t,n=!1,r=!0,i){const{resource:o,dimensions:s,processor:a}=t;if(n)return this.cacheFactory(t,r,i);const l=[this.configStore.serverUrl,"remote.php/dav",wc(o.webDavPath),"?",this.buildQueryString({etag:o.etag,dimensions:s,processor:a})].join("");try{const{data:u}=await this.clientService.httpAuthenticated.get(l,{responseType:"blob",signal:i});return window.URL.createObjectURL(u)}catch(u){if([425,429].includes(u.status)){const c=u.response?.headers?.["retry-after"]||5;return await new Promise(d=>setTimeout(d,c*1e3)),this.privatePreviewBlob(t,n,r,i)}throw u}}async publicPreviewUrl(t,n){const{space:r,resource:i,dimensions:o,processor:s}=t;let{downloadURL:a}=i;if(!a){const{downloadURL:p}=await this.clientService.webdav.getFileInfo(r,i,{davProperties:[qe.DownloadURL]});a=p}const[l,u]=a.split("?"),c=[this.buildQueryString({etag:i.etag,dimensions:o,processor:s}),u].filter(Boolean).join("&"),d=[l,c].filter(Boolean).join("?");try{const{status:p}=await this.clientService.httpUnAuthenticated.head(d,{signal:n});if(p!==404)return d}catch(p){if([425,429].includes(p.status)){const m=p.response?.headers?.["retry-after"]||5;return await new Promise(b=>setTimeout(b,m*1e3)),this.publicPreviewUrl(t,n)}throw p}}}const ya=fe.z.enum(["fit","resize","fill","thumbnail"]);class hP{$gettext;constructor({$gettext:t}){this.$gettext=t}explain(t,n){return{code:"mustNotBeEmpty",message:this.$gettext("Must not be empty"),format:[],...At.isBoolean(n)&&{verified:n}}}assert(t,n){return n.length>0}validate(){return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class mP{$gettext;constructor({$gettext:t}){this.$gettext=t}explain(t,n){return{code:"mustContain",helperMessage:this.$gettext("Valid special characters: %{characters}",{characters:t.characters},!0),message:this.$gettext("%{param1}+ special characters"),format:[t.minLength],...At.isBoolean(n)&&{verified:n}}}assert(t,n){return Array.from(n).filter(i=>t.characters.includes(i)).length>=t.minLength}validate(t){if(!At.isObject(t))throw new Error("options should be an object");if(!At.isNumber(t.minLength)||At.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");if(!At.isString(t.characters))throw new Error("characters should be a character sequence");return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class va{$gettext;constructor({$gettext:t}){this.$gettext=t}assert(t,n){throw new Error("Method not implemented.")}explain(t,n){throw new Error("Method not implemented.")}validate(t){if(!At.isObject(t))throw new Error("options should be an object");if(!At.isNumber(t.minLength)||At.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class gP extends va{constructor(t){super(t)}explain(t,n){return{code:"atLeastCharacters",message:this.$gettext("%{param1}+ letters"),format:[t.minLength],...At.isBoolean(n)&&{verified:n}}}assert(t,n){return n.length>=t.minLength}}class yP extends va{constructor(t){super(t)}explain(t,n){return{code:"atLeastUppercaseCharacters",message:this.$gettext("%{param1}+ uppercase letters"),format:[t.minLength],...At.isBoolean(n)&&{verified:n}}}assert(t,n){return(n||"").match(/[A-Z\xC0-\xD6\xD8-\xDE]/g)?.length>=t.minLength}}class vP extends va{constructor(t){super(t)}explain(t,n){return{code:"atLeastLowercaseCharacters",message:this.$gettext("%{param1}+ lowercase letters"),format:[t.minLength],...At.isBoolean(n)&&{verified:n}}}assert(t,n){return(n||"").match(/[a-z\xDF-\xF6\xF8-\xFF]/g)?.length>=t.minLength}}class bP extends va{constructor(t){super(t)}explain(t,n){return{code:"atLeastDigits",message:this.$gettext("%{param1}+ numbers"),format:[t.minLength],...At.isBoolean(n)&&{verified:n}}}assert(t,n){return(n||"").match(/\d/g)?.length>=t.minLength}}class wP{language;capability;policy;generatePasswordRules;constructor({language:t}){this.language=t}initialize(t){this.capability=t.passwordPolicy,this.buildGeneratePasswordRules()}hasRules(){return!!this.capability.min_characters||!!this.capability.min_lowercase_characters||!!this.capability.min_uppercase_characters||!!this.capability.min_digits||!!this.capability.min_special_characters}buildGeneratePasswordRules(){this.generatePasswordRules={length:Math.max(this.capability.min_characters||0,(this.capability.min_lowercase_characters||0)+(this.capability.min_uppercase_characters||0)+(this.capability.min_digits||0)+(this.capability.min_special_characters||0),12),minLowercaseCharacters:Math.max(this.capability.min_lowercase_characters||0,2),minUppercaseCharacters:Math.max(this.capability.min_uppercase_characters||0,2),minSpecialCharacters:Math.max(this.capability.min_special_characters||0,2),minDigits:Math.max(this.capability.min_digits||0,2)}}buildPolicy({enforcePassword:t=!1}={}){const n={atLeastCharacters:new gP({...this.language}),mustNotBeEmpty:new hP({...this.language}),atLeastUppercaseCharacters:new yP({...this.language}),atLeastLowercaseCharacters:new vP({...this.language}),atLeastDigits:new bP({...this.language}),mustContain:new mP({...this.language})},r={};t&&!this.hasRules()&&(r.mustNotBeEmpty={}),this.capability.min_characters&&(r.atLeastCharacters={minLength:this.capability.min_characters}),this.capability.min_uppercase_characters&&(r.atLeastUppercaseCharacters={minLength:this.capability.min_uppercase_characters}),this.capability.min_lowercase_characters&&(r.atLeastLowercaseCharacters={minLength:this.capability.min_lowercase_characters}),this.capability.min_digits&&(r.atLeastDigits={minLength:this.capability.min_digits}),this.capability.min_special_characters&&(r.mustContain={minLength:this.capability.min_special_characters,characters:' "!#\\$%&\'()*+,-./:;<=>?@[\\]^_`{|}~"'}),this.policy=new CS.PasswordPolicy(r,n)}getPolicy({enforcePassword:t=!1}={}){return this.buildPolicy({enforcePassword:t}),this.policy}generatePassword(){const t="abcdefghijklmnopqrstuvwxyz",n="ABCDEFGHIJKLMNOPQRSTUVWXYZ",r="\"!#$%&'()*+,-./:;<=>?@[]^_`{|}~",i="0123456789",o=(m,b)=>{const w=256-256%m.length;let S="",y;for(let g=0;g<b;g++){do y=window.crypto.getRandomValues(new Uint8Array(1))[0];while(y>=w);S+=m[y%m.length]}return S},{minLowercaseCharacters:s,minUppercaseCharacters:a,minDigits:l,minSpecialCharacters:u,length:c}=this.generatePasswordRules;let d="";if(d+=o(t,s),d+=o(n,a),d+=o(i,l),d+=o(r,u),d.length<c){const m=c-d.length,b=t+n+r+i;d+=o(b,m)}return(m=>{const b=m.split(""),w=new Uint32Array(b.length);window.crypto.getRandomValues(w);for(let S=b.length-1;S>0;S--){const y=w[S]%(S+1);[b[S],b[y]]=[b[y],b[S]]}return b.join("")})(d)}}const zv=e=>({name:ct.basename(e),type:"directory",relativePath:e}),Wv=(e,t)=>t.map(n=>({source:e,name:n.name,type:n.type,data:n,meta:{relativePath:n.relativePath||null}})),Hv=async e=>{const t=await new Promise((r,i)=>e.file(r,i));return e.fullPath===re.urlJoin(e.name,{leadingSlash:!0})||(t.relativePath=e.fullPath),t},SP=e=>typeof e.getAsEntry=="function"?e.getAsEntry():e.webkitGetAsEntry();async function*EP(e){const t=e.createReader(),n=()=>new Promise((i,o)=>{t.readEntries(i,o)});let r;do{r=await n();for(const i of r)yield i}while(r.length>0)}async function*Kv(e,t){if(e.isDirectory){let n=!1;for await(const r of EP(e))if(r.isDirectory)yield*Kv(r,t);else if(r.isFile)try{n=!0,yield Hv(r)}catch(i){console.error(i),t?.(i)}n||(yield zv(e.fullPath||e.name))}else try{yield Hv(e)}catch(n){console.error(n),t?.(n)}}const TP=async(e,t)=>{try{const n=[],r=await Promise.all(Array.from(e.items,i=>SP(i)));for(let i=0;i<r.length;i++)for await(const o of Kv(r[i],t))n.push(o);return n}catch(n){console.error(n);const r=Array.from(e.files);return Promise.resolve(r)}},AP={target:null,uppyService:null};class xP extends Kd.BasePlugin{nodes;uppyService;constructor(t,n){super(t,{...AP,...n}),this.type="acquirer",this.id=this.opts.id||"DropTarget"}handleDrop=async t=>{t.preventDefault(),t.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(o=>{o.type==="acquirer"&&o.handleRootDrop?.(t)});let n=!1;const r=o=>{this.uppy.log(o,"error"),n||(this.uppy.info(o.message,"error"),n=!0)},i=await TP(t.dataTransfer,r);if(i.length>0){this.uppy.log("[DropTarget] Files were dropped");try{const o=Wv("DropTarget",i);this.uppyService.addFiles(o)}catch(o){this.uppy.log(o)}}this.opts.onDrop?.(t),this.uppyService?.publish("drop",t)};handleDragOver=t=>{t.preventDefault(),t.stopPropagation(),this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver?.(t),this.uppyService?.publish("drag-over",t)};handleDragLeave=t=>{t.preventDefault(),t.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave?.(t),this.uppyService?.publish("drag-out",t)};addListeners=()=>{const{target:t,uppyService:n}=this.opts;if(this.uppyService=n,t instanceof Element?this.nodes=[t]:typeof t=="string"&&(this.nodes=Gd.toArray(document.querySelectorAll(t))),!this.nodes||this.nodes.length===0)throw new Error(`"${t}" does not match any HTML elements`);this.nodes.forEach(r=>{r.addEventListener("dragover",this.handleDragOver,!1),r.addEventListener("dragleave",this.handleDragLeave,!1),r.addEventListener("drop",this.handleDrop,!1)})};removeListeners=()=>{this.nodes&&this.nodes.forEach(t=>{t.removeEventListener("dragover",this.handleDragOver,!1),t.removeEventListener("dragleave",this.handleDragLeave,!1),t.removeEventListener("drop",this.handleDrop,!1)})};install(){this.setPluginState({isDraggingOver:!1}),this.addListeners()}uninstall(){this.removeListeners()}}class CP{uppy;uploadInputs=[];uploadFolderMap={};constructor({language:t}){const{$gettext:n}=t;this.uppy=new Kd({autoProceed:!1,onBeforeFileAdded:(r,i)=>r.id in i&&!i[r.id].error?!1:(r.name=r.name.normalize("NFC"),r.meta.relativePath=this.getRelativeFilePath(r)?.normalize("NFC"),r.id=this.generateUploadId(r),r)}),this.uppy.setOptions({locale:{strings:{addedNumFiles:n("Added %{numFiles} file(s)"),authenticate:n("Connect"),authenticateWith:n("Connect to %{pluginName}"),authenticateWithTitle:n("Please authenticate with %{pluginName} to select files"),cancel:n("Cancel"),companionError:n("Connection with Companion failed"),loadedXFiles:n("Loaded %{numFiles} files"),loading:n("Loading..."),logOut:n("Log out"),pluginWebdavInputLabel:n("Public link without password protection"),selectX:{0:n("Select %{smart_count}"),1:n("Select %{smart_count}")},signInWithGoogle:n("Sign in with Google")}}}),this.setUpEvents()}getRelativeFilePath=t=>{const n=t.data.relativePath||t.data.webkitRelativePath;return n?re.urlJoin(n):void 0};addPlugin(t,...n){this.uppy.use(t,...n)}removePlugin(t){this.uppy.removePlugin(t)}getPlugin(t){return this.uppy.getPlugin(t)}useTus({chunkSize:t,overridePatchMethod:n,uploadDataDuringCreation:r,onBeforeRequest:i,headers:o}){const s={chunkSize:t,removeFingerprintOnSuccess:!0,overridePatchMethod:n,retryDelays:[0,500,1e3],uploadDataDuringCreation:r,limit:5,headers:o,onBeforeRequest:i,onShouldRetry:(u,c,d,p)=>u?.originalResponse?.getStatus()>=500?!1:u?.originalResponse?.getStatus()===401?!0:p(u)},a=this.uppy.getPlugin("XHRUpload");a&&this.uppy.removePlugin(a);const l=this.uppy.getPlugin("Tus");if(l){l.setOptions(s);return}this.uppy.use(RS,s)}useXhr({headers:t,timeout:n,endpoint:r}){const i={endpoint:r,method:"put",headers:t,formData:!1,timeout:n,getResponseData(){return{}}},o=this.uppy.getPlugin("Tus");o&&this.uppy.removePlugin(o);const s=this.uppy.getPlugin("XHRUpload");if(s){s.setOptions(i);return}this.uppy.use(kS,i)}tusActive(){return!!this.uppy.getPlugin("Tus")}useDropTarget({targetSelector:t}){this.uppy.getPlugin("DropTarget")||this.uppy.use(xP,{target:t,uppyService:this})}removeDropTarget(){const t=this.uppy.getPlugin("DropTarget");t&&this.uppy.removePlugin(t)}subscribe(t,n){return Je.subscribe(t,n)}unsubscribe(t,n){Je.unsubscribe(t,n)}publish(t,n){Je.publish(t,n)}setUpEvents(){this.uppy.on("progress",t=>{this.publish("progress",t)}),this.uppy.on("upload-progress",(t,n)=>{this.publish("upload-progress",{file:t,progress:n})}),this.uppy.on("cancel-all",()=>{this.publish("uploadCancelled"),this.clearInputs()}),this.uppy.on("complete",t=>{if(!(!t||!t.successful.length&&!t.failed.length)){this.publish("uploadCompleted",t);for(let n=0;n<t.successful.length;n++)this.uppy.removeFile(t.successful[n].id);this.clearInputs()}}),this.uppy.on("upload-success",t=>{this.publish("uploadSuccess",t)}),this.uppy.on("upload-error",(t,n)=>{this.publish("uploadError",{file:t,error:n})})}registerUploadInput(t){t.getAttribute("listener")!=="true"&&(t.setAttribute("listener","true"),t.addEventListener("change",r=>{const i=r.target,o=Array.from(i.files);this.addFiles(o)}),this.uploadInputs.push(t))}removeUploadInput(t){this.uploadInputs=this.uploadInputs.filter(n=>n!==t)}generateUploadId(t){return Gd.generateFileID(t,this.uppy.getID())}log(t,n){this.uppy.log(t,n)}addFiles(t){this.uppy.addFiles(t)}uploadFiles(){return this.uppy.upload()}retryAllUploads(){return this.uppy.retryAll()}pauseAllUploads(){return this.uppy.pauseAll()}resumeAllUploads(){return this.uppy.resumeAll()}cancelAllUploads(){return this.uppy.cancelAll()}removeFailedFiles(){const{files:t}=this.uppy.getState(),n=Object.values(t).filter(r=>r.error);n.length&&this.uppy.removeFiles(n.map(({id:r})=>r))}getCurrentUploads(){return this.uppy.getState().currentUploads}isRemoteUploadInProgress(){return this.uppy.getFiles().some(t=>t.isRemote&&!t.error)}clearInputs(){this.uploadInputs.forEach(t=>{t.value=null})}setUploadFolder(t,n){this.uploadFolderMap[t]=n}removeUploadFolder(t){this.uploadFolderMap[t]&&delete this.uploadFolderMap[t]}}function RP(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var kP=Object.getOwnPropertySymbols,PP=kP?function(e){for(var t=[];e;)qf(t,Fv(e)),e=Ql(e);return t}:Iv;function Gv(e){return Pv(e,nc,PP)}var IP=Object.prototype,OP=IP.hasOwnProperty;function FP(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&OP.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function _P(e,t){var n=Gl(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var DP=/\w*$/;function NP(e){var t=new e.constructor(e.source,DP.exec(e));return t.lastIndex=e.lastIndex,t}var Qv=_n?_n.prototype:void 0,Xv=Qv?Qv.valueOf:void 0;function LP(e){return Xv?Object(Xv.call(e)):{}}var $P="[object Boolean]",MP="[object Date]",BP="[object Map]",jP="[object Number]",UP="[object RegExp]",VP="[object Set]",qP="[object String]",zP="[object Symbol]",WP="[object ArrayBuffer]",HP="[object DataView]",KP="[object Float32Array]",GP="[object Float64Array]",QP="[object Int8Array]",XP="[object Int16Array]",YP="[object Int32Array]",JP="[object Uint8Array]",ZP="[object Uint8ClampedArray]",eI="[object Uint16Array]",tI="[object Uint32Array]";function nI(e,t,n){var r=e.constructor;switch(t){case WP:return Gl(e);case $P:case MP:return new r(+e);case HP:return _P(e);case KP:case GP:case QP:case XP:case YP:case JP:case ZP:case eI:case tI:return Lh(e,n);case BP:return new r;case jP:case qP:return new r(e);case UP:return NP(e);case VP:return new r;case zP:return LP(e)}}var rI="[object Map]";function iI(e){return sr(e)&&Xn(e)==rI}var Yv=Di&&Di.isMap,oI=Yv?Jl(Yv):iI,sI="[object Set]";function aI(e){return sr(e)&&Xn(e)==sI}var Jv=Di&&Di.isSet,lI=Jv?Jl(Jv):aI,cI=1,Zv="[object Arguments]",uI="[object Array]",fI="[object Boolean]",dI="[object Date]",pI="[object Error]",eb="[object Function]",hI="[object GeneratorFunction]",mI="[object Map]",gI="[object Number]",tb="[object Object]",yI="[object RegExp]",vI="[object Set]",bI="[object String]",wI="[object Symbol]",SI="[object WeakMap]",EI="[object ArrayBuffer]",TI="[object DataView]",AI="[object Float32Array]",xI="[object Float64Array]",CI="[object Int8Array]",RI="[object Int16Array]",kI="[object Int32Array]",PI="[object Uint8Array]",II="[object Uint8ClampedArray]",OI="[object Uint16Array]",FI="[object Uint32Array]",bt={};bt[Zv]=bt[uI]=bt[EI]=bt[TI]=bt[fI]=bt[dI]=bt[AI]=bt[xI]=bt[CI]=bt[RI]=bt[kI]=bt[mI]=bt[gI]=bt[tb]=bt[yI]=bt[vI]=bt[bI]=bt[wI]=bt[PI]=bt[II]=bt[OI]=bt[FI]=!0,bt[pI]=bt[eb]=bt[SI]=!1;function ba(e,t,n,r,i,o){var s,a=t&cI;if(n&&(s=i?n(e,r,i,o):n(e)),s!==void 0)return s;if(!ir(e))return e;var l=Gn(e);if(l)s=FP(e);else{var u=Xn(e),c=u==eb||u==hI;if(Co(e))return Nh(e,a);if(u==tb||u==Zv||c&&!i)s={};else{if(!bt[u])return i?e:{};s=nI(e,u,a)}}o||(o=new or);var d=o.get(e);if(d)return d;o.set(e,s),lI(e)?e.forEach(function(b){s.add(ba(b,t,n,b,e,o))}):oI(e)&&e.forEach(function(b,w){s.set(w,ba(b,t,n,w,e,o))});var p=Gv,m=l?void 0:p(e);return RP(m||e,function(b,w){m&&(w=b,b=e[w]),Gh(s,w,ba(b,t,n,w,e,o))}),s}function _I(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}function DI(e,t){return t.length<2?e:gm(e,_I(t,0,-1))}var NI=Object.prototype,LI=NI.hasOwnProperty;function $I(e,t){t=pc(t,e);var n=-1,r=t.length;if(!r)return!0;for(var i=e==null||typeof e!="object"&&typeof e!="function";++n<r;){var o=t[n];if(typeof o=="string"){if(o==="__proto__"&&!LI.call(e,"__proto__"))return!1;if(o==="constructor"&&n+1<r&&typeof t[n+1]=="string"&&t[n+1]==="prototype"){if(i&&n===0)continue;return!1}}}var s=DI(e,t);return s==null||delete s[mm(Jd(t))]}function MI(e){return Yl(e)?void 0:e}var nb=_n?_n.isConcatSpreadable:void 0;function BI(e){return Gn(e)||Ws(e)||!!(nb&&e&&e[nb])}function jI(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=BI),i||(i=[]);++o<s;){var a=e[o];n(a)?qf(i,a):i[i.length]=a}return i}function UI(e){var t=e==null?0:e.length;return t?jI(e):[]}function VI(e){return nm(tm(e,void 0,UI),e+"")}var qI=1,zI=2,WI=4,Hi=VI(function(e,t){var n={};if(e==null)return n;var r=!1;t=fm(t,function(o){return o=pc(o,e),r||(r=o.length>1),o}),Qh(e,Gv(e),n),r&&(n=ba(n,qI|zI|WI,MI));for(var i=t.length;i--;)$I(n,t[i]);return n});const HI=(e,t)=>{const n=(o="")=>o.split("/").filter(Boolean),r=n(e.path),i=n(t);return i.map((o,s)=>({id:Gt.v4(),allowContextActions:!0,text:o,to:{path:"/"+[...r].splice(0,r.length-i.length+s+1).join("/"),query:Hi(e.query,"fileId","page")},isStaticNav:!1}))},KI=(...e)=>{const t=e.pop();return[...e,{id:Gt.v4(),allowContextActions:t.allowContextActions,text:t.text,onClick:()=>Je.publish("app.files.list.load"),isTruncationPlaceholder:t.isTruncationPlaceholder,isStaticNav:t.isStaticNav}]};class jo{static Cut="cut";static Copy="copy"}const Gf=e=>e.clientY===0,Qf=(e,t,n)=>{if(!e)return;let r=n;r.$el&&(r=n.$el);const i=r.getBoundingClientRect(),o=Gf(t)?t.target?.getBoundingClientRect().top||0:t.clientY;e.setProps({getReferenceClientRect:()=>({width:0,height:0,top:o,bottom:o,left:t.type==="contextmenu"&&!Gf(t)?t.clientX:i.x,right:t.type==="contextmenu"&&!Gf(t)?t.clientX:i.x})}),e.show()},wa=e=>(e||"").split("_")[0],fi=(e,t,n=jt.DateTime.DATETIME_MED)=>e.setLocale(wa(t)).toLocaleString(n),rb=(e,t,n=jt.DateTime.DATETIME_MED)=>fi(jt.DateTime.fromJSDate(e),t,n),GI=(e,t,n=jt.DateTime.DATETIME_MED)=>fi(jt.DateTime.fromHTTP(e),t,n),ib=(e,t,n=jt.DateTime.DATETIME_MED)=>fi(jt.DateTime.fromISO(e),t,n),QI=(e,t,n=jt.DateTime.DATETIME_MED)=>fi(jt.DateTime.fromRFC2822(e),t,n),Uo=(e,t)=>e.setLocale(wa(t)).toRelative(),ob=(e,t)=>Uo(jt.DateTime.fromJSDate(e),t),XI=(e,t)=>Uo(jt.DateTime.fromHTTP(e),t),YI=(e,t)=>Uo(jt.DateTime.fromISO(e),t),JI=(e,t)=>Uo(jt.DateTime.fromRFC2822(e),t),ZI=1048576,bn=(e,t)=>{const n=typeof e=="string"?parseInt(e):e;return n<0?"--":isNaN(n)?"?":AS.filesize(n,{round:n<ZI?0:1,locale:wa(t),base:10,output:"string"})};function sb(e="",t=!1){const n=re.urlJoin(e,{leadingSlash:!0});if(n==="/")return[];const r=[],i=n.split("/");for(t&&r.push(n),i.pop();i.length>0;){if(!i.join("/")){i.pop();continue}r.push(i.join("/")),i.pop()}return r}var Ct=(e=>(e.open="sidebar.open",e.close="sidebar.close",e.toggle="sidebar.toggle",e.openWithPanel="sidebar.openWithPanel",e.setActivePanel="sidebar.setActivePanel",e))(Ct||{});const Xf=(e,t=void 0)=>{const n=window.localStorage.getItem(e),r=ae(t);if(n)try{r.value=JSON.parse(n)}catch{r.value=n}return ot(()=>f(r),(i,o)=>{i!==o&&(i!==void 0?window.localStorage.setItem(e,typeof i=="string"?i:JSON.stringify(i)):window.localStorage.removeItem(e))},{deep:!0}),r},Qr=()=>{const e=ut(),t=M(()=>e.options.embed?.enabled),n=M(()=>e.options.embed?.target==="location"),r=M(()=>e.options.embed?.chooseFileName),i=M(()=>e.options.embed?.chooseFileNameSuggestion),o=M(()=>e.options.embed?.target==="file"),s=M(()=>e.options.embed?.fileTypes),a=M(()=>e.options.embed?.messagesOrigin),l=M(()=>f(t)&&e.options.embed?.delegateAuthentication),u=M(()=>e.options.embed?.delegateAuthenticationOrigin);return{isEnabled:t,isLocationPicker:n,chooseFileName:r,chooseFileNameSuggestion:i,isFilePicker:o,messagesTargetOrigin:a,isDelegatingAuthentication:l,fileTypes:s,postMessage:(p,m)=>{const b={};f(a)&&(b.targetOrigin=f(a)),window.parent.postMessage({name:p,data:m},b)},verifyDelegatedAuthenticationOrigin:p=>f(u)?f(u)===p:!0}},Sa=e=>{const{isEnabled:t}=Qr(),n=e?.bus||Je,r=Xf("oc_sideBarOpen",!1),i=ae(!1),o=M({get(){return f(t)?f(i):f(r)},set(b){if(f(t)){i.value=b;return}r.value=b}}),s=async()=>{await Vt();const b=document.getElementById("app-sidebar");b&&b.focus()},a=ae(null),l=n.subscribe(Ct.toggle,()=>{o.value=!f(o),f(o)&&s()}),u=n.subscribe(Ct.close,()=>{o.value=!1,a.value=null}),c=n.subscribe(Ct.open,()=>{o.value=!0,a.value=null,s()}),d=n.subscribe(Ct.openWithPanel,b=>{o.value=!0,a.value=b,s()}),p=n.subscribe(Ct.setActivePanel,b=>{a.value=b});xn(()=>{n.unsubscribe(Ct.toggle,l),n.unsubscribe(Ct.close,u),n.unsubscribe(Ct.open,c),n.unsubscribe(Ct.openWithPanel,d),n.unsubscribe(Ct.setActivePanel,p)});const m=(b,w)=>{n.subscribe(Ct.setActivePanel,S=>{b===S&&setTimeout(()=>{w(S)},100)})};return{isSideBarOpen:nr(o),sideBarActivePanel:nr(a),onPanelActive:m}},Xt=e=>e,ab=e=>re.ShareTypes.containsAnyValue(re.ShareTypes.authenticated,e??[]),lb=e=>re.ShareTypes.containsAnyValue(re.ShareTypes.unauthenticated,e??[]),eO=({isDirect:e})=>Xt(e?"This item is directly shared with others.":"This item is shared with others through one of the parent folders."),tO=({isDirect:e})=>Xt(e?"This item is directly shared via links.":"This item is shared via links through one of the parent folders."),nO=({resource:e,isDirect:t,interceptModifierClick:n})=>({id:`files-sharing-${e.getDomSelector()}`,accessibleDescription:eO({isDirect:t}),label:Xt("Show invited people"),icon:"group",category:"sharing",type:t?"user-direct":"user-indirect",fillType:"line",handler:(r,i)=>{i&&n(i,r)||Je.publish(Ct.openWithPanel,"sharing#peopleShares")}}),rO=({resource:e})=>({id:`files-sharing-synced-${e.getDomSelector()}`,accessibleDescription:Xt("This item is synced with your devices"),label:Xt("Synced with your devices"),icon:"loop-right",category:"sharing",type:"resource-synced",fillType:"line"}),iO=({resource:e})=>e.shareRoles?.length?{id:`files-sharing-role-${e.getDomSelector()}`,accessibleDescription:Xt(e.shareRoles[0].description),label:Xt(e.shareRoles[0].displayName),icon:e.shareRoles[0].icon,category:"sharing",type:"share-role",fillType:"line"}:{id:`files-sharing-role-${e.getDomSelector()}`,accessibleDescription:re.ShareTypes.remote.label,label:re.ShareTypes.remote.label,icon:re.ShareTypes.remote.icon,category:"sharing",type:"share-role",fillType:"line"},oO=({resource:e,isDirect:t})=>({id:`file-link-${e.getDomSelector()}`,accessibleDescription:tO({isDirect:t}),label:Xt("Show links"),icon:"link",category:"sharing",type:t?"link-direct":"link-indirect",fillType:"line",handler:()=>{Je.publish(Ct.openWithPanel,"sharing#linkShares")}}),sO=({resource:e})=>({id:`resource-locked-${e.getDomSelector()}`,accessibleDescription:Xt("Item locked"),label:Xt("This item is locked"),icon:"lock",category:"system",type:"resource-locked",fillType:"line"}),aO=({resource:e})=>({id:`resource-processing-${e.getDomSelector()}`,accessibleDescription:Xt("Item in processing"),label:Xt("This item is in processing"),icon:"loop-right",category:"system",type:"resource-processing",fillType:"line"}),lO=({resource:e})=>({id:`resource-space-enabled-${e.getDomSelector()}`,accessibleDescription:Xt("Space is enabled"),label:Xt("This space is enabled"),icon:"play-circle",category:"space",type:"resource-space-enabled",fillType:"line"}),cO=({resource:e})=>({id:`resource-space-disabled-${e.getDomSelector()}`,accessibleDescription:Xt("Space is disabled"),label:Xt("This space is disabled"),icon:"stop-circle",category:"space",type:"resource-space-disabled",fillType:"line"}),cb=({space:e,resource:t,ancestorMetaData:n,user:r,interceptModifierClick:i})=>{const o=[];if(t.locked&&o.push(sO({resource:t})),t.processing&&o.push(aO({resource:t})),re.isProjectSpaceResource(t)&&!t.disabled&&o.push(lO({resource:t})),re.isProjectSpaceResource(t)&&t.disabled&&o.push(cO({resource:t})),re.isIncomingShareResource(t)&&(t.shareTypes.includes(re.ShareTypes.remote.value)||t.shareRoles?.length)&&o.push(iO({resource:t})),re.isIncomingShareResource(t)&&t.syncEnabled&&o.push(rO({resource:t})),re.isProjectSpaceResource(e)||re.isPersonalSpaceResource(e)&&e.isOwner(r)){const a=Object.values(n).reduce((c,d)=>(c.push(...d.shareTypes||[]),c),[]),l=ab(t.shareTypes);(l||ab(a))&&o.push(nO({resource:t,isDirect:l,interceptModifierClick:i}));const u=lb(t.shareTypes);(u||lb(a))&&o.push(oO({resource:t,isDirect:u}))}return o},ub=e=>new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=i=>n(i),r.readAsArrayBuffer(e)}),fb=e=>new Promise(t=>e.toBlob(t)),Vo=()=>window.navigator.platform.match("Mac");function di(e){return e.status==="fulfilled"}function pi(e){return e.status==="rejected"}const Yf=e=>new TextEncoder().encode(e).length,tt=Me.defineStore("messages",()=>{const e=ae([]),t=o=>{const s={...o,id:Gt.v4()};return e.value.push(s),s},n=o=>{const s=a=>a.response?.headers?.get("x-request-id");return o.map(a=>s(a)).filter(Boolean).map(a=>`X-Request-Id: ${a}`).join(`\r
41
- `)};return{messages:e,showMessage:t,showErrorMessage:o=>{const s={id:Gt.v4(),status:"danger",timeout:0,...o.errors&&{errorLogContent:n(o.errors)},...o};return e.value.push(s),s},removeMessage:o=>{e.value=f(e).filter(({id:s})=>o.id!==s)}}}),qo=Me.defineStore("clipboard",()=>{const{$gettext:e}=Oe.useGettext(),{showMessage:t}=tt(),n=ae(),r=ae([]);return{action:n,resources:r,copyResources:a=>{a[0]?.canDownload()&&(n.value=jo.Copy,r.value=a,t({title:e("Copied to clipboard!"),status:"success"}))},cutResources:a=>{a[0]?.canDownload()&&(n.value=jo.Cut,r.value=a,t({title:e("Cut to clipboard!"),status:"success"}))},clearClipboard:()=>{n.value=void 0,r.value=[]}}}),db={cernFeatures:!1,concurrentRequests:{resourceBatchActions:4,shares:{create:4,list:2},sse:4,avatars:4},contextHelpers:!0,contextHelpersReadMore:!0,defaultAppId:"files",disabledExtensions:[],disableFeedbackLink:!1,editor:{autosaveEnabled:!0,autosaveInterval:120},embed:{enabled:!1,target:"resources"},ocm:{openRemotely:!1},routing:{idBased:!0,fullShareOwnerPaths:!1},runningOnEos:!1,tokenStorageLocal:!0,userListRequiresFilter:!1,hideLogo:!1},ut=Me.defineStore("config",()=>{const e=lr(),t=ae(""),n=ae(""),r=ae({...db}),i=ae([]),o=ae([]),s=ae([]),a=ae(),l=ae(),u=ae(),c=ae([]),d=ae([]),p=M(()=>re.urlJoin(f(t)||window.location.origin,{trailingSlash:!0})),m=M(()=>re.urlJoin(f(p),"groupware",{trailingSlash:!0})),b=M(()=>!!f(a)),w=M(()=>!!f(l));return{options:r,oAuth2:a,openIdConnect:l,isOAuth2:b,isOIDC:w,customTranslations:s,apps:i,externalApps:o,sentry:u,theme:n,scripts:c,styles:d,serverUrl:p,groupwareUrl:m,loadConfig:y=>{y.server&&(t.value=y.server?.endsWith("/")?y.server:y.server+"/"),i.value=y.apps||[],s.value=y.customTranslations||[],a.value=y.auth,l.value=y.openIdConnect,u.value=y.sentry,c.value=y.scripts||[],d.value=y.styles||[],n.value=y.theme,y.options&&(r.value=ko({...db},y.options),f(r).ocm.openRemotely=f(r).cernFeatures,f(r).routing.idBased=!f(r).cernFeatures,f(r).routing.fullShareOwnerPaths=f(r).cernFeatures),y.external_apps&&(o.value=y.external_apps,y.external_apps.filter(Boolean).forEach(g=>{e.loadExternalAppConfig({appId:g.id,config:g.config})}))}}}),uO=fe.z.object({url:fe.z.string()}),fO=fe.z.object({apiUrl:fe.z.string().optional(),authUrl:fe.z.string().optional(),clientId:fe.z.string().optional(),clientSecret:fe.z.string().optional(),logoutUrl:fe.z.string().optional(),metaDataUrl:fe.z.string().optional(),url:fe.z.string().optional()}),dO=fe.z.object({authority:fe.z.string().optional(),client_id:fe.z.string().optional(),client_secret:fe.z.string().optional(),dynamic:fe.z.string().optional(),metadata_url:fe.z.string().optional(),post_logout_redirect_uri:fe.z.string().optional(),response_type:fe.z.string().optional(),scope:fe.z.string().optional()}).passthrough(),pO=fe.z.record(fe.z.any(),fe.z.any()),hO=fe.z.object({href:fe.z.string().optional()}),mO=fe.z.object({async:fe.z.boolean().optional(),src:fe.z.string().optional()}),gO=fe.z.object({cernFeatures:fe.z.boolean().optional(),concurrentRequests:fe.z.object({resourceBatchActions:fe.z.number().optional(),sse:fe.z.number().optional(),shares:fe.z.object({create:fe.z.number().optional(),list:fe.z.number().optional()}).optional(),avatars:fe.z.number().optional()}).optional(),contextHelpers:fe.z.boolean().optional(),contextHelpersReadMore:fe.z.boolean().optional(),defaultAppId:fe.z.string().optional(),disabledExtensions:fe.z.array(fe.z.string()).optional(),disableFeedbackLink:fe.z.boolean().optional(),accountEditLink:fe.z.object({href:fe.z.string().optional()}).optional(),editor:fe.z.object({autosaveEnabled:fe.z.boolean().optional(),autosaveInterval:fe.z.number().optional(),openAsPreview:fe.z.union([fe.z.boolean(),fe.z.array(fe.z.string())]).optional()}).optional(),embed:fe.z.object({enabled:fe.z.boolean().optional(),target:fe.z.string().optional(),messagesOrigin:fe.z.string().optional(),delegateAuthentication:fe.z.boolean().optional(),delegateAuthenticationOrigin:fe.z.string().optional(),fileTypes:fe.z.array(fe.z.string()).optional(),chooseFileName:fe.z.boolean().optional(),chooseFileNameSuggestion:fe.z.string().optional()}).optional(),feedbackLink:fe.z.object({ariaLabel:fe.z.string().optional(),description:fe.z.string().optional(),href:fe.z.string().optional()}).optional(),isRunningOnEos:fe.z.boolean().optional(),loginUrl:fe.z.string().optional(),logoutUrl:fe.z.string().optional(),ocm:fe.z.object({openRemotely:fe.z.boolean().optional()}).optional(),routing:fe.z.object({fullShareOwnerPaths:fe.z.boolean().optional(),idBased:fe.z.boolean().optional()}).optional(),runningOnEos:fe.z.boolean().optional(),tokenStorageLocal:fe.z.boolean().optional(),upload:fe.z.object({companionUrl:fe.z.string().optional()}).optional(),userListRequiresFilter:fe.z.boolean().optional(),hideLogo:fe.z.boolean().optional()}),yO=fe.z.object({id:fe.z.string(),path:fe.z.string(),config:fe.z.record(fe.z.string(),fe.z.unknown()).optional()}),vO=fe.z.object({server:fe.z.string(),theme:fe.z.string(),options:gO,apps:fe.z.array(fe.z.string()).optional(),external_apps:fe.z.array(yO).optional(),customTranslations:fe.z.array(uO).optional(),auth:fO.optional(),openIdConnect:dO.optional(),sentry:pO.optional(),scripts:fe.z.array(mO).optional(),styles:fe.z.array(hO).optional()}),pb=Me.defineStore("extensionPreferences",()=>{const e=Vn.useLocalStorage("extensionPreferences",{});return{extensionPreferences:e,extractDefaultExtensionIds:(i,o)=>i.multiple?o.map(s=>s.id):i.defaultExtensionId?[i.defaultExtensionId]:[],getExtensionPreference:(i,o)=>{const s=e.value[i];return s||{extensionPointId:i,selectedExtensionIds:o}},setSelectedExtensionIds:(i,o)=>{if(!Object.hasOwn(f(e),i)){e.value[i]={extensionPointId:i,selectedExtensionIds:o};return}e.value[i].selectedExtensionIds=o}}}),Ki=Me.defineStore("extensionRegistry",()=>{const e=ut(),t=ae([]),n=u=>{t.value.push(u)},r=u=>{t.value=f(t).map(c=>ae(f(c).filter(({id:d})=>!u.includes(d)))).filter(c=>f(c).length)},i=u=>{if(!u.id||!u.extensionType)throw new Error("ExtensionPoint must have an id and an extensionType");return f(t).flatMap(c=>f(c).filter(d=>d.type===u.extensionType&&!e.options.disabledExtensions.includes(d.id)&&(!d.extensionPointIds||d.extensionPointIds?.includes(u.id))))},o=ae([]);return{extensions:t,registerExtensions:n,unregisterExtensions:r,requestExtensions:i,extensionPoints:o,registerExtensionPoints:u=>{o.value.push(u)},unregisterExtensionPoints:u=>{o.value=f(o).map(c=>ae(f(c).filter(({id:d})=>!u.includes(d)))).filter(c=>f(c).length)},getExtensionPoints:(u={})=>f(o).flatMap(c=>f(c).filter(d=>!(Object.hasOwn(u,"extensionType")&&d.extensionType!==u.extensionType)))}}),ft=Me.defineStore("modals",()=>{const e=ae([]),t=M(()=>f(e).at(-1)),n=l=>f(e).find(u=>u.id===l);return{modals:e,activeModal:t,dispatchModal:l=>{const u={...l,id:Gt.v4()};return e.value.push(u),u},updateModal:(l,u,c)=>{const d=n(l);d[u]=c},removeModal:l=>{e.value=f(e).filter(u=>u.id!==l)},removeAllModals:()=>{e.value=[]},setModalActive:l=>{const u=f(e).findIndex(d=>d.id===l);if(u<0)return;const c=n(l);f(e).splice(u,1),e.value.push(c)}}}),gt=Me.defineStore("user",()=>{const e=ae();return{user:e,setUser:r=>{e.value=r,IS.setUser({username:r.onPremisesSamAccountName})},reset:()=>{e.value=null}}}),Ea=(e,t)=>{t!==void 0&&document.querySelector(":root").style.setProperty("--oc-"+e,t)},bO="thead-clicked",wO="highlight",SO="rowMounted",EO="contextmenuClicked",hb="itemDropped",TO="itemDragged";let AO="";const xO=()=>AO,CO=e=>({"gap-0":e==="none","gap-0.5":e==="xsmall","gap-1":e==="small","gap-2":e==="medium","gap-4":e==="large","gap-5":e==="xlarge","gap-6":e==="xxlarge","gap-7":e==="xxxlarge"}),RO=e=>({"justify-start":e==="left","justify-center":e==="center","justify-end":e==="right","justify-around":e==="space-around","justify-between":e==="space-between","justify-evenly":e==="space-evenly"}),kO=e=>({"p-0":e==="remove","p-1":e==="xsmall","p-2":e==="small","p-4":e==="medium","p-6":e==="large","p-12":e==="xlarge","p-24":e==="xxlarge"});var Gi=(e=>(e.Desc="desc",e.Asc="asc",e))(Gi||{});let mb=0;const hi=(e="")=>(e=e||"",mb+=1,e+mb);function PO(e,t,n,r){for(var i=-1,o=e==null?0:e.length;++i<o;)n=t(n,e[i],i,e);return n}function IO(e){return function(t){return e?.[t]}}var OO={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},FO=IO(OO),_O=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,DO="\\u0300-\\u036f",NO="\\ufe20-\\ufe2f",LO="\\u20d0-\\u20ff",$O=DO+NO+LO,MO="["+$O+"]",BO=RegExp(MO,"g");function jO(e){return e=dc(e),e&&e.replace(_O,FO).replace(BO,"")}var UO=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function VO(e){return e.match(UO)||[]}var qO=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function zO(e){return qO.test(e)}var gb="\\ud800-\\udfff",WO="\\u0300-\\u036f",HO="\\ufe20-\\ufe2f",KO="\\u20d0-\\u20ff",GO=WO+HO+KO,yb="\\u2700-\\u27bf",vb="a-z\\xdf-\\xf6\\xf8-\\xff",QO="\\xac\\xb1\\xd7\\xf7",XO="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",YO="\\u2000-\\u206f",JO=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",bb="A-Z\\xc0-\\xd6\\xd8-\\xde",ZO="\\ufe0e\\ufe0f",wb=QO+XO+YO+JO,Sb="['’]",Eb="["+wb+"]",eF="["+GO+"]",Tb="\\d+",tF="["+yb+"]",Ab="["+vb+"]",xb="[^"+gb+wb+Tb+yb+vb+bb+"]",nF="\\ud83c[\\udffb-\\udfff]",rF="(?:"+eF+"|"+nF+")",iF="[^"+gb+"]",Cb="(?:\\ud83c[\\udde6-\\uddff]){2}",Rb="[\\ud800-\\udbff][\\udc00-\\udfff]",Qi="["+bb+"]",oF="\\u200d",kb="(?:"+Ab+"|"+xb+")",sF="(?:"+Qi+"|"+xb+")",Pb="(?:"+Sb+"(?:d|ll|m|re|s|t|ve))?",Ib="(?:"+Sb+"(?:D|LL|M|RE|S|T|VE))?",Ob=rF+"?",Fb="["+ZO+"]?",aF="(?:"+oF+"(?:"+[iF,Cb,Rb].join("|")+")"+Fb+Ob+")*",lF="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",cF="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",uF=Fb+Ob+aF,fF="(?:"+[tF,Cb,Rb].join("|")+")"+uF,dF=RegExp([Qi+"?"+Ab+"+"+Pb+"(?="+[Eb,Qi,"$"].join("|")+")",sF+"+"+Ib+"(?="+[Eb,Qi+kb,"$"].join("|")+")",Qi+"?"+kb+"+"+Pb,Qi+"+"+Ib,cF,lF,Tb,fF].join("|"),"g");function pF(e){return e.match(dF)||[]}function hF(e,t,n){return e=dc(e),t=t,t===void 0?zO(e)?pF(e):VO(e):e.match(t)||[]}var mF="['’]",gF=RegExp(mF,"g");function yF(e){return function(t){return PO(hF(jO(t).replace(gF,"")),e,"")}}var _b=yF(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const Db=fe.z.object({name:fe.z.string().optional(),slogan:fe.z.string().optional(),logo:fe.z.string().optional(),logoMobile:fe.z.string().optional(),urls:fe.z.object({accessDeniedHelp:fe.z.string().optional(),imprint:fe.z.string().optional(),privacy:fe.z.string().optional(),accessibility:fe.z.string().optional()}).optional(),shareRoles:fe.z.record(fe.z.string(),fe.z.object({iconName:fe.z.string()})).optional()}),vF=fe.z.object({roles:fe.z.record(fe.z.string(),fe.z.string()).optional(),colorPalette:fe.z.record(fe.z.string(),fe.z.string()).optional(),fontFamily:fe.z.string().optional()}),Nb=Db.extend({designTokens:vF.optional(),favicon:fe.z.string().optional(),background:fe.z.string().optional()}),bF=Nb.extend({isDark:fe.z.boolean(),label:fe.z.string()}),Lb=fe.z.object({defaults:Nb,themes:fe.z.array(bF)}),wF=fe.z.object({common:Db.optional(),clients:fe.z.object({web:Lb})}),SF="oc_currentThemeName",EF=e=>{let t=document.querySelector("link[rel~='icon']");t||(t=document.createElement("link"),t.rel="icon",document.head.appendChild(t)),t.href=e},ur=Me.defineStore("theme",()=>{const e=Vn.useLocalStorage(SF,null),t=Vn.usePreferredDark(),n=ae(),r=ae([]),i=c=>{const d=c.common,p=c.clients.web.defaults,m=Qd(d,p);r.value=c.clients.web.themes.map(b=>Qd(m,b)),o()},o=()=>{const c=f(r).find(p=>!p.isDark),d=f(r).find(p=>p.isDark);l(f(r).find(p=>p.label===f(e))||(f(t)?d:c)||f(r)[0],!1)},s=()=>{e.value=null,o()},a=M(()=>e.value===null),l=(c,d=!0)=>{n.value=c,d&&(e.value=f(n).label);const p=[{name:"roles",prefix:"role"},{name:"colorPalette",prefix:"color"}];Ea("font-family",f(n).designTokens.fontFamily),p.forEach(m=>{for(const b in f(n).designTokens[m.name])Ea(`${m.prefix}-${_b(b)}`,f(n).designTokens[m.name][b])}),f(n).designTokens?.roles?.chrome||(Ea("role-chrome",f(n).designTokens?.roles?.surfaceContainer),Ea("role-on-chrome",f(n).designTokens?.roles?.onSurface)),f(n).favicon&&EF(f(n).favicon)};return{availableThemes:r,currentTheme:n,initializeThemes:i,setAndApplyTheme:l,setAutoSystemTheme:s,isCurrentThemeAutoSystem:a,getRoleIcon:c=>f(n).shareRoles[c.id]?.iconName||"user"}}),kr=Me.defineStore("shares",()=>{const e=We(),{getRoleIcon:t}=ur(),n=ae(!1),r=ae([]),i=ae([]),o=ae({}),s=C=>{o.value=C.reduce((A,D)=>(A[D.id]={...D,icon:t(D)},A),{})},a=C=>{const A=f(r).find(({id:D})=>D===C.id);if(A){Object.assign(A,C);return}f(r).push(C)},l=C=>{r.value=C},u=C=>{f(r).push(...C)},c=C=>{r.value=f(r).filter(({id:A})=>A!==C.id)},d=()=>{r.value=[],i.value=[],n.value=void 0},p=()=>{const C=Object.values(e.ancestorMetaData).map(({id:A})=>A);if(!C.length){r.value=[],i.value=[];return}f(r).forEach(A=>{C.includes(A.resourceId)||c(A)}),f(i).forEach(A=>{C.includes(A.resourceId)||w(A)})},m=C=>{i.value=C},b=C=>{const A=f(i).find(({id:D})=>D===C.id);if(A){Object.assign(A,C);return}f(i).push(C)},w=C=>{i.value=f(i).filter(({id:A})=>A!==C.id)},S=C=>{n.value=C},y=C=>{const A=N=>{const W=new Set;return N.forEach(L=>{W.add(L.shareType)}),Array.from(W)},D=[...e.resources,e.currentFolder].find(N=>N?.id===C);if(!D||re.isProjectSpaceResource(D))return;const V=[...f(r),...f(i)];e.updateResourceField({id:D.id,field:"shareTypes",value:A(V.filter(N=>!N.indirect))});const O=e.getAncestorById(C);O&&e.updateAncestorField({path:O.path,field:"shareTypes",value:A(V.filter(N=>!N.indirect))})};return{loading:n,collaboratorShares:r,linkShares:i,graphRoles:o,setGraphRoles:s,setLoading:S,setCollaboratorShares:l,setLinkShares:m,removeOrphanedShares:p,pruneShares:d,addShare:async({clientService:C,space:A,resource:D,options:V})=>{const N=await C.graphAuthenticated.permissions.createInvite(A.id,D.id,V,f(o));return u([N]),y(D.id),N},updateShare:async({clientService:C,space:A,resource:D,collaboratorShare:V,options:O})=>{const N=C.graphAuthenticated.permissions,W={roles:O.roles,expirationDateTime:O.expirationDateTime},L=await N.updatePermission(A.id,D.id,V.id,W,f(o));return a(L),L},deleteShare:async({clientService:C,space:A,resource:D,collaboratorShare:V})=>{await C.graphAuthenticated.permissions.deletePermission(A.id,D.id,V.id),c(V),y(D.id)},addLink:async({clientService:C,space:A,resource:D,options:V})=>{const N=await C.graphAuthenticated.permissions.createLink(A.id,D.id,V),W=e.selectedResources,L=W.some(({fileId:ee})=>ee===D.fileId)||W.length===0&&e.currentFolder.fileId===D.fileId;if(b(N),y(D.id),!L){const ee=e.ancestorMetaData[D.path]??null;if(ee){const{shareTypes:J}=ee;J.includes(re.ShareTypes.link.value)||e.updateAncestorField({path:ee.path,field:"shareTypes",value:[...J,re.ShareTypes.link.value]})}}return N},updateLink:async({clientService:C,space:A,resource:D,linkShare:V,options:O})=>{const N=C.graphAuthenticated.permissions;let W;if(Object.hasOwn(O,"password"))W=await N.setPermissionPassword(A.id,D.id,V.id,{password:O.password}),V.hasPassword=!!O.password;else{const L={link:{...O.type&&{type:O.type},...O.displayName&&{"@libre.graph.displayName":O.displayName}},...Object.hasOwn(O,"expirationDateTime")&&{expirationDateTime:O.expirationDateTime}};W=await N.updatePermission(A.id,D.id,V.id,L)}return b(W),W},deleteLink:async({clientService:C,space:A,resource:D,linkShare:V})=>{await C.graphAuthenticated.permissions.deletePermission(A.id,D.id,V.id),w(V),y(D.id)}}}),wn={View:"view",Upload:"upload",Edit:"edit",CreateOnly:"createOnly"},$b={LibreGraphPermissionsActionsAllowedValues:"@libre.graph.permissions.actions.allowedValues",LibreGraphPermissionsRolesAllowedValues:"@libre.graph.permissions.roles.allowedValues"},Mb=e=>e.sort((t,n)=>n.permissions.length-t.permissions.length),zo=async({graphClient:e,driveType:t,configStore:n,signal:r})=>{const i=await e.drives.listMyDrives({orderBy:"name asc",filter:`driveType eq ${t}`},{signal:r});if(!i.length)return[];if(t!=="mountpoint"||!n.options.routing?.fullShareOwnerPaths)return i;const o={};i.forEach(a=>{const{rootId:l,driveAlias:u}=a.root.remoteItem;o[l]=u});const s=Object.entries(o).map(([a,l])=>re.buildSpace({id:re.extractStorageId(a),name:l,driveType:l.split("/")[0],driveAlias:l,path:"/",serverUrl:n.serverUrl}));return[...i,...s]},st=Me.defineStore("spaces",()=>{const e=gt(),t=ut(),n=kr(),r=ae([]),i=ae(),o=ae(!1),s=ae(!1),a=ae(!1),l=ae(null),u=ae([]),c=ae([]),d=M(()=>f(r).find(oe=>re.isPersonalSpaceResource(oe)&&oe.isOwner(e.user))),p=oe=>{o.value=oe},m=oe=>{s.value=oe},b=oe=>{a.value=oe},w=oe=>{i.value=oe},S=oe=>{l.value=oe},y=oe=>{if(!re.isProjectSpaceResource(oe))return[];const we=n.collaboratorShares.filter(X=>X.resourceId===oe.id);return Mb(we)},g=oe=>{f(r).push(...oe)},v=oe=>{r.value=f(r).filter(({id:we})=>we!==oe.id)},h=oe=>f(r).find(we=>oe==we.id),E=async({graphClient:oe,space:we,signal:X})=>(await D({graphClient:oe,signal:X}),f(r).find(ie=>re.isMountPointSpaceResource(ie)&&ie.root?.remoteItem?.id===we.id)),T=({driveAliasPrefix:oe,id:we,shareName:X})=>{const ie=re.buildShareSpaceResource({driveAliasPrefix:oe,id:we,shareName:X,serverUrl:t.serverUrl});return g([ie]),ie},R=oe=>{const we=f(r).find(({id:X})=>X===oe.id);if(we){Object.assign(we,oe);return}g([oe])},C=({id:oe,field:we,value:X})=>{const ie=f(r).find(le=>oe===le.id);ie&&(ie[we]=X)},A=async({graphClient:oe})=>{a.value=!0;try{const[we,X]=await Promise.all([zo({graphClient:oe,driveType:"personal",configStore:t}),zo({graphClient:oe,driveType:"project",configStore:t})]);g([...we,...X])}finally{a.value=!1}},D=async({graphClient:oe,signal:we})=>{if(!f(s))try{const X=await zo({graphClient:oe,driveType:"mountpoint",configStore:t,signal:we});g(X)}finally{s.value=!0}},V=async({graphClient:oe,signal:we})=>{const X=await zo({graphClient:oe,driveType:"project",configStore:t,signal:we});r.value=f(r).filter(ie=>!re.isProjectSpaceResource(ie)),g(X)},O=oe=>{f(u).includes(oe)||f(u).push(oe)},N=oe=>{u.value=f(u).filter(we=>we!==oe)},W=()=>{u.value=[]},L=oe=>{f(c).includes(oe)||f(c).push(oe)},ee=oe=>{c.value=f(c).filter(we=>we!==oe)},J=()=>{c.value=[]},se=ae({});return{spaces:r,spacesInitialized:o,mountPointsInitialized:s,spacesLoading:a,currentSpace:i,personalSpace:d,defaultSpaceImageBlobURL:l,imagesLoading:u,readmesLoading:c,getSpace:h,createShareSpace:T,setSpacesInitialized:p,setMountPointsInitialized:m,setSpacesLoading:b,setCurrentSpace:w,setDefaultSpaceImageBlobURL:S,getSpaceMembers:y,getMountPointForSpace:E,addSpaces:g,removeSpace:v,upsertSpace:R,updateSpaceField:C,loadSpaces:A,loadMountPoints:D,reloadProjectSpaces:V,addToImagesLoading:O,removeFromImagesLoading:N,purgeImagesLoading:W,addToReadmesLoading:L,removeFromReadmesLoading:ee,purgeReadmesLoading:J,loadGraphPermissions:async({ids:oe,graphClient:we,useCache:X=!0})=>{const ie=f(r).filter(le=>oe.includes(le.id)&&(le.graphPermissions===void 0||!X));if(ie.length){for(const{id:le,disabled:Ae}of ie){if(Ae){C({id:le,field:"graphPermissions",value:[]});continue}f(se)[le]||(se.value[le]=we.permissions.listPermissions(le,le,n.graphRoles,{select:[$b.LibreGraphPermissionsActionsAllowedValues]}).then(({allowedActions:te})=>{C({id:le,field:"graphPermissions",value:te}),delete se.value[le]}))}await Promise.all(Object.values(f(se)))}}}}),We=Me.defineStore("resources",()=>{const e=ut(),t=st(),n=gt(),r=ae([]),i=ae(),o=ae({}),s=ae([]),a=M(()=>{let x=f(r);return f(O)||(x=x.filter(G=>!G.name.startsWith("."))),x}),l=M(()=>{const x=f(r).filter(({type:ge})=>ge==="file").length,G=f(r).filter(({type:ge,name:Re})=>ge==="file"&&Re.startsWith(".")).length,H=f(r).filter(({type:ge})=>ge==="folder").length,B=f(r).filter(({type:ge,name:Re})=>ge==="folder"&&Re.startsWith(".")).length,z=f(r).filter(re.isProjectSpaceResource).length;return{files:x,hiddenFiles:G,folders:H,hiddenFolders:B,spaces:z}}),u=x=>{r.value=x},c=x=>{r.value=f(r).filter(G=>!x.find(({id:H})=>H===G.id))},d=()=>{r.value=[]},p=x=>{const G=f(r).find(({id:H})=>H===x.id);if(G){Object.assign(G,x);return}f(r).push(x)},m=x=>{const G=f(r).filter(H=>!x.some(B=>B.path===H.path));r.value=[...G,...x]},b=({id:x,field:G,value:H})=>{const B=f(r).find(z=>x===z.id);B&&(B[G]=H)},w=x=>{i.value=x},S=()=>{i.value=void 0},y=x=>{r.value=x.resources,i.value=x.currentFolder},g=()=>{r.value=[],i.value=void 0,v.value=[]},v=ae([]),h=ae(null),E=M(()=>f(r).filter(x=>f(v).includes(x.id))),T=x=>{const G=x.find(H=>!f(v).includes(H));G&&(h.value=G),v.value=x},R=x=>{h.value=x,f(v).includes(x)||f(v).push(x)},C=x=>{h.value=x,f(v).includes(x)&&(v.value=f(v).filter(G=>G!==x))},A=x=>{f(v).includes(x)?C(x):R(x)},D=()=>{v.value=[]},V=x=>{h.value=x},O=ae(!0),N=ae(!0),W=ae(!1),L=ae(!0),ee=ae(!0),J=x=>{O.value=x,window.localStorage.setItem("oc_hiddenFilesShown",x.toString())},se=x=>{N.value=x,window.localStorage.setItem("oc_fileExtensionsShown",x.toString())},he=x=>{W.value=x,window.localStorage.setItem("oc_webDavDetailsShown",x.toString())},oe=x=>{L.value=x,window.localStorage.setItem("oc_disabledSpacesShown",x.toString())},we=x=>{ee.value=x,window.localStorage.setItem("oc_emptyTrashesShown",x.toString())},X=x=>{o.value=x};return{resources:r,currentFolder:i,activeResources:a,totalResourcesCount:l,setResources:u,removeResources:c,clearResources:d,upsertResource:p,upsertResources:m,updateResourceField:b,setCurrentFolder:w,clearCurrentFolder:S,initResourceList:y,clearResourceList:g,selectedIds:v,latestSelectedId:h,selectedResources:E,setSelection:T,addSelection:R,removeSelection:C,toggleSelection:A,resetSelection:D,setLastSelectedId:V,areHiddenFilesShown:O,areFileExtensionsShown:N,areWebDavDetailsShown:W,areDisabledSpacesShown:L,areEmptyTrashesShown:ee,setAreHiddenFilesShown:J,setAreFileExtensionsShown:se,setAreWebDavDetailsShown:he,setAreDisabledSpacesShown:oe,setAreEmptyTrashesShown:we,ancestorMetaData:o,setAncestorMetaData:X,updateAncestorField:({path:x,field:G,value:H})=>{const B=f(o)[x]??null;B&&(B[G]=H)},loadAncestorMetaData:({folder:x,space:G,client:H,signal:B})=>{const z={[x.path]:{id:x.fileId,shareTypes:x.shareTypes,parentFolderId:x.parentFolderId,spaceId:G.id,path:x.path}},ge=[],Re=[qe.FileId,qe.ShareTypes,qe.FileParent],De=sb(x.path),Ce=t.spaces,Ie=()=>Ce.filter(ye=>re.isMountPointSpaceResource(ye)&&re.extractStorageId(ye.root.remoteItem.rootId)===G.id);let $e=!0;if(e.options.routing.fullShareOwnerPaths){const ye=Ce.some(Ke=>re.isProjectSpaceResource(Ke)&&Ke.id===G.id);$e=G.isOwner(n.user)||ye}for(const ye of De){const Ke=f(o)[ye]??null;if(Ke?.spaceId===G.id){z[ye]=Ke;continue}if(!$e&&!Ie().find(Ge=>ye.startsWith(Ge.root.remoteItem.path)))break;ge.push(H.listFiles(G,{path:ye},{depth:0,davProperties:Re,signal:B}).then(({resource:Ge})=>{z[ye]={id:Ge.fileId,shareTypes:Ge.shareTypes,parentFolderId:Ge.parentFolderId,spaceId:G.id,path:ye}}))}return Promise.all(ge).then(()=>{if(!Object.keys(z).includes("/")){const ye=f(o)["/"];if(ye?.spaceId===G.id)z["/"]=ye;else{const{parentFolderId:Ke}=Object.values(z)[0],Ge=t.spaces.find(({id:Ye})=>Ke.startsWith(Ye));Ge&&(z["/"]={id:Ge.id,shareTypes:Ge.shareTypes,parentFolderId:Ge.id,spaceId:Ge.id,path:"/"})}}X(z)})},getAncestorById:x=>Object.values(f(o)).find(G=>x===G.id),deleteQueue:s,addResourcesIntoDeleteQueue:x=>{s.value=s.value.concat(x.filter(G=>!f(s).includes(G)))},removeResourcesFromDeleteQueue:x=>{s.value=s.value.filter(G=>!x.includes(G))}}}),Wo=Me.defineStore("webWorkers",()=>{const e=ae([]);return{createWorker:(o,{needsTokenRenewal:s=!1}={})=>{const a=Gt.v4(),l=Vn.useWebWorker(o,{type:"module",name:a}),u={id:a,needsTokenRenewal:s,...l};return f(e).push(u),u},terminateWorker:o=>{const s=f(e).find(a=>o===a.id);s&&(s.terminate(),e.value=f(e).filter(a=>o!==a.id))},terminateAllWorkers:()=>{f(e).forEach(({terminate:o})=>{o()}),e.value=[]},updateAccessTokens:o=>{f(e).filter(({needsTokenRenewal:s})=>s).forEach(({post:s})=>{s(JSON.stringify({topic:"tokenUpdate",data:{accessToken:`Bearer ${o}`}}))})}}}),Ta=Me.defineStore("avatars",()=>{const e=ut(),t=ae({}),n=bp(new Lr({concurrency:e.options.concurrentRequests.avatars}));return{avatarMap:t,getAvatar:l=>f(t)[l],addAvatar:(l,u)=>{t.value[l]=u},removeAvatar:l=>{t.value[l]=null},reset:()=>{t.value={}},avatarsQueue:n,pendingAvatarsRequests:new Map}}),Bb=Me.defineStore("updates",()=>{const e=ae(!0),t=ae(!1),n=ae();return{updates:n,isLoading:e,hasError:t,setUpdates:s=>{n.value=s},setHasError:s=>{t.value=s},setIsLoading:s=>{e.value=s}}}),TF=Me.defineStore("groupwareConfig",()=>{const e=ae(""),t=ae([]),n=ae(),r=ae([]),i=ae({});return{version:e,capabilities:t,limits:n,accounts:r,primaryAccounts:i,loadGroupwareConfig:s=>{e.value=s.version,t.value=s.capabilities||[],n.value=s.limits,r.value=s.accounts||[],i.value=s.primaryAccounts||{}}}}),jb=fe.z.object({maxMailboxDepth:fe.z.number(),maxSizeMailboxName:fe.z.number(),maxMailboxesPerEmail:fe.z.number(),maxSizeAttachmentsPerEmail:fe.z.number(),mayCreateTopLevelMailbox:fe.z.boolean(),maxDelayedSend:fe.z.number()}),Ub=fe.z.object({maxSizeScriptName:fe.z.number(),maxSizeScript:fe.z.number(),maxNumberScripts:fe.z.number(),maxNumberRedirects:fe.z.number()}),Vb=fe.z.object({mail:jb.optional(),sieve:Ub.optional()}),qb=fe.z.object({id:fe.z.string(),name:fe.z.string(),email:fe.z.string().email(),mayDelete:fe.z.boolean()}),zb=fe.z.object({accountId:fe.z.string(),name:fe.z.string(),isPersonal:fe.z.boolean(),isReadOnly:fe.z.boolean(),capabilities:Vb,identities:fe.z.array(qb)}),Wb=fe.z.object({maxSizeUpload:fe.z.number(),maxConcurrentUpload:fe.z.number(),maxSizeRequest:fe.z.number(),maxConcurrentRequests:fe.z.number()}),Hb=fe.z.array(zb),Kb=fe.z.record(fe.z.string(),fe.z.string()),AF=fe.z.object({version:fe.z.string(),capabilities:fe.z.array(fe.z.string()),limits:Wb,accounts:Hb,primaryAccounts:Kb}),Aa=(e={})=>{const t=e.router||ze(),n=e.configStore||ut();return{replaceInvalidFileRoute:({space:i,resource:o,path:s,fileId:a})=>{if(!n.options.routing?.idBased||s===o.path&&a===o.fileId)return!1;const l=ar(i,o,{configStore:n});return t.replace(l),!0}}},Jf=()=>{const e=zt();return M(()=>f(e).name)},Gb=(e,t)=>{const n=zt();return M(()=>f(n).meta[e]||t)},xa=(e,t)=>{const n=ze();return M({get(){return Rt(f(n.currentRoute).params[e])||t},async set(r){f(n.currentRoute).params[e]!==r&&await n.replace({params:{...f(n.currentRoute).params,[e]:r}})}})};let Qb=Promise.resolve();const en=(e,t)=>{const n=ze();return M({get(){return f(n.currentRoute).query[e]||t},set(r){if(f(n.currentRoute).query[e]===r)return;Qb=Qb.then(async()=>{try{await n.replace({path:f(n.currentRoute).path,query:{...f(n.currentRoute).query,[e]:r}})}catch{}})}})},Pr=e=>{const t=en(e.name),n=Xf(xF(e));return ot(()=>f(t)?{value:f(t),source:"route"}:f(n)?{value:f(n),source:"storage"}:{value:e.defaultValue,source:"default"},r=>{["route","default"].includes(r.source)&&(n.value=r.value===e.defaultValue?void 0:Rt(r.value)),["storage","default"].includes(r.source)&&(t.value=r.value)},{immediate:!0}),t},xF=e=>["oc-options",e.storagePrefix,e.name].filter(Boolean).join("_"),Yn=(e,...t)=>{const n=ae(!1),r=ze(),i=zt();return ot(i,()=>{n.value=e(r,...t)},{immediate:!0}),n},Ca="contextRouteName",Zf="contextRouteParams",ed="contextRouteQuery",Ra=e=>{const{params:t,query:n}=e,r={},i=["fileId","shareId","q_share-visibility","page"].concat(e.meta?.contextQueryItems||[]);for(const o of i)r[o]=n[o];return{[Ca]:e.name,[Zf]:t,[ed]:r}},Xb=e=>({routeName:Rt(e[Ca]),routeParams:e[Zf],routeQuery:e[ed]}),Rt=e=>Array.isArray(e)?e[0].toString():e?.toString();function Yb({router:e,currentFileContext:t}){const n=a=>{const{fileName:l,routeName:u,routeParams:c,routeQuery:d}=f(a);return f(u)?e.push({name:f(u),params:f(c),query:{...f(d),scrollTo:f(l)}}):e.push({path:"/"})},{replaceInvalidFileRoute:r}=Aa({router:e}),i=(a,l)=>{const u=f(a);return r({space:f(u.space),resource:l,path:f(u.item),fileId:f(u.itemId)})},o=ae(!1);return{replaceInvalidFileRoute:i,closeApp:()=>(o.value=!0,n(t)),closed:o}}const He=()=>xr("$clientService");function td({clientService:e}){e=e||He();const t=gt();return{getUrlForResource:(a,l,u)=>e.webdav.getFileUrl(a,l,{username:t.user?.onPremisesSamAccountName,...u}),revokeUrl:a=>e.webdav.revokeUrl(a),getFileContents:(a,l)=>e.webdav.getFileContents(f(f(a).space),{path:f(f(a).item)},{...l}),getFileInfo:(a,l={})=>e.webdav.getFileInfo(f(f(a).space),{path:f(f(a).item),fileId:f(f(a).itemId)},l),putFileContents:(a,l)=>e.webdav.putFileContents(f(f(a).space),{path:f(f(a).item),...l})}}const nd=()=>xr("$authService");class mi{static allFiles="all-files";static currentFolder="current-folder"}const rd=()=>{const e=ut(),t=He(),n=st(),r=We(),i=Zt(),o=M(()=>i.searchContent?.enabled),s=M(()=>r.areHiddenFilesShown),a=M(()=>n.spaces.filter(re.isProjectSpaceResource)),l=p=>f(a).find(m=>m.id===p),u=rn.useTask(function*(p,m,b=null){if(e.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:t.graphAuthenticated,signal:p})),!m)return{totalResults:null,values:[]};const{resources:w,totalResults:S}=yield*re.call(t.webdav.search(m,{searchLimit:b,davProperties:Io.Default,signal:p}));return{totalResults:S,values:w.map(y=>{const g=l(y.parentFolderId),v=g||y;return e.options.routing.fullShareOwnerPaths&&v.remoteItemPath&&(v.path=re.urlJoin(v.remoteItemPath,v.path)),{id:v.id,data:v}}).filter(({data:y})=>!y.name.startsWith(".")||f(s))}}).restartable();return{search:async(p,m=null)=>await u.perform(p,m),buildSearchTerm:({term:p,isTitleOnlySearch:m,tags:b,lastModified:w,mediaType:S,scope:y,useScope:g})=>{const v=[],h=p,E=f(o)&&!m;if(h){let T=`name:"*${h}*"`;E&&(T=`(name:"*${h}*" OR content:"${h}")`),v.push(T)}if(g&&y&&v.push(`scope:${y}`),b){const T=b.split("+").map(R=>`"${R}"`);v.push(`tag:(${T.join(" OR ")})`)}if(w&&v.push(`mtime:${w}`),S){const T=S.split("+").map(R=>`"${R}"`);v.push(`mediatype:(${T.join(" OR ")})`)}return v.sort((T,R)=>Number(T.startsWith("scope:"))-Number(R.startsWith("scope:"))).join(" AND ")}}};function Jb({currentRoute:e,clientService:t}){const n=ae(!1),{webdav:r}=t,{replaceInvalidFileRoute:i}=Aa(),{getFileInfo:o}=td({clientService:t}),s=nd(),a=st(),{buildSearchTerm:l,search:u}=rd(),c=en("contextRouteQuery"),d=We(),{activeResources:p}=Me.storeToRefs(d);return{isFolderLoading:n,loadFolderForFileContext:async b=>{n.value=!0;try{if(b=f(b),f(c)?.term){const T=l({term:f(c)?.term}),{values:R}=await u(T,200),C=R.filter(({data:A})=>re.isSearchResource(A)).map(A=>A.data);d.initResourceList({currentFolder:null,resources:C}),n.value=!1;return}if(["files-shares-with-me","files-shares-with-others","files-shares-via-link","files-common-favorites"].includes(f(b.routeName))){await Cv.getTask().perform(),n.value=!1;return}d.clearResourceList();const S=f(b.space),y=await o(b,{davProperties:[qe.FileId]});if(i({space:S,resource:y,path:f(b.item),fileId:f(b.itemId)}),a.spaces.some(T=>re.isMountPointSpaceResource(T)&&T.root.remoteItem?.id===y.id)){const T=await o(b);d.initResourceList({currentFolder:T,resources:[T]}),n.value=!1;return}const v=ct.dirname(y.path),{resource:h,children:E}=await r.listFiles(S,{path:v});h.type==="file"?d.initResourceList({currentFolder:h,resources:[h]}):d.initResourceList({currentFolder:h,resources:E})}catch(w){if(w.statusCode===401)return s.handleAuthError(f(e));d.setCurrentFolder(null),console.error(w)}n.value=!1},activeFiles:p}}function id({appsStore:e,applicationId:t}){return{applicationMeta:M(()=>{const r=e.apps[t];if(!r)throw new Error(`useAppConfig: could not find config for applicationId: ${t}`);return r||{}})}}const fr=()=>Je;function Zb({titleSegments:e,eventBus:t}){const n=ur(),{currentTheme:r}=Me.storeToRefs(n);t=t||fr(),ot(e,i=>{const o=f(i),s=" - ",a={shortDocumentTitle:o.join(s),fullDocumentTitle:[...o,f(r).name].join(s)};t.publish("runtime.documentTitle.changed",a)},{immediate:!0,deep:!0})}function CF({appsStore:e,applicationId:t,applicationName:n,currentFileContext:r,currentRoute:i}){const o=id({applicationId:t,appsStore:e}),{$gettext:s}=Oe.useGettext(),a=M(()=>{const l=ct.basename(f(f(r)?.fileName))||s(f(i)?.meta?.title||""),u=f(f(o).applicationMeta);return[l,f(n)||u.name||u.id].filter(Boolean)});Zb({titleSegments:a})}function ew(e={}){const t=e.clientService??He(),n=e.authStore??li();return{makeRequest:(i,o,s={})=>{const a=!n.accessToken||n.publicLinkContextReady?t.httpUnAuthenticated:t.httpAuthenticated,l=new Ac({accessToken:n.accessToken,publicLinkToken:n.publicLinkToken,publicLinkPassword:n.publicLinkPassword});return s.method=i,s.url=o,s.headers={...l.getHeaders(),...s?.headers||{}},a.request(s)}}}const tw=()=>{const e=st();return{areSpacesLoading:M(()=>!e.spacesInitialized||e.spacesLoading)}},nw=(e={})=>{const t=st(),{areSpacesLoading:n}=tw(),r=en("shareId"),i=en("fileId"),o=M(()=>Rt(f(i))),s=ut(),a=He(),l=M(()=>t.spaces),u=ae(null),c=ae(null),d=ae(!1),p=m=>{const b=m.split("/");return f(l).find(w=>{if(!m.startsWith(w.driveAlias))return!1;const S=w.driveAlias.split("/");return b.length<S.length||b.slice(0,S.length).join("/")!==w.driveAlias?!1:w})};return Pl(()=>{const m=f(e.driveAliasAndItem);!m?.startsWith("personal/")&&!m?.startsWith("project/")&&t.setCurrentSpace(null)}),ot([e.driveAliasAndItem,n],async([m,b],[w,S])=>{if(m===w&&b===S)return;if(!m||m.startsWith("virtual/")){u.value=null,c.value=null;return}if(f(u)&&m.startsWith(f(u).driveAlias)){c.value=re.urlJoin(m.slice(f(u).driveAlias.length),{leadingSlash:!0});return}let g=null,v=null;if(m.startsWith("public/")||m.startsWith("ocm/")){const[h,...E]=m.split("/").slice(1);g=f(l).find(T=>T.id===h),v=E.join("/")}else if(m.startsWith("share/")||m.startsWith("ocm-share/")){const[h,...E]=m.split("/").slice(1),T=m.startsWith("ocm-share/")?"ocm-share":"share";let R=Rt(f(r));R?.includes(":")&&(R=[re.SHARE_JAIL_ID,R].join("!")),g=t.getSpace(R)||t.createShareSpace({driveAliasPrefix:T,id:R,shareName:f(h)}),v=E.join("/")}else f(o)?g=f(l).find(h=>f(o).startsWith(`${h.fileId}`)):g=p(m),g||(!t.mountPointsInitialized&&s.options.routing.fullShareOwnerPaths&&(d.value=!0,await t.loadMountPoints({graphClient:a.graphAuthenticated})),g=p(m)),g&&(v=m.slice(g.driveAlias.length));u.value=g,c.value=re.urlJoin(v,{leadingSlash:!0}),d.value=!1},{immediate:!0,deep:!0}),ot(u,m=>{t.setCurrentSpace(m)},{immediate:!0}),{space:u,item:c,itemId:o,loading:d}};function rw(e){const t=ze(),n=lr(),r=zt(),i=e.clientService??He(),o=e.applicationId,s=li(),{publicLinkContextReady:a}=Me.storeToRefs(s),l=xa("driveAliasAndItem"),{space:u,item:c,itemId:d,loading:p}=nw({driveAliasAndItem:l}),m=M(()=>{if(f(p))return null;let b;return f(u)?b=re.urlJoin(f(u).webDavPath,f(c)):b=re.urlJoin(Rt(f(r).params.filePath)),{path:b,driveAliasAndItem:f(l),space:f(u),item:f(c),itemId:f(d),fileName:ct.basename(b),routeName:Rt(f(r).query[Ca]),...Xb(f(r).query)}});return CF({appsStore:n,applicationId:o,applicationName:e.applicationName,currentFileContext:m,currentRoute:r}),{isPublicLinkContext:a,currentFileContext:m,...lm({appsStore:n,...e}),...Yb({router:t,currentFileContext:m}),...td({clientService:i}),...Jb({clientService:i,currentRoute:r}),...ew({clientService:i,currentRoute:f(r)})}}const RF=e=>({meta:{...e.meta,authContext:"anonymous"},path:e.path,redirect:t=>{const n=e.redirect(t);return console.warn(`route "${e.path}" is deprecated, use "${String(n.path)||String(n.name)}" instead.`),n}}),kF=()=>[{path:"/list",redirect:e=>Qn("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:"personal/home"}})},{path:"/list/all/:item(.*)",redirect:e=>Qn("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:re.urlJoin("personal/home",Rt(e.params.item),{leadingSlash:!1})}})},{path:"/list/favorites",redirect:e=>$i("files-common-favorites",e)},{path:"/list/shared-with-me",redirect:e=>Dn("files-shares-with-me",e)},{path:"/list/shared-with-others",redirect:e=>Dn("files-shares-with-others",e)},{path:"/list/shared-via-link",redirect:e=>Dn("files-shares-via-link",e)},{path:"/trash-bin",redirect:e=>Hr("files-trash-generic",e)},{path:"/public/list/:item(.*)",redirect:e=>Mi("files-public-link",e)},{path:"/private-link/:fileId",redirect:e=>({name:"resolvePrivateLink",params:{fileId:e.params.fileId}})},{path:"/public-link/:token",redirect:e=>({name:"resolvePublicLink",params:{token:e.params.token}})}].map(RF),PF=(e,...t)=>{const[n,...r]=t.map(i=>{const o={"files-personal":Qn("files-spaces-generic").name,"files-favorites":$i("files-common-favorites").name,"files-shared-with-others":Dn("files-shares-with-others").name,"files-shared-with-me":Dn("files-shares-with-me").name,"files-trashbin ":Hr("files-trash-generic").name,"files-public-list":Mi("files-public-link").name}[i.name.toString()];return o&&console.warn(`route name "${name}" is deprecated, use "${o.toString()}" instead.`),{...i,...!!o&&{name:o}}});return rc(e,n,...r)},IF={name:"root",path:"/",redirect:e=>Qn("files-spaces-generic",e)},OF=e=>[IF,...tx(e),...ix(e),...ox(e),...nx(e),...sx(e),...kF()],ka=()=>{const e=He();return{getDefaultMetaFolder:async n=>{const{children:r}=await e.webdav.listFiles(n);return r.find(({name:i})=>i===".space")}}},ln=e=>{const t=gt(),n=st(),r=ut(),i=M(()=>n.spaces),o=xa("driveAliasAndItem"),s=d=>f(e?.space)||f(i).find(p=>p.id===d),a=d=>{let p=d.storageId;(f(o)?.startsWith("public/")||f(o)?.startsWith("ocm/"))&&(p=f(o).split("/")[1]);const m=s(p);if(m&&!re.isMountPointSpaceResource(m))return m;const b=re.isShareResource(d)&&d.shareTypes.includes(re.ShareTypes.remote.value)||d?.id?.toString().startsWith(re.OCM_PROVIDER_ID)?"ocm-share":"share";let w;return d.remoteItemPath?w=ct.basename(d.remoteItemPath):f(o)?.startsWith("share/")||f(o)?.startsWith("ocm-share/")?w=f(o).split("/")[1]:w=d.name,n.getSpace(d.remoteItemId)||n.createShareSpace({driveAliasPrefix:b,id:d.remoteItemId,shareName:w})},l=d=>f(i).filter(p=>re.isMountPointSpaceResource(p)&&re.extractStorageId(p.root.remoteItem.rootId)===d.id);return{getInternalSpace:s,getMatchingSpace:a,isPersonalSpaceRoot:d=>d?.storageId&&d?.storageId===n.personalSpace?.storageId&&d?.path==="/"&&!re.isIncomingShareResource(d),isResourceAccessible:({space:d,path:p})=>{if(!r.options.routing.fullShareOwnerPaths)return!0;const m=f(i).some(w=>re.isProjectSpaceResource(w)&&w.id===d.id);return d.isOwner(t.user)||m||l(d).some(w=>p.startsWith(w.root.remoteItem.path))}}},Xi=()=>{const e=He(),t=We();return{createSpace:i=>{const{graphAuthenticated:o}=e;return o.drives.createDrive({name:i},{params:{template:"default"}})},createDefaultMetaFolder:async i=>{const o=await e.webdav.createFolder(i,{path:".space"});return re.extractStorageId(o.parentFolderId)===t.currentFolder?.id&&t.upsertResource(o),o}}},yn=()=>xr("$loadingService"),Pa=()=>{const e=li(),t=He(),n=Oe.useGettext();return{headers:M(()=>{const i=new Ac({accessToken:e.accessToken,publicLinkToken:e.publicLinkToken,publicLinkPassword:e.publicLinkPassword});return{"Accept-Language":n.current,"Initiator-ID":t.initiatorId,"X-Request-ID":Gt.v4(),...i.getHeaders()}})}};function FF(e){return new Worker("/assets/worker-Br2EoHIh.js",{name:e?.name})}const iw=({concurrentRequests:e=4}={})=>{const t=ut(),n=yn(),{headers:r}=Pa(),{createWorker:i,terminateWorker:o}=Wo(),s=({topic:l,space:u,resources:c},d)=>{const p=i(FF,{needsTokenRenewal:!0});let m;f(p.worker).onmessage=b=>{o(p.id),m?.(!0);const{successful:w,failed:S}=JSON.parse(b.data),y=S.map(({resource:g,...v})=>({resource:g,error:re.createHttpError(v)}));d({successful:w,failed:y})},n.addTask(()=>new Promise(b=>{m=b})),p.post(a({topic:l,space:u,resources:c}))},a=({topic:l,space:u,resources:c})=>JSON.stringify({topic:l,data:{space:u,resources:c,concurrentRequests:e,baseUrl:t.serverUrl,headers:{...f(r),"X-Request-ID":void 0}}});return{startWorker:s}};function _F(e){return new Worker("/assets/worker-CL8AMTxB.js",{name:e?.name})}const ow=()=>{const e=ut(),t=yn(),{headers:n}=Pa(),{createWorker:r,terminateWorker:i}=Wo(),o=(a,l)=>{const u=r(_F,{needsTokenRenewal:!0});let c;f(u.worker).onmessage=d=>{i(u.id),c?.(!0);const{successful:p,failed:m}=JSON.parse(d.data),b=m.map(({resourceName:w,...S})=>({resourceName:w,error:re.createHttpError(S)}));l({successful:p,failed:b})},t.addTask(()=>new Promise(d=>{c=d})),u.post(s(a))},s=a=>JSON.stringify({topic:"startProcess",data:{transferData:a,baseUrl:e.serverUrl,headers:{...f(n),"X-Request-ID":void 0}}});return{startWorker:o}};function DF(e){return new Worker("/assets/worker-SrzUf4Ns.js",{name:e?.name})}const sw=()=>{const e=ut(),t=yn(),{headers:n}=Pa(),{createWorker:r,terminateWorker:i}=Wo(),o=({space:a,resources:l,missingFolderPaths:u},c)=>{const d=r(DF,{needsTokenRenewal:!0});let p;f(d.worker).onmessage=m=>{i(d.id),p?.(!0);const{successful:b,failed:w}=JSON.parse(m.data),S=w.map(({resource:y,...g})=>({resource:y,error:re.createHttpError(g)}));c({successful:b,failed:S})},t.addTask(()=>new Promise(m=>{p=m})),d.post(s({space:a,resources:l,missingFolderPaths:u}))},s=({space:a,resources:l,missingFolderPaths:u})=>JSON.stringify({topic:"startProcess",data:{space:a,resources:l,missingFolderPaths:u,baseUrl:e.serverUrl,headers:{...f(n),"X-Request-ID":void 0}}});return{startWorker:o}};function NF(e){return new Worker("/assets/worker-BBQqm_-D.js",{name:e?.name})}const LF=({authService:e})=>{const{createWorker:t}=Wo(),n=ae();return{startWorker:()=>{n.value=t(NF),f(f(n).worker).onmessage=()=>{e.signinSilent().catch(async s=>{if(s instanceof PS.ErrorTimeout){console.warn("token renewal timed out, retrying in 5 seconds..."),f(n).post(JSON.stringify({topic:"set",expiry:5,expiryThreshold:0}));return}if(console.error("token renewal error:",s),!await e.getRefreshToken())return e.logoutUser()})}},setTokenTimer:({expiry:s,expiryThreshold:a})=>{if(!f(n)){console.error("token timer worker is not running");return}f(n).post(JSON.stringify({topic:"set",expiry:s,expiryThreshold:a}))},resetTokenTimer:()=>{if(!f(n)){console.error("token timer worker is not running");return}f(n).post(JSON.stringify({topic:"reset"}))}}};function $F(e){return e==null}const Jn=()=>{const e=lr(),t=ze(),n=el(),{isEnabled:r}=Qr(),{requestExtensions:i}=Ki(),o=Dr(),{openUrl:s}=Q0(),a=ut(),{options:l}=Me.storeToRefs(a),{actions:u}=Xa(),{actions:c}=Za(),{actions:d}=Ia(),{actions:p}=ls(),{actions:m}=Ga(),{actions:b}=Qa(),{actions:w}=cs(),{actions:S}=_d(),{actions:y}=Ya(),{actions:g}=A0(),{actions:v}=Ja(),{actions:h}=us(),{actions:E}=Fd(),T=M(()=>[...f(b),...f(w),...f(p),...f(y),...f(d),...f(v),...f(E),...f(h),...f(u),...f(c),...f(m),...f(S)]),R=M(()=>(i({id:"global.files.context-actions",extensionType:"action"})||[]).map(L=>L.action).filter(L=>$F(L.category)||L.category==="context"||L.category==="actions")),C=M(()=>f(r)?[]:e.fileExtensions.map(L=>{const ee=e.apps[L.app];return{name:`editor-${L.app}`,label:()=>L.label?typeof L.label=="function"?L.label():L.label:ee.name,icon:L.icon||ee.icon,...ee.iconFillType&&{iconFillType:ee.iconFillType},img:ee.img,route:({space:J,resources:se})=>A({appFileExtension:L,space:J,resource:se[0]}),handler:J=>V(L,J.space,J.resources[0]),isVisible:({resources:J})=>!f(o)||J.length!==1||!J[0].canDownload()&&!L.secureView||!f(n)&&dn(t,"files-trash-generic")?!1:J[0].extension&&L.extension?J[0].extension.toLowerCase()===L.extension.toLowerCase():J[0].mimeType&&L.mimeType?J[0].mimeType.toLowerCase()===L.mimeType.toLowerCase()||J[0].mimeType.split("/")[0].toLowerCase()===L.mimeType.toLowerCase():!1,hasPriority:L.hasPriority,class:`oc-files-actions-${_b(ee.name).toLowerCase()}-trigger`}}).sort((L,ee)=>ee.hasPriority!==L.hasPriority&&ee.hasPriority?1:0)),A=({appFileExtension:L,space:ee,resource:J})=>{const se=re.isShareSpaceResource(ee)?ee.id:void 0,he=L.routeName||L.app,oe=D(he,ee,J,se);return t.resolve(oe)},D=(L,ee,J,se,he)=>({name:L,params:{driveAliasAndItem:ee?.getDriveAliasAndItem(J)},query:{...se&&{shareId:se},...J.fileId&&f(l).routing.idBased&&{fileId:J.fileId},...he&&{templateId:he},...Ra(f(t.currentRoute))}}),V=(L,ee,J)=>{const se=re.isShareSpaceResource(ee)?ee.id:void 0,he=L.routeName||L.app,oe=D(he,ee,J,se);if(f(l).cernFeatures){const we=t.resolve(oe).href,X=`${L.routeName}-${J.path}`;s(we,X,!0);return}t.push(oe)},O=L=>{const ee=N(L);ee&&ee.handler({...L})},N=L=>{const ee=W(L);if(ee.length)return ee[0]},W=L=>{const ee=he=>he.isVisible(L),J=[...f(R),...f(C),...f(g)].filter(ee).sort((he,oe)=>Number(oe.hasPriority)-Number(he.hasPriority)),se=L.omitSystemActions?[]:f(T).filter(ee);return[...J,...se]};return{getDefaultAction:N,getAllOpenWithActions:W,getEditorRouteOpts:D,openEditor:V,triggerDefaultAction:O}},Ia=()=>{const e=ut(),t=ze(),{copyResources:n}=qo(),r=Oe.useGettext(),{$gettext:i}=r,o=We(),{currentFolder:s}=Me.storeToRefs(o),a=M(()=>Vo()?i("⌘ + C"):i("Ctrl + C")),l=({resources:c})=>{It(t,"files-common-search")&&(c=c.filter(d=>!re.isProjectSpaceResource(d))),n(c)};return{actions:M(()=>[{name:"copy",icon:"file-copy-2",handler:l,shortcut:f(a),label:()=>i("Copy"),isVisible:({resources:c})=>{if(!pt(t,"files-spaces-generic")&&!Rn(t,"files-public-link")&&!It(t,"files-common-favorites")&&!It(t,"files-common-search")||pt(t,"files-spaces-projects")||c.length===0)return!1;if(Rn(t,"files-public-link"))return f(s)?.canCreate();if(It(t,"files-common-search")&&c.every(d=>re.isProjectSpaceResource(d)))return!1;if(f(e.options.runningOnEos)){const d=c[0].path?.split("/").filter(Boolean)||[];if(pt(t,"files-spaces-generic")&&d.length<5)return!1}return!!f(c)[0].canDownload()},class:"oc-files-actions-copy-trigger"}])}};var dr=(e=>(e.C="c",e.V="v",e.X="x",e.A="a",e.S="s",e.Z="z",e.Plus="+",e.Minus="-",e.Space=" ",e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.Esc="Escape",e.Backspace="Backspace",e.Delete="Delete",e))(dr||{}),Oa=(e=>(e.Ctrl="Control",e.Shift="Shift",e))(Oa||{});const MF=()=>{const e=document.activeElement.tagName,t=document.activeElement.getAttribute("type");if(["textarea","input","select"].includes(e.toLowerCase())&&t!=="checkbox")return!0;const n=document.activeElement;if(!n)return!1;let r;try{r=n?.closest("[data-custom-key-bindings-disabled='true']")}catch{r=n?.parentElement.closest("[data-custom-key-bindings-disabled='true']")}return r?!0:window.getSelection().type==="Range"},Fa=e=>{const t=ae([]),n=ae(0),r=a=>{if(!e?.skipDisabledKeyBindingsCheck&&MF())return;const{key:l,ctrlKey:u,metaKey:c,shiftKey:d}=a;let p=null;const m=[];c||u?(p="Control",m.push("altKey","shiftKey")):d&&(p="Shift",m.push("altKey","ctrlKey","metaKey")),!((w,S)=>S.some(y=>w[y]))(a,m)&&f(t).filter(w=>w.primary===l&&w.modifier===p).forEach(w=>{w.preventDefault&&a.preventDefault(),w.callback(a)})},i=(a,l,{preventDefault:u=!0}={})=>{const c=Gt.v4();return t.value.push({id:c,...a,modifier:a.modifier??null,preventDefault:u,callback:l}),c},o=a=>{t.value=t.value.filter(l=>l.id!==a)},s=()=>{n.value=0};return Vn.useEventListener(document,"keydown",r),{actions:t,bindKeyAction:i,removeKeyAction:o,selectionCursor:n,resetSelectionCursor:s}};function gi(){return{interceptModifierClick:(t,n)=>{if(!t||!n)return!1;const r=t.shiftKey,i=t.ctrlKey||t.metaKey;return!r&&!i?!1:(t.stopPropagation?.(),t.stopImmediatePropagation?.(),r&&Je.publish("app.files.list.clicked.shift",{resource:n,skipTargetSelection:!1}),i&&Je.publish("app.files.list.clicked.meta",n),!0)}}}const od=()=>{const e=Fa(),t=10,n=.1;return{setCropperInstance:i=>{e.bindKeyAction({primary:dr.ArrowRight},()=>f(i)?.move(-t,0)),e.bindKeyAction({primary:dr.ArrowLeft},()=>f(i)?.move(t,0)),e.bindKeyAction({primary:dr.ArrowDown},()=>f(i)?.move(0,-t)),e.bindKeyAction({primary:dr.ArrowUp},()=>f(i)?.move(0,t)),e.bindKeyAction({primary:dr.Plus},()=>f(i)?.zoom(n)),e.bindKeyAction({primary:dr.Minus},()=>f(i)?.zoom(-n))}}},sd=()=>{const{showMessage:e,showErrorMessage:t}=tt(),{$gettext:n}=Oe.useGettext(),{copy:r}=Vn.useClipboard(),{interceptModifierClick:i}=gi(),o=async a=>{try{await r(a),e({title:n("The link has been copied to your clipboard.")})}catch(l){t({title:n("Copy link failed"),errors:[l]})}};return{actions:M(()=>[{name:"copy-permanent-link",icon:"link",label:()=>n("Copy permanent link"),handler:a=>{const{resources:l,event:u}=a,c=l[0];if(!(u&&i(u,c)))return o(c.privateLink)},isVisible:({space:a,resources:l})=>!(l.length!==1||re.isPublicSpaceResource(a)||re.isTrashResource(l[0])),class:"oc-files-actions-copy-permanent-link-trigger"}])}},Ho={};function BF(e){return e.getIsPending!==void 0}function jF(e){if(BF(e))return e;let t=!0,n=e.then(r=>(t=!1,r),r=>{throw t=!1,r});return n.getIsPending=function(){return t},n}function UF(e){let t={};const n=e.attributes;if(!n)return t;for(let r=n.length-1;r>=0;r--)t[n[r].name]=n[r].value;return t}function VF(e){return Object.keys(e).reduce((t,n)=>(e[n]!==!1&&e[n]!==null&&e[n]!==void 0&&(t[n]=e[n]),t),{})}function qF(e,t){const{class:n,style:r,...i}=UF(e),{class:o,style:s,...a}=VF(t);return{class:[n,o],style:[r,s],...i,...a}}const aw=Fe({inheritAttrs:!1,__name:"InlineSvg",props:{src:{},title:{default:void 0},transformSource:{type:Function,default:e=>e},keepDuringLoading:{type:Boolean,default:!0},uniqueIds:{type:[Boolean,String],default:!1},uniqueIdsBase:{default:""}},emits:["loaded","unloaded","error"],setup(e,{expose:t,emit:n}){const r=e,i=n,o=_l(),s=ae(),a=ae(),l=ae(),u=Math.random().toString(36).substring(2);t({svgElSource:s,request:l}),ot(()=>r.src,S=>{d(S)}),d(r.src);function c(S){if(S=S.cloneNode(!0),r.uniqueIds){const y=typeof r.uniqueIds=="string"?r.uniqueIds:u;S=w(S,y,r.uniqueIdsBase)}return S=r.transformSource(S),r.title&&b(S,r.title),S.innerHTML}function d(S){Ho[S]||(Ho[S]=p(S)),s.value&&Ho[S].getIsPending()&&!r.keepDuringLoading&&(s.value=null,i("unloaded")),Ho[S].then(y=>{s.value=y,Vt(()=>{i("loaded",a.value)})}).catch(y=>{s.value&&(s.value=void 0,i("unloaded")),delete Ho[S],i("error",y)})}function p(S){return jF(new Promise((y,g)=>{const v=new XMLHttpRequest;v.open("GET",S,!0),l.value=v,v.onload=()=>{if(v.status>=200&&v.status<400)try{let h=new DOMParser().parseFromString(v.responseText,"text/xml").getElementsByTagName("svg")[0];h?y(h):g(new Error('Loaded file is not valid SVG"'))}catch(h){g(h)}else g(new Error("Error loading SVG"))},v.onerror=g,v.send()}))}const m=()=>s.value?$l("svg",{...qF(s.value,o),innerHTML:c(s.value),ref:a}):null;function b(S,y){const g=S.getElementsByTagName("title");if(g.length)g[0].textContent=y;else{const v=document.createElementNS("http://www.w3.org/2000/svg","title");v.textContent=y,S.insertBefore(v,S.firstChild)}}function w(S,y,g=""){const v=["id","href","xlink:href","xlink:role","xlink:arcrole"],h=["href","xlink:href"],E=(T,R)=>h.includes(T)&&(R?!R.includes("#"):!1);return[...S.children].forEach(T=>{var R;if((R=T.attributes)!=null&&R.length){const C=Object.values(T.attributes).map(A=>{const D=/url\((.*?)\)/.exec(A.value);return D!=null&&D[1]&&(A.value=A.value.replace(D[0],`url(${g}${D[1]}_${y})`)),A});v.forEach(A=>{const D=C.find(V=>V.name===A);D&&!E(A,D.value)&&(D.value=`${D.value}_${y}`)})}return T.children.length?w(T,y,g):T}),S}return(S,y)=>(Y(),Te(m))}}),Ir=Fe({__name:"OcIcon",props:{accessibleLabel:{default:""},color:{default:""},fillType:{default:"fill"},name:{default:"info"},size:{default:"medium"},type:{default:"span"}},emits:["loaded"],setup(e,{emit:t}){aw.name="inline-svg";const n=t,r=M(()=>hi("oc-icon-title-")),i=M(()=>{const a=`${xO()}icons/`,l=e.fillType.toLowerCase();return l==="none"?`${a}${e.name}.svg`:`${a}${e.name}-${l}.svg`}),o=M(()=>({"size-3":e.size==="xsmall","size-4":e.size==="small","size-5.5":e.size==="medium","size-8":e.size==="large","size-12":e.size==="xlarge","size-22":e.size==="xxlarge","size-42":e.size==="xxxlarge"})),s=a=>{if(e.accessibleLabel!==""){const l=document.createElement("title");l.setAttribute("id",r.value),l.appendChild(document.createTextNode(e.accessibleLabel)),a.insertBefore(l,a.firstChild)}return a};return(a,l)=>(Y(),Te(On(e.type),{class:q.normalizeClass(["oc-icon","box-content","inline-block","align-baseline","[&_svg]:block",o.value,{"bg-transparent min-h-0":e.type==="button"}])},{default:ve(()=>[me(f(aw),{src:i.value,"transform-source":s,"aria-hidden":e.accessibleLabel===""?"true":null,"aria-labelledby":e.accessibleLabel===""?null:r.value,focusable:e.accessibleLabel===""?"false":null,style:q.normalizeStyle(e.color!==""?{fill:e.color}:{}),class:q.normalizeClass(o.value),onLoaded:l[0]||(l[0]=u=>n("loaded"))},null,8,["src","aria-hidden","aria-labelledby","focusable","style","class"])]),_:1},8,["class"]))}});var lw=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],_a=lw.join(","),cw=typeof Element>"u",yi=cw?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Da=!cw&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Na=function(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=i===""||i==="true",s=o||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Na(t.parentNode));return s},zF=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},uw=function(t,n,r){if(Na(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(_a));return n&&yi.call(t,_a)&&i.unshift(t),i=i.filter(r),i},La=function(t,n,r){for(var i=[],o=Array.from(t);o.length;){var s=o.shift();if(!Na(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,u=La(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:s,candidates:u})}else{var c=yi.call(s,_a);c&&r.filter(s)&&(n||!t.includes(s))&&i.push(s);var d=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),p=!Na(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(d&&p){var m=La(d===!0?s.children:d.children,!0,r);r.flatten?i.push.apply(i,m):i.push({scopeParent:s,candidates:m})}else o.unshift.apply(o,s.children)}}return i},fw=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},vi=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||zF(t))&&!fw(t)?0:t.tabIndex},WF=function(t,n){var r=vi(t);return r<0&&n&&!fw(t)?0:r},HF=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},dw=function(t){return t.tagName==="INPUT"},KF=function(t){return dw(t)&&t.type==="hidden"},GF=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},QF=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},XF=function(t){if(!t.name)return!0;var n=t.form||Da(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var o=QF(i,t.form);return!o||o===t},YF=function(t){return dw(t)&&t.type==="radio"},JF=function(t){return YF(t)&&!XF(t)},ZF=function(t){var n,r=t&&Da(t),i=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var s,a,l;for(o=!!((s=i)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&i;){var u,c,d;r=Da(i),i=(u=r)===null||u===void 0?void 0:u.host,o=!!((c=i)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(i))}}return o},pw=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},e_=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}if(getComputedStyle(t).visibility==="hidden")return!0;var s=yi.call(t,"details>summary:first-of-type"),a=s?t.parentElement:t;if(yi.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var l=t;t;){var u=t.parentElement,c=Da(t);if(u&&!u.shadowRoot&&i(u)===!0)return pw(t);t.assignedSlot?t=t.assignedSlot:!u&&c!==t.ownerDocument?t=c.host:t=u}t=l}if(ZF(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return pw(t);return!1},t_=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return yi.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},$a=function(t,n){return!(n.disabled||KF(n)||e_(n,t)||GF(n)||t_(n))},ad=function(t,n){return!(JF(n)||vi(n)<0||!$a(t,n))},n_=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},hw=function(t){var n=[],r=[];return t.forEach(function(i,o){var s=!!i.scopeParent,a=s?i.scopeParent:i,l=WF(a,s),u=s?hw(i.candidates):a;l===0?s?n.push.apply(n,u):n.push(a):r.push({documentOrder:o,tabIndex:l,item:i,isScope:s,content:u})}),r.sort(HF).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},r_=function(t,n){n=n||{};var r;return n.getShadowRoot?r=La([t],n.includeContainer,{filter:ad.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:n_}):r=uw(t,n.includeContainer,ad.bind(null,n)),hw(r)},i_=function(t,n){n=n||{};var r;return n.getShadowRoot?r=La([t],n.includeContainer,{filter:$a.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=uw(t,n.includeContainer,$a.bind(null,n)),r},Yi=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return yi.call(t,_a)===!1?!1:ad(n,t)},o_=lw.concat("iframe:not([inert]):not([inert] *)").join(","),ld=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return yi.call(t,o_)===!1?!1:$a(n,t)};function cd(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s_(e){if(Array.isArray(e))return cd(e)}function mw(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=vw(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
42
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var l=n.next();return s=l.done,l},e:function(l){a=!0,o=l},f:function(){try{s||n.return==null||n.return()}finally{if(a)throw o}}}}function a_(e,t,n){return(t=d_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l_(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c_(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
43
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gw(Object(n),!0).forEach(function(r){a_(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gw(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function u_(e){return s_(e)||l_(e)||vw(e)||c_()}function f_(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function d_(e){var t=f_(e,"string");return typeof t=="symbol"?t:t+""}function vw(e,t){if(e){if(typeof e=="string")return cd(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cd(e,t):void 0}}var Or={getActiveTrap:function(t){return t?.length>0?t[t.length-1]:null},activateTrap:function(t,n){var r=Or.getActiveTrap(t);n!==r&&Or.pauseTrap(t);var i=t.indexOf(n);i===-1||t.splice(i,1),t.push(n)},deactivateTrap:function(t,n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),Or.unpauseTrap(t)},pauseTrap:function(t){var n=Or.getActiveTrap(t);n?._setPausedState(!0)},unpauseTrap:function(t){var n=Or.getActiveTrap(t);n&&!n._isManuallyPaused()&&n._setPausedState(!1)}},p_=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},h_=function(t){return t?.key==="Escape"||t?.key==="Esc"||t?.keyCode===27},Ko=function(t){return t?.key==="Tab"||t?.keyCode===9},m_=function(t){return Ko(t)&&!t.shiftKey},g_=function(t){return Ko(t)&&t.shiftKey},bw=function(t){return setTimeout(t,0)},Go=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return typeof t=="function"?t.apply(void 0,r):t},Ma=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},y_=[],v_=function(t,n){var r=n?.document||document,i=n?.trapStack||y_,o=yw({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isolateSubtrees:!1,isKeyForward:m_,isKeyBackward:g_},n),s={containers:[],containerGroups:[],tabbableGroups:[],adjacentElements:new Set,alreadySilent:new Set,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a,l=function(W,L,ee){return W&&W[L]!==void 0?W[L]:o[ee||L]},u=function(W,L){var ee=typeof L?.composedPath=="function"?L.composedPath():void 0;return s.containerGroups.findIndex(function(J){var se=J.container,he=J.tabbableNodes;return se.contains(W)||ee?.includes(se)||he.find(function(oe){return oe===W})})},c=function(W){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ee=L.hasFallback,J=ee===void 0?!1:ee,se=L.params,he=se===void 0?[]:se,oe=o[W];if(typeof oe=="function"&&(oe=oe.apply(void 0,u_(he))),oe===!0&&(oe=void 0),!oe){if(oe===void 0||oe===!1)return oe;throw new Error("`".concat(W,"` was specified but was not a node, or did not return a node"))}var we=oe;if(typeof oe=="string"){try{we=r.querySelector(oe)}catch(X){throw new Error("`".concat(W,'` appears to be an invalid selector; error="').concat(X.message,'"'))}if(!we&&!J)throw new Error("`".concat(W,"` as selector refers to no known node"))}return we},d=function(){var W=c("initialFocus",{hasFallback:!0});if(W===!1)return!1;if(W===void 0||W&&!ld(W,o.tabbableOptions))if(u(r.activeElement)>=0)W=r.activeElement;else{var L=s.tabbableGroups[0],ee=L&&L.firstTabbableNode;W=ee||c("fallbackFocus")}else W===null&&(W=c("fallbackFocus"));if(!W)throw new Error("Your focus-trap needs to have at least one focusable element");return W},p=function(){if(s.containerGroups=s.containers.map(function(W){var L=r_(W,o.tabbableOptions),ee=i_(W,o.tabbableOptions),J=L.length>0?L[0]:void 0,se=L.length>0?L[L.length-1]:void 0,he=ee.find(function(X){return Yi(X)}),oe=ee.slice().reverse().find(function(X){return Yi(X)}),we=!!L.find(function(X){return vi(X)>0});return{container:W,tabbableNodes:L,focusableNodes:ee,posTabIndexesFound:we,firstTabbableNode:J,lastTabbableNode:se,firstDomTabbableNode:he,lastDomTabbableNode:oe,nextTabbableNode:function(ie){var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Ae=L.indexOf(ie);return Ae<0?le?ee.slice(ee.indexOf(ie)+1).find(function(te){return Yi(te)}):ee.slice(0,ee.indexOf(ie)).reverse().find(function(te){return Yi(te)}):L[Ae+(le?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(W){return W.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(s.containerGroups.find(function(W){return W.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},m=function(W){var L=W.activeElement;if(L)return L.shadowRoot&&L.shadowRoot.activeElement!==null?m(L.shadowRoot):L},b=function(W){if(W!==!1&&W!==m(document)){if(!W||!W.focus){b(d());return}W.focus({preventScroll:!!o.preventScroll}),s.mostRecentlyFocusedNode=W,p_(W)&&W.select()}},w=function(W){var L=c("setReturnFocus",{params:[W]});return L||(L===!1?!1:W)},S=function(W){var L=W.target,ee=W.event,J=W.isBackward,se=J===void 0?!1:J;L=L||Ma(ee),p();var he=null;if(s.tabbableGroups.length>0){var oe=u(L,ee),we=oe>=0?s.containerGroups[oe]:void 0;if(oe<0)se?he=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:he=s.tabbableGroups[0].firstTabbableNode;else if(se){var X=s.tabbableGroups.findIndex(function(x){var G=x.firstTabbableNode;return L===G});if(X<0&&(we.container===L||ld(L,o.tabbableOptions)&&!Yi(L,o.tabbableOptions)&&!we.nextTabbableNode(L,!1))&&(X=oe),X>=0){var ie=X===0?s.tabbableGroups.length-1:X-1,le=s.tabbableGroups[ie];he=vi(L)>=0?le.lastTabbableNode:le.lastDomTabbableNode}else Ko(ee)||(he=we.nextTabbableNode(L,!1))}else{var Ae=s.tabbableGroups.findIndex(function(x){var G=x.lastTabbableNode;return L===G});if(Ae<0&&(we.container===L||ld(L,o.tabbableOptions)&&!Yi(L,o.tabbableOptions)&&!we.nextTabbableNode(L))&&(Ae=oe),Ae>=0){var te=Ae===s.tabbableGroups.length-1?0:Ae+1,F=s.tabbableGroups[te];he=vi(L)>=0?F.firstTabbableNode:F.firstDomTabbableNode}else Ko(ee)||(he=we.nextTabbableNode(L))}}else he=c("fallbackFocus");return he},y=function(W){var L=Ma(W);if(!(u(L,W)>=0)){if(Go(o.clickOutsideDeactivates,W)){a.deactivate({returnFocus:o.returnFocusOnDeactivate});return}Go(o.allowOutsideClick,W)||W.preventDefault()}},g=function(W){var L=Ma(W),ee=u(L,W)>=0;if(ee||L instanceof Document)ee&&(s.mostRecentlyFocusedNode=L);else{W.stopImmediatePropagation();var J,se=!0;if(s.mostRecentlyFocusedNode)if(vi(s.mostRecentlyFocusedNode)>0){var he=u(s.mostRecentlyFocusedNode),oe=s.containerGroups[he].tabbableNodes;if(oe.length>0){var we=oe.findIndex(function(X){return X===s.mostRecentlyFocusedNode});we>=0&&(o.isKeyForward(s.recentNavEvent)?we+1<oe.length&&(J=oe[we+1],se=!1):we-1>=0&&(J=oe[we-1],se=!1))}}else s.containerGroups.some(function(X){return X.tabbableNodes.some(function(ie){return vi(ie)>0})})||(se=!1);else se=!1;se&&(J=S({target:s.mostRecentlyFocusedNode,isBackward:o.isKeyBackward(s.recentNavEvent)})),b(J||s.mostRecentlyFocusedNode||d())}s.recentNavEvent=void 0},v=function(W){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=W;var ee=S({event:W,isBackward:L});ee&&(Ko(W)&&W.preventDefault(),b(ee))},h=function(W){(o.isKeyForward(W)||o.isKeyBackward(W))&&v(W,o.isKeyBackward(W))},E=function(W){h_(W)&&Go(o.escapeDeactivates,W)!==!1&&(W.preventDefault(),a.deactivate())},T=function(W){var L=Ma(W);u(L,W)>=0||Go(o.clickOutsideDeactivates,W)||Go(o.allowOutsideClick,W)||(W.preventDefault(),W.stopImmediatePropagation())},R=function(){if(s.active)return Or.activateTrap(i,a),s.delayInitialFocusTimer=o.delayInitialFocus?bw(function(){b(d())}):b(d()),r.addEventListener("focusin",g,!0),r.addEventListener("mousedown",y,{capture:!0,passive:!1}),r.addEventListener("touchstart",y,{capture:!0,passive:!1}),r.addEventListener("click",T,{capture:!0,passive:!1}),r.addEventListener("keydown",h,{capture:!0,passive:!1}),r.addEventListener("keydown",E),a},C=function(W){s.active&&!s.paused&&a._setSubtreeIsolation(!1),s.adjacentElements.clear(),s.alreadySilent.clear();var L=new Set,ee=new Set,J=mw(W),se;try{for(J.s();!(se=J.n()).done;){var he=se.value;L.add(he);for(var oe=typeof ShadowRoot<"u"&&he.getRootNode()instanceof ShadowRoot,we=he;we;){L.add(we);var X=we.parentElement,ie=[];X?ie=X.children:!X&&oe&&(ie=we.getRootNode().children,X=we.getRootNode().host,oe=typeof ShadowRoot<"u"&&X.getRootNode()instanceof ShadowRoot);var le=mw(ie),Ae;try{for(le.s();!(Ae=le.n()).done;){var te=Ae.value;ee.add(te)}}catch(F){le.e(F)}finally{le.f()}we=X}}}catch(F){J.e(F)}finally{J.f()}L.forEach(function(F){ee.delete(F)}),s.adjacentElements=ee},A=function(){if(s.active)return r.removeEventListener("focusin",g,!0),r.removeEventListener("mousedown",y,!0),r.removeEventListener("touchstart",y,!0),r.removeEventListener("click",T,!0),r.removeEventListener("keydown",h,!0),r.removeEventListener("keydown",E),a},D=function(W){var L=W.some(function(ee){var J=Array.from(ee.removedNodes);return J.some(function(se){return se===s.mostRecentlyFocusedNode})});L&&b(d())},V=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(D):void 0,O=function(){V&&(V.disconnect(),s.active&&!s.paused&&s.containers.map(function(W){V.observe(W,{subtree:!0,childList:!0})}))};return a={get active(){return s.active},get paused(){return s.paused},activate:function(W){if(s.active)return this;var L=l(W,"onActivate"),ee=l(W,"onPostActivate"),J=l(W,"checkCanFocusTrap"),se=Or.getActiveTrap(i),he=!1;if(se&&!se.paused){var oe;(oe=se._setSubtreeIsolation)===null||oe===void 0||oe.call(se,!1),he=!0}try{J||p(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=m(r),L?.();var we=function(){J&&p(),R(),O(),o.isolateSubtrees&&a._setSubtreeIsolation(!0),ee?.()};if(J)return J(s.containers.concat()).then(we,we),this;we()}catch(ie){if(se===Or.getActiveTrap(i)&&he){var X;(X=se._setSubtreeIsolation)===null||X===void 0||X.call(se,!0)}throw ie}return this},deactivate:function(W){if(!s.active)return this;var L=yw({onDeactivate:o.onDeactivate,onPostDeactivate:o.onPostDeactivate,checkCanReturnFocus:o.checkCanReturnFocus},W);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,s.paused||a._setSubtreeIsolation(!1),s.alreadySilent.clear(),A(),s.active=!1,s.paused=!1,O(),Or.deactivateTrap(i,a);var ee=l(L,"onDeactivate"),J=l(L,"onPostDeactivate"),se=l(L,"checkCanReturnFocus"),he=l(L,"returnFocus","returnFocusOnDeactivate");ee?.();var oe=function(){bw(function(){he&&b(w(s.nodeFocusedBeforeActivation)),J?.()})};return he&&se?(se(w(s.nodeFocusedBeforeActivation)).then(oe,oe),this):(oe(),this)},pause:function(W){return s.active?(s.manuallyPaused=!0,this._setPausedState(!0,W)):this},unpause:function(W){return s.active?(s.manuallyPaused=!1,i[i.length-1]!==this?this:this._setPausedState(!1,W)):this},updateContainerElements:function(W){var L=[].concat(W).filter(Boolean);return s.containers=L.map(function(ee){return typeof ee=="string"?r.querySelector(ee):ee}),o.isolateSubtrees&&C(s.containers),s.active&&(p(),o.isolateSubtrees&&!s.paused&&a._setSubtreeIsolation(!0)),O(),this}},Object.defineProperties(a,{_isManuallyPaused:{value:function(){return s.manuallyPaused}},_setPausedState:{value:function(W,L){if(s.paused===W)return this;if(s.paused=W,W){var ee=l(L,"onPause"),J=l(L,"onPostPause");ee?.(),A(),O(),a._setSubtreeIsolation(!1),J?.()}else{var se=l(L,"onUnpause"),he=l(L,"onPostUnpause");se?.(),a._setSubtreeIsolation(!0),p(),R(),O(),he?.()}return this}},_setSubtreeIsolation:{value:function(W){o.isolateSubtrees&&s.adjacentElements.forEach(function(L){var ee;W?o.isolateSubtrees==="aria-hidden"?((L.ariaHidden==="true"||((ee=L.getAttribute("aria-hidden"))===null||ee===void 0?void 0:ee.toLowerCase())==="true")&&s.alreadySilent.add(L),L.setAttribute("aria-hidden","true")):((L.inert||L.hasAttribute("inert"))&&s.alreadySilent.add(L),L.setAttribute("inert",!0)):s.alreadySilent.has(L)||(o.isolateSubtrees==="aria-hidden"?L.removeAttribute("aria-hidden"):L.removeAttribute("inert"))})}}}),a.updateContainerElements(t),a};function x8(e){return e}const b_={escapeDeactivates:{type:Boolean,default:!0},returnFocusOnDeactivate:{type:Boolean,default:!0},allowOutsideClick:{type:[Boolean,Function],default:!0},clickOutsideDeactivates:[Boolean,Function],initialFocus:[String,Function,Boolean],fallbackFocus:[String,Function],checkCanFocusTrap:Function,checkCanReturnFocus:Function,delayInitialFocus:{type:Boolean,default:!0},document:Object,preventScroll:Boolean,setReturnFocus:[Object,String,Boolean,Function],tabbableOptions:Object},w_=Fe({name:"FocusTrap",props:Object.assign({active:{type:Boolean,default:!0}},b_),emits:["update:active","activate","postActivate","deactivate","postDeactivate"],render(){return this.renderImpl()},setup(e,{slots:t,emit:n}){let r;const i=ae(null),o=M(()=>{const a=i.value;return a&&(a instanceof HTMLElement?a:a.$el)});function s(){return r||(r=v_(o.value,{escapeDeactivates:e.escapeDeactivates,allowOutsideClick:e.allowOutsideClick,returnFocusOnDeactivate:e.returnFocusOnDeactivate,clickOutsideDeactivates:e.clickOutsideDeactivates,onActivate:()=>{n("update:active",!0),n("activate")},onDeactivate:()=>{n("update:active",!1),n("deactivate")},onPostActivate:()=>n("postActivate"),onPostDeactivate:()=>n("postDeactivate"),initialFocus:e.initialFocus,fallbackFocus:e.fallbackFocus,tabbableOptions:e.tabbableOptions,delayInitialFocus:e.delayInitialFocus,preventScroll:e.preventScroll}))}return $t(()=>{ot(()=>e.active,a=>{a&&o.value?s().activate():r&&(r.deactivate(),(!o.value||o.value.nodeType===Node.COMMENT_NODE)&&(r=null))},{immediate:!0,flush:"post"})}),Pl(()=>{r&&r.deactivate(),r=null}),{activate(){s().activate()},deactivate(){r&&r.deactivate()},renderImpl(){if(!t.default)return null;const a=t.default().filter(u=>u.type!==Ii);return!a||!a.length||a.length>1?(console.error("[focus-trap-vue]: FocusTrap requires exactly one child."),a):Oi(a[0],{ref:i})}}}}),Sn=Fe({__name:"OcButton",props:{appearance:{default:"outline"},ariaLabel:{},colorRole:{default:"secondary"},disabled:{type:Boolean,default:!1},gapSize:{default:"medium"},href:{},justifyContent:{default:"center"},showSpinner:{type:Boolean,default:!1},size:{default:"medium"},submit:{default:"button"},target:{},to:{},type:{default:"button"},noHover:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:t}){const n=t,r=M(()=>({...e.href&&{href:e.href},...e.target&&{target:e.target},...e.to&&{to:e.to},...e.type==="button"&&{type:e.submit},...e.type==="button"&&{disabled:e.disabled}})),i=M(()=>({...e.type==="button"&&{click:o}})),o=s=>{n("click",s)};return(s,a)=>{const l=Ee("oc-spinner");return Y(),Te(On(e.type),Mt(r.value,{"aria-label":e.ariaLabel,class:[[`oc-button-${f(At.kebabCase)(e.colorRole)}`,`oc-button-${e.appearance}`,`oc-button-${f(At.kebabCase)(e.colorRole)}-${e.appearance}`,{...f(CO)(e.gapSize),...f(RO)(e.justifyContent),"text-sm min-h-3":e.size==="small","text-base min-h-4":e.size==="medium","text-lg min-h-7":e.size==="large","no-hover":e.noHover}],"oc-button cursor-pointer disabled:opacity-60 disabled:cursor-default"]},Fs(i.value)),{default:ve(()=>[e.showSpinner?(Y(),Te(l,{key:0,size:"small",class:"spinner"})):ke("",!0),Ve(s.$slots,"default")]),_:3},16,["aria-label","class"])}}}),S_=["src"],ud=Fe({__name:"OcCard",props:{tag:{default:"div"},title:{},titleTag:{default:"h2"},logoUrl:{default:""},headerClass:{default:""},bodyClass:{default:""},footerClass:{default:""}},setup(e){const t=zp(),n=M(()=>Object.hasOwn(t,"header")||!!f(e.title)||!!f(e.logoUrl)),r=M(()=>Object.hasOwn(t,"footer"));return(i,o)=>(Y(),Te(On(e.tag),{class:"oc-card"},{default:ve(()=>[n.value?(Y(),pe("div",{key:0,class:q.normalizeClass(["oc-card-header",e.headerClass])},[Ve(i.$slots,"header",{},()=>[e.logoUrl?(Y(),pe("img",{key:0,src:e.logoUrl,alt:"","aria-hidden":!0,class:"max-w-48 max-h-48 absolute -translate-y-16"},null,8,S_)):ke("",!0),e.title?(Y(),Te(On(e.titleTag),{key:1,class:"mt-0"},{default:ve(()=>[kt(q.toDisplayString(e.title),1)]),_:1})):ke("",!0)])],2)):ke("",!0),ue("div",{class:q.normalizeClass(["oc-card-body",e.bodyClass])},[Ve(i.$slots,"default")],2),r.value?(Y(),pe("div",{key:1,class:q.normalizeClass(["oc-card-footer",e.footerClass])},[Ve(i.$slots,"footer")],2)):ke("",!0)]),_:3}))}}),ww=({target:e,mode:t="show",rootMargin:n="100px",onVisibleCallback:r})=>{if(!(window&&"IntersectionObserver"in window))return{isVisible:ae(!0)};const o=ae(!1),s=new IntersectionObserver(a=>{const l=a.at(-1).isIntersecting;o.value=l,f(o)&&r&&r(),t!=="showHide"&&o.value&&s.unobserve(e.value)},{rootMargin:n});return ot(e,()=>{s.observe(e.value)}),xn(()=>s.disconnect()),{isVisible:o}},Sw=()=>{const{width:e}=Vn.useWindowSize();return{isMobile:M(()=>e.value<640)}},E_=Me.defineStore("bottomDrawers",()=>{const e=ae([]),t=M(()=>f(e).length?f(e)[f(e).length-1]:null);return{drawers:e,currentDrawer:t,showDrawer:()=>{const o={id:hi()};return e.value.push(o),o},closeDrawer:o=>{e.value=f(e).filter(s=>s.id!==o)},closeAllDrawers:()=>{e.value=[]}}}),T_=["id"],A_=["textContent"],x_=Fe({__name:"OcBottomDrawer",props:{drawerId:{},toggle:{},closeOnClick:{type:Boolean,default:!1},title:{default:""},usePortal:{type:Boolean,default:!1},portalTarget:{default:"app.runtime.bottom.drawer"}},emits:["show","hide"],setup(e,{expose:t,emit:n}){const r=n,{$gettext:i}=Oe.useGettext(),o=E_(),{showDrawer:s,closeDrawer:a,closeAllDrawers:l}=o,{drawers:u,currentDrawer:c}=Me.storeToRefs(o),d=ae(null),p=An("bottomDrawerCardBodyRef"),m=M(()=>f(u).map(({id:v})=>v).includes(f(d)?.id)),b=M(()=>f(d)?.id&&f(c)?.id===f(d).id),w=async()=>{d.value=s(),r("show"),await Vt(),f(p)?.addEventListener("click",y)},S=()=>{a(f(d)?.id),f(p)?.removeEventListener("click",y),r("hide")},y=v=>{const h=v.target.closest("a[href], button");if(h){if(h.hasAttribute("aria-expanded")){h.setAttribute("aria-expanded","true");return}e.closeOnClick&&(S(),l())}},g=v=>{v.target===v.currentTarget&&l()};return Vn.onKeyStroke("Escape",v=>{v.preventDefault(),l()}),$t(()=>{f(e.toggle)&&document.querySelector(e.toggle).addEventListener("click",w)}),xn(()=>{document.querySelector(e.toggle).removeEventListener("click",w),f(d)&&a(f(d).id)}),ot(b,async()=>{f(b)&&(await Vt(),document.getElementById(e.drawerId)?.classList.add("active"))}),t({show:w,hide:S}),(v,h)=>{const E=Ee("oc-icon");return m.value?(Y(),Te(On(e.usePortal?"portal":"div"),{key:0,to:e.usePortal?e.portalTarget:void 0},{default:ve(()=>[ue("div",{class:"oc-bottom-drawer-background fixed inset-0 z-[calc(var(--z-index-modal)+2)] top-0 left-0 bg-black/40 size-full",role:"button",onClick:g},[me(f(w_),{active:b.value},{default:ve(()=>[ue("div",{id:e.drawerId,tabindex:"0",class:q.normalizeClass(["oc-bottom-drawer fixed inset-x-0 bg-role-surface-container-high rounded-t-sm w-full max-h-[66vh] overflow-y-auto transition-all duration-200 bottom-[-100%]",{"[&.active]:bottom-0":b.value}])},[me(ud,{class:"bg-transparent overflow-x-hidden","header-class":"flex flex-row justify-between items-center"},{header:ve(()=>[f(u).length>1?(Y(),Te(Sn,{key:0,appearance:"raw",class:"raw-hover-surface oc-bottom-drawer-back-button","aria-label":f(i)("Open the parent context menu"),onClick:h[0]||(h[0]=T=>S())},{default:ve(()=>[me(E,{name:"arrow-left","fill-type":"line"})]),_:1},8,["aria-label"])):ke("",!0),ue("span",{class:"font-semibold",textContent:q.toDisplayString(e.title)},null,8,A_),me(Sn,{appearance:"raw",class:"raw-hover-surface oc-bottom-drawer-close-button","aria-label":f(i)("Close the context menu"),onClick:h[1]||(h[1]=T=>f(l)())},{default:ve(()=>[me(E,{name:"close","fill-type":"line"})]),_:1},8,["aria-label"])]),default:ve(()=>[ue("div",{ref_key:"bottomDrawerCardBodyRef",ref:p},[Ve(v.$slots,"default")],512)]),_:3})],10,T_)]),_:3},8,["active"])])]),_:3},8,["to"])):ke("",!0)}}});var En="top",Bn="bottom",jn="right",Tn="left",fd="auto",Qo=[En,Bn,jn,Tn],Ji="start",Xo="end",C_="clippingParents",Ew="viewport",Yo="popper",R_="reference",Tw=Qo.reduce(function(e,t){return e.concat([t+"-"+Ji,t+"-"+Xo])},[]),Aw=[].concat(Qo,[fd]).reduce(function(e,t){return e.concat([t,t+"-"+Ji,t+"-"+Xo])},[]),k_="beforeRead",P_="read",I_="afterRead",O_="beforeMain",F_="main",__="afterMain",D_="beforeWrite",N_="write",L_="afterWrite",$_=[k_,P_,I_,O_,F_,__,D_,N_,L_];function pr(e){return e?(e.nodeName||"").toLowerCase():null}function kn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function bi(e){var t=kn(e).Element;return e instanceof t||e instanceof Element}function Un(e){var t=kn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function dd(e){if(typeof ShadowRoot>"u")return!1;var t=kn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function M_(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!Un(o)||!pr(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function B_(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),a=s.reduce(function(l,u){return l[u]="",l},{});!Un(i)||!pr(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const xw={name:"applyStyles",enabled:!0,phase:"write",fn:M_,effect:B_,requires:["computeStyles"]};function hr(e){return e.split("-")[0]}var wi=Math.max,Ba=Math.min,Zi=Math.round;function pd(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Cw(){return!/^((?!chrome|android).)*safari/i.test(pd())}function eo(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&Un(e)&&(i=e.offsetWidth>0&&Zi(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Zi(r.height)/e.offsetHeight||1);var s=bi(e)?kn(e):window,a=s.visualViewport,l=!Cw()&&n,u=(r.left+(l&&a?a.offsetLeft:0))/i,c=(r.top+(l&&a?a.offsetTop:0))/o,d=r.width/i,p=r.height/o;return{width:d,height:p,top:c,right:u+d,bottom:c+p,left:u,x:u,y:c}}function hd(e){var t=eo(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Rw(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&dd(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Fr(e){return kn(e).getComputedStyle(e)}function j_(e){return["table","td","th"].indexOf(pr(e))>=0}function Xr(e){return((bi(e)?e.ownerDocument:e.document)||window.document).documentElement}function ja(e){return pr(e)==="html"?e:e.assignedSlot||e.parentNode||(dd(e)?e.host:null)||Xr(e)}function kw(e){return!Un(e)||Fr(e).position==="fixed"?null:e.offsetParent}function U_(e){var t=/firefox/i.test(pd()),n=/Trident/i.test(pd());if(n&&Un(e)){var r=Fr(e);if(r.position==="fixed")return null}var i=ja(e);for(dd(i)&&(i=i.host);Un(i)&&["html","body"].indexOf(pr(i))<0;){var o=Fr(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Jo(e){for(var t=kn(e),n=kw(e);n&&j_(n)&&Fr(n).position==="static";)n=kw(n);return n&&(pr(n)==="html"||pr(n)==="body"&&Fr(n).position==="static")?t:n||U_(e)||t}function md(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Zo(e,t,n){return wi(e,Ba(t,n))}function V_(e,t,n){var r=Zo(e,t,n);return r>n?n:r}function Pw(){return{top:0,right:0,bottom:0,left:0}}function Iw(e){return Object.assign({},Pw(),e)}function Ow(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var q_=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Iw(typeof t!="number"?t:Ow(t,Qo))};function z_(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=hr(n.placement),l=md(a),u=[Tn,jn].indexOf(a)>=0,c=u?"height":"width";if(!(!o||!s)){var d=q_(i.padding,n),p=hd(o),m=l==="y"?En:Tn,b=l==="y"?Bn:jn,w=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],S=s[l]-n.rects.reference[l],y=Jo(o),g=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,v=w/2-S/2,h=d[m],E=g-p[c]-d[b],T=g/2-p[c]/2+v,R=Zo(h,T,E),C=l;n.modifiersData[r]=(t={},t[C]=R,t.centerOffset=R-T,t)}}function W_(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||Rw(t.elements.popper,i)&&(t.elements.arrow=i))}const H_={name:"arrow",enabled:!0,phase:"main",fn:z_,effect:W_,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function to(e){return e.split("-")[1]}var K_={top:"auto",right:"auto",bottom:"auto",left:"auto"};function G_(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:Zi(n*i)/i||0,y:Zi(r*i)/i||0}}function Fw(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,p=s.x,m=p===void 0?0:p,b=s.y,w=b===void 0?0:b,S=typeof c=="function"?c({x:m,y:w}):{x:m,y:w};m=S.x,w=S.y;var y=s.hasOwnProperty("x"),g=s.hasOwnProperty("y"),v=Tn,h=En,E=window;if(u){var T=Jo(n),R="clientHeight",C="clientWidth";if(T===kn(n)&&(T=Xr(n),Fr(T).position!=="static"&&a==="absolute"&&(R="scrollHeight",C="scrollWidth")),T=T,i===En||(i===Tn||i===jn)&&o===Xo){h=Bn;var A=d&&T===E&&E.visualViewport?E.visualViewport.height:T[R];w-=A-r.height,w*=l?1:-1}if(i===Tn||(i===En||i===Bn)&&o===Xo){v=jn;var D=d&&T===E&&E.visualViewport?E.visualViewport.width:T[C];m-=D-r.width,m*=l?1:-1}}var V=Object.assign({position:a},u&&K_),O=c===!0?G_({x:m,y:w},kn(n)):{x:m,y:w};if(m=O.x,w=O.y,l){var N;return Object.assign({},V,(N={},N[h]=g?"0":"",N[v]=y?"0":"",N.transform=(E.devicePixelRatio||1)<=1?"translate("+m+"px, "+w+"px)":"translate3d("+m+"px, "+w+"px, 0)",N))}return Object.assign({},V,(t={},t[h]=g?w+"px":"",t[v]=y?m+"px":"",t.transform="",t))}function Q_(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,u={placement:hr(t.placement),variation:to(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Fw(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Fw(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const X_={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Q_,data:{}};var Ua={passive:!0};function Y_(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,l=kn(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",n.update,Ua)}),a&&l.addEventListener("resize",n.update,Ua),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",n.update,Ua)}),a&&l.removeEventListener("resize",n.update,Ua)}}const J_={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Y_,data:{}};var Z_={left:"right",right:"left",bottom:"top",top:"bottom"};function Va(e){return e.replace(/left|right|bottom|top/g,function(t){return Z_[t]})}var eD={start:"end",end:"start"};function _w(e){return e.replace(/start|end/g,function(t){return eD[t]})}function gd(e){var t=kn(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function yd(e){return eo(Xr(e)).left+gd(e).scrollLeft}function tD(e,t){var n=kn(e),r=Xr(e),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var u=Cw();(u||!u&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+yd(e),y:l}}function nD(e){var t,n=Xr(e),r=gd(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=wi(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=wi(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+yd(e),l=-r.scrollTop;return Fr(i||n).direction==="rtl"&&(a+=wi(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function vd(e){var t=Fr(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Dw(e){return["html","body","#document"].indexOf(pr(e))>=0?e.ownerDocument.body:Un(e)&&vd(e)?e:Dw(ja(e))}function es(e,t){var n;t===void 0&&(t=[]);var r=Dw(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=kn(r),s=i?[o].concat(o.visualViewport||[],vd(r)?r:[]):r,a=t.concat(s);return i?a:a.concat(es(ja(s)))}function bd(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function rD(e,t){var n=eo(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Nw(e,t,n){return t===Ew?bd(tD(e,n)):bi(t)?rD(t,n):bd(nD(Xr(e)))}function iD(e){var t=es(ja(e)),n=["absolute","fixed"].indexOf(Fr(e).position)>=0,r=n&&Un(e)?Jo(e):e;return bi(r)?t.filter(function(i){return bi(i)&&Rw(i,r)&&pr(i)!=="body"}):[]}function oD(e,t,n,r){var i=t==="clippingParents"?iD(e):[].concat(t),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(l,u){var c=Nw(e,u,r);return l.top=wi(c.top,l.top),l.right=Ba(c.right,l.right),l.bottom=Ba(c.bottom,l.bottom),l.left=wi(c.left,l.left),l},Nw(e,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Lw(e){var t=e.reference,n=e.element,r=e.placement,i=r?hr(r):null,o=r?to(r):null,s=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(i){case En:l={x:s,y:t.y-n.height};break;case Bn:l={x:s,y:t.y+t.height};break;case jn:l={x:t.x+t.width,y:a};break;case Tn:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var u=i?md(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(o){case Ji:l[u]=l[u]-(t[c]/2-n[c]/2);break;case Xo:l[u]=l[u]+(t[c]/2-n[c]/2);break}}return l}function no(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,s=o===void 0?e.strategy:o,a=n.boundary,l=a===void 0?C_:a,u=n.rootBoundary,c=u===void 0?Ew:u,d=n.elementContext,p=d===void 0?Yo:d,m=n.altBoundary,b=m===void 0?!1:m,w=n.padding,S=w===void 0?0:w,y=Iw(typeof S!="number"?S:Ow(S,Qo)),g=p===Yo?R_:Yo,v=e.rects.popper,h=e.elements[b?g:p],E=oD(bi(h)?h:h.contextElement||Xr(e.elements.popper),l,c,s),T=eo(e.elements.reference),R=Lw({reference:T,element:v,placement:i}),C=bd(Object.assign({},v,R)),A=p===Yo?C:T,D={top:E.top-A.top+y.top,bottom:A.bottom-E.bottom+y.bottom,left:E.left-A.left+y.left,right:A.right-E.right+y.right},V=e.modifiersData.offset;if(p===Yo&&V){var O=V[i];Object.keys(D).forEach(function(N){var W=[jn,Bn].indexOf(N)>=0?1:-1,L=[En,Bn].indexOf(N)>=0?"y":"x";D[N]+=O[L]*W})}return D}function sD(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?Aw:l,c=to(r),d=c?a?Tw:Tw.filter(function(b){return to(b)===c}):Qo,p=d.filter(function(b){return u.indexOf(b)>=0});p.length===0&&(p=d);var m=p.reduce(function(b,w){return b[w]=no(e,{placement:w,boundary:i,rootBoundary:o,padding:s})[hr(w)],b},{});return Object.keys(m).sort(function(b,w){return m[b]-m[w]})}function aD(e){if(hr(e)===fd)return[];var t=Va(e);return[_w(e),t,_w(t)]}function lD(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,p=n.altBoundary,m=n.flipVariations,b=m===void 0?!0:m,w=n.allowedAutoPlacements,S=t.options.placement,y=hr(S),g=y===S,v=l||(g||!b?[Va(S)]:aD(S)),h=[S].concat(v).reduce(function(le,Ae){return le.concat(hr(Ae)===fd?sD(t,{placement:Ae,boundary:c,rootBoundary:d,padding:u,flipVariations:b,allowedAutoPlacements:w}):Ae)},[]),E=t.rects.reference,T=t.rects.popper,R=new Map,C=!0,A=h[0],D=0;D<h.length;D++){var V=h[D],O=hr(V),N=to(V)===Ji,W=[En,Bn].indexOf(O)>=0,L=W?"width":"height",ee=no(t,{placement:V,boundary:c,rootBoundary:d,altBoundary:p,padding:u}),J=W?N?jn:Tn:N?Bn:En;E[L]>T[L]&&(J=Va(J));var se=Va(J),he=[];if(o&&he.push(ee[O]<=0),a&&he.push(ee[J]<=0,ee[se]<=0),he.every(function(le){return le})){A=V,C=!1;break}R.set(V,he)}if(C)for(var oe=b?3:1,we=function(Ae){var te=h.find(function(F){var x=R.get(F);if(x)return x.slice(0,Ae).every(function(G){return G})});if(te)return A=te,"break"},X=oe;X>0;X--){var ie=we(X);if(ie==="break")break}t.placement!==A&&(t.modifiersData[r]._skip=!0,t.placement=A,t.reset=!0)}}const cD={name:"flip",enabled:!0,phase:"main",fn:lD,requiresIfExists:["offset"],data:{_skip:!1}};function $w(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Mw(e){return[En,jn,Bn,Tn].some(function(t){return e[t]>=0})}function uD(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=no(t,{elementContext:"reference"}),a=no(t,{altBoundary:!0}),l=$w(s,r),u=$w(a,i,o),c=Mw(l),d=Mw(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}const fD={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:uD};function dD(e,t,n){var r=hr(e),i=[Tn,En].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[Tn,jn].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function pD(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,s=Aw.reduce(function(c,d){return c[d]=dD(d,t.rects,o),c},{}),a=s[t.placement],l=a.x,u=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=s}const hD={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:pD};function mD(e){var t=e.state,n=e.name;t.modifiersData[n]=Lw({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const gD={name:"popperOffsets",enabled:!0,phase:"read",fn:mD,data:{}};function yD(e){return e==="x"?"y":"x"}function vD(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,p=n.tether,m=p===void 0?!0:p,b=n.tetherOffset,w=b===void 0?0:b,S=no(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),y=hr(t.placement),g=to(t.placement),v=!g,h=md(y),E=yD(h),T=t.modifiersData.popperOffsets,R=t.rects.reference,C=t.rects.popper,A=typeof w=="function"?w(Object.assign({},t.rects,{placement:t.placement})):w,D=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),V=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(T){if(o){var N,W=h==="y"?En:Tn,L=h==="y"?Bn:jn,ee=h==="y"?"height":"width",J=T[h],se=J+S[W],he=J-S[L],oe=m?-C[ee]/2:0,we=g===Ji?R[ee]:C[ee],X=g===Ji?-C[ee]:-R[ee],ie=t.elements.arrow,le=m&&ie?hd(ie):{width:0,height:0},Ae=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Pw(),te=Ae[W],F=Ae[L],x=Zo(0,R[ee],le[ee]),G=v?R[ee]/2-oe-x-te-D.mainAxis:we-x-te-D.mainAxis,H=v?-R[ee]/2+oe+x+F+D.mainAxis:X+x+F+D.mainAxis,B=t.elements.arrow&&Jo(t.elements.arrow),z=B?h==="y"?B.clientTop||0:B.clientLeft||0:0,ge=(N=V?.[h])!=null?N:0,Re=J+G-ge-z,De=J+H-ge,Ce=Zo(m?Ba(se,Re):se,J,m?wi(he,De):he);T[h]=Ce,O[h]=Ce-J}if(a){var Ie,$e=h==="x"?En:Tn,ye=h==="x"?Bn:jn,Ke=T[E],Ge=E==="y"?"height":"width",Ye=Ke+S[$e],Ze=Ke-S[ye],wt=[En,Tn].indexOf(y)!==-1,St=(Ie=V?.[E])!=null?Ie:0,Et=wt?Ye:Ke-R[Ge]-C[Ge]-St+D.altAxis,Tt=wt?Ke+R[Ge]+C[Ge]-St-D.altAxis:Ze,at=m&&wt?V_(Et,Ke,Tt):Zo(m?Et:Ye,Ke,m?Tt:Ze);T[E]=at,O[E]=at-Ke}t.modifiersData[r]=O}}const bD={name:"preventOverflow",enabled:!0,phase:"main",fn:vD,requiresIfExists:["offset"]};function wD(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function SD(e){return e===kn(e)||!Un(e)?gd(e):wD(e)}function ED(e){var t=e.getBoundingClientRect(),n=Zi(t.width)/e.offsetWidth||1,r=Zi(t.height)/e.offsetHeight||1;return n!==1||r!==1}function TD(e,t,n){n===void 0&&(n=!1);var r=Un(t),i=Un(t)&&ED(t),o=Xr(t),s=eo(e,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((pr(t)!=="body"||vd(o))&&(a=SD(t)),Un(t)?(l=eo(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=yd(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function AD(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function xD(e){var t=AD(e);return $_.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function CD(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function RD(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Bw={placement:"bottom",modifiers:[],strategy:"absolute"};function jw(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function kD(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,o=i===void 0?Bw:i;return function(a,l,u){u===void 0&&(u=o);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},Bw,o),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},d=[],p=!1,m={state:c,setOptions:function(y){var g=typeof y=="function"?y(c.options):y;w(),c.options=Object.assign({},o,c.options,g),c.scrollParents={reference:bi(a)?es(a):a.contextElement?es(a.contextElement):[],popper:es(l)};var v=xD(RD([].concat(r,c.options.modifiers)));return c.orderedModifiers=v.filter(function(h){return h.enabled}),b(),m.update()},forceUpdate:function(){if(!p){var y=c.elements,g=y.reference,v=y.popper;if(jw(g,v)){c.rects={reference:TD(g,Jo(v),c.options.strategy==="fixed"),popper:hd(v)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(D){return c.modifiersData[D.name]=Object.assign({},D.data)});for(var h=0;h<c.orderedModifiers.length;h++){if(c.reset===!0){c.reset=!1,h=-1;continue}var E=c.orderedModifiers[h],T=E.fn,R=E.options,C=R===void 0?{}:R,A=E.name;typeof T=="function"&&(c=T({state:c,options:C,name:A,instance:m})||c)}}}},update:CD(function(){return new Promise(function(S){m.forceUpdate(),S(c)})}),destroy:function(){w(),p=!0}};if(!jw(a,l))return m;m.setOptions(u).then(function(S){!p&&u.onFirstUpdate&&u.onFirstUpdate(S)});function b(){c.orderedModifiers.forEach(function(S){var y=S.name,g=S.options,v=g===void 0?{}:g,h=S.effect;if(typeof h=="function"){var E=h({state:c,name:y,instance:m,options:v}),T=function(){};d.push(E||T)}})}function w(){d.forEach(function(S){return S()}),d=[]}return m}}var PD=[J_,gD,X_,xw,hD,cD,bD,H_,fD],ID=kD({defaultModifiers:PD}),OD="tippy-box",Uw="tippy-content",FD="tippy-backdrop",Vw="tippy-arrow",qw="tippy-svg-arrow",Si={passive:!0,capture:!0},zw=function(){return document.body};function _D(e,t){return{}.hasOwnProperty.call(e,t)}function wd(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function Sd(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function Ww(e,t){return typeof e=="function"?e.apply(void 0,t):e}function Hw(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function DD(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function ND(e){return e.split(/\s+/).filter(Boolean)}function ro(e){return[].concat(e)}function Kw(e,t){e.indexOf(t)===-1&&e.push(t)}function LD(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function $D(e){return e.split("-")[0]}function qa(e){return[].slice.call(e)}function Gw(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function ts(){return document.createElement("div")}function ns(e){return["Element","Fragment"].some(function(t){return Sd(e,t)})}function MD(e){return Sd(e,"NodeList")}function BD(e){return Sd(e,"MouseEvent")}function Qw(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function jD(e){return ns(e)?[e]:MD(e)?qa(e):Array.isArray(e)?e:qa(document.querySelectorAll(e))}function Ed(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function Xw(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function UD(e){var t,n=ro(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function VD(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,s=i.popperState,a=i.props,l=a.interactiveBorder,u=$D(s.placement),c=s.modifiersData.offset;if(!c)return!0;var d=u==="bottom"?c.top.y:0,p=u==="top"?c.bottom.y:0,m=u==="right"?c.left.x:0,b=u==="left"?c.right.x:0,w=o.top-r+d>l,S=r-o.bottom-p>l,y=o.left-n+m>l,g=n-o.right-b>l;return w||S||y||g})}function Td(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function Yw(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var mr={isTouch:!1},Jw=0;function qD(){mr.isTouch||(mr.isTouch=!0,window.performance&&document.addEventListener("mousemove",Zw))}function Zw(){var e=performance.now();e-Jw<20&&(mr.isTouch=!1,document.removeEventListener("mousemove",Zw)),Jw=e}function zD(){var e=document.activeElement;if(Qw(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function WD(){document.addEventListener("touchstart",qD,Si),window.addEventListener("blur",zD)}var HD=typeof window<"u"&&typeof document<"u",KD=HD?!!window.msCrypto:!1;function io(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function e0(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function GD(e){return e0(`
1
+ (function(x,z){typeof exports=="object"&&typeof module<"u"?z(exports,require("@opencloud-eu/web-client"),require("@casl/vue"),require("vue3-gettext"),require("fuse.js"),require("lodash-es"),require("axios"),require("uuid"),require("@microsoft/fetch-event-source"),require("vue-concurrency"),require("luxon"),require("filesize"),require("qs"),require("password-sheriff"),require("@uppy/core"),require("@uppy/tus"),require("@uppy/xhr-upload"),require("@uppy/utils"),require("pinia"),require("oidc-client-ts"),require("@vueuse/core"),require("deepmerge"),require("portal-vue"),require("dompurify"),require("mark.js"),require("p-queue"),require("cropperjs"),require("vue-router"),require("@vue/shared"),require("md-editor-v3"),require("zod"),require("@sentry/vue"),require("screenfull"),require("@codemirror/view")):typeof define=="function"&&define.amd?define(["exports","@opencloud-eu/web-client","@casl/vue","vue3-gettext","fuse.js","lodash-es","axios","uuid","@microsoft/fetch-event-source","vue-concurrency","luxon","filesize","qs","password-sheriff","@uppy/core","@uppy/tus","@uppy/xhr-upload","@uppy/utils","pinia","oidc-client-ts","@vueuse/core","deepmerge","portal-vue","dompurify","mark.js","p-queue","cropperjs","vue-router","@vue/shared","md-editor-v3","zod","@sentry/vue","screenfull","@codemirror/view"],z):(x=typeof globalThis<"u"?globalThis:x||self,z(x["web-pkg"]={},x.webClient,x.vue,x.vue3Gettext,x.Fuse,x.lodashEs,x.globalAxios,x.uuid,x.fetchEventSource,x.vueConcurrency,x.luxon,x.filesize,x.qs,x.passwordSheriff,x.Uppy,x.Tus,x.XHRUpload,x.utils,x.pinia,x.oidcClientTs,x.core,x.merge$1,x.portalVue,x.DOMPurify,x.Mark,x.PQueue,x.Cropper,x.vueRouter,x.shared,x.mdEditorV3,x.zod,x.vue$1,x.screenfull,x.view))})(this,(function(x,z,Pg,me,Nc,rt,Es,Ct,Ig,$t,vt,Fg,$g,Og,Bc,Lg,_g,jc,we,Mg,Rn,zc,Rs,Uc,Vc,ur,ca,Ds,R,Ro,K,Ng,Bg,jg){"use strict";const zg=e=>e;function qc(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function Ug(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hc={exports:{}},ht=Hc.exports={},Dn,Pn;function ua(){throw new Error("setTimeout has not been defined")}function da(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Dn=setTimeout:Dn=ua}catch{Dn=ua}try{typeof clearTimeout=="function"?Pn=clearTimeout:Pn=da}catch{Pn=da}})();function Wc(e){if(Dn===setTimeout)return setTimeout(e,0);if((Dn===ua||!Dn)&&setTimeout)return Dn=setTimeout,setTimeout(e,0);try{return Dn(e,0)}catch{try{return Dn.call(null,e,0)}catch{return Dn.call(this,e,0)}}}function Vg(e){if(Pn===clearTimeout)return clearTimeout(e);if((Pn===da||!Pn)&&clearTimeout)return Pn=clearTimeout,clearTimeout(e);try{return Pn(e)}catch{try{return Pn.call(null,e)}catch{return Pn.call(this,e)}}}var Hn=[],Kr=!1,xr,Ps=-1;function qg(){!Kr||!xr||(Kr=!1,xr.length?Hn=xr.concat(Hn):Ps=-1,Hn.length&&Qc())}function Qc(){if(!Kr){var e=Wc(qg);Kr=!0;for(var t=Hn.length;t;){for(xr=Hn,Hn=[];++Ps<t;)xr&&xr[Ps].run();Ps=-1,t=Hn.length}xr=null,Kr=!1,Vg(e)}}ht.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Hn.push(new Kc(e,t)),Hn.length===1&&!Kr&&Wc(Qc)};function Kc(e,t){this.fun=e,this.array=t}Kc.prototype.run=function(){this.fun.apply(null,this.array)},ht.title="browser",ht.browser=!0,ht.env={},ht.argv=[],ht.version="",ht.versions={};function Wn(){}ht.on=Wn,ht.addListener=Wn,ht.once=Wn,ht.off=Wn,ht.removeListener=Wn,ht.removeAllListeners=Wn,ht.emit=Wn,ht.prependListener=Wn,ht.prependOnceListener=Wn,ht.listeners=function(e){return[]},ht.binding=function(e){throw new Error("process.binding is not supported")},ht.cwd=function(){return"/"},ht.chdir=function(e){throw new Error("process.chdir is not supported")},ht.umask=function(){return 0};var Hg=Hc.exports;const ce=Ug(Hg);function In(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let Qe;const fa=new WeakSet;class Wg{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,fa.has(this)&&(fa.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Jc(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,tu(this),Xc(this);const t=Qe,n=gn;Qe=this,gn=!0;try{return this.fn()}finally{ce.env.NODE_ENV!=="production"&&Qe!==this&&In("Active effect was not restored correctly - this is likely a Vue internal bug."),Yc(this),Qe=t,gn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)ga(t);this.deps=this.depsTail=void 0,tu(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?fa.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ma(this)&&this.run()}get dirty(){return ma(this)}}let Gc=0,Do,Po;function Jc(e,t=!1){if(e.flags|=8,t){e.next=Po,Po=e;return}e.next=Do,Do=e}function pa(){Gc++}function ha(){if(--Gc>0)return;if(Po){let t=Po;for(Po=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Do;){let t=Do;for(Do=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function Xc(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Yc(e){let t,n=e.depsTail,r=n;for(;r;){const o=r.prevDep;r.version===-1?(r===n&&(n=o),ga(r),Qg(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}e.deps=t,e.depsTail=n}function ma(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Zc(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Zc(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Io)||(e.globalVersion=Io,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ma(e))))return;e.flags|=2;const t=e.dep,n=Qe,r=gn;Qe=e,gn=!0;try{Xc(e);const o=e.fn(e._value);(t.version===0||R.hasChanged(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{Qe=n,gn=r,Yc(e),e.flags&=-3}}function ga(e,t=!1){const{dep:n,prevSub:r,nextSub:o}=e;if(r&&(r.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=r,e.nextSub=void 0),ce.env.NODE_ENV!=="production"&&n.subsHead===e&&(n.subsHead=o),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)ga(s,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Qg(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let gn=!0;const eu=[];function Gr(){eu.push(gn),gn=!1}function Jr(){const e=eu.pop();gn=e===void 0?!0:e}function tu(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Qe;Qe=void 0;try{t()}finally{Qe=n}}}let Io=0;class Kg{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Is{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0,ce.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(t){if(!Qe||!gn||Qe===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Qe)n=this.activeLink=new Kg(Qe,this),Qe.deps?(n.prevDep=Qe.depsTail,Qe.depsTail.nextDep=n,Qe.depsTail=n):Qe.deps=Qe.depsTail=n,nu(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=Qe.depsTail,n.nextDep=void 0,Qe.depsTail.nextDep=n,Qe.depsTail=n,Qe.deps===n&&(Qe.deps=r)}return ce.env.NODE_ENV!=="production"&&Qe.onTrack&&Qe.onTrack(R.extend({effect:Qe},t)),n}trigger(t){this.version++,Io++,this.notify(t)}notify(t){pa();try{if(ce.env.NODE_ENV!=="production")for(let n=this.subsHead;n;n=n.nextSub)n.sub.onTrigger&&!(n.sub.flags&8)&&n.sub.onTrigger(R.extend({effect:n.sub},t));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{ha()}}}function nu(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)nu(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),ce.env.NODE_ENV!=="production"&&e.dep.subsHead===void 0&&(e.dep.subsHead=e),e.dep.subs=e}}const Fs=new WeakMap,Ar=Symbol(ce.env.NODE_ENV!=="production"?"Object iterate":""),va=Symbol(ce.env.NODE_ENV!=="production"?"Map keys iterate":""),Fo=Symbol(ce.env.NODE_ENV!=="production"?"Array iterate":"");function Et(e,t,n){if(gn&&Qe){let r=Fs.get(e);r||Fs.set(e,r=new Map);let o=r.get(n);o||(r.set(n,o=new Is),o.map=r,o.key=n),ce.env.NODE_ENV!=="production"?o.track({target:e,type:t,key:n}):o.track()}}function dr(e,t,n,r,o,s){const i=Fs.get(e);if(!i){Io++;return}const l=u=>{u&&(ce.env.NODE_ENV!=="production"?u.trigger({target:e,type:t,key:n,newValue:r,oldValue:o,oldTarget:s}):u.trigger())};if(pa(),t==="clear")i.forEach(l);else{const u=R.isArray(e),d=u&&R.isIntegerKey(n);if(u&&n==="length"){const c=Number(r);i.forEach((p,f)=>{(f==="length"||f===Fo||!R.isSymbol(f)&&f>=c)&&l(p)})}else switch((n!==void 0||i.has(void 0))&&l(i.get(n)),d&&l(i.get(Fo)),t){case"add":u?d&&l(i.get("length")):(l(i.get(Ar)),R.isMap(e)&&l(i.get(va)));break;case"delete":u||(l(i.get(Ar)),R.isMap(e)&&l(i.get(va)));break;case"set":R.isMap(e)&&l(i.get(Ar));break}}ha()}function Gg(e,t){const n=Fs.get(e);return n&&n.get(t)}function Xr(e){const t=Be(e);return t===e?t:(Et(t,"iterate",Fo),Ot(e)?t:t.map(yn))}function $s(e){return Et(e=Be(e),"iterate",Fo),e}function fr(e,t){return vn(e)?Yr(hr(e)?yn(t):t):yn(t)}const Jg={__proto__:null,[Symbol.iterator](){return ya(this,Symbol.iterator,e=>fr(this,e))},concat(...e){return Xr(this).concat(...e.map(t=>R.isArray(t)?Xr(t):t))},entries(){return ya(this,"entries",e=>(e[1]=fr(this,e[1]),e))},every(e,t){return Qn(this,"every",e,t,void 0,arguments)},filter(e,t){return Qn(this,"filter",e,t,n=>n.map(r=>fr(this,r)),arguments)},find(e,t){return Qn(this,"find",e,t,n=>fr(this,n),arguments)},findIndex(e,t){return Qn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Qn(this,"findLast",e,t,n=>fr(this,n),arguments)},findLastIndex(e,t){return Qn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Qn(this,"forEach",e,t,void 0,arguments)},includes(...e){return ba(this,"includes",e)},indexOf(...e){return ba(this,"indexOf",e)},join(e){return Xr(this).join(e)},lastIndexOf(...e){return ba(this,"lastIndexOf",e)},map(e,t){return Qn(this,"map",e,t,void 0,arguments)},pop(){return $o(this,"pop")},push(...e){return $o(this,"push",e)},reduce(e,...t){return ru(this,"reduce",e,t)},reduceRight(e,...t){return ru(this,"reduceRight",e,t)},shift(){return $o(this,"shift")},some(e,t){return Qn(this,"some",e,t,void 0,arguments)},splice(...e){return $o(this,"splice",e)},toReversed(){return Xr(this).toReversed()},toSorted(e){return Xr(this).toSorted(e)},toSpliced(...e){return Xr(this).toSpliced(...e)},unshift(...e){return $o(this,"unshift",e)},values(){return ya(this,"values",e=>fr(this,e))}};function ya(e,t,n){const r=$s(e),o=r[t]();return r!==e&&!Ot(e)&&(o._next=o.next,o.next=()=>{const s=o._next();return s.done||(s.value=n(s.value)),s}),o}const Xg=Array.prototype;function Qn(e,t,n,r,o,s){const i=$s(e),l=i!==e&&!Ot(e),u=i[t];if(u!==Xg[t]){const p=u.apply(e,s);return l?yn(p):p}let d=n;i!==e&&(l?d=function(p,f){return n.call(this,fr(e,p),f,e)}:n.length>2&&(d=function(p,f){return n.call(this,p,f,e)}));const c=u.call(i,d,r);return l&&o?o(c):c}function ru(e,t,n,r){const o=$s(e);let s=n;return o!==e&&(Ot(e)?n.length>3&&(s=function(i,l,u){return n.call(this,i,l,u,e)}):s=function(i,l,u){return n.call(this,i,fr(e,l),u,e)}),o[t](s,...r)}function ba(e,t,n){const r=Be(e);Et(r,"iterate",Fo);const o=r[t](...n);return(o===-1||o===!1)&&Oo(n[0])?(n[0]=Be(n[0]),r[t](...n)):o}function $o(e,t,n=[]){Gr(),pa();const r=Be(e)[t].apply(e,n);return ha(),Jr(),r}const Yg=R.makeMap("__proto__,__v_isRef,__isVue"),ou=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(R.isSymbol));function Zg(e){R.isSymbol(e)||(e=String(e));const t=Be(this);return Et(t,"has",e),t.hasOwnProperty(e)}class su{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return s;if(n==="__v_raw")return r===(o?s?uu:cu:s?cv:lu).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=R.isArray(t);if(!o){let u;if(i&&(u=Jg[n]))return u;if(n==="hasOwnProperty")return Zg}const l=Reflect.get(t,n,ft(t)?t:r);if((R.isSymbol(n)?ou.has(n):Yg(n))||(o||Et(t,"get",n),s))return l;if(ft(l)){const u=i&&R.isIntegerKey(n)?l:l.value;return o&&R.isObject(u)?pr(u):u}return R.isObject(l)?o?pr(l):Ta(l):l}}class ev extends su{constructor(t=!1){super(!1,t)}set(t,n,r,o){let s=t[n];const i=R.isArray(t)&&R.isIntegerKey(n);if(!this._isShallow){const d=vn(s);if(!Ot(r)&&!vn(r)&&(s=Be(s),r=Be(r)),!i&&ft(s)&&!ft(r))return d?(ce.env.NODE_ENV!=="production"&&In(`Set operation on key "${String(n)}" failed: target is readonly.`,t[n]),!0):(s.value=r,!0)}const l=i?Number(n)<t.length:R.hasOwn(t,n),u=Reflect.set(t,n,r,ft(t)?t:o);return t===Be(o)&&(l?R.hasChanged(r,s)&&dr(t,"set",n,r,s):dr(t,"add",n,r)),u}deleteProperty(t,n){const r=R.hasOwn(t,n),o=t[n],s=Reflect.deleteProperty(t,n);return s&&r&&dr(t,"delete",n,void 0,o),s}has(t,n){const r=Reflect.has(t,n);return(!R.isSymbol(n)||!ou.has(n))&&Et(t,"has",n),r}ownKeys(t){return Et(t,"iterate",R.isArray(t)?"length":Ar),Reflect.ownKeys(t)}}class iu extends su{constructor(t=!1){super(!0,t)}set(t,n){return ce.env.NODE_ENV!=="production"&&In(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return ce.env.NODE_ENV!=="production"&&In(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const tv=new ev,nv=new iu,rv=new iu(!0),wa=e=>e,Os=e=>Reflect.getPrototypeOf(e);function ov(e,t,n){return function(...r){const o=this.__v_raw,s=Be(o),i=R.isMap(s),l=e==="entries"||e===Symbol.iterator&&i,u=e==="keys"&&i,d=o[e](...r),c=n?wa:t?Yr:yn;return!t&&Et(s,"iterate",u?va:Ar),R.extend(Object.create(d),{next(){const{value:p,done:f}=d.next();return f?{value:p,done:f}:{value:l?[c(p[0]),c(p[1])]:c(p),done:f}}})}}function Ls(e){return function(...t){if(ce.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";In(`${R.capitalize(e)} operation ${n}failed: target is readonly.`,Be(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function sv(e,t){const n={get(o){const s=this.__v_raw,i=Be(s),l=Be(o);e||(R.hasChanged(o,l)&&Et(i,"get",o),Et(i,"get",l));const{has:u}=Os(i),d=t?wa:e?Yr:yn;if(u.call(i,o))return d(s.get(o));if(u.call(i,l))return d(s.get(l));s!==i&&s.get(o)},get size(){const o=this.__v_raw;return!e&&Et(Be(o),"iterate",Ar),o.size},has(o){const s=this.__v_raw,i=Be(s),l=Be(o);return e||(R.hasChanged(o,l)&&Et(i,"has",o),Et(i,"has",l)),o===l?s.has(o):s.has(o)||s.has(l)},forEach(o,s){const i=this,l=i.__v_raw,u=Be(l),d=t?wa:e?Yr:yn;return!e&&Et(u,"iterate",Ar),l.forEach((c,p)=>o.call(s,d(c),d(p),i))}};return R.extend(n,e?{add:Ls("add"),set:Ls("set"),delete:Ls("delete"),clear:Ls("clear")}:{add(o){!t&&!Ot(o)&&!vn(o)&&(o=Be(o));const s=Be(this);return Os(s).has.call(s,o)||(s.add(o),dr(s,"add",o,o)),this},set(o,s){!t&&!Ot(s)&&!vn(s)&&(s=Be(s));const i=Be(this),{has:l,get:u}=Os(i);let d=l.call(i,o);d?ce.env.NODE_ENV!=="production"&&au(i,l,o):(o=Be(o),d=l.call(i,o));const c=u.call(i,o);return i.set(o,s),d?R.hasChanged(s,c)&&dr(i,"set",o,s,c):dr(i,"add",o,s),this},delete(o){const s=Be(this),{has:i,get:l}=Os(s);let u=i.call(s,o);u?ce.env.NODE_ENV!=="production"&&au(s,i,o):(o=Be(o),u=i.call(s,o));const d=l?l.call(s,o):void 0,c=s.delete(o);return u&&dr(s,"delete",o,void 0,d),c},clear(){const o=Be(this),s=o.size!==0,i=ce.env.NODE_ENV!=="production"?R.isMap(o)?new Map(o):new Set(o):void 0,l=o.clear();return s&&dr(o,"clear",void 0,void 0,i),l}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=ov(o,e,t)}),n}function Sa(e,t){const n=sv(e,t);return(r,o,s)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?r:Reflect.get(R.hasOwn(n,o)&&o in r?n:r,o,s)}const iv={get:Sa(!1,!1)},av={get:Sa(!0,!1)},lv={get:Sa(!0,!0)};function au(e,t,n){const r=Be(n);if(r!==n&&t.call(e,r)){const o=R.toRawType(e);In(`Reactive ${o} contains both the raw and reactive versions of the same object${o==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const lu=new WeakMap,cv=new WeakMap,cu=new WeakMap,uu=new WeakMap;function uv(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function dv(e){return e.__v_skip||!Object.isExtensible(e)?0:uv(R.toRawType(e))}function Ta(e){return vn(e)?e:ka(e,!1,tv,iv,lu)}function pr(e){return ka(e,!0,nv,av,cu)}function _s(e){return ka(e,!0,rv,lv,uu)}function ka(e,t,n,r,o){if(!R.isObject(e))return ce.env.NODE_ENV!=="production"&&In(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const s=dv(e);if(s===0)return e;const i=o.get(e);if(i)return i;const l=new Proxy(e,s===2?r:n);return o.set(e,l),l}function hr(e){return vn(e)?hr(e.__v_raw):!!(e&&e.__v_isReactive)}function vn(e){return!!(e&&e.__v_isReadonly)}function Ot(e){return!!(e&&e.__v_isShallow)}function Oo(e){return e?!!e.__v_raw:!1}function Be(e){const t=e&&e.__v_raw;return t?Be(t):e}function du(e){return!R.hasOwn(e,"__v_skip")&&Object.isExtensible(e)&&R.def(e,"__v_skip",!0),e}const yn=e=>R.isObject(e)?Ta(e):e,Yr=e=>R.isObject(e)?pr(e):e;function ft(e){return e?e.__v_isRef===!0:!1}function W(e){return fu(e,!1)}function fv(e){return fu(e,!0)}function fu(e,t){return ft(e)?e:new pv(e,t)}class pv{constructor(t,n){this.dep=new Is,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Be(t),this._value=n?t:yn(t),this.__v_isShallow=n}get value(){return ce.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||Ot(t)||vn(t);t=r?t:Be(t),R.hasChanged(t,n)&&(this._rawValue=t,this._value=r?t:yn(t),ce.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:t,oldValue:n}):this.dep.trigger())}}function a(e){return ft(e)?e.value:e}const hv={get:(e,t,n)=>t==="__v_raw"?e:a(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return ft(o)&&!ft(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function mv(e){return hr(e)?e:new Proxy(e,hv)}class gv{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Is,{get:r,set:o}=t(n.track.bind(n),n.trigger.bind(n));this._get=r,this._set=o}get value(){return this._value=this._get()}set value(t){this._set(t)}}function vv(e){return new gv(e)}class yv{constructor(t,n,r){this._object=t,this._key=n,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0,this._raw=Be(t);let o=!0,s=t;if(!R.isArray(t)||!R.isIntegerKey(String(n)))do o=!Oo(s)||Ot(s);while(o&&(s=s.__v_raw));this._shallow=o}get value(){let t=this._object[this._key];return this._shallow&&(t=a(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&ft(this._raw[this._key])){const n=this._object[this._key];if(ft(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return Gg(this._raw,this._key)}}class bv{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function wv(e,t,n){return ft(e)?e:R.isFunction(e)?new bv(e):R.isObject(e)&&arguments.length>1?Sv(e,t,n):W(e)}function Sv(e,t,n){return new yv(e,t,n)}class Tv{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Is(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Io-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Qe!==this)return Jc(this,!0),!0;ce.env.NODE_ENV}get value(){const t=ce.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return Zc(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter?this.setter(t):ce.env.NODE_ENV!=="production"&&In("Write operation failed: computed value is readonly")}}function kv(e,t,n=!1){let r,o;R.isFunction(e)?r=e:(r=e.get,o=e.set);const s=new Tv(r,o,n);return ce.env.NODE_ENV,s}const Ms={},Ns=new WeakMap;let Er;function Cv(e,t=!1,n=Er){if(n){let r=Ns.get(n);r||Ns.set(n,r=[]),r.push(e)}else ce.env.NODE_ENV!=="production"&&!t&&In("onWatcherCleanup() was called when there was no active watcher to associate with.")}function xv(e,t,n=R.EMPTY_OBJ){const{immediate:r,deep:o,once:s,scheduler:i,augmentJob:l,call:u}=n,d=y=>{(n.onWarn||In)("Invalid watch source: ",y,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},c=y=>o?y:Ot(y)||o===!1||o===0?Kn(y,1):Kn(y);let p,f,h,g,m=!1,w=!1;if(ft(e)?(f=()=>e.value,m=Ot(e)):hr(e)?(f=()=>c(e),m=!0):R.isArray(e)?(w=!0,m=e.some(y=>hr(y)||Ot(y)),f=()=>e.map(y=>{if(ft(y))return y.value;if(hr(y))return c(y);if(R.isFunction(y))return u?u(y,2):y();ce.env.NODE_ENV!=="production"&&d(y)})):R.isFunction(e)?t?f=u?()=>u(e,2):e:f=()=>{if(h){Gr();try{h()}finally{Jr()}}const y=Er;Er=p;try{return u?u(e,3,[g]):e(g)}finally{Er=y}}:(f=R.NOOP,ce.env.NODE_ENV!=="production"&&d(e)),t&&o){const y=f,E=o===!0?1/0:o;f=()=>Kn(y(),E)}const T=()=>{p.stop()};if(s&&t){const y=t;t=(...E)=>{y(...E),T()}}let k=w?new Array(e.length).fill(Ms):Ms;const S=y=>{if(!(!(p.flags&1)||!p.dirty&&!y))if(t){const E=p.run();if(o||m||(w?E.some((D,$)=>R.hasChanged(D,k[$])):R.hasChanged(E,k))){h&&h();const D=Er;Er=p;try{const $=[E,k===Ms?void 0:w&&k[0]===Ms?[]:k,g];k=E,u?u(t,3,$):t(...$)}finally{Er=D}}}else p.run()};return l&&l(S),p=new Wg(f),p.scheduler=i?()=>i(S,!1):S,g=y=>Cv(y,!1,p),h=p.onStop=()=>{const y=Ns.get(p);if(y){if(u)u(y,4);else for(const E of y)E();Ns.delete(p)}},ce.env.NODE_ENV!=="production"&&(p.onTrack=n.onTrack,p.onTrigger=n.onTrigger),t?r?S(!0):k=p.run():i?i(S.bind(null,!0),!0):p.run(),T.pause=p.pause.bind(p),T.resume=p.resume.bind(p),T.stop=T,T}function Kn(e,t=1/0,n){if(t<=0||!R.isObject(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,ft(e))Kn(e.value,t,n);else if(R.isArray(e))for(let r=0;r<e.length;r++)Kn(e[r],t,n);else if(R.isSet(e)||R.isMap(e))e.forEach(r=>{Kn(r,t,n)});else if(R.isPlainObject(e)){for(const r in e)Kn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Kn(e[r],t,n)}return e}const Rr=[];function Av(e){Rr.push(e)}function Ev(){Rr.pop()}let Ca=!1;function _e(e,...t){if(Ca)return;Ca=!0,Gr();const n=Rr.length?Rr[Rr.length-1].component:null,r=n&&n.appContext.config.warnHandler,o=Rv();if(r)Bs(r,n,11,[e+t.map(s=>{var i,l;return(l=(i=s.toString)==null?void 0:i.call(s))!=null?l:JSON.stringify(s)}).join(""),n&&n.proxy,o.map(({vnode:s})=>`at <${Yu(n,s.type)}>`).join(`
2
+ `),o]);else{const s=[`[Vue warn]: ${e}`,...t];o.length&&s.push(`
3
+ `,...Dv(o)),console.warn(...s)}Jr(),Ca=!1}function Rv(){let e=Rr[Rr.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const r=e.component&&e.component.parent;e=r&&r.vnode}return t}function Dv(e){const t=[];return e.forEach((n,r)=>{t.push(...r===0?[]:[`
4
+ `],...Pv(n))}),t}function Pv({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",r=e.component?e.component.parent==null:!1,o=` at <${Yu(e.component,e.type,r)}`,s=">"+n;return e.props?[o,...Iv(e.props),s]:[o+s]}function Iv(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(r=>{t.push(...pu(r,e[r]))}),n.length>3&&t.push(" ..."),t}function pu(e,t,n){return R.isString(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:ft(t)?(t=pu(e,Be(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):R.isFunction(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=Be(t),n?t:[`${e}=`,t])}const xa={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Bs(e,t,n,r){try{return r?e(...r):e()}catch(o){js(o,t,n)}}function Aa(e,t,n,r){if(R.isFunction(e)){const o=Bs(e,t,n,r);return o&&R.isPromise(o)&&o.catch(s=>{js(s,t,n)}),o}if(R.isArray(e)){const o=[];for(let s=0;s<e.length;s++)o.push(Aa(e[s],t,n,r));return o}else ce.env.NODE_ENV!=="production"&&_e(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function js(e,t,n,r=!0){const o=t?t.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||R.EMPTY_OBJ;if(t){let l=t.parent;const u=t.proxy,d=ce.env.NODE_ENV!=="production"?xa[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const c=l.ec;if(c){for(let p=0;p<c.length;p++)if(c[p](e,u,d)===!1)return}l=l.parent}if(s){Gr(),Bs(s,null,10,[e,u,d]),Jr();return}}Fv(e,n,o,r,i)}function Fv(e,t,n,r=!0,o=!1){if(ce.env.NODE_ENV!=="production"){const s=xa[t];if(n&&Av(n),_e(`Unhandled error${s?` during execution of ${s}`:""}`),n&&Ev(),r)throw e;console.error(e)}else{if(o)throw e;console.error(e)}}const tn=[];let Gn=-1;const Zr=[];let mr=null,eo=0;const hu=Promise.resolve();let zs=null;const $v=100;function xt(e){const t=zs||hu;return e?t.then(this?e.bind(this):e):t}function Ov(e){let t=Gn+1,n=tn.length;for(;t<n;){const r=t+n>>>1,o=tn[r],s=Lo(o);s<e||s===e&&o.flags&2?t=r+1:n=r}return t}function Ea(e){if(!(e.flags&1)){const t=Lo(e),n=tn[tn.length-1];!n||!(e.flags&2)&&t>=Lo(n)?tn.push(e):tn.splice(Ov(t),0,e),e.flags|=1,mu()}}function mu(){zs||(zs=hu.then(vu))}function gu(e){R.isArray(e)?Zr.push(...e):mr&&e.id===-1?mr.splice(eo+1,0,e):e.flags&1||(Zr.push(e),e.flags|=1),mu()}function Lv(e){if(Zr.length){const t=[...new Set(Zr)].sort((n,r)=>Lo(n)-Lo(r));if(Zr.length=0,mr){mr.push(...t);return}for(mr=t,ce.env.NODE_ENV!=="production"&&(e=e||new Map),eo=0;eo<mr.length;eo++){const n=mr[eo];ce.env.NODE_ENV!=="production"&&yu(e,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}mr=null,eo=0}}const Lo=e=>e.id==null?e.flags&2?-1:1/0:e.id;function vu(e){ce.env.NODE_ENV!=="production"&&(e=e||new Map);const t=ce.env.NODE_ENV!=="production"?n=>yu(e,n):R.NOOP;try{for(Gn=0;Gn<tn.length;Gn++){const n=tn[Gn];if(n&&!(n.flags&8)){if(ce.env.NODE_ENV!=="production"&&t(n))continue;n.flags&4&&(n.flags&=-2),Bs(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;Gn<tn.length;Gn++){const n=tn[Gn];n&&(n.flags&=-2)}Gn=-1,tn.length=0,Lv(e),zs=null,(tn.length||Zr.length)&&vu(e)}}function yu(e,t){const n=e.get(t)||0;if(n>$v){const r=t.i,o=r&&ri(r.type);return js(`Maximum recursive updates exceeded${o?` in component <${o}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return e.set(t,n+1),!1}let _o=!1;const Ra=new Map;ce.env.NODE_ENV!=="production"&&(R.getGlobalThis().__VUE_HMR_RUNTIME__={createRecord:Da(_v),rerender:Da(Mv),reload:Da(Nv)});const Us=new Map;function _v(e,t){return Us.has(e)?!1:(Us.set(e,{initialDef:Vs(t),instances:new Set}),!0)}function Vs(e){return Zu(e)?e.__vccOpts:e}function Mv(e,t){const n=Us.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(r=>{t&&(r.render=t,Vs(r.type).render=t),r.renderCache=[],_o=!0,r.job.flags&8||r.update(),_o=!1}))}function Nv(e,t){const n=Us.get(e);if(!n)return;t=Vs(t),bu(n.initialDef,t);const r=[...n.instances];for(let o=0;o<r.length;o++){const s=r[o],i=Vs(s.type);let l=Ra.get(i);l||(i!==n.initialDef&&bu(i,t),Ra.set(i,l=new Set)),l.add(s),s.appContext.propsCache.delete(s.type),s.appContext.emitsCache.delete(s.type),s.appContext.optionsCache.delete(s.type),s.ceReload?(l.add(s),s.ceReload(t.styles),l.delete(s)):s.parent?Ea(()=>{s.job.flags&8||(_o=!0,s.parent.update(),_o=!1,l.delete(s))}):s.appContext.reload?s.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),s.root.ce&&s!==s.root&&s.root.ce._removeChildStyle(i)}gu(()=>{Ra.clear()})}function bu(e,t){R.extend(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function Da(e){return(t,n)=>{try{return e(t,n)}catch(r){console.error(r),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let gr,Mo=[],Pa=!1;function Bv(e,...t){gr?gr.emit(e,...t):Pa||Mo.push({event:e,args:t})}function wu(e,t){var n,r;gr=e,gr?(gr.enabled=!0,Mo.forEach(({event:o,args:s})=>gr.emit(o,...s)),Mo=[]):typeof window<"u"&&window.HTMLElement&&!((r=(n=window.navigator)==null?void 0:n.userAgent)!=null&&r.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(s=>{wu(s,t)}),setTimeout(()=>{gr||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Pa=!0,Mo=[])},3e3)):(Pa=!0,Mo=[])}const jv=zv("component:updated");function zv(e){return t=>{Bv(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}let Rt=null,Su=null;function Tu(e){const t=Rt;return Rt=e,Su=e&&e.type.__scopeId||null,t}function Z(e,t=Rt,n){if(!t||e._n)return e;const r=(...o)=>{r._d&&Zs(-1);const s=Tu(t);let i;try{i=e(...o)}finally{Tu(s),r._d&&Zs(1)}return ce.env.NODE_ENV!=="production"&&jv(t),i};return r._n=!0,r._c=!0,r._d=!0,r}function je(e,t){if(Rt===null)return ce.env.NODE_ENV!=="production"&&_e("withDirectives can only be used inside render functions."),e;const n=Xu(Rt),r=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[s,i,l,u=R.EMPTY_OBJ]=t[o];s&&(R.isFunction(s)&&(s={mounted:s,updated:s}),s.deep&&Kn(i),r.push({dir:s,instance:n,value:i,oldValue:void 0,arg:l,modifiers:u}))}return e}function Dr(e,t){if(ce.env.NODE_ENV!=="production"&&(!Nt||Nt.isMounted)&&_e("provide() can only be used inside setup()."),Nt){let n=Nt.provides;const r=Nt.parent&&Nt.parent.provides;r===n&&(n=Nt.provides=Object.create(r)),n[e]=t}}function Jn(e,t,n=!1){const r=ni();if(r||cy){let o=r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&R.isFunction(t)?t.call(r&&r.proxy):t;ce.env.NODE_ENV!=="production"&&_e(`injection "${String(e)}" not found.`)}else ce.env.NODE_ENV!=="production"&&_e("inject() can only be used inside setup() or functional components.")}const Uv=Symbol.for("v-scx"),Vv=()=>{{const e=Jn(Uv);return e||ce.env.NODE_ENV!=="production"&&_e("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function Ue(e,t,n){return ce.env.NODE_ENV!=="production"&&!R.isFunction(t)&&_e("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),ku(e,t,n)}function ku(e,t,n=R.EMPTY_OBJ){const{immediate:r,deep:o,flush:s,once:i}=n;ce.env.NODE_ENV!=="production"&&!t&&(r!==void 0&&_e('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),o!==void 0&&_e('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&_e('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const l=R.extend({},n);ce.env.NODE_ENV!=="production"&&(l.onWarn=_e);const u=t&&r||!t&&s!=="post";let d;if(ro){if(s==="sync"){const h=Vv();d=h.__watcherHandles||(h.__watcherHandles=[])}else if(!u){const h=()=>{};return h.stop=R.NOOP,h.resume=R.NOOP,h.pause=R.NOOP,h}}const c=Nt;l.call=(h,g,m)=>Aa(h,c,g,m);let p=!1;s==="post"?l.scheduler=h=>{Na(h,c&&c.suspense)}:s!=="sync"&&(p=!0,l.scheduler=(h,g)=>{g?h():Ea(h)}),l.augmentJob=h=>{t&&(h.flags|=4),p&&(h.flags|=2,c&&(h.id=c.uid,h.i=c))};const f=xv(e,t,l);return ro&&(d?d.push(f):u&&f()),f}function qv(e,t,n){const r=this.proxy,o=R.isString(e)?e.includes(".")?Hv(r,e):()=>r[e]:e.bind(r,r);let s;R.isFunction(t)?s=t:(s=t.handler,n=t);const i=Gu(this),l=ku(o,s.bind(r),n);return i(),l}function Hv(e,t){const n=t.split(".");return()=>{let r=e;for(let o=0;o<n.length&&r;o++)r=r[n[o]];return r}}const Wv=Symbol("_vte"),Qv=e=>e.__isTeleport,Pr=e=>e&&(e.disabled||e.disabled===""),Cu=e=>e&&(e.defer||e.defer===""),xu=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Au=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Ia=(e,t)=>{const n=e&&e.to;if(R.isString(n))if(t){const r=t(n);return ce.env.NODE_ENV!=="production"&&!r&&!Pr(e)&&_e(`Failed to locate Teleport target with selector "${n}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`),r}else return ce.env.NODE_ENV!=="production"&&_e("Current renderer does not support string target for Teleports. (missing querySelector renderer option)"),null;else return ce.env.NODE_ENV!=="production"&&!n&&!Pr(e)&&_e(`Invalid Teleport target: ${n}`),n},Eu={name:"Teleport",__isTeleport:!0,process(e,t,n,r,o,s,i,l,u,d){const{mc:c,pc:p,pbc:f,o:{insert:h,querySelector:g,createText:m,createComment:w}}=d,T=Pr(t.props);let{shapeFlag:k,children:S,dynamicChildren:y}=t;if(ce.env.NODE_ENV!=="production"&&_o&&(u=!1,y=null),e==null){const E=t.el=ce.env.NODE_ENV!=="production"?w("teleport start"):m(""),D=t.anchor=ce.env.NODE_ENV!=="production"?w("teleport end"):m("");h(E,n,r),h(D,n,r);const $=(L,V)=>{k&16&&c(S,L,V,o,s,i,l,u)},_=()=>{const L=t.target=Ia(t.props,g),V=$a(L,t,m,h);L?(i!=="svg"&&xu(L)?i="svg":i!=="mathml"&&Au(L)&&(i="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(L),T||($(L,V),Hs(t,!1))):ce.env.NODE_ENV!=="production"&&!T&&_e("Invalid Teleport target on mount:",L,`(${typeof L})`)};T&&($(n,D),Hs(t,!0)),Cu(t.props)?(t.el.__isMounted=!1,Na(()=>{_(),delete t.el.__isMounted},s)):_()}else{if(Cu(t.props)&&e.el.__isMounted===!1){Na(()=>{Eu.process(e,t,n,r,o,s,i,l,u,d)},s);return}t.el=e.el,t.targetStart=e.targetStart;const E=t.anchor=e.anchor,D=t.target=e.target,$=t.targetAnchor=e.targetAnchor,_=Pr(e.props),L=_?n:D,V=_?E:$;if(i==="svg"||xu(D)?i="svg":(i==="mathml"||Au(D))&&(i="mathml"),y?(f(e.dynamicChildren,y,L,o,s,i,l),zu(e,t,ce.env.NODE_ENV==="production")):u||p(e,t,L,V,o,s,i,l,!1),T)_?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):qs(t,n,E,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const te=t.target=Ia(t.props,g);te?qs(t,te,null,d,0):ce.env.NODE_ENV!=="production"&&_e("Invalid Teleport target on update:",D,`(${typeof D})`)}else _&&qs(t,D,$,d,1);Hs(t,T)}},remove(e,t,n,{um:r,o:{remove:o}},s){const{shapeFlag:i,children:l,anchor:u,targetStart:d,targetAnchor:c,target:p,props:f}=e;if(p&&(o(d),o(c)),s&&o(u),i&16){const h=s||!Pr(f);for(let g=0;g<l.length;g++){const m=l[g];r(m,t,n,h,!!m.dynamicChildren)}}},move:qs,hydrate:Kv};function qs(e,t,n,{o:{insert:r},m:o},s=2){s===0&&r(e.targetAnchor,t,n);const{el:i,anchor:l,shapeFlag:u,children:d,props:c}=e,p=s===2;if(p&&r(i,t,n),(!p||Pr(c))&&u&16)for(let f=0;f<d.length;f++)o(d[f],t,n,2);p&&r(l,t,n)}function Kv(e,t,n,r,o,s,{o:{nextSibling:i,parentNode:l,querySelector:u,insert:d,createText:c}},p){function f(w,T){let k=T;for(;k;){if(k&&k.nodeType===8){if(k.data==="teleport start anchor")t.targetStart=k;else if(k.data==="teleport anchor"){t.targetAnchor=k,w._lpa=t.targetAnchor&&i(t.targetAnchor);break}}k=i(k)}}function h(w,T){T.anchor=p(i(w),T,l(w),n,r,o,s)}const g=t.target=Ia(t.props,u),m=Pr(t.props);if(g){const w=g._lpa||g.firstChild;t.shapeFlag&16&&(m?(h(e,t),f(g,w),t.targetAnchor||$a(g,t,c,d,l(e)===g?e:null)):(t.anchor=i(e),f(g,w),t.targetAnchor||$a(g,t,c,d),p(w&&i(w),t,g,n,r,o,s))),Hs(t,m)}else m&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Fa=Eu;function Hs(e,t){const n=e.ctx;if(n&&n.ut){let r,o;for(t?(r=e.el,o=e.anchor):(r=e.targetStart,o=e.targetAnchor);r&&r!==o;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function $a(e,t,n,r,o=null){const s=t.targetStart=n(""),i=t.targetAnchor=n("");return s[Wv]=i,e&&(r(s,e,o),r(i,e,o)),i}function Ru(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Ru(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function ge(e,t){return R.isFunction(e)?R.extend({name:e.name},t,{setup:e}):e}function Gv(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const Jv=new WeakSet;function nn(e){const t=ni(),n=fv(null);if(t){const o=t.refs===R.EMPTY_OBJ?t.refs={}:t.refs;ce.env.NODE_ENV!=="production"&&Xv(o,e)?_e(`useTemplateRef('${e}') already exists.`):Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:s=>n.value=s})}else ce.env.NODE_ENV!=="production"&&_e("useTemplateRef() is called when there is no active component instance to be associated with.");const r=ce.env.NODE_ENV!=="production"?pr(n):n;return ce.env.NODE_ENV!=="production"&&Jv.add(r),r}function Xv(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Du=e=>e.nodeType===8;R.getGlobalThis().requestIdleCallback,R.getGlobalThis().cancelIdleCallback;function Yv(e,t){if(Du(e)&&e.data==="["){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(Du(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else t(e)}const Zv=e=>!!e.type.__asyncLoader;function ey(e){R.isFunction(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:o=200,hydrate:s,timeout:i,suspensible:l=!0,onError:u}=e;let d=null,c,p=0;const f=()=>(p++,d=null,h()),h=()=>{let g;return d||(g=d=t().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),u)return new Promise((w,T)=>{u(m,()=>w(f()),()=>T(m),p+1)});throw m}).then(m=>{if(g!==d&&d)return d;if(ce.env.NODE_ENV!=="production"&&!m&&_e("Async component loader resolved to undefined. If you are using retry(), make sure to return its return value."),m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),ce.env.NODE_ENV!=="production"&&m&&!R.isObject(m)&&!R.isFunction(m))throw new Error(`Invalid async component load result: ${m}`);return c=m,m}))};return ge({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(g,m,w){let T=!1;(m.bu||(m.bu=[])).push(()=>T=!0);const k=()=>{if(T){ce.env.NODE_ENV!=="production"&&_e(`Skipping lazy hydration for component '${ri(c)||c.__file}': it was updated before lazy hydration performed.`);return}w()},S=s?()=>{const y=s(k,E=>Yv(g,E));y&&(m.bum||(m.bum=[])).push(y)}:k;c?S():h().then(()=>!m.isUnmounted&&S())},get __asyncResolved(){return c},setup(){const g=Nt;if(Gv(g),c)return()=>Ws(c,g);const m=S=>{d=null,js(S,g,13,!r)};if(l&&g.suspense||ro)return h().then(S=>()=>Ws(S,g)).catch(S=>(m(S),()=>r?J(r,{error:S}):null));const w=W(!1),T=W(),k=W(!!o);return o&&setTimeout(()=>{k.value=!1},o),i!=null&&setTimeout(()=>{if(!w.value&&!T.value){const S=new Error(`Async component timed out after ${i}ms.`);m(S),T.value=S}},i),h().then(()=>{w.value=!0,g.parent&&ty(g.parent.vnode)&&g.parent.update()}).catch(S=>{m(S),T.value=S}),()=>{if(w.value&&c)return Ws(c,g);if(T.value&&r)return J(r,{error:T.value});if(n&&!k.value)return Ws(n,g)}}})}function Ws(e,t){const{ref:n,props:r,children:o,ce:s}=t.vnode,i=J(e,r,o);return i.ref=n,i.ce=s,delete t.vnode.ce,i}const ty=e=>e.type.__isKeepAlive;function ny(e,t,n=Nt,r=!1){if(n){const o=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...i)=>{Gr();const l=Gu(n),u=Aa(t,n,e,i);return l(),Jr(),u});return r?o.unshift(s):o.push(s),s}else if(ce.env.NODE_ENV!=="production"){const o=R.toHandlerKey(xa[e].replace(/ hook$/,""));_e(`${o} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}}const Oa=e=>(t,n=Nt)=>{(!ro||e==="sp")&&ny(e,(...r)=>t(...r),n)},yt=Oa("m"),bn=Oa("bum"),Qs=Oa("um"),Ks="components",ry="directives";function oe(e,t){return La(Ks,e,!0,t)||e}const Pu=Symbol.for("v-ndc");function rn(e){return R.isString(e)?La(Ks,e,!1)||e:e||Pu}function Lt(e){return La(ry,e)}function La(e,t,n=!0,r=!1){const o=Rt||Nt;if(o){const s=o.type;if(e===Ks){const l=ri(s,!1);if(l&&(l===t||l===R.camelize(t)||l===R.capitalize(R.camelize(t))))return s}const i=Iu(o[e]||s[e],t)||Iu(o.appContext[e],t);if(!i&&r)return s;if(ce.env.NODE_ENV!=="production"&&n&&!i){const l=e===Ks?`
5
+ If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`:"";_e(`Failed to resolve ${e.slice(0,-1)}: ${t}${l}`)}return i}else ce.env.NODE_ENV!=="production"&&_e(`resolve${R.capitalize(e.slice(0,-1))} can only be used in render() or setup().`)}function Iu(e,t){return e&&(e[t]||e[R.camelize(t)]||e[R.capitalize(R.camelize(t))])}function Ye(e,t,n,r){let o;const s=n,i=R.isArray(e);if(i||R.isString(e)){const l=i&&hr(e);let u=!1,d=!1;l&&(u=!Ot(e),d=vn(e),e=$s(e)),o=new Array(e.length);for(let c=0,p=e.length;c<p;c++)o[c]=t(u?d?Yr(yn(e[c])):yn(e[c]):e[c],c,void 0,s)}else if(typeof e=="number"){ce.env.NODE_ENV!=="production"&&!Number.isInteger(e)&&_e(`The v-for range expect an integer value but got ${e}.`),o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,s)}else if(R.isObject(e))if(e[Symbol.iterator])o=Array.from(e,(l,u)=>t(l,u,void 0,s));else{const l=Object.keys(e);o=new Array(l.length);for(let u=0,d=l.length;u<d;u++){const c=l[u];o[u]=t(e[c],c,u,s)}}else o=[];return o}function Fu(e,t){for(let n=0;n<t.length;n++){const r=t[n];if(R.isArray(r))for(let o=0;o<r.length;o++)e[r[o].name]=r[o].fn;else r&&(e[r.name]=r.key?(...o)=>{const s=r.fn(...o);return s&&(s.key=r.key),s}:r.fn)}return e}function Ce(e,t,n={},r,o){if(Rt.ce||Rt.parent&&Zv(Rt.parent)&&Rt.parent.ce){const d=Object.keys(n).length>0;return t!=="default"&&(n.name=t),I(),re(Ae,null,[J("slot",n,r&&r())],d?-2:64)}let s=e[t];ce.env.NODE_ENV!=="production"&&s&&s.length>1&&(_e("SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template."),s=()=>[]),s&&s._c&&(s._d=!1),I();const i=s&&$u(s(n)),l=n.key||i&&i.key,u=re(Ae,{key:(l&&!R.isSymbol(l)?l:`_${t}`)+(!i&&r?"_fb":"")},i||(r?r():[]),i&&e._===1?64:-2);return!o&&u.scopeId&&(u.slotScopeIds=[u.scopeId+"-s"]),s&&s._c&&(s._d=!0),u}function $u(e){return e.some(t=>ei(t)?!(t.type===to||t.type===Ae&&!$u(t.children)):!0)?e:null}function Gs(e,t){const n={};if(ce.env.NODE_ENV!=="production"&&!R.isObject(e))return _e("v-on with no argument expects an object value."),n;for(const r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:R.toHandlerKey(r)]=e[r];return n}const _a=e=>e?my(e)?Xu(e):_a(e.parent):null,Ma=R.extend(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>ce.env.NODE_ENV!=="production"?_s(e.props):e.props,$attrs:e=>ce.env.NODE_ENV!=="production"?_s(e.attrs):e.attrs,$slots:e=>ce.env.NODE_ENV!=="production"?_s(e.slots):e.slots,$refs:e=>ce.env.NODE_ENV!=="production"?_s(e.refs):e.refs,$parent:e=>_a(e.parent),$root:e=>_a(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>sy(e),$forceUpdate:e=>e.f||(e.f=()=>{Ea(e.update)}),$nextTick:e=>e.n||(e.n=xt.bind(e.proxy)),$watch:e=>qv.bind(e)}),oy={};ce.env.NODE_ENV!=="production"&&(oy.ownKeys=e=>(_e("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));function Ou(){return Lu("useSlots").slots}function Js(){return Lu("useAttrs").attrs}function Lu(e){const t=ni();return ce.env.NODE_ENV!=="production"&&!t&&_e(`${e}() called without active instance.`),t.setupContext||(t.setupContext=vy(t))}function _u(e){return R.isArray(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function sy(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:o,optionsCache:s,config:{optionMergeStrategies:i}}=e.appContext,l=s.get(t);let u;return l?u=l:!o.length&&!n&&!r?u=t:(u={},o.length&&o.forEach(d=>Xs(u,d,i,!0)),Xs(u,t,i)),R.isObject(t)&&s.set(t,u),u}function Xs(e,t,n,r=!1){const{mixins:o,extends:s}=t;s&&Xs(e,s,n,!0),o&&o.forEach(i=>Xs(e,i,n,!0));for(const i in t)if(r&&i==="expose")ce.env.NODE_ENV!=="production"&&_e('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const l=iy[i]||n&&n[i];e[i]=l?l(e[i],t[i]):t[i]}return e}const iy={data:Mu,props:Bu,emits:Bu,methods:No,computed:No,beforeCreate:Mt,created:Mt,beforeMount:Mt,mounted:Mt,beforeUpdate:Mt,updated:Mt,beforeDestroy:Mt,beforeUnmount:Mt,destroyed:Mt,unmounted:Mt,activated:Mt,deactivated:Mt,errorCaptured:Mt,serverPrefetch:Mt,components:No,directives:No,watch:ly,provide:Mu,inject:ay};function Mu(e,t){return t?e?function(){return R.extend(R.isFunction(e)?e.call(this,this):e,R.isFunction(t)?t.call(this,this):t)}:t:e}function ay(e,t){return No(Nu(e),Nu(t))}function Nu(e){if(R.isArray(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Mt(e,t){return e?[...new Set([].concat(e,t))]:t}function No(e,t){return e?R.extend(Object.create(null),e,t):t}function Bu(e,t){return e?R.isArray(e)&&R.isArray(t)?[...new Set([...e,...t])]:R.extend(Object.create(null),_u(e),_u(t??{})):t}function ly(e,t){if(!e)return t;if(!t)return e;const n=R.extend(Object.create(null),e);for(const r in t)n[r]=Mt(e[r],t[r]);return n}let cy=null;const uy={},ju=e=>Object.getPrototypeOf(e)===uy,Na=fy;function zu(e,t,n=!1){const r=e.children,o=t.children;if(R.isArray(r)&&R.isArray(o))for(let s=0;s<r.length;s++){const i=r[s];let l=o[s];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[s]=Ku(o[s]),l.el=i.el),!n&&l.patchFlag!==-2&&zu(i,l)),l.type===Uu&&(l.patchFlag===-1&&(l=o[s]=Ku(l)),l.el=i.el),l.type===to&&!l.el&&(l.el=i.el),ce.env.NODE_ENV!=="production"&&l.el&&(l.el.__vnode=l)}}const dy=e=>e.__isSuspense;function fy(e,t){t&&t.pendingBranch?R.isArray(e)?t.effects.push(...e):t.effects.push(e):gu(e)}const Ae=Symbol.for("v-fgt"),Uu=Symbol.for("v-txt"),to=Symbol.for("v-cmt"),Ys=[];let Yt=null;function I(e=!1){Ys.push(Yt=e?null:[])}function py(){Ys.pop(),Yt=Ys[Ys.length-1]||null}let Bo=1;function Zs(e,t=!1){Bo+=e,e<0&&Yt&&t&&(Yt.hasOnce=!0)}function Vu(e){return e.dynamicChildren=Bo>0?Yt||R.EMPTY_ARR:null,py(),Bo>0&&Yt&&Yt.push(e),e}function G(e,t,n,r,o,s){return Vu(Q(e,t,n,r,o,s,!0))}function re(e,t,n,r,o){return Vu(J(e,t,n,r,o,!0))}function ei(e){return e?e.__v_isVNode===!0:!1}const hy=(...e)=>Hu(...e),qu=({key:e})=>e??null,ti=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?R.isString(e)||ft(e)||R.isFunction(e)?{i:Rt,r:e,k:t,f:!!n}:e:null);function Q(e,t=null,n=null,r=0,o=null,s=e===Ae?0:1,i=!1,l=!1){const u={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&qu(t),ref:t&&ti(t),scopeId:Su,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Rt};return l?(Ba(u,n),s&128&&e.normalize(u)):n&&(u.shapeFlag|=R.isString(n)?8:16),ce.env.NODE_ENV!=="production"&&u.key!==u.key&&_e("VNode created with invalid key (NaN). VNode type:",u.type),Bo>0&&!i&&Yt&&(u.patchFlag>0||s&6)&&u.patchFlag!==32&&Yt.push(u),u}const J=ce.env.NODE_ENV!=="production"?hy:Hu;function Hu(e,t=null,n=null,r=0,o=null,s=!1){if((!e||e===Pu)&&(ce.env.NODE_ENV!=="production"&&!e&&_e(`Invalid vnode type when creating vnode: ${e}.`),e=to),ei(e)){const l=no(e,t,!0);return n&&Ba(l,n),Bo>0&&!s&&Yt&&(l.shapeFlag&6?Yt[Yt.indexOf(e)]=l:Yt.push(l)),l.patchFlag=-2,l}if(Zu(e)&&(e=e.__vccOpts),t){t=Wu(t);let{class:l,style:u}=t;l&&!R.isString(l)&&(t.class=R.normalizeClass(l)),R.isObject(u)&&(Oo(u)&&!R.isArray(u)&&(u=R.extend({},u)),t.style=R.normalizeStyle(u))}const i=R.isString(e)?1:dy(e)?128:Qv(e)?64:R.isObject(e)?4:R.isFunction(e)?2:0;return ce.env.NODE_ENV!=="production"&&i&4&&Oo(e)&&(e=Be(e),_e("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
6
+ Component that was made reactive: `,e)),Q(e,t,n,r,o,i,s,!0)}function Wu(e){return e?Oo(e)||ju(e)?R.extend({},e):e:null}function no(e,t,n=!1,r=!1){const{props:o,ref:s,patchFlag:i,children:l,transition:u}=e,d=t?pt(o||{},t):o,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&qu(d),ref:t&&t.ref?n&&s?R.isArray(s)?s.concat(ti(t)):[s,ti(t)]:ti(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:ce.env.NODE_ENV!=="production"&&i===-1&&R.isArray(l)?l.map(Qu):l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ae?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:u,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&no(e.ssContent),ssFallback:e.ssFallback&&no(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return u&&r&&Ru(c,u.clone(c)),c}function Qu(e){const t=no(e);return R.isArray(e.children)&&(t.children=e.children.map(Qu)),t}function ct(e=" ",t=0){return J(Uu,null,e,t)}function le(e="",t=!1){return t?(I(),re(to,null,e)):J(to,null,e)}function Ku(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:no(e)}function Ba(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(R.isArray(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),Ba(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!ju(t)?t._ctx=Rt:o===3&&Rt&&(Rt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else R.isFunction(t)?(t={default:t,_ctx:Rt},n=32):(t=String(t),r&64?(n=16,t=[ct(t)]):n=8);e.children=t,e.shapeFlag|=n}function pt(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const o in r)if(o==="class")t.class!==r.class&&(t.class=R.normalizeClass([t.class,r.class]));else if(o==="style")t.style=R.normalizeStyle([t.style,r.style]);else if(R.isOn(o)){const s=t[o],i=r[o];i&&s!==i&&!(R.isArray(s)&&s.includes(i))&&(t[o]=s?[].concat(s,i):i)}else o!==""&&(t[o]=r[o])}return t}let Nt=null;const ni=()=>Nt||Rt;let ja;{const e=R.getGlobalThis(),t=(n,r)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(r),s=>{o.length>1?o.forEach(i=>i(s)):o[0](s)}};ja=t("__VUE_INSTANCE_SETTERS__",n=>Nt=n),t("__VUE_SSR_SETTERS__",n=>ro=n)}const Gu=e=>{const t=Nt;return ja(e),e.scope.on(),()=>{e.scope.off(),ja(t)}};function my(e){return e.vnode.shapeFlag&4}let ro=!1;const Ju=ce.env.NODE_ENV!=="production"?{get(e,t){return Et(e,"get",""),e[t]},set(){return _e("setupContext.attrs is readonly."),!1},deleteProperty(){return _e("setupContext.attrs is readonly."),!1}}:{get(e,t){return Et(e,"get",""),e[t]}};function gy(e){return new Proxy(e.slots,{get(t,n){return Et(e,"get","$slots"),t[n]}})}function vy(e){const t=n=>{if(ce.env.NODE_ENV!=="production"&&(e.exposed&&_e("expose() should be called only once per setup()."),n!=null)){let r=typeof n;r==="object"&&(R.isArray(n)?r="array":ft(n)&&(r="ref")),r!=="object"&&_e(`expose() should be passed a plain object, received ${r}.`)}e.exposed=n||{}};if(ce.env.NODE_ENV!=="production"){let n,r;return Object.freeze({get attrs(){return n||(n=new Proxy(e.attrs,Ju))},get slots(){return r||(r=gy(e))},get emit(){return(o,...s)=>e.emit(o,...s)},expose:t})}else return{attrs:new Proxy(e.attrs,Ju),slots:e.slots,emit:e.emit,expose:t}}function Xu(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(mv(du(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ma)return Ma[n](e)},has(t,n){return n in t||n in Ma}})):e.proxy}const yy=/(?:^|[-_])\w/g,by=e=>e.replace(yy,t=>t.toUpperCase()).replace(/[-_]/g,"");function ri(e,t=!0){return R.isFunction(e)?e.displayName||e.name:e.name||t&&e.__name}function Yu(e,t,n=!1){let r=ri(t);if(!r&&t.__file){const o=t.__file.match(/([^/\\]+)\.\w+$/);o&&(r=o[1])}if(!r&&e){const o=s=>{for(const i in s)if(s[i]===t)return i};r=o(e.components)||e.parent&&o(e.parent.type.components)||o(e.appContext.components)}return r?by(r):n?"App":"Anonymous"}function Zu(e){return R.isFunction(e)&&"__vccOpts"in e}const A=(e,t)=>{const n=kv(e,t,ro);if(ce.env.NODE_ENV!=="production"){const r=ni();r&&r.appContext.config.warnRecursiveComputed&&(n._warnRecursive=!0)}return n};function za(e,t,n){try{Zs(-1);const r=arguments.length;return r===2?R.isObject(t)&&!R.isArray(t)?ei(t)?J(e,null,[t]):J(e,t):J(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&ei(n)&&(n=[n]),J(e,t,n))}finally{Zs(1)}}function wy(){if(ce.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},n={style:"color:#f5222d"},r={style:"color:#eb2f96"},o={__vue_custom_formatter:!0,header(p){if(!R.isObject(p))return null;if(p.__isVue)return["div",e,"VueInstance"];if(ft(p)){Gr();const f=p.value;return Jr(),["div",{},["span",e,c(p)],"<",l(f),">"]}else{if(hr(p))return["div",{},["span",e,Ot(p)?"ShallowReactive":"Reactive"],"<",l(p),`>${vn(p)?" (readonly)":""}`];if(vn(p))return["div",{},["span",e,Ot(p)?"ShallowReadonly":"Readonly"],"<",l(p),">"]}return null},hasBody(p){return p&&p.__isVue},body(p){if(p&&p.__isVue)return["div",{},...s(p.$)]}};function s(p){const f=[];p.type.props&&p.props&&f.push(i("props",Be(p.props))),p.setupState!==R.EMPTY_OBJ&&f.push(i("setup",p.setupState)),p.data!==R.EMPTY_OBJ&&f.push(i("data",Be(p.data)));const h=u(p,"computed");h&&f.push(i("computed",h));const g=u(p,"inject");return g&&f.push(i("injected",g)),f.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:p}]]),f}function i(p,f){return f=R.extend({},f),Object.keys(f).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},p],["div",{style:"padding-left:1.25em"},...Object.keys(f).map(h=>["div",{},["span",r,h+": "],l(f[h],!1)])]]:["span",{}]}function l(p,f=!0){return typeof p=="number"?["span",t,p]:typeof p=="string"?["span",n,JSON.stringify(p)]:typeof p=="boolean"?["span",r,p]:R.isObject(p)?["object",{object:f?Be(p):p}]:["span",n,String(p)]}function u(p,f){const h=p.type;if(R.isFunction(h))return;const g={};for(const m in p.ctx)d(h,m,f)&&(g[m]=p.ctx[m]);return g}function d(p,f,h){const g=p[h];if(R.isArray(g)&&g.includes(f)||R.isObject(g)&&f in g||p.extends&&d(p.extends,f,h)||p.mixins&&p.mixins.some(m=>d(m,f,h)))return!0}function c(p){return Ot(p)?"ShallowRef":p.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(o):window.devtoolsFormatters=[o]}const ed=ce.env.NODE_ENV!=="production"?_e:R.NOOP;ce.env.NODE_ENV,ce.env.NODE_ENV;let Sy;const td=typeof window<"u"&&window.trustedTypes;if(td)try{Sy=td.createPolicy("vue",{createHTML:e=>e})}catch(e){ce.env.NODE_ENV!=="production"&&ed(`Error creating trusted types policy: ${e}`)}const nd=Symbol("_vod"),Ty=Symbol("_vsh"),rd={name:"show",beforeMount(e,{value:t},{transition:n}){e[nd]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):jo(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),jo(e,!0),r.enter(e)):r.leave(e,()=>{jo(e,!1)}):jo(e,t))},beforeUnmount(e,{value:t}){jo(e,t)}};function jo(e,t){e.style.display=t?e[nd]:"none",e[Ty]=!t}ce.env.NODE_ENV;function vr(e,t,n,r){e.addEventListener(t,n,r)}const yr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return R.isArray(t)?n=>R.invokeArrayFns(t,n):t};function ky(e){e.target.composing=!0}function od(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const on=Symbol("_assign");function sd(e,t,n){return t&&(e=e.trim()),n&&(e=R.looseToNumber(e)),e}const Ua={created(e,{modifiers:{lazy:t,trim:n,number:r}},o){e[on]=yr(o);const s=r||o.props&&o.props.type==="number";vr(e,t?"change":"input",i=>{i.target.composing||e[on](sd(e.value,n,s))}),(n||s)&&vr(e,"change",()=>{e.value=sd(e.value,n,s)}),t||(vr(e,"compositionstart",ky),vr(e,"compositionend",od),vr(e,"change",od))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:o,number:s}},i){if(e[on]=yr(i),e.composing)return;const l=(s||e.type==="number")&&!/^0\d/.test(e.value)?R.looseToNumber(e.value):e.value,u=t??"";l!==u&&(document.activeElement===e&&e.type!=="range"&&(r&&t===n||o&&e.value.trim()===u)||(e.value=u))}},Cy={deep:!0,created(e,t,n){e[on]=yr(n),vr(e,"change",()=>{const r=e._modelValue,o=oo(e),s=e.checked,i=e[on];if(R.isArray(r)){const l=R.looseIndexOf(r,o),u=l!==-1;if(s&&!u)i(r.concat(o));else if(!s&&u){const d=[...r];d.splice(l,1),i(d)}}else if(R.isSet(r)){const l=new Set(r);s?l.add(o):l.delete(o),i(l)}else i(ld(e,s))})},mounted:id,beforeUpdate(e,t,n){e[on]=yr(n),id(e,t,n)}};function id(e,{value:t,oldValue:n},r){e._modelValue=t;let o;if(R.isArray(t))o=R.looseIndexOf(t,r.props.value)>-1;else if(R.isSet(t))o=t.has(r.props.value);else{if(t===n)return;o=R.looseEqual(t,ld(e,!0))}e.checked!==o&&(e.checked=o)}const xy={created(e,{value:t},n){e.checked=R.looseEqual(t,n.props.value),e[on]=yr(n),vr(e,"change",()=>{e[on](oo(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[on]=yr(r),t!==n&&(e.checked=R.looseEqual(t,r.props.value))}},Ay={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const o=R.isSet(t);vr(e,"change",()=>{const s=Array.prototype.filter.call(e.options,i=>i.selected).map(i=>n?R.looseToNumber(oo(i)):oo(i));e[on](e.multiple?o?new Set(s):s:s[0]),e._assigning=!0,xt(()=>{e._assigning=!1})}),e[on]=yr(r)},mounted(e,{value:t}){ad(e,t)},beforeUpdate(e,t,n){e[on]=yr(n)},updated(e,{value:t}){e._assigning||ad(e,t)}};function ad(e,t){const n=e.multiple,r=R.isArray(t);if(n&&!r&&!R.isSet(t)){ce.env.NODE_ENV!=="production"&&ed(`<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(t).slice(8,-1)}.`);return}for(let o=0,s=e.options.length;o<s;o++){const i=e.options[o],l=oo(i);if(n)if(r){const u=typeof l;u==="string"||u==="number"?i.selected=t.some(d=>String(d)===String(l)):i.selected=R.looseIndexOf(t,l)>-1}else i.selected=t.has(l);else if(R.looseEqual(oo(i),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}function oo(e){return"_value"in e?e._value:e.value}function ld(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Ey={created(e,t,n){oi(e,t,n,null,"created")},mounted(e,t,n){oi(e,t,n,null,"mounted")},beforeUpdate(e,t,n,r){oi(e,t,n,r,"beforeUpdate")},updated(e,t,n,r){oi(e,t,n,r,"updated")}};function Ry(e,t){switch(e){case"SELECT":return Ay;case"TEXTAREA":return Ua;default:switch(t){case"checkbox":return Cy;case"radio":return xy;default:return Ua}}}function oi(e,t,n,r,o){const i=Ry(e.tagName,n.props&&n.props.type)[o];i&&i(e,t,n,r)}const Dy=["ctrl","shift","alt","meta"],Py={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Dy.some(n=>e[`${n}Key`]&&!t.includes(n))},wt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((o,...s)=>{for(let i=0;i<t.length;i++){const l=Py[t[i]];if(l&&l(o,t))return}return e(o,...s)}))},Iy={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},zo=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(o=>{if(!("key"in o))return;const s=R.hyphenate(o.key);if(t.some(i=>i===s||Iy[i]===s))return e(o)}))};function Fy(){wy()}ce.env.NODE_ENV!=="production"&&Fy();const Bt=()=>Pg.useAbility();function cd(e){if(e===void 0)throw new Error('cloneStateObject: cannot clone "undefined"');return JSON.parse(JSON.stringify(e))}const Uo=(e,t)=>!e||!t?!1:e.id===t.id;function $y(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Va,ud;function Oy(){if(ud)return Va;ud=1;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function t(o,s){for(var i="",l=0,u=-1,d=0,c,p=0;p<=o.length;++p){if(p<o.length)c=o.charCodeAt(p);else{if(c===47)break;c=47}if(c===47){if(!(u===p-1||d===1))if(u!==p-1&&d===2){if(i.length<2||l!==2||i.charCodeAt(i.length-1)!==46||i.charCodeAt(i.length-2)!==46){if(i.length>2){var f=i.lastIndexOf("/");if(f!==i.length-1){f===-1?(i="",l=0):(i=i.slice(0,f),l=i.length-1-i.lastIndexOf("/")),u=p,d=0;continue}}else if(i.length===2||i.length===1){i="",l=0,u=p,d=0;continue}}s&&(i.length>0?i+="/..":i="..",l=2)}else i.length>0?i+="/"+o.slice(u+1,p):i=o.slice(u+1,p),l=p-u-1;u=p,d=0}else c===46&&d!==-1?++d:d=-1}return i}function n(o,s){var i=s.dir||s.root,l=s.base||(s.name||"")+(s.ext||"");return i?i===s.root?i+l:i+o+l:l}var r={resolve:function(){for(var s="",i=!1,l,u=arguments.length-1;u>=-1&&!i;u--){var d;u>=0?d=arguments[u]:(l===void 0&&(l=ce.cwd()),d=l),e(d),d.length!==0&&(s=d+"/"+s,i=d.charCodeAt(0)===47)}return s=t(s,!i),i?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(e(s),s.length===0)return".";var i=s.charCodeAt(0)===47,l=s.charCodeAt(s.length-1)===47;return s=t(s,!i),s.length===0&&!i&&(s="."),s.length>0&&l&&(s+="/"),i?"/"+s:s},isAbsolute:function(s){return e(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,i=0;i<arguments.length;++i){var l=arguments[i];e(l),l.length>0&&(s===void 0?s=l:s+="/"+l)}return s===void 0?".":r.normalize(s)},relative:function(s,i){if(e(s),e(i),s===i||(s=r.resolve(s),i=r.resolve(i),s===i))return"";for(var l=1;l<s.length&&s.charCodeAt(l)===47;++l);for(var u=s.length,d=u-l,c=1;c<i.length&&i.charCodeAt(c)===47;++c);for(var p=i.length,f=p-c,h=d<f?d:f,g=-1,m=0;m<=h;++m){if(m===h){if(f>h){if(i.charCodeAt(c+m)===47)return i.slice(c+m+1);if(m===0)return i.slice(c+m)}else d>h&&(s.charCodeAt(l+m)===47?g=m:m===0&&(g=0));break}var w=s.charCodeAt(l+m),T=i.charCodeAt(c+m);if(w!==T)break;w===47&&(g=m)}var k="";for(m=l+g+1;m<=u;++m)(m===u||s.charCodeAt(m)===47)&&(k.length===0?k+="..":k+="/..");return k.length>0?k+i.slice(c+g):(c+=g,i.charCodeAt(c)===47&&++c,i.slice(c))},_makeLong:function(s){return s},dirname:function(s){if(e(s),s.length===0)return".";for(var i=s.charCodeAt(0),l=i===47,u=-1,d=!0,c=s.length-1;c>=1;--c)if(i=s.charCodeAt(c),i===47){if(!d){u=c;break}}else d=!1;return u===-1?l?"/":".":l&&u===1?"//":s.slice(0,u)},basename:function(s,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');e(s);var l=0,u=-1,d=!0,c;if(i!==void 0&&i.length>0&&i.length<=s.length){if(i.length===s.length&&i===s)return"";var p=i.length-1,f=-1;for(c=s.length-1;c>=0;--c){var h=s.charCodeAt(c);if(h===47){if(!d){l=c+1;break}}else f===-1&&(d=!1,f=c+1),p>=0&&(h===i.charCodeAt(p)?--p===-1&&(u=c):(p=-1,u=f))}return l===u?u=f:u===-1&&(u=s.length),s.slice(l,u)}else{for(c=s.length-1;c>=0;--c)if(s.charCodeAt(c)===47){if(!d){l=c+1;break}}else u===-1&&(d=!1,u=c+1);return u===-1?"":s.slice(l,u)}},extname:function(s){e(s);for(var i=-1,l=0,u=-1,d=!0,c=0,p=s.length-1;p>=0;--p){var f=s.charCodeAt(p);if(f===47){if(!d){l=p+1;break}continue}u===-1&&(d=!1,u=p+1),f===46?i===-1?i=p:c!==1&&(c=1):i!==-1&&(c=-1)}return i===-1||u===-1||c===0||c===1&&i===u-1&&i===l+1?"":s.slice(i,u)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return n("/",s)},parse:function(s){e(s);var i={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return i;var l=s.charCodeAt(0),u=l===47,d;u?(i.root="/",d=1):d=0;for(var c=-1,p=0,f=-1,h=!0,g=s.length-1,m=0;g>=d;--g){if(l=s.charCodeAt(g),l===47){if(!h){p=g+1;break}continue}f===-1&&(h=!1,f=g+1),l===46?c===-1?c=g:m!==1&&(m=1):c!==-1&&(m=-1)}return c===-1||f===-1||m===0||m===1&&c===f-1&&c===p+1?f!==-1&&(p===0&&u?i.base=i.name=s.slice(1,f):i.base=i.name=s.slice(p,f)):(p===0&&u?(i.name=s.slice(1,c),i.base=s.slice(1,f)):(i.name=s.slice(p,c),i.base=s.slice(p,f)),i.ext=s.slice(c,f)),p>0?i.dir=s.slice(0,p-1):u&&(i.dir="/"),i},sep:"/",delimiter:":",win32:null,posix:null};return r.posix=r,Va=r,Va}var Ke=Oy();const qa=$y(Ke),Ly=ge({name:"SpaceMoveInfoModal",props:{modal:{type:Object,required:!0}}}),Le=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},_y=["textContent"],My=["textContent"];function Ny(e,t,n,r,o,s){return I(),G(Ae,null,[Q("p",{class:"mt-0",textContent:R.toDisplayString(e.$gettext("Moving files from one space to another is not possible. Do you want to copy instead?"))},null,8,_y),Q("p",{class:"mb-0",textContent:R.toDisplayString(e.$gettext("Note: Links and shares of the original file are not copied."))},null,8,My)],64)}const dd=Le(Ly,[["render",Ny]]),By=ge({name:"ResourceConflictModal",props:{modal:{type:Object,required:!0},resource:{type:Object,required:!0},conflictCount:{type:Number,required:!0},callbackFn:{type:Function,required:!0},suggestMerge:{type:Boolean,default:!0},separateSkipHandling:{type:Boolean,default:!1},confirmSecondaryTextOverwrite:{type:String,default:null}},setup(e){const{removeModal:t}=Je(),{$gettext:n}=me.useGettext(),r=W(!1),o=A(()=>e.conflictCount<2?"":e.separateSkipHandling?e.resource.isFolder?n("Apply to all %{count} folders",{count:e.conflictCount.toString()},!0):n("Apply to all %{count} files",{count:e.conflictCount.toString()},!0):n("Apply to all %{count} conflicts",{count:e.conflictCount.toString()},!0)),s=A(()=>e.resource.isFolder?n("Folder with name »%{name}« already exists.",{name:e.resource.name},!0):n("File with name »%{name}« already exists.",{name:e.resource.name},!0)),i=A(()=>e.confirmSecondaryTextOverwrite||n("Replace"));return{message:s,checkboxValue:r,checkboxLabel:o,confirmSecondaryText:i,onConfirm:()=>{t(e.modal.id),e.callbackFn({strategy:Sn.KEEP_BOTH,doForAllConflicts:a(r)})},onConfirmSecondary:()=>{t(e.modal.id);const c=e.suggestMerge?Sn.MERGE:Sn.REPLACE;e.callbackFn({strategy:c,doForAllConflicts:a(r)})},onCancel:()=>{t(e.modal.id),e.callbackFn({strategy:Sn.SKIP,doForAllConflicts:a(r)})}}}}),jy=["textContent"],zy={class:"my-4"},Uy={class:"flex justify-end items-center mt-4"},Vy={class:"oc-modal-body-actions-grid"};function qy(e,t,n,r,o,s){const i=oe("oc-checkbox"),l=oe("oc-button");return I(),G(Ae,null,[Q("span",{class:"inline-block mb-4",textContent:R.toDisplayString(e.message)},null,8,jy),Q("div",zy,[e.conflictCount>1?(I(),re(i,{key:0,modelValue:e.checkboxValue,"onUpdate:modelValue":t[0]||(t[0]=u=>e.checkboxValue=u),size:"medium",label:e.checkboxLabel,"aria-label":e.checkboxLabel},null,8,["modelValue","label","aria-label"])):le("",!0)]),Q("div",Uy,[Q("div",Vy,[J(l,{class:"oc-modal-body-actions-cancel ml-2",onClick:e.onCancel},{default:Z(()=>[ct(R.toDisplayString(e.$gettext("Skip")),1)]),_:1},8,["onClick"]),J(l,{class:"oc-modal-body-actions-secondary ml-2",onClick:e.onConfirmSecondary},{default:Z(()=>[ct(R.toDisplayString(e.confirmSecondaryText),1)]),_:1},8,["onClick"]),J(l,{class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:e.onConfirm},{default:Z(()=>[ct(R.toDisplayString(e.$gettext("Keep both")),1)]),_:1},8,["onClick"])])])],64)}const fd=Le(By,[["render",qy]]);class Ha{constructor(t,n){this.$gettext=t,this.$ngettext=n}async resolveAllConflicts(t,n,r){const o=[];for(const d of t){const c=Ke.join(n.path,d.name);r.some(f=>f.path===c)&&o.push({resource:d,strategy:null})}let s=0,i=!1,l=null;const u=[];for(const d of o){if(i){d.strategy=l,u.push(d);continue}const c=o.length-s,p=await this.resolveFileExists(d.resource,c);d.strategy=p.strategy,u.push(d),s+=1,p.doForAllConflicts&&(i=!0,l=p.strategy)}return u}resolveFileExists(t,n,r=!1,o=!1){const{dispatchModal:s}=Je();return new Promise(i=>{s({title:t.isFolder?this.$gettext("Folder already exists"):this.$gettext("File already exists"),hideActions:!0,customComponent:fd,customComponentAttrs:()=>({resource:t,conflictCount:n,suggestMerge:r,separateSkipHandling:o,callbackFn:l=>{i(l)}})})})}resolveDoCopyInsteadOfMoveForSpaces(){const{dispatchModal:t}=Je();return new Promise(n=>{t({title:this.$gettext("Copy here?"),customComponent:dd,confirmText:this.$gettext("Copy here"),onCancel:()=>{n(!1)},onConfirm:()=>Promise.resolve(n(!0))})})}}const wn=(e,t,n,r=1)=>{let o;return t?o=`${z.extractNameWithoutExtension({name:e,extension:t})} (${r}).${t}`:o=`${e} (${r})`,n.some(i=>i.name===o)?wn(e,t,n,r+1):o},pd=(e,t,n,r)=>e.id===n.id&&Ke.dirname(t.path)===r.path;var Sn=(e=>(e[e.SKIP=0]="SKIP",e[e.REPLACE=1]="REPLACE",e[e.KEEP_BOTH=2]="KEEP_BOTH",e[e.MERGE=3]="MERGE",e))(Sn||{}),Xn=(e=>(e[e.COPY=0]="COPY",e[e.MOVE=1]="MOVE",e))(Xn||{});class hd extends Ha{constructor(t,n,r,o,s,i,l,u){super(l,u),this.sourceSpace=t,this.resourcesToMove=n,this.targetSpace=r,this.targetFolder=o,this.currentFolder=s,this.clientService=i}hasRecursion(){return this.sourceSpace.id!==this.targetSpace.id?!1:this.resourcesToMove.some(t=>this.targetFolder.path===t.path)}showRecursionErrorMessage(){const t=this.resourcesToMove.length,n=this.$ngettext("You can't paste the selected file at this location because you can't paste an item into itself.","You can't paste the selected files at this location because you can't paste an item into itself.",t);Me().showErrorMessage({title:n})}showResultMessage(t,n,r){if(t.length===0){const l=n.length;if(l===0)return;const u=r===Xn.COPY?this.$ngettext("%{count} item was copied successfully","%{count} items were copied successfully",l,{count:l.toString()},!0):this.$ngettext("%{count} item was moved successfully","%{count} items were moved successfully",l,{count:l.toString()},!0);Me().showMessage({title:u,status:"success"});return}let o=r===Xn.COPY?this.$gettext("Failed to copy %{count} resources",{count:t.length.toString()},!0):this.$gettext("Failed to move %{count} resources",{count:t.length.toString()},!0);t.length===1&&(o=r===Xn.COPY?this.$gettext("Failed to copy »%{name}«",{name:t[0]?.resourceName},!0):this.$gettext("Failed to move »%{name}«",{name:t[0]?.resourceName},!0));let s="";t.some(({error:l})=>l instanceof z.HttpError&&l.statusCode===507)&&(s=this.$gettext("Insufficient quota")),Me().showErrorMessage({title:o,...s&&{desc:s},errors:t.map(({error:l})=>l)})}async getTransferData(t){if(this.hasRecursion())return this.showRecursionErrorMessage(),[];if(this.sourceSpace.id!==this.targetSpace.id&&t===Xn.MOVE){if(!await this.resolveDoCopyInsteadOfMoveForSpaces())return[];t=Xn.COPY}const n=(await this.clientService.webdav.listFiles(this.targetSpace,this.targetFolder)).children,r=await this.resolveAllConflicts(this.resourcesToMove,this.targetFolder,n),o=[];for(const s of this.resourcesToMove){const i={...s},{id:l,name:u,extension:d}=i,c=r.some(h=>h.resource.id===l);let p=u,f=!1;if(c){const h=r.find(g=>g.resource.id===l)?.strategy;if(h===Sn.SKIP)continue;if(h===Sn.REPLACE){if(this.isOverwritingParentFolder(i,this.targetFolder,n)){const g=new Error;this.showResultMessage([{error:g,resourceName:u}],[],t);continue}f=!0}h===Sn.KEEP_BOTH&&(p=wn(u,d,n),i.name=p)}pd(this.sourceSpace,i,this.targetSpace,this.targetFolder)&&f||o.push({resource:i,sourceSpace:this.sourceSpace,targetSpace:this.targetSpace,targetFolder:this.targetFolder,path:Ke.join(this.targetFolder.path,p),overwrite:f,transferType:t})}return o}isOverwritingParentFolder(t,n,r){if(t.type!=="folder")return!1;const o=a(this.currentFolder)?.path;if(!o||n.path===o)return!1;const s=Ke.basename(t.path),i=Ke.join(n.path,s);return o.split("/").length<i.split("/").length?!1:r.some(l=>l.path===i)}}const Wa={ignoreLocation:!0,threshold:0,useExtendedSearch:!0},Hy=(e,t,n)=>new Nc(e,{...Wa,keys:["name","type","icon","extension","tags"]}).search(t,{limit:n}).map(o=>o.item),md="oc-resource-icon-mapping",Wy={archive:{icon:{name:"resource-type-archive",color:"var(--oc-color-icon-archive)"},extensions:["7z","apk","bz2","deb","gz","gzip","rar","tar","tar.bz2","tar.gz","tar.xz","tbz2","tgz","zip"]},audio:{icon:{name:"resource-type-audio",color:"var(--oc-color-icon-audio)"},extensions:["3gp","8svx","aa","aac","aax","act","aiff","alac","amr","ape","au","awb","cda","dss","dvf","flac","gsm","iklax","ivs","m4a","m4b","m4p","mmf","mogg","movpkg","mp3","mpc","msv","nmf","oga","ogga","opus","ra","raw","rf64","rm","sln","tta","voc","vox","wav","wma","wv"]},code:{icon:{name:"resource-type-code",color:"var(--oc-role-on-surface)"},extensions:["bash","c++","c","cc","cpp","css","feature","go","h","hh","hpp","htm","html","java","js","json","php","pl","py","scss","sh","sh-lib","sql","ts","xml","yaml","yml"]},default:{icon:{name:"resource-type-file",color:"var(--oc-role-on-surface)"},extensions:["accdb","rss","swf"]},drawio:{icon:{name:"resource-type-drawio",color:"var(--oc-color-icon-drawio)"},extensions:["drawio"]},document:{icon:{name:"resource-type-document",color:"var(--oc-color-icon-document)"},extensions:["doc","docm","docx","dot","dotx","lwp","odt","one","vsd","wpd"]},ifc:{icon:{name:"resource-type-ifc",color:"var(--oc-color-icon-ifc)"},extensions:["ifc"]},ipynb:{icon:{name:"resource-type-jupyter",color:"var(--oc-color-icon-jupyter)"},extensions:["ipynb"]},image:{icon:{name:"resource-type-image",color:"var(--oc-color-icon-image)"},extensions:["ai","cdr","eot","eps","gif","jpeg","jpg","otf","pfb","png","ps","psd","svg","ttf","webp","woff","xcf"]},form:{icon:{name:"resource-type-form",color:"var(--oc-color-icon-form)"},extensions:["docf","docxf","oform"]},markdown:{icon:{name:"resource-type-markdown",color:"var(--oc-color-icon-markdown)"},extensions:["md","markdown"]},odg:{icon:{name:"resource-type-graphic",color:"var(--oc-color-icon-graphic)"},extensions:["odg"]},pdf:{icon:{name:"resource-type-pdf",color:"var(--oc-color-icon-pdf)"},extensions:["pdf"]},presentation:{icon:{name:"resource-type-presentation",color:"var(--oc-color-icon-presentation)"},extensions:["odp","otp","pot","potm","potx","ppa","ppam","pps","ppsm","ppsx","ppt","pptm","pptx"]},root:{icon:{name:"resource-type-root",color:"var(--oc-color-icon-root)"},extensions:["root"]},spreadsheet:{icon:{name:"resource-type-spreadsheet",color:"var(--oc-color-icon-spreadsheet)"},extensions:["csv","ods","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx"]},text:{icon:{name:"resource-type-text",color:"var(--oc-role-on-surface)"},extensions:["cb7","cba","cbr","cbt","cbtc","cbz","cvbdl","eml","mdb","tex","txt"]},url:{icon:{name:"resource-type-url",color:"var(--oc-role-on-surface)"},extensions:["url"]},video:{icon:{name:"resource-type-video",color:"var(--oc-color-icon-video)"},extensions:["mov","mp4","webm","wmv"]},epub:{icon:{name:"resource-type-book",color:"var(--oc-color-icon-epub)"},extensions:["epub"]},board:{icon:{name:"resource-type-board"},extensions:["ggs"]},notes:{icon:{name:"resource-type-sticky-note",color:"var(--oc-color-icon-notes)"},extensions:["ocnb"]}};function gd(){const e={};return Object.values(Wy).forEach(t=>{t.extensions.forEach(n=>{e[n]=t.icon})}),e}const vd=({resourcesStore:e,parentFolderId:t})=>{const n=e.currentFolder;if(!n||!n.id)return!1;if(z.extractNodeId(n.id)){if(n.id!==t)return!1}else{const r=n.id.split("$")[1];if(`${n.id}!${r}`!==t)return!1}return!0};function Qa(e,t,n){return t.name=Ke.basename(n),t.path=n,t.webDavPath=Ke.join(e.webDavPath,n),t.extension=z.extractExtensionFromFile(t),t}function Qy(){this.__data__=[],this.size=0}function Vo(e,t){return e===t||e!==e&&t!==t}function si(e,t){for(var n=e.length;n--;)if(Vo(e[n][0],t))return n;return-1}var Ky=Array.prototype,Gy=Ky.splice;function Jy(e){var t=this.__data__,n=si(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Gy.call(t,n,1),--this.size,!0}function Xy(e){var t=this.__data__,n=si(t,e);return n<0?void 0:t[n][1]}function Yy(e){return si(this.__data__,e)>-1}function Zy(e,t){var n=this.__data__,r=si(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Yn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Yn.prototype.clear=Qy,Yn.prototype.delete=Jy,Yn.prototype.get=Xy,Yn.prototype.has=Yy,Yn.prototype.set=Zy;function eb(){this.__data__=new Yn,this.size=0}function tb(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function nb(e){return this.__data__.get(e)}function rb(e){return this.__data__.has(e)}const br=globalThis||void 0||self;var yd=typeof br=="object"&&br&&br.Object===Object&&br,ob=typeof self=="object"&&self&&self.Object===Object&&self,Fn=yd||ob||Function("return this")(),sn=Fn.Symbol,bd=Object.prototype,sb=bd.hasOwnProperty,ib=bd.toString,qo=sn?sn.toStringTag:void 0;function ab(e){var t=sb.call(e,qo),n=e[qo];try{e[qo]=void 0;var r=!0}catch{}var o=ib.call(e);return r&&(t?e[qo]=n:delete e[qo]),o}var lb=Object.prototype,cb=lb.toString;function ub(e){return cb.call(e)}var db="[object Null]",fb="[object Undefined]",wd=sn?sn.toStringTag:void 0;function Ir(e){return e==null?e===void 0?fb:db:wd&&wd in Object(e)?ab(e):ub(e)}function $n(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var pb="[object AsyncFunction]",hb="[object Function]",mb="[object GeneratorFunction]",gb="[object Proxy]";function Ka(e){if(!$n(e))return!1;var t=Ir(e);return t==hb||t==mb||t==pb||t==gb}var Ga=Fn["__core-js_shared__"],Sd=(function(){var e=/[^.]+$/.exec(Ga&&Ga.keys&&Ga.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function vb(e){return!!Sd&&Sd in e}var yb=Function.prototype,bb=yb.toString;function Fr(e){if(e!=null){try{return bb.call(e)}catch{}try{return e+""}catch{}}return""}var wb=/[\\^$.*+?()[\]{}|]/g,Sb=/^\[object .+?Constructor\]$/,Tb=Function.prototype,kb=Object.prototype,Cb=Tb.toString,xb=kb.hasOwnProperty,Ab=RegExp("^"+Cb.call(xb).replace(wb,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Eb(e){if(!$n(e)||vb(e))return!1;var t=Ka(e)?Ab:Sb;return t.test(Fr(e))}function Rb(e,t){return e?.[t]}function $r(e,t){var n=Rb(e,t);return Eb(n)?n:void 0}var Ho=$r(Fn,"Map"),Wo=$r(Object,"create");function Db(){this.__data__=Wo?Wo(null):{},this.size=0}function Pb(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ib="__lodash_hash_undefined__",Fb=Object.prototype,$b=Fb.hasOwnProperty;function Ob(e){var t=this.__data__;if(Wo){var n=t[e];return n===Ib?void 0:n}return $b.call(t,e)?t[e]:void 0}var Lb=Object.prototype,_b=Lb.hasOwnProperty;function Mb(e){var t=this.__data__;return Wo?t[e]!==void 0:_b.call(t,e)}var Nb="__lodash_hash_undefined__";function Bb(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Wo&&t===void 0?Nb:t,this}function Or(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Or.prototype.clear=Db,Or.prototype.delete=Pb,Or.prototype.get=Ob,Or.prototype.has=Mb,Or.prototype.set=Bb;function jb(){this.size=0,this.__data__={hash:new Or,map:new(Ho||Yn),string:new Or}}function zb(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ii(e,t){var n=e.__data__;return zb(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Ub(e){var t=ii(this,e).delete(e);return this.size-=t?1:0,t}function Vb(e){return ii(this,e).get(e)}function qb(e){return ii(this,e).has(e)}function Hb(e,t){var n=ii(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Zn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Zn.prototype.clear=jb,Zn.prototype.delete=Ub,Zn.prototype.get=Vb,Zn.prototype.has=qb,Zn.prototype.set=Hb;var Wb=200;function Qb(e,t){var n=this.__data__;if(n instanceof Yn){var r=n.__data__;if(!Ho||r.length<Wb-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Zn(r)}return n.set(e,t),this.size=n.size,this}function On(e){var t=this.__data__=new Yn(e);this.size=t.size}On.prototype.clear=eb,On.prototype.delete=tb,On.prototype.get=nb,On.prototype.has=rb,On.prototype.set=Qb;var ai=(function(){try{var e=$r(Object,"defineProperty");return e({},"",{}),e}catch{}})();function Ja(e,t,n){t=="__proto__"&&ai?ai(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Xa(e,t,n){(n!==void 0&&!Vo(e[t],n)||n===void 0&&!(t in e))&&Ja(e,t,n)}function Kb(e){return function(t,n,r){for(var o=-1,s=Object(t),i=r(t),l=i.length;l--;){var u=i[++o];if(n(s[u],u,s)===!1)break}return t}}var Gb=Kb(),Td=typeof x=="object"&&x&&!x.nodeType&&x,kd=Td&&typeof module=="object"&&module&&!module.nodeType&&module,Jb=kd&&kd.exports===Td,Cd=Jb?Fn.Buffer:void 0,xd=Cd?Cd.allocUnsafe:void 0;function Ad(e,t){if(t)return e.slice();var n=e.length,r=xd?xd(n):new e.constructor(n);return e.copy(r),r}var li=Fn.Uint8Array;function Ya(e){var t=new e.constructor(e.byteLength);return new li(t).set(new li(e)),t}function Ed(e,t){var n=t?Ya(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Xb(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Rd=Object.create,Yb=(function(){function e(){}return function(t){if(!$n(t))return{};if(Rd)return Rd(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})();function Dd(e,t){return function(n){return e(t(n))}}var Za=Dd(Object.getPrototypeOf,Object),Zb=Object.prototype;function el(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Zb;return e===n}function ew(e){return typeof e.constructor=="function"&&!el(e)?Yb(Za(e)):{}}function Ln(e){return e!=null&&typeof e=="object"}var tw="[object Arguments]";function Pd(e){return Ln(e)&&Ir(e)==tw}var Id=Object.prototype,nw=Id.hasOwnProperty,rw=Id.propertyIsEnumerable,ci=Pd((function(){return arguments})())?Pd:function(e){return Ln(e)&&nw.call(e,"callee")&&!rw.call(e,"callee")},Tn=Array.isArray,ow=9007199254740991;function Fd(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ow}function ui(e){return e!=null&&Fd(e.length)&&!Ka(e)}function sw(e){return Ln(e)&&ui(e)}function iw(){return!1}var $d=typeof x=="object"&&x&&!x.nodeType&&x,Od=$d&&typeof module=="object"&&module&&!module.nodeType&&module,aw=Od&&Od.exports===$d,Ld=aw?Fn.Buffer:void 0,lw=Ld?Ld.isBuffer:void 0,Qo=lw||iw,cw="[object Object]",uw=Function.prototype,dw=Object.prototype,_d=uw.toString,fw=dw.hasOwnProperty,pw=_d.call(Object);function tl(e){if(!Ln(e)||Ir(e)!=cw)return!1;var t=Za(e);if(t===null)return!0;var n=fw.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&_d.call(n)==pw}var hw="[object Arguments]",mw="[object Array]",gw="[object Boolean]",vw="[object Date]",yw="[object Error]",bw="[object Function]",ww="[object Map]",Sw="[object Number]",Tw="[object Object]",kw="[object RegExp]",Cw="[object Set]",xw="[object String]",Aw="[object WeakMap]",Ew="[object ArrayBuffer]",Rw="[object DataView]",Dw="[object Float32Array]",Pw="[object Float64Array]",Iw="[object Int8Array]",Fw="[object Int16Array]",$w="[object Int32Array]",Ow="[object Uint8Array]",Lw="[object Uint8ClampedArray]",_w="[object Uint16Array]",Mw="[object Uint32Array]",ot={};ot[Dw]=ot[Pw]=ot[Iw]=ot[Fw]=ot[$w]=ot[Ow]=ot[Lw]=ot[_w]=ot[Mw]=!0,ot[hw]=ot[mw]=ot[Ew]=ot[gw]=ot[Rw]=ot[vw]=ot[yw]=ot[bw]=ot[ww]=ot[Sw]=ot[Tw]=ot[kw]=ot[Cw]=ot[xw]=ot[Aw]=!1;function Nw(e){return Ln(e)&&Fd(e.length)&&!!ot[Ir(e)]}function nl(e){return function(t){return e(t)}}var Md=typeof x=="object"&&x&&!x.nodeType&&x,Ko=Md&&typeof module=="object"&&module&&!module.nodeType&&module,Bw=Ko&&Ko.exports===Md,rl=Bw&&yd.process,so=(function(){try{var e=Ko&&Ko.require&&Ko.require("util").types;return e||rl&&rl.binding&&rl.binding("util")}catch{}})(),Nd=so&&so.isTypedArray,ol=Nd?nl(Nd):Nw;function sl(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var jw=Object.prototype,zw=jw.hasOwnProperty;function Bd(e,t,n){var r=e[t];(!(zw.call(e,t)&&Vo(r,n))||n===void 0&&!(t in e))&&Ja(e,t,n)}function jd(e,t,n,r){var o=!n;n||(n={});for(var s=-1,i=t.length;++s<i;){var l=t[s],u=void 0;u===void 0&&(u=e[l]),o?Ja(n,l,u):Bd(n,l,u)}return n}function Uw(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Vw=9007199254740991,qw=/^(?:0|[1-9]\d*)$/;function zd(e,t){var n=typeof e;return t=t??Vw,!!t&&(n=="number"||n!="symbol"&&qw.test(e))&&e>-1&&e%1==0&&e<t}var Hw=Object.prototype,Ww=Hw.hasOwnProperty;function Ud(e,t){var n=Tn(e),r=!n&&ci(e),o=!n&&!r&&Qo(e),s=!n&&!r&&!o&&ol(e),i=n||r||o||s,l=i?Uw(e.length,String):[],u=l.length;for(var d in e)(t||Ww.call(e,d))&&!(i&&(d=="length"||o&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||zd(d,u)))&&l.push(d);return l}function Qw(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Kw=Object.prototype,Gw=Kw.hasOwnProperty;function Jw(e){if(!$n(e))return Qw(e);var t=el(e),n=[];for(var r in e)r=="constructor"&&(t||!Gw.call(e,r))||n.push(r);return n}function il(e){return ui(e)?Ud(e,!0):Jw(e)}function Xw(e){return jd(e,il(e))}function Yw(e,t,n,r,o,s,i){var l=sl(e,n),u=sl(t,n),d=i.get(u);if(d){Xa(e,n,d);return}var c=s?s(l,u,n+"",e,t,i):void 0,p=c===void 0;if(p){var f=Tn(u),h=!f&&Qo(u),g=!f&&!h&&ol(u);c=u,f||h||g?Tn(l)?c=l:sw(l)?c=Xb(l):h?(p=!1,c=Ad(u,!0)):g?(p=!1,c=Ed(u,!0)):c=[]:tl(u)||ci(u)?(c=l,ci(l)?c=Xw(l):(!$n(l)||Ka(l))&&(c=ew(u))):p=!1}p&&(i.set(u,c),o(c,u,r,s,i),i.delete(u)),Xa(e,n,c)}function Vd(e,t,n,r,o){e!==t&&Gb(t,function(s,i){if(o||(o=new On),$n(s))Yw(e,t,i,n,Vd,r,o);else{var l=r?r(sl(e,i),s,i+"",e,t,o):void 0;l===void 0&&(l=s),Xa(e,i,l)}},il)}function qd(e){return e}function Zw(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Hd=Math.max;function Wd(e,t,n){return t=Hd(t===void 0?e.length-1:t,0),function(){for(var r=arguments,o=-1,s=Hd(r.length-t,0),i=Array(s);++o<s;)i[o]=r[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=r[o];return l[t]=n(i),Zw(e,this,l)}}function eS(e){return function(){return e}}var tS=ai?function(e,t){return ai(e,"toString",{configurable:!0,enumerable:!1,value:eS(t),writable:!0})}:qd,nS=800,rS=16,oS=Date.now;function sS(e){var t=0,n=0;return function(){var r=oS(),o=rS-(r-n);if(n=r,o>0){if(++t>=nS)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Qd=sS(tS);function iS(e,t){return Qd(Wd(e,t,qd),e+"")}function aS(e,t,n){if(!$n(n))return!1;var r=typeof t;return(r=="number"?ui(n)&&zd(t,n.length):r=="string"&&t in n)?Vo(n[t],e):!1}function lS(e){return iS(function(t,n){var r=-1,o=n.length,s=o>1?n[o-1]:void 0,i=o>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(o--,s):void 0,i&&aS(n[0],n[1],i)&&(s=o<3?void 0:s,o=1),t=Object(t);++r<o;){var l=n[r];l&&e(t,l,r,s)}return t})}var Go=lS(function(e,t,n){Vd(e,t,n)});const al=(e,...t)=>{const{href:n}=e.resolve(a(e.currentRoute));return t.map(r=>{const{href:o}=e.resolve({...r});return o==="/"||o==="#/"?!1:n.startsWith(o)}).some(Boolean)},io=(...e)=>(t,...n)=>{if(!n.length)return al(t,...e);const[r,...o]=n.map(s=>{const i=e.find(l=>l.name===s);if(!i)throw new Error(`unknown comparative '${s}'`);return i});return al(t,r,...o)};function PO(e){return e}const ao=(e,...t)=>Go({},{name:e},...t.map(n=>({...n.params&&{params:n.params},...n.query&&{query:n.query}}))),lo=(e,t={})=>ao(e,t),Kd=lo("files-common-favorites"),Gd=lo("files-common-search"),bt=io(Kd,Gd),cS=e=>[{path:"/search",component:e.App,children:[{name:Gd.name,path:"list/:page?",component:e.SearchResults,meta:{authContext:"user",title:"Search results",contextQueryItems:["term","provider","q_tags","q_lastModified","q_titleOnly","q_mediaType","scope","useScope","sort-by","sort-dir"]}}]},{path:"/favorites",component:e.App,children:[{name:Kd.name,path:"",component:e.Favorites,meta:{authContext:"user",title:"Favorite files"}}]}],kn=(e,t={})=>ao(e,t),Jd=kn("files-spaces-projects"),ll=kn("files-spaces-generic"),st=io(Jd,ll),uS=e=>[{path:"/spaces",component:e.App,children:[{path:"projects",name:Jd.name,component:e.Spaces.Projects,meta:{authContext:"user",title:"Spaces"}},{path:":driveAliasAndItem(.*)?",name:ll.name,component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0,contextQueryItems:["sort-by","sort-dir"]}}]}],an=(e,t={})=>ao(e,t),dS=an("files-shares"),di=an("files-shares-with-me"),cl=an("files-shares-with-others"),ul=an("files-shares-via-link"),mt=io(di,cl,ul),fS=e=>[{name:dS.name,path:"/shares",component:e.App,redirect:di,children:[{name:di.name,path:"with-me",component:e.Shares.SharedWithMe,meta:{authContext:"user",title:"Files shared with me"}},{name:cl.name,path:"with-others",component:e.Shares.SharedWithOthers,meta:{authContext:"user",title:"Files shared with others"}},{name:ul.name,path:"via-link",component:e.Shares.SharedViaLink,meta:{authContext:"user",title:"Files shared via link"}}]}],co=(e,t={})=>ao(e,t),dl=co("files-public-link"),fl=co("files-public-upload"),ln=io(dl,fl),pS=e=>[{path:"/link",component:e.App,meta:{auth:!1},children:[{name:dl.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"publicLink",patchCleanPath:!0}}]},{path:"/upload",component:e.App,meta:{auth:!1},children:[{name:fl.name,path:":token?",component:e.FilesDrop,meta:{authContext:"publicLink",title:"Public file upload"}}]}],wr=(e,t={})=>ao(e,t),Xd=wr("files-trash-generic"),Yd=wr("files-trash-overview"),qt=io(Xd,Yd),hS=e=>[{path:"/trash",component:e.App,children:[{path:"overview",name:Yd.name,component:e.Trash.Overview,meta:{authContext:"user",title:"Trash overview"}},{name:Xd.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0}}]}];function Zd(e){return{applicationConfig:A(()=>e.appsStore.externalAppConfig[e.applicationId]||{})}}const mS=["anonymous","user","idp","publicLink","hybrid"],er=e=>Jn(e),Re=()=>er("$router"),St=()=>Re().currentRoute,pl=e=>e.path.split("/")[1],gS=()=>{const e=St();return A(()=>pl(a(e)))},_n=(e,t={},n)=>{const r=n?.configStore||Ge();return{params:{driveAliasAndItem:e.getDriveAliasAndItem({path:t.path||""})},query:{...z.isShareSpaceResource(e)&&{shareId:e.id},...r?.options?.routing?.idBased&&!rt.isUndefined(t.fileId)&&{fileId:`${t.fileId}`}}}},vS=(e,t)=>{const n=document.querySelector("base"),r=!!n,o=new URL(window.location.href.split("#")[0]);return o.search="",r?o.pathname=new URL(n.href).pathname:o.pathname.endsWith("/index.html")&&(o.pathname=o.pathname.split("/").slice(0,-1).filter(Boolean).join("/")),/\.(html?)$/i.test(t)?o.pathname=[...o.pathname.split("/"),...t.split("/")].filter(Boolean).join("/"):o[r?"pathname":"hash"]=e.resolve(t).href,o.href},Mn=we.defineStore("apps",()=>{const e=W({}),t=W({}),n=W([]),r=A(()=>Object.keys(a(e))),o=(u,d)=>{u.id&&(u.extensions&&u.extensions.forEach(c=>{s({appId:u.id,data:c})}),a(e)[u.id]={defaultExtension:u.defaultExtension||"",icon:"check_box_outline_blank",name:u.name||u.id,translations:d,...u})},s=({appId:u,data:d})=>{a(n).push({...d,app:u,hasPriority:d.hasPriority||a(t)?.[u]?.priorityExtensions?.includes(d.extension)||!1,secureView:d.secureView||!1})};return{apps:e,externalAppConfig:t,appIds:r,fileExtensions:n,registerApp:o,registerFileExtension:s,loadExternalAppConfig:({appId:u,config:d})=>{t.value={...a(t),[u]:d}},isAppEnabled:u=>a(r).includes(u)}}),Lr=we.defineStore("auth",()=>{const e=W(),t=W(!1),n=W(!1),r=W(),o=W(),s=W(),i=W(!1),l=h=>{e.value=h},u=h=>{t.value=h},d=h=>{n.value=h},c=h=>{r.value=h.publicLinkToken,o.value=h.publicLinkPassword,s.value=h.publicLinkType,i.value=h.publicLinkContextReady};return{accessToken:e,idpContextReady:t,userContextReady:n,publicLinkToken:r,publicLinkPassword:o,publicLinkType:s,publicLinkContextReady:i,setAccessToken:l,setIdpContextReady:u,setUserContextReady:d,setPublicLinkContext:c,clearUserContext:()=>{l(null),u(null),d(null)},clearPublicLinkContext:()=>{c({publicLinkToken:null,publicLinkPassword:null,publicLinkType:null,publicLinkContextReady:!1})}}}),ef={cernFeatures:!1,concurrentRequests:{resourceBatchActions:4,shares:{create:4,list:2},sse:4,avatars:4},contextHelpers:!0,contextHelpersReadMore:!0,defaultAppId:"files",disabledExtensions:[],disableFeedbackLink:!1,editor:{autosaveEnabled:!0,autosaveInterval:120},embed:{enabled:!1,target:"resources"},ocm:{openRemotely:!1},routing:{idBased:!0,fullShareOwnerPaths:!1},runningOnEos:!1,tokenStorageLocal:!0,userListRequiresFilter:!1,hideLogo:!1},Ge=we.defineStore("config",()=>{const e=Mn(),t=W(""),n=W(""),r=W({...ef}),o=W([]),s=W([]),i=W([]),l=W(),u=W(),d=W(),c=W([]),p=W([]),f=A(()=>z.urlJoin(a(t)||window.location.origin,{trailingSlash:!0})),h=A(()=>z.urlJoin(a(f),"groupware",{trailingSlash:!0})),g=A(()=>!!a(l)),m=A(()=>!!a(u));return{options:r,oAuth2:l,openIdConnect:u,isOAuth2:g,isOIDC:m,customTranslations:i,apps:o,externalApps:s,sentry:d,theme:n,scripts:c,styles:p,serverUrl:f,groupwareUrl:h,loadConfig:T=>{T.server&&(t.value=T.server?.endsWith("/")?T.server:T.server+"/"),o.value=T.apps||[],i.value=T.customTranslations||[],l.value=T.auth,u.value=T.openIdConnect,d.value=T.sentry,c.value=T.scripts||[],p.value=T.styles||[],n.value=T.theme,T.options&&(r.value=Go({...ef},T.options),a(r).ocm.openRemotely=a(r).cernFeatures,a(r).routing.idBased=!a(r).cernFeatures,a(r).routing.fullShareOwnerPaths=a(r).cernFeatures),T.external_apps&&(s.value=T.external_apps,T.external_apps.filter(Boolean).forEach(k=>{e.loadExternalAppConfig({appId:k.id,config:k.config})}))}}}),yS=K.z.object({url:K.z.string()}),bS=K.z.object({apiUrl:K.z.string().optional(),authUrl:K.z.string().optional(),clientId:K.z.string().optional(),clientSecret:K.z.string().optional(),logoutUrl:K.z.string().optional(),metaDataUrl:K.z.string().optional(),url:K.z.string().optional()}),wS=K.z.object({authority:K.z.string().optional(),client_id:K.z.string().optional(),client_secret:K.z.string().optional(),dynamic:K.z.string().optional(),metadata_url:K.z.string().optional(),post_logout_redirect_uri:K.z.string().optional(),response_type:K.z.string().optional(),scope:K.z.string().optional()}).passthrough(),SS=K.z.record(K.z.any(),K.z.any()),TS=K.z.object({href:K.z.string().optional()}),kS=K.z.object({async:K.z.boolean().optional(),src:K.z.string().optional()}),CS=K.z.object({cernFeatures:K.z.boolean().optional(),concurrentRequests:K.z.object({resourceBatchActions:K.z.number().optional(),sse:K.z.number().optional(),shares:K.z.object({create:K.z.number().optional(),list:K.z.number().optional()}).optional(),avatars:K.z.number().optional()}).optional(),contextHelpers:K.z.boolean().optional(),contextHelpersReadMore:K.z.boolean().optional(),defaultAppId:K.z.string().optional(),disabledExtensions:K.z.array(K.z.string()).optional(),disableFeedbackLink:K.z.boolean().optional(),accountEditLink:K.z.object({href:K.z.string().optional()}).optional(),editor:K.z.object({autosaveEnabled:K.z.boolean().optional(),autosaveInterval:K.z.number().optional(),openAsPreview:K.z.union([K.z.boolean(),K.z.array(K.z.string())]).optional()}).optional(),embed:K.z.object({enabled:K.z.boolean().optional(),target:K.z.string().optional(),messagesOrigin:K.z.string().optional(),delegateAuthentication:K.z.boolean().optional(),delegateAuthenticationOrigin:K.z.string().optional(),fileTypes:K.z.array(K.z.string()).optional(),chooseFileName:K.z.boolean().optional(),chooseFileNameSuggestion:K.z.string().optional()}).optional(),feedbackLink:K.z.object({ariaLabel:K.z.string().optional(),description:K.z.string().optional(),href:K.z.string().optional()}).optional(),isRunningOnEos:K.z.boolean().optional(),loginUrl:K.z.string().optional(),logoutUrl:K.z.string().optional(),ocm:K.z.object({openRemotely:K.z.boolean().optional()}).optional(),routing:K.z.object({fullShareOwnerPaths:K.z.boolean().optional(),idBased:K.z.boolean().optional()}).optional(),runningOnEos:K.z.boolean().optional(),tokenStorageLocal:K.z.boolean().optional(),upload:K.z.object({companionUrl:K.z.string().optional()}).optional(),userListRequiresFilter:K.z.boolean().optional(),hideLogo:K.z.boolean().optional()}),xS=K.z.object({id:K.z.string(),path:K.z.string(),config:K.z.record(K.z.string(),K.z.unknown()).optional()}),AS=K.z.object({server:K.z.string(),theme:K.z.string(),options:CS,apps:K.z.array(K.z.string()).optional(),external_apps:K.z.array(xS).optional(),customTranslations:K.z.array(yS).optional(),auth:bS.optional(),openIdConnect:wS.optional(),sentry:SS.optional(),scripts:K.z.array(kS).optional(),styles:K.z.array(TS).optional()}),fi=we.defineStore("avatars",()=>{const e=Ge(),t=W({}),n=du(new ur({concurrency:e.options.concurrentRequests.avatars}));return{avatarMap:t,getAvatar:u=>a(t)[u],addAvatar:(u,d)=>{t.value[u]=d},removeAvatar:u=>{t.value[u]=null},reset:()=>{t.value={}},avatarsQueue:n,pendingAvatarsRequests:new Map}}),tf={core:{"support-sse":!1},dav:{},files:{app_providers:[],favorites:!1,permanent_deletion:!0,tags:!1,privateLinks:!1,tus_support:{extension:"",http_method_override:!1,max_chunk_size:0}},files_sharing:{allow_custom:!0,api_enabled:!0,can_rename:!0,deny_access:!1,public:{alias:!1,can_contribute:!0,can_edit:!1,default_permissions:z.SharePermissionBit.Read,enabled:!0,password:{enforced_for:{read_only:!1,upload_only:!1,read_write:!1}}}},graph:{"personal-data-export":!1,users:{change_password_self_disabled:!0,create_disabled:!1,delete_disabled:!1,read_only_attributes:[],edit_login_allowed_disabled:!1}},notifications:{"ocs-endpoints":[]},password_policy:{},search:{property:{mediatype:{},mtime:{}}},spaces:{enabled:!1,max_quota:0,projects:!1}},Dt=we.defineStore("capabilities",()=>{const e=W(!1),t=W(tf),n=xe=>{t.value=Go({...tf},xe.capabilities),e.value=!0},r=A(()=>a(t).core["support-sse"]),o=A(()=>a(t).core["support-radicale"]),s=A(()=>a(t).graph["personal-data-export"]),i=A(()=>a(t).core.status),l=A(()=>a(t).dav.reports),u=A(()=>a(t).dav.trashbin),d=A(()=>a(t).spaces.max_quota),c=A(()=>a(t).spaces.projects),p=A(()=>a(t).graph.users.create_disabled),f=A(()=>a(t).graph.users.delete_disabled),h=A(()=>a(t).graph.users.change_password_self_disabled),g=A(()=>a(t).graph.users.read_only_attributes),m=A(()=>a(t).graph.users.edit_login_allowed_disabled),w=A(()=>a(t).files.app_providers),T=A(()=>a(t).files.favorites),k=A(()=>a(t).files.archivers),S=A(()=>a(t).files.privateLinks),y=A(()=>a(t).files.permanent_deletion),E=A(()=>a(t).files.tags),D=A(()=>a(t).files.undelete),$=A(()=>a(t).files_sharing.api_enabled),_=A(()=>a(t).files_sharing.can_rename),L=A(()=>a(t).files_sharing.allow_custom),V=A(()=>a(t).files_sharing.public?.enabled),te=A(()=>a(t).files_sharing.public?.can_edit),B=A(()=>a(t).files_sharing.public?.can_contribute),O=A(()=>a(t).files_sharing.public?.alias),M=A(()=>a(t).files_sharing.public?.default_permissions),N=A(()=>a(t).files_sharing.public?.password.enforced_for),q=A(()=>a(t).files_sharing.search_min_length),j=A(()=>a(t).files_sharing.user?.profile_picture),H=A(()=>a(t).files.tus_support?.max_chunk_size),se=A(()=>a(t).files.tus_support?.extension),Y=A(()=>a(t).files.tus_support?.http_method_override),ae=A(()=>a(t).notifications["ocs-endpoints"]),ne=A(()=>a(t).password_policy),pe=A(()=>a(t).search.property?.mtime),fe=A(()=>a(t).search.property?.mediatype),be=A(()=>a(t).search.property?.content);return{isInitialized:e,capabilities:t,setCapabilities:n,status:i,supportSSE:r,supportRadicale:o,personalDataExport:s,davReports:l,davTrashbin:u,spacesMaxQuota:d,spacesProjects:c,graphUsersCreateDisabled:p,graphUsersDeleteDisabled:f,graphUsersChangeSelfPasswordDisabled:h,graphUsersEditLoginAllowedDisabled:m,graphUsersReadOnlyAttributes:g,filesAppProviders:w,filesFavorites:T,filesArchivers:k,filesPrivateLinks:S,filesPermanentDeletion:y,filesTags:E,filesUndelete:D,sharingApiEnabled:$,sharingCanRename:_,sharingAllowCustom:L,sharingPublicEnabled:V,sharingPublicCanEdit:te,sharingPublicCanContribute:B,sharingPublicAlias:O,sharingPublicDefaultPermissions:M,sharingPublicPasswordEnforcedFor:N,sharingSearchMinLength:q,sharingUserProfilePicture:j,tusMaxChunkSize:H,tusExtension:se,tusHttpMethodOverride:Y,notificationsOcsEndpoints:ae,passwordPolicy:ne,searchLastMofifiedDate:pe,searchMediaType:fe,searchContent:be}});class ES{value;expires;constructor(t,n){this.value=t,this.expires=n?new Date().getTime()+n:0}get expired(){return this.expires>0&&this.expires<new Date().getTime()}}class nf{map;ttl;capacity;constructor(t){this.ttl=t.ttl||0,this.capacity=t.capacity||0,this.map=new Map}set(t,n,r){return this.evict(),this.map.set(t,new ES(n,isNaN(r)?this.ttl:r)),n}get(t){this.evict();const n=this.map.get(t);if(n)return n.value}delete(t){return this.map.delete(t)}clear(){return this.map.clear()}entries(){return this.evict(),[...this.map.entries()].map(t=>[t[0],t[1].value])}keys(){return this.evict(),[...this.map.keys()]}has(t){return this.evict(),this.map.has(t)}values(){return this.evict(),[...this.map.values()].map(t=>t.value)}evict(){if(this.map.forEach((t,n)=>{t.expired&&this.delete(n)}),!!this.capacity)for(const[t]of[...this.map.entries()]){if(this.map.size<=this.capacity)break;this.delete(t)}}}const pi=async({graphClient:e,spacesStore:t,space:n,signal:r})=>{const o=await t.getMountPointForSpace({graphClient:e,space:n,signal:r});if(!o)return null;const{id:s}=o;return e.driveItems.getDriveItem(s.split("!")[0],s)},RS=({sharedAncestor:e,matchingSpace:t})=>t?kn("files-spaces-generic",_n(t,{path:e.path,fileId:e.id})):{},rf=({sharesStore:e,spacesStore:t,space:n,sharedDriveItem:r})=>{const o=r?.remoteItem?.permissions||[];if(!o.length)return;const s=[];o.forEach(i=>{if(i["@libre.graph.permissions.actions"]){s.push(...i["@libre.graph.permissions.actions"]);return}const l=e.graphRoles[i.roles[0]];if(!l)return;const u=l.rolePermissions.flatMap(d=>d.allowedResourceActions);s.push(...u)}),t.updateSpaceField({id:n.id,field:"graphPermissions",value:[...new Set(s)]})},DS=e=>{const t=document.querySelectorAll(`[data-item-id="${e}"] input[type=checkbox]`)?.[0];t&&t.focus()},hi=(e,t)=>{t!==void 0&&document.querySelector(":root").style.setProperty("--oc-"+e,t)},PS="thead-clicked",IS="highlight",FS="rowMounted",$S="contextmenuClicked",of="itemDropped",OS="itemDragged";let LS="";const _S=()=>LS,MS=e=>({"gap-0":e==="none","gap-0.5":e==="xsmall","gap-1":e==="small","gap-2":e==="medium","gap-4":e==="large","gap-5":e==="xlarge","gap-6":e==="xxlarge","gap-7":e==="xxxlarge"}),NS=e=>({"justify-start":e==="left","justify-center":e==="center","justify-end":e==="right","justify-around":e==="space-around","justify-between":e==="space-between","justify-evenly":e==="space-evenly"}),BS=e=>({"p-0":e==="remove","p-1":e==="xsmall","p-2":e==="small","p-4":e==="medium","p-6":e==="large","p-12":e==="xlarge","p-24":e==="xxlarge"});var Xe=(e=>(e.Desc="desc",e.Asc="asc",e))(Xe||{});let sf=0;const _r=(e="")=>(e=e||"",sf+=1,e+sf),af=e=>e?[{name:"name",sortable:!0,sortDir:Xe.Asc},{name:"size",sortable:!0,sortDir:Xe.Desc},{name:"sharedWith",sortable:t=>t.length>0?t.sort((n,r)=>n.shareType!==r.shareType?n.shareType<r.shareType?-1:1:n.displayName<r.displayName?-1:1).map(n=>n.displayName).join():!1,sortDir:Xe.Asc},{name:"owner",sortable:"displayName",sortDir:Xe.Asc},{name:"mdate",sortable:t=>new Date(t).valueOf(),sortDir:Xe.Desc},{name:"sdate",sortable:t=>new Date(t).valueOf(),sortDir:Xe.Desc},{name:"ddate",sortable:t=>new Date(t).valueOf(),sortDir:Xe.Desc}].filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[];function IO(e){return e}const lf=[{label:"A-Z",name:"name",sortable:!0,sortDir:Xe.Asc},{label:"Z-A",name:"name",sortable:!0,sortDir:Xe.Desc},{label:"Newest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:Xe.Desc},{label:"Oldest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:Xe.Asc},{label:"Largest",name:"size",sortable:!0,sortDir:Xe.Desc},{label:"Smallest",name:"size",sortable:!0,sortDir:Xe.Asc},{label:"Remaining quota",name:"remainingQuota",prop:"spaceQuota.remaining",sortable:!0,sortDir:Xe.Desc},{label:"Total quota",name:"totalQuota",prop:"spaceQuota.total",sortable:!0,sortDir:Xe.Desc},{label:"Used quota",name:"usedQuota",prop:"spaceQuota.used",sortable:!0,sortDir:Xe.Desc}],jS=e=>e?lf.filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[],zS=(e,{$gettext:t})=>e.map(n=>({...n,label:t(n.label)})),US=K.z.object({icon:K.z.string(),name:K.z.string(),secure_view:K.z.boolean().optional().default(!1),target_ext:K.z.string().optional()}),VS=K.z.object({allow_creation:K.z.boolean().optional(),app_providers:K.z.array(US),default_application:K.z.string().optional(),description:K.z.string().optional(),ext:K.z.string().optional(),mime_type:K.z.string(),name:K.z.string().optional()}),cf=K.z.object({"mime-types":K.z.array(VS)});class qS{_mimeTypes=W([]);serverUrl;clientService;constructor(t,n){this.serverUrl=t,this.clientService=n}async loadData(){const t=z.urlJoin(this.serverUrl,"app","list"),{data:{"mime-types":n}}=await this.clientService.httpUnAuthenticated.get(t,{schema:cf});this._mimeTypes.value=n}set mimeTypes(t){this._mimeTypes.value=t}get mimeTypes(){return a(this._mimeTypes)}get templateMimeTypes(){return a(this._mimeTypes).filter(t=>!!t.app_providers.some(n=>!!n.target_ext))}get appNames(){return[...new Set(a(this._mimeTypes).flatMap(t=>t.app_providers.map(n=>n.name)))]}getMimeTypesByAppName(t){return a(this._mimeTypes).filter(n=>n.app_providers.some(r=>r.name===t))}}var uf={},mi={};mi.byteLength=QS,mi.toByteArray=GS,mi.fromByteArray=YS;for(var Nn=[],cn=[],HS=typeof Uint8Array<"u"?Uint8Array:Array,hl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",uo=0,WS=hl.length;uo<WS;++uo)Nn[uo]=hl[uo],cn[hl.charCodeAt(uo)]=uo;cn[45]=62,cn[95]=63;function df(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function QS(e){var t=df(e),n=t[0],r=t[1];return(n+r)*3/4-r}function KS(e,t,n){return(t+n)*3/4-n}function GS(e){var t,n=df(e),r=n[0],o=n[1],s=new HS(KS(e,r,o)),i=0,l=o>0?r-4:r,u;for(u=0;u<l;u+=4)t=cn[e.charCodeAt(u)]<<18|cn[e.charCodeAt(u+1)]<<12|cn[e.charCodeAt(u+2)]<<6|cn[e.charCodeAt(u+3)],s[i++]=t>>16&255,s[i++]=t>>8&255,s[i++]=t&255;return o===2&&(t=cn[e.charCodeAt(u)]<<2|cn[e.charCodeAt(u+1)]>>4,s[i++]=t&255),o===1&&(t=cn[e.charCodeAt(u)]<<10|cn[e.charCodeAt(u+1)]<<4|cn[e.charCodeAt(u+2)]>>2,s[i++]=t>>8&255,s[i++]=t&255),s}function JS(e){return Nn[e>>18&63]+Nn[e>>12&63]+Nn[e>>6&63]+Nn[e&63]}function XS(e,t,n){for(var r,o=[],s=t;s<n;s+=3)r=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),o.push(JS(r));return o.join("")}function YS(e){for(var t,n=e.length,r=n%3,o=[],s=16383,i=0,l=n-r;i<l;i+=s)o.push(XS(e,i,i+s>l?l:i+s));return r===1?(t=e[n-1],o.push(Nn[t>>2]+Nn[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(Nn[t>>10]+Nn[t>>4&63]+Nn[t<<2&63]+"=")),o.join("")}var ml={};ml.read=function(e,t,n,r,o){var s,i,l=o*8-r-1,u=(1<<l)-1,d=u>>1,c=-7,p=n?o-1:0,f=n?-1:1,h=e[t+p];for(p+=f,s=h&(1<<-c)-1,h>>=-c,c+=l;c>0;s=s*256+e[t+p],p+=f,c-=8);for(i=s&(1<<-c)-1,s>>=-c,c+=r;c>0;i=i*256+e[t+p],p+=f,c-=8);if(s===0)s=1-d;else{if(s===u)return i?NaN:(h?-1:1)*(1/0);i=i+Math.pow(2,r),s=s-d}return(h?-1:1)*i*Math.pow(2,s-r)},ml.write=function(e,t,n,r,o,s){var i,l,u,d=s*8-o-1,c=(1<<d)-1,p=c>>1,f=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:s-1,g=r?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,i=c):(i=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-i))<1&&(i--,u*=2),i+p>=1?t+=f/u:t+=f*Math.pow(2,1-p),t*u>=2&&(i++,u/=2),i+p>=c?(l=0,i=c):i+p>=1?(l=(t*u-1)*Math.pow(2,o),i=i+p):(l=t*Math.pow(2,p-1)*Math.pow(2,o),i=0));o>=8;e[n+h]=l&255,h+=g,l/=256,o-=8);for(i=i<<o|l,d+=o;d>0;e[n+h]=i&255,h+=g,i/=256,d-=8);e[n+h-g]|=m*128};(function(e){const t=mi,n=ml,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=E,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o;const{Uint8Array:s,ArrayBuffer:i,SharedArrayBuffer:l}=globalThis;c.TYPED_ARRAY_SUPPORT=u(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function u(){try{const C=new s(1),v={foo:function(){return 42}};return Object.setPrototypeOf(v,s.prototype),Object.setPrototypeOf(C,v),C.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function d(C){if(C>o)throw new RangeError('The value "'+C+'" is invalid for option "size"');const v=new s(C);return Object.setPrototypeOf(v,c.prototype),v}function c(C,v,b){if(typeof C=="number"){if(typeof v=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(C)}return p(C,v,b)}c.poolSize=8192;function p(C,v,b){if(typeof C=="string")return m(C,v);if(i.isView(C))return T(C);if(C==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof C);if(dt(C,i)||C&&dt(C.buffer,i)||typeof l<"u"&&(dt(C,l)||C&&dt(C.buffer,l)))return k(C,v,b);if(typeof C=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const F=C.valueOf&&C.valueOf();if(F!=null&&F!==C)return c.from(F,v,b);const P=S(C);if(P)return P;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof C[Symbol.toPrimitive]=="function")return c.from(C[Symbol.toPrimitive]("string"),v,b);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof C)}c.from=function(C,v,b){return p(C,v,b)},Object.setPrototypeOf(c.prototype,s.prototype),Object.setPrototypeOf(c,s);function f(C){if(typeof C!="number")throw new TypeError('"size" argument must be of type number');if(C<0)throw new RangeError('The value "'+C+'" is invalid for option "size"')}function h(C,v,b){return f(C),C<=0?d(C):v!==void 0?typeof b=="string"?d(C).fill(v,b):d(C).fill(v):d(C)}c.alloc=function(C,v,b){return h(C,v,b)};function g(C){return f(C),d(C<0?0:y(C)|0)}c.allocUnsafe=function(C){return g(C)},c.allocUnsafeSlow=function(C){return g(C)};function m(C,v){if((typeof v!="string"||v==="")&&(v="utf8"),!c.isEncoding(v))throw new TypeError("Unknown encoding: "+v);const b=D(C,v)|0;let F=d(b);const P=F.write(C,v);return P!==b&&(F=F.slice(0,P)),F}function w(C){const v=C.length<0?0:y(C.length)|0,b=d(v);for(let F=0;F<v;F+=1)b[F]=C[F]&255;return b}function T(C){if(dt(C,s)){const v=new s(C);return k(v.buffer,v.byteOffset,v.byteLength)}return w(C)}function k(C,v,b){if(v<0||C.byteLength<v)throw new RangeError('"offset" is outside of buffer bounds');if(C.byteLength<v+(b||0))throw new RangeError('"length" is outside of buffer bounds');let F;return v===void 0&&b===void 0?F=new s(C):b===void 0?F=new s(C,v):F=new s(C,v,b),Object.setPrototypeOf(F,c.prototype),F}function S(C){if(c.isBuffer(C)){const v=y(C.length)|0,b=d(v);return b.length===0||C.copy(b,0,0,v),b}if(C.length!==void 0)return typeof C.length!="number"||mn(C.length)?d(0):w(C);if(C.type==="Buffer"&&Array.isArray(C.data))return w(C.data)}function y(C){if(C>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return C|0}function E(C){return+C!=C&&(C=0),c.alloc(+C)}c.isBuffer=function(v){return v!=null&&v._isBuffer===!0&&v!==c.prototype},c.compare=function(v,b){if(dt(v,s)&&(v=c.from(v,v.offset,v.byteLength)),dt(b,s)&&(b=c.from(b,b.offset,b.byteLength)),!c.isBuffer(v)||!c.isBuffer(b))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(v===b)return 0;let F=v.length,P=b.length;for(let U=0,X=Math.min(F,P);U<X;++U)if(v[U]!==b[U]){F=v[U],P=b[U];break}return F<P?-1:P<F?1:0},c.isEncoding=function(v){switch(String(v).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(v,b){if(!Array.isArray(v))throw new TypeError('"list" argument must be an Array of Buffers');if(v.length===0)return c.alloc(0);let F;if(b===void 0)for(b=0,F=0;F<v.length;++F)b+=v[F].length;const P=c.allocUnsafe(b);let U=0;for(F=0;F<v.length;++F){let X=v[F];if(dt(X,s))U+X.length>P.length?(c.isBuffer(X)||(X=c.from(X)),X.copy(P,U)):s.prototype.set.call(P,X,U);else if(c.isBuffer(X))X.copy(P,U);else throw new TypeError('"list" argument must be an Array of Buffers');U+=X.length}return P};function D(C,v){if(c.isBuffer(C))return C.length;if(i.isView(C)||dt(C,i))return C.byteLength;if(typeof C!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof C);const b=C.length,F=arguments.length>2&&arguments[2]===!0;if(!F&&b===0)return 0;let P=!1;for(;;)switch(v){case"ascii":case"latin1":case"binary":return b;case"utf8":case"utf-8":return qe(C).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b*2;case"hex":return b>>>1;case"base64":return Xt(C).length;default:if(P)return F?-1:qe(C).length;v=(""+v).toLowerCase(),P=!0}}c.byteLength=D;function $(C,v,b){let F=!1;if((v===void 0||v<0)&&(v=0),v>this.length||((b===void 0||b>this.length)&&(b=this.length),b<=0)||(b>>>=0,v>>>=0,b<=v))return"";for(C||(C="utf8");;)switch(C){case"hex":return ne(this,v,b);case"utf8":case"utf-8":return j(this,v,b);case"ascii":return Y(this,v,b);case"latin1":case"binary":return ae(this,v,b);case"base64":return q(this,v,b);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,v,b);default:if(F)throw new TypeError("Unknown encoding: "+C);C=(C+"").toLowerCase(),F=!0}}c.prototype._isBuffer=!0;function _(C,v,b){const F=C[v];C[v]=C[b],C[b]=F}c.prototype.swap16=function(){const v=this.length;if(v%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let b=0;b<v;b+=2)_(this,b,b+1);return this},c.prototype.swap32=function(){const v=this.length;if(v%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let b=0;b<v;b+=4)_(this,b,b+3),_(this,b+1,b+2);return this},c.prototype.swap64=function(){const v=this.length;if(v%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let b=0;b<v;b+=8)_(this,b,b+7),_(this,b+1,b+6),_(this,b+2,b+5),_(this,b+3,b+4);return this},c.prototype.toString=function(){const v=this.length;return v===0?"":arguments.length===0?j(this,0,v):$.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(v){if(!c.isBuffer(v))throw new TypeError("Argument must be a Buffer");return this===v?!0:c.compare(this,v)===0},c.prototype.inspect=function(){let v="";const b=e.INSPECT_MAX_BYTES;return v=this.toString("hex",0,b).replace(/(.{2})/g,"$1 ").trim(),this.length>b&&(v+=" ... "),"<Buffer "+v+">"},r&&(c.prototype[r]=c.prototype.inspect),c.prototype.compare=function(v,b,F,P,U){if(dt(v,s)&&(v=c.from(v,v.offset,v.byteLength)),!c.isBuffer(v))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof v);if(b===void 0&&(b=0),F===void 0&&(F=v?v.length:0),P===void 0&&(P=0),U===void 0&&(U=this.length),b<0||F>v.length||P<0||U>this.length)throw new RangeError("out of range index");if(P>=U&&b>=F)return 0;if(P>=U)return-1;if(b>=F)return 1;if(b>>>=0,F>>>=0,P>>>=0,U>>>=0,this===v)return 0;let X=U-P,ee=F-b;const ye=Math.min(X,ee),Ie=this.slice(P,U),Fe=v.slice(b,F);for(let Ne=0;Ne<ye;++Ne)if(Ie[Ne]!==Fe[Ne]){X=Ie[Ne],ee=Fe[Ne];break}return X<ee?-1:ee<X?1:0};function L(C,v,b,F,P){if(C.length===0)return-1;if(typeof b=="string"?(F=b,b=0):b>2147483647?b=2147483647:b<-2147483648&&(b=-2147483648),b=+b,mn(b)&&(b=P?0:C.length-1),b<0&&(b=C.length+b),b>=C.length){if(P)return-1;b=C.length-1}else if(b<0)if(P)b=0;else return-1;if(typeof v=="string"&&(v=c.from(v,F)),c.isBuffer(v))return v.length===0?-1:V(C,v,b,F,P);if(typeof v=="number")return v=v&255,typeof s.prototype.indexOf=="function"?P?s.prototype.indexOf.call(C,v,b):s.prototype.lastIndexOf.call(C,v,b):V(C,[v],b,F,P);throw new TypeError("val must be string, number or Buffer")}function V(C,v,b,F,P){let U=1,X=C.length,ee=v.length;if(F!==void 0&&(F=String(F).toLowerCase(),F==="ucs2"||F==="ucs-2"||F==="utf16le"||F==="utf-16le")){if(C.length<2||v.length<2)return-1;U=2,X/=2,ee/=2,b/=2}function ye(Fe,Ne){return U===1?Fe[Ne]:Fe.readUInt16BE(Ne*U)}let Ie;if(P){let Fe=-1;for(Ie=b;Ie<X;Ie++)if(ye(C,Ie)===ye(v,Fe===-1?0:Ie-Fe)){if(Fe===-1&&(Fe=Ie),Ie-Fe+1===ee)return Fe*U}else Fe!==-1&&(Ie-=Ie-Fe),Fe=-1}else for(b+ee>X&&(b=X-ee),Ie=b;Ie>=0;Ie--){let Fe=!0;for(let Ne=0;Ne<ee;Ne++)if(ye(C,Ie+Ne)!==ye(v,Ne)){Fe=!1;break}if(Fe)return Ie}return-1}c.prototype.includes=function(v,b,F){return this.indexOf(v,b,F)!==-1},c.prototype.indexOf=function(v,b,F){return L(this,v,b,F,!0)},c.prototype.lastIndexOf=function(v,b,F){return L(this,v,b,F,!1)};function te(C,v,b,F){b=Number(b)||0;const P=C.length-b;F?(F=Number(F),F>P&&(F=P)):F=P;const U=v.length;F>U/2&&(F=U/2);let X;for(X=0;X<F;++X){const ee=parseInt(v.substr(X*2,2),16);if(mn(ee))return X;C[b+X]=ee}return X}function B(C,v,b,F){return kt(qe(v,C.length-b),C,b,F)}function O(C,v,b,F){return kt(We(v),C,b,F)}function M(C,v,b,F){return kt(Xt(v),C,b,F)}function N(C,v,b,F){return kt(Jt(v,C.length-b),C,b,F)}c.prototype.write=function(v,b,F,P){if(b===void 0)P="utf8",F=this.length,b=0;else if(F===void 0&&typeof b=="string")P=b,F=this.length,b=0;else if(isFinite(b))b=b>>>0,isFinite(F)?(F=F>>>0,P===void 0&&(P="utf8")):(P=F,F=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const U=this.length-b;if((F===void 0||F>U)&&(F=U),v.length>0&&(F<0||b<0)||b>this.length)throw new RangeError("Attempt to write outside buffer bounds");P||(P="utf8");let X=!1;for(;;)switch(P){case"hex":return te(this,v,b,F);case"utf8":case"utf-8":return B(this,v,b,F);case"ascii":case"latin1":case"binary":return O(this,v,b,F);case"base64":return M(this,v,b,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,v,b,F);default:if(X)throw new TypeError("Unknown encoding: "+P);P=(""+P).toLowerCase(),X=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function q(C,v,b){return v===0&&b===C.length?t.fromByteArray(C):t.fromByteArray(C.slice(v,b))}function j(C,v,b){b=Math.min(C.length,b);const F=[];let P=v;for(;P<b;){const U=C[P];let X=null,ee=U>239?4:U>223?3:U>191?2:1;if(P+ee<=b){let ye,Ie,Fe,Ne;switch(ee){case 1:U<128&&(X=U);break;case 2:ye=C[P+1],(ye&192)===128&&(Ne=(U&31)<<6|ye&63,Ne>127&&(X=Ne));break;case 3:ye=C[P+1],Ie=C[P+2],(ye&192)===128&&(Ie&192)===128&&(Ne=(U&15)<<12|(ye&63)<<6|Ie&63,Ne>2047&&(Ne<55296||Ne>57343)&&(X=Ne));break;case 4:ye=C[P+1],Ie=C[P+2],Fe=C[P+3],(ye&192)===128&&(Ie&192)===128&&(Fe&192)===128&&(Ne=(U&15)<<18|(ye&63)<<12|(Ie&63)<<6|Fe&63,Ne>65535&&Ne<1114112&&(X=Ne))}}X===null?(X=65533,ee=1):X>65535&&(X-=65536,F.push(X>>>10&1023|55296),X=56320|X&1023),F.push(X),P+=ee}return se(F)}const H=4096;function se(C){const v=C.length;if(v<=H)return String.fromCharCode.apply(String,C);let b="",F=0;for(;F<v;)b+=String.fromCharCode.apply(String,C.slice(F,F+=H));return b}function Y(C,v,b){let F="";b=Math.min(C.length,b);for(let P=v;P<b;++P)F+=String.fromCharCode(C[P]&127);return F}function ae(C,v,b){let F="";b=Math.min(C.length,b);for(let P=v;P<b;++P)F+=String.fromCharCode(C[P]);return F}function ne(C,v,b){const F=C.length;(!v||v<0)&&(v=0),(!b||b<0||b>F)&&(b=F);let P="";for(let U=v;U<b;++U)P+=qn[C[U]];return P}function pe(C,v,b){const F=C.slice(v,b);let P="";for(let U=0;U<F.length-1;U+=2)P+=String.fromCharCode(F[U]+F[U+1]*256);return P}c.prototype.slice=function(v,b){const F=this.length;v=~~v,b=b===void 0?F:~~b,v<0?(v+=F,v<0&&(v=0)):v>F&&(v=F),b<0?(b+=F,b<0&&(b=0)):b>F&&(b=F),b<v&&(b=v);const P=this.subarray(v,b);return Object.setPrototypeOf(P,c.prototype),P};function fe(C,v,b){if(C%1!==0||C<0)throw new RangeError("offset is not uint");if(C+v>b)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(v,b,F){v=v>>>0,b=b>>>0,F||fe(v,b,this.length);let P=this[v],U=1,X=0;for(;++X<b&&(U*=256);)P+=this[v+X]*U;return P},c.prototype.readUintBE=c.prototype.readUIntBE=function(v,b,F){v=v>>>0,b=b>>>0,F||fe(v,b,this.length);let P=this[v+--b],U=1;for(;b>0&&(U*=256);)P+=this[v+--b]*U;return P},c.prototype.readUint8=c.prototype.readUInt8=function(v,b){return v=v>>>0,b||fe(v,1,this.length),this[v]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(v,b){return v=v>>>0,b||fe(v,2,this.length),this[v]|this[v+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(v,b){return v=v>>>0,b||fe(v,2,this.length),this[v]<<8|this[v+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(v,b){return v=v>>>0,b||fe(v,4,this.length),(this[v]|this[v+1]<<8|this[v+2]<<16)+this[v+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(v,b){return v=v>>>0,b||fe(v,4,this.length),this[v]*16777216+(this[v+1]<<16|this[v+2]<<8|this[v+3])},c.prototype.readBigUInt64LE=At(function(v){v=v>>>0,ut(v,"offset");const b=this[v],F=this[v+7];(b===void 0||F===void 0)&&gt(v,this.length-8);const P=b+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24,U=this[++v]+this[++v]*2**8+this[++v]*2**16+F*2**24;return BigInt(P)+(BigInt(U)<<BigInt(32))}),c.prototype.readBigUInt64BE=At(function(v){v=v>>>0,ut(v,"offset");const b=this[v],F=this[v+7];(b===void 0||F===void 0)&&gt(v,this.length-8);const P=b*2**24+this[++v]*2**16+this[++v]*2**8+this[++v],U=this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+F;return(BigInt(P)<<BigInt(32))+BigInt(U)}),c.prototype.readIntLE=function(v,b,F){v=v>>>0,b=b>>>0,F||fe(v,b,this.length);let P=this[v],U=1,X=0;for(;++X<b&&(U*=256);)P+=this[v+X]*U;return U*=128,P>=U&&(P-=Math.pow(2,8*b)),P},c.prototype.readIntBE=function(v,b,F){v=v>>>0,b=b>>>0,F||fe(v,b,this.length);let P=b,U=1,X=this[v+--P];for(;P>0&&(U*=256);)X+=this[v+--P]*U;return U*=128,X>=U&&(X-=Math.pow(2,8*b)),X},c.prototype.readInt8=function(v,b){return v=v>>>0,b||fe(v,1,this.length),this[v]&128?(255-this[v]+1)*-1:this[v]},c.prototype.readInt16LE=function(v,b){v=v>>>0,b||fe(v,2,this.length);const F=this[v]|this[v+1]<<8;return F&32768?F|4294901760:F},c.prototype.readInt16BE=function(v,b){v=v>>>0,b||fe(v,2,this.length);const F=this[v+1]|this[v]<<8;return F&32768?F|4294901760:F},c.prototype.readInt32LE=function(v,b){return v=v>>>0,b||fe(v,4,this.length),this[v]|this[v+1]<<8|this[v+2]<<16|this[v+3]<<24},c.prototype.readInt32BE=function(v,b){return v=v>>>0,b||fe(v,4,this.length),this[v]<<24|this[v+1]<<16|this[v+2]<<8|this[v+3]},c.prototype.readBigInt64LE=At(function(v){v=v>>>0,ut(v,"offset");const b=this[v],F=this[v+7];(b===void 0||F===void 0)&&gt(v,this.length-8);const P=this[v+4]+this[v+5]*2**8+this[v+6]*2**16+(F<<24);return(BigInt(P)<<BigInt(32))+BigInt(b+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24)}),c.prototype.readBigInt64BE=At(function(v){v=v>>>0,ut(v,"offset");const b=this[v],F=this[v+7];(b===void 0||F===void 0)&&gt(v,this.length-8);const P=(b<<24)+this[++v]*2**16+this[++v]*2**8+this[++v];return(BigInt(P)<<BigInt(32))+BigInt(this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+F)}),c.prototype.readFloatLE=function(v,b){return v=v>>>0,b||fe(v,4,this.length),n.read(this,v,!0,23,4)},c.prototype.readFloatBE=function(v,b){return v=v>>>0,b||fe(v,4,this.length),n.read(this,v,!1,23,4)},c.prototype.readDoubleLE=function(v,b){return v=v>>>0,b||fe(v,8,this.length),n.read(this,v,!0,52,8)},c.prototype.readDoubleBE=function(v,b){return v=v>>>0,b||fe(v,8,this.length),n.read(this,v,!1,52,8)};function be(C,v,b,F,P,U){if(!c.isBuffer(C))throw new TypeError('"buffer" argument must be a Buffer instance');if(v>P||v<U)throw new RangeError('"value" argument is out of bounds');if(b+F>C.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(v,b,F,P){if(v=+v,b=b>>>0,F=F>>>0,!P){const ee=Math.pow(2,8*F)-1;be(this,v,b,F,ee,0)}let U=1,X=0;for(this[b]=v&255;++X<F&&(U*=256);)this[b+X]=v/U&255;return b+F},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(v,b,F,P){if(v=+v,b=b>>>0,F=F>>>0,!P){const ee=Math.pow(2,8*F)-1;be(this,v,b,F,ee,0)}let U=F-1,X=1;for(this[b+U]=v&255;--U>=0&&(X*=256);)this[b+U]=v/X&255;return b+F},c.prototype.writeUint8=c.prototype.writeUInt8=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,1,255,0),this[b]=v&255,b+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,2,65535,0),this[b]=v&255,this[b+1]=v>>>8,b+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,2,65535,0),this[b]=v>>>8,this[b+1]=v&255,b+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,4,4294967295,0),this[b+3]=v>>>24,this[b+2]=v>>>16,this[b+1]=v>>>8,this[b]=v&255,b+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,4,4294967295,0),this[b]=v>>>24,this[b+1]=v>>>16,this[b+2]=v>>>8,this[b+3]=v&255,b+4};function xe(C,v,b,F,P){Tt(v,F,P,C,b,7);let U=Number(v&BigInt(4294967295));C[b++]=U,U=U>>8,C[b++]=U,U=U>>8,C[b++]=U,U=U>>8,C[b++]=U;let X=Number(v>>BigInt(32)&BigInt(4294967295));return C[b++]=X,X=X>>8,C[b++]=X,X=X>>8,C[b++]=X,X=X>>8,C[b++]=X,b}function he(C,v,b,F,P){Tt(v,F,P,C,b,7);let U=Number(v&BigInt(4294967295));C[b+7]=U,U=U>>8,C[b+6]=U,U=U>>8,C[b+5]=U,U=U>>8,C[b+4]=U;let X=Number(v>>BigInt(32)&BigInt(4294967295));return C[b+3]=X,X=X>>8,C[b+2]=X,X=X>>8,C[b+1]=X,X=X>>8,C[b]=X,b+8}c.prototype.writeBigUInt64LE=At(function(v,b=0){return xe(this,v,b,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=At(function(v,b=0){return he(this,v,b,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(v,b,F,P){if(v=+v,b=b>>>0,!P){const ye=Math.pow(2,8*F-1);be(this,v,b,F,ye-1,-ye)}let U=0,X=1,ee=0;for(this[b]=v&255;++U<F&&(X*=256);)v<0&&ee===0&&this[b+U-1]!==0&&(ee=1),this[b+U]=(v/X>>0)-ee&255;return b+F},c.prototype.writeIntBE=function(v,b,F,P){if(v=+v,b=b>>>0,!P){const ye=Math.pow(2,8*F-1);be(this,v,b,F,ye-1,-ye)}let U=F-1,X=1,ee=0;for(this[b+U]=v&255;--U>=0&&(X*=256);)v<0&&ee===0&&this[b+U+1]!==0&&(ee=1),this[b+U]=(v/X>>0)-ee&255;return b+F},c.prototype.writeInt8=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,1,127,-128),v<0&&(v=255+v+1),this[b]=v&255,b+1},c.prototype.writeInt16LE=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,2,32767,-32768),this[b]=v&255,this[b+1]=v>>>8,b+2},c.prototype.writeInt16BE=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,2,32767,-32768),this[b]=v>>>8,this[b+1]=v&255,b+2},c.prototype.writeInt32LE=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,4,2147483647,-2147483648),this[b]=v&255,this[b+1]=v>>>8,this[b+2]=v>>>16,this[b+3]=v>>>24,b+4},c.prototype.writeInt32BE=function(v,b,F){return v=+v,b=b>>>0,F||be(this,v,b,4,2147483647,-2147483648),v<0&&(v=4294967295+v+1),this[b]=v>>>24,this[b+1]=v>>>16,this[b+2]=v>>>8,this[b+3]=v&255,b+4},c.prototype.writeBigInt64LE=At(function(v,b=0){return xe(this,v,b,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=At(function(v,b=0){return he(this,v,b,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ie(C,v,b,F,P,U){if(b+F>C.length)throw new RangeError("Index out of range");if(b<0)throw new RangeError("Index out of range")}function de(C,v,b,F,P){return v=+v,b=b>>>0,P||ie(C,v,b,4),n.write(C,v,b,F,23,4),b+4}c.prototype.writeFloatLE=function(v,b,F){return de(this,v,b,!0,F)},c.prototype.writeFloatBE=function(v,b,F){return de(this,v,b,!1,F)};function ue(C,v,b,F,P){return v=+v,b=b>>>0,P||ie(C,v,b,8),n.write(C,v,b,F,52,8),b+8}c.prototype.writeDoubleLE=function(v,b,F){return ue(this,v,b,!0,F)},c.prototype.writeDoubleBE=function(v,b,F){return ue(this,v,b,!1,F)},c.prototype.copy=function(v,b,F,P){if(!c.isBuffer(v))throw new TypeError("argument should be a Buffer");if(F||(F=0),!P&&P!==0&&(P=this.length),b>=v.length&&(b=v.length),b||(b=0),P>0&&P<F&&(P=F),P===F||v.length===0||this.length===0)return 0;if(b<0)throw new RangeError("targetStart out of bounds");if(F<0||F>=this.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("sourceEnd out of bounds");P>this.length&&(P=this.length),v.length-b<P-F&&(P=v.length-b+F);const U=P-F;return this===v&&typeof s.prototype.copyWithin=="function"?this.copyWithin(b,F,P):s.prototype.set.call(v,this.subarray(F,P),b),U},c.prototype.fill=function(v,b,F,P){if(typeof v=="string"){if(typeof b=="string"?(P=b,b=0,F=this.length):typeof F=="string"&&(P=F,F=this.length),P!==void 0&&typeof P!="string")throw new TypeError("encoding must be a string");if(typeof P=="string"&&!c.isEncoding(P))throw new TypeError("Unknown encoding: "+P);if(v.length===1){const X=v.charCodeAt(0);(P==="utf8"&&X<128||P==="latin1")&&(v=X)}}else typeof v=="number"?v=v&255:typeof v=="boolean"&&(v=Number(v));if(b<0||this.length<b||this.length<F)throw new RangeError("Out of range index");if(F<=b)return this;b=b>>>0,F=F===void 0?this.length:F>>>0,v||(v=0);let U;if(typeof v=="number")for(U=b;U<F;++U)this[U]=v;else{const X=c.isBuffer(v)?v:c.from(v,P),ee=X.length;if(ee===0)throw new TypeError('The value "'+v+'" is invalid for argument "value"');for(U=0;U<F-b;++U)this[U+b]=X[U%ee]}return this};const Se={};function $e(C,v,b){Se[C]=class extends b{constructor(){super(),Object.defineProperty(this,"message",{value:v.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${C}]`,this.stack,delete this.name}get code(){return C}set code(P){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:P,writable:!0})}toString(){return`${this.name} [${C}]: ${this.message}`}}}$e("ERR_BUFFER_OUT_OF_BOUNDS",function(C){return C?`${C} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),$e("ERR_INVALID_ARG_TYPE",function(C,v){return`The "${C}" argument must be of type number. Received type ${typeof v}`},TypeError),$e("ERR_OUT_OF_RANGE",function(C,v,b){let F=`The value of "${C}" is out of range.`,P=b;return Number.isInteger(b)&&Math.abs(b)>2**32?P=Ve(String(b)):typeof b=="bigint"&&(P=String(b),(b>BigInt(2)**BigInt(32)||b<-(BigInt(2)**BigInt(32)))&&(P=Ve(P)),P+="n"),F+=` It must be ${v}. Received ${P}`,F},RangeError);function Ve(C){let v="",b=C.length;const F=C[0]==="-"?1:0;for(;b>=F+4;b-=3)v=`_${C.slice(b-3,b)}${v}`;return`${C.slice(0,b)}${v}`}function lt(C,v,b){ut(v,"offset"),(C[v]===void 0||C[v+b]===void 0)&&gt(v,C.length-(b+1))}function Tt(C,v,b,F,P,U){if(C>b||C<v){const X=typeof v=="bigint"?"n":"";let ee;throw v===0||v===BigInt(0)?ee=`>= 0${X} and < 2${X} ** ${(U+1)*8}${X}`:ee=`>= -(2${X} ** ${(U+1)*8-1}${X}) and < 2 ** ${(U+1)*8-1}${X}`,new Se.ERR_OUT_OF_RANGE("value",ee,C)}lt(F,P,U)}function ut(C,v){if(typeof C!="number")throw new Se.ERR_INVALID_ARG_TYPE(v,"number",C)}function gt(C,v,b){throw Math.floor(C)!==C?(ut(C,b),new Se.ERR_OUT_OF_RANGE("offset","an integer",C)):v<0?new Se.ERR_BUFFER_OUT_OF_BOUNDS:new Se.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${v}`,C)}const ve=/[^+/0-9A-Za-z-_]/g;function ke(C){if(C=C.split("=")[0],C=C.trim().replace(ve,""),C.length<2)return"";for(;C.length%4!==0;)C=C+"=";return C}function qe(C,v){v=v||1/0;let b;const F=C.length;let P=null;const U=[];for(let X=0;X<F;++X){if(b=C.charCodeAt(X),b>55295&&b<57344){if(!P){if(b>56319){(v-=3)>-1&&U.push(239,191,189);continue}else if(X+1===F){(v-=3)>-1&&U.push(239,191,189);continue}P=b;continue}if(b<56320){(v-=3)>-1&&U.push(239,191,189),P=b;continue}b=(P-55296<<10|b-56320)+65536}else P&&(v-=3)>-1&&U.push(239,191,189);if(P=null,b<128){if((v-=1)<0)break;U.push(b)}else if(b<2048){if((v-=2)<0)break;U.push(b>>6|192,b&63|128)}else if(b<65536){if((v-=3)<0)break;U.push(b>>12|224,b>>6&63|128,b&63|128)}else if(b<1114112){if((v-=4)<0)break;U.push(b>>18|240,b>>12&63|128,b>>6&63|128,b&63|128)}else throw new Error("Invalid code point")}return U}function We(C){const v=[];for(let b=0;b<C.length;++b)v.push(C.charCodeAt(b)&255);return v}function Jt(C,v){let b,F,P;const U=[];for(let X=0;X<C.length&&!((v-=2)<0);++X)b=C.charCodeAt(X),F=b>>8,P=b%256,U.push(P),U.push(F);return U}function Xt(C){return t.toByteArray(ke(C))}function kt(C,v,b,F){let P;for(P=0;P<F&&!(P+b>=v.length||P>=C.length);++P)v[P+b]=C[P];return P}function dt(C,v){return C instanceof v||C!=null&&C.constructor!=null&&C.constructor.name!=null&&C.constructor.name===v.name}function mn(C){return C!==C}const qn=(function(){const C="0123456789abcdef",v=new Array(256);for(let b=0;b<16;++b){const F=b*16;for(let P=0;P<16;++P)v[F+P]=C[b]+C[P]}return v})();function At(C){return typeof BigInt>"u"?En:C}function En(){throw new Error("BigInt not supported")}})(uf);const gi=uf.Buffer;class fo extends Error{name="RuntimeError";constructor(t,...n){super([t,...n].filter(Boolean).join(", ")),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class ZS extends fo{name="ApiError"}const gl=(e,t="")=>{const n=document.createElement("a");n.style.display="none",document.body.appendChild(n),n.href=e,n.setAttribute("download",t),n.click(),document.body.removeChild(n)},vl=(e="")=>e.split("/").map(encodeURIComponent).join("/"),e0=e=>{const t=[],n=(r,o="")=>Object.keys(r).forEach(s=>{tl(r[s])?n(r[s],`${o}${s}.`):t.push(`${o}${s}`)});return n(e),t},yl=e=>{const t=e.startsWith("v")?e.slice(1):e,[n,r]=t.split("-"),[o,s,i]=n.split(".").map(Number);return{major:o,minor:s,patch:i,pre:r}},bl=(e,t)=>{const n=yl(e),r=yl(t);return n.major!==r.major?n.major-r.major:n.minor!==r.minor?n.minor-r.minor:n.patch!==r.patch?n.patch-r.patch:n.pre&&!r.pre?-1:!n.pre&&r.pre?1:n.pre&&r.pre?n.pre.localeCompare(r.pre):0};class t0{clientService;userStore;serverUrl;capability;available;constructor(t,n,r,o=W([])){this.clientService=t,this.userStore=n,this.serverUrl=r,this.capability=A(()=>{const s=a(o).filter(i=>i.enabled).sort((i,l)=>bl(l.version,i.version));return s.length?s[0]:null}),this.available=A(()=>!!a(this.capability)?.version)}async triggerDownload(t){if(!a(this.available))throw new fo("no archiver available");if((t.fileIds?.length||0)+(t.files?.length||0)===0)throw new fo("requested archive with empty list of resources");const n=this.buildDownloadUrl({...t});if(!n)throw new fo("download url could not be built");let r=t.publicToken?n:await this.clientService.ocs.signUrl(n,this.userStore.user?.onPremisesSamAccountName),o;if(t.publicLinkPassword)try{const s=await fetch(r,{headers:{...this.clientService.getRequestHeaders({useAuth:!1}),Authorization:"Basic "+gi.from(["public",t.publicLinkPassword].join(":")).toString("base64")}});if(!s.ok)throw new z.HttpError("",s);const i=await s.blob();r=URL.createObjectURL(i),o=decodeURI(s.headers.get("content-disposition")?.split('"')[1])}catch{throw new Error("archive could not be fetched")}return gl(r,o),r}buildDownloadUrl(t){const n=[];return t.publicToken&&n.push(`public-token=${t.publicToken}`),n.push(...t.fileIds.map(r=>`id=${r}`)),this.url+"?"+n.join("&")}get url(){if(!this.available)throw new fo("no archiver available");const t=a(this.capability);return/^https?:\/\//i.test(t.archiver_url)?t.archiver_url:z.urlJoin(this.serverUrl,t.archiver_url)}}const n0=new nf({ttl:10*1e3,capacity:250});class r0{get filePreview(){return n0}}const wl=new r0;class Sl{accessToken;publicLinkToken;publicLinkPassword;constructor(t={}){this.accessToken=t.accessToken,this.publicLinkToken=t.publicLinkToken,this.publicLinkPassword=t.publicLinkPassword}getHeaders(){return{...this.publicLinkToken&&{"public-token":this.publicLinkToken},...this.publicLinkPassword&&{Authorization:"Basic "+gi.from(["public",this.publicLinkPassword].join(":")).toString("base64")},...this.accessToken&&!this.publicLinkPassword&&!this.publicLinkToken&&{Authorization:"Bearer "+this.accessToken}}}}class Tl{instance;cancelToken;constructor(t,n){this.cancelToken=Es.CancelToken.source(),this.instance=Es.create(t),n&&this.instance.interceptors.request.use(n)}cancel(t){this.cancelToken.cancel(t)}async delete(t,n,r){return await this.internalRequestWithData("delete",t,n,r)}get(t,n){return this.internalRequest("get",t,n)}head(t,n){return this.internalRequest("head",t,n)}options(t,n){return this.internalRequest("options",t,n)}patch(t,n,r){return this.internalRequestWithData("patch",t,n,r)}post(t,n,r){return this.internalRequestWithData("post",t,n,r)}put(t,n,r){return this.internalRequestWithData("put",t,n,r)}async request(t){const n=await this.instance.request(this.obtainConfig(t));return this.processResponse(n,t)}obtainConfig(t){return Go({cancelToken:this.cancelToken.token},t)}processResponse(t,n){if(n?.schema){const r=n.schema.parse(t.data);return{...t,data:r}}return t}async internalRequest(t,n,r){const o=await this.instance[t](n,this.obtainConfig(r));return this.processResponse(o,r)}async internalRequestWithData(t,n,r,o){const s=await this.instance[t](n,r,this.obtainConfig(o));return this.processResponse(s,o)}}class o0 extends Error{name="RetriableError"}const s0=15e3;class i0{url;fetchOptions;abortController;eventListenerMap;readyState;withCredentials;CONNECTING;OPEN;CLOSED;onerror;onmessage;onopen;constructor(t,n){this.url=t,this.fetchOptions=n,this.abortController=new AbortController,this.eventListenerMap={},this.readyState=this.CONNECTING,this.connect()}connect(){return Ig.fetchEventSource(this.url,{openWhenHidden:!0,signal:this.abortController.signal,fetch:this.fetchProvider.bind(this),onopen:async()=>{const t=new Event("open");this.onopen?.bind(this)(t),this.readyState=this.OPEN},onmessage:t=>{const n=new MessageEvent("message",{data:t.data});this.onmessage?.bind(this)(n);const r=t.event;this.eventListenerMap[r]?.forEach(s=>s(n))},onclose:()=>{throw this.readyState=this.CLOSED,new o0},onerror:t=>{console.error(t);const n=new CustomEvent("error",{detail:t});return this.onerror?.bind(this)(n),3e4+Math.floor(Math.random()*s0)}})}fetchProvider(...t){const[n,r]=t,o={...r,...this.fetchOptions};return window.fetch(n,o)}close(){this.abortController.abort("closed")}addEventListener(t,n){this.eventListenerMap[t]=this.eventListenerMap[t]||[],this.eventListenerMap[t].push(n)}removeEventListener(t,n){this.eventListenerMap[t]=this.eventListenerMap[t]?.filter(r=>r!==n)}dispatchEvent(){throw new Error("Method not implemented.")}updateAccessToken(t){this.fetchOptions.headers.Authorization=`Bearer ${t}`}updateLanguage(t){this.fetchOptions.headers["Accept-Language"]=t,this.close(),this.connect()}}let kl=null;const a0=(e,t)=>(kl||(kl=new i0(new URL("ocs/v2.php/apps/notifications/api/v1/notifications/sse",e).href,t)),kl),l0=(e,t)=>({headers:{Authorization:`Bearer ${e.accessToken}`,"Accept-Language":t,"X-Request-ID":Ct.v4(),"X-Requested-With":"XMLHttpRequest"}});class c0{configStore;language;authStore;httpAuthenticatedClient;httpUnAuthenticatedClient;graphClient;ocsClient;webDavClient;initiatorId=Ct.v4();staticHeaders={"Initiator-ID":this.initiatorId,"X-Requested-With":"XMLHttpRequest"};constructor(t){this.configStore=t.configStore,this.language=t.language,this.authStore=t.authStore,this.initGraphClient(),this.initOcsClient(),this.initWebDavClient(),this.httpAuthenticatedClient=new Tl({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.httpUnAuthenticatedClient=new Tl({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},n=>(Object.assign(n.headers,this.getDynamicHeaders({useAuth:!1})),n))}get httpAuthenticated(){return this.httpAuthenticatedClient}get httpUnAuthenticated(){return this.httpUnAuthenticatedClient}get graphAuthenticated(){return this.graphClient}get sseAuthenticated(){return a0(this.configStore.serverUrl,l0({accessToken:this.authStore.accessToken},this.currentLanguage))}get ocs(){return this.ocsClient}get webdav(){return this.webDavClient}get currentLanguage(){return this.language.current}getRequestHeaders=({useAuth:t=!0}={})=>({...this.staticHeaders,...this.getDynamicHeaders({useAuth:t})});initGraphClient(){const t=Es.create({headers:this.staticHeaders});t.interceptors.request.use(n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.graphClient=z.graph(this.configStore.serverUrl,t)}initOcsClient(){const t=Es.create({headers:this.staticHeaders});t.interceptors.request.use(n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.ocsClient=z.ocs(this.configStore.serverUrl,t)}initWebDavClient(){this.webDavClient=z.webdav(this.configStore.serverUrl,()=>{const t={...this.staticHeaders,...this.getDynamicHeaders()};return this.authStore.publicLinkToken&&(t["public-token"]=this.authStore.publicLinkToken),this.authStore.publicLinkPassword&&(t.Authorization="Basic "+gi.from(["public",this.authStore.publicLinkPassword].join(":")).toString("base64")),t})}getDynamicHeaders({useAuth:t=!0}={}){return{"Accept-Language":this.currentLanguage,"X-Request-ID":Ct.v4(),...t&&{Authorization:"Bearer "+this.authStore.accessToken}}}}class ff{topics;constructor(){this.topics=new Map}subscribe(t,n){const r={token:Ct.v4(),callback:n},o=[r,...this.topics.get(t)||[]];return this.topics.set(t,o),r.token}publish(t,n){(this.topics.get(t)||[]).forEach(o=>o.callback(n))}unsubscribe(t,n){this.topics.has(t)&&this.topics.set(t,this.topics.get(t).filter(r=>r.token!==n))}}const ze=new ff;class pf{static Shared="S";static Shareable="R";static Mounted="M";static Deletable="D";static Renameable="N";static Moveable="V";static Updateable="NV";static FileUpdateable="W";static FolderCreateable="CK";static Deny="Z";static SecureView="X"}const vi=e=>({value:e,type:null}),u0=e=>vi(e),Ze=e=>vi(e),yi=e=>vi(e),d0=e=>vi(e),f0={Permissions:Ze("permissions"),IsFavorite:yi("favorite"),FileId:Ze("fileid"),FileParent:Ze("file-parent"),Name:Ze("name"),OwnerId:Ze("owner-id"),OwnerDisplayName:Ze("owner-display-name"),PrivateLink:Ze("privatelink"),ContentLength:yi("getcontentlength"),ContentSize:yi("size"),LastModifiedDate:Ze("getlastmodified"),Tags:u0("tags"),Audio:{value:"audio",type:null},Location:{value:"location",type:null},Image:{value:"image",type:null},Photo:{value:"photo",type:null},ETag:Ze("getetag"),MimeType:Ze("getcontenttype"),ResourceType:d0("resourcetype"),LockDiscovery:{value:"lockdiscovery",type:null},LockOwner:Ze("owner"),LockTime:Ze("locktime"),ActiveLock:{value:"activelock",type:null},DownloadURL:Ze("downloadURL"),Highlights:Ze("highlights"),MetaPathForUser:Ze("meta-path-for-user"),RemoteItemId:Ze("remote-item-id"),HasPreview:yi("has-preview"),ShareId:Ze("shareid"),ShareRoot:Ze("shareroot"),ShareTypes:{value:"share-types",type:null},SharePermissions:Ze("share-permissions"),TrashbinOriginalFilename:Ze("trashbin-original-filename"),TrashbinOriginalLocation:Ze("trashbin-original-location"),TrashbinDeletedDate:Ze("trashbin-delete-datetime"),PublicLinkItemType:Ze("public-link-item-type"),PublicLinkPermission:Ze("public-link-permission"),PublicLinkExpiration:Ze("public-link-expiration"),PublicLinkShareDate:Ze("public-link-share-datetime"),PublicLinkShareOwner:Ze("public-link-share-owner")},Ee=Object.fromEntries(Object.entries(f0).map(([e,t])=>[e,t.value]));class Jo{static Default=[Ee.Permissions,Ee.IsFavorite,Ee.FileId,Ee.FileParent,Ee.Name,Ee.LockDiscovery,Ee.ActiveLock,Ee.OwnerId,Ee.OwnerDisplayName,Ee.RemoteItemId,Ee.ShareRoot,Ee.ShareTypes,Ee.PrivateLink,Ee.ContentLength,Ee.ContentSize,Ee.LastModifiedDate,Ee.ETag,Ee.MimeType,Ee.ResourceType,Ee.Tags,Ee.Audio,Ee.Location,Ee.Image,Ee.Photo,Ee.HasPreview];static PublicLink=Jo.Default.concat([Ee.PublicLinkItemType,Ee.PublicLinkPermission,Ee.PublicLinkExpiration,Ee.PublicLinkShareDate,Ee.PublicLinkShareOwner]);static Trashbin=[Ee.ContentLength,Ee.ResourceType,Ee.TrashbinOriginalLocation,Ee.TrashbinOriginalFilename,Ee.TrashbinDeletedDate,Ee.Permissions,Ee.FileParent];static DavNamespace=[Ee.ContentLength,Ee.LastModifiedDate,Ee.ETag,Ee.MimeType,Ee.ResourceType,Ee.LockDiscovery,Ee.ActiveLock]}var p0="[object Symbol]";function bi(e){return typeof e=="symbol"||Ln(e)&&Ir(e)==p0}var h0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,m0=/^\w*$/;function g0(e,t){if(Tn(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||bi(e)?!0:m0.test(e)||!h0.test(e)||t!=null&&e in Object(t)}var v0="Expected a function";function Cl(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(v0);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],s=n.cache;if(s.has(o))return s.get(o);var i=e.apply(this,r);return n.cache=s.set(o,i)||s,i};return n.cache=new(Cl.Cache||Zn),n}Cl.Cache=Zn;var y0=500;function b0(e){var t=Cl(e,function(r){return n.size===y0&&n.clear(),r}),n=t.cache;return t}var w0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,S0=/\\(\\)?/g,T0=b0(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(w0,function(n,r,o,s){t.push(o?s.replace(S0,"$1"):r||n)}),t});function hf(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var mf=sn?sn.prototype:void 0,gf=mf?mf.toString:void 0;function vf(e){if(typeof e=="string")return e;if(Tn(e))return hf(e,vf)+"";if(bi(e))return gf?gf.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function xl(e){return e==null?"":vf(e)}function Al(e,t){return Tn(e)?e:g0(e,t)?[e]:T0(xl(e))}function yf(e){if(typeof e=="string"||bi(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function bf(e,t){t=Al(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[yf(t[n++])];return n&&n==r?e:void 0}function El(e,t,n){var r=e==null?void 0:bf(e,t);return r===void 0?n:r}var k0={2:e=>{function t(o,s,i){o instanceof RegExp&&(o=n(o,i)),s instanceof RegExp&&(s=n(s,i));var l=r(o,s,i);return l&&{start:l[0],end:l[1],pre:i.slice(0,l[0]),body:i.slice(l[0]+o.length,l[1]),post:i.slice(l[1]+s.length)}}function n(o,s){var i=s.match(o);return i?i[0]:null}function r(o,s,i){var l,u,d,c,p,f=i.indexOf(o),h=i.indexOf(s,f+1),g=f;if(f>=0&&h>0){for(l=[],d=i.length;g>=0&&!p;)g==f?(l.push(g),f=i.indexOf(o,g+1)):l.length==1?p=[l.pop(),h]:((u=l.pop())<d&&(d=u,c=h),h=i.indexOf(s,g+1)),g=f<h&&f>=0?f:h;l.length&&(p=[d,c])}return p}e.exports=t,t.range=r},47:(e,t,n)=>{var r=n(410),o=function(d){return typeof d=="string"};function s(d,c){for(var p=[],f=0;f<d.length;f++){var h=d[f];h&&h!=="."&&(h===".."?p.length&&p[p.length-1]!==".."?p.pop():c&&p.push(".."):p.push(h))}return p}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,l={};function u(d){return i.exec(d).slice(1)}l.resolve=function(){for(var d="",c=!1,p=arguments.length-1;p>=-1&&!c;p--){var f=p>=0?arguments[p]:ce.cwd();if(!o(f))throw new TypeError("Arguments to path.resolve must be strings");f&&(d=f+"/"+d,c=f.charAt(0)==="/")}return(c?"/":"")+(d=s(d.split("/"),!c).join("/"))||"."},l.normalize=function(d){var c=l.isAbsolute(d),p=d.substr(-1)==="/";return(d=s(d.split("/"),!c).join("/"))||c||(d="."),d&&p&&(d+="/"),(c?"/":"")+d},l.isAbsolute=function(d){return d.charAt(0)==="/"},l.join=function(){for(var d="",c=0;c<arguments.length;c++){var p=arguments[c];if(!o(p))throw new TypeError("Arguments to path.join must be strings");p&&(d+=d?"/"+p:p)}return l.normalize(d)},l.relative=function(d,c){function p(k){for(var S=0;S<k.length&&k[S]==="";S++);for(var y=k.length-1;y>=0&&k[y]==="";y--);return S>y?[]:k.slice(S,y+1)}d=l.resolve(d).substr(1),c=l.resolve(c).substr(1);for(var f=p(d.split("/")),h=p(c.split("/")),g=Math.min(f.length,h.length),m=g,w=0;w<g;w++)if(f[w]!==h[w]){m=w;break}var T=[];for(w=m;w<f.length;w++)T.push("..");return(T=T.concat(h.slice(m))).join("/")},l._makeLong=function(d){return d},l.dirname=function(d){var c=u(d),p=c[0],f=c[1];return p||f?(f&&(f=f.substr(0,f.length-1)),p+f):"."},l.basename=function(d,c){var p=u(d)[2];return c&&p.substr(-1*c.length)===c&&(p=p.substr(0,p.length-c.length)),p},l.extname=function(d){return u(d)[3]},l.format=function(d){if(!r.isObject(d))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof d);var c=d.root||"";if(!o(c))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof d.root);return(d.dir?d.dir+l.sep:"")+(d.base||"")},l.parse=function(d){if(!o(d))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof d);var c=u(d);if(!c||c.length!==4)throw new TypeError("Invalid path '"+d+"'");return c[1]=c[1]||"",c[2]=c[2]||"",c[3]=c[3]||"",{root:c[0],dir:c[0]+c[1].slice(0,c[1].length-1),base:c[2],ext:c[3],name:c[2].slice(0,c[2].length-c[3].length)}},l.sep="/",l.delimiter=":",e.exports=l},101:function(e,t,n){var r;e=n.nmd(e),(function(){var o=(e&&e.exports,typeof br=="object"&&br);o.global!==o&&o.window;var s=function(c){this.message=c};(s.prototype=new Error).name="InvalidCharacterError";var i=function(c){throw new s(c)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,d={encode:function(c){c=String(c),/[^\0-\xFF]/.test(c)&&i("The string to be encoded contains characters outside of the Latin1 range.");for(var p,f,h,g,m=c.length%3,w="",T=-1,k=c.length-m;++T<k;)p=c.charCodeAt(T)<<16,f=c.charCodeAt(++T)<<8,h=c.charCodeAt(++T),w+=l.charAt((g=p+f+h)>>18&63)+l.charAt(g>>12&63)+l.charAt(g>>6&63)+l.charAt(63&g);return m==2?(p=c.charCodeAt(T)<<8,f=c.charCodeAt(++T),w+=l.charAt((g=p+f)>>10)+l.charAt(g>>4&63)+l.charAt(g<<2&63)+"="):m==1&&(g=c.charCodeAt(T),w+=l.charAt(g>>2)+l.charAt(g<<4&63)+"=="),w},decode:function(c){var p=(c=String(c).replace(u,"")).length;p%4==0&&(p=(c=c.replace(/==?$/,"")).length),(p%4==1||/[^+a-zA-Z0-9/]/.test(c))&&i("Invalid character: the string to be decoded is not correctly encoded.");for(var f,h,g=0,m="",w=-1;++w<p;)h=l.indexOf(c.charAt(w)),f=g%4?64*f+h:h,g++%4&&(m+=String.fromCharCode(255&f>>(-2*g&6)));return m},version:"1.0.0"};(r=(function(){return d}).call(t,n,t,e))===void 0||(e.exports=r)})()},135:e=>{function t(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}e.exports=function(n){return n!=null&&(t(n)||(function(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&t(r.slice(0,0))})(n)||!!n._isBuffer)}},172:(e,t)=>{t.d=function(n){if(!n)return 0;for(var r=(n=n.toString()).length,o=n.length;o--;){var s=n.charCodeAt(o);56320<=s&&s<=57343&&o--,127<s&&s<=2047?r++:2047<s&&s<=65535&&(r+=2)}return r}},285:(e,t,n)=>{var r=n(2);e.exports=function(T){return T?(T.substr(0,2)==="{}"&&(T="\\{\\}"+T.substr(2)),w((function(k){return k.split("\\\\").join(o).split("\\{").join(s).split("\\}").join(i).split("\\,").join(l).split("\\.").join(u)})(T),!0).map(c)):[]};var o="\0SLASH"+Math.random()+"\0",s="\0OPEN"+Math.random()+"\0",i="\0CLOSE"+Math.random()+"\0",l="\0COMMA"+Math.random()+"\0",u="\0PERIOD"+Math.random()+"\0";function d(T){return parseInt(T,10)==T?parseInt(T,10):T.charCodeAt(0)}function c(T){return T.split(o).join("\\").split(s).join("{").split(i).join("}").split(l).join(",").split(u).join(".")}function p(T){if(!T)return[""];var k=[],S=r("{","}",T);if(!S)return T.split(",");var y=S.pre,E=S.body,D=S.post,$=y.split(",");$[$.length-1]+="{"+E+"}";var _=p(D);return D.length&&($[$.length-1]+=_.shift(),$.push.apply($,_)),k.push.apply(k,$),k}function f(T){return"{"+T+"}"}function h(T){return/^-?0\d/.test(T)}function g(T,k){return T<=k}function m(T,k){return T>=k}function w(T,k){var S=[],y=r("{","}",T);if(!y)return[T];var E=y.pre,D=y.post.length?w(y.post,!1):[""];if(/\$$/.test(y.pre))for(var $=0;$<D.length;$++){var _=E+"{"+y.body+"}"+D[$];S.push(_)}else{var L,V,te=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(y.body),B=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(y.body),O=te||B,M=y.body.indexOf(",")>=0;if(!O&&!M)return y.post.match(/,(?!,).*\}/)?w(T=y.pre+"{"+y.body+i+y.post):[T];if(O)L=y.body.split(/\.\./);else if((L=p(y.body)).length===1&&(L=w(L[0],!1).map(f)).length===1)return D.map((function(xe){return y.pre+L[0]+xe}));if(O){var N=d(L[0]),q=d(L[1]),j=Math.max(L[0].length,L[1].length),H=L.length==3?Math.abs(d(L[2])):1,se=g;q<N&&(H*=-1,se=m);var Y=L.some(h);V=[];for(var ae=N;se(ae,q);ae+=H){var ne;if(B)(ne=String.fromCharCode(ae))==="\\"&&(ne="");else if(ne=String(ae),Y){var pe=j-ne.length;if(pe>0){var fe=new Array(pe+1).join("0");ne=ae<0?"-"+fe+ne.slice(1):fe+ne}}V.push(ne)}}else{V=[];for(var be=0;be<L.length;be++)V.push.apply(V,w(L[be],!1))}for(be=0;be<V.length;be++)for($=0;$<D.length;$++)_=E+V[be]+D[$],(!k||O||_)&&S.push(_)}return S}},298:e=>{var t,n;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(r,o){return r<<o|r>>>32-o},rotr:function(r,o){return r<<32-o|r>>>o},endian:function(r){if(r.constructor==Number)return 16711935&n.rotl(r,8)|4278255360&n.rotl(r,24);for(var o=0;o<r.length;o++)r[o]=n.endian(r[o]);return r},randomBytes:function(r){for(var o=[];r>0;r--)o.push(Math.floor(256*Math.random()));return o},bytesToWords:function(r){for(var o=[],s=0,i=0;s<r.length;s++,i+=8)o[i>>>5]|=r[s]<<24-i%32;return o},wordsToBytes:function(r){for(var o=[],s=0;s<32*r.length;s+=8)o.push(r[s>>>5]>>>24-s%32&255);return o},bytesToHex:function(r){for(var o=[],s=0;s<r.length;s++)o.push((r[s]>>>4).toString(16)),o.push((15&r[s]).toString(16));return o.join("")},hexToBytes:function(r){for(var o=[],s=0;s<r.length;s+=2)o.push(parseInt(r.substr(s,2),16));return o},bytesToBase64:function(r){for(var o=[],s=0;s<r.length;s+=3)for(var i=r[s]<<16|r[s+1]<<8|r[s+2],l=0;l<4;l++)8*s+6*l<=8*r.length?o.push(t.charAt(i>>>6*(3-l)&63)):o.push("=");return o.join("")},base64ToBytes:function(r){r=r.replace(/[^A-Z0-9+\/]/gi,"");for(var o=[],s=0,i=0;s<r.length;i=++s%4)i!=0&&o.push((t.indexOf(r.charAt(s-1))&Math.pow(2,-2*i+8)-1)<<2*i|t.indexOf(r.charAt(s))>>>6-2*i);return o}},e.exports=n},345:()=>{},388:()=>{},410:()=>{},526:e=>{var t={utf8:{stringToBytes:function(n){return t.bin.stringToBytes(unescape(encodeURIComponent(n)))},bytesToString:function(n){return decodeURIComponent(escape(t.bin.bytesToString(n)))}},bin:{stringToBytes:function(n){for(var r=[],o=0;o<n.length;o++)r.push(255&n.charCodeAt(o));return r},bytesToString:function(n){for(var r=[],o=0;o<n.length;o++)r.push(String.fromCharCode(n[o]));return r.join("")}}};e.exports=t},542:(e,t,n)=>{(function(){var r=n(298),o=n(526).utf8,s=n(135),i=n(526).bin,l=function(u,d){u.constructor==String?u=d&&d.encoding==="binary"?i.stringToBytes(u):o.stringToBytes(u):s(u)?u=Array.prototype.slice.call(u,0):Array.isArray(u)||u.constructor===Uint8Array||(u=u.toString());for(var c=r.bytesToWords(u),p=8*u.length,f=1732584193,h=-271733879,g=-1732584194,m=271733878,w=0;w<c.length;w++)c[w]=16711935&(c[w]<<8|c[w]>>>24)|4278255360&(c[w]<<24|c[w]>>>8);c[p>>>5]|=128<<p%32,c[14+(p+64>>>9<<4)]=p;var T=l._ff,k=l._gg,S=l._hh,y=l._ii;for(w=0;w<c.length;w+=16){var E=f,D=h,$=g,_=m;f=T(f,h,g,m,c[w+0],7,-680876936),m=T(m,f,h,g,c[w+1],12,-389564586),g=T(g,m,f,h,c[w+2],17,606105819),h=T(h,g,m,f,c[w+3],22,-1044525330),f=T(f,h,g,m,c[w+4],7,-176418897),m=T(m,f,h,g,c[w+5],12,1200080426),g=T(g,m,f,h,c[w+6],17,-1473231341),h=T(h,g,m,f,c[w+7],22,-45705983),f=T(f,h,g,m,c[w+8],7,1770035416),m=T(m,f,h,g,c[w+9],12,-1958414417),g=T(g,m,f,h,c[w+10],17,-42063),h=T(h,g,m,f,c[w+11],22,-1990404162),f=T(f,h,g,m,c[w+12],7,1804603682),m=T(m,f,h,g,c[w+13],12,-40341101),g=T(g,m,f,h,c[w+14],17,-1502002290),f=k(f,h=T(h,g,m,f,c[w+15],22,1236535329),g,m,c[w+1],5,-165796510),m=k(m,f,h,g,c[w+6],9,-1069501632),g=k(g,m,f,h,c[w+11],14,643717713),h=k(h,g,m,f,c[w+0],20,-373897302),f=k(f,h,g,m,c[w+5],5,-701558691),m=k(m,f,h,g,c[w+10],9,38016083),g=k(g,m,f,h,c[w+15],14,-660478335),h=k(h,g,m,f,c[w+4],20,-405537848),f=k(f,h,g,m,c[w+9],5,568446438),m=k(m,f,h,g,c[w+14],9,-1019803690),g=k(g,m,f,h,c[w+3],14,-187363961),h=k(h,g,m,f,c[w+8],20,1163531501),f=k(f,h,g,m,c[w+13],5,-1444681467),m=k(m,f,h,g,c[w+2],9,-51403784),g=k(g,m,f,h,c[w+7],14,1735328473),f=S(f,h=k(h,g,m,f,c[w+12],20,-1926607734),g,m,c[w+5],4,-378558),m=S(m,f,h,g,c[w+8],11,-2022574463),g=S(g,m,f,h,c[w+11],16,1839030562),h=S(h,g,m,f,c[w+14],23,-35309556),f=S(f,h,g,m,c[w+1],4,-1530992060),m=S(m,f,h,g,c[w+4],11,1272893353),g=S(g,m,f,h,c[w+7],16,-155497632),h=S(h,g,m,f,c[w+10],23,-1094730640),f=S(f,h,g,m,c[w+13],4,681279174),m=S(m,f,h,g,c[w+0],11,-358537222),g=S(g,m,f,h,c[w+3],16,-722521979),h=S(h,g,m,f,c[w+6],23,76029189),f=S(f,h,g,m,c[w+9],4,-640364487),m=S(m,f,h,g,c[w+12],11,-421815835),g=S(g,m,f,h,c[w+15],16,530742520),f=y(f,h=S(h,g,m,f,c[w+2],23,-995338651),g,m,c[w+0],6,-198630844),m=y(m,f,h,g,c[w+7],10,1126891415),g=y(g,m,f,h,c[w+14],15,-1416354905),h=y(h,g,m,f,c[w+5],21,-57434055),f=y(f,h,g,m,c[w+12],6,1700485571),m=y(m,f,h,g,c[w+3],10,-1894986606),g=y(g,m,f,h,c[w+10],15,-1051523),h=y(h,g,m,f,c[w+1],21,-2054922799),f=y(f,h,g,m,c[w+8],6,1873313359),m=y(m,f,h,g,c[w+15],10,-30611744),g=y(g,m,f,h,c[w+6],15,-1560198380),h=y(h,g,m,f,c[w+13],21,1309151649),f=y(f,h,g,m,c[w+4],6,-145523070),m=y(m,f,h,g,c[w+11],10,-1120210379),g=y(g,m,f,h,c[w+2],15,718787259),h=y(h,g,m,f,c[w+9],21,-343485551),f=f+E>>>0,h=h+D>>>0,g=g+$>>>0,m=m+_>>>0}return r.endian([f,h,g,m])};l._ff=function(u,d,c,p,f,h,g){var m=u+(d&c|~d&p)+(f>>>0)+g;return(m<<h|m>>>32-h)+d},l._gg=function(u,d,c,p,f,h,g){var m=u+(d&p|c&~p)+(f>>>0)+g;return(m<<h|m>>>32-h)+d},l._hh=function(u,d,c,p,f,h,g){var m=u+(d^c^p)+(f>>>0)+g;return(m<<h|m>>>32-h)+d},l._ii=function(u,d,c,p,f,h,g){var m=u+(c^(d|~p))+(f>>>0)+g;return(m<<h|m>>>32-h)+d},l._blocksize=16,l._digestsize=16,e.exports=function(u,d){if(u==null)throw new Error("Illegal argument "+u);var c=r.wordsToBytes(l(u,d));return d&&d.asBytes?c:d&&d.asString?i.bytesToString(c):r.bytesToHex(c)}})()},647:(e,t)=>{var n=Object.prototype.hasOwnProperty;function r(s){try{return decodeURIComponent(s.replace(/\+/g," "))}catch{return null}}function o(s){try{return encodeURIComponent(s)}catch{return null}}t.stringify=function(s,i){i=i||"";var l,u,d=[];for(u in typeof i!="string"&&(i="?"),s)if(n.call(s,u)){if((l=s[u])||l!=null&&!isNaN(l)||(l=""),u=o(u),l=o(l),u===null||l===null)continue;d.push(u+"="+l)}return d.length?i+d.join("&"):""},t.parse=function(s){for(var i,l=/([^=?#&]+)=?([^&]*)/g,u={};i=l.exec(s);){var d=r(i[1]),c=r(i[2]);d===null||c===null||d in u||(u[d]=c)}return u}},670:e=>{e.exports=function(t,n){if(n=n.split(":")[0],!(t=+t))return!1;switch(n){case"http":case"ws":return t!==80;case"https":case"wss":return t!==443;case"ftp":return t!==21;case"gopher":return t!==70;case"file":return!1}return t!==0}},737:(e,t,n)=>{var r=n(670),o=n(647),s=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i=/[\n\r\t]/g,l=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,u=/:\d+$/,d=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,c=/^[a-zA-Z]:/;function p(k){return(k||"").toString().replace(s,"")}var f=[["#","hash"],["?","query"],function(k,S){return m(S.protocol)?k.replace(/\\/g,"/"):k},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],h={hash:1,query:1};function g(k){var S,y=(typeof window<"u"?window:typeof br<"u"?br:typeof self<"u"?self:{}).location||{},E={},D=typeof(k=k||y);if(k.protocol==="blob:")E=new T(unescape(k.pathname),{});else if(D==="string")for(S in E=new T(k,{}),h)delete E[S];else if(D==="object"){for(S in k)S in h||(E[S]=k[S]);E.slashes===void 0&&(E.slashes=l.test(k.href))}return E}function m(k){return k==="file:"||k==="ftp:"||k==="http:"||k==="https:"||k==="ws:"||k==="wss:"}function w(k,S){k=(k=p(k)).replace(i,""),S=S||{};var y,E=d.exec(k),D=E[1]?E[1].toLowerCase():"",$=!!E[2],_=!!E[3],L=0;return $?_?(y=E[2]+E[3]+E[4],L=E[2].length+E[3].length):(y=E[2]+E[4],L=E[2].length):_?(y=E[3]+E[4],L=E[3].length):y=E[4],D==="file:"?L>=2&&(y=y.slice(2)):m(D)?y=E[4]:D?$&&(y=y.slice(2)):L>=2&&m(S.protocol)&&(y=E[4]),{protocol:D,slashes:$||m(D),slashesCount:L,rest:y}}function T(k,S,y){if(k=(k=p(k)).replace(i,""),!(this instanceof T))return new T(k,S,y);var E,D,$,_,L,V,te=f.slice(),B=typeof S,O=this,M=0;for(B!=="object"&&B!=="string"&&(y=S,S=null),y&&typeof y!="function"&&(y=o.parse),E=!(D=w(k||"",S=g(S))).protocol&&!D.slashes,O.slashes=D.slashes||E&&S.slashes,O.protocol=D.protocol||S.protocol||"",k=D.rest,(D.protocol==="file:"&&(D.slashesCount!==2||c.test(k))||!D.slashes&&(D.protocol||D.slashesCount<2||!m(O.protocol)))&&(te[3]=[/(.*)/,"pathname"]);M<te.length;M++)typeof(_=te[M])!="function"?($=_[0],V=_[1],$!=$?O[V]=k:typeof $=="string"?~(L=$==="@"?k.lastIndexOf($):k.indexOf($))&&(typeof _[2]=="number"?(O[V]=k.slice(0,L),k=k.slice(L+_[2])):(O[V]=k.slice(L),k=k.slice(0,L))):(L=$.exec(k))&&(O[V]=L[1],k=k.slice(0,L.index)),O[V]=O[V]||E&&_[3]&&S[V]||"",_[4]&&(O[V]=O[V].toLowerCase())):k=_(k,O);y&&(O.query=y(O.query)),E&&S.slashes&&O.pathname.charAt(0)!=="/"&&(O.pathname!==""||S.pathname!=="")&&(O.pathname=(function(N,q){if(N==="")return q;for(var j=(q||"/").split("/").slice(0,-1).concat(N.split("/")),H=j.length,se=j[H-1],Y=!1,ae=0;H--;)j[H]==="."?j.splice(H,1):j[H]===".."?(j.splice(H,1),ae++):ae&&(H===0&&(Y=!0),j.splice(H,1),ae--);return Y&&j.unshift(""),se!=="."&&se!==".."||j.push(""),j.join("/")})(O.pathname,S.pathname)),O.pathname.charAt(0)!=="/"&&m(O.protocol)&&(O.pathname="/"+O.pathname),r(O.port,O.protocol)||(O.host=O.hostname,O.port=""),O.username=O.password="",O.auth&&(~(L=O.auth.indexOf(":"))?(O.username=O.auth.slice(0,L),O.username=encodeURIComponent(decodeURIComponent(O.username)),O.password=O.auth.slice(L+1),O.password=encodeURIComponent(decodeURIComponent(O.password))):O.username=encodeURIComponent(decodeURIComponent(O.auth)),O.auth=O.password?O.username+":"+O.password:O.username),O.origin=O.protocol!=="file:"&&m(O.protocol)&&O.host?O.protocol+"//"+O.host:"null",O.href=O.toString()}T.prototype={set:function(k,S,y){var E=this;switch(k){case"query":typeof S=="string"&&S.length&&(S=(y||o.parse)(S)),E[k]=S;break;case"port":E[k]=S,r(S,E.protocol)?S&&(E.host=E.hostname+":"+S):(E.host=E.hostname,E[k]="");break;case"hostname":E[k]=S,E.port&&(S+=":"+E.port),E.host=S;break;case"host":E[k]=S,u.test(S)?(S=S.split(":"),E.port=S.pop(),E.hostname=S.join(":")):(E.hostname=S,E.port="");break;case"protocol":E.protocol=S.toLowerCase(),E.slashes=!y;break;case"pathname":case"hash":if(S){var D=k==="pathname"?"/":"#";E[k]=S.charAt(0)!==D?D+S:S}else E[k]=S;break;case"username":case"password":E[k]=encodeURIComponent(S);break;case"auth":var $=S.indexOf(":");~$?(E.username=S.slice(0,$),E.username=encodeURIComponent(decodeURIComponent(E.username)),E.password=S.slice($+1),E.password=encodeURIComponent(decodeURIComponent(E.password))):E.username=encodeURIComponent(decodeURIComponent(S))}for(var _=0;_<f.length;_++){var L=f[_];L[4]&&(E[L[1]]=E[L[1]].toLowerCase())}return E.auth=E.password?E.username+":"+E.password:E.username,E.origin=E.protocol!=="file:"&&m(E.protocol)&&E.host?E.protocol+"//"+E.host:"null",E.href=E.toString(),E},toString:function(k){k&&typeof k=="function"||(k=o.stringify);var S,y=this,E=y.host,D=y.protocol;D&&D.charAt(D.length-1)!==":"&&(D+=":");var $=D+(y.protocol&&y.slashes||m(y.protocol)?"//":"");return y.username?($+=y.username,y.password&&($+=":"+y.password),$+="@"):y.password?($+=":"+y.password,$+="@"):y.protocol!=="file:"&&m(y.protocol)&&!E&&y.pathname!=="/"&&($+="@"),(E[E.length-1]===":"||u.test(y.hostname)&&!y.port)&&(E+=":"),$+=E+y.pathname,(S=typeof y.query=="object"?k(y.query):y.query)&&($+=S.charAt(0)!=="?"?"?"+S:S),y.hash&&($+=y.hash),$}},T.extractProtocol=w,T.location=g,T.trimLeft=p,T.qs=o,e.exports=T},800:()=>{},805:()=>{},829:e=>{function t(d){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},t(d)}function n(d){var c=typeof Map=="function"?new Map:void 0;return n=function(p){if(p===null||(f=p,Function.toString.call(f).indexOf("[native code]")===-1))return p;var f;if(typeof p!="function")throw new TypeError("Super expression must either be null or a function");if(c!==void 0){if(c.has(p))return c.get(p);c.set(p,h)}function h(){return r(p,arguments,s(this).constructor)}return h.prototype=Object.create(p.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),o(h,p)},n(d)}function r(d,c,p){return r=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch{return!1}})()?Reflect.construct:function(f,h,g){var m=[null];m.push.apply(m,h);var w=new(Function.bind.apply(f,m));return g&&o(w,g.prototype),w},r.apply(null,arguments)}function o(d,c){return o=Object.setPrototypeOf||function(p,f){return p.__proto__=f,p},o(d,c)}function s(d){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(c){return c.__proto__||Object.getPrototypeOf(c)},s(d)}var i=(function(d){function c(p){var f;return(function(h,g){if(!(h instanceof g))throw new TypeError("Cannot call a class as a function")})(this,c),(f=(function(h,g){return!g||t(g)!=="object"&&typeof g!="function"?(function(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m})(h):g})(this,s(c).call(this,p))).name="ObjectPrototypeMutationError",f}return(function(p,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(f&&f.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),f&&o(p,f)})(c,d),c})(n(Error));function l(d,c){for(var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},f=c.split("."),h=f.length,g=function(T){var k=f[T];if(!d)return{v:void 0};if(k==="+"){if(Array.isArray(d))return{v:d.map((function(y,E){var D=f.slice(T+1);return D.length>0?l(y,D.join("."),p):p(d,E,f,T)}))};var S=f.slice(0,T).join(".");throw new Error("Object at wildcard (".concat(S,") is not an array"))}d=p(d,k,f,T)},m=0;m<h;m++){var w=g(m);if(t(w)==="object")return w.v}return d}function u(d,c){return d.length===c+1}e.exports={set:function(d,c,p){if(t(d)!="object"||d===null||c===void 0)return d;if(typeof c=="number")return d[c]=p,d[c];try{return l(d,c,(function(f,h,g,m){if(f===Reflect.getPrototypeOf({}))throw new i("Attempting to mutate Object.prototype");if(!f[h]){var w=Number.isInteger(Number(g[m+1])),T=g[m+1]==="+";f[h]=w||T?[]:{}}return u(g,m)&&(f[h]=p),f[h]}))}catch(f){if(f instanceof i)throw f;return d}},get:function(d,c){if(t(d)!="object"||d===null||c===void 0)return d;if(typeof c=="number")return d[c];try{return l(d,c,(function(p,f){return p[f]}))}catch{return d}},has:function(d,c){var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(t(d)!="object"||d===null||c===void 0)return!1;if(typeof c=="number")return c in d;try{var f=!1;return l(d,c,(function(h,g,m,w){if(!u(m,w))return h&&h[g];f=p.own?h.hasOwnProperty(g):g in h})),f}catch{return!1}},hasOwn:function(d,c,p){return this.has(d,c,p||{own:!0})},isIn:function(d,c,p){var f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(t(d)!="object"||d===null||c===void 0)return!1;try{var h=!1,g=!1;return l(d,c,(function(m,w,T,k){return h=h||m===p||!!m&&m[w]===p,g=u(T,k)&&t(m)==="object"&&w in m,m&&m[w]})),f.validPath?h&&g:h}catch{return!1}},ObjectPrototypeMutationError:i}}},wf={};function it(e){var t=wf[e];if(t!==void 0)return t.exports;var n=wf[e]={id:e,loaded:!1,exports:{}};return k0[e].call(n.exports,n,n.exports,it),n.loaded=!0,n.exports}it.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return it.d(t,{a:t}),t},it.d=(e,t)=>{for(var n in t)it.o(t,n)&&!it.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},it.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),it.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var C0=it(737);it.n(C0);var x0=it(47);it.n(x0);var A0=it(542);it.n(A0);var E0=it(101);it.n(E0);const Sf=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis;Sf.fetch.bind(Sf),(function(e){return e.Auto="auto",e.Digest="digest",e.None="none",e.Password="password",e.Token="token",e})({}),(function(e){return e.DataTypeNoLength="data-type-no-length",e.InvalidAuthType="invalid-auth-type",e.InvalidOutputFormat="invalid-output-format",e.LinkUnsupportedAuthType="link-unsupported-auth",e.InvalidUpdateRange="invalid-update-range",e.NotSupported="not-supported",e})({}),it(345),it(800),it(805);var R0=it(285);const wi=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},D0={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Xo=e=>e.replace(/[[\]\\-]/g,"\\$&"),Tf=e=>e.join(""),P0=(e,t)=>{const n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");const r=[],o=[];let s=n+1,i=!1,l=!1,u=!1,d=!1,c=n,p="";e:for(;s<e.length;){const m=e.charAt(s);if(m!=="!"&&m!=="^"||s!==n+1){if(m==="]"&&i&&!u){c=s+1;break}if(i=!0,m!=="\\"||u){if(m==="["&&!u){for(const[w,[T,k,S]]of Object.entries(D0))if(e.startsWith(w,s)){if(p)return["$.",!1,e.length-n,!0];s+=w.length,S?o.push(T):r.push(T),l=l||k;continue e}}u=!1,p?(m>p?r.push(Xo(p)+"-"+Xo(m)):m===p&&r.push(Xo(m)),p="",s++):e.startsWith("-]",s+1)?(r.push(Xo(m+"-")),s+=2):e.startsWith("-",s+1)?(p=m,s+=2):(r.push(Xo(m)),s++)}else u=!0,s++}else d=!0,s++}if(c<s)return["",!1,0,!1];if(!r.length&&!o.length)return["$.",!1,e.length-n,!0];if(o.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!d)return[(f=r[0].length===2?r[0].slice(-1):r[0],f.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,c-n,!1];var f;const h="["+(d?"^":"")+Tf(r)+"]",g="["+(d?"":"^")+Tf(o)+"]";return[r.length&&o.length?"("+h+"|"+g+")":r.length?h:g,l,c-n,!0]},Yo=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")},I0=new Set(["!","?","+","*","@"]),kf=e=>I0.has(e),Rl="(?!\\.)",F0=new Set(["[","."]),$0=new Set(["..","."]),O0=new Set("().*{}+?[]^$\\!"),Dl="[^/]",Cf=Dl+"*?",xf=Dl+"+?";class jt{type;#n;#r;#s=!1;#e=[];#t;#i;#l;#a=!1;#o;#c;#d=!1;constructor(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.type=t,t&&(this.#r=!0),this.#t=n,this.#n=this.#t?this.#t.#n:this,this.#o=this.#n===this?r:this.#n.#o,this.#l=this.#n===this?[]:this.#n.#l,t!=="!"||this.#n.#a||this.#l.push(this),this.#i=this.#t?this.#t.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(const t of this.#e)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#e.map((t=>String(t))).join("|")+")":this.#c=this.#e.map((t=>String(t))).join("")}#p(){if(this!==this.#n)throw new Error("should only call on root");if(this.#a)return this;let t;for(this.toString(),this.#a=!0;t=this.#l.pop();){if(t.type!=="!")continue;let n=t,r=n.#t;for(;r;){for(let o=n.#i+1;!r.type&&o<r.#e.length;o++)for(const s of t.#e){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#e[o])}n=r,r=n.#t}}return this}push(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(const o of n)if(o!==""){if(typeof o!="string"&&!(o instanceof jt&&o.#t===this))throw new Error("invalid part: "+o);this.#e.push(o)}}toJSON(){const t=this.type===null?this.#e.slice().map((n=>typeof n=="string"?n:n.toJSON())):[this.type,...this.#e.map((n=>n.toJSON()))];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#a&&this.#t?.type==="!")&&t.push({}),t}isStart(){if(this.#n===this)return!0;if(!this.#t?.isStart())return!1;if(this.#i===0)return!0;const t=this.#t;for(let n=0;n<this.#i;n++){const r=t.#e[n];if(!(r instanceof jt&&r.type==="!"))return!1}return!0}isEnd(){if(this.#n===this||this.#t?.type==="!")return!0;if(!this.#t?.isEnd())return!1;if(!this.type)return this.#t?.isEnd();const t=this.#t?this.#t.#e.length:0;return this.#i===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const n=new jt(this.type,t);for(const r of this.#e)n.copyIn(r);return n}static#u(t,n,r,o){let s=!1,i=!1,l=-1,u=!1;if(n.type===null){let h=r,g="";for(;h<t.length;){const m=t.charAt(h++);if(s||m==="\\")s=!s,g+=m;else if(i)h===l+1?m!=="^"&&m!=="!"||(u=!0):m!=="]"||h===l+2&&u||(i=!1),g+=m;else if(m!=="[")if(o.noext||!kf(m)||t.charAt(h)!=="(")g+=m;else{n.push(g),g="";const w=new jt(m,n);h=jt.#u(t,w,h,o),n.push(w)}else i=!0,l=h,u=!1,g+=m}return n.push(g),h}let d=r+1,c=new jt(null,n);const p=[];let f="";for(;d<t.length;){const h=t.charAt(d++);if(s||h==="\\")s=!s,f+=h;else if(i)d===l+1?h!=="^"&&h!=="!"||(u=!0):h!=="]"||d===l+2&&u||(i=!1),f+=h;else if(h!=="[")if(kf(h)&&t.charAt(d)==="("){c.push(f),f="";const g=new jt(h,c);c.push(g),d=jt.#u(t,g,d,o)}else if(h!=="|"){if(h===")")return f===""&&n.#e.length===0&&(n.#d=!0),c.push(f),f="",n.push(...p,c),d;f+=h}else c.push(f),f="",p.push(c),c=new jt(null,n);else i=!0,l=d,u=!1,f+=h}return n.type=null,n.#r=void 0,n.#e=[t.substring(r-1)],d}static fromGlob(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=new jt(null,void 0,n);return jt.#u(t,r,0,n),r}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();const t=this.toString(),[n,r,o,s]=this.toRegExpSource();if(!(o||this.#r||this.#o.nocase&&!this.#o.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;const i=(this.#o.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,i),{_src:n,_glob:t})}get options(){return this.#o}toRegExpSource(t){const n=t??!!this.#o.dot;if(this.#n===this&&this.#p(),!this.type){const u=this.isStart()&&this.isEnd(),d=this.#e.map((f=>{const[h,g,m,w]=typeof f=="string"?jt.#h(f,this.#r,u):f.toRegExpSource(t);return this.#r=this.#r||m,this.#s=this.#s||w,h})).join("");let c="";if(this.isStart()&&typeof this.#e[0]=="string"&&(this.#e.length!==1||!$0.has(this.#e[0]))){const f=F0,h=n&&f.has(d.charAt(0))||d.startsWith("\\.")&&f.has(d.charAt(2))||d.startsWith("\\.\\.")&&f.has(d.charAt(4)),g=!n&&!t&&f.has(d.charAt(0));c=h?"(?!(?:^|/)\\.\\.?(?:$|/))":g?Rl:""}let p="";return this.isEnd()&&this.#n.#a&&this.#t?.type==="!"&&(p="(?:$|\\/)"),[c+d+p,Yo(d),this.#r=!!this.#r,this.#s]}const r=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:";let s=this.#f(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){const u=this.toString();return this.#e=[u],this.type=null,this.#r=void 0,[u,Yo(this.toString()),!1,!1]}let i=!r||t||n?"":this.#f(!0);i===s&&(i=""),i&&(s=`(?:${s})(?:${i})*?`);let l="";return l=this.type==="!"&&this.#d?(this.isStart()&&!n?Rl:"")+xf:o+s+(this.type==="!"?"))"+(!this.isStart()||n||t?"":Rl)+Cf+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&i?")":this.type==="*"&&i?")?":`)${this.type}`),[l,Yo(s),this.#r=!!this.#r,this.#s]}#f(t){return this.#e.map((n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");const[r,o,s,i]=n.toRegExpSource(t);return this.#s=this.#s||i,r})).filter((n=>!(this.isStart()&&this.isEnd()&&!n))).join("|")}static#h(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],o=!1,s="",i=!1;for(let l=0;l<t.length;l++){const u=t.charAt(l);if(o)o=!1,s+=(O0.has(u)?"\\":"")+u;else if(u!=="\\"){if(u==="["){const[d,c,p,f]=P0(t,l);if(p){s+=d,i=i||c,l+=p-1,n=n||f;continue}}u!=="*"?u!=="?"?s+=u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):(s+=Dl,n=!0):(s+=r&&t==="*"?xf:Cf,n=!0)}else l===t.length-1?s+="\\\\":o=!0}return[s,Yo(t),!!n,i]}}const zt=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return wi(t),!(!n.nocomment&&t.charAt(0)==="#")&&new Si(t,n).match(e)},L0=/^\*+([^+@!?\*\[\(]*)$/,_0=e=>t=>!t.startsWith(".")&&t.endsWith(e),M0=e=>t=>t.endsWith(e),N0=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),B0=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),j0=/^\*+\.\*+$/,z0=e=>!e.startsWith(".")&&e.includes("."),U0=e=>e!=="."&&e!==".."&&e.includes("."),V0=/^\.\*+$/,q0=e=>e!=="."&&e!==".."&&e.startsWith("."),H0=/^\*+$/,W0=e=>e.length!==0&&!e.startsWith("."),Q0=e=>e.length!==0&&e!=="."&&e!=="..",K0=/^\?+([^+@!?\*\[\(]*)?$/,G0=e=>{let[t,n=""]=e;const r=Af([t]);return n?(n=n.toLowerCase(),o=>r(o)&&o.toLowerCase().endsWith(n)):r},J0=e=>{let[t,n=""]=e;const r=Ef([t]);return n?(n=n.toLowerCase(),o=>r(o)&&o.toLowerCase().endsWith(n)):r},X0=e=>{let[t,n=""]=e;const r=Ef([t]);return n?o=>r(o)&&o.endsWith(n):r},Y0=e=>{let[t,n=""]=e;const r=Af([t]);return n?o=>r(o)&&o.endsWith(n):r},Af=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&!r.startsWith(".")},Ef=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&r!=="."&&r!==".."},Rf=typeof ce=="object"&&ce?typeof ce.env=="object"&&ce.env&&ce.env.__MINIMATCH_TESTING_PLATFORM__||ce.platform:"posix";zt.sep=Rf==="win32"?"\\":"/";const un=Symbol("globstar **");zt.GLOBSTAR=un,zt.filter=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=>zt(n,e,t)};const dn=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},e,t)};zt.defaults=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return zt;const t=zt;return Object.assign((function(n,r){return t(n,r,dn(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}),{Minimatch:class extends t.Minimatch{constructor(n){super(n,dn(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(n){return t.defaults(dn(e,n)).Minimatch}},AST:class extends t.AST{constructor(n,r){super(n,r,dn(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}static fromGlob(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.AST.fromGlob(n,dn(e,r))}},unescape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(n,dn(e,r))},escape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(n,dn(e,r))},filter:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(n,dn(e,r))},defaults:n=>t.defaults(dn(e,n)),makeRe:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(n,dn(e,r))},braceExpand:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(n,dn(e,r))},match:function(n,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(n,r,dn(e,o))},sep:t.sep,GLOBSTAR:un})};const Df=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return wi(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:R0(e)};zt.braceExpand=Df,zt.makeRe=function(e){return new Si(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},zt.match=function(e,t){const n=new Si(t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{});return e=e.filter((r=>n.match(r))),n.options.nonull&&!e.length&&e.push(t),e};const Pf=/[?*]|[+@!]\(.*?\)|\[|\]/;class Si{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};wi(t),n=n||{},this.options=n,this.pattern=t,this.platform=n.platform||Rf,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!(!this.isWindows||!this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const n of t)if(typeof n!="string")return!0;return!1}debug(){}make(){const t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#")return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=function(){return console.error(...arguments)}),this.debug(this.pattern,this.globSet);const r=this.globSet.map((s=>this.slashSplit(s)));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let o=this.globParts.map(((s,i,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){const u=!(s[0]!==""||s[1]!==""||s[2]!=="?"&&Pf.test(s[2])||Pf.test(s[3])),d=/^[a-z]:/i.test(s[0]);if(u)return[...s.slice(0,4),...s.slice(4).map((c=>this.parse(c)))];if(d)return[s[0],...s.slice(1).map((c=>this.parse(c)))]}return s.map((u=>this.parse(u)))}));if(this.debug(this.pattern,o),this.set=o.filter((s=>s.indexOf(!1)===-1)),this.isWindows)for(let s=0;s<this.set.length;s++){const i=this.set[s];i[0]===""&&i[1]===""&&this.globParts[s][2]==="?"&&typeof i[3]=="string"&&/^[a-z]:$/i.test(i[3])&&(i[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let r=0;r<t.length;r++)for(let o=0;o<t[r].length;o++)t[r][o]==="**"&&(t[r][o]="*");const{optimizationLevel:n=1}=this.options;return n>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=n>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map((n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let o=r;for(;n[o+1]==="**";)o++;o!==r&&n.splice(r,o-r)}return n}))}levelOneOptimize(t){return t.map((n=>(n=n.reduce(((r,o)=>{const s=r[r.length-1];return o==="**"&&s==="**"?r:o===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(o),r)}),[])).length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let o=1;o<t.length-1;o++){const s=t[o];o===1&&s===""&&t[0]===""||s!=="."&&s!==""||(n=!0,t.splice(o,1),o--)}t[0]!=="."||t.length!==2||t[1]!=="."&&t[1]!==""||(n=!0,t.pop())}let r=0;for(;(r=t.indexOf("..",r+1))!==-1;){const o=t[r-1];o&&o!=="."&&o!==".."&&o!=="**"&&(n=!0,t.splice(r-1,2),r-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let r of t){let o=-1;for(;(o=r.indexOf("**",o+1))!==-1;){let i=o;for(;r[i+1]==="**";)i++;i>o&&r.splice(o+1,i-o);let l=r[o+1];const u=r[o+2],d=r[o+3];if(l!==".."||!u||u==="."||u===".."||!d||d==="."||d==="..")continue;n=!0,r.splice(o,1);const c=r.slice(0);c[o]="**",t.push(c),o--}if(!this.preserveMultipleSlashes){for(let i=1;i<r.length-1;i++){const l=r[i];i===1&&l===""&&r[0]===""||l!=="."&&l!==""||(n=!0,r.splice(i,1),i--)}r[0]!=="."||r.length!==2||r[1]!=="."&&r[1]!==""||(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){const i=r[s-1];if(i&&i!=="."&&i!==".."&&i!=="**"){n=!0;const l=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...l),r.length===0&&r.push(""),s-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let r=n+1;r<t.length;r++){const o=this.partsMatch(t[n],t[r],!this.preserveMultipleSlashes);if(o){t[n]=[],t[r]=o;break}}return t.filter((n=>n.length))}partsMatch(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],o=0,s=0,i=[],l="";for(;o<t.length&&s<n.length;)if(t[o]===n[s])i.push(l==="b"?n[s]:t[o]),o++,s++;else if(r&&t[o]==="**"&&n[s]===t[o+1])i.push(t[o]),o++;else if(r&&n[s]==="**"&&t[o]===n[s+1])i.push(n[s]),s++;else if(t[o]!=="*"||!n[s]||!this.options.dot&&n[s].startsWith(".")||n[s]==="**"){if(n[s]!=="*"||!t[o]||!this.options.dot&&t[o].startsWith(".")||t[o]==="**"||l==="a")return!1;l="b",i.push(n[s]),o++,s++}else{if(l==="b")return!1;l="a",i.push(t[o]),o++,s++}return t.length===n.length&&i}parseNegate(){if(this.nonegate)return;const t=this.pattern;let n=!1,r=0;for(let o=0;o<t.length&&t.charAt(o)==="!";o++)n=!n,r++;r&&(this.pattern=t.slice(r)),this.negate=n}matchOne(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const o=this.options;if(this.isWindows){const m=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),w=!m&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),T=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),k=w?3:m?0:void 0,S=!T&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])?3:T?0:void 0;if(typeof k=="number"&&typeof S=="number"){const[y,E]=[t[k],n[S]];y.toLowerCase()===E.toLowerCase()&&(n[S]=y,S>k?n=n.slice(S):k>S&&(t=t.slice(k)))}}const{optimizationLevel:s=1}=this.options;s>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:n}),this.debug("matchOne",t.length,n.length);for(var i=0,l=0,u=t.length,d=n.length;i<u&&l<d;i++,l++){this.debug("matchOne loop");var c=n[l],p=t[i];if(this.debug(n,c,p),c===!1)return!1;if(c===un){this.debug("GLOBSTAR",[n,c,p]);var f=i,h=l+1;if(h===d){for(this.debug("** at the end");i<u;i++)if(t[i]==="."||t[i]===".."||!o.dot&&t[i].charAt(0)===".")return!1;return!0}for(;f<u;){var g=t[f];if(this.debug(`
7
+ globstar while`,t,f,n,h,g),this.matchOne(t.slice(f),n.slice(h),r))return this.debug("globstar found match!",f,u,g),!0;if(g==="."||g===".."||!o.dot&&g.charAt(0)==="."){this.debug("dot detected!",t,f,n,h);break}this.debug("globstar swallow a segment, and continue"),f++}return!(!r||(this.debug(`
8
+ >>> no match, partial?`,t,f,n,h),f!==u))}let m;if(typeof c=="string"?(m=p===c,this.debug("string match",c,p,m)):(m=c.test(p),this.debug("pattern match",c,p,m)),!m)return!1}if(i===u&&l===d)return!0;if(i===u)return r;if(l===d)return i===u-1&&t[i]==="";throw new Error("wtf?")}braceExpand(){return Df(this.pattern,this.options)}parse(t){wi(t);const n=this.options;if(t==="**")return un;if(t==="")return"";let r,o=null;(r=t.match(H0))?o=n.dot?Q0:W0:(r=t.match(L0))?o=(n.nocase?n.dot?B0:N0:n.dot?M0:_0)(r[1]):(r=t.match(K0))?o=(n.nocase?n.dot?J0:G0:n.dot?X0:Y0)(r):(r=t.match(j0))?o=n.dot?U0:z0:(r=t.match(V0))&&(o=q0);const s=jt.fromGlob(t,this.options).toMMPattern();return o&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:o}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const n=this.options,r=n.noglobstar?"[^/]*?":n.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",o=new Set(n.nocase?["i"]:[]);let s=t.map((u=>{const d=u.map((c=>{if(c instanceof RegExp)for(const p of c.flags.split(""))o.add(p);return typeof c=="string"?c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):c===un?un:c._src}));return d.forEach(((c,p)=>{const f=d[p+1],h=d[p-1];c===un&&h!==un&&(h===void 0?f!==void 0&&f!==un?d[p+1]="(?:\\/|"+r+"\\/)?"+f:d[p]=r:f===void 0?d[p-1]=h+"(?:\\/|"+r+")?":f!==un&&(d[p-1]=h+"(?:\\/|\\/"+r+"\\/)"+f,d[p+1]=un))})),d.filter((c=>c!==un)).join("/")})).join("|");const[i,l]=t.length>1?["(?:",")"]:["",""];s="^"+i+s+l+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...o].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.partial;if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;const r=this.options;this.isWindows&&(t=t.split("\\").join("/"));const o=this.slashSplit(t);this.debug(this.pattern,"split",o);const s=this.set;this.debug(this.pattern,"set",s);let i=o[o.length-1];if(!i)for(let l=o.length-2;!i&&l>=0;l--)i=o[l];for(let l=0;l<s.length;l++){const u=s[l];let d=o;if(r.matchBase&&u.length===1&&(d=[i]),this.matchOne(d,u,n))return!!r.flipNegate||!this.negate}return!r.flipNegate&&this.negate}static defaults(t){return zt.defaults(t).Minimatch}}zt.AST=jt,zt.Minimatch=Si,zt.escape=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")},zt.unescape=Yo;var Z0=it(829);it.n(Z0);var e1=(function(e){return e.Array="array",e.Object="object",e.Original="original",e})(e1||{});typeof Symbol<"u"&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")));var t1=it(388);it.n(t1),it(172);class If{isEnabled(){return!0}isActive(t){return st(t,"files-spaces-projects")?!1:st(t,"files-spaces-generic")||ln(t,"files-public-link")}getTask(t){const{router:n,clientService:r,resourcesStore:o,authService:s,spacesStore:i,sharesStore:l,configStore:u}=t,{webdav:d,graphAuthenticated:c}=r,{replaceInvalidFileRoute:p}=Ri({router:n});return $t.useTask(function*(f,h,g,m=null,w=null,T={}){try{o.clearResourceList();const k=Jo.Default;z.isPublicSpaceResource(g)&&k.push(Ee.DownloadURL);let{resource:S,children:y}=yield*z.call(d.listFiles(g,{path:m,fileId:w},{signal:f,davProperties:k}));S.id&&p({space:g,resource:S,path:m,fileId:w});let E;m==="/"&&(z.isShareSpaceResource(g)?(E=yield*z.call(pi({graphClient:c,spacesStore:i,space:g,signal:f})),E&&(S=z.buildIncomingShareResource({graphRoles:l.graphRoles,driveItem:E,serverUrl:u.serverUrl}))):!z.isPersonalSpaceResource(g)&&!z.isPublicSpaceResource(g)&&(S=g)),yield o.loadAncestorMetaData({folder:S,space:g,client:d,signal:f}),z.isProjectSpaceResource(g)&&(yield i.loadGraphPermissions({ids:[g.id],graphClient:c})),z.isShareSpaceResource(g)&&(y.forEach(D=>D.remoteItemId=g.id),g.graphPermissions===void 0&&(E||(E=yield*z.call(pi({graphClient:c,spacesStore:i,space:g,signal:f}))),rf({sharesStore:l,spacesStore:i,space:g,sharedDriveItem:E}))),o.initResourceList({currentFolder:S,resources:y})}catch(k){if(o.setCurrentFolder(null),console.error(k),k.statusCode===401)return s.handleAuthError(a(n.currentRoute))}}).restartable()}}class Ff{isEnabled(){return!0}isActive(t){const n=a(t.currentRoute);return bt(t,"files-common-favorites")||n?.query?.contextRouteName==="files-common-favorites"}getTask(t){const{resourcesStore:n,clientService:r,userStore:o}=t;return $t.useTask(function*(s,i){n.clearResourceList(),n.setAncestorMetaData({});let l=yield r.webdav.listFavoriteFiles({username:o.user?.onPremisesSamAccountName,signal:s});l=l.map(z.buildResource),n.initResourceList({currentFolder:null,resources:l})})}}class $f{isEnabled(){return!0}isActive(t){const n=a(t.currentRoute);return mt(t,"files-shares-via-link")||n?.query?.contextRouteName==="files-shares-via-link"}getTask(t){const{userStore:n,spacesStore:r,clientService:o,configStore:s,resourcesStore:i}=t;return $t.useTask(function*(l,u){i.clearResourceList(),i.setAncestorMetaData({}),s.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:o.graphAuthenticated,signal:l}));const c=(yield*z.call(o.graphAuthenticated.driveItems.listSharedByMe({expand:new Set(["thumbnails"])},{signal:l}))).filter(p=>p.permissions.some(({link:f})=>!!f)).map(p=>z.buildOutgoingShareResource({driveItem:p,user:n.user,serverUrl:s.serverUrl}));i.initResourceList({currentFolder:null,resources:c})})}}class Of{isEnabled(){return!0}isActive(t){const n=a(t.currentRoute);return mt(t,"files-shares-with-me")||n?.query?.contextRouteName==="files-shares-with-me"}getTask(t){const{spacesStore:n,clientService:r,configStore:o,resourcesStore:s,sharesStore:i}=t;return $t.useTask(function*(l,u){s.clearResourceList(),s.setAncestorMetaData({}),o.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:r.graphAuthenticated,signal:l}));const c=(yield*z.call(r.graphAuthenticated.driveItems.listSharedWithMe({expand:new Set(["thumbnails"])},{signal:l}))).map(p=>z.buildIncomingShareResource({driveItem:p,graphRoles:i.graphRoles,serverUrl:o.serverUrl}));s.initResourceList({currentFolder:null,resources:c})})}}class Lf{isEnabled(){return!0}isActive(t){const n=a(t.currentRoute);return mt(t,"files-shares-with-others")||n?.query?.contextRouteName==="files-shares-with-others"}getTask(t){const{userStore:n,spacesStore:r,clientService:o,configStore:s,resourcesStore:i}=t;return $t.useTask(function*(l,u){i.clearResourceList(),i.setAncestorMetaData({}),s.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:o.graphAuthenticated,signal:l}));const c=(yield*z.call(o.graphAuthenticated.driveItems.listSharedByMe({expand:new Set(["thumbnails"])},{signal:l}))).filter(p=>p.permissions.some(({link:f})=>!f)).map(p=>z.buildOutgoingShareResource({driveItem:p,user:n.user,serverUrl:s.serverUrl}));i.initResourceList({currentFolder:null,resources:c})})}}class _f{isEnabled(){return!0}isActive(t){return qt(t,"files-trash-generic")}getTask(t){const{resourcesStore:n,spacesStore:r,clientService:{webdav:o,graphAuthenticated:s}}=t;return $t.useTask(function*(i,l,u){n.clearResourceList(),n.setAncestorMetaData({});const{resource:d,children:c}=yield o.listFiles(u,{},{depth:1,davProperties:Jo.Trashbin,isTrash:!0,signal:i});z.isProjectSpaceResource(u)&&(yield r.loadGraphPermissions({ids:[u.id],graphClient:s})),n.initResourceList({currentFolder:d,resources:c})})}}class Mf{loaders;constructor(){this.loaders=[new If,new Ff,new $f,new Of,new Lf,new _f]}getTask(){const t=et(),n=He(),r=Dt(),o=Re(),s=Pe(),i=Ge(),l=De(),u=tr(),d=ql(),c=this.loaders.find(p=>p.isEnabled()&&p.isActive(a(o)));if(!c){console.debug("No folder loader found for route");return}return $t.useTask(function*(...p){const f={clientService:s,configStore:i,userStore:t,spacesStore:n,capabilityStore:r,resourcesStore:l,sharesStore:u,router:o,authService:d};try{yield c.getTask(f).perform(...p)}catch(h){console.error(h)}})}}const Nf=new Mf;var Sr=(e=>(e.add="loading-service.add",e.remove="loading-service.remove",e.setProgress="loading-service.set-progress",e))(Sr||{});const n1=200;class r1{tasks=[];get isLoading(){return this.tasks.some(t=>t.active)}get currentProgress(){if(this.tasks.some(r=>!r.state&&r.active))return null;const t=this.tasks.filter(r=>!!r.state&&r.active);if(!t.length)return null;const n=t.reduce((r,o)=>(r+=o.state.current/o.state.total,r),0);return Math.round(n/t.length*100)}addTask(t,{debounceTime:n=n1,indeterminate:r=!0}={}){const o={id:Ct.v4(),active:!1,...!r&&{state:{total:0,current:0}}};return this.tasks.length||window.addEventListener("beforeunload",this.onBeforeUnload),this.tasks.push(o),rt.debounce(()=>{o.active=!0,ze.publish("loading-service.add")},n)(),t({setProgress:({total:l,current:u})=>{r||this.setProgress({task:o,total:l,current:u})}}).finally(()=>{this.removeTask(o.id)})}removeTask(t){this.tasks=this.tasks.filter(n=>n.id!==t),this.tasks.length||window.removeEventListener("beforeunload",this.onBeforeUnload),ze.publish("loading-service.remove")}setProgress({task:t,total:n,current:r}){t.state||(t.state={total:0,current:0}),t.state.total=n,t.state.current=r,ze.publish("loading-service.set-progress")}onBeforeUnload(t){t.preventDefault()}}var o1="__lodash_hash_undefined__";function s1(e){return this.__data__.set(e,o1),this}function i1(e){return this.__data__.has(e)}function Ti(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Zn;++t<n;)this.add(e[t])}Ti.prototype.add=Ti.prototype.push=s1,Ti.prototype.has=i1;function a1(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function l1(e,t){return e.has(t)}var c1=1,u1=2;function Bf(e,t,n,r,o,s){var i=n&c1,l=e.length,u=t.length;if(l!=u&&!(i&&u>l))return!1;var d=s.get(e),c=s.get(t);if(d&&c)return d==t&&c==e;var p=-1,f=!0,h=n&u1?new Ti:void 0;for(s.set(e,t),s.set(t,e);++p<l;){var g=e[p],m=t[p];if(r)var w=i?r(m,g,p,t,e,s):r(g,m,p,e,t,s);if(w!==void 0){if(w)continue;f=!1;break}if(h){if(!a1(t,function(T,k){if(!l1(h,k)&&(g===T||o(g,T,n,r,s)))return h.push(k)})){f=!1;break}}else if(!(g===m||o(g,m,n,r,s))){f=!1;break}}return s.delete(e),s.delete(t),f}function d1(e){var t=-1,n=Array(e.size);return e.forEach(function(r,o){n[++t]=[o,r]}),n}function f1(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var p1=1,h1=2,m1="[object Boolean]",g1="[object Date]",v1="[object Error]",y1="[object Map]",b1="[object Number]",w1="[object RegExp]",S1="[object Set]",T1="[object String]",k1="[object Symbol]",C1="[object ArrayBuffer]",x1="[object DataView]",jf=sn?sn.prototype:void 0,Pl=jf?jf.valueOf:void 0;function A1(e,t,n,r,o,s,i){switch(n){case x1:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case C1:return!(e.byteLength!=t.byteLength||!s(new li(e),new li(t)));case m1:case g1:case b1:return Vo(+e,+t);case v1:return e.name==t.name&&e.message==t.message;case w1:case T1:return e==t+"";case y1:var l=d1;case S1:var u=r&p1;if(l||(l=f1),e.size!=t.size&&!u)return!1;var d=i.get(e);if(d)return d==t;r|=h1,i.set(e,t);var c=Bf(l(e),l(t),r,o,s,i);return i.delete(e),c;case k1:if(Pl)return Pl.call(e)==Pl.call(t)}return!1}function Il(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function zf(e,t,n){var r=t(e);return Tn(e)?r:Il(r,n(e))}function E1(e,t){for(var n=-1,r=e==null?0:e.length,o=0,s=[];++n<r;){var i=e[n];t(i,n,e)&&(s[o++]=i)}return s}function Uf(){return[]}var R1=Object.prototype,D1=R1.propertyIsEnumerable,Vf=Object.getOwnPropertySymbols,qf=Vf?function(e){return e==null?[]:(e=Object(e),E1(Vf(e),function(t){return D1.call(e,t)}))}:Uf,P1=Dd(Object.keys,Object),I1=Object.prototype,F1=I1.hasOwnProperty;function $1(e){if(!el(e))return P1(e);var t=[];for(var n in Object(e))F1.call(e,n)&&n!="constructor"&&t.push(n);return t}function O1(e){return ui(e)?Ud(e):$1(e)}function Hf(e){return zf(e,O1,qf)}var L1=1,_1=Object.prototype,M1=_1.hasOwnProperty;function N1(e,t,n,r,o,s){var i=n&L1,l=Hf(e),u=l.length,d=Hf(t),c=d.length;if(u!=c&&!i)return!1;for(var p=u;p--;){var f=l[p];if(!(i?f in t:M1.call(t,f)))return!1}var h=s.get(e),g=s.get(t);if(h&&g)return h==t&&g==e;var m=!0;s.set(e,t),s.set(t,e);for(var w=i;++p<u;){f=l[p];var T=e[f],k=t[f];if(r)var S=i?r(k,T,f,t,e,s):r(T,k,f,e,t,s);if(!(S===void 0?T===k||o(T,k,n,r,s):S)){m=!1;break}w||(w=f=="constructor")}if(m&&!w){var y=e.constructor,E=t.constructor;y!=E&&"constructor"in e&&"constructor"in t&&!(typeof y=="function"&&y instanceof y&&typeof E=="function"&&E instanceof E)&&(m=!1)}return s.delete(e),s.delete(t),m}var Fl=$r(Fn,"DataView"),$l=$r(Fn,"Promise"),Ol=$r(Fn,"Set"),Ll=$r(Fn,"WeakMap"),Wf="[object Map]",B1="[object Object]",Qf="[object Promise]",Kf="[object Set]",Gf="[object WeakMap]",Jf="[object DataView]",j1=Fr(Fl),z1=Fr(Ho),U1=Fr($l),V1=Fr(Ol),q1=Fr(Ll),Cn=Ir;(Fl&&Cn(new Fl(new ArrayBuffer(1)))!=Jf||Ho&&Cn(new Ho)!=Wf||$l&&Cn($l.resolve())!=Qf||Ol&&Cn(new Ol)!=Kf||Ll&&Cn(new Ll)!=Gf)&&(Cn=function(e){var t=Ir(e),n=t==B1?e.constructor:void 0,r=n?Fr(n):"";if(r)switch(r){case j1:return Jf;case z1:return Wf;case U1:return Qf;case V1:return Kf;case q1:return Gf}return t});var H1=1,Xf="[object Arguments]",Yf="[object Array]",ki="[object Object]",W1=Object.prototype,Zf=W1.hasOwnProperty;function Q1(e,t,n,r,o,s){var i=Tn(e),l=Tn(t),u=i?Yf:Cn(e),d=l?Yf:Cn(t);u=u==Xf?ki:u,d=d==Xf?ki:d;var c=u==ki,p=d==ki,f=u==d;if(f&&Qo(e)){if(!Qo(t))return!1;i=!0,c=!1}if(f&&!c)return s||(s=new On),i||ol(e)?Bf(e,t,n,r,o,s):A1(e,t,u,n,r,o,s);if(!(n&H1)){var h=c&&Zf.call(e,"__wrapped__"),g=p&&Zf.call(t,"__wrapped__");if(h||g){var m=h?e.value():e,w=g?t.value():t;return s||(s=new On),o(m,w,n,r,s)}}return f?(s||(s=new On),N1(e,t,n,r,o,s)):!1}function ep(e,t,n,r,o){return e===t?!0:e==null||t==null||!Ln(e)&&!Ln(t)?e!==e&&t!==t:Q1(e,t,n,r,ep,o)}function tp(e,t){return ep(e,t)}class K1{clientService;configStore;userStore;authStore;constructor({clientService:t,userStore:n,authStore:r,configStore:o}){this.clientService=t,this.userStore=n,this.authStore=r,this.configStore=o}get user(){return this.userStore.user}async loadPreview(t,n=!1,r=!0,o){const{space:s,resource:i}=t;if(!i.canDownload()||!i.hasPreview?.())return;const l=z.isPublicSpaceResource(s);if(!(!l&&(!this.configStore.serverUrl||!this.user.onPremisesSamAccountName||!this.authStore.accessToken))){if(l)return this.publicPreviewUrl(t,o);try{return await this.privatePreviewBlob(t,n,r,o)}catch(u){if(r)return;throw u}}}async cacheFactory(t,n,r){const{resource:o,dimensions:s}=t,i=wl.filePreview.get(o.id.toString());if(i&&i.etag===o.etag&&tp(s,i.dimensions))return i.src;try{const l=await this.privatePreviewBlob(t,!1,!0,r);return wl.filePreview.set(o.id.toString(),{src:l,etag:o.etag,dimensions:s},0).src}catch(l){if(n)return;throw l}}buildQueryString(t){return $g.stringify({scalingup:t.scalingup||0,preview:Object.hasOwnProperty.call(t,"preview")?t.preview:1,a:Object.hasOwnProperty.call(t,"a")?t.a:1,...t.processor&&{processor:t.processor},...t.etag&&{c:t.etag.replaceAll('"',"")},...t.dimensions&&t.dimensions[0]&&{x:t.dimensions[0]},...t.dimensions&&t.dimensions[1]&&{y:t.dimensions[1]}})}async privatePreviewBlob(t,n=!1,r=!0,o){const{resource:s,dimensions:i,processor:l}=t;if(n)return this.cacheFactory(t,r,o);const u=[this.configStore.serverUrl,"remote.php/dav",vl(s.webDavPath),"?",this.buildQueryString({etag:s.etag,dimensions:i,processor:l})].join("");try{const{data:d}=await this.clientService.httpAuthenticated.get(u,{responseType:"blob",signal:o});return window.URL.createObjectURL(d)}catch(d){if([425,429].includes(d.status)){const c=d.response?.headers?.["retry-after"]||5;return await new Promise(p=>setTimeout(p,c*1e3)),this.privatePreviewBlob(t,n,r,o)}throw d}}async publicPreviewUrl(t,n){const{space:r,resource:o,dimensions:s,processor:i}=t;let{downloadURL:l}=o;if(!l){const{downloadURL:f}=await this.clientService.webdav.getFileInfo(r,o,{davProperties:[Ee.DownloadURL]});l=f}const[u,d]=l.split("?"),c=[this.buildQueryString({etag:o.etag,dimensions:s,processor:i}),d].filter(Boolean).join("&"),p=[u,c].filter(Boolean).join("?");try{const{status:f}=await this.clientService.httpUnAuthenticated.head(p,{signal:n});if(f!==404)return p}catch(f){if([425,429].includes(f.status)){const h=f.response?.headers?.["retry-after"]||5;return await new Promise(g=>setTimeout(g,h*1e3)),this.publicPreviewUrl(t,n)}throw f}}}const Ci=K.z.enum(["fit","resize","fill","thumbnail"]);class G1{$gettext;constructor({$gettext:t}){this.$gettext=t}explain(t,n){return{code:"mustNotBeEmpty",message:this.$gettext("Must not be empty"),format:[],...rt.isBoolean(n)&&{verified:n}}}assert(t,n){return n.length>0}validate(){return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class J1{$gettext;constructor({$gettext:t}){this.$gettext=t}explain(t,n){return{code:"mustContain",helperMessage:this.$gettext("Valid special characters: %{characters}",{characters:t.characters},!0),message:this.$gettext("%{param1}+ special characters"),format:[t.minLength],...rt.isBoolean(n)&&{verified:n}}}assert(t,n){return Array.from(n).filter(o=>t.characters.includes(o)).length>=t.minLength}validate(t){if(!rt.isObject(t))throw new Error("options should be an object");if(!rt.isNumber(t.minLength)||rt.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");if(!rt.isString(t.characters))throw new Error("characters should be a character sequence");return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class xi{$gettext;constructor({$gettext:t}){this.$gettext=t}assert(t,n){throw new Error("Method not implemented.")}explain(t,n){throw new Error("Method not implemented.")}validate(t){if(!rt.isObject(t))throw new Error("options should be an object");if(!rt.isNumber(t.minLength)||rt.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");return!0}missing(t,n){return this.explain(t,this.assert(t,n))}}class X1 extends xi{constructor(t){super(t)}explain(t,n){return{code:"atLeastCharacters",message:this.$gettext("%{param1}+ letters"),format:[t.minLength],...rt.isBoolean(n)&&{verified:n}}}assert(t,n){return n.length>=t.minLength}}class Y1 extends xi{constructor(t){super(t)}explain(t,n){return{code:"atLeastUppercaseCharacters",message:this.$gettext("%{param1}+ uppercase letters"),format:[t.minLength],...rt.isBoolean(n)&&{verified:n}}}assert(t,n){return(n||"").match(/[A-Z\xC0-\xD6\xD8-\xDE]/g)?.length>=t.minLength}}class Z1 extends xi{constructor(t){super(t)}explain(t,n){return{code:"atLeastLowercaseCharacters",message:this.$gettext("%{param1}+ lowercase letters"),format:[t.minLength],...rt.isBoolean(n)&&{verified:n}}}assert(t,n){return(n||"").match(/[a-z\xDF-\xF6\xF8-\xFF]/g)?.length>=t.minLength}}class eT extends xi{constructor(t){super(t)}explain(t,n){return{code:"atLeastDigits",message:this.$gettext("%{param1}+ numbers"),format:[t.minLength],...rt.isBoolean(n)&&{verified:n}}}assert(t,n){return(n||"").match(/\d/g)?.length>=t.minLength}}class tT{language;capability;policy;generatePasswordRules;constructor({language:t}){this.language=t}initialize(t){this.capability=t.passwordPolicy,this.buildGeneratePasswordRules()}hasRules(){return!!this.capability.min_characters||!!this.capability.min_lowercase_characters||!!this.capability.min_uppercase_characters||!!this.capability.min_digits||!!this.capability.min_special_characters}buildGeneratePasswordRules(){this.generatePasswordRules={length:Math.max(this.capability.min_characters||0,(this.capability.min_lowercase_characters||0)+(this.capability.min_uppercase_characters||0)+(this.capability.min_digits||0)+(this.capability.min_special_characters||0),12),minLowercaseCharacters:Math.max(this.capability.min_lowercase_characters||0,2),minUppercaseCharacters:Math.max(this.capability.min_uppercase_characters||0,2),minSpecialCharacters:Math.max(this.capability.min_special_characters||0,2),minDigits:Math.max(this.capability.min_digits||0,2)}}buildPolicy({enforcePassword:t=!1}={}){const n={atLeastCharacters:new X1({...this.language}),mustNotBeEmpty:new G1({...this.language}),atLeastUppercaseCharacters:new Y1({...this.language}),atLeastLowercaseCharacters:new Z1({...this.language}),atLeastDigits:new eT({...this.language}),mustContain:new J1({...this.language})},r={};t&&!this.hasRules()&&(r.mustNotBeEmpty={}),this.capability.min_characters&&(r.atLeastCharacters={minLength:this.capability.min_characters}),this.capability.min_uppercase_characters&&(r.atLeastUppercaseCharacters={minLength:this.capability.min_uppercase_characters}),this.capability.min_lowercase_characters&&(r.atLeastLowercaseCharacters={minLength:this.capability.min_lowercase_characters}),this.capability.min_digits&&(r.atLeastDigits={minLength:this.capability.min_digits}),this.capability.min_special_characters&&(r.mustContain={minLength:this.capability.min_special_characters,characters:' "!#\\$%&\'()*+,-./:;<=>?@[\\]^_`{|}~"'}),this.policy=new Og.PasswordPolicy(r,n)}getPolicy({enforcePassword:t=!1}={}){return this.buildPolicy({enforcePassword:t}),this.policy}generatePassword(){const t="abcdefghijklmnopqrstuvwxyz",n="ABCDEFGHIJKLMNOPQRSTUVWXYZ",r="\"!#$%&'()*+,-./:;<=>?@[]^_`{|}~",o="0123456789",s=(h,g)=>{const m=256-256%h.length;let w="",T;for(let k=0;k<g;k++){do T=window.crypto.getRandomValues(new Uint8Array(1))[0];while(T>=m);w+=h[T%h.length]}return w},{minLowercaseCharacters:i,minUppercaseCharacters:l,minDigits:u,minSpecialCharacters:d,length:c}=this.generatePasswordRules;let p="";if(p+=s(t,i),p+=s(n,l),p+=s(o,u),p+=s(r,d),p.length<c){const h=c-p.length,g=t+n+r+o;p+=s(g,h)}return(h=>{const g=h.split(""),m=new Uint32Array(g.length);window.crypto.getRandomValues(m);for(let w=g.length-1;w>0;w--){const T=m[w]%(w+1);[g[w],g[T]]=[g[T],g[w]]}return g.join("")})(p)}}const np=e=>({name:Ke.basename(e),type:"directory",relativePath:e}),rp=(e,t)=>t.map(n=>({source:e,name:n.name,type:n.type,data:n,meta:{relativePath:n.relativePath||null}})),op=async e=>{const t=await new Promise((r,o)=>e.file(r,o));return e.fullPath===z.urlJoin(e.name,{leadingSlash:!0})||(t.relativePath=e.fullPath),t},nT=e=>typeof e.getAsEntry=="function"?e.getAsEntry():e.webkitGetAsEntry();async function*rT(e){const t=e.createReader(),n=()=>new Promise((o,s)=>{t.readEntries(o,s)});let r;do{r=await n();for(const o of r)yield o}while(r.length>0)}async function*sp(e,t){if(e.isDirectory){let n=!1;for await(const r of rT(e))if(r.isDirectory)yield*sp(r,t);else if(r.isFile)try{n=!0,yield op(r)}catch(o){console.error(o),t?.(o)}n||(yield np(e.fullPath||e.name))}else try{yield op(e)}catch(n){console.error(n),t?.(n)}}const oT=async(e,t)=>{try{const n=[],r=await Promise.all(Array.from(e.items,o=>nT(o)));for(let o=0;o<r.length;o++)for await(const s of sp(r[o],t))n.push(s);return n}catch(n){console.error(n);const r=Array.from(e.files);return Promise.resolve(r)}},sT={target:null,uppyService:null};class iT extends Bc.BasePlugin{nodes;uppyService;constructor(t,n){super(t,{...sT,...n}),this.type="acquirer",this.id=this.opts.id||"DropTarget"}handleDrop=async t=>{t.preventDefault(),t.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(s=>{s.type==="acquirer"&&s.handleRootDrop?.(t)});let n=!1;const r=s=>{this.uppy.log(s,"error"),n||(this.uppy.info(s.message,"error"),n=!0)},o=await oT(t.dataTransfer,r);if(o.length>0){this.uppy.log("[DropTarget] Files were dropped");try{const s=rp("DropTarget",o);this.uppyService.addFiles(s)}catch(s){this.uppy.log(s)}}this.opts.onDrop?.(t),this.uppyService?.publish("drop",t)};handleDragOver=t=>{t.preventDefault(),t.stopPropagation(),this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver?.(t),this.uppyService?.publish("drag-over",t)};handleDragLeave=t=>{t.preventDefault(),t.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave?.(t),this.uppyService?.publish("drag-out",t)};addListeners=()=>{const{target:t,uppyService:n}=this.opts;if(this.uppyService=n,t instanceof Element?this.nodes=[t]:typeof t=="string"&&(this.nodes=jc.toArray(document.querySelectorAll(t))),!this.nodes||this.nodes.length===0)throw new Error(`"${t}" does not match any HTML elements`);this.nodes.forEach(r=>{r.addEventListener("dragover",this.handleDragOver,!1),r.addEventListener("dragleave",this.handleDragLeave,!1),r.addEventListener("drop",this.handleDrop,!1)})};removeListeners=()=>{this.nodes&&this.nodes.forEach(t=>{t.removeEventListener("dragover",this.handleDragOver,!1),t.removeEventListener("dragleave",this.handleDragLeave,!1),t.removeEventListener("drop",this.handleDrop,!1)})};install(){this.setPluginState({isDraggingOver:!1}),this.addListeners()}uninstall(){this.removeListeners()}}class aT{uppy;uploadInputs=[];uploadFolderMap={};constructor({language:t}){const{$gettext:n}=t;this.uppy=new Bc({autoProceed:!1,onBeforeFileAdded:(r,o)=>r.id in o&&!o[r.id].error?!1:(r.name=r.name.normalize("NFC"),r.meta.relativePath=this.getRelativeFilePath(r)?.normalize("NFC"),r.id=this.generateUploadId(r),r)}),this.uppy.setOptions({locale:{strings:{addedNumFiles:n("Added %{numFiles} file(s)"),authenticate:n("Connect"),authenticateWith:n("Connect to %{pluginName}"),authenticateWithTitle:n("Please authenticate with %{pluginName} to select files"),cancel:n("Cancel"),companionError:n("Connection with Companion failed"),loadedXFiles:n("Loaded %{numFiles} files"),loading:n("Loading..."),logOut:n("Log out"),pluginWebdavInputLabel:n("Public link without password protection"),selectX:{0:n("Select %{smart_count}"),1:n("Select %{smart_count}")},signInWithGoogle:n("Sign in with Google")}}}),this.setUpEvents()}getRelativeFilePath=t=>{const n=t.data.relativePath||t.data.webkitRelativePath;return n?z.urlJoin(n):void 0};addPlugin(t,...n){this.uppy.use(t,...n)}removePlugin(t){this.uppy.removePlugin(t)}getPlugin(t){return this.uppy.getPlugin(t)}useTus({chunkSize:t,overridePatchMethod:n,uploadDataDuringCreation:r,onBeforeRequest:o,headers:s}){const i={chunkSize:t,removeFingerprintOnSuccess:!0,overridePatchMethod:n,retryDelays:[0,500,1e3],uploadDataDuringCreation:r,limit:5,headers:s,onBeforeRequest:o,onShouldRetry:(d,c,p,f)=>d?.originalResponse?.getStatus()>=500?!1:d?.originalResponse?.getStatus()===401?!0:f(d)},l=this.uppy.getPlugin("XHRUpload");l&&this.uppy.removePlugin(l);const u=this.uppy.getPlugin("Tus");if(u){u.setOptions(i);return}this.uppy.use(Lg,i)}useXhr({headers:t,timeout:n,endpoint:r}){const o={endpoint:r,method:"put",headers:t,formData:!1,timeout:n,getResponseData(){return{}}},s=this.uppy.getPlugin("Tus");s&&this.uppy.removePlugin(s);const i=this.uppy.getPlugin("XHRUpload");if(i){i.setOptions(o);return}this.uppy.use(_g,o)}tusActive(){return!!this.uppy.getPlugin("Tus")}useDropTarget({targetSelector:t}){this.uppy.getPlugin("DropTarget")||this.uppy.use(iT,{target:t,uppyService:this})}removeDropTarget(){const t=this.uppy.getPlugin("DropTarget");t&&this.uppy.removePlugin(t)}subscribe(t,n){return ze.subscribe(t,n)}unsubscribe(t,n){ze.unsubscribe(t,n)}publish(t,n){ze.publish(t,n)}setUpEvents(){this.uppy.on("progress",t=>{this.publish("progress",t)}),this.uppy.on("upload-progress",(t,n)=>{this.publish("upload-progress",{file:t,progress:n})}),this.uppy.on("cancel-all",()=>{this.publish("uploadCancelled"),this.clearInputs()}),this.uppy.on("complete",t=>{if(!(!t||!t.successful.length&&!t.failed.length)){this.publish("uploadCompleted",t);for(let n=0;n<t.successful.length;n++)this.uppy.removeFile(t.successful[n].id);this.clearInputs()}}),this.uppy.on("upload-success",t=>{this.publish("uploadSuccess",t)}),this.uppy.on("upload-error",(t,n)=>{this.publish("uploadError",{file:t,error:n})})}registerUploadInput(t){t.getAttribute("listener")!=="true"&&(t.setAttribute("listener","true"),t.addEventListener("change",r=>{const o=r.target,s=Array.from(o.files);this.addFiles(s)}),this.uploadInputs.push(t))}removeUploadInput(t){this.uploadInputs=this.uploadInputs.filter(n=>n!==t)}generateUploadId(t){return jc.generateFileID(t,this.uppy.getID())}log(t,n){this.uppy.log(t,n)}addFiles(t){this.uppy.addFiles(t)}uploadFiles(){return this.uppy.upload()}retryAllUploads(){return this.uppy.retryAll()}pauseAllUploads(){return this.uppy.pauseAll()}resumeAllUploads(){return this.uppy.resumeAll()}cancelAllUploads(){return this.uppy.cancelAll()}removeFailedFiles(){const{files:t}=this.uppy.getState(),n=Object.values(t).filter(r=>r.error);n.length&&this.uppy.removeFiles(n.map(({id:r})=>r))}getCurrentUploads(){return this.uppy.getState().currentUploads}isRemoteUploadInProgress(){return this.uppy.getFiles().some(t=>t.isRemote&&!t.error)}clearInputs(){this.uploadInputs.forEach(t=>{t.value=null})}setUploadFolder(t,n){this.uploadFolderMap[t]=n}removeUploadFolder(t){this.uploadFolderMap[t]&&delete this.uploadFolderMap[t]}}function lT(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var cT=Object.getOwnPropertySymbols,uT=cT?function(e){for(var t=[];e;)Il(t,qf(e)),e=Za(e);return t}:Uf;function ip(e){return zf(e,il,uT)}var dT=Object.prototype,fT=dT.hasOwnProperty;function pT(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&fT.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function hT(e,t){var n=Ya(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var mT=/\w*$/;function gT(e){var t=new e.constructor(e.source,mT.exec(e));return t.lastIndex=e.lastIndex,t}var ap=sn?sn.prototype:void 0,lp=ap?ap.valueOf:void 0;function vT(e){return lp?Object(lp.call(e)):{}}var yT="[object Boolean]",bT="[object Date]",wT="[object Map]",ST="[object Number]",TT="[object RegExp]",kT="[object Set]",CT="[object String]",xT="[object Symbol]",AT="[object ArrayBuffer]",ET="[object DataView]",RT="[object Float32Array]",DT="[object Float64Array]",PT="[object Int8Array]",IT="[object Int16Array]",FT="[object Int32Array]",$T="[object Uint8Array]",OT="[object Uint8ClampedArray]",LT="[object Uint16Array]",_T="[object Uint32Array]";function MT(e,t,n){var r=e.constructor;switch(t){case AT:return Ya(e);case yT:case bT:return new r(+e);case ET:return hT(e);case RT:case DT:case PT:case IT:case FT:case $T:case OT:case LT:case _T:return Ed(e,n);case wT:return new r;case ST:case CT:return new r(e);case TT:return gT(e);case kT:return new r;case xT:return vT(e)}}var NT="[object Map]";function BT(e){return Ln(e)&&Cn(e)==NT}var cp=so&&so.isMap,jT=cp?nl(cp):BT,zT="[object Set]";function UT(e){return Ln(e)&&Cn(e)==zT}var up=so&&so.isSet,VT=up?nl(up):UT,qT=1,dp="[object Arguments]",HT="[object Array]",WT="[object Boolean]",QT="[object Date]",KT="[object Error]",fp="[object Function]",GT="[object GeneratorFunction]",JT="[object Map]",XT="[object Number]",pp="[object Object]",YT="[object RegExp]",ZT="[object Set]",ek="[object String]",tk="[object Symbol]",nk="[object WeakMap]",rk="[object ArrayBuffer]",ok="[object DataView]",sk="[object Float32Array]",ik="[object Float64Array]",ak="[object Int8Array]",lk="[object Int16Array]",ck="[object Int32Array]",uk="[object Uint8Array]",dk="[object Uint8ClampedArray]",fk="[object Uint16Array]",pk="[object Uint32Array]",nt={};nt[dp]=nt[HT]=nt[rk]=nt[ok]=nt[WT]=nt[QT]=nt[sk]=nt[ik]=nt[ak]=nt[lk]=nt[ck]=nt[JT]=nt[XT]=nt[pp]=nt[YT]=nt[ZT]=nt[ek]=nt[tk]=nt[uk]=nt[dk]=nt[fk]=nt[pk]=!0,nt[KT]=nt[fp]=nt[nk]=!1;function Ai(e,t,n,r,o,s){var i,l=t&qT;if(n&&(i=o?n(e,r,o,s):n(e)),i!==void 0)return i;if(!$n(e))return e;var u=Tn(e);if(u)i=pT(e);else{var d=Cn(e),c=d==fp||d==GT;if(Qo(e))return Ad(e,l);if(d==pp||d==dp||c&&!o)i={};else{if(!nt[d])return o?e:{};i=MT(e,d,l)}}s||(s=new On);var p=s.get(e);if(p)return p;s.set(e,i),VT(e)?e.forEach(function(g){i.add(Ai(g,t,n,g,e,s))}):jT(e)&&e.forEach(function(g,m){i.set(m,Ai(g,t,n,m,e,s))});var f=ip,h=u?void 0:f(e);return lT(h||e,function(g,m){h&&(m=g,g=e[m]),Bd(i,m,Ai(g,t,n,m,e,s))}),i}function hk(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(o);++r<o;)s[r]=e[r+t];return s}function mk(e,t){return t.length<2?e:bf(e,hk(t,0,-1))}var gk=Object.prototype,vk=gk.hasOwnProperty;function yk(e,t){t=Al(t,e);var n=-1,r=t.length;if(!r)return!0;for(var o=e==null||typeof e!="object"&&typeof e!="function";++n<r;){var s=t[n];if(typeof s=="string"){if(s==="__proto__"&&!vk.call(e,"__proto__"))return!1;if(s==="constructor"&&n+1<r&&typeof t[n+1]=="string"&&t[n+1]==="prototype"){if(o&&n===0)continue;return!1}}}var i=mk(e,t);return i==null||delete i[yf(qc(t))]}function bk(e){return tl(e)?void 0:e}var hp=sn?sn.isConcatSpreadable:void 0;function wk(e){return Tn(e)||ci(e)||!!(hp&&e&&e[hp])}function Sk(e,t,n,r,o){var s=-1,i=e.length;for(n||(n=wk),o||(o=[]);++s<i;){var l=e[s];n(l)?Il(o,l):o[o.length]=l}return o}function Tk(e){var t=e==null?0:e.length;return t?Sk(e):[]}function kk(e){return Qd(Wd(e,void 0,Tk),e+"")}var Ck=1,xk=2,Ak=4,po=kk(function(e,t){var n={};if(e==null)return n;var r=!1;t=hf(t,function(s){return s=Al(s,e),r||(r=s.length>1),s}),jd(e,ip(e),n),r&&(n=Ai(n,Ck|xk|Ak,bk));for(var o=t.length;o--;)yk(n,t[o]);return n});const Ek=(e,t)=>{const n=(s="")=>s.split("/").filter(Boolean),r=n(e.path),o=n(t);return o.map((s,i)=>({id:Ct.v4(),allowContextActions:!0,text:s,to:{path:"/"+[...r].splice(0,r.length-o.length+i+1).join("/"),query:po(e.query,"fileId","page")},isStaticNav:!1}))},Rk=(...e)=>{const t=e.pop();return[...e,{id:Ct.v4(),allowContextActions:t.allowContextActions,text:t.text,onClick:()=>ze.publish("app.files.list.load"),isTruncationPlaceholder:t.isTruncationPlaceholder,isStaticNav:t.isStaticNav}]};class Zo{static Cut="cut";static Copy="copy"}const _l=e=>e.clientY===0,Ml=(e,t,n)=>{if(!e)return;let r=n;r.$el&&(r=n.$el);const o=r.getBoundingClientRect(),s=_l(t)?t.target?.getBoundingClientRect().top||0:t.clientY;e.setProps({getReferenceClientRect:()=>({width:0,height:0,top:s,bottom:s,left:t.type==="contextmenu"&&!_l(t)?t.clientX:o.x,right:t.type==="contextmenu"&&!_l(t)?t.clientX:o.x})}),e.show()},Ei=e=>(e||"").split("_")[0],Mr=(e,t,n=vt.DateTime.DATETIME_MED)=>e.setLocale(Ei(t)).toLocaleString(n),mp=(e,t,n=vt.DateTime.DATETIME_MED)=>Mr(vt.DateTime.fromJSDate(e),t,n),Dk=(e,t,n=vt.DateTime.DATETIME_MED)=>Mr(vt.DateTime.fromHTTP(e),t,n),gp=(e,t,n=vt.DateTime.DATETIME_MED)=>Mr(vt.DateTime.fromISO(e),t,n),Pk=(e,t,n=vt.DateTime.DATETIME_MED)=>Mr(vt.DateTime.fromRFC2822(e),t,n),es=(e,t)=>e.setLocale(Ei(t)).toRelative(),vp=(e,t)=>es(vt.DateTime.fromJSDate(e),t),Ik=(e,t)=>es(vt.DateTime.fromHTTP(e),t),Fk=(e,t)=>es(vt.DateTime.fromISO(e),t),$k=(e,t)=>es(vt.DateTime.fromRFC2822(e),t),Ok=1048576,Ht=(e,t)=>{const n=typeof e=="string"?parseInt(e):e;return n<0?"--":isNaN(n)?"?":Fg.filesize(n,{round:n<Ok?0:1,locale:Ei(t),base:10,output:"string"})};function yp(e="",t=!1){const n=z.urlJoin(e,{leadingSlash:!0});if(n==="/")return[];const r=[],o=n.split("/");for(t&&r.push(n),o.pop();o.length>0;){if(!o.join("/")){o.pop();continue}r.push(o.join("/")),o.pop()}return r}const Lk=({space:e,resource:t})=>{const{getIndicators:n}=Dc();return n({space:e,resource:t})},bp=e=>new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=o=>n(o),r.readAsArrayBuffer(e)}),wp=e=>new Promise(t=>e.toBlob(t)),ts=()=>window.navigator.platform.match("Mac");function Nr(e){return e.status==="fulfilled"}function Br(e){return e.status==="rejected"}const Nl=e=>new TextEncoder().encode(e).length,Me=we.defineStore("messages",()=>{const e=W([]),t=s=>{const i={...s,id:Ct.v4()};return e.value.push(i),i},n=s=>{const i=l=>l.response?.headers?.get("x-request-id");return s.map(l=>i(l)).filter(Boolean).map(l=>`X-Request-Id: ${l}`).join(`\r
9
+ `)};return{messages:e,showMessage:t,showErrorMessage:s=>{const i={id:Ct.v4(),status:"danger",timeout:0,...s.errors&&{errorLogContent:n(s.errors)},...s};return e.value.push(i),i},removeMessage:s=>{e.value=a(e).filter(({id:i})=>s.id!==i)}}}),ns=we.defineStore("clipboard",()=>{const{$gettext:e}=me.useGettext(),{showMessage:t}=Me(),n=W(),r=W([]);return{action:n,resources:r,copyResources:l=>{l[0]?.canDownload()&&(n.value=Zo.Copy,r.value=l,t({title:e("Copied to clipboard!"),status:"success"}))},cutResources:l=>{l[0]?.canDownload()&&(n.value=Zo.Cut,r.value=l,t({title:e("Cut to clipboard!"),status:"success"}))},clearClipboard:()=>{n.value=void 0,r.value=[]}}}),Sp=we.defineStore("extensionPreferences",()=>{const e=Rn.useLocalStorage("extensionPreferences",{});return{extensionPreferences:e,extractDefaultExtensionIds:(o,s)=>o.multiple?s.map(i=>i.id):o.defaultExtensionId?[o.defaultExtensionId]:[],getExtensionPreference:(o,s)=>{const i=e.value[o];return i||{extensionPointId:o,selectedExtensionIds:s}},setSelectedExtensionIds:(o,s)=>{if(!Object.hasOwn(a(e),o)){e.value[o]={extensionPointId:o,selectedExtensionIds:s};return}e.value[o].selectedExtensionIds=s}}}),ho=we.defineStore("extensionRegistry",()=>{const e=Ge(),t=W([]),n=d=>{t.value.push(d)},r=d=>{t.value=a(t).map(c=>W(a(c).filter(({id:p})=>!d.includes(p)))).filter(c=>a(c).length)},o=d=>{if(!d.id||!d.extensionType)throw new Error("ExtensionPoint must have an id and an extensionType");return a(t).flatMap(c=>a(c).filter(p=>p.type===d.extensionType&&!e.options.disabledExtensions.includes(p.id)&&(!p.extensionPointIds||p.extensionPointIds?.includes(d.id))))},s=W([]);return{extensions:t,registerExtensions:n,unregisterExtensions:r,requestExtensions:o,extensionPoints:s,registerExtensionPoints:d=>{s.value.push(d)},unregisterExtensionPoints:d=>{s.value=a(s).map(c=>W(a(c).filter(({id:p})=>!d.includes(p)))).filter(c=>a(c).length)},getExtensionPoints:(d={})=>a(s).flatMap(c=>a(c).filter(p=>!(Object.hasOwn(d,"extensionType")&&p.extensionType!==d.extensionType)))}}),_k=we.defineStore("groupwareConfig",()=>{const e=W(""),t=W([]),n=W(),r=W([]),o=W({});return{version:e,capabilities:t,limits:n,accounts:r,primaryAccounts:o,loadGroupwareConfig:i=>{e.value=i.version,t.value=i.capabilities||[],n.value=i.limits,r.value=i.accounts||[],o.value=i.primaryAccounts||{}}}}),Tp=K.z.object({maxMailboxDepth:K.z.number(),maxSizeMailboxName:K.z.number(),maxMailboxesPerEmail:K.z.number(),maxSizeAttachmentsPerEmail:K.z.number(),mayCreateTopLevelMailbox:K.z.boolean(),maxDelayedSend:K.z.number()}),kp=K.z.object({maxSizeScriptName:K.z.number(),maxSizeScript:K.z.number(),maxNumberScripts:K.z.number(),maxNumberRedirects:K.z.number()}),Cp=K.z.object({mail:Tp.optional(),sieve:kp.optional()}),xp=K.z.object({id:K.z.string(),name:K.z.string(),email:K.z.string().email(),mayDelete:K.z.boolean()}),Ap=K.z.object({accountId:K.z.string(),name:K.z.string(),isPersonal:K.z.boolean(),isReadOnly:K.z.boolean(),capabilities:Cp,identities:K.z.array(xp)}),Ep=K.z.object({maxSizeUpload:K.z.number(),maxConcurrentUpload:K.z.number(),maxSizeRequest:K.z.number(),maxConcurrentRequests:K.z.number()}),Rp=K.z.array(Ap),Dp=K.z.record(K.z.string(),K.z.string()),Mk=K.z.object({version:K.z.string(),capabilities:K.z.array(K.z.string()),limits:Ep,accounts:Rp,primaryAccounts:Dp}),Je=we.defineStore("modals",()=>{const e=W([]),t=A(()=>a(e).at(-1)),n=u=>a(e).find(d=>d.id===u);return{modals:e,activeModal:t,dispatchModal:u=>{const d={...u,id:Ct.v4()};return e.value.push(d),d},updateModal:(u,d,c)=>{const p=n(u);p[d]=c},removeModal:u=>{e.value=a(e).filter(d=>d.id!==u)},removeAllModals:()=>{e.value=[]},setModalActive:u=>{const d=a(e).findIndex(p=>p.id===u);if(d<0)return;const c=n(u);a(e).splice(d,1),e.value.push(c)}}}),et=we.defineStore("user",()=>{const e=W();return{user:e,setUser:r=>{e.value=r,Ng.setUser({username:r.onPremisesSamAccountName})},reset:()=>{e.value=null}}});function Nk(e,t,n,r){for(var o=-1,s=e==null?0:e.length;++o<s;)n=t(n,e[o],o,e);return n}function Bk(e){return function(t){return e?.[t]}}var jk={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},zk=Bk(jk),Uk=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Vk="\\u0300-\\u036f",qk="\\ufe20-\\ufe2f",Hk="\\u20d0-\\u20ff",Wk=Vk+qk+Hk,Qk="["+Wk+"]",Kk=RegExp(Qk,"g");function Gk(e){return e=xl(e),e&&e.replace(Uk,zk).replace(Kk,"")}var Jk=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Xk(e){return e.match(Jk)||[]}var Yk=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Zk(e){return Yk.test(e)}var Pp="\\ud800-\\udfff",eC="\\u0300-\\u036f",tC="\\ufe20-\\ufe2f",nC="\\u20d0-\\u20ff",rC=eC+tC+nC,Ip="\\u2700-\\u27bf",Fp="a-z\\xdf-\\xf6\\xf8-\\xff",oC="\\xac\\xb1\\xd7\\xf7",sC="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",iC="\\u2000-\\u206f",aC=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",$p="A-Z\\xc0-\\xd6\\xd8-\\xde",lC="\\ufe0e\\ufe0f",Op=oC+sC+iC+aC,Lp="['’]",_p="["+Op+"]",cC="["+rC+"]",Mp="\\d+",uC="["+Ip+"]",Np="["+Fp+"]",Bp="[^"+Pp+Op+Mp+Ip+Fp+$p+"]",dC="\\ud83c[\\udffb-\\udfff]",fC="(?:"+cC+"|"+dC+")",pC="[^"+Pp+"]",jp="(?:\\ud83c[\\udde6-\\uddff]){2}",zp="[\\ud800-\\udbff][\\udc00-\\udfff]",mo="["+$p+"]",hC="\\u200d",Up="(?:"+Np+"|"+Bp+")",mC="(?:"+mo+"|"+Bp+")",Vp="(?:"+Lp+"(?:d|ll|m|re|s|t|ve))?",qp="(?:"+Lp+"(?:D|LL|M|RE|S|T|VE))?",Hp=fC+"?",Wp="["+lC+"]?",gC="(?:"+hC+"(?:"+[pC,jp,zp].join("|")+")"+Wp+Hp+")*",vC="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",yC="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",bC=Wp+Hp+gC,wC="(?:"+[uC,jp,zp].join("|")+")"+bC,SC=RegExp([mo+"?"+Np+"+"+Vp+"(?="+[_p,mo,"$"].join("|")+")",mC+"+"+qp+"(?="+[_p,mo+Up,"$"].join("|")+")",mo+"?"+Up+"+"+Vp,mo+"+"+qp,yC,vC,Mp,wC].join("|"),"g");function TC(e){return e.match(SC)||[]}function kC(e,t,n){return e=xl(e),t=t,t===void 0?Zk(e)?TC(e):Xk(e):e.match(t)||[]}var CC="['’]",xC=RegExp(CC,"g");function AC(e){return function(t){return Nk(kC(Gk(t).replace(xC,"")),e,"")}}var Qp=AC(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const Kp=K.z.object({name:K.z.string().optional(),slogan:K.z.string().optional(),logo:K.z.string().optional(),logoMobile:K.z.string().optional(),urls:K.z.object({accessDeniedHelp:K.z.string().optional(),imprint:K.z.string().optional(),privacy:K.z.string().optional(),accessibility:K.z.string().optional()}).optional(),shareRoles:K.z.record(K.z.string(),K.z.object({iconName:K.z.string()})).optional()}),EC=K.z.object({roles:K.z.record(K.z.string(),K.z.string()).optional(),colorPalette:K.z.record(K.z.string(),K.z.string()).optional(),fontFamily:K.z.string().optional()}),Gp=Kp.extend({designTokens:EC.optional(),favicon:K.z.string().optional(),background:K.z.string().optional()}),RC=Gp.extend({isDark:K.z.boolean(),label:K.z.string()}),Jp=K.z.object({defaults:Gp,themes:K.z.array(RC)}),DC=K.z.object({common:Kp.optional(),clients:K.z.object({web:Jp})}),PC="oc_currentThemeName",IC=e=>{let t=document.querySelector("link[rel~='icon']");t||(t=document.createElement("link"),t.rel="icon",document.head.appendChild(t)),t.href=e},Bn=we.defineStore("theme",()=>{const e=Rn.useLocalStorage(PC,null),t=Rn.usePreferredDark(),n=W(),r=W([]),o=c=>{const p=c.common,f=c.clients.web.defaults,h=zc(p,f);r.value=c.clients.web.themes.map(g=>zc(h,g)),s()},s=()=>{const c=a(r).find(f=>!f.isDark),p=a(r).find(f=>f.isDark);u(a(r).find(f=>f.label===a(e))||(a(t)?p:c)||a(r)[0],!1)},i=()=>{e.value=null,s()},l=A(()=>e.value===null),u=(c,p=!0)=>{n.value=c,p&&(e.value=a(n).label);const f=[{name:"roles",prefix:"role"},{name:"colorPalette",prefix:"color"}];hi("font-family",a(n).designTokens.fontFamily),f.forEach(h=>{for(const g in a(n).designTokens[h.name])hi(`${h.prefix}-${Qp(g)}`,a(n).designTokens[h.name][g])}),a(n).designTokens?.roles?.chrome||(hi("role-chrome",a(n).designTokens?.roles?.surfaceContainer),hi("role-on-chrome",a(n).designTokens?.roles?.onSurface)),a(n).favicon&&IC(a(n).favicon)};return{availableThemes:r,currentTheme:n,initializeThemes:o,setAndApplyTheme:u,setAutoSystemTheme:i,isCurrentThemeAutoSystem:l,getRoleIcon:c=>a(n).shareRoles[c.id]?.iconName||"user"}}),tr=we.defineStore("shares",()=>{const e=De(),{getRoleIcon:t}=Bn(),n=W(!1),r=W([]),o=W([]),s=W({}),i=_=>{s.value=_.reduce((L,V)=>(L[V.id]={...V,icon:t(V)},L),{})},l=_=>{const L=a(r).find(({id:V})=>V===_.id);if(L){Object.assign(L,_);return}a(r).push(_)},u=_=>{r.value=_},d=_=>{a(r).push(..._)},c=_=>{r.value=a(r).filter(({id:L})=>L!==_.id)},p=()=>{r.value=[],o.value=[],n.value=void 0},f=()=>{const _=Object.values(e.ancestorMetaData).map(({id:L})=>L);if(!_.length){r.value=[],o.value=[];return}a(r).forEach(L=>{_.includes(L.resourceId)||c(L)}),a(o).forEach(L=>{_.includes(L.resourceId)||m(L)})},h=_=>{o.value=_},g=_=>{const L=a(o).find(({id:V})=>V===_.id);if(L){Object.assign(L,_);return}a(o).push(_)},m=_=>{o.value=a(o).filter(({id:L})=>L!==_.id)},w=_=>{n.value=_},T=_=>{const L=O=>{const M=new Set;return O.forEach(N=>{M.add(N.shareType)}),Array.from(M)},V=[...e.resources,e.currentFolder].find(O=>O?.id===_);if(!V||z.isProjectSpaceResource(V))return;const te=[...a(r),...a(o)];e.updateResourceField({id:V.id,field:"shareTypes",value:L(te.filter(O=>!O.indirect))});const B=e.getAncestorById(_);B&&e.updateAncestorField({path:B.path,field:"shareTypes",value:L(te.filter(O=>!O.indirect))})};return{loading:n,collaboratorShares:r,linkShares:o,graphRoles:s,setGraphRoles:i,setLoading:w,setCollaboratorShares:u,setLinkShares:h,removeOrphanedShares:f,pruneShares:p,addShare:async({clientService:_,space:L,resource:V,options:te})=>{const O=await _.graphAuthenticated.permissions.createInvite(L.id,V.id,te,a(s));return d([O]),T(V.id),O},updateShare:async({clientService:_,space:L,resource:V,collaboratorShare:te,options:B})=>{const O=_.graphAuthenticated.permissions,M={roles:B.roles,expirationDateTime:B.expirationDateTime},N=await O.updatePermission(L.id,V.id,te.id,M,a(s));return l(N),N},deleteShare:async({clientService:_,space:L,resource:V,collaboratorShare:te})=>{await _.graphAuthenticated.permissions.deletePermission(L.id,V.id,te.id),c(te),T(V.id)},addLink:async({clientService:_,space:L,resource:V,options:te})=>{const O=await _.graphAuthenticated.permissions.createLink(L.id,V.id,te),M=e.selectedResources,N=M.some(({fileId:q})=>q===V.fileId)||M.length===0&&e.currentFolder.fileId===V.fileId;if(g(O),T(V.id),!N){const q=e.ancestorMetaData[V.path]??null;if(q){const{shareTypes:j}=q;j.includes(z.ShareTypes.link.value)||e.updateAncestorField({path:q.path,field:"shareTypes",value:[...j,z.ShareTypes.link.value]})}}return O},updateLink:async({clientService:_,space:L,resource:V,linkShare:te,options:B})=>{const O=_.graphAuthenticated.permissions;let M;if(Object.hasOwn(B,"password"))M=await O.setPermissionPassword(L.id,V.id,te.id,{password:B.password}),te.hasPassword=!!B.password;else{const N={link:{...B.type&&{type:B.type},...B.displayName&&{"@libre.graph.displayName":B.displayName}},...Object.hasOwn(B,"expirationDateTime")&&{expirationDateTime:B.expirationDateTime}};M=await O.updatePermission(L.id,V.id,te.id,N)}return g(M),M},deleteLink:async({clientService:_,space:L,resource:V,linkShare:te})=>{await _.graphAuthenticated.permissions.deletePermission(L.id,V.id,te.id),m(te),T(V.id)}}}),Wt={View:"view",Upload:"upload",Edit:"edit",CreateOnly:"createOnly"},Xp={LibreGraphPermissionsActionsAllowedValues:"@libre.graph.permissions.actions.allowedValues",LibreGraphPermissionsRolesAllowedValues:"@libre.graph.permissions.roles.allowedValues"},Yp=e=>e.sort((t,n)=>n.permissions.length-t.permissions.length),rs=async({graphClient:e,driveType:t,configStore:n,signal:r})=>{const o=await e.drives.listMyDrives({orderBy:"name asc",filter:`driveType eq ${t}`},{signal:r});if(!o.length)return[];if(t!=="mountpoint"||!n.options.routing?.fullShareOwnerPaths)return o;const s={};o.forEach(l=>{const{rootId:u,driveAlias:d}=l.root.remoteItem;s[u]=d});const i=Object.entries(s).map(([l,u])=>z.buildSpace({id:z.extractStorageId(l),name:u,driveType:u.split("/")[0],driveAlias:u,path:"/",serverUrl:n.serverUrl}));return[...o,...i]},He=we.defineStore("spaces",()=>{const e=et(),t=Ge(),n=tr(),r=W([]),o=W(),s=W(!1),i=W(!1),l=W(!1),u=W(null),d=W([]),c=W([]),p=A(()=>a(r).find(Y=>z.isPersonalSpaceResource(Y)&&Y.isOwner(e.user))),f=Y=>{s.value=Y},h=Y=>{i.value=Y},g=Y=>{l.value=Y},m=Y=>{o.value=Y},w=Y=>{u.value=Y},T=Y=>{if(!z.isProjectSpaceResource(Y))return[];const ae=n.collaboratorShares.filter(ne=>ne.resourceId===Y.id);return Yp(ae)},k=Y=>{a(r).push(...Y)},S=Y=>{r.value=a(r).filter(({id:ae})=>ae!==Y.id)},y=Y=>a(r).find(ae=>Y==ae.id),E=async({graphClient:Y,space:ae,signal:ne})=>(await V({graphClient:Y,signal:ne}),a(r).find(pe=>z.isMountPointSpaceResource(pe)&&pe.root?.remoteItem?.id===ae.id)),D=({driveAliasPrefix:Y,id:ae,shareName:ne})=>{const pe=z.buildShareSpaceResource({driveAliasPrefix:Y,id:ae,shareName:ne,serverUrl:t.serverUrl});return k([pe]),pe},$=Y=>{const ae=a(r).find(({id:ne})=>ne===Y.id);if(ae){Object.assign(ae,Y);return}k([Y])},_=({id:Y,field:ae,value:ne})=>{const pe=a(r).find(fe=>Y===fe.id);pe&&(pe[ae]=ne)},L=async({graphClient:Y})=>{l.value=!0;try{const[ae,ne]=await Promise.all([rs({graphClient:Y,driveType:"personal",configStore:t}),rs({graphClient:Y,driveType:"project",configStore:t})]);k([...ae,...ne])}finally{l.value=!1}},V=async({graphClient:Y,signal:ae})=>{if(!a(i))try{const ne=await rs({graphClient:Y,driveType:"mountpoint",configStore:t,signal:ae});k(ne)}finally{i.value=!0}},te=async({graphClient:Y,signal:ae})=>{const ne=await rs({graphClient:Y,driveType:"project",configStore:t,signal:ae});r.value=a(r).filter(pe=>!z.isProjectSpaceResource(pe)),k(ne)},B=Y=>{a(d).includes(Y)||a(d).push(Y)},O=Y=>{d.value=a(d).filter(ae=>ae!==Y)},M=()=>{d.value=[]},N=Y=>{a(c).includes(Y)||a(c).push(Y)},q=Y=>{c.value=a(c).filter(ae=>ae!==Y)},j=()=>{c.value=[]},H=W({});return{spaces:r,spacesInitialized:s,mountPointsInitialized:i,spacesLoading:l,currentSpace:o,personalSpace:p,defaultSpaceImageBlobURL:u,imagesLoading:d,readmesLoading:c,getSpace:y,createShareSpace:D,setSpacesInitialized:f,setMountPointsInitialized:h,setSpacesLoading:g,setCurrentSpace:m,setDefaultSpaceImageBlobURL:w,getSpaceMembers:T,getMountPointForSpace:E,addSpaces:k,removeSpace:S,upsertSpace:$,updateSpaceField:_,loadSpaces:L,loadMountPoints:V,reloadProjectSpaces:te,addToImagesLoading:B,removeFromImagesLoading:O,purgeImagesLoading:M,addToReadmesLoading:N,removeFromReadmesLoading:q,purgeReadmesLoading:j,loadGraphPermissions:async({ids:Y,graphClient:ae,useCache:ne=!0})=>{const pe=a(r).filter(fe=>Y.includes(fe.id)&&(fe.graphPermissions===void 0||!ne));if(pe.length){for(const{id:fe,disabled:be}of pe){if(be){_({id:fe,field:"graphPermissions",value:[]});continue}a(H)[fe]||(H.value[fe]=ae.permissions.listPermissions(fe,fe,n.graphRoles,{select:[Xp.LibreGraphPermissionsActionsAllowedValues]}).then(({allowedActions:xe})=>{_({id:fe,field:"graphPermissions",value:xe}),delete H.value[fe]}))}await Promise.all(Object.values(a(H)))}}}}),De=we.defineStore("resources",()=>{const e=Ge(),t=He(),n=et(),r=W([]),o=W(),s=W({}),i=W([]),l=A(()=>{let ie=a(r);return a(B)||(ie=ie.filter(de=>!de.name.startsWith("."))),ie}),u=A(()=>{const ie=a(r).filter(({type:Ve})=>Ve==="file").length,de=a(r).filter(({type:Ve,name:lt})=>Ve==="file"&&lt.startsWith(".")).length,ue=a(r).filter(({type:Ve})=>Ve==="folder").length,Se=a(r).filter(({type:Ve,name:lt})=>Ve==="folder"&&lt.startsWith(".")).length,$e=a(r).filter(z.isProjectSpaceResource).length;return{files:ie,hiddenFiles:de,folders:ue,hiddenFolders:Se,spaces:$e}}),d=ie=>{r.value=ie},c=ie=>{r.value=a(r).filter(de=>!ie.find(({id:ue})=>ue===de.id))},p=()=>{r.value=[]},f=ie=>{const de=a(r).find(({id:ue})=>ue===ie.id);if(de){Object.assign(de,ie);return}a(r).push(ie)},h=ie=>{const de=a(r).filter(ue=>!ie.some(Se=>Se.path===ue.path));r.value=[...de,...ie]},g=({id:ie,field:de,value:ue})=>{const Se=a(r).find($e=>ie===$e.id);Se&&(Se[de]=ue)},m=ie=>{o.value=ie},w=()=>{o.value=void 0},T=ie=>{r.value=ie.resources,o.value=ie.currentFolder},k=()=>{r.value=[],o.value=void 0,S.value=[]},S=W([]),y=W(null),E=A(()=>a(r).filter(ie=>a(S).includes(ie.id))),D=ie=>{const de=ie.find(ue=>!a(S).includes(ue));de&&(y.value=de),S.value=ie},$=ie=>{y.value=ie,a(S).includes(ie)||a(S).push(ie)},_=ie=>{y.value=ie,a(S).includes(ie)&&(S.value=a(S).filter(de=>de!==ie))},L=ie=>{a(S).includes(ie)?_(ie):$(ie)},V=()=>{S.value=[]},te=ie=>{y.value=ie},B=W(!0),O=W(!0),M=W(!1),N=W(!0),q=W(!0),j=ie=>{B.value=ie,window.localStorage.setItem("oc_hiddenFilesShown",ie.toString())},H=ie=>{O.value=ie,window.localStorage.setItem("oc_fileExtensionsShown",ie.toString())},se=ie=>{M.value=ie,window.localStorage.setItem("oc_webDavDetailsShown",ie.toString())},Y=ie=>{N.value=ie,window.localStorage.setItem("oc_disabledSpacesShown",ie.toString())},ae=ie=>{q.value=ie,window.localStorage.setItem("oc_emptyTrashesShown",ie.toString())},ne=ie=>{s.value=ie};return{resources:r,currentFolder:o,activeResources:l,totalResourcesCount:u,setResources:d,removeResources:c,clearResources:p,upsertResource:f,upsertResources:h,updateResourceField:g,setCurrentFolder:m,clearCurrentFolder:w,initResourceList:T,clearResourceList:k,selectedIds:S,latestSelectedId:y,selectedResources:E,setSelection:D,addSelection:$,removeSelection:_,toggleSelection:L,resetSelection:V,setLastSelectedId:te,areHiddenFilesShown:B,areFileExtensionsShown:O,areWebDavDetailsShown:M,areDisabledSpacesShown:N,areEmptyTrashesShown:q,setAreHiddenFilesShown:j,setAreFileExtensionsShown:H,setAreWebDavDetailsShown:se,setAreDisabledSpacesShown:Y,setAreEmptyTrashesShown:ae,ancestorMetaData:s,setAncestorMetaData:ne,updateAncestorField:({path:ie,field:de,value:ue})=>{const Se=a(s)[ie]??null;Se&&(Se[de]=ue)},loadAncestorMetaData:({folder:ie,space:de,client:ue,signal:Se})=>{const $e={[ie.path]:{id:ie.fileId,shareTypes:ie.shareTypes,parentFolderId:ie.parentFolderId,spaceId:de.id,path:ie.path}},Ve=[],lt=[Ee.FileId,Ee.ShareTypes,Ee.FileParent],Tt=yp(ie.path),ut=t.spaces,gt=()=>ut.filter(ke=>z.isMountPointSpaceResource(ke)&&z.extractStorageId(ke.root.remoteItem.rootId)===de.id);let ve=!0;if(e.options.routing.fullShareOwnerPaths){const ke=ut.some(qe=>z.isProjectSpaceResource(qe)&&qe.id===de.id);ve=de.isOwner(n.user)||ke}for(const ke of Tt){const qe=a(s)[ke]??null;if(qe?.spaceId===de.id){$e[ke]=qe;continue}if(!ve&&!gt().find(We=>ke.startsWith(We.root.remoteItem.path)))break;Ve.push(ue.listFiles(de,{path:ke},{depth:0,davProperties:lt,signal:Se}).then(({resource:We})=>{$e[ke]={id:We.fileId,shareTypes:We.shareTypes,parentFolderId:We.parentFolderId,spaceId:de.id,path:ke}}))}return Promise.all(Ve).then(()=>{if(!Object.keys($e).includes("/")){const ke=a(s)["/"];if(ke?.spaceId===de.id)$e["/"]=ke;else{const{parentFolderId:qe}=Object.values($e)[0],We=t.spaces.find(({id:Jt})=>qe.startsWith(Jt));We&&($e["/"]={id:We.id,shareTypes:We.shareTypes,parentFolderId:We.id,spaceId:We.id,path:"/"})}}ne($e)})},getAncestorById:ie=>Object.values(a(s)).find(de=>ie===de.id),deleteQueue:i,addResourcesIntoDeleteQueue:ie=>{i.value=i.value.concat(ie.filter(de=>!a(i).includes(de)))},removeResourcesFromDeleteQueue:ie=>{i.value=i.value.filter(de=>!ie.includes(de))}}}),Bl=(e,t=void 0)=>{const n=window.localStorage.getItem(e),r=W(t);if(n)try{r.value=JSON.parse(n)}catch{r.value=n}return Ue(()=>a(r),(o,s)=>{o!==s&&(o!==void 0?window.localStorage.setItem(e,typeof o=="string"?o:JSON.stringify(o)):window.localStorage.removeItem(e))},{deep:!0}),r},Tr=()=>{const e=Ge(),t=A(()=>e.options.embed?.enabled),n=A(()=>e.options.embed?.target==="location"),r=A(()=>e.options.embed?.chooseFileName),o=A(()=>e.options.embed?.chooseFileNameSuggestion),s=A(()=>e.options.embed?.target==="file"),i=A(()=>e.options.embed?.fileTypes),l=A(()=>e.options.embed?.messagesOrigin),u=A(()=>a(t)&&e.options.embed?.delegateAuthentication),d=A(()=>e.options.embed?.delegateAuthenticationOrigin);return{isEnabled:t,isLocationPicker:n,chooseFileName:r,chooseFileNameSuggestion:o,isFilePicker:s,messagesTargetOrigin:l,isDelegatingAuthentication:u,fileTypes:i,postMessage:(f,h)=>{const g={};a(l)&&(g.targetOrigin=a(l)),window.parent.postMessage({name:f,data:h},g)},verifyDelegatedAuthenticationOrigin:f=>a(d)?a(d)===f:!0}},Zp=({target:e,mode:t="show",rootMargin:n="100px",onVisibleCallback:r})=>{if(!(window&&"IntersectionObserver"in window))return{isVisible:W(!0)};const s=W(!1),i=new IntersectionObserver(l=>{const u=l.at(-1).isIntersecting;s.value=u,a(s)&&r&&r(),t!=="showHide"&&s.value&&i.unobserve(e.value)},{rootMargin:n});return Ue(e,()=>{i.observe(e.value)}),bn(()=>i.disconnect()),{isVisible:s}},os=()=>{const{width:e}=Rn.useWindowSize();return{isMobile:A(()=>e.value<640)}},FC=we.defineStore("bottomDrawers",()=>{const e=W([]),t=A(()=>a(e).length?a(e)[a(e).length-1]:null);return{drawers:e,currentDrawer:t,showDrawer:()=>{const s={id:_r()};return e.value.push(s),s},closeDrawer:s=>{e.value=a(e).filter(i=>i.id!==s)},closeAllDrawers:()=>{e.value=[]}}});var eh=(e=>(e.open="sidebar.open",e.close="sidebar.close",e.toggle="sidebar.toggle",e.openWithPanel="sidebar.openWithPanel",e.setActivePanel="sidebar.setActivePanel",e))(eh||{});const _t=we.defineStore("sideBar",()=>{const{isEnabled:e}=Tr(),t=Bl("oc_sideBarOpen",!1),{isMobile:n}=os(),r=W(!1),o=W(null),s=A({get(){return a(e)?a(r):a(t)},set(g){if(a(e)){r.value=g;return}t.value=g}}),i=async()=>{await xt();const g=document.getElementById("app-sidebar");g&&g.focus()},l=()=>{s.value=!a(s),a(s)&&i()},u=()=>{s.value=!1,o.value=null},d=()=>{s.value=!0,o.value=null,i()},c=g=>{s.value=!0,o.value=g,i()},p=g=>{o.value=g};return ze.subscribe("sidebar.toggle",l),ze.subscribe("sidebar.close",u),ze.subscribe("sidebar.open",d),ze.subscribe("sidebar.openWithPanel",c),ze.subscribe("sidebar.setActivePanel",p),{isSideBarOpen:s,sideBarActivePanel:o,focusSidebar:i,onInitialLoad:()=>{a(n)&&(s.value=!1)},toggleSideBar:l,closeSideBar:u,openSideBar:d,openSideBarPanel:c,setActiveSideBarPanel:p,onPanelActive:(g,m)=>{ze.subscribe("sidebar.setActivePanel",w=>{g===w&&setTimeout(()=>{m(w)},100)})}}}),th=we.defineStore("updates",()=>{const e=W(!0),t=W(!1),n=W();return{updates:n,isLoading:e,hasError:t,setUpdates:i=>{n.value=i},setHasError:i=>{t.value=i},setIsLoading:i=>{e.value=i}}}),ss=we.defineStore("webWorkers",()=>{const e=W([]);return{createWorker:(s,{needsTokenRenewal:i=!1}={})=>{const l=Ct.v4(),u=Rn.useWebWorker(s,{type:"module",name:l}),d={id:l,needsTokenRenewal:i,...u};return a(e).push(d),d},terminateWorker:s=>{const i=a(e).find(l=>s===l.id);i&&(i.terminate(),e.value=a(e).filter(l=>s!==l.id))},terminateAllWorkers:()=>{a(e).forEach(({terminate:s})=>{s()}),e.value=[]},updateAccessTokens:s=>{a(e).filter(({needsTokenRenewal:i})=>i).forEach(({post:i})=>{i(JSON.stringify({topic:"tokenUpdate",data:{accessToken:`Bearer ${s}`}}))})}}}),Ri=(e={})=>{const t=e.router||Re(),n=e.configStore||Ge();return{replaceInvalidFileRoute:({space:o,resource:s,path:i,fileId:l})=>{if(!n.options.routing?.idBased||i===s.path&&l===s.fileId)return!1;const u=_n(o,s,{configStore:n});return t.replace(u),!0}}},jl=()=>{const e=St();return A(()=>a(e).name)},nh=(e,t)=>{const n=St();return A(()=>a(n).meta[e]||t)},Di=(e,t)=>{const n=Re();return A({get(){return at(a(n.currentRoute).params[e])||t},async set(r){a(n.currentRoute).params[e]!==r&&await n.replace({params:{...a(n.currentRoute).params,[e]:r}})}})};let rh=Promise.resolve();const Pt=(e,t)=>{const n=Re();return A({get(){return a(n.currentRoute).query[e]||t},set(r){if(a(n.currentRoute).query[e]===r)return;rh=rh.then(async()=>{try{await n.replace({path:a(n.currentRoute).path,query:{...a(n.currentRoute).query,[e]:r}})}catch{}})}})},nr=e=>{const t=Pt(e.name),n=Bl($C(e));return Ue(()=>a(t)?{value:a(t),source:"route"}:a(n)?{value:a(n),source:"storage"}:{value:e.defaultValue,source:"default"},r=>{["route","default"].includes(r.source)&&(n.value=r.value===e.defaultValue?void 0:at(r.value)),["storage","default"].includes(r.source)&&(t.value=r.value)},{immediate:!0}),t},$C=e=>["oc-options",e.storagePrefix,e.name].filter(Boolean).join("_"),xn=(e,...t)=>{const n=W(!1),r=Re(),o=St();return Ue(o,()=>{n.value=e(r,...t)},{immediate:!0}),n},Pi="contextRouteName",zl="contextRouteParams",Ul="contextRouteQuery",Ii=e=>{const{params:t,query:n}=e,r={},o=["fileId","shareId","q_share-visibility","page"].concat(e.meta?.contextQueryItems||[]);for(const s of o)r[s]=n[s];return{[Pi]:e.name,[zl]:t,[Ul]:r}},oh=e=>({routeName:at(e[Pi]),routeParams:e[zl],routeQuery:e[Ul]}),at=e=>Array.isArray(e)?e[0].toString():e?.toString();function sh({router:e,currentFileContext:t}){const n=l=>{const{fileName:u,routeName:d,routeParams:c,routeQuery:p}=a(l);return a(d)?e.push({name:a(d),params:a(c),query:{...a(p),scrollTo:a(u)}}):e.push({path:"/"})},{replaceInvalidFileRoute:r}=Ri({router:e}),o=(l,u)=>{const d=a(l);return r({space:a(d.space),resource:u,path:a(d.item),fileId:a(d.itemId)})},s=W(!1);return{replaceInvalidFileRoute:o,closeApp:()=>(s.value=!0,n(t)),closed:s}}const Pe=()=>er("$clientService");function Vl({clientService:e}){e=e||Pe();const t=et();return{getUrlForResource:(l,u,d)=>e.webdav.getFileUrl(l,u,{username:t.user?.onPremisesSamAccountName,...d}),revokeUrl:l=>e.webdav.revokeUrl(l),getFileContents:(l,u)=>e.webdav.getFileContents(a(a(l).space),{path:a(a(l).item)},{...u}),getFileInfo:(l,u={})=>e.webdav.getFileInfo(a(a(l).space),{path:a(a(l).item),fileId:a(a(l).itemId)},u),putFileContents:(l,u)=>e.webdav.putFileContents(a(a(l).space),{path:a(a(l).item),...u})}}const ql=()=>er("$authService");class jr{static allFiles="all-files";static currentFolder="current-folder"}const Hl=()=>{const e=Ge(),t=Pe(),n=He(),r=De(),o=Dt(),s=A(()=>o.searchContent?.enabled),i=A(()=>r.areHiddenFilesShown),l=A(()=>n.spaces.filter(z.isProjectSpaceResource)),u=f=>a(l).find(h=>h.id===f),d=$t.useTask(function*(f,h,g=null){if(e.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:t.graphAuthenticated,signal:f})),!h)return{totalResults:null,values:[]};const{resources:m,totalResults:w}=yield*z.call(t.webdav.search(h,{searchLimit:g,davProperties:Jo.Default,signal:f}));return{totalResults:w,values:m.map(T=>{const k=u(T.parentFolderId),S=k||T;return e.options.routing.fullShareOwnerPaths&&S.remoteItemPath&&(S.path=z.urlJoin(S.remoteItemPath,S.path)),{id:S.id,data:S}}).filter(({data:T})=>!T.name.startsWith(".")||a(i))}}).restartable();return{search:async(f,h=null)=>await d.perform(f,h),buildSearchTerm:({term:f,isTitleOnlySearch:h,tags:g,lastModified:m,mediaType:w,scope:T,useScope:k})=>{const S=[],y=f,E=a(s)&&!h;if(y){let D=`name:"*${y}*"`;E&&(D=`(name:"*${y}*" OR content:"${y}")`),S.push(D)}if(k&&T&&S.push(`scope:${T}`),g){const D=g.split("+").map($=>`"${$}"`);S.push(`tag:(${D.join(" OR ")})`)}if(m&&S.push(`mtime:${m}`),w){const D=w.split("+").map($=>`"${$}"`);S.push(`mediatype:(${D.join(" OR ")})`)}return S.sort((D,$)=>Number(D.startsWith("scope:"))-Number($.startsWith("scope:"))).join(" AND ")}}};function ih({currentRoute:e,clientService:t}){const n=W(!1),{webdav:r}=t,{replaceInvalidFileRoute:o}=Ri(),{getFileInfo:s}=Vl({clientService:t}),i=ql(),l=He(),{buildSearchTerm:u,search:d}=Hl(),c=Pt("contextRouteQuery"),p=De(),{activeResources:f}=we.storeToRefs(p);return{isFolderLoading:n,loadFolderForFileContext:async g=>{n.value=!0;try{if(g=a(g),a(c)?.term){const D=u({term:a(c)?.term}),{values:$}=await d(D,200),_=$.filter(({data:L})=>z.isSearchResource(L)).map(L=>L.data);p.initResourceList({currentFolder:null,resources:_}),n.value=!1;return}if(["files-shares-with-me","files-shares-with-others","files-shares-via-link","files-common-favorites"].includes(a(g.routeName))){await Nf.getTask().perform(),n.value=!1;return}p.clearResourceList();const w=a(g.space),T=await s(g,{davProperties:[Ee.FileId]});if(o({space:w,resource:T,path:a(g.item),fileId:a(g.itemId)}),l.spaces.some(D=>z.isMountPointSpaceResource(D)&&D.root.remoteItem?.id===T.id)){const D=await s(g);p.initResourceList({currentFolder:D,resources:[D]}),n.value=!1;return}const S=Ke.dirname(T.path),{resource:y,children:E}=await r.listFiles(w,{path:S});y.type==="file"?p.initResourceList({currentFolder:y,resources:[y]}):p.initResourceList({currentFolder:y,resources:E})}catch(m){if(m.statusCode===401)return i.handleAuthError(a(e));p.setCurrentFolder(null),console.error(m)}n.value=!1},activeFiles:f}}function Wl({appsStore:e,applicationId:t}){return{applicationMeta:A(()=>{const r=e.apps[t];if(!r)throw new Error(`useAppConfig: could not find config for applicationId: ${t}`);return r||{}})}}const rr=()=>ze;function ah({titleSegments:e,eventBus:t}){const n=Bn(),{currentTheme:r}=we.storeToRefs(n);t=t||rr(),Ue(e,o=>{const s=a(o),i=" - ",l={shortDocumentTitle:s.join(i),fullDocumentTitle:[...s,a(r).name].join(i)};t.publish("runtime.documentTitle.changed",l)},{immediate:!0,deep:!0})}function OC({appsStore:e,applicationId:t,applicationName:n,currentFileContext:r,currentRoute:o}){const s=Wl({applicationId:t,appsStore:e}),{$gettext:i}=me.useGettext(),l=A(()=>{const u=Ke.basename(a(a(r)?.fileName))||i(a(o)?.meta?.title||""),d=a(a(s).applicationMeta);return[u,a(n)||d.name||d.id].filter(Boolean)});ah({titleSegments:l})}function lh(e={}){const t=e.clientService??Pe(),n=e.authStore??Lr();return{makeRequest:(o,s,i={})=>{const l=!n.accessToken||n.publicLinkContextReady?t.httpUnAuthenticated:t.httpAuthenticated,u=new Sl({accessToken:n.accessToken,publicLinkToken:n.publicLinkToken,publicLinkPassword:n.publicLinkPassword});return i.method=o,i.url=s,i.headers={...u.getHeaders(),...i?.headers||{}},l.request(i)}}}const ch=()=>{const e=He();return{areSpacesLoading:A(()=>!e.spacesInitialized||e.spacesLoading)}},uh=(e={})=>{const t=He(),{areSpacesLoading:n}=ch(),r=Pt("shareId"),o=Pt("fileId"),s=A(()=>at(a(o))),i=Ge(),l=Pe(),u=A(()=>t.spaces),d=W(null),c=W(null),p=W(!1),f=h=>{const g=h.split("/");return a(u).find(m=>{if(!h.startsWith(m.driveAlias))return!1;const w=m.driveAlias.split("/");return g.length<w.length||g.slice(0,w.length).join("/")!==m.driveAlias?!1:m})};return Qs(()=>{const h=a(e.driveAliasAndItem);!h?.startsWith("personal/")&&!h?.startsWith("project/")&&t.setCurrentSpace(null)}),Ue([e.driveAliasAndItem,n],async([h,g],[m,w])=>{if(h===m&&g===w)return;if(!h||h.startsWith("virtual/")){d.value=null,c.value=null;return}if(a(d)&&h.startsWith(a(d).driveAlias)){c.value=z.urlJoin(h.slice(a(d).driveAlias.length),{leadingSlash:!0});return}let k=null,S=null;if(h.startsWith("public/")||h.startsWith("ocm/")){const[y,...E]=h.split("/").slice(1);k=a(u).find(D=>D.id===y),S=E.join("/")}else if(h.startsWith("share/")||h.startsWith("ocm-share/")){const[y,...E]=h.split("/").slice(1),D=h.startsWith("ocm-share/")?"ocm-share":"share";let $=at(a(r));$?.includes(":")&&($=[z.SHARE_JAIL_ID,$].join("!")),k=t.getSpace($)||t.createShareSpace({driveAliasPrefix:D,id:$,shareName:a(y)}),S=E.join("/")}else a(s)?k=a(u).find(y=>a(s).startsWith(`${y.fileId}`)):k=f(h),k||(!t.mountPointsInitialized&&i.options.routing.fullShareOwnerPaths&&(p.value=!0,await t.loadMountPoints({graphClient:l.graphAuthenticated})),k=f(h)),k&&(S=h.slice(k.driveAlias.length));d.value=k,c.value=z.urlJoin(S,{leadingSlash:!0}),p.value=!1},{immediate:!0,deep:!0}),Ue(d,h=>{t.setCurrentSpace(h)},{immediate:!0}),{space:d,item:c,itemId:s,loading:p}};function dh(e){const t=Re(),n=Mn(),r=St(),o=e.clientService??Pe(),s=e.applicationId,i=Lr(),{publicLinkContextReady:l}=we.storeToRefs(i),u=Di("driveAliasAndItem"),{space:d,item:c,itemId:p,loading:f}=uh({driveAliasAndItem:u}),h=A(()=>{if(a(f))return null;let g;return a(d)?g=z.urlJoin(a(d).webDavPath,a(c)):g=z.urlJoin(at(a(r).params.filePath)),{path:g,driveAliasAndItem:a(u),space:a(d),item:a(c),itemId:a(p),fileName:Ke.basename(g),routeName:at(a(r).query[Pi]),...oh(a(r).query)}});return OC({appsStore:n,applicationId:s,applicationName:e.applicationName,currentFileContext:h,currentRoute:r}),{isPublicLinkContext:l,currentFileContext:h,...Zd({appsStore:n,...e}),...sh({router:t,currentFileContext:h}),...Vl({clientService:o}),...ih({clientService:o,currentRoute:r}),...lh({clientService:o,currentRoute:a(r)})}}const LC=e=>({meta:{...e.meta,authContext:"anonymous"},path:e.path,redirect:t=>{const n=e.redirect(t);return console.warn(`route "${e.path}" is deprecated, use "${String(n.path)||String(n.name)}" instead.`),n}}),_C=()=>[{path:"/list",redirect:e=>kn("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:"personal/home"}})},{path:"/list/all/:item(.*)",redirect:e=>kn("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:z.urlJoin("personal/home",at(e.params.item),{leadingSlash:!1})}})},{path:"/list/favorites",redirect:e=>lo("files-common-favorites",e)},{path:"/list/shared-with-me",redirect:e=>an("files-shares-with-me",e)},{path:"/list/shared-with-others",redirect:e=>an("files-shares-with-others",e)},{path:"/list/shared-via-link",redirect:e=>an("files-shares-via-link",e)},{path:"/trash-bin",redirect:e=>wr("files-trash-generic",e)},{path:"/public/list/:item(.*)",redirect:e=>co("files-public-link",e)},{path:"/private-link/:fileId",redirect:e=>({name:"resolvePrivateLink",params:{fileId:e.params.fileId}})},{path:"/public-link/:token",redirect:e=>({name:"resolvePublicLink",params:{token:e.params.token}})}].map(LC),MC=(e,...t)=>{const[n,...r]=t.map(o=>{const s={"files-personal":kn("files-spaces-generic").name,"files-favorites":lo("files-common-favorites").name,"files-shared-with-others":an("files-shares-with-others").name,"files-shared-with-me":an("files-shares-with-me").name,"files-trashbin ":wr("files-trash-generic").name,"files-public-list":co("files-public-link").name}[o.name.toString()];return s&&console.warn(`route name "${name}" is deprecated, use "${s.toString()}" instead.`),{...o,...!!s&&{name:s}}});return al(e,n,...r)},NC={name:"root",path:"/",redirect:e=>kn("files-spaces-generic",e)},BC=e=>[NC,...cS(e),...fS(e),...pS(e),...uS(e),...hS(e),..._C()],Fi=()=>{const e=Pe();return{getDefaultMetaFolder:async n=>{const{children:r}=await e.webdav.listFiles(n);return r.find(({name:o})=>o===".space")}}},It=e=>{const t=et(),n=He(),r=Ge(),o=A(()=>n.spaces),s=Di("driveAliasAndItem"),i=p=>a(e?.space)||a(o).find(f=>f.id===p),l=p=>{let f=p.storageId;(a(s)?.startsWith("public/")||a(s)?.startsWith("ocm/"))&&(f=a(s).split("/")[1]);const h=i(f);if(h&&!z.isMountPointSpaceResource(h))return h;const g=z.isShareResource(p)&&p.shareTypes.includes(z.ShareTypes.remote.value)||p?.id?.toString().startsWith(z.OCM_PROVIDER_ID)?"ocm-share":"share";let m;return p.remoteItemPath?m=Ke.basename(p.remoteItemPath):a(s)?.startsWith("share/")||a(s)?.startsWith("ocm-share/")?m=a(s).split("/")[1]:m=p.name,n.getSpace(p.remoteItemId)||n.createShareSpace({driveAliasPrefix:g,id:p.remoteItemId,shareName:m})},u=p=>a(o).filter(f=>z.isMountPointSpaceResource(f)&&z.extractStorageId(f.root.remoteItem.rootId)===p.id);return{getInternalSpace:i,getMatchingSpace:l,isPersonalSpaceRoot:p=>p?.storageId&&p?.storageId===n.personalSpace?.storageId&&p?.path==="/"&&!z.isIncomingShareResource(p),isResourceAccessible:({space:p,path:f})=>{if(!r.options.routing.fullShareOwnerPaths)return!0;const h=a(o).some(m=>z.isProjectSpaceResource(m)&&m.id===p.id);return p.isOwner(t.user)||h||u(p).some(m=>f.startsWith(m.root.remoteItem.path))}}},go=()=>{const e=Pe(),t=De();return{createSpace:o=>{const{graphAuthenticated:s}=e;return s.drives.createDrive({name:o},{params:{template:"default"}})},createDefaultMetaFolder:async o=>{const s=await e.webdav.createFolder(o,{path:".space"});return z.extractStorageId(s.parentFolderId)===t.currentFolder?.id&&t.upsertResource(s),s}}},Ut=()=>er("$loadingService"),$i=()=>{const e=Lr(),t=Pe(),n=me.useGettext();return{headers:A(()=>{const o=new Sl({accessToken:e.accessToken,publicLinkToken:e.publicLinkToken,publicLinkPassword:e.publicLinkPassword});return{"Accept-Language":n.current,"Initiator-ID":t.initiatorId,"X-Request-ID":Ct.v4(),...o.getHeaders()}})}};function jC(e){return new Worker("/assets/worker-BSCY2vwA.js",{name:e?.name})}const fh=({concurrentRequests:e=4}={})=>{const t=Ge(),n=Ut(),{headers:r}=$i(),{createWorker:o,terminateWorker:s}=ss(),i=({topic:u,space:d,resources:c},p)=>{const f=o(jC,{needsTokenRenewal:!0});let h;a(f.worker).onmessage=g=>{s(f.id),h?.(!0);const{successful:m,failed:w}=JSON.parse(g.data),T=w.map(({resource:k,...S})=>({resource:k,error:z.createHttpError(S)}));p({successful:m,failed:T})},n.addTask(()=>new Promise(g=>{h=g})),f.post(l({topic:u,space:d,resources:c}))},l=({topic:u,space:d,resources:c})=>JSON.stringify({topic:u,data:{space:d,resources:c,concurrentRequests:e,baseUrl:t.serverUrl,headers:{...a(r),"X-Request-ID":void 0}}});return{startWorker:i}};function zC(e){return new Worker("/assets/worker-DH8D29Kr.js",{name:e?.name})}const ph=()=>{const e=Ge(),t=Ut(),{headers:n}=$i(),{createWorker:r,terminateWorker:o}=ss(),s=(l,u)=>{const d=r(zC,{needsTokenRenewal:!0});let c;a(d.worker).onmessage=p=>{o(d.id),c?.(!0);const{successful:f,failed:h}=JSON.parse(p.data),g=h.map(({resourceName:m,...w})=>({resourceName:m,error:z.createHttpError(w)}));u({successful:f,failed:g})},t.addTask(()=>new Promise(p=>{c=p})),d.post(i(l))},i=l=>JSON.stringify({topic:"startProcess",data:{transferData:l,baseUrl:e.serverUrl,headers:{...a(n),"X-Request-ID":void 0}}});return{startWorker:s}};function UC(e){return new Worker("/assets/worker-22sDKzz_.js",{name:e?.name})}const hh=()=>{const e=Ge(),t=Ut(),{headers:n}=$i(),{createWorker:r,terminateWorker:o}=ss(),s=({space:l,resources:u,missingFolderPaths:d},c)=>{const p=r(UC,{needsTokenRenewal:!0});let f;a(p.worker).onmessage=h=>{o(p.id),f?.(!0);const{successful:g,failed:m}=JSON.parse(h.data),w=m.map(({resource:T,...k})=>({resource:T,error:z.createHttpError(k)}));c({successful:g,failed:w})},t.addTask(()=>new Promise(h=>{f=h})),p.post(i({space:l,resources:u,missingFolderPaths:d}))},i=({space:l,resources:u,missingFolderPaths:d})=>JSON.stringify({topic:"startProcess",data:{space:l,resources:u,missingFolderPaths:d,baseUrl:e.serverUrl,headers:{...a(n),"X-Request-ID":void 0}}});return{startWorker:s}};function VC(e){return new Worker("/assets/worker-BBQqm_-D.js",{name:e?.name})}const qC=({authService:e})=>{const{createWorker:t}=ss(),n=W();return{startWorker:()=>{n.value=t(VC),a(a(n).worker).onmessage=()=>{e.signinSilent().catch(async i=>{if(i instanceof Mg.ErrorTimeout){console.warn("token renewal timed out, retrying in 5 seconds..."),a(n).post(JSON.stringify({topic:"set",expiry:5,expiryThreshold:0}));return}if(console.error("token renewal error:",i),!await e.getRefreshToken())return e.logoutUser()})}},setTokenTimer:({expiry:i,expiryThreshold:l})=>{if(!a(n)){console.error("token timer worker is not running");return}a(n).post(JSON.stringify({topic:"set",expiry:i,expiryThreshold:l}))},resetTokenTimer:()=>{if(!a(n)){console.error("token timer worker is not running");return}a(n).post(JSON.stringify({topic:"reset"}))}}};function HC(e){return e==null}const An=()=>{const e=Mn(),t=Re(),n=oa(),{isEnabled:r}=Tr(),{requestExtensions:o}=ho(),s=lr(),{openUrl:i}=eg(),l=Ge(),{options:u}=we.storeToRefs(l),{actions:d}=ea(),{actions:c}=ra(),{actions:p}=Oi(),{actions:f}=Ts(),{actions:h}=Yi(),{actions:g}=Zi(),{actions:m}=xo(),{actions:w}=Um(),{actions:T}=Tc(),{actions:k}=ta(),{actions:S}=Dm(),{actions:y}=na(),{actions:E}=ks(),{actions:D}=wc(),$=A(()=>[...a(g),...a(m),...a(f),...a(k),...a(p),...a(y),...a(D),...a(E),...a(d),...a(c),...a(h),...a(T)]),_=A(()=>(o({id:"global.files.context-actions",extensionType:"action"})||[]).map(q=>q.action).filter(q=>HC(q.category)||q.category==="context"||q.category==="actions")),L=A(()=>a(r)?[]:e.fileExtensions.map(q=>{const j=e.apps[q.app];return{name:`editor-${q.app}`,label:()=>q.label?typeof q.label=="function"?q.label():q.label:j.name,icon:q.icon||j.icon,...j.iconFillType&&{iconFillType:j.iconFillType},img:j.img,route:({space:H,resources:se})=>V({appFileExtension:q,space:H,resource:se[0]}),handler:H=>B(q,H.space,H.resources[0]),isVisible:({resources:H})=>!a(s)||H.length!==1||!H[0].canDownload()&&!q.secureView||!a(n)&&qt(t,"files-trash-generic")?!1:H[0].extension&&q.extension?H[0].extension.toLowerCase()===q.extension.toLowerCase():H[0].mimeType&&q.mimeType?H[0].mimeType.toLowerCase()===q.mimeType.toLowerCase()||H[0].mimeType.split("/")[0].toLowerCase()===q.mimeType.toLowerCase():!1,hasPriority:q.hasPriority,class:`oc-files-actions-${Qp(j.name).toLowerCase()}-trigger`}}).sort((q,j)=>j.hasPriority!==q.hasPriority&&j.hasPriority?1:0)),V=({appFileExtension:q,space:j,resource:H})=>{const se=z.isShareSpaceResource(j)?j.id:void 0,Y=q.routeName||q.app,ae=te(Y,j,H,se);return t.resolve(ae)},te=(q,j,H,se,Y)=>({name:q,params:{driveAliasAndItem:j?.getDriveAliasAndItem(H)},query:{...se&&{shareId:se},...H.fileId&&a(u).routing.idBased&&{fileId:H.fileId},...Y&&{templateId:Y},...Ii(a(t.currentRoute))}}),B=(q,j,H)=>{const se=z.isShareSpaceResource(j)?j.id:void 0,Y=q.routeName||q.app,ae=te(Y,j,H,se);if(a(u).cernFeatures){const ne=t.resolve(ae).href,pe=`${q.routeName}-${H.path}`;i(ne,pe,!0);return}t.push(ae)},O=q=>{const j=M(q);j&&j.handler({...q})},M=q=>{const j=N(q);if(j.length)return j[0].name===a(m)[0].name?a(w)[0]:j[0]},N=q=>{const j=Y=>Y.isVisible(q),H=[...a(_),...a(L),...a(S)].filter(j).sort((Y,ae)=>Number(ae.hasPriority)-Number(Y.hasPriority)),se=q.omitSystemActions?[]:a($).filter(j);return[...H,...se]};return{getDefaultAction:M,getAllOpenWithActions:N,getEditorRouteOpts:te,openEditor:B,triggerDefaultAction:O}},Oi=()=>{const e=Ge(),t=Re(),{copyResources:n}=ns(),r=me.useGettext(),{$gettext:o}=r,s=De(),{currentFolder:i}=we.storeToRefs(s),l=A(()=>ts()?o("⌘ + C"):o("Ctrl + C")),u=({resources:c})=>{bt(t,"files-common-search")&&(c=c.filter(p=>!z.isProjectSpaceResource(p))),n(c)};return{actions:A(()=>[{name:"copy",icon:"file-copy-2",handler:u,shortcut:a(l),label:()=>o("Copy"),isVisible:({resources:c})=>{if(!st(t,"files-spaces-generic")&&!ln(t,"files-public-link")&&!bt(t,"files-common-favorites")&&!bt(t,"files-common-search")||st(t,"files-spaces-projects")||c.length===0)return!1;if(ln(t,"files-public-link"))return a(i)?.canCreate();if(bt(t,"files-common-search")&&c.every(p=>z.isProjectSpaceResource(p)))return!1;if(a(e.options.runningOnEos)){const p=c[0].path?.split("/").filter(Boolean)||[];if(st(t,"files-spaces-generic")&&p.length<5)return!1}return!!a(c)[0].canDownload()},class:"oc-files-actions-copy-trigger"}])}};var jn=(e=>(e.C="c",e.V="v",e.X="x",e.A="a",e.S="s",e.Z="z",e.Plus="+",e.Minus="-",e.Space=" ",e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.Esc="Escape",e.Backspace="Backspace",e.Delete="Delete",e))(jn||{}),Li=(e=>(e.Ctrl="Control",e.Shift="Shift",e))(Li||{});const WC=()=>{const e=document.activeElement.tagName,t=document.activeElement.getAttribute("type");if(["textarea","input","select"].includes(e.toLowerCase())&&t!=="checkbox")return!0;const n=document.activeElement;if(!n)return!1;let r;try{r=n?.closest("[data-custom-key-bindings-disabled='true']")}catch{r=n?.parentElement.closest("[data-custom-key-bindings-disabled='true']")}return r?!0:window.getSelection().type==="Range"},_i=e=>{const t=W([]),n=W(0),r=l=>{if(!e?.skipDisabledKeyBindingsCheck&&WC())return;const{key:u,ctrlKey:d,metaKey:c,shiftKey:p}=l;let f=null;const h=[];c||d?(f="Control",h.push("altKey","shiftKey")):p&&(f="Shift",h.push("altKey","ctrlKey","metaKey")),!((m,w)=>w.some(T=>m[T]))(l,h)&&a(t).filter(m=>m.primary===u&&m.modifier===f).forEach(m=>{m.preventDefault&&l.preventDefault(),m.callback(l)})},o=(l,u,{preventDefault:d=!0}={})=>{const c=Ct.v4();return t.value.push({id:c,...l,modifier:l.modifier??null,preventDefault:d,callback:u}),c},s=l=>{t.value=t.value.filter(u=>u.id!==l)},i=()=>{n.value=0};return Rn.useEventListener(document,"keydown",r),{actions:t,bindKeyAction:o,removeKeyAction:s,selectionCursor:n,resetSelectionCursor:i}};function zr(){return{interceptModifierClick:(t,n)=>{if(!t||!n)return!1;const r=t.shiftKey,o=t.ctrlKey||t.metaKey;return!r&&!o?!1:(t.stopPropagation?.(),t.stopImmediatePropagation?.(),r&&ze.publish("app.files.list.clicked.shift",{resource:n,skipTargetSelection:!1}),o&&ze.publish("app.files.list.clicked.meta",n),!0)}}}const Ql=()=>{const e=_i(),t=10,n=.1;return{setCropperInstance:o=>{e.bindKeyAction({primary:jn.ArrowRight},()=>a(o)?.move(-t,0)),e.bindKeyAction({primary:jn.ArrowLeft},()=>a(o)?.move(t,0)),e.bindKeyAction({primary:jn.ArrowDown},()=>a(o)?.move(0,-t)),e.bindKeyAction({primary:jn.ArrowUp},()=>a(o)?.move(0,t)),e.bindKeyAction({primary:jn.Plus},()=>a(o)?.zoom(n)),e.bindKeyAction({primary:jn.Minus},()=>a(o)?.zoom(-n))}}},Kl=()=>{const{showMessage:e,showErrorMessage:t}=Me(),{$gettext:n}=me.useGettext(),{copy:r}=Rn.useClipboard(),{interceptModifierClick:o}=zr(),s=async l=>{try{await r(l),e({title:n("The link has been copied to your clipboard.")})}catch(u){t({title:n("Copy link failed"),errors:[u]})}};return{actions:A(()=>[{name:"copy-permanent-link",icon:"link",label:()=>n("Copy permanent link"),handler:l=>{const{resources:u,event:d}=l,c=u[0];if(!(d&&o(d,c)))return s(c.privateLink)},isVisible:({space:l,resources:u})=>!(u.length!==1||z.isPublicSpaceResource(l)||z.isTrashResource(u[0])),class:"oc-files-actions-copy-permanent-link-trigger"}])}},is={};function QC(e){return e.getIsPending!==void 0}function KC(e){if(QC(e))return e;let t=!0,n=e.then(r=>(t=!1,r),r=>{throw t=!1,r});return n.getIsPending=function(){return t},n}function GC(e){let t={};const n=e.attributes;if(!n)return t;for(let r=n.length-1;r>=0;r--)t[n[r].name]=n[r].value;return t}function JC(e){return Object.keys(e).reduce((t,n)=>(e[n]!==!1&&e[n]!==null&&e[n]!==void 0&&(t[n]=e[n]),t),{})}function XC(e,t){const{class:n,style:r,...o}=GC(e),{class:s,style:i,...l}=JC(t);return{class:[n,s],style:[r,i],...o,...l}}const mh=ge({inheritAttrs:!1,__name:"InlineSvg",props:{src:{},title:{default:void 0},transformSource:{type:Function,default:e=>e},keepDuringLoading:{type:Boolean,default:!0},uniqueIds:{type:[Boolean,String],default:!1},uniqueIdsBase:{default:""}},emits:["loaded","unloaded","error"],setup(e,{expose:t,emit:n}){const r=e,o=n,s=Js(),i=W(),l=W(),u=W(),d=Math.random().toString(36).substring(2);t({svgElSource:i,request:u}),Ue(()=>r.src,w=>{p(w)}),p(r.src);function c(w){if(w=w.cloneNode(!0),r.uniqueIds){const T=typeof r.uniqueIds=="string"?r.uniqueIds:d;w=m(w,T,r.uniqueIdsBase)}return w=r.transformSource(w),r.title&&g(w,r.title),w.innerHTML}function p(w){is[w]||(is[w]=f(w)),i.value&&is[w].getIsPending()&&!r.keepDuringLoading&&(i.value=null,o("unloaded")),is[w].then(T=>{i.value=T,xt(()=>{o("loaded",l.value)})}).catch(T=>{i.value&&(i.value=void 0,o("unloaded")),delete is[w],o("error",T)})}function f(w){return KC(new Promise((T,k)=>{const S=new XMLHttpRequest;S.open("GET",w,!0),u.value=S,S.onload=()=>{if(S.status>=200&&S.status<400)try{let y=new DOMParser().parseFromString(S.responseText,"text/xml").getElementsByTagName("svg")[0];y?T(y):k(new Error('Loaded file is not valid SVG"'))}catch(y){k(y)}else k(new Error("Error loading SVG"))},S.onerror=k,S.send()}))}const h=()=>i.value?za("svg",{...XC(i.value,s),innerHTML:c(i.value),ref:l}):null;function g(w,T){const k=w.getElementsByTagName("title");if(k.length)k[0].textContent=T;else{const S=document.createElementNS("http://www.w3.org/2000/svg","title");S.textContent=T,w.insertBefore(S,w.firstChild)}}function m(w,T,k=""){const S=["id","href","xlink:href","xlink:role","xlink:arcrole"],y=["href","xlink:href"],E=(D,$)=>y.includes(D)&&($?!$.includes("#"):!1);return[...w.children].forEach(D=>{var $;if(($=D.attributes)!=null&&$.length){const _=Object.values(D.attributes).map(L=>{const V=/url\((.*?)\)/.exec(L.value);return V!=null&&V[1]&&(L.value=L.value.replace(V[0],`url(${k}${V[1]}_${T})`)),L});S.forEach(L=>{const V=_.find(te=>te.name===L);V&&!E(L,V.value)&&(V.value=`${V.value}_${T}`)})}return D.children.length?m(D,T,k):D}),w}return(w,T)=>(I(),re(h))}}),or=ge({__name:"OcIcon",props:{accessibleLabel:{default:""},color:{default:""},fillType:{default:"fill"},name:{default:"info"},size:{default:"medium"},type:{default:"span"}},emits:["loaded"],setup(e,{emit:t}){mh.name="inline-svg";const n=t,r=A(()=>_r("oc-icon-title-")),o=A(()=>{const l=`${_S()}icons/`,u=e.fillType.toLowerCase();return u==="none"?`${l}${e.name}.svg`:`${l}${e.name}-${u}.svg`}),s=A(()=>({"size-3":e.size==="xsmall","size-4":e.size==="small","size-5.5":e.size==="medium","size-8":e.size==="large","size-12":e.size==="xlarge","size-22":e.size==="xxlarge","size-42":e.size==="xxxlarge"})),i=l=>{if(e.accessibleLabel!==""){const u=document.createElement("title");u.setAttribute("id",r.value),u.appendChild(document.createTextNode(e.accessibleLabel)),l.insertBefore(u,l.firstChild)}return l};return(l,u)=>(I(),re(rn(e.type),{class:R.normalizeClass(["oc-icon","box-content","inline-block","align-baseline","[&_svg]:block",s.value,{"bg-transparent min-h-0":e.type==="button"}])},{default:Z(()=>[J(a(mh),{src:o.value,"transform-source":i,"aria-hidden":e.accessibleLabel===""?"true":null,"aria-labelledby":e.accessibleLabel===""?null:r.value,focusable:e.accessibleLabel===""?"false":null,style:R.normalizeStyle(e.color!==""?{fill:e.color}:{}),class:R.normalizeClass(s.value),onLoaded:u[0]||(u[0]=d=>n("loaded"))},null,8,["src","aria-hidden","aria-labelledby","focusable","style","class"])]),_:1},8,["class"]))}});var gh=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Mi=gh.join(","),vh=typeof Element>"u",Ur=vh?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ni=!vh&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Bi=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Bi(t.parentNode));return i},YC=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},yh=function(t,n,r){if(Bi(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Mi));return n&&Ur.call(t,Mi)&&o.unshift(t),o=o.filter(r),o},ji=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!Bi(i,!1))if(i.tagName==="SLOT"){var l=i.assignedElements(),u=l.length?l:i.children,d=ji(u,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:i,candidates:d})}else{var c=Ur.call(i,Mi);c&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var p=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),f=!Bi(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(p&&f){var h=ji(p===!0?i.children:p.children,!0,r);r.flatten?o.push.apply(o,h):o.push({scopeParent:i,candidates:h})}else s.unshift.apply(s,i.children)}}return o},bh=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Vr=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||YC(t))&&!bh(t)?0:t.tabIndex},ZC=function(t,n){var r=Vr(t);return r<0&&n&&!bh(t)?0:r},ex=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},wh=function(t){return t.tagName==="INPUT"},tx=function(t){return wh(t)&&t.type==="hidden"},nx=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},rx=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},ox=function(t){if(!t.name)return!0;var n=t.form||Ni(t),r=function(l){return n.querySelectorAll('input[type="radio"][name="'+l+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=rx(o,t.form);return!s||s===t},sx=function(t){return wh(t)&&t.type==="radio"},ix=function(t){return sx(t)&&!ox(t)},ax=function(t){var n,r=t&&Ni(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,l,u;for(s=!!((i=o)!==null&&i!==void 0&&(l=i.ownerDocument)!==null&&l!==void 0&&l.contains(o)||t!=null&&(u=t.ownerDocument)!==null&&u!==void 0&&u.contains(t));!s&&o;){var d,c,p;r=Ni(o),o=(d=r)===null||d===void 0?void 0:d.host,s=!!((c=o)!==null&&c!==void 0&&(p=c.ownerDocument)!==null&&p!==void 0&&p.contains(o))}}return s},Sh=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},lx=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=Ur.call(t,"details>summary:first-of-type"),l=i?t.parentElement:t;if(Ur.call(l,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var u=t;t;){var d=t.parentElement,c=Ni(t);if(d&&!d.shadowRoot&&o(d)===!0)return Sh(t);t.assignedSlot?t=t.assignedSlot:!d&&c!==t.ownerDocument?t=c.host:t=d}t=u}if(ax(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Sh(t);return!1},cx=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Ur.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},zi=function(t,n){return!(n.disabled||tx(n)||lx(n,t)||nx(n)||cx(n))},Gl=function(t,n){return!(ix(n)||Vr(n)<0||!zi(t,n))},ux=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Th=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,l=i?o.scopeParent:o,u=ZC(l,i),d=i?Th(o.candidates):l;u===0?i?n.push.apply(n,d):n.push(l):r.push({documentOrder:s,tabIndex:u,item:o,isScope:i,content:d})}),r.sort(ex).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},dx=function(t,n){n=n||{};var r;return n.getShadowRoot?r=ji([t],n.includeContainer,{filter:Gl.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:ux}):r=yh(t,n.includeContainer,Gl.bind(null,n)),Th(r)},fx=function(t,n){n=n||{};var r;return n.getShadowRoot?r=ji([t],n.includeContainer,{filter:zi.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=yh(t,n.includeContainer,zi.bind(null,n)),r},vo=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Ur.call(t,Mi)===!1?!1:Gl(n,t)},px=gh.concat("iframe:not([inert]):not([inert] *)").join(","),Jl=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Ur.call(t,px)===!1?!1:zi(n,t)};function Xl(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hx(e){if(Array.isArray(e))return Xl(e)}function kh(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Ah(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
10
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return i=u.done,u},e:function(u){l=!0,s=u},f:function(){try{i||n.return==null||n.return()}finally{if(l)throw s}}}}function mx(e,t,n){return(t=wx(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gx(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vx(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
11
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ch(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function xh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ch(Object(n),!0).forEach(function(r){mx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ch(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yx(e){return hx(e)||gx(e)||Ah(e)||vx()}function bx(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wx(e){var t=bx(e,"string");return typeof t=="symbol"?t:t+""}function Ah(e,t){if(e){if(typeof e=="string")return Xl(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xl(e,t):void 0}}var sr={getActiveTrap:function(t){return t?.length>0?t[t.length-1]:null},activateTrap:function(t,n){var r=sr.getActiveTrap(t);n!==r&&sr.pauseTrap(t);var o=t.indexOf(n);o===-1||t.splice(o,1),t.push(n)},deactivateTrap:function(t,n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),sr.unpauseTrap(t)},pauseTrap:function(t){var n=sr.getActiveTrap(t);n?._setPausedState(!0)},unpauseTrap:function(t){var n=sr.getActiveTrap(t);n&&!n._isManuallyPaused()&&n._setPausedState(!1)}},Sx=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},Tx=function(t){return t?.key==="Escape"||t?.key==="Esc"||t?.keyCode===27},as=function(t){return t?.key==="Tab"||t?.keyCode===9},kx=function(t){return as(t)&&!t.shiftKey},Cx=function(t){return as(t)&&t.shiftKey},Eh=function(t){return setTimeout(t,0)},ls=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return typeof t=="function"?t.apply(void 0,r):t},Ui=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},xx=[],Ax=function(t,n){var r=n?.document||document,o=n?.trapStack||xx,s=xh({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isolateSubtrees:!1,isKeyForward:kx,isKeyBackward:Cx},n),i={containers:[],containerGroups:[],tabbableGroups:[],adjacentElements:new Set,alreadySilent:new Set,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},l,u=function(M,N,q){return M&&M[N]!==void 0?M[N]:s[q||N]},d=function(M,N){var q=typeof N?.composedPath=="function"?N.composedPath():void 0;return i.containerGroups.findIndex(function(j){var H=j.container,se=j.tabbableNodes;return H.contains(M)||q?.includes(H)||se.find(function(Y){return Y===M})})},c=function(M){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},q=N.hasFallback,j=q===void 0?!1:q,H=N.params,se=H===void 0?[]:H,Y=s[M];if(typeof Y=="function"&&(Y=Y.apply(void 0,yx(se))),Y===!0&&(Y=void 0),!Y){if(Y===void 0||Y===!1)return Y;throw new Error("`".concat(M,"` was specified but was not a node, or did not return a node"))}var ae=Y;if(typeof Y=="string"){try{ae=r.querySelector(Y)}catch(ne){throw new Error("`".concat(M,'` appears to be an invalid selector; error="').concat(ne.message,'"'))}if(!ae&&!j)throw new Error("`".concat(M,"` as selector refers to no known node"))}return ae},p=function(){var M=c("initialFocus",{hasFallback:!0});if(M===!1)return!1;if(M===void 0||M&&!Jl(M,s.tabbableOptions))if(d(r.activeElement)>=0)M=r.activeElement;else{var N=i.tabbableGroups[0],q=N&&N.firstTabbableNode;M=q||c("fallbackFocus")}else M===null&&(M=c("fallbackFocus"));if(!M)throw new Error("Your focus-trap needs to have at least one focusable element");return M},f=function(){if(i.containerGroups=i.containers.map(function(M){var N=dx(M,s.tabbableOptions),q=fx(M,s.tabbableOptions),j=N.length>0?N[0]:void 0,H=N.length>0?N[N.length-1]:void 0,se=q.find(function(ne){return vo(ne)}),Y=q.slice().reverse().find(function(ne){return vo(ne)}),ae=!!N.find(function(ne){return Vr(ne)>0});return{container:M,tabbableNodes:N,focusableNodes:q,posTabIndexesFound:ae,firstTabbableNode:j,lastTabbableNode:H,firstDomTabbableNode:se,lastDomTabbableNode:Y,nextTabbableNode:function(pe){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,be=N.indexOf(pe);return be<0?fe?q.slice(q.indexOf(pe)+1).find(function(xe){return vo(xe)}):q.slice(0,q.indexOf(pe)).reverse().find(function(xe){return vo(xe)}):N[be+(fe?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(M){return M.tabbableNodes.length>0}),i.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(i.containerGroups.find(function(M){return M.posTabIndexesFound})&&i.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function(M){var N=M.activeElement;if(N)return N.shadowRoot&&N.shadowRoot.activeElement!==null?h(N.shadowRoot):N},g=function(M){if(M!==!1&&M!==h(document)){if(!M||!M.focus){g(p());return}M.focus({preventScroll:!!s.preventScroll}),i.mostRecentlyFocusedNode=M,Sx(M)&&M.select()}},m=function(M){var N=c("setReturnFocus",{params:[M]});return N||(N===!1?!1:M)},w=function(M){var N=M.target,q=M.event,j=M.isBackward,H=j===void 0?!1:j;N=N||Ui(q),f();var se=null;if(i.tabbableGroups.length>0){var Y=d(N,q),ae=Y>=0?i.containerGroups[Y]:void 0;if(Y<0)H?se=i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:se=i.tabbableGroups[0].firstTabbableNode;else if(H){var ne=i.tabbableGroups.findIndex(function(ie){var de=ie.firstTabbableNode;return N===de});if(ne<0&&(ae.container===N||Jl(N,s.tabbableOptions)&&!vo(N,s.tabbableOptions)&&!ae.nextTabbableNode(N,!1))&&(ne=Y),ne>=0){var pe=ne===0?i.tabbableGroups.length-1:ne-1,fe=i.tabbableGroups[pe];se=Vr(N)>=0?fe.lastTabbableNode:fe.lastDomTabbableNode}else as(q)||(se=ae.nextTabbableNode(N,!1))}else{var be=i.tabbableGroups.findIndex(function(ie){var de=ie.lastTabbableNode;return N===de});if(be<0&&(ae.container===N||Jl(N,s.tabbableOptions)&&!vo(N,s.tabbableOptions)&&!ae.nextTabbableNode(N))&&(be=Y),be>=0){var xe=be===i.tabbableGroups.length-1?0:be+1,he=i.tabbableGroups[xe];se=Vr(N)>=0?he.firstTabbableNode:he.firstDomTabbableNode}else as(q)||(se=ae.nextTabbableNode(N))}}else se=c("fallbackFocus");return se},T=function(M){var N=Ui(M);if(!(d(N,M)>=0)){if(ls(s.clickOutsideDeactivates,M)){l.deactivate({returnFocus:s.returnFocusOnDeactivate});return}ls(s.allowOutsideClick,M)||M.preventDefault()}},k=function(M){var N=Ui(M),q=d(N,M)>=0;if(q||N instanceof Document)q&&(i.mostRecentlyFocusedNode=N);else{M.stopImmediatePropagation();var j,H=!0;if(i.mostRecentlyFocusedNode)if(Vr(i.mostRecentlyFocusedNode)>0){var se=d(i.mostRecentlyFocusedNode),Y=i.containerGroups[se].tabbableNodes;if(Y.length>0){var ae=Y.findIndex(function(ne){return ne===i.mostRecentlyFocusedNode});ae>=0&&(s.isKeyForward(i.recentNavEvent)?ae+1<Y.length&&(j=Y[ae+1],H=!1):ae-1>=0&&(j=Y[ae-1],H=!1))}}else i.containerGroups.some(function(ne){return ne.tabbableNodes.some(function(pe){return Vr(pe)>0})})||(H=!1);else H=!1;H&&(j=w({target:i.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(i.recentNavEvent)})),g(j||i.mostRecentlyFocusedNode||p())}i.recentNavEvent=void 0},S=function(M){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i.recentNavEvent=M;var q=w({event:M,isBackward:N});q&&(as(M)&&M.preventDefault(),g(q))},y=function(M){(s.isKeyForward(M)||s.isKeyBackward(M))&&S(M,s.isKeyBackward(M))},E=function(M){Tx(M)&&ls(s.escapeDeactivates,M)!==!1&&(M.preventDefault(),l.deactivate())},D=function(M){var N=Ui(M);d(N,M)>=0||ls(s.clickOutsideDeactivates,M)||ls(s.allowOutsideClick,M)||(M.preventDefault(),M.stopImmediatePropagation())},$=function(){if(i.active)return sr.activateTrap(o,l),i.delayInitialFocusTimer=s.delayInitialFocus?Eh(function(){g(p())}):g(p()),r.addEventListener("focusin",k,!0),r.addEventListener("mousedown",T,{capture:!0,passive:!1}),r.addEventListener("touchstart",T,{capture:!0,passive:!1}),r.addEventListener("click",D,{capture:!0,passive:!1}),r.addEventListener("keydown",y,{capture:!0,passive:!1}),r.addEventListener("keydown",E),l},_=function(M){i.active&&!i.paused&&l._setSubtreeIsolation(!1),i.adjacentElements.clear(),i.alreadySilent.clear();var N=new Set,q=new Set,j=kh(M),H;try{for(j.s();!(H=j.n()).done;){var se=H.value;N.add(se);for(var Y=typeof ShadowRoot<"u"&&se.getRootNode()instanceof ShadowRoot,ae=se;ae;){N.add(ae);var ne=ae.parentElement,pe=[];ne?pe=ne.children:!ne&&Y&&(pe=ae.getRootNode().children,ne=ae.getRootNode().host,Y=typeof ShadowRoot<"u"&&ne.getRootNode()instanceof ShadowRoot);var fe=kh(pe),be;try{for(fe.s();!(be=fe.n()).done;){var xe=be.value;q.add(xe)}}catch(he){fe.e(he)}finally{fe.f()}ae=ne}}}catch(he){j.e(he)}finally{j.f()}N.forEach(function(he){q.delete(he)}),i.adjacentElements=q},L=function(){if(i.active)return r.removeEventListener("focusin",k,!0),r.removeEventListener("mousedown",T,!0),r.removeEventListener("touchstart",T,!0),r.removeEventListener("click",D,!0),r.removeEventListener("keydown",y,!0),r.removeEventListener("keydown",E),l},V=function(M){var N=M.some(function(q){var j=Array.from(q.removedNodes);return j.some(function(H){return H===i.mostRecentlyFocusedNode})});N&&g(p())},te=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(V):void 0,B=function(){te&&(te.disconnect(),i.active&&!i.paused&&i.containers.map(function(M){te.observe(M,{subtree:!0,childList:!0})}))};return l={get active(){return i.active},get paused(){return i.paused},activate:function(M){if(i.active)return this;var N=u(M,"onActivate"),q=u(M,"onPostActivate"),j=u(M,"checkCanFocusTrap"),H=sr.getActiveTrap(o),se=!1;if(H&&!H.paused){var Y;(Y=H._setSubtreeIsolation)===null||Y===void 0||Y.call(H,!1),se=!0}try{j||f(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=h(r),N?.();var ae=function(){j&&f(),$(),B(),s.isolateSubtrees&&l._setSubtreeIsolation(!0),q?.()};if(j)return j(i.containers.concat()).then(ae,ae),this;ae()}catch(pe){if(H===sr.getActiveTrap(o)&&se){var ne;(ne=H._setSubtreeIsolation)===null||ne===void 0||ne.call(H,!0)}throw pe}return this},deactivate:function(M){if(!i.active)return this;var N=xh({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},M);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,i.paused||l._setSubtreeIsolation(!1),i.alreadySilent.clear(),L(),i.active=!1,i.paused=!1,B(),sr.deactivateTrap(o,l);var q=u(N,"onDeactivate"),j=u(N,"onPostDeactivate"),H=u(N,"checkCanReturnFocus"),se=u(N,"returnFocus","returnFocusOnDeactivate");q?.();var Y=function(){Eh(function(){se&&g(m(i.nodeFocusedBeforeActivation)),j?.()})};return se&&H?(H(m(i.nodeFocusedBeforeActivation)).then(Y,Y),this):(Y(),this)},pause:function(M){return i.active?(i.manuallyPaused=!0,this._setPausedState(!0,M)):this},unpause:function(M){return i.active?(i.manuallyPaused=!1,o[o.length-1]!==this?this:this._setPausedState(!1,M)):this},updateContainerElements:function(M){var N=[].concat(M).filter(Boolean);return i.containers=N.map(function(q){return typeof q=="string"?r.querySelector(q):q}),s.isolateSubtrees&&_(i.containers),i.active&&(f(),s.isolateSubtrees&&!i.paused&&l._setSubtreeIsolation(!0)),B(),this}},Object.defineProperties(l,{_isManuallyPaused:{value:function(){return i.manuallyPaused}},_setPausedState:{value:function(M,N){if(i.paused===M)return this;if(i.paused=M,M){var q=u(N,"onPause"),j=u(N,"onPostPause");q?.(),L(),B(),l._setSubtreeIsolation(!1),j?.()}else{var H=u(N,"onUnpause"),se=u(N,"onPostUnpause");H?.(),l._setSubtreeIsolation(!0),f(),$(),B(),se?.()}return this}},_setSubtreeIsolation:{value:function(M){s.isolateSubtrees&&i.adjacentElements.forEach(function(N){var q;M?s.isolateSubtrees==="aria-hidden"?((N.ariaHidden==="true"||((q=N.getAttribute("aria-hidden"))===null||q===void 0?void 0:q.toLowerCase())==="true")&&i.alreadySilent.add(N),N.setAttribute("aria-hidden","true")):((N.inert||N.hasAttribute("inert"))&&i.alreadySilent.add(N),N.setAttribute("inert",!0)):i.alreadySilent.has(N)||(s.isolateSubtrees==="aria-hidden"?N.removeAttribute("aria-hidden"):N.removeAttribute("inert"))})}}}),l.updateContainerElements(t),l};function FO(e){return e}const Ex={escapeDeactivates:{type:Boolean,default:!0},returnFocusOnDeactivate:{type:Boolean,default:!0},allowOutsideClick:{type:[Boolean,Function],default:!0},clickOutsideDeactivates:[Boolean,Function],initialFocus:[String,Function,Boolean],fallbackFocus:[String,Function],checkCanFocusTrap:Function,checkCanReturnFocus:Function,delayInitialFocus:{type:Boolean,default:!0},document:Object,preventScroll:Boolean,setReturnFocus:[Object,String,Boolean,Function],tabbableOptions:Object},Rx=ge({name:"FocusTrap",props:Object.assign({active:{type:Boolean,default:!0}},Ex),emits:["update:active","activate","postActivate","deactivate","postDeactivate"],render(){return this.renderImpl()},setup(e,{slots:t,emit:n}){let r;const o=W(null),s=A(()=>{const l=o.value;return l&&(l instanceof HTMLElement?l:l.$el)});function i(){return r||(r=Ax(s.value,{escapeDeactivates:e.escapeDeactivates,allowOutsideClick:e.allowOutsideClick,returnFocusOnDeactivate:e.returnFocusOnDeactivate,clickOutsideDeactivates:e.clickOutsideDeactivates,onActivate:()=>{n("update:active",!0),n("activate")},onDeactivate:()=>{n("update:active",!1),n("deactivate")},onPostActivate:()=>n("postActivate"),onPostDeactivate:()=>n("postDeactivate"),initialFocus:e.initialFocus,fallbackFocus:e.fallbackFocus,tabbableOptions:e.tabbableOptions,delayInitialFocus:e.delayInitialFocus,preventScroll:e.preventScroll}))}return yt(()=>{Ue(()=>e.active,l=>{l&&s.value?i().activate():r&&(r.deactivate(),(!s.value||s.value.nodeType===Node.COMMENT_NODE)&&(r=null))},{immediate:!0,flush:"post"})}),Qs(()=>{r&&r.deactivate(),r=null}),{activate(){i().activate()},deactivate(){r&&r.deactivate()},renderImpl(){if(!t.default)return null;const l=t.default().filter(d=>d.type!==to);return!l||!l.length||l.length>1?(console.error("[focus-trap-vue]: FocusTrap requires exactly one child."),l):no(l[0],{ref:o})}}}}),Dx=["open"],Px=["id"],Ix=Le(ge({__name:"OcBottomDrawer",props:{id:{},isDrawerActive:{type:Boolean,default:!0},isFocusTrapActive:{type:Boolean,default:!0},hasFullHeight:{type:Boolean,default:!1},maxHeight:{default:"max-h-[66vh]"}},emits:["clicked"],setup(e){return Ue(()=>e.isDrawerActive,async()=>{e.isDrawerActive&&(await xt(),document.getElementById(e.id)?.classList.add("active"))},{immediate:!0}),(t,n)=>(I(),G("dialog",{class:"oc-bottom-drawer fixed inset-0 bg-black/40 size-full",open:e.isDrawerActive,onClick:n[0]||(n[0]=r=>t.$emit("clicked",r))},[J(a(Rx),{active:e.isFocusTrapActive},{default:Z(()=>[Q("div",{id:e.id,tabindex:"-1",class:R.normalizeClass(["fixed inset-x-0 rounded-t-xl w-full overflow-y-auto transition-all duration-200 -bottom-full overflow-x-hidden",[{"[&.active]:bottom-0":e.isDrawerActive,"h-full":e.hasFullHeight},e.maxHeight]])},[Ce(t.$slots,"default",{},void 0,!0)],10,Px)]),_:3},8,["active"])],8,Dx))}}),[["__scopeId","data-v-42899e08"]]),Qt=ge({__name:"OcButton",props:{appearance:{default:"outline"},ariaLabel:{},colorRole:{default:"secondary"},disabled:{type:Boolean,default:!1},gapSize:{default:"medium"},href:{},justifyContent:{default:"center"},showSpinner:{type:Boolean,default:!1},size:{default:"medium"},submit:{default:"button"},target:{},to:{},type:{default:"button"},noHover:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:t}){const n=t,r=A(()=>({...e.href&&{href:e.href},...e.target&&{target:e.target},...e.to&&{to:e.to},...e.type==="button"&&{type:e.submit},...e.type==="button"&&{disabled:e.disabled}})),o=A(()=>({...e.type==="button"&&{click:s}})),s=i=>{n("click",i)};return(i,l)=>{const u=oe("oc-spinner");return I(),re(rn(e.type),pt(r.value,{"aria-label":e.ariaLabel,class:[[`oc-button-${a(rt.kebabCase)(e.colorRole)}`,`oc-button-${e.appearance}`,`oc-button-${a(rt.kebabCase)(e.colorRole)}-${e.appearance}`,{...a(MS)(e.gapSize),...a(NS)(e.justifyContent),"text-sm min-h-3":e.size==="small","text-base min-h-4":e.size==="medium","text-lg min-h-7":e.size==="large","no-hover":e.noHover}],"oc-button cursor-pointer disabled:opacity-60 disabled:cursor-default"]},Gs(o.value)),{default:Z(()=>[e.showSpinner?(I(),re(u,{key:0,size:"small",class:"spinner"})):le("",!0),Ce(i.$slots,"default")]),_:3},16,["aria-label","class"])}}});var Kt="top",fn="bottom",pn="right",Gt="left",Yl="auto",cs=[Kt,fn,pn,Gt],yo="start",us="end",Fx="clippingParents",Rh="viewport",ds="popper",$x="reference",Dh=cs.reduce(function(e,t){return e.concat([t+"-"+yo,t+"-"+us])},[]),Ph=[].concat(cs,[Yl]).reduce(function(e,t){return e.concat([t,t+"-"+yo,t+"-"+us])},[]),Ox="beforeRead",Lx="read",_x="afterRead",Mx="beforeMain",Nx="main",Bx="afterMain",jx="beforeWrite",zx="write",Ux="afterWrite",Vx=[Ox,Lx,_x,Mx,Nx,Bx,jx,zx,Ux];function zn(e){return e?(e.nodeName||"").toLowerCase():null}function Zt(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function qr(e){var t=Zt(e).Element;return e instanceof t||e instanceof Element}function hn(e){var t=Zt(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Zl(e){if(typeof ShadowRoot>"u")return!1;var t=Zt(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function qx(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},s=t.elements[n];!hn(s)||!zn(s)||(Object.assign(s.style,r),Object.keys(o).forEach(function(i){var l=o[i];l===!1?s.removeAttribute(i):s.setAttribute(i,l===!0?"":l)}))})}function Hx(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],s=t.attributes[r]||{},i=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),l=i.reduce(function(u,d){return u[d]="",u},{});!hn(o)||!zn(o)||(Object.assign(o.style,l),Object.keys(s).forEach(function(u){o.removeAttribute(u)}))})}}const Ih={name:"applyStyles",enabled:!0,phase:"write",fn:qx,effect:Hx,requires:["computeStyles"]};function Un(e){return e.split("-")[0]}var Hr=Math.max,Vi=Math.min,bo=Math.round;function ec(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Fh(){return!/^((?!chrome|android).)*safari/i.test(ec())}function wo(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,s=1;t&&hn(e)&&(o=e.offsetWidth>0&&bo(r.width)/e.offsetWidth||1,s=e.offsetHeight>0&&bo(r.height)/e.offsetHeight||1);var i=qr(e)?Zt(e):window,l=i.visualViewport,u=!Fh()&&n,d=(r.left+(u&&l?l.offsetLeft:0))/o,c=(r.top+(u&&l?l.offsetTop:0))/s,p=r.width/o,f=r.height/s;return{width:p,height:f,top:c,right:d+p,bottom:c+f,left:d,x:d,y:c}}function tc(e){var t=wo(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function $h(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Zl(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ir(e){return Zt(e).getComputedStyle(e)}function Wx(e){return["table","td","th"].indexOf(zn(e))>=0}function kr(e){return((qr(e)?e.ownerDocument:e.document)||window.document).documentElement}function qi(e){return zn(e)==="html"?e:e.assignedSlot||e.parentNode||(Zl(e)?e.host:null)||kr(e)}function Oh(e){return!hn(e)||ir(e).position==="fixed"?null:e.offsetParent}function Qx(e){var t=/firefox/i.test(ec()),n=/Trident/i.test(ec());if(n&&hn(e)){var r=ir(e);if(r.position==="fixed")return null}var o=qi(e);for(Zl(o)&&(o=o.host);hn(o)&&["html","body"].indexOf(zn(o))<0;){var s=ir(o);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return o;o=o.parentNode}return null}function fs(e){for(var t=Zt(e),n=Oh(e);n&&Wx(n)&&ir(n).position==="static";)n=Oh(n);return n&&(zn(n)==="html"||zn(n)==="body"&&ir(n).position==="static")?t:n||Qx(e)||t}function nc(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ps(e,t,n){return Hr(e,Vi(t,n))}function Kx(e,t,n){var r=ps(e,t,n);return r>n?n:r}function Lh(){return{top:0,right:0,bottom:0,left:0}}function _h(e){return Object.assign({},Lh(),e)}function Mh(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var Gx=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,_h(typeof t!="number"?t:Mh(t,cs))};function Jx(e){var t,n=e.state,r=e.name,o=e.options,s=n.elements.arrow,i=n.modifiersData.popperOffsets,l=Un(n.placement),u=nc(l),d=[Gt,pn].indexOf(l)>=0,c=d?"height":"width";if(!(!s||!i)){var p=Gx(o.padding,n),f=tc(s),h=u==="y"?Kt:Gt,g=u==="y"?fn:pn,m=n.rects.reference[c]+n.rects.reference[u]-i[u]-n.rects.popper[c],w=i[u]-n.rects.reference[u],T=fs(s),k=T?u==="y"?T.clientHeight||0:T.clientWidth||0:0,S=m/2-w/2,y=p[h],E=k-f[c]-p[g],D=k/2-f[c]/2+S,$=ps(y,D,E),_=u;n.modifiersData[r]=(t={},t[_]=$,t.centerOffset=$-D,t)}}function Xx(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||$h(t.elements.popper,o)&&(t.elements.arrow=o))}const Yx={name:"arrow",enabled:!0,phase:"main",fn:Jx,effect:Xx,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function So(e){return e.split("-")[1]}var Zx={top:"auto",right:"auto",bottom:"auto",left:"auto"};function eA(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:bo(n*o)/o||0,y:bo(r*o)/o||0}}function Nh(e){var t,n=e.popper,r=e.popperRect,o=e.placement,s=e.variation,i=e.offsets,l=e.position,u=e.gpuAcceleration,d=e.adaptive,c=e.roundOffsets,p=e.isFixed,f=i.x,h=f===void 0?0:f,g=i.y,m=g===void 0?0:g,w=typeof c=="function"?c({x:h,y:m}):{x:h,y:m};h=w.x,m=w.y;var T=i.hasOwnProperty("x"),k=i.hasOwnProperty("y"),S=Gt,y=Kt,E=window;if(d){var D=fs(n),$="clientHeight",_="clientWidth";if(D===Zt(n)&&(D=kr(n),ir(D).position!=="static"&&l==="absolute"&&($="scrollHeight",_="scrollWidth")),D=D,o===Kt||(o===Gt||o===pn)&&s===us){y=fn;var L=p&&D===E&&E.visualViewport?E.visualViewport.height:D[$];m-=L-r.height,m*=u?1:-1}if(o===Gt||(o===Kt||o===fn)&&s===us){S=pn;var V=p&&D===E&&E.visualViewport?E.visualViewport.width:D[_];h-=V-r.width,h*=u?1:-1}}var te=Object.assign({position:l},d&&Zx),B=c===!0?eA({x:h,y:m},Zt(n)):{x:h,y:m};if(h=B.x,m=B.y,u){var O;return Object.assign({},te,(O={},O[y]=k?"0":"",O[S]=T?"0":"",O.transform=(E.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",O))}return Object.assign({},te,(t={},t[y]=k?m+"px":"",t[S]=T?h+"px":"",t.transform="",t))}function tA(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,s=n.adaptive,i=s===void 0?!0:s,l=n.roundOffsets,u=l===void 0?!0:l,d={placement:Un(t.placement),variation:So(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Nh(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Nh(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const nA={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:tA,data:{}};var Hi={passive:!0};function rA(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,s=o===void 0?!0:o,i=r.resize,l=i===void 0?!0:i,u=Zt(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&d.forEach(function(c){c.addEventListener("scroll",n.update,Hi)}),l&&u.addEventListener("resize",n.update,Hi),function(){s&&d.forEach(function(c){c.removeEventListener("scroll",n.update,Hi)}),l&&u.removeEventListener("resize",n.update,Hi)}}const oA={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:rA,data:{}};var sA={left:"right",right:"left",bottom:"top",top:"bottom"};function Wi(e){return e.replace(/left|right|bottom|top/g,function(t){return sA[t]})}var iA={start:"end",end:"start"};function Bh(e){return e.replace(/start|end/g,function(t){return iA[t]})}function rc(e){var t=Zt(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function oc(e){return wo(kr(e)).left+rc(e).scrollLeft}function aA(e,t){var n=Zt(e),r=kr(e),o=n.visualViewport,s=r.clientWidth,i=r.clientHeight,l=0,u=0;if(o){s=o.width,i=o.height;var d=Fh();(d||!d&&t==="fixed")&&(l=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:l+oc(e),y:u}}function lA(e){var t,n=kr(e),r=rc(e),o=(t=e.ownerDocument)==null?void 0:t.body,s=Hr(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=Hr(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-r.scrollLeft+oc(e),u=-r.scrollTop;return ir(o||n).direction==="rtl"&&(l+=Hr(n.clientWidth,o?o.clientWidth:0)-s),{width:s,height:i,x:l,y:u}}function sc(e){var t=ir(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function jh(e){return["html","body","#document"].indexOf(zn(e))>=0?e.ownerDocument.body:hn(e)&&sc(e)?e:jh(qi(e))}function hs(e,t){var n;t===void 0&&(t=[]);var r=jh(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Zt(r),i=o?[s].concat(s.visualViewport||[],sc(r)?r:[]):r,l=t.concat(i);return o?l:l.concat(hs(qi(i)))}function ic(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function cA(e,t){var n=wo(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function zh(e,t,n){return t===Rh?ic(aA(e,n)):qr(t)?cA(t,n):ic(lA(kr(e)))}function uA(e){var t=hs(qi(e)),n=["absolute","fixed"].indexOf(ir(e).position)>=0,r=n&&hn(e)?fs(e):e;return qr(r)?t.filter(function(o){return qr(o)&&$h(o,r)&&zn(o)!=="body"}):[]}function dA(e,t,n,r){var o=t==="clippingParents"?uA(e):[].concat(t),s=[].concat(o,[n]),i=s[0],l=s.reduce(function(u,d){var c=zh(e,d,r);return u.top=Hr(c.top,u.top),u.right=Vi(c.right,u.right),u.bottom=Vi(c.bottom,u.bottom),u.left=Hr(c.left,u.left),u},zh(e,i,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function Uh(e){var t=e.reference,n=e.element,r=e.placement,o=r?Un(r):null,s=r?So(r):null,i=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,u;switch(o){case Kt:u={x:i,y:t.y-n.height};break;case fn:u={x:i,y:t.y+t.height};break;case pn:u={x:t.x+t.width,y:l};break;case Gt:u={x:t.x-n.width,y:l};break;default:u={x:t.x,y:t.y}}var d=o?nc(o):null;if(d!=null){var c=d==="y"?"height":"width";switch(s){case yo:u[d]=u[d]-(t[c]/2-n[c]/2);break;case us:u[d]=u[d]+(t[c]/2-n[c]/2);break}}return u}function To(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,s=n.strategy,i=s===void 0?e.strategy:s,l=n.boundary,u=l===void 0?Fx:l,d=n.rootBoundary,c=d===void 0?Rh:d,p=n.elementContext,f=p===void 0?ds:p,h=n.altBoundary,g=h===void 0?!1:h,m=n.padding,w=m===void 0?0:m,T=_h(typeof w!="number"?w:Mh(w,cs)),k=f===ds?$x:ds,S=e.rects.popper,y=e.elements[g?k:f],E=dA(qr(y)?y:y.contextElement||kr(e.elements.popper),u,c,i),D=wo(e.elements.reference),$=Uh({reference:D,element:S,placement:o}),_=ic(Object.assign({},S,$)),L=f===ds?_:D,V={top:E.top-L.top+T.top,bottom:L.bottom-E.bottom+T.bottom,left:E.left-L.left+T.left,right:L.right-E.right+T.right},te=e.modifiersData.offset;if(f===ds&&te){var B=te[o];Object.keys(V).forEach(function(O){var M=[pn,fn].indexOf(O)>=0?1:-1,N=[Kt,fn].indexOf(O)>=0?"y":"x";V[O]+=B[N]*M})}return V}function fA(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,s=n.rootBoundary,i=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,d=u===void 0?Ph:u,c=So(r),p=c?l?Dh:Dh.filter(function(g){return So(g)===c}):cs,f=p.filter(function(g){return d.indexOf(g)>=0});f.length===0&&(f=p);var h=f.reduce(function(g,m){return g[m]=To(e,{placement:m,boundary:o,rootBoundary:s,padding:i})[Un(m)],g},{});return Object.keys(h).sort(function(g,m){return h[g]-h[m]})}function pA(e){if(Un(e)===Yl)return[];var t=Wi(e);return[Bh(e),t,Bh(t)]}function hA(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,s=o===void 0?!0:o,i=n.altAxis,l=i===void 0?!0:i,u=n.fallbackPlacements,d=n.padding,c=n.boundary,p=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,g=h===void 0?!0:h,m=n.allowedAutoPlacements,w=t.options.placement,T=Un(w),k=T===w,S=u||(k||!g?[Wi(w)]:pA(w)),y=[w].concat(S).reduce(function(fe,be){return fe.concat(Un(be)===Yl?fA(t,{placement:be,boundary:c,rootBoundary:p,padding:d,flipVariations:g,allowedAutoPlacements:m}):be)},[]),E=t.rects.reference,D=t.rects.popper,$=new Map,_=!0,L=y[0],V=0;V<y.length;V++){var te=y[V],B=Un(te),O=So(te)===yo,M=[Kt,fn].indexOf(B)>=0,N=M?"width":"height",q=To(t,{placement:te,boundary:c,rootBoundary:p,altBoundary:f,padding:d}),j=M?O?pn:Gt:O?fn:Kt;E[N]>D[N]&&(j=Wi(j));var H=Wi(j),se=[];if(s&&se.push(q[B]<=0),l&&se.push(q[j]<=0,q[H]<=0),se.every(function(fe){return fe})){L=te,_=!1;break}$.set(te,se)}if(_)for(var Y=g?3:1,ae=function(be){var xe=y.find(function(he){var ie=$.get(he);if(ie)return ie.slice(0,be).every(function(de){return de})});if(xe)return L=xe,"break"},ne=Y;ne>0;ne--){var pe=ae(ne);if(pe==="break")break}t.placement!==L&&(t.modifiersData[r]._skip=!0,t.placement=L,t.reset=!0)}}const mA={name:"flip",enabled:!0,phase:"main",fn:hA,requiresIfExists:["offset"],data:{_skip:!1}};function Vh(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function qh(e){return[Kt,pn,fn,Gt].some(function(t){return e[t]>=0})}function gA(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,s=t.modifiersData.preventOverflow,i=To(t,{elementContext:"reference"}),l=To(t,{altBoundary:!0}),u=Vh(i,r),d=Vh(l,o,s),c=qh(u),p=qh(d);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:d,isReferenceHidden:c,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":p})}const vA={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:gA};function yA(e,t,n){var r=Un(e),o=[Gt,Kt].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,i=s[0],l=s[1];return i=i||0,l=(l||0)*o,[Gt,pn].indexOf(r)>=0?{x:l,y:i}:{x:i,y:l}}function bA(e){var t=e.state,n=e.options,r=e.name,o=n.offset,s=o===void 0?[0,0]:o,i=Ph.reduce(function(c,p){return c[p]=yA(p,t.rects,s),c},{}),l=i[t.placement],u=l.x,d=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=d),t.modifiersData[r]=i}const wA={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:bA};function SA(e){var t=e.state,n=e.name;t.modifiersData[n]=Uh({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const TA={name:"popperOffsets",enabled:!0,phase:"read",fn:SA,data:{}};function kA(e){return e==="x"?"y":"x"}function CA(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=o===void 0?!0:o,i=n.altAxis,l=i===void 0?!1:i,u=n.boundary,d=n.rootBoundary,c=n.altBoundary,p=n.padding,f=n.tether,h=f===void 0?!0:f,g=n.tetherOffset,m=g===void 0?0:g,w=To(t,{boundary:u,rootBoundary:d,padding:p,altBoundary:c}),T=Un(t.placement),k=So(t.placement),S=!k,y=nc(T),E=kA(y),D=t.modifiersData.popperOffsets,$=t.rects.reference,_=t.rects.popper,L=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,V=typeof L=="number"?{mainAxis:L,altAxis:L}:Object.assign({mainAxis:0,altAxis:0},L),te=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,B={x:0,y:0};if(D){if(s){var O,M=y==="y"?Kt:Gt,N=y==="y"?fn:pn,q=y==="y"?"height":"width",j=D[y],H=j+w[M],se=j-w[N],Y=h?-_[q]/2:0,ae=k===yo?$[q]:_[q],ne=k===yo?-_[q]:-$[q],pe=t.elements.arrow,fe=h&&pe?tc(pe):{width:0,height:0},be=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Lh(),xe=be[M],he=be[N],ie=ps(0,$[q],fe[q]),de=S?$[q]/2-Y-ie-xe-V.mainAxis:ae-ie-xe-V.mainAxis,ue=S?-$[q]/2+Y+ie+he+V.mainAxis:ne+ie+he+V.mainAxis,Se=t.elements.arrow&&fs(t.elements.arrow),$e=Se?y==="y"?Se.clientTop||0:Se.clientLeft||0:0,Ve=(O=te?.[y])!=null?O:0,lt=j+de-Ve-$e,Tt=j+ue-Ve,ut=ps(h?Vi(H,lt):H,j,h?Hr(se,Tt):se);D[y]=ut,B[y]=ut-j}if(l){var gt,ve=y==="x"?Kt:Gt,ke=y==="x"?fn:pn,qe=D[E],We=E==="y"?"height":"width",Jt=qe+w[ve],Xt=qe-w[ke],kt=[Kt,Gt].indexOf(T)!==-1,dt=(gt=te?.[E])!=null?gt:0,mn=kt?Jt:qe-$[We]-_[We]-dt+V.altAxis,qn=kt?qe+$[We]+_[We]-dt-V.altAxis:Xt,At=h&&kt?Kx(mn,qe,qn):ps(h?mn:Jt,qe,h?qn:Xt);D[E]=At,B[E]=At-qe}t.modifiersData[r]=B}}const xA={name:"preventOverflow",enabled:!0,phase:"main",fn:CA,requiresIfExists:["offset"]};function AA(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function EA(e){return e===Zt(e)||!hn(e)?rc(e):AA(e)}function RA(e){var t=e.getBoundingClientRect(),n=bo(t.width)/e.offsetWidth||1,r=bo(t.height)/e.offsetHeight||1;return n!==1||r!==1}function DA(e,t,n){n===void 0&&(n=!1);var r=hn(t),o=hn(t)&&RA(t),s=kr(t),i=wo(e,o,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((zn(t)!=="body"||sc(s))&&(l=EA(t)),hn(t)?(u=wo(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=oc(s))),{x:i.left+l.scrollLeft-u.x,y:i.top+l.scrollTop-u.y,width:i.width,height:i.height}}function PA(e){var t=new Map,n=new Set,r=[];e.forEach(function(s){t.set(s.name,s)});function o(s){n.add(s.name);var i=[].concat(s.requires||[],s.requiresIfExists||[]);i.forEach(function(l){if(!n.has(l)){var u=t.get(l);u&&o(u)}}),r.push(s)}return e.forEach(function(s){n.has(s.name)||o(s)}),r}function IA(e){var t=PA(e);return Vx.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function FA(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function $A(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Hh={placement:"bottom",modifiers:[],strategy:"absolute"};function Wh(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function OA(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,s=o===void 0?Hh:o;return function(l,u,d){d===void 0&&(d=s);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},Hh,s),modifiersData:{},elements:{reference:l,popper:u},attributes:{},styles:{}},p=[],f=!1,h={state:c,setOptions:function(T){var k=typeof T=="function"?T(c.options):T;m(),c.options=Object.assign({},s,c.options,k),c.scrollParents={reference:qr(l)?hs(l):l.contextElement?hs(l.contextElement):[],popper:hs(u)};var S=IA($A([].concat(r,c.options.modifiers)));return c.orderedModifiers=S.filter(function(y){return y.enabled}),g(),h.update()},forceUpdate:function(){if(!f){var T=c.elements,k=T.reference,S=T.popper;if(Wh(k,S)){c.rects={reference:DA(k,fs(S),c.options.strategy==="fixed"),popper:tc(S)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(V){return c.modifiersData[V.name]=Object.assign({},V.data)});for(var y=0;y<c.orderedModifiers.length;y++){if(c.reset===!0){c.reset=!1,y=-1;continue}var E=c.orderedModifiers[y],D=E.fn,$=E.options,_=$===void 0?{}:$,L=E.name;typeof D=="function"&&(c=D({state:c,options:_,name:L,instance:h})||c)}}}},update:FA(function(){return new Promise(function(w){h.forceUpdate(),w(c)})}),destroy:function(){m(),f=!0}};if(!Wh(l,u))return h;h.setOptions(d).then(function(w){!f&&d.onFirstUpdate&&d.onFirstUpdate(w)});function g(){c.orderedModifiers.forEach(function(w){var T=w.name,k=w.options,S=k===void 0?{}:k,y=w.effect;if(typeof y=="function"){var E=y({state:c,name:T,instance:h,options:S}),D=function(){};p.push(E||D)}})}function m(){p.forEach(function(w){return w()}),p=[]}return h}}var LA=[oA,TA,nA,Ih,wA,mA,xA,Yx,vA],_A=OA({defaultModifiers:LA}),MA="tippy-box",Qh="tippy-content",NA="tippy-backdrop",Kh="tippy-arrow",Gh="tippy-svg-arrow",Wr={passive:!0,capture:!0},Jh=function(){return document.body};function BA(e,t){return{}.hasOwnProperty.call(e,t)}function ac(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function lc(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function Xh(e,t){return typeof e=="function"?e.apply(void 0,t):e}function Yh(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function jA(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function zA(e){return e.split(/\s+/).filter(Boolean)}function ko(e){return[].concat(e)}function Zh(e,t){e.indexOf(t)===-1&&e.push(t)}function UA(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function VA(e){return e.split("-")[0]}function Qi(e){return[].slice.call(e)}function em(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function ms(){return document.createElement("div")}function gs(e){return["Element","Fragment"].some(function(t){return lc(e,t)})}function qA(e){return lc(e,"NodeList")}function HA(e){return lc(e,"MouseEvent")}function tm(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function WA(e){return gs(e)?[e]:qA(e)?Qi(e):Array.isArray(e)?e:Qi(document.querySelectorAll(e))}function cc(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function nm(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function QA(e){var t,n=ko(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function KA(e,t){var n=t.clientX,r=t.clientY;return e.every(function(o){var s=o.popperRect,i=o.popperState,l=o.props,u=l.interactiveBorder,d=VA(i.placement),c=i.modifiersData.offset;if(!c)return!0;var p=d==="bottom"?c.top.y:0,f=d==="top"?c.bottom.y:0,h=d==="right"?c.left.x:0,g=d==="left"?c.right.x:0,m=s.top-r+p>u,w=r-s.bottom-f>u,T=s.left-n+h>u,k=n-s.right-g>u;return m||w||T||k})}function uc(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){e[r](o,n)})}function rm(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Vn={isTouch:!1},om=0;function GA(){Vn.isTouch||(Vn.isTouch=!0,window.performance&&document.addEventListener("mousemove",sm))}function sm(){var e=performance.now();e-om<20&&(Vn.isTouch=!1,document.removeEventListener("mousemove",sm)),om=e}function JA(){var e=document.activeElement;if(tm(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function XA(){document.addEventListener("touchstart",GA,Wr),window.addEventListener("blur",JA)}var YA=typeof window<"u"&&typeof document<"u",ZA=YA?!!window.msCrypto:!1;function Co(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function im(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function eE(e){return im(`
44
12
  %ctippy.js
45
13
 
46
- %c`+e0(e)+`
14
+ %c`+im(e)+`
47
15
 
48
16
  %c👷‍ This is a development-only message. It will be removed in production.
49
- `)}function t0(e){return[GD(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var rs;be.env.NODE_ENV!=="production"&&QD();function QD(){rs=new Set}function _r(e,t){if(e&&!rs.has(t)){var n;rs.add(t),(n=console).warn.apply(n,t0(t))}}function Ad(e,t){if(e&&!rs.has(t)){var n;rs.add(t),(n=console).error.apply(n,t0(t))}}function XD(e){var t=!e,n=Object.prototype.toString.call(e)==="[object Object]"&&!e.addEventListener;Ad(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Ad(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var n0={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},YD={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Pn=Object.assign({appendTo:zw,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},n0,YD),JD=Object.keys(Pn),ZD=function(t){be.env.NODE_ENV!=="production"&&o0(t,[]);var n=Object.keys(t);n.forEach(function(r){Pn[r]=t[r]})};function r0(e){var t=e.plugins||[],n=t.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var a;r[o]=e[o]!==void 0?e[o]:(a=Pn[o])!=null?a:s}return r},{});return Object.assign({},e,n)}function eN(e,t){var n=t?Object.keys(r0(Object.assign({},Pn,{plugins:t}))):JD,r=n.reduce(function(i,o){var s=(e.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function i0(e,t){var n=Object.assign({},t,{content:Ww(t.content,[e])},t.ignoreAttributes?{}:eN(e,t.plugins));return n.aria=Object.assign({},Pn.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}function o0(e,t){e===void 0&&(e={}),t===void 0&&(t=[]);var n=Object.keys(e);n.forEach(function(r){var i=DD(Pn,Object.keys(n0)),o=!_D(i,r);o&&(o=t.filter(function(s){return s.name===r}).length===0),_r(o,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
17
+ `)}function am(e){return[eE(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var vs;ce.env.NODE_ENV!=="production"&&tE();function tE(){vs=new Set}function ar(e,t){if(e&&!vs.has(t)){var n;vs.add(t),(n=console).warn.apply(n,am(t))}}function dc(e,t){if(e&&!vs.has(t)){var n;vs.add(t),(n=console).error.apply(n,am(t))}}function nE(e){var t=!e,n=Object.prototype.toString.call(e)==="[object Object]"&&!e.addEventListener;dc(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),dc(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var lm={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},rE={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},en=Object.assign({appendTo:Jh,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},lm,rE),oE=Object.keys(en),sE=function(t){ce.env.NODE_ENV!=="production"&&dm(t,[]);var n=Object.keys(t);n.forEach(function(r){en[r]=t[r]})};function cm(e){var t=e.plugins||[],n=t.reduce(function(r,o){var s=o.name,i=o.defaultValue;if(s){var l;r[s]=e[s]!==void 0?e[s]:(l=en[s])!=null?l:i}return r},{});return Object.assign({},e,n)}function iE(e,t){var n=t?Object.keys(cm(Object.assign({},en,{plugins:t}))):oE,r=n.reduce(function(o,s){var i=(e.getAttribute("data-tippy-"+s)||"").trim();if(!i)return o;if(s==="content")o[s]=i;else try{o[s]=JSON.parse(i)}catch{o[s]=i}return o},{});return r}function um(e,t){var n=Object.assign({},t,{content:Xh(t.content,[e])},t.ignoreAttributes?{}:iE(e,t.plugins));return n.aria=Object.assign({},en.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}function dm(e,t){e===void 0&&(e={}),t===void 0&&(t=[]);var n=Object.keys(e);n.forEach(function(r){var o=jA(en,Object.keys(lm)),s=!BA(o,r);s&&(s=t.filter(function(i){return i.name===r}).length===0),ar(s,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
50
18
 
51
19
  `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
52
- `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var tN=function(){return"innerHTML"};function xd(e,t){e[tN()]=t}function s0(e){var t=ts();return e===!0?t.className=Vw:(t.className=qw,ns(e)?t.appendChild(e):xd(t,e)),t}function a0(e,t){ns(t.content)?(xd(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?xd(e,t.content):e.textContent=t.content)}function Cd(e){var t=e.firstElementChild,n=qa(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(Uw)}),arrow:n.find(function(r){return r.classList.contains(Vw)||r.classList.contains(qw)}),backdrop:n.find(function(r){return r.classList.contains(FD)})}}function l0(e){var t=ts(),n=ts();n.className=OD,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=ts();r.className=Uw,r.setAttribute("data-state","hidden"),a0(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(o,s){var a=Cd(t),l=a.box,u=a.content,c=a.arrow;s.theme?l.setAttribute("data-theme",s.theme):l.removeAttribute("data-theme"),typeof s.animation=="string"?l.setAttribute("data-animation",s.animation):l.removeAttribute("data-animation"),s.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?l.setAttribute("role",s.role):l.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&a0(u,e.props),s.arrow?c?o.arrow!==s.arrow&&(l.removeChild(c),l.appendChild(s0(s.arrow))):l.appendChild(s0(s.arrow)):c&&l.removeChild(c)}return{popper:t,onUpdate:i}}l0.$$tippy=!0;var nN=1,za=[],Wa=[];function rN(e,t){var n=i0(e,Object.assign({},Pn,r0(Gw(t)))),r,i,o,s=!1,a=!1,l=!1,u=!1,c,d,p,m=[],b=Hw(Re,n.interactiveDebounce),w,S=nN++,y=null,g=LD(n.plugins),v={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},h={id:S,reference:e,popper:ts(),popperInstance:y,props:n,state:v,plugins:g,clearDelayTimeouts:Et,setProps:Tt,setContent:at,show:vn,hide:U,hideWithInteractivity:k,enable:wt,disable:St,unmount:P,destroy:Q};if(!n.render)return be.env.NODE_ENV!=="production"&&Ad(!0,"render() function has not been supplied."),h;var E=n.render(h),T=E.popper,R=E.onUpdate;T.setAttribute("data-tippy-root",""),T.id="tippy-"+h.id,h.popper=T,e._tippy=h,T._tippy=h;var C=g.map(function(K){return K.fn(h)}),A=e.hasAttribute("aria-expanded");return B(),oe(),J(),se("onCreate",[h]),n.showOnCreate&&Ye(),T.addEventListener("mouseenter",function(){h.props.interactive&&h.state.isVisible&&h.clearDelayTimeouts()}),T.addEventListener("mouseleave",function(){h.props.interactive&&h.props.trigger.indexOf("mouseenter")>=0&&W().addEventListener("mousemove",b)}),h;function D(){var K=h.props.touch;return Array.isArray(K)?K:[K,0]}function V(){return D()[0]==="hold"}function O(){var K;return!!((K=h.props.render)!=null&&K.$$tippy)}function N(){return w||e}function W(){var K=N().parentNode;return K?UD(K):document}function L(){return Cd(T)}function ee(K){return h.state.isMounted&&!h.state.isVisible||mr.isTouch||c&&c.type==="focus"?0:wd(h.props.delay,K?0:1,Pn.delay)}function J(K){K===void 0&&(K=!1),T.style.pointerEvents=h.props.interactive&&!K?"":"none",T.style.zIndex=""+h.props.zIndex}function se(K,ne,de){if(de===void 0&&(de=!0),C.forEach(function(Ne){Ne[K]&&Ne[K].apply(Ne,ne)}),de){var _e;(_e=h.props)[K].apply(_e,ne)}}function he(){var K=h.props.aria;if(K.content){var ne="aria-"+K.content,de=T.id,_e=ro(h.props.triggerTarget||e);_e.forEach(function(Ne){var xe=Ne.getAttribute(ne);if(h.state.isVisible)Ne.setAttribute(ne,xe?xe+" "+de:de);else{var Be=xe&&xe.replace(de,"").trim();Be?Ne.setAttribute(ne,Be):Ne.removeAttribute(ne)}})}}function oe(){if(!(A||!h.props.aria.expanded)){var K=ro(h.props.triggerTarget||e);K.forEach(function(ne){h.props.interactive?ne.setAttribute("aria-expanded",h.state.isVisible&&ne===N()?"true":"false"):ne.removeAttribute("aria-expanded")})}}function we(){W().removeEventListener("mousemove",b),za=za.filter(function(K){return K!==b})}function X(K){if(!(mr.isTouch&&(l||K.type==="mousedown"))){var ne=K.composedPath&&K.composedPath()[0]||K.target;if(!(h.props.interactive&&Yw(T,ne))){if(ro(h.props.triggerTarget||e).some(function(de){return Yw(de,ne)})){if(mr.isTouch||h.state.isVisible&&h.props.trigger.indexOf("click")>=0)return}else se("onClickOutside",[h,K]);h.props.hideOnClick===!0&&(h.clearDelayTimeouts(),h.hide(),a=!0,setTimeout(function(){a=!1}),h.state.isMounted||te())}}}function ie(){l=!0}function le(){l=!1}function Ae(){var K=W();K.addEventListener("mousedown",X,!0),K.addEventListener("touchend",X,Si),K.addEventListener("touchstart",le,Si),K.addEventListener("touchmove",ie,Si)}function te(){var K=W();K.removeEventListener("mousedown",X,!0),K.removeEventListener("touchend",X,Si),K.removeEventListener("touchstart",le,Si),K.removeEventListener("touchmove",ie,Si)}function F(K,ne){G(K,function(){!h.state.isVisible&&T.parentNode&&T.parentNode.contains(T)&&ne()})}function x(K,ne){G(K,ne)}function G(K,ne){var de=L().box;function _e(Ne){Ne.target===de&&(Td(de,"remove",_e),ne())}if(K===0)return ne();Td(de,"remove",d),Td(de,"add",_e),d=_e}function H(K,ne,de){de===void 0&&(de=!1);var _e=ro(h.props.triggerTarget||e);_e.forEach(function(Ne){Ne.addEventListener(K,ne,de),m.push({node:Ne,eventType:K,handler:ne,options:de})})}function B(){V()&&(H("touchstart",ge,{passive:!0}),H("touchend",De,{passive:!0})),ND(h.props.trigger).forEach(function(K){if(K!=="manual")switch(H(K,ge),K){case"mouseenter":H("mouseleave",De);break;case"focus":H(KD?"focusout":"blur",Ce);break;case"focusin":H("focusout",Ce);break}})}function z(){m.forEach(function(K){var ne=K.node,de=K.eventType,_e=K.handler,Ne=K.options;ne.removeEventListener(de,_e,Ne)}),m=[]}function ge(K){var ne,de=!1;if(!(!h.state.isEnabled||Ie(K)||a)){var _e=((ne=c)==null?void 0:ne.type)==="focus";c=K,w=K.currentTarget,oe(),!h.state.isVisible&&BD(K)&&za.forEach(function(Ne){return Ne(K)}),K.type==="click"&&(h.props.trigger.indexOf("mouseenter")<0||s)&&h.props.hideOnClick!==!1&&h.state.isVisible?de=!0:Ye(K),K.type==="click"&&(s=!de),de&&!_e&&Ze(K)}}function Re(K){var ne=K.target,de=N().contains(ne)||T.contains(ne);if(!(K.type==="mousemove"&&de)){var _e=Ge().concat(T).map(function(Ne){var xe,Be=Ne._tippy,Qe=(xe=Be.popperInstance)==null?void 0:xe.state;return Qe?{popperRect:Ne.getBoundingClientRect(),popperState:Qe,props:n}:null}).filter(Boolean);VD(_e,K)&&(we(),Ze(K))}}function De(K){var ne=Ie(K)||h.props.trigger.indexOf("click")>=0&&s;if(!ne){if(h.props.interactive){h.hideWithInteractivity(K);return}Ze(K)}}function Ce(K){h.props.trigger.indexOf("focusin")<0&&K.target!==N()||h.props.interactive&&K.relatedTarget&&T.contains(K.relatedTarget)||Ze(K)}function Ie(K){return mr.isTouch?V()!==K.type.indexOf("touch")>=0:!1}function $e(){ye();var K=h.props,ne=K.popperOptions,de=K.placement,_e=K.offset,Ne=K.getReferenceClientRect,xe=K.moveTransition,Be=O()?Cd(T).arrow:null,Qe=Ne?{getBoundingClientRect:Ne,contextElement:Ne.contextElement||N()}:e,nn={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Le){var Ue=Le.state;if(O()){var yt=L(),j=yt.box;["placement","reference-hidden","escaped"].forEach(function(I){I==="placement"?j.setAttribute("data-placement",Ue.placement):Ue.attributes.popper["data-popper-"+I]?j.setAttribute("data-"+I,""):j.removeAttribute("data-"+I)}),Ue.attributes.popper={}}}},Ut=[{name:"offset",options:{offset:_e}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!xe}},nn];O()&&Be&&Ut.push({name:"arrow",options:{element:Be,padding:3}}),Ut.push.apply(Ut,ne?.modifiers||[]),h.popperInstance=ID(Qe,T,Object.assign({},ne,{placement:de,onFirstUpdate:p,modifiers:Ut}))}function ye(){h.popperInstance&&(h.popperInstance.destroy(),h.popperInstance=null)}function Ke(){var K=h.props.appendTo,ne,de=N();h.props.interactive&&K===zw||K==="parent"?ne=de.parentNode:ne=Ww(K,[de]),ne.contains(T)||ne.appendChild(T),h.state.isMounted=!0,$e(),be.env.NODE_ENV!=="production"&&_r(h.props.interactive&&K===Pn.appendTo&&de.nextElementSibling!==T,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
20
+ `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var aE=function(){return"innerHTML"};function fc(e,t){e[aE()]=t}function fm(e){var t=ms();return e===!0?t.className=Kh:(t.className=Gh,gs(e)?t.appendChild(e):fc(t,e)),t}function pm(e,t){gs(t.content)?(fc(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?fc(e,t.content):e.textContent=t.content)}function pc(e){var t=e.firstElementChild,n=Qi(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(Qh)}),arrow:n.find(function(r){return r.classList.contains(Kh)||r.classList.contains(Gh)}),backdrop:n.find(function(r){return r.classList.contains(NA)})}}function hm(e){var t=ms(),n=ms();n.className=MA,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=ms();r.className=Qh,r.setAttribute("data-state","hidden"),pm(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props);function o(s,i){var l=pc(t),u=l.box,d=l.content,c=l.arrow;i.theme?u.setAttribute("data-theme",i.theme):u.removeAttribute("data-theme"),typeof i.animation=="string"?u.setAttribute("data-animation",i.animation):u.removeAttribute("data-animation"),i.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof i.maxWidth=="number"?i.maxWidth+"px":i.maxWidth,i.role?u.setAttribute("role",i.role):u.removeAttribute("role"),(s.content!==i.content||s.allowHTML!==i.allowHTML)&&pm(d,e.props),i.arrow?c?s.arrow!==i.arrow&&(u.removeChild(c),u.appendChild(fm(i.arrow))):u.appendChild(fm(i.arrow)):c&&u.removeChild(c)}return{popper:t,onUpdate:o}}hm.$$tippy=!0;var lE=1,Ki=[],Gi=[];function cE(e,t){var n=um(e,Object.assign({},en,cm(em(t)))),r,o,s,i=!1,l=!1,u=!1,d=!1,c,p,f,h=[],g=Yh(lt,n.interactiveDebounce),m,w=lE++,T=null,k=UA(n.plugins),S={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},y={id:w,reference:e,popper:ms(),popperInstance:T,props:n,state:S,plugins:k,clearDelayTimeouts:mn,setProps:qn,setContent:At,show:En,hide:C,hideWithInteractivity:v,enable:kt,disable:dt,unmount:b,destroy:F};if(!n.render)return ce.env.NODE_ENV!=="production"&&dc(!0,"render() function has not been supplied."),y;var E=n.render(y),D=E.popper,$=E.onUpdate;D.setAttribute("data-tippy-root",""),D.id="tippy-"+y.id,y.popper=D,e._tippy=y,D._tippy=y;var _=k.map(function(P){return P.fn(y)}),L=e.hasAttribute("aria-expanded");return Se(),Y(),j(),H("onCreate",[y]),n.showOnCreate&&Jt(),D.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),D.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&M().addEventListener("mousemove",g)}),y;function V(){var P=y.props.touch;return Array.isArray(P)?P:[P,0]}function te(){return V()[0]==="hold"}function B(){var P;return!!((P=y.props.render)!=null&&P.$$tippy)}function O(){return m||e}function M(){var P=O().parentNode;return P?QA(P):document}function N(){return pc(D)}function q(P){return y.state.isMounted&&!y.state.isVisible||Vn.isTouch||c&&c.type==="focus"?0:ac(y.props.delay,P?0:1,en.delay)}function j(P){P===void 0&&(P=!1),D.style.pointerEvents=y.props.interactive&&!P?"":"none",D.style.zIndex=""+y.props.zIndex}function H(P,U,X){if(X===void 0&&(X=!0),_.forEach(function(ye){ye[P]&&ye[P].apply(ye,U)}),X){var ee;(ee=y.props)[P].apply(ee,U)}}function se(){var P=y.props.aria;if(P.content){var U="aria-"+P.content,X=D.id,ee=ko(y.props.triggerTarget||e);ee.forEach(function(ye){var Ie=ye.getAttribute(U);if(y.state.isVisible)ye.setAttribute(U,Ie?Ie+" "+X:X);else{var Fe=Ie&&Ie.replace(X,"").trim();Fe?ye.setAttribute(U,Fe):ye.removeAttribute(U)}})}}function Y(){if(!(L||!y.props.aria.expanded)){var P=ko(y.props.triggerTarget||e);P.forEach(function(U){y.props.interactive?U.setAttribute("aria-expanded",y.state.isVisible&&U===O()?"true":"false"):U.removeAttribute("aria-expanded")})}}function ae(){M().removeEventListener("mousemove",g),Ki=Ki.filter(function(P){return P!==g})}function ne(P){if(!(Vn.isTouch&&(u||P.type==="mousedown"))){var U=P.composedPath&&P.composedPath()[0]||P.target;if(!(y.props.interactive&&rm(D,U))){if(ko(y.props.triggerTarget||e).some(function(X){return rm(X,U)})){if(Vn.isTouch||y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else H("onClickOutside",[y,P]);y.props.hideOnClick===!0&&(y.clearDelayTimeouts(),y.hide(),l=!0,setTimeout(function(){l=!1}),y.state.isMounted||xe())}}}function pe(){u=!0}function fe(){u=!1}function be(){var P=M();P.addEventListener("mousedown",ne,!0),P.addEventListener("touchend",ne,Wr),P.addEventListener("touchstart",fe,Wr),P.addEventListener("touchmove",pe,Wr)}function xe(){var P=M();P.removeEventListener("mousedown",ne,!0),P.removeEventListener("touchend",ne,Wr),P.removeEventListener("touchstart",fe,Wr),P.removeEventListener("touchmove",pe,Wr)}function he(P,U){de(P,function(){!y.state.isVisible&&D.parentNode&&D.parentNode.contains(D)&&U()})}function ie(P,U){de(P,U)}function de(P,U){var X=N().box;function ee(ye){ye.target===X&&(uc(X,"remove",ee),U())}if(P===0)return U();uc(X,"remove",p),uc(X,"add",ee),p=ee}function ue(P,U,X){X===void 0&&(X=!1);var ee=ko(y.props.triggerTarget||e);ee.forEach(function(ye){ye.addEventListener(P,U,X),h.push({node:ye,eventType:P,handler:U,options:X})})}function Se(){te()&&(ue("touchstart",Ve,{passive:!0}),ue("touchend",Tt,{passive:!0})),zA(y.props.trigger).forEach(function(P){if(P!=="manual")switch(ue(P,Ve),P){case"mouseenter":ue("mouseleave",Tt);break;case"focus":ue(ZA?"focusout":"blur",ut);break;case"focusin":ue("focusout",ut);break}})}function $e(){h.forEach(function(P){var U=P.node,X=P.eventType,ee=P.handler,ye=P.options;U.removeEventListener(X,ee,ye)}),h=[]}function Ve(P){var U,X=!1;if(!(!y.state.isEnabled||gt(P)||l)){var ee=((U=c)==null?void 0:U.type)==="focus";c=P,m=P.currentTarget,Y(),!y.state.isVisible&&HA(P)&&Ki.forEach(function(ye){return ye(P)}),P.type==="click"&&(y.props.trigger.indexOf("mouseenter")<0||i)&&y.props.hideOnClick!==!1&&y.state.isVisible?X=!0:Jt(P),P.type==="click"&&(i=!X),X&&!ee&&Xt(P)}}function lt(P){var U=P.target,X=O().contains(U)||D.contains(U);if(!(P.type==="mousemove"&&X)){var ee=We().concat(D).map(function(ye){var Ie,Fe=ye._tippy,Ne=(Ie=Fe.popperInstance)==null?void 0:Ie.state;return Ne?{popperRect:ye.getBoundingClientRect(),popperState:Ne,props:n}:null}).filter(Boolean);KA(ee,P)&&(ae(),Xt(P))}}function Tt(P){var U=gt(P)||y.props.trigger.indexOf("click")>=0&&i;if(!U){if(y.props.interactive){y.hideWithInteractivity(P);return}Xt(P)}}function ut(P){y.props.trigger.indexOf("focusin")<0&&P.target!==O()||y.props.interactive&&P.relatedTarget&&D.contains(P.relatedTarget)||Xt(P)}function gt(P){return Vn.isTouch?te()!==P.type.indexOf("touch")>=0:!1}function ve(){ke();var P=y.props,U=P.popperOptions,X=P.placement,ee=P.offset,ye=P.getReferenceClientRect,Ie=P.moveTransition,Fe=B()?pc(D).arrow:null,Ne=ye?{getBoundingClientRect:ye,contextElement:ye.contextElement||O()}:e,xs={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Eo){var Te=Eo.state;if(B()){var Oe=N(),tt=Oe.box;["placement","reference-hidden","escaped"].forEach(function(Vt){Vt==="placement"?tt.setAttribute("data-placement",Te.placement):Te.attributes.popper["data-popper-"+Vt]?tt.setAttribute("data-"+Vt,""):tt.removeAttribute("data-"+Vt)}),Te.attributes.popper={}}}},cr=[{name:"offset",options:{offset:ee}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Ie}},xs];B()&&Fe&&cr.push({name:"arrow",options:{element:Fe,padding:3}}),cr.push.apply(cr,U?.modifiers||[]),y.popperInstance=_A(Ne,D,Object.assign({},U,{placement:X,onFirstUpdate:f,modifiers:cr}))}function ke(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function qe(){var P=y.props.appendTo,U,X=O();y.props.interactive&&P===Jh||P==="parent"?U=X.parentNode:U=Xh(P,[X]),U.contains(D)||U.appendChild(D),y.state.isMounted=!0,ve(),ce.env.NODE_ENV!=="production"&&ar(y.props.interactive&&P===en.appendTo&&X.nextElementSibling!==D,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
53
21
 
54
22
  `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
55
23
 
56
24
  `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
57
25
 
58
- `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Ge(){return qa(T.querySelectorAll("[data-tippy-root]"))}function Ye(K){h.clearDelayTimeouts(),K&&se("onTrigger",[h,K]),Ae();var ne=ee(!0),de=D(),_e=de[0],Ne=de[1];mr.isTouch&&_e==="hold"&&Ne&&(ne=Ne),ne?r=setTimeout(function(){h.show()},ne):h.show()}function Ze(K){if(h.clearDelayTimeouts(),se("onUntrigger",[h,K]),!h.state.isVisible){te();return}if(!(h.props.trigger.indexOf("mouseenter")>=0&&h.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(K.type)>=0&&s)){var ne=ee(!1);ne?i=setTimeout(function(){h.state.isVisible&&h.hide()},ne):o=requestAnimationFrame(function(){h.hide()})}}function wt(){h.state.isEnabled=!0}function St(){h.hide(),h.state.isEnabled=!1}function Et(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function Tt(K){if(be.env.NODE_ENV!=="production"&&_r(h.state.isDestroyed,io("setProps")),!h.state.isDestroyed){se("onBeforeUpdate",[h,K]),z();var ne=h.props,de=i0(e,Object.assign({},ne,Gw(K),{ignoreAttributes:!0}));h.props=de,B(),ne.interactiveDebounce!==de.interactiveDebounce&&(we(),b=Hw(Re,de.interactiveDebounce)),ne.triggerTarget&&!de.triggerTarget?ro(ne.triggerTarget).forEach(function(_e){_e.removeAttribute("aria-expanded")}):de.triggerTarget&&e.removeAttribute("aria-expanded"),oe(),J(),R&&R(ne,de),h.popperInstance&&($e(),Ge().forEach(function(_e){requestAnimationFrame(_e._tippy.popperInstance.forceUpdate)})),se("onAfterUpdate",[h,K])}}function at(K){h.setProps({content:K})}function vn(){be.env.NODE_ENV!=="production"&&_r(h.state.isDestroyed,io("show"));var K=h.state.isVisible,ne=h.state.isDestroyed,de=!h.state.isEnabled,_e=mr.isTouch&&!h.props.touch,Ne=wd(h.props.duration,0,Pn.duration);if(!(K||ne||de||_e)&&!N().hasAttribute("disabled")&&(se("onShow",[h],!1),h.props.onShow(h)!==!1)){if(h.state.isVisible=!0,O()&&(T.style.visibility="visible"),J(),Ae(),h.state.isMounted||(T.style.transition="none"),O()){var xe=L(),Be=xe.box,Qe=xe.content;Ed([Be,Qe],0)}p=function(){var Ut;if(!(!h.state.isVisible||u)){if(u=!0,T.offsetHeight,T.style.transition=h.props.moveTransition,O()&&h.props.animation){var Nr=L(),Le=Nr.box,Ue=Nr.content;Ed([Le,Ue],Ne),Xw([Le,Ue],"visible")}he(),oe(),Kw(Wa,h),(Ut=h.popperInstance)==null||Ut.forceUpdate(),se("onMount",[h]),h.props.animation&&O()&&x(Ne,function(){h.state.isShown=!0,se("onShown",[h])})}},Ke()}}function U(){be.env.NODE_ENV!=="production"&&_r(h.state.isDestroyed,io("hide"));var K=!h.state.isVisible,ne=h.state.isDestroyed,de=!h.state.isEnabled,_e=wd(h.props.duration,1,Pn.duration);if(!(K||ne||de)&&(se("onHide",[h],!1),h.props.onHide(h)!==!1)){if(h.state.isVisible=!1,h.state.isShown=!1,u=!1,s=!1,O()&&(T.style.visibility="hidden"),we(),te(),J(!0),O()){var Ne=L(),xe=Ne.box,Be=Ne.content;h.props.animation&&(Ed([xe,Be],_e),Xw([xe,Be],"hidden"))}he(),oe(),h.props.animation?O()&&F(_e,h.unmount):h.unmount()}}function k(K){be.env.NODE_ENV!=="production"&&_r(h.state.isDestroyed,io("hideWithInteractivity")),W().addEventListener("mousemove",b),Kw(za,b),b(K)}function P(){be.env.NODE_ENV!=="production"&&_r(h.state.isDestroyed,io("unmount")),h.state.isVisible&&h.hide(),h.state.isMounted&&(ye(),Ge().forEach(function(K){K._tippy.unmount()}),T.parentNode&&T.parentNode.removeChild(T),Wa=Wa.filter(function(K){return K!==h}),h.state.isMounted=!1,se("onHidden",[h]))}function Q(){be.env.NODE_ENV!=="production"&&_r(h.state.isDestroyed,io("destroy")),!h.state.isDestroyed&&(h.clearDelayTimeouts(),h.unmount(),z(),delete e._tippy,h.state.isDestroyed=!0,se("onDestroy",[h]))}}function is(e,t){t===void 0&&(t={});var n=Pn.plugins.concat(t.plugins||[]);be.env.NODE_ENV!=="production"&&(XD(e),o0(t,n)),WD();var r=Object.assign({},t,{plugins:n}),i=jD(e);if(be.env.NODE_ENV!=="production"){var o=ns(r.content),s=i.length>1;_r(o&&s,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
26
+ `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function We(){return Qi(D.querySelectorAll("[data-tippy-root]"))}function Jt(P){y.clearDelayTimeouts(),P&&H("onTrigger",[y,P]),be();var U=q(!0),X=V(),ee=X[0],ye=X[1];Vn.isTouch&&ee==="hold"&&ye&&(U=ye),U?r=setTimeout(function(){y.show()},U):y.show()}function Xt(P){if(y.clearDelayTimeouts(),H("onUntrigger",[y,P]),!y.state.isVisible){xe();return}if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(P.type)>=0&&i)){var U=q(!1);U?o=setTimeout(function(){y.state.isVisible&&y.hide()},U):s=requestAnimationFrame(function(){y.hide()})}}function kt(){y.state.isEnabled=!0}function dt(){y.hide(),y.state.isEnabled=!1}function mn(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(s)}function qn(P){if(ce.env.NODE_ENV!=="production"&&ar(y.state.isDestroyed,Co("setProps")),!y.state.isDestroyed){H("onBeforeUpdate",[y,P]),$e();var U=y.props,X=um(e,Object.assign({},U,em(P),{ignoreAttributes:!0}));y.props=X,Se(),U.interactiveDebounce!==X.interactiveDebounce&&(ae(),g=Yh(lt,X.interactiveDebounce)),U.triggerTarget&&!X.triggerTarget?ko(U.triggerTarget).forEach(function(ee){ee.removeAttribute("aria-expanded")}):X.triggerTarget&&e.removeAttribute("aria-expanded"),Y(),j(),$&&$(U,X),y.popperInstance&&(ve(),We().forEach(function(ee){requestAnimationFrame(ee._tippy.popperInstance.forceUpdate)})),H("onAfterUpdate",[y,P])}}function At(P){y.setProps({content:P})}function En(){ce.env.NODE_ENV!=="production"&&ar(y.state.isDestroyed,Co("show"));var P=y.state.isVisible,U=y.state.isDestroyed,X=!y.state.isEnabled,ee=Vn.isTouch&&!y.props.touch,ye=ac(y.props.duration,0,en.duration);if(!(P||U||X||ee)&&!O().hasAttribute("disabled")&&(H("onShow",[y],!1),y.props.onShow(y)!==!1)){if(y.state.isVisible=!0,B()&&(D.style.visibility="visible"),j(),be(),y.state.isMounted||(D.style.transition="none"),B()){var Ie=N(),Fe=Ie.box,Ne=Ie.content;cc([Fe,Ne],0)}f=function(){var cr;if(!(!y.state.isVisible||d)){if(d=!0,D.offsetHeight,D.style.transition=y.props.moveTransition,B()&&y.props.animation){var As=N(),Eo=As.box,Te=As.content;cc([Eo,Te],ye),nm([Eo,Te],"visible")}se(),Y(),Zh(Gi,y),(cr=y.popperInstance)==null||cr.forceUpdate(),H("onMount",[y]),y.props.animation&&B()&&ie(ye,function(){y.state.isShown=!0,H("onShown",[y])})}},qe()}}function C(){ce.env.NODE_ENV!=="production"&&ar(y.state.isDestroyed,Co("hide"));var P=!y.state.isVisible,U=y.state.isDestroyed,X=!y.state.isEnabled,ee=ac(y.props.duration,1,en.duration);if(!(P||U||X)&&(H("onHide",[y],!1),y.props.onHide(y)!==!1)){if(y.state.isVisible=!1,y.state.isShown=!1,d=!1,i=!1,B()&&(D.style.visibility="hidden"),ae(),xe(),j(!0),B()){var ye=N(),Ie=ye.box,Fe=ye.content;y.props.animation&&(cc([Ie,Fe],ee),nm([Ie,Fe],"hidden"))}se(),Y(),y.props.animation?B()&&he(ee,y.unmount):y.unmount()}}function v(P){ce.env.NODE_ENV!=="production"&&ar(y.state.isDestroyed,Co("hideWithInteractivity")),M().addEventListener("mousemove",g),Zh(Ki,g),g(P)}function b(){ce.env.NODE_ENV!=="production"&&ar(y.state.isDestroyed,Co("unmount")),y.state.isVisible&&y.hide(),y.state.isMounted&&(ke(),We().forEach(function(P){P._tippy.unmount()}),D.parentNode&&D.parentNode.removeChild(D),Gi=Gi.filter(function(P){return P!==y}),y.state.isMounted=!1,H("onHidden",[y]))}function F(){ce.env.NODE_ENV!=="production"&&ar(y.state.isDestroyed,Co("destroy")),!y.state.isDestroyed&&(y.clearDelayTimeouts(),y.unmount(),$e(),delete e._tippy,y.state.isDestroyed=!0,H("onDestroy",[y]))}}function ys(e,t){t===void 0&&(t={});var n=en.plugins.concat(t.plugins||[]);ce.env.NODE_ENV!=="production"&&(nE(e),dm(t,n)),XA();var r=Object.assign({},t,{plugins:n}),o=WA(e);if(ce.env.NODE_ENV!=="production"){var s=gs(r.content),i=o.length>1;ar(s&&i,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
59
27
 
60
28
  `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
61
29
 
62
30
  `,`1) content: element.innerHTML
63
- `,"2) content: () => element.cloneNode(true)"].join(" "))}var a=i.reduce(function(l,u){var c=u&&rN(u,r);return c&&l.push(c),l},[]);return ns(e)?a[0]:a}is.defaultProps=Pn,is.setDefaultProps=ZD,is.currentInput=mr;var iN=function(t){var n=t===void 0?{}:t,r=n.exclude,i=n.duration;Wa.forEach(function(o){var s=!1;if(r&&(s=Qw(r)?o.reference===r:o.popper===r.popper),!s){var a=o.props.duration;o.setProps({duration:i}),o.hide(),o.state.isDestroyed||o.setProps({duration:a})}})};Object.assign({},xw,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),is.setDefaultProps({render:l0});const oN={name:"hideOnEsc",defaultValue:!0,fn({hide:e}){const t=n=>{n.code==="Escape"&&e()};return{onShow:()=>{document.addEventListener("keydown",t)},onHide:()=>{document.removeEventListener("keydown",t)}}}},Rd=e=>{if(e)try{e.destroy()}catch{}},sN=["id"],aN=Fe({__name:"OcDrop",props:{title:{default:""},closeOnClick:{type:Boolean,default:!1},dropId:{default:()=>hi("oc-drop-")},isNestedElement:{type:Boolean,default:!1},mode:{default:"click"},offset:{type:[Array,Function],default:[0,0]},paddingSize:{default:"medium"},popperOptions:{default:()=>({})},position:{default:"bottom-start"},target:{},toggle:{default:""},enforceDropOnMobile:{type:Boolean,default:!1}},emits:["hideDrop","showDrop"],setup(e,{expose:t,emit:n}){const r=n,{isMobile:i}=Sw(),o=ae(!1),s=M(()=>f(i)&&!e.enforceDropOnMobile),a=An("bottomDrawerRef"),l=An("drop"),u=ae(null),c=()=>{if(f(s)){f(a).show();return}f(u)?.show()},d=()=>{if(f(s)){f(a).hide();return}f(u)?.hide()};t({show:c,hide:d,tippy:u});const p=S=>{const y=S.target.closest(".oc-button")?.hasAttribute("aria-expanded");e.closeOnClick&&!y&&d()},m=S=>{const y=l.value?.closest(".tippy-box");S.relatedTarget&&!y?.contains(S.relatedTarget)&&d()},b=M(()=>({hover:"mouseenter focus",click:void 0,manual:void 0})[e.mode]||e.mode);ot(()=>e.position,()=>{f(u)?.setProps({placement:e.position})}),ot(()=>e.mode,()=>{f(u)?.setProps({trigger:b.value})}),xn(()=>{f(l)?.removeEventListener("focusout",m),Rd(f(u))});const w=()=>{Rd(f(u));const S=e.target?document.querySelector(e.target):e.toggle?document.querySelector(e.toggle):l.value?.previousElementSibling,y=l.value;if(!S||!y)return;const g={trigger:b.value,placement:e.position,arrow:!1,hideOnClick:!e.isNestedElement,interactive:!0,plugins:[oN],theme:"none",maxWidth:416,offset:e.offset,onShow:v=>{o.value=!0,r("showDrop"),e.isNestedElement||iN({exclude:v})},onHide:()=>{o.value=!1,r("hideDrop")},popperOptions:{...e.popperOptions,modifiers:[...e.popperOptions?.modifiers?e.popperOptions.modifiers:[],{name:"fixVerticalPosition",enabled:!0,phase:"beforeWrite",requiresIfExists:["offset","preventOverflow","flip"],fn({state:v}){const h=no(v),E=v.modifiersData.fullHeight||v.elements.popper.offsetHeight,T=h.top*-1-10,R=T+E+h.bottom*-1,C=R-T,A=R-C;E>C&&E>A&&(v.styles.popper.top=`-${T}px`,v.modifiersData.fullHeight=E),E>R&&(v.styles.popper.maxHeight=`${R-10}px`,v.styles.popper.overflowY="auto",v.styles.popper.overflowX="hidden")}}]},content:y};e.target&&(g.triggerTarget=e.toggle?document.querySelector(e.toggle):l.value?.previousElementSibling),u.value=is(S,g),l.value?.addEventListener("focusout",m)};return ot(s,async()=>{if(await Vt(),f(s)){f(u)&&Rd(f(u));return}w()},{immediate:!0}),(S,y)=>s.value?(Y(),Te(x_,{key:0,ref_key:"bottomDrawerRef",ref:a,"drawer-id":e.dropId,toggle:e.toggle,"close-on-click":e.closeOnClick,title:e.title,"use-portal":"",onShow:y[0]||(y[0]=g=>r("showDrop")),onHide:y[1]||(y[1]=g=>r("hideDrop"))},{default:ve(()=>[Ve(S.$slots,"default")]),_:3},8,["drawer-id","toggle","close-on-click","title"])):(Y(),pe("div",{key:1,id:e.dropId,ref_key:"drop",ref:l,class:"oc-drop shadow-md/20 rounded-sm",onClick:p},[o.value&&S.$slots.default?(Y(),Te(ud,{key:0,"body-class":[f(kO)(e.paddingSize)]},{default:ve(()=>[Ve(S.$slots,"default")]),_:3},8,["body-class"])):o.value?Ve(S.$slots,"special",{key:1}):ke("",!0)],8,sN))}}),lN=["type","disabled"],cN={class:"flex flex-row flex-wrap text-sm pt-2 gap-x-2"},uN=["textContent"],c0="file-copy",fN=Fe({__name:"OcTextInputPassword",props:{disabled:{type:Boolean,default:!1},generatePasswordMethod:{type:Function},hasError:{type:Boolean,default:!1},passwordPolicy:{},value:{default:""}},emits:["passwordChallengeCompleted","passwordChallengeFailed","passwordGenerated"],setup(e,{expose:t,emit:n}){const r=n,i=An("passwordInput"),{$gettext:o}=Oe.useGettext(),s=ae(e.value),a=ae(!1),l=ae(c0),u=ae(!1),c=M(()=>!!Object.keys(e.passwordPolicy?.rules||{}).length),d=M(()=>e.passwordPolicy?.missing(f(s))),p=g=>{const v={};for(let h=0;h<g.format.length;h++)v[`param${h+1}`]=g.format[h]?.toString();return o(g.message,v,!0)},m=()=>{navigator.clipboard.writeText(f(s)),l.value="check",setTimeout(()=>l.value=c0,1500)},b=()=>{const g=e.generatePasswordMethod();s.value=g,r("passwordGenerated",s.value)};return t({focus:()=>{f(i).focus()},select:()=>{f(i).select()},setSelectionRange:(g,v)=>{f(i).setSelectionRange(g,v)}}),ot(s,g=>{if(Object.keys(e.passwordPolicy).length){if(!e.passwordPolicy.check(g))return r("passwordChallengeFailed");r("passwordChallengeCompleted")}}),(g,v)=>{const h=Ee("oc-contextual-helper"),E=Ee("portal"),T=sn("oc-tooltip");return Y(),pe(je,null,[ue("div",{class:q.normalizeClass(["oc-text-input-password-wrapper flex flex-row border rounded-sm",{"oc-text-input-password-wrapper-danger text-role-error focus:text-role-error border-role-error":e.hasError,"border-role-surface outline-2 outline-role-outline":u.value,"border-role-outline":!u.value}])},[it(ue("input",Mt(g.$attrs,{ref_key:"passwordInput",ref:i,"onUpdate:modelValue":v[0]||(v[0]=R=>s.value=R),class:"grow-2 border-0 focus:border-0 focus:outline-0",type:a.value?"text":"password",disabled:e.disabled,onFocus:v[1]||(v[1]=R=>u.value=!0),onBlur:v[2]||(v[2]=R=>u.value=!1)}),null,16,lN),[[bE,s.value]]),s.value&&!e.disabled?it((Y(),Te(Sn,{key:0,"aria-label":a.value?f(o)("Hide password"):f(o)("Show password"),class:"oc-text-input-show-password-toggle px-2",appearance:"raw",size:"small",onClick:v[3]||(v[3]=R=>a.value=!a.value)},{default:ve(()=>[me(Ir,{size:"small",name:a.value?"eye-off":"eye"},null,8,["name"])]),_:1},8,["aria-label"])),[[T,a.value?f(o)("Hide password"):f(o)("Show password")]]):ke("",!0),s.value&&!e.disabled?it((Y(),Te(Sn,{key:1,"aria-label":f(o)("Copy password"),class:"oc-text-input-copy-password-button px-2",appearance:"raw",size:"small",onClick:m},{default:ve(()=>[me(Ir,{size:"small",name:l.value},null,8,["name"])]),_:1},8,["aria-label"])),[[T,f(o)("Copy password")]]):ke("",!0),e.generatePasswordMethod&&!e.disabled?it((Y(),Te(Sn,{key:2,"aria-label":f(o)("Generate password"),class:"oc-text-input-generate-password-button px-2",appearance:"raw",size:"small",onClick:b},{default:ve(()=>[me(Ir,{size:"small",name:"refresh","fill-type":"line"})]),_:1},8,["aria-label"])),[[T,f(o)("Generate password")]]):ke("",!0)],2),c.value?(Y(),Te(E,{key:0,to:"app.design-system.password-policy"},{default:ve(()=>[ue("div",cN,[(Y(!0),pe(je,null,dt(d.value.rules,(R,C)=>(Y(),pe("div",{key:C,class:"flex items-center oc-text-input-password-policy-rule"},[me(Ir,{size:"small",class:"mr-1",name:R.verified?"checkbox-circle":"close-circle",color:R.verified?"var(--oc-role-on-surface)":"var(--oc-role-error)"},null,8,["name","color"]),ue("span",{class:q.normalizeClass([{"oc-text-input-danger":!R.verified}]),textContent:q.toDisplayString(p(R))},null,10,uN),R.helperMessage?(Y(),Te(h,{key:0,text:R.helperMessage,title:f(o)("Password policy")},null,8,["text","title"])):ke("",!0)]))),128))])]),_:1})):ke("",!0)],64)}}}),dN=["for"],pN={key:0,class:"text-role-error","aria-hidden":"true"},hN=["id","textContent"],mN=["id","textContent"],gN=Fe({inheritAttrs:!1,__name:"OcTextInput",props:{id:{default:()=>hi("oc-textinput-")},type:{default:"text"},modelValue:{default:""},selectionRange:{},clearButtonEnabled:{type:Boolean,default:!1},clearButtonAccessibleLabel:{default:""},defaultValue:{},disabled:{type:Boolean,default:!1},label:{},inlineLabel:{type:Boolean,default:!1},errorMessage:{},errorMessageDebouncedTime:{default:500},fixMessageLine:{type:Boolean,default:!1},descriptionMessage:{},readOnly:{type:Boolean,default:!1},requiredMark:{type:Boolean,default:!1},passwordPolicy:{default:()=>({})},generatePasswordMethod:{type:Function},hasBorder:{type:Boolean,default:!0}},emits:["change","update:modelValue","focus","passwordChallengeCompleted","passwordChallengeFailed"],setup(e,{expose:t,emit:n}){const r=n,i=ae(!1),o=M(()=>!!e.descriptionMessage),s=M(()=>e.fixMessageLine||f(i)||f(o)),a=M(()=>f(i).toString()),l=M(()=>`${e.id}-message`),u=M(()=>e.type==="password"?{passwordGenerated:v}:{}),c=_l(),d=M(()=>{const R={};(f(i)||f(o))&&(R["aria-describedby"]=l.value),e.defaultValue&&(R.placeholder=e.defaultValue),e.type==="password"&&(R["password-policy"]=e.passwordPolicy,R["generate-password-method"]=e.generatePasswordMethod,R["has-error"]=f(i));const{change:C,input:A,focus:D,class:V,...O}=c;return{...O,...R}}),p=M(()=>!e.disabled&&e.clearButtonEnabled&&!!e.modelValue),m=M(()=>e.clearButtonAccessibleLabel||"Clear input"),b=M(()=>e.type==="password"?fN:"input"),w=An("inputRef"),S=()=>{f(w).focus()};t({focus:S});function y(){S(),v(""),g(null)}const g=R=>{r("change",R)},v=R=>{r("update:modelValue",R)},h=async R=>{await Vt(),f(w).select(),E(),r("focus",R.value)},E=()=>{e.selectionRange&&e.selectionRange.length>1&&f(w).setSelectionRange(e.selectionRange[0],e.selectionRange[1])};ot([()=>e.selectionRange,w],async()=>{f(w)&&(await Vt(),E())},{immediate:!0});const T=At.debounce(()=>{i.value=!!e.errorMessage},e.errorMessageDebouncedTime);return ot(()=>e.modelValue,()=>{T()}),ot(()=>e.errorMessage,()=>{e.errorMessage?T():(i.value=!1,T.cancel?.())}),(R,C)=>(Y(),pe("div",{class:q.normalizeClass([{"flex items-center":e.inlineLabel},R.$attrs.class])},[Ve(R.$slots,"label",{},()=>[ue("label",{class:q.normalizeClass(["inline-block",{"mr-2":e.inlineLabel,"mb-0.5":!e.inlineLabel}]),for:e.id},[kt(q.toDisplayString(e.label)+" ",1),e.requiredMark?(Y(),pe("span",pN,"*")):ke("",!0)],10,dN)]),ue("div",{class:q.normalizeClass(["relative",{"grow-1":e.inlineLabel}])},[e.readOnly?(Y(),Te(Ir,{key:0,name:"lock",size:"small",class:"mt-2 ml-2 absolute"})):ke("",!0),(Y(),Te(On(b.value),Mt({id:e.id},d.value,{ref_key:"inputRef",ref:w,"aria-invalid":a.value,class:["oc-text-input oc-input",{"oc-text-input-danger border-role-error":!!i.value,"pl-6":!!e.readOnly,"pr-6":p.value,"border-none outline-none bg-transparent":!e.hasBorder}],type:e.type,value:e.modelValue,disabled:e.disabled||e.readOnly},Fs(u.value),{onChange:C[0]||(C[0]=A=>g(A.target.value)),onInput:C[1]||(C[1]=A=>v(A.target.value)),onPasswordChallengeCompleted:C[2]||(C[2]=A=>R.$emit("passwordChallengeCompleted")),onPasswordChallengeFailed:C[3]||(C[3]=A=>R.$emit("passwordChallengeFailed")),onFocus:C[4]||(C[4]=A=>h(A.target))}),null,16,["id","aria-invalid","class","type","value","disabled"])),p.value?(Y(),Te(Sn,{key:1,"aria-label":m.value,class:"pr-2 absolute top-[50%] transform-[translateY(-50%)] right-0 oc-text-input-btn-clear",appearance:"raw","no-hover":"",onClick:y},{default:ve(()=>[me(Ir,{name:"close",size:"small"})]),_:1},8,["aria-label"])):ke("",!0)],2),s.value?(Y(),pe("div",{key:0,class:q.normalizeClass(["oc-text-input-message flex align-center text-sm mt-1 min-h-4.5",{"oc-text-input-description text-role-on-surface-variant relative":o.value,"oc-text-input-danger text-role-error focus:text-role-error border-role-error":i.value}])},[i.value?(Y(),pe(je,{key:0},[i.value?(Y(),Te(Ir,{key:0,name:"error-warning",size:"small","fill-type":"line","aria-hidden":"true",class:"mr-1"})):ke("",!0),i.value?(Y(),pe("span",{key:1,id:l.value,class:"oc-text-input-danger text-role-error focus:text-role-error border-role-error",textContent:q.toDisplayString(e.errorMessage)},null,8,hN)):ke("",!0)],64)):o.value?(Y(),pe("span",{key:1,id:l.value,class:"oc-text-input-description text-role-on-surface-variant flex items-center relative",textContent:q.toDisplayString(e.descriptionMessage)},null,8,mN)):ke("",!0)],2)):ke("",!0),e.type==="password"?(Y(),Te(f(ds.PortalTarget),{key:1,name:"app.design-system.password-policy"})):ke("",!0)],2))}});var yN=Object.defineProperty,u0=Object.getOwnPropertySymbols,vN=Object.prototype.hasOwnProperty,bN=Object.prototype.propertyIsEnumerable,f0=(e,t,n)=>t in e?yN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wN=(e,t)=>{for(var n in t||(t={}))vN.call(t,n)&&f0(e,n,t[n]);if(u0)for(var n of u0(t))bN.call(t,n)&&f0(e,n,t[n]);return e};const d0=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},SN={},EN={xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"},TN=ue("path",{d:"M6.895455 5l2.842897-2.842898c.348864-.348863.348864-.914488 0-1.263636L9.106534.261648c-.348864-.348864-.914489-.348864-1.263636 0L5 3.104545 2.157102.261648c-.348863-.348864-.914488-.348864-1.263636 0L.261648.893466c-.348864.348864-.348864.914489 0 1.263636L3.104545 5 .261648 7.842898c-.348864.348863-.348864.914488 0 1.263636l.631818.631818c.348864.348864.914773.348864 1.263636 0L5 6.895455l2.842898 2.842897c.348863.348864.914772.348864 1.263636 0l.631818-.631818c.348864-.348864.348864-.914489 0-1.263636L6.895455 5z"},null,-1),AN=[TN];function xN(e,t){return Y(),pe("svg",EN,AN)}const CN=d0(SN,[["render",xN]]),RN={},kN={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"10"},PN=ue("path",{d:"M9.211364 7.59931l4.48338-4.867229c.407008-.441854.407008-1.158247 0-1.60046l-.73712-.80023c-.407008-.441854-1.066904-.441854-1.474243 0L7 5.198617 2.51662.33139c-.407008-.441853-1.066904-.441853-1.474243 0l-.737121.80023c-.407008.441854-.407008 1.158248 0 1.600461l4.48338 4.867228L7 10l2.211364-2.40069z"},null,-1),IN=[PN];function ON(e,t){return Y(),pe("svg",kN,IN)}wN({},{Deselect:CN,OpenIndicator:d0(RN,[["render",ON]])});const FN=["aria-label","aria-live","aria-hidden","role"],_N=Fe({__name:"OcSpinner",props:{ariaLabel:{default:()=>{}},size:{default:"medium"}},setup(e){return(t,n)=>(Y(),pe("span",{class:q.normalizeClass(["oc-spinner inline-block after:block after:bg-transparent after:border after:border-current after:rounded-full after:size-full relative after:relative animate-spin after:content-[''] after:border-b-transparent",{"size-2":e.size==="xsmall","size-4":e.size==="small","size-5":e.size==="medium","size-8":e.size==="large","size-10":e.size==="xlarge","size-12":e.size==="xxlarge","size-16":e.size==="xxxlarge"}]),"aria-label":e.ariaLabel||void 0,"aria-live":e.ariaLabel?"polite":void 0,"aria-hidden":e.ariaLabel?void 0:"true",tabindex:"-1",role:e.ariaLabel?"img":void 0},null,10,FN))}}),DN={class:"oc-status-indicators flex"},NN=["id","textContent"],LN=Fe({__name:"OcStatusIndicators",props:{resource:{},indicators:{},disableHandler:{type:Boolean,default:!1}},setup(e){const{$gettext:t}=Oe.useGettext(),n=ae({}),r=o=>Object.hasOwn(o,"handler"),i=o=>o.accessibleDescription?(f(n)[o.id]||(f(n)[o.id]=hi("oc-indicator-description-")),f(n)[o.id]):null;return(o,s)=>{const a=sn("oc-tooltip");return Y(),pe("div",DN,[(Y(!0),pe(je,null,dt(e.indicators,(l,u)=>(Y(),pe(je,null,[r(l)&&!e.disableHandler?it((Y(),Te(Sn,{id:l.id,key:`${l.id}-handler`,class:q.normalizeClass(["oc-status-indicators-indicator",{"ml-1":u>0}]),"aria-label":f(t)(l.label),"aria-describedby":i(l),appearance:"raw","data-testid":l.id,"data-test-indicator-type":l.type,"data-test-indicator-resource-name":e.resource.name,"data-test-indicator-resource-path":e.resource.path,"no-hover":"",onClick:c=>l.handler?.(e.resource,c)},{default:ve(()=>[me(Ir,{name:l.icon,size:"small","fill-type":l.fillType},null,8,["name","fill-type"])]),_:2},1032,["id","class","aria-label","aria-describedby","data-testid","data-test-indicator-type","data-test-indicator-resource-name","data-test-indicator-resource-path","onClick"])),[[a,f(t)(l.label)]]):it((Y(),Te(Ir,{id:l.id,key:l.id,tabindex:"-1",size:"small",class:q.normalizeClass(["oc-status-indicators-indicator",{"ml-1":u>0}]),name:l.icon,"fill-type":l.fillType,"accessible-label":f(t)(l.label),"aria-describedby":i(l),"data-testid":l.id,"data-test-indicator-type":l.type},null,8,["id","class","name","fill-type","accessible-label","aria-describedby","data-testid","data-test-indicator-type"])),[[a,f(t)(l.label)]]),i(l)?(Y(),pe("p",{id:i(l),key:i(l),class:"sr-only",textContent:q.toDisplayString(f(t)(l.accessibleDescription))},null,8,NN)):ke("",!0)],64))),256))])}}}),$N={class:"oc-thead border-b"},MN=Fe({name:"OcTableHead",__name:"OcTableHead",setup(e){return(t,n)=>(Y(),pe("thead",$N,[Ve(t.$slots,"default")]))}}),BN=Fe({name:"OcTableBody",__name:"OcTableBody",setup(e){return(t,n)=>(Y(),pe("tbody",null,[Ve(t.$slots,"default")]))}}),p0=Xe(Fe({__name:"OcTableCell",props:{alignH:{default:"left"},alignV:{default:"middle"},type:{default:"td"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e,{emit:t}){const n=t;return(r,i)=>(Y(),Te(On(e.type),{class:q.normalizeClass(["oc-table-cell",{"break-all":e.wrap==="break","whitespace-nowrap":e.wrap==="nowrap","overflow-visible max-w-0":e.wrap==="truncate","text-left":e.alignH==="left","text-right":e.alignH==="right","text-center":e.alignH==="center","align-top":e.alignV==="top","align-middle":e.alignV==="middle","align-bottom":e.alignV==="bottom","w-px":e.width==="shrink","min-w-38":e.width==="expand"}]),onClick:i[0]||(i[0]=o=>n("click",o))},{default:ve(()=>[Ve(r.$slots,"default",{},void 0,!0)]),_:3},8,["class"]))}}),[["__scopeId","data-v-dc7aa8e1"]]),h0=Fe({__name:"OcTableTd",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},setup(e){return(t,n)=>(Y(),Te(p0,{type:"td","align-h":e.alignH,"align-v":e.alignV,width:e.width,wrap:e.wrap,class:"oc-td"},{default:ve(()=>[Ve(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),m0=Xe(Fe({__name:"OcTableTr",props:{lazy:{}},emits:["contextmenu","click","dragstart","drop","dragenter","dragleave","dragover","mouseleave","itemVisible"],setup(e,{emit:t}){const n=t,r=c1((a,l)=>{let u;return{get(){return a(),u},set(c){u=c,l()}}}),i=M(()=>e.lazy?e.lazy.colspan:1),{isVisible:o}=e.lazy?ww({...e.lazy,target:r,onVisibleCallback:()=>n("itemVisible")}):{isVisible:ae(!0)},s=M(()=>!f(o));return e.lazy||n("itemVisible"),(a,l)=>(Y(),pe("tr",{ref_key:"observerTarget",ref:r,onClick:l[0]||(l[0]=u=>a.$emit("click",u)),onContextmenu:l[1]||(l[1]=u=>a.$emit("contextmenu",u)),onDragstart:l[2]||(l[2]=u=>a.$emit("dragstart",u)),onDrop:l[3]||(l[3]=u=>a.$emit("drop",u)),onDragenter:l[4]||(l[4]=u=>a.$emit("dragenter",u)),onDragleave:l[5]||(l[5]=u=>a.$emit("dragleave",u)),onDragover:l[6]||(l[6]=u=>a.$emit("dragover",u)),onMouseleave:l[7]||(l[7]=u=>a.$emit("mouseleave",u))},[s.value?(Y(),Te(h0,{key:0,colspan:i.value},{default:ve(()=>[...l[8]||(l[8]=[ue("span",{class:"shimmer inline-block bg-role-shadow overflow-hidden absolute inset-x-2 inset-y-3 after:absolute after:inset-0 after:transform-[translateX(-100%)] opacity-10 after:animate-shimmer"},null,-1)])]),_:1},8,["colspan"])):Ve(a.$slots,"default",{key:1},void 0,!0)],544))}}),[["__scopeId","data-v-7acab1b8"]]),jN=Xe(Fe({__name:"OcTableTh",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e){return(t,n)=>(Y(),Te(p0,{type:"th","align-h":e.alignH,"align-v":e.alignV,width:e.width,wrap:e.wrap,class:"oc-th aria-[sort]:cursor-pointer",onClick:n[0]||(n[0]=r=>t.$emit("click",r))},{default:ve(()=>[Ve(t.$slots,"default",{},void 0,!0)]),_:3},8,["align-h","align-v","width","wrap"]))}}),[["__scopeId","data-v-d746eb11"]]),UN={key:0,class:"oc-table-thead-content inline-table align-middle"},VN=["textContent"],qN={key:1},zN={key:0,class:"oc-table-thead-content inline-table align-middle"},WN=["textContent"],HN={key:1,class:"oc-table-footer border-t"},KN={class:"oc-table-footer-row h-10.5"},GN=["colspan"],QN=Xe(Fe({__name:"OcTable",props:{data:{},fields:{},disabled:{default:()=>[]},dragDrop:{type:Boolean,default:!1},hasHeader:{type:Boolean,default:!0},headerPosition:{default:0},highlighted:{},hover:{type:Boolean,default:!1},idKey:{default:"id"},itemDomSelector:{type:Function},lazy:{type:Boolean,default:!1},paddingX:{default:"small"},sortBy:{},sortDir:{},sticky:{type:Boolean,default:!1}},emits:["itemDropped","itemDragged","theadClicked","highlight","rowMounted","contextmenuClicked","sort","dropRowStyling","itemVisible"],setup(e,{emit:t}){const n=t,r={EVENT_THEAD_CLICKED:bO,EVENT_TROW_CLICKED:wO,EVENT_TROW_MOUNTED:SO,EVENT_TROW_CONTEXTMENU:EO},{$gettext:i}=Oe.useGettext(),o=O=>e.itemDomSelector?e.itemDomSelector(O):O[e.idKey],s=M(()=>{const O=["oc-table"];return e.hover&&O.push("oc-table-hover"),e.sticky&&O.push("oc-table-sticky"),O}),a=M(()=>e.fields.length),l=O=>{O.preventDefault()},u=(O,N)=>{n(TO,[O,N])},c=(O,N)=>{n(hb,[O,N])},d=(O,N,W)=>{n("dropRowStyling",O,N,W)},p=O=>O.type==="slot",m=O=>["callback","function"].indexOf(O.type)>=0,b=O=>Object.prototype.hasOwnProperty.call(O,"title")?O.title:O.name,w=()=>({class:s.value}),S=O=>{switch(e.paddingX){case"remove":return O==="right"?"pr-0":"pl-0";case"xsmall":return O==="right"?"pr-1":"pl-1";case"small":return O==="right"?"pr-2":"pl-2";case"medium":return O==="right"?"pr-4":"pl-4";case"large":return O==="right"?"pr-6":"pl-6";case"xlarge":return O==="right"?"pr-12":"pl-12";case"xxlarge":return O==="right"?"pr-24":"pl-24"}},y=(O,N)=>{const W=h(O);return W.class=`oc-table-header-cell oc-table-header-cell-${O.name}`,Object.prototype.hasOwnProperty.call(O,"thClass")&&(W.class+=` ${O.thClass}`),e.sticky&&(W.style=`top: ${e.headerPosition}px;`,W.class+=" z-10"),N===0&&(W.class+=` ${S("left")} `),N===e.fields.length-1&&(W.class+=` ${S("right")}`),A(W,O),W},g=(O,N)=>({...e.lazy&&{lazy:{colspan:a.value}},class:["oc-tbody-tr",`oc-tbody-tr-${o(O)||N}`,E(O)?"oc-table-highlighted":void 0,...T(O)?["oc-table-disabled","opacity-70","pointer-events-none","grayscale-60"]:[]].filter(Boolean)}),v=(O,N,W)=>{const L=h(O);return L.class=`oc-table-data-cell oc-table-data-cell-${O.name}`,Object.prototype.hasOwnProperty.call(O,"tdClass")&&(L.class+=` ${O.tdClass}`),Object.prototype.hasOwnProperty.call(O,"wrap")&&(L.wrap=O.wrap),N===0&&(L.class+=` ${S("left")} `),N===e.fields.length-1&&(L.class+=` ${S("right")}`),Object.prototype.hasOwnProperty.call(O,"accessibleLabelCallback")&&(L["aria-label"]=O.accessibleLabelCallback(W)),L},h=O=>({...O?.alignH&&{alignH:O.alignH},...O?.alignV&&{alignV:O.alignV},...O?.width&&{width:O.width},class:void 0,wrap:void 0,style:void 0}),E=O=>e.highlighted?Array.isArray(e.highlighted)?e.highlighted.indexOf(O[e.idKey])>-1:e.highlighted===O[e.idKey]:!1,T=O=>e.disabled.length?e.disabled.indexOf(O[e.idKey])>-1:!1,R=(O,N,W)=>{const L=[W[e.idKey],N+1].filter(Boolean);return p(O)?[...L,O.name].join("-"):m(O)?[...L,O.callback(W[O.name])].join("-"):[...L,W[O.name]].join("-")},C=O=>i("Sort by %{ name }",{name:O}),A=(O,N)=>{if(!D(N))return;let W="none";e.sortBy===N.name&&(W=e.sortDir===Gi.Asc?"ascending":"descending"),O["aria-sort"]=W},D=({sortable:O})=>!!O,V=O=>{if(!D(O))return;let N=e.sortDir;e.sortBy===O.name&&e.sortDir!==void 0&&(N=e.sortDir===Gi.Desc?Gi.Asc:Gi.Desc),(e.sortBy!==O.name||e.sortDir===void 0)&&(N=O.sortDir||Gi.Desc),n("sort",{sortBy:O.name,sortDir:N})};return(O,N)=>{const W=Ee("oc-icon");return Y(),pe("table",Mt(w(),{class:"has-item-context-menu"}),[e.hasHeader?(Y(),Te(MN,{key:0},{default:ve(()=>[me(m0,{class:"oc-table-header-row h-10.5"},{default:ve(()=>[(Y(!0),pe(je,null,dt(e.fields,(L,ee)=>(Y(),Te(jN,Mt({key:`oc-thead-${L.name}`},{ref_for:!0},y(L,ee)),{default:ve(()=>[L.sortable?(Y(),Te(Sn,{key:0,"aria-label":C(L.name),appearance:"raw","justify-content":"left",class:"oc-button-sort w-full hover:underline","gap-size":"small","no-hover":"",onClick:J=>V(L)},{default:ve(()=>[L.headerType==="slot"?(Y(),pe("span",UN,[Ve(O.$slots,L.name+"Header",{},void 0,!0)])):(Y(),pe("span",{key:1,class:"oc-table-thead-content inline-table align-middle header-text",textContent:q.toDisplayString(b(L))},null,8,VN)),me(W,{name:e.sortDir==="asc"?"arrow-down":"arrow-up","fill-type":"line",class:q.normalizeClass([{"sr-only":e.sortBy!==L.name},"p-1 rounded-sm"]),size:"small"},null,8,["name","class"])]),_:2},1032,["aria-label","onClick"])):(Y(),pe("div",qN,[L.headerType==="slot"?(Y(),pe("span",zN,[Ve(O.$slots,L.name+"Header",{},void 0,!0)])):(Y(),pe("span",{key:1,class:"oc-table-thead-content inline-table align-middle header-text",textContent:q.toDisplayString(b(L))},null,8,WN))]))]),_:2},1040))),128))]),_:3})]),_:3})):ke("",!0),me(BN,{class:"has-item-context-menu"},{default:ve(()=>[(Y(!0),pe(je,null,dt(e.data,(L,ee)=>(Y(),Te(m0,Mt({key:`oc-tbody-tr-${o(L)||ee}`,ref_for:!0,ref:`row-${ee}`},{ref_for:!0},g(L,ee),{"data-item-id":L[e.idKey],draggable:e.dragDrop,class:"border-t h-10.5",onClick:J=>O.$emit(r.EVENT_TROW_CLICKED,[L,J]),onContextmenu:J=>O.$emit(r.EVENT_TROW_CONTEXTMENU,O.$refs[`row-${ee}`][0],J,L),onVnodeMounted:J=>O.$emit(r.EVENT_TROW_MOUNTED,L,O.$refs[`row-${ee}`][0]),onDragstart:J=>u(L,J),onDrop:J=>c(L,J),onDragenter:qt(J=>d(L,!1,J),["prevent"]),onDragleave:qt(J=>d(L,!0,J),["prevent"]),onDragover:N[0]||(N[0]=J=>l(J)),onItemVisible:J=>O.$emit("itemVisible",L)}),{default:ve(()=>[(Y(!0),pe(je,null,dt(e.fields,(J,se)=>(Y(),Te(h0,Mt({key:"oc-tbody-td-"+R(J,se,L)},{ref_for:!0},v(J,se,L)),{default:ve(()=>[p(J)?Ve(O.$slots,J.name,{key:0,item:L},void 0,!0):m(J)?(Y(),pe(je,{key:1},[kt(q.toDisplayString(J.callback(L[J.name])),1)],64)):(Y(),pe(je,{key:2},[kt(q.toDisplayString(L[J.name]),1)],64))]),_:2},1040))),128))]),_:2},1040,["data-item-id","draggable","onClick","onContextmenu","onVnodeMounted","onDragstart","onDrop","onDragenter","onDragleave","onItemVisible"]))),128))]),_:3}),O.$slots.footer?(Y(),pe("tfoot",HN,[ue("tr",KN,[ue("td",{colspan:a.value,class:"oc-table-footer-cell p-1 text-sm text-role-on-surface-variant"},[Ve(O.$slots,"footer",{},void 0,!0)],8,GN)])])):ke("",!0)],16)}}}),[["__scopeId","data-v-57029fa4"]]),kd=()=>{const{$gettext:e,$ngettext:t}=Oe.useGettext(),{showMessage:n,showErrorMessage:r}=tt(),{copy:i}=Vn.useClipboard(),o=({result:a,password:l})=>{const u=a.filter(di);let c="";if(u.length){let p=e("Link has been created successfully");if(a.length===1)try{c=l?e("%{link} Password:%{password}",{link:u[0].value.webUrl,password:l},!0):u[0].value.webUrl,p=e("The link has been copied to your clipboard.")}catch(m){console.warn("Unable to copy link to clipboard",m)}n({title:t(p,"Links have been created successfully.",u.length)})}const d=a.filter(pi);return d.length&&r({errors:d.map(({reason:p})=>p),title:t("Failed to create link","Failed to create links",d.length)}),c};return{copyLink:async({createLinkHandler:a,password:l})=>{if(navigator.clipboard.write)await new Promise((u,c)=>{const d=new ClipboardItem({"text/plain":a().then(p=>{const m=o({result:p,password:l}),b=new Blob([m],{type:"text/plain"});return u(),b}).catch(p=>{throw c(),p})});navigator.clipboard.write([d])});else{const u=await a(),c=o({result:u,password:l});c&&i(c)}}}},Ha=()=>{const{$gettext:e}=Oe.useGettext(),t=Zt(),n=fn(),r=M(()=>n.can("create-all","PublicLink")),i=M(()=>wn.View),o=u=>u===wn.View?t.sharingPublicPasswordEnforcedFor.read_only:u===wn.Upload?t.sharingPublicPasswordEnforcedFor.upload_only:u===wn.CreateOnly?t.sharingPublicPasswordEnforcedFor.read_write:u===wn.Edit?t.sharingPublicPasswordEnforcedFor.read_write_delete:!1,s=({isFolder:u})=>f(r)?u?[wn.View,wn.Edit,wn.CreateOnly]:[wn.View,wn.Edit]:[],a=[{id:wn.View,displayName:e("Can view"),description:e("View, download"),icon:"eye"},{id:wn.Upload,displayName:e("Can upload"),description:e("View, upload, download"),icon:"upload"},{id:wn.Edit,displayName:e("Can edit"),description:e("View, upload, edit, download, delete"),icon:"pencil"},{id:wn.CreateOnly,displayName:e("Secret File Drop"),description:e("Upload only, existing content is not revealed"),icon:"inbox-unarchive"}];return{defaultLinkType:i,isPasswordEnforcedForLinkType:o,getAvailableLinkTypes:s,linkShareRoles:a,getLinkRoleByType:u=>a.find(({id:c})=>c===u)}},XN=Fe({name:"LinkRoleDropdown",props:{modelValue:{type:Object,required:!0},availableLinkTypeOptions:{type:Array,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=Oe.useGettext(),{getLinkRoleByType:r}=Ha(),i=l=>e.modelValue===l,o=l=>{t("update:modelValue",l)},s=M(()=>n(r(e.modelValue)?.displayName)),a=Gt.v4();return{isSelectedType:i,updateSelectedType:o,currentLinkRoleLabel:s,dropUuid:a,getLinkRoleByType:r}}}),YN=["textContent"],JN=["textContent"],ZN={class:"flex items-center"},e2={class:"text-left"},t2=["textContent"],n2={class:"text-sm leading-4"},r2={class:"flex"};function i2(e,t,n,r,i,o){const s=Ee("oc-icon"),a=Ee("oc-button"),l=Ee("oc-list"),u=Ee("oc-drop"),c=sn("oc-tooltip");return Y(),pe(je,null,[e.availableLinkTypeOptions.length>1?(Y(),Te(a,{key:0,id:`link-role-dropdown-toggle-${e.dropUuid}`,appearance:"raw","gap-size":"none","no-hover":"",class:"text-left link-role-dropdown-toggle"},{default:ve(()=>[ue("span",{class:"link-current-role",textContent:q.toDisplayString(e.currentLinkRoleLabel||e.$gettext("Select a role"))},null,8,YN),me(s,{name:"arrow-down-s"})]),_:1},8,["id"])):it((Y(),pe("span",{key:1,class:"link-current-role mr-4",textContent:q.toDisplayString(e.currentLinkRoleLabel)},null,8,JN)),[[c,e.getLinkRoleByType(e.modelValue)?.description]]),e.availableLinkTypeOptions.length>1?(Y(),Te(u,{key:2,class:"link-role-dropdown w-md",title:e.$gettext("Role"),"drop-id":`link-role-dropdown-${e.dropUuid}`,toggle:`#link-role-dropdown-toggle-${e.dropUuid}`,"padding-size":"small",mode:"click","close-on-click":""},{default:ve(()=>[me(l,{class:"role-dropdown-list"},{default:ve(()=>[(Y(!0),pe(je,null,dt(e.availableLinkTypeOptions,(d,p)=>(Y(),pe("li",{key:`role-dropdown-${p}`},[me(a,{id:`files-role-${e.getLinkRoleByType(d).id}`,class:q.normalizeClass([{selected:e.isSelectedType(d)},"p-2"]),appearance:e.isSelectedType(d)?"filled":"raw-inverse","color-role":e.isSelectedType(d)?"secondaryContainer":"surface","justify-content":"space-between",onClick:m=>e.updateSelectedType(d)},{default:ve(()=>[ue("span",ZN,[me(s,{name:e.getLinkRoleByType(d).icon,class:"pl-2 pr-4"},null,8,["name"]),ue("span",e2,[ue("span",{class:"role-dropdown-list-option-label font-semibold block w-full leading-4",textContent:q.toDisplayString(e.$gettext(e.getLinkRoleByType(d).displayName))},null,8,t2),ue("span",n2,q.toDisplayString(e.$gettext(e.getLinkRoleByType(d).description)),1)])]),ue("span",r2,[e.isSelectedType(d)?(Y(),Te(s,{key:0,name:"check"})):ke("",!0)])]),_:2},1032,["id","class","appearance","color-role","onClick"])]))),128))]),_:1})]),_:1},8,["title","drop-id","toggle"])):ke("",!0)],64)}const g0=Xe(XN,[["render",i2]]),o2={class:"flex justify-between pb-2"},s2={key:0,class:"flex items-center"},a2={key:1,class:"flex items-center"},l2={class:"flex flex-col"},c2=["textContent"],u2=["textContent"],f2=["textContent"],d2={class:"mb-4 ml-[30px]"},p2={key:1,class:"text-sm text-role-on-surface-variant"},h2=["textContent"],m2=["textContent"],g2={class:"flex justify-end items-center mt-2"},y2={class:"sr-only"},y0=Fe({__name:"CreateLinkModal",props:{modal:{},resources:{},space:{default:()=>{}}},emits:["cancel","confirm"],setup(e,{expose:t}){const n=He(),r=Oe.useGettext(),{$gettext:i}=r,{removeModal:o}=ft(),{copyLink:s}=kd(),a=X0(),{isEnabled:l,postMessage:u}=Qr(),{defaultLinkType:c,getAvailableLinkTypes:d,getLinkRoleByType:p,isPasswordEnforcedForLinkType:m}=Ha(),{addLink:b}=kr(),w=ur(),{currentTheme:S}=Me.storeToRefs(w),y=ae(!1),g=ae(!1),v=M(()=>e.resources.every(({isFolder:F})=>F)),h=M(()=>f(l)?i("Share link(s)"):i("Copy link")),E=M(()=>f(l)?i("Share link(s) and password(s)"):i("Copy link and password")),T=ae(Gt.v4()),R=ae({}),C=ae(),A=vl({value:"",error:void 0}),D=ae(f(c)),V=M(()=>i(p(f(D)).description)),O=M(()=>i(p(f(D)).displayName)),N=M(()=>p(f(D)).icon),W=M(()=>d({isFolder:f(v)})),L=M(()=>m(f(D))),ee=a.getPolicy({enforcePassword:f(L)}),J=()=>{y.value=!0},se=({date:F,error:x})=>{C.value=F,g.value=x},he=()=>Promise.allSettled(e.resources.map(F=>b({clientService:n,space:e.space,resource:F,options:{type:f(D),"@libre.graph.quickLink":!1,password:f(A).value,expirationDateTime:f(C)?.toISO(),displayName:i("Unnamed link")}}))),oe=M(()=>ee.check(f(A).value)),we=M(()=>!f(oe)||f(g)),X=async()=>{const F=await he(),x=[],G=F.filter(pi);return G.length&&G.map(({reason:H})=>H).forEach(H=>{if(console.error(H),H.response?.status===400){const B=H.response.data.error;B.message=At.upperFirst(B.message),x.push(B)}}),x.length?(A.error=i(x[0].message),Promise.reject()):F};t({onConfirm:async(F={})=>{if(f(l)){const G=(await X()).filter(di);G.length&&(u("opencloud-embed:share",G.map(({value:H})=>H.webUrl)),u("opencloud-embed:share-links",G.map(({value:H})=>({url:H.webUrl,...F.copyPassword&&{password:f(A).value}})))),o(e.modal.id);return}await s({createLinkHandler:X,password:F.copyPassword?f(A).value:void 0}),o(e.modal.id)}});const le=F=>{A.value=F,A.error=void 0},Ae=F=>{D.value=F},te=()=>a.generatePassword();return $t(()=>{const F=f(R)[f(D)];F&&F.$el.focus(),f(L)&&(A.value=a.generatePassword())}),(F,x)=>{const G=Ee("oc-icon"),H=Ee("oc-text-input"),B=Ee("oc-datepicker"),z=Ee("oc-list"),ge=Ee("oc-drop");return Y(),pe(je,null,[ue("div",o2,[y.value?(Y(),pe("div",s2,[me(G,{class:"mr-2",name:N.value,"fill-type":"line"},null,8,["name"]),me(g0,{"model-value":D.value,"available-link-type-options":W.value,"onUpdate:modelValue":Ae},null,8,["model-value","available-link-type-options"])])):(Y(),pe("div",a2,[me(G,{class:"mr-2",name:N.value,"fill-type":"line"},null,8,["name"]),ue("div",l2,[ue("span",{class:"font-semibold",textContent:q.toDisplayString(O.value)},null,8,c2),ue("span",{class:"text-sm",textContent:q.toDisplayString(V.value)},null,8,u2)])])),y.value?ke("",!0):(Y(),Te(f(Sn),{key:2,class:"link-modal-advanced-mode-button","gap-size":"xsmall",appearance:"raw","no-hover":"",onClick:x[0]||(x[0]=Re=>J())},{default:ve(()=>[me(G,{name:"settings-3",size:"small","fill-type":"fill"}),ue("span",{textContent:q.toDisplayString(f(i)("Options"))},null,8,f2)]),_:1}))]),ue("div",d2,[y.value?(Y(),Te(H,{key:T.value,"model-value":A.value,type:"password","password-policy":f(ee),"generate-password-method":te,"error-message":A.error,label:f(i)("Password"),"required-mark":L.value,class:"link-modal-password-input","onUpdate:modelValue":le},null,8,["model-value","password-policy","error-message","label","required-mark"])):A.value?(Y(),pe("div",p2,[ue("span",{textContent:q.toDisplayString(f(i)("Password:"))},null,8,h2),ue("span",{textContent:q.toDisplayString(A.value)},null,8,m2)])):ke("",!0),y.value?(Y(),Te(B,{key:2,class:"mt-2","min-date":f(jt.DateTime).now(),label:f(i)("Expiry date"),"is-dark":f(S).isDark,onDateChanged:se},null,8,["min-date","label","is-dark"])):ke("",!0)]),ue("div",g2,[me(f(Sn),{class:"link-modal-cancel oc-modal-body-actions-cancel ml-2",onClick:x[1]||(x[1]=Re=>F.$emit("cancel"))},{default:ve(()=>[kt(q.toDisplayString(f(i)("Cancel")),1)]),_:1}),ue("div",{class:q.normalizeClass(["ml-2",{"oc-button-group":A.value}])},[me(f(Sn),{class:"link-modal-confirm oc-modal-body-actions-confirm",appearance:"filled",disabled:we.value,onClick:x[2]||(x[2]=Re=>F.$emit("confirm"))},{default:ve(()=>[kt(q.toDisplayString(h.value),1)]),_:1},8,["disabled"]),A.value?(Y(),Te(f(Sn),{key:0,class:"link-modal-confirm oc-modal-body-actions-confirm-secondary-trigger p-1",appearance:"filled",disabled:we.value,"aria-label":f(i)("More options")},{default:ve(()=>[me(G,{size:"small",name:"arrow-down-s"}),ue("span",y2,q.toDisplayString(f(i)("More options")),1)]),_:1},8,["disabled","aria-label"])):ke("",!0),A.value?(Y(),Te(ge,{key:1,"drop-id":"oc-modal-body-actions-confirm-secondary-drop",toggle:".oc-modal-body-actions-confirm-secondary-trigger",mode:"click","padding-size":"small",title:f(i)("More options"),"close-on-click":""},{default:ve(()=>[me(z,null,{default:ve(()=>[ue("li",null,[me(f(Sn),{class:"oc-modal-body-actions-confirm-password",appearance:"raw","justify-content":"left",onClick:x[3]||(x[3]=Re=>F.$emit("confirm",{copyPassword:!0}))},{default:ve(()=>[kt(q.toDisplayString(E.value),1)]),_:1})])]),_:1})]),_:1},8,["title"])):ke("",!0)],2)])],64)}}}),v2=({enforceModal:e=!1}={})=>{const t=He(),n=gt(),{$gettext:r,$ngettext:i}=Oe.useGettext(),o=Zt(),s=fn(),a=yn(),{defaultLinkType:l}=Ha(),{addLink:u}=kr(),{dispatchModal:c}=ft(),{copyLink:d}=kd(),p=({space:w,resources:S})=>{const y=o.sharingPublicPasswordEnforcedFor.read_only===!0;if(e||y){c({title:i("Copy link for »%{resourceName}«","Copy links for the selected items",S.length,{resourceName:S[0].name}),customComponent:y0,customComponentAttrs:()=>({space:w,resources:S}),hideActions:!0});return}const g=S.map(h=>u({clientService:t,space:w,resource:h,options:{"@libre.graph.quickLink":!1,displayName:r("Unnamed link"),type:f(l)}}));d({createLinkHandler:()=>a.addTask(()=>Promise.allSettled(g))})},m=({resources:w})=>{if(!w.length)return!1;for(const S of w)if(!S.canShare({user:n.user,ability:s})||re.isProjectSpaceResource(S)&&S.disabled)return!1;return!0};return{actions:M(()=>[{name:"create-links",icon:"link",handler:p,label:()=>r("Create links"),isVisible:m,class:"oc-files-actions-create-links"}])}},b2=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=tt(),r=gt(),{$gettext:i}=Oe.useGettext(),{dispatchModal:o}=ft(),s=lr(),{isEnabled:a}=Qr(),{openEditor:l}=Jn(),u=He(),c=We(),{resources:d,currentFolder:p,areFileExtensionsShown:m}=Me.storeToRefs(c),{isFileNameValid:b}=Ei(),w=M(()=>s.fileExtensions.filter(({newFileMenu:v})=>!!v)),S=(v,h)=>(c.upsertResource(v),l(h,f(e),v)),y=(v,h,E)=>{let T=i("New file")+`.${h}`;f(d).some(C=>C.name===T)&&(T=Hn(T,h,f(d))),m.value||(T=re.extractNameWithoutExtension({name:T,extension:h}));const R=m.value?[0,T.length-(h.length+1)]:null;o({title:i("Create a new file"),confirmText:i("Create"),hasInput:!0,inputValue:T,inputLabel:i("File name"),inputRequiredMark:!0,inputSelectionRange:R,onConfirm:async C=>{m.value||(C=`${C}.${h}`);try{let A;if(E.createFileHandler)A=await E.createFileHandler({fileName:C,space:f(e),currentFolder:f(p)});else if(E.type==="folder"){const D=ct.join(f(p).path,C);A=await u.webdav.createFolder(f(e),{path:D})}else{const D=ct.join(f(p).path,C);A=await u.webdav.putFileContents(f(e),{path:D})}return c.upsertResource(A),t({title:i("»%{fileName}« was created successfully",{fileName:A.name})}),f(a)?void 0:S(A,E)}catch(A){console.error(A),n({title:i("Failed to create file"),errors:[A]})}},onInput:(C,A)=>{const D=m.value?C:`${C}.${h}`,V={path:ct.join(f(p).path,D),name:D,extension:h},{isValid:O,error:N}=b(V,D);A(O?null:N)}})};return{actions:M(()=>{const v=[],h={};for(const E of f(w)||[])E.hasPriority?h[E.extension]=E:h[E.extension]=h[E.extension]||E;for(const[,E]of Object.entries(h))v.push({name:"create-new-file",icon:"add",handler:T=>y(T,E.extension,E),label:()=>i(E.newFileMenu.menuTitle()),isVisible:()=>f(p)?.canUpload({user:r.user}),class:"oc-files-actions-create-new-file",ext:E.extension,isExternal:E.app?.startsWith("external-")});return v}),openFile:S}},v0=()=>{const e=en("scrollTo"),t=en("details"),n=We(),r=M(()=>Rt(f(e))),i=M(()=>Rt(f(t))),o=(a,l={forceScroll:!1,topbarElement:null})=>{const u=document.querySelectorAll(`[data-item-id='${a}']`)[0];if(!u){Je.publish("app.files.navigate.page",{resourceId:a,forceScroll:l.forceScroll,topbarElement:l.topbarElement});return}const d=document.getElementById(l.topbarElement)?.offsetHeight||0+u.offsetHeight*2;(u.getBoundingClientRect().bottom>window.innerHeight||u.getBoundingClientRect().top<d||l.forceScroll)&&u.scrollIntoView({behavior:"smooth",block:"center"})};return Je.subscribe("app.files.navigate.scrollTo",a=>o(a.resourceId,{forceScroll:a.forceScroll,topbarElement:a.topbarElement})),{scrollToResource:o,scrollToResourceFromRoute:(a,l)=>{if(!f(r)||!a.length)return;const u=f(a).find(c=>re.isIncomingShareResource(c)?c.remoteItemId===f(r):c.id===f(r));u&&u.processing!==!0&&(n.setSelection([u.id]),o(u.id,{forceScroll:!0,topbarElement:l}),f(i)&&Je.publish(Ct.openWithPanel,f(i)))}}},w2=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=tt(),{dispatchModal:r}=ft(),{$gettext:i}=Oe.useGettext(),{scrollToResource:o}=v0(),s=We(),{resources:a,currentFolder:l}=Me.storeToRefs(s),u=He(),{isFileNameValid:c}=Ei(),d=async b=>{b=b.trimEnd();try{const w=ct.join(f(l).path,b),S=await u.webdav.createFolder(f(e),{path:w});re.isShareSpaceResource(f(e))&&(S.remoteItemId=f(e).id),s.upsertResource(S),t({title:i("»%{folderName}« was created successfully",{folderName:b})}),await Vt(),o(S.id,{forceScroll:!0,topbarElement:"files-app-bar"})}catch(w){console.error(w),n({title:i("Failed to create folder"),errors:[w]})}},p=()=>{let b=i("New folder");f(a).some(w=>w.name===b)&&(b=Hn(b,"",f(a))),r({title:i("Create a new folder"),confirmText:i("Create"),hasInput:!0,inputValue:b,inputLabel:i("Folder name"),inputRequiredMark:!0,onConfirm:d,onInput:(w,S)=>{const y={path:ct.join(f(l).path,w),name:w,isFolder:!0},{isValid:g,error:v}=c(y,w,f(a));return S(g?null:v)}})};return{actions:M(()=>[{name:"create-folder",icon:"folder",handler:p,label:()=>i("New Folder"),isVisible:()=>f(l)?.canCreate(),class:"oc-files-actions-create-new-folder"}]),addNewFolder:d}},S2="rowMounted",E2="fileDropped",T2="contextmenuClicked";class os{static Thumbnail=[36,36];static Tile=[1e3,1e3];static Preview=[1200,1200];static Avatar=64}class A2{static Thumbnail="thumbnail";static Preview="preview";static Avatar="avatar"}const Pd=10,x2=63,Id=256;class C2{state;observeEnter;observeExit;onEnterCallCount;onExitCallCount;onEnter;onExit;threshold;unobserver;constructor(t,n,r){this.unobserver=t,this.threshold=n,this.onEnter=r.onEnter,this.onExit=r.onExit,this.observeEnter=!!r.onEnter,this.observeExit=!!r.onExit,this.onEnterCallCount=0,this.onExitCallCount=0}request(t,n){const r={element:n,unobserve:()=>this.unobserve(t,n)};t===0&&this.observeEnter&&this.onEnter?(this.onEnterCallCount++,this.onEnter({callCount:this.onEnterCallCount,...r})):this.state===0&&t===1&&this.observeExit&&this.onExit&&(this.onExitCallCount++,this.onExit({callCount:this.onExitCallCount,...r})),this.state=t}unobserve(t,n){t===0?this.observeEnter=!1:t===1&&(this.observeExit=!1),!this.observeEnter&&!this.observeExit&&this.unobserver(n)}}class b0{targets;intersectionObserver;options;constructor(t={}){this.options={root:t.root,rootMargin:t.rootMargin,threshold:t.threshold||0},this.targets=new WeakMap,this.intersectionObserver=new IntersectionObserver(this.trigger.bind(this),this.options)}observe(t,n={},r){!n.onEnter&&!n.onExit||(this.targets.set(t,new C2(this.unobserve.bind(this),r||this.options.threshold||0,{onEnter:n.onEnter,onExit:n.onExit})),this.intersectionObserver.observe(t))}unobserve(t){this.targets.delete(t),this.intersectionObserver.unobserve(t)}disconnect(){this.targets=new WeakMap,this.intersectionObserver.disconnect()}trigger(t){t.forEach(n=>{const r=this.targets.get(n.target);r&&r.request(n.isIntersecting&&n.intersectionRatio>r.threshold?0:1,n.target)})}}const ss=Fe({__name:"ResourceIcon",props:{resource:{},size:{default:"large"}},setup(e){const t={name:"resource-type-folder",color:"var(--oc-color-icon-folder)"},n={name:"resource-type-folder",color:"var(--oc-role-secondary)"},r={name:"layout-grid",color:"var(--oc-role-secondary)"},i={name:"layout-grid",color:"var(--oc-role-secondary)"},o={name:"resource-type-file",color:"var(--oc-role-on-surface)"},s=xh(),a=Sr(Ah),l=M(()=>e.resource.extension?!1:e.resource.type==="folder"||e.resource.isFolder),u=M(()=>e.resource.type==="space"),c=M(()=>re.isProjectSpaceResource(e.resource)&&e.resource.disabled===!0),d=M(()=>re.isPersonalSpaceResource(e.resource)),p=M(()=>e.resource.extension?.toLowerCase()),m=M(()=>e.resource.mimeType?.toLowerCase()),b=M(()=>{if(f(d))return n;if(f(c))return i;if(f(u))return r;if(f(l))return t;const w=s[f(p)]||a?.mimeType[f(m)]||a?.extension[f(p)];return{...o,...w}});return(w,S)=>{const y=Ee("oc-icon");return Y(),Te(y,{key:`resource-icon-${b.value.name}`,name:b.value.name,color:b.value.color,size:e.size,class:q.normalizeClass(["oc-resource-icon","inline-flex","items-center",{"opacity-80 grayscale":c.value,"[&_svg]:h-[70%]":!u.value&&!l.value}])},null,8,["name","color","size","class"])}}}),R2={name:"ResourceLink",props:{link:{type:Object,required:!1,default:null},resource:{type:Object,required:!0},isResourceClickable:{type:Boolean,required:!1,default:!0}},emits:["click"],setup:e=>{const t=ut(),{options:n}=Me.storeToRefs(t);return{linkTarget:M(()=>f(n).cernFeatures&&e.link&&!e.resource.isFolder?"_blank":"_self")}},computed:{isNavigatable(){return this.resource?this.link&&!this.resource.disabled:!1},isClickable(){return this.isResourceClickable&&!this.resource?.disabled}},methods:{emitClick(e){!e||typeof e.stopPropagation!="function"||this.isNavigatable||this.$emit("click",e)}}},k2={key:1};function P2(e,t,n,r,i,o){return n.isResourceClickable?(Y(),Te(On(o.isNavigatable?"router-link":"oc-button"),{key:0,to:o.isNavigatable?n.link:void 0,target:o.isNavigatable?e.linkTarget:void 0,rel:o.isNavigatable&&e.linkTarget==="_blank"?"noopener noreferrer":void 0,appearance:o.isNavigatable?void 0:"raw","gap-size":o.isNavigatable?void 0:"none","justify-content":o.isNavigatable?void 0:"left",type:o.isNavigatable?void 0:"button","no-hover":o.isNavigatable?void 0:!0,draggable:!1,class:"oc-resource-link max-w-full",onDragstart:t[0]||(t[0]=qt(()=>{},["prevent","stop"])),onClick:o.emitClick},{default:ve(()=>[Ve(e.$slots,"default",{},void 0,!0)]),_:3},40,["to","target","rel","appearance","gap-size","justify-content","type","no-hover","onClick"])):(Y(),pe("span",k2,[Ve(e.$slots,"default",{},void 0,!0)]))}const Ka=Xe(R2,[["render",P2],["__scopeId","data-v-15d92dd6"]]),I2=Fe({name:"ResourceName",props:{name:{type:String,required:!0},pathPrefix:{type:String,required:!1,default:""},extension:{type:String,required:!1,default:""},type:{type:String,required:!0},fullPath:{type:String,required:!0},isPathDisplayed:{type:Boolean,required:!1,default:!1},isExtensionDisplayed:{type:Boolean,required:!1,default:!0},truncateName:{type:Boolean,required:!1,default:!0}},computed:{tooltip(){return this.pathTooltip},fullName(){return(this.displayPath||"")+this.name},displayName(){return this.extension?this.name.slice(0,-this.extension.length-1):this.name},displayExtension(){return this.extension?"."+this.extension:""},displayPath(){if(!this.isPathDisplayed)return null;const e=this.fullPath.replace(/^\//,"").split("/");return e.length<2?null:e.length===2?e[0]+"/":`…/${e[e.length-2]}/`},pathTooltip(){return!this.isPathDisplayed||this.displayPath===this.fullPath?null:this.pathPrefix?jl.join(this.pathPrefix,this.fullPath):this.fullPath},htmlTitle(){if(!this.tooltip)return this.isExtensionDisplayed?`${this.displayName}${this.displayExtension}`:this.displayName}}}),O2=["data-test-resource-path","data-test-resource-name","data-test-resource-type","title"],F2={key:0,class:"truncate leading-4"},_2=["textContent"],D2=["textContent"],N2=["textContent"];function L2(e,t,n,r,i,o){const s=sn("oc-tooltip");return it((Y(),pe("span",{class:q.normalizeClass(["oc-resource-name flex min-w-0",[{"inline-block":!e.truncateName}]]),"data-test-resource-path":e.fullPath,"data-test-resource-name":e.fullName,"data-test-resource-type":e.type,title:e.htmlTitle},[e.truncateName?(Y(),pe("span",F2,[ue("span",{class:"oc-resource-basename whitespace-pre text-role-on-surface",textContent:q.toDisplayString(e.displayName)},null,8,_2)])):(Y(),pe("span",{key:1,class:"oc-resource-basename break-normal text-role-on-surface leading-4",textContent:q.toDisplayString(e.displayName)},null,8,D2)),e.extension&&e.isExtensionDisplayed?(Y(),pe("span",{key:2,class:"oc-resource-extension whitespace-pre text-role-on-surface leading-4",textContent:q.toDisplayString(e.displayExtension)},null,8,N2)):ke("",!0)],10,O2)),[[s,e.tooltip]])}const Od=Xe(I2,[["render",L2]]),$2={class:"flex"},M2=["textContent"],as=Fe({__name:"ResourceListItem",props:{resource:{},pathPrefix:{default:""},link:{default:null},isPathDisplayed:{type:Boolean,default:!1},parentFolderLink:{default:null},parentFolderName:{default:""},parentFolderLinkIconAdditionalAttributes:{default:()=>({})},isExtensionDisplayed:{type:Boolean,default:!0},isThumbnailDisplayed:{type:Boolean,default:!0},isIconDisplayed:{type:Boolean,default:!0},isResourceClickable:{type:Boolean,default:!0}},emits:["click"],setup(e,{emit:t}){const n=t,{$gettext:r}=Oe.useGettext(),i=M(()=>e.parentFolderLink?"router-link":"span"),o=M(()=>({"fill-type":"line",name:"folder-2",size:"small",...e.parentFolderLinkIconAdditionalAttributes})),s=M(()=>e.isThumbnailDisplayed&&Object.prototype.hasOwnProperty.call(e.resource,"thumbnail")),a=M(()=>e.resource.thumbnail),l=M(()=>e.resource.locked?r("This item is locked"):null),u=c=>{!c||typeof c.stopPropagation!="function"||n("click",c)};return(c,d)=>{const p=Ee("oc-image"),m=Ee("oc-icon"),b=sn("oc-tooltip");return Y(),pe("div",{class:q.normalizeClass(["oc-resource inline-flex justify-start items-center max-w-full overflow-visible",{"pointer-events-none":!e.isResourceClickable}])},[e.isIconDisplayed?it((Y(),Te(Ka,{key:0,resource:e.resource,link:e.link,"is-resource-clickable":e.isResourceClickable,class:q.normalizeClass(["relative",{"hover:underline":e.isResourceClickable}]),"aria-label":e.isResourceClickable?f(r)("Open »%{name}«",{name:e.resource?.name??""}):void 0,onClick:u},{default:ve(()=>[s.value?it((Y(),Te(p,{key:a.value,src:a.value,"data-test-thumbnail-resource-name":e.resource.name,class:"rounded-xs size-8 object-cover max-w-fit","aria-label":l.value,alt:""},null,8,["src","data-test-thumbnail-resource-name","aria-label"])),[[b,l.value]]):it((Y(),Te(ss,{key:1,"aria-label":l.value,"aria-hidden":"true",resource:e.resource},null,8,["aria-label","resource"])),[[b,l.value]])]),_:1},8,["resource","link","is-resource-clickable","class","aria-label"])),[[b,e.isResourceClickable?l.value:void 0]]):ke("",!0),ue("div",{class:q.normalizeClass(["oc-resource-details block truncate",{"pl-2":e.isIconDisplayed}])},[me(Ka,{resource:e.resource,"is-resource-clickable":e.isResourceClickable,link:e.link,class:q.normalizeClass(["hover:outline-offset-0 focus:outline-offset-0",{"hover:underline":e.isResourceClickable}]),onClick:u},{default:ve(()=>[(Y(),Te(Od,{key:e.resource.name,name:e.resource.name,"path-prefix":e.pathPrefix,extension:e.resource.extension,type:e.resource.type,"full-path":e.resource.path,"is-path-displayed":e.isPathDisplayed,"is-extension-displayed":e.isExtensionDisplayed},null,8,["name","path-prefix","extension","type","full-path","is-path-displayed","is-extension-displayed"]))]),_:1},8,["resource","is-resource-clickable","link","class"]),ue("div",$2,[e.isPathDisplayed?(Y(),Te(On(i.value),{key:0,to:e.parentFolderLink,class:q.normalizeClass(["parent-folder flex items-center truncate px-0.5 mr-2 -ml-0.5 hover:bg-transparent",{"cursor-pointer":e.parentFolderLink,"cursor-default":!e.parentFolderLink}])},{default:ve(()=>[me(m,Mt(o.value,{class:"mr-1"}),null,16),ue("span",{class:"text truncate text-sm hover:underline",textContent:q.toDisplayString(e.parentFolderName)},null,8,M2)]),_:1},8,["to","class"])):ke("",!0)])],2)],2)}}}),w0=Fe({__name:"ResourcePreview",props:{searchResult:{default:()=>({data:{}})},isClickable:{type:Boolean,default:!0},term:{default:""}},setup(e){const t=new b0,{triggerDefaultAction:n}=Jn(),{getMatchingSpace:r}=ln(),{getDefaultAction:i}=Jn(),{loadPreview:o}=Bd(),s=An("resourceListItem"),{getPathPrefix:a,getParentFolderName:l,getParentFolderLink:u,getParentFolderLinkIconAdditionalAttributes:c,getFolderLink:d}=Yr(),p=We(),m=ae(),b=M(()=>p.areFileExtensionsShown),w=M(()=>({...e.searchResult.data,...f(m)&&{thumbnail:f(m)}})),S=M(()=>r(f(w))),y=M(()=>{const C=f(w);return re.isSpaceResource(C)&&C.disabled===!0}),g=()=>{n({space:f(S),resources:[f(w)]})},v=M(()=>e.isClickable?{parentFolderLink:u(f(w)),onClick:g}:{isResourceClickable:!1}),h=M(()=>{if(f(w).isFolder)return d(f(w));const C=i({resources:[f(w)],space:f(S)});if(!C?.route)return null;const A=C.route({space:f(S),resources:[f(w)]});return A.query={...A.query,contextRouteQuery:{...A.query?.contextRouteQuery||{},term:e.term}},A}),E=a(f(w)),T=l(f(w)),R=c(f(w));return $t(()=>{f(y)&&f(s).parentElement.classList.add("disabled");const C=async()=>{const D=await o({space:f(S),resource:f(w),dimensions:os.Thumbnail,cancelRunning:!0,updateStore:!1});D&&(m.value=D)},A=At.debounce(({unobserve:D})=>{D(),C()},250);t.observe(f(s).$el,{onEnter:A,onExit:A.cancel})}),xn(()=>{t.disconnect()}),(C,A)=>(Y(),Te(as,Mt({ref_key:"resourceListItem",ref:s,resource:w.value,"path-prefix":f(E),"is-path-displayed":!0,link:h.value,"is-extension-displayed":b.value,"parent-folder-link-icon-additional-attributes":f(R),"parent-folder-name":f(T),"is-thumbnail-displayed":!!m.value},v.value),null,16,["resource","path-prefix","link","is-extension-displayed","parent-folder-link-icon-additional-attributes","parent-folder-name","is-thumbnail-displayed"]))}}),B2=7,j2=200,U2=Fe({name:"CreateShortcutModal",components:{ResourcePreview:w0},props:{modal:{type:Object,required:!0},space:{type:Object,required:!0}},emits:["update:confirmDisabled"],setup(e,{emit:t,expose:n}){const r=He(),{$gettext:i}=Oe.useGettext(),{showMessage:o,showErrorMessage:s}=tt(),a=ze(),{search:l}=rd(),{getPathPrefix:u,getParentFolderName:c,getParentFolderLink:d,getParentFolderLinkIconAdditionalAttributes:p,getFolderLink:m}=Yr(),b=We(),{resources:w,currentFolder:S}=Me.storeToRefs(b),y=An("dropRef"),g=ae(""),v=ae(""),h=ae(null),E=ae(null),T=ae(!1);let R;const C=G=>{const H=G.trim();return L(H)?H:`https://${H}`},A=M(()=>C(f(g))),D=M(()=>!!f(w).find(G=>G.name===`${f(v)}.url`)),V=M(()=>f(D)||!f(v)||!f(g));ot(V,()=>{t("update:confirmDisabled",f(V))},{immediate:!0});const O=M(()=>f(D)?i("»%{name}« already exists",{name:`${f(v)}.url`}):/[/]/.test(f(v))?i('Shortcut name cannot contain "/"'):""),N=rn.useTask(function*(G,H){h.value=null,H=`name:"*${H}*" NOT name:"*.url"`;try{h.value=yield l(H,B2)}catch{}}),W=At.debounce(()=>{N.perform(f(g))},j2),L=G=>["http://","https://"].some(B=>B.startsWith(G)||G.startsWith(B)),ee=()=>{h.value=null,g.value=f(A);try{let G=new URL(f(A)).host;f(w).some(H=>H.name===`${G}.url`)&&(G=Hn(`${G}.url`,"url",f(w)).slice(0,-4)),v.value=G}catch{}},J=G=>{h.value=null;const H=new URL(window.location.href);let B=G.data.name;g.value=`${H.origin}/f/${G.id}`,f(w).some(z=>z.name===`${B}.url`)&&(B=Hn(`${B}.url`,"url",f(w)).slice(0,-4)),v.value=B},se=G=>f(E)===G,he=(G=!1)=>{const H=Array.from(document.querySelectorAll("li.selectable-item"));let B=f(E)!==null?f(E):G?H.length:-1;const z=G?-1:1;do if(B+=z,B<0||B>H.length-1)return null;while(H[B].classList.contains("disabled"));return B},oe=()=>{E.value=he(!0)},we=()=>{E.value=he(!1)},X=G=>{f(T)&&(G.stopPropagation(),f(y).hide())},ie=G=>{f(T)&&(G.stopPropagation(),f(E)!==null&&(f(E)===0?ee():J(f(h)?.values?.[f(E)-1]),f(y).hide()))},le=()=>{T.value=!1,E.value=null},Ae=()=>{T.value=!0,E.value=0},te=()=>{g.value.trim().length&&f(y).show()},F=async()=>{if(await Vt(),v.value=g.value.trim(),!g.value.trim().length){f(y).hide();return}f(y).show(),Rn(a,"files-public-link")||W()},x=async()=>{try{const H=`[InternetShortcut]
64
- URL=${Xd.sanitize(C(f(g)),{USE_PROFILES:{html:!0}})}`,B=re.urlJoin(f(S).path,`${f(v)}.url`),z=await r.webdav.putFileContents(e.space,{path:B,content:H});b.upsertResource(z),o({title:i("Shortcut was created successfully")})}catch(G){console.error(G),s({title:i("Failed to create shortcut"),errors:[G]})}};return $t(async()=>{await Vt(),R=new Yd(f(y)?.$refs?.drop)}),ot(h,async()=>{await Vt(),!(!f(T)||!R)&&(R.unmark(),R.mark(f(g),{element:"span",className:"mark-highlight",exclude:[".selectable-item-url *",".create-shortcut-modal-search-separator *"]}))},{deep:!0}),ot(E,()=>{if(!f(T)||typeof f(y)?.$el?.scrollTo!="function")return;const G=f(y).$el.querySelectorAll(".selectable-item");G[f(E)]&&f(y).$el.scrollTo(0,f(E)===null?0:G[f(E)].getBoundingClientRect().y-G[f(E)].getBoundingClientRect().height)}),n({onConfirm:x}),{inputUrl:g,inputFilename:v,dropRef:y,dropItemUrl:A,searchResult:h,confirmButtonDisabled:V,inputFileNameErrorMessage:O,searchTask:N,dropItemUrlClicked:ee,dropItemResourceClicked:J,getPathPrefix:u,getFolderLink:m,getParentFolderLink:d,getParentFolderName:c,getParentFolderLinkIconAdditionalAttributes:p,onKeyEnterDrop:ie,onKeyDownDrop:we,onKeyUpDrop:oe,onKeyEscDrop:X,onHideDrop:le,onShowDrop:Ae,onInputUrlInput:F,onClickUrlInput:te,isDropItemActive:se,onConfirm:x}}}),V2={class:"flex items-center mb-1"},q2={for:"create-shortcut-modal-url-input"},z2=["textContent"],W2={key:0,class:"p-1 flex justify-center"},H2={class:"create-shortcut-modal-search-separator text-role-on-surface-variant text-sm pl-1"},K2=["textContent"],G2={key:0,class:"flex w-full mt-4"},Q2={class:"flex items-center mb-1"},X2={for:"create-shortcut-modal-filename-input"};function Y2(e,t,n,r,i,o){const s=Ee("oc-contextual-helper"),a=Ee("oc-text-input"),l=Ee("oc-icon"),u=Ee("oc-button"),c=Ee("oc-spinner"),d=Ee("resource-preview"),p=Ee("oc-list"),m=Ee("oc-drop");return Y(),pe(je,null,[me(a,{id:"create-shortcut-modal-url-input",modelValue:e.inputUrl,"onUpdate:modelValue":[t[0]||(t[0]=b=>e.inputUrl=b),e.onInputUrlInput],placeholder:"example.org",label:e.$gettext("Webpage or file"),onKeydown:[wo(e.onKeyUpDrop,["up"]),wo(e.onKeyDownDrop,["down"]),wo(e.onKeyEscDrop,["esc"]),wo(e.onKeyEnterDrop,["enter"])],onClick:e.onClickUrlInput},{label:ve(()=>[ue("div",V2,[ue("label",q2,[kt(q.toDisplayString(e.$gettext("Webpage or file"))+" ",1),t[2]||(t[2]=ue("span",{class:"text-role-error","aria-hidden":"true"},"*",-1))]),me(s,{text:e.$gettext("Enter the target URL of a webpage or the name of a file. Users will be directed to this webpage or file."),title:e.$gettext("Webpage or file"),class:"ml-1"},null,8,["text","title"])])]),_:1},8,["modelValue","label","onKeydown","onUpdate:modelValue","onClick"]),me(m,{ref:"dropRef",class:"w-lg","padding-size":"remove","drop-id":"create-shortcut-modal-contextmenu",mode:"manual",position:"bottom-start","close-on-click":"","enforce-drop-on-mobile":"",onHideDrop:e.onHideDrop,onShowDrop:e.onShowDrop},{default:ve(()=>[me(p,null,{default:ve(()=>[ue("li",{class:q.normalizeClass(["selectable-item selectable-item-url",{active:e.isDropItemActive(0)}])},[me(u,{class:"w-full",appearance:"raw","justify-content":"left",onClick:e.dropItemUrlClicked},{default:ve(()=>[me(l,{name:"external-link"}),ue("span",{textContent:q.toDisplayString(e.dropItemUrl)},null,8,z2)]),_:1},8,["onClick"])],2),e.searchTask.isRunning?(Y(),pe("li",W2,[me(c)])):ke("",!0),e.searchResult?.values?.length?(Y(),pe(je,{key:1},[ue("li",H2,[ue("span",{textContent:q.toDisplayString(e.$gettext("Link to a file"))},null,8,K2)]),(Y(!0),pe(je,null,dt(e.searchResult.values,(b,w)=>(Y(),pe("li",{key:w,class:q.normalizeClass(["selectable-item",{active:e.isDropItemActive(w+1)}])},[me(u,{class:"w-full",appearance:"raw","justify-content":"left",onClick:S=>e.dropItemResourceClicked(b)},{default:ve(()=>[me(d,{"search-result":b,"is-clickable":!1},null,8,["search-result"])]),_:2},1032,["onClick"])],2))),128))],64)):ke("",!0)]),_:1})]),_:1},8,["onHideDrop","onShowDrop"]),e.inputFilename?(Y(),pe("div",G2,[me(a,{id:"create-shortcut-modal-filename-input",modelValue:e.inputFilename,"onUpdate:modelValue":t[1]||(t[1]=b=>e.inputFilename=b),label:e.$gettext("Shortcut name"),class:"w-full","error-message":e.inputFileNameErrorMessage,"fix-message-line":!0},{label:ve(()=>[ue("div",Q2,[ue("label",X2,[kt(q.toDisplayString(e.$gettext("Shortcut name"))+" ",1),t[3]||(t[3]=ue("span",{class:"text-role-error","aria-hidden":"true"},"*",-1))]),me(s,{text:e.$gettext("Shortcut name as it will appear in the file list."),title:e.$gettext("Shortcut name"),class:"ml-1"},null,8,["text","title"])])]),_:1},8,["modelValue","label","error-message"])])):ke("",!0)],64)}const S0=Xe(U2,[["render",Y2]]),J2=({space:e})=>{const{dispatchModal:t}=ft(),{$gettext:n}=Oe.useGettext(),r=We(),{currentFolder:i}=Me.storeToRefs(r);return{actions:M(()=>[{name:"create-shortcut",icon:"external-link",handler:()=>{t({title:n("Create a Shortcut"),confirmText:n("Create"),customComponent:S0,customComponentAttrs:()=>({space:f(e)})})},label:()=>n("New Shortcut"),isVisible:()=>f(i)?.canCreate(),class:"oc-files-actions-create-new-shortcut"}])}},Fd=()=>{const{showMessage:e,showErrorMessage:t}=tt(),{can:n}=fn(),{$gettext:r,$ngettext:i}=Oe.useGettext(),{createSpace:o}=Xi(),s=He(),a=ze(),l=M(()=>n("create-all","Drive")),{dispatchModal:u}=ft(),c=ut(),d=st(),p=We(),{isSpaceNameValid:m}=Ei(),b=async({spaceName:y,resources:g,space:v})=>{const{webdav:h}=s,E=new Lr({concurrency:c.options.concurrentRequests.resourceBatchActions}),T=[];try{const R=await o(y);d.upsertSpace(R),g.length===1&&g[0].isFolder&&(g=(await h.listFiles(v,{path:g[0].path})).children);for(const C of g)T.push(E.add(()=>h.copyFiles(v,C,R,{path:C.name})));await Promise.all(T),p.resetSelection(),e({title:r("Space was created successfully")})}catch(R){console.error(R),t({title:r("Creating space failed…"),errors:[R]})}},w=({resources:y,space:g})=>{u({title:i("Create Space from »%{resourceName}«","Create Space from selection",y.length,{resourceName:y[0].name}),message:i("Create Space with the content of »%{resourceName}«.","Create Space with the selected files.",y.length,{resourceName:y[0].name}),contextualHelperLabel:r("The marked elements will be copied."),contextualHelperData:{title:r("Restrictions"),text:r("Shares, versions and tags will not be copied.")},confirmText:r("Create"),hasInput:!0,inputLabel:r("Space name"),inputRequiredMark:!0,onInput:(v,h)=>{const{isValid:E,error:T}=m(v);h(E?null:T)},onConfirm:v=>b({spaceName:v,space:g,resources:y})})};return{actions:M(()=>[{name:"create-space-from-resource",icon:"function",handler:w,label:()=>r("Create Space from selection"),isVisible:({resources:y,space:g})=>!(!y.length||!f(l)||!pt(a,"files-spaces-generic")||!re.isPersonalSpaceResource(g)),class:"oc-files-actions-create-space-from-resource-trigger"}])}},ls=()=>{const e=gt(),t=Zt(),n=ze(),r=M0(),{displayDialog:i,filesList_delete:o}=$0(),{$gettext:s}=Oe.useGettext(),a=({space:u,resources:c,deletePermanent:d})=>{if(It(n,"files-common-search")&&(c=c.filter(p=>p.canBeDeleted()&&!p.isShareRoot()&&!re.isProjectSpaceResource(p))),d){i(u,c);return}o(c)};return{actions:M(()=>[{name:"delete",icon:"delete-bin-5",label:()=>s("Delete"),handler:({space:u,resources:c})=>a({space:u,resources:c,deletePermanent:!1}),isVisible:({space:u,resources:c})=>!pt(n,"files-spaces-generic")&&!Rn(n,"files-public-link")&&!It(n,"files-common-search")&&!f(r)||c.length===0||pt(n,"files-spaces-generic")&&u?.driveType==="share"&&c[0].path==="/"?!1:It(n,"files-common-search")?c.some(d=>d.canBeDeleted()&&!d.isShareRoot()&&!re.isProjectSpaceResource(d)):!c.some(d=>!d.canBeDeleted()||re.isProjectSpaceResource(d)),isDisabled:({resources:u})=>u.length===1&&u[0].locked,disabledTooltip:()=>s("File can't be deleted because it is currently locked."),class:"oc-files-actions-delete-trigger"},{name:"delete-permanent",icon:"delete-bin-5",label:()=>s("Delete"),handler:({space:u,resources:c})=>a({space:u,resources:c,deletePermanent:!0}),isVisible:({space:u,resources:c})=>!dn(n,"files-trash-generic")||!t.filesPermanentDeletion||re.isProjectSpaceResource(u)&&!u.canDeleteFromTrashBin({user:e.user})?!1:c.length>0,class:"oc-files-actions-delete-permanent-trigger"}])}},Ga=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=ze(),{$gettext:r,$ngettext:i}=Oe.useGettext(),o=He(),s=yn(),a=ut(),{updateResourceField:l}=We(),u=async({resources:d})=>{const p=[],m=[],b=new Lr({concurrency:a.options.concurrentRequests.resourceBatchActions});if(d.forEach(w=>{m.push(b.add(async()=>{try{const{graphAuthenticated:S}=o;await S.driveItems.deleteDriveItem(w.driveId,w.id),l({id:w.id,field:"syncEnabled",value:!1})}catch(S){console.error(S),p.push(S)}}))}),await Promise.all(m),p.length===0){pt(n,"files-spaces-generic")&&(e({title:i("Sync for the selected share was disabled successfully","Sync for the selected shares was disabled successfully",d.length)}),n.push(Dn("files-shares-with-me")));return}t({title:i("Failed to disable sync for the the selected share","Failed to disable sync for the selected shares",d.length),errors:p})};return{actions:M(()=>[{name:"disable-sync",icon:"spam-3",handler:d=>s.addTask(()=>u(d)),label:()=>r("Disable sync"),isVisible:({space:d,resources:p})=>!Bt(n,"files-shares-with-me")&&!pt(n,"files-spaces-generic")||p.length===0||pt(n,"files-spaces-generic")&&(d?.driveType!=="share"||p.length>1||p[0].path!=="/")?!1:p.some(m=>m.syncEnabled),class:"oc-files-actions-disable-sync-trigger"}])}},E0=()=>xr("$archiverService"),Qa=()=>{const{showErrorMessage:e}=tt(),t=ze(),n=E0(),{$ngettext:r,$gettext:i,current:o}=Oe.useGettext(),s=li(),a=Dr(),l=({space:d,resources:p})=>(p.length>1&&(p=p.filter(m=>m.canDownload()&&!re.isProjectSpaceResource(m))),n.triggerDownload({fileIds:p.map(m=>m.fileId),...d&&re.isPublicSpaceResource(d)&&{publicToken:d.id,publicLinkPassword:s.publicLinkPassword}}).catch(m=>{console.error(m),e({title:r("Failed to download the selected folder.","Failed to download the selected files.",p.length),errors:[m]})})),u=d=>{const p=f(n.capability);return p?d.reduce((b,w)=>b+parseInt(`${w.size}`),0)>parseInt(p.max_size):void 0};return{actions:M(()=>[{name:"download-archive",icon:"inbox-archive",handler:d=>{l(d)},label:()=>i("Download"),disabledTooltip:({resources:d})=>u(d)?i("The selection exceeds the allowed archive size (max. %{maxSize})",{maxSize:bn(f(n.capability).max_size,o)}):"",isDisabled:({resources:d})=>u(d),isVisible:({resources:d})=>f(a)&&!pt(t,"files-spaces-generic")&&!Rn(t,"files-public-link")&&!It(t,"files-common-favorites")&&!It(t,"files-common-search")&&!Bt(t,"files-shares-with-me")&&!Bt(t,"files-shares-with-others")&&!Bt(t,"files-shares-via-link")&&!It(t,"files-common-search")||!f(n.available)||d.length===0||d.length===1&&!d[0].isFolder||d.length>1&&d.every(m=>re.isProjectSpaceResource(m))||re.isProjectSpaceResource(d[0])&&d[0].disabled?!1:!d.some(m=>!m.canDownload()),class:"oc-files-actions-download-archive-trigger"}])}},T0=e=>{const{showErrorMessage:t}=tt(),n=e?.clientService||He(),{$gettext:r}=Oe.useGettext(),i=gt();return{downloadFile:async(s,a,l=null)=>{try{const u=await n.webdav.getFileUrl(s,a,{version:l,username:i.user?.onPremisesSamAccountName});bc(u,a.name)}catch(u){console.error(u),t({title:r("Download failed"),desc:r("File could not be located"),errors:[u]})}}}},cs=()=>{const e=ze(),{$gettext:t}=Oe.useGettext(),n=Dr(),r=el(),{downloadFile:i}=T0(),o=({space:a,resources:l})=>{i(a,l[0])};return{actions:M(()=>[{name:"download-file",icon:"file-download",handler:o,label:()=>t("Download"),isVisible:({resources:a})=>f(n)&&!f(r)&&!pt(e,"files-spaces-generic")&&!Rn(e,"files-public-link")&&!It(e,"files-common-favorites")&&!It(e,"files-common-search")&&!Bt(e,"files-shares-with-me")&&!Bt(e,"files-shares-with-others")&&!Bt(e,"files-shares-via-link")||a.length!==1||a[0].isFolder?!1:a[0].canDownload(),class:"oc-files-actions-download-file-trigger"}])}},Z2=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=gt(),r=Zt(),{$gettext:i}=Oe.useGettext(),o=He(),{dispatchModal:s}=ft(),a=We(),l=st(),u=yn(),c=async({space:m})=>{try{await o.webdav.clearTrashBin(m),e({title:i("All deleted files were removed")}),a.clearResources(),a.resetSelection(),l.updateSpaceField({id:m.id,field:"hasTrashedItems",value:!1})}catch(b){console.error(b),t({title:i("Failed to empty trash bin"),errors:[b]})}},d=({resources:m})=>{s({title:i("Empty trash bin for »%{name}«",{name:m[0].name}),confirmText:i("Delete"),message:i("Are you sure you want to permanently delete the items in »%{name}«? You can’t undo this action.",{name:m[0].name}),hasInput:!1,onConfirm:()=>u.addTask(()=>c({space:m[0]}))})};return{actions:M(()=>[{name:"empty-trash-bin",icon:({resources:m})=>m[0]?.hasTrashedItems?"delete-bin-2":"delete-bin-7",label:()=>i("Empty trash bin"),handler:d,isVisible:({resources:m})=>m.length!==1||!r.filesPermanentDeletion||!re.isSpaceResource(m[0])?!1:m[0].canDeleteFromTrashBin({user:n.user}),isDisabled:({resources:m})=>!m[0].hasTrashedItems,class:"oc-files-actions-empty-trash-bin-trigger"}]),emptyTrashBin:c}},Xa=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=ze(),{$gettext:r,$ngettext:i}=Oe.useGettext(),o=He(),s=yn(),a=ut(),l=We(),{updateResourceField:u}=l,c=async({resources:p})=>{const m=[],b=[],w=new Lr({concurrency:a.options.concurrentRequests.resourceBatchActions});if(p.forEach(S=>{b.push(w.add(async()=>{try{const{graphAuthenticated:y}=o;await y.driveItems.createDriveItem(S.driveId,{name:S.name,remoteItem:{id:S.fileId}}),u({id:S.id,field:"syncEnabled",value:!0})}catch(y){console.error(y),m.push(y)}}))}),await Promise.all(b),m.length===0){l.resetSelection(),pt(n,"files-spaces-generic")&&e({title:i("Sync for the selected share was enabled successfully","Sync for the selected shares was enabled successfully",p.length)});return}t({title:i("Failed to enable sync for the the selected share","Failed to enable sync for the selected shares",p.length),errors:m})};return{actions:M(()=>[{name:"enable-sync",icon:"check",handler:p=>s.addTask(()=>c(p)),label:()=>r("Enable sync"),isVisible:({space:p,resources:m})=>!Bt(n,"files-shares-with-me")&&!pt(n,"files-spaces-generic")||m.length===0||pt(n,"files-spaces-generic")&&(f(p)?.driveType!=="share"||m.length>1||m[0].path!=="/")?!1:m.some(b=>!b.syncEnabled),class:"oc-files-actions-enable-sync-trigger"}])}},_d=()=>{const{showErrorMessage:e}=tt(),t=Zt(),n=ze(),{$gettext:r}=Oe.useGettext(),i=He(),o=Dr(),s=fn(),a=We(),l=fr(),u=async({space:d,resources:p})=>{try{const m=!p[0].starred;await i.webdav.setFavorite(d,p[0],m),a.updateResourceField({id:p[0].id,field:"starred",value:m}),m||l.publish("app.files.list.removeFromFavorites",p[0].id)}catch(m){const b=r('Failed to change favorite state of "%{file}"',{file:p[0].name},!0);e({title:b,errors:[m]})}};return{actions:M(()=>[{name:"favorite",icon:"star",handler:u,label:({resources:d})=>d[0].starred?r("Remove from favorites"):r("Add to favorites"),isVisible:({resources:d})=>f(o)&&!pt(n,"files-spaces-generic")&&!It(n,"files-common-favorites")||d.length!==1?!1:t.filesFavorites&&s.can("create","Favorite"),class:"oc-files-actions-favorite-trigger"}])}};function eL(e,t){const n=e.isReceivedShare()||e.isMounted(),r=t===""&&n;return e.canBeDeleted()&&!r}const Ya=()=>{const e=ze(),{cutResources:t}=qo(),n=Oe.useGettext(),{$gettext:r}=n,i=We(),{currentFolder:o}=Me.storeToRefs(i),s=M(()=>Vo()?r("⌘ + X"):r("Ctrl + X")),a=({resources:u})=>{t(u)};return{actions:M(()=>[{name:"cut",icon:"scissors",handler:a,shortcut:f(s),label:()=>r("Cut"),isVisible:({resources:u})=>!pt(e,"files-spaces-generic")&&!Rn(e,"files-public-link")&&!It(e,"files-common-favorites")||u.length===0||!f(o)||u.length===1&&u[0].locked?!1:!u.some(d=>eL(d,f(o).path)===!1),class:"oc-files-actions-move-trigger"}])}},A0=()=>{const e=ze(),{$gettext:t}=Oe.useGettext(),n=We(),{currentFolder:r}=Me.storeToRefs(n),i=M(()=>Rn(e,"files-public-link")?Mi("files-public-link"):dn(e,"files-trash-overview")?Hr("files-trash-generic"):Qn("files-spaces-generic"));return{actions:M(()=>[{name:"navigate",icon:"folder-open",label:()=>t("Navigate"),isVisible:({resources:s})=>s.length!==1||f(r)!==null&&So(s[0],f(r))||re.isTrashResource(s[0])?!1:s[0].isFolder||s[0].type==="space",route:({space:s,resources:a})=>ko({},f(i),ar(s,{path:a[0].path,fileId:a[0].fileId})),class:"oc-files-actions-navigate-trigger"}])}},x0=()=>{const{$gettext:e}=Oe.useGettext(),{getDefaultAction:t}=Jn();return{actions:M(()=>[{name:"open",icon:"eye",label:()=>e("Open"),handler:r=>{const i=t({...r,omitSystemActions:!0});!i||!Object.hasOwn(i,"handler")||i.handler(r)},route:r=>{const i=t({...r,omitSystemActions:!0});if(!(!i||!Object.hasOwn(i,"route")))return i.route(r)},isVisible:r=>{const i=t({...r,omitSystemActions:!0});return i?i.isVisible(r):!1},class:"oc-files-actions-default-editor-trigger"}])}},tL=()=>{const{showErrorMessage:e}=tt(),t=ze(),{$gettext:n}=Oe.useGettext(),r=Dr(),i=el(),o=He(),s=u=>{const c=/URL=(.+)/,d=u.match(c);if(d&&d[1])return d[1];throw new Error("unable to extract url")},a=async({resources:u,space:c})=>{try{const d=new URL(window.location.href),p=(await o.webdav.getFileContents(c,u[0])).body;let m=s(p);if(m=m.match(/^http[s]?:\/\//)?m:`https://${m}`,m=Xd.sanitize(m,{USE_PROFILES:{html:!0}}),m.startsWith(d.origin)){window.location.href=m;return}window.open(m)}catch(d){console.error(d),e({title:n("Failed to open shortcut"),errors:[d]})}};return{actions:M(()=>[{name:"open-shortcut",icon:"external-link",category:"context",handler:a,label:()=>n("Open shortcut"),isVisible:({resources:u})=>f(r)&&!f(i)&&!pt(t,"files-spaces-generic")&&!Rn(t,"files-public-link")&&!It(t,"files-common-favorites")&&!It(t,"files-common-search")&&!Bt(t,"files-shares-with-me")&&!Bt(t,"files-shares-with-others")&&!Bt(t,"files-shares-via-link")||u.length!==1||u[0].extension!=="url"?!1:u[0].canDownload(),class:"oc-files-actions-open-short-cut-trigger"}]),extractUrl:s}},nL=Fe({name:"AppLoadingSpinner"}),rL={class:"flex items-center justify-center size-full"};function iL(e,t,n,r,i,o){const s=Ee("oc-spinner");return Y(),pe("div",rL,[me(s,{id:"app-loading-spinner",size:"large","aria-hidden":!0,"aria-label":""})])}const Dd=Xe(nL,[["render",iL]]),oL=Fe({name:"FilePickerModal",components:{AppLoadingSpinner:Dd},props:{modal:{type:Object,required:!0},allowedFileTypes:{type:Array,required:!0},parentFolderLink:{type:Object,required:!0},callbackFn:{type:Function,required:!0}},setup(e){const t=ae(),n=ae(!0),r=ze(),{removeModal:i}=ft(),o=ur(),s=r.resolve(e.parentFolderLink),a=o.currentTheme.name,l=new URL(s.href,window.location.origin);l.searchParams.append("hide-logo","true"),l.searchParams.append("embed","true"),l.searchParams.append("embed-target","file"),l.searchParams.append("embed-delegate-authentication","false"),l.searchParams.append("embed-file-types",e.allowedFileTypes.join(","));const u=()=>{n.value=!1,f(t).contentWindow.focus()},c=({data:p})=>{if(p.name!=="opencloud-embed:file-pick")return;const{resource:m,locationQuery:b}=p.data;e.callbackFn({resource:m,locationQuery:b}),i(e.modal.id)},d=({data:p})=>{p.name==="opencloud-embed:cancel"&&i(e.modal.id)};return $t(()=>{window.addEventListener("message",c),window.addEventListener("message",d)}),xn(()=>{window.removeEventListener("message",c),window.removeEventListener("message",d)}),{isLoading:n,onLoad:u,iframeTitle:a,iframeSrc:l.href,iframeRef:t,onFilePick:c}}}),sL={class:"h-full",tabindex:"0"},aL=["title","src"];function lL(e,t,n,r,i,o){const s=Ee("app-loading-spinner");return Y(),pe("div",sL,[e.isLoading?(Y(),Te(s,{key:0})):ke("",!0),it(ue("iframe",{ref:"iframeRef",class:"size-full",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...a)=>e.onLoad&&e.onLoad(...a))},null,40,aL),[[dh,!e.isLoading]])])}const C0=Xe(oL,[["render",lL]]),R0=(e={},t)=>{const n=ze(),{getMatchingSpace:r}=ln(e);return{createFileAction:s=>{const a=f(e.space)||r(s);t.emit("fileClick",{space:a,resources:[s]})},createFolderLink:s=>{const{path:a,fileId:l,resource:u}=s,c=f(e.space)||r(u);return c?dn(n,"files-trash-overview")?Hr("files-trash-generic",ar(c)):Qn("files-spaces-generic",ar(c,{path:a,fileId:l})):{}}}},Yr=(e={})=>{const t=Zt(),{$gettext:n}=Oe.useGettext(),{getInternalSpace:r,getMatchingSpace:i,isResourceAccessible:o}=ln(),{createFolderLink:s}=R0(e);return{getPathPrefix:p=>{const m=f(e.space)||i(p);return re.isProjectSpaceResource(m)?jl.join(n("Spaces"),m.name):re.isShareSpaceResource(m)?jl.join(n("Shares"),m.name):m.name},getFolderLink:p=>s({path:p.path,fileId:p.fileId,resource:p}),getParentFolderLink:p=>{const m=f(e.space)||i(p),b=o({space:m,path:ct.dirname(p.path)});return p.remoteItemId&&p.path==="/"||!b?Dn("files-shares-with-me"):re.isProjectSpaceResource(p)?Qn("files-spaces-projects"):s({path:ct.dirname(p.path),...p.parentFolderId&&{fileId:p.parentFolderId},resource:p})},getParentFolderName:p=>{const m=f(e.space)||i(p),b=o({space:m,path:ct.dirname(p.path)});if(re.isShareRoot(p)||p.id===m.id&&re.isShareSpaceResource(m)||!b)return n("Shared with me");const S=re.extractParentFolderName(p);if(S)return S;if(re.isShareSpaceResource(m))return m.name;if(t.spacesProjects){if(re.isProjectSpaceResource(p))return n("Spaces");if(m?.driveType==="project")return m.name}return n("Personal")},getParentFolderLinkIconAdditionalAttributes:p=>re.isProjectSpaceResource(p)||re.isProjectSpaceResource(r(p.storageId)||{})&&p.path.split("/").length===2?{name:"layout-grid","fill-type":"fill"}:{}}},k0=({appId:e})=>{const{$gettext:t}=Oe.useGettext(),n=Dr(),{dispatchModal:r}=ft(),i=lr(),{apps:o}=Me.storeToRefs(i),s=ze(),{getParentFolderLink:a}=Yr(),{getMatchingSpace:l}=ln(),{getEditorRouteOpts:u}=Jn(),c=({resources:m})=>{const b=f(o)[e],w=a(m[0]),S=b.extensions.map(y=>y.extension?y.extension:y.mimeType);r({elementClass:"file-picker-modal",title:t("Open file in %{app}",{app:b.name}),customComponent:C0,hideActions:!0,customComponentAttrs:()=>({allowedFileTypes:S,parentFolderLink:w,callbackFn:p}),focusTrapInitial:!1})},d=M(()=>[{name:"open-with-app",icon:"folder-open",handler:c,label:()=>t("Open"),isVisible:()=>!f(n),class:"oc-files-actions-open-with-app-trigger"}]),p=({resource:m,locationQuery:b})=>{const w=l(m),S=re.isShareSpaceResource(w)?w.id:void 0,y=u(f(s.currentRoute).name,w,m,S);y.query={...y.query,...b};const g=s.resolve(y),v=new URL(g.href,window.location.origin);window.open(v.href,"_blank")};return{actions:d,onFilePicked:p}},P0=()=>{const e=ze(),t=He(),{getMatchingSpace:n}=ln(),{$gettext:r,$ngettext:i}=Oe.useGettext(),o=qo(),{startWorker:s}=ow(),a=We(),{currentFolder:l}=Me.storeToRefs(a),u=M(()=>Vo()?r("⌘ + V"):r("Ctrl + V")),c=M(()=>o.action===jo.Cut?Er.MOVE:Er.COPY),d=async({targetSpace:b,sourceSpace:w,resources:S})=>{const y=new Th(w,S,b,f(l),l,t,r,i),g=await y.getTransferData(f(c));if(!g.length)return;const v=f(l)?.id;s(g,async({successful:h,failed:E})=>{if(y.showResultMessage(E,h,f(c)),!h.length||f(l)&&v!==f(l).id)return;const T=[],R=[];for(const C of h)T.push((async()=>{const A=await t.webdav.getFileInfo(b,C);R.push(A)})());await Promise.allSettled(T),re.isShareSpaceResource(b)&&R.forEach(C=>{C.remoteItemId=b.id}),a.upsertResources(R)})},p=async({space:b})=>{const w=o.resources.reduce((y,g)=>{if(g.storageId in y)return y[g.storageId].resources.push(g),y;const v=n(g);return v.id in y||(y[v.id]={space:v,resources:[]}),y[v.id].resources.push(g),y},{}),S=Object.values(w).map(({space:y,resources:g})=>d({targetSpace:b,sourceSpace:y,resources:g}));await Promise.all(S),o.clearClipboard()};return{actions:M(()=>[{name:"paste",icon:"clipboard",handler:p,label:()=>r("Paste"),shortcut:f(u),isVisible:({resources:b})=>o.resources.length===0||!pt(e,"files-spaces-generic")&&!Rn(e,"files-public-link")&&!It(e,"files-common-favorites")||b.length===0?!1:Rn(e,"files-public-link")&&f(l)?f(l)?.canCreate():!0,class:"oc-files-actions-copy-trigger"}])}},Ja=()=>{const{showErrorMessage:e}=tt(),t=Zt(),n=ze(),{$gettext:r}=Oe.useGettext(),i=He(),o=ut(),{dispatchModal:s}=ft(),a=gt(),l=fn(),u=We(),{setCurrentFolder:c,upsertResource:d}=u,{isFileNameValid:p}=Ei(),m=async(S,y,g)=>{let v=u.currentFolder;try{const h=ct.join(ct.dirname(y.path),g);await i.webdav.moveFiles(S,y,S,{path:h});const E=So(y,v);if(re.isShareSpaceResource(S)&&y.isReceivedShare()){if(S.rename(g),E)return v={...v},v.name=g,c(v),n.push(ar(S,{path:"",fileId:y.fileId}));const R={...y};R.name=g,d(R);return}if(E)return v={...v},ql(S,v,h),c(v),n.push(ar(S,{path:h,fileId:y.fileId}));const T={...y};ql(S,T,h),d(T)}catch(h){console.error(h);let E=r('Failed to rename "%{file}" to »%{newName}«',{file:y.name,newName:g},!0);h.statusCode===423&&(E=r("Failed to rename »%{file}« to »%{newName}« - the file is locked",{file:y.name,newName:g},!0)),e({title:E,errors:[h]})}},b=async({space:S,resources:y})=>{const g=u.currentFolder;let v;if(So(y[0],g)){const O=ct.dirname(g.path);v=(await i.webdav.listFiles(S,{path:O})).children}const h=u.areFileExtensionsShown,E=async O=>{h||(O=`${O}.${y[0].extension}`),await m(S,y[0],O)},T=(O,N)=>{h||(O=`${O}.${y[0].extension}`);const{isValid:W,error:L}=p(y[0],O,v);N(W?null:L)},R=re.extractNameWithoutExtension(y[0]),C=!y[0].isFolder&&!h?R:y[0].name,A=y[0].isFolder?r("Rename folder »%{name}«",{name:C}):r("Rename file »%{name}«",{name:C}),D=!y[0].isFolder&&!h?R:y[0].name,V=y[0].isFolder||!h?null:[0,R.length];s({title:A,confirmText:r("Rename"),hasInput:!0,inputValue:D,inputSelectionRange:V,inputLabel:y[0].isFolder?r("Folder name"):r("File name"),inputRequiredMark:!0,onConfirm:E,onInput:T})};return{actions:M(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:b,isVisible:({resources:S})=>dn(n,"files-trash-generic")||Bt(n,"files-shares-with-me")&&!t.sharingCanRename||S.length!==1||(o.options.routing.fullShareOwnerPaths?S.some(v=>v.remoteItemPath&&v.path):S.some(v=>v.remoteItemId&&v.path==="/"))||S.length===1&&S[0].locked?!1:!S.some(v=>!v.canRename({user:a.user,ability:l})||v.processing),class:"oc-files-actions-rename-trigger"}]),renameResource:m}},us=({showSuccessMessage:e=!0,onRestoreComplete:t}={})=>{const{showMessage:n,showErrorMessage:r}=tt(),i=gt(),o=ze(),{$gettext:s,$ngettext:a}=Oe.useGettext(),l=He(),u=st(),c=We(),{startWorker:d}=sw(),p=async(y,g)=>{const v={},h=[],E=[],T=[];for(const R of g){const C=ct.dirname(R.path);let A=[];if(C in v)A=v[C];else{try{A=(await l.webdav.listFiles(y,{path:C})).children}catch{T.push(C)}v[C]=A}A.some(V=>V.name===R.name)||E.filter(V=>V.id!==R.id).some(V=>V.path===R.path)?h.push(R):E.push(R)}return{existingResourcesByPath:v,conflicts:h,resolvedResources:E,missingFolderPaths:T.filter(R=>!v[R]?.length)}},m=async y=>{let g=0;const v=[],h=y.length;let E=!1,T;for(const R of y){const C=R.type==="folder";if(E){v.push({resource:R,strategy:T});continue}const A=h-g,V=await new Ul(s,a).resolveFileExists({name:R.name,isFolder:C},A,!1);g++,V.doForAllConflicts&&(E=!0,T=V.strategy),v.push({resource:R,strategy:V.strategy})}return v},b=(y,g,v)=>{const h=f(o.currentRoute);d({space:y,resources:g,missingFolderPaths:v},async({successful:E,failed:T})=>{if(E.length){let R;E.length===1?R=s("%{resource} was restored successfully",{resource:E[0].name}):R=s("%{resourceCount} files restored successfully",{resourceCount:E.length.toString()}),e&&n({title:R}),h.name===f(o.currentRoute).name&&h.query?.fileId===f(o.currentRoute).query?.fileId&&(c.removeResources(E),c.resetSelection());const A=await l.graphAuthenticated.drives.getDrive(y.id);u.updateSpaceField({id:A.id,field:"spaceQuota",value:A.spaceQuota}),t?.({space:y,resources:E})}if(T.length){let R;const C={};T.length===1?(C.resource=T[0].resource.name,R=s('Failed to restore "%{resource}"',C,!0)):(C.resourceCount=T.length.toString(),R=s("Failed to restore %{resourceCount} files",C,!0)),r({title:R,errors:T.map(({error:A})=>A)})}})},w=async({space:y,resources:g})=>{const v=g.sort((V,O)=>V.path.length-O.path.length),{existingResourcesByPath:h,conflicts:E,resolvedResources:T,missingFolderPaths:R}=await p(y,v),C=await m(E),A=C.filter(V=>V.strategy===Kn.REPLACE).map(V=>V.resource);T.push(...A);const D=C.filter(V=>V.strategy===Kn.KEEP_BOTH).map(V=>V.resource);for(let V of D){V={...V};const O=ct.dirname(V.path),N=h[O]||[],W=re.extractExtensionFromFile(V),L=Hn(V.name,W,[...N,...C.map(ee=>ee.resource),...T]);V.name=L,V.path=re.urlJoin(O,L),T.push(V)}return b(y,T,R)};return{actions:M(()=>[{name:"restore",icon:"arrow-go-back",label:()=>s("Restore"),handler:w,isVisible:({space:y,resources:g})=>!dn(o,"files-trash-generic")||!g.every(v=>re.isTrashResource(v)&&v.canBeRestored())||re.isProjectSpaceResource(y)&&!y.canRestoreFromTrashbin({user:i.user})?!1:g.length>0,class:"oc-files-actions-restore-trigger"}]),restoreResources:b,collectConflicts:p}},cL=Fe({name:"SaveAsModal",components:{AppLoadingSpinner:Dd},props:{modal:{type:Object,required:!0},parentFolderLink:{type:Object,required:!0},originalResource:{type:Object,required:!0},content:{type:String,required:!0}},setup(e){const t=ae(),n=ae(!0),r=ur(),{$gettext:i}=Oe.useGettext(),o=ze(),s=He(),{removeModal:a}=ft(),{showMessage:l,showErrorMessage:u}=tt(),{getMatchingSpace:c}=ln(),{getEditorRouteOpts:d}=Jn(),p=o.resolve(e.parentFolderLink),m=r.currentTheme.name,b=new URL(p.href,window.location.origin);b.searchParams.append("hide-logo","true"),b.searchParams.append("embed","true"),b.searchParams.append("embed-target","location"),b.searchParams.append("embed-choose-file-name","true"),b.searchParams.append("embed-delegate-authentication","false"),b.searchParams.append("embed-choose-file-name-suggestion",e.originalResource.name);const w=()=>{n.value=!1,f(t).contentWindow.focus()},S=async({data:h})=>{if(h.name!=="opencloud-embed:select")return;const{resources:E,fileName:T,locationQuery:R}=h.data,C=E[0],A=c(C);try{const D=await y({destinationFolder:C,fileName:T,space:A});l({title:i("»%{fileName}« was saved successfully",{fileName:D.name})}),g({resource:D,space:A,locationQuery:R})}catch(D){console.error(D),u({title:i("Unable to save »%{fileName}«",{fileName:T}),errors:[D]}),console.error(D)}a(e.modal.id)},y=async({destinationFolder:h,fileName:E,space:T})=>{const{children:R}=await s.webdav.listFiles(T,{fileId:h.fileId},{davProperties:[qe.Name]});return R.find(A=>A.name===E)&&(E=Hn(E,e.originalResource.extension,R)),s.webdav.putFileContents(T,{fileName:E,parentFolderId:h.id,content:e.content,path:re.urlJoin(h.path,E)})},g=({locationQuery:h,resource:E,space:T})=>{const R=re.isShareSpaceResource(T)?T.id:void 0,C=d(f(o.currentRoute).name,T,E,R);C.query={...C.query,...h};const A=o.resolve(C),D=new URL(A.href,window.location.origin);window.open(D.href,"_blank")},v=({data:h})=>{h.name==="opencloud-embed:cancel"&&a(e.modal.id)};return $t(()=>{window.addEventListener("message",S),window.addEventListener("message",v)}),xn(()=>{window.removeEventListener("message",S),window.removeEventListener("message",v)}),{isLoading:n,onLoad:w,iframeTitle:m,iframeSrc:b.href,iframeRef:t,onLocationPick:S}}}),uL={class:"h-full",tabindex:"0"},fL=["title","src"];function dL(e,t,n,r,i,o){const s=Ee("app-loading-spinner");return Y(),pe("div",uL,[e.isLoading?(Y(),Te(s,{key:0})):ke("",!0),it(ue("iframe",{ref:"iframeRef",class:"size-full",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...a)=>e.onLoad&&e.onLoad(...a))},null,40,fL),[[dh,!e.isLoading]])])}const I0=Xe(cL,[["render",dL]]),O0=({content:e})=>{const{$gettext:t}=Oe.useGettext(),n=Dr(),{dispatchModal:r}=ft(),{getParentFolderLink:i}=Yr(),o=({resources:a})=>{const l=i(a[0]);r({elementClass:"save-as-modal",title:t("Save as"),customComponent:I0,hideActions:!0,customComponentAttrs:()=>({content:f(e),parentFolderLink:l,originalResource:a[0]}),focusTrapInitial:!1})};return{actions:M(()=>[{name:"save-as",icon:"save-2",handler:o,label:()=>t("Save as"),isVisible:({resources:a})=>!f(n)||a.length!==1,class:"oc-files-actions-save-as-trigger"}])}},pL={class:q.normalizeClass(["[&_.cropper-crop-box]:!outline-1","[&_.cropper-crop-box]:!outline-role-outline","[&_.cropper-line]:!bg-role-outline","[&_.cropper-point]:!bg-role-outline"])},hL={key:0,class:"max-h-[400px]"},mL=["src"],gL={class:"text-sm text-role-on-surface-variant flex items-center mt-1"},yL=["textContent"],F0=Fe({__name:"SpaceImageModal",props:{modal:{},space:{},file:{}},setup(e,{expose:t}){const{showMessage:n,showErrorMessage:r}=tt(),{$gettext:i}=Oe.useGettext(),o=He(),s=st(),{createDefaultMetaFolder:a}=Xi(),{getDefaultMetaFolder:l}=ka(),{setCropperInstance:u}=od(),c=ae(null),d=An("imageRef"),p=ae(null);t({onConfirm:async()=>{const S=f(c)?.getCroppedCanvas({imageSmoothingQuality:"high"}),y=await b(S);await w(y)}});const b=async S=>(await new Promise(g=>S.toBlob(g,"image/png"))).arrayBuffer(),w=async S=>{const y=o.graphAuthenticated;s.addToImagesLoading(e.space.id);let g=await l(e.space);g||(g=await a(e.space));const v={"Content-Type":"application/offset+octet-stream"};try{const{fileId:h,processing:E}=await o.webdav.putFileContents(e.space,{parentFolderId:g.id,fileName:"image.png",content:S,headers:v,overwrite:!0}),T=await y.drives.updateDrive(e.space.id,{name:e.space.name,special:[{specialFolder:{name:"image"},id:h}]});E||s.removeFromImagesLoading(e.space.id),s.updateSpaceField({id:e.space.id,field:"spaceImageData",value:T.spaceImageData}),n({title:i("Space image was set successfully")}),Je.publish("app.files.spaces.uploaded-image",T)}catch(h){if(console.error(h),s.removeFromImagesLoading(e.space.id),h instanceof re.HttpError&&h.statusCode===507){r({title:i("Failed to set space image"),desc:i("Not enough quota to set the space image"),errors:[h]});return}r({title:i("Failed to set space image"),errors:[h]})}};return $t(async()=>{try{p.value=URL.createObjectURL(e.file),f(c)&&f(c)?.destroy(),await Vt(),c.value=new ol(f(d),{aspectRatio:16/9,viewMode:1,dragMode:"move",autoCropArea:.8,responsive:!0,background:!1}),u(c)}catch(S){r({title:i("Failed to load space image"),errors:[S]})}}),(S,y)=>{const g=Ee("oc-icon");return Y(),pe("div",pL,[p.value?(Y(),pe("div",hL,[ue("img",{ref_key:"imageRef",ref:d,src:p.value},null,8,mL),ue("div",gL,[me(g,{class:"mr-1",name:"information",size:"small","fill-type":"line"}),ue("span",{textContent:q.toDisplayString(f(i)("Zoom via %{ zoomKeys }, pan via %{ panKeys }",{zoomKeys:f(i)("+-"),panKeys:f(i)("↑↓←→")}))},null,8,yL)])])):ke("",!0)])}}}),_0=()=>{const e=gt(),t=ze(),{$gettext:n}=Oe.useGettext(),r=He(),i=yn(),{dispatchModal:o}=ft(),s=async({space:l,resources:u})=>{const{getFileContents:c}=r.webdav,d=await c(l,u[0],{responseType:"blob"}),p=new File([d.body],u[0].name);o({title:n("Crop your Space image"),confirmText:n("Confirm"),customComponent:F0,customComponentAttrs:()=>({file:p,space:l})})};return{actions:M(()=>[{name:"set-space-image",icon:"image-edit",handler:l=>i.addTask(()=>s(l)),label:()=>n("Set as space image"),isVisible:({space:l,resources:u})=>u.length!==1||!u[0].hasPreview?.()||!u[0].mimeType?.includes("image/")||!pt(t,"files-spaces-generic")||!l||!re.isProjectSpaceResource(l)?!1:l.canEditImage({user:e.user}),class:"oc-files-actions-set-space-image-trigger"}])}},vL=()=>{const e=ze(),{$gettext:t}=Oe.useGettext(),n=Dr(),r=()=>{const o=dn(e,"files-trash-generic")?null:"actions";Je.publish(Ct.openWithPanel,o)};return{actions:M(()=>[{name:"show-actions",icon:"slideshow-3",label:()=>t("All Actions"),handler:r,isVisible:({resources:o})=>f(n)?o.length===1:!1,class:"oc-files-actions-show-actions-trigger"}])}},Nd=()=>{const e=ze(),t=We(),{$gettext:n}=Oe.useGettext();return{actions:M(()=>[{name:"show-details",icon:"information",class:"oc-files-actions-show-details-trigger",label:()=>n("Details"),isVisible:({resources:i})=>dn(e,"files-trash-generic")?!1:i.length>0,handler({resources:i}){t.setSelection(i.map(({id:o})=>o)),Je.publish(Ct.open)}}])}},D0=()=>{const e=Zt(),{isPersonalSpaceRoot:t}=ln();return{canListShares:({space:r,resource:i})=>!e.sharingApiEnabled||re.isPublicSpaceResource(r)||t(i)||re.isTrashResource(i)?!1:re.isIncomingShareResource(i)?i.sharePermissions.includes(re.GraphSharePermission.readPermissions):re.isShareSpaceResource(r)?r.graphPermissions?.includes(re.GraphSharePermission.readPermissions):!0}},N0=()=>{const e=Zt(),t=fn(),n=gt();return{canShare:({space:i,resource:o})=>!e.sharingApiEnabled||re.isShareSpaceResource(i)||re.isProjectSpaceResource(i)&&!i.canShare({user:n.user})?!1:o.canShare({ability:t,user:n.user})}},Ld=()=>{const e=ze(),{$gettext:t}=Oe.useGettext(),{canShare:n}=N0();We();const{interceptModifierClick:r}=gi(),i=({resources:s,event:a})=>{const l=s[0];a&&r(a,l)||Je.publish(Ct.openWithPanel,"sharing#peopleShares")};return{actions:M(()=>[{name:"show-shares",icon:"user-add",label:()=>t("Share"),handler:i,isVisible:({space:s,resources:a})=>dn(e,"files-trash-generic")||a.length!==1?!1:n({space:s,resource:a[0]}),class:"oc-files-actions-show-shares-trigger"}])}},Za=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=ze(),{$gettext:r}=Oe.useGettext(),i=He(),o=yn(),s=ut(),{updateResourceField:a,resetSelection:l}=We(),u=async({resources:d})=>{const p=[],m=[],b=new Lr({concurrency:s.options.concurrentRequests.resourceBatchActions}),w=!d[0].hidden;if(d.forEach(S=>{m.push(b.add(async()=>{try{await i.graphAuthenticated.driveItems.updateDriveItem(S.driveId,S.id,{"@UI.Hidden":w}),a({id:S.id,field:"hidden",value:w})}catch(y){console.error(y),p.push(y)}}))}),await Promise.all(m),p.length===0){l(),e({title:r(w?"The share was hidden successfully":"The share was unhidden successfully")});return}t({title:r(w?"Failed to hide the share":"Failed to unhide the share"),errors:p})};return{actions:M(()=>[{name:"toggle-hide-share",icon:"eye-off",handler:d=>o.addTask(()=>u(d)),label:({resources:d})=>d[0].hidden?r("Unhide"):r("Hide"),isVisible:({resources:d})=>d.length===0?!1:Bt(n,"files-shares-with-me"),class:"oc-files-actions-hide-share-trigger"}])}},L0=()=>{const{$gettext:e}=Oe.useGettext(),{showErrorMessage:t}=tt(),{webdav:n}=He(),r=Zt(),i=We(),{currentFolder:o}=Me.storeToRefs(i),{actions:s}=us({showSuccessMessage:!1,onRestoreComplete:async({space:d,resources:p})=>{if(Ch({resourcesStore:i,parentFolderId:p[0].parentFolderId})){const{children:m}=await n.listFiles(d,{path:f(o).path});i.upsertResources(m.filter(({id:b})=>p.some(w=>w.id===a(b))))}}}),a=d=>d.includes("!")?d.split("!")[1]:d,l=async({space:d,resources:p,callback:m})=>{const b=p.map(w=>({...w,id:a(w.id)}));try{await f(s)[0].handler({space:d,resources:b}),m()}catch(w){console.error(w),t({title:e("Failed to restore files"),errors:[w]})}},u=M(()=>Vo()?e("⌘ + Z"):e("Ctrl + Z"));return{actions:M(()=>[{name:"undoDelete",icon:"arrow-go-back",shortcut:f(u),isVisible:({space:d})=>r.davTrashbin?re.isProjectSpaceResource(d)||re.isPersonalSpaceResource(d):!1,label:()=>e("Undo"),handler:l}])}},$0=()=>{const e=ut(),{showMessage:t,showErrorMessage:n,removeMessage:r}=tt(),i=ze(),o=Oe.useGettext(),{getMatchingSpace:s}=ln(),{$gettext:a,$ngettext:l}=o,u=He(),{dispatchModal:c}=ft(),d=st(),p=fr(),{bindKeyAction:m,removeKeyAction:b}=Fa(),{startWorker:w}=iw({concurrentRequests:e.options.concurrentRequests.resourceBatchActions}),{actions:S}=L0(),y=We(),{currentFolder:g}=Me.storeToRefs(y),v=ae([]),h=en("page","1"),E=M(()=>parseInt(Rt(f(h)))),T=en("items-per-page","1"),R=M(()=>parseInt(Rt(f(T)))),C=M(()=>vh(f(v))),A=({space:L,filesToDelete:ee,deletedFiles:J})=>{const se=J.length===1&&ee.length===1?a('"%{item}" was moved to trash bin',{item:J[0].name}):l("%{itemCount} item was moved to trash bin","%{itemCount} items were moved to trash bin",J.length,{itemCount:J.length.toString()},!0),he=7,oe=f(S)[0],we=oe.isVisible({space:L,resources:J});let X;const ie=t({title:se,timeout:he,actions:[oe],actionOptions:{space:L,resources:J,callback:()=>{r(ie),X&&b(X)}}});we&&(X=m({primary:dr.Z,modifier:Oa.Ctrl},()=>(b(X),oe.handler({space:L,resources:J,callback:()=>{r(ie)}}))),setTimeout(()=>b(X),he*1e3))},D=M(()=>{const L=f(C),ee=L[0].type==="folder";let J=null;return L.length===1?(ee?J=a("Permanently delete folder »%{name}«",{name:L[0].name},!0):J=a("Permanently delete file »%{name}«",{name:L[0].name},!0),J):l("Permanently delete selected resource?","Permanently delete %{amount} selected resources?",L.length,{amount:L.length.toString()},!1)}),V=M(()=>{const L=f(C),ee=L[0].type==="folder";return L.length===1?a(ee?"Are you sure you want to delete this folder? All its content will be permanently removed. This action cannot be undone.":"Are you sure you want to delete this file? All its content will be permanently removed. This action cannot be undone."):a("Are you sure you want to delete all selected resources? All their content will be permanently removed. This action cannot be undone.")}),O=L=>{const ee=f(i.currentRoute);w({topic:"trashBinDelete",space:L,resources:f(C)},({successful:J,failed:se})=>{if(J.length){const he=J.length===1&&f(C).length===1?a('"%{item}" was deleted successfully',{item:J[0].name}):l("%{itemCount} item was deleted successfully","%{itemCount} items were deleted successfully",J.length,{itemCount:J.length.toString()},!0);t({title:he})}se.forEach(({resource:he})=>{const oe=a('Failed to delete "%{item}"',{item:he.name});n({title:oe,errors:[new Error]})}),ee.name===f(i.currentRoute).name&&ee.query?.fileId===f(i.currentRoute).query?.fileId&&(y.removeResources(J),y.resetSelection())})};return{displayDialog:(L,ee)=>{v.value=[...ee],c({title:f(D),message:f(V),confirmText:a("Delete"),onConfirm:()=>O(L)})},filesList_delete:L=>{v.value=[...L],y.addResourcesIntoDeleteQueue(f(v).map(({id:se})=>se)),f(v).forEach(({id:se})=>y.removeSelection(se));const ee=f(L).reduce((se,he)=>{if(he.storageId in se)return se[he.storageId].resources.push(he),se;const oe=s(he);return oe.id in se||(se[oe.id]={space:oe,resources:[]}),se[oe.id].resources.push(he),se},{}),J=f(g)?.id;return Object.values(ee).map(({space:se,resources:he})=>{w({topic:"fileListDelete",space:se,resources:he},async({successful:oe,failed:we})=>{if(oe.length&&(A({space:se,filesToDelete:he,deletedFiles:oe}),p.publish("runtime.resource.deleted",oe)),y.removeResourcesFromDeleteQueue(we.map(({resource:X})=>X.id)),y.removeResourcesFromDeleteQueue(oe.map(({id:X})=>X)),we.forEach(({error:X,resource:ie})=>{let le=a('Failed to delete "%{resource}"',{resource:ie.name});X.statusCode===423&&(le=a('Failed to delete "%{resource}" - the file is locked',{resource:ie.name})),n({title:le,errors:[X]})}),J===f(g)?.id){y.removeResources(oe);const X=y.activeResources.length,ie=Math.ceil(f(X)/f(R));f(E)>1&&f(E)>ie&&(h.value=ie.toString())}if(pt(i,"files-spaces-generic")&&!["public","share"].includes(se?.driveType)){const ie=await u.graphAuthenticated.drives.getDrive(f(L)[0].storageId);d.updateSpaceField({id:ie.id,field:"spaceQuota",value:ie.spaceQuota})}if(f(v).length&&So(f(v)[0],f(g)))return i.push(ar(se,{path:ct.dirname(f(v)[0].path),fileId:f(v)[0].parentFolderId}))})})}}},M0=()=>{const e=zt();return M(()=>f(e)?.query?.contextRouteName)},bL=e=>e==="files",Dr=()=>{const e=zt();return M(()=>bL(cc(f(e))))},Ei=()=>{const{$gettext:e}=Oe.useGettext(),t=We();return{isSpaceNameValid:i=>i.trim()===""?{isValid:!1,error:e("The Space name cannot be empty")}:Yf(i)>Id?{isValid:!1,error:e("The Space name is too long")}:i.trim()!==i?{isValid:!1,error:e("The Space name cannot start or end with whitespace")}:/[/\\.:?*"><|]/.test(i)?{isValid:!1,error:e(`The Space name cannot contain the following characters: / \\\\ . : ? * " > < |'`)}:{isValid:!0,error:void 0},isFileNameValid:(i,o,s=void 0)=>{if(!o)return{isValid:!1,error:e("The name cannot be empty")};if(/[/]/.test(o))return{isValid:!1,error:e('The name cannot contain "/"')};if(o===".")return{isValid:!1,error:e('The name cannot be equal to "."')};if(o==="..")return{isValid:!1,error:e('The name cannot be equal to ".."')};if(o.trim()!==o)return{isValid:!1,error:e("The name cannot start or end with whitespace")};if(Yf(o)>Id)return{isValid:!1,error:e("The name is too long")};const a=i.path.substring(0,i.path.length-i.name.length)+o;if((s||t.resources).some(u=>u.path===a&&u.name===o)){const u=e("The name »%{name}« is already taken");return{isValid:!1,error:e(u,{name:o},!0)}}return{isValid:!0,error:void 0}}}},el=()=>M(()=>!!document.getElementById("files-global-search-options")),B0=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=gt(),{$gettext:r,$ngettext:i}=Oe.useGettext(),o=fn(),s=He(),a=zt(),{dispatchModal:l}=ft(),u=st(),{removeResources:c}=We(),d=w=>w.filter(S=>re.isProjectSpaceResource(S)&&S.canBeDeleted({user:n.user,ability:o})),p=async w=>{const S=s.graphAuthenticated,y=w.map(E=>S.drives.deleteDrive(E.id).then(()=>(c([E]),u.removeSpace(E),!0))),g=await Promise.allSettled(y),v=g.filter(di);if(v.length){const E=v.length===1&&w.length===1?r("Space »%{space}« was deleted successfully",{space:w[0].name}):i("%{spaceCount} space was deleted successfully","%{spaceCount} spaces were deleted successfully",v.length,{spaceCount:v.length.toString()},!0);e({title:E})}const h=g.filter(pi);if(h.length){h.forEach(console.error);const E=h.length===1&&w.length===1?r("Failed to delete space »%{space}«",{space:w[0].name}):i("Failed to delete %{spaceCount} space","Failed to delete %{spaceCount} spaces",h.length,{spaceCount:h.length.toString()},!0);t({title:E,errors:h.map(T=>T.reason)})}f(a).name==="admin-settings-spaces"&&Je.publish("app.admin-settings.list.load")},m=({resources:w})=>{const S=d(w);if(!S.length)return;const y=i("Are you sure you want to delete the selected space?","Are you sure you want to delete %{count} selected spaces?",S.length,{count:S.length.toString()});l({title:i("Delete Space »%{space}«?","Delete %{spaceCount} Spaces?",S.length,{space:S[0].name,spaceCount:S.length.toString()}),confirmText:r("Delete"),message:y,hasInput:!1,onConfirm:()=>p(S)})};return{actions:M(()=>[{name:"delete",icon:"delete-bin",label:()=>r("Delete"),handler:m,isVisible:({resources:w})=>!!d(w).length,class:"oc-files-actions-delete-trigger"}]),deleteSpaces:p}},j0=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=gt(),{$gettext:r,$ngettext:i}=Oe.useGettext(),o=fn(),s=He(),a=zt(),l=ze(),{dispatchModal:u}=ft(),c=st(),d=w=>w.filter(S=>re.isProjectSpaceResource(S)&&S.canDisable({user:n.user,ability:o})),p=async w=>{const S=f(a),y=s.graphAuthenticated,g=w.map(T=>y.drives.disableDrive(T.id).then(()=>(S.name==="files-spaces-generic"&&l.push({name:"files-spaces-projects"}),S.name==="admin-settings-spaces"&&(T.disabled=!0,T.spaceQuota={total:T.spaceQuota.total}),c.updateSpaceField({id:T.id,field:"disabled",value:!0}),!0))),v=await Promise.allSettled(g),h=v.filter(di);if(h.length){const T=h.length===1&&w.length===1?r("Space »%{space}« was disabled successfully",{space:w[0].name}):i("%{spaceCount} space was disabled successfully","%{spaceCount} spaces were disabled successfully",h.length,{spaceCount:h.length.toString()},!0);e({title:T})}const E=v.filter(pi);if(E.length){E.forEach(console.error);const T=E.length===1&&w.length===1?r("Failed to disable space »%{space}«",{space:w[0].name}):i("Failed to disable %{spaceCount} space","Failed to disable %{spaceCount} spaces",E.length,{spaceCount:E.length.toString()},!0);t({title:T,errors:E.map(R=>R.reason)})}},m=({resources:w})=>{const S=d(w);if(!S.length)return;const y=i("If you disable the selected space, it can no longer be accessed. Only Space managers will still have access. Note: No files will be deleted from the server.","If you disable the %{count} selected spaces, they can no longer be accessed. Only Space managers will still have access. Note: No files will be deleted from the server.",S.length,{count:S.length.toString()}),g=r("Disable");u({title:i("Disable Space »%{space}«?","Disable %{spaceCount} Spaces?",S.length,{space:S[0].name,spaceCount:S.length.toString()}),confirmText:g,message:y,hasInput:!1,onConfirm:()=>p(S)})};return{actions:M(()=>[{name:"disable",icon:"stop-circle",label:()=>r("Disable"),handler:m,isVisible:({resources:w})=>!!d(w).length,class:"oc-files-actions-disable-trigger"}]),disableSpaces:p}},U0=()=>{const e=ut(),t=st(),n=kr(),{showMessage:r,showErrorMessage:i}=tt(),o=ze(),{$gettext:s}=Oe.useGettext(),a=fn(),l=He(),u=yn(),{upsertResource:c}=We(),d=pt(o,"files-spaces-projects"),p=async w=>{const S=t.spaces.filter(re.isProjectSpaceResource),y=Hn(w.name,"",S);try{let g=await l.graphAuthenticated.drives.createDrive({name:y,description:w.description,quota:{total:w.spaceQuota.total}});const v=await l.webdav.listFiles(w);if(v.children.length){const h=new Lr({concurrency:e.options.concurrentRequests.resourceBatchActions}),E=[];for(const T of v.children)E.push(h.add(()=>l.webdav.copyFiles(w,T,g,{path:T.name})));await Promise.all(E)}if(w.spaceReadmeData||w.spaceImageData){const h={special:[]};if(w.spaceReadmeData){const E=await l.webdav.getFileInfo(g,{path:`.space/${w.spaceReadmeData.name}`});h.special.push({specialFolder:{name:"readme"},id:E.id})}if(w.spaceImageData){const E=await l.webdav.getFileInfo(g,{path:`.space/${w.spaceImageData.name}`});h.special.push({specialFolder:{name:"image"},id:E.id})}g=await l.graphAuthenticated.drives.updateDrive(g.id,h,n.graphRoles)}t.upsertSpace(g),d&&c(g),r({title:s("Space »%{space}« was duplicated successfully",{space:w.name})})}catch(g){console.error(g),i({title:s("Failed to duplicate space »%{space}«",{space:w.name}),errors:[g]})}},m=async({resources:w})=>{for(const S of w)S.disabled||!re.isProjectSpaceResource(S)||await p(S)};return{actions:M(()=>[{name:"duplicate",icon:"folders",label:()=>s("Duplicate"),handler:w=>u.addTask(()=>m(w)),isVisible:({resources:w})=>!w?.length||w.every(S=>S.disabled)||w.every(S=>!re.isProjectSpaceResource(S))?!1:a.can("create-all","Drive"),class:"oc-files-actions-duplicate-trigger"}]),duplicateSpace:p}},wL=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=gt(),{$gettext:r}=Oe.useGettext(),i=fn(),o=He(),s=zt(),{dispatchModal:a}=ft(),l=st(),u=(p,m)=>o.graphAuthenticated.drives.updateDrive(p.id,{name:p.name,description:m}).then(()=>{l.updateSpaceField({id:p.id,field:"description",value:m}),f(s).name==="admin-settings-spaces"&&(p.description=m),e({title:r("Space subtitle was changed successfully")})}).catch(w=>{console.error(w),t({title:r("Failed to change space subtitle"),errors:[w]})}),c=({resources:p})=>{p.length===1&&a({title:r("Change subtitle for space")+" "+p[0].name,confirmText:r("Confirm"),hasInput:!0,inputLabel:r("Space subtitle"),inputValue:p[0].description,onConfirm:m=>u(p[0],m)})};return{actions:M(()=>[{name:"editDescription",icon:"h-2",iconFillType:"none",label:()=>r("Edit subtitle"),handler:c,isVisible:({resources:p})=>p.length!==1?!1:p[0].canEditDescription({user:n.user,ability:i}),class:"oc-files-actions-edit-description-trigger"}]),editDescriptionSpace:u}},SL={name:"QuotaSelect",props:{totalQuota:{type:Number,default:0},maxQuota:{type:Number,default:0}},emits:["selectedOptionChange"],setup(){const e=ae(void 0),t=ae([]);return{selectedOption:e,options:t}},computed:{quotaLimit(){return this.maxQuota||1e15},DEFAULT_OPTIONS(){return[{value:Math.pow(10,9),displayValue:this.getFormattedFileSize(Math.pow(10,9))},{value:2*Math.pow(10,9),displayValue:this.getFormattedFileSize(2*Math.pow(10,9))},{value:5*Math.pow(10,9),displayValue:this.getFormattedFileSize(5*Math.pow(10,9))},{value:10*Math.pow(10,9),displayValue:this.getFormattedFileSize(10*Math.pow(10,9))},{value:50*Math.pow(10,9),displayValue:this.getFormattedFileSize(50*Math.pow(10,9))},{value:100*Math.pow(10,9),displayValue:this.getFormattedFileSize(100*Math.pow(10,9))},{displayValue:this.$gettext("No restriction"),value:0}]}},watch:{totalQuota(){const e=this.options.find(t=>t.value===this.totalQuota);e&&(this.selectedOption=e)}},mounted(){this.setOptions(),this.selectedOption=this.options.find(e=>e.value===this.totalQuota)},methods:{onUpdate(e){this.selectedOption=e,this.$emit("selectedOptionChange",this.selectedOption)},optionSelectable(e){return e.selectable!==!1},isValueValidNumber(e){return At.isNumber(e)?e>0:/^[0-9]\d*(([.,])\d+)?$/g.test(e)},createOption(e){if(e=e.replace(",","."),!this.isValueValidNumber(e))return{displayValue:e,value:e,error:this.$gettext("Please enter only numbers"),selectable:!1};const t=parseFloat(e)*Math.pow(10,9);return t>this.quotaLimit?{value:t,displayValue:this.getFormattedFileSize(t),error:this.$gettext("Please enter a value equal to or less than %{ quotaLimit }",{quotaLimit:this.getFormattedFileSize(this.quotaLimit).toString()}),selectable:!1}:{value:t,displayValue:this.getFormattedFileSize(t)}},setOptions(){let e=[...this.DEFAULT_OPTIONS];this.maxQuota&&(e=e.filter(n=>this.totalQuota===0&&n.value===0?(n.selectable=!1,!0):n.value!==0&&n.value<=this.maxQuota)),e.find(n=>n.value===this.totalQuota)||e.push({displayValue:this.getFormattedFileSize(this.totalQuota),value:this.totalQuota,selectable:this.totalQuota<=this.quotaLimit}),e=[...e.filter(n=>n.value).sort((n,r)=>n.value-r.value),...e.filter(n=>!n.value)],this.options=e},getFormattedFileSize(e){const t=bn(e,this.$language.current);return this.isValueValidNumber(e)?t:e.toString()}}},EL={class:"quota-select-batch-action-form"},TL=["textContent"],AL={class:"flex justify-between"},xL=["textContent"],CL={key:0,class:"oc-text-input-danger"};function RL(e,t,n,r,i,o){const s=Ee("oc-icon"),a=Ee("oc-select");return Y(),pe("div",EL,[me(a,Mt({ref:"select","model-value":r.selectedOption,selectable:o.optionSelectable,taggable:"","push-tags":"",clearable:!1,options:r.options,"create-option":o.createOption,"option-label":"displayValue",label:e.$gettext("Quota")},e.$attrs,{"onUpdate:modelValue":o.onUpdate}),{"selected-option":ve(({displayValue:l})=>[e.$attrs["read-only"]?(Y(),Te(s,{key:0,name:"lock",class:"mr-1",size:"small"})):ke("",!0),ue("span",{textContent:q.toDisplayString(l)},null,8,TL)]),search:ve(({attributes:l,events:u})=>[ue("input",Mt({class:"vs__search"},l,Fs(u,!0)),null,16)]),option:ve(({displayValue:l,error:u})=>[ue("div",AL,[ue("span",{textContent:q.toDisplayString(l)},null,8,xL)]),u?(Y(),pe("div",CL,q.toDisplayString(u),1)):ke("",!0)]),_:1},16,["model-value","selectable","options","create-option","label","onUpdate:modelValue"])])}const V0=Xe(SL,[["render",RL]]),kL={key:0,class:"mt-2"},PL=["textContent"],q0=Fe({__name:"QuotaModal",props:{modal:{},spaces:{},warningMessage:{default:""},warningMessageContextualHelperData:{default:()=>{}},resourceType:{default:"space"}},emits:["update:confirmDisabled"],setup(e,{expose:t,emit:n}){const r=n,{showMessage:i,showErrorMessage:o}=tt(),{$gettext:s,$ngettext:a}=Oe.useGettext(),l=He(),u=ze(),c=st(),d=Zt(),{spacesMaxQuota:p}=Me.storeToRefs(d),{updateResourceField:m}=We(),b=ae(e.spaces[0]?.spaceQuota?.total||0),w=h=>e.resourceType==="space"?a("Space quota was changed successfully","Quota of %{count} spaces was changed successfully",h,{count:h.toString()}):e.resourceType==="user"?a("User quota was changed successfully","Quota of %{count} users was changed successfully",h,{count:h.toString()}):s("Quota was changed successfully"),S=h=>e.resourceType==="space"?a("Failed to change space quota","Failed to change quota for %{count} spaces",h,{count:h.toString()}):e.resourceType==="user"?a("Failed to change user quota","Failed to change quota for %{count} users",h,{count:h.toString()}):s("Failed to change quota"),y=M(()=>!e.spaces.some(h=>h.spaceQuota.total!==f(b)));ot(y,()=>{r("update:confirmDisabled",f(y))},{immediate:!0});const g=h=>{b.value=h.value};return t({onConfirm:async()=>{const h=l.graphAuthenticated,E=e.spaces.map(async A=>{const D=await h.drives.updateDrive(A.id,{name:A.name,quota:{total:f(b)}});f(u.currentRoute).name==="admin-settings-spaces"&&Je.publish("app.admin-settings.spaces.space.quota.updated",{spaceId:A.id,quota:D.spaceQuota}),f(u.currentRoute).name==="admin-settings-users"&&Je.publish("app.admin-settings.users.user.quota.updated",{spaceId:A.id,quota:D.spaceQuota}),c.updateSpaceField({id:A.id,field:"spaceQuota",value:D.spaceQuota}),m({id:A.id,field:"spaceQuota",value:D.spaceQuota})}),T=await Promise.allSettled(E),R=T.filter(di);R.length&&i({title:w(R.length)});const C=T.filter(pi);C.length&&(console.error(C),C.forEach(console.error),o({title:S(C.length),errors:C.map(A=>A.reason)}))}}),(h,E)=>{const T=Ee("oc-contextual-helper");return Y(),pe(je,null,[me(V0,{"total-quota":b.value,"max-quota":f(p),"position-fixed":!0,onSelectedOptionChange:g},null,8,["total-quota","max-quota"]),e.warningMessage?(Y(),pe("div",kL,[ue("span",{class:"oc-text-input-warning",textContent:q.toDisplayString(e.warningMessage)},null,8,PL),e.warningMessageContextualHelperData?(Y(),Te(T,Mt({key:0,class:"pl-1"},e.warningMessageContextualHelperData),null,16)):ke("",!0)])):ke("",!0)],64)}}}),z0=()=>{const{dispatchModal:e}=ft(),{$gettext:t}=Oe.useGettext(),n=fn(),r=({resources:s})=>s.length===1?t("Change quota for Space »%{name}«",{name:s[0].name}):t("Change quota for %{count} Spaces",{count:s.length.toString()}),i=({resources:s})=>{e({title:r({resources:s}),customComponent:q0,customComponentAttrs:()=>({spaces:s,resourceType:"space"})})};return{actions:M(()=>[{name:"editQuota",icon:"cloud",label:()=>t("Edit quota"),handler:i,isVisible:({resources:s})=>!s||!s.length||s.some(a=>!re.isProjectSpaceResource(a)||re.isSpaceResource(a)&&!a.spaceQuota)?!1:n.can("set-quota-all","Drive"),class:"oc-files-actions-edit-quota-trigger"}])}};function W0(){const{triggerDefaultAction:e}=Jn();return{openWithDefaultApp:({space:n,resource:r})=>{if(!r||r.isFolder)return;e({...{resources:[r],space:n},omitSystemActions:!0})}}}const IL=()=>{const e=He(),{openWithDefaultApp:t}=W0(),{createDefaultMetaFolder:n}=Xi(),r=gt(),i=st(),{$gettext:o}=Oe.useGettext(),{getDefaultMetaFolder:s}=ka(),a=async(c,d)=>{const p=await e.webdav.putFileContents(c,{path:".space/readme.md",parentFolderId:d.id,fileName:"readme.md"}),m=await e.graphAuthenticated.drives.updateDrive(c.id,{name:c.name,special:[{specialFolder:{name:"readme"},id:p.id}]});return i.updateSpaceField({id:c.id,field:"spaceReadmeData",value:m.spaceReadmeData}),p},l=async({resources:c})=>{let d=null,p=await s(c[0]);if(p||(p=await n(c[0]),d=await a(c[0],p)),!d){const m=re.getRelativeSpecialFolderSpacePath(c[0],"readme");m?d=await e.webdav.getFileInfo(c[0],{path:m}):d=await a(c[0],p)}t({space:c[0],resource:d})};return{actions:M(()=>[{name:"editReadmeContent",icon:"article",label:()=>o("Edit description"),handler:l,isVisible:({resources:c})=>c.length!==1?!1:c[0].canEditReadme({user:r.user}),class:"oc-files-actions-edit-readme-content-trigger"}])}},H0=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=gt(),{$gettext:r}=Oe.useGettext(),i=fn(),o=He(),s=zt(),{isSpaceNameValid:a}=Ei(),{dispatchModal:l}=ft(),u=st(),c=(m,b)=>o.graphAuthenticated.drives.updateDrive(m.id,{name:b}).then(()=>{f(s).name==="admin-settings-spaces"&&(m.name=b),u.updateSpaceField({id:m.id,field:"name",value:b}),e({title:r("Space name was changed successfully")})}).catch(S=>{console.error(S),t({title:r("Failed to rename space"),errors:[S]})}),d=({resources:m})=>{m.length===1&&l({title:r("Rename space »%{name}«",{name:m[0].name}),confirmText:r("Rename"),hasInput:!0,inputLabel:r("Space name"),inputValue:m[0].name,inputRequiredMark:!0,onConfirm:b=>c(m[0],b),onInput:(b,w)=>{const{isValid:S,error:y}=a(b);w(S?null:y)}})};return{actions:M(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:d,isVisible:({resources:m})=>m.length!==1?!1:m[0].canRename({user:n.user,ability:i}),class:"oc-files-actions-rename-trigger"}]),renameSpace:c}},K0=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=gt(),{$gettext:r,$ngettext:i}=Oe.useGettext(),o=fn(),s=He(),a=yn(),l=zt(),{dispatchModal:u}=ft(),c=st(),d=w=>w.filter(S=>re.isProjectSpaceResource(S)&&S.canRestore({user:n.user,ability:o})),p=async w=>{const S=s.graphAuthenticated,y=w.map(E=>S.drives.updateDrive(E.id,{name:E.name},{headers:{Restore:"true"}}).then(T=>(f(l).name==="admin-settings-spaces"&&(E.disabled=!1,E.spaceQuota=T.spaceQuota),c.updateSpaceField({id:E.id,field:"disabled",value:!1}),!0))),g=await a.addTask(()=>Promise.allSettled(y));await c.loadGraphPermissions({ids:w.map(E=>E.id),graphClient:S});const v=g.filter(di);if(v.length){const E=v.length===1&&w.length===1?r("Space »%{space}« was enabled successfully",{space:w[0].name}):i("%{spaceCount} space was enabled successfully","%{spaceCount} spaces were enabled successfully",v.length,{spaceCount:v.length.toString()},!0);e({title:E})}const h=g.filter(pi);if(h.length){h.forEach(console.error);const E=h.length===1&&w.length===1?r("Failed to enable space »%{space}«",{space:w[0].name}):i("Failed to enable %{spaceCount} space","Failed to enable %{spaceCount} spaces",h.length,{spaceCount:h.length.toString()},!0);t({title:E,errors:h.map(T=>T.reason)})}},m=({resources:w})=>{const S=d(w);if(!S.length)return;const y=i("If you enable the selected space, it can be accessed again.","If you enable the %{count} selected spaces, they can be accessed again.",S.length,{count:S.length.toString()}),g=r("Enable");u({title:i("Enable Space »%{space}«?","Enable %{spaceCount} Spaces?",S.length,{space:S[0].name,spaceCount:S.length.toString()}),confirmText:g,message:y,hasInput:!1,onConfirm:()=>p(S)})};return{actions:M(()=>[{name:"restore",icon:"play-circle",label:()=>r("Enable"),handler:m,isVisible:({resources:w})=>!!d(w).length,class:"oc-files-actions-restore-trigger"}]),restoreSpaces:p}},OL=()=>{const{$gettext:e}=Oe.useGettext(),t=We(),n=({resources:i})=>{t.setSelection(i.map(({id:o})=>o)),Je.publish(Ct.openWithPanel,"space-share")};return{actions:M(()=>[{name:"show-members",icon:"group",label:()=>e("Members"),handler:n,isVisible:({resources:i})=>i.length===1&&!i[0].disabled,class:"oc-files-actions-show-details-trigger"}])}},FL=()=>{const e=ze(),{$gettext:t}=Oe.useGettext(),n=i=>Hr("files-trash-generic",{...ar(i,{fileId:i.fileId})});return{actions:M(()=>[{name:"navigateToTrash",icon:"delete-bin-5",label:()=>t("Open trash bin"),handler:({resources:i})=>{e.push(n(i[0]))},isVisible:({resources:i})=>!(i.length!==1||!re.isProjectSpaceResource(i[0])&&!re.isPersonalSpaceResource(i[0])||i[0].disabled),class:"oc-files-actions-navigate-to-trash-trigger"}])}},_L=Fe({name:"EmojiPickerModal",components:{},props:{modal:{type:Object,required:!0}},emits:["confirm"],setup(e,{emit:t}){const n=ur(),{currentTheme:r}=Me.storeToRefs(n),i=M(()=>f(r).isDark?"dark":"light");return{onEmojiSelect:s=>{t("confirm",s)},theme:i}}});function DL(e,t,n,r,i,o){const s=Ee("oc-emoji-picker");return Y(),Te(s,{theme:e.theme,onEmojiSelect:e.onEmojiSelect},null,8,["theme","onEmojiSelect"])}const G0=Xe(_L,[["render",DL]]),NL=()=>{const e=gt(),{showMessage:t,showErrorMessage:n}=tt(),{$gettext:r}=Oe.useGettext(),i=He(),o=yn(),s=st(),{createDefaultMetaFolder:a}=Xi(),{dispatchModal:l}=ft(),{getDefaultMetaFolder:u}=ka(),c=({resources:b})=>{b.length===1&&l({elementClass:"w-auto",title:r("Set icon for »%{space}«",{space:b[0].name}),hideConfirmButton:!0,customComponent:G0,focusTrapInitial:!1,onConfirm:w=>p(b[0],w)})},d=async b=>{const w=document.createElement("canvas"),S=w.getContext("2d"),y=16/9,g=720,v=g/y;w.width=g,w.height=v;const h=.4*g;S.font=`${h}px sans-serif`,S.textBaseline="middle",S.textAlign="center",S.fillText(b,w.width/2,w.height/2+15);const T=await fb(w);return ub(T)},p=async(b,w)=>{const S=i.graphAuthenticated,y=await d(w);let g=await u(b);return g||(g=await a(b)),o.addTask(async()=>{const v={"Content-Type":"application/offset+octet-stream"};try{const{fileId:h}=await i.webdav.putFileContents(b,{parentFolderId:g.id,fileName:"image.png",content:y,headers:v,overwrite:!0}),E=await S.drives.updateDrive(b.id,{name:b.name,special:[{specialFolder:{name:"image"},id:h}]});s.updateSpaceField({id:b.id,field:"spaceImageData",value:E.spaceImageData}),t({title:r("Space icon was set successfully")}),Je.publish("app.files.spaces.uploaded-image",E)}catch(h){if(console.error(h),h instanceof re.HttpError&&h.statusCode===507){n({title:r("Failed to set space icon"),desc:r("Not enough quota to set the space icon"),errors:[h]});return}n({title:r("Failed to set space icon"),errors:[h]})}})};return{actions:M(()=>[{name:"set-space-icon",icon:"emoji-sticker",handler:c,label:()=>r("Set icon"),isVisible:({resources:b})=>b.length!==1?!1:b[0].canEditImage({user:e.user}),class:"oc-files-actions-set-space-icon-trigger"}]),setIconSpace:p}},LL=()=>{const e=gt(),{$gettext:t}=Oe.useGettext(),{dispatchModal:n}=ft(),{graphAuthenticated:r,webdav:i}=He(),o=st(),{showMessage:s,showErrorMessage:a}=tt(),{defaultSpaceImageBlobURL:l}=Me.storeToRefs(o),u=async({space:p})=>{try{await i.deleteFile(p,{path:".space/image.png"}),await r.drives.updateDrive(p.id,{name:p.name,special:[{specialFolder:{name:"image"},id:null}]}),o.updateSpaceField({id:p.id,field:"spaceImageData",value:null}),o.updateSpaceField({id:p.id,field:"thumbnail",value:f(l)}),s({title:t("Space image deleted successfully")})}catch(m){console.error(m),a({title:t("Failed to delete space image"),errors:[m]})}},c=({resources:p})=>{n({title:t("Delete »%{space}« image",{space:p[0].name}),confirmText:t("Delete"),onConfirm:()=>u({space:p[0]}),message:t("Are you sure you want to delete the image of »%{space}«?",{space:p[0].name})})};return{actions:M(()=>[{name:"delete-space-image",icon:"delete-bin",handler:c,label:()=>t("Delete image"),isVisible:({resources:p})=>p.length!==1||!p[0].spaceImageData?!1:p[0].canEditImage({user:e.user}),class:"oc-files-actions-delete-space-image-trigger"}]),deleteSpaceImage:u}},$L=()=>{const{$gettext:e}=Oe.useGettext();return{actions:M(()=>[{name:"show-details",icon:"information",label:()=>e("Details"),handler:()=>Je.publish(Ct.open),isVisible:({resources:n})=>n.length>0,class:"oc-admin-settings-show-details-trigger"}])}},ML=()=>{const{getMatchingSpace:e}=ln(),t=st(),n=lr(),r=We(),i=He(),{$gettext:o}=Oe.useGettext(),{openEditor:s}=Jn(),{resources:a,currentFolder:l}=Me.storeToRefs(r);return{openEmptyEditor:async(c,d)=>{let p=f(l)?e(f(l)):null,m=f(a),b=f(l)?.path;(!p||!f(l).canCreate())&&(p=t.personalSpace,m=(await i.webdav.listFiles(p)).children,b="");let w=o("New file")+`.${d}`;m.some(v=>v.name===w)&&(w=Hn(w,d,m));const S=await i.webdav.putFileContents(p,{path:re.urlJoin(b,w)}),y=e(S),g=n.fileExtensions.find(({app:v,extension:h})=>v===c&&h===d);s(g,y,S)}}},Q0=()=>{const{$gettext:e}=Oe.useGettext(),{showMessage:t}=tt();return{openUrl:(r,i,o)=>{const s=window.open(r,i);s?o&&s.focus():t({title:e("Pop-up and redirect block detected"),timeout:20,status:"warning",desc:e("Please turn on pop-ups and redirects in your browser settings to make sure everything works right.")})}}},BL=()=>xr("$appProviderService"),jL=()=>{const{isResourceAccessible:e}=ln();return{breadcrumbsFromPath:({route:r,space:i,resourcePath:o,ancestorMetaData:s=ae({})})=>{const a=(c="")=>c.split("/").filter(Boolean),l=a(r.path),u=a(o);return u.map((c,d)=>{const p=re.urlJoin(...u.slice(0,d+1),{leadingSlash:!0}),m=e({space:f(i),path:p});let b;return m&&(b=f(s)[p]),{id:Gt.v4(),allowContextActions:!0,text:c,...m&&{to:{path:"/"+[...l].splice(0,l.length-u.length+d+1).join("/"),query:{...Hi(r.query,"page","fileId"),...b&&{fileId:b.id}}}},isStaticNav:!1}})},concatBreadcrumbs:(...r)=>{const i=r.pop();return[...r,{id:Gt.v4(),allowContextActions:i.allowContextActions,text:i.text,onClick:()=>Je.publish("app.files.list.load"),isTruncationPlaceholder:i.isTruncationPlaceholder,isStaticNav:i.isStaticNav}]}}},UL=()=>({copyToClipboard:t=>{if(navigator?.clipboard?.write)return navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"})})]);{const{copy:n}=Vn.useClipboard({legacy:!0});return n(t)}}}),VL=(e="")=>{const t=ae(0),n=async()=>{await Vt();const r=document.querySelector(e||"#files-app-bar"),i=r?r.getBoundingClientRect().height:0;t.value!==i&&(t.value=i)};return window.onresize=n,$t(n),{y:t,refresh:n}},$d=()=>{const e=ae(!0),t=()=>{e.value=window.innerHeight>500};return $t(()=>{t(),window.addEventListener("resize",t)}),xn(()=>{window.removeEventListener("resize",t)}),{isSticky:e}};class oo{static perPageDefault="100";static perPageQueryName="items-per-page";static options=["20","50","100","250","500"]}function qL(e){const t=ps.useRouter(),n=ps.useRoute(),r=zL(e),i=WL(e),o=M(()=>Math.ceil(f(e.items).length/f(i))||1),s=M(()=>{if(!f(i))return f(e.items);const a=(f(r)-1)*f(i),l=a+f(i);return f(e.items).slice(a,l)});return Je.subscribe("app.files.navigate.page",({resourceId:a,forceScroll:l,topbarElement:u})=>{const c=At.findIndex(f(e.items),d=>d.id===a);if(c>=0){const d=Math.ceil((c+1)/Number(f(i)));t.push({...f(n),query:{...f(n).query,page:d}}).then(()=>{Je.publish("app.files.navigate.scrollTo",{resourceId:a,forceScroll:l,topbarElement:u})})}}),{items:s,total:o,page:r,perPage:i}}function zL(e){if(e.page)return M(()=>f(e.page));const t=en("page","1");return M(()=>parseInt(Rt(f(t))))}function WL(e){if(e.perPage)return M(()=>f(e.perPage));const t=Pr({name:e.perPageQueryName||oo.perPageQueryName,defaultValue:e.perPageDefault||oo.perPageDefault,storagePrefix:e.perPageStoragePrefix});return M(()=>parseInt(Rt(f(t))))}const X0=()=>xr("$passwordPolicyService");var tl=(e=>(e.mounted="portal-target.mounted",e))(tl||{});const HL=()=>{const e=fr(),t=ds.useWormhole();return{registerPortal:r=>{e.subscribe(tl.mounted,()=>{t.open(r)})}}},Y0=()=>xr("$previewService"),J0=()=>{const e=lr();return{canBeOpenedWithSecureView:n=>e.fileExtensions.filter(({secureView:i})=>i).some(({mimeType:i})=>i===n.mimeType)}},Z0=()=>{const e=gt();return{canListVersions:({space:n,resource:r})=>r.type==="folder"||re.isSpaceResource(r)||re.isTrashResource(r)?!1:n?.canListVersions({user:e.user})}},eS=()=>{const e=He(),t=st(),n=M(()=>t.spaces),r=l=>f(n).find(u=>l.toString().startsWith(u.id.toString())),i=l=>f(n).find(u=>re.isMountPointSpaceResource(u)&&u.root?.remoteItem?.id===l),o=(l,u)=>{const c=[qe.FileId,qe.FileParent,qe.Name,qe.ResourceType],d=re.buildSpace({id:l,name:""});return e.webdav.getFileInfo(d,{fileId:l},{davProperties:c,signal:u})},s=rn.useTask(function*(l,u){let c,d,p=r(u);if(p)return c=yield e.webdav.getPathForFileId(u,{signal:l}),d=yield e.webdav.getFileInfo(p,{path:c},{signal:l}),{space:p,resource:d,path:c};yield t.loadMountPoints({graphClient:e.graphAuthenticated,signal:l});let m=i(u);d=yield o(u,l);const b=m?[]:[f(d).name];let w=f(d);for(;!m;)w=yield o(w.parentFolderId,l),m=i(w.id),m||b.unshift(w.name);return p=t.getSpace(m.root?.remoteItem?.id)||t.createShareSpace({driveAliasPrefix:d.storageId?.startsWith(re.OCM_PROVIDER_ID)?"ocm-share":"share",id:m.root?.remoteItem?.id,shareName:m.name}),c=re.urlJoin(...b),{space:p,resource:d,path:c}}).restartable();return{getResourceContext:l=>s.perform(l)}},tn={name:{table:"resource-table",condensedTable:"resource-table-condensed",tiles:"resource-tiles"},defaultModeName:"resource-tiles",queryName:"view-mode",tilesSizeDefault:2,tilesSizeMax:6,tilesSizeQueryName:"tiles-size"},KL=140,GL=84,tS=()=>{const e=ae(KL),t=ae(GL),n=i=>f(e)+(i-1)*f(t);return{calculateTileSizePixels:n,calculateTileSizeRem:i=>{const o=parseFloat(getComputedStyle(document.documentElement).fontSize);return n(i)/o}}};function QL(e){if(e)return M(()=>f(e));const t=Pr({name:tn.queryName,defaultValue:tn.defaultModeName});return M(()=>Rt(f(t)))}function XL(e){if(e)return M(()=>parseInt(f(e)));const t=Pr({name:tn.tilesSizeQueryName,defaultValue:tn.tilesSizeDefault.toString()});return M(()=>parseInt(Rt(f(t))))}const YL=ae(tn.tilesSizeMax);function Md(){return YL}const Bd=e=>{const t=Y0(),{updateResourceField:n}=We(),{httpAuthenticated:r}=He(),i=st(),{defaultSpaceImageBlobURL:o}=Me.storeToRefs(i),s=ut(),{serverUrl:a}=Me.storeToRefs(s),l=new Lr({concurrency:4}),u=M(()=>f(e)===tn.name.tiles),c=M(()=>f(u)?ya.enum.fit:ya.enum.thumbnail),d=M(()=>f(u)?os.Tile:os.Thumbnail),p=rn.useTask(function*(S,{space:y,resource:g,dimensions:v,processor:h,updateStore:E=!0}){const T=re.isProjectSpaceResource(g)?re.buildSpaceImageResource(g):g,R=T.id===y.spaceImageData?.id;R&&i.addToImagesLoading(y.id);const C=yield l.add(()=>t.loadPreview({space:y,resource:T,processor:h||f(c),dimensions:v||f(d)},!0,!0,S));return C&&E&&n({id:g.id,field:"thumbnail",value:C}),R&&i.removeFromImagesLoading(y.id),C}),m=async S=>{const{resource:y,cancelRunning:g}=S;if(g&&w(),re.isProjectSpaceResource(y)&&(!y.spaceImageData||y.disabled)){f(o)&&i.updateSpaceField({id:y.id,field:"thumbnail",value:f(o)});try{const v=await r.get(`${f(a)}images/default-space-icon.png`,{responseType:"blob"});return i.setDefaultSpaceImageBlobURL(URL.createObjectURL(v.data)),i.updateSpaceField({id:y.id,field:"thumbnail",value:f(o)}),f(o)}catch{return null}}try{return await p.perform(S)}catch(v){v!=="cancel"&&console.error(v)}},b=M(()=>p.isRunning),w=()=>{p.cancelAll(),l.clear(),i.purgeImagesLoading()};return Pl(w),{loadPreview:m,previewsLoading:b}},nS=({showSizeInformation:e=!0}={})=>{const t=We(),{current:n,$gettext:r,$ngettext:i}=Oe.useGettext(),o=ze(),{resources:s,totalResourcesCount:a,areHiddenFilesShown:l,currentFolder:u}=Me.storeToRefs(t),c=M(()=>{if(!f(u)?.size||f(u)?.size==="0"){const p=f(s).map(m=>m.size?parseInt(m.size.toString()):0).reduce((m,b)=>m+b,0);return bn(p,n)}return bn(f(u).size,n)});return{resourceContentsText:M(()=>{let p=i("%{ filesCount } file","%{ filesCount } files",f(a).files,{filesCount:f(a).files.toString()});!f(l)&&f(a).hiddenFiles&&(p=i("%{ filesCount } file including %{ filesHiddenCount } hidden","%{ filesCount } files including %{ filesHiddenCount } hidden",f(a).files,{filesCount:f(a).files.toString(),filesHiddenCount:f(a).hiddenFiles.toString()}));let m=i("%{ foldersCount } folder","%{ foldersCount } folders",f(a).folders,{foldersCount:f(a).folders.toString()});!f(l)&&f(a).hiddenFolders&&(m=i("%{ foldersCount } folder including %{ foldersHiddenCount } hidden","%{ foldersCount } folders including %{ foldersHiddenCount } hidden",f(a).folders,{foldersCount:f(a).folders.toString(),foldersHiddenCount:f(a).hiddenFolders.toString()}));const b=i("%{ spacesCount } space","%{ spacesCount } spaces",f(a).spaces,{spacesCount:f(a).spaces.toString()}),w=f(a).files+f(a).folders+f(a).spaces,S=e&&parseFloat(f(c))>0,y=Bt(o,"files-shares-via-link"),g=r(S?"%{ itemsCount } item with %{ itemSize } in total":"%{ itemsCount } item in total"),v=r(S?"%{ itemsCount } items with %{ itemSize } in total":"%{ itemsCount } items in total"),h=y?"(%{ filesStr}, %{ foldersStr}, %{ spacesStr})":"(%{ filesStr}, %{ foldersStr})",E=`${g} ${h}`,T=`${v} ${h}`;return i(E,T,w,{itemsCount:w.toString(),itemSize:f(c),filesStr:p,foldersStr:m,spacesStr:b})})}},rS=({isResourceSelected:e,isResourceDisabled:t,emit:n})=>{const r=fr(),{isMobile:i}=Sw(),{interceptModifierClick:o}=gi(),s=p=>{r.publish("app.files.list.clicked"),n("update:selectedIds",p)},a=Yn(dn,"files-trash-overview"),l=p=>f(a)&&re.isProjectSpaceResource(p)&&p.disabled?!1:!t(p),u=p=>document.getElementById(`context-menu-trigger-${p.getDomSelector()}`);return{shouldShowContextDrop:l,showContextMenuOnBtnClick:(p,m)=>{const{dropdown:b,event:w}=p;if(w instanceof MouseEvent&&o(w,m))return;if(t(m))return!1;if(b?.tippy===void 0)return;const S=u(m);S&&(e(m)||s([m.id]),Qf(b.tippy,w,S))},showContextMenuOnRightClick:(p,m)=>{if(p instanceof MouseEvent&&o(p,m))return;if(p.preventDefault(),t(m))return!1;const b=u(m);if(b){if(e(m)||s([m.id]),f(i)){b.click();return}Qf(b._tippy,p,b)}}}},iS=({selectedIds:e,selectedResources:t,emit:n})=>{const r=We(),i=ae(),o=An("ghostElement"),s=async(p,m)=>{i.value=p,await Vt(),f(o).$el.ariaHidden="true",f(o).$el.style.left="-99999px",f(o).$el.style.top="-99999px",m.dataTransfer.setDragImage(f(o).$el,0,0),m.dataTransfer.dropEffect="move",m.dataTransfer.effectAllowed="move"},a=async(p,m)=>{f(e).includes(p.id)||(r.toggleSelection(p.id),n("update:selectedIds",[...r.selectedIds])),await s(p,m)},l=M(()=>f(t).filter(({id:p})=>p!==f(i)?.id)),u=p=>(p.dataTransfer.types||[]).some(m=>m==="Files"),c=(p,m)=>{u(m)||(i.value=null,d(p,!0,m),n("fileDropped",p.id))},d=(p,m,b)=>{if(u(b)||b.currentTarget?.contains(b.relatedTarget)||f(e).includes(p.id)||p.type!=="folder")return;const w=document.querySelectorAll(`[data-item-id='${p.id}']`)?.[0];if(!w)return;const S="!bg-role-secondary-container";m?w.classList.remove(S):w.classList.add(S)};return{ghostElement:o,dragItem:i,dragSelection:l,dragStart:a,fileDropped:c,setDropStyling:d}},oS=({resources:e,disabledResources:t,selectedIds:n,emit:r})=>{const i=fr(),{$gettext:o}=Oe.useGettext(),s=d=>{i.publish("app.files.list.clicked"),r("update:selectedIds",d)},a=d=>{switch(d.type){case"folder":return o("Select folder");case"space":return o("Select space");default:return o("Select file")}},l=M(()=>{const d=f(t).length===f(e).length,p=f(n).length===f(e).length-f(t).length;return!d&&p}),u=M(()=>f(l)?o("Clear selection"):o("Select all"));return{getResourceCheckboxLabel:a,areAllResourcesSelected:l,selectAllCheckboxLabel:u,toggleSelectionAll:()=>{if(f(l))return s([]);s(f(e).filter(d=>!f(t).includes(d.id)).map(d=>d.id))}}},jd=({space:e,resources:t,selectedIds:n,emit:r})=>{const i=We(),o=ze(),s=fr(),{interceptModifierClick:a}=gi(),{getMatchingSpace:l}=ln(),{canBeOpenedWithSecureView:u}=J0(),{getDefaultAction:c}=Jn(),{isEnabled:d,fileTypes:p,isFilePicker:m,postMessage:b}=Qr(),w=M(()=>f(t).filter(A=>f(n).includes(A.id))),S=A=>f(n).includes(A.id),y=A=>i.deleteQueue.includes(A),g=A=>f(d)&&f(p)?.length?!f(p).includes(A.extension)&&!f(p).includes(A.mimeType)&&!A.isFolder:y(A.id)?!0:re.isSpaceResource(A)?A.disabled:A.processing===!0,v=M(()=>f(t)?.filter(g)?.map(A=>A.id)||[]);return{selectedResources:w,disabledResources:v,isResourceSelected:S,isResourceInDeleteQueue:y,isResourceDisabled:g,isResourceClickable:(A,D)=>!D||re.isProjectSpaceResource(A)&&A.disabled||!A.isFolder&&!A.canDownload()&&!u(A)?!1:!g(A),fileContainerClicked:({resource:A,event:D})=>{if(g(A))return;if(f(d)&&f(m)&&!A.isFolder)return b("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(A)),locationQuery:JSON.parse(JSON.stringify(Ra(f(o.currentRoute))))});!D.shiftKey&&!D.metaKey&&!D.ctrlKey&&s.publish("app.files.shiftAnchor.reset");const V=D?.target;if(V?.closest("div")?.id==="oc-files-context-menu")return;if(D&&D.metaKey)return s.publish("app.files.list.clicked.meta",A);if(D&&D.shiftKey)return s.publish("app.files.list.clicked.shift",{resource:A,skipTargetSelection:!1});V.getAttribute("type")!=="checkbox"&&(S(A)||(s.publish("app.files.list.clicked"),r("update:selectedIds",[A.id])))},fileNameClicked:({resource:A,event:D})=>{if(!a(D,A)){if(f(d))return f(m)||r("update:selectedIds",[A.id]),f(m)&&!A.isFolder?b("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(A)),locationQuery:JSON.parse(JSON.stringify(Ra(f(o.currentRoute))))}):void 0;r("fileClick",{space:l(A),resources:[A]})}},fileCheckboxClicked:({resource:A,event:D})=>{a(D,A)||(i.toggleSelection(A.id),s.publish("app.files.list.clicked"),r("update:selectedIds",[...i.selectedIds]))},getResourceLink:A=>{let D=f(e);D||(D=l(A));const V=c({resources:[A],space:D});if(V?.route)return V.route({space:D,resources:[A]})},...iS({selectedIds:n,selectedResources:w,emit:r}),...rS({isResourceDisabled:g,isResourceSelected:S,emit:r}),...oS({resources:t,disabledResources:v,selectedIds:n,emit:r})}},Ud=()=>{const{getMatchingSpace:e}=ln(),t=We(),n=M({get(){return t.selectedResources},set(s){t.setSelection(s.map(({id:a})=>a))}}),r=M({get(){return t.selectedIds},set(s){t.setSelection(s)}}),i=s=>f(r).includes(s.id),o=M(()=>{if(f(n).length!==1)return null;const s=f(n)[0];return e(s)});return{selectedResources:n,selectedResourcesIds:r,isResourceInSelection:i,selectedResourceSpace:o}};function JL(e){const t=Zt(),n=li(),r=He(),i=Oe.useGettext(),o=M(()=>t.tusMaxChunkSize>0),s=()=>{const u={};return n.publicLinkPassword?u.Authorization="Basic "+Kr.from(["public",n.publicLinkPassword].join(":")).toString("base64"):n.accessToken&&!n.publicLinkPassword&&(u.Authorization="Bearer "+n.accessToken),u["X-Request-ID"]=Gt.v4(),u["Accept-Language"]=i.current,u["Initiator-ID"]=r.initiatorId,u},a=M(()=>{const u={onBeforeRequest:(c,d)=>new Promise(p=>{const m=s();c.setHeader("Authorization",m.Authorization),c.setHeader("X-Request-ID",m["X-Request-ID"]),c.setHeader("Accept-Language",m["Accept-Language"]),c.setHeader("Initiator-ID",m["Initiator-ID"]),d?.isRemote&&c.setHeader("x-oc-mtime",(d?.data?.lastModified/1e3).toFixed(0)),p()}),chunkSize:t.tusMaxChunkSize||1/0,overridePatchMethod:t.tusHttpMethodOverride,uploadDataDuringCreation:t.tusExtension.includes("creation-with-upload")};return u.headers=c=>{if(c.xhrUpload||c?.isRemote)return{"x-oc-mtime":(c?.data?.lastModified/1e3).toFixed(0),...s()}},u}),l=M(()=>({timeout:6e4,endpoint:"",headers:u=>({"x-oc-mtime":(u?.data?.lastModified/1e3).toFixed(0),...s()})}));ot([a,l],()=>{if(f(o)){e.uppyService.useTus(f(a));return}e.uppyService.useXhr(f(l))},{immediate:!0})}const sS=()=>{const e=He(),{addAvatar:t,getAvatar:n,avatarsQueue:r,pendingAvatarsRequests:i}=Ta(),o=async a=>{try{const l=await e.graphAuthenticated.photos.getUserPhoto(a,{responseType:"blob"});t(a,URL.createObjectURL(l))}catch(l){l.response?.status===404&&t(a,null)}return n(a)};return{enqueueAvatar:a=>{if(n(a)!==void 0||i.has(a))return;const l=r.add(()=>o(a));i.set(a,l),l.finally(()=>i.delete(a))}}},ZL=Fe({name:"ActionMenuItem",props:{action:{type:Object,required:!0},actionOptions:{type:Object,required:!0},size:{type:String,required:!1,default:"medium"},appearance:{type:String,default:"raw"},shortcutHint:{type:Boolean,default:!0,required:!1},showTooltip:{type:Boolean,default:!1,required:!1},buttonClasses:{type:Array,default:()=>[]}},setup(e){const t=ut(),{options:n}=Me.storeToRefs(t),r=M(()=>Object.hasOwn(e.action,"route")?"router-link":Object.hasOwn(e.action,"href")?"a":(Object.hasOwn(e.action,"handler")||console.warn("ActionMenuItem: No handler, route or href callback found in action",e.action),"button")),i=M(()=>({...{appearance:e.action.appearance||e.appearance,...e.action.isDisabled&&{disabled:e.action.isDisabled(e.actionOptions)},...e.action.id&&{id:e.action.id}},...f(r)==="router-link"&&{to:e.action.route(e.actionOptions)},...f(r)==="a"&&{href:e.action.href(e.actionOptions)},...["router-link","a"].includes(f(r))&&{target:n.value.cernFeatures?"_blank":"_self"}})),o=M(()=>typeof e.action.icon=="function"?e.action.icon(e.actionOptions):e.action.icon);return{componentType:r,componentProps:i,actionIcon:o}},computed:{hasExternalImageIcon(){return this.actionIcon&&/^https?:\/\//i.test(this.actionIcon)},componentListeners(){if(typeof this.action.handler!="function")return{};const e=()=>this.action.handler({...this.actionOptions});return this.action.keepOpen?{click:t=>{t.stopPropagation(),e()}}:{click:e}}}}),e$={key:3,class:"oc-files-context-action-label flex flex-col","data-testid":"action-label"},t$=["textContent"],n$=["textContent"];function r$(e,t,n,r,i,o){const s=Ee("oc-image"),a=Ee("oc-icon"),l=Ee("oc-button"),u=sn("oc-tooltip");return it((Y(),pe("li",null,[it((Y(),Te(l,Mt({type:e.componentType},e.componentProps,{class:[e.action.class,"action-menu-item","align-middle","w-full",...e.buttonClasses],"aria-label":e.componentProps.disabled?e.action.disabledTooltip?.(e.actionOptions)??e.action.label(e.actionOptions):e.action.label(e.actionOptions),"data-testid":"action-handler",size:e.size,"justify-content":"left"},Fs(e.componentListeners)),{default:ve(()=>[e.action.img?(Y(),Te(s,{key:0,"data-testid":"action-img",src:e.action.img,alt:"",class:"oc-icon oc-icon-m w-[22px]"},null,8,["src"])):e.hasExternalImageIcon?(Y(),Te(s,{key:1,"data-testid":"action-img",src:e.actionIcon,alt:"",class:"oc-icon oc-icon-m w-[22px]"},null,8,["src"])):e.actionIcon?(Y(),Te(a,{key:2,"data-testid":"action-icon",name:e.actionIcon,"fill-type":e.action.iconFillType||"line",size:e.size},null,8,["name","fill-type","size"])):ke("",!0),e.action.hideLabel?ke("",!0):(Y(),pe("span",e$,[ue("span",{class:"text-left",textContent:q.toDisplayString(e.action.label(e.actionOptions))},null,8,t$)])),e.action.shortcut&&e.shortcutHint?(Y(),pe("span",{key:4,class:"text-sm flex-row-reverse",textContent:q.toDisplayString(e.action.shortcut)},null,8,n$)):ke("",!0)]),_:1},16,["type","class","aria-label","size"])),[[u,e.showTooltip||e.action.hideLabel?e.action.label(e.actionOptions):""]])])),[[u,e.componentProps.disabled?e.action.disabledTooltip?.(e.actionOptions):""]])}const nl=Xe(ZL,[["render",r$]]),i$=Fe({name:"BatchActions",components:{ActionMenuItem:nl},props:{actions:{type:Array,required:!0},actionOptions:{type:Object,required:!0},limitedScreenSpace:{type:Boolean,default:!1,required:!1}}});function o$(e,t,n,r,i,o){const s=Ee("action-menu-item"),a=Ee("oc-list");return Y(),pe("div",null,[me(a,{id:"oc-appbar-batch-actions",class:q.normalizeClass(["block xl:flex xl:items-center",{"oc-appbar-batch-actions-squashed [&_.oc-files-context-action-label]:hidden":e.limitedScreenSpace}])},{default:ve(()=>[(Y(!0),pe(je,null,dt(e.actions,(l,u)=>(Y(),Te(s,{key:`action-${u}`,action:l,"action-options":e.actionOptions,appearance:"raw",class:"batch-actions mr-2 float-left [&_.action-menu-item]:p-2 [&_.action-menu-item]:gap-1","shortcut-hint":!1,"show-tooltip":e.limitedScreenSpace},null,8,["action","action-options","show-tooltip"]))),128))]),_:1},8,["class"])])}const aS=Xe(i$,[["render",o$]]),s$={class:"context-menu px-2"},a$={class:"inline-flex gap-2"},l$={class:"flex oc-files-context-action-label"},c$=["textContent"],lS=Fe({__name:"ActionMenuDropItem",props:{menuSectionDrop:{},appearance:{},actionOptions:{}},setup(e){const t=hi(`oc-files-context-actions-${e.menuSectionDrop.name}-drop-`),n=hi(`oc-files-context-actions-${e.menuSectionDrop.name}-toggle-`);return(r,i)=>{const o=Ee("oc-icon"),s=Ee("oc-button"),a=Ee("oc-list");return Y(),pe("li",s$,[me(s,{id:f(n),appearance:"raw","justify-content":"space-between","gap-size":"medium",class:"w-full flex justify-between","aria-expanded":"false"},{default:ve(()=>[ue("span",a$,[me(o,{name:e.menuSectionDrop.icon,size:"medium","fill-type":"line"},null,8,["name"]),ue("span",l$,[ue("span",{textContent:q.toDisplayString(e.menuSectionDrop.label)},null,8,c$)])]),me(o,{name:"arrow-right-s",size:"small","fill-type":"line"})]),_:1},8,["id"]),me(f(aN),{title:e.menuSectionDrop.label,"drop-id":f(t),toggle:`#${f(n)}`,"is-nested-element":!0,mode:"hover",class:"w-3xs oc-files-context-action-drop","padding-size":"small",position:"auto-start","close-on-click":""},{default:ve(()=>[e.menuSectionDrop.items.length?(Y(),Te(a,{key:0},{default:ve(()=>[(Y(!0),pe(je,null,dt(e.menuSectionDrop.items,(l,u)=>(Y(),Te(nl,{key:`section-${e.menuSectionDrop.label}-action-${u}`,action:l,appearance:e.appearance,"action-options":e.actionOptions},null,8,["action","appearance","action-options"]))),128))]),_:1})):ke("",!0)]),_:1},8,["title","drop-id","toggle"])])}}}),u$=Fe({name:"ContextActionMenu",components:{ActionMenuDropItem:lS,ActionMenuItem:nl},props:{menuSections:{type:Array,required:!0},appearance:{type:String,default:"raw"},actionOptions:{type:Object,required:!0}},methods:{getSectionClasses(e){const t=[];return this.menuSections.length&&(e<this.menuSections.length-1&&t.push("pb-2"),e>0&&t.push("pt-2"),e<this.menuSections.length-1&&t.push("border-b")),t}}}),f$={id:"oc-files-context-menu"};function d$(e,t,n,r,i,o){const s=Ee("action-menu-item"),a=Ee("action-menu-drop-item"),l=Ee("oc-list");return Y(),pe("div",f$,[(Y(!0),pe(je,null,dt(e.menuSections,(u,c)=>(Y(),Te(l,{id:`oc-files-context-actions-${u.name}`,key:`section-${u.name}-list`,class:q.normalizeClass(["[&_li]:px-0",e.getSectionClasses(c)])},{default:ve(()=>[u.items?(Y(!0),pe(je,{key:0},dt(u.items,(d,p)=>(Y(),Te(s,{key:`section-${u.name}-action-${p}`,action:d,appearance:e.appearance,"action-options":e.actionOptions,class:"context-menu"},null,8,["action","appearance","action-options"]))),128)):ke("",!0),(Y(!0),pe(je,null,dt(u.dropItems,d=>(Y(),pe(je,null,[d.items.length?(Y(),Te(a,{key:d.name,"menu-section-drop":d,appearance:e.appearance,"action-options":e.actionOptions},null,8,["menu-section-drop","appearance","action-options"])):ke("",!0)],64))),256))]),_:2},1032,["id","class"]))),128))])}const rl=Xe(u$,[["render",d$]]),p$=Fe({name:"ContextActions",components:{ContextActionMenu:rl},props:{actionOptions:{type:Object,required:!0}},setup(e){const{getAllOpenWithActions:t}=Jn(),{$gettext:n}=Oe.useGettext(),{actions:r}=x0(),{actions:i}=Xa(),{actions:o}=Za(),{actions:s}=Ia(),{actions:a}=sd(),{actions:l}=Ga(),{actions:u}=ls(),{actions:c}=Qa(),{actions:d}=cs(),{actions:p}=_d(),{actions:m}=Ya(),{actions:b}=P0(),{actions:w}=Ja(),{actions:S}=us(),{actions:y}=_0(),{actions:g}=Nd(),{actions:v}=Fd(),{actions:h}=Ld(),E=Ki(),T=M(()=>E.requestExtensions({id:"global.files.context-actions",extensionType:"action"}).map(J=>J.action)),R=M(()=>E.requestExtensions({id:"global.files.batch-actions",extensionType:"action"}).map(J=>J.action)),C=d1(e,"actionOptions"),A=M(()=>[...f(i),...f(l),...f(c),...f(m),...f(s),...f(u),...f(S),...f(v),...f(R).filter(J=>J.category==="actions"||At.isNil(J.category))].filter(J=>J.isVisible(f(C)))),D=M(()=>[...f(g),...f(R).filter(J=>J.category==="sidebar")].filter(J=>J.isVisible(f(C)))),V=M(()=>f(r).filter(J=>J.isVisible(f(C))).sort((J,se)=>Number(se.hasPriority)-Number(J.hasPriority))),O=M(()=>t({...f(C),omitSystemActions:!0}).filter(J=>J.isVisible(f(C))).sort((J,se)=>Number(se.hasPriority)-Number(J.hasPriority))),N=M(()=>[...f(h),...f(a),...f(T).filter(J=>J.category==="share")].filter(J=>J.isVisible(f(C)))),W=M(()=>[...f(c),...f(d),...f(u),...f(m),...f(s),...f(b),...f(w),...f(v),...f(S),...f(i),...f(l),...f(o),...f(y),...f(T).filter(J=>J.category==="actions"||At.isNil(J.category))].filter(J=>J.isVisible(f(C)))),L=M(()=>[...f(p).map(J=>(J.keepOpen=!0,J)),...f(g),...f(T).filter(J=>J.category==="sidebar")].filter(J=>J.isVisible(f(C))));return{menuSections:M(()=>{const J=[];return f(C).resources.length>1?(f(A).length&&J.push({name:"batch-actions",items:[...f(A)]}),J.push({name:"batch-details",items:[...f(D)]}),J):([...f(V),...f(O)].length&&J.push({name:"context",items:[...f(V)],dropItems:[{label:n("Open with..."),name:"open-with",icon:"apps",items:[...f(O)]}]}),f(N).length&&J.push({name:"share",items:f(N)}),f(W).length&&J.push({name:"actions",items:f(W)}),f(L).length&&J.push({name:"sidebar",items:f(L)}),J)})}}});function h$(e,t,n,r,i,o){const s=Ee("context-action-menu");return Y(),Te(s,{"menu-sections":e.menuSections,"action-options":e.actionOptions},null,8,["menu-sections","action-options"])}const cS=Xe(p$,[["render",h$]]),m$={class:"flex items-center"},g$={class:"flex justify-between w-full"},y$={class:"flex items-center"},v$=["textContent"],b$={key:0,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},w$={key:1,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},S$={key:2,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},E$={key:3,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},T$={key:4,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},A$={key:5,class:"mt-2 mb-4 last:mb-0 flex justify-between items-center [&>*]:flex [&>*]:justify-between"},x$=["textContent"],C$=["max"],uS=Xe(Fe({__name:"ViewOptions",props:{perPageStoragePrefix:{},hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},paginationOptions:{default:()=>oo.options},perPageQueryName:{default:()=>oo.perPageQueryName},perPageDefault:{default:()=>oo.perPageDefault},viewModeDefault:{default:()=>tn.defaultModeName},viewModes:{default:()=>[]}},setup(e){const t=ze(),n=zt(),{$gettext:r}=Oe.useGettext(),{isSideBarOpen:i}=Sa(),o=We(),{setAreHiddenFilesShown:s,setAreFileExtensionsShown:a,setAreDisabledSpacesShown:l,setAreEmptyTrashesShown:u}=o,{areHiddenFilesShown:c,areFileExtensionsShown:d,areDisabledSpacesShown:p,areEmptyTrashesShown:m}=Me.storeToRefs(o),b=ae(!1),w=Yn(pt,"files-spaces-projects"),S=Yn(dn,"files-trash-overview"),y=en("page"),g=M(()=>f(y)?parseInt(Rt(f(y))):1),v=Pr({name:e.perPageQueryName,defaultValue:e.perPageDefault,storagePrefix:e.perPageStoragePrefix}),h=Pr({name:tn.queryName,defaultValue:e.viewModeDefault}),E=Pr({name:tn.tilesSizeQueryName,defaultValue:tn.tilesSizeDefault.toString()}),T=J=>t.replace({query:{...f(n).query,[e.perPageQueryName]:J.toString(),...f(g)>1&&{page:"1"}}}),R=J=>{h.value=J.name};ot([v,h,E],J=>{b.value=J.some(se=>!se)},{immediate:!0,deep:!0});const C=Md(),A=M({get(){return f(c)},set(J){s(J)}}),D=M({get(){return f(d)},set(J){a(J)}}),V=M({get(){return f(p)},set(J){l(J)}}),O=M({get(){return f(m)},set(J){u(J)}}),N=J=>{A.value=J},W=J=>{D.value=J},L=J=>{V.value=J},ee=J=>{O.value=J};return(J,se)=>{const he=Ee("oc-icon"),oe=Ee("oc-button"),we=Ee("oc-list"),X=Ee("oc-drop"),ie=Ee("oc-switch"),le=Ee("oc-page-size"),Ae=sn("oc-tooltip");return Y(),pe("div",m$,[e.viewModes.length?(Y(),pe(je,{key:0},[it((Y(),Te(oe,{id:"mobile-viewmode-switch-toggle","aria-label":f(r)("Switch view mode"),appearance:"raw",class:q.normalizeClass(["my-2 mx-1 p-1 align-middle",{"sm:hidden":!f(i),"md:hidden":f(i)}])},{default:ve(()=>[me(he,{name:"list-view","fill-type":"none"})]),_:1},8,["aria-label","class"])),[[Ae,f(r)("Switch view mode")]]),me(X,{title:f(r)("View mode"),"drop-id":"mobile-viewmode-switch-drop",toggle:"#mobile-viewmode-switch-toggle",class:"w-auto","padding-size":"medium","close-on-click":""},{default:ve(()=>[me(we,null,{default:ve(()=>[(Y(!0),pe(je,null,dt(e.viewModes,te=>(Y(),pe("li",{key:te.name},[me(oe,{appearance:f(h)===te.name?"filled":"raw","color-role":f(h)===te.name?"secondaryContainer":"secondary","justify-content":"left",onClick:F=>R(te)},{default:ve(()=>[ue("div",g$,[ue("span",y$,[me(he,{name:te.icon.name,"fill-type":te.icon.fillType,size:"medium",class:"mr-1"},null,8,["name","fill-type"]),ue("span",{textContent:q.toDisplayString(te.label)},null,8,v$)]),f(h)===te.name?(Y(),Te(he,{key:0,name:"check",size:"medium"})):ke("",!0)])]),_:2},1032,["appearance","color-role","onClick"])]))),128))]),_:1})]),_:1},8,["title"])],64)):ke("",!0),e.viewModes.length>1?(Y(),pe("div",{key:1,class:q.normalizeClass(["viewmode-switch-buttons oc-button-group hidden mr-2",{"sm:inline-flex":!f(i),"md:inline-flex":f(i)}])},[(Y(!0),pe(je,null,dt(e.viewModes,te=>it((Y(),Te(oe,{key:te.name,"no-hover":f(h)===te.name,class:q.normalizeClass([te.name]),appearance:f(h)===te.name?"filled":"outline","color-role":f(h)===te.name?"secondaryContainer":"secondary","aria-label":f(r)("Switch to %{viewMode}",{viewMode:te.label}),onClick:F=>R(te)},{default:ve(()=>[me(he,{name:te.icon.name,"fill-type":te.icon.fillType,size:"small"},null,8,["name","fill-type"])]),_:2},1032,["no-hover","class","appearance","color-role","aria-label","onClick"])),[[Ae,f(r)("Switch to %{viewMode}",{viewMode:te.label})]])),128))],2)):ke("",!0),it((Y(),Te(oe,{id:"files-view-options-btn",key:"files-view-options-btn","data-testid":"files-view-options-btn","aria-label":f(r)("Display customization options of the files list"),appearance:"raw",class:"my-2 mx-1 p-1 align-middle"},{default:ve(()=>[me(he,{name:"settings-3","fill-type":"line"})]),_:1},8,["aria-label"])),[[Ae,f(r)("Display customization options of the files list")]]),me(X,{title:f(r)("View options"),"drop-id":"files-view-options-drop",toggle:"#files-view-options-btn",mode:"click",class:"w-auto","padding-size":"medium"},{default:ve(()=>[me(we,null,{default:ve(()=>[e.hasHiddenFiles?(Y(),pe("li",b$,[me(ie,{checked:A.value,"onUpdate:checked":[se[0]||(se[0]=te=>A.value=te),N],"data-testid":"files-switch-hidden-files",label:f(r)("Show hidden files")},null,8,["checked","label"])])):ke("",!0),e.hasFileExtensions?(Y(),pe("li",w$,[me(ie,{checked:D.value,"onUpdate:checked":[se[1]||(se[1]=te=>D.value=te),W],"data-testid":"files-switch-files-extensions-files",label:f(r)("Show file extensions")},null,8,["checked","label"])])):ke("",!0),e.hasPagination?(Y(),pe("li",S$,[b.value?ke("",!0):(Y(),Te(le,{key:0,selected:f(Rt)(f(v)),"data-testid":"files-pagination-size",label:f(r)("Items per page"),options:e.paginationOptions,class:"files-pagination-size",onChange:T},null,8,["selected","label","options"]))])):ke("",!0),f(w)?(Y(),pe("li",E$,[me(ie,{checked:V.value,"onUpdate:checked":[se[2]||(se[2]=te=>V.value=te),L],"data-testid":"files-switch-projects-show-disabled",label:f(r)("Show disabled Spaces")},null,8,["checked","label"])])):ke("",!0),f(S)?(Y(),pe("li",T$,[me(ie,{checked:O.value,"onUpdate:checked":[se[3]||(se[3]=te=>O.value=te),ee],"data-testid":"files-switch-projects-show-disabled",label:f(r)("Show empty trash bins")},null,8,["checked","label"])])):ke("",!0),f(h)===f(tn).name.tiles?(Y(),pe("li",A$,[ue("label",{for:"tiles-size-slider",textContent:q.toDisplayString(f(r)("Tile size"))},null,8,x$),it(ue("input",{id:"tiles-size-slider","onUpdate:modelValue":se[4]||(se[4]=te=>_t(E)?E.value=te:null),type:"range",min:1,max:f(C),class:"oc-range bg-role-surface-container-high rounded-sm outline-0 w-full max-w-[50%] h-1.5 hover:opacity-100 appearance-none","data-testid":"files-tiles-size-slider"},null,8,C$),[[Ml,f(E)]])])):ke("",!0)]),_:1})]),_:1},8,["title"])])}}}),[["__scopeId","data-v-15b0e205"]]),R$=Fe({name:"AppBar",components:{BatchActions:aS,ContextActions:cS,ViewOptions:uS},props:{viewModeDefault:{type:String,required:!1,default:()=>tn.defaultModeName},breadcrumbs:{type:Array,default:()=>[]},breadcrumbsContextActionsItems:{type:Array,default:()=>[]},viewModes:{type:Array,default:()=>[]},hasBulkActions:{type:Boolean,default:!1},hasViewOptions:{type:Boolean,default:!0},hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},showActionsOnSelection:{type:Boolean,default:!1},isSideBarOpen:{type:Boolean,default:!1},batchActionsLoading:{type:Boolean,default:!1},space:{type:Object,required:!1,default:null}},setup(e,{emit:t}){const n=st(),{$gettext:r}=Oe.useGettext(),{can:i}=fn(),o=ze(),{requestExtensions:s}=Ki(),{isSticky:a}=$d(),l=We(),{selectedResources:u}=Me.storeToRefs(l),c=M(()=>e.space),{actions:d}=Xa(),{actions:p}=Za(),{actions:m}=Ia(),{actions:b}=U0(),{actions:w}=Ga(),{actions:S}=ls(),{actions:y}=Qa(),{actions:g}=cs(),{actions:v}=Ya(),{actions:h}=us(),{actions:E}=B0(),{actions:T}=j0(),{actions:R}=z0(),{actions:C}=K0(),A=ae(0),D=Yn(It,"files-common-search"),V=M(()=>Object.hasOwn(zp(),"navigation")&&i("create-all","Share")),O=M(()=>{let X=[...f(p),...f(d),...f(w),...f(y),...f(g),...f(v),...f(m),...f(S),...f(h)];D.value||(X=[...X,...f(b),...f(R),...f(C),...f(E),...f(T)]);const ie=s({id:"global.files.batch-actions",extensionType:"action"});return ie.length&&(X=[...X,...ie.map(le=>le.action)]),X.filter(le=>le.isVisible({space:f(c),resources:l.selectedResources}))}),N=M(()=>n.spaces.filter(X=>re.isPersonalSpaceResource(X)||re.isProjectSpaceResource(X))),W=Sr("isMobileWidth"),L=Yn(dn,"files-trash-generic"),ee=M(()=>!f(W)&&e.breadcrumbs.length?!0:f(L)&&f(N).length===1?!1:e.breadcrumbs.length>1),J=M(()=>f(L)&&f(N).length===1?e.breadcrumbs.length<=2:e.breadcrumbs.length<=1),se=M(()=>f(c)&&(re.isProjectSpaceResource(f(c))||re.isShareSpaceResource(f(c)))?3:2),he=X=>{t(hb,X)},oe=Gb("title"),we=M(()=>f(oe)?r(f(oe)):f(c)?.name||"");return{router:o,hasSharesNavigation:V,batchActions:O,showBreadcrumb:ee,showMobileNav:J,breadcrumbMaxWidth:A,breadcrumbTruncationOffset:se,fileDroppedBreadcrumb:he,pageTitle:we,selectedResources:u,isSticky:a}},data:function(){return{resizeObserver:new ResizeObserver(this.onResize),limitedScreenSpace:!1}},computed:{showContextActions(){return Jd(this.breadcrumbs).allowContextActions},showBatchActions(){return this.hasBulkActions&&(this.selectedResources.length>=1||dn(this.router,"files-trash-generic"))},selectedResourcesAnnouncement(){return this.selectedResources.length===0?this.$gettext("No items selected."):this.$ngettext("%{ amount } item selected. Actions are available above the table.","%{ amount } items selected. Actions are available above the table.",this.selectedResources.length,{amount:this.selectedResources.length.toString()})}},mounted(){this.resizeObserver.observe(this.$refs.filesAppBar),window.addEventListener("resize",this.onResize)},beforeUnmount(){this.resizeObserver.unobserve(this.$refs.filesAppBar),window.removeEventListener("resize",this.onResize)},methods:{onResize(){const e=document.getElementById("web-content-main")?.getBoundingClientRect().width||0,t=document.getElementById("web-nav-sidebar")?.getBoundingClientRect().width||0,n=document.getElementById("app-sidebar")?.getBoundingClientRect().width||0,r=document.getElementById("files-app-bar-controls-right")?.clientWidth;this.breadcrumbMaxWidth=e-t-n-r,this.limitedScreenSpace=this.isSideBarOpen?window.innerWidth<=1280:window.innerWidth<=1e3}}}),k$={class:"files-topbar py-2 w-full"},P$=["textContent"],I$={key:3,id:"files-app-bar-controls-right",class:"flex"},O$={class:"files-app-bar-actions flex items-center justify-end mt-1 min-h-10 gap-2"},F$={class:"flex-1 flex justify-start items-center"},_$={key:1};function D$(e,t,n,r,i,o){const s=Ee("oc-hidden-announcer"),a=Ee("context-actions"),l=Ee("oc-breadcrumb"),u=Ee("portal-target"),c=Ee("view-options"),d=Ee("batch-actions"),p=Ee("oc-spinner");return Y(),pe("div",{id:"files-app-bar",ref:"filesAppBar",class:q.normalizeClass(["px-4 bg-role-surface rounded-t-xl [display:inherit] top-0 z-20",{"files-app-bar-squashed":e.isSideBarOpen,sticky:e.isSticky}])},[ue("div",k$,[ue("h1",{class:"sr-only",textContent:q.toDisplayString(e.pageTitle)},null,8,P$),me(s,{announcement:e.selectedResourcesAnnouncement,level:"polite"},null,8,["announcement"]),ue("div",{class:q.normalizeClass(["flex items-center files-app-bar-controls min-h-13",{"justify-between":e.breadcrumbs.length||e.hasSharesNavigation,"justify-end":!e.breadcrumbs.length&&!e.hasSharesNavigation}])},[e.showBreadcrumb?(Y(),Te(l,{key:0,id:"files-breadcrumb","context-menu-padding":"small","show-context-actions":e.showContextActions,items:e.breadcrumbs,"max-width":e.breadcrumbMaxWidth,"truncation-offset":e.breadcrumbTruncationOffset,"mobile-breakpoint":e.isSideBarOpen?"md":"sm",onItemDroppedBreadcrumb:e.fileDroppedBreadcrumb},{contextMenu:ve(()=>[me(a,{"action-options":{space:e.space,resources:e.breadcrumbsContextActionsItems.filter(Boolean)}},null,8,["action-options"])]),_:1},8,["show-context-actions","items","max-width","truncation-offset","mobile-breakpoint","onItemDroppedBreadcrumb"])):ke("",!0),e.showMobileNav?(Y(),Te(u,{key:1,name:"app.runtime.mobile.nav"})):ke("",!0),e.hasSharesNavigation?Ve(e.$slots,"navigation",{key:2}):ke("",!0),e.hasViewOptions?(Y(),pe("div",I$,[me(c,{"view-modes":e.viewModes,"has-hidden-files":e.hasHiddenFiles,"has-file-extensions":e.hasFileExtensions,"has-pagination":e.hasPagination,"per-page-storage-prefix":"files","view-mode-default":e.viewModeDefault},null,8,["view-modes","has-hidden-files","has-file-extensions","has-pagination","view-mode-default"])])):ke("",!0)],2),ue("div",O$,[ue("div",F$,[Ve(e.$slots,"actions",{limitedScreenSpace:e.limitedScreenSpace}),e.showBatchActions&&!e.batchActionsLoading?(Y(),Te(d,{key:0,actions:e.batchActions,"action-options":{space:e.space,resources:e.selectedResources},"limited-screen-space":e.limitedScreenSpace},null,8,["actions","action-options","limited-screen-space"])):e.showBatchActions&&e.batchActionsLoading?(Y(),pe("div",_$,[me(p,{"aria-label":e.$gettext("Loading actions")},null,8,["aria-label"])])):ke("",!0)])]),Ve(e.$slots,"content")])],2)}const N$=Xe(R$,[["render",D$]]),L$=Fe({name:"CreateSpace",props:{showLabel:{type:Boolean,default:!0}},emits:["spaceCreated"],setup(e,{emit:t}){const{showMessage:n,showErrorMessage:r}=tt(),{$gettext:i}=Oe.useGettext(),{createSpace:o}=Xi(),{isSpaceNameValid:s}=Ei(),{dispatchModal:a}=ft(),l=st(),{upsertResource:u}=We(),c=async p=>{try{const m=await o(p);u(m),l.upsertSpace(m),t("spaceCreated",m),n({title:i("Space was created successfully")})}catch(m){console.error(m),r({title:i("Creating space failed…"),errors:[m]})}};return{showCreateSpaceModal:()=>{a({title:i("Create a new space"),confirmText:i("Create"),hasInput:!0,inputLabel:i("Space name"),inputValue:i("New space"),inputRequiredMark:!0,onConfirm:p=>c(p),onInput:(p,m)=>{const{isValid:b,error:w}=s(p);m(b?null:w)}})}}}}),$$=["textContent"];function M$(e,t,n,r,i,o){const s=Ee("oc-icon"),a=Ee("oc-button"),l=sn("oc-tooltip");return it((Y(),Te(a,{id:"new-space-menu-btn","aria-label":e.showLabel?void 0:e.$gettext("New space"),appearance:"filled",onClick:e.showCreateSpaceModal},{default:ve(()=>[me(s,{name:"add"}),e.showLabel?(Y(),pe("span",{key:0,textContent:q.toDisplayString(e.$gettext("New Space"))},null,8,$$)):ke("",!0)]),_:1},8,["aria-label","onClick"])),[[l,e.showLabel?void 0:e.$gettext("New space")]])}const B$=Xe(L$,[["render",M$]]),j$={class:"oc-app-top-bar self-center flex col-[1/4] row-2 sm:col-2 sm:row-1 [&_.parent-folder]:text-role-on-chrome"},U$={class:"pl-4 pr-1 my-2 mx-auto sm:m-0 inline-flex items-center justify-between bg-role-chrome border border-role-on-chrome rounded-lg h-10 gap-4 w-full sm:w-fit"},V$={class:"open-file-bar flex"},q$={class:"flex"},z$={key:1,class:"flex items-center","data-testid":"autosave-indicator"},fS=Fe({__name:"AppTopBar",props:{dropDownMenuSections:{default:()=>[]},dropDownActionOptions:{default:()=>({space:null,resources:[]})},mainActions:{default:()=>[]},hasAutoSave:{type:Boolean,default:!0},isEditor:{type:Boolean,default:!1},resource:{default:null},isReadOnly:{type:Boolean,default:!0}},emits:["close"],setup(e){const{$gettext:t,current:n}=Oe.useGettext(),r=We(),i=ut(),{getMatchingSpace:o}=ln(),{getParentFolderName:s,getPathPrefix:a,getParentFolderLinkIconAdditionalAttributes:l}=Yr(),u=M(()=>r.areFileExtensionsShown),c=M(()=>t("Show context menu")),d=M(()=>e.isEditor&&e.hasAutoSave&&i.options.editor.autosaveEnabled),p=M(()=>{const w=jt.Duration.fromObject({seconds:i.options.editor.autosaveInterval},{locale:n});return t("Autosave (every %{ duration })",{duration:w.toHuman()})}),m=M(()=>o(e.resource)),b=M(()=>!re.isPublicSpaceResource(f(m)));return(w,S)=>{const y=Ee("oc-icon"),g=Ee("oc-button"),v=Ee("oc-drop"),h=Ee("portal"),E=sn("oc-tooltip");return Y(),Te(h,{to:"app.runtime.header.left"},{default:ve(()=>[ue("div",j$,[ue("div",U$,[ue("div",V$,[e.resource?(Y(),Te(as,{key:0,id:"app-top-bar-resource",class:"[&_.oc-resource-name]:max-w-60 xs:[&_.oc-resource-name]:max-w-full sm:[&_.oc-resource-name]:max-w-20 md:[&_.oc-resource-name]:max-w-60 [&_svg]:!fill-role-on-chrome [&_span]:text-role-on-chrome","is-thumbnail-displayed":!1,"is-extension-displayed":u.value,"path-prefix":f(a)(e.resource),resource:e.resource,"parent-folder-name":f(s)(e.resource),"parent-folder-link-icon-additional-attributes":f(l)(e.resource),"is-path-displayed":b.value,"is-resource-clickable":!1},null,8,["is-extension-displayed","path-prefix","resource","parent-folder-name","parent-folder-link-icon-additional-attributes","is-path-displayed"])):ke("",!0)]),ue("div",q$,[e.dropDownMenuSections.length?(Y(),pe(je,{key:0},[it((Y(),Te(g,{id:"oc-openfile-contextmenu-trigger","aria-label":c.value,appearance:"raw-inverse","color-role":"chrome",class:"p-1"},{default:ve(()=>[me(y,{name:"more-2"})]),_:1},8,["aria-label"])),[[E,c.value]]),me(v,{"drop-id":"oc-openfile-contextmenu",mode:"click","padding-size":"small",toggle:"#oc-openfile-contextmenu-trigger","close-on-click":"",title:e.resource.name,onClick:S[0]||(S[0]=qt(()=>{},["stop","prevent"]))},{default:ve(()=>[me(rl,{"menu-sections":e.dropDownMenuSections,"action-options":e.dropDownActionOptions},null,8,["menu-sections","action-options"])]),_:1},8,["title"])],64)):ke("",!0),d.value&&!e.isReadOnly?(Y(),pe("span",z$,[it(me(y,{"accessible-label":p.value,name:"refresh",color:"white",class:"ox-p-xs mx-1"},null,8,["accessible-label"]),[[E,p.value]])])):ke("",!0),e.mainActions.length&&e.resource?(Y(),Te(rl,{key:2,"menu-sections":[{name:"main-actions",items:e.mainActions.filter(T=>T.isVisible()).map(T=>({...T,class:"p-1 text-role-on-chrome [&_svg]:!fill-role-on-chrome [&:hover:not(:disabled)_svg]:!fill-role-chrome",hideLabel:!0}))}],"action-options":{resources:[e.resource]},appearance:"raw-inverse","color-role":"chrome"},null,8,["menu-sections","action-options"])):ke("",!0),me(g,{id:"app-top-bar-close",appearance:"raw-inverse","color-role":"chrome",class:"p-1","aria-label":f(t)("Close"),onClick:S[1]||(S[1]=T=>w.$emit("close"))},{default:ve(()=>[me(y,{name:"close"})]),_:1},8,["aria-label"])])])])]),_:1})}}}),W$=Fe({name:"ErrorScreen",props:{message:{default:"",type:String,required:!1}}}),H$={class:"text-center flex justify-center items-center h-full"},K$={key:0,class:"text-xl"};function G$(e,t,n,r,i,o){const s=Ee("oc-icon");return Y(),pe("div",H$,[me(s,{size:"xxlarge",name:"error-warning","fill-type":"line"}),e.message?(Y(),pe("p",K$,q.toDisplayString(e.message),1)):ke("",!0)])}const Q$=Xe(W$,[["render",G$]]),X$=Fe({name:"LoadingScreen"}),Y$={class:"text-center flex justify-center items-center h-full"},J$=["textContent"];function Z$(e,t,n,r,i,o){const s=Ee("oc-spinner");return Y(),pe("div",Y$,[me(s,{size:"xlarge"}),ue("p",{class:"sr-only",textContent:q.toDisplayString(e.$gettext("Loading app"))},null,8,J$)])}const eM=Xe(X$,[["render",Z$]]),tM=["id","data-testid","tabindex","inert"],nM={key:0,class:"sidebar-panel__header header grid grid-cols-[auto_1fr_auto] items-center pt-2 px-2"},rM={class:"col-start-2 text-center my-0 text-lg"},iM={key:0,class:"mt-4"},dS=Xe(Fe({__name:"SideBar",props:{isOpen:{type:Boolean},loading:{type:Boolean},availablePanels:{},panelContext:{},activePanel:{default:""}},emits:["selectPanel","close"],setup(e,{emit:t}){const n=t,{$gettext:r}=Oe.useGettext(),i=An("appSideBar"),o=M(()=>e.availablePanels.filter(A=>A.isVisible(e.panelContext)&&A.isRoot?.(e.panelContext))),s=M(()=>e.availablePanels.filter(A=>A.isVisible(e.panelContext)&&!A.isRoot?.(e.panelContext))),a=M(()=>f(o).length?[f(o)[0],...f(s)]:f(s)),l=M(()=>{const A=e.activePanel?.split("#")[0];return!A||!f(s).map(D=>D.name).includes(A)?null:A}),u=M(()=>f(l)!==null),c=M(()=>f(l)===null),d=ae(null),p=A=>{d.value=A},m=M(()=>f(u)?f(l):f(o)[0].name),b=M(()=>f(o).length===1?r("Back to %{panel} panel",{panel:f(o)[0].title(e.panelContext)}):r("Back to main panels")),w=ae(window.innerWidth),S=M(()=>f(w)<=580),y=M(()=>f(i)?.parentElement?.querySelector("div")),g=()=>{if(!f(y))return;const A=f(S)?"hidden":"visible";f(y).style.visibility=A},v=()=>{e.isOpen&&(w.value=window.innerWidth,g())};ot(()=>e.isOpen,async A=>{A&&(await Vt(),g())},{immediate:!0});const h=A=>{n("selectPanel",A)},E=()=>{n("selectPanel",null)},T=()=>{n("close")},R=A=>{p(f(m)),h(A)},C=()=>{p(f(m)),E(),f(i).focus()};return $t(()=>{window.addEventListener("resize",v)}),xn(()=>{window.removeEventListener("resize",v),f(y)&&(f(y).style.visibility="visible")}),(A,D)=>{const V=Ee("oc-spinner"),O=Ee("oc-icon"),N=Ee("oc-button"),W=sn("oc-tooltip");return Y(),pe("div",{id:"app-sidebar",ref_key:"appSideBar",ref:i,"data-testid":"app-sidebar",tabindex:"-1",class:q.normalizeClass(["border-l focus:outline-0 focus-visible:outline-0 w-[440px] min-w-[440px] overflow-hidden relative focus:shadow-none focus-visible:shadow-none",{"flex justify-center items-center":e.loading,"w-full min-w-full":S.value}])},[e.loading?(Y(),Te(V,{key:0})):(Y(!0),pe(je,{key:1},dt(a.value,L=>(Y(),pe("div",{id:`sidebar-panel-${L.name}`,key:`panel-${L.name}`,"data-testid":`sidebar-panel-${L.name}`,tabindex:m.value===L.name?-1:null,class:q.normalizeClass(["sidebar-panel absolute top-0 grid grid-rows-[auto_auto_1fr] bg-role-surface rounded-r-xl w-full size-full max-w-full max-h-full overflow-hidden motion-reduce:transition-none",{"is-root-panel transition-[right] duration-[0.4s,0s]":L.isRoot?.(e.panelContext),"is-active-sub-panel":u.value&&l.value===L.name,"is-active-root-panel transition-[right] duration-[0.4s,0s]":c.value&&L.isRoot?.(e.panelContext)}]),inert:m.value!==L.name},[[m.value,d.value].includes(L.name)?(Y(),pe("div",nM,[L.isRoot?.(e.panelContext)?ke("",!0):it((Y(),Te(N,{key:0,class:"header__back col-start-1 p-1",appearance:"raw","aria-label":b.value,onClick:C},{default:ve(()=>[me(O,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"])),[[W,b.value]]),ue("h2",rM,q.toDisplayString(L.title(e.panelContext)),1),me(N,{appearance:"raw",class:"header__close col-start-3 p-1","aria-label":f(r)("Close file sidebar"),onClick:T},{default:ve(()=>[me(O,{name:"close"})]),_:1},8,["aria-label"])])):ke("",!0),ue("div",null,[L.isRoot?.(e.panelContext)?Ve(A.$slots,"rootHeader",{key:0},void 0,!0):Ve(A.$slots,"subHeader",{key:1},void 0,!0)]),ue("div",{class:q.normalizeClass(["sidebar-panel__body flex flex-col p-2 overflow-y-auto overflow-x-hidden",[`sidebar-panel__body-${L.name}`]])},[ue("div",{class:q.normalizeClass(["sidebar-panel__body-content",{"flex-1 ":!L.isRoot?.(e.panelContext)}])},[Ve(A.$slots,"body",{},()=>[(Y(!0),pe(je,null,dt(L.isRoot?.(e.panelContext)?o.value:[L],(ee,J)=>(Y(),pe("div",{key:`sidebar-panel-${ee.name}`},[(c.value?ee.isRoot?.(e.panelContext):[m.value,d.value].includes(ee.name))?(Y(),Te(On(ee.component),Mt({key:0,class:[{"multi-root-panel-separator mt-4 pt-2 border-t":J>0},"rounded-sm"]},{ref_for:!0},ee.componentAttrs?.(e.panelContext)||{}),null,16,["class"])):ke("",!0)]))),128))],!0)],2),L.isRoot?.(e.panelContext)&&s.value.length>0?(Y(),pe("div",iM,[(Y(!0),pe(je,null,dt(s.value,ee=>(Y(),Te(N,{id:`sidebar-panel-${ee.name}-select`,key:`panel-select-${ee.name}`,"data-testid":`sidebar-panel-${ee.name}-select`,appearance:"raw-inverse","color-role":"surface",class:"!grid !grid-cols-[auto_1fr_auto] text-left px-2 w-full h-12",onClick:J=>R(ee.name)},{default:ve(()=>[me(O,{name:ee.icon,"fill-type":ee.iconFillType},null,8,["name","fill-type"]),kt(" "+q.toDisplayString(ee.title(e.panelContext))+" ",1),me(O,{name:"arrow-right-s","fill-type":"line"})]),_:2},1032,["id","data-testid","onClick"]))),128))])):ke("",!0)],2)],10,tM))),128))],2)}}}),[["__scopeId","data-v-b2b7e1e8"]]),oM=Fe({name:"SpaceInfo",setup(){return{resource:Sr("resource")}}}),sM={class:"grid items-center p-2"},aM={class:"flex items-center text-sm"},lM={class:"mr-2"},cM=["textContent"],uM=["textContent"];function fM(e,t,n,r,i,o){const s=Ee("oc-icon");return Y(),pe("div",sM,[ue("div",aM,[ue("div",lM,[me(s,{name:"layout-grid",size:e.resource.description?"large":"medium",class:"block"},null,8,["size"])]),ue("div",null,[ue("h3",{"data-testid":"space-info-name",class:"font-semibold m-0 text-base",textContent:q.toDisplayString(e.resource.name)},null,8,cM),ue("span",{"data-testid":"space-info-subtitle",textContent:q.toDisplayString(e.resource.description)},null,8,uM)])])])}const Vd=Xe(oM,[["render",fM]]),dM={class:"flex justify-between p-2"},pM={class:"flex items-center"},hM={"data-testid":"files-info-name",class:"font-semibold m-0 text-base break-all"},qd=Fe({__name:"FileInfo",props:{isSubPanelActive:{type:Boolean,default:!0}},setup(e){const t=We(),{isPersonalSpaceRoot:n}=ln(),r=Sr("resource"),i=Sr("space"),o=M(()=>t.areFileExtensionsShown),s=M(()=>n(f(r))?f(i).name:f(r).name);return(a,l)=>(Y(),pe("div",dM,[ue("div",pM,[e.isSubPanelActive?(Y(),Te(ss,{key:0,resource:f(r),size:"large",class:"mr-2 relative"},null,8,["resource"])):ke("",!0),ue("div",null,[ue("h3",hM,[me(Od,{name:s.value,extension:f(r).extension,type:f(r).type,"full-path":f(r).webDavPath,"is-extension-displayed":o.value,"is-path-displayed":!1,"truncate-name":!1},null,8,["name","extension","type","full-path","is-extension-displayed"])])])])]))}}),pS=Fe({__name:"FileSideBar",props:{isOpen:{type:Boolean},activePanel:{default:()=>{}},space:{default:()=>{}}},setup(e){const t=ze(),n=He(),r=Ki(),i=fr(),o=st(),s=kr(),a=ut(),l=lr(),{canListShares:u}=D0(),{canListVersions:c}=Z0(),d=We(),{currentFolder:p}=Me.storeToRefs(d),m=ae(),b=ae([]),w=ae([]),S=ae([]),{selectedResources:y}=Ud(),g=ae(!1),v=M(()=>f(g)),h=M(()=>f(y).length===0?{root:e.space,parent:null,items:f(p)?.id?[f(p)]:[]}:{root:e.space,parent:f(p),items:f(y)}),E=Yn(Bt,"files-shares-with-me"),T=Yn(Bt,"files-shares-with-others"),R=Yn(Bt,"files-shares-via-link"),C=pt(t,"files-spaces-projects"),A=Yn(It,"files-common-favorites"),D=Yn(It,"files-common-search"),V=()=>{i.publish(Ct.close)},O=X=>{i.publish(Ct.setActivePanel,X)},N=M(()=>f(h).items?.length===1&&!re.isProjectSpaceResource(f(h).items[0])),W=M(()=>f(h).items?.length===1&&re.isProjectSpaceResource(f(h).items[0])),L=M(()=>f(E)||f(T)||f(R)),ee=M(()=>f(L)||f(D)||f(A)),J=M(()=>r.requestExtensions({id:"global.files.sidebar",extensionType:"sidebarPanel"}).map(X=>X.panel)),se=rn.useTask(function*(X,ie){b.value=yield n.webdav.listFileVersions(ie.id,{signal:X})}),he=rn.useTask(function*(X,ie){s.setLoading(!0),s.removeOrphanedShares();const{collaboratorShares:le,linkShares:Ae}=s,te=n.graphAuthenticated.permissions;let F=e.space?.id;if(re.isShareSpaceResource(e.space)){const $e=yield o.getMountPointForSpace({graphClient:n.graphAuthenticated,space:e.space,signal:X});$e&&(F=$e.root.remoteItem.rootId)}const{shares:x,allowedRoles:G}=yield*re.call(te.listPermissions(F,ie.fileId,s.graphRoles,{},{signal:X})),H=x.filter(re.isCollaboratorShare),B=x.filter(re.isLinkShare),z=Object.values(s.graphRoles);if(w.value=G?.map($e=>({...$e,icon:z.find(ye=>ye.id===$e.id)?.icon}))||[],l.isAppEnabled("open-cloud-mesh")){const{allowedRoles:$e}=yield*re.call(te.listPermissions(F,ie.fileId,s.graphRoles,{filter:`@libre.graph.permissions.roles.allowedValues/rolePermissions/any(p:contains(p/condition, '@Subject.UserType=="Federated"'))`,select:[$b.LibreGraphPermissionsRolesAllowedValues]},{signal:X}));S.value=$e?.map(ye=>({...ye,icon:z.find(Ke=>Ke.id===ye.id)?.icon}))||[]}!f(ee)&&!f(C)&&(le.forEach($e=>{H.some(ye=>ye.id===$e.id)||H.push({...$e,indirect:!0})}),Ae.forEach($e=>{B.some(ye=>ye.id===$e.id)||B.push({...$e,indirect:!0})})),It(t,"files-common-search")&&(yield d.loadAncestorMetaData({folder:f(ie),space:e.space,client:n.webdav,signal:X}));const Re=[...le,...Ae].map(({resourceId:$e})=>$e),De=Object.values(d.ancestorMetaData).filter(({id:$e,path:ye})=>$e===ie.id||Re.includes($e)||re.isIncomingShareResource(ie)?!1:re.isPersonalSpaceResource(e.space)?ye!=="/":!0).map(({id:$e})=>$e);f(ee)&&re.isProjectSpaceResource(e.space)&&!re.isProjectSpaceResource(ie)&&De.push(e.space.id);const Ce=new Lr({concurrency:a.options.concurrentRequests.shares.list}),Ie=[...new Set(De)].map($e=>Ce.add(()=>n.graphAuthenticated.permissions.listPermissions(F,$e,s.graphRoles,{},{signal:X}).then(ye=>{const Ke=ye.shares.map(Ge=>({...Ge,indirect:!0}));H.push(...Ke.filter(re.isCollaboratorShare)),B.push(...Ke.filter(re.isLinkShare))})));yield Promise.allSettled(Ie),s.setCollaboratorShares(H),s.setLinkShares(B),s.setLoading(!1)}).restartable(),oe=ae();ot(()=>[...f(h).items,e.isOpen],async(X,ie)=>{if(f(h).items?.length!==1)return;if(!e.isOpen){oe.value=void 0,b.value=[];return}const le=X?.[0],Ae=ie?.[0];if(le?.id===Ae?.id&&le?.mdate===f(oe))return;const te=f(h).items[0];if(oe.value=te.mdate,se.isRunning&&se.cancelAll(),!!c({space:e.space,resource:te}))try{await se.perform(te)}catch(F){console.error(F)}},{immediate:!0,deep:!0});const we=M(()=>f(h).items.map(X=>X.id));return ot(()=>[we,e.isOpen],async()=>{if(!e.isOpen||!f(h).items?.length){s.pruneShares(),m.value=null;return}if(f(h).items?.length!==1)return;const X=f(h).items[0];if(g.value=!0,re.isProjectSpaceResource(X)&&await o.loadGraphPermissions({ids:[X.id],graphClient:n.graphAuthenticated}),u({space:e.space,resource:X}))try{he.isRunning&&he.cancelAll(),he.perform(X)}catch(ie){console.error(ie)}if(!re.isOutgoingShareResource(X)&&!re.isIncomingShareResource(X)){m.value=X,g.value=!1;return}try{const ie=await n.webdav.getFileInfo(e.space,{path:X.path}),le={...ie,...X,tags:ie.tags};m.value=le}catch(ie){m.value=X,console.error(ie)}g.value=!1},{deep:!0,immediate:!0}),ni("resource",nr(m)),ni("versions",nr(b)),ni("space",M(()=>e.space)),ni("activePanel",M(()=>e.activePanel)),ni("availableInternalShareRoles",nr(w)),ni("availableExternalShareRoles",nr(S)),ni("versionsLoading",M(()=>se.isRunning)),(X,ie)=>e.isOpen?(Y(),Te(dS,Mt({key:0,ref:"sidebar",class:"files-side-bar z-30","is-open":e.isOpen,"active-panel":e.activePanel,"available-panels":J.value,"panel-context":h.value,loading:v.value},X.$attrs,{"data-custom-key-bindings-disabled":"true",onSelectPanel:O,onClose:V}),{rootHeader:ve(()=>[N.value?(Y(),Te(qd,{key:0,class:"px-2 pt-2","is-sub-panel-active":!1})):W.value?(Y(),Te(Vd,{key:1})):ke("",!0)]),subHeader:ve(()=>[N.value?(Y(),Te(qd,{key:0,class:"px-2 pt-2","is-sub-panel-active":!0})):W.value?(Y(),Te(Vd,{key:1})):ke("",!0)]),_:1},16,["is-open","active-panel","available-panels","panel-context","loading"])):ke("",!0)}}),mM=Fe({name:"DatePickerModal",props:{modal:{type:Object,required:!0},currentDate:{type:Object,required:!1,default:null},minDate:{type:Object,required:!1,default:null},isClearable:{type:Boolean,default:!0}},emits:["confirm","cancel"],setup(){const e=ur(),{currentTheme:t}=Me.storeToRefs(e),n=ae(),r=ae(!0);return{confirmDisabled:r,onDateChanged:({date:o,error:s})=>{r.value=s||!o,n.value=o},currentTheme:t,dateTime:n}}}),gM={class:"flex justify-end items-center mt-2"};function yM(e,t,n,r,i,o){const s=Ee("oc-datepicker"),a=Ee("oc-button");return Y(),pe(je,null,[me(s,{label:e.$gettext("Expiration date"),type:"date","min-date":e.minDate,"current-date":e.currentDate,"is-clearable":e.isClearable,"is-dark":e.currentTheme.isDark,"required-mark":"",onDateChanged:e.onDateChanged},null,8,["label","min-date","current-date","is-clearable","is-dark","onDateChanged"]),ue("div",gM,[me(a,{class:"oc-modal-body-actions-cancel ml-2",onClick:t[0]||(t[0]=l=>e.$emit("cancel"))},{default:ve(()=>[kt(q.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),me(a,{disabled:e.confirmDisabled,class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:t[1]||(t[1]=l=>e.$emit("confirm",e.dateTime))},{default:ve(()=>[kt(q.toDisplayString(e.$gettext("Confirm")),1)]),_:1},8,["disabled"])])],64)}const vM=Xe(mM,[["render",yM]]),bM=Fe({name:"UnsavedChangesModal",props:{modal:{type:Object,required:!0},closeCallback:{type:Function,required:!0}},emits:["cancel","confirm"],setup(e){const{removeModal:t}=ft();return{onClose:()=>{t(e.modal.id),e.closeCallback()}}}}),wM=["textContent"],SM={class:"flex justify-end items-center mt-4"},EM={class:"oc-modal-body-actions-grid"};function TM(e,t,n,r,i,o){const s=Ee("oc-button");return Y(),pe(je,null,[ue("span",{class:"inline-block mb-4",textContent:q.toDisplayString(e.$gettext("Your changes were not saved. Do you want to save them?"))},null,8,wM),t[2]||(t[2]=ue("div",{class:"my-4"},null,-1)),ue("div",SM,[ue("div",EM,[me(s,{class:"oc-modal-body-actions-cancel ml-2",onClick:t[0]||(t[0]=a=>e.$emit("cancel"))},{default:ve(()=>[kt(q.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),me(s,{class:"oc-modal-body-actions-secondary ml-2",onClick:e.onClose},{default:ve(()=>[kt(q.toDisplayString(e.$gettext("Don't Save")),1)]),_:1},8,["onClick"]),me(s,{class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:t[1]||(t[1]=a=>e.$emit("confirm"))},{default:ve(()=>[kt(q.toDisplayString(e.$gettext("Save")),1)]),_:1})])])],64)}const hS=Xe(bM,[["render",TM]]);var AM=/\s/;function xM(e){for(var t=e.length;t--&&AM.test(e.charAt(t)););return t}var CM=/^\s+/;function RM(e){return e&&e.slice(0,xM(e)+1).replace(CM,"")}var mS=NaN,kM=/^[-+]0x[0-9a-f]+$/i,PM=/^0b[01]+$/i,IM=/^0o[0-7]+$/i,OM=parseInt;function FM(e){if(typeof e=="number")return e;if(Qs(e))return mS;if(ir(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ir(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=RM(e);var n=PM.test(e);return n||IM.test(e)?OM(e.slice(2),n?2:8):kM.test(e)?mS:+e}const _M=["id"],DM=["textContent"],NM={key:3,class:"flex size-full"},gS=Fe({__name:"AppWrapper",props:{applicationId:{},urlForResourceOptions:{default:null},fileContentOptions:{default:null},wrappedComponent:{default:null},importResourceWithExtension:{type:Function,default:()=>null},disableAutoSave:{type:Boolean,default:!1}},setup(e){const{$gettext:t,current:n}=Oe.useGettext(),r=lr(),{showMessage:i,showErrorMessage:o}=tt(),s=ps.useRouter(),a=zt(),l=He(),u=yn(),{getResourceContext:c}=eS(),{selectedResources:d}=Ud(),{dispatchModal:p}=ft(),m=st(),b=ut(),w=We(),S=kr(),y=fr(),{isSideBarOpen:g,sideBarActivePanel:v}=Sa(),{actions:h}=k0({appId:e.applicationId}),{actions:E}=sd(),{actions:T}=cs(),{actions:R}=Nd(),{actions:C}=Ld(),{actions:A}=ls(),D=M(()=>!!e.wrappedComponent.emits?.includes("update:resource")),V=ae(),O=ae(),N=ae(""),W=ae(""),L=ae(!f(D)),ee=ae(),J=ae(!1),se=ae(),he=ae();let oe="",we=null;const{actions:X}=O0({content:he}),ie=M(()=>!!e.wrappedComponent.emits?.includes("update:currentContent")),le=Le=>!!Object.keys(e.wrappedComponent.props).includes(Le),Ae=M(()=>f(he)!==f(se)),te=Le=>{Le.preventDefault()};ot(Ae,Le=>{Le?window.addEventListener("beforeunload",te):window.removeEventListener("beforeunload",te)});const{applicationConfig:F,closeApp:x,currentFileContext:G,getFileContents:H,getFileInfo:B,getUrlForResource:z,putFileContents:ge,replaceInvalidFileRoute:Re,revokeUrl:De,activeFiles:Ce,loadFolderForFileContext:Ie,isFolderLoading:$e}=rw({applicationId:e.applicationId}),{applicationMeta:ye}=id({applicationId:e.applicationId,appsStore:r}),Ke=M(()=>f(ye).meta?.fileSizeLimit),Ge=M(()=>{const{name:Le}=f(ye);return t("%{appName} for %{fileName}",{appName:t(Le),fileName:f(f(G).fileName)})}),Ye=xa("driveAliasAndItem"),Ze=en("fileId"),wt=M(()=>Rt(f(Ze))),St=async()=>{const Le=f(wt),{space:Ue,path:yt}=await c(Le),j=Ue.getDriveAliasAndItem({path:yt});return re.isPersonalSpaceResource(Ue)?s.push({params:{...f(a).params,driveAliasAndItem:j},query:{...f(a).query,fileId:Le,contextRouteName:"files-spaces-generic",contextRouteParams:{driveAliasAndItem:ct.dirname(j)}}}):s.push({params:{...f(a).params,driveAliasAndItem:j},query:{...f(a).query,fileId:Le,contextRouteName:yt==="/"?"files-shares-with-me":"files-spaces-generic",...re.isShareSpaceResource(Ue)&&{shareId:Ue.id},contextRouteParams:{driveAliasAndItem:ct.dirname(j)},contextRouteQuery:{...re.isShareSpaceResource(Ue)&&{shareId:Ue.id}}}})},Et=rn.useTask(function*(Le){try{f(Ye)||(yield St()),O.value=f(f(G).space);const Ue=yield B(f(G),{signal:Le});if(V.value=Ue,re.isShareSpaceResource(f(O))&&(f(V).remoteItemId=f(O).id,f(V).id===f(V).remoteItemId)){const yt=yield*re.call(Gs({graphClient:l.graphAuthenticated,spacesStore:m,space:f(O)}));yt&&(V.value={...Ue,...re.buildIncomingShareResource({graphRoles:S.graphRoles,driveItem:yt,serverUrl:b.serverUrl}),tags:Ue.tags})}w.initResourceList({currentFolder:null,resources:[f(V)]}),d.value=[f(V)]}catch(Ue){console.error(Ue),ee.value=Ue,L.value=!1}}).restartable(),Tt=rn.useTask(function*(Le){try{const Ue=e.importResourceWithExtension(f(V));if(Ue){const yt=jt.DateTime.local().toFormat("yyyyMMddHHmmss"),j=`${f(V).name}_${yt}.${Ue}`;if(!(yield l.webdav.copyFiles(f(O),f(V),f(O),{path:j},{signal:Le})))throw new Error(t("Importing failed"));V.value={path:j}}if(Re(G,f(V)))return;if(J.value=![xm.Updateable,xm.FileUpdateable].some(yt=>(f(V).permissions||"").indexOf(yt)>-1),f(le("currentContent"))){const yt=yield*re.call(H(G,{...e.fileContentOptions,signal:Le}));se.value=he.value=yt.body,N.value=yt.headers["OC-ETag"]}f(le("url"))&&(W.value=yield z(f(O),f(V),{...e.urlForResourceOptions,signal:Le}))}catch(Ue){console.error(Ue),ee.value=Ue}finally{L.value=!1}}).restartable();ot(G,async()=>{f(D)?O.value=f(f(G).space):(await Et.perform(),f(Ke)&&FM(f(V).size)>f(Ke)?p({title:t("File exceeds %{threshold}",{threshold:bn(f(Ke),n)}),message:t("%{resource} exceeds the recommended size of %{threshold} for editing, and may cause performance issues.",{resource:f(V).name,threshold:bn(f(Ke),n)}),confirmText:t("Continue"),onCancel:()=>{x()},onConfirm:()=>{Tt.perform()}}):Tt.perform())},{immediate:!0});const at=Le=>{console.error(Le),o({title:t("An error occurred"),desc:Le.message,errors:[Le]})},vn=()=>{i({title:t("File autosaved")})},U=rn.useTask(function*(){const Le=f(he);try{const Ue=yield ge(G,{content:Le,previousEntityTag:f(N)});se.value=Le,N.value=Ue.etag,w.upsertResource(Ue)}catch(Ue){switch(Ue.statusCode){case 401:case 403:at(new re.HttpError(t("You're not authorized to save this file"),Ue.response));break;case 409:case 412:at(new re.HttpError(t("This file was updated outside this window. Please refresh the page (all changes will be lost)."),Ue.response));break;case 507:const yt=m.spaces.find(j=>j.id===f(V).storageId&&re.isProjectSpaceResource(j));if(yt){at(new re.HttpError(t('Insufficient quota on "%{spaceName}" to save this file',{spaceName:yt.name}),Ue.response));break}at(new re.HttpError(t("Insufficient quota for saving this file"),Ue.response));break;default:at(new re.HttpError("",Ue.response))}}}).drop(),k=async()=>{await U.perform()};let P=null;$t(()=>{if(oe=y.subscribe("runtime.resource.deleted",_e),w.ancestorMetaData?.["/"]&&f(O)&&w.ancestorMetaData["/"].spaceId!==f(O).id&&w.setAncestorMetaData({}),!f(ie))return;const Le=b.options.editor;Le.autosaveEnabled&&!e.disableAutoSave&&(P=setInterval(async()=>{Ae.value&&(await k(),vn())},(Le.autosaveInterval||120)*1e3))}),xn(()=>{y.unsubscribe("runtime.resource.deleted",oe),u.isLoading||window.removeEventListener("beforeunload",te),f(le("url"))&&De(W.value),f(ie)&&(clearInterval(P),P=null)});const{bindKeyAction:Q}=Fa({skipDisabledKeyBindingsCheck:!0});Q({modifier:Oa.Ctrl,primary:dr.S},()=>{f(Ae)&&k()});const K=M(()=>[{name:"save-file",disabledTooltip:()=>"",isVisible:()=>f(ie)&&!f(J),isDisabled:()=>!f(Ae),icon:"save",id:"app-save-action",label:()=>t("Save"),handler:k}]),ne=M(()=>({space:f(O),resources:[f(V)]})),de=async(Le,Ue)=>{f(Ae)&&(await k(),vn()),Ue(Le)},_e=Le=>{if(Le.find(yt=>yt.id===f(V).id)){if(we)return we();x()}},Ne=M(()=>[...f(h),...f(K),...f(X).map(Le=>({...Le,isVisible:Ue=>ie.value&&Le.isVisible(Ue)}))].filter(Le=>Le.isVisible(f(ne)))),xe=M(()=>[...f(C),...f(E)].filter(Le=>Le.isVisible(f(ne)))),Be=M(()=>[...f(T).map(Le=>({...Le,handler:Ue=>de(Ue,Le.handler)})),...f(A)].filter(Le=>Le.isVisible(f(ne)))),Qe=M(()=>[...f(R)].filter(Le=>Le.isVisible(f(ne)))),nn=M(()=>{const Le=[];return f(Ne).length&&Le.push({name:"context",items:f(Ne)}),f(xe).length&&Le.push({name:"share",items:f(xe)}),f(Be).length&&Le.push({name:"actions",items:f(Be)}),f(Qe).length&&Le.push({name:"sidebar",items:f(Qe)}),Le}),Ut=M(()=>[...f(K)]);ps.onBeforeRouteLeave((Le,Ue,yt)=>{f(Ae)?p({title:t("Unsaved changes"),customComponent:hS,focusTrapInitial:".oc-modal-body-actions-confirm",hideActions:!0,customComponentAttrs:()=>({closeCallback:()=>{yt()}}),async onConfirm(){await k(),yt()}}):yt()});const Nr=M(()=>({url:f(W),space:f(f(G).space),resource:f(V),activeFiles:f(Ce),isDirty:f(Ae),isReadOnly:f(J),applicationConfig:f(F),currentFileContext:f(G),currentContent:f(he),isFolderLoading:f($e),"onUpdate:resource":Le=>{O.value=f(f(G).space),V.value={...Le,...re.isShareSpaceResource(f(O))&&{remoteItemId:f(O).id}},d.value=[f(V)]},"onUpdate:currentContent":Le=>{he.value=Le},"onRegister:onDeleteResourceCallback":Le=>{we=Le},"onDelete:resource":()=>{f(A)[0].isVisible({space:f(O),resources:[f(V)]})&&f(A)[0].handler({space:f(O),resources:[f(V)]})},onSave:k,onClose:x,loadFolderForFileContext:Ie,revokeUrl:De,getUrlForResource:z}));return(Le,Ue)=>(Y(),pe("main",{id:e.applicationId,class:"app-wrapper h-full",onKeydown:Ue[0]||(Ue[0]=wo((...yt)=>f(x)&&f(x)(...yt),["esc"]))},[ue("h1",{class:"sr-only",textContent:q.toDisplayString(Ge.value)},null,8,DM),!L.value&&!ee.value&&V.value?(Y(),Te(fS,{key:0,"main-actions":Ut.value,"drop-down-menu-sections":nn.value,"drop-down-action-options":ne.value,"has-auto-save":!e.disableAutoSave,"is-editor":ie.value,resource:V.value,"is-read-only":J.value,onClose:f(x)},null,8,["main-actions","drop-down-menu-sections","drop-down-action-options","has-auto-save","is-editor","resource","is-read-only","onClose"])):ke("",!0),L.value?(Y(),Te(eM,{key:1})):ee.value?(Y(),Te(Q$,{key:2,message:ee.value.message},null,8,["message"])):(Y(),pe("div",NM,[Ve(Le.$slots,"default",Mt({class:["app-wrapper-content size-full",{"w-[calc(100%-440px)] hidden xs:block":f(g)}]},Nr.value)),me(pS,{"is-open":f(g),"active-panel":f(v),space:O.value},null,8,["is-open","active-panel","space"])]))],40,_M))}});function LM(e,t){return Fe({render(){return $l(gS,{wrappedComponent:e,...t},{default:n=>$l(e,n)})}})}const zd=Fe({__name:"ContextMenuQuickAction",props:{item:{},resourceDomSelector:{type:Function,default:e=>re.extractDomSelector(e.id)},title:{default:""}},emits:["quickActionClicked"],setup(e){const{$gettext:t}=Oe.useGettext(),n=M(()=>t("Show context menu"));return(r,i)=>{const o=Ee("oc-icon"),s=Ee("oc-drop"),a=Ee("oc-button"),l=sn("oc-tooltip");return it((Y(),Te(a,{id:`context-menu-trigger-${e.resourceDomSelector(e.item)}`,"data-test-context-menu-resource-name":e.item.name,"aria-label":n.value,appearance:"raw",class:"quick-action-button ml-1 p-1",onClick:i[0]||(i[0]=qt(u=>r.$emit("quickActionClicked",{event:u,dropdown:r.$refs[`context-menu-drop-ref-${e.resourceDomSelector(e.item)}`]}),["stop","prevent"]))},{default:ve(()=>[me(o,{name:"more-2"}),me(s,{ref:`context-menu-drop-ref-${e.resourceDomSelector(e.item)}`,"drop-id":`context-menu-drop-${e.resourceDomSelector(e.item)}`,toggle:`#context-menu-trigger-${e.resourceDomSelector(e.item)}`,title:e.title,position:"bottom-end",mode:"click","padding-size":"small","close-on-click":""},{default:ve(()=>[Ve(r.$slots,"contextMenu",{item:e.item})]),_:3},8,["drop-id","toggle","title"])]),_:3},8,["id","data-test-context-menu-resource-name","aria-label"])),[[l,n.value]])}}}),$M=Fe({name:"ResourceGhostElement",components:{ResourceIcon:ss},props:{previewItems:{type:Array,required:!0}},computed:{layerCount(){return Math.min(this.previewItems.length,3)},showSecondLayer(){return this.layerCount>1},showThirdLayer(){return this.layerCount>2},itemCount(){return this.previewItems.length}}}),MM={id:"ghost-element",class:"z-[var(--z-index-modal)] absolute pt-1 pl-4 bg-transparent"},BM={class:"relative rounded-sm bg-role-surface-container-high"},jM={key:0,class:"-z-10 absolute top-[3px] left-[3px] right-[-3px] bottom-[-3px] rounded-sm bg-role-surface-container-high brightness-82"},UM={key:1,class:"-z-20 absolute top-[6px] left-[6px] right-[-6px] bottom-[-6px] rounded-sm bg-role-surface-container-high brightness-72"},VM={class:"badge absolute top-[-2px] right-[-8px] p-1 text-sm text-center leading-2 bg-red-600 text-white rounded-4xl box-content min-w-2 h-2"};function qM(e,t,n,r,i,o){const s=Ee("resource-icon");return Y(),pe("div",MM,[ue("div",BM,[me(s,{class:"p-1",resource:e.previewItems[0]},null,8,["resource"]),e.showSecondLayer?(Y(),pe("div",jM)):ke("",!0),e.showThirdLayer?(Y(),pe("div",UM)):ke("",!0)]),ue("span",VM,q.toDisplayString(e.itemCount),1)])}const Wd=Xe($M,[["render",qM]]),zM=Fe({name:"ResourceSize",props:{size:{type:[String,Number],required:!0}},setup:e=>{const{current:t}=Oe.useGettext();return{formattedSize:M(()=>bn(e.size,t))}}}),WM=["textContent"];function HM(e,t,n,r,i,o){return Y(),pe("span",{textContent:q.toDisplayString(e.formattedSize)},null,8,WM)}const yS=Xe(zM,[["render",HM]]),vS=Fe({__name:"ResourceStatusIndicators",props:{resource:{},space:{default:()=>{}},filter:{type:Function,default:void 0}},setup(e){const t=_l(),n=gt(),r=We(),{interceptModifierClick:i}=gi(),o=M(()=>{const s=cb({space:e.space,resource:e.resource,ancestorMetaData:r.ancestorMetaData,user:n.user,interceptModifierClick:i});return e.filter?s.filter(e.filter):s});return(s,a)=>o.value.length>0?(Y(),Te(f(LN),Mt({key:0},f(t),{indicators:o.value,resource:e.resource}),null,16,["indicators","resource"])):ke("",!0)}}),il=Fe({__name:"UserAvatar",props:{userId:{},userName:{}},setup(e){const t=Ta(),{avatarMap:n}=Me.storeToRefs(t),{enqueueAvatar:r}=sS(),i=M(()=>f(n)[e.userId]);return $t(()=>{r(e.userId)}),(o,s)=>{const a=Ee("oc-avatar");return Y(),Te(a,{"user-name":e.userName,src:i.value,width:36},null,8,["user-name","src"])}}}),KM={class:q.normalizeClass(["[&_.cropper-crop-box]:!outline-1","[&_.cropper-crop-box]:!outline-role-outline","[&_.cropper-view-box]:!rounded-[50%]","[&_.cropper-crop-box]:!rounded-[50%]","[&_.cropper-line]:!bg-role-outline","[&_.cropper-point]:!bg-role-outline"])},GM={class:"flex flex-col items-center"},QM={class:"oc-button-group"},XM={key:0},YM=["src"],JM={class:"text-sm text-role-on-surface-variant flex items-center mt-1"},ZM=["textContent"],eB=Fe({__name:"AvatarUpload",setup(e){const t=gt(),n=Ta(),{avatarMap:r}=Me.storeToRefs(n),{user:i}=Me.storeToRefs(t),{$gettext:o}=Oe.useGettext(),{showErrorMessage:s,showMessage:a}=tt(),{graphAuthenticated:l}=He(),{setCropperInstance:u}=od(),c=ae(null),d=ae(null),p=ae(null),m=ae(!1),b=ae(!1),w=ae(!1),S=ae(null),y=Pd*1024*1024,g=M(()=>!!f(r)[f(i).id]),v=V=>{const N=V.target.files?.[0];if(N){if(N.size>y){s({title:o("File size exceeds the limit of %{size}MB",{size:Pd.toString()})});return}c.value=URL.createObjectURL(N),b.value=!0}};ot(c,async V=>{V&&(await Vt(),p.value&&p.value.destroy(),d.value&&(p.value=new ol(d.value,{aspectRatio:1,viewMode:1,dragMode:"move",autoCropArea:.8,responsive:!0,background:!1,ready(){m.value=!0}}),u(p)))});const h=()=>p.value.getCroppedCanvas({width:256,height:256,imageSmoothingQuality:"high"}),E=async V=>await new Promise(O=>{V.toBlob(N=>O(N),"image/png")}),T=()=>{S.value?.click()},R=()=>{b.value=!1,D()},C=async()=>{const V=h(),O=await E(V),N=URL.createObjectURL(O),W=new File([O],"avatar.png",{type:"image/png",lastModified:Date.now()});try{await l.photos.updateOwnUserPhotoPatch(W),n.addAvatar(f(i).id,N),a({title:o("Profile picture was set successfully")})}catch(L){s({title:o("Failed to set profile picture"),errors:[L]})}b.value=!1,D()},A=async()=>{try{await l.photos.deleteOwnUserPhoto(),n.removeAvatar(f(i).id),a({title:o("Profile picture was removed successfully")})}catch(V){s({title:o("Failed to remove profile picture"),errors:[V]})}w.value=!1},D=()=>{p.value?.destroy(),p.value=null,S.value&&(S.value.value=""),c.value=null};return(V,O)=>{const N=Ee("oc-button"),W=Ee("oc-icon"),L=Ee("oc-modal");return Y(),pe("div",KM,[ue("input",{ref_key:"fileInputRef",ref:S,class:"invisible avatar-file-input",type:"file",accept:"image/jpeg, image/png",onChange:v},null,544),ue("div",GM,[me(il,{class:"mb-4",width:128,"user-id":f(i).id,"user-name":f(i).displayName},null,8,["user-id","user-name"]),ue("div",null,[ue("div",QM,[me(N,{size:"small",onClick:T},{default:ve(()=>[kt(q.toDisplayString(f(o)("Upload")),1)]),_:1}),g.value?(Y(),Te(N,{key:0,class:"avatar-upload-remove-button",size:"small",onClick:O[0]||(O[0]=ee=>w.value=!0)},{default:ve(()=>[kt(q.toDisplayString(f(o)("Remove")),1)]),_:1})):ke("",!0)])])]),b.value?(Y(),Te(L,{key:0,title:f(o)("Crop your new profile picture"),"button-cancel-text":f(o)("Cancel"),"button-confirm-text":f(o)("Set"),"button-confirm-disabled":!m.value,"focus-trap-initial":!1,onCancel:R,onConfirm:C},{content:ve(()=>[c.value?(Y(),pe("div",XM,[ue("img",{ref_key:"imageRef",ref:d,class:"max-h-[400px]",src:c.value},null,8,YM),ue("div",JM,[me(W,{class:"mr-1",name:"information",size:"small","fill-type":"line"}),ue("span",{textContent:q.toDisplayString(f(o)("Zoom via %{ zoomKeys }, pan via %{ panKeys }",{zoomKeys:f(o)("+-"),panKeys:f(o)("↑↓←→")}))},null,8,ZM)])])):ke("",!0)]),_:1},8,["title","button-cancel-text","button-confirm-text","button-confirm-disabled"])):ke("",!0),w.value?(Y(),Te(L,{key:1,message:f(o)("Are you sure you want to remove your profile picture?"),title:f(o)("Remove profile picture"),"button-cancel-text":f(o)("Cancel"),"button-confirm-text":f(o)("Remove"),onCancel:O[1]||(O[1]=ee=>w.value=!1),onConfirm:A},null,8,["message","title","button-cancel-text","button-confirm-text"])):ke("",!0)])}}}),tB={class:"resource-table-select-all flex justify-center items-center"},nB={class:"truncate"},rB=["textContent"],iB=["textContent"],oB=["textContent"],sB={key:0,class:"flex items-center justify-end flex-row flex-nowrap"},aB=850,lB=Fe({__name:"ResourceTable",props:{resources:{},resourceDomSelector:{type:Function,default:e=>re.extractDomSelector(e.id)},arePathsDisplayed:{type:Boolean,default:!1},selectedIds:{default:()=>[]},hasActions:{type:Boolean,default:!0},showRenameQuickAction:{type:Boolean,default:!0},areResourcesClickable:{type:Boolean,default:!0},headerPosition:{default:0},isSelectable:{type:Boolean,default:!0},isSideBarOpen:{type:Boolean,default:!1},dragDrop:{type:Boolean,default:!1},viewMode:{default:()=>tn.defaultModeName},hover:{type:Boolean,default:!0},sortBy:{default:()=>{}},fieldsDisplayed:{default:()=>{}},sortDir:{default:()=>{}},space:{default:()=>{}},resourceType:{default:"file"},lazy:{type:Boolean,default:!0}},emits:["fileClick","sort","fileDropped","update:selectedIds","update:modelValue"],setup(e,{emit:t}){const n=t,r=ze(),i=Zt(),{getMatchingSpace:o}=ln(),{interceptModifierClick:s}=gi(),{getParentFolderLink:a,getParentFolderLinkIconAdditionalAttributes:l,getParentFolderName:u,getPathPrefix:c}=Yr({space:ae(e.space)}),{isSticky:d}=$d(),{$gettext:p,$ngettext:m,current:b}=Oe.useGettext(),{isLocationPicker:w,isFilePicker:S}=Qr(),{selectedResources:y,disabledResources:g,isResourceSelected:v,fileContainerClicked:h,fileNameClicked:E,fileCheckboxClicked:T,isResourceDisabled:R,isResourceInDeleteQueue:C,isResourceClickable:A,getResourceLink:D,dragItem:V,dragSelection:O,dragStart:N,fileDropped:W,setDropStyling:L,shouldShowContextDrop:ee,showContextMenuOnRightClick:J,showContextMenuOnBtnClick:se,selectAllCheckboxLabel:he,getResourceCheckboxLabel:oe,toggleSelectionAll:we,areAllResourcesSelected:X}=jd({space:M(()=>e.space),resources:M(()=>e.resources),selectedIds:M(()=>e.selectedIds),emit:n}),ie=qo(),{resources:le,action:Ae}=Me.storeToRefs(ie),te=li(),{userContextReady:F}=Me.storeToRefs(te),x=We(),{areFileExtensionsShown:G,latestSelectedId:H}=Me.storeToRefs(x),{width:B}=Vn.useWindowSize(),z=M(()=>i.filesTags&&B.value>=aB),{actions:ge}=Ja(),{actions:Re}=H0(),De=M(()=>f(ge)[0].handler),Ce=M(()=>f(Re)[0].handler),Ie=P=>p("Search for tag %{tag}",{tag:P}),$e=M(()=>{if(e.resources.length===0)return[];const P=e.resources[0],Q=[];e.isSelectable&&Q.push({name:"select",title:"",type:"slot",headerType:"slot",width:"shrink"});const K=bm(P);return Q.push(...[{name:"name",title:p("Name"),type:"slot",width:"expand",wrap:"truncate"},{name:"manager",prop:"members",title:p("Manager"),type:"slot"},{name:"members",title:p("Members"),prop:"members",type:"slot"},{name:"totalQuota",prop:"spaceQuota.total",title:p("Total quota"),type:"slot",sortable:!0},{name:"usedQuota",prop:"spaceQuota.used",title:p("Used quota"),type:"slot",sortable:!0},{name:"remainingQuota",prop:"spaceQuota.remaining",title:p("Remaining quota"),type:"slot",sortable:!0},{name:"indicators",title:p("Status"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"size",title:p("Size"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"syncEnabled",title:p("Info"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"tags",title:p("Tags"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedBy",title:p("Shared by"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedWith",title:p("Shared with"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"mdate",title:p("Modified"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:ne=>Tt(ne.mdate)+" ("+Et(ne.mdate)+")"},{name:"sdate",title:p("Shared on"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:ne=>Tt(ne.sdate)+" ("+Et(ne.sdate)+")"},{name:"ddate",title:p("Deleted"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:ne=>Tt(ne.ddate)+" ("+Et(ne.ddate)+")"}].filter(ne=>{if(ne.name==="tags"&&!f(z))return!1;if(ne.name==="indicators")return!0;let de;return ne.prop?de=hc(P,ne.prop)!==void 0:de=Object.prototype.hasOwnProperty.call(P,ne.name),e.fieldsDisplayed?de&&e.fieldsDisplayed.includes(ne.name):de}).map(ne=>{const de=K.find(_e=>_e.name===ne.name);return de&&Object.assign(ne,{sortable:de.sortable,sortDir:de.sortDir}),ne})),e.hasActions&&Q.push({name:"actions",title:p("Actions"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"}),Q}),ye=P=>f(Ae)!==jo.Cut?!1:f(le).some(Q=>Q.id===P.id),Ke=P=>{const Q=f(r.currentRoute).query?.term;return $i("files-common-search",{query:{provider:"files.sdk",q_tags:P,...Q&&{term:Q}}})},Ge=P=>f(F)?{to:Ke(P)}:{},Ye=P=>P.id===f(H),Ze=P=>e.showRenameQuickAction?re.isProjectSpaceResource(P)?f(Re).filter(Q=>Q.isVisible({resources:[P]})).length:f(ge).filter(Q=>Q.isVisible({space:e.space,resources:[P]})).length:!1,wt=P=>{if(re.isProjectSpaceResource(P))return f(Ce)({resources:[P]});f(De)({space:o(P),resources:[P]})},St=()=>{Je.publish(Ct.open)},Et=P=>rb(new Date(P),b),Tt=P=>ob(new Date(P),b),at=P=>{if(!re.isShareResource(P))return;const Q=P.type==="folder"?p("folder"):p("file"),K=P.sharedWith.filter(({shareType:ne})=>re.ShareTypes.authenticated.includes(re.ShareTypes.getByValue(ne))).length;return K?m("This %{ resourceType } is shared via %{ shareCount } invite","This %{ resourceType } is shared via %{ shareCount } invites",K,{resourceType:Q,shareCount:K.toString()}):""},vn=P=>{if(!re.isShareResource(P))return"";const Q=P.type==="folder"?p("folder"):p("file");return p("This %{ resourceType } is shared by %{ user }",{resourceType:Q,user:P.sharedBy.map(({displayName:K})=>K).join(", ")})},U=P=>re.isShareResource(P)?P.sharedBy.map(Q=>({displayName:Q.displayName,name:Q.displayName,avatarType:re.ShareTypes.user.key,username:Q.id,userId:Q.id})):[],k=P=>re.isShareResource(P)?P.sharedWith.filter(({shareType:Q})=>re.ShareTypes.authenticated.includes(re.ShareTypes.getByValue(Q))).map(Q=>({displayName:Q.displayName,name:Q.displayName,avatarType:re.ShareTypes.getByValue(Q.shareType).key,username:Q.id,userId:Q.id})):[];return(P,Q)=>{const K=Ee("oc-checkbox"),ne=Ee("oc-icon"),de=Ee("oc-tag"),_e=Ee("oc-avatars"),Ne=sn("oc-tooltip");return Y(),pe(je,null,[me(f(QN),Mt(P.$attrs,{id:"files-space-table",class:[{condensed:e.viewMode===f(tn).name.condensedTable,"files-table":e.resourceType==="file","files-table-squashed":e.resourceType==="file"&&e.isSideBarOpen,"spaces-table":e.resourceType==="space","spaces-table-squashed":e.resourceType==="space"&&e.isSideBarOpen}],data:e.resources,fields:$e.value,highlighted:e.selectedIds,disabled:f(g),sticky:f(d),"header-position":e.headerPosition,"drag-drop":e.dragDrop,hover:e.hover,"item-dom-selector":e.resourceDomSelector,selection:f(y),"sort-by":e.sortBy,"sort-dir":e.sortDir,lazy:e.lazy,"padding-x":"medium",onHighlight:Q[1]||(Q[1]=xe=>f(h)({resource:xe[0],event:xe[1]})),onContextmenuClicked:Q[2]||(Q[2]=(xe,Be,Qe)=>f(J)(Be,Qe)),onItemDropped:Q[3]||(Q[3]=xe=>f(W)(xe[0],xe[1])),onItemDragged:Q[4]||(Q[4]=xe=>f(N)(xe[0],xe[1])),onDropRowStyling:f(L),onSort:Q[5]||(Q[5]=xe=>P.$emit("sort",xe)),"onUpdate:modelValue":Q[6]||(Q[6]=xe=>P.$emit("update:modelValue",xe))}),Vp({name:ve(({item:xe})=>[ue("div",{class:q.normalizeClass(["resource-table-resource-wrapper flex items-center",[{"resource-table-resource-wrapper-limit-max-width":Ze(xe)}]])},[Ve(P.$slots,"image",{resource:xe}),(Y(),Te(as,{key:`${xe.path}-${e.resourceDomSelector(xe)}-${xe.thumbnail}`,resource:xe,"path-prefix":f(c)(xe),"is-path-displayed":e.arePathsDisplayed,"parent-folder-name":f(u)(xe),"is-icon-displayed":!P.$slots.image,"is-extension-displayed":f(G),"is-resource-clickable":f(A)(xe,e.areResourcesClickable),link:f(D)(xe),"parent-folder-link":f(a)(xe),"parent-folder-link-icon-additional-attributes":f(l)(xe),class:q.normalizeClass({"opacity-70":ye(xe)}),onClick:qt(Be=>f(E)({resource:xe,event:Be}),["stop"])},null,8,["resource","path-prefix","is-path-displayed","parent-folder-name","is-icon-displayed","is-extension-displayed","is-resource-clickable","link","parent-folder-link","parent-folder-link-icon-additional-attributes","class","onClick"])),Ze(xe)?(Y(),Te(f(Sn),{key:0,class:"resource-table-edit-name inline-flex raw-hover-surface p-1 ml-1",appearance:"raw","aria-label":f(p)("Rename file »%{name}«",{name:xe.name}),title:f(p)("Rename"),onClick:qt(Be=>{f(s)(Be,xe)||wt(xe)},["stop"])},{default:ve(()=>[me(ne,{name:"edit-2","fill-type":"line",size:"small",color:"var(--oc-role-on-surface)"})]),_:1},8,["aria-label","title","onClick"])):ke("",!0)],2),Ve(P.$slots,"additionalResourceContent",{resource:xe})]),syncEnabled:ve(({item:xe})=>[Ve(P.$slots,"syncEnabled",{resource:xe})]),size:ve(({item:xe})=>[me(yS,{size:xe.size||Number.NaN},null,8,["size"])]),tags:ve(({item:xe})=>[(Y(!0),pe(je,null,dt(xe.tags.slice(0,2),Be=>(Y(),Te(On(f(F)?"router-link":"span"),Mt({key:Be},{ref_for:!0},Ge(Be),{class:"resource-table-tag-wrapper"}),{default:ve(()=>[it((Y(),Te(de,{class:"resource-table-tag ml-1 max-w-20",rounded:!0,size:"small"},{default:ve(()=>[me(ne,{name:"price-tag-3",size:"small"}),ue("span",nB,q.toDisplayString(Be),1)]),_:2},1024)),[[Ne,Ie(Be)]])]),_:2},1040))),128)),xe.tags.length>2?(Y(),Te(de,{key:0,size:"small",class:"resource-table-tag-more align-text-bottom cursor-pointer",onClick:Q[0]||(Q[0]=Be=>St())},{default:ve(()=>[kt(" + "+q.toDisplayString(xe.tags.length-2),1)]),_:2},1024)):ke("",!0)]),manager:ve(({item:xe})=>[Ve(P.$slots,"manager",{resource:xe})]),members:ve(({item:xe})=>[Ve(P.$slots,"members",{resource:xe})]),totalQuota:ve(({item:xe})=>[Ve(P.$slots,"totalQuota",{resource:xe})]),usedQuota:ve(({item:xe})=>[Ve(P.$slots,"usedQuota",{resource:xe})]),remainingQuota:ve(({item:xe})=>[Ve(P.$slots,"remainingQuota",{resource:xe})]),mdate:ve(({item:xe})=>[it(ue("span",{tabindex:"0",textContent:q.toDisplayString(Tt(xe.mdate))},null,8,rB),[[Ne,Et(xe.mdate)]])]),indicators:ve(({item:xe})=>[me(vS,{space:e.space,resource:xe,"disable-handler":f(R)(xe)},null,8,["space","resource","disable-handler"])]),sdate:ve(({item:xe})=>[it(ue("span",{tabindex:"0",textContent:q.toDisplayString(Tt(xe.sdate))},null,8,iB),[[Ne,Et(xe.sdate)]])]),ddate:ve(({item:xe})=>[it(ue("p",{tabindex:"0",class:"m-0",textContent:q.toDisplayString(Tt(xe.ddate))},null,8,oB),[[Ne,Et(xe.ddate)]])]),sharedBy:ve(({item:xe})=>[me(_e,{class:"flex items-center justify-end flex-row flex-nowrap","is-tooltip-displayed":!0,items:U(xe),"accessible-description":vn(xe),"hover-effect":""},{userAvatars:ve(({avatars:Be,width:Qe})=>[(Y(!0),pe(je,null,dt(Be,nn=>(Y(),Te(f(il),{key:nn.userId,"user-id":nn.userId,"user-name":nn.displayName,width:Qe},null,8,["user-id","user-name","width"]))),128))]),_:1},8,["items","accessible-description"])]),sharedWith:ve(({item:xe})=>[me(_e,{class:"flex items-center justify-end flex-row flex-nowrap","data-testid":"resource-table-shared-with",items:k(xe),stacked:!0,"max-displayed":3,"is-tooltip-displayed":!0,"accessible-description":at(xe),"hover-effect":""},{userAvatars:ve(({avatars:Be,width:Qe})=>[(Y(!0),pe(je,null,dt(Be,nn=>(Y(),Te(f(il),{key:nn.userId,"user-id":nn.userId,"user-name":nn.displayName,width:Qe},null,8,["user-id","user-name","width"]))),128))]),_:1},8,["items","accessible-description"])]),actions:ve(({item:xe})=>[f(ee)(xe)?(Y(),pe("div",sB,[Ve(P.$slots,"quickActions",{resource:xe}),me(zd,{title:xe.name,item:xe,"resource-dom-selector":e.resourceDomSelector,class:"resource-table-btn-action-dropdown",onQuickActionClicked:Be=>f(se)(Be,xe)},{contextMenu:ve(()=>[Ve(P.$slots,"contextMenu",{resource:xe})]),_:2},1032,["title","item","resource-dom-selector","onQuickActionClicked"])])):ke("",!0)]),_:2},[!f(w)&&!f(S)?{name:"selectHeader",fn:ve(()=>[ue("div",tB,[it(me(K,{id:"resource-table-select-all",size:"large",label:f(he),disabled:e.resources.length===f(g).length,"label-hidden":!0,"model-value":f(X),onClick:qt(f(we),["stop"])},null,8,["label","disabled","model-value","onClick"]),[[Ne,{content:f(he),placement:"bottom"}]])])]),key:"0"}:void 0,!f(w)&&!f(S)?{name:"select",fn:ve(({item:xe})=>[f(C)(xe.id)?(Y(),Te(f(_N),{key:0,class:"inline-flex ml-1",size:"medium","aria-label":f(p)("File is being processed")},null,8,["aria-label"])):(Y(),Te(K,{key:1,id:`resource-table-select-${e.resourceDomSelector(xe)}`,label:f(oe)(xe),"label-hidden":!0,size:"large",disabled:f(R)(xe),"model-value":f(v)(xe),outline:Ye(xe),"data-test-selection-resource-name":xe.name,"data-test-selection-resource-path":xe.path,onClick:qt(Be=>f(T)({resource:xe,event:Be}),["stop"])},null,8,["id","label","disabled","model-value","outline","data-test-selection-resource-name","data-test-selection-resource-path","onClick"]))]),key:"1"}:void 0,P.$slots.footer?{name:"footer",fn:ve(()=>[Ve(P.$slots,"footer")]),key:"2"}:void 0]),1040,["class","data","fields","highlighted","disabled","sticky","header-position","drag-drop","hover","item-dom-selector","selection","sort-by","sort-dir","lazy","onDropRowStyling"]),f(V)?(Y(),Te(Lp,{key:0,to:"body"},[me(Wd,{ref:"ghostElement","preview-items":[f(V),...f(O)]},null,8,["preview-items"])])):ke("",!0)],64)}}}),cB={key:0,class:"oc-tile-card-lazy-shimmer h-30 overflow-hidden relative after:absolute after:inset-0 after:transform-[translateX(-100%)] opacity-20 after:animate-shimmer"},uB={class:"z-10 absolute top-0 left-0 [&_input]:not-[.oc-checkbox-checked]:bg-role-surface-container"},fB={key:0,class:"oc-tile-card-loading-spinner z-990 m-2"},dB=["textContent"],pB=["aria-label"],hB={class:"flex justify-between items-center"},mB={class:"flex items-center truncate resource-name-wrapper text-role-on-surface overflow-hidden"},gB={class:"flex items-center"},yB={key:0,class:"text-left my-0 truncate"},vB=["textContent"],bS=Fe({__name:"ResourceTile",props:{resource:{},resourceRoute:{},space:{},isResourceSelected:{type:Boolean,default:!1},isResourceClickable:{type:Boolean,default:!0},isResourceDisabled:{type:Boolean,default:!1},isExtensionDisplayed:{type:Boolean,default:!0},isPathDisplayed:{type:Boolean,default:!1},resourceIconSize:{default:"xlarge"},lazy:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1}},emits:["fileNameClicked","contextmenu","itemVisible","tileClicked"],setup(e,{emit:t}){const n=t,{$gettext:r}=Oe.useGettext(),{getParentFolderName:i,getParentFolderLink:o}=Yr({space:ae(e.space)}),s=An("observerTarget"),a=M(()=>f(s)?.$el),l=M(()=>e.resource.locked||e.resource.processing),u=M(()=>e.resource.locked?{name:"lock",fillType:"fill"}:e.resource.processing?{name:"loop-right",fillType:"line"}:{}),c=M(()=>e.resource.locked?r("This item is locked"):null),d=M(()=>re.isSpaceResource(e.resource)?e.resource.description:""),{isVisible:p}=e.lazy?ww({target:a,onVisibleCallback:()=>n("itemVisible")}):{isVisible:ae(!0)},m=M(()=>!f(p));return e.lazy||n("itemVisible"),(b,w)=>{const S=Ee("oc-spinner"),y=Ee("oc-tag"),g=Ee("oc-image"),v=Ee("oc-icon"),h=sn("oc-tooltip");return Y(),Te(f(ud),{ref_key:"observerTarget",ref:s,"body-class":"p-0",class:q.normalizeClass(["oc-tile-card flex flex-col h-full shadow-none [&.item-accentuated]:bg-role-secondary-container",{"oc-tile-card-selected bg-role-secondary-container outline-2 outline-role-outline":e.isResourceSelected,"bg-role-surface-container hover:bg-role-surface-container-highest outline outline-role-surface-container-highest":!e.isResourceSelected,"oc-tile-card-disabled opacity-70 grayscale-60 pointer-events-none":e.isResourceDisabled&&!f(re.isProjectSpaceResource)(e.resource),"state-trashed [&_.tile-preview]:opacity-80 [&_.tile-default-image_svg]:opacity-80 [&_.tile-preview]:grayscale [&_.tile-default-image_svg]:grayscale":e.isResourceDisabled&&f(re.isProjectSpaceResource)(e.resource)}]),"data-item-id":e.resource.id,onContextmenu:w[4]||(w[4]=E=>b.$emit("contextmenu",E))},{default:ve(()=>[m.value?(Y(),pe("div",cB)):(Y(),pe(je,{key:1},[me(Ka,{class:"oc-card-media-top flex justify-center items-center m-0 w-full relative aspect-[16/9]",resource:e.resource,link:e.resourceRoute,"is-resource-clickable":e.isResourceClickable,tabindex:"-1",onClick:w[1]||(w[1]=E=>b.$emit("fileNameClicked",E))},{default:ve(()=>[ue("div",uB,[e.isLoading?(Y(),pe("div",fB,[me(S,{"aria-label":f(r)("File is being processed")},null,8,["aria-label"])])):Ve(b.$slots,"selection",{key:1,item:e.resource})]),e.isResourceDisabled&&f(re.isProjectSpaceResource)(e.resource)?(Y(),Te(y,{key:0,class:"z-10 absolute text-role-on-surface",type:"span"},{default:ve(()=>[ue("span",{textContent:q.toDisplayString(f(r)("Disabled"))},null,8,dB)]),_:1})):ke("",!0),it((Y(),pe("div",{class:q.normalizeClass(["oc-tile-card-preview flex items-center justify-center text-center size-full absolute",{"p-2":e.isResourceSelected,"hover:p-2":!e.isResourceSelected}]),"aria-label":c.value},[Ve(b.$slots,"imageField",{item:e.resource},()=>[e.resource.thumbnail?(Y(),Te(g,{key:0,class:q.normalizeClass(["tile-preview rounded-t-sm size-full object-cover aspect-[16/9] pointer-events-none",{"rounded-sm":e.isResourceSelected}]),src:e.resource.thumbnail,"data-test-thumbnail-resource-name":e.resource.name,onClick:w[0]||(w[0]=qt(E=>b.$emit("tileClicked",[e.resource,E]),["stop"]))},null,8,["class","src","data-test-thumbnail-resource-name"])):(Y(),Te(ss,{key:1,resource:e.resource,size:e.resourceIconSize,class:"tile-default-image pt-1 relative"},Vp({_:2},[l.value?{name:"status",fn:ve(()=>[me(v,Mt(u.value,{size:"xsmall"}),null,16)]),key:"0"}:void 0]),1032,["resource","size"]))])],10,pB)),[[h,c.value]])]),_:3},8,["resource","link","is-resource-clickable"]),ue("div",{class:"p-2",onClick:w[3]||(w[3]=qt(E=>b.$emit("tileClicked",[e.resource,E]),["stop"]))},[ue("div",hB,[ue("div",mB,[me(as,{resource:e.resource,"is-icon-displayed":!1,"is-extension-displayed":e.isExtensionDisplayed,"is-resource-clickable":e.isResourceClickable,"is-path-displayed":e.isPathDisplayed,"parent-folder-name":f(i)(e.resource),"parent-folder-link":f(o)(e.resource),link:e.resourceRoute,onClick:w[2]||(w[2]=qt(E=>b.$emit("fileNameClicked",E),["stop"]))},null,8,["resource","is-extension-displayed","is-resource-clickable","is-path-displayed","parent-folder-name","parent-folder-link","link"])]),ue("div",gB,[Ve(b.$slots,"indicators",{item:e.resource,class:"resource-indicators"}),Ve(b.$slots,"actions",{item:e.resource}),Ve(b.$slots,"contextMenu",{item:e.resource})])]),d.value?(Y(),pe("p",yB,[ue("span",{class:"text-sm",textContent:q.toDisplayString(d.value)},null,8,vB)])):ke("",!0),Ve(b.$slots,"additionalResourceContent",{item:e.resource})])],64))]),_:3},8,["data-item-id","class"])}}}),bB={id:"tiles-view",class:"px-4 pt-2"},wB={class:"flex items-center mb-2 pb-2 oc-tiles-controls"},SB={key:1,class:"oc-tiles-sort"},EB={key:0,class:"flex"},TB={class:"p-1 text-sm"},AB=Xe(Fe({__name:"ResourceTiles",props:{resources:{default:()=>[]},selectedIds:{default:()=>[]},isSelectable:{type:Boolean,default:!0},space:{},sortFields:{default:()=>[]},sortBy:{},sortDir:{},viewSize:{default:()=>tn.tilesSizeDefault},dragDrop:{type:Boolean,default:!1},lazy:{type:Boolean,default:!0},areResourcesClickable:{type:Boolean,default:!0},arePathsDisplayed:{type:Boolean,default:!1}},emits:["fileClick","fileDropped","sort","itemVisible","update:selectedIds"],setup(e,{emit:t}){const n=t,{$gettext:r}=Oe.useGettext(),i=We(),{areFileExtensionsShown:o}=Me.storeToRefs(i),{isLocationPicker:s,isFilePicker:a}=Qr(),l=Md(),u=M(()=>Math.min(f(l),e.viewSize)),{isSideBarOpen:c}=Sa(),{disabledResources:d,isResourceSelected:p,fileContainerClicked:m,fileNameClicked:b,fileCheckboxClicked:w,isResourceDisabled:S,isResourceInDeleteQueue:y,isResourceClickable:g,getResourceLink:v,dragItem:h,dragSelection:E,dragStart:T,fileDropped:R,setDropStyling:C,shouldShowContextDrop:A,showContextMenuOnRightClick:D,showContextMenuOnBtnClick:V,selectAllCheckboxLabel:O,getResourceCheckboxLabel:N,toggleSelectionAll:W,areAllResourcesSelected:L}=jd({space:M(()=>e.space),resources:M(()=>e.resources),selectedIds:M(()=>e.selectedIds),emit:n}),ee=window.__E2E__===!0?!1:e.lazy,J=M(()=>e.sortFields.find(x=>x.name===e.sortBy&&x.sortDir===e.sortDir)||e.sortFields[0]),se=x=>{n("sort",{sortBy:x.name,sortDir:f(x.sortDir)})},he=M(()=>{const x={1:"xlarge",2:"xlarge",3:"xxlarge",4:"xxlarge",5:"xxxlarge",6:"xxxlarge"},G=f(u);return x[G]??"xxlarge"}),oe=ae(0),we=()=>{const x=document.getElementById("tiles-view"),G=getComputedStyle(x),H=parseInt(G.getPropertyValue("padding-left"),10)|0,B=parseInt(G.getPropertyValue("padding-right"),10)|0;oe.value=x.clientWidth-H-B},X=M(()=>parseFloat(getComputedStyle(document.documentElement).fontSize)),{calculateTileSizePixels:ie}=tS(),le=M(()=>{const x=[...Array(tn.tilesSizeMax).keys()].map(G=>G+1);return[...new Set(x.map(G=>{const H=ie(G);return H?Math.round(f(oe)/(H+f(X))):0}))]}),Ae=M(()=>{const x=f(le);return x.length<f(u)?x[x.length-1]:x[f(u)-1]}),te=M(()=>{const x=f(Ae)?e.resources.length%f(Ae):0;return x?f(Ae)-x:0}),F=M(()=>f(oe)/f(Ae)-f(X));return ot(F,x=>{x&&!isNaN(x)&&document.documentElement.style.setProperty("--oc-size-tiles-actual",`${x}px`)},{immediate:!0}),ot(le,x=>{l.value=Math.max(x.length,1)}),ot(c,()=>{we()}),$t(()=>{window.addEventListener("resize",we),we()}),xn(()=>{window.removeEventListener("resize",we)}),(x,G)=>{const H=Ee("oc-checkbox"),B=Ee("oc-icon"),z=Ee("oc-button"),ge=Ee("oc-list"),Re=Ee("oc-filter-chip"),De=sn("oc-tooltip");return Y(),pe("div",bB,[ue("div",wB,[e.isSelectable&&!f(a)?it((Y(),Te(H,{key:0,id:"tiles-view-select-all",class:"ml-2",size:"large",label:f(O),"label-hidden":!0,disabled:e.resources.length===f(d).length,"model-value":f(L),onClick:qt(f(W),["stop"])},null,8,["label","disabled","model-value","onClick"])),[[De,f(O)]]):ke("",!0),e.sortFields.length?(Y(),pe("div",SB,[me(Re,{class:"[&_.oc-filter-chip-label]:text-sm","filter-label":f(r)("Sort by"),"selected-item-names":[J.value.label],"has-active-state":!1,"close-on-click":"",raw:""},{default:ve(()=>[me(ge,null,{default:ve(()=>[(Y(!0),pe(je,null,dt(e.sortFields,(Ce,Ie)=>(Y(),pe("li",{key:Ie},[me(z,{appearance:J.value===Ce?"filled":"raw-inverse","color-role":J.value===Ce?"secondaryContainer":"surface","no-hover":J.value===Ce,"justify-content":"space-between",class:"oc-tiles-sort-filter-chip-item",onClick:$e=>se(Ce)},{default:ve(()=>[ue("span",null,q.toDisplayString(Ce.label),1),Ce===J.value?(Y(),pe("div",EB,[me(B,{name:"check"})])):ke("",!0)]),_:2},1032,["appearance","color-role","no-hover","onClick"])]))),128))]),_:1})]),_:1},8,["filter-label","selected-item-names"])])):ke("",!0)]),me(ge,{class:"oc-tiles grid justify-start gap-3"},{default:ve(()=>[(Y(!0),pe(je,null,dt(e.resources,Ce=>(Y(),pe("li",{key:Ce.id,class:"oc-tiles-item has-item-context-menu"},[me(bS,{resource:Ce,space:e.space,"resource-route":f(v)(Ce),"is-resource-selected":f(p)(Ce),"is-resource-clickable":f(g)(Ce,e.areResourcesClickable),"is-resource-disabled":f(S)(Ce),"is-extension-displayed":f(o),"is-path-displayed":e.arePathsDisplayed,"resource-icon-size":he.value,draggable:e.dragDrop,lazy:f(ee),"is-loading":f(y)(Ce.id),onContextmenu:Ie=>f(D)(Ie,Ce),onFileNameClicked:qt(Ie=>f(b)({resource:Ce,event:Ie}),["stop"]),onDragstart:Ie=>f(T)(Ce,Ie),onDragenter:qt(Ie=>f(C)(Ce,!1,Ie),["prevent"]),onDragleave:qt(Ie=>f(C)(Ce,!0,Ie),["prevent"]),onDrop:Ie=>f(R)(Ce,Ie),onDragover:G[0]||(G[0]=Ie=>Ie.preventDefault()),onItemVisible:Ie=>x.$emit("itemVisible",Ce),onTileClicked:Ie=>f(m)({resource:Ce,event:Ie[1]})},{selection:ve(()=>[e.isSelectable&&!f(s)&&!f(a)?(Y(),Te(H,{key:0,label:f(N)(Ce),"label-hidden":!0,size:"large",class:"inline-flex p-2.5",disabled:f(S)(Ce),"model-value":f(p)(Ce),"data-test-selection-resource-name":Ce.name,"data-test-selection-resource-path":Ce.path,onClick:qt(Ie=>f(w)({resource:Ce,event:Ie}),["stop","prevent"])},null,8,["label","disabled","model-value","data-test-selection-resource-name","data-test-selection-resource-path","onClick"])):ke("",!0)]),imageField:ve(()=>[Ve(x.$slots,"image",{resource:Ce},void 0,!0)]),indicators:ve(()=>[me(vS,{space:e.space,class:"ml-2",resource:Ce,filter:Ie=>["system","sharing"].includes(Ie.category),"disable-handler":f(S)(Ce)},null,8,["space","resource","filter","disable-handler"])]),actions:ve(()=>[Ve(x.$slots,"actions",{resource:Ce},void 0,!0)]),contextMenu:ve(()=>[f(A)(Ce)?(Y(),Te(f(zd),{key:0,item:Ce,title:Ce.name,class:"resource-tiles-btn-action-dropdown",onQuickActionClicked:Ie=>f(V)(Ie,Ce)},{contextMenu:ve(()=>[Ve(x.$slots,"contextMenu",{resource:Ce},void 0,!0)]),_:2},1032,["item","title","onQuickActionClicked"])):ke("",!0)]),additionalResourceContent:ve(()=>[Ve(x.$slots,"additionalResourceContent",{resource:Ce},void 0,!0)]),_:2},1032,["resource","space","resource-route","is-resource-selected","is-resource-clickable","is-resource-disabled","is-extension-displayed","is-path-displayed","resource-icon-size","draggable","lazy","is-loading","onContextmenu","onFileNameClicked","onDragstart","onDragenter","onDragleave","onDrop","onItemVisible","onTileClicked"])]))),128)),(Y(!0),pe(je,null,dt(te.value,Ce=>(Y(),pe("li",{key:`ghost-tile-${Ce}`,class:"list-item","aria-hidden":!0}))),128))]),_:3}),f(h)?(Y(),Te(Lp,{key:0,to:"body"},[me(Wd,{ref:"ghostElement","preview-items":[f(h),...f(E)]},null,8,["preview-items"])])):ke("",!0),ue("div",TB,[Ve(x.$slots,"footer",{},void 0,!0)])])}}}),[["__scopeId","data-v-2ea556cc"]]),xB=Fe({name:"DateFilter",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0},items:{type:Array,required:!0},idAttribute:{type:String,required:!1,default:"id"},displayNameAttribute:{type:String,required:!1,default:"name"}},emits:["selectionChange"],setup:function(e,{emit:t,expose:n}){const r=ze(),{current:i}=Oe.useGettext(),o=zt(),s=ur(),{currentTheme:a}=Me.storeToRefs(s),l=ae(),u=ae(e.items),c=ae(),d=ae(),p=ae(!1),m=ae(),b=`q_${e.filterName}`,w=en(b),S=W=>W[e.idAttribute],y=()=>r.push({query:{...Hi(f(o).query,[b]),...f(l)&&{[b]:S(f(l))}}}),g=W=>f(l)&&S(f(l))===S(W),v=()=>{c.value=void 0,d.value=void 0},h=async W=>{v(),g(W)?l.value=void 0:(l.value=W,f(m).hideDrop()),await y(),t("selectionChange",f(l))},E=()=>{l.value=void 0,p.value=!1,v(),t("selectionChange",f(l)),y()},T=()=>{u.value=e.items},R=()=>{p.value=!1},C=()=>{const W=Rt(f(w));if(!W)return;const L=e.items.find(ee=>S(ee)===W);if(L){l.value=L;return}if(f(A)){const ee=W.replace("range:",""),J=Number(ee.split(" - ")[0]),se=Number(ee.split(" - ")[1]);c.value=jt.DateTime.fromMillis(J),d.value=jt.DateTime.fromMillis(se),l.value=f(V)}},A=M(()=>Rt(f(w))?.startsWith("range:")),D=M(()=>!f(c)||!f(d)?!1:f(c)<=f(d)),V=M(()=>{if(!f(c)||!f(d))return null;const W=fi(f(c),i,jt.DateTime.DATE_SHORT),L=fi(f(d),i,jt.DateTime.DATE_SHORT),ee=f(c).toMillis(),J=f(d).toMillis();return{[e.idAttribute]:`range:${ee} - ${J}`,[e.displayNameAttribute]:`${W} - ${L}`}}),O=async()=>{l.value=f(V),await y(),f(m).hideDrop(),t("selectionChange",f(l))},N=({date:W,error:L},ee)=>{if(L){console.error("date could not be set");return}const J=ee==="from"?c:d;if(!W){J.value=void 0;return}const se=ee==="from"?W.startOf("day"):W.endOf("day");J.value=se};return n({setSelectedItemsBasedOnQuery:C}),$t(()=>{C()}),{clearFilter:E,displayedItems:u,isItemSelected:g,selectedItem:l,onShowDrop:T,onHideDrop:R,filterChip:m,toggleItemSelection:h,setSelectedItemsBasedOnQuery:C,fromDate:c,toDate:d,dateRangeValid:D,applyDateRangeFilter:O,dateRangeApplied:A,setDateRangeDate:N,dateRangeClicked:p,currentTheme:a,queryParam:b}}}),CB={class:"flex items-center truncate"},RB={class:"truncate ml-2"},kB={class:"flex"},PB={class:"my-1"},IB={class:"flex items-center truncate"},OB={class:"truncate ml-2"},FB=["textContent"],_B={class:"flex"},DB={class:"flex items-center justify-between mb-4"},NB=["textContent"],LB={class:"mt-2"},$B={class:"date-filter-apply-btn text-end"};function MB(e,t,n,r,i,o){const s=Ee("oc-icon"),a=Ee("oc-button"),l=Ee("oc-list"),u=Ee("oc-datepicker"),c=Ee("oc-filter-chip");return Y(),pe("div",{class:q.normalizeClass(["date-filter flex overflow-hidden [&_label]:text-sm",`date-filter-${e.filterName}`])},[me(c,{ref:"filterChip","filter-label":e.filterLabel,"selected-item-names":e.selectedItem?[e.selectedItem[e.displayNameAttribute]]:void 0,onClearFilter:e.clearFilter,onShowDrop:e.onShowDrop,onHideDrop:e.onHideDrop},{default:ve(()=>[me(l,{class:q.normalizeClass({"invisible min-h-[225px] transition-[visibility] duration-[0.4s,0s]":e.dateRangeClicked})},{default:ve(()=>[(Y(!0),pe(je,null,dt(e.displayedItems,(d,p)=>(Y(),pe("li",{key:p,class:"my-1 first:mt-0 last:mb-0"},[me(a,{class:q.normalizeClass(["date-filter-list-item flex justify-between items-center w-full p-1",{"date-filter-list-item-active":e.isItemSelected(d)}]),"justify-content":"space-between",appearance:"raw","data-testid":d[e.displayNameAttribute],onClick:m=>e.toggleItemSelection(d)},{default:ve(()=>[ue("div",CB,[ue("div",RB,[Ve(e.$slots,"item",{item:d},void 0,!0)])]),ue("div",kB,[e.isItemSelected(d)?(Y(),Te(s,{key:0,name:"check"})):ke("",!0)])]),_:2},1032,["class","data-testid","onClick"])]))),128)),ue("li",PB,[me(a,{class:q.normalizeClass(["date-filter-list-item flex justify-between items-center w-full p-1",{"date-filter-list-item-active":e.dateRangeApplied}]),"justify-content":"space-between",appearance:"raw","data-testid":"custom-date-range",onClick:t[0]||(t[0]=d=>e.dateRangeClicked=!0)},{default:ve(()=>[ue("div",IB,[ue("div",OB,[ue("span",{textContent:q.toDisplayString(e.$gettext("Custom date range"))},null,8,FB)])]),ue("div",_B,[e.dateRangeApplied?(Y(),Te(s,{key:0,name:"check"})):ke("",!0)])]),_:1},8,["class"])])]),_:3},8,["class"]),ue("div",{class:q.normalizeClass(["date-filter-range-panel absolute top-0 p-2 bg-role-surface",{"transform-[translateX(0)] visible":e.dateRangeClicked,"transform-[translateX(100%)] invisible":!e.dateRangeClicked}])},[ue("div",DB,[me(a,{appearance:"raw",class:"date-filter-range-panel-back","aria-label":e.$gettext("Go back to filter options"),onClick:t[1]||(t[1]=d=>e.dateRangeClicked=!1)},{default:ve(()=>[me(s,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"]),ue("span",{textContent:q.toDisplayString(e.$gettext("Custom date range"))},null,8,NB),me(a,{appearance:"raw",class:"date-filter-range-panel-close","aria-label":e.$gettext("Close filter"),onClick:t[2]||(t[2]=d=>e.filterChip.hideDrop())},{default:ve(()=>[me(s,{name:"close"})]),_:1},8,["aria-label"])]),ue("div",LB,[me(u,{label:e.$gettext("From"),"is-clearable":!0,"current-date":e.fromDate,"is-dark":e.currentTheme.isDark,onDateChanged:t[3]||(t[3]=d=>e.setDateRangeDate(d,"from"))},null,8,["label","current-date","is-dark"]),me(u,{label:e.$gettext("To"),"is-clearable":!0,"current-date":e.toDate,"min-date":e.fromDate?e.fromDate:void 0,"is-dark":e.currentTheme.isDark,onDateChanged:t[4]||(t[4]=d=>e.setDateRangeDate(d,"to"))},null,8,["label","current-date","min-date","is-dark"])]),ue("div",$B,[me(a,{size:"small",disabled:!e.dateRangeValid,onClick:e.applyDateRangeFilter},{default:ve(()=>[kt(q.toDisplayString(e.$gettext("Apply")),1)]),_:1},8,["disabled","onClick"])])],2)]),_:3},8,["filter-label","selected-item-names","onClearFilter","onShowDrop","onHideDrop"])],2)}const BB=Xe(xB,[["render",MB],["__scopeId","data-v-80ea8301"]]),jB=Fe({name:"ItemFilterInline",props:{filterName:{type:String,required:!0},filterOptions:{type:Array,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=ze(),r=zt(),i=ae(e.filterOptions[0].name),o=`q_${e.filterName}`,s=en(o),a=u=>n.push({query:{...Hi(f(r).query,[o]),[o]:u}}),l=async u=>{i.value=u.name,await a(u.name),t("toggleFilter",u)};return $t(()=>{const u=Rt(f(s));u&&e.filterOptions.some(({name:c})=>c===u)&&(i.value=u,t("toggleFilter",e.filterOptions.find(({name:c})=>c===u)))}),{queryParam:o,activeOption:i,toggleFilter:l}}}),UB=["textContent"];function VB(e,t,n,r,i,o){const s=Ee("oc-button");return Y(),pe("div",null,[ue("div",{class:q.normalizeClass(["item-inline-filter inline-flex outline outline-role-secondary outline-offset-[-1px] rounded-full",`item-inline-filter-${e.filterName}`])},[(Y(!0),pe(je,null,dt(e.filterOptions,(a,l)=>(Y(),Te(s,{id:a.name,key:l,class:q.normalizeClass(["item-inline-filter-option py-1 px-2 text-xs first:rounded-l-full last:rounded-r-full h-[26px]",{"item-inline-filter-option-selected":e.activeOption===a.name}]),appearance:e.activeOption===a.name?"filled":"raw-inverse","color-role":e.activeOption===a.name?"secondaryContainer":"surface","no-hover":e.activeOption===a.name,onClick:u=>e.toggleFilter(a)},{default:ve(()=>[ue("span",{class:"truncate item-inline-filter-option-label",textContent:q.toDisplayString(a.label)},null,8,UB)]),_:2},1032,["id","class","appearance","color-role","no-hover","onClick"]))),128))],2)])}const qB=Xe(jB,[["render",VB]]),zB={class:"space-quota"},WB=["textContent"],wS=Fe({__name:"SpaceQuota",props:{spaceQuota:{}},setup(e){const{$gettext:t,current:n}=Oe.useGettext(),r=M(()=>e.spaceQuota.total?t("%{used} of %{total} used (%{percentage}% used)",{used:f(o),total:f(i),percentage:f(s).toString()}):t("%{used} used (no restriction)",{used:f(o)})),i=M(()=>bn(e.spaceQuota.total,n)),o=M(()=>bn(e.spaceQuota.used,n)),s=M(()=>parseFloat((e.spaceQuota.used/e.spaceQuota.total*100).toFixed(2))),a=M(()=>e.spaceQuota.state==="normal"?"var(--oc-role-secondary)":"var(--oc-role-error)");return(l,u)=>{const c=Ee("oc-progress");return Y(),pe("div",zB,[ue("p",{class:"mb-2 mt-0",textContent:q.toDisplayString(r.value)},null,8,WB),me(c,{value:s.value,max:100,size:"small",color:a.value,"background-color":"var(--oc-role-surface)"},null,8,["value","color"])])}}}),HB=Fe({name:"WebDavDetails",props:{space:{type:Object,required:!0}},setup(e){const t=Sr("resource"),n="check",r="file-copy",i=ae(r),o=ae(r),s=M(()=>wc(f(t).webDavPath)),a=M(()=>e.space?.getWebDavUrl({path:f(t).path}));return{copyWebDAVPathIcon:i,copyWebDAVPathToClipboard:()=>{navigator.clipboard.writeText(f(s)),i.value=n,setTimeout(()=>i.value=r,1500)},copyWebDAVUrlIcon:o,copyWebDAVUrlToClipboard:()=>{navigator.clipboard.writeText(f(a)),o.value=n,setTimeout(()=>o.value=r,1500)},webDavPath:s,webDavUrl:a}}}),KB={class:"flex"},GB=["textContent"],QB={class:"flex"},XB=["textContent"];function YB(e,t,n,r,i,o){const s=Ee("oc-icon"),a=Ee("oc-button"),l=sn("oc-tooltip");return Y(),pe(je,null,[ue("dt",null,q.toDisplayString(e.$gettext("WebDAV path")),1),ue("dd",KB,[it(ue("div",{class:"truncate",textContent:q.toDisplayString(e.webDavPath)},null,8,GB),[[l,e.webDavPath]]),it((Y(),Te(a,{class:"ml-2",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV path to clipboard"),"no-hover":"",onClick:e.copyWebDAVPathToClipboard},{default:ve(()=>[me(s,{name:e.copyWebDAVPathIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[l,e.$gettext("Copy WebDAV path")]])]),ue("dt",null,q.toDisplayString(e.$gettext("WebDAV URL")),1),ue("dd",QB,[it(ue("div",{class:"truncate",textContent:q.toDisplayString(e.webDavUrl)},null,8,XB),[[l,e.webDavUrl]]),it((Y(),Te(a,{class:"ml-2",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV URL to clipboard"),"no-hover":"",onClick:e.copyWebDAVUrlToClipboard},{default:ve(()=>[me(s,{name:e.copyWebDAVUrlIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[l,e.$gettext("Copy WebDAV URL")]])])],64)}const SS=Xe(HB,[["render",YB]]),JB={id:"oc-space-details-sidebar",class:"p-4 bg-role-surface-container rounded-sm"},ZB={class:"text-center"},ej={key:1,class:"relative mb-2"},tj=["src"],nj={key:0,class:"flex items-center oc-space-details-sidebar-members mb-2 text-sm gap-2"},rj=["textContent"],ij=["textContent"],oj=["aria-label"],sj=Fe({__name:"SpaceDetails",props:{showShareIndicators:{type:Boolean,default:!0}},setup(e){const t=gt(),n=We(),{resourceContentsText:r}=nS({showSizeInformation:!1}),i=ze(),{$gettext:o,$ngettext:s,current:a}=Oe.useGettext(),{loadPreview:l}=Bd(),u=st(),{imagesLoading:c}=Me.storeToRefs(u),d=kr(),p=Sr("resource"),m=ae(""),{user:b}=Me.storeToRefs(t),w=M(()=>u.getSpaceMembers(f(p))),S=M(()=>d.linkShares.length),y=M(()=>n.areWebDavDetailsShown),g=M(()=>!pt(i,"files-spaces-projects")),v=M(()=>`${bn(f(p).size,a)}, ${f(r)}`);ot(()=>f(p).spaceImageData,async()=>{m.value=await l({space:f(p),resource:f(p).spaceImageData?re.buildSpaceImageResource(f(p)):f(p),dimensions:os.Tile,processor:ya.enum.fit,cancelRunning:!0,updateStore:!1})},{immediate:!0});const h=M(()=>f(w).length?f(w).filter(re.isManager).map(({sharedWith:se})=>se.id===f(b)?.id?o("%{displayName} (me)",{displayName:se.displayName}):se.displayName).join(", "):re.getSpaceManagers(f(p),d.graphRoles)?.map(({grantedToV2:he})=>he.user?.id===f(b)?.id?o("%{displayName} (me)",{displayName:he.user.displayName}):he.user?.displayName||he.group?.displayName).join(", ")),E=M(()=>ib(f(p).mdate,a)),T=M(()=>f(V)||f(O)),R=M(()=>f(V)&&!f(O)?f(W):!f(V)&&f(O)?f(L):f(N)===1?s("This space has one member and %{linkShareCount} link.","This space has one member and %{linkShareCount} links.",f(S),{linkShareCount:f(S).toString()}):f(S)===1?o("This space has %{memberShareCount} members and one link.",{memberShareCount:f(N).toString()}):o("This space has %{memberShareCount} members and %{linkShareCount} links.",{memberShareCount:f(N).toString(),linkShareCount:f(S).toString()})),C=M(()=>o("Open share panel")),A=M(()=>o("Open link list in share panel")),D=M(()=>o("Open member list in share panel")),V=M(()=>f(N)>0),O=M(()=>f(S)>0),N=M(()=>f(w).length),W=M(()=>s("This space has %{memberShareCount} member.","This space has %{memberShareCount} members.",f(N),{memberShareCount:f(N).toString()})),L=M(()=>s("%{linkShareCount} link giving access.","%{linkShareCount} links giving access.",f(S),{linkShareCount:f(S).toString()})),ee=()=>{Je.publish(Ct.setActivePanel,"space-share")};return(J,se)=>{const he=Ee("oc-spinner"),oe=Ee("oc-icon"),we=Ee("oc-button"),X=Ee("portal-target");return Y(),pe("div",JB,[ue("div",ZB,[f(c).includes(f(p).id)?(Y(),Te(he,{key:0,"aria-label":f(o)("Space image is loading")},null,8,["aria-label"])):m.value?(Y(),pe("div",ej,[ue("img",{src:m.value,alt:"",class:"size-full object-cover aspect-[16/9]"},null,8,tj)])):(Y(),Te(oe,{key:2,name:"layout-grid",size:"xxlarge",class:"space-default-image px-4 py-4"}))]),e.showShareIndicators&&T.value&&!f(p).disabled?(Y(),pe("div",nj,[V.value?(Y(),Te(we,{key:0,appearance:"raw","aria-label":D.value,"no-hover":"",onClick:ee},{default:ve(()=>[me(oe,{name:"group",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):ke("",!0),O.value?(Y(),Te(we,{key:1,appearance:"raw","aria-label":A.value,"no-hover":"",onClick:ee},{default:ve(()=>[me(oe,{name:"link",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):ke("",!0),ue("p",{textContent:q.toDisplayString(R.value)},null,8,rj),me(we,{appearance:"raw","aria-label":C.value,size:"small","no-hover":"",onClick:ee},{default:ve(()=>[ue("span",{class:"text-sm",textContent:q.toDisplayString(f(o)("Show"))},null,8,ij)]),_:1},8,["aria-label"])])):ke("",!0),ue("dl",{class:"details-list grid grid-cols-[auto_minmax(0,1fr)] m-0","aria-label":f(o)("Overview of the information about the selected space")},[ue("dt",null,q.toDisplayString(f(o)("Last activity")),1),ue("dd",null,q.toDisplayString(E.value),1),f(p).description?(Y(),pe(je,{key:0},[ue("dt",null,q.toDisplayString(f(o)("Subtitle")),1),ue("dd",null,q.toDisplayString(f(p).description),1)],64)):ke("",!0),ue("dt",null,q.toDisplayString(f(o)("Manager")),1),ue("dd",null,q.toDisplayString(h.value),1),f(p).disabled?ke("",!0):(Y(),pe(je,{key:1},[ue("dt",null,q.toDisplayString(f(o)("Quota")),1),ue("dd",null,[me(wS,{"space-quota":f(p).spaceQuota},null,8,["space-quota"])])],64)),g.value?(Y(),pe(je,{key:2},[ue("dt",null,q.toDisplayString(f(o)("Size")),1),ue("dd",null,q.toDisplayString(v.value),1)],64)):ke("",!0),y.value?(Y(),Te(SS,{key:3,space:f(p)},null,8,["space"])):ke("",!0),me(X,{name:"app.files.sidebar.space.details.table","slot-props":{space:f(p),resource:f(p)},multiple:!0},null,8,["slot-props"])],8,oj)])}}}),aj={id:"oc-spaces-details-multiple-sidebar",class:"p-4 bg-role-surface-container rounded-sm"},lj={class:"text-center mb-6 rounded-sm"},cj=["textContent"],uj=Fe({__name:"SpaceDetailsMultiple",props:{selectedSpaces:{}},setup(e){const t=Oe.useGettext(),{$gettext:n,$ngettext:r}=t,i=M(()=>{let p=0;return e.selectedSpaces.forEach(m=>{p+=m.spaceQuota.total}),bn(p,t.current)}),o=M(()=>{let p=0;return e.selectedSpaces.forEach(m=>{m.disabled||(p+=m.spaceQuota.remaining)}),bn(p,t.current)}),s=M(()=>{let p=0;return e.selectedSpaces.forEach(m=>{m.disabled||(p+=m.spaceQuota.used)}),bn(p,t.current)}),a=M(()=>e.selectedSpaces.filter(p=>!p.disabled).length),l=M(()=>e.selectedSpaces.filter(p=>p.disabled).length),u=M(()=>n("Overview of the information about the selected spaces")),c=M(()=>r("%{ itemCount } space selected","%{ itemCount } spaces selected",e.selectedSpaces.length,{itemCount:e.selectedSpaces.length.toString()})),d=M(()=>[{term:n("Total quota:"),definition:f(i).toString()},{term:n("Remaining quota:"),definition:f(o).toString()},{term:n("Used quota:"),definition:f(s).toString()},{term:n("Enabled:"),definition:f(a).toString()},{term:n("Disabled:"),definition:f(l).toString()}]);return(p,m)=>{const b=Ee("oc-icon"),w=Ee("oc-definition-list");return Y(),pe("div",aj,[ue("div",lj,[ue("div",null,[me(b,{size:"xxlarge",name:"layout-grid"}),ue("p",{textContent:q.toDisplayString(c.value)},null,8,cj)])]),me(w,{"aria-label":u.value,items:d.value,class:"m-0"},null,8,["aria-label","items"])])}}}),fj=Fe({name:"SpaceNoSelection"}),dj={class:"mt-12"},pj={class:"flex flex-col items-center space-info text-center"};function hj(e,t,n,r,i,o){const s=Ee("oc-icon"),a=sn("translate");return Y(),pe("div",dj,[ue("div",pj,[me(s,{name:"layout-grid",size:"xxlarge"}),it((Y(),pe("p",null,[...t[0]||(t[0]=[kt("Select a space to view details",-1)])])),[[a]])])])}const mj=Xe(fj,[["render",hj]]),gj=Fe({name:"CompareSaveDialog",props:{originalObject:{type:Object,required:!0},compareObject:{type:Object,required:!0},confirmButtonDisabled:{type:Boolean,default:()=>!1}},emits:["confirm","revert"],setup(){const e=ae(!1);let t;return $t(()=>{t=Je.subscribe("sidebar.entity.saved",()=>{e.value=!0})}),xn(()=>{Je.unsubscribe("sidebar.entity.saved",t)}),{saved:e}},computed:{unsavedChanges(){return!qv(this.originalObject,this.compareObject)},unsavedChangesText(){return this.unsavedChanges?this.$gettext("Unsaved changes"):this.$gettext("No changes")}},watch:{unsavedChanges(){this.unsavedChanges&&(this.saved=!1)},"originalObject.id":function(){this.saved=!1}}}),yj={class:"w-full flex flex-row flex-wrap justify-between items-center"},vj={key:0,class:"flex items-center"},bj=["textContent"],wj={key:1},Sj=["textContent"],Ej=["textContent"];function Tj(e,t,n,r,i,o){const s=Ee("oc-icon"),a=Ee("oc-button");return Y(),pe("div",yj,[e.saved?(Y(),pe("span",vj,[me(s,{name:"checkbox-circle"}),ue("span",{class:"ml-2",textContent:q.toDisplayString(e.$gettext("Changes saved"))},null,8,bj)])):(Y(),pe("span",wj,q.toDisplayString(e.unsavedChangesText),1)),ue("div",null,[me(a,{disabled:!e.unsavedChanges,class:"compare-save-dialog-revert-btn",onClick:t[0]||(t[0]=l=>e.$emit("revert"))},{default:ve(()=>[ue("span",{textContent:q.toDisplayString(e.$gettext("Revert"))},null,8,Sj)]),_:1},8,["disabled"]),me(a,{appearance:"filled",class:"compare-save-dialog-confirm-btn",disabled:!e.unsavedChanges||e.confirmButtonDisabled,onClick:t[1]||(t[1]=l=>e.$emit("confirm"))},{default:ve(()=>[ue("span",{textContent:q.toDisplayString(e.$gettext("Save"))},null,8,Ej)]),_:1},8,["disabled"])])])}const Aj=Xe(gj,[["render",Tj]]),xj=W1(async()=>(await Promise.resolve().then(()=>E8)).default),Cj=Fe({name:"CustomComponentTarget",props:{extensionPoint:{type:Object,required:!0}},setup(e){const t=Ki(),n=pb(),r=M(()=>t.requestExtensions(e.extensionPoint)),i=n.extractDefaultExtensionIds(e.extensionPoint,f(r));return{extensions:M(()=>{if(e.extensionPoint.multiple||f(r).length<=1)return f(r);const s=n.getExtensionPreference(e.extensionPoint.id,i);return s.selectedExtensionIds.length?[f(r).find(a=>s.selectedExtensionIds.includes(a.id))||f(r)[0]]:[f(r)[0]]})}}});function Rj(e,t,n,r,i,o){return Y(!0),pe(je,null,dt(e.extensions,s=>(Y(),Te(On(s.content),{key:`custom-component-${s.id}`}))),128)}const kj=Xe(Cj,[["render",Rj]]),Pj={class:"flex items-center truncate"},Ij={class:"truncate"},Oj={class:"flex"},Fj=Fe({__name:"ItemFilter",props:{filterLabel:{},filterName:{},items:{},optionFilterLabel:{default:""},showOptionFilter:{type:Boolean,default:!1},allowMultiple:{type:Boolean,default:!1},idAttribute:{default:"id"},displayNameAttribute:{default:"name"},filterableAttributes:{default:()=>[]},closeOnClick:{type:Boolean,default:!1}},emits:["selectionChange"],setup(e,{expose:t,emit:n}){const r=n,i=ze(),o=zt(),s=An("filterInputRef"),a=ae([]),l=ae(e.items),u=An("itemFilterListRef"),c=`q_${e.filterName}`,d=en(c),p=R=>R[e.idAttribute],m=()=>i.push({query:{...Hi(f(o).query,[c]),...!!f(a).length&&{[c]:f(a).reduce((R,C)=>(R+=`${p(C)}+`,R),"").slice(0,-1)}}}),b=R=>!!f(a).find(C=>p(C)===p(R)),w=async R=>{b(R)?a.value=f(a).filter(C=>p(C)!==p(R)):(e.allowMultiple||(a.value=[]),a.value.push(R)),await m(),r("selectionChange",f(a))},S=ae(),y=(R,C)=>{if(!(C||"").trim())return R;const D=new Hd(R,{...Vl,keys:e.filterableAttributes}).search(C).map(V=>V.item);return R.filter(V=>D.includes(V))},g=()=>{a.value=[],r("selectionChange",f(a)),m()},v=R=>{l.value=R},h=async()=>{v(e.items),await Vt(),f(s)?.focus()};let E;ot(S,()=>{v(y(e.items,f(S))),f(u)&&(E=new Yd(f(u)),E.unmark(),E.mark(f(S),{element:"span",className:"mark-highlight"}))});const T=()=>{const R=Rt(f(d));if(R){const C=R.split("+");a.value=e.items.filter(A=>C.includes(p(A)))}};return t({setSelectedItemsBasedOnQuery:T}),$t(()=>{T()}),(R,C)=>{const A=Ee("oc-checkbox"),D=Ee("oc-icon"),V=Ee("oc-button"),O=Ee("oc-list"),N=Ee("oc-filter-chip");return Y(),pe("div",{class:q.normalizeClass(["item-filter flex",`item-filter-${e.filterName}`])},[me(N,{"filter-label":e.filterLabel,"selected-item-names":a.value.map(W=>W[e.displayNameAttribute]),"close-on-click":e.closeOnClick,onClearFilter:g,onShowDrop:h},{default:ve(()=>[e.showOptionFilter&&e.filterableAttributes.length?(Y(),Te(f(gN),{key:0,ref_key:"filterInputRef",ref:s,modelValue:S.value,"onUpdate:modelValue":C[0]||(C[0]=W=>S.value=W),class:"item-filter-input mb-4 mt-2",autocomplete:"off",label:e.optionFilterLabel===""?R.$gettext("Filter list"):e.optionFilterLabel},null,8,["modelValue","label"])):ke("",!0),ue("div",{ref_key:"itemFilterListRef",ref:u},[me(O,{class:"item-filter-list"},{default:ve(()=>[(Y(!0),pe(je,null,dt(l.value,(W,L)=>(Y(),pe("li",{key:L,class:"my-1"},[me(V,{class:q.normalizeClass(["item-filter-list-item flex items-center w-full",{"item-filter-list-item-active":!e.allowMultiple&&b(W),"justify-start":e.allowMultiple,"justify-between":!e.allowMultiple}]),"justify-content":"space-between",appearance:"raw","data-test-value":W[e.displayNameAttribute],onClick:ee=>w(W)},{default:ve(()=>[ue("div",Pj,[e.allowMultiple?(Y(),Te(A,{key:0,size:"large",class:"mr-2",label:R.$gettext("Toggle selection"),"model-value":b(W),"label-hidden":!0,"onUpdate:modelValue":ee=>w(W),onClick:C[1]||(C[1]=qt(()=>{},["stop"]))},null,8,["label","model-value","onUpdate:modelValue"])):ke("",!0),ue("div",null,[Ve(R.$slots,"image",{item:W})]),ue("div",Ij,[Ve(R.$slots,"item",{item:W})])]),ue("div",Oj,[!e.allowMultiple&&b(W)?(Y(),Te(D,{key:0,name:"check"})):ke("",!0)])]),_:2},1032,["class","data-test-value","onClick"])]))),128))]),_:3})],512)]),_:3},8,["filter-label","selected-item-names","close-on-click"])],2)}}}),_j=Fe({name:"ItemFilterToggle",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=ze(),r=zt(),i=ae(!1),o=`q_${e.filterName}`,s=en(o),a=()=>n.push({query:{...Hi(f(r).query,[o]),...f(i)&&{[o]:"true"}}}),l=async()=>{i.value=!f(i),await a(),t("toggleFilter",f(i))};return $t(()=>{Rt(f(s))==="true"&&(i.value=!0)}),{queryParam:o,filterActive:i,toggleFilter:l}}});function Dj(e,t,n,r,i,o){const s=Ee("oc-filter-chip");return Y(),pe("div",{class:q.normalizeClass(["item-filter flex",`item-filter-${e.filterName}`])},[me(s,{"is-toggle":!0,"filter-label":e.filterLabel,"is-toggle-active":e.filterActive,onToggleFilter:e.toggleFilter,onClearFilter:e.toggleFilter},null,8,["filter-label","is-toggle-active","onToggleFilter","onClearFilter"])],2)}const Nj=Xe(_j,[["render",Dj]]),Lj=Fe({name:"LoadingIndicator",setup(){const e=yn();let t,n,r;const i=ae(e.isLoading),o=ae(e.currentProgress),s=()=>{o.value=e.currentProgress,i.value=e.isLoading},a=()=>{o.value=e.currentProgress};return $t(()=>{t=Je.subscribe(Gr.add,s),n=Je.subscribe(Gr.remove,s),r=Je.subscribe(Gr.setProgress,a)}),xn(()=>{Je.unsubscribe(Gr.add,t),Je.unsubscribe(Gr.remove,n),Je.unsubscribe(Gr.setProgress,r)}),{isLoading:i,currentProgress:o}}}),$j={key:0,id:"oc-loading-indicator",class:"w-full"};function Mj(e,t,n,r,i,o){const s=Ee("oc-progress");return e.isLoading?(Y(),pe("div",$j,[me(s,{max:100,indeterminate:e.currentProgress===null,value:e.currentProgress,size:"xsmall"},null,8,["indeterminate","value"])])):ke("",!0)}const Bj=Xe(Lj,[["render",Mj]]),jj={class:"no-content-message flex flex-col justify-center items-center text-center"},Uj={class:"text-role-on-surface-variant text-xl"},Vj={class:"text-role-on-surface-variant"},qj=Xe(Fe({__name:"NoContentMessage",props:{icon:{},iconFillType:{default:"fill"}},setup(e){return(t,n)=>{const r=Ee("oc-icon");return Y(),pe("div",jj,[me(r,{name:e.icon,type:"div",size:"xxlarge","fill-type":e.iconFillType,class:"mb-4"},null,8,["name","fill-type"]),ue("div",Uj,[Ve(t.$slots,"message",{},void 0,!0)]),ue("div",Vj,[Ve(t.$slots,"callToAction",{},void 0,!0)])])}}}),[["__scopeId","data-v-734c490b"]]),zj=Fe({props:{pages:{type:Number,required:!0},currentPage:{type:Number,required:!0}},watch:{currentPage:{handler:function(){document.getElementsByClassName("files-view-wrapper")[0]?.scrollTo(0,0)}}}});function Wj(e,t,n,r,i,o){const s=Ee("oc-pagination");return e.pages>1?(Y(),Te(s,{key:0,pages:e.pages,"current-page":e.currentPage,"max-displayed":3,"current-route":e.$route,class:"files-pagination flex justify-center my-2"},null,8,["pages","current-page","current-route"])):ke("",!0)}const Hj=Xe(zj,[["render",Wj]]),Kj=Fe({name:"SearchBarFilter",props:{currentFolderAvailable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=Oe.useGettext(),r=en("useScope"),i=ae(),o=ae(),s=M(()=>n(i.value?.title)),a=M(()=>[{id:mi.currentFolder,title:n("Current folder"),enabled:e.currentFolderAvailable},{id:mi.allFiles,title:n("All files"),enabled:!0}]);return ot(()=>e.currentFolderAvailable,()=>{if(f(r)){if(f(r).toString()==="true"){i.value=f(a).find(({id:c})=>c===mi.currentFolder);return}i.value=f(a).find(({id:c})=>c===mi.allFiles);return}if(!e.currentFolderAvailable){i.value=f(a).find(({id:u})=>u===mi.allFiles);return}if(f(o)){i.value=f(a).find(({id:u})=>u===f(o).id);return}i.value=f(a).find(({id:u})=>u===mi.allFiles)},{immediate:!0}),{currentSelection:i,currentSelectionTitle:s,onOptionSelected:u=>{o.value=u,i.value=u,t("update:modelValue",{value:u})},locationOptions:a}}}),Gj={key:0},Qj={key:0,class:"flex"};function Xj(e,t,n,r,i,o){const s=Ee("oc-icon"),a=Ee("oc-button"),l=Ee("oc-list"),u=Ee("oc-filter-chip");return Y(),pe("div",{class:"z-[var(--z-index-modal)] absolute top-[50%] transform-[translateY(-50%)] right-0 ml-4 mb-4 mt-0 mr-[34px] float-right","data-testid":"search-bar-filter",onClick:t[0]||(t[0]=qt(()=>{},["stop"]))},[e.currentSelection?(Y(),pe("div",Gj,[me(u,{"is-toggle":!1,"is-toggle-active":!1,"filter-label":e.$gettext("Location filter"),"selected-item-names":[e.currentSelectionTitle],class:"oc-search-bar-filter [&_button]:items-center [&_.oc-drop]:w-45","has-active-state":!1,raw:"","close-on-click":""},{default:ve(()=>[me(l,null,{default:ve(()=>[(Y(!0),pe(je,null,dt(e.locationOptions,(c,d)=>(Y(),pe("li",{key:d},[me(a,{appearance:c.id===e.currentSelection.id?"filled":"raw-inverse","color-role":c.id===e.currentSelection.id?"secondaryContainer":"surface","no-hover":c.id===e.currentSelection.id,size:"medium",class:"flex items-center w-full py-1 px-2","justify-content":"space-between",disabled:!c.enabled,"data-test-id":c.id,onClick:p=>e.onOptionSelected(c)},{default:ve(()=>[ue("span",null,q.toDisplayString(c.title),1),c.id===e.currentSelection.id?(Y(),pe("div",Qj,[me(s,{name:"check"})])):ke("",!0)]),_:2},1032,["appearance","color-role","no-hover","disabled","data-test-id","onClick"])]))),128))]),_:1})]),_:1},8,["filter-label","selected-item-names"])])):ke("",!0)])}const Yj=Xe(Kj,[["render",Xj]]),Jj=Fe({name:"PortalTarget",components:{PortalTargetVue:ds.PortalTarget},props:{...ds.PortalTarget.props},setup(e){const t=M(()=>e);return $t(()=>{Je.publish(tl.mounted,e)}),{properties:t}}});function Zj(e,t,n,r,i,o){const s=Ee("portal-target-vue");return Y(),Te(s,q.normalizeProps(nh(e.properties)),null,16)}const e8=Xe(Jj,[["render",Zj]]),t8={key:0},n8={key:0,class:"version-check-loading flex items-center"},r8=["textContent"],i8={key:0,class:"version-check-no-updates flex items-center"},o8=["textContent"],s8=["textContent"],a8=Fe({__name:"VersionCheck",setup(e){const{$gettext:t}=Oe.useGettext(),n=Zt(),r=Bb(),i=n.capabilities.core["check-for-updates"],{updates:o,isLoading:s,hasError:a}=Me.storeToRefs(r),l=M(()=>i&&!f(a)),u=ae(!1),c=ae(),d=n.status.edition||"rolling",m=n.status.productversion.split("+")[0];return ot(()=>o,()=>{if(!f(o))return;const b=f(o).channels[d].current_version;Ec(b,m)>0&&(u.value=!0,c.value=f(o).channels[d])},{immediate:!0,deep:!0}),(b,w)=>{const S=Ee("oc-spinner"),y=Ee("oc-icon"),g=Ee("oc-button");return l.value?(Y(),pe("div",t8,[f(s)?(Y(),pe("div",n8,[ue("span",{textContent:q.toDisplayString(f(t)("Checking for updates"))},null,8,r8),me(S,{class:"ml-1",size:"xsmall"})])):(Y(),pe(je,{key:1},[u.value?(Y(),Te(g,{key:1,class:"version-check-update text-role-on-surface-variant",size:"small",type:"a",href:c.value.url,target:"_blank","gap-size":"small",appearance:"raw","no-hover":""},{default:ve(()=>[ue("span",{class:"text-xs",textContent:q.toDisplayString(f(t)("Version %{version} available",{version:c.value.current_version}))},null,8,s8),me(y,{name:"refresh",size:"xsmall","fill-type":"line"})]),_:1},8,["href"])):(Y(),pe("div",i8,[ue("span",{textContent:q.toDisplayString(f(t)("Up to date"))},null,8,o8),me(y,{class:"ml-0.5",name:"checkbox-circle",size:"xsmall","fill-type":"line"})]))],64))])):ke("",!0)}}}),l8={toolbarTips:{bold:"Gras",underline:"Souligné",italic:"Italique",strikeThrough:"Barré",title:"Titre",sub:"Indice",sup:"Exposant",quote:"Citation",unorderedList:"Liste",orderedList:"Liste numérique",task:"Liste de tâche",codeRow:"Code intégré",code:"Bloc de code",link:"Lien",image:"Image",table:"Table",mermaid:"Organigramme",katex:"Formule",revoke:"Annuler",next:"Refaire",save:"Sauvegarder",prettier:"Sublimer",pageFullscreen:"Passer en pleine page",fullscreen:"Passer en plein écran",preview:"Prévisualiser",htmlPreview:"Prévisualiser le HTML",catalog:"Table des matières",github:"Code source de l'editeur"},titleItem:{h1:"Titre niveau 1",h2:"Titre niveau 2",h3:"Titre niveau 3",h4:"Titre niveau 4",h5:"Titre niveau 5",h6:"Titre niveau 6"},imgTitleItem:{link:"Ajouter depuis une url",upload:"Télécharger une image",clip2upload:"Télécharger et recadrer"},linkModalTips:{linkTitle:"Ajouter un lien",imageTitle:"Ajouter une image depuis une url",descLabel:"Texte : ",descLabelPlaceHolder:"Entrez un texte...",urlLabel:"Url : ",urlLabelPlaceHolder:"Entrez une url...",buttonOK:"Valider"},clipModalTips:{title:"Télécharger et recadrer une image",buttonUpload:"Valider"},copyCode:{text:"Copier le code",successTips:"Copié",failTips:"La copie a échoué!"},mermaid:{flow:"Organigramme",sequence:"Chronogramme",gantt:"Diagramme de Gantt",class:"Diagramme de classes",state:"Diagramme d'état",pie:"Diagramme circulaire",relationship:"Diagramme de relation",journey:"Diagramme de tâches"},katex:{inline:"Formule en ligne",block:"Formule en bloc"},footer:{markdownTotal:"Nombre de mots",scrollAuto:"Défilement synchronisé"}},c8={toolbarTips:{bold:"Fett",underline:"Unterstrichen",italic:"Kursiv",strikeThrough:"Durchgestrichen",title:"Titel",sub:"Tiefgestellt",sup:"Hochgestellt",quote:"Zitat",unorderedList:"Ungeordnete Liste",orderedList:"Geordnete Liste",task:"Aufgabenliste",codeRow:"Eingebetteter Code",code:"Codeblock",link:"Link",image:"Bild",table:"Tabelle",mermaid:"Flussdiagramm",katex:"Formel",revoke:"Rückgängig machen",next:"Wiederherstellen",save:"Speichern",prettier:"Verschönern",pageFullscreen:"Vollbildmodus",fullscreen:"Vollbild",preview:"Vorschau",htmlPreview:"HTML Vorschau",catalog:"Inhaltsverzeichnis",github:"Quellcode des Editors"},titleItem:{h1:"Überschrift Ebene 1",h2:"Überschrift Ebene 2",h3:"Überschrift Ebene 3",h4:"Überschrift Ebene 4",h5:"Überschrift Ebene 5",h6:"Überschrift Ebene 6"},imgTitleItem:{link:"Bildlink hinzufügen",upload:"Bild hochladen",clip2upload:"Bild zuschneiden und hochladen"},linkModalTips:{linkTitle:"Link hinzufügen",imageTitle:"Bild von URL hinzufügen",descLabel:"Text: ",descLabelPlaceHolder:"Text eingeben...",urlLabel:"URL: ",urlLabelPlaceHolder:"URL eingeben...",buttonOK:"Bestätigen"},clipModalTips:{title:"Bild zuschneiden und hochladen",buttonUpload:"Hochladen"},copyCode:{text:"Code kopieren",successTips:"Kopiert!",failTips:"Kopieren fehlgeschlagen!"},mermaid:{flow:"Flussdiagramm",sequence:"Sequenzdiagramm",gantt:"Gantt-Diagramm",class:"Klassendiagramm",state:"Zustandsdiagramm",pie:"Kreisdiagramm",relationship:"Beziehungsdiagramm",journey:"Reisediagramm"},katex:{inline:"Inline-Formel",block:"Blockformel"},footer:{markdownTotal:"Zeichenanzahl",scrollAuto:"Automatisches Scrollen"}},u8={toolbarTips:{bold:"Grassetto",underline:"Sottolineato",italic:"Corsivo",strikeThrough:"Barrato",title:"Titolo",sub:"Indice",sup:"Esponente",quote:"Citazione",unorderedList:"Elenco non ordinato",orderedList:"Elenco ordinato",task:"Lista di compiti",codeRow:"Codice incorporato",code:"Blocco di codice",link:"Link",image:"Immagine",table:"Tabella",mermaid:"Diagramma",katex:"Formula",revoke:"Annulla",next:"Ripristina",save:"Salva",prettier:"Formatta",pageFullscreen:"Pagina a schermo intero",fullscreen:"Schermo intero",preview:"Anteprima",htmlPreview:"Anteprima HTML",catalog:"Indice",github:"Codice sorgente dell'editor"},titleItem:{h1:"Intestazione Livello 1",h2:"Intestazione Livello 2",h3:"Intestazione Livello 3",h4:"Intestazione Livello 4",h5:"Intestazione Livello 5",h6:"Intestazione Livello 6"},imgTitleItem:{link:"Aggiungi link immagine",upload:"Carica immagine",clip2upload:"Ritaglia e carica immagine"},linkModalTips:{linkTitle:"Aggiungi link",imageTitle:"Aggiungi immagine da URL",descLabel:"Testo: ",descLabelPlaceHolder:"Inserisci il testo...",urlLabel:"URL: ",urlLabelPlaceHolder:"Inserisci l'URL...",buttonOK:"Conferma"},clipModalTips:{title:"Ritaglia e carica immagine",buttonUpload:"Carica"},copyCode:{text:"Copia codice",successTips:"Copiato!",failTips:"Copia fallita!"},mermaid:{flow:"Diagramma di flusso",sequence:"Diagramma di sequenza",gantt:"Diagramma di Gantt",class:"Diagramma di classe",state:"Diagramma di stato",pie:"Diagramma a torta",relationship:"Diagramma di relazione",journey:"Diagramma di viaggio"},katex:{inline:"Formula in linea",block:"Formula a blocco"},footer:{markdownTotal:"Conteggio parole",scrollAuto:"Scorrimento automatico"}},f8={toolbarTips:{bold:"Negrita",underline:"Subrayado",italic:"Cursiva",strikeThrough:"Tachado",title:"Título",sub:"Subíndice",sup:"Superíndice",quote:"Cita",unorderedList:"Lista desordenada",orderedList:"Lista ordenada",task:"Lista de tareas",codeRow:"Código en línea",code:"Bloque de código",link:"Enlace",image:"Imagen",table:"Tabla",mermaid:"Diagrama",katex:"Fórmula",revoke:"Deshacer",next:"Rehacer",save:"Guardar",prettier:"Formatear",pageFullscreen:"Página en pantalla completa",fullscreen:"Pantalla completa",preview:"Vista previa",htmlPreview:"Vista previa del HTML",catalog:"Índice",github:"Código fuente del editor"},titleItem:{h1:"Encabezado de nivel 1",h2:"Encabezado de nivel 2",h3:"Encabezado de nivel 3",h4:"Encabezado de nivel 4",h5:"Encabezado de nivel 5",h6:"Encabezado de nivel 6"},imgTitleItem:{link:"Agregar enlace de imagen",upload:"Subir imagen",clip2upload:"Recortar y subir imagen"},linkModalTips:{linkTitle:"Agregar enlace",imageTitle:"Agregar imagen desde URL",descLabel:"Texto: ",descLabelPlaceHolder:"Introduce el texto...",urlLabel:"Enlace: ",urlLabelPlaceHolder:"Introduce el enlace...",buttonOK:"Confirmar"},clipModalTips:{title:"Recortar y subir imagen",buttonUpload:"Subir"},copyCode:{text:"Copiar código",successTips:"¡Copiado!",failTips:"¡Copia fallida!"},mermaid:{flow:"Diagrama de flujo",sequence:"Diagrama de secuencia",gantt:"Diagrama de Gantt",class:"Diagrama de clase",state:"Diagrama de estado",pie:"Diagrama de pastel",relationship:"Diagrama de relación",journey:"Diagrama de viaje"},katex:{inline:"Fórmula en línea",block:"Fórmula de bloque"},footer:{markdownTotal:"Conteo de letras",scrollAuto:"Desplazamiento automático"}},d8={toolbarTips:{bold:"Pogrubienie",underline:"Podkreślenie",italic:"Kursywa",strikeThrough:"Przekreślenie",title:"Tytuł",sub:"Indeks dolny",sup:"Indeks górny",quote:"Cytat",unorderedList:"Lista nieuporządkowana",orderedList:"Lista uporządkowana",task:"Lista zadań",codeRow:"Wbudowany kod",code:"Blok kodu",link:"Link",image:"Obraz",table:"Tabela",mermaid:"Schemat przepływu",katex:"Formuła",revoke:"Cofnij",next:"Przywróć",save:"Zapisz",prettier:"Upiększ",pageFullscreen:"Pełny ekran strony",fullscreen:"Pełny ekran",preview:"Podgląd",htmlPreview:"Podgląd HTML",catalog:"Spis treści",github:"Kod źródłowy edytora"},titleItem:{h1:"Nagłówek poziom 1",h2:"Nagłówek poziom 2",h3:"Nagłówek poziom 3",h4:"Nagłówek poziom 4",h5:"Nagłówek poziom 5",h6:"Nagłówek poziom 6"},imgTitleItem:{link:"Dodaj link do obrazu",upload:"Prześlij obraz",clip2upload:"Przytnij i prześlij obraz"},linkModalTips:{linkTitle:"Dodaj link",imageTitle:"Dodaj obraz z URL",descLabel:"Tekst: ",descLabelPlaceHolder:"Wpisz tekst...",urlLabel:"URL: ",urlLabelPlaceHolder:"Wpisz URL...",buttonOK:"Potwierdź"},clipModalTips:{title:"Przytnij i prześlij obraz",buttonUpload:"Prześlij"},copyCode:{text:"Skopiuj kod",successTips:"Skopiowano!",failTips:"Nie udało się skopiować!"},mermaid:{flow:"Schemat przepływu",sequence:"Schemat sekwencji",gantt:"Wykres Gantta",class:"Diagram klas",state:"Diagram stanów",pie:"Diagram kołowy",relationship:"Diagram relacji",journey:"Diagram podróży"},katex:{inline:"Formuła inline",block:"Formuła blokowa"},footer:{markdownTotal:"Liczba znaków",scrollAuto:"Automatyczne przewijanie"}},p8={toolbarTips:{bold:"жирный",underline:"подчёркнутый",italic:"курсив",strikeThrough:"зачёркнутый",title:"заголовок",sub:"нижний индекс",sup:"верхний индекс",quote:"цитата",unorderedList:"неупорядоченный список",orderedList:"упорядоченный список",task:"список задач",codeRow:"встроенный код",code:"блочный код",link:"ссылка",image:"изображение",table:"таблица",mermaid:"диаграмма",katex:"формула",revoke:"отмена",next:"вернуть",save:"сохранить",prettier:"форматировать",pageFullscreen:"на всю страницу",fullscreen:"на весь экран",preview:"превью",previewOnly:"только превью",htmlPreview:"превью html",catalog:"каталог",github:"исходный код"},titleItem:{h1:"Заголовок 1-го ур.",h2:"Заголовок 2-го ур.",h3:"Заголовок 3-го ур.",h4:"Заголовок 4-го ур.",h5:"Заголовок 5-го ур.",h6:"Заголовок 6-го ур."},imgTitleItem:{link:"Добавить ссылку на изображение",upload:"Загрузить изображение",clip2upload:"Из буфера обмена"},linkModalTips:{linkTitle:"Добавить ссылку",imageTitle:"Добавить изображение",descLabel:"Описание:",descLabelPlaceHolder:"Введите описание...",urlLabel:"Ссылка:",urlLabelPlaceHolder:"Введите ссылку...",buttonOK:"ОК"},clipModalTips:{title:"Обрезать изображение",buttonUpload:"Загрузить"},copyCode:{text:"Скопировать",successTips:"Скопировано!",failTips:"Не удалось скопировать!"},mermaid:{flow:"цепная",sequence:"последовательная",gantt:"временная",class:"структурная",state:"статусная",pie:"круговая",relationship:"реляционная",journey:"путешествия"},katex:{inline:"встроенная",block:"блочная"},footer:{markdownTotal:"Кол-во символов",scrollAuto:"Автопрокрутка"}},h8={toolbarTips:{bold:"太字",underline:"下線",italic:"斜体",strikeThrough:"取り消し線",title:"タイトル",sub:"下付き文字",sup:"上付き文字",quote:"引用",unorderedList:"番号なし箇条書き",orderedList:"番号付の箇条書き",task:"タスクリスト",codeRow:"インラインコード",code:"ブロックコード",link:"リンク",image:"イメージ",table:"テーブル",mermaid:"mermaid図",katex:"katex数式",revoke:"後退",next:"前進",save:"保存",prettier:"フォーマット",pageFullscreen:"ブラウザのフルスクリーン",fullscreen:"フルスクリーン",preview:"プレビュー",htmlPreview:"htmlプレビュー",catalog:"目次",github:"ギットハブ"},titleItem:{h1:"見出し1",h2:"見出し2",h3:"見出し3",h4:"見出し4",h5:"見出し5",h6:"見出し6"},imgTitleItem:{link:"リンク",upload:"アップロード",clip2upload:"トリミングアップロード"},linkModalTips:{linkTitle:"追加",imageTitle:"イメージ追加",descLabel:"リンクの説明:",descLabelPlaceHolder:"説明を入力してください...",urlLabel:"リンクアドレス:",urlLabelPlaceHolder:"リンクを入力してください...",buttonOK:"確定"},clipModalTips:{title:"トリミング画像のアップロード",buttonUpload:"アップロード"},copyCode:{text:"コードをコピー",successTips:"コピー成功!",failTips:"コピー失敗!"},mermaid:{flow:"フローチャート",sequence:"タイミング図",gantt:"ガントチャート",class:"クラス図",state:"状態図",pie:"円グラフ",relationship:"関係図",journey:"旅路図"},katex:{inline:"インライン数式",block:"ブロック数式"},footer:{markdownTotal:"単語数",scrollAuto:"同期スクロール"}},m8={toolbarTips:{bold:"tebal",underline:"garis bawah",italic:"miring",strikeThrough:"coret sambung",title:"judul",sub:"subscript",sup:"superscript",quote:"quote",unorderedList:"daftar tak berurutan",orderedList:"daftar berurutan",task:"daftar tugas",codeRow:"kode inline",code:"kode blok",link:"tautan",image:"gambar",table:"tabel",mermaid:"mermaid",katex:"rumus",revoke:"membatalkan",next:"membatalkan pembatalan",save:"simpan",prettier:"penataan",pageFullscreen:"layar penuh di halaman",fullscreen:"layar penuh",preview:"pratinjau",htmlPreview:"pratinjau html",catalog:"daftar isi",github:"kode sumber"},titleItem:{h1:"Judul 1",h2:"Judul 2",h3:"Judul 3",h4:"Judul 4",h5:"Judul 5",h6:"Judul 6"},imgTitleItem:{link:"Tambahkan Tautan Gambar",upload:"Unggah Gambar",clip2upload:"Potong dan Unggah"},linkModalTips:{linkTitle:"Tambahkan Tautan",imageTitle:"Tambahkan Gambar",descLabel:"Deskripsi:",descLabelPlaceHolder:"Masukkan deskripsi...",urlLabel:"Tautan:",urlLabelPlaceHolder:"Masukkan tautan...",buttonOK:"OK"},clipModalTips:{title:"Potong dan Unggah Gambar",buttonUpload:"Unggah"},copyCode:{text:"Salin",successTips:"Tersalin!",failTips:"Gagal menyalin!"},mermaid:{flow:"diagram aliran",sequence:"diagram urutan",gantt:"diagram gantt",class:"diagram kelas",state:"diagram status",pie:"diagram pie",relationship:"diagram hubungan",journey:"diagram perjalanan"},katex:{inline:"rumus inline",block:"rumus blok"},footer:{markdownTotal:"Jumlah Kata",scrollAuto:"Gulir Otomatis"}},g8={zh:"zh-CN",fr:"fr-FR",ja:"jp-JP",id:"id-ID",ru:"ru",de:"de-DE",it:"it-IT",es:"es-ES",pl:"pl-PL",en:"en-US"},y8={"fr-FR":l8,"de-DE":c8,"it-IT":u8,"es-ES":f8,"pl-PL":d8,ru:p8,"jp-JP":h8,"id-ID":m8},v8=Fe({name:"TextEditor",components:{MdEditor:so.MdEditor,MdPreview:so.MdPreview,NormalToolbar:so.NormalToolbar},props:{applicationConfig:{type:Object,required:!1},currentContent:{type:String,required:!0},markdownMode:{type:Boolean,required:!1,default:!1},isReadOnly:{type:Boolean,required:!1,default:!1},resource:{type:Object,required:!1}},emits:["update:currentContent"],setup(e,{emit:t}){const n=Oe.useGettext(),{currentTheme:r}=ur(),i=ae(!0),o=M(()=>{const{showPreviewOnlyMd:c=!0}=e.applicationConfig;return{showPreviewOnlyMd:c}}),s=M(()=>e.markdownMode||["md","markdown"].includes(e.resource?.extension)||!f(o).showPreviewOnlyMd),a=M(()=>f(r).isDark?"dark":"light"),l=M(()=>f(s)?["bold","underline","italic","-","title","strikeThrough","sub","sup","quote","unorderedList","orderedList","task","-","codeRow","code","link","image","table","-","revoke","next","=",0,"preview","previewOnly"]:["revoke","next","=",0]);return so.config({editorConfig:{languageUserDefined:y8},editorExtensions:{screenfull:{instance:OS},cropper:{instance:ol}},markdownItPlugins(c){return[...c,{type:"xss",plugin:so.XSSPlugin,options:{}}]},codeMirrorExtensions(c){const d=[...c,{type:"lineNumbers",extension:FS.lineNumbers()}],p=d.find(m=>m.type==="linkShortener");return p&&(p.options.maxLength=120),f(s)?d:d.filter(m=>["lineWrapping","keymap","floatingToolbar","lineNumbers"].includes(m.type))}}),{isMarkdown:s,theme:a,toolbars:l,language:n,languages:g8,onUploadImg:async c=>{const p=(await Promise.all([...c].map(b=>new Promise((w,S)=>{const y=new FileReader;y.onload=()=>w(y.result),y.onerror=S,y.readAsDataURL(b)})))).map(b=>`![image](${b})`),m=`${f(e.currentContent)}
65
- ${p.join(`
31
+ `,"2) content: () => element.cloneNode(true)"].join(" "))}var l=o.reduce(function(u,d){var c=d&&cE(d,r);return c&&u.push(c),u},[]);return gs(e)?l[0]:l}ys.defaultProps=en,ys.setDefaultProps=sE,ys.currentInput=Vn;var uE=function(t){var n=t===void 0?{}:t,r=n.exclude,o=n.duration;Gi.forEach(function(s){var i=!1;if(r&&(i=tm(r)?s.reference===r:s.popper===r.popper),!i){var l=s.props.duration;s.setProps({duration:o}),s.hide(),s.state.isDestroyed||s.setProps({duration:l})}})};Object.assign({},Ih,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),ys.setDefaultProps({render:hm});const dE={name:"hideOnEsc",defaultValue:!0,fn({hide:e}){const t=n=>{n.code==="Escape"&&e()};return{onShow:()=>{document.addEventListener("keydown",t)},onHide:()=>{document.removeEventListener("keydown",t)}}}},hc=e=>{if(e)try{e.destroy()}catch{}},fE=["src"],mc=ge({__name:"OcCard",props:{tag:{default:"div"},title:{},titleTag:{default:"h2"},logoUrl:{default:""},headerClass:{default:""},bodyClass:{default:""},footerClass:{default:""}},setup(e){const t=Ou(),n=A(()=>Object.hasOwn(t,"header")||!!a(e.title)||!!a(e.logoUrl)),r=A(()=>Object.hasOwn(t,"footer"));return(o,s)=>(I(),re(rn(e.tag),{class:"oc-card"},{default:Z(()=>[n.value?(I(),G("div",{key:0,class:R.normalizeClass(["oc-card-header",e.headerClass])},[Ce(o.$slots,"header",{},()=>[e.logoUrl?(I(),G("img",{key:0,src:e.logoUrl,alt:"","aria-hidden":!0,class:"max-w-48 max-h-48 absolute -translate-y-16"},null,8,fE)):le("",!0),e.title?(I(),re(rn(e.titleTag),{key:1,class:"mt-0"},{default:Z(()=>[ct(R.toDisplayString(e.title),1)]),_:1})):le("",!0)])],2)):le("",!0),Q("div",{class:R.normalizeClass(["oc-card-body",e.bodyClass])},[Ce(o.$slots,"default")],2),r.value?(I(),G("div",{key:1,class:R.normalizeClass(["oc-card-footer",e.footerClass])},[Ce(o.$slots,"footer")],2)):le("",!0)]),_:3}))}}),pE=["textContent"],hE=ge({__name:"OcMobileDrop",props:{drawerId:{},toggle:{},closeOnClick:{type:Boolean,default:!1},title:{default:""}},emits:["show","hide"],setup(e,{expose:t,emit:n}){const r=n,{$gettext:o}=me.useGettext(),s=FC(),{showDrawer:i,closeDrawer:l,closeAllDrawers:u}=s,{drawers:d,currentDrawer:c}=we.storeToRefs(s),p=W(null),f=nn("bottomDrawerCardBodyRef"),h=A(()=>a(d).map(({id:S})=>S).includes(a(p)?.id)),g=A(()=>a(p)?.id&&a(c)?.id===a(p).id),m=async()=>{p.value=i(),r("show"),await xt(),a(f)?.addEventListener("click",T)},w=()=>{l(a(p)?.id),a(f)?.removeEventListener("click",T),r("hide")},T=S=>{const y=S.target.closest("a[href], button");if(y){if(y.hasAttribute("aria-expanded")){y.setAttribute("aria-expanded","true");return}e.closeOnClick&&(w(),u())}},k=S=>{S.target===S.currentTarget&&u()};return Rn.onKeyStroke("Escape",S=>{S.preventDefault(),u()}),yt(()=>{a(e.toggle)&&document.querySelector(e.toggle).addEventListener("click",m)}),bn(()=>{document.querySelector(e.toggle).removeEventListener("click",m),a(p)&&l(a(p).id)}),t({show:m,hide:w}),(S,y)=>{const E=oe("oc-icon"),D=oe("portal");return h.value?(I(),re(D,{key:0,to:"app.runtime.bottom.drawer"},{default:Z(()=>[J(Ix,{id:e.drawerId,"is-drawer-active":g.value,"is-focus-trap-active":g.value,class:"oc-mobile-drop z-[calc(var(--z-index-modal)+2)]",onClicked:k},{default:Z(()=>[J(mc,{class:"bg-role-surface-container-high overflow-x-hidden rounded-b-none","header-class":"flex flex-row justify-between items-center"},{header:Z(()=>[a(d).length>1?(I(),re(Qt,{key:0,appearance:"raw",class:"raw-hover-surface oc-bottom-drawer-back-button","aria-label":a(o)("Open the parent context menu"),onClick:y[0]||(y[0]=$=>w())},{default:Z(()=>[J(E,{name:"arrow-left","fill-type":"line"})]),_:1},8,["aria-label"])):le("",!0),Q("span",{class:"font-semibold",textContent:R.toDisplayString(e.title)},null,8,pE),J(Qt,{appearance:"raw",class:"raw-hover-surface oc-bottom-drawer-close-button","aria-label":a(o)("Close the context menu"),onClick:y[1]||(y[1]=$=>a(u)())},{default:Z(()=>[J(E,{name:"close","fill-type":"line"})]),_:1},8,["aria-label"])]),default:Z(()=>[Q("div",{ref_key:"bottomDrawerCardBodyRef",ref:f},[Ce(S.$slots,"default")],512)]),_:3})]),_:3},8,["id","is-drawer-active","is-focus-trap-active"])]),_:3})):le("",!0)}}}),mE=["id"],gE=ge({__name:"OcDrop",props:{title:{default:""},closeOnClick:{type:Boolean,default:!1},dropId:{default:()=>_r("oc-drop-")},isNestedElement:{type:Boolean,default:!1},mode:{default:"click"},offset:{type:[Array,Function],default:[0,0]},paddingSize:{default:"medium"},popperOptions:{default:()=>({})},position:{default:"bottom-start"},target:{},toggle:{default:""},enforceDropOnMobile:{type:Boolean,default:!1}},emits:["hideDrop","showDrop"],setup(e,{expose:t,emit:n}){const r=n,{isMobile:o}=os(),s=W(!1),i=A(()=>a(o)&&!e.enforceDropOnMobile),l=nn("bottomDrawerRef"),u=nn("drop"),d=W(null),c=()=>{if(a(i)){a(l).show();return}a(d)?.show()},p=()=>{if(a(i)){a(l).hide();return}a(d)?.hide()};t({show:c,hide:p,tippy:d});const f=w=>{const T=w.target.closest(".oc-button")?.hasAttribute("aria-expanded");e.closeOnClick&&!T&&p()},h=w=>{const T=u.value?.closest(".tippy-box");w.relatedTarget&&!T?.contains(w.relatedTarget)&&p()},g=A(()=>({hover:"mouseenter focus",click:void 0,manual:void 0})[e.mode]||e.mode);Ue(()=>e.position,()=>{a(d)?.setProps({placement:e.position})}),Ue(()=>e.mode,()=>{a(d)?.setProps({trigger:g.value})}),bn(()=>{a(u)?.removeEventListener("focusout",h),hc(a(d))});const m=()=>{hc(a(d));const w=e.target?document.querySelector(e.target):e.toggle?document.querySelector(e.toggle):u.value?.previousElementSibling,T=u.value;if(!w||!T)return;const k={trigger:g.value,placement:e.position,arrow:!1,hideOnClick:!e.isNestedElement,interactive:!0,plugins:[dE],theme:"none",maxWidth:416,offset:e.offset,onShow:S=>{s.value=!0,r("showDrop"),e.isNestedElement||uE({exclude:S})},onHide:()=>{s.value=!1,r("hideDrop")},popperOptions:{...e.popperOptions,modifiers:[...e.popperOptions?.modifiers?e.popperOptions.modifiers:[],{name:"fixVerticalPosition",enabled:!0,phase:"beforeWrite",requiresIfExists:["offset","preventOverflow","flip"],fn({state:S}){const y=To(S),E=S.modifiersData.fullHeight||S.elements.popper.offsetHeight,D=y.top*-1-10,$=D+E+y.bottom*-1,_=$-D,L=$-_;E>_&&E>L&&(S.styles.popper.top=`-${D}px`,S.modifiersData.fullHeight=E),E>$&&(S.styles.popper.maxHeight=`${$-10}px`,S.styles.popper.overflowY="auto",S.styles.popper.overflowX="hidden")}}]},content:T};e.target&&(k.triggerTarget=e.toggle?document.querySelector(e.toggle):u.value?.previousElementSibling),d.value=ys(w,k),u.value?.addEventListener("focusout",h)};return Ue(i,async()=>{if(await xt(),a(i)){a(d)&&hc(a(d));return}m()},{immediate:!0}),(w,T)=>i.value?(I(),re(hE,{key:0,ref_key:"bottomDrawerRef",ref:l,"drawer-id":e.dropId,toggle:e.toggle,"close-on-click":e.closeOnClick,title:e.title,onShow:T[0]||(T[0]=k=>r("showDrop")),onHide:T[1]||(T[1]=k=>r("hideDrop"))},{default:Z(()=>[Ce(w.$slots,"default")]),_:3},8,["drawer-id","toggle","close-on-click","title"])):(I(),G("div",{key:1,id:e.dropId,ref_key:"drop",ref:u,class:"oc-drop shadow-md/20 rounded-sm",onClick:f},[s.value&&w.$slots.default?(I(),re(mc,{key:0,"body-class":[a(BS)(e.paddingSize)]},{default:Z(()=>[Ce(w.$slots,"default")]),_:3},8,["body-class"])):s.value?Ce(w.$slots,"special",{key:1}):le("",!0)],8,mE))}}),vE=["type","disabled"],yE={class:"flex flex-row flex-wrap text-sm pt-2 gap-x-2"},bE=["textContent"],mm="file-copy",wE=ge({__name:"OcTextInputPassword",props:{disabled:{type:Boolean,default:!1},generatePasswordMethod:{type:Function},hasError:{type:Boolean,default:!1},passwordPolicy:{},value:{default:""}},emits:["passwordChallengeCompleted","passwordChallengeFailed","passwordGenerated"],setup(e,{expose:t,emit:n}){const r=n,o=nn("passwordInput"),{$gettext:s}=me.useGettext(),i=W(e.value),l=W(!1),u=W(mm),d=W(!1),c=A(()=>!!Object.keys(e.passwordPolicy?.rules||{}).length),p=A(()=>e.passwordPolicy?.missing(a(i))),f=k=>{const S={};for(let y=0;y<k.format.length;y++)S[`param${y+1}`]=k.format[y]?.toString();return s(k.message,S,!0)},h=()=>{navigator.clipboard.writeText(a(i)),u.value="check",setTimeout(()=>u.value=mm,1500)},g=()=>{const k=e.generatePasswordMethod();i.value=k,r("passwordGenerated",i.value)};return t({focus:()=>{a(o).focus()},select:()=>{a(o).select()},setSelectionRange:(k,S)=>{a(o).setSelectionRange(k,S)}}),Ue(i,k=>{if(Object.keys(e.passwordPolicy).length){if(!e.passwordPolicy.check(k))return r("passwordChallengeFailed");r("passwordChallengeCompleted")}}),(k,S)=>{const y=oe("oc-contextual-helper"),E=oe("portal"),D=Lt("oc-tooltip");return I(),G(Ae,null,[Q("div",{class:R.normalizeClass(["oc-text-input-password-wrapper flex flex-row border rounded-sm",{"oc-text-input-password-wrapper-danger text-role-error focus:text-role-error border-role-error":e.hasError,"border-role-surface outline-2 outline-role-outline":d.value,"border-role-outline":!d.value}])},[je(Q("input",pt(k.$attrs,{ref_key:"passwordInput",ref:o,"onUpdate:modelValue":S[0]||(S[0]=$=>i.value=$),class:"grow-2 border-0 focus:border-0 focus:outline-0",type:l.value?"text":"password",disabled:e.disabled,onFocus:S[1]||(S[1]=$=>d.value=!0),onBlur:S[2]||(S[2]=$=>d.value=!1)}),null,16,vE),[[Ey,i.value]]),i.value&&!e.disabled?je((I(),re(Qt,{key:0,"aria-label":l.value?a(s)("Hide password"):a(s)("Show password"),class:"oc-text-input-show-password-toggle px-2",appearance:"raw",size:"small",onClick:S[3]||(S[3]=$=>l.value=!l.value)},{default:Z(()=>[J(or,{size:"small",name:l.value?"eye-off":"eye"},null,8,["name"])]),_:1},8,["aria-label"])),[[D,l.value?a(s)("Hide password"):a(s)("Show password")]]):le("",!0),i.value&&!e.disabled?je((I(),re(Qt,{key:1,"aria-label":a(s)("Copy password"),class:"oc-text-input-copy-password-button px-2",appearance:"raw",size:"small",onClick:h},{default:Z(()=>[J(or,{size:"small",name:u.value},null,8,["name"])]),_:1},8,["aria-label"])),[[D,a(s)("Copy password")]]):le("",!0),e.generatePasswordMethod&&!e.disabled?je((I(),re(Qt,{key:2,"aria-label":a(s)("Generate password"),class:"oc-text-input-generate-password-button px-2",appearance:"raw",size:"small",onClick:g},{default:Z(()=>[J(or,{size:"small",name:"refresh","fill-type":"line"})]),_:1},8,["aria-label"])),[[D,a(s)("Generate password")]]):le("",!0)],2),c.value?(I(),re(E,{key:0,to:"app.design-system.password-policy"},{default:Z(()=>[Q("div",yE,[(I(!0),G(Ae,null,Ye(p.value.rules,($,_)=>(I(),G("div",{key:_,class:"flex items-center oc-text-input-password-policy-rule"},[J(or,{size:"small",class:"mr-1",name:$.verified?"checkbox-circle":"close-circle",color:$.verified?"var(--oc-role-on-surface)":"var(--oc-role-error)"},null,8,["name","color"]),Q("span",{class:R.normalizeClass([{"oc-text-input-danger":!$.verified}]),textContent:R.toDisplayString(f($))},null,10,bE),$.helperMessage?(I(),re(y,{key:0,text:$.helperMessage,title:a(s)("Password policy")},null,8,["text","title"])):le("",!0)]))),128))])]),_:1})):le("",!0)],64)}}}),SE=["for"],TE={key:0,class:"text-role-error","aria-hidden":"true"},kE=["id","textContent"],CE=["id","textContent"],xE=ge({inheritAttrs:!1,__name:"OcTextInput",props:{id:{default:()=>_r("oc-textinput-")},type:{default:"text"},modelValue:{default:""},selectionRange:{},clearButtonEnabled:{type:Boolean,default:!1},clearButtonAccessibleLabel:{default:""},defaultValue:{},disabled:{type:Boolean,default:!1},label:{},inlineLabel:{type:Boolean,default:!1},errorMessage:{},errorMessageDebouncedTime:{default:500},fixMessageLine:{type:Boolean,default:!1},descriptionMessage:{},readOnly:{type:Boolean,default:!1},requiredMark:{type:Boolean,default:!1},passwordPolicy:{default:()=>({})},generatePasswordMethod:{type:Function},hasBorder:{type:Boolean,default:!0}},emits:["change","update:modelValue","focus","passwordChallengeCompleted","passwordChallengeFailed"],setup(e,{expose:t,emit:n}){const r=n,o=W(!1),s=A(()=>!!e.descriptionMessage),i=A(()=>e.fixMessageLine||a(o)||a(s)),l=A(()=>a(o).toString()),u=A(()=>`${e.id}-message`),d=A(()=>e.type==="password"?{passwordGenerated:S}:{}),c=Js(),p=A(()=>{const $={};(a(o)||a(s))&&($["aria-describedby"]=u.value),e.defaultValue&&($.placeholder=e.defaultValue),e.type==="password"&&($["password-policy"]=e.passwordPolicy,$["generate-password-method"]=e.generatePasswordMethod,$["has-error"]=a(o));const{change:_,input:L,focus:V,class:te,...B}=c;return{...B,...$}}),f=A(()=>!e.disabled&&e.clearButtonEnabled&&!!e.modelValue),h=A(()=>e.clearButtonAccessibleLabel||"Clear input"),g=A(()=>e.type==="password"?wE:"input"),m=nn("inputRef"),w=()=>{a(m).focus()};t({focus:w});function T(){w(),S(""),k(null)}const k=$=>{r("change",$)},S=$=>{r("update:modelValue",$)},y=async $=>{await xt(),a(m).select(),E(),r("focus",$.value)},E=()=>{e.selectionRange&&e.selectionRange.length>1&&a(m).setSelectionRange(e.selectionRange[0],e.selectionRange[1])};Ue([()=>e.selectionRange,m],async()=>{a(m)&&(await xt(),E())},{immediate:!0});const D=rt.debounce(()=>{o.value=!!e.errorMessage},e.errorMessageDebouncedTime);return Ue(()=>e.modelValue,()=>{D()}),Ue(()=>e.errorMessage,()=>{e.errorMessage?D():(o.value=!1,D.cancel?.())}),($,_)=>(I(),G("div",{class:R.normalizeClass([{"flex items-center":e.inlineLabel},$.$attrs.class])},[Ce($.$slots,"label",{},()=>[Q("label",{class:R.normalizeClass(["inline-block",{"mr-2":e.inlineLabel,"mb-0.5":!e.inlineLabel}]),for:e.id},[ct(R.toDisplayString(e.label)+" ",1),e.requiredMark?(I(),G("span",TE,"*")):le("",!0)],10,SE)]),Q("div",{class:R.normalizeClass(["relative",{"grow-1":e.inlineLabel}])},[e.readOnly?(I(),re(or,{key:0,name:"lock",size:"small",class:"mt-2 ml-2 absolute"})):le("",!0),(I(),re(rn(g.value),pt({id:e.id},p.value,{ref_key:"inputRef",ref:m,"aria-invalid":l.value,class:["oc-text-input oc-input",{"oc-text-input-danger border-role-error":!!o.value,"pl-6":!!e.readOnly,"pr-6":f.value,"border-none outline-none bg-transparent":!e.hasBorder}],type:e.type,value:e.modelValue,disabled:e.disabled||e.readOnly},Gs(d.value),{onChange:_[0]||(_[0]=L=>k(L.target.value)),onInput:_[1]||(_[1]=L=>S(L.target.value)),onPasswordChallengeCompleted:_[2]||(_[2]=L=>$.$emit("passwordChallengeCompleted")),onPasswordChallengeFailed:_[3]||(_[3]=L=>$.$emit("passwordChallengeFailed")),onFocus:_[4]||(_[4]=L=>y(L.target))}),null,16,["id","aria-invalid","class","type","value","disabled"])),f.value?(I(),re(Qt,{key:1,"aria-label":h.value,class:"pr-2 absolute top-[50%] transform-[translateY(-50%)] right-0 oc-text-input-btn-clear",appearance:"raw","no-hover":"",onClick:T},{default:Z(()=>[J(or,{name:"close",size:"small"})]),_:1},8,["aria-label"])):le("",!0)],2),i.value?(I(),G("div",{key:0,class:R.normalizeClass(["oc-text-input-message flex align-center text-sm mt-1 min-h-4.5",{"oc-text-input-description text-role-on-surface-variant relative":s.value,"oc-text-input-danger text-role-error focus:text-role-error border-role-error":o.value}])},[o.value?(I(),G(Ae,{key:0},[o.value?(I(),re(or,{key:0,name:"error-warning",size:"small","fill-type":"line","aria-hidden":"true",class:"mr-1"})):le("",!0),o.value?(I(),G("span",{key:1,id:u.value,class:"oc-text-input-danger text-role-error focus:text-role-error border-role-error",textContent:R.toDisplayString(e.errorMessage)},null,8,kE)):le("",!0)],64)):s.value?(I(),G("span",{key:1,id:u.value,class:"oc-text-input-description text-role-on-surface-variant flex items-center relative",textContent:R.toDisplayString(e.descriptionMessage)},null,8,CE)):le("",!0)],2)):le("",!0),e.type==="password"?(I(),re(a(Rs.PortalTarget),{key:1,name:"app.design-system.password-policy"})):le("",!0)],2))}});var AE=Object.defineProperty,gm=Object.getOwnPropertySymbols,EE=Object.prototype.hasOwnProperty,RE=Object.prototype.propertyIsEnumerable,vm=(e,t,n)=>t in e?AE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,DE=(e,t)=>{for(var n in t||(t={}))EE.call(t,n)&&vm(e,n,t[n]);if(gm)for(var n of gm(t))RE.call(t,n)&&vm(e,n,t[n]);return e};const ym=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},PE={},IE={xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"},FE=Q("path",{d:"M6.895455 5l2.842897-2.842898c.348864-.348863.348864-.914488 0-1.263636L9.106534.261648c-.348864-.348864-.914489-.348864-1.263636 0L5 3.104545 2.157102.261648c-.348863-.348864-.914488-.348864-1.263636 0L.261648.893466c-.348864.348864-.348864.914489 0 1.263636L3.104545 5 .261648 7.842898c-.348864.348863-.348864.914488 0 1.263636l.631818.631818c.348864.348864.914773.348864 1.263636 0L5 6.895455l2.842898 2.842897c.348863.348864.914772.348864 1.263636 0l.631818-.631818c.348864-.348864.348864-.914489 0-1.263636L6.895455 5z"},null,-1),$E=[FE];function OE(e,t){return I(),G("svg",IE,$E)}const LE=ym(PE,[["render",OE]]),_E={},ME={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"10"},NE=Q("path",{d:"M9.211364 7.59931l4.48338-4.867229c.407008-.441854.407008-1.158247 0-1.60046l-.73712-.80023c-.407008-.441854-1.066904-.441854-1.474243 0L7 5.198617 2.51662.33139c-.407008-.441853-1.066904-.441853-1.474243 0l-.737121.80023c-.407008.441854-.407008 1.158248 0 1.600461l4.48338 4.867228L7 10l2.211364-2.40069z"},null,-1),BE=[NE];function jE(e,t){return I(),G("svg",ME,BE)}DE({},{Deselect:LE,OpenIndicator:ym(_E,[["render",jE]])});const zE=["aria-label","aria-live","aria-hidden","role"],UE=ge({__name:"OcSpinner",props:{ariaLabel:{default:()=>{}},size:{default:"medium"}},setup(e){return(t,n)=>(I(),G("span",{class:R.normalizeClass(["oc-spinner inline-block after:block after:bg-transparent after:border after:border-current after:rounded-full after:size-full relative after:relative animate-spin after:content-[''] after:border-b-transparent",{"size-2":e.size==="xsmall","size-4":e.size==="small","size-5":e.size==="medium","size-8":e.size==="large","size-10":e.size==="xlarge","size-12":e.size==="xxlarge","size-16":e.size==="xxxlarge"}]),"aria-label":e.ariaLabel||void 0,"aria-live":e.ariaLabel?"polite":void 0,"aria-hidden":e.ariaLabel?void 0:"true",tabindex:"-1",role:e.ariaLabel?"img":void 0},null,10,zE))}}),VE={class:"oc-status-indicators flex"},qE=["id","textContent"],HE=ge({__name:"OcStatusIndicators",props:{resource:{},indicators:{},disableHandler:{type:Boolean,default:!1}},setup(e){const{$gettext:t}=me.useGettext(),n=W({}),r=s=>Object.hasOwn(s,"handler"),o=s=>s.accessibleDescription?(a(n)[s.id]||(a(n)[s.id]=_r("oc-indicator-description-")),a(n)[s.id]):null;return(s,i)=>{const l=Lt("oc-tooltip");return I(),G("div",VE,[(I(!0),G(Ae,null,Ye(e.indicators,(u,d)=>(I(),G(Ae,null,[r(u)&&!e.disableHandler?je((I(),re(Qt,{id:u.id,key:`${u.id}-handler`,class:R.normalizeClass(["oc-status-indicators-indicator",{"ml-1":d>0}]),"aria-label":a(t)(u.label),"aria-describedby":o(u),appearance:"raw","data-testid":u.id,"data-test-indicator-type":u.type,"data-test-indicator-resource-name":e.resource.name,"data-test-indicator-resource-path":e.resource.path,"no-hover":"",onClick:c=>u.handler?.(e.resource,c)},{default:Z(()=>[J(or,{name:u.icon,size:"small","fill-type":u.fillType},null,8,["name","fill-type"])]),_:2},1032,["id","class","aria-label","aria-describedby","data-testid","data-test-indicator-type","data-test-indicator-resource-name","data-test-indicator-resource-path","onClick"])),[[l,a(t)(u.label)]]):je((I(),re(or,{id:u.id,key:u.id,tabindex:"-1",size:"small",class:R.normalizeClass(["oc-status-indicators-indicator",{"ml-1":d>0}]),name:u.icon,"fill-type":u.fillType,"accessible-label":a(t)(u.label),"aria-describedby":o(u),"data-testid":u.id,"data-test-indicator-type":u.type},null,8,["id","class","name","fill-type","accessible-label","aria-describedby","data-testid","data-test-indicator-type"])),[[l,a(t)(u.label)]]),o(u)?(I(),G("p",{id:o(u),key:o(u),class:"sr-only",textContent:R.toDisplayString(a(t)(u.accessibleDescription))},null,8,qE)):le("",!0)],64))),256))])}}}),WE={class:"oc-thead border-b"},QE=ge({name:"OcTableHead",__name:"OcTableHead",setup(e){return(t,n)=>(I(),G("thead",WE,[Ce(t.$slots,"default")]))}}),KE=ge({name:"OcTableBody",__name:"OcTableBody",setup(e){return(t,n)=>(I(),G("tbody",null,[Ce(t.$slots,"default")]))}}),bm=Le(ge({__name:"OcTableCell",props:{alignH:{default:"left"},alignV:{default:"middle"},type:{default:"td"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e,{emit:t}){const n=t;return(r,o)=>(I(),re(rn(e.type),{class:R.normalizeClass(["oc-table-cell",{"break-all":e.wrap==="break","whitespace-nowrap":e.wrap==="nowrap","overflow-visible max-w-0":e.wrap==="truncate","text-left":e.alignH==="left","text-right":e.alignH==="right","text-center":e.alignH==="center","align-top":e.alignV==="top","align-middle":e.alignV==="middle","align-bottom":e.alignV==="bottom","w-px":e.width==="shrink","min-w-38":e.width==="expand"}]),onClick:o[0]||(o[0]=s=>n("click",s))},{default:Z(()=>[Ce(r.$slots,"default",{},void 0,!0)]),_:3},8,["class"]))}}),[["__scopeId","data-v-dc7aa8e1"]]),wm=ge({__name:"OcTableTd",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},setup(e){return(t,n)=>(I(),re(bm,{type:"td","align-h":e.alignH,"align-v":e.alignV,width:e.width,wrap:e.wrap,class:"oc-td"},{default:Z(()=>[Ce(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),Sm=Le(ge({__name:"OcTableTr",props:{lazy:{}},emits:["contextmenu","click","dragstart","drop","dragenter","dragleave","dragover","mouseleave","itemVisible"],setup(e,{emit:t}){const n=t,r=vv((l,u)=>{let d;return{get(){return l(),d},set(c){d=c,u()}}}),o=A(()=>e.lazy?e.lazy.colspan:1),{isVisible:s}=e.lazy?Zp({...e.lazy,target:r,onVisibleCallback:()=>n("itemVisible")}):{isVisible:W(!0)},i=A(()=>!a(s));return e.lazy||n("itemVisible"),(l,u)=>(I(),G("tr",{ref_key:"observerTarget",ref:r,onClick:u[0]||(u[0]=d=>l.$emit("click",d)),onContextmenu:u[1]||(u[1]=d=>l.$emit("contextmenu",d)),onDragstart:u[2]||(u[2]=d=>l.$emit("dragstart",d)),onDrop:u[3]||(u[3]=d=>l.$emit("drop",d)),onDragenter:u[4]||(u[4]=d=>l.$emit("dragenter",d)),onDragleave:u[5]||(u[5]=d=>l.$emit("dragleave",d)),onDragover:u[6]||(u[6]=d=>l.$emit("dragover",d)),onMouseleave:u[7]||(u[7]=d=>l.$emit("mouseleave",d))},[i.value?(I(),re(wm,{key:0,colspan:o.value},{default:Z(()=>[...u[8]||(u[8]=[Q("span",{class:"shimmer inline-block bg-role-shadow overflow-hidden absolute inset-x-2 inset-y-3 after:absolute after:inset-0 after:transform-[translateX(-100%)] opacity-10 after:animate-shimmer"},null,-1)])]),_:1},8,["colspan"])):Ce(l.$slots,"default",{key:1},void 0,!0)],544))}}),[["__scopeId","data-v-7acab1b8"]]),GE=Le(ge({__name:"OcTableTh",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e){return(t,n)=>(I(),re(bm,{type:"th","align-h":e.alignH,"align-v":e.alignV,width:e.width,wrap:e.wrap,class:"oc-th aria-[sort]:cursor-pointer",onClick:n[0]||(n[0]=r=>t.$emit("click",r))},{default:Z(()=>[Ce(t.$slots,"default",{},void 0,!0)]),_:3},8,["align-h","align-v","width","wrap"]))}}),[["__scopeId","data-v-d746eb11"]]),JE={key:0,class:"oc-table-thead-content inline-table align-middle"},XE=["textContent"],YE={key:1},ZE={key:0,class:"oc-table-thead-content inline-table align-middle"},eR=["textContent"],tR={key:1,class:"oc-table-footer border-t"},nR={class:"oc-table-footer-row h-10.5"},rR=["colspan"],oR=Le(ge({__name:"OcTable",props:{data:{},fields:{},disabled:{default:()=>[]},dragDrop:{type:Boolean,default:!1},hasHeader:{type:Boolean,default:!0},headerPosition:{default:0},highlighted:{},hover:{type:Boolean,default:!1},idKey:{default:"id"},itemDomSelector:{type:Function},lazy:{type:Boolean,default:!1},paddingX:{default:"small"},sortBy:{},sortDir:{},sticky:{type:Boolean,default:!1}},emits:["itemDropped","itemDragged","theadClicked","highlight","rowMounted","contextmenuClicked","sort","dropRowStyling","itemVisible"],setup(e,{emit:t}){const n=t,r={EVENT_THEAD_CLICKED:PS,EVENT_TROW_CLICKED:IS,EVENT_TROW_MOUNTED:FS,EVENT_TROW_CONTEXTMENU:$S},{$gettext:o}=me.useGettext(),s=B=>e.itemDomSelector?e.itemDomSelector(B):B[e.idKey],i=A(()=>{const B=["oc-table"];return e.hover&&B.push("oc-table-hover"),e.sticky&&B.push("oc-table-sticky"),B}),l=A(()=>e.fields.length),u=B=>{B.preventDefault()},d=(B,O)=>{n(OS,[B,O])},c=(B,O)=>{n(of,[B,O])},p=(B,O,M)=>{n("dropRowStyling",B,O,M)},f=B=>B.type==="slot",h=B=>["callback","function"].indexOf(B.type)>=0,g=B=>Object.prototype.hasOwnProperty.call(B,"title")?B.title:B.name,m=()=>({class:i.value}),w=B=>{switch(e.paddingX){case"remove":return B==="right"?"pr-0":"pl-0";case"xsmall":return B==="right"?"pr-1":"pl-1";case"small":return B==="right"?"pr-2":"pl-2";case"medium":return B==="right"?"pr-4":"pl-4";case"large":return B==="right"?"pr-6":"pl-6";case"xlarge":return B==="right"?"pr-12":"pl-12";case"xxlarge":return B==="right"?"pr-24":"pl-24"}},T=(B,O)=>{const M=y(B);return M.class=`oc-table-header-cell oc-table-header-cell-${B.name}`,Object.prototype.hasOwnProperty.call(B,"thClass")&&(M.class+=` ${B.thClass}`),e.sticky&&(M.style=`top: ${e.headerPosition}px;`,M.class+=" z-10"),O===0&&(M.class+=` ${w("left")} `),O===e.fields.length-1&&(M.class+=` ${w("right")}`),L(M,B),M},k=(B,O)=>({...e.lazy&&{lazy:{colspan:l.value}},class:["oc-tbody-tr",`oc-tbody-tr-${s(B)||O}`,E(B)?"oc-table-highlighted":void 0,...D(B)?["oc-table-disabled","opacity-70","pointer-events-none","grayscale-60"]:[]].filter(Boolean)}),S=(B,O,M)=>{const N=y(B);return N.class=`oc-table-data-cell oc-table-data-cell-${B.name}`,Object.prototype.hasOwnProperty.call(B,"tdClass")&&(N.class+=` ${B.tdClass}`),Object.prototype.hasOwnProperty.call(B,"wrap")&&(N.wrap=B.wrap),O===0&&(N.class+=` ${w("left")} `),O===e.fields.length-1&&(N.class+=` ${w("right")}`),Object.prototype.hasOwnProperty.call(B,"accessibleLabelCallback")&&(N["aria-label"]=B.accessibleLabelCallback(M)),N},y=B=>({...B?.alignH&&{alignH:B.alignH},...B?.alignV&&{alignV:B.alignV},...B?.width&&{width:B.width},class:void 0,wrap:void 0,style:void 0}),E=B=>e.highlighted?Array.isArray(e.highlighted)?e.highlighted.indexOf(B[e.idKey])>-1:e.highlighted===B[e.idKey]:!1,D=B=>e.disabled.length?e.disabled.indexOf(B[e.idKey])>-1:!1,$=(B,O,M)=>{const N=[M[e.idKey],O+1].filter(Boolean);return f(B)?[...N,B.name].join("-"):h(B)?[...N,B.callback(M[B.name])].join("-"):[...N,M[B.name]].join("-")},_=B=>o("Sort by %{ name }",{name:B}),L=(B,O)=>{if(!V(O))return;let M="none";e.sortBy===O.name&&(M=e.sortDir===Xe.Asc?"ascending":"descending"),B["aria-sort"]=M},V=({sortable:B})=>!!B,te=B=>{if(!V(B))return;let O=e.sortDir;e.sortBy===B.name&&e.sortDir!==void 0&&(O=e.sortDir===Xe.Desc?Xe.Asc:Xe.Desc),(e.sortBy!==B.name||e.sortDir===void 0)&&(O=B.sortDir||Xe.Desc),n("sort",{sortBy:B.name,sortDir:O})};return(B,O)=>{const M=oe("oc-icon");return I(),G("table",pt(m(),{class:"has-item-context-menu"}),[e.hasHeader?(I(),re(QE,{key:0},{default:Z(()=>[J(Sm,{class:"oc-table-header-row h-10.5"},{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.fields,(N,q)=>(I(),re(GE,pt({key:`oc-thead-${N.name}`},{ref_for:!0},T(N,q)),{default:Z(()=>[N.sortable?(I(),re(Qt,{key:0,"aria-label":_(N.name),appearance:"raw","justify-content":"left",class:"oc-button-sort w-full hover:underline","gap-size":"small","no-hover":"",onClick:j=>te(N)},{default:Z(()=>[N.headerType==="slot"?(I(),G("span",JE,[Ce(B.$slots,N.name+"Header",{},void 0,!0)])):(I(),G("span",{key:1,class:"oc-table-thead-content inline-table align-middle header-text",textContent:R.toDisplayString(g(N))},null,8,XE)),J(M,{name:e.sortDir==="asc"?"arrow-down":"arrow-up","fill-type":"line",class:R.normalizeClass([{"sr-only":e.sortBy!==N.name},"p-1 rounded-sm"]),size:"small"},null,8,["name","class"])]),_:2},1032,["aria-label","onClick"])):(I(),G("div",YE,[N.headerType==="slot"?(I(),G("span",ZE,[Ce(B.$slots,N.name+"Header",{},void 0,!0)])):(I(),G("span",{key:1,class:"oc-table-thead-content inline-table align-middle header-text",textContent:R.toDisplayString(g(N))},null,8,eR))]))]),_:2},1040))),128))]),_:3})]),_:3})):le("",!0),J(KE,{class:"has-item-context-menu"},{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.data,(N,q)=>(I(),re(Sm,pt({key:`oc-tbody-tr-${s(N)||q}`,ref_for:!0,ref:`row-${q}`},{ref_for:!0},k(N,q),{"data-item-id":N[e.idKey],draggable:e.dragDrop,class:"border-t h-10.5",onClick:j=>B.$emit(r.EVENT_TROW_CLICKED,[N,j]),onContextmenu:j=>B.$emit(r.EVENT_TROW_CONTEXTMENU,B.$refs[`row-${q}`][0],j,N),onVnodeMounted:j=>B.$emit(r.EVENT_TROW_MOUNTED,N,B.$refs[`row-${q}`][0]),onDragstart:j=>d(N,j),onDrop:j=>c(N,j),onDragenter:wt(j=>p(N,!1,j),["prevent"]),onDragleave:wt(j=>p(N,!0,j),["prevent"]),onDragover:O[0]||(O[0]=j=>u(j)),onItemVisible:j=>B.$emit("itemVisible",N)}),{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.fields,(j,H)=>(I(),re(wm,pt({key:"oc-tbody-td-"+$(j,H,N)},{ref_for:!0},S(j,H,N)),{default:Z(()=>[f(j)?Ce(B.$slots,j.name,{key:0,item:N},void 0,!0):h(j)?(I(),G(Ae,{key:1},[ct(R.toDisplayString(j.callback(N[j.name])),1)],64)):(I(),G(Ae,{key:2},[ct(R.toDisplayString(N[j.name]),1)],64))]),_:2},1040))),128))]),_:2},1040,["data-item-id","draggable","onClick","onContextmenu","onVnodeMounted","onDragstart","onDrop","onDragenter","onDragleave","onItemVisible"]))),128))]),_:3}),B.$slots.footer?(I(),G("tfoot",tR,[Q("tr",nR,[Q("td",{colspan:l.value,class:"oc-table-footer-cell p-1 text-sm text-role-on-surface-variant"},[Ce(B.$slots,"footer",{},void 0,!0)],8,rR)])])):le("",!0)],16)}}}),[["__scopeId","data-v-57029fa4"]]),gc=()=>{const{$gettext:e,$ngettext:t}=me.useGettext(),{showMessage:n,showErrorMessage:r}=Me(),{copy:o}=Rn.useClipboard(),s=({result:l,password:u})=>{const d=l.filter(Nr);let c="";if(d.length){let f=e("Link has been created successfully");if(l.length===1)try{c=u?e("%{link} Password:%{password}",{link:d[0].value.webUrl,password:u},!0):d[0].value.webUrl,f=e("The link has been copied to your clipboard.")}catch(h){console.warn("Unable to copy link to clipboard",h)}n({title:t(f,"Links have been created successfully.",d.length)})}const p=l.filter(Br);return p.length&&r({errors:p.map(({reason:f})=>f),title:t("Failed to create link","Failed to create links",p.length)}),c};return{copyLink:async({createLinkHandler:l,password:u})=>{if(navigator.clipboard.write)await new Promise((d,c)=>{const p=new ClipboardItem({"text/plain":l().then(f=>{const h=s({result:f,password:u}),g=new Blob([h],{type:"text/plain"});return d(),g}).catch(f=>{throw c(),f})});navigator.clipboard.write([p])});else{const d=await l(),c=s({result:d,password:u});c&&o(c)}}}},Ji=()=>{const{$gettext:e}=me.useGettext(),t=Dt(),n=Bt(),r=A(()=>n.can("create-all","PublicLink")),o=A(()=>Wt.View),s=d=>d===Wt.View?t.sharingPublicPasswordEnforcedFor.read_only:d===Wt.Upload?t.sharingPublicPasswordEnforcedFor.upload_only:d===Wt.CreateOnly?t.sharingPublicPasswordEnforcedFor.read_write:d===Wt.Edit?t.sharingPublicPasswordEnforcedFor.read_write_delete:!1,i=({isFolder:d})=>a(r)?d?[Wt.View,Wt.Edit,Wt.CreateOnly]:[Wt.View,Wt.Edit]:[],l=[{id:Wt.View,displayName:e("Can view"),description:e("View, download"),icon:"eye"},{id:Wt.Upload,displayName:e("Can upload"),description:e("View, upload, download"),icon:"upload"},{id:Wt.Edit,displayName:e("Can edit"),description:e("View, upload, edit, download, delete"),icon:"pencil"},{id:Wt.CreateOnly,displayName:e("Secret File Drop"),description:e("Upload only, existing content is not revealed"),icon:"inbox-unarchive"}];return{defaultLinkType:o,isPasswordEnforcedForLinkType:s,getAvailableLinkTypes:i,linkShareRoles:l,getLinkRoleByType:d=>l.find(({id:c})=>c===d)}},sR=ge({name:"LinkRoleDropdown",props:{modelValue:{type:Object,required:!0},availableLinkTypeOptions:{type:Array,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=me.useGettext(),{getLinkRoleByType:r}=Ji(),o=u=>e.modelValue===u,s=u=>{t("update:modelValue",u)},i=A(()=>n(r(e.modelValue)?.displayName)),l=Ct.v4();return{isSelectedType:o,updateSelectedType:s,currentLinkRoleLabel:i,dropUuid:l,getLinkRoleByType:r}}}),iR=["textContent"],aR=["textContent"],lR={class:"flex items-center"},cR={class:"text-left"},uR=["textContent"],dR={class:"text-sm leading-4"},fR={class:"flex"};function pR(e,t,n,r,o,s){const i=oe("oc-icon"),l=oe("oc-button"),u=oe("oc-list"),d=oe("oc-drop"),c=Lt("oc-tooltip");return I(),G(Ae,null,[e.availableLinkTypeOptions.length>1?(I(),re(l,{key:0,id:`link-role-dropdown-toggle-${e.dropUuid}`,appearance:"raw","gap-size":"none","no-hover":"",class:"text-left link-role-dropdown-toggle"},{default:Z(()=>[Q("span",{class:"link-current-role",textContent:R.toDisplayString(e.currentLinkRoleLabel||e.$gettext("Select a role"))},null,8,iR),J(i,{name:"arrow-down-s"})]),_:1},8,["id"])):je((I(),G("span",{key:1,class:"link-current-role mr-4",textContent:R.toDisplayString(e.currentLinkRoleLabel)},null,8,aR)),[[c,e.getLinkRoleByType(e.modelValue)?.description]]),e.availableLinkTypeOptions.length>1?(I(),re(d,{key:2,class:"link-role-dropdown w-md",title:e.$gettext("Role"),"drop-id":`link-role-dropdown-${e.dropUuid}`,toggle:`#link-role-dropdown-toggle-${e.dropUuid}`,"padding-size":"small",mode:"click","close-on-click":""},{default:Z(()=>[J(u,{class:"role-dropdown-list"},{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.availableLinkTypeOptions,(p,f)=>(I(),G("li",{key:`role-dropdown-${f}`},[J(l,{id:`files-role-${e.getLinkRoleByType(p).id}`,class:R.normalizeClass([{selected:e.isSelectedType(p)},"p-2"]),appearance:e.isSelectedType(p)?"filled":"raw-inverse","color-role":e.isSelectedType(p)?"secondaryContainer":"surface","justify-content":"space-between",onClick:h=>e.updateSelectedType(p)},{default:Z(()=>[Q("span",lR,[J(i,{name:e.getLinkRoleByType(p).icon,class:"pl-2 pr-4"},null,8,["name"]),Q("span",cR,[Q("span",{class:"role-dropdown-list-option-label font-semibold block w-full leading-4",textContent:R.toDisplayString(e.$gettext(e.getLinkRoleByType(p).displayName))},null,8,uR),Q("span",dR,R.toDisplayString(e.$gettext(e.getLinkRoleByType(p).description)),1)])]),Q("span",fR,[e.isSelectedType(p)?(I(),re(i,{key:0,name:"check"})):le("",!0)])]),_:2},1032,["id","class","appearance","color-role","onClick"])]))),128))]),_:1})]),_:1},8,["title","drop-id","toggle"])):le("",!0)],64)}const Tm=Le(sR,[["render",pR]]),hR={class:"flex justify-between pb-2"},mR={key:0,class:"flex items-center"},gR={key:1,class:"flex items-center"},vR={class:"flex flex-col"},yR=["textContent"],bR=["textContent"],wR=["textContent"],SR={class:"mb-4 ml-[30px]"},TR={key:1,class:"text-sm text-role-on-surface-variant"},kR=["textContent"],CR=["textContent"],xR={class:"flex justify-end items-center mt-2"},AR={class:"sr-only"},km=ge({__name:"CreateLinkModal",props:{modal:{},resources:{},space:{default:()=>{}}},emits:["cancel","confirm"],setup(e,{expose:t}){const n=Pe(),r=me.useGettext(),{$gettext:o}=r,{removeModal:s}=Je(),{copyLink:i}=gc(),l=tg(),{isEnabled:u,postMessage:d}=Tr(),{defaultLinkType:c,getAvailableLinkTypes:p,getLinkRoleByType:f,isPasswordEnforcedForLinkType:h}=Ji(),{addLink:g}=tr(),m=Bn(),{currentTheme:w}=we.storeToRefs(m),T=W(!1),k=W(!1),S=A(()=>e.resources.every(({isFolder:he})=>he)),y=A(()=>a(u)?o("Share link(s)"):o("Copy link")),E=A(()=>a(u)?o("Share link(s) and password(s)"):o("Copy link and password")),D=W(Ct.v4()),$=W({}),_=W(),L=Ta({value:"",error:void 0}),V=W(a(c)),te=A(()=>o(f(a(V)).description)),B=A(()=>o(f(a(V)).displayName)),O=A(()=>f(a(V)).icon),M=A(()=>p({isFolder:a(S)})),N=A(()=>h(a(V))),q=l.getPolicy({enforcePassword:a(N)}),j=()=>{T.value=!0},H=({date:he,error:ie})=>{_.value=he,k.value=ie},se=()=>Promise.allSettled(e.resources.map(he=>g({clientService:n,space:e.space,resource:he,options:{type:a(V),"@libre.graph.quickLink":!1,password:a(L).value,expirationDateTime:a(_)?.toISO(),displayName:o("Unnamed link")}}))),Y=A(()=>q.check(a(L).value)),ae=A(()=>!a(Y)||a(k)),ne=async()=>{const he=await se(),ie=[],de=he.filter(Br);return de.length&&de.map(({reason:ue})=>ue).forEach(ue=>{if(console.error(ue),ue.response?.status===400){const Se=ue.response.data.error;Se.message=rt.upperFirst(Se.message),ie.push(Se)}}),ie.length?(L.error=o(ie[0].message),Promise.reject()):he};t({onConfirm:async(he={})=>{if(a(u)){const de=(await ne()).filter(Nr);de.length&&(d("opencloud-embed:share",de.map(({value:ue})=>ue.webUrl)),d("opencloud-embed:share-links",de.map(({value:ue})=>({url:ue.webUrl,...he.copyPassword&&{password:a(L).value}})))),s(e.modal.id);return}await i({createLinkHandler:ne,password:he.copyPassword?a(L).value:void 0}),s(e.modal.id)}});const fe=he=>{L.value=he,L.error=void 0},be=he=>{V.value=he},xe=()=>l.generatePassword();return yt(()=>{const he=a($)[a(V)];he&&he.$el.focus(),a(N)&&(L.value=l.generatePassword())}),(he,ie)=>{const de=oe("oc-icon"),ue=oe("oc-text-input"),Se=oe("oc-datepicker"),$e=oe("oc-list"),Ve=oe("oc-drop");return I(),G(Ae,null,[Q("div",hR,[T.value?(I(),G("div",mR,[J(de,{class:"mr-2",name:O.value,"fill-type":"line"},null,8,["name"]),J(Tm,{"model-value":V.value,"available-link-type-options":M.value,"onUpdate:modelValue":be},null,8,["model-value","available-link-type-options"])])):(I(),G("div",gR,[J(de,{class:"mr-2",name:O.value,"fill-type":"line"},null,8,["name"]),Q("div",vR,[Q("span",{class:"font-semibold",textContent:R.toDisplayString(B.value)},null,8,yR),Q("span",{class:"text-sm",textContent:R.toDisplayString(te.value)},null,8,bR)])])),T.value?le("",!0):(I(),re(a(Qt),{key:2,class:"link-modal-advanced-mode-button","gap-size":"xsmall",appearance:"raw","no-hover":"",onClick:ie[0]||(ie[0]=lt=>j())},{default:Z(()=>[J(de,{name:"settings-3",size:"small","fill-type":"fill"}),Q("span",{textContent:R.toDisplayString(a(o)("Options"))},null,8,wR)]),_:1}))]),Q("div",SR,[T.value?(I(),re(ue,{key:D.value,"model-value":L.value,type:"password","password-policy":a(q),"generate-password-method":xe,"error-message":L.error,label:a(o)("Password"),"required-mark":N.value,class:"link-modal-password-input","onUpdate:modelValue":fe},null,8,["model-value","password-policy","error-message","label","required-mark"])):L.value?(I(),G("div",TR,[Q("span",{textContent:R.toDisplayString(a(o)("Password:"))},null,8,kR),Q("span",{textContent:R.toDisplayString(L.value)},null,8,CR)])):le("",!0),T.value?(I(),re(Se,{key:2,class:"mt-2","min-date":a(vt.DateTime).now(),label:a(o)("Expiry date"),"is-dark":a(w).isDark,onDateChanged:H},null,8,["min-date","label","is-dark"])):le("",!0)]),Q("div",xR,[J(a(Qt),{class:"link-modal-cancel oc-modal-body-actions-cancel ml-2",onClick:ie[1]||(ie[1]=lt=>he.$emit("cancel"))},{default:Z(()=>[ct(R.toDisplayString(a(o)("Cancel")),1)]),_:1}),Q("div",{class:R.normalizeClass(["ml-2",{"oc-button-group":L.value}])},[J(a(Qt),{class:"link-modal-confirm oc-modal-body-actions-confirm",appearance:"filled",disabled:ae.value,onClick:ie[2]||(ie[2]=lt=>he.$emit("confirm"))},{default:Z(()=>[ct(R.toDisplayString(y.value),1)]),_:1},8,["disabled"]),L.value?(I(),re(a(Qt),{key:0,class:"link-modal-confirm oc-modal-body-actions-confirm-secondary-trigger p-1",appearance:"filled",disabled:ae.value,"aria-label":a(o)("More options")},{default:Z(()=>[J(de,{size:"small",name:"arrow-down-s"}),Q("span",AR,R.toDisplayString(a(o)("More options")),1)]),_:1},8,["disabled","aria-label"])):le("",!0),L.value?(I(),re(Ve,{key:1,"drop-id":"oc-modal-body-actions-confirm-secondary-drop",toggle:".oc-modal-body-actions-confirm-secondary-trigger",mode:"click","padding-size":"small",title:a(o)("More options"),"close-on-click":""},{default:Z(()=>[J($e,null,{default:Z(()=>[Q("li",null,[J(a(Qt),{class:"oc-modal-body-actions-confirm-password",appearance:"raw","justify-content":"left",onClick:ie[3]||(ie[3]=lt=>he.$emit("confirm",{copyPassword:!0}))},{default:Z(()=>[ct(R.toDisplayString(E.value),1)]),_:1})])]),_:1})]),_:1},8,["title"])):le("",!0)],2)])],64)}}}),ER=({enforceModal:e=!1}={})=>{const t=Pe(),n=et(),{$gettext:r,$ngettext:o}=me.useGettext(),s=Dt(),i=Bt(),l=Ut(),{defaultLinkType:u}=Ji(),{addLink:d}=tr(),{dispatchModal:c}=Je(),{copyLink:p}=gc(),f=({space:m,resources:w})=>{const T=s.sharingPublicPasswordEnforcedFor.read_only===!0;if(e||T){c({title:o("Copy link for »%{resourceName}«","Copy links for the selected items",w.length,{resourceName:w[0].name}),customComponent:km,customComponentAttrs:()=>({space:m,resources:w}),hideActions:!0});return}const k=w.map(y=>d({clientService:t,space:m,resource:y,options:{"@libre.graph.quickLink":!1,displayName:r("Unnamed link"),type:a(u)}}));p({createLinkHandler:()=>l.addTask(()=>Promise.allSettled(k))})},h=({resources:m})=>{if(!m.length)return!1;for(const w of m)if(!w.canShare({user:n.user,ability:i})||z.isProjectSpaceResource(w)&&w.disabled)return!1;return!0};return{actions:A(()=>[{name:"create-links",icon:"link",handler:f,label:()=>r("Create links"),isVisible:h,class:"oc-files-actions-create-links"}])}},RR=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=Me(),r=et(),{$gettext:o}=me.useGettext(),{dispatchModal:s}=Je(),i=Mn(),{isEnabled:l}=Tr(),{openEditor:u}=An(),d=Pe(),c=De(),{resources:p,currentFolder:f,areFileExtensionsShown:h}=we.storeToRefs(c),{isFileNameValid:g}=Qr(),m=A(()=>i.fileExtensions.filter(({newFileMenu:S})=>!!S)),w=(S,y)=>(c.upsertResource(S),u(y,a(e),S)),T=(S,y,E)=>{let D=o("New file")+`.${y}`;a(p).some(_=>_.name===D)&&(D=wn(D,y,a(p))),h.value||(D=z.extractNameWithoutExtension({name:D,extension:y}));const $=h.value?[0,D.length-(y.length+1)]:null;s({title:o("Create a new file"),confirmText:o("Create"),hasInput:!0,inputValue:D,inputLabel:o("File name"),inputRequiredMark:!0,inputSelectionRange:$,onConfirm:async _=>{h.value||(_=`${_}.${y}`);try{let L;if(E.createFileHandler)L=await E.createFileHandler({fileName:_,space:a(e),currentFolder:a(f)});else if(E.type==="folder"){const V=Ke.join(a(f).path,_);L=await d.webdav.createFolder(a(e),{path:V})}else{const V=Ke.join(a(f).path,_);L=await d.webdav.putFileContents(a(e),{path:V})}return c.upsertResource(L),t({title:o("»%{fileName}« was created successfully",{fileName:L.name})}),a(l)?void 0:w(L,E)}catch(L){console.error(L),n({title:o("Failed to create file"),errors:[L]})}},onInput:(_,L)=>{const V=h.value?_:`${_}.${y}`,te={path:Ke.join(a(f).path,V),name:V,extension:y},{isValid:B,error:O}=g(te,V);L(B?null:O)}})};return{actions:A(()=>{const S=[],y={};for(const E of a(m)||[])E.hasPriority?y[E.extension]=E:y[E.extension]=y[E.extension]||E;for(const[,E]of Object.entries(y))S.push({name:"create-new-file",icon:"add",handler:D=>T(D,E.extension,E),label:()=>o(E.newFileMenu.menuTitle()),isVisible:()=>a(f)?.canUpload({user:r.user}),class:"oc-files-actions-create-new-file",ext:E.extension,isExternal:E.app?.startsWith("external-")});return S}),openFile:w}},Cm=()=>{const e=Pt("scrollTo"),t=Pt("details"),n=De(),{openSideBarPanel:r}=_t(),o=A(()=>at(a(e))),s=A(()=>at(a(t))),i=(u,d={forceScroll:!1,topbarElement:null})=>{const c=document.querySelectorAll(`[data-item-id='${u}']`)[0];if(!c){ze.publish("app.files.navigate.page",{resourceId:u,forceScroll:d.forceScroll,topbarElement:d.topbarElement});return}const f=document.getElementById(d.topbarElement)?.offsetHeight||0+c.offsetHeight*2;(c.getBoundingClientRect().bottom>window.innerHeight||c.getBoundingClientRect().top<f||d.forceScroll)&&c.scrollIntoView({behavior:"smooth",block:"center"})};return ze.subscribe("app.files.navigate.scrollTo",u=>i(u.resourceId,{forceScroll:u.forceScroll,topbarElement:u.topbarElement})),{scrollToResource:i,scrollToResourceFromRoute:(u,d)=>{if(!a(o)||!u.length)return;const c=a(u).find(p=>z.isIncomingShareResource(p)?p.remoteItemId===a(o):p.id===a(o));c&&c.processing!==!0&&(n.setSelection([c.id]),i(c.id,{forceScroll:!0,topbarElement:d}),a(s)&&r(a(s)))}}},DR=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=Me(),{dispatchModal:r}=Je(),{$gettext:o}=me.useGettext(),{scrollToResource:s}=Cm(),i=De(),{resources:l,currentFolder:u}=we.storeToRefs(i),d=Pe(),{isFileNameValid:c}=Qr(),p=async g=>{g=g.trimEnd();try{const m=Ke.join(a(u).path,g),w=await d.webdav.createFolder(a(e),{path:m});z.isShareSpaceResource(a(e))&&(w.remoteItemId=a(e).id),i.upsertResource(w),t({title:o("»%{folderName}« was created successfully",{folderName:g})}),await xt(),s(w.id,{forceScroll:!0,topbarElement:"files-app-bar"})}catch(m){console.error(m),n({title:o("Failed to create folder"),errors:[m]})}},f=()=>{let g=o("New folder");a(l).some(m=>m.name===g)&&(g=wn(g,"",a(l))),r({title:o("Create a new folder"),confirmText:o("Create"),hasInput:!0,inputValue:g,inputLabel:o("Folder name"),inputRequiredMark:!0,onConfirm:p,onInput:(m,w)=>{const T={path:Ke.join(a(u).path,m),name:m,isFolder:!0},{isValid:k,error:S}=c(T,m,a(l));return w(k?null:S)}})};return{actions:A(()=>[{name:"create-folder",icon:"folder",handler:f,label:()=>o("New Folder"),isVisible:()=>a(u)?.canCreate(),class:"oc-files-actions-create-new-folder"}]),addNewFolder:p}},PR="rowMounted",IR="fileDropped",FR="contextmenuClicked";class bs{static Thumbnail=[36,36];static Tile=[1e3,1e3];static Preview=[1200,1200];static Avatar=64}class $R{static Thumbnail="thumbnail";static Preview="preview";static Avatar="avatar"}const vc=10,OR=63,yc=256;class LR{state;observeEnter;observeExit;onEnterCallCount;onExitCallCount;onEnter;onExit;threshold;unobserver;constructor(t,n,r){this.unobserver=t,this.threshold=n,this.onEnter=r.onEnter,this.onExit=r.onExit,this.observeEnter=!!r.onEnter,this.observeExit=!!r.onExit,this.onEnterCallCount=0,this.onExitCallCount=0}request(t,n){const r={element:n,unobserve:()=>this.unobserve(t,n)};t===0&&this.observeEnter&&this.onEnter?(this.onEnterCallCount++,this.onEnter({callCount:this.onEnterCallCount,...r})):this.state===0&&t===1&&this.observeExit&&this.onExit&&(this.onExitCallCount++,this.onExit({callCount:this.onExitCallCount,...r})),this.state=t}unobserve(t,n){t===0?this.observeEnter=!1:t===1&&(this.observeExit=!1),!this.observeEnter&&!this.observeExit&&this.unobserver(n)}}class xm{targets;intersectionObserver;options;constructor(t={}){this.options={root:t.root,rootMargin:t.rootMargin,threshold:t.threshold||0},this.targets=new WeakMap,this.intersectionObserver=new IntersectionObserver(this.trigger.bind(this),this.options)}observe(t,n={},r){!n.onEnter&&!n.onExit||(this.targets.set(t,new LR(this.unobserve.bind(this),r||this.options.threshold||0,{onEnter:n.onEnter,onExit:n.onExit})),this.intersectionObserver.observe(t))}unobserve(t){this.targets.delete(t),this.intersectionObserver.unobserve(t)}disconnect(){this.targets=new WeakMap,this.intersectionObserver.disconnect()}trigger(t){t.forEach(n=>{const r=this.targets.get(n.target);r&&r.request(n.isIntersecting&&n.intersectionRatio>r.threshold?0:1,n.target)})}}const ws=ge({__name:"ResourceIcon",props:{resource:{},size:{default:"large"}},setup(e){const t={name:"resource-type-folder",color:"var(--oc-color-icon-folder)"},n={name:"resource-type-folder",color:"var(--oc-role-secondary)"},r={name:"layout-grid",color:"var(--oc-role-secondary)"},o={name:"layout-grid",color:"var(--oc-role-secondary)"},s={name:"resource-type-file",color:"var(--oc-role-on-surface)"},i=gd(),l=Jn(md),u=A(()=>a(m)?.name===t.name),d=A(()=>e.resource.type==="space"),c=A(()=>z.isProjectSpaceResource(e.resource)&&e.resource.disabled===!0),p=A(()=>e.resource.type==="folder"||e.resource.isFolder?t:s),f=A(()=>z.isPersonalSpaceResource(e.resource)),h=A(()=>e.resource.extension?.toLowerCase()),g=A(()=>e.resource.mimeType?.toLowerCase()),m=A(()=>{if(a(f))return n;if(a(c))return o;if(a(d))return r;const w=i[a(h)]||l?.mimeType[a(g)]||l?.extension[a(h)];return{...a(p),...w}});return(w,T)=>{const k=oe("oc-icon");return I(),re(k,{key:`resource-icon-${m.value.name}`,name:m.value.name,color:m.value.color,size:e.size,class:R.normalizeClass(["oc-resource-icon","inline-flex","items-center",{"opacity-80 grayscale":c.value,"[&_svg]:h-[70%]":!d.value&&!u.value}])},null,8,["name","color","size","class"])}}}),_R={name:"ResourceLink",props:{link:{type:Object,required:!1,default:null},resource:{type:Object,required:!0},isResourceClickable:{type:Boolean,required:!1,default:!0}},emits:["click"],setup:e=>{const t=Ge(),{options:n}=we.storeToRefs(t);return{linkTarget:A(()=>a(n).cernFeatures&&e.link&&!e.resource.isFolder?"_blank":"_self")}},computed:{isNavigatable(){return this.resource?this.link&&!this.resource.disabled:!1},isClickable(){return this.isResourceClickable&&!this.resource?.disabled}},methods:{emitClick(e){!e||typeof e.stopPropagation!="function"||this.isNavigatable||this.$emit("click",e)}}},MR={key:1};function NR(e,t,n,r,o,s){return n.isResourceClickable?(I(),re(rn(s.isNavigatable?"router-link":"oc-button"),{key:0,to:s.isNavigatable?n.link:void 0,target:s.isNavigatable?e.linkTarget:void 0,rel:s.isNavigatable&&e.linkTarget==="_blank"?"noopener noreferrer":void 0,appearance:s.isNavigatable?void 0:"raw","gap-size":s.isNavigatable?void 0:"none","justify-content":s.isNavigatable?void 0:"left",type:s.isNavigatable?void 0:"button","no-hover":s.isNavigatable?void 0:!0,draggable:!1,class:"oc-resource-link max-w-full",onDragstart:t[0]||(t[0]=wt(()=>{},["prevent","stop"])),onClick:s.emitClick},{default:Z(()=>[Ce(e.$slots,"default",{},void 0,!0)]),_:3},40,["to","target","rel","appearance","gap-size","justify-content","type","no-hover","onClick"])):(I(),G("span",MR,[Ce(e.$slots,"default",{},void 0,!0)]))}const Xi=Le(_R,[["render",NR],["__scopeId","data-v-15d92dd6"]]),BR=["data-test-resource-path","data-test-resource-name","data-test-resource-type","title"],jR={key:0,class:"truncate leading-4"},zR=["textContent"],UR=["textContent"],VR=["textContent"],bc=ge({__name:"ResourceName",props:{name:{},type:{},fullPath:{},pathPrefix:{default:""},extension:{default:""},isPathDisplayed:{type:Boolean,default:!1},isExtensionDisplayed:{type:Boolean,default:!0},truncateName:{type:Boolean,default:!0}},setup(e){const t=A(()=>e.extension?e.name.slice(0,-e.extension.length-1):e.name),n=A(()=>e.extension?"."+e.extension:""),r=A(()=>{if(!e.isPathDisplayed)return null;const l=e.fullPath.replace(/^\//,"").split("/");return l.length<2?null:l.length===2?l[0]+"/":`…/${l[l.length-2]}/`}),o=A(()=>!e.isPathDisplayed||a(r)===e.fullPath?null:e.pathPrefix?qa.join(e.pathPrefix,e.fullPath):e.fullPath),s=A(()=>{if(!a(o))return e.isExtensionDisplayed?`${a(t)}${a(n)}`:a(t)}),i=A(()=>(a(r)||"")+e.name);return(l,u)=>{const d=Lt("oc-tooltip");return je((I(),G("span",{class:R.normalizeClass(["oc-resource-name flex min-w-0",[{"inline-block":!e.truncateName}]]),"data-test-resource-path":e.fullPath,"data-test-resource-name":i.value,"data-test-resource-type":e.type,title:s.value},[e.truncateName?(I(),G("span",jR,[Q("span",{class:"oc-resource-basename whitespace-pre text-role-on-surface",textContent:R.toDisplayString(t.value)},null,8,zR)])):(I(),G("span",{key:1,class:"oc-resource-basename break-normal text-role-on-surface leading-4",textContent:R.toDisplayString(t.value)},null,8,UR)),e.extension&&e.isExtensionDisplayed?(I(),G("span",{key:2,class:"oc-resource-extension whitespace-pre text-role-on-surface leading-4",textContent:R.toDisplayString(n.value)},null,8,VR)):le("",!0)],10,BR)),[[d,o.value]])}}}),qR={class:"flex"},HR=["textContent"],Ss=ge({__name:"ResourceListItem",props:{resource:{},pathPrefix:{default:""},link:{default:null},isPathDisplayed:{type:Boolean,default:!1},parentFolderLink:{default:null},parentFolderName:{default:""},parentFolderLinkIconAdditionalAttributes:{default:()=>({})},isExtensionDisplayed:{type:Boolean,default:!0},isThumbnailDisplayed:{type:Boolean,default:!0},isIconDisplayed:{type:Boolean,default:!0},isResourceClickable:{type:Boolean,default:!0}},emits:["click"],setup(e,{emit:t}){const n=t,{$gettext:r}=me.useGettext(),o=A(()=>e.parentFolderLink?"router-link":"span"),s=A(()=>({"fill-type":"line",name:"folder-2",size:"small",...e.parentFolderLinkIconAdditionalAttributes})),i=A(()=>e.isThumbnailDisplayed&&Object.prototype.hasOwnProperty.call(e.resource,"thumbnail")),l=A(()=>e.resource.thumbnail),u=A(()=>e.resource.locked?r("This item is locked"):null),d=c=>{!c||typeof c.stopPropagation!="function"||n("click",c)};return(c,p)=>{const f=oe("oc-image"),h=oe("oc-icon"),g=Lt("oc-tooltip");return I(),G("div",{class:R.normalizeClass(["oc-resource inline-flex justify-start items-center max-w-full overflow-visible",{"pointer-events-none":!e.isResourceClickable}])},[e.isIconDisplayed?je((I(),re(Xi,{key:0,resource:e.resource,link:e.link,"is-resource-clickable":e.isResourceClickable,class:R.normalizeClass(["relative",{"hover:underline":e.isResourceClickable}]),"aria-label":e.isResourceClickable?a(r)("Open »%{name}«",{name:e.resource?.name??""}):void 0,onClick:d},{default:Z(()=>[i.value?je((I(),re(f,{key:l.value,src:l.value,"data-test-thumbnail-resource-name":e.resource.name,class:"rounded-xs size-8 object-cover max-w-fit","aria-label":u.value,alt:""},null,8,["src","data-test-thumbnail-resource-name","aria-label"])),[[g,u.value]]):je((I(),re(ws,{key:1,"aria-label":u.value,"aria-hidden":"true",resource:e.resource},null,8,["aria-label","resource"])),[[g,u.value]])]),_:1},8,["resource","link","is-resource-clickable","class","aria-label"])),[[g,e.isResourceClickable?u.value:void 0]]):le("",!0),Q("div",{class:R.normalizeClass(["oc-resource-details block truncate",{"pl-2":e.isIconDisplayed}])},[J(Xi,{resource:e.resource,"is-resource-clickable":e.isResourceClickable,link:e.link,class:R.normalizeClass(["hover:outline-offset-0 focus:outline-offset-0",{"hover:underline":e.isResourceClickable}]),onClick:d},{default:Z(()=>[(I(),re(bc,{key:e.resource.name,name:e.resource.name,"path-prefix":e.pathPrefix,extension:e.resource.extension,type:e.resource.type,"full-path":e.resource.path,"is-path-displayed":e.isPathDisplayed,"is-extension-displayed":e.isExtensionDisplayed},null,8,["name","path-prefix","extension","type","full-path","is-path-displayed","is-extension-displayed"]))]),_:1},8,["resource","is-resource-clickable","link","class"]),Q("div",qR,[e.isPathDisplayed?(I(),re(rn(o.value),{key:0,to:e.parentFolderLink,class:R.normalizeClass(["parent-folder flex items-center truncate px-0.5 mr-2 -ml-0.5 hover:bg-transparent",{"cursor-pointer":e.parentFolderLink,"cursor-default":!e.parentFolderLink}])},{default:Z(()=>[J(h,pt(s.value,{class:"mr-1"}),null,16),Q("span",{class:"text truncate text-sm hover:underline",textContent:R.toDisplayString(e.parentFolderName)},null,8,HR)]),_:1},8,["to","class"])):le("",!0)])],2)],2)}}}),Am=ge({__name:"ResourcePreview",props:{searchResult:{default:()=>({data:{}})},isClickable:{type:Boolean,default:!0},term:{default:""}},setup(e){const t=new xm,{triggerDefaultAction:n}=An(),{getMatchingSpace:r}=It(),{getDefaultAction:o}=An(),{loadPreview:s}=Rc(),i=nn("resourceListItem"),{getPathPrefix:l,getParentFolderName:u,getParentFolderLink:d,getParentFolderLinkIconAdditionalAttributes:c,getFolderLink:p}=Cr(),f=De(),h=W(),g=A(()=>f.areFileExtensionsShown),m=A(()=>({...e.searchResult.data,...a(h)&&{thumbnail:a(h)}})),w=A(()=>r(a(m))),T=A(()=>{const _=a(m);return z.isSpaceResource(_)&&_.disabled===!0}),k=()=>{n({space:a(w),resources:[a(m)]})},S=A(()=>e.isClickable?{parentFolderLink:d(a(m)),onClick:k}:{isResourceClickable:!1}),y=A(()=>{if(a(m).isFolder)return p(a(m));const _=o({resources:[a(m)],space:a(w)});if(!_?.route)return null;const L=_.route({space:a(w),resources:[a(m)]});return L.query={...L.query,contextRouteQuery:{...L.query?.contextRouteQuery||{},term:e.term}},L}),E=l(a(m)),D=u(a(m)),$=c(a(m));return yt(()=>{a(T)&&a(i).parentElement.classList.add("disabled");const _=async()=>{const V=await s({space:a(w),resource:a(m),dimensions:bs.Thumbnail,cancelRunning:!0,updateStore:!1});V&&(h.value=V)},L=rt.debounce(({unobserve:V})=>{V(),_()},250);t.observe(a(i).$el,{onEnter:L,onExit:L.cancel})}),bn(()=>{t.disconnect()}),(_,L)=>(I(),re(Ss,pt({ref_key:"resourceListItem",ref:i,resource:m.value,"path-prefix":a(E),"is-path-displayed":!0,link:y.value,"is-extension-displayed":g.value,"parent-folder-link-icon-additional-attributes":a($),"parent-folder-name":a(D),"is-thumbnail-displayed":!!h.value},S.value),null,16,["resource","path-prefix","link","is-extension-displayed","parent-folder-link-icon-additional-attributes","parent-folder-name","is-thumbnail-displayed"]))}}),WR=7,QR=200,KR=ge({name:"CreateShortcutModal",components:{ResourcePreview:Am},props:{modal:{type:Object,required:!0},space:{type:Object,required:!0}},emits:["update:confirmDisabled"],setup(e,{emit:t,expose:n}){const r=Pe(),{$gettext:o}=me.useGettext(),{showMessage:s,showErrorMessage:i}=Me(),l=Re(),{search:u}=Hl(),{getPathPrefix:d,getParentFolderName:c,getParentFolderLink:p,getParentFolderLinkIconAdditionalAttributes:f,getFolderLink:h}=Cr(),g=De(),{resources:m,currentFolder:w}=we.storeToRefs(g),T=nn("dropRef"),k=W(""),S=W(""),y=W(null),E=W(null),D=W(!1);let $;const _=de=>{const ue=de.trim();return N(ue)?ue:`https://${ue}`},L=A(()=>_(a(k))),V=A(()=>!!a(m).find(de=>de.name===`${a(S)}.url`)),te=A(()=>a(V)||!a(S)||!a(k));Ue(te,()=>{t("update:confirmDisabled",a(te))},{immediate:!0});const B=A(()=>a(V)?o("»%{name}« already exists",{name:`${a(S)}.url`}):/[/]/.test(a(S))?o('Shortcut name cannot contain "/"'):""),O=$t.useTask(function*(de,ue){y.value=null,ue=`name:"*${ue}*" NOT name:"*.url"`;try{y.value=yield u(ue,WR)}catch{}}),M=rt.debounce(()=>{O.perform(a(k))},QR),N=de=>["http://","https://"].some(Se=>Se.startsWith(de)||de.startsWith(Se)),q=()=>{y.value=null,k.value=a(L);try{let de=new URL(a(L)).host;a(m).some(ue=>ue.name===`${de}.url`)&&(de=wn(`${de}.url`,"url",a(m)).slice(0,-4)),S.value=de}catch{}},j=de=>{y.value=null;const ue=new URL(window.location.href);let Se=de.data.name;k.value=`${ue.origin}/f/${de.id}`,a(m).some($e=>$e.name===`${Se}.url`)&&(Se=wn(`${Se}.url`,"url",a(m)).slice(0,-4)),S.value=Se},H=de=>a(E)===de,se=(de=!1)=>{const ue=Array.from(document.querySelectorAll("li.selectable-item"));let Se=a(E)!==null?a(E):de?ue.length:-1;const $e=de?-1:1;do if(Se+=$e,Se<0||Se>ue.length-1)return null;while(ue[Se].classList.contains("disabled"));return Se},Y=()=>{E.value=se(!0)},ae=()=>{E.value=se(!1)},ne=de=>{a(D)&&(de.stopPropagation(),a(T).hide())},pe=de=>{a(D)&&(de.stopPropagation(),a(E)!==null&&(a(E)===0?q():j(a(y)?.values?.[a(E)-1]),a(T).hide()))},fe=()=>{D.value=!1,E.value=null},be=()=>{D.value=!0,E.value=0},xe=()=>{k.value.trim().length&&a(T).show()},he=async()=>{if(await xt(),S.value=k.value.trim(),!k.value.trim().length){a(T).hide();return}a(T).show(),ln(l,"files-public-link")||M()},ie=async()=>{try{const ue=`[InternetShortcut]
32
+ URL=${Uc.sanitize(_(a(k)),{USE_PROFILES:{html:!0}})}`,Se=z.urlJoin(a(w).path,`${a(S)}.url`),$e=await r.webdav.putFileContents(e.space,{path:Se,content:ue});g.upsertResource($e),s({title:o("Shortcut was created successfully")})}catch(de){console.error(de),i({title:o("Failed to create shortcut"),errors:[de]})}};return yt(async()=>{await xt(),$=new Vc(a(T)?.$refs?.drop)}),Ue(y,async()=>{await xt(),!(!a(D)||!$)&&($.unmark(),$.mark(a(k),{element:"span",className:"mark-highlight",exclude:[".selectable-item-url *",".create-shortcut-modal-search-separator *"]}))},{deep:!0}),Ue(E,()=>{if(!a(D)||typeof a(T)?.$el?.scrollTo!="function")return;const de=a(T).$el.querySelectorAll(".selectable-item");de[a(E)]&&a(T).$el.scrollTo(0,a(E)===null?0:de[a(E)].getBoundingClientRect().y-de[a(E)].getBoundingClientRect().height)}),n({onConfirm:ie}),{inputUrl:k,inputFilename:S,dropRef:T,dropItemUrl:L,searchResult:y,confirmButtonDisabled:te,inputFileNameErrorMessage:B,searchTask:O,dropItemUrlClicked:q,dropItemResourceClicked:j,getPathPrefix:d,getFolderLink:h,getParentFolderLink:p,getParentFolderName:c,getParentFolderLinkIconAdditionalAttributes:f,onKeyEnterDrop:pe,onKeyDownDrop:ae,onKeyUpDrop:Y,onKeyEscDrop:ne,onHideDrop:fe,onShowDrop:be,onInputUrlInput:he,onClickUrlInput:xe,isDropItemActive:H,onConfirm:ie}}}),GR={class:"flex items-center mb-1"},JR={for:"create-shortcut-modal-url-input"},XR=["textContent"],YR={key:0,class:"p-1 flex justify-center"},ZR={class:"create-shortcut-modal-search-separator text-role-on-surface-variant text-sm pl-1"},eD=["textContent"],tD={key:0,class:"flex w-full mt-4"},nD={class:"flex items-center mb-1"},rD={for:"create-shortcut-modal-filename-input"};function oD(e,t,n,r,o,s){const i=oe("oc-contextual-helper"),l=oe("oc-text-input"),u=oe("oc-icon"),d=oe("oc-button"),c=oe("oc-spinner"),p=oe("resource-preview"),f=oe("oc-list"),h=oe("oc-drop");return I(),G(Ae,null,[J(l,{id:"create-shortcut-modal-url-input",modelValue:e.inputUrl,"onUpdate:modelValue":[t[0]||(t[0]=g=>e.inputUrl=g),e.onInputUrlInput],placeholder:"example.org",label:e.$gettext("Webpage or file"),onKeydown:[zo(e.onKeyUpDrop,["up"]),zo(e.onKeyDownDrop,["down"]),zo(e.onKeyEscDrop,["esc"]),zo(e.onKeyEnterDrop,["enter"])],onClick:e.onClickUrlInput},{label:Z(()=>[Q("div",GR,[Q("label",JR,[ct(R.toDisplayString(e.$gettext("Webpage or file"))+" ",1),t[2]||(t[2]=Q("span",{class:"text-role-error","aria-hidden":"true"},"*",-1))]),J(i,{text:e.$gettext("Enter the target URL of a webpage or the name of a file. Users will be directed to this webpage or file."),title:e.$gettext("Webpage or file"),class:"ml-1"},null,8,["text","title"])])]),_:1},8,["modelValue","label","onKeydown","onUpdate:modelValue","onClick"]),J(h,{ref:"dropRef",class:"w-lg","padding-size":"remove","drop-id":"create-shortcut-modal-contextmenu",mode:"manual",position:"bottom-start","close-on-click":"","enforce-drop-on-mobile":"",onHideDrop:e.onHideDrop,onShowDrop:e.onShowDrop},{default:Z(()=>[J(f,null,{default:Z(()=>[Q("li",{class:R.normalizeClass(["selectable-item selectable-item-url",{active:e.isDropItemActive(0)}])},[J(d,{class:"w-full",appearance:"raw","justify-content":"left",onClick:e.dropItemUrlClicked},{default:Z(()=>[J(u,{name:"external-link"}),Q("span",{textContent:R.toDisplayString(e.dropItemUrl)},null,8,XR)]),_:1},8,["onClick"])],2),e.searchTask.isRunning?(I(),G("li",YR,[J(c)])):le("",!0),e.searchResult?.values?.length?(I(),G(Ae,{key:1},[Q("li",ZR,[Q("span",{textContent:R.toDisplayString(e.$gettext("Link to a file"))},null,8,eD)]),(I(!0),G(Ae,null,Ye(e.searchResult.values,(g,m)=>(I(),G("li",{key:m,class:R.normalizeClass(["selectable-item",{active:e.isDropItemActive(m+1)}])},[J(d,{class:"w-full",appearance:"raw","justify-content":"left",onClick:w=>e.dropItemResourceClicked(g)},{default:Z(()=>[J(p,{"search-result":g,"is-clickable":!1},null,8,["search-result"])]),_:2},1032,["onClick"])],2))),128))],64)):le("",!0)]),_:1})]),_:1},8,["onHideDrop","onShowDrop"]),e.inputFilename?(I(),G("div",tD,[J(l,{id:"create-shortcut-modal-filename-input",modelValue:e.inputFilename,"onUpdate:modelValue":t[1]||(t[1]=g=>e.inputFilename=g),label:e.$gettext("Shortcut name"),class:"w-full","error-message":e.inputFileNameErrorMessage,"fix-message-line":!0},{label:Z(()=>[Q("div",nD,[Q("label",rD,[ct(R.toDisplayString(e.$gettext("Shortcut name"))+" ",1),t[3]||(t[3]=Q("span",{class:"text-role-error","aria-hidden":"true"},"*",-1))]),J(i,{text:e.$gettext("Shortcut name as it will appear in the file list."),title:e.$gettext("Shortcut name"),class:"ml-1"},null,8,["text","title"])])]),_:1},8,["modelValue","label","error-message"])])):le("",!0)],64)}const Em=Le(KR,[["render",oD]]),sD=({space:e})=>{const{dispatchModal:t}=Je(),{$gettext:n}=me.useGettext(),r=De(),{currentFolder:o}=we.storeToRefs(r);return{actions:A(()=>[{name:"create-shortcut",icon:"external-link",handler:()=>{t({title:n("Create a Shortcut"),confirmText:n("Create"),customComponent:Em,customComponentAttrs:()=>({space:a(e)})})},label:()=>n("New Shortcut"),isVisible:()=>a(o)?.canCreate(),class:"oc-files-actions-create-new-shortcut"}])}},wc=()=>{const{showMessage:e,showErrorMessage:t}=Me(),{can:n}=Bt(),{$gettext:r,$ngettext:o}=me.useGettext(),{createSpace:s}=go(),i=Pe(),l=Re(),u=A(()=>n("create-all","Drive")),{dispatchModal:d}=Je(),c=Ge(),p=He(),f=De(),{isSpaceNameValid:h}=Qr(),g=async({spaceName:T,resources:k,space:S})=>{const{webdav:y}=i,E=new ur({concurrency:c.options.concurrentRequests.resourceBatchActions}),D=[];try{const $=await s(T);p.upsertSpace($),k.length===1&&k[0].isFolder&&(k=(await y.listFiles(S,{path:k[0].path})).children);for(const _ of k)D.push(E.add(()=>y.copyFiles(S,_,$,{path:_.name})));await Promise.all(D),f.resetSelection(),e({title:r("Space was created successfully")})}catch($){console.error($);const _=$.statusCode===425?r("Some files could not be copied"):r("Creating space failed…");t({title:_,errors:[$]})}},m=({resources:T,space:k})=>{d({title:o("Create Space from »%{resourceName}«","Create Space from selection",T.length,{resourceName:T[0].name}),message:o("Create Space with the content of »%{resourceName}«.","Create Space with the selected files.",T.length,{resourceName:T[0].name}),contextualHelperLabel:r("The marked elements will be copied."),contextualHelperData:{title:r("Restrictions"),text:r("Shares, versions and tags will not be copied.")},confirmText:r("Create"),hasInput:!0,inputLabel:r("Space name"),inputRequiredMark:!0,onInput:(S,y)=>{const{isValid:E,error:D}=h(S);y(E?null:D)},onConfirm:S=>g({spaceName:S,space:k,resources:T})})};return{actions:A(()=>[{name:"create-space-from-resource",icon:"function",handler:m,label:()=>r("Create Space from selection"),isVisible:({resources:T,space:k})=>!(!T.length||!a(u)||!st(l,"files-spaces-generic")||!z.isPersonalSpaceResource(k)),class:"oc-files-actions-create-space-from-resource-trigger"}])}},Ts=()=>{const e=et(),t=Dt(),{displayDialog:n,filesList_delete:r}=Vm(),{$gettext:o}=me.useGettext();return{actions:A(()=>[{name:"delete",icon:"delete-bin-5",label:()=>o("Delete"),handler:({resources:i})=>{r(i)},isVisible:({resources:i})=>i.length?i.every(l=>l.canBeDeleted()&&!z.isSpaceResource(l)&&!z.isIncomingShareResource(l)&&!z.isTrashResource(l)&&!l.isShareRoot()):!1,isDisabled:({resources:i})=>i.length===1&&i[0].locked,disabledTooltip:()=>o("File can't be deleted because it is currently locked."),class:"oc-files-actions-delete-trigger"},{name:"delete-permanent",icon:"delete-bin-5",label:()=>o("Delete"),handler:({space:i,resources:l})=>{n(i,l)},isVisible:({space:i,resources:l})=>!l.length||!t.filesPermanentDeletion||z.isProjectSpaceResource(i)&&!i.canDeleteFromTrashBin({user:e.user})?!1:l.every(z.isTrashResource),class:"oc-files-actions-delete-permanent-trigger"}])}},Yi=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Re(),{$gettext:r,$ngettext:o}=me.useGettext(),s=Pe(),i=Ut(),l=Ge(),{updateResourceField:u}=De(),d=async({resources:p})=>{const f=[],h=[],g=new ur({concurrency:l.options.concurrentRequests.resourceBatchActions});if(p.forEach(m=>{h.push(g.add(async()=>{try{const{graphAuthenticated:w}=s;await w.driveItems.deleteDriveItem(m.driveId,m.id),u({id:m.id,field:"syncEnabled",value:!1})}catch(w){console.error(w),f.push(w)}}))}),await Promise.all(h),f.length===0){st(n,"files-spaces-generic")&&(e({title:o("Sync for the selected share was disabled successfully","Sync for the selected shares was disabled successfully",p.length)}),n.push(an("files-shares-with-me")));return}t({title:o("Failed to disable sync for the the selected share","Failed to disable sync for the selected shares",p.length),errors:f})};return{actions:A(()=>[{name:"disable-sync",icon:"spam-3",handler:p=>i.addTask(()=>d(p)),label:()=>r("Disable sync"),isVisible:({space:p,resources:f})=>!mt(n,"files-shares-with-me")&&!st(n,"files-spaces-generic")||f.length===0||st(n,"files-spaces-generic")&&(p?.driveType!=="share"||f.length>1||f[0].path!=="/")?!1:f.some(h=>h.syncEnabled),class:"oc-files-actions-disable-sync-trigger"}])}},Rm=()=>er("$archiverService"),Zi=()=>{const{showErrorMessage:e}=Me(),t=Re(),n=Rm(),{$ngettext:r,$gettext:o,current:s}=me.useGettext(),i=Lr(),l=lr(),u=({space:p,resources:f})=>(f.length>1&&(f=f.filter(h=>h.canDownload()&&!z.isProjectSpaceResource(h))),n.triggerDownload({fileIds:f.map(h=>h.fileId),...p&&z.isPublicSpaceResource(p)&&{publicToken:p.id,publicLinkPassword:i.publicLinkPassword}}).catch(h=>{console.error(h),e({title:r("Failed to download the selected folder.","Failed to download the selected files.",f.length),errors:[h]})})),d=p=>{const f=a(n.capability);return f?p.reduce((g,m)=>g+parseInt(`${m.size}`),0)>parseInt(f.max_size):void 0};return{actions:A(()=>[{name:"download-archive",icon:"inbox-archive",handler:p=>{u(p)},label:()=>o("Download"),disabledTooltip:({resources:p})=>d(p)?o("The selection exceeds the allowed archive size (max. %{maxSize})",{maxSize:Ht(a(n.capability).max_size,s)}):"",isDisabled:({resources:p})=>d(p),isVisible:({resources:p})=>a(l)&&!st(t,"files-spaces-generic")&&!ln(t,"files-public-link")&&!bt(t,"files-common-favorites")&&!bt(t,"files-common-search")&&!mt(t,"files-shares-with-me")&&!mt(t,"files-shares-with-others")&&!mt(t,"files-shares-via-link")&&!bt(t,"files-common-search")||!a(n.available)||p.length===0||p.length===1&&!p[0].isFolder||p.length>1&&p.every(h=>z.isProjectSpaceResource(h))||z.isProjectSpaceResource(p[0])&&p[0].disabled?!1:!p.some(h=>!h.canDownload()),class:"oc-files-actions-download-archive-trigger"}])}},Sc=e=>{const{showErrorMessage:t}=Me(),{getMatchingSpace:n}=It(),r=e?.clientService||Pe(),{$gettext:o}=me.useGettext(),s=et();return{downloadFile:async(l=null,u,d=null)=>{try{l||(l=n(u));const c=await r.webdav.getFileUrl(l,u,{version:d,username:s.user?.onPremisesSamAccountName});gl(c,u.name)}catch(c){console.error(c),t({title:o("Download failed"),desc:o("File could not be located"),errors:[c]})}}}},xo=()=>{const e=Re(),{$gettext:t}=me.useGettext(),n=lr(),r=oa(),{downloadFile:o}=Sc(),s=({space:l,resources:u})=>{o(l,u[0])};return{actions:A(()=>[{name:"download-file",icon:"file-download",handler:s,label:()=>t("Download"),isVisible:({resources:l})=>a(n)&&!a(r)&&!st(e,"files-spaces-generic")&&!ln(e,"files-public-link")&&!bt(e,"files-common-favorites")&&!bt(e,"files-common-search")&&!mt(e,"files-shares-with-me")&&!mt(e,"files-shares-with-others")&&!mt(e,"files-shares-via-link")||l.length!==1||l[0].isFolder?!1:l[0].canDownload(),class:"oc-files-actions-download-file-trigger"}])}},iD=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=et(),r=Dt(),{$gettext:o}=me.useGettext(),s=Pe(),{dispatchModal:i}=Je(),l=De(),u=He(),d=Ut(),c=async({space:h})=>{try{await s.webdav.clearTrashBin(h),e({title:o("All deleted files were removed")}),l.resetSelection(),u.updateSpaceField({id:h.id,field:"hasTrashedItems",value:!1}),l.resources.some(z.isTrashResource)&&l.clearResources()}catch(g){console.error(g),t({title:o("Failed to empty trash bin"),errors:[g]})}},p=({resources:h})=>{i({title:o("Empty trash bin for »%{name}«",{name:h[0].name}),confirmText:o("Delete"),message:o("Are you sure you want to permanently delete the items in »%{name}«? You can’t undo this action.",{name:h[0].name}),hasInput:!1,onConfirm:()=>d.addTask(()=>c({space:h[0]}))})};return{actions:A(()=>[{name:"empty-trash-bin",icon:({resources:h})=>h[0]?.hasTrashedItems?"delete-bin-2":"delete-bin-7",label:()=>o("Empty trash bin"),handler:p,isVisible:({resources:h})=>h.length!==1||!r.filesPermanentDeletion||!z.isSpaceResource(h[0])?!1:h[0].canDeleteFromTrashBin({user:n.user}),isDisabled:({resources:h})=>!h[0].hasTrashedItems,class:"oc-files-actions-empty-trash-bin-trigger"}]),emptyTrashBin:c}},ea=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Re(),{$gettext:r,$ngettext:o}=me.useGettext(),s=Pe(),i=Ut(),l=Ge(),u=De(),{updateResourceField:d}=u,c=async({resources:f})=>{const h=[],g=[],m=new ur({concurrency:l.options.concurrentRequests.resourceBatchActions});if(f.forEach(w=>{g.push(m.add(async()=>{try{const{graphAuthenticated:T}=s;await T.driveItems.createDriveItem(w.driveId,{name:w.name,remoteItem:{id:w.fileId}}),d({id:w.id,field:"syncEnabled",value:!0})}catch(T){console.error(T),h.push(T)}}))}),await Promise.all(g),h.length===0){u.resetSelection(),st(n,"files-spaces-generic")&&e({title:o("Sync for the selected share was enabled successfully","Sync for the selected shares was enabled successfully",f.length)});return}t({title:o("Failed to enable sync for the the selected share","Failed to enable sync for the selected shares",f.length),errors:h})};return{actions:A(()=>[{name:"enable-sync",icon:"check",handler:f=>i.addTask(()=>c(f)),label:()=>r("Enable sync"),isVisible:({space:f,resources:h})=>!mt(n,"files-shares-with-me")&&!st(n,"files-spaces-generic")||h.length===0||st(n,"files-spaces-generic")&&(a(f)?.driveType!=="share"||h.length>1||h[0].path!=="/")?!1:h.some(g=>!g.syncEnabled),class:"oc-files-actions-enable-sync-trigger"}])}},Tc=()=>{const{showErrorMessage:e}=Me(),t=Dt(),n=Re(),{$gettext:r}=me.useGettext(),o=Pe(),s=lr(),i=Bt(),l=De(),u=rr(),d=async({space:p,resources:f})=>{try{const h=!f[0].starred;await o.webdav.setFavorite(p,f[0],h),l.updateResourceField({id:f[0].id,field:"starred",value:h}),h||u.publish("app.files.list.removeFromFavorites",f[0].id)}catch(h){const g=r('Failed to change favorite state of "%{file}"',{file:f[0].name},!0);e({title:g,errors:[h]})}};return{actions:A(()=>[{name:"favorite",icon:"star",handler:d,label:({resources:p})=>p[0].starred?r("Remove from favorites"):r("Add to favorites"),isVisible:({resources:p})=>a(s)&&!st(n,"files-spaces-generic")&&!bt(n,"files-common-favorites")||p.length!==1?!1:t.filesFavorites&&i.can("create","Favorite"),class:"oc-files-actions-favorite-trigger"}])}};function aD(e,t){const n=e.isReceivedShare()||e.isMounted(),r=t===""&&n;return e.canBeDeleted()&&!r}const ta=()=>{const e=Re(),{cutResources:t}=ns(),n=me.useGettext(),{$gettext:r}=n,o=De(),{currentFolder:s}=we.storeToRefs(o),i=A(()=>ts()?r("⌘ + X"):r("Ctrl + X")),l=({resources:d})=>{t(d)};return{actions:A(()=>[{name:"cut",icon:"scissors",handler:l,shortcut:a(i),label:()=>r("Cut"),isVisible:({resources:d})=>!st(e,"files-spaces-generic")&&!ln(e,"files-public-link")&&!bt(e,"files-common-favorites")||d.length===0||!a(s)||d.length===1&&d[0].locked?!1:!d.some(p=>aD(p,a(s).path)===!1),class:"oc-files-actions-move-trigger"}])}},Dm=()=>{const e=Re(),{$gettext:t}=me.useGettext(),n=De(),{currentFolder:r}=we.storeToRefs(n),o=A(()=>ln(e,"files-public-link")?co("files-public-link"):qt(e,"files-trash-overview")?wr("files-trash-generic"):kn("files-spaces-generic"));return{actions:A(()=>[{name:"navigate",icon:"folder-open",label:()=>t("Navigate"),isVisible:({resources:i})=>i.length!==1||a(r)!==null&&Uo(i[0],a(r))||z.isTrashResource(i[0])?!1:i[0].isFolder||i[0].type==="space",route:({space:i,resources:l})=>Go({},a(o),_n(i,{path:l[0].path,fileId:l[0].fileId})),class:"oc-files-actions-navigate-trigger"}])}},Pm=()=>{const{$gettext:e}=me.useGettext(),{getDefaultAction:t}=An();return{actions:A(()=>[{name:"open",icon:"eye",label:()=>e("Open"),handler:r=>{const o=t({...r,omitSystemActions:!0});!o||!Object.hasOwn(o,"handler")||o.handler(r)},route:r=>{const o=t({...r,omitSystemActions:!0});if(!(!o||!Object.hasOwn(o,"route")))return o.route(r)},isVisible:r=>{const o=t({...r,omitSystemActions:!0});return o?o.isVisible(r):!1},class:"oc-files-actions-default-editor-trigger"}])}},lD=()=>{const{showErrorMessage:e}=Me(),t=Re(),{$gettext:n}=me.useGettext(),r=lr(),o=oa(),s=Pe(),i=d=>{const c=/URL=(.+)/,p=d.match(c);if(p&&p[1])return p[1];throw new Error("unable to extract url")},l=async({resources:d,space:c})=>{try{const p=new URL(window.location.href),f=(await s.webdav.getFileContents(c,d[0])).body;let h=i(f);if(h=h.match(/^http[s]?:\/\//)?h:`https://${h}`,h=Uc.sanitize(h,{USE_PROFILES:{html:!0}}),h.startsWith(p.origin)){window.location.href=h;return}window.open(h)}catch(p){console.error(p),e({title:n("Failed to open shortcut"),errors:[p]})}};return{actions:A(()=>[{name:"open-shortcut",icon:"external-link",category:"context",handler:l,label:()=>n("Open shortcut"),isVisible:({resources:d})=>a(r)&&!a(o)&&!st(t,"files-spaces-generic")&&!ln(t,"files-public-link")&&!bt(t,"files-common-favorites")&&!bt(t,"files-common-search")&&!mt(t,"files-shares-with-me")&&!mt(t,"files-shares-with-others")&&!mt(t,"files-shares-via-link")||d.length!==1||d[0].extension!=="url"?!1:d[0].canDownload(),class:"oc-files-actions-open-short-cut-trigger"}]),extractUrl:i}},cD=ge({name:"AppLoadingSpinner"}),uD={class:"flex items-center justify-center size-full"};function dD(e,t,n,r,o,s){const i=oe("oc-spinner");return I(),G("div",uD,[J(i,{id:"app-loading-spinner",size:"large","aria-hidden":!0,"aria-label":""})])}const kc=Le(cD,[["render",dD]]),fD=ge({name:"FilePickerModal",components:{AppLoadingSpinner:kc},props:{modal:{type:Object,required:!0},allowedFileTypes:{type:Array,required:!0},parentFolderLink:{type:Object,required:!0},callbackFn:{type:Function,required:!0}},setup(e){const t=W(),n=W(!0),r=Re(),{removeModal:o}=Je(),s=Bn(),i=r.resolve(e.parentFolderLink),l=s.currentTheme.name,u=new URL(i.href,window.location.origin);u.searchParams.append("hide-logo","true"),u.searchParams.append("embed","true"),u.searchParams.append("embed-target","file"),u.searchParams.append("embed-delegate-authentication","false"),u.searchParams.append("embed-file-types",e.allowedFileTypes.join(","));const d=()=>{n.value=!1,a(t).contentWindow.focus()},c=({data:f})=>{if(f.name!=="opencloud-embed:file-pick")return;const{resource:h,locationQuery:g}=f.data;e.callbackFn({resource:h,locationQuery:g}),o(e.modal.id)},p=({data:f})=>{f.name==="opencloud-embed:cancel"&&o(e.modal.id)};return yt(()=>{window.addEventListener("message",c),window.addEventListener("message",p)}),bn(()=>{window.removeEventListener("message",c),window.removeEventListener("message",p)}),{isLoading:n,onLoad:d,iframeTitle:l,iframeSrc:u.href,iframeRef:t,onFilePick:c}}}),pD={class:"h-full",tabindex:"0"},hD=["title","src"];function mD(e,t,n,r,o,s){const i=oe("app-loading-spinner");return I(),G("div",pD,[e.isLoading?(I(),re(i,{key:0})):le("",!0),je(Q("iframe",{ref:"iframeRef",class:"size-full",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...l)=>e.onLoad&&e.onLoad(...l))},null,40,hD),[[rd,!e.isLoading]])])}const Im=Le(fD,[["render",mD]]),Fm=(e={})=>{const t=Re(),{getMatchingSpace:n}=It(e);return{createFolderLink:o=>{const{path:s,fileId:i,resource:l}=o,u=a(e.space)||n(l);return u?qt(t,"files-trash-overview")?wr("files-trash-generic",_n(u)):kn("files-spaces-generic",_n(u,{path:s,fileId:i})):{}}}},Cr=(e={})=>{const t=Dt(),{$gettext:n}=me.useGettext(),{getInternalSpace:r,getMatchingSpace:o,isResourceAccessible:s}=It(),{createFolderLink:i}=Fm(e);return{getPathPrefix:f=>{const h=a(e.space)||o(f);return z.isProjectSpaceResource(h)?qa.join(n("Spaces"),h.name):z.isShareSpaceResource(h)?qa.join(n("Shares"),h.name):h.name},getFolderLink:f=>i({path:f.path,fileId:f.fileId,resource:f}),getParentFolderLink:f=>{const h=a(e.space)||o(f),g=s({space:h,path:Ke.dirname(f.path)});return f.remoteItemId&&f.path==="/"||!g?an("files-shares-with-me"):z.isProjectSpaceResource(f)?kn("files-spaces-projects"):i({path:Ke.dirname(f.path),...f.parentFolderId&&{fileId:f.parentFolderId},resource:f})},getParentFolderName:f=>{const h=a(e.space)||o(f),g=s({space:h,path:Ke.dirname(f.path)});if(z.isShareRoot(f)||f.id===h.id&&z.isShareSpaceResource(h)||!g)return n("Shared with me");const w=z.extractParentFolderName(f);if(w)return w;if(z.isShareSpaceResource(h))return h.name;if(t.spacesProjects){if(z.isProjectSpaceResource(f))return n("Spaces");if(h?.driveType==="project")return h.name}return n("Personal")},getParentFolderLinkIconAdditionalAttributes:f=>z.isProjectSpaceResource(f)||z.isProjectSpaceResource(r(f.storageId)||{})&&f.path.split("/").length===2?{name:"layout-grid","fill-type":"fill"}:{}}},$m=({appId:e})=>{const{$gettext:t}=me.useGettext(),n=lr(),{dispatchModal:r}=Je(),o=Mn(),{apps:s}=we.storeToRefs(o),i=Re(),{getParentFolderLink:l}=Cr(),{getMatchingSpace:u}=It(),{getEditorRouteOpts:d}=An(),c=({resources:h})=>{const g=a(s)[e],m=l(h[0]),w=g.extensions.map(T=>T.extension?T.extension:T.mimeType);r({elementClass:"file-picker-modal",title:t("Open file in %{app}",{app:g.name}),customComponent:Im,hideActions:!0,customComponentAttrs:()=>({allowedFileTypes:w,parentFolderLink:m,callbackFn:f}),focusTrapInitial:!1})},p=A(()=>[{name:"open-with-app",icon:"folder-open",handler:c,label:()=>t("Open"),isVisible:()=>!a(n),class:"oc-files-actions-open-with-app-trigger"}]),f=({resource:h,locationQuery:g})=>{const m=u(h),w=z.isShareSpaceResource(m)?m.id:void 0,T=d(a(i.currentRoute).name,m,h,w);T.query={...T.query,...g};const k=i.resolve(T),S=new URL(k.href,window.location.origin);window.open(S.href,"_blank")};return{actions:p,onFilePicked:f}},Om=()=>{const e=Re(),t=Pe(),{getMatchingSpace:n}=It(),{$gettext:r,$ngettext:o}=me.useGettext(),s=ns(),{startWorker:i}=ph(),l=De(),{currentFolder:u}=we.storeToRefs(l),d=A(()=>ts()?r("⌘ + V"):r("Ctrl + V")),c=A(()=>s.action===Zo.Cut?Xn.MOVE:Xn.COPY),p=async({targetSpace:g,sourceSpace:m,resources:w})=>{const T=new hd(m,w,g,a(u),u,t,r,o),k=await T.getTransferData(a(c));if(!k.length)return;const S=a(u)?.id;i(k,async({successful:y,failed:E})=>{if(T.showResultMessage(E,y,a(c)),!y.length||a(u)&&S!==a(u).id)return;const D=[],$=[];for(const _ of y)D.push((async()=>{const L=await t.webdav.getFileInfo(g,_);$.push(L)})());await Promise.allSettled(D),z.isShareSpaceResource(g)&&$.forEach(_=>{_.remoteItemId=g.id}),l.upsertResources($)})},f=async({space:g})=>{const m=s.resources.reduce((T,k)=>{if(k.storageId in T)return T[k.storageId].resources.push(k),T;const S=n(k);return S.id in T||(T[S.id]={space:S,resources:[]}),T[S.id].resources.push(k),T},{}),w=Object.values(m).map(({space:T,resources:k})=>p({targetSpace:g,sourceSpace:T,resources:k}));await Promise.all(w),s.clearClipboard()};return{actions:A(()=>[{name:"paste",icon:"clipboard",handler:f,label:()=>r("Paste"),shortcut:a(d),isVisible:({resources:g})=>s.resources.length===0||!st(e,"files-spaces-generic")&&!ln(e,"files-public-link")&&!bt(e,"files-common-favorites")||g.length===0?!1:ln(e,"files-public-link")&&a(u)?a(u)?.canCreate():!0,class:"oc-files-actions-copy-trigger"}])}},na=()=>{const{showErrorMessage:e}=Me(),t=Dt(),n=Re(),{$gettext:r}=me.useGettext(),o=Pe(),s=Ge(),{dispatchModal:i}=Je(),l=et(),u=Bt(),d=De(),{setCurrentFolder:c,upsertResource:p}=d,{isFileNameValid:f}=Qr(),h=async(w,T,k)=>{let S=d.currentFolder;try{const y=Ke.join(Ke.dirname(T.path),k);await o.webdav.moveFiles(w,T,w,{path:y});const E=Uo(T,S);if(z.isShareSpaceResource(w)&&T.isReceivedShare()){if(w.rename(k),E)return S={...S},S.name=k,c(S),n.push(_n(w,{path:"",fileId:T.fileId}));const $={...T};$.name=k,p($);return}if(E)return S={...S},Qa(w,S,y),c(S),n.push(_n(w,{path:y,fileId:T.fileId}));const D={...T};Qa(w,D,y),p(D)}catch(y){console.error(y);let E=r('Failed to rename "%{file}" to »%{newName}«',{file:T.name,newName:k},!0);y.statusCode===423&&(E=r("Failed to rename »%{file}« to »%{newName}« - the file is locked",{file:T.name,newName:k},!0)),e({title:E,errors:[y]})}},g=async({space:w,resources:T})=>{const k=d.currentFolder;let S;if(Uo(T[0],k)){const B=Ke.dirname(k.path);S=(await o.webdav.listFiles(w,{path:B})).children}const y=d.areFileExtensionsShown,E=async B=>{y||(B=`${B}.${T[0].extension}`),await h(w,T[0],B)},D=(B,O)=>{y||(B=`${B}.${T[0].extension}`);const{isValid:M,error:N}=f(T[0],B,S);O(M?null:N)},$=z.extractNameWithoutExtension(T[0]),_=!T[0].isFolder&&!y?$:T[0].name,L=T[0].isFolder?r("Rename folder »%{name}«",{name:_}):r("Rename file »%{name}«",{name:_}),V=!T[0].isFolder&&!y?$:T[0].name,te=T[0].isFolder||!y?null:[0,$.length];i({title:L,confirmText:r("Rename"),hasInput:!0,inputValue:V,inputSelectionRange:te,inputLabel:T[0].isFolder?r("Folder name"):r("File name"),inputRequiredMark:!0,onConfirm:E,onInput:D})};return{actions:A(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:g,isVisible:({resources:w})=>qt(n,"files-trash-generic")||mt(n,"files-shares-with-me")&&!t.sharingCanRename||w.length!==1||(s.options.routing.fullShareOwnerPaths?w.some(S=>S.remoteItemPath&&S.path):w.some(S=>S.remoteItemId&&S.path==="/"))||w.length===1&&w[0].locked?!1:!w.some(S=>!S.canRename({user:l.user,ability:u})||S.processing),class:"oc-files-actions-rename-trigger"}]),renameResource:h}},ks=({showSuccessMessage:e=!0,onRestoreComplete:t}={})=>{const{showMessage:n,showErrorMessage:r}=Me(),o=et(),s=Re(),{$gettext:i,$ngettext:l}=me.useGettext(),u=Pe(),d=He(),c=De(),{startWorker:p}=hh(),f=async(T,k)=>{const S={},y=[],E=[],D=[];for(const $ of k){const _=Ke.dirname($.path);let L=[];if(_ in S)L=S[_];else{try{L=(await u.webdav.listFiles(T,{path:_})).children}catch{D.push(_)}S[_]=L}L.some(te=>te.name===$.name)||E.filter(te=>te.id!==$.id).some(te=>te.path===$.path)?y.push($):E.push($)}return{existingResourcesByPath:S,conflicts:y,resolvedResources:E,missingFolderPaths:D.filter($=>!S[$]?.length)}},h=async T=>{let k=0;const S=[],y=T.length;let E=!1,D;for(const $ of T){const _=$.type==="folder";if(E){S.push({resource:$,strategy:D});continue}const L=y-k,te=await new Ha(i,l).resolveFileExists({name:$.name,isFolder:_},L,!1);k++,te.doForAllConflicts&&(E=!0,D=te.strategy),S.push({resource:$,strategy:te.strategy})}return S},g=(T,k,S)=>{const y=a(s.currentRoute);p({space:T,resources:k,missingFolderPaths:S},async({successful:E,failed:D})=>{if(E.length){let $;E.length===1?$=i("%{resource} was restored successfully",{resource:E[0].name}):$=i("%{resourceCount} files restored successfully",{resourceCount:E.length.toString()}),e&&n({title:$}),y.name===a(s.currentRoute).name&&y.query?.fileId===a(s.currentRoute).query?.fileId&&(c.removeResources(E),c.resetSelection());const L=await u.graphAuthenticated.drives.getDrive(T.id);d.updateSpaceField({id:L.id,field:"spaceQuota",value:L.spaceQuota}),t?.({space:T,resources:E})}if(D.length){let $;const _={};D.length===1?(_.resource=D[0].resource.name,$=i('Failed to restore "%{resource}"',_,!0)):(_.resourceCount=D.length.toString(),$=i("Failed to restore %{resourceCount} files",_,!0)),r({title:$,errors:D.map(({error:L})=>L)})}})},m=async({space:T,resources:k})=>{const S=k.sort((te,B)=>te.path.length-B.path.length),{existingResourcesByPath:y,conflicts:E,resolvedResources:D,missingFolderPaths:$}=await f(T,S),_=await h(E),L=_.filter(te=>te.strategy===Sn.REPLACE).map(te=>te.resource);D.push(...L);const V=_.filter(te=>te.strategy===Sn.KEEP_BOTH).map(te=>te.resource);for(let te of V){te={...te};const B=Ke.dirname(te.path),O=y[B]||[],M=z.extractExtensionFromFile(te),N=wn(te.name,M,[...O,..._.map(q=>q.resource),...D]);te.name=N,te.path=z.urlJoin(B,N),D.push(te)}return g(T,D,$)};return{actions:A(()=>[{name:"restore",icon:"arrow-go-back",label:()=>i("Restore"),handler:m,isVisible:({space:T,resources:k})=>!qt(s,"files-trash-generic")||!k.every(S=>z.isTrashResource(S)&&S.canBeRestored())||z.isProjectSpaceResource(T)&&!T.canRestoreFromTrashbin({user:o.user})?!1:k.length>0,class:"oc-files-actions-restore-trigger"}]),restoreResources:g,collectConflicts:f}},gD=ge({name:"SaveAsModal",components:{AppLoadingSpinner:kc},props:{modal:{type:Object,required:!0},parentFolderLink:{type:Object,required:!0},originalResource:{type:Object,required:!0},content:{type:String,required:!0}},setup(e){const t=W(),n=W(!0),r=Bn(),{$gettext:o}=me.useGettext(),s=Re(),i=Pe(),{removeModal:l}=Je(),{showMessage:u,showErrorMessage:d}=Me(),{getMatchingSpace:c}=It(),{getEditorRouteOpts:p}=An(),f=s.resolve(e.parentFolderLink),h=r.currentTheme.name,g=new URL(f.href,window.location.origin);g.searchParams.append("hide-logo","true"),g.searchParams.append("embed","true"),g.searchParams.append("embed-target","location"),g.searchParams.append("embed-choose-file-name","true"),g.searchParams.append("embed-delegate-authentication","false"),g.searchParams.append("embed-choose-file-name-suggestion",e.originalResource.name);const m=()=>{n.value=!1,a(t).contentWindow.focus()},w=async({data:y})=>{if(y.name!=="opencloud-embed:select")return;const{resources:E,fileName:D,locationQuery:$}=y.data,_=E[0],L=c(_);try{const V=await T({destinationFolder:_,fileName:D,space:L});u({title:o("»%{fileName}« was saved successfully",{fileName:V.name})}),k({resource:V,space:L,locationQuery:$})}catch(V){console.error(V),d({title:o("Unable to save »%{fileName}«",{fileName:D}),errors:[V]}),console.error(V)}l(e.modal.id)},T=async({destinationFolder:y,fileName:E,space:D})=>{const{children:$}=await i.webdav.listFiles(D,{fileId:y.fileId},{davProperties:[Ee.Name]});return $.find(L=>L.name===E)&&(E=wn(E,e.originalResource.extension,$)),i.webdav.putFileContents(D,{fileName:E,parentFolderId:y.id,content:e.content,path:z.urlJoin(y.path,E)})},k=({locationQuery:y,resource:E,space:D})=>{const $=z.isShareSpaceResource(D)?D.id:void 0,_=p(a(s.currentRoute).name,D,E,$);_.query={..._.query,...y};const L=s.resolve(_),V=new URL(L.href,window.location.origin);window.open(V.href,"_blank")},S=({data:y})=>{y.name==="opencloud-embed:cancel"&&l(e.modal.id)};return yt(()=>{window.addEventListener("message",w),window.addEventListener("message",S)}),bn(()=>{window.removeEventListener("message",w),window.removeEventListener("message",S)}),{isLoading:n,onLoad:m,iframeTitle:h,iframeSrc:g.href,iframeRef:t,onLocationPick:w}}}),vD={class:"h-full",tabindex:"0"},yD=["title","src"];function bD(e,t,n,r,o,s){const i=oe("app-loading-spinner");return I(),G("div",vD,[e.isLoading?(I(),re(i,{key:0})):le("",!0),je(Q("iframe",{ref:"iframeRef",class:"size-full",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...l)=>e.onLoad&&e.onLoad(...l))},null,40,yD),[[rd,!e.isLoading]])])}const Lm=Le(gD,[["render",bD]]),_m=({content:e})=>{const{$gettext:t}=me.useGettext(),n=lr(),{dispatchModal:r}=Je(),{getParentFolderLink:o}=Cr(),s=({resources:l})=>{const u=o(l[0]);r({elementClass:"save-as-modal",title:t("Save as"),customComponent:Lm,hideActions:!0,customComponentAttrs:()=>({content:a(e),parentFolderLink:u,originalResource:l[0]}),focusTrapInitial:!1})};return{actions:A(()=>[{name:"save-as",icon:"save-2",handler:s,label:()=>t("Save as"),isVisible:({resources:l})=>!a(n)||l.length!==1,class:"oc-files-actions-save-as-trigger"}])}},wD={class:R.normalizeClass(["[&_.cropper-crop-box]:!outline-1","[&_.cropper-crop-box]:!outline-role-outline","[&_.cropper-line]:!bg-role-outline","[&_.cropper-point]:!bg-role-outline"])},SD={key:0,class:"max-h-[400px]"},TD=["src"],kD={class:"text-sm text-role-on-surface-variant flex items-center mt-1"},CD=["textContent"],Mm=ge({__name:"SpaceImageModal",props:{modal:{},space:{},file:{}},setup(e,{expose:t}){const{showMessage:n,showErrorMessage:r}=Me(),{$gettext:o}=me.useGettext(),s=Pe(),i=He(),{createDefaultMetaFolder:l}=go(),{getDefaultMetaFolder:u}=Fi(),{setCropperInstance:d}=Ql(),c=W(null),p=nn("imageRef"),f=W(null);t({onConfirm:async()=>{const w=a(c)?.getCroppedCanvas({imageSmoothingQuality:"high"}),T=await g(w);await m(T)}});const g=async w=>(await new Promise(k=>w.toBlob(k,"image/png"))).arrayBuffer(),m=async w=>{const T=s.graphAuthenticated;i.addToImagesLoading(e.space.id);let k=await u(e.space);k||(k=await l(e.space));const S={"Content-Type":"application/offset+octet-stream"};try{const{fileId:y,processing:E}=await s.webdav.putFileContents(e.space,{parentFolderId:k.id,fileName:"image.png",content:w,headers:S,overwrite:!0}),D=await T.drives.updateDrive(e.space.id,{name:e.space.name,special:[{specialFolder:{name:"image"},id:y}]});E||i.removeFromImagesLoading(e.space.id),i.updateSpaceField({id:e.space.id,field:"spaceImageData",value:D.spaceImageData}),n({title:o("Space image was set successfully")}),ze.publish("app.files.spaces.uploaded-image",D)}catch(y){if(console.error(y),i.removeFromImagesLoading(e.space.id),y instanceof z.HttpError&&y.statusCode===507){r({title:o("Failed to set space image"),desc:o("Not enough quota to set the space image"),errors:[y]});return}r({title:o("Failed to set space image"),errors:[y]})}};return yt(async()=>{try{f.value=URL.createObjectURL(e.file),a(c)&&a(c)?.destroy(),await xt(),c.value=new ca(a(p),{aspectRatio:16/9,viewMode:1,dragMode:"move",autoCropArea:.8,responsive:!0,background:!1}),d(c)}catch(w){r({title:o("Failed to load space image"),errors:[w]})}}),(w,T)=>{const k=oe("oc-icon");return I(),G("div",wD,[f.value?(I(),G("div",SD,[Q("img",{ref_key:"imageRef",ref:p,src:f.value},null,8,TD),Q("div",kD,[J(k,{class:"mr-1",name:"information",size:"small","fill-type":"line"}),Q("span",{textContent:R.toDisplayString(a(o)("Zoom via %{ zoomKeys }, pan via %{ panKeys }",{zoomKeys:a(o)("+-"),panKeys:a(o)("↑↓←→")}))},null,8,CD)])])):le("",!0)])}}}),Nm=()=>{const e=et(),t=Re(),{$gettext:n}=me.useGettext(),r=Pe(),o=Ut(),{dispatchModal:s}=Je(),i=async({space:u,resources:d})=>{const{getFileContents:c}=r.webdav,p=await c(u,d[0],{responseType:"blob"}),f=new File([p.body],d[0].name);s({title:n("Crop your Space image"),confirmText:n("Confirm"),customComponent:Mm,customComponentAttrs:()=>({file:f,space:u})})};return{actions:A(()=>[{name:"set-space-image",icon:"image-edit",handler:u=>o.addTask(()=>i(u)),label:()=>n("Set as space image"),isVisible:({space:u,resources:d})=>d.length!==1||!d[0].hasPreview?.()||!d[0].mimeType?.includes("image/")||!st(t,"files-spaces-generic")||!u||!z.isProjectSpaceResource(u)?!1:u.canEditImage({user:e.user}),class:"oc-files-actions-set-space-image-trigger"}])}},xD=()=>{const e=Re(),{$gettext:t}=me.useGettext(),n=lr(),{openSideBarPanel:r}=_t(),o=()=>{const i=qt(e,"files-trash-generic")?null:"actions";r(i)};return{actions:A(()=>[{name:"show-actions",icon:"slideshow-3",label:()=>t("All Actions"),handler:o,isVisible:({resources:i})=>a(n)?i.length===1:!1,class:"oc-files-actions-show-actions-trigger"}])}},Cc=()=>{const e=Re(),t=De(),{openSideBar:n}=_t(),{$gettext:r}=me.useGettext();return{actions:A(()=>[{name:"show-details",icon:"information",class:"oc-files-actions-show-details-trigger",label:()=>r("Details"),isVisible:({resources:s})=>qt(e,"files-trash-generic")?!1:s.length>0,handler({resources:s}){t.setSelection(s.map(({id:i})=>i)),n()}}])}},Bm=()=>{const e=Dt(),{isPersonalSpaceRoot:t}=It();return{canListShares:({space:r,resource:o})=>!e.sharingApiEnabled||z.isPublicSpaceResource(r)||t(o)||z.isTrashResource(o)?!1:z.isIncomingShareResource(o)?o.sharePermissions.includes(z.GraphSharePermission.readPermissions):z.isShareSpaceResource(r)?r.graphPermissions?.includes(z.GraphSharePermission.readPermissions):!0}},jm=()=>{const e=Dt(),t=Bt(),n=et();return{canShare:({space:o,resource:s})=>!e.sharingApiEnabled||z.isShareSpaceResource(o)||z.isProjectSpaceResource(o)&&!o.canShare({user:n.user})?!1:s.canShare({ability:t,user:n.user})}},xc=()=>{const e=Re(),{$gettext:t}=me.useGettext(),{canShare:n}=jm(),{openSideBarPanel:r}=_t(),{interceptModifierClick:o}=zr(),s=({resources:l,event:u})=>{const d=l[0];u&&o(u,d)||r("sharing")};return{actions:A(()=>[{name:"show-shares",icon:"user-add",label:()=>t("Share"),handler:s,isVisible:({space:l,resources:u})=>qt(e,"files-trash-generic")||u.length!==1?!1:n({space:l,resource:u[0]}),class:"oc-files-actions-show-shares-trigger"}])}},ra=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=Re(),{$gettext:r}=me.useGettext(),o=Pe(),s=Ut(),i=Ge(),{updateResourceField:l,resetSelection:u}=De(),d=async({resources:p})=>{const f=[],h=[],g=new ur({concurrency:i.options.concurrentRequests.resourceBatchActions}),m=!p[0].hidden;if(p.forEach(w=>{h.push(g.add(async()=>{try{await o.graphAuthenticated.driveItems.updateDriveItem(w.driveId,w.id,{"@UI.Hidden":m}),l({id:w.id,field:"hidden",value:m})}catch(T){console.error(T),f.push(T)}}))}),await Promise.all(h),f.length===0){u(),e({title:r(m?"The share was hidden successfully":"The share was unhidden successfully")});return}t({title:r(m?"Failed to hide the share":"Failed to unhide the share"),errors:f})};return{actions:A(()=>[{name:"toggle-hide-share",icon:"eye-off",handler:p=>s.addTask(()=>d(p)),label:({resources:p})=>p[0].hidden?r("Unhide"):r("Hide"),isVisible:({resources:p})=>p.length===0?!1:mt(n,"files-shares-with-me"),class:"oc-files-actions-hide-share-trigger"}])}},zm=()=>{const{$gettext:e}=me.useGettext(),{showErrorMessage:t}=Me(),{webdav:n}=Pe(),r=Dt(),o=De(),{currentFolder:s}=we.storeToRefs(o),{actions:i}=ks({showSuccessMessage:!1,onRestoreComplete:async({space:p,resources:f})=>{if(vd({resourcesStore:o,parentFolderId:f[0].parentFolderId})){const{children:h}=await n.listFiles(p,{path:a(s).path});o.upsertResources(h.filter(({id:g})=>f.some(m=>m.id===l(g))))}}}),l=p=>p.includes("!")?p.split("!")[1]:p,u=async({space:p,resources:f,callback:h})=>{const g=f.map(m=>({...m,id:l(m.id)}));try{await a(i)[0].handler({space:p,resources:g}),h()}catch(m){console.error(m),t({title:e("Failed to restore files"),errors:[m]})}},d=A(()=>ts()?e("⌘ + Z"):e("Ctrl + Z"));return{actions:A(()=>[{name:"undoDelete",icon:"arrow-go-back",shortcut:a(d),isVisible:({space:p})=>r.davTrashbin?z.isProjectSpaceResource(p)||z.isPersonalSpaceResource(p):!1,label:()=>e("Undo"),handler:u}])}},Um=()=>{const{$gettext:e}=me.useGettext(),{actions:t}=xo(),{downloadFile:n}=Sc(),{dispatchModal:r}=Je(),o=({space:i,resources:l})=>{r({title:e("No preview available for »%{name}«",{name:l[0].name}),confirmText:e("Download"),message:e("There is no preview available for this file. Do you want to download it instead?"),onConfirm:()=>{n(i,l[0])}})};return{actions:A(()=>[{name:"fallback-to-download",icon:"file-download",handler:o,label:()=>e("Download"),isVisible:i=>a(t)[0].isVisible(i),class:"oc-files-actions-fallback-to-download-trigger"}])}},Vm=()=>{const e=Ge(),{showMessage:t,showErrorMessage:n,removeMessage:r}=Me(),o=Re(),s=me.useGettext(),{getMatchingSpace:i}=It(),{$gettext:l,$ngettext:u}=s,d=Pe(),{dispatchModal:c}=Je(),p=He(),f=rr(),{bindKeyAction:h,removeKeyAction:g}=_i(),{startWorker:m}=fh({concurrentRequests:e.options.concurrentRequests.resourceBatchActions}),{actions:w}=zm(),T=De(),{currentFolder:k}=we.storeToRefs(T),S=W([]),y=Pt("page","1"),E=A(()=>parseInt(at(a(y)))),D=Pt("items-per-page","1"),$=A(()=>parseInt(at(a(D)))),_=A(()=>cd(a(S))),L=({space:N,filesToDelete:q,deletedFiles:j})=>{const H=j.length===1&&q.length===1?l('"%{item}" was moved to trash bin',{item:j[0].name}):u("%{itemCount} item was moved to trash bin","%{itemCount} items were moved to trash bin",j.length,{itemCount:j.length.toString()},!0),se=7,Y=a(w)[0],ae=Y.isVisible({space:N,resources:j});let ne;const pe=t({title:H,timeout:se,actions:[Y],actionOptions:{space:N,resources:j,callback:()=>{r(pe),ne&&g(ne)}}});ae&&(ne=h({primary:jn.Z,modifier:Li.Ctrl},()=>(g(ne),Y.handler({space:N,resources:j,callback:()=>{r(pe)}}))),setTimeout(()=>g(ne),se*1e3))},V=A(()=>{const N=a(_),q=N[0].type==="folder";let j=null;return N.length===1?(q?j=l("Permanently delete folder »%{name}«",{name:N[0].name},!0):j=l("Permanently delete file »%{name}«",{name:N[0].name},!0),j):u("Permanently delete selected resource?","Permanently delete %{amount} selected resources?",N.length,{amount:N.length.toString()},!1)}),te=A(()=>{const N=a(_),q=N[0].type==="folder";return N.length===1?l(q?"Are you sure you want to delete this folder? All its content will be permanently removed. This action cannot be undone.":"Are you sure you want to delete this file? All its content will be permanently removed. This action cannot be undone."):l("Are you sure you want to delete all selected resources? All their content will be permanently removed. This action cannot be undone.")}),B=N=>{const q=a(o.currentRoute);m({topic:"trashBinDelete",space:N,resources:a(_)},({successful:j,failed:H})=>{if(j.length){const se=j.length===1&&a(_).length===1?l('"%{item}" was deleted successfully',{item:j[0].name}):u("%{itemCount} item was deleted successfully","%{itemCount} items were deleted successfully",j.length,{itemCount:j.length.toString()},!0);t({title:se})}H.forEach(({resource:se})=>{const Y=l('Failed to delete "%{item}"',{item:se.name});n({title:Y,errors:[new Error]})}),q.name===a(o.currentRoute).name&&q.query?.fileId===a(o.currentRoute).query?.fileId&&(T.removeResources(j),T.resetSelection())})};return{displayDialog:(N,q)=>{S.value=[...q],c({title:a(V),message:a(te),confirmText:l("Delete"),onConfirm:()=>B(N)})},filesList_delete:N=>{S.value=[...N],T.addResourcesIntoDeleteQueue(a(S).map(({id:H})=>H)),a(S).forEach(({id:H})=>T.removeSelection(H));const q=a(N).reduce((H,se)=>{if(se.storageId in H)return H[se.storageId].resources.push(se),H;const Y=i(se);return Y.id in H||(H[Y.id]={space:Y,resources:[]}),H[Y.id].resources.push(se),H},{}),j=a(k)?.id;return Object.values(q).map(({space:H,resources:se})=>{m({topic:"fileListDelete",space:H,resources:se},async({successful:Y,failed:ae})=>{if(Y.length&&(L({space:H,filesToDelete:se,deletedFiles:Y}),f.publish("runtime.resource.deleted",Y)),T.removeResourcesFromDeleteQueue(ae.map(({resource:ne})=>ne.id)),T.removeResourcesFromDeleteQueue(Y.map(({id:ne})=>ne)),ae.forEach(({error:ne,resource:pe})=>{let fe=l('Failed to delete "%{resource}"',{resource:pe.name});ne.statusCode===423&&(fe=l('Failed to delete "%{resource}" - the file is locked',{resource:pe.name})),n({title:fe,errors:[ne]})}),j===a(k)?.id){T.removeResources(Y);const ne=T.activeResources.length,pe=Math.ceil(a(ne)/a($));a(E)>1&&a(E)>pe&&(y.value=pe.toString())}if(st(o,"files-spaces-generic")&&!["public","share"].includes(H?.driveType)){const pe=await d.graphAuthenticated.drives.getDrive(a(N)[0].storageId);p.updateSpaceField({id:pe.id,field:"spaceQuota",value:pe.spaceQuota})}if(a(S).length&&Uo(a(S)[0],a(k)))return o.push(_n(H,{path:Ke.dirname(a(S)[0].path),fileId:a(S)[0].parentFolderId}))})})}}},AD=()=>{const e=St();return A(()=>a(e)?.query?.contextRouteName)},ED=e=>e==="files",lr=()=>{const e=St();return A(()=>ED(pl(a(e))))},Qr=()=>{const{$gettext:e}=me.useGettext(),t=De();return{isSpaceNameValid:o=>o.trim()===""?{isValid:!1,error:e("The Space name cannot be empty")}:Nl(o)>yc?{isValid:!1,error:e("The Space name is too long")}:o.trim()!==o?{isValid:!1,error:e("The Space name cannot start or end with whitespace")}:/[/\\.:?*"><|]/.test(o)?{isValid:!1,error:e(`The Space name cannot contain the following characters: / \\\\ . : ? * " > < |'`)}:{isValid:!0,error:void 0},isFileNameValid:(o,s,i=void 0)=>{if(!s)return{isValid:!1,error:e("The name cannot be empty")};if(/[/]/.test(s))return{isValid:!1,error:e('The name cannot contain "/"')};if(/[\\]/.test(s))return{isValid:!1,error:e('The name cannot contain "\\"')};if(s===".")return{isValid:!1,error:e('The name cannot be equal to "."')};if(s==="..")return{isValid:!1,error:e('The name cannot be equal to ".."')};if(s.trim()!==s)return{isValid:!1,error:e("The name cannot start or end with whitespace")};if(Nl(s)>yc)return{isValid:!1,error:e("The name is too long")};const l=o.path.substring(0,o.path.length-o.name.length)+s;if((i||t.resources).some(d=>d.path===l&&d.name===s)){const d=e("The name »%{name}« is already taken");return{isValid:!1,error:e(d,{name:s},!0)}}return{isValid:!0,error:void 0}}}},oa=()=>A(()=>!!document.getElementById("files-global-search-options")),qm=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=et(),{$gettext:r,$ngettext:o}=me.useGettext(),s=Bt(),i=Pe(),l=St(),{dispatchModal:u}=Je(),d=He(),{removeResources:c}=De(),p=m=>m.filter(w=>z.isProjectSpaceResource(w)&&w.canBeDeleted({user:n.user,ability:s})),f=async m=>{const w=i.graphAuthenticated,T=m.map(E=>w.drives.deleteDrive(E.id).then(()=>(c([E]),d.removeSpace(E),!0))),k=await Promise.allSettled(T),S=k.filter(Nr);if(S.length){const E=S.length===1&&m.length===1?r("Space »%{space}« was deleted successfully",{space:m[0].name}):o("%{spaceCount} space was deleted successfully","%{spaceCount} spaces were deleted successfully",S.length,{spaceCount:S.length.toString()},!0);e({title:E})}const y=k.filter(Br);if(y.length){y.forEach(console.error);const E=y.length===1&&m.length===1?r("Failed to delete space »%{space}«",{space:m[0].name}):o("Failed to delete %{spaceCount} space","Failed to delete %{spaceCount} spaces",y.length,{spaceCount:y.length.toString()},!0);t({title:E,errors:y.map(D=>D.reason)})}a(l).name==="admin-settings-spaces"&&ze.publish("app.admin-settings.list.load")},h=({resources:m})=>{const w=p(m);if(!w.length)return;const T=o("Are you sure you want to delete the selected space?","Are you sure you want to delete %{count} selected spaces?",w.length,{count:w.length.toString()});u({title:o("Delete Space »%{space}«?","Delete %{spaceCount} Spaces?",w.length,{space:w[0].name,spaceCount:w.length.toString()}),confirmText:r("Delete"),message:T,hasInput:!1,onConfirm:()=>f(w)})};return{actions:A(()=>[{name:"delete",icon:"delete-bin",label:()=>r("Delete"),handler:h,isVisible:({resources:m})=>!!p(m).length,class:"oc-files-actions-delete-trigger"}]),deleteSpaces:f}},Hm=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=et(),{$gettext:r,$ngettext:o}=me.useGettext(),s=Bt(),i=Pe(),l=St(),u=Re(),{dispatchModal:d}=Je(),c=He(),p=m=>m.filter(w=>z.isProjectSpaceResource(w)&&w.canDisable({user:n.user,ability:s})),f=async m=>{const w=a(l),T=i.graphAuthenticated,k=m.map(D=>T.drives.disableDrive(D.id).then(()=>(w.name==="files-spaces-generic"&&u.push({name:"files-spaces-projects"}),w.name==="admin-settings-spaces"&&(D.disabled=!0,D.spaceQuota={total:D.spaceQuota.total}),c.updateSpaceField({id:D.id,field:"disabled",value:!0}),!0))),S=await Promise.allSettled(k),y=S.filter(Nr);if(y.length){const D=y.length===1&&m.length===1?r("Space »%{space}« was disabled successfully",{space:m[0].name}):o("%{spaceCount} space was disabled successfully","%{spaceCount} spaces were disabled successfully",y.length,{spaceCount:y.length.toString()},!0);e({title:D})}const E=S.filter(Br);if(E.length){E.forEach(console.error);const D=E.length===1&&m.length===1?r("Failed to disable space »%{space}«",{space:m[0].name}):o("Failed to disable %{spaceCount} space","Failed to disable %{spaceCount} spaces",E.length,{spaceCount:E.length.toString()},!0);t({title:D,errors:E.map($=>$.reason)})}},h=({resources:m})=>{const w=p(m);if(!w.length)return;const T=o("If you disable the selected space, it can no longer be accessed. Only Space managers will still have access. Note: No files will be deleted from the server.","If you disable the %{count} selected spaces, they can no longer be accessed. Only Space managers will still have access. Note: No files will be deleted from the server.",w.length,{count:w.length.toString()}),k=r("Disable");d({title:o("Disable Space »%{space}«?","Disable %{spaceCount} Spaces?",w.length,{space:w[0].name,spaceCount:w.length.toString()}),confirmText:k,message:T,hasInput:!1,onConfirm:()=>f(w)})};return{actions:A(()=>[{name:"disable",icon:"stop-circle",label:()=>r("Disable"),handler:h,isVisible:({resources:m})=>!!p(m).length,class:"oc-files-actions-disable-trigger"}]),disableSpaces:f}},Wm=()=>{const e=Ge(),t=He(),n=tr(),{showMessage:r,showErrorMessage:o}=Me(),s=Re(),{$gettext:i}=me.useGettext(),l=Bt(),u=Pe(),d=Ut(),{upsertResource:c}=De(),p=st(s,"files-spaces-projects"),f=async m=>{const w=t.spaces.filter(z.isProjectSpaceResource),T=wn(m.name,"",w);try{let k=await u.graphAuthenticated.drives.createDrive({name:T,description:m.description,quota:{total:m.spaceQuota.total}});const S=await u.webdav.listFiles(m);if(S.children.length){const y=new ur({concurrency:e.options.concurrentRequests.resourceBatchActions}),E=[];for(const D of S.children)E.push(y.add(()=>u.webdav.copyFiles(m,D,k,{path:D.name})));await Promise.all(E)}if(m.spaceReadmeData||m.spaceImageData){const y={special:[]};if(m.spaceReadmeData){const E=await u.webdav.getFileInfo(k,{path:`.space/${m.spaceReadmeData.name}`});y.special.push({specialFolder:{name:"readme"},id:E.id})}if(m.spaceImageData){const E=await u.webdav.getFileInfo(k,{path:`.space/${m.spaceImageData.name}`});y.special.push({specialFolder:{name:"image"},id:E.id})}k=await u.graphAuthenticated.drives.updateDrive(k.id,y,n.graphRoles)}t.upsertSpace(k),p&&c(k),r({title:i("Space »%{space}« was duplicated successfully",{space:m.name})})}catch(k){console.error(k),o({title:i("Failed to duplicate space »%{space}«",{space:m.name}),errors:[k]})}},h=async({resources:m})=>{for(const w of m)w.disabled||!z.isProjectSpaceResource(w)||await f(w)};return{actions:A(()=>[{name:"duplicate",icon:"folders",label:()=>i("Duplicate"),handler:m=>d.addTask(()=>h(m)),isVisible:({resources:m})=>!m?.length||m.every(w=>w.disabled)||m.every(w=>!z.isProjectSpaceResource(w))?!1:l.can("create-all","Drive"),class:"oc-files-actions-duplicate-trigger"}]),duplicateSpace:f}},RD=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=et(),{$gettext:r}=me.useGettext(),o=Bt(),s=Pe(),i=St(),{dispatchModal:l}=Je(),u=He(),d=(f,h)=>s.graphAuthenticated.drives.updateDrive(f.id,{name:f.name,description:h}).then(()=>{u.updateSpaceField({id:f.id,field:"description",value:h}),a(i).name==="admin-settings-spaces"&&(f.description=h),e({title:r("Space subtitle was changed successfully")})}).catch(m=>{console.error(m),t({title:r("Failed to change space subtitle"),errors:[m]})}),c=({resources:f})=>{f.length===1&&l({title:r("Change subtitle for space")+" "+f[0].name,confirmText:r("Confirm"),hasInput:!0,inputLabel:r("Space subtitle"),inputValue:f[0].description,onConfirm:h=>d(f[0],h)})};return{actions:A(()=>[{name:"editDescription",icon:"h-2",iconFillType:"none",label:()=>r("Edit subtitle"),handler:c,isVisible:({resources:f})=>f.length!==1?!1:f[0].canEditDescription({user:n.user,ability:o}),class:"oc-files-actions-edit-description-trigger"}]),editDescriptionSpace:d}},DD={name:"QuotaSelect",props:{totalQuota:{type:Number,default:0},maxQuota:{type:Number,default:0}},emits:["selectedOptionChange"],setup(){return{selectedOption:W(void 0),options:W([])}},computed:{quotaLimit(){return this.maxQuota||1e15},DEFAULT_OPTIONS(){return[{value:Math.pow(10,9),displayValue:this.getFormattedFileSize(Math.pow(10,9))},{value:2*Math.pow(10,9),displayValue:this.getFormattedFileSize(2*Math.pow(10,9))},{value:5*Math.pow(10,9),displayValue:this.getFormattedFileSize(5*Math.pow(10,9))},{value:10*Math.pow(10,9),displayValue:this.getFormattedFileSize(10*Math.pow(10,9))},{value:50*Math.pow(10,9),displayValue:this.getFormattedFileSize(50*Math.pow(10,9))},{value:100*Math.pow(10,9),displayValue:this.getFormattedFileSize(100*Math.pow(10,9))},{displayValue:this.$gettext("No restriction"),value:0}]}},watch:{totalQuota(){const e=this.options.find(t=>t.value===this.totalQuota);e&&(this.selectedOption=e)}},mounted(){this.setOptions(),this.selectedOption=this.options.find(e=>e.value===this.totalQuota)},methods:{onUpdate(e){this.selectedOption=e,this.$emit("selectedOptionChange",this.selectedOption)},optionSelectable(e){return e.selectable!==!1},isValueValidNumber(e){return rt.isNumber(e)?e>0:/^[0-9]\d*(([.,])\d+)?$/g.test(e)},createOption(e){if(e=e.replace(",","."),!this.isValueValidNumber(e))return{displayValue:e,value:e,error:this.$gettext("Please enter only numbers"),selectable:!1};const t=parseFloat(e)*Math.pow(10,9);return t>this.quotaLimit?{value:t,displayValue:this.getFormattedFileSize(t),error:this.$gettext("Please enter a value equal to or less than %{ quotaLimit }",{quotaLimit:this.getFormattedFileSize(this.quotaLimit).toString()}),selectable:!1}:{value:t,displayValue:this.getFormattedFileSize(t)}},setOptions(){let e=[...this.DEFAULT_OPTIONS];this.maxQuota&&(e=e.filter(n=>this.totalQuota===0&&n.value===0?(n.selectable=!1,!0):n.value!==0&&n.value<=this.maxQuota)),e.find(n=>n.value===this.totalQuota)||e.push({displayValue:this.getFormattedFileSize(this.totalQuota),value:this.totalQuota,selectable:this.totalQuota<=this.quotaLimit}),e=[...e.filter(n=>n.value).sort((n,r)=>n.value-r.value),...e.filter(n=>!n.value)],this.options=e},getFormattedFileSize(e){const t=Ht(e,this.$language.current);return this.isValueValidNumber(e)?t:e.toString()}}},PD={class:"quota-select-batch-action-form"},ID=["textContent"],FD={class:"flex justify-between"},$D=["textContent"],OD={key:0,class:"oc-text-input-danger"};function LD(e,t,n,r,o,s){const i=oe("oc-icon"),l=oe("oc-select");return I(),G("div",PD,[J(l,pt({ref:"select","model-value":r.selectedOption,selectable:s.optionSelectable,taggable:"","push-tags":"",clearable:!1,options:r.options,"create-option":s.createOption,"option-label":"displayValue",label:e.$gettext("Quota")},e.$attrs,{"onUpdate:modelValue":s.onUpdate}),{"selected-option":Z(({displayValue:u})=>[e.$attrs["read-only"]?(I(),re(i,{key:0,name:"lock",class:"mr-1",size:"small"})):le("",!0),Q("span",{textContent:R.toDisplayString(u)},null,8,ID)]),search:Z(({attributes:u,events:d})=>[Q("input",pt({class:"vs__search"},u,Gs(d,!0)),null,16)]),option:Z(({displayValue:u,error:d})=>[Q("div",FD,[Q("span",{textContent:R.toDisplayString(u)},null,8,$D)]),d?(I(),G("div",OD,R.toDisplayString(d),1)):le("",!0)]),_:1},16,["model-value","selectable","options","create-option","label","onUpdate:modelValue"])])}const Qm=Le(DD,[["render",LD]]),_D={key:0,class:"mt-2"},MD=["textContent"],Km=ge({__name:"QuotaModal",props:{modal:{},spaces:{},warningMessage:{default:""},warningMessageContextualHelperData:{default:()=>{}},resourceType:{default:"space"}},emits:["update:confirmDisabled"],setup(e,{expose:t,emit:n}){const r=n,{showMessage:o,showErrorMessage:s}=Me(),{$gettext:i,$ngettext:l}=me.useGettext(),u=Pe(),d=Re(),c=He(),p=Dt(),{spacesMaxQuota:f}=we.storeToRefs(p),{updateResourceField:h}=De(),g=W(e.spaces[0]?.spaceQuota?.total||0),m=y=>e.resourceType==="space"?l("Space quota was changed successfully","Quota of %{count} spaces was changed successfully",y,{count:y.toString()}):e.resourceType==="user"?l("User quota was changed successfully","Quota of %{count} users was changed successfully",y,{count:y.toString()}):i("Quota was changed successfully"),w=y=>e.resourceType==="space"?l("Failed to change space quota","Failed to change quota for %{count} spaces",y,{count:y.toString()}):e.resourceType==="user"?l("Failed to change user quota","Failed to change quota for %{count} users",y,{count:y.toString()}):i("Failed to change quota"),T=A(()=>!e.spaces.some(y=>y.spaceQuota.total!==a(g)));Ue(T,()=>{r("update:confirmDisabled",a(T))},{immediate:!0});const k=y=>{g.value=y.value};return t({onConfirm:async()=>{const y=u.graphAuthenticated,E=e.spaces.map(async L=>{const V=await y.drives.updateDrive(L.id,{name:L.name,quota:{total:a(g)}});a(d.currentRoute).name==="admin-settings-spaces"&&ze.publish("app.admin-settings.spaces.space.quota.updated",{spaceId:L.id,quota:V.spaceQuota}),a(d.currentRoute).name==="admin-settings-users"&&ze.publish("app.admin-settings.users.user.quota.updated",{spaceId:L.id,quota:V.spaceQuota}),c.updateSpaceField({id:L.id,field:"spaceQuota",value:V.spaceQuota}),h({id:L.id,field:"spaceQuota",value:V.spaceQuota})}),D=await Promise.allSettled(E),$=D.filter(Nr);$.length&&o({title:m($.length)});const _=D.filter(Br);_.length&&(console.error(_),_.forEach(console.error),s({title:w(_.length),errors:_.map(L=>L.reason)}))}}),(y,E)=>{const D=oe("oc-contextual-helper");return I(),G(Ae,null,[J(Qm,{"total-quota":g.value,"max-quota":a(f),"position-fixed":!0,onSelectedOptionChange:k},null,8,["total-quota","max-quota"]),e.warningMessage?(I(),G("div",_D,[Q("span",{class:"oc-text-input-warning",textContent:R.toDisplayString(e.warningMessage)},null,8,MD),e.warningMessageContextualHelperData?(I(),re(D,pt({key:0,class:"pl-1"},e.warningMessageContextualHelperData),null,16)):le("",!0)])):le("",!0)],64)}}}),Gm=()=>{const{dispatchModal:e}=Je(),{$gettext:t}=me.useGettext(),n=Bt(),r=({resources:i})=>i.length===1?t("Change quota for Space »%{name}«",{name:i[0].name}):t("Change quota for %{count} Spaces",{count:i.length.toString()}),o=({resources:i})=>{e({title:r({resources:i}),customComponent:Km,customComponentAttrs:()=>({spaces:i,resourceType:"space"})})};return{actions:A(()=>[{name:"editQuota",icon:"cloud",label:()=>t("Edit quota"),handler:o,isVisible:({resources:i})=>!i||!i.length||i.some(l=>!z.isProjectSpaceResource(l)||z.isSpaceResource(l)&&!l.spaceQuota)?!1:n.can("set-quota-all","Drive"),class:"oc-files-actions-edit-quota-trigger"}])}};function Jm(){const{triggerDefaultAction:e}=An();return{openWithDefaultApp:({space:n,resource:r})=>{if(!r||r.isFolder)return;e({...{resources:[r],space:n},omitSystemActions:!0})}}}const ND=()=>{const e=Pe(),{openWithDefaultApp:t}=Jm(),{createDefaultMetaFolder:n}=go(),r=et(),o=He(),{$gettext:s}=me.useGettext(),{getDefaultMetaFolder:i}=Fi(),l=async(c,p)=>{const f=await e.webdav.putFileContents(c,{path:".space/readme.md",parentFolderId:p.id,fileName:"readme.md"}),h=await e.graphAuthenticated.drives.updateDrive(c.id,{name:c.name,special:[{specialFolder:{name:"readme"},id:f.id}]});return o.updateSpaceField({id:c.id,field:"spaceReadmeData",value:h.spaceReadmeData}),f},u=async({resources:c})=>{let p=null,f=await i(c[0]);if(f||(f=await n(c[0]),p=await l(c[0],f)),!p){const h=z.getRelativeSpecialFolderSpacePath(c[0],"readme");h?p=await e.webdav.getFileInfo(c[0],{path:h}):p=await l(c[0],f)}t({space:c[0],resource:p})};return{actions:A(()=>[{name:"editReadmeContent",icon:"article",label:()=>s("Edit description"),handler:u,isVisible:({resources:c})=>c.length!==1?!1:c[0].canEditReadme({user:r.user}),class:"oc-files-actions-edit-readme-content-trigger"}])}},Xm=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=et(),{$gettext:r}=me.useGettext(),o=Bt(),s=Pe(),i=St(),{isSpaceNameValid:l}=Qr(),{dispatchModal:u}=Je(),d=He(),c=(h,g)=>s.graphAuthenticated.drives.updateDrive(h.id,{name:g}).then(()=>{a(i).name==="admin-settings-spaces"&&(h.name=g),d.updateSpaceField({id:h.id,field:"name",value:g}),e({title:r("Space name was changed successfully")})}).catch(w=>{console.error(w),t({title:r("Failed to rename space"),errors:[w]})}),p=({resources:h})=>{h.length===1&&u({title:r("Rename space »%{name}«",{name:h[0].name}),confirmText:r("Rename"),hasInput:!0,inputLabel:r("Space name"),inputValue:h[0].name,inputRequiredMark:!0,onConfirm:g=>c(h[0],g),onInput:(g,m)=>{const{isValid:w,error:T}=l(g);m(w?null:T)}})};return{actions:A(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:p,isVisible:({resources:h})=>h.length!==1?!1:h[0].canRename({user:n.user,ability:o}),class:"oc-files-actions-rename-trigger"}]),renameSpace:c}},Ym=()=>{const{showMessage:e,showErrorMessage:t}=Me(),n=et(),{$gettext:r,$ngettext:o}=me.useGettext(),s=Bt(),i=Pe(),l=Ut(),u=St(),{dispatchModal:d}=Je(),c=He(),p=m=>m.filter(w=>z.isProjectSpaceResource(w)&&w.canRestore({user:n.user,ability:s})),f=async m=>{const w=i.graphAuthenticated,T=m.map(E=>w.drives.updateDrive(E.id,{name:E.name},{headers:{Restore:"true"}}).then(D=>(a(u).name==="admin-settings-spaces"&&(E.disabled=!1,E.spaceQuota=D.spaceQuota),c.updateSpaceField({id:E.id,field:"disabled",value:!1}),!0))),k=await l.addTask(()=>Promise.allSettled(T));await c.loadGraphPermissions({ids:m.map(E=>E.id),graphClient:w});const S=k.filter(Nr);if(S.length){const E=S.length===1&&m.length===1?r("Space »%{space}« was enabled successfully",{space:m[0].name}):o("%{spaceCount} space was enabled successfully","%{spaceCount} spaces were enabled successfully",S.length,{spaceCount:S.length.toString()},!0);e({title:E})}const y=k.filter(Br);if(y.length){y.forEach(console.error);const E=y.length===1&&m.length===1?r("Failed to enable space »%{space}«",{space:m[0].name}):o("Failed to enable %{spaceCount} space","Failed to enable %{spaceCount} spaces",y.length,{spaceCount:y.length.toString()},!0);t({title:E,errors:y.map(D=>D.reason)})}},h=({resources:m})=>{const w=p(m);if(!w.length)return;const T=o("If you enable the selected space, it can be accessed again.","If you enable the %{count} selected spaces, they can be accessed again.",w.length,{count:w.length.toString()}),k=r("Enable");d({title:o("Enable Space »%{space}«?","Enable %{spaceCount} Spaces?",w.length,{space:w[0].name,spaceCount:w.length.toString()}),confirmText:k,message:T,hasInput:!1,onConfirm:()=>f(w)})};return{actions:A(()=>[{name:"restore",icon:"play-circle",label:()=>r("Enable"),handler:h,isVisible:({resources:m})=>!!p(m).length,class:"oc-files-actions-restore-trigger"}]),restoreSpaces:f}},BD=()=>{const{$gettext:e}=me.useGettext(),t=De(),{openSideBarPanel:n}=_t(),r=({resources:s})=>{t.setSelection(s.map(({id:i})=>i)),n("space-share")};return{actions:A(()=>[{name:"show-members",icon:"group",label:()=>e("Members"),handler:r,isVisible:({resources:s})=>s.length===1&&!s[0].disabled,class:"oc-files-actions-show-details-trigger"}])}},jD=()=>{const e=Re(),{$gettext:t}=me.useGettext(),n=o=>wr("files-trash-generic",{..._n(o,{fileId:o.fileId})});return{actions:A(()=>[{name:"navigateToTrash",icon:"delete-bin-5",label:()=>t("Open trash bin"),handler:({resources:o})=>{e.push(n(o[0]))},isVisible:({resources:o})=>!(o.length!==1||!z.isProjectSpaceResource(o[0])&&!z.isPersonalSpaceResource(o[0])||o[0].disabled),class:"oc-files-actions-navigate-to-trash-trigger"}])}},zD=ge({name:"EmojiPickerModal",components:{},props:{modal:{type:Object,required:!0}},emits:["confirm"],setup(e,{emit:t}){const n=Bn(),{currentTheme:r}=we.storeToRefs(n),o=A(()=>a(r).isDark?"dark":"light");return{onEmojiSelect:i=>{t("confirm",i)},theme:o}}});function UD(e,t,n,r,o,s){const i=oe("oc-emoji-picker");return I(),re(i,{theme:e.theme,onEmojiSelect:e.onEmojiSelect},null,8,["theme","onEmojiSelect"])}const Zm=Le(zD,[["render",UD]]),VD=()=>{const e=et(),{showMessage:t,showErrorMessage:n}=Me(),{$gettext:r}=me.useGettext(),o=Pe(),s=Ut(),i=He(),{createDefaultMetaFolder:l}=go(),{dispatchModal:u}=Je(),{getDefaultMetaFolder:d}=Fi(),c=({resources:g})=>{g.length===1&&u({elementClass:"w-auto",title:r("Set icon for »%{space}«",{space:g[0].name}),hideConfirmButton:!0,customComponent:Zm,focusTrapInitial:!1,onConfirm:m=>f(g[0],m)})},p=async g=>{const m=document.createElement("canvas"),w=m.getContext("2d"),T=16/9,k=720,S=k/T;m.width=k,m.height=S;const y=.4*k;w.font=`${y}px sans-serif`,w.textBaseline="middle",w.textAlign="center",w.fillText(g,m.width/2,m.height/2+15);const D=await wp(m);return bp(D)},f=async(g,m)=>{const w=o.graphAuthenticated,T=await p(m);let k=await d(g);return k||(k=await l(g)),s.addTask(async()=>{const S={"Content-Type":"application/offset+octet-stream"};try{const{fileId:y}=await o.webdav.putFileContents(g,{parentFolderId:k.id,fileName:"image.png",content:T,headers:S,overwrite:!0}),E=await w.drives.updateDrive(g.id,{name:g.name,special:[{specialFolder:{name:"image"},id:y}]});i.updateSpaceField({id:g.id,field:"spaceImageData",value:E.spaceImageData}),t({title:r("Space icon was set successfully")}),ze.publish("app.files.spaces.uploaded-image",E)}catch(y){if(console.error(y),y instanceof z.HttpError&&y.statusCode===507){n({title:r("Failed to set space icon"),desc:r("Not enough quota to set the space icon"),errors:[y]});return}n({title:r("Failed to set space icon"),errors:[y]})}})};return{actions:A(()=>[{name:"set-space-icon",icon:"emoji-sticker",handler:c,label:()=>r("Set icon"),isVisible:({resources:g})=>g.length!==1?!1:g[0].canEditImage({user:e.user}),class:"oc-files-actions-set-space-icon-trigger"}]),setIconSpace:f}},qD=()=>{const e=et(),{$gettext:t}=me.useGettext(),{dispatchModal:n}=Je(),{graphAuthenticated:r,webdav:o}=Pe(),s=He(),{showMessage:i,showErrorMessage:l}=Me(),{defaultSpaceImageBlobURL:u}=we.storeToRefs(s),d=async({space:f})=>{try{await o.deleteFile(f,{path:".space/image.png"}),await r.drives.updateDrive(f.id,{name:f.name,special:[{specialFolder:{name:"image"},id:null}]}),s.updateSpaceField({id:f.id,field:"spaceImageData",value:null}),s.updateSpaceField({id:f.id,field:"thumbnail",value:a(u)}),i({title:t("Space image deleted successfully")})}catch(h){console.error(h),l({title:t("Failed to delete space image"),errors:[h]})}},c=({resources:f})=>{n({title:t("Delete »%{space}« image",{space:f[0].name}),confirmText:t("Delete"),onConfirm:()=>d({space:f[0]}),message:t("Are you sure you want to delete the image of »%{space}«?",{space:f[0].name})})};return{actions:A(()=>[{name:"delete-space-image",icon:"delete-bin",handler:c,label:()=>t("Delete image"),isVisible:({resources:f})=>f.length!==1||!f[0].spaceImageData?!1:f[0].canEditImage({user:e.user}),class:"oc-files-actions-delete-space-image-trigger"}]),deleteSpaceImage:d}},HD=()=>{const{$gettext:e}=me.useGettext(),{openSideBar:t}=_t();return{actions:A(()=>[{name:"show-details",icon:"information",label:()=>e("Details"),handler:()=>t(),isVisible:({resources:r})=>r.length>0,class:"oc-admin-settings-show-details-trigger"}])}},WD=()=>{const{getMatchingSpace:e}=It(),t=He(),n=Mn(),r=De(),o=Pe(),{$gettext:s}=me.useGettext(),{openEditor:i}=An(),{resources:l,currentFolder:u}=we.storeToRefs(r);return{openEmptyEditor:async(c,p)=>{let f=a(u)?e(a(u)):null,h=a(l),g=a(u)?.path;(!f||!a(u).canCreate())&&(f=t.personalSpace,h=(await o.webdav.listFiles(f)).children,g="");let m=s("New file")+`.${p}`;h.some(S=>S.name===m)&&(m=wn(m,p,h));const w=await o.webdav.putFileContents(f,{path:z.urlJoin(g,m)}),T=e(w),k=n.fileExtensions.find(({app:S,extension:y})=>S===c&&y===p);i(k,T,w)}}},eg=()=>{const{$gettext:e}=me.useGettext(),{showMessage:t}=Me();return{openUrl:(r,o,s)=>{const i=window.open(r,o);i?s&&i.focus():t({title:e("Pop-up and redirect block detected"),timeout:20,status:"warning",desc:e("Please turn on pop-ups and redirects in your browser settings to make sure everything works right.")})}}},QD=()=>er("$appProviderService"),KD=()=>{const{isResourceAccessible:e}=It();return{breadcrumbsFromPath:({route:r,space:o,resourcePath:s,ancestorMetaData:i=W({})})=>{const l=(c="")=>c.split("/").filter(Boolean),u=l(r.path),d=l(s);return d.map((c,p)=>{const f=z.urlJoin(...d.slice(0,p+1),{leadingSlash:!0}),h=e({space:a(o),path:f});let g;return h&&(g=a(i)[f]),{id:Ct.v4(),allowContextActions:!0,text:c,...h&&{to:{path:"/"+[...u].splice(0,u.length-d.length+p+1).join("/"),query:{...po(r.query,"page","fileId"),...g&&{fileId:g.id}}}},isStaticNav:!1}})},concatBreadcrumbs:(...r)=>{const o=r.pop();return[...r,{id:Ct.v4(),allowContextActions:o.allowContextActions,text:o.text,onClick:()=>ze.publish("app.files.list.load"),isTruncationPlaceholder:o.isTruncationPlaceholder,isStaticNav:o.isStaticNav}]}}},GD=(e="")=>{const t=W(0),n=async()=>{await xt();const r=document.querySelector(e||"#files-app-bar"),o=r?r.getBoundingClientRect().height:0;t.value!==o&&(t.value=o)};return window.onresize=n,yt(n),{y:t,refresh:n}},Ac=()=>{const e=W(!0),t=()=>{e.value=window.innerHeight>500};return yt(()=>{t(),window.addEventListener("resize",t)}),bn(()=>{window.removeEventListener("resize",t)}),{isSticky:e}};class Ao{static perPageDefault="100";static perPageQueryName="items-per-page";static options=["20","50","100","250","500"]}function JD(e){const t=Ds.useRouter(),n=Ds.useRoute(),r=XD(e),o=YD(e),s=A(()=>Math.ceil(a(e.items).length/a(o))||1),i=A(()=>{if(!a(o))return a(e.items);const l=(a(r)-1)*a(o),u=l+a(o);return a(e.items).slice(l,u)});return ze.subscribe("app.files.navigate.page",({resourceId:l,forceScroll:u,topbarElement:d})=>{const c=rt.findIndex(a(e.items),p=>p.id===l);if(c>=0){const p=Math.ceil((c+1)/Number(a(o)));t.push({...a(n),query:{...a(n).query,page:p}}).then(()=>{ze.publish("app.files.navigate.scrollTo",{resourceId:l,forceScroll:u,topbarElement:d})})}}),{items:i,total:s,page:r,perPage:o}}function XD(e){if(e.page)return A(()=>a(e.page));const t=Pt("page","1");return A(()=>parseInt(at(a(t))))}function YD(e){if(e.perPage)return A(()=>a(e.perPage));const t=nr({name:e.perPageQueryName||Ao.perPageQueryName,defaultValue:e.perPageDefault||Ao.perPageDefault,storagePrefix:e.perPageStoragePrefix});return A(()=>parseInt(at(a(t))))}const tg=()=>er("$passwordPolicyService");var sa=(e=>(e.mounted="portal-target.mounted",e))(sa||{});const ZD=()=>{const e=rr(),t=Rs.useWormhole();return{registerPortal:r=>{e.subscribe(sa.mounted,()=>{t.open(r)})}}},ng=()=>er("$previewService"),rg=()=>{const e=Mn();return{canBeOpenedWithSecureView:n=>e.fileExtensions.filter(({secureView:o})=>o).some(({mimeType:o})=>o===n.mimeType)}},og=()=>{const e=et();return{canListVersions:({space:n,resource:r})=>r.type==="folder"||z.isSpaceResource(r)||z.isTrashResource(r)?!1:n?.canListVersions({user:e.user})}},sg=()=>{const e=Pe(),t=He(),n=A(()=>t.spaces),r=u=>a(n).find(d=>u.toString().startsWith(d.id.toString())),o=u=>a(n).find(d=>z.isMountPointSpaceResource(d)&&d.root?.remoteItem?.id===u),s=(u,d)=>{const c=[Ee.FileId,Ee.FileParent,Ee.Name,Ee.ResourceType],p=z.buildSpace({id:u,name:""});return e.webdav.getFileInfo(p,{fileId:u},{davProperties:c,signal:d})},i=$t.useTask(function*(u,d){let c,p,f=r(d);if(f)return c=yield e.webdav.getPathForFileId(d,{signal:u}),p=yield e.webdav.getFileInfo(f,{path:c},{signal:u}),{space:f,resource:p,path:c};yield t.loadMountPoints({graphClient:e.graphAuthenticated,signal:u});let h=o(d);p=yield s(d,u);const g=h?[]:[a(p).name];let m=a(p);for(;!h;)m=yield s(m.parentFolderId,u),h=o(m.id),h||g.unshift(m.name);return f=t.getSpace(h.root?.remoteItem?.id)||t.createShareSpace({driveAliasPrefix:p.storageId?.startsWith(z.OCM_PROVIDER_ID)?"ocm-share":"share",id:h.root?.remoteItem?.id,shareName:h.name}),c=z.urlJoin(...g),{space:f,resource:p,path:c}}).restartable();return{getResourceContext:u=>i.perform(u)}},Ft={name:{table:"resource-table",condensedTable:"resource-table-condensed",tiles:"resource-tiles"},defaultModeName:"resource-tiles",queryName:"view-mode",tilesSizeDefault:2,tilesSizeMax:6,tilesSizeQueryName:"tiles-size"},eP=140,tP=84,ig=()=>{const e=W(eP),t=W(tP),n=o=>a(e)+(o-1)*a(t);return{calculateTileSizePixels:n,calculateTileSizeRem:o=>{const s=parseFloat(getComputedStyle(document.documentElement).fontSize);return n(o)/s}}};function nP(e){if(e)return A(()=>a(e));const t=nr({name:Ft.queryName,defaultValue:Ft.defaultModeName});return A(()=>at(a(t)))}function rP(e){if(e)return A(()=>parseInt(a(e)));const t=nr({name:Ft.tilesSizeQueryName,defaultValue:Ft.tilesSizeDefault.toString()});return A(()=>parseInt(at(a(t))))}const oP=W(Ft.tilesSizeMax);function Ec(){return oP}const Rc=e=>{const t=ng(),{updateResourceField:n}=De(),{httpAuthenticated:r}=Pe(),o=He(),{defaultSpaceImageBlobURL:s}=we.storeToRefs(o),i=Ge(),{serverUrl:l}=we.storeToRefs(i),u=new ur({concurrency:4}),d=A(()=>a(e)===Ft.name.tiles),c=A(()=>a(d)?Ci.enum.fit:Ci.enum.thumbnail),p=A(()=>a(d)?bs.Tile:bs.Thumbnail),f=$t.useTask(function*(w,{space:T,resource:k,dimensions:S,processor:y,updateStore:E=!0}){const D=z.isProjectSpaceResource(k)?z.buildSpaceImageResource(k):k,$=D.id===T.spaceImageData?.id;$&&o.addToImagesLoading(T.id);const _=yield u.add(()=>t.loadPreview({space:T,resource:D,processor:y||a(c),dimensions:S||a(p)},!0,!0,w));return _&&E&&n({id:k.id,field:"thumbnail",value:_}),$&&o.removeFromImagesLoading(T.id),_}),h=async w=>{const{resource:T,cancelRunning:k}=w;if(k&&m(),z.isProjectSpaceResource(T)&&(!T.spaceImageData||T.disabled)){a(s)&&o.updateSpaceField({id:T.id,field:"thumbnail",value:a(s)});try{const S=await r.get(`${a(l)}images/default-space-icon.png`,{responseType:"blob"});return o.setDefaultSpaceImageBlobURL(URL.createObjectURL(S.data)),o.updateSpaceField({id:T.id,field:"thumbnail",value:a(s)}),a(s)}catch{return null}}try{return await f.perform(w)}catch(S){S!=="cancel"&&console.error(S)}},g=A(()=>f.isRunning),m=()=>{f.cancelAll(),u.clear(),o.purgeImagesLoading()};return Qs(m),{loadPreview:h,previewsLoading:g}},ag=({showSizeInformation:e=!0}={})=>{const t=De(),{current:n,$gettext:r,$ngettext:o}=me.useGettext(),s=Re(),{resources:i,totalResourcesCount:l,areHiddenFilesShown:u,currentFolder:d}=we.storeToRefs(t),c=A(()=>{if(!a(d)?.size||a(d)?.size==="0"){const f=a(i).map(h=>h.size?parseInt(h.size.toString()):0).reduce((h,g)=>h+g,0);return Ht(f,n)}return Ht(a(d).size,n)});return{resourceContentsText:A(()=>{let f=o("%{ filesCount } file","%{ filesCount } files",a(l).files,{filesCount:a(l).files.toString()});!a(u)&&a(l).hiddenFiles&&(f=o("%{ filesCount } file including %{ filesHiddenCount } hidden","%{ filesCount } files including %{ filesHiddenCount } hidden",a(l).files,{filesCount:a(l).files.toString(),filesHiddenCount:a(l).hiddenFiles.toString()}));let h=o("%{ foldersCount } folder","%{ foldersCount } folders",a(l).folders,{foldersCount:a(l).folders.toString()});!a(u)&&a(l).hiddenFolders&&(h=o("%{ foldersCount } folder including %{ foldersHiddenCount } hidden","%{ foldersCount } folders including %{ foldersHiddenCount } hidden",a(l).folders,{foldersCount:a(l).folders.toString(),foldersHiddenCount:a(l).hiddenFolders.toString()}));const g=o("%{ spacesCount } space","%{ spacesCount } spaces",a(l).spaces,{spacesCount:a(l).spaces.toString()}),m=a(l).files+a(l).folders+a(l).spaces,w=e&&parseFloat(a(c))>0,T=mt(s,"files-shares-via-link"),k=r(w?"%{ itemsCount } item with %{ itemSize } in total":"%{ itemsCount } item in total"),S=r(w?"%{ itemsCount } items with %{ itemSize } in total":"%{ itemsCount } items in total"),y=T?"(%{ filesStr}, %{ foldersStr}, %{ spacesStr})":"(%{ filesStr}, %{ foldersStr})",E=`${k} ${y}`,D=`${S} ${y}`;return o(E,D,m,{itemsCount:m.toString(),itemSize:a(c),filesStr:f,foldersStr:h,spacesStr:g})})}},Dc=()=>{const{$gettext:e}=me.useGettext(),{interceptModifierClick:t}=zr(),{openSideBarPanel:n}=_t(),r=De(),o=et(),s=k=>z.ShareTypes.containsAnyValue(z.ShareTypes.authenticated,k??[]),i=k=>z.ShareTypes.containsAnyValue(z.ShareTypes.unauthenticated,k??[]),l=({isDirect:k})=>e(k?"This item is directly shared with others.":"This item is shared with others through one of the parent folders."),u=({isDirect:k})=>e(k?"This item is directly shared via links.":"This item is shared via links through one of the parent folders."),d=({resource:k,isDirect:S})=>({id:`files-sharing-${k.getDomSelector()}`,accessibleDescription:l({isDirect:S}),label:e("Show invited people"),icon:"group",category:"sharing",type:S?"user-direct":"user-indirect",fillType:"line",handler:(y,E)=>{E&&t(E,y)||n("sharing")}}),c=({resource:k})=>({id:`files-sharing-synced-${k.getDomSelector()}`,accessibleDescription:e("This item is synced with your devices"),label:e("Synced with your devices"),icon:"loop-right",category:"sharing",type:"resource-synced",fillType:"line"}),p=({resource:k})=>k.shareRoles?.length?{id:`files-sharing-role-${k.getDomSelector()}`,accessibleDescription:e(k.shareRoles[0].description),label:e(k.shareRoles[0].displayName),icon:k.shareRoles[0].icon,category:"sharing",type:"share-role",fillType:"line"}:{id:`files-sharing-role-${k.getDomSelector()}`,accessibleDescription:z.ShareTypes.remote.label,label:z.ShareTypes.remote.label,icon:z.ShareTypes.remote.icon,category:"sharing",type:"share-role",fillType:"line"},f=({resource:k,isDirect:S})=>({id:`file-link-${k.getDomSelector()}`,accessibleDescription:u({isDirect:S}),label:e("Show links"),icon:"link",category:"sharing",type:S?"link-direct":"link-indirect",fillType:"line",handler:()=>n("sharing")}),h=({resource:k})=>({id:`resource-locked-${k.getDomSelector()}`,accessibleDescription:e("Item locked"),label:e("This item is locked"),icon:"lock",category:"system",type:"resource-locked",fillType:"line"}),g=({resource:k})=>({id:`resource-processing-${k.getDomSelector()}`,accessibleDescription:e("Item in processing"),label:e("This item is in processing"),icon:"loop-right",category:"system",type:"resource-processing",fillType:"line"}),m=({resource:k})=>({id:`resource-space-enabled-${k.getDomSelector()}`,accessibleDescription:e("Space is enabled"),label:e("This space is enabled"),icon:"play-circle",category:"space",type:"resource-space-enabled",fillType:"line"}),w=({resource:k})=>({id:`resource-space-disabled-${k.getDomSelector()}`,accessibleDescription:e("Space is disabled"),label:e("This space is disabled"),icon:"stop-circle",category:"space",type:"resource-space-disabled",fillType:"line"});return{getIndicators:({space:k,resource:S})=>{const y=[];if(S.locked&&y.push(h({resource:S})),S.processing&&y.push(g({resource:S})),z.isProjectSpaceResource(S)&&!S.disabled&&y.push(m({resource:S})),z.isProjectSpaceResource(S)&&S.disabled&&y.push(w({resource:S})),z.isIncomingShareResource(S)&&(S.shareTypes.includes(z.ShareTypes.remote.value)||S.shareRoles?.length)&&y.push(p({resource:S})),z.isIncomingShareResource(S)&&S.syncEnabled&&y.push(c({resource:S})),z.isProjectSpaceResource(k)||z.isPersonalSpaceResource(k)&&k.isOwner(o.user)){const $=Object.values(r.ancestorMetaData).flatMap(({shareTypes:V})=>V),_=s(S.shareTypes);(_||s($))&&y.push(d({resource:S,isDirect:_}));const L=i(S.shareTypes);(L||i($))&&y.push(f({resource:S,isDirect:L}))}return y}}},lg=({isResourceSelected:e,isResourceDisabled:t,emit:n})=>{const r=rr(),{isMobile:o}=os(),{interceptModifierClick:s}=zr(),i=f=>{r.publish("app.files.list.clicked"),n("update:selectedIds",f)},l=xn(qt,"files-trash-overview"),u=f=>a(l)&&z.isProjectSpaceResource(f)&&f.disabled?!1:!t(f),d=f=>document.getElementById(`context-menu-trigger-${f.getDomSelector()}`);return{shouldShowContextDrop:u,showContextMenuOnBtnClick:(f,h)=>{const{dropdown:g,event:m}=f;if(m instanceof MouseEvent&&s(m,h))return;if(t(h))return!1;if(g?.tippy===void 0)return;const w=d(h);w&&(e(h)||i([h.id]),Ml(g.tippy,m,w))},showContextMenuOnRightClick:(f,h)=>{if(f instanceof MouseEvent&&s(f,h))return;if(f.preventDefault(),t(h))return!1;const g=d(h);if(g){if(e(h)||i([h.id]),a(o)){g.click();return}Ml(g._tippy,f,g)}}}},cg=({selectedIds:e,selectedResources:t,emit:n})=>{const r=De(),o=W(),s=nn("ghostElement"),i=async(f,h)=>{o.value=f,await xt(),a(s).$el.ariaHidden="true",a(s).$el.style.left="-99999px",a(s).$el.style.top="-99999px",h.dataTransfer.setDragImage(a(s).$el,0,0),h.dataTransfer.dropEffect="move",h.dataTransfer.effectAllowed="move"},l=async(f,h)=>{a(e).includes(f.id)||(r.toggleSelection(f.id),n("update:selectedIds",[...r.selectedIds])),await i(f,h)},u=A(()=>a(t).filter(({id:f})=>f!==a(o)?.id)),d=f=>(f.dataTransfer.types||[]).some(h=>h==="Files"),c=(f,h)=>{d(h)||(o.value=null,p(f,!0,h),n("fileDropped",f.id))},p=(f,h,g)=>{if(d(g)||g.currentTarget?.contains(g.relatedTarget)||a(e).includes(f.id)||f.type!=="folder")return;const m=document.querySelectorAll(`[data-item-id='${f.id}']`)?.[0];if(!m)return;const w="!bg-role-secondary-container";h?m.classList.remove(w):m.classList.add(w)};return{ghostElement:s,dragItem:o,dragSelection:u,dragStart:l,fileDropped:c,setDropStyling:p}},ug=({resources:e,disabledResources:t,selectedIds:n,emit:r})=>{const o=rr(),{$gettext:s}=me.useGettext(),i=p=>{o.publish("app.files.list.clicked"),r("update:selectedIds",p)},l=p=>{switch(p.type){case"folder":return s("Select folder");case"space":return s("Select space");default:return s("Select file")}},u=A(()=>{const p=a(t).length===a(e).length,f=a(n).length===a(e).length-a(t).length;return!p&&f}),d=A(()=>a(u)?s("Clear selection"):s("Select all"));return{getResourceCheckboxLabel:l,areAllResourcesSelected:u,selectAllCheckboxLabel:d,toggleSelectionAll:()=>{if(a(u))return i([]);i(a(e).filter(p=>!a(t).includes(p.id)).map(p=>p.id))}}},Pc=({space:e,resources:t,selectedIds:n,emit:r})=>{const o=De(),s=Re(),i=rr(),{interceptModifierClick:l}=zr(),{getMatchingSpace:u}=It(),{canBeOpenedWithSecureView:d}=rg(),{getDefaultAction:c}=An(),{isEnabled:p,fileTypes:f,isFilePicker:h,postMessage:g}=Tr(),m=ns(),{resources:w,action:T}=we.storeToRefs(m),k=A(()=>a(t).filter(O=>a(n).includes(O.id))),S=O=>a(n).includes(O.id),y=O=>o.deleteQueue.includes(O),E=O=>a(p)&&a(f)?.length?!a(f).includes(O.extension)&&!a(f).includes(O.mimeType)&&!O.isFolder:y(O.id)?!0:O.processing===!0,D=A(()=>a(t)?.filter(E)?.map(O=>O.id)||[]);return{selectedResources:k,disabledResources:D,isResourceSelected:S,isResourceInDeleteQueue:y,isResourceDisabled:E,isResourceClickable:(O,M)=>!M||z.isProjectSpaceResource(O)&&O.disabled||!O.isFolder&&!O.canDownload()&&!d(O)?!1:!E(O),isResourceCut:O=>a(T)!==Zo.Cut?!1:a(w).some(M=>M.id===O.id),fileContainerClicked:({resource:O,event:M})=>{if(E(O))return;if(a(p)&&a(h)&&!O.isFolder)return g("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(O)),locationQuery:JSON.parse(JSON.stringify(Ii(a(s.currentRoute))))});!M.shiftKey&&!M.metaKey&&!M.ctrlKey&&i.publish("app.files.shiftAnchor.reset");const N=M?.target;if(N?.closest("div")?.id==="oc-files-context-menu")return;if(M&&M.metaKey)return i.publish("app.files.list.clicked.meta",O);if(M&&M.shiftKey)return i.publish("app.files.list.clicked.shift",{resource:O,skipTargetSelection:!1});N.getAttribute("type")!=="checkbox"&&(S(O)||(i.publish("app.files.list.clicked"),r("update:selectedIds",[O.id])))},fileNameClicked:({resource:O,event:M})=>{if(!l(M,O)){if(a(p))return a(h)||r("update:selectedIds",[O.id]),a(h)&&!O.isFolder?g("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(O)),locationQuery:JSON.parse(JSON.stringify(Ii(a(s.currentRoute))))}):void 0;r("fileClick",{space:u(O),resources:[O]})}},fileCheckboxClicked:({resource:O,event:M})=>{l(M,O)||(o.toggleSelection(O.id),i.publish("app.files.list.clicked"),r("update:selectedIds",[...o.selectedIds]))},getResourceLink:O=>{let M=a(e);M||(M=u(O));const N=c({resources:[O],space:M});if(N?.route)return N.route({space:M,resources:[O]})},...cg({selectedIds:n,selectedResources:k,emit:r}),...lg({isResourceDisabled:E,isResourceSelected:S,emit:r}),...ug({resources:t,disabledResources:D,selectedIds:n,emit:r})}},Ic=()=>{const{getMatchingSpace:e}=It(),t=De(),n=A({get(){return t.selectedResources},set(i){t.setSelection(i.map(({id:l})=>l))}}),r=A({get(){return t.selectedIds},set(i){t.setSelection(i)}}),o=i=>a(r).includes(i.id),s=A(()=>{if(a(n).length!==1)return null;const i=a(n)[0];return e(i)});return{selectedResources:n,selectedResourcesIds:r,isResourceInSelection:o,selectedResourceSpace:s}};class Cs{static sortByQueryName="sort-by";static sortDirQueryName="sort-dir"}function sP(e){const t=Re(),n=iP(e),r=aP(e),o=A(()=>fg(a(n))||a(Fc(a(i))?.name)),s=A(()=>cP(a(r))||lP(a(o),a(i))),i=e.fields;return{items:A(()=>{const d=a(e.items);return a(o)?dg(d,a(i),a(o),a(s)):d}),sortBy:o,sortDir:s,handleSort:({sortBy:d,sortDir:c})=>t.replace({query:{...a(t.currentRoute).query,[a(e.sortByQueryName)||Cs.sortByQueryName]:d,[a(e.sortDirQueryName)||Cs.sortDirQueryName]:c}})}}function iP(e){return e.sortBy?ft(e.sortBy)?e.sortBy:W(e.sortBy):nr({name:a(e.sortByQueryName)||Cs.sortByQueryName,defaultValue:a(Fc(a(e.fields))?.name),storagePrefix:a(e.routeName)||a(jl())})}function aP(e){return e.sortDir?ft(e.sortDir)?e.sortDir:W(e.sortDir):nr({name:a(e.sortDirQueryName)||Cs.sortDirQueryName,defaultValue:a(Fc(a(e.fields))?.sortDir),storagePrefix:a(e.routeName)||a(jl())})}const Fc=e=>{const t=e.filter(n=>n.sortable);return t?t[0]:null},lP=(e,t)=>{const n=t.find(r=>r.name===e);return n&&n.sortDir?a(n.sortDir):Xe.Desc},dg=(e,t,n,r)=>{const o=t.find(l=>l.name===n);if(!o)return e;const{sortable:s}=o,i=new Intl.Collator(navigator.language,{sensitivity:"base",numeric:!0});if(n==="name"){const l=c=>c.type==="folder"&&!c.extension,u=[...e.filter(c=>l(c))].sort((c,p)=>$c(c,p,i,n,r,s)),d=[...e.filter(c=>!l(c))].sort((c,p)=>$c(c,p,i,n,r,s));return r===Xe.Asc?u.concat(d):d.concat(u)}return[...e].sort((l,u)=>$c(l,u,i,o.prop||o.name,r,s))},$c=(e,t,n,r,o,s)=>{let i=El(e,r),l=El(t,r);const u=o===Xe.Asc?1:-1;if(s)if(typeof s=="string"){const c=p=>p.map(f=>f[s]).join("");i=c(i),l=c(l)}else typeof s=="function"&&(i=s(i),l=s(l));return!isNaN(i)&&!isNaN(l)?(i-l)*u:n.compare((i||"").toString(),(l||"").toString())*u},fg=e=>Array.isArray(e)?e[0]:e,cP=e=>{switch(fg(e)){case Xe.Asc:return Xe.Asc;case Xe.Desc:return Xe.Desc}return null};function uP(e){const t=Dt(),n=Lr(),r=Pe(),o=me.useGettext(),s=A(()=>t.tusMaxChunkSize>0),i=()=>{const d={};return n.publicLinkPassword?d.Authorization="Basic "+gi.from(["public",n.publicLinkPassword].join(":")).toString("base64"):n.accessToken&&!n.publicLinkPassword&&(d.Authorization="Bearer "+n.accessToken),d["X-Request-ID"]=Ct.v4(),d["Accept-Language"]=o.current,d["Initiator-ID"]=r.initiatorId,d},l=A(()=>{const d={onBeforeRequest:(c,p)=>new Promise(f=>{const h=i();c.setHeader("Authorization",h.Authorization),c.setHeader("X-Request-ID",h["X-Request-ID"]),c.setHeader("Accept-Language",h["Accept-Language"]),c.setHeader("Initiator-ID",h["Initiator-ID"]),p?.isRemote&&c.setHeader("x-oc-mtime",(p?.data?.lastModified/1e3).toFixed(0)),f()}),chunkSize:t.tusMaxChunkSize||1/0,overridePatchMethod:t.tusHttpMethodOverride,uploadDataDuringCreation:t.tusExtension.includes("creation-with-upload")};return d.headers=c=>{if(c.xhrUpload||c?.isRemote)return{"x-oc-mtime":(c?.data?.lastModified/1e3).toFixed(0),...i()}},d}),u=A(()=>({timeout:6e4,endpoint:"",headers:d=>({"x-oc-mtime":(d?.data?.lastModified/1e3).toFixed(0),...i()})}));Ue([l,u],()=>{if(a(s)){e.uppyService.useTus(a(l));return}e.uppyService.useXhr(a(u))},{immediate:!0})}const pg=()=>{const e=Pe(),{addAvatar:t,getAvatar:n,avatarsQueue:r,pendingAvatarsRequests:o}=fi(),s=async l=>{try{const u=await e.graphAuthenticated.photos.getUserPhoto(l,{responseType:"blob"});t(l,URL.createObjectURL(u))}catch(u){u.response?.status===404&&t(l,null)}return n(l)};return{enqueueAvatar:l=>{if(n(l)!==void 0||o.has(l))return;const u=r.add(()=>s(l));o.set(l,u),u.finally(()=>o.delete(l))}}},dP=ge({name:"ActionMenuItem",props:{action:{type:Object,required:!0},actionOptions:{type:Object,required:!0},size:{type:String,required:!1,default:"medium"},appearance:{type:String,default:"raw"},shortcutHint:{type:Boolean,default:!0,required:!1},showTooltip:{type:Boolean,default:!1,required:!1},buttonClasses:{type:Array,default:()=>[]}},setup(e){const t=Ge(),{options:n}=we.storeToRefs(t),r=A(()=>Object.hasOwn(e.action,"route")?"router-link":Object.hasOwn(e.action,"href")?"a":(Object.hasOwn(e.action,"handler")||console.warn("ActionMenuItem: No handler, route or href callback found in action",e.action),"button")),o=A(()=>({...{appearance:e.action.appearance||e.appearance,...e.action.isDisabled&&{disabled:e.action.isDisabled(e.actionOptions)},...e.action.id&&{id:e.action.id}},...a(r)==="router-link"&&{to:e.action.route(e.actionOptions)},...a(r)==="a"&&{href:e.action.href(e.actionOptions)},...["router-link","a"].includes(a(r))&&{target:n.value.cernFeatures?"_blank":"_self"}})),s=A(()=>typeof e.action.icon=="function"?e.action.icon(e.actionOptions):e.action.icon);return{componentType:r,componentProps:o,actionIcon:s}},computed:{hasExternalImageIcon(){return this.actionIcon&&/^https?:\/\//i.test(this.actionIcon)},componentListeners(){if(typeof this.action.handler!="function")return{};const e=()=>this.action.handler({...this.actionOptions});return this.action.keepOpen?{click:t=>{t.stopPropagation(),e()}}:{click:e}}}}),fP={key:3,class:"oc-files-context-action-label flex flex-col","data-testid":"action-label"},pP=["textContent"],hP=["textContent"];function mP(e,t,n,r,o,s){const i=oe("oc-image"),l=oe("oc-icon"),u=oe("oc-button"),d=Lt("oc-tooltip");return je((I(),G("li",null,[je((I(),re(u,pt({type:e.componentType},e.componentProps,{class:[e.action.class,"action-menu-item","align-middle","w-full",...e.buttonClasses],"aria-label":e.componentProps.disabled?e.action.disabledTooltip?.(e.actionOptions)??e.action.label(e.actionOptions):e.action.label(e.actionOptions),"data-testid":"action-handler",size:e.size,"justify-content":"left"},Gs(e.componentListeners)),{default:Z(()=>[e.action.img?(I(),re(i,{key:0,"data-testid":"action-img",src:e.action.img,alt:"",class:"oc-icon oc-icon-m w-[22px]"},null,8,["src"])):e.hasExternalImageIcon?(I(),re(i,{key:1,"data-testid":"action-img",src:e.actionIcon,alt:"",class:"oc-icon oc-icon-m w-[22px]"},null,8,["src"])):e.actionIcon?(I(),re(l,{key:2,"data-testid":"action-icon",name:e.actionIcon,"fill-type":e.action.iconFillType||"line",size:e.size},null,8,["name","fill-type","size"])):le("",!0),e.action.hideLabel?le("",!0):(I(),G("span",fP,[Q("span",{class:"text-left",textContent:R.toDisplayString(e.action.label(e.actionOptions))},null,8,pP)])),e.action.shortcut&&e.shortcutHint?(I(),G("span",{key:4,class:"text-sm flex-row-reverse",textContent:R.toDisplayString(e.action.shortcut)},null,8,hP)):le("",!0)]),_:1},16,["type","class","aria-label","size"])),[[d,e.showTooltip||e.action.hideLabel?e.action.label(e.actionOptions):""]])])),[[d,e.componentProps.disabled?e.action.disabledTooltip?.(e.actionOptions):""]])}const ia=Le(dP,[["render",mP]]),gP=ge({name:"BatchActions",components:{ActionMenuItem:ia},props:{actions:{type:Array,required:!0},actionOptions:{type:Object,required:!0},limitedScreenSpace:{type:Boolean,default:!1,required:!1}}});function vP(e,t,n,r,o,s){const i=oe("action-menu-item"),l=oe("oc-list");return I(),G("div",null,[J(l,{id:"oc-appbar-batch-actions",class:R.normalizeClass(["block xl:flex xl:items-center",{"oc-appbar-batch-actions-squashed [&_.oc-files-context-action-label]:hidden":e.limitedScreenSpace}])},{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.actions,(u,d)=>(I(),re(i,{key:`action-${d}`,action:u,"action-options":e.actionOptions,appearance:"raw",class:"batch-actions mr-2 float-left [&_.action-menu-item]:p-2 [&_.action-menu-item]:gap-1","shortcut-hint":!1,"show-tooltip":e.limitedScreenSpace},null,8,["action","action-options","show-tooltip"]))),128))]),_:1},8,["class"])])}const hg=Le(gP,[["render",vP]]),yP={class:"context-menu px-2"},bP={class:"inline-flex gap-2"},wP={class:"flex oc-files-context-action-label"},SP=["textContent"],mg=ge({__name:"ActionMenuDropItem",props:{menuSectionDrop:{},appearance:{},actionOptions:{}},setup(e){const t=_r(`oc-files-context-actions-${e.menuSectionDrop.name}-drop-`),n=_r(`oc-files-context-actions-${e.menuSectionDrop.name}-toggle-`);return(r,o)=>{const s=oe("oc-icon"),i=oe("oc-button"),l=oe("oc-list");return I(),G("li",yP,[J(i,{id:a(n),appearance:"raw","justify-content":"space-between","gap-size":"medium",class:"w-full flex justify-between","aria-expanded":"false"},{default:Z(()=>[Q("span",bP,[J(s,{name:e.menuSectionDrop.icon,size:"medium","fill-type":"line"},null,8,["name"]),Q("span",wP,[Q("span",{textContent:R.toDisplayString(e.menuSectionDrop.label)},null,8,SP)])]),J(s,{name:"arrow-right-s",size:"small","fill-type":"line"})]),_:1},8,["id"]),J(a(gE),{title:e.menuSectionDrop.label,"drop-id":a(t),toggle:`#${a(n)}`,"is-nested-element":!0,mode:"hover",class:"w-3xs oc-files-context-action-drop","padding-size":"small",position:"auto-start","close-on-click":""},{default:Z(()=>[e.menuSectionDrop.items.length?(I(),re(l,{key:0},{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.menuSectionDrop.items,(u,d)=>(I(),re(ia,{key:`section-${e.menuSectionDrop.label}-action-${d}`,action:u,appearance:e.appearance,"action-options":e.actionOptions},null,8,["action","appearance","action-options"]))),128))]),_:1})):le("",!0)]),_:1},8,["title","drop-id","toggle"])])}}}),TP=ge({name:"ContextActionMenu",components:{ActionMenuDropItem:mg,ActionMenuItem:ia},props:{menuSections:{type:Array,required:!0},appearance:{type:String,default:"raw"},actionOptions:{type:Object,required:!0}},methods:{getSectionClasses(e){const t=[];return this.menuSections.length&&(e<this.menuSections.length-1&&t.push("pb-2"),e>0&&t.push("pt-2"),e<this.menuSections.length-1&&t.push("border-b")),t}}}),kP={id:"oc-files-context-menu"};function CP(e,t,n,r,o,s){const i=oe("action-menu-item"),l=oe("action-menu-drop-item"),u=oe("oc-list");return I(),G("div",kP,[(I(!0),G(Ae,null,Ye(e.menuSections,(d,c)=>(I(),re(u,{id:`oc-files-context-actions-${d.name}`,key:`section-${d.name}-list`,class:R.normalizeClass(["[&_li]:px-0",e.getSectionClasses(c)])},{default:Z(()=>[d.items?(I(!0),G(Ae,{key:0},Ye(d.items,(p,f)=>(I(),re(i,{key:`section-${d.name}-action-${f}`,action:p,appearance:e.appearance,"action-options":e.actionOptions,class:"context-menu"},null,8,["action","appearance","action-options"]))),128)):le("",!0),(I(!0),G(Ae,null,Ye(d.dropItems,p=>(I(),G(Ae,null,[p.items.length?(I(),re(l,{key:p.name,"menu-section-drop":p,appearance:e.appearance,"action-options":e.actionOptions},null,8,["menu-section-drop","appearance","action-options"])):le("",!0)],64))),256))]),_:2},1032,["id","class"]))),128))])}const aa=Le(TP,[["render",CP]]),xP=ge({name:"ContextActions",components:{ContextActionMenu:aa},props:{actionOptions:{type:Object,required:!0}},setup(e){const{getAllOpenWithActions:t}=An(),{$gettext:n}=me.useGettext(),{actions:r}=Pm(),{actions:o}=ea(),{actions:s}=ra(),{actions:i}=Oi(),{actions:l}=Kl(),{actions:u}=Yi(),{actions:d}=Ts(),{actions:c}=Zi(),{actions:p}=xo(),{actions:f}=Tc(),{actions:h}=ta(),{actions:g}=Om(),{actions:m}=na(),{actions:w}=ks(),{actions:T}=Nm(),{actions:k}=Cc(),{actions:S}=wc(),{actions:y}=xc(),E=ho(),D=A(()=>E.requestExtensions({id:"global.files.context-actions",extensionType:"action"}).map(j=>j.action)),$=A(()=>E.requestExtensions({id:"global.files.batch-actions",extensionType:"action"}).map(j=>j.action)),_=wv(e,"actionOptions"),L=A(()=>[...a(o),...a(u),...a(c),...a(h),...a(i),...a(d),...a(w),...a(S),...a($).filter(j=>j.category==="actions"||rt.isNil(j.category))].filter(j=>j.isVisible(a(_)))),V=A(()=>[...a(k),...a($).filter(j=>j.category==="sidebar")].filter(j=>j.isVisible(a(_)))),te=A(()=>a(r).filter(j=>j.isVisible(a(_))).sort((j,H)=>Number(H.hasPriority)-Number(j.hasPriority))),B=A(()=>t({...a(_),omitSystemActions:!0}).filter(j=>j.isVisible(a(_))).sort((j,H)=>Number(H.hasPriority)-Number(j.hasPriority))),O=A(()=>[...a(y),...a(l),...a(D).filter(j=>j.category==="share")].filter(j=>j.isVisible(a(_)))),M=A(()=>[...a(c),...a(p),...a(d),...a(h),...a(i),...a(g),...a(m),...a(S),...a(w),...a(o),...a(u),...a(s),...a(T),...a(D).filter(j=>j.category==="actions"||rt.isNil(j.category))].filter(j=>j.isVisible(a(_)))),N=A(()=>[...a(f).map(j=>(j.keepOpen=!0,j)),...a(k),...a(D).filter(j=>j.category==="sidebar")].filter(j=>j.isVisible(a(_))));return{menuSections:A(()=>{const j=[];return a(_).resources.length>1?(a(L).length&&j.push({name:"batch-actions",items:[...a(L)]}),j.push({name:"batch-details",items:[...a(V)]}),j):([...a(te),...a(B)].length&&j.push({name:"context",items:[...a(te)],dropItems:[{label:n("Open with..."),name:"open-with",icon:"apps",items:[...a(B)]}]}),a(O).length&&j.push({name:"share",items:a(O)}),a(M).length&&j.push({name:"actions",items:a(M)}),a(N).length&&j.push({name:"sidebar",items:a(N)}),j)})}}});function AP(e,t,n,r,o,s){const i=oe("context-action-menu");return I(),re(i,{"menu-sections":e.menuSections,"action-options":e.actionOptions},null,8,["menu-sections","action-options"])}const gg=Le(xP,[["render",AP]]),EP={class:"flex items-center"},RP={class:"flex justify-between w-full"},DP={class:"flex items-center"},PP=["textContent"],IP={key:0,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},FP={key:1,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},$P={key:2,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},OP={key:3,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},LP={key:4,class:"mt-2 mb-4 last:mb-0 [&>*]:flex [&>*]:justify-between"},_P={key:5,class:"mt-2 mb-4 last:mb-0 flex justify-between items-center [&>*]:flex [&>*]:justify-between"},MP=["textContent"],NP=["max"],vg=Le(ge({__name:"ViewOptions",props:{perPageStoragePrefix:{},hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},paginationOptions:{default:()=>Ao.options},perPageQueryName:{default:()=>Ao.perPageQueryName},perPageDefault:{default:()=>Ao.perPageDefault},viewModeDefault:{default:()=>Ft.defaultModeName},viewModes:{default:()=>[]}},setup(e){const t=Re(),n=St(),{$gettext:r}=me.useGettext(),o=_t(),{isSideBarOpen:s}=we.storeToRefs(o),i=De(),{setAreHiddenFilesShown:l,setAreFileExtensionsShown:u,setAreDisabledSpacesShown:d,setAreEmptyTrashesShown:c}=i,{areHiddenFilesShown:p,areFileExtensionsShown:f,areDisabledSpacesShown:h,areEmptyTrashesShown:g}=we.storeToRefs(i),m=W(!1),w=xn(st,"files-spaces-projects"),T=xn(qt,"files-trash-overview"),k=Pt("page"),S=A(()=>a(k)?parseInt(at(a(k))):1),y=nr({name:e.perPageQueryName,defaultValue:e.perPageDefault,storagePrefix:e.perPageStoragePrefix}),E=nr({name:Ft.queryName,defaultValue:e.viewModeDefault}),D=nr({name:Ft.tilesSizeQueryName,defaultValue:Ft.tilesSizeDefault.toString()}),$=H=>t.replace({query:{...a(n).query,[e.perPageQueryName]:H.toString(),...a(S)>1&&{page:"1"}}}),_=H=>{E.value=H.name};Ue([y,E,D],H=>{m.value=H.some(se=>!se)},{immediate:!0,deep:!0});const L=Ec(),V=A({get(){return a(p)},set(H){l(H)}}),te=A({get(){return a(f)},set(H){u(H)}}),B=A({get(){return a(h)},set(H){d(H)}}),O=A({get(){return a(g)},set(H){c(H)}}),M=H=>{V.value=H},N=H=>{te.value=H},q=H=>{B.value=H},j=H=>{O.value=H};return(H,se)=>{const Y=oe("oc-icon"),ae=oe("oc-button"),ne=oe("oc-list"),pe=oe("oc-drop"),fe=oe("oc-switch"),be=oe("oc-page-size"),xe=Lt("oc-tooltip");return I(),G("div",EP,[e.viewModes.length?(I(),G(Ae,{key:0},[je((I(),re(ae,{id:"mobile-viewmode-switch-toggle","aria-label":a(r)("Switch view mode"),appearance:"raw",class:R.normalizeClass(["my-2 mx-1 p-1 align-middle",{"sm:hidden":!a(s),"md:hidden":a(s)}])},{default:Z(()=>[J(Y,{name:"list-view","fill-type":"none"})]),_:1},8,["aria-label","class"])),[[xe,a(r)("Switch view mode")]]),J(pe,{title:a(r)("View mode"),"drop-id":"mobile-viewmode-switch-drop",toggle:"#mobile-viewmode-switch-toggle",class:"w-auto","padding-size":"medium","close-on-click":""},{default:Z(()=>[J(ne,null,{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.viewModes,he=>(I(),G("li",{key:he.name},[J(ae,{appearance:a(E)===he.name?"filled":"raw","color-role":a(E)===he.name?"secondaryContainer":"secondary","justify-content":"left",onClick:ie=>_(he)},{default:Z(()=>[Q("div",RP,[Q("span",DP,[J(Y,{name:he.icon.name,"fill-type":he.icon.fillType,size:"medium",class:"mr-1"},null,8,["name","fill-type"]),Q("span",{textContent:R.toDisplayString(he.label)},null,8,PP)]),a(E)===he.name?(I(),re(Y,{key:0,name:"check",size:"medium"})):le("",!0)])]),_:2},1032,["appearance","color-role","onClick"])]))),128))]),_:1})]),_:1},8,["title"])],64)):le("",!0),e.viewModes.length>1?(I(),G("div",{key:1,class:R.normalizeClass(["viewmode-switch-buttons oc-button-group hidden mr-2",{"sm:inline-flex":!a(s),"md:inline-flex":a(s)}])},[(I(!0),G(Ae,null,Ye(e.viewModes,he=>je((I(),re(ae,{key:he.name,"no-hover":a(E)===he.name,class:R.normalizeClass([he.name]),appearance:a(E)===he.name?"filled":"outline","color-role":a(E)===he.name?"secondaryContainer":"secondary","aria-label":a(r)("Switch to %{viewMode}",{viewMode:he.label}),onClick:ie=>_(he)},{default:Z(()=>[J(Y,{name:he.icon.name,"fill-type":he.icon.fillType,size:"small"},null,8,["name","fill-type"])]),_:2},1032,["no-hover","class","appearance","color-role","aria-label","onClick"])),[[xe,a(r)("Switch to %{viewMode}",{viewMode:he.label})]])),128))],2)):le("",!0),je((I(),re(ae,{id:"files-view-options-btn",key:"files-view-options-btn","data-testid":"files-view-options-btn","aria-label":a(r)("Display customization options of the files list"),appearance:"raw",class:"my-2 mx-1 p-1 align-middle"},{default:Z(()=>[J(Y,{name:"settings-3","fill-type":"line"})]),_:1},8,["aria-label"])),[[xe,a(r)("Display customization options of the files list")]]),J(pe,{title:a(r)("View options"),"drop-id":"files-view-options-drop",toggle:"#files-view-options-btn",mode:"click",class:"w-auto","padding-size":"medium"},{default:Z(()=>[J(ne,null,{default:Z(()=>[e.hasHiddenFiles?(I(),G("li",IP,[J(fe,{checked:V.value,"onUpdate:checked":[se[0]||(se[0]=he=>V.value=he),M],"data-testid":"files-switch-hidden-files",label:a(r)("Show hidden files")},null,8,["checked","label"])])):le("",!0),e.hasFileExtensions?(I(),G("li",FP,[J(fe,{checked:te.value,"onUpdate:checked":[se[1]||(se[1]=he=>te.value=he),N],"data-testid":"files-switch-files-extensions-files",label:a(r)("Show file extensions")},null,8,["checked","label"])])):le("",!0),e.hasPagination?(I(),G("li",$P,[m.value?le("",!0):(I(),re(be,{key:0,selected:a(at)(a(y)),"data-testid":"files-pagination-size",label:a(r)("Items per page"),options:e.paginationOptions,class:"files-pagination-size",onChange:$},null,8,["selected","label","options"]))])):le("",!0),a(w)?(I(),G("li",OP,[J(fe,{checked:B.value,"onUpdate:checked":[se[2]||(se[2]=he=>B.value=he),q],"data-testid":"files-switch-projects-show-disabled",label:a(r)("Show disabled Spaces")},null,8,["checked","label"])])):le("",!0),a(T)?(I(),G("li",LP,[J(fe,{checked:O.value,"onUpdate:checked":[se[3]||(se[3]=he=>O.value=he),j],"data-testid":"files-switch-projects-show-disabled",label:a(r)("Show empty trash bins")},null,8,["checked","label"])])):le("",!0),a(E)===a(Ft).name.tiles?(I(),G("li",_P,[Q("label",{for:"tiles-size-slider",textContent:R.toDisplayString(a(r)("Tile size"))},null,8,MP),je(Q("input",{id:"tiles-size-slider","onUpdate:modelValue":se[4]||(se[4]=he=>ft(D)?D.value=he:null),type:"range",min:1,max:a(L),class:"oc-range bg-role-surface-container-high rounded-sm outline-0 w-full max-w-[50%] h-1.5 hover:opacity-100 appearance-none","data-testid":"files-tiles-size-slider"},null,8,NP),[[Ua,a(D)]])])):le("",!0)]),_:1})]),_:1},8,["title"])])}}}),[["__scopeId","data-v-17fa8a66"]]),BP=ge({name:"AppBar",components:{BatchActions:hg,ContextActions:gg,ViewOptions:vg},props:{viewModeDefault:{type:String,required:!1,default:()=>Ft.defaultModeName},breadcrumbs:{type:Array,default:()=>[]},breadcrumbsContextActionsItems:{type:Array,default:()=>[]},viewModes:{type:Array,default:()=>[]},hasBulkActions:{type:Boolean,default:!1},hasViewOptions:{type:Boolean,default:!0},hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},showActionsOnSelection:{type:Boolean,default:!1},batchActionsLoading:{type:Boolean,default:!1},space:{type:Object,required:!1,default:null}},setup(e,{emit:t}){const n=He(),{$gettext:r}=me.useGettext(),{can:o}=Bt(),s=Re(),{requestExtensions:i}=ho(),{isSticky:l}=Ac(),u=_t(),{isSideBarOpen:d}=we.storeToRefs(u),c=De(),{selectedResources:p}=we.storeToRefs(c),f=A(()=>e.space),{actions:h}=ea(),{actions:g}=ra(),{actions:m}=Oi(),{actions:w}=Wm(),{actions:T}=Yi(),{actions:k}=Ts(),{actions:S}=Zi(),{actions:y}=xo(),{actions:E}=ta(),{actions:D}=ks(),{actions:$}=qm(),{actions:_}=Hm(),{actions:L}=Gm(),{actions:V}=Ym(),te=W(0),B=xn(bt,"files-common-search"),O=A(()=>Object.hasOwn(Ou(),"navigation")&&o("create-all","Share")),M=A(()=>{let fe=[...a(g),...a(h),...a(T),...a(S),...a(y),...a(E),...a(m),...a(k),...a(D)];B.value||(fe=[...fe,...a(w),...a(L),...a(V),...a($),...a(_)]);const be=i({id:"global.files.batch-actions",extensionType:"action"});return be.length&&(fe=[...fe,...be.map(xe=>xe.action)]),fe.filter(xe=>xe.isVisible({space:a(f),resources:c.selectedResources}))}),N=A(()=>n.spaces.filter(fe=>z.isPersonalSpaceResource(fe)||z.isProjectSpaceResource(fe))),q=Jn("isMobileWidth"),j=xn(qt,"files-trash-generic"),H=A(()=>!a(q)&&e.breadcrumbs.length?!0:a(j)&&a(N).length===1?!1:e.breadcrumbs.length>1),se=A(()=>a(j)&&a(N).length===1?e.breadcrumbs.length<=2:e.breadcrumbs.length<=1),Y=A(()=>a(f)&&(z.isProjectSpaceResource(a(f))||z.isShareSpaceResource(a(f)))?3:2),ae=fe=>{t(of,fe)},ne=nh("title"),pe=A(()=>a(ne)?r(a(ne)):a(f)?.name||"");return{router:s,hasSharesNavigation:O,batchActions:M,showBreadcrumb:H,showMobileNav:se,breadcrumbMaxWidth:te,breadcrumbTruncationOffset:Y,fileDroppedBreadcrumb:ae,pageTitle:pe,selectedResources:p,isSticky:l,isSideBarOpen:d}},data:function(){return{resizeObserver:new ResizeObserver(this.onResize),limitedScreenSpace:!1}},computed:{showContextActions(){return qc(this.breadcrumbs).allowContextActions},showBatchActions(){return this.hasBulkActions&&(this.selectedResources.length>=1||qt(this.router,"files-trash-generic"))},selectedResourcesAnnouncement(){return this.selectedResources.length===0?this.$gettext("No items selected."):this.$ngettext("%{ amount } item selected. Actions are available above the table.","%{ amount } items selected. Actions are available above the table.",this.selectedResources.length,{amount:this.selectedResources.length.toString()})}},mounted(){this.resizeObserver.observe(this.$refs.filesAppBar),window.addEventListener("resize",this.onResize)},beforeUnmount(){this.resizeObserver.unobserve(this.$refs.filesAppBar),window.removeEventListener("resize",this.onResize)},methods:{onResize(){const e=document.getElementById("web-content-main")?.getBoundingClientRect().width||0,t=document.getElementById("web-nav-sidebar")?.getBoundingClientRect().width||0,n=document.getElementById("app-sidebar")?.getBoundingClientRect().width||0,r=document.getElementById("files-app-bar-controls-right")?.clientWidth;this.breadcrumbMaxWidth=e-t-n-r,this.limitedScreenSpace=this.isSideBarOpen?window.innerWidth<=1280:window.innerWidth<=1e3}}}),jP={class:"files-topbar py-2 w-full"},zP=["textContent"],UP={key:3,id:"files-app-bar-controls-right",class:"flex"},VP={class:"files-app-bar-actions flex items-center justify-end mt-1 min-h-10 gap-2"},qP={class:"flex-1 flex justify-start items-center"},HP={key:1};function WP(e,t,n,r,o,s){const i=oe("oc-hidden-announcer"),l=oe("context-actions"),u=oe("oc-breadcrumb"),d=oe("portal-target"),c=oe("view-options"),p=oe("batch-actions"),f=oe("oc-spinner");return I(),G("div",{id:"files-app-bar",ref:"filesAppBar",class:R.normalizeClass(["px-4 bg-role-surface rounded-t-xl [display:inherit] top-0 z-20",{"files-app-bar-squashed":e.isSideBarOpen,sticky:e.isSticky}])},[Q("div",jP,[Q("h1",{class:"sr-only",textContent:R.toDisplayString(e.pageTitle)},null,8,zP),J(i,{announcement:e.selectedResourcesAnnouncement,level:"polite"},null,8,["announcement"]),Q("div",{class:R.normalizeClass(["flex items-center files-app-bar-controls min-h-13",{"justify-between":e.breadcrumbs.length||e.hasSharesNavigation,"justify-end":!e.breadcrumbs.length&&!e.hasSharesNavigation}])},[e.showBreadcrumb?(I(),re(u,{key:0,id:"files-breadcrumb","context-menu-padding":"small","show-context-actions":e.showContextActions,items:e.breadcrumbs,"max-width":e.breadcrumbMaxWidth,"truncation-offset":e.breadcrumbTruncationOffset,"mobile-breakpoint":e.isSideBarOpen?"md":"sm",onItemDroppedBreadcrumb:e.fileDroppedBreadcrumb},{contextMenu:Z(()=>[J(l,{"action-options":{space:e.space,resources:e.breadcrumbsContextActionsItems.filter(Boolean)}},null,8,["action-options"])]),_:1},8,["show-context-actions","items","max-width","truncation-offset","mobile-breakpoint","onItemDroppedBreadcrumb"])):le("",!0),e.showMobileNav?(I(),re(d,{key:1,name:"app.runtime.mobile.nav"})):le("",!0),e.hasSharesNavigation?Ce(e.$slots,"navigation",{key:2}):le("",!0),e.hasViewOptions?(I(),G("div",UP,[J(c,{"view-modes":e.viewModes,"has-hidden-files":e.hasHiddenFiles,"has-file-extensions":e.hasFileExtensions,"has-pagination":e.hasPagination,"per-page-storage-prefix":"files","view-mode-default":e.viewModeDefault},null,8,["view-modes","has-hidden-files","has-file-extensions","has-pagination","view-mode-default"])])):le("",!0)],2),Q("div",VP,[Q("div",qP,[Ce(e.$slots,"actions",{limitedScreenSpace:e.limitedScreenSpace}),e.showBatchActions&&!e.batchActionsLoading?(I(),re(p,{key:0,actions:e.batchActions,"action-options":{space:e.space,resources:e.selectedResources},"limited-screen-space":e.limitedScreenSpace},null,8,["actions","action-options","limited-screen-space"])):e.showBatchActions&&e.batchActionsLoading?(I(),G("div",HP,[J(f,{"aria-label":e.$gettext("Loading actions")},null,8,["aria-label"])])):le("",!0)])]),Ce(e.$slots,"content")])],2)}const QP=Le(BP,[["render",WP]]),KP=ge({name:"CreateSpace",props:{showLabel:{type:Boolean,default:!0}},emits:["spaceCreated"],setup(e,{emit:t}){const{showMessage:n,showErrorMessage:r}=Me(),{$gettext:o}=me.useGettext(),{createSpace:s}=go(),{isSpaceNameValid:i}=Qr(),{dispatchModal:l}=Je(),u=He(),{upsertResource:d}=De(),c=async f=>{try{const h=await s(f);d(h),u.upsertSpace(h),t("spaceCreated",h),n({title:o("Space was created successfully")})}catch(h){console.error(h),r({title:o("Creating space failed…"),errors:[h]})}};return{showCreateSpaceModal:()=>{l({title:o("Create a new space"),confirmText:o("Create"),hasInput:!0,inputLabel:o("Space name"),inputValue:o("New space"),inputRequiredMark:!0,onConfirm:f=>c(f),onInput:(f,h)=>{const{isValid:g,error:m}=i(f);h(g?null:m)}})}}}}),GP=["textContent"];function JP(e,t,n,r,o,s){const i=oe("oc-icon"),l=oe("oc-button"),u=Lt("oc-tooltip");return je((I(),re(l,{id:"new-space-menu-btn","aria-label":e.showLabel?void 0:e.$gettext("New space"),appearance:"filled",onClick:e.showCreateSpaceModal},{default:Z(()=>[J(i,{name:"add"}),e.showLabel?(I(),G("span",{key:0,textContent:R.toDisplayString(e.$gettext("New Space"))},null,8,GP)):le("",!0)]),_:1},8,["aria-label","onClick"])),[[u,e.showLabel?void 0:e.$gettext("New space")]])}const XP=Le(KP,[["render",JP]]),YP={class:"oc-app-top-bar self-center flex col-[1/4] row-2 sm:col-2 sm:row-1 [&_.parent-folder]:text-role-on-chrome"},ZP={class:"pl-4 pr-1 my-2 mx-auto sm:m-0 inline-flex items-center justify-between bg-role-chrome border border-role-on-chrome rounded-lg h-10 gap-4 w-full sm:w-fit"},eI={class:"open-file-bar flex"},tI={class:"flex"},nI={key:1,class:"flex items-center","data-testid":"autosave-indicator"},yg=ge({__name:"AppTopBar",props:{dropDownMenuSections:{default:()=>[]},dropDownActionOptions:{default:()=>({space:null,resources:[]})},mainActions:{default:()=>[]},hasAutoSave:{type:Boolean,default:!0},isEditor:{type:Boolean,default:!1},resource:{default:null},isReadOnly:{type:Boolean,default:!0}},emits:["close"],setup(e){const{$gettext:t,current:n}=me.useGettext(),r=De(),o=Ge(),{getMatchingSpace:s}=It(),{getParentFolderName:i,getPathPrefix:l,getParentFolderLinkIconAdditionalAttributes:u}=Cr(),d=A(()=>r.areFileExtensionsShown),c=A(()=>t("Show context menu")),p=A(()=>e.isEditor&&e.hasAutoSave&&o.options.editor.autosaveEnabled),f=A(()=>{const m=vt.Duration.fromObject({seconds:o.options.editor.autosaveInterval},{locale:n});return t("Autosave (every %{ duration })",{duration:m.toHuman()})}),h=A(()=>s(e.resource)),g=A(()=>!z.isPublicSpaceResource(a(h)));return(m,w)=>{const T=oe("oc-icon"),k=oe("oc-button"),S=oe("oc-drop"),y=oe("portal"),E=Lt("oc-tooltip");return I(),re(y,{to:"app.runtime.header.left"},{default:Z(()=>[Q("div",YP,[Q("div",ZP,[Q("div",eI,[e.resource?(I(),re(Ss,{key:0,id:"app-top-bar-resource",class:"[&_.oc-resource-name]:max-w-60 xs:[&_.oc-resource-name]:max-w-full sm:[&_.oc-resource-name]:max-w-20 md:[&_.oc-resource-name]:max-w-60 [&_svg]:!fill-role-on-chrome [&_span]:text-role-on-chrome","is-thumbnail-displayed":!1,"is-extension-displayed":d.value,"path-prefix":a(l)(e.resource),resource:e.resource,"parent-folder-name":a(i)(e.resource),"parent-folder-link-icon-additional-attributes":a(u)(e.resource),"is-path-displayed":g.value,"is-resource-clickable":!1},null,8,["is-extension-displayed","path-prefix","resource","parent-folder-name","parent-folder-link-icon-additional-attributes","is-path-displayed"])):le("",!0)]),Q("div",tI,[e.dropDownMenuSections.length?(I(),G(Ae,{key:0},[je((I(),re(k,{id:"oc-openfile-contextmenu-trigger","aria-label":c.value,appearance:"raw-inverse","color-role":"chrome",class:"p-1"},{default:Z(()=>[J(T,{name:"more-2"})]),_:1},8,["aria-label"])),[[E,c.value]]),J(S,{"drop-id":"oc-openfile-contextmenu",mode:"click","padding-size":"small",toggle:"#oc-openfile-contextmenu-trigger","close-on-click":"",title:e.resource.name,onClick:w[0]||(w[0]=wt(()=>{},["stop","prevent"]))},{default:Z(()=>[J(aa,{"menu-sections":e.dropDownMenuSections,"action-options":e.dropDownActionOptions},null,8,["menu-sections","action-options"])]),_:1},8,["title"])],64)):le("",!0),p.value&&!e.isReadOnly?(I(),G("span",nI,[je(J(T,{"accessible-label":f.value,name:"refresh",color:"white",class:"ox-p-xs mx-1"},null,8,["accessible-label"]),[[E,f.value]])])):le("",!0),e.mainActions.length&&e.resource?(I(),re(aa,{key:2,"menu-sections":[{name:"main-actions",items:e.mainActions.filter(D=>D.isVisible()).map(D=>({...D,class:"p-1 text-role-on-chrome [&_svg]:!fill-role-on-chrome [&:hover:not(:disabled)_svg]:!fill-role-chrome",hideLabel:!0}))}],"action-options":{resources:[e.resource]},appearance:"raw-inverse","color-role":"chrome"},null,8,["menu-sections","action-options"])):le("",!0),J(k,{id:"app-top-bar-close",appearance:"raw-inverse","color-role":"chrome",class:"p-1","aria-label":a(t)("Close"),onClick:w[1]||(w[1]=D=>m.$emit("close"))},{default:Z(()=>[J(T,{name:"close"})]),_:1},8,["aria-label"])])])])]),_:1})}}}),rI=ge({name:"ErrorScreen",props:{message:{default:"",type:String,required:!1}}}),oI={class:"text-center flex justify-center items-center h-full"},sI={key:0,class:"text-xl"};function iI(e,t,n,r,o,s){const i=oe("oc-icon");return I(),G("div",oI,[J(i,{size:"xxlarge",name:"error-warning","fill-type":"line"}),e.message?(I(),G("p",sI,R.toDisplayString(e.message),1)):le("",!0)])}const aI=Le(rI,[["render",iI]]),lI=ge({name:"LoadingScreen"}),cI={class:"text-center flex justify-center items-center h-full"},uI=["textContent"];function dI(e,t,n,r,o,s){const i=oe("oc-spinner");return I(),G("div",cI,[J(i,{size:"xlarge"}),Q("p",{class:"sr-only",textContent:R.toDisplayString(e.$gettext("Loading app"))},null,8,uI)])}const fI=Le(lI,[["render",dI]]),pI=["id","data-testid","tabindex","inert"],hI={key:0,class:"sidebar-panel__header header grid grid-cols-[auto_1fr_auto] items-center pt-2 px-2"},mI={class:"col-start-2 text-center my-0 text-lg"},gI={key:0,class:"mt-4"},bg=Le(ge({__name:"SideBarPanels",props:{loading:{type:Boolean},availablePanels:{},panelContext:{},activePanel:{default:""}},emits:["selectPanel","close","closePanel"],setup(e,{emit:t}){const n=t,{$gettext:r}=me.useGettext(),o=A(()=>e.availablePanels.filter(S=>S.isVisible(e.panelContext)&&S.isRoot?.(e.panelContext))),s=A(()=>e.availablePanels.filter(S=>S.isVisible(e.panelContext)&&!S.isRoot?.(e.panelContext))),i=A(()=>a(o).length?[a(o)[0],...a(s)]:a(s)),l=A(()=>{const S=e.activePanel?.split("#")[0];return!S||!a(s).map(y=>y.name).includes(S)?null:S}),u=A(()=>a(l)!==null),d=A(()=>a(l)===null),c=W(null),p=S=>{c.value=S},f=A(()=>a(u)?a(l):a(o)[0].name),h=A(()=>a(o).length===1?r("Back to %{panel} panel",{panel:a(o)[0].title(e.panelContext)}):r("Back to main panels")),g=S=>{n("selectPanel",S)},m=()=>{n("selectPanel",null)},w=()=>{n("close")},T=S=>{p(a(f)),g(S)},k=()=>{p(a(f)),m(),n("closePanel")};return(S,y)=>{const E=oe("oc-spinner"),D=oe("oc-icon"),$=oe("oc-button"),_=Lt("oc-tooltip");return e.loading?(I(),re(E,{key:0,"aria-label":a(r)("Loading sidebar content")},null,8,["aria-label"])):(I(!0),G(Ae,{key:1},Ye(i.value,L=>(I(),G("div",{id:`sidebar-panel-${L.name}`,key:`panel-${L.name}`,"data-testid":`sidebar-panel-${L.name}`,tabindex:f.value===L.name?-1:null,class:R.normalizeClass(["sidebar-panel absolute top-0 grid grid-rows-[auto_auto_1fr] bg-role-surface w-full size-full max-w-full max-h-full motion-reduce:transition-none",{"is-root-panel transition-[right] duration-[0.4s,0s]":L.isRoot?.(e.panelContext),"is-active-sub-panel":u.value&&l.value===L.name,"is-active-root-panel transition-[right] duration-[0.4s,0s]":d.value&&L.isRoot?.(e.panelContext)}]),inert:f.value!==L.name},[[f.value,c.value].includes(L.name)?(I(),G("div",hI,[L.isRoot?.(e.panelContext)?le("",!0):je((I(),re($,{key:0,class:"header__back col-start-1 p-1",appearance:"raw","aria-label":h.value,onClick:k},{default:Z(()=>[J(D,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"])),[[_,h.value]]),Q("h2",mI,R.toDisplayString(L.title(e.panelContext)),1),J($,{appearance:"raw",class:"header__close col-start-3 p-1","aria-label":a(r)("Close file sidebar"),onClick:w},{default:Z(()=>[J(D,{name:"close"})]),_:1},8,["aria-label"])])):le("",!0),Q("div",null,[L.isRoot?.(e.panelContext)?Ce(S.$slots,"rootHeader",{key:0},void 0,!0):Ce(S.$slots,"subHeader",{key:1},void 0,!0)]),Q("div",{class:R.normalizeClass(["sidebar-panel__body flex flex-col p-2 overflow-y-auto overflow-x-hidden",[`sidebar-panel__body-${L.name}`]])},[Q("div",{class:R.normalizeClass(["sidebar-panel__body-content",{"flex-1 ":!L.isRoot?.(e.panelContext)}])},[Ce(S.$slots,"body",{},()=>[(I(!0),G(Ae,null,Ye(L.isRoot?.(e.panelContext)?o.value:[L],(V,te)=>(I(),G("div",{key:`sidebar-panel-${V.name}`},[(d.value?V.isRoot?.(e.panelContext):[f.value,c.value].includes(V.name))?(I(),re(rn(V.component),pt({key:0,class:[{"multi-root-panel-separator mt-4 pt-2 border-t":te>0},"rounded-sm"]},{ref_for:!0},V.componentAttrs?.(e.panelContext)||{}),null,16,["class"])):le("",!0)]))),128))],!0)],2),L.isRoot?.(e.panelContext)&&s.value.length>0?(I(),G("div",gI,[(I(!0),G(Ae,null,Ye(s.value,V=>(I(),re($,{id:`sidebar-panel-${V.name}-select`,key:`panel-select-${V.name}`,"data-testid":`sidebar-panel-${V.name}-select`,appearance:"raw-inverse","color-role":"surface",class:"!grid !grid-cols-[auto_1fr_auto] text-left px-2 w-full h-12",onClick:te=>T(V.name)},{default:Z(()=>[J(D,{name:V.icon,"fill-type":V.iconFillType},null,8,["name","fill-type"]),ct(" "+R.toDisplayString(V.title(e.panelContext))+" ",1),J(D,{name:"arrow-right-s","fill-type":"line"})]),_:2},1032,["id","data-testid","onClick"]))),128))])):le("",!0)],2)],10,pI))),128))}}}),[["__scopeId","data-v-839c4e7a"]]),wg=ge({inheritAttrs:!1,__name:"SideBar",props:{loading:{type:Boolean},availablePanels:{},panelContext:{}},emits:["selectPanel","close"],setup(e,{emit:t}){const n=t,r=Js(),{isMobile:o}=os(),s=_t(),{focusSidebar:i}=s,{sideBarActivePanel:l}=we.storeToRefs(s),u=A(()=>{if(a(o))return{...a(r),isFocusTrapActive:!e.loading,hasFullHeight:!0,maxHeight:"max-h-[80vh]",class:"z-100",onClicked:d};const f=["border-l","focus:outline-0","focus-visible:outline-0","w-[440px]","min-w-[440px]","overflow-hidden","relative","focus:shadow-none","focus-visible:shadow-none",...a(r)?.class?[a(r).class]:[]];return e.loading&&f.push("flex","justify-center","items-center"),{...a(r),class:f}}),d=f=>{if(!f.target)return;const h=f.target===f.currentTarget,g=f.target instanceof HTMLAnchorElement,m=f.target.closest("ul.sidebar-actions-panel");(h||g||m)&&c()},c=()=>{s.closeSideBar(),n("close")},p=f=>{s.openSideBarPanel(f),n("selectPanel",f)};return Qs(()=>{a(o)&&c()}),(f,h)=>(I(),re(Fa,{to:"#mobile-right-sidebar",disabled:!a(o)},[(I(),re(rn(a(o)?"oc-bottom-drawer":"div"),pt({id:"app-sidebar",tabindex:"-1"},u.value),{default:Z(()=>[J(bg,{loading:e.loading,"available-panels":e.availablePanels,"panel-context":e.panelContext,"active-panel":a(l),onSelectPanel:p,onClose:c,onClosePanel:a(i)},{body:Z(()=>[Ce(f.$slots,"body")]),rootHeader:Z(()=>[Ce(f.$slots,"rootHeader")]),subHeader:Z(()=>[Ce(f.$slots,"subHeader")]),_:3},8,["loading","available-panels","panel-context","active-panel","onClosePanel"])]),_:3},16))],8,["disabled"]))}}),vI={class:"grid items-center p-2"},yI={class:"flex items-center text-sm"},bI=["textContent"],wI=["textContent"],Oc=ge({__name:"SpaceInfo",setup(e){const t=Jn("resource");return(n,r)=>{const o=oe("oc-icon");return I(),G("div",vI,[Q("div",yI,[J(o,{name:"layout-grid",size:a(t).description?"large":"medium",class:"block mr-2"},null,8,["size"]),Q("div",null,[Q("h3",{"data-testid":"space-info-name",class:"font-semibold m-0 text-base break-all",textContent:R.toDisplayString(a(t).name)},null,8,bI),Q("span",{"data-testid":"space-info-subtitle",textContent:R.toDisplayString(a(t).description)},null,8,wI)])])])}}}),SI={class:"flex justify-between p-2"},TI={class:"flex items-center"},kI={"data-testid":"files-info-name",class:"font-semibold m-0 text-base break-all"},Lc=ge({__name:"FileInfo",props:{isSubPanelActive:{type:Boolean,default:!0}},setup(e){const t=De(),{isPersonalSpaceRoot:n}=It(),r=Jn("resource"),o=Jn("space"),s=A(()=>t.areFileExtensionsShown),i=A(()=>n(a(r))?a(o).name:a(r).name);return(l,u)=>(I(),G("div",SI,[Q("div",TI,[e.isSubPanelActive?(I(),re(ws,{key:0,resource:a(r),size:"large",class:"mr-2 relative"},null,8,["resource"])):le("",!0),Q("div",null,[Q("h3",kI,[J(bc,{name:i.value,extension:a(r).extension,type:a(r).type,"full-path":a(r).webDavPath,"is-extension-displayed":s.value,"is-path-displayed":!1,"truncate-name":!1,class:"[&_span]:break-all"},null,8,["name","extension","type","full-path","is-extension-displayed"])])])])]))}}),Sg=ge({__name:"FileSideBar",props:{space:{default:()=>{}}},setup(e){const t=Re(),n=Pe(),r=ho(),o=He(),s=tr(),i=Ge(),l=Mn(),{canListShares:u}=Bm(),{canListVersions:d}=og(),c=De(),{currentFolder:p}=we.storeToRefs(c),f=_t(),{isSideBarOpen:h,sideBarActivePanel:g}=we.storeToRefs(f),m=W(),w=W([]),T=W([]),k=W([]),{selectedResources:S}=Ic(),y=W(!1),E=A(()=>a(y)),D=A(()=>a(S).length===0?{root:e.space,parent:null,items:a(p)?.id?[a(p)]:[]}:{root:e.space,parent:a(p),items:a(S)}),$=xn(mt,"files-shares-with-me"),_=xn(mt,"files-shares-with-others"),L=xn(mt,"files-shares-via-link"),V=st(t,"files-spaces-projects"),te=xn(bt,"files-common-favorites"),B=xn(bt,"files-common-search"),O=A(()=>a(D).items?.length===1&&!z.isProjectSpaceResource(a(D).items[0])),M=A(()=>a(D).items?.length===1&&z.isProjectSpaceResource(a(D).items[0])),N=A(()=>a($)||a(_)||a(L)),q=A(()=>a(N)||a(B)||a(te)),j=A(()=>r.requestExtensions({id:"global.files.sidebar",extensionType:"sidebarPanel"}).map(ne=>ne.panel)),H=$t.useTask(function*(ne,pe){w.value=yield n.webdav.listFileVersions(pe.id,{signal:ne})}),se=$t.useTask(function*(ne,pe){s.setLoading(!0),s.removeOrphanedShares();const{collaboratorShares:fe,linkShares:be}=s,xe=n.graphAuthenticated.permissions;let he=e.space?.id;if(z.isShareSpaceResource(e.space)){const ve=yield o.getMountPointForSpace({graphClient:n.graphAuthenticated,space:e.space,signal:ne});ve&&(he=ve.root.remoteItem.rootId)}const{shares:ie,allowedRoles:de}=yield*z.call(xe.listPermissions(he,pe.fileId,s.graphRoles,{},{signal:ne})),ue=ie.filter(z.isCollaboratorShare),Se=ie.filter(z.isLinkShare),$e=Object.values(s.graphRoles);if(T.value=de?.map(ve=>({...ve,icon:$e.find(ke=>ke.id===ve.id)?.icon}))||[],l.isAppEnabled("open-cloud-mesh")){const{allowedRoles:ve}=yield*z.call(xe.listPermissions(he,pe.fileId,s.graphRoles,{filter:`@libre.graph.permissions.roles.allowedValues/rolePermissions/any(p:contains(p/condition, '@Subject.UserType=="Federated"'))`,select:[Xp.LibreGraphPermissionsRolesAllowedValues]},{signal:ne}));k.value=ve?.map(ke=>({...ke,icon:$e.find(qe=>qe.id===ke.id)?.icon}))||[]}!a(q)&&!a(V)&&(fe.forEach(ve=>{ue.some(ke=>ke.id===ve.id)||ue.push({...ve,indirect:!0})}),be.forEach(ve=>{Se.some(ke=>ke.id===ve.id)||Se.push({...ve,indirect:!0})})),bt(t,"files-common-search")&&(yield c.loadAncestorMetaData({folder:a(pe),space:e.space,client:n.webdav,signal:ne}));const lt=[...fe,...be].map(({resourceId:ve})=>ve),Tt=Object.values(c.ancestorMetaData).filter(({id:ve,path:ke})=>ve===pe.id||lt.includes(ve)||z.isIncomingShareResource(pe)?!1:z.isPersonalSpaceResource(e.space)?ke!=="/":!0).map(({id:ve})=>ve);a(q)&&z.isProjectSpaceResource(e.space)&&!z.isProjectSpaceResource(pe)&&Tt.push(e.space.id);const ut=new ur({concurrency:i.options.concurrentRequests.shares.list}),gt=[...new Set(Tt)].map(ve=>ut.add(()=>n.graphAuthenticated.permissions.listPermissions(he,ve,s.graphRoles,{},{signal:ne}).then(ke=>{const qe=ke.shares.map(We=>({...We,indirect:!0}));ue.push(...qe.filter(z.isCollaboratorShare)),Se.push(...qe.filter(z.isLinkShare))})));yield Promise.allSettled(gt),s.setCollaboratorShares(ue),s.setLinkShares(Se),s.setLoading(!1)}).restartable(),Y=W();Ue(()=>[...a(D).items,h],async(ne,pe)=>{if(a(D).items?.length!==1)return;if(!a(h)){Y.value=void 0,w.value=[];return}const fe=ne?.[0],be=pe?.[0];if(fe?.id===be?.id&&fe?.mdate===a(Y))return;const xe=a(D).items[0];if(Y.value=xe.mdate,H.isRunning&&H.cancelAll(),!!d({space:e.space,resource:xe}))try{await H.perform(xe)}catch(he){console.error(he)}},{immediate:!0,deep:!0});const ae=A(()=>a(D).items.map(ne=>ne.id));return Ue(()=>[ae,h],async()=>{if(!a(h)||!a(D).items?.length){s.pruneShares(),m.value=null;return}if(a(D).items?.length!==1)return;const ne=a(D).items[0];if(y.value=!0,z.isProjectSpaceResource(ne)&&await o.loadGraphPermissions({ids:[ne.id],graphClient:n.graphAuthenticated}),u({space:e.space,resource:ne}))try{se.isRunning&&se.cancelAll(),se.perform(ne)}catch(pe){console.error(pe)}if(!z.isOutgoingShareResource(ne)&&!z.isIncomingShareResource(ne)){m.value=ne,y.value=!1;return}try{const pe=await n.webdav.getFileInfo(e.space,{path:ne.path}),fe={...pe,...ne,tags:pe.tags};m.value=fe}catch(pe){m.value=ne,console.error(pe)}y.value=!1},{deep:!0,immediate:!0}),Dr("resource",pr(m)),Dr("versions",pr(w)),Dr("space",A(()=>e.space)),Dr("availableInternalShareRoles",pr(T)),Dr("availableExternalShareRoles",pr(k)),Dr("versionsLoading",A(()=>H.isRunning)),Dr("activePanel",g),(ne,pe)=>a(h)?(I(),re(wg,pt({key:0,ref:"sidebar",class:"files-side-bar z-30","available-panels":j.value,"panel-context":D.value,loading:E.value},ne.$attrs,{"data-custom-key-bindings-disabled":"true"}),{rootHeader:Z(()=>[O.value?(I(),re(Lc,{key:0,class:"px-2 pt-2","is-sub-panel-active":!1})):M.value?(I(),re(Oc,{key:1})):le("",!0)]),subHeader:Z(()=>[O.value?(I(),re(Lc,{key:0,class:"px-2 pt-2","is-sub-panel-active":!0})):M.value?(I(),re(Oc,{key:1})):le("",!0)]),_:1},16,["available-panels","panel-context","loading"])):le("",!0)}}),CI=ge({name:"DatePickerModal",props:{modal:{type:Object,required:!0},currentDate:{type:Object,required:!1,default:null},minDate:{type:Object,required:!1,default:null},isClearable:{type:Boolean,default:!0}},emits:["confirm","cancel"],setup(){const e=Bn(),{currentTheme:t}=we.storeToRefs(e),n=W(),r=W(!0);return{confirmDisabled:r,onDateChanged:({date:s,error:i})=>{r.value=i||!s,n.value=s},currentTheme:t,dateTime:n}}}),xI={class:"flex justify-end items-center mt-2"};function AI(e,t,n,r,o,s){const i=oe("oc-datepicker"),l=oe("oc-button");return I(),G(Ae,null,[J(i,{label:e.$gettext("Expiration date"),type:"date","min-date":e.minDate,"current-date":e.currentDate,"is-clearable":e.isClearable,"is-dark":e.currentTheme.isDark,"required-mark":"",onDateChanged:e.onDateChanged},null,8,["label","min-date","current-date","is-clearable","is-dark","onDateChanged"]),Q("div",xI,[J(l,{class:"oc-modal-body-actions-cancel ml-2",onClick:t[0]||(t[0]=u=>e.$emit("cancel"))},{default:Z(()=>[ct(R.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),J(l,{disabled:e.confirmDisabled,class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:t[1]||(t[1]=u=>e.$emit("confirm",e.dateTime))},{default:Z(()=>[ct(R.toDisplayString(e.$gettext("Confirm")),1)]),_:1},8,["disabled"])])],64)}const EI=Le(CI,[["render",AI]]),RI=ge({name:"UnsavedChangesModal",props:{modal:{type:Object,required:!0},closeCallback:{type:Function,required:!0}},emits:["cancel","confirm"],setup(e){const{removeModal:t}=Je();return{onClose:()=>{t(e.modal.id),e.closeCallback()}}}}),DI=["textContent"],PI={class:"flex justify-end items-center mt-4"},II={class:"oc-modal-body-actions-grid"};function FI(e,t,n,r,o,s){const i=oe("oc-button");return I(),G(Ae,null,[Q("span",{class:"inline-block mb-4",textContent:R.toDisplayString(e.$gettext("Your changes were not saved. Do you want to save them?"))},null,8,DI),t[2]||(t[2]=Q("div",{class:"my-4"},null,-1)),Q("div",PI,[Q("div",II,[J(i,{class:"oc-modal-body-actions-cancel ml-2",onClick:t[0]||(t[0]=l=>e.$emit("cancel"))},{default:Z(()=>[ct(R.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),J(i,{class:"oc-modal-body-actions-secondary ml-2",onClick:e.onClose},{default:Z(()=>[ct(R.toDisplayString(e.$gettext("Don't Save")),1)]),_:1},8,["onClick"]),J(i,{class:"oc-modal-body-actions-confirm ml-2",appearance:"filled",onClick:t[1]||(t[1]=l=>e.$emit("confirm"))},{default:Z(()=>[ct(R.toDisplayString(e.$gettext("Save")),1)]),_:1})])])],64)}const Tg=Le(RI,[["render",FI]]);var $I=/\s/;function OI(e){for(var t=e.length;t--&&$I.test(e.charAt(t)););return t}var LI=/^\s+/;function _I(e){return e&&e.slice(0,OI(e)+1).replace(LI,"")}var kg=NaN,MI=/^[-+]0x[0-9a-f]+$/i,NI=/^0b[01]+$/i,BI=/^0o[0-7]+$/i,jI=parseInt;function zI(e){if(typeof e=="number")return e;if(bi(e))return kg;if($n(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=$n(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=_I(e);var n=NI.test(e);return n||BI.test(e)?jI(e.slice(2),n?2:8):MI.test(e)?kg:+e}const UI=["id"],VI=["textContent"],qI={key:3,class:"flex size-full"},Cg=ge({__name:"AppWrapper",props:{applicationId:{},urlForResourceOptions:{default:null},fileContentOptions:{default:null},wrappedComponent:{default:null},importResourceWithExtension:{type:Function,default:()=>null},disableAutoSave:{type:Boolean,default:!1}},setup(e){const{$gettext:t,current:n}=me.useGettext(),r=Mn(),{showMessage:o,showErrorMessage:s}=Me(),i=Ds.useRouter(),l=St(),u=Pe(),d=Ut(),{getResourceContext:c}=sg(),{selectedResources:p}=Ic(),{dispatchModal:f}=Je(),h=He(),g=Ge(),m=De(),w=tr(),T=rr(),{isMobile:k}=os(),S=_t(),{isSideBarOpen:y}=we.storeToRefs(S),{actions:E}=$m({appId:e.applicationId}),{actions:D}=Kl(),{actions:$}=xo(),{actions:_}=Cc(),{actions:L}=xc(),{actions:V}=Ts(),te=A(()=>!!e.wrappedComponent.emits?.includes("update:resource")),B=W(),O=W(),M=W(""),N=W(""),q=W(!a(te)),j=W(),H=W(!1),se=W(),Y=W();let ae="",ne=null;const{actions:pe}=_m({content:Y}),fe=A(()=>!!e.wrappedComponent.emits?.includes("update:currentContent")),be=Te=>!!Object.keys(e.wrappedComponent.props).includes(Te),xe=A(()=>a(Y)!==a(se)),he=Te=>{Te.preventDefault()};Ue(xe,Te=>{Te?window.addEventListener("beforeunload",he):window.removeEventListener("beforeunload",he)});const{applicationConfig:ie,closeApp:de,currentFileContext:ue,getFileContents:Se,getFileInfo:$e,getUrlForResource:Ve,putFileContents:lt,replaceInvalidFileRoute:Tt,revokeUrl:ut,activeFiles:gt,loadFolderForFileContext:ve,isFolderLoading:ke}=dh({applicationId:e.applicationId}),{applicationMeta:qe}=Wl({applicationId:e.applicationId,appsStore:r}),We=A(()=>a(qe).meta?.fileSizeLimit),Jt=A(()=>{const{name:Te}=a(qe);return t("%{appName} for %{fileName}",{appName:t(Te),fileName:a(a(ue).fileName)})}),Xt=Di("driveAliasAndItem"),kt=Pt("fileId"),dt=A(()=>at(a(kt))),mn=async()=>{const Te=a(dt),{space:Oe,path:tt}=await c(Te),Vt=Oe.getDriveAliasAndItem({path:tt});return z.isPersonalSpaceResource(Oe)?i.push({params:{...a(l).params,driveAliasAndItem:Vt},query:{...a(l).query,fileId:Te,contextRouteName:"files-spaces-generic",contextRouteParams:{driveAliasAndItem:Ke.dirname(Vt)}}}):i.push({params:{...a(l).params,driveAliasAndItem:Vt},query:{...a(l).query,fileId:Te,contextRouteName:tt==="/"?"files-shares-with-me":"files-spaces-generic",...z.isShareSpaceResource(Oe)&&{shareId:Oe.id},contextRouteParams:{driveAliasAndItem:Ke.dirname(Vt)},contextRouteQuery:{...z.isShareSpaceResource(Oe)&&{shareId:Oe.id}}}})},qn=$t.useTask(function*(Te){try{a(Xt)||(yield mn()),O.value=a(a(ue).space);const Oe=yield $e(a(ue),{signal:Te});if(B.value=Oe,z.isShareSpaceResource(a(O))&&(a(B).remoteItemId=a(O).id,a(B).id===a(B).remoteItemId)){const tt=yield*z.call(pi({graphClient:u.graphAuthenticated,spacesStore:h,space:a(O)}));tt&&(B.value={...Oe,...z.buildIncomingShareResource({graphRoles:w.graphRoles,driveItem:tt,serverUrl:g.serverUrl}),tags:Oe.tags})}m.initResourceList({currentFolder:null,resources:[a(B)]}),p.value=[a(B)]}catch(Oe){console.error(Oe),j.value=Oe,q.value=!1}}).restartable(),At=$t.useTask(function*(Te){try{const Oe=e.importResourceWithExtension(a(B));if(Oe){const tt=vt.DateTime.local().toFormat("yyyyMMddHHmmss"),Vt=`${a(B).name}_${tt}.${Oe}`;if(!(yield u.webdav.copyFiles(a(O),a(B),a(O),{path:Vt},{signal:Te})))throw new Error(t("Importing failed"));B.value={path:Vt}}if(Tt(ue,a(B)))return;if(H.value=![pf.Updateable,pf.FileUpdateable].some(tt=>(a(B).permissions||"").indexOf(tt)>-1),a(be("currentContent"))){const tt=yield*z.call(Se(ue,{...e.fileContentOptions,signal:Te}));se.value=Y.value=tt.body,M.value=tt.headers["OC-ETag"]}a(be("url"))&&(N.value=yield Ve(a(O),a(B),{...e.urlForResourceOptions,signal:Te}))}catch(Oe){console.error(Oe),j.value=Oe}finally{q.value=!1}}).restartable();Ue(ue,async()=>{a(te)?O.value=a(a(ue).space):(await qn.perform(),a(We)&&zI(a(B).size)>a(We)?f({title:t("File exceeds %{threshold}",{threshold:Ht(a(We),n)}),message:t("%{resource} exceeds the recommended size of %{threshold} for editing, and may cause performance issues.",{resource:a(B).name,threshold:Ht(a(We),n)}),confirmText:t("Continue"),onCancel:()=>{de()},onConfirm:()=>{At.perform()}}):At.perform())},{immediate:!0});const En=Te=>{console.error(Te),s({title:t("An error occurred"),desc:Te.message,errors:[Te]})},C=()=>{o({title:t("File autosaved")})},v=$t.useTask(function*(){const Te=a(Y);try{const Oe=yield lt(ue,{content:Te,previousEntityTag:a(M)});se.value=Te,M.value=Oe.etag,m.upsertResource(Oe)}catch(Oe){switch(Oe.statusCode){case 401:case 403:En(new z.HttpError(t("You're not authorized to save this file"),Oe.response));break;case 409:case 412:En(new z.HttpError(t("This file was updated outside this window. Please copy your changes or save the file under a new name (»Save As...«)."),Oe.response));break;case 507:const tt=h.spaces.find(Vt=>Vt.id===a(B).storageId&&z.isProjectSpaceResource(Vt));if(tt){En(new z.HttpError(t('Insufficient quota on "%{spaceName}" to save this file',{spaceName:tt.name}),Oe.response));break}En(new z.HttpError(t("Insufficient quota for saving this file"),Oe.response));break;default:En(new z.HttpError("",Oe.response))}}}).drop(),b=async()=>{await v.perform()};let F=null;yt(()=>{if(ae=T.subscribe("runtime.resource.deleted",ye),m.ancestorMetaData?.["/"]&&a(O)&&m.ancestorMetaData["/"].spaceId!==a(O).id&&m.setAncestorMetaData({}),!a(fe))return;const Te=g.options.editor;Te.autosaveEnabled&&!e.disableAutoSave&&(F=setInterval(async()=>{xe.value&&(await b(),C())},(Te.autosaveInterval||120)*1e3))}),bn(()=>{T.unsubscribe("runtime.resource.deleted",ae),d.isLoading||window.removeEventListener("beforeunload",he),a(be("url"))&&ut(N.value),a(fe)&&(clearInterval(F),F=null)});const{bindKeyAction:P}=_i({skipDisabledKeyBindingsCheck:!0});P({modifier:Li.Ctrl,primary:jn.S},()=>{a(xe)&&b()});const U=A(()=>[{name:"save-file",disabledTooltip:()=>"",isVisible:()=>a(fe)&&!a(H),isDisabled:()=>!a(xe),icon:"save",id:"app-save-action",label:()=>t("Save"),handler:b}]),X=A(()=>({space:a(O),resources:[a(B)]})),ee=async(Te,Oe)=>{a(xe)&&(await b(),C()),Oe(Te)},ye=Te=>{if(Te.find(tt=>tt.id===a(B).id)){if(ne)return ne();de()}},Ie=A(()=>[...a(E),...a(U),...a(pe).map(Te=>({...Te,isVisible:Oe=>fe.value&&Te.isVisible(Oe)}))].filter(Te=>Te.isVisible(a(X)))),Fe=A(()=>[...a(L),...a(D)].filter(Te=>Te.isVisible(a(X)))),Ne=A(()=>[...a($).map(Te=>({...Te,handler:Oe=>ee(Oe,Te.handler)})),...a(V)].filter(Te=>Te.isVisible(a(X)))),xs=A(()=>[...a(_)].filter(Te=>Te.isVisible(a(X)))),cr=A(()=>{const Te=[];return a(Ie).length&&Te.push({name:"context",items:a(Ie)}),a(Fe).length&&Te.push({name:"share",items:a(Fe)}),a(Ne).length&&Te.push({name:"actions",items:a(Ne)}),a(xs).length&&Te.push({name:"sidebar",items:a(xs)}),Te}),As=A(()=>[...a(U)]);Ds.onBeforeRouteLeave((Te,Oe,tt)=>{a(xe)?f({title:t("Unsaved changes"),customComponent:Tg,focusTrapInitial:".oc-modal-body-actions-confirm",hideActions:!0,customComponentAttrs:()=>({closeCallback:()=>{tt()}}),async onConfirm(){await b(),tt()}}):tt()});const Eo=A(()=>({url:a(N),space:a(a(ue).space),resource:a(B),activeFiles:a(gt),isDirty:a(xe),isReadOnly:a(H),applicationConfig:a(ie),currentFileContext:a(ue),currentContent:a(Y),isFolderLoading:a(ke),"onUpdate:resource":Te=>{O.value=a(a(ue).space),B.value={...Te,...z.isShareSpaceResource(a(O))&&{remoteItemId:a(O).id}},p.value=[a(B)]},"onUpdate:currentContent":Te=>{Y.value=Te},"onRegister:onDeleteResourceCallback":Te=>{ne=Te},"onDelete:resource":()=>{a(V)[0].isVisible({space:a(O),resources:[a(B)]})&&a(V)[0].handler({space:a(O),resources:[a(B)]})},onSave:b,onClose:de,loadFolderForFileContext:ve,revokeUrl:ut,getUrlForResource:Ve}));return(Te,Oe)=>(I(),G("main",{id:e.applicationId,class:"app-wrapper h-full",onKeydown:Oe[0]||(Oe[0]=zo((...tt)=>a(de)&&a(de)(...tt),["esc"]))},[Q("h1",{class:"sr-only",textContent:R.toDisplayString(Jt.value)},null,8,VI),!q.value&&!j.value&&B.value?(I(),re(yg,{key:0,"main-actions":As.value,"drop-down-menu-sections":cr.value,"drop-down-action-options":X.value,"has-auto-save":!e.disableAutoSave,"is-editor":fe.value,resource:B.value,"is-read-only":H.value,onClose:a(de)},null,8,["main-actions","drop-down-menu-sections","drop-down-action-options","has-auto-save","is-editor","resource","is-read-only","onClose"])):le("",!0),q.value?(I(),re(fI,{key:1})):j.value?(I(),re(aI,{key:2,message:j.value.message},null,8,["message"])):(I(),G("div",qI,[Ce(Te.$slots,"default",pt({class:["app-wrapper-content size-full",{"w-[calc(100%-440px)]":a(y)&&!a(k)}]},Eo.value)),J(Sg,{space:O.value},null,8,["space"])]))],40,UI))}});function HI(e,t){return ge({render(){return za(Cg,{wrappedComponent:e,...t},{default:n=>za(e,n)})}})}const _c=ge({__name:"ContextMenuQuickAction",props:{item:{},resourceDomSelector:{type:Function,default:e=>z.extractDomSelector(e.id)},title:{default:""}},emits:["quickActionClicked"],setup(e){const{$gettext:t}=me.useGettext(),n=A(()=>t("Show context menu"));return(r,o)=>{const s=oe("oc-icon"),i=oe("oc-drop"),l=oe("oc-button"),u=Lt("oc-tooltip");return je((I(),re(l,{id:`context-menu-trigger-${e.resourceDomSelector(e.item)}`,"data-test-context-menu-resource-name":e.item.name,"aria-label":n.value,appearance:"raw",class:"quick-action-button ml-1 p-1",onClick:o[0]||(o[0]=wt(d=>r.$emit("quickActionClicked",{event:d,dropdown:r.$refs[`context-menu-drop-ref-${e.resourceDomSelector(e.item)}`]}),["stop","prevent"]))},{default:Z(()=>[J(s,{name:"more-2"}),J(i,{ref:`context-menu-drop-ref-${e.resourceDomSelector(e.item)}`,"drop-id":`context-menu-drop-${e.resourceDomSelector(e.item)}`,toggle:`#context-menu-trigger-${e.resourceDomSelector(e.item)}`,title:e.title,position:"bottom-end",mode:"click","padding-size":"small","close-on-click":""},{default:Z(()=>[Ce(r.$slots,"contextMenu",{item:e.item})]),_:3},8,["drop-id","toggle","title"])]),_:3},8,["id","data-test-context-menu-resource-name","aria-label"])),[[u,n.value]])}}}),WI=ge({name:"ResourceGhostElement",components:{ResourceIcon:ws},props:{previewItems:{type:Array,required:!0}},computed:{layerCount(){return Math.min(this.previewItems.length,3)},showSecondLayer(){return this.layerCount>1},showThirdLayer(){return this.layerCount>2},itemCount(){return this.previewItems.length}}}),QI={id:"ghost-element",class:"z-[var(--z-index-modal)] absolute pt-1 pl-4 bg-transparent"},KI={class:"relative rounded-sm bg-role-surface-container-high"},GI={key:0,class:"-z-10 absolute top-[3px] left-[3px] right-[-3px] bottom-[-3px] rounded-sm bg-role-surface-container-high brightness-82"},JI={key:1,class:"-z-20 absolute top-[6px] left-[6px] right-[-6px] bottom-[-6px] rounded-sm bg-role-surface-container-high brightness-72"},XI={class:"badge absolute top-[-2px] right-[-8px] p-1 text-sm text-center leading-2 bg-red-600 text-white rounded-4xl box-content min-w-2 h-2"};function YI(e,t,n,r,o,s){const i=oe("resource-icon");return I(),G("div",QI,[Q("div",KI,[J(i,{class:"p-1",resource:e.previewItems[0]},null,8,["resource"]),e.showSecondLayer?(I(),G("div",GI)):le("",!0),e.showThirdLayer?(I(),G("div",JI)):le("",!0)]),Q("span",XI,R.toDisplayString(e.itemCount),1)])}const Mc=Le(WI,[["render",YI]]),ZI=ge({name:"ResourceSize",props:{size:{type:[String,Number],required:!0}},setup:e=>{const{current:t}=me.useGettext();return{formattedSize:A(()=>Ht(e.size,t))}}}),eF=["textContent"];function tF(e,t,n,r,o,s){return I(),G("span",{textContent:R.toDisplayString(e.formattedSize)},null,8,eF)}const xg=Le(ZI,[["render",tF]]),Ag=ge({__name:"ResourceStatusIndicators",props:{resource:{},space:{default:()=>{}},filter:{type:Function,default:void 0}},setup(e){const t=Js(),{getIndicators:n}=Dc(),r=A(()=>{const o=n({space:e.space,resource:e.resource});return e.filter?o.filter(e.filter):o});return(o,s)=>r.value.length>0?(I(),re(a(HE),pt({key:0},a(t),{indicators:r.value,resource:e.resource}),null,16,["indicators","resource"])):le("",!0)}}),la=ge({__name:"UserAvatar",props:{userId:{},userName:{}},setup(e){const t=fi(),{avatarMap:n}=we.storeToRefs(t),{enqueueAvatar:r}=pg(),o=A(()=>a(n)[e.userId]);return yt(()=>{r(e.userId)}),(s,i)=>{const l=oe("oc-avatar");return I(),re(l,{"user-name":e.userName,src:o.value,width:36},null,8,["user-name","src"])}}}),nF={class:R.normalizeClass(["[&_.cropper-crop-box]:!outline-1","[&_.cropper-crop-box]:!outline-role-outline","[&_.cropper-view-box]:!rounded-[50%]","[&_.cropper-crop-box]:!rounded-[50%]","[&_.cropper-line]:!bg-role-outline","[&_.cropper-point]:!bg-role-outline"])},rF={class:"flex flex-col items-center"},oF={class:"oc-button-group"},sF={key:0},iF=["src"],aF={class:"text-sm text-role-on-surface-variant flex items-center mt-1"},lF=["textContent"],cF=ge({__name:"AvatarUpload",setup(e){const t=et(),n=fi(),{avatarMap:r}=we.storeToRefs(n),{user:o}=we.storeToRefs(t),{$gettext:s}=me.useGettext(),{showErrorMessage:i,showMessage:l}=Me(),{graphAuthenticated:u}=Pe(),{setCropperInstance:d}=Ql(),c=W(null),p=W(null),f=W(null),h=W(!1),g=W(!1),m=W(!1),w=W(null),T=vc*1024*1024,k=A(()=>!!a(r)[a(o).id]),S=te=>{const O=te.target.files?.[0];if(O){if(O.size>T){i({title:s("File size exceeds the limit of %{size}MB",{size:vc.toString()})});return}c.value=URL.createObjectURL(O),g.value=!0}};Ue(c,async te=>{te&&(await xt(),f.value&&f.value.destroy(),p.value&&(f.value=new ca(p.value,{aspectRatio:1,viewMode:1,dragMode:"move",autoCropArea:.8,responsive:!0,background:!1,ready(){h.value=!0}}),d(f)))});const y=()=>f.value.getCroppedCanvas({width:256,height:256,imageSmoothingQuality:"high"}),E=async te=>await new Promise(B=>{te.toBlob(O=>B(O),"image/png")}),D=()=>{w.value?.click()},$=()=>{g.value=!1,V()},_=async()=>{const te=y(),B=await E(te),O=URL.createObjectURL(B),M=new File([B],"avatar.png",{type:"image/png",lastModified:Date.now()});try{await u.photos.updateOwnUserPhotoPatch(M),n.addAvatar(a(o).id,O),l({title:s("Profile picture was set successfully")})}catch(N){i({title:s("Failed to set profile picture"),errors:[N]})}g.value=!1,V()},L=async()=>{try{await u.photos.deleteOwnUserPhoto(),n.removeAvatar(a(o).id),l({title:s("Profile picture was removed successfully")})}catch(te){i({title:s("Failed to remove profile picture"),errors:[te]})}m.value=!1},V=()=>{f.value?.destroy(),f.value=null,w.value&&(w.value.value=""),c.value=null};return(te,B)=>{const O=oe("oc-button"),M=oe("oc-icon"),N=oe("oc-modal");return I(),G("div",nF,[Q("input",{ref_key:"fileInputRef",ref:w,class:"invisible avatar-file-input",type:"file",accept:"image/jpeg, image/png",onChange:S},null,544),Q("div",rF,[J(la,{class:"mb-4",width:128,"user-id":a(o).id,"user-name":a(o).displayName},null,8,["user-id","user-name"]),Q("div",null,[Q("div",oF,[J(O,{size:"small",onClick:D},{default:Z(()=>[ct(R.toDisplayString(a(s)("Upload")),1)]),_:1}),k.value?(I(),re(O,{key:0,class:"avatar-upload-remove-button",size:"small",onClick:B[0]||(B[0]=q=>m.value=!0)},{default:Z(()=>[ct(R.toDisplayString(a(s)("Remove")),1)]),_:1})):le("",!0)])])]),g.value?(I(),re(N,{key:0,title:a(s)("Crop your new profile picture"),"button-cancel-text":a(s)("Cancel"),"button-confirm-text":a(s)("Set"),"button-confirm-disabled":!h.value,"focus-trap-initial":!1,onCancel:$,onConfirm:_},{content:Z(()=>[c.value?(I(),G("div",sF,[Q("img",{ref_key:"imageRef",ref:p,class:"max-h-[400px]",src:c.value},null,8,iF),Q("div",aF,[J(M,{class:"mr-1",name:"information",size:"small","fill-type":"line"}),Q("span",{textContent:R.toDisplayString(a(s)("Zoom via %{ zoomKeys }, pan via %{ panKeys }",{zoomKeys:a(s)("+-"),panKeys:a(s)("↑↓←→")}))},null,8,lF)])])):le("",!0)]),_:1},8,["title","button-cancel-text","button-confirm-text","button-confirm-disabled"])):le("",!0),m.value?(I(),re(N,{key:1,message:a(s)("Are you sure you want to remove your profile picture?"),title:a(s)("Remove profile picture"),"button-cancel-text":a(s)("Cancel"),"button-confirm-text":a(s)("Remove"),onCancel:B[1]||(B[1]=q=>m.value=!1),onConfirm:L},null,8,["message","title","button-cancel-text","button-confirm-text"])):le("",!0)])}}}),uF={class:"resource-table-select-all flex justify-center items-center"},dF={class:"truncate"},fF=["textContent"],pF=["textContent"],hF=["textContent"],mF={key:0,class:"flex items-center justify-end flex-row flex-nowrap"},gF=850,vF=ge({__name:"ResourceTable",props:{resources:{},resourceDomSelector:{type:Function,default:e=>z.extractDomSelector(e.id)},arePathsDisplayed:{type:Boolean,default:!1},selectedIds:{default:()=>[]},hasActions:{type:Boolean,default:!0},showRenameQuickAction:{type:Boolean,default:!0},areResourcesClickable:{type:Boolean,default:!0},headerPosition:{default:0},isSelectable:{type:Boolean,default:!0},dragDrop:{type:Boolean,default:!1},viewMode:{default:()=>Ft.defaultModeName},hover:{type:Boolean,default:!0},sortBy:{default:()=>{}},fieldsDisplayed:{default:()=>{}},sortDir:{default:()=>{}},space:{default:()=>{}},resourceType:{default:"file"},lazy:{type:Boolean,default:!0}},emits:["fileClick","sort","fileDropped","update:selectedIds","update:modelValue"],setup(e,{emit:t}){const n=t,r=Re(),o=Dt(),{getMatchingSpace:s}=It(),{interceptModifierClick:i}=zr(),{getParentFolderLink:l,getParentFolderLinkIconAdditionalAttributes:u,getParentFolderName:d,getPathPrefix:c}=Cr({space:W(e.space)}),{isSticky:p}=Ac(),{$gettext:f,$ngettext:h,current:g}=me.useGettext(),{isLocationPicker:m,isFilePicker:w}=Tr(),{selectedResources:T,disabledResources:k,isResourceSelected:S,fileContainerClicked:y,fileNameClicked:E,fileCheckboxClicked:D,isResourceDisabled:$,isResourceInDeleteQueue:_,isResourceClickable:L,isResourceCut:V,getResourceLink:te,dragItem:B,dragSelection:O,dragStart:M,fileDropped:N,setDropStyling:q,shouldShowContextDrop:j,showContextMenuOnRightClick:H,showContextMenuOnBtnClick:se,selectAllCheckboxLabel:Y,getResourceCheckboxLabel:ae,toggleSelectionAll:ne,areAllResourcesSelected:pe}=Pc({space:A(()=>e.space),resources:A(()=>e.resources),selectedIds:A(()=>e.selectedIds),emit:n}),fe=_t(),{isSideBarOpen:be}=we.storeToRefs(fe),xe=Lr(),{userContextReady:he}=we.storeToRefs(xe),ie=De(),{areFileExtensionsShown:de,latestSelectedId:ue}=we.storeToRefs(ie),{width:Se}=Rn.useWindowSize(),$e=A(()=>o.filesTags&&Se.value>=gF),{actions:Ve}=na(),{actions:lt}=Xm(),Tt=A(()=>a(Ve)[0].handler),ut=A(()=>a(lt)[0].handler),gt=C=>f("Search for tag %{tag}",{tag:C}),ve=A(()=>{if(e.resources.length===0)return[];const C=e.resources[0],v=[];e.isSelectable&&v.push({name:"select",title:"",type:"slot",headerType:"slot",width:"shrink"});const b=af(C);return v.push(...[{name:"name",title:f("Name"),type:"slot",width:"expand",wrap:"truncate"},{name:"manager",prop:"members",title:f("Manager"),type:"slot"},{name:"members",title:f("Members"),prop:"members",type:"slot"},{name:"totalQuota",prop:"spaceQuota.total",title:f("Total quota"),type:"slot",sortable:!0},{name:"usedQuota",prop:"spaceQuota.used",title:f("Used quota"),type:"slot",sortable:!0},{name:"remainingQuota",prop:"spaceQuota.remaining",title:f("Remaining quota"),type:"slot",sortable:!0},{name:"indicators",title:f("Status"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"size",title:f("Size"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"syncEnabled",title:f("Info"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"tags",title:f("Tags"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedBy",title:f("Shared by"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedWith",title:f("Shared with"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"mdate",title:f("Modified"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:F=>dt(F.mdate)+" ("+kt(F.mdate)+")"},{name:"sdate",title:f("Shared on"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:F=>dt(F.sdate)+" ("+kt(F.sdate)+")"},{name:"ddate",title:f("Deleted"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:F=>dt(F.ddate)+" ("+kt(F.ddate)+")"}].filter(F=>{if(F.name==="tags"&&!a($e))return!1;if(F.name==="indicators")return!0;let P;return F.prop?P=El(C,F.prop)!==void 0:P=Object.prototype.hasOwnProperty.call(C,F.name),e.fieldsDisplayed?P&&e.fieldsDisplayed.includes(F.name):P}).map(F=>{const P=b.find(U=>U.name===F.name);return P&&Object.assign(F,{sortable:P.sortable,sortDir:P.sortDir}),F})),e.hasActions&&v.push({name:"actions",title:f("Actions"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"}),v}),ke=C=>{const v=a(r.currentRoute).query?.term;return lo("files-common-search",{query:{provider:"files.sdk",q_tags:C,...v&&{term:v}}})},qe=C=>a(he)?{to:ke(C)}:{},We=C=>C.id===a(ue),Jt=C=>e.showRenameQuickAction?z.isProjectSpaceResource(C)?a(lt).filter(v=>v.isVisible({resources:[C]})).length:a(Ve).filter(v=>v.isVisible({space:e.space,resources:[C]})).length:!1,Xt=C=>{if(z.isProjectSpaceResource(C))return a(ut)({resources:[C]});a(Tt)({space:s(C),resources:[C]})},kt=C=>mp(new Date(C),g),dt=C=>vp(new Date(C),g),mn=C=>{if(!z.isShareResource(C))return;const v=C.type==="folder"?f("folder"):f("file"),b=C.sharedWith.filter(({shareType:F})=>z.ShareTypes.authenticated.includes(z.ShareTypes.getByValue(F))).length;return b?h("This %{ resourceType } is shared via %{ shareCount } invite","This %{ resourceType } is shared via %{ shareCount } invites",b,{resourceType:v,shareCount:b.toString()}):""},qn=C=>{if(!z.isShareResource(C))return"";const v=C.type==="folder"?f("folder"):f("file");return f("This %{ resourceType } is shared by %{ user }",{resourceType:v,user:C.sharedBy.map(({displayName:b})=>b).join(", ")})},At=C=>z.isShareResource(C)?C.sharedBy.map(v=>({displayName:v.displayName,name:v.displayName,avatarType:z.ShareTypes.user.key,username:v.id,userId:v.id})):[],En=C=>z.isShareResource(C)?C.sharedWith.filter(({shareType:v})=>z.ShareTypes.authenticated.includes(z.ShareTypes.getByValue(v))).map(v=>({displayName:v.displayName,name:v.displayName,avatarType:z.ShareTypes.getByValue(v.shareType).key,username:v.id,userId:v.id})):[];return(C,v)=>{const b=oe("oc-checkbox"),F=oe("oc-icon"),P=oe("oc-tag"),U=oe("oc-avatars"),X=Lt("oc-tooltip");return I(),G(Ae,null,[J(a(oR),pt(C.$attrs,{id:"files-space-table",class:[{condensed:e.viewMode===a(Ft).name.condensedTable,"files-table":e.resourceType==="file","files-table-squashed":e.resourceType==="file"&&a(be),"spaces-table":e.resourceType==="space","spaces-table-squashed":e.resourceType==="space"&&a(be)}],data:e.resources,fields:ve.value,highlighted:e.selectedIds,disabled:a(k),sticky:a(p),"header-position":e.headerPosition,"drag-drop":e.dragDrop,hover:e.hover,"item-dom-selector":e.resourceDomSelector,selection:a(T),"sort-by":e.sortBy,"sort-dir":e.sortDir,lazy:e.lazy,"padding-x":"medium",onHighlight:v[1]||(v[1]=ee=>a(y)({resource:ee[0],event:ee[1]})),onContextmenuClicked:v[2]||(v[2]=(ee,ye,Ie)=>a(H)(ye,Ie)),onItemDropped:v[3]||(v[3]=ee=>a(N)(ee[0],ee[1])),onItemDragged:v[4]||(v[4]=ee=>a(M)(ee[0],ee[1])),onDropRowStyling:a(q),onSort:v[5]||(v[5]=ee=>C.$emit("sort",ee)),"onUpdate:modelValue":v[6]||(v[6]=ee=>C.$emit("update:modelValue",ee))}),Fu({name:Z(({item:ee})=>[Q("div",{class:R.normalizeClass(["resource-table-resource-wrapper flex items-center",[{"resource-table-resource-wrapper-limit-max-width":Jt(ee)}]])},[Ce(C.$slots,"image",{resource:ee}),(I(),re(Ss,{key:`${ee.path}-${e.resourceDomSelector(ee)}-${ee.thumbnail}`,resource:ee,"path-prefix":a(c)(ee),"is-path-displayed":e.arePathsDisplayed,"parent-folder-name":a(d)(ee),"is-icon-displayed":!C.$slots.image,"is-extension-displayed":a(de),"is-resource-clickable":a(L)(ee,e.areResourcesClickable),link:a(te)(ee),"parent-folder-link":a(l)(ee),"parent-folder-link-icon-additional-attributes":a(u)(ee),class:R.normalizeClass({"opacity-60":a(V)(ee)}),onClick:wt(ye=>a(E)({resource:ee,event:ye}),["stop"])},null,8,["resource","path-prefix","is-path-displayed","parent-folder-name","is-icon-displayed","is-extension-displayed","is-resource-clickable","link","parent-folder-link","parent-folder-link-icon-additional-attributes","class","onClick"])),Jt(ee)?(I(),re(a(Qt),{key:0,class:"resource-table-edit-name inline-flex raw-hover-surface p-1 ml-1",appearance:"raw","aria-label":a(f)("Rename file »%{name}«",{name:ee.name}),title:a(f)("Rename"),onClick:wt(ye=>{a(i)(ye,ee)||Xt(ee)},["stop"])},{default:Z(()=>[J(F,{name:"edit-2","fill-type":"line",size:"small",color:"var(--oc-role-on-surface)"})]),_:1},8,["aria-label","title","onClick"])):le("",!0)],2),Ce(C.$slots,"additionalResourceContent",{resource:ee})]),syncEnabled:Z(({item:ee})=>[Ce(C.$slots,"syncEnabled",{resource:ee})]),size:Z(({item:ee})=>[J(xg,{size:ee.size||Number.NaN},null,8,["size"])]),tags:Z(({item:ee})=>[(I(!0),G(Ae,null,Ye(ee.tags.slice(0,2),ye=>(I(),re(rn(a(he)?"router-link":"span"),pt({key:ye},{ref_for:!0},qe(ye),{class:"resource-table-tag-wrapper"}),{default:Z(()=>[je((I(),re(P,{class:"resource-table-tag ml-1 max-w-20",rounded:!0,size:"small"},{default:Z(()=>[J(F,{name:"price-tag-3",size:"small"}),Q("span",dF,R.toDisplayString(ye),1)]),_:2},1024)),[[X,gt(ye)]])]),_:2},1040))),128)),ee.tags.length>2?(I(),re(P,{key:0,size:"small",class:"resource-table-tag-more align-text-bottom cursor-pointer",onClick:v[0]||(v[0]=ye=>a(fe).openSideBar())},{default:Z(()=>[ct(" + "+R.toDisplayString(ee.tags.length-2),1)]),_:2},1024)):le("",!0)]),manager:Z(({item:ee})=>[Ce(C.$slots,"manager",{resource:ee})]),members:Z(({item:ee})=>[Ce(C.$slots,"members",{resource:ee})]),totalQuota:Z(({item:ee})=>[Ce(C.$slots,"totalQuota",{resource:ee})]),usedQuota:Z(({item:ee})=>[Ce(C.$slots,"usedQuota",{resource:ee})]),remainingQuota:Z(({item:ee})=>[Ce(C.$slots,"remainingQuota",{resource:ee})]),mdate:Z(({item:ee})=>[je(Q("span",{tabindex:"0",textContent:R.toDisplayString(dt(ee.mdate))},null,8,fF),[[X,kt(ee.mdate)]])]),indicators:Z(({item:ee})=>[J(Ag,{space:e.space,resource:ee,"disable-handler":a($)(ee)},null,8,["space","resource","disable-handler"])]),sdate:Z(({item:ee})=>[je(Q("span",{tabindex:"0",textContent:R.toDisplayString(dt(ee.sdate))},null,8,pF),[[X,kt(ee.sdate)]])]),ddate:Z(({item:ee})=>[je(Q("p",{tabindex:"0",class:"m-0",textContent:R.toDisplayString(dt(ee.ddate))},null,8,hF),[[X,kt(ee.ddate)]])]),sharedBy:Z(({item:ee})=>[J(U,{class:"flex items-center justify-end flex-row flex-nowrap","is-tooltip-displayed":!0,items:At(ee),"accessible-description":qn(ee),"hover-effect":""},{userAvatars:Z(({avatars:ye,width:Ie})=>[(I(!0),G(Ae,null,Ye(ye,Fe=>(I(),re(a(la),{key:Fe.userId,"user-id":Fe.userId,"user-name":Fe.displayName,width:Ie},null,8,["user-id","user-name","width"]))),128))]),_:1},8,["items","accessible-description"])]),sharedWith:Z(({item:ee})=>[J(U,{class:"flex items-center justify-end flex-row flex-nowrap","data-testid":"resource-table-shared-with",items:En(ee),stacked:!0,"max-displayed":3,"is-tooltip-displayed":!0,"accessible-description":mn(ee),"hover-effect":""},{userAvatars:Z(({avatars:ye,width:Ie})=>[(I(!0),G(Ae,null,Ye(ye,Fe=>(I(),re(a(la),{key:Fe.userId,"user-id":Fe.userId,"user-name":Fe.displayName,width:Ie},null,8,["user-id","user-name","width"]))),128))]),_:1},8,["items","accessible-description"])]),actions:Z(({item:ee})=>[a(j)(ee)?(I(),G("div",mF,[Ce(C.$slots,"quickActions",{resource:ee}),J(_c,{title:ee.name,item:ee,"resource-dom-selector":e.resourceDomSelector,class:"resource-table-btn-action-dropdown",onQuickActionClicked:ye=>a(se)(ye,ee)},{contextMenu:Z(()=>[Ce(C.$slots,"contextMenu",{resource:ee})]),_:2},1032,["title","item","resource-dom-selector","onQuickActionClicked"])])):le("",!0)]),_:2},[!a(m)&&!a(w)?{name:"selectHeader",fn:Z(()=>[Q("div",uF,[je(J(b,{id:"resource-table-select-all",size:"large",label:a(Y),disabled:e.resources.length===a(k).length,"label-hidden":!0,"model-value":a(pe),onClick:wt(a(ne),["stop"])},null,8,["label","disabled","model-value","onClick"]),[[X,{content:a(Y),placement:"bottom"}]])])]),key:"0"}:void 0,!a(m)&&!a(w)?{name:"select",fn:Z(({item:ee})=>[a(_)(ee.id)?(I(),re(a(UE),{key:0,class:"inline-flex ml-1",size:"medium","aria-label":a(f)("File is being processed")},null,8,["aria-label"])):(I(),re(b,{key:1,id:`resource-table-select-${e.resourceDomSelector(ee)}`,label:a(ae)(ee),"label-hidden":!0,size:"large",disabled:a($)(ee),"model-value":a(S)(ee),outline:We(ee),"data-test-selection-resource-name":ee.name,"data-test-selection-resource-path":ee.path,onClick:wt(ye=>a(D)({resource:ee,event:ye}),["stop"])},null,8,["id","label","disabled","model-value","outline","data-test-selection-resource-name","data-test-selection-resource-path","onClick"]))]),key:"1"}:void 0,C.$slots.footer?{name:"footer",fn:Z(()=>[Ce(C.$slots,"footer")]),key:"2"}:void 0]),1040,["class","data","fields","highlighted","disabled","sticky","header-position","drag-drop","hover","item-dom-selector","selection","sort-by","sort-dir","lazy","onDropRowStyling"]),a(B)?(I(),re(Fa,{key:0,to:"body"},[J(Mc,{ref:"ghostElement","preview-items":[a(B),...a(O)]},null,8,["preview-items"])])):le("",!0)],64)}}}),yF={key:0,class:"oc-tile-card-lazy-shimmer h-30 overflow-hidden relative after:absolute after:inset-0 after:transform-[translateX(-100%)] opacity-20 after:animate-shimmer"},bF={class:"z-10 absolute top-0 left-0 [&_input]:not-[.oc-checkbox-checked]:bg-role-surface-container"},wF={key:0,class:"oc-tile-card-loading-spinner z-990 m-2"},SF=["textContent"],TF=["aria-label"],kF={class:"flex justify-between items-center"},CF={class:"flex items-center truncate resource-name-wrapper text-role-on-surface overflow-hidden"},xF={class:"flex items-center"},AF={key:0,class:"text-left my-0 truncate"},EF=["textContent"],Eg=ge({__name:"ResourceTile",props:{resource:{},resourceRoute:{},space:{},isResourceSelected:{type:Boolean,default:!1},isResourceClickable:{type:Boolean,default:!0},isResourceDisabled:{type:Boolean,default:!1},isExtensionDisplayed:{type:Boolean,default:!0},isPathDisplayed:{type:Boolean,default:!1},resourceIconSize:{default:"xlarge"},lazy:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1}},emits:["fileNameClicked","contextmenu","itemVisible","tileClicked"],setup(e,{emit:t}){const n=t,{$gettext:r}=me.useGettext(),{getParentFolderName:o,getParentFolderLink:s}=Cr({space:W(e.space)}),i=nn("observerTarget"),l=A(()=>a(i)?.$el),u=A(()=>e.resource.locked||e.resource.processing),d=A(()=>e.resource.locked?{name:"lock",fillType:"fill"}:e.resource.processing?{name:"loop-right",fillType:"line"}:{}),c=A(()=>e.resource.locked?r("This item is locked"):null),p=A(()=>z.isSpaceResource(e.resource)?e.resource.description:""),{isVisible:f}=e.lazy?Zp({target:l,onVisibleCallback:()=>n("itemVisible")}):{isVisible:W(!0)},h=A(()=>!a(f));return e.lazy||n("itemVisible"),(g,m)=>{const w=oe("oc-spinner"),T=oe("oc-tag"),k=oe("oc-image"),S=oe("oc-icon"),y=Lt("oc-tooltip");return I(),re(a(mc),{ref_key:"observerTarget",ref:i,"body-class":"p-0",class:R.normalizeClass(["oc-tile-card flex flex-col h-full shadow-none [&.item-accentuated]:bg-role-secondary-container",{"oc-tile-card-selected bg-role-secondary-container outline-2 outline-role-outline":e.isResourceSelected,"bg-role-surface-container hover:bg-role-surface-container-highest outline outline-role-surface-container-highest":!e.isResourceSelected,"oc-tile-card-disabled opacity-70 grayscale-60 pointer-events-none":e.isResourceDisabled&&!a(z.isProjectSpaceResource)(e.resource),"state-trashed [&_.tile-preview]:opacity-80 [&_.tile-default-image_svg]:opacity-80 [&_.tile-preview]:grayscale [&_.tile-default-image_svg]:grayscale":e.isResourceDisabled&&a(z.isProjectSpaceResource)(e.resource)}]),"data-item-id":e.resource.id,onContextmenu:m[4]||(m[4]=E=>g.$emit("contextmenu",E))},{default:Z(()=>[h.value?(I(),G("div",yF)):(I(),G(Ae,{key:1},[J(Xi,{class:"oc-card-media-top flex justify-center items-center m-0 w-full relative aspect-[16/9]",resource:e.resource,link:e.resourceRoute,"is-resource-clickable":e.isResourceClickable,tabindex:"-1",onClick:m[1]||(m[1]=E=>g.$emit("fileNameClicked",E))},{default:Z(()=>[Q("div",bF,[e.isLoading?(I(),G("div",wF,[J(w,{"aria-label":a(r)("File is being processed")},null,8,["aria-label"])])):Ce(g.$slots,"selection",{key:1,item:e.resource})]),e.isResourceDisabled&&a(z.isProjectSpaceResource)(e.resource)?(I(),re(T,{key:0,class:"z-10 absolute text-role-on-surface",type:"span"},{default:Z(()=>[Q("span",{textContent:R.toDisplayString(a(r)("Disabled"))},null,8,SF)]),_:1})):le("",!0),je((I(),G("div",{class:R.normalizeClass(["oc-tile-card-preview flex items-center justify-center text-center size-full absolute",{"p-2":e.isResourceSelected,"hover:p-2":!e.isResourceSelected}]),"aria-label":c.value},[Ce(g.$slots,"imageField",{item:e.resource},()=>[e.resource.thumbnail?(I(),re(k,{key:0,class:R.normalizeClass(["tile-preview rounded-t-sm size-full object-cover aspect-[16/9] pointer-events-none",{"rounded-sm":e.isResourceSelected}]),src:e.resource.thumbnail,"data-test-thumbnail-resource-name":e.resource.name,onClick:m[0]||(m[0]=wt(E=>g.$emit("tileClicked",[e.resource,E]),["stop"]))},null,8,["class","src","data-test-thumbnail-resource-name"])):(I(),re(ws,{key:1,resource:e.resource,size:e.resourceIconSize,class:"tile-default-image pt-1 relative"},Fu({_:2},[u.value?{name:"status",fn:Z(()=>[J(S,pt(d.value,{size:"xsmall"}),null,16)]),key:"0"}:void 0]),1032,["resource","size"]))])],10,TF)),[[y,c.value]])]),_:3},8,["resource","link","is-resource-clickable"]),Q("div",{class:"p-2",onClick:m[3]||(m[3]=wt(E=>g.$emit("tileClicked",[e.resource,E]),["stop"]))},[Q("div",kF,[Q("div",CF,[J(Ss,{resource:e.resource,"is-icon-displayed":!1,"is-extension-displayed":e.isExtensionDisplayed,"is-resource-clickable":e.isResourceClickable,"is-path-displayed":e.isPathDisplayed,"parent-folder-name":a(o)(e.resource),"parent-folder-link":a(s)(e.resource),link:e.resourceRoute,onClick:m[2]||(m[2]=wt(E=>g.$emit("fileNameClicked",E),["stop"]))},null,8,["resource","is-extension-displayed","is-resource-clickable","is-path-displayed","parent-folder-name","parent-folder-link","link"])]),Q("div",xF,[Ce(g.$slots,"indicators",{item:e.resource,class:"resource-indicators"}),Ce(g.$slots,"actions",{item:e.resource}),Ce(g.$slots,"contextMenu",{item:e.resource})])]),p.value?(I(),G("p",AF,[Q("span",{class:"text-sm",textContent:R.toDisplayString(p.value)},null,8,EF)])):le("",!0),Ce(g.$slots,"additionalResourceContent",{item:e.resource})])],64))]),_:3},8,["data-item-id","class"])}}}),RF={id:"tiles-view",class:"px-4 pt-2"},DF={class:"flex items-center mb-2 pb-2 oc-tiles-controls"},PF={key:1,class:"oc-tiles-sort"},IF={key:0,class:"flex"},FF={class:"p-1 text-sm"},$F=Le(ge({__name:"ResourceTiles",props:{resources:{default:()=>[]},selectedIds:{default:()=>[]},isSelectable:{type:Boolean,default:!0},space:{},sortFields:{default:()=>[]},sortBy:{},sortDir:{},viewSize:{default:()=>Ft.tilesSizeDefault},dragDrop:{type:Boolean,default:!1},lazy:{type:Boolean,default:!0},areResourcesClickable:{type:Boolean,default:!0},arePathsDisplayed:{type:Boolean,default:!1}},emits:["fileClick","fileDropped","sort","itemVisible","update:selectedIds"],setup(e,{emit:t}){const n=t,{$gettext:r}=me.useGettext(),o=De(),{areFileExtensionsShown:s}=we.storeToRefs(o),{isLocationPicker:i,isFilePicker:l}=Tr(),u=Ec(),d=A(()=>Math.min(a(u),e.viewSize)),c=_t(),{isSideBarOpen:p}=we.storeToRefs(c),{disabledResources:f,isResourceSelected:h,fileContainerClicked:g,fileNameClicked:m,fileCheckboxClicked:w,isResourceDisabled:T,isResourceInDeleteQueue:k,isResourceClickable:S,isResourceCut:y,getResourceLink:E,dragItem:D,dragSelection:$,dragStart:_,fileDropped:L,setDropStyling:V,shouldShowContextDrop:te,showContextMenuOnRightClick:B,showContextMenuOnBtnClick:O,selectAllCheckboxLabel:M,getResourceCheckboxLabel:N,toggleSelectionAll:q,areAllResourcesSelected:j}=Pc({space:A(()=>e.space),resources:A(()=>e.resources),selectedIds:A(()=>e.selectedIds),emit:n}),H=window.__E2E__===!0?!1:e.lazy,se=A(()=>e.sortFields.find(ue=>ue.name===e.sortBy&&ue.sortDir===e.sortDir)||e.sortFields[0]),Y=ue=>{n("sort",{sortBy:ue.name,sortDir:a(ue.sortDir)})},ae=A(()=>{const ue={1:"xlarge",2:"xlarge",3:"xxlarge",4:"xxlarge",5:"xxxlarge",6:"xxxlarge"},Se=a(d);return ue[Se]??"xxlarge"}),ne=W(0),pe=()=>{const ue=document.getElementById("tiles-view"),Se=getComputedStyle(ue),$e=parseInt(Se.getPropertyValue("padding-left"),10)|0,Ve=parseInt(Se.getPropertyValue("padding-right"),10)|0;ne.value=ue.clientWidth-$e-Ve},fe=A(()=>parseFloat(getComputedStyle(document.documentElement).fontSize)),{calculateTileSizePixels:be}=ig(),xe=A(()=>{const ue=[...Array(Ft.tilesSizeMax).keys()].map(Se=>Se+1);return[...new Set(ue.map(Se=>{const $e=be(Se);return $e?Math.round(a(ne)/($e+a(fe))):0}))]}),he=A(()=>{const ue=a(xe);return ue.length<a(d)?ue[ue.length-1]:ue[a(d)-1]}),ie=A(()=>{const ue=a(he)?e.resources.length%a(he):0;return ue?a(he)-ue:0}),de=A(()=>a(ne)/a(he)-a(fe));return Ue(de,ue=>{ue&&!isNaN(ue)&&document.documentElement.style.setProperty("--oc-size-tiles-actual",`${ue}px`)},{immediate:!0}),Ue(xe,ue=>{u.value=Math.max(ue.length,1)}),Ue(p,()=>{pe()}),yt(()=>{window.addEventListener("resize",pe),pe()}),bn(()=>{window.removeEventListener("resize",pe)}),(ue,Se)=>{const $e=oe("oc-checkbox"),Ve=oe("oc-icon"),lt=oe("oc-button"),Tt=oe("oc-list"),ut=oe("oc-filter-chip"),gt=Lt("oc-tooltip");return I(),G("div",RF,[Q("div",DF,[e.isSelectable&&!a(l)?je((I(),re($e,{key:0,id:"tiles-view-select-all",class:"ml-2",size:"large",label:a(M),"label-hidden":!0,disabled:e.resources.length===a(f).length,"model-value":a(j),onClick:wt(a(q),["stop"])},null,8,["label","disabled","model-value","onClick"])),[[gt,a(M)]]):le("",!0),e.sortFields.length?(I(),G("div",PF,[J(ut,{class:"[&_.oc-filter-chip-label]:text-sm","filter-label":a(r)("Sort by"),"selected-item-names":[se.value.label],"has-active-state":!1,"close-on-click":"",raw:""},{default:Z(()=>[J(Tt,null,{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.sortFields,(ve,ke)=>(I(),G("li",{key:ke},[J(lt,{appearance:se.value===ve?"filled":"raw-inverse","color-role":se.value===ve?"secondaryContainer":"surface","no-hover":se.value===ve,"justify-content":"space-between",class:"oc-tiles-sort-filter-chip-item",onClick:qe=>Y(ve)},{default:Z(()=>[Q("span",null,R.toDisplayString(ve.label),1),ve===se.value?(I(),G("div",IF,[J(Ve,{name:"check"})])):le("",!0)]),_:2},1032,["appearance","color-role","no-hover","onClick"])]))),128))]),_:1})]),_:1},8,["filter-label","selected-item-names"])])):le("",!0)]),J(Tt,{class:"oc-tiles grid justify-start gap-3"},{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.resources,ve=>(I(),G("li",{key:ve.id,class:"oc-tiles-item has-item-context-menu"},[J(Eg,{resource:ve,space:e.space,"resource-route":a(E)(ve),"is-resource-selected":a(h)(ve),"is-resource-clickable":a(S)(ve,e.areResourcesClickable),"is-resource-disabled":a(T)(ve),"is-extension-displayed":a(s),"is-path-displayed":e.arePathsDisplayed,"resource-icon-size":ae.value,draggable:e.dragDrop,lazy:a(H),"is-loading":a(k)(ve.id),class:R.normalizeClass({"opacity-60":a(y)(ve)}),onContextmenu:ke=>a(B)(ke,ve),onFileNameClicked:wt(ke=>a(m)({resource:ve,event:ke}),["stop"]),onDragstart:ke=>a(_)(ve,ke),onDragenter:wt(ke=>a(V)(ve,!1,ke),["prevent"]),onDragleave:wt(ke=>a(V)(ve,!0,ke),["prevent"]),onDrop:ke=>a(L)(ve,ke),onDragover:Se[0]||(Se[0]=ke=>ke.preventDefault()),onItemVisible:ke=>ue.$emit("itemVisible",ve),onTileClicked:ke=>a(g)({resource:ve,event:ke[1]})},{selection:Z(()=>[e.isSelectable&&!a(i)&&!a(l)?(I(),re($e,{key:0,label:a(N)(ve),"label-hidden":!0,size:"large",class:"inline-flex p-2.5",disabled:a(T)(ve),"model-value":a(h)(ve),"data-test-selection-resource-name":ve.name,"data-test-selection-resource-path":ve.path,onClick:wt(ke=>a(w)({resource:ve,event:ke}),["stop","prevent"])},null,8,["label","disabled","model-value","data-test-selection-resource-name","data-test-selection-resource-path","onClick"])):le("",!0)]),imageField:Z(()=>[Ce(ue.$slots,"image",{resource:ve},void 0,!0)]),indicators:Z(()=>[J(Ag,{space:e.space,class:"ml-2",resource:ve,filter:ke=>["system","sharing"].includes(ke.category),"disable-handler":a(T)(ve)},null,8,["space","resource","filter","disable-handler"])]),actions:Z(()=>[Ce(ue.$slots,"actions",{resource:ve},void 0,!0)]),contextMenu:Z(()=>[a(te)(ve)?(I(),re(a(_c),{key:0,item:ve,title:ve.name,class:"resource-tiles-btn-action-dropdown",onQuickActionClicked:ke=>a(O)(ke,ve)},{contextMenu:Z(()=>[Ce(ue.$slots,"contextMenu",{resource:ve},void 0,!0)]),_:2},1032,["item","title","onQuickActionClicked"])):le("",!0)]),additionalResourceContent:Z(()=>[Ce(ue.$slots,"additionalResourceContent",{resource:ve},void 0,!0)]),_:2},1032,["resource","space","resource-route","is-resource-selected","is-resource-clickable","is-resource-disabled","is-extension-displayed","is-path-displayed","resource-icon-size","draggable","lazy","is-loading","class","onContextmenu","onFileNameClicked","onDragstart","onDragenter","onDragleave","onDrop","onItemVisible","onTileClicked"])]))),128)),(I(!0),G(Ae,null,Ye(ie.value,ve=>(I(),G("li",{key:`ghost-tile-${ve}`,class:"list-item","aria-hidden":!0}))),128))]),_:3}),a(D)?(I(),re(Fa,{key:0,to:"body"},[J(Mc,{ref:"ghostElement","preview-items":[a(D),...a($)]},null,8,["preview-items"])])):le("",!0),Q("div",FF,[Ce(ue.$slots,"footer",{},void 0,!0)])])}}}),[["__scopeId","data-v-6956bf7e"]]),OF=ge({name:"DateFilter",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0},items:{type:Array,required:!0},idAttribute:{type:String,required:!1,default:"id"},displayNameAttribute:{type:String,required:!1,default:"name"}},emits:["selectionChange"],setup:function(e,{emit:t,expose:n}){const r=Re(),{current:o}=me.useGettext(),s=St(),i=Bn(),{currentTheme:l}=we.storeToRefs(i),u=W(),d=W(e.items),c=W(),p=W(),f=W(!1),h=W(),g=`q_${e.filterName}`,m=Pt(g),w=M=>M[e.idAttribute],T=()=>r.push({query:{...po(a(s).query,[g]),...a(u)&&{[g]:w(a(u))}}}),k=M=>a(u)&&w(a(u))===w(M),S=()=>{c.value=void 0,p.value=void 0},y=async M=>{S(),k(M)?u.value=void 0:(u.value=M,a(h).hideDrop()),await T(),t("selectionChange",a(u))},E=()=>{u.value=void 0,f.value=!1,S(),t("selectionChange",a(u)),T()},D=()=>{d.value=e.items},$=()=>{f.value=!1},_=()=>{const M=at(a(m));if(!M)return;const N=e.items.find(q=>w(q)===M);if(N){u.value=N;return}if(a(L)){const q=M.replace("range:",""),j=Number(q.split(" - ")[0]),H=Number(q.split(" - ")[1]);c.value=vt.DateTime.fromMillis(j),p.value=vt.DateTime.fromMillis(H),u.value=a(te)}},L=A(()=>at(a(m))?.startsWith("range:")),V=A(()=>!a(c)||!a(p)?!1:a(c)<=a(p)),te=A(()=>{if(!a(c)||!a(p))return null;const M=Mr(a(c),o,vt.DateTime.DATE_SHORT),N=Mr(a(p),o,vt.DateTime.DATE_SHORT),q=a(c).toMillis(),j=a(p).toMillis();return{[e.idAttribute]:`range:${q} - ${j}`,[e.displayNameAttribute]:`${M} - ${N}`}}),B=async()=>{u.value=a(te),await T(),a(h).hideDrop(),t("selectionChange",a(u))},O=({date:M,error:N},q)=>{if(N){console.error("date could not be set");return}const j=q==="from"?c:p;if(!M){j.value=void 0;return}const H=q==="from"?M.startOf("day"):M.endOf("day");j.value=H};return n({setSelectedItemsBasedOnQuery:_}),yt(()=>{_()}),{clearFilter:E,displayedItems:d,isItemSelected:k,selectedItem:u,onShowDrop:D,onHideDrop:$,filterChip:h,toggleItemSelection:y,setSelectedItemsBasedOnQuery:_,fromDate:c,toDate:p,dateRangeValid:V,applyDateRangeFilter:B,dateRangeApplied:L,setDateRangeDate:O,dateRangeClicked:f,currentTheme:l,queryParam:g}}}),LF={class:"flex items-center truncate"},_F={class:"truncate ml-2"},MF={class:"flex"},NF={class:"my-1"},BF={class:"flex items-center truncate"},jF={class:"truncate ml-2"},zF=["textContent"],UF={class:"flex"},VF={class:"flex items-center justify-between mb-4"},qF=["textContent"],HF={class:"mt-2"},WF={class:"date-filter-apply-btn text-end"};function QF(e,t,n,r,o,s){const i=oe("oc-icon"),l=oe("oc-button"),u=oe("oc-list"),d=oe("oc-datepicker"),c=oe("oc-filter-chip");return I(),G("div",{class:R.normalizeClass(["date-filter flex overflow-hidden [&_label]:text-sm",`date-filter-${e.filterName}`])},[J(c,{ref:"filterChip","filter-label":e.filterLabel,"selected-item-names":e.selectedItem?[e.selectedItem[e.displayNameAttribute]]:void 0,onClearFilter:e.clearFilter,onShowDrop:e.onShowDrop,onHideDrop:e.onHideDrop},{default:Z(()=>[J(u,{class:R.normalizeClass({"invisible min-h-[225px] transition-[visibility] duration-[0.4s,0s]":e.dateRangeClicked})},{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.displayedItems,(p,f)=>(I(),G("li",{key:f,class:"my-1 first:mt-0 last:mb-0"},[J(l,{class:R.normalizeClass(["date-filter-list-item flex justify-between items-center w-full p-1",{"date-filter-list-item-active":e.isItemSelected(p)}]),"justify-content":"space-between",appearance:"raw","data-testid":p[e.displayNameAttribute],onClick:h=>e.toggleItemSelection(p)},{default:Z(()=>[Q("div",LF,[Q("div",_F,[Ce(e.$slots,"item",{item:p},void 0,!0)])]),Q("div",MF,[e.isItemSelected(p)?(I(),re(i,{key:0,name:"check"})):le("",!0)])]),_:2},1032,["class","data-testid","onClick"])]))),128)),Q("li",NF,[J(l,{class:R.normalizeClass(["date-filter-list-item flex justify-between items-center w-full p-1",{"date-filter-list-item-active":e.dateRangeApplied}]),"justify-content":"space-between",appearance:"raw","data-testid":"custom-date-range",onClick:t[0]||(t[0]=p=>e.dateRangeClicked=!0)},{default:Z(()=>[Q("div",BF,[Q("div",jF,[Q("span",{textContent:R.toDisplayString(e.$gettext("Custom date range"))},null,8,zF)])]),Q("div",UF,[e.dateRangeApplied?(I(),re(i,{key:0,name:"check"})):le("",!0)])]),_:1},8,["class"])])]),_:3},8,["class"]),Q("div",{class:R.normalizeClass(["date-filter-range-panel absolute top-0 p-2 bg-role-surface",{"transform-[translateX(0)] visible":e.dateRangeClicked,"transform-[translateX(100%)] invisible":!e.dateRangeClicked}])},[Q("div",VF,[J(l,{appearance:"raw",class:"date-filter-range-panel-back","aria-label":e.$gettext("Go back to filter options"),onClick:t[1]||(t[1]=p=>e.dateRangeClicked=!1)},{default:Z(()=>[J(i,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"]),Q("span",{textContent:R.toDisplayString(e.$gettext("Custom date range"))},null,8,qF),J(l,{appearance:"raw",class:"date-filter-range-panel-close","aria-label":e.$gettext("Close filter"),onClick:t[2]||(t[2]=p=>e.filterChip.hideDrop())},{default:Z(()=>[J(i,{name:"close"})]),_:1},8,["aria-label"])]),Q("div",HF,[J(d,{label:e.$gettext("From"),"is-clearable":!0,"current-date":e.fromDate,"is-dark":e.currentTheme.isDark,onDateChanged:t[3]||(t[3]=p=>e.setDateRangeDate(p,"from"))},null,8,["label","current-date","is-dark"]),J(d,{label:e.$gettext("To"),"is-clearable":!0,"current-date":e.toDate,"min-date":e.fromDate?e.fromDate:void 0,"is-dark":e.currentTheme.isDark,onDateChanged:t[4]||(t[4]=p=>e.setDateRangeDate(p,"to"))},null,8,["label","current-date","min-date","is-dark"])]),Q("div",WF,[J(l,{size:"small",disabled:!e.dateRangeValid,onClick:e.applyDateRangeFilter},{default:Z(()=>[ct(R.toDisplayString(e.$gettext("Apply")),1)]),_:1},8,["disabled","onClick"])])],2)]),_:3},8,["filter-label","selected-item-names","onClearFilter","onShowDrop","onHideDrop"])],2)}const KF=Le(OF,[["render",QF],["__scopeId","data-v-80ea8301"]]),GF=ge({name:"ItemFilterInline",props:{filterName:{type:String,required:!0},filterOptions:{type:Array,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=Re(),r=St(),o=W(e.filterOptions[0].name),s=`q_${e.filterName}`,i=Pt(s),l=d=>n.push({query:{...po(a(r).query,[s]),[s]:d}}),u=async d=>{o.value=d.name,await l(d.name),t("toggleFilter",d)};return yt(()=>{const d=at(a(i));d&&e.filterOptions.some(({name:c})=>c===d)&&(o.value=d,t("toggleFilter",e.filterOptions.find(({name:c})=>c===d)))}),{queryParam:s,activeOption:o,toggleFilter:u}}}),JF=["textContent"];function XF(e,t,n,r,o,s){const i=oe("oc-button");return I(),G("div",null,[Q("div",{class:R.normalizeClass(["item-inline-filter inline-flex outline outline-role-secondary outline-offset-[-1px] rounded-full",`item-inline-filter-${e.filterName}`])},[(I(!0),G(Ae,null,Ye(e.filterOptions,(l,u)=>(I(),re(i,{id:l.name,key:u,class:R.normalizeClass(["item-inline-filter-option py-1 px-2 text-xs first:rounded-l-full last:rounded-r-full h-[26px]",{"item-inline-filter-option-selected":e.activeOption===l.name}]),appearance:e.activeOption===l.name?"filled":"raw-inverse","color-role":e.activeOption===l.name?"secondaryContainer":"surface","no-hover":e.activeOption===l.name,onClick:d=>e.toggleFilter(l)},{default:Z(()=>[Q("span",{class:"truncate item-inline-filter-option-label",textContent:R.toDisplayString(l.label)},null,8,JF)]),_:2},1032,["id","class","appearance","color-role","no-hover","onClick"]))),128))],2)])}const YF=Le(GF,[["render",XF]]),ZF={class:"space-quota"},e$=["textContent"],Rg=ge({__name:"SpaceQuota",props:{spaceQuota:{}},setup(e){const{$gettext:t,current:n}=me.useGettext(),r=A(()=>e.spaceQuota.total?t("%{used} of %{total} used (%{percentage}% used)",{used:a(s),total:a(o),percentage:a(i).toString()}):t("%{used} used (no restriction)",{used:a(s)})),o=A(()=>Ht(e.spaceQuota.total,n)),s=A(()=>Ht(e.spaceQuota.used,n)),i=A(()=>parseFloat((e.spaceQuota.used/e.spaceQuota.total*100).toFixed(2))),l=A(()=>e.spaceQuota.state==="normal"?"var(--oc-role-secondary)":"var(--oc-role-error)");return(u,d)=>{const c=oe("oc-progress");return I(),G("div",ZF,[Q("p",{class:"mb-2 mt-0",textContent:R.toDisplayString(r.value)},null,8,e$),J(c,{value:i.value,max:100,size:"small",color:l.value,"background-color":"var(--oc-role-surface)"},null,8,["value","color"])])}}}),t$=ge({name:"WebDavDetails",props:{space:{type:Object,required:!0}},setup(e){const t=Jn("resource"),n="check",r="file-copy",o=W(r),s=W(r),i=A(()=>vl(a(t).webDavPath)),l=A(()=>e.space?.getWebDavUrl({path:a(t).path}));return{copyWebDAVPathIcon:o,copyWebDAVPathToClipboard:()=>{navigator.clipboard.writeText(a(i)),o.value=n,setTimeout(()=>o.value=r,1500)},copyWebDAVUrlIcon:s,copyWebDAVUrlToClipboard:()=>{navigator.clipboard.writeText(a(l)),s.value=n,setTimeout(()=>s.value=r,1500)},webDavPath:i,webDavUrl:l}}}),n$={class:"flex"},r$=["textContent"],o$={class:"flex"},s$=["textContent"];function i$(e,t,n,r,o,s){const i=oe("oc-icon"),l=oe("oc-button"),u=Lt("oc-tooltip");return I(),G(Ae,null,[Q("dt",null,R.toDisplayString(e.$gettext("WebDAV path")),1),Q("dd",n$,[je(Q("div",{class:"truncate",textContent:R.toDisplayString(e.webDavPath)},null,8,r$),[[u,e.webDavPath]]),je((I(),re(l,{class:"ml-2",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV path to clipboard"),"no-hover":"",onClick:e.copyWebDAVPathToClipboard},{default:Z(()=>[J(i,{name:e.copyWebDAVPathIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[u,e.$gettext("Copy WebDAV path")]])]),Q("dt",null,R.toDisplayString(e.$gettext("WebDAV URL")),1),Q("dd",o$,[je(Q("div",{class:"truncate",textContent:R.toDisplayString(e.webDavUrl)},null,8,s$),[[u,e.webDavUrl]]),je((I(),re(l,{class:"ml-2",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV URL to clipboard"),"no-hover":"",onClick:e.copyWebDAVUrlToClipboard},{default:Z(()=>[J(i,{name:e.copyWebDAVUrlIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[u,e.$gettext("Copy WebDAV URL")]])])],64)}const Dg=Le(t$,[["render",i$]]),a$={id:"oc-space-details-sidebar",class:"p-4 bg-role-surface-container rounded-sm"},l$={class:"text-center"},c$={key:1,class:"relative mb-2"},u$=["src"],d$={key:0,class:"flex items-center oc-space-details-sidebar-members mb-2 text-sm gap-2"},f$=["textContent"],p$=["textContent"],h$=["aria-label"],m$=ge({__name:"SpaceDetails",props:{showShareIndicators:{type:Boolean,default:!0}},setup(e){const t=et(),n=De(),{resourceContentsText:r}=ag({showSizeInformation:!1}),o=Re(),{$gettext:s,$ngettext:i,current:l}=me.useGettext(),{loadPreview:u}=Rc(),{openSideBarPanel:d}=_t(),c=He(),{imagesLoading:p}=we.storeToRefs(c),f=tr(),h=Jn("resource"),g=W(""),{user:m}=we.storeToRefs(t),w=A(()=>c.getSpaceMembers(a(h))),T=A(()=>f.linkShares.length),k=A(()=>n.areWebDavDetailsShown),S=A(()=>!st(o,"files-spaces-projects")),y=A(()=>`${Ht(a(h).size,l)}, ${a(r)}`);Ue(()=>a(h).spaceImageData,async()=>{g.value=await u({space:a(h),resource:a(h).spaceImageData?z.buildSpaceImageResource(a(h)):a(h),dimensions:bs.Tile,processor:Ci.enum.fit,cancelRunning:!0,updateStore:!1})},{immediate:!0});const E=A(()=>a(w).length?a(w).filter(z.isManager).map(({sharedWith:H})=>H.id===a(m)?.id?s("%{displayName} (me)",{displayName:H.displayName}):H.displayName).join(", "):z.getSpaceManagers(a(h),f.graphRoles)?.map(({grantedToV2:se})=>se.user?.id===a(m)?.id?s("%{displayName} (me)",{displayName:se.user.displayName}):se.user?.displayName||se.group?.displayName).join(", ")),D=A(()=>gp(a(h).mdate,l)),$=A(()=>a(B)||a(O)),_=A(()=>a(B)&&!a(O)?a(N):!a(B)&&a(O)?a(q):a(M)===1?i("This space has one member and %{linkShareCount} link.","This space has one member and %{linkShareCount} links.",a(T),{linkShareCount:a(T).toString()}):a(T)===1?s("This space has %{memberShareCount} members and one link.",{memberShareCount:a(M).toString()}):s("This space has %{memberShareCount} members and %{linkShareCount} links.",{memberShareCount:a(M).toString(),linkShareCount:a(T).toString()})),L=A(()=>s("Open share panel")),V=A(()=>s("Open link list in share panel")),te=A(()=>s("Open member list in share panel")),B=A(()=>a(M)>0),O=A(()=>a(T)>0),M=A(()=>a(w).length),N=A(()=>i("This space has %{memberShareCount} member.","This space has %{memberShareCount} members.",a(M),{memberShareCount:a(M).toString()})),q=A(()=>i("%{linkShareCount} link giving access.","%{linkShareCount} links giving access.",a(T),{linkShareCount:a(T).toString()}));return(j,H)=>{const se=oe("oc-spinner"),Y=oe("oc-icon"),ae=oe("oc-button"),ne=oe("portal-target");return I(),G("div",a$,[Q("div",l$,[a(p).includes(a(h).id)?(I(),re(se,{key:0,"aria-label":a(s)("Space image is loading")},null,8,["aria-label"])):g.value?(I(),G("div",c$,[Q("img",{src:g.value,alt:"",class:"size-full object-cover aspect-[16/9]"},null,8,u$)])):(I(),re(Y,{key:2,name:"layout-grid",size:"xxlarge",class:"space-default-image px-4 py-4"}))]),e.showShareIndicators&&$.value&&!a(h).disabled?(I(),G("div",d$,[B.value?(I(),re(ae,{key:0,appearance:"raw","aria-label":te.value,"no-hover":"",onClick:H[0]||(H[0]=pe=>a(d)("space-share"))},{default:Z(()=>[J(Y,{name:"group",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):le("",!0),O.value?(I(),re(ae,{key:1,appearance:"raw","aria-label":V.value,"no-hover":"",onClick:H[1]||(H[1]=pe=>a(d)("space-share"))},{default:Z(()=>[J(Y,{name:"link",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):le("",!0),Q("p",{textContent:R.toDisplayString(_.value)},null,8,f$),J(ae,{appearance:"raw","aria-label":L.value,size:"small","no-hover":"",onClick:H[2]||(H[2]=pe=>a(d)("space-share"))},{default:Z(()=>[Q("span",{class:"text-sm",textContent:R.toDisplayString(a(s)("Show"))},null,8,p$)]),_:1},8,["aria-label"])])):le("",!0),Q("dl",{class:"details-list grid grid-cols-[auto_minmax(0,1fr)] m-0","aria-label":a(s)("Overview of the information about the selected space")},[Q("dt",null,R.toDisplayString(a(s)("Last activity")),1),Q("dd",null,R.toDisplayString(D.value),1),a(h).description?(I(),G(Ae,{key:0},[Q("dt",null,R.toDisplayString(a(s)("Subtitle")),1),Q("dd",null,R.toDisplayString(a(h).description),1)],64)):le("",!0),Q("dt",null,R.toDisplayString(a(s)("Manager")),1),Q("dd",null,R.toDisplayString(E.value),1),a(h).disabled?le("",!0):(I(),G(Ae,{key:1},[Q("dt",null,R.toDisplayString(a(s)("Quota")),1),Q("dd",null,[J(Rg,{"space-quota":a(h).spaceQuota},null,8,["space-quota"])])],64)),S.value?(I(),G(Ae,{key:2},[Q("dt",null,R.toDisplayString(a(s)("Size")),1),Q("dd",null,R.toDisplayString(y.value),1)],64)):le("",!0),k.value?(I(),re(Dg,{key:3,space:a(h)},null,8,["space"])):le("",!0),J(ne,{name:"app.files.sidebar.space.details.table","slot-props":{space:a(h),resource:a(h)},multiple:!0},null,8,["slot-props"])],8,h$)])}}}),g$={id:"oc-spaces-details-multiple-sidebar",class:"p-4 bg-role-surface-container rounded-sm"},v$={class:"text-center mb-6 rounded-sm"},y$=["textContent"],b$=ge({__name:"SpaceDetailsMultiple",props:{selectedSpaces:{}},setup(e){const t=me.useGettext(),{$gettext:n,$ngettext:r}=t,o=A(()=>{let f=0;return e.selectedSpaces.forEach(h=>{f+=h.spaceQuota.total}),Ht(f,t.current)}),s=A(()=>{let f=0;return e.selectedSpaces.forEach(h=>{h.disabled||(f+=h.spaceQuota.remaining)}),Ht(f,t.current)}),i=A(()=>{let f=0;return e.selectedSpaces.forEach(h=>{h.disabled||(f+=h.spaceQuota.used)}),Ht(f,t.current)}),l=A(()=>e.selectedSpaces.filter(f=>!f.disabled).length),u=A(()=>e.selectedSpaces.filter(f=>f.disabled).length),d=A(()=>n("Overview of the information about the selected spaces")),c=A(()=>r("%{ itemCount } space selected","%{ itemCount } spaces selected",e.selectedSpaces.length,{itemCount:e.selectedSpaces.length.toString()})),p=A(()=>[{term:n("Total quota:"),definition:a(o).toString()},{term:n("Remaining quota:"),definition:a(s).toString()},{term:n("Used quota:"),definition:a(i).toString()},{term:n("Enabled:"),definition:a(l).toString()},{term:n("Disabled:"),definition:a(u).toString()}]);return(f,h)=>{const g=oe("oc-icon"),m=oe("oc-definition-list");return I(),G("div",g$,[Q("div",v$,[Q("div",null,[J(g,{size:"xxlarge",name:"layout-grid"}),Q("p",{textContent:R.toDisplayString(c.value)},null,8,y$)])]),J(m,{"aria-label":d.value,items:p.value,class:"m-0"},null,8,["aria-label","items"])])}}}),w$=ge({name:"SpaceNoSelection"}),S$={class:"mt-12"},T$={class:"flex flex-col items-center space-info text-center"};function k$(e,t,n,r,o,s){const i=oe("oc-icon"),l=Lt("translate");return I(),G("div",S$,[Q("div",T$,[J(i,{name:"layout-grid",size:"xxlarge"}),je((I(),G("p",null,[...t[0]||(t[0]=[ct("Select a space to view details",-1)])])),[[l]])])])}const C$=Le(w$,[["render",k$]]),x$=ge({name:"CompareSaveDialog",props:{originalObject:{type:Object,required:!0},compareObject:{type:Object,required:!0},confirmButtonDisabled:{type:Boolean,default:()=>!1}},emits:["confirm","revert"],setup(){const e=W(!1);let t;return yt(()=>{t=ze.subscribe("sidebar.entity.saved",()=>{e.value=!0})}),bn(()=>{ze.unsubscribe("sidebar.entity.saved",t)}),{saved:e}},computed:{unsavedChanges(){return!tp(this.originalObject,this.compareObject)},unsavedChangesText(){return this.unsavedChanges?this.$gettext("Unsaved changes"):this.$gettext("No changes")}},watch:{unsavedChanges(){this.unsavedChanges&&(this.saved=!1)},"originalObject.id":function(){this.saved=!1}}}),A$={class:"w-full flex flex-row flex-wrap justify-between items-center"},E$={key:0,class:"flex items-center"},R$=["textContent"],D$={key:1},P$=["textContent"],I$=["textContent"];function F$(e,t,n,r,o,s){const i=oe("oc-icon"),l=oe("oc-button");return I(),G("div",A$,[e.saved?(I(),G("span",E$,[J(i,{name:"checkbox-circle"}),Q("span",{class:"ml-2",textContent:R.toDisplayString(e.$gettext("Changes saved"))},null,8,R$)])):(I(),G("span",D$,R.toDisplayString(e.unsavedChangesText),1)),Q("div",null,[J(l,{disabled:!e.unsavedChanges,class:"compare-save-dialog-revert-btn",onClick:t[0]||(t[0]=u=>e.$emit("revert"))},{default:Z(()=>[Q("span",{textContent:R.toDisplayString(e.$gettext("Revert"))},null,8,P$)]),_:1},8,["disabled"]),J(l,{appearance:"filled",class:"compare-save-dialog-confirm-btn",disabled:!e.unsavedChanges||e.confirmButtonDisabled,onClick:t[1]||(t[1]=u=>e.$emit("confirm"))},{default:Z(()=>[Q("span",{textContent:R.toDisplayString(e.$gettext("Save"))},null,8,I$)]),_:1},8,["disabled"])])])}const $$=Le(x$,[["render",F$]]),O$=ey(async()=>(await Promise.resolve().then(()=>DO)).default),L$=ge({name:"CustomComponentTarget",props:{extensionPoint:{type:Object,required:!0}},setup(e){const t=ho(),n=Sp(),r=A(()=>t.requestExtensions(e.extensionPoint)),o=n.extractDefaultExtensionIds(e.extensionPoint,a(r));return{extensions:A(()=>{if(e.extensionPoint.multiple||a(r).length<=1)return a(r);const i=n.getExtensionPreference(e.extensionPoint.id,o);return i.selectedExtensionIds.length?[a(r).find(l=>i.selectedExtensionIds.includes(l.id))||a(r)[0]]:[a(r)[0]]})}}});function _$(e,t,n,r,o,s){return I(!0),G(Ae,null,Ye(e.extensions,i=>(I(),re(rn(i.content),{key:`custom-component-${i.id}`}))),128)}const M$=Le(L$,[["render",_$]]),N$={class:"flex items-center truncate"},B$={class:"truncate"},j$={class:"flex"},z$=ge({__name:"ItemFilter",props:{filterLabel:{},filterName:{},items:{},optionFilterLabel:{default:""},showOptionFilter:{type:Boolean,default:!1},allowMultiple:{type:Boolean,default:!1},idAttribute:{default:"id"},displayNameAttribute:{default:"name"},filterableAttributes:{default:()=>[]},closeOnClick:{type:Boolean,default:!1}},emits:["selectionChange"],setup(e,{expose:t,emit:n}){const r=n,o=Re(),s=St(),i=nn("filterInputRef"),l=W([]),u=W(e.items),d=nn("itemFilterListRef"),c=`q_${e.filterName}`,p=Pt(c),f=$=>$[e.idAttribute],h=()=>o.push({query:{...po(a(s).query,[c]),...!!a(l).length&&{[c]:a(l).reduce(($,_)=>($+=`${f(_)}+`,$),"").slice(0,-1)}}}),g=$=>!!a(l).find(_=>f(_)===f($)),m=async $=>{g($)?l.value=a(l).filter(_=>f(_)!==f($)):(e.allowMultiple||(l.value=[]),l.value.push($)),await h(),r("selectionChange",a(l))},w=W(),T=($,_)=>{if(!(_||"").trim())return $;const V=new Nc($,{...Wa,keys:e.filterableAttributes}).search(_).map(te=>te.item);return $.filter(te=>V.includes(te))},k=()=>{l.value=[],r("selectionChange",a(l)),h()},S=$=>{u.value=$},y=async()=>{S(e.items),await xt(),a(i)?.focus()};let E;Ue(w,()=>{S(T(e.items,a(w))),a(d)&&(E=new Vc(a(d)),E.unmark(),E.mark(a(w),{element:"span",className:"mark-highlight"}))});const D=()=>{const $=at(a(p));if($){const _=$.split("+");l.value=e.items.filter(L=>_.includes(f(L)))}};return t({setSelectedItemsBasedOnQuery:D}),yt(()=>{D()}),($,_)=>{const L=oe("oc-checkbox"),V=oe("oc-icon"),te=oe("oc-button"),B=oe("oc-list"),O=oe("oc-filter-chip");return I(),G("div",{class:R.normalizeClass(["item-filter flex",`item-filter-${e.filterName}`])},[J(O,{"filter-label":e.filterLabel,"selected-item-names":l.value.map(M=>M[e.displayNameAttribute]),"close-on-click":e.closeOnClick,onClearFilter:k,onShowDrop:y},{default:Z(()=>[e.showOptionFilter&&e.filterableAttributes.length?(I(),re(a(xE),{key:0,ref_key:"filterInputRef",ref:i,modelValue:w.value,"onUpdate:modelValue":_[0]||(_[0]=M=>w.value=M),class:"item-filter-input mb-4 mt-2",autocomplete:"off",label:e.optionFilterLabel===""?$.$gettext("Filter list"):e.optionFilterLabel},null,8,["modelValue","label"])):le("",!0),Q("div",{ref_key:"itemFilterListRef",ref:d},[J(B,{class:"item-filter-list"},{default:Z(()=>[(I(!0),G(Ae,null,Ye(u.value,(M,N)=>(I(),G("li",{key:N,class:"my-1"},[J(te,{class:R.normalizeClass(["item-filter-list-item flex items-center w-full",{"item-filter-list-item-active":!e.allowMultiple&&g(M),"justify-start":e.allowMultiple,"justify-between":!e.allowMultiple}]),"justify-content":"space-between",appearance:"raw","data-test-value":M[e.displayNameAttribute],onClick:q=>m(M)},{default:Z(()=>[Q("div",N$,[e.allowMultiple?(I(),re(L,{key:0,size:"large",class:"mr-2",label:$.$gettext("Toggle selection"),"model-value":g(M),"label-hidden":!0,"onUpdate:modelValue":q=>m(M),onClick:_[1]||(_[1]=wt(()=>{},["stop"]))},null,8,["label","model-value","onUpdate:modelValue"])):le("",!0),Q("div",null,[Ce($.$slots,"image",{item:M})]),Q("div",B$,[Ce($.$slots,"item",{item:M})])]),Q("div",j$,[!e.allowMultiple&&g(M)?(I(),re(V,{key:0,name:"check"})):le("",!0)])]),_:2},1032,["class","data-test-value","onClick"])]))),128))]),_:3})],512)]),_:3},8,["filter-label","selected-item-names","close-on-click"])],2)}}}),U$=ge({name:"ItemFilterToggle",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=Re(),r=St(),o=W(!1),s=`q_${e.filterName}`,i=Pt(s),l=()=>n.push({query:{...po(a(r).query,[s]),...a(o)&&{[s]:"true"}}}),u=async()=>{o.value=!a(o),await l(),t("toggleFilter",a(o))};return yt(()=>{at(a(i))==="true"&&(o.value=!0)}),{queryParam:s,filterActive:o,toggleFilter:u}}});function V$(e,t,n,r,o,s){const i=oe("oc-filter-chip");return I(),G("div",{class:R.normalizeClass(["item-filter flex",`item-filter-${e.filterName}`])},[J(i,{"is-toggle":!0,"filter-label":e.filterLabel,"is-toggle-active":e.filterActive,onToggleFilter:e.toggleFilter,onClearFilter:e.toggleFilter},null,8,["filter-label","is-toggle-active","onToggleFilter","onClearFilter"])],2)}const q$=Le(U$,[["render",V$]]),H$=ge({name:"LoadingIndicator",setup(){const e=Ut();let t,n,r;const o=W(e.isLoading),s=W(e.currentProgress),i=()=>{s.value=e.currentProgress,o.value=e.isLoading},l=()=>{s.value=e.currentProgress};return yt(()=>{t=ze.subscribe(Sr.add,i),n=ze.subscribe(Sr.remove,i),r=ze.subscribe(Sr.setProgress,l)}),bn(()=>{ze.unsubscribe(Sr.add,t),ze.unsubscribe(Sr.remove,n),ze.unsubscribe(Sr.setProgress,r)}),{isLoading:o,currentProgress:s}}}),W$={key:0,id:"oc-loading-indicator",class:"w-full"};function Q$(e,t,n,r,o,s){const i=oe("oc-progress");return e.isLoading?(I(),G("div",W$,[J(i,{max:100,indeterminate:e.currentProgress===null,value:e.currentProgress,size:"xsmall"},null,8,["indeterminate","value"])])):le("",!0)}const K$=Le(H$,[["render",Q$]]),G$={class:"no-content-message flex flex-col justify-center items-center text-center"},J$={class:"text-role-on-surface-variant text-xl"},X$={class:"text-role-on-surface-variant"},Y$=Le(ge({__name:"NoContentMessage",props:{icon:{},iconFillType:{default:"fill"}},setup(e){return(t,n)=>{const r=oe("oc-icon");return I(),G("div",G$,[J(r,{name:e.icon,type:"div",size:"xxlarge","fill-type":e.iconFillType,class:"mb-4"},null,8,["name","fill-type"]),Q("div",J$,[Ce(t.$slots,"message",{},void 0,!0)]),Q("div",X$,[Ce(t.$slots,"callToAction",{},void 0,!0)])])}}}),[["__scopeId","data-v-734c490b"]]),Z$=ge({props:{pages:{type:Number,required:!0},currentPage:{type:Number,required:!0}},watch:{currentPage:{handler:function(){document.getElementsByClassName("files-view-wrapper")[0]?.scrollTo(0,0)}}}});function eO(e,t,n,r,o,s){const i=oe("oc-pagination");return e.pages>1?(I(),re(i,{key:0,pages:e.pages,"current-page":e.currentPage,"max-displayed":3,"current-route":e.$route,class:"files-pagination flex justify-center my-2"},null,8,["pages","current-page","current-route"])):le("",!0)}const tO=Le(Z$,[["render",eO]]),nO=ge({name:"SearchBarFilter",props:{currentFolderAvailable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=me.useGettext(),r=Pt("useScope"),o=W(),s=W(),i=A(()=>n(o.value?.title)),l=A(()=>[{id:jr.currentFolder,title:n("Current folder"),enabled:e.currentFolderAvailable},{id:jr.allFiles,title:n("All files"),enabled:!0}]);return Ue(()=>e.currentFolderAvailable,()=>{if(a(r)){if(a(r).toString()==="true"){o.value=a(l).find(({id:c})=>c===jr.currentFolder);return}o.value=a(l).find(({id:c})=>c===jr.allFiles);return}if(!e.currentFolderAvailable){o.value=a(l).find(({id:d})=>d===jr.allFiles);return}if(a(s)){o.value=a(l).find(({id:d})=>d===a(s).id);return}o.value=a(l).find(({id:d})=>d===jr.allFiles)},{immediate:!0}),{currentSelection:o,currentSelectionTitle:i,onOptionSelected:d=>{s.value=d,o.value=d,t("update:modelValue",{value:d})},locationOptions:l}}}),rO={key:0},oO={key:0,class:"flex"};function sO(e,t,n,r,o,s){const i=oe("oc-icon"),l=oe("oc-button"),u=oe("oc-list"),d=oe("oc-filter-chip");return I(),G("div",{class:"z-[var(--z-index-modal)] absolute top-[50%] transform-[translateY(-50%)] right-0 ml-4 mb-4 mt-0 mr-[34px] float-right","data-testid":"search-bar-filter",onClick:t[0]||(t[0]=wt(()=>{},["stop"]))},[e.currentSelection?(I(),G("div",rO,[J(d,{"is-toggle":!1,"is-toggle-active":!1,"filter-label":e.$gettext("Location filter"),"selected-item-names":[e.currentSelectionTitle],class:"oc-search-bar-filter [&_button]:items-center [&_.oc-drop]:w-45","has-active-state":!1,raw:"","close-on-click":""},{default:Z(()=>[J(u,null,{default:Z(()=>[(I(!0),G(Ae,null,Ye(e.locationOptions,(c,p)=>(I(),G("li",{key:p},[J(l,{appearance:c.id===e.currentSelection.id?"filled":"raw-inverse","color-role":c.id===e.currentSelection.id?"secondaryContainer":"surface","no-hover":c.id===e.currentSelection.id,size:"medium",class:"flex items-center w-full py-1 px-2","justify-content":"space-between",disabled:!c.enabled,"data-test-id":c.id,onClick:f=>e.onOptionSelected(c)},{default:Z(()=>[Q("span",null,R.toDisplayString(c.title),1),c.id===e.currentSelection.id?(I(),G("div",oO,[J(i,{name:"check"})])):le("",!0)]),_:2},1032,["appearance","color-role","no-hover","disabled","data-test-id","onClick"])]))),128))]),_:1})]),_:1},8,["filter-label","selected-item-names"])])):le("",!0)])}const iO=Le(nO,[["render",sO]]),aO=ge({__name:"PortalTarget",setup(e){const t={...Rs.PortalTarget.props},n=A(()=>t);return yt(()=>{ze.publish(sa.mounted,t)}),(r,o)=>(I(),re(a(Rs.PortalTarget),R.normalizeProps(Wu(n.value)),null,16))}}),lO={key:0},cO={key:0,class:"version-check-loading flex items-center"},uO=["textContent"],dO={key:0,class:"version-check-no-updates flex items-center"},fO=["textContent"],pO=["textContent"],hO=ge({__name:"VersionCheck",setup(e){const{$gettext:t}=me.useGettext(),n=Dt(),r=th(),o=n.capabilities.core["check-for-updates"],{updates:s,isLoading:i,hasError:l}=we.storeToRefs(r),u=A(()=>o&&!a(l)),d=W(!1),c=W(),p=n.status.edition||"rolling",h=n.status.productversion.split("+")[0];return Ue(()=>s,()=>{if(!a(s))return;const g=a(s).channels[p].current_version;bl(g,h)>0&&(d.value=!0,c.value=a(s).channels[p])},{immediate:!0,deep:!0}),(g,m)=>{const w=oe("oc-spinner"),T=oe("oc-icon"),k=oe("oc-button");return u.value?(I(),G("div",lO,[a(i)?(I(),G("div",cO,[Q("span",{textContent:R.toDisplayString(a(t)("Checking for updates"))},null,8,uO),J(w,{class:"ml-1",size:"xsmall"})])):(I(),G(Ae,{key:1},[d.value?(I(),re(k,{key:1,class:"version-check-update text-role-on-surface-variant",size:"small",type:"a",href:c.value.url,target:"_blank","gap-size":"small",appearance:"raw","no-hover":""},{default:Z(()=>[Q("span",{class:"text-xs",textContent:R.toDisplayString(a(t)("Version %{version} available",{version:c.value.current_version}))},null,8,pO),J(T,{name:"refresh",size:"xsmall","fill-type":"line"})]),_:1},8,["href"])):(I(),G("div",dO,[Q("span",{textContent:R.toDisplayString(a(t)("Up to date"))},null,8,fO),J(T,{class:"ml-0.5",name:"checkbox-circle",size:"xsmall","fill-type":"line"})]))],64))])):le("",!0)}}}),mO={toolbarTips:{bold:"Gras",underline:"Souligné",italic:"Italique",strikeThrough:"Barré",title:"Titre",sub:"Indice",sup:"Exposant",quote:"Citation",unorderedList:"Liste",orderedList:"Liste numérique",task:"Liste de tâche",codeRow:"Code intégré",code:"Bloc de code",link:"Lien",image:"Image",table:"Table",mermaid:"Organigramme",katex:"Formule",revoke:"Annuler",next:"Refaire",save:"Sauvegarder",prettier:"Sublimer",pageFullscreen:"Passer en pleine page",fullscreen:"Passer en plein écran",preview:"Prévisualiser",htmlPreview:"Prévisualiser le HTML",catalog:"Table des matières",github:"Code source de l'editeur"},titleItem:{h1:"Titre niveau 1",h2:"Titre niveau 2",h3:"Titre niveau 3",h4:"Titre niveau 4",h5:"Titre niveau 5",h6:"Titre niveau 6"},imgTitleItem:{link:"Ajouter depuis une url",upload:"Télécharger une image",clip2upload:"Télécharger et recadrer"},linkModalTips:{linkTitle:"Ajouter un lien",imageTitle:"Ajouter une image depuis une url",descLabel:"Texte : ",descLabelPlaceHolder:"Entrez un texte...",urlLabel:"Url : ",urlLabelPlaceHolder:"Entrez une url...",buttonOK:"Valider"},clipModalTips:{title:"Télécharger et recadrer une image",buttonUpload:"Valider"},copyCode:{text:"Copier le code",successTips:"Copié",failTips:"La copie a échoué!"},mermaid:{flow:"Organigramme",sequence:"Chronogramme",gantt:"Diagramme de Gantt",class:"Diagramme de classes",state:"Diagramme d'état",pie:"Diagramme circulaire",relationship:"Diagramme de relation",journey:"Diagramme de tâches"},katex:{inline:"Formule en ligne",block:"Formule en bloc"},footer:{markdownTotal:"Nombre de mots",scrollAuto:"Défilement synchronisé"}},gO={toolbarTips:{bold:"Fett",underline:"Unterstrichen",italic:"Kursiv",strikeThrough:"Durchgestrichen",title:"Titel",sub:"Tiefgestellt",sup:"Hochgestellt",quote:"Zitat",unorderedList:"Ungeordnete Liste",orderedList:"Geordnete Liste",task:"Aufgabenliste",codeRow:"Eingebetteter Code",code:"Codeblock",link:"Link",image:"Bild",table:"Tabelle",mermaid:"Flussdiagramm",katex:"Formel",revoke:"Rückgängig machen",next:"Wiederherstellen",save:"Speichern",prettier:"Verschönern",pageFullscreen:"Vollbildmodus",fullscreen:"Vollbild",preview:"Vorschau",htmlPreview:"HTML Vorschau",catalog:"Inhaltsverzeichnis",github:"Quellcode des Editors"},titleItem:{h1:"Überschrift Ebene 1",h2:"Überschrift Ebene 2",h3:"Überschrift Ebene 3",h4:"Überschrift Ebene 4",h5:"Überschrift Ebene 5",h6:"Überschrift Ebene 6"},imgTitleItem:{link:"Bildlink hinzufügen",upload:"Bild hochladen",clip2upload:"Bild zuschneiden und hochladen"},linkModalTips:{linkTitle:"Link hinzufügen",imageTitle:"Bild von URL hinzufügen",descLabel:"Text: ",descLabelPlaceHolder:"Text eingeben...",urlLabel:"URL: ",urlLabelPlaceHolder:"URL eingeben...",buttonOK:"Bestätigen"},clipModalTips:{title:"Bild zuschneiden und hochladen",buttonUpload:"Hochladen"},copyCode:{text:"Code kopieren",successTips:"Kopiert!",failTips:"Kopieren fehlgeschlagen!"},mermaid:{flow:"Flussdiagramm",sequence:"Sequenzdiagramm",gantt:"Gantt-Diagramm",class:"Klassendiagramm",state:"Zustandsdiagramm",pie:"Kreisdiagramm",relationship:"Beziehungsdiagramm",journey:"Reisediagramm"},katex:{inline:"Inline-Formel",block:"Blockformel"},footer:{markdownTotal:"Zeichenanzahl",scrollAuto:"Automatisches Scrollen"}},vO={toolbarTips:{bold:"Grassetto",underline:"Sottolineato",italic:"Corsivo",strikeThrough:"Barrato",title:"Titolo",sub:"Indice",sup:"Esponente",quote:"Citazione",unorderedList:"Elenco non ordinato",orderedList:"Elenco ordinato",task:"Lista di compiti",codeRow:"Codice incorporato",code:"Blocco di codice",link:"Link",image:"Immagine",table:"Tabella",mermaid:"Diagramma",katex:"Formula",revoke:"Annulla",next:"Ripristina",save:"Salva",prettier:"Formatta",pageFullscreen:"Pagina a schermo intero",fullscreen:"Schermo intero",preview:"Anteprima",htmlPreview:"Anteprima HTML",catalog:"Indice",github:"Codice sorgente dell'editor"},titleItem:{h1:"Intestazione Livello 1",h2:"Intestazione Livello 2",h3:"Intestazione Livello 3",h4:"Intestazione Livello 4",h5:"Intestazione Livello 5",h6:"Intestazione Livello 6"},imgTitleItem:{link:"Aggiungi link immagine",upload:"Carica immagine",clip2upload:"Ritaglia e carica immagine"},linkModalTips:{linkTitle:"Aggiungi link",imageTitle:"Aggiungi immagine da URL",descLabel:"Testo: ",descLabelPlaceHolder:"Inserisci il testo...",urlLabel:"URL: ",urlLabelPlaceHolder:"Inserisci l'URL...",buttonOK:"Conferma"},clipModalTips:{title:"Ritaglia e carica immagine",buttonUpload:"Carica"},copyCode:{text:"Copia codice",successTips:"Copiato!",failTips:"Copia fallita!"},mermaid:{flow:"Diagramma di flusso",sequence:"Diagramma di sequenza",gantt:"Diagramma di Gantt",class:"Diagramma di classe",state:"Diagramma di stato",pie:"Diagramma a torta",relationship:"Diagramma di relazione",journey:"Diagramma di viaggio"},katex:{inline:"Formula in linea",block:"Formula a blocco"},footer:{markdownTotal:"Conteggio parole",scrollAuto:"Scorrimento automatico"}},yO={toolbarTips:{bold:"Negrita",underline:"Subrayado",italic:"Cursiva",strikeThrough:"Tachado",title:"Título",sub:"Subíndice",sup:"Superíndice",quote:"Cita",unorderedList:"Lista desordenada",orderedList:"Lista ordenada",task:"Lista de tareas",codeRow:"Código en línea",code:"Bloque de código",link:"Enlace",image:"Imagen",table:"Tabla",mermaid:"Diagrama",katex:"Fórmula",revoke:"Deshacer",next:"Rehacer",save:"Guardar",prettier:"Formatear",pageFullscreen:"Página en pantalla completa",fullscreen:"Pantalla completa",preview:"Vista previa",htmlPreview:"Vista previa del HTML",catalog:"Índice",github:"Código fuente del editor"},titleItem:{h1:"Encabezado de nivel 1",h2:"Encabezado de nivel 2",h3:"Encabezado de nivel 3",h4:"Encabezado de nivel 4",h5:"Encabezado de nivel 5",h6:"Encabezado de nivel 6"},imgTitleItem:{link:"Agregar enlace de imagen",upload:"Subir imagen",clip2upload:"Recortar y subir imagen"},linkModalTips:{linkTitle:"Agregar enlace",imageTitle:"Agregar imagen desde URL",descLabel:"Texto: ",descLabelPlaceHolder:"Introduce el texto...",urlLabel:"Enlace: ",urlLabelPlaceHolder:"Introduce el enlace...",buttonOK:"Confirmar"},clipModalTips:{title:"Recortar y subir imagen",buttonUpload:"Subir"},copyCode:{text:"Copiar código",successTips:"¡Copiado!",failTips:"¡Copia fallida!"},mermaid:{flow:"Diagrama de flujo",sequence:"Diagrama de secuencia",gantt:"Diagrama de Gantt",class:"Diagrama de clase",state:"Diagrama de estado",pie:"Diagrama de pastel",relationship:"Diagrama de relación",journey:"Diagrama de viaje"},katex:{inline:"Fórmula en línea",block:"Fórmula de bloque"},footer:{markdownTotal:"Conteo de letras",scrollAuto:"Desplazamiento automático"}},bO={toolbarTips:{bold:"Pogrubienie",underline:"Podkreślenie",italic:"Kursywa",strikeThrough:"Przekreślenie",title:"Tytuł",sub:"Indeks dolny",sup:"Indeks górny",quote:"Cytat",unorderedList:"Lista nieuporządkowana",orderedList:"Lista uporządkowana",task:"Lista zadań",codeRow:"Wbudowany kod",code:"Blok kodu",link:"Link",image:"Obraz",table:"Tabela",mermaid:"Schemat przepływu",katex:"Formuła",revoke:"Cofnij",next:"Przywróć",save:"Zapisz",prettier:"Upiększ",pageFullscreen:"Pełny ekran strony",fullscreen:"Pełny ekran",preview:"Podgląd",htmlPreview:"Podgląd HTML",catalog:"Spis treści",github:"Kod źródłowy edytora"},titleItem:{h1:"Nagłówek poziom 1",h2:"Nagłówek poziom 2",h3:"Nagłówek poziom 3",h4:"Nagłówek poziom 4",h5:"Nagłówek poziom 5",h6:"Nagłówek poziom 6"},imgTitleItem:{link:"Dodaj link do obrazu",upload:"Prześlij obraz",clip2upload:"Przytnij i prześlij obraz"},linkModalTips:{linkTitle:"Dodaj link",imageTitle:"Dodaj obraz z URL",descLabel:"Tekst: ",descLabelPlaceHolder:"Wpisz tekst...",urlLabel:"URL: ",urlLabelPlaceHolder:"Wpisz URL...",buttonOK:"Potwierdź"},clipModalTips:{title:"Przytnij i prześlij obraz",buttonUpload:"Prześlij"},copyCode:{text:"Skopiuj kod",successTips:"Skopiowano!",failTips:"Nie udało się skopiować!"},mermaid:{flow:"Schemat przepływu",sequence:"Schemat sekwencji",gantt:"Wykres Gantta",class:"Diagram klas",state:"Diagram stanów",pie:"Diagram kołowy",relationship:"Diagram relacji",journey:"Diagram podróży"},katex:{inline:"Formuła inline",block:"Formuła blokowa"},footer:{markdownTotal:"Liczba znaków",scrollAuto:"Automatyczne przewijanie"}},wO={toolbarTips:{bold:"жирный",underline:"подчёркнутый",italic:"курсив",strikeThrough:"зачёркнутый",title:"заголовок",sub:"нижний индекс",sup:"верхний индекс",quote:"цитата",unorderedList:"неупорядоченный список",orderedList:"упорядоченный список",task:"список задач",codeRow:"встроенный код",code:"блочный код",link:"ссылка",image:"изображение",table:"таблица",mermaid:"диаграмма",katex:"формула",revoke:"отмена",next:"вернуть",save:"сохранить",prettier:"форматировать",pageFullscreen:"на всю страницу",fullscreen:"на весь экран",preview:"превью",previewOnly:"только превью",htmlPreview:"превью html",catalog:"каталог",github:"исходный код"},titleItem:{h1:"Заголовок 1-го ур.",h2:"Заголовок 2-го ур.",h3:"Заголовок 3-го ур.",h4:"Заголовок 4-го ур.",h5:"Заголовок 5-го ур.",h6:"Заголовок 6-го ур."},imgTitleItem:{link:"Добавить ссылку на изображение",upload:"Загрузить изображение",clip2upload:"Из буфера обмена"},linkModalTips:{linkTitle:"Добавить ссылку",imageTitle:"Добавить изображение",descLabel:"Описание:",descLabelPlaceHolder:"Введите описание...",urlLabel:"Ссылка:",urlLabelPlaceHolder:"Введите ссылку...",buttonOK:"ОК"},clipModalTips:{title:"Обрезать изображение",buttonUpload:"Загрузить"},copyCode:{text:"Скопировать",successTips:"Скопировано!",failTips:"Не удалось скопировать!"},mermaid:{flow:"цепная",sequence:"последовательная",gantt:"временная",class:"структурная",state:"статусная",pie:"круговая",relationship:"реляционная",journey:"путешествия"},katex:{inline:"встроенная",block:"блочная"},footer:{markdownTotal:"Кол-во символов",scrollAuto:"Автопрокрутка"}},SO={toolbarTips:{bold:"太字",underline:"下線",italic:"斜体",strikeThrough:"取り消し線",title:"タイトル",sub:"下付き文字",sup:"上付き文字",quote:"引用",unorderedList:"番号なし箇条書き",orderedList:"番号付の箇条書き",task:"タスクリスト",codeRow:"インラインコード",code:"ブロックコード",link:"リンク",image:"イメージ",table:"テーブル",mermaid:"mermaid図",katex:"katex数式",revoke:"後退",next:"前進",save:"保存",prettier:"フォーマット",pageFullscreen:"ブラウザのフルスクリーン",fullscreen:"フルスクリーン",preview:"プレビュー",htmlPreview:"htmlプレビュー",catalog:"目次",github:"ギットハブ"},titleItem:{h1:"見出し1",h2:"見出し2",h3:"見出し3",h4:"見出し4",h5:"見出し5",h6:"見出し6"},imgTitleItem:{link:"リンク",upload:"アップロード",clip2upload:"トリミングアップロード"},linkModalTips:{linkTitle:"追加",imageTitle:"イメージ追加",descLabel:"リンクの説明:",descLabelPlaceHolder:"説明を入力してください...",urlLabel:"リンクアドレス:",urlLabelPlaceHolder:"リンクを入力してください...",buttonOK:"確定"},clipModalTips:{title:"トリミング画像のアップロード",buttonUpload:"アップロード"},copyCode:{text:"コードをコピー",successTips:"コピー成功!",failTips:"コピー失敗!"},mermaid:{flow:"フローチャート",sequence:"タイミング図",gantt:"ガントチャート",class:"クラス図",state:"状態図",pie:"円グラフ",relationship:"関係図",journey:"旅路図"},katex:{inline:"インライン数式",block:"ブロック数式"},footer:{markdownTotal:"単語数",scrollAuto:"同期スクロール"}},TO={toolbarTips:{bold:"tebal",underline:"garis bawah",italic:"miring",strikeThrough:"coret sambung",title:"judul",sub:"subscript",sup:"superscript",quote:"quote",unorderedList:"daftar tak berurutan",orderedList:"daftar berurutan",task:"daftar tugas",codeRow:"kode inline",code:"kode blok",link:"tautan",image:"gambar",table:"tabel",mermaid:"mermaid",katex:"rumus",revoke:"membatalkan",next:"membatalkan pembatalan",save:"simpan",prettier:"penataan",pageFullscreen:"layar penuh di halaman",fullscreen:"layar penuh",preview:"pratinjau",htmlPreview:"pratinjau html",catalog:"daftar isi",github:"kode sumber"},titleItem:{h1:"Judul 1",h2:"Judul 2",h3:"Judul 3",h4:"Judul 4",h5:"Judul 5",h6:"Judul 6"},imgTitleItem:{link:"Tambahkan Tautan Gambar",upload:"Unggah Gambar",clip2upload:"Potong dan Unggah"},linkModalTips:{linkTitle:"Tambahkan Tautan",imageTitle:"Tambahkan Gambar",descLabel:"Deskripsi:",descLabelPlaceHolder:"Masukkan deskripsi...",urlLabel:"Tautan:",urlLabelPlaceHolder:"Masukkan tautan...",buttonOK:"OK"},clipModalTips:{title:"Potong dan Unggah Gambar",buttonUpload:"Unggah"},copyCode:{text:"Salin",successTips:"Tersalin!",failTips:"Gagal menyalin!"},mermaid:{flow:"diagram aliran",sequence:"diagram urutan",gantt:"diagram gantt",class:"diagram kelas",state:"diagram status",pie:"diagram pie",relationship:"diagram hubungan",journey:"diagram perjalanan"},katex:{inline:"rumus inline",block:"rumus blok"},footer:{markdownTotal:"Jumlah Kata",scrollAuto:"Gulir Otomatis"}},kO={zh:"zh-CN",fr:"fr-FR",ja:"jp-JP",id:"id-ID",ru:"ru",de:"de-DE",it:"it-IT",es:"es-ES",pl:"pl-PL",en:"en-US"},CO={"fr-FR":mO,"de-DE":gO,"it-IT":vO,"es-ES":yO,"pl-PL":bO,ru:wO,"jp-JP":SO,"id-ID":TO},xO=ge({name:"TextEditor",components:{MdEditor:Ro.MdEditor,MdPreview:Ro.MdPreview,NormalToolbar:Ro.NormalToolbar},props:{applicationConfig:{type:Object,required:!1},currentContent:{type:String,required:!0},markdownMode:{type:Boolean,required:!1,default:!1},isReadOnly:{type:Boolean,required:!1,default:!1},resource:{type:Object,required:!1}},emits:["update:currentContent"],setup(e,{emit:t}){const n=me.useGettext(),{currentTheme:r}=Bn(),o=W(!0),s=A(()=>{const{showPreviewOnlyMd:c=!0}=e.applicationConfig;return{showPreviewOnlyMd:c}}),i=A(()=>e.markdownMode||["md","markdown"].includes(e.resource?.extension)||!a(s).showPreviewOnlyMd),l=A(()=>a(r).isDark?"dark":"light"),u=A(()=>a(i)?["bold","underline","italic","-","title","strikeThrough","sub","sup","quote","unorderedList","orderedList","task","-","codeRow","code","link","image","table","-","revoke","next","=",0,"preview","previewOnly"]:["revoke","next","=",0]);return Ro.config({editorConfig:{languageUserDefined:CO},editorExtensions:{screenfull:{instance:Bg},cropper:{instance:ca}},markdownItPlugins(c){return[...c,{type:"xss",plugin:Ro.XSSPlugin,options:{}}]},codeMirrorExtensions(c){const p=[...c,{type:"lineNumbers",extension:jg.lineNumbers()}],f=p.find(h=>h.type==="linkShortener");return f&&(f.options.maxLength=120),a(i)?p:p.filter(h=>["lineWrapping","keymap","floatingToolbar","lineNumbers"].includes(h.type))}}),{isMarkdown:i,theme:l,toolbars:u,language:n,languages:kO,onUploadImg:async c=>{const f=(await Promise.all([...c].map(g=>new Promise((m,w)=>{const T=new FileReader;T.onload=()=>m(T.result),T.onerror=w,T.readAsDataURL(g)})))).map(g=>`![image](${g})`),h=`${a(e.currentContent)}
33
+ ${f.join(`
66
34
 
67
35
  `)}
68
- `;t("update:currentContent",m)},showLineNumbers:i}}}),b8={id:"text-editor-container",class:"h-full [&_.md-editor-preview]:!font-(family-name:--oc-font-family)"},w8={key:0};function S8(e,t,n,r,i,o){const s=Ee("md-preview"),a=Ee("oc-icon"),l=Ee("NormalToolbar"),u=Ee("md-editor");return Y(),pe("div",b8,[e.isReadOnly?(Y(),pe("article",w8,[me(s,{id:"text-editor-preview-component","model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-upload-img":"","no-highlight":"","no-echarts":"",language:e.languages[e.language.current]||"en-US",theme:e.theme,"auto-focus":"","read-only":""},null,8,["model-value","language","theme"])])):(Y(),Te(u,{key:1,id:"text-editor-component",class:q.normalizeClass([{"no-line-numbers":!e.showLineNumbers},"[&_.cm-content]:!font-(family-name:--oc-font-family)"]),"model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-highlight":"","no-echarts":"","on-upload-img":e.onUploadImg,language:e.languages[e.language.current]||"en-US",theme:e.theme,preview:e.isMarkdown,toolbars:e.toolbars,"auto-focus":"",onOnChange:t[1]||(t[1]=c=>e.$emit("update:currentContent",c))},{defToolbars:ve(()=>[me(l,{title:e.showLineNumbers?e.$gettext("hide line numbers"):e.$gettext("show line numbers"),onOnClick:t[0]||(t[0]=c=>e.showLineNumbers=!e.showLineNumbers)},{default:ve(()=>[me(a,{class:"!flex items-center justify-center size-6",size:"small",name:"hashtag","fill-type":"none"})]),_:1},8,["title"])]),_:1},8,["class","model-value","on-upload-img","language","theme","preview","toolbars"]))])}const E8=Object.freeze(Object.defineProperty({__proto__:null,default:Xe(v8,[["render",S8]])},Symbol.toStringTag,{value:"Module"}));$.AVATAR_UPLOAD_MAX_FILE_SIZE_MB=Pd,$.AccountCapabilitiesSchema=Vb,$.AccountSchema=zb,$.AccountsSchema=Hb,$.ActionMenuDropItem=lS,$.ActionMenuItem=nl,$.ApiError=Ux,$.AppBar=N$,$.AppLoadingSpinner=Dd,$.AppProviderService=Fx,$.AppTopBar=fS,$.AppWrapper=gS,$.AppWrapperRoute=LM,$.ArchiverService=qx,$.Auth=Ac,$.AvatarUpload=eB,$.BatchActions=aS,$.Cache=uc,$.ClientService=Jx,$.ClipboardActions=jo,$.CompareSaveDialog=Aj,$.ConflictDialog=Ul,$.ContextActionMenu=rl,$.ContextActions=cS,$.ContextMenuQuickAction=zd,$.CreateLinkModal=y0,$.CreateShortcutModal=S0,$.CreateSpace=B$,$.CustomComponentTarget=kj,$.DateFilter=BB,$.DatePickerModal=vM,$.EVENT_FILE_DROPPED=E2,$.EVENT_TROW_CONTEXTMENU=T2,$.EVENT_TROW_MOUNTED=S2,$.EmojiPickerModal=G0,$.EventBus=Am,$.FileInfo=qd,$.FilePickerModal=C0,$.FileSideBar=pS,$.FolderLoaderFavorites=wv,$.FolderLoaderSharedViaLink=Sv,$.FolderLoaderSharedWithMe=Ev,$.FolderLoaderSharedWithOthers=Tv,$.FolderLoaderSpace=bv,$.FolderLoaderTrashbin=Av,$.FolderService=xv,$.FolderViewModeConstants=tn,$.HttpClient=xc,$.IdentitySchema=qb,$.ImageDimension=os,$.ImageType=A2,$.ItemFilter=Fj,$.ItemFilterInline=qB,$.ItemFilterToggle=Nj,$.Key=dr,$.LimitsSchema=Wb,$.LinkRoleDropdown=g0,$.LoadingEventTopics=Gr,$.LoadingIndicator=Bj,$.LoadingService=Ek,$.MailCapabilitiesSchema=jb,$.MimeTypesToAppsSchema=Sm,$.Modifier=Oa,$.NoContentMessage=qj,$.Pagination=Hj,$.PaginationConstants=oo,$.PasswordPolicyService=wP,$.PortalTarget=e8,$.PortalTargetEventTopics=tl,$.PreviewService=pP,$.PrimaryAccountsSchema=Kb,$.ProcessorType=ya,$.QuotaModal=q0,$.QuotaSelect=V0,$.RESOURCE_MAX_CHARACTER_LENGTH=x2,$.RESOURCE_NAME_MAX_BYTES=Id,$.RawConfigSchema=vO,$.RawGroupwareConfigSchema=AF,$.ResolveStrategy=Kn,$.ResourceConflictModal=Sh,$.ResourceGhostElement=Wd,$.ResourceIcon=ss,$.ResourceLink=Ka,$.ResourceListItem=as,$.ResourceName=Od,$.ResourcePreview=w0,$.ResourceSize=yS,$.ResourceTable=lB,$.ResourceTile=bS,$.ResourceTiles=AB,$.ResourceTransfer=Th,$.RuntimeError=ji,$.SaveAsModal=I0,$.SearchBarFilter=Yj,$.SearchLocationFilterConstants=mi,$.SideBar=dS,$.SideBarEventTopics=Ct,$.SieveCapabilitiesSchema=Ub,$.SortConstants=Po,$.SortDir=Qt,$.SpaceDetails=sj,$.SpaceDetailsMultiple=uj,$.SpaceImageModal=F0,$.SpaceInfo=Vd,$.SpaceMoveInfoModal=wh,$.SpaceNoSelection=mj,$.SpaceQuota=wS,$.TextEditor=xj,$.ThemeConfig=wF,$.TransferType=Er,$.UnsavedChangesModal=hS,$.UppyService=CP,$.UserAvatar=il,$.VersionCheck=a8,$.ViewOptions=uS,$.VisibilityObserver=b0,$.WebDavDetails=SS,$.WebThemeConfig=Lb,$.activeApp=cc,$.authContextValues=ax,$.blobToArrayBuffer=ub,$.breadcrumbsFromPath=HI,$.buildRoutes=OF,$.buildUrl=cx,$.cacheService=Tc,$.canvasToBlob=fb,$.cloneStateObject=vh,$.compareVersions=Ec,$.concatBreadcrumbs=KI,$.contextQueryToFileContextProps=Xb,$.contextRouteNameKey=Ca,$.contextRouteParamsKey=Zf,$.contextRouteQueryKey=ed,$.convertToMinimalUppyFile=Wv,$.createDefaultFileIconMapping=xh,$.createFileRouteOptions=ar,$.createFolderDummyFile=zv,$.createLocation=Li,$.createLocationCommon=$i,$.createLocationPublic=Mi,$.createLocationShares=Dn,$.createLocationSpaces=Qn,$.createLocationTrash=Hr,$.defaultFuseOptions=Vl,$.defineWebApplication=_S,$.determineResourceTableSortFields=bm,$.determineResourceTilesSortFields=kx,$.dirname=ct.dirname,$.displayPositionedDropdown=Qf,$.encodePath=wc,$.eventBus=Je,$.filterResources=$E,$.focusCheckbox=dx,$.folderService=Cv,$.formatDateFromDateTime=fi,$.formatDateFromHTTP=GI,$.formatDateFromISO=ib,$.formatDateFromJSDate=rb,$.formatDateFromRFC=QI,$.formatFileSize=bn,$.formatRelativeDateFromDateTime=Uo,$.formatRelativeDateFromHTTP=XI,$.formatRelativeDateFromISO=YI,$.formatRelativeDateFromJSDate=ob,$.formatRelativeDateFromRFC=JI,$.getIndicators=cb,$.getLocaleFromLanguage=wa,$.getParentPaths=sb,$.getSharedAncestorRoute=fx,$.getSharedDriveItem=Gs,$.getSpacesByType=zo,$.getTextByteSize=Yf,$.isItemInCurrentFolder=Ch,$.isLocationActive=PF,$.isLocationActiveDirector=Ni,$.isLocationCommonActive=It,$.isLocationPublicActive=Rn,$.isLocationSharesActive=Bt,$.isLocationSpacesActive=pt,$.isLocationTrashActive=dn,$.isMacOs=Vo,$.isPromiseFulfilled=di,$.isPromiseRejected=pi,$.isResourceBeeingMovedToSameLocation=Eh,$.isSameResource=So,$.locationPublicLink=ac,$.locationPublicUpload=lc,$.locationSharesViaLink=sc,$.locationSharesWithMe=Ks,$.locationSharesWithOthers=oc,$.locationSpacesGeneric=ic,$.objectKeys=Vx,$.parseVersion=Sc,$.queryItemAsString=Rt,$.renameResource=ql,$.resolveFileNameDuplicate=Hn,$.resourceIconMappingInjectionKey=Ah,$.routeToContextQuery=Ra,$.setCurrentUserShareSpacePermissions=um,$.sortFields=wm,$.sortHelper=ym,$.sortSpaceMembers=Mb,$.translateSortFields=Px,$.triggerDownloadWithFilename=bc,$.useAbility=fn,$.useActionsShowDetails=$L,$.useActiveApp=lx,$.useActiveLocation=Yn,$.useAppConfig=lm,$.useAppDefaults=rw,$.useAppFileHandling=td,$.useAppFolderHandling=Jb,$.useAppMeta=id,$.useAppNavigation=Yb,$.useAppProviderService=BL,$.useAppsStore=lr,$.useArchiverService=E0,$.useAuthService=nd,$.useAuthStore=li,$.useAvatarsStore=Ta,$.useBreadcrumbsFromPath=jL,$.useCanBeOpenedWithSecureView=J0,$.useCanListShares=D0,$.useCanListVersions=Z0,$.useCanShare=N0,$.useCapabilityStore=Zt,$.useClientService=He,$.useClipboard=UL,$.useClipboardStore=qo,$.useConfigStore=ut,$.useCopyLink=kd,$.useCreateSpace=Xi,$.useCropperKeyboardActions=od,$.useDeleteWorker=iw,$.useDocumentTitle=Zb,$.useDownloadFile=T0,$.useDriveResolver=nw,$.useEmbedMode=Qr,$.useEventBus=fr,$.useExtensionPreferencesStore=pb,$.useExtensionRegistry=Ki,$.useFileActions=Jn,$.useFileActionsCopy=Ia,$.useFileActionsCopyPermanentLink=sd,$.useFileActionsCreateLink=v2,$.useFileActionsCreateNewFile=b2,$.useFileActionsCreateNewFolder=w2,$.useFileActionsCreateNewShortcut=J2,$.useFileActionsCreateSpaceFromResource=Fd,$.useFileActionsDelete=ls,$.useFileActionsDeleteResources=$0,$.useFileActionsDisableSync=Ga,$.useFileActionsDownloadArchive=Qa,$.useFileActionsDownloadFile=cs,$.useFileActionsEmptyTrashBin=Z2,$.useFileActionsEnableSync=Xa,$.useFileActionsFavorite=_d,$.useFileActionsMove=Ya,$.useFileActionsNavigate=A0,$.useFileActionsOpenShortcut=tL,$.useFileActionsOpenWithApp=k0,$.useFileActionsOpenWithDefault=x0,$.useFileActionsPaste=P0,$.useFileActionsRename=Ja,$.useFileActionsRestore=us,$.useFileActionsSaveAs=O0,$.useFileActionsSetImage=_0,$.useFileActionsShowActions=vL,$.useFileActionsShowDetails=Nd,$.useFileActionsShowShares=Ld,$.useFileActionsToggleHideShare=Za,$.useFileActionsUndoDelete=L0,$.useFileListHeaderPosition=VL,$.useFileRouteReplace=Aa,$.useFolderLink=Yr,$.useGetMatchingSpace=ln,$.useGetResourceContext=eS,$.useGroupwareConfigStore=TF,$.useInterceptModifierClick=gi,$.useIsAppActive=M0,$.useIsFilesAppActive=Dr,$.useIsResourceNameValid=Ei,$.useIsSearchActive=el,$.useIsTopBarSticky=$d,$.useKeyboardActions=Fa,$.useLinkTypes=Ha,$.useLoadAvatars=sS,$.useLoadPreview=Bd,$.useLoadingService=yn,$.useLocalStorage=Xf,$.useMessages=tt,$.useModals=ft,$.useOpenEmptyEditor=ML,$.useOpenWithDefaultApp=W0,$.usePagination=qL,$.usePasswordPolicyService=X0,$.usePasteWorker=ow,$.usePortalTarget=HL,$.usePreviewService=Y0,$.useRequest=ew,$.useRequestHeaders=Pa,$.useResourceContents=nS,$.useResourceRouteResolver=R0,$.useResourceViewContextMenu=rS,$.useResourceViewDrag=iS,$.useResourceViewHelpers=jd,$.useResourceViewSelection=oS,$.useResourcesStore=We,$.useRestoreWorker=sw,$.useRoute=zt,$.useRouteMeta=Gb,$.useRouteName=Jf,$.useRouteParam=xa,$.useRouteQuery=en,$.useRouteQueryPersisted=Pr,$.useRouter=ze,$.useScrollTo=v0,$.useSearch=rd,$.useSelectedResources=Ud,$.useService=xr,$.useSharesStore=kr,$.useSideBar=Sa,$.useSort=Tx,$.useSpaceActionsDelete=B0,$.useSpaceActionsDeleteImage=LL,$.useSpaceActionsDisable=j0,$.useSpaceActionsDuplicate=U0,$.useSpaceActionsEditDescription=wL,$.useSpaceActionsEditQuota=z0,$.useSpaceActionsEditReadmeContent=IL,$.useSpaceActionsNavigateToTrash=FL,$.useSpaceActionsRename=H0,$.useSpaceActionsRestore=K0,$.useSpaceActionsSetIcon=NL,$.useSpaceActionsShowMembers=OL,$.useSpaceHelpers=ka,$.useSpacesLoading=tw,$.useSpacesStore=st,$.useThemeStore=ur,$.useTileSize=tS,$.useTokenTimerWorker=LF,$.useUpdatesStore=Bb,$.useUpload=JL,$.useUserStore=gt,$.useViewMode=QL,$.useViewSize=XL,$.useViewSizeMax=Md,$.useWebWorkersStore=Wo,$.useWindowOpen=Q0,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})}));
36
+ `;t("update:currentContent",h)},showLineNumbers:o}}}),AO={id:"text-editor-container",class:"h-full [&_.md-editor-preview]:!font-(family-name:--oc-font-family)"},EO={key:0};function RO(e,t,n,r,o,s){const i=oe("md-preview"),l=oe("oc-icon"),u=oe("NormalToolbar"),d=oe("md-editor");return I(),G("div",AO,[e.isReadOnly?(I(),G("article",EO,[J(i,{id:"text-editor-preview-component","model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-upload-img":"","no-highlight":"","no-echarts":"",language:e.languages[e.language.current]||"en-US",theme:e.theme,"auto-focus":"","read-only":""},null,8,["model-value","language","theme"])])):(I(),re(d,{key:1,id:"text-editor-component",class:R.normalizeClass([{"no-line-numbers":!e.showLineNumbers},"[&_.cm-content]:!font-(family-name:--oc-font-family)"]),"model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-highlight":"","no-echarts":"","on-upload-img":e.onUploadImg,language:e.languages[e.language.current]||"en-US",theme:e.theme,preview:e.isMarkdown,toolbars:e.toolbars,"auto-focus":"",onOnChange:t[1]||(t[1]=c=>e.$emit("update:currentContent",c))},{defToolbars:Z(()=>[J(u,{title:e.showLineNumbers?e.$gettext("hide line numbers"):e.$gettext("show line numbers"),onOnClick:t[0]||(t[0]=c=>e.showLineNumbers=!e.showLineNumbers)},{default:Z(()=>[J(l,{class:"!flex items-center justify-center size-6",size:"small",name:"hashtag","fill-type":"none"})]),_:1},8,["title"])]),_:1},8,["class","model-value","on-upload-img","language","theme","preview","toolbars"]))])}const DO=Object.freeze(Object.defineProperty({__proto__:null,default:Le(xO,[["render",RO]])},Symbol.toStringTag,{value:"Module"}));x.AVATAR_UPLOAD_MAX_FILE_SIZE_MB=vc,x.AccountCapabilitiesSchema=Cp,x.AccountSchema=Ap,x.AccountsSchema=Rp,x.ActionMenuDropItem=mg,x.ActionMenuItem=ia,x.ApiError=ZS,x.AppBar=QP,x.AppLoadingSpinner=kc,x.AppProviderService=qS,x.AppTopBar=yg,x.AppWrapper=Cg,x.AppWrapperRoute=HI,x.ArchiverService=t0,x.Auth=Sl,x.AvatarUpload=cF,x.BatchActions=hg,x.Cache=nf,x.ClientService=c0,x.ClipboardActions=Zo,x.CompareSaveDialog=$$,x.ConflictDialog=Ha,x.ContextActionMenu=aa,x.ContextActions=gg,x.ContextMenuQuickAction=_c,x.CreateLinkModal=km,x.CreateShortcutModal=Em,x.CreateSpace=XP,x.CustomComponentTarget=M$,x.DateFilter=KF,x.DatePickerModal=EI,x.EVENT_FILE_DROPPED=IR,x.EVENT_TROW_CONTEXTMENU=FR,x.EVENT_TROW_MOUNTED=PR,x.EmojiPickerModal=Zm,x.EventBus=ff,x.FileInfo=Lc,x.FilePickerModal=Im,x.FileSideBar=Sg,x.FolderLoaderFavorites=Ff,x.FolderLoaderSharedViaLink=$f,x.FolderLoaderSharedWithMe=Of,x.FolderLoaderSharedWithOthers=Lf,x.FolderLoaderSpace=If,x.FolderLoaderTrashbin=_f,x.FolderService=Mf,x.FolderViewModeConstants=Ft,x.HttpClient=Tl,x.IdentitySchema=xp,x.ImageDimension=bs,x.ImageType=$R,x.ItemFilter=z$,x.ItemFilterInline=YF,x.ItemFilterToggle=q$,x.Key=jn,x.LimitsSchema=Ep,x.LinkRoleDropdown=Tm,x.LoadingEventTopics=Sr,x.LoadingIndicator=K$,x.LoadingService=r1,x.MailCapabilitiesSchema=Tp,x.MimeTypesToAppsSchema=cf,x.Modifier=Li,x.NoContentMessage=Y$,x.Pagination=tO,x.PaginationConstants=Ao,x.PasswordPolicyService=tT,x.PortalTarget=aO,x.PortalTargetEventTopics=sa,x.PreviewService=K1,x.PrimaryAccountsSchema=Dp,x.ProcessorType=Ci,x.QuotaModal=Km,x.QuotaSelect=Qm,x.RESOURCE_MAX_CHARACTER_LENGTH=OR,x.RESOURCE_NAME_MAX_BYTES=yc,x.RawConfigSchema=AS,x.RawGroupwareConfigSchema=Mk,x.ResolveStrategy=Sn,x.ResourceConflictModal=fd,x.ResourceGhostElement=Mc,x.ResourceIcon=ws,x.ResourceLink=Xi,x.ResourceListItem=Ss,x.ResourceName=bc,x.ResourcePreview=Am,x.ResourceSize=xg,x.ResourceTable=vF,x.ResourceTile=Eg,x.ResourceTiles=$F,x.ResourceTransfer=hd,x.RuntimeError=fo,x.SaveAsModal=Lm,x.SearchBarFilter=iO,x.SearchLocationFilterConstants=jr,x.SideBar=wg,x.SideBarEventTopics=eh,x.SideBarPanels=bg,x.SieveCapabilitiesSchema=kp,x.SortConstants=Cs,x.SpaceDetails=m$,x.SpaceDetailsMultiple=b$,x.SpaceImageModal=Mm,x.SpaceInfo=Oc,x.SpaceMoveInfoModal=dd,x.SpaceNoSelection=C$,x.SpaceQuota=Rg,x.TextEditor=O$,x.ThemeConfig=DC,x.TransferType=Xn,x.UnsavedChangesModal=Tg,x.UppyService=aT,x.UserAvatar=la,x.VersionCheck=hO,x.ViewOptions=vg,x.VisibilityObserver=xm,x.WebDavDetails=Dg,x.WebThemeConfig=Jp,x.activeApp=pl,x.authContextValues=mS,x.blobToArrayBuffer=bp,x.breadcrumbsFromPath=Ek,x.buildRoutes=BC,x.buildUrl=vS,x.cacheService=wl,x.canvasToBlob=wp,x.cloneStateObject=cd,x.compareVersions=bl,x.concatBreadcrumbs=Rk,x.contextQueryToFileContextProps=oh,x.contextRouteNameKey=Pi,x.contextRouteParamsKey=zl,x.contextRouteQueryKey=Ul,x.convertToMinimalUppyFile=rp,x.createDefaultFileIconMapping=gd,x.createFileRouteOptions=_n,x.createFolderDummyFile=np,x.createLocation=ao,x.createLocationCommon=lo,x.createLocationPublic=co,x.createLocationShares=an,x.createLocationSpaces=kn,x.createLocationTrash=wr,x.defaultFuseOptions=Wa,x.defineWebApplication=zg,x.determineResourceTableSortFields=af,x.determineResourceTilesSortFields=jS,x.dirname=Ke.dirname,x.displayPositionedDropdown=Ml,x.encodePath=vl,x.eventBus=ze,x.filterResources=Hy,x.focusCheckbox=DS,x.folderService=Nf,x.formatDateFromDateTime=Mr,x.formatDateFromHTTP=Dk,x.formatDateFromISO=gp,x.formatDateFromJSDate=mp,x.formatDateFromRFC=Pk,x.formatFileSize=Ht,x.formatRelativeDateFromDateTime=es,x.formatRelativeDateFromHTTP=Ik,x.formatRelativeDateFromISO=Fk,x.formatRelativeDateFromJSDate=vp,x.formatRelativeDateFromRFC=$k,x.getIndicators=Lk,x.getLocaleFromLanguage=Ei,x.getParentPaths=yp,x.getSharedAncestorRoute=RS,x.getSharedDriveItem=pi,x.getSpacesByType=rs,x.getTextByteSize=Nl,x.isItemInCurrentFolder=vd,x.isLocationActive=MC,x.isLocationActiveDirector=io,x.isLocationCommonActive=bt,x.isLocationPublicActive=ln,x.isLocationSharesActive=mt,x.isLocationSpacesActive=st,x.isLocationTrashActive=qt,x.isMacOs=ts,x.isPromiseFulfilled=Nr,x.isPromiseRejected=Br,x.isResourceBeeingMovedToSameLocation=pd,x.isSameResource=Uo,x.locationPublicLink=dl,x.locationPublicUpload=fl,x.locationSharesViaLink=ul,x.locationSharesWithMe=di,x.locationSharesWithOthers=cl,x.locationSpacesGeneric=ll,x.objectKeys=e0,x.parseVersion=yl,x.queryItemAsString=at,x.renameResource=Qa,x.resolveFileNameDuplicate=wn,x.resourceIconMappingInjectionKey=md,x.routeToContextQuery=Ii,x.setCurrentUserShareSpacePermissions=rf,x.sortFields=lf,x.sortHelper=dg,x.sortSpaceMembers=Yp,x.translateSortFields=zS,x.triggerDownloadWithFilename=gl,x.useAbility=Bt,x.useActionsShowDetails=HD,x.useActiveApp=gS,x.useActiveLocation=xn,x.useAppConfig=Zd,x.useAppDefaults=dh,x.useAppFileHandling=Vl,x.useAppFolderHandling=ih,x.useAppMeta=Wl,x.useAppNavigation=sh,x.useAppProviderService=QD,x.useAppsStore=Mn,x.useArchiverService=Rm,x.useAuthService=ql,x.useAuthStore=Lr,x.useAvatarsStore=fi,x.useBreadcrumbsFromPath=KD,x.useCanBeOpenedWithSecureView=rg,x.useCanListShares=Bm,x.useCanListVersions=og,x.useCanShare=jm,x.useCapabilityStore=Dt,x.useClientService=Pe,x.useClipboardStore=ns,x.useConfigStore=Ge,x.useCopyLink=gc,x.useCreateSpace=go,x.useCropperKeyboardActions=Ql,x.useDeleteWorker=fh,x.useDocumentTitle=ah,x.useDownloadFile=Sc,x.useDriveResolver=uh,x.useEmbedMode=Tr,x.useEventBus=rr,x.useExtensionPreferencesStore=Sp,x.useExtensionRegistry=ho,x.useFileActionFallbackToDownload=Um,x.useFileActions=An,x.useFileActionsCopy=Oi,x.useFileActionsCopyPermanentLink=Kl,x.useFileActionsCreateLink=ER,x.useFileActionsCreateNewFile=RR,x.useFileActionsCreateNewFolder=DR,x.useFileActionsCreateNewShortcut=sD,x.useFileActionsCreateSpaceFromResource=wc,x.useFileActionsDelete=Ts,x.useFileActionsDeleteResources=Vm,x.useFileActionsDisableSync=Yi,x.useFileActionsDownloadArchive=Zi,x.useFileActionsDownloadFile=xo,x.useFileActionsEmptyTrashBin=iD,x.useFileActionsEnableSync=ea,x.useFileActionsFavorite=Tc,x.useFileActionsMove=ta,x.useFileActionsNavigate=Dm,x.useFileActionsOpenShortcut=lD,x.useFileActionsOpenWithApp=$m,x.useFileActionsOpenWithDefault=Pm,x.useFileActionsPaste=Om,x.useFileActionsRename=na,x.useFileActionsRestore=ks,x.useFileActionsSaveAs=_m,x.useFileActionsSetImage=Nm,x.useFileActionsShowActions=xD,x.useFileActionsShowDetails=Cc,x.useFileActionsShowShares=xc,x.useFileActionsToggleHideShare=ra,x.useFileActionsUndoDelete=zm,x.useFileListHeaderPosition=GD,x.useFileRouteReplace=Ri,x.useFolderLink=Cr,x.useGetMatchingSpace=It,x.useGetResourceContext=sg,x.useGroupwareConfigStore=_k,x.useInterceptModifierClick=zr,x.useIsAppActive=AD,x.useIsFilesAppActive=lr,x.useIsResourceNameValid=Qr,x.useIsSearchActive=oa,x.useIsTopBarSticky=Ac,x.useKeyboardActions=_i,x.useLinkTypes=Ji,x.useLoadAvatars=pg,x.useLoadPreview=Rc,x.useLoadingService=Ut,x.useLocalStorage=Bl,x.useMessages=Me,x.useModals=Je,x.useOpenEmptyEditor=WD,x.useOpenWithDefaultApp=Jm,x.usePagination=JD,x.usePasswordPolicyService=tg,x.usePasteWorker=ph,x.usePortalTarget=ZD,x.usePreviewService=ng,x.useRequest=lh,x.useRequestHeaders=$i,x.useResourceContents=ag,x.useResourceIndicators=Dc,x.useResourceRouteResolver=Fm,x.useResourceViewContextMenu=lg,x.useResourceViewDrag=cg,x.useResourceViewHelpers=Pc,x.useResourceViewSelection=ug,x.useResourcesStore=De,x.useRestoreWorker=hh,x.useRoute=St,x.useRouteMeta=nh,x.useRouteName=jl,x.useRouteParam=Di,x.useRouteQuery=Pt,x.useRouteQueryPersisted=nr,x.useRouter=Re,x.useScrollTo=Cm,x.useSearch=Hl,x.useSelectedResources=Ic,x.useService=er,x.useSharesStore=tr,x.useSideBar=_t,x.useSort=sP,x.useSpaceActionsDelete=qm,x.useSpaceActionsDeleteImage=qD,x.useSpaceActionsDisable=Hm,x.useSpaceActionsDuplicate=Wm,x.useSpaceActionsEditDescription=RD,x.useSpaceActionsEditQuota=Gm,x.useSpaceActionsEditReadmeContent=ND,x.useSpaceActionsNavigateToTrash=jD,x.useSpaceActionsRename=Xm,x.useSpaceActionsRestore=Ym,x.useSpaceActionsSetIcon=VD,x.useSpaceActionsShowMembers=BD,x.useSpaceHelpers=Fi,x.useSpacesLoading=ch,x.useSpacesStore=He,x.useThemeStore=Bn,x.useTileSize=ig,x.useTokenTimerWorker=qC,x.useUpdatesStore=th,x.useUpload=uP,x.useUserStore=et,x.useViewMode=nP,x.useViewSize=rP,x.useViewSizeMax=Ec,x.useWebWorkersStore=ss,x.useWindowOpen=eg,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})}));