@opencloud-eu/web-pkg 2.4.0 → 3.2.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.
@@ -1,67 +1,67 @@
1
- (function(D,te){typeof exports=="object"&&typeof module<"u"?te(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/drop-target"),require("pinia"),require("oidc-client-ts"),require("p-queue"),require("@vueuse/core"),require("dompurify"),require("mark.js"),require("vue-router"),require("portal-vue"),require("@vue/shared"),require("deepmerge"),require("md-editor-v3"),require("zod"),require("@sentry/vue"),require("screenfull"),require("cropperjs")):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/drop-target","pinia","oidc-client-ts","p-queue","@vueuse/core","dompurify","mark.js","vue-router","portal-vue","@vue/shared","deepmerge","md-editor-v3","zod","@sentry/vue","screenfull","cropperjs"],te):(D=typeof globalThis<"u"?globalThis:D||self,te(D["web-pkg"]={},D.webClient,D.vue,D.vue3Gettext,D.Fuse,D.lodashEs,D.globalAxios,D.uuid,D.fetchEventSource,D.vueConcurrency,D.luxon,D.filesize,D.qs,D.passwordSheriff,D.Uppy,D.Tus,D.XHRUpload,D.DropTarget,D.pinia,D.oidcClientTs,D.PQueue,D.core,D.DOMPurify,D.Mark,D.vueRouter,D.portalVue,D.shared,D.merge$1,D.mdEditorV3,D.zod,D.vue$1,D.screenfull,D.Cropper))})(this,function(D,te,Ht,Oe,nd,_t,Mo,tn,M0,hn,jt,B0,j0,U0,q0,V0,z0,W0,We,H0,Ur,qr,rd,id,Bo,wa,W,od,jo,ve,G0,K0,Q0){"use strict";var V2=Object.defineProperty;var $0=D=>{throw TypeError(D)};var z2=(D,te,Ht)=>te in D?V2(D,te,{enumerable:!0,configurable:!0,writable:!0,value:Ht}):D[te]=Ht;var Se=(D,te,Ht)=>z2(D,typeof te!="symbol"?te+"":te,Ht),ed=(D,te,Ht)=>te.has(D)||$0("Cannot "+Ht);var Fe=(D,te,Ht)=>(ed(D,te,"read from private field"),Ht?Ht.call(D):te.get(D)),Rn=(D,te,Ht)=>te.has(D)?$0("Cannot add the same private member more than once"):te instanceof WeakSet?te.add(D):te.set(D,Ht),Bt=(D,te,Ht,Oe)=>(ed(D,te,"write to private field"),Oe?Oe.call(D,Ht):te.set(D,Ht),Ht),jr=(D,te,Ht)=>(ed(D,te,"access private method"),Ht);var en,rn,Cr,Ct,Wt,Lr,pi,Mr,ar,hi,Lo,gi,D0,Br,va,td,L0;const X0=e=>e;function sd(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function Y0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ad={exports:{}},Lt=ad.exports={},Xn,Yn;function Sa(){throw new Error("setTimeout has not been defined")}function Ea(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Xn=setTimeout:Xn=Sa}catch{Xn=Sa}try{typeof clearTimeout=="function"?Yn=clearTimeout:Yn=Ea}catch{Yn=Ea}})();function ld(e){if(Xn===setTimeout)return setTimeout(e,0);if((Xn===Sa||!Xn)&&setTimeout)return Xn=setTimeout,setTimeout(e,0);try{return Xn(e,0)}catch{try{return Xn.call(null,e,0)}catch{return Xn.call(this,e,0)}}}function J0(e){if(Yn===clearTimeout)return clearTimeout(e);if((Yn===Ea||!Yn)&&clearTimeout)return Yn=clearTimeout,clearTimeout(e);try{return Yn(e)}catch{try{return Yn.call(null,e)}catch{return Yn.call(this,e)}}}var lr=[],mi=!1,Vr,Uo=-1;function Z0(){!mi||!Vr||(mi=!1,Vr.length?lr=Vr.concat(lr):Uo=-1,lr.length&&cd())}function cd(){if(!mi){var e=ld(Z0);mi=!0;for(var t=lr.length;t;){for(Vr=lr,lr=[];++Uo<t;)Vr&&Vr[Uo].run();Uo=-1,t=lr.length}Vr=null,mi=!1,J0(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];lr.push(new ud(e,t)),lr.length===1&&!mi&&ld(cd)};function ud(e,t){this.fun=e,this.array=t}ud.prototype.run=function(){this.fun.apply(null,this.array)},Lt.title="browser",Lt.browser=!0,Lt.env={},Lt.argv=[],Lt.version="",Lt.versions={};function cr(){}Lt.on=cr,Lt.addListener=cr,Lt.once=cr,Lt.off=cr,Lt.removeListener=cr,Lt.removeAllListeners=cr,Lt.emit=cr,Lt.prependListener=cr,Lt.prependOnceListener=cr,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 ew=ad.exports;const we=Y0(ew);function ur(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let at;const Ta=new WeakSet;class tw{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,Ta.has(this)&&(Ta.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||dd(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,yd(this),pd(this);const t=at,n=Vn;at=this,Vn=!0;try{return this.fn()}finally{we.env.NODE_ENV!=="production"&&at!==this&&ur("Active effect was not restored correctly - this is likely a Vue internal bug."),hd(this),at=t,Vn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Ia(t);this.deps=this.depsTail=void 0,yd(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ta.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){_a(this)&&this.run()}get dirty(){return _a(this)}}let fd=0,zi,Wi;function dd(e,t=!1){if(e.flags|=8,t){e.next=Wi,Wi=e;return}e.next=zi,zi=e}function Aa(){fd++}function Ra(){if(--fd>0)return;if(Wi){let t=Wi;for(Wi=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;zi;){let t=zi;for(zi=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 pd(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function hd(e){let t,n=e.depsTail,r=n;for(;r;){const o=r.prevDep;r.version===-1?(r===n&&(n=o),Ia(r),nw(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}e.deps=t,e.depsTail=n}function _a(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(gd(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function gd(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Hi)||(e.globalVersion=Hi,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!_a(e))))return;e.flags|=2;const t=e.dep,n=at,r=Vn;at=e,Vn=!0;try{pd(e);const o=e.fn(e._value);(t.version===0||W.hasChanged(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{at=n,Vn=r,hd(e),e.flags&=-3}}function Ia(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),we.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 i=n.computed.deps;i;i=i.nextDep)Ia(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function nw(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Vn=!0;const md=[];function yi(){md.push(Vn),Vn=!1}function bi(){const e=md.pop();Vn=e===void 0?!0:e}function yd(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=at;at=void 0;try{t()}finally{at=n}}}let Hi=0;class rw{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 qo{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,we.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(t){if(!at||!Vn||at===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==at)n=this.activeLink=new rw(at,this),at.deps?(n.prevDep=at.depsTail,at.depsTail.nextDep=n,at.depsTail=n):at.deps=at.depsTail=n,bd(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=at.depsTail,n.nextDep=void 0,at.depsTail.nextDep=n,at.depsTail=n,at.deps===n&&(at.deps=r)}return we.env.NODE_ENV!=="production"&&at.onTrack&&at.onTrack(W.extend({effect:at},t)),n}trigger(t){this.version++,Hi++,this.notify(t)}notify(t){Aa();try{if(we.env.NODE_ENV!=="production")for(let n=this.subsHead;n;n=n.nextSub)n.sub.onTrigger&&!(n.sub.flags&8)&&n.sub.onTrigger(W.extend({effect:n.sub},t));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ra()}}}function bd(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)bd(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),we.env.NODE_ENV!=="production"&&e.dep.subsHead===void 0&&(e.dep.subsHead=e),e.dep.subs=e}}const Vo=new WeakMap,zr=Symbol(we.env.NODE_ENV!=="production"?"Object iterate":""),Ca=Symbol(we.env.NODE_ENV!=="production"?"Map keys iterate":""),Gi=Symbol(we.env.NODE_ENV!=="production"?"Array iterate":"");function on(e,t,n){if(Vn&&at){let r=Vo.get(e);r||Vo.set(e,r=new Map);let o=r.get(n);o||(r.set(n,o=new qo),o.map=r,o.key=n),we.env.NODE_ENV!=="production"?o.track({target:e,type:t,key:n}):o.track()}}function Pr(e,t,n,r,o,i){const s=Vo.get(e);if(!s){Hi++;return}const a=c=>{c&&(we.env.NODE_ENV!=="production"?c.trigger({target:e,type:t,key:n,newValue:r,oldValue:o,oldTarget:i}):c.trigger())};if(Aa(),t==="clear")s.forEach(a);else{const c=W.isArray(e),u=c&&W.isIntegerKey(n);if(c&&n==="length"){const l=Number(r);s.forEach((f,d)=>{(d==="length"||d===Gi||!W.isSymbol(d)&&d>=l)&&a(f)})}else switch((n!==void 0||s.has(void 0))&&a(s.get(n)),u&&a(s.get(Gi)),t){case"add":c?u&&a(s.get("length")):(a(s.get(zr)),W.isMap(e)&&a(s.get(Ca)));break;case"delete":c||(a(s.get(zr)),W.isMap(e)&&a(s.get(Ca)));break;case"set":W.isMap(e)&&a(s.get(zr));break}}Ra()}function iw(e,t){const n=Vo.get(e);return n&&n.get(t)}function vi(e){const t=nt(e);return t===e?t:(on(t,"iterate",Gi),gn(e)?t:t.map(sn))}function zo(e){return on(e=nt(e),"iterate",Gi),e}const ow={__proto__:null,[Symbol.iterator](){return Pa(this,Symbol.iterator,sn)},concat(...e){return vi(this).concat(...e.map(t=>W.isArray(t)?vi(t):t))},entries(){return Pa(this,"entries",e=>(e[1]=sn(e[1]),e))},every(e,t){return fr(this,"every",e,t,void 0,arguments)},filter(e,t){return fr(this,"filter",e,t,n=>n.map(sn),arguments)},find(e,t){return fr(this,"find",e,t,sn,arguments)},findIndex(e,t){return fr(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return fr(this,"findLast",e,t,sn,arguments)},findLastIndex(e,t){return fr(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return fr(this,"forEach",e,t,void 0,arguments)},includes(...e){return Fa(this,"includes",e)},indexOf(...e){return Fa(this,"indexOf",e)},join(e){return vi(this).join(e)},lastIndexOf(...e){return Fa(this,"lastIndexOf",e)},map(e,t){return fr(this,"map",e,t,void 0,arguments)},pop(){return Ki(this,"pop")},push(...e){return Ki(this,"push",e)},reduce(e,...t){return vd(this,"reduce",e,t)},reduceRight(e,...t){return vd(this,"reduceRight",e,t)},shift(){return Ki(this,"shift")},some(e,t){return fr(this,"some",e,t,void 0,arguments)},splice(...e){return Ki(this,"splice",e)},toReversed(){return vi(this).toReversed()},toSorted(e){return vi(this).toSorted(e)},toSpliced(...e){return vi(this).toSpliced(...e)},unshift(...e){return Ki(this,"unshift",e)},values(){return Pa(this,"values",sn)}};function Pa(e,t,n){const r=zo(e),o=r[t]();return r!==e&&!gn(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.value&&(i.value=n(i.value)),i}),o}const sw=Array.prototype;function fr(e,t,n,r,o,i){const s=zo(e),a=s!==e&&!gn(e),c=s[t];if(c!==sw[t]){const f=c.apply(e,i);return a?sn(f):f}let u=n;s!==e&&(a?u=function(f,d){return n.call(this,sn(f),d,e)}:n.length>2&&(u=function(f,d){return n.call(this,f,d,e)}));const l=c.call(s,u,r);return a&&o?o(l):l}function vd(e,t,n,r){const o=zo(e);let i=n;return o!==e&&(gn(e)?n.length>3&&(i=function(s,a,c){return n.call(this,s,a,c,e)}):i=function(s,a,c){return n.call(this,s,sn(a),c,e)}),o[t](i,...r)}function Fa(e,t,n){const r=nt(e);on(r,"iterate",Gi);const o=r[t](...n);return(o===-1||o===!1)&&Ko(n[0])?(n[0]=nt(n[0]),r[t](...n)):o}function Ki(e,t,n=[]){yi(),Aa();const r=nt(e)[t].apply(e,n);return Ra(),bi(),r}const aw=W.makeMap("__proto__,__v_isRef,__isVue"),wd=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(W.isSymbol));function lw(e){W.isSymbol(e)||(e=String(e));const t=nt(this);return on(t,"has",e),t.hasOwnProperty(e)}class Sd{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,i=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return i;if(n==="__v_raw")return r===(o?i?_d:Rd:i?bw:Ad).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const s=W.isArray(t);if(!o){let c;if(s&&(c=ow[n]))return c;if(n==="hasOwnProperty")return lw}const a=Reflect.get(t,n,Ut(t)?t:r);return(W.isSymbol(n)?wd.has(n):aw(n))||(o||on(t,"get",n),i)?a:Ut(a)?s&&W.isIntegerKey(n)?a:a.value:W.isObject(a)?o?dr(a):xa(a):a}}class cw extends Sd{constructor(t=!1){super(!1,t)}set(t,n,r,o){let i=t[n];if(!this._isShallow){const c=Jn(i);if(!gn(r)&&!Jn(r)&&(i=nt(i),r=nt(r)),!W.isArray(t)&&Ut(i)&&!Ut(r))return c?!1:(i.value=r,!0)}const s=W.isArray(t)&&W.isIntegerKey(n)?Number(n)<t.length:W.hasOwn(t,n),a=Reflect.set(t,n,r,Ut(t)?t:o);return t===nt(o)&&(s?W.hasChanged(r,i)&&Pr(t,"set",n,r,i):Pr(t,"add",n,r)),a}deleteProperty(t,n){const r=W.hasOwn(t,n),o=t[n],i=Reflect.deleteProperty(t,n);return i&&r&&Pr(t,"delete",n,void 0,o),i}has(t,n){const r=Reflect.has(t,n);return(!W.isSymbol(n)||!wd.has(n))&&on(t,"has",n),r}ownKeys(t){return on(t,"iterate",W.isArray(t)?"length":zr),Reflect.ownKeys(t)}}class Ed extends Sd{constructor(t=!1){super(!0,t)}set(t,n){return we.env.NODE_ENV!=="production"&&ur(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return we.env.NODE_ENV!=="production"&&ur(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const uw=new cw,fw=new Ed,dw=new Ed(!0),Oa=e=>e,Wo=e=>Reflect.getPrototypeOf(e);function pw(e,t,n){return function(...r){const o=this.__v_raw,i=nt(o),s=W.isMap(i),a=e==="entries"||e===Symbol.iterator&&s,c=e==="keys"&&s,u=o[e](...r),l=n?Oa:t?Qo:sn;return!t&&on(i,"iterate",c?Ca:zr),{next(){const{value:f,done:d}=u.next();return d?{value:f,done:d}:{value:a?[l(f[0]),l(f[1])]:l(f),done:d}},[Symbol.iterator](){return this}}}}function Ho(e){return function(...t){if(we.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";ur(`${W.capitalize(e)} operation ${n}failed: target is readonly.`,nt(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function hw(e,t){const n={get(o){const i=this.__v_raw,s=nt(i),a=nt(o);e||(W.hasChanged(o,a)&&on(s,"get",o),on(s,"get",a));const{has:c}=Wo(s),u=t?Oa:e?Qo:sn;if(c.call(s,o))return u(i.get(o));if(c.call(s,a))return u(i.get(a));i!==s&&i.get(o)},get size(){const o=this.__v_raw;return!e&&on(nt(o),"iterate",zr),Reflect.get(o,"size",o)},has(o){const i=this.__v_raw,s=nt(i),a=nt(o);return e||(W.hasChanged(o,a)&&on(s,"has",o),on(s,"has",a)),o===a?i.has(o):i.has(o)||i.has(a)},forEach(o,i){const s=this,a=s.__v_raw,c=nt(a),u=t?Oa:e?Qo:sn;return!e&&on(c,"iterate",zr),a.forEach((l,f)=>o.call(i,u(l),u(f),s))}};return W.extend(n,e?{add:Ho("add"),set:Ho("set"),delete:Ho("delete"),clear:Ho("clear")}:{add(o){!t&&!gn(o)&&!Jn(o)&&(o=nt(o));const i=nt(this);return Wo(i).has.call(i,o)||(i.add(o),Pr(i,"add",o,o)),this},set(o,i){!t&&!gn(i)&&!Jn(i)&&(i=nt(i));const s=nt(this),{has:a,get:c}=Wo(s);let u=a.call(s,o);u?we.env.NODE_ENV!=="production"&&Td(s,a,o):(o=nt(o),u=a.call(s,o));const l=c.call(s,o);return s.set(o,i),u?W.hasChanged(i,l)&&Pr(s,"set",o,i,l):Pr(s,"add",o,i),this},delete(o){const i=nt(this),{has:s,get:a}=Wo(i);let c=s.call(i,o);c?we.env.NODE_ENV!=="production"&&Td(i,s,o):(o=nt(o),c=s.call(i,o));const u=a?a.call(i,o):void 0,l=i.delete(o);return c&&Pr(i,"delete",o,void 0,u),l},clear(){const o=nt(this),i=o.size!==0,s=we.env.NODE_ENV!=="production"?W.isMap(o)?new Map(o):new Set(o):void 0,a=o.clear();return i&&Pr(o,"clear",void 0,void 0,s),a}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=pw(o,e,t)}),n}function ka(e,t){const n=hw(e,t);return(r,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?r:Reflect.get(W.hasOwn(n,o)&&o in r?n:r,o,i)}const gw={get:ka(!1,!1)},mw={get:ka(!0,!1)},yw={get:ka(!0,!0)};function Td(e,t,n){const r=nt(n);if(r!==n&&t.call(e,r)){const o=W.toRawType(e);ur(`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 Ad=new WeakMap,bw=new WeakMap,Rd=new WeakMap,_d=new WeakMap;function vw(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ww(e){return e.__v_skip||!Object.isExtensible(e)?0:vw(W.toRawType(e))}function xa(e){return Jn(e)?e:Na(e,!1,uw,gw,Ad)}function dr(e){return Na(e,!0,fw,mw,Rd)}function Go(e){return Na(e,!0,dw,yw,_d)}function Na(e,t,n,r,o){if(!W.isObject(e))return we.env.NODE_ENV!=="production"&&ur(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=ww(e);if(i===0)return e;const s=o.get(e);if(s)return s;const a=new Proxy(e,i===2?r:n);return o.set(e,a),a}function Wr(e){return Jn(e)?Wr(e.__v_raw):!!(e&&e.__v_isReactive)}function Jn(e){return!!(e&&e.__v_isReadonly)}function gn(e){return!!(e&&e.__v_isShallow)}function Ko(e){return e?!!e.__v_raw:!1}function nt(e){const t=e&&e.__v_raw;return t?nt(t):e}function Sw(e){return!W.hasOwn(e,"__v_skip")&&Object.isExtensible(e)&&W.def(e,"__v_skip",!0),e}const sn=e=>W.isObject(e)?xa(e):e,Qo=e=>W.isObject(e)?dr(e):e;function Ut(e){return e?e.__v_isRef===!0:!1}function le(e){return Id(e,!1)}function Ew(e){return Id(e,!0)}function Id(e,t){return Ut(e)?e:new Tw(e,t)}class Tw{constructor(t,n){this.dep=new qo,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:nt(t),this._value=n?t:sn(t),this.__v_isShallow=n}get value(){return we.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||gn(t)||Jn(t);t=r?t:nt(t),W.hasChanged(t,n)&&(this._rawValue=t,this._value=r?t:sn(t),we.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:t,oldValue:n}):this.dep.trigger())}}function p(e){return Ut(e)?e.value:e}const Aw={get:(e,t,n)=>t==="__v_raw"?e:p(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return Ut(o)&&!Ut(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function Rw(e){return Wr(e)?e:new Proxy(e,Aw)}class _w{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new qo,{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 Cd(e){return new _w(e)}class Iw{constructor(t,n,r){this._object=t,this._key=n,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0}get value(){const t=this._object[this._key];return this._value=t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return iw(nt(this._object),this._key)}}class Cw{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 Pw(e,t,n){return Ut(e)?e:W.isFunction(e)?new Cw(e):W.isObject(e)&&arguments.length>1?Fw(e,t,n):le(e)}function Fw(e,t,n){const r=e[t];return Ut(r)?r:new Iw(e,t,n)}class Ow{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new qo(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Hi-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&at!==this)return dd(this,!0),!0;we.env.NODE_ENV}get value(){const t=we.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return gd(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter?this.setter(t):we.env.NODE_ENV!=="production"&&ur("Write operation failed: computed value is readonly")}}function kw(e,t,n=!1){let r,o;W.isFunction(e)?r=e:(r=e.get,o=e.set);const i=new Ow(r,o,n);return we.env.NODE_ENV,i}const Xo={},Yo=new WeakMap;let Hr;function xw(e,t=!1,n=Hr){if(n){let r=Yo.get(n);r||Yo.set(n,r=[]),r.push(e)}else we.env.NODE_ENV!=="production"&&!t&&ur("onWatcherCleanup() was called when there was no active watcher to associate with.")}function Nw(e,t,n=W.EMPTY_OBJ){const{immediate:r,deep:o,once:i,scheduler:s,augmentJob:a,call:c}=n,u=b=>{(n.onWarn||ur)("Invalid watch source: ",b,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},l=b=>o?b:gn(b)||o===!1||o===0?pr(b,1):pr(b);let f,d,m,w,v=!1,T=!1;if(Ut(e)?(d=()=>e.value,v=gn(e)):Wr(e)?(d=()=>l(e),v=!0):W.isArray(e)?(T=!0,v=e.some(b=>Wr(b)||gn(b)),d=()=>e.map(b=>{if(Ut(b))return b.value;if(Wr(b))return l(b);if(W.isFunction(b))return c?c(b,2):b();we.env.NODE_ENV!=="production"&&u(b)})):W.isFunction(e)?t?d=c?()=>c(e,2):e:d=()=>{if(m){yi();try{m()}finally{bi()}}const b=Hr;Hr=f;try{return c?c(e,3,[w]):e(w)}finally{Hr=b}}:(d=W.NOOP,we.env.NODE_ENV!=="production"&&u(e)),t&&o){const b=d,S=o===!0?1/0:o;d=()=>pr(b(),S)}const y=()=>{f.stop()};if(i&&t){const b=t;t=(...S)=>{b(...S),y()}}let g=T?new Array(e.length).fill(Xo):Xo;const h=b=>{if(!(!(f.flags&1)||!f.dirty&&!b))if(t){const S=f.run();if(o||v||(T?S.some((E,I)=>W.hasChanged(E,g[I])):W.hasChanged(S,g))){m&&m();const E=Hr;Hr=f;try{const I=[S,g===Xo?void 0:T&&g[0]===Xo?[]:g,w];c?c(t,3,I):t(...I),g=S}finally{Hr=E}}}else f.run()};return a&&a(h),f=new tw(d),f.scheduler=s?()=>s(h,!1):h,w=b=>xw(b,!1,f),m=f.onStop=()=>{const b=Yo.get(f);if(b){if(c)c(b,4);else for(const S of b)S();Yo.delete(f)}},we.env.NODE_ENV!=="production"&&(f.onTrack=n.onTrack,f.onTrigger=n.onTrigger),t?r?h(!0):g=f.run():s?s(h.bind(null,!0),!0):f.run(),y.pause=f.pause.bind(f),y.resume=f.resume.bind(f),y.stop=y,y}function pr(e,t=1/0,n){if(t<=0||!W.isObject(e)||e.__v_skip||(n=n||new Set,n.has(e)))return e;if(n.add(e),t--,Ut(e))pr(e.value,t,n);else if(W.isArray(e))for(let r=0;r<e.length;r++)pr(e[r],t,n);else if(W.isSet(e)||W.isMap(e))e.forEach(r=>{pr(r,t,n)});else if(W.isPlainObject(e)){for(const r in e)pr(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&pr(e[r],t,n)}return e}const Gr=[];function $w(e){Gr.push(e)}function Dw(){Gr.pop()}let $a=!1;function et(e,...t){if($a)return;$a=!0,yi();const n=Gr.length?Gr[Gr.length-1].component:null,r=n&&n.appContext.config.warnHandler,o=Lw();if(r)Jo(r,n,11,[e+t.map(i=>{var s,a;return(a=(s=i.toString)==null?void 0:s.call(i))!=null?a:JSON.stringify(i)}).join(""),n&&n.proxy,o.map(({vnode:i})=>`at <${mp(n,i.type)}>`).join(`
1
+ (function(L,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/drop-target"),require("pinia"),require("oidc-client-ts"),require("p-queue"),require("@vueuse/core"),require("cropperjs"),require("dompurify"),require("mark.js"),require("vue-router"),require("portal-vue"),require("@vue/shared"),require("deepmerge"),require("md-editor-v3"),require("zod"),require("@sentry/vue"),require("screenfull")):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/drop-target","pinia","oidc-client-ts","p-queue","@vueuse/core","cropperjs","dompurify","mark.js","vue-router","portal-vue","@vue/shared","deepmerge","md-editor-v3","zod","@sentry/vue","screenfull"],Z):(L=typeof globalThis<"u"?globalThis:L||self,Z(L["web-pkg"]={},L.webClient,L.vue,L.vue3Gettext,L.Fuse,L.lodashEs,L.globalAxios,L.uuid,L.fetchEventSource,L.vueConcurrency,L.luxon,L.filesize,L.qs,L.passwordSheriff,L.Uppy,L.Tus,L.XHRUpload,L.DropTarget,L.pinia,L.oidcClientTs,L.PQueue,L.core,L.Cropper,L.DOMPurify,L.Mark,L.vueRouter,L.portalVue,L.shared,L.merge$1,L.mdEditorV3,L.zod,L.vue$1,L.screenfull))})(this,function(L,Z,Ht,Fe,fd,It,Lo,en,K0,pn,qt,Q0,X0,Y0,J0,Z0,ew,tw,Ue,nw,Fr,Vr,Ra,dd,pd,Mo,_a,H,hd,Bo,me,rw,iw){"use strict";var pM=Object.defineProperty;var W0=L=>{throw TypeError(L)};var hM=(L,Z,Ht)=>Z in L?pM(L,Z,{enumerable:!0,configurable:!0,writable:!0,value:Ht}):L[Z]=Ht;var Ee=(L,Z,Ht)=>hM(L,typeof Z!="symbol"?Z+"":Z,Ht),cd=(L,Z,Ht)=>Z.has(L)||W0("Cannot "+Ht);var Oe=(L,Z,Ht)=>(cd(L,Z,"read from private field"),Ht?Ht.call(L):Z.get(L)),_n=(L,Z,Ht)=>Z.has(L)?W0("Cannot add the same private member more than once"):Z instanceof WeakSet?Z.add(L):Z.set(L,Ht),Ut=(L,Z,Ht,Fe)=>(cd(L,Z,"write to private field"),Fe?Fe.call(L,Ht):Z.set(L,Ht),Ht),qr=(L,Z,Ht)=>(cd(L,Z,"access private method"),Ht);var Zt,nn,Pr,Pt,Wt,Br,hi,jr,ar,gi,Do,mi,H0,Ur,Aa,ud,G0;const ow=e=>e;function gd(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function sw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var md={exports:{}},Mt=md.exports={},Yn,Jn;function Ia(){throw new Error("setTimeout has not been defined")}function Ca(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Yn=setTimeout:Yn=Ia}catch{Yn=Ia}try{typeof clearTimeout=="function"?Jn=clearTimeout:Jn=Ca}catch{Jn=Ca}})();function yd(e){if(Yn===setTimeout)return setTimeout(e,0);if((Yn===Ia||!Yn)&&setTimeout)return Yn=setTimeout,setTimeout(e,0);try{return Yn(e,0)}catch{try{return Yn.call(null,e,0)}catch{return Yn.call(this,e,0)}}}function aw(e){if(Jn===clearTimeout)return clearTimeout(e);if((Jn===Ca||!Jn)&&clearTimeout)return Jn=clearTimeout,clearTimeout(e);try{return Jn(e)}catch{try{return Jn.call(null,e)}catch{return Jn.call(this,e)}}}var lr=[],yi=!1,zr,jo=-1;function lw(){!yi||!zr||(yi=!1,zr.length?lr=zr.concat(lr):jo=-1,lr.length&&bd())}function bd(){if(!yi){var e=yd(lw);yi=!0;for(var t=lr.length;t;){for(zr=lr,lr=[];++jo<t;)zr&&zr[jo].run();jo=-1,t=lr.length}zr=null,yi=!1,aw(e)}}Mt.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];lr.push(new vd(e,t)),lr.length===1&&!yi&&yd(bd)};function vd(e,t){this.fun=e,this.array=t}vd.prototype.run=function(){this.fun.apply(null,this.array)},Mt.title="browser",Mt.browser=!0,Mt.env={},Mt.argv=[],Mt.version="",Mt.versions={};function cr(){}Mt.on=cr,Mt.addListener=cr,Mt.once=cr,Mt.off=cr,Mt.removeListener=cr,Mt.removeAllListeners=cr,Mt.emit=cr,Mt.prependListener=cr,Mt.prependOnceListener=cr,Mt.listeners=function(e){return[]},Mt.binding=function(e){throw new Error("process.binding is not supported")},Mt.cwd=function(){return"/"},Mt.chdir=function(e){throw new Error("process.chdir is not supported")},Mt.umask=function(){return 0};var cw=md.exports;const ve=sw(cw);function ur(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let ct;const Pa=new WeakSet;class uw{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,Pa.has(this)&&(Pa.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Sd(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,_d(this),Ed(this);const t=ct,n=qn;ct=this,qn=!0;try{return this.fn()}finally{ve.env.NODE_ENV!=="production"&&ct!==this&&ur("Active effect was not restored correctly - this is likely a Vue internal bug."),Td(this),ct=t,qn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)xa(t);this.deps=this.depsTail=void 0,_d(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Pa.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ka(this)&&this.run()}get dirty(){return ka(this)}}let wd=0,zi,Wi;function Sd(e,t=!1){if(e.flags|=8,t){e.next=Wi,Wi=e;return}e.next=zi,zi=e}function Fa(){wd++}function Oa(){if(--wd>0)return;if(Wi){let t=Wi;for(Wi=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;zi;){let t=zi;for(zi=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 Ed(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Td(e){let t,n=e.depsTail,r=n;for(;r;){const o=r.prevDep;r.version===-1?(r===n&&(n=o),xa(r),fw(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}e.deps=t,e.depsTail=n}function ka(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ad(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Ad(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Hi)||(e.globalVersion=Hi,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ka(e))))return;e.flags|=2;const t=e.dep,n=ct,r=qn;ct=e,qn=!0;try{Ed(e);const o=e.fn(e._value);(t.version===0||H.hasChanged(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{ct=n,qn=r,Td(e),e.flags&=-3}}function xa(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),ve.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 i=n.computed.deps;i;i=i.nextDep)xa(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function fw(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 Rd=[];function bi(){Rd.push(qn),qn=!1}function vi(){const e=Rd.pop();qn=e===void 0?!0:e}function _d(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ct;ct=void 0;try{t()}finally{ct=n}}}let Hi=0;class dw{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 Uo{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,ve.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(t){if(!ct||!qn||ct===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ct)n=this.activeLink=new dw(ct,this),ct.deps?(n.prevDep=ct.depsTail,ct.depsTail.nextDep=n,ct.depsTail=n):ct.deps=ct.depsTail=n,Id(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=ct.depsTail,n.nextDep=void 0,ct.depsTail.nextDep=n,ct.depsTail=n,ct.deps===n&&(ct.deps=r)}return ve.env.NODE_ENV!=="production"&&ct.onTrack&&ct.onTrack(H.extend({effect:ct},t)),n}trigger(t){this.version++,Hi++,this.notify(t)}notify(t){Fa();try{if(ve.env.NODE_ENV!=="production")for(let n=this.subsHead;n;n=n.nextSub)n.sub.onTrigger&&!(n.sub.flags&8)&&n.sub.onTrigger(H.extend({effect:n.sub},t));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Oa()}}}function Id(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)Id(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),ve.env.NODE_ENV!=="production"&&e.dep.subsHead===void 0&&(e.dep.subsHead=e),e.dep.subs=e}}const qo=new WeakMap,Wr=Symbol(ve.env.NODE_ENV!=="production"?"Object iterate":""),Na=Symbol(ve.env.NODE_ENV!=="production"?"Map keys iterate":""),Gi=Symbol(ve.env.NODE_ENV!=="production"?"Array iterate":"");function rn(e,t,n){if(qn&&ct){let r=qo.get(e);r||qo.set(e,r=new Map);let o=r.get(n);o||(r.set(n,o=new Uo),o.map=r,o.key=n),ve.env.NODE_ENV!=="production"?o.track({target:e,type:t,key:n}):o.track()}}function Or(e,t,n,r,o,i){const s=qo.get(e);if(!s){Hi++;return}const a=c=>{c&&(ve.env.NODE_ENV!=="production"?c.trigger({target:e,type:t,key:n,newValue:r,oldValue:o,oldTarget:i}):c.trigger())};if(Fa(),t==="clear")s.forEach(a);else{const c=H.isArray(e),u=c&&H.isIntegerKey(n);if(c&&n==="length"){const l=Number(r);s.forEach((d,f)=>{(f==="length"||f===Gi||!H.isSymbol(f)&&f>=l)&&a(d)})}else switch((n!==void 0||s.has(void 0))&&a(s.get(n)),u&&a(s.get(Gi)),t){case"add":c?u&&a(s.get("length")):(a(s.get(Wr)),H.isMap(e)&&a(s.get(Na)));break;case"delete":c||(a(s.get(Wr)),H.isMap(e)&&a(s.get(Na)));break;case"set":H.isMap(e)&&a(s.get(Wr));break}}Oa()}function pw(e,t){const n=qo.get(e);return n&&n.get(t)}function wi(e){const t=rt(e);return t===e?t:(rn(t,"iterate",Gi),hn(e)?t:t.map(on))}function Vo(e){return rn(e=rt(e),"iterate",Gi),e}const hw={__proto__:null,[Symbol.iterator](){return $a(this,Symbol.iterator,on)},concat(...e){return wi(this).concat(...e.map(t=>H.isArray(t)?wi(t):t))},entries(){return $a(this,"entries",e=>(e[1]=on(e[1]),e))},every(e,t){return fr(this,"every",e,t,void 0,arguments)},filter(e,t){return fr(this,"filter",e,t,n=>n.map(on),arguments)},find(e,t){return fr(this,"find",e,t,on,arguments)},findIndex(e,t){return fr(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return fr(this,"findLast",e,t,on,arguments)},findLastIndex(e,t){return fr(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return fr(this,"forEach",e,t,void 0,arguments)},includes(...e){return Da(this,"includes",e)},indexOf(...e){return Da(this,"indexOf",e)},join(e){return wi(this).join(e)},lastIndexOf(...e){return Da(this,"lastIndexOf",e)},map(e,t){return fr(this,"map",e,t,void 0,arguments)},pop(){return Ki(this,"pop")},push(...e){return Ki(this,"push",e)},reduce(e,...t){return Cd(this,"reduce",e,t)},reduceRight(e,...t){return Cd(this,"reduceRight",e,t)},shift(){return Ki(this,"shift")},some(e,t){return fr(this,"some",e,t,void 0,arguments)},splice(...e){return Ki(this,"splice",e)},toReversed(){return wi(this).toReversed()},toSorted(e){return wi(this).toSorted(e)},toSpliced(...e){return wi(this).toSpliced(...e)},unshift(...e){return Ki(this,"unshift",e)},values(){return $a(this,"values",on)}};function $a(e,t,n){const r=Vo(e),o=r[t]();return r!==e&&!hn(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.value&&(i.value=n(i.value)),i}),o}const gw=Array.prototype;function fr(e,t,n,r,o,i){const s=Vo(e),a=s!==e&&!hn(e),c=s[t];if(c!==gw[t]){const d=c.apply(e,i);return a?on(d):d}let u=n;s!==e&&(a?u=function(d,f){return n.call(this,on(d),f,e)}:n.length>2&&(u=function(d,f){return n.call(this,d,f,e)}));const l=c.call(s,u,r);return a&&o?o(l):l}function Cd(e,t,n,r){const o=Vo(e);let i=n;return o!==e&&(hn(e)?n.length>3&&(i=function(s,a,c){return n.call(this,s,a,c,e)}):i=function(s,a,c){return n.call(this,s,on(a),c,e)}),o[t](i,...r)}function Da(e,t,n){const r=rt(e);rn(r,"iterate",Gi);const o=r[t](...n);return(o===-1||o===!1)&&Go(n[0])?(n[0]=rt(n[0]),r[t](...n)):o}function Ki(e,t,n=[]){bi(),Fa();const r=rt(e)[t].apply(e,n);return Oa(),vi(),r}const mw=H.makeMap("__proto__,__v_isRef,__isVue"),Pd=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(H.isSymbol));function yw(e){H.isSymbol(e)||(e=String(e));const t=rt(this);return rn(t,"has",e),t.hasOwnProperty(e)}class Fd{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,i=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return i;if(n==="__v_raw")return r===(o?i?$d:Nd:i?Iw:xd).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const s=H.isArray(t);if(!o){let c;if(s&&(c=hw[n]))return c;if(n==="hasOwnProperty")return yw}const a=Reflect.get(t,n,Vt(t)?t:r);return(H.isSymbol(n)?Pd.has(n):mw(n))||(o||rn(t,"get",n),i)?a:Vt(a)?s&&H.isIntegerKey(n)?a:a.value:H.isObject(a)?o?dr(a):Ba(a):a}}class bw extends Fd{constructor(t=!1){super(!1,t)}set(t,n,r,o){let i=t[n];if(!this._isShallow){const c=Zn(i);if(!hn(r)&&!Zn(r)&&(i=rt(i),r=rt(r)),!H.isArray(t)&&Vt(i)&&!Vt(r))return c?!1:(i.value=r,!0)}const s=H.isArray(t)&&H.isIntegerKey(n)?Number(n)<t.length:H.hasOwn(t,n),a=Reflect.set(t,n,r,Vt(t)?t:o);return t===rt(o)&&(s?H.hasChanged(r,i)&&Or(t,"set",n,r,i):Or(t,"add",n,r)),a}deleteProperty(t,n){const r=H.hasOwn(t,n),o=t[n],i=Reflect.deleteProperty(t,n);return i&&r&&Or(t,"delete",n,void 0,o),i}has(t,n){const r=Reflect.has(t,n);return(!H.isSymbol(n)||!Pd.has(n))&&rn(t,"has",n),r}ownKeys(t){return rn(t,"iterate",H.isArray(t)?"length":Wr),Reflect.ownKeys(t)}}class Od extends Fd{constructor(t=!1){super(!0,t)}set(t,n){return ve.env.NODE_ENV!=="production"&&ur(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return ve.env.NODE_ENV!=="production"&&ur(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const vw=new bw,ww=new Od,Sw=new Od(!0),La=e=>e,zo=e=>Reflect.getPrototypeOf(e);function Ew(e,t,n){return function(...r){const o=this.__v_raw,i=rt(o),s=H.isMap(i),a=e==="entries"||e===Symbol.iterator&&s,c=e==="keys"&&s,u=o[e](...r),l=n?La:t?Ko:on;return!t&&rn(i,"iterate",c?Na:Wr),{next(){const{value:d,done:f}=u.next();return f?{value:d,done:f}:{value:a?[l(d[0]),l(d[1])]:l(d),done:f}},[Symbol.iterator](){return this}}}}function Wo(e){return function(...t){if(ve.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";ur(`${H.capitalize(e)} operation ${n}failed: target is readonly.`,rt(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function Tw(e,t){const n={get(o){const i=this.__v_raw,s=rt(i),a=rt(o);e||(H.hasChanged(o,a)&&rn(s,"get",o),rn(s,"get",a));const{has:c}=zo(s),u=t?La:e?Ko:on;if(c.call(s,o))return u(i.get(o));if(c.call(s,a))return u(i.get(a));i!==s&&i.get(o)},get size(){const o=this.__v_raw;return!e&&rn(rt(o),"iterate",Wr),Reflect.get(o,"size",o)},has(o){const i=this.__v_raw,s=rt(i),a=rt(o);return e||(H.hasChanged(o,a)&&rn(s,"has",o),rn(s,"has",a)),o===a?i.has(o):i.has(o)||i.has(a)},forEach(o,i){const s=this,a=s.__v_raw,c=rt(a),u=t?La:e?Ko:on;return!e&&rn(c,"iterate",Wr),a.forEach((l,d)=>o.call(i,u(l),u(d),s))}};return H.extend(n,e?{add:Wo("add"),set:Wo("set"),delete:Wo("delete"),clear:Wo("clear")}:{add(o){!t&&!hn(o)&&!Zn(o)&&(o=rt(o));const i=rt(this);return zo(i).has.call(i,o)||(i.add(o),Or(i,"add",o,o)),this},set(o,i){!t&&!hn(i)&&!Zn(i)&&(i=rt(i));const s=rt(this),{has:a,get:c}=zo(s);let u=a.call(s,o);u?ve.env.NODE_ENV!=="production"&&kd(s,a,o):(o=rt(o),u=a.call(s,o));const l=c.call(s,o);return s.set(o,i),u?H.hasChanged(i,l)&&Or(s,"set",o,i,l):Or(s,"add",o,i),this},delete(o){const i=rt(this),{has:s,get:a}=zo(i);let c=s.call(i,o);c?ve.env.NODE_ENV!=="production"&&kd(i,s,o):(o=rt(o),c=s.call(i,o));const u=a?a.call(i,o):void 0,l=i.delete(o);return c&&Or(i,"delete",o,void 0,u),l},clear(){const o=rt(this),i=o.size!==0,s=ve.env.NODE_ENV!=="production"?H.isMap(o)?new Map(o):new Set(o):void 0,a=o.clear();return i&&Or(o,"clear",void 0,void 0,s),a}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=Ew(o,e,t)}),n}function Ma(e,t){const n=Tw(e,t);return(r,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?r:Reflect.get(H.hasOwn(n,o)&&o in r?n:r,o,i)}const Aw={get:Ma(!1,!1)},Rw={get:Ma(!0,!1)},_w={get:Ma(!0,!0)};function kd(e,t,n){const r=rt(n);if(r!==n&&t.call(e,r)){const o=H.toRawType(e);ur(`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 xd=new WeakMap,Iw=new WeakMap,Nd=new WeakMap,$d=new WeakMap;function Cw(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Pw(e){return e.__v_skip||!Object.isExtensible(e)?0:Cw(H.toRawType(e))}function Ba(e){return Zn(e)?e:ja(e,!1,vw,Aw,xd)}function dr(e){return ja(e,!0,ww,Rw,Nd)}function Ho(e){return ja(e,!0,Sw,_w,$d)}function ja(e,t,n,r,o){if(!H.isObject(e))return ve.env.NODE_ENV!=="production"&&ur(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=Pw(e);if(i===0)return e;const s=o.get(e);if(s)return s;const a=new Proxy(e,i===2?r:n);return o.set(e,a),a}function Hr(e){return Zn(e)?Hr(e.__v_raw):!!(e&&e.__v_isReactive)}function Zn(e){return!!(e&&e.__v_isReadonly)}function hn(e){return!!(e&&e.__v_isShallow)}function Go(e){return e?!!e.__v_raw:!1}function rt(e){const t=e&&e.__v_raw;return t?rt(t):e}function Dd(e){return!H.hasOwn(e,"__v_skip")&&Object.isExtensible(e)&&H.def(e,"__v_skip",!0),e}const on=e=>H.isObject(e)?Ba(e):e,Ko=e=>H.isObject(e)?dr(e):e;function Vt(e){return e?e.__v_isRef===!0:!1}function ce(e){return Ld(e,!1)}function Fw(e){return Ld(e,!0)}function Ld(e,t){return Vt(e)?e:new Ow(e,t)}class Ow{constructor(t,n){this.dep=new Uo,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:rt(t),this._value=n?t:on(t),this.__v_isShallow=n}get value(){return ve.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||hn(t)||Zn(t);t=r?t:rt(t),H.hasChanged(t,n)&&(this._rawValue=t,this._value=r?t:on(t),ve.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:t,oldValue:n}):this.dep.trigger())}}function p(e){return Vt(e)?e.value:e}const kw={get:(e,t,n)=>t==="__v_raw"?e:p(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return Vt(o)&&!Vt(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function xw(e){return Hr(e)?e:new Proxy(e,kw)}class Nw{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Uo,{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 Md(e){return new Nw(e)}class $w{constructor(t,n,r){this._object=t,this._key=n,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0}get value(){const t=this._object[this._key];return this._value=t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return pw(rt(this._object),this._key)}}class Dw{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 Lw(e,t,n){return Vt(e)?e:H.isFunction(e)?new Dw(e):H.isObject(e)&&arguments.length>1?Mw(e,t,n):ce(e)}function Mw(e,t,n){const r=e[t];return Vt(r)?r:new $w(e,t,n)}class Bw{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Uo(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Hi-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&ct!==this)return Sd(this,!0),!0;ve.env.NODE_ENV}get value(){const t=ve.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return Ad(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter?this.setter(t):ve.env.NODE_ENV!=="production"&&ur("Write operation failed: computed value is readonly")}}function jw(e,t,n=!1){let r,o;H.isFunction(e)?r=e:(r=e.get,o=e.set);const i=new Bw(r,o,n);return ve.env.NODE_ENV,i}const Qo={},Xo=new WeakMap;let Gr;function Uw(e,t=!1,n=Gr){if(n){let r=Xo.get(n);r||Xo.set(n,r=[]),r.push(e)}else ve.env.NODE_ENV!=="production"&&!t&&ur("onWatcherCleanup() was called when there was no active watcher to associate with.")}function qw(e,t,n=H.EMPTY_OBJ){const{immediate:r,deep:o,once:i,scheduler:s,augmentJob:a,call:c}=n,u=h=>{(n.onWarn||ur)("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.")},l=h=>o?h:hn(h)||o===!1||o===0?pr(h,1):pr(h);let d,f,m,w,y=!1,E=!1;if(Vt(e)?(f=()=>e.value,y=hn(e)):Hr(e)?(f=()=>l(e),y=!0):H.isArray(e)?(E=!0,y=e.some(h=>Hr(h)||hn(h)),f=()=>e.map(h=>{if(Vt(h))return h.value;if(Hr(h))return l(h);if(H.isFunction(h))return c?c(h,2):h();ve.env.NODE_ENV!=="production"&&u(h)})):H.isFunction(e)?t?f=c?()=>c(e,2):e:f=()=>{if(m){bi();try{m()}finally{vi()}}const h=Gr;Gr=d;try{return c?c(e,3,[w]):e(w)}finally{Gr=h}}:(f=H.NOOP,ve.env.NODE_ENV!=="production"&&u(e)),t&&o){const h=f,S=o===!0?1/0:o;f=()=>pr(h(),S)}const b=()=>{d.stop()};if(i&&t){const h=t;t=(...S)=>{h(...S),b()}}let g=E?new Array(e.length).fill(Qo):Qo;const v=h=>{if(!(!(d.flags&1)||!d.dirty&&!h))if(t){const S=d.run();if(o||y||(E?S.some((T,R)=>H.hasChanged(T,g[R])):H.hasChanged(S,g))){m&&m();const T=Gr;Gr=d;try{const R=[S,g===Qo?void 0:E&&g[0]===Qo?[]:g,w];g=S,c?c(t,3,R):t(...R)}finally{Gr=T}}}else d.run()};return a&&a(v),d=new uw(f),d.scheduler=s?()=>s(v,!1):v,w=h=>Uw(h,!1,d),m=d.onStop=()=>{const h=Xo.get(d);if(h){if(c)c(h,4);else for(const S of h)S();Xo.delete(d)}},ve.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(),b.pause=d.pause.bind(d),b.resume=d.resume.bind(d),b.stop=b,b}function pr(e,t=1/0,n){if(t<=0||!H.isObject(e)||e.__v_skip||(n=n||new Set,n.has(e)))return e;if(n.add(e),t--,Vt(e))pr(e.value,t,n);else if(H.isArray(e))for(let r=0;r<e.length;r++)pr(e[r],t,n);else if(H.isSet(e)||H.isMap(e))e.forEach(r=>{pr(r,t,n)});else if(H.isPlainObject(e)){for(const r in e)pr(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&pr(e[r],t,n)}return e}const Kr=[];function Vw(e){Kr.push(e)}function zw(){Kr.pop()}let Ua=!1;function Ze(e,...t){if(Ua)return;Ua=!0,bi();const n=Kr.length?Kr[Kr.length-1].component:null,r=n&&n.appContext.config.warnHandler,o=Ww();if(r)Yo(r,n,11,[e+t.map(i=>{var s,a;return(a=(s=i.toString)==null?void 0:s.call(i))!=null?a:JSON.stringify(i)}).join(""),n&&n.proxy,o.map(({vnode:i})=>`at <${Rp(n,i.type)}>`).join(`
2
2
  `),o]);else{const i=[`[Vue warn]: ${e}`,...t];o.length&&i.push(`
3
- `,...Mw(o)),console.warn(...i)}bi(),$a=!1}function Lw(){let e=Gr[Gr.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 Mw(e){const t=[];return e.forEach((n,r)=>{t.push(...r===0?[]:[`
4
- `],...Bw(n))}),t}function Bw({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",r=e.component?e.component.parent==null:!1,o=` at <${mp(e.component,e.type,r)}`,i=">"+n;return e.props?[o,...jw(e.props),i]:[o+i]}function jw(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(r=>{t.push(...Pd(r,e[r]))}),n.length>3&&t.push(" ..."),t}function Pd(e,t,n){return W.isString(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:Ut(t)?(t=Pd(e,nt(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):W.isFunction(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=nt(t),n?t:[`${e}=`,t])}const Da={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 Jo(e,t,n,r){try{return r?e(...r):e()}catch(o){Zo(o,t,n)}}function La(e,t,n,r){if(W.isFunction(e)){const o=Jo(e,t,n,r);return o&&W.isPromise(o)&&o.catch(i=>{Zo(i,t,n)}),o}if(W.isArray(e)){const o=[];for(let i=0;i<e.length;i++)o.push(La(e[i],t,n,r));return o}else we.env.NODE_ENV!=="production"&&et(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function Zo(e,t,n,r=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||W.EMPTY_OBJ;if(t){let a=t.parent;const c=t.proxy,u=we.env.NODE_ENV!=="production"?Da[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const l=a.ec;if(l){for(let f=0;f<l.length;f++)if(l[f](e,c,u)===!1)return}a=a.parent}if(i){yi(),Jo(i,null,10,[e,c,u]),bi();return}}Uw(e,n,o,r,s)}function Uw(e,t,n,r=!0,o=!1){if(we.env.NODE_ENV!=="production"){const i=Da[t];if(n&&$w(n),et(`Unhandled error${i?` during execution of ${i}`:""}`),n&&Dw(),r)throw e;console.error(e)}else{if(o)throw e;console.error(e)}}const On=[];let hr=-1;const wi=[];let Fr=null,Si=0;const Fd=Promise.resolve();let es=null;const qw=100;function zn(e){const t=es||Fd;return e?t.then(this?e.bind(this):e):t}function Vw(e){let t=hr+1,n=On.length;for(;t<n;){const r=t+n>>>1,o=On[r],i=Qi(o);i<e||i===e&&o.flags&2?t=r+1:n=r}return t}function Ma(e){if(!(e.flags&1)){const t=Qi(e),n=On[On.length-1];!n||!(e.flags&2)&&t>=Qi(n)?On.push(e):On.splice(Vw(t),0,e),e.flags|=1,Od()}}function Od(){es||(es=Fd.then(xd))}function kd(e){W.isArray(e)?wi.push(...e):Fr&&e.id===-1?Fr.splice(Si+1,0,e):e.flags&1||(wi.push(e),e.flags|=1),Od()}function zw(e){if(wi.length){const t=[...new Set(wi)].sort((n,r)=>Qi(n)-Qi(r));if(wi.length=0,Fr){Fr.push(...t);return}for(Fr=t,we.env.NODE_ENV!=="production"&&(e=e||new Map),Si=0;Si<Fr.length;Si++){const n=Fr[Si];we.env.NODE_ENV!=="production"&&Nd(e,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}Fr=null,Si=0}}const Qi=e=>e.id==null?e.flags&2?-1:1/0:e.id;function xd(e){we.env.NODE_ENV!=="production"&&(e=e||new Map);const t=we.env.NODE_ENV!=="production"?n=>Nd(e,n):W.NOOP;try{for(hr=0;hr<On.length;hr++){const n=On[hr];if(n&&!(n.flags&8)){if(we.env.NODE_ENV!=="production"&&t(n))continue;n.flags&4&&(n.flags&=-2),Jo(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;hr<On.length;hr++){const n=On[hr];n&&(n.flags&=-2)}hr=-1,On.length=0,zw(e),es=null,(On.length||wi.length)&&xd(e)}}function Nd(e,t){const n=e.get(t)||0;if(n>qw){const r=t.i,o=r&&el(r.type);return Zo(`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 Xi=!1;const Ba=new Map;we.env.NODE_ENV!=="production"&&(W.getGlobalThis().__VUE_HMR_RUNTIME__={createRecord:ja(Ww),rerender:ja(Hw),reload:ja(Gw)});const ts=new Map;function Ww(e,t){return ts.has(e)?!1:(ts.set(e,{initialDef:ns(t),instances:new Set}),!0)}function ns(e){return yp(e)?e.__vccOpts:e}function Hw(e,t){const n=ts.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(r=>{t&&(r.render=t,ns(r.type).render=t),r.renderCache=[],Xi=!0,r.update(),Xi=!1}))}function Gw(e,t){const n=ts.get(e);if(!n)return;t=ns(t),$d(n.initialDef,t);const r=[...n.instances];for(let o=0;o<r.length;o++){const i=r[o],s=ns(i.type);let a=Ba.get(s);a||(s!==n.initialDef&&$d(s,t),Ba.set(s,a=new Set)),a.add(i),i.appContext.propsCache.delete(i.type),i.appContext.emitsCache.delete(i.type),i.appContext.optionsCache.delete(i.type),i.ceReload?(a.add(i),i.ceReload(t.styles),a.delete(i)):i.parent?Ma(()=>{Xi=!0,i.parent.update(),Xi=!1,a.delete(i)}):i.appContext.reload?i.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),i.root.ce&&i!==i.root&&i.root.ce._removeChildStyle(s)}kd(()=>{Ba.clear()})}function $d(e,t){W.extend(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function ja(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 Or,Yi=[],Ua=!1;function Kw(e,...t){Or?Or.emit(e,...t):Ua||Yi.push({event:e,args:t})}function Dd(e,t){var n,r;Or=e,Or?(Or.enabled=!0,Yi.forEach(({event:o,args:i})=>Or.emit(o,...i)),Yi=[]):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(i=>{Dd(i,t)}),setTimeout(()=>{Or||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Ua=!0,Yi=[])},3e3)):(Ua=!0,Yi=[])}const Qw=Xw("component:updated");/*! #__NO_SIDE_EFFECTS__ */function Xw(e){return t=>{Kw(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}let nn=null,Ld=null;function Md(e){const t=nn;return nn=e,Ld=e&&e.type.__scopeId||null,t}function Ee(e,t=nn,n){if(!t||e._n)return e;const r=(...o)=>{r._d&&lp(-1);const i=Md(t);let s;try{s=e(...o)}finally{Md(i),r._d&&lp(1)}return we.env.NODE_ENV!=="production"&&Qw(t),s};return r._n=!0,r._c=!0,r._d=!0,r}function it(e,t){if(nn===null)return we.env.NODE_ENV!=="production"&&et("withDirectives can only be used inside render functions."),e;const n=gp(nn),r=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,s,a,c=W.EMPTY_OBJ]=t[o];i&&(W.isFunction(i)&&(i={mounted:i,updated:i}),i.deep&&pr(s),r.push({dir:i,instance:n,value:s,oldValue:void 0,arg:a,modifiers:c}))}return e}const Yw=Symbol("_vte"),Jw=e=>e.__isTeleport,Kr=e=>e&&(e.disabled||e.disabled===""),Bd=e=>e&&(e.defer||e.defer===""),jd=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Ud=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,qa=(e,t)=>{const n=e&&e.to;if(W.isString(n))if(t){const r=t(n);return we.env.NODE_ENV!=="production"&&!r&&!Kr(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 we.env.NODE_ENV!=="production"&&et("Current renderer does not support string target for Teleports. (missing querySelector renderer option)"),null;else return we.env.NODE_ENV!=="production"&&!n&&!Kr(e)&&et(`Invalid Teleport target: ${n}`),n},qd={name:"Teleport",__isTeleport:!0,process(e,t,n,r,o,i,s,a,c,u){const{mc:l,pc:f,pbc:d,o:{insert:m,querySelector:w,createText:v,createComment:T}}=u,y=Kr(t.props);let{shapeFlag:g,children:h,dynamicChildren:b}=t;if(we.env.NODE_ENV!=="production"&&Xi&&(c=!1,b=null),e==null){const S=t.el=we.env.NODE_ENV!=="production"?T("teleport start"):v(""),E=t.anchor=we.env.NODE_ENV!=="production"?T("teleport end"):v("");m(S,n,r),m(E,n,r);const I=(A,N)=>{g&16&&(o&&o.isCE&&(o.ce._teleportTarget=A),l(h,A,N,o,i,s,a,c))},R=()=>{const A=t.target=qa(t.props,w),N=zd(A,t,v,m);A?(s!=="svg"&&jd(A)?s="svg":s!=="mathml"&&Ud(A)&&(s="mathml"),y||(I(A,N),is(t,!1))):we.env.NODE_ENV!=="production"&&!y&&et("Invalid Teleport target on mount:",A,`(${typeof A})`)};y&&(I(n,E),is(t,!0)),Bd(t.props)?Qa(()=>{R(),t.el.__isMounted=!0},i):R()}else{if(Bd(t.props)&&!e.el.__isMounted){Qa(()=>{qd.process(e,t,n,r,o,i,s,a,c,u),delete e.el.__isMounted},i);return}t.el=e.el,t.targetStart=e.targetStart;const S=t.anchor=e.anchor,E=t.target=e.target,I=t.targetAnchor=e.targetAnchor,R=Kr(e.props),A=R?n:E,N=R?S:I;if(s==="svg"||jd(E)?s="svg":(s==="mathml"||Ud(E))&&(s="mathml"),b?(d(e.dynamicChildren,b,A,o,i,s,a),op(e,t,we.env.NODE_ENV==="production")):c||f(e,t,A,N,o,i,s,a,!1),y)R?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):rs(t,n,S,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const L=t.target=qa(t.props,w);L?rs(t,L,null,u,0):we.env.NODE_ENV!=="production"&&et("Invalid Teleport target on update:",E,`(${typeof E})`)}else R&&rs(t,E,I,u,1);is(t,y)}},remove(e,t,n,{um:r,o:{remove:o}},i){const{shapeFlag:s,children:a,anchor:c,targetStart:u,targetAnchor:l,target:f,props:d}=e;if(f&&(o(u),o(l)),i&&o(c),s&16){const m=i||!Kr(d);for(let w=0;w<a.length;w++){const v=a[w];r(v,t,n,m,!!v.dynamicChildren)}}},move:rs,hydrate:Zw};function rs(e,t,n,{o:{insert:r},m:o},i=2){i===0&&r(e.targetAnchor,t,n);const{el:s,anchor:a,shapeFlag:c,children:u,props:l}=e,f=i===2;if(f&&r(s,t,n),(!f||Kr(l))&&c&16)for(let d=0;d<u.length;d++)o(u[d],t,n,2);f&&r(a,t,n)}function Zw(e,t,n,r,o,i,{o:{nextSibling:s,parentNode:a,querySelector:c,insert:u,createText:l}},f){const d=t.target=qa(t.props,c);if(d){const m=Kr(t.props),w=d._lpa||d.firstChild;if(t.shapeFlag&16)if(m)t.anchor=f(s(e),t,a(e),n,r,o,i),t.targetStart=w,t.targetAnchor=w&&s(w);else{t.anchor=s(e);let v=w;for(;v;){if(v&&v.nodeType===8){if(v.data==="teleport start anchor")t.targetStart=v;else if(v.data==="teleport anchor"){t.targetAnchor=v,d._lpa=t.targetAnchor&&s(t.targetAnchor);break}}v=s(v)}t.targetAnchor||zd(d,t,l,u),f(w&&s(w),t,d,n,r,o,i)}is(t,m)}return t.anchor&&s(t.anchor)}const Vd=qd;function is(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 zd(e,t,n,r){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Yw]=i,e&&(r(o,e),r(i,e)),i}function Wd(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Wd(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}/*! #__NO_SIDE_EFFECTS__ */function $e(e,t){return W.isFunction(e)?W.extend({name:e.name},t,{setup:e}):e}function eS(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const tS=new WeakSet;function Hd(e){const t=Ja(),n=Ew(null);if(t){const o=t.refs===W.EMPTY_OBJ?t.refs={}:t.refs;let i;we.env.NODE_ENV!=="production"&&(i=Object.getOwnPropertyDescriptor(o,e))&&!i.configurable?et(`useTemplateRef('${e}') already exists.`):Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:s=>n.value=s})}else we.env.NODE_ENV!=="production"&&et("useTemplateRef() is called when there is no active component instance to be associated with.");const r=we.env.NODE_ENV!=="production"?dr(n):n;return we.env.NODE_ENV!=="production"&&tS.add(r),r}const Gd=e=>e.nodeType===8;W.getGlobalThis().requestIdleCallback,W.getGlobalThis().cancelIdleCallback;function nS(e,t){if(Gd(e)&&e.data==="["){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(Gd(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else t(e)}const rS=e=>!!e.type.__asyncLoader;/*! #__NO_SIDE_EFFECTS__ */function iS(e){W.isFunction(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:o=200,hydrate:i,timeout:s,suspensible:a=!0,onError:c}=e;let u=null,l,f=0;const d=()=>(f++,u=null,m()),m=()=>{let w;return u||(w=u=t().catch(v=>{if(v=v instanceof Error?v:new Error(String(v)),c)return new Promise((T,y)=>{c(v,()=>T(d()),()=>y(v),f+1)});throw v}).then(v=>{if(w!==u&&u)return u;if(we.env.NODE_ENV!=="production"&&!v&&et("Async component loader resolved to undefined. If you are using retry(), make sure to return its return value."),v&&(v.__esModule||v[Symbol.toStringTag]==="Module")&&(v=v.default),we.env.NODE_ENV!=="production"&&v&&!W.isObject(v)&&!W.isFunction(v))throw new Error(`Invalid async component load result: ${v}`);return l=v,v}))};return $e({name:"AsyncComponentWrapper",__asyncLoader:m,__asyncHydrate(w,v,T){const y=i?()=>{const g=i(T,h=>nS(w,h));g&&(v.bum||(v.bum=[])).push(g)}:T;l?y():m().then(()=>!v.isUnmounted&&y())},get __asyncResolved(){return l},setup(){const w=Tn;if(eS(w),l)return()=>Va(l,w);const v=h=>{u=null,Zo(h,w,13,!r)};if(a&&w.suspense||Ri)return m().then(h=>()=>Va(h,w)).catch(h=>(v(h),()=>r?me(r,{error:h}):null));const T=le(!1),y=le(),g=le(!!o);return o&&setTimeout(()=>{g.value=!1},o),s!=null&&setTimeout(()=>{if(!T.value&&!y.value){const h=new Error(`Async component timed out after ${s}ms.`);v(h),y.value=h}},s),m().then(()=>{T.value=!0,w.parent&&oS(w.parent.vnode)&&w.parent.update()}).catch(h=>{v(h),y.value=h}),()=>{if(T.value&&l)return Va(l,w);if(y.value&&r)return me(r,{error:y.value});if(n&&!g.value)return me(n)}}})}function Va(e,t){const{ref:n,props:r,children:o,ce:i}=t.vnode,s=me(e,r,o);return s.ref=n,s.ce=i,delete t.vnode.ce,s}const oS=e=>e.type.__isKeepAlive;function sS(e,t,n=Tn,r=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...s)=>{yi();const a=pp(n),c=La(t,n,e,s);return a(),bi(),c});return r?o.unshift(i):o.push(i),i}else if(we.env.NODE_ENV!=="production"){const o=W.toHandlerKey(Da[e].replace(/ hook$/,""));et(`${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 os=e=>(t,n=Tn)=>{(!Ri||e==="sp")&&sS(e,(...r)=>t(...r),n)},qt=os("m"),aS=os("bu"),Wn=os("bum"),za=os("um"),ss="components",lS="directives";function ye(e,t){return Wa(ss,e,!0,t)||e}const Kd=Symbol.for("v-ndc");function kr(e){return W.isString(e)?Wa(ss,e,!1)||e:e||Kd}function cn(e){return Wa(lS,e)}function Wa(e,t,n=!0,r=!1){const o=nn||Tn;if(o){const i=o.type;if(e===ss){const a=el(i,!1);if(a&&(a===t||a===W.camelize(t)||a===W.capitalize(W.camelize(t))))return i}const s=Qd(o[e]||i[e],t)||Qd(o.appContext[e],t);if(!s&&r)return i;if(we.env.NODE_ENV!=="production"&&n&&!s){const a=e===ss?`
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 we.env.NODE_ENV!=="production"&&et(`resolve${W.capitalize(e.slice(0,-1))} can only be used in render() or setup().`)}function Qd(e,t){return e&&(e[t]||e[W.camelize(t)]||e[W.capitalize(W.camelize(t))])}function xt(e,t,n,r){let o;const i=n,s=W.isArray(e);if(s||W.isString(e)){const a=s&&Wr(e);let c=!1,u=!1;a&&(c=!gn(e),u=Jn(e),e=zo(e)),o=new Array(e.length);for(let l=0,f=e.length;l<f;l++)o[l]=t(c?u?Qo(sn(e[l])):sn(e[l]):e[l],l,void 0,i)}else if(typeof e=="number"){we.env.NODE_ENV!=="production"&&!Number.isInteger(e)&&et(`The v-for range expect an integer value but got ${e}.`),o=new Array(e);for(let a=0;a<e;a++)o[a]=t(a+1,a,void 0,i)}else if(W.isObject(e))if(e[Symbol.iterator])o=Array.from(e,(a,c)=>t(a,c,void 0,i));else{const a=Object.keys(e);o=new Array(a.length);for(let c=0,u=a.length;c<u;c++){const l=a[c];o[c]=t(e[l],l,c,i)}}else o=[];return o}function Xd(e,t){for(let n=0;n<t.length;n++){const r=t[n];if(W.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 i=r.fn(...o);return i&&(i.key=r.key),i}:r.fn)}return e}function He(e,t,n={},r,o){if(nn.ce||nn.parent&&rS(nn.parent)&&nn.parent.ce)return t!=="default"&&(n.name=t),J(),Ie(Ge,null,[me("slot",n,r&&r())],64);let i=e[t];we.env.NODE_ENV!=="production"&&i&&i.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."),i=()=>[]),i&&i._c&&(i._d=!1),J();const s=i&&Yd(i(n)),a=n.key||s&&s.key,c=Ie(Ge,{key:(a&&!W.isSymbol(a)?a:`_${t}`)+(!s&&r?"_fb":"")},s||(r?r():[]),s&&e._===1?64:-2);return!o&&c.scopeId&&(c.slotScopeIds=[c.scopeId+"-s"]),i&&i._c&&(i._d=!0),c}function Yd(e){return e.some(t=>cs(t)?!(t.type===Ti||t.type===Ge&&!Yd(t.children)):!0)?e:null}function Ha(e,t){const n={};if(we.env.NODE_ENV!=="production"&&!W.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}`:W.toHandlerKey(r)]=e[r];return n}const Ga=e=>e?_S(e)?gp(e):Ga(e.parent):null,Ka=W.extend(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>we.env.NODE_ENV!=="production"?Go(e.props):e.props,$attrs:e=>we.env.NODE_ENV!=="production"?Go(e.attrs):e.attrs,$slots:e=>we.env.NODE_ENV!=="production"?Go(e.slots):e.slots,$refs:e=>we.env.NODE_ENV!=="production"?Go(e.refs):e.refs,$parent:e=>Ga(e.parent),$root:e=>Ga(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>fS(e),$forceUpdate:e=>e.f||(e.f=()=>{Ma(e.update)}),$nextTick:e=>e.n||(e.n=zn.bind(e.proxy)),$watch:e=>vS.bind(e)}),cS={};we.env.NODE_ENV!=="production"&&(cS.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 uS(){return Zd().slots}function Jd(){return Zd().attrs}function Zd(){const e=Ja();return we.env.NODE_ENV!=="production"&&!e&&et("useContext() called without active instance."),e.setupContext||(e.setupContext=CS(e))}function ep(e){return W.isArray(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function fS(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:s}}=e.appContext,a=i.get(t);let c;return a?c=a:!o.length&&!n&&!r?c=t:(c={},o.length&&o.forEach(u=>as(c,u,s,!0)),as(c,t,s)),W.isObject(t)&&i.set(t,c),c}function as(e,t,n,r=!1){const{mixins:o,extends:i}=t;i&&as(e,i,n,!0),o&&o.forEach(s=>as(e,s,n,!0));for(const s in t)if(r&&s==="expose")we.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=dS[s]||n&&n[s];e[s]=a?a(e[s],t[s]):t[s]}return e}const dS={data:tp,props:rp,emits:rp,methods:Ji,computed:Ji,beforeCreate:mn,created:mn,beforeMount:mn,mounted:mn,beforeUpdate:mn,updated:mn,beforeDestroy:mn,beforeUnmount:mn,destroyed:mn,unmounted:mn,activated:mn,deactivated:mn,errorCaptured:mn,serverPrefetch:mn,components:Ji,directives:Ji,watch:hS,provide:tp,inject:pS};function tp(e,t){return t?e?function(){return W.extend(W.isFunction(e)?e.call(this,this):e,W.isFunction(t)?t.call(this,this):t)}:t:e}function pS(e,t){return Ji(np(e),np(t))}function np(e){if(W.isArray(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function mn(e,t){return e?[...new Set([].concat(e,t))]:t}function Ji(e,t){return e?W.extend(Object.create(null),e,t):t}function rp(e,t){return e?W.isArray(e)&&W.isArray(t)?[...new Set([...e,...t])]:W.extend(Object.create(null),ep(e),ep(t??{})):t}function hS(e,t){if(!e)return t;if(!t)return e;const n=W.extend(Object.create(null),e);for(const r in t)n[r]=mn(e[r],t[r]);return n}let gS=null;function Ei(e,t){if(!Tn)we.env.NODE_ENV!=="production"&&et("provide() can only be used inside setup().");else{let n=Tn.provides;const r=Tn.parent&&Tn.parent.provides;r===n&&(n=Tn.provides=Object.create(r)),n[e]=t}}function gr(e,t,n=!1){const r=Tn||nn;if(r||gS){const o=r?r.parent==null?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&&W.isFunction(t)?t.call(r&&r.proxy):t;we.env.NODE_ENV!=="production"&&et(`injection "${String(e)}" not found.`)}else we.env.NODE_ENV!=="production"&&et("inject() can only be used inside setup() or functional components.")}const mS={},ip=e=>Object.getPrototypeOf(e)===mS,Qa=ES;function op(e,t,n=!1){const r=e.children,o=t.children;if(W.isArray(r)&&W.isArray(o))for(let i=0;i<r.length;i++){const s=r[i];let a=o[i];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=o[i]=RS(o[i]),a.el=s.el),!n&&a.patchFlag!==-2&&op(s,a)),a.type===ap&&(a.el=s.el),a.type===Ti&&!a.el&&(a.el=s.el),we.env.NODE_ENV!=="production"&&a.el&&(a.el.__vnode=a)}}const yS=Symbol.for("v-scx"),bS=()=>{{const e=gr(yS);return e||we.env.NODE_ENV!=="production"&&et("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function Et(e,t,n){return we.env.NODE_ENV!=="production"&&!W.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."),sp(e,t,n)}function sp(e,t,n=W.EMPTY_OBJ){const{immediate:r,deep:o,flush:i,once:s}=n;we.env.NODE_ENV!=="production"&&!t&&(r!==void 0&&et('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),o!==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=W.extend({},n);we.env.NODE_ENV!=="production"&&(a.onWarn=et);const c=t&&r||!t&&i!=="post";let u;if(Ri){if(i==="sync"){const m=bS();u=m.__watcherHandles||(m.__watcherHandles=[])}else if(!c){const m=()=>{};return m.stop=W.NOOP,m.resume=W.NOOP,m.pause=W.NOOP,m}}const l=Tn;a.call=(m,w,v)=>La(m,l,w,v);let f=!1;i==="post"?a.scheduler=m=>{Qa(m,l&&l.suspense)}:i!=="sync"&&(f=!0,a.scheduler=(m,w)=>{w?m():Ma(m)}),a.augmentJob=m=>{t&&(m.flags|=4),f&&(m.flags|=2,l&&(m.id=l.uid,m.i=l))};const d=Nw(e,t,a);return Ri&&(u?u.push(d):c&&d()),d}function vS(e,t,n){const r=this.proxy,o=W.isString(e)?e.includes(".")?wS(r,e):()=>r[e]:e.bind(r,r);let i;W.isFunction(t)?i=t:(i=t.handler,n=t);const s=pp(this),a=sp(o,i.bind(r),n);return s(),a}function wS(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 SS=e=>e.__isSuspense;function ES(e,t){t&&t.pendingBranch?W.isArray(e)?t.effects.push(...e):t.effects.push(e):kd(e)}const Ge=Symbol.for("v-fgt"),ap=Symbol.for("v-txt"),Ti=Symbol.for("v-cmt"),ls=[];let _n=null;function J(e=!1){ls.push(_n=e?null:[])}function TS(){ls.pop(),_n=ls[ls.length-1]||null}let Zi=1;function lp(e,t=!1){Zi+=e,e<0&&_n&&t&&(_n.hasOnce=!0)}function cp(e){return e.dynamicChildren=Zi>0?_n||W.EMPTY_ARR:null,TS(),Zi>0&&_n&&_n.push(e),e}function ge(e,t,n,r,o,i){return cp(pe(e,t,n,r,o,i,!0))}function Ie(e,t,n,r,o){return cp(me(e,t,n,r,o,!0))}function cs(e){return e?e.__v_isVNode===!0:!1}const AS=(...e)=>fp(...e),up=({key:e})=>e??null,us=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?W.isString(e)||Ut(e)||W.isFunction(e)?{i:nn,r:e,k:t,f:!!n}:e:null);function pe(e,t=null,n=null,r=0,o=null,i=e===Ge?0:1,s=!1,a=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&up(t),ref:t&&us(t),scopeId:Ld,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:i,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:nn};return a?(Ya(c,n),i&128&&e.normalize(c)):n&&(c.shapeFlag|=W.isString(n)?8:16),we.env.NODE_ENV!=="production"&&c.key!==c.key&&et("VNode created with invalid key (NaN). VNode type:",c.type),Zi>0&&!s&&_n&&(c.patchFlag>0||i&6)&&c.patchFlag!==32&&_n.push(c),c}const me=we.env.NODE_ENV!=="production"?AS:fp;function fp(e,t=null,n=null,r=0,o=null,i=!1){if((!e||e===Kd)&&(we.env.NODE_ENV!=="production"&&!e&&et(`Invalid vnode type when creating vnode: ${e}.`),e=Ti),cs(e)){const a=Ai(e,t,!0);return n&&Ya(a,n),Zi>0&&!i&&_n&&(a.shapeFlag&6?_n[_n.indexOf(e)]=a:_n.push(a)),a.patchFlag=-2,a}if(yp(e)&&(e=e.__vccOpts),t){t=Xa(t);let{class:a,style:c}=t;a&&!W.isString(a)&&(t.class=W.normalizeClass(a)),W.isObject(c)&&(Ko(c)&&!W.isArray(c)&&(c=W.extend({},c)),t.style=W.normalizeStyle(c))}const s=W.isString(e)?1:SS(e)?128:Jw(e)?64:W.isObject(e)?4:W.isFunction(e)?2:0;return we.env.NODE_ENV!=="production"&&s&4&&Ko(e)&&(e=nt(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)),pe(e,t,n,r,o,s,i,!0)}function Xa(e){return e?Ko(e)||ip(e)?W.extend({},e):e:null}function Ai(e,t,n=!1,r=!1){const{props:o,ref:i,patchFlag:s,children:a,transition:c}=e,u=t?Kt(o||{},t):o,l={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&up(u),ref:t&&t.ref?n&&i?W.isArray(i)?i.concat(us(t)):[i,us(t)]:us(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:we.env.NODE_ENV!=="production"&&s===-1&&W.isArray(a)?a.map(dp):a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ge?s===-1?16:s|16:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ai(e.ssContent),ssFallback:e.ssFallback&&Ai(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&Wd(l,c.clone(l)),l}function dp(e){const t=Ai(e);return W.isArray(e.children)&&(t.children=e.children.map(dp)),t}function Gt(e=" ",t=0){return me(ap,null,e,t)}function Pe(e="",t=!1){return t?(J(),Ie(Ti,null,e)):me(Ti,null,e)}function RS(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ai(e)}function Ya(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(W.isArray(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),Ya(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!ip(t)?t._ctx=nn:o===3&&nn&&(nn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else W.isFunction(t)?(t={default:t,_ctx:nn},n=32):(t=String(t),r&64?(n=16,t=[Gt(t)]):n=8);e.children=t,e.shapeFlag|=n}function Kt(...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=W.normalizeClass([t.class,r.class]));else if(o==="style")t.style=W.normalizeStyle([t.style,r.style]);else if(W.isOn(o)){const i=t[o],s=r[o];s&&i!==s&&!(W.isArray(i)&&i.includes(s))&&(t[o]=i?[].concat(i,s):s)}else o!==""&&(t[o]=r[o])}return t}let Tn=null;const Ja=()=>Tn||nn;let Za;{const e=W.getGlobalThis(),t=(n,r)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(r),i=>{o.length>1?o.forEach(s=>s(i)):o[0](i)}};Za=t("__VUE_INSTANCE_SETTERS__",n=>Tn=n),t("__VUE_SSR_SETTERS__",n=>Ri=n)}const pp=e=>{const t=Tn;return Za(e),e.scope.on(),()=>{e.scope.off(),Za(t)}};function _S(e){return e.vnode.shapeFlag&4}let Ri=!1;const hp=we.env.NODE_ENV!=="production"?{get(e,t){return on(e,"get",""),e[t]},set(){return et("setupContext.attrs is readonly."),!1},deleteProperty(){return et("setupContext.attrs is readonly."),!1}}:{get(e,t){return on(e,"get",""),e[t]}};function IS(e){return new Proxy(e.slots,{get(t,n){return on(e,"get","$slots"),t[n]}})}function CS(e){const t=n=>{if(we.env.NODE_ENV!=="production"&&(e.exposed&&et("expose() should be called only once per setup()."),n!=null)){let r=typeof n;r==="object"&&(W.isArray(n)?r="array":Ut(n)&&(r="ref")),r!=="object"&&et(`expose() should be passed a plain object, received ${r}.`)}e.exposed=n||{}};if(we.env.NODE_ENV!=="production"){let n,r;return Object.freeze({get attrs(){return n||(n=new Proxy(e.attrs,hp))},get slots(){return r||(r=IS(e))},get emit(){return(o,...i)=>e.emit(o,...i)},expose:t})}else return{attrs:new Proxy(e.attrs,hp),slots:e.slots,emit:e.emit,expose:t}}function gp(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Rw(Sw(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ka)return Ka[n](e)},has(t,n){return n in t||n in Ka}})):e.proxy}const PS=/(?:^|[-_])(\w)/g,FS=e=>e.replace(PS,t=>t.toUpperCase()).replace(/[-_]/g,"");function el(e,t=!0){return W.isFunction(e)?e.displayName||e.name:e.name||t&&e.__name}function mp(e,t,n=!1){let r=el(t);if(!r&&t.__file){const o=t.__file.match(/([^/\\]+)\.\w+$/);o&&(r=o[1])}if(!r&&e&&e.parent){const o=i=>{for(const s in i)if(i[s]===t)return s};r=o(e.components||e.parent.type.components)||o(e.appContext.components)}return r?FS(r):n?"App":"Anonymous"}function yp(e){return W.isFunction(e)&&"__vccOpts"in e}const j=(e,t)=>{const n=kw(e,t,Ri);if(we.env.NODE_ENV!=="production"){const r=Ja();r&&r.appContext.config.warnRecursiveComputed&&(n._warnRecursive=!0)}return n};function tl(e,t,n){const r=arguments.length;return r===2?W.isObject(t)&&!W.isArray(t)?cs(t)?me(e,null,[t]):me(e,t):me(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&cs(n)&&(n=[n]),me(e,t,n))}function OS(){if(we.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(f){if(!W.isObject(f))return null;if(f.__isVue)return["div",e,"VueInstance"];if(Ut(f)){yi();const d=f.value;return bi(),["div",{},["span",e,l(f)],"<",a(d),">"]}else{if(Wr(f))return["div",{},["span",e,gn(f)?"ShallowReactive":"Reactive"],"<",a(f),`>${Jn(f)?" (readonly)":""}`];if(Jn(f))return["div",{},["span",e,gn(f)?"ShallowReadonly":"Readonly"],"<",a(f),">"]}return null},hasBody(f){return f&&f.__isVue},body(f){if(f&&f.__isVue)return["div",{},...i(f.$)]}};function i(f){const d=[];f.type.props&&f.props&&d.push(s("props",nt(f.props))),f.setupState!==W.EMPTY_OBJ&&d.push(s("setup",f.setupState)),f.data!==W.EMPTY_OBJ&&d.push(s("data",nt(f.data)));const m=c(f,"computed");m&&d.push(s("computed",m));const w=c(f,"inject");return w&&d.push(s("injected",w)),d.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:f}]]),d}function s(f,d){return d=W.extend({},d),Object.keys(d).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},f],["div",{style:"padding-left:1.25em"},...Object.keys(d).map(m=>["div",{},["span",r,m+": "],a(d[m],!1)])]]:["span",{}]}function a(f,d=!0){return typeof f=="number"?["span",t,f]:typeof f=="string"?["span",n,JSON.stringify(f)]:typeof f=="boolean"?["span",r,f]:W.isObject(f)?["object",{object:d?nt(f):f}]:["span",n,String(f)]}function c(f,d){const m=f.type;if(W.isFunction(m))return;const w={};for(const v in f.ctx)u(m,v,d)&&(w[v]=f.ctx[v]);return w}function u(f,d,m){const w=f[m];if(W.isArray(w)&&w.includes(d)||W.isObject(w)&&d in w||f.extends&&u(f.extends,d,m)||f.mixins&&f.mixins.some(v=>u(v,d,m)))return!0}function l(f){return gn(f)?"ShallowRef":f.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(o):window.devtoolsFormatters=[o]}const kS=we.env.NODE_ENV!=="production"?et:W.NOOP;we.env.NODE_ENV,we.env.NODE_ENV;let xS;const bp=typeof window<"u"&&window.trustedTypes;if(bp)try{xS=bp.createPolicy("vue",{createHTML:e=>e})}catch(e){we.env.NODE_ENV!=="production"&&kS(`Error creating trusted types policy: ${e}`)}const vp=Symbol("_vod"),NS=Symbol("_vsh"),nl={beforeMount(e,{value:t},{transition:n}){e[vp]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):eo(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),eo(e,!0),r.enter(e)):r.leave(e,()=>{eo(e,!1)}):eo(e,t))},beforeUnmount(e,{value:t}){eo(e,t)}};we.env.NODE_ENV!=="production"&&(nl.name="show");function eo(e,t){e.style.display=t?e[vp]:"none",e[NS]=!t}Symbol(we.env.NODE_ENV!=="production"?"CSS_VAR_TEXT":"");function to(e,t,n,r){e.addEventListener(t,n,r)}const wp=e=>{const t=e.props["onUpdate:modelValue"]||!1;return W.isArray(t)?n=>W.invokeArrayFns(t,n):t};function $S(e){e.target.composing=!0}function Sp(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const rl=Symbol("_assign"),DS={created(e,{modifiers:{lazy:t,trim:n,number:r}},o){e[rl]=wp(o);const i=r||o.props&&o.props.type==="number";to(e,t?"change":"input",s=>{if(s.target.composing)return;let a=e.value;n&&(a=a.trim()),i&&(a=W.looseToNumber(a)),e[rl](a)}),n&&to(e,"change",()=>{e.value=e.value.trim()}),t||(to(e,"compositionstart",$S),to(e,"compositionend",Sp),to(e,"change",Sp))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:o,number:i}},s){if(e[rl]=wp(s),e.composing)return;const a=(i||e.type==="number")&&!/^0\d/.test(e.value)?W.looseToNumber(e.value):e.value,c=t??"";a!==c&&(document.activeElement===e&&e.type!=="range"&&(r&&t===n||o&&e.value.trim()===c)||(e.value=c))}},LS=["ctrl","shift","alt","meta"],MS={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)=>LS.some(n=>e[`${n}Key`]&&!t.includes(n))},In=(e,t)=>{const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=(o,...i)=>{for(let s=0;s<t.length;s++){const a=MS[t[s]];if(a&&a(o,t))return}return e(o,...i)})},BS={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},no=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=o=>{if(!("key"in o))return;const i=W.hyphenate(o.key);if(t.some(s=>s===i||BS[s]===i))return e(o)})};function jS(){OS()}we.env.NODE_ENV!=="production"&&jS();const yn=()=>Ht.useAbility(),fs=()=>j(()=>!!document.getElementById("files-global-search-options"));function Ep(e){if(e===void 0)throw new Error('cloneStateObject: cannot clone "undefined"');return JSON.parse(JSON.stringify(e))}const ro=(e,t)=>!e||!t?!1:e.id===t.id;var xr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function il(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ol,Tp;function US(){if(Tp)return ol;Tp=1;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function t(o,i){for(var s="",a=0,c=-1,u=0,l,f=0;f<=o.length;++f){if(f<o.length)l=o.charCodeAt(f);else{if(l===47)break;l=47}if(l===47){if(!(c===f-1||u===1))if(c!==f-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 d=s.lastIndexOf("/");if(d!==s.length-1){d===-1?(s="",a=0):(s=s.slice(0,d),a=s.length-1-s.lastIndexOf("/")),c=f,u=0;continue}}else if(s.length===2||s.length===1){s="",a=0,c=f,u=0;continue}}i&&(s.length>0?s+="/..":s="..",a=2)}else s.length>0?s+="/"+o.slice(c+1,f):s=o.slice(c+1,f),a=f-c-1;c=f,u=0}else l===46&&u!==-1?++u:u=-1}return s}function n(o,i){var s=i.dir||i.root,a=i.base||(i.name||"")+(i.ext||"");return s?s===i.root?s+a:s+o+a:a}var r={resolve:function(){for(var i="",s=!1,a,c=arguments.length-1;c>=-1&&!s;c--){var u;c>=0?u=arguments[c]:(a===void 0&&(a=we.cwd()),u=a),e(u),u.length!==0&&(i=u+"/"+i,s=u.charCodeAt(0)===47)}return i=t(i,!s),s?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(i){if(e(i),i.length===0)return".";var s=i.charCodeAt(0)===47,a=i.charCodeAt(i.length-1)===47;return i=t(i,!s),i.length===0&&!s&&(i="."),i.length>0&&a&&(i+="/"),s?"/"+i:i},isAbsolute:function(i){return e(i),i.length>0&&i.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var i,s=0;s<arguments.length;++s){var a=arguments[s];e(a),a.length>0&&(i===void 0?i=a:i+="/"+a)}return i===void 0?".":r.normalize(i)},relative:function(i,s){if(e(i),e(s),i===s||(i=r.resolve(i),s=r.resolve(s),i===s))return"";for(var a=1;a<i.length&&i.charCodeAt(a)===47;++a);for(var c=i.length,u=c-a,l=1;l<s.length&&s.charCodeAt(l)===47;++l);for(var f=s.length,d=f-l,m=u<d?u:d,w=-1,v=0;v<=m;++v){if(v===m){if(d>m){if(s.charCodeAt(l+v)===47)return s.slice(l+v+1);if(v===0)return s.slice(l+v)}else u>m&&(i.charCodeAt(a+v)===47?w=v:v===0&&(w=0));break}var T=i.charCodeAt(a+v),y=s.charCodeAt(l+v);if(T!==y)break;T===47&&(w=v)}var g="";for(v=a+w+1;v<=c;++v)(v===c||i.charCodeAt(v)===47)&&(g.length===0?g+="..":g+="/..");return g.length>0?g+s.slice(l+w):(l+=w,s.charCodeAt(l)===47&&++l,s.slice(l))},_makeLong:function(i){return i},dirname:function(i){if(e(i),i.length===0)return".";for(var s=i.charCodeAt(0),a=s===47,c=-1,u=!0,l=i.length-1;l>=1;--l)if(s=i.charCodeAt(l),s===47){if(!u){c=l;break}}else u=!1;return c===-1?a?"/":".":a&&c===1?"//":i.slice(0,c)},basename:function(i,s){if(s!==void 0&&typeof s!="string")throw new TypeError('"ext" argument must be a string');e(i);var a=0,c=-1,u=!0,l;if(s!==void 0&&s.length>0&&s.length<=i.length){if(s.length===i.length&&s===i)return"";var f=s.length-1,d=-1;for(l=i.length-1;l>=0;--l){var m=i.charCodeAt(l);if(m===47){if(!u){a=l+1;break}}else d===-1&&(u=!1,d=l+1),f>=0&&(m===s.charCodeAt(f)?--f===-1&&(c=l):(f=-1,c=d))}return a===c?c=d:c===-1&&(c=i.length),i.slice(a,c)}else{for(l=i.length-1;l>=0;--l)if(i.charCodeAt(l)===47){if(!u){a=l+1;break}}else c===-1&&(u=!1,c=l+1);return c===-1?"":i.slice(a,c)}},extname:function(i){e(i);for(var s=-1,a=0,c=-1,u=!0,l=0,f=i.length-1;f>=0;--f){var d=i.charCodeAt(f);if(d===47){if(!u){a=f+1;break}continue}c===-1&&(u=!1,c=f+1),d===46?s===-1?s=f:l!==1&&(l=1):s!==-1&&(l=-1)}return s===-1||c===-1||l===0||l===1&&s===c-1&&s===a+1?"":i.slice(s,c)},format:function(i){if(i===null||typeof i!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof i);return n("/",i)},parse:function(i){e(i);var s={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return s;var a=i.charCodeAt(0),c=a===47,u;c?(s.root="/",u=1):u=0;for(var l=-1,f=0,d=-1,m=!0,w=i.length-1,v=0;w>=u;--w){if(a=i.charCodeAt(w),a===47){if(!m){f=w+1;break}continue}d===-1&&(m=!1,d=w+1),a===46?l===-1?l=w:v!==1&&(v=1):l!==-1&&(v=-1)}return l===-1||d===-1||v===0||v===1&&l===d-1&&l===f+1?d!==-1&&(f===0&&c?s.base=s.name=i.slice(1,d):s.base=s.name=i.slice(f,d)):(f===0&&c?(s.name=i.slice(1,l),s.base=i.slice(1,d)):(s.name=i.slice(f,l),s.base=i.slice(f,d)),s.ext=i.slice(l,d)),f>0?s.dir=i.slice(0,f-1):c&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return r.posix=r,ol=r,ol}var yt=US();const ds=il(yt),qS=$e({name:"SpaceMoveInfoModal",props:{modal:{type:Object,required:!0}}}),Ue=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},VS=["textContent"],zS=["textContent"];function WS(e,t,n,r,o,i){return J(),ge(Ge,null,[pe("p",{class:"oc-mt-rm",textContent:W.toDisplayString(e.$gettext("Moving files from one space to another is not possible. Do you want to copy instead?"))},null,8,VS),pe("p",{class:"oc-mb-rm",textContent:W.toDisplayString(e.$gettext("Note: Links and shares of the original file are not copied."))},null,8,zS)],64)}const Ap=Ue(qS,[["render",WS]]),HS=$e({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}=wt(),{$gettext:n}=Oe.useGettext(),r=le(!1),o=j(()=>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)),i=j(()=>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=j(()=>e.confirmSecondaryTextOverwrite||n("Replace"));return{message:i,checkboxValue:r,checkboxLabel:o,confirmSecondaryText:s,onConfirm:()=>{t(e.modal.id),e.callbackFn({strategy:Gn.KEEP_BOTH,doForAllConflicts:p(r)})},onConfirmSecondary:()=>{t(e.modal.id);const l=e.suggestMerge?Gn.MERGE:Gn.REPLACE;e.callbackFn({strategy:l,doForAllConflicts:p(r)})},onCancel:()=>{t(e.modal.id),e.callbackFn({strategy:Gn.SKIP,doForAllConflicts:p(r)})}}}}),GS=["textContent"],KS={class:"oc-my-m"},QS={class:"oc-flex oc-flex-right oc-flex-middle oc-mt-m"},XS={class:"oc-modal-body-actions-grid"};function YS(e,t,n,r,o,i){const s=ye("oc-checkbox"),a=ye("oc-button");return J(),ge(Ge,null,[pe("span",{class:"oc-display-inline-block oc-mb-m",textContent:W.toDisplayString(e.message)},null,8,GS),pe("div",KS,[e.conflictCount>1?(J(),Ie(s,{key:0,modelValue:e.checkboxValue,"onUpdate:modelValue":t[0]||(t[0]=c=>e.checkboxValue=c),size:"medium",label:e.checkboxLabel,"aria-label":e.checkboxLabel},null,8,["modelValue","label","aria-label"])):Pe("",!0)]),pe("div",QS,[pe("div",XS,[me(a,{class:"oc-modal-body-actions-cancel oc-ml-s",onClick:e.onCancel},{default:Ee(()=>[Gt(W.toDisplayString(e.$gettext("Skip")),1)]),_:1},8,["onClick"]),me(a,{class:"oc-modal-body-actions-secondary oc-ml-s",onClick:e.onConfirmSecondary},{default:Ee(()=>[Gt(W.toDisplayString(e.confirmSecondaryText),1)]),_:1},8,["onClick"]),me(a,{class:"oc-modal-body-actions-confirm oc-ml-s",appearance:"filled",onClick:e.onConfirm},{default:Ee(()=>[Gt(W.toDisplayString(e.$gettext("Keep both")),1)]),_:1},8,["onClick"])])])],64)}const Rp=Ue(HS,[["render",YS]]);class sl{constructor(t,n){this.$gettext=t,this.$ngettext=n}async resolveAllConflicts(t,n,r){const o=[];for(const u of t){const l=yt.join(n.path,u.name);r.some(d=>d.path===l)&&o.push({resource:u,strategy:null})}let i=0,s=!1,a=null;const c=[];for(const u of o){if(s){u.strategy=a,c.push(u);continue}const l=o.length-i,f=await this.resolveFileExists(u.resource,l);u.strategy=f.strategy,c.push(u),i+=1,f.doForAllConflicts&&(s=!0,a=f.strategy)}return c}resolveFileExists(t,n,r=!1,o=!1){const{dispatchModal:i}=wt();return new Promise(s=>{i({title:t.isFolder?this.$gettext("Folder already exists"):this.$gettext("File already exists"),hideActions:!0,customComponent:Rp,customComponentAttrs:()=>({resource:t,conflictCount:n,suggestMerge:r,separateSkipHandling:o,callbackFn:a=>{s(a)}})})})}resolveDoCopyInsteadOfMoveForSpaces(){const{dispatchModal:t}=wt();return new Promise(n=>{t({title:this.$gettext("Copy here?"),customComponent:Ap,confirmText:this.$gettext("Copy here"),onCancel:()=>{n(!1)},onConfirm:()=>Promise.resolve(n(!0))})})}}const Hn=(e,t,n,r=1)=>{let o;return t?o=`${te.extractNameWithoutExtension({name:e,extension:t})} (${r}).${t}`:o=`${e} (${r})`,n.some(s=>s.name===o)?Hn(e,t,n,r+1):o},_p=(e,t,n,r)=>e.id===n.id&&yt.dirname(t.path)===r.path;var Gn=(e=>(e[e.SKIP=0]="SKIP",e[e.REPLACE=1]="REPLACE",e[e.KEEP_BOTH=2]="KEEP_BOTH",e[e.MERGE=3]="MERGE",e))(Gn||{}),mr=(e=>(e[e.COPY=0]="COPY",e[e.MOVE=1]="MOVE",e))(mr||{});class Ip extends sl{constructor(t,n,r,o,i,s,a,c){super(a,c),this.sourceSpace=t,this.resourcesToMove=n,this.targetSpace=r,this.targetFolder=o,this.currentFolder=i,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);rt().showErrorMessage({title:n})}showResultMessage(t,n,r){var a,c;if(t.length===0){const u=n.length;if(u===0)return;const l=r===mr.COPY?this.$ngettext("%{count} item was copied successfully","%{count} items were copied successfully",u,{count:u.toString()},!0):this.$ngettext("%{count} item was moved successfully","%{count} items were moved successfully",u,{count:u.toString()},!0);rt().showMessage({title:l,status:"success"});return}let o=r===mr.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===mr.COPY?this.$gettext('Failed to copy "%{name}"',{name:(a=t[0])==null?void 0:a.resourceName},!0):this.$gettext('Failed to move "%{name}"',{name:(c=t[0])==null?void 0:c.resourceName},!0));let i="";t.some(({error:u})=>u instanceof te.HttpError&&u.statusCode===507)&&(i=this.$gettext("Insufficient quota")),rt().showErrorMessage({title:o,...i&&{desc:i},errors:t.map(({error:u})=>u)})}async getTransferData(t){var i;if(this.hasRecursion())return this.showRecursionErrorMessage(),[];if(this.sourceSpace.id!==this.targetSpace.id&&t===mr.MOVE){if(!await this.resolveDoCopyInsteadOfMoveForSpaces())return[];t=mr.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 a={...s},{id:c,name:u,extension:l}=a,f=r.some(w=>w.resource.id===c);let d=u,m=!1;if(f){const w=(i=r.find(v=>v.resource.id===c))==null?void 0:i.strategy;if(w===Gn.SKIP)continue;if(w===Gn.REPLACE){if(this.isOverwritingParentFolder(a,this.targetFolder,n)){const v=new Error;this.showResultMessage([{error:v,resourceName:u}],[],t);continue}m=!0}w===Gn.KEEP_BOTH&&(d=Hn(u,l,n),a.name=d)}_p(this.sourceSpace,a,this.targetSpace,this.targetFolder)&&m||o.push({resource:a,sourceSpace:this.sourceSpace,targetSpace:this.targetSpace,targetFolder:this.targetFolder,path:yt.join(this.targetFolder.path,d),overwrite:m,transferType:t})}return o}isOverwritingParentFolder(t,n,r){var s;if(t.type!=="folder"||n.path===((s=p(this.currentFolder))==null?void 0:s.path))return!1;const o=yt.basename(t.path),i=yt.join(n.path,o);return r.some(a=>a.path===i)}}const al={ignoreLocation:!0,threshold:0,useExtendedSearch:!0},JS=(e,t,n)=>new nd(e,{...al,keys:["name","type","icon","extension","tags"]}).search(t,{limit:n}).map(o=>o.item),Cp="oc-resource-icon-mapping",ZS={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","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"]}};function Pp(){const e={};return Object.values(ZS).forEach(t=>{t.extensions.forEach(n=>{e[n]=t.icon})}),e}function ll(e,t,n){return t.name=yt.basename(n),t.path=n,t.webDavPath=yt.join(e.webDavPath,n),t.extension=te.extractExtensionFromFile(t),t}function eE(){this.__data__=[],this.size=0}function io(e,t){return e===t||e!==e&&t!==t}function ps(e,t){for(var n=e.length;n--;)if(io(e[n][0],t))return n;return-1}var tE=Array.prototype,nE=tE.splice;function rE(e){var t=this.__data__,n=ps(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():nE.call(t,n,1),--this.size,!0}function iE(e){var t=this.__data__,n=ps(t,e);return n<0?void 0:t[n][1]}function oE(e){return ps(this.__data__,e)>-1}function sE(e,t){var n=this.__data__,r=ps(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function yr(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])}}yr.prototype.clear=eE,yr.prototype.delete=rE,yr.prototype.get=iE,yr.prototype.has=oE,yr.prototype.set=sE;function aE(){this.__data__=new yr,this.size=0}function lE(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function cE(e){return this.__data__.get(e)}function uE(e){return this.__data__.has(e)}const Nr=globalThis||void 0||self;var Fp=typeof Nr=="object"&&Nr&&Nr.Object===Object&&Nr,fE=typeof self=="object"&&self&&self.Object===Object&&self,Zn=Fp||fE||Function("return this")(),kn=Zn.Symbol,Op=Object.prototype,dE=Op.hasOwnProperty,pE=Op.toString,oo=kn?kn.toStringTag:void 0;function hE(e){var t=dE.call(e,oo),n=e[oo];try{e[oo]=void 0;var r=!0}catch{}var o=pE.call(e);return r&&(t?e[oo]=n:delete e[oo]),o}var gE=Object.prototype,mE=gE.toString;function yE(e){return mE.call(e)}var bE="[object Null]",vE="[object Undefined]",kp=kn?kn.toStringTag:void 0;function Qr(e){return e==null?e===void 0?vE:bE:kp&&kp in Object(e)?hE(e):yE(e)}function er(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var wE="[object AsyncFunction]",SE="[object Function]",EE="[object GeneratorFunction]",TE="[object Proxy]";function cl(e){if(!er(e))return!1;var t=Qr(e);return t==SE||t==EE||t==wE||t==TE}var ul=Zn["__core-js_shared__"],xp=function(){var e=/[^.]+$/.exec(ul&&ul.keys&&ul.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function AE(e){return!!xp&&xp in e}var RE=Function.prototype,_E=RE.toString;function Xr(e){if(e!=null){try{return _E.call(e)}catch{}try{return e+""}catch{}}return""}var IE=/[\\^$.*+?()[\]{}|]/g,CE=/^\[object .+?Constructor\]$/,PE=Function.prototype,FE=Object.prototype,OE=PE.toString,kE=FE.hasOwnProperty,xE=RegExp("^"+OE.call(kE).replace(IE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function NE(e){if(!er(e)||AE(e))return!1;var t=cl(e)?xE:CE;return t.test(Xr(e))}function $E(e,t){return e==null?void 0:e[t]}function Yr(e,t){var n=$E(e,t);return NE(n)?n:void 0}var so=Yr(Zn,"Map"),ao=Yr(Object,"create");function DE(){this.__data__=ao?ao(null):{},this.size=0}function LE(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var ME="__lodash_hash_undefined__",BE=Object.prototype,jE=BE.hasOwnProperty;function UE(e){var t=this.__data__;if(ao){var n=t[e];return n===ME?void 0:n}return jE.call(t,e)?t[e]:void 0}var qE=Object.prototype,VE=qE.hasOwnProperty;function zE(e){var t=this.__data__;return ao?t[e]!==void 0:VE.call(t,e)}var WE="__lodash_hash_undefined__";function HE(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ao&&t===void 0?WE:t,this}function Jr(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])}}Jr.prototype.clear=DE,Jr.prototype.delete=LE,Jr.prototype.get=UE,Jr.prototype.has=zE,Jr.prototype.set=HE;function GE(){this.size=0,this.__data__={hash:new Jr,map:new(so||yr),string:new Jr}}function KE(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function hs(e,t){var n=e.__data__;return KE(t)?n[typeof t=="string"?"string":"hash"]:n.map}function QE(e){var t=hs(this,e).delete(e);return this.size-=t?1:0,t}function XE(e){return hs(this,e).get(e)}function YE(e){return hs(this,e).has(e)}function JE(e,t){var n=hs(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function br(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])}}br.prototype.clear=GE,br.prototype.delete=QE,br.prototype.get=XE,br.prototype.has=YE,br.prototype.set=JE;var ZE=200;function e1(e,t){var n=this.__data__;if(n instanceof yr){var r=n.__data__;if(!so||r.length<ZE-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new br(r)}return n.set(e,t),this.size=n.size,this}function tr(e){var t=this.__data__=new yr(e);this.size=t.size}tr.prototype.clear=aE,tr.prototype.delete=lE,tr.prototype.get=cE,tr.prototype.has=uE,tr.prototype.set=e1;var gs=function(){try{var e=Yr(Object,"defineProperty");return e({},"",{}),e}catch{}}();function fl(e,t,n){t=="__proto__"&&gs?gs(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function dl(e,t,n){(n!==void 0&&!io(e[t],n)||n===void 0&&!(t in e))&&fl(e,t,n)}function t1(e){return function(t,n,r){for(var o=-1,i=Object(t),s=r(t),a=s.length;a--;){var c=s[++o];if(n(i[c],c,i)===!1)break}return t}}var n1=t1(),Np=typeof D=="object"&&D&&!D.nodeType&&D,$p=Np&&typeof module=="object"&&module&&!module.nodeType&&module,r1=$p&&$p.exports===Np,Dp=r1?Zn.Buffer:void 0,Lp=Dp?Dp.allocUnsafe:void 0;function Mp(e,t){if(t)return e.slice();var n=e.length,r=Lp?Lp(n):new e.constructor(n);return e.copy(r),r}var ms=Zn.Uint8Array;function pl(e){var t=new e.constructor(e.byteLength);return new ms(t).set(new ms(e)),t}function Bp(e,t){var n=t?pl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function i1(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var jp=Object.create,o1=function(){function e(){}return function(t){if(!er(t))return{};if(jp)return jp(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Up(e,t){return function(n){return e(t(n))}}var hl=Up(Object.getPrototypeOf,Object),s1=Object.prototype;function ys(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||s1;return e===n}function a1(e){return typeof e.constructor=="function"&&!ys(e)?o1(hl(e)):{}}function nr(e){return e!=null&&typeof e=="object"}var l1="[object Arguments]";function qp(e){return nr(e)&&Qr(e)==l1}var Vp=Object.prototype,c1=Vp.hasOwnProperty,u1=Vp.propertyIsEnumerable,lo=qp(function(){return arguments}())?qp:function(e){return nr(e)&&c1.call(e,"callee")&&!u1.call(e,"callee")},xn=Array.isArray,f1=9007199254740991;function zp(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=f1}function co(e){return e!=null&&zp(e.length)&&!cl(e)}function d1(e){return nr(e)&&co(e)}function p1(){return!1}var Wp=typeof D=="object"&&D&&!D.nodeType&&D,Hp=Wp&&typeof module=="object"&&module&&!module.nodeType&&module,h1=Hp&&Hp.exports===Wp,Gp=h1?Zn.Buffer:void 0,g1=Gp?Gp.isBuffer:void 0,_i=g1||p1,m1="[object Object]",y1=Function.prototype,b1=Object.prototype,Kp=y1.toString,v1=b1.hasOwnProperty,w1=Kp.call(Object);function gl(e){if(!nr(e)||Qr(e)!=m1)return!1;var t=hl(e);if(t===null)return!0;var n=v1.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Kp.call(n)==w1}var S1="[object Arguments]",E1="[object Array]",T1="[object Boolean]",A1="[object Date]",R1="[object Error]",_1="[object Function]",I1="[object Map]",C1="[object Number]",P1="[object Object]",F1="[object RegExp]",O1="[object Set]",k1="[object String]",x1="[object WeakMap]",N1="[object ArrayBuffer]",$1="[object DataView]",D1="[object Float32Array]",L1="[object Float64Array]",M1="[object Int8Array]",B1="[object Int16Array]",j1="[object Int32Array]",U1="[object Uint8Array]",q1="[object Uint8ClampedArray]",V1="[object Uint16Array]",z1="[object Uint32Array]",Tt={};Tt[D1]=Tt[L1]=Tt[M1]=Tt[B1]=Tt[j1]=Tt[U1]=Tt[q1]=Tt[V1]=Tt[z1]=!0,Tt[S1]=Tt[E1]=Tt[N1]=Tt[T1]=Tt[$1]=Tt[A1]=Tt[R1]=Tt[_1]=Tt[I1]=Tt[C1]=Tt[P1]=Tt[F1]=Tt[O1]=Tt[k1]=Tt[x1]=!1;function W1(e){return nr(e)&&zp(e.length)&&!!Tt[Qr(e)]}function ml(e){return function(t){return e(t)}}var Qp=typeof D=="object"&&D&&!D.nodeType&&D,uo=Qp&&typeof module=="object"&&module&&!module.nodeType&&module,H1=uo&&uo.exports===Qp,yl=H1&&Fp.process,Ii=function(){try{var e=uo&&uo.require&&uo.require("util").types;return e||yl&&yl.binding&&yl.binding("util")}catch{}}(),Xp=Ii&&Ii.isTypedArray,bs=Xp?ml(Xp):W1;function bl(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var G1=Object.prototype,K1=G1.hasOwnProperty;function Yp(e,t,n){var r=e[t];(!(K1.call(e,t)&&io(r,n))||n===void 0&&!(t in e))&&fl(e,t,n)}function Jp(e,t,n,r){var o=!n;n||(n={});for(var i=-1,s=t.length;++i<s;){var a=t[i],c=void 0;c===void 0&&(c=e[a]),o?fl(n,a,c):Yp(n,a,c)}return n}function Q1(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var X1=9007199254740991,Y1=/^(?:0|[1-9]\d*)$/;function Zp(e,t){var n=typeof e;return t=t??X1,!!t&&(n=="number"||n!="symbol"&&Y1.test(e))&&e>-1&&e%1==0&&e<t}var J1=Object.prototype,Z1=J1.hasOwnProperty;function eh(e,t){var n=xn(e),r=!n&&lo(e),o=!n&&!r&&_i(e),i=!n&&!r&&!o&&bs(e),s=n||r||o||i,a=s?Q1(e.length,String):[],c=a.length;for(var u in e)(t||Z1.call(e,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Zp(u,c)))&&a.push(u);return a}function eT(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var tT=Object.prototype,nT=tT.hasOwnProperty;function rT(e){if(!er(e))return eT(e);var t=ys(e),n=[];for(var r in e)r=="constructor"&&(t||!nT.call(e,r))||n.push(r);return n}function vl(e){return co(e)?eh(e,!0):rT(e)}function iT(e){return Jp(e,vl(e))}function oT(e,t,n,r,o,i,s){var a=bl(e,n),c=bl(t,n),u=s.get(c);if(u){dl(e,n,u);return}var l=i?i(a,c,n+"",e,t,s):void 0,f=l===void 0;if(f){var d=xn(c),m=!d&&_i(c),w=!d&&!m&&bs(c);l=c,d||m||w?xn(a)?l=a:d1(a)?l=i1(a):m?(f=!1,l=Mp(c,!0)):w?(f=!1,l=Bp(c,!0)):l=[]:gl(c)||lo(c)?(l=a,lo(a)?l=iT(a):(!er(a)||cl(a))&&(l=a1(c))):f=!1}f&&(s.set(c,l),o(l,c,r,i,s),s.delete(c)),dl(e,n,l)}function th(e,t,n,r,o){e!==t&&n1(t,function(i,s){if(o||(o=new tr),er(i))oT(e,t,s,n,th,r,o);else{var a=r?r(bl(e,s),i,s+"",e,t,o):void 0;a===void 0&&(a=i),dl(e,s,a)}},vl)}function nh(e){return e}function sT(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 rh=Math.max;function ih(e,t,n){return t=rh(t===void 0?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=rh(r.length-t,0),s=Array(i);++o<i;)s[o]=r[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=r[o];return a[t]=n(s),sT(e,this,a)}}function aT(e){return function(){return e}}var lT=gs?function(e,t){return gs(e,"toString",{configurable:!0,enumerable:!1,value:aT(t),writable:!0})}:nh,cT=800,uT=16,fT=Date.now;function dT(e){var t=0,n=0;return function(){var r=fT(),o=uT-(r-n);if(n=r,o>0){if(++t>=cT)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var oh=dT(lT);function pT(e,t){return oh(ih(e,t,nh),e+"")}function hT(e,t,n){if(!er(n))return!1;var r=typeof t;return(r=="number"?co(n)&&Zp(t,n.length):r=="string"&&t in n)?io(n[t],e):!1}function gT(e){return pT(function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(o--,i):void 0,s&&hT(n[0],n[1],s)&&(i=o<3?void 0:i,o=1),t=Object(t);++r<o;){var a=n[r];a&&e(t,a,r,i)}return t})}var fo=gT(function(e,t,n){th(e,t,n)});const wl=(e,...t)=>{const{href:n}=e.resolve(p(e.currentRoute));return t.map(r=>{const{href:o}=e.resolve({...r});return o==="/"||o==="#/"?!1:n.startsWith(o)}).some(Boolean)},po=(...e)=>(t,...n)=>{if(!n.length)return wl(t,...e);const[r,...o]=n.map(i=>{const s=e.find(a=>a.name===i);if(!s)throw new Error(`unknown comparative '${i}'`);return s});return wl(t,r,...o)};function W2(e){return e}const ho=(e,...t)=>fo({},{name:e},...t.map(n=>({...n.params&&{params:n.params},...n.query&&{query:n.query}}))),Ci=(e,t={})=>ho(e,t),sh=Ci("files-common-favorites"),ah=Ci("files-common-search"),It=po(sh,ah),mT=e=>[{path:"/search",component:e.App,children:[{name:ah.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:sh.name,path:"",component:e.Favorites,meta:{authContext:"user",title:"Favorite files"}}]}],Nn=(e,t={})=>ho(e,t),lh=Nn("files-spaces-projects"),Sl=Nn("files-spaces-generic"),dt=po(lh,Sl),yT=e=>[{path:"/spaces",component:e.App,children:[{path:"projects",name:lh.name,component:e.Spaces.Projects,meta:{authContext:"user",title:"Spaces"}},{path:":driveAliasAndItem(.*)?",name:Sl.name,component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0,contextQueryItems:["sort-by","sort-dir"]}}]}],$n=(e,t={})=>ho(e,t),bT=$n("files-shares"),vs=$n("files-shares-with-me"),El=$n("files-shares-with-others"),Tl=$n("files-shares-via-link"),Mt=po(vs,El,Tl),vT=e=>[{name:bT.name,path:"/shares",component:e.App,redirect:vs,children:[{name:vs.name,path:"with-me",component:e.Shares.SharedWithMe,meta:{authContext:"user",title:"Files shared with me"}},{name:El.name,path:"with-others",component:e.Shares.SharedWithOthers,meta:{authContext:"user",title:"Files shared with others"}},{name:Tl.name,path:"via-link",component:e.Shares.SharedViaLink,meta:{authContext:"user",title:"Files shared via link"}}]}],Pi=(e,t={})=>ho(e,t),Al=Pi("files-public-link"),Rl=Pi("files-public-upload"),Cn=po(Al,Rl),wT=e=>[{path:"/link",component:e.App,meta:{auth:!1},children:[{name:Al.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"publicLink",patchCleanPath:!0}}]},{path:"/upload",component:e.App,meta:{auth:!1},children:[{name:Rl.name,path:":token?",component:e.FilesDrop,meta:{authContext:"publicLink",title:"Public file upload"}}]}],Fi=(e,t={})=>ho(e,t),ch=Fi("files-trash-generic"),uh=Fi("files-trash-overview"),Pn=po(ch,uh),ST=e=>[{path:"/trash",component:e.App,children:[{path:"overview",name:uh.name,component:e.Trash.Overview,meta:{authContext:"user",title:"Trash overview"}},{name:ch.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0}}]}];function fh(e){return{applicationConfig:j(()=>e.appsStore.externalAppConfig[e.applicationId]||{})}}const ET=["anonymous","user","idp","publicLink","hybrid"],vr=e=>gr(e),qe=()=>vr("$router"),Qt=()=>qe().currentRoute,_l=e=>e.path.split("/")[1],TT=()=>{const e=Qt();return j(()=>_l(p(e)))},rr=(e,t={},n)=>{var o,i;const r=(n==null?void 0:n.configStore)||lt();return{params:{driveAliasAndItem:e.getDriveAliasAndItem({path:t.path||""})},query:{...te.isShareSpaceResource(e)&&{shareId:e.id},...((i=(o=r==null?void 0:r.options)==null?void 0:o.routing)==null?void 0:i.idBased)&&!_t.isUndefined(t.fileId)&&{fileId:`${t.fileId}`}}}},AT=(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},ir=We.defineStore("apps",()=>{const e=le({}),t=le({}),n=le([]),r=j(()=>Object.keys(p(e))),o=(c,u)=>{c.id&&(c.extensions&&c.extensions.forEach(l=>{i({appId:c.id,data:l})}),p(e)[c.id]={applicationMenu:c.applicationMenu||{enabled:()=>!1},defaultExtension:c.defaultExtension||"",icon:"check_box_outline_blank",name:c.name||c.id,translations:u,...c})},i=({appId:c,data:u})=>{var l,f,d;p(n).push({app:c,extension:u.extension,createFileHandler:u.createFileHandler,label:u.label,mimeType:u.mimeType,routeName:u.routeName,newFileMenu:u.newFileMenu,icon:u.icon,name:u.name,hasPriority:u.hasPriority||((d=(f=(l=p(t))==null?void 0:l[c])==null?void 0:f.priorityExtensions)==null?void 0:d.includes(u.extension))||!1,secureView:u.secureView||!1})};return{apps:e,externalAppConfig:t,appIds:r,fileExtensions:n,registerApp:o,registerFileExtension:i,loadExternalAppConfig:({appId:c,config:u})=>{t.value={...p(t),[c]:u}},isAppEnabled:c=>p(r).includes(c)}}),Zr=We.defineStore("auth",()=>{const e=le(),t=le(!1),n=le(!1),r=le(),o=le(),i=le(),s=le(!1),a=m=>{e.value=m},c=m=>{t.value=m},u=m=>{n.value=m},l=m=>{r.value=m.publicLinkToken,o.value=m.publicLinkPassword,i.value=m.publicLinkType,s.value=m.publicLinkContextReady};return{accessToken:e,idpContextReady:t,userContextReady:n,publicLinkToken:r,publicLinkPassword:o,publicLinkType:i,publicLinkContextReady:s,setAccessToken:a,setIdpContextReady:c,setUserContextReady:u,setPublicLinkContext:l,clearUserContext:()=>{a(null),c(null),u(null)},clearPublicLinkContext:()=>{l({publicLinkToken:null,publicLinkPassword:null,publicLinkType:null,publicLinkContextReady:!1})}}}),dh={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:te.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:[]}},notifications:{"ocs-endpoints":[]},password_policy:{},search:{property:{mediatype:{},mtime:{}}},spaces:{enabled:!1,max_quota:0,projects:!1}},an=We.defineStore("capabilities",()=>{const e=le(!1),t=le(dh),n=_=>{t.value=fo({...dh},_.capabilities),e.value=!0},r=j(()=>p(t).core["support-url-signing"]),o=j(()=>p(t).core["support-sse"]),i=j(()=>p(t).graph["personal-data-export"]),s=j(()=>p(t).core.status),a=j(()=>p(t).dav.reports),c=j(()=>p(t).dav.trashbin),u=j(()=>p(t).spaces.max_quota),l=j(()=>p(t).spaces.projects),f=j(()=>p(t).graph.users.create_disabled),d=j(()=>p(t).graph.users.delete_disabled),m=j(()=>p(t).graph.users.change_password_self_disabled),w=j(()=>p(t).graph.users.read_only_attributes),v=j(()=>p(t).files.app_providers),T=j(()=>p(t).files.favorites),y=j(()=>p(t).files.thumbnail),g=j(()=>p(t).files.archivers),h=j(()=>p(t).files.privateLinks),b=j(()=>p(t).files.permanent_deletion),S=j(()=>p(t).files.tags),E=j(()=>p(t).files.undelete),I=j(()=>p(t).files_sharing.api_enabled),R=j(()=>p(t).files_sharing.deny_access),A=j(()=>p(t).files_sharing.can_rename),N=j(()=>p(t).files_sharing.allow_custom),L=j(()=>{var _;return(_=p(t).files_sharing.public)==null?void 0:_.enabled}),x=j(()=>{var _;return(_=p(t).files_sharing.public)==null?void 0:_.can_edit}),$=j(()=>{var _;return(_=p(t).files_sharing.public)==null?void 0:_.can_contribute}),V=j(()=>{var _;return(_=p(t).files_sharing.public)==null?void 0:_.alias}),X=j(()=>{var _;return(_=p(t).files_sharing.public)==null?void 0:_.default_permissions}),ee=j(()=>{var _;return(_=p(t).files_sharing.public)==null?void 0:_.password.enforced_for}),se=j(()=>p(t).files_sharing.search_min_length),ie=j(()=>{var _;return(_=p(t).files_sharing.user)==null?void 0:_.profile_picture}),re=j(()=>{var _;return(_=p(t).files.tus_support)==null?void 0:_.max_chunk_size}),fe=j(()=>{var _;return(_=p(t).files.tus_support)==null?void 0:_.extension}),ue=j(()=>{var _;return(_=p(t).files.tus_support)==null?void 0:_.http_method_override}),Z=j(()=>p(t).notifications["ocs-endpoints"]),oe=j(()=>p(t).password_policy),ce=j(()=>{var _;return(_=p(t).search.property)==null?void 0:_.mtime}),Ce=j(()=>{var _;return(_=p(t).search.property)==null?void 0:_.mediatype}),H=j(()=>{var _;return(_=p(t).search.property)==null?void 0:_.content});return{isInitialized:e,capabilities:t,setCapabilities:n,status:s,supportUrlSigning:r,supportSSE:o,personalDataExport:i,davReports:a,davTrashbin:c,spacesMaxQuota:u,spacesProjects:l,graphUsersCreateDisabled:f,graphUsersDeleteDisabled:d,graphUsersChangeSelfPasswordDisabled:m,graphUsersReadOnlyAttributes:w,filesAppProviders:v,filesFavorites:T,filesThumbnail:y,filesArchivers:g,filesPrivateLinks:h,filesPermanentDeletion:b,filesTags:S,filesUndelete:E,sharingApiEnabled:I,sharingDenyAccess:R,sharingCanRename:A,sharingAllowCustom:N,sharingPublicEnabled:L,sharingPublicCanEdit:x,sharingPublicCanContribute:$,sharingPublicAlias:V,sharingPublicDefaultPermissions:X,sharingPublicPasswordEnforcedFor:ee,sharingSearchMinLength:se,sharingUserProfilePicture:ie,tusMaxChunkSize:re,tusExtension:fe,tusHttpMethodOverride:ue,notificationsOcsEndpoints:Z,passwordPolicy:oe,searchLastMofifiedDate:ce,searchMediaType:Ce,searchContent:H}});class RT{constructor(t,n){Se(this,"value");Se(this,"expires");this.value=t,this.expires=n?new Date().getTime()+n:0}get expired(){return this.expires>0&&this.expires<new Date().getTime()}}class Il{constructor(t){Se(this,"map");Se(this,"ttl");Se(this,"capacity");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 RT(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 ws=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:i}=o;return e.driveItems.getDriveItem(i.split("!")[0],i)},_T=({sharedAncestor:e,matchingSpace:t})=>t?Nn("files-spaces-generic",rr(t,{path:e.path,fileId:e.id})):{},ph=({sharesStore:e,spacesStore:t,userStore:n,space:r,sharedDriveItem:o})=>{var u;const i=((u=o==null?void 0:o.remoteItem)==null?void 0:u.permissions)||[];if(!i.length)return;const s=[];i.forEach(l=>{if(l["@libre.graph.permissions.actions"]){s.push(...l["@libre.graph.permissions.actions"]);return}const f=e.graphRoles[l.roles[0]];if(!f)return;const d=f.rolePermissions.flatMap(m=>m.allowedResourceActions);s.push(...d)});const a=[...new Set(s)],c={grantedTo:{user:{id:n.user.id,displayName:n.user.displayName}},permissions:a,roleId:""};t.updateSpaceField({id:r.id,field:"members",value:{[n.user.id]:c}})},IT=e=>{var n;const t=(n=document.querySelectorAll(`[data-item-id="${e}"] input[type=checkbox]`))==null?void 0:n[0];t&&t.focus()};class ei{}Se(ei,"sortByQueryName","sort-by"),Se(ei,"sortDirQueryName","sort-dir");var CT="[object Symbol]";function Ss(e){return typeof e=="symbol"||nr(e)&&Qr(e)==CT}var PT=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,FT=/^\w*$/;function OT(e,t){if(xn(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Ss(e)?!0:FT.test(e)||!PT.test(e)||t!=null&&e in Object(t)}var kT="Expected a function";function Cl(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(kT);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=e.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(Cl.Cache||br),n}Cl.Cache=br;var xT=500;function NT(e){var t=Cl(e,function(r){return n.size===xT&&n.clear(),r}),n=t.cache;return t}var $T=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,DT=/\\(\\)?/g,LT=NT(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace($T,function(n,r,o,i){t.push(o?i.replace(DT,"$1"):r||n)}),t});function hh(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 gh=kn?kn.prototype:void 0,mh=gh?gh.toString:void 0;function yh(e){if(typeof e=="string")return e;if(xn(e))return hh(e,yh)+"";if(Ss(e))return mh?mh.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Pl(e){return e==null?"":yh(e)}function Fl(e,t){return xn(e)?e:OT(e,t)?[e]:LT(Pl(e))}function bh(e){if(typeof e=="string"||Ss(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function vh(e,t){t=Fl(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[bh(t[n++])];return n&&n==r?e:void 0}function Ol(e,t,n){var r=e==null?void 0:vh(e,t);return r===void 0?n:r}var Vt=(e=>(e.Desc="desc",e.Asc="asc",e))(Vt||{});function MT(e){const t=qe(),n=BT(e),r=jT(e),o=j(()=>{var u;return Sh(p(n))||p((u=kl(p(s)))==null?void 0:u.name)}),i=j(()=>qT(p(r))||UT(p(o),p(s))),s=e.fields;return{items:j(()=>{const u=p(e.items);return p(o)?wh(u,p(s),p(o),p(i)):u}),sortBy:o,sortDir:i,handleSort:({sortBy:u,sortDir:l})=>t.replace({query:{...p(t.currentRoute).query,[p(e.sortByQueryName)||ei.sortByQueryName]:u,[p(e.sortDirQueryName)||ei.sortDirQueryName]:l}})}}function BT(e){var t;return e.sortBy?Ut(e.sortBy)?e.sortBy:le(e.sortBy):Tr({name:p(e.sortByQueryName)||ei.sortByQueryName,defaultValue:p((t=kl(p(e.fields)))==null?void 0:t.name),storagePrefix:p(e.routeName)||p(Ys())})}function jT(e){var t;return e.sortDir?Ut(e.sortDir)?e.sortDir:le(e.sortDir):Tr({name:p(e.sortDirQueryName)||ei.sortDirQueryName,defaultValue:p((t=kl(p(e.fields)))==null?void 0:t.sortDir),storagePrefix:p(e.routeName)||p(Ys())})}const kl=e=>{const t=e.filter(n=>n.sortable);return t?t[0]:null},UT=(e,t)=>{const n=t.find(r=>r.name===e);return n&&n.sortDir?p(n.sortDir):"desc"},wh=(e,t,n,r)=>{const o=t.find(a=>a.name===n);if(!o)return e;const{sortable:i}=o,s=new Intl.Collator(navigator.language,{sensitivity:"base",numeric:!0});if(n==="name"){const a=[...e.filter(u=>u.type==="folder")].sort((u,l)=>xl(u,l,s,n,r,i)),c=[...e.filter(u=>u.type!=="folder")].sort((u,l)=>xl(u,l,s,n,r,i));return r==="asc"?a.concat(c):c.concat(a)}return[...e].sort((a,c)=>xl(a,c,s,o.prop||o.name,r,i))},xl=(e,t,n,r,o,i)=>{let s=Ol(e,r),a=Ol(t,r);const c=o==="asc"?1:-1;if(i)if(typeof i=="string"){const l=f=>f.map(d=>d[i]).join("");s=l(s),a=l(a)}else typeof i=="function"&&(s=i(s),a=i(a));return!isNaN(s)&&!isNaN(a)?(s-a)*c:n.compare((s||"").toString(),(a||"").toString())*c},Sh=e=>Array.isArray(e)?e[0]:e,qT=e=>{switch(Sh(e)){case"asc":return"asc";case"desc":return"desc"}return null},Eh=e=>e?[{name:"name",sortable:!0,sortDir:Vt.Asc},{name:"size",sortable:!0,sortDir:Vt.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:Vt.Asc},{name:"owner",sortable:"displayName",sortDir:Vt.Asc},{name:"mdate",sortable:t=>new Date(t).valueOf(),sortDir:Vt.Desc},{name:"sdate",sortable:t=>new Date(t).valueOf(),sortDir:Vt.Desc},{name:"ddate",sortable:t=>new Date(t).valueOf(),sortDir:Vt.Desc}].filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[];function H2(e){return e}const Th=[{label:"A-Z",name:"name",sortable:!0,sortDir:Vt.Asc},{label:"Z-A",name:"name",sortable:!0,sortDir:Vt.Desc},{label:"Newest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:Vt.Desc},{label:"Oldest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:Vt.Asc},{label:"Largest",name:"size",sortable:!0,sortDir:Vt.Desc},{label:"Smallest",name:"size",sortable:!0,sortDir:Vt.Asc},{label:"Remaining quota",name:"remainingQuota",prop:"spaceQuota.remaining",sortable:!0,sortDir:Vt.Desc},{label:"Total quota",name:"totalQuota",prop:"spaceQuota.total",sortable:!0,sortDir:Vt.Desc},{label:"Used quota",name:"usedQuota",prop:"spaceQuota.used",sortable:!0,sortDir:Vt.Desc}],VT=e=>e?Th.filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[],zT=(e,{$gettext:t})=>e.map(n=>({...n,label:t(n.label)})),WT=ve.z.object({icon:ve.z.string(),name:ve.z.string(),secure_view:ve.z.boolean().optional().default(!1),target_ext:ve.z.string().optional()}),HT=ve.z.object({allow_creation:ve.z.boolean().optional(),app_providers:ve.z.array(WT),default_application:ve.z.string().optional(),description:ve.z.string().optional(),ext:ve.z.string().optional(),mime_type:ve.z.string(),name:ve.z.string().optional()}),Ah=ve.z.object({"mime-types":ve.z.array(HT)});class GT{constructor(t,n){Se(this,"_mimeTypes",le([]));Se(this,"serverUrl");Se(this,"clientService");this.serverUrl=t,this.clientService=n}async loadData(){const t=te.urlJoin(this.serverUrl,"app","list"),{data:{"mime-types":n}}=await this.clientService.httpUnAuthenticated.get(t,{schema:Ah});this._mimeTypes.value=n}set mimeTypes(t){this._mimeTypes.value=t}get mimeTypes(){return p(this._mimeTypes)}get templateMimeTypes(){return p(this._mimeTypes).filter(t=>!!t.app_providers.some(n=>!!n.target_ext))}get appNames(){return[...new Set(p(this._mimeTypes).flatMap(t=>t.app_providers.map(n=>n.name)))]}getMimeTypesByAppName(t){return p(this._mimeTypes).filter(n=>n.app_providers.some(r=>r.name===t))}}var Rh={},Es={};Es.byteLength=XT,Es.toByteArray=JT,Es.fromByteArray=tA;for(var or=[],Dn=[],KT=typeof Uint8Array<"u"?Uint8Array:Array,Nl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Oi=0,QT=Nl.length;Oi<QT;++Oi)or[Oi]=Nl[Oi],Dn[Nl.charCodeAt(Oi)]=Oi;Dn[45]=62,Dn[95]=63;function _h(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 XT(e){var t=_h(e),n=t[0],r=t[1];return(n+r)*3/4-r}function YT(e,t,n){return(t+n)*3/4-n}function JT(e){var t,n=_h(e),r=n[0],o=n[1],i=new KT(YT(e,r,o)),s=0,a=o>0?r-4:r,c;for(c=0;c<a;c+=4)t=Dn[e.charCodeAt(c)]<<18|Dn[e.charCodeAt(c+1)]<<12|Dn[e.charCodeAt(c+2)]<<6|Dn[e.charCodeAt(c+3)],i[s++]=t>>16&255,i[s++]=t>>8&255,i[s++]=t&255;return o===2&&(t=Dn[e.charCodeAt(c)]<<2|Dn[e.charCodeAt(c+1)]>>4,i[s++]=t&255),o===1&&(t=Dn[e.charCodeAt(c)]<<10|Dn[e.charCodeAt(c+1)]<<4|Dn[e.charCodeAt(c+2)]>>2,i[s++]=t>>8&255,i[s++]=t&255),i}function ZT(e){return or[e>>18&63]+or[e>>12&63]+or[e>>6&63]+or[e&63]}function eA(e,t,n){for(var r,o=[],i=t;i<n;i+=3)r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),o.push(ZT(r));return o.join("")}function tA(e){for(var t,n=e.length,r=n%3,o=[],i=16383,s=0,a=n-r;s<a;s+=i)o.push(eA(e,s,s+i>a?a:s+i));return r===1?(t=e[n-1],o.push(or[t>>2]+or[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(or[t>>10]+or[t>>4&63]+or[t<<2&63]+"=")),o.join("")}var $l={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */$l.read=function(e,t,n,r,o){var i,s,a=o*8-r-1,c=(1<<a)-1,u=c>>1,l=-7,f=n?o-1:0,d=n?-1:1,m=e[t+f];for(f+=d,i=m&(1<<-l)-1,m>>=-l,l+=a;l>0;i=i*256+e[t+f],f+=d,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=r;l>0;s=s*256+e[t+f],f+=d,l-=8);if(i===0)i=1-u;else{if(i===c)return s?NaN:(m?-1:1)*(1/0);s=s+Math.pow(2,r),i=i-u}return(m?-1:1)*s*Math.pow(2,i-r)},$l.write=function(e,t,n,r,o,i){var s,a,c,u=i*8-o-1,l=(1<<u)-1,f=l>>1,d=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:i-1,w=r?1:-1,v=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=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+f>=1?t+=d/c:t+=d*Math.pow(2,1-f),t*c>=2&&(s++,c/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*c-1)*Math.pow(2,o),s=s+f):(a=t*Math.pow(2,f-1)*Math.pow(2,o),s=0));o>=8;e[n+m]=a&255,m+=w,a/=256,o-=8);for(s=s<<o|a,u+=o;u>0;e[n+m]=s&255,m+=w,s/=256,u-=8);e[n+m-w]|=v*128};/*!
3
+ `,...Hw(o)),console.warn(...i)}vi(),Ua=!1}function Ww(){let e=Kr[Kr.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 Hw(e){const t=[];return e.forEach((n,r)=>{t.push(...r===0?[]:[`
4
+ `],...Gw(n))}),t}function Gw({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",r=e.component?e.component.parent==null:!1,o=` at <${Rp(e.component,e.type,r)}`,i=">"+n;return e.props?[o,...Kw(e.props),i]:[o+i]}function Kw(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(r=>{t.push(...Bd(r,e[r]))}),n.length>3&&t.push(" ..."),t}function Bd(e,t,n){return H.isString(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:Vt(t)?(t=Bd(e,rt(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):H.isFunction(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=rt(t),n?t:[`${e}=`,t])}const qa={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 Yo(e,t,n,r){try{return r?e(...r):e()}catch(o){Jo(o,t,n)}}function Va(e,t,n,r){if(H.isFunction(e)){const o=Yo(e,t,n,r);return o&&H.isPromise(o)&&o.catch(i=>{Jo(i,t,n)}),o}if(H.isArray(e)){const o=[];for(let i=0;i<e.length;i++)o.push(Va(e[i],t,n,r));return o}else ve.env.NODE_ENV!=="production"&&Ze(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function Jo(e,t,n,r=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||H.EMPTY_OBJ;if(t){let a=t.parent;const c=t.proxy,u=ve.env.NODE_ENV!=="production"?qa[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const l=a.ec;if(l){for(let d=0;d<l.length;d++)if(l[d](e,c,u)===!1)return}a=a.parent}if(i){bi(),Yo(i,null,10,[e,c,u]),vi();return}}Qw(e,n,o,r,s)}function Qw(e,t,n,r=!0,o=!1){if(ve.env.NODE_ENV!=="production"){const i=qa[t];if(n&&Vw(n),Ze(`Unhandled error${i?` during execution of ${i}`:""}`),n&&zw(),r)throw e;console.error(e)}else{if(o)throw e;console.error(e)}}const kn=[];let hr=-1;const Si=[];let kr=null,Ei=0;const jd=Promise.resolve();let Zo=null;const Xw=100;function In(e){const t=Zo||jd;return e?t.then(this?e.bind(this):e):t}function Yw(e){let t=hr+1,n=kn.length;for(;t<n;){const r=t+n>>>1,o=kn[r],i=Qi(o);i<e||i===e&&o.flags&2?t=r+1:n=r}return t}function za(e){if(!(e.flags&1)){const t=Qi(e),n=kn[kn.length-1];!n||!(e.flags&2)&&t>=Qi(n)?kn.push(e):kn.splice(Yw(t),0,e),e.flags|=1,Ud()}}function Ud(){Zo||(Zo=jd.then(Vd))}function qd(e){H.isArray(e)?Si.push(...e):kr&&e.id===-1?kr.splice(Ei+1,0,e):e.flags&1||(Si.push(e),e.flags|=1),Ud()}function Jw(e){if(Si.length){const t=[...new Set(Si)].sort((n,r)=>Qi(n)-Qi(r));if(Si.length=0,kr){kr.push(...t);return}for(kr=t,ve.env.NODE_ENV!=="production"&&(e=e||new Map),Ei=0;Ei<kr.length;Ei++){const n=kr[Ei];ve.env.NODE_ENV!=="production"&&zd(e,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}kr=null,Ei=0}}const Qi=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Vd(e){ve.env.NODE_ENV!=="production"&&(e=e||new Map);const t=ve.env.NODE_ENV!=="production"?n=>zd(e,n):H.NOOP;try{for(hr=0;hr<kn.length;hr++){const n=kn[hr];if(n&&!(n.flags&8)){if(ve.env.NODE_ENV!=="production"&&t(n))continue;n.flags&4&&(n.flags&=-2),Yo(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;hr<kn.length;hr++){const n=kn[hr];n&&(n.flags&=-2)}hr=-1,kn.length=0,Jw(e),Zo=null,(kn.length||Si.length)&&Vd(e)}}function zd(e,t){const n=e.get(t)||0;if(n>Xw){const r=t.i,o=r&&us(r.type);return Jo(`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 Xi=!1;const Wa=new Map;ve.env.NODE_ENV!=="production"&&(H.getGlobalThis().__VUE_HMR_RUNTIME__={createRecord:Ha(Zw),rerender:Ha(eS),reload:Ha(tS)});const es=new Map;function Zw(e,t){return es.has(e)?!1:(es.set(e,{initialDef:ts(t),instances:new Set}),!0)}function ts(e){return _p(e)?e.__vccOpts:e}function eS(e,t){const n=es.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(r=>{t&&(r.render=t,ts(r.type).render=t),r.renderCache=[],Xi=!0,r.update(),Xi=!1}))}function tS(e,t){const n=es.get(e);if(!n)return;t=ts(t),Wd(n.initialDef,t);const r=[...n.instances];for(let o=0;o<r.length;o++){const i=r[o],s=ts(i.type);let a=Wa.get(s);a||(s!==n.initialDef&&Wd(s,t),Wa.set(s,a=new Set)),a.add(i),i.appContext.propsCache.delete(i.type),i.appContext.emitsCache.delete(i.type),i.appContext.optionsCache.delete(i.type),i.ceReload?(a.add(i),i.ceReload(t.styles),a.delete(i)):i.parent?za(()=>{Xi=!0,i.parent.update(),Xi=!1,a.delete(i)}):i.appContext.reload?i.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),i.root.ce&&i!==i.root&&i.root.ce._removeChildStyle(s)}qd(()=>{Wa.clear()})}function Wd(e,t){H.extend(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function Ha(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 xr,Yi=[],Ga=!1;function nS(e,...t){xr?xr.emit(e,...t):Ga||Yi.push({event:e,args:t})}function Hd(e,t){var n,r;xr=e,xr?(xr.enabled=!0,Yi.forEach(({event:o,args:i})=>xr.emit(o,...i)),Yi=[]):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(i=>{Hd(i,t)}),setTimeout(()=>{xr||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Ga=!0,Yi=[])},3e3)):(Ga=!0,Yi=[])}const rS=iS("component:updated");/*! #__NO_SIDE_EFFECTS__ */function iS(e){return t=>{nS(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}let tn=null,Gd=null;function Kd(e){const t=tn;return tn=e,Gd=e&&e.type.__scopeId||null,t}function Se(e,t=tn,n){if(!t||e._n)return e;const r=(...o)=>{r._d&&yp(-1);const i=Kd(t);let s;try{s=e(...o)}finally{Kd(i),r._d&&yp(1)}return ve.env.NODE_ENV!=="production"&&rS(t),s};return r._n=!0,r._c=!0,r._d=!0,r}function ot(e,t){if(tn===null)return ve.env.NODE_ENV!=="production"&&Ze("withDirectives can only be used inside render functions."),e;const n=Ap(tn),r=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,s,a,c=H.EMPTY_OBJ]=t[o];i&&(H.isFunction(i)&&(i={mounted:i,updated:i}),i.deep&&pr(s),r.push({dir:i,instance:n,value:s,oldValue:void 0,arg:a,modifiers:c}))}return e}const oS=Symbol("_vte"),sS=e=>e.__isTeleport,Qr=e=>e&&(e.disabled||e.disabled===""),Qd=e=>e&&(e.defer||e.defer===""),Xd=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Yd=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Ka=(e,t)=>{const n=e&&e.to;if(H.isString(n))if(t){const r=t(n);return ve.env.NODE_ENV!=="production"&&!r&&!Qr(e)&&Ze(`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 ve.env.NODE_ENV!=="production"&&Ze("Current renderer does not support string target for Teleports. (missing querySelector renderer option)"),null;else return ve.env.NODE_ENV!=="production"&&!n&&!Qr(e)&&Ze(`Invalid Teleport target: ${n}`),n},Jd={name:"Teleport",__isTeleport:!0,process(e,t,n,r,o,i,s,a,c,u){const{mc:l,pc:d,pbc:f,o:{insert:m,querySelector:w,createText:y,createComment:E}}=u,b=Qr(t.props);let{shapeFlag:g,children:v,dynamicChildren:h}=t;if(ve.env.NODE_ENV!=="production"&&Xi&&(c=!1,h=null),e==null){const S=t.el=ve.env.NODE_ENV!=="production"?E("teleport start"):y(""),T=t.anchor=ve.env.NODE_ENV!=="production"?E("teleport end"):y("");m(S,n,r),m(T,n,r);const R=(A,$)=>{g&16&&(o&&o.isCE&&(o.ce._teleportTarget=A),l(v,A,$,o,i,s,a,c))},_=()=>{const A=t.target=Ka(t.props,w),$=ep(A,t,y,m);A?(s!=="svg"&&Xd(A)?s="svg":s!=="mathml"&&Yd(A)&&(s="mathml"),b||(R(A,$),rs(t,!1))):ve.env.NODE_ENV!=="production"&&!b&&Ze("Invalid Teleport target on mount:",A,`(${typeof A})`)};b&&(R(n,T),rs(t,!0)),Qd(t.props)?(t.el.__isMounted=!1,nl(()=>{_(),delete t.el.__isMounted},i)):_()}else{if(Qd(t.props)&&e.el.__isMounted===!1){nl(()=>{Jd.process(e,t,n,r,o,i,s,a,c,u)},i);return}t.el=e.el,t.targetStart=e.targetStart;const S=t.anchor=e.anchor,T=t.target=e.target,R=t.targetAnchor=e.targetAnchor,_=Qr(e.props),A=_?n:T,$=_?S:R;if(s==="svg"||Xd(T)?s="svg":(s==="mathml"||Yd(T))&&(s="mathml"),h?(f(e.dynamicChildren,h,A,o,i,s,a),hp(e,t,ve.env.NODE_ENV==="production")):c||d(e,t,A,$,o,i,s,a,!1),b)_?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):ns(t,n,S,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const D=t.target=Ka(t.props,w);D?ns(t,D,null,u,0):ve.env.NODE_ENV!=="production"&&Ze("Invalid Teleport target on update:",T,`(${typeof T})`)}else _&&ns(t,T,R,u,1);rs(t,b)}},remove(e,t,n,{um:r,o:{remove:o}},i){const{shapeFlag:s,children:a,anchor:c,targetStart:u,targetAnchor:l,target:d,props:f}=e;if(d&&(o(u),o(l)),i&&o(c),s&16){const m=i||!Qr(f);for(let w=0;w<a.length;w++){const y=a[w];r(y,t,n,m,!!y.dynamicChildren)}}},move:ns,hydrate:aS};function ns(e,t,n,{o:{insert:r},m:o},i=2){i===0&&r(e.targetAnchor,t,n);const{el:s,anchor:a,shapeFlag:c,children:u,props:l}=e,d=i===2;if(d&&r(s,t,n),(!d||Qr(l))&&c&16)for(let f=0;f<u.length;f++)o(u[f],t,n,2);d&&r(a,t,n)}function aS(e,t,n,r,o,i,{o:{nextSibling:s,parentNode:a,querySelector:c,insert:u,createText:l}},d){const f=t.target=Ka(t.props,c);if(f){const m=Qr(t.props),w=f._lpa||f.firstChild;if(t.shapeFlag&16)if(m)t.anchor=d(s(e),t,a(e),n,r,o,i),t.targetStart=w,t.targetAnchor=w&&s(w);else{t.anchor=s(e);let y=w;for(;y;){if(y&&y.nodeType===8){if(y.data==="teleport start anchor")t.targetStart=y;else if(y.data==="teleport anchor"){t.targetAnchor=y,f._lpa=t.targetAnchor&&s(t.targetAnchor);break}}y=s(y)}t.targetAnchor||ep(f,t,l,u),d(w&&s(w),t,f,n,r,o,i)}rs(t,m)}return t.anchor&&s(t.anchor)}const Zd=Jd;function rs(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 ep(e,t,n,r){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[oS]=i,e&&(r(o,e),r(i,e)),i}function tp(e,t){e.shapeFlag&6&&e.component?(e.transition=t,tp(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}/*! #__NO_SIDE_EFFECTS__ */function xe(e,t){return H.isFunction(e)?H.extend({name:e.name},t,{setup:e}):e}function lS(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const cS=new WeakSet;function Qa(e){const t=ol(),n=Fw(null);if(t){const o=t.refs===H.EMPTY_OBJ?t.refs={}:t.refs;let i;ve.env.NODE_ENV!=="production"&&(i=Object.getOwnPropertyDescriptor(o,e))&&!i.configurable?Ze(`useTemplateRef('${e}') already exists.`):Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:s=>n.value=s})}else ve.env.NODE_ENV!=="production"&&Ze("useTemplateRef() is called when there is no active component instance to be associated with.");const r=ve.env.NODE_ENV!=="production"?dr(n):n;return ve.env.NODE_ENV!=="production"&&cS.add(r),r}const np=e=>e.nodeType===8;H.getGlobalThis().requestIdleCallback,H.getGlobalThis().cancelIdleCallback;function uS(e,t){if(np(e)&&e.data==="["){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(np(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else t(e)}const fS=e=>!!e.type.__asyncLoader;/*! #__NO_SIDE_EFFECTS__ */function dS(e){H.isFunction(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:o=200,hydrate:i,timeout:s,suspensible:a=!0,onError:c}=e;let u=null,l,d=0;const f=()=>(d++,u=null,m()),m=()=>{let w;return u||(w=u=t().catch(y=>{if(y=y instanceof Error?y:new Error(String(y)),c)return new Promise((E,b)=>{c(y,()=>E(f()),()=>b(y),d+1)});throw y}).then(y=>{if(w!==u&&u)return u;if(ve.env.NODE_ENV!=="production"&&!y&&Ze("Async component loader resolved to undefined. If you are using retry(), make sure to return its return value."),y&&(y.__esModule||y[Symbol.toStringTag]==="Module")&&(y=y.default),ve.env.NODE_ENV!=="production"&&y&&!H.isObject(y)&&!H.isFunction(y))throw new Error(`Invalid async component load result: ${y}`);return l=y,y}))};return xe({name:"AsyncComponentWrapper",__asyncLoader:m,__asyncHydrate(w,y,E){let b=!1;const g=i?()=>{const h=i(()=>{if(ve.env.NODE_ENV!=="production"&&b){Ze(`Skipping lazy hydration for component '${us(l)}': it was updated before lazy hydration performed.`);return}E()},S=>uS(w,S));h&&(y.bum||(y.bum=[])).push(h),(y.u||(y.u=[])).push(()=>b=!0)}:E;l?g():m().then(()=>!y.isUnmounted&&g())},get __asyncResolved(){return l},setup(){const w=En;if(lS(w),l)return()=>Xa(l,w);const y=v=>{u=null,Jo(v,w,13,!r)};if(a&&w.suspense||_i)return m().then(v=>()=>Xa(v,w)).catch(v=>(y(v),()=>r?ge(r,{error:v}):null));const E=ce(!1),b=ce(),g=ce(!!o);return o&&setTimeout(()=>{g.value=!1},o),s!=null&&setTimeout(()=>{if(!E.value&&!b.value){const v=new Error(`Async component timed out after ${s}ms.`);y(v),b.value=v}},s),m().then(()=>{E.value=!0,w.parent&&pS(w.parent.vnode)&&w.parent.update()}).catch(v=>{y(v),b.value=v}),()=>{if(E.value&&l)return Xa(l,w);if(b.value&&r)return ge(r,{error:b.value});if(n&&!g.value)return ge(n)}}})}function Xa(e,t){const{ref:n,props:r,children:o,ce:i}=t.vnode,s=ge(e,r,o);return s.ref=n,s.ce=i,delete t.vnode.ce,s}const pS=e=>e.type.__isKeepAlive;function hS(e,t,n=En,r=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...s)=>{bi();const a=Ep(n),c=Va(t,n,e,s);return a(),vi(),c});return r?o.unshift(i):o.push(i),i}else if(ve.env.NODE_ENV!=="production"){const o=H.toHandlerKey(qa[e].replace(/ hook$/,""));Ze(`${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 is=e=>(t,n=En)=>{(!_i||e==="sp")&&hS(e,(...r)=>t(...r),n)},Bt=is("m"),gS=is("bu"),Vn=is("bum"),Ya=is("um"),os="components",mS="directives";function he(e,t){return Ja(os,e,!0,t)||e}const rp=Symbol.for("v-ndc");function Nr(e){return H.isString(e)?Ja(os,e,!1)||e:e||rp}function ln(e){return Ja(mS,e)}function Ja(e,t,n=!0,r=!1){const o=tn||En;if(o){const i=o.type;if(e===os){const a=us(i,!1);if(a&&(a===t||a===H.camelize(t)||a===H.capitalize(H.camelize(t))))return i}const s=ip(o[e]||i[e],t)||ip(o.appContext[e],t);if(!s&&r)return i;if(ve.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.`:"";Ze(`Failed to resolve ${e.slice(0,-1)}: ${t}${a}`)}return s}else ve.env.NODE_ENV!=="production"&&Ze(`resolve${H.capitalize(e.slice(0,-1))} can only be used in render() or setup().`)}function ip(e,t){return e&&(e[t]||e[H.camelize(t)]||e[H.capitalize(H.camelize(t))])}function wt(e,t,n,r){let o;const i=n,s=H.isArray(e);if(s||H.isString(e)){const a=s&&Hr(e);let c=!1,u=!1;a&&(c=!hn(e),u=Zn(e),e=Vo(e)),o=new Array(e.length);for(let l=0,d=e.length;l<d;l++)o[l]=t(c?u?Ko(on(e[l])):on(e[l]):e[l],l,void 0,i)}else if(typeof e=="number"){ve.env.NODE_ENV!=="production"&&!Number.isInteger(e)&&Ze(`The v-for range expect an integer value but got ${e}.`),o=new Array(e);for(let a=0;a<e;a++)o[a]=t(a+1,a,void 0,i)}else if(H.isObject(e))if(e[Symbol.iterator])o=Array.from(e,(a,c)=>t(a,c,void 0,i));else{const a=Object.keys(e);o=new Array(a.length);for(let c=0,u=a.length;c<u;c++){const l=a[c];o[c]=t(e[l],l,c,i)}}else o=[];return o}function op(e,t){for(let n=0;n<t.length;n++){const r=t[n];if(H.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 i=r.fn(...o);return i&&(i.key=r.key),i}:r.fn)}return e}function Xe(e,t,n={},r,o){if(tn.ce||tn.parent&&fS(tn.parent)&&tn.parent.ce)return t!=="default"&&(n.name=t),X(),Re(qe,null,[ge("slot",n,r&&r())],64);let i=e[t];ve.env.NODE_ENV!=="production"&&i&&i.length>1&&(Ze("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."),i=()=>[]),i&&i._c&&(i._d=!1),X();const s=i&&sp(i(n)),a=n.key||s&&s.key,c=Re(qe,{key:(a&&!H.isSymbol(a)?a:`_${t}`)+(!s&&r?"_fb":"")},s||(r?r():[]),s&&e._===1?64:-2);return!o&&c.scopeId&&(c.slotScopeIds=[c.scopeId+"-s"]),i&&i._c&&(i._d=!0),c}function sp(e){return e.some(t=>ls(t)?!(t.type===Ai||t.type===qe&&!sp(t.children)):!0)?e:null}function Za(e,t){const n={};if(ve.env.NODE_ENV!=="production"&&!H.isObject(e))return Ze("v-on with no argument expects an object value."),n;for(const r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:H.toHandlerKey(r)]=e[r];return n}const el=e=>e?NS(e)?Ap(e):el(e.parent):null,tl=H.extend(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>ve.env.NODE_ENV!=="production"?Ho(e.props):e.props,$attrs:e=>ve.env.NODE_ENV!=="production"?Ho(e.attrs):e.attrs,$slots:e=>ve.env.NODE_ENV!=="production"?Ho(e.slots):e.slots,$refs:e=>ve.env.NODE_ENV!=="production"?Ho(e.refs):e.refs,$parent:e=>el(e.parent),$root:e=>el(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>vS(e),$forceUpdate:e=>e.f||(e.f=()=>{za(e.update)}),$nextTick:e=>e.n||(e.n=In.bind(e.proxy)),$watch:e=>IS.bind(e)}),yS={};ve.env.NODE_ENV!=="production"&&(yS.ownKeys=e=>(Ze("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 bS(){return lp().slots}function ap(){return lp().attrs}function lp(){const e=ol();return ve.env.NODE_ENV!=="production"&&!e&&Ze("useContext() called without active instance."),e.setupContext||(e.setupContext=DS(e))}function cp(e){return H.isArray(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function vS(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:s}}=e.appContext,a=i.get(t);let c;return a?c=a:!o.length&&!n&&!r?c=t:(c={},o.length&&o.forEach(u=>ss(c,u,s,!0)),ss(c,t,s)),H.isObject(t)&&i.set(t,c),c}function ss(e,t,n,r=!1){const{mixins:o,extends:i}=t;i&&ss(e,i,n,!0),o&&o.forEach(s=>ss(e,s,n,!0));for(const s in t)if(r&&s==="expose")ve.env.NODE_ENV!=="production"&&Ze('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const a=wS[s]||n&&n[s];e[s]=a?a(e[s],t[s]):t[s]}return e}const wS={data:up,props:dp,emits:dp,methods:Ji,computed:Ji,beforeCreate:gn,created:gn,beforeMount:gn,mounted:gn,beforeUpdate:gn,updated:gn,beforeDestroy:gn,beforeUnmount:gn,destroyed:gn,unmounted:gn,activated:gn,deactivated:gn,errorCaptured:gn,serverPrefetch:gn,components:Ji,directives:Ji,watch:ES,provide:up,inject:SS};function up(e,t){return t?e?function(){return H.extend(H.isFunction(e)?e.call(this,this):e,H.isFunction(t)?t.call(this,this):t)}:t:e}function SS(e,t){return Ji(fp(e),fp(t))}function fp(e){if(H.isArray(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function gn(e,t){return e?[...new Set([].concat(e,t))]:t}function Ji(e,t){return e?H.extend(Object.create(null),e,t):t}function dp(e,t){return e?H.isArray(e)&&H.isArray(t)?[...new Set([...e,...t])]:H.extend(Object.create(null),cp(e),cp(t??{})):t}function ES(e,t){if(!e)return t;if(!t)return e;const n=H.extend(Object.create(null),e);for(const r in t)n[r]=gn(e[r],t[r]);return n}let TS=null;function Ti(e,t){if(!En)ve.env.NODE_ENV!=="production"&&Ze("provide() can only be used inside setup().");else{let n=En.provides;const r=En.parent&&En.parent.provides;r===n&&(n=En.provides=Object.create(r)),n[e]=t}}function gr(e,t,n=!1){const r=En||tn;if(r||TS){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&&H.isFunction(t)?t.call(r&&r.proxy):t;ve.env.NODE_ENV!=="production"&&Ze(`injection "${String(e)}" not found.`)}else ve.env.NODE_ENV!=="production"&&Ze("inject() can only be used inside setup() or functional components.")}const AS={},pp=e=>Object.getPrototypeOf(e)===AS,nl=FS;function hp(e,t,n=!1){const r=e.children,o=t.children;if(H.isArray(r)&&H.isArray(o))for(let i=0;i<r.length;i++){const s=r[i];let a=o[i];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=o[i]=xS(o[i]),a.el=s.el),!n&&a.patchFlag!==-2&&hp(s,a)),a.type===mp&&(a.el=s.el),a.type===Ai&&!a.el&&(a.el=s.el),ve.env.NODE_ENV!=="production"&&a.el&&(a.el.__vnode=a)}}const RS=Symbol.for("v-scx"),_S=()=>{{const e=gr(RS);return e||ve.env.NODE_ENV!=="production"&&Ze("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function St(e,t,n){return ve.env.NODE_ENV!=="production"&&!H.isFunction(t)&&Ze("`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."),gp(e,t,n)}function gp(e,t,n=H.EMPTY_OBJ){const{immediate:r,deep:o,flush:i,once:s}=n;ve.env.NODE_ENV!=="production"&&!t&&(r!==void 0&&Ze('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),o!==void 0&&Ze('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),s!==void 0&&Ze('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const a=H.extend({},n);ve.env.NODE_ENV!=="production"&&(a.onWarn=Ze);const c=t&&r||!t&&i!=="post";let u;if(_i){if(i==="sync"){const m=_S();u=m.__watcherHandles||(m.__watcherHandles=[])}else if(!c){const m=()=>{};return m.stop=H.NOOP,m.resume=H.NOOP,m.pause=H.NOOP,m}}const l=En;a.call=(m,w,y)=>Va(m,l,w,y);let d=!1;i==="post"?a.scheduler=m=>{nl(m,l&&l.suspense)}:i!=="sync"&&(d=!0,a.scheduler=(m,w)=>{w?m():za(m)}),a.augmentJob=m=>{t&&(m.flags|=4),d&&(m.flags|=2,l&&(m.id=l.uid,m.i=l))};const f=qw(e,t,a);return _i&&(u?u.push(f):c&&f()),f}function IS(e,t,n){const r=this.proxy,o=H.isString(e)?e.includes(".")?CS(r,e):()=>r[e]:e.bind(r,r);let i;H.isFunction(t)?i=t:(i=t.handler,n=t);const s=Ep(this),a=gp(o,i.bind(r),n);return s(),a}function CS(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 PS=e=>e.__isSuspense;function FS(e,t){t&&t.pendingBranch?H.isArray(e)?t.effects.push(...e):t.effects.push(e):qd(e)}const qe=Symbol.for("v-fgt"),mp=Symbol.for("v-txt"),Ai=Symbol.for("v-cmt"),as=[];let Cn=null;function X(e=!1){as.push(Cn=e?null:[])}function OS(){as.pop(),Cn=as[as.length-1]||null}let Zi=1;function yp(e,t=!1){Zi+=e,e<0&&Cn&&t&&(Cn.hasOnce=!0)}function bp(e){return e.dynamicChildren=Zi>0?Cn||H.EMPTY_ARR:null,OS(),Zi>0&&Cn&&Cn.push(e),e}function pe(e,t,n,r,o,i){return bp(fe(e,t,n,r,o,i,!0))}function Re(e,t,n,r,o){return bp(ge(e,t,n,r,o,!0))}function ls(e){return e?e.__v_isVNode===!0:!1}const kS=(...e)=>wp(...e),vp=({key:e})=>e??null,cs=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?H.isString(e)||Vt(e)||H.isFunction(e)?{i:tn,r:e,k:t,f:!!n}:e:null);function fe(e,t=null,n=null,r=0,o=null,i=e===qe?0:1,s=!1,a=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&vp(t),ref:t&&cs(t),scopeId:Gd,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:i,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:tn};return a?(il(c,n),i&128&&e.normalize(c)):n&&(c.shapeFlag|=H.isString(n)?8:16),ve.env.NODE_ENV!=="production"&&c.key!==c.key&&Ze("VNode created with invalid key (NaN). VNode type:",c.type),Zi>0&&!s&&Cn&&(c.patchFlag>0||i&6)&&c.patchFlag!==32&&Cn.push(c),c}const ge=ve.env.NODE_ENV!=="production"?kS:wp;function wp(e,t=null,n=null,r=0,o=null,i=!1){if((!e||e===rp)&&(ve.env.NODE_ENV!=="production"&&!e&&Ze(`Invalid vnode type when creating vnode: ${e}.`),e=Ai),ls(e)){const a=Ri(e,t,!0);return n&&il(a,n),Zi>0&&!i&&Cn&&(a.shapeFlag&6?Cn[Cn.indexOf(e)]=a:Cn.push(a)),a.patchFlag=-2,a}if(_p(e)&&(e=e.__vccOpts),t){t=rl(t);let{class:a,style:c}=t;a&&!H.isString(a)&&(t.class=H.normalizeClass(a)),H.isObject(c)&&(Go(c)&&!H.isArray(c)&&(c=H.extend({},c)),t.style=H.normalizeStyle(c))}const s=H.isString(e)?1:PS(e)?128:sS(e)?64:H.isObject(e)?4:H.isFunction(e)?2:0;return ve.env.NODE_ENV!=="production"&&s&4&&Go(e)&&(e=rt(e),Ze("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)),fe(e,t,n,r,o,s,i,!0)}function rl(e){return e?Go(e)||pp(e)?H.extend({},e):e:null}function Ri(e,t,n=!1,r=!1){const{props:o,ref:i,patchFlag:s,children:a,transition:c}=e,u=t?Gt(o||{},t):o,l={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&vp(u),ref:t&&t.ref?n&&i?H.isArray(i)?i.concat(cs(t)):[i,cs(t)]:cs(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:ve.env.NODE_ENV!=="production"&&s===-1&&H.isArray(a)?a.map(Sp):a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==qe?s===-1?16:s|16:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ri(e.ssContent),ssFallback:e.ssFallback&&Ri(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&tp(l,c.clone(l)),l}function Sp(e){const t=Ri(e);return H.isArray(e.children)&&(t.children=e.children.map(Sp)),t}function Ot(e=" ",t=0){return ge(mp,null,e,t)}function Ce(e="",t=!1){return t?(X(),Re(Ai,null,e)):ge(Ai,null,e)}function xS(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ri(e)}function il(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(H.isArray(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),il(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!pp(t)?t._ctx=tn:o===3&&tn&&(tn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else H.isFunction(t)?(t={default:t,_ctx:tn},n=32):(t=String(t),r&64?(n=16,t=[Ot(t)]):n=8);e.children=t,e.shapeFlag|=n}function Gt(...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=H.normalizeClass([t.class,r.class]));else if(o==="style")t.style=H.normalizeStyle([t.style,r.style]);else if(H.isOn(o)){const i=t[o],s=r[o];s&&i!==s&&!(H.isArray(i)&&i.includes(s))&&(t[o]=i?[].concat(i,s):s)}else o!==""&&(t[o]=r[o])}return t}let En=null;const ol=()=>En||tn;let sl;{const e=H.getGlobalThis(),t=(n,r)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(r),i=>{o.length>1?o.forEach(s=>s(i)):o[0](i)}};sl=t("__VUE_INSTANCE_SETTERS__",n=>En=n),t("__VUE_SSR_SETTERS__",n=>_i=n)}const Ep=e=>{const t=En;return sl(e),e.scope.on(),()=>{e.scope.off(),sl(t)}};function NS(e){return e.vnode.shapeFlag&4}let _i=!1;const Tp=ve.env.NODE_ENV!=="production"?{get(e,t){return rn(e,"get",""),e[t]},set(){return Ze("setupContext.attrs is readonly."),!1},deleteProperty(){return Ze("setupContext.attrs is readonly."),!1}}:{get(e,t){return rn(e,"get",""),e[t]}};function $S(e){return new Proxy(e.slots,{get(t,n){return rn(e,"get","$slots"),t[n]}})}function DS(e){const t=n=>{if(ve.env.NODE_ENV!=="production"&&(e.exposed&&Ze("expose() should be called only once per setup()."),n!=null)){let r=typeof n;r==="object"&&(H.isArray(n)?r="array":Vt(n)&&(r="ref")),r!=="object"&&Ze(`expose() should be passed a plain object, received ${r}.`)}e.exposed=n||{}};if(ve.env.NODE_ENV!=="production"){let n,r;return Object.freeze({get attrs(){return n||(n=new Proxy(e.attrs,Tp))},get slots(){return r||(r=$S(e))},get emit(){return(o,...i)=>e.emit(o,...i)},expose:t})}else return{attrs:new Proxy(e.attrs,Tp),slots:e.slots,emit:e.emit,expose:t}}function Ap(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(xw(Dd(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in tl)return tl[n](e)},has(t,n){return n in t||n in tl}})):e.proxy}const LS=/(?:^|[-_])(\w)/g,MS=e=>e.replace(LS,t=>t.toUpperCase()).replace(/[-_]/g,"");function us(e,t=!0){return H.isFunction(e)?e.displayName||e.name:e.name||t&&e.__name}function Rp(e,t,n=!1){let r=us(t);if(!r&&t.__file){const o=t.__file.match(/([^/\\]+)\.\w+$/);o&&(r=o[1])}if(!r&&e&&e.parent){const o=i=>{for(const s in i)if(i[s]===t)return s};r=o(e.components||e.parent.type.components)||o(e.appContext.components)}return r?MS(r):n?"App":"Anonymous"}function _p(e){return H.isFunction(e)&&"__vccOpts"in e}const B=(e,t)=>{const n=jw(e,t,_i);if(ve.env.NODE_ENV!=="production"){const r=ol();r&&r.appContext.config.warnRecursiveComputed&&(n._warnRecursive=!0)}return n};function al(e,t,n){const r=arguments.length;return r===2?H.isObject(t)&&!H.isArray(t)?ls(t)?ge(e,null,[t]):ge(e,t):ge(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&ls(n)&&(n=[n]),ge(e,t,n))}function BS(){if(ve.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(d){if(!H.isObject(d))return null;if(d.__isVue)return["div",e,"VueInstance"];if(Vt(d)){bi();const f=d.value;return vi(),["div",{},["span",e,l(d)],"<",a(f),">"]}else{if(Hr(d))return["div",{},["span",e,hn(d)?"ShallowReactive":"Reactive"],"<",a(d),`>${Zn(d)?" (readonly)":""}`];if(Zn(d))return["div",{},["span",e,hn(d)?"ShallowReadonly":"Readonly"],"<",a(d),">"]}return null},hasBody(d){return d&&d.__isVue},body(d){if(d&&d.__isVue)return["div",{},...i(d.$)]}};function i(d){const f=[];d.type.props&&d.props&&f.push(s("props",rt(d.props))),d.setupState!==H.EMPTY_OBJ&&f.push(s("setup",d.setupState)),d.data!==H.EMPTY_OBJ&&f.push(s("data",rt(d.data)));const m=c(d,"computed");m&&f.push(s("computed",m));const w=c(d,"inject");return w&&f.push(s("injected",w)),f.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:d}]]),f}function s(d,f){return f=H.extend({},f),Object.keys(f).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},d],["div",{style:"padding-left:1.25em"},...Object.keys(f).map(m=>["div",{},["span",r,m+": "],a(f[m],!1)])]]:["span",{}]}function a(d,f=!0){return typeof d=="number"?["span",t,d]:typeof d=="string"?["span",n,JSON.stringify(d)]:typeof d=="boolean"?["span",r,d]:H.isObject(d)?["object",{object:f?rt(d):d}]:["span",n,String(d)]}function c(d,f){const m=d.type;if(H.isFunction(m))return;const w={};for(const y in d.ctx)u(m,y,f)&&(w[y]=d.ctx[y]);return w}function u(d,f,m){const w=d[m];if(H.isArray(w)&&w.includes(f)||H.isObject(w)&&f in w||d.extends&&u(d.extends,f,m)||d.mixins&&d.mixins.some(y=>u(y,f,m)))return!0}function l(d){return hn(d)?"ShallowRef":d.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(o):window.devtoolsFormatters=[o]}const jS=ve.env.NODE_ENV!=="production"?Ze:H.NOOP;ve.env.NODE_ENV,ve.env.NODE_ENV;let US;const Ip=typeof window<"u"&&window.trustedTypes;if(Ip)try{US=Ip.createPolicy("vue",{createHTML:e=>e})}catch(e){ve.env.NODE_ENV!=="production"&&jS(`Error creating trusted types policy: ${e}`)}const Cp=Symbol("_vod"),qS=Symbol("_vsh"),ll={beforeMount(e,{value:t},{transition:n}){e[Cp]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):eo(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),eo(e,!0),r.enter(e)):r.leave(e,()=>{eo(e,!1)}):eo(e,t))},beforeUnmount(e,{value:t}){eo(e,t)}};ve.env.NODE_ENV!=="production"&&(ll.name="show");function eo(e,t){e.style.display=t?e[Cp]:"none",e[qS]=!t}Symbol(ve.env.NODE_ENV!=="production"?"CSS_VAR_TEXT":"");function to(e,t,n,r){e.addEventListener(t,n,r)}const Pp=e=>{const t=e.props["onUpdate:modelValue"]||!1;return H.isArray(t)?n=>H.invokeArrayFns(t,n):t};function VS(e){e.target.composing=!0}function Fp(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const cl=Symbol("_assign"),zS={created(e,{modifiers:{lazy:t,trim:n,number:r}},o){e[cl]=Pp(o);const i=r||o.props&&o.props.type==="number";to(e,t?"change":"input",s=>{if(s.target.composing)return;let a=e.value;n&&(a=a.trim()),i&&(a=H.looseToNumber(a)),e[cl](a)}),n&&to(e,"change",()=>{e.value=e.value.trim()}),t||(to(e,"compositionstart",VS),to(e,"compositionend",Fp),to(e,"change",Fp))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:o,number:i}},s){if(e[cl]=Pp(s),e.composing)return;const a=(i||e.type==="number")&&!/^0\d/.test(e.value)?H.looseToNumber(e.value):e.value,c=t??"";a!==c&&(document.activeElement===e&&e.type!=="range"&&(r&&t===n||o&&e.value.trim()===c)||(e.value=c))}},WS=["ctrl","shift","alt","meta"],HS={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)=>WS.some(n=>e[`${n}Key`]&&!t.includes(n))},Pn=(e,t)=>{const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=(o,...i)=>{for(let s=0;s<t.length;s++){const a=HS[t[s]];if(a&&a(o,t))return}return e(o,...i)})},GS={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},no=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=o=>{if(!("key"in o))return;const i=H.hyphenate(o.key);if(t.some(s=>s===i||GS[s]===i))return e(o)})};function KS(){BS()}ve.env.NODE_ENV!=="production"&&KS();const mn=()=>Ht.useAbility();function Op(e){if(e===void 0)throw new Error('cloneStateObject: cannot clone "undefined"');return JSON.parse(JSON.stringify(e))}const ro=(e,t)=>!e||!t?!1:e.id===t.id;var $r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ul(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fl,kp;function QS(){if(kp)return fl;kp=1;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function t(o,i){for(var s="",a=0,c=-1,u=0,l,d=0;d<=o.length;++d){if(d<o.length)l=o.charCodeAt(d);else{if(l===47)break;l=47}if(l===47){if(!(c===d-1||u===1))if(c!==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 f=s.lastIndexOf("/");if(f!==s.length-1){f===-1?(s="",a=0):(s=s.slice(0,f),a=s.length-1-s.lastIndexOf("/")),c=d,u=0;continue}}else if(s.length===2||s.length===1){s="",a=0,c=d,u=0;continue}}i&&(s.length>0?s+="/..":s="..",a=2)}else s.length>0?s+="/"+o.slice(c+1,d):s=o.slice(c+1,d),a=d-c-1;c=d,u=0}else l===46&&u!==-1?++u:u=-1}return s}function n(o,i){var s=i.dir||i.root,a=i.base||(i.name||"")+(i.ext||"");return s?s===i.root?s+a:s+o+a:a}var r={resolve:function(){for(var i="",s=!1,a,c=arguments.length-1;c>=-1&&!s;c--){var u;c>=0?u=arguments[c]:(a===void 0&&(a=ve.cwd()),u=a),e(u),u.length!==0&&(i=u+"/"+i,s=u.charCodeAt(0)===47)}return i=t(i,!s),s?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(i){if(e(i),i.length===0)return".";var s=i.charCodeAt(0)===47,a=i.charCodeAt(i.length-1)===47;return i=t(i,!s),i.length===0&&!s&&(i="."),i.length>0&&a&&(i+="/"),s?"/"+i:i},isAbsolute:function(i){return e(i),i.length>0&&i.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var i,s=0;s<arguments.length;++s){var a=arguments[s];e(a),a.length>0&&(i===void 0?i=a:i+="/"+a)}return i===void 0?".":r.normalize(i)},relative:function(i,s){if(e(i),e(s),i===s||(i=r.resolve(i),s=r.resolve(s),i===s))return"";for(var a=1;a<i.length&&i.charCodeAt(a)===47;++a);for(var c=i.length,u=c-a,l=1;l<s.length&&s.charCodeAt(l)===47;++l);for(var d=s.length,f=d-l,m=u<f?u:f,w=-1,y=0;y<=m;++y){if(y===m){if(f>m){if(s.charCodeAt(l+y)===47)return s.slice(l+y+1);if(y===0)return s.slice(l+y)}else u>m&&(i.charCodeAt(a+y)===47?w=y:y===0&&(w=0));break}var E=i.charCodeAt(a+y),b=s.charCodeAt(l+y);if(E!==b)break;E===47&&(w=y)}var g="";for(y=a+w+1;y<=c;++y)(y===c||i.charCodeAt(y)===47)&&(g.length===0?g+="..":g+="/..");return g.length>0?g+s.slice(l+w):(l+=w,s.charCodeAt(l)===47&&++l,s.slice(l))},_makeLong:function(i){return i},dirname:function(i){if(e(i),i.length===0)return".";for(var s=i.charCodeAt(0),a=s===47,c=-1,u=!0,l=i.length-1;l>=1;--l)if(s=i.charCodeAt(l),s===47){if(!u){c=l;break}}else u=!1;return c===-1?a?"/":".":a&&c===1?"//":i.slice(0,c)},basename:function(i,s){if(s!==void 0&&typeof s!="string")throw new TypeError('"ext" argument must be a string');e(i);var a=0,c=-1,u=!0,l;if(s!==void 0&&s.length>0&&s.length<=i.length){if(s.length===i.length&&s===i)return"";var d=s.length-1,f=-1;for(l=i.length-1;l>=0;--l){var m=i.charCodeAt(l);if(m===47){if(!u){a=l+1;break}}else f===-1&&(u=!1,f=l+1),d>=0&&(m===s.charCodeAt(d)?--d===-1&&(c=l):(d=-1,c=f))}return a===c?c=f:c===-1&&(c=i.length),i.slice(a,c)}else{for(l=i.length-1;l>=0;--l)if(i.charCodeAt(l)===47){if(!u){a=l+1;break}}else c===-1&&(u=!1,c=l+1);return c===-1?"":i.slice(a,c)}},extname:function(i){e(i);for(var s=-1,a=0,c=-1,u=!0,l=0,d=i.length-1;d>=0;--d){var f=i.charCodeAt(d);if(f===47){if(!u){a=d+1;break}continue}c===-1&&(u=!1,c=d+1),f===46?s===-1?s=d:l!==1&&(l=1):s!==-1&&(l=-1)}return s===-1||c===-1||l===0||l===1&&s===c-1&&s===a+1?"":i.slice(s,c)},format:function(i){if(i===null||typeof i!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof i);return n("/",i)},parse:function(i){e(i);var s={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return s;var a=i.charCodeAt(0),c=a===47,u;c?(s.root="/",u=1):u=0;for(var l=-1,d=0,f=-1,m=!0,w=i.length-1,y=0;w>=u;--w){if(a=i.charCodeAt(w),a===47){if(!m){d=w+1;break}continue}f===-1&&(m=!1,f=w+1),a===46?l===-1?l=w:y!==1&&(y=1):l!==-1&&(y=-1)}return l===-1||f===-1||y===0||y===1&&l===f-1&&l===d+1?f!==-1&&(d===0&&c?s.base=s.name=i.slice(1,f):s.base=s.name=i.slice(d,f)):(d===0&&c?(s.name=i.slice(1,l),s.base=i.slice(1,f)):(s.name=i.slice(d,l),s.base=i.slice(d,f)),s.ext=i.slice(l,f)),d>0?s.dir=i.slice(0,d-1):c&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};return r.posix=r,fl=r,fl}var dt=QS();const fs=ul(dt),XS=xe({name:"SpaceMoveInfoModal",props:{modal:{type:Object,required:!0}}}),We=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},YS=["textContent"],JS=["textContent"];function ZS(e,t,n,r,o,i){return X(),pe(qe,null,[fe("p",{class:"oc-mt-rm",textContent:H.toDisplayString(e.$gettext("Moving files from one space to another is not possible. Do you want to copy instead?"))},null,8,YS),fe("p",{class:"oc-mb-rm",textContent:H.toDisplayString(e.$gettext("Note: Links and shares of the original file are not copied."))},null,8,JS)],64)}const xp=We(XS,[["render",ZS]]),eE=xe({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}=pt(),{$gettext:n}=Fe.useGettext(),r=ce(!1),o=B(()=>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)),i=B(()=>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=B(()=>e.confirmSecondaryTextOverwrite||n("Replace"));return{message:i,checkboxValue:r,checkboxLabel:o,confirmSecondaryText:s,onConfirm:()=>{t(e.modal.id),e.callbackFn({strategy:Wn.KEEP_BOTH,doForAllConflicts:p(r)})},onConfirmSecondary:()=>{t(e.modal.id);const l=e.suggestMerge?Wn.MERGE:Wn.REPLACE;e.callbackFn({strategy:l,doForAllConflicts:p(r)})},onCancel:()=>{t(e.modal.id),e.callbackFn({strategy:Wn.SKIP,doForAllConflicts:p(r)})}}}}),tE=["textContent"],nE={class:"oc-my-m"},rE={class:"oc-flex oc-flex-right oc-flex-middle oc-mt-m"},iE={class:"oc-modal-body-actions-grid"};function oE(e,t,n,r,o,i){const s=he("oc-checkbox"),a=he("oc-button");return X(),pe(qe,null,[fe("span",{class:"oc-display-inline-block oc-mb-m",textContent:H.toDisplayString(e.message)},null,8,tE),fe("div",nE,[e.conflictCount>1?(X(),Re(s,{key:0,modelValue:e.checkboxValue,"onUpdate:modelValue":t[0]||(t[0]=c=>e.checkboxValue=c),size:"medium",label:e.checkboxLabel,"aria-label":e.checkboxLabel},null,8,["modelValue","label","aria-label"])):Ce("",!0)]),fe("div",rE,[fe("div",iE,[ge(a,{class:"oc-modal-body-actions-cancel oc-ml-s",onClick:e.onCancel},{default:Se(()=>[Ot(H.toDisplayString(e.$gettext("Skip")),1)]),_:1},8,["onClick"]),ge(a,{class:"oc-modal-body-actions-secondary oc-ml-s",onClick:e.onConfirmSecondary},{default:Se(()=>[Ot(H.toDisplayString(e.confirmSecondaryText),1)]),_:1},8,["onClick"]),ge(a,{class:"oc-modal-body-actions-confirm oc-ml-s",appearance:"filled",onClick:e.onConfirm},{default:Se(()=>[Ot(H.toDisplayString(e.$gettext("Keep both")),1)]),_:1},8,["onClick"])])])],64)}const Np=We(eE,[["render",oE]]);class dl{constructor(t,n){this.$gettext=t,this.$ngettext=n}async resolveAllConflicts(t,n,r){const o=[];for(const u of t){const l=dt.join(n.path,u.name);r.some(f=>f.path===l)&&o.push({resource:u,strategy:null})}let i=0,s=!1,a=null;const c=[];for(const u of o){if(s){u.strategy=a,c.push(u);continue}const l=o.length-i,d=await this.resolveFileExists(u.resource,l);u.strategy=d.strategy,c.push(u),i+=1,d.doForAllConflicts&&(s=!0,a=d.strategy)}return c}resolveFileExists(t,n,r=!1,o=!1){const{dispatchModal:i}=pt();return new Promise(s=>{i({title:t.isFolder?this.$gettext("Folder already exists"):this.$gettext("File already exists"),hideActions:!0,customComponent:Np,customComponentAttrs:()=>({resource:t,conflictCount:n,suggestMerge:r,separateSkipHandling:o,callbackFn:a=>{s(a)}})})})}resolveDoCopyInsteadOfMoveForSpaces(){const{dispatchModal:t}=pt();return new Promise(n=>{t({title:this.$gettext("Copy here?"),customComponent:xp,confirmText:this.$gettext("Copy here"),onCancel:()=>{n(!1)},onConfirm:()=>Promise.resolve(n(!0))})})}}const zn=(e,t,n,r=1)=>{let o;return t?o=`${Z.extractNameWithoutExtension({name:e,extension:t})} (${r}).${t}`:o=`${e} (${r})`,n.some(s=>s.name===o)?zn(e,t,n,r+1):o},$p=(e,t,n,r)=>e.id===n.id&&dt.dirname(t.path)===r.path;var Wn=(e=>(e[e.SKIP=0]="SKIP",e[e.REPLACE=1]="REPLACE",e[e.KEEP_BOTH=2]="KEEP_BOTH",e[e.MERGE=3]="MERGE",e))(Wn||{}),mr=(e=>(e[e.COPY=0]="COPY",e[e.MOVE=1]="MOVE",e))(mr||{});class Dp extends dl{constructor(t,n,r,o,i,s,a,c){super(a,c),this.sourceSpace=t,this.resourcesToMove=n,this.targetSpace=r,this.targetFolder=o,this.currentFolder=i,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){var a,c;if(t.length===0){const u=n.length;if(u===0)return;const l=r===mr.COPY?this.$ngettext("%{count} item was copied successfully","%{count} items were copied successfully",u,{count:u.toString()},!0):this.$ngettext("%{count} item was moved successfully","%{count} items were moved successfully",u,{count:u.toString()},!0);tt().showMessage({title:l,status:"success"});return}let o=r===mr.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===mr.COPY?this.$gettext("Failed to copy »%{name}«",{name:(a=t[0])==null?void 0:a.resourceName},!0):this.$gettext("Failed to move »%{name}«",{name:(c=t[0])==null?void 0:c.resourceName},!0));let i="";t.some(({error:u})=>u instanceof Z.HttpError&&u.statusCode===507)&&(i=this.$gettext("Insufficient quota")),tt().showErrorMessage({title:o,...i&&{desc:i},errors:t.map(({error:u})=>u)})}async getTransferData(t){var i;if(this.hasRecursion())return this.showRecursionErrorMessage(),[];if(this.sourceSpace.id!==this.targetSpace.id&&t===mr.MOVE){if(!await this.resolveDoCopyInsteadOfMoveForSpaces())return[];t=mr.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 a={...s},{id:c,name:u,extension:l}=a,d=r.some(w=>w.resource.id===c);let f=u,m=!1;if(d){const w=(i=r.find(y=>y.resource.id===c))==null?void 0:i.strategy;if(w===Wn.SKIP)continue;if(w===Wn.REPLACE){if(this.isOverwritingParentFolder(a,this.targetFolder,n)){const y=new Error;this.showResultMessage([{error:y,resourceName:u}],[],t);continue}m=!0}w===Wn.KEEP_BOTH&&(f=zn(u,l,n),a.name=f)}$p(this.sourceSpace,a,this.targetSpace,this.targetFolder)&&m||o.push({resource:a,sourceSpace:this.sourceSpace,targetSpace:this.targetSpace,targetFolder:this.targetFolder,path:dt.join(this.targetFolder.path,f),overwrite:m,transferType:t})}return o}isOverwritingParentFolder(t,n,r){var s;if(t.type!=="folder"||n.path===((s=p(this.currentFolder))==null?void 0:s.path))return!1;const o=dt.basename(t.path),i=dt.join(n.path,o);return r.some(a=>a.path===i)}}const pl={ignoreLocation:!0,threshold:0,useExtendedSearch:!0},sE=(e,t,n)=>new fd(e,{...pl,keys:["name","type","icon","extension","tags"]}).search(t,{limit:n}).map(o=>o.item),Lp="oc-resource-icon-mapping",aE={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","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"]}};function Mp(){const e={};return Object.values(aE).forEach(t=>{t.extensions.forEach(n=>{e[n]=t.icon})}),e}function hl(e,t,n){return t.name=dt.basename(n),t.path=n,t.webDavPath=dt.join(e.webDavPath,n),t.extension=Z.extractExtensionFromFile(t),t}function lE(){this.__data__=[],this.size=0}function io(e,t){return e===t||e!==e&&t!==t}function ds(e,t){for(var n=e.length;n--;)if(io(e[n][0],t))return n;return-1}var cE=Array.prototype,uE=cE.splice;function fE(e){var t=this.__data__,n=ds(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 dE(e){var t=this.__data__,n=ds(t,e);return n<0?void 0:t[n][1]}function pE(e){return ds(this.__data__,e)>-1}function hE(e,t){var n=this.__data__,r=ds(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function yr(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])}}yr.prototype.clear=lE,yr.prototype.delete=fE,yr.prototype.get=dE,yr.prototype.has=pE,yr.prototype.set=hE;function gE(){this.__data__=new yr,this.size=0}function mE(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function yE(e){return this.__data__.get(e)}function bE(e){return this.__data__.has(e)}const Dr=globalThis||void 0||self;var Bp=typeof Dr=="object"&&Dr&&Dr.Object===Object&&Dr,vE=typeof self=="object"&&self&&self.Object===Object&&self,er=Bp||vE||Function("return this")(),xn=er.Symbol,jp=Object.prototype,wE=jp.hasOwnProperty,SE=jp.toString,oo=xn?xn.toStringTag:void 0;function EE(e){var t=wE.call(e,oo),n=e[oo];try{e[oo]=void 0;var r=!0}catch{}var o=SE.call(e);return r&&(t?e[oo]=n:delete e[oo]),o}var TE=Object.prototype,AE=TE.toString;function RE(e){return AE.call(e)}var _E="[object Null]",IE="[object Undefined]",Up=xn?xn.toStringTag:void 0;function Xr(e){return e==null?e===void 0?IE:_E:Up&&Up in Object(e)?EE(e):RE(e)}function tr(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var CE="[object AsyncFunction]",PE="[object Function]",FE="[object GeneratorFunction]",OE="[object Proxy]";function gl(e){if(!tr(e))return!1;var t=Xr(e);return t==PE||t==FE||t==CE||t==OE}var ml=er["__core-js_shared__"],qp=function(){var e=/[^.]+$/.exec(ml&&ml.keys&&ml.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function kE(e){return!!qp&&qp in e}var xE=Function.prototype,NE=xE.toString;function Yr(e){if(e!=null){try{return NE.call(e)}catch{}try{return e+""}catch{}}return""}var $E=/[\\^$.*+?()[\]{}|]/g,DE=/^\[object .+?Constructor\]$/,LE=Function.prototype,ME=Object.prototype,BE=LE.toString,jE=ME.hasOwnProperty,UE=RegExp("^"+BE.call(jE).replace($E,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function qE(e){if(!tr(e)||kE(e))return!1;var t=gl(e)?UE:DE;return t.test(Yr(e))}function VE(e,t){return e==null?void 0:e[t]}function Jr(e,t){var n=VE(e,t);return qE(n)?n:void 0}var so=Jr(er,"Map"),ao=Jr(Object,"create");function zE(){this.__data__=ao?ao(null):{},this.size=0}function WE(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var HE="__lodash_hash_undefined__",GE=Object.prototype,KE=GE.hasOwnProperty;function QE(e){var t=this.__data__;if(ao){var n=t[e];return n===HE?void 0:n}return KE.call(t,e)?t[e]:void 0}var XE=Object.prototype,YE=XE.hasOwnProperty;function JE(e){var t=this.__data__;return ao?t[e]!==void 0:YE.call(t,e)}var ZE="__lodash_hash_undefined__";function e1(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ao&&t===void 0?ZE:t,this}function Zr(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])}}Zr.prototype.clear=zE,Zr.prototype.delete=WE,Zr.prototype.get=QE,Zr.prototype.has=JE,Zr.prototype.set=e1;function t1(){this.size=0,this.__data__={hash:new Zr,map:new(so||yr),string:new Zr}}function n1(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ps(e,t){var n=e.__data__;return n1(t)?n[typeof t=="string"?"string":"hash"]:n.map}function r1(e){var t=ps(this,e).delete(e);return this.size-=t?1:0,t}function i1(e){return ps(this,e).get(e)}function o1(e){return ps(this,e).has(e)}function s1(e,t){var n=ps(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function br(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])}}br.prototype.clear=t1,br.prototype.delete=r1,br.prototype.get=i1,br.prototype.has=o1,br.prototype.set=s1;var a1=200;function l1(e,t){var n=this.__data__;if(n instanceof yr){var r=n.__data__;if(!so||r.length<a1-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new br(r)}return n.set(e,t),this.size=n.size,this}function nr(e){var t=this.__data__=new yr(e);this.size=t.size}nr.prototype.clear=gE,nr.prototype.delete=mE,nr.prototype.get=yE,nr.prototype.has=bE,nr.prototype.set=l1;var hs=function(){try{var e=Jr(Object,"defineProperty");return e({},"",{}),e}catch{}}();function yl(e,t,n){t=="__proto__"&&hs?hs(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function bl(e,t,n){(n!==void 0&&!io(e[t],n)||n===void 0&&!(t in e))&&yl(e,t,n)}function c1(e){return function(t,n,r){for(var o=-1,i=Object(t),s=r(t),a=s.length;a--;){var c=s[++o];if(n(i[c],c,i)===!1)break}return t}}var u1=c1(),Vp=typeof L=="object"&&L&&!L.nodeType&&L,zp=Vp&&typeof module=="object"&&module&&!module.nodeType&&module,f1=zp&&zp.exports===Vp,Wp=f1?er.Buffer:void 0,Hp=Wp?Wp.allocUnsafe:void 0;function Gp(e,t){if(t)return e.slice();var n=e.length,r=Hp?Hp(n):new e.constructor(n);return e.copy(r),r}var gs=er.Uint8Array;function vl(e){var t=new e.constructor(e.byteLength);return new gs(t).set(new gs(e)),t}function Kp(e,t){var n=t?vl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function d1(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Qp=Object.create,p1=function(){function e(){}return function(t){if(!tr(t))return{};if(Qp)return Qp(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Xp(e,t){return function(n){return e(t(n))}}var wl=Xp(Object.getPrototypeOf,Object),h1=Object.prototype;function Sl(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||h1;return e===n}function g1(e){return typeof e.constructor=="function"&&!Sl(e)?p1(wl(e)):{}}function rr(e){return e!=null&&typeof e=="object"}var m1="[object Arguments]";function Yp(e){return rr(e)&&Xr(e)==m1}var Jp=Object.prototype,y1=Jp.hasOwnProperty,b1=Jp.propertyIsEnumerable,ms=Yp(function(){return arguments}())?Yp:function(e){return rr(e)&&y1.call(e,"callee")&&!b1.call(e,"callee")},Hn=Array.isArray,v1=9007199254740991;function Zp(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=v1}function ys(e){return e!=null&&Zp(e.length)&&!gl(e)}function w1(e){return rr(e)&&ys(e)}function S1(){return!1}var eh=typeof L=="object"&&L&&!L.nodeType&&L,th=eh&&typeof module=="object"&&module&&!module.nodeType&&module,E1=th&&th.exports===eh,nh=E1?er.Buffer:void 0,T1=nh?nh.isBuffer:void 0,lo=T1||S1,A1="[object Object]",R1=Function.prototype,_1=Object.prototype,rh=R1.toString,I1=_1.hasOwnProperty,C1=rh.call(Object);function El(e){if(!rr(e)||Xr(e)!=A1)return!1;var t=wl(e);if(t===null)return!0;var n=I1.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&rh.call(n)==C1}var P1="[object Arguments]",F1="[object Array]",O1="[object Boolean]",k1="[object Date]",x1="[object Error]",N1="[object Function]",$1="[object Map]",D1="[object Number]",L1="[object Object]",M1="[object RegExp]",B1="[object Set]",j1="[object String]",U1="[object WeakMap]",q1="[object ArrayBuffer]",V1="[object DataView]",z1="[object Float32Array]",W1="[object Float64Array]",H1="[object Int8Array]",G1="[object Int16Array]",K1="[object Int32Array]",Q1="[object Uint8Array]",X1="[object Uint8ClampedArray]",Y1="[object Uint16Array]",J1="[object Uint32Array]",At={};At[z1]=At[W1]=At[H1]=At[G1]=At[K1]=At[Q1]=At[X1]=At[Y1]=At[J1]=!0,At[P1]=At[F1]=At[q1]=At[O1]=At[V1]=At[k1]=At[x1]=At[N1]=At[$1]=At[D1]=At[L1]=At[M1]=At[B1]=At[j1]=At[U1]=!1;function Z1(e){return rr(e)&&Zp(e.length)&&!!At[Xr(e)]}function Tl(e){return function(t){return e(t)}}var ih=typeof L=="object"&&L&&!L.nodeType&&L,co=ih&&typeof module=="object"&&module&&!module.nodeType&&module,eT=co&&co.exports===ih,Al=eT&&Bp.process,Ii=function(){try{var e=co&&co.require&&co.require("util").types;return e||Al&&Al.binding&&Al.binding("util")}catch{}}(),oh=Ii&&Ii.isTypedArray,Rl=oh?Tl(oh):Z1;function _l(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var tT=Object.prototype,nT=tT.hasOwnProperty;function sh(e,t,n){var r=e[t];(!(nT.call(e,t)&&io(r,n))||n===void 0&&!(t in e))&&yl(e,t,n)}function ah(e,t,n,r){var o=!n;n||(n={});for(var i=-1,s=t.length;++i<s;){var a=t[i],c=void 0;c===void 0&&(c=e[a]),o?yl(n,a,c):sh(n,a,c)}return n}function rT(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var iT=9007199254740991,oT=/^(?:0|[1-9]\d*)$/;function lh(e,t){var n=typeof e;return t=t??iT,!!t&&(n=="number"||n!="symbol"&&oT.test(e))&&e>-1&&e%1==0&&e<t}var sT=Object.prototype,aT=sT.hasOwnProperty;function ch(e,t){var n=Hn(e),r=!n&&ms(e),o=!n&&!r&&lo(e),i=!n&&!r&&!o&&Rl(e),s=n||r||o||i,a=s?rT(e.length,String):[],c=a.length;for(var u in e)(t||aT.call(e,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||lh(u,c)))&&a.push(u);return a}function lT(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var cT=Object.prototype,uT=cT.hasOwnProperty;function fT(e){if(!tr(e))return lT(e);var t=Sl(e),n=[];for(var r in e)r=="constructor"&&(t||!uT.call(e,r))||n.push(r);return n}function Il(e){return ys(e)?ch(e,!0):fT(e)}function dT(e){return ah(e,Il(e))}function pT(e,t,n,r,o,i,s){var a=_l(e,n),c=_l(t,n),u=s.get(c);if(u){bl(e,n,u);return}var l=i?i(a,c,n+"",e,t,s):void 0,d=l===void 0;if(d){var f=Hn(c),m=!f&&lo(c),w=!f&&!m&&Rl(c);l=c,f||m||w?Hn(a)?l=a:w1(a)?l=d1(a):m?(d=!1,l=Gp(c,!0)):w?(d=!1,l=Kp(c,!0)):l=[]:El(c)||ms(c)?(l=a,ms(a)?l=dT(a):(!tr(a)||gl(a))&&(l=g1(c))):d=!1}d&&(s.set(c,l),o(l,c,r,i,s),s.delete(c)),bl(e,n,l)}function uh(e,t,n,r,o){e!==t&&u1(t,function(i,s){if(o||(o=new nr),tr(i))pT(e,t,s,n,uh,r,o);else{var a=r?r(_l(e,s),i,s+"",e,t,o):void 0;a===void 0&&(a=i),bl(e,s,a)}},Il)}function fh(e){return e}function hT(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 dh=Math.max;function ph(e,t,n){return t=dh(t===void 0?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=dh(r.length-t,0),s=Array(i);++o<i;)s[o]=r[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=r[o];return a[t]=n(s),hT(e,this,a)}}function gT(e){return function(){return e}}var mT=hs?function(e,t){return hs(e,"toString",{configurable:!0,enumerable:!1,value:gT(t),writable:!0})}:fh,yT=800,bT=16,vT=Date.now;function wT(e){var t=0,n=0;return function(){var r=vT(),o=bT-(r-n);if(n=r,o>0){if(++t>=yT)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var hh=wT(mT);function ST(e,t){return hh(ph(e,t,fh),e+"")}function ET(e,t,n){if(!tr(n))return!1;var r=typeof t;return(r=="number"?ys(n)&&lh(t,n.length):r=="string"&&t in n)?io(n[t],e):!1}function TT(e){return ST(function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(o--,i):void 0,s&&ET(n[0],n[1],s)&&(i=o<3?void 0:i,o=1),t=Object(t);++r<o;){var a=n[r];a&&e(t,a,r,i)}return t})}var uo=TT(function(e,t,n){uh(e,t,n)});const Cl=(e,...t)=>{const{href:n}=e.resolve(p(e.currentRoute));return t.map(r=>{const{href:o}=e.resolve({...r});return o==="/"||o==="#/"?!1:n.startsWith(o)}).some(Boolean)},fo=(...e)=>(t,...n)=>{if(!n.length)return Cl(t,...e);const[r,...o]=n.map(i=>{const s=e.find(a=>a.name===i);if(!s)throw new Error(`unknown comparative '${i}'`);return s});return Cl(t,r,...o)};function gM(e){return e}const po=(e,...t)=>uo({},{name:e},...t.map(n=>({...n.params&&{params:n.params},...n.query&&{query:n.query}}))),Ci=(e,t={})=>po(e,t),gh=Ci("files-common-favorites"),mh=Ci("files-common-search"),Ct=fo(gh,mh),AT=e=>[{path:"/search",component:e.App,children:[{name:mh.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:gh.name,path:"",component:e.Favorites,meta:{authContext:"user",title:"Favorite files"}}]}],Nn=(e,t={})=>po(e,t),yh=Nn("files-spaces-projects"),Pl=Nn("files-spaces-generic"),ht=fo(yh,Pl),RT=e=>[{path:"/spaces",component:e.App,children:[{path:"projects",name:yh.name,component:e.Spaces.Projects,meta:{authContext:"user",title:"Spaces"}},{path:":driveAliasAndItem(.*)?",name:Pl.name,component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0,contextQueryItems:["sort-by","sort-dir"]}}]}],$n=(e,t={})=>po(e,t),_T=$n("files-shares"),bs=$n("files-shares-with-me"),Fl=$n("files-shares-with-others"),Ol=$n("files-shares-via-link"),jt=fo(bs,Fl,Ol),IT=e=>[{name:_T.name,path:"/shares",component:e.App,redirect:bs,children:[{name:bs.name,path:"with-me",component:e.Shares.SharedWithMe,meta:{authContext:"user",title:"Files shared with me"}},{name:Fl.name,path:"with-others",component:e.Shares.SharedWithOthers,meta:{authContext:"user",title:"Files shared with others"}},{name:Ol.name,path:"via-link",component:e.Shares.SharedViaLink,meta:{authContext:"user",title:"Files shared via link"}}]}],Pi=(e,t={})=>po(e,t),kl=Pi("files-public-link"),xl=Pi("files-public-upload"),Fn=fo(kl,xl),CT=e=>[{path:"/link",component:e.App,meta:{auth:!1},children:[{name:kl.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"publicLink",patchCleanPath:!0}}]},{path:"/upload",component:e.App,meta:{auth:!1},children:[{name:xl.name,path:":token?",component:e.FilesDrop,meta:{authContext:"publicLink",title:"Public file upload"}}]}],Fi=(e,t={})=>po(e,t),bh=Fi("files-trash-generic"),vh=Fi("files-trash-overview"),Tn=fo(bh,vh),PT=e=>[{path:"/trash",component:e.App,children:[{path:"overview",name:vh.name,component:e.Trash.Overview,meta:{authContext:"user",title:"Trash overview"}},{name:bh.name,path:":driveAliasAndItem(.*)?",component:e.Spaces.DriveResolver,meta:{authContext:"user",patchCleanPath:!0}}]}];function wh(e){return{applicationConfig:B(()=>e.appsStore.externalAppConfig[e.applicationId]||{})}}const FT=["anonymous","user","idp","publicLink","hybrid"],vr=e=>gr(e),He=()=>vr("$router"),Kt=()=>He().currentRoute,Nl=e=>e.path.split("/")[1],OT=()=>{const e=Kt();return B(()=>Nl(p(e)))},ir=(e,t={},n)=>{var o,i;const r=(n==null?void 0:n.configStore)||st();return{params:{driveAliasAndItem:e.getDriveAliasAndItem({path:t.path||""})},query:{...Z.isShareSpaceResource(e)&&{shareId:e.id},...((i=(o=r==null?void 0:r.options)==null?void 0:o.routing)==null?void 0:i.idBased)&&!It.isUndefined(t.fileId)&&{fileId:`${t.fileId}`}}}},kT=(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},or=Ue.defineStore("apps",()=>{const e=ce({}),t=ce({}),n=ce([]),r=B(()=>Object.keys(p(e))),o=(c,u)=>{c.id&&(c.extensions&&c.extensions.forEach(l=>{i({appId:c.id,data:l})}),p(e)[c.id]={applicationMenu:c.applicationMenu||{enabled:()=>!1},defaultExtension:c.defaultExtension||"",icon:"check_box_outline_blank",name:c.name||c.id,translations:u,...c})},i=({appId:c,data:u})=>{var l,d,f;p(n).push({app:c,extension:u.extension,createFileHandler:u.createFileHandler,label:u.label,mimeType:u.mimeType,routeName:u.routeName,newFileMenu:u.newFileMenu,icon:u.icon,name:u.name,hasPriority:u.hasPriority||((f=(d=(l=p(t))==null?void 0:l[c])==null?void 0:d.priorityExtensions)==null?void 0:f.includes(u.extension))||!1,secureView:u.secureView||!1})};return{apps:e,externalAppConfig:t,appIds:r,fileExtensions:n,registerApp:o,registerFileExtension:i,loadExternalAppConfig:({appId:c,config:u})=>{t.value={...p(t),[c]:u}},isAppEnabled:c=>p(r).includes(c)}}),ei=Ue.defineStore("auth",()=>{const e=ce(),t=ce(!1),n=ce(!1),r=ce(),o=ce(),i=ce(),s=ce(!1),a=m=>{e.value=m},c=m=>{t.value=m},u=m=>{n.value=m},l=m=>{r.value=m.publicLinkToken,o.value=m.publicLinkPassword,i.value=m.publicLinkType,s.value=m.publicLinkContextReady};return{accessToken:e,idpContextReady:t,userContextReady:n,publicLinkToken:r,publicLinkPassword:o,publicLinkType:i,publicLinkContextReady:s,setAccessToken:a,setIdpContextReady:c,setUserContextReady:u,setPublicLinkContext:l,clearUserContext:()=>{a(null),c(null),u(null)},clearPublicLinkContext:()=>{l({publicLinkToken:null,publicLinkPassword:null,publicLinkType:null,publicLinkContextReady:!1})}}}),Sh={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: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:[]}},notifications:{"ocs-endpoints":[]},password_policy:{},search:{property:{mediatype:{},mtime:{}}},spaces:{enabled:!1,max_quota:0,projects:!1}},sn=Ue.defineStore("capabilities",()=>{const e=ce(!1),t=ce(Sh),n=F=>{t.value=uo({...Sh},F.capabilities),e.value=!0},r=B(()=>p(t).core["support-url-signing"]),o=B(()=>p(t).core["support-sse"]),i=B(()=>p(t).graph["personal-data-export"]),s=B(()=>p(t).core.status),a=B(()=>p(t).dav.reports),c=B(()=>p(t).dav.trashbin),u=B(()=>p(t).spaces.max_quota),l=B(()=>p(t).spaces.projects),d=B(()=>p(t).graph.users.create_disabled),f=B(()=>p(t).graph.users.delete_disabled),m=B(()=>p(t).graph.users.change_password_self_disabled),w=B(()=>p(t).graph.users.read_only_attributes),y=B(()=>p(t).files.app_providers),E=B(()=>p(t).files.favorites),b=B(()=>p(t).files.thumbnail),g=B(()=>p(t).files.archivers),v=B(()=>p(t).files.privateLinks),h=B(()=>p(t).files.permanent_deletion),S=B(()=>p(t).files.tags),T=B(()=>p(t).files.undelete),R=B(()=>p(t).files_sharing.api_enabled),_=B(()=>p(t).files_sharing.deny_access),A=B(()=>p(t).files_sharing.can_rename),$=B(()=>p(t).files_sharing.allow_custom),D=B(()=>{var F;return(F=p(t).files_sharing.public)==null?void 0:F.enabled}),N=B(()=>{var F;return(F=p(t).files_sharing.public)==null?void 0:F.can_edit}),x=B(()=>{var F;return(F=p(t).files_sharing.public)==null?void 0:F.can_contribute}),W=B(()=>{var F;return(F=p(t).files_sharing.public)==null?void 0:F.alias}),K=B(()=>{var F;return(F=p(t).files_sharing.public)==null?void 0:F.default_permissions}),le=B(()=>{var F;return(F=p(t).files_sharing.public)==null?void 0:F.password.enforced_for}),be=B(()=>p(t).files_sharing.search_min_length),te=B(()=>{var F;return(F=p(t).files_sharing.user)==null?void 0:F.profile_picture}),ae=B(()=>{var F;return(F=p(t).files.tus_support)==null?void 0:F.max_chunk_size}),ue=B(()=>{var F;return(F=p(t).files.tus_support)==null?void 0:F.extension}),ie=B(()=>{var F;return(F=p(t).files.tus_support)==null?void 0:F.http_method_override}),G=B(()=>p(t).notifications["ocs-endpoints"]),re=B(()=>p(t).password_policy),se=B(()=>{var F;return(F=p(t).search.property)==null?void 0:F.mtime}),Ie=B(()=>{var F;return(F=p(t).search.property)==null?void 0:F.mediatype}),ee=B(()=>{var F;return(F=p(t).search.property)==null?void 0:F.content});return{isInitialized:e,capabilities:t,setCapabilities:n,status:s,supportUrlSigning:r,supportSSE:o,personalDataExport:i,davReports:a,davTrashbin:c,spacesMaxQuota:u,spacesProjects:l,graphUsersCreateDisabled:d,graphUsersDeleteDisabled:f,graphUsersChangeSelfPasswordDisabled:m,graphUsersReadOnlyAttributes:w,filesAppProviders:y,filesFavorites:E,filesThumbnail:b,filesArchivers:g,filesPrivateLinks:v,filesPermanentDeletion:h,filesTags:S,filesUndelete:T,sharingApiEnabled:R,sharingDenyAccess:_,sharingCanRename:A,sharingAllowCustom:$,sharingPublicEnabled:D,sharingPublicCanEdit:N,sharingPublicCanContribute:x,sharingPublicAlias:W,sharingPublicDefaultPermissions:K,sharingPublicPasswordEnforcedFor:le,sharingSearchMinLength:be,sharingUserProfilePicture:te,tusMaxChunkSize:ae,tusExtension:ue,tusHttpMethodOverride:ie,notificationsOcsEndpoints:G,passwordPolicy:re,searchLastMofifiedDate:se,searchMediaType:Ie,searchContent:ee}});class xT{constructor(t,n){Ee(this,"value");Ee(this,"expires");this.value=t,this.expires=n?new Date().getTime()+n:0}get expired(){return this.expires>0&&this.expires<new Date().getTime()}}class $l{constructor(t){Ee(this,"map");Ee(this,"ttl");Ee(this,"capacity");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 xT(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 vs=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:i}=o;return e.driveItems.getDriveItem(i.split("!")[0],i)},NT=({sharedAncestor:e,matchingSpace:t})=>t?Nn("files-spaces-generic",ir(t,{path:e.path,fileId:e.id})):{},Eh=({sharesStore:e,spacesStore:t,space:n,sharedDriveItem:r})=>{var s;const o=((s=r==null?void 0:r.remoteItem)==null?void 0:s.permissions)||[];if(!o.length)return;const i=[];o.forEach(a=>{if(a["@libre.graph.permissions.actions"]){i.push(...a["@libre.graph.permissions.actions"]);return}const c=e.graphRoles[a.roles[0]];if(!c)return;const u=c.rolePermissions.flatMap(l=>l.allowedResourceActions);i.push(...u)}),t.updateSpaceField({id:n.id,field:"graphPermissions",value:[...new Set(i)]})},$T=e=>{var n;const t=(n=document.querySelectorAll(`[data-item-id="${e}"] input[type=checkbox]`))==null?void 0:n[0];t&&t.focus()};class ti{}Ee(ti,"sortByQueryName","sort-by"),Ee(ti,"sortDirQueryName","sort-dir");var DT="[object Symbol]";function ws(e){return typeof e=="symbol"||rr(e)&&Xr(e)==DT}var LT=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,MT=/^\w*$/;function BT(e,t){if(Hn(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||ws(e)?!0:MT.test(e)||!LT.test(e)||t!=null&&e in Object(t)}var jT="Expected a function";function Dl(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(jT);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=e.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(Dl.Cache||br),n}Dl.Cache=br;var UT=500;function qT(e){var t=Dl(e,function(r){return n.size===UT&&n.clear(),r}),n=t.cache;return t}var VT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,zT=/\\(\\)?/g,WT=qT(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(VT,function(n,r,o,i){t.push(o?i.replace(zT,"$1"):r||n)}),t});function Th(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 Ah=xn?xn.prototype:void 0,Rh=Ah?Ah.toString:void 0;function _h(e){if(typeof e=="string")return e;if(Hn(e))return Th(e,_h)+"";if(ws(e))return Rh?Rh.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ll(e){return e==null?"":_h(e)}function Ml(e,t){return Hn(e)?e:BT(e,t)?[e]:WT(Ll(e))}function Ih(e){if(typeof e=="string"||ws(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ch(e,t){t=Ml(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Ih(t[n++])];return n&&n==r?e:void 0}function Bl(e,t,n){var r=e==null?void 0:Ch(e,t);return r===void 0?n:r}var zt=(e=>(e.Desc="desc",e.Asc="asc",e))(zt||{});function HT(e){const t=He(),n=GT(e),r=KT(e),o=B(()=>{var u;return Fh(p(n))||p((u=jl(p(s)))==null?void 0:u.name)}),i=B(()=>XT(p(r))||QT(p(o),p(s))),s=e.fields;return{items:B(()=>{const u=p(e.items);return p(o)?Ph(u,p(s),p(o),p(i)):u}),sortBy:o,sortDir:i,handleSort:({sortBy:u,sortDir:l})=>t.replace({query:{...p(t.currentRoute).query,[p(e.sortByQueryName)||ti.sortByQueryName]:u,[p(e.sortDirQueryName)||ti.sortDirQueryName]:l}})}}function GT(e){var t;return e.sortBy?Vt(e.sortBy)?e.sortBy:ce(e.sortBy):Ar({name:p(e.sortByQueryName)||ti.sortByQueryName,defaultValue:p((t=jl(p(e.fields)))==null?void 0:t.name),storagePrefix:p(e.routeName)||p(Zs())})}function KT(e){var t;return e.sortDir?Vt(e.sortDir)?e.sortDir:ce(e.sortDir):Ar({name:p(e.sortDirQueryName)||ti.sortDirQueryName,defaultValue:p((t=jl(p(e.fields)))==null?void 0:t.sortDir),storagePrefix:p(e.routeName)||p(Zs())})}const jl=e=>{const t=e.filter(n=>n.sortable);return t?t[0]:null},QT=(e,t)=>{const n=t.find(r=>r.name===e);return n&&n.sortDir?p(n.sortDir):"desc"},Ph=(e,t,n,r)=>{const o=t.find(a=>a.name===n);if(!o)return e;const{sortable:i}=o,s=new Intl.Collator(navigator.language,{sensitivity:"base",numeric:!0});if(n==="name"){const a=[...e.filter(u=>u.type==="folder")].sort((u,l)=>Ul(u,l,s,n,r,i)),c=[...e.filter(u=>u.type!=="folder")].sort((u,l)=>Ul(u,l,s,n,r,i));return r==="asc"?a.concat(c):c.concat(a)}return[...e].sort((a,c)=>Ul(a,c,s,o.prop||o.name,r,i))},Ul=(e,t,n,r,o,i)=>{let s=Bl(e,r),a=Bl(t,r);const c=o==="asc"?1:-1;if(i)if(typeof i=="string"){const l=d=>d.map(f=>f[i]).join("");s=l(s),a=l(a)}else typeof i=="function"&&(s=i(s),a=i(a));return!isNaN(s)&&!isNaN(a)?(s-a)*c:n.compare((s||"").toString(),(a||"").toString())*c},Fh=e=>Array.isArray(e)?e[0]:e,XT=e=>{switch(Fh(e)){case"asc":return"asc";case"desc":return"desc"}return null},Oh=e=>e?[{name:"name",sortable:!0,sortDir:zt.Asc},{name:"size",sortable:!0,sortDir:zt.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:zt.Asc},{name:"owner",sortable:"displayName",sortDir:zt.Asc},{name:"mdate",sortable:t=>new Date(t).valueOf(),sortDir:zt.Desc},{name:"sdate",sortable:t=>new Date(t).valueOf(),sortDir:zt.Desc},{name:"ddate",sortable:t=>new Date(t).valueOf(),sortDir:zt.Desc}].filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[];function mM(e){return e}const kh=[{label:"A-Z",name:"name",sortable:!0,sortDir:zt.Asc},{label:"Z-A",name:"name",sortable:!0,sortDir:zt.Desc},{label:"Newest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:zt.Desc},{label:"Oldest",name:"mdate",sortable:e=>new Date(e).valueOf(),sortDir:zt.Asc},{label:"Largest",name:"size",sortable:!0,sortDir:zt.Desc},{label:"Smallest",name:"size",sortable:!0,sortDir:zt.Asc},{label:"Remaining quota",name:"remainingQuota",prop:"spaceQuota.remaining",sortable:!0,sortDir:zt.Desc},{label:"Total quota",name:"totalQuota",prop:"spaceQuota.total",sortable:!0,sortDir:zt.Desc},{label:"Used quota",name:"usedQuota",prop:"spaceQuota.used",sortable:!0,sortDir:zt.Desc}],YT=e=>e?kh.filter(t=>Object.prototype.hasOwnProperty.call(e,t.name)):[],JT=(e,{$gettext:t})=>e.map(n=>({...n,label:t(n.label)})),ZT=me.z.object({icon:me.z.string(),name:me.z.string(),secure_view:me.z.boolean().optional().default(!1),target_ext:me.z.string().optional()}),eA=me.z.object({allow_creation:me.z.boolean().optional(),app_providers:me.z.array(ZT),default_application:me.z.string().optional(),description:me.z.string().optional(),ext:me.z.string().optional(),mime_type:me.z.string(),name:me.z.string().optional()}),xh=me.z.object({"mime-types":me.z.array(eA)});class tA{constructor(t,n){Ee(this,"_mimeTypes",ce([]));Ee(this,"serverUrl");Ee(this,"clientService");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:xh});this._mimeTypes.value=n}set mimeTypes(t){this._mimeTypes.value=t}get mimeTypes(){return p(this._mimeTypes)}get templateMimeTypes(){return p(this._mimeTypes).filter(t=>!!t.app_providers.some(n=>!!n.target_ext))}get appNames(){return[...new Set(p(this._mimeTypes).flatMap(t=>t.app_providers.map(n=>n.name)))]}getMimeTypesByAppName(t){return p(this._mimeTypes).filter(n=>n.app_providers.some(r=>r.name===t))}}var Nh={},Ss={};Ss.byteLength=iA,Ss.toByteArray=sA,Ss.fromByteArray=cA;for(var sr=[],Dn=[],nA=typeof Uint8Array<"u"?Uint8Array:Array,ql="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Oi=0,rA=ql.length;Oi<rA;++Oi)sr[Oi]=ql[Oi],Dn[ql.charCodeAt(Oi)]=Oi;Dn[45]=62,Dn[95]=63;function $h(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 iA(e){var t=$h(e),n=t[0],r=t[1];return(n+r)*3/4-r}function oA(e,t,n){return(t+n)*3/4-n}function sA(e){var t,n=$h(e),r=n[0],o=n[1],i=new nA(oA(e,r,o)),s=0,a=o>0?r-4:r,c;for(c=0;c<a;c+=4)t=Dn[e.charCodeAt(c)]<<18|Dn[e.charCodeAt(c+1)]<<12|Dn[e.charCodeAt(c+2)]<<6|Dn[e.charCodeAt(c+3)],i[s++]=t>>16&255,i[s++]=t>>8&255,i[s++]=t&255;return o===2&&(t=Dn[e.charCodeAt(c)]<<2|Dn[e.charCodeAt(c+1)]>>4,i[s++]=t&255),o===1&&(t=Dn[e.charCodeAt(c)]<<10|Dn[e.charCodeAt(c+1)]<<4|Dn[e.charCodeAt(c+2)]>>2,i[s++]=t>>8&255,i[s++]=t&255),i}function aA(e){return sr[e>>18&63]+sr[e>>12&63]+sr[e>>6&63]+sr[e&63]}function lA(e,t,n){for(var r,o=[],i=t;i<n;i+=3)r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),o.push(aA(r));return o.join("")}function cA(e){for(var t,n=e.length,r=n%3,o=[],i=16383,s=0,a=n-r;s<a;s+=i)o.push(lA(e,s,s+i>a?a:s+i));return r===1?(t=e[n-1],o.push(sr[t>>2]+sr[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(sr[t>>10]+sr[t>>4&63]+sr[t<<2&63]+"=")),o.join("")}var Vl={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Vl.read=function(e,t,n,r,o){var i,s,a=o*8-r-1,c=(1<<a)-1,u=c>>1,l=-7,d=n?o-1:0,f=n?-1:1,m=e[t+d];for(d+=f,i=m&(1<<-l)-1,m>>=-l,l+=a;l>0;i=i*256+e[t+d],d+=f,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=r;l>0;s=s*256+e[t+d],d+=f,l-=8);if(i===0)i=1-u;else{if(i===c)return s?NaN:(m?-1:1)*(1/0);s=s+Math.pow(2,r),i=i-u}return(m?-1:1)*s*Math.pow(2,i-r)},Vl.write=function(e,t,n,r,o,i){var s,a,c,u=i*8-o-1,l=(1<<u)-1,d=l>>1,f=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:i-1,w=r?1:-1,y=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=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+d>=1?t+=f/c:t+=f*Math.pow(2,1-d),t*c>=2&&(s++,c/=2),s+d>=l?(a=0,s=l):s+d>=1?(a=(t*c-1)*Math.pow(2,o),s=s+d):(a=t*Math.pow(2,d-1)*Math.pow(2,o),s=0));o>=8;e[n+m]=a&255,m+=w,a/=256,o-=8);for(s=s<<o|a,u+=o;u>0;e[n+m]=s&255,m+=w,s/=256,u-=8);e[n+m-w]|=y*128};/*!
7
7
  * The buffer module from node.js, for the browser.
8
8
  *
9
9
  * @author Feross Aboukhadijeh <https://feross.org>
10
10
  * @license MIT
11
- */(function(e){const t=Es,n=$l,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=l,e.SlowBuffer=S,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o;const{Uint8Array:i,ArrayBuffer:s,SharedArrayBuffer:a}=globalThis;l.TYPED_ARRAY_SUPPORT=c(),!l.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 c(){try{const B=new i(1),C={foo:function(){return 42}};return Object.setPrototypeOf(C,i.prototype),Object.setPrototypeOf(B,C),B.foo()===42}catch{return!1}}Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}});function u(B){if(B>o)throw new RangeError('The value "'+B+'" is invalid for option "size"');const C=new i(B);return Object.setPrototypeOf(C,l.prototype),C}function l(B,C,O){if(typeof B=="number"){if(typeof C=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return w(B)}return f(B,C,O)}l.poolSize=8192;function f(B,C,O){if(typeof B=="string")return v(B,C);if(s.isView(B))return y(B);if(B==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof B);if(Rt(B,s)||B&&Rt(B.buffer,s)||typeof a<"u"&&(Rt(B,a)||B&&Rt(B.buffer,a)))return g(B,C,O);if(typeof B=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const K=B.valueOf&&B.valueOf();if(K!=null&&K!==B)return l.from(K,C,O);const ne=h(B);if(ne)return ne;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof B[Symbol.toPrimitive]=="function")return l.from(B[Symbol.toPrimitive]("string"),C,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof B)}l.from=function(B,C,O){return f(B,C,O)},Object.setPrototypeOf(l.prototype,i.prototype),Object.setPrototypeOf(l,i);function d(B){if(typeof B!="number")throw new TypeError('"size" argument must be of type number');if(B<0)throw new RangeError('The value "'+B+'" is invalid for option "size"')}function m(B,C,O){return d(B),B<=0?u(B):C!==void 0?typeof O=="string"?u(B).fill(C,O):u(B).fill(C):u(B)}l.alloc=function(B,C,O){return m(B,C,O)};function w(B){return d(B),u(B<0?0:b(B)|0)}l.allocUnsafe=function(B){return w(B)},l.allocUnsafeSlow=function(B){return w(B)};function v(B,C){if((typeof C!="string"||C==="")&&(C="utf8"),!l.isEncoding(C))throw new TypeError("Unknown encoding: "+C);const O=E(B,C)|0;let K=u(O);const ne=K.write(B,C);return ne!==O&&(K=K.slice(0,ne)),K}function T(B){const C=B.length<0?0:b(B.length)|0,O=u(C);for(let K=0;K<C;K+=1)O[K]=B[K]&255;return O}function y(B){if(Rt(B,i)){const C=new i(B);return g(C.buffer,C.byteOffset,C.byteLength)}return T(B)}function g(B,C,O){if(C<0||B.byteLength<C)throw new RangeError('"offset" is outside of buffer bounds');if(B.byteLength<C+(O||0))throw new RangeError('"length" is outside of buffer bounds');let K;return C===void 0&&O===void 0?K=new i(B):O===void 0?K=new i(B,C):K=new i(B,C,O),Object.setPrototypeOf(K,l.prototype),K}function h(B){if(l.isBuffer(B)){const C=b(B.length)|0,O=u(C);return O.length===0||B.copy(O,0,0,C),O}if(B.length!==void 0)return typeof B.length!="number"||Nt(B.length)?u(0):T(B);if(B.type==="Buffer"&&Array.isArray(B.data))return T(B.data)}function b(B){if(B>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return B|0}function S(B){return+B!=B&&(B=0),l.alloc(+B)}l.isBuffer=function(C){return C!=null&&C._isBuffer===!0&&C!==l.prototype},l.compare=function(C,O){if(Rt(C,i)&&(C=l.from(C,C.offset,C.byteLength)),Rt(O,i)&&(O=l.from(O,O.offset,O.byteLength)),!l.isBuffer(C)||!l.isBuffer(O))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(C===O)return 0;let K=C.length,ne=O.length;for(let he=0,Te=Math.min(K,ne);he<Te;++he)if(C[he]!==O[he]){K=C[he],ne=O[he];break}return K<ne?-1:ne<K?1:0},l.isEncoding=function(C){switch(String(C).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}},l.concat=function(C,O){if(!Array.isArray(C))throw new TypeError('"list" argument must be an Array of Buffers');if(C.length===0)return l.alloc(0);let K;if(O===void 0)for(O=0,K=0;K<C.length;++K)O+=C[K].length;const ne=l.allocUnsafe(O);let he=0;for(K=0;K<C.length;++K){let Te=C[K];if(Rt(Te,i))he+Te.length>ne.length?(l.isBuffer(Te)||(Te=l.from(Te)),Te.copy(ne,he)):i.prototype.set.call(ne,Te,he);else if(l.isBuffer(Te))Te.copy(ne,he);else throw new TypeError('"list" argument must be an Array of Buffers');he+=Te.length}return ne};function E(B,C){if(l.isBuffer(B))return B.length;if(s.isView(B)||Rt(B,s))return B.byteLength;if(typeof B!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof B);const O=B.length,K=arguments.length>2&&arguments[2]===!0;if(!K&&O===0)return 0;let ne=!1;for(;;)switch(C){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return xe(B).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return Ze(B).length;default:if(ne)return K?-1:xe(B).length;C=(""+C).toLowerCase(),ne=!0}}l.byteLength=E;function I(B,C,O){let K=!1;if((C===void 0||C<0)&&(C=0),C>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0,C>>>=0,O<=C))return"";for(B||(B="utf8");;)switch(B){case"hex":return Z(this,C,O);case"utf8":case"utf-8":return se(this,C,O);case"ascii":return fe(this,C,O);case"latin1":case"binary":return ue(this,C,O);case"base64":return ee(this,C,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return oe(this,C,O);default:if(K)throw new TypeError("Unknown encoding: "+B);B=(B+"").toLowerCase(),K=!0}}l.prototype._isBuffer=!0;function R(B,C,O){const K=B[C];B[C]=B[O],B[O]=K}l.prototype.swap16=function(){const C=this.length;if(C%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let O=0;O<C;O+=2)R(this,O,O+1);return this},l.prototype.swap32=function(){const C=this.length;if(C%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let O=0;O<C;O+=4)R(this,O,O+3),R(this,O+1,O+2);return this},l.prototype.swap64=function(){const C=this.length;if(C%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let O=0;O<C;O+=8)R(this,O,O+7),R(this,O+1,O+6),R(this,O+2,O+5),R(this,O+3,O+4);return this},l.prototype.toString=function(){const C=this.length;return C===0?"":arguments.length===0?se(this,0,C):I.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(C){if(!l.isBuffer(C))throw new TypeError("Argument must be a Buffer");return this===C?!0:l.compare(this,C)===0},l.prototype.inspect=function(){let C="";const O=e.INSPECT_MAX_BYTES;return C=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O&&(C+=" ... "),"<Buffer "+C+">"},r&&(l.prototype[r]=l.prototype.inspect),l.prototype.compare=function(C,O,K,ne,he){if(Rt(C,i)&&(C=l.from(C,C.offset,C.byteLength)),!l.isBuffer(C))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof C);if(O===void 0&&(O=0),K===void 0&&(K=C?C.length:0),ne===void 0&&(ne=0),he===void 0&&(he=this.length),O<0||K>C.length||ne<0||he>this.length)throw new RangeError("out of range index");if(ne>=he&&O>=K)return 0;if(ne>=he)return-1;if(O>=K)return 1;if(O>>>=0,K>>>=0,ne>>>=0,he>>>=0,this===C)return 0;let Te=he-ne,Ye=K-O;const ut=Math.min(Te,Ye),ft=this.slice(ne,he),gt=C.slice(O,K);for(let ot=0;ot<ut;++ot)if(ft[ot]!==gt[ot]){Te=ft[ot],Ye=gt[ot];break}return Te<Ye?-1:Ye<Te?1:0};function A(B,C,O,K,ne){if(B.length===0)return-1;if(typeof O=="string"?(K=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,Nt(O)&&(O=ne?0:B.length-1),O<0&&(O=B.length+O),O>=B.length){if(ne)return-1;O=B.length-1}else if(O<0)if(ne)O=0;else return-1;if(typeof C=="string"&&(C=l.from(C,K)),l.isBuffer(C))return C.length===0?-1:N(B,C,O,K,ne);if(typeof C=="number")return C=C&255,typeof i.prototype.indexOf=="function"?ne?i.prototype.indexOf.call(B,C,O):i.prototype.lastIndexOf.call(B,C,O):N(B,[C],O,K,ne);throw new TypeError("val must be string, number or Buffer")}function N(B,C,O,K,ne){let he=1,Te=B.length,Ye=C.length;if(K!==void 0&&(K=String(K).toLowerCase(),K==="ucs2"||K==="ucs-2"||K==="utf16le"||K==="utf-16le")){if(B.length<2||C.length<2)return-1;he=2,Te/=2,Ye/=2,O/=2}function ut(gt,ot){return he===1?gt[ot]:gt.readUInt16BE(ot*he)}let ft;if(ne){let gt=-1;for(ft=O;ft<Te;ft++)if(ut(B,ft)===ut(C,gt===-1?0:ft-gt)){if(gt===-1&&(gt=ft),ft-gt+1===Ye)return gt*he}else gt!==-1&&(ft-=ft-gt),gt=-1}else for(O+Ye>Te&&(O=Te-Ye),ft=O;ft>=0;ft--){let gt=!0;for(let ot=0;ot<Ye;ot++)if(ut(B,ft+ot)!==ut(C,ot)){gt=!1;break}if(gt)return ft}return-1}l.prototype.includes=function(C,O,K){return this.indexOf(C,O,K)!==-1},l.prototype.indexOf=function(C,O,K){return A(this,C,O,K,!0)},l.prototype.lastIndexOf=function(C,O,K){return A(this,C,O,K,!1)};function L(B,C,O,K){O=Number(O)||0;const ne=B.length-O;K?(K=Number(K),K>ne&&(K=ne)):K=ne;const he=C.length;K>he/2&&(K=he/2);let Te;for(Te=0;Te<K;++Te){const Ye=parseInt(C.substr(Te*2,2),16);if(Nt(Ye))return Te;B[O+Te]=Ye}return Te}function x(B,C,O,K){return kt(xe(C,B.length-O),B,O,K)}function $(B,C,O,K){return kt(Me(C),B,O,K)}function V(B,C,O,K){return kt(Ze(C),B,O,K)}function X(B,C,O,K){return kt(Ve(C,B.length-O),B,O,K)}l.prototype.write=function(C,O,K,ne){if(O===void 0)ne="utf8",K=this.length,O=0;else if(K===void 0&&typeof O=="string")ne=O,K=this.length,O=0;else if(isFinite(O))O=O>>>0,isFinite(K)?(K=K>>>0,ne===void 0&&(ne="utf8")):(ne=K,K=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const he=this.length-O;if((K===void 0||K>he)&&(K=he),C.length>0&&(K<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");ne||(ne="utf8");let Te=!1;for(;;)switch(ne){case"hex":return L(this,C,O,K);case"utf8":case"utf-8":return x(this,C,O,K);case"ascii":case"latin1":case"binary":return $(this,C,O,K);case"base64":return V(this,C,O,K);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X(this,C,O,K);default:if(Te)throw new TypeError("Unknown encoding: "+ne);ne=(""+ne).toLowerCase(),Te=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ee(B,C,O){return C===0&&O===B.length?t.fromByteArray(B):t.fromByteArray(B.slice(C,O))}function se(B,C,O){O=Math.min(B.length,O);const K=[];let ne=C;for(;ne<O;){const he=B[ne];let Te=null,Ye=he>239?4:he>223?3:he>191?2:1;if(ne+Ye<=O){let ut,ft,gt,ot;switch(Ye){case 1:he<128&&(Te=he);break;case 2:ut=B[ne+1],(ut&192)===128&&(ot=(he&31)<<6|ut&63,ot>127&&(Te=ot));break;case 3:ut=B[ne+1],ft=B[ne+2],(ut&192)===128&&(ft&192)===128&&(ot=(he&15)<<12|(ut&63)<<6|ft&63,ot>2047&&(ot<55296||ot>57343)&&(Te=ot));break;case 4:ut=B[ne+1],ft=B[ne+2],gt=B[ne+3],(ut&192)===128&&(ft&192)===128&&(gt&192)===128&&(ot=(he&15)<<18|(ut&63)<<12|(ft&63)<<6|gt&63,ot>65535&&ot<1114112&&(Te=ot))}}Te===null?(Te=65533,Ye=1):Te>65535&&(Te-=65536,K.push(Te>>>10&1023|55296),Te=56320|Te&1023),K.push(Te),ne+=Ye}return re(K)}const ie=4096;function re(B){const C=B.length;if(C<=ie)return String.fromCharCode.apply(String,B);let O="",K=0;for(;K<C;)O+=String.fromCharCode.apply(String,B.slice(K,K+=ie));return O}function fe(B,C,O){let K="";O=Math.min(B.length,O);for(let ne=C;ne<O;++ne)K+=String.fromCharCode(B[ne]&127);return K}function ue(B,C,O){let K="";O=Math.min(B.length,O);for(let ne=C;ne<O;++ne)K+=String.fromCharCode(B[ne]);return K}function Z(B,C,O){const K=B.length;(!C||C<0)&&(C=0),(!O||O<0||O>K)&&(O=K);let ne="";for(let he=C;he<O;++he)ne+=Be[B[he]];return ne}function oe(B,C,O){const K=B.slice(C,O);let ne="";for(let he=0;he<K.length-1;he+=2)ne+=String.fromCharCode(K[he]+K[he+1]*256);return ne}l.prototype.slice=function(C,O){const K=this.length;C=~~C,O=O===void 0?K:~~O,C<0?(C+=K,C<0&&(C=0)):C>K&&(C=K),O<0?(O+=K,O<0&&(O=0)):O>K&&(O=K),O<C&&(O=C);const ne=this.subarray(C,O);return Object.setPrototypeOf(ne,l.prototype),ne};function ce(B,C,O){if(B%1!==0||B<0)throw new RangeError("offset is not uint");if(B+C>O)throw new RangeError("Trying to access beyond buffer length")}l.prototype.readUintLE=l.prototype.readUIntLE=function(C,O,K){C=C>>>0,O=O>>>0,K||ce(C,O,this.length);let ne=this[C],he=1,Te=0;for(;++Te<O&&(he*=256);)ne+=this[C+Te]*he;return ne},l.prototype.readUintBE=l.prototype.readUIntBE=function(C,O,K){C=C>>>0,O=O>>>0,K||ce(C,O,this.length);let ne=this[C+--O],he=1;for(;O>0&&(he*=256);)ne+=this[C+--O]*he;return ne},l.prototype.readUint8=l.prototype.readUInt8=function(C,O){return C=C>>>0,O||ce(C,1,this.length),this[C]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(C,O){return C=C>>>0,O||ce(C,2,this.length),this[C]|this[C+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(C,O){return C=C>>>0,O||ce(C,2,this.length),this[C]<<8|this[C+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(C,O){return C=C>>>0,O||ce(C,4,this.length),(this[C]|this[C+1]<<8|this[C+2]<<16)+this[C+3]*16777216},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(C,O){return C=C>>>0,O||ce(C,4,this.length),this[C]*16777216+(this[C+1]<<16|this[C+2]<<8|this[C+3])},l.prototype.readBigUInt64LE=ze(function(C){C=C>>>0,ke(C,"offset");const O=this[C],K=this[C+7];(O===void 0||K===void 0)&&_e(C,this.length-8);const ne=O+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24,he=this[++C]+this[++C]*2**8+this[++C]*2**16+K*2**24;return BigInt(ne)+(BigInt(he)<<BigInt(32))}),l.prototype.readBigUInt64BE=ze(function(C){C=C>>>0,ke(C,"offset");const O=this[C],K=this[C+7];(O===void 0||K===void 0)&&_e(C,this.length-8);const ne=O*2**24+this[++C]*2**16+this[++C]*2**8+this[++C],he=this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+K;return(BigInt(ne)<<BigInt(32))+BigInt(he)}),l.prototype.readIntLE=function(C,O,K){C=C>>>0,O=O>>>0,K||ce(C,O,this.length);let ne=this[C],he=1,Te=0;for(;++Te<O&&(he*=256);)ne+=this[C+Te]*he;return he*=128,ne>=he&&(ne-=Math.pow(2,8*O)),ne},l.prototype.readIntBE=function(C,O,K){C=C>>>0,O=O>>>0,K||ce(C,O,this.length);let ne=O,he=1,Te=this[C+--ne];for(;ne>0&&(he*=256);)Te+=this[C+--ne]*he;return he*=128,Te>=he&&(Te-=Math.pow(2,8*O)),Te},l.prototype.readInt8=function(C,O){return C=C>>>0,O||ce(C,1,this.length),this[C]&128?(255-this[C]+1)*-1:this[C]},l.prototype.readInt16LE=function(C,O){C=C>>>0,O||ce(C,2,this.length);const K=this[C]|this[C+1]<<8;return K&32768?K|4294901760:K},l.prototype.readInt16BE=function(C,O){C=C>>>0,O||ce(C,2,this.length);const K=this[C+1]|this[C]<<8;return K&32768?K|4294901760:K},l.prototype.readInt32LE=function(C,O){return C=C>>>0,O||ce(C,4,this.length),this[C]|this[C+1]<<8|this[C+2]<<16|this[C+3]<<24},l.prototype.readInt32BE=function(C,O){return C=C>>>0,O||ce(C,4,this.length),this[C]<<24|this[C+1]<<16|this[C+2]<<8|this[C+3]},l.prototype.readBigInt64LE=ze(function(C){C=C>>>0,ke(C,"offset");const O=this[C],K=this[C+7];(O===void 0||K===void 0)&&_e(C,this.length-8);const ne=this[C+4]+this[C+5]*2**8+this[C+6]*2**16+(K<<24);return(BigInt(ne)<<BigInt(32))+BigInt(O+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24)}),l.prototype.readBigInt64BE=ze(function(C){C=C>>>0,ke(C,"offset");const O=this[C],K=this[C+7];(O===void 0||K===void 0)&&_e(C,this.length-8);const ne=(O<<24)+this[++C]*2**16+this[++C]*2**8+this[++C];return(BigInt(ne)<<BigInt(32))+BigInt(this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+K)}),l.prototype.readFloatLE=function(C,O){return C=C>>>0,O||ce(C,4,this.length),n.read(this,C,!0,23,4)},l.prototype.readFloatBE=function(C,O){return C=C>>>0,O||ce(C,4,this.length),n.read(this,C,!1,23,4)},l.prototype.readDoubleLE=function(C,O){return C=C>>>0,O||ce(C,8,this.length),n.read(this,C,!0,52,8)},l.prototype.readDoubleBE=function(C,O){return C=C>>>0,O||ce(C,8,this.length),n.read(this,C,!1,52,8)};function Ce(B,C,O,K,ne,he){if(!l.isBuffer(B))throw new TypeError('"buffer" argument must be a Buffer instance');if(C>ne||C<he)throw new RangeError('"value" argument is out of bounds');if(O+K>B.length)throw new RangeError("Index out of range")}l.prototype.writeUintLE=l.prototype.writeUIntLE=function(C,O,K,ne){if(C=+C,O=O>>>0,K=K>>>0,!ne){const Ye=Math.pow(2,8*K)-1;Ce(this,C,O,K,Ye,0)}let he=1,Te=0;for(this[O]=C&255;++Te<K&&(he*=256);)this[O+Te]=C/he&255;return O+K},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(C,O,K,ne){if(C=+C,O=O>>>0,K=K>>>0,!ne){const Ye=Math.pow(2,8*K)-1;Ce(this,C,O,K,Ye,0)}let he=K-1,Te=1;for(this[O+he]=C&255;--he>=0&&(Te*=256);)this[O+he]=C/Te&255;return O+K},l.prototype.writeUint8=l.prototype.writeUInt8=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,1,255,0),this[O]=C&255,O+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,2,65535,0),this[O]=C&255,this[O+1]=C>>>8,O+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,2,65535,0),this[O]=C>>>8,this[O+1]=C&255,O+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,4,4294967295,0),this[O+3]=C>>>24,this[O+2]=C>>>16,this[O+1]=C>>>8,this[O]=C&255,O+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,4,4294967295,0),this[O]=C>>>24,this[O+1]=C>>>16,this[O+2]=C>>>8,this[O+3]=C&255,O+4};function H(B,C,O,K,ne){De(C,K,ne,B,O,7);let he=Number(C&BigInt(4294967295));B[O++]=he,he=he>>8,B[O++]=he,he=he>>8,B[O++]=he,he=he>>8,B[O++]=he;let Te=Number(C>>BigInt(32)&BigInt(4294967295));return B[O++]=Te,Te=Te>>8,B[O++]=Te,Te=Te>>8,B[O++]=Te,Te=Te>>8,B[O++]=Te,O}function _(B,C,O,K,ne){De(C,K,ne,B,O,7);let he=Number(C&BigInt(4294967295));B[O+7]=he,he=he>>8,B[O+6]=he,he=he>>8,B[O+5]=he,he=he>>8,B[O+4]=he;let Te=Number(C>>BigInt(32)&BigInt(4294967295));return B[O+3]=Te,Te=Te>>8,B[O+2]=Te,Te=Te>>8,B[O+1]=Te,Te=Te>>8,B[O]=Te,O+8}l.prototype.writeBigUInt64LE=ze(function(C,O=0){return H(this,C,O,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=ze(function(C,O=0){return _(this,C,O,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(C,O,K,ne){if(C=+C,O=O>>>0,!ne){const ut=Math.pow(2,8*K-1);Ce(this,C,O,K,ut-1,-ut)}let he=0,Te=1,Ye=0;for(this[O]=C&255;++he<K&&(Te*=256);)C<0&&Ye===0&&this[O+he-1]!==0&&(Ye=1),this[O+he]=(C/Te>>0)-Ye&255;return O+K},l.prototype.writeIntBE=function(C,O,K,ne){if(C=+C,O=O>>>0,!ne){const ut=Math.pow(2,8*K-1);Ce(this,C,O,K,ut-1,-ut)}let he=K-1,Te=1,Ye=0;for(this[O+he]=C&255;--he>=0&&(Te*=256);)C<0&&Ye===0&&this[O+he+1]!==0&&(Ye=1),this[O+he]=(C/Te>>0)-Ye&255;return O+K},l.prototype.writeInt8=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,1,127,-128),C<0&&(C=255+C+1),this[O]=C&255,O+1},l.prototype.writeInt16LE=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,2,32767,-32768),this[O]=C&255,this[O+1]=C>>>8,O+2},l.prototype.writeInt16BE=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,2,32767,-32768),this[O]=C>>>8,this[O+1]=C&255,O+2},l.prototype.writeInt32LE=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,4,2147483647,-2147483648),this[O]=C&255,this[O+1]=C>>>8,this[O+2]=C>>>16,this[O+3]=C>>>24,O+4},l.prototype.writeInt32BE=function(C,O,K){return C=+C,O=O>>>0,K||Ce(this,C,O,4,2147483647,-2147483648),C<0&&(C=4294967295+C+1),this[O]=C>>>24,this[O+1]=C>>>16,this[O+2]=C>>>8,this[O+3]=C&255,O+4},l.prototype.writeBigInt64LE=ze(function(C,O=0){return H(this,C,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=ze(function(C,O=0){return _(this,C,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function F(B,C,O,K,ne,he){if(O+K>B.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function G(B,C,O,K,ne){return C=+C,O=O>>>0,ne||F(B,C,O,4),n.write(B,C,O,K,23,4),O+4}l.prototype.writeFloatLE=function(C,O,K){return G(this,C,O,!0,K)},l.prototype.writeFloatBE=function(C,O,K){return G(this,C,O,!1,K)};function z(B,C,O,K,ne){return C=+C,O=O>>>0,ne||F(B,C,O,8),n.write(B,C,O,K,52,8),O+8}l.prototype.writeDoubleLE=function(C,O,K){return z(this,C,O,!0,K)},l.prototype.writeDoubleBE=function(C,O,K){return z(this,C,O,!1,K)},l.prototype.copy=function(C,O,K,ne){if(!l.isBuffer(C))throw new TypeError("argument should be a Buffer");if(K||(K=0),!ne&&ne!==0&&(ne=this.length),O>=C.length&&(O=C.length),O||(O=0),ne>0&&ne<K&&(ne=K),ne===K||C.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if(K<0||K>=this.length)throw new RangeError("Index out of range");if(ne<0)throw new RangeError("sourceEnd out of bounds");ne>this.length&&(ne=this.length),C.length-O<ne-K&&(ne=C.length-O+K);const he=ne-K;return this===C&&typeof i.prototype.copyWithin=="function"?this.copyWithin(O,K,ne):i.prototype.set.call(C,this.subarray(K,ne),O),he},l.prototype.fill=function(C,O,K,ne){if(typeof C=="string"){if(typeof O=="string"?(ne=O,O=0,K=this.length):typeof K=="string"&&(ne=K,K=this.length),ne!==void 0&&typeof ne!="string")throw new TypeError("encoding must be a string");if(typeof ne=="string"&&!l.isEncoding(ne))throw new TypeError("Unknown encoding: "+ne);if(C.length===1){const Te=C.charCodeAt(0);(ne==="utf8"&&Te<128||ne==="latin1")&&(C=Te)}}else typeof C=="number"?C=C&255:typeof C=="boolean"&&(C=Number(C));if(O<0||this.length<O||this.length<K)throw new RangeError("Out of range index");if(K<=O)return this;O=O>>>0,K=K===void 0?this.length:K>>>0,C||(C=0);let he;if(typeof C=="number")for(he=O;he<K;++he)this[he]=C;else{const Te=l.isBuffer(C)?C:l.from(C,ne),Ye=Te.length;if(Ye===0)throw new TypeError('The value "'+C+'" is invalid for argument "value"');for(he=0;he<K-O;++he)this[he+O]=Te[he%Ye]}return this};const M={};function q(B,C,O){M[B]=class extends O{constructor(){super(),Object.defineProperty(this,"message",{value:C.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${B}]`,this.stack,delete this.name}get code(){return B}set code(ne){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ne,writable:!0})}toString(){return`${this.name} [${B}]: ${this.message}`}}}q("ERR_BUFFER_OUT_OF_BOUNDS",function(B){return B?`${B} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),q("ERR_INVALID_ARG_TYPE",function(B,C){return`The "${B}" argument must be of type number. Received type ${typeof C}`},TypeError),q("ERR_OUT_OF_RANGE",function(B,C,O){let K=`The value of "${B}" is out of range.`,ne=O;return Number.isInteger(O)&&Math.abs(O)>2**32?ne=de(String(O)):typeof O=="bigint"&&(ne=String(O),(O>BigInt(2)**BigInt(32)||O<-(BigInt(2)**BigInt(32)))&&(ne=de(ne)),ne+="n"),K+=` It must be ${C}. Received ${ne}`,K},RangeError);function de(B){let C="",O=B.length;const K=B[0]==="-"?1:0;for(;O>=K+4;O-=3)C=`_${B.slice(O-3,O)}${C}`;return`${B.slice(0,O)}${C}`}function Ae(B,C,O){ke(C,"offset"),(B[C]===void 0||B[C+O]===void 0)&&_e(C,B.length-(O+1))}function De(B,C,O,K,ne,he){if(B>O||B<C){const Te=typeof C=="bigint"?"n":"";let Ye;throw C===0||C===BigInt(0)?Ye=`>= 0${Te} and < 2${Te} ** ${(he+1)*8}${Te}`:Ye=`>= -(2${Te} ** ${(he+1)*8-1}${Te}) and < 2 ** ${(he+1)*8-1}${Te}`,new M.ERR_OUT_OF_RANGE("value",Ye,B)}Ae(K,ne,he)}function ke(B,C){if(typeof B!="number")throw new M.ERR_INVALID_ARG_TYPE(C,"number",B)}function _e(B,C,O){throw Math.floor(B)!==B?(ke(B,O),new M.ERR_OUT_OF_RANGE("offset","an integer",B)):C<0?new M.ERR_BUFFER_OUT_OF_BOUNDS:new M.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${C}`,B)}const Le=/[^+/0-9A-Za-z-_]/g;function Y(B){if(B=B.split("=")[0],B=B.trim().replace(Le,""),B.length<2)return"";for(;B.length%4!==0;)B=B+"=";return B}function xe(B,C){C=C||1/0;let O;const K=B.length;let ne=null;const he=[];for(let Te=0;Te<K;++Te){if(O=B.charCodeAt(Te),O>55295&&O<57344){if(!ne){if(O>56319){(C-=3)>-1&&he.push(239,191,189);continue}else if(Te+1===K){(C-=3)>-1&&he.push(239,191,189);continue}ne=O;continue}if(O<56320){(C-=3)>-1&&he.push(239,191,189),ne=O;continue}O=(ne-55296<<10|O-56320)+65536}else ne&&(C-=3)>-1&&he.push(239,191,189);if(ne=null,O<128){if((C-=1)<0)break;he.push(O)}else if(O<2048){if((C-=2)<0)break;he.push(O>>6|192,O&63|128)}else if(O<65536){if((C-=3)<0)break;he.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((C-=4)<0)break;he.push(O>>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else throw new Error("Invalid code point")}return he}function Me(B){const C=[];for(let O=0;O<B.length;++O)C.push(B.charCodeAt(O)&255);return C}function Ve(B,C){let O,K,ne;const he=[];for(let Te=0;Te<B.length&&!((C-=2)<0);++Te)O=B.charCodeAt(Te),K=O>>8,ne=O%256,he.push(ne),he.push(K);return he}function Ze(B){return t.toByteArray(Y(B))}function kt(B,C,O,K){let ne;for(ne=0;ne<K&&!(ne+O>=C.length||ne>=B.length);++ne)C[ne+O]=B[ne];return ne}function Rt(B,C){return B instanceof C||B!=null&&B.constructor!=null&&B.constructor.name!=null&&B.constructor.name===C.name}function Nt(B){return B!==B}const Be=function(){const B="0123456789abcdef",C=new Array(256);for(let O=0;O<16;++O){const K=O*16;for(let ne=0;ne<16;++ne)C[K+ne]=B[O]+B[ne]}return C}();function ze(B){return typeof BigInt>"u"?pn:B}function pn(){throw new Error("BigInt not supported")}})(Rh);const wr=Rh.Buffer;var Dl,Ih;function Ch(){return Ih||(Ih=1,Dl=typeof we=="object"&&we.env&&we.env.NODE_DEBUG&&/\bsemver\b/i.test(we.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),Dl}var Ll,Ph;function Fh(){if(Ph)return Ll;Ph=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,o=t-6;return Ll={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Ll}var Ts={exports:{}},Oh;function nA(){return Oh||(Oh=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:o}=Fh(),i=Ch();t=e.exports={};const s=t.re=[],a=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],l=t.t={};let f=0;const d="[a-zA-Z0-9-]",m=[["\\s",1],["\\d",o],[d,r]],w=T=>{for(const[y,g]of m)T=T.split(`${y}*`).join(`${y}{0,${g}}`).split(`${y}+`).join(`${y}{1,${g}}`);return T},v=(T,y,g)=>{const h=w(y),b=f++;i(T,b,y),l[T]=b,c[b]=y,u[b]=h,s[b]=new RegExp(y,g?"g":void 0),a[b]=new RegExp(h,g?"g":void 0)};v("NUMERICIDENTIFIER","0|[1-9]\\d*"),v("NUMERICIDENTIFIERLOOSE","\\d+"),v("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),v("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),v("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),v("PRERELEASEIDENTIFIER",`(?:${c[l.NUMERICIDENTIFIER]}|${c[l.NONNUMERICIDENTIFIER]})`),v("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NUMERICIDENTIFIERLOOSE]}|${c[l.NONNUMERICIDENTIFIER]})`),v("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),v("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),v("BUILDIDENTIFIER",`${d}+`),v("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),v("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),v("FULL",`^${c[l.FULLPLAIN]}$`),v("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),v("LOOSE",`^${c[l.LOOSEPLAIN]}$`),v("GTLT","((?:<|>)?=?)"),v("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),v("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),v("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),v("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),v("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),v("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),v("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),v("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),v("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?(?:${c[l.BUILD]})?(?:$|[^\\d])`),v("COERCERTL",c[l.COERCE],!0),v("COERCERTLFULL",c[l.COERCEFULL],!0),v("LONETILDE","(?:~>?)"),v("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",v("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),v("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),v("LONECARET","(?:\\^)"),v("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",v("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),v("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),v("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),v("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),v("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",v("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),v("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),v("STAR","(<|>)?=?\\s*\\*"),v("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),v("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Ts,Ts.exports)),Ts.exports}var Ml,kh;function rA(){if(kh)return Ml;kh=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Ml=r=>r?typeof r!="object"?e:r:t,Ml}var Bl,xh;function iA(){if(xh)return Bl;xh=1;const e=/^[0-9]+$/,t=(r,o)=>{const i=e.test(r),s=e.test(o);return i&&s&&(r=+r,o=+o),r===o?0:i&&!s?-1:s&&!i?1:r<o?-1:1};return Bl={compareIdentifiers:t,rcompareIdentifiers:(r,o)=>t(o,r)},Bl}var jl,Nh;function $h(){if(Nh)return jl;Nh=1;const e=Ch(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=Fh(),{safeRe:r,safeSrc:o,t:i}=nA(),s=rA(),{compareIdentifiers:a}=iA();class c{constructor(l,f){if(f=s(f),l instanceof c){if(l.loose===!!f.loose&&l.includePrerelease===!!f.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",l,f),this.options=f,this.loose=!!f.loose,this.includePrerelease=!!f.includePrerelease;const d=l.trim().match(f.loose?r[i.LOOSE]:r[i.FULL]);if(!d)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+d[1],this.minor=+d[2],this.patch=+d[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");d[4]?this.prerelease=d[4].split(".").map(m=>{if(/^[0-9]+$/.test(m)){const w=+m;if(w>=0&&w<n)return w}return m}):this.prerelease=[],this.build=d[5]?d[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(l){if(e("SemVer.compare",this.version,this.options,l),!(l instanceof c)){if(typeof l=="string"&&l===this.version)return 0;l=new c(l,this.options)}return l.version===this.version?0:this.compareMain(l)||this.comparePre(l)}compareMain(l){return l instanceof c||(l=new c(l,this.options)),a(this.major,l.major)||a(this.minor,l.minor)||a(this.patch,l.patch)}comparePre(l){if(l instanceof c||(l=new c(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let f=0;do{const d=this.prerelease[f],m=l.prerelease[f];if(e("prerelease compare",f,d,m),d===void 0&&m===void 0)return 0;if(m===void 0)return 1;if(d===void 0)return-1;if(d===m)continue;return a(d,m)}while(++f)}compareBuild(l){l instanceof c||(l=new c(l,this.options));let f=0;do{const d=this.build[f],m=l.build[f];if(e("build compare",f,d,m),d===void 0&&m===void 0)return 0;if(m===void 0)return 1;if(d===void 0)return-1;if(d===m)continue;return a(d,m)}while(++f)}inc(l,f,d){if(l.startsWith("pre")){if(!f&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(f){const m=new RegExp(`^${this.options.loose?o[i.PRERELEASELOOSE]:o[i.PRERELEASE]}$`),w=`-${f}`.match(m);if(!w||w[1]!==f)throw new Error(`invalid identifier: ${f}`)}}switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",f,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",f,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",f,d),this.inc("pre",f,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",f,d),this.inc("pre",f,d);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const m=Number(d)?1:0;if(this.prerelease.length===0)this.prerelease=[m];else{let w=this.prerelease.length;for(;--w>=0;)typeof this.prerelease[w]=="number"&&(this.prerelease[w]++,w=-2);if(w===-1){if(f===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(m)}}if(f){let w=[f,m];d===!1&&(w=[f]),a(this.prerelease[0],f)===0?isNaN(this.prerelease[1])&&(this.prerelease=w):this.prerelease=w}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return jl=c,jl}var Ul,Dh;function oA(){if(Dh)return Ul;Dh=1;const e=$h();return Ul=(n,r)=>new e(n,r).major,Ul}var sA=oA();const Lh=il(sA);var ql,Mh;function aA(){if(Mh)return ql;Mh=1;const e=$h();return ql=(n,r,o)=>new e(n,o).compare(new e(r,o)),ql}var Vl,Bh;function lA(){if(Bh)return Vl;Bh=1;const e=aA();return Vl=(n,r,o)=>e(r,n,o),Vl}var cA=lA();const uA=il(cA);class ki extends Error{constructor(n,...r){super([n,...r].filter(Boolean).join(", "));Se(this,"name","RuntimeError");Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class fA extends ki{constructor(){super(...arguments);Se(this,"name","ApiError")}}const zl=(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)};class dA{constructor(t,n,r,o=le([])){Se(this,"clientService");Se(this,"userStore");Se(this,"serverUrl");Se(this,"capability");Se(this,"available");Se(this,"fileIdsSupported");this.clientService=t,this.userStore=n,this.serverUrl=r,this.capability=j(()=>{const i=p(o).filter(s=>s.enabled).sort((s,a)=>uA(s.version,a.version));return i.length?i[0]:null}),this.available=j(()=>{var i;return!!((i=p(this.capability))!=null&&i.version)}),this.fileIdsSupported=j(()=>{var i;return Lh((i=p(this.capability))==null?void 0:i.version)>=2})}async triggerDownload(t){var o,i,s;if(!p(this.available))throw new ki("no archiver available");if((((o=t.fileIds)==null?void 0:o.length)||0)+(((i=t.files)==null?void 0:i.length)||0)===0)throw new ki("requested archive with empty list of resources");const n=this.buildDownloadUrl({...t});if(!n)throw new ki("download url could not be built");const r=t.publicToken?n:await this.clientService.ocsUserContext.signUrl(n,(s=this.userStore.user)==null?void 0:s.onPremisesSamAccountName);try{const a=await fetch(r,{headers:{...this.clientService.getRequestHeaders({useAuth:!t.publicLinkPassword}),...!!t.publicLinkPassword&&{Authorization:"Basic "+wr.from(["public",t.publicLinkPassword].join(":")).toString("base64")}}});if(!a.ok)throw new te.HttpError("",a);const c=await a.blob(),u=URL.createObjectURL(c),l=this.getFileNameFromResponseHeaders(a.headers);return zl(u,l),r}catch(a){throw new te.HttpError("archive could not be fetched",a.response)}}buildDownloadUrl(t){const n=[];switch(t.publicToken&&n.push(`public-token=${t.publicToken}`),Lh(p(this.capability).version)){case 2:return n.push(...t.fileIds.map(o=>`id=${o}`)),this.url+"?"+n.join("&");case 1:{const o=Math.random().toString(36).substring(2);return n.push(`dir=${encodeURIComponent(t.dir)}`,...t.files.map(i=>`files[]=${encodeURIComponent(i)}`),`downloadStartSecret=${o}`),this.url+"?"+n.join("&")}default:return}}get url(){if(!this.available)throw new ki("no archiver available");const t=p(this.capability);return/^https?:\/\//i.test(t.archiver_url)?t.archiver_url:te.urlJoin(this.serverUrl,t.archiver_url)}getFileNameFromResponseHeaders(t){var r;const n=(r=t.get("content-disposition"))==null?void 0:r.split('"')[1];return decodeURI(n)}}const pA=new Il({ttl:10*1e3,capacity:250}),hA=new Il({ttl:10*1e3,capacity:250});class gA{get avatarUrl(){return hA}get filePreview(){return pA}}const Wl=new gA;class jh{constructor(t={}){Se(this,"accessToken");Se(this,"publicLinkToken");Se(this,"publicLinkPassword");this.accessToken=t.accessToken,this.publicLinkToken=t.publicLinkToken,this.publicLinkPassword=t.publicLinkPassword}getHeaders(){return{...this.publicLinkToken&&{"public-token":this.publicLinkToken},...this.publicLinkPassword&&{Authorization:"Basic "+wr.from(["public",this.publicLinkPassword].join(":")).toString("base64")},...this.accessToken&&!this.publicLinkPassword&&{Authorization:"Bearer "+this.accessToken}}}}class Hl{constructor(t,n){Se(this,"instance");Se(this,"cancelToken");this.cancelToken=Mo.CancelToken.source(),this.instance=Mo.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 fo({cancelToken:this.cancelToken.token},t)}processResponse(t,n){if(n!=null&&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 i=await this.instance[t](n,r,this.obtainConfig(o));return this.processResponse(i,o)}}class mA extends Error{constructor(){super(...arguments);Se(this,"name","RetriableError")}}const yA=15e3;class bA{constructor(t,n){Se(this,"url");Se(this,"fetchOptions");Se(this,"abortController");Se(this,"eventListenerMap");Se(this,"readyState");Se(this,"withCredentials");Se(this,"CONNECTING");Se(this,"OPEN");Se(this,"CLOSED");Se(this,"onerror");Se(this,"onmessage");Se(this,"onopen");this.url=t,this.fetchOptions=n,this.abortController=new AbortController,this.eventListenerMap={},this.readyState=this.CONNECTING,this.connect()}connect(){return M0.fetchEventSource(this.url,{openWhenHidden:!0,signal:this.abortController.signal,fetch:this.fetchProvider.bind(this),onopen:async()=>{var n;const t=new Event("open");(n=this.onopen)==null||n.bind(this)(t),this.readyState=this.OPEN},onmessage:t=>{var i;const n=new MessageEvent("message",{data:t.data});(i=this.onmessage)==null||i.bind(this)(n);const r=t.event,o=this.eventListenerMap[r];o==null||o.forEach(s=>s(n))},onclose:()=>{throw this.readyState=this.CLOSED,new mA},onerror:t=>{var r;console.error(t);const n=new CustomEvent("error",{detail:t});return(r=this.onerror)==null||r.bind(this)(n),3e4+Math.floor(Math.random()*yA)}})}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){var r;this.eventListenerMap[t]=(r=this.eventListenerMap[t])==null?void 0:r.filter(o=>o!==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 Gl=null;const vA=(e,t)=>(Gl||(Gl=new bA(new URL("ocs/v2.php/apps/notifications/api/v1/notifications/sse",e).href,t)),Gl),wA=(e,t)=>({headers:{Authorization:`Bearer ${e.accessToken}`,"Accept-Language":t,"X-Request-ID":tn.v4(),"X-Requested-With":"XMLHttpRequest"}});class SA{constructor(t){Se(this,"configStore");Se(this,"language");Se(this,"authStore");Se(this,"httpAuthenticatedClient");Se(this,"httpUnAuthenticatedClient");Se(this,"graphClient");Se(this,"ocsClient");Se(this,"webDavClient");Se(this,"initiatorId",tn.v4());Se(this,"staticHeaders",{"Initiator-ID":this.initiatorId,"X-Requested-With":"XMLHttpRequest"});Se(this,"getRequestHeaders",({useAuth:t=!0}={})=>({...this.staticHeaders,...this.getDynamicHeaders({useAuth:t})}));this.configStore=t.configStore,this.language=t.language,this.authStore=t.authStore,this.initGraphClient(),this.initOcsClient(),this.initWebDavClient(),this.httpAuthenticatedClient=new Hl({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.httpUnAuthenticatedClient=new Hl({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 vA(this.configStore.serverUrl,wA({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}initGraphClient(){const t=Mo.create({headers:this.staticHeaders});t.interceptors.request.use(n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.graphClient=te.graph(this.configStore.serverUrl,t)}initOcsClient(){const t=Mo.create({headers:this.staticHeaders});t.interceptors.request.use(n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.ocsClient=te.ocs(this.configStore.serverUrl,t)}initWebDavClient(){this.webDavClient=te.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 "+wr.from(["public",this.authStore.publicLinkPassword].join(":")).toString("base64")),t})}getDynamicHeaders({useAuth:t=!0}={}){return{"Accept-Language":this.currentLanguage,"X-Request-ID":tn.v4(),...t&&{Authorization:"Bearer "+this.authStore.accessToken}}}}class Uh{constructor(){Se(this,"topics");this.topics=new Map}subscribe(t,n){const r={token:tn.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 Ke=new Uh;var EA=Up(Object.keys,Object),TA=Object.prototype,AA=TA.hasOwnProperty;function qh(e){if(!ys(e))return EA(e);var t=[];for(var n in Object(e))AA.call(e,n)&&n!="constructor"&&t.push(n);return t}var Kl=Yr(Zn,"DataView"),Ql=Yr(Zn,"Promise"),Xl=Yr(Zn,"Set"),Yl=Yr(Zn,"WeakMap"),Vh="[object Map]",RA="[object Object]",zh="[object Promise]",Wh="[object Set]",Hh="[object WeakMap]",Gh="[object DataView]",_A=Xr(Kl),IA=Xr(so),CA=Xr(Ql),PA=Xr(Xl),FA=Xr(Yl),Ln=Qr;(Kl&&Ln(new Kl(new ArrayBuffer(1)))!=Gh||so&&Ln(new so)!=Vh||Ql&&Ln(Ql.resolve())!=zh||Xl&&Ln(new Xl)!=Wh||Yl&&Ln(new Yl)!=Hh)&&(Ln=function(e){var t=Qr(e),n=t==RA?e.constructor:void 0,r=n?Xr(n):"";if(r)switch(r){case _A:return Gh;case IA:return Vh;case CA:return zh;case PA:return Wh;case FA:return Hh}return t});var OA="[object Map]",kA="[object Set]",xA=Object.prototype,NA=xA.hasOwnProperty;function $A(e){if(e==null)return!0;if(co(e)&&(xn(e)||typeof e=="string"||typeof e.splice=="function"||_i(e)||bs(e)||lo(e)))return!e.length;var t=Ln(e);if(t==OA||t==kA)return!e.size;if(ys(e))return!qh(e).length;for(var n in e)if(NA.call(e,n))return!1;return!0}class Kh{isEnabled(){return!0}isActive(t){return dt(t,"files-spaces-projects")?!1:dt(t,"files-spaces-generic")||Cn(t,"files-public-link")}getTask(t){const{router:n,clientService:r,resourcesStore:o,userStore:i,authService:s,spacesStore:a,sharesStore:c,configStore:u}=t,{webdav:l,graphAuthenticated:f}=r,{replaceInvalidFileRoute:d}=Xs({router:n});return hn.useTask(function*(m,w,v,T=null,y=null,g={}){try{o.clearResourceList();let{resource:h,children:b}=yield*te.call(l.listFiles(v,{path:T,fileId:y},{signal:m}));h.id&&d({space:v,resource:h,path:T,fileId:y});let S;T==="/"&&(te.isShareSpaceResource(v)?(S=yield*te.call(ws({graphClient:f,spacesStore:a,space:v,signal:m})),S&&(h=te.buildIncomingShareResource({graphRoles:c.graphRoles,driveItem:S,serverUrl:u.serverUrl}))):!te.isPersonalSpaceResource(v)&&!te.isPublicSpaceResource(v)&&(h=v)),yield o.loadAncestorMetaData({folder:h,space:v,client:l,signal:m}),te.isShareSpaceResource(v)&&(b.forEach(E=>E.remoteItemId=v.id),$A(v.members)&&(S||(S=yield*te.call(ws({graphClient:f,spacesStore:a,space:v,signal:m}))),ph({sharesStore:c,spacesStore:a,userStore:i,space:v,sharedDriveItem:S}))),o.initResourceList({currentFolder:h,resources:b})}catch(h){if(o.setCurrentFolder(null),console.error(h),h.statusCode===401)return s.handleAuthError(p(n.currentRoute))}}).restartable()}}class Qh{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return It(t,"files-common-favorites")||((r=n==null?void 0:n.query)==null?void 0:r.contextRouteName)==="files-common-favorites"}getTask(t){const{resourcesStore:n,clientService:r,userStore:o}=t;return hn.useTask(function*(i,s){var c;n.clearResourceList(),n.setAncestorMetaData({});let a=yield r.webdav.listFavoriteFiles({username:(c=o.user)==null?void 0:c.onPremisesSamAccountName,signal:i});a=a.map(te.buildResource),n.initResourceList({currentFolder:null,resources:a})})}}class Xh{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return Mt(t,"files-shares-via-link")||((r=n==null?void 0:n.query)==null?void 0:r.contextRouteName)==="files-shares-via-link"}getTask(t){const{userStore:n,spacesStore:r,clientService:o,configStore:i,resourcesStore:s}=t;return hn.useTask(function*(a,c){s.clearResourceList(),s.setAncestorMetaData({}),i.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:o.graphAuthenticated,signal:a}));const l=(yield*te.call(o.graphAuthenticated.driveItems.listSharedByMe({signal:a}))).filter(f=>f.permissions.some(({link:d})=>!!d)).map(f=>te.buildOutgoingShareResource({driveItem:f,user:n.user,serverUrl:i.serverUrl}));s.initResourceList({currentFolder:null,resources:l})})}}class Yh{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return Mt(t,"files-shares-with-me")||((r=n==null?void 0:n.query)==null?void 0:r.contextRouteName)==="files-shares-with-me"}getTask(t){const{spacesStore:n,clientService:r,configStore:o,resourcesStore:i,sharesStore:s}=t;return hn.useTask(function*(a,c){i.clearResourceList(),i.setAncestorMetaData({}),o.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:r.graphAuthenticated,signal:a}));const l=(yield*te.call(r.graphAuthenticated.driveItems.listSharedWithMe({signal:a}))).map(f=>te.buildIncomingShareResource({driveItem:f,graphRoles:s.graphRoles,serverUrl:o.serverUrl}));i.initResourceList({currentFolder:null,resources:l})})}}class Jh{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return Mt(t,"files-shares-with-others")||((r=n==null?void 0:n.query)==null?void 0:r.contextRouteName)==="files-shares-with-others"}getTask(t){const{userStore:n,spacesStore:r,clientService:o,configStore:i,resourcesStore:s}=t;return hn.useTask(function*(a,c){s.clearResourceList(),s.setAncestorMetaData({}),i.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:o.graphAuthenticated,signal:a}));const l=(yield*te.call(o.graphAuthenticated.driveItems.listSharedByMe({signal:a}))).filter(f=>f.permissions.some(({link:d})=>!d)).map(f=>te.buildOutgoingShareResource({driveItem:f,user:n.user,serverUrl:i.serverUrl}));s.initResourceList({currentFolder:null,resources:l})})}}class Fn{}Se(Fn,"Shared","S"),Se(Fn,"Shareable","R"),Se(Fn,"Mounted","M"),Se(Fn,"Deletable","D"),Se(Fn,"Renameable","N"),Se(Fn,"Moveable","V"),Se(Fn,"Updateable","NV"),Se(Fn,"FileUpdateable","W"),Se(Fn,"FolderCreateable","CK"),Se(Fn,"Deny","Z"),Se(Fn,"SecureView","X");const As=e=>({value:e,type:null}),DA=e=>As(e),pt=e=>As(e),Jl=e=>As(e),LA=e=>As(e),MA={Permissions:pt("permissions"),IsFavorite:Jl("favorite"),FileId:pt("fileid"),FileParent:pt("file-parent"),Name:pt("name"),OwnerId:pt("owner-id"),OwnerDisplayName:pt("owner-display-name"),PrivateLink:pt("privatelink"),ContentLength:Jl("getcontentlength"),ContentSize:Jl("size"),LastModifiedDate:pt("getlastmodified"),Tags:DA("tags"),Audio:{value:"audio",type:null},Location:{value:"location",type:null},Image:{value:"image",type:null},Photo:{value:"photo",type:null},ETag:pt("getetag"),MimeType:pt("getcontenttype"),ResourceType:LA("resourcetype"),LockDiscovery:{value:"lockdiscovery",type:null},LockOwner:pt("owner"),LockTime:pt("locktime"),ActiveLock:{value:"activelock",type:null},DownloadURL:pt("downloadURL"),Highlights:pt("highlights"),MetaPathForUser:pt("meta-path-for-user"),RemoteItemId:pt("remote-item-id"),ShareId:pt("shareid"),ShareRoot:pt("shareroot"),ShareTypes:{value:"share-types",type:null},SharePermissions:pt("share-permissions"),TrashbinOriginalFilename:pt("trashbin-original-filename"),TrashbinOriginalLocation:pt("trashbin-original-location"),TrashbinDeletedDate:pt("trashbin-delete-datetime"),PublicLinkItemType:pt("public-link-item-type"),PublicLinkPermission:pt("public-link-permission"),PublicLinkExpiration:pt("public-link-expiration"),PublicLinkShareDate:pt("public-link-share-datetime"),PublicLinkShareOwner:pt("public-link-share-owner")},je=Object.fromEntries(Object.entries(MA).map(([e,t])=>[e,t.value])),di=class di{};Se(di,"Default",[je.Permissions,je.IsFavorite,je.FileId,je.FileParent,je.Name,je.LockDiscovery,je.ActiveLock,je.OwnerId,je.OwnerDisplayName,je.RemoteItemId,je.ShareRoot,je.ShareTypes,je.PrivateLink,je.ContentLength,je.ContentSize,je.LastModifiedDate,je.ETag,je.MimeType,je.ResourceType,je.DownloadURL,je.Tags,je.Audio,je.Location,je.Image,je.Photo]),Se(di,"PublicLink",di.Default.concat([je.PublicLinkItemType,je.PublicLinkPermission,je.PublicLinkExpiration,je.PublicLinkShareDate,je.PublicLinkShareOwner])),Se(di,"Trashbin",[je.ContentLength,je.ResourceType,je.TrashbinOriginalLocation,je.TrashbinOriginalFilename,je.TrashbinDeletedDate,je.Permissions,je.FileParent]),Se(di,"DavNamespace",[je.ContentLength,je.LastModifiedDate,je.ETag,je.MimeType,je.ResourceType,je.LockDiscovery,je.ActiveLock]);let Rs=di;var Zl={},_s={exports:{}},Zh;function ec(){if(Zh)return _s.exports;Zh=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(S,E,I){return Function.prototype.apply.call(S,E,I)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(S){return Object.getOwnPropertyNames(S).concat(Object.getOwnPropertySymbols(S))}:n=function(S){return Object.getOwnPropertyNames(S)};function r(b){console&&console.warn&&console.warn(b)}var o=Number.isNaN||function(S){return S!==S};function i(){i.init.call(this)}_s.exports=i,_s.exports.once=y,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function a(b){if(typeof b!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof b)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(b){if(typeof b!="number"||b<0||o(b))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+b+".");s=b}}),i.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},i.prototype.setMaxListeners=function(S){if(typeof S!="number"||S<0||o(S))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+S+".");return this._maxListeners=S,this};function c(b){return b._maxListeners===void 0?i.defaultMaxListeners:b._maxListeners}i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(S){for(var E=[],I=1;I<arguments.length;I++)E.push(arguments[I]);var R=S==="error",A=this._events;if(A!==void 0)R=R&&A.error===void 0;else if(!R)return!1;if(R){var N;if(E.length>0&&(N=E[0]),N instanceof Error)throw N;var L=new Error("Unhandled error."+(N?" ("+N.message+")":""));throw L.context=N,L}var x=A[S];if(x===void 0)return!1;if(typeof x=="function")t(x,this,E);else for(var $=x.length,V=w(x,$),I=0;I<$;++I)t(V[I],this,E);return!0};function u(b,S,E,I){var R,A,N;if(a(E),A=b._events,A===void 0?(A=b._events=Object.create(null),b._eventsCount=0):(A.newListener!==void 0&&(b.emit("newListener",S,E.listener?E.listener:E),A=b._events),N=A[S]),N===void 0)N=A[S]=E,++b._eventsCount;else if(typeof N=="function"?N=A[S]=I?[E,N]:[N,E]:I?N.unshift(E):N.push(E),R=c(b),R>0&&N.length>R&&!N.warned){N.warned=!0;var L=new Error("Possible EventEmitter memory leak detected. "+N.length+" "+String(S)+" listeners added. Use emitter.setMaxListeners() to increase limit");L.name="MaxListenersExceededWarning",L.emitter=b,L.type=S,L.count=N.length,r(L)}return b}i.prototype.addListener=function(S,E){return u(this,S,E,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(S,E){return u(this,S,E,!0)};function l(){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 f(b,S,E){var I={fired:!1,wrapFn:void 0,target:b,type:S,listener:E},R=l.bind(I);return R.listener=E,I.wrapFn=R,R}i.prototype.once=function(S,E){return a(E),this.on(S,f(this,S,E)),this},i.prototype.prependOnceListener=function(S,E){return a(E),this.prependListener(S,f(this,S,E)),this},i.prototype.removeListener=function(S,E){var I,R,A,N,L;if(a(E),R=this._events,R===void 0)return this;if(I=R[S],I===void 0)return this;if(I===E||I.listener===E)--this._eventsCount===0?this._events=Object.create(null):(delete R[S],R.removeListener&&this.emit("removeListener",S,I.listener||E));else if(typeof I!="function"){for(A=-1,N=I.length-1;N>=0;N--)if(I[N]===E||I[N].listener===E){L=I[N].listener,A=N;break}if(A<0)return this;A===0?I.shift():v(I,A),I.length===1&&(R[S]=I[0]),R.removeListener!==void 0&&this.emit("removeListener",S,L||E)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(S){var E,I,R;if(I=this._events,I===void 0)return this;if(I.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):I[S]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete I[S]),this;if(arguments.length===0){var A=Object.keys(I),N;for(R=0;R<A.length;++R)N=A[R],N!=="removeListener"&&this.removeAllListeners(N);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(E=I[S],typeof E=="function")this.removeListener(S,E);else if(E!==void 0)for(R=E.length-1;R>=0;R--)this.removeListener(S,E[R]);return this};function d(b,S,E){var I=b._events;if(I===void 0)return[];var R=I[S];return R===void 0?[]:typeof R=="function"?E?[R.listener||R]:[R]:E?T(R):w(R,R.length)}i.prototype.listeners=function(S){return d(this,S,!0)},i.prototype.rawListeners=function(S){return d(this,S,!1)},i.listenerCount=function(b,S){return typeof b.listenerCount=="function"?b.listenerCount(S):m.call(b,S)},i.prototype.listenerCount=m;function m(b){var S=this._events;if(S!==void 0){var E=S[b];if(typeof E=="function")return 1;if(E!==void 0)return E.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function w(b,S){for(var E=new Array(S),I=0;I<S;++I)E[I]=b[I];return E}function v(b,S){for(;S+1<b.length;S++)b[S]=b[S+1];b.pop()}function T(b){for(var S=new Array(b.length),E=0;E<S.length;++E)S[E]=b[E].listener||b[E];return S}function y(b,S){return new Promise(function(E,I){function R(N){b.removeListener(S,A),I(N)}function A(){typeof b.removeListener=="function"&&b.removeListener("error",R),E([].slice.call(arguments))}h(b,S,A,{once:!0}),S!=="error"&&g(b,R,{once:!0})})}function g(b,S,E){typeof b.on=="function"&&h(b,"error",S,E)}function h(b,S,E,I){if(typeof b.on=="function")I.once?b.once(S,E):b.on(S,E);else if(typeof b.addEventListener=="function")b.addEventListener(S,function R(A){I.once&&b.removeEventListener(S,R),E(A)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof b)}return _s.exports}var Is={exports:{}},eg;function ti(){return eg||(eg=1,typeof Object.create=="function"?Is.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Is.exports=function(t,n){if(n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t}}),Is.exports}var tc,tg;function ng(){return tg||(tg=1,tc=ec().EventEmitter),tc}var nc={},rg;function Cs(){return rg||(rg=1,function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t={},n={};n.byteLength=l,n.toByteArray=d,n.fromByteArray=v;for(var r=[],o=[],i=typeof Uint8Array<"u"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=s.length;a<c;++a)r[a]=s[a],o[s.charCodeAt(a)]=a;o[45]=62,o[95]=63;function u(g){var h=g.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var b=g.indexOf("=");b===-1&&(b=h);var S=b===h?0:4-b%4;return[b,S]}function l(g){var h=u(g),b=h[0],S=h[1];return(b+S)*3/4-S}function f(g,h,b){return(h+b)*3/4-b}function d(g){var h,b=u(g),S=b[0],E=b[1],I=new i(f(g,S,E)),R=0,A=E>0?S-4:S,N;for(N=0;N<A;N+=4)h=o[g.charCodeAt(N)]<<18|o[g.charCodeAt(N+1)]<<12|o[g.charCodeAt(N+2)]<<6|o[g.charCodeAt(N+3)],I[R++]=h>>16&255,I[R++]=h>>8&255,I[R++]=h&255;return E===2&&(h=o[g.charCodeAt(N)]<<2|o[g.charCodeAt(N+1)]>>4,I[R++]=h&255),E===1&&(h=o[g.charCodeAt(N)]<<10|o[g.charCodeAt(N+1)]<<4|o[g.charCodeAt(N+2)]>>2,I[R++]=h>>8&255,I[R++]=h&255),I}function m(g){return r[g>>18&63]+r[g>>12&63]+r[g>>6&63]+r[g&63]}function w(g,h,b){for(var S,E=[],I=h;I<b;I+=3)S=(g[I]<<16&16711680)+(g[I+1]<<8&65280)+(g[I+2]&255),E.push(m(S));return E.join("")}function v(g){for(var h,b=g.length,S=b%3,E=[],I=16383,R=0,A=b-S;R<A;R+=I)E.push(w(g,R,R+I>A?A:R+I));return S===1?(h=g[b-1],E.push(r[h>>2]+r[h<<4&63]+"==")):S===2&&(h=(g[b-2]<<8)+g[b-1],E.push(r[h>>10]+r[h>>4&63]+r[h<<2&63]+"=")),E.join("")}var T={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */T.read=function(g,h,b,S,E){var I,R,A=E*8-S-1,N=(1<<A)-1,L=N>>1,x=-7,$=b?E-1:0,V=b?-1:1,X=g[h+$];for($+=V,I=X&(1<<-x)-1,X>>=-x,x+=A;x>0;I=I*256+g[h+$],$+=V,x-=8);for(R=I&(1<<-x)-1,I>>=-x,x+=S;x>0;R=R*256+g[h+$],$+=V,x-=8);if(I===0)I=1-L;else{if(I===N)return R?NaN:(X?-1:1)*(1/0);R=R+Math.pow(2,S),I=I-L}return(X?-1:1)*R*Math.pow(2,I-S)},T.write=function(g,h,b,S,E,I){var R,A,N,L=I*8-E-1,x=(1<<L)-1,$=x>>1,V=E===23?Math.pow(2,-24)-Math.pow(2,-77):0,X=S?0:I-1,ee=S?1:-1,se=h<0||h===0&&1/h<0?1:0;for(h=Math.abs(h),isNaN(h)||h===1/0?(A=isNaN(h)?1:0,R=x):(R=Math.floor(Math.log(h)/Math.LN2),h*(N=Math.pow(2,-R))<1&&(R--,N*=2),R+$>=1?h+=V/N:h+=V*Math.pow(2,1-$),h*N>=2&&(R++,N/=2),R+$>=x?(A=0,R=x):R+$>=1?(A=(h*N-1)*Math.pow(2,E),R=R+$):(A=h*Math.pow(2,$-1)*Math.pow(2,E),R=0));E>=8;g[b+X]=A&255,X+=ee,A/=256,E-=8);for(R=R<<E|A,L+=E;L>0;g[b+X]=R&255,X+=ee,R/=256,L-=8);g[b+X-ee]|=se*128};/*!
11
+ */(function(e){const t=Ss,n=Vl,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=l,e.SlowBuffer=S,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o;const{Uint8Array:i,ArrayBuffer:s,SharedArrayBuffer:a}=globalThis;l.TYPED_ARRAY_SUPPORT=c(),!l.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 c(){try{const j=new i(1),I={foo:function(){return 42}};return Object.setPrototypeOf(I,i.prototype),Object.setPrototypeOf(j,I),j.foo()===42}catch{return!1}}Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}});function u(j){if(j>o)throw new RangeError('The value "'+j+'" is invalid for option "size"');const I=new i(j);return Object.setPrototypeOf(I,l.prototype),I}function l(j,I,O){if(typeof j=="number"){if(typeof I=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return w(j)}return d(j,I,O)}l.poolSize=8192;function d(j,I,O){if(typeof j=="string")return y(j,I);if(s.isView(j))return b(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(_t(j,s)||j&&_t(j.buffer,s)||typeof a<"u"&&(_t(j,a)||j&&_t(j.buffer,a)))return g(j,I,O);if(typeof j=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Q=j.valueOf&&j.valueOf();if(Q!=null&&Q!==j)return l.from(Q,I,O);const ne=v(j);if(ne)return ne;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof j[Symbol.toPrimitive]=="function")return l.from(j[Symbol.toPrimitive]("string"),I,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof j)}l.from=function(j,I,O){return d(j,I,O)},Object.setPrototypeOf(l.prototype,i.prototype),Object.setPrototypeOf(l,i);function f(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 m(j,I,O){return f(j),j<=0?u(j):I!==void 0?typeof O=="string"?u(j).fill(I,O):u(j).fill(I):u(j)}l.alloc=function(j,I,O){return m(j,I,O)};function w(j){return f(j),u(j<0?0:h(j)|0)}l.allocUnsafe=function(j){return w(j)},l.allocUnsafeSlow=function(j){return w(j)};function y(j,I){if((typeof I!="string"||I==="")&&(I="utf8"),!l.isEncoding(I))throw new TypeError("Unknown encoding: "+I);const O=T(j,I)|0;let Q=u(O);const ne=Q.write(j,I);return ne!==O&&(Q=Q.slice(0,ne)),Q}function E(j){const I=j.length<0?0:h(j.length)|0,O=u(I);for(let Q=0;Q<I;Q+=1)O[Q]=j[Q]&255;return O}function b(j){if(_t(j,i)){const I=new i(j);return g(I.buffer,I.byteOffset,I.byteLength)}return E(j)}function g(j,I,O){if(I<0||j.byteLength<I)throw new RangeError('"offset" is outside of buffer bounds');if(j.byteLength<I+(O||0))throw new RangeError('"length" is outside of buffer bounds');let Q;return I===void 0&&O===void 0?Q=new i(j):O===void 0?Q=new i(j,I):Q=new i(j,I,O),Object.setPrototypeOf(Q,l.prototype),Q}function v(j){if(l.isBuffer(j)){const I=h(j.length)|0,O=u(I);return O.length===0||j.copy(O,0,0,I),O}if(j.length!==void 0)return typeof j.length!="number"||$t(j.length)?u(0):E(j);if(j.type==="Buffer"&&Array.isArray(j.data))return E(j.data)}function h(j){if(j>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return j|0}function S(j){return+j!=j&&(j=0),l.alloc(+j)}l.isBuffer=function(I){return I!=null&&I._isBuffer===!0&&I!==l.prototype},l.compare=function(I,O){if(_t(I,i)&&(I=l.from(I,I.offset,I.byteLength)),_t(O,i)&&(O=l.from(O,O.offset,O.byteLength)),!l.isBuffer(I)||!l.isBuffer(O))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(I===O)return 0;let Q=I.length,ne=O.length;for(let ye=0,Ae=Math.min(Q,ne);ye<Ae;++ye)if(I[ye]!==O[ye]){Q=I[ye],ne=O[ye];break}return Q<ne?-1:ne<Q?1:0},l.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}},l.concat=function(I,O){if(!Array.isArray(I))throw new TypeError('"list" argument must be an Array of Buffers');if(I.length===0)return l.alloc(0);let Q;if(O===void 0)for(O=0,Q=0;Q<I.length;++Q)O+=I[Q].length;const ne=l.allocUnsafe(O);let ye=0;for(Q=0;Q<I.length;++Q){let Ae=I[Q];if(_t(Ae,i))ye+Ae.length>ne.length?(l.isBuffer(Ae)||(Ae=l.from(Ae)),Ae.copy(ne,ye)):i.prototype.set.call(ne,Ae,ye);else if(l.isBuffer(Ae))Ae.copy(ne,ye);else throw new TypeError('"list" argument must be an Array of Buffers');ye+=Ae.length}return ne};function T(j,I){if(l.isBuffer(j))return j.length;if(s.isView(j)||_t(j,s))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 O=j.length,Q=arguments.length>2&&arguments[2]===!0;if(!Q&&O===0)return 0;let ne=!1;for(;;)switch(I){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return Pe(j).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return et(j).length;default:if(ne)return Q?-1:Pe(j).length;I=(""+I).toLowerCase(),ne=!0}}l.byteLength=T;function R(j,I,O){let Q=!1;if((I===void 0||I<0)&&(I=0),I>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0,I>>>=0,O<=I))return"";for(j||(j="utf8");;)switch(j){case"hex":return G(this,I,O);case"utf8":case"utf-8":return be(this,I,O);case"ascii":return ue(this,I,O);case"latin1":case"binary":return ie(this,I,O);case"base64":return le(this,I,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return re(this,I,O);default:if(Q)throw new TypeError("Unknown encoding: "+j);j=(j+"").toLowerCase(),Q=!0}}l.prototype._isBuffer=!0;function _(j,I,O){const Q=j[I];j[I]=j[O],j[O]=Q}l.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 O=0;O<I;O+=2)_(this,O,O+1);return this},l.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 O=0;O<I;O+=4)_(this,O,O+3),_(this,O+1,O+2);return this},l.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 O=0;O<I;O+=8)_(this,O,O+7),_(this,O+1,O+6),_(this,O+2,O+5),_(this,O+3,O+4);return this},l.prototype.toString=function(){const I=this.length;return I===0?"":arguments.length===0?be(this,0,I):R.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(I){if(!l.isBuffer(I))throw new TypeError("Argument must be a Buffer");return this===I?!0:l.compare(this,I)===0},l.prototype.inspect=function(){let I="";const O=e.INSPECT_MAX_BYTES;return I=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O&&(I+=" ... "),"<Buffer "+I+">"},r&&(l.prototype[r]=l.prototype.inspect),l.prototype.compare=function(I,O,Q,ne,ye){if(_t(I,i)&&(I=l.from(I,I.offset,I.byteLength)),!l.isBuffer(I))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof I);if(O===void 0&&(O=0),Q===void 0&&(Q=I?I.length:0),ne===void 0&&(ne=0),ye===void 0&&(ye=this.length),O<0||Q>I.length||ne<0||ye>this.length)throw new RangeError("out of range index");if(ne>=ye&&O>=Q)return 0;if(ne>=ye)return-1;if(O>=Q)return 1;if(O>>>=0,Q>>>=0,ne>>>=0,ye>>>=0,this===I)return 0;let Ae=ye-ne,Ye=Q-O;const ut=Math.min(Ae,Ye),ft=this.slice(ne,ye),bt=I.slice(O,Q);for(let it=0;it<ut;++it)if(ft[it]!==bt[it]){Ae=ft[it],Ye=bt[it];break}return Ae<Ye?-1:Ye<Ae?1:0};function A(j,I,O,Q,ne){if(j.length===0)return-1;if(typeof O=="string"?(Q=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,$t(O)&&(O=ne?0:j.length-1),O<0&&(O=j.length+O),O>=j.length){if(ne)return-1;O=j.length-1}else if(O<0)if(ne)O=0;else return-1;if(typeof I=="string"&&(I=l.from(I,Q)),l.isBuffer(I))return I.length===0?-1:$(j,I,O,Q,ne);if(typeof I=="number")return I=I&255,typeof i.prototype.indexOf=="function"?ne?i.prototype.indexOf.call(j,I,O):i.prototype.lastIndexOf.call(j,I,O):$(j,[I],O,Q,ne);throw new TypeError("val must be string, number or Buffer")}function $(j,I,O,Q,ne){let ye=1,Ae=j.length,Ye=I.length;if(Q!==void 0&&(Q=String(Q).toLowerCase(),Q==="ucs2"||Q==="ucs-2"||Q==="utf16le"||Q==="utf-16le")){if(j.length<2||I.length<2)return-1;ye=2,Ae/=2,Ye/=2,O/=2}function ut(bt,it){return ye===1?bt[it]:bt.readUInt16BE(it*ye)}let ft;if(ne){let bt=-1;for(ft=O;ft<Ae;ft++)if(ut(j,ft)===ut(I,bt===-1?0:ft-bt)){if(bt===-1&&(bt=ft),ft-bt+1===Ye)return bt*ye}else bt!==-1&&(ft-=ft-bt),bt=-1}else for(O+Ye>Ae&&(O=Ae-Ye),ft=O;ft>=0;ft--){let bt=!0;for(let it=0;it<Ye;it++)if(ut(j,ft+it)!==ut(I,it)){bt=!1;break}if(bt)return ft}return-1}l.prototype.includes=function(I,O,Q){return this.indexOf(I,O,Q)!==-1},l.prototype.indexOf=function(I,O,Q){return A(this,I,O,Q,!0)},l.prototype.lastIndexOf=function(I,O,Q){return A(this,I,O,Q,!1)};function D(j,I,O,Q){O=Number(O)||0;const ne=j.length-O;Q?(Q=Number(Q),Q>ne&&(Q=ne)):Q=ne;const ye=I.length;Q>ye/2&&(Q=ye/2);let Ae;for(Ae=0;Ae<Q;++Ae){const Ye=parseInt(I.substr(Ae*2,2),16);if($t(Ye))return Ae;j[O+Ae]=Ye}return Ae}function N(j,I,O,Q){return Nt(Pe(I,j.length-O),j,O,Q)}function x(j,I,O,Q){return Nt(Ne(I),j,O,Q)}function W(j,I,O,Q){return Nt(et(I),j,O,Q)}function K(j,I,O,Q){return Nt(Ve(I,j.length-O),j,O,Q)}l.prototype.write=function(I,O,Q,ne){if(O===void 0)ne="utf8",Q=this.length,O=0;else if(Q===void 0&&typeof O=="string")ne=O,Q=this.length,O=0;else if(isFinite(O))O=O>>>0,isFinite(Q)?(Q=Q>>>0,ne===void 0&&(ne="utf8")):(ne=Q,Q=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ye=this.length-O;if((Q===void 0||Q>ye)&&(Q=ye),I.length>0&&(Q<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");ne||(ne="utf8");let Ae=!1;for(;;)switch(ne){case"hex":return D(this,I,O,Q);case"utf8":case"utf-8":return N(this,I,O,Q);case"ascii":case"latin1":case"binary":return x(this,I,O,Q);case"base64":return W(this,I,O,Q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return K(this,I,O,Q);default:if(Ae)throw new TypeError("Unknown encoding: "+ne);ne=(""+ne).toLowerCase(),Ae=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function le(j,I,O){return I===0&&O===j.length?t.fromByteArray(j):t.fromByteArray(j.slice(I,O))}function be(j,I,O){O=Math.min(j.length,O);const Q=[];let ne=I;for(;ne<O;){const ye=j[ne];let Ae=null,Ye=ye>239?4:ye>223?3:ye>191?2:1;if(ne+Ye<=O){let ut,ft,bt,it;switch(Ye){case 1:ye<128&&(Ae=ye);break;case 2:ut=j[ne+1],(ut&192)===128&&(it=(ye&31)<<6|ut&63,it>127&&(Ae=it));break;case 3:ut=j[ne+1],ft=j[ne+2],(ut&192)===128&&(ft&192)===128&&(it=(ye&15)<<12|(ut&63)<<6|ft&63,it>2047&&(it<55296||it>57343)&&(Ae=it));break;case 4:ut=j[ne+1],ft=j[ne+2],bt=j[ne+3],(ut&192)===128&&(ft&192)===128&&(bt&192)===128&&(it=(ye&15)<<18|(ut&63)<<12|(ft&63)<<6|bt&63,it>65535&&it<1114112&&(Ae=it))}}Ae===null?(Ae=65533,Ye=1):Ae>65535&&(Ae-=65536,Q.push(Ae>>>10&1023|55296),Ae=56320|Ae&1023),Q.push(Ae),ne+=Ye}return ae(Q)}const te=4096;function ae(j){const I=j.length;if(I<=te)return String.fromCharCode.apply(String,j);let O="",Q=0;for(;Q<I;)O+=String.fromCharCode.apply(String,j.slice(Q,Q+=te));return O}function ue(j,I,O){let Q="";O=Math.min(j.length,O);for(let ne=I;ne<O;++ne)Q+=String.fromCharCode(j[ne]&127);return Q}function ie(j,I,O){let Q="";O=Math.min(j.length,O);for(let ne=I;ne<O;++ne)Q+=String.fromCharCode(j[ne]);return Q}function G(j,I,O){const Q=j.length;(!I||I<0)&&(I=0),(!O||O<0||O>Q)&&(O=Q);let ne="";for(let ye=I;ye<O;++ye)ne+=Be[j[ye]];return ne}function re(j,I,O){const Q=j.slice(I,O);let ne="";for(let ye=0;ye<Q.length-1;ye+=2)ne+=String.fromCharCode(Q[ye]+Q[ye+1]*256);return ne}l.prototype.slice=function(I,O){const Q=this.length;I=~~I,O=O===void 0?Q:~~O,I<0?(I+=Q,I<0&&(I=0)):I>Q&&(I=Q),O<0?(O+=Q,O<0&&(O=0)):O>Q&&(O=Q),O<I&&(O=I);const ne=this.subarray(I,O);return Object.setPrototypeOf(ne,l.prototype),ne};function se(j,I,O){if(j%1!==0||j<0)throw new RangeError("offset is not uint");if(j+I>O)throw new RangeError("Trying to access beyond buffer length")}l.prototype.readUintLE=l.prototype.readUIntLE=function(I,O,Q){I=I>>>0,O=O>>>0,Q||se(I,O,this.length);let ne=this[I],ye=1,Ae=0;for(;++Ae<O&&(ye*=256);)ne+=this[I+Ae]*ye;return ne},l.prototype.readUintBE=l.prototype.readUIntBE=function(I,O,Q){I=I>>>0,O=O>>>0,Q||se(I,O,this.length);let ne=this[I+--O],ye=1;for(;O>0&&(ye*=256);)ne+=this[I+--O]*ye;return ne},l.prototype.readUint8=l.prototype.readUInt8=function(I,O){return I=I>>>0,O||se(I,1,this.length),this[I]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(I,O){return I=I>>>0,O||se(I,2,this.length),this[I]|this[I+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(I,O){return I=I>>>0,O||se(I,2,this.length),this[I]<<8|this[I+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(I,O){return I=I>>>0,O||se(I,4,this.length),(this[I]|this[I+1]<<8|this[I+2]<<16)+this[I+3]*16777216},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(I,O){return I=I>>>0,O||se(I,4,this.length),this[I]*16777216+(this[I+1]<<16|this[I+2]<<8|this[I+3])},l.prototype.readBigUInt64LE=ze(function(I){I=I>>>0,ke(I,"offset");const O=this[I],Q=this[I+7];(O===void 0||Q===void 0)&&$e(I,this.length-8);const ne=O+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24,ye=this[++I]+this[++I]*2**8+this[++I]*2**16+Q*2**24;return BigInt(ne)+(BigInt(ye)<<BigInt(32))}),l.prototype.readBigUInt64BE=ze(function(I){I=I>>>0,ke(I,"offset");const O=this[I],Q=this[I+7];(O===void 0||Q===void 0)&&$e(I,this.length-8);const ne=O*2**24+this[++I]*2**16+this[++I]*2**8+this[++I],ye=this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+Q;return(BigInt(ne)<<BigInt(32))+BigInt(ye)}),l.prototype.readIntLE=function(I,O,Q){I=I>>>0,O=O>>>0,Q||se(I,O,this.length);let ne=this[I],ye=1,Ae=0;for(;++Ae<O&&(ye*=256);)ne+=this[I+Ae]*ye;return ye*=128,ne>=ye&&(ne-=Math.pow(2,8*O)),ne},l.prototype.readIntBE=function(I,O,Q){I=I>>>0,O=O>>>0,Q||se(I,O,this.length);let ne=O,ye=1,Ae=this[I+--ne];for(;ne>0&&(ye*=256);)Ae+=this[I+--ne]*ye;return ye*=128,Ae>=ye&&(Ae-=Math.pow(2,8*O)),Ae},l.prototype.readInt8=function(I,O){return I=I>>>0,O||se(I,1,this.length),this[I]&128?(255-this[I]+1)*-1:this[I]},l.prototype.readInt16LE=function(I,O){I=I>>>0,O||se(I,2,this.length);const Q=this[I]|this[I+1]<<8;return Q&32768?Q|4294901760:Q},l.prototype.readInt16BE=function(I,O){I=I>>>0,O||se(I,2,this.length);const Q=this[I+1]|this[I]<<8;return Q&32768?Q|4294901760:Q},l.prototype.readInt32LE=function(I,O){return I=I>>>0,O||se(I,4,this.length),this[I]|this[I+1]<<8|this[I+2]<<16|this[I+3]<<24},l.prototype.readInt32BE=function(I,O){return I=I>>>0,O||se(I,4,this.length),this[I]<<24|this[I+1]<<16|this[I+2]<<8|this[I+3]},l.prototype.readBigInt64LE=ze(function(I){I=I>>>0,ke(I,"offset");const O=this[I],Q=this[I+7];(O===void 0||Q===void 0)&&$e(I,this.length-8);const ne=this[I+4]+this[I+5]*2**8+this[I+6]*2**16+(Q<<24);return(BigInt(ne)<<BigInt(32))+BigInt(O+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24)}),l.prototype.readBigInt64BE=ze(function(I){I=I>>>0,ke(I,"offset");const O=this[I],Q=this[I+7];(O===void 0||Q===void 0)&&$e(I,this.length-8);const ne=(O<<24)+this[++I]*2**16+this[++I]*2**8+this[++I];return(BigInt(ne)<<BigInt(32))+BigInt(this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+Q)}),l.prototype.readFloatLE=function(I,O){return I=I>>>0,O||se(I,4,this.length),n.read(this,I,!0,23,4)},l.prototype.readFloatBE=function(I,O){return I=I>>>0,O||se(I,4,this.length),n.read(this,I,!1,23,4)},l.prototype.readDoubleLE=function(I,O){return I=I>>>0,O||se(I,8,this.length),n.read(this,I,!0,52,8)},l.prototype.readDoubleBE=function(I,O){return I=I>>>0,O||se(I,8,this.length),n.read(this,I,!1,52,8)};function Ie(j,I,O,Q,ne,ye){if(!l.isBuffer(j))throw new TypeError('"buffer" argument must be a Buffer instance');if(I>ne||I<ye)throw new RangeError('"value" argument is out of bounds');if(O+Q>j.length)throw new RangeError("Index out of range")}l.prototype.writeUintLE=l.prototype.writeUIntLE=function(I,O,Q,ne){if(I=+I,O=O>>>0,Q=Q>>>0,!ne){const Ye=Math.pow(2,8*Q)-1;Ie(this,I,O,Q,Ye,0)}let ye=1,Ae=0;for(this[O]=I&255;++Ae<Q&&(ye*=256);)this[O+Ae]=I/ye&255;return O+Q},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(I,O,Q,ne){if(I=+I,O=O>>>0,Q=Q>>>0,!ne){const Ye=Math.pow(2,8*Q)-1;Ie(this,I,O,Q,Ye,0)}let ye=Q-1,Ae=1;for(this[O+ye]=I&255;--ye>=0&&(Ae*=256);)this[O+ye]=I/Ae&255;return O+Q},l.prototype.writeUint8=l.prototype.writeUInt8=function(I,O,Q){return I=+I,O=O>>>0,Q||Ie(this,I,O,1,255,0),this[O]=I&255,O+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(I,O,Q){return I=+I,O=O>>>0,Q||Ie(this,I,O,2,65535,0),this[O]=I&255,this[O+1]=I>>>8,O+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(I,O,Q){return I=+I,O=O>>>0,Q||Ie(this,I,O,2,65535,0),this[O]=I>>>8,this[O+1]=I&255,O+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(I,O,Q){return I=+I,O=O>>>0,Q||Ie(this,I,O,4,4294967295,0),this[O+3]=I>>>24,this[O+2]=I>>>16,this[O+1]=I>>>8,this[O]=I&255,O+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(I,O,Q){return I=+I,O=O>>>0,Q||Ie(this,I,O,4,4294967295,0),this[O]=I>>>24,this[O+1]=I>>>16,this[O+2]=I>>>8,this[O+3]=I&255,O+4};function ee(j,I,O,Q,ne){Le(I,Q,ne,j,O,7);let ye=Number(I&BigInt(4294967295));j[O++]=ye,ye=ye>>8,j[O++]=ye,ye=ye>>8,j[O++]=ye,ye=ye>>8,j[O++]=ye;let Ae=Number(I>>BigInt(32)&BigInt(4294967295));return j[O++]=Ae,Ae=Ae>>8,j[O++]=Ae,Ae=Ae>>8,j[O++]=Ae,Ae=Ae>>8,j[O++]=Ae,O}function F(j,I,O,Q,ne){Le(I,Q,ne,j,O,7);let ye=Number(I&BigInt(4294967295));j[O+7]=ye,ye=ye>>8,j[O+6]=ye,ye=ye>>8,j[O+5]=ye,ye=ye>>8,j[O+4]=ye;let Ae=Number(I>>BigInt(32)&BigInt(4294967295));return j[O+3]=Ae,Ae=Ae>>8,j[O+2]=Ae,Ae=Ae>>8,j[O+1]=Ae,Ae=Ae>>8,j[O]=Ae,O+8}l.prototype.writeBigUInt64LE=ze(function(I,O=0){return ee(this,I,O,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=ze(function(I,O=0){return F(this,I,O,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(I,O,Q,ne){if(I=+I,O=O>>>0,!ne){const ut=Math.pow(2,8*Q-1);Ie(this,I,O,Q,ut-1,-ut)}let ye=0,Ae=1,Ye=0;for(this[O]=I&255;++ye<Q&&(Ae*=256);)I<0&&Ye===0&&this[O+ye-1]!==0&&(Ye=1),this[O+ye]=(I/Ae>>0)-Ye&255;return O+Q},l.prototype.writeIntBE=function(I,O,Q,ne){if(I=+I,O=O>>>0,!ne){const ut=Math.pow(2,8*Q-1);Ie(this,I,O,Q,ut-1,-ut)}let ye=Q-1,Ae=1,Ye=0;for(this[O+ye]=I&255;--ye>=0&&(Ae*=256);)I<0&&Ye===0&&this[O+ye+1]!==0&&(Ye=1),this[O+ye]=(I/Ae>>0)-Ye&255;return O+Q},l.prototype.writeInt8=function(I,O,Q){return I=+I,O=O>>>0,Q||Ie(this,I,O,1,127,-128),I<0&&(I=255+I+1),this[O]=I&255,O+1},l.prototype.writeInt16LE=function(I,O,Q){return I=+I,O=O>>>0,Q||Ie(this,I,O,2,32767,-32768),this[O]=I&255,this[O+1]=I>>>8,O+2},l.prototype.writeInt16BE=function(I,O,Q){return I=+I,O=O>>>0,Q||Ie(this,I,O,2,32767,-32768),this[O]=I>>>8,this[O+1]=I&255,O+2},l.prototype.writeInt32LE=function(I,O,Q){return I=+I,O=O>>>0,Q||Ie(this,I,O,4,2147483647,-2147483648),this[O]=I&255,this[O+1]=I>>>8,this[O+2]=I>>>16,this[O+3]=I>>>24,O+4},l.prototype.writeInt32BE=function(I,O,Q){return I=+I,O=O>>>0,Q||Ie(this,I,O,4,2147483647,-2147483648),I<0&&(I=4294967295+I+1),this[O]=I>>>24,this[O+1]=I>>>16,this[O+2]=I>>>8,this[O+3]=I&255,O+4},l.prototype.writeBigInt64LE=ze(function(I,O=0){return ee(this,I,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=ze(function(I,O=0){return F(this,I,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function C(j,I,O,Q,ne,ye){if(O+Q>j.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function z(j,I,O,Q,ne){return I=+I,O=O>>>0,ne||C(j,I,O,4),n.write(j,I,O,Q,23,4),O+4}l.prototype.writeFloatLE=function(I,O,Q){return z(this,I,O,!0,Q)},l.prototype.writeFloatBE=function(I,O,Q){return z(this,I,O,!1,Q)};function q(j,I,O,Q,ne){return I=+I,O=O>>>0,ne||C(j,I,O,8),n.write(j,I,O,Q,52,8),O+8}l.prototype.writeDoubleLE=function(I,O,Q){return q(this,I,O,!0,Q)},l.prototype.writeDoubleBE=function(I,O,Q){return q(this,I,O,!1,Q)},l.prototype.copy=function(I,O,Q,ne){if(!l.isBuffer(I))throw new TypeError("argument should be a Buffer");if(Q||(Q=0),!ne&&ne!==0&&(ne=this.length),O>=I.length&&(O=I.length),O||(O=0),ne>0&&ne<Q&&(ne=Q),ne===Q||I.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if(Q<0||Q>=this.length)throw new RangeError("Index out of range");if(ne<0)throw new RangeError("sourceEnd out of bounds");ne>this.length&&(ne=this.length),I.length-O<ne-Q&&(ne=I.length-O+Q);const ye=ne-Q;return this===I&&typeof i.prototype.copyWithin=="function"?this.copyWithin(O,Q,ne):i.prototype.set.call(I,this.subarray(Q,ne),O),ye},l.prototype.fill=function(I,O,Q,ne){if(typeof I=="string"){if(typeof O=="string"?(ne=O,O=0,Q=this.length):typeof Q=="string"&&(ne=Q,Q=this.length),ne!==void 0&&typeof ne!="string")throw new TypeError("encoding must be a string");if(typeof ne=="string"&&!l.isEncoding(ne))throw new TypeError("Unknown encoding: "+ne);if(I.length===1){const Ae=I.charCodeAt(0);(ne==="utf8"&&Ae<128||ne==="latin1")&&(I=Ae)}}else typeof I=="number"?I=I&255:typeof I=="boolean"&&(I=Number(I));if(O<0||this.length<O||this.length<Q)throw new RangeError("Out of range index");if(Q<=O)return this;O=O>>>0,Q=Q===void 0?this.length:Q>>>0,I||(I=0);let ye;if(typeof I=="number")for(ye=O;ye<Q;++ye)this[ye]=I;else{const Ae=l.isBuffer(I)?I:l.from(I,ne),Ye=Ae.length;if(Ye===0)throw new TypeError('The value "'+I+'" is invalid for argument "value"');for(ye=0;ye<Q-O;++ye)this[ye+O]=Ae[ye%Ye]}return this};const M={};function V(j,I,O){M[j]=class extends O{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(ne){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ne,writable:!0})}toString(){return`${this.name} [${j}]: ${this.message}`}}}V("ERR_BUFFER_OUT_OF_BOUNDS",function(j){return j?`${j} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),V("ERR_INVALID_ARG_TYPE",function(j,I){return`The "${j}" argument must be of type number. Received type ${typeof I}`},TypeError),V("ERR_OUT_OF_RANGE",function(j,I,O){let Q=`The value of "${j}" is out of range.`,ne=O;return Number.isInteger(O)&&Math.abs(O)>2**32?ne=de(String(O)):typeof O=="bigint"&&(ne=String(O),(O>BigInt(2)**BigInt(32)||O<-(BigInt(2)**BigInt(32)))&&(ne=de(ne)),ne+="n"),Q+=` It must be ${I}. Received ${ne}`,Q},RangeError);function de(j){let I="",O=j.length;const Q=j[0]==="-"?1:0;for(;O>=Q+4;O-=3)I=`_${j.slice(O-3,O)}${I}`;return`${j.slice(0,O)}${I}`}function Te(j,I,O){ke(I,"offset"),(j[I]===void 0||j[I+O]===void 0)&&$e(I,j.length-(O+1))}function Le(j,I,O,Q,ne,ye){if(j>O||j<I){const Ae=typeof I=="bigint"?"n":"";let Ye;throw I===0||I===BigInt(0)?Ye=`>= 0${Ae} and < 2${Ae} ** ${(ye+1)*8}${Ae}`:Ye=`>= -(2${Ae} ** ${(ye+1)*8-1}${Ae}) and < 2 ** ${(ye+1)*8-1}${Ae}`,new M.ERR_OUT_OF_RANGE("value",Ye,j)}Te(Q,ne,ye)}function ke(j,I){if(typeof j!="number")throw new M.ERR_INVALID_ARG_TYPE(I,"number",j)}function $e(j,I,O){throw Math.floor(j)!==j?(ke(j,O),new M.ERR_OUT_OF_RANGE("offset","an integer",j)):I<0?new M.ERR_BUFFER_OUT_OF_BOUNDS:new M.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${I}`,j)}const Me=/[^+/0-9A-Za-z-_]/g;function Y(j){if(j=j.split("=")[0],j=j.trim().replace(Me,""),j.length<2)return"";for(;j.length%4!==0;)j=j+"=";return j}function Pe(j,I){I=I||1/0;let O;const Q=j.length;let ne=null;const ye=[];for(let Ae=0;Ae<Q;++Ae){if(O=j.charCodeAt(Ae),O>55295&&O<57344){if(!ne){if(O>56319){(I-=3)>-1&&ye.push(239,191,189);continue}else if(Ae+1===Q){(I-=3)>-1&&ye.push(239,191,189);continue}ne=O;continue}if(O<56320){(I-=3)>-1&&ye.push(239,191,189),ne=O;continue}O=(ne-55296<<10|O-56320)+65536}else ne&&(I-=3)>-1&&ye.push(239,191,189);if(ne=null,O<128){if((I-=1)<0)break;ye.push(O)}else if(O<2048){if((I-=2)<0)break;ye.push(O>>6|192,O&63|128)}else if(O<65536){if((I-=3)<0)break;ye.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((I-=4)<0)break;ye.push(O>>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else throw new Error("Invalid code point")}return ye}function Ne(j){const I=[];for(let O=0;O<j.length;++O)I.push(j.charCodeAt(O)&255);return I}function Ve(j,I){let O,Q,ne;const ye=[];for(let Ae=0;Ae<j.length&&!((I-=2)<0);++Ae)O=j.charCodeAt(Ae),Q=O>>8,ne=O%256,ye.push(ne),ye.push(Q);return ye}function et(j){return t.toByteArray(Y(j))}function Nt(j,I,O,Q){let ne;for(ne=0;ne<Q&&!(ne+O>=I.length||ne>=j.length);++ne)I[ne+O]=j[ne];return ne}function _t(j,I){return j instanceof I||j!=null&&j.constructor!=null&&j.constructor.name!=null&&j.constructor.name===I.name}function $t(j){return j!==j}const Be=function(){const j="0123456789abcdef",I=new Array(256);for(let O=0;O<16;++O){const Q=O*16;for(let ne=0;ne<16;++ne)I[Q+ne]=j[O]+j[ne]}return I}();function ze(j){return typeof BigInt>"u"?dn:j}function dn(){throw new Error("BigInt not supported")}})(Nh);const wr=Nh.Buffer;var zl,Dh;function Lh(){return Dh||(Dh=1,zl=typeof ve=="object"&&ve.env&&ve.env.NODE_DEBUG&&/\bsemver\b/i.test(ve.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),zl}var Wl,Mh;function Bh(){if(Mh)return Wl;Mh=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,o=t-6;return Wl={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Wl}var Es={exports:{}},jh;function uA(){return jh||(jh=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:o}=Bh(),i=Lh();t=e.exports={};const s=t.re=[],a=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],l=t.t={};let d=0;const f="[a-zA-Z0-9-]",m=[["\\s",1],["\\d",o],[f,r]],w=E=>{for(const[b,g]of m)E=E.split(`${b}*`).join(`${b}{0,${g}}`).split(`${b}+`).join(`${b}{1,${g}}`);return E},y=(E,b,g)=>{const v=w(b),h=d++;i(E,h,b),l[E]=h,c[h]=b,u[h]=v,s[h]=new RegExp(b,g?"g":void 0),a[h]=new RegExp(v,g?"g":void 0)};y("NUMERICIDENTIFIER","0|[1-9]\\d*"),y("NUMERICIDENTIFIERLOOSE","\\d+"),y("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),y("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),y("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),y("PRERELEASEIDENTIFIER",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIER]})`),y("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIERLOOSE]})`),y("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),y("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),y("BUILDIDENTIFIER",`${f}+`),y("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),y("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),y("FULL",`^${c[l.FULLPLAIN]}$`),y("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),y("LOOSE",`^${c[l.LOOSEPLAIN]}$`),y("GTLT","((?:<|>)?=?)"),y("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),y("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),y("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),y("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),y("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),y("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),y("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),y("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),y("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?(?:${c[l.BUILD]})?(?:$|[^\\d])`),y("COERCERTL",c[l.COERCE],!0),y("COERCERTLFULL",c[l.COERCEFULL],!0),y("LONETILDE","(?:~>?)"),y("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",y("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),y("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),y("LONECARET","(?:\\^)"),y("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",y("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),y("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),y("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),y("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),y("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",y("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),y("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),y("STAR","(<|>)?=?\\s*\\*"),y("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),y("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Es,Es.exports)),Es.exports}var Hl,Uh;function fA(){if(Uh)return Hl;Uh=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Hl=r=>r?typeof r!="object"?e:r:t,Hl}var Gl,qh;function dA(){if(qh)return Gl;qh=1;const e=/^[0-9]+$/,t=(r,o)=>{const i=e.test(r),s=e.test(o);return i&&s&&(r=+r,o=+o),r===o?0:i&&!s?-1:s&&!i?1:r<o?-1:1};return Gl={compareIdentifiers:t,rcompareIdentifiers:(r,o)=>t(o,r)},Gl}var Kl,Vh;function zh(){if(Vh)return Kl;Vh=1;const e=Lh(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=Bh(),{safeRe:r,t:o}=uA(),i=fA(),{compareIdentifiers:s}=dA();class a{constructor(u,l){if(l=i(l),u instanceof a){if(u.loose===!!l.loose&&u.includePrerelease===!!l.includePrerelease)return u;u=u.version}else if(typeof u!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof u}".`);if(u.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",u,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const d=u.trim().match(l.loose?r[o.LOOSE]:r[o.FULL]);if(!d)throw new TypeError(`Invalid Version: ${u}`);if(this.raw=u,this.major=+d[1],this.minor=+d[2],this.patch=+d[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");d[4]?this.prerelease=d[4].split(".").map(f=>{if(/^[0-9]+$/.test(f)){const m=+f;if(m>=0&&m<n)return m}return f}):this.prerelease=[],this.build=d[5]?d[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(u){if(e("SemVer.compare",this.version,this.options,u),!(u instanceof a)){if(typeof u=="string"&&u===this.version)return 0;u=new a(u,this.options)}return u.version===this.version?0:this.compareMain(u)||this.comparePre(u)}compareMain(u){return u instanceof a||(u=new a(u,this.options)),s(this.major,u.major)||s(this.minor,u.minor)||s(this.patch,u.patch)}comparePre(u){if(u instanceof a||(u=new a(u,this.options)),this.prerelease.length&&!u.prerelease.length)return-1;if(!this.prerelease.length&&u.prerelease.length)return 1;if(!this.prerelease.length&&!u.prerelease.length)return 0;let l=0;do{const d=this.prerelease[l],f=u.prerelease[l];if(e("prerelease compare",l,d,f),d===void 0&&f===void 0)return 0;if(f===void 0)return 1;if(d===void 0)return-1;if(d===f)continue;return s(d,f)}while(++l)}compareBuild(u){u instanceof a||(u=new a(u,this.options));let l=0;do{const d=this.build[l],f=u.build[l];if(e("build compare",l,d,f),d===void 0&&f===void 0)return 0;if(f===void 0)return 1;if(d===void 0)return-1;if(d===f)continue;return s(d,f)}while(++l)}inc(u,l,d){if(u.startsWith("pre")){if(!l&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(l){const f=`-${l}`.match(this.options.loose?r[o.PRERELEASELOOSE]:r[o.PRERELEASE]);if(!f||f[1]!==l)throw new Error(`invalid identifier: ${l}`)}}switch(u){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",l,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",l,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",l,d),this.inc("pre",l,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",l,d),this.inc("pre",l,d);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const f=Number(d)?1:0;if(this.prerelease.length===0)this.prerelease=[f];else{let m=this.prerelease.length;for(;--m>=0;)typeof this.prerelease[m]=="number"&&(this.prerelease[m]++,m=-2);if(m===-1){if(l===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(f)}}if(l){let m=[l,f];d===!1&&(m=[l]),s(this.prerelease[0],l)===0?isNaN(this.prerelease[1])&&(this.prerelease=m):this.prerelease=m}break}default:throw new Error(`invalid increment argument: ${u}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Kl=a,Kl}var Ql,Wh;function pA(){if(Wh)return Ql;Wh=1;const e=zh();return Ql=(n,r)=>new e(n,r).major,Ql}var hA=pA();const Hh=ul(hA);var Xl,Gh;function gA(){if(Gh)return Xl;Gh=1;const e=zh();return Xl=(n,r,o)=>new e(n,o).compare(new e(r,o)),Xl}var Yl,Kh;function mA(){if(Kh)return Yl;Kh=1;const e=gA();return Yl=(n,r,o)=>e(r,n,o),Yl}var yA=mA();const bA=ul(yA);class ki extends Error{constructor(n,...r){super([n,...r].filter(Boolean).join(", "));Ee(this,"name","RuntimeError");Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class vA extends ki{constructor(){super(...arguments);Ee(this,"name","ApiError")}}const Jl=(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)};class wA{constructor(t,n,r,o=ce([])){Ee(this,"clientService");Ee(this,"userStore");Ee(this,"serverUrl");Ee(this,"capability");Ee(this,"available");Ee(this,"fileIdsSupported");this.clientService=t,this.userStore=n,this.serverUrl=r,this.capability=B(()=>{const i=p(o).filter(s=>s.enabled).sort((s,a)=>bA(s.version,a.version));return i.length?i[0]:null}),this.available=B(()=>{var i;return!!((i=p(this.capability))!=null&&i.version)}),this.fileIdsSupported=B(()=>{var i;return Hh((i=p(this.capability))==null?void 0:i.version)>=2})}async triggerDownload(t){var o,i,s;if(!p(this.available))throw new ki("no archiver available");if((((o=t.fileIds)==null?void 0:o.length)||0)+(((i=t.files)==null?void 0:i.length)||0)===0)throw new ki("requested archive with empty list of resources");const n=this.buildDownloadUrl({...t});if(!n)throw new ki("download url could not be built");const r=t.publicToken?n:await this.clientService.ocsUserContext.signUrl(n,(s=this.userStore.user)==null?void 0:s.onPremisesSamAccountName);try{const a=await fetch(r,{headers:{...this.clientService.getRequestHeaders({useAuth:!t.publicLinkPassword}),...!!t.publicLinkPassword&&{Authorization:"Basic "+wr.from(["public",t.publicLinkPassword].join(":")).toString("base64")}}});if(!a.ok)throw new Z.HttpError("",a);const c=await a.blob(),u=URL.createObjectURL(c),l=this.getFileNameFromResponseHeaders(a.headers);return Jl(u,l),r}catch(a){throw new Z.HttpError("archive could not be fetched",a.response)}}buildDownloadUrl(t){const n=[];switch(t.publicToken&&n.push(`public-token=${t.publicToken}`),Hh(p(this.capability).version)){case 2:return n.push(...t.fileIds.map(o=>`id=${o}`)),this.url+"?"+n.join("&");case 1:{const o=Math.random().toString(36).substring(2);return n.push(`dir=${encodeURIComponent(t.dir)}`,...t.files.map(i=>`files[]=${encodeURIComponent(i)}`),`downloadStartSecret=${o}`),this.url+"?"+n.join("&")}default:return}}get url(){if(!this.available)throw new ki("no archiver available");const t=p(this.capability);return/^https?:\/\//i.test(t.archiver_url)?t.archiver_url:Z.urlJoin(this.serverUrl,t.archiver_url)}getFileNameFromResponseHeaders(t){var r;const n=(r=t.get("content-disposition"))==null?void 0:r.split('"')[1];return decodeURI(n)}}const SA=new $l({ttl:10*1e3,capacity:250}),EA=new $l({ttl:10*1e3,capacity:250});class TA{get avatarUrl(){return EA}get filePreview(){return SA}}const Zl=new TA;class Qh{constructor(t={}){Ee(this,"accessToken");Ee(this,"publicLinkToken");Ee(this,"publicLinkPassword");this.accessToken=t.accessToken,this.publicLinkToken=t.publicLinkToken,this.publicLinkPassword=t.publicLinkPassword}getHeaders(){return{...this.publicLinkToken&&{"public-token":this.publicLinkToken},...this.publicLinkPassword&&{Authorization:"Basic "+wr.from(["public",this.publicLinkPassword].join(":")).toString("base64")},...this.accessToken&&!this.publicLinkPassword&&{Authorization:"Bearer "+this.accessToken}}}}class ec{constructor(t,n){Ee(this,"instance");Ee(this,"cancelToken");this.cancelToken=Lo.CancelToken.source(),this.instance=Lo.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 uo({cancelToken:this.cancelToken.token},t)}processResponse(t,n){if(n!=null&&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 i=await this.instance[t](n,r,this.obtainConfig(o));return this.processResponse(i,o)}}class AA extends Error{constructor(){super(...arguments);Ee(this,"name","RetriableError")}}const RA=15e3;class _A{constructor(t,n){Ee(this,"url");Ee(this,"fetchOptions");Ee(this,"abortController");Ee(this,"eventListenerMap");Ee(this,"readyState");Ee(this,"withCredentials");Ee(this,"CONNECTING");Ee(this,"OPEN");Ee(this,"CLOSED");Ee(this,"onerror");Ee(this,"onmessage");Ee(this,"onopen");this.url=t,this.fetchOptions=n,this.abortController=new AbortController,this.eventListenerMap={},this.readyState=this.CONNECTING,this.connect()}connect(){return K0.fetchEventSource(this.url,{openWhenHidden:!0,signal:this.abortController.signal,fetch:this.fetchProvider.bind(this),onopen:async()=>{var n;const t=new Event("open");(n=this.onopen)==null||n.bind(this)(t),this.readyState=this.OPEN},onmessage:t=>{var i;const n=new MessageEvent("message",{data:t.data});(i=this.onmessage)==null||i.bind(this)(n);const r=t.event,o=this.eventListenerMap[r];o==null||o.forEach(s=>s(n))},onclose:()=>{throw this.readyState=this.CLOSED,new AA},onerror:t=>{var r;console.error(t);const n=new CustomEvent("error",{detail:t});return(r=this.onerror)==null||r.bind(this)(n),3e4+Math.floor(Math.random()*RA)}})}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){var r;this.eventListenerMap[t]=(r=this.eventListenerMap[t])==null?void 0:r.filter(o=>o!==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 tc=null;const IA=(e,t)=>(tc||(tc=new _A(new URL("ocs/v2.php/apps/notifications/api/v1/notifications/sse",e).href,t)),tc),CA=(e,t)=>({headers:{Authorization:`Bearer ${e.accessToken}`,"Accept-Language":t,"X-Request-ID":en.v4(),"X-Requested-With":"XMLHttpRequest"}});class PA{constructor(t){Ee(this,"configStore");Ee(this,"language");Ee(this,"authStore");Ee(this,"httpAuthenticatedClient");Ee(this,"httpUnAuthenticatedClient");Ee(this,"graphClient");Ee(this,"ocsClient");Ee(this,"webDavClient");Ee(this,"initiatorId",en.v4());Ee(this,"staticHeaders",{"Initiator-ID":this.initiatorId,"X-Requested-With":"XMLHttpRequest"});Ee(this,"getRequestHeaders",({useAuth:t=!0}={})=>({...this.staticHeaders,...this.getDynamicHeaders({useAuth:t})}));this.configStore=t.configStore,this.language=t.language,this.authStore=t.authStore,this.initGraphClient(),this.initOcsClient(),this.initWebDavClient(),this.httpAuthenticatedClient=new ec({baseURL:this.configStore.serverUrl,headers:this.staticHeaders},n=>(Object.assign(n.headers,this.getDynamicHeaders()),n)),this.httpUnAuthenticatedClient=new ec({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 IA(this.configStore.serverUrl,CA({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}initGraphClient(){const t=Lo.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=Lo.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 "+wr.from(["public",this.authStore.publicLinkPassword].join(":")).toString("base64")),t})}getDynamicHeaders({useAuth:t=!0}={}){return{"Accept-Language":this.currentLanguage,"X-Request-ID":en.v4(),...t&&{Authorization:"Bearer "+this.authStore.accessToken}}}}class Xh{constructor(){Ee(this,"topics");this.topics=new Map}subscribe(t,n){const r={token:en.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 Ke=new Xh;class Yh{isEnabled(){return!0}isActive(t){return ht(t,"files-spaces-projects")?!1:ht(t,"files-spaces-generic")||Fn(t,"files-public-link")}getTask(t){const{router:n,clientService:r,resourcesStore:o,authService:i,spacesStore:s,sharesStore:a,configStore:c}=t,{webdav:u,graphAuthenticated:l}=r,{replaceInvalidFileRoute:d}=Js({router:n});return pn.useTask(function*(f,m,w,y=null,E=null,b={}){try{o.clearResourceList();let{resource:g,children:v}=yield*Z.call(u.listFiles(w,{path:y,fileId:E},{signal:f}));g.id&&d({space:w,resource:g,path:y,fileId:E});let h;y==="/"&&(Z.isShareSpaceResource(w)?(h=yield*Z.call(vs({graphClient:l,spacesStore:s,space:w,signal:f})),h&&(g=Z.buildIncomingShareResource({graphRoles:a.graphRoles,driveItem:h,serverUrl:c.serverUrl}))):!Z.isPersonalSpaceResource(w)&&!Z.isPublicSpaceResource(w)&&(g=w)),yield o.loadAncestorMetaData({folder:g,space:w,client:u,signal:f}),Z.isProjectSpaceResource(w)&&(yield s.loadGraphPermissions({ids:[w.id],graphClient:l})),Z.isShareSpaceResource(w)&&(v.forEach(S=>S.remoteItemId=w.id),w.graphPermissions===void 0&&(h||(h=yield*Z.call(vs({graphClient:l,spacesStore:s,space:w,signal:f}))),Eh({sharesStore:a,spacesStore:s,space:w,sharedDriveItem:h}))),o.initResourceList({currentFolder:g,resources:v})}catch(g){if(o.setCurrentFolder(null),console.error(g),g.statusCode===401)return i.handleAuthError(p(n.currentRoute))}}).restartable()}}class Jh{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return Ct(t,"files-common-favorites")||((r=n==null?void 0:n.query)==null?void 0:r.contextRouteName)==="files-common-favorites"}getTask(t){const{resourcesStore:n,clientService:r,userStore:o}=t;return pn.useTask(function*(i,s){var c;n.clearResourceList(),n.setAncestorMetaData({});let a=yield r.webdav.listFavoriteFiles({username:(c=o.user)==null?void 0:c.onPremisesSamAccountName,signal:i});a=a.map(Z.buildResource),n.initResourceList({currentFolder:null,resources:a})})}}class Zh{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return jt(t,"files-shares-via-link")||((r=n==null?void 0:n.query)==null?void 0:r.contextRouteName)==="files-shares-via-link"}getTask(t){const{userStore:n,spacesStore:r,clientService:o,configStore:i,resourcesStore:s}=t;return pn.useTask(function*(a,c){s.clearResourceList(),s.setAncestorMetaData({}),i.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:o.graphAuthenticated,signal:a}));const l=(yield*Z.call(o.graphAuthenticated.driveItems.listSharedByMe({signal:a}))).filter(d=>d.permissions.some(({link:f})=>!!f)).map(d=>Z.buildOutgoingShareResource({driveItem:d,user:n.user,serverUrl:i.serverUrl}));s.initResourceList({currentFolder:null,resources:l})})}}class eg{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return jt(t,"files-shares-with-me")||((r=n==null?void 0:n.query)==null?void 0:r.contextRouteName)==="files-shares-with-me"}getTask(t){const{spacesStore:n,clientService:r,configStore:o,resourcesStore:i,sharesStore:s}=t;return pn.useTask(function*(a,c){i.clearResourceList(),i.setAncestorMetaData({}),o.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:r.graphAuthenticated,signal:a}));const l=(yield*Z.call(r.graphAuthenticated.driveItems.listSharedWithMe({signal:a}))).map(d=>Z.buildIncomingShareResource({driveItem:d,graphRoles:s.graphRoles,serverUrl:o.serverUrl}));i.initResourceList({currentFolder:null,resources:l})})}}class tg{isEnabled(){return!0}isActive(t){var r;const n=p(t.currentRoute);return jt(t,"files-shares-with-others")||((r=n==null?void 0:n.query)==null?void 0:r.contextRouteName)==="files-shares-with-others"}getTask(t){const{userStore:n,spacesStore:r,clientService:o,configStore:i,resourcesStore:s}=t;return pn.useTask(function*(a,c){s.clearResourceList(),s.setAncestorMetaData({}),i.options.routing.fullShareOwnerPaths&&(yield r.loadMountPoints({graphClient:o.graphAuthenticated,signal:a}));const l=(yield*Z.call(o.graphAuthenticated.driveItems.listSharedByMe({signal:a}))).filter(d=>d.permissions.some(({link:f})=>!f)).map(d=>Z.buildOutgoingShareResource({driveItem:d,user:n.user,serverUrl:i.serverUrl}));s.initResourceList({currentFolder:null,resources:l})})}}class On{}Ee(On,"Shared","S"),Ee(On,"Shareable","R"),Ee(On,"Mounted","M"),Ee(On,"Deletable","D"),Ee(On,"Renameable","N"),Ee(On,"Moveable","V"),Ee(On,"Updateable","NV"),Ee(On,"FileUpdateable","W"),Ee(On,"FolderCreateable","CK"),Ee(On,"Deny","Z"),Ee(On,"SecureView","X");const Ts=e=>({value:e,type:null}),FA=e=>Ts(e),gt=e=>Ts(e),nc=e=>Ts(e),OA=e=>Ts(e),kA={Permissions:gt("permissions"),IsFavorite:nc("favorite"),FileId:gt("fileid"),FileParent:gt("file-parent"),Name:gt("name"),OwnerId:gt("owner-id"),OwnerDisplayName:gt("owner-display-name"),PrivateLink:gt("privatelink"),ContentLength:nc("getcontentlength"),ContentSize:nc("size"),LastModifiedDate:gt("getlastmodified"),Tags:FA("tags"),Audio:{value:"audio",type:null},Location:{value:"location",type:null},Image:{value:"image",type:null},Photo:{value:"photo",type:null},ETag:gt("getetag"),MimeType:gt("getcontenttype"),ResourceType:OA("resourcetype"),LockDiscovery:{value:"lockdiscovery",type:null},LockOwner:gt("owner"),LockTime:gt("locktime"),ActiveLock:{value:"activelock",type:null},DownloadURL:gt("downloadURL"),Highlights:gt("highlights"),MetaPathForUser:gt("meta-path-for-user"),RemoteItemId:gt("remote-item-id"),ShareId:gt("shareid"),ShareRoot:gt("shareroot"),ShareTypes:{value:"share-types",type:null},SharePermissions:gt("share-permissions"),TrashbinOriginalFilename:gt("trashbin-original-filename"),TrashbinOriginalLocation:gt("trashbin-original-location"),TrashbinDeletedDate:gt("trashbin-delete-datetime"),PublicLinkItemType:gt("public-link-item-type"),PublicLinkPermission:gt("public-link-permission"),PublicLinkExpiration:gt("public-link-expiration"),PublicLinkShareDate:gt("public-link-share-datetime"),PublicLinkShareOwner:gt("public-link-share-owner")},je=Object.fromEntries(Object.entries(kA).map(([e,t])=>[e,t.value])),pi=class pi{};Ee(pi,"Default",[je.Permissions,je.IsFavorite,je.FileId,je.FileParent,je.Name,je.LockDiscovery,je.ActiveLock,je.OwnerId,je.OwnerDisplayName,je.RemoteItemId,je.ShareRoot,je.ShareTypes,je.PrivateLink,je.ContentLength,je.ContentSize,je.LastModifiedDate,je.ETag,je.MimeType,je.ResourceType,je.DownloadURL,je.Tags,je.Audio,je.Location,je.Image,je.Photo]),Ee(pi,"PublicLink",pi.Default.concat([je.PublicLinkItemType,je.PublicLinkPermission,je.PublicLinkExpiration,je.PublicLinkShareDate,je.PublicLinkShareOwner])),Ee(pi,"Trashbin",[je.ContentLength,je.ResourceType,je.TrashbinOriginalLocation,je.TrashbinOriginalFilename,je.TrashbinDeletedDate,je.Permissions,je.FileParent]),Ee(pi,"DavNamespace",[je.ContentLength,je.LastModifiedDate,je.ETag,je.MimeType,je.ResourceType,je.LockDiscovery,je.ActiveLock]);let As=pi;var rc={},Rs={exports:{}},ng;function ic(){if(ng)return Rs.exports;ng=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(S,T,R){return Function.prototype.apply.call(S,T,R)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(S){return Object.getOwnPropertyNames(S).concat(Object.getOwnPropertySymbols(S))}:n=function(S){return Object.getOwnPropertyNames(S)};function r(h){console&&console.warn&&console.warn(h)}var o=Number.isNaN||function(S){return S!==S};function i(){i.init.call(this)}Rs.exports=i,Rs.exports.once=b,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.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(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(h){if(typeof h!="number"||h<0||o(h))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+h+".");s=h}}),i.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},i.prototype.setMaxListeners=function(S){if(typeof S!="number"||S<0||o(S))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+S+".");return this._maxListeners=S,this};function c(h){return h._maxListeners===void 0?i.defaultMaxListeners:h._maxListeners}i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(S){for(var T=[],R=1;R<arguments.length;R++)T.push(arguments[R]);var _=S==="error",A=this._events;if(A!==void 0)_=_&&A.error===void 0;else if(!_)return!1;if(_){var $;if(T.length>0&&($=T[0]),$ instanceof Error)throw $;var D=new Error("Unhandled error."+($?" ("+$.message+")":""));throw D.context=$,D}var N=A[S];if(N===void 0)return!1;if(typeof N=="function")t(N,this,T);else for(var x=N.length,W=w(N,x),R=0;R<x;++R)t(W[R],this,T);return!0};function u(h,S,T,R){var _,A,$;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",S,T.listener?T.listener:T),A=h._events),$=A[S]),$===void 0)$=A[S]=T,++h._eventsCount;else if(typeof $=="function"?$=A[S]=R?[T,$]:[$,T]:R?$.unshift(T):$.push(T),_=c(h),_>0&&$.length>_&&!$.warned){$.warned=!0;var D=new Error("Possible EventEmitter memory leak detected. "+$.length+" "+String(S)+" listeners added. Use emitter.setMaxListeners() to increase limit");D.name="MaxListenersExceededWarning",D.emitter=h,D.type=S,D.count=$.length,r(D)}return h}i.prototype.addListener=function(S,T){return u(this,S,T,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(S,T){return u(this,S,T,!0)};function l(){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,S,T){var R={fired:!1,wrapFn:void 0,target:h,type:S,listener:T},_=l.bind(R);return _.listener=T,R.wrapFn=_,_}i.prototype.once=function(S,T){return a(T),this.on(S,d(this,S,T)),this},i.prototype.prependOnceListener=function(S,T){return a(T),this.prependListener(S,d(this,S,T)),this},i.prototype.removeListener=function(S,T){var R,_,A,$,D;if(a(T),_=this._events,_===void 0)return this;if(R=_[S],R===void 0)return this;if(R===T||R.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete _[S],_.removeListener&&this.emit("removeListener",S,R.listener||T));else if(typeof R!="function"){for(A=-1,$=R.length-1;$>=0;$--)if(R[$]===T||R[$].listener===T){D=R[$].listener,A=$;break}if(A<0)return this;A===0?R.shift():y(R,A),R.length===1&&(_[S]=R[0]),_.removeListener!==void 0&&this.emit("removeListener",S,D||T)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(S){var T,R,_;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[S]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete R[S]),this;if(arguments.length===0){var A=Object.keys(R),$;for(_=0;_<A.length;++_)$=A[_],$!=="removeListener"&&this.removeAllListeners($);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=R[S],typeof T=="function")this.removeListener(S,T);else if(T!==void 0)for(_=T.length-1;_>=0;_--)this.removeListener(S,T[_]);return this};function f(h,S,T){var R=h._events;if(R===void 0)return[];var _=R[S];return _===void 0?[]:typeof _=="function"?T?[_.listener||_]:[_]:T?E(_):w(_,_.length)}i.prototype.listeners=function(S){return f(this,S,!0)},i.prototype.rawListeners=function(S){return f(this,S,!1)},i.listenerCount=function(h,S){return typeof h.listenerCount=="function"?h.listenerCount(S):m.call(h,S)},i.prototype.listenerCount=m;function m(h){var S=this._events;if(S!==void 0){var T=S[h];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function w(h,S){for(var T=new Array(S),R=0;R<S;++R)T[R]=h[R];return T}function y(h,S){for(;S+1<h.length;S++)h[S]=h[S+1];h.pop()}function E(h){for(var S=new Array(h.length),T=0;T<S.length;++T)S[T]=h[T].listener||h[T];return S}function b(h,S){return new Promise(function(T,R){function _($){h.removeListener(S,A),R($)}function A(){typeof h.removeListener=="function"&&h.removeListener("error",_),T([].slice.call(arguments))}v(h,S,A,{once:!0}),S!=="error"&&g(h,_,{once:!0})})}function g(h,S,T){typeof h.on=="function"&&v(h,"error",S,T)}function v(h,S,T,R){if(typeof h.on=="function")R.once?h.once(S,T):h.on(S,T);else if(typeof h.addEventListener=="function")h.addEventListener(S,function _(A){R.once&&h.removeEventListener(S,_),T(A)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof h)}return Rs.exports}var _s={exports:{}},rg;function ni(){return rg||(rg=1,typeof Object.create=="function"?_s.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:_s.exports=function(t,n){if(n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t}}),_s.exports}var oc,ig;function og(){return ig||(ig=1,oc=ic().EventEmitter),oc}var sc={},sg;function Is(){return sg||(sg=1,function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t={},n={};n.byteLength=l,n.toByteArray=f,n.fromByteArray=y;for(var r=[],o=[],i=typeof Uint8Array<"u"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=s.length;a<c;++a)r[a]=s[a],o[s.charCodeAt(a)]=a;o[45]=62,o[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 S=h===v?0:4-h%4;return[h,S]}function l(g){var v=u(g),h=v[0],S=v[1];return(h+S)*3/4-S}function d(g,v,h){return(v+h)*3/4-h}function f(g){var v,h=u(g),S=h[0],T=h[1],R=new i(d(g,S,T)),_=0,A=T>0?S-4:S,$;for($=0;$<A;$+=4)v=o[g.charCodeAt($)]<<18|o[g.charCodeAt($+1)]<<12|o[g.charCodeAt($+2)]<<6|o[g.charCodeAt($+3)],R[_++]=v>>16&255,R[_++]=v>>8&255,R[_++]=v&255;return T===2&&(v=o[g.charCodeAt($)]<<2|o[g.charCodeAt($+1)]>>4,R[_++]=v&255),T===1&&(v=o[g.charCodeAt($)]<<10|o[g.charCodeAt($+1)]<<4|o[g.charCodeAt($+2)]>>2,R[_++]=v>>8&255,R[_++]=v&255),R}function m(g){return r[g>>18&63]+r[g>>12&63]+r[g>>6&63]+r[g&63]}function w(g,v,h){for(var S,T=[],R=v;R<h;R+=3)S=(g[R]<<16&16711680)+(g[R+1]<<8&65280)+(g[R+2]&255),T.push(m(S));return T.join("")}function y(g){for(var v,h=g.length,S=h%3,T=[],R=16383,_=0,A=h-S;_<A;_+=R)T.push(w(g,_,_+R>A?A:_+R));return S===1?(v=g[h-1],T.push(r[v>>2]+r[v<<4&63]+"==")):S===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 E={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */E.read=function(g,v,h,S,T){var R,_,A=T*8-S-1,$=(1<<A)-1,D=$>>1,N=-7,x=h?T-1:0,W=h?-1:1,K=g[v+x];for(x+=W,R=K&(1<<-N)-1,K>>=-N,N+=A;N>0;R=R*256+g[v+x],x+=W,N-=8);for(_=R&(1<<-N)-1,R>>=-N,N+=S;N>0;_=_*256+g[v+x],x+=W,N-=8);if(R===0)R=1-D;else{if(R===$)return _?NaN:(K?-1:1)*(1/0);_=_+Math.pow(2,S),R=R-D}return(K?-1:1)*_*Math.pow(2,R-S)},E.write=function(g,v,h,S,T,R){var _,A,$,D=R*8-T-1,N=(1<<D)-1,x=N>>1,W=T===23?Math.pow(2,-24)-Math.pow(2,-77):0,K=S?0:R-1,le=S?1:-1,be=v<0||v===0&&1/v<0?1:0;for(v=Math.abs(v),isNaN(v)||v===1/0?(A=isNaN(v)?1:0,_=N):(_=Math.floor(Math.log(v)/Math.LN2),v*($=Math.pow(2,-_))<1&&(_--,$*=2),_+x>=1?v+=W/$:v+=W*Math.pow(2,1-x),v*$>=2&&(_++,$/=2),_+x>=N?(A=0,_=N):_+x>=1?(A=(v*$-1)*Math.pow(2,T),_=_+x):(A=v*Math.pow(2,x-1)*Math.pow(2,T),_=0));T>=8;g[h+K]=A&255,K+=le,A/=256,T-=8);for(_=_<<T|A,D+=T;D>0;g[h+K]=_&255,K+=le,_/=256,D-=8);g[h+K-le]|=be*128};/*!
12
12
  * The buffer module from node.js, for the browser.
13
13
  *
14
14
  * @author Feross Aboukhadijeh <https://feross.org>
15
15
  * @license MIT
16
- */(function(g){const h=n,b=T,S=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;g.Buffer=x,g.SlowBuffer=oe,g.INSPECT_MAX_BYTES=50;const E=2147483647;g.kMaxLength=E;const{Uint8Array:I,ArrayBuffer:R,SharedArrayBuffer:A}=globalThis;x.TYPED_ARRAY_SUPPORT=N(),!x.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 N(){try{const U=new I(1),P={foo:function(){return 42}};return Object.setPrototypeOf(P,I.prototype),Object.setPrototypeOf(U,P),U.foo()===42}catch{return!1}}Object.defineProperty(x.prototype,"parent",{enumerable:!0,get:function(){if(x.isBuffer(this))return this.buffer}}),Object.defineProperty(x.prototype,"offset",{enumerable:!0,get:function(){if(x.isBuffer(this))return this.byteOffset}});function L(U){if(U>E)throw new RangeError('The value "'+U+'" is invalid for option "size"');const P=new I(U);return Object.setPrototypeOf(P,x.prototype),P}function x(U,P,k){if(typeof U=="number"){if(typeof P=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return ee(U)}return $(U,P,k)}x.poolSize=8192;function $(U,P,k){if(typeof U=="string")return se(U,P);if(R.isView(U))return re(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(Un(U,R)||U&&Un(U.buffer,R)||typeof A<"u"&&(Un(U,A)||U&&Un(U.buffer,A)))return fe(U,P,k);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 x.from(Q,P,k);const ae=ue(U);if(ae)return ae;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof U[Symbol.toPrimitive]=="function")return x.from(U[Symbol.toPrimitive]("string"),P,k);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U)}x.from=function(U,P,k){return $(U,P,k)},Object.setPrototypeOf(x.prototype,I.prototype),Object.setPrototypeOf(x,I);function V(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 X(U,P,k){return V(U),U<=0?L(U):P!==void 0?typeof k=="string"?L(U).fill(P,k):L(U).fill(P):L(U)}x.alloc=function(U,P,k){return X(U,P,k)};function ee(U){return V(U),L(U<0?0:Z(U)|0)}x.allocUnsafe=function(U){return ee(U)},x.allocUnsafeSlow=function(U){return ee(U)};function se(U,P){if((typeof P!="string"||P==="")&&(P="utf8"),!x.isEncoding(P))throw new TypeError("Unknown encoding: "+P);const k=ce(U,P)|0;let Q=L(k);const ae=Q.write(U,P);return ae!==k&&(Q=Q.slice(0,ae)),Q}function ie(U){const P=U.length<0?0:Z(U.length)|0,k=L(P);for(let Q=0;Q<P;Q+=1)k[Q]=U[Q]&255;return k}function re(U){if(Un(U,I)){const P=new I(U);return fe(P.buffer,P.byteOffset,P.byteLength)}return ie(U)}function fe(U,P,k){if(P<0||U.byteLength<P)throw new RangeError('"offset" is outside of buffer bounds');if(U.byteLength<P+(k||0))throw new RangeError('"length" is outside of buffer bounds');let Q;return P===void 0&&k===void 0?Q=new I(U):k===void 0?Q=new I(U,P):Q=new I(U,P,k),Object.setPrototypeOf(Q,x.prototype),Q}function ue(U){if(x.isBuffer(U)){const P=Z(U.length)|0,k=L(P);return k.length===0||U.copy(k,0,0,P),k}if(U.length!==void 0)return typeof U.length!="number"||Ne(U.length)?L(0):ie(U);if(U.type==="Buffer"&&Array.isArray(U.data))return ie(U.data)}function Z(U){if(U>=E)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+E.toString(16)+" bytes");return U|0}function oe(U){return+U!=U&&(U=0),x.alloc(+U)}x.isBuffer=function(P){return P!=null&&P._isBuffer===!0&&P!==x.prototype},x.compare=function(P,k){if(Un(P,I)&&(P=x.from(P,P.offset,P.byteLength)),Un(k,I)&&(k=x.from(k,k.offset,k.byteLength)),!x.isBuffer(P)||!x.isBuffer(k))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(P===k)return 0;let Q=P.length,ae=k.length;for(let be=0,Re=Math.min(Q,ae);be<Re;++be)if(P[be]!==k[be]){Q=P[be],ae=k[be];break}return Q<ae?-1:ae<Q?1:0},x.isEncoding=function(P){switch(String(P).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}},x.concat=function(P,k){if(!Array.isArray(P))throw new TypeError('"list" argument must be an Array of Buffers');if(P.length===0)return x.alloc(0);let Q;if(k===void 0)for(k=0,Q=0;Q<P.length;++Q)k+=P[Q].length;const ae=x.allocUnsafe(k);let be=0;for(Q=0;Q<P.length;++Q){let Re=P[Q];if(Un(Re,I))be+Re.length>ae.length?(x.isBuffer(Re)||(Re=x.from(Re)),Re.copy(ae,be)):I.prototype.set.call(ae,Re,be);else if(x.isBuffer(Re))Re.copy(ae,be);else throw new TypeError('"list" argument must be an Array of Buffers');be+=Re.length}return ae};function ce(U,P){if(x.isBuffer(U))return U.length;if(R.isView(U)||Un(U,R))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 k=U.length,Q=arguments.length>2&&arguments[2]===!0;if(!Q&&k===0)return 0;let ae=!1;for(;;)switch(P){case"ascii":case"latin1":case"binary":return k;case"utf8":case"utf-8":return ut(U).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k*2;case"hex":return k>>>1;case"base64":return ot(U).length;default:if(ae)return Q?-1:ut(U).length;P=(""+P).toLowerCase(),ae=!0}}x.byteLength=ce;function Ce(U,P,k){let Q=!1;if((P===void 0||P<0)&&(P=0),P>this.length||((k===void 0||k>this.length)&&(k=this.length),k<=0)||(k>>>=0,P>>>=0,k<=P))return"";for(U||(U="utf8");;)switch(U){case"hex":return xe(this,P,k);case"utf8":case"utf-8":return De(this,P,k);case"ascii":return Le(this,P,k);case"latin1":case"binary":return Y(this,P,k);case"base64":return Ae(this,P,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Me(this,P,k);default:if(Q)throw new TypeError("Unknown encoding: "+U);U=(U+"").toLowerCase(),Q=!0}}x.prototype._isBuffer=!0;function H(U,P,k){const Q=U[P];U[P]=U[k],U[k]=Q}x.prototype.swap16=function(){const P=this.length;if(P%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let k=0;k<P;k+=2)H(this,k,k+1);return this},x.prototype.swap32=function(){const P=this.length;if(P%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let k=0;k<P;k+=4)H(this,k,k+3),H(this,k+1,k+2);return this},x.prototype.swap64=function(){const P=this.length;if(P%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let k=0;k<P;k+=8)H(this,k,k+7),H(this,k+1,k+6),H(this,k+2,k+5),H(this,k+3,k+4);return this},x.prototype.toString=function(){const P=this.length;return P===0?"":arguments.length===0?De(this,0,P):Ce.apply(this,arguments)},x.prototype.toLocaleString=x.prototype.toString,x.prototype.equals=function(P){if(!x.isBuffer(P))throw new TypeError("Argument must be a Buffer");return this===P?!0:x.compare(this,P)===0},x.prototype.inspect=function(){let P="";const k=g.INSPECT_MAX_BYTES;return P=this.toString("hex",0,k).replace(/(.{2})/g,"$1 ").trim(),this.length>k&&(P+=" ... "),"<Buffer "+P+">"},S&&(x.prototype[S]=x.prototype.inspect),x.prototype.compare=function(P,k,Q,ae,be){if(Un(P,I)&&(P=x.from(P,P.offset,P.byteLength)),!x.isBuffer(P))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof P);if(k===void 0&&(k=0),Q===void 0&&(Q=P?P.length:0),ae===void 0&&(ae=0),be===void 0&&(be=this.length),k<0||Q>P.length||ae<0||be>this.length)throw new RangeError("out of range index");if(ae>=be&&k>=Q)return 0;if(ae>=be)return-1;if(k>=Q)return 1;if(k>>>=0,Q>>>=0,ae>>>=0,be>>>=0,this===P)return 0;let Re=be-ae,tt=Q-k;const $t=Math.min(Re,tt),Pt=this.slice(ae,be),Dt=P.slice(k,Q);for(let mt=0;mt<$t;++mt)if(Pt[mt]!==Dt[mt]){Re=Pt[mt],tt=Dt[mt];break}return Re<tt?-1:tt<Re?1:0};function _(U,P,k,Q,ae){if(U.length===0)return-1;if(typeof k=="string"?(Q=k,k=0):k>2147483647?k=2147483647:k<-2147483648&&(k=-2147483648),k=+k,Ne(k)&&(k=ae?0:U.length-1),k<0&&(k=U.length+k),k>=U.length){if(ae)return-1;k=U.length-1}else if(k<0)if(ae)k=0;else return-1;if(typeof P=="string"&&(P=x.from(P,Q)),x.isBuffer(P))return P.length===0?-1:F(U,P,k,Q,ae);if(typeof P=="number")return P=P&255,typeof I.prototype.indexOf=="function"?ae?I.prototype.indexOf.call(U,P,k):I.prototype.lastIndexOf.call(U,P,k):F(U,[P],k,Q,ae);throw new TypeError("val must be string, number or Buffer")}function F(U,P,k,Q,ae){let be=1,Re=U.length,tt=P.length;if(Q!==void 0&&(Q=String(Q).toLowerCase(),Q==="ucs2"||Q==="ucs-2"||Q==="utf16le"||Q==="utf-16le")){if(U.length<2||P.length<2)return-1;be=2,Re/=2,tt/=2,k/=2}function $t(Dt,mt){return be===1?Dt[mt]:Dt.readUInt16BE(mt*be)}let Pt;if(ae){let Dt=-1;for(Pt=k;Pt<Re;Pt++)if($t(U,Pt)===$t(P,Dt===-1?0:Pt-Dt)){if(Dt===-1&&(Dt=Pt),Pt-Dt+1===tt)return Dt*be}else Dt!==-1&&(Pt-=Pt-Dt),Dt=-1}else for(k+tt>Re&&(k=Re-tt),Pt=k;Pt>=0;Pt--){let Dt=!0;for(let mt=0;mt<tt;mt++)if($t(U,Pt+mt)!==$t(P,mt)){Dt=!1;break}if(Dt)return Pt}return-1}x.prototype.includes=function(P,k,Q){return this.indexOf(P,k,Q)!==-1},x.prototype.indexOf=function(P,k,Q){return _(this,P,k,Q,!0)},x.prototype.lastIndexOf=function(P,k,Q){return _(this,P,k,Q,!1)};function G(U,P,k,Q){k=Number(k)||0;const ae=U.length-k;Q?(Q=Number(Q),Q>ae&&(Q=ae)):Q=ae;const be=P.length;Q>be/2&&(Q=be/2);let Re;for(Re=0;Re<Q;++Re){const tt=parseInt(P.substr(Re*2,2),16);if(Ne(tt))return Re;U[k+Re]=tt}return Re}function z(U,P,k,Q){return Vi(ut(P,U.length-k),U,k,Q)}function M(U,P,k,Q){return Vi(ft(P),U,k,Q)}function q(U,P,k,Q){return Vi(ot(P),U,k,Q)}function de(U,P,k,Q){return Vi(gt(P,U.length-k),U,k,Q)}x.prototype.write=function(P,k,Q,ae){if(k===void 0)ae="utf8",Q=this.length,k=0;else if(Q===void 0&&typeof k=="string")ae=k,Q=this.length,k=0;else if(isFinite(k))k=k>>>0,isFinite(Q)?(Q=Q>>>0,ae===void 0&&(ae="utf8")):(ae=Q,Q=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const be=this.length-k;if((Q===void 0||Q>be)&&(Q=be),P.length>0&&(Q<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");ae||(ae="utf8");let Re=!1;for(;;)switch(ae){case"hex":return G(this,P,k,Q);case"utf8":case"utf-8":return z(this,P,k,Q);case"ascii":case"latin1":case"binary":return M(this,P,k,Q);case"base64":return q(this,P,k,Q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return de(this,P,k,Q);default:if(Re)throw new TypeError("Unknown encoding: "+ae);ae=(""+ae).toLowerCase(),Re=!0}},x.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ae(U,P,k){return P===0&&k===U.length?h.fromByteArray(U):h.fromByteArray(U.slice(P,k))}function De(U,P,k){k=Math.min(U.length,k);const Q=[];let ae=P;for(;ae<k;){const be=U[ae];let Re=null,tt=be>239?4:be>223?3:be>191?2:1;if(ae+tt<=k){let $t,Pt,Dt,mt;switch(tt){case 1:be<128&&(Re=be);break;case 2:$t=U[ae+1],($t&192)===128&&(mt=(be&31)<<6|$t&63,mt>127&&(Re=mt));break;case 3:$t=U[ae+1],Pt=U[ae+2],($t&192)===128&&(Pt&192)===128&&(mt=(be&15)<<12|($t&63)<<6|Pt&63,mt>2047&&(mt<55296||mt>57343)&&(Re=mt));break;case 4:$t=U[ae+1],Pt=U[ae+2],Dt=U[ae+3],($t&192)===128&&(Pt&192)===128&&(Dt&192)===128&&(mt=(be&15)<<18|($t&63)<<12|(Pt&63)<<6|Dt&63,mt>65535&&mt<1114112&&(Re=mt))}}Re===null?(Re=65533,tt=1):Re>65535&&(Re-=65536,Q.push(Re>>>10&1023|55296),Re=56320|Re&1023),Q.push(Re),ae+=tt}return _e(Q)}const ke=4096;function _e(U){const P=U.length;if(P<=ke)return String.fromCharCode.apply(String,U);let k="",Q=0;for(;Q<P;)k+=String.fromCharCode.apply(String,U.slice(Q,Q+=ke));return k}function Le(U,P,k){let Q="";k=Math.min(U.length,k);for(let ae=P;ae<k;++ae)Q+=String.fromCharCode(U[ae]&127);return Q}function Y(U,P,k){let Q="";k=Math.min(U.length,k);for(let ae=P;ae<k;++ae)Q+=String.fromCharCode(U[ae]);return Q}function xe(U,P,k){const Q=U.length;(!P||P<0)&&(P=0),(!k||k<0||k>Q)&&(k=Q);let ae="";for(let be=P;be<k;++be)ae+=Je[U[be]];return ae}function Me(U,P,k){const Q=U.slice(P,k);let ae="";for(let be=0;be<Q.length-1;be+=2)ae+=String.fromCharCode(Q[be]+Q[be+1]*256);return ae}x.prototype.slice=function(P,k){const Q=this.length;P=~~P,k=k===void 0?Q:~~k,P<0?(P+=Q,P<0&&(P=0)):P>Q&&(P=Q),k<0?(k+=Q,k<0&&(k=0)):k>Q&&(k=Q),k<P&&(k=P);const ae=this.subarray(P,k);return Object.setPrototypeOf(ae,x.prototype),ae};function Ve(U,P,k){if(U%1!==0||U<0)throw new RangeError("offset is not uint");if(U+P>k)throw new RangeError("Trying to access beyond buffer length")}x.prototype.readUintLE=x.prototype.readUIntLE=function(P,k,Q){P=P>>>0,k=k>>>0,Q||Ve(P,k,this.length);let ae=this[P],be=1,Re=0;for(;++Re<k&&(be*=256);)ae+=this[P+Re]*be;return ae},x.prototype.readUintBE=x.prototype.readUIntBE=function(P,k,Q){P=P>>>0,k=k>>>0,Q||Ve(P,k,this.length);let ae=this[P+--k],be=1;for(;k>0&&(be*=256);)ae+=this[P+--k]*be;return ae},x.prototype.readUint8=x.prototype.readUInt8=function(P,k){return P=P>>>0,k||Ve(P,1,this.length),this[P]},x.prototype.readUint16LE=x.prototype.readUInt16LE=function(P,k){return P=P>>>0,k||Ve(P,2,this.length),this[P]|this[P+1]<<8},x.prototype.readUint16BE=x.prototype.readUInt16BE=function(P,k){return P=P>>>0,k||Ve(P,2,this.length),this[P]<<8|this[P+1]},x.prototype.readUint32LE=x.prototype.readUInt32LE=function(P,k){return P=P>>>0,k||Ve(P,4,this.length),(this[P]|this[P+1]<<8|this[P+2]<<16)+this[P+3]*16777216},x.prototype.readUint32BE=x.prototype.readUInt32BE=function(P,k){return P=P>>>0,k||Ve(P,4,this.length),this[P]*16777216+(this[P+1]<<16|this[P+2]<<8|this[P+3])},x.prototype.readBigUInt64LE=st(function(P){P=P>>>0,ne(P,"offset");const k=this[P],Q=this[P+7];(k===void 0||Q===void 0)&&he(P,this.length-8);const ae=k+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24,be=this[++P]+this[++P]*2**8+this[++P]*2**16+Q*2**24;return BigInt(ae)+(BigInt(be)<<BigInt(32))}),x.prototype.readBigUInt64BE=st(function(P){P=P>>>0,ne(P,"offset");const k=this[P],Q=this[P+7];(k===void 0||Q===void 0)&&he(P,this.length-8);const ae=k*2**24+this[++P]*2**16+this[++P]*2**8+this[++P],be=this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+Q;return(BigInt(ae)<<BigInt(32))+BigInt(be)}),x.prototype.readIntLE=function(P,k,Q){P=P>>>0,k=k>>>0,Q||Ve(P,k,this.length);let ae=this[P],be=1,Re=0;for(;++Re<k&&(be*=256);)ae+=this[P+Re]*be;return be*=128,ae>=be&&(ae-=Math.pow(2,8*k)),ae},x.prototype.readIntBE=function(P,k,Q){P=P>>>0,k=k>>>0,Q||Ve(P,k,this.length);let ae=k,be=1,Re=this[P+--ae];for(;ae>0&&(be*=256);)Re+=this[P+--ae]*be;return be*=128,Re>=be&&(Re-=Math.pow(2,8*k)),Re},x.prototype.readInt8=function(P,k){return P=P>>>0,k||Ve(P,1,this.length),this[P]&128?(255-this[P]+1)*-1:this[P]},x.prototype.readInt16LE=function(P,k){P=P>>>0,k||Ve(P,2,this.length);const Q=this[P]|this[P+1]<<8;return Q&32768?Q|4294901760:Q},x.prototype.readInt16BE=function(P,k){P=P>>>0,k||Ve(P,2,this.length);const Q=this[P+1]|this[P]<<8;return Q&32768?Q|4294901760:Q},x.prototype.readInt32LE=function(P,k){return P=P>>>0,k||Ve(P,4,this.length),this[P]|this[P+1]<<8|this[P+2]<<16|this[P+3]<<24},x.prototype.readInt32BE=function(P,k){return P=P>>>0,k||Ve(P,4,this.length),this[P]<<24|this[P+1]<<16|this[P+2]<<8|this[P+3]},x.prototype.readBigInt64LE=st(function(P){P=P>>>0,ne(P,"offset");const k=this[P],Q=this[P+7];(k===void 0||Q===void 0)&&he(P,this.length-8);const ae=this[P+4]+this[P+5]*2**8+this[P+6]*2**16+(Q<<24);return(BigInt(ae)<<BigInt(32))+BigInt(k+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24)}),x.prototype.readBigInt64BE=st(function(P){P=P>>>0,ne(P,"offset");const k=this[P],Q=this[P+7];(k===void 0||Q===void 0)&&he(P,this.length-8);const ae=(k<<24)+this[++P]*2**16+this[++P]*2**8+this[++P];return(BigInt(ae)<<BigInt(32))+BigInt(this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+Q)}),x.prototype.readFloatLE=function(P,k){return P=P>>>0,k||Ve(P,4,this.length),b.read(this,P,!0,23,4)},x.prototype.readFloatBE=function(P,k){return P=P>>>0,k||Ve(P,4,this.length),b.read(this,P,!1,23,4)},x.prototype.readDoubleLE=function(P,k){return P=P>>>0,k||Ve(P,8,this.length),b.read(this,P,!0,52,8)},x.prototype.readDoubleBE=function(P,k){return P=P>>>0,k||Ve(P,8,this.length),b.read(this,P,!1,52,8)};function Ze(U,P,k,Q,ae,be){if(!x.isBuffer(U))throw new TypeError('"buffer" argument must be a Buffer instance');if(P>ae||P<be)throw new RangeError('"value" argument is out of bounds');if(k+Q>U.length)throw new RangeError("Index out of range")}x.prototype.writeUintLE=x.prototype.writeUIntLE=function(P,k,Q,ae){if(P=+P,k=k>>>0,Q=Q>>>0,!ae){const tt=Math.pow(2,8*Q)-1;Ze(this,P,k,Q,tt,0)}let be=1,Re=0;for(this[k]=P&255;++Re<Q&&(be*=256);)this[k+Re]=P/be&255;return k+Q},x.prototype.writeUintBE=x.prototype.writeUIntBE=function(P,k,Q,ae){if(P=+P,k=k>>>0,Q=Q>>>0,!ae){const tt=Math.pow(2,8*Q)-1;Ze(this,P,k,Q,tt,0)}let be=Q-1,Re=1;for(this[k+be]=P&255;--be>=0&&(Re*=256);)this[k+be]=P/Re&255;return k+Q},x.prototype.writeUint8=x.prototype.writeUInt8=function(P,k,Q){return P=+P,k=k>>>0,Q||Ze(this,P,k,1,255,0),this[k]=P&255,k+1},x.prototype.writeUint16LE=x.prototype.writeUInt16LE=function(P,k,Q){return P=+P,k=k>>>0,Q||Ze(this,P,k,2,65535,0),this[k]=P&255,this[k+1]=P>>>8,k+2},x.prototype.writeUint16BE=x.prototype.writeUInt16BE=function(P,k,Q){return P=+P,k=k>>>0,Q||Ze(this,P,k,2,65535,0),this[k]=P>>>8,this[k+1]=P&255,k+2},x.prototype.writeUint32LE=x.prototype.writeUInt32LE=function(P,k,Q){return P=+P,k=k>>>0,Q||Ze(this,P,k,4,4294967295,0),this[k+3]=P>>>24,this[k+2]=P>>>16,this[k+1]=P>>>8,this[k]=P&255,k+4},x.prototype.writeUint32BE=x.prototype.writeUInt32BE=function(P,k,Q){return P=+P,k=k>>>0,Q||Ze(this,P,k,4,4294967295,0),this[k]=P>>>24,this[k+1]=P>>>16,this[k+2]=P>>>8,this[k+3]=P&255,k+4};function kt(U,P,k,Q,ae){K(P,Q,ae,U,k,7);let be=Number(P&BigInt(4294967295));U[k++]=be,be=be>>8,U[k++]=be,be=be>>8,U[k++]=be,be=be>>8,U[k++]=be;let Re=Number(P>>BigInt(32)&BigInt(4294967295));return U[k++]=Re,Re=Re>>8,U[k++]=Re,Re=Re>>8,U[k++]=Re,Re=Re>>8,U[k++]=Re,k}function Rt(U,P,k,Q,ae){K(P,Q,ae,U,k,7);let be=Number(P&BigInt(4294967295));U[k+7]=be,be=be>>8,U[k+6]=be,be=be>>8,U[k+5]=be,be=be>>8,U[k+4]=be;let Re=Number(P>>BigInt(32)&BigInt(4294967295));return U[k+3]=Re,Re=Re>>8,U[k+2]=Re,Re=Re>>8,U[k+1]=Re,Re=Re>>8,U[k]=Re,k+8}x.prototype.writeBigUInt64LE=st(function(P,k=0){return kt(this,P,k,BigInt(0),BigInt("0xffffffffffffffff"))}),x.prototype.writeBigUInt64BE=st(function(P,k=0){return Rt(this,P,k,BigInt(0),BigInt("0xffffffffffffffff"))}),x.prototype.writeIntLE=function(P,k,Q,ae){if(P=+P,k=k>>>0,!ae){const $t=Math.pow(2,8*Q-1);Ze(this,P,k,Q,$t-1,-$t)}let be=0,Re=1,tt=0;for(this[k]=P&255;++be<Q&&(Re*=256);)P<0&&tt===0&&this[k+be-1]!==0&&(tt=1),this[k+be]=(P/Re>>0)-tt&255;return k+Q},x.prototype.writeIntBE=function(P,k,Q,ae){if(P=+P,k=k>>>0,!ae){const $t=Math.pow(2,8*Q-1);Ze(this,P,k,Q,$t-1,-$t)}let be=Q-1,Re=1,tt=0;for(this[k+be]=P&255;--be>=0&&(Re*=256);)P<0&&tt===0&&this[k+be+1]!==0&&(tt=1),this[k+be]=(P/Re>>0)-tt&255;return k+Q},x.prototype.writeInt8=function(P,k,Q){return P=+P,k=k>>>0,Q||Ze(this,P,k,1,127,-128),P<0&&(P=255+P+1),this[k]=P&255,k+1},x.prototype.writeInt16LE=function(P,k,Q){return P=+P,k=k>>>0,Q||Ze(this,P,k,2,32767,-32768),this[k]=P&255,this[k+1]=P>>>8,k+2},x.prototype.writeInt16BE=function(P,k,Q){return P=+P,k=k>>>0,Q||Ze(this,P,k,2,32767,-32768),this[k]=P>>>8,this[k+1]=P&255,k+2},x.prototype.writeInt32LE=function(P,k,Q){return P=+P,k=k>>>0,Q||Ze(this,P,k,4,2147483647,-2147483648),this[k]=P&255,this[k+1]=P>>>8,this[k+2]=P>>>16,this[k+3]=P>>>24,k+4},x.prototype.writeInt32BE=function(P,k,Q){return P=+P,k=k>>>0,Q||Ze(this,P,k,4,2147483647,-2147483648),P<0&&(P=4294967295+P+1),this[k]=P>>>24,this[k+1]=P>>>16,this[k+2]=P>>>8,this[k+3]=P&255,k+4},x.prototype.writeBigInt64LE=st(function(P,k=0){return kt(this,P,k,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),x.prototype.writeBigInt64BE=st(function(P,k=0){return Rt(this,P,k,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Nt(U,P,k,Q,ae,be){if(k+Q>U.length)throw new RangeError("Index out of range");if(k<0)throw new RangeError("Index out of range")}function Be(U,P,k,Q,ae){return P=+P,k=k>>>0,ae||Nt(U,P,k,4),b.write(U,P,k,Q,23,4),k+4}x.prototype.writeFloatLE=function(P,k,Q){return Be(this,P,k,!0,Q)},x.prototype.writeFloatBE=function(P,k,Q){return Be(this,P,k,!1,Q)};function ze(U,P,k,Q,ae){return P=+P,k=k>>>0,ae||Nt(U,P,k,8),b.write(U,P,k,Q,52,8),k+8}x.prototype.writeDoubleLE=function(P,k,Q){return ze(this,P,k,!0,Q)},x.prototype.writeDoubleBE=function(P,k,Q){return ze(this,P,k,!1,Q)},x.prototype.copy=function(P,k,Q,ae){if(!x.isBuffer(P))throw new TypeError("argument should be a Buffer");if(Q||(Q=0),!ae&&ae!==0&&(ae=this.length),k>=P.length&&(k=P.length),k||(k=0),ae>0&&ae<Q&&(ae=Q),ae===Q||P.length===0||this.length===0)return 0;if(k<0)throw new RangeError("targetStart out of bounds");if(Q<0||Q>=this.length)throw new RangeError("Index out of range");if(ae<0)throw new RangeError("sourceEnd out of bounds");ae>this.length&&(ae=this.length),P.length-k<ae-Q&&(ae=P.length-k+Q);const be=ae-Q;return this===P&&typeof I.prototype.copyWithin=="function"?this.copyWithin(k,Q,ae):I.prototype.set.call(P,this.subarray(Q,ae),k),be},x.prototype.fill=function(P,k,Q,ae){if(typeof P=="string"){if(typeof k=="string"?(ae=k,k=0,Q=this.length):typeof Q=="string"&&(ae=Q,Q=this.length),ae!==void 0&&typeof ae!="string")throw new TypeError("encoding must be a string");if(typeof ae=="string"&&!x.isEncoding(ae))throw new TypeError("Unknown encoding: "+ae);if(P.length===1){const Re=P.charCodeAt(0);(ae==="utf8"&&Re<128||ae==="latin1")&&(P=Re)}}else typeof P=="number"?P=P&255:typeof P=="boolean"&&(P=Number(P));if(k<0||this.length<k||this.length<Q)throw new RangeError("Out of range index");if(Q<=k)return this;k=k>>>0,Q=Q===void 0?this.length:Q>>>0,P||(P=0);let be;if(typeof P=="number")for(be=k;be<Q;++be)this[be]=P;else{const Re=x.isBuffer(P)?P:x.from(P,ae),tt=Re.length;if(tt===0)throw new TypeError('The value "'+P+'" is invalid for argument "value"');for(be=0;be<Q-k;++be)this[be+k]=Re[be%tt]}return this};const pn={};function B(U,P,k){pn[U]=class extends k{constructor(){super(),Object.defineProperty(this,"message",{value:P.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${U}]`,this.stack,delete this.name}get code(){return U}set code(ae){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ae,writable:!0})}toString(){return`${this.name} [${U}]: ${this.message}`}}}B("ERR_BUFFER_OUT_OF_BOUNDS",function(U){return U?`${U} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),B("ERR_INVALID_ARG_TYPE",function(U,P){return`The "${U}" argument must be of type number. Received type ${typeof P}`},TypeError),B("ERR_OUT_OF_RANGE",function(U,P,k){let Q=`The value of "${U}" is out of range.`,ae=k;return Number.isInteger(k)&&Math.abs(k)>2**32?ae=C(String(k)):typeof k=="bigint"&&(ae=String(k),(k>BigInt(2)**BigInt(32)||k<-(BigInt(2)**BigInt(32)))&&(ae=C(ae)),ae+="n"),Q+=` It must be ${P}. Received ${ae}`,Q},RangeError);function C(U){let P="",k=U.length;const Q=U[0]==="-"?1:0;for(;k>=Q+4;k-=3)P=`_${U.slice(k-3,k)}${P}`;return`${U.slice(0,k)}${P}`}function O(U,P,k){ne(P,"offset"),(U[P]===void 0||U[P+k]===void 0)&&he(P,U.length-(k+1))}function K(U,P,k,Q,ae,be){if(U>k||U<P){const Re=typeof P=="bigint"?"n":"";let tt;throw P===0||P===BigInt(0)?tt=`>= 0${Re} and < 2${Re} ** ${(be+1)*8}${Re}`:tt=`>= -(2${Re} ** ${(be+1)*8-1}${Re}) and < 2 ** ${(be+1)*8-1}${Re}`,new pn.ERR_OUT_OF_RANGE("value",tt,U)}O(Q,ae,be)}function ne(U,P){if(typeof U!="number")throw new pn.ERR_INVALID_ARG_TYPE(P,"number",U)}function he(U,P,k){throw Math.floor(U)!==U?(ne(U,k),new pn.ERR_OUT_OF_RANGE("offset","an integer",U)):P<0?new pn.ERR_BUFFER_OUT_OF_BOUNDS:new pn.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${P}`,U)}const Te=/[^+/0-9A-Za-z-_]/g;function Ye(U){if(U=U.split("=")[0],U=U.trim().replace(Te,""),U.length<2)return"";for(;U.length%4!==0;)U=U+"=";return U}function ut(U,P){P=P||1/0;let k;const Q=U.length;let ae=null;const be=[];for(let Re=0;Re<Q;++Re){if(k=U.charCodeAt(Re),k>55295&&k<57344){if(!ae){if(k>56319){(P-=3)>-1&&be.push(239,191,189);continue}else if(Re+1===Q){(P-=3)>-1&&be.push(239,191,189);continue}ae=k;continue}if(k<56320){(P-=3)>-1&&be.push(239,191,189),ae=k;continue}k=(ae-55296<<10|k-56320)+65536}else ae&&(P-=3)>-1&&be.push(239,191,189);if(ae=null,k<128){if((P-=1)<0)break;be.push(k)}else if(k<2048){if((P-=2)<0)break;be.push(k>>6|192,k&63|128)}else if(k<65536){if((P-=3)<0)break;be.push(k>>12|224,k>>6&63|128,k&63|128)}else if(k<1114112){if((P-=4)<0)break;be.push(k>>18|240,k>>12&63|128,k>>6&63|128,k&63|128)}else throw new Error("Invalid code point")}return be}function ft(U){const P=[];for(let k=0;k<U.length;++k)P.push(U.charCodeAt(k)&255);return P}function gt(U,P){let k,Q,ae;const be=[];for(let Re=0;Re<U.length&&!((P-=2)<0);++Re)k=U.charCodeAt(Re),Q=k>>8,ae=k%256,be.push(ae),be.push(Q);return be}function ot(U){return h.toByteArray(Ye(U))}function Vi(U,P,k,Q){let ae;for(ae=0;ae<Q&&!(ae+k>=P.length||ae>=U.length);++ae)P[ae+k]=U[ae];return ae}function Un(U,P){return U instanceof P||U!=null&&U.constructor!=null&&U.constructor.name!=null&&U.constructor.name===P.name}function Ne(U){return U!==U}const Je=function(){const U="0123456789abcdef",P=new Array(256);for(let k=0;k<16;++k){const Q=k*16;for(let ae=0;ae<16;++ae)P[Q+ae]=U[k]+U[ae]}return P}();function st(U){return typeof BigInt>"u"?qn:U}function qn(){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}(nc)),nc}var rc={},ic={},oc,ig;function og(){return ig||(ig=1,oc=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 o=42;t[n]=o;for(var i 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!==o||a.enumerable!==!0)return!1}return!0}),oc}var sc,sg;function Ps(){if(sg)return sc;sg=1;var e=og();return sc=function(){return e()&&!!Symbol.toStringTag},sc}var ac,ag;function lg(){return ag||(ag=1,ac=Object),ac}var lc,cg;function BA(){return cg||(cg=1,lc=Error),lc}var cc,ug;function jA(){return ug||(ug=1,cc=EvalError),cc}var uc,fg;function UA(){return fg||(fg=1,uc=RangeError),uc}var fc,dg;function qA(){return dg||(dg=1,fc=ReferenceError),fc}var dc,pg;function hg(){return pg||(pg=1,dc=SyntaxError),dc}var pc,gg;function go(){return gg||(gg=1,pc=TypeError),pc}var hc,mg;function VA(){return mg||(mg=1,hc=URIError),hc}var gc,yg;function zA(){return yg||(yg=1,gc=Math.abs),gc}var mc,bg;function WA(){return bg||(bg=1,mc=Math.floor),mc}var yc,vg;function HA(){return vg||(vg=1,yc=Math.max),yc}var bc,wg;function GA(){return wg||(wg=1,bc=Math.min),bc}var vc,Sg;function KA(){return Sg||(Sg=1,vc=Math.pow),vc}var wc,Eg;function QA(){return Eg||(Eg=1,wc=Math.round),wc}var Sc,Tg;function XA(){return Tg||(Tg=1,Sc=Number.isNaN||function(t){return t!==t}),Sc}var Ec,Ag;function YA(){if(Ag)return Ec;Ag=1;var e=XA();return Ec=function(n){return e(n)||n===0?n:n<0?-1:1},Ec}var Tc,Rg;function JA(){return Rg||(Rg=1,Tc=Object.getOwnPropertyDescriptor),Tc}var Ac,_g;function xi(){if(_g)return Ac;_g=1;var e=JA();if(e)try{e([],"length")}catch{e=null}return Ac=e,Ac}var Rc,Ig;function Fs(){if(Ig)return Rc;Ig=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Rc=e,Rc}var _c,Cg;function ZA(){if(Cg)return _c;Cg=1;var e=typeof Symbol<"u"&&Symbol,t=og();return _c=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},_c}var Ic,Pg;function Fg(){return Pg||(Pg=1,Ic=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Ic}var Cc,Og;function kg(){if(Og)return Cc;Og=1;var e=lg();return Cc=e.getPrototypeOf||null,Cc}var Pc,xg;function eR(){if(xg)return Pc;xg=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,n=Math.max,r="[object Function]",o=function(c,u){for(var l=[],f=0;f<c.length;f+=1)l[f]=c[f];for(var d=0;d<u.length;d+=1)l[d+c.length]=u[d];return l},i=function(c,u){for(var l=[],f=u,d=0;f<c.length;f+=1,d+=1)l[d]=c[f];return l},s=function(a,c){for(var u="",l=0;l<a.length;l+=1)u+=a[l],l+1<a.length&&(u+=c);return u};return Pc=function(c){var u=this;if(typeof u!="function"||t.apply(u)!==r)throw new TypeError(e+u);for(var l=i(arguments,1),f,d=function(){if(this instanceof f){var y=u.apply(this,o(l,arguments));return Object(y)===y?y:this}return u.apply(c,o(l,arguments))},m=n(0,u.length-l.length),w=[],v=0;v<m;v++)w[v]="$"+v;if(f=Function("binder","return function ("+s(w,",")+"){ return binder.apply(this,arguments); }")(d),u.prototype){var T=function(){};T.prototype=u.prototype,f.prototype=new T,T.prototype=null}return f},Pc}var Fc,Ng;function mo(){if(Ng)return Fc;Ng=1;var e=eR();return Fc=Function.prototype.bind||e,Fc}var Oc,$g;function kc(){return $g||($g=1,Oc=Function.prototype.call),Oc}var xc,Dg;function Nc(){return Dg||(Dg=1,xc=Function.prototype.apply),xc}var $c,Lg;function tR(){return Lg||(Lg=1,$c=typeof Reflect<"u"&&Reflect&&Reflect.apply),$c}var Dc,Mg;function Bg(){if(Mg)return Dc;Mg=1;var e=mo(),t=Nc(),n=kc(),r=tR();return Dc=r||e.call(n,t),Dc}var Lc,jg;function Mc(){if(jg)return Lc;jg=1;var e=mo(),t=go(),n=kc(),r=Bg();return Lc=function(i){if(i.length<1||typeof i[0]!="function")throw new t("a function is required");return r(e,n,i)},Lc}var Bc,Ug;function nR(){if(Ug)return Bc;Ug=1;var e=Mc(),t=xi(),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__"),o=Object,i=o.getPrototypeOf;return Bc=r&&typeof r.get=="function"?e([r.get]):typeof i=="function"?function(a){return i(a==null?a:o(a))}:!1,Bc}var jc,qg;function Uc(){if(qg)return jc;qg=1;var e=Fg(),t=kg(),n=nR();return jc=e?function(o){return e(o)}:t?function(o){if(!o||typeof o!="object"&&typeof o!="function")throw new TypeError("getProto: not an object");return t(o)}:n?function(o){return n(o)}:null,jc}var qc,Vg;function zg(){if(Vg)return qc;Vg=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,n=mo();return qc=n.call(e,t),qc}var Vc,Wg;function Hg(){if(Wg)return Vc;Wg=1;var e,t=lg(),n=BA(),r=jA(),o=UA(),i=qA(),s=hg(),a=go(),c=VA(),u=zA(),l=WA(),f=HA(),d=GA(),m=KA(),w=QA(),v=YA(),T=Function,y=function(G){try{return T('"use strict"; return ('+G+").constructor;")()}catch{}},g=xi(),h=Fs(),b=function(){throw new a},S=g?function(){try{return arguments.callee,b}catch{try{return g(arguments,"callee").get}catch{return b}}}():b,E=ZA()(),I=Uc(),R=kg(),A=Fg(),N=Nc(),L=kc(),x={},$=typeof Uint8Array>"u"||!I?e:I(Uint8Array),V={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":E&&I?I([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":x,"%AsyncGenerator%":x,"%AsyncGeneratorFunction%":x,"%AsyncIteratorPrototype%":x,"%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%":T,"%GeneratorFunction%":x,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":E&&I?I(I([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!E||!I?e:I(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%":o,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!E||!I?e:I(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":E&&I?I(""[Symbol.iterator]()):e,"%Symbol%":E?Symbol:e,"%SyntaxError%":s,"%ThrowTypeError%":S,"%TypedArray%":$,"%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%":c,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":L,"%Function.prototype.apply%":N,"%Object.defineProperty%":h,"%Object.getPrototypeOf%":R,"%Math.abs%":u,"%Math.floor%":l,"%Math.max%":f,"%Math.min%":d,"%Math.pow%":m,"%Math.round%":w,"%Math.sign%":v,"%Reflect.getPrototypeOf%":A};if(I)try{null.error}catch(G){var X=I(I(G));V["%Error.prototype%"]=X}var ee=function G(z){var M;if(z==="%AsyncFunction%")M=y("async function () {}");else if(z==="%GeneratorFunction%")M=y("function* () {}");else if(z==="%AsyncGeneratorFunction%")M=y("async function* () {}");else if(z==="%AsyncGenerator%"){var q=G("%AsyncGeneratorFunction%");q&&(M=q.prototype)}else if(z==="%AsyncIteratorPrototype%"){var de=G("%AsyncGenerator%");de&&I&&(M=I(de.prototype))}return V[z]=M,M},se={__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"]},ie=mo(),re=zg(),fe=ie.call(L,Array.prototype.concat),ue=ie.call(N,Array.prototype.splice),Z=ie.call(L,String.prototype.replace),oe=ie.call(L,String.prototype.slice),ce=ie.call(L,RegExp.prototype.exec),Ce=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,H=/\\(\\)?/g,_=function(z){var M=oe(z,0,1),q=oe(z,-1);if(M==="%"&&q!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(q==="%"&&M!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var de=[];return Z(z,Ce,function(Ae,De,ke,_e){de[de.length]=ke?Z(_e,H,"$1"):De||Ae}),de},F=function(z,M){var q=z,de;if(re(se,q)&&(de=se[q],q="%"+de[0]+"%"),re(V,q)){var Ae=V[q];if(Ae===x&&(Ae=ee(q)),typeof Ae>"u"&&!M)throw new a("intrinsic "+z+" exists, but is not available. Please file an issue!");return{alias:de,name:q,value:Ae}}throw new s("intrinsic "+z+" does not exist!")};return Vc=function(z,M){if(typeof z!="string"||z.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof M!="boolean")throw new a('"allowMissing" argument must be a boolean');if(ce(/^%?[^%]*%?$/,z)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var q=_(z),de=q.length>0?q[0]:"",Ae=F("%"+de+"%",M),De=Ae.name,ke=Ae.value,_e=!1,Le=Ae.alias;Le&&(de=Le[0],ue(q,fe([0,1],Le)));for(var Y=1,xe=!0;Y<q.length;Y+=1){var Me=q[Y],Ve=oe(Me,0,1),Ze=oe(Me,-1);if((Ve==='"'||Ve==="'"||Ve==="`"||Ze==='"'||Ze==="'"||Ze==="`")&&Ve!==Ze)throw new s("property names with quotes must have matching quotes");if((Me==="constructor"||!xe)&&(_e=!0),de+="."+Me,De="%"+de+"%",re(V,De))ke=V[De];else if(ke!=null){if(!(Me in ke)){if(!M)throw new a("base intrinsic for "+z+" exists, but the property is not available.");return}if(g&&Y+1>=q.length){var kt=g(ke,Me);xe=!!kt,xe&&"get"in kt&&!("originalValue"in kt.get)?ke=kt.get:ke=ke[Me]}else xe=re(ke,Me),ke=ke[Me];xe&&!_e&&(V[De]=ke)}}return ke},Vc}var zc,Gg;function yo(){if(Gg)return zc;Gg=1;var e=Hg(),t=Mc(),n=t([e("%String.prototype.indexOf%")]);return zc=function(o,i){var s=e(o,!!i);return typeof s=="function"&&n(o,".prototype.")>-1?t([s]):s},zc}var Wc,Kg;function rR(){if(Kg)return Wc;Kg=1;var e=Ps()(),t=yo(),n=t("Object.prototype.toString"),r=function(a){return e&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:n(a)==="[object Arguments]"},o=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]"},i=function(){return r(arguments)}();return r.isLegacyArguments=o,Wc=i?r:o,Wc}var Hc,Qg;function iR(){if(Qg)return Hc;Qg=1;var e=yo(),t=Ps()(),n=zg(),r=xi(),o;if(t){var i=e("RegExp.prototype.exec"),s={},a=function(){throw s},c={toString:a,valueOf:a};typeof Symbol.toPrimitive=="symbol"&&(c[Symbol.toPrimitive]=a),o=function(d){if(!d||typeof d!="object")return!1;var m=r(d,"lastIndex"),w=m&&n(m,"value");if(!w)return!1;try{i(d,c)}catch(v){return v===s}}}else{var u=e("Object.prototype.toString"),l="[object RegExp]";o=function(d){return!d||typeof d!="object"&&typeof d!="function"?!1:u(d)===l}}return Hc=o,Hc}var Gc,Xg;function oR(){if(Xg)return Gc;Xg=1;var e=yo(),t=iR(),n=e("RegExp.prototype.exec"),r=go();return Gc=function(i){if(!t(i))throw new r("`regex` must be a RegExp");return function(a){return n(i,a)!==null}},Gc}var Kc,Yg;function sR(){if(Yg)return Kc;Yg=1;var e=yo(),t=oR(),n=t(/^\s*(?:function)?\*/),r=Ps()(),o=Uc(),i=e("Object.prototype.toString"),s=e("Function.prototype.toString"),a=function(){if(!r)return!1;try{return Function("return function*() {}")()}catch{}},c;return Kc=function(l){if(typeof l!="function")return!1;if(n(s(l)))return!0;if(!r){var f=i(l);return f==="[object GeneratorFunction]"}if(!o)return!1;if(typeof c>"u"){var d=a();c=d?o(d):!1}return o(l)===c},Kc}var Qc,Jg;function aR(){if(Jg)return Qc;Jg=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 o=/^\s*class\b/,i=function(h){try{var b=e.call(h);return o.test(b)}catch{return!1}},s=function(h){try{return i(h)?!1:(e.call(h),!0)}catch{return!1}},a=Object.prototype.toString,c="[object Object]",u="[object Function]",l="[object GeneratorFunction]",f="[object HTMLAllCollection]",d="[object HTML document.all class]",m="[object HTMLCollection]",w=typeof Symbol=="function"&&!!Symbol.toStringTag,v=!(0 in[,]),T=function(){return!1};if(typeof document=="object"){var y=document.all;a.call(y)===a.call(document.all)&&(T=function(h){if((v||!h)&&(typeof h>"u"||typeof h=="object"))try{var b=a.call(h);return(b===f||b===d||b===m||b===c)&&h("")==null}catch{}return!1})}return Qc=t?function(h){if(T(h))return!0;if(!h||typeof h!="function"&&typeof h!="object")return!1;try{t(h,null,n)}catch(b){if(b!==r)return!1}return!i(h)&&s(h)}:function(h){if(T(h))return!0;if(!h||typeof h!="function"&&typeof h!="object")return!1;if(w)return s(h);if(i(h))return!1;var b=a.call(h);return b!==u&&b!==l&&!/^\[object HTML/.test(b)?!1:s(h)},Qc}var Xc,Zg;function lR(){if(Zg)return Xc;Zg=1;var e=aR(),t=Object.prototype.toString,n=Object.prototype.hasOwnProperty,r=function(c,u,l){for(var f=0,d=c.length;f<d;f++)n.call(c,f)&&(l==null?u(c[f],f,c):u.call(l,c[f],f,c))},o=function(c,u,l){for(var f=0,d=c.length;f<d;f++)l==null?u(c.charAt(f),f,c):u.call(l,c.charAt(f),f,c)},i=function(c,u,l){for(var f in c)n.call(c,f)&&(l==null?u(c[f],f,c):u.call(l,c[f],f,c))};function s(a){return t.call(a)==="[object Array]"}return Xc=function(c,u,l){if(!e(u))throw new TypeError("iterator must be a function");var f;arguments.length>=3&&(f=l),s(c)?r(c,u,f):typeof c=="string"?o(c,u,f):i(c,u,f)},Xc}var Yc,em;function cR(){return em||(em=1,Yc=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Yc}var Jc,tm;function uR(){if(tm)return Jc;tm=1;var e=cR(),t=typeof globalThis>"u"?xr:globalThis;return Jc=function(){for(var r=[],o=0;o<e.length;o++)typeof t[e[o]]=="function"&&(r[r.length]=e[o]);return r},Jc}var Zc={exports:{}},eu,nm;function fR(){if(nm)return eu;nm=1;var e=Fs(),t=hg(),n=go(),r=xi();return eu=function(i,s,a){if(!i||typeof i!="object"&&typeof i!="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 c=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,f=arguments.length>6?arguments[6]:!1,d=!!r&&r(i,s);if(e)e(i,s,{configurable:l===null&&d?d.configurable:!l,enumerable:c===null&&d?d.enumerable:!c,value:a,writable:u===null&&d?d.writable:!u});else if(f||!c&&!u&&!l)i[s]=a;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},eu}var tu,rm;function dR(){if(rm)return tu;rm=1;var e=Fs(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},tu=t,tu}var nu,im;function pR(){if(im)return nu;im=1;var e=Hg(),t=fR(),n=dR()(),r=xi(),o=go(),i=e("%Math.floor%");return nu=function(a,c){if(typeof a!="function")throw new o("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||i(c)!==c)throw new o("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],l=!0,f=!0;if("length"in a&&r){var d=r(a,"length");d&&!d.configurable&&(l=!1),d&&!d.writable&&(f=!1)}return(l||f||!u)&&(n?t(a,"length",c,!0,!0):t(a,"length",c)),a},nu}var ru,om;function hR(){if(om)return ru;om=1;var e=mo(),t=Nc(),n=Bg();return ru=function(){return n(e,t,arguments)},ru}var sm;function gR(){return sm||(sm=1,function(e){var t=pR(),n=Fs(),r=Mc(),o=hR();e.exports=function(s){var a=r(arguments),c=s.length-(arguments.length-1);return t(a,1+(c>0?c:0),!0)},n?n(e.exports,"apply",{value:o}):e.exports.apply=o}(Zc)),Zc.exports}var iu,am;function lm(){if(am)return iu;am=1;var e=lR(),t=uR(),n=gR(),r=yo(),o=xi(),i=Uc(),s=r("Object.prototype.toString"),a=Ps()(),c=typeof globalThis>"u"?xr:globalThis,u=t(),l=r("String.prototype.slice"),f=r("Array.prototype.indexOf",!0)||function(T,y){for(var g=0;g<T.length;g+=1)if(T[g]===y)return g;return-1},d={__proto__:null};a&&o&&i?e(u,function(v){var T=new c[v];if(Symbol.toStringTag in T&&i){var y=i(T),g=o(y,Symbol.toStringTag);if(!g&&y){var h=i(y);g=o(h,Symbol.toStringTag)}d["$"+v]=n(g.get)}}):e(u,function(v){var T=new c[v],y=T.slice||T.set;y&&(d["$"+v]=n(y))});var m=function(T){var y=!1;return e(d,function(g,h){if(!y)try{"$"+g(T)===h&&(y=l(h,1))}catch{}}),y},w=function(T){var y=!1;return e(d,function(g,h){if(!y)try{g(T),y=l(h,1)}catch{}}),y};return iu=function(T){if(!T||typeof T!="object")return!1;if(!a){var y=l(s(T),8,-1);return f(u,y)>-1?y:y!=="Object"?!1:w(T)}return o?m(T):null},iu}var ou,cm;function mR(){if(cm)return ou;cm=1;var e=lm();return ou=function(n){return!!e(n)},ou}var um;function yR(){return um||(um=1,function(e){var t=rR(),n=sR(),r=lm(),o=mR();function i(Y){return Y.call.bind(Y)}var s=typeof BigInt<"u",a=typeof Symbol<"u",c=i(Object.prototype.toString),u=i(Number.prototype.valueOf),l=i(String.prototype.valueOf),f=i(Boolean.prototype.valueOf);if(s)var d=i(BigInt.prototype.valueOf);if(a)var m=i(Symbol.prototype.valueOf);function w(Y,xe){if(typeof Y!="object")return!1;try{return xe(Y),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=n,e.isTypedArray=o;function v(Y){return typeof Promise<"u"&&Y instanceof Promise||Y!==null&&typeof Y=="object"&&typeof Y.then=="function"&&typeof Y.catch=="function"}e.isPromise=v;function T(Y){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Y):o(Y)||oe(Y)}e.isArrayBufferView=T;function y(Y){return r(Y)==="Uint8Array"}e.isUint8Array=y;function g(Y){return r(Y)==="Uint8ClampedArray"}e.isUint8ClampedArray=g;function h(Y){return r(Y)==="Uint16Array"}e.isUint16Array=h;function b(Y){return r(Y)==="Uint32Array"}e.isUint32Array=b;function S(Y){return r(Y)==="Int8Array"}e.isInt8Array=S;function E(Y){return r(Y)==="Int16Array"}e.isInt16Array=E;function I(Y){return r(Y)==="Int32Array"}e.isInt32Array=I;function R(Y){return r(Y)==="Float32Array"}e.isFloat32Array=R;function A(Y){return r(Y)==="Float64Array"}e.isFloat64Array=A;function N(Y){return r(Y)==="BigInt64Array"}e.isBigInt64Array=N;function L(Y){return r(Y)==="BigUint64Array"}e.isBigUint64Array=L;function x(Y){return c(Y)==="[object Map]"}x.working=typeof Map<"u"&&x(new Map);function $(Y){return typeof Map>"u"?!1:x.working?x(Y):Y instanceof Map}e.isMap=$;function V(Y){return c(Y)==="[object Set]"}V.working=typeof Set<"u"&&V(new Set);function X(Y){return typeof Set>"u"?!1:V.working?V(Y):Y instanceof Set}e.isSet=X;function ee(Y){return c(Y)==="[object WeakMap]"}ee.working=typeof WeakMap<"u"&&ee(new WeakMap);function se(Y){return typeof WeakMap>"u"?!1:ee.working?ee(Y):Y instanceof WeakMap}e.isWeakMap=se;function ie(Y){return c(Y)==="[object WeakSet]"}ie.working=typeof WeakSet<"u"&&ie(new WeakSet);function re(Y){return ie(Y)}e.isWeakSet=re;function fe(Y){return c(Y)==="[object ArrayBuffer]"}fe.working=typeof ArrayBuffer<"u"&&fe(new ArrayBuffer);function ue(Y){return typeof ArrayBuffer>"u"?!1:fe.working?fe(Y):Y instanceof ArrayBuffer}e.isArrayBuffer=ue;function Z(Y){return c(Y)==="[object DataView]"}Z.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Z(new DataView(new ArrayBuffer(1),0,1));function oe(Y){return typeof DataView>"u"?!1:Z.working?Z(Y):Y instanceof DataView}e.isDataView=oe;var ce=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Ce(Y){return c(Y)==="[object SharedArrayBuffer]"}function H(Y){return typeof ce>"u"?!1:(typeof Ce.working>"u"&&(Ce.working=Ce(new ce)),Ce.working?Ce(Y):Y instanceof ce)}e.isSharedArrayBuffer=H;function _(Y){return c(Y)==="[object AsyncFunction]"}e.isAsyncFunction=_;function F(Y){return c(Y)==="[object Map Iterator]"}e.isMapIterator=F;function G(Y){return c(Y)==="[object Set Iterator]"}e.isSetIterator=G;function z(Y){return c(Y)==="[object Generator]"}e.isGeneratorObject=z;function M(Y){return c(Y)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=M;function q(Y){return w(Y,u)}e.isNumberObject=q;function de(Y){return w(Y,l)}e.isStringObject=de;function Ae(Y){return w(Y,f)}e.isBooleanObject=Ae;function De(Y){return s&&w(Y,d)}e.isBigIntObject=De;function ke(Y){return a&&w(Y,m)}e.isSymbolObject=ke;function _e(Y){return q(Y)||de(Y)||Ae(Y)||De(Y)||ke(Y)}e.isBoxedPrimitive=_e;function Le(Y){return typeof Uint8Array<"u"&&(ue(Y)||H(Y))}e.isAnyArrayBuffer=Le,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Y){Object.defineProperty(e,Y,{enumerable:!1,value:function(){throw new Error(Y+" is not supported in userland")}})})}(ic)),ic}var su,fm;function bR(){return fm||(fm=1,su=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),su}var dm;function pm(){return dm||(dm=1,function(e){var t=Object.getOwnPropertyDescriptors||function(oe){for(var ce=Object.keys(oe),Ce={},H=0;H<ce.length;H++)Ce[ce[H]]=Object.getOwnPropertyDescriptor(oe,ce[H]);return Ce},n=/%[sdj%]/g;e.format=function(Z){if(!S(Z)){for(var oe=[],ce=0;ce<arguments.length;ce++)oe.push(s(arguments[ce]));return oe.join(" ")}for(var ce=1,Ce=arguments,H=Ce.length,_=String(Z).replace(n,function(G){if(G==="%%")return"%";if(ce>=H)return G;switch(G){case"%s":return String(Ce[ce++]);case"%d":return Number(Ce[ce++]);case"%j":try{return JSON.stringify(Ce[ce++])}catch{return"[Circular]"}default:return G}}),F=Ce[ce];ce<H;F=Ce[++ce])g(F)||!A(F)?_+=" "+F:_+=" "+s(F);return _},e.deprecate=function(Z,oe){if(typeof we<"u"&&we.noDeprecation===!0)return Z;if(typeof we>"u")return function(){return e.deprecate(Z,oe).apply(this,arguments)};var ce=!1;function Ce(){if(!ce){if(we.throwDeprecation)throw new Error(oe);we.traceDeprecation?console.trace(oe):console.error(oe),ce=!0}return Z.apply(this,arguments)}return Ce};var r={},o=/^$/;if(we.env.NODE_DEBUG){var i=we.env.NODE_DEBUG;i=i.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),o=new RegExp("^"+i+"$","i")}e.debuglog=function(Z){if(Z=Z.toUpperCase(),!r[Z])if(o.test(Z)){var oe=we.pid;r[Z]=function(){var ce=e.format.apply(e,arguments);console.error("%s %d: %s",Z,oe,ce)}}else r[Z]=function(){};return r[Z]};function s(Z,oe){var ce={seen:[],stylize:c};return arguments.length>=3&&(ce.depth=arguments[2]),arguments.length>=4&&(ce.colors=arguments[3]),y(oe)?ce.showHidden=oe:oe&&e._extend(ce,oe),I(ce.showHidden)&&(ce.showHidden=!1),I(ce.depth)&&(ce.depth=2),I(ce.colors)&&(ce.colors=!1),I(ce.customInspect)&&(ce.customInspect=!0),ce.colors&&(ce.stylize=a),l(ce,Z,ce.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(Z,oe){var ce=s.styles[oe];return ce?"\x1B["+s.colors[ce][0]+"m"+Z+"\x1B["+s.colors[ce][1]+"m":Z}function c(Z,oe){return Z}function u(Z){var oe={};return Z.forEach(function(ce,Ce){oe[ce]=!0}),oe}function l(Z,oe,ce){if(Z.customInspect&&oe&&x(oe.inspect)&&oe.inspect!==e.inspect&&!(oe.constructor&&oe.constructor.prototype===oe)){var Ce=oe.inspect(ce,Z);return S(Ce)||(Ce=l(Z,Ce,ce)),Ce}var H=f(Z,oe);if(H)return H;var _=Object.keys(oe),F=u(_);if(Z.showHidden&&(_=Object.getOwnPropertyNames(oe)),L(oe)&&(_.indexOf("message")>=0||_.indexOf("description")>=0))return d(oe);if(_.length===0){if(x(oe)){var G=oe.name?": "+oe.name:"";return Z.stylize("[Function"+G+"]","special")}if(R(oe))return Z.stylize(RegExp.prototype.toString.call(oe),"regexp");if(N(oe))return Z.stylize(Date.prototype.toString.call(oe),"date");if(L(oe))return d(oe)}var z="",M=!1,q=["{","}"];if(T(oe)&&(M=!0,q=["[","]"]),x(oe)){var de=oe.name?": "+oe.name:"";z=" [Function"+de+"]"}if(R(oe)&&(z=" "+RegExp.prototype.toString.call(oe)),N(oe)&&(z=" "+Date.prototype.toUTCString.call(oe)),L(oe)&&(z=" "+d(oe)),_.length===0&&(!M||oe.length==0))return q[0]+z+q[1];if(ce<0)return R(oe)?Z.stylize(RegExp.prototype.toString.call(oe),"regexp"):Z.stylize("[Object]","special");Z.seen.push(oe);var Ae;return M?Ae=m(Z,oe,ce,F,_):Ae=_.map(function(De){return w(Z,oe,ce,F,De,M)}),Z.seen.pop(),v(Ae,z,q)}function f(Z,oe){if(I(oe))return Z.stylize("undefined","undefined");if(S(oe)){var ce="'"+JSON.stringify(oe).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Z.stylize(ce,"string")}if(b(oe))return Z.stylize(""+oe,"number");if(y(oe))return Z.stylize(""+oe,"boolean");if(g(oe))return Z.stylize("null","null")}function d(Z){return"["+Error.prototype.toString.call(Z)+"]"}function m(Z,oe,ce,Ce,H){for(var _=[],F=0,G=oe.length;F<G;++F)ie(oe,String(F))?_.push(w(Z,oe,ce,Ce,String(F),!0)):_.push("");return H.forEach(function(z){z.match(/^\d+$/)||_.push(w(Z,oe,ce,Ce,z,!0))}),_}function w(Z,oe,ce,Ce,H,_){var F,G,z;if(z=Object.getOwnPropertyDescriptor(oe,H)||{value:oe[H]},z.get?z.set?G=Z.stylize("[Getter/Setter]","special"):G=Z.stylize("[Getter]","special"):z.set&&(G=Z.stylize("[Setter]","special")),ie(Ce,H)||(F="["+H+"]"),G||(Z.seen.indexOf(z.value)<0?(g(ce)?G=l(Z,z.value,null):G=l(Z,z.value,ce-1),G.indexOf(`
17
- `)>-1&&(_?G=G.split(`
16
+ */(function(g){const v=n,h=E,S=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;g.Buffer=N,g.SlowBuffer=re,g.INSPECT_MAX_BYTES=50;const T=2147483647;g.kMaxLength=T;const{Uint8Array:R,ArrayBuffer:_,SharedArrayBuffer:A}=globalThis;N.TYPED_ARRAY_SUPPORT=$(),!N.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 $(){try{const U=new R(1),P={foo:function(){return 42}};return Object.setPrototypeOf(P,R.prototype),Object.setPrototypeOf(U,P),U.foo()===42}catch{return!1}}Object.defineProperty(N.prototype,"parent",{enumerable:!0,get:function(){if(N.isBuffer(this))return this.buffer}}),Object.defineProperty(N.prototype,"offset",{enumerable:!0,get:function(){if(N.isBuffer(this))return this.byteOffset}});function D(U){if(U>T)throw new RangeError('The value "'+U+'" is invalid for option "size"');const P=new R(U);return Object.setPrototypeOf(P,N.prototype),P}function N(U,P,k){if(typeof U=="number"){if(typeof P=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return le(U)}return x(U,P,k)}N.poolSize=8192;function x(U,P,k){if(typeof U=="string")return be(U,P);if(_.isView(U))return ae(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(jn(U,_)||U&&jn(U.buffer,_)||typeof A<"u"&&(jn(U,A)||U&&jn(U.buffer,A)))return ue(U,P,k);if(typeof U=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const J=U.valueOf&&U.valueOf();if(J!=null&&J!==U)return N.from(J,P,k);const oe=ie(U);if(oe)return oe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof U[Symbol.toPrimitive]=="function")return N.from(U[Symbol.toPrimitive]("string"),P,k);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U)}N.from=function(U,P,k){return x(U,P,k)},Object.setPrototypeOf(N.prototype,R.prototype),Object.setPrototypeOf(N,R);function W(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 K(U,P,k){return W(U),U<=0?D(U):P!==void 0?typeof k=="string"?D(U).fill(P,k):D(U).fill(P):D(U)}N.alloc=function(U,P,k){return K(U,P,k)};function le(U){return W(U),D(U<0?0:G(U)|0)}N.allocUnsafe=function(U){return le(U)},N.allocUnsafeSlow=function(U){return le(U)};function be(U,P){if((typeof P!="string"||P==="")&&(P="utf8"),!N.isEncoding(P))throw new TypeError("Unknown encoding: "+P);const k=se(U,P)|0;let J=D(k);const oe=J.write(U,P);return oe!==k&&(J=J.slice(0,oe)),J}function te(U){const P=U.length<0?0:G(U.length)|0,k=D(P);for(let J=0;J<P;J+=1)k[J]=U[J]&255;return k}function ae(U){if(jn(U,R)){const P=new R(U);return ue(P.buffer,P.byteOffset,P.byteLength)}return te(U)}function ue(U,P,k){if(P<0||U.byteLength<P)throw new RangeError('"offset" is outside of buffer bounds');if(U.byteLength<P+(k||0))throw new RangeError('"length" is outside of buffer bounds');let J;return P===void 0&&k===void 0?J=new R(U):k===void 0?J=new R(U,P):J=new R(U,P,k),Object.setPrototypeOf(J,N.prototype),J}function ie(U){if(N.isBuffer(U)){const P=G(U.length)|0,k=D(P);return k.length===0||U.copy(k,0,0,P),k}if(U.length!==void 0)return typeof U.length!="number"||De(U.length)?D(0):te(U);if(U.type==="Buffer"&&Array.isArray(U.data))return te(U.data)}function G(U){if(U>=T)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+T.toString(16)+" bytes");return U|0}function re(U){return+U!=U&&(U=0),N.alloc(+U)}N.isBuffer=function(P){return P!=null&&P._isBuffer===!0&&P!==N.prototype},N.compare=function(P,k){if(jn(P,R)&&(P=N.from(P,P.offset,P.byteLength)),jn(k,R)&&(k=N.from(k,k.offset,k.byteLength)),!N.isBuffer(P)||!N.isBuffer(k))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(P===k)return 0;let J=P.length,oe=k.length;for(let we=0,_e=Math.min(J,oe);we<_e;++we)if(P[we]!==k[we]){J=P[we],oe=k[we];break}return J<oe?-1:oe<J?1:0},N.isEncoding=function(P){switch(String(P).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}},N.concat=function(P,k){if(!Array.isArray(P))throw new TypeError('"list" argument must be an Array of Buffers');if(P.length===0)return N.alloc(0);let J;if(k===void 0)for(k=0,J=0;J<P.length;++J)k+=P[J].length;const oe=N.allocUnsafe(k);let we=0;for(J=0;J<P.length;++J){let _e=P[J];if(jn(_e,R))we+_e.length>oe.length?(N.isBuffer(_e)||(_e=N.from(_e)),_e.copy(oe,we)):R.prototype.set.call(oe,_e,we);else if(N.isBuffer(_e))_e.copy(oe,we);else throw new TypeError('"list" argument must be an Array of Buffers');we+=_e.length}return oe};function se(U,P){if(N.isBuffer(U))return U.length;if(_.isView(U)||jn(U,_))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 k=U.length,J=arguments.length>2&&arguments[2]===!0;if(!J&&k===0)return 0;let oe=!1;for(;;)switch(P){case"ascii":case"latin1":case"binary":return k;case"utf8":case"utf-8":return ut(U).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k*2;case"hex":return k>>>1;case"base64":return it(U).length;default:if(oe)return J?-1:ut(U).length;P=(""+P).toLowerCase(),oe=!0}}N.byteLength=se;function Ie(U,P,k){let J=!1;if((P===void 0||P<0)&&(P=0),P>this.length||((k===void 0||k>this.length)&&(k=this.length),k<=0)||(k>>>=0,P>>>=0,k<=P))return"";for(U||(U="utf8");;)switch(U){case"hex":return Pe(this,P,k);case"utf8":case"utf-8":return Le(this,P,k);case"ascii":return Me(this,P,k);case"latin1":case"binary":return Y(this,P,k);case"base64":return Te(this,P,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ne(this,P,k);default:if(J)throw new TypeError("Unknown encoding: "+U);U=(U+"").toLowerCase(),J=!0}}N.prototype._isBuffer=!0;function ee(U,P,k){const J=U[P];U[P]=U[k],U[k]=J}N.prototype.swap16=function(){const P=this.length;if(P%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let k=0;k<P;k+=2)ee(this,k,k+1);return this},N.prototype.swap32=function(){const P=this.length;if(P%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let k=0;k<P;k+=4)ee(this,k,k+3),ee(this,k+1,k+2);return this},N.prototype.swap64=function(){const P=this.length;if(P%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let k=0;k<P;k+=8)ee(this,k,k+7),ee(this,k+1,k+6),ee(this,k+2,k+5),ee(this,k+3,k+4);return this},N.prototype.toString=function(){const P=this.length;return P===0?"":arguments.length===0?Le(this,0,P):Ie.apply(this,arguments)},N.prototype.toLocaleString=N.prototype.toString,N.prototype.equals=function(P){if(!N.isBuffer(P))throw new TypeError("Argument must be a Buffer");return this===P?!0:N.compare(this,P)===0},N.prototype.inspect=function(){let P="";const k=g.INSPECT_MAX_BYTES;return P=this.toString("hex",0,k).replace(/(.{2})/g,"$1 ").trim(),this.length>k&&(P+=" ... "),"<Buffer "+P+">"},S&&(N.prototype[S]=N.prototype.inspect),N.prototype.compare=function(P,k,J,oe,we){if(jn(P,R)&&(P=N.from(P,P.offset,P.byteLength)),!N.isBuffer(P))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof P);if(k===void 0&&(k=0),J===void 0&&(J=P?P.length:0),oe===void 0&&(oe=0),we===void 0&&(we=this.length),k<0||J>P.length||oe<0||we>this.length)throw new RangeError("out of range index");if(oe>=we&&k>=J)return 0;if(oe>=we)return-1;if(k>=J)return 1;if(k>>>=0,J>>>=0,oe>>>=0,we>>>=0,this===P)return 0;let _e=we-oe,nt=J-k;const Dt=Math.min(_e,nt),Ft=this.slice(oe,we),Lt=P.slice(k,J);for(let vt=0;vt<Dt;++vt)if(Ft[vt]!==Lt[vt]){_e=Ft[vt],nt=Lt[vt];break}return _e<nt?-1:nt<_e?1:0};function F(U,P,k,J,oe){if(U.length===0)return-1;if(typeof k=="string"?(J=k,k=0):k>2147483647?k=2147483647:k<-2147483648&&(k=-2147483648),k=+k,De(k)&&(k=oe?0:U.length-1),k<0&&(k=U.length+k),k>=U.length){if(oe)return-1;k=U.length-1}else if(k<0)if(oe)k=0;else return-1;if(typeof P=="string"&&(P=N.from(P,J)),N.isBuffer(P))return P.length===0?-1:C(U,P,k,J,oe);if(typeof P=="number")return P=P&255,typeof R.prototype.indexOf=="function"?oe?R.prototype.indexOf.call(U,P,k):R.prototype.lastIndexOf.call(U,P,k):C(U,[P],k,J,oe);throw new TypeError("val must be string, number or Buffer")}function C(U,P,k,J,oe){let we=1,_e=U.length,nt=P.length;if(J!==void 0&&(J=String(J).toLowerCase(),J==="ucs2"||J==="ucs-2"||J==="utf16le"||J==="utf-16le")){if(U.length<2||P.length<2)return-1;we=2,_e/=2,nt/=2,k/=2}function Dt(Lt,vt){return we===1?Lt[vt]:Lt.readUInt16BE(vt*we)}let Ft;if(oe){let Lt=-1;for(Ft=k;Ft<_e;Ft++)if(Dt(U,Ft)===Dt(P,Lt===-1?0:Ft-Lt)){if(Lt===-1&&(Lt=Ft),Ft-Lt+1===nt)return Lt*we}else Lt!==-1&&(Ft-=Ft-Lt),Lt=-1}else for(k+nt>_e&&(k=_e-nt),Ft=k;Ft>=0;Ft--){let Lt=!0;for(let vt=0;vt<nt;vt++)if(Dt(U,Ft+vt)!==Dt(P,vt)){Lt=!1;break}if(Lt)return Ft}return-1}N.prototype.includes=function(P,k,J){return this.indexOf(P,k,J)!==-1},N.prototype.indexOf=function(P,k,J){return F(this,P,k,J,!0)},N.prototype.lastIndexOf=function(P,k,J){return F(this,P,k,J,!1)};function z(U,P,k,J){k=Number(k)||0;const oe=U.length-k;J?(J=Number(J),J>oe&&(J=oe)):J=oe;const we=P.length;J>we/2&&(J=we/2);let _e;for(_e=0;_e<J;++_e){const nt=parseInt(P.substr(_e*2,2),16);if(De(nt))return _e;U[k+_e]=nt}return _e}function q(U,P,k,J){return Vi(ut(P,U.length-k),U,k,J)}function M(U,P,k,J){return Vi(ft(P),U,k,J)}function V(U,P,k,J){return Vi(it(P),U,k,J)}function de(U,P,k,J){return Vi(bt(P,U.length-k),U,k,J)}N.prototype.write=function(P,k,J,oe){if(k===void 0)oe="utf8",J=this.length,k=0;else if(J===void 0&&typeof k=="string")oe=k,J=this.length,k=0;else if(isFinite(k))k=k>>>0,isFinite(J)?(J=J>>>0,oe===void 0&&(oe="utf8")):(oe=J,J=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const we=this.length-k;if((J===void 0||J>we)&&(J=we),P.length>0&&(J<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");oe||(oe="utf8");let _e=!1;for(;;)switch(oe){case"hex":return z(this,P,k,J);case"utf8":case"utf-8":return q(this,P,k,J);case"ascii":case"latin1":case"binary":return M(this,P,k,J);case"base64":return V(this,P,k,J);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return de(this,P,k,J);default:if(_e)throw new TypeError("Unknown encoding: "+oe);oe=(""+oe).toLowerCase(),_e=!0}},N.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Te(U,P,k){return P===0&&k===U.length?v.fromByteArray(U):v.fromByteArray(U.slice(P,k))}function Le(U,P,k){k=Math.min(U.length,k);const J=[];let oe=P;for(;oe<k;){const we=U[oe];let _e=null,nt=we>239?4:we>223?3:we>191?2:1;if(oe+nt<=k){let Dt,Ft,Lt,vt;switch(nt){case 1:we<128&&(_e=we);break;case 2:Dt=U[oe+1],(Dt&192)===128&&(vt=(we&31)<<6|Dt&63,vt>127&&(_e=vt));break;case 3:Dt=U[oe+1],Ft=U[oe+2],(Dt&192)===128&&(Ft&192)===128&&(vt=(we&15)<<12|(Dt&63)<<6|Ft&63,vt>2047&&(vt<55296||vt>57343)&&(_e=vt));break;case 4:Dt=U[oe+1],Ft=U[oe+2],Lt=U[oe+3],(Dt&192)===128&&(Ft&192)===128&&(Lt&192)===128&&(vt=(we&15)<<18|(Dt&63)<<12|(Ft&63)<<6|Lt&63,vt>65535&&vt<1114112&&(_e=vt))}}_e===null?(_e=65533,nt=1):_e>65535&&(_e-=65536,J.push(_e>>>10&1023|55296),_e=56320|_e&1023),J.push(_e),oe+=nt}return $e(J)}const ke=4096;function $e(U){const P=U.length;if(P<=ke)return String.fromCharCode.apply(String,U);let k="",J=0;for(;J<P;)k+=String.fromCharCode.apply(String,U.slice(J,J+=ke));return k}function Me(U,P,k){let J="";k=Math.min(U.length,k);for(let oe=P;oe<k;++oe)J+=String.fromCharCode(U[oe]&127);return J}function Y(U,P,k){let J="";k=Math.min(U.length,k);for(let oe=P;oe<k;++oe)J+=String.fromCharCode(U[oe]);return J}function Pe(U,P,k){const J=U.length;(!P||P<0)&&(P=0),(!k||k<0||k>J)&&(k=J);let oe="";for(let we=P;we<k;++we)oe+=Je[U[we]];return oe}function Ne(U,P,k){const J=U.slice(P,k);let oe="";for(let we=0;we<J.length-1;we+=2)oe+=String.fromCharCode(J[we]+J[we+1]*256);return oe}N.prototype.slice=function(P,k){const J=this.length;P=~~P,k=k===void 0?J:~~k,P<0?(P+=J,P<0&&(P=0)):P>J&&(P=J),k<0?(k+=J,k<0&&(k=0)):k>J&&(k=J),k<P&&(k=P);const oe=this.subarray(P,k);return Object.setPrototypeOf(oe,N.prototype),oe};function Ve(U,P,k){if(U%1!==0||U<0)throw new RangeError("offset is not uint");if(U+P>k)throw new RangeError("Trying to access beyond buffer length")}N.prototype.readUintLE=N.prototype.readUIntLE=function(P,k,J){P=P>>>0,k=k>>>0,J||Ve(P,k,this.length);let oe=this[P],we=1,_e=0;for(;++_e<k&&(we*=256);)oe+=this[P+_e]*we;return oe},N.prototype.readUintBE=N.prototype.readUIntBE=function(P,k,J){P=P>>>0,k=k>>>0,J||Ve(P,k,this.length);let oe=this[P+--k],we=1;for(;k>0&&(we*=256);)oe+=this[P+--k]*we;return oe},N.prototype.readUint8=N.prototype.readUInt8=function(P,k){return P=P>>>0,k||Ve(P,1,this.length),this[P]},N.prototype.readUint16LE=N.prototype.readUInt16LE=function(P,k){return P=P>>>0,k||Ve(P,2,this.length),this[P]|this[P+1]<<8},N.prototype.readUint16BE=N.prototype.readUInt16BE=function(P,k){return P=P>>>0,k||Ve(P,2,this.length),this[P]<<8|this[P+1]},N.prototype.readUint32LE=N.prototype.readUInt32LE=function(P,k){return P=P>>>0,k||Ve(P,4,this.length),(this[P]|this[P+1]<<8|this[P+2]<<16)+this[P+3]*16777216},N.prototype.readUint32BE=N.prototype.readUInt32BE=function(P,k){return P=P>>>0,k||Ve(P,4,this.length),this[P]*16777216+(this[P+1]<<16|this[P+2]<<8|this[P+3])},N.prototype.readBigUInt64LE=lt(function(P){P=P>>>0,ne(P,"offset");const k=this[P],J=this[P+7];(k===void 0||J===void 0)&&ye(P,this.length-8);const oe=k+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24,we=this[++P]+this[++P]*2**8+this[++P]*2**16+J*2**24;return BigInt(oe)+(BigInt(we)<<BigInt(32))}),N.prototype.readBigUInt64BE=lt(function(P){P=P>>>0,ne(P,"offset");const k=this[P],J=this[P+7];(k===void 0||J===void 0)&&ye(P,this.length-8);const oe=k*2**24+this[++P]*2**16+this[++P]*2**8+this[++P],we=this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+J;return(BigInt(oe)<<BigInt(32))+BigInt(we)}),N.prototype.readIntLE=function(P,k,J){P=P>>>0,k=k>>>0,J||Ve(P,k,this.length);let oe=this[P],we=1,_e=0;for(;++_e<k&&(we*=256);)oe+=this[P+_e]*we;return we*=128,oe>=we&&(oe-=Math.pow(2,8*k)),oe},N.prototype.readIntBE=function(P,k,J){P=P>>>0,k=k>>>0,J||Ve(P,k,this.length);let oe=k,we=1,_e=this[P+--oe];for(;oe>0&&(we*=256);)_e+=this[P+--oe]*we;return we*=128,_e>=we&&(_e-=Math.pow(2,8*k)),_e},N.prototype.readInt8=function(P,k){return P=P>>>0,k||Ve(P,1,this.length),this[P]&128?(255-this[P]+1)*-1:this[P]},N.prototype.readInt16LE=function(P,k){P=P>>>0,k||Ve(P,2,this.length);const J=this[P]|this[P+1]<<8;return J&32768?J|4294901760:J},N.prototype.readInt16BE=function(P,k){P=P>>>0,k||Ve(P,2,this.length);const J=this[P+1]|this[P]<<8;return J&32768?J|4294901760:J},N.prototype.readInt32LE=function(P,k){return P=P>>>0,k||Ve(P,4,this.length),this[P]|this[P+1]<<8|this[P+2]<<16|this[P+3]<<24},N.prototype.readInt32BE=function(P,k){return P=P>>>0,k||Ve(P,4,this.length),this[P]<<24|this[P+1]<<16|this[P+2]<<8|this[P+3]},N.prototype.readBigInt64LE=lt(function(P){P=P>>>0,ne(P,"offset");const k=this[P],J=this[P+7];(k===void 0||J===void 0)&&ye(P,this.length-8);const oe=this[P+4]+this[P+5]*2**8+this[P+6]*2**16+(J<<24);return(BigInt(oe)<<BigInt(32))+BigInt(k+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24)}),N.prototype.readBigInt64BE=lt(function(P){P=P>>>0,ne(P,"offset");const k=this[P],J=this[P+7];(k===void 0||J===void 0)&&ye(P,this.length-8);const oe=(k<<24)+this[++P]*2**16+this[++P]*2**8+this[++P];return(BigInt(oe)<<BigInt(32))+BigInt(this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+J)}),N.prototype.readFloatLE=function(P,k){return P=P>>>0,k||Ve(P,4,this.length),h.read(this,P,!0,23,4)},N.prototype.readFloatBE=function(P,k){return P=P>>>0,k||Ve(P,4,this.length),h.read(this,P,!1,23,4)},N.prototype.readDoubleLE=function(P,k){return P=P>>>0,k||Ve(P,8,this.length),h.read(this,P,!0,52,8)},N.prototype.readDoubleBE=function(P,k){return P=P>>>0,k||Ve(P,8,this.length),h.read(this,P,!1,52,8)};function et(U,P,k,J,oe,we){if(!N.isBuffer(U))throw new TypeError('"buffer" argument must be a Buffer instance');if(P>oe||P<we)throw new RangeError('"value" argument is out of bounds');if(k+J>U.length)throw new RangeError("Index out of range")}N.prototype.writeUintLE=N.prototype.writeUIntLE=function(P,k,J,oe){if(P=+P,k=k>>>0,J=J>>>0,!oe){const nt=Math.pow(2,8*J)-1;et(this,P,k,J,nt,0)}let we=1,_e=0;for(this[k]=P&255;++_e<J&&(we*=256);)this[k+_e]=P/we&255;return k+J},N.prototype.writeUintBE=N.prototype.writeUIntBE=function(P,k,J,oe){if(P=+P,k=k>>>0,J=J>>>0,!oe){const nt=Math.pow(2,8*J)-1;et(this,P,k,J,nt,0)}let we=J-1,_e=1;for(this[k+we]=P&255;--we>=0&&(_e*=256);)this[k+we]=P/_e&255;return k+J},N.prototype.writeUint8=N.prototype.writeUInt8=function(P,k,J){return P=+P,k=k>>>0,J||et(this,P,k,1,255,0),this[k]=P&255,k+1},N.prototype.writeUint16LE=N.prototype.writeUInt16LE=function(P,k,J){return P=+P,k=k>>>0,J||et(this,P,k,2,65535,0),this[k]=P&255,this[k+1]=P>>>8,k+2},N.prototype.writeUint16BE=N.prototype.writeUInt16BE=function(P,k,J){return P=+P,k=k>>>0,J||et(this,P,k,2,65535,0),this[k]=P>>>8,this[k+1]=P&255,k+2},N.prototype.writeUint32LE=N.prototype.writeUInt32LE=function(P,k,J){return P=+P,k=k>>>0,J||et(this,P,k,4,4294967295,0),this[k+3]=P>>>24,this[k+2]=P>>>16,this[k+1]=P>>>8,this[k]=P&255,k+4},N.prototype.writeUint32BE=N.prototype.writeUInt32BE=function(P,k,J){return P=+P,k=k>>>0,J||et(this,P,k,4,4294967295,0),this[k]=P>>>24,this[k+1]=P>>>16,this[k+2]=P>>>8,this[k+3]=P&255,k+4};function Nt(U,P,k,J,oe){Q(P,J,oe,U,k,7);let we=Number(P&BigInt(4294967295));U[k++]=we,we=we>>8,U[k++]=we,we=we>>8,U[k++]=we,we=we>>8,U[k++]=we;let _e=Number(P>>BigInt(32)&BigInt(4294967295));return U[k++]=_e,_e=_e>>8,U[k++]=_e,_e=_e>>8,U[k++]=_e,_e=_e>>8,U[k++]=_e,k}function _t(U,P,k,J,oe){Q(P,J,oe,U,k,7);let we=Number(P&BigInt(4294967295));U[k+7]=we,we=we>>8,U[k+6]=we,we=we>>8,U[k+5]=we,we=we>>8,U[k+4]=we;let _e=Number(P>>BigInt(32)&BigInt(4294967295));return U[k+3]=_e,_e=_e>>8,U[k+2]=_e,_e=_e>>8,U[k+1]=_e,_e=_e>>8,U[k]=_e,k+8}N.prototype.writeBigUInt64LE=lt(function(P,k=0){return Nt(this,P,k,BigInt(0),BigInt("0xffffffffffffffff"))}),N.prototype.writeBigUInt64BE=lt(function(P,k=0){return _t(this,P,k,BigInt(0),BigInt("0xffffffffffffffff"))}),N.prototype.writeIntLE=function(P,k,J,oe){if(P=+P,k=k>>>0,!oe){const Dt=Math.pow(2,8*J-1);et(this,P,k,J,Dt-1,-Dt)}let we=0,_e=1,nt=0;for(this[k]=P&255;++we<J&&(_e*=256);)P<0&&nt===0&&this[k+we-1]!==0&&(nt=1),this[k+we]=(P/_e>>0)-nt&255;return k+J},N.prototype.writeIntBE=function(P,k,J,oe){if(P=+P,k=k>>>0,!oe){const Dt=Math.pow(2,8*J-1);et(this,P,k,J,Dt-1,-Dt)}let we=J-1,_e=1,nt=0;for(this[k+we]=P&255;--we>=0&&(_e*=256);)P<0&&nt===0&&this[k+we+1]!==0&&(nt=1),this[k+we]=(P/_e>>0)-nt&255;return k+J},N.prototype.writeInt8=function(P,k,J){return P=+P,k=k>>>0,J||et(this,P,k,1,127,-128),P<0&&(P=255+P+1),this[k]=P&255,k+1},N.prototype.writeInt16LE=function(P,k,J){return P=+P,k=k>>>0,J||et(this,P,k,2,32767,-32768),this[k]=P&255,this[k+1]=P>>>8,k+2},N.prototype.writeInt16BE=function(P,k,J){return P=+P,k=k>>>0,J||et(this,P,k,2,32767,-32768),this[k]=P>>>8,this[k+1]=P&255,k+2},N.prototype.writeInt32LE=function(P,k,J){return P=+P,k=k>>>0,J||et(this,P,k,4,2147483647,-2147483648),this[k]=P&255,this[k+1]=P>>>8,this[k+2]=P>>>16,this[k+3]=P>>>24,k+4},N.prototype.writeInt32BE=function(P,k,J){return P=+P,k=k>>>0,J||et(this,P,k,4,2147483647,-2147483648),P<0&&(P=4294967295+P+1),this[k]=P>>>24,this[k+1]=P>>>16,this[k+2]=P>>>8,this[k+3]=P&255,k+4},N.prototype.writeBigInt64LE=lt(function(P,k=0){return Nt(this,P,k,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),N.prototype.writeBigInt64BE=lt(function(P,k=0){return _t(this,P,k,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function $t(U,P,k,J,oe,we){if(k+J>U.length)throw new RangeError("Index out of range");if(k<0)throw new RangeError("Index out of range")}function Be(U,P,k,J,oe){return P=+P,k=k>>>0,oe||$t(U,P,k,4),h.write(U,P,k,J,23,4),k+4}N.prototype.writeFloatLE=function(P,k,J){return Be(this,P,k,!0,J)},N.prototype.writeFloatBE=function(P,k,J){return Be(this,P,k,!1,J)};function ze(U,P,k,J,oe){return P=+P,k=k>>>0,oe||$t(U,P,k,8),h.write(U,P,k,J,52,8),k+8}N.prototype.writeDoubleLE=function(P,k,J){return ze(this,P,k,!0,J)},N.prototype.writeDoubleBE=function(P,k,J){return ze(this,P,k,!1,J)},N.prototype.copy=function(P,k,J,oe){if(!N.isBuffer(P))throw new TypeError("argument should be a Buffer");if(J||(J=0),!oe&&oe!==0&&(oe=this.length),k>=P.length&&(k=P.length),k||(k=0),oe>0&&oe<J&&(oe=J),oe===J||P.length===0||this.length===0)return 0;if(k<0)throw new RangeError("targetStart out of bounds");if(J<0||J>=this.length)throw new RangeError("Index out of range");if(oe<0)throw new RangeError("sourceEnd out of bounds");oe>this.length&&(oe=this.length),P.length-k<oe-J&&(oe=P.length-k+J);const we=oe-J;return this===P&&typeof R.prototype.copyWithin=="function"?this.copyWithin(k,J,oe):R.prototype.set.call(P,this.subarray(J,oe),k),we},N.prototype.fill=function(P,k,J,oe){if(typeof P=="string"){if(typeof k=="string"?(oe=k,k=0,J=this.length):typeof J=="string"&&(oe=J,J=this.length),oe!==void 0&&typeof oe!="string")throw new TypeError("encoding must be a string");if(typeof oe=="string"&&!N.isEncoding(oe))throw new TypeError("Unknown encoding: "+oe);if(P.length===1){const _e=P.charCodeAt(0);(oe==="utf8"&&_e<128||oe==="latin1")&&(P=_e)}}else typeof P=="number"?P=P&255:typeof P=="boolean"&&(P=Number(P));if(k<0||this.length<k||this.length<J)throw new RangeError("Out of range index");if(J<=k)return this;k=k>>>0,J=J===void 0?this.length:J>>>0,P||(P=0);let we;if(typeof P=="number")for(we=k;we<J;++we)this[we]=P;else{const _e=N.isBuffer(P)?P:N.from(P,oe),nt=_e.length;if(nt===0)throw new TypeError('The value "'+P+'" is invalid for argument "value"');for(we=0;we<J-k;++we)this[we+k]=_e[we%nt]}return this};const dn={};function j(U,P,k){dn[U]=class extends k{constructor(){super(),Object.defineProperty(this,"message",{value:P.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${U}]`,this.stack,delete this.name}get code(){return U}set code(oe){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:oe,writable:!0})}toString(){return`${this.name} [${U}]: ${this.message}`}}}j("ERR_BUFFER_OUT_OF_BOUNDS",function(U){return U?`${U} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),j("ERR_INVALID_ARG_TYPE",function(U,P){return`The "${U}" argument must be of type number. Received type ${typeof P}`},TypeError),j("ERR_OUT_OF_RANGE",function(U,P,k){let J=`The value of "${U}" is out of range.`,oe=k;return Number.isInteger(k)&&Math.abs(k)>2**32?oe=I(String(k)):typeof k=="bigint"&&(oe=String(k),(k>BigInt(2)**BigInt(32)||k<-(BigInt(2)**BigInt(32)))&&(oe=I(oe)),oe+="n"),J+=` It must be ${P}. Received ${oe}`,J},RangeError);function I(U){let P="",k=U.length;const J=U[0]==="-"?1:0;for(;k>=J+4;k-=3)P=`_${U.slice(k-3,k)}${P}`;return`${U.slice(0,k)}${P}`}function O(U,P,k){ne(P,"offset"),(U[P]===void 0||U[P+k]===void 0)&&ye(P,U.length-(k+1))}function Q(U,P,k,J,oe,we){if(U>k||U<P){const _e=typeof P=="bigint"?"n":"";let nt;throw P===0||P===BigInt(0)?nt=`>= 0${_e} and < 2${_e} ** ${(we+1)*8}${_e}`:nt=`>= -(2${_e} ** ${(we+1)*8-1}${_e}) and < 2 ** ${(we+1)*8-1}${_e}`,new dn.ERR_OUT_OF_RANGE("value",nt,U)}O(J,oe,we)}function ne(U,P){if(typeof U!="number")throw new dn.ERR_INVALID_ARG_TYPE(P,"number",U)}function ye(U,P,k){throw Math.floor(U)!==U?(ne(U,k),new dn.ERR_OUT_OF_RANGE("offset","an integer",U)):P<0?new dn.ERR_BUFFER_OUT_OF_BOUNDS:new dn.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${P}`,U)}const Ae=/[^+/0-9A-Za-z-_]/g;function Ye(U){if(U=U.split("=")[0],U=U.trim().replace(Ae,""),U.length<2)return"";for(;U.length%4!==0;)U=U+"=";return U}function ut(U,P){P=P||1/0;let k;const J=U.length;let oe=null;const we=[];for(let _e=0;_e<J;++_e){if(k=U.charCodeAt(_e),k>55295&&k<57344){if(!oe){if(k>56319){(P-=3)>-1&&we.push(239,191,189);continue}else if(_e+1===J){(P-=3)>-1&&we.push(239,191,189);continue}oe=k;continue}if(k<56320){(P-=3)>-1&&we.push(239,191,189),oe=k;continue}k=(oe-55296<<10|k-56320)+65536}else oe&&(P-=3)>-1&&we.push(239,191,189);if(oe=null,k<128){if((P-=1)<0)break;we.push(k)}else if(k<2048){if((P-=2)<0)break;we.push(k>>6|192,k&63|128)}else if(k<65536){if((P-=3)<0)break;we.push(k>>12|224,k>>6&63|128,k&63|128)}else if(k<1114112){if((P-=4)<0)break;we.push(k>>18|240,k>>12&63|128,k>>6&63|128,k&63|128)}else throw new Error("Invalid code point")}return we}function ft(U){const P=[];for(let k=0;k<U.length;++k)P.push(U.charCodeAt(k)&255);return P}function bt(U,P){let k,J,oe;const we=[];for(let _e=0;_e<U.length&&!((P-=2)<0);++_e)k=U.charCodeAt(_e),J=k>>8,oe=k%256,we.push(oe),we.push(J);return we}function it(U){return v.toByteArray(Ye(U))}function Vi(U,P,k,J){let oe;for(oe=0;oe<J&&!(oe+k>=P.length||oe>=U.length);++oe)P[oe+k]=U[oe];return oe}function jn(U,P){return U instanceof P||U!=null&&U.constructor!=null&&U.constructor.name!=null&&U.constructor.name===P.name}function De(U){return U!==U}const Je=function(){const U="0123456789abcdef",P=new Array(256);for(let k=0;k<16;++k){const J=k*16;for(let oe=0;oe<16;++oe)P[J+oe]=U[k]+U[oe]}return P}();function lt(U){return typeof BigInt>"u"?Un:U}function Un(){throw new Error("BigInt not supported")}})(t);const b=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=b,e.isAscii=t.isAscii,e.isUtf8=t.isUtf8,e.kMaxLength=t.kMaxLength,e.kStringMaxLength=t.kStringMaxLength,e.resolveObjectURL=t.resolveObjectURL,e.transcode=t.transcode}(sc)),sc}var ac={},lc={},cc,ag;function lg(){return ag||(ag=1,cc=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 o=42;t[n]=o;for(var i 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!==o||a.enumerable!==!0)return!1}return!0}),cc}var uc,cg;function Cs(){if(cg)return uc;cg=1;var e=lg();return uc=function(){return e()&&!!Symbol.toStringTag},uc}var fc,ug;function fg(){return ug||(ug=1,fc=Object),fc}var dc,dg;function xA(){return dg||(dg=1,dc=Error),dc}var pc,pg;function NA(){return pg||(pg=1,pc=EvalError),pc}var hc,hg;function $A(){return hg||(hg=1,hc=RangeError),hc}var gc,gg;function DA(){return gg||(gg=1,gc=ReferenceError),gc}var mc,mg;function yg(){return mg||(mg=1,mc=SyntaxError),mc}var yc,bg;function ho(){return bg||(bg=1,yc=TypeError),yc}var bc,vg;function LA(){return vg||(vg=1,bc=URIError),bc}var vc,wg;function MA(){return wg||(wg=1,vc=Math.abs),vc}var wc,Sg;function BA(){return Sg||(Sg=1,wc=Math.floor),wc}var Sc,Eg;function jA(){return Eg||(Eg=1,Sc=Math.max),Sc}var Ec,Tg;function UA(){return Tg||(Tg=1,Ec=Math.min),Ec}var Tc,Ag;function qA(){return Ag||(Ag=1,Tc=Math.pow),Tc}var Ac,Rg;function VA(){return Rg||(Rg=1,Ac=Math.round),Ac}var Rc,_g;function zA(){return _g||(_g=1,Rc=Number.isNaN||function(t){return t!==t}),Rc}var _c,Ig;function WA(){if(Ig)return _c;Ig=1;var e=zA();return _c=function(n){return e(n)||n===0?n:n<0?-1:1},_c}var Ic,Cg;function HA(){return Cg||(Cg=1,Ic=Object.getOwnPropertyDescriptor),Ic}var Cc,Pg;function xi(){if(Pg)return Cc;Pg=1;var e=HA();if(e)try{e([],"length")}catch{e=null}return Cc=e,Cc}var Pc,Fg;function Ps(){if(Fg)return Pc;Fg=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Pc=e,Pc}var Fc,Og;function GA(){if(Og)return Fc;Og=1;var e=typeof Symbol<"u"&&Symbol,t=lg();return Fc=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Fc}var Oc,kg;function xg(){return kg||(kg=1,Oc=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Oc}var kc,Ng;function $g(){if(Ng)return kc;Ng=1;var e=fg();return kc=e.getPrototypeOf||null,kc}var xc,Dg;function KA(){if(Dg)return xc;Dg=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,n=Math.max,r="[object Function]",o=function(c,u){for(var l=[],d=0;d<c.length;d+=1)l[d]=c[d];for(var f=0;f<u.length;f+=1)l[f+c.length]=u[f];return l},i=function(c,u){for(var l=[],d=u,f=0;d<c.length;d+=1,f+=1)l[f]=c[d];return l},s=function(a,c){for(var u="",l=0;l<a.length;l+=1)u+=a[l],l+1<a.length&&(u+=c);return u};return xc=function(c){var u=this;if(typeof u!="function"||t.apply(u)!==r)throw new TypeError(e+u);for(var l=i(arguments,1),d,f=function(){if(this instanceof d){var b=u.apply(this,o(l,arguments));return Object(b)===b?b:this}return u.apply(c,o(l,arguments))},m=n(0,u.length-l.length),w=[],y=0;y<m;y++)w[y]="$"+y;if(d=Function("binder","return function ("+s(w,",")+"){ return binder.apply(this,arguments); }")(f),u.prototype){var E=function(){};E.prototype=u.prototype,d.prototype=new E,E.prototype=null}return d},xc}var Nc,Lg;function go(){if(Lg)return Nc;Lg=1;var e=KA();return Nc=Function.prototype.bind||e,Nc}var $c,Mg;function Dc(){return Mg||(Mg=1,$c=Function.prototype.call),$c}var Lc,Bg;function Mc(){return Bg||(Bg=1,Lc=Function.prototype.apply),Lc}var Bc,jg;function QA(){return jg||(jg=1,Bc=typeof Reflect<"u"&&Reflect&&Reflect.apply),Bc}var jc,Ug;function qg(){if(Ug)return jc;Ug=1;var e=go(),t=Mc(),n=Dc(),r=QA();return jc=r||e.call(n,t),jc}var Uc,Vg;function qc(){if(Vg)return Uc;Vg=1;var e=go(),t=ho(),n=Dc(),r=qg();return Uc=function(i){if(i.length<1||typeof i[0]!="function")throw new t("a function is required");return r(e,n,i)},Uc}var Vc,zg;function XA(){if(zg)return Vc;zg=1;var e=qc(),t=xi(),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__"),o=Object,i=o.getPrototypeOf;return Vc=r&&typeof r.get=="function"?e([r.get]):typeof i=="function"?function(a){return i(a==null?a:o(a))}:!1,Vc}var zc,Wg;function Wc(){if(Wg)return zc;Wg=1;var e=xg(),t=$g(),n=XA();return zc=e?function(o){return e(o)}:t?function(o){if(!o||typeof o!="object"&&typeof o!="function")throw new TypeError("getProto: not an object");return t(o)}:n?function(o){return n(o)}:null,zc}var Hc,Hg;function Gg(){if(Hg)return Hc;Hg=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,n=go();return Hc=n.call(e,t),Hc}var Gc,Kg;function Qg(){if(Kg)return Gc;Kg=1;var e,t=fg(),n=xA(),r=NA(),o=$A(),i=DA(),s=yg(),a=ho(),c=LA(),u=MA(),l=BA(),d=jA(),f=UA(),m=qA(),w=VA(),y=WA(),E=Function,b=function(z){try{return E('"use strict"; return ('+z+").constructor;")()}catch{}},g=xi(),v=Ps(),h=function(){throw new a},S=g?function(){try{return arguments.callee,h}catch{try{return g(arguments,"callee").get}catch{return h}}}():h,T=GA()(),R=Wc(),_=$g(),A=xg(),$=Mc(),D=Dc(),N={},x=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%":N,"%AsyncGenerator%":N,"%AsyncGeneratorFunction%":N,"%AsyncIteratorPrototype%":N,"%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%":E,"%GeneratorFunction%":N,"%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%":o,"%ReferenceError%":i,"%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%":S,"%TypedArray%":x,"%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%":c,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":D,"%Function.prototype.apply%":$,"%Object.defineProperty%":v,"%Object.getPrototypeOf%":_,"%Math.abs%":u,"%Math.floor%":l,"%Math.max%":d,"%Math.min%":f,"%Math.pow%":m,"%Math.round%":w,"%Math.sign%":y,"%Reflect.getPrototypeOf%":A};if(R)try{null.error}catch(z){var K=R(R(z));W["%Error.prototype%"]=K}var le=function z(q){var M;if(q==="%AsyncFunction%")M=b("async function () {}");else if(q==="%GeneratorFunction%")M=b("function* () {}");else if(q==="%AsyncGeneratorFunction%")M=b("async function* () {}");else if(q==="%AsyncGenerator%"){var V=z("%AsyncGeneratorFunction%");V&&(M=V.prototype)}else if(q==="%AsyncIteratorPrototype%"){var de=z("%AsyncGenerator%");de&&R&&(M=R(de.prototype))}return W[q]=M,M},be={__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"]},te=go(),ae=Gg(),ue=te.call(D,Array.prototype.concat),ie=te.call($,Array.prototype.splice),G=te.call(D,String.prototype.replace),re=te.call(D,String.prototype.slice),se=te.call(D,RegExp.prototype.exec),Ie=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ee=/\\(\\)?/g,F=function(q){var M=re(q,0,1),V=re(q,-1);if(M==="%"&&V!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(V==="%"&&M!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var de=[];return G(q,Ie,function(Te,Le,ke,$e){de[de.length]=ke?G($e,ee,"$1"):Le||Te}),de},C=function(q,M){var V=q,de;if(ae(be,V)&&(de=be[V],V="%"+de[0]+"%"),ae(W,V)){var Te=W[V];if(Te===N&&(Te=le(V)),typeof Te>"u"&&!M)throw new a("intrinsic "+q+" exists, but is not available. Please file an issue!");return{alias:de,name:V,value:Te}}throw new s("intrinsic "+q+" does not exist!")};return Gc=function(q,M){if(typeof q!="string"||q.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof M!="boolean")throw new a('"allowMissing" argument must be a boolean');if(se(/^%?[^%]*%?$/,q)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var V=F(q),de=V.length>0?V[0]:"",Te=C("%"+de+"%",M),Le=Te.name,ke=Te.value,$e=!1,Me=Te.alias;Me&&(de=Me[0],ie(V,ue([0,1],Me)));for(var Y=1,Pe=!0;Y<V.length;Y+=1){var Ne=V[Y],Ve=re(Ne,0,1),et=re(Ne,-1);if((Ve==='"'||Ve==="'"||Ve==="`"||et==='"'||et==="'"||et==="`")&&Ve!==et)throw new s("property names with quotes must have matching quotes");if((Ne==="constructor"||!Pe)&&($e=!0),de+="."+Ne,Le="%"+de+"%",ae(W,Le))ke=W[Le];else if(ke!=null){if(!(Ne in ke)){if(!M)throw new a("base intrinsic for "+q+" exists, but the property is not available.");return}if(g&&Y+1>=V.length){var Nt=g(ke,Ne);Pe=!!Nt,Pe&&"get"in Nt&&!("originalValue"in Nt.get)?ke=Nt.get:ke=ke[Ne]}else Pe=ae(ke,Ne),ke=ke[Ne];Pe&&!$e&&(W[Le]=ke)}}return ke},Gc}var Kc,Xg;function mo(){if(Xg)return Kc;Xg=1;var e=Qg(),t=qc(),n=t([e("%String.prototype.indexOf%")]);return Kc=function(o,i){var s=e(o,!!i);return typeof s=="function"&&n(o,".prototype.")>-1?t([s]):s},Kc}var Qc,Yg;function YA(){if(Yg)return Qc;Yg=1;var e=Cs()(),t=mo(),n=t("Object.prototype.toString"),r=function(a){return e&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:n(a)==="[object Arguments]"},o=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]"},i=function(){return r(arguments)}();return r.isLegacyArguments=o,Qc=i?r:o,Qc}var Xc,Jg;function JA(){if(Jg)return Xc;Jg=1;var e=mo(),t=Cs()(),n=Gg(),r=xi(),o;if(t){var i=e("RegExp.prototype.exec"),s={},a=function(){throw s},c={toString:a,valueOf:a};typeof Symbol.toPrimitive=="symbol"&&(c[Symbol.toPrimitive]=a),o=function(f){if(!f||typeof f!="object")return!1;var m=r(f,"lastIndex"),w=m&&n(m,"value");if(!w)return!1;try{i(f,c)}catch(y){return y===s}}}else{var u=e("Object.prototype.toString"),l="[object RegExp]";o=function(f){return!f||typeof f!="object"&&typeof f!="function"?!1:u(f)===l}}return Xc=o,Xc}var Yc,Zg;function ZA(){if(Zg)return Yc;Zg=1;var e=mo(),t=JA(),n=e("RegExp.prototype.exec"),r=ho();return Yc=function(i){if(!t(i))throw new r("`regex` must be a RegExp");return function(a){return n(i,a)!==null}},Yc}var Jc,em;function eR(){if(em)return Jc;em=1;var e=mo(),t=ZA(),n=t(/^\s*(?:function)?\*/),r=Cs()(),o=Wc(),i=e("Object.prototype.toString"),s=e("Function.prototype.toString"),a=function(){if(!r)return!1;try{return Function("return function*() {}")()}catch{}},c;return Jc=function(l){if(typeof l!="function")return!1;if(n(s(l)))return!0;if(!r){var d=i(l);return d==="[object GeneratorFunction]"}if(!o)return!1;if(typeof c>"u"){var f=a();c=f?o(f):!1}return o(l)===c},Jc}var Zc,tm;function tR(){if(tm)return Zc;tm=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 o=/^\s*class\b/,i=function(v){try{var h=e.call(v);return o.test(h)}catch{return!1}},s=function(v){try{return i(v)?!1:(e.call(v),!0)}catch{return!1}},a=Object.prototype.toString,c="[object Object]",u="[object Function]",l="[object GeneratorFunction]",d="[object HTMLAllCollection]",f="[object HTML document.all class]",m="[object HTMLCollection]",w=typeof Symbol=="function"&&!!Symbol.toStringTag,y=!(0 in[,]),E=function(){return!1};if(typeof document=="object"){var b=document.all;a.call(b)===a.call(document.all)&&(E=function(v){if((y||!v)&&(typeof v>"u"||typeof v=="object"))try{var h=a.call(v);return(h===d||h===f||h===m||h===c)&&v("")==null}catch{}return!1})}return Zc=t?function(v){if(E(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!i(v)&&s(v)}:function(v){if(E(v))return!0;if(!v||typeof v!="function"&&typeof v!="object")return!1;if(w)return s(v);if(i(v))return!1;var h=a.call(v);return h!==u&&h!==l&&!/^\[object HTML/.test(h)?!1:s(v)},Zc}var eu,nm;function nR(){if(nm)return eu;nm=1;var e=tR(),t=Object.prototype.toString,n=Object.prototype.hasOwnProperty,r=function(c,u,l){for(var d=0,f=c.length;d<f;d++)n.call(c,d)&&(l==null?u(c[d],d,c):u.call(l,c[d],d,c))},o=function(c,u,l){for(var d=0,f=c.length;d<f;d++)l==null?u(c.charAt(d),d,c):u.call(l,c.charAt(d),d,c)},i=function(c,u,l){for(var d in c)n.call(c,d)&&(l==null?u(c[d],d,c):u.call(l,c[d],d,c))};function s(a){return t.call(a)==="[object Array]"}return eu=function(c,u,l){if(!e(u))throw new TypeError("iterator must be a function");var d;arguments.length>=3&&(d=l),s(c)?r(c,u,d):typeof c=="string"?o(c,u,d):i(c,u,d)},eu}var tu,rm;function rR(){return rm||(rm=1,tu=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),tu}var nu,im;function iR(){if(im)return nu;im=1;var e=rR(),t=typeof globalThis>"u"?$r:globalThis;return nu=function(){for(var r=[],o=0;o<e.length;o++)typeof t[e[o]]=="function"&&(r[r.length]=e[o]);return r},nu}var ru={exports:{}},iu,om;function oR(){if(om)return iu;om=1;var e=Ps(),t=yg(),n=ho(),r=xi();return iu=function(i,s,a){if(!i||typeof i!="object"&&typeof i!="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 c=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,d=arguments.length>6?arguments[6]:!1,f=!!r&&r(i,s);if(e)e(i,s,{configurable:l===null&&f?f.configurable:!l,enumerable:c===null&&f?f.enumerable:!c,value:a,writable:u===null&&f?f.writable:!u});else if(d||!c&&!u&&!l)i[s]=a;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},iu}var ou,sm;function sR(){if(sm)return ou;sm=1;var e=Ps(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},ou=t,ou}var su,am;function aR(){if(am)return su;am=1;var e=Qg(),t=oR(),n=sR()(),r=xi(),o=ho(),i=e("%Math.floor%");return su=function(a,c){if(typeof a!="function")throw new o("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||i(c)!==c)throw new o("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],l=!0,d=!0;if("length"in a&&r){var f=r(a,"length");f&&!f.configurable&&(l=!1),f&&!f.writable&&(d=!1)}return(l||d||!u)&&(n?t(a,"length",c,!0,!0):t(a,"length",c)),a},su}var au,lm;function lR(){if(lm)return au;lm=1;var e=go(),t=Mc(),n=qg();return au=function(){return n(e,t,arguments)},au}var cm;function cR(){return cm||(cm=1,function(e){var t=aR(),n=Ps(),r=qc(),o=lR();e.exports=function(s){var a=r(arguments),c=s.length-(arguments.length-1);return t(a,1+(c>0?c:0),!0)},n?n(e.exports,"apply",{value:o}):e.exports.apply=o}(ru)),ru.exports}var lu,um;function fm(){if(um)return lu;um=1;var e=nR(),t=iR(),n=cR(),r=mo(),o=xi(),i=Wc(),s=r("Object.prototype.toString"),a=Cs()(),c=typeof globalThis>"u"?$r:globalThis,u=t(),l=r("String.prototype.slice"),d=r("Array.prototype.indexOf",!0)||function(E,b){for(var g=0;g<E.length;g+=1)if(E[g]===b)return g;return-1},f={__proto__:null};a&&o&&i?e(u,function(y){var E=new c[y];if(Symbol.toStringTag in E&&i){var b=i(E),g=o(b,Symbol.toStringTag);if(!g&&b){var v=i(b);g=o(v,Symbol.toStringTag)}f["$"+y]=n(g.get)}}):e(u,function(y){var E=new c[y],b=E.slice||E.set;b&&(f["$"+y]=n(b))});var m=function(E){var b=!1;return e(f,function(g,v){if(!b)try{"$"+g(E)===v&&(b=l(v,1))}catch{}}),b},w=function(E){var b=!1;return e(f,function(g,v){if(!b)try{g(E),b=l(v,1)}catch{}}),b};return lu=function(E){if(!E||typeof E!="object")return!1;if(!a){var b=l(s(E),8,-1);return d(u,b)>-1?b:b!=="Object"?!1:w(E)}return o?m(E):null},lu}var cu,dm;function uR(){if(dm)return cu;dm=1;var e=fm();return cu=function(n){return!!e(n)},cu}var pm;function fR(){return pm||(pm=1,function(e){var t=YA(),n=eR(),r=fm(),o=uR();function i(Y){return Y.call.bind(Y)}var s=typeof BigInt<"u",a=typeof Symbol<"u",c=i(Object.prototype.toString),u=i(Number.prototype.valueOf),l=i(String.prototype.valueOf),d=i(Boolean.prototype.valueOf);if(s)var f=i(BigInt.prototype.valueOf);if(a)var m=i(Symbol.prototype.valueOf);function w(Y,Pe){if(typeof Y!="object")return!1;try{return Pe(Y),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=n,e.isTypedArray=o;function y(Y){return typeof Promise<"u"&&Y instanceof Promise||Y!==null&&typeof Y=="object"&&typeof Y.then=="function"&&typeof Y.catch=="function"}e.isPromise=y;function E(Y){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Y):o(Y)||re(Y)}e.isArrayBufferView=E;function b(Y){return r(Y)==="Uint8Array"}e.isUint8Array=b;function g(Y){return r(Y)==="Uint8ClampedArray"}e.isUint8ClampedArray=g;function v(Y){return r(Y)==="Uint16Array"}e.isUint16Array=v;function h(Y){return r(Y)==="Uint32Array"}e.isUint32Array=h;function S(Y){return r(Y)==="Int8Array"}e.isInt8Array=S;function T(Y){return r(Y)==="Int16Array"}e.isInt16Array=T;function R(Y){return r(Y)==="Int32Array"}e.isInt32Array=R;function _(Y){return r(Y)==="Float32Array"}e.isFloat32Array=_;function A(Y){return r(Y)==="Float64Array"}e.isFloat64Array=A;function $(Y){return r(Y)==="BigInt64Array"}e.isBigInt64Array=$;function D(Y){return r(Y)==="BigUint64Array"}e.isBigUint64Array=D;function N(Y){return c(Y)==="[object Map]"}N.working=typeof Map<"u"&&N(new Map);function x(Y){return typeof Map>"u"?!1:N.working?N(Y):Y instanceof Map}e.isMap=x;function W(Y){return c(Y)==="[object Set]"}W.working=typeof Set<"u"&&W(new Set);function K(Y){return typeof Set>"u"?!1:W.working?W(Y):Y instanceof Set}e.isSet=K;function le(Y){return c(Y)==="[object WeakMap]"}le.working=typeof WeakMap<"u"&&le(new WeakMap);function be(Y){return typeof WeakMap>"u"?!1:le.working?le(Y):Y instanceof WeakMap}e.isWeakMap=be;function te(Y){return c(Y)==="[object WeakSet]"}te.working=typeof WeakSet<"u"&&te(new WeakSet);function ae(Y){return te(Y)}e.isWeakSet=ae;function ue(Y){return c(Y)==="[object ArrayBuffer]"}ue.working=typeof ArrayBuffer<"u"&&ue(new ArrayBuffer);function ie(Y){return typeof ArrayBuffer>"u"?!1:ue.working?ue(Y):Y instanceof ArrayBuffer}e.isArrayBuffer=ie;function G(Y){return c(Y)==="[object DataView]"}G.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&G(new DataView(new ArrayBuffer(1),0,1));function re(Y){return typeof DataView>"u"?!1:G.working?G(Y):Y instanceof DataView}e.isDataView=re;var se=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Ie(Y){return c(Y)==="[object SharedArrayBuffer]"}function ee(Y){return typeof se>"u"?!1:(typeof Ie.working>"u"&&(Ie.working=Ie(new se)),Ie.working?Ie(Y):Y instanceof se)}e.isSharedArrayBuffer=ee;function F(Y){return c(Y)==="[object AsyncFunction]"}e.isAsyncFunction=F;function C(Y){return c(Y)==="[object Map Iterator]"}e.isMapIterator=C;function z(Y){return c(Y)==="[object Set Iterator]"}e.isSetIterator=z;function q(Y){return c(Y)==="[object Generator]"}e.isGeneratorObject=q;function M(Y){return c(Y)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=M;function V(Y){return w(Y,u)}e.isNumberObject=V;function de(Y){return w(Y,l)}e.isStringObject=de;function Te(Y){return w(Y,d)}e.isBooleanObject=Te;function Le(Y){return s&&w(Y,f)}e.isBigIntObject=Le;function ke(Y){return a&&w(Y,m)}e.isSymbolObject=ke;function $e(Y){return V(Y)||de(Y)||Te(Y)||Le(Y)||ke(Y)}e.isBoxedPrimitive=$e;function Me(Y){return typeof Uint8Array<"u"&&(ie(Y)||ee(Y))}e.isAnyArrayBuffer=Me,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Y){Object.defineProperty(e,Y,{enumerable:!1,value:function(){throw new Error(Y+" is not supported in userland")}})})}(lc)),lc}var uu,hm;function dR(){return hm||(hm=1,uu=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),uu}var gm;function mm(){return gm||(gm=1,function(e){var t=Object.getOwnPropertyDescriptors||function(re){for(var se=Object.keys(re),Ie={},ee=0;ee<se.length;ee++)Ie[se[ee]]=Object.getOwnPropertyDescriptor(re,se[ee]);return Ie},n=/%[sdj%]/g;e.format=function(G){if(!S(G)){for(var re=[],se=0;se<arguments.length;se++)re.push(s(arguments[se]));return re.join(" ")}for(var se=1,Ie=arguments,ee=Ie.length,F=String(G).replace(n,function(z){if(z==="%%")return"%";if(se>=ee)return z;switch(z){case"%s":return String(Ie[se++]);case"%d":return Number(Ie[se++]);case"%j":try{return JSON.stringify(Ie[se++])}catch{return"[Circular]"}default:return z}}),C=Ie[se];se<ee;C=Ie[++se])g(C)||!A(C)?F+=" "+C:F+=" "+s(C);return F},e.deprecate=function(G,re){if(typeof ve<"u"&&ve.noDeprecation===!0)return G;if(typeof ve>"u")return function(){return e.deprecate(G,re).apply(this,arguments)};var se=!1;function Ie(){if(!se){if(ve.throwDeprecation)throw new Error(re);ve.traceDeprecation?console.trace(re):console.error(re),se=!0}return G.apply(this,arguments)}return Ie};var r={},o=/^$/;if(ve.env.NODE_DEBUG){var i=ve.env.NODE_DEBUG;i=i.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),o=new RegExp("^"+i+"$","i")}e.debuglog=function(G){if(G=G.toUpperCase(),!r[G])if(o.test(G)){var re=ve.pid;r[G]=function(){var se=e.format.apply(e,arguments);console.error("%s %d: %s",G,re,se)}}else r[G]=function(){};return r[G]};function s(G,re){var se={seen:[],stylize:c};return arguments.length>=3&&(se.depth=arguments[2]),arguments.length>=4&&(se.colors=arguments[3]),b(re)?se.showHidden=re:re&&e._extend(se,re),R(se.showHidden)&&(se.showHidden=!1),R(se.depth)&&(se.depth=2),R(se.colors)&&(se.colors=!1),R(se.customInspect)&&(se.customInspect=!0),se.colors&&(se.stylize=a),l(se,G,se.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(G,re){var se=s.styles[re];return se?"\x1B["+s.colors[se][0]+"m"+G+"\x1B["+s.colors[se][1]+"m":G}function c(G,re){return G}function u(G){var re={};return G.forEach(function(se,Ie){re[se]=!0}),re}function l(G,re,se){if(G.customInspect&&re&&N(re.inspect)&&re.inspect!==e.inspect&&!(re.constructor&&re.constructor.prototype===re)){var Ie=re.inspect(se,G);return S(Ie)||(Ie=l(G,Ie,se)),Ie}var ee=d(G,re);if(ee)return ee;var F=Object.keys(re),C=u(F);if(G.showHidden&&(F=Object.getOwnPropertyNames(re)),D(re)&&(F.indexOf("message")>=0||F.indexOf("description")>=0))return f(re);if(F.length===0){if(N(re)){var z=re.name?": "+re.name:"";return G.stylize("[Function"+z+"]","special")}if(_(re))return G.stylize(RegExp.prototype.toString.call(re),"regexp");if($(re))return G.stylize(Date.prototype.toString.call(re),"date");if(D(re))return f(re)}var q="",M=!1,V=["{","}"];if(E(re)&&(M=!0,V=["[","]"]),N(re)){var de=re.name?": "+re.name:"";q=" [Function"+de+"]"}if(_(re)&&(q=" "+RegExp.prototype.toString.call(re)),$(re)&&(q=" "+Date.prototype.toUTCString.call(re)),D(re)&&(q=" "+f(re)),F.length===0&&(!M||re.length==0))return V[0]+q+V[1];if(se<0)return _(re)?G.stylize(RegExp.prototype.toString.call(re),"regexp"):G.stylize("[Object]","special");G.seen.push(re);var Te;return M?Te=m(G,re,se,C,F):Te=F.map(function(Le){return w(G,re,se,C,Le,M)}),G.seen.pop(),y(Te,q,V)}function d(G,re){if(R(re))return G.stylize("undefined","undefined");if(S(re)){var se="'"+JSON.stringify(re).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return G.stylize(se,"string")}if(h(re))return G.stylize(""+re,"number");if(b(re))return G.stylize(""+re,"boolean");if(g(re))return G.stylize("null","null")}function f(G){return"["+Error.prototype.toString.call(G)+"]"}function m(G,re,se,Ie,ee){for(var F=[],C=0,z=re.length;C<z;++C)te(re,String(C))?F.push(w(G,re,se,Ie,String(C),!0)):F.push("");return ee.forEach(function(q){q.match(/^\d+$/)||F.push(w(G,re,se,Ie,q,!0))}),F}function w(G,re,se,Ie,ee,F){var C,z,q;if(q=Object.getOwnPropertyDescriptor(re,ee)||{value:re[ee]},q.get?q.set?z=G.stylize("[Getter/Setter]","special"):z=G.stylize("[Getter]","special"):q.set&&(z=G.stylize("[Setter]","special")),te(Ie,ee)||(C="["+ee+"]"),z||(G.seen.indexOf(q.value)<0?(g(se)?z=l(G,q.value,null):z=l(G,q.value,se-1),z.indexOf(`
17
+ `)>-1&&(F?z=z.split(`
18
18
  `).map(function(M){return" "+M}).join(`
19
- `).slice(2):G=`
20
- `+G.split(`
19
+ `).slice(2):z=`
20
+ `+z.split(`
21
21
  `).map(function(M){return" "+M}).join(`
22
- `))):G=Z.stylize("[Circular]","special")),I(F)){if(_&&H.match(/^\d+$/))return G;F=JSON.stringify(""+H),F.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(F=F.slice(1,-1),F=Z.stylize(F,"name")):(F=F.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),F=Z.stylize(F,"string"))}return F+": "+G}function v(Z,oe,ce){var Ce=Z.reduce(function(H,_){return _.indexOf(`
23
- `)>=0,H+_.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Ce>60?ce[0]+(oe===""?"":oe+`
24
- `)+" "+Z.join(`,
25
- `)+" "+ce[1]:ce[0]+oe+" "+Z.join(", ")+" "+ce[1]}e.types=yR();function T(Z){return Array.isArray(Z)}e.isArray=T;function y(Z){return typeof Z=="boolean"}e.isBoolean=y;function g(Z){return Z===null}e.isNull=g;function h(Z){return Z==null}e.isNullOrUndefined=h;function b(Z){return typeof Z=="number"}e.isNumber=b;function S(Z){return typeof Z=="string"}e.isString=S;function E(Z){return typeof Z=="symbol"}e.isSymbol=E;function I(Z){return Z===void 0}e.isUndefined=I;function R(Z){return A(Z)&&V(Z)==="[object RegExp]"}e.isRegExp=R,e.types.isRegExp=R;function A(Z){return typeof Z=="object"&&Z!==null}e.isObject=A;function N(Z){return A(Z)&&V(Z)==="[object Date]"}e.isDate=N,e.types.isDate=N;function L(Z){return A(Z)&&(V(Z)==="[object Error]"||Z instanceof Error)}e.isError=L,e.types.isNativeError=L;function x(Z){return typeof Z=="function"}e.isFunction=x;function $(Z){return Z===null||typeof Z=="boolean"||typeof Z=="number"||typeof Z=="string"||typeof Z=="symbol"||typeof Z>"u"}e.isPrimitive=$,e.isBuffer=bR();function V(Z){return Object.prototype.toString.call(Z)}function X(Z){return Z<10?"0"+Z.toString(10):Z.toString(10)}var ee=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function se(){var Z=new Date,oe=[X(Z.getHours()),X(Z.getMinutes()),X(Z.getSeconds())].join(":");return[Z.getDate(),ee[Z.getMonth()],oe].join(" ")}e.log=function(){console.log("%s - %s",se(),e.format.apply(e,arguments))},e.inherits=ti(),e._extend=function(Z,oe){if(!oe||!A(oe))return Z;for(var ce=Object.keys(oe),Ce=ce.length;Ce--;)Z[ce[Ce]]=oe[ce[Ce]];return Z};function ie(Z,oe){return Object.prototype.hasOwnProperty.call(Z,oe)}var re=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(oe){if(typeof oe!="function")throw new TypeError('The "original" argument must be of type Function');if(re&&oe[re]){var ce=oe[re];if(typeof ce!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ce,re,{value:ce,enumerable:!1,writable:!1,configurable:!0}),ce}function ce(){for(var Ce,H,_=new Promise(function(z,M){Ce=z,H=M}),F=[],G=0;G<arguments.length;G++)F.push(arguments[G]);F.push(function(z,M){z?H(z):Ce(M)});try{oe.apply(this,F)}catch(z){H(z)}return _}return Object.setPrototypeOf(ce,Object.getPrototypeOf(oe)),re&&Object.defineProperty(ce,re,{value:ce,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(ce,t(oe))},e.promisify.custom=re;function fe(Z,oe){if(!Z){var ce=new Error("Promise was rejected with a falsy value");ce.reason=Z,Z=ce}return oe(Z)}function ue(Z){if(typeof Z!="function")throw new TypeError('The "original" argument must be of type Function');function oe(){for(var ce=[],Ce=0;Ce<arguments.length;Ce++)ce.push(arguments[Ce]);var H=ce.pop();if(typeof H!="function")throw new TypeError("The last argument must be of type Function");var _=this,F=function(){return H.apply(_,arguments)};Z.apply(this,ce).then(function(G){we.nextTick(F.bind(null,null,G))},function(G){we.nextTick(fe.bind(null,G,F))})}return Object.setPrototypeOf(oe,Object.getPrototypeOf(Z)),Object.defineProperties(oe,t(Z)),oe}e.callbackify=ue}(rc)),rc}var au,hm;function vR(){if(hm)return au;hm=1;function e(w,v){var T=Object.keys(w);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(w);v&&(y=y.filter(function(g){return Object.getOwnPropertyDescriptor(w,g).enumerable})),T.push.apply(T,y)}return T}function t(w){for(var v=1;v<arguments.length;v++){var T=arguments[v]!=null?arguments[v]:{};v%2?e(Object(T),!0).forEach(function(y){n(w,y,T[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(T)):e(Object(T)).forEach(function(y){Object.defineProperty(w,y,Object.getOwnPropertyDescriptor(T,y))})}return w}function n(w,v,T){return v=s(v),v in w?Object.defineProperty(w,v,{value:T,enumerable:!0,configurable:!0,writable:!0}):w[v]=T,w}function r(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function o(w,v){for(var T=0;T<v.length;T++){var y=v[T];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(w,s(y.key),y)}}function i(w,v,T){return v&&o(w.prototype,v),Object.defineProperty(w,"prototype",{writable:!1}),w}function s(w){var v=a(w,"string");return typeof v=="symbol"?v:String(v)}function a(w,v){if(typeof w!="object"||w===null)return w;var T=w[Symbol.toPrimitive];if(T!==void 0){var y=T.call(w,v);if(typeof y!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(w)}var c=Cs(),u=c.Buffer,l=pm(),f=l.inspect,d=f&&f.custom||"inspect";function m(w,v,T){u.prototype.copy.call(w,v,T)}return au=function(){function w(){r(this,w),this.head=null,this.tail=null,this.length=0}return i(w,[{key:"push",value:function(T){var y={data:T,next:null};this.length>0?this.tail.next=y:this.head=y,this.tail=y,++this.length}},{key:"unshift",value:function(T){var y={data:T,next:this.head};this.length===0&&(this.tail=y),this.head=y,++this.length}},{key:"shift",value:function(){if(this.length!==0){var T=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,T}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(T){if(this.length===0)return"";for(var y=this.head,g=""+y.data;y=y.next;)g+=T+y.data;return g}},{key:"concat",value:function(T){if(this.length===0)return u.alloc(0);for(var y=u.allocUnsafe(T>>>0),g=this.head,h=0;g;)m(g.data,y,h),h+=g.data.length,g=g.next;return y}},{key:"consume",value:function(T,y){var g;return T<this.head.data.length?(g=this.head.data.slice(0,T),this.head.data=this.head.data.slice(T)):T===this.head.data.length?g=this.shift():g=y?this._getString(T):this._getBuffer(T),g}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(T){var y=this.head,g=1,h=y.data;for(T-=h.length;y=y.next;){var b=y.data,S=T>b.length?b.length:T;if(S===b.length?h+=b:h+=b.slice(0,T),T-=S,T===0){S===b.length?(++g,y.next?this.head=y.next:this.head=this.tail=null):(this.head=y,y.data=b.slice(S));break}++g}return this.length-=g,h}},{key:"_getBuffer",value:function(T){var y=u.allocUnsafe(T),g=this.head,h=1;for(g.data.copy(y),T-=g.data.length;g=g.next;){var b=g.data,S=T>b.length?b.length:T;if(b.copy(y,y.length-T,0,S),T-=S,T===0){S===b.length?(++h,g.next?this.head=g.next:this.head=this.tail=null):(this.head=g,g.data=b.slice(S));break}++h}return this.length-=h,y}},{key:d,value:function(T,y){return f(this,t(t({},y),{},{depth:0,customInspect:!1}))}}]),w}(),au}var lu,gm;function mm(){if(gm)return lu;gm=1;function e(s,a){var c=this,u=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return u||l?(a?a(s):s&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,we.nextTick(o,this,s)):we.nextTick(o,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(f){!a&&f?c._writableState?c._writableState.errorEmitted?we.nextTick(n,c):(c._writableState.errorEmitted=!0,we.nextTick(t,c,f)):we.nextTick(t,c,f):a?(we.nextTick(n,c),a(f)):we.nextTick(n,c)}),this)}function t(s,a){o(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 o(s,a){s.emit("error",a)}function i(s,a){var c=s._readableState,u=s._writableState;c&&c.autoDestroy||u&&u.autoDestroy?s.destroy(a):s.emit("error",a)}return lu={destroy:e,undestroy:r,errorOrDestroy:i},lu}var cu={},ym;function Ni(){if(ym)return cu;ym=1;function e(a,c){a.prototype=Object.create(c.prototype),a.prototype.constructor=a,a.__proto__=c}var t={};function n(a,c,u){u||(u=Error);function l(d,m,w){return typeof c=="string"?c:c(d,m,w)}var f=function(d){e(m,d);function m(w,v,T){return d.call(this,l(w,v,T))||this}return m}(u);f.prototype.name=u.name,f.prototype.code=a,t[a]=f}function r(a,c){if(Array.isArray(a)){var u=a.length;return a=a.map(function(l){return String(l)}),u>2?"one of ".concat(c," ").concat(a.slice(0,u-1).join(", "),", or ")+a[u-1]:u===2?"one of ".concat(c," ").concat(a[0]," or ").concat(a[1]):"of ".concat(c," ").concat(a[0])}else return"of ".concat(c," ").concat(String(a))}function o(a,c,u){return a.substr(0,c.length)===c}function i(a,c,u){return(u===void 0||u>a.length)&&(u=a.length),a.substring(u-c.length,u)===c}function s(a,c,u){return typeof u!="number"&&(u=0),u+c.length>a.length?!1:a.indexOf(c,u)!==-1}return n("ERR_INVALID_OPT_VALUE",function(a,c){return'The value "'+c+'" is invalid for option "'+a+'"'},TypeError),n("ERR_INVALID_ARG_TYPE",function(a,c,u){var l;typeof c=="string"&&o(c,"not ")?(l="must not be",c=c.replace(/^not /,"")):l="must be";var f;if(i(a," argument"))f="The ".concat(a," ").concat(l," ").concat(r(c,"type"));else{var d=s(a,".")?"property":"argument";f='The "'.concat(a,'" ').concat(d," ").concat(l," ").concat(r(c,"type"))}return f+=". Received type ".concat(typeof u),f},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"),cu.codes=t,cu}var uu,bm;function vm(){if(bm)return uu;bm=1;var e=Ni().codes.ERR_INVALID_OPT_VALUE;function t(r,o,i){return r.highWaterMark!=null?r.highWaterMark:o?r[i]:null}function n(r,o,i,s){var a=t(o,s,i);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var c=s?i:"highWaterMark";throw new e(c,a)}return Math.floor(a)}return r.objectMode?16:16*1024}return uu={getHighWaterMark:n},uu}var fu,wm;function wR(){if(wm)return fu;wm=1,fu=e;function e(n,r){if(t("noDeprecation"))return n;var o=!1;function i(){if(!o){if(t("throwDeprecation"))throw new Error(r);t("traceDeprecation")?console.trace(r):console.warn(r),o=!0}return n.apply(this,arguments)}return i}function t(n){try{if(!xr.localStorage)return!1}catch{return!1}var r=xr.localStorage[n];return r==null?!1:String(r).toLowerCase()==="true"}return fu}var du,Sm;function Em(){if(Sm)return du;Sm=1,du=R;function e(H){var _=this;this.next=null,this.entry=null,this.finish=function(){Ce(_,H)}}var t;R.WritableState=E;var n={deprecate:wR()},r=ng(),o=Cs().Buffer,i=(typeof xr<"u"?xr:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(H){return o.from(H)}function a(H){return o.isBuffer(H)||H instanceof i}var c=mm(),u=vm(),l=u.getHighWaterMark,f=Ni().codes,d=f.ERR_INVALID_ARG_TYPE,m=f.ERR_METHOD_NOT_IMPLEMENTED,w=f.ERR_MULTIPLE_CALLBACK,v=f.ERR_STREAM_CANNOT_PIPE,T=f.ERR_STREAM_DESTROYED,y=f.ERR_STREAM_NULL_VALUES,g=f.ERR_STREAM_WRITE_AFTER_END,h=f.ERR_UNKNOWN_ENCODING,b=c.errorOrDestroy;ti()(R,r);function S(){}function E(H,_,F){t=t||$i(),H=H||{},typeof F!="boolean"&&(F=_ instanceof t),this.objectMode=!!H.objectMode,F&&(this.objectMode=this.objectMode||!!H.writableObjectMode),this.highWaterMark=l(this,H,"writableHighWaterMark",F),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var G=H.decodeStrings===!1;this.decodeStrings=!G,this.defaultEncoding=H.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(z){ee(_,z)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=H.emitClose!==!1,this.autoDestroy=!!H.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}E.prototype.getBuffer=function(){for(var _=this.bufferedRequest,F=[];_;)F.push(_),_=_.next;return F},function(){try{Object.defineProperty(E.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var I;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(I=Function.prototype[Symbol.hasInstance],Object.defineProperty(R,Symbol.hasInstance,{value:function(_){return I.call(this,_)?!0:this!==R?!1:_&&_._writableState instanceof E}})):I=function(_){return _ instanceof this};function R(H){t=t||$i();var _=this instanceof t;if(!_&&!I.call(R,this))return new R(H);this._writableState=new E(H,this,_),this.writable=!0,H&&(typeof H.write=="function"&&(this._write=H.write),typeof H.writev=="function"&&(this._writev=H.writev),typeof H.destroy=="function"&&(this._destroy=H.destroy),typeof H.final=="function"&&(this._final=H.final)),r.call(this)}R.prototype.pipe=function(){b(this,new v)};function A(H,_){var F=new g;b(H,F),we.nextTick(_,F)}function N(H,_,F,G){var z;return F===null?z=new y:typeof F!="string"&&!_.objectMode&&(z=new d("chunk",["string","Buffer"],F)),z?(b(H,z),we.nextTick(G,z),!1):!0}R.prototype.write=function(H,_,F){var G=this._writableState,z=!1,M=!G.objectMode&&a(H);return M&&!o.isBuffer(H)&&(H=s(H)),typeof _=="function"&&(F=_,_=null),M?_="buffer":_||(_=G.defaultEncoding),typeof F!="function"&&(F=S),G.ending?A(this,F):(M||N(this,G,H,F))&&(G.pendingcb++,z=x(this,G,M,H,_,F)),z},R.prototype.cork=function(){this._writableState.corked++},R.prototype.uncork=function(){var H=this._writableState;H.corked&&(H.corked--,!H.writing&&!H.corked&&!H.bufferProcessing&&H.bufferedRequest&&re(this,H))},R.prototype.setDefaultEncoding=function(_){if(typeof _=="string"&&(_=_.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((_+"").toLowerCase())>-1))throw new h(_);return this._writableState.defaultEncoding=_,this},Object.defineProperty(R.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function L(H,_,F){return!H.objectMode&&H.decodeStrings!==!1&&typeof _=="string"&&(_=o.from(_,F)),_}Object.defineProperty(R.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function x(H,_,F,G,z,M){if(!F){var q=L(_,G,z);G!==q&&(F=!0,z="buffer",G=q)}var de=_.objectMode?1:G.length;_.length+=de;var Ae=_.length<_.highWaterMark;if(Ae||(_.needDrain=!0),_.writing||_.corked){var De=_.lastBufferedRequest;_.lastBufferedRequest={chunk:G,encoding:z,isBuf:F,callback:M,next:null},De?De.next=_.lastBufferedRequest:_.bufferedRequest=_.lastBufferedRequest,_.bufferedRequestCount+=1}else $(H,_,!1,de,G,z,M);return Ae}function $(H,_,F,G,z,M,q){_.writelen=G,_.writecb=q,_.writing=!0,_.sync=!0,_.destroyed?_.onwrite(new T("write")):F?H._writev(z,_.onwrite):H._write(z,M,_.onwrite),_.sync=!1}function V(H,_,F,G,z){--_.pendingcb,F?(we.nextTick(z,G),we.nextTick(oe,H,_),H._writableState.errorEmitted=!0,b(H,G)):(z(G),H._writableState.errorEmitted=!0,b(H,G),oe(H,_))}function X(H){H.writing=!1,H.writecb=null,H.length-=H.writelen,H.writelen=0}function ee(H,_){var F=H._writableState,G=F.sync,z=F.writecb;if(typeof z!="function")throw new w;if(X(F),_)V(H,F,G,_,z);else{var M=fe(F)||H.destroyed;!M&&!F.corked&&!F.bufferProcessing&&F.bufferedRequest&&re(H,F),G?we.nextTick(se,H,F,M,z):se(H,F,M,z)}}function se(H,_,F,G){F||ie(H,_),_.pendingcb--,G(),oe(H,_)}function ie(H,_){_.length===0&&_.needDrain&&(_.needDrain=!1,H.emit("drain"))}function re(H,_){_.bufferProcessing=!0;var F=_.bufferedRequest;if(H._writev&&F&&F.next){var G=_.bufferedRequestCount,z=new Array(G),M=_.corkedRequestsFree;M.entry=F;for(var q=0,de=!0;F;)z[q]=F,F.isBuf||(de=!1),F=F.next,q+=1;z.allBuffers=de,$(H,_,!0,_.length,z,"",M.finish),_.pendingcb++,_.lastBufferedRequest=null,M.next?(_.corkedRequestsFree=M.next,M.next=null):_.corkedRequestsFree=new e(_),_.bufferedRequestCount=0}else{for(;F;){var Ae=F.chunk,De=F.encoding,ke=F.callback,_e=_.objectMode?1:Ae.length;if($(H,_,!1,_e,Ae,De,ke),F=F.next,_.bufferedRequestCount--,_.writing)break}F===null&&(_.lastBufferedRequest=null)}_.bufferedRequest=F,_.bufferProcessing=!1}R.prototype._write=function(H,_,F){F(new m("_write()"))},R.prototype._writev=null,R.prototype.end=function(H,_,F){var G=this._writableState;return typeof H=="function"?(F=H,H=null,_=null):typeof _=="function"&&(F=_,_=null),H!=null&&this.write(H,_),G.corked&&(G.corked=1,this.uncork()),G.ending||ce(this,G,F),this},Object.defineProperty(R.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function fe(H){return H.ending&&H.length===0&&H.bufferedRequest===null&&!H.finished&&!H.writing}function ue(H,_){H._final(function(F){_.pendingcb--,F&&b(H,F),_.prefinished=!0,H.emit("prefinish"),oe(H,_)})}function Z(H,_){!_.prefinished&&!_.finalCalled&&(typeof H._final=="function"&&!_.destroyed?(_.pendingcb++,_.finalCalled=!0,we.nextTick(ue,H,_)):(_.prefinished=!0,H.emit("prefinish")))}function oe(H,_){var F=fe(_);if(F&&(Z(H,_),_.pendingcb===0&&(_.finished=!0,H.emit("finish"),_.autoDestroy))){var G=H._readableState;(!G||G.autoDestroy&&G.endEmitted)&&H.destroy()}return F}function ce(H,_,F){_.ending=!0,oe(H,_),F&&(_.finished?we.nextTick(F):H.once("finish",F)),_.ended=!0,H.writable=!1}function Ce(H,_,F){var G=H.entry;for(H.entry=null;G;){var z=G.callback;_.pendingcb--,z(F),G=G.next}_.corkedRequestsFree.next=H}return Object.defineProperty(R.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(_){this._writableState&&(this._writableState.destroyed=_)}}),R.prototype.destroy=c.destroy,R.prototype._undestroy=c.undestroy,R.prototype._destroy=function(H,_){_(H)},du}var pu,Tm;function $i(){if(Tm)return pu;Tm=1;var e=Object.keys||function(u){var l=[];for(var f in u)l.push(f);return l};pu=s;var t=Fm(),n=Em();ti()(s,t);for(var r=e(n.prototype),o=0;o<r.length;o++){var i=r[o];s.prototype[i]||(s.prototype[i]=n.prototype[i])}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||we.nextTick(c,this)}function c(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(l){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=l,this._writableState.destroyed=l)}}),pu}var hu={},Os={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var Am;function SR(){return Am||(Am=1,function(e,t){var n=Cs(),r=n.Buffer;function o(s,a){for(var c in s)a[c]=s[c]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=i);function i(s,a,c){return r(s,a,c)}i.prototype=Object.create(r.prototype),o(r,i),i.from=function(s,a,c){if(typeof s=="number")throw new TypeError("Argument must not be a number");return r(s,a,c)},i.alloc=function(s,a,c){if(typeof s!="number")throw new TypeError("Argument must be a number");var u=r(s);return a!==void 0?typeof c=="string"?u.fill(a,c):u.fill(a):u.fill(0),u},i.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r(s)},i.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(s)}}(Os,Os.exports)),Os.exports}var Rm;function gu(){if(Rm)return hu;Rm=1;var e=SR().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}hu.StringDecoder=o;function o(y){this.encoding=r(y);var g;switch(this.encoding){case"utf16le":this.text=f,this.end=d,g=4;break;case"utf8":this.fillLast=c,g=4;break;case"base64":this.text=m,this.end=w,g=3;break;default:this.write=v,this.end=T;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(g)}o.prototype.write=function(y){if(y.length===0)return"";var g,h;if(this.lastNeed){if(g=this.fillLast(y),g===void 0)return"";h=this.lastNeed,this.lastNeed=0}else h=0;return h<y.length?g?g+this.text(y,h):this.text(y,h):g||""},o.prototype.end=l,o.prototype.text=u,o.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 i(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,h){var b=g.length-1;if(b<h)return 0;var S=i(g[b]);return S>=0?(S>0&&(y.lastNeed=S-1),S):--b<h||S===-2?0:(S=i(g[b]),S>=0?(S>0&&(y.lastNeed=S-2),S):--b<h||S===-2?0:(S=i(g[b]),S>=0?(S>0&&(S===2?S=0:y.lastNeed=S-3),S):0))}function a(y,g,h){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 c(y){var g=this.lastTotal-this.lastNeed,h=a(this,y);if(h!==void 0)return h;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 h=s(this,y,g);if(!this.lastNeed)return y.toString("utf8",g);this.lastTotal=h;var b=y.length-(h-this.lastNeed);return y.copy(this.lastChar,0,b),y.toString("utf8",g,b)}function l(y){var g=y&&y.length?this.write(y):"";return this.lastNeed?g+"�":g}function f(y,g){if((y.length-g)%2===0){var h=y.toString("utf16le",g);if(h){var b=h.charCodeAt(h.length-1);if(b>=55296&&b<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=y[y.length-2],this.lastChar[1]=y[y.length-1],h.slice(0,-1)}return h}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=y[y.length-1],y.toString("utf16le",g,y.length-1)}function d(y){var g=y&&y.length?this.write(y):"";if(this.lastNeed){var h=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,h)}return g}function m(y,g){var h=(y.length-g)%3;return h===0?y.toString("base64",g):(this.lastNeed=3-h,this.lastTotal=3,h===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-h))}function w(y){var g=y&&y.length?this.write(y):"";return this.lastNeed?g+this.lastChar.toString("base64",0,3-this.lastNeed):g}function v(y){return y.toString(this.encoding)}function T(y){return y&&y.length?this.write(y):""}return hu}var mu,_m;function yu(){if(_m)return mu;_m=1;var e=Ni().codes.ERR_STREAM_PREMATURE_CLOSE;function t(i){var s=!1;return function(){if(!s){s=!0;for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];i.apply(this,c)}}}function n(){}function r(i){return i.setHeader&&typeof i.abort=="function"}function o(i,s,a){if(typeof s=="function")return o(i,null,s);s||(s={}),a=t(a||n);var c=s.readable||s.readable!==!1&&i.readable,u=s.writable||s.writable!==!1&&i.writable,l=function(){i.writable||d()},f=i._writableState&&i._writableState.finished,d=function(){u=!1,f=!0,c||a.call(i)},m=i._readableState&&i._readableState.endEmitted,w=function(){c=!1,m=!0,u||a.call(i)},v=function(h){a.call(i,h)},T=function(){var h;if(c&&!m)return(!i._readableState||!i._readableState.ended)&&(h=new e),a.call(i,h);if(u&&!f)return(!i._writableState||!i._writableState.ended)&&(h=new e),a.call(i,h)},y=function(){i.req.on("finish",d)};return r(i)?(i.on("complete",d),i.on("abort",T),i.req?y():i.on("request",y)):u&&!i._writableState&&(i.on("end",l),i.on("close",l)),i.on("end",w),i.on("finish",d),s.error!==!1&&i.on("error",v),i.on("close",T),function(){i.removeListener("complete",d),i.removeListener("abort",T),i.removeListener("request",y),i.req&&i.req.removeListener("finish",d),i.removeListener("end",l),i.removeListener("close",l),i.removeListener("finish",d),i.removeListener("end",w),i.removeListener("error",v),i.removeListener("close",T)}}return mu=o,mu}var bu,Im;function ER(){if(Im)return bu;Im=1;var e;function t(h,b,S){return b=n(b),b in h?Object.defineProperty(h,b,{value:S,enumerable:!0,configurable:!0,writable:!0}):h[b]=S,h}function n(h){var b=r(h,"string");return typeof b=="symbol"?b:String(b)}function r(h,b){if(typeof h!="object"||h===null)return h;var S=h[Symbol.toPrimitive];if(S!==void 0){var E=S.call(h,b);if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(h)}var o=yu(),i=Symbol("lastResolve"),s=Symbol("lastReject"),a=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),l=Symbol("handlePromise"),f=Symbol("stream");function d(h,b){return{value:h,done:b}}function m(h){var b=h[i];if(b!==null){var S=h[f].read();S!==null&&(h[u]=null,h[i]=null,h[s]=null,b(d(S,!1)))}}function w(h){we.nextTick(m,h)}function v(h,b){return function(S,E){h.then(function(){if(b[c]){S(d(void 0,!0));return}b[l](S,E)},E)}}var T=Object.getPrototypeOf(function(){}),y=Object.setPrototypeOf((e={get stream(){return this[f]},next:function(){var b=this,S=this[a];if(S!==null)return Promise.reject(S);if(this[c])return Promise.resolve(d(void 0,!0));if(this[f].destroyed)return new Promise(function(A,N){we.nextTick(function(){b[a]?N(b[a]):A(d(void 0,!0))})});var E=this[u],I;if(E)I=new Promise(v(E,this));else{var R=this[f].read();if(R!==null)return Promise.resolve(d(R,!1));I=new Promise(this[l])}return this[u]=I,I}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var b=this;return new Promise(function(S,E){b[f].destroy(null,function(I){if(I){E(I);return}S(d(void 0,!0))})})}),e),T),g=function(b){var S,E=Object.create(y,(S={},t(S,f,{value:b,writable:!0}),t(S,i,{value:null,writable:!0}),t(S,s,{value:null,writable:!0}),t(S,a,{value:null,writable:!0}),t(S,c,{value:b._readableState.endEmitted,writable:!0}),t(S,l,{value:function(R,A){var N=E[f].read();N?(E[u]=null,E[i]=null,E[s]=null,R(d(N,!1))):(E[i]=R,E[s]=A)},writable:!0}),S));return E[u]=null,o(b,function(I){if(I&&I.code!=="ERR_STREAM_PREMATURE_CLOSE"){var R=E[s];R!==null&&(E[u]=null,E[i]=null,E[s]=null,R(I)),E[a]=I;return}var A=E[i];A!==null&&(E[u]=null,E[i]=null,E[s]=null,A(d(void 0,!0))),E[c]=!0}),b.on("readable",w.bind(null,E)),E};return bu=g,bu}var vu,Cm;function TR(){return Cm||(Cm=1,vu=function(){throw new Error("Readable.from is not available in the browser")}),vu}var wu,Pm;function Fm(){if(Pm)return wu;Pm=1,wu=A;var e;A.ReadableState=R,ec().EventEmitter;var t=function(q,de){return q.listeners(de).length},n=ng(),r=Cs().Buffer,o=(typeof xr<"u"?xr:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function i(M){return r.from(M)}function s(M){return r.isBuffer(M)||M instanceof o}var a=pm(),c;a&&a.debuglog?c=a.debuglog("stream"):c=function(){};var u=vR(),l=mm(),f=vm(),d=f.getHighWaterMark,m=Ni().codes,w=m.ERR_INVALID_ARG_TYPE,v=m.ERR_STREAM_PUSH_AFTER_EOF,T=m.ERR_METHOD_NOT_IMPLEMENTED,y=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,g,h,b;ti()(A,n);var S=l.errorOrDestroy,E=["error","close","destroy","pause","resume"];function I(M,q,de){if(typeof M.prependListener=="function")return M.prependListener(q,de);!M._events||!M._events[q]?M.on(q,de):Array.isArray(M._events[q])?M._events[q].unshift(de):M._events[q]=[de,M._events[q]]}function R(M,q,de){e=e||$i(),M=M||{},typeof de!="boolean"&&(de=q instanceof e),this.objectMode=!!M.objectMode,de&&(this.objectMode=this.objectMode||!!M.readableObjectMode),this.highWaterMark=d(this,M,"readableHighWaterMark",de),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=M.emitClose!==!1,this.autoDestroy=!!M.autoDestroy,this.destroyed=!1,this.defaultEncoding=M.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,M.encoding&&(g||(g=gu().StringDecoder),this.decoder=new g(M.encoding),this.encoding=M.encoding)}function A(M){if(e=e||$i(),!(this instanceof A))return new A(M);var q=this instanceof e;this._readableState=new R(M,this,q),this.readable=!0,M&&(typeof M.read=="function"&&(this._read=M.read),typeof M.destroy=="function"&&(this._destroy=M.destroy)),n.call(this)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(q){this._readableState&&(this._readableState.destroyed=q)}}),A.prototype.destroy=l.destroy,A.prototype._undestroy=l.undestroy,A.prototype._destroy=function(M,q){q(M)},A.prototype.push=function(M,q){var de=this._readableState,Ae;return de.objectMode?Ae=!0:typeof M=="string"&&(q=q||de.defaultEncoding,q!==de.encoding&&(M=r.from(M,q),q=""),Ae=!0),N(this,M,q,!1,Ae)},A.prototype.unshift=function(M){return N(this,M,null,!0,!1)};function N(M,q,de,Ae,De){c("readableAddChunk",q);var ke=M._readableState;if(q===null)ke.reading=!1,ee(M,ke);else{var _e;if(De||(_e=x(ke,q)),_e)S(M,_e);else if(ke.objectMode||q&&q.length>0)if(typeof q!="string"&&!ke.objectMode&&Object.getPrototypeOf(q)!==r.prototype&&(q=i(q)),Ae)ke.endEmitted?S(M,new y):L(M,ke,q,!0);else if(ke.ended)S(M,new v);else{if(ke.destroyed)return!1;ke.reading=!1,ke.decoder&&!de?(q=ke.decoder.write(q),ke.objectMode||q.length!==0?L(M,ke,q,!1):re(M,ke)):L(M,ke,q,!1)}else Ae||(ke.reading=!1,re(M,ke))}return!ke.ended&&(ke.length<ke.highWaterMark||ke.length===0)}function L(M,q,de,Ae){q.flowing&&q.length===0&&!q.sync?(q.awaitDrain=0,M.emit("data",de)):(q.length+=q.objectMode?1:de.length,Ae?q.buffer.unshift(de):q.buffer.push(de),q.needReadable&&se(M)),re(M,q)}function x(M,q){var de;return!s(q)&&typeof q!="string"&&q!==void 0&&!M.objectMode&&(de=new w("chunk",["string","Buffer","Uint8Array"],q)),de}A.prototype.isPaused=function(){return this._readableState.flowing===!1},A.prototype.setEncoding=function(M){g||(g=gu().StringDecoder);var q=new g(M);this._readableState.decoder=q,this._readableState.encoding=this._readableState.decoder.encoding;for(var de=this._readableState.buffer.head,Ae="";de!==null;)Ae+=q.write(de.data),de=de.next;return this._readableState.buffer.clear(),Ae!==""&&this._readableState.buffer.push(Ae),this._readableState.length=Ae.length,this};var $=1073741824;function V(M){return M>=$?M=$:(M--,M|=M>>>1,M|=M>>>2,M|=M>>>4,M|=M>>>8,M|=M>>>16,M++),M}function X(M,q){return M<=0||q.length===0&&q.ended?0:q.objectMode?1:M!==M?q.flowing&&q.length?q.buffer.head.data.length:q.length:(M>q.highWaterMark&&(q.highWaterMark=V(M)),M<=q.length?M:q.ended?q.length:(q.needReadable=!0,0))}A.prototype.read=function(M){c("read",M),M=parseInt(M,10);var q=this._readableState,de=M;if(M!==0&&(q.emittedReadable=!1),M===0&&q.needReadable&&((q.highWaterMark!==0?q.length>=q.highWaterMark:q.length>0)||q.ended))return c("read: emitReadable",q.length,q.ended),q.length===0&&q.ended?F(this):se(this),null;if(M=X(M,q),M===0&&q.ended)return q.length===0&&F(this),null;var Ae=q.needReadable;c("need readable",Ae),(q.length===0||q.length-M<q.highWaterMark)&&(Ae=!0,c("length less than watermark",Ae)),q.ended||q.reading?(Ae=!1,c("reading or ended",Ae)):Ae&&(c("do read"),q.reading=!0,q.sync=!0,q.length===0&&(q.needReadable=!0),this._read(q.highWaterMark),q.sync=!1,q.reading||(M=X(de,q)));var De;return M>0?De=_(M,q):De=null,De===null?(q.needReadable=q.length<=q.highWaterMark,M=0):(q.length-=M,q.awaitDrain=0),q.length===0&&(q.ended||(q.needReadable=!0),de!==M&&q.ended&&F(this)),De!==null&&this.emit("data",De),De};function ee(M,q){if(c("onEofChunk"),!q.ended){if(q.decoder){var de=q.decoder.end();de&&de.length&&(q.buffer.push(de),q.length+=q.objectMode?1:de.length)}q.ended=!0,q.sync?se(M):(q.needReadable=!1,q.emittedReadable||(q.emittedReadable=!0,ie(M)))}}function se(M){var q=M._readableState;c("emitReadable",q.needReadable,q.emittedReadable),q.needReadable=!1,q.emittedReadable||(c("emitReadable",q.flowing),q.emittedReadable=!0,we.nextTick(ie,M))}function ie(M){var q=M._readableState;c("emitReadable_",q.destroyed,q.length,q.ended),!q.destroyed&&(q.length||q.ended)&&(M.emit("readable"),q.emittedReadable=!1),q.needReadable=!q.flowing&&!q.ended&&q.length<=q.highWaterMark,H(M)}function re(M,q){q.readingMore||(q.readingMore=!0,we.nextTick(fe,M,q))}function fe(M,q){for(;!q.reading&&!q.ended&&(q.length<q.highWaterMark||q.flowing&&q.length===0);){var de=q.length;if(c("maybeReadMore read 0"),M.read(0),de===q.length)break}q.readingMore=!1}A.prototype._read=function(M){S(this,new T("_read()"))},A.prototype.pipe=function(M,q){var de=this,Ae=this._readableState;switch(Ae.pipesCount){case 0:Ae.pipes=M;break;case 1:Ae.pipes=[Ae.pipes,M];break;default:Ae.pipes.push(M);break}Ae.pipesCount+=1,c("pipe count=%d opts=%j",Ae.pipesCount,q);var De=(!q||q.end!==!1)&&M!==we.stdout&&M!==we.stderr,ke=De?Le:Nt;Ae.endEmitted?we.nextTick(ke):de.once("end",ke),M.on("unpipe",_e);function _e(Be,ze){c("onunpipe"),Be===de&&ze&&ze.hasUnpiped===!1&&(ze.hasUnpiped=!0,Me())}function Le(){c("onend"),M.end()}var Y=ue(de);M.on("drain",Y);var xe=!1;function Me(){c("cleanup"),M.removeListener("close",kt),M.removeListener("finish",Rt),M.removeListener("drain",Y),M.removeListener("error",Ze),M.removeListener("unpipe",_e),de.removeListener("end",Le),de.removeListener("end",Nt),de.removeListener("data",Ve),xe=!0,Ae.awaitDrain&&(!M._writableState||M._writableState.needDrain)&&Y()}de.on("data",Ve);function Ve(Be){c("ondata");var ze=M.write(Be);c("dest.write",ze),ze===!1&&((Ae.pipesCount===1&&Ae.pipes===M||Ae.pipesCount>1&&z(Ae.pipes,M)!==-1)&&!xe&&(c("false write response, pause",Ae.awaitDrain),Ae.awaitDrain++),de.pause())}function Ze(Be){c("onerror",Be),Nt(),M.removeListener("error",Ze),t(M,"error")===0&&S(M,Be)}I(M,"error",Ze);function kt(){M.removeListener("finish",Rt),Nt()}M.once("close",kt);function Rt(){c("onfinish"),M.removeListener("close",kt),Nt()}M.once("finish",Rt);function Nt(){c("unpipe"),de.unpipe(M)}return M.emit("pipe",de),Ae.flowing||(c("pipe resume"),de.resume()),M};function ue(M){return function(){var de=M._readableState;c("pipeOnDrain",de.awaitDrain),de.awaitDrain&&de.awaitDrain--,de.awaitDrain===0&&t(M,"data")&&(de.flowing=!0,H(M))}}A.prototype.unpipe=function(M){var q=this._readableState,de={hasUnpiped:!1};if(q.pipesCount===0)return this;if(q.pipesCount===1)return M&&M!==q.pipes?this:(M||(M=q.pipes),q.pipes=null,q.pipesCount=0,q.flowing=!1,M&&M.emit("unpipe",this,de),this);if(!M){var Ae=q.pipes,De=q.pipesCount;q.pipes=null,q.pipesCount=0,q.flowing=!1;for(var ke=0;ke<De;ke++)Ae[ke].emit("unpipe",this,{hasUnpiped:!1});return this}var _e=z(q.pipes,M);return _e===-1?this:(q.pipes.splice(_e,1),q.pipesCount-=1,q.pipesCount===1&&(q.pipes=q.pipes[0]),M.emit("unpipe",this,de),this)},A.prototype.on=function(M,q){var de=n.prototype.on.call(this,M,q),Ae=this._readableState;return M==="data"?(Ae.readableListening=this.listenerCount("readable")>0,Ae.flowing!==!1&&this.resume()):M==="readable"&&!Ae.endEmitted&&!Ae.readableListening&&(Ae.readableListening=Ae.needReadable=!0,Ae.flowing=!1,Ae.emittedReadable=!1,c("on readable",Ae.length,Ae.reading),Ae.length?se(this):Ae.reading||we.nextTick(oe,this)),de},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(M,q){var de=n.prototype.removeListener.call(this,M,q);return M==="readable"&&we.nextTick(Z,this),de},A.prototype.removeAllListeners=function(M){var q=n.prototype.removeAllListeners.apply(this,arguments);return(M==="readable"||M===void 0)&&we.nextTick(Z,this),q};function Z(M){var q=M._readableState;q.readableListening=M.listenerCount("readable")>0,q.resumeScheduled&&!q.paused?q.flowing=!0:M.listenerCount("data")>0&&M.resume()}function oe(M){c("readable nexttick read 0"),M.read(0)}A.prototype.resume=function(){var M=this._readableState;return M.flowing||(c("resume"),M.flowing=!M.readableListening,ce(this,M)),M.paused=!1,this};function ce(M,q){q.resumeScheduled||(q.resumeScheduled=!0,we.nextTick(Ce,M,q))}function Ce(M,q){c("resume",q.reading),q.reading||M.read(0),q.resumeScheduled=!1,M.emit("resume"),H(M),q.flowing&&!q.reading&&M.read(0)}A.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function H(M){var q=M._readableState;for(c("flow",q.flowing);q.flowing&&M.read()!==null;);}A.prototype.wrap=function(M){var q=this,de=this._readableState,Ae=!1;M.on("end",function(){if(c("wrapped end"),de.decoder&&!de.ended){var _e=de.decoder.end();_e&&_e.length&&q.push(_e)}q.push(null)}),M.on("data",function(_e){if(c("wrapped data"),de.decoder&&(_e=de.decoder.write(_e)),!(de.objectMode&&_e==null)&&!(!de.objectMode&&(!_e||!_e.length))){var Le=q.push(_e);Le||(Ae=!0,M.pause())}});for(var De in M)this[De]===void 0&&typeof M[De]=="function"&&(this[De]=function(Le){return function(){return M[Le].apply(M,arguments)}}(De));for(var ke=0;ke<E.length;ke++)M.on(E[ke],this.emit.bind(this,E[ke]));return this._read=function(_e){c("wrapped _read",_e),Ae&&(Ae=!1,M.resume())},this},typeof Symbol=="function"&&(A.prototype[Symbol.asyncIterator]=function(){return h===void 0&&(h=ER()),h(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(q){this._readableState&&(this._readableState.flowing=q)}}),A._fromList=_,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function _(M,q){if(q.length===0)return null;var de;return q.objectMode?de=q.buffer.shift():!M||M>=q.length?(q.decoder?de=q.buffer.join(""):q.buffer.length===1?de=q.buffer.first():de=q.buffer.concat(q.length),q.buffer.clear()):de=q.buffer.consume(M,q.decoder),de}function F(M){var q=M._readableState;c("endReadable",q.endEmitted),q.endEmitted||(q.ended=!0,we.nextTick(G,q,M))}function G(M,q){if(c("endReadableNT",M.endEmitted,M.length),!M.endEmitted&&M.length===0&&(M.endEmitted=!0,q.readable=!1,q.emit("end"),M.autoDestroy)){var de=q._writableState;(!de||de.autoDestroy&&de.finished)&&q.destroy()}}typeof Symbol=="function"&&(A.from=function(M,q){return b===void 0&&(b=TR()),b(A,M,q)});function z(M,q){for(var de=0,Ae=M.length;de<Ae;de++)if(M[de]===q)return de;return-1}return wu}var Su,Om;function km(){if(Om)return Su;Om=1,Su=a;var e=Ni().codes,t=e.ERR_METHOD_NOT_IMPLEMENTED,n=e.ERR_MULTIPLE_CALLBACK,r=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=e.ERR_TRANSFORM_WITH_LENGTH_0,i=$i();ti()(a,i);function s(l,f){var d=this._transformState;d.transforming=!1;var m=d.writecb;if(m===null)return this.emit("error",new n);d.writechunk=null,d.writecb=null,f!=null&&this.push(f),m(l);var w=this._readableState;w.reading=!1,(w.needReadable||w.length<w.highWaterMark)&&this._read(w.highWaterMark)}function a(l){if(!(this instanceof a))return new a(l);i.call(this,l),this._transformState={afterTransform:s.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,l&&(typeof l.transform=="function"&&(this._transform=l.transform),typeof l.flush=="function"&&(this._flush=l.flush)),this.on("prefinish",c)}function c(){var l=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(f,d){u(l,f,d)}):u(this,null,null)}a.prototype.push=function(l,f){return this._transformState.needTransform=!1,i.prototype.push.call(this,l,f)},a.prototype._transform=function(l,f,d){d(new t("_transform()"))},a.prototype._write=function(l,f,d){var m=this._transformState;if(m.writecb=d,m.writechunk=l,m.writeencoding=f,!m.transforming){var w=this._readableState;(m.needTransform||w.needReadable||w.length<w.highWaterMark)&&this._read(w.highWaterMark)}},a.prototype._read=function(l){var f=this._transformState;f.writechunk!==null&&!f.transforming?(f.transforming=!0,this._transform(f.writechunk,f.writeencoding,f.afterTransform)):f.needTransform=!0},a.prototype._destroy=function(l,f){i.prototype._destroy.call(this,l,function(d){f(d)})};function u(l,f,d){if(f)return l.emit("error",f);if(d!=null&&l.push(d),l._writableState.length)throw new o;if(l._transformState.transforming)throw new r;return l.push(null)}return Su}var Eu,xm;function AR(){if(xm)return Eu;xm=1,Eu=t;var e=km();ti()(t,e);function t(n){if(!(this instanceof t))return new t(n);e.call(this,n)}return t.prototype._transform=function(n,r,o){o(null,n)},Eu}var Tu,Nm;function RR(){if(Nm)return Tu;Nm=1;var e;function t(d){var m=!1;return function(){m||(m=!0,d.apply(void 0,arguments))}}var n=Ni().codes,r=n.ERR_MISSING_ARGS,o=n.ERR_STREAM_DESTROYED;function i(d){if(d)throw d}function s(d){return d.setHeader&&typeof d.abort=="function"}function a(d,m,w,v){v=t(v);var T=!1;d.on("close",function(){T=!0}),e===void 0&&(e=yu()),e(d,{readable:m,writable:w},function(g){if(g)return v(g);T=!0,v()});var y=!1;return function(g){if(!T&&!y){if(y=!0,s(d))return d.abort();if(typeof d.destroy=="function")return d.destroy();v(g||new o("pipe"))}}}function c(d){d()}function u(d,m){return d.pipe(m)}function l(d){return!d.length||typeof d[d.length-1]!="function"?i:d.pop()}function f(){for(var d=arguments.length,m=new Array(d),w=0;w<d;w++)m[w]=arguments[w];var v=l(m);if(Array.isArray(m[0])&&(m=m[0]),m.length<2)throw new r("streams");var T,y=m.map(function(g,h){var b=h<m.length-1,S=h>0;return a(g,b,S,function(E){T||(T=E),E&&y.forEach(c),!b&&(y.forEach(c),v(T))})});return m.reduce(u)}return Tu=f,Tu}var Au,$m;function _R(){if($m)return Au;$m=1,Au=n;var e=ec().EventEmitter,t=ti();t(n,e),n.Readable=Fm(),n.Writable=Em(),n.Duplex=$i(),n.Transform=km(),n.PassThrough=AR(),n.finished=yu(),n.pipeline=RR(),n.Stream=n;function n(){e.call(this)}return n.prototype.pipe=function(r,o){var i=this;function s(m){r.writable&&r.write(m)===!1&&i.pause&&i.pause()}i.on("data",s);function a(){i.readable&&i.resume&&i.resume()}r.on("drain",a),!r._isStdio&&(!o||o.end!==!1)&&(i.on("end",u),i.on("close",l));var c=!1;function u(){c||(c=!0,r.end())}function l(){c||(c=!0,typeof r.destroy=="function"&&r.destroy())}function f(m){if(d(),e.listenerCount(this,"error")===0)throw m}i.on("error",f),r.on("error",f);function d(){i.removeListener("data",s),r.removeListener("drain",a),i.removeListener("end",u),i.removeListener("close",l),i.removeListener("error",f),r.removeListener("error",f),i.removeListener("end",d),i.removeListener("close",d),r.removeListener("close",d)}return i.on("end",d),i.on("close",d),r.on("close",d),r.emit("pipe",i),r},Au}var Dm;function IR(){return Dm||(Dm=1,function(e){(function(t){t.parser=function(_,F){return new r(_,F)},t.SAXParser=r,t.SAXStream=l,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){if(!(this instanceof r))return new r(_,F);var G=this;i(G),G.q=G.c="",G.bufferCheckPosition=t.MAX_BUFFER_LENGTH,G.opt=F||{},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=!!_,G.noscript=!!(_||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(v)),G.opt.unquotedAttributeValues===void 0&&(G.opt.unquotedAttributeValues=!_),G.trackPosition=G.opt.position!==!1,G.trackPosition&&(G.position=G.line=G.column=0),L(G,"onready")}Object.create||(Object.create=function(_){function F(){}F.prototype=_;var G=new F;return G}),Object.keys||(Object.keys=function(_){var F=[];for(var G in _)_.hasOwnProperty(G)&&F.push(G);return F});function o(_){for(var F=Math.max(t.MAX_BUFFER_LENGTH,10),G=0,z=0,M=n.length;z<M;z++){var q=_[n[z]].length;if(q>F)switch(n[z]){case"textNode":$(_);break;case"cdata":x(_,"oncdata",_.cdata),_.cdata="";break;case"script":x(_,"onscript",_.script),_.script="";break;default:X(_,"Max buffer length exceeded: "+n[z])}G=Math.max(G,q)}var de=t.MAX_BUFFER_LENGTH-G;_.bufferCheckPosition=de+_.position}function i(_){for(var F=0,G=n.length;F<G;F++)_[n[F]]=""}function s(_){$(_),_.cdata!==""&&(x(_,"oncdata",_.cdata),_.cdata=""),_.script!==""&&(x(_,"onscript",_.script),_.script="")}r.prototype={end:function(){ee(this)},write:H,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){s(this)}};var a;try{a=_R().Stream}catch{a=function(){}}a||(a=function(){});var c=t.EVENTS.filter(function(_){return _!=="error"&&_!=="end"});function u(_,F){return new l(_,F)}function l(_,F){if(!(this instanceof l))return new l(_,F);a.apply(this),this._parser=new r(_,F),this.writable=!0,this.readable=!0;var G=this;this._parser.onend=function(){G.emit("end")},this._parser.onerror=function(z){G.emit("error",z),G._parser.error=null},this._decoder=null,c.forEach(function(z){Object.defineProperty(G,"on"+z,{get:function(){return G._parser["on"+z]},set:function(M){if(!M)return G.removeAllListeners(z),G._parser["on"+z]=M,M;G.on(z,M)},enumerable:!0,configurable:!1})})}l.prototype=Object.create(a.prototype,{constructor:{value:l}}),l.prototype.write=function(_){if(typeof wr=="function"&&typeof wr.isBuffer=="function"&&wr.isBuffer(_)){if(!this._decoder){var F=gu().StringDecoder;this._decoder=new F("utf8")}_=this._decoder.write(_)}return this._parser.write(_.toString()),this.emit("data",_),!0},l.prototype.end=function(_){return _&&_.length&&this.write(_),this._parser.end(),!0},l.prototype.on=function(_,F){var G=this;return!G._parser["on"+_]&&c.indexOf(_)!==-1&&(G._parser["on"+_]=function(){var z=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);z.splice(0,0,_),G.emit.apply(G,z)}),a.prototype.on.call(G,_,F)};var f="[CDATA[",d="DOCTYPE",m="http://www.w3.org/XML/1998/namespace",w="http://www.w3.org/2000/xmlns/",v={xml:m,xmlns:w},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]/,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]/,h=/[#:_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 b(_){return _===" "||_===`
26
- `||_==="\r"||_===" "}function S(_){return _==='"'||_==="'"}function E(_){return _===">"||b(_)}function I(_,F){return _.test(F)}function R(_,F){return!I(_,F)}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(_){var F=t.ENTITIES[_],G=typeof F=="number"?String.fromCharCode(F):F;t.ENTITIES[_]=G});for(var N in t.STATE)t.STATE[t.STATE[N]]=N;A=t.STATE;function L(_,F,G){_[F]&&_[F](G)}function x(_,F,G){_.textNode&&$(_),L(_,F,G)}function $(_){_.textNode=V(_.opt,_.textNode),_.textNode&&L(_,"ontext",_.textNode),_.textNode=""}function V(_,F){return _.trim&&(F=F.trim()),_.normalize&&(F=F.replace(/\s+/g," ")),F}function X(_,F){return $(_),_.trackPosition&&(F+=`
27
- Line: `+_.line+`
28
- Column: `+_.column+`
29
- Char: `+_.c),F=new Error(F),_.error=F,L(_,"onerror",F),_}function ee(_){return _.sawRoot&&!_.closedRoot&&se(_,"Unclosed root tag"),_.state!==A.BEGIN&&_.state!==A.BEGIN_WHITESPACE&&_.state!==A.TEXT&&X(_,"Unexpected end"),$(_),_.c="",_.closed=!0,L(_,"onend"),r.call(_,_.strict,_.opt),_}function se(_,F){if(typeof _!="object"||!(_ instanceof r))throw new Error("bad call to strictFail");_.strict&&X(_,F)}function ie(_){_.strict||(_.tagName=_.tagName[_.looseCase]());var F=_.tags[_.tags.length-1]||_,G=_.tag={name:_.tagName,attributes:{}};_.opt.xmlns&&(G.ns=F.ns),_.attribList.length=0,x(_,"onopentagstart",G)}function re(_,F){var G=_.indexOf(":"),z=G<0?["",_]:_.split(":"),M=z[0],q=z[1];return F&&_==="xmlns"&&(M="xmlns",q=""),{prefix:M,local:q}}function fe(_){if(_.strict||(_.attribName=_.attribName[_.looseCase]()),_.attribList.indexOf(_.attribName)!==-1||_.tag.attributes.hasOwnProperty(_.attribName)){_.attribName=_.attribValue="";return}if(_.opt.xmlns){var F=re(_.attribName,!0),G=F.prefix,z=F.local;if(G==="xmlns")if(z==="xml"&&_.attribValue!==m)se(_,"xml: prefix must be bound to "+m+`
30
- Actual: `+_.attribValue);else if(z==="xmlns"&&_.attribValue!==w)se(_,"xmlns: prefix must be bound to "+w+`
31
- Actual: `+_.attribValue);else{var M=_.tag,q=_.tags[_.tags.length-1]||_;M.ns===q.ns&&(M.ns=Object.create(q.ns)),M.ns[z]=_.attribValue}_.attribList.push([_.attribName,_.attribValue])}else _.tag.attributes[_.attribName]=_.attribValue,x(_,"onattribute",{name:_.attribName,value:_.attribValue});_.attribName=_.attribValue=""}function ue(_,F){if(_.opt.xmlns){var G=_.tag,z=re(_.tagName);G.prefix=z.prefix,G.local=z.local,G.uri=G.ns[z.prefix]||"",G.prefix&&!G.uri&&(se(_,"Unbound namespace prefix: "+JSON.stringify(_.tagName)),G.uri=z.prefix);var M=_.tags[_.tags.length-1]||_;G.ns&&M.ns!==G.ns&&Object.keys(G.ns).forEach(function(Ve){x(_,"onopennamespace",{prefix:Ve,uri:G.ns[Ve]})});for(var q=0,de=_.attribList.length;q<de;q++){var Ae=_.attribList[q],De=Ae[0],ke=Ae[1],_e=re(De,!0),Le=_e.prefix,Y=_e.local,xe=Le===""?"":G.ns[Le]||"",Me={name:De,value:ke,prefix:Le,local:Y,uri:xe};Le&&Le!=="xmlns"&&!xe&&(se(_,"Unbound namespace prefix: "+JSON.stringify(Le)),Me.uri=Le),_.tag.attributes[De]=Me,x(_,"onattribute",Me)}_.attribList.length=0}_.tag.isSelfClosing=!!F,_.sawRoot=!0,_.tags.push(_.tag),x(_,"onopentag",_.tag),F||(!_.noscript&&_.tagName.toLowerCase()==="script"?_.state=A.SCRIPT:_.state=A.TEXT,_.tag=null,_.tagName=""),_.attribName=_.attribValue="",_.attribList.length=0}function Z(_){if(!_.tagName){se(_,"Weird empty close tag."),_.textNode+="</>",_.state=A.TEXT;return}if(_.script){if(_.tagName!=="script"){_.script+="</"+_.tagName+">",_.tagName="",_.state=A.SCRIPT;return}x(_,"onscript",_.script),_.script=""}var F=_.tags.length,G=_.tagName;_.strict||(G=G[_.looseCase]());for(var z=G;F--;){var M=_.tags[F];if(M.name!==z)se(_,"Unexpected close tag");else break}if(F<0){se(_,"Unmatched closing tag: "+_.tagName),_.textNode+="</"+_.tagName+">",_.state=A.TEXT;return}_.tagName=G;for(var q=_.tags.length;q-- >F;){var de=_.tag=_.tags.pop();_.tagName=_.tag.name,x(_,"onclosetag",_.tagName);var Ae={};for(var De in de.ns)Ae[De]=de.ns[De];var ke=_.tags[_.tags.length-1]||_;_.opt.xmlns&&de.ns!==ke.ns&&Object.keys(de.ns).forEach(function(_e){var Le=de.ns[_e];x(_,"onclosenamespace",{prefix:_e,uri:Le})})}F===0&&(_.closedRoot=!0),_.tagName=_.attribValue=_.attribName="",_.attribList.length=0,_.state=A.TEXT}function oe(_){var F=_.entity,G=F.toLowerCase(),z,M="";return _.ENTITIES[F]?_.ENTITIES[F]:_.ENTITIES[G]?_.ENTITIES[G]:(F=G,F.charAt(0)==="#"&&(F.charAt(1)==="x"?(F=F.slice(2),z=parseInt(F,16),M=z.toString(16)):(F=F.slice(1),z=parseInt(F,10),M=z.toString(10))),F=F.replace(/^0+/,""),isNaN(z)||M.toLowerCase()!==F?(se(_,"Invalid character entity"),"&"+_.entity+";"):String.fromCodePoint(z))}function ce(_,F){F==="<"?(_.state=A.OPEN_WAKA,_.startTagPosition=_.position):b(F)||(se(_,"Non-whitespace before first tag."),_.textNode=F,_.state=A.TEXT)}function Ce(_,F){var G="";return F<_.length&&(G=_.charAt(F)),G}function H(_){var F=this;if(this.error)throw this.error;if(F.closed)return X(F,"Cannot write after close. Assign an onready handler.");if(_===null)return ee(F);typeof _=="object"&&(_=_.toString());for(var G=0,z="";z=Ce(_,G++),F.c=z,!!z;)switch(F.trackPosition&&(F.position++,z===`
32
- `?(F.line++,F.column=0):F.column++),F.state){case A.BEGIN:if(F.state=A.BEGIN_WHITESPACE,z==="\uFEFF")continue;ce(F,z);continue;case A.BEGIN_WHITESPACE:ce(F,z);continue;case A.TEXT:if(F.sawRoot&&!F.closedRoot){for(var M=G-1;z&&z!=="<"&&z!=="&";)z=Ce(_,G++),z&&F.trackPosition&&(F.position++,z===`
33
- `?(F.line++,F.column=0):F.column++);F.textNode+=_.substring(M,G-1)}z==="<"&&!(F.sawRoot&&F.closedRoot&&!F.strict)?(F.state=A.OPEN_WAKA,F.startTagPosition=F.position):(!b(z)&&(!F.sawRoot||F.closedRoot)&&se(F,"Text data outside of root node."),z==="&"?F.state=A.TEXT_ENTITY:F.textNode+=z);continue;case A.SCRIPT:z==="<"?F.state=A.SCRIPT_ENDING:F.script+=z;continue;case A.SCRIPT_ENDING:z==="/"?F.state=A.CLOSE_TAG:(F.script+="<"+z,F.state=A.SCRIPT);continue;case A.OPEN_WAKA:if(z==="!")F.state=A.SGML_DECL,F.sgmlDecl="";else if(!b(z))if(I(T,z))F.state=A.OPEN_TAG,F.tagName=z;else if(z==="/")F.state=A.CLOSE_TAG,F.tagName="";else if(z==="?")F.state=A.PROC_INST,F.procInstName=F.procInstBody="";else{if(se(F,"Unencoded <"),F.startTagPosition+1<F.position){var q=F.position-F.startTagPosition;z=new Array(q).join(" ")+z}F.textNode+="<"+z,F.state=A.TEXT}continue;case A.SGML_DECL:if(F.sgmlDecl+z==="--"){F.state=A.COMMENT,F.comment="",F.sgmlDecl="";continue}F.doctype&&F.doctype!==!0&&F.sgmlDecl?(F.state=A.DOCTYPE_DTD,F.doctype+="<!"+F.sgmlDecl+z,F.sgmlDecl=""):(F.sgmlDecl+z).toUpperCase()===f?(x(F,"onopencdata"),F.state=A.CDATA,F.sgmlDecl="",F.cdata=""):(F.sgmlDecl+z).toUpperCase()===d?(F.state=A.DOCTYPE,(F.doctype||F.sawRoot)&&se(F,"Inappropriately located doctype declaration"),F.doctype="",F.sgmlDecl=""):z===">"?(x(F,"onsgmldeclaration",F.sgmlDecl),F.sgmlDecl="",F.state=A.TEXT):(S(z)&&(F.state=A.SGML_DECL_QUOTED),F.sgmlDecl+=z);continue;case A.SGML_DECL_QUOTED:z===F.q&&(F.state=A.SGML_DECL,F.q=""),F.sgmlDecl+=z;continue;case A.DOCTYPE:z===">"?(F.state=A.TEXT,x(F,"ondoctype",F.doctype),F.doctype=!0):(F.doctype+=z,z==="["?F.state=A.DOCTYPE_DTD:S(z)&&(F.state=A.DOCTYPE_QUOTED,F.q=z));continue;case A.DOCTYPE_QUOTED:F.doctype+=z,z===F.q&&(F.q="",F.state=A.DOCTYPE);continue;case A.DOCTYPE_DTD:z==="]"?(F.doctype+=z,F.state=A.DOCTYPE):z==="<"?(F.state=A.OPEN_WAKA,F.startTagPosition=F.position):S(z)?(F.doctype+=z,F.state=A.DOCTYPE_DTD_QUOTED,F.q=z):F.doctype+=z;continue;case A.DOCTYPE_DTD_QUOTED:F.doctype+=z,z===F.q&&(F.state=A.DOCTYPE_DTD,F.q="");continue;case A.COMMENT:z==="-"?F.state=A.COMMENT_ENDING:F.comment+=z;continue;case A.COMMENT_ENDING:z==="-"?(F.state=A.COMMENT_ENDED,F.comment=V(F.opt,F.comment),F.comment&&x(F,"oncomment",F.comment),F.comment=""):(F.comment+="-"+z,F.state=A.COMMENT);continue;case A.COMMENT_ENDED:z!==">"?(se(F,"Malformed comment"),F.comment+="--"+z,F.state=A.COMMENT):F.doctype&&F.doctype!==!0?F.state=A.DOCTYPE_DTD:F.state=A.TEXT;continue;case A.CDATA:z==="]"?F.state=A.CDATA_ENDING:F.cdata+=z;continue;case A.CDATA_ENDING:z==="]"?F.state=A.CDATA_ENDING_2:(F.cdata+="]"+z,F.state=A.CDATA);continue;case A.CDATA_ENDING_2:z===">"?(F.cdata&&x(F,"oncdata",F.cdata),x(F,"onclosecdata"),F.cdata="",F.state=A.TEXT):z==="]"?F.cdata+="]":(F.cdata+="]]"+z,F.state=A.CDATA);continue;case A.PROC_INST:z==="?"?F.state=A.PROC_INST_ENDING:b(z)?F.state=A.PROC_INST_BODY:F.procInstName+=z;continue;case A.PROC_INST_BODY:if(!F.procInstBody&&b(z))continue;z==="?"?F.state=A.PROC_INST_ENDING:F.procInstBody+=z;continue;case A.PROC_INST_ENDING:z===">"?(x(F,"onprocessinginstruction",{name:F.procInstName,body:F.procInstBody}),F.procInstName=F.procInstBody="",F.state=A.TEXT):(F.procInstBody+="?"+z,F.state=A.PROC_INST_BODY);continue;case A.OPEN_TAG:I(y,z)?F.tagName+=z:(ie(F),z===">"?ue(F):z==="/"?F.state=A.OPEN_TAG_SLASH:(b(z)||se(F,"Invalid character in tag name"),F.state=A.ATTRIB));continue;case A.OPEN_TAG_SLASH:z===">"?(ue(F,!0),Z(F)):(se(F,"Forward-slash in opening tag not followed by >"),F.state=A.ATTRIB);continue;case A.ATTRIB:if(b(z))continue;z===">"?ue(F):z==="/"?F.state=A.OPEN_TAG_SLASH:I(T,z)?(F.attribName=z,F.attribValue="",F.state=A.ATTRIB_NAME):se(F,"Invalid attribute name");continue;case A.ATTRIB_NAME:z==="="?F.state=A.ATTRIB_VALUE:z===">"?(se(F,"Attribute without value"),F.attribValue=F.attribName,fe(F),ue(F)):b(z)?F.state=A.ATTRIB_NAME_SAW_WHITE:I(y,z)?F.attribName+=z:se(F,"Invalid attribute name");continue;case A.ATTRIB_NAME_SAW_WHITE:if(z==="=")F.state=A.ATTRIB_VALUE;else{if(b(z))continue;se(F,"Attribute without value"),F.tag.attributes[F.attribName]="",F.attribValue="",x(F,"onattribute",{name:F.attribName,value:""}),F.attribName="",z===">"?ue(F):I(T,z)?(F.attribName=z,F.state=A.ATTRIB_NAME):(se(F,"Invalid attribute name"),F.state=A.ATTRIB)}continue;case A.ATTRIB_VALUE:if(b(z))continue;S(z)?(F.q=z,F.state=A.ATTRIB_VALUE_QUOTED):(F.opt.unquotedAttributeValues||X(F,"Unquoted attribute value"),F.state=A.ATTRIB_VALUE_UNQUOTED,F.attribValue=z);continue;case A.ATTRIB_VALUE_QUOTED:if(z!==F.q){z==="&"?F.state=A.ATTRIB_VALUE_ENTITY_Q:F.attribValue+=z;continue}fe(F),F.q="",F.state=A.ATTRIB_VALUE_CLOSED;continue;case A.ATTRIB_VALUE_CLOSED:b(z)?F.state=A.ATTRIB:z===">"?ue(F):z==="/"?F.state=A.OPEN_TAG_SLASH:I(T,z)?(se(F,"No whitespace between attributes"),F.attribName=z,F.attribValue="",F.state=A.ATTRIB_NAME):se(F,"Invalid attribute name");continue;case A.ATTRIB_VALUE_UNQUOTED:if(!E(z)){z==="&"?F.state=A.ATTRIB_VALUE_ENTITY_U:F.attribValue+=z;continue}fe(F),z===">"?ue(F):F.state=A.ATTRIB;continue;case A.CLOSE_TAG:if(F.tagName)z===">"?Z(F):I(y,z)?F.tagName+=z:F.script?(F.script+="</"+F.tagName,F.tagName="",F.state=A.SCRIPT):(b(z)||se(F,"Invalid tagname in closing tag"),F.state=A.CLOSE_TAG_SAW_WHITE);else{if(b(z))continue;R(T,z)?F.script?(F.script+="</"+z,F.state=A.SCRIPT):se(F,"Invalid tagname in closing tag."):F.tagName=z}continue;case A.CLOSE_TAG_SAW_WHITE:if(b(z))continue;z===">"?Z(F):se(F,"Invalid characters in closing tag");continue;case A.TEXT_ENTITY:case A.ATTRIB_VALUE_ENTITY_Q:case A.ATTRIB_VALUE_ENTITY_U:var de,Ae;switch(F.state){case A.TEXT_ENTITY:de=A.TEXT,Ae="textNode";break;case A.ATTRIB_VALUE_ENTITY_Q:de=A.ATTRIB_VALUE_QUOTED,Ae="attribValue";break;case A.ATTRIB_VALUE_ENTITY_U:de=A.ATTRIB_VALUE_UNQUOTED,Ae="attribValue";break}if(z===";"){var De=oe(F);F.opt.unparsedEntities&&!Object.values(t.XML_ENTITIES).includes(De)?(F.entity="",F.state=de,F.write(De)):(F[Ae]+=De,F.entity="",F.state=de)}else I(F.entity.length?h:g,z)?F.entity+=z:(se(F,"Invalid character in entity name"),F[Ae]+="&"+F.entity+z,F.entity="",F.state=de);continue;default:throw new Error(F,"Unknown state: "+F.state)}return F.position>=F.bufferCheckPosition&&o(F),F}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */String.fromCodePoint||function(){var _=String.fromCharCode,F=Math.floor,G=function(){var z=16384,M=[],q,de,Ae=-1,De=arguments.length;if(!De)return"";for(var ke="";++Ae<De;){var _e=Number(arguments[Ae]);if(!isFinite(_e)||_e<0||_e>1114111||F(_e)!==_e)throw RangeError("Invalid code point: "+_e);_e<=65535?M.push(_e):(_e-=65536,q=(_e>>10)+55296,de=_e%1024+56320,M.push(q,de)),(Ae+1===De||M.length>z)&&(ke+=_.apply(null,M),M.length=0)}return ke};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:G,configurable:!0,writable:!0}):String.fromCodePoint=G}()})(e)}(Zl)),Zl}var Ru,Lm;function _u(){return Lm||(Lm=1,Ru={isArray:function(e){return Array.isArray?Array.isArray(e):Object.prototype.toString.call(e)==="[object Array]"}}),Ru}var Iu,Mm;function Cu(){if(Mm)return Iu;Mm=1;var e=_u().isArray;return Iu={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}},Iu}var Pu,Bm;function jm(){if(Bm)return Pu;Bm=1;var e=IR(),t=Cu(),n=_u().isArray,r,o;function i(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 h=y.toLowerCase();return h==="true"?!0:h==="false"?!1:y}function a(y,g){var h;if(r.compact){if(!o[r[y+"Key"]]&&(n(r.alwaysArray)?r.alwaysArray.indexOf(r[y+"Key"])!==-1:r.alwaysArray)&&(o[r[y+"Key"]]=[]),o[r[y+"Key"]]&&!n(o[r[y+"Key"]])&&(o[r[y+"Key"]]=[o[r[y+"Key"]]]),y+"Fn"in r&&typeof g=="string"&&(g=r[y+"Fn"](g,o)),y==="instruction"&&("instructionFn"in r||"instructionNameFn"in r)){for(h in g)if(g.hasOwnProperty(h))if("instructionFn"in r)g[h]=r.instructionFn(g[h],h,o);else{var b=g[h];delete g[h],g[r.instructionNameFn(h,b,o)]=b}}n(o[r[y+"Key"]])?o[r[y+"Key"]].push(g):o[r[y+"Key"]]=g}else{o[r.elementsKey]||(o[r.elementsKey]=[]);var S={};if(S[r.typeKey]=y,y==="instruction"){for(h in g)if(g.hasOwnProperty(h))break;S[r.nameKey]="instructionNameFn"in r?r.instructionNameFn(h,g,o):h,r.instructionHasAttributes?(S[r.attributesKey]=g[h][r.attributesKey],"instructionFn"in r&&(S[r.attributesKey]=r.instructionFn(S[r.attributesKey],h,o))):("instructionFn"in r&&(g[h]=r.instructionFn(g[h],h,o)),S[r.instructionKey]=g[h])}else y+"Fn"in r&&(g=r[y+"Fn"](g,o)),S[r[y+"Key"]]=g;r.addParent&&(S[r.parentKey]=o),o[r.elementsKey].push(S)}}function c(y){if("attributesFn"in r&&y&&(y=r.attributesFn(y,o)),(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,o)),"attributeNameFn"in r)){var h=y[g];delete y[g],y[r.attributeNameFn(g,y[g],o)]=h}}return y}function u(y){var g={};if(y.body&&(y.name.toLowerCase()==="xml"||r.instructionHasAttributes)){for(var h=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g,b;(b=h.exec(y.body))!==null;)g[b[1]]=b[2]||b[3]||b[4];g=c(g)}if(y.name.toLowerCase()==="xml"){if(r.ignoreDeclaration)return;o[r.declarationKey]={},Object.keys(g).length&&(o[r.declarationKey][r.attributesKey]=g),r.addParent&&(o[r.declarationKey][r.parentKey]=o)}else{if(r.ignoreInstruction)return;r.trim&&(y.body=y.body.trim());var S={};r.instructionHasAttributes&&Object.keys(g).length?(S[y.name]={},S[y.name][r.attributesKey]=g):S[y.name]=y.body,a("instruction",S)}}function l(y,g){var h;if(typeof y=="object"&&(g=y.attributes,y=y.name),g=c(g),"elementNameFn"in r&&(y=r.elementNameFn(y,o)),r.compact){if(h={},!r.ignoreAttributes&&g&&Object.keys(g).length){h[r.attributesKey]={};var b;for(b in g)g.hasOwnProperty(b)&&(h[r.attributesKey][b]=g[b])}!(y in o)&&(n(r.alwaysArray)?r.alwaysArray.indexOf(y)!==-1:r.alwaysArray)&&(o[y]=[]),o[y]&&!n(o[y])&&(o[y]=[o[y]]),n(o[y])?o[y].push(h):o[y]=h}else o[r.elementsKey]||(o[r.elementsKey]=[]),h={},h[r.typeKey]="element",h[r.nameKey]=y,!r.ignoreAttributes&&g&&Object.keys(g).length&&(h[r.attributesKey]=g),r.alwaysChildren&&(h[r.elementsKey]=[]),o[r.elementsKey].push(h);h[r.parentKey]=o,o=h}function f(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 d(y){r.ignoreComment||(r.trim&&(y=y.trim()),a("comment",y))}function m(y){var g=o[r.parentKey];r.addParent||delete o[r.parentKey],o=g}function w(y){r.ignoreCdata||(r.trim&&(y=y.trim()),a("cdata",y))}function v(y){r.ignoreDoctype||(y=y.replace(/^ /,""),r.trim&&(y=y.trim()),a("doctype",y))}function T(y){y.note=y}return Pu=function(y,g){var h=e.parser(!0,{}),b={};if(o=b,r=i(g),h.opt={strictEntities:!0},h.onopentag=l,h.ontext=f,h.oncomment=d,h.onclosetag=m,h.onerror=T,h.oncdata=w,h.ondoctype=v,h.onprocessinginstruction=u,h.write(y).close(),b[r.elementsKey]){var S=b[r.elementsKey];delete b[r.elementsKey],b[r.elementsKey]=S,delete b.text}return b},Pu}var Fu,Um;function CR(){if(Um)return Fu;Um=1;var e=Cu(),t=jm();function n(r){var o=e.copyOptions(r);return e.ensureSpacesExists(o),o}return Fu=function(r,o){var i,s,a,c;return i=n(o),s=t(r,i),c="compact"in i&&i.compact?"_parent":"parent","addParent"in i&&i.addParent?a=JSON.stringify(s,function(u,l){return u===c?"_":l},i.spaces):a=JSON.stringify(s,null,i.spaces),a.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")},Fu}var Ou,qm;function Vm(){if(qm)return Ou;qm=1;var e=Cu(),t=_u().isArray,n,r;function o(h){var b=e.copyOptions(h);return e.ensureFlagExists("ignoreDeclaration",b),e.ensureFlagExists("ignoreInstruction",b),e.ensureFlagExists("ignoreAttributes",b),e.ensureFlagExists("ignoreText",b),e.ensureFlagExists("ignoreComment",b),e.ensureFlagExists("ignoreCdata",b),e.ensureFlagExists("ignoreDoctype",b),e.ensureFlagExists("compact",b),e.ensureFlagExists("indentText",b),e.ensureFlagExists("indentCdata",b),e.ensureFlagExists("indentAttributes",b),e.ensureFlagExists("indentInstruction",b),e.ensureFlagExists("fullTagEmptyElement",b),e.ensureFlagExists("noQuotesForNativeAttributes",b),e.ensureSpacesExists(b),typeof b.spaces=="number"&&(b.spaces=Array(b.spaces+1).join(" ")),e.ensureKeyExists("declaration",b),e.ensureKeyExists("instruction",b),e.ensureKeyExists("attributes",b),e.ensureKeyExists("text",b),e.ensureKeyExists("comment",b),e.ensureKeyExists("cdata",b),e.ensureKeyExists("doctype",b),e.ensureKeyExists("type",b),e.ensureKeyExists("name",b),e.ensureKeyExists("elements",b),e.checkFnExists("doctype",b),e.checkFnExists("instruction",b),e.checkFnExists("cdata",b),e.checkFnExists("comment",b),e.checkFnExists("text",b),e.checkFnExists("instructionName",b),e.checkFnExists("elementName",b),e.checkFnExists("attributeName",b),e.checkFnExists("attributeValue",b),e.checkFnExists("attributes",b),e.checkFnExists("fullTagEmptyElement",b),b}function i(h,b,S){return(!S&&h.spaces?`
34
- `:"")+Array(b+1).join(h.spaces)}function s(h,b,S){if(b.ignoreAttributes)return"";"attributesFn"in b&&(h=b.attributesFn(h,r,n));var E,I,R,A,N=[];for(E in h)h.hasOwnProperty(E)&&h[E]!==null&&h[E]!==void 0&&(A=b.noQuotesForNativeAttributes&&typeof h[E]!="string"?"":'"',I=""+h[E],I=I.replace(/"/g,"&quot;"),R="attributeNameFn"in b?b.attributeNameFn(E,I,r,n):E,N.push(b.spaces&&b.indentAttributes?i(b,S+1,!1):" "),N.push(R+"="+A+("attributeValueFn"in b?b.attributeValueFn(I,E,r,n):I)+A));return h&&Object.keys(h).length&&b.spaces&&b.indentAttributes&&N.push(i(b,S,!1)),N.join("")}function a(h,b,S){return n=h,r="xml",b.ignoreDeclaration?"":"<?xml"+s(h[b.attributesKey],b,S)+"?>"}function c(h,b,S){if(b.ignoreInstruction)return"";var E;for(E in h)if(h.hasOwnProperty(E))break;var I="instructionNameFn"in b?b.instructionNameFn(E,h[E],r,n):E;if(typeof h[E]=="object")return n=h,r=I,"<?"+I+s(h[E][b.attributesKey],b,S)+"?>";var R=h[E]?h[E]:"";return"instructionFn"in b&&(R=b.instructionFn(R,E,r,n)),"<?"+I+(R?" "+R:"")+"?>"}function u(h,b){return b.ignoreComment?"":"<!--"+("commentFn"in b?b.commentFn(h,r,n):h)+"-->"}function l(h,b){return b.ignoreCdata?"":"<![CDATA["+("cdataFn"in b?b.cdataFn(h,r,n):h.replace("]]>","]]]]><![CDATA[>"))+"]]>"}function f(h,b){return b.ignoreDoctype?"":"<!DOCTYPE "+("doctypeFn"in b?b.doctypeFn(h,r,n):h)+">"}function d(h,b){return b.ignoreText?"":(h=""+h,h=h.replace(/&amp;/g,"&"),h=h.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"textFn"in b?b.textFn(h,r,n):h)}function m(h,b){var S;if(h.elements&&h.elements.length)for(S=0;S<h.elements.length;++S)switch(h.elements[S][b.typeKey]){case"text":if(b.indentText)return!0;break;case"cdata":if(b.indentCdata)return!0;break;case"instruction":if(b.indentInstruction)return!0;break;case"doctype":case"comment":case"element":return!0;default:return!0}return!1}function w(h,b,S){n=h,r=h.name;var E=[],I="elementNameFn"in b?b.elementNameFn(h.name,h):h.name;E.push("<"+I),h[b.attributesKey]&&E.push(s(h[b.attributesKey],b,S));var R=h[b.elementsKey]&&h[b.elementsKey].length||h[b.attributesKey]&&h[b.attributesKey]["xml:space"]==="preserve";return R||("fullTagEmptyElementFn"in b?R=b.fullTagEmptyElementFn(h.name,h):R=b.fullTagEmptyElement),R?(E.push(">"),h[b.elementsKey]&&h[b.elementsKey].length&&(E.push(v(h[b.elementsKey],b,S+1)),n=h,r=h.name),E.push(b.spaces&&m(h,b)?`
35
- `+Array(S+1).join(b.spaces):""),E.push("</"+I+">")):E.push("/>"),E.join("")}function v(h,b,S,E){return h.reduce(function(I,R){var A=i(b,S,E&&!I);switch(R.type){case"element":return I+A+w(R,b,S);case"comment":return I+A+u(R[b.commentKey],b);case"doctype":return I+A+f(R[b.doctypeKey],b);case"cdata":return I+(b.indentCdata?A:"")+l(R[b.cdataKey],b);case"text":return I+(b.indentText?A:"")+d(R[b.textKey],b);case"instruction":var N={};return N[R[b.nameKey]]=R[b.attributesKey]?R:R[b.instructionKey],I+(b.indentInstruction?A:"")+c(N,b,S)}},"")}function T(h,b,S){var E;for(E in h)if(h.hasOwnProperty(E))switch(E){case b.parentKey:case b.attributesKey:break;case b.textKey:if(b.indentText||S)return!0;break;case b.cdataKey:if(b.indentCdata||S)return!0;break;case b.instructionKey:if(b.indentInstruction||S)return!0;break;case b.doctypeKey:case b.commentKey:return!0;default:return!0}return!1}function y(h,b,S,E,I){n=h,r=b;var R="elementNameFn"in S?S.elementNameFn(b,h):b;if(typeof h>"u"||h===null||h==="")return"fullTagEmptyElementFn"in S&&S.fullTagEmptyElementFn(b,h)||S.fullTagEmptyElement?"<"+R+"></"+R+">":"<"+R+"/>";var A=[];if(b){if(A.push("<"+R),typeof h!="object")return A.push(">"+d(h,S)+"</"+R+">"),A.join("");h[S.attributesKey]&&A.push(s(h[S.attributesKey],S,E));var N=T(h,S,!0)||h[S.attributesKey]&&h[S.attributesKey]["xml:space"]==="preserve";if(N||("fullTagEmptyElementFn"in S?N=S.fullTagEmptyElementFn(b,h):N=S.fullTagEmptyElement),N)A.push(">");else return A.push("/>"),A.join("")}return A.push(g(h,S,E+1,!1)),n=h,r=b,b&&A.push((I?i(S,E,!1):"")+"</"+R+">"),A.join("")}function g(h,b,S,E){var I,R,A,N=[];for(R in h)if(h.hasOwnProperty(R))for(A=t(h[R])?h[R]:[h[R]],I=0;I<A.length;++I){switch(R){case b.declarationKey:N.push(a(A[I],b,S));break;case b.instructionKey:N.push((b.indentInstruction?i(b,S,E):"")+c(A[I],b,S));break;case b.attributesKey:case b.parentKey:break;case b.textKey:N.push((b.indentText?i(b,S,E):"")+d(A[I],b));break;case b.cdataKey:N.push((b.indentCdata?i(b,S,E):"")+l(A[I],b));break;case b.doctypeKey:N.push(i(b,S,E)+f(A[I],b));break;case b.commentKey:N.push(i(b,S,E)+u(A[I],b));break;default:N.push(i(b,S,E)+y(A[I],R,b,S,T(A[I],b)))}E=E&&!N.length}return N.join("")}return Ou=function(h,b){b=o(b);var S=[];return n=h,r="_root_",b.compact?S.push(g(h,b,0,!0)):(h[b.declarationKey]&&S.push(a(h[b.declarationKey],b,0)),h[b.elementsKey]&&h[b.elementsKey].length&&S.push(v(h[b.elementsKey],b,0,!S.length))),S.join("")},Ou}var ku,zm;function PR(){if(zm)return ku;zm=1;var e=Vm();return ku=function(t,n){t instanceof wr&&(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)},ku}var xu,Wm;function FR(){if(Wm)return xu;Wm=1;var e=jm(),t=CR(),n=Vm(),r=PR();return xu={xml2js:e,xml2json:t,js2xml:n,json2xml:r},xu}FR();/*! For license information please see index.js.LICENSE.txt */var OR={2:e=>{function t(o,i,s){o instanceof RegExp&&(o=n(o,s)),i instanceof RegExp&&(i=n(i,s));var a=r(o,i,s);return a&&{start:a[0],end:a[1],pre:s.slice(0,a[0]),body:s.slice(a[0]+o.length,a[1]),post:s.slice(a[1]+i.length)}}function n(o,i){var s=i.match(o);return s?s[0]:null}function r(o,i,s){var a,c,u,l,f,d=s.indexOf(o),m=s.indexOf(i,d+1),w=d;if(d>=0&&m>0){for(a=[],u=s.length;w>=0&&!f;)w==d?(a.push(w),d=s.indexOf(o,w+1)):a.length==1?f=[a.pop(),m]:((c=a.pop())<u&&(u=c,l=m),m=s.indexOf(i,w+1)),w=d<m&&d>=0?d:m;a.length&&(f=[u,l])}return f}e.exports=t,t.range=r},101:function(e,t,n){var r;e=n.nmd(e),function(o){var i=(e&&e.exports,typeof Nr=="object"&&Nr);i.global!==i&&i.window;var s=function(f){this.message=f};(s.prototype=new Error).name="InvalidCharacterError";var a=function(f){throw new s(f)},c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,l={encode:function(f){f=String(f),/[^\0-\xFF]/.test(f)&&a("The string to be encoded contains characters outside of the Latin1 range.");for(var d,m,w,v,T=f.length%3,y="",g=-1,h=f.length-T;++g<h;)d=f.charCodeAt(g)<<16,m=f.charCodeAt(++g)<<8,w=f.charCodeAt(++g),y+=c.charAt((v=d+m+w)>>18&63)+c.charAt(v>>12&63)+c.charAt(v>>6&63)+c.charAt(63&v);return T==2?(d=f.charCodeAt(g)<<8,m=f.charCodeAt(++g),y+=c.charAt((v=d+m)>>10)+c.charAt(v>>4&63)+c.charAt(v<<2&63)+"="):T==1&&(v=f.charCodeAt(g),y+=c.charAt(v>>2)+c.charAt(v<<4&63)+"=="),y},decode:function(f){var d=(f=String(f).replace(u,"")).length;d%4==0&&(d=(f=f.replace(/==?$/,"")).length),(d%4==1||/[^+a-zA-Z0-9/]/.test(f))&&a("Invalid character: the string to be decoded is not correctly encoded.");for(var m,w,v=0,T="",y=-1;++y<d;)w=c.indexOf(f.charAt(y)),m=v%4?64*m+w:w,v++%4&&(T+=String.fromCharCode(255&m>>(-2*v&6)));return T},version:"1.0.0"};(r=(function(){return l}).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,o=n.length;o--;){var i=n.charCodeAt(o);56320<=i&&i<=57343&&o--,127<i&&i<=2047?r++:2047<i&&i<=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=[],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},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=[],i=0,s=0;i<r.length;i++,s+=8)o[s>>>5]|=r[i]<<24-s%32;return o},wordsToBytes:function(r){for(var o=[],i=0;i<32*r.length;i+=8)o.push(r[i>>>5]>>>24-i%32&255);return o},bytesToHex:function(r){for(var o=[],i=0;i<r.length;i++)o.push((r[i]>>>4).toString(16)),o.push((15&r[i]).toString(16));return o.join("")},hexToBytes:function(r){for(var o=[],i=0;i<r.length;i+=2)o.push(parseInt(r.substr(i,2),16));return o},bytesToBase64:function(r){for(var o=[],i=0;i<r.length;i+=3)for(var s=r[i]<<16|r[i+1]<<8|r[i+2],a=0;a<4;a++)8*i+6*a<=8*r.length?o.push(t.charAt(s>>>6*(3-a)&63)):o.push("=");return o.join("")},base64ToBytes:function(r){r=r.replace(/[^A-Z0-9+\/]/gi,"");for(var o=[],i=0,s=0;i<r.length;s=++i%4)s!=0&&o.push((t.indexOf(r.charAt(i-1))&Math.pow(2,-2*s+8)-1)<<2*s|t.indexOf(r.charAt(i))>>>6-2*s);return o}},e.exports=n},635:(e,t,n)=>{const r=n(31),o=n(338),i=n(221);e.exports={XMLParser:o,XMLValidator:r,XMLBuilder:i}},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]*",o=new RegExp("^"+r+"$");t.isExist=function(i){return i!==void 0},t.isEmptyObject=function(i){return Object.keys(i).length===0},t.merge=function(i,s,a){if(s){const c=Object.keys(s),u=c.length;for(let l=0;l<u;l++)i[c[l]]=a==="strict"?[s[c[l]]]:s[c[l]]}},t.getValue=function(i){return t.isExist(i)?i:""},t.isName=function(i){return o.exec(i)!=null},t.getAllMatches=function(i,s){const a=[];let c=s.exec(i);for(;c;){const u=[];u.startIndex=s.lastIndex-c[0].length;const l=c.length;for(let f=0;f<l;f++)u.push(c[f]);a.push(u),c=s.exec(i)}return a},t.nameRegexp=r},31:(e,t,n)=>{const r=n(705),o={allowBooleanAttributes:!1,unpairedTags:[]};function i(g){return g===" "||g===" "||g===`
36
- `||g==="\r"}function s(g,h){const b=h;for(;h<g.length;h++)if(!(g[h]!="?"&&g[h]!=" ")){const S=g.substr(b,h-b);if(h>5&&S==="xml")return w("InvalidXml","XML declaration allowed only at the start of the document.",T(g,h));if(g[h]=="?"&&g[h+1]==">"){h++;break}}return h}function a(g,h){if(g.length>h+5&&g[h+1]==="-"&&g[h+2]==="-"){for(h+=3;h<g.length;h++)if(g[h]==="-"&&g[h+1]==="-"&&g[h+2]===">"){h+=2;break}}else if(g.length>h+8&&g[h+1]==="D"&&g[h+2]==="O"&&g[h+3]==="C"&&g[h+4]==="T"&&g[h+5]==="Y"&&g[h+6]==="P"&&g[h+7]==="E"){let b=1;for(h+=8;h<g.length;h++)if(g[h]==="<")b++;else if(g[h]===">"&&(b--,b===0))break}else if(g.length>h+9&&g[h+1]==="["&&g[h+2]==="C"&&g[h+3]==="D"&&g[h+4]==="A"&&g[h+5]==="T"&&g[h+6]==="A"&&g[h+7]==="["){for(h+=8;h<g.length;h++)if(g[h]==="]"&&g[h+1]==="]"&&g[h+2]===">"){h+=2;break}}return h}t.validate=function(g,h){h=Object.assign({},o,h);const b=[];let S=!1,E=!1;g[0]==="\uFEFF"&&(g=g.substr(1));for(let R=0;R<g.length;R++)if(g[R]==="<"&&g[R+1]==="?"){if(R+=2,R=s(g,R),R.err)return R}else{if(g[R]!=="<"){if(i(g[R]))continue;return w("InvalidChar","char '"+g[R]+"' is not expected.",T(g,R))}{let A=R;if(R++,g[R]==="!"){R=a(g,R);continue}{let N=!1;g[R]==="/"&&(N=!0,R++);let L="";for(;R<g.length&&g[R]!==">"&&g[R]!==" "&&g[R]!==" "&&g[R]!==`
37
- `&&g[R]!=="\r";R++)L+=g[R];if(L=L.trim(),L[L.length-1]==="/"&&(L=L.substring(0,L.length-1),R--),I=L,!r.isName(I)){let V;return V=L.trim().length===0?"Invalid space after '<'.":"Tag '"+L+"' is an invalid name.",w("InvalidTag",V,T(g,R))}const x=l(g,R);if(x===!1)return w("InvalidAttr","Attributes for '"+L+"' have open quote.",T(g,R));let $=x.value;if(R=x.index,$[$.length-1]==="/"){const V=R-$.length;$=$.substring(0,$.length-1);const X=d($,h);if(X!==!0)return w(X.err.code,X.err.msg,T(g,V+X.err.line));S=!0}else if(N){if(!x.tagClosed)return w("InvalidTag","Closing tag '"+L+"' doesn't have proper closing.",T(g,R));if($.trim().length>0)return w("InvalidTag","Closing tag '"+L+"' can't have attributes or invalid starting.",T(g,A));if(b.length===0)return w("InvalidTag","Closing tag '"+L+"' has not been opened.",T(g,A));{const V=b.pop();if(L!==V.tagName){let X=T(g,V.tagStartPos);return w("InvalidTag","Expected closing tag '"+V.tagName+"' (opened in line "+X.line+", col "+X.col+") instead of closing tag '"+L+"'.",T(g,A))}b.length==0&&(E=!0)}}else{const V=d($,h);if(V!==!0)return w(V.err.code,V.err.msg,T(g,R-$.length+V.err.line));if(E===!0)return w("InvalidXml","Multiple possible root nodes found.",T(g,R));h.unpairedTags.indexOf(L)!==-1||b.push({tagName:L,tagStartPos:A}),S=!0}for(R++;R<g.length;R++)if(g[R]==="<"){if(g[R+1]==="!"){R++,R=a(g,R);continue}if(g[R+1]!=="?")break;if(R=s(g,++R),R.err)return R}else if(g[R]==="&"){const V=m(g,R);if(V==-1)return w("InvalidChar","char '&' is not expected.",T(g,R));R=V}else if(E===!0&&!i(g[R]))return w("InvalidXml","Extra text at the end",T(g,R));g[R]==="<"&&R--}}}var I;return S?b.length==1?w("InvalidTag","Unclosed tag '"+b[0].tagName+"'.",T(g,b[0].tagStartPos)):!(b.length>0)||w("InvalidXml","Invalid '"+JSON.stringify(b.map(R=>R.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):w("InvalidXml","Start tag expected.",1)};const c='"',u="'";function l(g,h){let b="",S="",E=!1;for(;h<g.length;h++){if(g[h]===c||g[h]===u)S===""?S=g[h]:S!==g[h]||(S="");else if(g[h]===">"&&S===""){E=!0;break}b+=g[h]}return S===""&&{value:b,index:h,tagClosed:E}}const f=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function d(g,h){const b=r.getAllMatches(g,f),S={};for(let E=0;E<b.length;E++){if(b[E][1].length===0)return w("InvalidAttr","Attribute '"+b[E][2]+"' has no space in starting.",y(b[E]));if(b[E][3]!==void 0&&b[E][4]===void 0)return w("InvalidAttr","Attribute '"+b[E][2]+"' is without value.",y(b[E]));if(b[E][3]===void 0&&!h.allowBooleanAttributes)return w("InvalidAttr","boolean attribute '"+b[E][2]+"' is not allowed.",y(b[E]));const I=b[E][2];if(!v(I))return w("InvalidAttr","Attribute '"+I+"' is an invalid name.",y(b[E]));if(S.hasOwnProperty(I))return w("InvalidAttr","Attribute '"+I+"' is repeated.",y(b[E]));S[I]=1}return!0}function m(g,h){if(g[++h]===";")return-1;if(g[h]==="#")return function(S,E){let I=/\d/;for(S[E]==="x"&&(E++,I=/[\da-fA-F]/);E<S.length;E++){if(S[E]===";")return E;if(!S[E].match(I))break}return-1}(g,++h);let b=0;for(;h<g.length;h++,b++)if(!(g[h].match(/\w/)&&b<20)){if(g[h]===";")break;return-1}return h}function w(g,h,b){return{err:{code:g,msg:h,line:b.line||b,col:b.col}}}function v(g){return r.isName(g)}function T(g,h){const b=g.substring(0,h).split(/\r?\n/);return{line:b.length,col:b[b.length-1].length+1}}function y(g){return g.startIndex+g[1].length}},221:(e,t,n)=>{const r=n(87),o=n(118),i={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(l,f){return f},attributeValueProcessor:function(l,f){return f},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(l){this.options=Object.assign({},i,l),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=o(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=u),this.processTextOrObjNode=a,this.options.format?(this.indentate=c,this.tagEndChar=`>
22
+ `))):z=G.stylize("[Circular]","special")),R(C)){if(F&&ee.match(/^\d+$/))return z;C=JSON.stringify(""+ee),C.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(C=C.slice(1,-1),C=G.stylize(C,"name")):(C=C.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),C=G.stylize(C,"string"))}return C+": "+z}function y(G,re,se){var Ie=G.reduce(function(ee,F){return F.indexOf(`
23
+ `)>=0,ee+F.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Ie>60?se[0]+(re===""?"":re+`
24
+ `)+" "+G.join(`,
25
+ `)+" "+se[1]:se[0]+re+" "+G.join(", ")+" "+se[1]}e.types=fR();function E(G){return Array.isArray(G)}e.isArray=E;function b(G){return typeof G=="boolean"}e.isBoolean=b;function g(G){return G===null}e.isNull=g;function v(G){return G==null}e.isNullOrUndefined=v;function h(G){return typeof G=="number"}e.isNumber=h;function S(G){return typeof G=="string"}e.isString=S;function T(G){return typeof G=="symbol"}e.isSymbol=T;function R(G){return G===void 0}e.isUndefined=R;function _(G){return A(G)&&W(G)==="[object RegExp]"}e.isRegExp=_,e.types.isRegExp=_;function A(G){return typeof G=="object"&&G!==null}e.isObject=A;function $(G){return A(G)&&W(G)==="[object Date]"}e.isDate=$,e.types.isDate=$;function D(G){return A(G)&&(W(G)==="[object Error]"||G instanceof Error)}e.isError=D,e.types.isNativeError=D;function N(G){return typeof G=="function"}e.isFunction=N;function x(G){return G===null||typeof G=="boolean"||typeof G=="number"||typeof G=="string"||typeof G=="symbol"||typeof G>"u"}e.isPrimitive=x,e.isBuffer=dR();function W(G){return Object.prototype.toString.call(G)}function K(G){return G<10?"0"+G.toString(10):G.toString(10)}var le=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function be(){var G=new Date,re=[K(G.getHours()),K(G.getMinutes()),K(G.getSeconds())].join(":");return[G.getDate(),le[G.getMonth()],re].join(" ")}e.log=function(){console.log("%s - %s",be(),e.format.apply(e,arguments))},e.inherits=ni(),e._extend=function(G,re){if(!re||!A(re))return G;for(var se=Object.keys(re),Ie=se.length;Ie--;)G[se[Ie]]=re[se[Ie]];return G};function te(G,re){return Object.prototype.hasOwnProperty.call(G,re)}var ae=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(re){if(typeof re!="function")throw new TypeError('The "original" argument must be of type Function');if(ae&&re[ae]){var se=re[ae];if(typeof se!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(se,ae,{value:se,enumerable:!1,writable:!1,configurable:!0}),se}function se(){for(var Ie,ee,F=new Promise(function(q,M){Ie=q,ee=M}),C=[],z=0;z<arguments.length;z++)C.push(arguments[z]);C.push(function(q,M){q?ee(q):Ie(M)});try{re.apply(this,C)}catch(q){ee(q)}return F}return Object.setPrototypeOf(se,Object.getPrototypeOf(re)),ae&&Object.defineProperty(se,ae,{value:se,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(se,t(re))},e.promisify.custom=ae;function ue(G,re){if(!G){var se=new Error("Promise was rejected with a falsy value");se.reason=G,G=se}return re(G)}function ie(G){if(typeof G!="function")throw new TypeError('The "original" argument must be of type Function');function re(){for(var se=[],Ie=0;Ie<arguments.length;Ie++)se.push(arguments[Ie]);var ee=se.pop();if(typeof ee!="function")throw new TypeError("The last argument must be of type Function");var F=this,C=function(){return ee.apply(F,arguments)};G.apply(this,se).then(function(z){ve.nextTick(C.bind(null,null,z))},function(z){ve.nextTick(ue.bind(null,z,C))})}return Object.setPrototypeOf(re,Object.getPrototypeOf(G)),Object.defineProperties(re,t(G)),re}e.callbackify=ie}(ac)),ac}var fu,ym;function pR(){if(ym)return fu;ym=1;function e(w,y){var E=Object.keys(w);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(w);y&&(b=b.filter(function(g){return Object.getOwnPropertyDescriptor(w,g).enumerable})),E.push.apply(E,b)}return E}function t(w){for(var y=1;y<arguments.length;y++){var E=arguments[y]!=null?arguments[y]:{};y%2?e(Object(E),!0).forEach(function(b){n(w,b,E[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(E)):e(Object(E)).forEach(function(b){Object.defineProperty(w,b,Object.getOwnPropertyDescriptor(E,b))})}return w}function n(w,y,E){return y=s(y),y in w?Object.defineProperty(w,y,{value:E,enumerable:!0,configurable:!0,writable:!0}):w[y]=E,w}function r(w,y){if(!(w instanceof y))throw new TypeError("Cannot call a class as a function")}function o(w,y){for(var E=0;E<y.length;E++){var b=y[E];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(w,s(b.key),b)}}function i(w,y,E){return y&&o(w.prototype,y),Object.defineProperty(w,"prototype",{writable:!1}),w}function s(w){var y=a(w,"string");return typeof y=="symbol"?y:String(y)}function a(w,y){if(typeof w!="object"||w===null)return w;var E=w[Symbol.toPrimitive];if(E!==void 0){var b=E.call(w,y);if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(w)}var c=Is(),u=c.Buffer,l=mm(),d=l.inspect,f=d&&d.custom||"inspect";function m(w,y,E){u.prototype.copy.call(w,y,E)}return fu=function(){function w(){r(this,w),this.head=null,this.tail=null,this.length=0}return i(w,[{key:"push",value:function(E){var b={data:E,next:null};this.length>0?this.tail.next=b:this.head=b,this.tail=b,++this.length}},{key:"unshift",value:function(E){var b={data:E,next:this.head};this.length===0&&(this.tail=b),this.head=b,++this.length}},{key:"shift",value:function(){if(this.length!==0){var E=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,E}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(E){if(this.length===0)return"";for(var b=this.head,g=""+b.data;b=b.next;)g+=E+b.data;return g}},{key:"concat",value:function(E){if(this.length===0)return u.alloc(0);for(var b=u.allocUnsafe(E>>>0),g=this.head,v=0;g;)m(g.data,b,v),v+=g.data.length,g=g.next;return b}},{key:"consume",value:function(E,b){var g;return E<this.head.data.length?(g=this.head.data.slice(0,E),this.head.data=this.head.data.slice(E)):E===this.head.data.length?g=this.shift():g=b?this._getString(E):this._getBuffer(E),g}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(E){var b=this.head,g=1,v=b.data;for(E-=v.length;b=b.next;){var h=b.data,S=E>h.length?h.length:E;if(S===h.length?v+=h:v+=h.slice(0,E),E-=S,E===0){S===h.length?(++g,b.next?this.head=b.next:this.head=this.tail=null):(this.head=b,b.data=h.slice(S));break}++g}return this.length-=g,v}},{key:"_getBuffer",value:function(E){var b=u.allocUnsafe(E),g=this.head,v=1;for(g.data.copy(b),E-=g.data.length;g=g.next;){var h=g.data,S=E>h.length?h.length:E;if(h.copy(b,b.length-E,0,S),E-=S,E===0){S===h.length?(++v,g.next?this.head=g.next:this.head=this.tail=null):(this.head=g,g.data=h.slice(S));break}++v}return this.length-=v,b}},{key:f,value:function(E,b){return d(this,t(t({},b),{},{depth:0,customInspect:!1}))}}]),w}(),fu}var du,bm;function vm(){if(bm)return du;bm=1;function e(s,a){var c=this,u=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return u||l?(a?a(s):s&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,ve.nextTick(o,this,s)):ve.nextTick(o,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(d){!a&&d?c._writableState?c._writableState.errorEmitted?ve.nextTick(n,c):(c._writableState.errorEmitted=!0,ve.nextTick(t,c,d)):ve.nextTick(t,c,d):a?(ve.nextTick(n,c),a(d)):ve.nextTick(n,c)}),this)}function t(s,a){o(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 o(s,a){s.emit("error",a)}function i(s,a){var c=s._readableState,u=s._writableState;c&&c.autoDestroy||u&&u.autoDestroy?s.destroy(a):s.emit("error",a)}return du={destroy:e,undestroy:r,errorOrDestroy:i},du}var pu={},wm;function Ni(){if(wm)return pu;wm=1;function e(a,c){a.prototype=Object.create(c.prototype),a.prototype.constructor=a,a.__proto__=c}var t={};function n(a,c,u){u||(u=Error);function l(f,m,w){return typeof c=="string"?c:c(f,m,w)}var d=function(f){e(m,f);function m(w,y,E){return f.call(this,l(w,y,E))||this}return m}(u);d.prototype.name=u.name,d.prototype.code=a,t[a]=d}function r(a,c){if(Array.isArray(a)){var u=a.length;return a=a.map(function(l){return String(l)}),u>2?"one of ".concat(c," ").concat(a.slice(0,u-1).join(", "),", or ")+a[u-1]:u===2?"one of ".concat(c," ").concat(a[0]," or ").concat(a[1]):"of ".concat(c," ").concat(a[0])}else return"of ".concat(c," ").concat(String(a))}function o(a,c,u){return a.substr(0,c.length)===c}function i(a,c,u){return(u===void 0||u>a.length)&&(u=a.length),a.substring(u-c.length,u)===c}function s(a,c,u){return typeof u!="number"&&(u=0),u+c.length>a.length?!1:a.indexOf(c,u)!==-1}return n("ERR_INVALID_OPT_VALUE",function(a,c){return'The value "'+c+'" is invalid for option "'+a+'"'},TypeError),n("ERR_INVALID_ARG_TYPE",function(a,c,u){var l;typeof c=="string"&&o(c,"not ")?(l="must not be",c=c.replace(/^not /,"")):l="must be";var d;if(i(a," argument"))d="The ".concat(a," ").concat(l," ").concat(r(c,"type"));else{var f=s(a,".")?"property":"argument";d='The "'.concat(a,'" ').concat(f," ").concat(l," ").concat(r(c,"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"),pu.codes=t,pu}var hu,Sm;function Em(){if(Sm)return hu;Sm=1;var e=Ni().codes.ERR_INVALID_OPT_VALUE;function t(r,o,i){return r.highWaterMark!=null?r.highWaterMark:o?r[i]:null}function n(r,o,i,s){var a=t(o,s,i);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var c=s?i:"highWaterMark";throw new e(c,a)}return Math.floor(a)}return r.objectMode?16:16*1024}return hu={getHighWaterMark:n},hu}var gu,Tm;function hR(){if(Tm)return gu;Tm=1,gu=e;function e(n,r){if(t("noDeprecation"))return n;var o=!1;function i(){if(!o){if(t("throwDeprecation"))throw new Error(r);t("traceDeprecation")?console.trace(r):console.warn(r),o=!0}return n.apply(this,arguments)}return i}function t(n){try{if(!$r.localStorage)return!1}catch{return!1}var r=$r.localStorage[n];return r==null?!1:String(r).toLowerCase()==="true"}return gu}var mu,Am;function Rm(){if(Am)return mu;Am=1,mu=_;function e(ee){var F=this;this.next=null,this.entry=null,this.finish=function(){Ie(F,ee)}}var t;_.WritableState=T;var n={deprecate:hR()},r=og(),o=Is().Buffer,i=(typeof $r<"u"?$r:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(ee){return o.from(ee)}function a(ee){return o.isBuffer(ee)||ee instanceof i}var c=vm(),u=Em(),l=u.getHighWaterMark,d=Ni().codes,f=d.ERR_INVALID_ARG_TYPE,m=d.ERR_METHOD_NOT_IMPLEMENTED,w=d.ERR_MULTIPLE_CALLBACK,y=d.ERR_STREAM_CANNOT_PIPE,E=d.ERR_STREAM_DESTROYED,b=d.ERR_STREAM_NULL_VALUES,g=d.ERR_STREAM_WRITE_AFTER_END,v=d.ERR_UNKNOWN_ENCODING,h=c.errorOrDestroy;ni()(_,r);function S(){}function T(ee,F,C){t=t||$i(),ee=ee||{},typeof C!="boolean"&&(C=F instanceof t),this.objectMode=!!ee.objectMode,C&&(this.objectMode=this.objectMode||!!ee.writableObjectMode),this.highWaterMark=l(this,ee,"writableHighWaterMark",C),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var z=ee.decodeStrings===!1;this.decodeStrings=!z,this.defaultEncoding=ee.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(q){le(F,q)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=ee.emitClose!==!1,this.autoDestroy=!!ee.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}T.prototype.getBuffer=function(){for(var F=this.bufferedRequest,C=[];F;)C.push(F),F=F.next;return C},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(_,Symbol.hasInstance,{value:function(F){return R.call(this,F)?!0:this!==_?!1:F&&F._writableState instanceof T}})):R=function(F){return F instanceof this};function _(ee){t=t||$i();var F=this instanceof t;if(!F&&!R.call(_,this))return new _(ee);this._writableState=new T(ee,this,F),this.writable=!0,ee&&(typeof ee.write=="function"&&(this._write=ee.write),typeof ee.writev=="function"&&(this._writev=ee.writev),typeof ee.destroy=="function"&&(this._destroy=ee.destroy),typeof ee.final=="function"&&(this._final=ee.final)),r.call(this)}_.prototype.pipe=function(){h(this,new y)};function A(ee,F){var C=new g;h(ee,C),ve.nextTick(F,C)}function $(ee,F,C,z){var q;return C===null?q=new b:typeof C!="string"&&!F.objectMode&&(q=new f("chunk",["string","Buffer"],C)),q?(h(ee,q),ve.nextTick(z,q),!1):!0}_.prototype.write=function(ee,F,C){var z=this._writableState,q=!1,M=!z.objectMode&&a(ee);return M&&!o.isBuffer(ee)&&(ee=s(ee)),typeof F=="function"&&(C=F,F=null),M?F="buffer":F||(F=z.defaultEncoding),typeof C!="function"&&(C=S),z.ending?A(this,C):(M||$(this,z,ee,C))&&(z.pendingcb++,q=N(this,z,M,ee,F,C)),q},_.prototype.cork=function(){this._writableState.corked++},_.prototype.uncork=function(){var ee=this._writableState;ee.corked&&(ee.corked--,!ee.writing&&!ee.corked&&!ee.bufferProcessing&&ee.bufferedRequest&&ae(this,ee))},_.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(_.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function D(ee,F,C){return!ee.objectMode&&ee.decodeStrings!==!1&&typeof F=="string"&&(F=o.from(F,C)),F}Object.defineProperty(_.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function N(ee,F,C,z,q,M){if(!C){var V=D(F,z,q);z!==V&&(C=!0,q="buffer",z=V)}var de=F.objectMode?1:z.length;F.length+=de;var Te=F.length<F.highWaterMark;if(Te||(F.needDrain=!0),F.writing||F.corked){var Le=F.lastBufferedRequest;F.lastBufferedRequest={chunk:z,encoding:q,isBuf:C,callback:M,next:null},Le?Le.next=F.lastBufferedRequest:F.bufferedRequest=F.lastBufferedRequest,F.bufferedRequestCount+=1}else x(ee,F,!1,de,z,q,M);return Te}function x(ee,F,C,z,q,M,V){F.writelen=z,F.writecb=V,F.writing=!0,F.sync=!0,F.destroyed?F.onwrite(new E("write")):C?ee._writev(q,F.onwrite):ee._write(q,M,F.onwrite),F.sync=!1}function W(ee,F,C,z,q){--F.pendingcb,C?(ve.nextTick(q,z),ve.nextTick(re,ee,F),ee._writableState.errorEmitted=!0,h(ee,z)):(q(z),ee._writableState.errorEmitted=!0,h(ee,z),re(ee,F))}function K(ee){ee.writing=!1,ee.writecb=null,ee.length-=ee.writelen,ee.writelen=0}function le(ee,F){var C=ee._writableState,z=C.sync,q=C.writecb;if(typeof q!="function")throw new w;if(K(C),F)W(ee,C,z,F,q);else{var M=ue(C)||ee.destroyed;!M&&!C.corked&&!C.bufferProcessing&&C.bufferedRequest&&ae(ee,C),z?ve.nextTick(be,ee,C,M,q):be(ee,C,M,q)}}function be(ee,F,C,z){C||te(ee,F),F.pendingcb--,z(),re(ee,F)}function te(ee,F){F.length===0&&F.needDrain&&(F.needDrain=!1,ee.emit("drain"))}function ae(ee,F){F.bufferProcessing=!0;var C=F.bufferedRequest;if(ee._writev&&C&&C.next){var z=F.bufferedRequestCount,q=new Array(z),M=F.corkedRequestsFree;M.entry=C;for(var V=0,de=!0;C;)q[V]=C,C.isBuf||(de=!1),C=C.next,V+=1;q.allBuffers=de,x(ee,F,!0,F.length,q,"",M.finish),F.pendingcb++,F.lastBufferedRequest=null,M.next?(F.corkedRequestsFree=M.next,M.next=null):F.corkedRequestsFree=new e(F),F.bufferedRequestCount=0}else{for(;C;){var Te=C.chunk,Le=C.encoding,ke=C.callback,$e=F.objectMode?1:Te.length;if(x(ee,F,!1,$e,Te,Le,ke),C=C.next,F.bufferedRequestCount--,F.writing)break}C===null&&(F.lastBufferedRequest=null)}F.bufferedRequest=C,F.bufferProcessing=!1}_.prototype._write=function(ee,F,C){C(new m("_write()"))},_.prototype._writev=null,_.prototype.end=function(ee,F,C){var z=this._writableState;return typeof ee=="function"?(C=ee,ee=null,F=null):typeof F=="function"&&(C=F,F=null),ee!=null&&this.write(ee,F),z.corked&&(z.corked=1,this.uncork()),z.ending||se(this,z,C),this},Object.defineProperty(_.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function ue(ee){return ee.ending&&ee.length===0&&ee.bufferedRequest===null&&!ee.finished&&!ee.writing}function ie(ee,F){ee._final(function(C){F.pendingcb--,C&&h(ee,C),F.prefinished=!0,ee.emit("prefinish"),re(ee,F)})}function G(ee,F){!F.prefinished&&!F.finalCalled&&(typeof ee._final=="function"&&!F.destroyed?(F.pendingcb++,F.finalCalled=!0,ve.nextTick(ie,ee,F)):(F.prefinished=!0,ee.emit("prefinish")))}function re(ee,F){var C=ue(F);if(C&&(G(ee,F),F.pendingcb===0&&(F.finished=!0,ee.emit("finish"),F.autoDestroy))){var z=ee._readableState;(!z||z.autoDestroy&&z.endEmitted)&&ee.destroy()}return C}function se(ee,F,C){F.ending=!0,re(ee,F),C&&(F.finished?ve.nextTick(C):ee.once("finish",C)),F.ended=!0,ee.writable=!1}function Ie(ee,F,C){var z=ee.entry;for(ee.entry=null;z;){var q=z.callback;F.pendingcb--,q(C),z=z.next}F.corkedRequestsFree.next=ee}return Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(F){this._writableState&&(this._writableState.destroyed=F)}}),_.prototype.destroy=c.destroy,_.prototype._undestroy=c.undestroy,_.prototype._destroy=function(ee,F){F(ee)},mu}var yu,_m;function $i(){if(_m)return yu;_m=1;var e=Object.keys||function(u){var l=[];for(var d in u)l.push(d);return l};yu=s;var t=xm(),n=Rm();ni()(s,t);for(var r=e(n.prototype),o=0;o<r.length;o++){var i=r[o];s.prototype[i]||(s.prototype[i]=n.prototype[i])}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||ve.nextTick(c,this)}function c(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(l){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=l,this._writableState.destroyed=l)}}),yu}var bu={},Fs={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var Im;function gR(){return Im||(Im=1,function(e,t){var n=Is(),r=n.Buffer;function o(s,a){for(var c in s)a[c]=s[c]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=i);function i(s,a,c){return r(s,a,c)}i.prototype=Object.create(r.prototype),o(r,i),i.from=function(s,a,c){if(typeof s=="number")throw new TypeError("Argument must not be a number");return r(s,a,c)},i.alloc=function(s,a,c){if(typeof s!="number")throw new TypeError("Argument must be a number");var u=r(s);return a!==void 0?typeof c=="string"?u.fill(a,c):u.fill(a):u.fill(0),u},i.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r(s)},i.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(s)}}(Fs,Fs.exports)),Fs.exports}var Cm;function vu(){if(Cm)return bu;Cm=1;var e=gR().Buffer,t=e.isEncoding||function(b){switch(b=""+b,b&&b.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(b){if(!b)return"utf8";for(var g;;)switch(b){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 b;default:if(g)return;b=(""+b).toLowerCase(),g=!0}}function r(b){var g=n(b);if(typeof g!="string"&&(e.isEncoding===t||!t(b)))throw new Error("Unknown encoding: "+b);return g||b}bu.StringDecoder=o;function o(b){this.encoding=r(b);var g;switch(this.encoding){case"utf16le":this.text=d,this.end=f,g=4;break;case"utf8":this.fillLast=c,g=4;break;case"base64":this.text=m,this.end=w,g=3;break;default:this.write=y,this.end=E;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(g)}o.prototype.write=function(b){if(b.length===0)return"";var g,v;if(this.lastNeed){if(g=this.fillLast(b),g===void 0)return"";v=this.lastNeed,this.lastNeed=0}else v=0;return v<b.length?g?g+this.text(b,v):this.text(b,v):g||""},o.prototype.end=l,o.prototype.text=u,o.prototype.fillLast=function(b){if(this.lastNeed<=b.length)return b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,b.length),this.lastNeed-=b.length};function i(b){return b<=127?0:b>>5===6?2:b>>4===14?3:b>>3===30?4:b>>6===2?-1:-2}function s(b,g,v){var h=g.length-1;if(h<v)return 0;var S=i(g[h]);return S>=0?(S>0&&(b.lastNeed=S-1),S):--h<v||S===-2?0:(S=i(g[h]),S>=0?(S>0&&(b.lastNeed=S-2),S):--h<v||S===-2?0:(S=i(g[h]),S>=0?(S>0&&(S===2?S=0:b.lastNeed=S-3),S):0))}function a(b,g,v){if((g[0]&192)!==128)return b.lastNeed=0,"�";if(b.lastNeed>1&&g.length>1){if((g[1]&192)!==128)return b.lastNeed=1,"�";if(b.lastNeed>2&&g.length>2&&(g[2]&192)!==128)return b.lastNeed=2,"�"}}function c(b){var g=this.lastTotal-this.lastNeed,v=a(this,b);if(v!==void 0)return v;if(this.lastNeed<=b.length)return b.copy(this.lastChar,g,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,g,0,b.length),this.lastNeed-=b.length}function u(b,g){var v=s(this,b,g);if(!this.lastNeed)return b.toString("utf8",g);this.lastTotal=v;var h=b.length-(v-this.lastNeed);return b.copy(this.lastChar,0,h),b.toString("utf8",g,h)}function l(b){var g=b&&b.length?this.write(b):"";return this.lastNeed?g+"�":g}function d(b,g){if((b.length-g)%2===0){var v=b.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]=b[b.length-2],this.lastChar[1]=b[b.length-1],v.slice(0,-1)}return v}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=b[b.length-1],b.toString("utf16le",g,b.length-1)}function f(b){var g=b&&b.length?this.write(b):"";if(this.lastNeed){var v=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,v)}return g}function m(b,g){var v=(b.length-g)%3;return v===0?b.toString("base64",g):(this.lastNeed=3-v,this.lastTotal=3,v===1?this.lastChar[0]=b[b.length-1]:(this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1]),b.toString("base64",g,b.length-v))}function w(b){var g=b&&b.length?this.write(b):"";return this.lastNeed?g+this.lastChar.toString("base64",0,3-this.lastNeed):g}function y(b){return b.toString(this.encoding)}function E(b){return b&&b.length?this.write(b):""}return bu}var wu,Pm;function Su(){if(Pm)return wu;Pm=1;var e=Ni().codes.ERR_STREAM_PREMATURE_CLOSE;function t(i){var s=!1;return function(){if(!s){s=!0;for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];i.apply(this,c)}}}function n(){}function r(i){return i.setHeader&&typeof i.abort=="function"}function o(i,s,a){if(typeof s=="function")return o(i,null,s);s||(s={}),a=t(a||n);var c=s.readable||s.readable!==!1&&i.readable,u=s.writable||s.writable!==!1&&i.writable,l=function(){i.writable||f()},d=i._writableState&&i._writableState.finished,f=function(){u=!1,d=!0,c||a.call(i)},m=i._readableState&&i._readableState.endEmitted,w=function(){c=!1,m=!0,u||a.call(i)},y=function(v){a.call(i,v)},E=function(){var v;if(c&&!m)return(!i._readableState||!i._readableState.ended)&&(v=new e),a.call(i,v);if(u&&!d)return(!i._writableState||!i._writableState.ended)&&(v=new e),a.call(i,v)},b=function(){i.req.on("finish",f)};return r(i)?(i.on("complete",f),i.on("abort",E),i.req?b():i.on("request",b)):u&&!i._writableState&&(i.on("end",l),i.on("close",l)),i.on("end",w),i.on("finish",f),s.error!==!1&&i.on("error",y),i.on("close",E),function(){i.removeListener("complete",f),i.removeListener("abort",E),i.removeListener("request",b),i.req&&i.req.removeListener("finish",f),i.removeListener("end",l),i.removeListener("close",l),i.removeListener("finish",f),i.removeListener("end",w),i.removeListener("error",y),i.removeListener("close",E)}}return wu=o,wu}var Eu,Fm;function mR(){if(Fm)return Eu;Fm=1;var e;function t(v,h,S){return h=n(h),h in v?Object.defineProperty(v,h,{value:S,enumerable:!0,configurable:!0,writable:!0}):v[h]=S,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 S=v[Symbol.toPrimitive];if(S!==void 0){var T=S.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 o=Su(),i=Symbol("lastResolve"),s=Symbol("lastReject"),a=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),l=Symbol("handlePromise"),d=Symbol("stream");function f(v,h){return{value:v,done:h}}function m(v){var h=v[i];if(h!==null){var S=v[d].read();S!==null&&(v[u]=null,v[i]=null,v[s]=null,h(f(S,!1)))}}function w(v){ve.nextTick(m,v)}function y(v,h){return function(S,T){v.then(function(){if(h[c]){S(f(void 0,!0));return}h[l](S,T)},T)}}var E=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((e={get stream(){return this[d]},next:function(){var h=this,S=this[a];if(S!==null)return Promise.reject(S);if(this[c])return Promise.resolve(f(void 0,!0));if(this[d].destroyed)return new Promise(function(A,$){ve.nextTick(function(){h[a]?$(h[a]):A(f(void 0,!0))})});var T=this[u],R;if(T)R=new Promise(y(T,this));else{var _=this[d].read();if(_!==null)return Promise.resolve(f(_,!1));R=new Promise(this[l])}return this[u]=R,R}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var h=this;return new Promise(function(S,T){h[d].destroy(null,function(R){if(R){T(R);return}S(f(void 0,!0))})})}),e),E),g=function(h){var S,T=Object.create(b,(S={},t(S,d,{value:h,writable:!0}),t(S,i,{value:null,writable:!0}),t(S,s,{value:null,writable:!0}),t(S,a,{value:null,writable:!0}),t(S,c,{value:h._readableState.endEmitted,writable:!0}),t(S,l,{value:function(_,A){var $=T[d].read();$?(T[u]=null,T[i]=null,T[s]=null,_(f($,!1))):(T[i]=_,T[s]=A)},writable:!0}),S));return T[u]=null,o(h,function(R){if(R&&R.code!=="ERR_STREAM_PREMATURE_CLOSE"){var _=T[s];_!==null&&(T[u]=null,T[i]=null,T[s]=null,_(R)),T[a]=R;return}var A=T[i];A!==null&&(T[u]=null,T[i]=null,T[s]=null,A(f(void 0,!0))),T[c]=!0}),h.on("readable",w.bind(null,T)),T};return Eu=g,Eu}var Tu,Om;function yR(){return Om||(Om=1,Tu=function(){throw new Error("Readable.from is not available in the browser")}),Tu}var Au,km;function xm(){if(km)return Au;km=1,Au=A;var e;A.ReadableState=_,ic().EventEmitter;var t=function(V,de){return V.listeners(de).length},n=og(),r=Is().Buffer,o=(typeof $r<"u"?$r:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function i(M){return r.from(M)}function s(M){return r.isBuffer(M)||M instanceof o}var a=mm(),c;a&&a.debuglog?c=a.debuglog("stream"):c=function(){};var u=pR(),l=vm(),d=Em(),f=d.getHighWaterMark,m=Ni().codes,w=m.ERR_INVALID_ARG_TYPE,y=m.ERR_STREAM_PUSH_AFTER_EOF,E=m.ERR_METHOD_NOT_IMPLEMENTED,b=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,g,v,h;ni()(A,n);var S=l.errorOrDestroy,T=["error","close","destroy","pause","resume"];function R(M,V,de){if(typeof M.prependListener=="function")return M.prependListener(V,de);!M._events||!M._events[V]?M.on(V,de):Array.isArray(M._events[V])?M._events[V].unshift(de):M._events[V]=[de,M._events[V]]}function _(M,V,de){e=e||$i(),M=M||{},typeof de!="boolean"&&(de=V instanceof e),this.objectMode=!!M.objectMode,de&&(this.objectMode=this.objectMode||!!M.readableObjectMode),this.highWaterMark=f(this,M,"readableHighWaterMark",de),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=M.emitClose!==!1,this.autoDestroy=!!M.autoDestroy,this.destroyed=!1,this.defaultEncoding=M.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,M.encoding&&(g||(g=vu().StringDecoder),this.decoder=new g(M.encoding),this.encoding=M.encoding)}function A(M){if(e=e||$i(),!(this instanceof A))return new A(M);var V=this instanceof e;this._readableState=new _(M,this,V),this.readable=!0,M&&(typeof M.read=="function"&&(this._read=M.read),typeof M.destroy=="function"&&(this._destroy=M.destroy)),n.call(this)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(V){this._readableState&&(this._readableState.destroyed=V)}}),A.prototype.destroy=l.destroy,A.prototype._undestroy=l.undestroy,A.prototype._destroy=function(M,V){V(M)},A.prototype.push=function(M,V){var de=this._readableState,Te;return de.objectMode?Te=!0:typeof M=="string"&&(V=V||de.defaultEncoding,V!==de.encoding&&(M=r.from(M,V),V=""),Te=!0),$(this,M,V,!1,Te)},A.prototype.unshift=function(M){return $(this,M,null,!0,!1)};function $(M,V,de,Te,Le){c("readableAddChunk",V);var ke=M._readableState;if(V===null)ke.reading=!1,le(M,ke);else{var $e;if(Le||($e=N(ke,V)),$e)S(M,$e);else if(ke.objectMode||V&&V.length>0)if(typeof V!="string"&&!ke.objectMode&&Object.getPrototypeOf(V)!==r.prototype&&(V=i(V)),Te)ke.endEmitted?S(M,new b):D(M,ke,V,!0);else if(ke.ended)S(M,new y);else{if(ke.destroyed)return!1;ke.reading=!1,ke.decoder&&!de?(V=ke.decoder.write(V),ke.objectMode||V.length!==0?D(M,ke,V,!1):ae(M,ke)):D(M,ke,V,!1)}else Te||(ke.reading=!1,ae(M,ke))}return!ke.ended&&(ke.length<ke.highWaterMark||ke.length===0)}function D(M,V,de,Te){V.flowing&&V.length===0&&!V.sync?(V.awaitDrain=0,M.emit("data",de)):(V.length+=V.objectMode?1:de.length,Te?V.buffer.unshift(de):V.buffer.push(de),V.needReadable&&be(M)),ae(M,V)}function N(M,V){var de;return!s(V)&&typeof V!="string"&&V!==void 0&&!M.objectMode&&(de=new w("chunk",["string","Buffer","Uint8Array"],V)),de}A.prototype.isPaused=function(){return this._readableState.flowing===!1},A.prototype.setEncoding=function(M){g||(g=vu().StringDecoder);var V=new g(M);this._readableState.decoder=V,this._readableState.encoding=this._readableState.decoder.encoding;for(var de=this._readableState.buffer.head,Te="";de!==null;)Te+=V.write(de.data),de=de.next;return this._readableState.buffer.clear(),Te!==""&&this._readableState.buffer.push(Te),this._readableState.length=Te.length,this};var x=1073741824;function W(M){return M>=x?M=x:(M--,M|=M>>>1,M|=M>>>2,M|=M>>>4,M|=M>>>8,M|=M>>>16,M++),M}function K(M,V){return M<=0||V.length===0&&V.ended?0:V.objectMode?1:M!==M?V.flowing&&V.length?V.buffer.head.data.length:V.length:(M>V.highWaterMark&&(V.highWaterMark=W(M)),M<=V.length?M:V.ended?V.length:(V.needReadable=!0,0))}A.prototype.read=function(M){c("read",M),M=parseInt(M,10);var V=this._readableState,de=M;if(M!==0&&(V.emittedReadable=!1),M===0&&V.needReadable&&((V.highWaterMark!==0?V.length>=V.highWaterMark:V.length>0)||V.ended))return c("read: emitReadable",V.length,V.ended),V.length===0&&V.ended?C(this):be(this),null;if(M=K(M,V),M===0&&V.ended)return V.length===0&&C(this),null;var Te=V.needReadable;c("need readable",Te),(V.length===0||V.length-M<V.highWaterMark)&&(Te=!0,c("length less than watermark",Te)),V.ended||V.reading?(Te=!1,c("reading or ended",Te)):Te&&(c("do read"),V.reading=!0,V.sync=!0,V.length===0&&(V.needReadable=!0),this._read(V.highWaterMark),V.sync=!1,V.reading||(M=K(de,V)));var Le;return M>0?Le=F(M,V):Le=null,Le===null?(V.needReadable=V.length<=V.highWaterMark,M=0):(V.length-=M,V.awaitDrain=0),V.length===0&&(V.ended||(V.needReadable=!0),de!==M&&V.ended&&C(this)),Le!==null&&this.emit("data",Le),Le};function le(M,V){if(c("onEofChunk"),!V.ended){if(V.decoder){var de=V.decoder.end();de&&de.length&&(V.buffer.push(de),V.length+=V.objectMode?1:de.length)}V.ended=!0,V.sync?be(M):(V.needReadable=!1,V.emittedReadable||(V.emittedReadable=!0,te(M)))}}function be(M){var V=M._readableState;c("emitReadable",V.needReadable,V.emittedReadable),V.needReadable=!1,V.emittedReadable||(c("emitReadable",V.flowing),V.emittedReadable=!0,ve.nextTick(te,M))}function te(M){var V=M._readableState;c("emitReadable_",V.destroyed,V.length,V.ended),!V.destroyed&&(V.length||V.ended)&&(M.emit("readable"),V.emittedReadable=!1),V.needReadable=!V.flowing&&!V.ended&&V.length<=V.highWaterMark,ee(M)}function ae(M,V){V.readingMore||(V.readingMore=!0,ve.nextTick(ue,M,V))}function ue(M,V){for(;!V.reading&&!V.ended&&(V.length<V.highWaterMark||V.flowing&&V.length===0);){var de=V.length;if(c("maybeReadMore read 0"),M.read(0),de===V.length)break}V.readingMore=!1}A.prototype._read=function(M){S(this,new E("_read()"))},A.prototype.pipe=function(M,V){var de=this,Te=this._readableState;switch(Te.pipesCount){case 0:Te.pipes=M;break;case 1:Te.pipes=[Te.pipes,M];break;default:Te.pipes.push(M);break}Te.pipesCount+=1,c("pipe count=%d opts=%j",Te.pipesCount,V);var Le=(!V||V.end!==!1)&&M!==ve.stdout&&M!==ve.stderr,ke=Le?Me:$t;Te.endEmitted?ve.nextTick(ke):de.once("end",ke),M.on("unpipe",$e);function $e(Be,ze){c("onunpipe"),Be===de&&ze&&ze.hasUnpiped===!1&&(ze.hasUnpiped=!0,Ne())}function Me(){c("onend"),M.end()}var Y=ie(de);M.on("drain",Y);var Pe=!1;function Ne(){c("cleanup"),M.removeListener("close",Nt),M.removeListener("finish",_t),M.removeListener("drain",Y),M.removeListener("error",et),M.removeListener("unpipe",$e),de.removeListener("end",Me),de.removeListener("end",$t),de.removeListener("data",Ve),Pe=!0,Te.awaitDrain&&(!M._writableState||M._writableState.needDrain)&&Y()}de.on("data",Ve);function Ve(Be){c("ondata");var ze=M.write(Be);c("dest.write",ze),ze===!1&&((Te.pipesCount===1&&Te.pipes===M||Te.pipesCount>1&&q(Te.pipes,M)!==-1)&&!Pe&&(c("false write response, pause",Te.awaitDrain),Te.awaitDrain++),de.pause())}function et(Be){c("onerror",Be),$t(),M.removeListener("error",et),t(M,"error")===0&&S(M,Be)}R(M,"error",et);function Nt(){M.removeListener("finish",_t),$t()}M.once("close",Nt);function _t(){c("onfinish"),M.removeListener("close",Nt),$t()}M.once("finish",_t);function $t(){c("unpipe"),de.unpipe(M)}return M.emit("pipe",de),Te.flowing||(c("pipe resume"),de.resume()),M};function ie(M){return function(){var de=M._readableState;c("pipeOnDrain",de.awaitDrain),de.awaitDrain&&de.awaitDrain--,de.awaitDrain===0&&t(M,"data")&&(de.flowing=!0,ee(M))}}A.prototype.unpipe=function(M){var V=this._readableState,de={hasUnpiped:!1};if(V.pipesCount===0)return this;if(V.pipesCount===1)return M&&M!==V.pipes?this:(M||(M=V.pipes),V.pipes=null,V.pipesCount=0,V.flowing=!1,M&&M.emit("unpipe",this,de),this);if(!M){var Te=V.pipes,Le=V.pipesCount;V.pipes=null,V.pipesCount=0,V.flowing=!1;for(var ke=0;ke<Le;ke++)Te[ke].emit("unpipe",this,{hasUnpiped:!1});return this}var $e=q(V.pipes,M);return $e===-1?this:(V.pipes.splice($e,1),V.pipesCount-=1,V.pipesCount===1&&(V.pipes=V.pipes[0]),M.emit("unpipe",this,de),this)},A.prototype.on=function(M,V){var de=n.prototype.on.call(this,M,V),Te=this._readableState;return M==="data"?(Te.readableListening=this.listenerCount("readable")>0,Te.flowing!==!1&&this.resume()):M==="readable"&&!Te.endEmitted&&!Te.readableListening&&(Te.readableListening=Te.needReadable=!0,Te.flowing=!1,Te.emittedReadable=!1,c("on readable",Te.length,Te.reading),Te.length?be(this):Te.reading||ve.nextTick(re,this)),de},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(M,V){var de=n.prototype.removeListener.call(this,M,V);return M==="readable"&&ve.nextTick(G,this),de},A.prototype.removeAllListeners=function(M){var V=n.prototype.removeAllListeners.apply(this,arguments);return(M==="readable"||M===void 0)&&ve.nextTick(G,this),V};function G(M){var V=M._readableState;V.readableListening=M.listenerCount("readable")>0,V.resumeScheduled&&!V.paused?V.flowing=!0:M.listenerCount("data")>0&&M.resume()}function re(M){c("readable nexttick read 0"),M.read(0)}A.prototype.resume=function(){var M=this._readableState;return M.flowing||(c("resume"),M.flowing=!M.readableListening,se(this,M)),M.paused=!1,this};function se(M,V){V.resumeScheduled||(V.resumeScheduled=!0,ve.nextTick(Ie,M,V))}function Ie(M,V){c("resume",V.reading),V.reading||M.read(0),V.resumeScheduled=!1,M.emit("resume"),ee(M),V.flowing&&!V.reading&&M.read(0)}A.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function ee(M){var V=M._readableState;for(c("flow",V.flowing);V.flowing&&M.read()!==null;);}A.prototype.wrap=function(M){var V=this,de=this._readableState,Te=!1;M.on("end",function(){if(c("wrapped end"),de.decoder&&!de.ended){var $e=de.decoder.end();$e&&$e.length&&V.push($e)}V.push(null)}),M.on("data",function($e){if(c("wrapped data"),de.decoder&&($e=de.decoder.write($e)),!(de.objectMode&&$e==null)&&!(!de.objectMode&&(!$e||!$e.length))){var Me=V.push($e);Me||(Te=!0,M.pause())}});for(var Le in M)this[Le]===void 0&&typeof M[Le]=="function"&&(this[Le]=function(Me){return function(){return M[Me].apply(M,arguments)}}(Le));for(var ke=0;ke<T.length;ke++)M.on(T[ke],this.emit.bind(this,T[ke]));return this._read=function($e){c("wrapped _read",$e),Te&&(Te=!1,M.resume())},this},typeof Symbol=="function"&&(A.prototype[Symbol.asyncIterator]=function(){return v===void 0&&(v=mR()),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(V){this._readableState&&(this._readableState.flowing=V)}}),A._fromList=F,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function F(M,V){if(V.length===0)return null;var de;return V.objectMode?de=V.buffer.shift():!M||M>=V.length?(V.decoder?de=V.buffer.join(""):V.buffer.length===1?de=V.buffer.first():de=V.buffer.concat(V.length),V.buffer.clear()):de=V.buffer.consume(M,V.decoder),de}function C(M){var V=M._readableState;c("endReadable",V.endEmitted),V.endEmitted||(V.ended=!0,ve.nextTick(z,V,M))}function z(M,V){if(c("endReadableNT",M.endEmitted,M.length),!M.endEmitted&&M.length===0&&(M.endEmitted=!0,V.readable=!1,V.emit("end"),M.autoDestroy)){var de=V._writableState;(!de||de.autoDestroy&&de.finished)&&V.destroy()}}typeof Symbol=="function"&&(A.from=function(M,V){return h===void 0&&(h=yR()),h(A,M,V)});function q(M,V){for(var de=0,Te=M.length;de<Te;de++)if(M[de]===V)return de;return-1}return Au}var Ru,Nm;function $m(){if(Nm)return Ru;Nm=1,Ru=a;var e=Ni().codes,t=e.ERR_METHOD_NOT_IMPLEMENTED,n=e.ERR_MULTIPLE_CALLBACK,r=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=e.ERR_TRANSFORM_WITH_LENGTH_0,i=$i();ni()(a,i);function s(l,d){var f=this._transformState;f.transforming=!1;var m=f.writecb;if(m===null)return this.emit("error",new n);f.writechunk=null,f.writecb=null,d!=null&&this.push(d),m(l);var w=this._readableState;w.reading=!1,(w.needReadable||w.length<w.highWaterMark)&&this._read(w.highWaterMark)}function a(l){if(!(this instanceof a))return new a(l);i.call(this,l),this._transformState={afterTransform:s.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,l&&(typeof l.transform=="function"&&(this._transform=l.transform),typeof l.flush=="function"&&(this._flush=l.flush)),this.on("prefinish",c)}function c(){var l=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(d,f){u(l,d,f)}):u(this,null,null)}a.prototype.push=function(l,d){return this._transformState.needTransform=!1,i.prototype.push.call(this,l,d)},a.prototype._transform=function(l,d,f){f(new t("_transform()"))},a.prototype._write=function(l,d,f){var m=this._transformState;if(m.writecb=f,m.writechunk=l,m.writeencoding=d,!m.transforming){var w=this._readableState;(m.needTransform||w.needReadable||w.length<w.highWaterMark)&&this._read(w.highWaterMark)}},a.prototype._read=function(l){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(l,d){i.prototype._destroy.call(this,l,function(f){d(f)})};function u(l,d,f){if(d)return l.emit("error",d);if(f!=null&&l.push(f),l._writableState.length)throw new o;if(l._transformState.transforming)throw new r;return l.push(null)}return Ru}var _u,Dm;function bR(){if(Dm)return _u;Dm=1,_u=t;var e=$m();ni()(t,e);function t(n){if(!(this instanceof t))return new t(n);e.call(this,n)}return t.prototype._transform=function(n,r,o){o(null,n)},_u}var Iu,Lm;function vR(){if(Lm)return Iu;Lm=1;var e;function t(f){var m=!1;return function(){m||(m=!0,f.apply(void 0,arguments))}}var n=Ni().codes,r=n.ERR_MISSING_ARGS,o=n.ERR_STREAM_DESTROYED;function i(f){if(f)throw f}function s(f){return f.setHeader&&typeof f.abort=="function"}function a(f,m,w,y){y=t(y);var E=!1;f.on("close",function(){E=!0}),e===void 0&&(e=Su()),e(f,{readable:m,writable:w},function(g){if(g)return y(g);E=!0,y()});var b=!1;return function(g){if(!E&&!b){if(b=!0,s(f))return f.abort();if(typeof f.destroy=="function")return f.destroy();y(g||new o("pipe"))}}}function c(f){f()}function u(f,m){return f.pipe(m)}function l(f){return!f.length||typeof f[f.length-1]!="function"?i:f.pop()}function d(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];var y=l(m);if(Array.isArray(m[0])&&(m=m[0]),m.length<2)throw new r("streams");var E,b=m.map(function(g,v){var h=v<m.length-1,S=v>0;return a(g,h,S,function(T){E||(E=T),T&&b.forEach(c),!h&&(b.forEach(c),y(E))})});return m.reduce(u)}return Iu=d,Iu}var Cu,Mm;function wR(){if(Mm)return Cu;Mm=1,Cu=n;var e=ic().EventEmitter,t=ni();t(n,e),n.Readable=xm(),n.Writable=Rm(),n.Duplex=$i(),n.Transform=$m(),n.PassThrough=bR(),n.finished=Su(),n.pipeline=vR(),n.Stream=n;function n(){e.call(this)}return n.prototype.pipe=function(r,o){var i=this;function s(m){r.writable&&r.write(m)===!1&&i.pause&&i.pause()}i.on("data",s);function a(){i.readable&&i.resume&&i.resume()}r.on("drain",a),!r._isStdio&&(!o||o.end!==!1)&&(i.on("end",u),i.on("close",l));var c=!1;function u(){c||(c=!0,r.end())}function l(){c||(c=!0,typeof r.destroy=="function"&&r.destroy())}function d(m){if(f(),e.listenerCount(this,"error")===0)throw m}i.on("error",d),r.on("error",d);function f(){i.removeListener("data",s),r.removeListener("drain",a),i.removeListener("end",u),i.removeListener("close",l),i.removeListener("error",d),r.removeListener("error",d),i.removeListener("end",f),i.removeListener("close",f),r.removeListener("close",f)}return i.on("end",f),i.on("close",f),r.on("close",f),r.emit("pipe",i),r},Cu}var Bm;function SR(){return Bm||(Bm=1,function(e){(function(t){t.parser=function(F,C){return new r(F,C)},t.SAXParser=r,t.SAXStream=l,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,C){if(!(this instanceof r))return new r(F,C);var z=this;i(z),z.q=z.c="",z.bufferCheckPosition=t.MAX_BUFFER_LENGTH,z.opt=C||{},z.opt.lowercase=z.opt.lowercase||z.opt.lowercasetags,z.looseCase=z.opt.lowercase?"toLowerCase":"toUpperCase",z.tags=[],z.closed=z.closedRoot=z.sawRoot=!1,z.tag=z.error=null,z.strict=!!F,z.noscript=!!(F||z.opt.noscript),z.state=A.BEGIN,z.strictEntities=z.opt.strictEntities,z.ENTITIES=z.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),z.attribList=[],z.opt.xmlns&&(z.ns=Object.create(y)),z.opt.unquotedAttributeValues===void 0&&(z.opt.unquotedAttributeValues=!F),z.trackPosition=z.opt.position!==!1,z.trackPosition&&(z.position=z.line=z.column=0),D(z,"onready")}Object.create||(Object.create=function(F){function C(){}C.prototype=F;var z=new C;return z}),Object.keys||(Object.keys=function(F){var C=[];for(var z in F)F.hasOwnProperty(z)&&C.push(z);return C});function o(F){for(var C=Math.max(t.MAX_BUFFER_LENGTH,10),z=0,q=0,M=n.length;q<M;q++){var V=F[n[q]].length;if(V>C)switch(n[q]){case"textNode":x(F);break;case"cdata":N(F,"oncdata",F.cdata),F.cdata="";break;case"script":N(F,"onscript",F.script),F.script="";break;default:K(F,"Max buffer length exceeded: "+n[q])}z=Math.max(z,V)}var de=t.MAX_BUFFER_LENGTH-z;F.bufferCheckPosition=de+F.position}function i(F){for(var C=0,z=n.length;C<z;C++)F[n[C]]=""}function s(F){x(F),F.cdata!==""&&(N(F,"oncdata",F.cdata),F.cdata=""),F.script!==""&&(N(F,"onscript",F.script),F.script="")}r.prototype={end:function(){le(this)},write:ee,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){s(this)}};var a;try{a=wR().Stream}catch{a=function(){}}a||(a=function(){});var c=t.EVENTS.filter(function(F){return F!=="error"&&F!=="end"});function u(F,C){return new l(F,C)}function l(F,C){if(!(this instanceof l))return new l(F,C);a.apply(this),this._parser=new r(F,C),this.writable=!0,this.readable=!0;var z=this;this._parser.onend=function(){z.emit("end")},this._parser.onerror=function(q){z.emit("error",q),z._parser.error=null},this._decoder=null,c.forEach(function(q){Object.defineProperty(z,"on"+q,{get:function(){return z._parser["on"+q]},set:function(M){if(!M)return z.removeAllListeners(q),z._parser["on"+q]=M,M;z.on(q,M)},enumerable:!0,configurable:!1})})}l.prototype=Object.create(a.prototype,{constructor:{value:l}}),l.prototype.write=function(F){if(typeof wr=="function"&&typeof wr.isBuffer=="function"&&wr.isBuffer(F)){if(!this._decoder){var C=vu().StringDecoder;this._decoder=new C("utf8")}F=this._decoder.write(F)}return this._parser.write(F.toString()),this.emit("data",F),!0},l.prototype.end=function(F){return F&&F.length&&this.write(F),this._parser.end(),!0},l.prototype.on=function(F,C){var z=this;return!z._parser["on"+F]&&c.indexOf(F)!==-1&&(z._parser["on"+F]=function(){var q=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);q.splice(0,0,F),z.emit.apply(z,q)}),a.prototype.on.call(z,F,C)};var d="[CDATA[",f="DOCTYPE",m="http://www.w3.org/XML/1998/namespace",w="http://www.w3.org/2000/xmlns/",y={xml:m,xmlns:w},E=/[:_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]/,b=/[:_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===`
26
+ `||F==="\r"||F===" "}function S(F){return F==='"'||F==="'"}function T(F){return F===">"||h(F)}function R(F,C){return F.test(C)}function _(F,C){return!R(F,C)}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 C=t.ENTITIES[F],z=typeof C=="number"?String.fromCharCode(C):C;t.ENTITIES[F]=z});for(var $ in t.STATE)t.STATE[t.STATE[$]]=$;A=t.STATE;function D(F,C,z){F[C]&&F[C](z)}function N(F,C,z){F.textNode&&x(F),D(F,C,z)}function x(F){F.textNode=W(F.opt,F.textNode),F.textNode&&D(F,"ontext",F.textNode),F.textNode=""}function W(F,C){return F.trim&&(C=C.trim()),F.normalize&&(C=C.replace(/\s+/g," ")),C}function K(F,C){return x(F),F.trackPosition&&(C+=`
27
+ Line: `+F.line+`
28
+ Column: `+F.column+`
29
+ Char: `+F.c),C=new Error(C),F.error=C,D(F,"onerror",C),F}function le(F){return F.sawRoot&&!F.closedRoot&&be(F,"Unclosed root tag"),F.state!==A.BEGIN&&F.state!==A.BEGIN_WHITESPACE&&F.state!==A.TEXT&&K(F,"Unexpected end"),x(F),F.c="",F.closed=!0,D(F,"onend"),r.call(F,F.strict,F.opt),F}function be(F,C){if(typeof F!="object"||!(F instanceof r))throw new Error("bad call to strictFail");F.strict&&K(F,C)}function te(F){F.strict||(F.tagName=F.tagName[F.looseCase]());var C=F.tags[F.tags.length-1]||F,z=F.tag={name:F.tagName,attributes:{}};F.opt.xmlns&&(z.ns=C.ns),F.attribList.length=0,N(F,"onopentagstart",z)}function ae(F,C){var z=F.indexOf(":"),q=z<0?["",F]:F.split(":"),M=q[0],V=q[1];return C&&F==="xmlns"&&(M="xmlns",V=""),{prefix:M,local:V}}function ue(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 C=ae(F.attribName,!0),z=C.prefix,q=C.local;if(z==="xmlns")if(q==="xml"&&F.attribValue!==m)be(F,"xml: prefix must be bound to "+m+`
30
+ Actual: `+F.attribValue);else if(q==="xmlns"&&F.attribValue!==w)be(F,"xmlns: prefix must be bound to "+w+`
31
+ Actual: `+F.attribValue);else{var M=F.tag,V=F.tags[F.tags.length-1]||F;M.ns===V.ns&&(M.ns=Object.create(V.ns)),M.ns[q]=F.attribValue}F.attribList.push([F.attribName,F.attribValue])}else F.tag.attributes[F.attribName]=F.attribValue,N(F,"onattribute",{name:F.attribName,value:F.attribValue});F.attribName=F.attribValue=""}function ie(F,C){if(F.opt.xmlns){var z=F.tag,q=ae(F.tagName);z.prefix=q.prefix,z.local=q.local,z.uri=z.ns[q.prefix]||"",z.prefix&&!z.uri&&(be(F,"Unbound namespace prefix: "+JSON.stringify(F.tagName)),z.uri=q.prefix);var M=F.tags[F.tags.length-1]||F;z.ns&&M.ns!==z.ns&&Object.keys(z.ns).forEach(function(Ve){N(F,"onopennamespace",{prefix:Ve,uri:z.ns[Ve]})});for(var V=0,de=F.attribList.length;V<de;V++){var Te=F.attribList[V],Le=Te[0],ke=Te[1],$e=ae(Le,!0),Me=$e.prefix,Y=$e.local,Pe=Me===""?"":z.ns[Me]||"",Ne={name:Le,value:ke,prefix:Me,local:Y,uri:Pe};Me&&Me!=="xmlns"&&!Pe&&(be(F,"Unbound namespace prefix: "+JSON.stringify(Me)),Ne.uri=Me),F.tag.attributes[Le]=Ne,N(F,"onattribute",Ne)}F.attribList.length=0}F.tag.isSelfClosing=!!C,F.sawRoot=!0,F.tags.push(F.tag),N(F,"onopentag",F.tag),C||(!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 G(F){if(!F.tagName){be(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}N(F,"onscript",F.script),F.script=""}var C=F.tags.length,z=F.tagName;F.strict||(z=z[F.looseCase]());for(var q=z;C--;){var M=F.tags[C];if(M.name!==q)be(F,"Unexpected close tag");else break}if(C<0){be(F,"Unmatched closing tag: "+F.tagName),F.textNode+="</"+F.tagName+">",F.state=A.TEXT;return}F.tagName=z;for(var V=F.tags.length;V-- >C;){var de=F.tag=F.tags.pop();F.tagName=F.tag.name,N(F,"onclosetag",F.tagName);var Te={};for(var Le in de.ns)Te[Le]=de.ns[Le];var ke=F.tags[F.tags.length-1]||F;F.opt.xmlns&&de.ns!==ke.ns&&Object.keys(de.ns).forEach(function($e){var Me=de.ns[$e];N(F,"onclosenamespace",{prefix:$e,uri:Me})})}C===0&&(F.closedRoot=!0),F.tagName=F.attribValue=F.attribName="",F.attribList.length=0,F.state=A.TEXT}function re(F){var C=F.entity,z=C.toLowerCase(),q,M="";return F.ENTITIES[C]?F.ENTITIES[C]:F.ENTITIES[z]?F.ENTITIES[z]:(C=z,C.charAt(0)==="#"&&(C.charAt(1)==="x"?(C=C.slice(2),q=parseInt(C,16),M=q.toString(16)):(C=C.slice(1),q=parseInt(C,10),M=q.toString(10))),C=C.replace(/^0+/,""),isNaN(q)||M.toLowerCase()!==C?(be(F,"Invalid character entity"),"&"+F.entity+";"):String.fromCodePoint(q))}function se(F,C){C==="<"?(F.state=A.OPEN_WAKA,F.startTagPosition=F.position):h(C)||(be(F,"Non-whitespace before first tag."),F.textNode=C,F.state=A.TEXT)}function Ie(F,C){var z="";return C<F.length&&(z=F.charAt(C)),z}function ee(F){var C=this;if(this.error)throw this.error;if(C.closed)return K(C,"Cannot write after close. Assign an onready handler.");if(F===null)return le(C);typeof F=="object"&&(F=F.toString());for(var z=0,q="";q=Ie(F,z++),C.c=q,!!q;)switch(C.trackPosition&&(C.position++,q===`
32
+ `?(C.line++,C.column=0):C.column++),C.state){case A.BEGIN:if(C.state=A.BEGIN_WHITESPACE,q==="\uFEFF")continue;se(C,q);continue;case A.BEGIN_WHITESPACE:se(C,q);continue;case A.TEXT:if(C.sawRoot&&!C.closedRoot){for(var M=z-1;q&&q!=="<"&&q!=="&";)q=Ie(F,z++),q&&C.trackPosition&&(C.position++,q===`
33
+ `?(C.line++,C.column=0):C.column++);C.textNode+=F.substring(M,z-1)}q==="<"&&!(C.sawRoot&&C.closedRoot&&!C.strict)?(C.state=A.OPEN_WAKA,C.startTagPosition=C.position):(!h(q)&&(!C.sawRoot||C.closedRoot)&&be(C,"Text data outside of root node."),q==="&"?C.state=A.TEXT_ENTITY:C.textNode+=q);continue;case A.SCRIPT:q==="<"?C.state=A.SCRIPT_ENDING:C.script+=q;continue;case A.SCRIPT_ENDING:q==="/"?C.state=A.CLOSE_TAG:(C.script+="<"+q,C.state=A.SCRIPT);continue;case A.OPEN_WAKA:if(q==="!")C.state=A.SGML_DECL,C.sgmlDecl="";else if(!h(q))if(R(E,q))C.state=A.OPEN_TAG,C.tagName=q;else if(q==="/")C.state=A.CLOSE_TAG,C.tagName="";else if(q==="?")C.state=A.PROC_INST,C.procInstName=C.procInstBody="";else{if(be(C,"Unencoded <"),C.startTagPosition+1<C.position){var V=C.position-C.startTagPosition;q=new Array(V).join(" ")+q}C.textNode+="<"+q,C.state=A.TEXT}continue;case A.SGML_DECL:if(C.sgmlDecl+q==="--"){C.state=A.COMMENT,C.comment="",C.sgmlDecl="";continue}C.doctype&&C.doctype!==!0&&C.sgmlDecl?(C.state=A.DOCTYPE_DTD,C.doctype+="<!"+C.sgmlDecl+q,C.sgmlDecl=""):(C.sgmlDecl+q).toUpperCase()===d?(N(C,"onopencdata"),C.state=A.CDATA,C.sgmlDecl="",C.cdata=""):(C.sgmlDecl+q).toUpperCase()===f?(C.state=A.DOCTYPE,(C.doctype||C.sawRoot)&&be(C,"Inappropriately located doctype declaration"),C.doctype="",C.sgmlDecl=""):q===">"?(N(C,"onsgmldeclaration",C.sgmlDecl),C.sgmlDecl="",C.state=A.TEXT):(S(q)&&(C.state=A.SGML_DECL_QUOTED),C.sgmlDecl+=q);continue;case A.SGML_DECL_QUOTED:q===C.q&&(C.state=A.SGML_DECL,C.q=""),C.sgmlDecl+=q;continue;case A.DOCTYPE:q===">"?(C.state=A.TEXT,N(C,"ondoctype",C.doctype),C.doctype=!0):(C.doctype+=q,q==="["?C.state=A.DOCTYPE_DTD:S(q)&&(C.state=A.DOCTYPE_QUOTED,C.q=q));continue;case A.DOCTYPE_QUOTED:C.doctype+=q,q===C.q&&(C.q="",C.state=A.DOCTYPE);continue;case A.DOCTYPE_DTD:q==="]"?(C.doctype+=q,C.state=A.DOCTYPE):q==="<"?(C.state=A.OPEN_WAKA,C.startTagPosition=C.position):S(q)?(C.doctype+=q,C.state=A.DOCTYPE_DTD_QUOTED,C.q=q):C.doctype+=q;continue;case A.DOCTYPE_DTD_QUOTED:C.doctype+=q,q===C.q&&(C.state=A.DOCTYPE_DTD,C.q="");continue;case A.COMMENT:q==="-"?C.state=A.COMMENT_ENDING:C.comment+=q;continue;case A.COMMENT_ENDING:q==="-"?(C.state=A.COMMENT_ENDED,C.comment=W(C.opt,C.comment),C.comment&&N(C,"oncomment",C.comment),C.comment=""):(C.comment+="-"+q,C.state=A.COMMENT);continue;case A.COMMENT_ENDED:q!==">"?(be(C,"Malformed comment"),C.comment+="--"+q,C.state=A.COMMENT):C.doctype&&C.doctype!==!0?C.state=A.DOCTYPE_DTD:C.state=A.TEXT;continue;case A.CDATA:q==="]"?C.state=A.CDATA_ENDING:C.cdata+=q;continue;case A.CDATA_ENDING:q==="]"?C.state=A.CDATA_ENDING_2:(C.cdata+="]"+q,C.state=A.CDATA);continue;case A.CDATA_ENDING_2:q===">"?(C.cdata&&N(C,"oncdata",C.cdata),N(C,"onclosecdata"),C.cdata="",C.state=A.TEXT):q==="]"?C.cdata+="]":(C.cdata+="]]"+q,C.state=A.CDATA);continue;case A.PROC_INST:q==="?"?C.state=A.PROC_INST_ENDING:h(q)?C.state=A.PROC_INST_BODY:C.procInstName+=q;continue;case A.PROC_INST_BODY:if(!C.procInstBody&&h(q))continue;q==="?"?C.state=A.PROC_INST_ENDING:C.procInstBody+=q;continue;case A.PROC_INST_ENDING:q===">"?(N(C,"onprocessinginstruction",{name:C.procInstName,body:C.procInstBody}),C.procInstName=C.procInstBody="",C.state=A.TEXT):(C.procInstBody+="?"+q,C.state=A.PROC_INST_BODY);continue;case A.OPEN_TAG:R(b,q)?C.tagName+=q:(te(C),q===">"?ie(C):q==="/"?C.state=A.OPEN_TAG_SLASH:(h(q)||be(C,"Invalid character in tag name"),C.state=A.ATTRIB));continue;case A.OPEN_TAG_SLASH:q===">"?(ie(C,!0),G(C)):(be(C,"Forward-slash in opening tag not followed by >"),C.state=A.ATTRIB);continue;case A.ATTRIB:if(h(q))continue;q===">"?ie(C):q==="/"?C.state=A.OPEN_TAG_SLASH:R(E,q)?(C.attribName=q,C.attribValue="",C.state=A.ATTRIB_NAME):be(C,"Invalid attribute name");continue;case A.ATTRIB_NAME:q==="="?C.state=A.ATTRIB_VALUE:q===">"?(be(C,"Attribute without value"),C.attribValue=C.attribName,ue(C),ie(C)):h(q)?C.state=A.ATTRIB_NAME_SAW_WHITE:R(b,q)?C.attribName+=q:be(C,"Invalid attribute name");continue;case A.ATTRIB_NAME_SAW_WHITE:if(q==="=")C.state=A.ATTRIB_VALUE;else{if(h(q))continue;be(C,"Attribute without value"),C.tag.attributes[C.attribName]="",C.attribValue="",N(C,"onattribute",{name:C.attribName,value:""}),C.attribName="",q===">"?ie(C):R(E,q)?(C.attribName=q,C.state=A.ATTRIB_NAME):(be(C,"Invalid attribute name"),C.state=A.ATTRIB)}continue;case A.ATTRIB_VALUE:if(h(q))continue;S(q)?(C.q=q,C.state=A.ATTRIB_VALUE_QUOTED):(C.opt.unquotedAttributeValues||K(C,"Unquoted attribute value"),C.state=A.ATTRIB_VALUE_UNQUOTED,C.attribValue=q);continue;case A.ATTRIB_VALUE_QUOTED:if(q!==C.q){q==="&"?C.state=A.ATTRIB_VALUE_ENTITY_Q:C.attribValue+=q;continue}ue(C),C.q="",C.state=A.ATTRIB_VALUE_CLOSED;continue;case A.ATTRIB_VALUE_CLOSED:h(q)?C.state=A.ATTRIB:q===">"?ie(C):q==="/"?C.state=A.OPEN_TAG_SLASH:R(E,q)?(be(C,"No whitespace between attributes"),C.attribName=q,C.attribValue="",C.state=A.ATTRIB_NAME):be(C,"Invalid attribute name");continue;case A.ATTRIB_VALUE_UNQUOTED:if(!T(q)){q==="&"?C.state=A.ATTRIB_VALUE_ENTITY_U:C.attribValue+=q;continue}ue(C),q===">"?ie(C):C.state=A.ATTRIB;continue;case A.CLOSE_TAG:if(C.tagName)q===">"?G(C):R(b,q)?C.tagName+=q:C.script?(C.script+="</"+C.tagName,C.tagName="",C.state=A.SCRIPT):(h(q)||be(C,"Invalid tagname in closing tag"),C.state=A.CLOSE_TAG_SAW_WHITE);else{if(h(q))continue;_(E,q)?C.script?(C.script+="</"+q,C.state=A.SCRIPT):be(C,"Invalid tagname in closing tag."):C.tagName=q}continue;case A.CLOSE_TAG_SAW_WHITE:if(h(q))continue;q===">"?G(C):be(C,"Invalid characters in closing tag");continue;case A.TEXT_ENTITY:case A.ATTRIB_VALUE_ENTITY_Q:case A.ATTRIB_VALUE_ENTITY_U:var de,Te;switch(C.state){case A.TEXT_ENTITY:de=A.TEXT,Te="textNode";break;case A.ATTRIB_VALUE_ENTITY_Q:de=A.ATTRIB_VALUE_QUOTED,Te="attribValue";break;case A.ATTRIB_VALUE_ENTITY_U:de=A.ATTRIB_VALUE_UNQUOTED,Te="attribValue";break}if(q===";"){var Le=re(C);C.opt.unparsedEntities&&!Object.values(t.XML_ENTITIES).includes(Le)?(C.entity="",C.state=de,C.write(Le)):(C[Te]+=Le,C.entity="",C.state=de)}else R(C.entity.length?v:g,q)?C.entity+=q:(be(C,"Invalid character in entity name"),C[Te]+="&"+C.entity+q,C.entity="",C.state=de);continue;default:throw new Error(C,"Unknown state: "+C.state)}return C.position>=C.bufferCheckPosition&&o(C),C}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */String.fromCodePoint||function(){var F=String.fromCharCode,C=Math.floor,z=function(){var q=16384,M=[],V,de,Te=-1,Le=arguments.length;if(!Le)return"";for(var ke="";++Te<Le;){var $e=Number(arguments[Te]);if(!isFinite($e)||$e<0||$e>1114111||C($e)!==$e)throw RangeError("Invalid code point: "+$e);$e<=65535?M.push($e):($e-=65536,V=($e>>10)+55296,de=$e%1024+56320,M.push(V,de)),(Te+1===Le||M.length>q)&&(ke+=F.apply(null,M),M.length=0)}return ke};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:z,configurable:!0,writable:!0}):String.fromCodePoint=z}()})(e)}(rc)),rc}var Pu,jm;function Fu(){return jm||(jm=1,Pu={isArray:function(e){return Array.isArray?Array.isArray(e):Object.prototype.toString.call(e)==="[object Array]"}}),Pu}var Ou,Um;function ku(){if(Um)return Ou;Um=1;var e=Fu().isArray;return Ou={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}},Ou}var xu,qm;function Vm(){if(qm)return xu;qm=1;var e=SR(),t=ku(),n=Fu().isArray,r,o;function i(b){return r=t.copyOptions(b),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(b){var g=Number(b);if(!isNaN(g))return g;var v=b.toLowerCase();return v==="true"?!0:v==="false"?!1:b}function a(b,g){var v;if(r.compact){if(!o[r[b+"Key"]]&&(n(r.alwaysArray)?r.alwaysArray.indexOf(r[b+"Key"])!==-1:r.alwaysArray)&&(o[r[b+"Key"]]=[]),o[r[b+"Key"]]&&!n(o[r[b+"Key"]])&&(o[r[b+"Key"]]=[o[r[b+"Key"]]]),b+"Fn"in r&&typeof g=="string"&&(g=r[b+"Fn"](g,o)),b==="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,o);else{var h=g[v];delete g[v],g[r.instructionNameFn(v,h,o)]=h}}n(o[r[b+"Key"]])?o[r[b+"Key"]].push(g):o[r[b+"Key"]]=g}else{o[r.elementsKey]||(o[r.elementsKey]=[]);var S={};if(S[r.typeKey]=b,b==="instruction"){for(v in g)if(g.hasOwnProperty(v))break;S[r.nameKey]="instructionNameFn"in r?r.instructionNameFn(v,g,o):v,r.instructionHasAttributes?(S[r.attributesKey]=g[v][r.attributesKey],"instructionFn"in r&&(S[r.attributesKey]=r.instructionFn(S[r.attributesKey],v,o))):("instructionFn"in r&&(g[v]=r.instructionFn(g[v],v,o)),S[r.instructionKey]=g[v])}else b+"Fn"in r&&(g=r[b+"Fn"](g,o)),S[r[b+"Key"]]=g;r.addParent&&(S[r.parentKey]=o),o[r.elementsKey].push(S)}}function c(b){if("attributesFn"in r&&b&&(b=r.attributesFn(b,o)),(r.trim||"attributeValueFn"in r||"attributeNameFn"in r||r.nativeTypeAttributes)&&b){var g;for(g in b)if(b.hasOwnProperty(g)&&(r.trim&&(b[g]=b[g].trim()),r.nativeTypeAttributes&&(b[g]=s(b[g])),"attributeValueFn"in r&&(b[g]=r.attributeValueFn(b[g],g,o)),"attributeNameFn"in r)){var v=b[g];delete b[g],b[r.attributeNameFn(g,b[g],o)]=v}}return b}function u(b){var g={};if(b.body&&(b.name.toLowerCase()==="xml"||r.instructionHasAttributes)){for(var v=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g,h;(h=v.exec(b.body))!==null;)g[h[1]]=h[2]||h[3]||h[4];g=c(g)}if(b.name.toLowerCase()==="xml"){if(r.ignoreDeclaration)return;o[r.declarationKey]={},Object.keys(g).length&&(o[r.declarationKey][r.attributesKey]=g),r.addParent&&(o[r.declarationKey][r.parentKey]=o)}else{if(r.ignoreInstruction)return;r.trim&&(b.body=b.body.trim());var S={};r.instructionHasAttributes&&Object.keys(g).length?(S[b.name]={},S[b.name][r.attributesKey]=g):S[b.name]=b.body,a("instruction",S)}}function l(b,g){var v;if(typeof b=="object"&&(g=b.attributes,b=b.name),g=c(g),"elementNameFn"in r&&(b=r.elementNameFn(b,o)),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])}!(b in o)&&(n(r.alwaysArray)?r.alwaysArray.indexOf(b)!==-1:r.alwaysArray)&&(o[b]=[]),o[b]&&!n(o[b])&&(o[b]=[o[b]]),n(o[b])?o[b].push(v):o[b]=v}else o[r.elementsKey]||(o[r.elementsKey]=[]),v={},v[r.typeKey]="element",v[r.nameKey]=b,!r.ignoreAttributes&&g&&Object.keys(g).length&&(v[r.attributesKey]=g),r.alwaysChildren&&(v[r.elementsKey]=[]),o[r.elementsKey].push(v);v[r.parentKey]=o,o=v}function d(b){r.ignoreText||!b.trim()&&!r.captureSpacesBetweenElements||(r.trim&&(b=b.trim()),r.nativeType&&(b=s(b)),r.sanitize&&(b=b.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")),a("text",b))}function f(b){r.ignoreComment||(r.trim&&(b=b.trim()),a("comment",b))}function m(b){var g=o[r.parentKey];r.addParent||delete o[r.parentKey],o=g}function w(b){r.ignoreCdata||(r.trim&&(b=b.trim()),a("cdata",b))}function y(b){r.ignoreDoctype||(b=b.replace(/^ /,""),r.trim&&(b=b.trim()),a("doctype",b))}function E(b){b.note=b}return xu=function(b,g){var v=e.parser(!0,{}),h={};if(o=h,r=i(g),v.opt={strictEntities:!0},v.onopentag=l,v.ontext=d,v.oncomment=f,v.onclosetag=m,v.onerror=E,v.oncdata=w,v.ondoctype=y,v.onprocessinginstruction=u,v.write(b).close(),h[r.elementsKey]){var S=h[r.elementsKey];delete h[r.elementsKey],h[r.elementsKey]=S,delete h.text}return h},xu}var Nu,zm;function ER(){if(zm)return Nu;zm=1;var e=ku(),t=Vm();function n(r){var o=e.copyOptions(r);return e.ensureSpacesExists(o),o}return Nu=function(r,o){var i,s,a,c;return i=n(o),s=t(r,i),c="compact"in i&&i.compact?"_parent":"parent","addParent"in i&&i.addParent?a=JSON.stringify(s,function(u,l){return u===c?"_":l},i.spaces):a=JSON.stringify(s,null,i.spaces),a.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")},Nu}var $u,Wm;function Hm(){if(Wm)return $u;Wm=1;var e=ku(),t=Fu().isArray,n,r;function o(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 i(v,h,S){return(!S&&v.spaces?`
34
+ `:"")+Array(h+1).join(v.spaces)}function s(v,h,S){if(h.ignoreAttributes)return"";"attributesFn"in h&&(v=h.attributesFn(v,r,n));var T,R,_,A,$=[];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;"),_="attributeNameFn"in h?h.attributeNameFn(T,R,r,n):T,$.push(h.spaces&&h.indentAttributes?i(h,S+1,!1):" "),$.push(_+"="+A+("attributeValueFn"in h?h.attributeValueFn(R,T,r,n):R)+A));return v&&Object.keys(v).length&&h.spaces&&h.indentAttributes&&$.push(i(h,S,!1)),$.join("")}function a(v,h,S){return n=v,r="xml",h.ignoreDeclaration?"":"<?xml"+s(v[h.attributesKey],h,S)+"?>"}function c(v,h,S){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,S)+"?>";var _=v[T]?v[T]:"";return"instructionFn"in h&&(_=h.instructionFn(_,T,r,n)),"<?"+R+(_?" "+_:"")+"?>"}function u(v,h){return h.ignoreComment?"":"<!--"+("commentFn"in h?h.commentFn(v,r,n):v)+"-->"}function l(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 f(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 S;if(v.elements&&v.elements.length)for(S=0;S<v.elements.length;++S)switch(v.elements[S][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 w(v,h,S){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,S));var _=v[h.elementsKey]&&v[h.elementsKey].length||v[h.attributesKey]&&v[h.attributesKey]["xml:space"]==="preserve";return _||("fullTagEmptyElementFn"in h?_=h.fullTagEmptyElementFn(v.name,v):_=h.fullTagEmptyElement),_?(T.push(">"),v[h.elementsKey]&&v[h.elementsKey].length&&(T.push(y(v[h.elementsKey],h,S+1)),n=v,r=v.name),T.push(h.spaces&&m(v,h)?`
35
+ `+Array(S+1).join(h.spaces):""),T.push("</"+R+">")):T.push("/>"),T.join("")}function y(v,h,S,T){return v.reduce(function(R,_){var A=i(h,S,T&&!R);switch(_.type){case"element":return R+A+w(_,h,S);case"comment":return R+A+u(_[h.commentKey],h);case"doctype":return R+A+d(_[h.doctypeKey],h);case"cdata":return R+(h.indentCdata?A:"")+l(_[h.cdataKey],h);case"text":return R+(h.indentText?A:"")+f(_[h.textKey],h);case"instruction":var $={};return $[_[h.nameKey]]=_[h.attributesKey]?_:_[h.instructionKey],R+(h.indentInstruction?A:"")+c($,h,S)}},"")}function E(v,h,S){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||S)return!0;break;case h.cdataKey:if(h.indentCdata||S)return!0;break;case h.instructionKey:if(h.indentInstruction||S)return!0;break;case h.doctypeKey:case h.commentKey:return!0;default:return!0}return!1}function b(v,h,S,T,R){n=v,r=h;var _="elementNameFn"in S?S.elementNameFn(h,v):h;if(typeof v>"u"||v===null||v==="")return"fullTagEmptyElementFn"in S&&S.fullTagEmptyElementFn(h,v)||S.fullTagEmptyElement?"<"+_+"></"+_+">":"<"+_+"/>";var A=[];if(h){if(A.push("<"+_),typeof v!="object")return A.push(">"+f(v,S)+"</"+_+">"),A.join("");v[S.attributesKey]&&A.push(s(v[S.attributesKey],S,T));var $=E(v,S,!0)||v[S.attributesKey]&&v[S.attributesKey]["xml:space"]==="preserve";if($||("fullTagEmptyElementFn"in S?$=S.fullTagEmptyElementFn(h,v):$=S.fullTagEmptyElement),$)A.push(">");else return A.push("/>"),A.join("")}return A.push(g(v,S,T+1,!1)),n=v,r=h,h&&A.push((R?i(S,T,!1):"")+"</"+_+">"),A.join("")}function g(v,h,S,T){var R,_,A,$=[];for(_ in v)if(v.hasOwnProperty(_))for(A=t(v[_])?v[_]:[v[_]],R=0;R<A.length;++R){switch(_){case h.declarationKey:$.push(a(A[R],h,S));break;case h.instructionKey:$.push((h.indentInstruction?i(h,S,T):"")+c(A[R],h,S));break;case h.attributesKey:case h.parentKey:break;case h.textKey:$.push((h.indentText?i(h,S,T):"")+f(A[R],h));break;case h.cdataKey:$.push((h.indentCdata?i(h,S,T):"")+l(A[R],h));break;case h.doctypeKey:$.push(i(h,S,T)+d(A[R],h));break;case h.commentKey:$.push(i(h,S,T)+u(A[R],h));break;default:$.push(i(h,S,T)+b(A[R],_,h,S,E(A[R],h)))}T=T&&!$.length}return $.join("")}return $u=function(v,h){h=o(h);var S=[];return n=v,r="_root_",h.compact?S.push(g(v,h,0,!0)):(v[h.declarationKey]&&S.push(a(v[h.declarationKey],h,0)),v[h.elementsKey]&&v[h.elementsKey].length&&S.push(y(v[h.elementsKey],h,0,!S.length))),S.join("")},$u}var Du,Gm;function TR(){if(Gm)return Du;Gm=1;var e=Hm();return Du=function(t,n){t instanceof wr&&(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)},Du}var Lu,Km;function AR(){if(Km)return Lu;Km=1;var e=Vm(),t=ER(),n=Hm(),r=TR();return Lu={xml2js:e,xml2json:t,js2xml:n,json2xml:r},Lu}AR();/*! For license information please see index.js.LICENSE.txt */var RR={2:e=>{function t(o,i,s){o instanceof RegExp&&(o=n(o,s)),i instanceof RegExp&&(i=n(i,s));var a=r(o,i,s);return a&&{start:a[0],end:a[1],pre:s.slice(0,a[0]),body:s.slice(a[0]+o.length,a[1]),post:s.slice(a[1]+i.length)}}function n(o,i){var s=i.match(o);return s?s[0]:null}function r(o,i,s){var a,c,u,l,d,f=s.indexOf(o),m=s.indexOf(i,f+1),w=f;if(f>=0&&m>0){for(a=[],u=s.length;w>=0&&!d;)w==f?(a.push(w),f=s.indexOf(o,w+1)):a.length==1?d=[a.pop(),m]:((c=a.pop())<u&&(u=c,l=m),m=s.indexOf(i,w+1)),w=f<m&&f>=0?f:m;a.length&&(d=[u,l])}return d}e.exports=t,t.range=r},101:function(e,t,n){var r;e=n.nmd(e),function(o){var i=(e&&e.exports,typeof Dr=="object"&&Dr);i.global!==i&&i.window;var s=function(d){this.message=d};(s.prototype=new Error).name="InvalidCharacterError";var a=function(d){throw new s(d)},c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,l={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 f,m,w,y,E=d.length%3,b="",g=-1,v=d.length-E;++g<v;)f=d.charCodeAt(g)<<16,m=d.charCodeAt(++g)<<8,w=d.charCodeAt(++g),b+=c.charAt((y=f+m+w)>>18&63)+c.charAt(y>>12&63)+c.charAt(y>>6&63)+c.charAt(63&y);return E==2?(f=d.charCodeAt(g)<<8,m=d.charCodeAt(++g),b+=c.charAt((y=f+m)>>10)+c.charAt(y>>4&63)+c.charAt(y<<2&63)+"="):E==1&&(y=d.charCodeAt(g),b+=c.charAt(y>>2)+c.charAt(y<<4&63)+"=="),b},decode:function(d){var f=(d=String(d).replace(u,"")).length;f%4==0&&(f=(d=d.replace(/==?$/,"")).length),(f%4==1||/[^+a-zA-Z0-9/]/.test(d))&&a("Invalid character: the string to be decoded is not correctly encoded.");for(var m,w,y=0,E="",b=-1;++b<f;)w=c.indexOf(d.charAt(b)),m=y%4?64*m+w:w,y++%4&&(E+=String.fromCharCode(255&m>>(-2*y&6)));return E},version:"1.0.0"};(r=(function(){return l}).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,o=n.length;o--;){var i=n.charCodeAt(o);56320<=i&&i<=57343&&o--,127<i&&i<=2047?r++:2047<i&&i<=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=[],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},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=[],i=0,s=0;i<r.length;i++,s+=8)o[s>>>5]|=r[i]<<24-s%32;return o},wordsToBytes:function(r){for(var o=[],i=0;i<32*r.length;i+=8)o.push(r[i>>>5]>>>24-i%32&255);return o},bytesToHex:function(r){for(var o=[],i=0;i<r.length;i++)o.push((r[i]>>>4).toString(16)),o.push((15&r[i]).toString(16));return o.join("")},hexToBytes:function(r){for(var o=[],i=0;i<r.length;i+=2)o.push(parseInt(r.substr(i,2),16));return o},bytesToBase64:function(r){for(var o=[],i=0;i<r.length;i+=3)for(var s=r[i]<<16|r[i+1]<<8|r[i+2],a=0;a<4;a++)8*i+6*a<=8*r.length?o.push(t.charAt(s>>>6*(3-a)&63)):o.push("=");return o.join("")},base64ToBytes:function(r){r=r.replace(/[^A-Z0-9+\/]/gi,"");for(var o=[],i=0,s=0;i<r.length;s=++i%4)s!=0&&o.push((t.indexOf(r.charAt(i-1))&Math.pow(2,-2*s+8)-1)<<2*s|t.indexOf(r.charAt(i))>>>6-2*s);return o}},e.exports=n},635:(e,t,n)=>{const r=n(31),o=n(338),i=n(221);e.exports={XMLParser:o,XMLValidator:r,XMLBuilder:i}},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]*",o=new RegExp("^"+r+"$");t.isExist=function(i){return i!==void 0},t.isEmptyObject=function(i){return Object.keys(i).length===0},t.merge=function(i,s,a){if(s){const c=Object.keys(s),u=c.length;for(let l=0;l<u;l++)i[c[l]]=a==="strict"?[s[c[l]]]:s[c[l]]}},t.getValue=function(i){return t.isExist(i)?i:""},t.isName=function(i){return o.exec(i)!=null},t.getAllMatches=function(i,s){const a=[];let c=s.exec(i);for(;c;){const u=[];u.startIndex=s.lastIndex-c[0].length;const l=c.length;for(let d=0;d<l;d++)u.push(c[d]);a.push(u),c=s.exec(i)}return a},t.nameRegexp=r},31:(e,t,n)=>{const r=n(705),o={allowBooleanAttributes:!1,unpairedTags:[]};function i(g){return g===" "||g===" "||g===`
36
+ `||g==="\r"}function s(g,v){const h=v;for(;v<g.length;v++)if(!(g[v]!="?"&&g[v]!=" ")){const S=g.substr(h,v-h);if(v>5&&S==="xml")return w("InvalidXml","XML declaration allowed only at the start of the document.",E(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({},o,v);const h=[];let S=!1,T=!1;g[0]==="\uFEFF"&&(g=g.substr(1));for(let _=0;_<g.length;_++)if(g[_]==="<"&&g[_+1]==="?"){if(_+=2,_=s(g,_),_.err)return _}else{if(g[_]!=="<"){if(i(g[_]))continue;return w("InvalidChar","char '"+g[_]+"' is not expected.",E(g,_))}{let A=_;if(_++,g[_]==="!"){_=a(g,_);continue}{let $=!1;g[_]==="/"&&($=!0,_++);let D="";for(;_<g.length&&g[_]!==">"&&g[_]!==" "&&g[_]!==" "&&g[_]!==`
37
+ `&&g[_]!=="\r";_++)D+=g[_];if(D=D.trim(),D[D.length-1]==="/"&&(D=D.substring(0,D.length-1),_--),R=D,!r.isName(R)){let W;return W=D.trim().length===0?"Invalid space after '<'.":"Tag '"+D+"' is an invalid name.",w("InvalidTag",W,E(g,_))}const N=l(g,_);if(N===!1)return w("InvalidAttr","Attributes for '"+D+"' have open quote.",E(g,_));let x=N.value;if(_=N.index,x[x.length-1]==="/"){const W=_-x.length;x=x.substring(0,x.length-1);const K=f(x,v);if(K!==!0)return w(K.err.code,K.err.msg,E(g,W+K.err.line));S=!0}else if($){if(!N.tagClosed)return w("InvalidTag","Closing tag '"+D+"' doesn't have proper closing.",E(g,_));if(x.trim().length>0)return w("InvalidTag","Closing tag '"+D+"' can't have attributes or invalid starting.",E(g,A));if(h.length===0)return w("InvalidTag","Closing tag '"+D+"' has not been opened.",E(g,A));{const W=h.pop();if(D!==W.tagName){let K=E(g,W.tagStartPos);return w("InvalidTag","Expected closing tag '"+W.tagName+"' (opened in line "+K.line+", col "+K.col+") instead of closing tag '"+D+"'.",E(g,A))}h.length==0&&(T=!0)}}else{const W=f(x,v);if(W!==!0)return w(W.err.code,W.err.msg,E(g,_-x.length+W.err.line));if(T===!0)return w("InvalidXml","Multiple possible root nodes found.",E(g,_));v.unpairedTags.indexOf(D)!==-1||h.push({tagName:D,tagStartPos:A}),S=!0}for(_++;_<g.length;_++)if(g[_]==="<"){if(g[_+1]==="!"){_++,_=a(g,_);continue}if(g[_+1]!=="?")break;if(_=s(g,++_),_.err)return _}else if(g[_]==="&"){const W=m(g,_);if(W==-1)return w("InvalidChar","char '&' is not expected.",E(g,_));_=W}else if(T===!0&&!i(g[_]))return w("InvalidXml","Extra text at the end",E(g,_));g[_]==="<"&&_--}}}var R;return S?h.length==1?w("InvalidTag","Unclosed tag '"+h[0].tagName+"'.",E(g,h[0].tagStartPos)):!(h.length>0)||w("InvalidXml","Invalid '"+JSON.stringify(h.map(_=>_.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):w("InvalidXml","Start tag expected.",1)};const c='"',u="'";function l(g,v){let h="",S="",T=!1;for(;v<g.length;v++){if(g[v]===c||g[v]===u)S===""?S=g[v]:S!==g[v]||(S="");else if(g[v]===">"&&S===""){T=!0;break}h+=g[v]}return S===""&&{value:h,index:v,tagClosed:T}}const d=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function f(g,v){const h=r.getAllMatches(g,d),S={};for(let T=0;T<h.length;T++){if(h[T][1].length===0)return w("InvalidAttr","Attribute '"+h[T][2]+"' has no space in starting.",b(h[T]));if(h[T][3]!==void 0&&h[T][4]===void 0)return w("InvalidAttr","Attribute '"+h[T][2]+"' is without value.",b(h[T]));if(h[T][3]===void 0&&!v.allowBooleanAttributes)return w("InvalidAttr","boolean attribute '"+h[T][2]+"' is not allowed.",b(h[T]));const R=h[T][2];if(!y(R))return w("InvalidAttr","Attribute '"+R+"' is an invalid name.",b(h[T]));if(S.hasOwnProperty(R))return w("InvalidAttr","Attribute '"+R+"' is repeated.",b(h[T]));S[R]=1}return!0}function m(g,v){if(g[++v]===";")return-1;if(g[v]==="#")return function(S,T){let R=/\d/;for(S[T]==="x"&&(T++,R=/[\da-fA-F]/);T<S.length;T++){if(S[T]===";")return T;if(!S[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 w(g,v,h){return{err:{code:g,msg:v,line:h.line||h,col:h.col}}}function y(g){return r.isName(g)}function E(g,v){const h=g.substring(0,v).split(/\r?\n/);return{line:h.length,col:h[h.length-1].length+1}}function b(g){return g.startIndex+g[1].length}},221:(e,t,n)=>{const r=n(87),o=n(118),i={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(l,d){return d},attributeValueProcessor:function(l,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(l){this.options=Object.assign({},i,l),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=o(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=u),this.processTextOrObjNode=a,this.options.format?(this.indentate=c,this.tagEndChar=`>
38
38
  `,this.newLine=`
39
- `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function a(l,f,d,m){const w=this.j2x(l,d+1,m.concat(f));return l[this.options.textNodeName]!==void 0&&Object.keys(l).length===1?this.buildTextValNode(l[this.options.textNodeName],f,w.attrStr,d):this.buildObjectNode(w.val,f,w.attrStr,d)}function c(l){return this.options.indentBy.repeat(l)}function u(l){return!(!l.startsWith(this.options.attributeNamePrefix)||l===this.options.textNodeName)&&l.substr(this.attrPrefixLen)}s.prototype.build=function(l){return this.options.preserveOrder?r(l,this.options):(Array.isArray(l)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(l={[this.options.arrayNodeName]:l}),this.j2x(l,0,[]).val)},s.prototype.j2x=function(l,f,d){let m="",w="";const v=d.join(".");for(let T in l)if(Object.prototype.hasOwnProperty.call(l,T))if(l[T]===void 0)this.isAttribute(T)&&(w+="");else if(l[T]===null)this.isAttribute(T)?w+="":T[0]==="?"?w+=this.indentate(f)+"<"+T+"?"+this.tagEndChar:w+=this.indentate(f)+"<"+T+"/"+this.tagEndChar;else if(l[T]instanceof Date)w+=this.buildTextValNode(l[T],T,"",f);else if(typeof l[T]!="object"){const y=this.isAttribute(T);if(y&&!this.ignoreAttributesFn(y,v))m+=this.buildAttrPairStr(y,""+l[T]);else if(!y)if(T===this.options.textNodeName){let g=this.options.tagValueProcessor(T,""+l[T]);w+=this.replaceEntitiesValue(g)}else w+=this.buildTextValNode(l[T],T,"",f)}else if(Array.isArray(l[T])){const y=l[T].length;let g="",h="";for(let b=0;b<y;b++){const S=l[T][b];if(S!==void 0)if(S===null)T[0]==="?"?w+=this.indentate(f)+"<"+T+"?"+this.tagEndChar:w+=this.indentate(f)+"<"+T+"/"+this.tagEndChar;else if(typeof S=="object")if(this.options.oneListGroup){const E=this.j2x(S,f+1,d.concat(T));g+=E.val,this.options.attributesGroupName&&S.hasOwnProperty(this.options.attributesGroupName)&&(h+=E.attrStr)}else g+=this.processTextOrObjNode(S,T,f,d);else if(this.options.oneListGroup){let E=this.options.tagValueProcessor(T,S);E=this.replaceEntitiesValue(E),g+=E}else g+=this.buildTextValNode(S,T,"",f)}this.options.oneListGroup&&(g=this.buildObjectNode(g,T,h,f)),w+=g}else if(this.options.attributesGroupName&&T===this.options.attributesGroupName){const y=Object.keys(l[T]),g=y.length;for(let h=0;h<g;h++)m+=this.buildAttrPairStr(y[h],""+l[T][y[h]])}else w+=this.processTextOrObjNode(l[T],T,f,d);return{attrStr:m,val:w}},s.prototype.buildAttrPairStr=function(l,f){return f=this.options.attributeValueProcessor(l,""+f),f=this.replaceEntitiesValue(f),this.options.suppressBooleanAttributes&&f==="true"?" "+l:" "+l+'="'+f+'"'},s.prototype.buildObjectNode=function(l,f,d,m){if(l==="")return f[0]==="?"?this.indentate(m)+"<"+f+d+"?"+this.tagEndChar:this.indentate(m)+"<"+f+d+this.closeTag(f)+this.tagEndChar;{let w="</"+f+this.tagEndChar,v="";return f[0]==="?"&&(v="?",w=""),!d&&d!==""||l.indexOf("<")!==-1?this.options.commentPropName!==!1&&f===this.options.commentPropName&&v.length===0?this.indentate(m)+`<!--${l}-->`+this.newLine:this.indentate(m)+"<"+f+d+v+this.tagEndChar+l+this.indentate(m)+w:this.indentate(m)+"<"+f+d+v+">"+l+w}},s.prototype.closeTag=function(l){let f="";return this.options.unpairedTags.indexOf(l)!==-1?this.options.suppressUnpairedNode||(f="/"):f=this.options.suppressEmptyNode?"/":`></${l}`,f},s.prototype.buildTextValNode=function(l,f,d,m){if(this.options.cdataPropName!==!1&&f===this.options.cdataPropName)return this.indentate(m)+`<![CDATA[${l}]]>`+this.newLine;if(this.options.commentPropName!==!1&&f===this.options.commentPropName)return this.indentate(m)+`<!--${l}-->`+this.newLine;if(f[0]==="?")return this.indentate(m)+"<"+f+d+"?"+this.tagEndChar;{let w=this.options.tagValueProcessor(f,l);return w=this.replaceEntitiesValue(w),w===""?this.indentate(m)+"<"+f+d+this.closeTag(f)+this.tagEndChar:this.indentate(m)+"<"+f+d+">"+w+"</"+f+this.tagEndChar}},s.prototype.replaceEntitiesValue=function(l){if(l&&l.length>0&&this.options.processEntities)for(let f=0;f<this.options.entities.length;f++){const d=this.options.entities[f];l=l.replace(d.regex,d.val)}return l},e.exports=s},87:e=>{function t(s,a,c,u){let l="",f=!1;for(let d=0;d<s.length;d++){const m=s[d],w=n(m);if(w===void 0)continue;let v="";if(v=c.length===0?w:`${c}.${w}`,w===a.textNodeName){let h=m[w];o(v,a)||(h=a.tagValueProcessor(w,h),h=i(h,a)),f&&(l+=u),l+=h,f=!1;continue}if(w===a.cdataPropName){f&&(l+=u),l+=`<![CDATA[${m[w][0][a.textNodeName]}]]>`,f=!1;continue}if(w===a.commentPropName){l+=u+`<!--${m[w][0][a.textNodeName]}-->`,f=!0;continue}if(w[0]==="?"){const h=r(m[":@"],a),b=w==="?xml"?"":u;let S=m[w][0][a.textNodeName];S=S.length!==0?" "+S:"",l+=b+`<${w}${S}${h}?>`,f=!0;continue}let T=u;T!==""&&(T+=a.indentBy);const y=u+`<${w}${r(m[":@"],a)}`,g=t(m[w],a,v,T);a.unpairedTags.indexOf(w)!==-1?a.suppressUnpairedNode?l+=y+">":l+=y+"/>":g&&g.length!==0||!a.suppressEmptyNode?g&&g.endsWith(">")?l+=y+`>${g}${u}</${w}>`:(l+=y+">",g&&u!==""&&(g.includes("/>")||g.includes("</"))?l+=u+a.indentBy+g+u:l+=g,l+=`</${w}>`):l+=y+"/>",f=!0}return l}function n(s){const a=Object.keys(s);for(let c=0;c<a.length;c++){const u=a[c];if(s.hasOwnProperty(u)&&u!==":@")return u}}function r(s,a){let c="";if(s&&!a.ignoreAttributes)for(let u in s){if(!s.hasOwnProperty(u))continue;let l=a.attributeValueProcessor(u,s[u]);l=i(l,a),l===!0&&a.suppressBooleanAttributes?c+=` ${u.substr(a.attributeNamePrefix.length)}`:c+=` ${u.substr(a.attributeNamePrefix.length)}="${l}"`}return c}function o(s,a){let c=(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]==="*."+c)return!0;return!1}function i(s,a){if(s&&s.length>0&&a.processEntities)for(let c=0;c<a.entities.length;c++){const u=a.entities[c];s=s.replace(u.regex,u.val)}return s}e.exports=function(s,a){let c="";return a.format&&a.indentBy.length>0&&(c=`
40
- `),t(s,a,"",c)}},193:(e,t,n)=>{const r=n(705);function o(f,d){let m="";for(;d<f.length&&f[d]!=="'"&&f[d]!=='"';d++)m+=f[d];if(m=m.trim(),m.indexOf(" ")!==-1)throw new Error("External entites are not supported");const w=f[d++];let v="";for(;d<f.length&&f[d]!==w;d++)v+=f[d];return[m,v,d]}function i(f,d){return f[d+1]==="!"&&f[d+2]==="-"&&f[d+3]==="-"}function s(f,d){return f[d+1]==="!"&&f[d+2]==="E"&&f[d+3]==="N"&&f[d+4]==="T"&&f[d+5]==="I"&&f[d+6]==="T"&&f[d+7]==="Y"}function a(f,d){return f[d+1]==="!"&&f[d+2]==="E"&&f[d+3]==="L"&&f[d+4]==="E"&&f[d+5]==="M"&&f[d+6]==="E"&&f[d+7]==="N"&&f[d+8]==="T"}function c(f,d){return f[d+1]==="!"&&f[d+2]==="A"&&f[d+3]==="T"&&f[d+4]==="T"&&f[d+5]==="L"&&f[d+6]==="I"&&f[d+7]==="S"&&f[d+8]==="T"}function u(f,d){return f[d+1]==="!"&&f[d+2]==="N"&&f[d+3]==="O"&&f[d+4]==="T"&&f[d+5]==="A"&&f[d+6]==="T"&&f[d+7]==="I"&&f[d+8]==="O"&&f[d+9]==="N"}function l(f){if(r.isName(f))return f;throw new Error(`Invalid entity name ${f}`)}e.exports=function(f,d){const m={};if(f[d+3]!=="O"||f[d+4]!=="C"||f[d+5]!=="T"||f[d+6]!=="Y"||f[d+7]!=="P"||f[d+8]!=="E")throw new Error("Invalid Tag instead of DOCTYPE");{d+=9;let w=1,v=!1,T=!1,y="";for(;d<f.length;d++)if(f[d]!=="<"||T)if(f[d]===">"){if(T?f[d-1]==="-"&&f[d-2]==="-"&&(T=!1,w--):w--,w===0)break}else f[d]==="["?v=!0:y+=f[d];else{if(v&&s(f,d)){let g,h;d+=7,[g,h,d]=o(f,d+1),h.indexOf("&")===-1&&(m[l(g)]={regx:RegExp(`&${g};`,"g"),val:h})}else if(v&&a(f,d))d+=8;else if(v&&c(f,d))d+=8;else if(v&&u(f,d))d+=9;else{if(!i)throw new Error("Invalid DOCTYPE");T=!0}w++,y=""}if(w!==0)throw new Error("Unclosed DOCTYPE")}return{entities:m,i:d}}},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,o){return o},attributeValueProcessor:function(r,o){return o},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(r,o,i){return r}};t.buildOptions=function(r){return Object.assign({},n,r)},t.defaultOptions=n},299:(e,t,n)=>{const r=n(705),o=n(365),i=n(193),s=n(494),a=n(118);function c(E){const I=Object.keys(E);for(let R=0;R<I.length;R++){const A=I[R];this.lastEntities[A]={regex:new RegExp("&"+A+";","g"),val:E[A]}}}function u(E,I,R,A,N,L,x){if(E!==void 0&&(this.options.trimValues&&!A&&(E=E.trim()),E.length>0)){x||(E=this.replaceEntitiesValue(E));const $=this.options.tagValueProcessor(I,E,R,N,L);return $==null?E:typeof $!=typeof E||$!==E?$:this.options.trimValues||E.trim()===E?S(E,this.options.parseTagValue,this.options.numberParseOptions):E}}function l(E){if(this.options.removeNSPrefix){const I=E.split(":"),R=E.charAt(0)==="/"?"/":"";if(I[0]==="xmlns")return"";I.length===2&&(E=R+I[1])}return E}const f=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function d(E,I,R){if(this.options.ignoreAttributes!==!0&&typeof E=="string"){const A=r.getAllMatches(E,f),N=A.length,L={};for(let x=0;x<N;x++){const $=this.resolveNameSpace(A[x][1]);if(this.ignoreAttributesFn($,I))continue;let V=A[x][4],X=this.options.attributeNamePrefix+$;if($.length)if(this.options.transformAttributeName&&(X=this.options.transformAttributeName(X)),X==="__proto__"&&(X="#__proto__"),V!==void 0){this.options.trimValues&&(V=V.trim()),V=this.replaceEntitiesValue(V);const ee=this.options.attributeValueProcessor($,V,I);L[X]=ee==null?V:typeof ee!=typeof V||ee!==V?ee:S(V,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(L[X]=!0)}if(!Object.keys(L).length)return;if(this.options.attributesGroupName){const x={};return x[this.options.attributesGroupName]=L,x}return L}}const m=function(E){E=E.replace(/\r\n?/g,`
41
- `);const I=new o("!xml");let R=I,A="",N="";for(let L=0;L<E.length;L++)if(E[L]==="<")if(E[L+1]==="/"){const x=g(E,">",L,"Closing Tag is not closed.");let $=E.substring(L+2,x).trim();if(this.options.removeNSPrefix){const ee=$.indexOf(":");ee!==-1&&($=$.substr(ee+1))}this.options.transformTagName&&($=this.options.transformTagName($)),R&&(A=this.saveTextToParentTag(A,R,N));const V=N.substring(N.lastIndexOf(".")+1);if($&&this.options.unpairedTags.indexOf($)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${$}>`);let X=0;V&&this.options.unpairedTags.indexOf(V)!==-1?(X=N.lastIndexOf(".",N.lastIndexOf(".")-1),this.tagsNodeStack.pop()):X=N.lastIndexOf("."),N=N.substring(0,X),R=this.tagsNodeStack.pop(),A="",L=x}else if(E[L+1]==="?"){let x=h(E,L,!1,"?>");if(!x)throw new Error("Pi Tag is not closed.");if(A=this.saveTextToParentTag(A,R,N),!(this.options.ignoreDeclaration&&x.tagName==="?xml"||this.options.ignorePiTags)){const $=new o(x.tagName);$.add(this.options.textNodeName,""),x.tagName!==x.tagExp&&x.attrExpPresent&&($[":@"]=this.buildAttributesMap(x.tagExp,N,x.tagName)),this.addChild(R,$,N)}L=x.closeIndex+1}else if(E.substr(L+1,3)==="!--"){const x=g(E,"-->",L+4,"Comment is not closed.");if(this.options.commentPropName){const $=E.substring(L+4,x-2);A=this.saveTextToParentTag(A,R,N),R.add(this.options.commentPropName,[{[this.options.textNodeName]:$}])}L=x}else if(E.substr(L+1,2)==="!D"){const x=i(E,L);this.docTypeEntities=x.entities,L=x.i}else if(E.substr(L+1,2)==="!["){const x=g(E,"]]>",L,"CDATA is not closed.")-2,$=E.substring(L+9,x);A=this.saveTextToParentTag(A,R,N);let V=this.parseTextData($,R.tagname,N,!0,!1,!0,!0);V==null&&(V=""),this.options.cdataPropName?R.add(this.options.cdataPropName,[{[this.options.textNodeName]:$}]):R.add(this.options.textNodeName,V),L=x+2}else{let x=h(E,L,this.options.removeNSPrefix),$=x.tagName;const V=x.rawTagName;let X=x.tagExp,ee=x.attrExpPresent,se=x.closeIndex;this.options.transformTagName&&($=this.options.transformTagName($)),R&&A&&R.tagname!=="!xml"&&(A=this.saveTextToParentTag(A,R,N,!1));const ie=R;if(ie&&this.options.unpairedTags.indexOf(ie.tagname)!==-1&&(R=this.tagsNodeStack.pop(),N=N.substring(0,N.lastIndexOf("."))),$!==I.tagname&&(N+=N?"."+$:$),this.isItStopNode(this.options.stopNodes,N,$)){let re="";if(X.length>0&&X.lastIndexOf("/")===X.length-1)$[$.length-1]==="/"?($=$.substr(0,$.length-1),N=N.substr(0,N.length-1),X=$):X=X.substr(0,X.length-1),L=x.closeIndex;else if(this.options.unpairedTags.indexOf($)!==-1)L=x.closeIndex;else{const ue=this.readStopNodeData(E,V,se+1);if(!ue)throw new Error(`Unexpected end of ${V}`);L=ue.i,re=ue.tagContent}const fe=new o($);$!==X&&ee&&(fe[":@"]=this.buildAttributesMap(X,N,$)),re&&(re=this.parseTextData(re,$,N,!0,ee,!0,!0)),N=N.substr(0,N.lastIndexOf(".")),fe.add(this.options.textNodeName,re),this.addChild(R,fe,N)}else{if(X.length>0&&X.lastIndexOf("/")===X.length-1){$[$.length-1]==="/"?($=$.substr(0,$.length-1),N=N.substr(0,N.length-1),X=$):X=X.substr(0,X.length-1),this.options.transformTagName&&($=this.options.transformTagName($));const re=new o($);$!==X&&ee&&(re[":@"]=this.buildAttributesMap(X,N,$)),this.addChild(R,re,N),N=N.substr(0,N.lastIndexOf("."))}else{const re=new o($);this.tagsNodeStack.push(R),$!==X&&ee&&(re[":@"]=this.buildAttributesMap(X,N,$)),this.addChild(R,re,N),R=re}A="",L=se}}else A+=E[L];return I.child};function w(E,I,R){const A=this.options.updateTag(I.tagname,R,I[":@"]);A===!1||(typeof A=="string"&&(I.tagname=A),E.addChild(I))}const v=function(E){if(this.options.processEntities){for(let I in this.docTypeEntities){const R=this.docTypeEntities[I];E=E.replace(R.regx,R.val)}for(let I in this.lastEntities){const R=this.lastEntities[I];E=E.replace(R.regex,R.val)}if(this.options.htmlEntities)for(let I in this.htmlEntities){const R=this.htmlEntities[I];E=E.replace(R.regex,R.val)}E=E.replace(this.ampEntity.regex,this.ampEntity.val)}return E};function T(E,I,R,A){return E&&(A===void 0&&(A=Object.keys(I.child).length===0),(E=this.parseTextData(E,I.tagname,R,!1,!!I[":@"]&&Object.keys(I[":@"]).length!==0,A))!==void 0&&E!==""&&I.add(this.options.textNodeName,E),E=""),E}function y(E,I,R){const A="*."+R;for(const N in E){const L=E[N];if(A===L||I===L)return!0}return!1}function g(E,I,R,A){const N=E.indexOf(I,R);if(N===-1)throw new Error(A);return N+I.length-1}function h(E,I,R){const A=function(ee,se){let ie,re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",fe="";for(let ue=se;ue<ee.length;ue++){let Z=ee[ue];if(ie)Z===ie&&(ie="");else if(Z==='"'||Z==="'")ie=Z;else if(Z===re[0]){if(!re[1])return{data:fe,index:ue};if(ee[ue+1]===re[1])return{data:fe,index:ue}}else Z===" "&&(Z=" ");fe+=Z}}(E,I+1,arguments.length>3&&arguments[3]!==void 0?arguments[3]:">");if(!A)return;let N=A.data;const L=A.index,x=N.search(/\s/);let $=N,V=!0;x!==-1&&($=N.substring(0,x),N=N.substring(x+1).trimStart());const X=$;if(R){const ee=$.indexOf(":");ee!==-1&&($=$.substr(ee+1),V=$!==A.data.substr(ee+1))}return{tagName:$,tagExp:N,closeIndex:L,attrExpPresent:V,rawTagName:X}}function b(E,I,R){const A=R;let N=1;for(;R<E.length;R++)if(E[R]==="<")if(E[R+1]==="/"){const L=g(E,">",R,`${I} is not closed`);if(E.substring(R+2,L).trim()===I&&(N--,N===0))return{tagContent:E.substring(A,R),i:L};R=L}else if(E[R+1]==="?")R=g(E,"?>",R+1,"StopNode is not closed.");else if(E.substr(R+1,3)==="!--")R=g(E,"-->",R+3,"StopNode is not closed.");else if(E.substr(R+1,2)==="![")R=g(E,"]]>",R,"StopNode is not closed.")-2;else{const L=h(E,R,">");L&&((L&&L.tagName)===I&&L.tagExp[L.tagExp.length-1]!=="/"&&N++,R=L.closeIndex)}}function S(E,I,R){if(I&&typeof E=="string"){const A=E.trim();return A==="true"||A!=="false"&&s(E,R)}return r.isExist(E)?E:""}e.exports=class{constructor(E){this.options=E,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:(I,R)=>String.fromCharCode(Number.parseInt(R,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(I,R)=>String.fromCharCode(Number.parseInt(R,16))}},this.addExternalEntities=c,this.parseXml=m,this.parseTextData=u,this.resolveNameSpace=l,this.buildAttributesMap=d,this.isItStopNode=y,this.replaceEntitiesValue=v,this.readStopNodeData=b,this.saveTextToParentTag=T,this.addChild=w,this.ignoreAttributesFn=a(this.options.ignoreAttributes)}}},338:(e,t,n)=>{const{buildOptions:r}=n(63),o=n(299),{prettify:i}=n(728),s=n(31);e.exports=class{constructor(a){this.externalEntities={},this.options=r(a)}parse(a,c){if(typeof a!="string"){if(!a.toString)throw new Error("XML data is accepted in String or Bytes[] form.");a=a.toString()}if(c){c===!0&&(c={});const f=s.validate(a,c);if(f!==!0)throw Error(`${f.err.msg}:${f.err.line}:${f.err.col}`)}const u=new o(this.options);u.addExternalEntities(this.externalEntities);const l=u.parseXml(a);return this.options.preserveOrder||l===void 0?l:i(l,this.options)}addEntity(a,c){if(c.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(c==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[a]=c}}},728:(e,t)=>{function n(s,a,c){let u;const l={};for(let f=0;f<s.length;f++){const d=s[f],m=r(d);let w="";if(w=c===void 0?m:c+"."+m,m===a.textNodeName)u===void 0?u=d[m]:u+=""+d[m];else{if(m===void 0)continue;if(d[m]){let v=n(d[m],a,w);const T=i(v,a);d[":@"]?o(v,d[":@"],w,a):Object.keys(v).length!==1||v[a.textNodeName]===void 0||a.alwaysCreateTextNode?Object.keys(v).length===0&&(a.alwaysCreateTextNode?v[a.textNodeName]="":v=""):v=v[a.textNodeName],l[m]!==void 0&&l.hasOwnProperty(m)?(Array.isArray(l[m])||(l[m]=[l[m]]),l[m].push(v)):a.isArray(m,w,T)?l[m]=[v]:l[m]=v}}}return typeof u=="string"?u.length>0&&(l[a.textNodeName]=u):u!==void 0&&(l[a.textNodeName]=u),l}function r(s){const a=Object.keys(s);for(let c=0;c<a.length;c++){const u=a[c];if(u!==":@")return u}}function o(s,a,c,u){if(a){const l=Object.keys(a),f=l.length;for(let d=0;d<f;d++){const m=l[d];u.isArray(m,c+"."+m,!0,!0)?s[m]=[a[m]]:s[m]=a[m]}}}function i(s,a){const{textNodeName:c}=a,u=Object.keys(s).length;return u===0||!(u!==1||!s[c]&&typeof s[c]!="boolean"&&s[c]!==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),o=n(526).utf8,i=n(135),s=n(526).bin,a=function(c,u){c.constructor==String?c=u&&u.encoding==="binary"?s.stringToBytes(c):o.stringToBytes(c):i(c)?c=Array.prototype.slice.call(c,0):Array.isArray(c)||c.constructor===Uint8Array||(c=c.toString());for(var l=r.bytesToWords(c),f=8*c.length,d=1732584193,m=-271733879,w=-1732584194,v=271733878,T=0;T<l.length;T++)l[T]=16711935&(l[T]<<8|l[T]>>>24)|4278255360&(l[T]<<24|l[T]>>>8);l[f>>>5]|=128<<f%32,l[14+(f+64>>>9<<4)]=f;var y=a._ff,g=a._gg,h=a._hh,b=a._ii;for(T=0;T<l.length;T+=16){var S=d,E=m,I=w,R=v;d=y(d,m,w,v,l[T+0],7,-680876936),v=y(v,d,m,w,l[T+1],12,-389564586),w=y(w,v,d,m,l[T+2],17,606105819),m=y(m,w,v,d,l[T+3],22,-1044525330),d=y(d,m,w,v,l[T+4],7,-176418897),v=y(v,d,m,w,l[T+5],12,1200080426),w=y(w,v,d,m,l[T+6],17,-1473231341),m=y(m,w,v,d,l[T+7],22,-45705983),d=y(d,m,w,v,l[T+8],7,1770035416),v=y(v,d,m,w,l[T+9],12,-1958414417),w=y(w,v,d,m,l[T+10],17,-42063),m=y(m,w,v,d,l[T+11],22,-1990404162),d=y(d,m,w,v,l[T+12],7,1804603682),v=y(v,d,m,w,l[T+13],12,-40341101),w=y(w,v,d,m,l[T+14],17,-1502002290),d=g(d,m=y(m,w,v,d,l[T+15],22,1236535329),w,v,l[T+1],5,-165796510),v=g(v,d,m,w,l[T+6],9,-1069501632),w=g(w,v,d,m,l[T+11],14,643717713),m=g(m,w,v,d,l[T+0],20,-373897302),d=g(d,m,w,v,l[T+5],5,-701558691),v=g(v,d,m,w,l[T+10],9,38016083),w=g(w,v,d,m,l[T+15],14,-660478335),m=g(m,w,v,d,l[T+4],20,-405537848),d=g(d,m,w,v,l[T+9],5,568446438),v=g(v,d,m,w,l[T+14],9,-1019803690),w=g(w,v,d,m,l[T+3],14,-187363961),m=g(m,w,v,d,l[T+8],20,1163531501),d=g(d,m,w,v,l[T+13],5,-1444681467),v=g(v,d,m,w,l[T+2],9,-51403784),w=g(w,v,d,m,l[T+7],14,1735328473),d=h(d,m=g(m,w,v,d,l[T+12],20,-1926607734),w,v,l[T+5],4,-378558),v=h(v,d,m,w,l[T+8],11,-2022574463),w=h(w,v,d,m,l[T+11],16,1839030562),m=h(m,w,v,d,l[T+14],23,-35309556),d=h(d,m,w,v,l[T+1],4,-1530992060),v=h(v,d,m,w,l[T+4],11,1272893353),w=h(w,v,d,m,l[T+7],16,-155497632),m=h(m,w,v,d,l[T+10],23,-1094730640),d=h(d,m,w,v,l[T+13],4,681279174),v=h(v,d,m,w,l[T+0],11,-358537222),w=h(w,v,d,m,l[T+3],16,-722521979),m=h(m,w,v,d,l[T+6],23,76029189),d=h(d,m,w,v,l[T+9],4,-640364487),v=h(v,d,m,w,l[T+12],11,-421815835),w=h(w,v,d,m,l[T+15],16,530742520),d=b(d,m=h(m,w,v,d,l[T+2],23,-995338651),w,v,l[T+0],6,-198630844),v=b(v,d,m,w,l[T+7],10,1126891415),w=b(w,v,d,m,l[T+14],15,-1416354905),m=b(m,w,v,d,l[T+5],21,-57434055),d=b(d,m,w,v,l[T+12],6,1700485571),v=b(v,d,m,w,l[T+3],10,-1894986606),w=b(w,v,d,m,l[T+10],15,-1051523),m=b(m,w,v,d,l[T+1],21,-2054922799),d=b(d,m,w,v,l[T+8],6,1873313359),v=b(v,d,m,w,l[T+15],10,-30611744),w=b(w,v,d,m,l[T+6],15,-1560198380),m=b(m,w,v,d,l[T+13],21,1309151649),d=b(d,m,w,v,l[T+4],6,-145523070),v=b(v,d,m,w,l[T+11],10,-1120210379),w=b(w,v,d,m,l[T+2],15,718787259),m=b(m,w,v,d,l[T+9],21,-343485551),d=d+S>>>0,m=m+E>>>0,w=w+I>>>0,v=v+R>>>0}return r.endian([d,m,w,v])};a._ff=function(c,u,l,f,d,m,w){var v=c+(u&l|~u&f)+(d>>>0)+w;return(v<<m|v>>>32-m)+u},a._gg=function(c,u,l,f,d,m,w){var v=c+(u&f|l&~f)+(d>>>0)+w;return(v<<m|v>>>32-m)+u},a._hh=function(c,u,l,f,d,m,w){var v=c+(u^l^f)+(d>>>0)+w;return(v<<m|v>>>32-m)+u},a._ii=function(c,u,l,f,d,m,w){var v=c+(l^(u|~f))+(d>>>0)+w;return(v<<m|v>>>32-m)+u},a._blocksize=16,a._digestsize=16,e.exports=function(c,u){if(c==null)throw new Error("Illegal argument "+c);var l=r.wordsToBytes(a(c,u));return u&&u.asBytes?l:u&&u.asString?s.bytesToString(l):r.bytesToHex(l)}})()},285:(e,t,n)=>{var r=n(2);e.exports=function(y){return y?(y.substr(0,2)==="{}"&&(y="\\{\\}"+y.substr(2)),T(function(g){return g.split("\\\\").join(o).split("\\{").join(i).split("\\}").join(s).split("\\,").join(a).split("\\.").join(c)}(y),!0).map(l)):[]};var o="\0SLASH"+Math.random()+"\0",i="\0OPEN"+Math.random()+"\0",s="\0CLOSE"+Math.random()+"\0",a="\0COMMA"+Math.random()+"\0",c="\0PERIOD"+Math.random()+"\0";function u(y){return parseInt(y,10)==y?parseInt(y,10):y.charCodeAt(0)}function l(y){return y.split(o).join("\\").split(i).join("{").split(s).join("}").split(a).join(",").split(c).join(".")}function f(y){if(!y)return[""];var g=[],h=r("{","}",y);if(!h)return y.split(",");var b=h.pre,S=h.body,E=h.post,I=b.split(",");I[I.length-1]+="{"+S+"}";var R=f(E);return E.length&&(I[I.length-1]+=R.shift(),I.push.apply(I,R)),g.push.apply(g,I),g}function d(y){return"{"+y+"}"}function m(y){return/^-?0\d/.test(y)}function w(y,g){return y<=g}function v(y,g){return y>=g}function T(y,g){var h=[],b=r("{","}",y);if(!b)return[y];var S=b.pre,E=b.post.length?T(b.post,!1):[""];if(/\$$/.test(b.pre))for(var I=0;I<E.length;I++){var R=S+"{"+b.body+"}"+E[I];h.push(R)}else{var A,N,L=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(b.body),x=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(b.body),$=L||x,V=b.body.indexOf(",")>=0;if(!$&&!V)return b.post.match(/,.*\}/)?T(y=b.pre+"{"+b.body+s+b.post):[y];if($)A=b.body.split(/\.\./);else if((A=f(b.body)).length===1&&(A=T(A[0],!1).map(d)).length===1)return E.map(function(H){return b.pre+A[0]+H});if($){var X=u(A[0]),ee=u(A[1]),se=Math.max(A[0].length,A[1].length),ie=A.length==3?Math.abs(u(A[2])):1,re=w;ee<X&&(ie*=-1,re=v);var fe=A.some(m);N=[];for(var ue=X;re(ue,ee);ue+=ie){var Z;if(x)(Z=String.fromCharCode(ue))==="\\"&&(Z="");else if(Z=String(ue),fe){var oe=se-Z.length;if(oe>0){var ce=new Array(oe+1).join("0");Z=ue<0?"-"+ce+Z.slice(1):ce+Z}}N.push(Z)}}else{N=[];for(var Ce=0;Ce<A.length;Ce++)N.push.apply(N,T(A[Ce],!1))}for(Ce=0;Ce<N.length;Ce++)for(I=0;I<E.length;I++)R=S+N[Ce]+E[I],(!g||$||R)&&h.push(R)}return h}},829:e=>{function t(u){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},t(u)}function n(u){var l=typeof Map=="function"?new Map:void 0;return n=function(f){if(f===null||(d=f,Function.toString.call(d).indexOf("[native code]")===-1))return f;var d;if(typeof f!="function")throw new TypeError("Super expression must either be null or a function");if(l!==void 0){if(l.has(f))return l.get(f);l.set(f,m)}function m(){return r(f,arguments,i(this).constructor)}return m.prototype=Object.create(f.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),o(m,f)},n(u)}function r(u,l,f){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(d,m,w){var v=[null];v.push.apply(v,m);var T=new(Function.bind.apply(d,v));return w&&o(T,w.prototype),T},r.apply(null,arguments)}function o(u,l){return o=Object.setPrototypeOf||function(f,d){return f.__proto__=d,f},o(u,l)}function i(u){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(l){return l.__proto__||Object.getPrototypeOf(l)},i(u)}var s=function(u){function l(f){var d;return function(m,w){if(!(m instanceof w))throw new TypeError("Cannot call a class as a function")}(this,l),(d=function(m,w){return!w||t(w)!=="object"&&typeof w!="function"?function(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}(m):w}(this,i(l).call(this,f))).name="ObjectPrototypeMutationError",d}return function(f,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");f.prototype=Object.create(d&&d.prototype,{constructor:{value:f,writable:!0,configurable:!0}}),d&&o(f,d)}(l,u),l}(n(Error));function a(u,l){for(var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},d=l.split("."),m=d.length,w=function(y){var g=d[y];if(!u)return{v:void 0};if(g==="+"){if(Array.isArray(u))return{v:u.map(function(b,S){var E=d.slice(y+1);return E.length>0?a(b,E.join("."),f):f(u,S,d,y)})};var h=d.slice(0,y).join(".");throw new Error("Object at wildcard (".concat(h,") is not an array"))}u=f(u,g,d,y)},v=0;v<m;v++){var T=w(v);if(t(T)==="object")return T.v}return u}function c(u,l){return u.length===l+1}e.exports={set:function(u,l,f){if(t(u)!="object"||u===null||l===void 0)return u;if(typeof l=="number")return u[l]=f,u[l];try{return a(u,l,function(d,m,w,v){if(d===Reflect.getPrototypeOf({}))throw new s("Attempting to mutate Object.prototype");if(!d[m]){var T=Number.isInteger(Number(w[v+1])),y=w[v+1]==="+";d[m]=T||y?[]:{}}return c(w,v)&&(d[m]=f),d[m]})}catch(d){if(d instanceof s)throw d;return u}},get:function(u,l){if(t(u)!="object"||u===null||l===void 0)return u;if(typeof l=="number")return u[l];try{return a(u,l,function(f,d){return f[d]})}catch{return u}},has:function(u,l){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(t(u)!="object"||u===null||l===void 0)return!1;if(typeof l=="number")return l in u;try{var d=!1;return a(u,l,function(m,w,v,T){if(!c(v,T))return m&&m[w];d=f.own?m.hasOwnProperty(w):w in m}),d}catch{return!1}},hasOwn:function(u,l,f){return this.has(u,l,f||{own:!0})},isIn:function(u,l,f){var d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(t(u)!="object"||u===null||l===void 0)return!1;try{var m=!1,w=!1;return a(u,l,function(v,T,y,g){return m=m||v===f||!!v&&v[T]===f,w=c(y,g)&&t(v)==="object"&&T in v,v&&v[T]}),d.validPath?m&&w:m}catch{return!1}},ObjectPrototypeMutationError:s}},47:(e,t,n)=>{var r=n(410),o=function(u){return typeof u=="string"};function i(u,l){for(var f=[],d=0;d<u.length;d++){var m=u[d];m&&m!=="."&&(m===".."?f.length&&f[f.length-1]!==".."?f.pop():l&&f.push(".."):f.push(m))}return f}var s=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a={};function c(u){return s.exec(u).slice(1)}a.resolve=function(){for(var u="",l=!1,f=arguments.length-1;f>=-1&&!l;f--){var d=f>=0?arguments[f]:we.cwd();if(!o(d))throw new TypeError("Arguments to path.resolve must be strings");d&&(u=d+"/"+u,l=d.charAt(0)==="/")}return(l?"/":"")+(u=i(u.split("/"),!l).join("/"))||"."},a.normalize=function(u){var l=a.isAbsolute(u),f=u.substr(-1)==="/";return(u=i(u.split("/"),!l).join("/"))||l||(u="."),u&&f&&(u+="/"),(l?"/":"")+u},a.isAbsolute=function(u){return u.charAt(0)==="/"},a.join=function(){for(var u="",l=0;l<arguments.length;l++){var f=arguments[l];if(!o(f))throw new TypeError("Arguments to path.join must be strings");f&&(u+=u?"/"+f:f)}return a.normalize(u)},a.relative=function(u,l){function f(g){for(var h=0;h<g.length&&g[h]==="";h++);for(var b=g.length-1;b>=0&&g[b]==="";b--);return h>b?[]:g.slice(h,b+1)}u=a.resolve(u).substr(1),l=a.resolve(l).substr(1);for(var d=f(u.split("/")),m=f(l.split("/")),w=Math.min(d.length,m.length),v=w,T=0;T<w;T++)if(d[T]!==m[T]){v=T;break}var y=[];for(T=v;T<d.length;T++)y.push("..");return(y=y.concat(m.slice(v))).join("/")},a._makeLong=function(u){return u},a.dirname=function(u){var l=c(u),f=l[0],d=l[1];return f||d?(d&&(d=d.substr(0,d.length-1)),f+d):"."},a.basename=function(u,l){var f=c(u)[2];return l&&f.substr(-1*l.length)===l&&(f=f.substr(0,f.length-l.length)),f},a.extname=function(u){return c(u)[3]},a.format=function(u){if(!r.isObject(u))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof u);var l=u.root||"";if(!o(l))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(!o(u))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof u);var l=c(u);if(!l||l.length!==4)throw new TypeError("Invalid path '"+u+"'");return l[1]=l[1]||"",l[2]=l[2]||"",l[3]=l[3]||"",{root:l[0],dir:l[0]+l[1].slice(0,l[1].length-1),base:l[2],ext:l[3],name:l[2].slice(0,l[2].length-l[3].length)}},a.sep="/",a.delimiter=":",e.exports=a},647:(e,t)=>{var n=Object.prototype.hasOwnProperty;function r(i){try{return decodeURIComponent(i.replace(/\+/g," "))}catch{return null}}function o(i){try{return encodeURIComponent(i)}catch{return null}}t.stringify=function(i,s){s=s||"";var a,c,u=[];for(c in typeof s!="string"&&(s="?"),i)if(n.call(i,c)){if((a=i[c])||a!=null&&!isNaN(a)||(a=""),c=o(c),a=o(a),c===null||a===null)continue;u.push(c+"="+a)}return u.length?s+u.join("&"):""},t.parse=function(i){for(var s,a=/([^=?#&]+)=?([^&]*)/g,c={};s=a.exec(i);){var u=r(s[1]),l=r(s[2]);u===null||l===null||u in c||(c[u]=l)}return c}},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(o){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(i=Object.assign({},r,i),!o||typeof o!="string")return o;let s=o.trim();if(i.skipLike!==void 0&&i.skipLike.test(s))return o;if(i.hex&&t.test(s))return Number.parseInt(s,16);{const c=n.exec(s);if(c){const u=c[1],l=c[2];let f=((a=c[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 d=c[4]||c[6];if(!i.leadingZeros&&l.length>0&&u&&s[2]!=="."||!i.leadingZeros&&l.length>0&&!u&&s[1]!==".")return o;{const m=Number(s),w=""+m;return w.search(/[eE]/)!==-1||d?i.eNotation?m:o:s.indexOf(".")!==-1?w==="0"&&f===""||w===f||u&&w==="-"+f?m:o:l?f===w||u+f===w?m:o:s===w||s===u+w?m:o}}return o}var a}},737:(e,t,n)=>{var r=n(670),o=n(647),i=/^[\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+-.]*:\/\//,c=/:\d+$/,u=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,l=/^[a-zA-Z]:/;function f(g){return(g||"").toString().replace(i,"")}var d=[["#","hash"],["?","query"],function(g,h){return v(h.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 w(g){var h,b=(typeof window<"u"?window:typeof Nr<"u"?Nr:typeof self<"u"?self:{}).location||{},S={},E=typeof(g=g||b);if(g.protocol==="blob:")S=new y(unescape(g.pathname),{});else if(E==="string")for(h in S=new y(g,{}),m)delete S[h];else if(E==="object"){for(h in g)h in m||(S[h]=g[h]);S.slashes===void 0&&(S.slashes=a.test(g.href))}return S}function v(g){return g==="file:"||g==="ftp:"||g==="http:"||g==="https:"||g==="ws:"||g==="wss:"}function T(g,h){g=(g=f(g)).replace(s,""),h=h||{};var b,S=u.exec(g),E=S[1]?S[1].toLowerCase():"",I=!!S[2],R=!!S[3],A=0;return I?R?(b=S[2]+S[3]+S[4],A=S[2].length+S[3].length):(b=S[2]+S[4],A=S[2].length):R?(b=S[3]+S[4],A=S[3].length):b=S[4],E==="file:"?A>=2&&(b=b.slice(2)):v(E)?b=S[4]:E?I&&(b=b.slice(2)):A>=2&&v(h.protocol)&&(b=S[4]),{protocol:E,slashes:I||v(E),slashesCount:A,rest:b}}function y(g,h,b){if(g=(g=f(g)).replace(s,""),!(this instanceof y))return new y(g,h,b);var S,E,I,R,A,N,L=d.slice(),x=typeof h,$=this,V=0;for(x!=="object"&&x!=="string"&&(b=h,h=null),b&&typeof b!="function"&&(b=o.parse),S=!(E=T(g||"",h=w(h))).protocol&&!E.slashes,$.slashes=E.slashes||S&&h.slashes,$.protocol=E.protocol||h.protocol||"",g=E.rest,(E.protocol==="file:"&&(E.slashesCount!==2||l.test(g))||!E.slashes&&(E.protocol||E.slashesCount<2||!v($.protocol)))&&(L[3]=[/(.*)/,"pathname"]);V<L.length;V++)typeof(R=L[V])!="function"?(I=R[0],N=R[1],I!=I?$[N]=g:typeof I=="string"?~(A=I==="@"?g.lastIndexOf(I):g.indexOf(I))&&(typeof R[2]=="number"?($[N]=g.slice(0,A),g=g.slice(A+R[2])):($[N]=g.slice(A),g=g.slice(0,A))):(A=I.exec(g))&&($[N]=A[1],g=g.slice(0,A.index)),$[N]=$[N]||S&&R[3]&&h[N]||"",R[4]&&($[N]=$[N].toLowerCase())):g=R(g,$);b&&($.query=b($.query)),S&&h.slashes&&$.pathname.charAt(0)!=="/"&&($.pathname!==""||h.pathname!=="")&&($.pathname=function(X,ee){if(X==="")return ee;for(var se=(ee||"/").split("/").slice(0,-1).concat(X.split("/")),ie=se.length,re=se[ie-1],fe=!1,ue=0;ie--;)se[ie]==="."?se.splice(ie,1):se[ie]===".."?(se.splice(ie,1),ue++):ue&&(ie===0&&(fe=!0),se.splice(ie,1),ue--);return fe&&se.unshift(""),re!=="."&&re!==".."||se.push(""),se.join("/")}($.pathname,h.pathname)),$.pathname.charAt(0)!=="/"&&v($.protocol)&&($.pathname="/"+$.pathname),r($.port,$.protocol)||($.host=$.hostname,$.port=""),$.username=$.password="",$.auth&&(~(A=$.auth.indexOf(":"))?($.username=$.auth.slice(0,A),$.username=encodeURIComponent(decodeURIComponent($.username)),$.password=$.auth.slice(A+1),$.password=encodeURIComponent(decodeURIComponent($.password))):$.username=encodeURIComponent(decodeURIComponent($.auth)),$.auth=$.password?$.username+":"+$.password:$.username),$.origin=$.protocol!=="file:"&&v($.protocol)&&$.host?$.protocol+"//"+$.host:"null",$.href=$.toString()}y.prototype={set:function(g,h,b){var S=this;switch(g){case"query":typeof h=="string"&&h.length&&(h=(b||o.parse)(h)),S[g]=h;break;case"port":S[g]=h,r(h,S.protocol)?h&&(S.host=S.hostname+":"+h):(S.host=S.hostname,S[g]="");break;case"hostname":S[g]=h,S.port&&(h+=":"+S.port),S.host=h;break;case"host":S[g]=h,c.test(h)?(h=h.split(":"),S.port=h.pop(),S.hostname=h.join(":")):(S.hostname=h,S.port="");break;case"protocol":S.protocol=h.toLowerCase(),S.slashes=!b;break;case"pathname":case"hash":if(h){var E=g==="pathname"?"/":"#";S[g]=h.charAt(0)!==E?E+h:h}else S[g]=h;break;case"username":case"password":S[g]=encodeURIComponent(h);break;case"auth":var I=h.indexOf(":");~I?(S.username=h.slice(0,I),S.username=encodeURIComponent(decodeURIComponent(S.username)),S.password=h.slice(I+1),S.password=encodeURIComponent(decodeURIComponent(S.password))):S.username=encodeURIComponent(decodeURIComponent(h))}for(var R=0;R<d.length;R++){var A=d[R];A[4]&&(S[A[1]]=S[A[1]].toLowerCase())}return S.auth=S.password?S.username+":"+S.password:S.username,S.origin=S.protocol!=="file:"&&v(S.protocol)&&S.host?S.protocol+"//"+S.host:"null",S.href=S.toString(),S},toString:function(g){g&&typeof g=="function"||(g=o.stringify);var h,b=this,S=b.host,E=b.protocol;E&&E.charAt(E.length-1)!==":"&&(E+=":");var I=E+(b.protocol&&b.slashes||v(b.protocol)?"//":"");return b.username?(I+=b.username,b.password&&(I+=":"+b.password),I+="@"):b.password?(I+=":"+b.password,I+="@"):b.protocol!=="file:"&&v(b.protocol)&&!S&&b.pathname!=="/"&&(I+="@"),(S[S.length-1]===":"||c.test(b.hostname)&&!b.port)&&(S+=":"),I+=S+b.pathname,(h=typeof b.query=="object"?g(b.query):b.query)&&(I+=h.charAt(0)!=="?"?"?"+h:h),b.hash&&(I+=b.hash),I}},y.extractProtocol=T,y.location=w,y.trimLeft=f,y.qs=o,e.exports=y},410:()=>{},388:()=>{},805:()=>{},345:()=>{},800:()=>{}},Hm={};function ht(e){var t=Hm[e];if(t!==void 0)return t.exports;var n=Hm[e]={id:e,loaded:!1,exports:{}};return OR[e].call(n.exports,n,n.exports,ht),n.loaded=!0,n.exports}ht.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return ht.d(t,{a:t}),t},ht.d=(e,t)=>{for(var n in t)ht.o(t,n)&&!ht.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},ht.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),ht.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var Mn={};ht.d(Mn,{hT:()=>vn,O4:()=>Sr,Kd:()=>jR,YK:()=>UR,UU:()=>G_,Gu:()=>ry,ky:()=>vy,h4:()=>Eo,ch:()=>js,hq:()=>ni,i5:()=>wy});var kR=ht(737),xR=ht.n(kR);function Nu(e){if(!$u(e))throw new Error("Parameter was not an error")}function $u(e){return!!e&&typeof e=="object"&&(t=e,Object.prototype.toString.call(t)==="[object Error]")||e instanceof Error;var t}class bn extends Error{constructor(t,n){const r=[...arguments],{options:o,shortMessage:i}=function(a){let c,u="";if(a.length===0)c={};else if($u(a[0]))c={cause:a[0]},u=a.slice(1).join(" ")||"";else if(a[0]&&typeof a[0]=="object")c=Object.assign({},a[0]),u=a.slice(1).join(" ")||"";else{if(typeof a[0]!="string")throw new Error("Invalid arguments passed to Layerr");c={},u=u=a.join(" ")||""}return{options:c,shortMessage:u}}(r);let s=i;if(o.cause&&(s=`${s}: ${o.cause.message}`),super(s),this.message=s,o.name&&typeof o.name=="string"?this.name=o.name:this.name="Layerr",o.cause&&Object.defineProperty(this,"_cause",{value:o.cause}),Object.defineProperty(this,"_info",{value:{}}),o.info&&typeof o.info=="object"&&Object.assign(this._info,o.info),Error.captureStackTrace){const a=o.constructorOpt||this.constructor;Error.captureStackTrace(this,a)}}static cause(t){return Nu(t),t._cause&&$u(t._cause)?t._cause:null}static fullStack(t){Nu(t);const n=bn.cause(t);return n?`${t.stack}
42
- caused by: ${bn.fullStack(n)}`:t.stack??""}static info(t){Nu(t);const n={},r=bn.cause(t);return r&&Object.assign(n,bn.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 NR=ht(47),ks=ht.n(NR);const Gm="__PATH_SEPARATOR_POSIX__",Km="__PATH_SEPARATOR_WINDOWS__";function Ft(e){try{const t=e.replace(/\//g,Gm).replace(/\\\\/g,Km);return encodeURIComponent(t).split(Km).join("\\\\").split(Gm).join("/")}catch(t){throw new bn(t,"Failed encoding path")}}function Qm(e){return e.startsWith("/")?e:"/"+e}function bo(e){let t=e;return t[0]!=="/"&&(t="/"+t),/^.+\/$/.test(t)&&(t=t.substr(0,t.length-1)),t}function $R(e){let t=new(xR())(e).pathname;return t.length<=0&&(t="/"),bo(t)}function Ot(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){return function(r){var o=[];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 i=r.shift();r[0]=i+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(/[\/]+$/,"/"),o.push(a))}var c=o.join("/"),u=(c=c.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return u.shift()+(u.length>0?"?":"")+u.join("&")}(typeof arguments[0]=="object"?arguments[0]:[].slice.call(arguments))}(t.reduce((r,o,i)=>((i===0||o!=="/"||o==="/"&&r[r.length-1]!=="/")&&r.push(o),r),[]))}var DR=ht(542),vo=ht.n(DR);const LR="abcdef0123456789";function Xm(e,t){const n=e.url.replace("//",""),r=n.indexOf("/")==-1?"/":n.slice(n.indexOf("/")),o=e.method?e.method.toUpperCase():"GET",i=!!/(^|,)\s*auth\s*($|,)/.test(t.qop)&&"auth",s=`00000000${t.nc}`.slice(-8),a=function(d,m,w,v,T,y,g){const h=g||vo()(`${m}:${w}:${v}`);return d&&d.toLowerCase()==="md5-sess"?vo()(`${h}:${T}:${y}`):h}(t.algorithm,t.username,t.realm,t.password,t.nonce,t.cnonce,t.ha1),c=vo()(`${o}:${r}`),u=i?vo()(`${a}:${t.nonce}:${s}:${t.cnonce}:${i}:${c}`):vo()(`${a}:${t.nonce}:${c}`),l={username:t.username,realm:t.realm,nonce:t.nonce,uri:r,qop:i,response:u,nc:s,cnonce:t.cnonce,algorithm:t.algorithm,opaque:t.opaque},f=[];for(const d in l)l[d]&&(d==="qop"||d==="nc"||d==="algorithm"?f.push(`${d}=${l[d]}`):f.push(`${d}="${l[d]}"`));return`Digest ${f.join(", ")}`}function Ym(e){return(e.headers&&e.headers.get("www-authenticate")||"").split(/\s/)[0].toLowerCase()==="digest"}var MR=ht(101),Jm=ht.n(MR);function Zm(e){return Jm().decode(e)}function ey(e,t){var n;return`Basic ${n=`${e}:${t}`,Jm().encode(n)}`}const xs=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis,BR=xs.fetch.bind(xs),jR=xs.Request,UR=xs.Response;let vn=function(e){return e.Auto="auto",e.Digest="digest",e.None="none",e.Password="password",e.Token="token",e}({}),Sr=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 ty(e,t,n,r,o){switch(e.authType){case vn.Auto:t&&n&&(e.headers.Authorization=ey(t,n));break;case vn.Digest:e.digest=function(s,a,c){return{username:s,password:a,ha1:c,nc:0,algorithm:"md5",hasDigestAuth:!1}}(t,n,o);break;case vn.None:break;case vn.Password:e.headers.Authorization=ey(t,n);break;case vn.Token:e.headers.Authorization=`${(i=r).token_type} ${i.access_token}`;break;default:throw new bn({info:{code:Sr.InvalidAuthType}},`Invalid auth type: ${e.authType}`)}var i}ht(345),ht(800);const ny="@@HOTPATCHER",qR=()=>{};function Du(e){return{original:e,methods:[e],final:!1}}class VR{constructor(){this._configuration={registry:{},getEmptyAction:"null"},this.__type__=ny}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__!==ny)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)||qR;for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return n(...o)}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,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];if(o.length===0)throw new Error("Failed creating sequence: No functions provided");return function(){for(var s=arguments.length,a=new Array(s),c=0;c<s;c++)a[c]=arguments[c];let u=a;const l=this;for(;o.length>0;)u=[o.shift().apply(l,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:o=!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(o)this.configuration.registry[t]?this.configuration.registry[t].methods.push(n):this.configuration.registry[t]=Du(n);else if(this.isPatched(t)){const{original:i}=this.configuration.registry[t];this.configuration.registry[t]=Object.assign(Du(n),{original:i})}else this.configuration.registry[t]=Du(n);return this}patchInline(t,n){this.isPatched(t)||this.patch(t,n);for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];return this.execute(t,...o)}plugin(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 r.forEach(i=>{this.patch(t,i,{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 Lu=null;function ry(){return Lu||(Lu=new VR),Lu}function Ns(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 iy(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];let r=null,o=[...t];for(;o.length>0;){const i=o.shift();r=r?oy(r,i):Ns(i)}return r}function oy(e,t){const n=Ns(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]?oy(n[r],t[r]):Ns(t[r]):n[r]=t[r]:n[r]=t[r]}),n}function zR(e){const t={};for(const n of e.keys())t[n]=e.get(n);return t}function Mu(){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((o,i)=>(Object.keys(i).forEach(s=>{const a=s.toLowerCase();r.hasOwnProperty(a)?o[r[a]]=i[s]:(r[a]=s,o[s]=i[s])}),o),{})}ht(805);const WR=typeof ArrayBuffer=="function",{toString:HR}=Object.prototype;function sy(e){return WR&&(e instanceof ArrayBuffer||HR.call(e)==="[object ArrayBuffer]")}function ay(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function Bu(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 ju(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const ly=Bu(function(e){const t=e._digest;return delete e._digest,t.hasDigestAuth&&(e=iy(e,{headers:{Authorization:Xm(e,t)}})),ju($s(e),function(n){let r=!1;return o=function(s){return r?s:n},(i=function(){if(n.status==401)return t.hasDigestAuth=function(s,a){if(!Ym(s))return!1;const c=/([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi;for(;;){const u=s.headers&&s.headers.get("www-authenticate")||"",l=c.exec(u);if(!l)break;a[l[1]]=l[2]||l[3]}return a.nc+=1,a.cnonce=function(){let u="";for(let l=0;l<32;++l)u=`${u}${LR[Math.floor(16*Math.random())]}`;return u}(),!0}(n,t),function(){if(t.hasDigestAuth)return ju($s(e=iy(e,{headers:{Authorization:Xm(e,t)}})),function(s){return s.status==401?t.hasDigestAuth=!1:t.nc++,r=!0,s})}();t.nc++}())&&i.then?i.then(o):o(i);var o,i})}),GR=Bu(function(e,t){return ju($s(e),function(n){return n.ok?(t.authType=vn.Password,n):n.status==401&&Ym(n)?(t.authType=vn.Digest,ty(t,t.username,t.password,void 0,void 0),e._digest=t.digest,ly(e)):n})}),Xt=Bu(function(e,t){return t.authType===vn.Auto?GR(e,t):e._digest?ly(e):$s(e)});function Yt(e,t,n){const r=Ns(e);return r.headers=Mu(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 $s(e){const t=ry();return t.patchInline("request",n=>t.patchInline("fetch",BR,n.url,function(r){let o={};const i={method:r.method};if(r.headers&&(o=Mu(o,r.headers)),r.data!==void 0){const[s,a]=function(c){if(typeof c=="string")return[c,{}];if(ay(c))return[c,{}];if(sy(c))return[c,{}];if(c&&typeof c=="object")return[JSON.stringify(c),{"content-type":"application/json"}];throw new Error("Unable to convert request body: Unexpected body type: "+typeof c)}(r.data);i.body=s,o=Mu(o,a)}return r.signal&&(i.signal=r.signal),r.withCredentials&&(i.credentials="include"),i.headers=o,i}(n)),e)}var KR=ht(285);const Ds=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},QR={"[: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]},wo=e=>e.replace(/[[\]\\-]/g,"\\$&"),cy=e=>e.join(""),XR=(e,t)=>{const n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");const r=[],o=[];let i=n+1,s=!1,a=!1,c=!1,u=!1,l=n,f="";e:for(;i<e.length;){const v=e.charAt(i);if(v!=="!"&&v!=="^"||i!==n+1){if(v==="]"&&s&&!c){l=i+1;break}if(s=!0,v!=="\\"||c){if(v==="["&&!c){for(const[T,[y,g,h]]of Object.entries(QR))if(e.startsWith(T,i)){if(f)return["$.",!1,e.length-n,!0];i+=T.length,h?o.push(y):r.push(y),a=a||g;continue e}}c=!1,f?(v>f?r.push(wo(f)+"-"+wo(v)):v===f&&r.push(wo(v)),f="",i++):e.startsWith("-]",i+1)?(r.push(wo(v+"-")),i+=2):e.startsWith("-",i+1)?(f=v,i+=2):(r.push(wo(v)),i++)}else c=!0,i++}else u=!0,i++}if(l<i)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])&&!u)return[(d=r[0].length===2?r[0].slice(-1):r[0],d.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,l-n,!1];var d;const m="["+(u?"^":"")+cy(r)+"]",w="["+(u?"":"^")+cy(o)+"]";return[r.length&&o.length?"("+m+"|"+w+")":r.length?m:w,a,l-n,!0]},So=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")},YR=new Set(["!","?","+","*","@"]),uy=e=>YR.has(e),Uu="(?!\\.)",JR=new Set(["[","."]),ZR=new Set(["..","."]),e_=new Set("().*{}+?[]^$\\!"),qu="[^/]",fy=qu+"*?",dy=qu+"+?",En=class En{constructor(t,n){Rn(this,gi);Se(this,"type");Rn(this,en);Rn(this,rn);Rn(this,Cr,!1);Rn(this,Ct,[]);Rn(this,Wt);Rn(this,Lr);Rn(this,pi);Rn(this,Mr,!1);Rn(this,ar);Rn(this,hi);Rn(this,Lo,!1);let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.type=t,t&&Bt(this,rn,!0),Bt(this,Wt,n),Bt(this,en,Fe(this,Wt)?Fe(Fe(this,Wt),en):this),Bt(this,ar,Fe(this,en)===this?r:Fe(Fe(this,en),ar)),Bt(this,pi,Fe(this,en)===this?[]:Fe(Fe(this,en),pi)),t!=="!"||Fe(Fe(this,en),Mr)||Fe(this,pi).push(this),Bt(this,Lr,Fe(this,Wt)?Fe(Fe(this,Wt),Ct).length:0)}get hasMagic(){if(Fe(this,rn)!==void 0)return Fe(this,rn);for(const t of Fe(this,Ct))if(typeof t!="string"&&(t.type||t.hasMagic))return Bt(this,rn,!0);return Fe(this,rn)}toString(){return Fe(this,hi)!==void 0?Fe(this,hi):this.type?Bt(this,hi,this.type+"("+Fe(this,Ct).map(t=>String(t)).join("|")+")"):Bt(this,hi,Fe(this,Ct).map(t=>String(t)).join(""))}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 En&&Fe(o,Wt)===this))throw new Error("invalid part: "+o);Fe(this,Ct).push(o)}}toJSON(){var n;const t=this.type===null?Fe(this,Ct).slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...Fe(this,Ct).map(r=>r.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===Fe(this,en)||Fe(Fe(this,en),Mr)&&((n=Fe(this,Wt))==null?void 0:n.type)==="!")&&t.push({}),t}isStart(){var n;if(Fe(this,en)===this)return!0;if(!((n=Fe(this,Wt))!=null&&n.isStart()))return!1;if(Fe(this,Lr)===0)return!0;const t=Fe(this,Wt);for(let r=0;r<Fe(this,Lr);r++){const o=Fe(t,Ct)[r];if(!(o instanceof En&&o.type==="!"))return!1}return!0}isEnd(){var n,r,o;if(Fe(this,en)===this||((n=Fe(this,Wt))==null?void 0:n.type)==="!")return!0;if(!((r=Fe(this,Wt))!=null&&r.isEnd()))return!1;if(!this.type)return(o=Fe(this,Wt))==null?void 0:o.isEnd();const t=Fe(this,Wt)?Fe(Fe(this,Wt),Ct).length:0;return Fe(this,Lr)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const n=new En(this.type,t);for(const r of Fe(this,Ct))n.copyIn(r);return n}static fromGlob(t){var o;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=new En(null,void 0,n);return jr(o=En,Br,va).call(o,t,r,0,n),r}toMMPattern(){if(this!==Fe(this,en))return Fe(this,en).toMMPattern();const t=this.toString(),[n,r,o,i]=this.toRegExpSource();if(!(o||Fe(this,rn)||Fe(this,ar).nocase&&!Fe(this,ar).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;const s=(Fe(this,ar).nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${n}$`,s),{_src:n,_glob:t})}get options(){return Fe(this,ar)}toRegExpSource(t){var c;const n=t??!!Fe(this,ar).dot;if(Fe(this,en)===this&&jr(this,gi,D0).call(this),!this.type){const u=this.isStart()&&this.isEnd(),l=Fe(this,Ct).map(m=>{var g;const[w,v,T,y]=typeof m=="string"?jr(g=En,Br,L0).call(g,m,Fe(this,rn),u):m.toRegExpSource(t);return Bt(this,rn,Fe(this,rn)||T),Bt(this,Cr,Fe(this,Cr)||y),w}).join("");let f="";if(this.isStart()&&typeof Fe(this,Ct)[0]=="string"&&(Fe(this,Ct).length!==1||!ZR.has(Fe(this,Ct)[0]))){const m=JR,w=n&&m.has(l.charAt(0))||l.startsWith("\\.")&&m.has(l.charAt(2))||l.startsWith("\\.\\.")&&m.has(l.charAt(4)),v=!n&&!t&&m.has(l.charAt(0));f=w?"(?!(?:^|/)\\.\\.?(?:$|/))":v?Uu:""}let d="";return this.isEnd()&&Fe(Fe(this,en),Mr)&&((c=Fe(this,Wt))==null?void 0:c.type)==="!"&&(d="(?:$|\\/)"),[f+l+d,So(l),Bt(this,rn,!!Fe(this,rn)),Fe(this,Cr)]}const r=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:";let i=jr(this,gi,td).call(this,n);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){const u=this.toString();return Bt(this,Ct,[u]),this.type=null,Bt(this,rn,void 0),[u,So(this.toString()),!1,!1]}let s=!r||t||n?"":jr(this,gi,td).call(this,!0);s===i&&(s=""),s&&(i=`(?:${i})(?:${s})*?`);let a="";return a=this.type==="!"&&Fe(this,Lo)?(this.isStart()&&!n?Uu:"")+dy:o+i+(this.type==="!"?"))"+(!this.isStart()||n||t?"":Uu)+fy+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&s?")":this.type==="*"&&s?")?":`)${this.type}`),[a,So(i),Bt(this,rn,!!Fe(this,rn)),Fe(this,Cr)]}};en=new WeakMap,rn=new WeakMap,Cr=new WeakMap,Ct=new WeakMap,Wt=new WeakMap,Lr=new WeakMap,pi=new WeakMap,Mr=new WeakMap,ar=new WeakMap,hi=new WeakMap,Lo=new WeakMap,gi=new WeakSet,D0=function(){if(this!==Fe(this,en))throw new Error("should only call on root");if(Fe(this,Mr))return this;let t;for(this.toString(),Bt(this,Mr,!0);t=Fe(this,pi).pop();){if(t.type!=="!")continue;let n=t,r=Fe(n,Wt);for(;r;){for(let o=Fe(n,Lr)+1;!r.type&&o<Fe(r,Ct).length;o++)for(const i of Fe(t,Ct)){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(Fe(r,Ct)[o])}n=r,r=Fe(n,Wt)}}return this},Br=new WeakSet,va=function(t,n,r,o){var m,w;let i=!1,s=!1,a=-1,c=!1;if(n.type===null){let v=r,T="";for(;v<t.length;){const y=t.charAt(v++);if(i||y==="\\")i=!i,T+=y;else if(s)v===a+1?y!=="^"&&y!=="!"||(c=!0):y!=="]"||v===a+2&&c||(s=!1),T+=y;else if(y!=="[")if(o.noext||!uy(y)||t.charAt(v)!=="(")T+=y;else{n.push(T),T="";const g=new En(y,n);v=jr(m=En,Br,va).call(m,t,g,v,o),n.push(g)}else s=!0,a=v,c=!1,T+=y}return n.push(T),v}let u=r+1,l=new En(null,n);const f=[];let d="";for(;u<t.length;){const v=t.charAt(u++);if(i||v==="\\")i=!i,d+=v;else if(s)u===a+1?v!=="^"&&v!=="!"||(c=!0):v!=="]"||u===a+2&&c||(s=!1),d+=v;else if(v!=="[")if(uy(v)&&t.charAt(u)==="("){l.push(d),d="";const T=new En(v,l);l.push(T),u=jr(w=En,Br,va).call(w,t,T,u,o)}else if(v!=="|"){if(v===")")return d===""&&Fe(n,Ct).length===0&&Bt(n,Lo,!0),l.push(d),d="",n.push(...f,l),u;d+=v}else l.push(d),d="",f.push(l),l=new En(null,n);else s=!0,a=u,c=!1,d+=v}return n.type=null,Bt(n,rn,void 0),Bt(n,Ct,[t.substring(r-1)]),u},td=function(t){return Fe(this,Ct).map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");const[r,o,i,s]=n.toRegExpSource(t);return Bt(this,Cr,Fe(this,Cr)||s),r}).filter(n=>!(this.isStart()&&this.isEnd()&&!n)).join("|")},L0=function(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],o=!1,i="",s=!1;for(let a=0;a<t.length;a++){const c=t.charAt(a);if(o)o=!1,i+=(e_.has(c)?"\\":"")+c;else if(c!=="\\"){if(c==="["){const[u,l,f,d]=XR(t,a);if(f){i+=u,s=s||l,a+=f-1,n=n||d;continue}}c!=="*"?c!=="?"?i+=c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):(i+=qu,n=!0):(i+=r&&t==="*"?dy:fy,n=!0)}else a===t.length-1?i+="\\\\":o=!0}return[i,So(t),!!n,s]},Rn(En,Br);let Ls=En;const un=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Ds(t),!(!n.nocomment&&t.charAt(0)==="#")&&new Ms(t,n).match(e)},t_=/^\*+([^+@!?\*\[\(]*)$/,n_=e=>t=>!t.startsWith(".")&&t.endsWith(e),r_=e=>t=>t.endsWith(e),i_=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),o_=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),s_=/^\*+\.\*+$/,a_=e=>!e.startsWith(".")&&e.includes("."),l_=e=>e!=="."&&e!==".."&&e.includes("."),c_=/^\.\*+$/,u_=e=>e!=="."&&e!==".."&&e.startsWith("."),f_=/^\*+$/,d_=e=>e.length!==0&&!e.startsWith("."),p_=e=>e.length!==0&&e!=="."&&e!=="..",h_=/^\?+([^+@!?\*\[\(]*)?$/,g_=e=>{let[t,n=""]=e;const r=py([t]);return n?(n=n.toLowerCase(),o=>r(o)&&o.toLowerCase().endsWith(n)):r},m_=e=>{let[t,n=""]=e;const r=hy([t]);return n?(n=n.toLowerCase(),o=>r(o)&&o.toLowerCase().endsWith(n)):r},y_=e=>{let[t,n=""]=e;const r=hy([t]);return n?o=>r(o)&&o.endsWith(n):r},b_=e=>{let[t,n=""]=e;const r=py([t]);return n?o=>r(o)&&o.endsWith(n):r},py=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&!r.startsWith(".")},hy=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&r!=="."&&r!==".."},gy=typeof we=="object"&&we?typeof we.env=="object"&&we.env&&we.env.__MINIMATCH_TESTING_PLATFORM__||we.platform:"posix";un.sep=gy==="win32"?"\\":"/";const Bn=Symbol("globstar **");un.GLOBSTAR=Bn,un.filter=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=>un(n,e,t)};const jn=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},e,t)};un.defaults=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return un;const t=un;return Object.assign(function(n,r){return t(n,r,jn(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))},{Minimatch:class extends t.Minimatch{constructor(n){super(n,jn(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(n){return t.defaults(jn(e,n)).Minimatch}},AST:class extends t.AST{constructor(n,r){super(n,r,jn(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,jn(e,r))}},unescape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(n,jn(e,r))},escape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(n,jn(e,r))},filter:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(n,jn(e,r))},defaults:n=>t.defaults(jn(e,n)),makeRe:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(n,jn(e,r))},braceExpand:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(n,jn(e,r))},match:function(n,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(n,r,jn(e,o))},sep:t.sep,GLOBSTAR:Bn})};const my=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Ds(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:KR(e)};un.braceExpand=my,un.makeRe=function(e){return new Ms(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},un.match=function(e,t){const n=new Ms(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 yy=/[?*]|[+@!]\(.*?\)|\[|\]/;class Ms{constructor(t){Se(this,"options");Se(this,"set");Se(this,"pattern");Se(this,"windowsPathsNoEscape");Se(this,"nonegate");Se(this,"negate");Se(this,"comment");Se(this,"empty");Se(this,"preserveMultipleSlashes");Se(this,"partial");Se(this,"globSet");Se(this,"globParts");Se(this,"nocase");Se(this,"isWindows");Se(this,"platform");Se(this,"windowsNoMagicRoot");Se(this,"regexp");let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ds(t),n=n||{},this.options=n,this.pattern=t,this.platform=n.platform||gy,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(i=>this.slashSplit(i));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let o=this.globParts.map((i,s,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){const c=!(i[0]!==""||i[1]!==""||i[2]!=="?"&&yy.test(i[2])||yy.test(i[3])),u=/^[a-z]:/i.test(i[0]);if(c)return[...i.slice(0,4),...i.slice(4).map(l=>this.parse(l))];if(u)return[i[0],...i.slice(1).map(l=>this.parse(l))]}return i.map(c=>this.parse(c))});if(this.debug(this.pattern,o),this.set=o.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){const s=this.set[i];s[0]===""&&s[1]===""&&this.globParts[i][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 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 i=r[r.length-1];return o==="**"&&i==="**"?r:o===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(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 i=t[o];o===1&&i===""&&t[0]===""||i!=="."&&i!==""||(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 s=o;for(;r[s+1]==="**";)s++;s>o&&r.splice(o+1,s-o);let a=r[o+1];const c=r[o+2],u=r[o+3];if(a!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;n=!0,r.splice(o,1);const l=r.slice(0);l[o]="**",t.push(l),o--}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 i=0;for(;(i=r.indexOf("..",i+1))!==-1;){const s=r[i-1];if(s&&s!=="."&&s!==".."&&s!=="**"){n=!0;const a=i===1&&r[i+1]==="**"?["."]:[];r.splice(i-1,2,...a),r.length===0&&r.push(""),i-=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,i=0,s=[],a="";for(;o<t.length&&i<n.length;)if(t[o]===n[i])s.push(a==="b"?n[i]:t[o]),o++,i++;else if(r&&t[o]==="**"&&n[i]===t[o+1])s.push(t[o]),o++;else if(r&&n[i]==="**"&&t[o]===n[i+1])s.push(n[i]),i++;else if(t[o]!=="*"||!n[i]||!this.options.dot&&n[i].startsWith(".")||n[i]==="**"){if(n[i]!=="*"||!t[o]||!this.options.dot&&t[o].startsWith(".")||t[o]==="**"||a==="a")return!1;a="b",s.push(n[i]),o++,i++}else{if(a==="b")return!1;a="a",s.push(t[o]),o++,i++}return t.length===n.length&&s}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 v=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),T=!v&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),y=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),g=T?3:v?0:void 0,h=!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 h=="number"){const[b,S]=[t[g],n[h]];b.toLowerCase()===S.toLowerCase()&&(n[h]=b,h>g?n=n.slice(h):g>h&&(t=t.slice(g)))}}const{optimizationLevel:i=1}=this.options;i>=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,c=t.length,u=n.length;s<c&&a<u;s++,a++){this.debug("matchOne loop");var l=n[a],f=t[s];if(this.debug(n,l,f),l===!1)return!1;if(l===Bn){this.debug("GLOBSTAR",[n,l,f]);var d=s,m=a+1;if(m===u){for(this.debug("** at the end");s<c;s++)if(t[s]==="."||t[s]===".."||!o.dot&&t[s].charAt(0)===".")return!1;return!0}for(;d<c;){var w=t[d];if(this.debug(`
43
- globstar while`,t,d,n,m,w),this.matchOne(t.slice(d),n.slice(m),r))return this.debug("globstar found match!",d,c,w),!0;if(w==="."||w===".."||!o.dot&&w.charAt(0)==="."){this.debug("dot detected!",t,d,n,m);break}this.debug("globstar swallow a segment, and continue"),d++}return!(!r||(this.debug(`
44
- >>> no match, partial?`,t,d,n,m),d!==c))}let v;if(typeof l=="string"?(v=f===l,this.debug("string match",l,f,v)):(v=l.test(f),this.debug("pattern match",l,f,v)),!v)return!1}if(s===c&&a===u)return!0;if(s===c)return r;if(a===u)return s===c-1&&t[s]==="";throw new Error("wtf?")}braceExpand(){return my(this.pattern,this.options)}parse(t){Ds(t);const n=this.options;if(t==="**")return Bn;if(t==="")return"";let r,o=null;(r=t.match(f_))?o=n.dot?p_:d_:(r=t.match(t_))?o=(n.nocase?n.dot?o_:i_:n.dot?r_:n_)(r[1]):(r=t.match(h_))?o=(n.nocase?n.dot?m_:g_:n.dot?y_:b_)(r):(r=t.match(s_))?o=n.dot?l_:a_:(r=t.match(c_))&&(o=u_);const i=Ls.fromGlob(t,this.options).toMMPattern();return o&&typeof i=="object"&&Reflect.defineProperty(i,"test",{value:o}),i}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 i=t.map(c=>{const u=c.map(l=>{if(l instanceof RegExp)for(const f of l.flags.split(""))o.add(f);return typeof l=="string"?l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):l===Bn?Bn:l._src});return u.forEach((l,f)=>{const d=u[f+1],m=u[f-1];l===Bn&&m!==Bn&&(m===void 0?d!==void 0&&d!==Bn?u[f+1]="(?:\\/|"+r+"\\/)?"+d:u[f]=r:d===void 0?u[f-1]=m+"(?:\\/|"+r+")?":d!==Bn&&(u[f-1]=m+"(?:\\/|\\/"+r+"\\/)"+d,u[f+1]=Bn))}),u.filter(l=>l!==Bn).join("/")}).join("|");const[s,a]=t.length>1?["(?:",")"]:["",""];i="^"+s+i+a+"$",this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...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 i=this.set;this.debug(this.pattern,"set",i);let s=o[o.length-1];if(!s)for(let a=o.length-2;!s&&a>=0;a--)s=o[a];for(let a=0;a<i.length;a++){const c=i[a];let u=o;if(r.matchBase&&c.length===1&&(u=[s]),this.matchOne(u,c,n))return!!r.flipNegate||!this.negate}return!r.flipNegate&&this.negate}static defaults(t){return un.defaults(t).Minimatch}}function Vu(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 Jt(e,t){const{status:n}=t;if(n===401&&e.digest)return t;if(n>=400)throw Vu(t);return t}function ni(e,t){return arguments.length>2&&arguments[2]!==void 0&&arguments[2]?{data:t,headers:e.headers?zR(e.headers):{},status:e.status,statusText:e.statusText}:t}un.AST=Ls,un.Minimatch=Ms,un.escape=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")},un.unescape=So;const v_=(by=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=Yt({url:Ot(e.remoteURL,Ft(t)),method:"COPY",headers:{Destination:Ot(e.remoteURL,Ft(n)),Overwrite:r.overwrite===!1?"F":"T",Depth:r.shallow?"0":"infinity"}},e,r);return s=function(a){Jt(e,a)},(i=Xt(o,e))&&i.then||(i=Promise.resolve(i)),s?i.then(s):i;var i,s},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(by.apply(this,e))}catch(n){return Promise.reject(n)}});var by,zu=ht(635),w_=ht(829),Er=ht.n(w_),Di=function(e){return e.Array="array",e.Object="object",e.Original="original",e}(Di||{});function Bs(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Di.Original;const r=Er().get(e,t);return n==="array"&&Array.isArray(r)===!1?[r]:n==="object"&&Array.isArray(r)?r[0]:r}function Eo(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 o={multistatus:Array.isArray(r)?r[0]:r};return Er().set(o,"multistatus.response",Bs(o,"multistatus.response",Di.Array)),Er().set(o,"multistatus.response",Er().get(o,"multistatus.response").map(i=>function(s){const a=Object.assign({},s);return a.status?Er().set(a,"status",Bs(a,"status",Di.Object)):(Er().set(a,"propstat",Bs(a,"propstat",Di.Object)),Er().set(a,"propstat.prop",Bs(a,"propstat.prop",Di.Object))),a}(i))),o}(new zu.XMLParser({allowBooleanAttributes:!0,attributeNamePrefix:"",textNodeName:"text",ignoreAttributes:!1,removeNSPrefix:!0,numberParseOptions:{hex:!0,leadingZeros:!1},attributeValueProcessor:(n,r,o)=>r==="true"||r==="false"?r==="true":r,tagValueProcessor(n,r,o){if(!o.endsWith("propstat.prop.displayname"))return r}}).parse(e)))})}function js(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const{getlastmodified:r=null,getcontentlength:o="0",resourcetype:i=null,getcontenttype:s=null,getetag:a=null}=e,c=i&&typeof i=="object"&&i.collection!==void 0?"directory":"file",u={filename:t,basename:ks().basename(t),lastmod:r,size:parseInt(o,10),type:c,etag:typeof a=="string"?a.replace(/"/g,""):null};return c==="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 vy(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:o,status:i}}=r,[s,a,c]=i.split(" ",3),u=parseInt(a,10);if(u>=400){const l=new Error(`Invalid response: ${u} ${c}`);throw l.status=u,l}return js(o,bo(t),n)}function wy(e){switch(String(e)){case"-3":return"unlimited";case"-2":case"-1":return"unknown";default:return parseInt(String(e),10)}}function Wu(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const Hu=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,o=Yt({url:Ot(e.remoteURL,Ft(t)),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,n);return Wu(Xt(o,e),function(i){return Jt(e,i),Wu(i.text(),function(s){return Wu(Eo(s),function(a){const c=vy(a,t,r);return ni(i,c,r)})})})});function Sy(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const S_=Ey(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=function(i){if(!i||i==="/")return[];let s=i;const a=[];do a.push(s),s=ks().dirname(s);while(s&&s!=="/");return a}(bo(t));r.sort((i,s)=>i.length>s.length?1:s.length>i.length?-1:0);let o=!1;return function(i,s,a){if(typeof i[Ay]=="function"){let v=function(T){try{for(;!(c=f.next()).done;)if((T=s(c.value))&&T.then){if(!Ry(T))return void T.then(v,l||(l=wn.bind(null,u=new Li,2)));T=T.v}u?wn(u,1,T):u=T}catch(y){wn(u||(u=new Li),2,y)}};var c,u,l,f=i[Ay]();if(v(),f.return){var d=function(T){try{c.done||f.return()}catch{}return T};if(u&&u.then)return u.then(d,function(T){throw d(T)});d()}return u}if(!("length"in i))throw new TypeError("Object is not iterable");for(var m=[],w=0;w<i.length;w++)m.push(i[w]);return function(v,T,y){var g,h,b=-1;return function S(E){try{for(;++b<v.length&&(!y||!y());)if((E=T(b))&&E.then){if(!Ry(E))return void E.then(S,h||(h=wn.bind(null,g=new Li,2)));E=E.v}g?wn(g,1,E):g=E}catch(I){wn(g||(g=new Li),2,I)}}(),g}(m,function(v){return s(m[v])},a)}(r,function(i){return s=function(){return function(c,u){try{var l=Sy(Hu(e,i),function(f){if(f.type!=="directory")throw new Error(`Path includes a file: ${t}`)})}catch(f){return u(f)}return l&&l.then?l.then(void 0,u):l}(0,function(c){const u=c;return function(){if(u.status===404)return o=!0,Ty(Gu(e,i,{...n,recursive:!1}));throw c}()})},(a=function(){if(o)return Ty(Gu(e,i,{...n,recursive:!1}))}())&&a.then?a.then(s):s();var s,a},function(){return!1})});function Ey(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_(){}function Ty(e,t){return e&&e.then?e.then(E_):Promise.resolve()}const Ay=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function wn(e,t,n){if(!e.s){if(n instanceof Li){if(!n.s)return void(n.o=wn.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(wn.bind(null,e,t),wn.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}const Li=function(){function e(){}return e.prototype.then=function(t,n){const r=new e,o=this.s;if(o){const i=1&o?t:n;if(i){try{wn(r,1,i(this.v))}catch(s){wn(r,2,s)}return r}return this}return this.o=function(i){try{const s=i.v;1&i.s?wn(r,1,t?t(s):s):n?wn(r,1,n(s)):wn(r,2,s)}catch(s){wn(r,2,s)}},r},e}();function Ry(e){return e instanceof Li&&1&e.s}const Gu=Ey(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(n.recursive===!0)return S_(e,t,n);const r=Yt({url:Ot(e.remoteURL,(o=Ft(t),o.endsWith("/")?o:o+"/")),method:"MKCOL"},e,n);var o;return Sy(Xt(r,e),function(i){Jt(e,i)})});var T_=ht(388),_y=ht.n(T_);const A_=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 o=Yt({url:Ot(e.remoteURL,Ft(t)),method:"GET",headers:r},e,n);return s=function(a){if(Jt(e,a),r.Range&&a.status!==206){const c=new Error(`Invalid response code for partial request: ${a.status}`);throw c.status=a.status,c}return n.callback&&setTimeout(()=>{n.callback(a)},0),a.body},(i=Xt(o,e))&&i.then||(i=Promise.resolve(i)),s?i.then(s):i;var i,s}),R_=()=>{},__=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=Ot(e.remoteURL,Ft(t)));const r=Yt(n,e,{});return i=function(s){return Jt(e,s),s},(o=Xt(r,e))&&o.then||(o=Promise.resolve(o)),i?o.then(i):o;var o,i}),I_=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=Yt({url:Ot(e.remoteURL,Ft(t)),method:"DELETE"},e,n);return i=function(s){Jt(e,s)},(o=Xt(r,e))&&o.then||(o=Promise.resolve(o)),i?o.then(i):o;var o,i}),C_=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,o){try{var i=(s=Hu(e,t,n),a=function(){return!0},c?a?a(s):s:(s&&s.then||(s=Promise.resolve(s)),a?s.then(a):s))}catch(u){return o(u)}var s,a,c;return i&&i.then?i.then(void 0,o):i}(0,function(r){if(r.status===404)return!1;throw r})});function Ku(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const P_=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=Yt({url:Ot(e.remoteURL,Ft(t),"/"),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:n.deep?"infinity":"1"}},e,n);return Ku(Xt(r,e),function(o){return Jt(e,o),Ku(o.text(),function(i){if(!i)throw new Error("Failed parsing directory contents: Empty response");return Ku(Eo(i),function(s){const a=Qm(t);let c=function(u,l,f){let d=arguments.length>3&&arguments[3]!==void 0&&arguments[3],m=arguments.length>4&&arguments[4]!==void 0&&arguments[4];const w=ks().join(l,"/"),{multistatus:{response:v}}=u,T=v.map(y=>{const g=function(b){try{return b.replace(/^https?:\/\/[^\/]+/,"")}catch(S){throw new bn(S,"Failed normalising HREF")}}(y.href),{propstat:{prop:h}}=y;return js(h,w==="/"?decodeURIComponent(bo(g)):bo(ks().relative(decodeURIComponent(w),decodeURIComponent(g))),d)});return m?T:T.filter(y=>y.basename&&(y.type==="file"||y.filename!==f.replace(/\/$/,"")))}(s,Qm(e.remoteBasePath||e.remotePath),a,n.details,n.includeSelf);return n.glob&&(c=function(u,l){return u.filter(f=>un(f.filename,l,{matchBase:!0}))}(c,n.glob)),ni(o,c,n.details)})})})});function Qu(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 F_=Qu(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Yt({url:Ot(e.remoteURL,Ft(t)),method:"GET",headers:{Accept:"text/plain"},transformResponse:[x_]},e,n);return Us(Xt(r,e),function(o){return Jt(e,o),Us(o.text(),function(i){return ni(o,i,n.details)})})});function Us(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const O_=Qu(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Yt({url:Ot(e.remoteURL,Ft(t)),method:"GET"},e,n);return Us(Xt(r,e),function(o){let i;return Jt(e,o),function(s,a){var c=s();return c&&c.then?c.then(a):a()}(function(){return Us(o.arrayBuffer(),function(s){i=s})},function(){return ni(o,i,n.details)})})}),k_=Qu(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 bn({info:{code:Sr.InvalidOutputFormat}},`Invalid output format: ${r}`);return r==="text"?F_(e,t,n):O_(e,t,n)}),x_=e=>e;function N_(e){return new zu.XMLBuilder({attributeNamePrefix:"@_",format:!0,ignoreAttributes:!1,suppressEmptyNode:!0}).build(Iy({lockinfo:{"@_xmlns:d":"DAV:",lockscope:{exclusive:{}},locktype:{write:{}},owner:{href:e}}},"d"))}function Iy(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}`]=Iy(n[r],t),delete n[r]):/^@_/.test(r)===!1&&(n[`${t}:${r}`]=n[r],delete n[r]));return n}function Xu(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function Cy(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 $_=Cy(function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=Yt({url:Ot(e.remoteURL,Ft(t)),method:"UNLOCK",headers:{"Lock-Token":n}},e,r);return Xu(Xt(o,e),function(i){if(Jt(e,i),i.status!==204&&i.status!==200)throw Vu(i)})}),D_=Cy(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{refreshToken:r,timeout:o=L_}=n,i={Accept:"text/plain,application/xml",Timeout:o};r&&(i.If=r);const s=Yt({url:Ot(e.remoteURL,Ft(t)),method:"LOCK",headers:i,data:N_(e.contactHref)},e,n);return Xu(Xt(s,e),function(a){return Jt(e,a),Xu(a.text(),function(c){const u=(d=c,new zu.XMLParser({removeNSPrefix:!0,parseAttributeValue:!0,parseTagValue:!0}).parse(d)),l=Er().get(u,"prop.lockdiscovery.activelock.locktoken.href"),f=Er().get(u,"prop.lockdiscovery.activelock.timeout");var d;if(!l)throw Vu(a,"No lock token received: ");return{token:l,serverTimeout:f}})})}),L_="Infinite, Second-4100000000";function Yu(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const M_=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=Yt({url:Ot(e.remoteURL,n),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,t);return Yu(Xt(r,e),function(o){return Jt(e,o),Yu(o.text(),function(i){return Yu(Eo(i),function(s){const a=function(c){try{const[u]=c.multistatus.response,{propstat:{prop:{"quota-used-bytes":l,"quota-available-bytes":f}}}=u;return l!==void 0&&f!==void 0?{used:parseInt(String(l),10),available:wy(f)}:null}catch{}return null}(s);return ni(o,a,t.details)})})})});function Ju(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const B_=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,o=Yt({url:Ot(e.remoteURL,Ft(t)),method:"SEARCH",headers:{Accept:"text/plain,application/xml","Content-Type":e.headers["Content-Type"]||"application/xml; charset=utf-8"}},e,n);return Ju(Xt(o,e),function(i){return Jt(e,i),Ju(i.text(),function(s){return Ju(Eo(s),function(a){const c=function(u,l,f){const d={truncated:!1,results:[]};return d.truncated=u.multistatus.response.some(m=>{var w,v;return((v=(m.status||((w=m.propstat)==null?void 0:w.status)).split(" ",3))==null?void 0:v[1])==="507"&&m.href.replace(/\/$/,"").endsWith(Ft(l).replace(/\/$/,""))}),u.multistatus.response.forEach(m=>{if(m.propstat===void 0)return;const w=m.href.split("/").map(decodeURIComponent).join("/");d.results.push(js(m.propstat.prop,w,f))}),d}(a,t,r);return ni(i,c,r)})})})}),j_=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 o=Yt({url:Ot(e.remoteURL,Ft(t)),method:"MOVE",headers:{Destination:Ot(e.remoteURL,Ft(n)),Overwrite:r.overwrite===!1?"F":"T"}},e,r);return s=function(a){Jt(e,a)},(i=Xt(o,e))&&i.then||(i=Promise.resolve(i)),s?i.then(s):i;var i,s});var U_=ht(172);const q_=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:o=!0,overwrite:i=!0}=r,s={"Content-Type":"application/octet-stream"};o===!1||(s["Content-Length"]=typeof o=="number"?`${o}`:`${function(l){if(sy(l))return l.byteLength;if(ay(l))return l.length;if(typeof l=="string")return(0,U_.d)(l);throw new bn({info:{code:Sr.DataTypeNoLength}},"Cannot calculate data length: Invalid type")}(n)}`),i||(s["If-None-Match"]="*");const a=Yt({url:Ot(e.remoteURL,Ft(t)),method:"PUT",headers:s,data:n},e,r);return u=function(l){try{Jt(e,l)}catch(f){const d=f;if(d.status!==412||i)throw d;return!1}return!0},(c=Xt(a,e))&&c.then||(c=Promise.resolve(c)),u?c.then(u):c;var c,u}),Py=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=Yt({url:Ot(e.remoteURL,Ft(t)),method:"OPTIONS"},e,n);return i=function(s){try{Jt(e,s)}catch(a){throw a}return{compliance:(s.headers.get("DAV")??"").split(",").map(a=>a.trim()),server:s.headers.get("Server")??""}},(o=Xt(r,e))&&o.then||(o=Promise.resolve(o)),i?o.then(i):o;var o,i});function To(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const V_=Zu(function(e,t,n,r,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>r||n<0)throw new bn({info:{code:Sr.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=Yt({url:Ot(e.remoteURL,Ft(t)),method:"PUT",headers:s,data:o},e,i);return To(Xt(a,e),function(c){Jt(e,c)})});function Fy(e,t){var n=e();return n&&n.then?n.then(t):t(n)}const z_=Zu(function(e,t,n,r,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>r||n<0)throw new bn({info:{code:Sr.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=Yt({url:Ot(e.remoteURL,Ft(t)),method:"PATCH",headers:s,data:o},e,i);return To(Xt(a,e),function(c){Jt(e,c)})});function Zu(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 W_=Zu(function(e,t,n,r,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};return To(Py(e,t,i),function(s){let a=!1;return Fy(function(){if(s.compliance.includes("sabredav-partialupdate"))return To(z_(e,t,n,r,o,i),function(c){return a=!0,c})},function(c){let u=!1;return a?c:Fy(function(){if(s.server.includes("Apache")&&s.compliance.includes("<http://apache.org/dav/propset/fs/1>"))return To(V_(e,t,n,r,o,i),function(l){return u=!0,l})},function(l){if(u)return l;throw new bn({info:{code:Sr.NotSupported}},"Not supported")})})})}),H_="https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";function G_(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{authType:n=null,remoteBasePath:r,contactHref:o=H_,ha1:i,headers:s={},httpAgent:a,httpsAgent:c,password:u,token:l,username:f,withCredentials:d}=t;let m=n;m||(m=f||u?vn.Password:vn.None);const w={authType:m,remoteBasePath:r,contactHref:o,ha1:i,headers:Object.assign({},s),httpAgent:a,httpsAgent:c,password:u,remotePath:$R(e),remoteURL:e,token:l,username:f,withCredentials:d};return ty(w,f,u,l,i),{copyFile:(v,T,y)=>v_(w,v,T,y),createDirectory:(v,T)=>Gu(w,v,T),createReadStream:(v,T)=>function(y,g){let h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const b=new(_y()).PassThrough;return A_(y,g,h).then(S=>{S.pipe(b)}).catch(S=>{b.emit("error",S)}),b}(w,v,T),createWriteStream:(v,T,y)=>function(g,h){let b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},S=arguments.length>3&&arguments[3]!==void 0?arguments[3]:R_;const E=new(_y()).PassThrough,I={};b.overwrite===!1&&(I["If-None-Match"]="*");const R=Yt({url:Ot(g.remoteURL,Ft(h)),method:"PUT",headers:I,data:E,maxRedirects:0},g,b);return Xt(R,g).then(A=>Jt(g,A)).then(A=>{setTimeout(()=>{S(A)},0)}).catch(A=>{E.emit("error",A)}),E}(w,v,T,y),customRequest:(v,T)=>__(w,v,T),deleteFile:(v,T)=>I_(w,v,T),exists:(v,T)=>C_(w,v,T),getDirectoryContents:(v,T)=>P_(w,v,T),getFileContents:(v,T)=>k_(w,v,T),getFileDownloadLink:v=>function(T,y){let g=Ot(T.remoteURL,Ft(y));const h=/^https:/i.test(g)?"https":"http";switch(T.authType){case vn.None:break;case vn.Password:{const b=Zm(T.headers.Authorization.replace(/^Basic /i,"").trim());g=g.replace(/^https?:\/\//,`${h}://${b}@`);break}default:throw new bn({info:{code:Sr.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${T.authType}`)}return g}(w,v),getFileUploadLink:v=>function(T,y){let g=`${Ot(T.remoteURL,Ft(y))}?Content-Type=application/octet-stream`;const h=/^https:/i.test(g)?"https":"http";switch(T.authType){case vn.None:break;case vn.Password:{const b=Zm(T.headers.Authorization.replace(/^Basic /i,"").trim());g=g.replace(/^https?:\/\//,`${h}://${b}@`);break}default:throw new bn({info:{code:Sr.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${T.authType}`)}return g}(w,v),getHeaders:()=>Object.assign({},w.headers),getQuota:v=>M_(w,v),lock:(v,T)=>D_(w,v,T),moveFile:(v,T,y)=>j_(w,v,T,y),putFileContents:(v,T,y)=>q_(w,v,T,y),partialUpdateFileContents:(v,T,y,g,h)=>W_(w,v,T,y,g,h),getDAVCompliance:v=>Py(w,v),search:(v,T)=>B_(w,v,T),setHeaders:v=>{w.headers=Object.assign({},v)},stat:(v,T)=>Hu(w,v,T),unlock:(v,T,y)=>$_(w,v,T,y)}}Mn.hT,Mn.O4,Mn.Kd,Mn.YK,Mn.UU,Mn.Gu,Mn.ky,Mn.h4,Mn.ch,Mn.hq,Mn.i5;var ef={},tf={},Oy;function nf(){return Oy||(Oy=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+"]*",o=new RegExp("^"+r+"$"),i=function(a,c){const u=[];let l=c.exec(a);for(;l;){const f=[];f.startIndex=c.lastIndex-l[0].length;const d=l.length;for(let m=0;m<d;m++)f.push(l[m]);u.push(f),l=c.exec(a)}return u},s=function(a){const c=o.exec(a);return!(c===null||typeof c>"u")};e.isExist=function(a){return typeof a<"u"},e.isEmptyObject=function(a){return Object.keys(a).length===0},e.merge=function(a,c,u){if(c){const l=Object.keys(c),f=l.length;for(let d=0;d<f;d++)u==="strict"?a[l[d]]=[c[l[d]]]:a[l[d]]=c[l[d]]}},e.getValue=function(a){return e.isExist(a)?a:""},e.isName=s,e.getAllMatches=i,e.nameRegexp=r}(tf)),tf}var ky;function xy(){if(ky)return ef;ky=1;const e=nf(),t={allowBooleanAttributes:!1,unpairedTags:[]};ef.validate=function(y,g){g=Object.assign({},t,g);const h=[];let b=!1,S=!1;y[0]==="\uFEFF"&&(y=y.substr(1));for(let E=0;E<y.length;E++)if(y[E]==="<"&&y[E+1]==="?"){if(E+=2,E=r(y,E),E.err)return E}else if(y[E]==="<"){let I=E;if(E++,y[E]==="!"){E=o(y,E);continue}else{let R=!1;y[E]==="/"&&(R=!0,E++);let A="";for(;E<y.length&&y[E]!==">"&&y[E]!==" "&&y[E]!==" "&&y[E]!==`
45
- `&&y[E]!=="\r";E++)A+=y[E];if(A=A.trim(),A[A.length-1]==="/"&&(A=A.substring(0,A.length-1),E--),!w(A)){let x;return A.trim().length===0?x="Invalid space after '<'.":x="Tag '"+A+"' is an invalid name.",d("InvalidTag",x,v(y,E))}const N=a(y,E);if(N===!1)return d("InvalidAttr","Attributes for '"+A+"' have open quote.",v(y,E));let L=N.value;if(E=N.index,L[L.length-1]==="/"){const x=E-L.length;L=L.substring(0,L.length-1);const $=u(L,g);if($===!0)b=!0;else return d($.err.code,$.err.msg,v(y,x+$.err.line))}else if(R)if(N.tagClosed){if(L.trim().length>0)return d("InvalidTag","Closing tag '"+A+"' can't have attributes or invalid starting.",v(y,I));if(h.length===0)return d("InvalidTag","Closing tag '"+A+"' has not been opened.",v(y,I));{const x=h.pop();if(A!==x.tagName){let $=v(y,x.tagStartPos);return d("InvalidTag","Expected closing tag '"+x.tagName+"' (opened in line "+$.line+", col "+$.col+") instead of closing tag '"+A+"'.",v(y,I))}h.length==0&&(S=!0)}}else return d("InvalidTag","Closing tag '"+A+"' doesn't have proper closing.",v(y,E));else{const x=u(L,g);if(x!==!0)return d(x.err.code,x.err.msg,v(y,E-L.length+x.err.line));if(S===!0)return d("InvalidXml","Multiple possible root nodes found.",v(y,E));g.unpairedTags.indexOf(A)!==-1||h.push({tagName:A,tagStartPos:I}),b=!0}for(E++;E<y.length;E++)if(y[E]==="<")if(y[E+1]==="!"){E++,E=o(y,E);continue}else if(y[E+1]==="?"){if(E=r(y,++E),E.err)return E}else break;else if(y[E]==="&"){const x=f(y,E);if(x==-1)return d("InvalidChar","char '&' is not expected.",v(y,E));E=x}else if(S===!0&&!n(y[E]))return d("InvalidXml","Extra text at the end",v(y,E));y[E]==="<"&&E--}}else{if(n(y[E]))continue;return d("InvalidChar","char '"+y[E]+"' is not expected.",v(y,E))}if(b){if(h.length==1)return d("InvalidTag","Unclosed tag '"+h[0].tagName+"'.",v(y,h[0].tagStartPos));if(h.length>0)return d("InvalidXml","Invalid '"+JSON.stringify(h.map(E=>E.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return d("InvalidXml","Start tag expected.",1);return!0};function n(y){return y===" "||y===" "||y===`
46
- `||y==="\r"}function r(y,g){const h=g;for(;g<y.length;g++)if(y[g]=="?"||y[g]==" "){const b=y.substr(h,g-h);if(g>5&&b==="xml")return d("InvalidXml","XML declaration allowed only at the start of the document.",v(y,g));if(y[g]=="?"&&y[g+1]==">"){g++;break}else continue}return g}function o(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 h=1;for(g+=8;g<y.length;g++)if(y[g]==="<")h++;else if(y[g]===">"&&(h--,h===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 i='"',s="'";function a(y,g){let h="",b="",S=!1;for(;g<y.length;g++){if(y[g]===i||y[g]===s)b===""?b=y[g]:b!==y[g]||(b="");else if(y[g]===">"&&b===""){S=!0;break}h+=y[g]}return b!==""?!1:{value:h,index:g,tagClosed:S}}const c=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function u(y,g){const h=e.getAllMatches(y,c),b={};for(let S=0;S<h.length;S++){if(h[S][1].length===0)return d("InvalidAttr","Attribute '"+h[S][2]+"' has no space in starting.",T(h[S]));if(h[S][3]!==void 0&&h[S][4]===void 0)return d("InvalidAttr","Attribute '"+h[S][2]+"' is without value.",T(h[S]));if(h[S][3]===void 0&&!g.allowBooleanAttributes)return d("InvalidAttr","boolean attribute '"+h[S][2]+"' is not allowed.",T(h[S]));const E=h[S][2];if(!m(E))return d("InvalidAttr","Attribute '"+E+"' is an invalid name.",T(h[S]));if(!b.hasOwnProperty(E))b[E]=1;else return d("InvalidAttr","Attribute '"+E+"' is repeated.",T(h[S]))}return!0}function l(y,g){let h=/\d/;for(y[g]==="x"&&(g++,h=/[\da-fA-F]/);g<y.length;g++){if(y[g]===";")return g;if(!y[g].match(h))break}return-1}function f(y,g){if(g++,y[g]===";")return-1;if(y[g]==="#")return g++,l(y,g);let h=0;for(;g<y.length;g++,h++)if(!(y[g].match(/\w/)&&h<20)){if(y[g]===";")break;return-1}return g}function d(y,g,h){return{err:{code:y,msg:g,line:h.line||h,col:h.col}}}function m(y){return e.isName(y)}function w(y){return e.isName(y)}function v(y,g){const h=y.substring(0,g).split(/\r?\n/);return{line:h.length,col:h[h.length-1].length+1}}function T(y){return y.startIndex+y[1].length}return ef}var qs={},Ny;function K_(){if(Ny)return qs;Ny=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,o){return n}},t=function(n){return Object.assign({},e,n)};return qs.buildOptions=t,qs.defaultOptions=e,qs}var rf,$y;function Q_(){if($y)return rf;$y=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 rf=e,rf}var of,Dy;function X_(){if(Dy)return of;Dy=1;const e=nf();function t(u,l){const f={};if(u[l+3]==="O"&&u[l+4]==="C"&&u[l+5]==="T"&&u[l+6]==="Y"&&u[l+7]==="P"&&u[l+8]==="E"){l=l+9;let d=1,m=!1,w=!1,v="";for(;l<u.length;l++)if(u[l]==="<"&&!w){if(m&&o(u,l)){l+=7;let T,y;[T,y,l]=n(u,l+1),y.indexOf("&")===-1&&(f[c(T)]={regx:RegExp(`&${T};`,"g"),val:y})}else if(m&&i(u,l))l+=8;else if(m&&s(u,l))l+=8;else if(m&&a(u,l))l+=9;else if(r)w=!0;else throw new Error("Invalid DOCTYPE");d++,v=""}else if(u[l]===">"){if(w?u[l-1]==="-"&&u[l-2]==="-"&&(w=!1,d--):d--,d===0)break}else u[l]==="["?m=!0:v+=u[l];if(d!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:f,i:l}}function n(u,l){let f="";for(;l<u.length&&u[l]!=="'"&&u[l]!=='"';l++)f+=u[l];if(f=f.trim(),f.indexOf(" ")!==-1)throw new Error("External entites are not supported");const d=u[l++];let m="";for(;l<u.length&&u[l]!==d;l++)m+=u[l];return[f,m,l]}function r(u,l){return u[l+1]==="!"&&u[l+2]==="-"&&u[l+3]==="-"}function o(u,l){return u[l+1]==="!"&&u[l+2]==="E"&&u[l+3]==="N"&&u[l+4]==="T"&&u[l+5]==="I"&&u[l+6]==="T"&&u[l+7]==="Y"}function i(u,l){return u[l+1]==="!"&&u[l+2]==="E"&&u[l+3]==="L"&&u[l+4]==="E"&&u[l+5]==="M"&&u[l+6]==="E"&&u[l+7]==="N"&&u[l+8]==="T"}function s(u,l){return u[l+1]==="!"&&u[l+2]==="A"&&u[l+3]==="T"&&u[l+4]==="T"&&u[l+5]==="L"&&u[l+6]==="I"&&u[l+7]==="S"&&u[l+8]==="T"}function a(u,l){return u[l+1]==="!"&&u[l+2]==="N"&&u[l+3]==="O"&&u[l+4]==="T"&&u[l+5]==="A"&&u[l+6]==="T"&&u[l+7]==="I"&&u[l+8]==="O"&&u[l+9]==="N"}function c(u){if(e.isName(u))return u;throw new Error(`Invalid entity name ${u}`)}return of=t,of}var sf,Ly;function Y_(){if(Ly)return sf;Ly=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 c=s.trim();if(a.skipLike!==void 0&&a.skipLike.test(c))return s;if(s==="0")return 0;if(a.hex&&e.test(c))return i(c,16);if(c.search(/[eE]/)!==-1){const u=c.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);if(u){if(a.leadingZeros)c=(u[1]||"")+u[3];else if(!(u[2]==="0"&&u[3][0]==="."))return s;return a.eNotation?Number(c):s}else return s}else{const u=t.exec(c);if(u){const l=u[1],f=u[2];let d=o(u[3]);if(!a.leadingZeros&&f.length>0&&l&&c[2]!==".")return s;if(!a.leadingZeros&&f.length>0&&!l&&c[1]!==".")return s;if(a.leadingZeros&&f===s)return 0;{const m=Number(c),w=""+m;return w.search(/[eE]/)!==-1?a.eNotation?m:s:c.indexOf(".")!==-1?w==="0"&&d===""||w===d||l&&w==="-"+d?m:s:f?d===w||l+d===w?m:s:c===w||c===l+w?m:s}}else return s}}function o(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 i(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 sf=r,sf}var af,My;function By(){if(My)return af;My=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 af=e,af}var lf,jy;function J_(){if(jy)return lf;jy=1;const e=nf(),t=Q_(),n=X_(),r=Y_(),o=By();class i{constructor(E){this.options=E,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:(I,R)=>String.fromCharCode(Number.parseInt(R,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(I,R)=>String.fromCharCode(Number.parseInt(R,16))}},this.addExternalEntities=s,this.parseXml=f,this.parseTextData=a,this.resolveNameSpace=c,this.buildAttributesMap=l,this.isItStopNode=v,this.replaceEntitiesValue=m,this.readStopNodeData=h,this.saveTextToParentTag=w,this.addChild=d,this.ignoreAttributesFn=o(this.options.ignoreAttributes)}}function s(S){const E=Object.keys(S);for(let I=0;I<E.length;I++){const R=E[I];this.lastEntities[R]={regex:new RegExp("&"+R+";","g"),val:S[R]}}}function a(S,E,I,R,A,N,L){if(S!==void 0&&(this.options.trimValues&&!R&&(S=S.trim()),S.length>0)){L||(S=this.replaceEntitiesValue(S));const x=this.options.tagValueProcessor(E,S,I,A,N);return x==null?S:typeof x!=typeof S||x!==S?x:this.options.trimValues?b(S,this.options.parseTagValue,this.options.numberParseOptions):S.trim()===S?b(S,this.options.parseTagValue,this.options.numberParseOptions):S}}function c(S){if(this.options.removeNSPrefix){const E=S.split(":"),I=S.charAt(0)==="/"?"/":"";if(E[0]==="xmlns")return"";E.length===2&&(S=I+E[1])}return S}const u=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function l(S,E,I){if(this.options.ignoreAttributes!==!0&&typeof S=="string"){const R=e.getAllMatches(S,u),A=R.length,N={};for(let L=0;L<A;L++){const x=this.resolveNameSpace(R[L][1]);if(this.ignoreAttributesFn(x,E))continue;let $=R[L][4],V=this.options.attributeNamePrefix+x;if(x.length)if(this.options.transformAttributeName&&(V=this.options.transformAttributeName(V)),V==="__proto__"&&(V="#__proto__"),$!==void 0){this.options.trimValues&&($=$.trim()),$=this.replaceEntitiesValue($);const X=this.options.attributeValueProcessor(x,$,E);X==null?N[V]=$:typeof X!=typeof $||X!==$?N[V]=X:N[V]=b($,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(N[V]=!0)}if(!Object.keys(N).length)return;if(this.options.attributesGroupName){const L={};return L[this.options.attributesGroupName]=N,L}return N}}const f=function(S){S=S.replace(/\r\n?/g,`
47
- `);const E=new t("!xml");let I=E,R="",A="";for(let N=0;N<S.length;N++)if(S[N]==="<")if(S[N+1]==="/"){const x=y(S,">",N,"Closing Tag is not closed.");let $=S.substring(N+2,x).trim();if(this.options.removeNSPrefix){const ee=$.indexOf(":");ee!==-1&&($=$.substr(ee+1))}this.options.transformTagName&&($=this.options.transformTagName($)),I&&(R=this.saveTextToParentTag(R,I,A));const V=A.substring(A.lastIndexOf(".")+1);if($&&this.options.unpairedTags.indexOf($)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${$}>`);let X=0;V&&this.options.unpairedTags.indexOf(V)!==-1?(X=A.lastIndexOf(".",A.lastIndexOf(".")-1),this.tagsNodeStack.pop()):X=A.lastIndexOf("."),A=A.substring(0,X),I=this.tagsNodeStack.pop(),R="",N=x}else if(S[N+1]==="?"){let x=g(S,N,!1,"?>");if(!x)throw new Error("Pi Tag is not closed.");if(R=this.saveTextToParentTag(R,I,A),!(this.options.ignoreDeclaration&&x.tagName==="?xml"||this.options.ignorePiTags)){const $=new t(x.tagName);$.add(this.options.textNodeName,""),x.tagName!==x.tagExp&&x.attrExpPresent&&($[":@"]=this.buildAttributesMap(x.tagExp,A,x.tagName)),this.addChild(I,$,A)}N=x.closeIndex+1}else if(S.substr(N+1,3)==="!--"){const x=y(S,"-->",N+4,"Comment is not closed.");if(this.options.commentPropName){const $=S.substring(N+4,x-2);R=this.saveTextToParentTag(R,I,A),I.add(this.options.commentPropName,[{[this.options.textNodeName]:$}])}N=x}else if(S.substr(N+1,2)==="!D"){const x=n(S,N);this.docTypeEntities=x.entities,N=x.i}else if(S.substr(N+1,2)==="!["){const x=y(S,"]]>",N,"CDATA is not closed.")-2,$=S.substring(N+9,x);R=this.saveTextToParentTag(R,I,A);let V=this.parseTextData($,I.tagname,A,!0,!1,!0,!0);V==null&&(V=""),this.options.cdataPropName?I.add(this.options.cdataPropName,[{[this.options.textNodeName]:$}]):I.add(this.options.textNodeName,V),N=x+2}else{let x=g(S,N,this.options.removeNSPrefix),$=x.tagName;const V=x.rawTagName;let X=x.tagExp,ee=x.attrExpPresent,se=x.closeIndex;this.options.transformTagName&&($=this.options.transformTagName($)),I&&R&&I.tagname!=="!xml"&&(R=this.saveTextToParentTag(R,I,A,!1));const ie=I;if(ie&&this.options.unpairedTags.indexOf(ie.tagname)!==-1&&(I=this.tagsNodeStack.pop(),A=A.substring(0,A.lastIndexOf("."))),$!==E.tagname&&(A+=A?"."+$:$),this.isItStopNode(this.options.stopNodes,A,$)){let re="";if(X.length>0&&X.lastIndexOf("/")===X.length-1)$[$.length-1]==="/"?($=$.substr(0,$.length-1),A=A.substr(0,A.length-1),X=$):X=X.substr(0,X.length-1),N=x.closeIndex;else if(this.options.unpairedTags.indexOf($)!==-1)N=x.closeIndex;else{const ue=this.readStopNodeData(S,V,se+1);if(!ue)throw new Error(`Unexpected end of ${V}`);N=ue.i,re=ue.tagContent}const fe=new t($);$!==X&&ee&&(fe[":@"]=this.buildAttributesMap(X,A,$)),re&&(re=this.parseTextData(re,$,A,!0,ee,!0,!0)),A=A.substr(0,A.lastIndexOf(".")),fe.add(this.options.textNodeName,re),this.addChild(I,fe,A)}else{if(X.length>0&&X.lastIndexOf("/")===X.length-1){$[$.length-1]==="/"?($=$.substr(0,$.length-1),A=A.substr(0,A.length-1),X=$):X=X.substr(0,X.length-1),this.options.transformTagName&&($=this.options.transformTagName($));const re=new t($);$!==X&&ee&&(re[":@"]=this.buildAttributesMap(X,A,$)),this.addChild(I,re,A),A=A.substr(0,A.lastIndexOf("."))}else{const re=new t($);this.tagsNodeStack.push(I),$!==X&&ee&&(re[":@"]=this.buildAttributesMap(X,A,$)),this.addChild(I,re,A),I=re}R="",N=se}}else R+=S[N];return E.child};function d(S,E,I){const R=this.options.updateTag(E.tagname,I,E[":@"]);R===!1||(typeof R=="string"&&(E.tagname=R),S.addChild(E))}const m=function(S){if(this.options.processEntities){for(let E in this.docTypeEntities){const I=this.docTypeEntities[E];S=S.replace(I.regx,I.val)}for(let E in this.lastEntities){const I=this.lastEntities[E];S=S.replace(I.regex,I.val)}if(this.options.htmlEntities)for(let E in this.htmlEntities){const I=this.htmlEntities[E];S=S.replace(I.regex,I.val)}S=S.replace(this.ampEntity.regex,this.ampEntity.val)}return S};function w(S,E,I,R){return S&&(R===void 0&&(R=E.child.length===0),S=this.parseTextData(S,E.tagname,I,!1,E[":@"]?Object.keys(E[":@"]).length!==0:!1,R),S!==void 0&&S!==""&&E.add(this.options.textNodeName,S),S=""),S}function v(S,E,I){const R="*."+I;for(const A in S){const N=S[A];if(R===N||E===N)return!0}return!1}function T(S,E,I=">"){let R,A="";for(let N=E;N<S.length;N++){let L=S[N];if(R)L===R&&(R="");else if(L==='"'||L==="'")R=L;else if(L===I[0])if(I[1]){if(S[N+1]===I[1])return{data:A,index:N}}else return{data:A,index:N};else L===" "&&(L=" ");A+=L}}function y(S,E,I,R){const A=S.indexOf(E,I);if(A===-1)throw new Error(R);return A+E.length-1}function g(S,E,I,R=">"){const A=T(S,E+1,R);if(!A)return;let N=A.data;const L=A.index,x=N.search(/\s/);let $=N,V=!0;x!==-1&&($=N.substring(0,x),N=N.substring(x+1).trimStart());const X=$;if(I){const ee=$.indexOf(":");ee!==-1&&($=$.substr(ee+1),V=$!==A.data.substr(ee+1))}return{tagName:$,tagExp:N,closeIndex:L,attrExpPresent:V,rawTagName:X}}function h(S,E,I){const R=I;let A=1;for(;I<S.length;I++)if(S[I]==="<")if(S[I+1]==="/"){const N=y(S,">",I,`${E} is not closed`);if(S.substring(I+2,N).trim()===E&&(A--,A===0))return{tagContent:S.substring(R,I),i:N};I=N}else if(S[I+1]==="?")I=y(S,"?>",I+1,"StopNode is not closed.");else if(S.substr(I+1,3)==="!--")I=y(S,"-->",I+3,"StopNode is not closed.");else if(S.substr(I+1,2)==="![")I=y(S,"]]>",I,"StopNode is not closed.")-2;else{const N=g(S,I,">");N&&((N&&N.tagName)===E&&N.tagExp[N.tagExp.length-1]!=="/"&&A++,I=N.closeIndex)}}function b(S,E,I){if(E&&typeof S=="string"){const R=S.trim();return R==="true"?!0:R==="false"?!1:r(S,I)}else return e.isExist(S)?S:""}return lf=i,lf}var cf={},Uy;function Z_(){if(Uy)return cf;Uy=1;function e(i,s){return t(i,s)}function t(i,s,a){let c;const u={};for(let l=0;l<i.length;l++){const f=i[l],d=n(f);let m="";if(a===void 0?m=d:m=a+"."+d,d===s.textNodeName)c===void 0?c=f[d]:c+=""+f[d];else{if(d===void 0)continue;if(f[d]){let w=t(f[d],s,m);const v=o(w,s);f[":@"]?r(w,f[":@"],m,s):Object.keys(w).length===1&&w[s.textNodeName]!==void 0&&!s.alwaysCreateTextNode?w=w[s.textNodeName]:Object.keys(w).length===0&&(s.alwaysCreateTextNode?w[s.textNodeName]="":w=""),u[d]!==void 0&&u.hasOwnProperty(d)?(Array.isArray(u[d])||(u[d]=[u[d]]),u[d].push(w)):s.isArray(d,m,v)?u[d]=[w]:u[d]=w}}}return typeof c=="string"?c.length>0&&(u[s.textNodeName]=c):c!==void 0&&(u[s.textNodeName]=c),u}function n(i){const s=Object.keys(i);for(let a=0;a<s.length;a++){const c=s[a];if(c!==":@")return c}}function r(i,s,a,c){if(s){const u=Object.keys(s),l=u.length;for(let f=0;f<l;f++){const d=u[f];c.isArray(d,a+"."+d,!0,!0)?i[d]=[s[d]]:i[d]=s[d]}}}function o(i,s){const{textNodeName:a}=s,c=Object.keys(i).length;return!!(c===0||c===1&&(i[a]||typeof i[a]=="boolean"||i[a]===0))}return cf.prettify=e,cf}var uf,qy;function eI(){if(qy)return uf;qy=1;const{buildOptions:e}=K_(),t=J_(),{prettify:n}=Z_(),r=xy();class o{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 l=r.validate(s,a);if(l!==!0)throw Error(`${l.err.msg}:${l.err.line}:${l.err.col}`)}const c=new t(this.options);c.addExternalEntities(this.externalEntities);const u=c.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 uf=o,uf}var ff,Vy;function tI(){if(Vy)return ff;Vy=1;const e=`
48
- `;function t(a,c){let u="";return c.format&&c.indentBy.length>0&&(u=e),n(a,c,"",u)}function n(a,c,u,l){let f="",d=!1;for(let m=0;m<a.length;m++){const w=a[m],v=r(w);if(v===void 0)continue;let T="";if(u.length===0?T=v:T=`${u}.${v}`,v===c.textNodeName){let S=w[v];i(T,c)||(S=c.tagValueProcessor(v,S),S=s(S,c)),d&&(f+=l),f+=S,d=!1;continue}else if(v===c.cdataPropName){d&&(f+=l),f+=`<![CDATA[${w[v][0][c.textNodeName]}]]>`,d=!1;continue}else if(v===c.commentPropName){f+=l+`<!--${w[v][0][c.textNodeName]}-->`,d=!0;continue}else if(v[0]==="?"){const S=o(w[":@"],c),E=v==="?xml"?"":l;let I=w[v][0][c.textNodeName];I=I.length!==0?" "+I:"",f+=E+`<${v}${I}${S}?>`,d=!0;continue}let y=l;y!==""&&(y+=c.indentBy);const g=o(w[":@"],c),h=l+`<${v}${g}`,b=n(w[v],c,T,y);c.unpairedTags.indexOf(v)!==-1?c.suppressUnpairedNode?f+=h+">":f+=h+"/>":(!b||b.length===0)&&c.suppressEmptyNode?f+=h+"/>":b&&b.endsWith(">")?f+=h+`>${b}${l}</${v}>`:(f+=h+">",b&&l!==""&&(b.includes("/>")||b.includes("</"))?f+=l+c.indentBy+b+l:f+=b,f+=`</${v}>`),d=!0}return f}function r(a){const c=Object.keys(a);for(let u=0;u<c.length;u++){const l=c[u];if(a.hasOwnProperty(l)&&l!==":@")return l}}function o(a,c){let u="";if(a&&!c.ignoreAttributes)for(let l in a){if(!a.hasOwnProperty(l))continue;let f=c.attributeValueProcessor(l,a[l]);f=s(f,c),f===!0&&c.suppressBooleanAttributes?u+=` ${l.substr(c.attributeNamePrefix.length)}`:u+=` ${l.substr(c.attributeNamePrefix.length)}="${f}"`}return u}function i(a,c){a=a.substr(0,a.length-c.textNodeName.length-1);let u=a.substr(a.lastIndexOf(".")+1);for(let l in c.stopNodes)if(c.stopNodes[l]===a||c.stopNodes[l]==="*."+u)return!0;return!1}function s(a,c){if(a&&a.length>0&&c.processEntities)for(let u=0;u<c.entities.length;u++){const l=c.entities[u];a=a.replace(l.regex,l.val)}return a}return ff=t,ff}var df,zy;function nI(){if(zy)return df;zy=1;const e=tI(),t=By(),n={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(a,c){return c},attributeValueProcessor:function(a,c){return c},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=o,this.options.format?(this.indentate=i,this.tagEndChar=`>
39
+ `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function a(l,d,f,m){const w=this.j2x(l,f+1,m.concat(d));return l[this.options.textNodeName]!==void 0&&Object.keys(l).length===1?this.buildTextValNode(l[this.options.textNodeName],d,w.attrStr,f):this.buildObjectNode(w.val,d,w.attrStr,f)}function c(l){return this.options.indentBy.repeat(l)}function u(l){return!(!l.startsWith(this.options.attributeNamePrefix)||l===this.options.textNodeName)&&l.substr(this.attrPrefixLen)}s.prototype.build=function(l){return this.options.preserveOrder?r(l,this.options):(Array.isArray(l)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(l={[this.options.arrayNodeName]:l}),this.j2x(l,0,[]).val)},s.prototype.j2x=function(l,d,f){let m="",w="";const y=f.join(".");for(let E in l)if(Object.prototype.hasOwnProperty.call(l,E))if(l[E]===void 0)this.isAttribute(E)&&(w+="");else if(l[E]===null)this.isAttribute(E)?w+="":E[0]==="?"?w+=this.indentate(d)+"<"+E+"?"+this.tagEndChar:w+=this.indentate(d)+"<"+E+"/"+this.tagEndChar;else if(l[E]instanceof Date)w+=this.buildTextValNode(l[E],E,"",d);else if(typeof l[E]!="object"){const b=this.isAttribute(E);if(b&&!this.ignoreAttributesFn(b,y))m+=this.buildAttrPairStr(b,""+l[E]);else if(!b)if(E===this.options.textNodeName){let g=this.options.tagValueProcessor(E,""+l[E]);w+=this.replaceEntitiesValue(g)}else w+=this.buildTextValNode(l[E],E,"",d)}else if(Array.isArray(l[E])){const b=l[E].length;let g="",v="";for(let h=0;h<b;h++){const S=l[E][h];if(S!==void 0)if(S===null)E[0]==="?"?w+=this.indentate(d)+"<"+E+"?"+this.tagEndChar:w+=this.indentate(d)+"<"+E+"/"+this.tagEndChar;else if(typeof S=="object")if(this.options.oneListGroup){const T=this.j2x(S,d+1,f.concat(E));g+=T.val,this.options.attributesGroupName&&S.hasOwnProperty(this.options.attributesGroupName)&&(v+=T.attrStr)}else g+=this.processTextOrObjNode(S,E,d,f);else if(this.options.oneListGroup){let T=this.options.tagValueProcessor(E,S);T=this.replaceEntitiesValue(T),g+=T}else g+=this.buildTextValNode(S,E,"",d)}this.options.oneListGroup&&(g=this.buildObjectNode(g,E,v,d)),w+=g}else if(this.options.attributesGroupName&&E===this.options.attributesGroupName){const b=Object.keys(l[E]),g=b.length;for(let v=0;v<g;v++)m+=this.buildAttrPairStr(b[v],""+l[E][b[v]])}else w+=this.processTextOrObjNode(l[E],E,d,f);return{attrStr:m,val:w}},s.prototype.buildAttrPairStr=function(l,d){return d=this.options.attributeValueProcessor(l,""+d),d=this.replaceEntitiesValue(d),this.options.suppressBooleanAttributes&&d==="true"?" "+l:" "+l+'="'+d+'"'},s.prototype.buildObjectNode=function(l,d,f,m){if(l==="")return d[0]==="?"?this.indentate(m)+"<"+d+f+"?"+this.tagEndChar:this.indentate(m)+"<"+d+f+this.closeTag(d)+this.tagEndChar;{let w="</"+d+this.tagEndChar,y="";return d[0]==="?"&&(y="?",w=""),!f&&f!==""||l.indexOf("<")!==-1?this.options.commentPropName!==!1&&d===this.options.commentPropName&&y.length===0?this.indentate(m)+`<!--${l}-->`+this.newLine:this.indentate(m)+"<"+d+f+y+this.tagEndChar+l+this.indentate(m)+w:this.indentate(m)+"<"+d+f+y+">"+l+w}},s.prototype.closeTag=function(l){let d="";return this.options.unpairedTags.indexOf(l)!==-1?this.options.suppressUnpairedNode||(d="/"):d=this.options.suppressEmptyNode?"/":`></${l}`,d},s.prototype.buildTextValNode=function(l,d,f,m){if(this.options.cdataPropName!==!1&&d===this.options.cdataPropName)return this.indentate(m)+`<![CDATA[${l}]]>`+this.newLine;if(this.options.commentPropName!==!1&&d===this.options.commentPropName)return this.indentate(m)+`<!--${l}-->`+this.newLine;if(d[0]==="?")return this.indentate(m)+"<"+d+f+"?"+this.tagEndChar;{let w=this.options.tagValueProcessor(d,l);return w=this.replaceEntitiesValue(w),w===""?this.indentate(m)+"<"+d+f+this.closeTag(d)+this.tagEndChar:this.indentate(m)+"<"+d+f+">"+w+"</"+d+this.tagEndChar}},s.prototype.replaceEntitiesValue=function(l){if(l&&l.length>0&&this.options.processEntities)for(let d=0;d<this.options.entities.length;d++){const f=this.options.entities[d];l=l.replace(f.regex,f.val)}return l},e.exports=s},87:e=>{function t(s,a,c,u){let l="",d=!1;for(let f=0;f<s.length;f++){const m=s[f],w=n(m);if(w===void 0)continue;let y="";if(y=c.length===0?w:`${c}.${w}`,w===a.textNodeName){let v=m[w];o(y,a)||(v=a.tagValueProcessor(w,v),v=i(v,a)),d&&(l+=u),l+=v,d=!1;continue}if(w===a.cdataPropName){d&&(l+=u),l+=`<![CDATA[${m[w][0][a.textNodeName]}]]>`,d=!1;continue}if(w===a.commentPropName){l+=u+`<!--${m[w][0][a.textNodeName]}-->`,d=!0;continue}if(w[0]==="?"){const v=r(m[":@"],a),h=w==="?xml"?"":u;let S=m[w][0][a.textNodeName];S=S.length!==0?" "+S:"",l+=h+`<${w}${S}${v}?>`,d=!0;continue}let E=u;E!==""&&(E+=a.indentBy);const b=u+`<${w}${r(m[":@"],a)}`,g=t(m[w],a,y,E);a.unpairedTags.indexOf(w)!==-1?a.suppressUnpairedNode?l+=b+">":l+=b+"/>":g&&g.length!==0||!a.suppressEmptyNode?g&&g.endsWith(">")?l+=b+`>${g}${u}</${w}>`:(l+=b+">",g&&u!==""&&(g.includes("/>")||g.includes("</"))?l+=u+a.indentBy+g+u:l+=g,l+=`</${w}>`):l+=b+"/>",d=!0}return l}function n(s){const a=Object.keys(s);for(let c=0;c<a.length;c++){const u=a[c];if(s.hasOwnProperty(u)&&u!==":@")return u}}function r(s,a){let c="";if(s&&!a.ignoreAttributes)for(let u in s){if(!s.hasOwnProperty(u))continue;let l=a.attributeValueProcessor(u,s[u]);l=i(l,a),l===!0&&a.suppressBooleanAttributes?c+=` ${u.substr(a.attributeNamePrefix.length)}`:c+=` ${u.substr(a.attributeNamePrefix.length)}="${l}"`}return c}function o(s,a){let c=(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]==="*."+c)return!0;return!1}function i(s,a){if(s&&s.length>0&&a.processEntities)for(let c=0;c<a.entities.length;c++){const u=a.entities[c];s=s.replace(u.regex,u.val)}return s}e.exports=function(s,a){let c="";return a.format&&a.indentBy.length>0&&(c=`
40
+ `),t(s,a,"",c)}},193:(e,t,n)=>{const r=n(705);function o(d,f){let m="";for(;f<d.length&&d[f]!=="'"&&d[f]!=='"';f++)m+=d[f];if(m=m.trim(),m.indexOf(" ")!==-1)throw new Error("External entites are not supported");const w=d[f++];let y="";for(;f<d.length&&d[f]!==w;f++)y+=d[f];return[m,y,f]}function i(d,f){return d[f+1]==="!"&&d[f+2]==="-"&&d[f+3]==="-"}function s(d,f){return d[f+1]==="!"&&d[f+2]==="E"&&d[f+3]==="N"&&d[f+4]==="T"&&d[f+5]==="I"&&d[f+6]==="T"&&d[f+7]==="Y"}function a(d,f){return d[f+1]==="!"&&d[f+2]==="E"&&d[f+3]==="L"&&d[f+4]==="E"&&d[f+5]==="M"&&d[f+6]==="E"&&d[f+7]==="N"&&d[f+8]==="T"}function c(d,f){return d[f+1]==="!"&&d[f+2]==="A"&&d[f+3]==="T"&&d[f+4]==="T"&&d[f+5]==="L"&&d[f+6]==="I"&&d[f+7]==="S"&&d[f+8]==="T"}function u(d,f){return d[f+1]==="!"&&d[f+2]==="N"&&d[f+3]==="O"&&d[f+4]==="T"&&d[f+5]==="A"&&d[f+6]==="T"&&d[f+7]==="I"&&d[f+8]==="O"&&d[f+9]==="N"}function l(d){if(r.isName(d))return d;throw new Error(`Invalid entity name ${d}`)}e.exports=function(d,f){const m={};if(d[f+3]!=="O"||d[f+4]!=="C"||d[f+5]!=="T"||d[f+6]!=="Y"||d[f+7]!=="P"||d[f+8]!=="E")throw new Error("Invalid Tag instead of DOCTYPE");{f+=9;let w=1,y=!1,E=!1,b="";for(;f<d.length;f++)if(d[f]!=="<"||E)if(d[f]===">"){if(E?d[f-1]==="-"&&d[f-2]==="-"&&(E=!1,w--):w--,w===0)break}else d[f]==="["?y=!0:b+=d[f];else{if(y&&s(d,f)){let g,v;f+=7,[g,v,f]=o(d,f+1),v.indexOf("&")===-1&&(m[l(g)]={regx:RegExp(`&${g};`,"g"),val:v})}else if(y&&a(d,f))f+=8;else if(y&&c(d,f))f+=8;else if(y&&u(d,f))f+=9;else{if(!i)throw new Error("Invalid DOCTYPE");E=!0}w++,b=""}if(w!==0)throw new Error("Unclosed DOCTYPE")}return{entities:m,i:f}}},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,o){return o},attributeValueProcessor:function(r,o){return o},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(r,o,i){return r}};t.buildOptions=function(r){return Object.assign({},n,r)},t.defaultOptions=n},299:(e,t,n)=>{const r=n(705),o=n(365),i=n(193),s=n(494),a=n(118);function c(T){const R=Object.keys(T);for(let _=0;_<R.length;_++){const A=R[_];this.lastEntities[A]={regex:new RegExp("&"+A+";","g"),val:T[A]}}}function u(T,R,_,A,$,D,N){if(T!==void 0&&(this.options.trimValues&&!A&&(T=T.trim()),T.length>0)){N||(T=this.replaceEntitiesValue(T));const x=this.options.tagValueProcessor(R,T,_,$,D);return x==null?T:typeof x!=typeof T||x!==T?x:this.options.trimValues||T.trim()===T?S(T,this.options.parseTagValue,this.options.numberParseOptions):T}}function l(T){if(this.options.removeNSPrefix){const R=T.split(":"),_=T.charAt(0)==="/"?"/":"";if(R[0]==="xmlns")return"";R.length===2&&(T=_+R[1])}return T}const d=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function f(T,R,_){if(this.options.ignoreAttributes!==!0&&typeof T=="string"){const A=r.getAllMatches(T,d),$=A.length,D={};for(let N=0;N<$;N++){const x=this.resolveNameSpace(A[N][1]);if(this.ignoreAttributesFn(x,R))continue;let W=A[N][4],K=this.options.attributeNamePrefix+x;if(x.length)if(this.options.transformAttributeName&&(K=this.options.transformAttributeName(K)),K==="__proto__"&&(K="#__proto__"),W!==void 0){this.options.trimValues&&(W=W.trim()),W=this.replaceEntitiesValue(W);const le=this.options.attributeValueProcessor(x,W,R);D[K]=le==null?W:typeof le!=typeof W||le!==W?le:S(W,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(D[K]=!0)}if(!Object.keys(D).length)return;if(this.options.attributesGroupName){const N={};return N[this.options.attributesGroupName]=D,N}return D}}const m=function(T){T=T.replace(/\r\n?/g,`
41
+ `);const R=new o("!xml");let _=R,A="",$="";for(let D=0;D<T.length;D++)if(T[D]==="<")if(T[D+1]==="/"){const N=g(T,">",D,"Closing Tag is not closed.");let x=T.substring(D+2,N).trim();if(this.options.removeNSPrefix){const le=x.indexOf(":");le!==-1&&(x=x.substr(le+1))}this.options.transformTagName&&(x=this.options.transformTagName(x)),_&&(A=this.saveTextToParentTag(A,_,$));const W=$.substring($.lastIndexOf(".")+1);if(x&&this.options.unpairedTags.indexOf(x)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${x}>`);let K=0;W&&this.options.unpairedTags.indexOf(W)!==-1?(K=$.lastIndexOf(".",$.lastIndexOf(".")-1),this.tagsNodeStack.pop()):K=$.lastIndexOf("."),$=$.substring(0,K),_=this.tagsNodeStack.pop(),A="",D=N}else if(T[D+1]==="?"){let N=v(T,D,!1,"?>");if(!N)throw new Error("Pi Tag is not closed.");if(A=this.saveTextToParentTag(A,_,$),!(this.options.ignoreDeclaration&&N.tagName==="?xml"||this.options.ignorePiTags)){const x=new o(N.tagName);x.add(this.options.textNodeName,""),N.tagName!==N.tagExp&&N.attrExpPresent&&(x[":@"]=this.buildAttributesMap(N.tagExp,$,N.tagName)),this.addChild(_,x,$)}D=N.closeIndex+1}else if(T.substr(D+1,3)==="!--"){const N=g(T,"-->",D+4,"Comment is not closed.");if(this.options.commentPropName){const x=T.substring(D+4,N-2);A=this.saveTextToParentTag(A,_,$),_.add(this.options.commentPropName,[{[this.options.textNodeName]:x}])}D=N}else if(T.substr(D+1,2)==="!D"){const N=i(T,D);this.docTypeEntities=N.entities,D=N.i}else if(T.substr(D+1,2)==="!["){const N=g(T,"]]>",D,"CDATA is not closed.")-2,x=T.substring(D+9,N);A=this.saveTextToParentTag(A,_,$);let W=this.parseTextData(x,_.tagname,$,!0,!1,!0,!0);W==null&&(W=""),this.options.cdataPropName?_.add(this.options.cdataPropName,[{[this.options.textNodeName]:x}]):_.add(this.options.textNodeName,W),D=N+2}else{let N=v(T,D,this.options.removeNSPrefix),x=N.tagName;const W=N.rawTagName;let K=N.tagExp,le=N.attrExpPresent,be=N.closeIndex;this.options.transformTagName&&(x=this.options.transformTagName(x)),_&&A&&_.tagname!=="!xml"&&(A=this.saveTextToParentTag(A,_,$,!1));const te=_;if(te&&this.options.unpairedTags.indexOf(te.tagname)!==-1&&(_=this.tagsNodeStack.pop(),$=$.substring(0,$.lastIndexOf("."))),x!==R.tagname&&($+=$?"."+x:x),this.isItStopNode(this.options.stopNodes,$,x)){let ae="";if(K.length>0&&K.lastIndexOf("/")===K.length-1)x[x.length-1]==="/"?(x=x.substr(0,x.length-1),$=$.substr(0,$.length-1),K=x):K=K.substr(0,K.length-1),D=N.closeIndex;else if(this.options.unpairedTags.indexOf(x)!==-1)D=N.closeIndex;else{const ie=this.readStopNodeData(T,W,be+1);if(!ie)throw new Error(`Unexpected end of ${W}`);D=ie.i,ae=ie.tagContent}const ue=new o(x);x!==K&&le&&(ue[":@"]=this.buildAttributesMap(K,$,x)),ae&&(ae=this.parseTextData(ae,x,$,!0,le,!0,!0)),$=$.substr(0,$.lastIndexOf(".")),ue.add(this.options.textNodeName,ae),this.addChild(_,ue,$)}else{if(K.length>0&&K.lastIndexOf("/")===K.length-1){x[x.length-1]==="/"?(x=x.substr(0,x.length-1),$=$.substr(0,$.length-1),K=x):K=K.substr(0,K.length-1),this.options.transformTagName&&(x=this.options.transformTagName(x));const ae=new o(x);x!==K&&le&&(ae[":@"]=this.buildAttributesMap(K,$,x)),this.addChild(_,ae,$),$=$.substr(0,$.lastIndexOf("."))}else{const ae=new o(x);this.tagsNodeStack.push(_),x!==K&&le&&(ae[":@"]=this.buildAttributesMap(K,$,x)),this.addChild(_,ae,$),_=ae}A="",D=be}}else A+=T[D];return R.child};function w(T,R,_){const A=this.options.updateTag(R.tagname,_,R[":@"]);A===!1||(typeof A=="string"&&(R.tagname=A),T.addChild(R))}const y=function(T){if(this.options.processEntities){for(let R in this.docTypeEntities){const _=this.docTypeEntities[R];T=T.replace(_.regx,_.val)}for(let R in this.lastEntities){const _=this.lastEntities[R];T=T.replace(_.regex,_.val)}if(this.options.htmlEntities)for(let R in this.htmlEntities){const _=this.htmlEntities[R];T=T.replace(_.regex,_.val)}T=T.replace(this.ampEntity.regex,this.ampEntity.val)}return T};function E(T,R,_,A){return T&&(A===void 0&&(A=Object.keys(R.child).length===0),(T=this.parseTextData(T,R.tagname,_,!1,!!R[":@"]&&Object.keys(R[":@"]).length!==0,A))!==void 0&&T!==""&&R.add(this.options.textNodeName,T),T=""),T}function b(T,R,_){const A="*."+_;for(const $ in T){const D=T[$];if(A===D||R===D)return!0}return!1}function g(T,R,_,A){const $=T.indexOf(R,_);if($===-1)throw new Error(A);return $+R.length-1}function v(T,R,_){const A=function(le,be){let te,ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",ue="";for(let ie=be;ie<le.length;ie++){let G=le[ie];if(te)G===te&&(te="");else if(G==='"'||G==="'")te=G;else if(G===ae[0]){if(!ae[1])return{data:ue,index:ie};if(le[ie+1]===ae[1])return{data:ue,index:ie}}else G===" "&&(G=" ");ue+=G}}(T,R+1,arguments.length>3&&arguments[3]!==void 0?arguments[3]:">");if(!A)return;let $=A.data;const D=A.index,N=$.search(/\s/);let x=$,W=!0;N!==-1&&(x=$.substring(0,N),$=$.substring(N+1).trimStart());const K=x;if(_){const le=x.indexOf(":");le!==-1&&(x=x.substr(le+1),W=x!==A.data.substr(le+1))}return{tagName:x,tagExp:$,closeIndex:D,attrExpPresent:W,rawTagName:K}}function h(T,R,_){const A=_;let $=1;for(;_<T.length;_++)if(T[_]==="<")if(T[_+1]==="/"){const D=g(T,">",_,`${R} is not closed`);if(T.substring(_+2,D).trim()===R&&($--,$===0))return{tagContent:T.substring(A,_),i:D};_=D}else if(T[_+1]==="?")_=g(T,"?>",_+1,"StopNode is not closed.");else if(T.substr(_+1,3)==="!--")_=g(T,"-->",_+3,"StopNode is not closed.");else if(T.substr(_+1,2)==="![")_=g(T,"]]>",_,"StopNode is not closed.")-2;else{const D=v(T,_,">");D&&((D&&D.tagName)===R&&D.tagExp[D.tagExp.length-1]!=="/"&&$++,_=D.closeIndex)}}function S(T,R,_){if(R&&typeof T=="string"){const A=T.trim();return A==="true"||A!=="false"&&s(T,_)}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,_)=>String.fromCharCode(Number.parseInt(_,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(R,_)=>String.fromCharCode(Number.parseInt(_,16))}},this.addExternalEntities=c,this.parseXml=m,this.parseTextData=u,this.resolveNameSpace=l,this.buildAttributesMap=f,this.isItStopNode=b,this.replaceEntitiesValue=y,this.readStopNodeData=h,this.saveTextToParentTag=E,this.addChild=w,this.ignoreAttributesFn=a(this.options.ignoreAttributes)}}},338:(e,t,n)=>{const{buildOptions:r}=n(63),o=n(299),{prettify:i}=n(728),s=n(31);e.exports=class{constructor(a){this.externalEntities={},this.options=r(a)}parse(a,c){if(typeof a!="string"){if(!a.toString)throw new Error("XML data is accepted in String or Bytes[] form.");a=a.toString()}if(c){c===!0&&(c={});const d=s.validate(a,c);if(d!==!0)throw Error(`${d.err.msg}:${d.err.line}:${d.err.col}`)}const u=new o(this.options);u.addExternalEntities(this.externalEntities);const l=u.parseXml(a);return this.options.preserveOrder||l===void 0?l:i(l,this.options)}addEntity(a,c){if(c.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(c==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[a]=c}}},728:(e,t)=>{function n(s,a,c){let u;const l={};for(let d=0;d<s.length;d++){const f=s[d],m=r(f);let w="";if(w=c===void 0?m:c+"."+m,m===a.textNodeName)u===void 0?u=f[m]:u+=""+f[m];else{if(m===void 0)continue;if(f[m]){let y=n(f[m],a,w);const E=i(y,a);f[":@"]?o(y,f[":@"],w,a):Object.keys(y).length!==1||y[a.textNodeName]===void 0||a.alwaysCreateTextNode?Object.keys(y).length===0&&(a.alwaysCreateTextNode?y[a.textNodeName]="":y=""):y=y[a.textNodeName],l[m]!==void 0&&l.hasOwnProperty(m)?(Array.isArray(l[m])||(l[m]=[l[m]]),l[m].push(y)):a.isArray(m,w,E)?l[m]=[y]:l[m]=y}}}return typeof u=="string"?u.length>0&&(l[a.textNodeName]=u):u!==void 0&&(l[a.textNodeName]=u),l}function r(s){const a=Object.keys(s);for(let c=0;c<a.length;c++){const u=a[c];if(u!==":@")return u}}function o(s,a,c,u){if(a){const l=Object.keys(a),d=l.length;for(let f=0;f<d;f++){const m=l[f];u.isArray(m,c+"."+m,!0,!0)?s[m]=[a[m]]:s[m]=a[m]}}}function i(s,a){const{textNodeName:c}=a,u=Object.keys(s).length;return u===0||!(u!==1||!s[c]&&typeof s[c]!="boolean"&&s[c]!==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),o=n(526).utf8,i=n(135),s=n(526).bin,a=function(c,u){c.constructor==String?c=u&&u.encoding==="binary"?s.stringToBytes(c):o.stringToBytes(c):i(c)?c=Array.prototype.slice.call(c,0):Array.isArray(c)||c.constructor===Uint8Array||(c=c.toString());for(var l=r.bytesToWords(c),d=8*c.length,f=1732584193,m=-271733879,w=-1732584194,y=271733878,E=0;E<l.length;E++)l[E]=16711935&(l[E]<<8|l[E]>>>24)|4278255360&(l[E]<<24|l[E]>>>8);l[d>>>5]|=128<<d%32,l[14+(d+64>>>9<<4)]=d;var b=a._ff,g=a._gg,v=a._hh,h=a._ii;for(E=0;E<l.length;E+=16){var S=f,T=m,R=w,_=y;f=b(f,m,w,y,l[E+0],7,-680876936),y=b(y,f,m,w,l[E+1],12,-389564586),w=b(w,y,f,m,l[E+2],17,606105819),m=b(m,w,y,f,l[E+3],22,-1044525330),f=b(f,m,w,y,l[E+4],7,-176418897),y=b(y,f,m,w,l[E+5],12,1200080426),w=b(w,y,f,m,l[E+6],17,-1473231341),m=b(m,w,y,f,l[E+7],22,-45705983),f=b(f,m,w,y,l[E+8],7,1770035416),y=b(y,f,m,w,l[E+9],12,-1958414417),w=b(w,y,f,m,l[E+10],17,-42063),m=b(m,w,y,f,l[E+11],22,-1990404162),f=b(f,m,w,y,l[E+12],7,1804603682),y=b(y,f,m,w,l[E+13],12,-40341101),w=b(w,y,f,m,l[E+14],17,-1502002290),f=g(f,m=b(m,w,y,f,l[E+15],22,1236535329),w,y,l[E+1],5,-165796510),y=g(y,f,m,w,l[E+6],9,-1069501632),w=g(w,y,f,m,l[E+11],14,643717713),m=g(m,w,y,f,l[E+0],20,-373897302),f=g(f,m,w,y,l[E+5],5,-701558691),y=g(y,f,m,w,l[E+10],9,38016083),w=g(w,y,f,m,l[E+15],14,-660478335),m=g(m,w,y,f,l[E+4],20,-405537848),f=g(f,m,w,y,l[E+9],5,568446438),y=g(y,f,m,w,l[E+14],9,-1019803690),w=g(w,y,f,m,l[E+3],14,-187363961),m=g(m,w,y,f,l[E+8],20,1163531501),f=g(f,m,w,y,l[E+13],5,-1444681467),y=g(y,f,m,w,l[E+2],9,-51403784),w=g(w,y,f,m,l[E+7],14,1735328473),f=v(f,m=g(m,w,y,f,l[E+12],20,-1926607734),w,y,l[E+5],4,-378558),y=v(y,f,m,w,l[E+8],11,-2022574463),w=v(w,y,f,m,l[E+11],16,1839030562),m=v(m,w,y,f,l[E+14],23,-35309556),f=v(f,m,w,y,l[E+1],4,-1530992060),y=v(y,f,m,w,l[E+4],11,1272893353),w=v(w,y,f,m,l[E+7],16,-155497632),m=v(m,w,y,f,l[E+10],23,-1094730640),f=v(f,m,w,y,l[E+13],4,681279174),y=v(y,f,m,w,l[E+0],11,-358537222),w=v(w,y,f,m,l[E+3],16,-722521979),m=v(m,w,y,f,l[E+6],23,76029189),f=v(f,m,w,y,l[E+9],4,-640364487),y=v(y,f,m,w,l[E+12],11,-421815835),w=v(w,y,f,m,l[E+15],16,530742520),f=h(f,m=v(m,w,y,f,l[E+2],23,-995338651),w,y,l[E+0],6,-198630844),y=h(y,f,m,w,l[E+7],10,1126891415),w=h(w,y,f,m,l[E+14],15,-1416354905),m=h(m,w,y,f,l[E+5],21,-57434055),f=h(f,m,w,y,l[E+12],6,1700485571),y=h(y,f,m,w,l[E+3],10,-1894986606),w=h(w,y,f,m,l[E+10],15,-1051523),m=h(m,w,y,f,l[E+1],21,-2054922799),f=h(f,m,w,y,l[E+8],6,1873313359),y=h(y,f,m,w,l[E+15],10,-30611744),w=h(w,y,f,m,l[E+6],15,-1560198380),m=h(m,w,y,f,l[E+13],21,1309151649),f=h(f,m,w,y,l[E+4],6,-145523070),y=h(y,f,m,w,l[E+11],10,-1120210379),w=h(w,y,f,m,l[E+2],15,718787259),m=h(m,w,y,f,l[E+9],21,-343485551),f=f+S>>>0,m=m+T>>>0,w=w+R>>>0,y=y+_>>>0}return r.endian([f,m,w,y])};a._ff=function(c,u,l,d,f,m,w){var y=c+(u&l|~u&d)+(f>>>0)+w;return(y<<m|y>>>32-m)+u},a._gg=function(c,u,l,d,f,m,w){var y=c+(u&d|l&~d)+(f>>>0)+w;return(y<<m|y>>>32-m)+u},a._hh=function(c,u,l,d,f,m,w){var y=c+(u^l^d)+(f>>>0)+w;return(y<<m|y>>>32-m)+u},a._ii=function(c,u,l,d,f,m,w){var y=c+(l^(u|~d))+(f>>>0)+w;return(y<<m|y>>>32-m)+u},a._blocksize=16,a._digestsize=16,e.exports=function(c,u){if(c==null)throw new Error("Illegal argument "+c);var l=r.wordsToBytes(a(c,u));return u&&u.asBytes?l:u&&u.asString?s.bytesToString(l):r.bytesToHex(l)}})()},285:(e,t,n)=>{var r=n(2);e.exports=function(b){return b?(b.substr(0,2)==="{}"&&(b="\\{\\}"+b.substr(2)),E(function(g){return g.split("\\\\").join(o).split("\\{").join(i).split("\\}").join(s).split("\\,").join(a).split("\\.").join(c)}(b),!0).map(l)):[]};var o="\0SLASH"+Math.random()+"\0",i="\0OPEN"+Math.random()+"\0",s="\0CLOSE"+Math.random()+"\0",a="\0COMMA"+Math.random()+"\0",c="\0PERIOD"+Math.random()+"\0";function u(b){return parseInt(b,10)==b?parseInt(b,10):b.charCodeAt(0)}function l(b){return b.split(o).join("\\").split(i).join("{").split(s).join("}").split(a).join(",").split(c).join(".")}function d(b){if(!b)return[""];var g=[],v=r("{","}",b);if(!v)return b.split(",");var h=v.pre,S=v.body,T=v.post,R=h.split(",");R[R.length-1]+="{"+S+"}";var _=d(T);return T.length&&(R[R.length-1]+=_.shift(),R.push.apply(R,_)),g.push.apply(g,R),g}function f(b){return"{"+b+"}"}function m(b){return/^-?0\d/.test(b)}function w(b,g){return b<=g}function y(b,g){return b>=g}function E(b,g){var v=[],h=r("{","}",b);if(!h)return[b];var S=h.pre,T=h.post.length?E(h.post,!1):[""];if(/\$$/.test(h.pre))for(var R=0;R<T.length;R++){var _=S+"{"+h.body+"}"+T[R];v.push(_)}else{var A,$,D=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(h.body),N=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(h.body),x=D||N,W=h.body.indexOf(",")>=0;if(!x&&!W)return h.post.match(/,.*\}/)?E(b=h.pre+"{"+h.body+s+h.post):[b];if(x)A=h.body.split(/\.\./);else if((A=d(h.body)).length===1&&(A=E(A[0],!1).map(f)).length===1)return T.map(function(ee){return h.pre+A[0]+ee});if(x){var K=u(A[0]),le=u(A[1]),be=Math.max(A[0].length,A[1].length),te=A.length==3?Math.abs(u(A[2])):1,ae=w;le<K&&(te*=-1,ae=y);var ue=A.some(m);$=[];for(var ie=K;ae(ie,le);ie+=te){var G;if(N)(G=String.fromCharCode(ie))==="\\"&&(G="");else if(G=String(ie),ue){var re=be-G.length;if(re>0){var se=new Array(re+1).join("0");G=ie<0?"-"+se+G.slice(1):se+G}}$.push(G)}}else{$=[];for(var Ie=0;Ie<A.length;Ie++)$.push.apply($,E(A[Ie],!1))}for(Ie=0;Ie<$.length;Ie++)for(R=0;R<T.length;R++)_=S+$[Ie]+T[R],(!g||x||_)&&v.push(_)}return v}},829:e=>{function t(u){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},t(u)}function n(u){var l=typeof Map=="function"?new Map:void 0;return n=function(d){if(d===null||(f=d,Function.toString.call(f).indexOf("[native code]")===-1))return d;var f;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(l!==void 0){if(l.has(d))return l.get(d);l.set(d,m)}function m(){return r(d,arguments,i(this).constructor)}return m.prototype=Object.create(d.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),o(m,d)},n(u)}function r(u,l,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(f,m,w){var y=[null];y.push.apply(y,m);var E=new(Function.bind.apply(f,y));return w&&o(E,w.prototype),E},r.apply(null,arguments)}function o(u,l){return o=Object.setPrototypeOf||function(d,f){return d.__proto__=f,d},o(u,l)}function i(u){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(l){return l.__proto__||Object.getPrototypeOf(l)},i(u)}var s=function(u){function l(d){var f;return function(m,w){if(!(m instanceof w))throw new TypeError("Cannot call a class as a function")}(this,l),(f=function(m,w){return!w||t(w)!=="object"&&typeof w!="function"?function(y){if(y===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y}(m):w}(this,i(l).call(this,d))).name="ObjectPrototypeMutationError",f}return function(d,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(f&&f.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),f&&o(d,f)}(l,u),l}(n(Error));function a(u,l){for(var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},f=l.split("."),m=f.length,w=function(b){var g=f[b];if(!u)return{v:void 0};if(g==="+"){if(Array.isArray(u))return{v:u.map(function(h,S){var T=f.slice(b+1);return T.length>0?a(h,T.join("."),d):d(u,S,f,b)})};var v=f.slice(0,b).join(".");throw new Error("Object at wildcard (".concat(v,") is not an array"))}u=d(u,g,f,b)},y=0;y<m;y++){var E=w(y);if(t(E)==="object")return E.v}return u}function c(u,l){return u.length===l+1}e.exports={set:function(u,l,d){if(t(u)!="object"||u===null||l===void 0)return u;if(typeof l=="number")return u[l]=d,u[l];try{return a(u,l,function(f,m,w,y){if(f===Reflect.getPrototypeOf({}))throw new s("Attempting to mutate Object.prototype");if(!f[m]){var E=Number.isInteger(Number(w[y+1])),b=w[y+1]==="+";f[m]=E||b?[]:{}}return c(w,y)&&(f[m]=d),f[m]})}catch(f){if(f instanceof s)throw f;return u}},get:function(u,l){if(t(u)!="object"||u===null||l===void 0)return u;if(typeof l=="number")return u[l];try{return a(u,l,function(d,f){return d[f]})}catch{return u}},has:function(u,l){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(t(u)!="object"||u===null||l===void 0)return!1;if(typeof l=="number")return l in u;try{var f=!1;return a(u,l,function(m,w,y,E){if(!c(y,E))return m&&m[w];f=d.own?m.hasOwnProperty(w):w in m}),f}catch{return!1}},hasOwn:function(u,l,d){return this.has(u,l,d||{own:!0})},isIn:function(u,l,d){var f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(t(u)!="object"||u===null||l===void 0)return!1;try{var m=!1,w=!1;return a(u,l,function(y,E,b,g){return m=m||y===d||!!y&&y[E]===d,w=c(b,g)&&t(y)==="object"&&E in y,y&&y[E]}),f.validPath?m&&w:m}catch{return!1}},ObjectPrototypeMutationError:s}},47:(e,t,n)=>{var r=n(410),o=function(u){return typeof u=="string"};function i(u,l){for(var d=[],f=0;f<u.length;f++){var m=u[f];m&&m!=="."&&(m===".."?d.length&&d[d.length-1]!==".."?d.pop():l&&d.push(".."):d.push(m))}return d}var s=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a={};function c(u){return s.exec(u).slice(1)}a.resolve=function(){for(var u="",l=!1,d=arguments.length-1;d>=-1&&!l;d--){var f=d>=0?arguments[d]:ve.cwd();if(!o(f))throw new TypeError("Arguments to path.resolve must be strings");f&&(u=f+"/"+u,l=f.charAt(0)==="/")}return(l?"/":"")+(u=i(u.split("/"),!l).join("/"))||"."},a.normalize=function(u){var l=a.isAbsolute(u),d=u.substr(-1)==="/";return(u=i(u.split("/"),!l).join("/"))||l||(u="."),u&&d&&(u+="/"),(l?"/":"")+u},a.isAbsolute=function(u){return u.charAt(0)==="/"},a.join=function(){for(var u="",l=0;l<arguments.length;l++){var d=arguments[l];if(!o(d))throw new TypeError("Arguments to path.join must be strings");d&&(u+=u?"/"+d:d)}return a.normalize(u)},a.relative=function(u,l){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),l=a.resolve(l).substr(1);for(var f=d(u.split("/")),m=d(l.split("/")),w=Math.min(f.length,m.length),y=w,E=0;E<w;E++)if(f[E]!==m[E]){y=E;break}var b=[];for(E=y;E<f.length;E++)b.push("..");return(b=b.concat(m.slice(y))).join("/")},a._makeLong=function(u){return u},a.dirname=function(u){var l=c(u),d=l[0],f=l[1];return d||f?(f&&(f=f.substr(0,f.length-1)),d+f):"."},a.basename=function(u,l){var d=c(u)[2];return l&&d.substr(-1*l.length)===l&&(d=d.substr(0,d.length-l.length)),d},a.extname=function(u){return c(u)[3]},a.format=function(u){if(!r.isObject(u))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof u);var l=u.root||"";if(!o(l))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(!o(u))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof u);var l=c(u);if(!l||l.length!==4)throw new TypeError("Invalid path '"+u+"'");return l[1]=l[1]||"",l[2]=l[2]||"",l[3]=l[3]||"",{root:l[0],dir:l[0]+l[1].slice(0,l[1].length-1),base:l[2],ext:l[3],name:l[2].slice(0,l[2].length-l[3].length)}},a.sep="/",a.delimiter=":",e.exports=a},647:(e,t)=>{var n=Object.prototype.hasOwnProperty;function r(i){try{return decodeURIComponent(i.replace(/\+/g," "))}catch{return null}}function o(i){try{return encodeURIComponent(i)}catch{return null}}t.stringify=function(i,s){s=s||"";var a,c,u=[];for(c in typeof s!="string"&&(s="?"),i)if(n.call(i,c)){if((a=i[c])||a!=null&&!isNaN(a)||(a=""),c=o(c),a=o(a),c===null||a===null)continue;u.push(c+"="+a)}return u.length?s+u.join("&"):""},t.parse=function(i){for(var s,a=/([^=?#&]+)=?([^&]*)/g,c={};s=a.exec(i);){var u=r(s[1]),l=r(s[2]);u===null||l===null||u in c||(c[u]=l)}return c}},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(o){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(i=Object.assign({},r,i),!o||typeof o!="string")return o;let s=o.trim();if(i.skipLike!==void 0&&i.skipLike.test(s))return o;if(i.hex&&t.test(s))return Number.parseInt(s,16);{const c=n.exec(s);if(c){const u=c[1],l=c[2];let d=((a=c[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 f=c[4]||c[6];if(!i.leadingZeros&&l.length>0&&u&&s[2]!=="."||!i.leadingZeros&&l.length>0&&!u&&s[1]!==".")return o;{const m=Number(s),w=""+m;return w.search(/[eE]/)!==-1||f?i.eNotation?m:o:s.indexOf(".")!==-1?w==="0"&&d===""||w===d||u&&w==="-"+d?m:o:l?d===w||u+d===w?m:o:s===w||s===u+w?m:o}}return o}var a}},737:(e,t,n)=>{var r=n(670),o=n(647),i=/^[\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+-.]*:\/\//,c=/:\d+$/,u=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,l=/^[a-zA-Z]:/;function d(g){return(g||"").toString().replace(i,"")}var f=[["#","hash"],["?","query"],function(g,v){return y(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 w(g){var v,h=(typeof window<"u"?window:typeof Dr<"u"?Dr:typeof self<"u"?self:{}).location||{},S={},T=typeof(g=g||h);if(g.protocol==="blob:")S=new b(unescape(g.pathname),{});else if(T==="string")for(v in S=new b(g,{}),m)delete S[v];else if(T==="object"){for(v in g)v in m||(S[v]=g[v]);S.slashes===void 0&&(S.slashes=a.test(g.href))}return S}function y(g){return g==="file:"||g==="ftp:"||g==="http:"||g==="https:"||g==="ws:"||g==="wss:"}function E(g,v){g=(g=d(g)).replace(s,""),v=v||{};var h,S=u.exec(g),T=S[1]?S[1].toLowerCase():"",R=!!S[2],_=!!S[3],A=0;return R?_?(h=S[2]+S[3]+S[4],A=S[2].length+S[3].length):(h=S[2]+S[4],A=S[2].length):_?(h=S[3]+S[4],A=S[3].length):h=S[4],T==="file:"?A>=2&&(h=h.slice(2)):y(T)?h=S[4]:T?R&&(h=h.slice(2)):A>=2&&y(v.protocol)&&(h=S[4]),{protocol:T,slashes:R||y(T),slashesCount:A,rest:h}}function b(g,v,h){if(g=(g=d(g)).replace(s,""),!(this instanceof b))return new b(g,v,h);var S,T,R,_,A,$,D=f.slice(),N=typeof v,x=this,W=0;for(N!=="object"&&N!=="string"&&(h=v,v=null),h&&typeof h!="function"&&(h=o.parse),S=!(T=E(g||"",v=w(v))).protocol&&!T.slashes,x.slashes=T.slashes||S&&v.slashes,x.protocol=T.protocol||v.protocol||"",g=T.rest,(T.protocol==="file:"&&(T.slashesCount!==2||l.test(g))||!T.slashes&&(T.protocol||T.slashesCount<2||!y(x.protocol)))&&(D[3]=[/(.*)/,"pathname"]);W<D.length;W++)typeof(_=D[W])!="function"?(R=_[0],$=_[1],R!=R?x[$]=g:typeof R=="string"?~(A=R==="@"?g.lastIndexOf(R):g.indexOf(R))&&(typeof _[2]=="number"?(x[$]=g.slice(0,A),g=g.slice(A+_[2])):(x[$]=g.slice(A),g=g.slice(0,A))):(A=R.exec(g))&&(x[$]=A[1],g=g.slice(0,A.index)),x[$]=x[$]||S&&_[3]&&v[$]||"",_[4]&&(x[$]=x[$].toLowerCase())):g=_(g,x);h&&(x.query=h(x.query)),S&&v.slashes&&x.pathname.charAt(0)!=="/"&&(x.pathname!==""||v.pathname!=="")&&(x.pathname=function(K,le){if(K==="")return le;for(var be=(le||"/").split("/").slice(0,-1).concat(K.split("/")),te=be.length,ae=be[te-1],ue=!1,ie=0;te--;)be[te]==="."?be.splice(te,1):be[te]===".."?(be.splice(te,1),ie++):ie&&(te===0&&(ue=!0),be.splice(te,1),ie--);return ue&&be.unshift(""),ae!=="."&&ae!==".."||be.push(""),be.join("/")}(x.pathname,v.pathname)),x.pathname.charAt(0)!=="/"&&y(x.protocol)&&(x.pathname="/"+x.pathname),r(x.port,x.protocol)||(x.host=x.hostname,x.port=""),x.username=x.password="",x.auth&&(~(A=x.auth.indexOf(":"))?(x.username=x.auth.slice(0,A),x.username=encodeURIComponent(decodeURIComponent(x.username)),x.password=x.auth.slice(A+1),x.password=encodeURIComponent(decodeURIComponent(x.password))):x.username=encodeURIComponent(decodeURIComponent(x.auth)),x.auth=x.password?x.username+":"+x.password:x.username),x.origin=x.protocol!=="file:"&&y(x.protocol)&&x.host?x.protocol+"//"+x.host:"null",x.href=x.toString()}b.prototype={set:function(g,v,h){var S=this;switch(g){case"query":typeof v=="string"&&v.length&&(v=(h||o.parse)(v)),S[g]=v;break;case"port":S[g]=v,r(v,S.protocol)?v&&(S.host=S.hostname+":"+v):(S.host=S.hostname,S[g]="");break;case"hostname":S[g]=v,S.port&&(v+=":"+S.port),S.host=v;break;case"host":S[g]=v,c.test(v)?(v=v.split(":"),S.port=v.pop(),S.hostname=v.join(":")):(S.hostname=v,S.port="");break;case"protocol":S.protocol=v.toLowerCase(),S.slashes=!h;break;case"pathname":case"hash":if(v){var T=g==="pathname"?"/":"#";S[g]=v.charAt(0)!==T?T+v:v}else S[g]=v;break;case"username":case"password":S[g]=encodeURIComponent(v);break;case"auth":var R=v.indexOf(":");~R?(S.username=v.slice(0,R),S.username=encodeURIComponent(decodeURIComponent(S.username)),S.password=v.slice(R+1),S.password=encodeURIComponent(decodeURIComponent(S.password))):S.username=encodeURIComponent(decodeURIComponent(v))}for(var _=0;_<f.length;_++){var A=f[_];A[4]&&(S[A[1]]=S[A[1]].toLowerCase())}return S.auth=S.password?S.username+":"+S.password:S.username,S.origin=S.protocol!=="file:"&&y(S.protocol)&&S.host?S.protocol+"//"+S.host:"null",S.href=S.toString(),S},toString:function(g){g&&typeof g=="function"||(g=o.stringify);var v,h=this,S=h.host,T=h.protocol;T&&T.charAt(T.length-1)!==":"&&(T+=":");var R=T+(h.protocol&&h.slashes||y(h.protocol)?"//":"");return h.username?(R+=h.username,h.password&&(R+=":"+h.password),R+="@"):h.password?(R+=":"+h.password,R+="@"):h.protocol!=="file:"&&y(h.protocol)&&!S&&h.pathname!=="/"&&(R+="@"),(S[S.length-1]===":"||c.test(h.hostname)&&!h.port)&&(S+=":"),R+=S+h.pathname,(v=typeof h.query=="object"?g(h.query):h.query)&&(R+=v.charAt(0)!=="?"?"?"+v:v),h.hash&&(R+=h.hash),R}},b.extractProtocol=E,b.location=w,b.trimLeft=d,b.qs=o,e.exports=b},410:()=>{},388:()=>{},805:()=>{},345:()=>{},800:()=>{}},Qm={};function mt(e){var t=Qm[e];if(t!==void 0)return t.exports;var n=Qm[e]={id:e,loaded:!1,exports:{}};return RR[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:()=>bn,O4:()=>Sr,Kd:()=>NR,YK:()=>$R,UU:()=>U_,Gu:()=>sy,ky:()=>Ey,h4:()=>So,ch:()=>Bs,hq:()=>ri,i5:()=>Ty});var _R=mt(737),IR=mt.n(_R);function Mu(e){if(!Bu(e))throw new Error("Parameter was not an error")}function Bu(e){return!!e&&typeof e=="object"&&(t=e,Object.prototype.toString.call(t)==="[object Error]")||e instanceof Error;var t}class yn extends Error{constructor(t,n){const r=[...arguments],{options:o,shortMessage:i}=function(a){let c,u="";if(a.length===0)c={};else if(Bu(a[0]))c={cause:a[0]},u=a.slice(1).join(" ")||"";else if(a[0]&&typeof a[0]=="object")c=Object.assign({},a[0]),u=a.slice(1).join(" ")||"";else{if(typeof a[0]!="string")throw new Error("Invalid arguments passed to Layerr");c={},u=u=a.join(" ")||""}return{options:c,shortMessage:u}}(r);let s=i;if(o.cause&&(s=`${s}: ${o.cause.message}`),super(s),this.message=s,o.name&&typeof o.name=="string"?this.name=o.name:this.name="Layerr",o.cause&&Object.defineProperty(this,"_cause",{value:o.cause}),Object.defineProperty(this,"_info",{value:{}}),o.info&&typeof o.info=="object"&&Object.assign(this._info,o.info),Error.captureStackTrace){const a=o.constructorOpt||this.constructor;Error.captureStackTrace(this,a)}}static cause(t){return Mu(t),t._cause&&Bu(t._cause)?t._cause:null}static fullStack(t){Mu(t);const n=yn.cause(t);return n?`${t.stack}
42
+ caused by: ${yn.fullStack(n)}`:t.stack??""}static info(t){Mu(t);const n={},r=yn.cause(t);return r&&Object.assign(n,yn.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 CR=mt(47),Os=mt.n(CR);const Xm="__PATH_SEPARATOR_POSIX__",Ym="__PATH_SEPARATOR_WINDOWS__";function kt(e){try{const t=e.replace(/\//g,Xm).replace(/\\\\/g,Ym);return encodeURIComponent(t).split(Ym).join("\\\\").split(Xm).join("/")}catch(t){throw new yn(t,"Failed encoding path")}}function Jm(e){return e.startsWith("/")?e:"/"+e}function yo(e){let t=e;return t[0]!=="/"&&(t="/"+t),/^.+\/$/.test(t)&&(t=t.substr(0,t.length-1)),t}function PR(e){let t=new(IR())(e).pathname;return t.length<=0&&(t="/"),yo(t)}function xt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){return function(r){var o=[];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 i=r.shift();r[0]=i+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(/[\/]+$/,"/"),o.push(a))}var c=o.join("/"),u=(c=c.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return u.shift()+(u.length>0?"?":"")+u.join("&")}(typeof arguments[0]=="object"?arguments[0]:[].slice.call(arguments))}(t.reduce((r,o,i)=>((i===0||o!=="/"||o==="/"&&r[r.length-1]!=="/")&&r.push(o),r),[]))}var FR=mt(542),bo=mt.n(FR);const OR="abcdef0123456789";function Zm(e,t){const n=e.url.replace("//",""),r=n.indexOf("/")==-1?"/":n.slice(n.indexOf("/")),o=e.method?e.method.toUpperCase():"GET",i=!!/(^|,)\s*auth\s*($|,)/.test(t.qop)&&"auth",s=`00000000${t.nc}`.slice(-8),a=function(f,m,w,y,E,b,g){const v=g||bo()(`${m}:${w}:${y}`);return f&&f.toLowerCase()==="md5-sess"?bo()(`${v}:${E}:${b}`):v}(t.algorithm,t.username,t.realm,t.password,t.nonce,t.cnonce,t.ha1),c=bo()(`${o}:${r}`),u=i?bo()(`${a}:${t.nonce}:${s}:${t.cnonce}:${i}:${c}`):bo()(`${a}:${t.nonce}:${c}`),l={username:t.username,realm:t.realm,nonce:t.nonce,uri:r,qop:i,response:u,nc:s,cnonce:t.cnonce,algorithm:t.algorithm,opaque:t.opaque},d=[];for(const f in l)l[f]&&(f==="qop"||f==="nc"||f==="algorithm"?d.push(`${f}=${l[f]}`):d.push(`${f}="${l[f]}"`));return`Digest ${d.join(", ")}`}function ey(e){return(e.headers&&e.headers.get("www-authenticate")||"").split(/\s/)[0].toLowerCase()==="digest"}var kR=mt(101),ty=mt.n(kR);function ny(e){return ty().decode(e)}function ry(e,t){var n;return`Basic ${n=`${e}:${t}`,ty().encode(n)}`}const ks=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis,xR=ks.fetch.bind(ks),NR=ks.Request,$R=ks.Response;let bn=function(e){return e.Auto="auto",e.Digest="digest",e.None="none",e.Password="password",e.Token="token",e}({}),Sr=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 iy(e,t,n,r,o){switch(e.authType){case bn.Auto:t&&n&&(e.headers.Authorization=ry(t,n));break;case bn.Digest:e.digest=function(s,a,c){return{username:s,password:a,ha1:c,nc:0,algorithm:"md5",hasDigestAuth:!1}}(t,n,o);break;case bn.None:break;case bn.Password:e.headers.Authorization=ry(t,n);break;case bn.Token:e.headers.Authorization=`${(i=r).token_type} ${i.access_token}`;break;default:throw new yn({info:{code:Sr.InvalidAuthType}},`Invalid auth type: ${e.authType}`)}var i}mt(345),mt(800);const oy="@@HOTPATCHER",DR=()=>{};function ju(e){return{original:e,methods:[e],final:!1}}class LR{constructor(){this._configuration={registry:{},getEmptyAction:"null"},this.__type__=oy}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__!==oy)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)||DR;for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return n(...o)}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,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];if(o.length===0)throw new Error("Failed creating sequence: No functions provided");return function(){for(var s=arguments.length,a=new Array(s),c=0;c<s;c++)a[c]=arguments[c];let u=a;const l=this;for(;o.length>0;)u=[o.shift().apply(l,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:o=!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(o)this.configuration.registry[t]?this.configuration.registry[t].methods.push(n):this.configuration.registry[t]=ju(n);else if(this.isPatched(t)){const{original:i}=this.configuration.registry[t];this.configuration.registry[t]=Object.assign(ju(n),{original:i})}else this.configuration.registry[t]=ju(n);return this}patchInline(t,n){this.isPatched(t)||this.patch(t,n);for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];return this.execute(t,...o)}plugin(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 r.forEach(i=>{this.patch(t,i,{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 Uu=null;function sy(){return Uu||(Uu=new LR),Uu}function xs(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 ay(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];let r=null,o=[...t];for(;o.length>0;){const i=o.shift();r=r?ly(r,i):xs(i)}return r}function ly(e,t){const n=xs(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]?ly(n[r],t[r]):xs(t[r]):n[r]=t[r]:n[r]=t[r]}),n}function MR(e){const t={};for(const n of e.keys())t[n]=e.get(n);return t}function qu(){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((o,i)=>(Object.keys(i).forEach(s=>{const a=s.toLowerCase();r.hasOwnProperty(a)?o[r[a]]=i[s]:(r[a]=s,o[s]=i[s])}),o),{})}mt(805);const BR=typeof ArrayBuffer=="function",{toString:jR}=Object.prototype;function cy(e){return BR&&(e instanceof ArrayBuffer||jR.call(e)==="[object ArrayBuffer]")}function uy(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function Vu(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 zu(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const fy=Vu(function(e){const t=e._digest;return delete e._digest,t.hasDigestAuth&&(e=ay(e,{headers:{Authorization:Zm(e,t)}})),zu(Ns(e),function(n){let r=!1;return o=function(s){return r?s:n},(i=function(){if(n.status==401)return t.hasDigestAuth=function(s,a){if(!ey(s))return!1;const c=/([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi;for(;;){const u=s.headers&&s.headers.get("www-authenticate")||"",l=c.exec(u);if(!l)break;a[l[1]]=l[2]||l[3]}return a.nc+=1,a.cnonce=function(){let u="";for(let l=0;l<32;++l)u=`${u}${OR[Math.floor(16*Math.random())]}`;return u}(),!0}(n,t),function(){if(t.hasDigestAuth)return zu(Ns(e=ay(e,{headers:{Authorization:Zm(e,t)}})),function(s){return s.status==401?t.hasDigestAuth=!1:t.nc++,r=!0,s})}();t.nc++}())&&i.then?i.then(o):o(i);var o,i})}),UR=Vu(function(e,t){return zu(Ns(e),function(n){return n.ok?(t.authType=bn.Password,n):n.status==401&&ey(n)?(t.authType=bn.Digest,iy(t,t.username,t.password,void 0,void 0),e._digest=t.digest,fy(e)):n})}),Qt=Vu(function(e,t){return t.authType===bn.Auto?UR(e,t):e._digest?fy(e):Ns(e)});function Xt(e,t,n){const r=xs(e);return r.headers=qu(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 Ns(e){const t=sy();return t.patchInline("request",n=>t.patchInline("fetch",xR,n.url,function(r){let o={};const i={method:r.method};if(r.headers&&(o=qu(o,r.headers)),r.data!==void 0){const[s,a]=function(c){if(typeof c=="string")return[c,{}];if(uy(c))return[c,{}];if(cy(c))return[c,{}];if(c&&typeof c=="object")return[JSON.stringify(c),{"content-type":"application/json"}];throw new Error("Unable to convert request body: Unexpected body type: "+typeof c)}(r.data);i.body=s,o=qu(o,a)}return r.signal&&(i.signal=r.signal),r.withCredentials&&(i.credentials="include"),i.headers=o,i}(n)),e)}var qR=mt(285);const $s=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},VR={"[: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]},vo=e=>e.replace(/[[\]\\-]/g,"\\$&"),dy=e=>e.join(""),zR=(e,t)=>{const n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");const r=[],o=[];let i=n+1,s=!1,a=!1,c=!1,u=!1,l=n,d="";e:for(;i<e.length;){const y=e.charAt(i);if(y!=="!"&&y!=="^"||i!==n+1){if(y==="]"&&s&&!c){l=i+1;break}if(s=!0,y!=="\\"||c){if(y==="["&&!c){for(const[E,[b,g,v]]of Object.entries(VR))if(e.startsWith(E,i)){if(d)return["$.",!1,e.length-n,!0];i+=E.length,v?o.push(b):r.push(b),a=a||g;continue e}}c=!1,d?(y>d?r.push(vo(d)+"-"+vo(y)):y===d&&r.push(vo(y)),d="",i++):e.startsWith("-]",i+1)?(r.push(vo(y+"-")),i+=2):e.startsWith("-",i+1)?(d=y,i+=2):(r.push(vo(y)),i++)}else c=!0,i++}else u=!0,i++}if(l<i)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])&&!u)return[(f=r[0].length===2?r[0].slice(-1):r[0],f.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,l-n,!1];var f;const m="["+(u?"^":"")+dy(r)+"]",w="["+(u?"":"^")+dy(o)+"]";return[r.length&&o.length?"("+m+"|"+w+")":r.length?m:w,a,l-n,!0]},wo=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")},WR=new Set(["!","?","+","*","@"]),py=e=>WR.has(e),Wu="(?!\\.)",HR=new Set(["[","."]),GR=new Set(["..","."]),KR=new Set("().*{}+?[]^$\\!"),Hu="[^/]",hy=Hu+"*?",gy=Hu+"+?",Sn=class Sn{constructor(t,n){_n(this,mi);Ee(this,"type");_n(this,Zt);_n(this,nn);_n(this,Pr,!1);_n(this,Pt,[]);_n(this,Wt);_n(this,Br);_n(this,hi);_n(this,jr,!1);_n(this,ar);_n(this,gi);_n(this,Do,!1);let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.type=t,t&&Ut(this,nn,!0),Ut(this,Wt,n),Ut(this,Zt,Oe(this,Wt)?Oe(Oe(this,Wt),Zt):this),Ut(this,ar,Oe(this,Zt)===this?r:Oe(Oe(this,Zt),ar)),Ut(this,hi,Oe(this,Zt)===this?[]:Oe(Oe(this,Zt),hi)),t!=="!"||Oe(Oe(this,Zt),jr)||Oe(this,hi).push(this),Ut(this,Br,Oe(this,Wt)?Oe(Oe(this,Wt),Pt).length:0)}get hasMagic(){if(Oe(this,nn)!==void 0)return Oe(this,nn);for(const t of Oe(this,Pt))if(typeof t!="string"&&(t.type||t.hasMagic))return Ut(this,nn,!0);return Oe(this,nn)}toString(){return Oe(this,gi)!==void 0?Oe(this,gi):this.type?Ut(this,gi,this.type+"("+Oe(this,Pt).map(t=>String(t)).join("|")+")"):Ut(this,gi,Oe(this,Pt).map(t=>String(t)).join(""))}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 Sn&&Oe(o,Wt)===this))throw new Error("invalid part: "+o);Oe(this,Pt).push(o)}}toJSON(){var n;const t=this.type===null?Oe(this,Pt).slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...Oe(this,Pt).map(r=>r.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===Oe(this,Zt)||Oe(Oe(this,Zt),jr)&&((n=Oe(this,Wt))==null?void 0:n.type)==="!")&&t.push({}),t}isStart(){var n;if(Oe(this,Zt)===this)return!0;if(!((n=Oe(this,Wt))!=null&&n.isStart()))return!1;if(Oe(this,Br)===0)return!0;const t=Oe(this,Wt);for(let r=0;r<Oe(this,Br);r++){const o=Oe(t,Pt)[r];if(!(o instanceof Sn&&o.type==="!"))return!1}return!0}isEnd(){var n,r,o;if(Oe(this,Zt)===this||((n=Oe(this,Wt))==null?void 0:n.type)==="!")return!0;if(!((r=Oe(this,Wt))!=null&&r.isEnd()))return!1;if(!this.type)return(o=Oe(this,Wt))==null?void 0:o.isEnd();const t=Oe(this,Wt)?Oe(Oe(this,Wt),Pt).length:0;return Oe(this,Br)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const n=new Sn(this.type,t);for(const r of Oe(this,Pt))n.copyIn(r);return n}static fromGlob(t){var o;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=new Sn(null,void 0,n);return qr(o=Sn,Ur,Aa).call(o,t,r,0,n),r}toMMPattern(){if(this!==Oe(this,Zt))return Oe(this,Zt).toMMPattern();const t=this.toString(),[n,r,o,i]=this.toRegExpSource();if(!(o||Oe(this,nn)||Oe(this,ar).nocase&&!Oe(this,ar).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;const s=(Oe(this,ar).nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${n}$`,s),{_src:n,_glob:t})}get options(){return Oe(this,ar)}toRegExpSource(t){var c;const n=t??!!Oe(this,ar).dot;if(Oe(this,Zt)===this&&qr(this,mi,H0).call(this),!this.type){const u=this.isStart()&&this.isEnd(),l=Oe(this,Pt).map(m=>{var g;const[w,y,E,b]=typeof m=="string"?qr(g=Sn,Ur,G0).call(g,m,Oe(this,nn),u):m.toRegExpSource(t);return Ut(this,nn,Oe(this,nn)||E),Ut(this,Pr,Oe(this,Pr)||b),w}).join("");let d="";if(this.isStart()&&typeof Oe(this,Pt)[0]=="string"&&(Oe(this,Pt).length!==1||!GR.has(Oe(this,Pt)[0]))){const m=HR,w=n&&m.has(l.charAt(0))||l.startsWith("\\.")&&m.has(l.charAt(2))||l.startsWith("\\.\\.")&&m.has(l.charAt(4)),y=!n&&!t&&m.has(l.charAt(0));d=w?"(?!(?:^|/)\\.\\.?(?:$|/))":y?Wu:""}let f="";return this.isEnd()&&Oe(Oe(this,Zt),jr)&&((c=Oe(this,Wt))==null?void 0:c.type)==="!"&&(f="(?:$|\\/)"),[d+l+f,wo(l),Ut(this,nn,!!Oe(this,nn)),Oe(this,Pr)]}const r=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:";let i=qr(this,mi,ud).call(this,n);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){const u=this.toString();return Ut(this,Pt,[u]),this.type=null,Ut(this,nn,void 0),[u,wo(this.toString()),!1,!1]}let s=!r||t||n?"":qr(this,mi,ud).call(this,!0);s===i&&(s=""),s&&(i=`(?:${i})(?:${s})*?`);let a="";return a=this.type==="!"&&Oe(this,Do)?(this.isStart()&&!n?Wu:"")+gy:o+i+(this.type==="!"?"))"+(!this.isStart()||n||t?"":Wu)+hy+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&s?")":this.type==="*"&&s?")?":`)${this.type}`),[a,wo(i),Ut(this,nn,!!Oe(this,nn)),Oe(this,Pr)]}};Zt=new WeakMap,nn=new WeakMap,Pr=new WeakMap,Pt=new WeakMap,Wt=new WeakMap,Br=new WeakMap,hi=new WeakMap,jr=new WeakMap,ar=new WeakMap,gi=new WeakMap,Do=new WeakMap,mi=new WeakSet,H0=function(){if(this!==Oe(this,Zt))throw new Error("should only call on root");if(Oe(this,jr))return this;let t;for(this.toString(),Ut(this,jr,!0);t=Oe(this,hi).pop();){if(t.type!=="!")continue;let n=t,r=Oe(n,Wt);for(;r;){for(let o=Oe(n,Br)+1;!r.type&&o<Oe(r,Pt).length;o++)for(const i of Oe(t,Pt)){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(Oe(r,Pt)[o])}n=r,r=Oe(n,Wt)}}return this},Ur=new WeakSet,Aa=function(t,n,r,o){var m,w;let i=!1,s=!1,a=-1,c=!1;if(n.type===null){let y=r,E="";for(;y<t.length;){const b=t.charAt(y++);if(i||b==="\\")i=!i,E+=b;else if(s)y===a+1?b!=="^"&&b!=="!"||(c=!0):b!=="]"||y===a+2&&c||(s=!1),E+=b;else if(b!=="[")if(o.noext||!py(b)||t.charAt(y)!=="(")E+=b;else{n.push(E),E="";const g=new Sn(b,n);y=qr(m=Sn,Ur,Aa).call(m,t,g,y,o),n.push(g)}else s=!0,a=y,c=!1,E+=b}return n.push(E),y}let u=r+1,l=new Sn(null,n);const d=[];let f="";for(;u<t.length;){const y=t.charAt(u++);if(i||y==="\\")i=!i,f+=y;else if(s)u===a+1?y!=="^"&&y!=="!"||(c=!0):y!=="]"||u===a+2&&c||(s=!1),f+=y;else if(y!=="[")if(py(y)&&t.charAt(u)==="("){l.push(f),f="";const E=new Sn(y,l);l.push(E),u=qr(w=Sn,Ur,Aa).call(w,t,E,u,o)}else if(y!=="|"){if(y===")")return f===""&&Oe(n,Pt).length===0&&Ut(n,Do,!0),l.push(f),f="",n.push(...d,l),u;f+=y}else l.push(f),f="",d.push(l),l=new Sn(null,n);else s=!0,a=u,c=!1,f+=y}return n.type=null,Ut(n,nn,void 0),Ut(n,Pt,[t.substring(r-1)]),u},ud=function(t){return Oe(this,Pt).map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");const[r,o,i,s]=n.toRegExpSource(t);return Ut(this,Pr,Oe(this,Pr)||s),r}).filter(n=>!(this.isStart()&&this.isEnd()&&!n)).join("|")},G0=function(t,n){let r=arguments.length>2&&arguments[2]!==void 0&&arguments[2],o=!1,i="",s=!1;for(let a=0;a<t.length;a++){const c=t.charAt(a);if(o)o=!1,i+=(KR.has(c)?"\\":"")+c;else if(c!=="\\"){if(c==="["){const[u,l,d,f]=zR(t,a);if(d){i+=u,s=s||l,a+=d-1,n=n||f;continue}}c!=="*"?c!=="?"?i+=c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):(i+=Hu,n=!0):(i+=r&&t==="*"?gy:hy,n=!0)}else a===t.length-1?i+="\\\\":o=!0}return[i,wo(t),!!n,s]},_n(Sn,Ur);let Ds=Sn;const cn=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return $s(t),!(!n.nocomment&&t.charAt(0)==="#")&&new Ls(t,n).match(e)},QR=/^\*+([^+@!?\*\[\(]*)$/,XR=e=>t=>!t.startsWith(".")&&t.endsWith(e),YR=e=>t=>t.endsWith(e),JR=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),ZR=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),e_=/^\*+\.\*+$/,t_=e=>!e.startsWith(".")&&e.includes("."),n_=e=>e!=="."&&e!==".."&&e.includes("."),r_=/^\.\*+$/,i_=e=>e!=="."&&e!==".."&&e.startsWith("."),o_=/^\*+$/,s_=e=>e.length!==0&&!e.startsWith("."),a_=e=>e.length!==0&&e!=="."&&e!=="..",l_=/^\?+([^+@!?\*\[\(]*)?$/,c_=e=>{let[t,n=""]=e;const r=my([t]);return n?(n=n.toLowerCase(),o=>r(o)&&o.toLowerCase().endsWith(n)):r},u_=e=>{let[t,n=""]=e;const r=yy([t]);return n?(n=n.toLowerCase(),o=>r(o)&&o.toLowerCase().endsWith(n)):r},f_=e=>{let[t,n=""]=e;const r=yy([t]);return n?o=>r(o)&&o.endsWith(n):r},d_=e=>{let[t,n=""]=e;const r=my([t]);return n?o=>r(o)&&o.endsWith(n):r},my=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&!r.startsWith(".")},yy=e=>{let[t]=e;const n=t.length;return r=>r.length===n&&r!=="."&&r!==".."},by=typeof ve=="object"&&ve?typeof ve.env=="object"&&ve.env&&ve.env.__MINIMATCH_TESTING_PLATFORM__||ve.platform:"posix";cn.sep=by==="win32"?"\\":"/";const Mn=Symbol("globstar **");cn.GLOBSTAR=Mn,cn.filter=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=>cn(n,e,t)};const Bn=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},e,t)};cn.defaults=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return cn;const t=cn;return Object.assign(function(n,r){return t(n,r,Bn(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))},{Minimatch:class extends t.Minimatch{constructor(n){super(n,Bn(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(n){return t.defaults(Bn(e,n)).Minimatch}},AST:class extends t.AST{constructor(n,r){super(n,r,Bn(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,Bn(e,r))}},unescape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(n,Bn(e,r))},escape:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(n,Bn(e,r))},filter:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(n,Bn(e,r))},defaults:n=>t.defaults(Bn(e,n)),makeRe:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(n,Bn(e,r))},braceExpand:function(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(n,Bn(e,r))},match:function(n,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(n,r,Bn(e,o))},sep:t.sep,GLOBSTAR:Mn})};const vy=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return $s(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:qR(e)};cn.braceExpand=vy,cn.makeRe=function(e){return new Ls(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},cn.match=function(e,t){const n=new Ls(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 wy=/[?*]|[+@!]\(.*?\)|\[|\]/;class Ls{constructor(t){Ee(this,"options");Ee(this,"set");Ee(this,"pattern");Ee(this,"windowsPathsNoEscape");Ee(this,"nonegate");Ee(this,"negate");Ee(this,"comment");Ee(this,"empty");Ee(this,"preserveMultipleSlashes");Ee(this,"partial");Ee(this,"globSet");Ee(this,"globParts");Ee(this,"nocase");Ee(this,"isWindows");Ee(this,"platform");Ee(this,"windowsNoMagicRoot");Ee(this,"regexp");let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};$s(t),n=n||{},this.options=n,this.pattern=t,this.platform=n.platform||by,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(i=>this.slashSplit(i));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let o=this.globParts.map((i,s,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){const c=!(i[0]!==""||i[1]!==""||i[2]!=="?"&&wy.test(i[2])||wy.test(i[3])),u=/^[a-z]:/i.test(i[0]);if(c)return[...i.slice(0,4),...i.slice(4).map(l=>this.parse(l))];if(u)return[i[0],...i.slice(1).map(l=>this.parse(l))]}return i.map(c=>this.parse(c))});if(this.debug(this.pattern,o),this.set=o.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){const s=this.set[i];s[0]===""&&s[1]===""&&this.globParts[i][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 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 i=r[r.length-1];return o==="**"&&i==="**"?r:o===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(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 i=t[o];o===1&&i===""&&t[0]===""||i!=="."&&i!==""||(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 s=o;for(;r[s+1]==="**";)s++;s>o&&r.splice(o+1,s-o);let a=r[o+1];const c=r[o+2],u=r[o+3];if(a!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;n=!0,r.splice(o,1);const l=r.slice(0);l[o]="**",t.push(l),o--}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 i=0;for(;(i=r.indexOf("..",i+1))!==-1;){const s=r[i-1];if(s&&s!=="."&&s!==".."&&s!=="**"){n=!0;const a=i===1&&r[i+1]==="**"?["."]:[];r.splice(i-1,2,...a),r.length===0&&r.push(""),i-=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,i=0,s=[],a="";for(;o<t.length&&i<n.length;)if(t[o]===n[i])s.push(a==="b"?n[i]:t[o]),o++,i++;else if(r&&t[o]==="**"&&n[i]===t[o+1])s.push(t[o]),o++;else if(r&&n[i]==="**"&&t[o]===n[i+1])s.push(n[i]),i++;else if(t[o]!=="*"||!n[i]||!this.options.dot&&n[i].startsWith(".")||n[i]==="**"){if(n[i]!=="*"||!t[o]||!this.options.dot&&t[o].startsWith(".")||t[o]==="**"||a==="a")return!1;a="b",s.push(n[i]),o++,i++}else{if(a==="b")return!1;a="a",s.push(t[o]),o++,i++}return t.length===n.length&&s}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 y=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),E=!y&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),b=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),g=E?3:y?0:void 0,v=!b&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])?3:b?0:void 0;if(typeof g=="number"&&typeof v=="number"){const[h,S]=[t[g],n[v]];h.toLowerCase()===S.toLowerCase()&&(n[v]=h,v>g?n=n.slice(v):g>v&&(t=t.slice(g)))}}const{optimizationLevel:i=1}=this.options;i>=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,c=t.length,u=n.length;s<c&&a<u;s++,a++){this.debug("matchOne loop");var l=n[a],d=t[s];if(this.debug(n,l,d),l===!1)return!1;if(l===Mn){this.debug("GLOBSTAR",[n,l,d]);var f=s,m=a+1;if(m===u){for(this.debug("** at the end");s<c;s++)if(t[s]==="."||t[s]===".."||!o.dot&&t[s].charAt(0)===".")return!1;return!0}for(;f<c;){var w=t[f];if(this.debug(`
43
+ globstar while`,t,f,n,m,w),this.matchOne(t.slice(f),n.slice(m),r))return this.debug("globstar found match!",f,c,w),!0;if(w==="."||w===".."||!o.dot&&w.charAt(0)==="."){this.debug("dot detected!",t,f,n,m);break}this.debug("globstar swallow a segment, and continue"),f++}return!(!r||(this.debug(`
44
+ >>> no match, partial?`,t,f,n,m),f!==c))}let y;if(typeof l=="string"?(y=d===l,this.debug("string match",l,d,y)):(y=l.test(d),this.debug("pattern match",l,d,y)),!y)return!1}if(s===c&&a===u)return!0;if(s===c)return r;if(a===u)return s===c-1&&t[s]==="";throw new Error("wtf?")}braceExpand(){return vy(this.pattern,this.options)}parse(t){$s(t);const n=this.options;if(t==="**")return Mn;if(t==="")return"";let r,o=null;(r=t.match(o_))?o=n.dot?a_:s_:(r=t.match(QR))?o=(n.nocase?n.dot?ZR:JR:n.dot?YR:XR)(r[1]):(r=t.match(l_))?o=(n.nocase?n.dot?u_:c_:n.dot?f_:d_)(r):(r=t.match(e_))?o=n.dot?n_:t_:(r=t.match(r_))&&(o=i_);const i=Ds.fromGlob(t,this.options).toMMPattern();return o&&typeof i=="object"&&Reflect.defineProperty(i,"test",{value:o}),i}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 i=t.map(c=>{const u=c.map(l=>{if(l instanceof RegExp)for(const d of l.flags.split(""))o.add(d);return typeof l=="string"?l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):l===Mn?Mn:l._src});return u.forEach((l,d)=>{const f=u[d+1],m=u[d-1];l===Mn&&m!==Mn&&(m===void 0?f!==void 0&&f!==Mn?u[d+1]="(?:\\/|"+r+"\\/)?"+f:u[d]=r:f===void 0?u[d-1]=m+"(?:\\/|"+r+")?":f!==Mn&&(u[d-1]=m+"(?:\\/|\\/"+r+"\\/)"+f,u[d+1]=Mn))}),u.filter(l=>l!==Mn).join("/")}).join("|");const[s,a]=t.length>1?["(?:",")"]:["",""];i="^"+s+i+a+"$",this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...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 i=this.set;this.debug(this.pattern,"set",i);let s=o[o.length-1];if(!s)for(let a=o.length-2;!s&&a>=0;a--)s=o[a];for(let a=0;a<i.length;a++){const c=i[a];let u=o;if(r.matchBase&&c.length===1&&(u=[s]),this.matchOne(u,c,n))return!!r.flipNegate||!this.negate}return!r.flipNegate&&this.negate}static defaults(t){return cn.defaults(t).Minimatch}}function Gu(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 Yt(e,t){const{status:n}=t;if(n===401&&e.digest)return t;if(n>=400)throw Gu(t);return t}function ri(e,t){return arguments.length>2&&arguments[2]!==void 0&&arguments[2]?{data:t,headers:e.headers?MR(e.headers):{},status:e.status,statusText:e.statusText}:t}cn.AST=Ds,cn.Minimatch=Ls,cn.escape=function(e){let{windowsPathsNoEscape:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")},cn.unescape=wo;const p_=(Sy=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=Xt({url:xt(e.remoteURL,kt(t)),method:"COPY",headers:{Destination:xt(e.remoteURL,kt(n)),Overwrite:r.overwrite===!1?"F":"T",Depth:r.shallow?"0":"infinity"}},e,r);return s=function(a){Yt(e,a)},(i=Qt(o,e))&&i.then||(i=Promise.resolve(i)),s?i.then(s):i;var i,s},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(Sy.apply(this,e))}catch(n){return Promise.reject(n)}});var Sy,Ku=mt(635),h_=mt(829),Er=mt.n(h_),Di=function(e){return e.Array="array",e.Object="object",e.Original="original",e}(Di||{});function Ms(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Di.Original;const r=Er().get(e,t);return n==="array"&&Array.isArray(r)===!1?[r]:n==="object"&&Array.isArray(r)?r[0]:r}function So(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 o={multistatus:Array.isArray(r)?r[0]:r};return Er().set(o,"multistatus.response",Ms(o,"multistatus.response",Di.Array)),Er().set(o,"multistatus.response",Er().get(o,"multistatus.response").map(i=>function(s){const a=Object.assign({},s);return a.status?Er().set(a,"status",Ms(a,"status",Di.Object)):(Er().set(a,"propstat",Ms(a,"propstat",Di.Object)),Er().set(a,"propstat.prop",Ms(a,"propstat.prop",Di.Object))),a}(i))),o}(new Ku.XMLParser({allowBooleanAttributes:!0,attributeNamePrefix:"",textNodeName:"text",ignoreAttributes:!1,removeNSPrefix:!0,numberParseOptions:{hex:!0,leadingZeros:!1},attributeValueProcessor:(n,r,o)=>r==="true"||r==="false"?r==="true":r,tagValueProcessor(n,r,o){if(!o.endsWith("propstat.prop.displayname"))return r}}).parse(e)))})}function Bs(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const{getlastmodified:r=null,getcontentlength:o="0",resourcetype:i=null,getcontenttype:s=null,getetag:a=null}=e,c=i&&typeof i=="object"&&i.collection!==void 0?"directory":"file",u={filename:t,basename:Os().basename(t),lastmod:r,size:parseInt(o,10),type:c,etag:typeof a=="string"?a.replace(/"/g,""):null};return c==="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 Ey(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:o,status:i}}=r,[s,a,c]=i.split(" ",3),u=parseInt(a,10);if(u>=400){const l=new Error(`Invalid response: ${u} ${c}`);throw l.status=u,l}return Bs(o,yo(t),n)}function Ty(e){switch(String(e)){case"-3":return"unlimited";case"-2":case"-1":return"unknown";default:return parseInt(String(e),10)}}function Qu(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const Xu=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,o=Xt({url:xt(e.remoteURL,kt(t)),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,n);return Qu(Qt(o,e),function(i){return Yt(e,i),Qu(i.text(),function(s){return Qu(So(s),function(a){const c=Ey(a,t,r);return ri(i,c,r)})})})});function Ay(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const g_=Ry(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=function(i){if(!i||i==="/")return[];let s=i;const a=[];do a.push(s),s=Os().dirname(s);while(s&&s!=="/");return a}(yo(t));r.sort((i,s)=>i.length>s.length?1:s.length>i.length?-1:0);let o=!1;return function(i,s,a){if(typeof i[Iy]=="function"){let y=function(E){try{for(;!(c=d.next()).done;)if((E=s(c.value))&&E.then){if(!Cy(E))return void E.then(y,l||(l=vn.bind(null,u=new Li,2)));E=E.v}u?vn(u,1,E):u=E}catch(b){vn(u||(u=new Li),2,b)}};var c,u,l,d=i[Iy]();if(y(),d.return){var f=function(E){try{c.done||d.return()}catch{}return E};if(u&&u.then)return u.then(f,function(E){throw f(E)});f()}return u}if(!("length"in i))throw new TypeError("Object is not iterable");for(var m=[],w=0;w<i.length;w++)m.push(i[w]);return function(y,E,b){var g,v,h=-1;return function S(T){try{for(;++h<y.length&&(!b||!b());)if((T=E(h))&&T.then){if(!Cy(T))return void T.then(S,v||(v=vn.bind(null,g=new Li,2)));T=T.v}g?vn(g,1,T):g=T}catch(R){vn(g||(g=new Li),2,R)}}(),g}(m,function(y){return s(m[y])},a)}(r,function(i){return s=function(){return function(c,u){try{var l=Ay(Xu(e,i),function(d){if(d.type!=="directory")throw new Error(`Path includes a file: ${t}`)})}catch(d){return u(d)}return l&&l.then?l.then(void 0,u):l}(0,function(c){const u=c;return function(){if(u.status===404)return o=!0,_y(Yu(e,i,{...n,recursive:!1}));throw c}()})},(a=function(){if(o)return _y(Yu(e,i,{...n,recursive:!1}))}())&&a.then?a.then(s):s();var s,a},function(){return!1})});function Ry(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 m_(){}function _y(e,t){return e&&e.then?e.then(m_):Promise.resolve()}const Iy=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function vn(e,t,n){if(!e.s){if(n instanceof Li){if(!n.s)return void(n.o=vn.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(vn.bind(null,e,t),vn.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}const Li=function(){function e(){}return e.prototype.then=function(t,n){const r=new e,o=this.s;if(o){const i=1&o?t:n;if(i){try{vn(r,1,i(this.v))}catch(s){vn(r,2,s)}return r}return this}return this.o=function(i){try{const s=i.v;1&i.s?vn(r,1,t?t(s):s):n?vn(r,1,n(s)):vn(r,2,s)}catch(s){vn(r,2,s)}},r},e}();function Cy(e){return e instanceof Li&&1&e.s}const Yu=Ry(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(n.recursive===!0)return g_(e,t,n);const r=Xt({url:xt(e.remoteURL,(o=kt(t),o.endsWith("/")?o:o+"/")),method:"MKCOL"},e,n);var o;return Ay(Qt(r,e),function(i){Yt(e,i)})});var y_=mt(388),Py=mt.n(y_);const b_=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 o=Xt({url:xt(e.remoteURL,kt(t)),method:"GET",headers:r},e,n);return s=function(a){if(Yt(e,a),r.Range&&a.status!==206){const c=new Error(`Invalid response code for partial request: ${a.status}`);throw c.status=a.status,c}return n.callback&&setTimeout(()=>{n.callback(a)},0),a.body},(i=Qt(o,e))&&i.then||(i=Promise.resolve(i)),s?i.then(s):i;var i,s}),v_=()=>{},w_=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=xt(e.remoteURL,kt(t)));const r=Xt(n,e,{});return i=function(s){return Yt(e,s),s},(o=Qt(r,e))&&o.then||(o=Promise.resolve(o)),i?o.then(i):o;var o,i}),S_=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=Xt({url:xt(e.remoteURL,kt(t)),method:"DELETE"},e,n);return i=function(s){Yt(e,s)},(o=Qt(r,e))&&o.then||(o=Promise.resolve(o)),i?o.then(i):o;var o,i}),E_=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,o){try{var i=(s=Xu(e,t,n),a=function(){return!0},c?a?a(s):s:(s&&s.then||(s=Promise.resolve(s)),a?s.then(a):s))}catch(u){return o(u)}var s,a,c;return i&&i.then?i.then(void 0,o):i}(0,function(r){if(r.status===404)return!1;throw r})});function Ju(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const T_=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=Xt({url:xt(e.remoteURL,kt(t),"/"),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:n.deep?"infinity":"1"}},e,n);return Ju(Qt(r,e),function(o){return Yt(e,o),Ju(o.text(),function(i){if(!i)throw new Error("Failed parsing directory contents: Empty response");return Ju(So(i),function(s){const a=Jm(t);let c=function(u,l,d){let f=arguments.length>3&&arguments[3]!==void 0&&arguments[3],m=arguments.length>4&&arguments[4]!==void 0&&arguments[4];const w=Os().join(l,"/"),{multistatus:{response:y}}=u,E=y.map(b=>{const g=function(h){try{return h.replace(/^https?:\/\/[^\/]+/,"")}catch(S){throw new yn(S,"Failed normalising HREF")}}(b.href),{propstat:{prop:v}}=b;return Bs(v,w==="/"?decodeURIComponent(yo(g)):yo(Os().relative(decodeURIComponent(w),decodeURIComponent(g))),f)});return m?E:E.filter(b=>b.basename&&(b.type==="file"||b.filename!==d.replace(/\/$/,"")))}(s,Jm(e.remoteBasePath||e.remotePath),a,n.details,n.includeSelf);return n.glob&&(c=function(u,l){return u.filter(d=>cn(d.filename,l,{matchBase:!0}))}(c,n.glob)),ri(o,c,n.details)})})})});function Zu(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 A_=Zu(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Xt({url:xt(e.remoteURL,kt(t)),method:"GET",headers:{Accept:"text/plain"},transformResponse:[I_]},e,n);return js(Qt(r,e),function(o){return Yt(e,o),js(o.text(),function(i){return ri(o,i,n.details)})})});function js(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const R_=Zu(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=Xt({url:xt(e.remoteURL,kt(t)),method:"GET"},e,n);return js(Qt(r,e),function(o){let i;return Yt(e,o),function(s,a){var c=s();return c&&c.then?c.then(a):a()}(function(){return js(o.arrayBuffer(),function(s){i=s})},function(){return ri(o,i,n.details)})})}),__=Zu(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 yn({info:{code:Sr.InvalidOutputFormat}},`Invalid output format: ${r}`);return r==="text"?A_(e,t,n):R_(e,t,n)}),I_=e=>e;function C_(e){return new Ku.XMLBuilder({attributeNamePrefix:"@_",format:!0,ignoreAttributes:!1,suppressEmptyNode:!0}).build(Fy({lockinfo:{"@_xmlns:d":"DAV:",lockscope:{exclusive:{}},locktype:{write:{}},owner:{href:e}}},"d"))}function Fy(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}`]=Fy(n[r],t),delete n[r]):/^@_/.test(r)===!1&&(n[`${t}:${r}`]=n[r],delete n[r]));return n}function ef(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function Oy(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 P_=Oy(function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=Xt({url:xt(e.remoteURL,kt(t)),method:"UNLOCK",headers:{"Lock-Token":n}},e,r);return ef(Qt(o,e),function(i){if(Yt(e,i),i.status!==204&&i.status!==200)throw Gu(i)})}),F_=Oy(function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{refreshToken:r,timeout:o=O_}=n,i={Accept:"text/plain,application/xml",Timeout:o};r&&(i.If=r);const s=Xt({url:xt(e.remoteURL,kt(t)),method:"LOCK",headers:i,data:C_(e.contactHref)},e,n);return ef(Qt(s,e),function(a){return Yt(e,a),ef(a.text(),function(c){const u=(f=c,new Ku.XMLParser({removeNSPrefix:!0,parseAttributeValue:!0,parseTagValue:!0}).parse(f)),l=Er().get(u,"prop.lockdiscovery.activelock.locktoken.href"),d=Er().get(u,"prop.lockdiscovery.activelock.timeout");var f;if(!l)throw Gu(a,"No lock token received: ");return{token:l,serverTimeout:d}})})}),O_="Infinite, Second-4100000000";function tf(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const k_=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=Xt({url:xt(e.remoteURL,n),method:"PROPFIND",headers:{Accept:"text/plain,application/xml",Depth:"0"}},e,t);return tf(Qt(r,e),function(o){return Yt(e,o),tf(o.text(),function(i){return tf(So(i),function(s){const a=function(c){try{const[u]=c.multistatus.response,{propstat:{prop:{"quota-used-bytes":l,"quota-available-bytes":d}}}=u;return l!==void 0&&d!==void 0?{used:parseInt(String(l),10),available:Ty(d)}:null}catch{}return null}(s);return ri(o,a,t.details)})})})});function nf(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const x_=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,o=Xt({url:xt(e.remoteURL,kt(t)),method:"SEARCH",headers:{Accept:"text/plain,application/xml","Content-Type":e.headers["Content-Type"]||"application/xml; charset=utf-8"}},e,n);return nf(Qt(o,e),function(i){return Yt(e,i),nf(i.text(),function(s){return nf(So(s),function(a){const c=function(u,l,d){const f={truncated:!1,results:[]};return f.truncated=u.multistatus.response.some(m=>{var w,y;return((y=(m.status||((w=m.propstat)==null?void 0:w.status)).split(" ",3))==null?void 0:y[1])==="507"&&m.href.replace(/\/$/,"").endsWith(kt(l).replace(/\/$/,""))}),u.multistatus.response.forEach(m=>{if(m.propstat===void 0)return;const w=m.href.split("/").map(decodeURIComponent).join("/");f.results.push(Bs(m.propstat.prop,w,d))}),f}(a,t,r);return ri(i,c,r)})})})}),N_=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 o=Xt({url:xt(e.remoteURL,kt(t)),method:"MOVE",headers:{Destination:xt(e.remoteURL,kt(n)),Overwrite:r.overwrite===!1?"F":"T"}},e,r);return s=function(a){Yt(e,a)},(i=Qt(o,e))&&i.then||(i=Promise.resolve(i)),s?i.then(s):i;var i,s});var $_=mt(172);const D_=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:o=!0,overwrite:i=!0}=r,s={"Content-Type":"application/octet-stream"};o===!1||(s["Content-Length"]=typeof o=="number"?`${o}`:`${function(l){if(cy(l))return l.byteLength;if(uy(l))return l.length;if(typeof l=="string")return(0,$_.d)(l);throw new yn({info:{code:Sr.DataTypeNoLength}},"Cannot calculate data length: Invalid type")}(n)}`),i||(s["If-None-Match"]="*");const a=Xt({url:xt(e.remoteURL,kt(t)),method:"PUT",headers:s,data:n},e,r);return u=function(l){try{Yt(e,l)}catch(d){const f=d;if(f.status!==412||i)throw f;return!1}return!0},(c=Qt(a,e))&&c.then||(c=Promise.resolve(c)),u?c.then(u):c;var c,u}),ky=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=Xt({url:xt(e.remoteURL,kt(t)),method:"OPTIONS"},e,n);return i=function(s){try{Yt(e,s)}catch(a){throw a}return{compliance:(s.headers.get("DAV")??"").split(",").map(a=>a.trim()),server:s.headers.get("Server")??""}},(o=Qt(r,e))&&o.then||(o=Promise.resolve(o)),i?o.then(i):o;var o,i});function Eo(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}const L_=rf(function(e,t,n,r,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>r||n<0)throw new yn({info:{code:Sr.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=Xt({url:xt(e.remoteURL,kt(t)),method:"PUT",headers:s,data:o},e,i);return Eo(Qt(a,e),function(c){Yt(e,c)})});function xy(e,t){var n=e();return n&&n.then?n.then(t):t(n)}const M_=rf(function(e,t,n,r,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(n>r||n<0)throw new yn({info:{code:Sr.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=Xt({url:xt(e.remoteURL,kt(t)),method:"PATCH",headers:s,data:o},e,i);return Eo(Qt(a,e),function(c){Yt(e,c)})});function rf(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 B_=rf(function(e,t,n,r,o){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};return Eo(ky(e,t,i),function(s){let a=!1;return xy(function(){if(s.compliance.includes("sabredav-partialupdate"))return Eo(M_(e,t,n,r,o,i),function(c){return a=!0,c})},function(c){let u=!1;return a?c:xy(function(){if(s.server.includes("Apache")&&s.compliance.includes("<http://apache.org/dav/propset/fs/1>"))return Eo(L_(e,t,n,r,o,i),function(l){return u=!0,l})},function(l){if(u)return l;throw new yn({info:{code:Sr.NotSupported}},"Not supported")})})})}),j_="https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";function U_(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{authType:n=null,remoteBasePath:r,contactHref:o=j_,ha1:i,headers:s={},httpAgent:a,httpsAgent:c,password:u,token:l,username:d,withCredentials:f}=t;let m=n;m||(m=d||u?bn.Password:bn.None);const w={authType:m,remoteBasePath:r,contactHref:o,ha1:i,headers:Object.assign({},s),httpAgent:a,httpsAgent:c,password:u,remotePath:PR(e),remoteURL:e,token:l,username:d,withCredentials:f};return iy(w,d,u,l,i),{copyFile:(y,E,b)=>p_(w,y,E,b),createDirectory:(y,E)=>Yu(w,y,E),createReadStream:(y,E)=>function(b,g){let v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const h=new(Py()).PassThrough;return b_(b,g,v).then(S=>{S.pipe(h)}).catch(S=>{h.emit("error",S)}),h}(w,y,E),createWriteStream:(y,E,b)=>function(g,v){let h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},S=arguments.length>3&&arguments[3]!==void 0?arguments[3]:v_;const T=new(Py()).PassThrough,R={};h.overwrite===!1&&(R["If-None-Match"]="*");const _=Xt({url:xt(g.remoteURL,kt(v)),method:"PUT",headers:R,data:T,maxRedirects:0},g,h);return Qt(_,g).then(A=>Yt(g,A)).then(A=>{setTimeout(()=>{S(A)},0)}).catch(A=>{T.emit("error",A)}),T}(w,y,E,b),customRequest:(y,E)=>w_(w,y,E),deleteFile:(y,E)=>S_(w,y,E),exists:(y,E)=>E_(w,y,E),getDirectoryContents:(y,E)=>T_(w,y,E),getFileContents:(y,E)=>__(w,y,E),getFileDownloadLink:y=>function(E,b){let g=xt(E.remoteURL,kt(b));const v=/^https:/i.test(g)?"https":"http";switch(E.authType){case bn.None:break;case bn.Password:{const h=ny(E.headers.Authorization.replace(/^Basic /i,"").trim());g=g.replace(/^https?:\/\//,`${v}://${h}@`);break}default:throw new yn({info:{code:Sr.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${E.authType}`)}return g}(w,y),getFileUploadLink:y=>function(E,b){let g=`${xt(E.remoteURL,kt(b))}?Content-Type=application/octet-stream`;const v=/^https:/i.test(g)?"https":"http";switch(E.authType){case bn.None:break;case bn.Password:{const h=ny(E.headers.Authorization.replace(/^Basic /i,"").trim());g=g.replace(/^https?:\/\//,`${v}://${h}@`);break}default:throw new yn({info:{code:Sr.LinkUnsupportedAuthType}},`Unsupported auth type for file link: ${E.authType}`)}return g}(w,y),getHeaders:()=>Object.assign({},w.headers),getQuota:y=>k_(w,y),lock:(y,E)=>F_(w,y,E),moveFile:(y,E,b)=>N_(w,y,E,b),putFileContents:(y,E,b)=>D_(w,y,E,b),partialUpdateFileContents:(y,E,b,g,v)=>B_(w,y,E,b,g,v),getDAVCompliance:y=>ky(w,y),search:(y,E)=>x_(w,y,E),setHeaders:y=>{w.headers=Object.assign({},y)},stat:(y,E)=>Xu(w,y,E),unlock:(y,E,b)=>P_(w,y,E,b)}}Ln.hT,Ln.O4,Ln.Kd,Ln.YK,Ln.UU,Ln.Gu,Ln.ky,Ln.h4,Ln.ch,Ln.hq,Ln.i5;var of={},sf={},Ny;function af(){return Ny||(Ny=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+"]*",o=new RegExp("^"+r+"$"),i=function(a,c){const u=[];let l=c.exec(a);for(;l;){const d=[];d.startIndex=c.lastIndex-l[0].length;const f=l.length;for(let m=0;m<f;m++)d.push(l[m]);u.push(d),l=c.exec(a)}return u},s=function(a){const c=o.exec(a);return!(c===null||typeof c>"u")};e.isExist=function(a){return typeof a<"u"},e.isEmptyObject=function(a){return Object.keys(a).length===0},e.merge=function(a,c,u){if(c){const l=Object.keys(c),d=l.length;for(let f=0;f<d;f++)u==="strict"?a[l[f]]=[c[l[f]]]:a[l[f]]=c[l[f]]}},e.getValue=function(a){return e.isExist(a)?a:""},e.isName=s,e.getAllMatches=i,e.nameRegexp=r}(sf)),sf}var $y;function Dy(){if($y)return of;$y=1;const e=af(),t={allowBooleanAttributes:!1,unpairedTags:[]};of.validate=function(b,g){g=Object.assign({},t,g);const v=[];let h=!1,S=!1;b[0]==="\uFEFF"&&(b=b.substr(1));for(let T=0;T<b.length;T++)if(b[T]==="<"&&b[T+1]==="?"){if(T+=2,T=r(b,T),T.err)return T}else if(b[T]==="<"){let R=T;if(T++,b[T]==="!"){T=o(b,T);continue}else{let _=!1;b[T]==="/"&&(_=!0,T++);let A="";for(;T<b.length&&b[T]!==">"&&b[T]!==" "&&b[T]!==" "&&b[T]!==`
45
+ `&&b[T]!=="\r";T++)A+=b[T];if(A=A.trim(),A[A.length-1]==="/"&&(A=A.substring(0,A.length-1),T--),!w(A)){let N;return A.trim().length===0?N="Invalid space after '<'.":N="Tag '"+A+"' is an invalid name.",f("InvalidTag",N,y(b,T))}const $=a(b,T);if($===!1)return f("InvalidAttr","Attributes for '"+A+"' have open quote.",y(b,T));let D=$.value;if(T=$.index,D[D.length-1]==="/"){const N=T-D.length;D=D.substring(0,D.length-1);const x=u(D,g);if(x===!0)h=!0;else return f(x.err.code,x.err.msg,y(b,N+x.err.line))}else if(_)if($.tagClosed){if(D.trim().length>0)return f("InvalidTag","Closing tag '"+A+"' can't have attributes or invalid starting.",y(b,R));if(v.length===0)return f("InvalidTag","Closing tag '"+A+"' has not been opened.",y(b,R));{const N=v.pop();if(A!==N.tagName){let x=y(b,N.tagStartPos);return f("InvalidTag","Expected closing tag '"+N.tagName+"' (opened in line "+x.line+", col "+x.col+") instead of closing tag '"+A+"'.",y(b,R))}v.length==0&&(S=!0)}}else return f("InvalidTag","Closing tag '"+A+"' doesn't have proper closing.",y(b,T));else{const N=u(D,g);if(N!==!0)return f(N.err.code,N.err.msg,y(b,T-D.length+N.err.line));if(S===!0)return f("InvalidXml","Multiple possible root nodes found.",y(b,T));g.unpairedTags.indexOf(A)!==-1||v.push({tagName:A,tagStartPos:R}),h=!0}for(T++;T<b.length;T++)if(b[T]==="<")if(b[T+1]==="!"){T++,T=o(b,T);continue}else if(b[T+1]==="?"){if(T=r(b,++T),T.err)return T}else break;else if(b[T]==="&"){const N=d(b,T);if(N==-1)return f("InvalidChar","char '&' is not expected.",y(b,T));T=N}else if(S===!0&&!n(b[T]))return f("InvalidXml","Extra text at the end",y(b,T));b[T]==="<"&&T--}}else{if(n(b[T]))continue;return f("InvalidChar","char '"+b[T]+"' is not expected.",y(b,T))}if(h){if(v.length==1)return f("InvalidTag","Unclosed tag '"+v[0].tagName+"'.",y(b,v[0].tagStartPos));if(v.length>0)return f("InvalidXml","Invalid '"+JSON.stringify(v.map(T=>T.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return f("InvalidXml","Start tag expected.",1);return!0};function n(b){return b===" "||b===" "||b===`
46
+ `||b==="\r"}function r(b,g){const v=g;for(;g<b.length;g++)if(b[g]=="?"||b[g]==" "){const h=b.substr(v,g-v);if(g>5&&h==="xml")return f("InvalidXml","XML declaration allowed only at the start of the document.",y(b,g));if(b[g]=="?"&&b[g+1]==">"){g++;break}else continue}return g}function o(b,g){if(b.length>g+5&&b[g+1]==="-"&&b[g+2]==="-"){for(g+=3;g<b.length;g++)if(b[g]==="-"&&b[g+1]==="-"&&b[g+2]===">"){g+=2;break}}else if(b.length>g+8&&b[g+1]==="D"&&b[g+2]==="O"&&b[g+3]==="C"&&b[g+4]==="T"&&b[g+5]==="Y"&&b[g+6]==="P"&&b[g+7]==="E"){let v=1;for(g+=8;g<b.length;g++)if(b[g]==="<")v++;else if(b[g]===">"&&(v--,v===0))break}else if(b.length>g+9&&b[g+1]==="["&&b[g+2]==="C"&&b[g+3]==="D"&&b[g+4]==="A"&&b[g+5]==="T"&&b[g+6]==="A"&&b[g+7]==="["){for(g+=8;g<b.length;g++)if(b[g]==="]"&&b[g+1]==="]"&&b[g+2]===">"){g+=2;break}}return g}const i='"',s="'";function a(b,g){let v="",h="",S=!1;for(;g<b.length;g++){if(b[g]===i||b[g]===s)h===""?h=b[g]:h!==b[g]||(h="");else if(b[g]===">"&&h===""){S=!0;break}v+=b[g]}return h!==""?!1:{value:v,index:g,tagClosed:S}}const c=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function u(b,g){const v=e.getAllMatches(b,c),h={};for(let S=0;S<v.length;S++){if(v[S][1].length===0)return f("InvalidAttr","Attribute '"+v[S][2]+"' has no space in starting.",E(v[S]));if(v[S][3]!==void 0&&v[S][4]===void 0)return f("InvalidAttr","Attribute '"+v[S][2]+"' is without value.",E(v[S]));if(v[S][3]===void 0&&!g.allowBooleanAttributes)return f("InvalidAttr","boolean attribute '"+v[S][2]+"' is not allowed.",E(v[S]));const T=v[S][2];if(!m(T))return f("InvalidAttr","Attribute '"+T+"' is an invalid name.",E(v[S]));if(!h.hasOwnProperty(T))h[T]=1;else return f("InvalidAttr","Attribute '"+T+"' is repeated.",E(v[S]))}return!0}function l(b,g){let v=/\d/;for(b[g]==="x"&&(g++,v=/[\da-fA-F]/);g<b.length;g++){if(b[g]===";")return g;if(!b[g].match(v))break}return-1}function d(b,g){if(g++,b[g]===";")return-1;if(b[g]==="#")return g++,l(b,g);let v=0;for(;g<b.length;g++,v++)if(!(b[g].match(/\w/)&&v<20)){if(b[g]===";")break;return-1}return g}function f(b,g,v){return{err:{code:b,msg:g,line:v.line||v,col:v.col}}}function m(b){return e.isName(b)}function w(b){return e.isName(b)}function y(b,g){const v=b.substring(0,g).split(/\r?\n/);return{line:v.length,col:v[v.length-1].length+1}}function E(b){return b.startIndex+b[1].length}return of}var Us={},Ly;function q_(){if(Ly)return Us;Ly=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,o){return n}},t=function(n){return Object.assign({},e,n)};return Us.buildOptions=t,Us.defaultOptions=e,Us}var lf,My;function V_(){if(My)return lf;My=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 lf=e,lf}var cf,By;function z_(){if(By)return cf;By=1;const e=af();function t(u,l){const d={};if(u[l+3]==="O"&&u[l+4]==="C"&&u[l+5]==="T"&&u[l+6]==="Y"&&u[l+7]==="P"&&u[l+8]==="E"){l=l+9;let f=1,m=!1,w=!1,y="";for(;l<u.length;l++)if(u[l]==="<"&&!w){if(m&&o(u,l)){l+=7;let E,b;[E,b,l]=n(u,l+1),b.indexOf("&")===-1&&(d[c(E)]={regx:RegExp(`&${E};`,"g"),val:b})}else if(m&&i(u,l))l+=8;else if(m&&s(u,l))l+=8;else if(m&&a(u,l))l+=9;else if(r)w=!0;else throw new Error("Invalid DOCTYPE");f++,y=""}else if(u[l]===">"){if(w?u[l-1]==="-"&&u[l-2]==="-"&&(w=!1,f--):f--,f===0)break}else u[l]==="["?m=!0:y+=u[l];if(f!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:d,i:l}}function n(u,l){let d="";for(;l<u.length&&u[l]!=="'"&&u[l]!=='"';l++)d+=u[l];if(d=d.trim(),d.indexOf(" ")!==-1)throw new Error("External entites are not supported");const f=u[l++];let m="";for(;l<u.length&&u[l]!==f;l++)m+=u[l];return[d,m,l]}function r(u,l){return u[l+1]==="!"&&u[l+2]==="-"&&u[l+3]==="-"}function o(u,l){return u[l+1]==="!"&&u[l+2]==="E"&&u[l+3]==="N"&&u[l+4]==="T"&&u[l+5]==="I"&&u[l+6]==="T"&&u[l+7]==="Y"}function i(u,l){return u[l+1]==="!"&&u[l+2]==="E"&&u[l+3]==="L"&&u[l+4]==="E"&&u[l+5]==="M"&&u[l+6]==="E"&&u[l+7]==="N"&&u[l+8]==="T"}function s(u,l){return u[l+1]==="!"&&u[l+2]==="A"&&u[l+3]==="T"&&u[l+4]==="T"&&u[l+5]==="L"&&u[l+6]==="I"&&u[l+7]==="S"&&u[l+8]==="T"}function a(u,l){return u[l+1]==="!"&&u[l+2]==="N"&&u[l+3]==="O"&&u[l+4]==="T"&&u[l+5]==="A"&&u[l+6]==="T"&&u[l+7]==="I"&&u[l+8]==="O"&&u[l+9]==="N"}function c(u){if(e.isName(u))return u;throw new Error(`Invalid entity name ${u}`)}return cf=t,cf}var uf,jy;function W_(){if(jy)return uf;jy=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 c=s.trim();if(a.skipLike!==void 0&&a.skipLike.test(c))return s;if(s==="0")return 0;if(a.hex&&e.test(c))return i(c,16);if(c.search(/[eE]/)!==-1){const u=c.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);if(u){if(a.leadingZeros)c=(u[1]||"")+u[3];else if(!(u[2]==="0"&&u[3][0]==="."))return s;return a.eNotation?Number(c):s}else return s}else{const u=t.exec(c);if(u){const l=u[1],d=u[2];let f=o(u[3]);if(!a.leadingZeros&&d.length>0&&l&&c[2]!==".")return s;if(!a.leadingZeros&&d.length>0&&!l&&c[1]!==".")return s;if(a.leadingZeros&&d===s)return 0;{const m=Number(c),w=""+m;return w.search(/[eE]/)!==-1?a.eNotation?m:s:c.indexOf(".")!==-1?w==="0"&&f===""||w===f||l&&w==="-"+f?m:s:d?f===w||l+f===w?m:s:c===w||c===l+w?m:s}}else return s}}function o(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 i(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 uf=r,uf}var ff,Uy;function qy(){if(Uy)return ff;Uy=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 ff=e,ff}var df,Vy;function H_(){if(Vy)return df;Vy=1;const e=af(),t=V_(),n=z_(),r=W_(),o=qy();class i{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,_)=>String.fromCharCode(Number.parseInt(_,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(R,_)=>String.fromCharCode(Number.parseInt(_,16))}},this.addExternalEntities=s,this.parseXml=d,this.parseTextData=a,this.resolveNameSpace=c,this.buildAttributesMap=l,this.isItStopNode=y,this.replaceEntitiesValue=m,this.readStopNodeData=v,this.saveTextToParentTag=w,this.addChild=f,this.ignoreAttributesFn=o(this.options.ignoreAttributes)}}function s(S){const T=Object.keys(S);for(let R=0;R<T.length;R++){const _=T[R];this.lastEntities[_]={regex:new RegExp("&"+_+";","g"),val:S[_]}}}function a(S,T,R,_,A,$,D){if(S!==void 0&&(this.options.trimValues&&!_&&(S=S.trim()),S.length>0)){D||(S=this.replaceEntitiesValue(S));const N=this.options.tagValueProcessor(T,S,R,A,$);return N==null?S:typeof N!=typeof S||N!==S?N:this.options.trimValues?h(S,this.options.parseTagValue,this.options.numberParseOptions):S.trim()===S?h(S,this.options.parseTagValue,this.options.numberParseOptions):S}}function c(S){if(this.options.removeNSPrefix){const T=S.split(":"),R=S.charAt(0)==="/"?"/":"";if(T[0]==="xmlns")return"";T.length===2&&(S=R+T[1])}return S}const u=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function l(S,T,R){if(this.options.ignoreAttributes!==!0&&typeof S=="string"){const _=e.getAllMatches(S,u),A=_.length,$={};for(let D=0;D<A;D++){const N=this.resolveNameSpace(_[D][1]);if(this.ignoreAttributesFn(N,T))continue;let x=_[D][4],W=this.options.attributeNamePrefix+N;if(N.length)if(this.options.transformAttributeName&&(W=this.options.transformAttributeName(W)),W==="__proto__"&&(W="#__proto__"),x!==void 0){this.options.trimValues&&(x=x.trim()),x=this.replaceEntitiesValue(x);const K=this.options.attributeValueProcessor(N,x,T);K==null?$[W]=x:typeof K!=typeof x||K!==x?$[W]=K:$[W]=h(x,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&($[W]=!0)}if(!Object.keys($).length)return;if(this.options.attributesGroupName){const D={};return D[this.options.attributesGroupName]=$,D}return $}}const d=function(S){S=S.replace(/\r\n?/g,`
47
+ `);const T=new t("!xml");let R=T,_="",A="";for(let $=0;$<S.length;$++)if(S[$]==="<")if(S[$+1]==="/"){const N=b(S,">",$,"Closing Tag is not closed.");let x=S.substring($+2,N).trim();if(this.options.removeNSPrefix){const le=x.indexOf(":");le!==-1&&(x=x.substr(le+1))}this.options.transformTagName&&(x=this.options.transformTagName(x)),R&&(_=this.saveTextToParentTag(_,R,A));const W=A.substring(A.lastIndexOf(".")+1);if(x&&this.options.unpairedTags.indexOf(x)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${x}>`);let K=0;W&&this.options.unpairedTags.indexOf(W)!==-1?(K=A.lastIndexOf(".",A.lastIndexOf(".")-1),this.tagsNodeStack.pop()):K=A.lastIndexOf("."),A=A.substring(0,K),R=this.tagsNodeStack.pop(),_="",$=N}else if(S[$+1]==="?"){let N=g(S,$,!1,"?>");if(!N)throw new Error("Pi Tag is not closed.");if(_=this.saveTextToParentTag(_,R,A),!(this.options.ignoreDeclaration&&N.tagName==="?xml"||this.options.ignorePiTags)){const x=new t(N.tagName);x.add(this.options.textNodeName,""),N.tagName!==N.tagExp&&N.attrExpPresent&&(x[":@"]=this.buildAttributesMap(N.tagExp,A,N.tagName)),this.addChild(R,x,A)}$=N.closeIndex+1}else if(S.substr($+1,3)==="!--"){const N=b(S,"-->",$+4,"Comment is not closed.");if(this.options.commentPropName){const x=S.substring($+4,N-2);_=this.saveTextToParentTag(_,R,A),R.add(this.options.commentPropName,[{[this.options.textNodeName]:x}])}$=N}else if(S.substr($+1,2)==="!D"){const N=n(S,$);this.docTypeEntities=N.entities,$=N.i}else if(S.substr($+1,2)==="!["){const N=b(S,"]]>",$,"CDATA is not closed.")-2,x=S.substring($+9,N);_=this.saveTextToParentTag(_,R,A);let W=this.parseTextData(x,R.tagname,A,!0,!1,!0,!0);W==null&&(W=""),this.options.cdataPropName?R.add(this.options.cdataPropName,[{[this.options.textNodeName]:x}]):R.add(this.options.textNodeName,W),$=N+2}else{let N=g(S,$,this.options.removeNSPrefix),x=N.tagName;const W=N.rawTagName;let K=N.tagExp,le=N.attrExpPresent,be=N.closeIndex;this.options.transformTagName&&(x=this.options.transformTagName(x)),R&&_&&R.tagname!=="!xml"&&(_=this.saveTextToParentTag(_,R,A,!1));const te=R;if(te&&this.options.unpairedTags.indexOf(te.tagname)!==-1&&(R=this.tagsNodeStack.pop(),A=A.substring(0,A.lastIndexOf("."))),x!==T.tagname&&(A+=A?"."+x:x),this.isItStopNode(this.options.stopNodes,A,x)){let ae="";if(K.length>0&&K.lastIndexOf("/")===K.length-1)x[x.length-1]==="/"?(x=x.substr(0,x.length-1),A=A.substr(0,A.length-1),K=x):K=K.substr(0,K.length-1),$=N.closeIndex;else if(this.options.unpairedTags.indexOf(x)!==-1)$=N.closeIndex;else{const ie=this.readStopNodeData(S,W,be+1);if(!ie)throw new Error(`Unexpected end of ${W}`);$=ie.i,ae=ie.tagContent}const ue=new t(x);x!==K&&le&&(ue[":@"]=this.buildAttributesMap(K,A,x)),ae&&(ae=this.parseTextData(ae,x,A,!0,le,!0,!0)),A=A.substr(0,A.lastIndexOf(".")),ue.add(this.options.textNodeName,ae),this.addChild(R,ue,A)}else{if(K.length>0&&K.lastIndexOf("/")===K.length-1){x[x.length-1]==="/"?(x=x.substr(0,x.length-1),A=A.substr(0,A.length-1),K=x):K=K.substr(0,K.length-1),this.options.transformTagName&&(x=this.options.transformTagName(x));const ae=new t(x);x!==K&&le&&(ae[":@"]=this.buildAttributesMap(K,A,x)),this.addChild(R,ae,A),A=A.substr(0,A.lastIndexOf("."))}else{const ae=new t(x);this.tagsNodeStack.push(R),x!==K&&le&&(ae[":@"]=this.buildAttributesMap(K,A,x)),this.addChild(R,ae,A),R=ae}_="",$=be}}else _+=S[$];return T.child};function f(S,T,R){const _=this.options.updateTag(T.tagname,R,T[":@"]);_===!1||(typeof _=="string"&&(T.tagname=_),S.addChild(T))}const m=function(S){if(this.options.processEntities){for(let T in this.docTypeEntities){const R=this.docTypeEntities[T];S=S.replace(R.regx,R.val)}for(let T in this.lastEntities){const R=this.lastEntities[T];S=S.replace(R.regex,R.val)}if(this.options.htmlEntities)for(let T in this.htmlEntities){const R=this.htmlEntities[T];S=S.replace(R.regex,R.val)}S=S.replace(this.ampEntity.regex,this.ampEntity.val)}return S};function w(S,T,R,_){return S&&(_===void 0&&(_=T.child.length===0),S=this.parseTextData(S,T.tagname,R,!1,T[":@"]?Object.keys(T[":@"]).length!==0:!1,_),S!==void 0&&S!==""&&T.add(this.options.textNodeName,S),S=""),S}function y(S,T,R){const _="*."+R;for(const A in S){const $=S[A];if(_===$||T===$)return!0}return!1}function E(S,T,R=">"){let _,A="";for(let $=T;$<S.length;$++){let D=S[$];if(_)D===_&&(_="");else if(D==='"'||D==="'")_=D;else if(D===R[0])if(R[1]){if(S[$+1]===R[1])return{data:A,index:$}}else return{data:A,index:$};else D===" "&&(D=" ");A+=D}}function b(S,T,R,_){const A=S.indexOf(T,R);if(A===-1)throw new Error(_);return A+T.length-1}function g(S,T,R,_=">"){const A=E(S,T+1,_);if(!A)return;let $=A.data;const D=A.index,N=$.search(/\s/);let x=$,W=!0;N!==-1&&(x=$.substring(0,N),$=$.substring(N+1).trimStart());const K=x;if(R){const le=x.indexOf(":");le!==-1&&(x=x.substr(le+1),W=x!==A.data.substr(le+1))}return{tagName:x,tagExp:$,closeIndex:D,attrExpPresent:W,rawTagName:K}}function v(S,T,R){const _=R;let A=1;for(;R<S.length;R++)if(S[R]==="<")if(S[R+1]==="/"){const $=b(S,">",R,`${T} is not closed`);if(S.substring(R+2,$).trim()===T&&(A--,A===0))return{tagContent:S.substring(_,R),i:$};R=$}else if(S[R+1]==="?")R=b(S,"?>",R+1,"StopNode is not closed.");else if(S.substr(R+1,3)==="!--")R=b(S,"-->",R+3,"StopNode is not closed.");else if(S.substr(R+1,2)==="![")R=b(S,"]]>",R,"StopNode is not closed.")-2;else{const $=g(S,R,">");$&&(($&&$.tagName)===T&&$.tagExp[$.tagExp.length-1]!=="/"&&A++,R=$.closeIndex)}}function h(S,T,R){if(T&&typeof S=="string"){const _=S.trim();return _==="true"?!0:_==="false"?!1:r(S,R)}else return e.isExist(S)?S:""}return df=i,df}var pf={},zy;function G_(){if(zy)return pf;zy=1;function e(i,s){return t(i,s)}function t(i,s,a){let c;const u={};for(let l=0;l<i.length;l++){const d=i[l],f=n(d);let m="";if(a===void 0?m=f:m=a+"."+f,f===s.textNodeName)c===void 0?c=d[f]:c+=""+d[f];else{if(f===void 0)continue;if(d[f]){let w=t(d[f],s,m);const y=o(w,s);d[":@"]?r(w,d[":@"],m,s):Object.keys(w).length===1&&w[s.textNodeName]!==void 0&&!s.alwaysCreateTextNode?w=w[s.textNodeName]:Object.keys(w).length===0&&(s.alwaysCreateTextNode?w[s.textNodeName]="":w=""),u[f]!==void 0&&u.hasOwnProperty(f)?(Array.isArray(u[f])||(u[f]=[u[f]]),u[f].push(w)):s.isArray(f,m,y)?u[f]=[w]:u[f]=w}}}return typeof c=="string"?c.length>0&&(u[s.textNodeName]=c):c!==void 0&&(u[s.textNodeName]=c),u}function n(i){const s=Object.keys(i);for(let a=0;a<s.length;a++){const c=s[a];if(c!==":@")return c}}function r(i,s,a,c){if(s){const u=Object.keys(s),l=u.length;for(let d=0;d<l;d++){const f=u[d];c.isArray(f,a+"."+f,!0,!0)?i[f]=[s[f]]:i[f]=s[f]}}}function o(i,s){const{textNodeName:a}=s,c=Object.keys(i).length;return!!(c===0||c===1&&(i[a]||typeof i[a]=="boolean"||i[a]===0))}return pf.prettify=e,pf}var hf,Wy;function K_(){if(Wy)return hf;Wy=1;const{buildOptions:e}=q_(),t=H_(),{prettify:n}=G_(),r=Dy();class o{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 l=r.validate(s,a);if(l!==!0)throw Error(`${l.err.msg}:${l.err.line}:${l.err.col}`)}const c=new t(this.options);c.addExternalEntities(this.externalEntities);const u=c.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 hf=o,hf}var gf,Hy;function Q_(){if(Hy)return gf;Hy=1;const e=`
48
+ `;function t(a,c){let u="";return c.format&&c.indentBy.length>0&&(u=e),n(a,c,"",u)}function n(a,c,u,l){let d="",f=!1;for(let m=0;m<a.length;m++){const w=a[m],y=r(w);if(y===void 0)continue;let E="";if(u.length===0?E=y:E=`${u}.${y}`,y===c.textNodeName){let S=w[y];i(E,c)||(S=c.tagValueProcessor(y,S),S=s(S,c)),f&&(d+=l),d+=S,f=!1;continue}else if(y===c.cdataPropName){f&&(d+=l),d+=`<![CDATA[${w[y][0][c.textNodeName]}]]>`,f=!1;continue}else if(y===c.commentPropName){d+=l+`<!--${w[y][0][c.textNodeName]}-->`,f=!0;continue}else if(y[0]==="?"){const S=o(w[":@"],c),T=y==="?xml"?"":l;let R=w[y][0][c.textNodeName];R=R.length!==0?" "+R:"",d+=T+`<${y}${R}${S}?>`,f=!0;continue}let b=l;b!==""&&(b+=c.indentBy);const g=o(w[":@"],c),v=l+`<${y}${g}`,h=n(w[y],c,E,b);c.unpairedTags.indexOf(y)!==-1?c.suppressUnpairedNode?d+=v+">":d+=v+"/>":(!h||h.length===0)&&c.suppressEmptyNode?d+=v+"/>":h&&h.endsWith(">")?d+=v+`>${h}${l}</${y}>`:(d+=v+">",h&&l!==""&&(h.includes("/>")||h.includes("</"))?d+=l+c.indentBy+h+l:d+=h,d+=`</${y}>`),f=!0}return d}function r(a){const c=Object.keys(a);for(let u=0;u<c.length;u++){const l=c[u];if(a.hasOwnProperty(l)&&l!==":@")return l}}function o(a,c){let u="";if(a&&!c.ignoreAttributes)for(let l in a){if(!a.hasOwnProperty(l))continue;let d=c.attributeValueProcessor(l,a[l]);d=s(d,c),d===!0&&c.suppressBooleanAttributes?u+=` ${l.substr(c.attributeNamePrefix.length)}`:u+=` ${l.substr(c.attributeNamePrefix.length)}="${d}"`}return u}function i(a,c){a=a.substr(0,a.length-c.textNodeName.length-1);let u=a.substr(a.lastIndexOf(".")+1);for(let l in c.stopNodes)if(c.stopNodes[l]===a||c.stopNodes[l]==="*."+u)return!0;return!1}function s(a,c){if(a&&a.length>0&&c.processEntities)for(let u=0;u<c.entities.length;u++){const l=c.entities[u];a=a.replace(l.regex,l.val)}return a}return gf=t,gf}var mf,Gy;function X_(){if(Gy)return mf;Gy=1;const e=Q_(),t=qy(),n={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(a,c){return c},attributeValueProcessor:function(a,c){return c},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=o,this.options.format?(this.indentate=i,this.tagEndChar=`>
49
49
  `,this.newLine=`
50
- `):(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,c,u){let l="",f="";const d=u.join(".");for(let m in a)if(Object.prototype.hasOwnProperty.call(a,m))if(typeof a[m]>"u")this.isAttribute(m)&&(f+="");else if(a[m]===null)this.isAttribute(m)||m===this.options.cdataPropName?f+="":m[0]==="?"?f+=this.indentate(c)+"<"+m+"?"+this.tagEndChar:f+=this.indentate(c)+"<"+m+"/"+this.tagEndChar;else if(a[m]instanceof Date)f+=this.buildTextValNode(a[m],m,"",c);else if(typeof a[m]!="object"){const w=this.isAttribute(m);if(w&&!this.ignoreAttributesFn(w,d))l+=this.buildAttrPairStr(w,""+a[m]);else if(!w)if(m===this.options.textNodeName){let v=this.options.tagValueProcessor(m,""+a[m]);f+=this.replaceEntitiesValue(v)}else f+=this.buildTextValNode(a[m],m,"",c)}else if(Array.isArray(a[m])){const w=a[m].length;let v="",T="";for(let y=0;y<w;y++){const g=a[m][y];if(!(typeof g>"u"))if(g===null)m[0]==="?"?f+=this.indentate(c)+"<"+m+"?"+this.tagEndChar:f+=this.indentate(c)+"<"+m+"/"+this.tagEndChar;else if(typeof g=="object")if(this.options.oneListGroup){const h=this.j2x(g,c+1,u.concat(m));v+=h.val,this.options.attributesGroupName&&g.hasOwnProperty(this.options.attributesGroupName)&&(T+=h.attrStr)}else v+=this.processTextOrObjNode(g,m,c,u);else if(this.options.oneListGroup){let h=this.options.tagValueProcessor(m,g);h=this.replaceEntitiesValue(h),v+=h}else v+=this.buildTextValNode(g,m,"",c)}this.options.oneListGroup&&(v=this.buildObjectNode(v,m,T,c)),f+=v}else if(this.options.attributesGroupName&&m===this.options.attributesGroupName){const w=Object.keys(a[m]),v=w.length;for(let T=0;T<v;T++)l+=this.buildAttrPairStr(w[T],""+a[m][w[T]])}else f+=this.processTextOrObjNode(a[m],m,c,u);return{attrStr:l,val:f}},r.prototype.buildAttrPairStr=function(a,c){return c=this.options.attributeValueProcessor(a,""+c),c=this.replaceEntitiesValue(c),this.options.suppressBooleanAttributes&&c==="true"?" "+a:" "+a+'="'+c+'"'};function o(a,c,u,l){const f=this.j2x(a,u+1,l.concat(c));return a[this.options.textNodeName]!==void 0&&Object.keys(a).length===1?this.buildTextValNode(a[this.options.textNodeName],c,f.attrStr,u):this.buildObjectNode(f.val,c,f.attrStr,u)}r.prototype.buildObjectNode=function(a,c,u,l){if(a==="")return c[0]==="?"?this.indentate(l)+"<"+c+u+"?"+this.tagEndChar:this.indentate(l)+"<"+c+u+this.closeTag(c)+this.tagEndChar;{let f="</"+c+this.tagEndChar,d="";return c[0]==="?"&&(d="?",f=""),(u||u==="")&&a.indexOf("<")===-1?this.indentate(l)+"<"+c+u+d+">"+a+f:this.options.commentPropName!==!1&&c===this.options.commentPropName&&d.length===0?this.indentate(l)+`<!--${a}-->`+this.newLine:this.indentate(l)+"<"+c+u+d+this.tagEndChar+a+this.indentate(l)+f}},r.prototype.closeTag=function(a){let c="";return this.options.unpairedTags.indexOf(a)!==-1?this.options.suppressUnpairedNode||(c="/"):this.options.suppressEmptyNode?c="/":c=`></${a}`,c},r.prototype.buildTextValNode=function(a,c,u,l){if(this.options.cdataPropName!==!1&&c===this.options.cdataPropName)return this.indentate(l)+`<![CDATA[${a}]]>`+this.newLine;if(this.options.commentPropName!==!1&&c===this.options.commentPropName)return this.indentate(l)+`<!--${a}-->`+this.newLine;if(c[0]==="?")return this.indentate(l)+"<"+c+u+"?"+this.tagEndChar;{let f=this.options.tagValueProcessor(c,a);return f=this.replaceEntitiesValue(f),f===""?this.indentate(l)+"<"+c+u+this.closeTag(c)+this.tagEndChar:this.indentate(l)+"<"+c+u+">"+f+"</"+c+this.tagEndChar}},r.prototype.replaceEntitiesValue=function(a){if(a&&a.length>0&&this.options.processEntities)for(let c=0;c<this.options.entities.length;c++){const u=this.options.entities[c];a=a.replace(u.regex,u.val)}return a};function i(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 df=r,df}var pf,Wy;function rI(){if(Wy)return pf;Wy=1;const e=xy(),t=eI(),n=nI();return pf={XMLParser:t,XMLValidator:e,XMLBuilder:n},pf}rI();class Hy{isEnabled(){return!0}isActive(t){return Pn(t,"files-trash-generic")}getTask(t){const{resourcesStore:n,clientService:{webdav:r}}=t;return hn.useTask(function*(o,i,s){n.clearResourceList(),n.setAncestorMetaData({});const{resource:a,children:c}=yield r.listFiles(s,{},{depth:1,davProperties:Rs.Trashbin,isTrash:!0,signal:o});n.initResourceList({currentFolder:a,resources:c})})}}class Gy{constructor(){Se(this,"loaders");this.loaders=[new Kh,new Qh,new Xh,new Yh,new Jh,new Hy]}getTask(){const t=St(),n=ct(),r=an(),o=qe(),i=Xe(),s=lt(),a=Qe(),c=zt(),u=Tf(),l=this.loaders.find(f=>f.isEnabled()&&f.isActive(p(o)));if(!l){console.debug("No folder loader found for route");return}return hn.useTask(function*(...f){const d={clientService:i,configStore:s,userStore:t,spacesStore:n,capabilityStore:r,resourcesStore:a,sharesStore:c,router:o,authService:u};try{yield l.getTask(d).perform(...f)}catch(m){console.error(m)}})}}const Ky=new Gy;var $r=(e=>(e.add="loading-service.add",e.remove="loading-service.remove",e.setProgress="loading-service.set-progress",e))($r||{});const iI=200;class oI{constructor(){Se(this,"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=iI,indeterminate:r=!0}={}){const o={id:tn.v4(),active:!1,...!r&&{state:{total:0,current:0}}};return this.tasks.length||window.addEventListener("beforeunload",this.onBeforeUnload),this.tasks.push(o),_t.debounce(()=>{o.active=!0,Ke.publish("loading-service.add")},n)(),t({setProgress:({total:a,current:c})=>{r||this.setProgress({task:o,total:a,current:c})}}).finally(()=>{this.removeTask(o.id)})}removeTask(t){this.tasks=this.tasks.filter(n=>n.id!==t),this.tasks.length||window.removeEventListener("beforeunload",this.onBeforeUnload),Ke.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,Ke.publish("loading-service.set-progress")}onBeforeUnload(t){t.preventDefault()}}var sI="__lodash_hash_undefined__";function aI(e){return this.__data__.set(e,sI),this}function lI(e){return this.__data__.has(e)}function Vs(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new br;++t<n;)this.add(e[t])}Vs.prototype.add=Vs.prototype.push=aI,Vs.prototype.has=lI;function cI(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 uI(e,t){return e.has(t)}var fI=1,dI=2;function Qy(e,t,n,r,o,i){var s=n&fI,a=e.length,c=t.length;if(a!=c&&!(s&&c>a))return!1;var u=i.get(e),l=i.get(t);if(u&&l)return u==t&&l==e;var f=-1,d=!0,m=n&dI?new Vs:void 0;for(i.set(e,t),i.set(t,e);++f<a;){var w=e[f],v=t[f];if(r)var T=s?r(v,w,f,t,e,i):r(w,v,f,e,t,i);if(T!==void 0){if(T)continue;d=!1;break}if(m){if(!cI(t,function(y,g){if(!uI(m,g)&&(w===y||o(w,y,n,r,i)))return m.push(g)})){d=!1;break}}else if(!(w===v||o(w,v,n,r,i))){d=!1;break}}return i.delete(e),i.delete(t),d}function pI(e){var t=-1,n=Array(e.size);return e.forEach(function(r,o){n[++t]=[o,r]}),n}function hI(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var gI=1,mI=2,yI="[object Boolean]",bI="[object Date]",vI="[object Error]",wI="[object Map]",SI="[object Number]",EI="[object RegExp]",TI="[object Set]",AI="[object String]",RI="[object Symbol]",_I="[object ArrayBuffer]",II="[object DataView]",Xy=kn?kn.prototype:void 0,hf=Xy?Xy.valueOf:void 0;function CI(e,t,n,r,o,i,s){switch(n){case II:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case _I:return!(e.byteLength!=t.byteLength||!i(new ms(e),new ms(t)));case yI:case bI:case SI:return io(+e,+t);case vI:return e.name==t.name&&e.message==t.message;case EI:case AI:return e==t+"";case wI:var a=pI;case TI:var c=r&gI;if(a||(a=hI),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;r|=mI,s.set(e,t);var l=Qy(a(e),a(t),r,o,i,s);return s.delete(e),l;case RI:if(hf)return hf.call(e)==hf.call(t)}return!1}function gf(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function Yy(e,t,n){var r=t(e);return xn(e)?r:gf(r,n(e))}function PI(e,t){for(var n=-1,r=e==null?0:e.length,o=0,i=[];++n<r;){var s=e[n];t(s,n,e)&&(i[o++]=s)}return i}function Jy(){return[]}var FI=Object.prototype,OI=FI.propertyIsEnumerable,Zy=Object.getOwnPropertySymbols,eb=Zy?function(e){return e==null?[]:(e=Object(e),PI(Zy(e),function(t){return OI.call(e,t)}))}:Jy;function kI(e){return co(e)?eh(e):qh(e)}function tb(e){return Yy(e,kI,eb)}var xI=1,NI=Object.prototype,$I=NI.hasOwnProperty;function DI(e,t,n,r,o,i){var s=n&xI,a=tb(e),c=a.length,u=tb(t),l=u.length;if(c!=l&&!s)return!1;for(var f=c;f--;){var d=a[f];if(!(s?d in t:$I.call(t,d)))return!1}var m=i.get(e),w=i.get(t);if(m&&w)return m==t&&w==e;var v=!0;i.set(e,t),i.set(t,e);for(var T=s;++f<c;){d=a[f];var y=e[d],g=t[d];if(r)var h=s?r(g,y,d,t,e,i):r(y,g,d,e,t,i);if(!(h===void 0?y===g||o(y,g,n,r,i):h)){v=!1;break}T||(T=d=="constructor")}if(v&&!T){var b=e.constructor,S=t.constructor;b!=S&&"constructor"in e&&"constructor"in t&&!(typeof b=="function"&&b instanceof b&&typeof S=="function"&&S instanceof S)&&(v=!1)}return i.delete(e),i.delete(t),v}var LI=1,nb="[object Arguments]",rb="[object Array]",zs="[object Object]",MI=Object.prototype,ib=MI.hasOwnProperty;function BI(e,t,n,r,o,i){var s=xn(e),a=xn(t),c=s?rb:Ln(e),u=a?rb:Ln(t);c=c==nb?zs:c,u=u==nb?zs:u;var l=c==zs,f=u==zs,d=c==u;if(d&&_i(e)){if(!_i(t))return!1;s=!0,l=!1}if(d&&!l)return i||(i=new tr),s||bs(e)?Qy(e,t,n,r,o,i):CI(e,t,c,n,r,o,i);if(!(n&LI)){var m=l&&ib.call(e,"__wrapped__"),w=f&&ib.call(t,"__wrapped__");if(m||w){var v=m?e.value():e,T=w?t.value():t;return i||(i=new tr),o(v,T,n,r,i)}}return d?(i||(i=new tr),DI(e,t,n,r,o,i)):!1}function ob(e,t,n,r,o){return e===t?!0:e==null||t==null||!nr(e)&&!nr(t)?e!==e&&t!==t:BI(e,t,n,r,ob,o)}function sb(e,t){return ob(e,t)}const mf=(e="")=>e.split("/").map(encodeURIComponent).join("/"),jI=e=>{const t=[],n=(r,o="")=>Object.keys(r).forEach(i=>{gl(r[i])?n(r[i],`${o}${i}.`):t.push(`${o}${i}`)});return n(e),t};class UI{constructor({clientService:t,userStore:n,authStore:r,capabilityStore:o,configStore:i}){Se(this,"clientService");Se(this,"configStore");Se(this,"userStore");Se(this,"authStore");Se(this,"capabilityStore");Se(this,"capability");this.clientService=t,this.userStore=n,this.authStore=r,this.configStore=i,this.capability=o.filesThumbnail||{enabled:!0,version:"v0.1",supportedMimeTypes:["image/gif","image/png","image/jpeg","image/tiff","image/bmp","image/x-ms-bmp","application/vnd.geogebra.slides","application/vnd.geogebra.pinboard"]}}get available(){var t;return!!((t=this.capability)!=null&&t.version)}get supportedMimeTypes(){var t;return((t=this.capability)==null?void 0:t.supportedMimeTypes)||[]}get user(){return this.userStore.user}isMimetypeSupported(t,n=!1){return this.supportedMimeTypes.length?this.getSupportedMimeTypes(n?"image/":null).includes(t):!0}getSupportedMimeTypes(t){return t?this.supportedMimeTypes.filter(n=>n.startsWith(t)):this.supportedMimeTypes}async loadPreview(t,n=!1,r=!0,o){const{space:i,resource:s}=t,a=this.available&&this.isMimetypeSupported(s.mimeType),c=s.type!=="folder"&&s.extension&&s.canDownload();if(!a||!c)return;const u=te.isPublicSpaceResource(i);if(!(!u&&(!this.configStore.serverUrl||!this.user.onPremisesSamAccountName||!this.authStore.accessToken))){if(u)return this.publicPreviewUrl(t,o);try{return await this.privatePreviewBlob(t,n,r,o)}catch(l){if(r)return;throw l}}}async cacheFactory(t,n,r){const{resource:o,dimensions:i}=t,s=Wl.filePreview.get(o.id.toString());if(s&&s.etag===o.etag&&sb(i,s.dimensions))return s.src;try{const a=await this.privatePreviewBlob(t,!1,!0,r);return Wl.filePreview.set(o.id.toString(),{src:a,etag:o.etag,dimensions:i},0).src}catch(a){if(n)return;throw a}}buildQueryString(t){return j0.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){var u,l;const{resource:i,dimensions:s,processor:a}=t;if(n)return this.cacheFactory(t,r,o);const c=[this.configStore.serverUrl,"remote.php/dav",mf(i.webDavPath),"?",this.buildQueryString({etag:i.etag,dimensions:s,processor:a})].join("");try{const{data:f}=await this.clientService.httpAuthenticated.get(c,{responseType:"blob",signal:o});return window.URL.createObjectURL(f)}catch(f){if([425,429].includes(f.status)){const d=((l=(u=f.response)==null?void 0:u.headers)==null?void 0:l["retry-after"])||5;return await new Promise(m=>setTimeout(m,d*1e3)),this.privatePreviewBlob(t,n,r,o)}throw f}}async publicPreviewUrl(t,n){var l,f;const{resource:r,dimensions:o,processor:i}=t,[s,a]=r.downloadURL.split("?"),c=[this.buildQueryString({etag:r.etag,dimensions:o,processor:i}),a].filter(Boolean).join("&"),u=[s,c].filter(Boolean).join("?");try{const{status:d}=await this.clientService.httpUnAuthenticated.head(u,{signal:n});if(d!==404)return u}catch(d){if([425,429].includes(d.status)){const m=((f=(l=d.response)==null?void 0:l.headers)==null?void 0:f["retry-after"])||5;return await new Promise(w=>setTimeout(w,m*1e3)),this.publicPreviewUrl(t,n)}throw d}}}const Ws=ve.z.enum(["fit","resize","fill","thumbnail"]);class qI{constructor({$gettext:t}){Se(this,"$gettext");this.$gettext=t}explain(t,n){return{code:"mustNotBeEmpty",message:this.$gettext("Must not be empty"),format:[],..._t.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 VI{constructor({$gettext:t}){Se(this,"$gettext");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],..._t.isBoolean(n)&&{verified:n}}}assert(t,n){return Array.from(n).filter(o=>t.characters.includes(o)).length>=t.minLength}validate(t){if(!_t.isObject(t))throw new Error("options should be an object");if(!_t.isNumber(t.minLength)||_t.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");if(!_t.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 Hs{constructor({$gettext:t}){Se(this,"$gettext");this.$gettext=t}assert(t,n){throw new Error("Method not implemented.")}explain(t,n){throw new Error("Method not implemented.")}validate(t){if(!_t.isObject(t))throw new Error("options should be an object");if(!_t.isNumber(t.minLength)||_t.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 zI extends Hs{constructor(t){super(t)}explain(t,n){return{code:"atLeastCharacters",message:this.$gettext("%{param1}+ letters"),format:[t.minLength],..._t.isBoolean(n)&&{verified:n}}}assert(t,n){return n.length>=t.minLength}}class WI extends Hs{constructor(t){super(t)}explain(t,n){return{code:"atLeastUppercaseCharacters",message:this.$gettext("%{param1}+ uppercase letters"),format:[t.minLength],..._t.isBoolean(n)&&{verified:n}}}assert(t,n){var o;return((o=(n||"").match(/[A-Z\xC0-\xD6\xD8-\xDE]/g))==null?void 0:o.length)>=t.minLength}}class HI extends Hs{constructor(t){super(t)}explain(t,n){return{code:"atLeastLowercaseCharacters",message:this.$gettext("%{param1}+ lowercase letters"),format:[t.minLength],..._t.isBoolean(n)&&{verified:n}}}assert(t,n){var o;return((o=(n||"").match(/[a-z\xDF-\xF6\xF8-\xFF]/g))==null?void 0:o.length)>=t.minLength}}class GI extends Hs{constructor(t){super(t)}explain(t,n){return{code:"atLeastDigits",message:this.$gettext("%{param1}+ numbers"),format:[t.minLength],..._t.isBoolean(n)&&{verified:n}}}assert(t,n){var o;return((o=(n||"").match(/\d/g))==null?void 0:o.length)>=t.minLength}}var yf={},ab;function KI(){if(ab)return yf;ab=1;var e=function(i){return Math.floor(Math.random()*i)},t=function(i){var s="",a="",c=i.length,u=i.lowercase,l=i.uppercase,f=i.numbers,d=i.symbols,m=i.minLengthLowercase,w=i.minLengthUppercase,v=i.minLengthNumbers,T=i.minLengthSymbols,y=i.exclude,g="abcdefghijklmnopqrstuvwxyz";g=n(g,y);var h="ABCDEFGHIJKLMNOPQRSTUVWXYZ";h=n(h,y);var b="0123456789";b=n(b,y);var S="!#$%&'()*+,-./:;<=>?@[]^_{|}~";S=n(S,y);for(var E=g.length,I=0;I<m;I++)a+=g.charAt(e(E));for(E=h.length,I=0;I<w;I++)a+=h.charAt(e(E));for(E=b.length,I=0;I<v;I++)a+=b.charAt(e(E));for(E=S.length,I=0;I<T;I++)a+=S.charAt(e(E));s+=function(N){for(var L=N.split(""),x=L.length-1;x>0;x--){var $=Math.floor(Math.random()*(x+1)),V=L[x];L[x]=L[$],L[$]=V}return L.join("")}(a);var R="";R=u?R+g:R,R=l?R+h:R,R=f?R+b:R,R=d?R+S:R;var A=c-s.length;for(E=R.length,I=0;I<A;I++)s+=R.charAt(e(E));return s},n=function(i,s){return s==null||s.split("").forEach(function(a){i=i.replace(a,"")}),i},r=function(i){var s=i.length,a=i.lowercase,c=i.uppercase,u=i.numbers,l=i.symbols;if(i.minLengthLowercase+i.minLengthUppercase+i.minLengthNumbers+i.minLengthSymbols>s)throw new Error("Sum of Minimum Characters in the passwords greater than the length of the Password to be generated.");if(a==0&&c==0&&u==0&&l==0)throw new Error("Alphabets, Numbers and Symbols are all set to False. No valid Characters to generate the Password.")},o=function(i){return i.length=i.length===void 0?10:i.length,i.lowercase=i.lowercase===void 0||i.lowercase,i.uppercase=i.uppercase===void 0||i.uppercase,i.numbers=i.numbers===void 0||i.numbers,i.symbols=i.symbols!==void 0&&i.symbols,i.lowercase?i.minLengthLowercase=i.minLengthLowercase===void 0?1:i.minLengthLowercase:i.minLengthLowercase=0,i.uppercase?i.minLengthUppercase=i.minLengthUppercase===void 0?1:i.minLengthUppercase:i.minLengthUppercase=0,i.numbers?i.minLengthNumbers=i.minLengthNumbers===void 0?1:i.minLengthNumbers:i.minLengthNumbers=0,i.symbols?i.minLengthSymbols=i.minLengthSymbols===void 0?1:i.minLengthSymbols:i.minLengthSymbols=0,i.exclude=i.exclude===void 0?"":i.exclude,i};return yf.GeneratePassword=function(i){return i?(i=o(i),r(i),t(i)):(i=o({length:10,lowercase:!0,uppercase:!0,numbers:!0,symbols:!1,exclude:"",minLengthLowercase:1,minLengthUppercase:1,minLengthNumbers:1,minLengthSymbols:0}),r(i),t(i))},yf}var QI=KI();class XI{constructor({language:t}){Se(this,"language");Se(this,"capability");Se(this,"policy");Se(this,"generatePasswordRules");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 zI({...this.language}),mustNotBeEmpty:new qI({...this.language}),atLeastUppercaseCharacters:new WI({...this.language}),atLeastLowercaseCharacters:new HI({...this.language}),atLeastDigits:new GI({...this.language}),mustContain:new VI({...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 U0.PasswordPolicy(r,n)}getPolicy({enforcePassword:t=!1}={}){return this.buildPolicy({enforcePassword:t}),this.policy}generatePassword(){return QI.GeneratePassword({symbols:!0,length:this.generatePasswordRules.length,minLengthLowercase:this.generatePasswordRules.minLowercaseCharacters,minLengthUppercase:this.generatePasswordRules.minUppercaseCharacters,minLengthNumbers:this.generatePasswordRules.minDigits,minLengthSymbols:this.generatePasswordRules.minSpecialCharacters})}}function YI(e){return e.charCodeAt(0).toString(32)}function lb(e){let t="";return e.replace(/[^A-Z0-9]/gi,n=>(t+=`-${YI(n)}`,"/"))+t}function cb(e,t){let n=t||"uppy";return typeof e.name=="string"&&(n+=`-${lb(e.name.toLowerCase())}`),e.type!==void 0&&(n+=`-${e.type}`),e.meta&&typeof e.meta.relativePath=="string"&&(n+=`-${lb(e.meta.relativePath.toLowerCase())}`),e.data.size!==void 0&&(n+=`-${e.data.size}`),e.data.lastModified!==void 0&&(n+=`-${e.data.lastModified}`),n}class JI{constructor({language:t}){Se(this,"uppy");Se(this,"uploadInputs",[]);Se(this,"uploadFolderMap",{});Se(this,"getRelativeFilePath",t=>{const n=t.data.relativePath||t.data.webkitRelativePath;return n?te.urlJoin(n):void 0});const{$gettext:n}=t;this.uppy=new q0({autoProceed:!1,onBeforeFileAdded:(r,o)=>(r.id in o&&(r.meta.retry=!0),r.meta.relativePath=this.getRelativeFilePath(r),r.id=cb(r,this.uppy.getID()),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()}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:i}){const s={chunkSize:t,removeFingerprintOnSuccess:!0,overridePatchMethod:n,retryDelays:[0,500,1e3],uploadDataDuringCreation:r,limit:5,headers:i,onBeforeRequest:o,onShouldRetry:(u,l,f,d)=>{var m,w;return((m=u==null?void 0:u.originalResponse)==null?void 0:m.getStatus())>=500?!1:((w=u==null?void 0:u.originalResponse)==null?void 0:w.getStatus())===401?!0:d(u)}},a=this.uppy.getPlugin("XHRUpload");a&&this.uppy.removePlugin(a);const c=this.uppy.getPlugin("Tus");if(c){c.setOptions(s);return}this.uppy.use(V0,s)}useXhr({headers:t,timeout:n,endpoint:r}){const o={endpoint:r,method:"put",headers:t,formData:!1,timeout:n,getResponseData(){return{}}},i=this.uppy.getPlugin("Tus");i&&this.uppy.removePlugin(i);const s=this.uppy.getPlugin("XHRUpload");if(s){s.setOptions(o);return}this.uppy.use(z0,o)}tusActive(){return!!this.uppy.getPlugin("Tus")}useDropTarget({targetSelector:t}){this.uppy.getPlugin("DropTarget")||this.uppy.use(W0,{target:t,onDragOver:n=>{this.publish("drag-over",n)},onDragLeave:n=>{this.publish("drag-out",n)},onDrop:n=>{this.publish("drop",n)}})}removeDropTarget(){const t=this.uppy.getPlugin("DropTarget");t&&this.uppy.removePlugin(t)}subscribe(t,n){return Ke.subscribe(t,n)}unsubscribe(t,n){Ke.unsubscribe(t,n)}publish(t,n){Ke.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=>{t&&(this.publish("uploadCompleted",t),t.successful.forEach(n=>{this.uppy.removeFile(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,i=Array.from(o.files);this.addFiles(i)}),this.uploadInputs.push(t))}removeUploadInput(t){this.uploadInputs=this.uploadInputs.filter(n=>n!==t)}generateUploadId(t){return cb(t,this.uppy.getID())}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()}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 ZI(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var eC=Object.getOwnPropertySymbols,tC=eC?function(e){for(var t=[];e;)gf(t,eb(e)),e=hl(e);return t}:Jy;function ub(e){return Yy(e,vl,tC)}var nC=Object.prototype,rC=nC.hasOwnProperty;function iC(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&rC.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function oC(e,t){var n=pl(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var sC=/\w*$/;function aC(e){var t=new e.constructor(e.source,sC.exec(e));return t.lastIndex=e.lastIndex,t}var fb=kn?kn.prototype:void 0,db=fb?fb.valueOf:void 0;function lC(e){return db?Object(db.call(e)):{}}var cC="[object Boolean]",uC="[object Date]",fC="[object Map]",dC="[object Number]",pC="[object RegExp]",hC="[object Set]",gC="[object String]",mC="[object Symbol]",yC="[object ArrayBuffer]",bC="[object DataView]",vC="[object Float32Array]",wC="[object Float64Array]",SC="[object Int8Array]",EC="[object Int16Array]",TC="[object Int32Array]",AC="[object Uint8Array]",RC="[object Uint8ClampedArray]",_C="[object Uint16Array]",IC="[object Uint32Array]";function CC(e,t,n){var r=e.constructor;switch(t){case yC:return pl(e);case cC:case uC:return new r(+e);case bC:return oC(e);case vC:case wC:case SC:case EC:case TC:case AC:case RC:case _C:case IC:return Bp(e,n);case fC:return new r;case dC:case gC:return new r(e);case pC:return aC(e);case hC:return new r;case mC:return lC(e)}}var PC="[object Map]";function FC(e){return nr(e)&&Ln(e)==PC}var pb=Ii&&Ii.isMap,OC=pb?ml(pb):FC,kC="[object Set]";function xC(e){return nr(e)&&Ln(e)==kC}var hb=Ii&&Ii.isSet,NC=hb?ml(hb):xC,$C=1,gb="[object Arguments]",DC="[object Array]",LC="[object Boolean]",MC="[object Date]",BC="[object Error]",mb="[object Function]",jC="[object GeneratorFunction]",UC="[object Map]",qC="[object Number]",yb="[object Object]",VC="[object RegExp]",zC="[object Set]",WC="[object String]",HC="[object Symbol]",GC="[object WeakMap]",KC="[object ArrayBuffer]",QC="[object DataView]",XC="[object Float32Array]",YC="[object Float64Array]",JC="[object Int8Array]",ZC="[object Int16Array]",eP="[object Int32Array]",tP="[object Uint8Array]",nP="[object Uint8ClampedArray]",rP="[object Uint16Array]",iP="[object Uint32Array]",bt={};bt[gb]=bt[DC]=bt[KC]=bt[QC]=bt[LC]=bt[MC]=bt[XC]=bt[YC]=bt[JC]=bt[ZC]=bt[eP]=bt[UC]=bt[qC]=bt[yb]=bt[VC]=bt[zC]=bt[WC]=bt[HC]=bt[tP]=bt[nP]=bt[rP]=bt[iP]=!0,bt[BC]=bt[mb]=bt[GC]=!1;function Gs(e,t,n,r,o,i){var s,a=t&$C;if(n&&(s=o?n(e,r,o,i):n(e)),s!==void 0)return s;if(!er(e))return e;var c=xn(e);if(c)s=iC(e);else{var u=Ln(e),l=u==mb||u==jC;if(_i(e))return Mp(e,a);if(u==yb||u==gb||l&&!o)s={};else{if(!bt[u])return o?e:{};s=CC(e,u,a)}}i||(i=new tr);var f=i.get(e);if(f)return f;i.set(e,s),NC(e)?e.forEach(function(w){s.add(Gs(w,t,n,w,e,i))}):OC(e)&&e.forEach(function(w,v){s.set(v,Gs(w,t,n,v,e,i))});var d=ub,m=c?void 0:d(e);return ZI(m||e,function(w,v){m&&(v=w,w=e[v]),Yp(s,v,Gs(w,t,n,v,e,i))}),s}function oP(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 i=Array(o);++r<o;)i[r]=e[r+t];return i}function sP(e,t){return t.length<2?e:vh(e,oP(t,0,-1))}function aP(e,t){return t=Fl(t,e),e=sP(e,t),e==null||delete e[bh(sd(t))]}function lP(e){return gl(e)?void 0:e}var bb=kn?kn.isConcatSpreadable:void 0;function cP(e){return xn(e)||lo(e)||!!(bb&&e&&e[bb])}function uP(e,t,n,r,o){var i=-1,s=e.length;for(n||(n=cP),o||(o=[]);++i<s;){var a=e[i];n(a)?gf(o,a):o[o.length]=a}return o}function fP(e){var t=e==null?0:e.length;return t?uP(e):[]}function dP(e){return oh(ih(e,void 0,fP),e+"")}var pP=1,hP=2,gP=4,Mi=dP(function(e,t){var n={};if(e==null)return n;var r=!1;t=hh(t,function(i){return i=Fl(i,e),r||(r=i.length>1),i}),Jp(e,ub(e),n),r&&(n=Gs(n,pP|hP|gP,lP));for(var o=t.length;o--;)aP(n,t[o]);return n});const mP=(e,t)=>{const n=(i="")=>i.split("/").filter(Boolean),r=n(e.path),o=n(t);return o.map((i,s)=>({id:tn.v4(),allowContextActions:!0,text:i,to:{path:"/"+[...r].splice(0,r.length-o.length+s+1).join("/"),query:Mi(e.query,"fileId","page")},isStaticNav:!1}))},yP=(...e)=>{const t=e.pop();return[...e,{id:tn.v4(),allowContextActions:t.allowContextActions,text:t.text,onClick:()=>Ke.publish("app.files.list.load"),isTruncationPlaceholder:t.isTruncationPlaceholder,isStaticNav:t.isStaticNav}]};class ri{}Se(ri,"Cut","cut"),Se(ri,"Copy","copy");const bf=e=>e.clientY===0,Ao=(e,t,n)=>{var i;const r=n.$el.getBoundingClientRect(),o=bf(t)?((i=t.target)==null?void 0:i.getBoundingClientRect().top)||0:t.clientY;e.setProps({getReferenceClientRect:()=>({width:0,height:0,top:o,bottom:o,left:t.type==="contextmenu"&&!bf(t)?t.clientX:r.x,right:t.type==="contextmenu"&&!bf(t)?t.clientX:r.x})}),e.show()},Ks=e=>(e||"").split("_")[0],ii=(e,t,n=jt.DateTime.DATETIME_MED)=>e.setLocale(Ks(t)).toLocaleString(n),vb=(e,t,n=jt.DateTime.DATETIME_MED)=>ii(jt.DateTime.fromJSDate(e),t,n),bP=(e,t,n=jt.DateTime.DATETIME_MED)=>ii(jt.DateTime.fromHTTP(e),t,n),wb=(e,t,n=jt.DateTime.DATETIME_MED)=>ii(jt.DateTime.fromISO(e),t,n),vP=(e,t,n=jt.DateTime.DATETIME_MED)=>ii(jt.DateTime.fromRFC2822(e),t,n),Ro=(e,t)=>e.setLocale(Ks(t)).toRelative(),Sb=(e,t)=>Ro(jt.DateTime.fromJSDate(e),t),wP=(e,t)=>Ro(jt.DateTime.fromHTTP(e),t),SP=(e,t)=>Ro(jt.DateTime.fromISO(e),t),EP=(e,t)=>Ro(jt.DateTime.fromRFC2822(e),t),TP=1048576,An=(e,t)=>{const n=typeof e=="string"?parseInt(e):e;return n<0?"--":isNaN(n)?"?":B0.filesize(n,{round:n<TP?0:1,locale:Ks(t),base:10,output:"string"})};function Eb(e="",t=!1){const n=te.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}var vt=(e=>(e.open="sidebar.open",e.close="sidebar.close",e.toggle="sidebar.toggle",e.openWithPanel="sidebar.openWithPanel",e.setActivePanel="sidebar.setActivePanel",e))(vt||{});const vf=(e,t=void 0)=>{const n=window.localStorage.getItem(e),r=le(t);if(n)try{r.value=JSON.parse(n)}catch{r.value=n}return Et(()=>p(r),(o,i)=>{o!==i&&(o!==void 0?window.localStorage.setItem(e,typeof o=="string"?o:JSON.stringify(o)):window.localStorage.removeItem(e))},{deep:!0}),r},oi=()=>{const e=lt(),t=j(()=>{var d;return(d=e.options.embed)==null?void 0:d.enabled}),n=j(()=>{var d;return((d=e.options.embed)==null?void 0:d.target)==="location"}),r=j(()=>{var d;return(d=e.options.embed)==null?void 0:d.chooseFileName}),o=j(()=>{var d;return(d=e.options.embed)==null?void 0:d.chooseFileNameSuggestion}),i=j(()=>{var d;return((d=e.options.embed)==null?void 0:d.target)==="file"}),s=j(()=>{var d;return(d=e.options.embed)==null?void 0:d.fileTypes}),a=j(()=>{var d;return(d=e.options.embed)==null?void 0:d.messagesOrigin}),c=j(()=>{var d;return p(t)&&((d=e.options.embed)==null?void 0:d.delegateAuthentication)}),u=j(()=>{var d;return(d=e.options.embed)==null?void 0:d.delegateAuthenticationOrigin});return{isEnabled:t,isLocationPicker:n,chooseFileName:r,chooseFileNameSuggestion:o,isFilePicker:i,messagesTargetOrigin:a,isDelegatingAuthentication:c,fileTypes:s,postMessage:(d,m)=>{const w={};p(a)&&(w.targetOrigin=p(a)),window.parent.postMessage({name:d,data:m},w)},verifyDelegatedAuthenticationOrigin:d=>p(u)?p(u)===d:!0}},Tb=e=>{const{isEnabled:t}=oi(),n=(e==null?void 0:e.bus)||Ke,r=vf("oc_sideBarOpen",!1),o=le(!1),i=j({get(){return p(t)?p(o):p(r)},set(w){if(p(t)){o.value=w;return}r.value=w}}),s=async()=>{await zn();const w=document.getElementById("app-sidebar");w&&w.focus()},a=le(null),c=n.subscribe(vt.toggle,()=>{i.value=!p(i),p(i)&&s()}),u=n.subscribe(vt.close,()=>{i.value=!1,a.value=null}),l=n.subscribe(vt.open,()=>{i.value=!0,a.value=null,s()}),f=n.subscribe(vt.openWithPanel,w=>{i.value=!0,a.value=w,s()}),d=n.subscribe(vt.setActivePanel,w=>{a.value=w});Wn(()=>{n.unsubscribe(vt.toggle,c),n.unsubscribe(vt.close,u),n.unsubscribe(vt.open,l),n.unsubscribe(vt.openWithPanel,f),n.unsubscribe(vt.setActivePanel,d)});const m=(w,v)=>{n.subscribe(vt.setActivePanel,T=>{w===T&&setTimeout(()=>{v(T)},100)})};return{isSideBarOpen:dr(i),sideBarActivePanel:dr(a),onPanelActive:m}},sr=e=>e,Ab=e=>te.ShareTypes.containsAnyValue(te.ShareTypes.authenticated,e??[]),Rb=e=>te.ShareTypes.containsAnyValue(te.ShareTypes.unauthenticated,e??[]),AP=({isDirect:e})=>sr(e?"This item is directly shared with others.":"This item is shared with others through one of the parent folders."),RP=({isDirect:e})=>sr(e?"This item is directly shared via links.":"This item is shared via links through one of the parent folders."),_P=({resource:e,isDirect:t})=>({id:`files-sharing-${e.getDomSelector()}`,accessibleDescription:AP({isDirect:t}),label:sr("Show invited people"),icon:"group",category:"sharing",type:t?"user-direct":"user-indirect",fillType:"line",handler:()=>{Ke.publish(vt.openWithPanel,"sharing#peopleShares")}}),IP=({resource:e,isDirect:t})=>({id:`file-link-${e.getDomSelector()}`,accessibleDescription:RP({isDirect:t}),label:sr("Show links"),icon:"link",category:"sharing",type:t?"link-direct":"link-indirect",fillType:"line",handler:()=>{Ke.publish(vt.openWithPanel,"sharing#linkShares")}}),CP=({resource:e})=>({id:`resource-locked-${e.getDomSelector()}`,accessibleDescription:sr("Item locked"),label:sr("This item is locked"),icon:"lock",category:"system",type:"resource-locked",fillType:"line"}),PP=({resource:e})=>({id:`resource-processing-${e.getDomSelector()}`,accessibleDescription:sr("Item in processing"),label:sr("This item is in processing"),icon:"loop-right",category:"system",type:"resource-processing",fillType:"line"}),_b=({space:e,resource:t,ancestorMetaData:n,user:r})=>{const o=[];if(t.locked&&o.push(CP({resource:t})),t.processing&&o.push(PP({resource:t})),te.isProjectSpaceResource(e)&&e.isMember(r)||te.isPersonalSpaceResource(e)&&e.isOwner(r)){const s=Object.values(n).reduce((u,l)=>(u.push(...l.shareTypes||[]),u),[]),a=Ab(t.shareTypes);(a||Ab(s))&&o.push(_P({resource:t,isDirect:a}));const c=Rb(t.shareTypes);(c||Rb(s))&&o.push(IP({resource:t,isDirect:c}))}return o},Ib=e=>new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=o=>n(o),r.readAsArrayBuffer(e)}),Cb=e=>new Promise(t=>e.toBlob(t)),_o=()=>window.navigator.platform.match("Mac"),rt=We.defineStore("messages",()=>{const e=le([]),t=i=>{const s={...i,id:tn.v4()};return e.value.push(s),s},n=i=>{const s=a=>{var c,u;return(u=(c=a.response)==null?void 0:c.headers)==null?void 0:u.get("x-request-id")};return i.map(a=>s(a)).filter(Boolean).map(a=>`X-Request-Id: ${a}`).join(`\r
51
- `)};return{messages:e,showMessage:t,showErrorMessage:i=>{const s={id:tn.v4(),status:"danger",timeout:0,...i.errors&&{errorLogContent:n(i.errors)},...i};return e.value.push(s),s},removeMessage:i=>{e.value=p(e).filter(({id:s})=>i.id!==s)}}}),Io=We.defineStore("clipboard",()=>{const{$gettext:e}=Oe.useGettext(),{showMessage:t}=rt(),n=le(),r=le([]);return{action:n,resources:r,copyResources:a=>{a[0].canDownload()&&(n.value=ri.Copy,r.value=a,t({title:e("Copied to clipboard!"),status:"success"}))},cutResources:a=>{a[0].canDownload()&&(n.value=ri.Cut,r.value=a,t({title:e("Cut to clipboard!"),status:"success"}))},clearClipboard:()=>{n.value=void 0,r.value=[]}}}),Pb={cernFeatures:!1,concurrentRequests:{resourceBatchActions:4,shares:{create:4,list:2},sse:4},contextHelpers:!0,contextHelpersReadMore:!0,defaultExtension:"files",disabledExtensions:[],disableFeedbackLink:!0,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},lt=We.defineStore("config",()=>{const e=ir(),t=le(""),n=le(""),r=le({...Pb}),o=le([]),i=le([]),s=le([]),a=le(),c=le(),u=le(),l=le([]),f=le([]),d=j(()=>te.urlJoin(p(t)||window.location.origin,{trailingSlash:!0})),m=j(()=>!!p(a)),w=j(()=>!!p(c));return{options:r,oAuth2:a,openIdConnect:c,isOAuth2:m,isOIDC:w,customTranslations:s,apps:o,externalApps:i,sentry:u,theme:n,scripts:l,styles:f,serverUrl:d,loadConfig:T=>{var y;T.server&&(t.value=(y=T.server)!=null&&y.endsWith("/")?T.server:T.server+"/"),o.value=T.apps||[],s.value=T.customTranslations||[],a.value=T.auth,c.value=T.openIdConnect,u.value=T.sentry,l.value=T.scripts||[],f.value=T.styles||[],n.value=T.theme,T.options&&(r.value=fo({...Pb},T.options),p(r).ocm.openRemotely=p(r).cernFeatures,p(r).routing.idBased=!p(r).cernFeatures,p(r).routing.fullShareOwnerPaths=p(r).cernFeatures),T.external_apps&&(i.value=T.external_apps,T.external_apps.filter(Boolean).forEach(g=>{e.loadExternalAppConfig({appId:g.id,config:g.config})}))}}}),FP=ve.z.object({url:ve.z.string()}),OP=ve.z.object({apiUrl:ve.z.string().optional(),authUrl:ve.z.string().optional(),clientId:ve.z.string().optional(),clientSecret:ve.z.string().optional(),logoutUrl:ve.z.string().optional(),metaDataUrl:ve.z.string().optional(),url:ve.z.string().optional()}),kP=ve.z.object({authority:ve.z.string().optional(),client_id:ve.z.string().optional(),client_secret:ve.z.string().optional(),dynamic:ve.z.string().optional(),metadata_url:ve.z.string().optional(),post_logout_redirect_uri:ve.z.string().optional(),response_type:ve.z.string().optional(),scope:ve.z.string().optional()}).passthrough(),xP=ve.z.record(ve.z.any()),NP=ve.z.object({href:ve.z.string().optional()}),$P=ve.z.object({async:ve.z.boolean().optional(),src:ve.z.string().optional()}),DP=ve.z.object({cernFeatures:ve.z.boolean().optional(),concurrentRequests:ve.z.object({resourceBatchActions:ve.z.number().optional(),sse:ve.z.number().optional(),shares:ve.z.object({create:ve.z.number().optional(),list:ve.z.number().optional()}).optional()}).optional(),contextHelpers:ve.z.boolean().optional(),contextHelpersReadMore:ve.z.boolean().optional(),defaultExtension:ve.z.string().optional(),disabledExtensions:ve.z.array(ve.z.string()).optional(),disableFeedbackLink:ve.z.boolean().optional(),accountEditLink:ve.z.object({href:ve.z.string().optional()}).optional(),editor:ve.z.object({autosaveEnabled:ve.z.boolean().optional(),autosaveInterval:ve.z.number().optional(),openAsPreview:ve.z.union([ve.z.boolean(),ve.z.array(ve.z.string())]).optional()}).optional(),embed:ve.z.object({enabled:ve.z.boolean().optional(),target:ve.z.string().optional(),messagesOrigin:ve.z.string().optional(),delegateAuthentication:ve.z.boolean().optional(),delegateAuthenticationOrigin:ve.z.string().optional(),fileTypes:ve.z.array(ve.z.string()).optional(),chooseFileName:ve.z.boolean().optional(),chooseFileNameSuggestion:ve.z.string().optional()}).optional(),feedbackLink:ve.z.object({ariaLabel:ve.z.string().optional(),description:ve.z.string().optional(),href:ve.z.string().optional()}).optional(),isRunningOnEos:ve.z.boolean().optional(),loginUrl:ve.z.string().optional(),logoutUrl:ve.z.string().optional(),ocm:ve.z.object({openRemotely:ve.z.boolean().optional()}).optional(),routing:ve.z.object({fullShareOwnerPaths:ve.z.boolean().optional(),idBased:ve.z.boolean().optional()}).optional(),runningOnEos:ve.z.boolean().optional(),tokenStorageLocal:ve.z.boolean().optional(),upload:ve.z.object({companionUrl:ve.z.string().optional()}).optional(),userListRequiresFilter:ve.z.boolean().optional(),hideLogo:ve.z.boolean().optional()}),LP=ve.z.object({id:ve.z.string(),path:ve.z.string(),config:ve.z.record(ve.z.unknown()).optional()}),MP=ve.z.object({server:ve.z.string(),theme:ve.z.string(),options:DP,apps:ve.z.array(ve.z.string()).optional(),external_apps:ve.z.array(LP).optional(),customTranslations:ve.z.array(FP).optional(),auth:OP.optional(),openIdConnect:kP.optional(),sentry:xP.optional(),scripts:ve.z.array($P).optional(),styles:ve.z.array(NP).optional()}),Fb=We.defineStore("extensionPreferences",()=>{const e=qr.useLocalStorage("extensionPreferences",{});return{extensionPreferences:e,extractDefaultExtensionIds:(o,i)=>o.multiple?i.map(s=>s.id):o.defaultExtensionId?[o.defaultExtensionId]:[],getExtensionPreference:(o,i)=>{const s=e.value[o];return s||{extensionPointId:o,selectedExtensionIds:i}},setSelectedExtensionIds:(o,i)=>{if(!Object.hasOwn(p(e),o)){e.value[o]={extensionPointId:o,selectedExtensionIds:i};return}e.value[o].selectedExtensionIds=i}}}),Bi=We.defineStore("extensionRegistry",()=>{const e=lt(),t=le([]),n=u=>{t.value.push(u)},r=u=>{t.value=p(t).map(l=>le(p(l).filter(({id:f})=>!u.includes(f)))).filter(l=>p(l).length)},o=u=>{if(!u.id||!u.extensionType)throw new Error("ExtensionPoint must have an id and an extensionType");return p(t).flatMap(l=>p(l).filter(f=>{var d;return f.type===u.extensionType&&!e.options.disabledExtensions.includes(f.id)&&(!f.extensionPointIds||((d=f.extensionPointIds)==null?void 0:d.includes(u.id)))}))},i=le([]);return{extensions:t,registerExtensions:n,unregisterExtensions:r,requestExtensions:o,extensionPoints:i,registerExtensionPoints:u=>{i.value.push(u)},unregisterExtensionPoints:u=>{i.value=p(i).map(l=>le(p(l).filter(({id:f})=>!u.includes(f)))).filter(l=>p(l).length)},getExtensionPoints:(u={})=>p(i).flatMap(l=>p(l).filter(f=>!(Object.hasOwn(u,"extensionType")&&f.extensionType!==u.extensionType)))}}),wt=We.defineStore("modals",()=>{const e=le([]),t=j(()=>p(e).at(-1)),n=c=>p(e).find(u=>u.id===c);return{modals:e,activeModal:t,dispatchModal:c=>{const u={...c,id:tn.v4()};return e.value.push(u),u},updateModal:(c,u,l)=>{const f=n(c);f[u]=l},removeModal:c=>{e.value=p(e).filter(u=>u.id!==c)},removeAllModals:()=>{e.value=[]},setModalActive:c=>{const u=p(e).findIndex(f=>f.id===c);if(u<0)return;const l=n(c);p(e).splice(u,1),e.value.push(l)}}}),St=We.defineStore("user",()=>{const e=le();return{user:e,setUser:r=>{e.value=r,G0.setUser({username:r.onPremisesSamAccountName})},reset:()=>{e.value=null}}}),Qs=(e,t)=>{t!==void 0&&document.querySelector(":root").style.setProperty("--oc-"+e,t)},BP="thead-clicked",jP="highlight",UP="rowMounted",qP="contextmenuClicked",Ob="itemDropped",VP="itemDragged",zP=["xsmall","small","medium","large","xlarge","xxlarge","xxxlarge"];let WP="";const HP=()=>WP,GP={xxxsmall:"xxxs",xxsmall:"xxs",xsmall:"xs",small:"s",medium:"m",large:"l",xlarge:"xl",xxlarge:"xxl",xxxlarge:"xxxl",remove:"rm"};function Dr(e){return GP[e]}let kb=0;const xb=(e="")=>(e=e||"",kb+=1,e+kb);function KP(e,t,n,r){for(var o=-1,i=e==null?0:e.length;++o<i;)n=t(n,e[o],o,e);return n}function QP(e){return function(t){return e==null?void 0:e[t]}}var XP={À:"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"},YP=QP(XP),JP=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ZP="\\u0300-\\u036f",eF="\\ufe20-\\ufe2f",tF="\\u20d0-\\u20ff",nF=ZP+eF+tF,rF="["+nF+"]",iF=RegExp(rF,"g");function oF(e){return e=Pl(e),e&&e.replace(JP,YP).replace(iF,"")}var sF=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function aF(e){return e.match(sF)||[]}var lF=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function cF(e){return lF.test(e)}var Nb="\\ud800-\\udfff",uF="\\u0300-\\u036f",fF="\\ufe20-\\ufe2f",dF="\\u20d0-\\u20ff",pF=uF+fF+dF,$b="\\u2700-\\u27bf",Db="a-z\\xdf-\\xf6\\xf8-\\xff",hF="\\xac\\xb1\\xd7\\xf7",gF="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",mF="\\u2000-\\u206f",yF=" \\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",Lb="A-Z\\xc0-\\xd6\\xd8-\\xde",bF="\\ufe0e\\ufe0f",Mb=hF+gF+mF+yF,Bb="['’]",jb="["+Mb+"]",vF="["+pF+"]",Ub="\\d+",wF="["+$b+"]",qb="["+Db+"]",Vb="[^"+Nb+Mb+Ub+$b+Db+Lb+"]",SF="\\ud83c[\\udffb-\\udfff]",EF="(?:"+vF+"|"+SF+")",TF="[^"+Nb+"]",zb="(?:\\ud83c[\\udde6-\\uddff]){2}",Wb="[\\ud800-\\udbff][\\udc00-\\udfff]",ji="["+Lb+"]",AF="\\u200d",Hb="(?:"+qb+"|"+Vb+")",RF="(?:"+ji+"|"+Vb+")",Gb="(?:"+Bb+"(?:d|ll|m|re|s|t|ve))?",Kb="(?:"+Bb+"(?:D|LL|M|RE|S|T|VE))?",Qb=EF+"?",Xb="["+bF+"]?",_F="(?:"+AF+"(?:"+[TF,zb,Wb].join("|")+")"+Xb+Qb+")*",IF="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",CF="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",PF=Xb+Qb+_F,FF="(?:"+[wF,zb,Wb].join("|")+")"+PF,OF=RegExp([ji+"?"+qb+"+"+Gb+"(?="+[jb,ji,"$"].join("|")+")",RF+"+"+Kb+"(?="+[jb,ji+Hb,"$"].join("|")+")",ji+"?"+Hb+"+"+Gb,ji+"+"+Kb,CF,IF,Ub,FF].join("|"),"g");function kF(e){return e.match(OF)||[]}function xF(e,t,n){return e=Pl(e),t=t,t===void 0?cF(e)?kF(e):aF(e):e.match(t)||[]}var NF="['’]",$F=RegExp(NF,"g");function DF(e){return function(t){return KP(xF(oF(t).replace($F,"")),e,"")}}var Yb=DF(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const Jb=ve.z.object({name:ve.z.string().optional(),slogan:ve.z.string().optional(),logo:ve.z.string().optional(),urls:ve.z.object({accessDeniedHelp:ve.z.string(),imprint:ve.z.string(),privacy:ve.z.string()}).optional(),shareRoles:ve.z.record(ve.z.string(),ve.z.object({iconName:ve.z.string()})).optional()}),LF=ve.z.object({breakpoints:ve.z.record(ve.z.string()).optional(),roles:ve.z.record(ve.z.string()).optional(),colorPalette:ve.z.record(ve.z.string()).optional(),fontFamily:ve.z.string().optional(),fontSizes:ve.z.record(ve.z.string()).optional(),sizes:ve.z.record(ve.z.string()).optional(),spacing:ve.z.record(ve.z.string()).optional()}),Zb=Jb.extend({designTokens:LF.optional(),favicon:ve.z.string().optional(),background:ve.z.string().optional()}),MF=Zb.extend({isDark:ve.z.boolean(),label:ve.z.string()}),ev=ve.z.object({defaults:Zb,themes:ve.z.array(MF)}),BF=ve.z.object({common:Jb.optional(),clients:ve.z.object({web:ev})}),jF="oc_currentThemeName",si=We.defineStore("theme",()=>{const e=qr.useLocalStorage(jF,null),t=qr.usePreferredDark(),n=le(),r=le([]),o=l=>{const f=od(l.common,l.clients.web.defaults);r.value=l.clients.web.themes.map(d=>od(f,d)),i()},i=()=>{const l=p(r).find(d=>!d.isDark),f=p(r).find(d=>d.isDark);c(p(r).find(d=>d.label===p(e))||(p(t)?f:l)||p(r)[0],!1)},s=()=>{e.value=null,i()},a=j(()=>e.value===null),c=(l,f=!0)=>{var m,w,v,T,y,g;n.value=l,f&&(e.value=p(n).label);const d=[{name:"breakpoints",prefix:"breakpoint"},{name:"roles",prefix:"role"},{name:"colorPalette",prefix:"color"},{name:"fontSizes",prefix:"font-size"},{name:"sizes",prefix:"size"},{name:"spacing",prefix:"spacing"}];Qs("font-family",p(n).designTokens.fontFamily),d.forEach(h=>{for(const b in p(n).designTokens[h.name])Qs(`${h.prefix}-${Yb(b)}`,p(n).designTokens[h.name][b])}),(w=(m=p(n).designTokens)==null?void 0:m.roles)!=null&&w.chrome||(Qs("role-chrome",(T=(v=p(n).designTokens)==null?void 0:v.roles)==null?void 0:T.surfaceContainer),Qs("role-on-chrome",(g=(y=p(n).designTokens)==null?void 0:y.roles)==null?void 0:g.onSurface))};return{availableThemes:r,currentTheme:n,initializeThemes:o,setAndApplyTheme:c,setAutoSystemTheme:s,isCurrentThemeAutoSystem:a,getRoleIcon:l=>{var f;return((f=p(n).shareRoles[l.id])==null?void 0:f.iconName)||"user"}}}),zt=We.defineStore("shares",()=>{const e=Qe(),{getRoleIcon:t}=si(),n=le(!1),r=le([]),o=le([]),i=le({}),s=R=>{i.value=R.reduce((A,N)=>(A[N.id]={...N,icon:t(N)},A),{})},a=R=>{const A=p(r).find(({id:N})=>N===R.id);if(A){Object.assign(A,R);return}p(r).push(R)},c=R=>{r.value=R},u=R=>{p(r).push(...R)},l=R=>{r.value=p(r).filter(({id:A})=>A!==R.id)},f=()=>{r.value=[],o.value=[],n.value=void 0},d=()=>{const R=Object.values(e.ancestorMetaData).map(({id:A})=>A);if(!R.length){r.value=[],o.value=[];return}p(r).forEach(A=>{R.includes(A.resourceId)||l(A)}),p(o).forEach(A=>{R.includes(A.resourceId)||v(A)})},m=R=>{o.value=R},w=R=>{const A=p(o).find(({id:N})=>N===R.id);if(A){Object.assign(A,R);return}p(o).push(R)},v=R=>{o.value=p(o).filter(({id:A})=>A!==R.id)},T=R=>{n.value=R},y=R=>{const A=$=>{const V=new Set;return $.forEach(X=>{V.add(X.shareType)}),Array.from(V)},N=[...e.resources,e.currentFolder].find($=>($==null?void 0:$.id)===R);if(!N||te.isProjectSpaceResource(N))return;const L=[...p(r),...p(o)];e.updateResourceField({id:N.id,field:"shareTypes",value:A(L.filter($=>!$.indirect))});const x=e.getAncestorById(R);x&&e.updateAncestorField({path:x.path,field:"shareTypes",value:A(L.filter($=>!$.indirect))})};return{loading:n,collaboratorShares:r,linkShares:o,graphRoles:i,setGraphRoles:s,setLoading:T,setCollaboratorShares:c,setLinkShares:m,removeOrphanedShares:d,pruneShares:f,addShare:async({clientService:R,space:A,resource:N,options:L})=>{const $=await R.graphAuthenticated.permissions.createInvite(A.id,N.id,L,p(i));return u([$]),y(N.id),$},updateShare:async({clientService:R,space:A,resource:N,collaboratorShare:L,options:x})=>{const $=R.graphAuthenticated.permissions,V={roles:x.roles,expirationDateTime:x.expirationDateTime},X=await $.updatePermission(A.id,N.id,L.id,V,p(i));return a(X),X},deleteShare:async({clientService:R,space:A,resource:N,collaboratorShare:L})=>{await R.graphAuthenticated.permissions.deletePermission(A.id,N.id,L.id),l(L),y(N.id)},addLink:async({clientService:R,space:A,resource:N,options:L})=>{const $=await R.graphAuthenticated.permissions.createLink(A.id,N.id,L),V=e.selectedResources,X=V.some(({fileId:ee})=>ee===N.fileId)||V.length===0&&e.currentFolder.fileId===N.fileId;if(w($),y(N.id),!X){const ee=e.ancestorMetaData[N.path]??null;if(ee){const{shareTypes:se}=ee;se.includes(te.ShareTypes.link.value)||e.updateAncestorField({path:ee.path,field:"shareTypes",value:[...se,te.ShareTypes.link.value]})}}return $},updateLink:async({clientService:R,space:A,resource:N,linkShare:L,options:x})=>{const $=R.graphAuthenticated.permissions;let V;if(Object.hasOwn(x,"password"))V=await $.setPermissionPassword(A.id,N.id,L.id,{password:x.password}),L.hasPassword=!!x.password;else{const X={link:{...x.type&&{type:x.type},...x.displayName&&{"@libre.graph.displayName":x.displayName}},...Object.hasOwn(x,"expirationDateTime")&&{expirationDateTime:x.expirationDateTime}};V=await $.updatePermission(A.id,N.id,L.id,X)}return w(V),V},deleteLink:async({clientService:R,space:A,resource:N,linkShare:L})=>{await R.graphAuthenticated.permissions.deletePermission(A.id,N.id,L.id),v(L),y(N.id)}}}),tv=e=>e.sort((t,n)=>n.permissions.length-t.permissions.length),Co=async({graphClient:e,driveType:t,configStore:n,graphRoles:r,signal:o})=>{var c;const i=await e.drives.listMyDrives(r,{orderBy:"name asc",filter:`driveType eq ${t}`},{signal:o});if(!i.length)return[];if(t!=="mountpoint"||!((c=n.options.routing)!=null&&c.fullShareOwnerPaths))return i;const s={};i.forEach(u=>{const{rootId:l,driveAlias:f}=u.root.remoteItem;s[l]=f});const a=Object.entries(s).map(([u,l])=>te.buildSpace({id:te.extractStorageId(u),name:l,driveType:l.split("/")[0],driveAlias:l,path:"/",serverUrl:n.serverUrl},r));return[...i,...a]},ct=We.defineStore("spaces",()=>{const e=St(),t=lt(),n=zt(),r=le([]),o=le(),i=le(!1),s=le(!1),a=le(!1),c=le(null),u=le([]),l=le([]),f=j(()=>p(r).find(ie=>te.isPersonalSpaceResource(ie)&&ie.isOwner(e.user))),d=ie=>{i.value=ie},m=ie=>{s.value=ie},w=ie=>{a.value=ie},v=ie=>{o.value=ie},T=ie=>{c.value=ie},y=ie=>{if(!te.isProjectSpaceResource(ie))return[];const re=n.collaboratorShares.filter(fe=>fe.resourceId===ie.id);return tv(re)},g=ie=>{p(r).push(...ie)},h=ie=>{r.value=p(r).filter(({id:re})=>re!==ie.id)},b=ie=>p(r).find(re=>ie==re.id),S=async({graphClient:ie,space:re,signal:fe})=>(await N({graphClient:ie,signal:fe}),p(r).find(ue=>{var Z,oe;return te.isMountPointSpaceResource(ue)&&((oe=(Z=ue.root)==null?void 0:Z.remoteItem)==null?void 0:oe.id)===re.id})),E=({driveAliasPrefix:ie,id:re,shareName:fe})=>{const ue=te.buildShareSpaceResource({driveAliasPrefix:ie,id:re,shareName:fe,serverUrl:t.serverUrl});return g([ue]),ue},I=ie=>{const re=p(r).find(({id:fe})=>fe===ie.id);if(re){Object.assign(re,ie);return}g([ie])},R=({id:ie,field:re,value:fe})=>{const ue=p(r).find(Z=>ie===Z.id);ue&&(ue[re]=fe)},A=async({graphClient:ie})=>{a.value=!0;try{const[re,fe]=await Promise.all([Co({graphClient:ie,driveType:"personal",configStore:t,graphRoles:n.graphRoles}),Co({graphClient:ie,driveType:"project",configStore:t,graphRoles:n.graphRoles})]);g([...re,...fe]),i.value=!0}finally{a.value=!1}},N=async({graphClient:ie,signal:re})=>{if(!p(s))try{const fe=await Co({graphClient:ie,driveType:"mountpoint",configStore:t,graphRoles:n.graphRoles,signal:re});g(fe)}finally{s.value=!0}};return{spaces:r,spacesInitialized:i,mountPointsInitialized:s,spacesLoading:a,currentSpace:o,personalSpace:f,defaultSpaceImageBlobURL:c,imagesLoading:u,readmesLoading:l,getSpace:b,createShareSpace:E,setSpacesInitialized:d,setMountPointsInitialized:m,setSpacesLoading:w,setCurrentSpace:v,setDefaultSpaceImageBlobURL:T,getSpaceMembers:y,getMountPointForSpace:S,addSpaces:g,removeSpace:h,upsertSpace:I,updateSpaceField:R,loadSpaces:A,loadMountPoints:N,reloadProjectSpaces:async({graphClient:ie,signal:re})=>{const fe=await Co({graphClient:ie,driveType:"project",configStore:t,graphRoles:n.graphRoles,signal:re});r.value=p(r).filter(ue=>!te.isProjectSpaceResource(ue)),g(fe)},addToImagesLoading:ie=>{p(u).includes(ie)||p(u).push(ie)},removeFromImagesLoading:ie=>{u.value=p(u).filter(re=>re!==ie)},purgeImagesLoading:()=>{u.value=[]},addToReadmesLoading:ie=>{p(l).includes(ie)||p(l).push(ie)},removeFromReadmesLoading:ie=>{l.value=p(l).filter(re=>re!==ie)},purgeReadmesLoading:()=>{l.value=[]}}}),Qe=We.defineStore("resources",()=>{const e=lt(),t=ct(),n=St(),r=le([]),o=le(),i=le({}),s=le([]),a=j(()=>{let H=p(r);return p(x)||(H=H.filter(_=>!_.name.startsWith("."))),H}),c=j(()=>{const H=p(r).filter(({type:M})=>M==="file").length,_=p(r).filter(({type:M,name:q})=>M==="file"&&q.startsWith(".")).length,F=p(r).filter(({type:M})=>M==="folder").length,G=p(r).filter(({type:M,name:q})=>M==="folder"&&q.startsWith(".")).length,z=p(r).filter(te.isProjectSpaceResource).length;return{files:H,hiddenFiles:_,folders:F,hiddenFolders:G,spaces:z}}),u=H=>{r.value=H},l=H=>{r.value=p(r).filter(_=>!H.find(({id:F})=>F===_.id))},f=()=>{r.value=[]},d=H=>{const _=p(r).find(({id:F})=>F===H.id);if(_){Object.assign(_,H);return}p(r).push(H)},m=H=>{const _=p(r).filter(F=>!H.some(G=>G.path===F.path));r.value=[..._,...H]},w=({id:H,field:_,value:F})=>{const G=p(r).find(z=>H===z.id);G&&(G[_]=F)},v=H=>{o.value=H},T=()=>{o.value=void 0},y=H=>{r.value=H.resources,o.value=H.currentFolder},g=()=>{r.value=[],o.value=void 0,h.value=[]},h=le([]),b=le(null),S=j(()=>p(r).filter(H=>p(h).includes(H.id))),E=H=>{const _=H.find(F=>!p(h).includes(F));_&&(b.value=_),h.value=H},I=H=>{b.value=H,p(h).includes(H)||p(h).push(H)},R=H=>{b.value=H,p(h).includes(H)&&(h.value=p(h).filter(_=>_!==H))},A=H=>{p(h).includes(H)?R(H):I(H)},N=()=>{h.value=[]},L=H=>{b.value=H},x=le(!0),$=le(!0),V=le(!1),X=le(!0),ee=H=>{x.value=H,window.localStorage.setItem("oc_hiddenFilesShown",H.toString())},se=H=>{$.value=H,window.localStorage.setItem("oc_fileExtensionsShown",H.toString())},ie=H=>{V.value=H,window.localStorage.setItem("oc_webDavDetailsShown",H.toString())},re=H=>{X.value=H,window.localStorage.setItem("oc_disabledSpacesShown",H.toString())},fe=H=>{i.value=H};return{resources:r,currentFolder:o,activeResources:a,totalResourcesCount:c,setResources:u,removeResources:l,clearResources:f,upsertResource:d,upsertResources:m,updateResourceField:w,setCurrentFolder:v,clearCurrentFolder:T,initResourceList:y,clearResourceList:g,selectedIds:h,latestSelectedId:b,selectedResources:S,setSelection:E,addSelection:I,removeSelection:R,toggleSelection:A,resetSelection:N,setLastSelectedId:L,areHiddenFilesShown:x,areFileExtensionsShown:$,areWebDavDetailsShown:V,areDisabledSpacesShown:X,setAreHiddenFilesShown:ee,setAreFileExtensionsShown:se,setAreWebDavDetailsShown:ie,setAreDisabledSpacesShown:re,ancestorMetaData:i,setAncestorMetaData:fe,updateAncestorField:({path:H,field:_,value:F})=>{const G=p(i)[H]??null;G&&(G[_]=F)},loadAncestorMetaData:({folder:H,space:_,client:F,signal:G})=>{const z={[H.path]:{id:H.fileId,shareTypes:H.shareTypes,parentFolderId:H.parentFolderId,spaceId:_.id,path:H.path}},M=[],q=[je.FileId,je.ShareTypes,je.FileParent],de=Eb(H.path),Ae=t.spaces,De=()=>Ae.filter(_e=>te.isMountPointSpaceResource(_e)&&te.extractStorageId(_e.root.remoteItem.rootId)===_.id);let ke=!0;if(e.options.routing.fullShareOwnerPaths){const _e=Ae.find(Le=>te.isProjectSpaceResource(Le)&&Le.id===_.id);ke=_.isOwner(n.user)||(_e==null?void 0:_e.isMember(n.user))}for(const _e of de){const Le=p(i)[_e]??null;if((Le==null?void 0:Le.spaceId)===_.id){z[_e]=Le;continue}if(!ke&&!De().find(Y=>_e.startsWith(Y.root.remoteItem.path)))break;M.push(F.listFiles(_,{path:_e},{depth:0,davProperties:q,signal:G}).then(({resource:Y})=>{z[_e]={id:Y.fileId,shareTypes:Y.shareTypes,parentFolderId:Y.parentFolderId,spaceId:_.id,path:_e}}))}return Promise.all(M).then(()=>{if(!Object.keys(z).includes("/")){const _e=p(i)["/"];if((_e==null?void 0:_e.spaceId)===_.id)z["/"]=_e;else{const{parentFolderId:Le}=Object.values(z)[0],Y=t.spaces.find(({id:xe})=>Le.startsWith(xe));Y&&(z["/"]={id:Y.id,shareTypes:Y.shareTypes,parentFolderId:Y.id,spaceId:Y.id,path:"/"})}}fe(z)})},getAncestorById:H=>Object.values(p(i)).find(_=>H===_.id),deleteQueue:s,addResourcesIntoDeleteQueue:H=>{s.value=s.value.concat(H.filter(_=>!p(s).includes(_)))},removeResourcesFromDeleteQueue:H=>{s.value=s.value.filter(_=>!H.includes(_))}}}),Po=We.defineStore("webWorkers",()=>{const e=le([]);return{createWorker:(i,{needsTokenRenewal:s=!1}={})=>{const a=tn.v4(),c=qr.useWebWorker(i,{type:"module",name:a}),u={id:a,needsTokenRenewal:s,...c};return p(e).push(u),u},terminateWorker:i=>{const s=p(e).find(a=>i===a.id);s&&(s.terminate(),e.value=p(e).filter(a=>i!==a.id))},terminateAllWorkers:()=>{p(e).forEach(({terminate:i})=>{i()}),e.value=[]},updateAccessTokens:i=>{p(e).filter(({needsTokenRenewal:s})=>s).forEach(({post:s})=>{s(JSON.stringify({topic:"tokenUpdate",data:{accessToken:`Bearer ${i}`}}))})}}}),Xs=(e={})=>{const t=e.router||qe(),n=e.configStore||lt();return{replaceInvalidFileRoute:({space:o,resource:i,path:s,fileId:a})=>{var u;if(!((u=n.options.routing)!=null&&u.idBased)||s===i.path&&a===i.fileId)return!1;const c=rr(o,i,{configStore:n});return t.replace(c),!0}}},Ys=()=>{const e=Qt();return j(()=>p(e).name)},nv=(e,t)=>{const n=Qt();return j(()=>p(n).meta[e]||t)},Js=(e,t)=>{const n=qe();return j({get(){return At(p(n.currentRoute).params[e])||t},async set(r){p(n.currentRoute).params[e]!==r&&await n.replace({params:{...p(n.currentRoute).params,[e]:r}})}})};let rv=Promise.resolve();const ln=(e,t)=>{const n=qe();return j({get(){return p(n.currentRoute).query[e]||t},set(r){if(p(n.currentRoute).query[e]===r)return;rv=rv.then(async()=>{try{await n.replace({path:p(n.currentRoute).path,query:{...p(n.currentRoute).query,[e]:r}})}catch{}})}})},Tr=e=>{const t=ln(e.name),n=vf(UF(e));return Et(()=>p(t)?{value:p(t),source:"route"}:p(n)?{value:p(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},UF=e=>["oc-options",e.storagePrefix,e.name].filter(Boolean).join("_"),Ar=(e,...t)=>{const n=le(!1),r=qe(),o=Qt();return Et(o,()=>{n.value=e(r,...t)},{immediate:!0}),n},Zs="contextRouteName",wf="contextRouteParams",Sf="contextRouteQuery",ea=e=>{var i;const{params:t,query:n}=e,r={},o=["fileId","shareId","q_share-visibility","page"].concat(((i=e.meta)==null?void 0:i.contextQueryItems)||[]);for(const s of o)r[s]=n[s];return{[Zs]:e.name,[wf]:t,[Sf]:r}},iv=e=>({routeName:At(e[Zs]),routeParams:e[wf],routeQuery:e[Sf]}),At=e=>Array.isArray(e)?e[0].toString():e==null?void 0:e.toString();function ov({router:e,currentFileContext:t}){const n=a=>{const{fileName:c,routeName:u,routeParams:l,routeQuery:f}=p(a);return p(u)?e.push({name:p(u),params:p(l),query:{...p(f),scrollTo:p(c)}}):e.push({path:"/"})},{replaceInvalidFileRoute:r}=Xs({router:e}),o=(a,c)=>{const u=p(a);return r({space:p(u.space),resource:c,path:p(u.item),fileId:p(u.itemId)})},i=le(!1);return{replaceInvalidFileRoute:o,closeApp:()=>(i.value=!0,n(t)),closed:i}}const Xe=()=>vr("$clientService");function Ef({clientService:e}){e=e||Xe();const t=an(),n=St();return{getUrlForResource:(c,u,l)=>{var f;return e.webdav.getFileUrl(c,u,{isUrlSigningEnabled:t.supportUrlSigning,username:(f=n.user)==null?void 0:f.onPremisesSamAccountName,...l})},revokeUrl:c=>e.webdav.revokeUrl(c),getFileContents:(c,u)=>e.webdav.getFileContents(p(p(c).space),{path:p(p(c).item)},{...u}),getFileInfo:(c,u={})=>e.webdav.getFileInfo(p(p(c).space),{path:p(p(c).item),fileId:p(p(c).itemId)},u),putFileContents:(c,u)=>e.webdav.putFileContents(p(p(c).space),{path:p(p(c).item),...u})}}const Tf=()=>vr("$authService");class Rr{}Se(Rr,"allFiles","all-files"),Se(Rr,"currentFolder","current-folder");const Af=()=>{const e=lt(),t=Xe(),n=ct(),r=Qe(),o=an(),i=j(()=>{var d;return(d=o.searchContent)==null?void 0:d.enabled}),s=j(()=>r.areHiddenFilesShown),a=j(()=>n.spaces.filter(te.isProjectSpaceResource)),c=d=>p(a).find(m=>m.id===d),u=hn.useTask(function*(d,m,w=null){if(e.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:t.graphAuthenticated,signal:d})),!m)return{totalResults:null,values:[]};const{resources:v,totalResults:T}=yield*te.call(t.webdav.search(m,{searchLimit:w,davProperties:Rs.Default,signal:d}));return{totalResults:T,values:v.map(y=>{const g=c(y.parentFolderId),h=g||y;return e.options.routing.fullShareOwnerPaths&&h.remoteItemPath&&(h.path=te.urlJoin(h.remoteItemPath,h.path)),{id:h.id,data:h}}).filter(({data:y})=>!y.name.startsWith(".")||p(s))}}).restartable();return{search:async(d,m=null)=>await u.perform(d,m),buildSearchTerm:({term:d,isTitleOnlySearch:m,tags:w,lastModified:v,mediaType:T,scope:y,useScope:g})=>{const h=[],b=d,S=p(i)&&!m;if(b){let E=`name:"*${b}*"`;S&&(E=`(name:"*${b}*" OR content:"${b}")`),h.push(E)}if(g&&y&&h.push(`scope:${y}`),w){const E=w.split("+").map(I=>`"${I}"`);h.push(`tag:(${E.join(" OR ")})`)}if(v&&h.push(`mtime:${v}`),T){const E=T.split("+").map(I=>`"${I}"`);h.push(`mediatype:(${E.join(" OR ")})`)}return h.sort((E,I)=>Number(E.startsWith("scope:"))-Number(I.startsWith("scope:"))).join(" AND ")}}};function sv({currentRoute:e,clientService:t}){const n=le(!1),{webdav:r}=t,{replaceInvalidFileRoute:o}=Xs(),{getFileInfo:i}=Ef({clientService:t}),s=Tf(),a=ct(),{buildSearchTerm:c,search:u}=Af(),l=ln("contextRouteQuery"),f=Qe(),{activeResources:d}=We.storeToRefs(f);return{isFolderLoading:n,loadFolderForFileContext:async w=>{var v,T;n.value=!0;try{if(w=p(w),(v=p(l))!=null&&v.term){const R=c({term:(T=p(l))==null?void 0:T.term}),{values:A}=await u(R,200),N=A.filter(({data:L})=>te.isSearchResource(L)).map(L=>L.data);f.initResourceList({currentFolder:null,resources:N}),n.value=!1;return}if(["files-shares-with-me","files-shares-with-others","files-shares-via-link","files-common-favorites"].includes(p(w.routeName))){await Ky.getTask().perform(),n.value=!1;return}f.clearResourceList();const g=p(w.space),h=await i(w,{davProperties:[je.FileId]});if(o({space:g,resource:h,path:p(w.item),fileId:p(w.itemId)}),a.spaces.some(R=>{var A;return te.isMountPointSpaceResource(R)&&((A=R.root.remoteItem)==null?void 0:A.id)===h.id})){const R=await i(w);f.initResourceList({currentFolder:R,resources:[R]}),n.value=!1;return}const S=yt.dirname(h.path),{resource:E,children:I}=await r.listFiles(g,{path:S});E.type==="file"?f.initResourceList({currentFolder:E,resources:[E]}):f.initResourceList({currentFolder:E,resources:I})}catch(y){if(y.statusCode===401)return s.handleAuthError(p(e));f.setCurrentFolder(null),console.error(y)}n.value=!1},activeFiles:d}}function Rf({appsStore:e,applicationId:t}){return{applicationMeta:j(()=>{const r=e.apps[t];if(!r)throw new Error(`useAppConfig: could not find config for applicationId: ${t}`);return r||{}})}}const ai=()=>Ke;function av({titleSegments:e,eventBus:t}){const n=si(),{currentTheme:r}=We.storeToRefs(n);t=t||ai(),Et(e,o=>{const i=p(o),s=" - ",a={shortDocumentTitle:i.join(s),fullDocumentTitle:[...i,p(r).name].join(s)};t.publish("runtime.documentTitle.changed",a)},{immediate:!0,deep:!0})}function qF({appsStore:e,applicationId:t,applicationName:n,currentFileContext:r,currentRoute:o}){const i=Rf({applicationId:t,appsStore:e}),{$gettext:s}=Oe.useGettext(),a=j(()=>{var l,f,d;const c=yt.basename(p((l=p(r))==null?void 0:l.fileName))||s(((d=(f=p(o))==null?void 0:f.meta)==null?void 0:d.title)||""),u=p(p(i).applicationMeta);return[c,p(n)||u.name||u.id].filter(Boolean)});av({titleSegments:a})}function lv(e={}){const t=e.clientService??Xe(),n=e.authStore??Zr();return{makeRequest:(o,i,s={})=>{const a=n.accessToken?t.httpAuthenticated:t.httpUnAuthenticated;return s.headers=s.headers||{},n.publicLinkContextReady&&(n.publicLinkPassword&&(s.headers.Authorization="Basic "+wr.from(["public",n.publicLinkPassword].join(":")).toString("base64")),n.publicLinkToken&&(s.headers["public-token"]=n.publicLinkToken)),s.method=o,s.url=i,a.request(s)}}}const cv=()=>{const e=ct();return{areSpacesLoading:j(()=>!e.spacesInitialized||e.spacesLoading)}},uv=(e={})=>{const t=ct(),{areSpacesLoading:n}=cv(),r=ln("shareId"),o=ln("fileId"),i=j(()=>At(p(o))),s=lt(),a=Xe(),c=j(()=>t.spaces),u=le(null),l=le(null),f=le(!1),d=m=>{const w=m.split("/");return p(c).find(v=>{if(!m.startsWith(v.driveAlias))return!1;const T=v.driveAlias.split("/");return w.length<T.length||w.slice(0,T.length).join("/")!==v.driveAlias?!1:v})};return za(()=>{const m=p(e.driveAliasAndItem);!(m!=null&&m.startsWith("personal/"))&&!(m!=null&&m.startsWith("project/"))&&t.setCurrentSpace(null)}),Et([e.driveAliasAndItem,n],async([m,w],[v,T])=>{if(m===v&&w===T)return;if(!m||m.startsWith("virtual/")){u.value=null,l.value=null;return}if(p(u)&&m.startsWith(p(u).driveAlias)){l.value=te.urlJoin(m.slice(p(u).driveAlias.length),{leadingSlash:!0});return}let g=null,h=null;if(m.startsWith("public/")||m.startsWith("ocm/")){const[b,...S]=m.split("/").slice(1);g=p(c).find(E=>E.id===b),h=S.join("/")}else if(m.startsWith("share/")||m.startsWith("ocm-share/")){const[b,...S]=m.split("/").slice(1),E=m.startsWith("ocm-share/")?"ocm-share":"share";let I=At(p(r));I!=null&&I.includes(":")&&(I=[te.SHARE_JAIL_ID,I].join("!")),g=t.getSpace(I)||t.createShareSpace({driveAliasPrefix:E,id:I,shareName:p(b)}),h=S.join("/")}else p(i)?g=p(c).find(b=>p(i).startsWith(`${b.fileId}`)):g=d(m),g||(!t.mountPointsInitialized&&s.options.routing.fullShareOwnerPaths&&(f.value=!0,await t.loadMountPoints({graphClient:a.graphAuthenticated})),g=d(m)),g&&(h=m.slice(g.driveAlias.length));u.value=g,l.value=te.urlJoin(h,{leadingSlash:!0}),f.value=!1},{immediate:!0,deep:!0}),Et(u,m=>{t.setCurrentSpace(m)},{immediate:!0}),{space:u,item:l,itemId:i,loading:f}};function fv(e){const t=qe(),n=ir(),r=Qt(),o=e.clientService??Xe(),i=e.applicationId,s=Zr(),{publicLinkContextReady:a}=We.storeToRefs(s),c=Js("driveAliasAndItem"),{space:u,item:l,itemId:f,loading:d}=uv({driveAliasAndItem:c}),m=j(()=>{if(p(d))return null;let w;return p(u)?w=te.urlJoin(p(u).webDavPath,p(l)):w=te.urlJoin(At(p(r).params.filePath)),{path:w,driveAliasAndItem:p(c),space:p(u),item:p(l),itemId:p(f),fileName:yt.basename(w),routeName:At(p(r).query[Zs]),...iv(p(r).query)}});return qF({appsStore:n,applicationId:i,applicationName:e.applicationName,currentFileContext:m,currentRoute:r}),{isPublicLinkContext:a,currentFileContext:m,...fh({appsStore:n,...e}),...ov({router:t,currentFileContext:m}),...Ef({clientService:o}),...sv({clientService:o,currentRoute:r}),...lv({clientService:o,currentRoute:p(r)})}}const VF=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}}),zF=()=>[{path:"/list",redirect:e=>Nn("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:"personal/home"}})},{path:"/list/all/:item(.*)",redirect:e=>Nn("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:te.urlJoin("personal/home",At(e.params.item),{leadingSlash:!1})}})},{path:"/list/favorites",redirect:e=>Ci("files-common-favorites",e)},{path:"/list/shared-with-me",redirect:e=>$n("files-shares-with-me",e)},{path:"/list/shared-with-others",redirect:e=>$n("files-shares-with-others",e)},{path:"/list/shared-via-link",redirect:e=>$n("files-shares-via-link",e)},{path:"/trash-bin",redirect:e=>Fi("files-trash-generic",e)},{path:"/public/list/:item(.*)",redirect:e=>Pi("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(VF),WF=(e,...t)=>{const[n,...r]=t.map(o=>{const i={"files-personal":Nn("files-spaces-generic").name,"files-favorites":Ci("files-common-favorites").name,"files-shared-with-others":$n("files-shares-with-others").name,"files-shared-with-me":$n("files-shares-with-me").name,"files-trashbin ":Fi("files-trash-generic").name,"files-public-list":Pi("files-public-link").name}[o.name.toString()];return i&&console.warn(`route name "${name}" is deprecated, use "${i.toString()}" instead.`),{...o,...!!i&&{name:i}}});return wl(e,n,...r)},HF={name:"root",path:"/",redirect:e=>Nn("files-spaces-generic",e)},GF=e=>[HF,...mT(e),...vT(e),...wT(e),...yT(e),...ST(e),...zF()],li=()=>{const{$gettext:e}=Oe.useGettext(),t=Xe();return{checkSpaceNameModalInput:(o,i)=>o.trim()===""?i(e("Space name cannot be empty")):o.length>255?i(e("Space name cannot exceed 255 characters")):/[/\\.:?*"><|]/.test(o)?i(e(`Space name cannot contain the following characters: / \\\\ . : ? * " > < |'`)):i(null),getDefaultMetaFolder:async o=>{const{children:i}=await t.webdav.listFiles(o);return i.find(({name:s})=>s===".space")}}},fn=e=>{const t=St(),n=ct(),r=lt(),o=j(()=>n.spaces),i=Js("driveAliasAndItem"),s=f=>p(e==null?void 0:e.space)||p(o).find(d=>d.id===f),a=f=>{var T,y,g,h,b;let d=f.storageId;((T=p(i))!=null&&T.startsWith("public/")||(y=p(i))!=null&&y.startsWith("ocm/"))&&(d=p(i).split("/")[1]);const m=s(d);if(m&&!te.isMountPointSpaceResource(m))return m;const w=te.isShareResource(f)&&f.shareTypes.includes(te.ShareTypes.remote.value)||(g=f==null?void 0:f.id)!=null&&g.toString().startsWith(te.OCM_PROVIDER_ID)?"ocm-share":"share";let v;return f.remoteItemPath?v=yt.basename(f.remoteItemPath):(h=p(i))!=null&&h.startsWith("share/")||(b=p(i))!=null&&b.startsWith("ocm-share/")?v=p(i).split("/")[1]:v=f.name,n.getSpace(f.remoteItemId)||n.createShareSpace({driveAliasPrefix:w,id:f.remoteItemId,shareName:v})},c=f=>p(o).filter(d=>te.isMountPointSpaceResource(d)&&te.extractStorageId(d.root.remoteItem.rootId)===f.id);return{getInternalSpace:s,getMatchingSpace:a,isPersonalSpaceRoot:f=>{var d;return(f==null?void 0:f.storageId)&&(f==null?void 0:f.storageId)===((d=n.personalSpace)==null?void 0:d.storageId)&&(f==null?void 0:f.path)==="/"},isResourceAccessible:({space:f,path:d})=>{if(!r.options.routing.fullShareOwnerPaths)return!0;const m=p(o).find(v=>te.isProjectSpaceResource(v)&&v.id===f.id);return f.isOwner(t.user)||(m==null?void 0:m.isMember(t.user))||c(f).some(v=>d.startsWith(v.root.remoteItem.path))}}},Ui=()=>{const e=Xe(),t=Qe(),n=zt();return{createSpace:i=>{const{graphAuthenticated:s}=e;return s.drives.createDrive({name:i},n.graphRoles,{params:{template:"default"}})},createDefaultMetaFolder:async i=>{var a;const s=await e.webdav.createFolder(i,{path:".space"});return te.extractStorageId(s.parentFolderId)===((a=t.currentFolder)==null?void 0:a.id)&&t.upsertResource(s),s}}},dn=()=>vr("$loadingService"),ta=()=>{const e=Zr(),t=Xe(),n=Oe.useGettext();return{headers:j(()=>{const o=new jh({accessToken:e.accessToken,publicLinkToken:e.publicLinkToken,publicLinkPassword:e.publicLinkPassword});return{"Accept-Language":n.current,"Initiator-ID":t.initiatorId,"X-Request-ID":tn.v4(),...o.getHeaders()}})}};function KF(e){return new Worker("/assets/worker-BWQce3Pf.js",{name:e==null?void 0:e.name})}const dv=({concurrentRequests:e=4}={})=>{const t=lt(),n=dn(),{headers:r}=ta(),{createWorker:o,terminateWorker:i}=Po(),s=({topic:c,space:u,resources:l},f)=>{const d=o(KF,{needsTokenRenewal:!0});let m;p(d.worker).onmessage=w=>{i(d.id),m==null||m(!0);const{successful:v,failed:T}=JSON.parse(w.data),y=T.map(({resource:g,...h})=>({resource:g,error:te.createHttpError(h)}));f({successful:v,failed:y})},n.addTask(()=>new Promise(w=>{m=w})),d.post(a({topic:c,space:u,resources:l}))},a=({topic:c,space:u,resources:l})=>JSON.stringify({topic:c,data:{space:u,resources:l,concurrentRequests:e,baseUrl:t.serverUrl,headers:{...p(r),"X-Request-ID":void 0}}});return{startWorker:s}};function QF(e){return new Worker("/assets/worker-pv-nMaO-.js",{name:e==null?void 0:e.name})}const pv=()=>{const e=lt(),t=dn(),{headers:n}=ta(),{createWorker:r,terminateWorker:o}=Po(),i=(a,c)=>{const u=r(QF,{needsTokenRenewal:!0});let l;p(u.worker).onmessage=f=>{o(u.id),l==null||l(!0);const{successful:d,failed:m}=JSON.parse(f.data),w=m.map(({resourceName:v,...T})=>({resourceName:v,error:te.createHttpError(T)}));c({successful:d,failed:w})},t.addTask(()=>new Promise(f=>{l=f})),u.post(s(a))},s=a=>JSON.stringify({topic:"startProcess",data:{transferData:a,baseUrl:e.serverUrl,headers:{...p(n),"X-Request-ID":void 0}}});return{startWorker:i}};function XF(e){return new Worker("/assets/worker-BB15oyfQ.js",{name:e==null?void 0:e.name})}const hv=()=>{const e=lt(),t=dn(),{headers:n}=ta(),{createWorker:r,terminateWorker:o}=Po(),i=({space:a,resources:c,missingFolderPaths:u},l)=>{const f=r(XF,{needsTokenRenewal:!0});let d;p(f.worker).onmessage=m=>{o(f.id),d==null||d(!0);const{successful:w,failed:v}=JSON.parse(m.data),T=v.map(({resource:y,...g})=>({resource:y,error:te.createHttpError(g)}));l({successful:w,failed:T})},t.addTask(()=>new Promise(m=>{d=m})),f.post(s({space:a,resources:c,missingFolderPaths:u}))},s=({space:a,resources:c,missingFolderPaths:u})=>JSON.stringify({topic:"startProcess",data:{space:a,resources:c,missingFolderPaths:u,baseUrl:e.serverUrl,headers:{...p(n),"X-Request-ID":void 0}}});return{startWorker:i}};function YF(e){return new Worker("/assets/worker-BBQqm_-D.js",{name:e==null?void 0:e.name})}const JF=({authService:e})=>{const{createWorker:t}=Po(),n=le();return{startWorker:()=>{n.value=t(YF),p(p(n).worker).onmessage=()=>{e.signinSilent().catch(async s=>{if(s instanceof H0.ErrorTimeout){console.warn("token renewal timed out, retrying in 5 seconds..."),p(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(!p(n)){console.error("token timer worker is not running");return}p(n).post(JSON.stringify({topic:"set",expiry:s,expiryThreshold:a}))},resetTokenTimer:()=>{if(!p(n)){console.error("token timer worker is not running");return}p(n).post(JSON.stringify({topic:"reset"}))}}},gv=()=>{const e=lt(),t=rt(),n=qe(),r=Oe.useGettext(),{getMatchingSpace:o}=fn(),{$gettext:i,$ngettext:s}=r,a=Xe(),{dispatchModal:c}=wt(),u=ct(),l=zt(),f=ai(),{startWorker:d}=dv({concurrentRequests:e.options.concurrentRequests.resourceBatchActions}),m=Qe(),{currentFolder:w}=We.storeToRefs(m),v=le([]),T=ln("page","1"),y=j(()=>parseInt(At(p(T)))),g=ln("items-per-page","1"),h=j(()=>parseInt(At(p(g)))),b=j(()=>Ep(p(v))),S=j(()=>{const N=p(b),L=N[0].type==="folder";let x=null;return N.length===1?(L?x=i('Permanently delete folder "%{name}"',{name:N[0].name},!0):x=i('Permanently delete file "%{name}"',{name:N[0].name},!0),x):s("Permanently delete selected resource?","Permanently delete %{amount} selected resources?",N.length,{amount:N.length.toString()},!1)}),E=j(()=>{const N=p(b),L=N[0].type==="folder";return N.length===1?i(L?"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."):i("Are you sure you want to delete all selected resources? All their content will be permanently removed. This action cannot be undone.")}),I=N=>{const L=p(n.currentRoute);d({topic:"trashBinDelete",space:N,resources:p(b)},({successful:x,failed:$})=>{var V,X;if(x.length){const ee=x.length===1&&p(b).length===1?i('"%{item}" was deleted successfully',{item:x[0].name}):s("%{itemCount} item was deleted successfully","%{itemCount} items were deleted successfully",x.length,{itemCount:x.length.toString()},!0);t.showMessage({title:ee})}$.forEach(({resource:ee})=>{const se=i('Failed to delete "%{item}"',{item:ee.name});t.showErrorMessage({title:se,errors:[new Error]})}),L.name===p(n.currentRoute).name&&((V=L.query)==null?void 0:V.fileId)===((X=p(n.currentRoute).query)==null?void 0:X.fileId)&&(m.removeResources(x),m.resetSelection())})};return{displayDialog:(N,L)=>{v.value=[...L],c({title:p(S),message:p(E),confirmText:i("Delete"),onConfirm:()=>I(N)})},filesList_delete:N=>{var $;v.value=[...N],m.addResourcesIntoDeleteQueue(p(v).map(({id:V})=>V)),p(v).forEach(({id:V})=>m.removeSelection(V));const L=p(N).reduce((V,X)=>{if(X.storageId in V)return V[X.storageId].resources.push(X),V;const ee=o(X);return ee.id in V||(V[ee.id]={space:ee,resources:[]}),V[ee.id].resources.push(X),V},{}),x=($=p(w))==null?void 0:$.id;return Object.values(L).map(({space:V,resources:X})=>{d({topic:"fileListDelete",space:V,resources:X},async({successful:ee,failed:se})=>{var ie;if(ee.length){const re=ee.length===1&&N.length===1?i('"%{item}" was moved to trash bin',{item:ee[0].name}):s("%{itemCount} item was moved to trash bin","%{itemCount} items were moved to trash bin",ee.length,{itemCount:ee.length.toString()},!0);t.showMessage({title:re}),f.publish("runtime.resource.deleted",ee)}if(m.removeResourcesFromDeleteQueue(se.map(({resource:re})=>re.id)),m.removeResourcesFromDeleteQueue(ee.map(({id:re})=>re)),se.forEach(({error:re,resource:fe})=>{let ue=i('Failed to delete "%{resource}"',{resource:fe.name});re.statusCode===423&&(ue=i('Failed to delete "%{resource}" - the file is locked',{resource:fe.name})),t.showErrorMessage({title:ue,errors:[re]})}),x===((ie=p(w))==null?void 0:ie.id)){m.removeResources(ee);const re=m.activeResources.length,fe=Math.ceil(p(re)/p(h));p(y)>1&&p(y)>fe&&(T.value=fe.toString())}if(dt(n,"files-spaces-generic")&&!["public","share"].includes(V==null?void 0:V.driveType)){const fe=await a.graphAuthenticated.drives.getDrive(p(N)[0].storageId,l.graphRoles);u.updateSpaceField({id:fe.id,field:"spaceQuota",value:fe.spaceQuota})}if(p(v).length&&ro(p(v)[0],p(w)))return n.push(rr(V,{path:yt.dirname(p(v)[0].path),fileId:p(v)[0].parentFolderId}))})})}}},ZF=e=>e==="files",_r=()=>{const e=Qt();return j(()=>ZF(_l(p(e))))},mv=()=>{const e=Qt();return j(()=>{var t,n;return(n=(t=p(e))==null?void 0:t.query)==null?void 0:n.contextRouteName})};function eO(e){return e==null}const tO="edit",nO="create",Kn=()=>{const e=ir(),t=qe(),{$gettext:n}=Oe.useGettext(),r=fs(),{isEnabled:o}=oi(),{requestExtensions:i}=Bi(),s=_r(),{openUrl:a}=zv(),c=lt(),{options:u}=We.storeToRefs(c),{actions:l}=na(),{actions:f}=ra(),{actions:d}=ia(),{actions:m}=Fo(),{actions:w}=oa(),{actions:v}=sa(),{actions:T}=Oo(),{actions:y}=Pf(),{actions:g}=aa(),{actions:h}=Ff(),{actions:b}=la(),{actions:S}=ca(),{actions:E}=Nf(),I=j(()=>[...p(v),...p(T),...p(m),...p(g),...p(d),...p(b),...p(E),...p(S),...p(l),...p(f),...p(w),...p(y),...p(h)]),R=j(()=>i({id:"global.files.default-actions",extensionType:"action"}).map(ie=>ie.action)),A=j(()=>i({id:"global.files.context-actions",extensionType:"action"}).map(se=>se.action)),N=j(()=>p(o)?[]:e.fileExtensions.map(se=>{const ie=e.apps[se.app];return{name:`editor-${se.app}`,label:()=>se.label?typeof se.label=="function"?se.label():se.label:n("Open in %{app}",{app:ie.name},!0),showOpenInNewTabHint:!0,icon:se.icon||ie.icon,...ie.iconFillType&&{iconFillType:ie.iconFillType},img:ie.img,route:({space:re,resources:fe})=>L({appFileExtension:se,space:re,resource:fe[0]}),handler:re=>$(se,re.space,re.resources[0]),isVisible:({resources:re})=>!p(s)||re.length!==1||!re[0].canDownload()&&!se.secureView||!p(r)&&Pn(t,"files-trash-generic")?!1:re[0].extension&&se.extension?re[0].extension.toLowerCase()===se.extension.toLowerCase():re[0].mimeType&&se.mimeType?re[0].mimeType.toLowerCase()===se.mimeType.toLowerCase()||re[0].mimeType.split("/")[0].toLowerCase()===se.mimeType.toLowerCase():!1,hasPriority:se.hasPriority,class:`oc-files-actions-${Yb(ie.name).toLowerCase()}-trigger`}}).sort((se,ie)=>ie.hasPriority!==se.hasPriority&&ie.hasPriority?1:0)),L=({appFileExtension:se,space:ie,resource:re})=>{const fe=te.isShareSpaceResource(ie)?ie.id:void 0,ue=se.routeName||se.app,Z=x(ue,ie,re,fe);return t.resolve(Z)},x=(se,ie,re,fe,ue)=>({name:se,params:{driveAliasAndItem:ie==null?void 0:ie.getDriveAliasAndItem(re)},query:{...fe&&{shareId:fe},...re.fileId&&p(u).routing.idBased&&{fileId:re.fileId},...ue&&{templateId:ue},...ea(p(t.currentRoute))}}),$=(se,ie,re)=>{const fe=te.isShareSpaceResource(ie)?ie.id:void 0,ue=se.routeName||se.app,Z=x(ue,ie,re,fe);if(p(u).cernFeatures){const oe=t.resolve(Z).href,ce=`${se.routeName}-${re.path}`;a(oe,ce,!0);return}t.push(Z)},V=se=>{X(se).handler({...se})},X=se=>{const ie=ee(se);if(ie.length)return ie[0]},ee=se=>{const ie=ue=>ue.isVisible(se),re=[...p(R),...p(N)].filter(ie).sort((ue,Z)=>Number(Z.hasPriority)-Number(ue.hasPriority)),fe=se.omitSystemActions?[]:p(I).filter(ie);return[...re,...fe,...p(A).filter(ue=>ue.isVisible(se)&&(ue.category==="actions"||eO(ue.category)))]};return{editorActions:N,systemActions:I,getDefaultAction:X,getAllAvailableActions:ee,getEditorRouteOpts:x,openEditor:$,triggerDefaultAction:V}},na=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=qe(),{$gettext:r,$ngettext:o}=Oe.useGettext(),i=Xe(),s=dn(),a=lt(),c=Qe(),{updateResourceField:u}=c,l=async({resources:d})=>{const m=[],w=[],v=new Ur({concurrency:a.options.concurrentRequests.resourceBatchActions});if(d.forEach(T=>{w.push(v.add(async()=>{try{const{graphAuthenticated:y}=i;await y.driveItems.createDriveItem(T.driveId,{name:T.name,remoteItem:{id:T.fileId}}),u({id:T.id,field:"syncEnabled",value:!0})}catch(y){console.error(y),m.push(y)}}))}),await Promise.all(w),m.length===0){c.resetSelection(),dt(n,"files-spaces-generic")&&e({title:o("Sync for the selected share was enabled successfully","Sync for the selected shares was enabled successfully",d.length)});return}t({title:o("Failed to enable sync for the the selected share","Failed to enable sync for the selected shares",d.length),errors:m})};return{actions:j(()=>[{name:"enable-sync",icon:"check",handler:d=>s.addTask(()=>l(d)),label:()=>r("Enable sync"),isVisible:({space:d,resources:m})=>{var w;return!Mt(n,"files-shares-with-me")&&!dt(n,"files-spaces-generic")||m.length===0||dt(n,"files-spaces-generic")&&(((w=p(d))==null?void 0:w.driveType)!=="share"||m.length>1||m[0].path!=="/")?!1:m.some(v=>!v.syncEnabled)},class:"oc-files-actions-enable-sync-trigger"}])}},ra=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=qe(),{$gettext:r}=Oe.useGettext(),o=Xe(),i=dn(),s=lt(),{updateResourceField:a,resetSelection:c}=Qe(),u=async({resources:f})=>{const d=[],m=[],w=new Ur({concurrency:s.options.concurrentRequests.resourceBatchActions}),v=!f[0].hidden;if(f.forEach(T=>{m.push(w.add(async()=>{try{await o.graphAuthenticated.driveItems.updateDriveItem(T.driveId,T.id,{"@UI.Hidden":v}),a({id:T.id,field:"hidden",value:v})}catch(y){console.error(y),d.push(y)}}))}),await Promise.all(m),d.length===0){c(),e({title:r(v?"The share was hidden successfully":"The share was unhidden successfully")});return}t({title:r(v?"Failed to hide the share":"Failed to unhide share share"),errors:d})};return{actions:j(()=>[{name:"toggle-hide-share",icon:"eye-off",handler:f=>i.addTask(()=>u(f)),label:({resources:f})=>f[0].hidden?r("Unhide"):r("Hide"),isVisible:({resources:f})=>f.length===0?!1:Mt(n,"files-shares-with-me"),class:"oc-files-actions-hide-share-trigger"}])}},ia=()=>{const e=lt(),t=qe(),{copyResources:n}=Io(),r=Oe.useGettext(),{$gettext:o}=r,i=Qe(),{currentFolder:s}=We.storeToRefs(i),a=j(()=>_o()?o("⌘ + C"):o("Ctrl + C")),c=({resources:l})=>{It(t,"files-common-search")&&(l=l.filter(f=>!te.isProjectSpaceResource(f))),n(l)};return{actions:j(()=>[{name:"copy",icon:"file-copy-2",handler:c,shortcut:p(a),label:()=>o("Copy"),isVisible:({resources:l})=>{var f,d;if(!dt(t,"files-spaces-generic")&&!Cn(t,"files-public-link")&&!It(t,"files-common-favorites")&&!It(t,"files-common-search")||dt(t,"files-spaces-projects")||l.length===0)return!1;if(Cn(t,"files-public-link"))return(f=p(s))==null?void 0:f.canCreate();if(It(t,"files-common-search")&&l.every(m=>te.isProjectSpaceResource(m)))return!1;if(p(e.options.runningOnEos)){const m=((d=l[0].path)==null?void 0:d.split("/").filter(Boolean))||[];if(dt(t,"files-spaces-generic")&&m.length<5)return!1}return!!p(l)[0].canDownload()},class:"oc-files-actions-copy-trigger"}])}},_f=()=>({copyToClipboard:t=>{var n;if((n=navigator==null?void 0:navigator.clipboard)!=null&&n.write)return navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"})})]);{const{copy:r}=qr.useClipboard({legacy:!0});return r(t)}}}),If=()=>{const{showMessage:e,showErrorMessage:t}=rt(),{$gettext:n}=Oe.useGettext(),{copyToClipboard:r}=_f(),o=async s=>{try{await r(s),e({title:n("The link has been copied to your clipboard.")})}catch(a){console.error(a),t({title:n("Copy link failed"),errors:[a]})}};return{actions:j(()=>[{name:"copy-permanent-link",icon:"link",label:()=>n("Copy permanent link"),handler:({resources:s})=>{const[a]=s,c=a.privateLink;return o(c)},isVisible:({space:s,resources:a})=>!(a.length!==1||te.isPublicSpaceResource(s)||te.isTrashResource(a[0])),class:"oc-files-actions-copy-permanent-link-trigger"}])}},oa=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=qe(),{$gettext:r,$ngettext:o}=Oe.useGettext(),i=Xe(),s=dn(),a=lt(),{updateResourceField:c}=Qe(),u=async({resources:f})=>{const d=[],m=[],w=new Ur({concurrency:a.options.concurrentRequests.resourceBatchActions});if(f.forEach(v=>{m.push(w.add(async()=>{try{const{graphAuthenticated:T}=i;await T.driveItems.deleteDriveItem(v.driveId,v.id),c({id:v.id,field:"syncEnabled",value:!1})}catch(T){console.error(T),d.push(T)}}))}),await Promise.all(m),d.length===0){dt(n,"files-spaces-generic")&&(e({title:o("Sync for the selected share was disabled successfully","Sync for the selected shares was disabled successfully",f.length)}),n.push($n("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",f.length),errors:d})};return{actions:j(()=>[{name:"disable-sync",icon:"spam-3",handler:f=>s.addTask(()=>u(f)),label:()=>r("Disable sync"),isVisible:({space:f,resources:d})=>!Mt(n,"files-shares-with-me")&&!dt(n,"files-spaces-generic")||d.length===0||dt(n,"files-spaces-generic")&&((f==null?void 0:f.driveType)!=="share"||d.length>1||d[0].path!=="/")?!1:d.some(m=>m.syncEnabled),class:"oc-files-actions-disable-sync-trigger"}])}},Fo=()=>{const e=St(),t=an(),n=qe(),r=mv(),{displayDialog:o,filesList_delete:i}=gv(),{$gettext:s}=Oe.useGettext(),a=({space:u,resources:l,deletePermanent:f})=>{if(It(n,"files-common-search")&&(l=l.filter(d=>d.canBeDeleted()&&!d.isShareRoot()&&!te.isProjectSpaceResource(d))),f){o(u,l);return}i(l)};return{actions:j(()=>[{name:"delete",icon:"delete-bin-5",label:()=>s("Delete"),handler:({space:u,resources:l})=>a({space:u,resources:l,deletePermanent:!1}),isVisible:({space:u,resources:l})=>!dt(n,"files-spaces-generic")&&!Cn(n,"files-public-link")&&!It(n,"files-common-search")&&!p(r)||l.length===0||dt(n,"files-spaces-generic")&&(u==null?void 0:u.driveType)==="share"&&l[0].path==="/"||l.length===1&&l[0].locked?!1:It(n,"files-common-search")?l.some(d=>d.canBeDeleted()&&!d.isShareRoot()&&!te.isProjectSpaceResource(d)):!l.some(d=>!d.canBeDeleted()),class:"oc-files-actions-delete-trigger"},{name:"delete-permanent",icon:"delete-bin-5",label:()=>s("Delete"),handler:({space:u,resources:l})=>a({space:u,resources:l,deletePermanent:!0}),isVisible:({space:u,resources:l})=>!Pn(n,"files-trash-generic")||!t.filesPermanentDeletion||te.isProjectSpaceResource(u)&&!u.canDeleteFromTrashBin({user:e.user})?!1:l.length>0,class:"oc-files-actions-delete-permanent-trigger"}])}};function rO(e){return e&&e.length?e[0]:void 0}const yv=()=>vr("$archiverService"),sa=()=>{const{showErrorMessage:e}=rt(),t=qe(),n=dn(),r=yv(),{$ngettext:o,$gettext:i,current:s}=Oe.useGettext(),a=Zr(),c=_r(),u=({space:d,resources:m})=>{m.length>1&&(m=m.filter(v=>v.canDownload()&&!te.isProjectSpaceResource(v)));const w=p(r.fileIdsSupported)?{fileIds:m.map(v=>v.fileId)}:{dir:ds.dirname(rO(m).path)||"/",files:m.map(v=>v.name)};return r.triggerDownload({...w,...d&&te.isPublicSpaceResource(d)&&{publicToken:d.id,publicLinkPassword:a.publicLinkPassword}}).catch(v=>{console.error(v),e({title:o("Failed to download the selected folder.","Failed to download the selected files.",m.length),errors:[v]})})},l=d=>{const m=p(r.capability);return m?d.reduce((v,T)=>v+parseInt(`${T.size}`),0)>parseInt(m.max_size):void 0};return{actions:j(()=>[{name:"download-archive",icon:"inbox-archive",handler:async d=>{await n.addTask(()=>u(d))},label:()=>i("Download"),disabledTooltip:({resources:d})=>l(d)?i("The selection exceeds the allowed archive size (max. %{maxSize})",{maxSize:An(p(r.capability).max_size,s)}):"",isDisabled:({resources:d})=>l(d),isVisible:({resources:d})=>p(c)&&!dt(t,"files-spaces-generic")&&!Cn(t,"files-public-link")&&!It(t,"files-common-favorites")&&!It(t,"files-common-search")&&!Mt(t,"files-shares-with-me")&&!Mt(t,"files-shares-with-others")&&!Mt(t,"files-shares-via-link")&&!It(t,"files-common-search")||!p(r.available)||d.length===0||d.length===1&&!d[0].isFolder||d.length>1&&d.every(w=>te.isProjectSpaceResource(w))||te.isProjectSpaceResource(d[0])&&d[0].disabled||!p(r.fileIdsSupported)&&It(t,"files-common-favorites")?!1:!d.some(w=>!w.canDownload()),class:"oc-files-actions-download-archive-trigger"}])}},bv=e=>{const{showErrorMessage:t}=rt(),n=(e==null?void 0:e.clientService)||Xe(),{$gettext:r}=Oe.useGettext(),o=an(),i=St();return{downloadFile:async(a,c,u=null)=>{var l;try{const f=await n.webdav.getFileUrl(a,c,{version:u,doHeadRequest:!0,isUrlSigningEnabled:o.supportUrlSigning,username:(l=i.user)==null?void 0:l.onPremisesSamAccountName});zl(f,c.name)}catch(f){console.error(f),t({title:r("Download failed"),desc:r("File could not be located"),errors:[f]})}}}},Oo=()=>{const e=qe(),{$gettext:t}=Oe.useGettext(),n=_r(),r=fs(),{downloadFile:o}=bv(),i=({space:a,resources:c})=>{o(a,c[0])};return{actions:j(()=>[{name:"download-file",icon:"file-download",handler:i,label:()=>t("Download"),isVisible:({resources:a})=>p(n)&&!p(r)&&!dt(e,"files-spaces-generic")&&!Cn(e,"files-public-link")&&!It(e,"files-common-favorites")&&!It(e,"files-common-search")&&!Mt(e,"files-shares-with-me")&&!Mt(e,"files-shares-with-others")&&!Mt(e,"files-shares-via-link")||a.length!==1||a[0].isFolder?!1:a[0].canDownload(),class:"oc-files-actions-download-file-trigger"}])}},Cf=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=St(),r=an(),o=qe(),{$gettext:i}=Oe.useGettext(),s=Xe(),{dispatchModal:a}=wt(),c=Qe(),u=dn(),l=({space:m})=>s.webdav.clearTrashBin(m).then(()=>{e({title:i("All deleted files were removed")}),c.clearResources(),c.resetSelection()}).catch(w=>{console.error(w),t({title:i("Failed to empty trash bin"),errors:[w]})}),f=({space:m})=>{a({title:i("Empty trash bin"),confirmText:i("Delete"),message:i("Are you sure you want to permanently delete the listed items? You can’t undo this action."),hasInput:!1,onConfirm:()=>u.addTask(()=>l({space:m}))})};return{actions:j(()=>[{name:"empty-trash-bin",icon:"delete-bin-5",label:()=>i("Empty trash bin"),handler:f,isVisible:({space:m})=>!(!Pn(o,"files-trash-generic")||!r.filesPermanentDeletion||te.isProjectSpaceResource(m)&&!m.canDeleteFromTrashBin({user:n.user})),isDisabled:()=>c.activeResources.length===0,class:"oc-files-actions-empty-trash-bin-trigger",appearance:"filled"}]),emptyTrashBin:l}},Pf=()=>{const{showErrorMessage:e}=rt(),t=an(),n=qe(),{$gettext:r}=Oe.useGettext(),o=Xe(),i=_r(),s=yn(),a=Qe(),c=ai(),u=async({space:f,resources:d})=>{try{const m=!d[0].starred;await o.webdav.setFavorite(f,d[0],m),a.updateResourceField({id:d[0].id,field:"starred",value:m}),m||c.publish("app.files.list.removeFromFavorites",d[0].id)}catch(m){const w=r('Failed to change favorite state of "%{file}"',{file:d[0].name},!0);e({title:w,errors:[m]})}};return{actions:j(()=>[{name:"favorite",icon:"star",handler:u,label:({resources:f})=>f[0].starred?r("Remove from favorites"):r("Add to favorites"),isVisible:({resources:f})=>p(i)&&!dt(n,"files-spaces-generic")&&!It(n,"files-common-favorites")||f.length!==1?!1:t.filesFavorites&&s.can("create","Favorite"),class:"oc-files-actions-favorite-trigger"}])}};function iO(e,t){const n=e.isReceivedShare()||e.isMounted(),r=t===""&&n;return e.canBeDeleted()&&!r}const aa=()=>{const e=qe(),{cutResources:t}=Io(),n=Oe.useGettext(),{$gettext:r}=n,o=Qe(),{currentFolder:i}=We.storeToRefs(o),s=j(()=>_o()?r("⌘ + X"):r("Ctrl + X")),a=({resources:u})=>{t(u)};return{actions:j(()=>[{name:"cut",icon:"scissors",handler:a,shortcut:p(s),label:()=>r("Cut"),isVisible:({resources:u})=>!dt(e,"files-spaces-generic")&&!Cn(e,"files-public-link")&&!It(e,"files-common-favorites")||u.length===0||!p(i)||u.length===1&&u[0].locked?!1:!u.some(f=>iO(f,p(i).path)===!1),class:"oc-files-actions-move-trigger"}])}},Ff=()=>{const e=qe(),{$gettext:t}=Oe.useGettext(),{getMatchingSpace:n}=fn(),r=Qe(),{currentFolder:o}=We.storeToRefs(r),i=c=>c||n(c),s=j(()=>Cn(e,"files-public-link")?Pi("files-public-link"):Nn("files-spaces-generic"));return{actions:j(()=>[{name:"navigate",icon:"folder-open",showOpenInNewTabHint:!0,label:()=>t("Open folder"),isVisible:({resources:c})=>!(Pn(e,"files-trash-generic")||c.length!==1||p(o)!==null&&ro(c[0],p(o))||!c[0].isFolder||c[0].type==="space"),route:({space:c,resources:u})=>fo({},p(s),rr(i(c),{path:u[0].path,fileId:u[0].fileId})),class:"oc-files-actions-navigate-trigger"}])}},vv=()=>{const e=qe(),t=Xe(),{getMatchingSpace:n}=fn(),{$gettext:r,$ngettext:o}=Oe.useGettext(),i=Io(),{startWorker:s}=pv(),a=Qe(),{currentFolder:c}=We.storeToRefs(a),u=j(()=>_o()?r("⌘ + V"):r("Ctrl + V")),l=j(()=>i.action===ri.Cut?mr.MOVE:mr.COPY),f=async({targetSpace:w,sourceSpace:v,resources:T})=>{var b;const y=new Ip(v,T,w,p(c),c,t,r,o),g=await y.getTransferData(p(l));if(!g.length)return;const h=(b=p(c))==null?void 0:b.id;s(g,async({successful:S,failed:E})=>{if(y.showResultMessage(E,S,p(l)),!S.length||p(c)&&h!==p(c).id)return;const I=[],R=[];for(const A of S)I.push((async()=>{const N=await t.webdav.getFileInfo(w,A);R.push(N)})());await Promise.allSettled(I),te.isShareSpaceResource(w)&&R.forEach(A=>{A.remoteItemId=w.id}),a.upsertResources(R)})},d=async({space:w})=>{const v=i.resources.reduce((y,g)=>{if(g.storageId in y)return y[g.storageId].resources.push(g),y;const h=n(g);return h.id in y||(y[h.id]={space:h,resources:[]}),y[h.id].resources.push(g),y},{}),T=Object.values(v).map(({space:y,resources:g})=>f({targetSpace:w,sourceSpace:y,resources:g}));await Promise.all(T),i.clearClipboard()};return{actions:j(()=>[{name:"paste",icon:"clipboard",handler:d,label:()=>r("Paste"),shortcut:p(u),isVisible:({resources:w})=>{var v;return i.resources.length===0||!dt(e,"files-spaces-generic")&&!Cn(e,"files-public-link")&&!It(e,"files-common-favorites")||w.length===0?!1:Cn(e,"files-public-link")&&p(c)?(v=p(c))==null?void 0:v.canCreate():!0},class:"oc-files-actions-copy-trigger"}])}},la=()=>{const{showErrorMessage:e}=rt(),t=an(),n=qe(),{$gettext:r}=Oe.useGettext(),o=Xe(),i=lt(),{dispatchModal:s}=wt(),a=St(),c=yn(),u=Qe(),{setCurrentFolder:l,upsertResource:f}=u,d=(T,y,g=void 0)=>{const h=T.path.substring(0,T.path.length-T.name.length)+y;if(!y)return r("The name cannot be empty");if(/[/]/.test(y))return r('The name cannot contain "/"');if(y===".")return r('The name cannot be equal to "."');if(y==="..")return r('The name cannot be equal to ".."');if(/\s+$/.test(y))return r("The name cannot end with whitespace");if(u.resources.find(S=>S.path===h&&T.name!==y)){const S=r('The name "%{name}" is already taken');return r(S,{name:y},!0)}if(g&&g.find(E=>E.path===h&&T.name!==y)){const E=r('The name "%{name}" is already taken');return r(E,{name:y},!0)}return null},m=async(T,y,g)=>{let h=u.currentFolder;try{const b=yt.join(yt.dirname(y.path),g);await o.webdav.moveFiles(T,y,T,{path:b});const S=ro(y,h);if(te.isShareSpaceResource(T)&&y.isReceivedShare()){if(T.rename(g),S)return h={...h},h.name=g,l(h),n.push(rr(T,{path:"",fileId:y.fileId}));const I={...y};I.name=g,f(I);return}if(S)return h={...h},ll(T,h,b),l(h),n.push(rr(T,{path:b,fileId:y.fileId}));const E={...y};ll(T,E,b),f(E)}catch(b){console.error(b);let S=r('Failed to rename "%{file}" to "%{newName}"',{file:y.name,newName:g},!0);b.statusCode===423&&(S=r('Failed to rename "%{file}" to "%{newName}" - the file is locked',{file:y.name,newName:g},!0)),e({title:S,errors:[b]})}},w=async({space:T,resources:y})=>{const g=u.currentFolder;let h;if(ro(y[0],g)){const x=yt.dirname(g.path);h=(await o.webdav.listFiles(T,{path:x})).children}const b=u.areFileExtensionsShown,S=async x=>{b||(x=`${x}.${y[0].extension}`),await m(T,y[0],x)},E=(x,$)=>{b||(x=`${x}.${y[0].extension}`);const V=d(y[0],x,h);$(V)},I=te.extractNameWithoutExtension(y[0]),R=!y[0].isFolder&&!b?I:y[0].name,A=y[0].isFolder?r("Rename folder %{name}",{name:R}):r("Rename file %{name}",{name:R}),N=!y[0].isFolder&&!b?I:y[0].name,L=y[0].isFolder||!b?null:[0,I.length];s({title:A,confirmText:r("Rename"),hasInput:!0,inputValue:N,inputSelectionRange:L,inputLabel:y[0].isFolder?r("Folder name"):r("File name"),onConfirm:S,onInput:E})};return{actions:j(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:w,isVisible:({resources:T})=>Pn(n,"files-trash-generic")||Mt(n,"files-shares-with-me")&&!t.sharingCanRename||T.length!==1||(i.options.routing.fullShareOwnerPaths?T.some(h=>h.remoteItemPath&&h.path):T.some(h=>h.remoteItemId&&h.path==="/"))||T.length===1&&T[0].locked?!1:!T.some(h=>!h.canRename({user:a.user,ability:c})||h.processing),class:"oc-files-actions-rename-trigger"}]),getNameErrorMsg:d,renameResource:m}},ca=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=St(),r=qe(),{$gettext:o,$ngettext:i}=Oe.useGettext(),s=Xe(),a=ct(),c=zt(),u=Qe(),{startWorker:l}=hv(),f=async(T,y)=>{const g={},h=[],b=[],S=[];for(const E of y){const I=yt.dirname(E.path);let R=[];if(I in g)R=g[I];else{try{R=(await s.webdav.listFiles(T,{path:I})).children}catch{S.push(I)}g[I]=R}R.some(N=>N.name===E.name)||b.filter(N=>N.id!==E.id).some(N=>N.path===E.path)?h.push(E):b.push(E)}return{existingResourcesByPath:g,conflicts:h,resolvedResources:b,missingFolderPaths:S.filter(E=>{var I;return!((I=g[E])!=null&&I.length)})}},d=async T=>{let y=0;const g=[],h=T.length;let b=!1,S;for(const E of T){const I=E.type==="folder";if(b){g.push({resource:E,strategy:S});continue}const R=h-y,N=await new sl(o,i).resolveFileExists({name:E.name,isFolder:I},R,!1);y++,N.doForAllConflicts&&(b=!0,S=N.strategy),g.push({resource:E,strategy:N.strategy})}return g},m=(T,y,g)=>{const h=p(r.currentRoute);l({space:T,resources:y,missingFolderPaths:g},async({successful:b,failed:S})=>{var E,I;if(b.length){let R;b.length===1?R=o("%{resource} was restored successfully",{resource:b[0].name}):R=o("%{resourceCount} files restored successfully",{resourceCount:b.length.toString()}),e({title:R}),h.name===p(r.currentRoute).name&&((E=h.query)==null?void 0:E.fileId)===((I=p(r.currentRoute).query)==null?void 0:I.fileId)&&(u.removeResources(b),u.resetSelection());const N=await s.graphAuthenticated.drives.getDrive(T.id,c.graphRoles);a.updateSpaceField({id:N.id,field:"spaceQuota",value:N.spaceQuota})}if(S.length){let R;const A={};S.length===1?(A.resource=S[0].resource.name,R=o('Failed to restore "%{resource}"',A,!0)):(A.resourceCount=S.length.toString(),R=o("Failed to restore %{resourceCount} files",A,!0)),t({title:R,errors:S.map(({error:N})=>N)})}})},w=async({space:T,resources:y})=>{const g=y.sort((N,L)=>N.path.length-L.path.length),{existingResourcesByPath:h,conflicts:b,resolvedResources:S,missingFolderPaths:E}=await f(T,g),I=await d(b),R=I.filter(N=>N.strategy===Gn.REPLACE).map(N=>N.resource);S.push(...R);const A=I.filter(N=>N.strategy===Gn.KEEP_BOTH).map(N=>N.resource);for(let N of A){N={...N};const L=yt.dirname(N.path),x=h[L]||[],$=te.extractExtensionFromFile(N),V=Hn(N.name,$,[...x,...I.map(X=>X.resource),...S]);N.name=V,N.path=te.urlJoin(L,V),S.push(N)}return m(T,S,E)};return{actions:j(()=>[{name:"restore",icon:"arrow-go-back",label:()=>o("Restore"),handler:w,isVisible:({space:T,resources:y})=>!Pn(r,"files-trash-generic")||!y.every(g=>te.isTrashResource(g)&&g.canBeRestored())||te.isProjectSpaceResource(T)&&!T.canRestoreFromTrashbin({user:n.user})?!1:y.length>0,class:"oc-files-actions-restore-trigger"}]),restoreResources:m,collectConflicts:f}},Of=()=>vr("$previewService"),wv=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=St(),r=qe(),{$gettext:o}=Oe.useGettext(),i=Xe(),s=dn(),a=Of(),c=ct(),u=zt(),{createDefaultMetaFolder:l}=Ui(),{getDefaultMetaFolder:f}=li(),d=async({space:w,resources:v})=>{var b;const T=i.graphAuthenticated,y=w==null?void 0:w.id,{copyFiles:g,getFileInfo:h}=i.webdav;try{let S=await f(w);S||(S=await l(w)),v[0].id!==((b=w.spaceImageData)==null?void 0:b.id)&&await g(w,{fileId:v[0].id},w,{parentFolderId:S.id,name:v[0].name},{overwrite:!0});const{fileId:E}=await h(w,{fileId:v[0].id}),I=await T.drives.updateDrive(y,{name:w.name,special:[{specialFolder:{name:"image"},id:E}]},u.graphRoles);c.updateSpaceField({id:y,field:"spaceImageData",value:I.spaceImageData}),e({title:o("Space image was set successfully")})}catch(S){console.error(S),t({title:o("Failed to set space image"),errors:[S]})}};return{actions:j(()=>[{name:"set-space-image",icon:"image-edit",handler:w=>s.addTask(()=>d(w)),label:()=>o("Set as space image"),isVisible:({space:w,resources:v})=>v.length!==1||!v[0].mimeType||!a.isMimetypeSupported(v[0].mimeType,!0)||!dt(r,"files-spaces-generic")||!w?!1:w.canEditImage({user:n.user}),class:"oc-files-actions-set-space-image-trigger"}])}},oO=()=>{const e=qe(),{$gettext:t}=Oe.useGettext(),n=_r(),r=()=>{const i=Pn(e,"files-trash-generic")?null:"actions";Ke.publish(vt.openWithPanel,i)};return{actions:j(()=>[{name:"show-actions",icon:"slideshow-3",label:()=>t("All Actions"),handler:r,isVisible:({resources:i})=>p(n)?i.length===1:!1,class:"oc-files-actions-show-actions-trigger"}])}},kf=()=>{const e=qe(),t=Qe(),{$gettext:n}=Oe.useGettext();return{actions:j(()=>[{name:"show-details",icon:"information",class:"oc-files-actions-show-details-trigger",label:()=>n("Details"),isVisible:({resources:o})=>Pn(e,"files-trash-generic")?!1:o.length>0,handler({resources:o}){t.setSelection(o.map(({id:i})=>i)),Ke.publish(vt.open)}}])}},Sv=()=>{const e=an(),{isPersonalSpaceRoot:t}=fn(),n=St();return{canListShares:({space:o,resource:i})=>!e.sharingApiEnabled||te.isPublicSpaceResource(o)||t(i)||te.isTrashResource(i)?!1:te.isIncomingShareResource(i)?i.sharePermissions.includes(te.GraphSharePermission.readPermissions):te.isShareSpaceResource(o)?te.getPermissionsForSpaceMember(o,n.user).includes(te.GraphSharePermission.readPermissions):!0}},Ev=()=>{const e=an(),t=yn(),n=St();return{canShare:({space:o,resource:i})=>!e.sharingApiEnabled||te.isShareSpaceResource(o)||te.isProjectSpaceResource(o)&&!o.canShare({user:n.user})?!1:i.canShare({ability:t,user:n.user})}},xf=()=>{const e=qe(),{$gettext:t}=Oe.useGettext(),{canShare:n}=Ev(),r=Qe(),o=({resources:s})=>{r.setSelection(s.map(({id:a})=>a)),Ke.publish(vt.openWithPanel,"sharing#peopleShares")};return{actions:j(()=>[{name:"show-shares",icon:"user-add",label:()=>t("Share"),handler:o,isVisible:({space:s,resources:a})=>Pn(e,"files-trash-generic")||a.length!==1?!1:n({space:s,resource:a[0]}),class:"oc-files-actions-show-shares-trigger"}])}},Nf=()=>{const{showMessage:e,showErrorMessage:t}=rt(),{can:n}=yn(),{$gettext:r,$ngettext:o}=Oe.useGettext(),{createSpace:i}=Ui(),{checkSpaceNameModalInput:s}=li(),a=Xe(),c=qe(),u=j(()=>n("create-all","Drive")),{dispatchModal:l}=wt(),f=lt(),d=ct(),m=Qe(),w=async({spaceName:y,resources:g,space:h})=>{const{webdav:b}=a,S=new Ur({concurrency:f.options.concurrentRequests.resourceBatchActions}),E=[];try{const I=await i(y);d.upsertSpace(I),g.length===1&&g[0].isFolder&&(g=(await b.listFiles(h,{path:g[0].path})).children);for(const R of g)E.push(S.add(()=>b.copyFiles(h,R,I,{path:R.name})));await Promise.all(E),m.resetSelection(),e({title:r("Space was created successfully")})}catch(I){console.error(I),t({title:r("Creating space failed…"),errors:[I]})}},v=({resources:y,space:g})=>{l({title:o('Create Space from "%{resourceName}"',"Create Space from selection",y.length,{resourceName:y[0].name}),message:o('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"),onInput:s,onConfirm:h=>w({spaceName:h,space:g,resources:y})})};return{actions:j(()=>[{name:"create-space-from-resource",icon:"function",handler:v,label:()=>r("Create Space from selection"),isVisible:({resources:y,space:g})=>!(!y.length||!p(u)||!dt(c,"files-spaces-generic")||!te.isPersonalSpaceResource(g)),class:"oc-files-actions-create-space-from-resource-trigger"}])}},Tv=()=>{const e=ln("scrollTo"),t=ln("details"),n=Qe(),r=j(()=>At(p(e))),o=j(()=>At(p(t))),i=(a,c={forceScroll:!1,topbarElement:null})=>{const u=document.querySelectorAll(`[data-item-id='${a}']`)[0];if(!u){Ke.publish("app.files.navigate.page",{resourceId:a,forceScroll:c.forceScroll,topbarElement:c.topbarElement});return}const l=document.getElementById(c.topbarElement),f=(l==null?void 0:l.offsetHeight)||0+u.offsetHeight*2;(u.getBoundingClientRect().bottom>window.innerHeight||u.getBoundingClientRect().top<f||c.forceScroll)&&u.scrollIntoView({behavior:"smooth",block:"center"})};return Ke.subscribe("app.files.navigate.scrollTo",a=>i(a.resourceId,{forceScroll:a.forceScroll,topbarElement:a.topbarElement})),{scrollToResource:i,scrollToResourceFromRoute:(a,c)=>{if(!p(r)||!a.length)return;const u=p(a).find(l=>te.isIncomingShareResource(l)?l.remoteItemId===p(r):l.id===p(r));u&&u.processing!==!0&&(n.setSelection([u.id]),i(u.id,{forceScroll:!0,topbarElement:c}),p(o)&&Ke.publish(vt.openWithPanel,p(o)))}}},sO=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=rt(),{dispatchModal:r}=wt(),{$gettext:o}=Oe.useGettext(),{scrollToResource:i}=Tv(),s=Qe(),{resources:a,currentFolder:c}=We.storeToRefs(s),u=Xe(),l=(w,v)=>w.trim()===""?v(o("Folder name cannot be empty")):/[/]/.test(w)?v(o('Folder name cannot contain "/"')):w==="."?v(o('Folder name cannot be equal to "."')):w===".."?v(o('Folder name cannot be equal to ".."')):p(a).find(y=>y.name===w)?v(o("%{name} already exists",{name:w},!0)):v(null),f=async w=>{w=w.trimEnd();try{const v=yt.join(p(c).path,w),T=await u.webdav.createFolder(p(e),{path:v});te.isShareSpaceResource(p(e))&&(T.remoteItemId=p(e).id),s.upsertResource(T),t({title:o('"%{folderName}" was created successfully',{folderName:w})}),await zn(),i(T.id,{forceScroll:!0,topbarElement:"files-app-bar"})}catch(v){console.error(v),n({title:o("Failed to create folder"),errors:[v]})}},d=()=>{let w=o("New folder");p(a).some(v=>v.name===w)&&(w=Hn(w,"",p(a))),r({title:o("Create a new folder"),confirmText:o("Create"),hasInput:!0,inputValue:w,inputLabel:o("Folder name"),onConfirm:f,onInput:l})};return{actions:j(()=>[{name:"create-folder",icon:"folder",handler:d,label:()=>o("New Folder"),isVisible:()=>{var w;return(w=p(c))==null?void 0:w.canCreate()},class:"oc-files-actions-create-new-folder"}]),checkNewFolderName:l,addNewFolder:f}},aO=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=rt(),r=St(),{$gettext:o}=Oe.useGettext(),{dispatchModal:i}=wt(),s=ir(),{isEnabled:a}=oi(),{openEditor:c}=Kn(),u=Xe(),l=Qe(),{resources:f,currentFolder:d,areFileExtensionsShown:m}=We.storeToRefs(l),w=j(()=>s.fileExtensions.filter(({newFileMenu:h})=>!!h)),v=h=>h===""?o("File name cannot be empty"):/[/]/.test(h)?o('File name cannot contain "/"'):h==="."?o('File name cannot be equal to "."'):h===".."?o('File name cannot be equal to ".."'):/\s+$/.test(h)?o("File name cannot end with whitespace"):p(f).find(S=>S.name===h)?o("%{name} already exists",{name:h},!0):null,T=(h,b)=>(l.upsertResource(h),c(b,p(e),h)),y=(h,b,S)=>{let E=o("New file")+`.${b}`;p(f).some(R=>R.name===E)&&(E=Hn(E,b,p(f))),m.value||(E=te.extractNameWithoutExtension({name:E,extension:b}));const I=m.value?[0,E.length-(b.length+1)]:null;i({title:o("Create a new file"),confirmText:o("Create"),hasInput:!0,inputValue:E,inputLabel:o("File name"),inputSelectionRange:I,onConfirm:async R=>{m.value||(R=`${R}.${b}`);try{let A;if(S.createFileHandler)A=await S.createFileHandler({fileName:R,space:p(e),currentFolder:p(d)});else{const N=yt.join(p(d).path,R);A=await u.webdav.putFileContents(p(e),{path:N})}return l.upsertResource(A),t({title:o('"%{fileName}" was created successfully',{fileName:A.name})}),p(a)?void 0:T(A,S)}catch(A){console.error(A),n({title:o("Failed to create file"),errors:[A]})}},onInput:(R,A)=>A(v(m.value?R:`${R}.${b}`))})};return{actions:j(()=>{var S;const h=[],b={};for(const E of p(w)||[])E.hasPriority?b[E.extension]=E:b[E.extension]=b[E.extension]||E;for(const[,E]of Object.entries(b))h.push({name:"create-new-file",icon:"add",handler:I=>y(I,E.extension,E),label:()=>o(E.newFileMenu.menuTitle()),isVisible:()=>{var I;return(I=p(d))==null?void 0:I.canUpload({user:r.user})},class:"oc-files-actions-create-new-file",ext:E.extension,isExternal:(S=E.app)==null?void 0:S.startsWith("external-")});return h}),getNameErrorMsg:v,openFile:T}},Av="rowMounted",$f="fileDropped",lO="contextmenuClicked";class Qn{}Se(Qn,"Thumbnail",[36,36]),Se(Qn,"Tile",[1e3,1e3]),Se(Qn,"Preview",[1200,1200]),Se(Qn,"Avatar",64);class ua{}Se(ua,"Thumbnail","thumbnail"),Se(ua,"Preview","preview"),Se(ua,"Avatar","avatar");class cO{constructor(t,n,r){Se(this,"state");Se(this,"observeEnter");Se(this,"observeExit");Se(this,"onEnterCallCount");Se(this,"onExitCallCount");Se(this,"onEnter");Se(this,"onExit");Se(this,"threshold");Se(this,"unobserver");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 Rv{constructor(t={}){Se(this,"targets");Se(this,"intersectionObserver");Se(this,"options");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 cO(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 uO={name:"resource-type-folder",color:"var(--oc-color-icon-folder)"},fO={name:"layout-grid",color:"var(--oc-role-secondary)"},dO={name:"resource-type-file",color:"var(--oc-role-on-surface)"},pO=Pp(),hO=$e({name:"ResourceIcon",props:{resource:{type:Object,required:!0},size:{type:String,default:"large",validator:e=>zP.some(t=>t===e)}},setup(e){const t=gr(Cp),n=j(()=>e.resource.type==="folder"||e.resource.isFolder),r=j(()=>e.resource.type==="space"),o=j(()=>{var c;return(c=e.resource.extension)==null?void 0:c.toLowerCase()}),i=j(()=>{var c;return(c=e.resource.mimeType)==null?void 0:c.toLowerCase()}),s=j(()=>{if(p(r))return fO;if(p(n))return uO;const c=pO[p(o)]||(t==null?void 0:t.mimeType[p(i)])||(t==null?void 0:t.extension[p(o)]);return{...dO,...c}}),a=j(()=>p(r)?"oc-resource-icon-space":p(n)?"oc-resource-icon-folder":"oc-resource-icon-file");return{icon:s,iconTypeClass:a}}});function gO(e,t,n,r,o,i){const s=ye("oc-icon");return J(),Ie(s,{key:`resource-icon-${e.icon.name}`,name:e.icon.name,color:e.icon.color,size:e.size,class:W.normalizeClass(["oc-resource-icon",e.iconTypeClass])},null,8,["name","color","size","class"])}const ko=Ue(hO,[["render",gO]]),mO={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=lt(),{options:n}=We.storeToRefs(t);return{linkTarget:j(()=>p(n).cernFeatures&&e.link&&!e.resource.isFolder?"_blank":"_self")}},computed:{isNavigatable(){return(this.resource.isFolder||this.link)&&!this.resource.disabled},componentType(){return this.isNavigatable?"router-link":"oc-button"},componentProps(){return this.isNavigatable?{to:this.link}:{appearance:"raw",gapSize:"none",justifyContent:"left"}}},methods:{emitClick(){this.isNavigatable||this.$emit("click")}}},yO={key:1};function bO(e,t,n,r,o,i){return n.isResourceClickable?(J(),Ie(kr(i.componentType),Kt({key:0},i.componentProps,{target:e.linkTarget,draggable:!1,class:"oc-resource-link","no-hover":"",onDragstart:t[0]||(t[0]=In(()=>{},["prevent","stop"])),onClick:i.emitClick}),{default:Ee(()=>[He(e.$slots,"default")]),_:3},16,["target","onClick"])):(J(),ge("span",yO,[He(e.$slots,"default")]))}const Df=Ue(mO,[["render",bO]]),vO=$e({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?ds.join(this.pathPrefix,this.fullPath):this.fullPath},htmlTitle(){if(!this.tooltip)return this.isExtensionDisplayed?`${this.displayName}${this.displayExtension}`:this.displayName}}}),wO=["data-test-resource-path","data-test-resource-name","data-test-resource-type","title"],SO={key:0,class:"oc-text-truncate"},EO=["textContent"],TO=["textContent"],AO=["textContent"];function RO(e,t,n,r,o,i){const s=cn("oc-tooltip");return it((J(),ge("span",{class:W.normalizeClass(["oc-resource-name",[{"oc-display-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?(J(),ge("span",SO,[pe("span",{class:"oc-resource-basename",textContent:W.toDisplayString(e.displayName)},null,8,EO)])):(J(),ge("span",{key:1,class:"oc-resource-basename oc-text-break",textContent:W.toDisplayString(e.displayName)},null,8,TO)),e.extension&&e.isExtensionDisplayed?(J(),ge("span",{key:2,class:"oc-resource-extension",textContent:W.toDisplayString(e.displayExtension)},null,8,AO)):Pe("",!0)],10,wO)),[[s,e.tooltip]])}const Lf=Ue(vO,[["render",RO]]),_O=$e({name:"ResourceListItem",components:{ResourceIcon:ko,ResourceLink:Df,ResourceName:Lf},props:{resource:{type:Object,required:!0},pathPrefix:{type:String,required:!1,default:""},link:{type:Object,required:!1,default:null},isPathDisplayed:{type:Boolean,required:!1,default:!1},parentFolderLink:{type:Object,required:!1,default:null},parentFolderName:{type:String,required:!1,default:""},parentFolderLinkIconAdditionalAttributes:{type:Object,required:!1,default:()=>({})},isExtensionDisplayed:{type:Boolean,required:!1,default:!0},isThumbnailDisplayed:{type:Boolean,required:!1,default:!0},isIconDisplayed:{type:Boolean,required:!1,default:!0},isResourceClickable:{type:Boolean,required:!1,default:!0}},emits:["click"],computed:{parentFolderComponentType(){return this.parentFolderLink?"router-link":"span"},parentFolderStyle(){return{cursor:this.parentFolderLink?"pointer":"default"}},parentFolderLinkIconAttrs(){return{"fill-type":"line",name:"folder-2",size:"small",...this.parentFolderLinkIconAdditionalAttributes}},hasThumbnail(){return this.isThumbnailDisplayed&&Object.prototype.hasOwnProperty.call(this.resource,"thumbnail")},thumbnail(){return this.resource.thumbnail},tooltipLabelIcon(){return this.resource.locked?this.$gettext("This item is locked"):null}},methods:{emitClick(){this.$emit("click")}}}),IO={class:"oc-resource-indicators"},CO=["textContent"];function PO(e,t,n,r,o,i){const s=ye("oc-image"),a=ye("resource-icon"),c=ye("resource-link"),u=ye("resource-name"),l=ye("oc-icon"),f=cn("oc-tooltip");return J(),ge("div",{class:W.normalizeClass(["oc-resource oc-text-overflow",{"oc-resource-no-interaction":!e.isResourceClickable}])},[e.isIconDisplayed?(J(),Ie(c,{key:0,resource:e.resource,link:e.link,"is-resource-clickable":e.isResourceClickable,class:"oc-resource-icon-link",onClick:e.emitClick},{default:Ee(()=>[e.hasThumbnail?it((J(),Ie(s,{key:e.thumbnail,src:e.thumbnail,class:"oc-resource-thumbnail",width:"40",height:"40","aria-label":e.tooltipLabelIcon},null,8,["src","aria-label"])),[[f,e.tooltipLabelIcon]]):it((J(),Ie(a,{key:1,"aria-label":e.tooltipLabelIcon,resource:e.resource},null,8,["aria-label","resource"])),[[f,e.tooltipLabelIcon]])]),_:1},8,["resource","link","is-resource-clickable","onClick"])):Pe("",!0),pe("div",{class:W.normalizeClass(["oc-resource-details oc-text-overflow",{"oc-pl-s":e.isIconDisplayed}])},[me(c,{resource:e.resource,"is-resource-clickable":e.isResourceClickable,link:e.link,class:"oc-text-overflow",onClick:e.emitClick},{default:Ee(()=>[(J(),Ie(u,{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","onClick"]),pe("div",IO,[e.isPathDisplayed?(J(),Ie(kr(e.parentFolderComponentType),{key:0,to:e.parentFolderLink,style:W.normalizeStyle(e.parentFolderStyle),class:"parent-folder oc-text-truncate"},{default:Ee(()=>[me(l,W.normalizeProps(Xa(e.parentFolderLinkIconAttrs)),null,16),pe("span",{class:"text oc-text-truncate",textContent:W.toDisplayString(e.parentFolderName)},null,8,CO)]),_:1},8,["to","style"])):Pe("",!0)])],2)],2)}const xo=Ue(_O,[["render",PO]]),_v=$e({__name:"ResourcePreview",props:{searchResult:{default:()=>({data:{}})},isClickable:{type:Boolean,default:!0},term:{default:""}},setup(e){const t=new Rv,{triggerDefaultAction:n}=Kn(),{getMatchingSpace:r}=fn(),{getDefaultAction:o}=Kn(),{loadPreview:i}=zf(),s=Hd("resourceListItem"),{getPathPrefix:a,getParentFolderName:c,getParentFolderLink:u,getParentFolderLinkIconAdditionalAttributes:l,getFolderLink:f}=ci(),d=Qe(),m=le(),w=j(()=>d.areFileExtensionsShown),v=j(()=>({...e.searchResult.data,...p(m)&&{thumbnail:p(m)}})),T=j(()=>r(p(v))),y=j(()=>{const R=p(v);return te.isSpaceResource(R)&&R.disabled===!0}),g=()=>{n({space:p(T),resources:[p(v)]})},h=j(()=>e.isClickable?{parentFolderLink:u(p(v)),onClick:g}:{isResourceClickable:!1}),b=j(()=>{var N;if(p(v).isFolder)return f(p(v));const R=o({resources:[p(v)],space:p(T)});if(!(R!=null&&R.route))return null;const A=R.route({space:p(T),resources:[p(v)]});return A.query={...A.query,contextRouteQuery:{...((N=A.query)==null?void 0:N.contextRouteQuery)||{},term:e.term}},A}),S=a(p(v)),E=c(p(v)),I=l(p(v));return qt(()=>{p(y)&&p(s).parentElement.classList.add("disabled");const R=async()=>{const N=await i({space:p(T),resource:p(v),dimensions:Qn.Thumbnail,cancelRunning:!0,updateStore:!1});N&&(m.value=N)},A=_t.debounce(({unobserve:N})=>{N(),R()},250);t.observe(p(s).$el,{onEnter:A,onExit:A.cancel})}),Wn(()=>{t.disconnect()}),(R,A)=>(J(),Ie(xo,Kt({ref_key:"resourceListItem",ref:s,resource:v.value,"path-prefix":p(S),"is-path-displayed":!0,link:b.value,"is-extension-displayed":w.value,"parent-folder-link-icon-additional-attributes":p(I),"parent-folder-name":p(E),"is-thumbnail-displayed":!!m.value},h.value),null,16,["resource","path-prefix","link","is-extension-displayed","parent-folder-link-icon-additional-attributes","parent-folder-name","is-thumbnail-displayed"]))}}),FO=7,OO=200,kO=$e({name:"CreateShortcutModal",components:{ResourcePreview:_v},props:{modal:{type:Object,required:!0},space:{type:Object,required:!0}},emits:["update:confirmDisabled"],setup(e,{emit:t,expose:n}){const r=Xe(),{$gettext:o}=Oe.useGettext(),{showMessage:i,showErrorMessage:s}=rt(),a=qe(),{search:c}=Af(),{getPathPrefix:u,getParentFolderName:l,getParentFolderLink:f,getParentFolderLinkIconAdditionalAttributes:d,getFolderLink:m}=ci(),w=Qe(),{resources:v,currentFolder:T}=We.storeToRefs(w),y=le(null),g=le(""),h=le(""),b=le(null),S=le(null),E=le(!1);let I=null;const R=G=>{const z=G.trim();return X(z)?z:`https://${z}`},A=j(()=>R(p(g))),N=j(()=>!!p(v).find(G=>G.name===`${p(h)}.url`)),L=j(()=>p(N)||!p(h)||!p(g));Et(L,()=>{t("update:confirmDisabled",p(L))},{immediate:!0});const x=j(()=>p(N)?o("%{name} already exists",{name:`${p(h)}.url`}):/[/]/.test(p(h))?o('Shortcut name cannot contain "/"'):""),$=hn.useTask(function*(G,z){b.value=null,z=`name:"*${z}*" NOT name:"*.url"`;try{b.value=yield c(z,FO)}catch{}}),V=_t.debounce(()=>{$.perform(p(g))},OO),X=G=>["http://","https://"].some(M=>M.startsWith(G)||G.startsWith(M)),ee=()=>{b.value=null,g.value=p(A);try{let G=new URL(p(A)).host;p(v).some(z=>z.name===`${G}.url`)&&(G=Hn(`${G}.url`,"url",p(v)).slice(0,-4)),h.value=G}catch{}},se=G=>{b.value=null;const z=new URL(window.location.href);let M=G.data.name;g.value=`${z.origin}/f/${G.id}`,p(v).some(q=>q.name===`${M}.url`)&&(M=Hn(`${M}.url`,"url",p(v)).slice(0,-4)),h.value=M},ie=G=>p(S)===G,re=(G=!1)=>{const z=Array.from(document.querySelectorAll("li.selectable-item"));let M=p(S)!==null?p(S):G?z.length:-1;const q=G?-1:1;do if(M+=q,M<0||M>z.length-1)return null;while(z[M].classList.contains("disabled"));return M},fe=()=>{S.value=re(!0)},ue=()=>{S.value=re(!1)},Z=G=>{p(E)&&(G.stopPropagation(),p(y).hide())},oe=G=>{var z,M;p(E)&&(G.stopPropagation(),p(S)!==null&&(p(S)===0?ee():se((M=(z=p(b))==null?void 0:z.values)==null?void 0:M[p(S)-1]),p(y).hide()))},ce=()=>{E.value=!1,S.value=null},Ce=()=>{E.value=!0,S.value=0},H=()=>{g.value.trim().length&&p(y).show()},_=async()=>{if(await zn(),h.value=g.value.trim(),!g.value.trim().length){p(y).hide();return}p(y).show(),Cn(a,"files-public-link")||V()},F=async()=>{try{const z=`[InternetShortcut]
52
- URL=${rd.sanitize(R(p(g)),{USE_PROFILES:{html:!0}})}`,M=te.urlJoin(p(T).path,`${p(h)}.url`),q=await r.webdav.putFileContents(e.space,{path:M,content:z});w.upsertResource(q),i({title:o("Shortcut was created successfully")})}catch(G){console.error(G),s({title:o("Failed to create shortcut"),errors:[G]})}};return qt(async()=>{var G,z;await zn(),I=new id((z=(G=p(y))==null?void 0:G.$refs)==null?void 0:z.drop)}),Et(b,async()=>{await zn(),!(!p(E)||!I)&&(I.unmark(),I.mark(p(g),{element:"span",className:"mark-highlight",exclude:[".selectable-item-url *",".create-shortcut-modal-search-separator *"]}))},{deep:!0}),Et(S,()=>{var z,M;if(!p(E)||typeof((M=(z=p(y))==null?void 0:z.$el)==null?void 0:M.scrollTo)!="function")return;const G=p(y).$el.querySelectorAll(".selectable-item");p(y).$el.scrollTo(0,p(S)===null?0:G[p(S)].getBoundingClientRect().y-G[p(S)].getBoundingClientRect().height)}),n({onConfirm:F}),{inputUrl:g,inputFilename:h,dropRef:y,dropItemUrl:A,searchResult:b,confirmButtonDisabled:L,inputFileNameErrorMessage:x,searchTask:$,dropItemUrlClicked:ee,dropItemResourceClicked:se,getPathPrefix:u,getFolderLink:m,getParentFolderLink:f,getParentFolderName:l,getParentFolderLinkIconAdditionalAttributes:d,onKeyEnterDrop:oe,onKeyDownDrop:ue,onKeyUpDrop:fe,onKeyEscDrop:Z,onHideDrop:ce,onShowDrop:Ce,onInputUrlInput:_,onClickUrlInput:H,isDropItemActive:ie,onConfirm:F}}}),xO={class:"oc-flex oc-flex-middle create-shortcut-modal-label"},NO=["textContent"],$O=["textContent"],DO={key:0,class:"oc-p-xs oc-flex oc-flex-center"},LO={class:"create-shortcut-modal-search-separator oc-text-muted oc-text-small oc-pl-xs"},MO=["textContent"],BO={key:0,class:"oc-flex oc-width-1-1 oc-mt-m"},jO={class:"oc-flex oc-flex-middle create-shortcut-modal-label"},UO=["textContent"];function qO(e,t,n,r,o,i){const s=ye("oc-contextual-helper"),a=ye("oc-text-input"),c=ye("oc-icon"),u=ye("oc-button"),l=ye("oc-spinner"),f=ye("resource-preview"),d=ye("oc-list"),m=ye("oc-drop");return J(),ge(Ge,null,[me(a,{id:"create-shortcut-modal-url-input",modelValue:e.inputUrl,"onUpdate:modelValue":[t[0]||(t[0]=w=>e.inputUrl=w),e.onInputUrlInput],placeholder:"example.org",label:e.$gettext("Webpage or file"),onKeydown:[no(e.onKeyUpDrop,["up"]),no(e.onKeyDownDrop,["down"]),no(e.onKeyEscDrop,["esc"]),no(e.onKeyEnterDrop,["enter"])],onClick:e.onClickUrlInput},{label:Ee(()=>[pe("div",xO,[pe("label",{for:"create-shortcut-modal-url-input",textContent:W.toDisplayString(e.$gettext("Webpage or file"))},null,8,NO),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:"oc-ml-xs"},null,8,["text","title"])])]),_:1},8,["modelValue","label","onKeydown","onUpdate:modelValue","onClick"]),me(m,{ref:"dropRef",class:"oc-pt-s","padding-size":"remove","drop-id":"create-shortcut-modal-contextmenu",mode:"manual",position:"bottom-start","close-on-click":!0,onHideDrop:e.onHideDrop,onShowDrop:e.onShowDrop},{default:Ee(()=>[me(d,null,{default:Ee(()=>{var w,v;return[pe("li",{class:W.normalizeClass(["oc-p-xs selectable-item selectable-item-url",{active:e.isDropItemActive(0)}])},[me(u,{class:"oc-width-1-1",appearance:"raw","justify-content":"left",onClick:e.dropItemUrlClicked},{default:Ee(()=>[me(c,{name:"external-link"}),pe("span",{textContent:W.toDisplayString(e.dropItemUrl)},null,8,$O)]),_:1},8,["onClick"])],2),e.searchTask.isRunning?(J(),ge("li",DO,[me(l)])):Pe("",!0),(v=(w=e.searchResult)==null?void 0:w.values)!=null&&v.length?(J(),ge(Ge,{key:1},[pe("li",LO,[pe("span",{textContent:W.toDisplayString(e.$gettext("Link to a file"))},null,8,MO)]),(J(!0),ge(Ge,null,xt(e.searchResult.values,(T,y)=>(J(),ge("li",{key:y,class:W.normalizeClass(["oc-p-xs selectable-item",{active:e.isDropItemActive(y+1)}])},[me(u,{class:"oc-width-1-1",appearance:"raw","justify-content":"left",onClick:g=>e.dropItemResourceClicked(T)},{default:Ee(()=>[me(f,{"search-result":T,"is-clickable":!1},null,8,["search-result"])]),_:2},1032,["onClick"])],2))),128))],64)):Pe("",!0)]}),_:1})]),_:1},8,["onHideDrop","onShowDrop"]),e.inputFilename?(J(),ge("div",BO,[me(a,{id:"create-shortcut-modal-filename-input",modelValue:e.inputFilename,"onUpdate:modelValue":t[1]||(t[1]=w=>e.inputFilename=w),label:e.$gettext("Shortcut name"),class:"oc-width-1-1","error-message":e.inputFileNameErrorMessage,"fix-message-line":!0},{label:Ee(()=>[pe("div",jO,[pe("label",{for:"create-shortcut-modal-filename-input",textContent:W.toDisplayString(e.$gettext("Shortcut name"))},null,8,UO),me(s,{text:e.$gettext("Shortcut name as it will appear in the file list."),title:e.$gettext("Shortcut name"),class:"oc-ml-xs"},null,8,["text","title"])])]),_:1},8,["modelValue","label","error-message"])])):Pe("",!0)],64)}const Iv=Ue(kO,[["render",qO]]),VO=({space:e})=>{const{dispatchModal:t}=wt(),{$gettext:n}=Oe.useGettext(),r=Qe(),{currentFolder:o}=We.storeToRefs(r);return{actions:j(()=>[{name:"create-shortcut",icon:"external-link",handler:()=>{t({title:n("Create a Shortcut"),confirmText:n("Create"),customComponent:Iv,customComponentAttrs:()=>({space:p(e)})})},label:()=>n("New Shortcut"),isVisible:()=>{var s;return(s=p(o))==null?void 0:s.canCreate()},class:"oc-files-actions-create-new-shortcut"}])}},zO=()=>{const{showErrorMessage:e}=rt(),t=qe(),{$gettext:n}=Oe.useGettext(),r=_r(),o=fs(),i=Xe(),s=u=>{const l=/URL=(.+)/,f=u.match(l);if(f&&f[1])return f[1];throw new Error("unable to extract url")},a=async({resources:u,space:l})=>{try{const f=new URL(window.location.href),d=(await i.webdav.getFileContents(l,u[0])).body;let m=s(d);if(m=m.match(/^http[s]?:\/\//)?m:`https://${m}`,m=rd.sanitize(m,{USE_PROFILES:{html:!0}}),m.startsWith(f.origin)){window.location.href=m;return}window.open(m)}catch(f){console.error(f),e({title:n("Failed to open shortcut"),errors:[f]})}};return{actions:j(()=>[{name:"open-shortcut",icon:"external-link",category:"context",handler:a,label:()=>n("Open shortcut"),isVisible:({resources:u})=>p(r)&&!p(o)&&!dt(t,"files-spaces-generic")&&!Cn(t,"files-public-link")&&!It(t,"files-common-favorites")&&!It(t,"files-common-search")&&!Mt(t,"files-shares-with-me")&&!Mt(t,"files-shares-with-others")&&!Mt(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}},Sn={Internal:"internal",View:"view",Upload:"upload",Edit:"edit",CreateOnly:"createOnly"},WO={LibreGraphPermissionsRolesAllowedValues:"@libre.graph.permissions.roles.allowedValues"},fa=()=>{const{$gettext:e}=Oe.useGettext(),t=an(),n=yn(),r=j(()=>n.can("create-all","PublicLink")),o=j(()=>Sn.View),i=u=>u===Sn.View?t.sharingPublicPasswordEnforcedFor.read_only:u===Sn.Upload?t.sharingPublicPasswordEnforcedFor.upload_only:u===Sn.CreateOnly?t.sharingPublicPasswordEnforcedFor.read_write:u===Sn.Edit?t.sharingPublicPasswordEnforcedFor.read_write_delete:!1,s=({isFolder:u})=>p(r)?u?[Sn.View,Sn.Edit,Sn.CreateOnly]:[Sn.View,Sn.Edit]:[],a=[{id:Sn.Internal,displayName:e("Invited people"),description:e("Link works only for invited people. Login is required."),icon:"user"},{id:Sn.View,displayName:e("Can view"),description:e("View, download"),icon:"eye"},{id:Sn.Upload,displayName:e("Can upload"),description:e("View, upload, download"),icon:"upload"},{id:Sn.Edit,displayName:e("Can edit"),description:e("View, upload, edit, download, delete"),icon:"pencil"},{id:Sn.CreateOnly,displayName:e("Secret File Drop"),description:e("Upload only, existing content is not revealed"),icon:"inbox-unarchive"}];return{defaultLinkType:o,isPasswordEnforcedForLinkType:i,getAvailableLinkTypes:s,linkShareRoles:a,getLinkRoleByType:u=>a.find(({id:l})=>l===u)}},HO=$e({name:"LinkRoleDropdown",props:{modelValue:{type:Object,required:!0},availableLinkTypeOptions:{type:Array,required:!0},dropOffset:{type:String,default:void 0}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=Oe.useGettext(),{getLinkRoleByType:r}=fa(),o=c=>e.modelValue===c,i=c=>{t("update:modelValue",c)},s=j(()=>{var c;return n((c=r(e.modelValue))==null?void 0:c.displayName)}),a=tn.v4();return{isSelectedType:o,updateSelectedType:i,currentLinkRoleLabel:s,dropUuid:a,getLinkRoleByType:r}}}),GO=["textContent"],KO=["textContent"],QO={class:"oc-flex oc-flex-middle"},XO=["textContent"],YO={class:"oc-text-small"},JO={class:"oc-flex"};function ZO(e,t,n,r,o,i){var f;const s=ye("oc-icon"),a=ye("oc-button"),c=ye("oc-list"),u=ye("oc-drop"),l=cn("oc-tooltip");return J(),ge(Ge,null,[e.availableLinkTypeOptions.length>1?(J(),Ie(a,{key:0,id:`link-role-dropdown-toggle-${e.dropUuid}`,appearance:"raw","gap-size":"none","no-hover":"",class:"oc-text-left link-role-dropdown-toggle"},{default:Ee(()=>[pe("span",{class:"link-current-role",textContent:W.toDisplayString(e.currentLinkRoleLabel||e.$gettext("Select a role"))},null,8,GO),me(s,{name:"arrow-down-s"})]),_:1},8,["id"])):it((J(),ge("span",{key:1,class:"link-current-role oc-mr-m",textContent:W.toDisplayString(e.currentLinkRoleLabel)},null,8,KO)),[[l,(f=e.getLinkRoleByType(e.modelValue))==null?void 0:f.description]]),e.availableLinkTypeOptions.length>1?(J(),Ie(u,{key:2,class:"link-role-dropdown","drop-id":`link-role-dropdown-${e.dropUuid}`,toggle:`#link-role-dropdown-toggle-${e.dropUuid}`,"padding-size":"small",mode:"click",offset:e.dropOffset,"close-on-click":""},{default:Ee(()=>[me(c,{class:"role-dropdown-list"},{default:Ee(()=>[(J(!0),ge(Ge,null,xt(e.availableLinkTypeOptions,(d,m)=>(J(),ge("li",{key:`role-dropdown-${m}`},[me(a,{id:`files-role-${e.getLinkRoleByType(d).id}`,class:W.normalizeClass([{selected:e.isSelectedType(d),"oc-secondary-container":e.isSelectedType(d)},"oc-p-s"]),appearance:"raw","justify-content":"space-between",onClick:w=>e.updateSelectedType(d)},{default:Ee(()=>[pe("span",QO,[me(s,{name:e.getLinkRoleByType(d).icon,class:"oc-pl-s oc-pr-m"},null,8,["name"]),pe("span",null,[pe("span",{class:"role-dropdown-list-option-label oc-text-bold oc-display-block oc-width-1-1",textContent:W.toDisplayString(e.$gettext(e.getLinkRoleByType(d).displayName))},null,8,XO),pe("span",YO,W.toDisplayString(e.$gettext(e.getLinkRoleByType(d).description)),1)])]),pe("span",JO,[e.isSelectedType(d)?(J(),Ie(s,{key:0,name:"check"})):Pe("",!0)])]),_:2},1032,["id","class","onClick"])]))),128))]),_:1})]),_:1},8,["drop-id","toggle","offset"])):Pe("",!0)],64)}const Cv=Ue(HO,[["render",ZO],["__scopeId","data-v-dbec00f6"]]),ek=$e({name:"CreateLinkModal",components:{LinkRoleDropdown:Cv},props:{modal:{type:Object,required:!0},resources:{type:Array,required:!0},space:{type:Object,default:void 0},callbackFn:{type:Function,default:void 0}},emits:["cancel","confirm"],setup(e,{expose:t}){const n=Xe(),r=Oe.useGettext(),{$gettext:o}=r,i=Hv(),{isEnabled:s,postMessage:a}=oi(),{defaultLinkType:c,getAvailableLinkTypes:u,getLinkRoleByType:l,isPasswordEnforcedForLinkType:f}=fa(),{addLink:d}=zt(),m=le(!1),w=le(!1),v=j(()=>e.resources.every(({isFolder:ue})=>ue)),T=j(()=>p(s)?o("Share link(s)"):o("Copy link")),y=le(tn.v4()),g=le({}),h=le(),b=xa({value:"",error:void 0}),S=le(p(c)),E=j(()=>o(l(p(S)).description)),I=j(()=>o(l(p(S)).displayName)),R=j(()=>l(p(S)).icon),A=j(()=>u({isFolder:p(v)})),N=j(()=>f(p(S))),L=i.getPolicy({enforcePassword:p(N)}),x=()=>{m.value=!0},$=({date:ue,error:Z})=>{h.value=ue,w.value=Z},V=()=>Promise.allSettled(e.resources.map(ue=>{var Z;return d({clientService:n,space:e.space,resource:ue,options:{type:p(S),"@libre.graph.quickLink":!1,password:p(b).value,expirationDateTime:(Z=p(h))==null?void 0:Z.toISO(),displayName:o("Unnamed link")}})})),X=j(()=>!!L.check(p(b).value)),ee=j(()=>!(p(X)&&!p(w))),se=async(ue={})=>{const Z=await V(),oe=Z.filter(({status:H})=>H==="fulfilled");oe.length&&p(s)&&a("opencloud-embed:share",oe.map(({value:H})=>H.webUrl));const ce=[],Ce=Z.filter(({status:H})=>H==="rejected");if(Ce.length&&Ce.map(({reason:H})=>H).forEach(H=>{var _;if(console.error(H),((_=H.response)==null?void 0:_.status)===400){const F=H.response.data.error;F.message=_t.upperFirst(F.message),ce.push(F)}}),ce.length)return b.error=o(ce[0].message),Promise.reject();e.callbackFn&&e.callbackFn({result:Z,password:b.value,options:ue})};t({onConfirm:se});const ie=ue=>p(S)===ue,re=ue=>{b.value=ue,b.error=void 0},fe=ue=>{S.value=ue};return qt(()=>{const ue=p(g)[p(S)];ue&&ue.$el.focus(),p(N)&&(b.value=i.generatePassword())}),{roleRefs:g,password:b,passwordEnforced:N,passwordPolicy:L,generatePasswordMethod:()=>i.generatePassword(),passwordInputKey:y,selectedExpiry:h,availableLinkTypes:A,selectedType:S,selectedTypeIcon:R,selectedTypeDisplayName:I,selectedTypeDescription:E,isSelectedLinkType:ie,updateSelectedLinkType:fe,updatePassword:re,getLinkRoleByType:l,confirmButtonText:T,isAdvancedMode:m,setAdvancedMode:x,onExpiryDateChanged:$,confirmButtonDisabled:ee,DateTime:jt.DateTime,onConfirm:se}}}),tk={class:"oc-flex oc-button-justify-content-space-between oc-pb-s"},nk={key:0,class:"oc-flex oc-flex-middle"},rk={key:1,class:"oc-flex oc-flex-middle"},ik={class:"oc-flex oc-flex-column"},ok=["textContent"],sk=["textContent"],ak=["textContent"],lk={class:"link-modal-password oc-mb-m"},ck={key:1,class:"link-modal-password-text oc-text-small oc-text-muted"},uk=["textContent"],fk=["textContent"],dk={class:"link-modal-actions oc-flex oc-flex-right oc-flex-middle oc-mt-s"},pk={class:"oc-rounded oc-menu-item-hover"};function hk(e,t,n,r,o,i){const s=ye("oc-icon"),a=ye("link-role-dropdown"),c=ye("oc-button"),u=ye("oc-text-input"),l=ye("oc-datepicker"),f=ye("oc-list"),d=ye("oc-drop");return J(),ge(Ge,null,[pe("div",tk,[e.isAdvancedMode?(J(),ge("div",nk,[me(s,{class:"oc-mr-s",name:e.selectedTypeIcon,"fill-type":"line"},null,8,["name"]),me(a,{"model-value":e.selectedType,"available-link-type-options":e.availableLinkTypes,"onUpdate:modelValue":e.updateSelectedLinkType},null,8,["model-value","available-link-type-options","onUpdate:modelValue"])])):(J(),ge("div",rk,[me(s,{class:"oc-mr-s",name:e.selectedTypeIcon,"fill-type":"line"},null,8,["name"]),pe("div",ik,[pe("span",{class:"oc-text-bold",textContent:W.toDisplayString(e.selectedTypeDisplayName)},null,8,ok),pe("span",{class:"oc-text-small",textContent:W.toDisplayString(e.selectedTypeDescription)},null,8,sk)])])),e.isAdvancedMode?Pe("",!0):(J(),Ie(c,{key:2,class:"link-modal-advanced-mode-button","gap-size":"xsmall",appearance:"raw","no-hover":"",onClick:t[0]||(t[0]=m=>e.setAdvancedMode())},{default:Ee(()=>[me(s,{name:"settings-3",size:"small","fill-type":"fill"}),pe("span",{textContent:W.toDisplayString(e.$gettext("Options"))},null,8,ak)]),_:1}))]),pe("div",lk,[e.isAdvancedMode?(J(),Ie(u,{key:e.passwordInputKey,"model-value":e.password.value,type:"password","password-policy":e.passwordPolicy,"generate-password-method":e.generatePasswordMethod,"error-message":e.password.error,label:e.passwordEnforced?`${e.$gettext("Password")}*`:e.$gettext("Password"),class:"link-modal-password-input","onUpdate:modelValue":e.updatePassword},null,8,["model-value","password-policy","generate-password-method","error-message","label","onUpdate:modelValue"])):e.password.value?(J(),ge("div",ck,[pe("span",{textContent:W.toDisplayString(e.$gettext("Password:"))},null,8,uk),pe("span",{textContent:W.toDisplayString(e.password.value)},null,8,fk)])):Pe("",!0),e.isAdvancedMode?(J(),Ie(l,{key:2,class:"oc-mt-s","min-date":e.DateTime.now(),label:e.$gettext("Expiry date"),onDateChanged:e.onExpiryDateChanged},null,8,["min-date","label","onDateChanged"])):Pe("",!0)]),pe("div",dk,[me(c,{class:"link-modal-cancel oc-modal-body-actions-cancel oc-ml-s",onClick:t[1]||(t[1]=m=>e.$emit("cancel"))},{default:Ee(()=>[Gt(W.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),pe("div",{class:W.normalizeClass(["link-modal-confirm-button-group oc-ml-s",{"oc-button-group":e.password.value}])},[me(c,{class:"link-modal-confirm oc-modal-body-actions-confirm",appearance:"filled",disabled:e.confirmButtonDisabled,onClick:t[2]||(t[2]=m=>e.$emit("confirm"))},{default:Ee(()=>[Gt(W.toDisplayString(e.confirmButtonText),1)]),_:1},8,["disabled"]),e.password.value?(J(),Ie(c,{key:0,class:"link-modal-confirm oc-modal-body-actions-confirm-secondary-trigger",appearance:"filled",disabled:e.confirmButtonDisabled},{default:Ee(()=>[me(s,{size:"small",name:"arrow-down-s"})]),_:1},8,["disabled"])):Pe("",!0),e.password.value?(J(),Ie(d,{key:1,"drop-id":"oc-modal-body-actions-confirm-secondary-drop",toggle:".oc-modal-body-actions-confirm-secondary-trigger",mode:"click","padding-size":"small","close-on-click":""},{default:Ee(()=>[me(f,{class:"oc-modal-body-actions-confirm-secondary-menu"},{default:Ee(()=>[pe("li",pk,[me(c,{class:"oc-modal-body-actions-confirm-password action-menu-item",appearance:"raw",onClick:t[3]||(t[3]=m=>e.$emit("confirm",{copyPassword:!0}))},{default:Ee(()=>[Gt(W.toDisplayString(e.$gettext("Copy link and password")),1)]),_:1})])]),_:1})]),_:1})):Pe("",!0)],2)])],64)}const Pv=Ue(ek,[["render",hk],["__scopeId","data-v-0f5a06c6"]]),gk=({enforceModal:e=!1}={})=>{const t=Xe(),n=St(),{showMessage:r,showErrorMessage:o}=rt(),{$gettext:i,$ngettext:s}=Oe.useGettext(),a=an(),c=yn(),u=dn(),{defaultLinkType:l}=fa(),{addLink:f}=zt(),{dispatchModal:d}=wt(),{copyToClipboard:m}=_f(),w=async({result:g,password:h,options:b={}})=>{const S=g.filter(I=>I.status==="fulfilled");if(S.length){let I=i("Link has been created successfully");if(g.length===1)try{const R=b.copyPassword?i("%{link} Password:%{password}",{link:S[0].value.webUrl,password:h},!0):S[0].value.webUrl;await m(R),I=i("The link has been copied to your clipboard.")}catch(R){console.warn("Unable to copy link to clipboard",R)}r({title:s(I,"Links have been created successfully.",S.length)})}const E=g.filter(({status:I})=>I==="rejected");E.length&&o({errors:E.map(({reason:I})=>I),title:s("Failed to create link","Failed to create links",E.length)})},v=async({space:g,resources:h})=>{const b=a.sharingPublicPasswordEnforcedFor.read_only===!0;if(e||b){d({title:s('Copy link for "%{resourceName}"',"Copy links for the selected items",h.length,{resourceName:h[0].name}),customComponent:Pv,customComponentAttrs:()=>({space:g,resources:h,callbackFn:w}),hideActions:!0});return}const S=h.map(I=>f({clientService:t,space:g,resource:I,options:{"@libre.graph.quickLink":!1,displayName:i("Unnamed link"),type:p(l)}})),E=await u.addTask(()=>Promise.allSettled(S));w({result:E})},T=({resources:g})=>{if(!g.length)return!1;for(const h of g)if(!h.canShare({user:n.user,ability:c})||te.isProjectSpaceResource(h)&&h.disabled)return!1;return!0};return{actions:j(()=>[{name:"create-links",icon:"link",handler:v,label:()=>i("Create links"),isVisible:T,class:"oc-files-actions-create-links"}])}},mk=$e({name:"AppLoadingSpinner"}),yk={class:"oc-flex oc-flex-middle oc-flex-center oc-height-1-1 oc-width-1-1"};function bk(e,t,n,r,o,i){const s=ye("oc-spinner");return J(),ge("div",yk,[me(s,{id:"app-loading-spinner",size:"large","aria-hidden":!0,"aria-label":""})])}const Mf=Ue(mk,[["render",bk]]),vk=$e({name:"FilePickerModal",components:{AppLoadingSpinner:Mf},props:{modal:{type:Object,required:!0},app:{type:Object,required:!0},parentFolderLink:{type:Object,required:!0}},setup(e){const t=le(),n=le(!0),r=qe(),{removeModal:o}=wt(),{getMatchingSpace:i}=fn(),s=si(),{getEditorRouteOpts:a}=Kn(),c=r.resolve(e.parentFolderLink),u=e.app.extensions.map(v=>v.extension?v.extension:v.mimeType),l=s.currentTheme.name,f=new URL(c.href,window.location.origin);f.searchParams.append("hide-logo","true"),f.searchParams.append("embed","true"),f.searchParams.append("embed-target","file"),f.searchParams.append("embed-delegate-authentication","false"),f.searchParams.append("embed-file-types",u.join(","));const d=()=>{n.value=!1,p(t).contentWindow.focus()},m=({data:v})=>{if(v.name!=="opencloud-embed:file-pick")return;const{resource:T,locationQuery:y}=v.data,g=i(T),h=te.isShareSpaceResource(g)?g.id:void 0,b=a(p(r.currentRoute).name,g,T,h);b.query={...b.query,...y};const S=r.resolve(b),E=new URL(S.href,window.location.origin);o(e.modal.id),window.open(E.href,"_blank")},w=({data:v})=>{v.name==="opencloud-embed:cancel"&&o(e.modal.id)};return qt(()=>{window.addEventListener("message",m),window.addEventListener("message",w)}),Wn(()=>{window.removeEventListener("message",m),window.removeEventListener("message",w)}),{isLoading:n,onLoad:d,iframeTitle:l,iframeSrc:f.href,iframeRef:t,onFilePick:m}}}),wk={class:"oc-height-1-1",tabindex:"0"},Sk=["title","src"];function Ek(e,t,n,r,o,i){const s=ye("app-loading-spinner");return J(),ge("div",wk,[e.isLoading?(J(),Ie(s,{key:0})):Pe("",!0),it(pe("iframe",{ref:"iframeRef",class:"oc-width-1-1 oc-height-1-1",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...a)=>e.onLoad&&e.onLoad(...a))},null,40,Sk),[[nl,!e.isLoading]])])}const Fv=Ue(vk,[["render",Ek]]),da=(e={},t)=>{const n=e.targetRouteCallback,{getMatchingSpace:r}=fn(e);return{createFileAction:s=>{const a=p(e.space)||r(s);t.emit("fileClick",{space:a,resources:[s]})},createFolderLink:s=>{if(p(n))return p(n)(s);const{path:a,fileId:c,resource:u}=s,l=p(e.space)||r(u);return l?Nn("files-spaces-generic",rr(l,{path:a,fileId:c})):{}}}},ci=(e={})=>{const t=an(),{$gettext:n}=Oe.useGettext(),{getInternalSpace:r,getMatchingSpace:o,isResourceAccessible:i}=fn(),{createFolderLink:s}=da(e);return{getPathPrefix:d=>{const m=p(e.space)||o(d);return te.isProjectSpaceResource(m)?ds.join(n("Spaces"),m.name):te.isShareSpaceResource(m)?ds.join(n("Shares"),m.name):m.name},getFolderLink:d=>s({path:d.path,fileId:d.fileId,resource:d}),getParentFolderLink:d=>{const m=p(e.space)||o(d),w=i({space:m,path:yt.dirname(d.path)});return d.remoteItemId&&d.path==="/"||!w?$n("files-shares-with-me"):te.isProjectSpaceResource(d)?Nn("files-spaces-projects"):s({path:yt.dirname(d.path),...d.parentFolderId&&{fileId:d.parentFolderId},resource:d})},getParentFolderName:d=>{const m=p(e.space)||o(d),w=i({space:m,path:yt.dirname(d.path)});if(te.isShareRoot(d)||d.id===m.id&&te.isShareSpaceResource(m)||!w)return n("Shared with me");const T=te.extractParentFolderName(d);if(T)return T;if(te.isShareSpaceResource(m))return m.name;if(t.spacesProjects){if(te.isProjectSpaceResource(d))return n("Spaces");if((m==null?void 0:m.driveType)==="project")return m.name}return n("Personal")},getParentFolderLinkIconAdditionalAttributes:d=>te.isProjectSpaceResource(d)||te.isProjectSpaceResource(r(d.storageId)||{})&&d.path.split("/").length===2?{name:"layout-grid","fill-type":"fill"}:{}}},Ov=({appId:e})=>{const{$gettext:t}=Oe.useGettext(),n=_r(),{dispatchModal:r}=wt(),o=ir(),{apps:i}=We.storeToRefs(o),{getParentFolderLink:s}=ci(),a=({resources:u})=>{const l=p(i)[e],f=s(u[0]);r({elementClass:"open-with-app-modal",title:t("Open file in %{app}",{app:l.name}),customComponent:Fv,hideActions:!0,customComponentAttrs:()=>({app:l,parentFolderLink:f}),focusTrapInitial:!1})};return{actions:j(()=>[{name:"open-with-app",icon:"folder-open",handler:a,label:()=>t("Open"),isVisible:()=>!p(n),class:"oc-files-actions-open-with-app-trigger"}])}},Tk=$e({name:"SaveAsModal",components:{AppLoadingSpinner:Mf},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=le(),n=le(!0),r=si(),{$gettext:o}=Oe.useGettext(),i=qe(),s=Xe(),{removeModal:a}=wt(),{showMessage:c,showErrorMessage:u}=rt(),{getMatchingSpace:l}=fn(),{getEditorRouteOpts:f}=Kn(),d=i.resolve(e.parentFolderLink),m=r.currentTheme.name,w=new URL(d.href,window.location.origin);w.searchParams.append("hide-logo","true"),w.searchParams.append("embed","true"),w.searchParams.append("embed-target","location"),w.searchParams.append("embed-choose-file-name","true"),w.searchParams.append("embed-delegate-authentication","false"),w.searchParams.append("embed-choose-file-name-suggestion",e.originalResource.name);const v=()=>{n.value=!1,p(t).contentWindow.focus()},T=async({data:b})=>{if(b.name!=="opencloud-embed:select")return;const{resources:S,fileName:E,locationQuery:I}=b.data,R=S[0],A=l(R);try{const N=await y({destinationFolder:R,fileName:E,space:A});c({title:o('"%{fileName}" was saved successfully',{fileName:N.name})}),g({resource:N,space:A,locationQuery:I})}catch(N){console.error(N),u({title:o('Unable to save "%{fileName}"',{fileName:E}),errors:[N]}),console.error(N)}a(e.modal.id)},y=async({destinationFolder:b,fileName:S,space:E})=>{const{children:I}=await s.webdav.listFiles(E,{fileId:b.fileId},{davProperties:[je.Name]});return I.find(A=>A.name===S)&&(S=Hn(S,e.originalResource.extension,I)),s.webdav.putFileContents(E,{fileName:S,parentFolderId:b.id,content:e.content,path:te.urlJoin(b.path,S)})},g=({locationQuery:b,resource:S,space:E})=>{const I=te.isShareSpaceResource(E)?E.id:void 0,R=f(p(i.currentRoute).name,E,S,I);R.query={...R.query,...b};const A=i.resolve(R),N=new URL(A.href,window.location.origin);window.open(N.href,"_blank")},h=({data:b})=>{b.name==="opencloud-embed:cancel"&&a(e.modal.id)};return qt(()=>{window.addEventListener("message",T),window.addEventListener("message",h)}),Wn(()=>{window.removeEventListener("message",T),window.removeEventListener("message",h)}),{isLoading:n,onLoad:v,iframeTitle:m,iframeSrc:w.href,iframeRef:t,onLocationPick:T}}}),Ak={class:"oc-height-1-1",tabindex:"0"},Rk=["title","src"];function _k(e,t,n,r,o,i){const s=ye("app-loading-spinner");return J(),ge("div",Ak,[e.isLoading?(J(),Ie(s,{key:0})):Pe("",!0),it(pe("iframe",{ref:"iframeRef",class:"oc-width-1-1 oc-height-1-1",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...a)=>e.onLoad&&e.onLoad(...a))},null,40,Rk),[[nl,!e.isLoading]])])}const kv=Ue(Tk,[["render",_k]]),xv=({content:e})=>{const{$gettext:t}=Oe.useGettext(),n=_r(),{dispatchModal:r}=wt(),{getParentFolderLink:o}=ci(),i=({resources:a})=>{const c=o(a[0]);r({elementClass:"save-as-modal",title:t("Save as"),customComponent:kv,hideActions:!0,customComponentAttrs:()=>({content:p(e),parentFolderLink:c,originalResource:a[0]}),focusTrapInitial:!1})};return{actions:j(()=>[{name:"save-as",icon:"save-2",handler:i,label:()=>t("Save as"),isVisible:({resources:a})=>!p(n)||a.length!==1,class:"oc-files-actions-save-as-trigger"}])}},Nv=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=St(),{$gettext:r,$ngettext:o}=Oe.useGettext(),i=yn(),s=Xe(),a=Qt(),{dispatchModal:c}=wt(),u=ct(),{removeResources:l}=Qe(),f=v=>v.filter(T=>te.isProjectSpaceResource(T)&&T.canBeDeleted({user:n.user,ability:i})),d=async v=>{const T=s.graphAuthenticated,y=v.map(S=>T.drives.deleteDrive(S.id).then(()=>(l([S]),u.removeSpace(S),!0))),g=await Promise.allSettled(y),h=g.filter(S=>S.status==="fulfilled");if(h.length){const S=h.length===1&&v.length===1?r('Space "%{space}" was deleted successfully',{space:v[0].name}):o("%{spaceCount} space was deleted successfully","%{spaceCount} spaces were deleted successfully",h.length,{spaceCount:h.length.toString()},!0);e({title:S})}const b=g.filter(S=>S.status==="rejected");if(b.length){b.forEach(console.error);const S=b.length===1&&v.length===1?r('Failed to delete space "%{space}"',{space:v[0].name}):o("Failed to delete %{spaceCount} space","Failed to delete %{spaceCount} spaces",b.length,{spaceCount:b.length.toString()},!0);t({title:S,errors:b.map(E=>E.reason)})}p(a).name==="admin-settings-spaces"&&Ke.publish("app.admin-settings.list.load")},m=({resources:v})=>{const T=f(v);if(!T.length)return;const y=o("Are you sure you want to delete the selected space?","Are you sure you want to delete %{count} selected spaces?",T.length,{count:T.length.toString()});c({title:o('Delete Space "%{space}"?',"Delete %{spaceCount} Spaces?",T.length,{space:T[0].name,spaceCount:T.length.toString()}),confirmText:r("Delete"),message:y,hasInput:!1,onConfirm:()=>d(T)})};return{actions:j(()=>[{name:"delete",icon:"delete-bin",label:()=>r("Delete"),handler:m,isVisible:({resources:v})=>!!f(v).length,class:"oc-files-actions-delete-trigger"}]),deleteSpaces:d}},$v=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=St(),{$gettext:r,$ngettext:o}=Oe.useGettext(),i=yn(),s=Xe(),a=Qt(),c=qe(),{dispatchModal:u}=wt(),l=ct(),f=v=>v.filter(T=>te.isProjectSpaceResource(T)&&T.canDisable({user:n.user,ability:i})),d=async v=>{const T=p(a),y=s.graphAuthenticated,g=v.map(E=>y.drives.disableDrive(E.id).then(()=>(T.name==="files-spaces-generic"&&c.push({name:"files-spaces-projects"}),T.name==="admin-settings-spaces"&&(E.disabled=!0,E.spaceQuota={total:E.spaceQuota.total}),l.updateSpaceField({id:E.id,field:"disabled",value:!0}),!0))),h=await Promise.allSettled(g),b=h.filter(E=>E.status==="fulfilled");if(b.length){const E=b.length===1&&v.length===1?r('Space "%{space}" was disabled successfully',{space:v[0].name}):o("%{spaceCount} space was disabled successfully","%{spaceCount} spaces were disabled successfully",b.length,{spaceCount:b.length.toString()},!0);e({title:E})}const S=h.filter(E=>E.status==="rejected");if(S.length){S.forEach(console.error);const E=S.length===1&&v.length===1?r('Failed to disable space "%{space}"',{space:v[0].name}):o("Failed to disable %{spaceCount} space","Failed to disable %{spaceCount} spaces",S.length,{spaceCount:S.length.toString()},!0);t({title:E,errors:S.map(I=>I.reason)})}},m=({resources:v})=>{const T=f(v);if(!T.length)return;const y=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.",T.length,{count:T.length.toString()}),g=r("Disable");u({title:o('Disable Space "%{space}"?',"Disable %{spaceCount} Spaces?",T.length,{space:T[0].name,spaceCount:T.length.toString()}),confirmText:g,message:y,hasInput:!1,onConfirm:()=>d(T)})};return{actions:j(()=>[{name:"disable",icon:"stop-circle",label:()=>r("Disable"),handler:m,isVisible:({resources:v})=>!!f(v).length,class:"oc-files-actions-disable-trigger"}]),disableSpaces:d}},Dv=()=>{const e=lt(),t=ct(),n=zt(),{showMessage:r,showErrorMessage:o}=rt(),i=qe(),{$gettext:s}=Oe.useGettext(),a=yn(),c=Xe(),u=dn(),{upsertResource:l}=Qe(),f=dt(i,"files-spaces-projects"),d=async v=>{const T=t.spaces.filter(te.isProjectSpaceResource),y=Hn(v.name,"",T);try{let g=await c.graphAuthenticated.drives.createDrive({name:y,description:v.description,quota:{total:v.spaceQuota.total}},n.graphRoles);const h=await c.webdav.listFiles(v);if(h.children.length){const b=new Ur({concurrency:e.options.concurrentRequests.resourceBatchActions}),S=[];for(const E of h.children)S.push(b.add(()=>c.webdav.copyFiles(v,E,g,{path:E.name})));await Promise.all(S)}if(v.spaceReadmeData||v.spaceImageData){const b={special:[]};if(v.spaceReadmeData){const S=await c.webdav.getFileInfo(g,{path:`.space/${v.spaceReadmeData.name}`});b.special.push({specialFolder:{name:"readme"},id:S.id})}if(v.spaceImageData){const S=await c.webdav.getFileInfo(g,{path:`.space/${v.spaceImageData.name}`});b.special.push({specialFolder:{name:"image"},id:S.id})}g=await c.graphAuthenticated.drives.updateDrive(g.id,b,n.graphRoles)}t.upsertSpace(g),f&&l(g),r({title:s('Space "%{space}" was duplicated successfully',{space:v.name})})}catch(g){console.error(g),o({title:s('Failed to duplicate space "%{space}"',{space:v.name}),errors:[g]})}},m=async({resources:v})=>{for(const T of v)T.disabled||!te.isProjectSpaceResource(T)||await d(T)};return{actions:j(()=>[{name:"duplicate",icon:"folders",label:()=>s("Duplicate"),handler:v=>u.addTask(()=>m(v)),isVisible:({resources:v})=>!(v!=null&&v.length)||v.every(T=>T.disabled)||v.every(T=>!te.isProjectSpaceResource(T))?!1:a.can("create-all","Drive"),class:"oc-files-actions-duplicate-trigger"}]),duplicateSpace:d}},Ik=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=St(),{$gettext:r}=Oe.useGettext(),o=yn(),i=Xe(),s=Qt(),{dispatchModal:a}=wt(),c=ct(),u=zt(),l=(m,w)=>i.graphAuthenticated.drives.updateDrive(m.id,{name:m.name,description:w},u.graphRoles).then(()=>{c.updateSpaceField({id:m.id,field:"description",value:w}),p(s).name==="admin-settings-spaces"&&(m.description=w),e({title:r("Space subtitle was changed successfully")})}).catch(T=>{console.error(T),t({title:r("Failed to change space subtitle"),errors:[T]})}),f=({resources:m})=>{m.length===1&&a({title:r("Change subtitle for space")+" "+m[0].name,confirmText:r("Confirm"),hasInput:!0,inputLabel:r("Space subtitle"),inputValue:m[0].description,onConfirm:w=>l(m[0],w)})};return{actions:j(()=>[{name:"editDescription",icon:"h-2",iconFillType:"none",label:()=>r("Edit subtitle"),handler:f,isVisible:({resources:m})=>m.length!==1?!1:m[0].canEditDescription({user:n.user,ability:o}),class:"oc-files-actions-edit-description-trigger"}]),editDescriptionSpace:l}},Ck={name:"QuotaSelect",props:{totalQuota:{type:Number,default:0},maxQuota:{type:Number,default:0}},emits:["selectedOptionChange"],setup(){const e=le(void 0),t=le([]);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 _t.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=An(e,this.$language.current);return this.isValueValidNumber(e)?t:e.toString()}}},Pk={class:"quota-select-batch-action-form"},Fk=["textContent"],Ok={class:"oc-flex oc-flex-between"},kk=["textContent"],xk={key:0,class:"oc-text-input-danger"};function Nk(e,t,n,r,o,i){const s=ye("oc-icon"),a=ye("oc-select");return J(),ge("div",Pk,[me(a,Kt({ref:"select","model-value":r.selectedOption,selectable:i.optionSelectable,taggable:"","push-tags":"",clearable:!1,options:r.options,"create-option":i.createOption,"option-label":"displayValue",label:e.$gettext("Quota")},e.$attrs,{"onUpdate:modelValue":i.onUpdate}),{"selected-option":Ee(({displayValue:c})=>[e.$attrs["read-only"]?(J(),Ie(s,{key:0,name:"lock",class:"oc-mr-xs",size:"small"})):Pe("",!0),pe("span",{textContent:W.toDisplayString(c)},null,8,Fk)]),search:Ee(({attributes:c,events:u})=>[pe("input",Kt({class:"vs__search"},c,Ha(u,!0)),null,16)]),option:Ee(({displayValue:c,error:u})=>[pe("div",Ok,[pe("span",{textContent:W.toDisplayString(c)},null,8,kk)]),u?(J(),ge("div",xk,W.toDisplayString(u),1)):Pe("",!0)]),_:1},16,["model-value","selectable","options","create-option","label","onUpdate:modelValue"])])}const Lv=Ue(Ck,[["render",Nk]]),$k=$e({name:"SpaceQuotaModal",components:{QuotaSelect:Lv},props:{modal:{type:Object,required:!0},spaces:{type:Array,required:!0},warningMessage:{type:String,default:""},warningMessageContextualHelperData:{type:Object,default:()=>{}},resourceType:{type:String,required:!1,default:"space",validator:e=>["space","user"].includes(e)}},emits:["update:confirmDisabled"],setup(e,{emit:t,expose:n}){const{showMessage:r,showErrorMessage:o}=rt(),i=an(),s=We.storeToRefs(i),{$gettext:a,$ngettext:c}=Oe.useGettext(),u=Xe(),l=qe(),f=ct(),d=zt(),{updateResourceField:m}=Qe(),w=le(0),v=b=>e.resourceType==="space"?c("Space quota was changed successfully","Quota of %{count} spaces was changed successfully",b,{count:b.toString()}):e.resourceType==="user"?c("User quota was changed successfully","Quota of %{count} users was changed successfully",b,{count:b.toString()}):a("Quota was changed successfully"),T=b=>e.resourceType==="space"?c("Failed to change space quota","Failed to change quota for %{count} spaces",b,{count:b.toString()}):e.resourceType==="user"?c("Failed to change user quota","Failed to change quota for %{count} users",b,{count:b.toString()}):a("Failed to change quota"),y=j(()=>!e.spaces.some(b=>b.spaceQuota.total!==p(w)));Et(y,()=>{t("update:confirmDisabled",p(y))},{immediate:!0});const g=b=>{w.value=b.value},h=async()=>{const b=u.graphAuthenticated,S=e.spaces.map(async A=>{const N=await b.drives.updateDrive(A.id,{name:A.name,quota:{total:p(w)}},d.graphRoles);p(l.currentRoute).name==="admin-settings-spaces"&&Ke.publish("app.admin-settings.spaces.space.quota.updated",{spaceId:A.id,quota:N.spaceQuota}),p(l.currentRoute).name==="admin-settings-users"&&Ke.publish("app.admin-settings.users.user.quota.updated",{spaceId:A.id,quota:N.spaceQuota}),f.updateSpaceField({id:A.id,field:"spaceQuota",value:N.spaceQuota}),m({id:A.id,field:"spaceQuota",value:N.spaceQuota})}),E=await Promise.allSettled(S),I=E.filter(A=>A.status==="fulfilled");I.length&&r({title:v(I.length)});const R=E.filter(A=>A.status==="rejected");R.length&&(console.error(R),R.forEach(console.error),o({title:T(R.length),errors:R.map(A=>A.reason)}))};return n({onConfirm:h}),qt(()=>{var b,S;w.value=((S=(b=e.spaces[0])==null?void 0:b.spaceQuota)==null?void 0:S.total)||0}),{selectedOption:w,confirmButtonDisabled:y,changeSelectedQuotaOption:g,maxQuota:s.spacesMaxQuota,onConfirm:h}}}),Dk={key:0,class:"oc-mt-s"},Lk=["textContent"];function Mk(e,t,n,r,o,i){const s=ye("quota-select"),a=ye("oc-contextual-helper");return J(),ge(Ge,null,[me(s,{"total-quota":e.selectedOption,"max-quota":e.maxQuota,"position-fixed":!0,onSelectedOptionChange:e.changeSelectedQuotaOption},null,8,["total-quota","max-quota","onSelectedOptionChange"]),e.warningMessage?(J(),ge("div",Dk,[pe("span",{class:"oc-text-input-warning",textContent:W.toDisplayString(e.warningMessage)},null,8,Lk),e.warningMessageContextualHelperData?(J(),Ie(a,Kt({key:0,class:"oc-pl-xs"},e.warningMessageContextualHelperData),null,16)):Pe("",!0)])):Pe("",!0)],64)}const Mv=Ue($k,[["render",Mk]]),Bv=()=>{const{dispatchModal:e}=wt(),{$gettext:t}=Oe.useGettext(),n=yn(),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()}),o=({resources:s})=>{e({title:r({resources:s}),customComponent:Mv,customComponentAttrs:()=>({spaces:s,resourceType:"space"})})};return{actions:j(()=>[{name:"editQuota",icon:"cloud",label:()=>t("Edit quota"),handler:o,isVisible:({resources:s})=>!s||!s.length||s.some(a=>!te.isProjectSpaceResource(a)||te.isSpaceResource(a)&&!a.spaceQuota)?!1:n.can("set-quota-all","Drive"),class:"oc-files-actions-edit-quota-trigger"}])}};function jv(){const{getDefaultAction:e}=Kn();return{openWithDefaultApp:({space:n,resource:r})=>{if(!r||r.isFolder)return;const o={resources:[r],space:n},i=e({...o,omitSystemActions:!0});i&&i.handler(o)}}}const Bk=()=>{const e=Xe(),{openWithDefaultApp:t}=jv(),{createDefaultMetaFolder:n}=Ui(),r=St(),o=ct(),i=zt(),{$gettext:s}=Oe.useGettext(),{getDefaultMetaFolder:a}=li(),c=async(f,d)=>{const m=await e.webdav.putFileContents(f,{path:".space/readme.md",parentFolderId:d.id,fileName:"readme.md"}),w=await e.graphAuthenticated.drives.updateDrive(f.id,{name:f.name,special:[{specialFolder:{name:"readme"},id:m.id}]},i.graphRoles);return o.updateSpaceField({id:f.id,field:"spaceReadmeData",value:w.spaceReadmeData}),m},u=async({resources:f})=>{let d=null,m=await a(f[0]);if(m||(m=await n(f[0]),d=await c(f[0],m)),!d){const w=te.getRelativeSpecialFolderSpacePath(f[0],"readme");w?d=await e.webdav.getFileInfo(f[0],{path:w}):d=await c(f[0],m)}t({space:f[0],resource:d})};return{actions:j(()=>[{name:"editReadmeContent",icon:"article",label:()=>s("Edit description"),handler:u,isVisible:({resources:f})=>f.length!==1?!1:f[0].canEditReadme({user:r.user}),class:"oc-files-actions-edit-readme-content-trigger"}])}},Uv=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=St(),{$gettext:r}=Oe.useGettext(),o=yn(),i=Xe(),s=Qt(),{checkSpaceNameModalInput:a}=li(),{dispatchModal:c}=wt(),u=ct(),l=zt(),f=(w,v)=>i.graphAuthenticated.drives.updateDrive(w.id,{name:v},l.graphRoles).then(()=>{p(s).name==="admin-settings-spaces"&&(w.name=v),u.updateSpaceField({id:w.id,field:"name",value:v}),e({title:r("Space name was changed successfully")})}).catch(y=>{console.error(y),t({title:r("Failed to rename space"),errors:[y]})}),d=({resources:w})=>{w.length===1&&c({title:r("Rename space")+" "+w[0].name,confirmText:r("Rename"),hasInput:!0,inputLabel:r("Space name"),inputValue:w[0].name,onConfirm:v=>f(w[0],v),onInput:a})};return{actions:j(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:d,isVisible:({resources:w})=>w.length!==1?!1:w[0].canRename({user:n.user,ability:o}),class:"oc-files-actions-rename-trigger"}]),renameSpace:f}},qv=()=>{const{showMessage:e,showErrorMessage:t}=rt(),n=St(),{$gettext:r,$ngettext:o}=Oe.useGettext(),i=yn(),s=Xe(),a=dn(),c=Qt(),{dispatchModal:u}=wt(),l=ct(),f=zt(),d=T=>T.filter(y=>te.isProjectSpaceResource(y)&&y.canRestore({user:n.user,ability:i})),m=async T=>{const y=s.graphAuthenticated,g=T.map(E=>y.drives.updateDrive(E.id,{name:E.name},f.graphRoles,{headers:{Restore:"true"}}).then(I=>(p(c).name==="admin-settings-spaces"&&(E.disabled=!1,E.spaceQuota=I.spaceQuota),l.updateSpaceField({id:E.id,field:"disabled",value:!1}),!0))),h=await a.addTask(()=>Promise.allSettled(g)),b=h.filter(E=>E.status==="fulfilled");if(b.length){const E=b.length===1&&T.length===1?r('Space "%{space}" was enabled successfully',{space:T[0].name}):o("%{spaceCount} space was enabled successfully","%{spaceCount} spaces were enabled successfully",b.length,{spaceCount:b.length.toString()},!0);e({title:E})}const S=h.filter(E=>E.status==="rejected");if(S.length){S.forEach(console.error);const E=S.length===1&&T.length===1?r('Failed to enabled space "%{space}"',{space:T[0].name}):o("Failed to enable %{spaceCount} space","Failed to enable %{spaceCount} spaces",S.length,{spaceCount:S.length.toString()},!0);t({title:E,errors:S.map(I=>I.reason)})}},w=({resources:T})=>{const y=d(T);if(!y.length)return;const g=o("If you enable the selected space, it can be accessed again.","If you enable the %{count} selected spaces, they can be accessed again.",y.length,{count:y.length.toString()}),h=r("Enable");u({title:o('Enable Space "%{space}"?',"Enable %{spaceCount} Spaces?",y.length,{space:y[0].name,spaceCount:y.length.toString()}),confirmText:h,message:g,hasInput:!1,onConfirm:()=>m(y)})};return{actions:j(()=>[{name:"restore",icon:"play-circle",label:()=>r("Enable"),handler:w,isVisible:({resources:T})=>!!d(T).length,class:"oc-files-actions-restore-trigger"}]),restoreSpaces:m}},jk=()=>{const{$gettext:e}=Oe.useGettext(),t=Qe(),n=({resources:o})=>{t.setSelection(o.map(({id:i})=>i)),Ke.publish(vt.openWithPanel,"space-share")};return{actions:j(()=>[{name:"show-members",icon:"group",label:()=>e("Members"),handler:n,isVisible:({resources:o})=>o.length===1&&!o[0].disabled,class:"oc-files-actions-show-details-trigger"}])}},Uk=()=>{const e=qe(),{$gettext:t}=Oe.useGettext(),n=o=>Fi("files-trash-generic",{...rr(o,{fileId:o.fileId})});return{actions:j(()=>[{name:"navigateToTrash",icon:"delete-bin",label:()=>t("Show deleted files"),handler:({resources:o})=>{e.push(n(o[0]))},isVisible:({resources:o})=>!(o.length!==1||!te.isProjectSpaceResource(o[0])||o[0].disabled),class:"oc-files-actions-navigate-to-trash-trigger"}])}},qk=$e({name:"EmojiPickerModal",components:{},props:{modal:{type:Object,required:!0}},emits:["confirm"],setup(e,{emit:t}){const n=si(),{currentTheme:r}=We.storeToRefs(n),o=j(()=>p(r).isDark?"dark":"light");return{onEmojiSelect:s=>{t("confirm",s)},theme:o}}});function Vk(e,t,n,r,o,i){const s=ye("oc-emoji-picker");return J(),Ie(s,{theme:e.theme,onEmojiSelect:e.onEmojiSelect},null,8,["theme","onEmojiSelect"])}const Vv=Ue(qk,[["render",Vk]]),zk=()=>{const e=St(),{showMessage:t,showErrorMessage:n}=rt(),{$gettext:r}=Oe.useGettext(),o=Xe(),i=dn(),s=ct(),{createDefaultMetaFolder:a}=Ui(),{dispatchModal:c}=wt(),{getDefaultMetaFolder:u}=li(),l=zt(),f=({resources:v})=>{v.length===1&&c({elementClass:"oc-width-auto",title:r("Set icon for %{space}",{space:v[0].name}),hideConfirmButton:!0,customComponent:Vv,focusTrapInitial:!1,onConfirm:T=>m(v[0],T)})},d=async v=>{const T=document.createElement("canvas"),y=T.getContext("2d"),g=16/9,h=720,b=h/g;T.width=h,T.height=b;const S=.4*h;y.font=`${S}px sans-serif`,y.textBaseline="middle",y.textAlign="center",y.fillText(v,T.width/2,T.height/2+15);const I=await Cb(T);return Ib(I)},m=async(v,T)=>{const y=o.graphAuthenticated,g=await d(T);let h=await u(v);return h||(h=await a(v)),i.addTask(async()=>{const b={"Content-Type":"application/offset+octet-stream"};try{const{fileId:S}=await o.webdav.putFileContents(v,{parentFolderId:h.id,fileName:"emoji.png",content:g,headers:b,overwrite:!0}),E=await y.drives.updateDrive(v.id,{name:v.name,special:[{specialFolder:{name:"image"},id:S}]},l.graphRoles);s.updateSpaceField({id:v.id,field:"spaceImageData",value:E.spaceImageData}),t({title:r("Space icon was set successfully")}),Ke.publish("app.files.spaces.uploaded-image",E)}catch(S){console.error(S),n({title:r("Failed to set space icon"),errors:[S]})}})};return{actions:j(()=>[{name:"set-space-icon",icon:"emoji-sticker",handler:f,label:()=>r("Set icon"),isVisible:({resources:v})=>v.length!==1?!1:v[0].canEditImage({user:e.user}),class:"oc-files-actions-set-space-icon-trigger"}]),setIconSpace:m}},Wk=()=>{const{$gettext:e}=Oe.useGettext();return{actions:j(()=>[{name:"show-details",icon:"information",label:()=>e("Details"),handler:()=>Ke.publish(vt.open),isVisible:({resources:n})=>n.length>0,class:"oc-admin-settings-show-details-trigger"}])}},Hk=()=>{const{getMatchingSpace:e}=fn(),t=ct(),n=ir(),r=Qe(),o=Xe(),{$gettext:i}=Oe.useGettext(),{openEditor:s}=Kn(),{resources:a,currentFolder:c}=We.storeToRefs(r);return{openEmptyEditor:async(l,f)=>{var h;let d=p(c)?e(p(c)):null,m=p(a),w=(h=p(c))==null?void 0:h.path;(!d||!p(c).canCreate())&&(d=t.personalSpace,m=(await o.webdav.listFiles(d)).children,w="");let v=i("New file")+`.${f}`;m.some(b=>b.name===v)&&(v=Hn(v,f,m));const T=await o.webdav.putFileContents(d,{path:te.urlJoin(w,v)}),y=e(T),g=n.fileExtensions.find(({app:b,extension:S})=>b===l&&S===f);s(g,y,T)}}},zv=()=>{const{$gettext:e}=Oe.useGettext(),{showMessage:t}=rt();return{openUrl:(r,o,i)=>{const s=window.open(r,o);s?i&&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.")})}}},Gk=()=>vr("$appProviderService"),Kk=()=>{const{isResourceAccessible:e}=fn();return{breadcrumbsFromPath:({route:r,space:o,resourcePath:i,ancestorMetaData:s=le({})})=>{const a=(l="")=>l.split("/").filter(Boolean),c=a(r.path),u=a(i);return u.map((l,f)=>{const d=te.urlJoin(...u.slice(0,f+1),{leadingSlash:!0}),m=e({space:p(o),path:d});let w;return m&&(w=p(s)[d]),{id:tn.v4(),allowContextActions:!0,text:l,...m&&{to:{path:"/"+[...c].splice(0,c.length-u.length+f+1).join("/"),query:{...Mi(r.query,"page","fileId"),...w&&{fileId:w.id}}}},isStaticNav:!1}})},concatBreadcrumbs:(...r)=>{const o=r.pop();return[...r,{id:tn.v4(),allowContextActions:o.allowContextActions,text:o.text,onClick:()=>Ke.publish("app.files.list.load"),isTruncationPlaceholder:o.isTruncationPlaceholder,isStaticNav:o.isStaticNav}]}}},Qk=(e="")=>{const t=le(0),n=async()=>{await zn();const r=document.querySelector(e||"#files-app-bar"),o=r?r.getBoundingClientRect().height:0;t.value!==o&&(t.value=o)};return window.onresize=n,qt(n),{y:t,refresh:n}},Bf=()=>{const e=le(!0),t=()=>{e.value=window.innerHeight>500};return qt(()=>{t(),window.addEventListener("resize",t)}),Wn(()=>{window.removeEventListener("resize",t)}),{isSticky:e}};var jf=(e=>(e.C="c",e.V="v",e.X="x",e.A="a",e.S="s",e.Space=" ",e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.Esc="Escape",e.Backspace="Backspace",e.Delete="Delete",e))(jf||{}),Uf=(e=>(e.Ctrl="Control",e.Shift="Shift",e))(Uf||{});const Xk=()=>{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==null?void 0:n.closest("[data-custom-key-bindings-disabled='true']")}catch{r=n==null?void 0:n.parentElement.closest("[data-custom-key-bindings-disabled='true']")}return r?!0:window.getSelection().type==="Range"},Wv=e=>{const t=le([]),n=le(0),r=a=>{if(!(e!=null&&e.skipDisabledKeyBindingsCheck)&&Xk())return;const{key:c,ctrlKey:u,metaKey:l,shiftKey:f}=a;let d=null;const m=[];l||u?(d="Control",m.push("altKey","shiftKey")):f&&(d="Shift",m.push("altKey","ctrlKey","metaKey")),!((v,T)=>T.some(y=>v[y]))(a,m)&&p(t).filter(v=>v.primary===c&&v.modifier===d).forEach(v=>{a.preventDefault(),v.callback(a)})},o=(a,c)=>{const u=tn.v4();return t.value.push({id:u,...a,modifier:a.modifier??null,callback:c}),u},i=a=>{t.value=t.value.filter(c=>c.id!==a)},s=()=>{n.value=0};return qr.useEventListener(document,"keydown",r),{actions:t,bindKeyAction:o,removeKeyAction:i,selectionCursor:n,resetSelectionCursor:s}};class Ir{}Se(Ir,"perPageDefault","100"),Se(Ir,"perPageQueryName","items-per-page"),Se(Ir,"options",["20","50","100","250","500"]);function Yk(e){const t=Bo.useRouter(),n=Bo.useRoute(),r=Jk(e),o=Zk(e),i=j(()=>Math.ceil(p(e.items).length/p(o))||1),s=j(()=>{if(!p(o))return p(e.items);const a=(p(r)-1)*p(o),c=a+p(o);return p(e.items).slice(a,c)});return Ke.subscribe("app.files.navigate.page",({resourceId:a,forceScroll:c,topbarElement:u})=>{const l=_t.findIndex(p(e.items),f=>f.id===a);if(l>=0){const f=Math.ceil((l+1)/Number(p(o)));t.push({...p(n),query:{...p(n).query,page:f}}).then(()=>{Ke.publish("app.files.navigate.scrollTo",{resourceId:a,forceScroll:c,topbarElement:u})})}}),{items:s,total:i,page:r,perPage:o}}function Jk(e){if(e.page)return j(()=>p(e.page));const t=ln("page","1");return j(()=>parseInt(At(p(t))))}function Zk(e){if(e.perPage)return j(()=>p(e.perPage));const t=Tr({name:e.perPageQueryName||Ir.perPageQueryName,defaultValue:e.perPageDefault||Ir.perPageDefault,storagePrefix:e.perPageStoragePrefix});return j(()=>parseInt(At(p(t))))}const Hv=()=>vr("$passwordPolicyService");var pa=(e=>(e.mounted="portal-target.mounted",e))(pa||{});const ex=()=>{const e=ai(),t=wa.useWormhole();return{registerPortal:r=>{e.subscribe(pa.mounted,()=>{t.open(r)})}}},qf=()=>{const e=ir();return{canBeOpenedWithSecureView:n=>e.fileExtensions.filter(({secureView:o})=>o).some(({mimeType:o})=>o===n.mimeType)}},Gv=()=>{const e=St();return{canListVersions:({space:n,resource:r})=>r.type==="folder"||te.isSpaceResource(r)||te.isTrashResource(r)?!1:n==null?void 0:n.canListVersions({user:e.user})}},Kv=()=>{const e=Xe(),t=ct(),n=zt(),r=j(()=>t.spaces),o=c=>p(r).find(u=>c.toString().startsWith(u.id.toString())),i=c=>p(r).find(u=>{var l,f;return te.isMountPointSpaceResource(u)&&((f=(l=u.root)==null?void 0:l.remoteItem)==null?void 0:f.id)===c}),s=c=>{const u=[je.FileId,je.FileParent,je.Name,je.ResourceType],l=te.buildSpace({id:c,name:""},n.graphRoles);return e.webdav.getFileInfo(l,{fileId:c},{davProperties:u})};return{getResourceContext:async c=>{var v,T,y,g,h;let u,l,f=o(c);if(f)return u=await e.webdav.getPathForFileId(c),l=await e.webdav.getFileInfo(f,{path:u}),{space:f,resource:l,path:u};await t.loadMountPoints({graphClient:e.graphAuthenticated});let d=i(c);l=await s(c);const m=d?[]:[p(l).name];let w=p(l);for(;!d;)w=await s(w.parentFolderId),d=i(w.id),d||m.unshift(w.name);return f=t.getSpace((T=(v=d.root)==null?void 0:v.remoteItem)==null?void 0:T.id)||t.createShareSpace({driveAliasPrefix:(y=l.storageId)!=null&&y.startsWith(te.OCM_PROVIDER_ID)?"ocm-share":"share",id:(h=(g=d.root)==null?void 0:g.remoteItem)==null?void 0:h.id,shareName:d.name}),u=te.urlJoin(...m),{space:f,resource:l,path:u}}}},Zt={name:{table:"resource-table",condensedTable:"resource-table-condensed",tiles:"resource-tiles"},defaultModeName:"resource-table",queryName:"view-mode",tilesSizeDefault:2,tilesSizeMax:6,tilesSizeQueryName:"tiles-size"},Qv=()=>{const e=i=>{if(!i.endsWith("rem")&&!i.endsWith("px"))return 0;if(i.endsWith("rem")){const s=parseInt(i.replace("rem","").trim()),a=parseFloat(getComputedStyle(document.documentElement).fontSize);return s*a}return parseInt(i.replace("px","").trim())},t=le(0),n=le(0);qt(()=>{const i=getComputedStyle(document.documentElement);t.value=e(i.getPropertyValue("--oc-size-tiles-default")),n.value=e(i.getPropertyValue("--oc-size-tiles-resize-step"))});const r=i=>p(t)+(i-1)*p(n);return{calculateTileSizePixels:r,calculateTileSizeRem:i=>{const s=parseFloat(getComputedStyle(document.documentElement).fontSize);return r(i)/s}}};function tx(e){if(e)return j(()=>p(e));const t=Tr({name:Zt.queryName,defaultValue:Zt.defaultModeName});return j(()=>At(p(t)))}function nx(e){if(e)return j(()=>parseInt(p(e)));const t=Tr({name:Zt.tilesSizeQueryName,defaultValue:Zt.tilesSizeDefault.toString()});return j(()=>parseInt(At(p(t))))}const rx=le(Zt.tilesSizeMax);function Vf(){return rx}const zf=e=>{const t=Of(),{updateResourceField:n}=Qe(),{httpAuthenticated:r}=Xe(),o=ct(),{defaultSpaceImageBlobURL:i}=We.storeToRefs(o),s=lt(),{serverUrl:a}=We.storeToRefs(s),c=new Ur({concurrency:4}),u=j(()=>p(e)===Zt.name.tiles),l=j(()=>p(u)?Ws.enum.fit:Ws.enum.thumbnail),f=j(()=>p(u)?Qn.Tile:Qn.Thumbnail),d=hn.useTask(function*(T,{space:y,resource:g,dimensions:h,processor:b,updateStore:S=!0}){var A;const E=te.isProjectSpaceResource(g)?te.buildSpaceImageResource(g):g,I=E.id===((A=y.spaceImageData)==null?void 0:A.id);I&&o.addToImagesLoading(y.id);const R=yield c.add(()=>t.loadPreview({space:y,resource:E,processor:b||p(l),dimensions:h||p(f)},!0,!0,T));return R&&S&&n({id:g.id,field:"thumbnail",value:R}),I&&o.removeFromImagesLoading(y.id),R}),m=async T=>{const{resource:y,cancelRunning:g}=T;if(g&&v(),te.isProjectSpaceResource(y)&&(!y.spaceImageData||y.disabled)){if(p(i))return y.thumbnail=p(i),p(i);try{const h=await r.get(`${p(a)}images/default-space-icon.png`,{responseType:"blob"});return o.setDefaultSpaceImageBlobURL(URL.createObjectURL(h.data)),y.thumbnail=p(i),p(i)}catch{return null}}try{return await d.perform(T)}catch(h){h!=="cancel"&&console.error(h)}},w=j(()=>d.isRunning),v=()=>{d.cancelAll(),c.clear(),o.purgeImagesLoading()};return za(v),{loadPreview:m,previewsLoading:w}},Xv=({showSizeInformation:e=!0}={})=>{const t=Qe(),{current:n,$gettext:r,$ngettext:o}=Oe.useGettext(),i=qe(),{resources:s,totalResourcesCount:a,areHiddenFilesShown:c,currentFolder:u}=We.storeToRefs(t),l=j(()=>{var d,m;if(!((d=p(u))!=null&&d.size)||((m=p(u))==null?void 0:m.size)==="0"){const w=p(s).map(v=>v.size?parseInt(v.size.toString()):0).reduce((v,T)=>v+T,0);return An(w,n)}return An(p(u).size,n)});return{resourceContentsText:j(()=>{let d=o("%{ filesCount } file","%{ filesCount } files",p(a).files,{filesCount:p(a).files.toString()});!p(c)&&p(a).hiddenFiles&&(d=o("%{ filesCount } file including %{ filesHiddenCount } hidden","%{ filesCount } files including %{ filesHiddenCount } hidden",p(a).files,{filesCount:p(a).files.toString(),filesHiddenCount:p(a).hiddenFiles.toString()}));let m=o("%{ foldersCount } folder","%{ foldersCount } folders",p(a).folders,{foldersCount:p(a).folders.toString()});!p(c)&&p(a).hiddenFolders&&(m=o("%{ foldersCount } folder including %{ foldersHiddenCount } hidden","%{ foldersCount } folders including %{ foldersHiddenCount } hidden",p(a).folders,{foldersCount:p(a).folders.toString(),foldersHiddenCount:p(a).hiddenFolders.toString()}));const w=o("%{ spacesCount } space","%{ spacesCount } spaces",p(a).spaces,{spacesCount:p(a).spaces.toString()}),v=p(a).files+p(a).folders+p(a).spaces,T=e&&parseFloat(p(l))>0,y=Mt(i,"files-shares-via-link"),g=r(T?"%{ itemsCount } item with %{ itemSize } in total":"%{ itemsCount } item in total"),h=r(T?"%{ itemsCount } items with %{ itemSize } in total":"%{ itemsCount } items in total"),b=y?"(%{ filesStr}, %{ foldersStr}, %{ spacesStr})":"(%{ filesStr}, %{ foldersStr})",S=`${g} ${b}`,E=`${h} ${b}`;return o(S,E,v,{itemsCount:v.toString(),itemSize:p(l),filesStr:d,foldersStr:m,spacesStr:w})})}},Wf=()=>{const{getMatchingSpace:e}=fn(),t=Qe(),n=j({get(){return t.selectedResources},set(s){t.setSelection(s.map(({id:a})=>a))}}),r=j({get(){return t.selectedIds},set(s){t.setSelection(s)}}),o=s=>p(r).includes(s.id),i=j(()=>{if(p(n).length!==1)return null;const s=p(n)[0];return e(s)});return{selectedResources:n,selectedResourcesIds:r,isResourceInSelection:o,selectedResourceSpace:i}};function ix(e){const t=an(),n=Zr(),r=Xe(),o=Oe.useGettext(),i=j(()=>t.tusMaxChunkSize>0),s=()=>{const u={};return n.publicLinkPassword?u.Authorization="Basic "+wr.from(["public",n.publicLinkPassword].join(":")).toString("base64"):n.accessToken&&!n.publicLinkPassword&&(u.Authorization="Bearer "+n.accessToken),u["X-Request-ID"]=tn.v4(),u["Accept-Language"]=o.current,u["Initiator-ID"]=r.initiatorId,u},a=j(()=>{const u={onBeforeRequest:(l,f)=>new Promise(d=>{var w;const m=s();l.setHeader("Authorization",m.Authorization),l.setHeader("X-Request-ID",m["X-Request-ID"]),l.setHeader("Accept-Language",m["Accept-Language"]),l.setHeader("Initiator-ID",m["Initiator-ID"]),f!=null&&f.isRemote&&l.setHeader("x-oc-mtime",(((w=f==null?void 0:f.data)==null?void 0:w.lastModified)/1e3).toFixed(0)),d()}),chunkSize:t.tusMaxChunkSize||1/0,overridePatchMethod:t.tusHttpMethodOverride,uploadDataDuringCreation:t.tusExtension.includes("creation-with-upload")};return u.headers=l=>{var f;if(l.xhrUpload||l!=null&&l.isRemote)return{"x-oc-mtime":(((f=l==null?void 0:l.data)==null?void 0:f.lastModified)/1e3).toFixed(0),...s()}},u}),c=j(()=>({timeout:6e4,endpoint:"",headers:u=>{var l;return{"x-oc-mtime":(((l=u==null?void 0:u.data)==null?void 0:l.lastModified)/1e3).toFixed(0),...s()}}}));Et([a,c],()=>{if(p(i)){e.uppyService.useTus(p(a));return}e.uppyService.useXhr(p(c))},{immediate:!0})}const ox=$e({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{$gettext:t}=Oe.useGettext(),n=lt(),{options:r}=We.storeToRefs(n),o=j(()=>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=j(()=>({...{appearance:e.action.appearance||e.appearance,...e.action.isDisabled&&{disabled:e.action.isDisabled(e.actionOptions)},...e.action.id&&{id:e.action.id}},...p(o)==="router-link"&&{to:e.action.route(e.actionOptions)},...p(o)==="a"&&{href:e.action.href(e.actionOptions)},...["router-link","a"].includes(p(o))&&{target:r.value.cernFeatures?"_blank":"_self"}})),s=j(()=>t("Hold %{key} and click to open in new tab",{key:_o()?"⌘":t("ctrl")},!0));return{componentType:o,componentProps:i,openInNewTabHint:s}},computed:{hasExternalImageIcon(){return this.action.icon&&/^https?:\/\//i.test(this.action.icon)},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}}}}),sx={key:3,class:"oc-files-context-action-label oc-flex","data-testid":"action-label"},ax=["textContent"],lx=["textContent"],cx=["textContent"];function ux(e,t,n,r,o,i){var l,f,d,m;const s=ye("oc-image"),a=ye("oc-icon"),c=ye("oc-button"),u=cn("oc-tooltip");return it((J(),ge("li",null,[it((J(),Ie(c,Kt({type:e.componentType},e.componentProps,{class:[e.action.class,"action-menu-item","oc-py-s","oc-px-m","oc-width-1-1",...e.buttonClasses],"aria-label":e.componentProps.disabled?(f=(l=e.action).disabledTooltip)==null?void 0:f.call(l,e.actionOptions):"","data-testid":"action-handler",size:e.size,"justify-content":"left"},Ha(e.componentListeners)),{default:Ee(()=>[e.action.img?(J(),Ie(s,{key:0,"data-testid":"action-img",src:e.action.img,alt:"",class:"oc-icon oc-icon-m"},null,8,["src"])):e.hasExternalImageIcon?(J(),Ie(s,{key:1,"data-testid":"action-img",src:e.action.icon,alt:"",class:"oc-icon oc-icon-m"},null,8,["src"])):e.action.icon?(J(),Ie(a,{key:2,"data-testid":"action-icon",name:e.action.icon,"fill-type":e.action.iconFillType||"line",size:e.size},null,8,["name","fill-type","size"])):Pe("",!0),e.action.hideLabel?Pe("",!0):(J(),ge("span",sx,[pe("span",{textContent:W.toDisplayString(e.action.label(e.actionOptions))},null,8,ax),e.action.showOpenInNewTabHint?(J(),ge("span",{key:0,class:"oc-text-muted oc-text-xsmall",textContent:W.toDisplayString(e.openInNewTabHint)},null,8,lx)):Pe("",!0)])),e.action.shortcut&&e.shortcutHint?(J(),ge("span",{key:4,class:"oc-files-context-action-shortcut",textContent:W.toDisplayString(e.action.shortcut)},null,8,cx)):Pe("",!0)]),_:1},16,["type","class","aria-label","size"])),[[u,e.showTooltip||e.action.hideLabel?e.action.label(e.actionOptions):""]])])),[[u,e.componentProps.disabled?(m=(d=e.action).disabledTooltip)==null?void 0:m.call(d,e.actionOptions):""]])}const Hf=Ue(ox,[["render",ux]]),fx=$e({name:"BatchActions",components:{ActionMenuItem:Hf},props:{actions:{type:Array,required:!0},actionOptions:{type:Object,required:!0},limitedScreenSpace:{type:Boolean,default:!1,required:!1}}});function dx(e,t,n,r,o,i){const s=ye("action-menu-item"),a=ye("oc-list");return J(),ge("div",null,[me(a,{id:"oc-appbar-batch-actions",class:W.normalizeClass({"oc-appbar-batch-actions-squashed":e.limitedScreenSpace})},{default:Ee(()=>[(J(!0),ge(Ge,null,xt(e.actions,(c,u)=>(J(),Ie(s,{key:`action-${u}`,action:c,"action-options":e.actionOptions,appearance:"raw",class:"batch-actions oc-mr-s","shortcut-hint":!1,"show-tooltip":e.limitedScreenSpace},null,8,["action","action-options","show-tooltip"]))),128))]),_:1},8,["class"])])}const Yv=Ue(fx,[["render",dx]]),px=$e({name:"ContextActionMenu",components:{ActionMenuItem:Hf},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("oc-pb-s"),e>0&&t.push("oc-pt-s"),e<this.menuSections.length-1&&t.push("oc-files-context-actions-border")),t}}}),hx={id:"oc-files-context-menu"};function gx(e,t,n,r,o,i){const s=ye("action-menu-item"),a=ye("oc-list");return J(),ge("div",hx,[(J(!0),ge(Ge,null,xt(e.menuSections,(c,u)=>(J(),Ie(a,{id:`oc-files-context-actions-${c.name}`,key:`section-${c.name}-list`,class:W.normalizeClass(["oc-files-context-actions",e.getSectionClasses(u)])},{default:Ee(()=>[(J(!0),ge(Ge,null,xt(c.items,(l,f)=>(J(),Ie(s,{key:`section-${c.name}-action-${f}`,action:l,appearance:e.appearance,"action-options":e.actionOptions,class:"context-menu oc-files-context-action oc-px-s oc-rounded oc-menu-item-hover"},null,8,["action","appearance","action-options"]))),128))]),_:2},1032,["id","class"]))),128))])}const Gf=Ue(px,[["render",gx]]),mx=$e({name:"ContextActions",components:{ContextActionMenu:Gf},props:{actionOptions:{type:Object,required:!0}},setup(e){const{editorActions:t}=Kn(),{actions:n}=na(),{actions:r}=ra(),{actions:o}=ia(),{actions:i}=If(),{actions:s}=oa(),{actions:a}=Fo(),{actions:c}=sa(),{actions:u}=Oo(),{actions:l}=Pf(),{actions:f}=Cf(),{actions:d}=aa(),{actions:m}=Ff(),{actions:w}=vv(),{actions:v}=la(),{actions:T}=ca(),{actions:y}=wv(),{actions:g}=kf(),{actions:h}=Nf(),{actions:b}=xf(),S=Bi(),E=j(()=>S.requestExtensions({id:"global.files.context-actions",extensionType:"action"}).map(ee=>ee.action)),I=j(()=>S.requestExtensions({id:"global.files.batch-actions",extensionType:"action"}).map(ee=>ee.action)),R=Pw(e,"actionOptions"),A=j(()=>[...p(n),...p(s),...p(c),...p(d),...p(o),...p(f),...p(a),...p(T),...p(h),...p(I).filter(ee=>ee.category==="actions"||_t.isNil(ee.category))].filter(ee=>ee.isVisible(p(R)))),N=j(()=>[...p(g),...p(I).filter(ee=>ee.category==="sidebar")].filter(ee=>ee.isVisible(p(R)))),L=j(()=>[...p(t),...p(E).filter(ee=>ee.category==="context")].filter(ee=>ee.isVisible(p(R))).sort((ee,se)=>Number(se.hasPriority)-Number(ee.hasPriority))),x=j(()=>[...p(b),...p(i),...p(E).filter(ee=>ee.category==="share")].filter(ee=>ee.isVisible(p(R)))),$=j(()=>[...p(c),...p(u),...p(a),...p(d),...p(o),...p(w),...p(v),...p(h),...p(T),...p(n),...p(s),...p(r),...p(y),...p(E).filter(ee=>ee.category==="actions"||_t.isNil(ee.category))].filter(ee=>ee.isVisible(p(R)))),V=j(()=>[...p(l).map(ee=>(ee.keepOpen=!0,ee)),...p(m),...p(g),...p(E).filter(ee=>ee.category==="sidebar")].filter(ee=>ee.isVisible(p(R))));return{menuSections:j(()=>{const ee=[];return p(R).resources.length>1?(p(A).length&&ee.push({name:"batch-actions",items:[...p(A)]}),ee.push({name:"batch-details",items:[...p(N)]}),ee):(p(L).length&&ee.push({name:"context",items:p(L)}),p(x).length&&ee.push({name:"share",items:p(x)}),p($).length&&ee.push({name:"actions",items:p($)}),p(V).length&&ee.push({name:"sidebar",items:p(V)}),ee)})}}});function yx(e,t,n,r,o,i){const s=ye("context-action-menu");return J(),Ie(s,{"menu-sections":e.menuSections,"action-options":e.actionOptions},null,8,["menu-sections","action-options"])}const Jv=Ue(mx,[["render",yx]]),bx=$e({props:{hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},paginationOptions:{type:Array,default:()=>Ir.options},perPageQueryName:{type:String,default:()=>Ir.perPageQueryName},perPageDefault:{type:String,default:()=>Ir.perPageDefault},perPageStoragePrefix:{type:String,required:!0},viewModeDefault:{type:String,required:!1,default:()=>Zt.defaultModeName},viewModes:{type:Array,default:()=>[]}},setup(e){const t=qe(),n=Qt(),{$gettext:r}=Oe.useGettext(),o=Qe(),{setAreHiddenFilesShown:i,setAreFileExtensionsShown:s,setAreDisabledSpacesShown:a}=o,{areHiddenFilesShown:c,areFileExtensionsShown:u,areDisabledSpacesShown:l}=We.storeToRefs(o),f=le(!1),d=ln("page"),m=j(()=>p(d)?parseInt(At(p(d))):1),w=Tr({name:e.perPageQueryName,defaultValue:e.perPageDefault,storagePrefix:e.perPageStoragePrefix}),v=Ys(),T=Tr({name:`${p(v)}-${Zt.queryName}`,defaultValue:e.viewModeDefault}),y=Tr({name:Zt.tilesSizeQueryName,defaultValue:Zt.tilesSizeDefault.toString()}),g=S=>t.replace({query:{...p(n).query,[e.perPageQueryName]:S,...p(m)>1&&{page:"1"}}}),h=S=>{T.value=S.name};Et([w,T,y],S=>{f.value=S.some(E=>!E)},{immediate:!0,deep:!0});const b=Vf();return{FolderViewModeConstants:Zt,viewModeCurrent:T,viewSizeCurrent:y,viewSizeMax:b,itemsPerPageCurrent:w,queryParamsLoading:f,queryItemAsString:At,setItemsPerPage:g,setViewMode:h,areHiddenFilesShown:c,areFileExtensionsShown:u,areDisabledSpacesShown:l,setAreHiddenFilesShown:i,setAreFileExtensionsShown:s,setAreDisabledSpacesShown:a,viewOptionsButtonLabel:r("Display customization options of the files list"),isProjectsLocation:Ar(dt,"files-spaces-projects")}},computed:{hiddenFilesShownModel:{get(){return this.areHiddenFilesShown},set(e){this.setAreHiddenFilesShown(e)}},fileExtensionsShownModel:{get(){return this.areFileExtensionsShown},set(e){this.setAreFileExtensionsShown(e)}},disabledSpacesShownModel:{get(){return this.areDisabledSpacesShown},set(e){this.setAreDisabledSpacesShown(e)}}},methods:{updateHiddenFilesShownModel(e){this.hiddenFilesShownModel=e},updateFileExtensionsShownModel(e){this.fileExtensionsShownModel=e},updateDisabledSpacesShownModel(e){this.disabledSpacesShownModel=e}}}),vx={class:"oc-flex oc-flex-middle"},wx={key:0,class:"viewmode-switch-buttons oc-button-group oc-visible@s oc-mr-s"},Sx={key:0,class:"files-view-options-list-item"},Ex={key:1,class:"files-view-options-list-item"},Tx={key:2,class:"files-view-options-list-item"},Ax={key:3,class:"files-view-options-list-item"},Rx={key:4,class:"files-view-options-list-item oc-flex oc-flex-between oc-flex-middle"},_x=["textContent"],Ix=["max"];function Cx(e,t,n,r,o,i){const s=ye("oc-icon"),a=ye("oc-button"),c=ye("oc-switch"),u=ye("oc-page-size"),l=ye("oc-list"),f=ye("oc-drop"),d=cn("oc-tooltip");return J(),ge("div",vx,[e.viewModes.length>1?(J(),ge("div",wx,[(J(!0),ge(Ge,null,xt(e.viewModes,m=>it((J(),Ie(a,{key:m.name,"no-hover":e.viewModeCurrent===m.name,class:W.normalizeClass([m.name]),appearance:e.viewModeCurrent===m.name?"filled":"outline","color-role":e.viewModeCurrent===m.name?"secondaryContainer":"secondary","aria-label":e.$gettext(m.label),onClick:w=>e.setViewMode(m)},{default:Ee(()=>[me(s,{name:m.icon.name,"fill-type":m.icon.fillType,size:"small"},null,8,["name","fill-type"])]),_:2},1032,["no-hover","class","appearance","color-role","aria-label","onClick"])),[[d,e.$gettext(m.label)]])),128))])):Pe("",!0),it((J(),Ie(a,{id:"files-view-options-btn",key:"files-view-options-btn","data-testid":"files-view-options-btn","aria-label":e.viewOptionsButtonLabel,appearance:"raw",class:"oc-my-s oc-p-xs"},{default:Ee(()=>[me(s,{name:"settings-3","fill-type":"line"})]),_:1},8,["aria-label"])),[[d,e.viewOptionsButtonLabel]]),me(f,{"drop-id":"files-view-options-drop",toggle:"#files-view-options-btn",mode:"click",class:"oc-width-auto","padding-size":"medium"},{default:Ee(()=>[me(l,null,{default:Ee(()=>[e.hasHiddenFiles?(J(),ge("li",Sx,[me(c,{checked:e.hiddenFilesShownModel,"onUpdate:checked":[t[0]||(t[0]=m=>e.hiddenFilesShownModel=m),e.updateHiddenFilesShownModel],"data-testid":"files-switch-hidden-files",label:e.$gettext("Show hidden files")},null,8,["checked","label","onUpdate:checked"])])):Pe("",!0),e.hasFileExtensions?(J(),ge("li",Ex,[me(c,{checked:e.fileExtensionsShownModel,"onUpdate:checked":[t[1]||(t[1]=m=>e.fileExtensionsShownModel=m),e.updateFileExtensionsShownModel],"data-testid":"files-switch-files-extensions-files",label:e.$gettext("Show file extensions")},null,8,["checked","label","onUpdate:checked"])])):Pe("",!0),e.hasPagination?(J(),ge("li",Tx,[e.queryParamsLoading?Pe("",!0):(J(),Ie(u,{key:0,selected:e.queryItemAsString(e.itemsPerPageCurrent),"data-testid":"files-pagination-size",label:e.$gettext("Items per page"),options:e.paginationOptions,class:"files-pagination-size",onChange:e.setItemsPerPage},null,8,["selected","label","options","onChange"]))])):Pe("",!0),e.isProjectsLocation?(J(),ge("li",Ax,[me(c,{checked:e.disabledSpacesShownModel,"onUpdate:checked":[t[2]||(t[2]=m=>e.disabledSpacesShownModel=m),e.updateDisabledSpacesShownModel],"data-testid":"files-switch-projects-show-disabled",label:e.$gettext("Show disabled Spaces")},null,8,["checked","label","onUpdate:checked"])])):Pe("",!0),e.viewModeCurrent===e.FolderViewModeConstants.name.tiles?(J(),ge("li",Rx,[pe("label",{for:"tiles-size-slider",textContent:W.toDisplayString(e.$gettext("Tile size"))},null,8,_x),it(pe("input",{id:"tiles-size-slider","onUpdate:modelValue":t[3]||(t[3]=m=>e.viewSizeCurrent=m),type:"range",min:1,max:e.viewSizeMax,class:"oc-range","data-testid":"files-tiles-size-slider"},null,8,Ix),[[DS,e.viewSizeCurrent]])])):Pe("",!0)]),_:1})]),_:1})])}const Zv=Ue(bx,[["render",Cx],["__scopeId","data-v-cc70f12f"]]),Px=$e({name:"AppBar",components:{BatchActions:Yv,ContextActions:Jv,ViewOptions:Zv},props:{viewModeDefault:{type:String,required:!1,default:()=>Zt.name.table},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},space:{type:Object,required:!1,default:null}},setup(e,{emit:t}){const n=ct(),{$gettext:r}=Oe.useGettext(),{can:o}=yn(),i=qe(),{requestExtensions:s}=Bi(),{isSticky:a}=Bf(),c=Qe(),{selectedResources:u}=We.storeToRefs(c),l=j(()=>e.space),{actions:f}=na(),{actions:d}=ra(),{actions:m}=ia(),{actions:w}=Dv(),{actions:v}=oa(),{actions:T}=Fo(),{actions:y}=sa(),{actions:g}=Oo(),{actions:h}=Cf(),{actions:b}=aa(),{actions:S}=ca(),{actions:E}=Nv(),{actions:I}=$v(),{actions:R}=Bv(),{actions:A}=qv(),N=le(0),L=Ar(It,"files-common-search"),x=j(()=>Object.hasOwn(uS(),"navigation")&&o("create-all","Share")),$=j(()=>{let oe=[...p(d),...p(f),...p(v),...p(y),...p(g),...p(b),...p(m),...p(h),...p(T),...p(S)];L.value||(oe=[...oe,...p(w),...p(R),...p(A),...p(E),...p(I)]);const ce=s({id:"global.files.batch-actions",extensionType:"action"});return ce.length&&(oe=[...oe,...ce.map(Ce=>Ce.action)]),oe.filter(Ce=>Ce.isVisible({space:p(l),resources:c.selectedResources}))}),V=j(()=>n.spaces.filter(oe=>te.isPersonalSpaceResource(oe)||te.isProjectSpaceResource(oe))),X=gr("isMobileWidth"),ee=Ar(Pn,"files-trash-generic"),se=j(()=>!p(X)&&e.breadcrumbs.length?!0:p(ee)&&p(V).length===1?!1:e.breadcrumbs.length>1),ie=j(()=>p(ee)&&p(V).length===1?e.breadcrumbs.length<=2:e.breadcrumbs.length<=1),re=j(()=>p(l)&&(te.isProjectSpaceResource(p(l))||te.isShareSpaceResource(p(l)))?3:2),fe=oe=>{t(Ob,oe)},ue=nv("title"),Z=j(()=>{var oe;return p(ue)?r(p(ue)):((oe=p(l))==null?void 0:oe.name)||""});return{router:i,hasSharesNavigation:x,batchActions:$,showBreadcrumb:se,showMobileNav:ie,breadcrumbMaxWidth:N,breadcrumbTruncationOffset:re,fileDroppedBreadcrumb:fe,pageTitle:Z,selectedResources:u,isSticky:a}},data:function(){return{resizeObserver:new ResizeObserver(this.onResize),limitedScreenSpace:!1}},computed:{showContextActions(){return sd(this.breadcrumbs).allowContextActions},showBatchActions(){return this.hasBulkActions&&(this.selectedResources.length>=1||Pn(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(){var o,i,s,a;const e=((o=document.getElementById("web-content-main"))==null?void 0:o.getBoundingClientRect().width)||0,t=((i=document.getElementById("web-nav-sidebar"))==null?void 0:i.getBoundingClientRect().width)||0,n=((s=document.getElementById("app-sidebar"))==null?void 0:s.getBoundingClientRect().width)||0,r=(a=document.getElementById("files-app-bar-controls-right"))==null?void 0:a.clientWidth;this.breadcrumbMaxWidth=e-t-n-r,this.limitedScreenSpace=this.isSideBarOpen?window.innerWidth<=1280:window.innerWidth<=1e3}}}),Fx={class:"files-topbar oc-py-s"},Ox=["textContent"],kx={key:3,id:"files-app-bar-controls-right",class:"oc-flex"},xx={class:"files-app-bar-actions oc-mt-xs"},Nx={class:"oc-flex-1 oc-flex oc-flex-start oc-flex-middle"};function $x(e,t,n,r,o,i){const s=ye("oc-hidden-announcer"),a=ye("context-actions"),c=ye("oc-breadcrumb"),u=ye("portal-target"),l=ye("view-options"),f=ye("batch-actions");return J(),ge("div",{id:"files-app-bar",ref:"filesAppBar",class:W.normalizeClass({"files-app-bar-squashed":e.isSideBarOpen,"files-app-bar-sticky":e.isSticky})},[pe("div",Fx,[pe("h1",{class:"oc-invisible-sr",textContent:W.toDisplayString(e.pageTitle)},null,8,Ox),me(s,{announcement:e.selectedResourcesAnnouncement,level:"polite"},null,8,["announcement"]),pe("div",{class:W.normalizeClass(["oc-flex oc-flex-middle files-app-bar-controls",{"oc-flex-between":e.breadcrumbs.length||e.hasSharesNavigation,"oc-flex-right":!e.breadcrumbs.length&&!e.hasSharesNavigation}])},[e.showBreadcrumb?(J(),Ie(c,{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,onItemDroppedBreadcrumb:e.fileDroppedBreadcrumb},{contextMenu:Ee(()=>[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","onItemDroppedBreadcrumb"])):Pe("",!0),e.showMobileNav?(J(),Ie(u,{key:1,name:"app.runtime.mobile.nav"})):Pe("",!0),e.hasSharesNavigation?He(e.$slots,"navigation",{key:2},void 0,!0):Pe("",!0),e.hasViewOptions?(J(),ge("div",kx,[me(l,{"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"])])):Pe("",!0)],2),pe("div",xx,[pe("div",Nx,[He(e.$slots,"actions",{limitedScreenSpace:e.limitedScreenSpace},void 0,!0),e.showBatchActions?(J(),Ie(f,{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"])):Pe("",!0)])]),He(e.$slots,"content",{},void 0,!0)])],2)}const Dx=Ue(Px,[["render",$x],["__scopeId","data-v-a47af7f5"]]),Lx=$e({name:"CreateSpace",props:{showLabel:{type:Boolean,default:!0}},emits:["spaceCreated"],setup(e,{emit:t}){const{showMessage:n,showErrorMessage:r}=rt(),{$gettext:o}=Oe.useGettext(),{createSpace:i}=Ui(),{checkSpaceNameModalInput:s}=li(),{dispatchModal:a}=wt(),c=ct(),{upsertResource:u}=Qe(),l=async d=>{try{const m=await i(d);u(m),c.upsertSpace(m),t("spaceCreated",m),n({title:o("Space was created successfully")})}catch(m){console.error(m),r({title:o("Creating space failed…"),errors:[m]})}};return{showCreateSpaceModal:()=>{a({title:o("Create a new space"),confirmText:o("Create"),hasInput:!0,inputLabel:o("Space name"),inputValue:o("New space"),onConfirm:d=>l(d),onInput:s})}}}}),Mx=["textContent"];function Bx(e,t,n,r,o,i){const s=ye("oc-icon"),a=ye("oc-button"),c=cn("oc-tooltip");return it((J(),Ie(a,{id:"new-space-menu-btn","aria-label":e.showLabel?void 0:e.$gettext("New space"),appearance:"filled",onClick:e.showCreateSpaceModal},{default:Ee(()=>[me(s,{name:"add"}),e.showLabel?(J(),ge("span",{key:0,textContent:W.toDisplayString(e.$gettext("New Space"))},null,8,Mx)):Pe("",!0)]),_:1},8,["aria-label","onClick"])),[[c,e.showLabel?void 0:e.$gettext("New space")]])}const jx=Ue(Lx,[["render",Bx]]),Ux=$e({name:"AppTopBar",components:{ContextActionMenu:Gf,ResourceListItem:xo},props:{dropDownMenuSections:{type:Array,default:()=>[]},dropDownActionOptions:{type:Object,default:()=>({space:null,resources:[]})},mainActions:{type:Array,default:()=>[]},hasAutoSave:{type:Boolean,default:!0},isEditor:{type:Boolean,default:!1},resource:{type:Object,default:null}},emits:["close"],setup(e){const{$gettext:t,current:n}=Oe.useGettext(),r=Qe(),o=lt(),{getMatchingSpace:i}=fn(),s=j(()=>r.areFileExtensionsShown),a=j(()=>t("Show context menu")),c=j(()=>e.isEditor&&e.hasAutoSave&&o.options.editor.autosaveEnabled),u=j(()=>{const d=jt.Duration.fromObject({seconds:o.options.editor.autosaveInterval},{locale:n});return t("Autosave (every %{ duration })",{duration:d.toHuman()})}),l=j(()=>i(e.resource)),f=j(()=>!te.isPublicSpaceResource(p(l)));return{contextMenuLabel:a,areFileExtensionsShown:s,hasAutosave:c,autoSaveTooltipText:u,isPathDisplayed:f,...ci()}}}),qx={class:"oc-app-top-bar oc-flex"},Vx={class:"oc-app-top-bar-inner oc-pl-m oc-pr-xs oc-flex oc-flex-middle oc-flex-between"},zx={class:"open-file-bar oc-flex"},Wx={class:"oc-flex main-actions"},Hx={key:1,class:"oc-flex oc-flex-middle"};function Gx(e,t,n,r,o,i){const s=ye("resource-list-item"),a=ye("oc-icon"),c=ye("oc-button"),u=ye("context-action-menu"),l=ye("oc-drop"),f=ye("portal"),d=cn("oc-tooltip");return J(),Ie(f,{to:"app.runtime.header.left"},{default:Ee(()=>[pe("div",qx,[pe("span",Vx,[pe("div",zx,[e.resource?(J(),Ie(s,{key:0,id:"app-top-bar-resource","is-thumbnail-displayed":!1,"is-extension-displayed":e.areFileExtensionsShown,"path-prefix":e.getPathPrefix(e.resource),resource:e.resource,"parent-folder-name":e.getParentFolderName(e.resource),"parent-folder-link-icon-additional-attributes":e.getParentFolderLinkIconAdditionalAttributes(e.resource),"is-path-displayed":e.isPathDisplayed,"is-resource-clickable":!1},null,8,["is-extension-displayed","path-prefix","resource","parent-folder-name","parent-folder-link-icon-additional-attributes","is-path-displayed"])):Pe("",!0)]),pe("div",Wx,[e.dropDownMenuSections.length?(J(),ge(Ge,{key:0},[it((J(),Ie(c,{id:"oc-openfile-contextmenu-trigger","aria-label":e.contextMenuLabel,appearance:"raw-inverse","color-role":"chrome",class:"oc-p-xs"},{default:Ee(()=>[me(a,{name:"more-2"})]),_:1},8,["aria-label"])),[[d,e.contextMenuLabel]]),me(l,{"drop-id":"oc-openfile-contextmenu",mode:"click","padding-size":"small",toggle:"#oc-openfile-contextmenu-trigger","close-on-click":"",onClick:t[0]||(t[0]=In(()=>{},["stop","prevent"]))},{default:Ee(()=>[me(u,{"menu-sections":e.dropDownMenuSections,"action-options":e.dropDownActionOptions},null,8,["menu-sections","action-options"])]),_:1})],64)):Pe("",!0),e.hasAutosave?(J(),ge("span",Hx,[it(me(a,{"accessible-label":e.autoSaveTooltipText,name:"refresh",color:"white",class:"ox-p-xs oc-mx-xs"},null,8,["accessible-label"]),[[d,e.autoSaveTooltipText]])])):Pe("",!0),e.mainActions.length&&e.resource?(J(),Ie(u,{key:2,"menu-sections":[{name:"main-actions",items:e.mainActions.filter(m=>m.isVisible()).map(m=>({...m,class:"oc-p-xs app-topbar-action",hideLabel:!0}))}],"action-options":{resources:[e.resource]},appearance:"raw-inverse","color-role":"chrome"},null,8,["menu-sections","action-options"])):Pe("",!0),me(c,{id:"app-top-bar-close",appearance:"raw-inverse","color-role":"chrome",class:"oc-p-xs","aria-label":e.$gettext("Close"),onClick:t[1]||(t[1]=m=>e.$emit("close"))},{default:Ee(()=>[me(a,{name:"close"})]),_:1},8,["aria-label"])])])])]),_:1})}const e0=Ue(Ux,[["render",Gx]]),Kx=$e({name:"ErrorScreen",props:{message:{default:"",type:String,required:!1}}}),Qx={class:"oc-text-center oc-flex oc-flex-center oc-flex-middle oc-height-1-1"},Xx={key:0,class:"oc-text-xlarge"};function Yx(e,t,n,r,o,i){const s=ye("oc-icon");return J(),ge("div",Qx,[me(s,{size:"xxlarge",name:"error-warning","fill-type":"line"}),e.message?(J(),ge("p",Xx,W.toDisplayString(e.message),1)):Pe("",!0)])}const Jx=Ue(Kx,[["render",Yx]]),Zx=$e({name:"LoadingScreen"}),eN={class:"oc-text-center oc-flex oc-flex-center oc-flex-middle oc-height-1-1"},tN={class:"oc-invisible"};function nN(e,t,n,r,o,i){const s=ye("oc-spinner"),a=cn("translate");return J(),ge("div",eN,[me(s,{size:"xlarge"}),it((J(),ge("p",tN,t[0]||(t[0]=[Gt("Loading app")]))),[[a]])])}const rN=Ue(Zx,[["render",nN]]),iN=["id","data-testid","tabindex","inert"],oN={key:0,class:"sidebar-panel__header header"},sN={class:"header__title oc-my-rm"},aN={key:0,class:"sidebar-panel__navigation oc-mt-m"},t0=$e({__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(),o=Hd("appSideBar"),i=j(()=>e.availablePanels.filter(A=>{var N;return A.isVisible(e.panelContext)&&((N=A.isRoot)==null?void 0:N.call(A,e.panelContext))})),s=j(()=>e.availablePanels.filter(A=>{var N;return A.isVisible(e.panelContext)&&!((N=A.isRoot)!=null&&N.call(A,e.panelContext))})),a=j(()=>p(i).length?[p(i)[0],...p(s)]:p(s)),c=j(()=>{var N;const A=(N=e.activePanel)==null?void 0:N.split("#")[0];return!A||!p(s).map(L=>L.name).includes(A)?null:A}),u=j(()=>p(c)!==null),l=j(()=>p(c)===null),f=le(null),d=A=>{f.value=A},m=j(()=>p(u)?p(c):p(i)[0].name),w=j(()=>p(i).length===1?r("Back to %{panel} panel",{panel:p(i)[0].title(e.panelContext)}):r("Back to main panels")),v=le(window.innerWidth),T=j(()=>p(v)<=580),y=j(()=>{var A,N;return(N=(A=p(o))==null?void 0:A.parentElement)==null?void 0:N.querySelector("div")}),g=()=>{if(!p(y))return;const A=p(T)?"hidden":"visible";p(y).style.visibility=A},h=()=>{e.isOpen&&(v.value=window.innerWidth,g())};Et(()=>e.isOpen,async A=>{A&&(await zn(),g())},{immediate:!0});const b=A=>{n("selectPanel",A)},S=()=>{n("selectPanel",null)},E=()=>{n("close")},I=A=>{d(p(m)),b(A)},R=()=>{d(p(m)),S(),p(o).focus()};return qt(()=>{window.addEventListener("resize",h)}),Wn(()=>{window.removeEventListener("resize",h),p(y)&&(p(y).style.visibility="visible")}),(A,N)=>{const L=ye("oc-spinner"),x=ye("oc-icon"),$=ye("oc-button"),V=cn("oc-tooltip");return J(),ge("div",{id:"app-sidebar",ref_key:"appSideBar",ref:o,"data-testid":"app-sidebar",tabindex:"-1",class:W.normalizeClass({"has-active-sub-panel":u.value,"oc-flex oc-flex-center oc-flex-middle":A.loading,"app-sidebar-full-width":T.value})},[A.loading?(J(),Ie(L,{key:0})):(J(!0),ge(Ge,{key:1},xt(a.value,X=>{var ee,se,ie,re,fe,ue;return J(),ge("div",{id:`sidebar-panel-${X.name}`,key:`panel-${X.name}`,"data-testid":`sidebar-panel-${X.name}`,tabindex:m.value===X.name?-1:null,class:W.normalizeClass(["sidebar-panel",{"is-root-panel":(ee=X.isRoot)==null?void 0:ee.call(X,A.panelContext),"is-active-sub-panel":u.value&&c.value===X.name,"is-active-root-panel":l.value&&((se=X.isRoot)==null?void 0:se.call(X,A.panelContext))}]),inert:m.value!==X.name},[[m.value,f.value].includes(X.name)?(J(),ge("div",oN,[(ie=X.isRoot)!=null&&ie.call(X,A.panelContext)?Pe("",!0):it((J(),Ie($,{key:0,class:"header__back oc-p-xs",appearance:"raw","aria-label":w.value,onClick:R},{default:Ee(()=>[me(x,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"])),[[V,w.value]]),pe("h2",sN,W.toDisplayString(X.title(A.panelContext)),1),me($,{appearance:"raw",class:"header__close oc-p-xs","aria-label":p(r)("Close file sidebar"),onClick:E},{default:Ee(()=>[me(x,{name:"close"})]),_:1},8,["aria-label"])])):Pe("",!0),pe("div",null,[(re=X.isRoot)!=null&&re.call(X,A.panelContext)?He(A.$slots,"rootHeader",{key:0}):He(A.$slots,"subHeader",{key:1})]),pe("div",{class:W.normalizeClass(["sidebar-panel__body",[`sidebar-panel__body-${X.name}`]])},[pe("div",{class:W.normalizeClass(["sidebar-panel__body-content",{"sidebar-panel__body-content-stretch":!((fe=X.isRoot)!=null&&fe.call(X,A.panelContext))}])},[He(A.$slots,"body",{},()=>{var Z;return[(J(!0),ge(Ge,null,xt((Z=X.isRoot)!=null&&Z.call(X,A.panelContext)?i.value:[X],(oe,ce)=>{var Ce;return J(),ge("div",{key:`sidebar-panel-${oe.name}`},[[m.value,f.value].includes(oe.name)?(J(),Ie(kr(oe.component),Kt({key:0,class:{"multi-root-panel-separator oc-mt oc-pt-s":ce>0},ref_for:!0},((Ce=oe.componentAttrs)==null?void 0:Ce.call(oe,A.panelContext))||{}),null,16,["class"])):Pe("",!0)])}),128))]})],2),(ue=X.isRoot)!=null&&ue.call(X,A.panelContext)&&s.value.length>0?(J(),ge("div",aN,[(J(!0),ge(Ge,null,xt(s.value,Z=>(J(),Ie($,{id:`sidebar-panel-${Z.name}-select`,key:`panel-select-${Z.name}`,"data-testid":`sidebar-panel-${Z.name}-select`,appearance:"raw-inverse","color-role":"surface",onClick:oe=>I(Z.name)},{default:Ee(()=>[me(x,{name:Z.icon,"fill-type":Z.iconFillType},null,8,["name","fill-type"]),Gt(" "+W.toDisplayString(Z.title(A.panelContext))+" ",1),me(x,{name:"arrow-right-s","fill-type":"line"})]),_:2},1032,["id","data-testid","onClick"]))),128))])):Pe("",!0)],2)],10,iN)}),128))],2)}}}),lN=$e({name:"SpaceInfo",setup(){return{resource:gr("resource")}}}),cN={class:"space_info oc-p-s"},uN={class:"space_info__body oc-text-overflow oc-flex oc-flex-middle"},fN={class:"oc-mr-s"},dN=["textContent"],pN=["textContent"];function hN(e,t,n,r,o,i){const s=ye("oc-icon");return J(),ge("div",cN,[pe("div",uN,[pe("div",fN,[me(s,{name:"layout-grid",size:e.resource.description?"large":"medium",class:"oc-display-block"},null,8,["size"])]),pe("div",null,[pe("h3",{"data-testid":"space-info-name",class:"oc-font-semibold oc-m-rm",textContent:W.toDisplayString(e.resource.name)},null,8,dN),pe("span",{"data-testid":"space-info-subtitle",textContent:W.toDisplayString(e.resource.description)},null,8,pN)])])])}const n0=Ue(lN,[["render",hN]]),gN=$e({name:"FileInfo",components:{ResourceIcon:ko,ResourceName:Lf},props:{isSubPanelActive:{type:Boolean,default:!0}},setup(){const e=Qe(),t=gr("resource"),n=gr("space"),r=j(()=>e.areFileExtensionsShown),o=j(()=>te.isPersonalSpaceResource(p(n))&&p(t).path==="/"?p(n).name:p(t).name);return{resource:t,resourceName:o,areFileExtensionsShown:r}}}),mN={class:"file_info oc-flex oc-flex-between oc-p-s"},yN={class:"oc-flex oc-flex-middle"},bN={class:"file_info__body oc-text-overflow"},vN={"data-testid":"files-info-name",class:"oc-font-semibold"};function wN(e,t,n,r,o,i){const s=ye("resource-icon"),a=ye("resource-name");return J(),ge("div",mN,[pe("div",yN,[e.isSubPanelActive?(J(),Ie(s,{key:0,resource:e.resource,size:"large",class:"file_info__icon oc-mr-s oc-position-relative"},null,8,["resource"])):Pe("",!0),pe("div",bN,[pe("h3",vN,[me(a,{name:e.resourceName,extension:e.resource.extension,type:e.resource.type,"full-path":e.resource.webDavPath,"is-extension-displayed":e.areFileExtensionsShown,"is-path-displayed":!1,"truncate-name":!1},null,8,["name","extension","type","full-path","is-extension-displayed"])])])])])}const r0=Ue(gN,[["render",wN]]),SN=$e({name:"FileSideBar",components:{FileInfo:r0,SpaceInfo:n0,InnerSideBar:t0},props:{isOpen:{type:Boolean,required:!0},activePanel:{type:String,required:!1,default:null},space:{type:Object,required:!1,default:null}},setup(e){const t=qe(),n=Xe(),r=Bi(),o=ai(),i=ct(),s=zt(),a=lt(),c=ir(),{canListShares:u}=Sv(),{canListVersions:l}=Gv(),f=Qe(),{currentFolder:d}=We.storeToRefs(f),m=le(),w=le([]),v=le([]),T=le([]),{selectedResources:y}=Wf(),g=le(!1),h=j(()=>p(g)||ie.isRunning),b=j(()=>{var fe;return p(y).length===0?{root:e.space,parent:null,items:(fe=p(d))!=null&&fe.id?[p(d)]:[]}:{root:e.space,parent:p(d),items:p(y)}}),S=Ar(Mt,"files-shares-with-me"),E=Ar(Mt,"files-shares-with-others"),I=Ar(Mt,"files-shares-via-link"),R=dt(t,"files-spaces-projects"),A=Ar(It,"files-common-favorites"),N=Ar(It,"files-common-search"),L=()=>{o.publish(vt.close)},x=fe=>{o.publish(vt.setActivePanel,fe)},$=j(()=>{var fe;return((fe=p(b).items)==null?void 0:fe.length)===1&&!te.isProjectSpaceResource(p(b).items[0])}),V=j(()=>{var fe;return((fe=p(b).items)==null?void 0:fe.length)===1&&te.isProjectSpaceResource(p(b).items[0])}),X=j(()=>p(S)||p(E)||p(I)),ee=j(()=>p(X)||p(N)||p(A)),se=j(()=>r.requestExtensions({id:"global.files.sidebar",extensionType:"sidebarPanel"}).map(fe=>fe.panel)),ie=hn.useTask(function*(fe,ue){w.value=yield n.webdav.listFileVersions(ue.id,{signal:fe})}),re=hn.useTask(function*(fe,ue){var ke;s.setLoading(!0),s.removeOrphanedShares();const{collaboratorShares:Z,linkShares:oe}=s,ce=n.graphAuthenticated.permissions;let Ce=(ke=e.space)==null?void 0:ke.id;if(te.isShareSpaceResource(e==null?void 0:e.space)){const _e=yield i.getMountPointForSpace({graphClient:n.graphAuthenticated,space:e.space,signal:fe});_e&&(Ce=_e.root.remoteItem.rootId)}const{shares:H,allowedRoles:_}=yield*te.call(ce.listPermissions(Ce,ue.fileId,s.graphRoles,{},{signal:fe})),F=H.filter(te.isCollaboratorShare),G=H.filter(te.isLinkShare),z=Object.values(s.graphRoles);if(v.value=(_==null?void 0:_.map(_e=>{var Le;return{..._e,icon:(Le=z.find(Y=>Y.id===_e.id))==null?void 0:Le.icon}}))||[],c.isAppEnabled("open-cloud-mesh")){const{allowedRoles:_e}=yield*te.call(ce.listPermissions(Ce,ue.fileId,s.graphRoles,{filter:`@libre.graph.permissions.roles.allowedValues/rolePermissions/any(p:contains(p/condition, '@Subject.UserType=="Federated"'))`,select:[WO.LibreGraphPermissionsRolesAllowedValues]},{signal:fe}));T.value=(_e==null?void 0:_e.map(Le=>{var Y;return{...Le,icon:(Y=z.find(xe=>xe.id===Le.id))==null?void 0:Y.icon}}))||[]}!p(ee)&&!p(R)&&(Z.forEach(_e=>{F.some(Le=>Le.id===_e.id)||F.push({..._e,indirect:!0})}),oe.forEach(_e=>{G.some(Le=>Le.id===_e.id)||G.push({..._e,indirect:!0})})),It(t,"files-common-search")&&(yield f.loadAncestorMetaData({folder:p(ue),space:p(e.space),client:n.webdav,signal:fe}));const q=[...Z,...oe].map(({resourceId:_e})=>_e),de=Object.values(f.ancestorMetaData).filter(({id:_e,path:Le})=>_e===ue.id||q.includes(_e)||te.isIncomingShareResource(ue)?!1:te.isPersonalSpaceResource(e.space)?Le!=="/":!0).map(({id:_e})=>_e);p(ee)&&te.isProjectSpaceResource(e.space)&&!te.isProjectSpaceResource(ue)&&de.push(e.space.id);const Ae=new Ur({concurrency:a.options.concurrentRequests.shares.list}),De=[...new Set(de)].map(_e=>Ae.add(()=>n.graphAuthenticated.permissions.listPermissions(Ce,_e,s.graphRoles,{},{signal:fe}).then(Le=>{const Y=Le.shares.map(xe=>({...xe,indirect:!0}));F.push(...Y.filter(te.isCollaboratorShare)),G.push(...Y.filter(te.isLinkShare))})));yield Promise.allSettled(De),s.setCollaboratorShares(F),s.setLinkShares(G),s.setLoading(!1)}).restartable();return Et(()=>[...p(b).items,e.isOpen],async()=>{var ue;if(((ue=p(b).items)==null?void 0:ue.length)!==1)return;if(!e.isOpen){w.value=[];return}const fe=p(b).items[0];if(ie.isRunning&&ie.cancelAll(),!!l({space:e.space,resource:fe}))try{await ie.perform(fe)}catch(Z){console.error(Z)}},{immediate:!0,deep:!0}),Et(()=>[...p(b).items,e.isOpen],async()=>{var ue;if(!e.isOpen){s.pruneShares(),m.value=null;return}if(((ue=p(b).items)==null?void 0:ue.length)!==1)return;const fe=p(b).items[0];if(g.value=!0,u({space:e.space,resource:fe}))try{re.isRunning&&re.cancelAll(),re.perform(fe)}catch(Z){console.error(Z)}if(!p(X)){m.value=fe,g.value=!1;return}try{const Z=await n.webdav.getFileInfo(e.space,{path:fe.path}),oe={...Z,...fe,tags:Z.tags};m.value=oe}catch(Z){m.value=fe,console.error(Z)}g.value=!1},{deep:!0,immediate:!0}),Ei("resource",dr(m)),Ei("versions",dr(w)),Ei("space",j(()=>e.space)),Ei("activePanel",j(()=>e.activePanel)),Ei("availableInternalShareRoles",dr(v)),Ei("availableExternalShareRoles",dr(T)),{loadedResource:m,setActiveSideBarPanel:x,closeSideBar:L,panelContext:b,availablePanels:se,isFileHeaderVisible:$,isSpaceHeaderVisible:V,isLoading:h,loadSharesTask:re}}});function EN(e,t,n,r,o,i){const s=ye("file-info"),a=ye("space-info"),c=ye("InnerSideBar");return e.isOpen?(J(),Ie(c,Kt({key:0,ref:"sidebar",class:"files-side-bar","is-open":e.isOpen,"active-panel":e.activePanel,"available-panels":e.availablePanels,"panel-context":e.panelContext,loading:e.isLoading},e.$attrs,{"data-custom-key-bindings-disabled":"true",onSelectPanel:e.setActiveSideBarPanel,onClose:e.closeSideBar}),{rootHeader:Ee(()=>[e.isFileHeaderVisible?(J(),Ie(s,{key:0,class:"sidebar-panel__file_info","is-sub-panel-active":!1})):e.isSpaceHeaderVisible?(J(),Ie(a,{key:1,class:"sidebar-panel__space_info"})):Pe("",!0)]),subHeader:Ee(()=>[e.isFileHeaderVisible?(J(),Ie(s,{key:0,class:"sidebar-panel__file_info","is-sub-panel-active":!0})):e.isSpaceHeaderVisible?(J(),Ie(a,{key:1,class:"sidebar-panel__space_info"})):Pe("",!0)]),_:1},16,["is-open","active-panel","available-panels","panel-context","loading","onSelectPanel","onClose"])):Pe("",!0)}const i0=Ue(SN,[["render",EN]]),TN=$e({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=le(),t=le(!0);return{confirmDisabled:t,onDateChanged:({date:r,error:o})=>{t.value=o||!r,e.value=r},dateTime:e}}}),AN={class:"link-modal-actions oc-flex oc-flex-right oc-flex-middle oc-mt-s"};function RN(e,t,n,r,o,i){const s=ye("oc-datepicker"),a=ye("oc-button");return J(),ge(Ge,null,[me(s,{label:e.$gettext("Expiration date"),type:"date","min-date":e.minDate,"current-date":e.currentDate,"is-clearable":e.isClearable,onDateChanged:e.onDateChanged},null,8,["label","min-date","current-date","is-clearable","onDateChanged"]),pe("div",AN,[me(a,{class:"oc-modal-body-actions-cancel oc-ml-s",onClick:t[0]||(t[0]=c=>e.$emit("cancel"))},{default:Ee(()=>[Gt(W.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),me(a,{disabled:e.confirmDisabled,class:"oc-modal-body-actions-confirm oc-ml-s",appearance:"filled",onClick:t[1]||(t[1]=c=>e.$emit("confirm",e.dateTime))},{default:Ee(()=>[Gt(W.toDisplayString(e.$gettext("Confirm")),1)]),_:1},8,["disabled"])])],64)}const _N=Ue(TN,[["render",RN]]),IN=$e({name:"UnsavedChangesModal",props:{modal:{type:Object,required:!0},closeCallback:{type:Function,required:!0}},emits:["cancel","confirm"],setup(e){const{removeModal:t}=wt();return{onClose:()=>{t(e.modal.id),e.closeCallback()}}}}),CN=["textContent"],PN={class:"oc-flex oc-flex-right oc-flex-middle oc-mt-m"},FN={class:"oc-modal-body-actions-grid"};function ON(e,t,n,r,o,i){const s=ye("oc-button");return J(),ge(Ge,null,[pe("span",{class:"oc-display-inline-block oc-mb-m",textContent:W.toDisplayString(e.$gettext("Your changes were not saved. Do you want to save them?"))},null,8,CN),t[2]||(t[2]=pe("div",{class:"oc-my-m"},null,-1)),pe("div",PN,[pe("div",FN,[me(s,{class:"oc-modal-body-actions-cancel oc-ml-s",onClick:t[0]||(t[0]=a=>e.$emit("cancel"))},{default:Ee(()=>[Gt(W.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),me(s,{class:"oc-modal-body-actions-secondary oc-ml-s",onClick:e.onClose},{default:Ee(()=>[Gt(W.toDisplayString(e.$gettext("Don't Save")),1)]),_:1},8,["onClick"]),me(s,{class:"oc-modal-body-actions-confirm oc-ml-s",appearance:"filled",onClick:t[1]||(t[1]=a=>e.$emit("confirm"))},{default:Ee(()=>[Gt(W.toDisplayString(e.$gettext("Save")),1)]),_:1})])])],64)}const o0=Ue(IN,[["render",ON]]);var kN=/\s/;function xN(e){for(var t=e.length;t--&&kN.test(e.charAt(t)););return t}var NN=/^\s+/;function $N(e){return e&&e.slice(0,xN(e)+1).replace(NN,"")}var s0=NaN,DN=/^[-+]0x[0-9a-f]+$/i,LN=/^0b[01]+$/i,MN=/^0o[0-7]+$/i,BN=parseInt;function jN(e){if(typeof e=="number")return e;if(Ss(e))return s0;if(er(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=er(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=$N(e);var n=LN.test(e);return n||MN.test(e)?BN(e.slice(2),n?2:8):DN.test(e)?s0:+e}const UN=$e({name:"AppWrapper",components:{AppTopBar:e0,FileSideBar:i0,ErrorScreen:Jx,LoadingScreen:rN},props:{applicationId:{type:String,required:!0},urlForResourceOptions:{type:Object,default:()=>null,required:!1},fileContentOptions:{type:Object,default:()=>null,required:!1},wrappedComponent:{type:Object,default:null},importResourceWithExtension:{type:Function,default:()=>null},disableAutoSave:{type:Boolean,default:!1}},setup(e){const{$gettext:t,current:n}=Oe.useGettext(),r=ir(),{showMessage:o,showErrorMessage:i}=rt(),s=Bo.useRouter(),a=Qt(),c=Xe(),u=dn(),{getResourceContext:l}=Kv(),{selectedResources:f}=Wf(),{dispatchModal:d}=wt(),m=ct(),w=lt(),v=Qe(),T=zt(),y=ai(),{actions:g}=Ov({appId:e.applicationId}),{actions:h}=If(),{actions:b}=Oo(),{actions:S}=kf(),{actions:E}=xf(),{actions:I}=Fo(),R=j(()=>{var Ne;return!!((Ne=e.wrappedComponent.emits)!=null&&Ne.includes("update:resource"))}),A=le(),N=le(),L=le(""),x=le(""),$=le(!p(R)),V=le(),X=le(!1),ee=le(),se=le();let ie="",re=null;const{actions:fe}=xv({content:se}),ue=j(()=>{var Ne;return!!((Ne=e.wrappedComponent.emits)!=null&&Ne.includes("update:currentContent"))}),Z=Ne=>!!Object.keys(e.wrappedComponent.props).includes(Ne),oe=j(()=>p(se)!==p(ee)),ce=Ne=>{Ne.preventDefault()};Et(oe,Ne=>{Ne?window.addEventListener("beforeunload",ce):window.removeEventListener("beforeunload",ce)});const{applicationConfig:Ce,closeApp:H,currentFileContext:_,getFileContents:F,getFileInfo:G,getUrlForResource:z,putFileContents:M,replaceInvalidFileRoute:q,revokeUrl:de,activeFiles:Ae,loadFolderForFileContext:De,isFolderLoading:ke}=fv({applicationId:e.applicationId}),{applicationMeta:_e}=Rf({applicationId:e.applicationId,appsStore:r}),Le=j(()=>{var Ne;return(Ne=p(_e).meta)==null?void 0:Ne.fileSizeLimit}),Y=j(()=>{const{name:Ne}=p(_e);return t("%{appName} for %{fileName}",{appName:t(Ne),fileName:p(p(_).fileName)})}),xe=Js("driveAliasAndItem"),Me=ln("fileId"),Ve=j(()=>At(p(Me))),Ze=async()=>{const Ne=p(Ve),{space:Je,path:st}=await l(Ne),qn=Je.getDriveAliasAndItem({path:st});return te.isPersonalSpaceResource(Je)?s.push({params:{...p(a).params,driveAliasAndItem:qn},query:{...p(a).query,fileId:Ne,contextRouteName:"files-spaces-generic",contextRouteParams:{driveAliasAndItem:yt.dirname(qn)}}}):s.push({params:{...p(a).params,driveAliasAndItem:qn},query:{...p(a).query,fileId:Ne,contextRouteName:st==="/"?"files-shares-with-me":"files-spaces-generic",...te.isShareSpaceResource(Je)&&{shareId:Je.id},contextRouteParams:{driveAliasAndItem:yt.dirname(qn)},contextRouteQuery:{...te.isShareSpaceResource(Je)&&{shareId:Je.id}}}})},kt=hn.useTask(function*(Ne){try{p(xe)||(yield Ze()),N.value=p(p(_).space);const Je=yield G(p(_),{signal:Ne});if(A.value=Je,te.isShareSpaceResource(p(N))&&(p(A).remoteItemId=p(N).id,p(A).id===p(A).remoteItemId)){const st=yield*te.call(ws({graphClient:c.graphAuthenticated,spacesStore:m,space:p(N)}));st&&(A.value={...Je,...te.buildIncomingShareResource({graphRoles:T.graphRoles,driveItem:st,serverUrl:w.serverUrl}),tags:Je.tags})}v.initResourceList({currentFolder:null,resources:[p(A)]}),f.value=[p(A)]}catch(Je){console.error(Je),V.value=Je,$.value=!1}}).restartable(),Rt=hn.useTask(function*(Ne){try{const Je=e.importResourceWithExtension(p(A));if(Je){const st=jt.DateTime.local().toFormat("yyyyMMddHHmmss"),qn=`${p(A).name}_${st}.${Je}`;if(!(yield c.webdav.copyFiles(p(N),p(A),p(N),{path:qn},{signal:Ne})))throw new Error(t("Importing failed"));A.value={path:qn}}if(q(_,p(A)))return;if(X.value=![Fn.Updateable,Fn.FileUpdateable].some(st=>(p(A).permissions||"").indexOf(st)>-1),p(Z("currentContent"))){const st=yield*te.call(F(_,{...e.fileContentOptions,signal:Ne}));ee.value=se.value=st.body,L.value=st.headers["OC-ETag"]}p(Z("url"))&&(x.value=yield z(p(N),p(A),{...e.urlForResourceOptions,signal:Ne}))}catch(Je){console.error(Je),V.value=Je}finally{$.value=!1}}).restartable();Et(_,async()=>{p(R)||(await kt.perform(),p(Le)&&jN(p(A).size)>p(Le)?d({title:t("File exceeds %{threshold}",{threshold:An(p(Le),n)}),message:t("%{resource} exceeds the recommended size of %{threshold} for editing, and may cause performance issues.",{resource:p(A).name,threshold:An(p(Le),n)}),confirmText:t("Continue"),onCancel:()=>{H()},onConfirm:()=>{Rt.perform()}}):Rt.perform())},{immediate:!0});const Nt=Ne=>{console.error(Ne),i({title:t("An error occurred"),desc:Ne.message,errors:[Ne]})},Be=()=>{o({title:t("File autosaved")})},ze=hn.useTask(function*(){const Ne=p(se);try{const Je=yield M(_,{content:Ne,previousEntityTag:p(L)});ee.value=Ne,L.value=Je.etag,v.upsertResource(Je)}catch(Je){switch(Je.statusCode){case 401:case 403:Nt(new te.HttpError(t("You're not authorized to save this file"),Je.response));break;case 409:case 412:Nt(new te.HttpError(t("This file was updated outside this window. Please refresh the page (all changes will be lost)."),Je.response));break;case 507:const st=m.spaces.find(qn=>qn.id===p(A).storageId&&te.isProjectSpaceResource(qn));if(st){Nt(new te.HttpError(t('Insufficient quota on "%{spaceName}" to save this file',{spaceName:st.name}),Je.response));break}Nt(new te.HttpError(t("Insufficient quota for saving this file"),Je.response));break;default:Nt(new te.HttpError("",Je.response))}}}).drop(),pn=async()=>{await ze.perform()},B=j(()=>!e.disableAutoSave);let C=null;qt(()=>{var Je;if(ie=y.subscribe("runtime.resource.deleted",Te),(Je=v.ancestorMetaData)!=null&&Je["/"]&&p(N)&&v.ancestorMetaData["/"].spaceId!==p(N).id&&v.setAncestorMetaData({}),!p(ue))return;const Ne=w.options.editor;Ne.autosaveEnabled&&!e.disableAutoSave&&(C=setInterval(async()=>{oe.value&&(await pn(),Be())},(Ne.autosaveInterval||120)*1e3))}),Wn(()=>{y.unsubscribe("runtime.resource.deleted",ie),u.isLoading||window.removeEventListener("beforeunload",ce),p(Z("url"))&&de(x.value),p(ue)&&(clearInterval(C),C=null)});const{bindKeyAction:O}=Wv({skipDisabledKeyBindingsCheck:!0});O({modifier:Uf.Ctrl,primary:jf.S},()=>{p(oe)&&pn()});const K=j(()=>[{name:"save-file",disabledTooltip:()=>"",isVisible:()=>p(ue),isDisabled:()=>X.value||!oe.value,icon:"save",id:"app-save-action",label:()=>t("Save"),handler:pn}]),ne=j(()=>({space:p(N),resources:[p(A)]})),he=async(Ne,Je)=>{p(oe)&&(await pn(),Be()),Je(Ne)},Te=Ne=>{if(Ne.find(st=>st.id===p(A).id)){if(re)return re();H()}},Ye=j(()=>[...p(g),...p(K),...p(fe).map(Ne=>({...Ne,isVisible:Je=>ue.value&&Ne.isVisible(Je)}))].filter(Ne=>Ne.isVisible(p(ne)))),ut=j(()=>[...p(E),...p(h)].filter(Ne=>Ne.isVisible(p(ne)))),ft=j(()=>[...p(b).map(Ne=>({...Ne,handler:Je=>he(Je,Ne.handler)})),...p(I)].filter(Ne=>Ne.isVisible(p(ne)))),gt=j(()=>[...p(S)].filter(Ne=>Ne.isVisible(p(ne)))),ot=j(()=>{const Ne=[];return p(Ye).length&&Ne.push({name:"context",items:p(Ye)}),p(ut).length&&Ne.push({name:"share",items:p(ut)}),p(ft).length&&Ne.push({name:"actions",items:p(ft)}),p(gt).length&&Ne.push({name:"sidebar",items:p(gt)}),Ne}),Vi=j(()=>[...p(K)]);Bo.onBeforeRouteLeave((Ne,Je,st)=>{p(oe)?d({title:t("Unsaved changes"),customComponent:o0,focusTrapInitial:".oc-modal-body-actions-confirm",hideActions:!0,customComponentAttrs:()=>({closeCallback:()=>{st()}}),async onConfirm(){await pn(),st()}}):st()});const Un=j(()=>({url:p(x),space:p(p(_).space),resource:p(A),activeFiles:p(Ae),isDirty:p(oe),isReadOnly:p(X),applicationConfig:p(Ce),currentFileContext:p(_),currentContent:p(se),isFolderLoading:p(ke),"onUpdate:resource":Ne=>{N.value=p(p(_).space),A.value={...Ne,...te.isShareSpaceResource(p(N))&&{remoteItemId:p(N).id}},f.value=[p(A)]},"onUpdate:currentContent":Ne=>{se.value=Ne},"onRegister:onDeleteResourceCallback":Ne=>{re=Ne},"onDelete:resource":()=>{p(I)[0].isVisible({space:p(N),resources:[p(A)]})&&p(I)[0].handler({space:p(N),resources:[p(A)]})},onSave:pn,onClose:H,loadFolderForFileContext:De,revokeUrl:de,getUrlForResource:z}));return{...Tb(),dropDownMenuSections:ot,dropDownActionOptions:ne,hasAutoSave:B,isEditor:ue,closeApp:H,fileActions:Vi,loading:$,loadingError:V,pageTitle:Y,resource:A,space:N,slotAttrs:Un}}}),qN=["id"],VN=["textContent"];function zN(e,t,n,r,o,i){const s=ye("app-top-bar"),a=ye("loading-screen"),c=ye("error-screen"),u=ye("file-side-bar");return J(),ge("main",{id:e.applicationId,class:"app-wrapper oc-height-1-1",onKeydown:t[0]||(t[0]=no((...l)=>e.closeApp&&e.closeApp(...l),["esc"]))},[pe("h1",{class:"oc-invisible-sr",textContent:W.toDisplayString(e.pageTitle)},null,8,VN),!e.loading&&!e.loadingError&&e.resource?(J(),Ie(s,{key:0,"main-actions":e.fileActions,"drop-down-menu-sections":e.dropDownMenuSections,"drop-down-action-options":e.dropDownActionOptions,"has-auto-save":e.hasAutoSave,"is-editor":e.isEditor,resource:e.resource,onClose:e.closeApp},null,8,["main-actions","drop-down-menu-sections","drop-down-action-options","has-auto-save","is-editor","resource","onClose"])):Pe("",!0),e.loading?(J(),Ie(a,{key:1})):e.loadingError?(J(),Ie(c,{key:2,message:e.loadingError.message},null,8,["message"])):(J(),ge("div",{key:3,class:W.normalizeClass(["oc-flex oc-width-1-1 oc-height-1-1",{"app-sidebar-open":e.isSideBarOpen}])},[He(e.$slots,"default",Kt({class:"app-wrapper-content oc-height-1-1"},e.slotAttrs)),me(u,{"is-open":e.isSideBarOpen,"active-panel":e.sideBarActivePanel,space:e.space},null,8,["is-open","active-panel","space"])],2))],40,qN)}const a0=Ue(UN,[["render",zN]]);function WN(e,t){return $e({render(){return tl(a0,{wrappedComponent:e,...t},{default:n=>tl(e,n)})}})}const HN=$e({name:"ContextMenuQuickAction",props:{item:{type:Object,required:!0},resourceDomSelector:{type:Function,required:!1,default:e=>te.extractDomSelector(e.id)}},emits:["quickActionClicked"],setup(){const{$gettext:e}=Oe.useGettext();return{contextMenuLabel:j(()=>e("Show context menu"))}}});function GN(e,t,n,r,o,i){const s=ye("oc-icon"),a=ye("oc-drop"),c=ye("oc-button"),u=cn("oc-tooltip");return it((J(),Ie(c,{id:`context-menu-trigger-${e.resourceDomSelector(e.item)}`,"aria-label":e.contextMenuLabel,appearance:"raw",class:"quick-action-button oc-ml-xs oc-p-xs",onClick:t[0]||(t[0]=In(l=>e.$emit("quickActionClicked",{event:l,dropdown:e.$refs[`context-menu-drop-ref-${e.resourceDomSelector(e.item)}`]}),["stop","prevent"]))},{default:Ee(()=>[me(s,{name:"more-2"}),me(a,{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)}`,class:"oc-overflow-hidden",position:"bottom-end",mode:"click","close-on-click":"","padding-size":"small"},{default:Ee(()=>[He(e.$slots,"contextMenu",{item:e.item})]),_:3},8,["drop-id","toggle"])]),_:3},8,["id","aria-label"])),[[u,e.contextMenuLabel]])}const Kf=Ue(HN,[["render",GN]]),KN=$e({name:"ResourceGhostElement",components:{ResourceIcon:ko},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}}}),QN={id:"ghost-element",class:"ghost-element"},XN={class:"ghost-element-layer1 oc-rounded"},YN={key:0,class:"ghost-element-layer2 oc-rounded"},JN={key:1,class:"ghost-element-layer3 oc-rounded"},ZN={class:"badge"};function e$(e,t,n,r,o,i){const s=ye("resource-icon");return J(),ge("div",QN,[pe("div",XN,[me(s,{class:"oc-p-xs",resource:e.previewItems[0]},null,8,["resource"]),e.showSecondLayer?(J(),ge("div",YN)):Pe("",!0),e.showThirdLayer?(J(),ge("div",JN)):Pe("",!0)]),pe("span",ZN,W.toDisplayString(e.itemCount),1)])}const Qf=Ue(KN,[["render",e$]]),t$=$e({name:"ResourceSize",props:{size:{type:[String,Number],required:!0}},setup:e=>{const{current:t}=Oe.useGettext();return{formattedSize:j(()=>An(e.size,t))}}}),n$=["textContent"];function r$(e,t,n,r,o,i){return J(),ge("span",{class:"oc-resource-size",textContent:W.toDisplayString(e.formattedSize)},null,8,n$)}const l0=Ue(t$,[["render",r$]]),No={};function i$(e){return e.getIsPending!==void 0}function o$(e){if(i$(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 s$(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 a$(e){return Object.keys(e).reduce((t,n)=>(e[n]!==!1&&e[n]!==null&&e[n]!==void 0&&(t[n]=e[n]),t),{})}function l$(e,t){const{class:n,style:r,...o}=s$(e),{class:i,style:s,...a}=a$(t);return{class:[n,i],style:[r,s],...o,...a}}const c0=$e({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,i=Jd(),s=le(),a=le(),c=le(),u=Math.random().toString(36).substring(2);t({svgElSource:s,request:c}),Et(()=>r.src,T=>{f(T)}),f(r.src);function l(T){if(T=T.cloneNode(!0),r.uniqueIds){const y=typeof r.uniqueIds=="string"?r.uniqueIds:u;T=v(T,y,r.uniqueIdsBase)}return T=r.transformSource(T),r.title&&w(T,r.title),T.innerHTML}function f(T){No[T]||(No[T]=d(T)),s.value&&No[T].getIsPending()&&!r.keepDuringLoading&&(s.value=null,o("unloaded")),No[T].then(y=>{s.value=y,zn(()=>{o("loaded",a.value)})}).catch(y=>{s.value&&(s.value=void 0,o("unloaded")),delete No[T],o("error",y)})}function d(T){return o$(new Promise((y,g)=>{const h=new XMLHttpRequest;h.open("GET",T,!0),c.value=h,h.onload=()=>{if(h.status>=200&&h.status<400)try{let b=new DOMParser().parseFromString(h.responseText,"text/xml").getElementsByTagName("svg")[0];b?y(b):g(new Error('Loaded file is not valid SVG"'))}catch(b){g(b)}else g(new Error("Error loading SVG"))},h.onerror=g,h.send()}))}const m=()=>s.value?tl("svg",{...l$(s.value,i),innerHTML:l(s.value),ref:a}):null;function w(T,y){const g=T.getElementsByTagName("title");if(g.length)g[0].textContent=y;else{const h=document.createElementNS("http://www.w3.org/2000/svg","title");h.textContent=y,T.insertBefore(h,T.firstChild)}}function v(T,y,g=""){const h=["id","href","xlink:href","xlink:role","xlink:arcrole"],b=["href","xlink:href"],S=(E,I)=>b.includes(E)&&(I?!I.includes("#"):!1);return[...T.children].forEach(E=>{var I;if((I=E.attributes)!=null&&I.length){const R=Object.values(E.attributes).map(A=>{const N=/url\((.*?)\)/.exec(A.value);return N!=null&&N[1]&&(A.value=A.value.replace(N[0],`url(${g}${N[1]}_${y})`)),A});h.forEach(A=>{const N=R.find(L=>L.name===A);N&&!S(A,N.value)&&(N.value=`${N.value}_${y}`)})}return E.children.length?v(E,y,g):E}),T}return(T,y)=>(J(),Ie(m))}}),u0=$e({__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}){c0.name="inline-svg";const n=t,r=j(()=>xb("oc-icon-title-")),o=j(()=>{const c=`${HP()}icons/`,u=e.fillType.toLowerCase();return u==="none"?`${c}${e.name}.svg`:`${c}${e.name}-${u}.svg`}),i=c=>s(Dr(c)),s=c=>{if(c!==null)return`oc-icon-${c}`},a=c=>{if(e.accessibleLabel!==""){const u=document.createElement("title");u.setAttribute("id",r.value),u.appendChild(document.createTextNode(e.accessibleLabel)),c.insertBefore(u,c.firstChild)}return c};return(c,u)=>(J(),Ie(kr(c.type),{class:W.normalizeClass([{"oc-button-reset":c.type==="button"},"oc-icon",i(c.size)])},{default:Ee(()=>[me(p(c0),{src:o.value,"transform-source":a,"aria-hidden":c.accessibleLabel===""?"true":null,"aria-labelledby":c.accessibleLabel===""?null:r.value,focusable:c.accessibleLabel===""?"false":null,style:W.normalizeStyle(c.color!==""?{fill:c.color}:{}),onLoaded:u[0]||(u[0]=l=>n("loaded"))},null,8,["src","aria-hidden","aria-labelledby","focusable","style"])]),_:1},8,["class"]))}}),f0=$e({__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=j(()=>{const a=["oc-button","oc-rounded",`oc-button-${Dr(e.size)}`,`oc-button-justify-content-${e.justifyContent}`,`oc-button-gap-${Dr(e.gapSize)}`,`oc-button-${_t.kebabCase(e.colorRole)}`,`oc-button-${e.appearance}`,`oc-button-${_t.kebabCase(e.colorRole)}-${e.appearance}`];return e.noHover&&a.push("no-hover"),a}),o=j(()=>({...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=j(()=>({...e.type==="button"&&{click:s}})),s=a=>{n("click",a)};return(a,c)=>{const u=ye("oc-spinner");return J(),Ie(kr(a.type),Kt(o.value,{"aria-label":a.ariaLabel,class:r.value},Ha(i.value)),{default:Ee(()=>[a.showSpinner?(J(),Ie(u,{key:0,size:"small",class:"spinner"})):Pe("",!0),He(a.$slots,"default")]),_:3},16,["aria-label","class"])}}});/*!
50
+ `):(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,c,u){let l="",d="";const f=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(c)+"<"+m+"?"+this.tagEndChar:d+=this.indentate(c)+"<"+m+"/"+this.tagEndChar;else if(a[m]instanceof Date)d+=this.buildTextValNode(a[m],m,"",c);else if(typeof a[m]!="object"){const w=this.isAttribute(m);if(w&&!this.ignoreAttributesFn(w,f))l+=this.buildAttrPairStr(w,""+a[m]);else if(!w)if(m===this.options.textNodeName){let y=this.options.tagValueProcessor(m,""+a[m]);d+=this.replaceEntitiesValue(y)}else d+=this.buildTextValNode(a[m],m,"",c)}else if(Array.isArray(a[m])){const w=a[m].length;let y="",E="";for(let b=0;b<w;b++){const g=a[m][b];if(!(typeof g>"u"))if(g===null)m[0]==="?"?d+=this.indentate(c)+"<"+m+"?"+this.tagEndChar:d+=this.indentate(c)+"<"+m+"/"+this.tagEndChar;else if(typeof g=="object")if(this.options.oneListGroup){const v=this.j2x(g,c+1,u.concat(m));y+=v.val,this.options.attributesGroupName&&g.hasOwnProperty(this.options.attributesGroupName)&&(E+=v.attrStr)}else y+=this.processTextOrObjNode(g,m,c,u);else if(this.options.oneListGroup){let v=this.options.tagValueProcessor(m,g);v=this.replaceEntitiesValue(v),y+=v}else y+=this.buildTextValNode(g,m,"",c)}this.options.oneListGroup&&(y=this.buildObjectNode(y,m,E,c)),d+=y}else if(this.options.attributesGroupName&&m===this.options.attributesGroupName){const w=Object.keys(a[m]),y=w.length;for(let E=0;E<y;E++)l+=this.buildAttrPairStr(w[E],""+a[m][w[E]])}else d+=this.processTextOrObjNode(a[m],m,c,u);return{attrStr:l,val:d}},r.prototype.buildAttrPairStr=function(a,c){return c=this.options.attributeValueProcessor(a,""+c),c=this.replaceEntitiesValue(c),this.options.suppressBooleanAttributes&&c==="true"?" "+a:" "+a+'="'+c+'"'};function o(a,c,u,l){const d=this.j2x(a,u+1,l.concat(c));return a[this.options.textNodeName]!==void 0&&Object.keys(a).length===1?this.buildTextValNode(a[this.options.textNodeName],c,d.attrStr,u):this.buildObjectNode(d.val,c,d.attrStr,u)}r.prototype.buildObjectNode=function(a,c,u,l){if(a==="")return c[0]==="?"?this.indentate(l)+"<"+c+u+"?"+this.tagEndChar:this.indentate(l)+"<"+c+u+this.closeTag(c)+this.tagEndChar;{let d="</"+c+this.tagEndChar,f="";return c[0]==="?"&&(f="?",d=""),(u||u==="")&&a.indexOf("<")===-1?this.indentate(l)+"<"+c+u+f+">"+a+d:this.options.commentPropName!==!1&&c===this.options.commentPropName&&f.length===0?this.indentate(l)+`<!--${a}-->`+this.newLine:this.indentate(l)+"<"+c+u+f+this.tagEndChar+a+this.indentate(l)+d}},r.prototype.closeTag=function(a){let c="";return this.options.unpairedTags.indexOf(a)!==-1?this.options.suppressUnpairedNode||(c="/"):this.options.suppressEmptyNode?c="/":c=`></${a}`,c},r.prototype.buildTextValNode=function(a,c,u,l){if(this.options.cdataPropName!==!1&&c===this.options.cdataPropName)return this.indentate(l)+`<![CDATA[${a}]]>`+this.newLine;if(this.options.commentPropName!==!1&&c===this.options.commentPropName)return this.indentate(l)+`<!--${a}-->`+this.newLine;if(c[0]==="?")return this.indentate(l)+"<"+c+u+"?"+this.tagEndChar;{let d=this.options.tagValueProcessor(c,a);return d=this.replaceEntitiesValue(d),d===""?this.indentate(l)+"<"+c+u+this.closeTag(c)+this.tagEndChar:this.indentate(l)+"<"+c+u+">"+d+"</"+c+this.tagEndChar}},r.prototype.replaceEntitiesValue=function(a){if(a&&a.length>0&&this.options.processEntities)for(let c=0;c<this.options.entities.length;c++){const u=this.options.entities[c];a=a.replace(u.regex,u.val)}return a};function i(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 mf=r,mf}var yf,Ky;function Y_(){if(Ky)return yf;Ky=1;const e=Dy(),t=K_(),n=X_();return yf={XMLParser:t,XMLValidator:e,XMLBuilder:n},yf}Y_();class Qy{isEnabled(){return!0}isActive(t){return Tn(t,"files-trash-generic")}getTask(t){const{resourcesStore:n,spacesStore:r,clientService:{webdav:o,graphAuthenticated:i}}=t;return pn.useTask(function*(s,a,c){n.clearResourceList(),n.setAncestorMetaData({});const{resource:u,children:l}=yield o.listFiles(c,{},{depth:1,davProperties:As.Trashbin,isTrash:!0,signal:s});Z.isProjectSpaceResource(c)&&(yield r.loadGraphPermissions({ids:[c.id],graphClient:i})),n.initResourceList({currentFolder:u,resources:l})})}}class Xy{constructor(){Ee(this,"loaders");this.loaders=[new Yh,new Jh,new Zh,new eg,new tg,new Qy]}getTask(){const t=yt(),n=at(),r=sn(),o=He(),i=Ge(),s=st(),a=Qe(),c=Tr(),u=Of(),l=this.loaders.find(d=>d.isEnabled()&&d.isActive(p(o)));if(!l){console.debug("No folder loader found for route");return}return pn.useTask(function*(...d){const f={clientService:i,configStore:s,userStore:t,spacesStore:n,capabilityStore:r,resourcesStore:a,sharesStore:c,router:o,authService:u};try{yield l.getTask(f).perform(...d)}catch(m){console.error(m)}})}}const Yy=new Xy;var Lr=(e=>(e.add="loading-service.add",e.remove="loading-service.remove",e.setProgress="loading-service.set-progress",e))(Lr||{});const J_=200;class Z_{constructor(){Ee(this,"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=J_,indeterminate:r=!0}={}){const o={id:en.v4(),active:!1,...!r&&{state:{total:0,current:0}}};return this.tasks.length||window.addEventListener("beforeunload",this.onBeforeUnload),this.tasks.push(o),It.debounce(()=>{o.active=!0,Ke.publish("loading-service.add")},n)(),t({setProgress:({total:a,current:c})=>{r||this.setProgress({task:o,total:a,current:c})}}).finally(()=>{this.removeTask(o.id)})}removeTask(t){this.tasks=this.tasks.filter(n=>n.id!==t),this.tasks.length||window.removeEventListener("beforeunload",this.onBeforeUnload),Ke.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,Ke.publish("loading-service.set-progress")}onBeforeUnload(t){t.preventDefault()}}var eI="__lodash_hash_undefined__";function tI(e){return this.__data__.set(e,eI),this}function nI(e){return this.__data__.has(e)}function qs(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new br;++t<n;)this.add(e[t])}qs.prototype.add=qs.prototype.push=tI,qs.prototype.has=nI;function rI(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 iI(e,t){return e.has(t)}var oI=1,sI=2;function Jy(e,t,n,r,o,i){var s=n&oI,a=e.length,c=t.length;if(a!=c&&!(s&&c>a))return!1;var u=i.get(e),l=i.get(t);if(u&&l)return u==t&&l==e;var d=-1,f=!0,m=n&sI?new qs:void 0;for(i.set(e,t),i.set(t,e);++d<a;){var w=e[d],y=t[d];if(r)var E=s?r(y,w,d,t,e,i):r(w,y,d,e,t,i);if(E!==void 0){if(E)continue;f=!1;break}if(m){if(!rI(t,function(b,g){if(!iI(m,g)&&(w===b||o(w,b,n,r,i)))return m.push(g)})){f=!1;break}}else if(!(w===y||o(w,y,n,r,i))){f=!1;break}}return i.delete(e),i.delete(t),f}function aI(e){var t=-1,n=Array(e.size);return e.forEach(function(r,o){n[++t]=[o,r]}),n}function lI(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var cI=1,uI=2,fI="[object Boolean]",dI="[object Date]",pI="[object Error]",hI="[object Map]",gI="[object Number]",mI="[object RegExp]",yI="[object Set]",bI="[object String]",vI="[object Symbol]",wI="[object ArrayBuffer]",SI="[object DataView]",Zy=xn?xn.prototype:void 0,bf=Zy?Zy.valueOf:void 0;function EI(e,t,n,r,o,i,s){switch(n){case SI:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case wI:return!(e.byteLength!=t.byteLength||!i(new gs(e),new gs(t)));case fI:case dI:case gI:return io(+e,+t);case pI:return e.name==t.name&&e.message==t.message;case mI:case bI:return e==t+"";case hI:var a=aI;case yI:var c=r&cI;if(a||(a=lI),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;r|=uI,s.set(e,t);var l=Jy(a(e),a(t),r,o,i,s);return s.delete(e),l;case vI:if(bf)return bf.call(e)==bf.call(t)}return!1}function vf(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function eb(e,t,n){var r=t(e);return Hn(e)?r:vf(r,n(e))}function TI(e,t){for(var n=-1,r=e==null?0:e.length,o=0,i=[];++n<r;){var s=e[n];t(s,n,e)&&(i[o++]=s)}return i}function tb(){return[]}var AI=Object.prototype,RI=AI.propertyIsEnumerable,nb=Object.getOwnPropertySymbols,rb=nb?function(e){return e==null?[]:(e=Object(e),TI(nb(e),function(t){return RI.call(e,t)}))}:tb,_I=Xp(Object.keys,Object),II=Object.prototype,CI=II.hasOwnProperty;function PI(e){if(!Sl(e))return _I(e);var t=[];for(var n in Object(e))CI.call(e,n)&&n!="constructor"&&t.push(n);return t}function FI(e){return ys(e)?ch(e):PI(e)}function ib(e){return eb(e,FI,rb)}var OI=1,kI=Object.prototype,xI=kI.hasOwnProperty;function NI(e,t,n,r,o,i){var s=n&OI,a=ib(e),c=a.length,u=ib(t),l=u.length;if(c!=l&&!s)return!1;for(var d=c;d--;){var f=a[d];if(!(s?f in t:xI.call(t,f)))return!1}var m=i.get(e),w=i.get(t);if(m&&w)return m==t&&w==e;var y=!0;i.set(e,t),i.set(t,e);for(var E=s;++d<c;){f=a[d];var b=e[f],g=t[f];if(r)var v=s?r(g,b,f,t,e,i):r(b,g,f,e,t,i);if(!(v===void 0?b===g||o(b,g,n,r,i):v)){y=!1;break}E||(E=f=="constructor")}if(y&&!E){var h=e.constructor,S=t.constructor;h!=S&&"constructor"in e&&"constructor"in t&&!(typeof h=="function"&&h instanceof h&&typeof S=="function"&&S instanceof S)&&(y=!1)}return i.delete(e),i.delete(t),y}var wf=Jr(er,"DataView"),Sf=Jr(er,"Promise"),Ef=Jr(er,"Set"),Tf=Jr(er,"WeakMap"),ob="[object Map]",$I="[object Object]",sb="[object Promise]",ab="[object Set]",lb="[object WeakMap]",cb="[object DataView]",DI=Yr(wf),LI=Yr(so),MI=Yr(Sf),BI=Yr(Ef),jI=Yr(Tf),Gn=Xr;(wf&&Gn(new wf(new ArrayBuffer(1)))!=cb||so&&Gn(new so)!=ob||Sf&&Gn(Sf.resolve())!=sb||Ef&&Gn(new Ef)!=ab||Tf&&Gn(new Tf)!=lb)&&(Gn=function(e){var t=Xr(e),n=t==$I?e.constructor:void 0,r=n?Yr(n):"";if(r)switch(r){case DI:return cb;case LI:return ob;case MI:return sb;case BI:return ab;case jI:return lb}return t});var UI=1,ub="[object Arguments]",fb="[object Array]",Vs="[object Object]",qI=Object.prototype,db=qI.hasOwnProperty;function VI(e,t,n,r,o,i){var s=Hn(e),a=Hn(t),c=s?fb:Gn(e),u=a?fb:Gn(t);c=c==ub?Vs:c,u=u==ub?Vs:u;var l=c==Vs,d=u==Vs,f=c==u;if(f&&lo(e)){if(!lo(t))return!1;s=!0,l=!1}if(f&&!l)return i||(i=new nr),s||Rl(e)?Jy(e,t,n,r,o,i):EI(e,t,c,n,r,o,i);if(!(n&UI)){var m=l&&db.call(e,"__wrapped__"),w=d&&db.call(t,"__wrapped__");if(m||w){var y=m?e.value():e,E=w?t.value():t;return i||(i=new nr),o(y,E,n,r,i)}}return f?(i||(i=new nr),NI(e,t,n,r,o,i)):!1}function pb(e,t,n,r,o){return e===t?!0:e==null||t==null||!rr(e)&&!rr(t)?e!==e&&t!==t:VI(e,t,n,r,pb,o)}function hb(e,t){return pb(e,t)}const Af=(e="")=>e.split("/").map(encodeURIComponent).join("/"),zI=e=>{const t=[],n=(r,o="")=>Object.keys(r).forEach(i=>{El(r[i])?n(r[i],`${o}${i}.`):t.push(`${o}${i}`)});return n(e),t};class WI{constructor({clientService:t,userStore:n,authStore:r,capabilityStore:o,configStore:i}){Ee(this,"clientService");Ee(this,"configStore");Ee(this,"userStore");Ee(this,"authStore");Ee(this,"capabilityStore");Ee(this,"capability");this.clientService=t,this.userStore=n,this.authStore=r,this.configStore=i,this.capability=o.filesThumbnail||{enabled:!0,version:"v0.1",supportedMimeTypes:["image/gif","image/png","image/jpeg","image/tiff","image/bmp","image/x-ms-bmp","application/vnd.geogebra.slides","application/vnd.geogebra.pinboard"]}}get available(){var t;return!!((t=this.capability)!=null&&t.version)}get supportedMimeTypes(){var t;return((t=this.capability)==null?void 0:t.supportedMimeTypes)||[]}get user(){return this.userStore.user}isMimetypeSupported(t,n=!1){return this.supportedMimeTypes.length?this.getSupportedMimeTypes(n?"image/":null).includes(t):!0}getSupportedMimeTypes(t){return t?this.supportedMimeTypes.filter(n=>n.startsWith(t)):this.supportedMimeTypes}async loadPreview(t,n=!1,r=!0,o){const{space:i,resource:s}=t,a=this.available&&this.isMimetypeSupported(s.mimeType),c=s.type!=="folder"&&s.extension&&s.canDownload();if(!a||!c)return;const u=Z.isPublicSpaceResource(i);if(!(!u&&(!this.configStore.serverUrl||!this.user.onPremisesSamAccountName||!this.authStore.accessToken))){if(u)return this.publicPreviewUrl(t,o);try{return await this.privatePreviewBlob(t,n,r,o)}catch(l){if(r)return;throw l}}}async cacheFactory(t,n,r){const{resource:o,dimensions:i}=t,s=Zl.filePreview.get(o.id.toString());if(s&&s.etag===o.etag&&hb(i,s.dimensions))return s.src;try{const a=await this.privatePreviewBlob(t,!1,!0,r);return Zl.filePreview.set(o.id.toString(),{src:a,etag:o.etag,dimensions:i},0).src}catch(a){if(n)return;throw a}}buildQueryString(t){return X0.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){var u,l;const{resource:i,dimensions:s,processor:a}=t;if(n)return this.cacheFactory(t,r,o);const c=[this.configStore.serverUrl,"remote.php/dav",Af(i.webDavPath),"?",this.buildQueryString({etag:i.etag,dimensions:s,processor:a})].join("");try{const{data:d}=await this.clientService.httpAuthenticated.get(c,{responseType:"blob",signal:o});return window.URL.createObjectURL(d)}catch(d){if([425,429].includes(d.status)){const f=((l=(u=d.response)==null?void 0:u.headers)==null?void 0:l["retry-after"])||5;return await new Promise(m=>setTimeout(m,f*1e3)),this.privatePreviewBlob(t,n,r,o)}throw d}}async publicPreviewUrl(t,n){var l,d;const{resource:r,dimensions:o,processor:i}=t,[s,a]=r.downloadURL.split("?"),c=[this.buildQueryString({etag:r.etag,dimensions:o,processor:i}),a].filter(Boolean).join("&"),u=[s,c].filter(Boolean).join("?");try{const{status:f}=await this.clientService.httpUnAuthenticated.head(u,{signal:n});if(f!==404)return u}catch(f){if([425,429].includes(f.status)){const m=((d=(l=f.response)==null?void 0:l.headers)==null?void 0:d["retry-after"])||5;return await new Promise(w=>setTimeout(w,m*1e3)),this.publicPreviewUrl(t,n)}throw f}}}const zs=me.z.enum(["fit","resize","fill","thumbnail"]);class HI{constructor({$gettext:t}){Ee(this,"$gettext");this.$gettext=t}explain(t,n){return{code:"mustNotBeEmpty",message:this.$gettext("Must not be empty"),format:[],...It.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 GI{constructor({$gettext:t}){Ee(this,"$gettext");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],...It.isBoolean(n)&&{verified:n}}}assert(t,n){return Array.from(n).filter(o=>t.characters.includes(o)).length>=t.minLength}validate(t){if(!It.isObject(t))throw new Error("options should be an object");if(!It.isNumber(t.minLength)||It.isNaN(t.minLength))throw new Error("minLength should be a non-zero number");if(!It.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 Ws{constructor({$gettext:t}){Ee(this,"$gettext");this.$gettext=t}assert(t,n){throw new Error("Method not implemented.")}explain(t,n){throw new Error("Method not implemented.")}validate(t){if(!It.isObject(t))throw new Error("options should be an object");if(!It.isNumber(t.minLength)||It.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 KI extends Ws{constructor(t){super(t)}explain(t,n){return{code:"atLeastCharacters",message:this.$gettext("%{param1}+ letters"),format:[t.minLength],...It.isBoolean(n)&&{verified:n}}}assert(t,n){return n.length>=t.minLength}}class QI extends Ws{constructor(t){super(t)}explain(t,n){return{code:"atLeastUppercaseCharacters",message:this.$gettext("%{param1}+ uppercase letters"),format:[t.minLength],...It.isBoolean(n)&&{verified:n}}}assert(t,n){var o;return((o=(n||"").match(/[A-Z\xC0-\xD6\xD8-\xDE]/g))==null?void 0:o.length)>=t.minLength}}class XI extends Ws{constructor(t){super(t)}explain(t,n){return{code:"atLeastLowercaseCharacters",message:this.$gettext("%{param1}+ lowercase letters"),format:[t.minLength],...It.isBoolean(n)&&{verified:n}}}assert(t,n){var o;return((o=(n||"").match(/[a-z\xDF-\xF6\xF8-\xFF]/g))==null?void 0:o.length)>=t.minLength}}class YI extends Ws{constructor(t){super(t)}explain(t,n){return{code:"atLeastDigits",message:this.$gettext("%{param1}+ numbers"),format:[t.minLength],...It.isBoolean(n)&&{verified:n}}}assert(t,n){var o;return((o=(n||"").match(/\d/g))==null?void 0:o.length)>=t.minLength}}var Rf={},gb;function JI(){if(gb)return Rf;gb=1;var e=function(i){return Math.floor(Math.random()*i)},t=function(i){var s="",a="",c=i.length,u=i.lowercase,l=i.uppercase,d=i.numbers,f=i.symbols,m=i.minLengthLowercase,w=i.minLengthUppercase,y=i.minLengthNumbers,E=i.minLengthSymbols,b=i.exclude,g="abcdefghijklmnopqrstuvwxyz";g=n(g,b);var v="ABCDEFGHIJKLMNOPQRSTUVWXYZ";v=n(v,b);var h="0123456789";h=n(h,b);var S="!#$%&'()*+,-./:;<=>?@[]^_{|}~";S=n(S,b);for(var T=g.length,R=0;R<m;R++)a+=g.charAt(e(T));for(T=v.length,R=0;R<w;R++)a+=v.charAt(e(T));for(T=h.length,R=0;R<y;R++)a+=h.charAt(e(T));for(T=S.length,R=0;R<E;R++)a+=S.charAt(e(T));s+=function($){for(var D=$.split(""),N=D.length-1;N>0;N--){var x=Math.floor(Math.random()*(N+1)),W=D[N];D[N]=D[x],D[x]=W}return D.join("")}(a);var _="";_=u?_+g:_,_=l?_+v:_,_=d?_+h:_,_=f?_+S:_;var A=c-s.length;for(T=_.length,R=0;R<A;R++)s+=_.charAt(e(T));return s},n=function(i,s){return s==null||s.split("").forEach(function(a){i=i.replace(a,"")}),i},r=function(i){var s=i.length,a=i.lowercase,c=i.uppercase,u=i.numbers,l=i.symbols;if(i.minLengthLowercase+i.minLengthUppercase+i.minLengthNumbers+i.minLengthSymbols>s)throw new Error("Sum of Minimum Characters in the passwords greater than the length of the Password to be generated.");if(a==0&&c==0&&u==0&&l==0)throw new Error("Alphabets, Numbers and Symbols are all set to False. No valid Characters to generate the Password.")},o=function(i){return i.length=i.length===void 0?10:i.length,i.lowercase=i.lowercase===void 0||i.lowercase,i.uppercase=i.uppercase===void 0||i.uppercase,i.numbers=i.numbers===void 0||i.numbers,i.symbols=i.symbols!==void 0&&i.symbols,i.lowercase?i.minLengthLowercase=i.minLengthLowercase===void 0?1:i.minLengthLowercase:i.minLengthLowercase=0,i.uppercase?i.minLengthUppercase=i.minLengthUppercase===void 0?1:i.minLengthUppercase:i.minLengthUppercase=0,i.numbers?i.minLengthNumbers=i.minLengthNumbers===void 0?1:i.minLengthNumbers:i.minLengthNumbers=0,i.symbols?i.minLengthSymbols=i.minLengthSymbols===void 0?1:i.minLengthSymbols:i.minLengthSymbols=0,i.exclude=i.exclude===void 0?"":i.exclude,i};return Rf.GeneratePassword=function(i){return i?(i=o(i),r(i),t(i)):(i=o({length:10,lowercase:!0,uppercase:!0,numbers:!0,symbols:!1,exclude:"",minLengthLowercase:1,minLengthUppercase:1,minLengthNumbers:1,minLengthSymbols:0}),r(i),t(i))},Rf}var ZI=JI();class eC{constructor({language:t}){Ee(this,"language");Ee(this,"capability");Ee(this,"policy");Ee(this,"generatePasswordRules");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 KI({...this.language}),mustNotBeEmpty:new HI({...this.language}),atLeastUppercaseCharacters:new QI({...this.language}),atLeastLowercaseCharacters:new XI({...this.language}),atLeastDigits:new YI({...this.language}),mustContain:new GI({...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 Y0.PasswordPolicy(r,n)}getPolicy({enforcePassword:t=!1}={}){return this.buildPolicy({enforcePassword:t}),this.policy}generatePassword(){return ZI.GeneratePassword({symbols:!0,length:this.generatePasswordRules.length,minLengthLowercase:this.generatePasswordRules.minLowercaseCharacters,minLengthUppercase:this.generatePasswordRules.minUppercaseCharacters,minLengthNumbers:this.generatePasswordRules.minDigits,minLengthSymbols:this.generatePasswordRules.minSpecialCharacters})}}function tC(e){return e.charCodeAt(0).toString(32)}function mb(e){let t="";return e.replace(/[^A-Z0-9]/gi,n=>(t+=`-${tC(n)}`,"/"))+t}function yb(e,t){let n=t||"uppy";return typeof e.name=="string"&&(n+=`-${mb(e.name.toLowerCase())}`),e.type!==void 0&&(n+=`-${e.type}`),e.meta&&typeof e.meta.relativePath=="string"&&(n+=`-${mb(e.meta.relativePath.toLowerCase())}`),e.data.size!==void 0&&(n+=`-${e.data.size}`),e.data.lastModified!==void 0&&(n+=`-${e.data.lastModified}`),n}class nC{constructor({language:t}){Ee(this,"uppy");Ee(this,"uploadInputs",[]);Ee(this,"uploadFolderMap",{});Ee(this,"getRelativeFilePath",t=>{const n=t.data.relativePath||t.data.webkitRelativePath;return n?Z.urlJoin(n):void 0});const{$gettext:n}=t;this.uppy=new J0({autoProceed:!1,onBeforeFileAdded:(r,o)=>(r.id in o&&(r.meta.retry=!0),r.meta.relativePath=this.getRelativeFilePath(r),r.id=yb(r,this.uppy.getID()),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()}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:i}){const s={chunkSize:t,removeFingerprintOnSuccess:!0,overridePatchMethod:n,retryDelays:[0,500,1e3],uploadDataDuringCreation:r,limit:5,headers:i,onBeforeRequest:o,onShouldRetry:(u,l,d,f)=>{var m,w;return((m=u==null?void 0:u.originalResponse)==null?void 0:m.getStatus())>=500?!1:((w=u==null?void 0:u.originalResponse)==null?void 0:w.getStatus())===401?!0:f(u)}},a=this.uppy.getPlugin("XHRUpload");a&&this.uppy.removePlugin(a);const c=this.uppy.getPlugin("Tus");if(c){c.setOptions(s);return}this.uppy.use(Z0,s)}useXhr({headers:t,timeout:n,endpoint:r}){const o={endpoint:r,method:"put",headers:t,formData:!1,timeout:n,getResponseData(){return{}}},i=this.uppy.getPlugin("Tus");i&&this.uppy.removePlugin(i);const s=this.uppy.getPlugin("XHRUpload");if(s){s.setOptions(o);return}this.uppy.use(ew,o)}tusActive(){return!!this.uppy.getPlugin("Tus")}useDropTarget({targetSelector:t}){this.uppy.getPlugin("DropTarget")||this.uppy.use(tw,{target:t,onDragOver:n=>{this.publish("drag-over",n)},onDragLeave:n=>{this.publish("drag-out",n)},onDrop:n=>{this.publish("drop",n)}})}removeDropTarget(){const t=this.uppy.getPlugin("DropTarget");t&&this.uppy.removePlugin(t)}subscribe(t,n){return Ke.subscribe(t,n)}unsubscribe(t,n){Ke.unsubscribe(t,n)}publish(t,n){Ke.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=>{!t||!t.successful.length&&!t.failed.length||(this.publish("uploadCompleted",t),t.successful.forEach(n=>{this.uppy.removeFile(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,i=Array.from(o.files);this.addFiles(i)}),this.uploadInputs.push(t))}removeUploadInput(t){this.uploadInputs=this.uploadInputs.filter(n=>n!==t)}generateUploadId(t){return yb(t,this.uppy.getID())}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()}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 rC(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var iC=Object.getOwnPropertySymbols,oC=iC?function(e){for(var t=[];e;)vf(t,rb(e)),e=wl(e);return t}:tb;function bb(e){return eb(e,Il,oC)}var sC=Object.prototype,aC=sC.hasOwnProperty;function lC(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&aC.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function cC(e,t){var n=vl(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var uC=/\w*$/;function fC(e){var t=new e.constructor(e.source,uC.exec(e));return t.lastIndex=e.lastIndex,t}var vb=xn?xn.prototype:void 0,wb=vb?vb.valueOf:void 0;function dC(e){return wb?Object(wb.call(e)):{}}var pC="[object Boolean]",hC="[object Date]",gC="[object Map]",mC="[object Number]",yC="[object RegExp]",bC="[object Set]",vC="[object String]",wC="[object Symbol]",SC="[object ArrayBuffer]",EC="[object DataView]",TC="[object Float32Array]",AC="[object Float64Array]",RC="[object Int8Array]",_C="[object Int16Array]",IC="[object Int32Array]",CC="[object Uint8Array]",PC="[object Uint8ClampedArray]",FC="[object Uint16Array]",OC="[object Uint32Array]";function kC(e,t,n){var r=e.constructor;switch(t){case SC:return vl(e);case pC:case hC:return new r(+e);case EC:return cC(e);case TC:case AC:case RC:case _C:case IC:case CC:case PC:case FC:case OC:return Kp(e,n);case gC:return new r;case mC:case vC:return new r(e);case yC:return fC(e);case bC:return new r;case wC:return dC(e)}}var xC="[object Map]";function NC(e){return rr(e)&&Gn(e)==xC}var Sb=Ii&&Ii.isMap,$C=Sb?Tl(Sb):NC,DC="[object Set]";function LC(e){return rr(e)&&Gn(e)==DC}var Eb=Ii&&Ii.isSet,MC=Eb?Tl(Eb):LC,BC=1,Tb="[object Arguments]",jC="[object Array]",UC="[object Boolean]",qC="[object Date]",VC="[object Error]",Ab="[object Function]",zC="[object GeneratorFunction]",WC="[object Map]",HC="[object Number]",Rb="[object Object]",GC="[object RegExp]",KC="[object Set]",QC="[object String]",XC="[object Symbol]",YC="[object WeakMap]",JC="[object ArrayBuffer]",ZC="[object DataView]",eP="[object Float32Array]",tP="[object Float64Array]",nP="[object Int8Array]",rP="[object Int16Array]",iP="[object Int32Array]",oP="[object Uint8Array]",sP="[object Uint8ClampedArray]",aP="[object Uint16Array]",lP="[object Uint32Array]",Et={};Et[Tb]=Et[jC]=Et[JC]=Et[ZC]=Et[UC]=Et[qC]=Et[eP]=Et[tP]=Et[nP]=Et[rP]=Et[iP]=Et[WC]=Et[HC]=Et[Rb]=Et[GC]=Et[KC]=Et[QC]=Et[XC]=Et[oP]=Et[sP]=Et[aP]=Et[lP]=!0,Et[VC]=Et[Ab]=Et[YC]=!1;function Hs(e,t,n,r,o,i){var s,a=t&BC;if(n&&(s=o?n(e,r,o,i):n(e)),s!==void 0)return s;if(!tr(e))return e;var c=Hn(e);if(c)s=lC(e);else{var u=Gn(e),l=u==Ab||u==zC;if(lo(e))return Gp(e,a);if(u==Rb||u==Tb||l&&!o)s={};else{if(!Et[u])return o?e:{};s=kC(e,u,a)}}i||(i=new nr);var d=i.get(e);if(d)return d;i.set(e,s),MC(e)?e.forEach(function(w){s.add(Hs(w,t,n,w,e,i))}):$C(e)&&e.forEach(function(w,y){s.set(y,Hs(w,t,n,y,e,i))});var f=bb,m=c?void 0:f(e);return rC(m||e,function(w,y){m&&(y=w,w=e[y]),sh(s,y,Hs(w,t,n,y,e,i))}),s}function cP(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 i=Array(o);++r<o;)i[r]=e[r+t];return i}function uP(e,t){return t.length<2?e:Ch(e,cP(t,0,-1))}function fP(e,t){return t=Ml(t,e),e=uP(e,t),e==null||delete e[Ih(gd(t))]}function dP(e){return El(e)?void 0:e}var _b=xn?xn.isConcatSpreadable:void 0;function pP(e){return Hn(e)||ms(e)||!!(_b&&e&&e[_b])}function hP(e,t,n,r,o){var i=-1,s=e.length;for(n||(n=pP),o||(o=[]);++i<s;){var a=e[i];n(a)?vf(o,a):o[o.length]=a}return o}function gP(e){var t=e==null?0:e.length;return t?hP(e):[]}function mP(e){return hh(ph(e,void 0,gP),e+"")}var yP=1,bP=2,vP=4,Mi=mP(function(e,t){var n={};if(e==null)return n;var r=!1;t=Th(t,function(i){return i=Ml(i,e),r||(r=i.length>1),i}),ah(e,bb(e),n),r&&(n=Hs(n,yP|bP|vP,dP));for(var o=t.length;o--;)fP(n,t[o]);return n});const wP=(e,t)=>{const n=(i="")=>i.split("/").filter(Boolean),r=n(e.path),o=n(t);return o.map((i,s)=>({id:en.v4(),allowContextActions:!0,text:i,to:{path:"/"+[...r].splice(0,r.length-o.length+s+1).join("/"),query:Mi(e.query,"fileId","page")},isStaticNav:!1}))},SP=(...e)=>{const t=e.pop();return[...e,{id:en.v4(),allowContextActions:t.allowContextActions,text:t.text,onClick:()=>Ke.publish("app.files.list.load"),isTruncationPlaceholder:t.isTruncationPlaceholder,isStaticNav:t.isStaticNav}]};class ii{}Ee(ii,"Cut","cut"),Ee(ii,"Copy","copy");const _f=e=>e.clientY===0,To=(e,t,n)=>{var i;const r=n.$el.getBoundingClientRect(),o=_f(t)?((i=t.target)==null?void 0:i.getBoundingClientRect().top)||0:t.clientY;e.setProps({getReferenceClientRect:()=>({width:0,height:0,top:o,bottom:o,left:t.type==="contextmenu"&&!_f(t)?t.clientX:r.x,right:t.type==="contextmenu"&&!_f(t)?t.clientX:r.x})}),e.show()},Gs=e=>(e||"").split("_")[0],oi=(e,t,n=qt.DateTime.DATETIME_MED)=>e.setLocale(Gs(t)).toLocaleString(n),Ib=(e,t,n=qt.DateTime.DATETIME_MED)=>oi(qt.DateTime.fromJSDate(e),t,n),EP=(e,t,n=qt.DateTime.DATETIME_MED)=>oi(qt.DateTime.fromHTTP(e),t,n),Cb=(e,t,n=qt.DateTime.DATETIME_MED)=>oi(qt.DateTime.fromISO(e),t,n),TP=(e,t,n=qt.DateTime.DATETIME_MED)=>oi(qt.DateTime.fromRFC2822(e),t,n),Ao=(e,t)=>e.setLocale(Gs(t)).toRelative(),Pb=(e,t)=>Ao(qt.DateTime.fromJSDate(e),t),AP=(e,t)=>Ao(qt.DateTime.fromHTTP(e),t),RP=(e,t)=>Ao(qt.DateTime.fromISO(e),t),_P=(e,t)=>Ao(qt.DateTime.fromRFC2822(e),t),IP=1048576,An=(e,t)=>{const n=typeof e=="string"?parseInt(e):e;return n<0?"--":isNaN(n)?"?":Q0.filesize(n,{round:n<IP?0:1,locale:Gs(t),base:10,output:"string"})};function Fb(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}var Tt=(e=>(e.open="sidebar.open",e.close="sidebar.close",e.toggle="sidebar.toggle",e.openWithPanel="sidebar.openWithPanel",e.setActivePanel="sidebar.setActivePanel",e))(Tt||{});const If=(e,t=void 0)=>{const n=window.localStorage.getItem(e),r=ce(t);if(n)try{r.value=JSON.parse(n)}catch{r.value=n}return St(()=>p(r),(o,i)=>{o!==i&&(o!==void 0?window.localStorage.setItem(e,typeof o=="string"?o:JSON.stringify(o)):window.localStorage.removeItem(e))},{deep:!0}),r},si=()=>{const e=st(),t=B(()=>{var f;return(f=e.options.embed)==null?void 0:f.enabled}),n=B(()=>{var f;return((f=e.options.embed)==null?void 0:f.target)==="location"}),r=B(()=>{var f;return(f=e.options.embed)==null?void 0:f.chooseFileName}),o=B(()=>{var f;return(f=e.options.embed)==null?void 0:f.chooseFileNameSuggestion}),i=B(()=>{var f;return((f=e.options.embed)==null?void 0:f.target)==="file"}),s=B(()=>{var f;return(f=e.options.embed)==null?void 0:f.fileTypes}),a=B(()=>{var f;return(f=e.options.embed)==null?void 0:f.messagesOrigin}),c=B(()=>{var f;return p(t)&&((f=e.options.embed)==null?void 0:f.delegateAuthentication)}),u=B(()=>{var f;return(f=e.options.embed)==null?void 0:f.delegateAuthenticationOrigin});return{isEnabled:t,isLocationPicker:n,chooseFileName:r,chooseFileNameSuggestion:o,isFilePicker:i,messagesTargetOrigin:a,isDelegatingAuthentication:c,fileTypes:s,postMessage:(f,m)=>{const w={};p(a)&&(w.targetOrigin=p(a)),window.parent.postMessage({name:f,data:m},w)},verifyDelegatedAuthenticationOrigin:f=>p(u)?p(u)===f:!0}},Ob=e=>{const{isEnabled:t}=si(),n=(e==null?void 0:e.bus)||Ke,r=If("oc_sideBarOpen",!1),o=ce(!1),i=B({get(){return p(t)?p(o):p(r)},set(w){if(p(t)){o.value=w;return}r.value=w}}),s=async()=>{await In();const w=document.getElementById("app-sidebar");w&&w.focus()},a=ce(null),c=n.subscribe(Tt.toggle,()=>{i.value=!p(i),p(i)&&s()}),u=n.subscribe(Tt.close,()=>{i.value=!1,a.value=null}),l=n.subscribe(Tt.open,()=>{i.value=!0,a.value=null,s()}),d=n.subscribe(Tt.openWithPanel,w=>{i.value=!0,a.value=w,s()}),f=n.subscribe(Tt.setActivePanel,w=>{a.value=w});Vn(()=>{n.unsubscribe(Tt.toggle,c),n.unsubscribe(Tt.close,u),n.unsubscribe(Tt.open,l),n.unsubscribe(Tt.openWithPanel,d),n.unsubscribe(Tt.setActivePanel,f)});const m=(w,y)=>{n.subscribe(Tt.setActivePanel,E=>{w===E&&setTimeout(()=>{y(E)},100)})};return{isSideBarOpen:dr(i),sideBarActivePanel:dr(a),onPanelActive:m}},Rn=e=>e,kb=e=>Z.ShareTypes.containsAnyValue(Z.ShareTypes.authenticated,e??[]),xb=e=>Z.ShareTypes.containsAnyValue(Z.ShareTypes.unauthenticated,e??[]),CP=({isDirect:e})=>Rn(e?"This item is directly shared with others.":"This item is shared with others through one of the parent folders."),PP=({isDirect:e})=>Rn(e?"This item is directly shared via links.":"This item is shared via links through one of the parent folders."),FP=({resource:e,isDirect:t})=>({id:`files-sharing-${e.getDomSelector()}`,accessibleDescription:CP({isDirect:t}),label:Rn("Show invited people"),icon:"group",category:"sharing",type:t?"user-direct":"user-indirect",fillType:"line",handler:()=>{Ke.publish(Tt.openWithPanel,"sharing#peopleShares")}}),OP=({resource:e,isDirect:t})=>({id:`file-link-${e.getDomSelector()}`,accessibleDescription:PP({isDirect:t}),label:Rn("Show links"),icon:"link",category:"sharing",type:t?"link-direct":"link-indirect",fillType:"line",handler:()=>{Ke.publish(Tt.openWithPanel,"sharing#linkShares")}}),kP=({resource:e})=>({id:`resource-locked-${e.getDomSelector()}`,accessibleDescription:Rn("Item locked"),label:Rn("This item is locked"),icon:"lock",category:"system",type:"resource-locked",fillType:"line"}),xP=({resource:e})=>({id:`resource-processing-${e.getDomSelector()}`,accessibleDescription:Rn("Item in processing"),label:Rn("This item is in processing"),icon:"loop-right",category:"system",type:"resource-processing",fillType:"line"}),NP=({resource:e})=>({id:`resource-space-enabled-${e.getDomSelector()}`,accessibleDescription:Rn("Space is enabled"),label:Rn("This space is enabled"),icon:"play-circle",category:"space",type:"resource-space-enabled",fillType:"line"}),$P=({resource:e})=>({id:`resource-space-disabled-${e.getDomSelector()}`,accessibleDescription:Rn("Space is disabled"),label:Rn("This space is disabled"),icon:"stop-circle",category:"space",type:"resource-space-disabled",fillType:"line"}),Nb=({space:e,resource:t,ancestorMetaData:n,user:r})=>{const o=[];if(t.locked&&o.push(kP({resource:t})),t.processing&&o.push(xP({resource:t})),Z.isProjectSpaceResource(t)&&!t.disabled&&o.push(NP({resource:t})),Z.isProjectSpaceResource(t)&&t.disabled&&o.push($P({resource:t})),Z.isProjectSpaceResource(e)||Z.isPersonalSpaceResource(e)&&e.isOwner(r)){const s=Object.values(n).reduce((u,l)=>(u.push(...l.shareTypes||[]),u),[]),a=kb(t.shareTypes);(a||kb(s))&&o.push(FP({resource:t,isDirect:a}));const c=xb(t.shareTypes);(c||xb(s))&&o.push(OP({resource:t,isDirect:c}))}return o},$b=e=>new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=o=>n(o),r.readAsArrayBuffer(e)}),Db=e=>new Promise(t=>e.toBlob(t)),Ks=()=>window.navigator.platform.match("Mac"),tt=Ue.defineStore("messages",()=>{const e=ce([]),t=i=>{const s={...i,id:en.v4()};return e.value.push(s),s},n=i=>{const s=a=>{var c,u;return(u=(c=a.response)==null?void 0:c.headers)==null?void 0:u.get("x-request-id")};return i.map(a=>s(a)).filter(Boolean).map(a=>`X-Request-Id: ${a}`).join(`\r
51
+ `)};return{messages:e,showMessage:t,showErrorMessage:i=>{const s={id:en.v4(),status:"danger",timeout:0,...i.errors&&{errorLogContent:n(i.errors)},...i};return e.value.push(s),s},removeMessage:i=>{e.value=p(e).filter(({id:s})=>i.id!==s)}}}),Ro=Ue.defineStore("clipboard",()=>{const{$gettext:e}=Fe.useGettext(),{showMessage:t}=tt(),n=ce(),r=ce([]);return{action:n,resources:r,copyResources:a=>{a[0].canDownload()&&(n.value=ii.Copy,r.value=a,t({title:e("Copied to clipboard!"),status:"success"}))},cutResources:a=>{a[0].canDownload()&&(n.value=ii.Cut,r.value=a,t({title:e("Cut to clipboard!"),status:"success"}))},clearClipboard:()=>{n.value=void 0,r.value=[]}}}),Lb={cernFeatures:!1,concurrentRequests:{resourceBatchActions:4,shares:{create:4,list:2},sse:4,avatars:4},contextHelpers:!0,contextHelpersReadMore:!0,defaultExtension:"files",disabledExtensions:[],disableFeedbackLink:!0,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},st=Ue.defineStore("config",()=>{const e=or(),t=ce(""),n=ce(""),r=ce({...Lb}),o=ce([]),i=ce([]),s=ce([]),a=ce(),c=ce(),u=ce(),l=ce([]),d=ce([]),f=B(()=>Z.urlJoin(p(t)||window.location.origin,{trailingSlash:!0})),m=B(()=>!!p(a)),w=B(()=>!!p(c));return{options:r,oAuth2:a,openIdConnect:c,isOAuth2:m,isOIDC:w,customTranslations:s,apps:o,externalApps:i,sentry:u,theme:n,scripts:l,styles:d,serverUrl:f,loadConfig:E=>{var b;E.server&&(t.value=(b=E.server)!=null&&b.endsWith("/")?E.server:E.server+"/"),o.value=E.apps||[],s.value=E.customTranslations||[],a.value=E.auth,c.value=E.openIdConnect,u.value=E.sentry,l.value=E.scripts||[],d.value=E.styles||[],n.value=E.theme,E.options&&(r.value=uo({...Lb},E.options),p(r).ocm.openRemotely=p(r).cernFeatures,p(r).routing.idBased=!p(r).cernFeatures,p(r).routing.fullShareOwnerPaths=p(r).cernFeatures),E.external_apps&&(i.value=E.external_apps,E.external_apps.filter(Boolean).forEach(g=>{e.loadExternalAppConfig({appId:g.id,config:g.config})}))}}}),DP=me.z.object({url:me.z.string()}),LP=me.z.object({apiUrl:me.z.string().optional(),authUrl:me.z.string().optional(),clientId:me.z.string().optional(),clientSecret:me.z.string().optional(),logoutUrl:me.z.string().optional(),metaDataUrl:me.z.string().optional(),url:me.z.string().optional()}),MP=me.z.object({authority:me.z.string().optional(),client_id:me.z.string().optional(),client_secret:me.z.string().optional(),dynamic:me.z.string().optional(),metadata_url:me.z.string().optional(),post_logout_redirect_uri:me.z.string().optional(),response_type:me.z.string().optional(),scope:me.z.string().optional()}).passthrough(),BP=me.z.record(me.z.any(),me.z.any()),jP=me.z.object({href:me.z.string().optional()}),UP=me.z.object({async:me.z.boolean().optional(),src:me.z.string().optional()}),qP=me.z.object({cernFeatures:me.z.boolean().optional(),concurrentRequests:me.z.object({resourceBatchActions:me.z.number().optional(),sse:me.z.number().optional(),shares:me.z.object({create:me.z.number().optional(),list:me.z.number().optional()}).optional(),avatars:me.z.number().optional()}).optional(),contextHelpers:me.z.boolean().optional(),contextHelpersReadMore:me.z.boolean().optional(),defaultExtension:me.z.string().optional(),disabledExtensions:me.z.array(me.z.string()).optional(),disableFeedbackLink:me.z.boolean().optional(),accountEditLink:me.z.object({href:me.z.string().optional()}).optional(),editor:me.z.object({autosaveEnabled:me.z.boolean().optional(),autosaveInterval:me.z.number().optional(),openAsPreview:me.z.union([me.z.boolean(),me.z.array(me.z.string())]).optional()}).optional(),embed:me.z.object({enabled:me.z.boolean().optional(),target:me.z.string().optional(),messagesOrigin:me.z.string().optional(),delegateAuthentication:me.z.boolean().optional(),delegateAuthenticationOrigin:me.z.string().optional(),fileTypes:me.z.array(me.z.string()).optional(),chooseFileName:me.z.boolean().optional(),chooseFileNameSuggestion:me.z.string().optional()}).optional(),feedbackLink:me.z.object({ariaLabel:me.z.string().optional(),description:me.z.string().optional(),href:me.z.string().optional()}).optional(),isRunningOnEos:me.z.boolean().optional(),loginUrl:me.z.string().optional(),logoutUrl:me.z.string().optional(),ocm:me.z.object({openRemotely:me.z.boolean().optional()}).optional(),routing:me.z.object({fullShareOwnerPaths:me.z.boolean().optional(),idBased:me.z.boolean().optional()}).optional(),runningOnEos:me.z.boolean().optional(),tokenStorageLocal:me.z.boolean().optional(),upload:me.z.object({companionUrl:me.z.string().optional()}).optional(),userListRequiresFilter:me.z.boolean().optional(),hideLogo:me.z.boolean().optional()}),VP=me.z.object({id:me.z.string(),path:me.z.string(),config:me.z.record(me.z.string(),me.z.unknown()).optional()}),zP=me.z.object({server:me.z.string(),theme:me.z.string(),options:qP,apps:me.z.array(me.z.string()).optional(),external_apps:me.z.array(VP).optional(),customTranslations:me.z.array(DP).optional(),auth:LP.optional(),openIdConnect:MP.optional(),sentry:BP.optional(),scripts:me.z.array(UP).optional(),styles:me.z.array(jP).optional()}),Mb=Ue.defineStore("extensionPreferences",()=>{const e=Vr.useLocalStorage("extensionPreferences",{});return{extensionPreferences:e,extractDefaultExtensionIds:(o,i)=>o.multiple?i.map(s=>s.id):o.defaultExtensionId?[o.defaultExtensionId]:[],getExtensionPreference:(o,i)=>{const s=e.value[o];return s||{extensionPointId:o,selectedExtensionIds:i}},setSelectedExtensionIds:(o,i)=>{if(!Object.hasOwn(p(e),o)){e.value[o]={extensionPointId:o,selectedExtensionIds:i};return}e.value[o].selectedExtensionIds=i}}}),Bi=Ue.defineStore("extensionRegistry",()=>{const e=st(),t=ce([]),n=u=>{t.value.push(u)},r=u=>{t.value=p(t).map(l=>ce(p(l).filter(({id:d})=>!u.includes(d)))).filter(l=>p(l).length)},o=u=>{if(!u.id||!u.extensionType)throw new Error("ExtensionPoint must have an id and an extensionType");return p(t).flatMap(l=>p(l).filter(d=>{var f;return d.type===u.extensionType&&!e.options.disabledExtensions.includes(d.id)&&(!d.extensionPointIds||((f=d.extensionPointIds)==null?void 0:f.includes(u.id)))}))},i=ce([]);return{extensions:t,registerExtensions:n,unregisterExtensions:r,requestExtensions:o,extensionPoints:i,registerExtensionPoints:u=>{i.value.push(u)},unregisterExtensionPoints:u=>{i.value=p(i).map(l=>ce(p(l).filter(({id:d})=>!u.includes(d)))).filter(l=>p(l).length)},getExtensionPoints:(u={})=>p(i).flatMap(l=>p(l).filter(d=>!(Object.hasOwn(u,"extensionType")&&d.extensionType!==u.extensionType)))}}),pt=Ue.defineStore("modals",()=>{const e=ce([]),t=B(()=>p(e).at(-1)),n=c=>p(e).find(u=>u.id===c);return{modals:e,activeModal:t,dispatchModal:c=>{const u={...c,id:en.v4()};return e.value.push(u),u},updateModal:(c,u,l)=>{const d=n(c);d[u]=l},removeModal:c=>{e.value=p(e).filter(u=>u.id!==c)},removeAllModals:()=>{e.value=[]},setModalActive:c=>{const u=p(e).findIndex(d=>d.id===c);if(u<0)return;const l=n(c);p(e).splice(u,1),e.value.push(l)}}}),yt=Ue.defineStore("user",()=>{const e=ce();return{user:e,setUser:r=>{e.value=r,rw.setUser({username:r.onPremisesSamAccountName})},reset:()=>{e.value=null}}}),Qs=(e,t)=>{t!==void 0&&document.querySelector(":root").style.setProperty("--oc-"+e,t)},WP="thead-clicked",HP="highlight",GP="rowMounted",KP="contextmenuClicked",Bb="itemDropped",QP="itemDragged",XP=["xsmall","small","medium","large","xlarge","xxlarge","xxxlarge"];let YP="";const JP=()=>YP,ZP={xxxsmall:"xxxs",xxsmall:"xxs",xsmall:"xs",small:"s",medium:"m",large:"l",xlarge:"xl",xxlarge:"xxl",xxxlarge:"xxxl",remove:"rm"};function Mr(e){return ZP[e]}let jb=0;const Xs=(e="")=>(e=e||"",jb+=1,e+jb);function eF(e,t,n,r){for(var o=-1,i=e==null?0:e.length;++o<i;)n=t(n,e[o],o,e);return n}function tF(e){return function(t){return e==null?void 0:e[t]}}var nF={À:"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"},rF=tF(nF),iF=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,oF="\\u0300-\\u036f",sF="\\ufe20-\\ufe2f",aF="\\u20d0-\\u20ff",lF=oF+sF+aF,cF="["+lF+"]",uF=RegExp(cF,"g");function fF(e){return e=Ll(e),e&&e.replace(iF,rF).replace(uF,"")}var dF=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function pF(e){return e.match(dF)||[]}var hF=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function gF(e){return hF.test(e)}var Ub="\\ud800-\\udfff",mF="\\u0300-\\u036f",yF="\\ufe20-\\ufe2f",bF="\\u20d0-\\u20ff",vF=mF+yF+bF,qb="\\u2700-\\u27bf",Vb="a-z\\xdf-\\xf6\\xf8-\\xff",wF="\\xac\\xb1\\xd7\\xf7",SF="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",EF="\\u2000-\\u206f",TF=" \\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",zb="A-Z\\xc0-\\xd6\\xd8-\\xde",AF="\\ufe0e\\ufe0f",Wb=wF+SF+EF+TF,Hb="['’]",Gb="["+Wb+"]",RF="["+vF+"]",Kb="\\d+",_F="["+qb+"]",Qb="["+Vb+"]",Xb="[^"+Ub+Wb+Kb+qb+Vb+zb+"]",IF="\\ud83c[\\udffb-\\udfff]",CF="(?:"+RF+"|"+IF+")",PF="[^"+Ub+"]",Yb="(?:\\ud83c[\\udde6-\\uddff]){2}",Jb="[\\ud800-\\udbff][\\udc00-\\udfff]",ji="["+zb+"]",FF="\\u200d",Zb="(?:"+Qb+"|"+Xb+")",OF="(?:"+ji+"|"+Xb+")",ev="(?:"+Hb+"(?:d|ll|m|re|s|t|ve))?",tv="(?:"+Hb+"(?:D|LL|M|RE|S|T|VE))?",nv=CF+"?",rv="["+AF+"]?",kF="(?:"+FF+"(?:"+[PF,Yb,Jb].join("|")+")"+rv+nv+")*",xF="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",NF="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",$F=rv+nv+kF,DF="(?:"+[_F,Yb,Jb].join("|")+")"+$F,LF=RegExp([ji+"?"+Qb+"+"+ev+"(?="+[Gb,ji,"$"].join("|")+")",OF+"+"+tv+"(?="+[Gb,ji+Zb,"$"].join("|")+")",ji+"?"+Zb+"+"+ev,ji+"+"+tv,NF,xF,Kb,DF].join("|"),"g");function MF(e){return e.match(LF)||[]}function BF(e,t,n){return e=Ll(e),t=t,t===void 0?gF(e)?MF(e):pF(e):e.match(t)||[]}var jF="['’]",UF=RegExp(jF,"g");function qF(e){return function(t){return eF(BF(fF(t).replace(UF,"")),e,"")}}var iv=qF(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const ov=me.z.object({name:me.z.string().optional(),slogan:me.z.string().optional(),logo:me.z.string().optional(),urls:me.z.object({accessDeniedHelp:me.z.string().optional(),imprint:me.z.string().optional(),privacy:me.z.string().optional(),accessibility:me.z.string().optional()}).optional(),shareRoles:me.z.record(me.z.string(),me.z.object({iconName:me.z.string()})).optional()}),VF=me.z.object({breakpoints:me.z.record(me.z.string(),me.z.string()).optional(),roles:me.z.record(me.z.string(),me.z.string()).optional(),colorPalette:me.z.record(me.z.string(),me.z.string()).optional(),fontFamily:me.z.string().optional(),fontSizes:me.z.record(me.z.string(),me.z.string()).optional(),sizes:me.z.record(me.z.string(),me.z.string()).optional(),spacing:me.z.record(me.z.string(),me.z.string()).optional()}),sv=ov.extend({designTokens:VF.optional(),favicon:me.z.string().optional(),background:me.z.string().optional()}),zF=sv.extend({isDark:me.z.boolean(),label:me.z.string()}),av=me.z.object({defaults:sv,themes:me.z.array(zF)}),WF=me.z.object({common:ov.optional(),clients:me.z.object({web:av})}),HF="oc_currentThemeName",ai=Ue.defineStore("theme",()=>{const e=Vr.useLocalStorage(HF,null),t=Vr.usePreferredDark(),n=ce(),r=ce([]),o=l=>{const d=l.common,f=l.clients.web.defaults,m=hd(d,f);r.value=l.clients.web.themes.map(w=>hd(m,w)),i()},i=()=>{const l=p(r).find(f=>!f.isDark),d=p(r).find(f=>f.isDark);c(p(r).find(f=>f.label===p(e))||(p(t)?d:l)||p(r)[0],!1)},s=()=>{e.value=null,i()},a=B(()=>e.value===null),c=(l,d=!0)=>{var m,w,y,E,b,g;n.value=l,d&&(e.value=p(n).label);const f=[{name:"breakpoints",prefix:"breakpoint"},{name:"roles",prefix:"role"},{name:"colorPalette",prefix:"color"},{name:"fontSizes",prefix:"font-size"},{name:"sizes",prefix:"size"},{name:"spacing",prefix:"spacing"}];Qs("font-family",p(n).designTokens.fontFamily),f.forEach(v=>{for(const h in p(n).designTokens[v.name])Qs(`${v.prefix}-${iv(h)}`,p(n).designTokens[v.name][h])}),(w=(m=p(n).designTokens)==null?void 0:m.roles)!=null&&w.chrome||(Qs("role-chrome",(E=(y=p(n).designTokens)==null?void 0:y.roles)==null?void 0:E.surfaceContainer),Qs("role-on-chrome",(g=(b=p(n).designTokens)==null?void 0:b.roles)==null?void 0:g.onSurface))};return{availableThemes:r,currentTheme:n,initializeThemes:o,setAndApplyTheme:c,setAutoSystemTheme:s,isCurrentThemeAutoSystem:a,getRoleIcon:l=>{var d;return((d=p(n).shareRoles[l.id])==null?void 0:d.iconName)||"user"}}}),Tr=Ue.defineStore("shares",()=>{const e=Qe(),{getRoleIcon:t}=ai(),n=ce(!1),r=ce([]),o=ce([]),i=ce({}),s=_=>{i.value=_.reduce((A,$)=>(A[$.id]={...$,icon:t($)},A),{})},a=_=>{const A=p(r).find(({id:$})=>$===_.id);if(A){Object.assign(A,_);return}p(r).push(_)},c=_=>{r.value=_},u=_=>{p(r).push(..._)},l=_=>{r.value=p(r).filter(({id:A})=>A!==_.id)},d=()=>{r.value=[],o.value=[],n.value=void 0},f=()=>{const _=Object.values(e.ancestorMetaData).map(({id:A})=>A);if(!_.length){r.value=[],o.value=[];return}p(r).forEach(A=>{_.includes(A.resourceId)||l(A)}),p(o).forEach(A=>{_.includes(A.resourceId)||y(A)})},m=_=>{o.value=_},w=_=>{const A=p(o).find(({id:$})=>$===_.id);if(A){Object.assign(A,_);return}p(o).push(_)},y=_=>{o.value=p(o).filter(({id:A})=>A!==_.id)},E=_=>{n.value=_},b=_=>{const A=x=>{const W=new Set;return x.forEach(K=>{W.add(K.shareType)}),Array.from(W)},$=[...e.resources,e.currentFolder].find(x=>(x==null?void 0:x.id)===_);if(!$||Z.isProjectSpaceResource($))return;const D=[...p(r),...p(o)];e.updateResourceField({id:$.id,field:"shareTypes",value:A(D.filter(x=>!x.indirect))});const N=e.getAncestorById(_);N&&e.updateAncestorField({path:N.path,field:"shareTypes",value:A(D.filter(x=>!x.indirect))})};return{loading:n,collaboratorShares:r,linkShares:o,graphRoles:i,setGraphRoles:s,setLoading:E,setCollaboratorShares:c,setLinkShares:m,removeOrphanedShares:f,pruneShares:d,addShare:async({clientService:_,space:A,resource:$,options:D})=>{const x=await _.graphAuthenticated.permissions.createInvite(A.id,$.id,D,p(i));return u([x]),b($.id),x},updateShare:async({clientService:_,space:A,resource:$,collaboratorShare:D,options:N})=>{const x=_.graphAuthenticated.permissions,W={roles:N.roles,expirationDateTime:N.expirationDateTime},K=await x.updatePermission(A.id,$.id,D.id,W,p(i));return a(K),K},deleteShare:async({clientService:_,space:A,resource:$,collaboratorShare:D})=>{await _.graphAuthenticated.permissions.deletePermission(A.id,$.id,D.id),l(D),b($.id)},addLink:async({clientService:_,space:A,resource:$,options:D})=>{const x=await _.graphAuthenticated.permissions.createLink(A.id,$.id,D),W=e.selectedResources,K=W.some(({fileId:le})=>le===$.fileId)||W.length===0&&e.currentFolder.fileId===$.fileId;if(w(x),b($.id),!K){const le=e.ancestorMetaData[$.path]??null;if(le){const{shareTypes:be}=le;be.includes(Z.ShareTypes.link.value)||e.updateAncestorField({path:le.path,field:"shareTypes",value:[...be,Z.ShareTypes.link.value]})}}return x},updateLink:async({clientService:_,space:A,resource:$,linkShare:D,options:N})=>{const x=_.graphAuthenticated.permissions;let W;if(Object.hasOwn(N,"password"))W=await x.setPermissionPassword(A.id,$.id,D.id,{password:N.password}),D.hasPassword=!!N.password;else{const K={link:{...N.type&&{type:N.type},...N.displayName&&{"@libre.graph.displayName":N.displayName}},...Object.hasOwn(N,"expirationDateTime")&&{expirationDateTime:N.expirationDateTime}};W=await x.updatePermission(A.id,$.id,D.id,K)}return w(W),W},deleteLink:async({clientService:_,space:A,resource:$,linkShare:D})=>{await _.graphAuthenticated.permissions.deletePermission(A.id,$.id,D.id),y(D),b($.id)}}}),wn={Internal:"internal",View:"view",Upload:"upload",Edit:"edit",CreateOnly:"createOnly"},lv={LibreGraphPermissionsActionsAllowedValues:"@libre.graph.permissions.actions.allowedValues",LibreGraphPermissionsRolesAllowedValues:"@libre.graph.permissions.roles.allowedValues"},cv=e=>e.sort((t,n)=>n.permissions.length-t.permissions.length),_o=async({graphClient:e,driveType:t,configStore:n,signal:r})=>{var a;const o=await e.drives.listMyDrives({orderBy:"name asc",filter:`driveType eq ${t}`},{signal:r});if(!o.length)return[];if(t!=="mountpoint"||!((a=n.options.routing)!=null&&a.fullShareOwnerPaths))return o;const i={};o.forEach(c=>{const{rootId:u,driveAlias:l}=c.root.remoteItem;i[u]=l});const s=Object.entries(i).map(([c,u])=>Z.buildSpace({id:Z.extractStorageId(c),name:u,driveType:u.split("/")[0],driveAlias:u,path:"/",serverUrl:n.serverUrl}));return[...o,...s]},at=Ue.defineStore("spaces",()=>{const e=yt(),t=st(),n=Tr(),r=ce([]),o=ce(),i=ce(!1),s=ce(!1),a=ce(!1),c=ce(null),u=ce([]),l=ce([]),d=B(()=>p(r).find(ue=>Z.isPersonalSpaceResource(ue)&&ue.isOwner(e.user))),f=ue=>{i.value=ue},m=ue=>{s.value=ue},w=ue=>{a.value=ue},y=ue=>{o.value=ue},E=ue=>{c.value=ue},b=ue=>{if(!Z.isProjectSpaceResource(ue))return[];const ie=n.collaboratorShares.filter(G=>G.resourceId===ue.id);return cv(ie)},g=ue=>{p(r).push(...ue)},v=ue=>{r.value=p(r).filter(({id:ie})=>ie!==ue.id)},h=ue=>p(r).find(ie=>ue==ie.id),S=async({graphClient:ue,space:ie,signal:G})=>(await $({graphClient:ue,signal:G}),p(r).find(re=>{var se,Ie;return Z.isMountPointSpaceResource(re)&&((Ie=(se=re.root)==null?void 0:se.remoteItem)==null?void 0:Ie.id)===ie.id})),T=({driveAliasPrefix:ue,id:ie,shareName:G})=>{const re=Z.buildShareSpaceResource({driveAliasPrefix:ue,id:ie,shareName:G,serverUrl:t.serverUrl});return g([re]),re},R=ue=>{const ie=p(r).find(({id:G})=>G===ue.id);if(ie){Object.assign(ie,ue);return}g([ue])},_=({id:ue,field:ie,value:G})=>{const re=p(r).find(se=>ue===se.id);re&&(re[ie]=G)},A=async({graphClient:ue})=>{a.value=!0;try{const[ie,G]=await Promise.all([_o({graphClient:ue,driveType:"personal",configStore:t}),_o({graphClient:ue,driveType:"project",configStore:t})]);g([...ie,...G]),i.value=!0}finally{a.value=!1}},$=async({graphClient:ue,signal:ie})=>{if(!p(s))try{const G=await _o({graphClient:ue,driveType:"mountpoint",configStore:t,signal:ie});g(G)}finally{s.value=!0}},D=async({graphClient:ue,signal:ie})=>{const G=await _o({graphClient:ue,driveType:"project",configStore:t,signal:ie});r.value=p(r).filter(re=>!Z.isProjectSpaceResource(re)),g(G)},N=ue=>{p(u).includes(ue)||p(u).push(ue)},x=ue=>{u.value=p(u).filter(ie=>ie!==ue)},W=()=>{u.value=[]},K=ue=>{p(l).includes(ue)||p(l).push(ue)},le=ue=>{l.value=p(l).filter(ie=>ie!==ue)},be=()=>{l.value=[]},te=ce({});return{spaces:r,spacesInitialized:i,mountPointsInitialized:s,spacesLoading:a,currentSpace:o,personalSpace:d,defaultSpaceImageBlobURL:c,imagesLoading:u,readmesLoading:l,getSpace:h,createShareSpace:T,setSpacesInitialized:f,setMountPointsInitialized:m,setSpacesLoading:w,setCurrentSpace:y,setDefaultSpaceImageBlobURL:E,getSpaceMembers:b,getMountPointForSpace:S,addSpaces:g,removeSpace:v,upsertSpace:R,updateSpaceField:_,loadSpaces:A,loadMountPoints:$,reloadProjectSpaces:D,addToImagesLoading:N,removeFromImagesLoading:x,purgeImagesLoading:W,addToReadmesLoading:K,removeFromReadmesLoading:le,purgeReadmesLoading:be,loadGraphPermissions:async({ids:ue,graphClient:ie,useCache:G=!0})=>{const re=p(r).filter(se=>ue.includes(se.id)&&(se.graphPermissions===void 0||!G));if(re.length){for(const{id:se,disabled:Ie}of re){if(Ie){_({id:se,field:"graphPermissions",value:[]});continue}p(te)[se]||(te.value[se]=ie.permissions.listPermissions(se,se,n.graphRoles,{select:[lv.LibreGraphPermissionsActionsAllowedValues]}).then(({allowedActions:ee})=>{_({id:se,field:"graphPermissions",value:ee}),delete te.value[se]}))}await Promise.all(Object.values(p(te)))}}}}),Qe=Ue.defineStore("resources",()=>{const e=st(),t=at(),n=yt(),r=ce([]),o=ce(),i=ce({}),s=ce([]),a=B(()=>{let C=p(r);return p(N)||(C=C.filter(z=>!z.name.startsWith("."))),C}),c=B(()=>{const C=p(r).filter(({type:de})=>de==="file").length,z=p(r).filter(({type:de,name:Te})=>de==="file"&&Te.startsWith(".")).length,q=p(r).filter(({type:de})=>de==="folder").length,M=p(r).filter(({type:de,name:Te})=>de==="folder"&&Te.startsWith(".")).length,V=p(r).filter(Z.isProjectSpaceResource).length;return{files:C,hiddenFiles:z,folders:q,hiddenFolders:M,spaces:V}}),u=C=>{r.value=C},l=C=>{r.value=p(r).filter(z=>!C.find(({id:q})=>q===z.id))},d=()=>{r.value=[]},f=C=>{const z=p(r).find(({id:q})=>q===C.id);if(z){Object.assign(z,C);return}p(r).push(C)},m=C=>{const z=p(r).filter(q=>!C.some(M=>M.path===q.path));r.value=[...z,...C]},w=({id:C,field:z,value:q})=>{const M=p(r).find(V=>C===V.id);M&&(M[z]=q)},y=C=>{o.value=C},E=()=>{o.value=void 0},b=C=>{r.value=C.resources,o.value=C.currentFolder},g=()=>{r.value=[],o.value=void 0,v.value=[]},v=ce([]),h=ce(null),S=B(()=>p(r).filter(C=>p(v).includes(C.id))),T=C=>{const z=C.find(q=>!p(v).includes(q));z&&(h.value=z),v.value=C},R=C=>{h.value=C,p(v).includes(C)||p(v).push(C)},_=C=>{h.value=C,p(v).includes(C)&&(v.value=p(v).filter(z=>z!==C))},A=C=>{p(v).includes(C)?_(C):R(C)},$=()=>{v.value=[]},D=C=>{h.value=C},N=ce(!0),x=ce(!0),W=ce(!1),K=ce(!0),le=ce(!0),be=C=>{N.value=C,window.localStorage.setItem("oc_hiddenFilesShown",C.toString())},te=C=>{x.value=C,window.localStorage.setItem("oc_fileExtensionsShown",C.toString())},ae=C=>{W.value=C,window.localStorage.setItem("oc_webDavDetailsShown",C.toString())},ue=C=>{K.value=C,window.localStorage.setItem("oc_disabledSpacesShown",C.toString())},ie=C=>{le.value=C,window.localStorage.setItem("oc_emptyTrashesShown",C.toString())},G=C=>{i.value=C};return{resources:r,currentFolder:o,activeResources:a,totalResourcesCount:c,setResources:u,removeResources:l,clearResources:d,upsertResource:f,upsertResources:m,updateResourceField:w,setCurrentFolder:y,clearCurrentFolder:E,initResourceList:b,clearResourceList:g,selectedIds:v,latestSelectedId:h,selectedResources:S,setSelection:T,addSelection:R,removeSelection:_,toggleSelection:A,resetSelection:$,setLastSelectedId:D,areHiddenFilesShown:N,areFileExtensionsShown:x,areWebDavDetailsShown:W,areDisabledSpacesShown:K,areEmptyTrashesShown:le,setAreHiddenFilesShown:be,setAreFileExtensionsShown:te,setAreWebDavDetailsShown:ae,setAreDisabledSpacesShown:ue,setAreEmptyTrashesShown:ie,ancestorMetaData:i,setAncestorMetaData:G,updateAncestorField:({path:C,field:z,value:q})=>{const M=p(i)[C]??null;M&&(M[z]=q)},loadAncestorMetaData:({folder:C,space:z,client:q,signal:M})=>{const V={[C.path]:{id:C.fileId,shareTypes:C.shareTypes,parentFolderId:C.parentFolderId,spaceId:z.id,path:C.path}},de=[],Te=[je.FileId,je.ShareTypes,je.FileParent],Le=Fb(C.path),ke=t.spaces,$e=()=>ke.filter(Y=>Z.isMountPointSpaceResource(Y)&&Z.extractStorageId(Y.root.remoteItem.rootId)===z.id);let Me=!0;if(e.options.routing.fullShareOwnerPaths){const Y=ke.some(Pe=>Z.isProjectSpaceResource(Pe)&&Pe.id===z.id);Me=z.isOwner(n.user)||Y}for(const Y of Le){const Pe=p(i)[Y]??null;if((Pe==null?void 0:Pe.spaceId)===z.id){V[Y]=Pe;continue}if(!Me&&!$e().find(Ne=>Y.startsWith(Ne.root.remoteItem.path)))break;de.push(q.listFiles(z,{path:Y},{depth:0,davProperties:Te,signal:M}).then(({resource:Ne})=>{V[Y]={id:Ne.fileId,shareTypes:Ne.shareTypes,parentFolderId:Ne.parentFolderId,spaceId:z.id,path:Y}}))}return Promise.all(de).then(()=>{if(!Object.keys(V).includes("/")){const Y=p(i)["/"];if((Y==null?void 0:Y.spaceId)===z.id)V["/"]=Y;else{const{parentFolderId:Pe}=Object.values(V)[0],Ne=t.spaces.find(({id:Ve})=>Pe.startsWith(Ve));Ne&&(V["/"]={id:Ne.id,shareTypes:Ne.shareTypes,parentFolderId:Ne.id,spaceId:Ne.id,path:"/"})}}G(V)})},getAncestorById:C=>Object.values(p(i)).find(z=>C===z.id),deleteQueue:s,addResourcesIntoDeleteQueue:C=>{s.value=s.value.concat(C.filter(z=>!p(s).includes(z)))},removeResourcesFromDeleteQueue:C=>{s.value=s.value.filter(z=>!C.includes(z))}}}),Io=Ue.defineStore("webWorkers",()=>{const e=ce([]);return{createWorker:(i,{needsTokenRenewal:s=!1}={})=>{const a=en.v4(),c=Vr.useWebWorker(i,{type:"module",name:a}),u={id:a,needsTokenRenewal:s,...c};return p(e).push(u),u},terminateWorker:i=>{const s=p(e).find(a=>i===a.id);s&&(s.terminate(),e.value=p(e).filter(a=>i!==a.id))},terminateAllWorkers:()=>{p(e).forEach(({terminate:i})=>{i()}),e.value=[]},updateAccessTokens:i=>{p(e).filter(({needsTokenRenewal:s})=>s).forEach(({post:s})=>{s(JSON.stringify({topic:"tokenUpdate",data:{accessToken:`Bearer ${i}`}}))})}}}),Ys=Ue.defineStore("avatars",()=>{const e=st(),t=ce({}),n=Dd(new Fr({concurrency:e.options.concurrentRequests.avatars}));return{avatarMap:t,getAvatar:c=>p(t)[c],addAvatar:(c,u)=>{t.value[c]=u},removeAvatar:c=>{t.value[c]=null},reset:()=>{t.value={}},avatarsQueue:n,pendingAvatarsRequests:new Map}}),Js=(e={})=>{const t=e.router||He(),n=e.configStore||st();return{replaceInvalidFileRoute:({space:o,resource:i,path:s,fileId:a})=>{var u;if(!((u=n.options.routing)!=null&&u.idBased)||s===i.path&&a===i.fileId)return!1;const c=ir(o,i,{configStore:n});return t.replace(c),!0}}},Zs=()=>{const e=Kt();return B(()=>p(e).name)},uv=(e,t)=>{const n=Kt();return B(()=>p(n).meta[e]||t)},ea=(e,t)=>{const n=He();return B({get(){return Rt(p(n.currentRoute).params[e])||t},async set(r){p(n.currentRoute).params[e]!==r&&await n.replace({params:{...p(n.currentRoute).params,[e]:r}})}})};let fv=Promise.resolve();const an=(e,t)=>{const n=He();return B({get(){return p(n.currentRoute).query[e]||t},set(r){if(p(n.currentRoute).query[e]===r)return;fv=fv.then(async()=>{try{await n.replace({path:p(n.currentRoute).path,query:{...p(n.currentRoute).query,[e]:r}})}catch{}})}})},Ar=e=>{const t=an(e.name),n=If(GF(e));return St(()=>p(t)?{value:p(t),source:"route"}:p(n)?{value:p(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},GF=e=>["oc-options",e.storagePrefix,e.name].filter(Boolean).join("_"),Kn=(e,...t)=>{const n=ce(!1),r=He(),o=Kt();return St(o,()=>{n.value=e(r,...t)},{immediate:!0}),n},ta="contextRouteName",Cf="contextRouteParams",Pf="contextRouteQuery",na=e=>{var i;const{params:t,query:n}=e,r={},o=["fileId","shareId","q_share-visibility","page"].concat(((i=e.meta)==null?void 0:i.contextQueryItems)||[]);for(const s of o)r[s]=n[s];return{[ta]:e.name,[Cf]:t,[Pf]:r}},dv=e=>({routeName:Rt(e[ta]),routeParams:e[Cf],routeQuery:e[Pf]}),Rt=e=>Array.isArray(e)?e[0].toString():e==null?void 0:e.toString();function pv({router:e,currentFileContext:t}){const n=a=>{const{fileName:c,routeName:u,routeParams:l,routeQuery:d}=p(a);return p(u)?e.push({name:p(u),params:p(l),query:{...p(d),scrollTo:p(c)}}):e.push({path:"/"})},{replaceInvalidFileRoute:r}=Js({router:e}),o=(a,c)=>{const u=p(a);return r({space:p(u.space),resource:c,path:p(u.item),fileId:p(u.itemId)})},i=ce(!1);return{replaceInvalidFileRoute:o,closeApp:()=>(i.value=!0,n(t)),closed:i}}const Ge=()=>vr("$clientService");function Ff({clientService:e}){e=e||Ge();const t=sn(),n=yt();return{getUrlForResource:(c,u,l)=>{var d;return e.webdav.getFileUrl(c,u,{isUrlSigningEnabled:t.supportUrlSigning,username:(d=n.user)==null?void 0:d.onPremisesSamAccountName,...l})},revokeUrl:c=>e.webdav.revokeUrl(c),getFileContents:(c,u)=>e.webdav.getFileContents(p(p(c).space),{path:p(p(c).item)},{...u}),getFileInfo:(c,u={})=>e.webdav.getFileInfo(p(p(c).space),{path:p(p(c).item),fileId:p(p(c).itemId)},u),putFileContents:(c,u)=>e.webdav.putFileContents(p(p(c).space),{path:p(p(c).item),...u})}}const Of=()=>vr("$authService");class Rr{}Ee(Rr,"allFiles","all-files"),Ee(Rr,"currentFolder","current-folder");const kf=()=>{const e=st(),t=Ge(),n=at(),r=Qe(),o=sn(),i=B(()=>{var f;return(f=o.searchContent)==null?void 0:f.enabled}),s=B(()=>r.areHiddenFilesShown),a=B(()=>n.spaces.filter(Z.isProjectSpaceResource)),c=f=>p(a).find(m=>m.id===f),u=pn.useTask(function*(f,m,w=null){if(e.options.routing.fullShareOwnerPaths&&(yield n.loadMountPoints({graphClient:t.graphAuthenticated,signal:f})),!m)return{totalResults:null,values:[]};const{resources:y,totalResults:E}=yield*Z.call(t.webdav.search(m,{searchLimit:w,davProperties:As.Default,signal:f}));return{totalResults:E,values:y.map(b=>{const g=c(b.parentFolderId),v=g||b;return e.options.routing.fullShareOwnerPaths&&v.remoteItemPath&&(v.path=Z.urlJoin(v.remoteItemPath,v.path)),{id:v.id,data:v}}).filter(({data:b})=>!b.name.startsWith(".")||p(s))}}).restartable();return{search:async(f,m=null)=>await u.perform(f,m),buildSearchTerm:({term:f,isTitleOnlySearch:m,tags:w,lastModified:y,mediaType:E,scope:b,useScope:g})=>{const v=[],h=f,S=p(i)&&!m;if(h){let T=`name:"*${h}*"`;S&&(T=`(name:"*${h}*" OR content:"${h}")`),v.push(T)}if(g&&b&&v.push(`scope:${b}`),w){const T=w.split("+").map(R=>`"${R}"`);v.push(`tag:(${T.join(" OR ")})`)}if(y&&v.push(`mtime:${y}`),E){const T=E.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 hv({currentRoute:e,clientService:t}){const n=ce(!1),{webdav:r}=t,{replaceInvalidFileRoute:o}=Js(),{getFileInfo:i}=Ff({clientService:t}),s=Of(),a=at(),{buildSearchTerm:c,search:u}=kf(),l=an("contextRouteQuery"),d=Qe(),{activeResources:f}=Ue.storeToRefs(d);return{isFolderLoading:n,loadFolderForFileContext:async w=>{var y,E;n.value=!0;try{if(w=p(w),(y=p(l))!=null&&y.term){const _=c({term:(E=p(l))==null?void 0:E.term}),{values:A}=await u(_,200),$=A.filter(({data:D})=>Z.isSearchResource(D)).map(D=>D.data);d.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(p(w.routeName))){await Yy.getTask().perform(),n.value=!1;return}d.clearResourceList();const g=p(w.space),v=await i(w,{davProperties:[je.FileId]});if(o({space:g,resource:v,path:p(w.item),fileId:p(w.itemId)}),a.spaces.some(_=>{var A;return Z.isMountPointSpaceResource(_)&&((A=_.root.remoteItem)==null?void 0:A.id)===v.id})){const _=await i(w);d.initResourceList({currentFolder:_,resources:[_]}),n.value=!1;return}const S=dt.dirname(v.path),{resource:T,children:R}=await r.listFiles(g,{path:S});T.type==="file"?d.initResourceList({currentFolder:T,resources:[T]}):d.initResourceList({currentFolder:T,resources:R})}catch(b){if(b.statusCode===401)return s.handleAuthError(p(e));d.setCurrentFolder(null),console.error(b)}n.value=!1},activeFiles:f}}function xf({appsStore:e,applicationId:t}){return{applicationMeta:B(()=>{const r=e.apps[t];if(!r)throw new Error(`useAppConfig: could not find config for applicationId: ${t}`);return r||{}})}}const li=()=>Ke;function gv({titleSegments:e,eventBus:t}){const n=ai(),{currentTheme:r}=Ue.storeToRefs(n);t=t||li(),St(e,o=>{const i=p(o),s=" - ",a={shortDocumentTitle:i.join(s),fullDocumentTitle:[...i,p(r).name].join(s)};t.publish("runtime.documentTitle.changed",a)},{immediate:!0,deep:!0})}function KF({appsStore:e,applicationId:t,applicationName:n,currentFileContext:r,currentRoute:o}){const i=xf({applicationId:t,appsStore:e}),{$gettext:s}=Fe.useGettext(),a=B(()=>{var l,d,f;const c=dt.basename(p((l=p(r))==null?void 0:l.fileName))||s(((f=(d=p(o))==null?void 0:d.meta)==null?void 0:f.title)||""),u=p(p(i).applicationMeta);return[c,p(n)||u.name||u.id].filter(Boolean)});gv({titleSegments:a})}function mv(e={}){const t=e.clientService??Ge(),n=e.authStore??ei();return{makeRequest:(o,i,s={})=>{const a=n.accessToken?t.httpAuthenticated:t.httpUnAuthenticated;return s.headers=s.headers||{},n.publicLinkContextReady&&(n.publicLinkPassword&&(s.headers.Authorization="Basic "+wr.from(["public",n.publicLinkPassword].join(":")).toString("base64")),n.publicLinkToken&&(s.headers["public-token"]=n.publicLinkToken)),s.method=o,s.url=i,a.request(s)}}}const yv=()=>{const e=at();return{areSpacesLoading:B(()=>!e.spacesInitialized||e.spacesLoading)}},bv=(e={})=>{const t=at(),{areSpacesLoading:n}=yv(),r=an("shareId"),o=an("fileId"),i=B(()=>Rt(p(o))),s=st(),a=Ge(),c=B(()=>t.spaces),u=ce(null),l=ce(null),d=ce(!1),f=m=>{const w=m.split("/");return p(c).find(y=>{if(!m.startsWith(y.driveAlias))return!1;const E=y.driveAlias.split("/");return w.length<E.length||w.slice(0,E.length).join("/")!==y.driveAlias?!1:y})};return Ya(()=>{const m=p(e.driveAliasAndItem);!(m!=null&&m.startsWith("personal/"))&&!(m!=null&&m.startsWith("project/"))&&t.setCurrentSpace(null)}),St([e.driveAliasAndItem,n],async([m,w],[y,E])=>{if(m===y&&w===E)return;if(!m||m.startsWith("virtual/")){u.value=null,l.value=null;return}if(p(u)&&m.startsWith(p(u).driveAlias)){l.value=Z.urlJoin(m.slice(p(u).driveAlias.length),{leadingSlash:!0});return}let g=null,v=null;if(m.startsWith("public/")||m.startsWith("ocm/")){const[h,...S]=m.split("/").slice(1);g=p(c).find(T=>T.id===h),v=S.join("/")}else if(m.startsWith("share/")||m.startsWith("ocm-share/")){const[h,...S]=m.split("/").slice(1),T=m.startsWith("ocm-share/")?"ocm-share":"share";let R=Rt(p(r));R!=null&&R.includes(":")&&(R=[Z.SHARE_JAIL_ID,R].join("!")),g=t.getSpace(R)||t.createShareSpace({driveAliasPrefix:T,id:R,shareName:p(h)}),v=S.join("/")}else p(i)?g=p(c).find(h=>p(i).startsWith(`${h.fileId}`)):g=f(m),g||(!t.mountPointsInitialized&&s.options.routing.fullShareOwnerPaths&&(d.value=!0,await t.loadMountPoints({graphClient:a.graphAuthenticated})),g=f(m)),g&&(v=m.slice(g.driveAlias.length));u.value=g,l.value=Z.urlJoin(v,{leadingSlash:!0}),d.value=!1},{immediate:!0,deep:!0}),St(u,m=>{t.setCurrentSpace(m)},{immediate:!0}),{space:u,item:l,itemId:i,loading:d}};function vv(e){const t=He(),n=or(),r=Kt(),o=e.clientService??Ge(),i=e.applicationId,s=ei(),{publicLinkContextReady:a}=Ue.storeToRefs(s),c=ea("driveAliasAndItem"),{space:u,item:l,itemId:d,loading:f}=bv({driveAliasAndItem:c}),m=B(()=>{if(p(f))return null;let w;return p(u)?w=Z.urlJoin(p(u).webDavPath,p(l)):w=Z.urlJoin(Rt(p(r).params.filePath)),{path:w,driveAliasAndItem:p(c),space:p(u),item:p(l),itemId:p(d),fileName:dt.basename(w),routeName:Rt(p(r).query[ta]),...dv(p(r).query)}});return KF({appsStore:n,applicationId:i,applicationName:e.applicationName,currentFileContext:m,currentRoute:r}),{isPublicLinkContext:a,currentFileContext:m,...wh({appsStore:n,...e}),...pv({router:t,currentFileContext:m}),...Ff({clientService:o}),...hv({clientService:o,currentRoute:r}),...mv({clientService:o,currentRoute:p(r)})}}const QF=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}}),XF=()=>[{path:"/list",redirect:e=>Nn("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:"personal/home"}})},{path:"/list/all/:item(.*)",redirect:e=>Nn("files-spaces-generic",{...e,params:{...e.params,driveAliasAndItem:Z.urlJoin("personal/home",Rt(e.params.item),{leadingSlash:!1})}})},{path:"/list/favorites",redirect:e=>Ci("files-common-favorites",e)},{path:"/list/shared-with-me",redirect:e=>$n("files-shares-with-me",e)},{path:"/list/shared-with-others",redirect:e=>$n("files-shares-with-others",e)},{path:"/list/shared-via-link",redirect:e=>$n("files-shares-via-link",e)},{path:"/trash-bin",redirect:e=>Fi("files-trash-generic",e)},{path:"/public/list/:item(.*)",redirect:e=>Pi("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(QF),YF=(e,...t)=>{const[n,...r]=t.map(o=>{const i={"files-personal":Nn("files-spaces-generic").name,"files-favorites":Ci("files-common-favorites").name,"files-shared-with-others":$n("files-shares-with-others").name,"files-shared-with-me":$n("files-shares-with-me").name,"files-trashbin ":Fi("files-trash-generic").name,"files-public-list":Pi("files-public-link").name}[o.name.toString()];return i&&console.warn(`route name "${name}" is deprecated, use "${i.toString()}" instead.`),{...o,...!!i&&{name:i}}});return Cl(e,n,...r)},JF={name:"root",path:"/",redirect:e=>Nn("files-spaces-generic",e)},ZF=e=>[JF,...AT(e),...IT(e),...CT(e),...RT(e),...PT(e),...XF()],ra=()=>{const e=Ge();return{getDefaultMetaFolder:async n=>{const{children:r}=await e.webdav.listFiles(n);return r.find(({name:o})=>o===".space")}}},un=e=>{const t=yt(),n=at(),r=st(),o=B(()=>n.spaces),i=ea("driveAliasAndItem"),s=d=>p(e==null?void 0:e.space)||p(o).find(f=>f.id===d),a=d=>{var E,b,g,v,h;let f=d.storageId;((E=p(i))!=null&&E.startsWith("public/")||(b=p(i))!=null&&b.startsWith("ocm/"))&&(f=p(i).split("/")[1]);const m=s(f);if(m&&!Z.isMountPointSpaceResource(m))return m;const w=Z.isShareResource(d)&&d.shareTypes.includes(Z.ShareTypes.remote.value)||(g=d==null?void 0:d.id)!=null&&g.toString().startsWith(Z.OCM_PROVIDER_ID)?"ocm-share":"share";let y;return d.remoteItemPath?y=dt.basename(d.remoteItemPath):(v=p(i))!=null&&v.startsWith("share/")||(h=p(i))!=null&&h.startsWith("ocm-share/")?y=p(i).split("/")[1]:y=d.name,n.getSpace(d.remoteItemId)||n.createShareSpace({driveAliasPrefix:w,id:d.remoteItemId,shareName:y})},c=d=>p(o).filter(f=>Z.isMountPointSpaceResource(f)&&Z.extractStorageId(f.root.remoteItem.rootId)===d.id);return{getInternalSpace:s,getMatchingSpace:a,isPersonalSpaceRoot:d=>{var f;return(d==null?void 0:d.storageId)&&(d==null?void 0:d.storageId)===((f=n.personalSpace)==null?void 0:f.storageId)&&(d==null?void 0:d.path)==="/"},isResourceAccessible:({space:d,path:f})=>{if(!r.options.routing.fullShareOwnerPaths)return!0;const m=p(o).some(y=>Z.isProjectSpaceResource(y)&&y.id===d.id);return d.isOwner(t.user)||m||c(d).some(y=>f.startsWith(y.root.remoteItem.path))}}},Ui=()=>{const e=Ge(),t=Qe();return{createSpace:o=>{const{graphAuthenticated:i}=e;return i.drives.createDrive({name:o},{params:{template:"default"}})},createDefaultMetaFolder:async o=>{var s;const i=await e.webdav.createFolder(o,{path:".space"});return Z.extractStorageId(i.parentFolderId)===((s=t.currentFolder)==null?void 0:s.id)&&t.upsertResource(i),i}}},fn=()=>vr("$loadingService"),ia=()=>{const e=ei(),t=Ge(),n=Fe.useGettext();return{headers:B(()=>{const o=new Qh({accessToken:e.accessToken,publicLinkToken:e.publicLinkToken,publicLinkPassword:e.publicLinkPassword});return{"Accept-Language":n.current,"Initiator-ID":t.initiatorId,"X-Request-ID":en.v4(),...o.getHeaders()}})}};function eO(e){return new Worker("/assets/worker-wzeBldCS.js",{name:e==null?void 0:e.name})}const wv=({concurrentRequests:e=4}={})=>{const t=st(),n=fn(),{headers:r}=ia(),{createWorker:o,terminateWorker:i}=Io(),s=({topic:c,space:u,resources:l},d)=>{const f=o(eO,{needsTokenRenewal:!0});let m;p(f.worker).onmessage=w=>{i(f.id),m==null||m(!0);const{successful:y,failed:E}=JSON.parse(w.data),b=E.map(({resource:g,...v})=>({resource:g,error:Z.createHttpError(v)}));d({successful:y,failed:b})},n.addTask(()=>new Promise(w=>{m=w})),f.post(a({topic:c,space:u,resources:l}))},a=({topic:c,space:u,resources:l})=>JSON.stringify({topic:c,data:{space:u,resources:l,concurrentRequests:e,baseUrl:t.serverUrl,headers:{...p(r),"X-Request-ID":void 0}}});return{startWorker:s}};function tO(e){return new Worker("/assets/worker-Bdr1GBo2.js",{name:e==null?void 0:e.name})}const Sv=()=>{const e=st(),t=fn(),{headers:n}=ia(),{createWorker:r,terminateWorker:o}=Io(),i=(a,c)=>{const u=r(tO,{needsTokenRenewal:!0});let l;p(u.worker).onmessage=d=>{o(u.id),l==null||l(!0);const{successful:f,failed:m}=JSON.parse(d.data),w=m.map(({resourceName:y,...E})=>({resourceName:y,error:Z.createHttpError(E)}));c({successful:f,failed:w})},t.addTask(()=>new Promise(d=>{l=d})),u.post(s(a))},s=a=>JSON.stringify({topic:"startProcess",data:{transferData:a,baseUrl:e.serverUrl,headers:{...p(n),"X-Request-ID":void 0}}});return{startWorker:i}};function nO(e){return new Worker("/assets/worker-CR6GDG5N.js",{name:e==null?void 0:e.name})}const Ev=()=>{const e=st(),t=fn(),{headers:n}=ia(),{createWorker:r,terminateWorker:o}=Io(),i=({space:a,resources:c,missingFolderPaths:u},l)=>{const d=r(nO,{needsTokenRenewal:!0});let f;p(d.worker).onmessage=m=>{o(d.id),f==null||f(!0);const{successful:w,failed:y}=JSON.parse(m.data),E=y.map(({resource:b,...g})=>({resource:b,error:Z.createHttpError(g)}));l({successful:w,failed:E})},t.addTask(()=>new Promise(m=>{f=m})),d.post(s({space:a,resources:c,missingFolderPaths:u}))},s=({space:a,resources:c,missingFolderPaths:u})=>JSON.stringify({topic:"startProcess",data:{space:a,resources:c,missingFolderPaths:u,baseUrl:e.serverUrl,headers:{...p(n),"X-Request-ID":void 0}}});return{startWorker:i}};function rO(e){return new Worker("/assets/worker-BBQqm_-D.js",{name:e==null?void 0:e.name})}const iO=({authService:e})=>{const{createWorker:t}=Io(),n=ce();return{startWorker:()=>{n.value=t(rO),p(p(n).worker).onmessage=()=>{e.signinSilent().catch(async s=>{if(s instanceof nw.ErrorTimeout){console.warn("token renewal timed out, retrying in 5 seconds..."),p(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(!p(n)){console.error("token timer worker is not running");return}p(n).post(JSON.stringify({topic:"set",expiry:s,expiryThreshold:a}))},resetTokenTimer:()=>{if(!p(n)){console.error("token timer worker is not running");return}p(n).post(JSON.stringify({topic:"reset"}))}}},Tv=()=>{const e=st(),t=tt(),n=He(),r=Fe.useGettext(),{getMatchingSpace:o}=un(),{$gettext:i,$ngettext:s}=r,a=Ge(),{dispatchModal:c}=pt(),u=at(),l=li(),{startWorker:d}=wv({concurrentRequests:e.options.concurrentRequests.resourceBatchActions}),f=Qe(),{currentFolder:m}=Ue.storeToRefs(f),w=ce([]),y=an("page","1"),E=B(()=>parseInt(Rt(p(y)))),b=an("items-per-page","1"),g=B(()=>parseInt(Rt(p(b)))),v=B(()=>Op(p(w))),h=B(()=>{const A=p(v),$=A[0].type==="folder";let D=null;return A.length===1?($?D=i("Permanently delete folder »%{name}«",{name:A[0].name},!0):D=i("Permanently delete file »%{name}«",{name:A[0].name},!0),D):s("Permanently delete selected resource?","Permanently delete %{amount} selected resources?",A.length,{amount:A.length.toString()},!1)}),S=B(()=>{const A=p(v),$=A[0].type==="folder";return A.length===1?i($?"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."):i("Are you sure you want to delete all selected resources? All their content will be permanently removed. This action cannot be undone.")}),T=A=>{const $=p(n.currentRoute);d({topic:"trashBinDelete",space:A,resources:p(v)},({successful:D,failed:N})=>{var x,W;if(D.length){const K=D.length===1&&p(v).length===1?i('"%{item}" was deleted successfully',{item:D[0].name}):s("%{itemCount} item was deleted successfully","%{itemCount} items were deleted successfully",D.length,{itemCount:D.length.toString()},!0);t.showMessage({title:K})}N.forEach(({resource:K})=>{const le=i('Failed to delete "%{item}"',{item:K.name});t.showErrorMessage({title:le,errors:[new Error]})}),$.name===p(n.currentRoute).name&&((x=$.query)==null?void 0:x.fileId)===((W=p(n.currentRoute).query)==null?void 0:W.fileId)&&(f.removeResources(D),f.resetSelection())})};return{displayDialog:(A,$)=>{w.value=[...$],c({title:p(h),message:p(S),confirmText:i("Delete"),onConfirm:()=>T(A)})},filesList_delete:A=>{var N;w.value=[...A],f.addResourcesIntoDeleteQueue(p(w).map(({id:x})=>x)),p(w).forEach(({id:x})=>f.removeSelection(x));const $=p(A).reduce((x,W)=>{if(W.storageId in x)return x[W.storageId].resources.push(W),x;const K=o(W);return K.id in x||(x[K.id]={space:K,resources:[]}),x[K.id].resources.push(W),x},{}),D=(N=p(m))==null?void 0:N.id;return Object.values($).map(({space:x,resources:W})=>{d({topic:"fileListDelete",space:x,resources:W},async({successful:K,failed:le})=>{var be;if(K.length){const te=K.length===1&&A.length===1?i('"%{item}" was moved to trash bin',{item:K[0].name}):s("%{itemCount} item was moved to trash bin","%{itemCount} items were moved to trash bin",K.length,{itemCount:K.length.toString()},!0);t.showMessage({title:te}),l.publish("runtime.resource.deleted",K)}if(f.removeResourcesFromDeleteQueue(le.map(({resource:te})=>te.id)),f.removeResourcesFromDeleteQueue(K.map(({id:te})=>te)),le.forEach(({error:te,resource:ae})=>{let ue=i('Failed to delete "%{resource}"',{resource:ae.name});te.statusCode===423&&(ue=i('Failed to delete "%{resource}" - the file is locked',{resource:ae.name})),t.showErrorMessage({title:ue,errors:[te]})}),D===((be=p(m))==null?void 0:be.id)){f.removeResources(K);const te=f.activeResources.length,ae=Math.ceil(p(te)/p(g));p(E)>1&&p(E)>ae&&(y.value=ae.toString())}if(ht(n,"files-spaces-generic")&&!["public","share"].includes(x==null?void 0:x.driveType)){const ae=await a.graphAuthenticated.drives.getDrive(p(A)[0].storageId);u.updateSpaceField({id:ae.id,field:"spaceQuota",value:ae.spaceQuota})}if(p(w).length&&ro(p(w)[0],p(m)))return n.push(ir(x,{path:dt.dirname(p(w)[0].path),fileId:p(w)[0].parentFolderId}))})})}}},Av=()=>{const e=Kt();return B(()=>{var t,n;return(n=(t=p(e))==null?void 0:t.query)==null?void 0:n.contextRouteName})},oO=e=>e==="files",_r=()=>{const e=Kt();return B(()=>oO(Nl(p(e))))},Rv="rowMounted",Nf="fileDropped",sO="contextmenuClicked";class Qn{}Ee(Qn,"Thumbnail",[36,36]),Ee(Qn,"Tile",[1e3,1e3]),Ee(Qn,"Preview",[1200,1200]),Ee(Qn,"Avatar",64);class oa{}Ee(oa,"Thumbnail","thumbnail"),Ee(oa,"Preview","preview"),Ee(oa,"Avatar","avatar");const $f=10,Co=63,ci=()=>{const{$gettext:e}=Fe.useGettext(),t=Qe();return{isSpaceNameValid:o=>o.trim()===""?{isValid:!1,error:e("The Space name cannot be empty")}:o.length>Co?{isValid:!1,error:e("The Space name cannot be longer than %{length} characters",{length:Co.toString()})}: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,i,s=void 0)=>{if(!i)return{isValid:!1,error:e("The name cannot be empty")};if(/[/]/.test(i))return{isValid:!1,error:e('The name cannot contain "/"')};if(i===".")return{isValid:!1,error:e('The name cannot be equal to "."')};if(i==="..")return{isValid:!1,error:e('The name cannot be equal to ".."')};if(i.trim()!==i)return{isValid:!1,error:e("The name cannot start or end with whitespace")};if(i.length>Co)return{isValid:!1,error:e("The name cannot be longer than %{length} characters",{length:Co.toString()})};const a=o.path.substring(0,o.path.length-o.name.length)+i;if((s||t.resources).some(u=>u.path===a&&u.name===i)){const u=e("The name »%{name}« is already taken");return{isValid:!1,error:e(u,{name:i},!0)}}return{isValid:!0,error:void 0}}}},sa=()=>B(()=>!!document.getElementById("files-global-search-options"));function aO(e){return e==null}const lO="edit",cO="create",Xn=()=>{const e=or(),t=He(),{$gettext:n}=Fe.useGettext(),r=sa(),{isEnabled:o}=si(),{requestExtensions:i}=Bi(),s=_r(),{openUrl:a}=Zv(),c=st(),{options:u}=Ue.storeToRefs(c),{actions:l}=aa(),{actions:d}=la(),{actions:f}=ca(),{actions:m}=Po(),{actions:w}=ua(),{actions:y}=fa(),{actions:E}=Fo(),{actions:b}=Mf(),{actions:g}=da(),{actions:v}=Bf(),{actions:h}=pa(),{actions:S}=ha(),{actions:T}=Vf(),R=B(()=>[...p(v),...p(y),...p(E),...p(m),...p(g),...p(f),...p(h),...p(T),...p(S),...p(l),...p(d),...p(w),...p(b)]),_=B(()=>i({id:"global.files.default-actions",extensionType:"action"}).map(ae=>ae.action)),A=B(()=>i({id:"global.files.context-actions",extensionType:"action"}).map(te=>te.action)),$=B(()=>[{name:"open",icon:"eye",label:()=>n("Open"),handler:({space:te,resources:ae})=>{const ue=le({space:te,resources:ae,omitSystemActions:!0});ue&&ue.handler({space:te,resources:ae})},isVisible:te=>{const ae=le({...te,omitSystemActions:!0});return ae?ae.isVisible(te):!1},class:"oc-files-actions-default-editor-trigger"}]),D=B(()=>p(o)?[]:e.fileExtensions.map(te=>{const ae=e.apps[te.app];return{name:`editor-${te.app}`,label:()=>te.label?typeof te.label=="function"?te.label():te.label:ae.name,icon:te.icon||ae.icon,...ae.iconFillType&&{iconFillType:ae.iconFillType},img:ae.img,route:({space:ue,resources:ie})=>N({appFileExtension:te,space:ue,resource:ie[0]}),handler:ue=>W(te,ue.space,ue.resources[0]),isVisible:({resources:ue})=>!p(s)||ue.length!==1||!ue[0].canDownload()&&!te.secureView||!p(r)&&Tn(t,"files-trash-generic")?!1:ue[0].extension&&te.extension?ue[0].extension.toLowerCase()===te.extension.toLowerCase():ue[0].mimeType&&te.mimeType?ue[0].mimeType.toLowerCase()===te.mimeType.toLowerCase()||ue[0].mimeType.split("/")[0].toLowerCase()===te.mimeType.toLowerCase():!1,hasPriority:te.hasPriority,class:`oc-files-actions-${iv(ae.name).toLowerCase()}-trigger`}}).sort((te,ae)=>ae.hasPriority!==te.hasPriority&&ae.hasPriority?1:0)),N=({appFileExtension:te,space:ae,resource:ue})=>{const ie=Z.isShareSpaceResource(ae)?ae.id:void 0,G=te.routeName||te.app,re=x(G,ae,ue,ie);return t.resolve(re)},x=(te,ae,ue,ie,G)=>({name:te,params:{driveAliasAndItem:ae==null?void 0:ae.getDriveAliasAndItem(ue)},query:{...ie&&{shareId:ie},...ue.fileId&&p(u).routing.idBased&&{fileId:ue.fileId},...G&&{templateId:G},...na(p(t.currentRoute))}}),W=(te,ae,ue)=>{const ie=Z.isShareSpaceResource(ae)?ae.id:void 0,G=te.routeName||te.app,re=x(G,ae,ue,ie);if(p(u).cernFeatures){const se=t.resolve(re).href,Ie=`${te.routeName}-${ue.path}`;a(se,Ie,!0);return}t.push(re)},K=te=>{le(te).handler({...te})},le=te=>{const ae=be(te);if(ae.length)return ae[0]},be=te=>{const ae=G=>G.isVisible(te),ue=[...p(_),...p(D)].filter(ae).sort((G,re)=>Number(re.hasPriority)-Number(G.hasPriority)),ie=te.omitSystemActions?[]:p(R).filter(ae);return[...ue,...ie,...p(A).filter(G=>G.isVisible(te)&&(G.category==="actions"||aO(G.category)))]};return{editorActions:D,defaultEditorActions:$,systemActions:R,getDefaultAction:le,getAllAvailableActions:be,getEditorRouteOpts:x,openEditor:W,triggerDefaultAction:K}},aa=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=He(),{$gettext:r,$ngettext:o}=Fe.useGettext(),i=Ge(),s=fn(),a=st(),c=Qe(),{updateResourceField:u}=c,l=async({resources:f})=>{const m=[],w=[],y=new Fr({concurrency:a.options.concurrentRequests.resourceBatchActions});if(f.forEach(E=>{w.push(y.add(async()=>{try{const{graphAuthenticated:b}=i;await b.driveItems.createDriveItem(E.driveId,{name:E.name,remoteItem:{id:E.fileId}}),u({id:E.id,field:"syncEnabled",value:!0})}catch(b){console.error(b),m.push(b)}}))}),await Promise.all(w),m.length===0){c.resetSelection(),ht(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:m})};return{actions:B(()=>[{name:"enable-sync",icon:"check",handler:f=>s.addTask(()=>l(f)),label:()=>r("Enable sync"),isVisible:({space:f,resources:m})=>{var w;return!jt(n,"files-shares-with-me")&&!ht(n,"files-spaces-generic")||m.length===0||ht(n,"files-spaces-generic")&&(((w=p(f))==null?void 0:w.driveType)!=="share"||m.length>1||m[0].path!=="/")?!1:m.some(y=>!y.syncEnabled)},class:"oc-files-actions-enable-sync-trigger"}])}},la=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=He(),{$gettext:r}=Fe.useGettext(),o=Ge(),i=fn(),s=st(),{updateResourceField:a,resetSelection:c}=Qe(),u=async({resources:d})=>{const f=[],m=[],w=new Fr({concurrency:s.options.concurrentRequests.resourceBatchActions}),y=!d[0].hidden;if(d.forEach(E=>{m.push(w.add(async()=>{try{await o.graphAuthenticated.driveItems.updateDriveItem(E.driveId,E.id,{"@UI.Hidden":y}),a({id:E.id,field:"hidden",value:y})}catch(b){console.error(b),f.push(b)}}))}),await Promise.all(m),f.length===0){c(),e({title:r(y?"The share was hidden successfully":"The share was unhidden successfully")});return}t({title:r(y?"Failed to hide the share":"Failed to unhide share share"),errors:f})};return{actions:B(()=>[{name:"toggle-hide-share",icon:"eye-off",handler:d=>i.addTask(()=>u(d)),label:({resources:d})=>d[0].hidden?r("Unhide"):r("Hide"),isVisible:({resources:d})=>d.length===0?!1:jt(n,"files-shares-with-me"),class:"oc-files-actions-hide-share-trigger"}])}},ca=()=>{const e=st(),t=He(),{copyResources:n}=Ro(),r=Fe.useGettext(),{$gettext:o}=r,i=Qe(),{currentFolder:s}=Ue.storeToRefs(i),a=B(()=>Ks()?o("⌘ + C"):o("Ctrl + C")),c=({resources:l})=>{Ct(t,"files-common-search")&&(l=l.filter(d=>!Z.isProjectSpaceResource(d))),n(l)};return{actions:B(()=>[{name:"copy",icon:"file-copy-2",handler:c,shortcut:p(a),label:()=>o("Copy"),isVisible:({resources:l})=>{var d,f;if(!ht(t,"files-spaces-generic")&&!Fn(t,"files-public-link")&&!Ct(t,"files-common-favorites")&&!Ct(t,"files-common-search")||ht(t,"files-spaces-projects")||l.length===0)return!1;if(Fn(t,"files-public-link"))return(d=p(s))==null?void 0:d.canCreate();if(Ct(t,"files-common-search")&&l.every(m=>Z.isProjectSpaceResource(m)))return!1;if(p(e.options.runningOnEos)){const m=((f=l[0].path)==null?void 0:f.split("/").filter(Boolean))||[];if(ht(t,"files-spaces-generic")&&m.length<5)return!1}return!!p(l)[0].canDownload()},class:"oc-files-actions-copy-trigger"}])}},Df=()=>({copyToClipboard:t=>{var n;if((n=navigator==null?void 0:navigator.clipboard)!=null&&n.write)return navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"})})]);{const{copy:r}=Vr.useClipboard({legacy:!0});return r(t)}}}),Lf=()=>{const{showMessage:e,showErrorMessage:t}=tt(),{$gettext:n}=Fe.useGettext(),{copyToClipboard:r}=Df(),o=async s=>{try{await r(s),e({title:n("The link has been copied to your clipboard.")})}catch(a){console.error(a),t({title:n("Copy link failed"),errors:[a]})}};return{actions:B(()=>[{name:"copy-permanent-link",icon:"link",label:()=>n("Copy permanent link"),handler:({resources:s})=>{const[a]=s,c=a.privateLink;return o(c)},isVisible:({space:s,resources:a})=>!(a.length!==1||Z.isPublicSpaceResource(s)||Z.isTrashResource(a[0])),class:"oc-files-actions-copy-permanent-link-trigger"}])}},ua=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=He(),{$gettext:r,$ngettext:o}=Fe.useGettext(),i=Ge(),s=fn(),a=st(),{updateResourceField:c}=Qe(),u=async({resources:d})=>{const f=[],m=[],w=new Fr({concurrency:a.options.concurrentRequests.resourceBatchActions});if(d.forEach(y=>{m.push(w.add(async()=>{try{const{graphAuthenticated:E}=i;await E.driveItems.deleteDriveItem(y.driveId,y.id),c({id:y.id,field:"syncEnabled",value:!1})}catch(E){console.error(E),f.push(E)}}))}),await Promise.all(m),f.length===0){ht(n,"files-spaces-generic")&&(e({title:o("Sync for the selected share was disabled successfully","Sync for the selected shares was disabled successfully",d.length)}),n.push($n("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",d.length),errors:f})};return{actions:B(()=>[{name:"disable-sync",icon:"spam-3",handler:d=>s.addTask(()=>u(d)),label:()=>r("Disable sync"),isVisible:({space:d,resources:f})=>!jt(n,"files-shares-with-me")&&!ht(n,"files-spaces-generic")||f.length===0||ht(n,"files-spaces-generic")&&((d==null?void 0:d.driveType)!=="share"||f.length>1||f[0].path!=="/")?!1:f.some(m=>m.syncEnabled),class:"oc-files-actions-disable-sync-trigger"}])}},Po=()=>{const e=yt(),t=sn(),n=He(),r=Av(),{displayDialog:o,filesList_delete:i}=Tv(),{$gettext:s}=Fe.useGettext(),a=({space:u,resources:l,deletePermanent:d})=>{if(Ct(n,"files-common-search")&&(l=l.filter(f=>f.canBeDeleted()&&!f.isShareRoot()&&!Z.isProjectSpaceResource(f))),d){o(u,l);return}i(l)};return{actions:B(()=>[{name:"delete",icon:"delete-bin-5",label:()=>s("Delete"),handler:({space:u,resources:l})=>a({space:u,resources:l,deletePermanent:!1}),isVisible:({space:u,resources:l})=>!ht(n,"files-spaces-generic")&&!Fn(n,"files-public-link")&&!Ct(n,"files-common-search")&&!p(r)||l.length===0||ht(n,"files-spaces-generic")&&(u==null?void 0:u.driveType)==="share"&&l[0].path==="/"||l.length===1&&l[0].locked?!1:Ct(n,"files-common-search")?l.some(f=>f.canBeDeleted()&&!f.isShareRoot()&&!Z.isProjectSpaceResource(f)):!l.some(f=>!f.canBeDeleted()),class:"oc-files-actions-delete-trigger"},{name:"delete-permanent",icon:"delete-bin-5",label:()=>s("Delete"),handler:({space:u,resources:l})=>a({space:u,resources:l,deletePermanent:!0}),isVisible:({space:u,resources:l})=>!Tn(n,"files-trash-generic")||!t.filesPermanentDeletion||Z.isProjectSpaceResource(u)&&!u.canDeleteFromTrashBin({user:e.user})?!1:l.length>0,class:"oc-files-actions-delete-permanent-trigger"}])}};function uO(e){return e&&e.length?e[0]:void 0}const _v=()=>vr("$archiverService"),fa=()=>{const{showErrorMessage:e}=tt(),t=He(),n=fn(),r=_v(),{$ngettext:o,$gettext:i,current:s}=Fe.useGettext(),a=ei(),c=_r(),u=({space:f,resources:m})=>{m.length>1&&(m=m.filter(y=>y.canDownload()&&!Z.isProjectSpaceResource(y)));const w=p(r.fileIdsSupported)?{fileIds:m.map(y=>y.fileId)}:{dir:fs.dirname(uO(m).path)||"/",files:m.map(y=>y.name)};return r.triggerDownload({...w,...f&&Z.isPublicSpaceResource(f)&&{publicToken:f.id,publicLinkPassword:a.publicLinkPassword}}).catch(y=>{console.error(y),e({title:o("Failed to download the selected folder.","Failed to download the selected files.",m.length),errors:[y]})})},l=f=>{const m=p(r.capability);return m?f.reduce((y,E)=>y+parseInt(`${E.size}`),0)>parseInt(m.max_size):void 0};return{actions:B(()=>[{name:"download-archive",icon:"inbox-archive",handler:async f=>{await n.addTask(()=>u(f))},label:()=>i("Download"),disabledTooltip:({resources:f})=>l(f)?i("The selection exceeds the allowed archive size (max. %{maxSize})",{maxSize:An(p(r.capability).max_size,s)}):"",isDisabled:({resources:f})=>l(f),isVisible:({resources:f})=>p(c)&&!ht(t,"files-spaces-generic")&&!Fn(t,"files-public-link")&&!Ct(t,"files-common-favorites")&&!Ct(t,"files-common-search")&&!jt(t,"files-shares-with-me")&&!jt(t,"files-shares-with-others")&&!jt(t,"files-shares-via-link")&&!Ct(t,"files-common-search")||!p(r.available)||f.length===0||f.length===1&&!f[0].isFolder||f.length>1&&f.every(w=>Z.isProjectSpaceResource(w))||Z.isProjectSpaceResource(f[0])&&f[0].disabled||!p(r.fileIdsSupported)&&Ct(t,"files-common-favorites")?!1:!f.some(w=>!w.canDownload()),class:"oc-files-actions-download-archive-trigger"}])}},Iv=e=>{const{showErrorMessage:t}=tt(),n=(e==null?void 0:e.clientService)||Ge(),{$gettext:r}=Fe.useGettext(),o=sn(),i=yt();return{downloadFile:async(a,c,u=null)=>{var l;try{const d=await n.webdav.getFileUrl(a,c,{version:u,doHeadRequest:!0,isUrlSigningEnabled:o.supportUrlSigning,username:(l=i.user)==null?void 0:l.onPremisesSamAccountName});Jl(d,c.name)}catch(d){console.error(d),t({title:r("Download failed"),desc:r("File could not be located"),errors:[d]})}}}},Fo=()=>{const e=He(),{$gettext:t}=Fe.useGettext(),n=_r(),r=sa(),{downloadFile:o}=Iv(),i=({space:a,resources:c})=>{o(a,c[0])};return{actions:B(()=>[{name:"download-file",icon:"file-download",handler:i,label:()=>t("Download"),isVisible:({resources:a})=>p(n)&&!p(r)&&!ht(e,"files-spaces-generic")&&!Fn(e,"files-public-link")&&!Ct(e,"files-common-favorites")&&!Ct(e,"files-common-search")&&!jt(e,"files-shares-with-me")&&!jt(e,"files-shares-with-others")&&!jt(e,"files-shares-via-link")||a.length!==1||a[0].isFolder?!1:a[0].canDownload(),class:"oc-files-actions-download-file-trigger"}])}},fO=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=yt(),r=sn(),{$gettext:o}=Fe.useGettext(),i=Ge(),{dispatchModal:s}=pt(),a=Qe(),c=at(),u=fn(),l=async({space:m})=>{try{await i.webdav.clearTrashBin(m),e({title:o("All deleted files were removed")}),a.clearResources(),a.resetSelection(),c.updateSpaceField({id:m.id,field:"hasTrashedItems",value:!1})}catch(w){console.error(w),t({title:o("Failed to empty trash bin"),errors:[w]})}},d=({resources:m})=>{s({title:o("Empty trash bin for »%{name}«",{name:m[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:m[0].name}),hasInput:!1,onConfirm:()=>u.addTask(()=>l({space:m[0]}))})};return{actions:B(()=>[{name:"empty-trash-bin",icon:"delete-bin-2",label:()=>o("Empty trash bin"),handler:d,isVisible:({resources:m})=>m.length!==1||!r.filesPermanentDeletion||!Z.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:l}},Mf=()=>{const{showErrorMessage:e}=tt(),t=sn(),n=He(),{$gettext:r}=Fe.useGettext(),o=Ge(),i=_r(),s=mn(),a=Qe(),c=li(),u=async({space:d,resources:f})=>{try{const m=!f[0].starred;await o.webdav.setFavorite(d,f[0],m),a.updateResourceField({id:f[0].id,field:"starred",value:m}),m||c.publish("app.files.list.removeFromFavorites",f[0].id)}catch(m){const w=r('Failed to change favorite state of "%{file}"',{file:f[0].name},!0);e({title:w,errors:[m]})}};return{actions:B(()=>[{name:"favorite",icon:"star",handler:u,label:({resources:d})=>d[0].starred?r("Remove from favorites"):r("Add to favorites"),isVisible:({resources:d})=>p(i)&&!ht(n,"files-spaces-generic")&&!Ct(n,"files-common-favorites")||d.length!==1?!1:t.filesFavorites&&s.can("create","Favorite"),class:"oc-files-actions-favorite-trigger"}])}};function dO(e,t){const n=e.isReceivedShare()||e.isMounted(),r=t===""&&n;return e.canBeDeleted()&&!r}const da=()=>{const e=He(),{cutResources:t}=Ro(),n=Fe.useGettext(),{$gettext:r}=n,o=Qe(),{currentFolder:i}=Ue.storeToRefs(o),s=B(()=>Ks()?r("⌘ + X"):r("Ctrl + X")),a=({resources:u})=>{t(u)};return{actions:B(()=>[{name:"cut",icon:"scissors",handler:a,shortcut:p(s),label:()=>r("Cut"),isVisible:({resources:u})=>!ht(e,"files-spaces-generic")&&!Fn(e,"files-public-link")&&!Ct(e,"files-common-favorites")||u.length===0||!p(i)||u.length===1&&u[0].locked?!1:!u.some(d=>dO(d,p(i).path)===!1),class:"oc-files-actions-move-trigger"}])}},Bf=()=>{const e=He(),{$gettext:t}=Fe.useGettext(),{getMatchingSpace:n}=un(),r=Qe(),{currentFolder:o}=Ue.storeToRefs(r),i=c=>c||n(c),s=B(()=>Fn(e,"files-public-link")?Pi("files-public-link"):Nn("files-spaces-generic"));return{actions:B(()=>[{name:"navigate",icon:"folder-open",label:()=>t("Open"),isVisible:({resources:c})=>!(Tn(e,"files-trash-generic")||c.length!==1||p(o)!==null&&ro(c[0],p(o))||!c[0].isFolder||c[0].type==="space"),route:({space:c,resources:u})=>uo({},p(s),ir(i(c),{path:u[0].path,fileId:u[0].fileId})),class:"oc-files-actions-navigate-trigger"}])}},Cv=()=>{const e=He(),t=Ge(),{getMatchingSpace:n}=un(),{$gettext:r,$ngettext:o}=Fe.useGettext(),i=Ro(),{startWorker:s}=Sv(),a=Qe(),{currentFolder:c}=Ue.storeToRefs(a),u=B(()=>Ks()?r("⌘ + V"):r("Ctrl + V")),l=B(()=>i.action===ii.Cut?mr.MOVE:mr.COPY),d=async({targetSpace:w,sourceSpace:y,resources:E})=>{var h;const b=new Dp(y,E,w,p(c),c,t,r,o),g=await b.getTransferData(p(l));if(!g.length)return;const v=(h=p(c))==null?void 0:h.id;s(g,async({successful:S,failed:T})=>{if(b.showResultMessage(T,S,p(l)),!S.length||p(c)&&v!==p(c).id)return;const R=[],_=[];for(const A of S)R.push((async()=>{const $=await t.webdav.getFileInfo(w,A);_.push($)})());await Promise.allSettled(R),Z.isShareSpaceResource(w)&&_.forEach(A=>{A.remoteItemId=w.id}),a.upsertResources(_)})},f=async({space:w})=>{const y=i.resources.reduce((b,g)=>{if(g.storageId in b)return b[g.storageId].resources.push(g),b;const v=n(g);return v.id in b||(b[v.id]={space:v,resources:[]}),b[v.id].resources.push(g),b},{}),E=Object.values(y).map(({space:b,resources:g})=>d({targetSpace:w,sourceSpace:b,resources:g}));await Promise.all(E),i.clearClipboard()};return{actions:B(()=>[{name:"paste",icon:"clipboard",handler:f,label:()=>r("Paste"),shortcut:p(u),isVisible:({resources:w})=>{var y;return i.resources.length===0||!ht(e,"files-spaces-generic")&&!Fn(e,"files-public-link")&&!Ct(e,"files-common-favorites")||w.length===0?!1:Fn(e,"files-public-link")&&p(c)?(y=p(c))==null?void 0:y.canCreate():!0},class:"oc-files-actions-copy-trigger"}])}},pa=()=>{const{showErrorMessage:e}=tt(),t=sn(),n=He(),{$gettext:r}=Fe.useGettext(),o=Ge(),i=st(),{dispatchModal:s}=pt(),a=yt(),c=mn(),u=Qe(),{setCurrentFolder:l,upsertResource:d}=u,{isFileNameValid:f}=ci(),m=async(E,b,g)=>{let v=u.currentFolder;try{const h=dt.join(dt.dirname(b.path),g);await o.webdav.moveFiles(E,b,E,{path:h});const S=ro(b,v);if(Z.isShareSpaceResource(E)&&b.isReceivedShare()){if(E.rename(g),S)return v={...v},v.name=g,l(v),n.push(ir(E,{path:"",fileId:b.fileId}));const R={...b};R.name=g,d(R);return}if(S)return v={...v},hl(E,v,h),l(v),n.push(ir(E,{path:h,fileId:b.fileId}));const T={...b};hl(E,T,h),d(T)}catch(h){console.error(h);let S=r('Failed to rename "%{file}" to »%{newName}«',{file:b.name,newName:g},!0);h.statusCode===423&&(S=r("Failed to rename »%{file}« to »%{newName}« - the file is locked",{file:b.name,newName:g},!0)),e({title:S,errors:[h]})}},w=async({space:E,resources:b})=>{const g=u.currentFolder;let v;if(ro(b[0],g)){const N=dt.dirname(g.path);v=(await o.webdav.listFiles(E,{path:N})).children}const h=u.areFileExtensionsShown,S=async N=>{h||(N=`${N}.${b[0].extension}`),await m(E,b[0],N)},T=(N,x)=>{h||(N=`${N}.${b[0].extension}`);const{isValid:W,error:K}=f(b[0],N,v);x(W?null:K)},R=Z.extractNameWithoutExtension(b[0]),_=!b[0].isFolder&&!h?R:b[0].name,A=b[0].isFolder?r("Rename folder »%{name}«",{name:_}):r("Rename file »%{name}«",{name:_}),$=!b[0].isFolder&&!h?R:b[0].name,D=b[0].isFolder||!h?null:[0,R.length];s({title:A,confirmText:r("Rename"),hasInput:!0,inputValue:$,inputSelectionRange:D,inputLabel:b[0].isFolder?r("Folder name"):r("File name"),inputRequiredMark:!0,onConfirm:S,onInput:T})};return{actions:B(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:w,isVisible:({resources:E})=>Tn(n,"files-trash-generic")||jt(n,"files-shares-with-me")&&!t.sharingCanRename||E.length!==1||(i.options.routing.fullShareOwnerPaths?E.some(v=>v.remoteItemPath&&v.path):E.some(v=>v.remoteItemId&&v.path==="/"))||E.length===1&&E[0].locked?!1:!E.some(v=>!v.canRename({user:a.user,ability:c})||v.processing),class:"oc-files-actions-rename-trigger"}]),renameResource:m}},ha=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=yt(),r=He(),{$gettext:o,$ngettext:i}=Fe.useGettext(),s=Ge(),a=at(),c=Qe(),{startWorker:u}=Ev(),l=async(y,E)=>{const b={},g=[],v=[],h=[];for(const S of E){const T=dt.dirname(S.path);let R=[];if(T in b)R=b[T];else{try{R=(await s.webdav.listFiles(y,{path:T})).children}catch{h.push(T)}b[T]=R}R.some(A=>A.name===S.name)||v.filter(A=>A.id!==S.id).some(A=>A.path===S.path)?g.push(S):v.push(S)}return{existingResourcesByPath:b,conflicts:g,resolvedResources:v,missingFolderPaths:h.filter(S=>{var T;return!((T=b[S])!=null&&T.length)})}},d=async y=>{let E=0;const b=[],g=y.length;let v=!1,h;for(const S of y){const T=S.type==="folder";if(v){b.push({resource:S,strategy:h});continue}const R=g-E,A=await new dl(o,i).resolveFileExists({name:S.name,isFolder:T},R,!1);E++,A.doForAllConflicts&&(v=!0,h=A.strategy),b.push({resource:S,strategy:A.strategy})}return b},f=(y,E,b)=>{const g=p(r.currentRoute);u({space:y,resources:E,missingFolderPaths:b},async({successful:v,failed:h})=>{var S,T;if(v.length){let R;v.length===1?R=o("%{resource} was restored successfully",{resource:v[0].name}):R=o("%{resourceCount} files restored successfully",{resourceCount:v.length.toString()}),e({title:R}),g.name===p(r.currentRoute).name&&((S=g.query)==null?void 0:S.fileId)===((T=p(r.currentRoute).query)==null?void 0:T.fileId)&&(c.removeResources(v),c.resetSelection());const A=await s.graphAuthenticated.drives.getDrive(y.id);a.updateSpaceField({id:A.id,field:"spaceQuota",value:A.spaceQuota})}if(h.length){let R;const _={};h.length===1?(_.resource=h[0].resource.name,R=o('Failed to restore "%{resource}"',_,!0)):(_.resourceCount=h.length.toString(),R=o("Failed to restore %{resourceCount} files",_,!0)),t({title:R,errors:h.map(({error:A})=>A)})}})},m=async({space:y,resources:E})=>{const b=E.sort((A,$)=>A.path.length-$.path.length),{existingResourcesByPath:g,conflicts:v,resolvedResources:h,missingFolderPaths:S}=await l(y,b),T=await d(v),R=T.filter(A=>A.strategy===Wn.REPLACE).map(A=>A.resource);h.push(...R);const _=T.filter(A=>A.strategy===Wn.KEEP_BOTH).map(A=>A.resource);for(let A of _){A={...A};const $=dt.dirname(A.path),D=g[$]||[],N=Z.extractExtensionFromFile(A),x=zn(A.name,N,[...D,...T.map(W=>W.resource),...h]);A.name=x,A.path=Z.urlJoin($,x),h.push(A)}return f(y,h,S)};return{actions:B(()=>[{name:"restore",icon:"arrow-go-back",label:()=>o("Restore"),handler:m,isVisible:({space:y,resources:E})=>!Tn(r,"files-trash-generic")||!E.every(b=>Z.isTrashResource(b)&&b.canBeRestored())||Z.isProjectSpaceResource(y)&&!y.canRestoreFromTrashbin({user:n.user})?!1:E.length>0,class:"oc-files-actions-restore-trigger"}]),restoreResources:f,collectConflicts:l}},jf=()=>vr("$previewService"),pO={class:"space-image-modal"},hO={key:0,class:"space-image-modal-image-container"},gO=["src"],mO={class:"oc-text-small oc-text-muted oc-flex oc-flex-middle oc-mt-xs"},yO=["textContent"],Pv=xe({__name:"SpaceImageModal",props:{modal:{},space:{},file:{}},setup(e,{expose:t}){const{showMessage:n,showErrorMessage:r}=tt(),{$gettext:o}=Fe.useGettext(),i=Ge(),s=at(),{createDefaultMetaFolder:a}=Ui(),{getDefaultMetaFolder:c}=ra(),{setCropperInstance:u}=Xf(),l=ce(null),d=Qa("imageRef"),f=ce(null);t({onConfirm:async()=>{var g;const E=(g=p(l))==null?void 0:g.getCroppedCanvas({imageSmoothingQuality:"high"}),b=await w(E);await y(b)}});const w=async E=>(await new Promise(g=>E.toBlob(g,"image/png"))).arrayBuffer(),y=async E=>{const b=i.graphAuthenticated;s.addToImagesLoading(e.space.id);let g=await c(e.space);g||(g=await a(e.space));const v={"Content-Type":"application/offset+octet-stream"};try{const{fileId:h,processing:S}=await i.webdav.putFileContents(e.space,{parentFolderId:g.id,fileName:"image.png",content:E,headers:v,overwrite:!0}),T=await b.drives.updateDrive(e.space.id,{name:e.space.name,special:[{specialFolder:{name:"image"},id:h}]});S||s.removeFromImagesLoading(e.space.id),s.updateSpaceField({id:e.space.id,field:"spaceImageData",value:T.spaceImageData}),n({title:o("Space image was set successfully")}),Ke.publish("app.files.spaces.uploaded-image",T)}catch(h){s.removeFromImagesLoading(e.space.id),console.error(h),r({title:o("Failed to set space image"),errors:[h]})}};return Bt(async()=>{var E;try{f.value=URL.createObjectURL(e.file),p(l)&&((E=p(l))==null||E.destroy()),await In(),l.value=new Ra(p(d),{aspectRatio:16/9,viewMode:1,dragMode:"move",autoCropArea:.8,responsive:!0,background:!1}),u(l)}catch(b){r({title:o("Failed to load space image"),errors:[b]})}}),(E,b)=>{const g=he("oc-icon");return X(),pe("div",pO,[f.value?(X(),pe("div",hO,[fe("img",{ref_key:"imageRef",ref:d,src:f.value},null,8,gO),fe("div",mO,[ge(g,{class:"oc-mr-xs",name:"information",size:"small","fill-type":"line"}),fe("span",{textContent:H.toDisplayString(p(o)("Zoom via %{ zoomKeys }, pan via %{ panKeys }",{zoomKeys:p(o)("+-"),panKeys:p(o)("↑↓←→")}))},null,8,yO)])])):Ce("",!0)])}}}),Fv=()=>{const e=yt(),t=He(),{$gettext:n}=Fe.useGettext(),r=Ge(),o=fn(),i=jf(),{dispatchModal:s}=pt(),a=async({space:u,resources:l})=>{const{getFileContents:d}=r.webdav,f=await d(u,l[0],{responseType:"blob"}),m=new File([f.body],l[0].name);s({title:n("Crop your Space image"),confirmText:n("Confirm"),customComponent:Pv,customComponentAttrs:()=>({file:m,space:u})})};return{actions:B(()=>[{name:"set-space-image",icon:"image-edit",handler:u=>o.addTask(()=>a(u)),label:()=>n("Set as space image"),isVisible:({space:u,resources:l})=>l.length!==1||!l[0].mimeType||!i.isMimetypeSupported(l[0].mimeType,!0)||!ht(t,"files-spaces-generic")||!u?!1:u.canEditImage({user:e.user}),class:"oc-files-actions-set-space-image-trigger"}])}},bO=()=>{const e=He(),{$gettext:t}=Fe.useGettext(),n=_r(),r=()=>{const i=Tn(e,"files-trash-generic")?null:"actions";Ke.publish(Tt.openWithPanel,i)};return{actions:B(()=>[{name:"show-actions",icon:"slideshow-3",label:()=>t("All Actions"),handler:r,isVisible:({resources:i})=>p(n)?i.length===1:!1,class:"oc-files-actions-show-actions-trigger"}])}},Uf=()=>{const e=He(),t=Qe(),{$gettext:n}=Fe.useGettext();return{actions:B(()=>[{name:"show-details",icon:"information",class:"oc-files-actions-show-details-trigger",label:()=>n("Details"),isVisible:({resources:o})=>Tn(e,"files-trash-generic")?!1:o.length>0,handler({resources:o}){t.setSelection(o.map(({id:i})=>i)),Ke.publish(Tt.open)}}])}},Ov=()=>{const e=sn(),{isPersonalSpaceRoot:t}=un();return{canListShares:({space:r,resource:o})=>{var i;return!e.sharingApiEnabled||Z.isPublicSpaceResource(r)||t(o)||Z.isTrashResource(o)?!1:Z.isIncomingShareResource(o)?o.sharePermissions.includes(Z.GraphSharePermission.readPermissions):Z.isShareSpaceResource(r)?(i=r.graphPermissions)==null?void 0:i.includes(Z.GraphSharePermission.readPermissions):!0}}},kv=()=>{const e=sn(),t=mn(),n=yt();return{canShare:({space:o,resource:i})=>!e.sharingApiEnabled||Z.isShareSpaceResource(o)||Z.isProjectSpaceResource(o)&&!o.canShare({user:n.user})?!1:i.canShare({ability:t,user:n.user})}},qf=()=>{const e=He(),{$gettext:t}=Fe.useGettext(),{canShare:n}=kv(),r=Qe(),o=({resources:s})=>{r.setSelection(s.map(({id:a})=>a)),Ke.publish(Tt.openWithPanel,"sharing#peopleShares")};return{actions:B(()=>[{name:"show-shares",icon:"user-add",label:()=>t("Share"),handler:o,isVisible:({space:s,resources:a})=>Tn(e,"files-trash-generic")||a.length!==1?!1:n({space:s,resource:a[0]}),class:"oc-files-actions-show-shares-trigger"}])}},Vf=()=>{const{showMessage:e,showErrorMessage:t}=tt(),{can:n}=mn(),{$gettext:r,$ngettext:o}=Fe.useGettext(),{createSpace:i}=Ui(),s=Ge(),a=He(),c=B(()=>n("create-all","Drive")),{dispatchModal:u}=pt(),l=st(),d=at(),f=Qe(),{isSpaceNameValid:m}=ci(),w=async({spaceName:b,resources:g,space:v})=>{const{webdav:h}=s,S=new Fr({concurrency:l.options.concurrentRequests.resourceBatchActions}),T=[];try{const R=await i(b);d.upsertSpace(R),g.length===1&&g[0].isFolder&&(g=(await h.listFiles(v,{path:g[0].path})).children);for(const _ of g)T.push(S.add(()=>h.copyFiles(v,_,R,{path:_.name})));await Promise.all(T),f.resetSelection(),e({title:r("Space was created successfully")})}catch(R){console.error(R),t({title:r("Creating space failed…"),errors:[R]})}},y=({resources:b,space:g})=>{u({title:o("Create Space from »%{resourceName}«","Create Space from selection",b.length,{resourceName:b[0].name}),message:o("Create Space with the content of »%{resourceName}«.","Create Space with the selected files.",b.length,{resourceName:b[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:S,error:T}=m(v);h(S?null:T)},onConfirm:v=>w({spaceName:v,space:g,resources:b})})};return{actions:B(()=>[{name:"create-space-from-resource",icon:"function",handler:y,label:()=>r("Create Space from selection"),isVisible:({resources:b,space:g})=>!(!b.length||!p(c)||!ht(a,"files-spaces-generic")||!Z.isPersonalSpaceResource(g)),class:"oc-files-actions-create-space-from-resource-trigger"}])}},xv=()=>{const e=an("scrollTo"),t=an("details"),n=Qe(),r=B(()=>Rt(p(e))),o=B(()=>Rt(p(t))),i=(a,c={forceScroll:!1,topbarElement:null})=>{const u=document.querySelectorAll(`[data-item-id='${a}']`)[0];if(!u){Ke.publish("app.files.navigate.page",{resourceId:a,forceScroll:c.forceScroll,topbarElement:c.topbarElement});return}const l=document.getElementById(c.topbarElement),d=(l==null?void 0:l.offsetHeight)||0+u.offsetHeight*2;(u.getBoundingClientRect().bottom>window.innerHeight||u.getBoundingClientRect().top<d||c.forceScroll)&&u.scrollIntoView({behavior:"smooth",block:"center"})};return Ke.subscribe("app.files.navigate.scrollTo",a=>i(a.resourceId,{forceScroll:a.forceScroll,topbarElement:a.topbarElement})),{scrollToResource:i,scrollToResourceFromRoute:(a,c)=>{if(!p(r)||!a.length)return;const u=p(a).find(l=>Z.isIncomingShareResource(l)?l.remoteItemId===p(r):l.id===p(r));u&&u.processing!==!0&&(n.setSelection([u.id]),i(u.id,{forceScroll:!0,topbarElement:c}),p(o)&&Ke.publish(Tt.openWithPanel,p(o)))}}},vO=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=tt(),{dispatchModal:r}=pt(),{$gettext:o}=Fe.useGettext(),{scrollToResource:i}=xv(),s=Qe(),{resources:a,currentFolder:c}=Ue.storeToRefs(s),u=Ge(),{isFileNameValid:l}=ci(),d=async w=>{w=w.trimEnd();try{const y=dt.join(p(c).path,w),E=await u.webdav.createFolder(p(e),{path:y});Z.isShareSpaceResource(p(e))&&(E.remoteItemId=p(e).id),s.upsertResource(E),t({title:o("»%{folderName}« was created successfully",{folderName:w})}),await In(),i(E.id,{forceScroll:!0,topbarElement:"files-app-bar"})}catch(y){console.error(y),n({title:o("Failed to create folder"),errors:[y]})}},f=()=>{let w=o("New folder");p(a).some(y=>y.name===w)&&(w=zn(w,"",p(a))),r({title:o("Create a new folder"),confirmText:o("Create"),hasInput:!0,inputValue:w,inputLabel:o("Folder name"),inputRequiredMark:!0,onConfirm:d,onInput:(y,E)=>{const b={path:dt.join(p(c).path,y),name:y,isFolder:!0},{isValid:g,error:v}=l(b,y,p(a));return E(g?null:v)}})};return{actions:B(()=>[{name:"create-folder",icon:"folder",handler:f,label:()=>o("New Folder"),isVisible:()=>{var w;return(w=p(c))==null?void 0:w.canCreate()},class:"oc-files-actions-create-new-folder"}]),addNewFolder:d}},wO=({space:e}={})=>{const{showMessage:t,showErrorMessage:n}=tt(),r=yt(),{$gettext:o}=Fe.useGettext(),{dispatchModal:i}=pt(),s=or(),{isEnabled:a}=si(),{openEditor:c}=Xn(),u=Ge(),l=Qe(),{resources:d,currentFolder:f,areFileExtensionsShown:m}=Ue.storeToRefs(l),{isFileNameValid:w}=ci(),y=B(()=>s.fileExtensions.filter(({newFileMenu:v})=>!!v)),E=(v,h)=>(l.upsertResource(v),c(h,p(e),v)),b=(v,h,S)=>{let T=o("New file")+`.${h}`;p(d).some(_=>_.name===T)&&(T=zn(T,h,p(d))),m.value||(T=Z.extractNameWithoutExtension({name:T,extension:h}));const R=m.value?[0,T.length-(h.length+1)]:null;i({title:o("Create a new file"),confirmText:o("Create"),hasInput:!0,inputValue:T,inputLabel:o("File name"),inputRequiredMark:!0,inputSelectionRange:R,onConfirm:async _=>{m.value||(_=`${_}.${h}`);try{let A;if(S.createFileHandler)A=await S.createFileHandler({fileName:_,space:p(e),currentFolder:p(f)});else{const $=dt.join(p(f).path,_);A=await u.webdav.putFileContents(p(e),{path:$})}return l.upsertResource(A),t({title:o("»%{fileName}« was created successfully",{fileName:A.name})}),p(a)?void 0:E(A,S)}catch(A){console.error(A),n({title:o("Failed to create file"),errors:[A]})}},onInput:(_,A)=>{const $=m.value?_:`${_}.${h}`,D={path:dt.join(p(f).path,$),name:$,extension:h},{isValid:N,error:x}=w(D,$);A(N?null:x)}})};return{actions:B(()=>{var S;const v=[],h={};for(const T of p(y)||[])T.hasPriority?h[T.extension]=T:h[T.extension]=h[T.extension]||T;for(const[,T]of Object.entries(h))v.push({name:"create-new-file",icon:"add",handler:R=>b(R,T.extension,T),label:()=>o(T.newFileMenu.menuTitle()),isVisible:()=>{var R;return(R=p(f))==null?void 0:R.canUpload({user:r.user})},class:"oc-files-actions-create-new-file",ext:T.extension,isExternal:(S=T.app)==null?void 0:S.startsWith("external-")});return v}),openFile:E}};class SO{constructor(t,n,r){Ee(this,"state");Ee(this,"observeEnter");Ee(this,"observeExit");Ee(this,"onEnterCallCount");Ee(this,"onExitCallCount");Ee(this,"onEnter");Ee(this,"onExit");Ee(this,"threshold");Ee(this,"unobserver");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 Nv{constructor(t={}){Ee(this,"targets");Ee(this,"intersectionObserver");Ee(this,"options");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 SO(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 EO={name:"resource-type-folder",color:"var(--oc-color-icon-folder)"},TO={name:"resource-type-folder",color:"var(--oc-role-secondary)"},AO={name:"layout-grid",color:"var(--oc-role-secondary)"},RO={name:"layout-grid",color:"var(--oc-role-secondary)"},_O={name:"resource-type-file",color:"var(--oc-role-on-surface)"},IO=Mp(),CO=xe({name:"ResourceIcon",props:{resource:{type:Object,required:!0},size:{type:String,default:"large",validator:e=>XP.some(t=>t===e)}},setup(e){const t=gr(Lp),n=B(()=>e.resource.type==="folder"||e.resource.isFolder),r=B(()=>e.resource.type==="space"),o=B(()=>Z.isProjectSpaceResource(e.resource)&&e.resource.disabled===!0),i=B(()=>Z.isPersonalSpaceResource(e.resource)),s=B(()=>{var l;return(l=e.resource.extension)==null?void 0:l.toLowerCase()}),a=B(()=>{var l;return(l=e.resource.mimeType)==null?void 0:l.toLowerCase()}),c=B(()=>{if(p(i))return TO;if(p(o))return RO;if(p(r))return AO;if(p(n))return EO;const l=IO[p(s)]||(t==null?void 0:t.mimeType[p(a)])||(t==null?void 0:t.extension[p(s)]);return{..._O,...l}}),u=B(()=>p(o)?"oc-resource-icon-space-disabled":p(r)?"oc-resource-icon-space":p(n)?"oc-resource-icon-folder":"oc-resource-icon-file");return{icon:c,iconTypeClass:u}}});function PO(e,t,n,r,o,i){const s=he("oc-icon");return X(),Re(s,{key:`resource-icon-${e.icon.name}`,name:e.icon.name,color:e.icon.color,size:e.size,class:H.normalizeClass(["oc-resource-icon",e.iconTypeClass])},null,8,["name","color","size","class"])}const Oo=We(CO,[["render",PO]]),FO={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=st(),{options:n}=Ue.storeToRefs(t);return{linkTarget:B(()=>p(n).cernFeatures&&e.link&&!e.resource.isFolder?"_blank":"_self")}},computed:{isNavigatable(){return(this.resource.isFolder||this.link)&&!this.resource.disabled},componentType(){return this.isNavigatable?"router-link":"oc-button"},componentProps(){return this.isNavigatable?{to:this.link}:{appearance:"raw",gapSize:"none",justifyContent:"left"}}},methods:{emitClick(){this.isNavigatable||this.$emit("click")}}},OO={key:1};function kO(e,t,n,r,o,i){return n.isResourceClickable?(X(),Re(Nr(i.componentType),Gt({key:0},i.componentProps,{target:e.linkTarget,draggable:!1,class:"oc-resource-link","no-hover":"",onDragstart:t[0]||(t[0]=Pn(()=>{},["prevent","stop"])),onClick:i.emitClick}),{default:Se(()=>[Xe(e.$slots,"default")]),_:3},16,["target","onClick"])):(X(),pe("span",OO,[Xe(e.$slots,"default")]))}const zf=We(FO,[["render",kO]]),xO=xe({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?fs.join(this.pathPrefix,this.fullPath):this.fullPath},htmlTitle(){if(!this.tooltip)return this.isExtensionDisplayed?`${this.displayName}${this.displayExtension}`:this.displayName}}}),NO=["data-test-resource-path","data-test-resource-name","data-test-resource-type","title"],$O={key:0,class:"oc-text-truncate"},DO=["textContent"],LO=["textContent"],MO=["textContent"];function BO(e,t,n,r,o,i){const s=ln("oc-tooltip");return ot((X(),pe("span",{class:H.normalizeClass(["oc-resource-name",[{"oc-display-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?(X(),pe("span",$O,[fe("span",{class:"oc-resource-basename",textContent:H.toDisplayString(e.displayName)},null,8,DO)])):(X(),pe("span",{key:1,class:"oc-resource-basename oc-text-break",textContent:H.toDisplayString(e.displayName)},null,8,LO)),e.extension&&e.isExtensionDisplayed?(X(),pe("span",{key:2,class:"oc-resource-extension",textContent:H.toDisplayString(e.displayExtension)},null,8,MO)):Ce("",!0)],10,NO)),[[s,e.tooltip]])}const Wf=We(xO,[["render",BO]]),jO=xe({name:"ResourceListItem",components:{ResourceIcon:Oo,ResourceLink:zf,ResourceName:Wf},props:{resource:{type:Object,required:!0},pathPrefix:{type:String,required:!1,default:""},link:{type:Object,required:!1,default:null},isPathDisplayed:{type:Boolean,required:!1,default:!1},parentFolderLink:{type:Object,required:!1,default:null},parentFolderName:{type:String,required:!1,default:""},parentFolderLinkIconAdditionalAttributes:{type:Object,required:!1,default:()=>({})},isExtensionDisplayed:{type:Boolean,required:!1,default:!0},isThumbnailDisplayed:{type:Boolean,required:!1,default:!0},isIconDisplayed:{type:Boolean,required:!1,default:!0},isResourceClickable:{type:Boolean,required:!1,default:!0}},emits:["click"],computed:{parentFolderComponentType(){return this.parentFolderLink?"router-link":"span"},parentFolderStyle(){return{cursor:this.parentFolderLink?"pointer":"default"}},parentFolderLinkIconAttrs(){return{"fill-type":"line",name:"folder-2",size:"small",...this.parentFolderLinkIconAdditionalAttributes}},hasThumbnail(){return this.isThumbnailDisplayed&&Object.prototype.hasOwnProperty.call(this.resource,"thumbnail")},thumbnail(){return this.resource.thumbnail},tooltipLabelIcon(){return this.resource.locked?this.$gettext("This item is locked"):null}},methods:{emitClick(){this.$emit("click")}}}),UO={class:"oc-resource-indicators"},qO=["textContent"];function VO(e,t,n,r,o,i){const s=he("oc-image"),a=he("resource-icon"),c=he("resource-link"),u=he("resource-name"),l=he("oc-icon"),d=ln("oc-tooltip");return X(),pe("div",{class:H.normalizeClass(["oc-resource oc-text-overflow",{"oc-resource-no-interaction":!e.isResourceClickable}])},[e.isIconDisplayed?(X(),Re(c,{key:0,resource:e.resource,link:e.link,"is-resource-clickable":e.isResourceClickable,class:"oc-resource-icon-link",onClick:e.emitClick},{default:Se(()=>[e.hasThumbnail?ot((X(),Re(s,{key:e.thumbnail,src:e.thumbnail,class:"oc-resource-thumbnail",width:"40",height:"40","aria-label":e.tooltipLabelIcon},null,8,["src","aria-label"])),[[d,e.tooltipLabelIcon]]):ot((X(),Re(a,{key:1,"aria-label":e.tooltipLabelIcon,resource:e.resource},null,8,["aria-label","resource"])),[[d,e.tooltipLabelIcon]])]),_:1},8,["resource","link","is-resource-clickable","onClick"])):Ce("",!0),fe("div",{class:H.normalizeClass(["oc-resource-details oc-text-overflow",{"oc-pl-s":e.isIconDisplayed}])},[ge(c,{resource:e.resource,"is-resource-clickable":e.isResourceClickable,link:e.link,class:"oc-text-overflow",onClick:e.emitClick},{default:Se(()=>[(X(),Re(u,{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","onClick"]),fe("div",UO,[e.isPathDisplayed?(X(),Re(Nr(e.parentFolderComponentType),{key:0,to:e.parentFolderLink,style:H.normalizeStyle(e.parentFolderStyle),class:"parent-folder oc-text-truncate"},{default:Se(()=>[ge(l,H.normalizeProps(rl(e.parentFolderLinkIconAttrs)),null,16),fe("span",{class:"text oc-text-truncate",textContent:H.toDisplayString(e.parentFolderName)},null,8,qO)]),_:1},8,["to","style"])):Ce("",!0)])],2)],2)}const ko=We(jO,[["render",VO]]),$v=xe({__name:"ResourcePreview",props:{searchResult:{default:()=>({data:{}})},isClickable:{type:Boolean,default:!0},term:{default:""}},setup(e){const t=new Nv,{triggerDefaultAction:n}=Xn(),{getMatchingSpace:r}=un(),{getDefaultAction:o}=Xn(),{loadPreview:i}=Zf(),s=Qa("resourceListItem"),{getPathPrefix:a,getParentFolderName:c,getParentFolderLink:u,getParentFolderLinkIconAdditionalAttributes:l,getFolderLink:d}=ui(),f=Qe(),m=ce(),w=B(()=>f.areFileExtensionsShown),y=B(()=>({...e.searchResult.data,...p(m)&&{thumbnail:p(m)}})),E=B(()=>r(p(y))),b=B(()=>{const _=p(y);return Z.isSpaceResource(_)&&_.disabled===!0}),g=()=>{n({space:p(E),resources:[p(y)]})},v=B(()=>e.isClickable?{parentFolderLink:u(p(y)),onClick:g}:{isResourceClickable:!1}),h=B(()=>{var $;if(p(y).isFolder)return d(p(y));const _=o({resources:[p(y)],space:p(E)});if(!(_!=null&&_.route))return null;const A=_.route({space:p(E),resources:[p(y)]});return A.query={...A.query,contextRouteQuery:{...(($=A.query)==null?void 0:$.contextRouteQuery)||{},term:e.term}},A}),S=a(p(y)),T=c(p(y)),R=l(p(y));return Bt(()=>{p(b)&&p(s).parentElement.classList.add("disabled");const _=async()=>{const $=await i({space:p(E),resource:p(y),dimensions:Qn.Thumbnail,cancelRunning:!0,updateStore:!1});$&&(m.value=$)},A=It.debounce(({unobserve:$})=>{$(),_()},250);t.observe(p(s).$el,{onEnter:A,onExit:A.cancel})}),Vn(()=>{t.disconnect()}),(_,A)=>(X(),Re(ko,Gt({ref_key:"resourceListItem",ref:s,resource:y.value,"path-prefix":p(S),"is-path-displayed":!0,link:h.value,"is-extension-displayed":w.value,"parent-folder-link-icon-additional-attributes":p(R),"parent-folder-name":p(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"]))}}),zO=7,WO=200,HO=xe({name:"CreateShortcutModal",components:{ResourcePreview:$v},props:{modal:{type:Object,required:!0},space:{type:Object,required:!0}},emits:["update:confirmDisabled"],setup(e,{emit:t,expose:n}){const r=Ge(),{$gettext:o}=Fe.useGettext(),{showMessage:i,showErrorMessage:s}=tt(),a=He(),{search:c}=kf(),{getPathPrefix:u,getParentFolderName:l,getParentFolderLink:d,getParentFolderLinkIconAdditionalAttributes:f,getFolderLink:m}=ui(),w=Qe(),{resources:y,currentFolder:E}=Ue.storeToRefs(w),b=ce(null),g=ce(""),v=ce(""),h=ce(null),S=ce(null),T=ce(!1);let R=null;const _=z=>{const q=z.trim();return K(q)?q:`https://${q}`},A=B(()=>_(p(g))),$=B(()=>!!p(y).find(z=>z.name===`${p(v)}.url`)),D=B(()=>p($)||!p(v)||!p(g));St(D,()=>{t("update:confirmDisabled",p(D))},{immediate:!0});const N=B(()=>p($)?o("»%{name}« already exists",{name:`${p(v)}.url`}):/[/]/.test(p(v))?o('Shortcut name cannot contain "/"'):""),x=pn.useTask(function*(z,q){h.value=null,q=`name:"*${q}*" NOT name:"*.url"`;try{h.value=yield c(q,zO)}catch{}}),W=It.debounce(()=>{x.perform(p(g))},WO),K=z=>["http://","https://"].some(M=>M.startsWith(z)||z.startsWith(M)),le=()=>{h.value=null,g.value=p(A);try{let z=new URL(p(A)).host;p(y).some(q=>q.name===`${z}.url`)&&(z=zn(`${z}.url`,"url",p(y)).slice(0,-4)),v.value=z}catch{}},be=z=>{h.value=null;const q=new URL(window.location.href);let M=z.data.name;g.value=`${q.origin}/f/${z.id}`,p(y).some(V=>V.name===`${M}.url`)&&(M=zn(`${M}.url`,"url",p(y)).slice(0,-4)),v.value=M},te=z=>p(S)===z,ae=(z=!1)=>{const q=Array.from(document.querySelectorAll("li.selectable-item"));let M=p(S)!==null?p(S):z?q.length:-1;const V=z?-1:1;do if(M+=V,M<0||M>q.length-1)return null;while(q[M].classList.contains("disabled"));return M},ue=()=>{S.value=ae(!0)},ie=()=>{S.value=ae(!1)},G=z=>{p(T)&&(z.stopPropagation(),p(b).hide())},re=z=>{var q,M;p(T)&&(z.stopPropagation(),p(S)!==null&&(p(S)===0?le():be((M=(q=p(h))==null?void 0:q.values)==null?void 0:M[p(S)-1]),p(b).hide()))},se=()=>{T.value=!1,S.value=null},Ie=()=>{T.value=!0,S.value=0},ee=()=>{g.value.trim().length&&p(b).show()},F=async()=>{if(await In(),v.value=g.value.trim(),!g.value.trim().length){p(b).hide();return}p(b).show(),Fn(a,"files-public-link")||W()},C=async()=>{try{const q=`[InternetShortcut]
52
+ URL=${dd.sanitize(_(p(g)),{USE_PROFILES:{html:!0}})}`,M=Z.urlJoin(p(E).path,`${p(v)}.url`),V=await r.webdav.putFileContents(e.space,{path:M,content:q});w.upsertResource(V),i({title:o("Shortcut was created successfully")})}catch(z){console.error(z),s({title:o("Failed to create shortcut"),errors:[z]})}};return Bt(async()=>{var z,q;await In(),R=new pd((q=(z=p(b))==null?void 0:z.$refs)==null?void 0:q.drop)}),St(h,async()=>{await In(),!(!p(T)||!R)&&(R.unmark(),R.mark(p(g),{element:"span",className:"mark-highlight",exclude:[".selectable-item-url *",".create-shortcut-modal-search-separator *"]}))},{deep:!0}),St(S,()=>{var q,M;if(!p(T)||typeof((M=(q=p(b))==null?void 0:q.$el)==null?void 0:M.scrollTo)!="function")return;const z=p(b).$el.querySelectorAll(".selectable-item");p(b).$el.scrollTo(0,p(S)===null?0:z[p(S)].getBoundingClientRect().y-z[p(S)].getBoundingClientRect().height)}),n({onConfirm:C}),{inputUrl:g,inputFilename:v,dropRef:b,dropItemUrl:A,searchResult:h,confirmButtonDisabled:D,inputFileNameErrorMessage:N,searchTask:x,dropItemUrlClicked:le,dropItemResourceClicked:be,getPathPrefix:u,getFolderLink:m,getParentFolderLink:d,getParentFolderName:l,getParentFolderLinkIconAdditionalAttributes:f,onKeyEnterDrop:re,onKeyDownDrop:ie,onKeyUpDrop:ue,onKeyEscDrop:G,onHideDrop:se,onShowDrop:Ie,onInputUrlInput:F,onClickUrlInput:ee,isDropItemActive:te,onConfirm:C}}}),GO={class:"oc-flex oc-flex-middle create-shortcut-modal-label"},KO={for:"create-shortcut-modal-url-input"},QO=["textContent"],XO={key:0,class:"oc-p-xs oc-flex oc-flex-center"},YO={class:"create-shortcut-modal-search-separator oc-text-muted oc-text-small oc-pl-xs"},JO=["textContent"],ZO={key:0,class:"oc-flex oc-width-1-1 oc-mt-m"},ek={class:"oc-flex oc-flex-middle create-shortcut-modal-label"},tk={for:"create-shortcut-modal-filename-input"};function nk(e,t,n,r,o,i){const s=he("oc-contextual-helper"),a=he("oc-text-input"),c=he("oc-icon"),u=he("oc-button"),l=he("oc-spinner"),d=he("resource-preview"),f=he("oc-list"),m=he("oc-drop");return X(),pe(qe,null,[ge(a,{id:"create-shortcut-modal-url-input",modelValue:e.inputUrl,"onUpdate:modelValue":[t[0]||(t[0]=w=>e.inputUrl=w),e.onInputUrlInput],placeholder:"example.org",label:e.$gettext("Webpage or file"),onKeydown:[no(e.onKeyUpDrop,["up"]),no(e.onKeyDownDrop,["down"]),no(e.onKeyEscDrop,["esc"]),no(e.onKeyEnterDrop,["enter"])],onClick:e.onClickUrlInput},{label:Se(()=>[fe("div",GO,[fe("label",KO,[Ot(H.toDisplayString(e.$gettext("Webpage or file"))+" ",1),t[2]||(t[2]=fe("span",{class:"oc-text-error","aria-hidden":"true"},"*",-1))]),ge(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:"oc-ml-xs"},null,8,["text","title"])])]),_:1},8,["modelValue","label","onKeydown","onUpdate:modelValue","onClick"]),ge(m,{ref:"dropRef",class:"oc-pt-s","padding-size":"remove","drop-id":"create-shortcut-modal-contextmenu",mode:"manual",position:"bottom-start","close-on-click":!0,onHideDrop:e.onHideDrop,onShowDrop:e.onShowDrop},{default:Se(()=>[ge(f,null,{default:Se(()=>{var w,y;return[fe("li",{class:H.normalizeClass(["oc-p-xs selectable-item selectable-item-url",{active:e.isDropItemActive(0)}])},[ge(u,{class:"oc-width-1-1",appearance:"raw","justify-content":"left",onClick:e.dropItemUrlClicked},{default:Se(()=>[ge(c,{name:"external-link"}),fe("span",{textContent:H.toDisplayString(e.dropItemUrl)},null,8,QO)]),_:1},8,["onClick"])],2),e.searchTask.isRunning?(X(),pe("li",XO,[ge(l)])):Ce("",!0),(y=(w=e.searchResult)==null?void 0:w.values)!=null&&y.length?(X(),pe(qe,{key:1},[fe("li",YO,[fe("span",{textContent:H.toDisplayString(e.$gettext("Link to a file"))},null,8,JO)]),(X(!0),pe(qe,null,wt(e.searchResult.values,(E,b)=>(X(),pe("li",{key:b,class:H.normalizeClass(["oc-p-xs selectable-item",{active:e.isDropItemActive(b+1)}])},[ge(u,{class:"oc-width-1-1",appearance:"raw","justify-content":"left",onClick:g=>e.dropItemResourceClicked(E)},{default:Se(()=>[ge(d,{"search-result":E,"is-clickable":!1},null,8,["search-result"])]),_:2},1032,["onClick"])],2))),128))],64)):Ce("",!0)]}),_:1})]),_:1},8,["onHideDrop","onShowDrop"]),e.inputFilename?(X(),pe("div",ZO,[ge(a,{id:"create-shortcut-modal-filename-input",modelValue:e.inputFilename,"onUpdate:modelValue":t[1]||(t[1]=w=>e.inputFilename=w),label:e.$gettext("Shortcut name"),class:"oc-width-1-1","error-message":e.inputFileNameErrorMessage,"fix-message-line":!0},{label:Se(()=>[fe("div",ek,[fe("label",tk,[Ot(H.toDisplayString(e.$gettext("Shortcut name"))+" ",1),t[3]||(t[3]=fe("span",{class:"oc-text-error","aria-hidden":"true"},"*",-1))]),ge(s,{text:e.$gettext("Shortcut name as it will appear in the file list."),title:e.$gettext("Shortcut name"),class:"oc-ml-xs"},null,8,["text","title"])])]),_:1},8,["modelValue","label","error-message"])])):Ce("",!0)],64)}const Dv=We(HO,[["render",nk]]),rk=({space:e})=>{const{dispatchModal:t}=pt(),{$gettext:n}=Fe.useGettext(),r=Qe(),{currentFolder:o}=Ue.storeToRefs(r);return{actions:B(()=>[{name:"create-shortcut",icon:"external-link",handler:()=>{t({title:n("Create a Shortcut"),confirmText:n("Create"),customComponent:Dv,customComponentAttrs:()=>({space:p(e)})})},label:()=>n("New Shortcut"),isVisible:()=>{var s;return(s=p(o))==null?void 0:s.canCreate()},class:"oc-files-actions-create-new-shortcut"}])}},ik=()=>{const{showErrorMessage:e}=tt(),t=He(),{$gettext:n}=Fe.useGettext(),r=_r(),o=sa(),i=Ge(),s=u=>{const l=/URL=(.+)/,d=u.match(l);if(d&&d[1])return d[1];throw new Error("unable to extract url")},a=async({resources:u,space:l})=>{try{const d=new URL(window.location.href),f=(await i.webdav.getFileContents(l,u[0])).body;let m=s(f);if(m=m.match(/^http[s]?:\/\//)?m:`https://${m}`,m=dd.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:B(()=>[{name:"open-shortcut",icon:"external-link",category:"context",handler:a,label:()=>n("Open shortcut"),isVisible:({resources:u})=>p(r)&&!p(o)&&!ht(t,"files-spaces-generic")&&!Fn(t,"files-public-link")&&!Ct(t,"files-common-favorites")&&!Ct(t,"files-common-search")&&!jt(t,"files-shares-with-me")&&!jt(t,"files-shares-with-others")&&!jt(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}},ga=()=>{const{$gettext:e}=Fe.useGettext(),t=sn(),n=mn(),r=B(()=>n.can("create-all","PublicLink")),o=B(()=>wn.View),i=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})=>p(r)?u?[wn.View,wn.Edit,wn.CreateOnly]:[wn.View,wn.Edit]:[],a=[{id:wn.Internal,displayName:e("Invited people"),description:e("Link works only for invited people. Login is required."),icon:"user"},{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:o,isPasswordEnforcedForLinkType:i,getAvailableLinkTypes:s,linkShareRoles:a,getLinkRoleByType:u=>a.find(({id:l})=>l===u)}},ok=xe({name:"LinkRoleDropdown",props:{modelValue:{type:Object,required:!0},availableLinkTypeOptions:{type:Array,required:!0},dropOffset:{type:String,default:void 0}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=Fe.useGettext(),{getLinkRoleByType:r}=ga(),o=c=>e.modelValue===c,i=c=>{t("update:modelValue",c)},s=B(()=>{var c;return n((c=r(e.modelValue))==null?void 0:c.displayName)}),a=en.v4();return{isSelectedType:o,updateSelectedType:i,currentLinkRoleLabel:s,dropUuid:a,getLinkRoleByType:r}}}),sk=["textContent"],ak=["textContent"],lk={class:"oc-flex oc-flex-middle"},ck=["textContent"],uk={class:"oc-text-small"},fk={class:"oc-flex"};function dk(e,t,n,r,o,i){var d;const s=he("oc-icon"),a=he("oc-button"),c=he("oc-list"),u=he("oc-drop"),l=ln("oc-tooltip");return X(),pe(qe,null,[e.availableLinkTypeOptions.length>1?(X(),Re(a,{key:0,id:`link-role-dropdown-toggle-${e.dropUuid}`,appearance:"raw","gap-size":"none","no-hover":"",class:"oc-text-left link-role-dropdown-toggle"},{default:Se(()=>[fe("span",{class:"link-current-role",textContent:H.toDisplayString(e.currentLinkRoleLabel||e.$gettext("Select a role"))},null,8,sk),ge(s,{name:"arrow-down-s"})]),_:1},8,["id"])):ot((X(),pe("span",{key:1,class:"link-current-role oc-mr-m",textContent:H.toDisplayString(e.currentLinkRoleLabel)},null,8,ak)),[[l,(d=e.getLinkRoleByType(e.modelValue))==null?void 0:d.description]]),e.availableLinkTypeOptions.length>1?(X(),Re(u,{key:2,class:"link-role-dropdown","drop-id":`link-role-dropdown-${e.dropUuid}`,toggle:`#link-role-dropdown-toggle-${e.dropUuid}`,"padding-size":"small",mode:"click",offset:e.dropOffset,"close-on-click":""},{default:Se(()=>[ge(c,{class:"role-dropdown-list"},{default:Se(()=>[(X(!0),pe(qe,null,wt(e.availableLinkTypeOptions,(f,m)=>(X(),pe("li",{key:`role-dropdown-${m}`},[ge(a,{id:`files-role-${e.getLinkRoleByType(f).id}`,class:H.normalizeClass([{selected:e.isSelectedType(f),"oc-secondary-container":e.isSelectedType(f)},"oc-p-s"]),appearance:"raw","justify-content":"space-between",onClick:w=>e.updateSelectedType(f)},{default:Se(()=>[fe("span",lk,[ge(s,{name:e.getLinkRoleByType(f).icon,class:"oc-pl-s oc-pr-m"},null,8,["name"]),fe("span",null,[fe("span",{class:"role-dropdown-list-option-label oc-text-bold oc-display-block oc-width-1-1",textContent:H.toDisplayString(e.$gettext(e.getLinkRoleByType(f).displayName))},null,8,ck),fe("span",uk,H.toDisplayString(e.$gettext(e.getLinkRoleByType(f).description)),1)])]),fe("span",fk,[e.isSelectedType(f)?(X(),Re(s,{key:0,name:"check"})):Ce("",!0)])]),_:2},1032,["id","class","onClick"])]))),128))]),_:1})]),_:1},8,["drop-id","toggle","offset"])):Ce("",!0)],64)}const Lv=We(ok,[["render",dk],["__scopeId","data-v-dbec00f6"]]),pk=xe({name:"CreateLinkModal",components:{LinkRoleDropdown:Lv},props:{modal:{type:Object,required:!0},resources:{type:Array,required:!0},space:{type:Object,default:void 0},callbackFn:{type:Function,default:void 0}},emits:["cancel","confirm"],setup(e,{expose:t}){const n=Ge(),r=Fe.useGettext(),{$gettext:o}=r,i=e0(),{isEnabled:s,postMessage:a}=si(),{defaultLinkType:c,getAvailableLinkTypes:u,getLinkRoleByType:l,isPasswordEnforcedForLinkType:d}=ga(),{addLink:f}=Tr(),m=ce(!1),w=ce(!1),y=B(()=>e.resources.every(({isFolder:ie})=>ie)),E=B(()=>p(s)?o("Share link(s)"):o("Copy link")),b=ce(en.v4()),g=ce({}),v=ce(),h=Ba({value:"",error:void 0}),S=ce(p(c)),T=B(()=>o(l(p(S)).description)),R=B(()=>o(l(p(S)).displayName)),_=B(()=>l(p(S)).icon),A=B(()=>u({isFolder:p(y)})),$=B(()=>d(p(S))),D=i.getPolicy({enforcePassword:p($)}),N=()=>{m.value=!0},x=({date:ie,error:G})=>{v.value=ie,w.value=G},W=()=>Promise.allSettled(e.resources.map(ie=>{var G;return f({clientService:n,space:e.space,resource:ie,options:{type:p(S),"@libre.graph.quickLink":!1,password:p(h).value,expirationDateTime:(G=p(v))==null?void 0:G.toISO(),displayName:o("Unnamed link")}})})),K=B(()=>!!D.check(p(h).value)),le=B(()=>!(p(K)&&!p(w))),be=async(ie={})=>{const G=await W(),re=G.filter(({status:ee})=>ee==="fulfilled");re.length&&p(s)&&a("opencloud-embed:share",re.map(({value:ee})=>ee.webUrl));const se=[],Ie=G.filter(({status:ee})=>ee==="rejected");if(Ie.length&&Ie.map(({reason:ee})=>ee).forEach(ee=>{var F;if(console.error(ee),((F=ee.response)==null?void 0:F.status)===400){const C=ee.response.data.error;C.message=It.upperFirst(C.message),se.push(C)}}),se.length)return h.error=o(se[0].message),Promise.reject();e.callbackFn&&e.callbackFn({result:G,password:h.value,options:ie})};t({onConfirm:be});const te=ie=>p(S)===ie,ae=ie=>{h.value=ie,h.error=void 0},ue=ie=>{S.value=ie};return Bt(()=>{const ie=p(g)[p(S)];ie&&ie.$el.focus(),p($)&&(h.value=i.generatePassword())}),{roleRefs:g,password:h,passwordEnforced:$,passwordPolicy:D,generatePasswordMethod:()=>i.generatePassword(),passwordInputKey:b,selectedExpiry:v,availableLinkTypes:A,selectedType:S,selectedTypeIcon:_,selectedTypeDisplayName:R,selectedTypeDescription:T,isSelectedLinkType:te,updateSelectedLinkType:ue,updatePassword:ae,getLinkRoleByType:l,confirmButtonText:E,isAdvancedMode:m,setAdvancedMode:N,onExpiryDateChanged:x,confirmButtonDisabled:le,DateTime:qt.DateTime,onConfirm:be}}}),hk={class:"oc-flex oc-button-justify-content-space-between oc-pb-s"},gk={key:0,class:"oc-flex oc-flex-middle"},mk={key:1,class:"oc-flex oc-flex-middle"},yk={class:"oc-flex oc-flex-column"},bk=["textContent"],vk=["textContent"],wk=["textContent"],Sk={class:"link-modal-password oc-mb-m"},Ek={key:1,class:"link-modal-password-text oc-text-small oc-text-muted"},Tk=["textContent"],Ak=["textContent"],Rk={class:"link-modal-actions oc-flex oc-flex-right oc-flex-middle oc-mt-s"},_k={class:"oc-rounded oc-menu-item-hover"};function Ik(e,t,n,r,o,i){const s=he("oc-icon"),a=he("link-role-dropdown"),c=he("oc-button"),u=he("oc-text-input"),l=he("oc-datepicker"),d=he("oc-list"),f=he("oc-drop");return X(),pe(qe,null,[fe("div",hk,[e.isAdvancedMode?(X(),pe("div",gk,[ge(s,{class:"oc-mr-s",name:e.selectedTypeIcon,"fill-type":"line"},null,8,["name"]),ge(a,{"model-value":e.selectedType,"available-link-type-options":e.availableLinkTypes,"onUpdate:modelValue":e.updateSelectedLinkType},null,8,["model-value","available-link-type-options","onUpdate:modelValue"])])):(X(),pe("div",mk,[ge(s,{class:"oc-mr-s",name:e.selectedTypeIcon,"fill-type":"line"},null,8,["name"]),fe("div",yk,[fe("span",{class:"oc-text-bold",textContent:H.toDisplayString(e.selectedTypeDisplayName)},null,8,bk),fe("span",{class:"oc-text-small",textContent:H.toDisplayString(e.selectedTypeDescription)},null,8,vk)])])),e.isAdvancedMode?Ce("",!0):(X(),Re(c,{key:2,class:"link-modal-advanced-mode-button","gap-size":"xsmall",appearance:"raw","no-hover":"",onClick:t[0]||(t[0]=m=>e.setAdvancedMode())},{default:Se(()=>[ge(s,{name:"settings-3",size:"small","fill-type":"fill"}),fe("span",{textContent:H.toDisplayString(e.$gettext("Options"))},null,8,wk)]),_:1}))]),fe("div",Sk,[e.isAdvancedMode?(X(),Re(u,{key:e.passwordInputKey,"model-value":e.password.value,type:"password","password-policy":e.passwordPolicy,"generate-password-method":e.generatePasswordMethod,"error-message":e.password.error,label:e.$gettext("Password"),"required-mark":e.passwordEnforced,class:"link-modal-password-input","onUpdate:modelValue":e.updatePassword},null,8,["model-value","password-policy","generate-password-method","error-message","label","required-mark","onUpdate:modelValue"])):e.password.value?(X(),pe("div",Ek,[fe("span",{textContent:H.toDisplayString(e.$gettext("Password:"))},null,8,Tk),fe("span",{textContent:H.toDisplayString(e.password.value)},null,8,Ak)])):Ce("",!0),e.isAdvancedMode?(X(),Re(l,{key:2,class:"oc-mt-s","min-date":e.DateTime.now(),label:e.$gettext("Expiry date"),onDateChanged:e.onExpiryDateChanged},null,8,["min-date","label","onDateChanged"])):Ce("",!0)]),fe("div",Rk,[ge(c,{class:"link-modal-cancel oc-modal-body-actions-cancel oc-ml-s",onClick:t[1]||(t[1]=m=>e.$emit("cancel"))},{default:Se(()=>[Ot(H.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),fe("div",{class:H.normalizeClass(["link-modal-confirm-button-group oc-ml-s",{"oc-button-group":e.password.value}])},[ge(c,{class:"link-modal-confirm oc-modal-body-actions-confirm",appearance:"filled",disabled:e.confirmButtonDisabled,onClick:t[2]||(t[2]=m=>e.$emit("confirm"))},{default:Se(()=>[Ot(H.toDisplayString(e.confirmButtonText),1)]),_:1},8,["disabled"]),e.password.value?(X(),Re(c,{key:0,class:"link-modal-confirm oc-modal-body-actions-confirm-secondary-trigger",appearance:"filled",disabled:e.confirmButtonDisabled},{default:Se(()=>[ge(s,{size:"small",name:"arrow-down-s"})]),_:1},8,["disabled"])):Ce("",!0),e.password.value?(X(),Re(f,{key:1,"drop-id":"oc-modal-body-actions-confirm-secondary-drop",toggle:".oc-modal-body-actions-confirm-secondary-trigger",mode:"click","padding-size":"small","close-on-click":""},{default:Se(()=>[ge(d,{class:"oc-modal-body-actions-confirm-secondary-menu"},{default:Se(()=>[fe("li",_k,[ge(c,{class:"oc-modal-body-actions-confirm-password action-menu-item",appearance:"raw",onClick:t[3]||(t[3]=m=>e.$emit("confirm",{copyPassword:!0}))},{default:Se(()=>[Ot(H.toDisplayString(e.$gettext("Copy link and password")),1)]),_:1})])]),_:1})]),_:1})):Ce("",!0)],2)])],64)}const Mv=We(pk,[["render",Ik],["__scopeId","data-v-6dfdb5d3"]]),Ck=({enforceModal:e=!1}={})=>{const t=Ge(),n=yt(),{showMessage:r,showErrorMessage:o}=tt(),{$gettext:i,$ngettext:s}=Fe.useGettext(),a=sn(),c=mn(),u=fn(),{defaultLinkType:l}=ga(),{addLink:d}=Tr(),{dispatchModal:f}=pt(),{copyToClipboard:m}=Df(),w=async({result:g,password:v,options:h={}})=>{const S=g.filter(R=>R.status==="fulfilled");if(S.length){let R=i("Link has been created successfully");if(g.length===1)try{const _=h.copyPassword?i("%{link} Password:%{password}",{link:S[0].value.webUrl,password:v},!0):S[0].value.webUrl;await m(_),R=i("The link has been copied to your clipboard.")}catch(_){console.warn("Unable to copy link to clipboard",_)}r({title:s(R,"Links have been created successfully.",S.length)})}const T=g.filter(({status:R})=>R==="rejected");T.length&&o({errors:T.map(({reason:R})=>R),title:s("Failed to create link","Failed to create links",T.length)})},y=async({space:g,resources:v})=>{const h=a.sharingPublicPasswordEnforcedFor.read_only===!0;if(e||h){f({title:s("Copy link for »%{resourceName}«","Copy links for the selected items",v.length,{resourceName:v[0].name}),customComponent:Mv,customComponentAttrs:()=>({space:g,resources:v,callbackFn:w}),hideActions:!0});return}const S=v.map(R=>d({clientService:t,space:g,resource:R,options:{"@libre.graph.quickLink":!1,displayName:i("Unnamed link"),type:p(l)}})),T=await u.addTask(()=>Promise.allSettled(S));w({result:T})},E=({resources:g})=>{if(!g.length)return!1;for(const v of g)if(!v.canShare({user:n.user,ability:c})||Z.isProjectSpaceResource(v)&&v.disabled)return!1;return!0};return{actions:B(()=>[{name:"create-links",icon:"link",handler:y,label:()=>i("Create links"),isVisible:E,class:"oc-files-actions-create-links"}])}},Pk=xe({name:"AppLoadingSpinner"}),Fk={class:"oc-flex oc-flex-middle oc-flex-center oc-height-1-1 oc-width-1-1"};function Ok(e,t,n,r,o,i){const s=he("oc-spinner");return X(),pe("div",Fk,[ge(s,{id:"app-loading-spinner",size:"large","aria-hidden":!0,"aria-label":""})])}const Hf=We(Pk,[["render",Ok]]),kk=xe({name:"FilePickerModal",components:{AppLoadingSpinner:Hf},props:{modal:{type:Object,required:!0},app:{type:Object,required:!0},parentFolderLink:{type:Object,required:!0}},setup(e){const t=ce(),n=ce(!0),r=He(),{removeModal:o}=pt(),{getMatchingSpace:i}=un(),s=ai(),{getEditorRouteOpts:a}=Xn(),c=r.resolve(e.parentFolderLink),u=e.app.extensions.map(y=>y.extension?y.extension:y.mimeType),l=s.currentTheme.name,d=new URL(c.href,window.location.origin);d.searchParams.append("hide-logo","true"),d.searchParams.append("embed","true"),d.searchParams.append("embed-target","file"),d.searchParams.append("embed-delegate-authentication","false"),d.searchParams.append("embed-file-types",u.join(","));const f=()=>{n.value=!1,p(t).contentWindow.focus()},m=({data:y})=>{if(y.name!=="opencloud-embed:file-pick")return;const{resource:E,locationQuery:b}=y.data,g=i(E),v=Z.isShareSpaceResource(g)?g.id:void 0,h=a(p(r.currentRoute).name,g,E,v);h.query={...h.query,...b};const S=r.resolve(h),T=new URL(S.href,window.location.origin);o(e.modal.id),window.open(T.href,"_blank")},w=({data:y})=>{y.name==="opencloud-embed:cancel"&&o(e.modal.id)};return Bt(()=>{window.addEventListener("message",m),window.addEventListener("message",w)}),Vn(()=>{window.removeEventListener("message",m),window.removeEventListener("message",w)}),{isLoading:n,onLoad:f,iframeTitle:l,iframeSrc:d.href,iframeRef:t,onFilePick:m}}}),xk={class:"oc-height-1-1",tabindex:"0"},Nk=["title","src"];function $k(e,t,n,r,o,i){const s=he("app-loading-spinner");return X(),pe("div",xk,[e.isLoading?(X(),Re(s,{key:0})):Ce("",!0),ot(fe("iframe",{ref:"iframeRef",class:"oc-width-1-1 oc-height-1-1",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...a)=>e.onLoad&&e.onLoad(...a))},null,40,Nk),[[ll,!e.isLoading]])])}const Bv=We(kk,[["render",$k]]),ma=(e={},t)=>{const n=e.targetRouteCallback,{getMatchingSpace:r}=un(e);return{createFileAction:s=>{const a=p(e.space)||r(s);t.emit("fileClick",{space:a,resources:[s]})},createFolderLink:s=>{if(p(n))return p(n)(s);const{path:a,fileId:c,resource:u}=s,l=p(e.space)||r(u);return l?Nn("files-spaces-generic",ir(l,{path:a,fileId:c})):{}}}},ui=(e={})=>{const t=sn(),{$gettext:n}=Fe.useGettext(),{getInternalSpace:r,getMatchingSpace:o,isResourceAccessible:i}=un(),{createFolderLink:s}=ma(e);return{getPathPrefix:f=>{const m=p(e.space)||o(f);return Z.isProjectSpaceResource(m)?fs.join(n("Spaces"),m.name):Z.isShareSpaceResource(m)?fs.join(n("Shares"),m.name):m.name},getFolderLink:f=>s({path:f.path,fileId:f.fileId,resource:f}),getParentFolderLink:f=>{const m=p(e.space)||o(f),w=i({space:m,path:dt.dirname(f.path)});return f.remoteItemId&&f.path==="/"||!w?$n("files-shares-with-me"):Z.isProjectSpaceResource(f)?Nn("files-spaces-projects"):s({path:dt.dirname(f.path),...f.parentFolderId&&{fileId:f.parentFolderId},resource:f})},getParentFolderName:f=>{const m=p(e.space)||o(f),w=i({space:m,path:dt.dirname(f.path)});if(Z.isShareRoot(f)||f.id===m.id&&Z.isShareSpaceResource(m)||!w)return n("Shared with me");const E=Z.extractParentFolderName(f);if(E)return E;if(Z.isShareSpaceResource(m))return m.name;if(t.spacesProjects){if(Z.isProjectSpaceResource(f))return n("Spaces");if((m==null?void 0:m.driveType)==="project")return m.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"}:{}}},jv=({appId:e})=>{const{$gettext:t}=Fe.useGettext(),n=_r(),{dispatchModal:r}=pt(),o=or(),{apps:i}=Ue.storeToRefs(o),{getParentFolderLink:s}=ui(),a=({resources:u})=>{const l=p(i)[e],d=s(u[0]);r({elementClass:"open-with-app-modal",title:t("Open file in %{app}",{app:l.name}),customComponent:Bv,hideActions:!0,customComponentAttrs:()=>({app:l,parentFolderLink:d}),focusTrapInitial:!1})};return{actions:B(()=>[{name:"open-with-app",icon:"folder-open",handler:a,label:()=>t("Open"),isVisible:()=>!p(n),class:"oc-files-actions-open-with-app-trigger"}])}},Dk=xe({name:"SaveAsModal",components:{AppLoadingSpinner:Hf},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=ce(),n=ce(!0),r=ai(),{$gettext:o}=Fe.useGettext(),i=He(),s=Ge(),{removeModal:a}=pt(),{showMessage:c,showErrorMessage:u}=tt(),{getMatchingSpace:l}=un(),{getEditorRouteOpts:d}=Xn(),f=i.resolve(e.parentFolderLink),m=r.currentTheme.name,w=new URL(f.href,window.location.origin);w.searchParams.append("hide-logo","true"),w.searchParams.append("embed","true"),w.searchParams.append("embed-target","location"),w.searchParams.append("embed-choose-file-name","true"),w.searchParams.append("embed-delegate-authentication","false"),w.searchParams.append("embed-choose-file-name-suggestion",e.originalResource.name);const y=()=>{n.value=!1,p(t).contentWindow.focus()},E=async({data:h})=>{if(h.name!=="opencloud-embed:select")return;const{resources:S,fileName:T,locationQuery:R}=h.data,_=S[0],A=l(_);try{const $=await b({destinationFolder:_,fileName:T,space:A});c({title:o("»%{fileName}« was saved successfully",{fileName:$.name})}),g({resource:$,space:A,locationQuery:R})}catch($){console.error($),u({title:o("Unable to save »%{fileName}«",{fileName:T}),errors:[$]}),console.error($)}a(e.modal.id)},b=async({destinationFolder:h,fileName:S,space:T})=>{const{children:R}=await s.webdav.listFiles(T,{fileId:h.fileId},{davProperties:[je.Name]});return R.find(A=>A.name===S)&&(S=zn(S,e.originalResource.extension,R)),s.webdav.putFileContents(T,{fileName:S,parentFolderId:h.id,content:e.content,path:Z.urlJoin(h.path,S)})},g=({locationQuery:h,resource:S,space:T})=>{const R=Z.isShareSpaceResource(T)?T.id:void 0,_=d(p(i.currentRoute).name,T,S,R);_.query={..._.query,...h};const A=i.resolve(_),$=new URL(A.href,window.location.origin);window.open($.href,"_blank")},v=({data:h})=>{h.name==="opencloud-embed:cancel"&&a(e.modal.id)};return Bt(()=>{window.addEventListener("message",E),window.addEventListener("message",v)}),Vn(()=>{window.removeEventListener("message",E),window.removeEventListener("message",v)}),{isLoading:n,onLoad:y,iframeTitle:m,iframeSrc:w.href,iframeRef:t,onLocationPick:E}}}),Lk={class:"oc-height-1-1",tabindex:"0"},Mk=["title","src"];function Bk(e,t,n,r,o,i){const s=he("app-loading-spinner");return X(),pe("div",Lk,[e.isLoading?(X(),Re(s,{key:0})):Ce("",!0),ot(fe("iframe",{ref:"iframeRef",class:"oc-width-1-1 oc-height-1-1",title:e.iframeTitle,src:e.iframeSrc,tabindex:"0",onLoad:t[0]||(t[0]=(...a)=>e.onLoad&&e.onLoad(...a))},null,40,Mk),[[ll,!e.isLoading]])])}const Uv=We(Dk,[["render",Bk]]),qv=({content:e})=>{const{$gettext:t}=Fe.useGettext(),n=_r(),{dispatchModal:r}=pt(),{getParentFolderLink:o}=ui(),i=({resources:a})=>{const c=o(a[0]);r({elementClass:"save-as-modal",title:t("Save as"),customComponent:Uv,hideActions:!0,customComponentAttrs:()=>({content:p(e),parentFolderLink:c,originalResource:a[0]}),focusTrapInitial:!1})};return{actions:B(()=>[{name:"save-as",icon:"save-2",handler:i,label:()=>t("Save as"),isVisible:({resources:a})=>!p(n)||a.length!==1,class:"oc-files-actions-save-as-trigger"}])}},Vv=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=yt(),{$gettext:r,$ngettext:o}=Fe.useGettext(),i=mn(),s=Ge(),a=Kt(),{dispatchModal:c}=pt(),u=at(),{removeResources:l}=Qe(),d=y=>y.filter(E=>Z.isProjectSpaceResource(E)&&E.canBeDeleted({user:n.user,ability:i})),f=async y=>{const E=s.graphAuthenticated,b=y.map(S=>E.drives.deleteDrive(S.id).then(()=>(l([S]),u.removeSpace(S),!0))),g=await Promise.allSettled(b),v=g.filter(S=>S.status==="fulfilled");if(v.length){const S=v.length===1&&y.length===1?r("Space »%{space}« was deleted successfully",{space:y[0].name}):o("%{spaceCount} space was deleted successfully","%{spaceCount} spaces were deleted successfully",v.length,{spaceCount:v.length.toString()},!0);e({title:S})}const h=g.filter(S=>S.status==="rejected");if(h.length){h.forEach(console.error);const S=h.length===1&&y.length===1?r("Failed to delete space »%{space}«",{space:y[0].name}):o("Failed to delete %{spaceCount} space","Failed to delete %{spaceCount} spaces",h.length,{spaceCount:h.length.toString()},!0);t({title:S,errors:h.map(T=>T.reason)})}p(a).name==="admin-settings-spaces"&&Ke.publish("app.admin-settings.list.load")},m=({resources:y})=>{const E=d(y);if(!E.length)return;const b=o("Are you sure you want to delete the selected space?","Are you sure you want to delete %{count} selected spaces?",E.length,{count:E.length.toString()});c({title:o("Delete Space »%{space}«?","Delete %{spaceCount} Spaces?",E.length,{space:E[0].name,spaceCount:E.length.toString()}),confirmText:r("Delete"),message:b,hasInput:!1,onConfirm:()=>f(E)})};return{actions:B(()=>[{name:"delete",icon:"delete-bin",label:()=>r("Delete"),handler:m,isVisible:({resources:y})=>!!d(y).length,class:"oc-files-actions-delete-trigger"}]),deleteSpaces:f}},zv=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=yt(),{$gettext:r,$ngettext:o}=Fe.useGettext(),i=mn(),s=Ge(),a=Kt(),c=He(),{dispatchModal:u}=pt(),l=at(),d=y=>y.filter(E=>Z.isProjectSpaceResource(E)&&E.canDisable({user:n.user,ability:i})),f=async y=>{const E=p(a),b=s.graphAuthenticated,g=y.map(T=>b.drives.disableDrive(T.id).then(()=>(E.name==="files-spaces-generic"&&c.push({name:"files-spaces-projects"}),E.name==="admin-settings-spaces"&&(T.disabled=!0,T.spaceQuota={total:T.spaceQuota.total}),l.updateSpaceField({id:T.id,field:"disabled",value:!0}),!0))),v=await Promise.allSettled(g),h=v.filter(T=>T.status==="fulfilled");if(h.length){const T=h.length===1&&y.length===1?r("Space »%{space}« was disabled successfully",{space:y[0].name}):o("%{spaceCount} space was disabled successfully","%{spaceCount} spaces were disabled successfully",h.length,{spaceCount:h.length.toString()},!0);e({title:T})}const S=v.filter(T=>T.status==="rejected");if(S.length){S.forEach(console.error);const T=S.length===1&&y.length===1?r("Failed to disable space »%{space}«",{space:y[0].name}):o("Failed to disable %{spaceCount} space","Failed to disable %{spaceCount} spaces",S.length,{spaceCount:S.length.toString()},!0);t({title:T,errors:S.map(R=>R.reason)})}},m=({resources:y})=>{const E=d(y);if(!E.length)return;const b=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.",E.length,{count:E.length.toString()}),g=r("Disable");u({title:o("Disable Space »%{space}«?","Disable %{spaceCount} Spaces?",E.length,{space:E[0].name,spaceCount:E.length.toString()}),confirmText:g,message:b,hasInput:!1,onConfirm:()=>f(E)})};return{actions:B(()=>[{name:"disable",icon:"stop-circle",label:()=>r("Disable"),handler:m,isVisible:({resources:y})=>!!d(y).length,class:"oc-files-actions-disable-trigger"}]),disableSpaces:f}},Wv=()=>{const e=st(),t=at(),n=Tr(),{showMessage:r,showErrorMessage:o}=tt(),i=He(),{$gettext:s}=Fe.useGettext(),a=mn(),c=Ge(),u=fn(),{upsertResource:l}=Qe(),d=ht(i,"files-spaces-projects"),f=async y=>{const E=t.spaces.filter(Z.isProjectSpaceResource),b=zn(y.name,"",E);try{let g=await c.graphAuthenticated.drives.createDrive({name:b,description:y.description,quota:{total:y.spaceQuota.total}});const v=await c.webdav.listFiles(y);if(v.children.length){const h=new Fr({concurrency:e.options.concurrentRequests.resourceBatchActions}),S=[];for(const T of v.children)S.push(h.add(()=>c.webdav.copyFiles(y,T,g,{path:T.name})));await Promise.all(S)}if(y.spaceReadmeData||y.spaceImageData){const h={special:[]};if(y.spaceReadmeData){const S=await c.webdav.getFileInfo(g,{path:`.space/${y.spaceReadmeData.name}`});h.special.push({specialFolder:{name:"readme"},id:S.id})}if(y.spaceImageData){const S=await c.webdav.getFileInfo(g,{path:`.space/${y.spaceImageData.name}`});h.special.push({specialFolder:{name:"image"},id:S.id})}g=await c.graphAuthenticated.drives.updateDrive(g.id,h,n.graphRoles)}t.upsertSpace(g),d&&l(g),r({title:s("Space »%{space}« was duplicated successfully",{space:y.name})})}catch(g){console.error(g),o({title:s("Failed to duplicate space »%{space}«",{space:y.name}),errors:[g]})}},m=async({resources:y})=>{for(const E of y)E.disabled||!Z.isProjectSpaceResource(E)||await f(E)};return{actions:B(()=>[{name:"duplicate",icon:"folders",label:()=>s("Duplicate"),handler:y=>u.addTask(()=>m(y)),isVisible:({resources:y})=>!(y!=null&&y.length)||y.every(E=>E.disabled)||y.every(E=>!Z.isProjectSpaceResource(E))?!1:a.can("create-all","Drive"),class:"oc-files-actions-duplicate-trigger"}]),duplicateSpace:f}},jk=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=yt(),{$gettext:r}=Fe.useGettext(),o=mn(),i=Ge(),s=Kt(),{dispatchModal:a}=pt(),c=at(),u=(f,m)=>i.graphAuthenticated.drives.updateDrive(f.id,{name:f.name,description:m}).then(()=>{c.updateSpaceField({id:f.id,field:"description",value:m}),p(s).name==="admin-settings-spaces"&&(f.description=m),e({title:r("Space subtitle was changed successfully")})}).catch(y=>{console.error(y),t({title:r("Failed to change space subtitle"),errors:[y]})}),l=({resources:f})=>{f.length===1&&a({title:r("Change subtitle for space")+" "+f[0].name,confirmText:r("Confirm"),hasInput:!0,inputLabel:r("Space subtitle"),inputValue:f[0].description,onConfirm:m=>u(f[0],m)})};return{actions:B(()=>[{name:"editDescription",icon:"h-2",iconFillType:"none",label:()=>r("Edit subtitle"),handler:l,isVisible:({resources:f})=>f.length!==1?!1:f[0].canEditDescription({user:n.user,ability:o}),class:"oc-files-actions-edit-description-trigger"}]),editDescriptionSpace:u}},Uk={name:"QuotaSelect",props:{totalQuota:{type:Number,default:0},maxQuota:{type:Number,default:0}},emits:["selectedOptionChange"],setup(){const e=ce(void 0),t=ce([]);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 It.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=An(e,this.$language.current);return this.isValueValidNumber(e)?t:e.toString()}}},qk={class:"quota-select-batch-action-form"},Vk=["textContent"],zk={class:"oc-flex oc-flex-between"},Wk=["textContent"],Hk={key:0,class:"oc-text-input-danger"};function Gk(e,t,n,r,o,i){const s=he("oc-icon"),a=he("oc-select");return X(),pe("div",qk,[ge(a,Gt({ref:"select","model-value":r.selectedOption,selectable:i.optionSelectable,taggable:"","push-tags":"",clearable:!1,options:r.options,"create-option":i.createOption,"option-label":"displayValue",label:e.$gettext("Quota")},e.$attrs,{"onUpdate:modelValue":i.onUpdate}),{"selected-option":Se(({displayValue:c})=>[e.$attrs["read-only"]?(X(),Re(s,{key:0,name:"lock",class:"oc-mr-xs",size:"small"})):Ce("",!0),fe("span",{textContent:H.toDisplayString(c)},null,8,Vk)]),search:Se(({attributes:c,events:u})=>[fe("input",Gt({class:"vs__search"},c,Za(u,!0)),null,16)]),option:Se(({displayValue:c,error:u})=>[fe("div",zk,[fe("span",{textContent:H.toDisplayString(c)},null,8,Wk)]),u?(X(),pe("div",Hk,H.toDisplayString(u),1)):Ce("",!0)]),_:1},16,["model-value","selectable","options","create-option","label","onUpdate:modelValue"])])}const Hv=We(Uk,[["render",Gk]]),Kk={key:0,class:"oc-mt-s"},Qk=["textContent"],Gv=xe({__name:"QuotaModal",props:{modal:{},spaces:{},warningMessage:{default:""},warningMessageContextualHelperData:{default:()=>{}},resourceType:{default:"space"}},emits:["update:confirmDisabled"],setup(e,{expose:t,emit:n}){var h,S;const r=n,{showMessage:o,showErrorMessage:i}=tt(),{$gettext:s,$ngettext:a}=Fe.useGettext(),c=Ge(),u=He(),l=at(),d=sn(),{spacesMaxQuota:f}=Ue.storeToRefs(d),{updateResourceField:m}=Qe(),w=ce(((S=(h=e.spaces[0])==null?void 0:h.spaceQuota)==null?void 0:S.total)||0),y=T=>e.resourceType==="space"?a("Space quota was changed successfully","Quota of %{count} spaces was changed successfully",T,{count:T.toString()}):e.resourceType==="user"?a("User quota was changed successfully","Quota of %{count} users was changed successfully",T,{count:T.toString()}):s("Quota was changed successfully"),E=T=>e.resourceType==="space"?a("Failed to change space quota","Failed to change quota for %{count} spaces",T,{count:T.toString()}):e.resourceType==="user"?a("Failed to change user quota","Failed to change quota for %{count} users",T,{count:T.toString()}):s("Failed to change quota"),b=B(()=>!e.spaces.some(T=>T.spaceQuota.total!==p(w)));St(b,()=>{r("update:confirmDisabled",p(b))},{immediate:!0});const g=T=>{w.value=T.value};return t({onConfirm:async()=>{const T=c.graphAuthenticated,R=e.spaces.map(async D=>{const N=await T.drives.updateDrive(D.id,{name:D.name,quota:{total:p(w)}});p(u.currentRoute).name==="admin-settings-spaces"&&Ke.publish("app.admin-settings.spaces.space.quota.updated",{spaceId:D.id,quota:N.spaceQuota}),p(u.currentRoute).name==="admin-settings-users"&&Ke.publish("app.admin-settings.users.user.quota.updated",{spaceId:D.id,quota:N.spaceQuota}),l.updateSpaceField({id:D.id,field:"spaceQuota",value:N.spaceQuota}),m({id:D.id,field:"spaceQuota",value:N.spaceQuota})}),_=await Promise.allSettled(R),A=_.filter(D=>D.status==="fulfilled");A.length&&o({title:y(A.length)});const $=_.filter(D=>D.status==="rejected");$.length&&(console.error($),$.forEach(console.error),i({title:E($.length),errors:$.map(D=>D.reason)}))}}),(T,R)=>{const _=he("oc-contextual-helper");return X(),pe(qe,null,[ge(Hv,{"total-quota":w.value,"max-quota":p(f),"position-fixed":!0,onSelectedOptionChange:g},null,8,["total-quota","max-quota"]),T.warningMessage?(X(),pe("div",Kk,[fe("span",{class:"oc-text-input-warning",textContent:H.toDisplayString(T.warningMessage)},null,8,Qk),T.warningMessageContextualHelperData?(X(),Re(_,Gt({key:0,class:"oc-pl-xs"},T.warningMessageContextualHelperData),null,16)):Ce("",!0)])):Ce("",!0)],64)}}}),Kv=()=>{const{dispatchModal:e}=pt(),{$gettext:t}=Fe.useGettext(),n=mn(),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()}),o=({resources:s})=>{e({title:r({resources:s}),customComponent:Gv,customComponentAttrs:()=>({spaces:s,resourceType:"space"})})};return{actions:B(()=>[{name:"editQuota",icon:"cloud",label:()=>t("Edit quota"),handler:o,isVisible:({resources:s})=>!s||!s.length||s.some(a=>!Z.isProjectSpaceResource(a)||Z.isSpaceResource(a)&&!a.spaceQuota)?!1:n.can("set-quota-all","Drive"),class:"oc-files-actions-edit-quota-trigger"}])}};function Qv(){const{getDefaultAction:e}=Xn();return{openWithDefaultApp:({space:n,resource:r})=>{if(!r||r.isFolder)return;const o={resources:[r],space:n},i=e({...o,omitSystemActions:!0});i&&i.handler(o)}}}const Xk=()=>{const e=Ge(),{openWithDefaultApp:t}=Qv(),{createDefaultMetaFolder:n}=Ui(),r=yt(),o=at(),{$gettext:i}=Fe.useGettext(),{getDefaultMetaFolder:s}=ra(),a=async(l,d)=>{const f=await e.webdav.putFileContents(l,{path:".space/readme.md",parentFolderId:d.id,fileName:"readme.md"}),m=await e.graphAuthenticated.drives.updateDrive(l.id,{name:l.name,special:[{specialFolder:{name:"readme"},id:f.id}]});return o.updateSpaceField({id:l.id,field:"spaceReadmeData",value:m.spaceReadmeData}),f},c=async({resources:l})=>{let d=null,f=await s(l[0]);if(f||(f=await n(l[0]),d=await a(l[0],f)),!d){const m=Z.getRelativeSpecialFolderSpacePath(l[0],"readme");m?d=await e.webdav.getFileInfo(l[0],{path:m}):d=await a(l[0],f)}t({space:l[0],resource:d})};return{actions:B(()=>[{name:"editReadmeContent",icon:"article",label:()=>i("Edit description"),handler:c,isVisible:({resources:l})=>l.length!==1?!1:l[0].canEditReadme({user:r.user}),class:"oc-files-actions-edit-readme-content-trigger"}])}},Xv=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=yt(),{$gettext:r}=Fe.useGettext(),o=mn(),i=Ge(),s=Kt(),{isSpaceNameValid:a}=ci(),{dispatchModal:c}=pt(),u=at(),l=(m,w)=>i.graphAuthenticated.drives.updateDrive(m.id,{name:w}).then(()=>{p(s).name==="admin-settings-spaces"&&(m.name=w),u.updateSpaceField({id:m.id,field:"name",value:w}),e({title:r("Space name was changed successfully")})}).catch(E=>{console.error(E),t({title:r("Failed to rename space"),errors:[E]})}),d=({resources:m})=>{m.length===1&&c({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:w=>l(m[0],w),onInput:(w,y)=>{const{isValid:E,error:b}=a(w);y(E?null:b)}})};return{actions:B(()=>[{name:"rename",icon:"pencil",label:()=>r("Rename"),handler:d,isVisible:({resources:m})=>m.length!==1?!1:m[0].canRename({user:n.user,ability:o}),class:"oc-files-actions-rename-trigger"}]),renameSpace:l}},Yv=()=>{const{showMessage:e,showErrorMessage:t}=tt(),n=yt(),{$gettext:r,$ngettext:o}=Fe.useGettext(),i=mn(),s=Ge(),a=fn(),c=Kt(),{dispatchModal:u}=pt(),l=at(),d=y=>y.filter(E=>Z.isProjectSpaceResource(E)&&E.canRestore({user:n.user,ability:i})),f=async y=>{const E=s.graphAuthenticated,b=y.map(S=>E.drives.updateDrive(S.id,{name:S.name},{headers:{Restore:"true"}}).then(T=>(p(c).name==="admin-settings-spaces"&&(S.disabled=!1,S.spaceQuota=T.spaceQuota),l.updateSpaceField({id:S.id,field:"disabled",value:!1}),!0))),g=await a.addTask(()=>Promise.allSettled(b));await l.loadGraphPermissions({ids:y.map(S=>S.id),graphClient:E});const v=g.filter(S=>S.status==="fulfilled");if(v.length){const S=v.length===1&&y.length===1?r("Space »%{space}« was enabled successfully",{space:y[0].name}):o("%{spaceCount} space was enabled successfully","%{spaceCount} spaces were enabled successfully",v.length,{spaceCount:v.length.toString()},!0);e({title:S})}const h=g.filter(S=>S.status==="rejected");if(h.length){h.forEach(console.error);const S=h.length===1&&y.length===1?r("Failed to enabled space »%{space}«",{space:y[0].name}):o("Failed to enable %{spaceCount} space","Failed to enable %{spaceCount} spaces",h.length,{spaceCount:h.length.toString()},!0);t({title:S,errors:h.map(T=>T.reason)})}},m=({resources:y})=>{const E=d(y);if(!E.length)return;const b=o("If you enable the selected space, it can be accessed again.","If you enable the %{count} selected spaces, they can be accessed again.",E.length,{count:E.length.toString()}),g=r("Enable");u({title:o("Enable Space »%{space}«?","Enable %{spaceCount} Spaces?",E.length,{space:E[0].name,spaceCount:E.length.toString()}),confirmText:g,message:b,hasInput:!1,onConfirm:()=>f(E)})};return{actions:B(()=>[{name:"restore",icon:"play-circle",label:()=>r("Enable"),handler:m,isVisible:({resources:y})=>!!d(y).length,class:"oc-files-actions-restore-trigger"}]),restoreSpaces:f}},Yk=()=>{const{$gettext:e}=Fe.useGettext(),t=Qe(),n=({resources:o})=>{t.setSelection(o.map(({id:i})=>i)),Ke.publish(Tt.openWithPanel,"space-share")};return{actions:B(()=>[{name:"show-members",icon:"group",label:()=>e("Members"),handler:n,isVisible:({resources:o})=>o.length===1&&!o[0].disabled,class:"oc-files-actions-show-details-trigger"}])}},Jk=()=>{const e=He(),{$gettext:t}=Fe.useGettext(),n=o=>Fi("files-trash-generic",{...ir(o,{fileId:o.fileId})});return{actions:B(()=>[{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"}])}},Zk=xe({name:"EmojiPickerModal",components:{},props:{modal:{type:Object,required:!0}},emits:["confirm"],setup(e,{emit:t}){const n=ai(),{currentTheme:r}=Ue.storeToRefs(n),o=B(()=>p(r).isDark?"dark":"light");return{onEmojiSelect:s=>{t("confirm",s)},theme:o}}});function ex(e,t,n,r,o,i){const s=he("oc-emoji-picker");return X(),Re(s,{theme:e.theme,onEmojiSelect:e.onEmojiSelect},null,8,["theme","onEmojiSelect"])}const Jv=We(Zk,[["render",ex]]),tx=()=>{const e=yt(),{showMessage:t,showErrorMessage:n}=tt(),{$gettext:r}=Fe.useGettext(),o=Ge(),i=fn(),s=at(),{createDefaultMetaFolder:a}=Ui(),{dispatchModal:c}=pt(),{getDefaultMetaFolder:u}=ra(),l=({resources:w})=>{w.length===1&&c({elementClass:"oc-width-auto",title:r("Set icon for »%{space}«",{space:w[0].name}),hideConfirmButton:!0,customComponent:Jv,focusTrapInitial:!1,onConfirm:y=>f(w[0],y)})},d=async w=>{const y=document.createElement("canvas"),E=y.getContext("2d"),b=16/9,g=720,v=g/b;y.width=g,y.height=v;const h=.4*g;E.font=`${h}px sans-serif`,E.textBaseline="middle",E.textAlign="center",E.fillText(w,y.width/2,y.height/2+15);const T=await Db(y);return $b(T)},f=async(w,y)=>{const E=o.graphAuthenticated,b=await d(y);let g=await u(w);return g||(g=await a(w)),i.addTask(async()=>{const v={"Content-Type":"application/offset+octet-stream"};try{const{fileId:h}=await o.webdav.putFileContents(w,{parentFolderId:g.id,fileName:"image.png",content:b,headers:v,overwrite:!0}),S=await E.drives.updateDrive(w.id,{name:w.name,special:[{specialFolder:{name:"image"},id:h}]});s.updateSpaceField({id:w.id,field:"spaceImageData",value:S.spaceImageData}),t({title:r("Space icon was set successfully")}),Ke.publish("app.files.spaces.uploaded-image",S)}catch(h){console.error(h),n({title:r("Failed to set space icon"),errors:[h]})}})};return{actions:B(()=>[{name:"set-space-icon",icon:"emoji-sticker",handler:l,label:()=>r("Set icon"),isVisible:({resources:w})=>w.length!==1?!1:w[0].canEditImage({user:e.user}),class:"oc-files-actions-set-space-icon-trigger"}]),setIconSpace:f}},nx=()=>{const e=yt(),{$gettext:t}=Fe.useGettext(),{dispatchModal:n}=pt(),{graphAuthenticated:r,webdav:o}=Ge(),i=at(),{showMessage:s,showErrorMessage:a}=tt(),{defaultSpaceImageBlobURL:c}=Ue.storeToRefs(i),u=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}]}),i.updateSpaceField({id:f.id,field:"spaceImageData",value:null}),i.updateSpaceField({id:f.id,field:"thumbnail",value:p(c)}),s({title:t("Space image deleted successfully")})}catch(m){console.error(m),a({title:t("Failed to delete space image"),errors:[m]})}},l=({resources:f})=>{n({title:t("Delete »%{space}« image",{space:f[0].name}),confirmText:t("Delete"),onConfirm:()=>u({space:f[0]}),message:t("Are you sure you want to delete the image of »%{space}«?",{space:f[0].name})})};return{actions:B(()=>[{name:"delete-space-image",icon:"delete-bin",handler:l,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:u}},rx=()=>{const{$gettext:e}=Fe.useGettext();return{actions:B(()=>[{name:"show-details",icon:"information",label:()=>e("Details"),handler:()=>Ke.publish(Tt.open),isVisible:({resources:n})=>n.length>0,class:"oc-admin-settings-show-details-trigger"}])}},ix=()=>{const{getMatchingSpace:e}=un(),t=at(),n=or(),r=Qe(),o=Ge(),{$gettext:i}=Fe.useGettext(),{openEditor:s}=Xn(),{resources:a,currentFolder:c}=Ue.storeToRefs(r);return{openEmptyEditor:async(l,d)=>{var v;let f=p(c)?e(p(c)):null,m=p(a),w=(v=p(c))==null?void 0:v.path;(!f||!p(c).canCreate())&&(f=t.personalSpace,m=(await o.webdav.listFiles(f)).children,w="");let y=i("New file")+`.${d}`;m.some(h=>h.name===y)&&(y=zn(y,d,m));const E=await o.webdav.putFileContents(f,{path:Z.urlJoin(w,y)}),b=e(E),g=n.fileExtensions.find(({app:h,extension:S})=>h===l&&S===d);s(g,b,E)}}},Zv=()=>{const{$gettext:e}=Fe.useGettext(),{showMessage:t}=tt();return{openUrl:(r,o,i)=>{const s=window.open(r,o);s?i&&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.")})}}},ox=()=>vr("$appProviderService"),sx=()=>{const{isResourceAccessible:e}=un();return{breadcrumbsFromPath:({route:r,space:o,resourcePath:i,ancestorMetaData:s=ce({})})=>{const a=(l="")=>l.split("/").filter(Boolean),c=a(r.path),u=a(i);return u.map((l,d)=>{const f=Z.urlJoin(...u.slice(0,d+1),{leadingSlash:!0}),m=e({space:p(o),path:f});let w;return m&&(w=p(s)[f]),{id:en.v4(),allowContextActions:!0,text:l,...m&&{to:{path:"/"+[...c].splice(0,c.length-u.length+d+1).join("/"),query:{...Mi(r.query,"page","fileId"),...w&&{fileId:w.id}}}},isStaticNav:!1}})},concatBreadcrumbs:(...r)=>{const o=r.pop();return[...r,{id:en.v4(),allowContextActions:o.allowContextActions,text:o.text,onClick:()=>Ke.publish("app.files.list.load"),isTruncationPlaceholder:o.isTruncationPlaceholder,isStaticNav:o.isStaticNav}]}}},ax=(e="")=>{const t=ce(0),n=async()=>{await In();const r=document.querySelector(e||"#files-app-bar"),o=r?r.getBoundingClientRect().height:0;t.value!==o&&(t.value=o)};return window.onresize=n,Bt(n),{y:t,refresh:n}},Gf=()=>{const e=ce(!0),t=()=>{e.value=window.innerHeight>500};return Bt(()=>{t(),window.addEventListener("resize",t)}),Vn(()=>{window.removeEventListener("resize",t)}),{isSticky:e}};var Ir=(e=>(e.C="c",e.V="v",e.X="x",e.A="a",e.S="s",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))(Ir||{}),Kf=(e=>(e.Ctrl="Control",e.Shift="Shift",e))(Kf||{});const lx=()=>{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==null?void 0:n.closest("[data-custom-key-bindings-disabled='true']")}catch{r=n==null?void 0:n.parentElement.closest("[data-custom-key-bindings-disabled='true']")}return r?!0:window.getSelection().type==="Range"},Qf=e=>{const t=ce([]),n=ce(0),r=a=>{if(!(e!=null&&e.skipDisabledKeyBindingsCheck)&&lx())return;const{key:c,ctrlKey:u,metaKey:l,shiftKey:d}=a;let f=null;const m=[];l||u?(f="Control",m.push("altKey","shiftKey")):d&&(f="Shift",m.push("altKey","ctrlKey","metaKey")),!((y,E)=>E.some(b=>y[b]))(a,m)&&p(t).filter(y=>y.primary===c&&y.modifier===f).forEach(y=>{a.preventDefault(),y.callback(a)})},o=(a,c)=>{const u=en.v4();return t.value.push({id:u,...a,modifier:a.modifier??null,callback:c}),u},i=a=>{t.value=t.value.filter(c=>c.id!==a)},s=()=>{n.value=0};return Vr.useEventListener(document,"keydown",r),{actions:t,bindKeyAction:o,removeKeyAction:i,selectionCursor:n,resetSelectionCursor:s}},Xf=()=>{const e=Qf(),t=10,n=.1;return{setCropperInstance:o=>{e.bindKeyAction({primary:Ir.ArrowRight},()=>{var i;return(i=p(o))==null?void 0:i.move(-10,0)}),e.bindKeyAction({primary:Ir.ArrowLeft},()=>{var i;return(i=p(o))==null?void 0:i.move(t,0)}),e.bindKeyAction({primary:Ir.ArrowDown},()=>{var i;return(i=p(o))==null?void 0:i.move(0,-10)}),e.bindKeyAction({primary:Ir.ArrowUp},()=>{var i;return(i=p(o))==null?void 0:i.move(0,t)}),e.bindKeyAction({primary:Ir.Plus},()=>{var i;return(i=p(o))==null?void 0:i.zoom(n)}),e.bindKeyAction({primary:Ir.Minus},()=>{var i;return(i=p(o))==null?void 0:i.zoom(-.1)})}}};class Cr{}Ee(Cr,"perPageDefault","100"),Ee(Cr,"perPageQueryName","items-per-page"),Ee(Cr,"options",["20","50","100","250","500"]);function cx(e){const t=Mo.useRouter(),n=Mo.useRoute(),r=ux(e),o=fx(e),i=B(()=>Math.ceil(p(e.items).length/p(o))||1),s=B(()=>{if(!p(o))return p(e.items);const a=(p(r)-1)*p(o),c=a+p(o);return p(e.items).slice(a,c)});return Ke.subscribe("app.files.navigate.page",({resourceId:a,forceScroll:c,topbarElement:u})=>{const l=It.findIndex(p(e.items),d=>d.id===a);if(l>=0){const d=Math.ceil((l+1)/Number(p(o)));t.push({...p(n),query:{...p(n).query,page:d}}).then(()=>{Ke.publish("app.files.navigate.scrollTo",{resourceId:a,forceScroll:c,topbarElement:u})})}}),{items:s,total:i,page:r,perPage:o}}function ux(e){if(e.page)return B(()=>p(e.page));const t=an("page","1");return B(()=>parseInt(Rt(p(t))))}function fx(e){if(e.perPage)return B(()=>p(e.perPage));const t=Ar({name:e.perPageQueryName||Cr.perPageQueryName,defaultValue:e.perPageDefault||Cr.perPageDefault,storagePrefix:e.perPageStoragePrefix});return B(()=>parseInt(Rt(p(t))))}const e0=()=>vr("$passwordPolicyService");var ya=(e=>(e.mounted="portal-target.mounted",e))(ya||{});const dx=()=>{const e=li(),t=_a.useWormhole();return{registerPortal:r=>{e.subscribe(ya.mounted,()=>{t.open(r)})}}},Yf=()=>{const e=or();return{canBeOpenedWithSecureView:n=>e.fileExtensions.filter(({secureView:o})=>o).some(({mimeType:o})=>o===n.mimeType)}},t0=()=>{const e=yt();return{canListVersions:({space:n,resource:r})=>r.type==="folder"||Z.isSpaceResource(r)||Z.isTrashResource(r)?!1:n==null?void 0:n.canListVersions({user:e.user})}},n0=()=>{const e=Ge(),t=at(),n=B(()=>t.spaces),r=a=>p(n).find(c=>a.toString().startsWith(c.id.toString())),o=a=>p(n).find(c=>{var u,l;return Z.isMountPointSpaceResource(c)&&((l=(u=c.root)==null?void 0:u.remoteItem)==null?void 0:l.id)===a}),i=a=>{const c=[je.FileId,je.FileParent,je.Name,je.ResourceType],u=Z.buildSpace({id:a,name:""});return e.webdav.getFileInfo(u,{fileId:a},{davProperties:c})};return{getResourceContext:async a=>{var w,y,E,b,g;let c,u,l=r(a);if(l)return c=await e.webdav.getPathForFileId(a),u=await e.webdav.getFileInfo(l,{path:c}),{space:l,resource:u,path:c};await t.loadMountPoints({graphClient:e.graphAuthenticated});let d=o(a);u=await i(a);const f=d?[]:[p(u).name];let m=p(u);for(;!d;)m=await i(m.parentFolderId),d=o(m.id),d||f.unshift(m.name);return l=t.getSpace((y=(w=d.root)==null?void 0:w.remoteItem)==null?void 0:y.id)||t.createShareSpace({driveAliasPrefix:(E=u.storageId)!=null&&E.startsWith(Z.OCM_PROVIDER_ID)?"ocm-share":"share",id:(g=(b=d.root)==null?void 0:b.remoteItem)==null?void 0:g.id,shareName:d.name}),c=Z.urlJoin(...f),{space:l,resource:u,path:c}}}},Jt={name:{table:"resource-table",condensedTable:"resource-table-condensed",tiles:"resource-tiles"},defaultModeName:"resource-table",queryName:"view-mode",tilesSizeDefault:2,tilesSizeMax:6,tilesSizeQueryName:"tiles-size"},r0=()=>{const e=i=>{if(!i.endsWith("rem")&&!i.endsWith("px"))return 0;if(i.endsWith("rem")){const s=parseInt(i.replace("rem","").trim()),a=parseFloat(getComputedStyle(document.documentElement).fontSize);return s*a}return parseInt(i.replace("px","").trim())},t=ce(0),n=ce(0);Bt(()=>{const i=getComputedStyle(document.documentElement);t.value=e(i.getPropertyValue("--oc-size-tiles-default")),n.value=e(i.getPropertyValue("--oc-size-tiles-resize-step"))});const r=i=>p(t)+(i-1)*p(n);return{calculateTileSizePixels:r,calculateTileSizeRem:i=>{const s=parseFloat(getComputedStyle(document.documentElement).fontSize);return r(i)/s}}};function px(e){if(e)return B(()=>p(e));const t=Ar({name:Jt.queryName,defaultValue:Jt.defaultModeName});return B(()=>Rt(p(t)))}function hx(e){if(e)return B(()=>parseInt(p(e)));const t=Ar({name:Jt.tilesSizeQueryName,defaultValue:Jt.tilesSizeDefault.toString()});return B(()=>parseInt(Rt(p(t))))}const gx=ce(Jt.tilesSizeMax);function Jf(){return gx}const Zf=e=>{const t=jf(),{updateResourceField:n}=Qe(),{httpAuthenticated:r}=Ge(),o=at(),{defaultSpaceImageBlobURL:i}=Ue.storeToRefs(o),s=st(),{serverUrl:a}=Ue.storeToRefs(s),c=new Fr({concurrency:4}),u=B(()=>p(e)===Jt.name.tiles),l=B(()=>p(u)?zs.enum.fit:zs.enum.thumbnail),d=B(()=>p(u)?Qn.Tile:Qn.Thumbnail),f=pn.useTask(function*(E,{space:b,resource:g,dimensions:v,processor:h,updateStore:S=!0}){var A;const T=Z.isProjectSpaceResource(g)?Z.buildSpaceImageResource(g):g,R=T.id===((A=b.spaceImageData)==null?void 0:A.id);R&&o.addToImagesLoading(b.id);const _=yield c.add(()=>t.loadPreview({space:b,resource:T,processor:h||p(l),dimensions:v||p(d)},!0,!0,E));return _&&S&&n({id:g.id,field:"thumbnail",value:_}),R&&o.removeFromImagesLoading(b.id),_}),m=async E=>{const{resource:b,cancelRunning:g}=E;if(g&&y(),Z.isProjectSpaceResource(b)&&(!b.spaceImageData||b.disabled)){if(p(i))return b.thumbnail=p(i),p(i);try{const v=await r.get(`${p(a)}images/default-space-icon.png`,{responseType:"blob"});return o.setDefaultSpaceImageBlobURL(URL.createObjectURL(v.data)),b.thumbnail=p(i),p(i)}catch{return null}}try{return await f.perform(E)}catch(v){v!=="cancel"&&console.error(v)}},w=B(()=>f.isRunning),y=()=>{f.cancelAll(),c.clear(),o.purgeImagesLoading()};return Ya(y),{loadPreview:m,previewsLoading:w}},i0=({showSizeInformation:e=!0}={})=>{const t=Qe(),{current:n,$gettext:r,$ngettext:o}=Fe.useGettext(),i=He(),{resources:s,totalResourcesCount:a,areHiddenFilesShown:c,currentFolder:u}=Ue.storeToRefs(t),l=B(()=>{var f,m;if(!((f=p(u))!=null&&f.size)||((m=p(u))==null?void 0:m.size)==="0"){const w=p(s).map(y=>y.size?parseInt(y.size.toString()):0).reduce((y,E)=>y+E,0);return An(w,n)}return An(p(u).size,n)});return{resourceContentsText:B(()=>{let f=o("%{ filesCount } file","%{ filesCount } files",p(a).files,{filesCount:p(a).files.toString()});!p(c)&&p(a).hiddenFiles&&(f=o("%{ filesCount } file including %{ filesHiddenCount } hidden","%{ filesCount } files including %{ filesHiddenCount } hidden",p(a).files,{filesCount:p(a).files.toString(),filesHiddenCount:p(a).hiddenFiles.toString()}));let m=o("%{ foldersCount } folder","%{ foldersCount } folders",p(a).folders,{foldersCount:p(a).folders.toString()});!p(c)&&p(a).hiddenFolders&&(m=o("%{ foldersCount } folder including %{ foldersHiddenCount } hidden","%{ foldersCount } folders including %{ foldersHiddenCount } hidden",p(a).folders,{foldersCount:p(a).folders.toString(),foldersHiddenCount:p(a).hiddenFolders.toString()}));const w=o("%{ spacesCount } space","%{ spacesCount } spaces",p(a).spaces,{spacesCount:p(a).spaces.toString()}),y=p(a).files+p(a).folders+p(a).spaces,E=e&&parseFloat(p(l))>0,b=jt(i,"files-shares-via-link"),g=r(E?"%{ itemsCount } item with %{ itemSize } in total":"%{ itemsCount } item in total"),v=r(E?"%{ itemsCount } items with %{ itemSize } in total":"%{ itemsCount } items in total"),h=b?"(%{ filesStr}, %{ foldersStr}, %{ spacesStr})":"(%{ filesStr}, %{ foldersStr})",S=`${g} ${h}`,T=`${v} ${h}`;return o(S,T,y,{itemsCount:y.toString(),itemSize:p(l),filesStr:f,foldersStr:m,spacesStr:w})})}},ed=()=>{const{getMatchingSpace:e}=un(),t=Qe(),n=B({get(){return t.selectedResources},set(s){t.setSelection(s.map(({id:a})=>a))}}),r=B({get(){return t.selectedIds},set(s){t.setSelection(s)}}),o=s=>p(r).includes(s.id),i=B(()=>{if(p(n).length!==1)return null;const s=p(n)[0];return e(s)});return{selectedResources:n,selectedResourcesIds:r,isResourceInSelection:o,selectedResourceSpace:i}};function mx(e){const t=sn(),n=ei(),r=Ge(),o=Fe.useGettext(),i=B(()=>t.tusMaxChunkSize>0),s=()=>{const u={};return n.publicLinkPassword?u.Authorization="Basic "+wr.from(["public",n.publicLinkPassword].join(":")).toString("base64"):n.accessToken&&!n.publicLinkPassword&&(u.Authorization="Bearer "+n.accessToken),u["X-Request-ID"]=en.v4(),u["Accept-Language"]=o.current,u["Initiator-ID"]=r.initiatorId,u},a=B(()=>{const u={onBeforeRequest:(l,d)=>new Promise(f=>{var w;const m=s();l.setHeader("Authorization",m.Authorization),l.setHeader("X-Request-ID",m["X-Request-ID"]),l.setHeader("Accept-Language",m["Accept-Language"]),l.setHeader("Initiator-ID",m["Initiator-ID"]),d!=null&&d.isRemote&&l.setHeader("x-oc-mtime",(((w=d==null?void 0:d.data)==null?void 0:w.lastModified)/1e3).toFixed(0)),f()}),chunkSize:t.tusMaxChunkSize||1/0,overridePatchMethod:t.tusHttpMethodOverride,uploadDataDuringCreation:t.tusExtension.includes("creation-with-upload")};return u.headers=l=>{var d;if(l.xhrUpload||l!=null&&l.isRemote)return{"x-oc-mtime":(((d=l==null?void 0:l.data)==null?void 0:d.lastModified)/1e3).toFixed(0),...s()}},u}),c=B(()=>({timeout:6e4,endpoint:"",headers:u=>{var l;return{"x-oc-mtime":(((l=u==null?void 0:u.data)==null?void 0:l.lastModified)/1e3).toFixed(0),...s()}}}));St([a,c],()=>{if(p(i)){e.uppyService.useTus(p(a));return}e.uppyService.useXhr(p(c))},{immediate:!0})}const o0=()=>{const e=Ge(),{addAvatar:t,getAvatar:n,avatarsQueue:r,pendingAvatarsRequests:o}=Ys(),i=async a=>{var c;try{const u=await e.graphAuthenticated.photos.getUserPhoto(a,{responseType:"blob"});t(a,URL.createObjectURL(u))}catch(u){((c=u.response)==null?void 0:c.status)===404&&t(a,null)}return n(a)};return{enqueueAvatar:a=>{if(n(a)!==void 0||o.has(a))return;const c=r.add(()=>i(a));o.set(a,c),c.finally(()=>o.delete(a))}}},yx=xe({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=st(),{options:n}=Ue.storeToRefs(t),r=B(()=>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=B(()=>({...{appearance:e.action.appearance||e.appearance,...e.action.isDisabled&&{disabled:e.action.isDisabled(e.actionOptions)},...e.action.id&&{id:e.action.id}},...p(r)==="router-link"&&{to:e.action.route(e.actionOptions)},...p(r)==="a"&&{href:e.action.href(e.actionOptions)},...["router-link","a"].includes(p(r))&&{target:n.value.cernFeatures?"_blank":"_self"}}));return{componentType:r,componentProps:o}},computed:{hasExternalImageIcon(){return this.action.icon&&/^https?:\/\//i.test(this.action.icon)},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}}}}),bx={key:3,class:"oc-files-context-action-label oc-flex","data-testid":"action-label"},vx=["textContent"],wx=["textContent"];function Sx(e,t,n,r,o,i){var l,d,f,m;const s=he("oc-image"),a=he("oc-icon"),c=he("oc-button"),u=ln("oc-tooltip");return ot((X(),pe("li",null,[ot((X(),Re(c,Gt({type:e.componentType},e.componentProps,{class:[e.action.class,"action-menu-item","oc-py-s","oc-px-m","oc-width-1-1",...e.buttonClasses],"aria-label":e.componentProps.disabled?(d=(l=e.action).disabledTooltip)==null?void 0:d.call(l,e.actionOptions):"","data-testid":"action-handler",size:e.size,"justify-content":"left"},Za(e.componentListeners)),{default:Se(()=>[e.action.img?(X(),Re(s,{key:0,"data-testid":"action-img",src:e.action.img,alt:"",class:"oc-icon oc-icon-m"},null,8,["src"])):e.hasExternalImageIcon?(X(),Re(s,{key:1,"data-testid":"action-img",src:e.action.icon,alt:"",class:"oc-icon oc-icon-m"},null,8,["src"])):e.action.icon?(X(),Re(a,{key:2,"data-testid":"action-icon",name:e.action.icon,"fill-type":e.action.iconFillType||"line",size:e.size},null,8,["name","fill-type","size"])):Ce("",!0),e.action.hideLabel?Ce("",!0):(X(),pe("span",bx,[fe("span",{textContent:H.toDisplayString(e.action.label(e.actionOptions))},null,8,vx)])),e.action.shortcut&&e.shortcutHint?(X(),pe("span",{key:4,class:"oc-files-context-action-shortcut",textContent:H.toDisplayString(e.action.shortcut)},null,8,wx)):Ce("",!0)]),_:1},16,["type","class","aria-label","size"])),[[u,e.showTooltip||e.action.hideLabel?e.action.label(e.actionOptions):""]])])),[[u,e.componentProps.disabled?(m=(f=e.action).disabledTooltip)==null?void 0:m.call(f,e.actionOptions):""]])}const ba=We(yx,[["render",Sx]]),Ex=xe({name:"BatchActions",components:{ActionMenuItem:ba},props:{actions:{type:Array,required:!0},actionOptions:{type:Object,required:!0},limitedScreenSpace:{type:Boolean,default:!1,required:!1}}});function Tx(e,t,n,r,o,i){const s=he("action-menu-item"),a=he("oc-list");return X(),pe("div",null,[ge(a,{id:"oc-appbar-batch-actions",class:H.normalizeClass({"oc-appbar-batch-actions-squashed":e.limitedScreenSpace})},{default:Se(()=>[(X(!0),pe(qe,null,wt(e.actions,(c,u)=>(X(),Re(s,{key:`action-${u}`,action:c,"action-options":e.actionOptions,appearance:"raw",class:"batch-actions oc-mr-s","shortcut-hint":!1,"show-tooltip":e.limitedScreenSpace},null,8,["action","action-options","show-tooltip"]))),128))]),_:1},8,["class"])])}const s0=We(Ex,[["render",Tx]]),Ax={class:"context-menu oc-files-context-action oc-px-s oc-rounded oc-menu-item-hover"},Rx={class:"oc-flex oc-files-context-action-label"},_x=["textContent"],a0=xe({__name:"ActionMenuDropItem",props:{menuSectionDrop:{},appearance:{},actionOptions:{}},setup(e){const t=Xs(`oc-files-context-actions-${e.menuSectionDrop.name}-drop-`),n=Xs(`oc-files-context-actions-${e.menuSectionDrop.name}-toggle-`);return(r,o)=>{const i=he("oc-icon"),s=he("oc-button"),a=he("oc-drop");return X(),pe("li",Ax,[ge(s,{id:p(n),appearance:"raw","gap-size":"medium",class:"oc-py-s oc-px-m oc-width-1-1 oc-flex-justify-between oc-width-1-1"},{default:Se(()=>[ge(i,{name:r.menuSectionDrop.icon,size:"medium","fill-type":"line"},null,8,["name"]),fe("span",Rx,[fe("span",{textContent:H.toDisplayString(r.menuSectionDrop.label)},null,8,_x)]),ge(i,{name:"arrow-right-s",size:"small","fill-type":"line"})]),_:1},8,["id"]),ge(a,{"drop-id":p(t),toggle:`#${p(n)}`,"is-nested":!0,mode:"hover",class:"oc-width-auto oc-files-context-action-drop","padding-size":"small",position:"auto-start","close-on-click":""},{default:Se(()=>[r.menuSectionDrop.items.length?(X(!0),pe(qe,{key:0},wt(r.menuSectionDrop.items,(c,u)=>(X(),Re(ba,{key:`section-${r.menuSectionDrop.label}-action-${u}`,action:c,appearance:r.appearance,"action-options":r.actionOptions,class:"oc-files-context-action oc-rounded oc-menu-item-hover"},null,8,["action","appearance","action-options"]))),128)):Ce("",!0)]),_:1},8,["drop-id","toggle"])])}}}),Ix=xe({name:"ContextActionMenu",components:{ActionMenuDropItem:a0,ActionMenuItem:ba},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("oc-pb-s"),e>0&&t.push("oc-pt-s"),e<this.menuSections.length-1&&t.push("oc-files-context-actions-border")),t}}}),Cx={id:"oc-files-context-menu"};function Px(e,t,n,r,o,i){const s=he("action-menu-item"),a=he("action-menu-drop-item"),c=he("oc-list");return X(),pe("div",Cx,[(X(!0),pe(qe,null,wt(e.menuSections,(u,l)=>(X(),Re(c,{id:`oc-files-context-actions-${u.name}`,key:`section-${u.name}-list`,class:H.normalizeClass(["oc-files-context-actions",e.getSectionClasses(l)])},{default:Se(()=>[u.items?(X(!0),pe(qe,{key:0},wt(u.items,(d,f)=>(X(),Re(s,{key:`section-${u.name}-action-${f}`,action:d,appearance:e.appearance,"action-options":e.actionOptions,class:"context-menu oc-files-context-action oc-rounded oc-menu-item-hover"},null,8,["action","appearance","action-options"]))),128)):Ce("",!0),(X(!0),pe(qe,null,wt(u.dropItems,d=>(X(),pe(qe,null,[d.items.length?(X(),Re(a,{key:d.name,"menu-section-drop":d,appearance:e.appearance,"action-options":e.actionOptions},null,8,["menu-section-drop","appearance","action-options"])):Ce("",!0)],64))),256))]),_:2},1032,["id","class"]))),128))])}const td=We(Ix,[["render",Px]]),Fx=xe({name:"ContextActions",components:{ContextActionMenu:td},props:{actionOptions:{type:Object,required:!0}},setup(e){const{editorActions:t,defaultEditorActions:n}=Xn(),{$gettext:r}=Fe.useGettext(),{actions:o}=aa(),{actions:i}=la(),{actions:s}=ca(),{actions:a}=Lf(),{actions:c}=ua(),{actions:u}=Po(),{actions:l}=fa(),{actions:d}=Fo(),{actions:f}=Mf(),{actions:m}=da(),{actions:w}=Bf(),{actions:y}=Cv(),{actions:E}=pa(),{actions:b}=ha(),{actions:g}=Fv(),{actions:v}=Uf(),{actions:h}=Vf(),{actions:S}=qf(),T=Bi(),R=B(()=>T.requestExtensions({id:"global.files.context-actions",extensionType:"action"}).map(te=>te.action)),_=B(()=>T.requestExtensions({id:"global.files.batch-actions",extensionType:"action"}).map(te=>te.action)),A=Lw(e,"actionOptions"),$=B(()=>[...p(o),...p(c),...p(l),...p(m),...p(s),...p(u),...p(b),...p(h),...p(_).filter(te=>te.category==="actions"||It.isNil(te.category))].filter(te=>te.isVisible(p(A)))),D=B(()=>[...p(v),...p(_).filter(te=>te.category==="sidebar")].filter(te=>te.isVisible(p(A)))),N=B(()=>[...p(w),...p(n)].filter(te=>te.isVisible(p(A))).sort((te,ae)=>Number(ae.hasPriority)-Number(te.hasPriority))),x=B(()=>[...p(t),...p(R).filter(te=>te.category==="context")].filter(te=>te.isVisible(p(A))).sort((te,ae)=>Number(ae.hasPriority)-Number(te.hasPriority))),W=B(()=>[...p(S),...p(a),...p(R).filter(te=>te.category==="share")].filter(te=>te.isVisible(p(A)))),K=B(()=>[...p(l),...p(d),...p(u),...p(m),...p(s),...p(y),...p(E),...p(h),...p(b),...p(o),...p(c),...p(i),...p(g),...p(R).filter(te=>te.category==="actions"||It.isNil(te.category))].filter(te=>te.isVisible(p(A)))),le=B(()=>[...p(f).map(te=>(te.keepOpen=!0,te)),...p(v),...p(R).filter(te=>te.category==="sidebar")].filter(te=>te.isVisible(p(A))));return{menuSections:B(()=>{const te=[];return p(A).resources.length>1?(p($).length&&te.push({name:"batch-actions",items:[...p($)]}),te.push({name:"batch-details",items:[...p(D)]}),te):([...p(N),...p(x)].length&&te.push({name:"context",items:[...p(N)],dropItems:[{label:r("Open with..."),name:"open-with",icon:"apps",items:[...p(x)]}]}),p(W).length&&te.push({name:"share",items:p(W)}),p(K).length&&te.push({name:"actions",items:p(K)}),p(le).length&&te.push({name:"sidebar",items:p(le)}),te)})}}});function Ox(e,t,n,r,o,i){const s=he("context-action-menu");return X(),Re(s,{"menu-sections":e.menuSections,"action-options":e.actionOptions},null,8,["menu-sections","action-options"])}const l0=We(Fx,[["render",Ox]]),kx=xe({props:{hasHiddenFiles:{type:Boolean,default:!0},hasFileExtensions:{type:Boolean,default:!0},hasPagination:{type:Boolean,default:!0},paginationOptions:{type:Array,default:()=>Cr.options},perPageQueryName:{type:String,default:()=>Cr.perPageQueryName},perPageDefault:{type:String,default:()=>Cr.perPageDefault},perPageStoragePrefix:{type:String,required:!0},viewModeDefault:{type:String,required:!1,default:()=>Jt.defaultModeName},viewModes:{type:Array,default:()=>[]}},setup(e){const t=He(),n=Kt(),{$gettext:r}=Fe.useGettext(),o=Qe(),{setAreHiddenFilesShown:i,setAreFileExtensionsShown:s,setAreDisabledSpacesShown:a,setAreEmptyTrashesShown:c}=o,{areHiddenFilesShown:u,areFileExtensionsShown:l,areDisabledSpacesShown:d,areEmptyTrashesShown:f}=Ue.storeToRefs(o),m=ce(!1),w=an("page"),y=B(()=>p(w)?parseInt(Rt(p(w))):1),E=Ar({name:e.perPageQueryName,defaultValue:e.perPageDefault,storagePrefix:e.perPageStoragePrefix}),b=Zs(),g=Ar({name:`${p(b)}-${Jt.queryName}`,defaultValue:e.viewModeDefault}),v=Ar({name:Jt.tilesSizeQueryName,defaultValue:Jt.tilesSizeDefault.toString()}),h=R=>t.replace({query:{...p(n).query,[e.perPageQueryName]:R,...p(y)>1&&{page:"1"}}}),S=R=>{g.value=R.name};St([E,g,v],R=>{m.value=R.some(_=>!_)},{immediate:!0,deep:!0});const T=Jf();return{FolderViewModeConstants:Jt,viewModeCurrent:g,viewSizeCurrent:v,viewSizeMax:T,itemsPerPageCurrent:E,queryParamsLoading:m,queryItemAsString:Rt,setItemsPerPage:h,setViewMode:S,areHiddenFilesShown:u,areFileExtensionsShown:l,areDisabledSpacesShown:d,areEmptyTrashesShown:f,setAreHiddenFilesShown:i,setAreFileExtensionsShown:s,setAreDisabledSpacesShown:a,setAreEmptyTrashesShown:c,viewOptionsButtonLabel:r("Display customization options of the files list"),isProjectsLocation:Kn(ht,"files-spaces-projects"),isTrashOverViewLocation:Kn(Tn,"files-trash-overview")}},computed:{hiddenFilesShownModel:{get(){return this.areHiddenFilesShown},set(e){this.setAreHiddenFilesShown(e)}},fileExtensionsShownModel:{get(){return this.areFileExtensionsShown},set(e){this.setAreFileExtensionsShown(e)}},disabledSpacesShownModel:{get(){return this.areDisabledSpacesShown},set(e){this.setAreDisabledSpacesShown(e)}},emptyTrashesShownModel:{get(){return this.areEmptyTrashesShown},set(e){this.setAreEmptyTrashesShown(e)}}},methods:{updateHiddenFilesShownModel(e){this.hiddenFilesShownModel=e},updateFileExtensionsShownModel(e){this.fileExtensionsShownModel=e},updateDisabledSpacesShownModel(e){this.disabledSpacesShownModel=e},updateEmptyTrashesShownModel(e){this.emptyTrashesShownModel=e}}}),xx={class:"oc-flex oc-flex-middle"},Nx={key:0,class:"viewmode-switch-buttons oc-button-group oc-visible@s oc-mr-s"},$x={key:0,class:"files-view-options-list-item"},Dx={key:1,class:"files-view-options-list-item"},Lx={key:2,class:"files-view-options-list-item"},Mx={key:3,class:"files-view-options-list-item"},Bx={key:4,class:"files-view-options-list-item"},jx={key:5,class:"files-view-options-list-item oc-flex oc-flex-between oc-flex-middle"},Ux=["textContent"],qx=["max"];function Vx(e,t,n,r,o,i){const s=he("oc-icon"),a=he("oc-button"),c=he("oc-switch"),u=he("oc-page-size"),l=he("oc-list"),d=he("oc-drop"),f=ln("oc-tooltip");return X(),pe("div",xx,[e.viewModes.length>1?(X(),pe("div",Nx,[(X(!0),pe(qe,null,wt(e.viewModes,m=>ot((X(),Re(a,{key:m.name,"no-hover":e.viewModeCurrent===m.name,class:H.normalizeClass([m.name]),appearance:e.viewModeCurrent===m.name?"filled":"outline","color-role":e.viewModeCurrent===m.name?"secondaryContainer":"secondary","aria-label":e.$gettext(m.label),onClick:w=>e.setViewMode(m)},{default:Se(()=>[ge(s,{name:m.icon.name,"fill-type":m.icon.fillType,size:"small"},null,8,["name","fill-type"])]),_:2},1032,["no-hover","class","appearance","color-role","aria-label","onClick"])),[[f,e.$gettext(m.label)]])),128))])):Ce("",!0),ot((X(),Re(a,{id:"files-view-options-btn",key:"files-view-options-btn","data-testid":"files-view-options-btn","aria-label":e.viewOptionsButtonLabel,appearance:"raw",class:"oc-my-s oc-p-xs"},{default:Se(()=>[ge(s,{name:"settings-3","fill-type":"line"})]),_:1},8,["aria-label"])),[[f,e.viewOptionsButtonLabel]]),ge(d,{"drop-id":"files-view-options-drop",toggle:"#files-view-options-btn",mode:"click",class:"oc-width-auto","padding-size":"medium"},{default:Se(()=>[ge(l,null,{default:Se(()=>[e.hasHiddenFiles?(X(),pe("li",$x,[ge(c,{checked:e.hiddenFilesShownModel,"onUpdate:checked":[t[0]||(t[0]=m=>e.hiddenFilesShownModel=m),e.updateHiddenFilesShownModel],"data-testid":"files-switch-hidden-files",label:e.$gettext("Show hidden files")},null,8,["checked","label","onUpdate:checked"])])):Ce("",!0),e.hasFileExtensions?(X(),pe("li",Dx,[ge(c,{checked:e.fileExtensionsShownModel,"onUpdate:checked":[t[1]||(t[1]=m=>e.fileExtensionsShownModel=m),e.updateFileExtensionsShownModel],"data-testid":"files-switch-files-extensions-files",label:e.$gettext("Show file extensions")},null,8,["checked","label","onUpdate:checked"])])):Ce("",!0),e.hasPagination?(X(),pe("li",Lx,[e.queryParamsLoading?Ce("",!0):(X(),Re(u,{key:0,selected:e.queryItemAsString(e.itemsPerPageCurrent),"data-testid":"files-pagination-size",label:e.$gettext("Items per page"),options:e.paginationOptions,class:"files-pagination-size",onChange:e.setItemsPerPage},null,8,["selected","label","options","onChange"]))])):Ce("",!0),e.isProjectsLocation?(X(),pe("li",Mx,[ge(c,{checked:e.disabledSpacesShownModel,"onUpdate:checked":[t[2]||(t[2]=m=>e.disabledSpacesShownModel=m),e.updateDisabledSpacesShownModel],"data-testid":"files-switch-projects-show-disabled",label:e.$gettext("Show disabled Spaces")},null,8,["checked","label","onUpdate:checked"])])):Ce("",!0),e.isTrashOverViewLocation?(X(),pe("li",Bx,[ge(c,{checked:e.emptyTrashesShownModel,"onUpdate:checked":[t[3]||(t[3]=m=>e.emptyTrashesShownModel=m),e.updateEmptyTrashesShownModel],"data-testid":"files-switch-projects-show-disabled",label:e.$gettext("Show empty trash bins")},null,8,["checked","label","onUpdate:checked"])])):Ce("",!0),e.viewModeCurrent===e.FolderViewModeConstants.name.tiles?(X(),pe("li",jx,[fe("label",{for:"tiles-size-slider",textContent:H.toDisplayString(e.$gettext("Tile size"))},null,8,Ux),ot(fe("input",{id:"tiles-size-slider","onUpdate:modelValue":t[4]||(t[4]=m=>e.viewSizeCurrent=m),type:"range",min:1,max:e.viewSizeMax,class:"oc-range","data-testid":"files-tiles-size-slider"},null,8,qx),[[zS,e.viewSizeCurrent]])])):Ce("",!0)]),_:1})]),_:1})])}const c0=We(kx,[["render",Vx],["__scopeId","data-v-9f461a71"]]),zx=xe({name:"AppBar",components:{BatchActions:s0,ContextActions:l0,ViewOptions:c0},props:{viewModeDefault:{type:String,required:!1,default:()=>Jt.name.table},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=at(),{$gettext:r}=Fe.useGettext(),{can:o}=mn(),i=He(),{requestExtensions:s}=Bi(),{isSticky:a}=Gf(),c=Qe(),{selectedResources:u}=Ue.storeToRefs(c),l=B(()=>e.space),{actions:d}=aa(),{actions:f}=la(),{actions:m}=ca(),{actions:w}=Wv(),{actions:y}=ua(),{actions:E}=Po(),{actions:b}=fa(),{actions:g}=Fo(),{actions:v}=da(),{actions:h}=ha(),{actions:S}=Vv(),{actions:T}=zv(),{actions:R}=Kv(),{actions:_}=Yv(),A=ce(0),$=Kn(Ct,"files-common-search"),D=B(()=>Object.hasOwn(bS(),"navigation")&&o("create-all","Share")),N=B(()=>{let G=[...p(f),...p(d),...p(y),...p(b),...p(g),...p(v),...p(m),...p(E),...p(h)];$.value||(G=[...G,...p(w),...p(R),...p(_),...p(S),...p(T)]);const re=s({id:"global.files.batch-actions",extensionType:"action"});return re.length&&(G=[...G,...re.map(se=>se.action)]),G.filter(se=>se.isVisible({space:p(l),resources:c.selectedResources}))}),x=B(()=>n.spaces.filter(G=>Z.isPersonalSpaceResource(G)||Z.isProjectSpaceResource(G))),W=gr("isMobileWidth"),K=Kn(Tn,"files-trash-generic"),le=B(()=>!p(W)&&e.breadcrumbs.length?!0:p(K)&&p(x).length===1?!1:e.breadcrumbs.length>1),be=B(()=>p(K)&&p(x).length===1?e.breadcrumbs.length<=2:e.breadcrumbs.length<=1),te=B(()=>p(l)&&(Z.isProjectSpaceResource(p(l))||Z.isShareSpaceResource(p(l)))?3:2),ae=G=>{t(Bb,G)},ue=uv("title"),ie=B(()=>{var G;return p(ue)?r(p(ue)):((G=p(l))==null?void 0:G.name)||""});return{router:i,hasSharesNavigation:D,batchActions:N,showBreadcrumb:le,showMobileNav:be,breadcrumbMaxWidth:A,breadcrumbTruncationOffset:te,fileDroppedBreadcrumb:ae,pageTitle:ie,selectedResources:u,isSticky:a}},data:function(){return{resizeObserver:new ResizeObserver(this.onResize),limitedScreenSpace:!1}},computed:{showContextActions(){return gd(this.breadcrumbs).allowContextActions},showBatchActions(){return this.hasBulkActions&&(this.selectedResources.length>=1||Tn(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(){var o,i,s,a;const e=((o=document.getElementById("web-content-main"))==null?void 0:o.getBoundingClientRect().width)||0,t=((i=document.getElementById("web-nav-sidebar"))==null?void 0:i.getBoundingClientRect().width)||0,n=((s=document.getElementById("app-sidebar"))==null?void 0:s.getBoundingClientRect().width)||0,r=(a=document.getElementById("files-app-bar-controls-right"))==null?void 0:a.clientWidth;this.breadcrumbMaxWidth=e-t-n-r,this.limitedScreenSpace=this.isSideBarOpen?window.innerWidth<=1280:window.innerWidth<=1e3}}}),Wx={class:"files-topbar oc-py-s"},Hx=["textContent"],Gx={key:3,id:"files-app-bar-controls-right",class:"oc-flex"},Kx={class:"files-app-bar-actions oc-mt-xs"},Qx={class:"oc-flex-1 oc-flex oc-flex-start oc-flex-middle"},Xx={key:1};function Yx(e,t,n,r,o,i){const s=he("oc-hidden-announcer"),a=he("context-actions"),c=he("oc-breadcrumb"),u=he("portal-target"),l=he("view-options"),d=he("batch-actions"),f=he("oc-spinner");return X(),pe("div",{id:"files-app-bar",ref:"filesAppBar",class:H.normalizeClass({"files-app-bar-squashed":e.isSideBarOpen,"files-app-bar-sticky":e.isSticky})},[fe("div",Wx,[fe("h1",{class:"oc-invisible-sr",textContent:H.toDisplayString(e.pageTitle)},null,8,Hx),ge(s,{announcement:e.selectedResourcesAnnouncement,level:"polite"},null,8,["announcement"]),fe("div",{class:H.normalizeClass(["oc-flex oc-flex-middle files-app-bar-controls",{"oc-flex-between":e.breadcrumbs.length||e.hasSharesNavigation,"oc-flex-right":!e.breadcrumbs.length&&!e.hasSharesNavigation}])},[e.showBreadcrumb?(X(),Re(c,{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,onItemDroppedBreadcrumb:e.fileDroppedBreadcrumb},{contextMenu:Se(()=>[ge(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","onItemDroppedBreadcrumb"])):Ce("",!0),e.showMobileNav?(X(),Re(u,{key:1,name:"app.runtime.mobile.nav"})):Ce("",!0),e.hasSharesNavigation?Xe(e.$slots,"navigation",{key:2},void 0,!0):Ce("",!0),e.hasViewOptions?(X(),pe("div",Gx,[ge(l,{"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"])])):Ce("",!0)],2),fe("div",Kx,[fe("div",Qx,[Xe(e.$slots,"actions",{limitedScreenSpace:e.limitedScreenSpace},void 0,!0),e.showBatchActions&&!e.batchActionsLoading?(X(),Re(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?(X(),pe("div",Xx,[ge(f,{"aria-label":e.$gettext("Loading actions")},null,8,["aria-label"])])):Ce("",!0)])]),Xe(e.$slots,"content",{},void 0,!0)])],2)}const Jx=We(zx,[["render",Yx],["__scopeId","data-v-e4e9c307"]]),Zx=xe({name:"CreateSpace",props:{showLabel:{type:Boolean,default:!0}},emits:["spaceCreated"],setup(e,{emit:t}){const{showMessage:n,showErrorMessage:r}=tt(),{$gettext:o}=Fe.useGettext(),{createSpace:i}=Ui(),{isSpaceNameValid:s}=ci(),{dispatchModal:a}=pt(),c=at(),{upsertResource:u}=Qe(),l=async f=>{try{const m=await i(f);u(m),c.upsertSpace(m),t("spaceCreated",m),n({title:o("Space was created successfully")})}catch(m){console.error(m),r({title:o("Creating space failed…"),errors:[m]})}};return{showCreateSpaceModal:()=>{a({title:o("Create a new space"),confirmText:o("Create"),hasInput:!0,inputLabel:o("Space name"),inputValue:o("New space"),inputRequiredMark:!0,onConfirm:f=>l(f),onInput:(f,m)=>{const{isValid:w,error:y}=s(f);m(w?null:y)}})}}}}),eN=["textContent"];function tN(e,t,n,r,o,i){const s=he("oc-icon"),a=he("oc-button"),c=ln("oc-tooltip");return ot((X(),Re(a,{id:"new-space-menu-btn","aria-label":e.showLabel?void 0:e.$gettext("New space"),appearance:"filled",onClick:e.showCreateSpaceModal},{default:Se(()=>[ge(s,{name:"add"}),e.showLabel?(X(),pe("span",{key:0,textContent:H.toDisplayString(e.$gettext("New Space"))},null,8,eN)):Ce("",!0)]),_:1},8,["aria-label","onClick"])),[[c,e.showLabel?void 0:e.$gettext("New space")]])}const nN=We(Zx,[["render",tN]]),rN=xe({name:"AppTopBar",components:{ContextActionMenu:td,ResourceListItem:ko},props:{dropDownMenuSections:{type:Array,default:()=>[]},dropDownActionOptions:{type:Object,default:()=>({space:null,resources:[]})},mainActions:{type:Array,default:()=>[]},hasAutoSave:{type:Boolean,default:!0},isEditor:{type:Boolean,default:!1},resource:{type:Object,default:null}},emits:["close"],setup(e){const{$gettext:t,current:n}=Fe.useGettext(),r=Qe(),o=st(),{getMatchingSpace:i}=un(),s=B(()=>r.areFileExtensionsShown),a=B(()=>t("Show context menu")),c=B(()=>e.isEditor&&e.hasAutoSave&&o.options.editor.autosaveEnabled),u=B(()=>{const f=qt.Duration.fromObject({seconds:o.options.editor.autosaveInterval},{locale:n});return t("Autosave (every %{ duration })",{duration:f.toHuman()})}),l=B(()=>i(e.resource)),d=B(()=>!Z.isPublicSpaceResource(p(l)));return{contextMenuLabel:a,areFileExtensionsShown:s,hasAutosave:c,autoSaveTooltipText:u,isPathDisplayed:d,...ui()}}}),iN={class:"oc-app-top-bar oc-flex"},oN={class:"oc-app-top-bar-inner oc-pl-m oc-pr-xs oc-flex oc-flex-middle oc-flex-between"},sN={class:"open-file-bar oc-flex"},aN={class:"oc-flex main-actions"},lN={key:1,class:"oc-flex oc-flex-middle"};function cN(e,t,n,r,o,i){const s=he("resource-list-item"),a=he("oc-icon"),c=he("oc-button"),u=he("context-action-menu"),l=he("oc-drop"),d=he("portal"),f=ln("oc-tooltip");return X(),Re(d,{to:"app.runtime.header.left"},{default:Se(()=>[fe("div",iN,[fe("span",oN,[fe("div",sN,[e.resource?(X(),Re(s,{key:0,id:"app-top-bar-resource","is-thumbnail-displayed":!1,"is-extension-displayed":e.areFileExtensionsShown,"path-prefix":e.getPathPrefix(e.resource),resource:e.resource,"parent-folder-name":e.getParentFolderName(e.resource),"parent-folder-link-icon-additional-attributes":e.getParentFolderLinkIconAdditionalAttributes(e.resource),"is-path-displayed":e.isPathDisplayed,"is-resource-clickable":!1},null,8,["is-extension-displayed","path-prefix","resource","parent-folder-name","parent-folder-link-icon-additional-attributes","is-path-displayed"])):Ce("",!0)]),fe("div",aN,[e.dropDownMenuSections.length?(X(),pe(qe,{key:0},[ot((X(),Re(c,{id:"oc-openfile-contextmenu-trigger","aria-label":e.contextMenuLabel,appearance:"raw-inverse","color-role":"chrome",class:"oc-p-xs"},{default:Se(()=>[ge(a,{name:"more-2"})]),_:1},8,["aria-label"])),[[f,e.contextMenuLabel]]),ge(l,{"drop-id":"oc-openfile-contextmenu",mode:"click","padding-size":"small",toggle:"#oc-openfile-contextmenu-trigger","close-on-click":"",onClick:t[0]||(t[0]=Pn(()=>{},["stop","prevent"]))},{default:Se(()=>[ge(u,{"menu-sections":e.dropDownMenuSections,"action-options":e.dropDownActionOptions},null,8,["menu-sections","action-options"])]),_:1})],64)):Ce("",!0),e.hasAutosave?(X(),pe("span",lN,[ot(ge(a,{"accessible-label":e.autoSaveTooltipText,name:"refresh",color:"white",class:"ox-p-xs oc-mx-xs"},null,8,["accessible-label"]),[[f,e.autoSaveTooltipText]])])):Ce("",!0),e.mainActions.length&&e.resource?(X(),Re(u,{key:2,"menu-sections":[{name:"main-actions",items:e.mainActions.filter(m=>m.isVisible()).map(m=>({...m,class:"oc-p-xs app-topbar-action",hideLabel:!0}))}],"action-options":{resources:[e.resource]},appearance:"raw-inverse","color-role":"chrome"},null,8,["menu-sections","action-options"])):Ce("",!0),ge(c,{id:"app-top-bar-close",appearance:"raw-inverse","color-role":"chrome",class:"oc-p-xs","aria-label":e.$gettext("Close"),onClick:t[1]||(t[1]=m=>e.$emit("close"))},{default:Se(()=>[ge(a,{name:"close"})]),_:1},8,["aria-label"])])])])]),_:1})}const u0=We(rN,[["render",cN]]),uN=xe({name:"ErrorScreen",props:{message:{default:"",type:String,required:!1}}}),fN={class:"oc-text-center oc-flex oc-flex-center oc-flex-middle oc-height-1-1"},dN={key:0,class:"oc-text-xlarge"};function pN(e,t,n,r,o,i){const s=he("oc-icon");return X(),pe("div",fN,[ge(s,{size:"xxlarge",name:"error-warning","fill-type":"line"}),e.message?(X(),pe("p",dN,H.toDisplayString(e.message),1)):Ce("",!0)])}const hN=We(uN,[["render",pN]]),gN=xe({name:"LoadingScreen"}),mN={class:"oc-text-center oc-flex oc-flex-center oc-flex-middle oc-height-1-1"},yN={class:"oc-invisible"};function bN(e,t,n,r,o,i){const s=he("oc-spinner"),a=ln("translate");return X(),pe("div",mN,[ge(s,{size:"xlarge"}),ot((X(),pe("p",yN,t[0]||(t[0]=[Ot("Loading app")]))),[[a]])])}const vN=We(gN,[["render",bN]]),wN=["id","data-testid","tabindex","inert"],SN={key:0,class:"sidebar-panel__header header"},EN={class:"header__title oc-my-rm"},TN={key:0,class:"sidebar-panel__navigation oc-mt-m"},f0=xe({__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}=Fe.useGettext(),o=Qa("appSideBar"),i=B(()=>e.availablePanels.filter(A=>{var $;return A.isVisible(e.panelContext)&&(($=A.isRoot)==null?void 0:$.call(A,e.panelContext))})),s=B(()=>e.availablePanels.filter(A=>{var $;return A.isVisible(e.panelContext)&&!(($=A.isRoot)!=null&&$.call(A,e.panelContext))})),a=B(()=>p(i).length?[p(i)[0],...p(s)]:p(s)),c=B(()=>{var $;const A=($=e.activePanel)==null?void 0:$.split("#")[0];return!A||!p(s).map(D=>D.name).includes(A)?null:A}),u=B(()=>p(c)!==null),l=B(()=>p(c)===null),d=ce(null),f=A=>{d.value=A},m=B(()=>p(u)?p(c):p(i)[0].name),w=B(()=>p(i).length===1?r("Back to %{panel} panel",{panel:p(i)[0].title(e.panelContext)}):r("Back to main panels")),y=ce(window.innerWidth),E=B(()=>p(y)<=580),b=B(()=>{var A,$;return($=(A=p(o))==null?void 0:A.parentElement)==null?void 0:$.querySelector("div")}),g=()=>{if(!p(b))return;const A=p(E)?"hidden":"visible";p(b).style.visibility=A},v=()=>{e.isOpen&&(y.value=window.innerWidth,g())};St(()=>e.isOpen,async A=>{A&&(await In(),g())},{immediate:!0});const h=A=>{n("selectPanel",A)},S=()=>{n("selectPanel",null)},T=()=>{n("close")},R=A=>{f(p(m)),h(A)},_=()=>{f(p(m)),S(),p(o).focus()};return Bt(()=>{window.addEventListener("resize",v)}),Vn(()=>{window.removeEventListener("resize",v),p(b)&&(p(b).style.visibility="visible")}),(A,$)=>{const D=he("oc-spinner"),N=he("oc-icon"),x=he("oc-button"),W=ln("oc-tooltip");return X(),pe("div",{id:"app-sidebar",ref_key:"appSideBar",ref:o,"data-testid":"app-sidebar",tabindex:"-1",class:H.normalizeClass({"has-active-sub-panel":u.value,"oc-flex oc-flex-center oc-flex-middle":A.loading,"app-sidebar-full-width":E.value})},[A.loading?(X(),Re(D,{key:0})):(X(!0),pe(qe,{key:1},wt(a.value,K=>{var le,be,te,ae,ue,ie;return X(),pe("div",{id:`sidebar-panel-${K.name}`,key:`panel-${K.name}`,"data-testid":`sidebar-panel-${K.name}`,tabindex:m.value===K.name?-1:null,class:H.normalizeClass(["sidebar-panel",{"is-root-panel":(le=K.isRoot)==null?void 0:le.call(K,A.panelContext),"is-active-sub-panel":u.value&&c.value===K.name,"is-active-root-panel":l.value&&((be=K.isRoot)==null?void 0:be.call(K,A.panelContext))}]),inert:m.value!==K.name},[[m.value,d.value].includes(K.name)?(X(),pe("div",SN,[(te=K.isRoot)!=null&&te.call(K,A.panelContext)?Ce("",!0):ot((X(),Re(x,{key:0,class:"header__back oc-p-xs",appearance:"raw","aria-label":w.value,onClick:_},{default:Se(()=>[ge(N,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"])),[[W,w.value]]),fe("h2",EN,H.toDisplayString(K.title(A.panelContext)),1),ge(x,{appearance:"raw",class:"header__close oc-p-xs","aria-label":p(r)("Close file sidebar"),onClick:T},{default:Se(()=>[ge(N,{name:"close"})]),_:1},8,["aria-label"])])):Ce("",!0),fe("div",null,[(ae=K.isRoot)!=null&&ae.call(K,A.panelContext)?Xe(A.$slots,"rootHeader",{key:0}):Xe(A.$slots,"subHeader",{key:1})]),fe("div",{class:H.normalizeClass(["sidebar-panel__body",[`sidebar-panel__body-${K.name}`]])},[fe("div",{class:H.normalizeClass(["sidebar-panel__body-content",{"sidebar-panel__body-content-stretch":!((ue=K.isRoot)!=null&&ue.call(K,A.panelContext))}])},[Xe(A.$slots,"body",{},()=>{var G;return[(X(!0),pe(qe,null,wt((G=K.isRoot)!=null&&G.call(K,A.panelContext)?i.value:[K],(re,se)=>{var Ie;return X(),pe("div",{key:`sidebar-panel-${re.name}`},[[m.value,d.value].includes(re.name)?(X(),Re(Nr(re.component),Gt({key:0,class:{"multi-root-panel-separator oc-mt oc-pt-s":se>0}},{ref_for:!0},((Ie=re.componentAttrs)==null?void 0:Ie.call(re,A.panelContext))||{}),null,16,["class"])):Ce("",!0)])}),128))]})],2),(ie=K.isRoot)!=null&&ie.call(K,A.panelContext)&&s.value.length>0?(X(),pe("div",TN,[(X(!0),pe(qe,null,wt(s.value,G=>(X(),Re(x,{id:`sidebar-panel-${G.name}-select`,key:`panel-select-${G.name}`,"data-testid":`sidebar-panel-${G.name}-select`,appearance:"raw-inverse","color-role":"surface",onClick:re=>R(G.name)},{default:Se(()=>[ge(N,{name:G.icon,"fill-type":G.iconFillType},null,8,["name","fill-type"]),Ot(" "+H.toDisplayString(G.title(A.panelContext))+" ",1),ge(N,{name:"arrow-right-s","fill-type":"line"})]),_:2},1032,["id","data-testid","onClick"]))),128))])):Ce("",!0)],2)],10,wN)}),128))],2)}}}),AN=xe({name:"SpaceInfo",setup(){return{resource:gr("resource")}}}),RN={class:"space_info oc-p-s"},_N={class:"space_info__body oc-text-overflow oc-flex oc-flex-middle"},IN={class:"oc-mr-s"},CN=["textContent"],PN=["textContent"];function FN(e,t,n,r,o,i){const s=he("oc-icon");return X(),pe("div",RN,[fe("div",_N,[fe("div",IN,[ge(s,{name:"layout-grid",size:e.resource.description?"large":"medium",class:"oc-display-block"},null,8,["size"])]),fe("div",null,[fe("h3",{"data-testid":"space-info-name",class:"oc-font-semibold oc-m-rm",textContent:H.toDisplayString(e.resource.name)},null,8,CN),fe("span",{"data-testid":"space-info-subtitle",textContent:H.toDisplayString(e.resource.description)},null,8,PN)])])])}const d0=We(AN,[["render",FN]]),ON=xe({name:"FileInfo",components:{ResourceIcon:Oo,ResourceName:Wf},props:{isSubPanelActive:{type:Boolean,default:!0}},setup(){const e=Qe(),t=gr("resource"),n=gr("space"),r=B(()=>e.areFileExtensionsShown),o=B(()=>Z.isPersonalSpaceResource(p(n))&&p(t).path==="/"?p(n).name:p(t).name);return{resource:t,resourceName:o,areFileExtensionsShown:r}}}),kN={class:"file_info oc-flex oc-flex-between oc-p-s"},xN={class:"oc-flex oc-flex-middle"},NN={class:"file_info__body oc-text-overflow"},$N={"data-testid":"files-info-name",class:"oc-font-semibold"};function DN(e,t,n,r,o,i){const s=he("resource-icon"),a=he("resource-name");return X(),pe("div",kN,[fe("div",xN,[e.isSubPanelActive?(X(),Re(s,{key:0,resource:e.resource,size:"large",class:"file_info__icon oc-mr-s oc-position-relative"},null,8,["resource"])):Ce("",!0),fe("div",NN,[fe("h3",$N,[ge(a,{name:e.resourceName,extension:e.resource.extension,type:e.resource.type,"full-path":e.resource.webDavPath,"is-extension-displayed":e.areFileExtensionsShown,"is-path-displayed":!1,"truncate-name":!1},null,8,["name","extension","type","full-path","is-extension-displayed"])])])])])}const p0=We(ON,[["render",DN]]),LN=xe({name:"FileSideBar",components:{FileInfo:p0,SpaceInfo:d0,InnerSideBar:f0},props:{isOpen:{type:Boolean,required:!0},activePanel:{type:String,required:!1,default:null},space:{type:Object,required:!1,default:null}},setup(e){const t=He(),n=Ge(),r=Bi(),o=li(),i=at(),s=Tr(),a=st(),c=or(),{canListShares:u}=Ov(),{canListVersions:l}=t0(),d=Qe(),{currentFolder:f}=Ue.storeToRefs(d),m=ce(),w=ce([]),y=ce([]),E=ce([]),{selectedResources:b}=ed(),g=ce(!1),v=B(()=>p(g)||te.isRunning),h=B(()=>{var ie;return p(b).length===0?{root:e.space,parent:null,items:(ie=p(f))!=null&&ie.id?[p(f)]:[]}:{root:e.space,parent:p(f),items:p(b)}}),S=Kn(jt,"files-shares-with-me"),T=Kn(jt,"files-shares-with-others"),R=Kn(jt,"files-shares-via-link"),_=ht(t,"files-spaces-projects"),A=Kn(Ct,"files-common-favorites"),$=Kn(Ct,"files-common-search"),D=()=>{o.publish(Tt.close)},N=ie=>{o.publish(Tt.setActivePanel,ie)},x=B(()=>{var ie;return((ie=p(h).items)==null?void 0:ie.length)===1&&!Z.isProjectSpaceResource(p(h).items[0])}),W=B(()=>{var ie;return((ie=p(h).items)==null?void 0:ie.length)===1&&Z.isProjectSpaceResource(p(h).items[0])}),K=B(()=>p(S)||p(T)||p(R)),le=B(()=>p(K)||p($)||p(A)),be=B(()=>r.requestExtensions({id:"global.files.sidebar",extensionType:"sidebarPanel"}).map(ie=>ie.panel)),te=pn.useTask(function*(ie,G){w.value=yield n.webdav.listFileVersions(G.id,{signal:ie})}),ae=pn.useTask(function*(ie,G){var $e;s.setLoading(!0),s.removeOrphanedShares();const{collaboratorShares:re,linkShares:se}=s,Ie=n.graphAuthenticated.permissions;let ee=($e=e.space)==null?void 0:$e.id;if(Z.isShareSpaceResource(e==null?void 0:e.space)){const Me=yield i.getMountPointForSpace({graphClient:n.graphAuthenticated,space:e.space,signal:ie});Me&&(ee=Me.root.remoteItem.rootId)}const{shares:F,allowedRoles:C}=yield*Z.call(Ie.listPermissions(ee,G.fileId,s.graphRoles,{},{signal:ie})),z=F.filter(Z.isCollaboratorShare),q=F.filter(Z.isLinkShare),M=Object.values(s.graphRoles);if(y.value=(C==null?void 0:C.map(Me=>{var Y;return{...Me,icon:(Y=M.find(Pe=>Pe.id===Me.id))==null?void 0:Y.icon}}))||[],c.isAppEnabled("open-cloud-mesh")){const{allowedRoles:Me}=yield*Z.call(Ie.listPermissions(ee,G.fileId,s.graphRoles,{filter:`@libre.graph.permissions.roles.allowedValues/rolePermissions/any(p:contains(p/condition, '@Subject.UserType=="Federated"'))`,select:[lv.LibreGraphPermissionsRolesAllowedValues]},{signal:ie}));E.value=(Me==null?void 0:Me.map(Y=>{var Pe;return{...Y,icon:(Pe=M.find(Ne=>Ne.id===Y.id))==null?void 0:Pe.icon}}))||[]}!p(le)&&!p(_)&&(re.forEach(Me=>{z.some(Y=>Y.id===Me.id)||z.push({...Me,indirect:!0})}),se.forEach(Me=>{q.some(Y=>Y.id===Me.id)||q.push({...Me,indirect:!0})})),Ct(t,"files-common-search")&&(yield d.loadAncestorMetaData({folder:p(G),space:p(e.space),client:n.webdav,signal:ie}));const de=[...re,...se].map(({resourceId:Me})=>Me),Te=Object.values(d.ancestorMetaData).filter(({id:Me,path:Y})=>Me===G.id||de.includes(Me)||Z.isIncomingShareResource(G)?!1:Z.isPersonalSpaceResource(e.space)?Y!=="/":!0).map(({id:Me})=>Me);p(le)&&Z.isProjectSpaceResource(e.space)&&!Z.isProjectSpaceResource(G)&&Te.push(e.space.id);const Le=new Fr({concurrency:a.options.concurrentRequests.shares.list}),ke=[...new Set(Te)].map(Me=>Le.add(()=>n.graphAuthenticated.permissions.listPermissions(ee,Me,s.graphRoles,{},{signal:ie}).then(Y=>{const Pe=Y.shares.map(Ne=>({...Ne,indirect:!0}));z.push(...Pe.filter(Z.isCollaboratorShare)),q.push(...Pe.filter(Z.isLinkShare))})));yield Promise.allSettled(ke),s.setCollaboratorShares(z),s.setLinkShares(q),s.setLoading(!1)}).restartable();St(()=>[...p(h).items,e.isOpen],async()=>{var G;if(((G=p(h).items)==null?void 0:G.length)!==1)return;if(!e.isOpen){w.value=[];return}const ie=p(h).items[0];if(te.isRunning&&te.cancelAll(),!!l({space:e.space,resource:ie}))try{await te.perform(ie)}catch(re){console.error(re)}},{immediate:!0,deep:!0});const ue=B(()=>p(h).items.map(ie=>ie.id));return St(()=>[ue,e.isOpen],async()=>{var G,re;if(!e.isOpen||!((G=p(h).items)!=null&&G.length)){s.pruneShares(),m.value=null;return}if(((re=p(h).items)==null?void 0:re.length)!==1)return;const ie=p(h).items[0];if(g.value=!0,Z.isProjectSpaceResource(ie)&&await i.loadGraphPermissions({ids:[ie.id],graphClient:n.graphAuthenticated}),u({space:e.space,resource:ie}))try{ae.isRunning&&ae.cancelAll(),ae.perform(ie)}catch(se){console.error(se)}if(!p(K)){m.value=ie,g.value=!1;return}try{const se=await n.webdav.getFileInfo(e.space,{path:ie.path}),Ie={...se,...ie,tags:se.tags};m.value=Ie}catch(se){m.value=ie,console.error(se)}g.value=!1},{deep:!0,immediate:!0}),Ti("resource",dr(m)),Ti("versions",dr(w)),Ti("space",B(()=>e.space)),Ti("activePanel",B(()=>e.activePanel)),Ti("availableInternalShareRoles",dr(y)),Ti("availableExternalShareRoles",dr(E)),{loadedResource:m,setActiveSideBarPanel:N,closeSideBar:D,panelContext:h,availablePanels:be,isFileHeaderVisible:x,isSpaceHeaderVisible:W,isLoading:v,loadSharesTask:ae}}});function MN(e,t,n,r,o,i){const s=he("file-info"),a=he("space-info"),c=he("InnerSideBar");return e.isOpen?(X(),Re(c,Gt({key:0,ref:"sidebar",class:"files-side-bar","is-open":e.isOpen,"active-panel":e.activePanel,"available-panels":e.availablePanels,"panel-context":e.panelContext,loading:e.isLoading},e.$attrs,{"data-custom-key-bindings-disabled":"true",onSelectPanel:e.setActiveSideBarPanel,onClose:e.closeSideBar}),{rootHeader:Se(()=>[e.isFileHeaderVisible?(X(),Re(s,{key:0,class:"sidebar-panel__file_info","is-sub-panel-active":!1})):e.isSpaceHeaderVisible?(X(),Re(a,{key:1,class:"sidebar-panel__space_info"})):Ce("",!0)]),subHeader:Se(()=>[e.isFileHeaderVisible?(X(),Re(s,{key:0,class:"sidebar-panel__file_info","is-sub-panel-active":!0})):e.isSpaceHeaderVisible?(X(),Re(a,{key:1,class:"sidebar-panel__space_info"})):Ce("",!0)]),_:1},16,["is-open","active-panel","available-panels","panel-context","loading","onSelectPanel","onClose"])):Ce("",!0)}const h0=We(LN,[["render",MN]]),BN=xe({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=ce(),t=ce(!0);return{confirmDisabled:t,onDateChanged:({date:r,error:o})=>{t.value=o||!r,e.value=r},dateTime:e}}}),jN={class:"link-modal-actions oc-flex oc-flex-right oc-flex-middle oc-mt-s"};function UN(e,t,n,r,o,i){const s=he("oc-datepicker"),a=he("oc-button");return X(),pe(qe,null,[ge(s,{label:e.$gettext("Expiration date"),type:"date","min-date":e.minDate,"current-date":e.currentDate,"is-clearable":e.isClearable,"required-mark":"",onDateChanged:e.onDateChanged},null,8,["label","min-date","current-date","is-clearable","onDateChanged"]),fe("div",jN,[ge(a,{class:"oc-modal-body-actions-cancel oc-ml-s",onClick:t[0]||(t[0]=c=>e.$emit("cancel"))},{default:Se(()=>[Ot(H.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),ge(a,{disabled:e.confirmDisabled,class:"oc-modal-body-actions-confirm oc-ml-s",appearance:"filled",onClick:t[1]||(t[1]=c=>e.$emit("confirm",e.dateTime))},{default:Se(()=>[Ot(H.toDisplayString(e.$gettext("Confirm")),1)]),_:1},8,["disabled"])])],64)}const qN=We(BN,[["render",UN]]),VN=xe({name:"UnsavedChangesModal",props:{modal:{type:Object,required:!0},closeCallback:{type:Function,required:!0}},emits:["cancel","confirm"],setup(e){const{removeModal:t}=pt();return{onClose:()=>{t(e.modal.id),e.closeCallback()}}}}),zN=["textContent"],WN={class:"oc-flex oc-flex-right oc-flex-middle oc-mt-m"},HN={class:"oc-modal-body-actions-grid"};function GN(e,t,n,r,o,i){const s=he("oc-button");return X(),pe(qe,null,[fe("span",{class:"oc-display-inline-block oc-mb-m",textContent:H.toDisplayString(e.$gettext("Your changes were not saved. Do you want to save them?"))},null,8,zN),t[2]||(t[2]=fe("div",{class:"oc-my-m"},null,-1)),fe("div",WN,[fe("div",HN,[ge(s,{class:"oc-modal-body-actions-cancel oc-ml-s",onClick:t[0]||(t[0]=a=>e.$emit("cancel"))},{default:Se(()=>[Ot(H.toDisplayString(e.$gettext("Cancel")),1)]),_:1}),ge(s,{class:"oc-modal-body-actions-secondary oc-ml-s",onClick:e.onClose},{default:Se(()=>[Ot(H.toDisplayString(e.$gettext("Don't Save")),1)]),_:1},8,["onClick"]),ge(s,{class:"oc-modal-body-actions-confirm oc-ml-s",appearance:"filled",onClick:t[1]||(t[1]=a=>e.$emit("confirm"))},{default:Se(()=>[Ot(H.toDisplayString(e.$gettext("Save")),1)]),_:1})])])],64)}const g0=We(VN,[["render",GN]]);var KN=/\s/;function QN(e){for(var t=e.length;t--&&KN.test(e.charAt(t)););return t}var XN=/^\s+/;function YN(e){return e&&e.slice(0,QN(e)+1).replace(XN,"")}var m0=NaN,JN=/^[-+]0x[0-9a-f]+$/i,ZN=/^0b[01]+$/i,e$=/^0o[0-7]+$/i,t$=parseInt;function n$(e){if(typeof e=="number")return e;if(ws(e))return m0;if(tr(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=tr(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=YN(e);var n=ZN.test(e);return n||e$.test(e)?t$(e.slice(2),n?2:8):JN.test(e)?m0:+e}const r$=xe({name:"AppWrapper",components:{AppTopBar:u0,FileSideBar:h0,ErrorScreen:hN,LoadingScreen:vN},props:{applicationId:{type:String,required:!0},urlForResourceOptions:{type:Object,default:()=>null,required:!1},fileContentOptions:{type:Object,default:()=>null,required:!1},wrappedComponent:{type:Object,default:null},importResourceWithExtension:{type:Function,default:()=>null},disableAutoSave:{type:Boolean,default:!1}},setup(e){const{$gettext:t,current:n}=Fe.useGettext(),r=or(),{showMessage:o,showErrorMessage:i}=tt(),s=Mo.useRouter(),a=Kt(),c=Ge(),u=fn(),{getResourceContext:l}=n0(),{selectedResources:d}=ed(),{dispatchModal:f}=pt(),m=at(),w=st(),y=Qe(),E=Tr(),b=li(),{actions:g}=jv({appId:e.applicationId}),{actions:v}=Lf(),{actions:h}=Fo(),{actions:S}=Uf(),{actions:T}=qf(),{actions:R}=Po(),_=B(()=>{var De;return!!((De=e.wrappedComponent.emits)!=null&&De.includes("update:resource"))}),A=ce(),$=ce(),D=ce(""),N=ce(""),x=ce(!p(_)),W=ce(),K=ce(!1),le=ce(),be=ce();let te="",ae=null;const{actions:ue}=qv({content:be}),ie=B(()=>{var De;return!!((De=e.wrappedComponent.emits)!=null&&De.includes("update:currentContent"))}),G=De=>!!Object.keys(e.wrappedComponent.props).includes(De),re=B(()=>p(be)!==p(le)),se=De=>{De.preventDefault()};St(re,De=>{De?window.addEventListener("beforeunload",se):window.removeEventListener("beforeunload",se)});const{applicationConfig:Ie,closeApp:ee,currentFileContext:F,getFileContents:C,getFileInfo:z,getUrlForResource:q,putFileContents:M,replaceInvalidFileRoute:V,revokeUrl:de,activeFiles:Te,loadFolderForFileContext:Le,isFolderLoading:ke}=vv({applicationId:e.applicationId}),{applicationMeta:$e}=xf({applicationId:e.applicationId,appsStore:r}),Me=B(()=>{var De;return(De=p($e).meta)==null?void 0:De.fileSizeLimit}),Y=B(()=>{const{name:De}=p($e);return t("%{appName} for %{fileName}",{appName:t(De),fileName:p(p(F).fileName)})}),Pe=ea("driveAliasAndItem"),Ne=an("fileId"),Ve=B(()=>Rt(p(Ne))),et=async()=>{const De=p(Ve),{space:Je,path:lt}=await l(De),Un=Je.getDriveAliasAndItem({path:lt});return Z.isPersonalSpaceResource(Je)?s.push({params:{...p(a).params,driveAliasAndItem:Un},query:{...p(a).query,fileId:De,contextRouteName:"files-spaces-generic",contextRouteParams:{driveAliasAndItem:dt.dirname(Un)}}}):s.push({params:{...p(a).params,driveAliasAndItem:Un},query:{...p(a).query,fileId:De,contextRouteName:lt==="/"?"files-shares-with-me":"files-spaces-generic",...Z.isShareSpaceResource(Je)&&{shareId:Je.id},contextRouteParams:{driveAliasAndItem:dt.dirname(Un)},contextRouteQuery:{...Z.isShareSpaceResource(Je)&&{shareId:Je.id}}}})},Nt=pn.useTask(function*(De){try{p(Pe)||(yield et()),$.value=p(p(F).space);const Je=yield z(p(F),{signal:De});if(A.value=Je,Z.isShareSpaceResource(p($))&&(p(A).remoteItemId=p($).id,p(A).id===p(A).remoteItemId)){const lt=yield*Z.call(vs({graphClient:c.graphAuthenticated,spacesStore:m,space:p($)}));lt&&(A.value={...Je,...Z.buildIncomingShareResource({graphRoles:E.graphRoles,driveItem:lt,serverUrl:w.serverUrl}),tags:Je.tags})}y.initResourceList({currentFolder:null,resources:[p(A)]}),d.value=[p(A)]}catch(Je){console.error(Je),W.value=Je,x.value=!1}}).restartable(),_t=pn.useTask(function*(De){try{const Je=e.importResourceWithExtension(p(A));if(Je){const lt=qt.DateTime.local().toFormat("yyyyMMddHHmmss"),Un=`${p(A).name}_${lt}.${Je}`;if(!(yield c.webdav.copyFiles(p($),p(A),p($),{path:Un},{signal:De})))throw new Error(t("Importing failed"));A.value={path:Un}}if(V(F,p(A)))return;if(K.value=![On.Updateable,On.FileUpdateable].some(lt=>(p(A).permissions||"").indexOf(lt)>-1),p(G("currentContent"))){const lt=yield*Z.call(C(F,{...e.fileContentOptions,signal:De}));le.value=be.value=lt.body,D.value=lt.headers["OC-ETag"]}p(G("url"))&&(N.value=yield q(p($),p(A),{...e.urlForResourceOptions,signal:De}))}catch(Je){console.error(Je),W.value=Je}finally{x.value=!1}}).restartable();St(F,async()=>{p(_)||(await Nt.perform(),p(Me)&&n$(p(A).size)>p(Me)?f({title:t("File exceeds %{threshold}",{threshold:An(p(Me),n)}),message:t("%{resource} exceeds the recommended size of %{threshold} for editing, and may cause performance issues.",{resource:p(A).name,threshold:An(p(Me),n)}),confirmText:t("Continue"),onCancel:()=>{ee()},onConfirm:()=>{_t.perform()}}):_t.perform())},{immediate:!0});const $t=De=>{console.error(De),i({title:t("An error occurred"),desc:De.message,errors:[De]})},Be=()=>{o({title:t("File autosaved")})},ze=pn.useTask(function*(){const De=p(be);try{const Je=yield M(F,{content:De,previousEntityTag:p(D)});le.value=De,D.value=Je.etag,y.upsertResource(Je)}catch(Je){switch(Je.statusCode){case 401:case 403:$t(new Z.HttpError(t("You're not authorized to save this file"),Je.response));break;case 409:case 412:$t(new Z.HttpError(t("This file was updated outside this window. Please refresh the page (all changes will be lost)."),Je.response));break;case 507:const lt=m.spaces.find(Un=>Un.id===p(A).storageId&&Z.isProjectSpaceResource(Un));if(lt){$t(new Z.HttpError(t('Insufficient quota on "%{spaceName}" to save this file',{spaceName:lt.name}),Je.response));break}$t(new Z.HttpError(t("Insufficient quota for saving this file"),Je.response));break;default:$t(new Z.HttpError("",Je.response))}}}).drop(),dn=async()=>{await ze.perform()},j=B(()=>!e.disableAutoSave);let I=null;Bt(()=>{var Je;if(te=b.subscribe("runtime.resource.deleted",Ae),(Je=y.ancestorMetaData)!=null&&Je["/"]&&p($)&&y.ancestorMetaData["/"].spaceId!==p($).id&&y.setAncestorMetaData({}),!p(ie))return;const De=w.options.editor;De.autosaveEnabled&&!e.disableAutoSave&&(I=setInterval(async()=>{re.value&&(await dn(),Be())},(De.autosaveInterval||120)*1e3))}),Vn(()=>{b.unsubscribe("runtime.resource.deleted",te),u.isLoading||window.removeEventListener("beforeunload",se),p(G("url"))&&de(N.value),p(ie)&&(clearInterval(I),I=null)});const{bindKeyAction:O}=Qf({skipDisabledKeyBindingsCheck:!0});O({modifier:Kf.Ctrl,primary:Ir.S},()=>{p(re)&&dn()});const Q=B(()=>[{name:"save-file",disabledTooltip:()=>"",isVisible:()=>p(ie),isDisabled:()=>K.value||!re.value,icon:"save",id:"app-save-action",label:()=>t("Save"),handler:dn}]),ne=B(()=>({space:p($),resources:[p(A)]})),ye=async(De,Je)=>{p(re)&&(await dn(),Be()),Je(De)},Ae=De=>{if(De.find(lt=>lt.id===p(A).id)){if(ae)return ae();ee()}},Ye=B(()=>[...p(g),...p(Q),...p(ue).map(De=>({...De,isVisible:Je=>ie.value&&De.isVisible(Je)}))].filter(De=>De.isVisible(p(ne)))),ut=B(()=>[...p(T),...p(v)].filter(De=>De.isVisible(p(ne)))),ft=B(()=>[...p(h).map(De=>({...De,handler:Je=>ye(Je,De.handler)})),...p(R)].filter(De=>De.isVisible(p(ne)))),bt=B(()=>[...p(S)].filter(De=>De.isVisible(p(ne)))),it=B(()=>{const De=[];return p(Ye).length&&De.push({name:"context",items:p(Ye)}),p(ut).length&&De.push({name:"share",items:p(ut)}),p(ft).length&&De.push({name:"actions",items:p(ft)}),p(bt).length&&De.push({name:"sidebar",items:p(bt)}),De}),Vi=B(()=>[...p(Q)]);Mo.onBeforeRouteLeave((De,Je,lt)=>{p(re)?f({title:t("Unsaved changes"),customComponent:g0,focusTrapInitial:".oc-modal-body-actions-confirm",hideActions:!0,customComponentAttrs:()=>({closeCallback:()=>{lt()}}),async onConfirm(){await dn(),lt()}}):lt()});const jn=B(()=>({url:p(N),space:p(p(F).space),resource:p(A),activeFiles:p(Te),isDirty:p(re),isReadOnly:p(K),applicationConfig:p(Ie),currentFileContext:p(F),currentContent:p(be),isFolderLoading:p(ke),"onUpdate:resource":De=>{$.value=p(p(F).space),A.value={...De,...Z.isShareSpaceResource(p($))&&{remoteItemId:p($).id}},d.value=[p(A)]},"onUpdate:currentContent":De=>{be.value=De},"onRegister:onDeleteResourceCallback":De=>{ae=De},"onDelete:resource":()=>{p(R)[0].isVisible({space:p($),resources:[p(A)]})&&p(R)[0].handler({space:p($),resources:[p(A)]})},onSave:dn,onClose:ee,loadFolderForFileContext:Le,revokeUrl:de,getUrlForResource:q}));return{...Ob(),dropDownMenuSections:it,dropDownActionOptions:ne,hasAutoSave:j,isEditor:ie,closeApp:ee,fileActions:Vi,loading:x,loadingError:W,pageTitle:Y,resource:A,space:$,slotAttrs:jn}}}),i$=["id"],o$=["textContent"];function s$(e,t,n,r,o,i){const s=he("app-top-bar"),a=he("loading-screen"),c=he("error-screen"),u=he("file-side-bar");return X(),pe("main",{id:e.applicationId,class:"app-wrapper oc-height-1-1",onKeydown:t[0]||(t[0]=no((...l)=>e.closeApp&&e.closeApp(...l),["esc"]))},[fe("h1",{class:"oc-invisible-sr",textContent:H.toDisplayString(e.pageTitle)},null,8,o$),!e.loading&&!e.loadingError&&e.resource?(X(),Re(s,{key:0,"main-actions":e.fileActions,"drop-down-menu-sections":e.dropDownMenuSections,"drop-down-action-options":e.dropDownActionOptions,"has-auto-save":e.hasAutoSave,"is-editor":e.isEditor,resource:e.resource,onClose:e.closeApp},null,8,["main-actions","drop-down-menu-sections","drop-down-action-options","has-auto-save","is-editor","resource","onClose"])):Ce("",!0),e.loading?(X(),Re(a,{key:1})):e.loadingError?(X(),Re(c,{key:2,message:e.loadingError.message},null,8,["message"])):(X(),pe("div",{key:3,class:H.normalizeClass(["oc-flex oc-width-1-1 oc-height-1-1",{"app-sidebar-open":e.isSideBarOpen}])},[Xe(e.$slots,"default",Gt({class:"app-wrapper-content oc-height-1-1"},e.slotAttrs)),ge(u,{"is-open":e.isSideBarOpen,"active-panel":e.sideBarActivePanel,space:e.space},null,8,["is-open","active-panel","space"])],2))],40,i$)}const y0=We(r$,[["render",s$]]);function a$(e,t){return xe({render(){return al(y0,{wrappedComponent:e,...t},{default:n=>al(e,n)})}})}const l$=xe({name:"ContextMenuQuickAction",props:{item:{type:Object,required:!0},resourceDomSelector:{type:Function,required:!1,default:e=>Z.extractDomSelector(e.id)}},emits:["quickActionClicked"],setup(){const{$gettext:e}=Fe.useGettext(),t=B(()=>e("Show context menu")),n=ce(!1);return{contextMenuLabel:t,isOpen:n}}});function c$(e,t,n,r,o,i){const s=he("oc-icon"),a=he("oc-drop"),c=he("oc-button"),u=ln("oc-tooltip");return ot((X(),Re(c,{id:`context-menu-trigger-${e.resourceDomSelector(e.item)}`,"aria-label":e.contextMenuLabel,appearance:"raw",class:"quick-action-button oc-ml-xs oc-p-xs",onClick:t[2]||(t[2]=Pn(l=>e.$emit("quickActionClicked",{event:l,dropdown:e.$refs[`context-menu-drop-ref-${e.resourceDomSelector(e.item)}`]}),["stop","prevent"]))},{default:Se(()=>[ge(s,{name:"more-2"}),ge(a,{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)}`,position:"bottom-end",mode:"click","padding-size":"small","close-on-click":"",onShowDrop:t[0]||(t[0]=l=>e.isOpen=!0),onHideDrop:t[1]||(t[1]=l=>e.isOpen=!1)},{default:Se(()=>[Xe(e.$slots,"contextMenu",{item:e.item,isOpen:e.isOpen})]),_:3},8,["drop-id","toggle"])]),_:3},8,["id","aria-label"])),[[u,e.contextMenuLabel]])}const nd=We(l$,[["render",c$]]),u$=xe({name:"ResourceGhostElement",components:{ResourceIcon:Oo},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}}}),f$={id:"ghost-element",class:"ghost-element"},d$={class:"ghost-element-layer1 oc-rounded"},p$={key:0,class:"ghost-element-layer2 oc-rounded"},h$={key:1,class:"ghost-element-layer3 oc-rounded"},g$={class:"badge"};function m$(e,t,n,r,o,i){const s=he("resource-icon");return X(),pe("div",f$,[fe("div",d$,[ge(s,{class:"oc-p-xs",resource:e.previewItems[0]},null,8,["resource"]),e.showSecondLayer?(X(),pe("div",p$)):Ce("",!0),e.showThirdLayer?(X(),pe("div",h$)):Ce("",!0)]),fe("span",g$,H.toDisplayString(e.itemCount),1)])}const rd=We(u$,[["render",m$]]),y$=xe({name:"ResourceSize",props:{size:{type:[String,Number],required:!0}},setup:e=>{const{current:t}=Fe.useGettext();return{formattedSize:B(()=>An(e.size,t))}}}),b$=["textContent"];function v$(e,t,n,r,o,i){return X(),pe("span",{class:"oc-resource-size",textContent:H.toDisplayString(e.formattedSize)},null,8,b$)}const b0=We(y$,[["render",v$]]),xo={};function w$(e){return e.getIsPending!==void 0}function S$(e){if(w$(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 E$(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 T$(e){return Object.keys(e).reduce((t,n)=>(e[n]!==!1&&e[n]!==null&&e[n]!==void 0&&(t[n]=e[n]),t),{})}function A$(e,t){const{class:n,style:r,...o}=E$(e),{class:i,style:s,...a}=T$(t);return{class:[n,i],style:[r,s],...o,...a}}const v0=xe({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,i=ap(),s=ce(),a=ce(),c=ce(),u=Math.random().toString(36).substring(2);t({svgElSource:s,request:c}),St(()=>r.src,E=>{d(E)}),d(r.src);function l(E){if(E=E.cloneNode(!0),r.uniqueIds){const b=typeof r.uniqueIds=="string"?r.uniqueIds:u;E=y(E,b,r.uniqueIdsBase)}return E=r.transformSource(E),r.title&&w(E,r.title),E.innerHTML}function d(E){xo[E]||(xo[E]=f(E)),s.value&&xo[E].getIsPending()&&!r.keepDuringLoading&&(s.value=null,o("unloaded")),xo[E].then(b=>{s.value=b,In(()=>{o("loaded",a.value)})}).catch(b=>{s.value&&(s.value=void 0,o("unloaded")),delete xo[E],o("error",b)})}function f(E){return S$(new Promise((b,g)=>{const v=new XMLHttpRequest;v.open("GET",E,!0),c.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?b(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?al("svg",{...A$(s.value,i),innerHTML:l(s.value),ref:a}):null;function w(E,b){const g=E.getElementsByTagName("title");if(g.length)g[0].textContent=b;else{const v=document.createElementNS("http://www.w3.org/2000/svg","title");v.textContent=b,E.insertBefore(v,E.firstChild)}}function y(E,b,g=""){const v=["id","href","xlink:href","xlink:role","xlink:arcrole"],h=["href","xlink:href"],S=(T,R)=>h.includes(T)&&(R?!R.includes("#"):!1);return[...E.children].forEach(T=>{var R;if((R=T.attributes)!=null&&R.length){const _=Object.values(T.attributes).map(A=>{const $=/url\((.*?)\)/.exec(A.value);return $!=null&&$[1]&&(A.value=A.value.replace($[0],`url(${g}${$[1]}_${b})`)),A});v.forEach(A=>{const $=_.find(D=>D.name===A);$&&!S(A,$.value)&&($.value=`${$.value}_${b}`)})}return T.children.length?y(T,b,g):T}),E}return(E,b)=>(X(),Re(m))}}),w0=xe({__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}){v0.name="inline-svg";const n=t,r=B(()=>Xs("oc-icon-title-")),o=B(()=>{const c=`${JP()}icons/`,u=e.fillType.toLowerCase();return u==="none"?`${c}${e.name}.svg`:`${c}${e.name}-${u}.svg`}),i=c=>s(Mr(c)),s=c=>{if(c!==null)return`oc-icon-${c}`},a=c=>{if(e.accessibleLabel!==""){const u=document.createElement("title");u.setAttribute("id",r.value),u.appendChild(document.createTextNode(e.accessibleLabel)),c.insertBefore(u,c.firstChild)}return c};return(c,u)=>(X(),Re(Nr(c.type),{class:H.normalizeClass([{"oc-button-reset":c.type==="button"},"oc-icon",i(c.size)])},{default:Se(()=>[ge(p(v0),{src:o.value,"transform-source":a,"aria-hidden":c.accessibleLabel===""?"true":null,"aria-labelledby":c.accessibleLabel===""?null:r.value,focusable:c.accessibleLabel===""?"false":null,style:H.normalizeStyle(c.color!==""?{fill:c.color}:{}),onLoaded:u[0]||(u[0]=l=>n("loaded"))},null,8,["src","aria-hidden","aria-labelledby","focusable","style"])]),_:1},8,["class"]))}}),S0=xe({__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=B(()=>{const a=["oc-button","oc-rounded",`oc-button-${Mr(e.size)}`,`oc-button-justify-content-${e.justifyContent}`,`oc-button-gap-${Mr(e.gapSize)}`,`oc-button-${It.kebabCase(e.colorRole)}`,`oc-button-${e.appearance}`,`oc-button-${It.kebabCase(e.colorRole)}-${e.appearance}`];return e.noHover&&a.push("no-hover"),a}),o=B(()=>({...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=B(()=>({...e.type==="button"&&{click:s}})),s=a=>{n("click",a)};return(a,c)=>{const u=he("oc-spinner");return X(),Re(Nr(a.type),Gt(o.value,{"aria-label":a.ariaLabel,class:r.value},Za(i.value)),{default:Se(()=>[a.showSpinner?(X(),Re(u,{key:0,size:"small",class:"spinner"})):Ce("",!0),Xe(a.$slots,"default")]),_:3},16,["aria-label","class"])}}});/*!
53
53
  * tabbable 6.2.0
54
54
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
55
- */var d0=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],ha=d0.join(","),p0=typeof Element>"u",ui=p0?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ga=!p0&&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==null?void 0:e.ownerDocument},ma=function e(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"),i=o===""||o==="true",s=i||n&&t&&e(t.parentNode);return s},c$=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},h0=function(t,n,r){if(ma(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(ha));return n&&ui.call(t,ha)&&o.unshift(t),o=o.filter(r),o},g0=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!ma(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),c=a.length?a:s.children,u=e(c,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:s,candidates:u})}else{var l=ui.call(s,ha);l&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var f=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),d=!ma(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(f&&d){var m=e(f===!0?s.children:f.children,!0,r);r.flatten?o.push.apply(o,m):o.push({scopeParent:s,candidates:m})}else i.unshift.apply(i,s.children)}}return o},m0=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},fi=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||c$(t))&&!m0(t)?0:t.tabIndex},u$=function(t,n){var r=fi(t);return r<0&&n&&!m0(t)?0:r},f$=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},y0=function(t){return t.tagName==="INPUT"},d$=function(t){return y0(t)&&t.type==="hidden"},p$=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},h$=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},g$=function(t){if(!t.name)return!0;var n=t.form||ga(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},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(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 i=h$(o,t.form);return!i||i===t},m$=function(t){return y0(t)&&t.type==="radio"},y$=function(t){return m$(t)&&!g$(t)},b$=function(t){var n,r=t&&ga(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var s,a,c;for(i=!!((s=o)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!i&&o;){var u,l,f;r=ga(o),o=(u=r)===null||u===void 0?void 0:u.host,i=!!((l=o)!==null&&l!==void 0&&(f=l.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return i},b0=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},v$=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=ui.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(ui.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var c=t.parentElement,u=ga(t);if(c&&!c.shadowRoot&&o(c)===!0)return b0(t);t.assignedSlot?t=t.assignedSlot:!c&&u!==t.ownerDocument?t=u.host:t=c}t=a}if(b$(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return b0(t);return!1},w$=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 ui.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},ya=function(t,n){return!(n.disabled||ma(n)||d$(n)||v$(n,t)||p$(n)||w$(n))},Xf=function(t,n){return!(y$(n)||fi(n)<0||!ya(t,n))},S$=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},E$=function e(t){var n=[],r=[];return t.forEach(function(o,i){var s=!!o.scopeParent,a=s?o.scopeParent:o,c=u$(a,s),u=s?e(o.candidates):a;c===0?s?n.push.apply(n,u):n.push(a):r.push({documentOrder:i,tabIndex:c,item:o,isScope:s,content:u})}),r.sort(f$).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},T$=function(t,n){n=n||{};var r;return n.getShadowRoot?r=g0([t],n.includeContainer,{filter:Xf.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:S$}):r=h0(t,n.includeContainer,Xf.bind(null,n)),E$(r)},A$=function(t,n){n=n||{};var r;return n.getShadowRoot?r=g0([t],n.includeContainer,{filter:ya.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=h0(t,n.includeContainer,ya.bind(null,n)),r},qi=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ui.call(t,ha)===!1?!1:Xf(n,t)},R$=d0.concat("iframe").join(","),Yf=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ui.call(t,R$)===!1?!1:ya(n,t)};/*!
56
- * focus-trap 7.6.4
55
+ */var E0=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],va=E0.join(","),T0=typeof Element>"u",fi=T0?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,wa=!T0&&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==null?void 0:e.ownerDocument},Sa=function e(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"),i=o===""||o==="true",s=i||n&&t&&e(t.parentNode);return s},R$=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},A0=function(t,n,r){if(Sa(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(va));return n&&fi.call(t,va)&&o.unshift(t),o=o.filter(r),o},R0=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!Sa(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),c=a.length?a:s.children,u=e(c,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:s,candidates:u})}else{var l=fi.call(s,va);l&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var d=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),f=!Sa(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(d&&f){var m=e(d===!0?s.children:d.children,!0,r);r.flatten?o.push.apply(o,m):o.push({scopeParent:s,candidates:m})}else i.unshift.apply(i,s.children)}}return o},_0=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},di=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||R$(t))&&!_0(t)?0:t.tabIndex},_$=function(t,n){var r=di(t);return r<0&&n&&!_0(t)?0:r},I$=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},I0=function(t){return t.tagName==="INPUT"},C$=function(t){return I0(t)&&t.type==="hidden"},P$=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},F$=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},O$=function(t){if(!t.name)return!0;var n=t.form||wa(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},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(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 i=F$(o,t.form);return!i||i===t},k$=function(t){return I0(t)&&t.type==="radio"},x$=function(t){return k$(t)&&!O$(t)},N$=function(t){var n,r=t&&wa(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var s,a,c;for(i=!!((s=o)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!i&&o;){var u,l,d;r=wa(o),o=(u=r)===null||u===void 0?void 0:u.host,i=!!((l=o)!==null&&l!==void 0&&(d=l.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return i},C0=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},$$=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=fi.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(fi.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var c=t.parentElement,u=wa(t);if(c&&!c.shadowRoot&&o(c)===!0)return C0(t);t.assignedSlot?t=t.assignedSlot:!c&&u!==t.ownerDocument?t=u.host:t=c}t=a}if(N$(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return C0(t);return!1},D$=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 fi.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Ea=function(t,n){return!(n.disabled||Sa(n)||C$(n)||$$(n,t)||P$(n)||D$(n))},id=function(t,n){return!(x$(n)||di(n)<0||!Ea(t,n))},L$=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},M$=function e(t){var n=[],r=[];return t.forEach(function(o,i){var s=!!o.scopeParent,a=s?o.scopeParent:o,c=_$(a,s),u=s?e(o.candidates):a;c===0?s?n.push.apply(n,u):n.push(a):r.push({documentOrder:i,tabIndex:c,item:o,isScope:s,content:u})}),r.sort(I$).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},B$=function(t,n){n=n||{};var r;return n.getShadowRoot?r=R0([t],n.includeContainer,{filter:id.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:L$}):r=A0(t,n.includeContainer,id.bind(null,n)),M$(r)},j$=function(t,n){n=n||{};var r;return n.getShadowRoot?r=R0([t],n.includeContainer,{filter:Ea.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=A0(t,n.includeContainer,Ea.bind(null,n)),r},qi=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return fi.call(t,va)===!1?!1:id(n,t)},U$=E0.concat("iframe").join(","),od=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return fi.call(t,U$)===!1?!1:Ea(n,t)};/*!
56
+ * focus-trap 7.6.5
57
57
  * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
58
- */function Jf(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 _$(e){if(Array.isArray(e))return Jf(e)}function I$(e,t,n){return(t=k$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C$(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function P$(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
59
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v0(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 w0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v0(Object(n),!0).forEach(function(r){I$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function F$(e){return _$(e)||C$(e)||x$(e)||P$()}function O$(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 k$(e){var t=O$(e,"string");return typeof t=="symbol"?t:t+""}function x$(e,t){if(e){if(typeof e=="string")return Jf(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)?Jf(e,t):void 0}}var S0={activateTrap:function(t,n){if(t.length>0){var r=t[t.length-1];r!==n&&r._setPausedState(!0)}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),t.length>0&&!t[t.length-1]._isManuallyPaused()&&t[t.length-1]._setPausedState(!1)}},N$=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},$$=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},$o=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},D$=function(t){return $o(t)&&!t.shiftKey},L$=function(t){return $o(t)&&t.shiftKey},E0=function(t){return setTimeout(t,0)},Do=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},ba=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},M$=[],B$=function(t,n){var r=(n==null?void 0:n.document)||document,o=(n==null?void 0:n.trapStack)||M$,i=w0({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:D$,isKeyBackward:L$},n),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a,c=function($,V,X){return $&&$[V]!==void 0?$[V]:i[X||V]},u=function($,V){var X=typeof(V==null?void 0:V.composedPath)=="function"?V.composedPath():void 0;return s.containerGroups.findIndex(function(ee){var se=ee.container,ie=ee.tabbableNodes;return se.contains($)||(X==null?void 0:X.includes(se))||ie.find(function(re){return re===$})})},l=function($){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},X=V.hasFallback,ee=X===void 0?!1:X,se=V.params,ie=se===void 0?[]:se,re=i[$];if(typeof re=="function"&&(re=re.apply(void 0,F$(ie))),re===!0&&(re=void 0),!re){if(re===void 0||re===!1)return re;throw new Error("`".concat($,"` was specified but was not a node, or did not return a node"))}var fe=re;if(typeof re=="string"){try{fe=r.querySelector(re)}catch(ue){throw new Error("`".concat($,'` appears to be an invalid selector; error="').concat(ue.message,'"'))}if(!fe&&!ee)throw new Error("`".concat($,"` as selector refers to no known node"))}return fe},f=function(){var $=l("initialFocus",{hasFallback:!0});if($===!1)return!1;if($===void 0||$&&!Yf($,i.tabbableOptions))if(u(r.activeElement)>=0)$=r.activeElement;else{var V=s.tabbableGroups[0],X=V&&V.firstTabbableNode;$=X||l("fallbackFocus")}else $===null&&($=l("fallbackFocus"));if(!$)throw new Error("Your focus-trap needs to have at least one focusable element");return $},d=function(){if(s.containerGroups=s.containers.map(function($){var V=T$($,i.tabbableOptions),X=A$($,i.tabbableOptions),ee=V.length>0?V[0]:void 0,se=V.length>0?V[V.length-1]:void 0,ie=X.find(function(ue){return qi(ue)}),re=X.slice().reverse().find(function(ue){return qi(ue)}),fe=!!V.find(function(ue){return fi(ue)>0});return{container:$,tabbableNodes:V,focusableNodes:X,posTabIndexesFound:fe,firstTabbableNode:ee,lastTabbableNode:se,firstDomTabbableNode:ie,lastDomTabbableNode:re,nextTabbableNode:function(Z){var oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,ce=V.indexOf(Z);return ce<0?oe?X.slice(X.indexOf(Z)+1).find(function(Ce){return qi(Ce)}):X.slice(0,X.indexOf(Z)).reverse().find(function(Ce){return qi(Ce)}):V[ce+(oe?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function($){return $.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!l("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($){return $.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($){var V=$.activeElement;if(V)return V.shadowRoot&&V.shadowRoot.activeElement!==null?m(V.shadowRoot):V},w=function($){if($!==!1&&$!==m(document)){if(!$||!$.focus){w(f());return}$.focus({preventScroll:!!i.preventScroll}),s.mostRecentlyFocusedNode=$,N$($)&&$.select()}},v=function($){var V=l("setReturnFocus",{params:[$]});return V||(V===!1?!1:$)},T=function($){var V=$.target,X=$.event,ee=$.isBackward,se=ee===void 0?!1:ee;V=V||ba(X),d();var ie=null;if(s.tabbableGroups.length>0){var re=u(V,X),fe=re>=0?s.containerGroups[re]:void 0;if(re<0)se?ie=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:ie=s.tabbableGroups[0].firstTabbableNode;else if(se){var ue=s.tabbableGroups.findIndex(function(_){var F=_.firstTabbableNode;return V===F});if(ue<0&&(fe.container===V||Yf(V,i.tabbableOptions)&&!qi(V,i.tabbableOptions)&&!fe.nextTabbableNode(V,!1))&&(ue=re),ue>=0){var Z=ue===0?s.tabbableGroups.length-1:ue-1,oe=s.tabbableGroups[Z];ie=fi(V)>=0?oe.lastTabbableNode:oe.lastDomTabbableNode}else $o(X)||(ie=fe.nextTabbableNode(V,!1))}else{var ce=s.tabbableGroups.findIndex(function(_){var F=_.lastTabbableNode;return V===F});if(ce<0&&(fe.container===V||Yf(V,i.tabbableOptions)&&!qi(V,i.tabbableOptions)&&!fe.nextTabbableNode(V))&&(ce=re),ce>=0){var Ce=ce===s.tabbableGroups.length-1?0:ce+1,H=s.tabbableGroups[Ce];ie=fi(V)>=0?H.firstTabbableNode:H.firstDomTabbableNode}else $o(X)||(ie=fe.nextTabbableNode(V))}}else ie=l("fallbackFocus");return ie},y=function($){var V=ba($);if(!(u(V,$)>=0)){if(Do(i.clickOutsideDeactivates,$)){a.deactivate({returnFocus:i.returnFocusOnDeactivate});return}Do(i.allowOutsideClick,$)||$.preventDefault()}},g=function($){var V=ba($),X=u(V,$)>=0;if(X||V instanceof Document)X&&(s.mostRecentlyFocusedNode=V);else{$.stopImmediatePropagation();var ee,se=!0;if(s.mostRecentlyFocusedNode)if(fi(s.mostRecentlyFocusedNode)>0){var ie=u(s.mostRecentlyFocusedNode),re=s.containerGroups[ie].tabbableNodes;if(re.length>0){var fe=re.findIndex(function(ue){return ue===s.mostRecentlyFocusedNode});fe>=0&&(i.isKeyForward(s.recentNavEvent)?fe+1<re.length&&(ee=re[fe+1],se=!1):fe-1>=0&&(ee=re[fe-1],se=!1))}}else s.containerGroups.some(function(ue){return ue.tabbableNodes.some(function(Z){return fi(Z)>0})})||(se=!1);else se=!1;se&&(ee=T({target:s.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(s.recentNavEvent)})),w(ee||s.mostRecentlyFocusedNode||f())}s.recentNavEvent=void 0},h=function($){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=$;var X=T({event:$,isBackward:V});X&&($o($)&&$.preventDefault(),w(X))},b=function($){(i.isKeyForward($)||i.isKeyBackward($))&&h($,i.isKeyBackward($))},S=function($){$$($)&&Do(i.escapeDeactivates,$)!==!1&&($.preventDefault(),a.deactivate())},E=function($){var V=ba($);u(V,$)>=0||Do(i.clickOutsideDeactivates,$)||Do(i.allowOutsideClick,$)||($.preventDefault(),$.stopImmediatePropagation())},I=function(){if(s.active)return S0.activateTrap(o,a),s.delayInitialFocusTimer=i.delayInitialFocus?E0(function(){w(f())}):w(f()),r.addEventListener("focusin",g,!0),r.addEventListener("mousedown",y,{capture:!0,passive:!1}),r.addEventListener("touchstart",y,{capture:!0,passive:!1}),r.addEventListener("click",E,{capture:!0,passive:!1}),r.addEventListener("keydown",b,{capture:!0,passive:!1}),r.addEventListener("keydown",S),a},R=function(){if(s.active)return r.removeEventListener("focusin",g,!0),r.removeEventListener("mousedown",y,!0),r.removeEventListener("touchstart",y,!0),r.removeEventListener("click",E,!0),r.removeEventListener("keydown",b,!0),r.removeEventListener("keydown",S),a},A=function($){var V=$.some(function(X){var ee=Array.from(X.removedNodes);return ee.some(function(se){return se===s.mostRecentlyFocusedNode})});V&&w(f())},N=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(A):void 0,L=function(){N&&(N.disconnect(),s.active&&!s.paused&&s.containers.map(function($){N.observe($,{subtree:!0,childList:!0})}))};return a={get active(){return s.active},get paused(){return s.paused},activate:function($){if(s.active)return this;var V=c($,"onActivate"),X=c($,"onPostActivate"),ee=c($,"checkCanFocusTrap");ee||d(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=r.activeElement,V==null||V();var se=function(){ee&&d(),I(),L(),X==null||X()};return ee?(ee(s.containers.concat()).then(se,se),this):(se(),this)},deactivate:function($){if(!s.active)return this;var V=w0({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},$);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,R(),s.active=!1,s.paused=!1,L(),S0.deactivateTrap(o,a);var X=c(V,"onDeactivate"),ee=c(V,"onPostDeactivate"),se=c(V,"checkCanReturnFocus"),ie=c(V,"returnFocus","returnFocusOnDeactivate");X==null||X();var re=function(){E0(function(){ie&&w(v(s.nodeFocusedBeforeActivation)),ee==null||ee()})};return ie&&se?(se(v(s.nodeFocusedBeforeActivation)).then(re,re),this):(re(),this)},pause:function($){return s.active?(s.manuallyPaused=!0,this._setPausedState(!0,$)):this},unpause:function($){return s.active?(s.manuallyPaused=!1,o[o.length-1]!==this?this:this._setPausedState(!1,$)):this},updateContainerElements:function($){var V=[].concat($).filter(Boolean);return s.containers=V.map(function(X){return typeof X=="string"?r.querySelector(X):X}),s.active&&d(),L(),this}},Object.defineProperties(a,{_isManuallyPaused:{value:function(){return s.manuallyPaused}},_setPausedState:{value:function($,V){if(s.paused===$)return this;if(s.paused=$,$){var X=c(V,"onPause"),ee=c(V,"onPostPause");X==null||X(),R(),L(),ee==null||ee()}else{var se=c(V,"onUnpause"),ie=c(V,"onPostUnpause");se==null||se(),d(),I(),L(),ie==null||ie()}return this}}}),a.updateContainerElements(t),a};/*!
58
+ */function sd(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 q$(e){if(Array.isArray(e))return sd(e)}function V$(e,t,n){return(t=K$(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z$(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function W$(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
59
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function P0(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 F0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P0(Object(n),!0).forEach(function(r){V$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function H$(e){return q$(e)||z$(e)||Q$(e)||W$()}function G$(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 K$(e){var t=G$(e,"string");return typeof t=="symbol"?t:t+""}function Q$(e,t){if(e){if(typeof e=="string")return sd(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)?sd(e,t):void 0}}var O0={activateTrap:function(t,n){if(t.length>0){var r=t[t.length-1];r!==n&&r._setPausedState(!0)}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),t.length>0&&!t[t.length-1]._isManuallyPaused()&&t[t.length-1]._setPausedState(!1)}},X$=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},Y$=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},No=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},J$=function(t){return No(t)&&!t.shiftKey},Z$=function(t){return No(t)&&t.shiftKey},k0=function(t){return setTimeout(t,0)},$o=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},Ta=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},eD=[],tD=function(t,n){var r=(n==null?void 0:n.document)||document,o=(n==null?void 0:n.trapStack)||eD,i=F0({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:J$,isKeyBackward:Z$},n),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a,c=function(x,W,K){return x&&x[W]!==void 0?x[W]:i[K||W]},u=function(x,W){var K=typeof(W==null?void 0:W.composedPath)=="function"?W.composedPath():void 0;return s.containerGroups.findIndex(function(le){var be=le.container,te=le.tabbableNodes;return be.contains(x)||(K==null?void 0:K.includes(be))||te.find(function(ae){return ae===x})})},l=function(x){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K=W.hasFallback,le=K===void 0?!1:K,be=W.params,te=be===void 0?[]:be,ae=i[x];if(typeof ae=="function"&&(ae=ae.apply(void 0,H$(te))),ae===!0&&(ae=void 0),!ae){if(ae===void 0||ae===!1)return ae;throw new Error("`".concat(x,"` was specified but was not a node, or did not return a node"))}var ue=ae;if(typeof ae=="string"){try{ue=r.querySelector(ae)}catch(ie){throw new Error("`".concat(x,'` appears to be an invalid selector; error="').concat(ie.message,'"'))}if(!ue&&!le)throw new Error("`".concat(x,"` as selector refers to no known node"))}return ue},d=function(){var x=l("initialFocus",{hasFallback:!0});if(x===!1)return!1;if(x===void 0||x&&!od(x,i.tabbableOptions))if(u(r.activeElement)>=0)x=r.activeElement;else{var W=s.tabbableGroups[0],K=W&&W.firstTabbableNode;x=K||l("fallbackFocus")}else x===null&&(x=l("fallbackFocus"));if(!x)throw new Error("Your focus-trap needs to have at least one focusable element");return x},f=function(){if(s.containerGroups=s.containers.map(function(x){var W=B$(x,i.tabbableOptions),K=j$(x,i.tabbableOptions),le=W.length>0?W[0]:void 0,be=W.length>0?W[W.length-1]:void 0,te=K.find(function(ie){return qi(ie)}),ae=K.slice().reverse().find(function(ie){return qi(ie)}),ue=!!W.find(function(ie){return di(ie)>0});return{container:x,tabbableNodes:W,focusableNodes:K,posTabIndexesFound:ue,firstTabbableNode:le,lastTabbableNode:be,firstDomTabbableNode:te,lastDomTabbableNode:ae,nextTabbableNode:function(G){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,se=W.indexOf(G);return se<0?re?K.slice(K.indexOf(G)+1).find(function(Ie){return qi(Ie)}):K.slice(0,K.indexOf(G)).reverse().find(function(Ie){return qi(Ie)}):W[se+(re?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(x){return x.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!l("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(x){return x.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(x){var W=x.activeElement;if(W)return W.shadowRoot&&W.shadowRoot.activeElement!==null?m(W.shadowRoot):W},w=function(x){if(x!==!1&&x!==m(document)){if(!x||!x.focus){w(d());return}x.focus({preventScroll:!!i.preventScroll}),s.mostRecentlyFocusedNode=x,X$(x)&&x.select()}},y=function(x){var W=l("setReturnFocus",{params:[x]});return W||(W===!1?!1:x)},E=function(x){var W=x.target,K=x.event,le=x.isBackward,be=le===void 0?!1:le;W=W||Ta(K),f();var te=null;if(s.tabbableGroups.length>0){var ae=u(W,K),ue=ae>=0?s.containerGroups[ae]:void 0;if(ae<0)be?te=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:te=s.tabbableGroups[0].firstTabbableNode;else if(be){var ie=s.tabbableGroups.findIndex(function(F){var C=F.firstTabbableNode;return W===C});if(ie<0&&(ue.container===W||od(W,i.tabbableOptions)&&!qi(W,i.tabbableOptions)&&!ue.nextTabbableNode(W,!1))&&(ie=ae),ie>=0){var G=ie===0?s.tabbableGroups.length-1:ie-1,re=s.tabbableGroups[G];te=di(W)>=0?re.lastTabbableNode:re.lastDomTabbableNode}else No(K)||(te=ue.nextTabbableNode(W,!1))}else{var se=s.tabbableGroups.findIndex(function(F){var C=F.lastTabbableNode;return W===C});if(se<0&&(ue.container===W||od(W,i.tabbableOptions)&&!qi(W,i.tabbableOptions)&&!ue.nextTabbableNode(W))&&(se=ae),se>=0){var Ie=se===s.tabbableGroups.length-1?0:se+1,ee=s.tabbableGroups[Ie];te=di(W)>=0?ee.firstTabbableNode:ee.firstDomTabbableNode}else No(K)||(te=ue.nextTabbableNode(W))}}else te=l("fallbackFocus");return te},b=function(x){var W=Ta(x);if(!(u(W,x)>=0)){if($o(i.clickOutsideDeactivates,x)){a.deactivate({returnFocus:i.returnFocusOnDeactivate});return}$o(i.allowOutsideClick,x)||x.preventDefault()}},g=function(x){var W=Ta(x),K=u(W,x)>=0;if(K||W instanceof Document)K&&(s.mostRecentlyFocusedNode=W);else{x.stopImmediatePropagation();var le,be=!0;if(s.mostRecentlyFocusedNode)if(di(s.mostRecentlyFocusedNode)>0){var te=u(s.mostRecentlyFocusedNode),ae=s.containerGroups[te].tabbableNodes;if(ae.length>0){var ue=ae.findIndex(function(ie){return ie===s.mostRecentlyFocusedNode});ue>=0&&(i.isKeyForward(s.recentNavEvent)?ue+1<ae.length&&(le=ae[ue+1],be=!1):ue-1>=0&&(le=ae[ue-1],be=!1))}}else s.containerGroups.some(function(ie){return ie.tabbableNodes.some(function(G){return di(G)>0})})||(be=!1);else be=!1;be&&(le=E({target:s.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(s.recentNavEvent)})),w(le||s.mostRecentlyFocusedNode||d())}s.recentNavEvent=void 0},v=function(x){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=x;var K=E({event:x,isBackward:W});K&&(No(x)&&x.preventDefault(),w(K))},h=function(x){(i.isKeyForward(x)||i.isKeyBackward(x))&&v(x,i.isKeyBackward(x))},S=function(x){Y$(x)&&$o(i.escapeDeactivates,x)!==!1&&(x.preventDefault(),a.deactivate())},T=function(x){var W=Ta(x);u(W,x)>=0||$o(i.clickOutsideDeactivates,x)||$o(i.allowOutsideClick,x)||(x.preventDefault(),x.stopImmediatePropagation())},R=function(){if(s.active)return O0.activateTrap(o,a),s.delayInitialFocusTimer=i.delayInitialFocus?k0(function(){w(d())}):w(d()),r.addEventListener("focusin",g,!0),r.addEventListener("mousedown",b,{capture:!0,passive:!1}),r.addEventListener("touchstart",b,{capture:!0,passive:!1}),r.addEventListener("click",T,{capture:!0,passive:!1}),r.addEventListener("keydown",h,{capture:!0,passive:!1}),r.addEventListener("keydown",S),a},_=function(){if(s.active)return r.removeEventListener("focusin",g,!0),r.removeEventListener("mousedown",b,!0),r.removeEventListener("touchstart",b,!0),r.removeEventListener("click",T,!0),r.removeEventListener("keydown",h,!0),r.removeEventListener("keydown",S),a},A=function(x){var W=x.some(function(K){var le=Array.from(K.removedNodes);return le.some(function(be){return be===s.mostRecentlyFocusedNode})});W&&w(d())},$=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(A):void 0,D=function(){$&&($.disconnect(),s.active&&!s.paused&&s.containers.map(function(x){$.observe(x,{subtree:!0,childList:!0})}))};return a={get active(){return s.active},get paused(){return s.paused},activate:function(x){if(s.active)return this;var W=c(x,"onActivate"),K=c(x,"onPostActivate"),le=c(x,"checkCanFocusTrap");le||f(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=m(r),W==null||W();var be=function(){le&&f(),R(),D(),K==null||K()};return le?(le(s.containers.concat()).then(be,be),this):(be(),this)},deactivate:function(x){if(!s.active)return this;var W=F0({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},x);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,_(),s.active=!1,s.paused=!1,D(),O0.deactivateTrap(o,a);var K=c(W,"onDeactivate"),le=c(W,"onPostDeactivate"),be=c(W,"checkCanReturnFocus"),te=c(W,"returnFocus","returnFocusOnDeactivate");K==null||K();var ae=function(){k0(function(){te&&w(y(s.nodeFocusedBeforeActivation)),le==null||le()})};return te&&be?(be(y(s.nodeFocusedBeforeActivation)).then(ae,ae),this):(ae(),this)},pause:function(x){return s.active?(s.manuallyPaused=!0,this._setPausedState(!0,x)):this},unpause:function(x){return s.active?(s.manuallyPaused=!1,o[o.length-1]!==this?this:this._setPausedState(!1,x)):this},updateContainerElements:function(x){var W=[].concat(x).filter(Boolean);return s.containers=W.map(function(K){return typeof K=="string"?r.querySelector(K):K}),s.active&&f(),D(),this}},Object.defineProperties(a,{_isManuallyPaused:{value:function(){return s.manuallyPaused}},_setPausedState:{value:function(x,W){if(s.paused===x)return this;if(s.paused=x,x){var K=c(W,"onPause"),le=c(W,"onPostPause");K==null||K(),_(),D(),le==null||le()}else{var be=c(W,"onUnpause"),te=c(W,"onPostUnpause");be==null||be(),f(),R(),D(),te==null||te()}return this}}}),a.updateContainerElements(t),a};/*!
60
60
  * focus-trap-vue v4.0.2
61
61
  * (c) 2023 Eduardo San Martin Morote
62
62
  * @license MIT
63
- */function G2(e){return e}const j$={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};Object.assign({active:{type:Boolean,default:!0}},j$);var U$=Object.defineProperty,T0=Object.getOwnPropertySymbols,q$=Object.prototype.hasOwnProperty,V$=Object.prototype.propertyIsEnumerable,A0=(e,t,n)=>t in e?U$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,z$=(e,t)=>{for(var n in t||(t={}))q$.call(t,n)&&A0(e,n,t[n]);if(T0)for(var n of T0(t))V$.call(t,n)&&A0(e,n,t[n]);return e};const R0=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},W$={},H$={xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"},G$=pe("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),K$=[G$];function Q$(e,t){return J(),ge("svg",H$,K$)}const X$=R0(W$,[["render",Q$]]),Y$={},J$={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"10"},Z$=pe("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),eD=[Z$];function tD(e,t){return J(),ge("svg",J$,eD)}z$({},{Deselect:X$,OpenIndicator:R0(Y$,[["render",tD]])});const nD=["aria-label"],rD=$e({__name:"OcSpinner",props:{ariaLabel:{default:""},size:{default:"medium"}},setup(e){const t=j(()=>["oc-spinner",`oc-spinner-${Dr(e.size||"medium")}`]);return(n,r)=>(J(),ge("span",{class:W.normalizeClass(t.value),"aria-label":n.ariaLabel,tabindex:"-1",role:"img"},null,10,nD))}}),iD={class:"oc-status-indicators oc-flex"},oD=["id","textContent"],sD=$e({__name:"OcStatusIndicators",props:{resource:{},indicators:{},disableHandler:{type:Boolean,default:!1}},setup(e){const{$gettext:t}=Oe.useGettext(),n=le({}),r=i=>Object.hasOwn(i,"handler"),o=i=>i.accessibleDescription?(p(n)[i.id]||(p(n)[i.id]=xb("oc-indicator-description-")),p(n)[i.id]):null;return(i,s)=>{const a=cn("oc-tooltip");return J(),ge("div",iD,[(J(!0),ge(Ge,null,xt(i.indicators,(c,u)=>(J(),ge(Ge,null,[r(c)&&!i.disableHandler?it((J(),Ie(f0,{id:c.id,key:`${c.id}-handler`,class:W.normalizeClass(["oc-status-indicators-indicator",{"oc-ml-xs":u>0}]),"aria-label":p(t)(c.label),"aria-describedby":o(c),appearance:"raw","data-testid":c.id,"data-test-indicator-type":c.type,"no-hover":"",onClick:l=>c.handler(i.resource)},{default:Ee(()=>[me(u0,{name:c.icon,size:"small","fill-type":c.fillType},null,8,["name","fill-type"])]),_:2},1032,["id","class","aria-label","aria-describedby","data-testid","data-test-indicator-type","onClick"])),[[a,p(t)(c.label)]]):it((J(),Ie(u0,{id:c.id,key:c.id,tabindex:"-1",size:"small",class:W.normalizeClass(["oc-status-indicators-indicator",{"oc-ml-xs":u>0}]),name:c.icon,"fill-type":c.fillType,"accessible-label":p(t)(c.label),"aria-describedby":o(c),"data-testid":c.id,"data-test-indicator-type":c.type},null,8,["id","class","name","fill-type","accessible-label","aria-describedby","data-testid","data-test-indicator-type"])),[[a,p(t)(c.label)]]),o(c)?(J(),ge("p",{id:o(c),key:o(c),class:"oc-invisible-sr",textContent:W.toDisplayString(p(t)(c.accessibleDescription))},null,8,oD)):Pe("",!0)],64))),256))])}}}),aD={class:"oc-thead"},lD=$e({name:"OcTableHead",__name:"OcTableHead",setup(e){return(t,n)=>(J(),ge("thead",aD,[He(t.$slots,"default")]))}}),cD=$e({name:"OcTableBody",__name:"OcTableBody",setup(e){return(t,n)=>(J(),ge("tbody",null,[He(t.$slots,"default")]))}}),_0=({target:e,mode:t="show",rootMargin:n="100px",onVisibleCallback:r})=>{if(!(window&&"IntersectionObserver"in window))return{isVisible:le(!0)};const i=le(!1),s=new IntersectionObserver(a=>{const c=a.at(-1).isIntersecting;i.value=c,p(i)&&r&&r(),t!=="showHide"&&i.value&&s.unobserve(e.value)},{rootMargin:n});return Et(e,()=>{s.observe(e.value)}),Wn(()=>s.disconnect()),{isVisible:i}},I0=$e({__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,r=j(()=>{const o=["oc-table-cell",`oc-table-cell-align-${e.alignH}`,`oc-table-cell-align-${e.alignV}`,`oc-table-cell-width-${e.width}`];return e.wrap&&o.push(`oc-text-${e.wrap}`),o});return(o,i)=>(J(),Ie(kr(o.type),{class:W.normalizeClass(r.value),onClick:i[0]||(i[0]=s=>n("click",s))},{default:Ee(()=>[He(o.$slots,"default")]),_:3},8,["class"]))}}),C0=$e({__name:"OcTableTd",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},setup(e){return(t,n)=>(J(),Ie(I0,{type:"td","align-h":t.alignH,"align-v":t.alignV,width:t.width,wrap:t.wrap,class:"oc-td"},{default:Ee(()=>[He(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),P0=$e({__name:"OcTableTr",props:{lazy:{}},emits:["contextmenu","click","dragstart","drop","dragenter","dragleave","dragover","mouseleave","itemVisible"],setup(e,{emit:t}){const n=t,r=Cd((a,c)=>{let u;return{get(){return a(),u},set(l){u=l,c()}}}),o=j(()=>e.lazy?e.lazy.colspan:1),{isVisible:i}=e.lazy?_0({...e.lazy,target:r,onVisibleCallback:()=>n("itemVisible")}):{isVisible:le(!0)},s=j(()=>!p(i));return e.lazy||n("itemVisible"),(a,c)=>(J(),ge("tr",{ref_key:"observerTarget",ref:r,onClick:c[0]||(c[0]=u=>a.$emit("click",u)),onContextmenu:c[1]||(c[1]=u=>a.$emit("contextmenu",u)),onDragstart:c[2]||(c[2]=u=>a.$emit("dragstart",u)),onDrop:c[3]||(c[3]=u=>a.$emit("drop",u)),onDragenter:c[4]||(c[4]=u=>a.$emit("dragenter",u)),onDragleave:c[5]||(c[5]=u=>a.$emit("dragleave",u)),onDragover:c[6]||(c[6]=u=>a.$emit("dragover",u)),onMouseleave:c[7]||(c[7]=u=>a.$emit("mouseleave",u))},[s.value?(J(),Ie(C0,{key:0,colspan:o.value},{default:Ee(()=>c[8]||(c[8]=[pe("span",{class:"shimmer"},null,-1)])),_:1,__:[8]},8,["colspan"])):He(a.$slots,"default",{key:1})],544))}}),uD=$e({__name:"OcTableTh",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e){return(t,n)=>(J(),Ie(I0,{type:"th","align-h":t.alignH,"align-v":t.alignV,width:t.width,wrap:t.wrap,class:"oc-th",onClick:n[0]||(n[0]=r=>t.$emit("click",r))},{default:Ee(()=>[He(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),fD={key:0,class:"oc-table-thead-content"},dD=["textContent"],pD={key:1},hD={key:0,class:"oc-table-thead-content"},gD=["textContent"],mD={key:1,class:"oc-table-footer"},yD={class:"oc-table-footer-row"},bD=["colspan"],F0="asc",Zf="desc",vD=$e({__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:BP,EVENT_TROW_CLICKED:jP,EVENT_TROW_MOUNTED:UP,EVENT_TROW_CONTEXTMENU:qP},{$gettext:o}=Oe.useGettext(),i=L=>e.itemDomSelector?e.itemDomSelector(L):L[e.idKey],s=j(()=>{const L=["oc-table"];return e.hover&&L.push("oc-table-hover"),e.sticky&&L.push("oc-table-sticky"),L}),a=j(()=>e.fields.length),c=L=>{L.preventDefault()},u=(L,x)=>{n(VP,L,x)},l=(L,x)=>{n(Ob,L,x)},f=(L,x,$)=>{n("dropRowStyling",L,x,$)},d=L=>L.type==="slot",m=L=>["callback","function"].indexOf(L.type)>=0,w=L=>Object.prototype.hasOwnProperty.call(L,"title")?L.title:L.name,v=()=>({class:s.value}),T=(L,x)=>{const $=h(L);return $.class=`oc-table-header-cell oc-table-header-cell-${L.name}`,Object.prototype.hasOwnProperty.call(L,"thClass")&&($.class+=` ${L.thClass}`),e.sticky&&($.style=`top: ${e.headerPosition}px;`),x===0&&($.class+=` oc-pl-${Dr(e.paddingX)} `),x===e.fields.length-1&&($.class+=` oc-pr-${Dr(e.paddingX)}`),R($,L),$},y=(L,x)=>({...e.lazy&&{lazy:{colspan:a.value}},class:["oc-tbody-tr",`oc-tbody-tr-${i(L)||x}`,b(L)?"oc-table-highlighted":void 0,S(L)?"oc-table-disabled":void 0].filter(Boolean)}),g=(L,x,$)=>{const V=h(L);return V.class=`oc-table-data-cell oc-table-data-cell-${L.name}`,Object.prototype.hasOwnProperty.call(L,"tdClass")&&(V.class+=` ${L.tdClass}`),Object.prototype.hasOwnProperty.call(L,"wrap")&&(V.wrap=L.wrap),x===0&&(V.class+=` oc-pl-${Dr(e.paddingX)} `),x===e.fields.length-1&&(V.class+=` oc-pr-${Dr(e.paddingX)}`),Object.prototype.hasOwnProperty.call(L,"accessibleLabelCallback")&&(V["aria-label"]=L.accessibleLabelCallback($)),V},h=L=>({...(L==null?void 0:L.alignH)&&{alignH:L.alignH},...(L==null?void 0:L.alignV)&&{alignV:L.alignV},...(L==null?void 0:L.width)&&{width:L.width},class:void 0,wrap:void 0,style:void 0}),b=L=>e.highlighted?Array.isArray(e.highlighted)?e.highlighted.indexOf(L[e.idKey])>-1:e.highlighted===L[e.idKey]:!1,S=L=>e.disabled.length?e.disabled.indexOf(L[e.idKey])>-1:!1,E=(L,x,$)=>{const V=[$[e.idKey],x+1].filter(Boolean);return d(L)?[...V,L.name].join("-"):m(L)?[...V,L.callback($[L.name])].join("-"):[...V,$[L.name]].join("-")},I=L=>o("Sort by %{ name }",{name:L}),R=(L,x)=>{if(!A(x))return;let $="none";e.sortBy===x.name&&($=e.sortDir===F0?"ascending":"descending"),L["aria-sort"]=$},A=({sortable:L})=>!!L,N=L=>{if(!A(L))return;let x=e.sortDir;e.sortBy===L.name&&e.sortDir!==void 0&&(x=e.sortDir===Zf?F0:Zf),(e.sortBy!==L.name||e.sortDir===void 0)&&(x=L.sortDir||Zf),n("sort",{sortBy:L.name,sortDir:x})};return(L,x)=>{const $=ye("oc-icon");return J(),ge("table",Kt(v(),{class:"has-item-context-menu"}),[L.hasHeader?(J(),Ie(lD,{key:0},{default:Ee(()=>[me(P0,{class:"oc-table-header-row"},{default:Ee(()=>[(J(!0),ge(Ge,null,xt(L.fields,(V,X)=>(J(),Ie(uD,Kt({key:`oc-thead-${V.name}`,ref_for:!0},T(V,X)),{default:Ee(()=>[V.sortable?(J(),Ie(f0,{key:0,"aria-label":I(V.name),appearance:"raw",class:"oc-button-sort oc-width-1-1","gap-size":"small","no-hover":"",onClick:ee=>N(V)},{default:Ee(()=>[V.headerType==="slot"?(J(),ge("span",fD,[He(L.$slots,V.name+"Header")])):(J(),ge("span",{key:1,class:"oc-table-thead-content header-text",textContent:W.toDisplayString(w(V))},null,8,dD)),me($,{name:L.sortDir==="asc"?"arrow-down":"arrow-up","fill-type":"line",class:W.normalizeClass([{"oc-invisible-sr":L.sortBy!==V.name},"oc-p-xs oc-rounded"]),size:"small"},null,8,["name","class"])]),_:2},1032,["aria-label","onClick"])):(J(),ge("div",pD,[V.headerType==="slot"?(J(),ge("span",hD,[He(L.$slots,V.name+"Header")])):(J(),ge("span",{key:1,class:"oc-table-thead-content header-text",textContent:W.toDisplayString(w(V))},null,8,gD))]))]),_:2},1040))),128))]),_:3})]),_:3})):Pe("",!0),me(cD,{class:"has-item-context-menu"},{default:Ee(()=>[(J(!0),ge(Ge,null,xt(L.data,(V,X)=>(J(),Ie(P0,Kt({key:`oc-tbody-tr-${i(V)||X}`,ref_for:!0,ref:`row-${X}`},y(V,X),{"data-item-id":V[L.idKey],draggable:L.dragDrop,onClick:ee=>L.$emit(r.EVENT_TROW_CLICKED,[V,ee]),onContextmenu:ee=>L.$emit(r.EVENT_TROW_CONTEXTMENU,L.$refs[`row-${X}`][0],ee,V),onVnodeMounted:ee=>L.$emit(r.EVENT_TROW_MOUNTED,V,L.$refs[`row-${X}`][0]),onDragstart:ee=>u(V,ee),onDrop:ee=>l(i(V),ee),onDragenter:In(ee=>f(i(V),!1,ee),["prevent"]),onDragleave:In(ee=>f(i(V),!0,ee),["prevent"]),onMouseleave:ee=>f(i(V),!0,ee),onDragover:x[0]||(x[0]=ee=>c(ee)),onItemVisible:ee=>L.$emit("itemVisible",V)}),{default:Ee(()=>[(J(!0),ge(Ge,null,xt(L.fields,(ee,se)=>(J(),Ie(C0,Kt({key:"oc-tbody-td-"+E(ee,se,V),ref_for:!0},g(ee,se,V)),{default:Ee(()=>[d(ee)?He(L.$slots,ee.name,{key:0,item:V}):m(ee)?(J(),ge(Ge,{key:1},[Gt(W.toDisplayString(ee.callback(V[ee.name])),1)],64)):(J(),ge(Ge,{key:2},[Gt(W.toDisplayString(V[ee.name]),1)],64))]),_:2},1040))),128))]),_:2},1040,["data-item-id","draggable","onClick","onContextmenu","onVnodeMounted","onDragstart","onDrop","onDragenter","onDragleave","onMouseleave","onItemVisible"]))),128))]),_:3}),L.$slots.footer?(J(),ge("tfoot",mD,[pe("tr",yD,[pe("td",{colspan:a.value,class:"oc-table-footer-cell"},[He(L.$slots,"footer")],8,bD)])])):Pe("",!0)],16)}}}),O0=$e({__name:"ResourceStatusIndicators",props:{space:{},resource:{},filter:{type:Function}},setup(e){const t=Jd(),n=St(),r=Qe(),o=j(()=>{const i=_b({space:e.space,resource:e.resource,ancestorMetaData:r.ancestorMetaData,user:n.user});return e.filter?i.filter(e.filter):i});return(i,s)=>o.value.length>0?(J(),Ie(p(sD),Kt({key:0},p(t),{indicators:o.value}),null,16,["indicators"])):Pe("",!0)}}),wD=850,SD=$e({components:{ContextMenuQuickAction:Kf,ResourceGhostElement:Qf,ResourceListItem:xo,ResourceSize:l0,ResourceStatusIndicators:O0,OcSpinner:rD,OcTable:vD},props:{resources:{type:Array,required:!0},resourceDomSelector:{type:Function,required:!1,default:e=>te.extractDomSelector(e.id)},arePathsDisplayed:{type:Boolean,required:!1,default:!1},areThumbnailsDisplayed:{type:Boolean,required:!1,default:!0},selectedIds:{type:Array,default:()=>[]},hasActions:{type:Boolean,required:!1,default:!0},targetRouteCallback:{type:Function,required:!1,default:void 0},areResourcesClickable:{type:Boolean,required:!1,default:!0},headerPosition:{type:Number,required:!1,default:0},isSelectable:{type:Boolean,required:!1,default:!0},isSideBarOpen:{type:Boolean,required:!1,default:!1},paddingX:{type:String,required:!1,default:"small",validator:e=>/(xsmall|small|medium|large|xlarge)/.test(e)},dragDrop:{type:Boolean,required:!1,default:!1},viewMode:{type:String,default:()=>Zt.defaultModeName,validator:e=>[Zt.name.condensedTable,Zt.name.table].includes(e)},hover:{type:Boolean,required:!1,default:!0},sortBy:{type:String,required:!1,default:void 0},fieldsDisplayed:{type:Array,required:!1,default:null},sortDir:{type:String,required:!1,default:void 0,validator:e=>e===void 0||[Vt.Asc.toString(),Vt.Desc.toString()].includes(e)},space:{type:Object,required:!1,default:null},resourceType:{type:String,default:"file"},lazy:{type:Boolean,default:!0},groupingSettings:{type:Object,required:!1,default:null}},emits:["fileClick","sort","rowMounted",$f,"update:selectedIds","update:modelValue"],setup(e,t){const n=qe(),r=an(),{getMatchingSpace:o}=fn(),{canBeOpenedWithSecureView:i}=qf(),s=ci({space:le(e.space),targetRouteCallback:j(()=>e.targetRouteCallback)}),{isSticky:a}=Bf(),{$gettext:c}=Oe.useGettext(),{isLocationPicker:u,isFilePicker:l,postMessage:f,isEnabled:d,fileTypes:m}=oi(),{getDefaultAction:w}=Kn(),v=lt(),{options:T}=We.storeToRefs(v),y=Io(),{resources:g,action:h}=We.storeToRefs(y),b=Zr(),{userContextReady:S}=We.storeToRefs(b),E=Qe(),{areFileExtensionsShown:I,latestSelectedId:R,deleteQueue:A}=We.storeToRefs(E),N=le(),L=le(),x=le(),{width:$}=qr.useWindowSize(),V=j(()=>r.filesTags&&$.value>=wD),{actions:X}=la(),{actions:ee}=Uv(),se=j(()=>p(X)[0].handler),ie=j(()=>p(ee)[0].handler),re=_=>c("Search for tag %{tag}",{tag:_}),fe=_=>{var F;return p(d)&&((F=p(m))!=null&&F.length)?!p(m).includes(_.extension)&&!p(m).includes(_.mimeType)&&!_.isFolder:_.processing===!0||H(_.id)},ue=j(()=>{var _,F;return((F=(_=e.resources)==null?void 0:_.filter(G=>fe(G)===!0))==null?void 0:F.map(G=>G.id))||[]}),Z=_=>!e.areResourcesClickable||te.isProjectSpaceResource(_)&&_.disabled||!_.isFolder&&(!_.canDownload()&&!i(_)||p(d)&&!p(l))?!1:!p(ue).includes(_.id),oe=_=>{Ke.publish("app.files.list.clicked"),t.emit("update:selectedIds",_)},ce=_=>{E.toggleSelection(_),oe(E.selectedIds)},Ce=_=>{if(_.isFolder)return s.getFolderLink(_);let F=e.space;F||(F=o(_));const G=w({resources:[_],space:F});if(G!=null&&G.route)return G.route({space:F,resources:[_]})},H=_=>p(A).includes(_);return{router:n,configOptions:T,dragItem:N,ghostElement:L,contextMenuButton:x,getTagToolTip:re,renameActions:X,renameActionsSpace:ee,renameHandler:se,renameHandlerSpace:ie,FolderViewModeConstants:Zt,hasTags:V,disabledResources:ue,isResourceDisabled:fe,userContextReady:S,getMatchingSpace:o,clipboardResources:g,clipboardAction:h,...da({space:le(e.space),targetRouteCallback:j(()=>e.targetRouteCallback)},t),...s,postMessage:f,isFilePicker:l,isLocationPicker:u,isEmbedModeEnabled:d,emitSelect:oe,toggleSelection:ce,areFileExtensionsShown:I,latestSelectedId:R,isResourceClickable:Z,getResourceLink:Ce,isSticky:a,isResourceInDeleteQueue:H}},data(){return{constants:{ImageDimension:Qn,EVENT_TROW_MOUNTED:Av}}},computed:{fields(){if(this.resources.length===0)return[];const e=this.resources[0],t=[];this.isSelectable&&t.push({name:"select",title:"",type:"slot",headerType:"slot",width:"shrink"});const n=Eh(e);return t.push(...[{name:"name",title:this.$gettext("Name"),type:"slot",width:"expand",wrap:"truncate"},{name:"manager",prop:"members",title:this.$gettext("Manager"),type:"slot"},{name:"members",title:this.$gettext("Members"),prop:"members",type:"slot"},{name:"totalQuota",prop:"spaceQuota.total",title:this.$gettext("Total quota"),type:"slot",sortable:!0},{name:"usedQuota",prop:"spaceQuota.used",title:this.$gettext("Used quota"),type:"slot",sortable:!0},{name:"remainingQuota",prop:"spaceQuota.remaining",title:this.$gettext("Remaining quota"),type:"slot",sortable:!0},{name:"indicators",title:this.$gettext("Status"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"size",title:this.$gettext("Size"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"syncEnabled",title:this.$gettext("Info"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"status",prop:"disabled",title:this.$gettext("Status"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"tags",title:this.$gettext("Tags"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedBy",title:this.$gettext("Shared by"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedWith",title:this.$gettext("Shared with"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"mdate",title:this.$gettext("Modified"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:r=>this.formatDateRelative(r.mdate)+" ("+this.formatDate(r.mdate)+")"},{name:"sdate",title:this.$gettext("Shared on"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:r=>this.formatDateRelative(r.sdate)+" ("+this.formatDate(r.sdate)+")"},{name:"ddate",title:this.$gettext("Deleted"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:r=>this.formatDateRelative(r.ddate)+" ("+this.formatDate(r.ddate)+")"}].filter(r=>{if(r.name==="tags"&&!this.hasTags)return!1;if(r.name==="indicators")return!0;let o;return r.prop?o=Ol(e,r.prop)!==void 0:o=Object.prototype.hasOwnProperty.call(e,r.name),this.fieldsDisplayed?o&&this.fieldsDisplayed.includes(r.name):o}).map(r=>{const o=n.find(i=>i.name===r.name);return o&&Object.assign(r,{sortable:o.sortable,sortDir:o.sortDir}),r})),this.hasActions&&t.push({name:"actions",title:this.$gettext("Actions"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"}),t},areAllResourcesSelected(){const e=this.disabledResources.length===this.resources.length,t=this.selectedResources.length===this.resources.length-this.disabledResources.length;return!e&&t},selectAllCheckboxLabel(){return this.areAllResourcesSelected?this.$gettext("Clear selection"):this.$gettext("Select all")},selectedResources(){return this.resources.filter(e=>this.selectedIds.includes(e.id))},contextMenuLabel(){return this.$gettext("Show context menu")},dragSelection(){const e=[...this.selectedResources];return e.splice(e.findIndex(t=>t.id===this.dragItem.id),1),e}},methods:{isResourceSelected(e){return this.selectedIds.includes(e.id)},isResourceCut(e){return this.clipboardAction!==ri.Cut?!1:this.clipboardResources.some(t=>t.id===e.id)},getTagLink(e){var n;const t=(n=p(this.router.currentRoute).query)==null?void 0:n.term;return Ci("files-common-search",{query:{provider:"files.sdk",q_tags:e,...t&&{term:t}}})},getTagComponentAttrs(e){return this.userContextReady?{to:this.getTagLink(e)}:{}},isLatestSelectedItem(e){return e.id===this.latestSelectedId},hasRenameAction(e){return te.isProjectSpaceResource(e)?this.renameActionsSpace.filter(t=>t.isVisible({resources:[e]})).length:this.renameActions.filter(t=>t.isVisible({space:this.space,resources:[e]})).length},openRenameDialog(e){if(te.isProjectSpaceResource(e))return this.renameHandlerSpace({resources:[e]});this.renameHandler({space:this.getMatchingSpace(e),resources:[e]})},openTagsSidebar(){Ke.publish(vt.open)},openSharingSidebar(e){let t;e.type==="space"?t="space-share":t="sharing",Ke.publish(vt.openWithPanel,t)},async fileDragged(e,t){this.dragDrop&&(await this.setDragItem(e,t),this.addSelectedResource(e))},fileDropped(e,t){if(!this.dragDrop||(t.dataTransfer.types||[]).some(s=>s==="Files"))return;this.dragItem=null;const i=t.target.closest("tr").dataset.itemId;this.dropRowStyling(e,!0,t),this.$emit($f,i)},async setDragItem(e,t){this.dragItem=e,await this.$nextTick(),this.ghostElement.$el.ariaHidden="true",this.ghostElement.$el.style.left="-99999px",this.ghostElement.$el.style.top="-99999px",t.dataTransfer.setDragImage(this.ghostElement.$el,0,0),t.dataTransfer.dropEffect="move",t.dataTransfer.effectAllowed="move"},dropRowStyling(e,t,n){var s,a;if((((s=n.dataTransfer)==null?void 0:s.types)||[]).some(c=>c==="Files")||(a=n.currentTarget)!=null&&a.contains(n.relatedTarget))return;const o=document.getElementsByClassName(`oc-tbody-tr-${e}`)[0].classList,i="highlightedDropTarget";t?o.remove(i):o.add(i)},sort(e){this.$emit("sort",e)},addSelectedResource(e){this.isResourceSelected(e)||this.toggleSelection(e.id)},showContextMenuOnBtnClick(e,t){if(this.isResourceDisabled(t))return!1;const{dropdown:n,event:r}=e;(n==null?void 0:n.tippy)!==void 0&&(this.isResourceSelected(t)||this.emitSelect([t.id]),Ao(n.tippy,r,this.contextMenuButton))},showContextMenu(e,t,n){if(t.preventDefault(),this.isResourceDisabled(n))return!1;const r=e.$el.getElementsByClassName("resource-table-btn-action-dropdown")[0];r!==void 0&&(this.isResourceSelected(n)||this.emitSelect([n.id]),Ao(r._tippy,t,this.contextMenuButton))},rowMounted(e,t){this.$emit("rowMounted",e,t,this.constants.ImageDimension.Thumbnail)},fileClicked(e){var s,a;const t=e[0];if(this.isResourceDisabled(t))return;if(this.isEmbedModeEnabled&&this.isFilePicker&&!t.isFolder)return this.postMessage("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(t)),locationQuery:JSON.parse(JSON.stringify(ea(p(this.router.currentRoute))))});const n=e[1],r=e[2]??!1;!n.shiftKey&&!n.metaKey&&!n.ctrlKey&&Ke.publish("app.files.shiftAnchor.reset");const o=(n==null?void 0:n.target).getAttribute("type")==="checkbox";if(((a=(s=n==null?void 0:n.target)==null?void 0:s.closest("div"))==null?void 0:a.id)!=="oc-files-context-menu"){if(n&&n.metaKey)return Ke.publish("app.files.list.clicked.meta",t);if(n&&n.shiftKey)return Ke.publish("app.files.list.clicked.shift",{resource:t,skipTargetSelection:r});if(!o&&!this.isResourceSelected(t))return this.emitSelect([t.id])}},formatDate(e){return vb(new Date(e),this.$language.current)},formatDateRelative(e){return Sb(new Date(e),this.$language.current)},toggleSelectionAll(){if(this.areAllResourcesSelected)return this.emitSelect([]);this.emitSelect(this.resources.filter(e=>!this.disabledResources.includes(e.id)).map(e=>e.id))},emitFileClick(e){const t=this.getMatchingSpace(e);this.$emit("fileClick",{space:t,resources:[e]})},getResourceCheckboxLabel(e){return e.type==="folder"?this.$gettext("Select folder"):this.$gettext("Select file")},getSharedWithAvatarDescription(e){if(!te.isShareResource(e))return;const t=e.type==="folder"?this.$gettext("folder"):this.$gettext("file"),n=e.sharedWith.filter(({shareType:r})=>te.ShareTypes.authenticated.includes(te.ShareTypes.getByValue(r))).length;return n?this.$ngettext("This %{ resourceType } is shared via %{ shareCount } invite","This %{ resourceType } is shared via %{ shareCount } invites",n,{resourceType:t,shareCount:n.toString()}):""},getSharedByAvatarDescription(e){if(!te.isShareResource(e))return"";const t=e.type==="folder"?this.$gettext("folder"):this.$gettext("file");return this.$gettext("This %{ resourceType } is shared by %{ user }",{resourceType:t,user:e.sharedBy.map(({displayName:n})=>n).join(", ")})},getSharedByAvatarItems(e){return te.isShareResource(e)?e.sharedBy.map(t=>({displayName:t.displayName,name:t.displayName,shareType:te.ShareTypes.user.value,username:t.id})):[]},getSharedWithAvatarItems(e){return te.isShareResource(e)?e.sharedWith.filter(({shareType:t})=>te.ShareTypes.authenticated.includes(te.ShareTypes.getByValue(t))).map(t=>({displayName:t.displayName,name:t.displayName,shareType:t.shareType,username:t.id})):[]}}}),ED={class:"resource-table-select-all"},TD={class:"oc-text-truncate"},AD=["textContent"],RD=["textContent"],_D=["textContent"],ID={key:0,class:"resource-table-actions"};function CD(e,t,n,r,o,i){const s=ye("oc-checkbox"),a=ye("oc-spinner"),c=ye("resource-list-item"),u=ye("oc-icon"),l=ye("oc-button"),f=ye("resource-size"),d=ye("oc-tag"),m=ye("resource-status-indicators"),w=ye("oc-avatars"),v=ye("context-menu-quick-action"),T=ye("oc-table"),y=ye("resource-ghost-element"),g=cn("oc-tooltip");return J(),ge(Ge,null,[me(T,Kt(e.$attrs,{id:"files-space-table",class:[{condensed:e.viewMode===e.FolderViewModeConstants.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.fields,highlighted:e.selectedIds,disabled:e.disabledResources,sticky:e.isSticky,"header-position":e.headerPosition,"drag-drop":e.dragDrop,hover:e.hover,"item-dom-selector":e.resourceDomSelector,selection:e.selectedResources,"sort-by":e.sortBy,"sort-dir":e.sortDir,lazy:e.lazy,"grouping-settings":e.groupingSettings,"padding-x":"medium",onHighlight:e.fileClicked,onRowMounted:e.rowMounted,onContextmenuClicked:e.showContextMenu,onItemDropped:e.fileDropped,onItemDragged:e.fileDragged,onDropRowStyling:e.dropRowStyling,onSort:e.sort,"onUpdate:modelValue":t[0]||(t[0]=h=>e.$emit("update:modelValue",h))}),Xd({name:Ee(({item:h})=>[pe("div",{class:W.normalizeClass(["resource-table-resource-wrapper",[{"resource-table-resource-wrapper-limit-max-width":e.hasRenameAction(h)}]])},[He(e.$slots,"image",{resource:h}),(J(),Ie(c,{key:`${h.path}-${e.resourceDomSelector(h)}-${h.thumbnail}`,resource:h,"path-prefix":e.getPathPrefix(h),"is-path-displayed":e.arePathsDisplayed,"parent-folder-name":e.getParentFolderName(h),"is-icon-displayed":!e.$slots.image,"is-extension-displayed":e.areFileExtensionsShown,"is-resource-clickable":e.isResourceClickable(h),link:e.getResourceLink(h),"parent-folder-link":e.getParentFolderLink(h),"parent-folder-link-icon-additional-attributes":e.getParentFolderLinkIconAdditionalAttributes(h),class:W.normalizeClass({"resource-table-resource-cut":e.isResourceCut(h)}),onClick:b=>e.emitFileClick(h)},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"])),e.hasRenameAction(h)?(J(),Ie(l,{key:0,class:"resource-table-edit-name raw-hover-surface oc-p-xs",appearance:"raw",onClick:b=>e.openRenameDialog(h)},{default:Ee(()=>[me(u,{name:"edit-2","fill-type":"line",size:"small"})]),_:2},1032,["onClick"])):Pe("",!0)],2),He(e.$slots,"additionalResourceContent",{resource:h})]),syncEnabled:Ee(({item:h})=>[He(e.$slots,"syncEnabled",{resource:h})]),size:Ee(({item:h})=>[me(f,{size:h.size||Number.NaN},null,8,["size"])]),tags:Ee(({item:h})=>[(J(!0),ge(Ge,null,xt(h.tags.slice(0,2),b=>(J(),Ie(kr(e.userContextReady?"router-link":"span"),Kt({key:b,ref_for:!0},e.getTagComponentAttrs(b),{class:"resource-table-tag-wrapper"}),{default:Ee(()=>[it((J(),Ie(d,{class:"resource-table-tag oc-ml-xs",rounded:!0,size:"small"},{default:Ee(()=>[me(u,{name:"price-tag-3",size:"small"}),pe("span",TD,W.toDisplayString(b),1)]),_:2},1024)),[[g,e.getTagToolTip(b)]])]),_:2},1040))),128)),h.tags.length>2?(J(),Ie(d,{key:0,size:"small",class:"resource-table-tag-more",onClick:e.openTagsSidebar},{default:Ee(()=>[Gt(" + "+W.toDisplayString(h.tags.length-2),1)]),_:2},1032,["onClick"])):Pe("",!0)]),manager:Ee(({item:h})=>[He(e.$slots,"manager",{resource:h})]),members:Ee(({item:h})=>[He(e.$slots,"members",{resource:h})]),totalQuota:Ee(({item:h})=>[He(e.$slots,"totalQuota",{resource:h})]),usedQuota:Ee(({item:h})=>[He(e.$slots,"usedQuota",{resource:h})]),remainingQuota:Ee(({item:h})=>[He(e.$slots,"remainingQuota",{resource:h})]),mdate:Ee(({item:h})=>[it(pe("span",{tabindex:"0",textContent:W.toDisplayString(e.formatDateRelative(h.mdate))},null,8,AD),[[g,e.formatDate(h.mdate)]])]),indicators:Ee(({item:h})=>[me(m,{space:e.space,resource:h,"disable-handler":e.isResourceDisabled(h)},null,8,["space","resource","disable-handler"])]),status:Ee(({item:h})=>[it(me(u,{name:h.disabled?"stop-circle":"play-circle",size:"small","fill-type":"line"},null,8,["name"]),[[g,h.disabled?e.$gettext("Disabled"):e.$gettext("Enabled")]])]),sdate:Ee(({item:h})=>[it(pe("span",{tabindex:"0",textContent:W.toDisplayString(e.formatDateRelative(h.sdate))},null,8,RD),[[g,e.formatDate(h.sdate)]])]),ddate:Ee(({item:h})=>[it(pe("p",{tabindex:"0",class:"oc-m-rm",textContent:W.toDisplayString(e.formatDateRelative(h.ddate))},null,8,_D),[[g,e.formatDate(h.ddate)]])]),sharedBy:Ee(({item:h})=>[me(l,{appearance:"raw-inverse",class:"resource-table-shared-by","no-hover":"",onClick:b=>e.openSharingSidebar(h)},{default:Ee(()=>[me(w,{class:"resource-table-people",items:e.getSharedByAvatarItems(h),"is-tooltip-displayed":!0,"accessible-description":e.getSharedByAvatarDescription(h)},null,8,["items","accessible-description"])]),_:2},1032,["onClick"])]),sharedWith:Ee(({item:h})=>[me(l,{appearance:"raw-inverse",class:"resource-table-shared-with","no-hover":"",onClick:b=>e.openSharingSidebar(h)},{default:Ee(()=>[me(w,{class:"resource-table-people",items:e.getSharedWithAvatarItems(h),stacked:!0,"max-displayed":3,"is-tooltip-displayed":!0,"accessible-description":e.getSharedWithAvatarDescription(h)},null,8,["items","accessible-description"])]),_:2},1032,["onClick"])]),actions:Ee(({item:h})=>[e.isResourceDisabled(h)?Pe("",!0):(J(),ge("div",ID,[He(e.$slots,"quickActions",{resource:h}),me(v,{ref:"contextMenuButton",item:h,"resource-dom-selector":e.resourceDomSelector,class:"resource-table-btn-action-dropdown",onQuickActionClicked:b=>e.showContextMenuOnBtnClick(b,h)},{contextMenu:Ee(()=>[He(e.$slots,"contextMenu",{resource:h})]),_:2},1032,["item","resource-dom-selector","onQuickActionClicked"])]))]),_:2},[!e.isLocationPicker&&!e.isFilePicker?{name:"selectHeader",fn:Ee(()=>[pe("div",ED,[it(me(s,{id:"resource-table-select-all",size:"large",label:e.selectAllCheckboxLabel,disabled:e.resources.length===e.disabledResources.length,"label-hidden":!0,"model-value":e.areAllResourcesSelected,onClick:In(e.toggleSelectionAll,["stop"])},null,8,["label","disabled","model-value","onClick"]),[[g,{content:e.selectAllCheckboxLabel,placement:"bottom"}]])])]),key:"0"}:void 0,!e.isLocationPicker&&!e.isFilePicker?{name:"select",fn:Ee(({item:h})=>[e.isResourceInDeleteQueue(h.id)?(J(),Ie(a,{key:0,class:"resource-table-activity-indicator",size:"medium","aria-label":e.$gettext("File is being processed")},null,8,["aria-label"])):(J(),Ie(s,{key:1,id:`resource-table-select-${e.resourceDomSelector(h)}`,label:e.getResourceCheckboxLabel(h),"label-hidden":!0,size:"large",disabled:e.isResourceDisabled(h),"model-value":e.isResourceSelected(h),outline:e.isLatestSelectedItem(h),onClick:In(b=>e.toggleSelection(h.id),["stop"])},null,8,["id","label","disabled","model-value","outline","onClick"]))]),key:"1"}:void 0,e.$slots.footer?{name:"footer",fn:Ee(()=>[He(e.$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","grouping-settings","onHighlight","onRowMounted","onContextmenuClicked","onItemDropped","onItemDragged","onDropRowStyling","onSort"]),e.dragItem?(J(),Ie(Vd,{key:0,to:"body"},[me(y,{ref:"ghostElement","preview-items":[e.dragItem,...e.dragSelection]},null,8,["preview-items"])])):Pe("",!0)],64)}const PD=Ue(SD,[["render",CD]]),FD=["data-item-id"],OD={key:0,class:"oc-tile-card-lazy-shimmer"},kD={class:"oc-tile-card-selection"},xD={key:0,class:"oc-tile-card-loading-spinner oc-m-s"},ND=["textContent"],$D=["aria-label"],DD={class:"oc-card-body oc-p-s"},LD={class:"oc-flex oc-flex-between oc-flex-middle"},MD={class:"oc-flex oc-flex-middle oc-text-truncate resource-name-wrapper"},BD={class:"oc-flex oc-flex-middle"},jD={key:0,class:"oc-text-left oc-my-rm oc-text-truncate"},UD=["textContent"],k0=$e({__name:"ResourceTile",props:{resource:{},resourceRoute:{},isResourceSelected:{type:Boolean,default:!1},isResourceClickable:{type:Boolean,default:!0},isResourceDisabled:{type:Boolean,default:!1},isExtensionDisplayed:{type:Boolean,default:!0},resourceIconSize:{default:"xlarge"},lazy:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1}},emits:["click","contextmenu","itemVisible"],setup(e,{emit:t}){const n=t,{$gettext:r}=Oe.useGettext(),o=Cd((f,d)=>{let m;return{get(){return f(),m},set(w){m=w,d()}}}),i=j(()=>e.resource.locked||e.resource.processing),s=j(()=>e.resource.locked?{name:"lock",fillType:"fill"}:e.resource.processing?{name:"loop-right",fillType:"line"}:{}),a=j(()=>e.resource.locked?r("This item is locked"):null),c=j(()=>te.isSpaceResource(e.resource)?e.resource.description:""),{isVisible:u}=e.lazy?_0({target:o,onVisibleCallback:()=>n("itemVisible")}):{isVisible:le(!0)},l=j(()=>!p(u));return e.lazy||n("itemVisible"),(f,d)=>{const m=ye("oc-spinner"),w=ye("oc-tag"),v=ye("oc-image"),T=ye("oc-icon"),y=cn("oc-tooltip");return J(),ge("div",{ref_key:"observerTarget",ref:o,class:W.normalizeClass(["oc-tile-card oc-card oc-card-default",{"oc-tile-card-selected":f.isResourceSelected,"oc-tile-card-disabled":f.isResourceDisabled&&!p(te.isProjectSpaceResource)(f.resource),"state-trashed":f.isResourceDisabled&&p(te.isProjectSpaceResource)(f.resource)}]),"data-item-id":f.resource.id,onContextmenu:d[2]||(d[2]=g=>f.$emit("contextmenu",g))},[l.value?(J(),ge("div",OD)):(J(),ge(Ge,{key:1},[me(Df,{class:"oc-card-media-top oc-flex oc-flex-center oc-flex-middle oc-m-rm",resource:f.resource,link:f.resourceRoute,"is-resource-clickable":f.isResourceClickable,tabindex:"-1",onClick:d[0]||(d[0]=g=>f.$emit("click"))},{default:Ee(()=>[pe("div",kD,[f.isLoading?(J(),ge("div",xD,[me(m,{"aria-label":p(r)("File is being processed")},null,8,["aria-label"])])):He(f.$slots,"selection",{key:1,item:f.resource})]),f.isResourceDisabled&&p(te.isProjectSpaceResource)(f.resource)?(J(),Ie(w,{key:0,class:"resource-disabled-indicator oc-position-absolute",type:"span"},{default:Ee(()=>[pe("span",{textContent:W.toDisplayString(p(r)("Disabled"))},null,8,ND)]),_:1})):Pe("",!0),it((J(),ge("div",{class:"oc-tile-card-preview oc-flex oc-flex-middle oc-flex-center","aria-label":a.value},[He(f.$slots,"imageField",{item:f.resource},()=>[f.resource.thumbnail?(J(),Ie(v,{key:0,class:"tile-preview",src:f.resource.thumbnail},null,8,["src"])):(J(),Ie(ko,{key:1,resource:f.resource,size:f.resourceIconSize,class:"tile-default-image oc-pt-xs"},Xd({_:2},[i.value?{name:"status",fn:Ee(()=>[me(T,Kt(s.value,{size:"xsmall"}),null,16)]),key:"0"}:void 0]),1032,["resource","size"]))])],8,$D)),[[y,a.value]])]),_:3},8,["resource","link","is-resource-clickable"]),pe("div",DD,[pe("div",LD,[pe("div",MD,[me(xo,{resource:f.resource,"is-icon-displayed":!1,"is-extension-displayed":f.isExtensionDisplayed,"is-resource-clickable":f.isResourceClickable,link:f.resourceRoute,onClick:d[1]||(d[1]=g=>f.$emit("click"))},null,8,["resource","is-extension-displayed","is-resource-clickable","link"])]),pe("div",BD,[He(f.$slots,"indicators",{item:f.resource,class:"resource-indicators"}),He(f.$slots,"actions",{item:f.resource}),He(f.$slots,"contextMenu",{item:f.resource})])]),c.value?(J(),ge("p",jD,[pe("small",{textContent:W.toDisplayString(c.value)},null,8,UD)])):Pe("",!0)])],64))],42,FD)}}}),qD={id:"tiles-view",class:"oc-px-m oc-pt-l"},VD={class:"oc-flex oc-flex-middle oc-mb-s oc-pb-s oc-tiles-controls"},zD={key:0,class:"oc-tiles-sort"},WD={key:0,class:"oc-flex"},HD={class:"oc-tiles-footer"},GD=$e({__name:"ResourceTiles",props:{resources:{default:()=>[]},selectedIds:{default:()=>[]},targetRouteCallback:{type:Function},space:{},sortFields:{default:()=>[]},sortBy:{},sortDir:{},viewSize:{default:()=>Zt.tilesSizeDefault},dragDrop:{type:Boolean,default:!1},lazy:{type:Boolean,default:!0}},emits:["fileDropped","rowMounted","sort","itemVisible","update:selectedIds"],setup(e,{emit:t}){const n=t,{$gettext:r}=Oe.useGettext(),o=qe(),i=Qe(),{getDefaultAction:s}=Kn(),{getMatchingSpace:a}=fn(),{canBeOpenedWithSecureView:c}=qf(),{isEnabled:u,fileTypes:l,isLocationPicker:f,isFilePicker:d,postMessage:m}=oi(),w=Vf(),v=j(()=>Math.min(p(w),e.viewSize)),T=j(()=>i.areFileExtensionsShown),y=j(()=>p(_e)?r("Clear selection"):r("Select all")),g=le(),h=le(),b=le({tiles:{},dropBtns:{}}),S=da({space:le(e.space),targetRouteCallback:j(()=>e.targetRouteCallback)},{emit:n}),E=Y=>{if(te.isSpaceResource(Y))return Y.disabled?null:Nn("files-spaces-generic",rr(Y,{path:"",fileId:Y.fileId}));if(Y.isFolder)return S.createFolderLink({path:Y.path,fileId:Y.fileId,resource:Y});let xe=e.space;xe||(xe=a(Y));const Me=s({resources:[Y],space:xe});return Me!=null&&Me.route?Me.route({space:xe,resources:[Y]}):null},I=Y=>{if(p(u)&&p(d))return m("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(Y)),locationQuery:JSON.parse(JSON.stringify(ea(p(o.currentRoute))))});Y.type!=="space"&&Y.type!=="folder"&&S.createFileAction(Y)},R=(Y,xe,Me)=>{const{dropdown:Ve,event:Ze}=Y;(Ve==null?void 0:Ve.tippy)!==void 0&&(i.setSelection([xe.id]),Ao(Ve.tippy,Ze,p(b).dropBtns[Me]))},A=Y=>e.selectedIds.includes(Y.id),N=j(()=>e.resources.filter(Y=>e.selectedIds.includes(Y.id))),L=Y=>x(Y)||$(Y)?!1:Y.isFolder?!0:!(!Y.canDownload()&&!c(Y)||p(u)&&!p(d)),x=Y=>{var xe;return p(u)&&((xe=p(l))!=null&&xe.length)?!p(l).includes(Y.extension)&&!p(l).includes(Y.mimeType)&&!Y.isFolder:Le(Y.id)?!0:Y.processing===!0},$=Y=>x(Y)?!0:te.isSpaceResource(Y)&&Y.disabled,V=j(()=>{var Y,xe;return((xe=(Y=e.resources)==null?void 0:Y.filter(Me=>x(Me)===!0))==null?void 0:xe.map(Me=>Me.id))||[]}),X=Y=>{n("update:selectedIds",Y)},ee=()=>{if(p(_e))return n("update:selectedIds",[]);n("update:selectedIds",e.resources.filter(Y=>!p(V).includes(Y.id)).map(Y=>Y.id))},se=(Y,xe,Me)=>{var Ze;Y.preventDefault();const Ve=(Ze=p(b).tiles[xe.id])==null?void 0:Ze.$el.getElementsByClassName("resource-tiles-btn-action-dropdown")[0];Ve!==void 0&&(A(xe)||X([xe.id]),Ao(Ve._tippy,Y,Me))},ie=Y=>{const xe=Y[0],Me=Y[1];if(Me&&Me.metaKey)return Ke.publish("app.files.list.clicked.meta",xe);if(!Me.shiftKey&&!Me.metaKey&&!Me.ctrlKey&&Ke.publish("app.files.shiftAnchor.reset"),Me&&Me.shiftKey)return Ke.publish("app.files.list.clicked.shift",{resource:xe,skipTargetSelection:!1});re(xe)},re=Y=>{const xe=A(Y)?e.selectedIds.filter(Me=>Me!==Y.id):[...e.selectedIds,Y.id];n("update:selectedIds",xe)},fe=Y=>{switch(Y.type){case"folder":return r("Select folder");case"space":return r("Select space");default:return r("Select file")}},ue=j(()=>e.sortFields.find(Y=>Y.name===e.sortBy&&Y.sortDir===e.sortDir)||e.sortFields[0]),Z=Y=>{n("sort",{sortBy:Y.name,sortDir:Y.sortDir})},oe=j(()=>{const Y={1:"xlarge",2:"xlarge",3:"xxlarge",4:"xxlarge",5:"xxxlarge",6:"xxxlarge"},xe=p(v);return Y[xe]??"xxlarge"});aS(()=>{b.value={tiles:{},dropBtns:{}}});const ce=(Y,xe,Me)=>{var kt,Rt;if((((kt=Me.dataTransfer)==null?void 0:kt.types)||[]).some(Nt=>Nt==="Files")||(Rt=Me.currentTarget)!=null&&Rt.contains(Me.relatedTarget)||e.selectedIds.includes(Y.id)||Y.type!=="folder")return;const Ze=p(b).tiles[Y.id];if(xe){Ze.$el.classList.remove("oc-tiles-item-drop-highlight");return}Ze.$el.classList.add("oc-tiles-item-drop-highlight")},Ce=j(()=>e.selectedIds.filter(Y=>Y!==p(g).id)),H=async(Y,xe)=>{g.value=Y,await zn(),p(h).$el.ariaHidden="true",p(h).$el.style.left="-99999px",p(h).$el.style.top="-99999px",xe.dataTransfer.setDragImage(p(h).$el,0,0),xe.dataTransfer.dropEffect="move",xe.dataTransfer.effectAllowed="move"},_=async(Y,xe)=>{A(Y)||re(Y),await H(Y,xe)},F=(Y,xe)=>{(xe.dataTransfer.types||[]).some(Ve=>Ve==="Files")||(g.value=null,ce(Y,!0,xe),n("fileDropped",Y.id))},G=le(0),z=()=>{const Y=document.getElementById("tiles-view"),xe=getComputedStyle(Y),Me=parseInt(xe.getPropertyValue("padding-left"),10)|0,Ve=parseInt(xe.getPropertyValue("padding-right"),10)|0;G.value=Y.clientWidth-Me-Ve},M=j(()=>parseFloat(getComputedStyle(document.documentElement).fontSize)),{calculateTileSizePixels:q}=Qv(),de=j(()=>{const Y=[...Array(Zt.tilesSizeMax).keys()].map(xe=>xe+1);return[...new Set(Y.map(xe=>{const Me=q(xe);return Me?Math.round(p(G)/(Me+p(M))):0}))]}),Ae=j(()=>{const Y=p(de);return Y.length<p(v)?Y[Y.length-1]:Y[p(v)-1]}),De=j(()=>{const Y=p(Ae)?e.resources.length%p(Ae):0;return Y?p(Ae)-Y:0}),ke=j(()=>p(G)/p(Ae)-p(M)),_e=j(()=>{const Y=p(V).length===e.resources.length,xe=p(N).length===e.resources.length-p(V).length;return!Y&&xe}),Le=Y=>i.deleteQueue.includes(Y);return Et(ke,Y=>{document.documentElement.style.setProperty("--oc-size-tiles-actual",`${Y}px`)},{immediate:!0}),Et(de,Y=>{w.value=Math.max(Y.length,1)}),qt(()=>{window.addEventListener("resize",z),z()}),Wn(()=>{window.removeEventListener("resize",z)}),(Y,xe)=>{const Me=ye("oc-checkbox"),Ve=ye("oc-icon"),Ze=ye("oc-button"),kt=ye("oc-filter-chip"),Rt=ye("oc-list"),Nt=cn("oc-tooltip");return J(),ge("div",qD,[pe("div",VD,[it(me(Me,{id:"tiles-view-select-all",class:"oc-ml-s",size:"large",label:y.value,"label-hidden":!0,disabled:Y.resources.length===V.value.length,"model-value":_e.value,onClick:In(ee,["stop"])},null,8,["label","disabled","model-value"]),[[Nt,y.value]]),Y.sortFields.length?(J(),ge("div",zD,[me(kt,{class:"oc-tiles-sort-filter-chip","filter-label":ue.value.label,"selected-item-names":[],"close-on-click":"",raw:""},{default:Ee(()=>[(J(!0),ge(Ge,null,xt(Y.sortFields,(Be,ze)=>(J(),Ie(Ze,{key:ze,appearance:"raw",size:"medium","justify-content":"space-between",class:W.normalizeClass(["oc-tiles-sort-filter-chip-item oc-flex oc-flex-middle oc-width-1-1 oc-p-s",{"oc-tiles-sort-filter-chip-item-active":ue.value===Be,"oc-mt-xs":ze>0}]),onClick:pn=>Z(Be)},{default:Ee(()=>[pe("span",null,W.toDisplayString(Be.label),1),Be===ue.value?(J(),ge("div",WD,[me(Ve,{name:"check"})])):Pe("",!0)]),_:2},1032,["class","onClick"]))),128))]),_:1},8,["filter-label"])])):Pe("",!0)]),me(Rt,{class:"oc-tiles"},{default:Ee(()=>[(J(!0),ge(Ge,null,xt(Y.resources,Be=>(J(),ge("li",{key:Be.id,class:"oc-tiles-item has-item-context-menu"},[me(k0,{ref_for:!0,ref:ze=>b.value.tiles[Be.id]=ze,resource:Be,"resource-route":E(Be),"is-resource-selected":A(Be),"is-resource-clickable":L(Be),"is-resource-disabled":x(Be)||$(Be),"is-extension-displayed":T.value,"resource-icon-size":oe.value,draggable:Y.dragDrop,lazy:Y.lazy,"is-loading":Le(Be.id),onVnodeMounted:ze=>Y.$emit("rowMounted",Be,b.value.tiles[Be.id],p(Qn).Tile),onContextmenu:ze=>se(ze,Be,b.value.tiles[Be.id]),onClick:ze=>I(Be),onDragstart:ze=>_(Be,ze),onDragenter:In(ze=>ce(Be,!1,ze),["prevent"]),onDragleave:In(ze=>ce(Be,!0,ze),["prevent"]),onDrop:ze=>F(Be,ze),onDragover:xe[0]||(xe[0]=ze=>ze.preventDefault()),onItemVisible:ze=>Y.$emit("itemVisible",Be)},{selection:Ee(()=>[!p(f)&&!p(d)?(J(),Ie(Me,{key:0,label:fe(Be),"label-hidden":!0,size:"large",class:"oc-flex-inline oc-p-s",disabled:x(Be),"model-value":A(Be),onClick:In(ze=>ie([Be,ze]),["stop","prevent"])},null,8,["label","disabled","model-value","onClick"])):Pe("",!0)]),imageField:Ee(()=>[He(Y.$slots,"image",{resource:Be})]),indicators:Ee(()=>[me(O0,{space:Y.space,resource:Be,filter:ze=>ze.category==="system","disable-handler":x(Be)},null,8,["space","resource","filter","disable-handler"])]),actions:Ee(()=>[He(Y.$slots,"actions",{resource:Be})]),contextMenu:Ee(()=>[p(te.isSpaceResource)(Be)||!x(Be)?(J(),Ie(p(Kf),{key:0,ref_for:!0,ref:ze=>b.value.dropBtns[Be.id]=ze,item:Be,class:"resource-tiles-btn-action-dropdown",onQuickActionClicked:ze=>R(ze,Be,Be.id)},{contextMenu:Ee(()=>[He(Y.$slots,"contextMenu",{resource:Be})]),_:2},1032,["item","onQuickActionClicked"])):Pe("",!0)]),_:2},1032,["resource","resource-route","is-resource-selected","is-resource-clickable","is-resource-disabled","is-extension-displayed","resource-icon-size","draggable","lazy","is-loading","onVnodeMounted","onContextmenu","onClick","onDragstart","onDragenter","onDragleave","onDrop","onItemVisible"])]))),128)),(J(!0),ge(Ge,null,xt(De.value,Be=>(J(),ge("li",{key:`ghost-tile-${Be}`,class:"ghost-tile","aria-hidden":!0}))),128))]),_:3}),g.value?(J(),Ie(Vd,{key:0,to:"body"},[me(Qf,{ref_key:"ghostElementRef",ref:h,"preview-items":[g.value,...Ce.value]},null,8,["preview-items"])])):Pe("",!0),pe("div",HD,[He(Y.$slots,"footer")])])}}}),KD=$e({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=qe(),{current:o}=Oe.useGettext(),i=Qt(),s=le(),a=le(e.items),c=le(),u=le(),l=le(!1),f=le(),d=`q_${e.filterName}`,m=ln(d),w=x=>x[e.idAttribute],v=()=>r.push({query:{...Mi(p(i).query,[d]),...p(s)&&{[d]:w(p(s))}}}),T=x=>p(s)&&w(p(s))===w(x),y=()=>{c.value=void 0,u.value=void 0},g=async x=>{y(),T(x)?s.value=void 0:(s.value=x,p(f).hideDrop()),await v(),t("selectionChange",p(s))},h=()=>{s.value=void 0,l.value=!1,y(),t("selectionChange",p(s)),v()},b=()=>{a.value=e.items},S=()=>{l.value=!1},E=()=>{const x=At(p(m));if(!x)return;const $=e.items.find(V=>w(V)===x);if($){s.value=$;return}if(p(I)){const V=x.replace("range:",""),X=Number(V.split(" - ")[0]),ee=Number(V.split(" - ")[1]);c.value=jt.DateTime.fromMillis(X),u.value=jt.DateTime.fromMillis(ee),s.value=p(A)}},I=j(()=>{var x;return(x=At(p(m)))==null?void 0:x.startsWith("range:")}),R=j(()=>!p(c)||!p(u)?!1:p(c)<=p(u)),A=j(()=>{if(!p(c)||!p(u))return null;const x=ii(p(c),o,jt.DateTime.DATE_SHORT),$=ii(p(u),o,jt.DateTime.DATE_SHORT),V=p(c).toMillis(),X=p(u).toMillis();return{[e.idAttribute]:`range:${V} - ${X}`,[e.displayNameAttribute]:`${x} - ${$}`}}),N=async()=>{s.value=p(A),await v(),p(f).hideDrop(),t("selectionChange",p(s))},L=({date:x,error:$},V)=>{if($){console.error("date could not be set");return}const X=V==="from"?c:u;if(!x){X.value=void 0;return}const ee=V==="from"?x.startOf("day"):x.endOf("day");X.value=ee};return n({setSelectedItemsBasedOnQuery:E}),qt(()=>{E()}),{clearFilter:h,displayedItems:a,isItemSelected:T,selectedItem:s,onShowDrop:b,onHideDrop:S,filterChip:f,toggleItemSelection:g,setSelectedItemsBasedOnQuery:E,fromDate:c,toDate:u,dateRangeValid:R,applyDateRangeFilter:N,dateRangeApplied:I,setDateRangeDate:L,dateRangeClicked:l,queryParam:d}}}),QD={class:"oc-flex oc-flex-middle oc-text-truncate"},XD={class:"oc-text-truncate oc-ml-s"},YD={class:"oc-flex"},JD={class:"oc-my-xs"},ZD={class:"oc-flex oc-flex-middle oc-text-truncate"},eL={class:"oc-text-truncate oc-ml-s"},tL=["textContent"],nL={class:"oc-flex"},rL={class:"oc-flex oc-flex-middle oc-flex-between oc-mb-m"},iL=["textContent"],oL={class:"oc-mt-s"},sL={class:"date-filter-apply-btn"};function aL(e,t,n,r,o,i){const s=ye("oc-icon"),a=ye("oc-button"),c=ye("oc-list"),u=ye("oc-datepicker"),l=ye("oc-filter-chip");return J(),ge("div",{class:W.normalizeClass(["date-filter oc-flex",`date-filter-${e.filterName}`])},[me(l,{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:Ee(()=>[me(c,{class:W.normalizeClass(["date-filter-list",{"date-filter-list-hidden":e.dateRangeClicked}])},{default:Ee(()=>[(J(!0),ge(Ge,null,xt(e.displayedItems,(f,d)=>(J(),ge("li",{key:d,class:"oc-my-xs"},[me(a,{class:W.normalizeClass(["date-filter-list-item oc-flex oc-flex-between oc-flex-middle oc-width-1-1 oc-p-xs",{"date-filter-list-item-active":e.isItemSelected(f)}]),"justify-content":"space-between",appearance:"raw","data-testid":f[e.displayNameAttribute],onClick:m=>e.toggleItemSelection(f)},{default:Ee(()=>[pe("div",QD,[pe("div",XD,[He(e.$slots,"item",{item:f})])]),pe("div",YD,[e.isItemSelected(f)?(J(),Ie(s,{key:0,name:"check"})):Pe("",!0)])]),_:2},1032,["class","data-testid","onClick"])]))),128)),pe("li",JD,[me(a,{class:W.normalizeClass(["date-filter-list-item oc-flex oc-flex-between oc-flex-middle oc-width-1-1 oc-p-xs",{"date-filter-list-item-active":e.dateRangeApplied}]),"justify-content":"space-between",appearance:"raw","data-testid":"custom-date-range",onClick:t[0]||(t[0]=f=>e.dateRangeClicked=!0)},{default:Ee(()=>[pe("div",ZD,[pe("div",eL,[pe("span",{textContent:W.toDisplayString(e.$gettext("Custom date range"))},null,8,tL)])]),pe("div",nL,[e.dateRangeApplied?(J(),Ie(s,{key:0,name:"check"})):Pe("",!0)])]),_:1},8,["class"])])]),_:3},8,["class"]),pe("div",{class:W.normalizeClass(["date-filter-range-panel oc-py-s",{"date-filter-range-panel-active":e.dateRangeClicked}])},[pe("div",rL,[me(a,{appearance:"raw",class:"date-filter-range-panel-back","aria-label":e.$gettext("Go back to filter options"),onClick:t[1]||(t[1]=f=>e.dateRangeClicked=!1)},{default:Ee(()=>[me(s,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"]),pe("span",{textContent:W.toDisplayString(e.$gettext("Custom date range"))},null,8,iL),me(a,{appearance:"raw",class:"date-filter-range-panel-close","aria-label":e.$gettext("Close filter"),onClick:t[2]||(t[2]=f=>e.filterChip.hideDrop())},{default:Ee(()=>[me(s,{name:"close"})]),_:1},8,["aria-label"])]),pe("div",oL,[me(u,{label:e.$gettext("From"),"is-clearable":!0,"current-date":e.fromDate,onDateChanged:t[3]||(t[3]=f=>e.setDateRangeDate(f,"from"))},null,8,["label","current-date"]),me(u,{label:e.$gettext("To"),"is-clearable":!0,"current-date":e.toDate,"min-date":e.fromDate?e.fromDate:void 0,onDateChanged:t[4]||(t[4]=f=>e.setDateRangeDate(f,"to"))},null,8,["label","current-date","min-date"])]),pe("div",sL,[me(a,{size:"small",disabled:!e.dateRangeValid,onClick:e.applyDateRangeFilter},{default:Ee(()=>[Gt(W.toDisplayString(e.$gettext("Apply")),1)]),_:1},8,["disabled","onClick"])])],2)]),_:3},8,["filter-label","selected-item-names","onClearFilter","onShowDrop","onHideDrop"])],2)}const lL=Ue(KD,[["render",aL]]),cL=$e({name:"ItemFilterInline",props:{filterName:{type:String,required:!0},filterOptions:{type:Array,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=qe(),r=Qt(),o=le(e.filterOptions[0].name),i=`q_${e.filterName}`,s=ln(i),a=u=>n.push({query:{...Mi(p(r).query,[i]),[i]:u}}),c=async u=>{o.value=u.name,await a(u.name),t("toggleFilter",u)};return qt(()=>{const u=At(p(s));u&&e.filterOptions.some(({name:l})=>l===u)&&(o.value=u,t("toggleFilter",e.filterOptions.find(({name:l})=>l===u)))}),{queryParam:i,activeOption:o,toggleFilter:c}}}),uL=["textContent"];function fL(e,t,n,r,o,i){const s=ye("oc-button");return J(),ge("div",null,[pe("div",{class:W.normalizeClass(["item-inline-filter oc-flex-inline",`item-inline-filter-${e.filterName}`])},[(J(!0),ge(Ge,null,xt(e.filterOptions,(a,c)=>(J(),Ie(s,{id:a.name,key:c,class:W.normalizeClass(["item-inline-filter-option",{"item-inline-filter-option-selected":e.activeOption===a.name}]),appearance:"raw-inverse","color-role":"surface",onClick:u=>e.toggleFilter(a)},{default:Ee(()=>[pe("span",{class:"oc-text-truncate item-inline-filter-option-label",textContent:W.toDisplayString(a.label)},null,8,uL)]),_:2},1032,["id","class","onClick"]))),128))],2)])}const dL=Ue(cL,[["render",fL]]),pL={class:"space-quota"},hL=["textContent"],x0=$e({__name:"SpaceQuota",props:{spaceQuota:{}},setup(e){const{$gettext:t,current:n}=Oe.useGettext(),r=j(()=>e.spaceQuota.total?t("%{used} of %{total} used (%{percentage}% used)",{used:p(i),total:p(o),percentage:p(s).toString()}):t("%{used} used (no restriction)",{used:p(i)})),o=j(()=>An(e.spaceQuota.total,n)),i=j(()=>An(e.spaceQuota.used,n)),s=j(()=>parseFloat((e.spaceQuota.used/e.spaceQuota.total*100).toFixed(2))),a=j(()=>{switch(e.spaceQuota.state){case"normal":return"var(--oc-role-secondary)";default:return"var(--oc-role-error)"}});return(c,u)=>{const l=ye("oc-progress");return J(),ge("div",pL,[pe("p",{class:"oc-mb-s oc-mt-rm",textContent:W.toDisplayString(r.value)},null,8,hL),me(l,{value:s.value,max:100,size:"small",color:a.value,"background-color":"var(--oc-role-surface)"},null,8,["value","color"])])}}}),gL=$e({name:"WebDavDetails",props:{space:{type:Object,required:!0}},setup(e){const t=gr("resource"),n="check",r="file-copy",o=le(r),i=le(r),s=j(()=>mf(p(t).webDavPath)),a=j(()=>{var l;return(l=e.space)==null?void 0:l.getWebDavUrl({path:p(t).path})});return{copyWebDAVPathIcon:o,copyWebDAVPathToClipboard:()=>{navigator.clipboard.writeText(p(s)),o.value=n,setTimeout(()=>o.value=r,1500)},copyWebDAVUrlIcon:i,copyWebDAVUrlToClipboard:()=>{navigator.clipboard.writeText(p(a)),i.value=n,setTimeout(()=>i.value=r,1500)},webDavPath:s,webDavUrl:a}}}),mL={class:"oc-flex"},yL=["textContent"],bL={class:"oc-flex"},vL=["textContent"];function wL(e,t,n,r,o,i){const s=ye("oc-icon"),a=ye("oc-button"),c=cn("oc-tooltip");return J(),ge(Ge,null,[pe("dt",null,W.toDisplayString(e.$gettext("WebDAV path")),1),pe("dd",mL,[it(pe("div",{class:"oc-text-truncate",textContent:W.toDisplayString(e.webDavPath)},null,8,yL),[[c,e.webDavPath]]),it((J(),Ie(a,{class:"oc-ml-s",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV path to clipboard"),"no-hover":"",onClick:e.copyWebDAVPathToClipboard},{default:Ee(()=>[me(s,{name:e.copyWebDAVPathIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[c,e.$gettext("Copy WebDAV path")]])]),pe("dt",null,W.toDisplayString(e.$gettext("WebDAV URL")),1),pe("dd",bL,[it(pe("div",{class:"oc-text-truncate",textContent:W.toDisplayString(e.webDavUrl)},null,8,vL),[[c,e.webDavUrl]]),it((J(),Ie(a,{class:"oc-ml-s",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV URL to clipboard"),"no-hover":"",onClick:e.copyWebDAVUrlToClipboard},{default:Ee(()=>[me(s,{name:e.copyWebDAVUrlIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[c,e.$gettext("Copy WebDAV URL")]])])],64)}const N0=Ue(gL,[["render",wL]]),SL={id:"oc-space-details-sidebar"},EL={class:"oc-space-details-sidebar-image oc-text-center"},TL={key:1,class:"oc-position-relative"},AL=["src"],RL={key:0,class:"oc-flex oc-flex-middle oc-space-details-sidebar-members oc-mb-s oc-text-small"},_L=["textContent"],IL=["textContent"],CL=["aria-label"],PL=Ue($e({__name:"SpaceDetails",props:{showShareIndicators:{type:Boolean,default:!0}},setup(e){const t=St(),n=Qe(),{resourceContentsText:r}=Xv({showSizeInformation:!1}),o=qe(),{$gettext:i,$ngettext:s,current:a}=Oe.useGettext(),{loadPreview:c}=zf(),u=ct(),{imagesLoading:l}=We.storeToRefs(u),f=zt(),d=gr("resource"),m=le(""),{user:w}=We.storeToRefs(t),v=j(()=>f.linkShares.length),T=j(()=>n.areWebDavDetailsShown),y=j(()=>!dt(o,"files-spaces-projects")),g=j(()=>`${An(p(d).size,a)}, ${p(r)}`);Et(()=>p(d).spaceImageData,async()=>{if(!p(d).spaceImageData){m.value="";return}const ee=te.buildSpaceImageResource(p(d));m.value=await c({space:p(d),resource:ee,dimensions:Qn.Tile,processor:Ws.enum.fit,cancelRunning:!0,updateStore:!1})},{immediate:!0});const h=j(()=>te.getSpaceManagers(p(d)).map(se=>{var re;const ie=se.grantedTo.user||se.grantedTo.group;return ie.id===((re=p(w))==null?void 0:re.id)?i("%{displayName} (me)",{displayName:ie.displayName}):ie.displayName}).join(", ")),b=j(()=>wb(p(d).mdate,a)),S=j(()=>p(N)||p(L)),E=j(()=>{if(p(N)&&!p(L))return p($);if(!p(N)&&p(L))return p(V);switch(p(x)){case 1:return s("This space has one member and %{linkShareCount} link.","This space has one member and %{linkShareCount} links.",p(v),{linkShareCount:p(v).toString()});default:return p(v)===1?i("This space has %{memberShareCount} members and one link.",{memberShareCount:p(x).toString()}):i("This space has %{memberShareCount} members and %{linkShareCount} links.",{memberShareCount:p(x).toString(),linkShareCount:p(v).toString()})}}),I=j(()=>i("Open share panel")),R=j(()=>i("Open link list in share panel")),A=j(()=>i("Open member list in share panel")),N=j(()=>p(x)>0),L=j(()=>p(v)>0),x=j(()=>Object.keys(p(d).members).length),$=j(()=>s("This space has %{memberShareCount} member.","This space has %{memberShareCount} members.",p(x),{memberShareCount:p(x).toString()})),V=j(()=>s("%{linkShareCount} link giving access.","%{linkShareCount} links giving access.",p(v),{linkShareCount:p(v).toString()})),X=()=>{Ke.publish(vt.setActivePanel,"space-share")};return(ee,se)=>{const ie=ye("oc-spinner"),re=ye("oc-icon"),fe=ye("oc-button"),ue=ye("portal-target");return J(),ge("div",SL,[pe("div",EL,[p(l).includes(p(d).id)?(J(),Ie(ie,{key:0,"aria-label":p(i)("Space image is loading")},null,8,["aria-label"])):m.value?(J(),ge("div",TL,[pe("img",{src:m.value,alt:""},null,8,AL)])):(J(),Ie(re,{key:2,name:"layout-grid",size:"xxlarge",class:"space-default-image oc-px-m oc-py-m"}))]),ee.showShareIndicators&&S.value&&!p(d).disabled?(J(),ge("div",RL,[N.value?(J(),Ie(fe,{key:0,appearance:"raw","aria-label":A.value,"no-hover":"",onClick:X},{default:Ee(()=>[me(re,{name:"group",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):Pe("",!0),L.value?(J(),Ie(fe,{key:1,appearance:"raw","aria-label":R.value,"no-hover":"",onClick:X},{default:Ee(()=>[me(re,{name:"link",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):Pe("",!0),pe("p",{textContent:W.toDisplayString(E.value)},null,8,_L),me(fe,{appearance:"raw","aria-label":I.value,size:"small","no-hover":"",onClick:X},{default:Ee(()=>[pe("span",{class:"oc-text-small",textContent:W.toDisplayString(p(i)("Show"))},null,8,IL)]),_:1},8,["aria-label"])])):Pe("",!0),pe("dl",{class:"details-list oc-m-rm","aria-label":p(i)("Overview of the information about the selected space")},[pe("dt",null,W.toDisplayString(p(i)("Last activity")),1),pe("dd",null,W.toDisplayString(b.value),1),p(d).description?(J(),ge(Ge,{key:0},[pe("dt",null,W.toDisplayString(p(i)("Subtitle")),1),pe("dd",null,W.toDisplayString(p(d).description),1)],64)):Pe("",!0),pe("dt",null,W.toDisplayString(p(i)("Manager")),1),pe("dd",null,W.toDisplayString(h.value),1),p(d).disabled?Pe("",!0):(J(),ge(Ge,{key:1},[pe("dt",null,W.toDisplayString(p(i)("Quota")),1),pe("dd",null,[me(x0,{"space-quota":p(d).spaceQuota},null,8,["space-quota"])])],64)),y.value?(J(),ge(Ge,{key:2},[pe("dt",null,W.toDisplayString(p(i)("Size")),1),pe("dd",null,W.toDisplayString(g.value),1)],64)):Pe("",!0),T.value?(J(),Ie(N0,{key:3,space:p(d)},null,8,["space"])):Pe("",!0),me(ue,{name:"app.files.sidebar.space.details.table","slot-props":{space:p(d),resource:p(d)},multiple:!0},null,8,["slot-props"])],8,CL)])}}}),[["__scopeId","data-v-6e24534c"]]),FL={id:"oc-spaces-details-multiple-sidebar"},OL={class:"spaces-preview oc-mb-l"},kL={class:"spaces-preview-body"},xL=["textContent"],NL=Ue($e({__name:"SpaceDetailsMultiple",props:{selectedSpaces:{}},setup(e){const t=Oe.useGettext(),{$gettext:n,$ngettext:r}=t,o=j(()=>{let d=0;return e.selectedSpaces.forEach(m=>{d+=m.spaceQuota.total}),An(d,t.current)}),i=j(()=>{let d=0;return e.selectedSpaces.forEach(m=>{m.disabled||(d+=m.spaceQuota.remaining)}),An(d,t.current)}),s=j(()=>{let d=0;return e.selectedSpaces.forEach(m=>{m.disabled||(d+=m.spaceQuota.used)}),An(d,t.current)}),a=j(()=>e.selectedSpaces.filter(d=>!d.disabled).length),c=j(()=>e.selectedSpaces.filter(d=>d.disabled).length),u=j(()=>n("Overview of the information about the selected spaces")),l=j(()=>r("%{ itemCount } space selected","%{ itemCount } spaces selected",e.selectedSpaces.length,{itemCount:e.selectedSpaces.length.toString()})),f=j(()=>[{term:n("Total quota:"),definition:p(o).toString()},{term:n("Remaining quota:"),definition:p(i).toString()},{term:n("Used quota:"),definition:p(s).toString()},{term:n("Enabled:"),definition:p(a).toString()},{term:n("Disabled:"),definition:p(c).toString()}]);return(d,m)=>{const w=ye("oc-icon"),v=ye("oc-definition-list");return J(),ge("div",FL,[pe("div",OL,[pe("div",kL,[me(w,{class:"preview-icon",size:"xxlarge",name:"layout-grid"}),pe("p",{class:"preview-text",textContent:W.toDisplayString(l.value)},null,8,xL)])]),me(v,{"aria-label":u.value,items:f.value},null,8,["aria-label","items"])])}}}),[["__scopeId","data-v-11ad741e"]]),$L=$e({name:"SpaceNoSelection"}),DL={class:"oc-mt-xl"},LL={class:"oc-flex space-info oc-text-center"};function ML(e,t,n,r,o,i){const s=ye("oc-icon"),a=cn("translate");return J(),ge("div",DL,[pe("div",LL,[me(s,{name:"layout-grid",size:"xxlarge"}),it((J(),ge("p",null,t[0]||(t[0]=[Gt("Select a space to view details")]))),[[a]])])])}const BL=Ue($L,[["render",ML]]),jL=$e({name:"CompareSaveDialog",props:{originalObject:{type:Object,required:!0},compareObject:{type:Object,required:!0},confirmButtonDisabled:{type:Boolean,default:()=>!1}},emits:["confirm","revert"],setup(){const e=le(!1);let t;return qt(()=>{t=Ke.subscribe("sidebar.entity.saved",()=>{e.value=!0})}),Wn(()=>{Ke.unsubscribe("sidebar.entity.saved",t)}),{saved:e}},computed:{unsavedChanges(){return!sb(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}}}),UL={class:"compare-save-dialog oc-width-1-1 oc-flex oc-flex-between oc-flex-middle"},qL={key:0,class:"state-indicator oc-flex oc-flex-middle"},VL=["textContent"],zL={key:1,class:"state-indicator"},WL=["textContent"],HL=["textContent"];function GL(e,t,n,r,o,i){const s=ye("oc-icon"),a=ye("oc-button");return J(),ge("div",UL,[e.saved?(J(),ge("span",qL,[me(s,{name:"checkbox-circle"}),pe("span",{class:"oc-ml-s",textContent:W.toDisplayString(e.$gettext("Changes saved"))},null,8,VL)])):(J(),ge("span",zL,W.toDisplayString(e.unsavedChangesText),1)),pe("div",null,[me(a,{disabled:!e.unsavedChanges,class:"compare-save-dialog-revert-btn",onClick:t[0]||(t[0]=c=>e.$emit("revert"))},{default:Ee(()=>[pe("span",{textContent:W.toDisplayString(e.$gettext("Revert"))},null,8,WL)]),_:1},8,["disabled"]),me(a,{appearance:"filled",class:"compare-save-dialog-confirm-btn",disabled:!e.unsavedChanges||e.confirmButtonDisabled,onClick:t[1]||(t[1]=c=>e.$emit("confirm"))},{default:Ee(()=>[pe("span",{textContent:W.toDisplayString(e.$gettext("Save"))},null,8,HL)]),_:1},8,["disabled"])])])}const KL=Ue(jL,[["render",GL],["__scopeId","data-v-471483fe"]]),QL=iS(async()=>(await Promise.resolve().then(()=>q2)).default),XL=$e({name:"CustomComponentTarget",props:{extensionPoint:{type:Object,required:!0}},setup(e){const t=Bi(),n=Fb(),r=j(()=>t.requestExtensions(e.extensionPoint)),o=n.extractDefaultExtensionIds(e.extensionPoint,p(r));return{extensions:j(()=>{if(e.extensionPoint.multiple||p(r).length<=1)return p(r);const s=n.getExtensionPreference(e.extensionPoint.id,o);return s.selectedExtensionIds.length?[p(r).find(a=>s.selectedExtensionIds.includes(a.id))||p(r)[0]]:[p(r)[0]]})}}});function YL(e,t,n,r,o,i){return J(!0),ge(Ge,null,xt(e.extensions,s=>(J(),Ie(kr(s.content),{key:`custom-component-${s.id}`}))),128)}const JL=Ue(XL,[["render",YL]]),ZL=$e({name:"ItemFilter",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0},optionFilterLabel:{type:String,required:!1,default:""},showOptionFilter:{type:Boolean,required:!1,default:!1},items:{type:Array,required:!0},allowMultiple:{type:Boolean,required:!1,default:!1},idAttribute:{type:String,required:!1,default:"id"},displayNameAttribute:{type:String,required:!1,default:"name"},filterableAttributes:{type:Array,required:!1,default:()=>[]},closeOnClick:{type:Boolean,default:!1}},emits:["selectionChange"],setup:function(e,{emit:t,expose:n}){const r=qe(),o=Qt(),i=le(),s=le([]),a=le(e.items),c=le(null),u=le(null),l=`q_${e.filterName}`,f=ln(l),d=E=>E[e.idAttribute],m=()=>r.push({query:{...Mi(p(o).query,[l]),...!!p(s).length&&{[l]:p(s).reduce((E,I)=>(E+=`${d(I)}+`,E),"").slice(0,-1)}}}),w=E=>!!p(s).find(I=>d(I)===d(E)),v=async E=>{w(E)?s.value=p(s).filter(I=>d(I)!==d(E)):(e.allowMultiple||(s.value=[]),s.value.push(E)),await m(),t("selectionChange",p(s))},T=le(),y=(E,I)=>{if(!(I||"").trim())return E;const A=new nd(E,{...al,keys:e.filterableAttributes}).search(I).map(N=>N.item);return E.filter(N=>A.includes(N))},g=()=>{s.value=[],t("selectionChange",p(s)),m()},h=E=>{a.value=E},b=async()=>{var E;h(e.items),await zn(),(E=p(i))==null||E.focus()};Et(T,()=>{h(y(e.items,p(T))),p(u)&&(c.value=new id(p(u)),p(c).unmark(),p(c).mark(p(T),{element:"span",className:"mark-highlight"}))});const S=()=>{const E=At(p(f));if(E){const I=E.split("+");s.value=e.items.filter(R=>I.includes(d(R)))}};return n({setSelectedItemsBasedOnQuery:S}),qt(()=>{S()}),{clearFilter:g,displayedItems:a,filterInputRef:i,filterTerm:T,isItemSelected:w,itemFilterListRef:u,queryParam:l,selectedItems:s,setDisplayedItems:h,showDrop:b,toggleItemSelection:v,setSelectedItemsBasedOnQuery:S}}}),e2={ref:"itemFilterListRef"},t2={class:"oc-flex oc-flex-middle oc-text-truncate"},n2={class:"oc-text-truncate oc-ml-s"},r2={class:"oc-flex"};function i2(e,t,n,r,o,i){const s=ye("oc-text-input"),a=ye("oc-checkbox"),c=ye("oc-icon"),u=ye("oc-button"),l=ye("oc-list"),f=ye("oc-filter-chip");return J(),ge("div",{class:W.normalizeClass(["item-filter oc-flex",`item-filter-${e.filterName}`])},[me(f,{"filter-label":e.filterLabel,"selected-item-names":e.selectedItems.map(d=>d[e.displayNameAttribute]),"close-on-click":e.closeOnClick,onClearFilter:e.clearFilter,onShowDrop:e.showDrop},{default:Ee(()=>[e.showOptionFilter&&e.filterableAttributes.length?(J(),Ie(s,{key:0,ref:"filterInputRef",modelValue:e.filterTerm,"onUpdate:modelValue":t[0]||(t[0]=d=>e.filterTerm=d),class:"item-filter-input oc-mb-m oc-mt-s",autocomplete:"off",label:e.optionFilterLabel===""?e.$gettext("Filter list"):e.optionFilterLabel},null,8,["modelValue","label"])):Pe("",!0),pe("div",e2,[me(l,{class:"item-filter-list"},{default:Ee(()=>[(J(!0),ge(Ge,null,xt(e.displayedItems,(d,m)=>(J(),ge("li",{key:m,class:"oc-my-xs"},[me(u,{class:W.normalizeClass(["item-filter-list-item oc-flex oc-flex-middle oc-width-1-1 oc-p-s",{"item-filter-list-item-active":!e.allowMultiple&&e.isItemSelected(d),"oc-flex-left":e.allowMultiple,"oc-flex-between":!e.allowMultiple}]),"justify-content":"space-between",appearance:"raw","data-test-value":d[e.displayNameAttribute],onClick:w=>e.toggleItemSelection(d)},{default:Ee(()=>[pe("div",t2,[e.allowMultiple?(J(),Ie(a,{key:0,size:"large",class:"item-filter-checkbox oc-mr-s",label:e.$gettext("Toggle selection"),"model-value":e.isItemSelected(d),"label-hidden":!0,"onUpdate:modelValue":w=>e.toggleItemSelection(d),onClick:t[1]||(t[1]=In(()=>{},["stop"]))},null,8,["label","model-value","onUpdate:modelValue"])):Pe("",!0),pe("div",null,[He(e.$slots,"image",{item:d})]),pe("div",n2,[He(e.$slots,"item",{item:d})])]),pe("div",r2,[!e.allowMultiple&&e.isItemSelected(d)?(J(),Ie(c,{key:0,name:"check"})):Pe("",!0)])]),_:2},1032,["class","data-test-value","onClick"])]))),128))]),_:3})],512)]),_:3},8,["filter-label","selected-item-names","close-on-click","onClearFilter","onShowDrop"])],2)}const o2=Ue(ZL,[["render",i2]]),s2=$e({name:"ItemFilterToggle",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=qe(),r=Qt(),o=le(!1),i=`q_${e.filterName}`,s=ln(i),a=()=>n.push({query:{...Mi(p(r).query,[i]),...p(o)&&{[i]:"true"}}}),c=async()=>{o.value=!p(o),await a(),t("toggleFilter",p(o))};return qt(()=>{At(p(s))==="true"&&(o.value=!0)}),{queryParam:i,filterActive:o,toggleFilter:c}}});function a2(e,t,n,r,o,i){const s=ye("oc-filter-chip");return J(),ge("div",{class:W.normalizeClass(["item-filter oc-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 l2=Ue(s2,[["render",a2]]),c2=$e({name:"LoadingIndicator",setup(){const e=dn();let t,n,r;const o=le(e.isLoading),i=le(e.currentProgress),s=()=>{i.value=e.currentProgress,o.value=e.isLoading},a=()=>{i.value=e.currentProgress};return qt(()=>{t=Ke.subscribe($r.add,s),n=Ke.subscribe($r.remove,s),r=Ke.subscribe($r.setProgress,a)}),Wn(()=>{Ke.unsubscribe($r.add,t),Ke.unsubscribe($r.remove,n),Ke.unsubscribe($r.setProgress,r)}),{isLoading:o,currentProgress:i}}}),u2={key:0,id:"oc-loading-indicator",class:"oc-width-1-1"};function f2(e,t,n,r,o,i){const s=ye("oc-progress");return e.isLoading?(J(),ge("div",u2,[me(s,{max:100,indeterminate:e.currentProgress===null,value:e.currentProgress,size:"small"},null,8,["indeterminate","value"])])):Pe("",!0)}const d2=Ue(c2,[["render",f2]]),p2={class:"no-content-message oc-flex oc-flex-column oc-flex-center oc-flex-middle oc-text-center"},h2={class:"oc-text-muted oc-text-xlarge"},g2={class:"oc-text-muted"},m2=$e({__name:"NoContentMessage",props:{icon:{},iconFillType:{default:"fill"}},setup(e){return(t,n)=>{const r=ye("oc-icon");return J(),ge("div",p2,[me(r,{name:t.icon,type:"div",size:"xxlarge","fill-type":t.iconFillType,class:"oc-mb-m"},null,8,["name","fill-type"]),pe("div",h2,[He(t.$slots,"message")]),pe("div",g2,[He(t.$slots,"callToAction")])])}}}),y2=$e({props:{pages:{type:Number,required:!0},currentPage:{type:Number,required:!0}},watch:{currentPage:{handler:function(){var e;(e=document.getElementsByClassName("files-view-wrapper")[0])==null||e.scrollTo(0,0)}}}});function b2(e,t,n,r,o,i){const s=ye("oc-pagination");return e.pages>1?(J(),Ie(s,{key:0,pages:e.pages,"current-page":e.currentPage,"max-displayed":3,"current-route":e.$route,class:"files-pagination oc-flex oc-flex-center oc-my-s"},null,8,["pages","current-page","current-route"])):Pe("",!0)}const v2=Ue(y2,[["render",b2]]),w2=$e({name:"SearchBarFilter",props:{currentFolderAvailable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=Oe.useGettext(),r=ln("useScope"),o=le(),i=le(),s=j(()=>{var u;return n((u=o.value)==null?void 0:u.title)}),a=j(()=>[{id:Rr.currentFolder,title:n("Current folder"),enabled:e.currentFolderAvailable},{id:Rr.allFiles,title:n("All files"),enabled:!0}]);return Et(()=>e.currentFolderAvailable,()=>{if(p(r)){if(p(r).toString()==="true"){o.value=p(a).find(({id:l})=>l===Rr.currentFolder);return}o.value=p(a).find(({id:l})=>l===Rr.allFiles);return}if(!e.currentFolderAvailable){o.value=p(a).find(({id:u})=>u===Rr.allFiles);return}if(p(i)){o.value=p(a).find(({id:u})=>u===p(i).id);return}o.value=p(a).find(({id:u})=>u===Rr.allFiles)},{immediate:!0}),{currentSelection:o,currentSelectionTitle:s,onOptionSelected:u=>{i.value=u,o.value=u,t("update:modelValue",{value:u})},locationOptions:a}}}),S2={key:0},E2={key:0,class:"oc-flex"};function T2(e,t,n,r,o,i){const s=ye("oc-icon"),a=ye("oc-button"),c=ye("oc-filter-chip");return J(),ge("div",{class:"oc-location-search oc-position-small oc-position-center-right oc-mt-rm",onClick:t[0]||(t[0]=In(()=>{},["stop"]))},[e.currentSelection?(J(),ge("div",S2,[me(c,{"is-toggle":!1,"is-toggle-active":!1,"filter-label":e.currentSelectionTitle,"selected-item-names":[],class:"oc-search-bar-filter",raw:"","close-on-click":""},{default:Ee(()=>[(J(!0),ge(Ge,null,xt(e.locationOptions,(u,l)=>(J(),Ie(a,{key:l,appearance:"raw",size:"medium","justify-content":"space-between",class:W.normalizeClass(["search-bar-filter-item oc-flex oc-flex-middle oc-width-1-1 oc-py-xs oc-px-s",{"oc-secondary-container":u.id===e.currentSelection.id}]),disabled:!u.enabled,"data-test-id":u.id,onClick:f=>e.onOptionSelected(u)},{default:Ee(()=>[pe("span",null,W.toDisplayString(u.title),1),u.id===e.currentSelection.id?(J(),ge("div",E2,[me(s,{name:"check"})])):Pe("",!0)]),_:2},1032,["class","disabled","data-test-id","onClick"]))),128))]),_:1},8,["filter-label"])])):Pe("",!0)])}const A2=Ue(w2,[["render",T2]]),R2=$e({name:"PortalTarget",components:{PortalTargetVue:wa.PortalTarget},props:{...wa.PortalTarget.props},setup(e){const t=j(()=>e);return qt(()=>{Ke.publish(pa.mounted,e)}),{properties:t}}});function _2(e,t,n,r,o,i){const s=ye("portal-target-vue");return J(),Ie(s,W.normalizeProps(Xa(e.properties)),null,16)}const I2=Ue(R2,[["render",_2]]),C2=({sortBy:e,sortDir:t})=>({groupingSettings:j(()=>({groupingBy:localStorage.getItem("grouping-shared-with-me")||"Shared on",showGroupingOptions:!0,groupingFunctions:{"Name alphabetically":function(r){return localStorage.setItem("grouping-shared-with-me","Name alphabetically"),isNaN(Number(r.name.charAt(0)))?r.name.charAt(0)==="."?r.name.charAt(1).toLowerCase():r.name.charAt(0).toLowerCase():"#"},"Shared on":function(r){localStorage.setItem("grouping-shared-with-me","Shared on");const o=Date.now()-6048e5,i=Date.now()-2592e6;return Date.parse(r.sdate)<i?"Older":Date.parse(r.sdate)>=o?"Recently":"Last month"},"Share owner":function(r){var o;return localStorage.setItem("grouping-shared-with-me","Share owner"),(o=r==null?void 0:r.owner)==null?void 0:o.displayName},None:function(){localStorage.setItem("grouping-shared-with-me","None")}},sortGroups:{"Name alphabetically":function(r){const o=r.sort(function(i,s){return i.name<s.name?-1:i.name>s.name?1:0});return p(e)==="name"&&p(t)==="desc"&&o.reverse(),o},"Shared on":function(r){const o=[],i=["Recently","Last month","Older"];for(const s of i){const a=r.find(c=>c.name.toLowerCase()===s.toLowerCase());a&&o.push(a)}return p(e)==="sdate"&&p(t)==="asc"&&o.reverse(),o},"Share owner":function(r){const o=r.sort(function(i,s){return i.name<s.name?-1:i.name>s.name?1:0});return p(e)==="owner"&&p(t)==="desc"&&o.reverse(),o}}}))}),P2={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é"}},F2={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"}},O2={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"}},k2={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"}},x2={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"}},N2={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:"Автопрокрутка"}},$2={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:"同期スクロール"}},D2={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"}},L2={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"},M2={"fr-FR":P2,"de-DE":F2,"it-IT":O2,"es-ES":k2,"pl-PL":x2,ru:N2,"jp-JP":$2,"id-ID":D2},B2=$e({name:"TextEditor",components:{MdEditor:jo.MdEditor,MdPreview:jo.MdPreview},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}=si(),o=j(()=>{const{showPreviewOnlyMd:c=!0}=e.applicationConfig;return{showPreviewOnlyMd:c}}),i=j(()=>{var c;return e.markdownMode||["md","markdown"].includes((c=e.resource)==null?void 0:c.extension)||!p(o).showPreviewOnlyMd}),s=j(()=>p(r).isDark?"dark":"light");return jo.config({editorConfig:{languageUserDefined:M2},editorExtensions:{screenfull:{instance:K0},cropper:{instance:Q0}},markdownItPlugins(c){return[...c,{type:"xss",plugin:jo.XSSPlugin,options:{}}]}}),{isMarkdown:i,theme:s,language:n,languages:L2,onUploadImg:async c=>{const l=(await Promise.all([...c].map(d=>new Promise((m,w)=>{const v=new FileReader;v.onload=()=>m(v.result),v.onerror=w,v.readAsDataURL(d)})))).map(d=>`![image](${d})`),f=`${p(e.currentContent)}
63
+ */function yM(e){return e}const nD={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};Object.assign({active:{type:Boolean,default:!0}},nD);var rD=Object.defineProperty,x0=Object.getOwnPropertySymbols,iD=Object.prototype.hasOwnProperty,oD=Object.prototype.propertyIsEnumerable,N0=(e,t,n)=>t in e?rD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sD=(e,t)=>{for(var n in t||(t={}))iD.call(t,n)&&N0(e,n,t[n]);if(x0)for(var n of x0(t))oD.call(t,n)&&N0(e,n,t[n]);return e};const $0=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},aD={},lD={xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"},cD=fe("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),uD=[cD];function fD(e,t){return X(),pe("svg",lD,uD)}const dD=$0(aD,[["render",fD]]),pD={},hD={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"10"},gD=fe("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),mD=[gD];function yD(e,t){return X(),pe("svg",hD,mD)}sD({},{Deselect:dD,OpenIndicator:$0(pD,[["render",yD]])});const bD=["aria-label"],vD=xe({__name:"OcSpinner",props:{ariaLabel:{default:""},size:{default:"medium"}},setup(e){const t=B(()=>["oc-spinner",`oc-spinner-${Mr(e.size||"medium")}`]);return(n,r)=>(X(),pe("span",{class:H.normalizeClass(t.value),"aria-label":n.ariaLabel,tabindex:"-1",role:"img"},null,10,bD))}}),wD={class:"oc-status-indicators oc-flex"},SD=["id","textContent"],ED=xe({__name:"OcStatusIndicators",props:{resource:{},indicators:{},disableHandler:{type:Boolean,default:!1}},setup(e){const{$gettext:t}=Fe.useGettext(),n=ce({}),r=i=>Object.hasOwn(i,"handler"),o=i=>i.accessibleDescription?(p(n)[i.id]||(p(n)[i.id]=Xs("oc-indicator-description-")),p(n)[i.id]):null;return(i,s)=>{const a=ln("oc-tooltip");return X(),pe("div",wD,[(X(!0),pe(qe,null,wt(i.indicators,(c,u)=>(X(),pe(qe,null,[r(c)&&!i.disableHandler?ot((X(),Re(S0,{id:c.id,key:`${c.id}-handler`,class:H.normalizeClass(["oc-status-indicators-indicator",{"oc-ml-xs":u>0}]),"aria-label":p(t)(c.label),"aria-describedby":o(c),appearance:"raw","data-testid":c.id,"data-test-indicator-type":c.type,"no-hover":"",onClick:l=>c.handler(i.resource)},{default:Se(()=>[ge(w0,{name:c.icon,size:"small","fill-type":c.fillType},null,8,["name","fill-type"])]),_:2},1032,["id","class","aria-label","aria-describedby","data-testid","data-test-indicator-type","onClick"])),[[a,p(t)(c.label)]]):ot((X(),Re(w0,{id:c.id,key:c.id,tabindex:"-1",size:"small",class:H.normalizeClass(["oc-status-indicators-indicator",{"oc-ml-xs":u>0}]),name:c.icon,"fill-type":c.fillType,"accessible-label":p(t)(c.label),"aria-describedby":o(c),"data-testid":c.id,"data-test-indicator-type":c.type},null,8,["id","class","name","fill-type","accessible-label","aria-describedby","data-testid","data-test-indicator-type"])),[[a,p(t)(c.label)]]),o(c)?(X(),pe("p",{id:o(c),key:o(c),class:"oc-invisible-sr",textContent:H.toDisplayString(p(t)(c.accessibleDescription))},null,8,SD)):Ce("",!0)],64))),256))])}}}),TD={class:"oc-thead"},AD=xe({name:"OcTableHead",__name:"OcTableHead",setup(e){return(t,n)=>(X(),pe("thead",TD,[Xe(t.$slots,"default")]))}}),RD=xe({name:"OcTableBody",__name:"OcTableBody",setup(e){return(t,n)=>(X(),pe("tbody",null,[Xe(t.$slots,"default")]))}}),D0=({target:e,mode:t="show",rootMargin:n="100px",onVisibleCallback:r})=>{if(!(window&&"IntersectionObserver"in window))return{isVisible:ce(!0)};const i=ce(!1),s=new IntersectionObserver(a=>{const c=a.at(-1).isIntersecting;i.value=c,p(i)&&r&&r(),t!=="showHide"&&i.value&&s.unobserve(e.value)},{rootMargin:n});return St(e,()=>{s.observe(e.value)}),Vn(()=>s.disconnect()),{isVisible:i}},L0=xe({__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,r=B(()=>{const o=["oc-table-cell",`oc-table-cell-align-${e.alignH}`,`oc-table-cell-align-${e.alignV}`,`oc-table-cell-width-${e.width}`];return e.wrap&&o.push(`oc-text-${e.wrap}`),o});return(o,i)=>(X(),Re(Nr(o.type),{class:H.normalizeClass(r.value),onClick:i[0]||(i[0]=s=>n("click",s))},{default:Se(()=>[Xe(o.$slots,"default")]),_:3},8,["class"]))}}),M0=xe({__name:"OcTableTd",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},setup(e){return(t,n)=>(X(),Re(L0,{type:"td","align-h":t.alignH,"align-v":t.alignV,width:t.width,wrap:t.wrap,class:"oc-td"},{default:Se(()=>[Xe(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),B0=xe({__name:"OcTableTr",props:{lazy:{}},emits:["contextmenu","click","dragstart","drop","dragenter","dragleave","dragover","mouseleave","itemVisible"],setup(e,{emit:t}){const n=t,r=Md((a,c)=>{let u;return{get(){return a(),u},set(l){u=l,c()}}}),o=B(()=>e.lazy?e.lazy.colspan:1),{isVisible:i}=e.lazy?D0({...e.lazy,target:r,onVisibleCallback:()=>n("itemVisible")}):{isVisible:ce(!0)},s=B(()=>!p(i));return e.lazy||n("itemVisible"),(a,c)=>(X(),pe("tr",{ref_key:"observerTarget",ref:r,onClick:c[0]||(c[0]=u=>a.$emit("click",u)),onContextmenu:c[1]||(c[1]=u=>a.$emit("contextmenu",u)),onDragstart:c[2]||(c[2]=u=>a.$emit("dragstart",u)),onDrop:c[3]||(c[3]=u=>a.$emit("drop",u)),onDragenter:c[4]||(c[4]=u=>a.$emit("dragenter",u)),onDragleave:c[5]||(c[5]=u=>a.$emit("dragleave",u)),onDragover:c[6]||(c[6]=u=>a.$emit("dragover",u)),onMouseleave:c[7]||(c[7]=u=>a.$emit("mouseleave",u))},[s.value?(X(),Re(M0,{key:0,colspan:o.value},{default:Se(()=>c[8]||(c[8]=[fe("span",{class:"shimmer"},null,-1)])),_:1,__:[8]},8,["colspan"])):Xe(a.$slots,"default",{key:1})],544))}}),_D=xe({__name:"OcTableTh",props:{alignH:{default:"left"},alignV:{default:"middle"},width:{default:"auto"},wrap:{}},emits:["click"],setup(e){return(t,n)=>(X(),Re(L0,{type:"th","align-h":t.alignH,"align-v":t.alignV,width:t.width,wrap:t.wrap,class:"oc-th",onClick:n[0]||(n[0]=r=>t.$emit("click",r))},{default:Se(()=>[Xe(t.$slots,"default")]),_:3},8,["align-h","align-v","width","wrap"]))}}),ID={key:0,class:"oc-table-thead-content"},CD=["textContent"],PD={key:1},FD={key:0,class:"oc-table-thead-content"},OD=["textContent"],kD={key:1,class:"oc-table-footer"},xD={class:"oc-table-footer-row"},ND=["colspan"],j0="asc",ad="desc",$D=xe({__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:WP,EVENT_TROW_CLICKED:HP,EVENT_TROW_MOUNTED:GP,EVENT_TROW_CONTEXTMENU:KP},{$gettext:o}=Fe.useGettext(),i=D=>e.itemDomSelector?e.itemDomSelector(D):D[e.idKey],s=B(()=>{const D=["oc-table"];return e.hover&&D.push("oc-table-hover"),e.sticky&&D.push("oc-table-sticky"),D}),a=B(()=>e.fields.length),c=D=>{D.preventDefault()},u=(D,N)=>{n(QP,D,N)},l=(D,N)=>{n(Bb,D,N)},d=(D,N,x)=>{n("dropRowStyling",D,N,x)},f=D=>D.type==="slot",m=D=>["callback","function"].indexOf(D.type)>=0,w=D=>Object.prototype.hasOwnProperty.call(D,"title")?D.title:D.name,y=()=>({class:s.value}),E=(D,N)=>{const x=v(D);return x.class=`oc-table-header-cell oc-table-header-cell-${D.name}`,Object.prototype.hasOwnProperty.call(D,"thClass")&&(x.class+=` ${D.thClass}`),e.sticky&&(x.style=`top: ${e.headerPosition}px;`),N===0&&(x.class+=` oc-pl-${Mr(e.paddingX)} `),N===e.fields.length-1&&(x.class+=` oc-pr-${Mr(e.paddingX)}`),_(x,D),x},b=(D,N)=>({...e.lazy&&{lazy:{colspan:a.value}},class:["oc-tbody-tr",`oc-tbody-tr-${i(D)||N}`,h(D)?"oc-table-highlighted":void 0,S(D)?"oc-table-disabled":void 0].filter(Boolean)}),g=(D,N,x)=>{const W=v(D);return W.class=`oc-table-data-cell oc-table-data-cell-${D.name}`,Object.prototype.hasOwnProperty.call(D,"tdClass")&&(W.class+=` ${D.tdClass}`),Object.prototype.hasOwnProperty.call(D,"wrap")&&(W.wrap=D.wrap),N===0&&(W.class+=` oc-pl-${Mr(e.paddingX)} `),N===e.fields.length-1&&(W.class+=` oc-pr-${Mr(e.paddingX)}`),Object.prototype.hasOwnProperty.call(D,"accessibleLabelCallback")&&(W["aria-label"]=D.accessibleLabelCallback(x)),W},v=D=>({...(D==null?void 0:D.alignH)&&{alignH:D.alignH},...(D==null?void 0:D.alignV)&&{alignV:D.alignV},...(D==null?void 0:D.width)&&{width:D.width},class:void 0,wrap:void 0,style:void 0}),h=D=>e.highlighted?Array.isArray(e.highlighted)?e.highlighted.indexOf(D[e.idKey])>-1:e.highlighted===D[e.idKey]:!1,S=D=>e.disabled.length?e.disabled.indexOf(D[e.idKey])>-1:!1,T=(D,N,x)=>{const W=[x[e.idKey],N+1].filter(Boolean);return f(D)?[...W,D.name].join("-"):m(D)?[...W,D.callback(x[D.name])].join("-"):[...W,x[D.name]].join("-")},R=D=>o("Sort by %{ name }",{name:D}),_=(D,N)=>{if(!A(N))return;let x="none";e.sortBy===N.name&&(x=e.sortDir===j0?"ascending":"descending"),D["aria-sort"]=x},A=({sortable:D})=>!!D,$=D=>{if(!A(D))return;let N=e.sortDir;e.sortBy===D.name&&e.sortDir!==void 0&&(N=e.sortDir===ad?j0:ad),(e.sortBy!==D.name||e.sortDir===void 0)&&(N=D.sortDir||ad),n("sort",{sortBy:D.name,sortDir:N})};return(D,N)=>{const x=he("oc-icon");return X(),pe("table",Gt(y(),{class:"has-item-context-menu"}),[D.hasHeader?(X(),Re(AD,{key:0},{default:Se(()=>[ge(B0,{class:"oc-table-header-row"},{default:Se(()=>[(X(!0),pe(qe,null,wt(D.fields,(W,K)=>(X(),Re(_D,Gt({key:`oc-thead-${W.name}`},{ref_for:!0},E(W,K)),{default:Se(()=>[W.sortable?(X(),Re(S0,{key:0,"aria-label":R(W.name),appearance:"raw",class:"oc-button-sort oc-width-1-1","gap-size":"small","no-hover":"",onClick:le=>$(W)},{default:Se(()=>[W.headerType==="slot"?(X(),pe("span",ID,[Xe(D.$slots,W.name+"Header")])):(X(),pe("span",{key:1,class:"oc-table-thead-content header-text",textContent:H.toDisplayString(w(W))},null,8,CD)),ge(x,{name:D.sortDir==="asc"?"arrow-down":"arrow-up","fill-type":"line",class:H.normalizeClass([{"oc-invisible-sr":D.sortBy!==W.name},"oc-p-xs oc-rounded"]),size:"small"},null,8,["name","class"])]),_:2},1032,["aria-label","onClick"])):(X(),pe("div",PD,[W.headerType==="slot"?(X(),pe("span",FD,[Xe(D.$slots,W.name+"Header")])):(X(),pe("span",{key:1,class:"oc-table-thead-content header-text",textContent:H.toDisplayString(w(W))},null,8,OD))]))]),_:2},1040))),128))]),_:3})]),_:3})):Ce("",!0),ge(RD,{class:"has-item-context-menu"},{default:Se(()=>[(X(!0),pe(qe,null,wt(D.data,(W,K)=>(X(),Re(B0,Gt({key:`oc-tbody-tr-${i(W)||K}`,ref_for:!0,ref:`row-${K}`},{ref_for:!0},b(W,K),{"data-item-id":W[D.idKey],draggable:D.dragDrop,onClick:le=>D.$emit(r.EVENT_TROW_CLICKED,[W,le]),onContextmenu:le=>D.$emit(r.EVENT_TROW_CONTEXTMENU,D.$refs[`row-${K}`][0],le,W),onVnodeMounted:le=>D.$emit(r.EVENT_TROW_MOUNTED,W,D.$refs[`row-${K}`][0]),onDragstart:le=>u(W,le),onDrop:le=>l(i(W),le),onDragenter:Pn(le=>d(i(W),!1,le),["prevent"]),onDragleave:Pn(le=>d(i(W),!0,le),["prevent"]),onMouseleave:le=>d(i(W),!0,le),onDragover:N[0]||(N[0]=le=>c(le)),onItemVisible:le=>D.$emit("itemVisible",W)}),{default:Se(()=>[(X(!0),pe(qe,null,wt(D.fields,(le,be)=>(X(),Re(M0,Gt({key:"oc-tbody-td-"+T(le,be,W)},{ref_for:!0},g(le,be,W)),{default:Se(()=>[f(le)?Xe(D.$slots,le.name,{key:0,item:W}):m(le)?(X(),pe(qe,{key:1},[Ot(H.toDisplayString(le.callback(W[le.name])),1)],64)):(X(),pe(qe,{key:2},[Ot(H.toDisplayString(W[le.name]),1)],64))]),_:2},1040))),128))]),_:2},1040,["data-item-id","draggable","onClick","onContextmenu","onVnodeMounted","onDragstart","onDrop","onDragenter","onDragleave","onMouseleave","onItemVisible"]))),128))]),_:3}),D.$slots.footer?(X(),pe("tfoot",kD,[fe("tr",xD,[fe("td",{colspan:a.value,class:"oc-table-footer-cell"},[Xe(D.$slots,"footer")],8,ND)])])):Ce("",!0)],16)}}}),U0=xe({__name:"ResourceStatusIndicators",props:{resource:{},space:{default:()=>{}},filter:{type:Function,default:void 0}},setup(e){const t=ap(),n=yt(),r=Qe(),o=B(()=>{const i=Nb({space:e.space,resource:e.resource,ancestorMetaData:r.ancestorMetaData,user:n.user});return e.filter?i.filter(e.filter):i});return(i,s)=>o.value.length>0?(X(),Re(p(ED),Gt({key:0},p(t),{indicators:o.value,resource:i.resource}),null,16,["indicators","resource"])):Ce("",!0)}}),ld=xe({__name:"UserAvatar",props:{userId:{},userName:{}},setup(e){const t=Ys(),{avatarMap:n}=Ue.storeToRefs(t),{enqueueAvatar:r}=o0(),o=B(()=>p(n)[e.userId]);return Bt(()=>{r(e.userId)}),(i,s)=>{const a=he("oc-avatar");return X(),Re(a,{"user-name":i.userName,src:o.value,width:36},null,8,["user-name","src"])}}}),DD={class:"avatar-upload"},LD={class:"oc-flex oc-flex-column oc-flex-middle"},MD={class:"oc-button-group"},BD={key:0},jD=["src"],UD={class:"oc-text-small oc-text-muted oc-flex oc-flex-middle oc-mt-xs"},qD=["textContent"],VD=xe({__name:"AvatarUpload",setup(e){const t=yt(),n=Ys(),{avatarMap:r}=Ue.storeToRefs(n),{user:o}=Ue.storeToRefs(t),{$gettext:i}=Fe.useGettext(),{showErrorMessage:s,showMessage:a}=tt(),{graphAuthenticated:c}=Ge(),{setCropperInstance:u}=Xf(),l=ce(null),d=ce(null),f=ce(null),m=ce(!1),w=ce(!1),y=ce(!1),E=ce(null),b=$f*1024*1024,g=B(()=>!!p(r)[p(o).id]),v=D=>{var W;const x=(W=D.target.files)==null?void 0:W[0];if(x){if(x.size>b){s({title:i("File size exceeds the limit of %{size}MB",{size:$f.toString()})});return}l.value=URL.createObjectURL(x),w.value=!0}};St(l,async D=>{D&&(await In(),f.value&&f.value.destroy(),d.value&&(f.value=new Ra(d.value,{aspectRatio:1,viewMode:1,dragMode:"move",autoCropArea:.8,responsive:!0,background:!1,ready(){m.value=!0}}),u(f)))});const h=()=>f.value.getCroppedCanvas({width:256,height:256,imageSmoothingQuality:"high"}),S=async D=>await new Promise(N=>{D.toBlob(x=>N(x),"image/png")}),T=()=>{var D;(D=E.value)==null||D.click()},R=()=>{w.value=!1,$()},_=async()=>{const D=h(),N=await S(D),x=URL.createObjectURL(N),W=new File([N],"avatar.png",{type:"image/png",lastModified:Date.now()});try{await c.photos.updateOwnUserPhotoPatch(W),n.addAvatar(p(o).id,x),a({title:i("Profile picture was set successfully")})}catch(K){s({title:i("Failed to set profile picture"),errors:[K]})}w.value=!1,$()},A=async()=>{try{await c.photos.deleteOwnUserPhoto(),n.removeAvatar(p(o).id),a({title:i("Profile picture was removed successfully")})}catch(D){s({title:i("Failed to remove profile picture"),errors:[D]})}y.value=!1},$=()=>{var D;(D=f.value)==null||D.destroy(),f.value=null,E.value&&(E.value.value=""),l.value=null};return(D,N)=>{const x=he("oc-button"),W=he("oc-icon"),K=he("oc-modal");return X(),pe("div",DD,[fe("input",{ref_key:"fileInputRef",ref:E,class:"oc-invisible avatar-file-input",type:"file",accept:"image/jpeg, image/png",onChange:v},null,544),fe("div",LD,[ge(ld,{class:"oc-mb-m",width:128,"user-id":p(o).id,"user-name":p(o).displayName},null,8,["user-id","user-name"]),fe("div",null,[fe("div",MD,[ge(x,{class:"avatar-upload-button",size:"small",onClick:T},{default:Se(()=>[Ot(H.toDisplayString(p(i)("Upload")),1)]),_:1}),g.value?(X(),Re(x,{key:0,class:"avatar-upload-remove-button",size:"small",onClick:N[0]||(N[0]=le=>y.value=!0)},{default:Se(()=>[Ot(H.toDisplayString(p(i)("Remove")),1)]),_:1})):Ce("",!0)])])]),w.value?(X(),Re(K,{key:0,title:p(i)("Crop your new profile picture"),"button-cancel-text":p(i)("Cancel"),"button-confirm-text":p(i)("Set"),"button-confirm-disabled":!m.value,"focus-trap-initial":!1,onCancel:R,onConfirm:_},{content:Se(()=>[l.value?(X(),pe("div",BD,[fe("img",{ref_key:"imageRef",ref:d,class:"avatar-upload-modal-image",src:l.value},null,8,jD),fe("div",UD,[ge(W,{class:"oc-mr-xs",name:"information",size:"small","fill-type":"line"}),fe("span",{textContent:H.toDisplayString(p(i)("Zoom via %{ zoomKeys }, pan via %{ panKeys }",{zoomKeys:p(i)("+-"),panKeys:p(i)("↑↓←→")}))},null,8,qD)])])):Ce("",!0)]),_:1},8,["title","button-cancel-text","button-confirm-text","button-confirm-disabled"])):Ce("",!0),y.value?(X(),Re(K,{key:1,message:p(i)("Are you sure you want to remove your profile picture?"),title:p(i)("Remove profile picture"),"button-cancel-text":p(i)("Cancel"),"button-confirm-text":p(i)("Remove"),onCancel:N[1]||(N[1]=le=>y.value=!1),onConfirm:A},null,8,["message","title","button-cancel-text","button-confirm-text"])):Ce("",!0)])}}}),zD=850,WD=xe({components:{UserAvatar:ld,ContextMenuQuickAction:nd,ResourceGhostElement:rd,ResourceListItem:ko,ResourceSize:b0,ResourceStatusIndicators:U0,OcSpinner:vD,OcTable:$D},props:{resources:{type:Array,required:!0},resourceDomSelector:{type:Function,required:!1,default:e=>Z.extractDomSelector(e.id)},arePathsDisplayed:{type:Boolean,required:!1,default:!1},areThumbnailsDisplayed:{type:Boolean,required:!1,default:!0},selectedIds:{type:Array,default:()=>[]},hasActions:{type:Boolean,required:!1,default:!0},showRenameQuickAction:{type:Boolean,required:!1,default:!0},targetRouteCallback:{type:Function,required:!1,default:void 0},areResourcesClickable:{type:Boolean,required:!1,default:!0},headerPosition:{type:Number,required:!1,default:0},isSelectable:{type:Boolean,required:!1,default:!0},isSideBarOpen:{type:Boolean,required:!1,default:!1},paddingX:{type:String,required:!1,default:"small",validator:e=>/(xsmall|small|medium|large|xlarge)/.test(e)},dragDrop:{type:Boolean,required:!1,default:!1},viewMode:{type:String,default:()=>Jt.defaultModeName,validator:e=>[Jt.name.condensedTable,Jt.name.table].includes(e)},hover:{type:Boolean,required:!1,default:!0},sortBy:{type:String,required:!1,default:void 0},fieldsDisplayed:{type:Array,required:!1,default:null},sortDir:{type:String,required:!1,default:void 0,validator:e=>e===void 0||[zt.Asc.toString(),zt.Desc.toString()].includes(e)},space:{type:Object,required:!1,default:null},resourceType:{type:String,default:"file"},lazy:{type:Boolean,default:!0},groupingSettings:{type:Object,required:!1,default:null}},emits:["fileClick","sort","rowMounted",Nf,"update:selectedIds","update:modelValue"],setup(e,t){const n=He(),r=sn(),{getMatchingSpace:o}=un(),{canBeOpenedWithSecureView:i}=Yf(),s=ui({space:ce(e.space),targetRouteCallback:B(()=>e.targetRouteCallback)}),{isSticky:a}=Gf(),{$gettext:c}=Fe.useGettext(),{isLocationPicker:u,isFilePicker:l,postMessage:d,isEnabled:f,fileTypes:m}=si(),{getDefaultAction:w}=Xn(),y=st(),{options:E}=Ue.storeToRefs(y),b=Ro(),{resources:g,action:v}=Ue.storeToRefs(b),h=ei(),{userContextReady:S}=Ue.storeToRefs(h),T=Qe(),{areFileExtensionsShown:R,latestSelectedId:_,deleteQueue:A}=Ue.storeToRefs(T),$=ce(),D=ce(),N=ce(),{width:x}=Vr.useWindowSize(),W=B(()=>r.filesTags&&x.value>=zD),K=Kn(Tn,"files-trash-overview"),{actions:le}=pa(),{actions:be}=Xv(),te=B(()=>p(le)[0].handler),ae=B(()=>p(be)[0].handler),ue=z=>c("Search for tag %{tag}",{tag:z}),ie=z=>{var q;return p(f)&&((q=p(m))!=null&&q.length)?!p(m).includes(z.extension)&&!p(m).includes(z.mimeType)&&!z.isFolder:z.processing===!0||F(z.id)},G=B(()=>{var z,q;return((q=(z=e.resources)==null?void 0:z.filter(M=>ie(M)===!0))==null?void 0:q.map(M=>M.id))||[]}),re=z=>!e.areResourcesClickable||Z.isProjectSpaceResource(z)&&z.disabled||!z.isFolder&&(!z.canDownload()&&!i(z)||p(f)&&!p(l))?!1:!p(G).includes(z.id),se=z=>{Ke.publish("app.files.list.clicked"),t.emit("update:selectedIds",z)},Ie=z=>{T.toggleSelection(z),se(T.selectedIds)},ee=z=>{if(z.isFolder)return s.getFolderLink(z);let q=e.space;q||(q=o(z));const M=w({resources:[z],space:q});if(M!=null&&M.route)return M.route({space:q,resources:[z]})},F=z=>p(A).includes(z),C=z=>p(K)&&Z.isProjectSpaceResource(z)&&z.disabled?!1:!ie(z);return{router:n,configOptions:E,dragItem:$,ghostElement:D,contextMenuButton:N,getTagToolTip:ue,renameActions:le,renameActionsSpace:be,renameHandler:te,renameHandlerSpace:ae,FolderViewModeConstants:Jt,hasTags:W,disabledResources:G,isResourceDisabled:ie,userContextReady:S,getMatchingSpace:o,clipboardResources:g,clipboardAction:v,...ma({space:ce(e.space),targetRouteCallback:B(()=>e.targetRouteCallback)},t),...s,postMessage:d,isFilePicker:l,isLocationPicker:u,isEmbedModeEnabled:f,emitSelect:se,toggleSelection:Ie,areFileExtensionsShown:R,latestSelectedId:_,isResourceClickable:re,getResourceLink:ee,isSticky:a,isResourceInDeleteQueue:F,ShareTypes:Z.ShareTypes,showContextDrop:C}},data(){return{constants:{ImageDimension:Qn,EVENT_TROW_MOUNTED:Rv}}},computed:{fields(){if(this.resources.length===0)return[];const e=this.resources[0],t=[];this.isSelectable&&t.push({name:"select",title:"",type:"slot",headerType:"slot",width:"shrink"});const n=Oh(e);return t.push(...[{name:"name",title:this.$gettext("Name"),type:"slot",width:"expand",wrap:"truncate"},{name:"manager",prop:"members",title:this.$gettext("Manager"),type:"slot"},{name:"members",title:this.$gettext("Members"),prop:"members",type:"slot"},{name:"totalQuota",prop:"spaceQuota.total",title:this.$gettext("Total quota"),type:"slot",sortable:!0},{name:"usedQuota",prop:"spaceQuota.used",title:this.$gettext("Used quota"),type:"slot",sortable:!0},{name:"remainingQuota",prop:"spaceQuota.remaining",title:this.$gettext("Remaining quota"),type:"slot",sortable:!0},{name:"indicators",title:this.$gettext("Status"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"size",title:this.$gettext("Size"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"syncEnabled",title:this.$gettext("Info"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"tags",title:this.$gettext("Tags"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedBy",title:this.$gettext("Shared by"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"sharedWith",title:this.$gettext("Shared with"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"},{name:"mdate",title:this.$gettext("Modified"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:r=>this.formatDateRelative(r.mdate)+" ("+this.formatDate(r.mdate)+")"},{name:"sdate",title:this.$gettext("Shared on"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:r=>this.formatDateRelative(r.sdate)+" ("+this.formatDate(r.sdate)+")"},{name:"ddate",title:this.$gettext("Deleted"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink",accessibleLabelCallback:r=>this.formatDateRelative(r.ddate)+" ("+this.formatDate(r.ddate)+")"}].filter(r=>{if(r.name==="tags"&&!this.hasTags)return!1;if(r.name==="indicators")return!0;let o;return r.prop?o=Bl(e,r.prop)!==void 0:o=Object.prototype.hasOwnProperty.call(e,r.name),this.fieldsDisplayed?o&&this.fieldsDisplayed.includes(r.name):o}).map(r=>{const o=n.find(i=>i.name===r.name);return o&&Object.assign(r,{sortable:o.sortable,sortDir:o.sortDir}),r})),this.hasActions&&t.push({name:"actions",title:this.$gettext("Actions"),type:"slot",alignH:"right",wrap:"nowrap",width:"shrink"}),t},areAllResourcesSelected(){const e=this.disabledResources.length===this.resources.length,t=this.selectedResources.length===this.resources.length-this.disabledResources.length;return!e&&t},selectAllCheckboxLabel(){return this.areAllResourcesSelected?this.$gettext("Clear selection"):this.$gettext("Select all")},selectedResources(){return this.resources.filter(e=>this.selectedIds.includes(e.id))},contextMenuLabel(){return this.$gettext("Show context menu")},dragSelection(){const e=[...this.selectedResources];return e.splice(e.findIndex(t=>t.id===this.dragItem.id),1),e}},methods:{isResourceSelected(e){return this.selectedIds.includes(e.id)},isResourceCut(e){return this.clipboardAction!==ii.Cut?!1:this.clipboardResources.some(t=>t.id===e.id)},getTagLink(e){var n;const t=(n=p(this.router.currentRoute).query)==null?void 0:n.term;return Ci("files-common-search",{query:{provider:"files.sdk",q_tags:e,...t&&{term:t}}})},getTagComponentAttrs(e){return this.userContextReady?{to:this.getTagLink(e)}:{}},isLatestSelectedItem(e){return e.id===this.latestSelectedId},hasRenameAction(e){return this.showRenameQuickAction?Z.isProjectSpaceResource(e)?this.renameActionsSpace.filter(t=>t.isVisible({resources:[e]})).length:this.renameActions.filter(t=>t.isVisible({space:this.space,resources:[e]})).length:!1},openRenameDialog(e){if(Z.isProjectSpaceResource(e))return this.renameHandlerSpace({resources:[e]});this.renameHandler({space:this.getMatchingSpace(e),resources:[e]})},openTagsSidebar(){Ke.publish(Tt.open)},openSharingSidebar(e){let t;e.type==="space"?t="space-share":t="sharing",Ke.publish(Tt.openWithPanel,t)},async fileDragged(e,t){this.dragDrop&&(await this.setDragItem(e,t),this.addSelectedResource(e))},fileDropped(e,t){if(!this.dragDrop||(t.dataTransfer.types||[]).some(s=>s==="Files"))return;this.dragItem=null;const i=t.target.closest("tr").dataset.itemId;this.dropRowStyling(e,!0,t),this.$emit(Nf,i)},async setDragItem(e,t){this.dragItem=e,await this.$nextTick(),this.ghostElement.$el.ariaHidden="true",this.ghostElement.$el.style.left="-99999px",this.ghostElement.$el.style.top="-99999px",t.dataTransfer.setDragImage(this.ghostElement.$el,0,0),t.dataTransfer.dropEffect="move",t.dataTransfer.effectAllowed="move"},dropRowStyling(e,t,n){var s,a;if((((s=n.dataTransfer)==null?void 0:s.types)||[]).some(c=>c==="Files")||(a=n.currentTarget)!=null&&a.contains(n.relatedTarget))return;const o=document.getElementsByClassName(`oc-tbody-tr-${e}`)[0].classList,i="highlightedDropTarget";t?o.remove(i):o.add(i)},sort(e){this.$emit("sort",e)},addSelectedResource(e){this.isResourceSelected(e)||this.toggleSelection(e.id)},showContextMenuOnBtnClick(e,t){if(this.isResourceDisabled(t))return!1;const{dropdown:n,event:r}=e;(n==null?void 0:n.tippy)!==void 0&&(this.isResourceSelected(t)||this.emitSelect([t.id]),To(n.tippy,r,this.contextMenuButton))},showContextMenu(e,t,n){if(t.preventDefault(),this.isResourceDisabled(n))return!1;const r=e.$el.getElementsByClassName("resource-table-btn-action-dropdown")[0];r!==void 0&&(this.isResourceSelected(n)||this.emitSelect([n.id]),To(r._tippy,t,this.contextMenuButton))},rowMounted(e,t){this.$emit("rowMounted",e,t,this.constants.ImageDimension.Thumbnail)},fileClicked(e){var s,a;const t=e[0];if(this.isResourceDisabled(t))return;if(this.isEmbedModeEnabled&&this.isFilePicker&&!t.isFolder)return this.postMessage("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(t)),locationQuery:JSON.parse(JSON.stringify(na(p(this.router.currentRoute))))});const n=e[1],r=e[2]??!1;!n.shiftKey&&!n.metaKey&&!n.ctrlKey&&Ke.publish("app.files.shiftAnchor.reset");const o=(n==null?void 0:n.target).getAttribute("type")==="checkbox";if(((a=(s=n==null?void 0:n.target)==null?void 0:s.closest("div"))==null?void 0:a.id)!=="oc-files-context-menu"){if(n&&n.metaKey)return Ke.publish("app.files.list.clicked.meta",t);if(n&&n.shiftKey)return Ke.publish("app.files.list.clicked.shift",{resource:t,skipTargetSelection:r});if(!o&&!this.isResourceSelected(t))return this.emitSelect([t.id])}},formatDate(e){return Ib(new Date(e),this.$language.current)},formatDateRelative(e){return Pb(new Date(e),this.$language.current)},toggleSelectionAll(){if(this.areAllResourcesSelected)return this.emitSelect([]);this.emitSelect(this.resources.filter(e=>!this.disabledResources.includes(e.id)).map(e=>e.id))},emitFileClick(e){const t=this.getMatchingSpace(e);this.$emit("fileClick",{space:t,resources:[e]})},getResourceCheckboxLabel(e){return e.type==="folder"?this.$gettext("Select folder"):this.$gettext("Select file")},getSharedWithAvatarDescription(e){if(!Z.isShareResource(e))return;const t=e.type==="folder"?this.$gettext("folder"):this.$gettext("file"),n=e.sharedWith.filter(({shareType:r})=>Z.ShareTypes.authenticated.includes(Z.ShareTypes.getByValue(r))).length;return n?this.$ngettext("This %{ resourceType } is shared via %{ shareCount } invite","This %{ resourceType } is shared via %{ shareCount } invites",n,{resourceType:t,shareCount:n.toString()}):""},getSharedByAvatarDescription(e){if(!Z.isShareResource(e))return"";const t=e.type==="folder"?this.$gettext("folder"):this.$gettext("file");return this.$gettext("This %{ resourceType } is shared by %{ user }",{resourceType:t,user:e.sharedBy.map(({displayName:n})=>n).join(", ")})},getSharedByAvatarItems(e){return Z.isShareResource(e)?e.sharedBy.map(t=>({displayName:t.displayName,name:t.displayName,avatarType:Z.ShareTypes.user.key,username:t.id,userId:t.id})):[]},getSharedWithAvatarItems(e){return Z.isShareResource(e)?e.sharedWith.filter(({shareType:t})=>Z.ShareTypes.authenticated.includes(Z.ShareTypes.getByValue(t))).map(t=>({displayName:t.displayName,name:t.displayName,avatarType:Z.ShareTypes.getByValue(t.shareType).key,username:t.id,userId:t.id})):[]}}}),HD={class:"resource-table-select-all"},GD={class:"oc-text-truncate"},KD=["textContent"],QD=["textContent"],XD=["textContent"],YD={key:0,class:"resource-table-actions"};function JD(e,t,n,r,o,i){const s=he("oc-checkbox"),a=he("oc-spinner"),c=he("resource-list-item"),u=he("oc-icon"),l=he("oc-button"),d=he("resource-size"),f=he("oc-tag"),m=he("resource-status-indicators"),w=he("user-avatar"),y=he("oc-avatars"),E=he("context-menu-quick-action"),b=he("oc-table"),g=he("resource-ghost-element"),v=ln("oc-tooltip");return X(),pe(qe,null,[ge(b,Gt(e.$attrs,{id:"files-space-table",class:[{condensed:e.viewMode===e.FolderViewModeConstants.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.fields,highlighted:e.selectedIds,disabled:e.disabledResources,sticky:e.isSticky,"header-position":e.headerPosition,"drag-drop":e.dragDrop,hover:e.hover,"item-dom-selector":e.resourceDomSelector,selection:e.selectedResources,"sort-by":e.sortBy,"sort-dir":e.sortDir,lazy:e.lazy,"grouping-settings":e.groupingSettings,"padding-x":"medium",onHighlight:e.fileClicked,onRowMounted:e.rowMounted,onContextmenuClicked:e.showContextMenu,onItemDropped:e.fileDropped,onItemDragged:e.fileDragged,onDropRowStyling:e.dropRowStyling,onSort:e.sort,"onUpdate:modelValue":t[0]||(t[0]=h=>e.$emit("update:modelValue",h))}),op({name:Se(({item:h})=>[fe("div",{class:H.normalizeClass(["resource-table-resource-wrapper",[{"resource-table-resource-wrapper-limit-max-width":e.hasRenameAction(h)}]])},[Xe(e.$slots,"image",{resource:h}),(X(),Re(c,{key:`${h.path}-${e.resourceDomSelector(h)}-${h.thumbnail}`,resource:h,"path-prefix":e.getPathPrefix(h),"is-path-displayed":e.arePathsDisplayed,"parent-folder-name":e.getParentFolderName(h),"is-icon-displayed":!e.$slots.image,"is-extension-displayed":e.areFileExtensionsShown,"is-resource-clickable":e.isResourceClickable(h),link:e.getResourceLink(h),"parent-folder-link":e.getParentFolderLink(h),"parent-folder-link-icon-additional-attributes":e.getParentFolderLinkIconAdditionalAttributes(h),class:H.normalizeClass({"resource-table-resource-cut":e.isResourceCut(h)}),onClick:S=>e.emitFileClick(h)},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"])),e.hasRenameAction(h)?(X(),Re(l,{key:0,class:"resource-table-edit-name raw-hover-surface oc-p-xs",appearance:"raw",onClick:S=>e.openRenameDialog(h)},{default:Se(()=>[ge(u,{name:"edit-2","fill-type":"line",size:"small"})]),_:2},1032,["onClick"])):Ce("",!0)],2),Xe(e.$slots,"additionalResourceContent",{resource:h})]),syncEnabled:Se(({item:h})=>[Xe(e.$slots,"syncEnabled",{resource:h})]),size:Se(({item:h})=>[ge(d,{size:h.size||Number.NaN},null,8,["size"])]),tags:Se(({item:h})=>[(X(!0),pe(qe,null,wt(h.tags.slice(0,2),S=>(X(),Re(Nr(e.userContextReady?"router-link":"span"),Gt({key:S},{ref_for:!0},e.getTagComponentAttrs(S),{class:"resource-table-tag-wrapper"}),{default:Se(()=>[ot((X(),Re(f,{class:"resource-table-tag oc-ml-xs",rounded:!0,size:"small"},{default:Se(()=>[ge(u,{name:"price-tag-3",size:"small"}),fe("span",GD,H.toDisplayString(S),1)]),_:2},1024)),[[v,e.getTagToolTip(S)]])]),_:2},1040))),128)),h.tags.length>2?(X(),Re(f,{key:0,size:"small",class:"resource-table-tag-more",onClick:e.openTagsSidebar},{default:Se(()=>[Ot(" + "+H.toDisplayString(h.tags.length-2),1)]),_:2},1032,["onClick"])):Ce("",!0)]),manager:Se(({item:h})=>[Xe(e.$slots,"manager",{resource:h})]),members:Se(({item:h})=>[Xe(e.$slots,"members",{resource:h})]),totalQuota:Se(({item:h})=>[Xe(e.$slots,"totalQuota",{resource:h})]),usedQuota:Se(({item:h})=>[Xe(e.$slots,"usedQuota",{resource:h})]),remainingQuota:Se(({item:h})=>[Xe(e.$slots,"remainingQuota",{resource:h})]),mdate:Se(({item:h})=>[ot(fe("span",{tabindex:"0",textContent:H.toDisplayString(e.formatDateRelative(h.mdate))},null,8,KD),[[v,e.formatDate(h.mdate)]])]),indicators:Se(({item:h})=>[ge(m,{space:e.space,resource:h,"disable-handler":e.isResourceDisabled(h)},null,8,["space","resource","disable-handler"])]),sdate:Se(({item:h})=>[ot(fe("span",{tabindex:"0",textContent:H.toDisplayString(e.formatDateRelative(h.sdate))},null,8,QD),[[v,e.formatDate(h.sdate)]])]),ddate:Se(({item:h})=>[ot(fe("p",{tabindex:"0",class:"oc-m-rm",textContent:H.toDisplayString(e.formatDateRelative(h.ddate))},null,8,XD),[[v,e.formatDate(h.ddate)]])]),sharedBy:Se(({item:h})=>[ge(l,{appearance:"raw-inverse",class:"resource-table-shared-by","no-hover":"",onClick:S=>e.openSharingSidebar(h)},{default:Se(()=>[ge(y,{class:"resource-table-people","is-tooltip-displayed":!0,items:e.getSharedByAvatarItems(h),"accessible-description":e.getSharedByAvatarDescription(h),"hover-effect":""},{userAvatars:Se(({avatars:S,width:T})=>[(X(!0),pe(qe,null,wt(S,R=>(X(),Re(w,{key:R.userId,"user-id":R.userId,"user-name":R.displayName,width:T},null,8,["user-id","user-name","width"]))),128))]),_:2},1032,["items","accessible-description"])]),_:2},1032,["onClick"])]),sharedWith:Se(({item:h})=>[ge(l,{appearance:"raw-inverse",class:"resource-table-shared-with","no-hover":"",onClick:S=>e.openSharingSidebar(h)},{default:Se(()=>[ge(y,{class:"resource-table-people",items:e.getSharedWithAvatarItems(h),stacked:!0,"max-displayed":3,"is-tooltip-displayed":!0,"accessible-description":e.getSharedWithAvatarDescription(h),"hover-effect":""},{userAvatars:Se(({avatars:S,width:T})=>[(X(!0),pe(qe,null,wt(S,R=>(X(),Re(w,{key:R.userId,"user-id":R.userId,"user-name":R.displayName,width:T},null,8,["user-id","user-name","width"]))),128))]),_:2},1032,["items","accessible-description"])]),_:2},1032,["onClick"])]),actions:Se(({item:h})=>[e.showContextDrop(h)?(X(),pe("div",YD,[Xe(e.$slots,"quickActions",{resource:h}),ge(E,{ref:"contextMenuButton",item:h,"resource-dom-selector":e.resourceDomSelector,class:"resource-table-btn-action-dropdown",onQuickActionClicked:S=>e.showContextMenuOnBtnClick(S,h)},{contextMenu:Se(({isOpen:S})=>[Xe(e.$slots,"contextMenu",{resource:h,isOpen:S})]),_:2},1032,["item","resource-dom-selector","onQuickActionClicked"])])):Ce("",!0)]),_:2},[!e.isLocationPicker&&!e.isFilePicker?{name:"selectHeader",fn:Se(()=>[fe("div",HD,[ot(ge(s,{id:"resource-table-select-all",size:"large",label:e.selectAllCheckboxLabel,disabled:e.resources.length===e.disabledResources.length,"label-hidden":!0,"model-value":e.areAllResourcesSelected,onClick:Pn(e.toggleSelectionAll,["stop"])},null,8,["label","disabled","model-value","onClick"]),[[v,{content:e.selectAllCheckboxLabel,placement:"bottom"}]])])]),key:"0"}:void 0,!e.isLocationPicker&&!e.isFilePicker?{name:"select",fn:Se(({item:h})=>[e.isResourceInDeleteQueue(h.id)?(X(),Re(a,{key:0,class:"resource-table-activity-indicator",size:"medium","aria-label":e.$gettext("File is being processed")},null,8,["aria-label"])):(X(),Re(s,{key:1,id:`resource-table-select-${e.resourceDomSelector(h)}`,label:e.getResourceCheckboxLabel(h),"label-hidden":!0,size:"large",disabled:e.isResourceDisabled(h),"model-value":e.isResourceSelected(h),outline:e.isLatestSelectedItem(h),onClick:Pn(S=>e.toggleSelection(h.id),["stop"])},null,8,["id","label","disabled","model-value","outline","onClick"]))]),key:"1"}:void 0,e.$slots.footer?{name:"footer",fn:Se(()=>[Xe(e.$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","grouping-settings","onHighlight","onRowMounted","onContextmenuClicked","onItemDropped","onItemDragged","onDropRowStyling","onSort"]),e.dragItem?(X(),Re(Zd,{key:0,to:"body"},[ge(g,{ref:"ghostElement","preview-items":[e.dragItem,...e.dragSelection]},null,8,["preview-items"])])):Ce("",!0)],64)}const ZD=We(WD,[["render",JD]]),eL=["data-item-id"],tL={key:0,class:"oc-tile-card-lazy-shimmer"},nL={class:"oc-tile-card-selection"},rL={key:0,class:"oc-tile-card-loading-spinner oc-m-s"},iL=["textContent"],oL=["aria-label"],sL={class:"oc-card-body oc-p-s"},aL={class:"oc-flex oc-flex-between oc-flex-middle"},lL={class:"oc-flex oc-flex-middle oc-text-truncate resource-name-wrapper"},cL={class:"oc-flex oc-flex-middle"},uL={key:0,class:"oc-text-left oc-my-rm oc-text-truncate"},fL=["textContent"],q0=xe({__name:"ResourceTile",props:{resource:{},resourceRoute:{},isResourceSelected:{type:Boolean,default:!1},isResourceClickable:{type:Boolean,default:!0},isResourceDisabled:{type:Boolean,default:!1},isExtensionDisplayed:{type:Boolean,default:!0},resourceIconSize:{default:"xlarge"},lazy:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1}},emits:["click","contextmenu","itemVisible"],setup(e,{emit:t}){const n=t,{$gettext:r}=Fe.useGettext(),o=Md((d,f)=>{let m;return{get(){return d(),m},set(w){m=w,f()}}}),i=B(()=>e.resource.locked||e.resource.processing),s=B(()=>e.resource.locked?{name:"lock",fillType:"fill"}:e.resource.processing?{name:"loop-right",fillType:"line"}:{}),a=B(()=>e.resource.locked?r("This item is locked"):null),c=B(()=>Z.isSpaceResource(e.resource)?e.resource.description:""),{isVisible:u}=e.lazy?D0({target:o,onVisibleCallback:()=>n("itemVisible")}):{isVisible:ce(!0)},l=B(()=>!p(u));return e.lazy||n("itemVisible"),(d,f)=>{const m=he("oc-spinner"),w=he("oc-tag"),y=he("oc-image"),E=he("oc-icon"),b=ln("oc-tooltip");return X(),pe("div",{ref_key:"observerTarget",ref:o,class:H.normalizeClass(["oc-tile-card oc-card",{"oc-tile-card-selected":d.isResourceSelected,"oc-tile-card-disabled":d.isResourceDisabled&&!p(Z.isProjectSpaceResource)(d.resource),"state-trashed":d.isResourceDisabled&&p(Z.isProjectSpaceResource)(d.resource)}]),"data-item-id":d.resource.id,onContextmenu:f[2]||(f[2]=g=>d.$emit("contextmenu",g))},[l.value?(X(),pe("div",tL)):(X(),pe(qe,{key:1},[ge(zf,{class:"oc-card-media-top oc-flex oc-flex-center oc-flex-middle oc-m-rm",resource:d.resource,link:d.resourceRoute,"is-resource-clickable":d.isResourceClickable,tabindex:"-1",onClick:f[0]||(f[0]=g=>d.$emit("click"))},{default:Se(()=>[fe("div",nL,[d.isLoading?(X(),pe("div",rL,[ge(m,{"aria-label":p(r)("File is being processed")},null,8,["aria-label"])])):Xe(d.$slots,"selection",{key:1,item:d.resource})]),d.isResourceDisabled&&p(Z.isProjectSpaceResource)(d.resource)?(X(),Re(w,{key:0,class:"resource-disabled-indicator oc-position-absolute",type:"span"},{default:Se(()=>[fe("span",{textContent:H.toDisplayString(p(r)("Disabled"))},null,8,iL)]),_:1})):Ce("",!0),ot((X(),pe("div",{class:"oc-tile-card-preview oc-flex oc-flex-middle oc-flex-center","aria-label":a.value},[Xe(d.$slots,"imageField",{item:d.resource},()=>[d.resource.thumbnail?(X(),Re(y,{key:0,class:"tile-preview",src:d.resource.thumbnail},null,8,["src"])):(X(),Re(Oo,{key:1,resource:d.resource,size:d.resourceIconSize,class:"tile-default-image oc-pt-xs"},op({_:2},[i.value?{name:"status",fn:Se(()=>[ge(E,Gt(s.value,{size:"xsmall"}),null,16)]),key:"0"}:void 0]),1032,["resource","size"]))])],8,oL)),[[b,a.value]])]),_:3},8,["resource","link","is-resource-clickable"]),fe("div",sL,[fe("div",aL,[fe("div",lL,[ge(ko,{resource:d.resource,"is-icon-displayed":!1,"is-extension-displayed":d.isExtensionDisplayed,"is-resource-clickable":d.isResourceClickable,link:d.resourceRoute,onClick:f[1]||(f[1]=g=>d.$emit("click"))},null,8,["resource","is-extension-displayed","is-resource-clickable","link"])]),fe("div",cL,[Xe(d.$slots,"indicators",{item:d.resource,class:"resource-indicators"}),Xe(d.$slots,"actions",{item:d.resource}),Xe(d.$slots,"contextMenu",{item:d.resource})])]),c.value?(X(),pe("p",uL,[fe("small",{textContent:H.toDisplayString(c.value)},null,8,fL)])):Ce("",!0)])],64))],42,eL)}}}),dL={id:"tiles-view",class:"oc-px-m oc-pt-l"},pL={class:"oc-flex oc-flex-middle oc-mb-s oc-pb-s oc-tiles-controls"},hL={key:0,class:"oc-tiles-sort"},gL={key:0,class:"oc-flex"},mL={class:"oc-tiles-footer"},yL=xe({__name:"ResourceTiles",props:{resources:{default:()=>[]},selectedIds:{default:()=>[]},targetRouteCallback:{type:Function},space:{},sortFields:{default:()=>[]},sortBy:{},sortDir:{},viewSize:{default:()=>Jt.tilesSizeDefault},dragDrop:{type:Boolean,default:!1},lazy:{type:Boolean,default:!0}},emits:["fileDropped","rowMounted","sort","itemVisible","update:selectedIds"],setup(e,{emit:t}){const n=t,{$gettext:r}=Fe.useGettext(),o=He(),i=Qe(),{getDefaultAction:s}=Xn(),{getMatchingSpace:a}=un(),{canBeOpenedWithSecureView:c}=Yf(),{isEnabled:u,fileTypes:l,isLocationPicker:d,isFilePicker:f,postMessage:m}=si(),w=Jf(),y=B(()=>Math.min(p(w),e.viewSize)),E=B(()=>i.areFileExtensionsShown),b=B(()=>p($e)?r("Clear selection"):r("Select all")),g=ce(),v=ce(),h=ce({tiles:{},dropBtns:{}}),S=ma({space:ce(e.space),targetRouteCallback:B(()=>e.targetRouteCallback)},{emit:n}),T=Y=>{if(Z.isSpaceResource(Y))return Y.disabled?null:Nn("files-spaces-generic",ir(Y,{path:"",fileId:Y.fileId}));if(Y.isFolder)return S.createFolderLink({path:Y.path,fileId:Y.fileId,resource:Y});let Pe=e.space;Pe||(Pe=a(Y));const Ne=s({resources:[Y],space:Pe});return Ne!=null&&Ne.route?Ne.route({space:Pe,resources:[Y]}):null},R=Y=>{if(p(u)&&p(f))return m("opencloud-embed:file-pick",{resource:JSON.parse(JSON.stringify(Y)),locationQuery:JSON.parse(JSON.stringify(na(p(o.currentRoute))))});Y.type!=="space"&&Y.type!=="folder"&&S.createFileAction(Y)},_=(Y,Pe,Ne)=>{const{dropdown:Ve,event:et}=Y;(Ve==null?void 0:Ve.tippy)!==void 0&&(i.setSelection([Pe.id]),To(Ve.tippy,et,p(h).dropBtns[Ne]))},A=Y=>e.selectedIds.includes(Y.id),$=B(()=>e.resources.filter(Y=>e.selectedIds.includes(Y.id))),D=Y=>N(Y)||x(Y)?!1:Y.isFolder?!0:!(!Y.canDownload()&&!c(Y)||p(u)&&!p(f)),N=Y=>{var Pe;return p(u)&&((Pe=p(l))!=null&&Pe.length)?!p(l).includes(Y.extension)&&!p(l).includes(Y.mimeType)&&!Y.isFolder:Me(Y.id)?!0:Y.processing===!0},x=Y=>N(Y)?!0:Z.isSpaceResource(Y)&&Y.disabled,W=B(()=>{var Y,Pe;return((Pe=(Y=e.resources)==null?void 0:Y.filter(Ne=>N(Ne)===!0))==null?void 0:Pe.map(Ne=>Ne.id))||[]}),K=Y=>{n("update:selectedIds",Y)},le=()=>{if(p($e))return n("update:selectedIds",[]);n("update:selectedIds",e.resources.filter(Y=>!p(W).includes(Y.id)).map(Y=>Y.id))},be=(Y,Pe,Ne)=>{var et;Y.preventDefault();const Ve=(et=p(h).tiles[Pe.id])==null?void 0:et.$el.getElementsByClassName("resource-tiles-btn-action-dropdown")[0];Ve!==void 0&&(A(Pe)||K([Pe.id]),To(Ve._tippy,Y,Ne))},te=Y=>{const Pe=Y[0],Ne=Y[1];if(Ne&&Ne.metaKey)return Ke.publish("app.files.list.clicked.meta",Pe);if(!Ne.shiftKey&&!Ne.metaKey&&!Ne.ctrlKey&&Ke.publish("app.files.shiftAnchor.reset"),Ne&&Ne.shiftKey)return Ke.publish("app.files.list.clicked.shift",{resource:Pe,skipTargetSelection:!1});ae(Pe)},ae=Y=>{const Pe=A(Y)?e.selectedIds.filter(Ne=>Ne!==Y.id):[...e.selectedIds,Y.id];n("update:selectedIds",Pe)},ue=Y=>{switch(Y.type){case"folder":return r("Select folder");case"space":return r("Select space");default:return r("Select file")}},ie=B(()=>e.sortFields.find(Y=>Y.name===e.sortBy&&Y.sortDir===e.sortDir)||e.sortFields[0]),G=Y=>{n("sort",{sortBy:Y.name,sortDir:Y.sortDir})},re=B(()=>{const Y={1:"xlarge",2:"xlarge",3:"xxlarge",4:"xxlarge",5:"xxxlarge",6:"xxxlarge"},Pe=p(y);return Y[Pe]??"xxlarge"});gS(()=>{h.value={tiles:{},dropBtns:{}}});const se=(Y,Pe,Ne)=>{var Nt,_t;if((((Nt=Ne.dataTransfer)==null?void 0:Nt.types)||[]).some($t=>$t==="Files")||(_t=Ne.currentTarget)!=null&&_t.contains(Ne.relatedTarget)||e.selectedIds.includes(Y.id)||Y.type!=="folder")return;const et=p(h).tiles[Y.id];if(Pe){et.$el.classList.remove("oc-tiles-item-drop-highlight");return}et.$el.classList.add("oc-tiles-item-drop-highlight")},Ie=B(()=>e.selectedIds.filter(Y=>Y!==p(g).id)),ee=async(Y,Pe)=>{g.value=Y,await In(),p(v).$el.ariaHidden="true",p(v).$el.style.left="-99999px",p(v).$el.style.top="-99999px",Pe.dataTransfer.setDragImage(p(v).$el,0,0),Pe.dataTransfer.dropEffect="move",Pe.dataTransfer.effectAllowed="move"},F=async(Y,Pe)=>{A(Y)||ae(Y),await ee(Y,Pe)},C=(Y,Pe)=>{(Pe.dataTransfer.types||[]).some(Ve=>Ve==="Files")||(g.value=null,se(Y,!0,Pe),n("fileDropped",Y.id))},z=ce(0),q=()=>{const Y=document.getElementById("tiles-view"),Pe=getComputedStyle(Y),Ne=parseInt(Pe.getPropertyValue("padding-left"),10)|0,Ve=parseInt(Pe.getPropertyValue("padding-right"),10)|0;z.value=Y.clientWidth-Ne-Ve},M=B(()=>parseFloat(getComputedStyle(document.documentElement).fontSize)),{calculateTileSizePixels:V}=r0(),de=B(()=>{const Y=[...Array(Jt.tilesSizeMax).keys()].map(Pe=>Pe+1);return[...new Set(Y.map(Pe=>{const Ne=V(Pe);return Ne?Math.round(p(z)/(Ne+p(M))):0}))]}),Te=B(()=>{const Y=p(de);return Y.length<p(y)?Y[Y.length-1]:Y[p(y)-1]}),Le=B(()=>{const Y=p(Te)?e.resources.length%p(Te):0;return Y?p(Te)-Y:0}),ke=B(()=>p(z)/p(Te)-p(M)),$e=B(()=>{const Y=p(W).length===e.resources.length,Pe=p($).length===e.resources.length-p(W).length;return!Y&&Pe}),Me=Y=>i.deleteQueue.includes(Y);return St(ke,Y=>{document.documentElement.style.setProperty("--oc-size-tiles-actual",`${Y}px`)},{immediate:!0}),St(de,Y=>{w.value=Math.max(Y.length,1)}),Bt(()=>{window.addEventListener("resize",q),q()}),Vn(()=>{window.removeEventListener("resize",q)}),(Y,Pe)=>{const Ne=he("oc-checkbox"),Ve=he("oc-icon"),et=he("oc-button"),Nt=he("oc-filter-chip"),_t=he("oc-list"),$t=ln("oc-tooltip");return X(),pe("div",dL,[fe("div",pL,[ot(ge(Ne,{id:"tiles-view-select-all",class:"oc-ml-s",size:"large",label:b.value,"label-hidden":!0,disabled:Y.resources.length===W.value.length,"model-value":$e.value,onClick:Pn(le,["stop"])},null,8,["label","disabled","model-value"]),[[$t,b.value]]),Y.sortFields.length?(X(),pe("div",hL,[ge(Nt,{class:"oc-tiles-sort-filter-chip","filter-label":ie.value.label,"selected-item-names":[],"close-on-click":"",raw:""},{default:Se(()=>[(X(!0),pe(qe,null,wt(Y.sortFields,(Be,ze)=>(X(),Re(et,{key:ze,appearance:"raw",size:"medium","justify-content":"space-between",class:H.normalizeClass(["oc-tiles-sort-filter-chip-item oc-flex oc-flex-middle oc-width-1-1 oc-p-s",{"oc-tiles-sort-filter-chip-item-active":ie.value===Be,"oc-mt-xs":ze>0}]),onClick:dn=>G(Be)},{default:Se(()=>[fe("span",null,H.toDisplayString(Be.label),1),Be===ie.value?(X(),pe("div",gL,[ge(Ve,{name:"check"})])):Ce("",!0)]),_:2},1032,["class","onClick"]))),128))]),_:1},8,["filter-label"])])):Ce("",!0)]),ge(_t,{class:"oc-tiles"},{default:Se(()=>[(X(!0),pe(qe,null,wt(Y.resources,Be=>(X(),pe("li",{key:Be.id,class:"oc-tiles-item has-item-context-menu"},[ge(q0,{ref_for:!0,ref:ze=>h.value.tiles[Be.id]=ze,resource:Be,"resource-route":T(Be),"is-resource-selected":A(Be),"is-resource-clickable":D(Be),"is-resource-disabled":N(Be)||x(Be),"is-extension-displayed":E.value,"resource-icon-size":re.value,draggable:Y.dragDrop,lazy:Y.lazy,"is-loading":Me(Be.id),onVnodeMounted:ze=>Y.$emit("rowMounted",Be,h.value.tiles[Be.id],p(Qn).Tile),onContextmenu:ze=>be(ze,Be,h.value.tiles[Be.id]),onClick:ze=>R(Be),onDragstart:ze=>F(Be,ze),onDragenter:Pn(ze=>se(Be,!1,ze),["prevent"]),onDragleave:Pn(ze=>se(Be,!0,ze),["prevent"]),onDrop:ze=>C(Be,ze),onDragover:Pe[0]||(Pe[0]=ze=>ze.preventDefault()),onItemVisible:ze=>Y.$emit("itemVisible",Be)},{selection:Se(()=>[!p(d)&&!p(f)?(X(),Re(Ne,{key:0,label:ue(Be),"label-hidden":!0,size:"large",class:"oc-flex-inline oc-p-s",disabled:N(Be),"model-value":A(Be),onClick:Pn(ze=>te([Be,ze]),["stop","prevent"])},null,8,["label","disabled","model-value","onClick"])):Ce("",!0)]),imageField:Se(()=>[Xe(Y.$slots,"image",{resource:Be})]),indicators:Se(()=>[ge(U0,{space:Y.space,resource:Be,filter:ze=>ze.category==="system","disable-handler":N(Be)},null,8,["space","resource","filter","disable-handler"])]),actions:Se(()=>[Xe(Y.$slots,"actions",{resource:Be})]),contextMenu:Se(()=>[p(Z.isSpaceResource)(Be)||!N(Be)?(X(),Re(p(nd),{key:0,ref_for:!0,ref:ze=>h.value.dropBtns[Be.id]=ze,item:Be,class:"resource-tiles-btn-action-dropdown",onQuickActionClicked:ze=>_(ze,Be,Be.id)},{contextMenu:Se(({isOpen:ze})=>[Xe(Y.$slots,"contextMenu",{resource:Be,isOpen:ze})]),_:2},1032,["item","onQuickActionClicked"])):Ce("",!0)]),_:2},1032,["resource","resource-route","is-resource-selected","is-resource-clickable","is-resource-disabled","is-extension-displayed","resource-icon-size","draggable","lazy","is-loading","onVnodeMounted","onContextmenu","onClick","onDragstart","onDragenter","onDragleave","onDrop","onItemVisible"])]))),128)),(X(!0),pe(qe,null,wt(Le.value,Be=>(X(),pe("li",{key:`ghost-tile-${Be}`,class:"ghost-tile","aria-hidden":!0}))),128))]),_:3}),g.value?(X(),Re(Zd,{key:0,to:"body"},[ge(rd,{ref_key:"ghostElementRef",ref:v,"preview-items":[g.value,...Ie.value]},null,8,["preview-items"])])):Ce("",!0),fe("div",mL,[Xe(Y.$slots,"footer")])])}}}),bL=xe({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=He(),{current:o}=Fe.useGettext(),i=Kt(),s=ce(),a=ce(e.items),c=ce(),u=ce(),l=ce(!1),d=ce(),f=`q_${e.filterName}`,m=an(f),w=N=>N[e.idAttribute],y=()=>r.push({query:{...Mi(p(i).query,[f]),...p(s)&&{[f]:w(p(s))}}}),E=N=>p(s)&&w(p(s))===w(N),b=()=>{c.value=void 0,u.value=void 0},g=async N=>{b(),E(N)?s.value=void 0:(s.value=N,p(d).hideDrop()),await y(),t("selectionChange",p(s))},v=()=>{s.value=void 0,l.value=!1,b(),t("selectionChange",p(s)),y()},h=()=>{a.value=e.items},S=()=>{l.value=!1},T=()=>{const N=Rt(p(m));if(!N)return;const x=e.items.find(W=>w(W)===N);if(x){s.value=x;return}if(p(R)){const W=N.replace("range:",""),K=Number(W.split(" - ")[0]),le=Number(W.split(" - ")[1]);c.value=qt.DateTime.fromMillis(K),u.value=qt.DateTime.fromMillis(le),s.value=p(A)}},R=B(()=>{var N;return(N=Rt(p(m)))==null?void 0:N.startsWith("range:")}),_=B(()=>!p(c)||!p(u)?!1:p(c)<=p(u)),A=B(()=>{if(!p(c)||!p(u))return null;const N=oi(p(c),o,qt.DateTime.DATE_SHORT),x=oi(p(u),o,qt.DateTime.DATE_SHORT),W=p(c).toMillis(),K=p(u).toMillis();return{[e.idAttribute]:`range:${W} - ${K}`,[e.displayNameAttribute]:`${N} - ${x}`}}),$=async()=>{s.value=p(A),await y(),p(d).hideDrop(),t("selectionChange",p(s))},D=({date:N,error:x},W)=>{if(x){console.error("date could not be set");return}const K=W==="from"?c:u;if(!N){K.value=void 0;return}const le=W==="from"?N.startOf("day"):N.endOf("day");K.value=le};return n({setSelectedItemsBasedOnQuery:T}),Bt(()=>{T()}),{clearFilter:v,displayedItems:a,isItemSelected:E,selectedItem:s,onShowDrop:h,onHideDrop:S,filterChip:d,toggleItemSelection:g,setSelectedItemsBasedOnQuery:T,fromDate:c,toDate:u,dateRangeValid:_,applyDateRangeFilter:$,dateRangeApplied:R,setDateRangeDate:D,dateRangeClicked:l,queryParam:f}}}),vL={class:"oc-flex oc-flex-middle oc-text-truncate"},wL={class:"oc-text-truncate oc-ml-s"},SL={class:"oc-flex"},EL={class:"oc-my-xs"},TL={class:"oc-flex oc-flex-middle oc-text-truncate"},AL={class:"oc-text-truncate oc-ml-s"},RL=["textContent"],_L={class:"oc-flex"},IL={class:"oc-flex oc-flex-middle oc-flex-between oc-mb-m"},CL=["textContent"],PL={class:"oc-mt-s"},FL={class:"date-filter-apply-btn"};function OL(e,t,n,r,o,i){const s=he("oc-icon"),a=he("oc-button"),c=he("oc-list"),u=he("oc-datepicker"),l=he("oc-filter-chip");return X(),pe("div",{class:H.normalizeClass(["date-filter oc-flex",`date-filter-${e.filterName}`])},[ge(l,{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:Se(()=>[ge(c,{class:H.normalizeClass(["date-filter-list",{"date-filter-list-hidden":e.dateRangeClicked}])},{default:Se(()=>[(X(!0),pe(qe,null,wt(e.displayedItems,(d,f)=>(X(),pe("li",{key:f,class:"oc-my-xs"},[ge(a,{class:H.normalizeClass(["date-filter-list-item oc-flex oc-flex-between oc-flex-middle oc-width-1-1 oc-p-xs",{"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:Se(()=>[fe("div",vL,[fe("div",wL,[Xe(e.$slots,"item",{item:d})])]),fe("div",SL,[e.isItemSelected(d)?(X(),Re(s,{key:0,name:"check"})):Ce("",!0)])]),_:2},1032,["class","data-testid","onClick"])]))),128)),fe("li",EL,[ge(a,{class:H.normalizeClass(["date-filter-list-item oc-flex oc-flex-between oc-flex-middle oc-width-1-1 oc-p-xs",{"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:Se(()=>[fe("div",TL,[fe("div",AL,[fe("span",{textContent:H.toDisplayString(e.$gettext("Custom date range"))},null,8,RL)])]),fe("div",_L,[e.dateRangeApplied?(X(),Re(s,{key:0,name:"check"})):Ce("",!0)])]),_:1},8,["class"])])]),_:3},8,["class"]),fe("div",{class:H.normalizeClass(["date-filter-range-panel oc-py-s",{"date-filter-range-panel-active":e.dateRangeClicked}])},[fe("div",IL,[ge(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:Se(()=>[ge(s,{name:"arrow-left-s","fill-type":"line"})]),_:1},8,["aria-label"]),fe("span",{textContent:H.toDisplayString(e.$gettext("Custom date range"))},null,8,CL),ge(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:Se(()=>[ge(s,{name:"close"})]),_:1},8,["aria-label"])]),fe("div",PL,[ge(u,{label:e.$gettext("From"),"is-clearable":!0,"current-date":e.fromDate,onDateChanged:t[3]||(t[3]=d=>e.setDateRangeDate(d,"from"))},null,8,["label","current-date"]),ge(u,{label:e.$gettext("To"),"is-clearable":!0,"current-date":e.toDate,"min-date":e.fromDate?e.fromDate:void 0,onDateChanged:t[4]||(t[4]=d=>e.setDateRangeDate(d,"to"))},null,8,["label","current-date","min-date"])]),fe("div",FL,[ge(a,{size:"small",disabled:!e.dateRangeValid,onClick:e.applyDateRangeFilter},{default:Se(()=>[Ot(H.toDisplayString(e.$gettext("Apply")),1)]),_:1},8,["disabled","onClick"])])],2)]),_:3},8,["filter-label","selected-item-names","onClearFilter","onShowDrop","onHideDrop"])],2)}const kL=We(bL,[["render",OL]]),xL=xe({name:"ItemFilterInline",props:{filterName:{type:String,required:!0},filterOptions:{type:Array,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=He(),r=Kt(),o=ce(e.filterOptions[0].name),i=`q_${e.filterName}`,s=an(i),a=u=>n.push({query:{...Mi(p(r).query,[i]),[i]:u}}),c=async u=>{o.value=u.name,await a(u.name),t("toggleFilter",u)};return Bt(()=>{const u=Rt(p(s));u&&e.filterOptions.some(({name:l})=>l===u)&&(o.value=u,t("toggleFilter",e.filterOptions.find(({name:l})=>l===u)))}),{queryParam:i,activeOption:o,toggleFilter:c}}}),NL=["textContent"];function $L(e,t,n,r,o,i){const s=he("oc-button");return X(),pe("div",null,[fe("div",{class:H.normalizeClass(["item-inline-filter oc-flex-inline",`item-inline-filter-${e.filterName}`])},[(X(!0),pe(qe,null,wt(e.filterOptions,(a,c)=>(X(),Re(s,{id:a.name,key:c,class:H.normalizeClass(["item-inline-filter-option",{"item-inline-filter-option-selected":e.activeOption===a.name}]),appearance:"raw-inverse","color-role":"surface",onClick:u=>e.toggleFilter(a)},{default:Se(()=>[fe("span",{class:"oc-text-truncate item-inline-filter-option-label",textContent:H.toDisplayString(a.label)},null,8,NL)]),_:2},1032,["id","class","onClick"]))),128))],2)])}const DL=We(xL,[["render",$L]]),LL={class:"space-quota"},ML=["textContent"],V0=xe({__name:"SpaceQuota",props:{spaceQuota:{}},setup(e){const{$gettext:t,current:n}=Fe.useGettext(),r=B(()=>e.spaceQuota.total?t("%{used} of %{total} used (%{percentage}% used)",{used:p(i),total:p(o),percentage:p(s).toString()}):t("%{used} used (no restriction)",{used:p(i)})),o=B(()=>An(e.spaceQuota.total,n)),i=B(()=>An(e.spaceQuota.used,n)),s=B(()=>parseFloat((e.spaceQuota.used/e.spaceQuota.total*100).toFixed(2))),a=B(()=>{switch(e.spaceQuota.state){case"normal":return"var(--oc-role-secondary)";default:return"var(--oc-role-error)"}});return(c,u)=>{const l=he("oc-progress");return X(),pe("div",LL,[fe("p",{class:"oc-mb-s oc-mt-rm",textContent:H.toDisplayString(r.value)},null,8,ML),ge(l,{value:s.value,max:100,size:"small",color:a.value,"background-color":"var(--oc-role-surface)"},null,8,["value","color"])])}}}),BL=xe({name:"WebDavDetails",props:{space:{type:Object,required:!0}},setup(e){const t=gr("resource"),n="check",r="file-copy",o=ce(r),i=ce(r),s=B(()=>Af(p(t).webDavPath)),a=B(()=>{var l;return(l=e.space)==null?void 0:l.getWebDavUrl({path:p(t).path})});return{copyWebDAVPathIcon:o,copyWebDAVPathToClipboard:()=>{navigator.clipboard.writeText(p(s)),o.value=n,setTimeout(()=>o.value=r,1500)},copyWebDAVUrlIcon:i,copyWebDAVUrlToClipboard:()=>{navigator.clipboard.writeText(p(a)),i.value=n,setTimeout(()=>i.value=r,1500)},webDavPath:s,webDavUrl:a}}}),jL={class:"oc-flex"},UL=["textContent"],qL={class:"oc-flex"},VL=["textContent"];function zL(e,t,n,r,o,i){const s=he("oc-icon"),a=he("oc-button"),c=ln("oc-tooltip");return X(),pe(qe,null,[fe("dt",null,H.toDisplayString(e.$gettext("WebDAV path")),1),fe("dd",jL,[ot(fe("div",{class:"oc-text-truncate",textContent:H.toDisplayString(e.webDavPath)},null,8,UL),[[c,e.webDavPath]]),ot((X(),Re(a,{class:"oc-ml-s",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV path to clipboard"),"no-hover":"",onClick:e.copyWebDAVPathToClipboard},{default:Se(()=>[ge(s,{name:e.copyWebDAVPathIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[c,e.$gettext("Copy WebDAV path")]])]),fe("dt",null,H.toDisplayString(e.$gettext("WebDAV URL")),1),fe("dd",qL,[ot(fe("div",{class:"oc-text-truncate",textContent:H.toDisplayString(e.webDavUrl)},null,8,VL),[[c,e.webDavUrl]]),ot((X(),Re(a,{class:"oc-ml-s",appearance:"raw",size:"small","aria-label":e.$gettext("Copy WebDAV URL to clipboard"),"no-hover":"",onClick:e.copyWebDAVUrlToClipboard},{default:Se(()=>[ge(s,{name:e.copyWebDAVUrlIcon},null,8,["name"])]),_:1},8,["aria-label","onClick"])),[[c,e.$gettext("Copy WebDAV URL")]])])],64)}const z0=We(BL,[["render",zL]]),WL={id:"oc-space-details-sidebar"},HL={class:"oc-space-details-sidebar-image oc-text-center"},GL={key:1,class:"oc-position-relative"},KL=["src"],QL={key:0,class:"oc-flex oc-flex-middle oc-space-details-sidebar-members oc-mb-s oc-text-small"},XL=["textContent"],YL=["textContent"],JL=["aria-label"],ZL=We(xe({__name:"SpaceDetails",props:{showShareIndicators:{type:Boolean,default:!0}},setup(e){const t=yt(),n=Qe(),{resourceContentsText:r}=i0({showSizeInformation:!1}),o=He(),{$gettext:i,$ngettext:s,current:a}=Fe.useGettext(),{loadPreview:c}=Zf(),u=at(),{imagesLoading:l}=Ue.storeToRefs(u),d=Tr(),f=gr("resource"),m=ce(""),{user:w}=Ue.storeToRefs(t),y=B(()=>u.getSpaceMembers(p(f))),E=B(()=>d.linkShares.length),b=B(()=>n.areWebDavDetailsShown),g=B(()=>!ht(o,"files-spaces-projects")),v=B(()=>`${An(p(f).size,a)}, ${p(r)}`);St(()=>p(f).spaceImageData,async()=>{m.value=await c({space:p(f),resource:p(f).spaceImageData?Z.buildSpaceImageResource(p(f)):p(f),dimensions:Qn.Tile,processor:zs.enum.fit,cancelRunning:!0,updateStore:!1})},{immediate:!0});const h=B(()=>p(y).filter(Z.isManager).map(({sharedWith:te})=>{var ae;return te.id===((ae=p(w))==null?void 0:ae.id)?i("%{displayName} (me)",{displayName:te.displayName}):te.displayName}).join(", ")),S=B(()=>Cb(p(f).mdate,a)),T=B(()=>p(D)||p(N)),R=B(()=>{if(p(D)&&!p(N))return p(W);if(!p(D)&&p(N))return p(K);switch(p(x)){case 1:return s("This space has one member and %{linkShareCount} link.","This space has one member and %{linkShareCount} links.",p(E),{linkShareCount:p(E).toString()});default:return p(E)===1?i("This space has %{memberShareCount} members and one link.",{memberShareCount:p(x).toString()}):i("This space has %{memberShareCount} members and %{linkShareCount} links.",{memberShareCount:p(x).toString(),linkShareCount:p(E).toString()})}}),_=B(()=>i("Open share panel")),A=B(()=>i("Open link list in share panel")),$=B(()=>i("Open member list in share panel")),D=B(()=>p(x)>0),N=B(()=>p(E)>0),x=B(()=>p(y).length),W=B(()=>s("This space has %{memberShareCount} member.","This space has %{memberShareCount} members.",p(x),{memberShareCount:p(x).toString()})),K=B(()=>s("%{linkShareCount} link giving access.","%{linkShareCount} links giving access.",p(E),{linkShareCount:p(E).toString()})),le=()=>{Ke.publish(Tt.setActivePanel,"space-share")};return(be,te)=>{const ae=he("oc-spinner"),ue=he("oc-icon"),ie=he("oc-button"),G=he("portal-target");return X(),pe("div",WL,[fe("div",HL,[p(l).includes(p(f).id)?(X(),Re(ae,{key:0,"aria-label":p(i)("Space image is loading")},null,8,["aria-label"])):m.value?(X(),pe("div",GL,[fe("img",{src:m.value,alt:""},null,8,KL)])):(X(),Re(ue,{key:2,name:"layout-grid",size:"xxlarge",class:"space-default-image oc-px-m oc-py-m"}))]),be.showShareIndicators&&T.value&&!p(f).disabled?(X(),pe("div",QL,[D.value?(X(),Re(ie,{key:0,appearance:"raw","aria-label":$.value,"no-hover":"",onClick:le},{default:Se(()=>[ge(ue,{name:"group",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):Ce("",!0),N.value?(X(),Re(ie,{key:1,appearance:"raw","aria-label":A.value,"no-hover":"",onClick:le},{default:Se(()=>[ge(ue,{name:"link",size:"small","fill-type":"line"})]),_:1},8,["aria-label"])):Ce("",!0),fe("p",{textContent:H.toDisplayString(R.value)},null,8,XL),ge(ie,{appearance:"raw","aria-label":_.value,size:"small","no-hover":"",onClick:le},{default:Se(()=>[fe("span",{class:"oc-text-small",textContent:H.toDisplayString(p(i)("Show"))},null,8,YL)]),_:1},8,["aria-label"])])):Ce("",!0),fe("dl",{class:"details-list oc-m-rm","aria-label":p(i)("Overview of the information about the selected space")},[fe("dt",null,H.toDisplayString(p(i)("Last activity")),1),fe("dd",null,H.toDisplayString(S.value),1),p(f).description?(X(),pe(qe,{key:0},[fe("dt",null,H.toDisplayString(p(i)("Subtitle")),1),fe("dd",null,H.toDisplayString(p(f).description),1)],64)):Ce("",!0),fe("dt",null,H.toDisplayString(p(i)("Manager")),1),fe("dd",null,H.toDisplayString(h.value),1),p(f).disabled?Ce("",!0):(X(),pe(qe,{key:1},[fe("dt",null,H.toDisplayString(p(i)("Quota")),1),fe("dd",null,[ge(V0,{"space-quota":p(f).spaceQuota},null,8,["space-quota"])])],64)),g.value?(X(),pe(qe,{key:2},[fe("dt",null,H.toDisplayString(p(i)("Size")),1),fe("dd",null,H.toDisplayString(v.value),1)],64)):Ce("",!0),b.value?(X(),Re(z0,{key:3,space:p(f)},null,8,["space"])):Ce("",!0),ge(G,{name:"app.files.sidebar.space.details.table","slot-props":{space:p(f),resource:p(f)},multiple:!0},null,8,["slot-props"])],8,JL)])}}}),[["__scopeId","data-v-73f2b09b"]]),e2={id:"oc-spaces-details-multiple-sidebar"},t2={class:"spaces-preview oc-mb-l"},n2={class:"spaces-preview-body"},r2=["textContent"],i2=We(xe({__name:"SpaceDetailsMultiple",props:{selectedSpaces:{}},setup(e){const t=Fe.useGettext(),{$gettext:n,$ngettext:r}=t,o=B(()=>{let f=0;return e.selectedSpaces.forEach(m=>{f+=m.spaceQuota.total}),An(f,t.current)}),i=B(()=>{let f=0;return e.selectedSpaces.forEach(m=>{m.disabled||(f+=m.spaceQuota.remaining)}),An(f,t.current)}),s=B(()=>{let f=0;return e.selectedSpaces.forEach(m=>{m.disabled||(f+=m.spaceQuota.used)}),An(f,t.current)}),a=B(()=>e.selectedSpaces.filter(f=>!f.disabled).length),c=B(()=>e.selectedSpaces.filter(f=>f.disabled).length),u=B(()=>n("Overview of the information about the selected spaces")),l=B(()=>r("%{ itemCount } space selected","%{ itemCount } spaces selected",e.selectedSpaces.length,{itemCount:e.selectedSpaces.length.toString()})),d=B(()=>[{term:n("Total quota:"),definition:p(o).toString()},{term:n("Remaining quota:"),definition:p(i).toString()},{term:n("Used quota:"),definition:p(s).toString()},{term:n("Enabled:"),definition:p(a).toString()},{term:n("Disabled:"),definition:p(c).toString()}]);return(f,m)=>{const w=he("oc-icon"),y=he("oc-definition-list");return X(),pe("div",e2,[fe("div",t2,[fe("div",n2,[ge(w,{class:"preview-icon",size:"xxlarge",name:"layout-grid"}),fe("p",{class:"preview-text",textContent:H.toDisplayString(l.value)},null,8,r2)])]),ge(y,{"aria-label":u.value,items:d.value},null,8,["aria-label","items"])])}}}),[["__scopeId","data-v-11ad741e"]]),o2=xe({name:"SpaceNoSelection"}),s2={class:"oc-mt-xl"},a2={class:"oc-flex space-info oc-text-center"};function l2(e,t,n,r,o,i){const s=he("oc-icon"),a=ln("translate");return X(),pe("div",s2,[fe("div",a2,[ge(s,{name:"layout-grid",size:"xxlarge"}),ot((X(),pe("p",null,t[0]||(t[0]=[Ot("Select a space to view details")]))),[[a]])])])}const c2=We(o2,[["render",l2]]),u2=xe({name:"CompareSaveDialog",props:{originalObject:{type:Object,required:!0},compareObject:{type:Object,required:!0},confirmButtonDisabled:{type:Boolean,default:()=>!1}},emits:["confirm","revert"],setup(){const e=ce(!1);let t;return Bt(()=>{t=Ke.subscribe("sidebar.entity.saved",()=>{e.value=!0})}),Vn(()=>{Ke.unsubscribe("sidebar.entity.saved",t)}),{saved:e}},computed:{unsavedChanges(){return!hb(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}}}),f2={class:"compare-save-dialog oc-width-1-1 oc-flex oc-flex-between oc-flex-middle"},d2={key:0,class:"state-indicator oc-flex oc-flex-middle"},p2=["textContent"],h2={key:1,class:"state-indicator"},g2=["textContent"],m2=["textContent"];function y2(e,t,n,r,o,i){const s=he("oc-icon"),a=he("oc-button");return X(),pe("div",f2,[e.saved?(X(),pe("span",d2,[ge(s,{name:"checkbox-circle"}),fe("span",{class:"oc-ml-s",textContent:H.toDisplayString(e.$gettext("Changes saved"))},null,8,p2)])):(X(),pe("span",h2,H.toDisplayString(e.unsavedChangesText),1)),fe("div",null,[ge(a,{disabled:!e.unsavedChanges,class:"compare-save-dialog-revert-btn",onClick:t[0]||(t[0]=c=>e.$emit("revert"))},{default:Se(()=>[fe("span",{textContent:H.toDisplayString(e.$gettext("Revert"))},null,8,g2)]),_:1},8,["disabled"]),ge(a,{appearance:"filled",class:"compare-save-dialog-confirm-btn",disabled:!e.unsavedChanges||e.confirmButtonDisabled,onClick:t[1]||(t[1]=c=>e.$emit("confirm"))},{default:Se(()=>[fe("span",{textContent:H.toDisplayString(e.$gettext("Save"))},null,8,m2)]),_:1},8,["disabled"])])])}const b2=We(u2,[["render",y2],["__scopeId","data-v-471483fe"]]),v2=dS(async()=>(await Promise.resolve().then(()=>dM)).default),w2=xe({name:"CustomComponentTarget",props:{extensionPoint:{type:Object,required:!0}},setup(e){const t=Bi(),n=Mb(),r=B(()=>t.requestExtensions(e.extensionPoint)),o=n.extractDefaultExtensionIds(e.extensionPoint,p(r));return{extensions:B(()=>{if(e.extensionPoint.multiple||p(r).length<=1)return p(r);const s=n.getExtensionPreference(e.extensionPoint.id,o);return s.selectedExtensionIds.length?[p(r).find(a=>s.selectedExtensionIds.includes(a.id))||p(r)[0]]:[p(r)[0]]})}}});function S2(e,t,n,r,o,i){return X(!0),pe(qe,null,wt(e.extensions,s=>(X(),Re(Nr(s.content),{key:`custom-component-${s.id}`}))),128)}const E2=We(w2,[["render",S2]]),T2=xe({name:"ItemFilter",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0},optionFilterLabel:{type:String,required:!1,default:""},showOptionFilter:{type:Boolean,required:!1,default:!1},items:{type:Array,required:!0},allowMultiple:{type:Boolean,required:!1,default:!1},idAttribute:{type:String,required:!1,default:"id"},displayNameAttribute:{type:String,required:!1,default:"name"},filterableAttributes:{type:Array,required:!1,default:()=>[]},closeOnClick:{type:Boolean,default:!1}},emits:["selectionChange"],setup:function(e,{emit:t,expose:n}){const r=He(),o=Kt(),i=ce(),s=ce([]),a=ce(e.items),c=ce(null),u=ce(null),l=`q_${e.filterName}`,d=an(l),f=T=>T[e.idAttribute],m=()=>r.push({query:{...Mi(p(o).query,[l]),...!!p(s).length&&{[l]:p(s).reduce((T,R)=>(T+=`${f(R)}+`,T),"").slice(0,-1)}}}),w=T=>!!p(s).find(R=>f(R)===f(T)),y=async T=>{w(T)?s.value=p(s).filter(R=>f(R)!==f(T)):(e.allowMultiple||(s.value=[]),s.value.push(T)),await m(),t("selectionChange",p(s))},E=ce(),b=(T,R)=>{if(!(R||"").trim())return T;const A=new fd(T,{...pl,keys:e.filterableAttributes}).search(R).map($=>$.item);return T.filter($=>A.includes($))},g=()=>{s.value=[],t("selectionChange",p(s)),m()},v=T=>{a.value=T},h=async()=>{var T;v(e.items),await In(),(T=p(i))==null||T.focus()};St(E,()=>{v(b(e.items,p(E))),p(u)&&(c.value=new pd(p(u)),p(c).unmark(),p(c).mark(p(E),{element:"span",className:"mark-highlight"}))});const S=()=>{const T=Rt(p(d));if(T){const R=T.split("+");s.value=e.items.filter(_=>R.includes(f(_)))}};return n({setSelectedItemsBasedOnQuery:S}),Bt(()=>{S()}),{clearFilter:g,displayedItems:a,filterInputRef:i,filterTerm:E,isItemSelected:w,itemFilterListRef:u,queryParam:l,selectedItems:s,setDisplayedItems:v,showDrop:h,toggleItemSelection:y,setSelectedItemsBasedOnQuery:S}}}),A2={ref:"itemFilterListRef"},R2={class:"oc-flex oc-flex-middle oc-text-truncate"},_2={class:"oc-text-truncate oc-ml-s"},I2={class:"oc-flex"};function C2(e,t,n,r,o,i){const s=he("oc-text-input"),a=he("oc-checkbox"),c=he("oc-icon"),u=he("oc-button"),l=he("oc-list"),d=he("oc-filter-chip");return X(),pe("div",{class:H.normalizeClass(["item-filter oc-flex",`item-filter-${e.filterName}`])},[ge(d,{"filter-label":e.filterLabel,"selected-item-names":e.selectedItems.map(f=>f[e.displayNameAttribute]),"close-on-click":e.closeOnClick,onClearFilter:e.clearFilter,onShowDrop:e.showDrop},{default:Se(()=>[e.showOptionFilter&&e.filterableAttributes.length?(X(),Re(s,{key:0,ref:"filterInputRef",modelValue:e.filterTerm,"onUpdate:modelValue":t[0]||(t[0]=f=>e.filterTerm=f),class:"item-filter-input oc-mb-m oc-mt-s",autocomplete:"off",label:e.optionFilterLabel===""?e.$gettext("Filter list"):e.optionFilterLabel},null,8,["modelValue","label"])):Ce("",!0),fe("div",A2,[ge(l,{class:"item-filter-list"},{default:Se(()=>[(X(!0),pe(qe,null,wt(e.displayedItems,(f,m)=>(X(),pe("li",{key:m,class:"oc-my-xs"},[ge(u,{class:H.normalizeClass(["item-filter-list-item oc-flex oc-flex-middle oc-width-1-1 oc-p-s",{"item-filter-list-item-active":!e.allowMultiple&&e.isItemSelected(f),"oc-flex-left":e.allowMultiple,"oc-flex-between":!e.allowMultiple}]),"justify-content":"space-between",appearance:"raw","data-test-value":f[e.displayNameAttribute],onClick:w=>e.toggleItemSelection(f)},{default:Se(()=>[fe("div",R2,[e.allowMultiple?(X(),Re(a,{key:0,size:"large",class:"item-filter-checkbox oc-mr-s",label:e.$gettext("Toggle selection"),"model-value":e.isItemSelected(f),"label-hidden":!0,"onUpdate:modelValue":w=>e.toggleItemSelection(f),onClick:t[1]||(t[1]=Pn(()=>{},["stop"]))},null,8,["label","model-value","onUpdate:modelValue"])):Ce("",!0),fe("div",null,[Xe(e.$slots,"image",{item:f})]),fe("div",_2,[Xe(e.$slots,"item",{item:f})])]),fe("div",I2,[!e.allowMultiple&&e.isItemSelected(f)?(X(),Re(c,{key:0,name:"check"})):Ce("",!0)])]),_:2},1032,["class","data-test-value","onClick"])]))),128))]),_:3})],512)]),_:3},8,["filter-label","selected-item-names","close-on-click","onClearFilter","onShowDrop"])],2)}const P2=We(T2,[["render",C2]]),F2=xe({name:"ItemFilterToggle",props:{filterLabel:{type:String,required:!0},filterName:{type:String,required:!0}},emits:["toggleFilter"],setup:function(e,{emit:t}){const n=He(),r=Kt(),o=ce(!1),i=`q_${e.filterName}`,s=an(i),a=()=>n.push({query:{...Mi(p(r).query,[i]),...p(o)&&{[i]:"true"}}}),c=async()=>{o.value=!p(o),await a(),t("toggleFilter",p(o))};return Bt(()=>{Rt(p(s))==="true"&&(o.value=!0)}),{queryParam:i,filterActive:o,toggleFilter:c}}});function O2(e,t,n,r,o,i){const s=he("oc-filter-chip");return X(),pe("div",{class:H.normalizeClass(["item-filter oc-flex",`item-filter-${e.filterName}`])},[ge(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 k2=We(F2,[["render",O2]]),x2=xe({name:"LoadingIndicator",setup(){const e=fn();let t,n,r;const o=ce(e.isLoading),i=ce(e.currentProgress),s=()=>{i.value=e.currentProgress,o.value=e.isLoading},a=()=>{i.value=e.currentProgress};return Bt(()=>{t=Ke.subscribe(Lr.add,s),n=Ke.subscribe(Lr.remove,s),r=Ke.subscribe(Lr.setProgress,a)}),Vn(()=>{Ke.unsubscribe(Lr.add,t),Ke.unsubscribe(Lr.remove,n),Ke.unsubscribe(Lr.setProgress,r)}),{isLoading:o,currentProgress:i}}}),N2={key:0,id:"oc-loading-indicator",class:"oc-width-1-1"};function $2(e,t,n,r,o,i){const s=he("oc-progress");return e.isLoading?(X(),pe("div",N2,[ge(s,{max:100,indeterminate:e.currentProgress===null,value:e.currentProgress,size:"small"},null,8,["indeterminate","value"])])):Ce("",!0)}const D2=We(x2,[["render",$2]]),L2={class:"no-content-message oc-flex oc-flex-column oc-flex-center oc-flex-middle oc-text-center"},M2={class:"oc-text-muted oc-text-xlarge"},B2={class:"oc-text-muted"},j2=xe({__name:"NoContentMessage",props:{icon:{},iconFillType:{default:"fill"}},setup(e){return(t,n)=>{const r=he("oc-icon");return X(),pe("div",L2,[ge(r,{name:t.icon,type:"div",size:"xxlarge","fill-type":t.iconFillType,class:"oc-mb-m"},null,8,["name","fill-type"]),fe("div",M2,[Xe(t.$slots,"message")]),fe("div",B2,[Xe(t.$slots,"callToAction")])])}}}),U2=xe({props:{pages:{type:Number,required:!0},currentPage:{type:Number,required:!0}},watch:{currentPage:{handler:function(){var e;(e=document.getElementsByClassName("files-view-wrapper")[0])==null||e.scrollTo(0,0)}}}});function q2(e,t,n,r,o,i){const s=he("oc-pagination");return e.pages>1?(X(),Re(s,{key:0,pages:e.pages,"current-page":e.currentPage,"max-displayed":3,"current-route":e.$route,class:"files-pagination oc-flex oc-flex-center oc-my-s"},null,8,["pages","current-page","current-route"])):Ce("",!0)}const V2=We(U2,[["render",q2]]),z2=xe({name:"SearchBarFilter",props:{currentFolderAvailable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const{$gettext:n}=Fe.useGettext(),r=an("useScope"),o=ce(),i=ce(),s=B(()=>{var u;return n((u=o.value)==null?void 0:u.title)}),a=B(()=>[{id:Rr.currentFolder,title:n("Current folder"),enabled:e.currentFolderAvailable},{id:Rr.allFiles,title:n("All files"),enabled:!0}]);return St(()=>e.currentFolderAvailable,()=>{if(p(r)){if(p(r).toString()==="true"){o.value=p(a).find(({id:l})=>l===Rr.currentFolder);return}o.value=p(a).find(({id:l})=>l===Rr.allFiles);return}if(!e.currentFolderAvailable){o.value=p(a).find(({id:u})=>u===Rr.allFiles);return}if(p(i)){o.value=p(a).find(({id:u})=>u===p(i).id);return}o.value=p(a).find(({id:u})=>u===Rr.allFiles)},{immediate:!0}),{currentSelection:o,currentSelectionTitle:s,onOptionSelected:u=>{i.value=u,o.value=u,t("update:modelValue",{value:u})},locationOptions:a}}}),W2={key:0},H2={key:0,class:"oc-flex"};function G2(e,t,n,r,o,i){const s=he("oc-icon"),a=he("oc-button"),c=he("oc-filter-chip");return X(),pe("div",{class:"oc-location-search oc-position-small oc-position-center-right oc-mt-rm",onClick:t[0]||(t[0]=Pn(()=>{},["stop"]))},[e.currentSelection?(X(),pe("div",W2,[ge(c,{"is-toggle":!1,"is-toggle-active":!1,"filter-label":e.currentSelectionTitle,"selected-item-names":[],class:"oc-search-bar-filter",raw:"","close-on-click":""},{default:Se(()=>[(X(!0),pe(qe,null,wt(e.locationOptions,(u,l)=>(X(),Re(a,{key:l,appearance:"raw",size:"medium","justify-content":"space-between",class:H.normalizeClass(["search-bar-filter-item oc-flex oc-flex-middle oc-width-1-1 oc-py-xs oc-px-s",{"oc-secondary-container":u.id===e.currentSelection.id}]),disabled:!u.enabled,"data-test-id":u.id,onClick:d=>e.onOptionSelected(u)},{default:Se(()=>[fe("span",null,H.toDisplayString(u.title),1),u.id===e.currentSelection.id?(X(),pe("div",H2,[ge(s,{name:"check"})])):Ce("",!0)]),_:2},1032,["class","disabled","data-test-id","onClick"]))),128))]),_:1},8,["filter-label"])])):Ce("",!0)])}const K2=We(z2,[["render",G2]]),Q2=xe({name:"PortalTarget",components:{PortalTargetVue:_a.PortalTarget},props:{..._a.PortalTarget.props},setup(e){const t=B(()=>e);return Bt(()=>{Ke.publish(ya.mounted,e)}),{properties:t}}});function X2(e,t,n,r,o,i){const s=he("portal-target-vue");return X(),Re(s,H.normalizeProps(rl(e.properties)),null,16)}const Y2=We(Q2,[["render",X2]]),J2=({sortBy:e,sortDir:t})=>({groupingSettings:B(()=>({groupingBy:localStorage.getItem("grouping-shared-with-me")||"Shared on",showGroupingOptions:!0,groupingFunctions:{"Name alphabetically":function(r){return localStorage.setItem("grouping-shared-with-me","Name alphabetically"),isNaN(Number(r.name.charAt(0)))?r.name.charAt(0)==="."?r.name.charAt(1).toLowerCase():r.name.charAt(0).toLowerCase():"#"},"Shared on":function(r){localStorage.setItem("grouping-shared-with-me","Shared on");const o=Date.now()-6048e5,i=Date.now()-2592e6;return Date.parse(r.sdate)<i?"Older":Date.parse(r.sdate)>=o?"Recently":"Last month"},"Share owner":function(r){var o;return localStorage.setItem("grouping-shared-with-me","Share owner"),(o=r==null?void 0:r.owner)==null?void 0:o.displayName},None:function(){localStorage.setItem("grouping-shared-with-me","None")}},sortGroups:{"Name alphabetically":function(r){const o=r.sort(function(i,s){return i.name<s.name?-1:i.name>s.name?1:0});return p(e)==="name"&&p(t)==="desc"&&o.reverse(),o},"Shared on":function(r){const o=[],i=["Recently","Last month","Older"];for(const s of i){const a=r.find(c=>c.name.toLowerCase()===s.toLowerCase());a&&o.push(a)}return p(e)==="sdate"&&p(t)==="asc"&&o.reverse(),o},"Share owner":function(r){const o=r.sort(function(i,s){return i.name<s.name?-1:i.name>s.name?1:0});return p(e)==="owner"&&p(t)==="desc"&&o.reverse(),o}}}))}),Z2={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é"}},eM={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"}},tM={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"}},nM={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"}},rM={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"}},iM={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:"Автопрокрутка"}},oM={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:"同期スクロール"}},sM={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"}},aM={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"},lM={"fr-FR":Z2,"de-DE":eM,"it-IT":tM,"es-ES":nM,"pl-PL":rM,ru:iM,"jp-JP":oM,"id-ID":sM},cM=xe({name:"TextEditor",components:{MdEditor:Bo.MdEditor,MdPreview:Bo.MdPreview},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=Fe.useGettext(),{currentTheme:r}=ai(),o=B(()=>{const{showPreviewOnlyMd:c=!0}=e.applicationConfig;return{showPreviewOnlyMd:c}}),i=B(()=>{var c;return e.markdownMode||["md","markdown"].includes((c=e.resource)==null?void 0:c.extension)||!p(o).showPreviewOnlyMd}),s=B(()=>p(r).isDark?"dark":"light");return Bo.config({editorConfig:{languageUserDefined:lM},editorExtensions:{screenfull:{instance:iw},cropper:{instance:Ra}},markdownItPlugins(c){return[...c,{type:"xss",plugin:Bo.XSSPlugin,options:{}}]}}),{isMarkdown:i,theme:s,language:n,languages:aM,onUploadImg:async c=>{const l=(await Promise.all([...c].map(f=>new Promise((m,w)=>{const y=new FileReader;y.onload=()=>m(y.result),y.onerror=w,y.readAsDataURL(f)})))).map(f=>`![image](${f})`),d=`${p(e.currentContent)}
64
64
  ${l.join(`
65
65
 
66
66
  `)}
67
- `;t("update:currentContent",f)}}}}),j2={id:"text-editor-container",class:"oc-height-1-1"};function U2(e,t,n,r,o,i){const s=ye("md-preview"),a=ye("md-editor");return J(),ge("div",j2,[e.isReadOnly?(J(),Ie(s,{key:0,id:"text-editor-preview-component","model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-upload-img":"","no-highlight":"",language:e.languages[e.language.current]||"en-US",theme:e.theme,"auto-focus":"","read-only":"",toolbars:[]},null,8,["model-value","language","theme"])):(J(),Ie(a,{key:1,id:"text-editor-component","model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-highlight":"","on-upload-img":e.onUploadImg,language:e.languages[e.language.current]||"en-US",theme:e.theme,preview:e.isMarkdown,toolbars:e.isMarkdown?void 0:["revoke","next"],"toolbars-exclude":["save","katex","github","catalog","mermaid","prettier","fullscreen","htmlPreview","pageFullscreen"],"read-only":e.isReadOnly,"auto-focus":"",onOnChange:t[0]||(t[0]=c=>e.$emit("update:currentContent",c))},null,8,["model-value","on-upload-img","language","theme","preview","toolbars","read-only"]))])}const q2=Object.freeze(Object.defineProperty({__proto__:null,default:Ue(B2,[["render",U2]])},Symbol.toStringTag,{value:"Module"}));D.ActionMenuItem=Hf,D.ApiError=fA,D.AppBar=Dx,D.AppLoadingSpinner=Mf,D.AppProviderService=GT,D.AppTopBar=e0,D.AppWrapper=a0,D.AppWrapperRoute=WN,D.ArchiverService=dA,D.Auth=jh,D.BatchActions=Yv,D.Cache=Il,D.ClientService=SA,D.ClipboardActions=ri,D.CompareSaveDialog=KL,D.ConflictDialog=sl,D.ContextActionMenu=Gf,D.ContextActions=Jv,D.ContextMenuQuickAction=Kf,D.CreateLinkModal=Pv,D.CreateShortcutModal=Iv,D.CreateSpace=jx,D.CustomComponentTarget=JL,D.DateFilter=lL,D.DatePickerModal=_N,D.EDITOR_MODE_CREATE=nO,D.EDITOR_MODE_EDIT=tO,D.EVENT_FILE_DROPPED=$f,D.EVENT_TROW_CONTEXTMENU=lO,D.EVENT_TROW_MOUNTED=Av,D.EmojiPickerModal=Vv,D.EventBus=Uh,D.FileInfo=r0,D.FilePickerModal=Fv,D.FileSideBar=i0,D.FolderLoaderFavorites=Qh,D.FolderLoaderSharedViaLink=Xh,D.FolderLoaderSharedWithMe=Yh,D.FolderLoaderSharedWithOthers=Jh,D.FolderLoaderSpace=Kh,D.FolderLoaderTrashbin=Hy,D.FolderService=Gy,D.FolderViewModeConstants=Zt,D.HttpClient=Hl,D.ImageDimension=Qn,D.ImageType=ua,D.ItemFilter=o2,D.ItemFilterInline=dL,D.ItemFilterToggle=l2,D.Key=jf,D.LinkRoleDropdown=Cv,D.LoadingEventTopics=$r,D.LoadingIndicator=d2,D.LoadingService=oI,D.MimeTypesToAppsSchema=Ah,D.Modifier=Uf,D.NoContentMessage=m2,D.Pagination=v2,D.PaginationConstants=Ir,D.PasswordPolicyService=XI,D.PortalTarget=I2,D.PortalTargetEventTopics=pa,D.PreviewService=UI,D.ProcessorType=Ws,D.QuotaModal=Mv,D.QuotaSelect=Lv,D.RawConfigSchema=MP,D.ResolveStrategy=Gn,D.ResourceConflictModal=Rp,D.ResourceGhostElement=Qf,D.ResourceIcon=ko,D.ResourceLink=Df,D.ResourceListItem=xo,D.ResourceName=Lf,D.ResourcePreview=_v,D.ResourceSize=l0,D.ResourceTable=PD,D.ResourceTile=k0,D.ResourceTiles=GD,D.ResourceTransfer=Ip,D.RuntimeError=ki,D.SaveAsModal=kv,D.SearchBarFilter=A2,D.SearchLocationFilterConstants=Rr,D.SideBar=t0,D.SideBarEventTopics=vt,D.SortConstants=ei,D.SortDir=Vt,D.SpaceDetails=PL,D.SpaceDetailsMultiple=NL,D.SpaceInfo=n0,D.SpaceMoveInfoModal=Ap,D.SpaceNoSelection=BL,D.SpaceQuota=x0,D.TextEditor=QL,D.ThemeConfig=BF,D.TransferType=mr,D.UnsavedChangesModal=o0,D.UppyService=JI,D.ViewOptions=Zv,D.VisibilityObserver=Rv,D.WebDavDetails=N0,D.WebThemeConfig=ev,D.activeApp=_l,D.authContextValues=ET,D.blobToArrayBuffer=Ib,D.breadcrumbsFromPath=mP,D.buildRoutes=GF,D.buildUrl=AT,D.cacheService=Wl,D.canvasToBlob=Cb,D.cloneStateObject=Ep,D.concatBreadcrumbs=yP,D.contextQueryToFileContextProps=iv,D.contextRouteNameKey=Zs,D.contextRouteParamsKey=wf,D.contextRouteQueryKey=Sf,D.createDefaultFileIconMapping=Pp,D.createFileRouteOptions=rr,D.createLocationCommon=Ci,D.createLocationPublic=Pi,D.createLocationShares=$n,D.createLocationSpaces=Nn,D.createLocationTrash=Fi,D.defaultFuseOptions=al,D.defineWebApplication=X0,D.determineResourceTableSortFields=Eh,D.determineResourceTilesSortFields=VT,D.dirname=yt.dirname,D.displayPositionedDropdown=Ao,D.encodePath=mf,D.eventBus=Ke,D.filterResources=JS,D.focusCheckbox=IT,D.folderService=Ky,D.formatDateFromDateTime=ii,D.formatDateFromHTTP=bP,D.formatDateFromISO=wb,D.formatDateFromJSDate=vb,D.formatDateFromRFC=vP,D.formatFileSize=An,D.formatRelativeDateFromDateTime=Ro,D.formatRelativeDateFromHTTP=wP,D.formatRelativeDateFromISO=SP,D.formatRelativeDateFromJSDate=Sb,D.formatRelativeDateFromRFC=EP,D.getIndicators=_b,D.getLocaleFromLanguage=Ks,D.getParentPaths=Eb,D.getSharedAncestorRoute=_T,D.getSharedDriveItem=ws,D.getSpacesByType=Co,D.isLocationActive=WF,D.isLocationCommonActive=It,D.isLocationPublicActive=Cn,D.isLocationSharesActive=Mt,D.isLocationSpacesActive=dt,D.isLocationTrashActive=Pn,D.isMacOs=_o,D.isResourceBeeingMovedToSameLocation=_p,D.isSameResource=ro,D.locationPublicLink=Al,D.locationPublicUpload=Rl,D.locationSharesViaLink=Tl,D.locationSharesWithMe=vs,D.locationSharesWithOthers=El,D.locationSpacesGeneric=Sl,D.objectKeys=jI,D.queryItemAsString=At,D.renameResource=ll,D.resolveFileNameDuplicate=Hn,D.resourceIconMappingInjectionKey=Cp,D.routeToContextQuery=ea,D.setCurrentUserShareSpacePermissions=ph,D.sortFields=Th,D.sortHelper=wh,D.sortSpaceMembers=tv,D.translateSortFields=zT,D.triggerDownloadWithFilename=zl,D.useAbility=yn,D.useActionsShowDetails=Wk,D.useActiveApp=TT,D.useActiveLocation=Ar,D.useAppConfig=fh,D.useAppDefaults=fv,D.useAppFileHandling=Ef,D.useAppFolderHandling=sv,D.useAppMeta=Rf,D.useAppNavigation=ov,D.useAppProviderService=Gk,D.useAppsStore=ir,D.useArchiverService=yv,D.useAuthService=Tf,D.useAuthStore=Zr,D.useBreadcrumbsFromPath=Kk,D.useCanBeOpenedWithSecureView=qf,D.useCanListShares=Sv,D.useCanListVersions=Gv,D.useCanShare=Ev,D.useCapabilityStore=an,D.useClientService=Xe,D.useClipboard=_f,D.useClipboardStore=Io,D.useConfigStore=lt,D.useCreateSpace=Ui,D.useDeleteWorker=dv,D.useDocumentTitle=av,D.useDownloadFile=bv,D.useDriveResolver=uv,D.useEmbedMode=oi,D.useEventBus=ai,D.useExtensionPreferencesStore=Fb,D.useExtensionRegistry=Bi,D.useFileActions=Kn,D.useFileActionsCopy=ia,D.useFileActionsCopyPermanentLink=If,D.useFileActionsCreateLink=gk,D.useFileActionsCreateNewFile=aO,D.useFileActionsCreateNewFolder=sO,D.useFileActionsCreateNewShortcut=VO,D.useFileActionsCreateSpaceFromResource=Nf,D.useFileActionsDelete=Fo,D.useFileActionsDeleteResources=gv,D.useFileActionsDisableSync=oa,D.useFileActionsDownloadArchive=sa,D.useFileActionsDownloadFile=Oo,D.useFileActionsEmptyTrashBin=Cf,D.useFileActionsEnableSync=na,D.useFileActionsFavorite=Pf,D.useFileActionsMove=aa,D.useFileActionsNavigate=Ff,D.useFileActionsOpenShortcut=zO,D.useFileActionsOpenWithApp=Ov,D.useFileActionsPaste=vv,D.useFileActionsRename=la,D.useFileActionsRestore=ca,D.useFileActionsSaveAs=xv,D.useFileActionsSetImage=wv,D.useFileActionsShowActions=oO,D.useFileActionsShowDetails=kf,D.useFileActionsShowShares=xf,D.useFileActionsToggleHideShare=ra,D.useFileListHeaderPosition=Qk,D.useFileRouteReplace=Xs,D.useFolderLink=ci,D.useGetMatchingSpace=fn,D.useGetResourceContext=Kv,D.useGroupingSettings=C2,D.useIsAppActive=mv,D.useIsFilesAppActive=_r,D.useIsSearchActive=fs,D.useIsTopBarSticky=Bf,D.useKeyboardActions=Wv,D.useLinkTypes=fa,D.useLoadPreview=zf,D.useLoadingService=dn,D.useLocalStorage=vf,D.useMessages=rt,D.useModals=wt,D.useOpenEmptyEditor=Hk,D.useOpenWithDefaultApp=jv,D.usePagination=Yk,D.usePasswordPolicyService=Hv,D.usePasteWorker=pv,D.usePortalTarget=ex,D.usePreviewService=Of,D.useRequest=lv,D.useRequestHeaders=ta,D.useResourceContents=Xv,D.useResourceRouteResolver=da,D.useResourcesStore=Qe,D.useRestoreWorker=hv,D.useRoute=Qt,D.useRouteMeta=nv,D.useRouteName=Ys,D.useRouteParam=Js,D.useRouteQuery=ln,D.useRouteQueryPersisted=Tr,D.useRouter=qe,D.useScrollTo=Tv,D.useSearch=Af,D.useSelectedResources=Wf,D.useService=vr,D.useSharesStore=zt,D.useSideBar=Tb,D.useSort=MT,D.useSpaceActionsDelete=Nv,D.useSpaceActionsDisable=$v,D.useSpaceActionsDuplicate=Dv,D.useSpaceActionsEditDescription=Ik,D.useSpaceActionsEditQuota=Bv,D.useSpaceActionsEditReadmeContent=Bk,D.useSpaceActionsNavigateToTrash=Uk,D.useSpaceActionsRename=Uv,D.useSpaceActionsRestore=qv,D.useSpaceActionsSetIcon=zk,D.useSpaceActionsShowMembers=jk,D.useSpaceHelpers=li,D.useSpacesLoading=cv,D.useSpacesStore=ct,D.useThemeStore=si,D.useTileSize=Qv,D.useTokenTimerWorker=JF,D.useUpload=ix,D.useUserStore=St,D.useViewMode=tx,D.useViewSize=nx,D.useViewSizeMax=Vf,D.useWebWorkersStore=Po,D.useWindowOpen=zv,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})});
67
+ `;t("update:currentContent",d)}}}}),uM={id:"text-editor-container",class:"oc-height-1-1"};function fM(e,t,n,r,o,i){const s=he("md-preview"),a=he("md-editor");return X(),pe("div",uM,[e.isReadOnly?(X(),Re(s,{key:0,id:"text-editor-preview-component","model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-upload-img":"","no-highlight":"",language:e.languages[e.language.current]||"en-US",theme:e.theme,"auto-focus":"","read-only":"",toolbars:[]},null,8,["model-value","language","theme"])):(X(),Re(a,{key:1,id:"text-editor-component","model-value":e.currentContent,"no-katex":"","no-mermaid":"","no-prettier":"","no-highlight":"","on-upload-img":e.onUploadImg,language:e.languages[e.language.current]||"en-US",theme:e.theme,preview:e.isMarkdown,toolbars:e.isMarkdown?void 0:["revoke","next"],"toolbars-exclude":["save","katex","github","catalog","mermaid","prettier","fullscreen","htmlPreview","pageFullscreen"],"read-only":e.isReadOnly,"auto-focus":"",onOnChange:t[0]||(t[0]=c=>e.$emit("update:currentContent",c))},null,8,["model-value","on-upload-img","language","theme","preview","toolbars","read-only"]))])}const dM=Object.freeze(Object.defineProperty({__proto__:null,default:We(cM,[["render",fM]])},Symbol.toStringTag,{value:"Module"}));L.AVATAR_UPLOAD_MAX_FILE_SIZE_MB=$f,L.ActionMenuDropItem=a0,L.ActionMenuItem=ba,L.ApiError=vA,L.AppBar=Jx,L.AppLoadingSpinner=Hf,L.AppProviderService=tA,L.AppTopBar=u0,L.AppWrapper=y0,L.AppWrapperRoute=a$,L.ArchiverService=wA,L.Auth=Qh,L.AvatarUpload=VD,L.BatchActions=s0,L.Cache=$l,L.ClientService=PA,L.ClipboardActions=ii,L.CompareSaveDialog=b2,L.ConflictDialog=dl,L.ContextActionMenu=td,L.ContextActions=l0,L.ContextMenuQuickAction=nd,L.CreateLinkModal=Mv,L.CreateShortcutModal=Dv,L.CreateSpace=nN,L.CustomComponentTarget=E2,L.DateFilter=kL,L.DatePickerModal=qN,L.EDITOR_MODE_CREATE=cO,L.EDITOR_MODE_EDIT=lO,L.EVENT_FILE_DROPPED=Nf,L.EVENT_TROW_CONTEXTMENU=sO,L.EVENT_TROW_MOUNTED=Rv,L.EmojiPickerModal=Jv,L.EventBus=Xh,L.FileInfo=p0,L.FilePickerModal=Bv,L.FileSideBar=h0,L.FolderLoaderFavorites=Jh,L.FolderLoaderSharedViaLink=Zh,L.FolderLoaderSharedWithMe=eg,L.FolderLoaderSharedWithOthers=tg,L.FolderLoaderSpace=Yh,L.FolderLoaderTrashbin=Qy,L.FolderService=Xy,L.FolderViewModeConstants=Jt,L.HttpClient=ec,L.ImageDimension=Qn,L.ImageType=oa,L.ItemFilter=P2,L.ItemFilterInline=DL,L.ItemFilterToggle=k2,L.Key=Ir,L.LinkRoleDropdown=Lv,L.LoadingEventTopics=Lr,L.LoadingIndicator=D2,L.LoadingService=Z_,L.MimeTypesToAppsSchema=xh,L.Modifier=Kf,L.NoContentMessage=j2,L.Pagination=V2,L.PaginationConstants=Cr,L.PasswordPolicyService=eC,L.PortalTarget=Y2,L.PortalTargetEventTopics=ya,L.PreviewService=WI,L.ProcessorType=zs,L.QuotaModal=Gv,L.QuotaSelect=Hv,L.RESOURCE_MAX_CHARACTER_LENGTH=Co,L.RawConfigSchema=zP,L.ResolveStrategy=Wn,L.ResourceConflictModal=Np,L.ResourceGhostElement=rd,L.ResourceIcon=Oo,L.ResourceLink=zf,L.ResourceListItem=ko,L.ResourceName=Wf,L.ResourcePreview=$v,L.ResourceSize=b0,L.ResourceTable=ZD,L.ResourceTile=q0,L.ResourceTiles=yL,L.ResourceTransfer=Dp,L.RuntimeError=ki,L.SaveAsModal=Uv,L.SearchBarFilter=K2,L.SearchLocationFilterConstants=Rr,L.SideBar=f0,L.SideBarEventTopics=Tt,L.SortConstants=ti,L.SortDir=zt,L.SpaceDetails=ZL,L.SpaceDetailsMultiple=i2,L.SpaceImageModal=Pv,L.SpaceInfo=d0,L.SpaceMoveInfoModal=xp,L.SpaceNoSelection=c2,L.SpaceQuota=V0,L.TextEditor=v2,L.ThemeConfig=WF,L.TransferType=mr,L.UnsavedChangesModal=g0,L.UppyService=nC,L.UserAvatar=ld,L.ViewOptions=c0,L.VisibilityObserver=Nv,L.WebDavDetails=z0,L.WebThemeConfig=av,L.activeApp=Nl,L.authContextValues=FT,L.blobToArrayBuffer=$b,L.breadcrumbsFromPath=wP,L.buildRoutes=ZF,L.buildUrl=kT,L.cacheService=Zl,L.canvasToBlob=Db,L.cloneStateObject=Op,L.concatBreadcrumbs=SP,L.contextQueryToFileContextProps=dv,L.contextRouteNameKey=ta,L.contextRouteParamsKey=Cf,L.contextRouteQueryKey=Pf,L.createDefaultFileIconMapping=Mp,L.createFileRouteOptions=ir,L.createLocationCommon=Ci,L.createLocationPublic=Pi,L.createLocationShares=$n,L.createLocationSpaces=Nn,L.createLocationTrash=Fi,L.defaultFuseOptions=pl,L.defineWebApplication=ow,L.determineResourceTableSortFields=Oh,L.determineResourceTilesSortFields=YT,L.dirname=dt.dirname,L.displayPositionedDropdown=To,L.encodePath=Af,L.eventBus=Ke,L.filterResources=sE,L.focusCheckbox=$T,L.folderService=Yy,L.formatDateFromDateTime=oi,L.formatDateFromHTTP=EP,L.formatDateFromISO=Cb,L.formatDateFromJSDate=Ib,L.formatDateFromRFC=TP,L.formatFileSize=An,L.formatRelativeDateFromDateTime=Ao,L.formatRelativeDateFromHTTP=AP,L.formatRelativeDateFromISO=RP,L.formatRelativeDateFromJSDate=Pb,L.formatRelativeDateFromRFC=_P,L.getIndicators=Nb,L.getLocaleFromLanguage=Gs,L.getParentPaths=Fb,L.getSharedAncestorRoute=NT,L.getSharedDriveItem=vs,L.getSpacesByType=_o,L.isLocationActive=YF,L.isLocationCommonActive=Ct,L.isLocationPublicActive=Fn,L.isLocationSharesActive=jt,L.isLocationSpacesActive=ht,L.isLocationTrashActive=Tn,L.isMacOs=Ks,L.isResourceBeeingMovedToSameLocation=$p,L.isSameResource=ro,L.locationPublicLink=kl,L.locationPublicUpload=xl,L.locationSharesViaLink=Ol,L.locationSharesWithMe=bs,L.locationSharesWithOthers=Fl,L.locationSpacesGeneric=Pl,L.objectKeys=zI,L.queryItemAsString=Rt,L.renameResource=hl,L.resolveFileNameDuplicate=zn,L.resourceIconMappingInjectionKey=Lp,L.routeToContextQuery=na,L.setCurrentUserShareSpacePermissions=Eh,L.sortFields=kh,L.sortHelper=Ph,L.sortSpaceMembers=cv,L.translateSortFields=JT,L.triggerDownloadWithFilename=Jl,L.useAbility=mn,L.useActionsShowDetails=rx,L.useActiveApp=OT,L.useActiveLocation=Kn,L.useAppConfig=wh,L.useAppDefaults=vv,L.useAppFileHandling=Ff,L.useAppFolderHandling=hv,L.useAppMeta=xf,L.useAppNavigation=pv,L.useAppProviderService=ox,L.useAppsStore=or,L.useArchiverService=_v,L.useAuthService=Of,L.useAuthStore=ei,L.useAvatarsStore=Ys,L.useBreadcrumbsFromPath=sx,L.useCanBeOpenedWithSecureView=Yf,L.useCanListShares=Ov,L.useCanListVersions=t0,L.useCanShare=kv,L.useCapabilityStore=sn,L.useClientService=Ge,L.useClipboard=Df,L.useClipboardStore=Ro,L.useConfigStore=st,L.useCreateSpace=Ui,L.useCropperKeyboardActions=Xf,L.useDeleteWorker=wv,L.useDocumentTitle=gv,L.useDownloadFile=Iv,L.useDriveResolver=bv,L.useEmbedMode=si,L.useEventBus=li,L.useExtensionPreferencesStore=Mb,L.useExtensionRegistry=Bi,L.useFileActions=Xn,L.useFileActionsCopy=ca,L.useFileActionsCopyPermanentLink=Lf,L.useFileActionsCreateLink=Ck,L.useFileActionsCreateNewFile=wO,L.useFileActionsCreateNewFolder=vO,L.useFileActionsCreateNewShortcut=rk,L.useFileActionsCreateSpaceFromResource=Vf,L.useFileActionsDelete=Po,L.useFileActionsDeleteResources=Tv,L.useFileActionsDisableSync=ua,L.useFileActionsDownloadArchive=fa,L.useFileActionsDownloadFile=Fo,L.useFileActionsEmptyTrashBin=fO,L.useFileActionsEnableSync=aa,L.useFileActionsFavorite=Mf,L.useFileActionsMove=da,L.useFileActionsNavigate=Bf,L.useFileActionsOpenShortcut=ik,L.useFileActionsOpenWithApp=jv,L.useFileActionsPaste=Cv,L.useFileActionsRename=pa,L.useFileActionsRestore=ha,L.useFileActionsSaveAs=qv,L.useFileActionsSetImage=Fv,L.useFileActionsShowActions=bO,L.useFileActionsShowDetails=Uf,L.useFileActionsShowShares=qf,L.useFileActionsToggleHideShare=la,L.useFileListHeaderPosition=ax,L.useFileRouteReplace=Js,L.useFolderLink=ui,L.useGetMatchingSpace=un,L.useGetResourceContext=n0,L.useGroupingSettings=J2,L.useIsAppActive=Av,L.useIsFilesAppActive=_r,L.useIsResourceNameValid=ci,L.useIsSearchActive=sa,L.useIsTopBarSticky=Gf,L.useKeyboardActions=Qf,L.useLinkTypes=ga,L.useLoadAvatars=o0,L.useLoadPreview=Zf,L.useLoadingService=fn,L.useLocalStorage=If,L.useMessages=tt,L.useModals=pt,L.useOpenEmptyEditor=ix,L.useOpenWithDefaultApp=Qv,L.usePagination=cx,L.usePasswordPolicyService=e0,L.usePasteWorker=Sv,L.usePortalTarget=dx,L.usePreviewService=jf,L.useRequest=mv,L.useRequestHeaders=ia,L.useResourceContents=i0,L.useResourceRouteResolver=ma,L.useResourcesStore=Qe,L.useRestoreWorker=Ev,L.useRoute=Kt,L.useRouteMeta=uv,L.useRouteName=Zs,L.useRouteParam=ea,L.useRouteQuery=an,L.useRouteQueryPersisted=Ar,L.useRouter=He,L.useScrollTo=xv,L.useSearch=kf,L.useSelectedResources=ed,L.useService=vr,L.useSharesStore=Tr,L.useSideBar=Ob,L.useSort=HT,L.useSpaceActionsDelete=Vv,L.useSpaceActionsDeleteImage=nx,L.useSpaceActionsDisable=zv,L.useSpaceActionsDuplicate=Wv,L.useSpaceActionsEditDescription=jk,L.useSpaceActionsEditQuota=Kv,L.useSpaceActionsEditReadmeContent=Xk,L.useSpaceActionsNavigateToTrash=Jk,L.useSpaceActionsRename=Xv,L.useSpaceActionsRestore=Yv,L.useSpaceActionsSetIcon=tx,L.useSpaceActionsShowMembers=Yk,L.useSpaceHelpers=ra,L.useSpacesLoading=yv,L.useSpacesStore=at,L.useThemeStore=ai,L.useTileSize=r0,L.useTokenTimerWorker=iO,L.useUpload=mx,L.useUserStore=yt,L.useViewMode=px,L.useViewSize=hx,L.useViewSizeMax=Jf,L.useWebWorkersStore=Io,L.useWindowOpen=Zv,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});