@xwiki/cristal-sharedworker-impl 0.13.0 → 0.15.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,57 +0,0 @@
1
- var Dh=Object.defineProperty;var tc=be=>{throw TypeError(be)};var Ih=(be,Ae,Me)=>Ae in be?Dh(be,Ae,{enumerable:!0,configurable:!0,writable:!0,value:Me}):be[Ae]=Me;var X=(be,Ae,Me)=>Ih(be,typeof Ae!="symbol"?Ae+"":Ae,Me),nc=(be,Ae,Me)=>Ae.has(be)||tc("Cannot "+Me);var ve=(be,Ae,Me)=>(nc(be,Ae,"read from private field"),Me?Me.call(be):Ae.get(be)),Vt=(be,Ae,Me)=>Ae.has(be)?tc("Cannot add the same private member more than once"):Ae instanceof WeakSet?Ae.add(be):Ae.set(be,Me),xt=(be,Ae,Me,Un)=>(nc(be,Ae,"write to private field"),Un?Un.call(be,Me):Ae.set(be,Me),Me);(function(){"use strict";var wu,sr,_u,xu,Eu,Rt,Su,qe,ar,ur,fn,cr,lr,Ou;var be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ae(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Me={};/*! *****************************************************************************
2
- Copyright (C) Microsoft. All rights reserved.
3
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
- this file except in compliance with the License. You may obtain a copy of the
5
- License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
- MERCHANTABLITY OR NON-INFRINGEMENT.
11
-
12
- See the Apache Version 2.0 License for specific language governing permissions
13
- and limitations under the License.
14
- ***************************************************************************** */var Un;function rc(){if(Un)return Me;Un=1;var t;return function(e){(function(n){var o=typeof globalThis=="object"?globalThis:typeof be=="object"?be:typeof self=="object"?self:typeof this=="object"?this:m(),s=c(e);typeof o.Reflect<"u"&&(s=c(o.Reflect,s)),n(s,o),typeof o.Reflect>"u"&&(o.Reflect=e);function c(T,$){return function(S,F){Object.defineProperty(T,S,{configurable:!0,writable:!0,value:F}),$&&$(S,F)}}function f(){try{return Function("return this;")()}catch{}}function p(){try{return(0,eval)("(function() { return this; })()")}catch{}}function m(){return f()||p()}})(function(n,o){var s=Object.prototype.hasOwnProperty,c=typeof Symbol=="function",f=c&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",p=c&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",m=typeof Object.create=="function",T={__proto__:[]}instanceof Array,$=!m&&!T,S={create:m?function(){return mt(Object.create(null))}:T?function(){return mt({__proto__:null})}:function(){return mt({})},has:$?function(C,D){return s.call(C,D)}:function(C,D){return D in C},get:$?function(C,D){return s.call(C,D)?C[D]:void 0}:function(C,D){return C[D]}},F=Object.getPrototypeOf(Function),H=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:yn(),oe=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:hr(),fe=typeof WeakMap=="function"?WeakMap:Fn(),Ve=c?Symbol.for("@reflect-metadata:registry"):void 0,We=vi(),je=gn(We);function dt(C,D,N,M){if(ee(N)){if(!de(C))throw new TypeError;if(!pi(D))throw new TypeError;return Mt(C,D)}else{if(!de(C))throw new TypeError;if(!ye(D))throw new TypeError;if(!ye(M)&&!ee(M)&&!kt(M))throw new TypeError;return kt(M)&&(M=void 0),N=Xe(N),ts(C,D,N,M)}}n("decorate",dt);function re(C,D){function N(M,J){if(!ye(M))throw new TypeError;if(!ee(J)&&!jt(J))throw new TypeError;Nt(C,D,M,J)}return N}n("metadata",re);function Ye(C,D,N,M){if(!ye(N))throw new TypeError;return ee(M)||(M=Xe(M)),Nt(C,D,N,M)}n("defineMetadata",Ye);function Qe(C,D,N){if(!ye(D))throw new TypeError;return ee(N)||(N=Xe(N)),Mn(C,D,N)}n("hasMetadata",Qe);function Re(C,D,N){if(!ye(D))throw new TypeError;return ee(N)||(N=Xe(N)),hn(C,D,N)}n("hasOwnMetadata",Re);function ui(C,D,N){if(!ye(D))throw new TypeError;return ee(N)||(N=Xe(N)),fi(C,D,N)}n("getMetadata",ui);function es(C,D,N){if(!ye(D))throw new TypeError;return ee(N)||(N=Xe(N)),vt(C,D,N)}n("getOwnMetadata",es);function ci(C,D){if(!ye(C))throw new TypeError;return ee(D)||(D=Xe(D)),ht(C,D)}n("getMetadataKeys",ci);function li(C,D){if(!ye(C))throw new TypeError;return ee(D)||(D=Xe(D)),Nn(C,D)}n("getOwnMetadataKeys",li);function dn(C,D,N){if(!ye(D))throw new TypeError;if(ee(N)||(N=Xe(N)),!ye(D))throw new TypeError;ee(N)||(N=Xe(N));var M=Ft(D,N,!1);return ee(M)?!1:M.OrdinaryDeleteMetadata(C,D,N)}n("deleteMetadata",dn);function Mt(C,D){for(var N=C.length-1;N>=0;--N){var M=C[N],J=M(D);if(!ee(J)&&!kt(J)){if(!pi(J))throw new TypeError;D=J}}return D}function ts(C,D,N,M){for(var J=C.length-1;J>=0;--J){var me=C[J],xe=me(D,N,M);if(!ee(xe)&&!kt(xe)){if(!ye(xe))throw new TypeError;M=xe}}return M}function Mn(C,D,N){var M=hn(C,D,N);if(M)return!0;var J=$n(D);return kt(J)?!1:Mn(C,J,N)}function hn(C,D,N){var M=Ft(D,N,!1);return ee(M)?!1:Z(M.OrdinaryHasOwnMetadata(C,D,N))}function fi(C,D,N){var M=hn(C,D,N);if(M)return vt(C,D,N);var J=$n(D);if(!kt(J))return fi(C,J,N)}function vt(C,D,N){var M=Ft(D,N,!1);if(!ee(M))return M.OrdinaryGetOwnMetadata(C,D,N)}function Nt(C,D,N,M){var J=Ft(N,M,!0);J.OrdinaryDefineOwnMetadata(C,D,N,M)}function ht(C,D){var N=Nn(C,D),M=$n(C);if(M===null)return N;var J=ht(M,D);if(J.length<=0)return N;if(N.length<=0)return J;for(var me=new oe,xe=[],j=0,U=N;j<U.length;j++){var z=U[j],G=me.has(z);G||(me.add(z),xe.push(z))}for(var Q=0,ie=J;Q<ie.length;Q++){var z=ie[Q],G=me.has(z);G||(me.add(z),xe.push(z))}return xe}function Nn(C,D){var N=Ft(C,D,!1);return N?N.OrdinaryOwnMetadataKeys(C,D):[]}function di(C){if(C===null)return 1;switch(typeof C){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return C===null?1:6;default:return 6}}function ee(C){return C===void 0}function kt(C){return C===null}function kn(C){return typeof C=="symbol"}function ye(C){return typeof C=="object"?C!==null:typeof C=="function"}function fr(C,D){switch(di(C)){case 0:return C;case 1:return C;case 2:return C;case 3:return C;case 4:return C;case 5:return C}var N="string",M=gi(C,f);if(M!==void 0){var J=M.call(C,N);if(ye(J))throw new TypeError;return J}return ns(C)}function ns(C,D){var N,M;{var J=C.toString;if(bt(J)){var M=J.call(C);if(!ye(M))return M}var N=C.valueOf;if(bt(N)){var M=N.call(C);if(!ye(M))return M}}throw new TypeError}function Z(C){return!!C}function hi(C){return""+C}function Xe(C){var D=fr(C);return kn(D)?D:hi(D)}function de(C){return Array.isArray?Array.isArray(C):C instanceof Object?C instanceof Array:Object.prototype.toString.call(C)==="[object Array]"}function bt(C){return typeof C=="function"}function pi(C){return typeof C=="function"}function jt(C){switch(di(C)){case 3:return!0;case 4:return!0;default:return!1}}function dr(C,D){return C===D||C!==C&&D!==D}function gi(C,D){var N=C[D];if(N!=null){if(!bt(N))throw new TypeError;return N}}function yi(C){var D=gi(C,p);if(!bt(D))throw new TypeError;var N=D.call(C);if(!ye(N))throw new TypeError;return N}function mi(C){return C.value}function jn(C){var D=C.next();return D.done?!1:D}function st(C){var D=C.return;D&&D.call(C)}function $n(C){var D=Object.getPrototypeOf(C);if(typeof C!="function"||C===F||D!==F)return D;var N=C.prototype,M=N&&Object.getPrototypeOf(N);if(M==null||M===Object.prototype)return D;var J=M.constructor;return typeof J!="function"||J===C?D:J}function pn(){var C;!ee(Ve)&&typeof o.Reflect<"u"&&!(Ve in o.Reflect)&&typeof o.Reflect.defineMetadata=="function"&&(C=$t(o.Reflect));var D,N,M,J=new fe,me={registerProvider:xe,getProvider:U,setProvider:G};return me;function xe(Q){if(!Object.isExtensible(me))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case C===Q:break;case ee(D):D=Q;break;case D===Q:break;case ee(N):N=Q;break;case N===Q:break;default:M===void 0&&(M=new oe),M.add(Q);break}}function j(Q,ie){if(!ee(D)){if(D.isProviderFor(Q,ie))return D;if(!ee(N)){if(N.isProviderFor(Q,ie))return D;if(!ee(M))for(var pe=yi(M);;){var Oe=jn(pe);if(!Oe)return;var $e=mi(Oe);if($e.isProviderFor(Q,ie))return st(pe),$e}}}if(!ee(C)&&C.isProviderFor(Q,ie))return C}function U(Q,ie){var pe=J.get(Q),Oe;return ee(pe)||(Oe=pe.get(ie)),ee(Oe)&&(Oe=j(Q,ie),ee(Oe)||(ee(pe)&&(pe=new H,J.set(Q,pe)),pe.set(ie,Oe))),Oe}function z(Q){if(ee(Q))throw new TypeError;return D===Q||N===Q||!ee(M)&&M.has(Q)}function G(Q,ie,pe){if(!z(pe))throw new Error("Metadata provider not registered.");var Oe=U(Q,ie);if(Oe!==pe){if(!ee(Oe))return!1;var $e=J.get(Q);ee($e)&&($e=new H,J.set(Q,$e)),$e.set(ie,pe)}return!0}}function vi(){var C;return!ee(Ve)&&ye(o.Reflect)&&Object.isExtensible(o.Reflect)&&(C=o.Reflect[Ve]),ee(C)&&(C=pn()),!ee(Ve)&&ye(o.Reflect)&&Object.isExtensible(o.Reflect)&&Object.defineProperty(o.Reflect,Ve,{enumerable:!1,configurable:!1,writable:!1,value:C}),C}function gn(C){var D=new fe,N={isProviderFor:function(z,G){var Q=D.get(z);return ee(Q)?!1:Q.has(G)},OrdinaryDefineOwnMetadata:xe,OrdinaryHasOwnMetadata:J,OrdinaryGetOwnMetadata:me,OrdinaryOwnMetadataKeys:j,OrdinaryDeleteMetadata:U};return We.registerProvider(N),N;function M(z,G,Q){var ie=D.get(z),pe=!1;if(ee(ie)){if(!Q)return;ie=new H,D.set(z,ie),pe=!0}var Oe=ie.get(G);if(ee(Oe)){if(!Q)return;if(Oe=new H,ie.set(G,Oe),!C.setProvider(z,G,N))throw ie.delete(G),pe&&D.delete(z),new Error("Wrong provider for target.")}return Oe}function J(z,G,Q){var ie=M(G,Q,!1);return ee(ie)?!1:Z(ie.has(z))}function me(z,G,Q){var ie=M(G,Q,!1);if(!ee(ie))return ie.get(z)}function xe(z,G,Q,ie){var pe=M(Q,ie,!0);pe.set(z,G)}function j(z,G){var Q=[],ie=M(z,G,!1);if(ee(ie))return Q;for(var pe=ie.keys(),Oe=yi(pe),$e=0;;){var Lt=jn(Oe);if(!Lt)return Q.length=$e,Q;var pr=mi(Lt);try{Q[$e]=pr}catch(Ln){try{st(Oe)}finally{throw Ln}}$e++}}function U(z,G,Q){var ie=M(G,Q,!1);if(ee(ie)||!ie.delete(z))return!1;if(ie.size===0){var pe=D.get(G);ee(pe)||(pe.delete(Q),pe.size===0&&D.delete(pe))}return!0}}function $t(C){var D=C.defineMetadata,N=C.hasOwnMetadata,M=C.getOwnMetadata,J=C.getOwnMetadataKeys,me=C.deleteMetadata,xe=new fe,j={isProviderFor:function(U,z){var G=xe.get(U);return!ee(G)&&G.has(z)?!0:J(U,z).length?(ee(G)&&(G=new oe,xe.set(U,G)),G.add(z),!0):!1},OrdinaryDefineOwnMetadata:D,OrdinaryHasOwnMetadata:N,OrdinaryGetOwnMetadata:M,OrdinaryOwnMetadataKeys:J,OrdinaryDeleteMetadata:me};return j}function Ft(C,D,N){var M=We.getProvider(C,D);if(!ee(M))return M;if(N){if(We.setProvider(C,D,je))return je;throw new Error("Illegal state.")}}function yn(){var C={},D=[],N=function(){function j(U,z,G){this._index=0,this._keys=U,this._values=z,this._selector=G}return j.prototype["@@iterator"]=function(){return this},j.prototype[p]=function(){return this},j.prototype.next=function(){var U=this._index;if(U>=0&&U<this._keys.length){var z=this._selector(this._keys[U],this._values[U]);return U+1>=this._keys.length?(this._index=-1,this._keys=D,this._values=D):this._index++,{value:z,done:!1}}return{value:void 0,done:!0}},j.prototype.throw=function(U){throw this._index>=0&&(this._index=-1,this._keys=D,this._values=D),U},j.prototype.return=function(U){return this._index>=0&&(this._index=-1,this._keys=D,this._values=D),{value:U,done:!0}},j}(),M=function(){function j(){this._keys=[],this._values=[],this._cacheKey=C,this._cacheIndex=-2}return Object.defineProperty(j.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),j.prototype.has=function(U){return this._find(U,!1)>=0},j.prototype.get=function(U){var z=this._find(U,!1);return z>=0?this._values[z]:void 0},j.prototype.set=function(U,z){var G=this._find(U,!0);return this._values[G]=z,this},j.prototype.delete=function(U){var z=this._find(U,!1);if(z>=0){for(var G=this._keys.length,Q=z+1;Q<G;Q++)this._keys[Q-1]=this._keys[Q],this._values[Q-1]=this._values[Q];return this._keys.length--,this._values.length--,dr(U,this._cacheKey)&&(this._cacheKey=C,this._cacheIndex=-2),!0}return!1},j.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=C,this._cacheIndex=-2},j.prototype.keys=function(){return new N(this._keys,this._values,J)},j.prototype.values=function(){return new N(this._keys,this._values,me)},j.prototype.entries=function(){return new N(this._keys,this._values,xe)},j.prototype["@@iterator"]=function(){return this.entries()},j.prototype[p]=function(){return this.entries()},j.prototype._find=function(U,z){if(!dr(this._cacheKey,U)){this._cacheIndex=-1;for(var G=0;G<this._keys.length;G++)if(dr(this._keys[G],U)){this._cacheIndex=G;break}}return this._cacheIndex<0&&z&&(this._cacheIndex=this._keys.length,this._keys.push(U),this._values.push(void 0)),this._cacheIndex},j}();return M;function J(j,U){return j}function me(j,U){return U}function xe(j,U){return[j,U]}}function hr(){var C=function(){function D(){this._map=new H}return Object.defineProperty(D.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),D.prototype.has=function(N){return this._map.has(N)},D.prototype.add=function(N){return this._map.set(N,N),this},D.prototype.delete=function(N){return this._map.delete(N)},D.prototype.clear=function(){this._map.clear()},D.prototype.keys=function(){return this._map.keys()},D.prototype.values=function(){return this._map.keys()},D.prototype.entries=function(){return this._map.entries()},D.prototype["@@iterator"]=function(){return this.keys()},D.prototype[p]=function(){return this.keys()},D}();return C}function Fn(){var C=16,D=S.create(),N=M();return function(){function U(){this._key=M()}return U.prototype.has=function(z){var G=J(z,!1);return G!==void 0?S.has(G,this._key):!1},U.prototype.get=function(z){var G=J(z,!1);return G!==void 0?S.get(G,this._key):void 0},U.prototype.set=function(z,G){var Q=J(z,!0);return Q[this._key]=G,this},U.prototype.delete=function(z){var G=J(z,!1);return G!==void 0?delete G[this._key]:!1},U.prototype.clear=function(){this._key=M()},U}();function M(){var U;do U="@@WeakMap@@"+j();while(S.has(D,U));return D[U]=!0,U}function J(U,z){if(!s.call(U,N)){if(!z)return;Object.defineProperty(U,N,{value:S.create()})}return U[N]}function me(U,z){for(var G=0;G<z;++G)U[G]=Math.random()*255|0;return U}function xe(U){if(typeof Uint8Array=="function"){var z=new Uint8Array(U);return typeof crypto<"u"?crypto.getRandomValues(z):typeof msCrypto<"u"?msCrypto.getRandomValues(z):me(z,U),z}return me(new Array(U),U)}function j(){var U=xe(C);U[6]=U[6]&79|64,U[8]=U[8]&191|128;for(var z="",G=0;G<C;++G){var Q=U[G];(G===4||G===6||G===8)&&(z+="-"),Q<16&&(z+="0"),z+=Q.toString(16).toLowerCase()}return z}}function mt(C){return C.__=void 0,delete C.__,C}})}(t||(t={})),Me}rc();const Bi=Symbol.for("@inversifyjs/common/islazyServiceIdentifier");let ic=(wu=Bi,_u=class{constructor(e){X(this,wu);Vt(this,sr);xt(this,sr,e),this[Bi]=!0}static is(e){return typeof e=="object"&&e!==null&&e[Bi]===!0}unwrap(){return ve(this,sr).call(this)}},sr=new WeakMap,_u);function Et(t,e){return Reflect.getMetadata(e,t)}function Ts(t,e,n,o){const s=o(Et(t,e)??n);Reflect.defineMetadata(e,s,t)}const Sr="named",qi="name",Vi="unmanaged",Wi="optional",Ui="inject",Hi="multi_inject",Rs="post_construct",Ms="pre_destroy",oc=[Ui,Hi,qi,Vi,Sr,Wi],zi=Symbol.for("@inversifyjs/core/InversifyCoreError");class St extends(Eu=Error,xu=zi,Eu){constructor(n,o,s){super(o,s);X(this,xu);X(this,"kind");this[zi]=!0,this.kind=n}static is(n){return typeof n=="object"&&n!==null&&n[zi]===!0}static isErrorOfKind(n,o){return St.is(n)&&n.kind===o}}var Ot,Ze;function Ns(t,e){const n=[];for(let o=0;o<e.length;++o)e[o]===void 0&&n.push(o);if(n.length>0)throw new St(Ot.missingInjectionDecorator,`Found unexpected missing metadata on type "${t.name}" at constructor indexes "${n.join('", "')}".
15
-
16
- Are you using @inject, @multiInject or @unmanaged decorators at those indexes?
17
-
18
- If you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`)}function ks(t){return{kind:Ze.singleInjection,name:void 0,optional:!1,tags:new Map,targetName:void 0,value:t}}function Or(t){const e=t.find(f=>f.key===Ui),n=t.find(f=>f.key===Hi);if(t.find(f=>f.key===Vi)!==void 0)return function(f,p){if(p!==void 0||f!==void 0)throw new St(Ot.missingInjectionDecorator,"Expected a single @inject, @multiInject or @unmanaged metadata");return{kind:Ze.unmanaged}}(e,n);if(n===void 0&&e===void 0)throw new St(Ot.missingInjectionDecorator,"Expected @inject, @multiInject or @unmanaged metadata");const o=t.find(f=>f.key===Sr),s=t.find(f=>f.key===Wi),c=t.find(f=>f.key===qi);return{kind:e===void 0?Ze.multipleInjection:Ze.singleInjection,name:o==null?void 0:o.value,optional:s!==void 0,tags:new Map(t.filter(f=>oc.every(p=>f.key!==p)).map(f=>[f.key,f.value])),targetName:c==null?void 0:c.value,value:e===void 0?n==null?void 0:n.value:e.value}}function js(t,e,n){try{return Or(n)}catch(o){throw St.isErrorOfKind(o,Ot.missingInjectionDecorator)?new St(Ot.missingInjectionDecorator,`Expected a single @inject, @multiInject or @unmanaged decorator at type "${t.name}" at constructor arguments at index "${e.toString()}"`,{cause:o}):o}}function sc(t){const e=Et(t,"design:paramtypes"),n=Et(t,"inversify:tagged"),o=[];if(n!==void 0)for(const[s,c]of Object.entries(n)){const f=parseInt(s);o[f]=js(t,f,c)}if(e!==void 0){for(let s=0;s<e.length;++s)if(o[s]===void 0){const c=e[s];o[s]=ks(c)}}return Ns(t,o),o}function $s(t,e,n){try{return Or(n)}catch(o){throw St.isErrorOfKind(o,Ot.missingInjectionDecorator)?new St(Ot.missingInjectionDecorator,`Expected a single @inject, @multiInject or @unmanaged decorator at type "${t.name}" at property "${e.toString()}"`,{cause:o}):o}}function Fs(t){const e=Et(t,"inversify:tagged_props"),n=new Map;if(e!==void 0)for(const o of Reflect.ownKeys(e)){const s=e[o];n.set(o,$s(t,o,s))}return n}function ac(t){const e=Et(t,Rs),n=Et(t,Ms);return{constructorArguments:sc(t),lifecycle:{postConstructMethodName:e==null?void 0:e.value,preDestroyMethodName:n==null?void 0:n.value},properties:Fs(t)}}function uc(t,e){const n=e.getConstructorMetadata(t),o=[];for(const[s,c]of Object.entries(n.userGeneratedMetadata)){const f=parseInt(s);o[f]=js(t,f,c)}if(n.compilerGeneratedMetadata!==void 0){for(let s=0;s<n.compilerGeneratedMetadata.length;++s)if(o[s]===void 0){const c=n.compilerGeneratedMetadata[s];o[s]=ks(c)}}return Ns(t,o),o}function Ls(t,e){const n=e.getPropertiesMetadata(t),o=new Map;for(const s of Reflect.ownKeys(n)){const c=n[s];o.set(s,$s(t,s,c))}return o}function cc(t,e){const n=Et(t,Rs),o=Et(t,Ms);return{constructorArguments:uc(t,e),lifecycle:{postConstructMethodName:n==null?void 0:n.value,preDestroyMethodName:o==null?void 0:o.value},properties:Ls(t,e)}}function Ks(t){const e=Object.getPrototypeOf(t.prototype);return e==null?void 0:e.constructor}function lc(t){return t.kind===Ze.unmanaged?[{key:Vi,value:!0}]:function(e){const n=[fc(e)];e.name!==void 0&&n.push({key:Sr,value:e.name}),e.optional&&n.push({key:Wi,value:!0});for(const[o,s]of e.tags)n.push({key:o,value:s});return e.targetName!==void 0&&n.push({key:qi,value:e.targetName}),n}(t)}function fc(t){let e;switch(t.kind){case Ze.multipleInjection:e={key:Hi,value:t.value};break;case Ze.singleInjection:e={key:Ui,value:t.value}}return e}(function(t){t[t.injectionDecoratorConflict=0]="injectionDecoratorConflict",t[t.missingInjectionDecorator=1]="missingInjectionDecorator",t[t.planning=2]="planning",t[t.unknown=3]="unknown"})(Ot||(Ot={})),function(t){t[t.multipleInjection=0]="multipleInjection",t[t.singleInjection=1]="singleInjection",t[t.unmanaged=2]="unmanaged"}(Ze||(Ze={}));let dc=(Su=class{constructor(e){Vt(this,Rt);xt(this,Rt,e)}startsWith(e){return ve(this,Rt).startsWith(e)}endsWith(e){return ve(this,Rt).endsWith(e)}contains(e){return ve(this,Rt).includes(e)}equals(e){return ve(this,Rt)===e}value(){return ve(this,Rt)}},Rt=new WeakMap,Su);const Gi="@inversifyjs/core/targetId";let Ar=(Ou=class{constructor(e,n,o){Vt(this,qe);Vt(this,ar);Vt(this,ur);Vt(this,fn);Vt(this,cr);Vt(this,lr);xt(this,ar,function(){const s=Et(Object,Gi)??0;return s===Number.MAX_SAFE_INTEGER?Ts(Object,Gi,s,()=>Number.MIN_SAFE_INTEGER):Ts(Object,Gi,s,c=>c+1),s}()),xt(this,ur,e),xt(this,fn,void 0),xt(this,qe,n),xt(this,cr,new dc(typeof e=="string"?e:e.toString().slice(7,-1))),xt(this,lr,o)}get id(){return ve(this,ar)}get identifier(){return ve(this,ur)}get metadata(){return ve(this,fn)===void 0&&xt(this,fn,lc(ve(this,qe))),ve(this,fn)}get name(){return ve(this,cr)}get type(){return ve(this,lr)}get serviceIdentifier(){return ic.is(ve(this,qe).value)?ve(this,qe).value.unwrap():ve(this,qe).value}getCustomTags(){return[...ve(this,qe).tags.entries()].map(([e,n])=>({key:e,value:n}))}getNamedTag(){return ve(this,qe).name===void 0?null:{key:Sr,value:ve(this,qe).name}}hasTag(e){return this.metadata.some(n=>n.key===e)}isArray(){return ve(this,qe).kind===Ze.multipleInjection}isNamed(){return ve(this,qe).name!==void 0}isOptional(){return ve(this,qe).optional}isTagged(){return ve(this,qe).tags.size>0}matchesArray(e){return this.isArray()&&ve(this,qe).value===e}matchesNamedTag(e){return ve(this,qe).name===e}matchesTag(e){return n=>this.metadata.some(o=>o.key===e&&o.value===n)}},qe=new WeakMap,ar=new WeakMap,ur=new WeakMap,fn=new WeakMap,cr=new WeakMap,lr=new WeakMap,Ou);const Bs=t=>function(e,n){return function(o){const s=e(o);let c=Ks(o);for(;c!==void 0&&c!==Object;){const p=n(c);for(const[m,T]of p)s.properties.has(m)||s.properties.set(m,T);c=Ks(c)}const f=[];for(const p of s.constructorArguments)if(p.kind!==Ze.unmanaged){const m=p.targetName??"";f.push(new Ar(m,p,"ConstructorArgument"))}for(const[p,m]of s.properties)if(m.kind!==Ze.unmanaged){const T=m.targetName??p;f.push(new Ar(T,m,"ClassProperty"))}return f}}(t===void 0?ac:e=>cc(e,t),t===void 0?Fs:e=>Ls(e,t)),ct="named",qs="unmanaged",Vs="optional",Ws="inject",hc="multi_inject",Us="inversify:tagged",Hs="inversify:tagged_props",zs="inversify:paramtypes",Gs="design:paramtypes",Ys="post_construct",Yi="pre_destroy",Pe={Request:"Request",Singleton:"Singleton",Transient:"Transient"},ge={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},Qs={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"};let pc=0;function Cr(){return pc++}class Qi{constructor(e,n){X(this,"id");X(this,"moduleId");X(this,"activated");X(this,"serviceIdentifier");X(this,"implementationType");X(this,"cache");X(this,"dynamicValue");X(this,"scope");X(this,"type");X(this,"factory");X(this,"provider");X(this,"constraint");X(this,"onActivation");X(this,"onDeactivation");this.id=Cr(),this.activated=!1,this.serviceIdentifier=e,this.scope=n,this.type=ge.Invalid,this.constraint=o=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.onDeactivation=null,this.dynamicValue=null}clone(){const e=new Qi(this.serviceIdentifier,this.scope);return e.activated=e.scope===Pe.Singleton&&this.activated,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.onDeactivation=this.onDeactivation,e.cache=this.cache,e}}const Xs="Metadata key was used more than once in a parameter:",Js="NULL argument",Zs="Key Not Found",gc="Ambiguous match found for serviceIdentifier:",yc="No matching bindings found for serviceIdentifier:",ea="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",Xi=(t,e)=>`onDeactivation() error in class ${t}: ${e}`;class mc{getConstructorMetadata(e){return{compilerGeneratedMetadata:Reflect.getMetadata(Gs,e)??[],userGeneratedMetadata:Reflect.getMetadata(Us,e)??{}}}getPropertiesMetadata(e){return Reflect.getMetadata(Hs,e)??{}}}var En;function ta(t){return t instanceof RangeError||t.message==="Maximum call stack size exceeded"}(function(t){t[t.MultipleBindingsAvailable=2]="MultipleBindingsAvailable",t[t.NoBindingsAvailable=0]="NoBindingsAvailable",t[t.OnlyOneBindingAvailable=1]="OnlyOneBindingAvailable"})(En||(En={}));function Wt(t){return typeof t=="function"?t.name:typeof t=="symbol"?t.toString():t}function na(t,e,n){let o="";const s=n(t,e);return s.length!==0&&(o=`
19
- Registered bindings:`,s.forEach(c=>{let f="Object";c.implementationType!==null&&(f=oa(c.implementationType)),o=`${o}
20
- ${f}`,c.constraint.metaData&&(o=`${o} - ${c.constraint.metaData}`)})),o}function ra(t,e){return t.parentRequest!==null&&(t.parentRequest.serviceIdentifier===e||ra(t.parentRequest,e))}function ia(t){t.childRequests.forEach(e=>{if(ra(t,e.serviceIdentifier)){const n=function(o){return function c(f,p=[]){const m=Wt(f.serviceIdentifier);return p.push(m),f.parentRequest!==null?c(f.parentRequest,p):p}(o).reverse().join(" --> ")}(e);throw new Error(`Circular dependency found: ${n}`)}ia(e)})}function oa(t){if(t.name!=null&&t.name!=="")return t.name;{const e=t.toString(),n=e.match(/^function\s*([^\s(]+)/);return n===null?`Anonymous function: ${e}`:n[1]}}function sa(t){return`{"key":"${t.key.toString()}","value":"${t.value.toString()}"}`}class aa{constructor(e){X(this,"id");X(this,"container");X(this,"plan");X(this,"currentRequest");this.id=Cr(),this.container=e}addPlan(e){this.plan=e}setCurrentRequest(e){this.currentRequest=e}}class Ut{constructor(e,n){X(this,"key");X(this,"value");this.key=e,this.value=n}toString(){return this.key===ct?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}class vc{constructor(e,n){X(this,"parentContext");X(this,"rootRequest");this.parentContext=e,this.rootRequest=n}}function ua(t,e){const n=function(p){const m=Object.getPrototypeOf(p.prototype);return m==null?void 0:m.constructor}(e);if(n===void 0||n===Object)return 0;const o=Bs(t)(n),s=o.map(p=>p.metadata.filter(m=>m.key===qs)),c=[].concat.apply([],s).length,f=o.length-c;return f>0?f:ua(t,n)}class Hn{constructor(e,n,o,s,c){X(this,"id");X(this,"serviceIdentifier");X(this,"parentContext");X(this,"parentRequest");X(this,"bindings");X(this,"childRequests");X(this,"target");X(this,"requestScope");this.id=Cr(),this.serviceIdentifier=e,this.parentContext=n,this.parentRequest=o,this.target=c,this.childRequests=[],this.bindings=Array.isArray(s)?s:[s],this.requestScope=o===null?new Map:null}addChildRequest(e,n,o){const s=new Hn(e,this.parentContext,this,n,o);return this.childRequests.push(s),s}}function Pr(t){return t._bindingDictionary}function ca(t,e,n,o,s){let c=zn(n.container,s.serviceIdentifier),f=[];return c.length===En.NoBindingsAvailable&&n.container.options.autoBindInjectable===!0&&typeof s.serviceIdentifier=="function"&&t.getConstructorMetadata(s.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(s.serviceIdentifier).toSelf(),c=zn(n.container,s.serviceIdentifier)),f=e?c:c.filter(p=>{const m=new Hn(p.serviceIdentifier,n,o,p,s);return p.constraint(m)}),function(p,m,T,$,S){switch(m.length){case En.NoBindingsAvailable:if($.isOptional())return m;{const F=Wt(p);let H=yc;throw H+=function(oe,fe){if(fe.isTagged()||fe.isNamed()){let Ve="";const We=fe.getNamedTag(),je=fe.getCustomTags();return We!==null&&(Ve+=sa(We)+`
21
- `),je!==null&&je.forEach(dt=>{Ve+=sa(dt)+`
22
- `}),` ${oe}
23
- ${oe} - ${Ve}`}return` ${oe}`}(F,$),H+=na(S,F,zn),T!==null&&(H+=`
24
- Trying to resolve bindings for "${Wt(T.serviceIdentifier)}"`),new Error(H)}case En.OnlyOneBindingAvailable:return m;case En.MultipleBindingsAvailable:default:if($.isArray())return m;{const F=Wt(p);let H=`${gc} ${F}`;throw H+=na(S,F,zn),new Error(H)}}}(s.serviceIdentifier,f,o,s,n.container),f}function la(t,e){const n=e.isMultiInject?hc:Ws,o=[new Ut(n,t)];return e.customTag!==void 0&&o.push(new Ut(e.customTag.key,e.customTag.value)),e.isOptional===!0&&o.push(new Ut(Vs,!0)),o}function fa(t,e,n,o,s,c){let f,p;if(s===null){f=ca(t,e,o,null,c),p=new Hn(n,o,null,f,c);const m=new vc(o,p);o.addPlan(m)}else f=ca(t,e,o,s,c),p=s.addChildRequest(c.serviceIdentifier,f,c);f.forEach(m=>{let T=null;if(c.isArray())T=p.addChildRequest(m.serviceIdentifier,m,c);else{if(m.cache!==null)return;T=p}if(m.type===ge.Instance&&m.implementationType!==null){const $=function(S,F){return Bs(S)(F)}(t,m.implementationType);if(o.container.options.skipBaseClassChecks!==!0){const S=ua(t,m.implementationType);if($.length<S){const F=`The number of constructor arguments in the derived class ${oa(m.implementationType)} must be >= than the number of constructor arguments of its base class.`;throw new Error(F)}}$.forEach(S=>{fa(t,!1,S.serviceIdentifier,o,T,S)})}})}function zn(t,e){let n=[];const o=Pr(t);return o.hasKey(e)?n=o.get(e):t.parent!==null&&(n=zn(t.parent,e)),n}function bc(t,e,n,o,s,c=!1){const f=new aa(e),p=function(m,T,$){const S=la(T,$),F=Or(S);if(F.kind===Ze.unmanaged)throw new Error("Unexpected metadata when creating target");return new Ar("",F,m)}(n,o,s);try{return fa(t,c,o,f,null,p),f}catch(m){throw ta(m)&&ia(f.plan.rootRequest),m}}function et(t){return(typeof t=="object"&&t!==null||typeof t=="function")&&typeof t.then=="function"}function da(t){return!!et(t)||Array.isArray(t)&&t.some(et)}const wc=(t,e,n)=>{t.has(e.id)||t.set(e.id,n)},_c=(t,e)=>{t.cache=e,t.activated=!0,et(e)&&xc(t,e)},xc=async(t,e)=>{try{const n=await e;t.cache=n}catch(n){throw t.cache=null,t.activated=!1,n}};var Gn;(function(t){t.DynamicValue="toDynamicValue",t.Factory="toFactory",t.Provider="toProvider"})(Gn||(Gn={}));function Ec(t,e,n){let o;if(e.length>0){const s=function(f,p){return f.reduce((m,T)=>{const $=p(T);return T.target.type===Qs.ConstructorArgument?m.constructorInjections.push($):(m.propertyRequests.push(T),m.propertyInjections.push($)),m.isAsync||(m.isAsync=da($)),m},{constructorInjections:[],isAsync:!1,propertyInjections:[],propertyRequests:[]})}(e,n),c={...s,constr:t};o=s.isAsync?async function(f){const p=await pa(f.constructorInjections),m=await pa(f.propertyInjections);return ha({...f,constructorInjections:p,propertyInjections:m})}(c):ha(c)}else o=new t;return o}function ha(t){const e=new t.constr(...t.constructorInjections);return t.propertyRequests.forEach((n,o)=>{const s=n.target.identifier,c=t.propertyInjections[o];n.target.isOptional()&&c===void 0||(e[s]=c)}),e}async function pa(t){const e=[];for(const n of t)Array.isArray(n)?e.push(Promise.all(n)):e.push(n);return Promise.all(e)}function ga(t,e){const n=function(o,s){var p;if(Reflect.hasMetadata(Ys,o)){const m=Reflect.getMetadata(Ys,o);try{return(p=s[m.value])==null?void 0:p.call(s)}catch(T){if(T instanceof Error)throw new Error((c=o.name,f=T.message,`@postConstruct error in class ${c}: ${f}`))}}var c,f}(t,e);return et(n)?n.then(()=>e):e}function Sc(t,e){t.scope!==Pe.Singleton&&function(n,o){const s=`Class cannot be instantiated in ${n.scope===Pe.Request?"request":"transient"} scope.`;if(typeof n.onDeactivation=="function")throw new Error(Xi(o.name,s));if(Reflect.hasMetadata(Yi,o))throw new Error(`@preDestroy error in class ${o.name}: ${s}`)}(t,e)}const Ji=t=>e=>{e.parentContext.setCurrentRequest(e);const n=e.bindings,o=e.childRequests,s=e.target&&e.target.isArray(),c=!(e.parentRequest&&e.parentRequest.target&&e.target&&e.parentRequest.target.matchesArray(e.target.serviceIdentifier));if(s&&c)return o.map(f=>Ji(t)(f));{if(e.target.isOptional()&&n.length===0)return;const f=n[0];return Pc(t,e,f)}},Oc=(t,e)=>{const n=(o=>{switch(o.type){case ge.Factory:return{factory:o.factory,factoryType:Gn.Factory};case ge.Provider:return{factory:o.provider,factoryType:Gn.Provider};case ge.DynamicValue:return{factory:o.dynamicValue,factoryType:Gn.DynamicValue};default:throw new Error(`Unexpected factory type ${o.type}`)}})(t);return((o,s)=>{try{return o()}catch(c){throw ta(c)?s():c}})(()=>n.factory.bind(t)(e),()=>{return new Error((o=n.factoryType,s=e.currentRequest.serviceIdentifier.toString(),`It looks like there is a circular dependency in one of the '${o}' bindings. Please investigate bindings with service identifier '${s}'.`));var o,s})},Ac=(t,e,n)=>{let o;const s=e.childRequests;switch((c=>{let f=null;switch(c.type){case ge.ConstantValue:case ge.Function:f=c.cache;break;case ge.Constructor:case ge.Instance:f=c.implementationType;break;case ge.DynamicValue:f=c.dynamicValue;break;case ge.Provider:f=c.provider;break;case ge.Factory:f=c.factory}if(f===null){const p=Wt(c.serviceIdentifier);throw new Error(`Invalid binding type: ${p}`)}})(n),n.type){case ge.ConstantValue:case ge.Function:o=n.cache;break;case ge.Constructor:o=n.implementationType;break;case ge.Instance:o=function(c,f,p,m){Sc(c,f);const T=Ec(f,p,m);return et(T)?T.then($=>ga(f,$)):ga(f,T)}(n,n.implementationType,s,Ji(t));break;default:o=Oc(n,e.parentContext)}return o},Cc=(t,e,n)=>{let o=((s,c)=>c.scope===Pe.Singleton&&c.activated?c.cache:c.scope===Pe.Request&&s.has(c.id)?s.get(c.id):null)(t,e);return o!==null||(o=n(),((s,c,f)=>{c.scope===Pe.Singleton&&_c(c,f),c.scope===Pe.Request&&wc(s,c,f)})(t,e,o)),o},Pc=(t,e,n)=>Cc(t,n,()=>{let o=Ac(t,e,n);return o=et(o)?o.then(s=>ya(e,n,s)):ya(e,n,o),o});function ya(t,e,n){let o=Dc(t.parentContext,e,n);const s=Rc(t.parentContext.container);let c,f=s.next();do{c=f.value;const p=t.parentContext,m=t.serviceIdentifier,T=Tc(c,m);o=et(o)?ma(T,p,o):Ic(T,p,o),f=s.next()}while(f.done!==!0&&!Pr(c).hasKey(t.serviceIdentifier));return o}const Dc=(t,e,n)=>{let o;return o=typeof e.onActivation=="function"?e.onActivation(t,n):n,o},Ic=(t,e,n)=>{let o=t.next();for(;o.done!==!0;){if(et(n=o.value(e,n)))return ma(t,e,n);o=t.next()}return n},ma=async(t,e,n)=>{let o=await n,s=t.next();for(;s.done!==!0;)o=await s.value(e,o),s=t.next();return o},Tc=(t,e)=>{const n=t._activations;return n.hasKey(e)?n.get(e).values():[].values()},Rc=t=>{const e=[t];let n=t.parent;for(;n!==null;)e.push(n),n=n.parent;return{next:()=>{const o=e.pop();return o!==void 0?{done:!1,value:o}:{done:!0,value:void 0}}}},At=(t,e)=>{const n=t.parentRequest;return n!==null&&(!!e(n)||At(n,e))},Yn=t=>e=>{const n=o=>o!==null&&o.target!==null&&o.target.matchesTag(t)(e);return n.metaData=new Ut(t,e),n},Dr=Yn(ct),Zi=t=>e=>{let n=null;if(e!==null){if(n=e.bindings[0],typeof t=="string")return n.serviceIdentifier===t;{const o=e.bindings[0].implementationType;return t===o}}return!1};class Ir{constructor(e){X(this,"_binding");this._binding=e}when(e){return this._binding.constraint=e,new Ke(this._binding)}whenTargetNamed(e){return this._binding.constraint=Dr(e),new Ke(this._binding)}whenTargetIsDefault(){return this._binding.constraint=e=>e===null?!1:e.target!==null&&!e.target.isNamed()&&!e.target.isTagged(),new Ke(this._binding)}whenTargetTagged(e,n){return this._binding.constraint=Yn(e)(n),new Ke(this._binding)}whenInjectedInto(e){return this._binding.constraint=n=>n!==null&&Zi(e)(n.parentRequest),new Ke(this._binding)}whenParentNamed(e){return this._binding.constraint=n=>n!==null&&Dr(e)(n.parentRequest),new Ke(this._binding)}whenParentTagged(e,n){return this._binding.constraint=o=>o!==null&&Yn(e)(n)(o.parentRequest),new Ke(this._binding)}whenAnyAncestorIs(e){return this._binding.constraint=n=>n!==null&&At(n,Zi(e)),new Ke(this._binding)}whenNoAncestorIs(e){return this._binding.constraint=n=>n!==null&&!At(n,Zi(e)),new Ke(this._binding)}whenAnyAncestorNamed(e){return this._binding.constraint=n=>n!==null&&At(n,Dr(e)),new Ke(this._binding)}whenNoAncestorNamed(e){return this._binding.constraint=n=>n!==null&&!At(n,Dr(e)),new Ke(this._binding)}whenAnyAncestorTagged(e,n){return this._binding.constraint=o=>o!==null&&At(o,Yn(e)(n)),new Ke(this._binding)}whenNoAncestorTagged(e,n){return this._binding.constraint=o=>o!==null&&!At(o,Yn(e)(n)),new Ke(this._binding)}whenAnyAncestorMatches(e){return this._binding.constraint=n=>n!==null&&At(n,e),new Ke(this._binding)}whenNoAncestorMatches(e){return this._binding.constraint=n=>n!==null&&!At(n,e),new Ke(this._binding)}}class Ke{constructor(e){X(this,"_binding");this._binding=e}onActivation(e){return this._binding.onActivation=e,new Ir(this._binding)}onDeactivation(e){return this._binding.onDeactivation=e,new Ir(this._binding)}}class Ct{constructor(e){X(this,"_bindingWhenSyntax");X(this,"_bindingOnSyntax");X(this,"_binding");this._binding=e,this._bindingWhenSyntax=new Ir(this._binding),this._bindingOnSyntax=new Ke(this._binding)}when(e){return this._bindingWhenSyntax.when(e)}whenTargetNamed(e){return this._bindingWhenSyntax.whenTargetNamed(e)}whenTargetIsDefault(){return this._bindingWhenSyntax.whenTargetIsDefault()}whenTargetTagged(e,n){return this._bindingWhenSyntax.whenTargetTagged(e,n)}whenInjectedInto(e){return this._bindingWhenSyntax.whenInjectedInto(e)}whenParentNamed(e){return this._bindingWhenSyntax.whenParentNamed(e)}whenParentTagged(e,n){return this._bindingWhenSyntax.whenParentTagged(e,n)}whenAnyAncestorIs(e){return this._bindingWhenSyntax.whenAnyAncestorIs(e)}whenNoAncestorIs(e){return this._bindingWhenSyntax.whenNoAncestorIs(e)}whenAnyAncestorNamed(e){return this._bindingWhenSyntax.whenAnyAncestorNamed(e)}whenAnyAncestorTagged(e,n){return this._bindingWhenSyntax.whenAnyAncestorTagged(e,n)}whenNoAncestorNamed(e){return this._bindingWhenSyntax.whenNoAncestorNamed(e)}whenNoAncestorTagged(e,n){return this._bindingWhenSyntax.whenNoAncestorTagged(e,n)}whenAnyAncestorMatches(e){return this._bindingWhenSyntax.whenAnyAncestorMatches(e)}whenNoAncestorMatches(e){return this._bindingWhenSyntax.whenNoAncestorMatches(e)}onActivation(e){return this._bindingOnSyntax.onActivation(e)}onDeactivation(e){return this._bindingOnSyntax.onDeactivation(e)}}class Mc{constructor(e){X(this,"_binding");this._binding=e}inRequestScope(){return this._binding.scope=Pe.Request,new Ct(this._binding)}inSingletonScope(){return this._binding.scope=Pe.Singleton,new Ct(this._binding)}inTransientScope(){return this._binding.scope=Pe.Transient,new Ct(this._binding)}}class va{constructor(e){X(this,"_bindingInSyntax");X(this,"_bindingWhenSyntax");X(this,"_bindingOnSyntax");X(this,"_binding");this._binding=e,this._bindingWhenSyntax=new Ir(this._binding),this._bindingOnSyntax=new Ke(this._binding),this._bindingInSyntax=new Mc(e)}inRequestScope(){return this._bindingInSyntax.inRequestScope()}inSingletonScope(){return this._bindingInSyntax.inSingletonScope()}inTransientScope(){return this._bindingInSyntax.inTransientScope()}when(e){return this._bindingWhenSyntax.when(e)}whenTargetNamed(e){return this._bindingWhenSyntax.whenTargetNamed(e)}whenTargetIsDefault(){return this._bindingWhenSyntax.whenTargetIsDefault()}whenTargetTagged(e,n){return this._bindingWhenSyntax.whenTargetTagged(e,n)}whenInjectedInto(e){return this._bindingWhenSyntax.whenInjectedInto(e)}whenParentNamed(e){return this._bindingWhenSyntax.whenParentNamed(e)}whenParentTagged(e,n){return this._bindingWhenSyntax.whenParentTagged(e,n)}whenAnyAncestorIs(e){return this._bindingWhenSyntax.whenAnyAncestorIs(e)}whenNoAncestorIs(e){return this._bindingWhenSyntax.whenNoAncestorIs(e)}whenAnyAncestorNamed(e){return this._bindingWhenSyntax.whenAnyAncestorNamed(e)}whenAnyAncestorTagged(e,n){return this._bindingWhenSyntax.whenAnyAncestorTagged(e,n)}whenNoAncestorNamed(e){return this._bindingWhenSyntax.whenNoAncestorNamed(e)}whenNoAncestorTagged(e,n){return this._bindingWhenSyntax.whenNoAncestorTagged(e,n)}whenAnyAncestorMatches(e){return this._bindingWhenSyntax.whenAnyAncestorMatches(e)}whenNoAncestorMatches(e){return this._bindingWhenSyntax.whenNoAncestorMatches(e)}onActivation(e){return this._bindingOnSyntax.onActivation(e)}onDeactivation(e){return this._bindingOnSyntax.onDeactivation(e)}}class Nc{constructor(e){X(this,"_binding");this._binding=e}to(e){return this._binding.type=ge.Instance,this._binding.implementationType=e,new va(this._binding)}toSelf(){if(typeof this._binding.serviceIdentifier!="function")throw new Error("The toSelf function can only be applied when a constructor is used as service identifier");const e=this._binding.serviceIdentifier;return this.to(e)}toConstantValue(e){return this._binding.type=ge.ConstantValue,this._binding.cache=e,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=Pe.Singleton,new Ct(this._binding)}toDynamicValue(e){return this._binding.type=ge.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=e,this._binding.implementationType=null,new va(this._binding)}toConstructor(e){return this._binding.type=ge.Constructor,this._binding.implementationType=e,this._binding.scope=Pe.Singleton,new Ct(this._binding)}toFactory(e){return this._binding.type=ge.Factory,this._binding.factory=e,this._binding.scope=Pe.Singleton,new Ct(this._binding)}toFunction(e){if(typeof e!="function")throw new Error("Value provided to function binding must be a function!");const n=this.toConstantValue(e);return this._binding.type=ge.Function,this._binding.scope=Pe.Singleton,n}toAutoFactory(e){return this._binding.type=ge.Factory,this._binding.factory=n=>()=>n.container.get(e),this._binding.scope=Pe.Singleton,new Ct(this._binding)}toAutoNamedFactory(e){return this._binding.type=ge.Factory,this._binding.factory=n=>o=>n.container.getNamed(e,o),new Ct(this._binding)}toProvider(e){return this._binding.type=ge.Provider,this._binding.provider=e,this._binding.scope=Pe.Singleton,new Ct(this._binding)}toService(e){this._binding.type=ge.DynamicValue,Object.defineProperty(this._binding,"cache",{configurable:!0,enumerable:!0,get:()=>null,set(n){}}),this._binding.dynamicValue=n=>{try{return n.container.get(e)}catch{return n.container.getAsync(e)}},this._binding.implementationType=null}}class eo{constructor(){X(this,"bindings");X(this,"activations");X(this,"deactivations");X(this,"middleware");X(this,"moduleActivationStore")}static of(e,n,o,s,c){const f=new eo;return f.bindings=e,f.middleware=n,f.deactivations=s,f.activations=o,f.moduleActivationStore=c,f}}class Pt{constructor(){X(this,"_map");this._map=new Map}getMap(){return this._map}add(e,n){if(this._checkNonNulish(e),n==null)throw new Error(Js);const o=this._map.get(e);o!==void 0?o.push(n):this._map.set(e,[n])}get(e){this._checkNonNulish(e);const n=this._map.get(e);if(n!==void 0)return n;throw new Error(Zs)}remove(e){if(this._checkNonNulish(e),!this._map.delete(e))throw new Error(Zs)}removeIntersection(e){this.traverse((n,o)=>{const s=e.hasKey(n)?e.get(n):void 0;if(s!==void 0){const c=o.filter(f=>!s.some(p=>f===p));this._setValue(n,c)}})}removeByCondition(e){const n=[];return this._map.forEach((o,s)=>{const c=[];for(const f of o)e(f)?n.push(f):c.push(f);this._setValue(s,c)}),n}hasKey(e){return this._checkNonNulish(e),this._map.has(e)}clone(){const e=new Pt;return this._map.forEach((n,o)=>{n.forEach(s=>{var c;e.add(o,typeof(c=s)=="object"&&c!==null&&"clone"in c&&typeof c.clone=="function"?s.clone():s)})}),e}traverse(e){this._map.forEach((n,o)=>{e(o,n)})}_checkNonNulish(e){if(e==null)throw new Error(Js)}_setValue(e,n){n.length>0?this._map.set(e,n):this._map.delete(e)}}class to{constructor(){X(this,"_map",new Map)}remove(e){const n=this._map.get(e);return n===void 0?this._getEmptyHandlersStore():(this._map.delete(e),n)}addDeactivation(e,n,o){this._getModuleActivationHandlers(e).onDeactivations.add(n,o)}addActivation(e,n,o){this._getModuleActivationHandlers(e).onActivations.add(n,o)}clone(){const e=new to;return this._map.forEach((n,o)=>{e._map.set(o,{onActivations:n.onActivations.clone(),onDeactivations:n.onDeactivations.clone()})}),e}_getModuleActivationHandlers(e){let n=this._map.get(e);return n===void 0&&(n=this._getEmptyHandlersStore(),this._map.set(e,n)),n}_getEmptyHandlersStore(){return{onActivations:new Pt,onDeactivations:new Pt}}}class Tr{constructor(e){X(this,"id");X(this,"parent");X(this,"options");X(this,"_middleware");X(this,"_bindingDictionary");X(this,"_activations");X(this,"_deactivations");X(this,"_snapshots");X(this,"_metadataReader");X(this,"_moduleActivationStore");const n=e||{};if(typeof n!="object")throw new Error("Invalid Container constructor argument. Container options must be an object.");if(n.defaultScope===void 0)n.defaultScope=Pe.Transient;else if(n.defaultScope!==Pe.Singleton&&n.defaultScope!==Pe.Transient&&n.defaultScope!==Pe.Request)throw new Error('Invalid Container option. Default scope must be a string ("singleton" or "transient").');if(n.autoBindInjectable===void 0)n.autoBindInjectable=!1;else if(typeof n.autoBindInjectable!="boolean")throw new Error("Invalid Container option. Auto bind injectable must be a boolean");if(n.skipBaseClassChecks===void 0)n.skipBaseClassChecks=!1;else if(typeof n.skipBaseClassChecks!="boolean")throw new Error("Invalid Container option. Skip base check must be a boolean");this.options={autoBindInjectable:n.autoBindInjectable,defaultScope:n.defaultScope,skipBaseClassChecks:n.skipBaseClassChecks},this.id=Cr(),this._bindingDictionary=new Pt,this._snapshots=[],this._middleware=null,this._activations=new Pt,this._deactivations=new Pt,this.parent=null,this._metadataReader=new mc,this._moduleActivationStore=new to}static merge(e,n,...o){const s=new Tr,c=[e,n,...o].map(p=>Pr(p)),f=Pr(s);return c.forEach(p=>{var m;m=f,p.traverse((T,$)=>{$.forEach(S=>{m.add(S.serviceIdentifier,S.clone())})})}),s}load(...e){const n=this._getContainerModuleHelpersFactory();for(const o of e){const s=n(o.id);o.registry(s.bindFunction,s.unbindFunction,s.isboundFunction,s.rebindFunction,s.unbindAsyncFunction,s.onActivationFunction,s.onDeactivationFunction)}}async loadAsync(...e){const n=this._getContainerModuleHelpersFactory();for(const o of e){const s=n(o.id);await o.registry(s.bindFunction,s.unbindFunction,s.isboundFunction,s.rebindFunction,s.unbindAsyncFunction,s.onActivationFunction,s.onDeactivationFunction)}}unload(...e){e.forEach(n=>{const o=this._removeModuleBindings(n.id);this._deactivateSingletons(o),this._removeModuleHandlers(n.id)})}async unloadAsync(...e){for(const n of e){const o=this._removeModuleBindings(n.id);await this._deactivateSingletonsAsync(o),this._removeModuleHandlers(n.id)}}bind(e){return this._bind(this._buildBinding(e))}rebind(e){return this.unbind(e),this.bind(e)}async rebindAsync(e){return await this.unbindAsync(e),this.bind(e)}unbind(e){if(this._bindingDictionary.hasKey(e)){const n=this._bindingDictionary.get(e);this._deactivateSingletons(n)}this._removeServiceFromDictionary(e)}async unbindAsync(e){if(this._bindingDictionary.hasKey(e)){const n=this._bindingDictionary.get(e);await this._deactivateSingletonsAsync(n)}this._removeServiceFromDictionary(e)}unbindAll(){this._bindingDictionary.traverse((e,n)=>{this._deactivateSingletons(n)}),this._bindingDictionary=new Pt}async unbindAllAsync(){const e=[];this._bindingDictionary.traverse((n,o)=>{e.push(this._deactivateSingletonsAsync(o))}),await Promise.all(e),this._bindingDictionary=new Pt}onActivation(e,n){this._activations.add(e,n)}onDeactivation(e,n){this._deactivations.add(e,n)}isBound(e){let n=this._bindingDictionary.hasKey(e);return!n&&this.parent&&(n=this.parent.isBound(e)),n}isCurrentBound(e){return this._bindingDictionary.hasKey(e)}isBoundNamed(e,n){return this.isBoundTagged(e,ct,n)}isBoundTagged(e,n,o){let s=!1;if(this._bindingDictionary.hasKey(e)){const c=this._bindingDictionary.get(e),f=function(p,m,T){const $=la(m,T),S=Or($);if(S.kind===Ze.unmanaged)throw new Error("Unexpected metadata when creating target");const F=new Ar("",S,"Variable"),H=new aa(p);return new Hn(m,H,null,[],F)}(this,e,{customTag:{key:n,value:o},isMultiInject:!1});s=c.some(p=>p.constraint(f))}return!s&&this.parent&&(s=this.parent.isBoundTagged(e,n,o)),s}snapshot(){this._snapshots.push(eo.of(this._bindingDictionary.clone(),this._middleware,this._activations.clone(),this._deactivations.clone(),this._moduleActivationStore.clone()))}restore(){const e=this._snapshots.pop();if(e===void 0)throw new Error("No snapshot available to restore.");this._bindingDictionary=e.bindings,this._activations=e.activations,this._deactivations=e.deactivations,this._middleware=e.middleware,this._moduleActivationStore=e.moduleActivationStore}createChild(e){const n=new Tr(e||this.options);return n.parent=this,n}applyMiddleware(...e){const n=this._middleware?this._middleware:this._planAndResolve();this._middleware=e.reduce((o,s)=>s(o),n)}applyCustomMetadataReader(e){this._metadataReader=e}get(e){const n=this._getNotAllArgs(e,!1,!1);return this._getButThrowIfAsync(n)}async getAsync(e){const n=this._getNotAllArgs(e,!1,!1);return this._get(n)}getTagged(e,n,o){const s=this._getNotAllArgs(e,!1,!1,n,o);return this._getButThrowIfAsync(s)}async getTaggedAsync(e,n,o){const s=this._getNotAllArgs(e,!1,!1,n,o);return this._get(s)}getNamed(e,n){return this.getTagged(e,ct,n)}async getNamedAsync(e,n){return this.getTaggedAsync(e,ct,n)}getAll(e,n){const o=this._getAllArgs(e,n,!1);return this._getButThrowIfAsync(o)}async getAllAsync(e,n){const o=this._getAllArgs(e,n,!1);return this._getAll(o)}getAllTagged(e,n,o){const s=this._getNotAllArgs(e,!0,!1,n,o);return this._getButThrowIfAsync(s)}async getAllTaggedAsync(e,n,o){const s=this._getNotAllArgs(e,!0,!1,n,o);return this._getAll(s)}getAllNamed(e,n){return this.getAllTagged(e,ct,n)}async getAllNamedAsync(e,n){return this.getAllTaggedAsync(e,ct,n)}resolve(e){const n=this.isBound(e);n||this.bind(e).toSelf();const o=this.get(e);return n||this.unbind(e),o}tryGet(e){const n=this._getNotAllArgs(e,!1,!0);return this._getButThrowIfAsync(n)}async tryGetAsync(e){const n=this._getNotAllArgs(e,!1,!0);return this._get(n)}tryGetTagged(e,n,o){const s=this._getNotAllArgs(e,!1,!0,n,o);return this._getButThrowIfAsync(s)}async tryGetTaggedAsync(e,n,o){const s=this._getNotAllArgs(e,!1,!0,n,o);return this._get(s)}tryGetNamed(e,n){return this.tryGetTagged(e,ct,n)}async tryGetNamedAsync(e,n){return this.tryGetTaggedAsync(e,ct,n)}tryGetAll(e,n){const o=this._getAllArgs(e,n,!0);return this._getButThrowIfAsync(o)}async tryGetAllAsync(e,n){const o=this._getAllArgs(e,n,!0);return this._getAll(o)}tryGetAllTagged(e,n,o){const s=this._getNotAllArgs(e,!0,!0,n,o);return this._getButThrowIfAsync(s)}async tryGetAllTaggedAsync(e,n,o){const s=this._getNotAllArgs(e,!0,!0,n,o);return this._getAll(s)}tryGetAllNamed(e,n){return this.tryGetAllTagged(e,ct,n)}async tryGetAllNamedAsync(e,n){return this.tryGetAllTaggedAsync(e,ct,n)}_preDestroy(e,n){var o;if(e!==void 0&&Reflect.hasMetadata(Yi,e)){const s=Reflect.getMetadata(Yi,e);return(o=n[s.value])==null?void 0:o.call(n)}}_removeModuleHandlers(e){const n=this._moduleActivationStore.remove(e);this._activations.removeIntersection(n.onActivations),this._deactivations.removeIntersection(n.onDeactivations)}_removeModuleBindings(e){return this._bindingDictionary.removeByCondition(n=>n.moduleId===e)}_deactivate(e,n){const o=n==null?void 0:Object.getPrototypeOf(n).constructor;try{if(this._deactivations.hasKey(e.serviceIdentifier)){const c=this._deactivateContainer(n,this._deactivations.get(e.serviceIdentifier).values());if(et(c))return this._handleDeactivationError(c.then(async()=>this._propagateContainerDeactivationThenBindingAndPreDestroyAsync(e,n,o)),e.serviceIdentifier)}const s=this._propagateContainerDeactivationThenBindingAndPreDestroy(e,n,o);if(et(s))return this._handleDeactivationError(s,e.serviceIdentifier)}catch(s){if(s instanceof Error)throw new Error(Xi(Wt(e.serviceIdentifier),s.message))}}async _handleDeactivationError(e,n){try{await e}catch(o){if(o instanceof Error)throw new Error(Xi(Wt(n),o.message))}}_deactivateContainer(e,n){let o=n.next();for(;typeof o.value=="function";){const s=o.value(e);if(et(s))return s.then(async()=>this._deactivateContainerAsync(e,n));o=n.next()}}async _deactivateContainerAsync(e,n){let o=n.next();for(;typeof o.value=="function";)await o.value(e),o=n.next()}_getContainerModuleHelpersFactory(){const e=m=>T=>{const $=this._buildBinding(T);return $.moduleId=m,this._bind($)},n=()=>m=>{this.unbind(m)},o=()=>async m=>this.unbindAsync(m),s=()=>m=>this.isBound(m),c=m=>{const T=e(m);return $=>(this.unbind($),T($))},f=m=>(T,$)=>{this._moduleActivationStore.addActivation(m,T,$),this.onActivation(T,$)},p=m=>(T,$)=>{this._moduleActivationStore.addDeactivation(m,T,$),this.onDeactivation(T,$)};return m=>({bindFunction:e(m),isboundFunction:s(),onActivationFunction:f(m),onDeactivationFunction:p(m),rebindFunction:c(m),unbindAsyncFunction:o(),unbindFunction:n()})}_bind(e){return this._bindingDictionary.add(e.serviceIdentifier,e),new Nc(e)}_buildBinding(e){const n=this.options.defaultScope||Pe.Transient;return new Qi(e,n)}async _getAll(e){return Promise.all(this._get(e))}_get(e){const n={...e,contextInterceptor:o=>o,targetType:Qs.Variable};if(this._middleware){const o=this._middleware(n);if(o==null)throw new Error("Invalid return type in middleware. Middleware must return!");return o}return this._planAndResolve()(n)}_getButThrowIfAsync(e){const n=this._get(e);if(da(n))throw new Error(`You are attempting to construct ${function(o){return typeof o=="function"?`[function/class ${o.name||"<anonymous>"}]`:typeof o=="symbol"?o.toString():`'${o}'`}(e.serviceIdentifier)} in a synchronous way but it has asynchronous dependencies.`);return n}_getAllArgs(e,n,o){return{avoidConstraints:!(n!=null&&n.enforceBindingConstraints),isMultiInject:!0,isOptional:o,serviceIdentifier:e}}_getNotAllArgs(e,n,o,s,c){return{avoidConstraints:!1,isMultiInject:n,isOptional:o,key:s,serviceIdentifier:e,value:c}}_getPlanMetadataFromNextArgs(e){const n={isMultiInject:e.isMultiInject};return e.key!==void 0&&(n.customTag={key:e.key,value:e.value}),e.isOptional===!0&&(n.isOptional=!0),n}_planAndResolve(){return e=>{let n=bc(this._metadataReader,this,e.targetType,e.serviceIdentifier,this._getPlanMetadataFromNextArgs(e),e.avoidConstraints);return n=e.contextInterceptor(n),function(s){return Ji(s.plan.rootRequest.requestScope)(s.plan.rootRequest)}(n)}}_deactivateIfSingleton(e){if(e.activated)return et(e.cache)?e.cache.then(n=>this._deactivate(e,n)):this._deactivate(e,e.cache)}_deactivateSingletons(e){for(const n of e)if(et(this._deactivateIfSingleton(n)))throw new Error("Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)")}async _deactivateSingletonsAsync(e){await Promise.all(e.map(async n=>this._deactivateIfSingleton(n)))}_propagateContainerDeactivationThenBindingAndPreDestroy(e,n,o){return this.parent?this._deactivate.bind(this.parent)(e,n):this._bindingDeactivationAndPreDestroy(e,n,o)}async _propagateContainerDeactivationThenBindingAndPreDestroyAsync(e,n,o){this.parent?await this._deactivate.bind(this.parent)(e,n):await this._bindingDeactivationAndPreDestroyAsync(e,n,o)}_removeServiceFromDictionary(e){try{this._bindingDictionary.remove(e)}catch{throw new Error(`Could not unbind serviceIdentifier: ${Wt(e)}`)}}_bindingDeactivationAndPreDestroy(e,n,o){if(typeof e.onDeactivation=="function"){const s=e.onDeactivation(n);if(et(s))return s.then(()=>this._preDestroy(o,n))}return this._preDestroy(o,n)}async _bindingDeactivationAndPreDestroyAsync(e,n,o){typeof e.onDeactivation=="function"&&await e.onDeactivation(n),await this._preDestroy(o,n)}}function ba(t,e,n,o){(function(s){if(s!==void 0)throw new Error(ea)})(e),wa(Us,t,n.toString(),o)}function kc(t){let e=[];if(Array.isArray(t)){e=t;const n=function(o){const s=new Set;for(const c of o){if(s.has(c))return c;s.add(c)}}(e.map(o=>o.key));if(n!==void 0)throw new Error(`${Xs} ${n.toString()}`)}else e=[t];return e}function wa(t,e,n,o){const s=kc(o);let c={};Reflect.hasOwnMetadata(t,e)&&(c=Reflect.getMetadata(t,e));let f=c[n];if(f===void 0)f=[];else for(const p of f)if(s.some(m=>m.key===p.key))throw new Error(`${Xs} ${p.key.toString()}`);f.push(...s),c[n]=f,Reflect.defineMetadata(t,c,e)}function no(t){return(e,n,o)=>{typeof o=="number"?ba(e,n,o,t):function(s,c,f){if(s.prototype!==void 0)throw new Error(ea);wa(Hs,s.constructor,c,f)}(e,n,t)}}function Ne(){return function(t){if(Reflect.hasOwnMetadata(zs,t))throw new Error("Cannot apply @injectable decorator multiple times.");const e=Reflect.getMetadata(Gs,t)||[];return Reflect.defineMetadata(zs,e,t),t}}function ro(t){return no(new Ut(ct,t))}function jc(t){return e=>(n,o,s)=>{if(e===void 0){const c=typeof n=="function"?n.name:n.constructor.name;throw new Error(`@inject called with undefined this could mean that the class ${c} has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation.`)}no(new Ut(t,e))(n,o,s)}}const Se=jc(Ws);function $c(){return no(new Ut(Vs,!0))}function Fc(){return function(t,e,n){ba(t,e,n,new Ut(qs,!0))}}var Lc=Object.defineProperty,Kc=Object.getOwnPropertyDescriptor,Bc=(t,e,n,o)=>{for(var s=o>1?void 0:o?Kc(e,n):e,c=t.length-1,f;c>=0;c--)(f=t[c])&&(s=(o?f(e,n,s):f(s))||s);return o&&s&&Lc(e,n,s),s};let io=class{constructor(){this.availableConfigurations=new Map}getApp(){throw new Error("Method not implemented.")}getRouter(){throw new Error("Method not implemented.")}getContainer(){return this.container}setContainer(t){this.container=t}getWikiConfig(){return this.wikiConfig}setWikiConfig(t){this.wikiConfig=t}getSkinManager(){throw new Error("Method not implemented.")}switchConfig(){}setAvailableConfigurations(t){console.log(t),t.forEach((e,n)=>{const o=e==null?void 0:e.configType;if(e){const s=this.container.getNamed("WikiConfig",o);s.setConfigFromObject(e),this.availableConfigurations.set(n,s)}})}getAvailableConfigurations(){return this.availableConfigurations}run(){throw new Error("Method not implemented.")}getUIXTemplates(){throw new Error("Method not implemented.")}getMenuEntries(){throw new Error("Method not implemented.")}getCurrentPage(){throw new Error("Method not implemented.")}getCurrentContent(){throw new Error("Method not implemented.")}getCurrentSource(){throw new Error("Method not implemented.")}getCurrentSyntax(){throw new Error("Method not implemented.")}setCurrentPage(){throw new Error("Method not implemented.")}setContentRef(){throw new Error("Method not implemented.")}loadPageFromURL(){throw new Error("Method not implemented.")}loadPage(){throw new Error("Method not implemented.")}getPage(){throw new Error("Method not implemented.")}getLogger(){throw new Error("Method not implemented.")}getLoggerConfig(){throw new Error("Method not implemented.")}renderContent(){throw new Error("Method not implemented.")}};io=Bc([Ne()],io);var qc=Object.defineProperty,Vc=Object.getOwnPropertyDescriptor,Wc=(t,e,n,o)=>{for(var s=o>1?void 0:o?Vc(e,n):e,c=t.length-1,f;c>=0;c--)(f=t[c])&&(s=(o?f(e,n,s):f(s))||s);return o&&s&&qc(e,n,s),s};let oo=class{constructor(){this.initialize()}initialize(){}getStatus(){return!0}async increment(){return 0}async addToQueue(){}async getQueueSize(){return 0}};oo=Wc([Ne()],oo);var Uc=Object.defineProperty,Hc=Object.getOwnPropertyDescriptor,zc=(t,e,n,o)=>{for(var s=o>1?void 0:o?Hc(e,n):e,c=t.length-1,f;c>=0;c--)(f=t[c])&&(s=(o?f(e,n,s):f(s))||s);return o&&s&&Uc(e,n,s),s},Gc=(t,e)=>(n,o)=>e(n,o,t);let so=class{constructor(t){this.cristalApp=t}get(t){const e=t||this.cristalApp.getWikiConfig().getType();try{return this.cristalApp.getContainer().getNamed("AuthenticationManager",e)}catch(n){this.cristalApp.getLogger("authentication.api").warn(`Couldn't resolve AuthenticationManager for type=[${e}]`,n);return}}};so=zc([Ne(),Gc(0,Se("CristalApp"))],so);let Yc=class{constructor(e){e.bind("AuthenticationManagerProvider").to(so).inSingletonScope()}};var Rr={exports:{}},Qc=Rr.exports,_a;function Xc(){return _a||(_a=1,function(t,e){(function(n,o){t.exports=o()})(Qc,function(){var n=function(r,i){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var l in u)Object.prototype.hasOwnProperty.call(u,l)&&(a[l]=u[l])})(r,i)},o=function(){return(o=Object.assign||function(r){for(var i,a=1,u=arguments.length;a<u;a++)for(var l in i=arguments[a])Object.prototype.hasOwnProperty.call(i,l)&&(r[l]=i[l]);return r}).apply(this,arguments)};function s(r,i,a){for(var u,l=0,d=i.length;l<d;l++)!u&&l in i||((u=u||Array.prototype.slice.call(i,0,l))[l]=i[l]);return r.concat(u||Array.prototype.slice.call(i))}var c=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:be,f=Object.keys,p=Array.isArray;function m(r,i){return typeof i!="object"||f(i).forEach(function(a){r[a]=i[a]}),r}typeof Promise>"u"||c.Promise||(c.Promise=Promise);var T=Object.getPrototypeOf,$={}.hasOwnProperty;function S(r,i){return $.call(r,i)}function F(r,i){typeof i=="function"&&(i=i(T(r))),(typeof Reflect>"u"?f:Reflect.ownKeys)(i).forEach(function(a){oe(r,a,i[a])})}var H=Object.defineProperty;function oe(r,i,a,u){H(r,i,m(a&&S(a,"get")&&typeof a.get=="function"?{get:a.get,set:a.set,configurable:!0}:{value:a,configurable:!0,writable:!0},u))}function fe(r){return{from:function(i){return r.prototype=Object.create(i.prototype),oe(r.prototype,"constructor",r),{extend:F.bind(null,r.prototype)}}}}var Ve=Object.getOwnPropertyDescriptor,We=[].slice;function je(r,i,a){return We.call(r,i,a)}function dt(r,i){return i(r)}function re(r){if(!r)throw new Error("Assertion Failed")}function Ye(r){c.setImmediate?setImmediate(r):setTimeout(r,0)}function Qe(r,i){if(typeof i=="string"&&S(r,i))return r[i];if(!i)return r;if(typeof i!="string"){for(var a=[],u=0,l=i.length;u<l;++u){var d=Qe(r,i[u]);a.push(d)}return a}var h=i.indexOf(".");if(h!==-1){var g=r[i.substr(0,h)];return g==null?void 0:Qe(g,i.substr(h+1))}}function Re(r,i,a){if(r&&i!==void 0&&!("isFrozen"in Object&&Object.isFrozen(r)))if(typeof i!="string"&&"length"in i){re(typeof a!="string"&&"length"in a);for(var u=0,l=i.length;u<l;++u)Re(r,i[u],a[u])}else{var d,h,g=i.indexOf(".");g!==-1?(d=i.substr(0,g),(h=i.substr(g+1))===""?a===void 0?p(r)&&!isNaN(parseInt(d))?r.splice(d,1):delete r[d]:r[d]=a:Re(g=!(g=r[d])||!S(r,d)?r[d]={}:g,h,a)):a===void 0?p(r)&&!isNaN(parseInt(i))?r.splice(i,1):delete r[i]:r[i]=a}}function ui(r){var i,a={};for(i in r)S(r,i)&&(a[i]=r[i]);return a}var es=[].concat;function ci(r){return es.apply([],r)}var Bt="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(ci([8,16,32,64].map(function(r){return["Int","Uint","Float"].map(function(i){return i+r+"Array"})}))).filter(function(r){return c[r]}),li=new Set(Bt.map(function(r){return c[r]})),dn=null;function Mt(r){return dn=new WeakMap,r=function i(a){if(!a||typeof a!="object")return a;var u=dn.get(a);if(u)return u;if(p(a)){u=[],dn.set(a,u);for(var l=0,d=a.length;l<d;++l)u.push(i(a[l]))}else if(li.has(a.constructor))u=a;else{var h,g=T(a);for(h in u=g===Object.prototype?{}:Object.create(g),dn.set(a,u),a)S(a,h)&&(u[h]=i(a[h]))}return u}(r),dn=null,r}var ts={}.toString;function Mn(r){return ts.call(r).slice(8,-1)}var hn=typeof Symbol<"u"?Symbol.iterator:"@@iterator",fi=typeof hn=="symbol"?function(r){var i;return r!=null&&(i=r[hn])&&i.apply(r)}:function(){return null};function vt(r,i){return i=r.indexOf(i),0<=i&&r.splice(i,1),0<=i}var Nt={};function ht(r){var i,a,u,l;if(arguments.length===1){if(p(r))return r.slice();if(this===Nt&&typeof r=="string")return[r];if(l=fi(r)){for(a=[];!(u=l.next()).done;)a.push(u.value);return a}if(r==null)return[r];if(typeof(i=r.length)!="number")return[r];for(a=new Array(i);i--;)a[i]=r[i];return a}for(i=arguments.length,a=new Array(i);i--;)a[i]=arguments[i];return a}var Nn=typeof Symbol<"u"?function(r){return r[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},gn=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],pt=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(gn),di={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function ee(r,i){this.name=r,this.message=i}function kt(r,i){return r+". Errors: "+Object.keys(i).map(function(a){return i[a].toString()}).filter(function(a,u,l){return l.indexOf(a)===u}).join(`
25
- `)}function kn(r,i,a,u){this.failures=i,this.failedKeys=u,this.successCount=a,this.message=kt(r,i)}function ye(r,i){this.name="BulkError",this.failures=Object.keys(i).map(function(a){return i[a]}),this.failuresByPos=i,this.message=kt(r,this.failures)}fe(ee).from(Error).extend({toString:function(){return this.name+": "+this.message}}),fe(kn).from(ee),fe(ye).from(ee);var fr=pt.reduce(function(r,i){return r[i]=i+"Error",r},{}),ns=ee,Z=pt.reduce(function(r,i){var a=i+"Error";function u(l,d){this.name=a,l?typeof l=="string"?(this.message="".concat(l).concat(d?`
26
- `+d:""),this.inner=d||null):typeof l=="object"&&(this.message="".concat(l.name," ").concat(l.message),this.inner=l):(this.message=di[i]||a,this.inner=null)}return fe(u).from(ns),r[i]=u,r},{});Z.Syntax=SyntaxError,Z.Type=TypeError,Z.Range=RangeError;var hi=gn.reduce(function(r,i){return r[i+"Error"]=Z[i],r},{}),Xe=pt.reduce(function(r,i){return["Syntax","Type","Range"].indexOf(i)===-1&&(r[i+"Error"]=Z[i]),r},{});function de(){}function bt(r){return r}function pi(r,i){return r==null||r===bt?i:function(a){return i(r(a))}}function jt(r,i){return function(){r.apply(this,arguments),i.apply(this,arguments)}}function dr(r,i){return r===de?i:function(){var a=r.apply(this,arguments);a!==void 0&&(arguments[0]=a);var u=this.onsuccess,l=this.onerror;this.onsuccess=null,this.onerror=null;var d=i.apply(this,arguments);return u&&(this.onsuccess=this.onsuccess?jt(u,this.onsuccess):u),l&&(this.onerror=this.onerror?jt(l,this.onerror):l),d!==void 0?d:a}}function gi(r,i){return r===de?i:function(){r.apply(this,arguments);var a=this.onsuccess,u=this.onerror;this.onsuccess=this.onerror=null,i.apply(this,arguments),a&&(this.onsuccess=this.onsuccess?jt(a,this.onsuccess):a),u&&(this.onerror=this.onerror?jt(u,this.onerror):u)}}function yi(r,i){return r===de?i:function(a){var u=r.apply(this,arguments);m(a,u);var l=this.onsuccess,d=this.onerror;return this.onsuccess=null,this.onerror=null,a=i.apply(this,arguments),l&&(this.onsuccess=this.onsuccess?jt(l,this.onsuccess):l),d&&(this.onerror=this.onerror?jt(d,this.onerror):d),u===void 0?a===void 0?void 0:a:m(u,a)}}function mi(r,i){return r===de?i:function(){return i.apply(this,arguments)!==!1&&r.apply(this,arguments)}}function jn(r,i){return r===de?i:function(){var a=r.apply(this,arguments);if(a&&typeof a.then=="function"){for(var u=this,l=arguments.length,d=new Array(l);l--;)d[l]=arguments[l];return a.then(function(){return i.apply(u,d)})}return i.apply(this,arguments)}}Xe.ModifyError=kn,Xe.DexieError=ee,Xe.BulkError=ye;var st=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function $n(r){st=r}var pn={},vi=100,Bt=typeof Promise>"u"?[]:function(){var r=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[r,T(r),r];var i=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[i,T(i),r]}(),gn=Bt[0],pt=Bt[1],Bt=Bt[2],pt=pt&&pt.then,$t=gn&&gn.constructor,Ft=!!Bt,yn=function(r,i){J.push([r,i]),Fn&&(queueMicrotask(Oe),Fn=!1)},hr=!0,Fn=!0,mt=[],C=[],D=bt,N={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:de,pgp:!1,env:{},finalize:de},M=N,J=[],me=0,xe=[];function j(r){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var i=this._PSD=M;if(typeof r!="function"){if(r!==pn)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&G(this,this._value))}this._state=null,this._value=null,++i.ref,function a(u,l){try{l(function(d){if(u._state===null){if(d===u)throw new TypeError("A promise cannot be resolved with itself.");var h=u._lib&&$e();d&&typeof d.then=="function"?a(u,function(g,v){d instanceof j?d._then(g,v):d.then(g,v)}):(u._state=!0,u._value=d,Q(u)),h&&Lt()}},G.bind(null,u))}catch(d){G(u,d)}}(this,r)}var U={get:function(){var r=M,i=_i;function a(u,l){var d=this,h=!r.global&&(r!==M||i!==_i),g=h&&!Zt(),v=new j(function(w,E){ie(d,new z(Cu(u,r,h,g),Cu(l,r,h,g),w,E,r))});return this._consoleTask&&(v._consoleTask=this._consoleTask),v}return a.prototype=pn,a},set:function(r){oe(this,"then",r&&r.prototype===pn?U:{get:function(){return r},set:U.set})}};function z(r,i,a,u,l){this.onFulfilled=typeof r=="function"?r:null,this.onRejected=typeof i=="function"?i:null,this.resolve=a,this.reject=u,this.psd=l}function G(r,i){var a,u;C.push(i),r._state===null&&(a=r._lib&&$e(),i=D(i),r._state=!1,r._value=i,u=r,mt.some(function(l){return l._value===u._value})||mt.push(u),Q(r),a&&Lt())}function Q(r){var i=r._listeners;r._listeners=[];for(var a=0,u=i.length;a<u;++a)ie(r,i[a]);var l=r._PSD;--l.ref||l.finalize(),me===0&&(++me,yn(function(){--me==0&&pr()},[]))}function ie(r,i){if(r._state!==null){var a=r._state?i.onFulfilled:i.onRejected;if(a===null)return(r._state?i.resolve:i.reject)(r._value);++i.psd.ref,++me,yn(pe,[a,r,i])}else r._listeners.push(i)}function pe(r,i,a){try{var u,l=i._value;!i._state&&C.length&&(C=[]),u=st&&i._consoleTask?i._consoleTask.run(function(){return r(l)}):r(l),i._state||C.indexOf(l)!==-1||function(d){for(var h=mt.length;h;)if(mt[--h]._value===d._value)return mt.splice(h,1)}(i),a.resolve(u)}catch(d){a.reject(d)}finally{--me==0&&pr(),--a.psd.ref||a.psd.finalize()}}function Oe(){mn(N,function(){$e()&&Lt()})}function $e(){var r=hr;return Fn=hr=!1,r}function Lt(){var r,i,a;do for(;0<J.length;)for(r=J,J=[],a=r.length,i=0;i<a;++i){var u=r[i];u[0].apply(null,u[1])}while(0<J.length);Fn=hr=!0}function pr(){var r=mt;mt=[],r.forEach(function(u){u._PSD.onunhandled.call(null,u._value,u)});for(var i=xe.slice(0),a=i.length;a;)i[--a]()}function Ln(r){return new j(pn,!1,r)}function Ee(r,i){var a=M;return function(){var u=$e(),l=M;try{return en(a,!0),r.apply(this,arguments)}catch(d){i&&i(d)}finally{en(l,!1),u&&Lt()}}}F(j.prototype,{then:U,_then:function(r,i){ie(this,new z(null,null,r,i,M))},catch:function(r){if(arguments.length===1)return this.then(null,r);var i=r,a=arguments[1];return typeof i=="function"?this.then(null,function(u){return(u instanceof i?a:Ln)(u)}):this.then(null,function(u){return(u&&u.name===i?a:Ln)(u)})},finally:function(r){return this.then(function(i){return j.resolve(r()).then(function(){return i})},function(i){return j.resolve(r()).then(function(){return Ln(i)})})},timeout:function(r,i){var a=this;return r<1/0?new j(function(u,l){var d=setTimeout(function(){return l(new Z.Timeout(i))},r);a.then(u,l).finally(clearTimeout.bind(null,d))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&oe(j.prototype,Symbol.toStringTag,"Dexie.Promise"),N.env=Au(),F(j,{all:function(){var r=ht.apply(null,arguments).map(xi);return new j(function(i,a){r.length===0&&i([]);var u=r.length;r.forEach(function(l,d){return j.resolve(l).then(function(h){r[d]=h,--u||i(r)},a)})})},resolve:function(r){return r instanceof j?r:r&&typeof r.then=="function"?new j(function(i,a){r.then(i,a)}):new j(pn,!0,r)},reject:Ln,race:function(){var r=ht.apply(null,arguments).map(xi);return new j(function(i,a){r.map(function(u){return j.resolve(u).then(i,a)})})},PSD:{get:function(){return M},set:function(r){return M=r}},totalEchoes:{get:function(){return _i}},newPSD:Jt,usePSD:mn,scheduler:{get:function(){return yn},set:function(r){yn=r}},rejectionMapper:{get:function(){return D},set:function(r){D=r}},follow:function(r,i){return new j(function(a,u){return Jt(function(l,d){var h=M;h.unhandleds=[],h.onunhandled=d,h.finalize=jt(function(){var g,v=this;g=function(){v.unhandleds.length===0?l():d(v.unhandleds[0])},xe.push(function w(){g(),xe.splice(xe.indexOf(w),1)}),++me,yn(function(){--me==0&&pr()},[])},h.finalize),r()},i,a,u)})}}),$t&&($t.allSettled&&oe(j,"allSettled",function(){var r=ht.apply(null,arguments).map(xi);return new j(function(i){r.length===0&&i([]);var a=r.length,u=new Array(a);r.forEach(function(l,d){return j.resolve(l).then(function(h){return u[d]={status:"fulfilled",value:h}},function(h){return u[d]={status:"rejected",reason:h}}).then(function(){return--a||i(u)})})})}),$t.any&&typeof AggregateError<"u"&&oe(j,"any",function(){var r=ht.apply(null,arguments).map(xi);return new j(function(i,a){r.length===0&&a(new AggregateError([]));var u=r.length,l=new Array(u);r.forEach(function(d,h){return j.resolve(d).then(function(g){return i(g)},function(g){l[h]=g,--u||a(new AggregateError(l))})})})}),$t.withResolvers&&(j.withResolvers=$t.withResolvers));var Fe={awaits:0,echoes:0,id:0},sh=0,bi=[],wi=0,_i=0,ah=0;function Jt(r,i,a,u){var l=M,d=Object.create(l);return d.parent=l,d.ref=0,d.global=!1,d.id=++ah,N.env,d.env=Ft?{Promise:j,PromiseProp:{value:j,configurable:!0,writable:!0},all:j.all,race:j.race,allSettled:j.allSettled,any:j.any,resolve:j.resolve,reject:j.reject}:{},i&&m(d,i),++l.ref,d.finalize=function(){--this.parent.ref||this.parent.finalize()},u=mn(d,r,a,u),d.ref===0&&d.finalize(),u}function Kn(){return Fe.id||(Fe.id=++sh),++Fe.awaits,Fe.echoes+=vi,Fe.id}function Zt(){return!!Fe.awaits&&(--Fe.awaits==0&&(Fe.id=0),Fe.echoes=Fe.awaits*vi,!0)}function xi(r){return Fe.echoes&&r&&r.constructor===$t?(Kn(),r.then(function(i){return Zt(),i},function(i){return Zt(),De(i)})):r}function uh(){var r=bi[bi.length-1];bi.pop(),en(r,!1)}function en(r,i){var a,u=M;(i?!Fe.echoes||wi++&&r===M:!wi||--wi&&r===M)||queueMicrotask(i?(function(l){++_i,Fe.echoes&&--Fe.echoes!=0||(Fe.echoes=Fe.awaits=Fe.id=0),bi.push(M),en(l,!0)}).bind(null,r):uh),r!==M&&(M=r,u===N&&(N.env=Au()),Ft&&(a=N.env.Promise,i=r.env,(u.global||r.global)&&(Object.defineProperty(c,"Promise",i.PromiseProp),a.all=i.all,a.race=i.race,a.resolve=i.resolve,a.reject=i.reject,i.allSettled&&(a.allSettled=i.allSettled),i.any&&(a.any=i.any))))}function Au(){var r=c.Promise;return Ft?{Promise:r,PromiseProp:Object.getOwnPropertyDescriptor(c,"Promise"),all:r.all,race:r.race,allSettled:r.allSettled,any:r.any,resolve:r.resolve,reject:r.reject}:{}}function mn(r,i,a,u,l){var d=M;try{return en(r,!0),i(a,u,l)}finally{en(d,!1)}}function Cu(r,i,a,u){return typeof r!="function"?r:function(){var l=M;a&&Kn(),en(i,!0);try{return r.apply(this,arguments)}finally{en(l,!1),u&&queueMicrotask(Zt)}}}function rs(r){Promise===$t&&Fe.echoes===0?wi===0?r():enqueueNativeMicroTask(r):setTimeout(r,0)}(""+pt).indexOf("[native code]")===-1&&(Kn=Zt=de);var De=j.reject,vn="￿",Kt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Pu="String expected.",Bn=[],Ei="__dbnames",is="readonly",os="readwrite";function bn(r,i){return r?i?function(){return r.apply(this,arguments)&&i.apply(this,arguments)}:r:i}var Du={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Si(r){return typeof r!="string"||/\./.test(r)?function(i){return i}:function(i){return i[r]===void 0&&r in i&&delete(i=Mt(i))[r],i}}function Iu(){throw Z.Type()}function ue(r,i){try{var a=Tu(r),u=Tu(i);if(a!==u)return a==="Array"?1:u==="Array"?-1:a==="binary"?1:u==="binary"?-1:a==="string"?1:u==="string"?-1:a==="Date"?1:u!=="Date"?NaN:-1;switch(a){case"number":case"Date":case"string":return i<r?1:r<i?-1:0;case"binary":return function(l,d){for(var h=l.length,g=d.length,v=h<g?h:g,w=0;w<v;++w)if(l[w]!==d[w])return l[w]<d[w]?-1:1;return h===g?0:h<g?-1:1}(Ru(r),Ru(i));case"Array":return function(l,d){for(var h=l.length,g=d.length,v=h<g?h:g,w=0;w<v;++w){var E=ue(l[w],d[w]);if(E!==0)return E}return h===g?0:h<g?-1:1}(r,i)}}catch{}return NaN}function Tu(r){var i=typeof r;return i!="object"?i:ArrayBuffer.isView(r)?"binary":(r=Mn(r),r==="ArrayBuffer"?"binary":r)}function Ru(r){return r instanceof Uint8Array?r:ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):new Uint8Array(r)}var Mu=(we.prototype._trans=function(r,i,a){var u=this._tx||M.trans,l=this.name,d=st&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(r==="readonly"?"read":"write"," ").concat(this.name));function h(w,E,y){if(!y.schema[l])throw new Z.NotFound("Table "+l+" not part of transaction");return i(y.idbtrans,y)}var g=$e();try{var v=u&&u.db._novip===this.db._novip?u===M.trans?u._promise(r,h,a):Jt(function(){return u._promise(r,h,a)},{trans:u,transless:M.transless||M}):function w(E,y,A,b){if(E.idbdb&&(E._state.openComplete||M.letThrough||E._vip)){var x=E._createTransaction(y,A,E._dbSchema);try{x.create(),E._state.PR1398_maxLoop=3}catch(O){return O.name===fr.InvalidState&&E.isOpen()&&0<--E._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),E.close({disableAutoOpen:!1}),E.open().then(function(){return w(E,y,A,b)})):De(O)}return x._promise(y,function(O,_){return Jt(function(){return M.trans=x,b(O,_,x)})}).then(function(O){if(y==="readwrite")try{x.idbtrans.commit()}catch{}return y==="readonly"?O:x._completion.then(function(){return O})})}if(E._state.openComplete)return De(new Z.DatabaseClosed(E._state.dbOpenError));if(!E._state.isBeingOpened){if(!E._state.autoOpen)return De(new Z.DatabaseClosed);E.open().catch(de)}return E._state.dbReadyPromise.then(function(){return w(E,y,A,b)})}(this.db,r,[this.name],h);return d&&(v._consoleTask=d,v=v.catch(function(w){return console.trace(w),De(w)})),v}finally{g&&Lt()}},we.prototype.get=function(r,i){var a=this;return r&&r.constructor===Object?this.where(r).first(i):r==null?De(new Z.Type("Invalid argument to Table.get()")):this._trans("readonly",function(u){return a.core.get({trans:u,key:r}).then(function(l){return a.hook.reading.fire(l)})}).then(i)},we.prototype.where=function(r){if(typeof r=="string")return new this.db.WhereClause(this,r);if(p(r))return new this.db.WhereClause(this,"[".concat(r.join("+"),"]"));var i=f(r);if(i.length===1)return this.where(i[0]).equals(r[i[0]]);var a=this.schema.indexes.concat(this.schema.primKey).filter(function(g){if(g.compound&&i.every(function(w){return 0<=g.keyPath.indexOf(w)})){for(var v=0;v<i.length;++v)if(i.indexOf(g.keyPath[v])===-1)return!1;return!0}return!1}).sort(function(g,v){return g.keyPath.length-v.keyPath.length})[0];if(a&&this.db._maxKey!==vn){var d=a.keyPath.slice(0,i.length);return this.where(d).equals(d.map(function(v){return r[v]}))}!a&&st&&console.warn("The query ".concat(JSON.stringify(r)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(i.join("+"),"]"));var u=this.schema.idxByName;function l(g,v){return ue(g,v)===0}var h=i.reduce(function(y,v){var w=y[0],E=y[1],y=u[v],A=r[v];return[w||y,w||!y?bn(E,y&&y.multi?function(b){return b=Qe(b,v),p(b)&&b.some(function(x){return l(A,x)})}:function(b){return l(A,Qe(b,v))}):E]},[null,null]),d=h[0],h=h[1];return d?this.where(d.name).equals(r[d.keyPath]).filter(h):a?this.filter(h):this.where(i).equals("")},we.prototype.filter=function(r){return this.toCollection().and(r)},we.prototype.count=function(r){return this.toCollection().count(r)},we.prototype.offset=function(r){return this.toCollection().offset(r)},we.prototype.limit=function(r){return this.toCollection().limit(r)},we.prototype.each=function(r){return this.toCollection().each(r)},we.prototype.toArray=function(r){return this.toCollection().toArray(r)},we.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},we.prototype.orderBy=function(r){return new this.db.Collection(new this.db.WhereClause(this,p(r)?"[".concat(r.join("+"),"]"):r))},we.prototype.reverse=function(){return this.toCollection().reverse()},we.prototype.mapToClass=function(r){var i,a=this.db,u=this.name;function l(){return i!==null&&i.apply(this,arguments)||this}(this.schema.mappedClass=r).prototype instanceof Iu&&(function(v,w){if(typeof w!="function"&&w!==null)throw new TypeError("Class extends value "+String(w)+" is not a constructor or null");function E(){this.constructor=v}n(v,w),v.prototype=w===null?Object.create(w):(E.prototype=w.prototype,new E)}(l,i=r),Object.defineProperty(l.prototype,"db",{get:function(){return a},enumerable:!1,configurable:!0}),l.prototype.table=function(){return u},r=l);for(var d=new Set,h=r.prototype;h;h=T(h))Object.getOwnPropertyNames(h).forEach(function(v){return d.add(v)});function g(v){if(!v)return v;var w,E=Object.create(r.prototype);for(w in v)if(!d.has(w))try{E[w]=v[w]}catch{}return E}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=g,this.hook("reading",g),r},we.prototype.defineClass=function(){return this.mapToClass(function(r){m(this,r)})},we.prototype.add=function(r,i){var a=this,u=this.schema.primKey,l=u.auto,d=u.keyPath,h=r;return d&&l&&(h=Si(d)(r)),this._trans("readwrite",function(g){return a.core.mutate({trans:g,type:"add",keys:i!=null?[i]:null,values:[h]})}).then(function(g){return g.numFailures?j.reject(g.failures[0]):g.lastResult}).then(function(g){if(d)try{Re(r,d,g)}catch{}return g})},we.prototype.update=function(r,i){return typeof r!="object"||p(r)?this.where(":id").equals(r).modify(i):(r=Qe(r,this.schema.primKey.keyPath),r===void 0?De(new Z.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(r).modify(i))},we.prototype.put=function(r,i){var a=this,u=this.schema.primKey,l=u.auto,d=u.keyPath,h=r;return d&&l&&(h=Si(d)(r)),this._trans("readwrite",function(g){return a.core.mutate({trans:g,type:"put",values:[h],keys:i!=null?[i]:null})}).then(function(g){return g.numFailures?j.reject(g.failures[0]):g.lastResult}).then(function(g){if(d)try{Re(r,d,g)}catch{}return g})},we.prototype.delete=function(r){var i=this;return this._trans("readwrite",function(a){return i.core.mutate({trans:a,type:"delete",keys:[r]})}).then(function(a){return a.numFailures?j.reject(a.failures[0]):void 0})},we.prototype.clear=function(){var r=this;return this._trans("readwrite",function(i){return r.core.mutate({trans:i,type:"deleteRange",range:Du})}).then(function(i){return i.numFailures?j.reject(i.failures[0]):void 0})},we.prototype.bulkGet=function(r){var i=this;return this._trans("readonly",function(a){return i.core.getMany({keys:r,trans:a}).then(function(u){return u.map(function(l){return i.hook.reading.fire(l)})})})},we.prototype.bulkAdd=function(r,i,a){var u=this,l=Array.isArray(i)?i:void 0,d=(a=a||(l?void 0:i))?a.allKeys:void 0;return this._trans("readwrite",function(h){var w=u.schema.primKey,g=w.auto,w=w.keyPath;if(w&&l)throw new Z.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(l&&l.length!==r.length)throw new Z.InvalidArgument("Arguments objects and keys must have the same length");var v=r.length,w=w&&g?r.map(Si(w)):r;return u.core.mutate({trans:h,type:"add",keys:l,values:w,wantResults:d}).then(function(x){var y=x.numFailures,A=x.results,b=x.lastResult,x=x.failures;if(y===0)return d?A:b;throw new ye("".concat(u.name,".bulkAdd(): ").concat(y," of ").concat(v," operations failed"),x)})})},we.prototype.bulkPut=function(r,i,a){var u=this,l=Array.isArray(i)?i:void 0,d=(a=a||(l?void 0:i))?a.allKeys:void 0;return this._trans("readwrite",function(h){var w=u.schema.primKey,g=w.auto,w=w.keyPath;if(w&&l)throw new Z.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(l&&l.length!==r.length)throw new Z.InvalidArgument("Arguments objects and keys must have the same length");var v=r.length,w=w&&g?r.map(Si(w)):r;return u.core.mutate({trans:h,type:"put",keys:l,values:w,wantResults:d}).then(function(x){var y=x.numFailures,A=x.results,b=x.lastResult,x=x.failures;if(y===0)return d?A:b;throw new ye("".concat(u.name,".bulkPut(): ").concat(y," of ").concat(v," operations failed"),x)})})},we.prototype.bulkUpdate=function(r){var i=this,a=this.core,u=r.map(function(h){return h.key}),l=r.map(function(h){return h.changes}),d=[];return this._trans("readwrite",function(h){return a.getMany({trans:h,keys:u,cache:"clone"}).then(function(g){var v=[],w=[];r.forEach(function(y,A){var b=y.key,x=y.changes,O=g[A];if(O){for(var _=0,P=Object.keys(x);_<P.length;_++){var I=P[_],R=x[I];if(I===i.schema.primKey.keyPath){if(ue(R,b)!==0)throw new Z.Constraint("Cannot update primary key in bulkUpdate()")}else Re(O,I,R)}d.push(A),v.push(b),w.push(O)}});var E=v.length;return a.mutate({trans:h,type:"put",keys:v,values:w,updates:{keys:u,changeSpecs:l}}).then(function(y){var A=y.numFailures,b=y.failures;if(A===0)return E;for(var x=0,O=Object.keys(b);x<O.length;x++){var _,P=O[x],I=d[Number(P)];I!=null&&(_=b[P],delete b[P],b[I]=_)}throw new ye("".concat(i.name,".bulkUpdate(): ").concat(A," of ").concat(E," operations failed"),b)})})})},we.prototype.bulkDelete=function(r){var i=this,a=r.length;return this._trans("readwrite",function(u){return i.core.mutate({trans:u,type:"delete",keys:r})}).then(function(h){var l=h.numFailures,d=h.lastResult,h=h.failures;if(l===0)return d;throw new ye("".concat(i.name,".bulkDelete(): ").concat(l," of ").concat(a," operations failed"),h)})},we);function we(){}function gr(r){function i(h,g){if(g){for(var v=arguments.length,w=new Array(v-1);--v;)w[v-1]=arguments[v];return a[h].subscribe.apply(null,w),r}if(typeof h=="string")return a[h]}var a={};i.addEventType=d;for(var u=1,l=arguments.length;u<l;++u)d(arguments[u]);return i;function d(h,g,v){if(typeof h!="object"){var w;g=g||mi;var E={subscribers:[],fire:v=v||de,subscribe:function(y){E.subscribers.indexOf(y)===-1&&(E.subscribers.push(y),E.fire=g(E.fire,y))},unsubscribe:function(y){E.subscribers=E.subscribers.filter(function(A){return A!==y}),E.fire=E.subscribers.reduce(g,v)}};return a[h]=i[h]=E}f(w=h).forEach(function(y){var A=w[y];if(p(A))d(y,w[y][0],w[y][1]);else{if(A!=="asap")throw new Z.InvalidArgument("Invalid event config");var b=d(y,bt,function(){for(var x=arguments.length,O=new Array(x);x--;)O[x]=arguments[x];b.subscribers.forEach(function(_){Ye(function(){_.apply(null,O)})})})}})}}function yr(r,i){return fe(i).from({prototype:r}),i}function qn(r,i){return!(r.filter||r.algorithm||r.or)&&(i?r.justLimit:!r.replayFilter)}function ss(r,i){r.filter=bn(r.filter,i)}function as(r,i,a){var u=r.replayFilter;r.replayFilter=u?function(){return bn(u(),i())}:i,r.justLimit=a&&!u}function Oi(r,i){if(r.isPrimKey)return i.primaryKey;var a=i.getIndexByKeyPath(r.index);if(!a)throw new Z.Schema("KeyPath "+r.index+" on object store "+i.name+" is not indexed");return a}function Nu(r,i,a){var u=Oi(r,i.schema);return i.openCursor({trans:a,values:!r.keysOnly,reverse:r.dir==="prev",unique:!!r.unique,query:{index:u,range:r.range}})}function Ai(r,i,a,u){var l=r.replayFilter?bn(r.filter,r.replayFilter()):r.filter;if(r.or){var d={},h=function(g,v,w){var E,y;l&&!l(v,w,function(A){return v.stop(A)},function(A){return v.fail(A)})||((y=""+(E=v.primaryKey))=="[object ArrayBuffer]"&&(y=""+new Uint8Array(E)),S(d,y)||(d[y]=!0,i(g,v,w)))};return Promise.all([r.or._iterate(h,a),ku(Nu(r,u,a),r.algorithm,h,!r.keysOnly&&r.valueMapper)])}return ku(Nu(r,u,a),bn(r.algorithm,l),i,!r.keysOnly&&r.valueMapper)}function ku(r,i,a,u){var l=Ee(u?function(d,h,g){return a(u(d),h,g)}:a);return r.then(function(d){if(d)return d.start(function(){var h=function(){return d.continue()};i&&!i(d,function(g){return h=g},function(g){d.stop(g),h=de},function(g){d.fail(g),h=de})||l(d.value,d,function(g){return h=g}),h()})})}var Bt=Symbol(),mr=(ju.prototype.execute=function(r){if(this.add!==void 0){var i=this.add;if(p(i))return s(s([],p(r)?r:[],!0),i).sort();if(typeof i=="number")return(Number(r)||0)+i;if(typeof i=="bigint")try{return BigInt(r)+i}catch{return BigInt(0)+i}throw new TypeError("Invalid term ".concat(i))}if(this.remove!==void 0){var a=this.remove;if(p(a))return p(r)?r.filter(function(u){return!a.includes(u)}).sort():[];if(typeof a=="number")return Number(r)-a;if(typeof a=="bigint")try{return BigInt(r)-a}catch{return BigInt(0)-a}throw new TypeError("Invalid subtrahend ".concat(a))}return i=(i=this.replacePrefix)===null||i===void 0?void 0:i[0],i&&typeof r=="string"&&r.startsWith(i)?this.replacePrefix[1]+r.substring(i.length):r},ju);function ju(r){Object.assign(this,r)}var ch=(le.prototype._read=function(r,i){var a=this._ctx;return a.error?a.table._trans(null,De.bind(null,a.error)):a.table._trans("readonly",r).then(i)},le.prototype._write=function(r){var i=this._ctx;return i.error?i.table._trans(null,De.bind(null,i.error)):i.table._trans("readwrite",r,"locked")},le.prototype._addAlgorithm=function(r){var i=this._ctx;i.algorithm=bn(i.algorithm,r)},le.prototype._iterate=function(r,i){return Ai(this._ctx,r,i,this._ctx.table.core)},le.prototype.clone=function(r){var i=Object.create(this.constructor.prototype),a=Object.create(this._ctx);return r&&m(a,r),i._ctx=a,i},le.prototype.raw=function(){return this._ctx.valueMapper=null,this},le.prototype.each=function(r){var i=this._ctx;return this._read(function(a){return Ai(i,r,a,i.table.core)})},le.prototype.count=function(r){var i=this;return this._read(function(a){var u=i._ctx,l=u.table.core;if(qn(u,!0))return l.count({trans:a,query:{index:Oi(u,l.schema),range:u.range}}).then(function(h){return Math.min(h,u.limit)});var d=0;return Ai(u,function(){return++d,!1},a,l).then(function(){return d})}).then(r)},le.prototype.sortBy=function(r,i){var a=r.split(".").reverse(),u=a[0],l=a.length-1;function d(v,w){return w?d(v[a[w]],w-1):v[u]}var h=this._ctx.dir==="next"?1:-1;function g(v,w){return ue(d(v,l),d(w,l))*h}return this.toArray(function(v){return v.sort(g)}).then(i)},le.prototype.toArray=function(r){var i=this;return this._read(function(a){var u=i._ctx;if(u.dir==="next"&&qn(u,!0)&&0<u.limit){var l=u.valueMapper,d=Oi(u,u.table.core.schema);return u.table.core.query({trans:a,limit:u.limit,values:!0,query:{index:d,range:u.range}}).then(function(g){return g=g.result,l?g.map(l):g})}var h=[];return Ai(u,function(g){return h.push(g)},a,u.table.core).then(function(){return h})},r)},le.prototype.offset=function(r){var i=this._ctx;return r<=0||(i.offset+=r,qn(i)?as(i,function(){var a=r;return function(u,l){return a===0||(a===1?--a:l(function(){u.advance(a),a=0}),!1)}}):as(i,function(){var a=r;return function(){return--a<0}})),this},le.prototype.limit=function(r){return this._ctx.limit=Math.min(this._ctx.limit,r),as(this._ctx,function(){var i=r;return function(a,u,l){return--i<=0&&u(l),0<=i}},!0),this},le.prototype.until=function(r,i){return ss(this._ctx,function(a,u,l){return!r(a.value)||(u(l),i)}),this},le.prototype.first=function(r){return this.limit(1).toArray(function(i){return i[0]}).then(r)},le.prototype.last=function(r){return this.reverse().first(r)},le.prototype.filter=function(r){var i;return ss(this._ctx,function(a){return r(a.value)}),(i=this._ctx).isMatch=bn(i.isMatch,r),this},le.prototype.and=function(r){return this.filter(r)},le.prototype.or=function(r){return new this.db.WhereClause(this._ctx.table,r,this)},le.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},le.prototype.desc=function(){return this.reverse()},le.prototype.eachKey=function(r){var i=this._ctx;return i.keysOnly=!i.isMatch,this.each(function(a,u){r(u.key,u)})},le.prototype.eachUniqueKey=function(r){return this._ctx.unique="unique",this.eachKey(r)},le.prototype.eachPrimaryKey=function(r){var i=this._ctx;return i.keysOnly=!i.isMatch,this.each(function(a,u){r(u.primaryKey,u)})},le.prototype.keys=function(r){var i=this._ctx;i.keysOnly=!i.isMatch;var a=[];return this.each(function(u,l){a.push(l.key)}).then(function(){return a}).then(r)},le.prototype.primaryKeys=function(r){var i=this._ctx;if(i.dir==="next"&&qn(i,!0)&&0<i.limit)return this._read(function(u){var l=Oi(i,i.table.core.schema);return i.table.core.query({trans:u,values:!1,limit:i.limit,query:{index:l,range:i.range}})}).then(function(u){return u.result}).then(r);i.keysOnly=!i.isMatch;var a=[];return this.each(function(u,l){a.push(l.primaryKey)}).then(function(){return a}).then(r)},le.prototype.uniqueKeys=function(r){return this._ctx.unique="unique",this.keys(r)},le.prototype.firstKey=function(r){return this.limit(1).keys(function(i){return i[0]}).then(r)},le.prototype.lastKey=function(r){return this.reverse().firstKey(r)},le.prototype.distinct=function(){var r=this._ctx,r=r.index&&r.table.schema.idxByName[r.index];if(!r||!r.multi)return this;var i={};return ss(this._ctx,function(l){var u=l.primaryKey.toString(),l=S(i,u);return i[u]=!0,!l}),this},le.prototype.modify=function(r){var i=this,a=this._ctx;return this._write(function(u){var l,d,h;h=typeof r=="function"?r:(l=f(r),d=l.length,function(_){for(var P=!1,I=0;I<d;++I){var R=l[I],k=r[R],L=Qe(_,R);k instanceof mr?(Re(_,R,k.execute(L)),P=!0):L!==k&&(Re(_,R,k),P=!0)}return P});var g=a.table.core,y=g.schema.primaryKey,v=y.outbound,w=y.extractKey,E=200,y=i.db._options.modifyChunkSize;y&&(E=typeof y=="object"?y[g.name]||y["*"]||200:y);function A(_,R){var I=R.failures,R=R.numFailures;x+=_-R;for(var k=0,L=f(I);k<L.length;k++){var V=L[k];b.push(I[V])}}var b=[],x=0,O=[];return i.clone().primaryKeys().then(function(_){function P(R){var k=Math.min(E,_.length-R);return g.getMany({trans:u,keys:_.slice(R,R+k),cache:"immutable"}).then(function(L){for(var V=[],K=[],B=v?[]:null,W=[],q=0;q<k;++q){var Y=L[q],ne={value:Mt(Y),primKey:_[R+q]};h.call(ne,ne.value,ne)!==!1&&(ne.value==null?W.push(_[R+q]):v||ue(w(Y),w(ne.value))===0?(K.push(ne.value),v&&B.push(_[R+q])):(W.push(_[R+q]),V.push(ne.value)))}return Promise.resolve(0<V.length&&g.mutate({trans:u,type:"add",values:V}).then(function(se){for(var ae in se.failures)W.splice(parseInt(ae),1);A(V.length,se)})).then(function(){return(0<K.length||I&&typeof r=="object")&&g.mutate({trans:u,type:"put",keys:B,values:K,criteria:I,changeSpec:typeof r!="function"&&r,isAdditionalChunk:0<R}).then(function(se){return A(K.length,se)})}).then(function(){return(0<W.length||I&&r===us)&&g.mutate({trans:u,type:"delete",keys:W,criteria:I,isAdditionalChunk:0<R}).then(function(se){return A(W.length,se)})}).then(function(){return _.length>R+k&&P(R+E)})})}var I=qn(a)&&a.limit===1/0&&(typeof r!="function"||r===us)&&{index:a.index,range:a.range};return P(0).then(function(){if(0<b.length)throw new kn("Error modifying one or more objects",b,x,O);return _.length})})})},le.prototype.delete=function(){var r=this._ctx,i=r.range;return qn(r)&&(r.isPrimKey||i.type===3)?this._write(function(a){var u=r.table.core.schema.primaryKey,l=i;return r.table.core.count({trans:a,query:{index:u,range:l}}).then(function(d){return r.table.core.mutate({trans:a,type:"deleteRange",range:l}).then(function(h){var g=h.failures;if(h.lastResult,h.results,h=h.numFailures,h)throw new kn("Could not delete some values",Object.keys(g).map(function(v){return g[v]}),d-h);return d-h})})}):this.modify(us)},le);function le(){}var us=function(r,i){return i.value=null};function lh(r,i){return r<i?-1:r===i?0:1}function fh(r,i){return i<r?-1:r===i?0:1}function at(r,i,a){return r=r instanceof Fu?new r.Collection(r):r,r._ctx.error=new(a||TypeError)(i),r}function Vn(r){return new r.Collection(r,function(){return $u("")}).limit(0)}function Ci(r,i,a,u){var l,d,h,g,v,w,E,y=a.length;if(!a.every(function(x){return typeof x=="string"}))return at(r,Pu);function A(x){l=x==="next"?function(_){return _.toUpperCase()}:function(_){return _.toLowerCase()},d=x==="next"?function(_){return _.toLowerCase()}:function(_){return _.toUpperCase()},h=x==="next"?lh:fh;var O=a.map(function(_){return{lower:d(_),upper:l(_)}}).sort(function(_,P){return h(_.lower,P.lower)});g=O.map(function(_){return _.upper}),v=O.map(function(_){return _.lower}),E=(w=x)==="next"?"":u}A("next"),r=new r.Collection(r,function(){return tn(g[0],v[y-1]+u)}),r._ondirectionchange=function(x){A(x)};var b=0;return r._addAlgorithm(function(x,O,_){var P=x.key;if(typeof P!="string")return!1;var I=d(P);if(i(I,v,b))return!0;for(var R=null,k=b;k<y;++k){var L=function(V,K,B,W,q,Y){for(var ne=Math.min(V.length,W.length),se=-1,ae=0;ae<ne;++ae){var ut=K[ae];if(ut!==W[ae])return q(V[ae],B[ae])<0?V.substr(0,ae)+B[ae]+B.substr(ae+1):q(V[ae],W[ae])<0?V.substr(0,ae)+W[ae]+B.substr(ae+1):0<=se?V.substr(0,se)+K[se]+B.substr(se+1):null;q(V[ae],ut)<0&&(se=ae)}return ne<W.length&&Y==="next"?V+B.substr(V.length):ne<V.length&&Y==="prev"?V.substr(0,B.length):se<0?null:V.substr(0,se)+W[se]+B.substr(se+1)}(P,I,g[k],v[k],h,w);L===null&&R===null?b=k+1:(R===null||0<h(R,L))&&(R=L)}return O(R!==null?function(){x.continue(R+E)}:_),!1}),r}function tn(r,i,a,u){return{type:2,lower:r,upper:i,lowerOpen:a,upperOpen:u}}function $u(r){return{type:1,lower:r,upper:r}}var Fu=(Object.defineProperty(Le.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Le.prototype.between=function(r,i,a,u){a=a!==!1,u=u===!0;try{return 0<this._cmp(r,i)||this._cmp(r,i)===0&&(a||u)&&(!a||!u)?Vn(this):new this.Collection(this,function(){return tn(r,i,!a,!u)})}catch{return at(this,Kt)}},Le.prototype.equals=function(r){return r==null?at(this,Kt):new this.Collection(this,function(){return $u(r)})},Le.prototype.above=function(r){return r==null?at(this,Kt):new this.Collection(this,function(){return tn(r,void 0,!0)})},Le.prototype.aboveOrEqual=function(r){return r==null?at(this,Kt):new this.Collection(this,function(){return tn(r,void 0,!1)})},Le.prototype.below=function(r){return r==null?at(this,Kt):new this.Collection(this,function(){return tn(void 0,r,!1,!0)})},Le.prototype.belowOrEqual=function(r){return r==null?at(this,Kt):new this.Collection(this,function(){return tn(void 0,r)})},Le.prototype.startsWith=function(r){return typeof r!="string"?at(this,Pu):this.between(r,r+vn,!0,!0)},Le.prototype.startsWithIgnoreCase=function(r){return r===""?this.startsWith(r):Ci(this,function(i,a){return i.indexOf(a[0])===0},[r],vn)},Le.prototype.equalsIgnoreCase=function(r){return Ci(this,function(i,a){return i===a[0]},[r],"")},Le.prototype.anyOfIgnoreCase=function(){var r=ht.apply(Nt,arguments);return r.length===0?Vn(this):Ci(this,function(i,a){return a.indexOf(i)!==-1},r,"")},Le.prototype.startsWithAnyOfIgnoreCase=function(){var r=ht.apply(Nt,arguments);return r.length===0?Vn(this):Ci(this,function(i,a){return a.some(function(u){return i.indexOf(u)===0})},r,vn)},Le.prototype.anyOf=function(){var r=this,i=ht.apply(Nt,arguments),a=this._cmp;try{i.sort(a)}catch{return at(this,Kt)}if(i.length===0)return Vn(this);var u=new this.Collection(this,function(){return tn(i[0],i[i.length-1])});u._ondirectionchange=function(d){a=d==="next"?r._ascending:r._descending,i.sort(a)};var l=0;return u._addAlgorithm(function(d,h,g){for(var v=d.key;0<a(v,i[l]);)if(++l===i.length)return h(g),!1;return a(v,i[l])===0||(h(function(){d.continue(i[l])}),!1)}),u},Le.prototype.notEqual=function(r){return this.inAnyRange([[-1/0,r],[r,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Le.prototype.noneOf=function(){var r=ht.apply(Nt,arguments);if(r.length===0)return new this.Collection(this);try{r.sort(this._ascending)}catch{return at(this,Kt)}var i=r.reduce(function(a,u){return a?a.concat([[a[a.length-1][1],u]]):[[-1/0,u]]},null);return i.push([r[r.length-1],this.db._maxKey]),this.inAnyRange(i,{includeLowers:!1,includeUppers:!1})},Le.prototype.inAnyRange=function(P,i){var a=this,u=this._cmp,l=this._ascending,d=this._descending,h=this._min,g=this._max;if(P.length===0)return Vn(this);if(!P.every(function(I){return I[0]!==void 0&&I[1]!==void 0&&l(I[0],I[1])<=0}))return at(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Z.InvalidArgument);var v=!i||i.includeLowers!==!1,w=i&&i.includeUppers===!0,E,y=l;function A(I,R){return y(I[0],R[0])}try{(E=P.reduce(function(I,R){for(var k=0,L=I.length;k<L;++k){var V=I[k];if(u(R[0],V[1])<0&&0<u(R[1],V[0])){V[0]=h(V[0],R[0]),V[1]=g(V[1],R[1]);break}}return k===L&&I.push(R),I},[])).sort(A)}catch{return at(this,Kt)}var b=0,x=w?function(I){return 0<l(I,E[b][1])}:function(I){return 0<=l(I,E[b][1])},O=v?function(I){return 0<d(I,E[b][0])}:function(I){return 0<=d(I,E[b][0])},_=x,P=new this.Collection(this,function(){return tn(E[0][0],E[E.length-1][1],!v,!w)});return P._ondirectionchange=function(I){y=I==="next"?(_=x,l):(_=O,d),E.sort(A)},P._addAlgorithm(function(I,R,k){for(var L,V=I.key;_(V);)if(++b===E.length)return R(k),!1;return!x(L=V)&&!O(L)||(a._cmp(V,E[b][1])===0||a._cmp(V,E[b][0])===0||R(function(){y===l?I.continue(E[b][0]):I.continue(E[b][1])}),!1)}),P},Le.prototype.startsWithAnyOf=function(){var r=ht.apply(Nt,arguments);return r.every(function(i){return typeof i=="string"})?r.length===0?Vn(this):this.inAnyRange(r.map(function(i){return[i,i+vn]})):at(this,"startsWithAnyOf() only works with strings")},Le);function Le(){}function wt(r){return Ee(function(i){return vr(i),r(i.target.error),!1})}function vr(r){r.stopPropagation&&r.stopPropagation(),r.preventDefault&&r.preventDefault()}var br="storagemutated",cs="x-storagemutated-1",nn=gr(null,br),dh=(_t.prototype._lock=function(){return re(!M.global),++this._reculock,this._reculock!==1||M.global||(M.lockOwnerFor=this),this},_t.prototype._unlock=function(){if(re(!M.global),--this._reculock==0)for(M.global||(M.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var r=this._blockedFuncs.shift();try{mn(r[1],r[0])}catch{}}return this},_t.prototype._locked=function(){return this._reculock&&M.lockOwnerFor!==this},_t.prototype.create=function(r){var i=this;if(!this.mode)return this;var a=this.db.idbdb,u=this.db._state.dbOpenError;if(re(!this.idbtrans),!r&&!a)switch(u&&u.name){case"DatabaseClosedError":throw new Z.DatabaseClosed(u);case"MissingAPIError":throw new Z.MissingAPI(u.message,u);default:throw new Z.OpenFailed(u)}if(!this.active)throw new Z.TransactionInactive;return re(this._completion._state===null),(r=this.idbtrans=r||(this.db.core||a).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Ee(function(l){vr(l),i._reject(r.error)}),r.onabort=Ee(function(l){vr(l),i.active&&i._reject(new Z.Abort(r.error)),i.active=!1,i.on("abort").fire(l)}),r.oncomplete=Ee(function(){i.active=!1,i._resolve(),"mutatedParts"in r&&nn.storagemutated.fire(r.mutatedParts)}),this},_t.prototype._promise=function(r,i,a){var u=this;if(r==="readwrite"&&this.mode!=="readwrite")return De(new Z.ReadOnly("Transaction is readonly"));if(!this.active)return De(new Z.TransactionInactive);if(this._locked())return new j(function(d,h){u._blockedFuncs.push([function(){u._promise(r,i,a).then(d,h)},M])});if(a)return Jt(function(){var d=new j(function(h,g){u._lock();var v=i(h,g,u);v&&v.then&&v.then(h,g)});return d.finally(function(){return u._unlock()}),d._lib=!0,d});var l=new j(function(d,h){var g=i(d,h,u);g&&g.then&&g.then(d,h)});return l._lib=!0,l},_t.prototype._root=function(){return this.parent?this.parent._root():this},_t.prototype.waitFor=function(r){var i,a=this._root(),u=j.resolve(r);a._waitingFor?a._waitingFor=a._waitingFor.then(function(){return u}):(a._waitingFor=u,a._waitingQueue=[],i=a.idbtrans.objectStore(a.storeNames[0]),function d(){for(++a._spinCount;a._waitingQueue.length;)a._waitingQueue.shift()();a._waitingFor&&(i.get(-1/0).onsuccess=d)}());var l=a._waitingFor;return new j(function(d,h){u.then(function(g){return a._waitingQueue.push(Ee(d.bind(null,g)))},function(g){return a._waitingQueue.push(Ee(h.bind(null,g)))}).finally(function(){a._waitingFor===l&&(a._waitingFor=null)})})},_t.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Z.Abort))},_t.prototype.table=function(r){var i=this._memoizedTables||(this._memoizedTables={});if(S(i,r))return i[r];var a=this.schema[r];if(!a)throw new Z.NotFound("Table "+r+" not part of transaction");return a=new this.db.Table(r,a,this),a.core=this.db.core.table(r),i[r]=a},_t);function _t(){}function ls(r,i,a,u,l,d,h){return{name:r,keyPath:i,unique:a,multi:u,auto:l,compound:d,src:(a&&!h?"&":"")+(u?"*":"")+(l?"++":"")+Lu(i)}}function Lu(r){return typeof r=="string"?r:r?"["+[].join.call(r,"+")+"]":""}function fs(r,i,a){return{name:r,primKey:i,indexes:a,mappedClass:null,idxByName:(u=function(l){return[l.name,l]},a.reduce(function(l,d,h){return h=u(d,h),h&&(l[h[0]]=h[1]),l},{}))};var u}var wr=function(r){try{return r.only([[]]),wr=function(){return[[]]},[[]]}catch{return wr=function(){return vn},vn}};function ds(r){return r==null?function(){}:typeof r=="string"?(i=r).split(".").length===1?function(a){return a[i]}:function(a){return Qe(a,i)}:function(a){return Qe(a,r)};var i}function Ku(r){return[].slice.call(r)}var hh=0;function _r(r){return r==null?":id":typeof r=="string"?r:"[".concat(r.join("+"),"]")}function ph(r,i,v){function u(_){if(_.type===3)return null;if(_.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var b=_.lower,x=_.upper,O=_.lowerOpen,_=_.upperOpen;return b===void 0?x===void 0?null:i.upperBound(x,!!_):x===void 0?i.lowerBound(b,!!O):i.bound(b,x,!!O,!!_)}function l(A){var b,x=A.name;return{name:x,schema:A,mutate:function(O){var _=O.trans,P=O.type,I=O.keys,R=O.values,k=O.range;return new Promise(function(L,V){L=Ee(L);var K=_.objectStore(x),B=K.keyPath==null,W=P==="put"||P==="add";if(!W&&P!=="delete"&&P!=="deleteRange")throw new Error("Invalid operation type: "+P);var q,Y=(I||R||{length:1}).length;if(I&&R&&I.length!==R.length)throw new Error("Given keys array must have same length as given values array.");if(Y===0)return L({numFailures:0,failures:{},results:[],lastResult:void 0});function ne(Je){++ut,vr(Je)}var se=[],ae=[],ut=0;if(P==="deleteRange"){if(k.type===4)return L({numFailures:ut,failures:ae,results:[],lastResult:void 0});k.type===3?se.push(q=K.clear()):se.push(q=K.delete(u(k)))}else{var B=W?B?[R,I]:[R,null]:[I,null],te=B[0],He=B[1];if(W)for(var ze=0;ze<Y;++ze)se.push(q=He&&He[ze]!==void 0?K[P](te[ze],He[ze]):K[P](te[ze])),q.onerror=ne;else for(ze=0;ze<Y;++ze)se.push(q=K[P](te[ze])),q.onerror=ne}function Ki(Je){Je=Je.target.result,se.forEach(function(xn,Is){return xn.error!=null&&(ae[Is]=xn.error)}),L({numFailures:ut,failures:ae,results:P==="delete"?I:se.map(function(xn){return xn.result}),lastResult:Je})}q.onerror=function(Je){ne(Je),Ki(Je)},q.onsuccess=Ki})},getMany:function(O){var _=O.trans,P=O.keys;return new Promise(function(I,R){I=Ee(I);for(var k,L=_.objectStore(x),V=P.length,K=new Array(V),B=0,W=0,q=function(se){se=se.target,K[se._pos]=se.result,++W===B&&I(K)},Y=wt(R),ne=0;ne<V;++ne)P[ne]!=null&&((k=L.get(P[ne]))._pos=ne,k.onsuccess=q,k.onerror=Y,++B);B===0&&I(K)})},get:function(O){var _=O.trans,P=O.key;return new Promise(function(I,R){I=Ee(I);var k=_.objectStore(x).get(P);k.onsuccess=function(L){return I(L.target.result)},k.onerror=wt(R)})},query:(b=w,function(O){return new Promise(function(_,P){_=Ee(_);var I,R,k,B=O.trans,L=O.values,V=O.limit,q=O.query,K=V===1/0?void 0:V,W=q.index,q=q.range,B=B.objectStore(x),W=W.isPrimaryKey?B:B.index(W.name),q=u(q);if(V===0)return _({result:[]});b?((K=L?W.getAll(q,K):W.getAllKeys(q,K)).onsuccess=function(Y){return _({result:Y.target.result})},K.onerror=wt(P)):(I=0,R=!L&&"openKeyCursor"in W?W.openKeyCursor(q):W.openCursor(q),k=[],R.onsuccess=function(Y){var ne=R.result;return ne?(k.push(L?ne.value:ne.primaryKey),++I===V?_({result:k}):void ne.continue()):_({result:k})},R.onerror=wt(P))})}),openCursor:function(O){var _=O.trans,P=O.values,I=O.query,R=O.reverse,k=O.unique;return new Promise(function(L,V){L=Ee(L);var W=I.index,K=I.range,B=_.objectStore(x),B=W.isPrimaryKey?B:B.index(W.name),W=R?k?"prevunique":"prev":k?"nextunique":"next",q=!P&&"openKeyCursor"in B?B.openKeyCursor(u(K),W):B.openCursor(u(K),W);q.onerror=wt(V),q.onsuccess=Ee(function(Y){var ne,se,ae,ut,te=q.result;te?(te.___id=++hh,te.done=!1,ne=te.continue.bind(te),se=(se=te.continuePrimaryKey)&&se.bind(te),ae=te.advance.bind(te),ut=function(){throw new Error("Cursor not stopped")},te.trans=_,te.stop=te.continue=te.continuePrimaryKey=te.advance=function(){throw new Error("Cursor not started")},te.fail=Ee(V),te.next=function(){var He=this,ze=1;return this.start(function(){return ze--?He.continue():He.stop()}).then(function(){return He})},te.start=function(He){function ze(){if(q.result)try{He()}catch(Je){te.fail(Je)}else te.done=!0,te.start=function(){throw new Error("Cursor behind last entry")},te.stop()}var Ki=new Promise(function(Je,xn){Je=Ee(Je),q.onerror=wt(xn),te.fail=xn,te.stop=function(Is){te.stop=te.continue=te.continuePrimaryKey=te.advance=ut,Je(Is)}});return q.onsuccess=Ee(function(Je){q.onsuccess=ze,ze()}),te.continue=ne,te.continuePrimaryKey=se,te.advance=ae,ze(),Ki},L(te)):L(null)},V)})},count:function(O){var _=O.query,P=O.trans,I=_.index,R=_.range;return new Promise(function(k,L){var V=P.objectStore(x),K=I.isPrimaryKey?V:V.index(I.name),V=u(R),K=V?K.count(V):K.count();K.onsuccess=Ee(function(B){return k(B.target.result)}),K.onerror=wt(L)})}}}var d,h,g,E=(h=v,g=Ku((d=r).objectStoreNames),{schema:{name:d.name,tables:g.map(function(A){return h.objectStore(A)}).map(function(A){var b=A.keyPath,_=A.autoIncrement,x=p(b),O={},_={name:A.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:b==null,compound:x,keyPath:b,autoIncrement:_,unique:!0,extractKey:ds(b)},indexes:Ku(A.indexNames).map(function(P){return A.index(P)}).map(function(k){var I=k.name,R=k.unique,L=k.multiEntry,k=k.keyPath,L={name:I,compound:p(k),keyPath:k,unique:R,multiEntry:L,extractKey:ds(k)};return O[_r(k)]=L}),getIndexByKeyPath:function(P){return O[_r(P)]}};return O[":id"]=_.primaryKey,b!=null&&(O[_r(b)]=_.primaryKey),_})},hasGetAll:0<g.length&&"getAll"in h.objectStore(g[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),v=E.schema,w=E.hasGetAll,E=v.tables.map(l),y={};return E.forEach(function(A){return y[A.name]=A}),{stack:"dbcore",transaction:r.transaction.bind(r),table:function(A){if(!y[A])throw new Error("Table '".concat(A,"' not found"));return y[A]},MIN_KEY:-1/0,MAX_KEY:wr(i),schema:v}}function gh(r,i,a,u){var l=a.IDBKeyRange;return a.indexedDB,{dbcore:(u=ph(i,l,u),r.dbcore.reduce(function(d,h){return h=h.create,o(o({},d),h(d))},u))}}function Pi(r,u){var a=u.db,u=gh(r._middlewares,a,r._deps,u);r.core=u.dbcore,r.tables.forEach(function(l){var d=l.name;r.core.schema.tables.some(function(h){return h.name===d})&&(l.core=r.core.table(d),r[d]instanceof r.Table&&(r[d].core=l.core))})}function Di(r,i,a,u){a.forEach(function(l){var d=u[l];i.forEach(function(h){var g=function v(w,E){return Ve(w,E)||(w=T(w))&&v(w,E)}(h,l);(!g||"value"in g&&g.value===void 0)&&(h===r.Transaction.prototype||h instanceof r.Transaction?oe(h,l,{get:function(){return this.table(l)},set:function(v){H(this,l,{value:v,writable:!0,configurable:!0,enumerable:!0})}}):h[l]=new r.Table(l,d))})})}function hs(r,i){i.forEach(function(a){for(var u in a)a[u]instanceof r.Table&&delete a[u]})}function yh(r,i){return r._cfg.version-i._cfg.version}function mh(r,i,a,u){var l=r._dbSchema;a.objectStoreNames.contains("$meta")&&!l.$meta&&(l.$meta=fs("$meta",qu("")[0],[]),r._storeNames.push("$meta"));var d=r._createTransaction("readwrite",r._storeNames,l);d.create(a),d._completion.catch(u);var h=d._reject.bind(d),g=M.transless||M;Jt(function(){return M.trans=d,M.transless=g,i!==0?(Pi(r,a),w=i,((v=d).storeNames.includes("$meta")?v.table("$meta").get("version").then(function(E){return E??w}):j.resolve(w)).then(function(E){return A=E,b=d,x=a,O=[],E=(y=r)._versions,_=y._dbSchema=Ti(0,y.idbdb,x),(E=E.filter(function(P){return P._cfg.version>=A})).length!==0?(E.forEach(function(P){O.push(function(){var I=_,R=P._cfg.dbschema;Ri(y,I,x),Ri(y,R,x),_=y._dbSchema=R;var k=ps(I,R);k.add.forEach(function(W){gs(x,W[0],W[1].primKey,W[1].indexes)}),k.change.forEach(function(W){if(W.recreate)throw new Z.Upgrade("Not yet support for changing primary key");var q=x.objectStore(W.name);W.add.forEach(function(Y){return Ii(q,Y)}),W.change.forEach(function(Y){q.deleteIndex(Y.name),Ii(q,Y)}),W.del.forEach(function(Y){return q.deleteIndex(Y)})});var L=P._cfg.contentUpgrade;if(L&&P._cfg.version>A){Pi(y,x),b._memoizedTables={};var V=ui(R);k.del.forEach(function(W){V[W]=I[W]}),hs(y,[y.Transaction.prototype]),Di(y,[y.Transaction.prototype],f(V),V),b.schema=V;var K,B=Nn(L);return B&&Kn(),k=j.follow(function(){var W;(K=L(b))&&B&&(W=Zt.bind(null,null),K.then(W,W))}),K&&typeof K.then=="function"?j.resolve(K):k.then(function(){return K})}}),O.push(function(I){var R,k,L=P._cfg.dbschema;R=L,k=I,[].slice.call(k.db.objectStoreNames).forEach(function(V){return R[V]==null&&k.db.deleteObjectStore(V)}),hs(y,[y.Transaction.prototype]),Di(y,[y.Transaction.prototype],y._storeNames,y._dbSchema),b.schema=y._dbSchema}),O.push(function(I){y.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(y.idbdb.version/10)===P._cfg.version?(y.idbdb.deleteObjectStore("$meta"),delete y._dbSchema.$meta,y._storeNames=y._storeNames.filter(function(R){return R!=="$meta"})):I.objectStore("$meta").put(P._cfg.version,"version"))})}),function P(){return O.length?j.resolve(O.shift()(b.idbtrans)).then(P):j.resolve()}().then(function(){Bu(_,x)})):j.resolve();var y,A,b,x,O,_}).catch(h)):(f(l).forEach(function(E){gs(a,E,l[E].primKey,l[E].indexes)}),Pi(r,a),void j.follow(function(){return r.on.populate.fire(d)}).catch(h));var v,w})}function vh(r,i){Bu(r._dbSchema,i),i.db.version%10!=0||i.objectStoreNames.contains("$meta")||i.db.createObjectStore("$meta").add(Math.ceil(i.db.version/10-1),"version");var a=Ti(0,r.idbdb,i);Ri(r,r._dbSchema,i);for(var u=0,l=ps(a,r._dbSchema).change;u<l.length;u++){var d=function(h){if(h.change.length||h.recreate)return console.warn("Unable to patch indexes of table ".concat(h.name," because it has changes on the type of index or primary key.")),{value:void 0};var g=i.objectStore(h.name);h.add.forEach(function(v){st&&console.debug("Dexie upgrade patch: Creating missing index ".concat(h.name,".").concat(v.src)),Ii(g,v)})}(l[u]);if(typeof d=="object")return d.value}}function ps(r,i){var a,u={del:[],add:[],change:[]};for(a in r)i[a]||u.del.push(a);for(a in i){var l=r[a],d=i[a];if(l){var h={name:a,def:d,recreate:!1,del:[],add:[],change:[]};if(""+(l.primKey.keyPath||"")!=""+(d.primKey.keyPath||"")||l.primKey.auto!==d.primKey.auto)h.recreate=!0,u.change.push(h);else{var g=l.idxByName,v=d.idxByName,w=void 0;for(w in g)v[w]||h.del.push(w);for(w in v){var E=g[w],y=v[w];E?E.src!==y.src&&h.change.push(y):h.add.push(y)}(0<h.del.length||0<h.add.length||0<h.change.length)&&u.change.push(h)}}else u.add.push([a,d])}return u}function gs(r,i,a,u){var l=r.db.createObjectStore(i,a.keyPath?{keyPath:a.keyPath,autoIncrement:a.auto}:{autoIncrement:a.auto});return u.forEach(function(d){return Ii(l,d)}),l}function Bu(r,i){f(r).forEach(function(a){i.db.objectStoreNames.contains(a)||(st&&console.debug("Dexie: Creating missing table",a),gs(i,a,r[a].primKey,r[a].indexes))})}function Ii(r,i){r.createIndex(i.name,i.keyPath,{unique:i.unique,multiEntry:i.multi})}function Ti(r,i,a){var u={};return je(i.objectStoreNames,0).forEach(function(l){for(var d=a.objectStore(l),h=ls(Lu(w=d.keyPath),w||"",!0,!1,!!d.autoIncrement,w&&typeof w!="string",!0),g=[],v=0;v<d.indexNames.length;++v){var E=d.index(d.indexNames[v]),w=E.keyPath,E=ls(E.name,w,!!E.unique,!!E.multiEntry,!1,w&&typeof w!="string",!1);g.push(E)}u[l]=fs(l,h,g)}),u}function Ri(r,i,a){for(var u=a.db.objectStoreNames,l=0;l<u.length;++l){var d=u[l],h=a.objectStore(d);r._hasGetAll="getAll"in h;for(var g=0;g<h.indexNames.length;++g){var v=h.indexNames[g],w=h.index(v).keyPath,E=typeof w=="string"?w:"["+je(w).join("+")+"]";!i[d]||(w=i[d].idxByName[E])&&(w.name=v,delete i[d].idxByName[E],i[d].idxByName[v]=w)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&c.WorkerGlobalScope&&c instanceof c.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(r._hasGetAll=!1)}function qu(r){return r.split(",").map(function(i,a){var u=(i=i.trim()).replace(/([&*]|\+\+)/g,""),l=/^\[/.test(u)?u.match(/^\[(.*)\]$/)[1].split("+"):u;return ls(u,l||null,/\&/.test(i),/\*/.test(i),/\+\+/.test(i),p(l),a===0)})}var bh=(Mi.prototype._parseStoresSpec=function(r,i){f(r).forEach(function(a){if(r[a]!==null){var u=qu(r[a]),l=u.shift();if(l.unique=!0,l.multi)throw new Z.Schema("Primary key cannot be multi-valued");u.forEach(function(d){if(d.auto)throw new Z.Schema("Only primary key can be marked as autoIncrement (++)");if(!d.keyPath)throw new Z.Schema("Index must have a name and cannot be an empty string")}),i[a]=fs(a,l,u)}})},Mi.prototype.stores=function(a){var i=this.db;this._cfg.storesSource=this._cfg.storesSource?m(this._cfg.storesSource,a):a;var a=i._versions,u={},l={};return a.forEach(function(d){m(u,d._cfg.storesSource),l=d._cfg.dbschema={},d._parseStoresSpec(u,l)}),i._dbSchema=l,hs(i,[i._allTables,i,i.Transaction.prototype]),Di(i,[i._allTables,i,i.Transaction.prototype,this._cfg.tables],f(l),l),i._storeNames=f(l),this},Mi.prototype.upgrade=function(r){return this._cfg.contentUpgrade=jn(this._cfg.contentUpgrade||de,r),this},Mi);function Mi(){}function ys(r,i){var a=r._dbNamesDB;return a||(a=r._dbNamesDB=new qt(Ei,{addons:[],indexedDB:r,IDBKeyRange:i})).version(1).stores({dbnames:"name"}),a.table("dbnames")}function ms(r){return r&&typeof r.databases=="function"}function vs(r){return Jt(function(){return M.letThrough=!0,r()})}function bs(r){return!("from"in r)}var Ue=function(r,i){if(!this){var a=new Ue;return r&&"d"in r&&m(a,r),a}m(this,arguments.length?{d:1,from:r,to:1<arguments.length?i:r}:{d:0})};function xr(r,i,a){var u=ue(i,a);if(!isNaN(u)){if(0<u)throw RangeError();if(bs(r))return m(r,{from:i,to:a,d:1});var l=r.l,u=r.r;if(ue(a,r.from)<0)return l?xr(l,i,a):r.l={from:i,to:a,d:1,l:null,r:null},Wu(r);if(0<ue(i,r.to))return u?xr(u,i,a):r.r={from:i,to:a,d:1,l:null,r:null},Wu(r);ue(i,r.from)<0&&(r.from=i,r.l=null,r.d=u?u.d+1:1),0<ue(a,r.to)&&(r.to=a,r.r=null,r.d=r.l?r.l.d+1:1),a=!r.r,l&&!r.l&&Er(r,l),u&&a&&Er(r,u)}}function Er(r,i){bs(i)||function a(u,v){var d=v.from,h=v.to,g=v.l,v=v.r;xr(u,d,h),g&&a(u,g),v&&a(u,v)}(r,i)}function Vu(r,i){var a=Ni(i),u=a.next();if(u.done)return!1;for(var l=u.value,d=Ni(r),h=d.next(l.from),g=h.value;!u.done&&!h.done;){if(ue(g.from,l.to)<=0&&0<=ue(g.to,l.from))return!0;ue(l.from,g.from)<0?l=(u=a.next(g.from)).value:g=(h=d.next(l.from)).value}return!1}function Ni(r){var i=bs(r)?null:{s:0,n:r};return{next:function(a){for(var u=0<arguments.length;i;)switch(i.s){case 0:if(i.s=1,u)for(;i.n.l&&ue(a,i.n.from)<0;)i={up:i,n:i.n.l,s:1};else for(;i.n.l;)i={up:i,n:i.n.l,s:1};case 1:if(i.s=2,!u||ue(a,i.n.to)<=0)return{value:i.n,done:!1};case 2:if(i.n.r){i.s=3,i={up:i,n:i.n.r,s:0};continue}case 3:i=i.up}return{done:!0}}}}function Wu(r){var i,a,u=(((i=r.r)===null||i===void 0?void 0:i.d)||0)-(((a=r.l)===null||a===void 0?void 0:a.d)||0),l=1<u?"r":u<-1?"l":"";l&&(i=l=="r"?"l":"r",a=o({},r),u=r[l],r.from=u.from,r.to=u.to,r[l]=u[l],a[l]=u[i],(r[i]=a).d=Uu(a)),r.d=Uu(r)}function Uu(a){var i=a.r,a=a.l;return(i?a?Math.max(i.d,a.d):i.d:a?a.d:0)+1}function ki(r,i){return f(i).forEach(function(a){r[a]?Er(r[a],i[a]):r[a]=function u(l){var d,h,g={};for(d in l)S(l,d)&&(h=l[d],g[d]=!h||typeof h!="object"||li.has(h.constructor)?h:u(h));return g}(i[a])}),r}function ws(r,i){return r.all||i.all||Object.keys(r).some(function(a){return i[a]&&Vu(i[a],r[a])})}F(Ue.prototype,((pt={add:function(r){return Er(this,r),this},addKey:function(r){return xr(this,r,r),this},addKeys:function(r){var i=this;return r.forEach(function(a){return xr(i,a,a)}),this},hasKey:function(r){var i=Ni(this).next(r).value;return i&&ue(i.from,r)<=0&&0<=ue(i.to,r)}})[hn]=function(){return Ni(this)},pt));var wn={},_s={},xs=!1;function ji(r){ki(_s,r),xs||(xs=!0,setTimeout(function(){xs=!1,Es(_s,!(_s={}))},0))}function Es(r,i){i===void 0&&(i=!1);var a=new Set;if(r.all)for(var u=0,l=Object.values(wn);u<l.length;u++)Hu(h=l[u],r,a,i);else for(var d in r){var h,g=/^idb\:\/\/(.*)\/(.*)\//.exec(d);g&&(d=g[1],g=g[2],(h=wn["idb://".concat(d,"/").concat(g)])&&Hu(h,r,a,i))}a.forEach(function(v){return v()})}function Hu(r,i,a,u){for(var l=[],d=0,h=Object.entries(r.queries.query);d<h.length;d++){for(var g=h[d],v=g[0],w=[],E=0,y=g[1];E<y.length;E++){var A=y[E];ws(i,A.obsSet)?A.subscribers.forEach(function(_){return a.add(_)}):u&&w.push(A)}u&&l.push([v,w])}if(u)for(var b=0,x=l;b<x.length;b++){var O=x[b],v=O[0],w=O[1];r.queries.query[v]=w}}function wh(r){var i=r._state,a=r._deps.indexedDB;if(i.isBeingOpened||r.idbdb)return i.dbReadyPromise.then(function(){return i.dbOpenError?De(i.dbOpenError):r});i.isBeingOpened=!0,i.dbOpenError=null,i.openComplete=!1;var u=i.openCanceller,l=Math.round(10*r.verno),d=!1;function h(){if(i.openCanceller!==u)throw new Z.DatabaseClosed("db.open() was cancelled")}function g(){return new j(function(A,b){if(h(),!a)throw new Z.MissingAPI;var x=r.name,O=i.autoSchema||!l?a.open(x):a.open(x,l);if(!O)throw new Z.MissingAPI;O.onerror=wt(b),O.onblocked=Ee(r._fireOnBlocked),O.onupgradeneeded=Ee(function(_){var P;E=O.transaction,i.autoSchema&&!r._options.allowEmptyDB?(O.onerror=vr,E.abort(),O.result.close(),(P=a.deleteDatabase(x)).onsuccess=P.onerror=Ee(function(){b(new Z.NoSuchDatabase("Database ".concat(x," doesnt exist")))})):(E.onerror=wt(b),_=_.oldVersion>Math.pow(2,62)?0:_.oldVersion,y=_<1,r.idbdb=O.result,d&&vh(r,E),mh(r,_/10,E,b))},b),O.onsuccess=Ee(function(){E=null;var _,P,I,R,k,L=r.idbdb=O.result,V=je(L.objectStoreNames);if(0<V.length)try{var K=L.transaction((R=V).length===1?R[0]:R,"readonly");if(i.autoSchema)P=L,I=K,(_=r).verno=P.version/10,I=_._dbSchema=Ti(0,P,I),_._storeNames=je(P.objectStoreNames,0),Di(_,[_._allTables],f(I),I);else if(Ri(r,r._dbSchema,K),((k=ps(Ti(0,(k=r).idbdb,K),k._dbSchema)).add.length||k.change.some(function(B){return B.add.length||B.change.length}))&&!d)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),L.close(),l=L.version+1,d=!0,A(g());Pi(r,K)}catch{}Bn.push(r),L.onversionchange=Ee(function(B){i.vcFired=!0,r.on("versionchange").fire(B)}),L.onclose=Ee(function(B){r.on("close").fire(B)}),y&&(k=r._deps,K=x,L=k.indexedDB,k=k.IDBKeyRange,ms(L)||K===Ei||ys(L,k).put({name:K}).catch(de)),A()},b)}).catch(function(A){switch(A==null?void 0:A.name){case"UnknownError":if(0<i.PR1398_maxLoop)return i.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),g();break;case"VersionError":if(0<l)return l=0,g()}return j.reject(A)})}var v,w=i.dbReadyResolve,E=null,y=!1;return j.race([u,(typeof navigator>"u"?j.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(A){function b(){return indexedDB.databases().finally(A)}v=setInterval(b,100),b()}).finally(function(){return clearInterval(v)}):Promise.resolve()).then(g)]).then(function(){return h(),i.onReadyBeingFired=[],j.resolve(vs(function(){return r.on.ready.fire(r.vip)})).then(function A(){if(0<i.onReadyBeingFired.length){var b=i.onReadyBeingFired.reduce(jn,de);return i.onReadyBeingFired=[],j.resolve(vs(function(){return b(r.vip)})).then(A)}})}).finally(function(){i.openCanceller===u&&(i.onReadyBeingFired=null,i.isBeingOpened=!1)}).catch(function(A){i.dbOpenError=A;try{E&&E.abort()}catch{}return u===i.openCanceller&&r._close(),De(A)}).finally(function(){i.openComplete=!0,w()}).then(function(){var A;return y&&(A={},r.tables.forEach(function(b){b.schema.indexes.forEach(function(x){x.name&&(A["idb://".concat(r.name,"/").concat(b.name,"/").concat(x.name)]=new Ue(-1/0,[[[]]]))}),A["idb://".concat(r.name,"/").concat(b.name,"/")]=A["idb://".concat(r.name,"/").concat(b.name,"/:dels")]=new Ue(-1/0,[[[]]])}),nn(br).fire(A),Es(A,!0)),r})}function Ss(r){function i(d){return r.next(d)}var a=l(i),u=l(function(d){return r.throw(d)});function l(d){return function(v){var g=d(v),v=g.value;return g.done?v:v&&typeof v.then=="function"?v.then(a,u):p(v)?Promise.all(v).then(a,u):a(v)}}return l(i)()}function $i(r,i,a){for(var u=p(r)?r.slice():[r],l=0;l<a;++l)u.push(i);return u}var _h={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(r){return o(o({},r),{table:function(i){var a=r.table(i),u=a.schema,l={},d=[];function h(y,A,b){var x=_r(y),O=l[x]=l[x]||[],_=y==null?0:typeof y=="string"?1:y.length,P=0<A,P=o(o({},b),{name:P?"".concat(x,"(virtual-from:").concat(b.name,")"):b.name,lowLevelIndex:b,isVirtual:P,keyTail:A,keyLength:_,extractKey:ds(y),unique:!P&&b.unique});return O.push(P),P.isPrimaryKey||d.push(P),1<_&&h(_===2?y[0]:y.slice(0,_-1),A+1,b),O.sort(function(I,R){return I.keyTail-R.keyTail}),P}i=h(u.primaryKey.keyPath,0,u.primaryKey),l[":id"]=[i];for(var g=0,v=u.indexes;g<v.length;g++){var w=v[g];h(w.keyPath,0,w)}function E(y){var A,b=y.query.index;return b.isVirtual?o(o({},y),{query:{index:b.lowLevelIndex,range:(A=y.query.range,b=b.keyTail,{type:A.type===1?2:A.type,lower:$i(A.lower,A.lowerOpen?r.MAX_KEY:r.MIN_KEY,b),lowerOpen:!0,upper:$i(A.upper,A.upperOpen?r.MIN_KEY:r.MAX_KEY,b),upperOpen:!0})}}):y}return o(o({},a),{schema:o(o({},u),{primaryKey:i,indexes:d,getIndexByKeyPath:function(y){return(y=l[_r(y)])&&y[0]}}),count:function(y){return a.count(E(y))},query:function(y){return a.query(E(y))},openCursor:function(y){var A=y.query.index,b=A.keyTail,x=A.isVirtual,O=A.keyLength;return x?a.openCursor(E(y)).then(function(P){return P&&_(P)}):a.openCursor(y);function _(P){return Object.create(P,{continue:{value:function(I){I!=null?P.continue($i(I,y.reverse?r.MAX_KEY:r.MIN_KEY,b)):y.unique?P.continue(P.key.slice(0,O).concat(y.reverse?r.MIN_KEY:r.MAX_KEY,b)):P.continue()}},continuePrimaryKey:{value:function(I,R){P.continuePrimaryKey($i(I,r.MAX_KEY,b),R)}},primaryKey:{get:function(){return P.primaryKey}},key:{get:function(){var I=P.key;return O===1?I[0]:I.slice(0,O)}},value:{get:function(){return P.value}}})}}})}})}};function Os(r,i,a,u){return a=a||{},u=u||"",f(r).forEach(function(l){var d,h,g;S(i,l)?(d=r[l],h=i[l],typeof d=="object"&&typeof h=="object"&&d&&h?(g=Mn(d))!==Mn(h)?a[u+l]=i[l]:g==="Object"?Os(d,h,a,u+l+"."):d!==h&&(a[u+l]=i[l]):d!==h&&(a[u+l]=i[l])):a[u+l]=void 0}),f(i).forEach(function(l){S(r,l)||(a[u+l]=i[l])}),a}function As(r,i){return i.type==="delete"?i.keys:i.keys||i.values.map(r.extractKey)}var xh={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(r){return o(o({},r),{table:function(i){var a=r.table(i),u=a.schema.primaryKey;return o(o({},a),{mutate:function(l){var d=M.trans,h=d.table(i).hook,g=h.deleting,v=h.creating,w=h.updating;switch(l.type){case"add":if(v.fire===de)break;return d._promise("readwrite",function(){return E(l)},!0);case"put":if(v.fire===de&&w.fire===de)break;return d._promise("readwrite",function(){return E(l)},!0);case"delete":if(g.fire===de)break;return d._promise("readwrite",function(){return E(l)},!0);case"deleteRange":if(g.fire===de)break;return d._promise("readwrite",function(){return function y(A,b,x){return a.query({trans:A,values:!1,query:{index:u,range:b},limit:x}).then(function(O){var _=O.result;return E({type:"delete",keys:_,trans:A}).then(function(P){return 0<P.numFailures?Promise.reject(P.failures[0]):_.length<x?{failures:[],numFailures:0,lastResult:void 0}:y(A,o(o({},b),{lower:_[_.length-1],lowerOpen:!0}),x)})})}(l.trans,l.range,1e4)},!0)}return a.mutate(l);function E(y){var A,b,x,O=M.trans,_=y.keys||As(u,y);if(!_)throw new Error("Keys missing");return(y=y.type==="add"||y.type==="put"?o(o({},y),{keys:_}):o({},y)).type!=="delete"&&(y.values=s([],y.values)),y.keys&&(y.keys=s([],y.keys)),A=a,x=_,((b=y).type==="add"?Promise.resolve([]):A.getMany({trans:b.trans,keys:x,cache:"immutable"})).then(function(P){var I=_.map(function(R,k){var L,V,K,B=P[k],W={onerror:null,onsuccess:null};return y.type==="delete"?g.fire.call(W,R,B,O):y.type==="add"||B===void 0?(L=v.fire.call(W,R,y.values[k],O),R==null&&L!=null&&(y.keys[k]=R=L,u.outbound||Re(y.values[k],u.keyPath,R))):(L=Os(B,y.values[k]),(V=w.fire.call(W,L,R,B,O))&&(K=y.values[k],Object.keys(V).forEach(function(q){S(K,q)?K[q]=V[q]:Re(K,q,V[q])}))),W});return a.mutate(y).then(function(R){for(var k=R.failures,L=R.results,V=R.numFailures,R=R.lastResult,K=0;K<_.length;++K){var B=(L||_)[K],W=I[K];B==null?W.onerror&&W.onerror(k[K]):W.onsuccess&&W.onsuccess(y.type==="put"&&P[K]?y.values[K]:B)}return{failures:k,results:L,numFailures:V,lastResult:R}}).catch(function(R){return I.forEach(function(k){return k.onerror&&k.onerror(R)}),Promise.reject(R)})})}}})}})}};function zu(r,i,a){try{if(!i||i.keys.length<r.length)return null;for(var u=[],l=0,d=0;l<i.keys.length&&d<r.length;++l)ue(i.keys[l],r[d])===0&&(u.push(a?Mt(i.values[l]):i.values[l]),++d);return u.length===r.length?u:null}catch{return null}}var Eh={stack:"dbcore",level:-1,create:function(r){return{table:function(i){var a=r.table(i);return o(o({},a),{getMany:function(u){if(!u.cache)return a.getMany(u);var l=zu(u.keys,u.trans._cache,u.cache==="clone");return l?j.resolve(l):a.getMany(u).then(function(d){return u.trans._cache={keys:u.keys,values:u.cache==="clone"?Mt(d):d},d})},mutate:function(u){return u.type!=="add"&&(u.trans._cache=null),a.mutate(u)}})}}}};function Gu(r,i){return r.trans.mode==="readonly"&&!!r.subscr&&!r.trans.explicit&&r.trans.db._options.cache!=="disabled"&&!i.schema.primaryKey.outbound}function Yu(r,i){switch(r){case"query":return i.values&&!i.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Sh={stack:"dbcore",level:0,name:"Observability",create:function(r){var i=r.schema.name,a=new Ue(r.MIN_KEY,r.MAX_KEY);return o(o({},r),{transaction:function(u,l,d){if(M.subscr&&l!=="readonly")throw new Z.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(M.querier));return r.transaction(u,l,d)},table:function(u){var l=r.table(u),d=l.schema,h=d.primaryKey,y=d.indexes,g=h.extractKey,v=h.outbound,w=h.autoIncrement&&y.filter(function(b){return b.compound&&b.keyPath.includes(h.keyPath)}),E=o(o({},l),{mutate:function(b){function x(q){return q="idb://".concat(i,"/").concat(u,"/").concat(q),R[q]||(R[q]=new Ue)}var O,_,P,I=b.trans,R=b.mutatedParts||(b.mutatedParts={}),k=x(""),L=x(":dels"),V=b.type,W=b.type==="deleteRange"?[b.range]:b.type==="delete"?[b.keys]:b.values.length<50?[As(h,b).filter(function(q){return q}),b.values]:[],K=W[0],B=W[1],W=b.trans._cache;return p(K)?(k.addKeys(K),(W=V==="delete"||K.length===B.length?zu(K,W):null)||L.addKeys(K),(W||B)&&(O=x,_=W,P=B,d.indexes.forEach(function(q){var Y=O(q.name||"");function ne(ae){return ae!=null?q.extractKey(ae):null}function se(ae){return q.multiEntry&&p(ae)?ae.forEach(function(ut){return Y.addKey(ut)}):Y.addKey(ae)}(_||P).forEach(function(ae,He){var te=_&&ne(_[He]),He=P&&ne(P[He]);ue(te,He)!==0&&(te!=null&&se(te),He!=null&&se(He))})}))):K?(B={from:(B=K.lower)!==null&&B!==void 0?B:r.MIN_KEY,to:(B=K.upper)!==null&&B!==void 0?B:r.MAX_KEY},L.add(B),k.add(B)):(k.add(a),L.add(a),d.indexes.forEach(function(q){return x(q.name).add(a)})),l.mutate(b).then(function(q){return!K||b.type!=="add"&&b.type!=="put"||(k.addKeys(q.results),w&&w.forEach(function(Y){for(var ne=b.values.map(function(te){return Y.extractKey(te)}),se=Y.keyPath.findIndex(function(te){return te===h.keyPath}),ae=0,ut=q.results.length;ae<ut;++ae)ne[ae][se]=q.results[ae];x(Y.name).addKeys(ne)})),I.mutatedParts=ki(I.mutatedParts||{},R),q})}}),y=function(x){var O=x.query,x=O.index,O=O.range;return[x,new Ue((x=O.lower)!==null&&x!==void 0?x:r.MIN_KEY,(O=O.upper)!==null&&O!==void 0?O:r.MAX_KEY)]},A={get:function(b){return[h,new Ue(b.key)]},getMany:function(b){return[h,new Ue().addKeys(b.keys)]},count:y,query:y,openCursor:y};return f(A).forEach(function(b){E[b]=function(x){var O=M.subscr,_=!!O,P=Gu(M,l)&&Yu(b,x)?x.obsSet={}:O;if(_){var I=function(B){return B="idb://".concat(i,"/").concat(u,"/").concat(B),P[B]||(P[B]=new Ue)},R=I(""),k=I(":dels"),O=A[b](x),_=O[0],O=O[1];if((b==="query"&&_.isPrimaryKey&&!x.values?k:I(_.name||"")).add(O),!_.isPrimaryKey){if(b!=="count"){var L=b==="query"&&v&&x.values&&l.query(o(o({},x),{values:!1}));return l[b].apply(this,arguments).then(function(B){if(b==="query"){if(v&&x.values)return L.then(function(ne){return ne=ne.result,R.addKeys(ne),B});var W=x.values?B.result.map(g):B.result;(x.values?R:k).addKeys(W)}else if(b==="openCursor"){var q=B,Y=x.values;return q&&Object.create(q,{key:{get:function(){return k.addKey(q.primaryKey),q.key}},primaryKey:{get:function(){var ne=q.primaryKey;return k.addKey(ne),ne}},value:{get:function(){return Y&&R.addKey(q.primaryKey),q.value}}})}return B})}k.add(a)}}return l[b].apply(this,arguments)}}),E}})}};function Qu(r,i,a){if(a.numFailures===0)return i;if(i.type==="deleteRange")return null;var u=i.keys?i.keys.length:"values"in i&&i.values?i.values.length:1;return a.numFailures===u?null:(i=o({},i),p(i.keys)&&(i.keys=i.keys.filter(function(l,d){return!(d in a.failures)})),"values"in i&&p(i.values)&&(i.values=i.values.filter(function(l,d){return!(d in a.failures)})),i)}function Cs(r,i){return a=r,((u=i).lower===void 0||(u.lowerOpen?0<ue(a,u.lower):0<=ue(a,u.lower)))&&(r=r,(i=i).upper===void 0||(i.upperOpen?ue(r,i.upper)<0:ue(r,i.upper)<=0));var a,u}function Xu(r,i,A,u,l,d){if(!A||A.length===0)return r;var h=i.query.index,g=h.multiEntry,v=i.query.range,w=u.schema.primaryKey.extractKey,E=h.extractKey,y=(h.lowLevelIndex||h).extractKey,A=A.reduce(function(b,x){var O=b,_=[];if(x.type==="add"||x.type==="put")for(var P=new Ue,I=x.values.length-1;0<=I;--I){var R,k=x.values[I],L=w(k);P.hasKey(L)||(R=E(k),(g&&p(R)?R.some(function(q){return Cs(q,v)}):Cs(R,v))&&(P.addKey(L),_.push(k)))}switch(x.type){case"add":var V=new Ue().addKeys(i.values?b.map(function(Y){return w(Y)}):b),O=b.concat(i.values?_.filter(function(Y){return Y=w(Y),!V.hasKey(Y)&&(V.addKey(Y),!0)}):_.map(function(Y){return w(Y)}).filter(function(Y){return!V.hasKey(Y)&&(V.addKey(Y),!0)}));break;case"put":var K=new Ue().addKeys(x.values.map(function(Y){return w(Y)}));O=b.filter(function(Y){return!K.hasKey(i.values?w(Y):Y)}).concat(i.values?_:_.map(function(Y){return w(Y)}));break;case"delete":var B=new Ue().addKeys(x.keys);O=b.filter(function(Y){return!B.hasKey(i.values?w(Y):Y)});break;case"deleteRange":var W=x.range;O=b.filter(function(Y){return!Cs(w(Y),W)})}return O},r);return A===r?r:(A.sort(function(b,x){return ue(y(b),y(x))||ue(w(b),w(x))}),i.limit&&i.limit<1/0&&(A.length>i.limit?A.length=i.limit:r.length===i.limit&&A.length<i.limit&&(l.dirty=!0)),d?Object.freeze(A):A)}function Ju(r,i){return ue(r.lower,i.lower)===0&&ue(r.upper,i.upper)===0&&!!r.lowerOpen==!!i.lowerOpen&&!!r.upperOpen==!!i.upperOpen}function Oh(r,i){return function(a,u,l,d){if(a===void 0)return u!==void 0?-1:0;if(u===void 0)return 1;if((u=ue(a,u))===0){if(l&&d)return 0;if(l)return 1;if(d)return-1}return u}(r.lower,i.lower,r.lowerOpen,i.lowerOpen)<=0&&0<=function(a,u,l,d){if(a===void 0)return u!==void 0?1:0;if(u===void 0)return-1;if((u=ue(a,u))===0){if(l&&d)return 0;if(l)return-1;if(d)return 1}return u}(r.upper,i.upper,r.upperOpen,i.upperOpen)}function Ah(r,i,a,u){r.subscribers.add(a),u.addEventListener("abort",function(){var l,d;r.subscribers.delete(a),r.subscribers.size===0&&(l=r,d=i,setTimeout(function(){l.subscribers.size===0&&vt(d,l)},3e3))})}var Ch={stack:"dbcore",level:0,name:"Cache",create:function(r){var i=r.schema.name;return o(o({},r),{transaction:function(a,u,l){var d,h,g=r.transaction(a,u,l);return u==="readwrite"&&(h=(d=new AbortController).signal,l=function(v){return function(){if(d.abort(),u==="readwrite"){for(var w=new Set,E=0,y=a;E<y.length;E++){var A=y[E],b=wn["idb://".concat(i,"/").concat(A)];if(b){var x=r.table(A),O=b.optimisticOps.filter(function(Y){return Y.trans===g});if(g._explicit&&v&&g.mutatedParts)for(var _=0,P=Object.values(b.queries.query);_<P.length;_++)for(var I=0,R=(V=P[_]).slice();I<R.length;I++)ws((K=R[I]).obsSet,g.mutatedParts)&&(vt(V,K),K.subscribers.forEach(function(Y){return w.add(Y)}));else if(0<O.length){b.optimisticOps=b.optimisticOps.filter(function(Y){return Y.trans!==g});for(var k=0,L=Object.values(b.queries.query);k<L.length;k++)for(var V,K,B,W=0,q=(V=L[k]).slice();W<q.length;W++)(K=q[W]).res!=null&&g.mutatedParts&&(v&&!K.dirty?(B=Object.isFrozen(K.res),B=Xu(K.res,K.req,O,x,K,B),K.dirty?(vt(V,K),K.subscribers.forEach(function(Y){return w.add(Y)})):B!==K.res&&(K.res=B,K.promise=j.resolve({result:B}))):(K.dirty&&vt(V,K),K.subscribers.forEach(function(Y){return w.add(Y)})))}}}w.forEach(function(Y){return Y()})}}},g.addEventListener("abort",l(!1),{signal:h}),g.addEventListener("error",l(!1),{signal:h}),g.addEventListener("complete",l(!0),{signal:h})),g},table:function(a){var u=r.table(a),l=u.schema.primaryKey;return o(o({},u),{mutate:function(d){var h=M.trans;if(l.outbound||h.db._options.cache==="disabled"||h.explicit||h.idbtrans.mode!=="readwrite")return u.mutate(d);var g=wn["idb://".concat(i,"/").concat(a)];return g?(h=u.mutate(d),d.type!=="add"&&d.type!=="put"||!(50<=d.values.length||As(l,d).some(function(v){return v==null}))?(g.optimisticOps.push(d),d.mutatedParts&&ji(d.mutatedParts),h.then(function(v){0<v.numFailures&&(vt(g.optimisticOps,d),(v=Qu(0,d,v))&&g.optimisticOps.push(v),d.mutatedParts&&ji(d.mutatedParts))}),h.catch(function(){vt(g.optimisticOps,d),d.mutatedParts&&ji(d.mutatedParts)})):h.then(function(v){var w=Qu(0,o(o({},d),{values:d.values.map(function(E,y){var A;return v.failures[y]?E:(E=(A=l.keyPath)!==null&&A!==void 0&&A.includes(".")?Mt(E):o({},E),Re(E,l.keyPath,v.results[y]),E)})}),v);g.optimisticOps.push(w),queueMicrotask(function(){return d.mutatedParts&&ji(d.mutatedParts)})}),h):u.mutate(d)},query:function(d){if(!Gu(M,u)||!Yu("query",d))return u.query(d);var h=((w=M.trans)===null||w===void 0?void 0:w.db._options.cache)==="immutable",y=M,g=y.requery,v=y.signal,w=function(x,O,_,P){var I=wn["idb://".concat(x,"/").concat(O)];if(!I)return[];if(!(O=I.queries[_]))return[null,!1,I,null];var R=O[(P.query?P.query.index.name:null)||""];if(!R)return[null,!1,I,null];switch(_){case"query":var k=R.find(function(L){return L.req.limit===P.limit&&L.req.values===P.values&&Ju(L.req.query.range,P.query.range)});return k?[k,!0,I,R]:[R.find(function(L){return("limit"in L.req?L.req.limit:1/0)>=P.limit&&(!P.values||L.req.values)&&Oh(L.req.query.range,P.query.range)}),!1,I,R];case"count":return k=R.find(function(L){return Ju(L.req.query.range,P.query.range)}),[k,!!k,I,R]}}(i,a,"query",d),E=w[0],y=w[1],A=w[2],b=w[3];return E&&y?E.obsSet=d.obsSet:(y=u.query(d).then(function(x){var O=x.result;if(E&&(E.res=O),h){for(var _=0,P=O.length;_<P;++_)Object.freeze(O[_]);Object.freeze(O)}else x.result=Mt(O);return x}).catch(function(x){return b&&E&&vt(b,E),Promise.reject(x)}),E={obsSet:d.obsSet,promise:y,subscribers:new Set,type:"query",req:d,dirty:!1},b?b.push(E):(b=[E],(A=A||(wn["idb://".concat(i,"/").concat(a)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[d.query.index.name||""]=b)),Ah(E,b,g,v),E.promise.then(function(x){return{result:Xu(x.result,d,A==null?void 0:A.optimisticOps,u,E,h)}})}})}})}};function Fi(r,i){return new Proxy(r,{get:function(a,u,l){return u==="db"?i:Reflect.get(a,u,l)}})}var qt=(Ie.prototype.version=function(r){if(isNaN(r)||r<.1)throw new Z.Type("Given version is not a positive number");if(r=Math.round(10*r)/10,this.idbdb||this._state.isBeingOpened)throw new Z.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,r);var i=this._versions,a=i.filter(function(u){return u._cfg.version===r})[0];return a||(a=new this.Version(r),i.push(a),i.sort(yh),a.stores({}),this._state.autoSchema=!1,a)},Ie.prototype._whenReady=function(r){var i=this;return this.idbdb&&(this._state.openComplete||M.letThrough||this._vip)?r():new j(function(a,u){if(i._state.openComplete)return u(new Z.DatabaseClosed(i._state.dbOpenError));if(!i._state.isBeingOpened){if(!i._state.autoOpen)return void u(new Z.DatabaseClosed);i.open().catch(de)}i._state.dbReadyPromise.then(a,u)}).then(r)},Ie.prototype.use=function(r){var i=r.stack,a=r.create,u=r.level,l=r.name;return l&&this.unuse({stack:i,name:l}),r=this._middlewares[i]||(this._middlewares[i]=[]),r.push({stack:i,create:a,level:u??10,name:l}),r.sort(function(d,h){return d.level-h.level}),this},Ie.prototype.unuse=function(r){var i=r.stack,a=r.name,u=r.create;return i&&this._middlewares[i]&&(this._middlewares[i]=this._middlewares[i].filter(function(l){return u?l.create!==u:!!a&&l.name!==a})),this},Ie.prototype.open=function(){var r=this;return mn(N,function(){return wh(r)})},Ie.prototype._close=function(){var r=this._state,i=Bn.indexOf(this);if(0<=i&&Bn.splice(i,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}r.isBeingOpened||(r.dbReadyPromise=new j(function(a){r.dbReadyResolve=a}),r.openCanceller=new j(function(a,u){r.cancelOpen=u}))},Ie.prototype.close=function(a){var i=(a===void 0?{disableAutoOpen:!0}:a).disableAutoOpen,a=this._state;i?(a.isBeingOpened&&a.cancelOpen(new Z.DatabaseClosed),this._close(),a.autoOpen=!1,a.dbOpenError=new Z.DatabaseClosed):(this._close(),a.autoOpen=this._options.autoOpen||a.isBeingOpened,a.openComplete=!1,a.dbOpenError=null)},Ie.prototype.delete=function(r){var i=this;r===void 0&&(r={disableAutoOpen:!0});var a=0<arguments.length&&typeof arguments[0]!="object",u=this._state;return new j(function(l,d){function h(){i.close(r);var g=i._deps.indexedDB.deleteDatabase(i.name);g.onsuccess=Ee(function(){var v,w,E;v=i._deps,w=i.name,E=v.indexedDB,v=v.IDBKeyRange,ms(E)||w===Ei||ys(E,v).delete(w).catch(de),l()}),g.onerror=wt(d),g.onblocked=i._fireOnBlocked}if(a)throw new Z.InvalidArgument("Invalid closeOptions argument to db.delete()");u.isBeingOpened?u.dbReadyPromise.then(h):h()})},Ie.prototype.backendDB=function(){return this.idbdb},Ie.prototype.isOpen=function(){return this.idbdb!==null},Ie.prototype.hasBeenClosed=function(){var r=this._state.dbOpenError;return r&&r.name==="DatabaseClosed"},Ie.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Ie.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Ie.prototype,"tables",{get:function(){var r=this;return f(this._allTables).map(function(i){return r._allTables[i]})},enumerable:!1,configurable:!0}),Ie.prototype.transaction=function(){var r=(function(i,a,u){var l=arguments.length;if(l<2)throw new Z.InvalidArgument("Too few arguments");for(var d=new Array(l-1);--l;)d[l-1]=arguments[l];return u=d.pop(),[i,ci(d),u]}).apply(this,arguments);return this._transaction.apply(this,r)},Ie.prototype._transaction=function(r,i,a){var u=this,l=M.trans;l&&l.db===this&&r.indexOf("!")===-1||(l=null);var d,h,g=r.indexOf("?")!==-1;r=r.replace("!","").replace("?","");try{if(h=i.map(function(w){if(w=w instanceof u.Table?w.name:w,typeof w!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return w}),r=="r"||r===is)d=is;else{if(r!="rw"&&r!=os)throw new Z.InvalidArgument("Invalid transaction mode: "+r);d=os}if(l){if(l.mode===is&&d===os){if(!g)throw new Z.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");l=null}l&&h.forEach(function(w){if(l&&l.storeNames.indexOf(w)===-1){if(!g)throw new Z.SubTransaction("Table "+w+" not included in parent transaction.");l=null}}),g&&l&&!l.active&&(l=null)}}catch(w){return l?l._promise(null,function(E,y){y(w)}):De(w)}var v=(function w(E,y,A,b,x){return j.resolve().then(function(){var O=M.transless||M,_=E._createTransaction(y,A,E._dbSchema,b);if(_.explicit=!0,O={trans:_,transless:O},b)_.idbtrans=b.idbtrans;else try{_.create(),_.idbtrans._explicit=!0,E._state.PR1398_maxLoop=3}catch(R){return R.name===fr.InvalidState&&E.isOpen()&&0<--E._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),E.close({disableAutoOpen:!1}),E.open().then(function(){return w(E,y,A,null,x)})):De(R)}var P,I=Nn(x);return I&&Kn(),O=j.follow(function(){var R;(P=x.call(_,_))&&(I?(R=Zt.bind(null,null),P.then(R,R)):typeof P.next=="function"&&typeof P.throw=="function"&&(P=Ss(P)))},O),(P&&typeof P.then=="function"?j.resolve(P).then(function(R){return _.active?R:De(new Z.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):O.then(function(){return P})).then(function(R){return b&&_._resolve(),_._completion.then(function(){return R})}).catch(function(R){return _._reject(R),De(R)})})}).bind(null,this,d,h,l,a);return l?l._promise(d,v,"lock"):M.trans?mn(M.transless,function(){return u._whenReady(v)}):this._whenReady(v)},Ie.prototype.table=function(r){if(!S(this._allTables,r))throw new Z.InvalidTable("Table ".concat(r," does not exist"));return this._allTables[r]},Ie);function Ie(r,i){var a=this;this._middlewares={},this.verno=0;var u=Ie.dependencies;this._options=i=o({addons:Ie.addons,autoOpen:!0,indexedDB:u.indexedDB,IDBKeyRange:u.IDBKeyRange,cache:"cloned"},i),this._deps={indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange},u=i.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var l,d,h,g,v,w={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:de,dbReadyPromise:null,cancelOpen:de,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:i.autoOpen};w.dbReadyPromise=new j(function(y){w.dbReadyResolve=y}),w.openCanceller=new j(function(y,A){w.cancelOpen=A}),this._state=w,this.name=r,this.on=gr(this,"populate","blocked","versionchange","close",{ready:[jn,de]}),this.on.ready.subscribe=dt(this.on.ready.subscribe,function(y){return function(A,b){Ie.vip(function(){var x,O=a._state;O.openComplete?(O.dbOpenError||j.resolve().then(A),b&&y(A)):O.onReadyBeingFired?(O.onReadyBeingFired.push(A),b&&y(A)):(y(A),x=a,b||y(function _(){x.on.ready.unsubscribe(A),x.on.ready.unsubscribe(_)}))})}}),this.Collection=(l=this,yr(ch.prototype,function(P,_){this.db=l;var b=Du,x=null;if(_)try{b=_()}catch(I){x=I}var O=P._ctx,_=O.table,P=_.hook.reading.fire;this._ctx={table:_,index:O.index,isPrimKey:!O.index||_.schema.primKey.keyPath&&O.index===_.schema.primKey.name,range:b,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:x,or:O.or,valueMapper:P!==bt?P:null}})),this.Table=(d=this,yr(Mu.prototype,function(y,A,b){this.db=d,this._tx=b,this.name=y,this.schema=A,this.hook=d._allTables[y]?d._allTables[y].hook:gr(null,{creating:[dr,de],reading:[pi,bt],updating:[yi,de],deleting:[gi,de]})})),this.Transaction=(h=this,yr(dh.prototype,function(y,A,b,x,O){var _=this;this.db=h,this.mode=y,this.storeNames=A,this.schema=b,this.chromeTransactionDurability=x,this.idbtrans=null,this.on=gr(this,"complete","error","abort"),this.parent=O||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new j(function(P,I){_._resolve=P,_._reject=I}),this._completion.then(function(){_.active=!1,_.on.complete.fire()},function(P){var I=_.active;return _.active=!1,_.on.error.fire(P),_.parent?_.parent._reject(P):I&&_.idbtrans&&_.idbtrans.abort(),De(P)})})),this.Version=(g=this,yr(bh.prototype,function(y){this.db=g,this._cfg={version:y,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(v=this,yr(Fu.prototype,function(y,A,b){if(this.db=v,this._ctx={table:y,index:A===":id"?null:A,or:b},this._cmp=this._ascending=ue,this._descending=function(x,O){return ue(O,x)},this._max=function(x,O){return 0<ue(x,O)?x:O},this._min=function(x,O){return ue(x,O)<0?x:O},this._IDBKeyRange=v._deps.IDBKeyRange,!this._IDBKeyRange)throw new Z.MissingAPI})),this.on("versionchange",function(y){0<y.newVersion?console.warn("Another connection wants to upgrade database '".concat(a.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(a.name,"'. Closing db now to resume the delete request.")),a.close({disableAutoOpen:!1})}),this.on("blocked",function(y){!y.newVersion||y.newVersion<y.oldVersion?console.warn("Dexie.delete('".concat(a.name,"') was blocked")):console.warn("Upgrade '".concat(a.name,"' blocked by other connection holding version ").concat(y.oldVersion/10))}),this._maxKey=wr(i.IDBKeyRange),this._createTransaction=function(y,A,b,x){return new a.Transaction(y,A,b,a._options.chromeTransactionDurability,x)},this._fireOnBlocked=function(y){a.on("blocked").fire(y),Bn.filter(function(A){return A.name===a.name&&A!==a&&!A._state.vcFired}).map(function(A){return A.on("versionchange").fire(y)})},this.use(Eh),this.use(Ch),this.use(Sh),this.use(_h),this.use(xh);var E=new Proxy(this,{get:function(y,A,b){if(A==="_vip")return!0;if(A==="table")return function(O){return Fi(a.table(O),E)};var x=Reflect.get(y,A,b);return x instanceof Mu?Fi(x,E):A==="tables"?x.map(function(O){return Fi(O,E)}):A==="_createTransaction"?function(){return Fi(x.apply(this,arguments),E)}:x}});this.vip=E,u.forEach(function(y){return y(a)})}var Li,pt=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Ph=(Ps.prototype.subscribe=function(r,i,a){return this._subscribe(r&&typeof r!="function"?r:{next:r,error:i,complete:a})},Ps.prototype[pt]=function(){return this},Ps);function Ps(r){this._subscribe=r}try{Li={indexedDB:c.indexedDB||c.mozIndexedDB||c.webkitIndexedDB||c.msIndexedDB,IDBKeyRange:c.IDBKeyRange||c.webkitIDBKeyRange}}catch{Li={indexedDB:null,IDBKeyRange:null}}function Zu(r){var i,a=!1,u=new Ph(function(l){var d=Nn(r),h,g=!1,v={},w={},E={get closed(){return g},unsubscribe:function(){g||(g=!0,h&&h.abort(),y&&nn.storagemutated.unsubscribe(b))}};l.start&&l.start(E);var y=!1,A=function(){return rs(x)},b=function(O){ki(v,O),ws(w,v)&&A()},x=function(){var O,_,P;!g&&Li.indexedDB&&(v={},O={},h&&h.abort(),h=new AbortController,P=function(I){var R=$e();try{d&&Kn();var k=Jt(r,I);return k=d?k.finally(Zt):k}finally{R&&Lt()}}(_={subscr:O,signal:h.signal,requery:A,querier:r,trans:null}),Promise.resolve(P).then(function(I){a=!0,i=I,g||_.signal.aborted||(v={},function(R){for(var k in R)if(S(R,k))return;return 1}(w=O)||y||(nn(br,b),y=!0),rs(function(){return!g&&l.next&&l.next(I)}))},function(I){a=!1,["DatabaseClosedError","AbortError"].includes(I==null?void 0:I.name)||g||rs(function(){g||l.error&&l.error(I)})}))};return setTimeout(A,0),E});return u.hasValue=function(){return a},u.getValue=function(){return i},u}var _n=qt;function Ds(r){var i=rn;try{rn=!0,nn.storagemutated.fire(r),Es(r,!0)}finally{rn=i}}F(_n,o(o({},Xe),{delete:function(r){return new _n(r,{addons:[]}).delete()},exists:function(r){return new _n(r,{addons:[]}).open().then(function(i){return i.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(r){try{return i=_n.dependencies,a=i.indexedDB,i=i.IDBKeyRange,(ms(a)?Promise.resolve(a.databases()).then(function(u){return u.map(function(l){return l.name}).filter(function(l){return l!==Ei})}):ys(a,i).toCollection().primaryKeys()).then(r)}catch{return De(new Z.MissingAPI)}var i,a},defineClass:function(){return function(r){m(this,r)}},ignoreTransaction:function(r){return M.trans?mn(M.transless,r):r()},vip:vs,async:function(r){return function(){try{var i=Ss(r.apply(this,arguments));return i&&typeof i.then=="function"?i:j.resolve(i)}catch(a){return De(a)}}},spawn:function(r,i,a){try{var u=Ss(r.apply(a,i||[]));return u&&typeof u.then=="function"?u:j.resolve(u)}catch(l){return De(l)}},currentTransaction:{get:function(){return M.trans||null}},waitFor:function(r,i){return i=j.resolve(typeof r=="function"?_n.ignoreTransaction(r):r).timeout(i||6e4),M.trans?M.trans.waitFor(i):i},Promise:j,debug:{get:function(){return st},set:function(r){$n(r)}},derive:fe,extend:m,props:F,override:dt,Events:gr,on:nn,liveQuery:Zu,extendObservabilitySet:ki,getByKeyPath:Qe,setByKeyPath:Re,delByKeyPath:function(r,i){typeof i=="string"?Re(r,i,void 0):"length"in i&&[].map.call(i,function(a){Re(r,a,void 0)})},shallowClone:ui,deepClone:Mt,getObjectDiff:Os,cmp:ue,asap:Ye,minKey:-1/0,addons:[],connections:Bn,errnames:fr,dependencies:Li,cache:wn,semVer:"4.0.10",version:"4.0.10".split(".").map(function(r){return parseInt(r)}).reduce(function(r,i,a){return r+i/Math.pow(10,2*a)})})),_n.maxKey=wr(_n.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(nn(br,function(r){rn||(r=new CustomEvent(cs,{detail:r}),rn=!0,dispatchEvent(r),rn=!1)}),addEventListener(cs,function(r){r=r.detail,rn||Ds(r)}));var Wn,rn=!1,ec=function(){};return typeof BroadcastChannel<"u"&&((ec=function(){(Wn=new BroadcastChannel(cs)).onmessage=function(r){return r.data&&Ds(r.data)}})(),typeof Wn.unref=="function"&&Wn.unref(),nn(br,function(r){rn||Wn.postMessage(r)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(r){if(!qt.disableBfCache&&r.persisted){st&&console.debug("Dexie: handling persisted pagehide"),Wn!=null&&Wn.close();for(var i=0,a=Bn;i<a.length;i++)a[i].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(r){!qt.disableBfCache&&r.persisted&&(st&&console.debug("Dexie: handling persisted pageshow"),ec(),Ds({all:new Ue(-1/0,[[]])}))})),j.rejectionMapper=function(r,i){return!r||r instanceof ee||r instanceof TypeError||r instanceof SyntaxError||!r.name||!hi[r.name]?r:(i=new hi[r.name](i||r.message,r),"stack"in r&&oe(i,"stack",{get:function(){return this.inner.stack}}),i)},$n(st),o(qt,Object.freeze({__proto__:null,Dexie:qt,liveQuery:Zu,Entity:Iu,cmp:ue,PropModSymbol:Bt,PropModification:mr,replacePrefix:function(r,i){return new mr({replacePrefix:[r,i]})},add:function(r){return new mr({add:r})},remove:function(r){return new mr({remove:r})},default:qt,RangeSet:Ue,mergeRanges:Er,rangesOverlap:Vu}),{default:qt}),qt})}(Rr)),Rr.exports}var Jc=Xc(),ao=Ae(Jc);const xa=Symbol.for("Dexie"),uo=globalThis[xa]||(globalThis[xa]=ao);if(ao.semVer!==uo.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${ao.semVer} and ${uo.semVer}`);class Zc extends uo{constructor(e){super("pages_"+e),this.version(2).stores({pages:"id, name, content, document, css, js, document.name, document.headline, document.creator"})}}/**
27
- * @vue/shared v3.5.13
28
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
29
- * @license MIT
30
- **//*! #__NO_SIDE_EFFECTS__ */function el(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const lt=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const on=()=>{},tl=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),rt=Object.assign,nl=Object.prototype.hasOwnProperty,Te=(t,e)=>nl.call(t,e),_e=Array.isArray,Sn=t=>Mr(t)==="[object Map]",rl=t=>Mr(t)==="[object Set]",Be=t=>typeof t=="function",gt=t=>typeof t=="string",Qn=t=>typeof t=="symbol",tt=t=>t!==null&&typeof t=="object",il=t=>(tt(t)||Be(t))&&Be(t.then)&&Be(t.catch),ol=Object.prototype.toString,Mr=t=>ol.call(t),Ea=t=>Mr(t).slice(8,-1),sl=t=>Mr(t)==="[object Object]",co=t=>gt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,al=(t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))})(t=>t.charAt(0).toUpperCase()+t.slice(1)),sn=(t,e)=>!Object.is(t,e),ul=(t,e,n,o=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:o,value:n})};let Sa;const Nr=()=>Sa||(Sa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function lo(t){if(_e(t)){const e={};for(let n=0;n<t.length;n++){const o=t[n],s=gt(o)?dl(o):lo(o);if(s)for(const c in s)e[c]=s[c]}return e}else if(gt(t)||tt(t))return t}const cl=/;(?![^(]*\))/g,ll=/:([^]+)/,fl=/\/\*[^]*?\*\//g;function dl(t){const e={};return t.replace(fl,"").split(cl).forEach(n=>{if(n){const o=n.split(ll);o.length>1&&(e[o[0].trim()]=o[1].trim())}}),e}function fo(t){let e="";if(gt(t))e=t;else if(_e(t))for(let n=0;n<t.length;n++){const o=fo(t[n]);o&&(e+=o+" ")}else if(tt(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}/**
31
- * @vue/reactivity v3.5.13
32
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
33
- * @license MIT
34
- **/function Ht(t,...e){console.warn(`[Vue warn] ${t}`,...e)}let he;const ho=new WeakSet;class hl{constructor(e){this.fn=e,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,ho.has(this)&&(ho.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||pl(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Da(this),Aa(this);const e=he,n=yt;he=this,yt=!0;try{return this.fn()}finally{process.env.NODE_ENV!=="production"&&he!==this&&Ht("Active effect was not restored correctly - this is likely a Vue internal bug."),Ca(this),he=e,yt=n,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)mo(e);this.deps=this.depsTail=void 0,Da(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ho.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){yo(this)&&this.run()}get dirty(){return yo(this)}}let Oa=0,Xn,Jn;function pl(t,e=!1){if(t.flags|=8,e){t.next=Jn,Jn=t;return}t.next=Xn,Xn=t}function po(){Oa++}function go(){if(--Oa>0)return;if(Jn){let e=Jn;for(Jn=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;Xn;){let e=Xn;for(Xn=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(o){t||(t=o)}e=n}}if(t)throw t}function Aa(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Ca(t){let e,n=t.depsTail,o=n;for(;o;){const s=o.prevDep;o.version===-1?(o===n&&(n=s),mo(o),yl(o)):e=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=s}t.deps=e,t.depsTail=n}function yo(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(gl(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function gl(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===$r))return;t.globalVersion=$r;const e=t.dep;if(t.flags|=2,e.version>0&&!t.isSSR&&t.deps&&!yo(t)){t.flags&=-3;return}const n=he,o=yt;he=t,yt=!0;try{Aa(t);const s=t.fn(t._value);(e.version===0||sn(s,t._value))&&(t._value=s,e.version++)}catch(s){throw e.version++,s}finally{he=n,yt=o,Ca(t),t.flags&=-3}}function mo(t,e=!1){const{dep:n,prevSub:o,nextSub:s}=t;if(o&&(o.nextSub=s,t.prevSub=void 0),s&&(s.prevSub=o,t.nextSub=void 0),process.env.NODE_ENV!=="production"&&n.subsHead===t&&(n.subsHead=s),n.subs===t&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let c=n.computed.deps;c;c=c.nextDep)mo(c,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function yl(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let yt=!0;const Pa=[];function kr(){Pa.push(yt),yt=!1}function jr(){const t=Pa.pop();yt=t===void 0?!0:t}function Da(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=he;he=void 0;try{e()}finally{he=n}}}let $r=0;class ml{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class vl{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,process.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(e){if(!he||!yt||he===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==he)n=this.activeLink=new ml(he,this),he.deps?(n.prevDep=he.depsTail,he.depsTail.nextDep=n,he.depsTail=n):he.deps=he.depsTail=n,Ia(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=he.depsTail,n.nextDep=void 0,he.depsTail.nextDep=n,he.depsTail=n,he.deps===n&&(he.deps=o)}return process.env.NODE_ENV!=="production"&&he.onTrack&&he.onTrack(rt({effect:he},e)),n}trigger(e){this.version++,$r++,this.notify(e)}notify(e){po();try{if(process.env.NODE_ENV!=="production")for(let n=this.subsHead;n;n=n.nextSub)n.sub.onTrigger&&!(n.sub.flags&8)&&n.sub.onTrigger(rt({effect:n.sub},e));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{go()}}}function Ia(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let o=e.deps;o;o=o.nextDep)Ia(o)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),process.env.NODE_ENV!=="production"&&t.dep.subsHead===void 0&&(t.dep.subsHead=t),t.dep.subs=t}}const vo=new WeakMap,an=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),bo=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),Zn=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function ke(t,e,n){if(yt&&he){let o=vo.get(t);o||vo.set(t,o=new Map);let s=o.get(n);s||(o.set(n,s=new vl),s.map=o,s.key=n),process.env.NODE_ENV!=="production"?s.track({target:t,type:e,key:n}):s.track()}}function zt(t,e,n,o,s,c){const f=vo.get(t);if(!f){$r++;return}const p=m=>{m&&(process.env.NODE_ENV!=="production"?m.trigger({target:t,type:e,key:n,newValue:o,oldValue:s,oldTarget:c}):m.trigger())};if(po(),e==="clear")f.forEach(p);else{const m=_e(t),T=m&&co(n);if(m&&n==="length"){const $=Number(o);f.forEach((S,F)=>{(F==="length"||F===Zn||!Qn(F)&&F>=$)&&p(S)})}else switch((n!==void 0||f.has(void 0))&&p(f.get(n)),T&&p(f.get(Zn)),e){case"add":m?T&&p(f.get("length")):(p(f.get(an)),Sn(t)&&p(f.get(bo)));break;case"delete":m||(p(f.get(an)),Sn(t)&&p(f.get(bo)));break;case"set":Sn(t)&&p(f.get(an));break}}go()}function On(t){const e=ce(t);return e===t?e:(ke(e,"iterate",Zn),it(t)?e:e.map(ot))}function wo(t){return ke(t=ce(t),"iterate",Zn),t}const bl={__proto__:null,[Symbol.iterator](){return _o(this,Symbol.iterator,ot)},concat(...t){return On(this).concat(...t.map(e=>_e(e)?On(e):e))},entries(){return _o(this,"entries",t=>(t[1]=ot(t[1]),t))},every(t,e){return Dt(this,"every",t,e,void 0,arguments)},filter(t,e){return Dt(this,"filter",t,e,n=>n.map(ot),arguments)},find(t,e){return Dt(this,"find",t,e,ot,arguments)},findIndex(t,e){return Dt(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return Dt(this,"findLast",t,e,ot,arguments)},findLastIndex(t,e){return Dt(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return Dt(this,"forEach",t,e,void 0,arguments)},includes(...t){return xo(this,"includes",t)},indexOf(...t){return xo(this,"indexOf",t)},join(t){return On(this).join(t)},lastIndexOf(...t){return xo(this,"lastIndexOf",t)},map(t,e){return Dt(this,"map",t,e,void 0,arguments)},pop(){return er(this,"pop")},push(...t){return er(this,"push",t)},reduce(t,...e){return Ta(this,"reduce",t,e)},reduceRight(t,...e){return Ta(this,"reduceRight",t,e)},shift(){return er(this,"shift")},some(t,e){return Dt(this,"some",t,e,void 0,arguments)},splice(...t){return er(this,"splice",t)},toReversed(){return On(this).toReversed()},toSorted(t){return On(this).toSorted(t)},toSpliced(...t){return On(this).toSpliced(...t)},unshift(...t){return er(this,"unshift",t)},values(){return _o(this,"values",ot)}};function _o(t,e,n){const o=wo(t),s=o[e]();return o!==t&&!it(t)&&(s._next=s.next,s.next=()=>{const c=s._next();return c.value&&(c.value=n(c.value)),c}),s}const wl=Array.prototype;function Dt(t,e,n,o,s,c){const f=wo(t),p=f!==t&&!it(t),m=f[e];if(m!==wl[e]){const S=m.apply(t,c);return p?ot(S):S}let T=n;f!==t&&(p?T=function(S,F){return n.call(this,ot(S),F,t)}:n.length>2&&(T=function(S,F){return n.call(this,S,F,t)}));const $=m.call(f,T,o);return p&&s?s($):$}function Ta(t,e,n,o){const s=wo(t);let c=n;return s!==t&&(it(t)?n.length>3&&(c=function(f,p,m){return n.call(this,f,p,m,t)}):c=function(f,p,m){return n.call(this,f,ot(p),m,t)}),s[e](c,...o)}function xo(t,e,n){const o=ce(t);ke(o,"iterate",Zn);const s=o[e](...n);return(s===-1||s===!1)&&Br(n[0])?(n[0]=ce(n[0]),o[e](...n)):s}function er(t,e,n=[]){kr(),po();const o=ce(t)[e].apply(t,n);return go(),jr(),o}const _l=el("__proto__,__v_isRef,__isVue"),Ra=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Qn));function xl(t){Qn(t)||(t=String(t));const e=ce(this);return ke(e,"has",t),e.hasOwnProperty(t)}class Ma{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,o){if(n==="__v_skip")return e.__v_skip;const s=this._isReadonly,c=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return c;if(n==="__v_raw")return o===(s?c?Fa:$a:c?Rl:ja).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(o)?e:void 0;const f=_e(e);if(!s){let m;if(f&&(m=bl[n]))return m;if(n==="hasOwnProperty")return xl}const p=Reflect.get(e,n,nt(e)?e:o);return(Qn(n)?Ra.has(n):_l(n))||(s||ke(e,"get",n),c)?p:nt(p)?f&&co(n)?p:p.value:tt(p)?s?Ka(p):La(p):p}}class El extends Ma{constructor(e=!1){super(!1,e)}set(e,n,o,s){let c=e[n];if(!this._isShallow){const m=Gt(c);if(!it(o)&&!Gt(o)&&(c=ce(c),o=ce(o)),!_e(e)&&nt(c)&&!nt(o))return m?!1:(c.value=o,!0)}const f=_e(e)&&co(n)?Number(n)<e.length:Te(e,n),p=Reflect.set(e,n,o,nt(e)?e:s);return e===ce(s)&&(f?sn(o,c)&&zt(e,"set",n,o,c):zt(e,"add",n,o)),p}deleteProperty(e,n){const o=Te(e,n),s=e[n],c=Reflect.deleteProperty(e,n);return c&&o&&zt(e,"delete",n,void 0,s),c}has(e,n){const o=Reflect.has(e,n);return(!Qn(n)||!Ra.has(n))&&ke(e,"has",n),o}ownKeys(e){return ke(e,"iterate",_e(e)?"length":an),Reflect.ownKeys(e)}}class Na extends Ma{constructor(e=!1){super(!0,e)}set(e,n){return process.env.NODE_ENV!=="production"&&Ht(`Set operation on key "${String(n)}" failed: target is readonly.`,e),!0}deleteProperty(e,n){return process.env.NODE_ENV!=="production"&&Ht(`Delete operation on key "${String(n)}" failed: target is readonly.`,e),!0}}const Sl=new El,Ol=new Na,Al=new Na(!0),Eo=t=>t,Fr=t=>Reflect.getPrototypeOf(t);function Cl(t,e,n){return function(...o){const s=this.__v_raw,c=ce(s),f=Sn(c),p=t==="entries"||t===Symbol.iterator&&f,m=t==="keys"&&f,T=s[t](...o),$=n?Eo:e?Ao:ot;return!e&&ke(c,"iterate",m?bo:an),{next(){const{value:S,done:F}=T.next();return F?{value:S,done:F}:{value:p?[$(S[0]),$(S[1])]:$(S),done:F}},[Symbol.iterator](){return this}}}}function Lr(t){return function(...e){if(process.env.NODE_ENV!=="production"){const n=e[0]?`on key "${e[0]}" `:"";Ht(`${al(t)} operation ${n}failed: target is readonly.`,ce(this))}return t==="delete"?!1:t==="clear"?void 0:this}}function Pl(t,e){const n={get(s){const c=this.__v_raw,f=ce(c),p=ce(s);t||(sn(s,p)&&ke(f,"get",s),ke(f,"get",p));const{has:m}=Fr(f),T=e?Eo:t?Ao:ot;if(m.call(f,s))return T(c.get(s));if(m.call(f,p))return T(c.get(p));c!==f&&c.get(s)},get size(){const s=this.__v_raw;return!t&&ke(ce(s),"iterate",an),Reflect.get(s,"size",s)},has(s){const c=this.__v_raw,f=ce(c),p=ce(s);return t||(sn(s,p)&&ke(f,"has",s),ke(f,"has",p)),s===p?c.has(s):c.has(s)||c.has(p)},forEach(s,c){const f=this,p=f.__v_raw,m=ce(p),T=e?Eo:t?Ao:ot;return!t&&ke(m,"iterate",an),p.forEach(($,S)=>s.call(c,T($),T(S),f))}};return rt(n,t?{add:Lr("add"),set:Lr("set"),delete:Lr("delete"),clear:Lr("clear")}:{add(s){!e&&!it(s)&&!Gt(s)&&(s=ce(s));const c=ce(this);return Fr(c).has.call(c,s)||(c.add(s),zt(c,"add",s,s)),this},set(s,c){!e&&!it(c)&&!Gt(c)&&(c=ce(c));const f=ce(this),{has:p,get:m}=Fr(f);let T=p.call(f,s);T?process.env.NODE_ENV!=="production"&&ka(f,p,s):(s=ce(s),T=p.call(f,s));const $=m.call(f,s);return f.set(s,c),T?sn(c,$)&&zt(f,"set",s,c,$):zt(f,"add",s,c),this},delete(s){const c=ce(this),{has:f,get:p}=Fr(c);let m=f.call(c,s);m?process.env.NODE_ENV!=="production"&&ka(c,f,s):(s=ce(s),m=f.call(c,s));const T=p?p.call(c,s):void 0,$=c.delete(s);return m&&zt(c,"delete",s,void 0,T),$},clear(){const s=ce(this),c=s.size!==0,f=process.env.NODE_ENV!=="production"?Sn(s)?new Map(s):new Set(s):void 0,p=s.clear();return c&&zt(s,"clear",void 0,void 0,f),p}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=Cl(s,t,e)}),n}function So(t,e){const n=Pl(t,e);return(o,s,c)=>s==="__v_isReactive"?!t:s==="__v_isReadonly"?t:s==="__v_raw"?o:Reflect.get(Te(n,s)&&s in o?n:o,s,c)}const Dl={get:So(!1,!1)},Il={get:So(!0,!1)},Tl={get:So(!0,!0)};function ka(t,e,n){const o=ce(n);if(o!==n&&e.call(t,o)){const s=Ea(t);Ht(`Reactive ${s} contains both the raw and reactive versions of the same object${s==="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 ja=new WeakMap,Rl=new WeakMap,$a=new WeakMap,Fa=new WeakMap;function Ml(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Nl(t){return t.__v_skip||!Object.isExtensible(t)?0:Ml(Ea(t))}function La(t){return Gt(t)?t:Oo(t,!1,Sl,Dl,ja)}function Ka(t){return Oo(t,!0,Ol,Il,$a)}function Kr(t){return Oo(t,!0,Al,Tl,Fa)}function Oo(t,e,n,o,s){if(!tt(t))return process.env.NODE_ENV!=="production"&&Ht(`value cannot be made ${e?"readonly":"reactive"}: ${String(t)}`),t;if(t.__v_raw&&!(e&&t.__v_isReactive))return t;const c=s.get(t);if(c)return c;const f=Nl(t);if(f===0)return t;const p=new Proxy(t,f===2?o:n);return s.set(t,p),p}function An(t){return Gt(t)?An(t.__v_raw):!!(t&&t.__v_isReactive)}function Gt(t){return!!(t&&t.__v_isReadonly)}function it(t){return!!(t&&t.__v_isShallow)}function Br(t){return t?!!t.__v_raw:!1}function ce(t){const e=t&&t.__v_raw;return e?ce(e):t}function kl(t){return!Te(t,"__v_skip")&&Object.isExtensible(t)&&ul(t,"__v_skip",!0),t}const ot=t=>tt(t)?La(t):t,Ao=t=>tt(t)?Ka(t):t;function nt(t){return t?t.__v_isRef===!0:!1}function jl(t){return nt(t)?t.value:t}const $l={get:(t,e,n)=>e==="__v_raw"?t:jl(Reflect.get(t,e,n)),set:(t,e,n,o)=>{const s=t[e];return nt(s)&&!nt(n)?(s.value=n,!0):Reflect.set(t,e,n,o)}};function Fl(t){return An(t)?t:new Proxy(t,$l)}const qr={},Vr=new WeakMap;let un;function Ll(t,e=!1,n=un){if(n){let o=Vr.get(n);o||Vr.set(n,o=[]),o.push(t)}else process.env.NODE_ENV!=="production"&&!e&&Ht("onWatcherCleanup() was called when there was no active watcher to associate with.")}function Kl(t,e,n=lt){const{immediate:o,deep:s,once:c,scheduler:f,augmentJob:p,call:m}=n,T=re=>{(n.onWarn||Ht)("Invalid watch source: ",re,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},$=re=>s?re:it(re)||s===!1||s===0?Yt(re,1):Yt(re);let S,F,H,oe,fe=!1,Ve=!1;if(nt(t)?(F=()=>t.value,fe=it(t)):An(t)?(F=()=>$(t),fe=!0):_e(t)?(Ve=!0,fe=t.some(re=>An(re)||it(re)),F=()=>t.map(re=>{if(nt(re))return re.value;if(An(re))return $(re);if(Be(re))return m?m(re,2):re();process.env.NODE_ENV!=="production"&&T(re)})):Be(t)?e?F=m?()=>m(t,2):t:F=()=>{if(H){kr();try{H()}finally{jr()}}const re=un;un=S;try{return m?m(t,3,[oe]):t(oe)}finally{un=re}}:(F=on,process.env.NODE_ENV!=="production"&&T(t)),e&&s){const re=F,Ye=s===!0?1/0:s;F=()=>Yt(re(),Ye)}const We=()=>{S.stop()};if(c&&e){const re=e;e=(...Ye)=>{re(...Ye),We()}}let je=Ve?new Array(t.length).fill(qr):qr;const dt=re=>{if(!(!(S.flags&1)||!S.dirty&&!re))if(e){const Ye=S.run();if(s||fe||(Ve?Ye.some((Qe,Re)=>sn(Qe,je[Re])):sn(Ye,je))){H&&H();const Qe=un;un=S;try{const Re=[Ye,je===qr?void 0:Ve&&je[0]===qr?[]:je,oe];m?m(e,3,Re):e(...Re),je=Ye}finally{un=Qe}}}else S.run()};return p&&p(dt),S=new hl(F),S.scheduler=f?()=>f(dt,!1):dt,oe=re=>Ll(re,!1,S),H=S.onStop=()=>{const re=Vr.get(S);if(re){if(m)m(re,4);else for(const Ye of re)Ye();Vr.delete(S)}},process.env.NODE_ENV!=="production"&&(S.onTrack=n.onTrack,S.onTrigger=n.onTrigger),e?o?dt(!0):je=S.run():f?f(dt.bind(null,!0),!0):S.run(),We.pause=S.pause.bind(S),We.resume=S.resume.bind(S),We.stop=We,We}function Yt(t,e=1/0,n){if(e<=0||!tt(t)||t.__v_skip||(n=n||new Set,n.has(t)))return t;if(n.add(t),e--,nt(t))Yt(t.value,e,n);else if(_e(t))for(let o=0;o<t.length;o++)Yt(t[o],e,n);else if(rl(t)||Sn(t))t.forEach(o=>{Yt(o,e,n)});else if(sl(t)){for(const o in t)Yt(t[o],e,n);for(const o of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,o)&&Yt(t[o],e,n)}return t}/**
35
- * @vue/runtime-core v3.5.13
36
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
37
- * @license MIT
38
- **/const cn=[];function Bl(t){cn.push(t)}function ql(){cn.pop()}let Co=!1;function Ce(t,...e){if(Co)return;Co=!0,kr();const n=cn.length?cn[cn.length-1].component:null,o=n&&n.appContext.config.warnHandler,s=Vl();if(o)Wr(o,n,11,[t+e.map(c=>{var f,p;return(p=(f=c.toString)==null?void 0:f.call(c))!=null?p:JSON.stringify(c)}).join(""),n&&n.proxy,s.map(({vnode:c})=>`at <${uu(n,c.type)}>`).join(`
39
- `),s]);else{const c=[`[Vue warn]: ${t}`,...e];s.length&&c.push(`
40
- `,...Wl(s)),console.warn(...c)}jr(),Co=!1}function Vl(){let t=cn[cn.length-1];if(!t)return[];const e=[];for(;t;){const n=e[0];n&&n.vnode===t?n.recurseCount++:e.push({vnode:t,recurseCount:0});const o=t.component&&t.component.parent;t=o&&o.vnode}return e}function Wl(t){const e=[];return t.forEach((n,o)=>{e.push(...o===0?[]:[`
41
- `],...Ul(n))}),e}function Ul({vnode:t,recurseCount:e}){const n=e>0?`... (${e} recursive calls)`:"",o=t.component?t.component.parent==null:!1,s=` at <${uu(t.component,t.type,o)}`,c=">"+n;return t.props?[s,...Hl(t.props),c]:[s+c]}function Hl(t){const e=[],n=Object.keys(t);return n.slice(0,3).forEach(o=>{e.push(...Ba(o,t[o]))}),n.length>3&&e.push(" ..."),e}function Ba(t,e,n){return gt(e)?(e=JSON.stringify(e),n?e:[`${t}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?n?e:[`${t}=${e}`]:nt(e)?(e=Ba(t,ce(e.value),!0),n?e:[`${t}=Ref<`,e,">"]):Be(e)?[`${t}=fn${e.name?`<${e.name}>`:""}`]:(e=ce(e),n?e:[`${t}=`,e])}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 Wr(t,e,n,o){try{return o?t(...o):t()}catch(s){Po(s,e,n)}}function Va(t,e,n,o){if(Be(t)){const s=Wr(t,e,n,o);return s&&il(s)&&s.catch(c=>{Po(c,e,n)}),s}if(_e(t)){const s=[];for(let c=0;c<t.length;c++)s.push(Va(t[c],e,n,o));return s}else process.env.NODE_ENV!=="production"&&Ce(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof t}`)}function Po(t,e,n,o=!0){const s=e?e.vnode:null,{errorHandler:c,throwUnhandledErrorInProduction:f}=e&&e.appContext.config||lt;if(e){let p=e.parent;const m=e.proxy,T=process.env.NODE_ENV!=="production"?qa[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;p;){const $=p.ec;if($){for(let S=0;S<$.length;S++)if($[S](t,m,T)===!1)return}p=p.parent}if(c){kr(),Wr(c,null,10,[t,m,T]),jr();return}}zl(t,n,s,o,f)}function zl(t,e,n,o=!0,s=!1){if(process.env.NODE_ENV!=="production"){const c=qa[e];if(n&&Bl(n),Ce(`Unhandled error${c?` during execution of ${c}`:""}`),n&&ql(),o)throw t;console.error(t)}else{if(s)throw t;console.error(t)}}const ft=[];let It=-1;const Cn=[];let Qt=null,Pn=0;const Wa=Promise.resolve();let Ur=null;const Gl=100;function Yl(t){const e=Ur||Wa;return t?e.then(this?t.bind(this):t):e}function Ql(t){let e=It+1,n=ft.length;for(;e<n;){const o=e+n>>>1,s=ft[o],c=tr(s);c<t||c===t&&s.flags&2?e=o+1:n=o}return e}function Do(t){if(!(t.flags&1)){const e=tr(t),n=ft[ft.length-1];!n||!(t.flags&2)&&e>=tr(n)?ft.push(t):ft.splice(Ql(e),0,t),t.flags|=1,Ua()}}function Ua(){Ur||(Ur=Wa.then(za))}function Ha(t){_e(t)?Cn.push(...t):Qt&&t.id===-1?Qt.splice(Pn+1,0,t):t.flags&1||(Cn.push(t),t.flags|=1),Ua()}function Xl(t){if(Cn.length){const e=[...new Set(Cn)].sort((n,o)=>tr(n)-tr(o));if(Cn.length=0,Qt){Qt.push(...e);return}for(Qt=e,process.env.NODE_ENV!=="production"&&(t=t||new Map),Pn=0;Pn<Qt.length;Pn++){const n=Qt[Pn];process.env.NODE_ENV!=="production"&&Ga(t,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}Qt=null,Pn=0}}const tr=t=>t.id==null?t.flags&2?-1:1/0:t.id;function za(t){process.env.NODE_ENV!=="production"&&(t=t||new Map);const e=process.env.NODE_ENV!=="production"?n=>Ga(t,n):on;try{for(It=0;It<ft.length;It++){const n=ft[It];if(n&&!(n.flags&8)){if(process.env.NODE_ENV!=="production"&&e(n))continue;n.flags&4&&(n.flags&=-2),Wr(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;It<ft.length;It++){const n=ft[It];n&&(n.flags&=-2)}It=-1,ft.length=0,Xl(t),Ur=null,(ft.length||Cn.length)&&za(t)}}function Ga(t,e){const n=t.get(e)||0;if(n>Gl){const o=e.i,s=o&&au(o.type);return Po(`Maximum recursive updates exceeded${s?` in component <${s}>`:""}. 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 t.set(e,n+1),!1}const Io=new Map;process.env.NODE_ENV!=="production"&&(Nr().__VUE_HMR_RUNTIME__={createRecord:To(Jl),rerender:To(Zl),reload:To(ef)});const Hr=new Map;function Jl(t,e){return Hr.has(t)?!1:(Hr.set(t,{initialDef:zr(e),instances:new Set}),!0)}function zr(t){return cu(t)?t.__vccOpts:t}function Zl(t,e){const n=Hr.get(t);n&&(n.initialDef.render=e,[...n.instances].forEach(o=>{e&&(o.render=e,zr(o.type).render=e),o.renderCache=[],o.update()}))}function ef(t,e){const n=Hr.get(t);if(!n)return;e=zr(e),Ya(n.initialDef,e);const o=[...n.instances];for(let s=0;s<o.length;s++){const c=o[s],f=zr(c.type);let p=Io.get(f);p||(f!==n.initialDef&&Ya(f,e),Io.set(f,p=new Set)),p.add(c),c.appContext.propsCache.delete(c.type),c.appContext.emitsCache.delete(c.type),c.appContext.optionsCache.delete(c.type),c.ceReload?(p.add(c),c.ceReload(e.styles),p.delete(c)):c.parent?Do(()=>{c.parent.update(),p.delete(c)}):c.appContext.reload?c.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),c.root.ce&&c!==c.root&&c.root.ce._removeChildStyle(f)}Ha(()=>{Io.clear()})}function Ya(t,e){rt(t,e);for(const n in t)n!=="__file"&&!(n in e)&&delete t[n]}function To(t){return(e,n)=>{try{return t(e,n)}catch(o){console.error(o),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let Dn,Gr=[];function Qa(t,e){var n,o;Dn=t,Dn?(Dn.enabled=!0,Gr.forEach(({event:s,args:c})=>Dn.emit(s,...c)),Gr=[]):typeof window<"u"&&window.HTMLElement&&!((o=(n=window.navigator)==null?void 0:n.userAgent)!=null&&o.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(c=>{Qa(c,e)}),setTimeout(()=>{Dn||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Gr=[])},3e3)):Gr=[]}let Tt=null,tf=null;const nf=t=>t.__isTeleport;function Xa(t,e){t.shapeFlag&6&&t.component?(t.transition=e,Xa(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}Nr().requestIdleCallback,Nr().cancelIdleCallback;const rf=Symbol.for("v-ndc"),Ro=t=>t?Mf(t)?Nf(t):Ro(t.parent):null,nr=rt(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>process.env.NODE_ENV!=="production"?Kr(t.props):t.props,$attrs:t=>process.env.NODE_ENV!=="production"?Kr(t.attrs):t.attrs,$slots:t=>process.env.NODE_ENV!=="production"?Kr(t.slots):t.slots,$refs:t=>process.env.NODE_ENV!=="production"?Kr(t.refs):t.refs,$parent:t=>Ro(t.parent),$root:t=>Ro(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>__VUE_OPTIONS_API__?uf(t):t.type,$forceUpdate:t=>t.f||(t.f=()=>{Do(t.update)}),$nextTick:t=>t.n||(t.n=Yl.bind(t.proxy)),$watch:t=>__VUE_OPTIONS_API__?bf.bind(t):on}),of=t=>t==="_"||t==="$",Mo=(t,e)=>t!==lt&&!t.__isScriptSetup&&Te(t,e),sf={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:o,data:s,props:c,accessCache:f,type:p,appContext:m}=t;if(process.env.NODE_ENV!=="production"&&e==="__isVue")return!0;let T;if(e[0]!=="$"){const H=f[e];if(H!==void 0)switch(H){case 1:return o[e];case 2:return s[e];case 4:return n[e];case 3:return c[e]}else{if(Mo(o,e))return f[e]=1,o[e];if(s!==lt&&Te(s,e))return f[e]=2,s[e];if((T=t.propsOptions[0])&&Te(T,e))return f[e]=3,c[e];if(n!==lt&&Te(n,e))return f[e]=4,n[e];(!__VUE_OPTIONS_API__||af)&&(f[e]=0)}}const $=nr[e];let S,F;if($)return e==="$attrs"?(ke(t.attrs,"get",""),process.env.NODE_ENV!=="production"&&void 0):process.env.NODE_ENV!=="production"&&e==="$slots"&&ke(t,"get",e),$(t);if((S=p.__cssModules)&&(S=S[e]))return S;if(n!==lt&&Te(n,e))return f[e]=4,n[e];if(F=m.config.globalProperties,Te(F,e))return F[e];process.env.NODE_ENV!=="production"&&Tt&&(!gt(e)||e.indexOf("__v")!==0)&&(s!==lt&&of(e[0])&&Te(s,e)?Ce(`Property ${JSON.stringify(e)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`):t===Tt&&Ce(`Property ${JSON.stringify(e)} was accessed during render but is not defined on instance.`))},set({_:t},e,n){const{data:o,setupState:s,ctx:c}=t;return Mo(s,e)?(s[e]=n,!0):process.env.NODE_ENV!=="production"&&s.__isScriptSetup&&Te(s,e)?(Ce(`Cannot mutate <script setup> binding "${e}" from Options API.`),!1):o!==lt&&Te(o,e)?(o[e]=n,!0):Te(t.props,e)?(process.env.NODE_ENV!=="production"&&Ce(`Attempting to mutate prop "${e}". Props are readonly.`),!1):e[0]==="$"&&e.slice(1)in t?(process.env.NODE_ENV!=="production"&&Ce(`Attempting to mutate public property "${e}". Properties starting with $ are reserved and readonly.`),!1):(process.env.NODE_ENV!=="production"&&e in t.appContext.config.globalProperties?Object.defineProperty(c,e,{enumerable:!0,configurable:!0,value:n}):c[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:o,appContext:s,propsOptions:c}},f){let p;return!!n[f]||t!==lt&&Te(t,f)||Mo(e,f)||(p=c[0])&&Te(p,f)||Te(o,f)||Te(nr,f)||Te(s.config.globalProperties,f)},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:Te(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};process.env.NODE_ENV!=="production"&&(sf.ownKeys=t=>(Ce("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(t)));function Ja(t){return _e(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}let af=!0;function uf(t){const e=t.type,{mixins:n,extends:o}=e,{mixins:s,optionsCache:c,config:{optionMergeStrategies:f}}=t.appContext,p=c.get(e);let m;return p?m=p:!s.length&&!n&&!o?m=e:(m={},s.length&&s.forEach(T=>Yr(m,T,f,!0)),Yr(m,e,f)),tt(e)&&c.set(e,m),m}function Yr(t,e,n,o=!1){const{mixins:s,extends:c}=e;c&&Yr(t,c,n,!0),s&&s.forEach(f=>Yr(t,f,n,!0));for(const f in e)if(o&&f==="expose")process.env.NODE_ENV!=="production"&&Ce('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const p=cf[f]||n&&n[f];t[f]=p?p(t[f],e[f]):e[f]}return t}const cf={data:Za,props:tu,emits:tu,methods:rr,computed:rr,beforeCreate:Ge,created:Ge,beforeMount:Ge,mounted:Ge,beforeUpdate:Ge,updated:Ge,beforeDestroy:Ge,beforeUnmount:Ge,destroyed:Ge,unmounted:Ge,activated:Ge,deactivated:Ge,errorCaptured:Ge,serverPrefetch:Ge,components:rr,directives:rr,watch:ff,provide:Za,inject:lf};function Za(t,e){return e?t?function(){return rt(Be(t)?t.call(this,this):t,Be(e)?e.call(this,this):e)}:e:t}function lf(t,e){return rr(eu(t),eu(e))}function eu(t){if(_e(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function Ge(t,e){return t?[...new Set([].concat(t,e))]:e}function rr(t,e){return t?rt(Object.create(null),t,e):e}function tu(t,e){return t?_e(t)&&_e(e)?[...new Set([...t,...e])]:rt(Object.create(null),Ja(t),Ja(e??{})):e}function ff(t,e){if(!t)return e;if(!e)return t;const n=rt(Object.create(null),t);for(const o in e)n[o]=Ge(t[o],e[o]);return n}let df=null;function hf(t,e,n=!1){const o=Jr||Tt;if(o||df){const s=o?o.parent==null?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:void 0;if(s&&t in s)return s[t];if(arguments.length>1)return n&&Be(e)?e.call(o&&o.proxy):e;process.env.NODE_ENV!=="production"&&Ce(`injection "${String(t)}" not found.`)}else process.env.NODE_ENV!=="production"&&Ce("inject() can only be used inside setup() or functional components.")}const pf={},nu=t=>Object.getPrototypeOf(t)===pf,gf=xf,yf=Symbol.for("v-scx"),mf=()=>{{const t=hf(yf);return t||process.env.NODE_ENV!=="production"&&Ce("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),t}};function vf(t,e,n=lt){const{immediate:o,deep:s,flush:c,once:f}=n;process.env.NODE_ENV!=="production"&&!e&&(o!==void 0&&Ce('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),s!==void 0&&Ce('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),f!==void 0&&Ce('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const p=rt({},n);process.env.NODE_ENV!=="production"&&(p.onWarn=Ce);const m=e&&o||!e&&c!=="post";let T;if(jo){if(c==="sync"){const H=mf();T=H.__watcherHandles||(H.__watcherHandles=[])}else if(!m){const H=()=>{};return H.stop=on,H.resume=on,H.pause=on,H}}const $=Jr;p.call=(H,oe,fe)=>Va(H,$,oe,fe);let S=!1;c==="post"?p.scheduler=H=>{gf(H,$&&$.suspense)}:c!=="sync"&&(S=!0,p.scheduler=(H,oe)=>{oe?H():Do(H)}),p.augmentJob=H=>{e&&(H.flags|=4),S&&(H.flags|=2,$&&(H.id=$.uid,H.i=$))};const F=Kl(t,e,p);return jo&&(T?T.push(F):m&&F()),F}function bf(t,e,n){const o=this.proxy,s=gt(t)?t.includes(".")?wf(o,t):()=>o[t]:t.bind(o,o);let c;Be(e)?c=e:(c=e.handler,n=e);const f=Rf(this),p=vf(s,c.bind(o),n);return f(),p}function wf(t,e){const n=e.split(".");return()=>{let o=t;for(let s=0;s<n.length&&o;s++)o=o[n[s]];return o}}function Rh(){}const _f=t=>t.__isSuspense;function xf(t,e){e&&e.pendingBranch?_e(t)?e.effects.push(...t):e.effects.push(t):Ha(t)}const ru=Symbol.for("v-fgt"),Ef=Symbol.for("v-txt"),Sf=Symbol.for("v-cmt");let In=null;function Of(t){return t?t.__v_isVNode===!0:!1}const Af=(...t)=>ou(...t),iu=({key:t})=>t??null,Qr=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?gt(t)||nt(t)||Be(t)?{i:Tt,r:t,k:e,f:!!n}:t:null);function Cf(t,e=null,n=null,o=0,s=null,c=t===ru?0:1,f=!1,p=!1){const m={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&iu(e),ref:e&&Qr(e),scopeId:tf,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:c,patchFlag:o,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Tt};return p?(No(m,n),c&128&&t.normalize(m)):n&&(m.shapeFlag|=gt(n)?8:16),process.env.NODE_ENV!=="production"&&m.key!==m.key&&Ce("VNode created with invalid key (NaN). VNode type:",m.type),!f&&In&&(m.patchFlag>0||c&6)&&m.patchFlag!==32&&In.push(m),m}const Pf=process.env.NODE_ENV!=="production"?Af:ou;function ou(t,e=null,n=null,o=0,s=null,c=!1){if((!t||t===rf)&&(process.env.NODE_ENV!=="production"&&!t&&Ce(`Invalid vnode type when creating vnode: ${t}.`),t=Sf),Of(t)){const p=Xr(t,e,!0);return n&&No(p,n),!c&&In&&(p.shapeFlag&6?In[In.indexOf(t)]=p:In.push(p)),p.patchFlag=-2,p}if(cu(t)&&(t=t.__vccOpts),e){e=Df(e);let{class:p,style:m}=e;p&&!gt(p)&&(e.class=fo(p)),tt(m)&&(Br(m)&&!_e(m)&&(m=rt({},m)),e.style=lo(m))}const f=gt(t)?1:_f(t)?128:nf(t)?64:tt(t)?4:Be(t)?2:0;return process.env.NODE_ENV!=="production"&&f&4&&Br(t)&&(t=ce(t),Ce("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`.",`
42
- Component that was made reactive: `,t)),Cf(t,e,n,o,s,f,c,!0)}function Df(t){return t?Br(t)||nu(t)?rt({},t):t:null}function Xr(t,e,n=!1,o=!1){const{props:s,ref:c,patchFlag:f,children:p,transition:m}=t,T=e?Tf(s||{},e):s,$={__v_isVNode:!0,__v_skip:!0,type:t.type,props:T,key:T&&iu(T),ref:e&&e.ref?n&&c?_e(c)?c.concat(Qr(e)):[c,Qr(e)]:Qr(e):c,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:process.env.NODE_ENV!=="production"&&f===-1&&_e(p)?p.map(su):p,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==ru?f===-1?16:f|16:f,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:m,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Xr(t.ssContent),ssFallback:t.ssFallback&&Xr(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return m&&o&&Xa($,m.clone($)),$}function su(t){const e=Xr(t);return _e(t.children)&&(e.children=t.children.map(su)),e}function If(t=" ",e=0){return Pf(Ef,null,t,e)}function No(t,e){let n=0;const{shapeFlag:o}=t;if(e==null)e=null;else if(_e(e))n=16;else if(typeof e=="object")if(o&65){const s=e.default;s&&(s._c&&(s._d=!1),No(t,s()),s._c&&(s._d=!0));return}else{n=32;const s=e._;!s&&!nu(e)?e._ctx=Tt:s===3&&Tt&&(Tt.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else Be(e)?(e={default:e,_ctx:Tt},n=32):(e=String(e),o&64?(n=16,e=[If(e)]):n=8);t.children=e,t.shapeFlag|=n}function Tf(...t){const e={};for(let n=0;n<t.length;n++){const o=t[n];for(const s in o)if(s==="class")e.class!==o.class&&(e.class=fo([e.class,o.class]));else if(s==="style")e.style=lo([e.style,o.style]);else if(tl(s)){const c=e[s],f=o[s];f&&c!==f&&!(_e(c)&&c.includes(f))&&(e[s]=c?[].concat(c,f):f)}else s!==""&&(e[s]=o[s])}return e}let Jr=null,ko;{const t=Nr(),e=(n,o)=>{let s;return(s=t[n])||(s=t[n]=[]),s.push(o),c=>{s.length>1?s.forEach(f=>f(c)):s[0](c)}};ko=e("__VUE_INSTANCE_SETTERS__",n=>Jr=n),e("__VUE_SSR_SETTERS__",n=>jo=n)}const Rf=t=>{const e=Jr;return ko(t),t.scope.on(),()=>{t.scope.off(),ko(e)}};function Mf(t){return t.vnode.shapeFlag&4}let jo=!1;process.env.NODE_ENV;function Nf(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(Fl(kl(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in nr)return nr[n](t)},has(e,n){return n in e||n in nr}})):t.proxy}const kf=/(?:^|[-_])(\w)/g,jf=t=>t.replace(kf,e=>e.toUpperCase()).replace(/[-_]/g,"");function au(t,e=!0){return Be(t)?t.displayName||t.name:t.name||e&&t.__name}function uu(t,e,n=!1){let o=au(e);if(!o&&e.__file){const s=e.__file.match(/([^/\\]+)\.\w+$/);s&&(o=s[1])}if(!o&&t&&t.parent){const s=c=>{for(const f in c)if(c[f]===e)return f};o=s(t.components||t.parent.type.components)||s(t.appContext.components)}return o?jf(o):n?"App":"Anonymous"}function cu(t){return Be(t)&&"__vccOpts"in t}function $f(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const t={style:"color:#3ba776"},e={style:"color:#1677ff"},n={style:"color:#f5222d"},o={style:"color:#eb2f96"},s={__vue_custom_formatter:!0,header(S){return tt(S)?S.__isVue?["div",t,"VueInstance"]:nt(S)?["div",{},["span",t,$(S)],"<",p("_value"in S?S._value:S),">"]:An(S)?["div",{},["span",t,it(S)?"ShallowReactive":"Reactive"],"<",p(S),`>${Gt(S)?" (readonly)":""}`]:Gt(S)?["div",{},["span",t,it(S)?"ShallowReadonly":"Readonly"],"<",p(S),">"]:null:null},hasBody(S){return S&&S.__isVue},body(S){if(S&&S.__isVue)return["div",{},...c(S.$)]}};function c(S){const F=[];S.type.props&&S.props&&F.push(f("props",ce(S.props))),S.setupState!==lt&&F.push(f("setup",S.setupState)),S.data!==lt&&F.push(f("data",ce(S.data)));const H=m(S,"computed");H&&F.push(f("computed",H));const oe=m(S,"inject");return oe&&F.push(f("injected",oe)),F.push(["div",{},["span",{style:o.style+";opacity:0.66"},"$ (internal): "],["object",{object:S}]]),F}function f(S,F){return F=rt({},F),Object.keys(F).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},S],["div",{style:"padding-left:1.25em"},...Object.keys(F).map(H=>["div",{},["span",o,H+": "],p(F[H],!1)])]]:["span",{}]}function p(S,F=!0){return typeof S=="number"?["span",e,S]:typeof S=="string"?["span",n,JSON.stringify(S)]:typeof S=="boolean"?["span",o,S]:tt(S)?["object",{object:F?ce(S):S}]:["span",n,String(S)]}function m(S,F){const H=S.type;if(Be(H))return;const oe={};for(const fe in S.ctx)T(H,fe,F)&&(oe[fe]=S.ctx[fe]);return oe}function T(S,F,H){const oe=S[H];if(_e(oe)&&oe.includes(F)||tt(oe)&&F in oe||S.extends&&T(S.extends,F,H)||S.mixins&&S.mixins.some(fe=>T(fe,F,H)))return!0}function $(S){return it(S)?"ShallowRef":S.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(s):window.devtoolsFormatters=[s]}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;/**
43
- * vue v3.5.13
44
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
45
- * @license MIT
46
- **/function Ff(){$f()}process.env.NODE_ENV!=="production"&&Ff();class $o{constructor(e){this.jsonld=e}getIdentifier(){return this.jsonld.identifier}setIdentifier(e){this.jsonld.identifier=e}getName(){return this.jsonld.name}setName(e){this.jsonld.name=e}getText(){return this.jsonld.text}setText(e){this.jsonld.text=e}get(e){return this.jsonld[e]}set(e,n){this.jsonld[e]=n}getSource(){return this.jsonld}}class Tn{constructor(e="",n="",o="",s=""){this.mode="",this.headline="",this.headlineRaw="",this.canEdit=!0,this.document=new $o({}),this.source=o,this.syntax=s,this.html="",this.name=n,this.id=e,this.css=[],this.js=[],this.version=""}toObject(){return{id:this.id,name:this.name,source:this.source,syntax:this.syntax,html:this.html,document:this.document.getSource(),css:this.css,js:this.js,version:this.version}}fromObject(e){this.id=e.id,this.name=e.name,this.source=e.source,this.syntax=e.syntax,this.html=e.html,this.document=new $o(e.document),this.css=e.css,this.js=e.js,this.version=e.version}}var Lf=Object.defineProperty,Kf=Object.getOwnPropertyDescriptor,Bf=(t,e,n,o)=>{for(var s=o>1?void 0:o?Kf(e,n):e,c=t.length-1,f;c>=0;c--)(f=t[c])&&(s=(o?f(e,n,s):f(s))||s);return o&&s&&Lf(e,n,s),s},lu=(t,e)=>(n,o)=>e(n,o,t);let Zr=class{constructor(t){this.loggerConfig=t}setModule(t){this.module=t}debug(...t){(!this.loggerConfig||this.loggerConfig.hasLevelId(this.module,4))&&t.unshift(this.module+":"),console.debug.apply(null,t)}info(...t){t.unshift(this.module+":"),console.info.apply(null,t)}warn(...t){t.unshift(this.module+":"),console.warn.apply(null,t)}error(...t){t.unshift(this.module+":"),console.error.apply(null,t)}};Zr=Bf([Ne(),lu(0,Se("LoggerConfig")),lu(0,$c())],Zr);var qf=Object.defineProperty,Vf=Object.getOwnPropertyDescriptor,Wf=(t,e,n,o)=>{for(var s=o>1?void 0:o?Vf(e,n):e,c=t.length-1,f;c>=0;c--)(f=t[c])&&(s=(o?f(e,n,s):f(s))||s);return o&&s&&qf(e,n,s),s};let Fo=class{constructor(t="error"){this.levels=new Map,this.config=new Map,this.defaultLevel=t,this.computedConfig=new Map,this.levels.set("error",1),this.levels.set("warn",2),this.levels.set("info",3),this.levels.set("debug",4)}addLevel(t,e){const n=this.levels.get(e);n!=null&&this.config.forEach(o=>{if(o.startsWith(t)){const s=this.computedConfig.get(o);(s==null||n&&n>s)&&n&&this.computedConfig.set(o,n)}})}getLevels(){return this.config}getLevel(t){let e=this.config.get(t);return e||(e=this.defaultLevel),e}getLevelId(t){const e=this.levels.get(t);return e||10}setDefaultLevel(t){this.defaultLevel=t,this.defaultLevelId=this.getLevelId(this.defaultLevel)}getDefaultLevel(){return this.defaultLevel}getDefaultLevelId(){return this.defaultLevelId?this.defaultLevelId:(this.defaultLevelId=this.getLevelId(this.defaultLevel),this.defaultLevelId)}hasLevel(t,e){let n=this.computedConfig.get(t);n||(n=this.getDefaultLevelId());const o=this.getLevelId(e);return!!(o&&n>=o)}hasLevelId(t,e){let n=this.computedConfig.get(t);n||(n=this.getDefaultLevelId());const o=e;return!!(o&&n>=o)}};Fo=Wf([Ne()],Fo);var Uf=Object.defineProperty,Hf=Object.getOwnPropertyDescriptor,zf=(t,e,n,o)=>{for(var s=o>1?void 0:o?Hf(e,n):e,c=t.length-1,f;c>=0;c--)(f=t[c])&&(s=(o?f(e,n,s):f(s))||s);return o&&s&&Uf(e,n,s),s},Gf=(t,e)=>(n,o)=>e(n,o,t);let ir=class{constructor(t){this.logger=t,this.logger.setModule("storage.components.defaultWikiStorage"),this.offlineSetup=!1}setConfig(t,e,n,o,s,c,f,p){this.name=t,this.baseURL=e,this.baseRestURL=n,this.realtimeURL=p==null?void 0:p.realtimeURL,this.homePage=o,this.serverRendering=s,this.designSystem=c,this.offline=f}setConfigFromObject(t){this.name=t.name,this.baseURL=t.baseURL,this.baseRestURL=t.baseRestURL,this.realtimeURL=t.realtimeURL,this.homePage=t.homePage,this.serverRendering=t.serverRendering,this.offline=t.offline,this.designSystem=t.designSystem}setupOfflineStorage(){if(this.logger.debug("Checking offline storage"),this.offline&&this.cristal){this.logger.debug("Looking for wrapping offline storage");const t=this.cristal.getContainer().get("WrappingStorage");t?(this.logger.debug("Offline local storage is ready"),t.setStorage(this.storage),t.setWikiConfig(this.storage.getWikiConfig()),this.storage=t):this.logger.debug("Failed Looking for wrapping offline storage")}else this.cristal||this.logger.debug("Cristal not initialized"),this.offline||this.logger.debug("Offline mode not activated")}isSupported(t){return t=="html"}initialize(){this.offline&&!this.offlineSetup&&(this.setupOfflineStorage(),this.offlineSetup=!0,this.storage.isStorageReady())}defaultPageName(){return"index"}getType(){return"Default"}getNewPageDefaultName(){return"newpage"}};ir=zf([Ne(),Gf(0,Se("Logger"))],ir);var Yf=Object.defineProperty,Qf=Object.getOwnPropertyDescriptor,Xf=(t,e,n,o)=>{for(var s=o>1?void 0:o?Qf(e,n):e,c=t.length-1,f;c>=0;c--)(f=t[c])&&(s=(o?f(e,n,s):f(s))||s);return o&&s&&Yf(e,n,s),s},Jf=(t,e)=>(n,o)=>e(n,o,t);let Lo=class{constructor(t){this.pageStorageMap=new Map,this.logger=t,this.logger.setModule("storage.components.dexieOfflineStorage")}getPageStorage(t){let e=this.pageStorageMap.get(t);return e==null&&(e=new Zc(t),this.pageStorageMap.set(t,e)),e}async getPage(t,e){try{this.logger.debug("Ready to load page from local storage",e);const n=this.getPageStorage(t);this.logger.debug("pageStorage is ready, asking for page");const o=await n.pages.get(e),s=new Tn;return s.fromObject(o),s}catch(n){this.logger.debug("Exception while trying to read from local storage",n);return}}async savePage(t,e,n){try{await this.getPageStorage(t).pages.put(n.toObject(),e)}catch(o){this.logger.debug("Exception while trying to store in local storage",t,e,n,o)}}async updatePage(t,e,n){try{const o=this.getPageStorage(t);this.logger.debug("Ready to store",n),await o.pages.update(e,n.toObject())}catch(o){this.logger.debug("Exception while trying to store in local storage",t,e,n,o)}}};Lo=Xf([Ne(),Jf(0,Se("Logger"))],Lo);var Zf=Object.defineProperty,ed=Object.getOwnPropertyDescriptor,td=(t,e,n,o)=>{for(var s=o>1?void 0:o?ed(e,n):e,c=t.length-1,f;c>=0;c--)(f=t[c])&&(s=(o?f(e,n,s):f(s))||s);return o&&s&&Zf(e,n,s),s},Ko=(t,e)=>(n,o)=>e(n,o,t);let Bo=class{constructor(t,e,n){this.logger=t,this.logger.setModule("storage.components.wrappingOfflineStorage"),this.offlineStorage=e,this.queueWorker=n}setStorage(t){this.storage=t}getStorage(){return this.storage}setWikiConfig(t){return this.storage.setWikiConfig(t)}getWikiConfig(){return this.storage.getWikiConfig()}async isStorageReady(){return this.storage.isStorageReady()}getPageRestURL(t,e){return this.storage.getPageRestURL(t,e)}getPageFromViewURL(t){return this.storage.getPageFromViewURL(t)}getImageURL(t,e){return this.storage.getImageURL(t,e)}async getPageContent(t,e,n,o){if(this.logger.debug("Trying to get data for page ",t),this.offlineStorage){this.logger.debug("Asking offline storage for ",t);const s=await this.offlineStorage.getPage(this.getWikiConfig().name,t+"_"+e);return s!=null&&s!=null?(this.logger.debug("Loading data from local storage for page",t),(o==null||o)&&this.queueWorker.addToQueue(this.getWikiConfig().name+":"+t+"_"+e),s):(this.logger.debug("Could not find data in local storage for page",t),this.savePageContent(t,e))}else return this.logger.debug("No offline local storage available"),this.storage.getPageContent(t,e)}getAttachments(t){return this.storage.getAttachments(t)}getAttachment(t,e){return this.storage.getAttachment(t,e)}async savePageContent(t,e){const n=await this.storage.getPageContent(t,e);if(n)return n.id=t+"_"+e,this.logger.debug("Saving page to offline storage",t),this.offlineStorage.savePage(this.getWikiConfig().name,t+"_"+e,n),n;throw new Error("Can't save missing page.")}async updatePageContent(t,e){const n=await this.offlineStorage.getPage(this.getWikiConfig().name,t+"_"+e),o=await this.storage.getPageContent(t,e);return n&&o?(o.id=t+"_"+e,this.logger.debug("Saving page to offline storage",t),this.offlineStorage.savePage(this.getWikiConfig().name,t+"_"+e,o),!0):(n==null?void 0:n.version)!=(o==null?void 0:o.version)&&o?(o.id=t+"_"+e,this.logger.debug("Updating page to offline storage",t),this.offlineStorage.updatePage(this.getWikiConfig().name,t+"_"+e,o),!0):(this.logger.debug("Local storage not updated, because version are identical"),!1)}async getPanelContent(t,e,n){return this.storage.getPanelContent(t,e,n)}async getEditField(t,e){return await this.storage.getEditField(t,e)}save(t,e,n,o){return this.storage.save(t,e,n,o)}async saveAttachments(t,e){return this.storage.saveAttachments(t,e)}async delete(t){return this.storage.delete(t)}};Bo=td([Ne(),Ko(0,Se("Logger")),Ko(1,Se("OfflineStorage")),Ko(2,Se("QueueWorker"))],Bo);let nd=class{constructor(e){e.bind("WrappingStorage").to(Bo).inSingletonScope(),e.bind("OfflineStorage").to(Lo).inSingletonScope()}};var rd=Object.defineProperty,id=Object.getOwnPropertyDescriptor,od=(t,e,n,o)=>{for(var s=o>1?void 0:o?id(e,n):e,c=t.length-1,f;c>=0;c--)(f=t[c])&&(s=(o?f(e,n,s):f(s))||s);return o&&s&&rd(e,n,s),s},ei=(t,e)=>(n,o)=>e(n,o,t);let qo=class extends ir{constructor(t,e,n){super(t),this.storage=e,this.cristal=n,this.storage.setWikiConfig(this),this.homePage==""&&(this.homePage="README.md")}defaultPageName(){return"README"}getType(){return"GitHub"}};qo=od([Ne(),ei(0,Se("Logger")),ei(1,Se("Storage")),ei(1,ro("GitHub")),ei(2,Se("CristalApp"))],qo);var sd=Object.defineProperty,ad=Object.getOwnPropertyDescriptor,ud=(t,e,n,o)=>{for(var s=o>1?void 0:o?ad(e,n):e,c=t.length-1,f;c>=0;c--)(f=t[c])&&(s=(o?f(e,n,s):f(s))||s);return o&&s&&sd(e,n,s),s},cd=(t,e)=>(n,o)=>e(n,o,t);let or=class{constructor(t,e){this.logger=t,this.logger.setModule(e)}setWikiConfig(t){this.logger.debug("Setting wiki Config: ",t),this.wikiConfig=t}getWikiConfig(){return this.wikiConfig}};or=ud([Ne(),cd(0,Fc())],or);var ld=Object.defineProperty,fd=Object.getOwnPropertyDescriptor,dd=(t,e,n,o)=>{for(var s=o>1?void 0:o?fd(e,n):e,c=t.length-1,f;c>=0;c--)(f=t[c])&&(s=(o?f(e,n,s):f(s))||s);return o&&s&&ld(e,n,s),s},hd=(t,e)=>(n,o)=>e(n,o,t);let fu=class{constructor(t){this.cristalApp=t}get(){return this.cristalApp.getWikiConfig().storage}};fu=dd([Ne(),hd(0,Se("CristalApp"))],fu);var pd=Object.defineProperty,gd=Object.getOwnPropertyDescriptor,yd=(t,e,n,o)=>{for(var s=o>1?void 0:o?gd(e,n):e,c=t.length-1,f;c>=0;c--)(f=t[c])&&(s=(o?f(e,n,s):f(s))||s);return o&&s&&pd(e,n,s),s},md=(t,e)=>(n,o)=>e(n,o,t);let Vo=class extends or{constructor(t){super(t,"storage.components.githubStorage"),this.hashCode=function(e){let n=0,o,s;if(e.length===0)return""+n;for(o=0;o<e.length;o++)s=e.charCodeAt(o),n=(n<<5)-n+s,n|=0;return""+n}}async isStorageReady(){return!0}getPageRestURL(t,e,n){var s;(s=this.logger)==null||s.debug("GitHub Loading page",t);let o=this.wikiConfig.baseRestURL;return n&&(o=o.replace(/\/[^/]*\/$/,`/${n}/`)),o+t}getPageFromViewURL(t){let e=null;return t.startsWith(this.wikiConfig.baseURL)&&(e=t.replace(this.wikiConfig.baseURL,"")),e}getImageURL(t,e){const n=t.replace(/[^/]*$/,"");return`${this.wikiConfig.baseRestURL}${n}${e}`}async getPageContent(t,e,n){var m;(m=this.logger)==null||m.debug("GitHub Loading page",t);const o=this.getPageRestURL(t,e,n),c=await(await fetch(o,{cache:"no-store"})).text();let f="";e=="json"?f="":e=="md"||e=="html"?f=c:f="";const p=new Tn;return p.id=t,p.name=t.split("/").pop(),p.source=f,p.syntax="md",p.css=[],p.version=this.hashCode(f),p.canEdit=!1,p}getAttachments(){throw new Error("unsupported")}getAttachment(){throw new Error("unsupported")}async getPanelContent(){return new Tn}async getEditField(){return""}save(){throw new Error("Save not supported")}async saveAttachments(){throw new Error("unsupported")}async delete(){throw new Error("Delete not supported")}};Vo=yd([Ne(),md(0,Se("Logger"))],Vo);let vd=class{constructor(e){e.bind("WikiConfig").to(qo).whenTargetNamed("GitHub"),e.bind("Storage").to(Vo).whenTargetNamed("GitHub")}};var bd=Object.defineProperty,wd=Object.getOwnPropertyDescriptor,_d=(t,e,n,o)=>{for(var s=o>1?void 0:o?wd(e,n):e,c=t.length-1,f;c>=0;c--)(f=t[c])&&(s=(o?f(e,n,s):f(s))||s);return o&&s&&bd(e,n,s),s},ti=(t,e)=>(n,o)=>e(n,o,t);let Wo=class extends ir{constructor(t,e,n){super(t),this.cristal=n,this.storage=e,this.storage.setWikiConfig(this)}isSupported(t){return t=="html"}defaultPageName(){return"home"}getType(){return"Nextcloud"}};Wo=_d([Ne(),ti(0,Se("Logger")),ti(1,Se("Storage")),ti(1,ro("Nextcloud")),ti(2,Se("CristalApp"))],Wo);const Xt="test",xd="test";var Ed=Object.defineProperty,Sd=Object.getOwnPropertyDescriptor,Od=(t,e,n,o)=>{for(var s=o>1?void 0:o?Sd(e,n):e,c=t.length-1,f;c>=0;c--)(f=t[c])&&(s=(o?f(e,n,s):f(s))||s);return o&&s&&Ed(e,n,s),s},Ad=(t,e)=>(n,o)=>e(n,o,t);let Uo=class extends or{constructor(t){super(t,"storage.components.nextcloudStorage"),this.ATTACHMENTS="attachments"}async getEditField(){return""}getImageURL(){return""}async getPageContent(t){const e=this.getWikiConfig().baseRestURL,n=this.getBaseHeaders();try{const o=await fetch(`${e}/${Xt}/.cristal/${t}/page.json`,{method:"GET",headers:n});if(o.status>=200&&o.status<300){const{lastModificationDate:s,lastAuthor:c}=await this.getLastEditDetails(t),f=await o.json();return{...f,id:t,headline:f.name,headlineRaw:f.name,lastAuthor:c,lastModificationDate:s,canEdit:!0}}else return}catch{return}}async getLastEditDetails(t){var s,c;let e,n;const o=await fetch(`${this.getWikiConfig().baseRestURL}/${Xt}/.cristal/${t}/page.json`,{body:`<?xml version="1.0" encoding="UTF-8"?>
47
- <d:propfind xmlns:d="DAV:">
48
- <d:prop xmlns:oc="http://owncloud.org/ns">
49
- <d:getlastmodified />
50
- <oc:owner-display-name />
51
- </d:prop>
52
- </d:propfind>`,method:"PROPFIND",headers:{...this.getBaseHeaders(),Accept:"application/json"}});if(o.status>=200&&o.status<300){const f=new window.DOMParser().parseFromString(await o.text(),"text/xml"),p=(s=f.getElementsByTagName("d:getlastmodified")[0])==null?void 0:s.innerHTML;p&&(e=new Date(Date.parse(p))),n={name:(c=f.getElementsByTagName("oc:owner-display-name")[0])==null?void 0:c.innerHTML}}return{lastModificationDate:e,lastAuthor:n}}async getAttachments(t){const e=await fetch(this.getAttachmentsBasePath(t),{method:"PROPFIND",headers:{...this.getBaseHeaders(),Depth:"1",Accept:"application/json"}});if(e.status>=200&&e.status<300){const n=await e.text(),s=new window.DOMParser().parseFromString(n,"text/xml").getElementsByTagName("d:response"),c=[];for(let f=0;f<s.length;f++){const p=s[f];p.getElementsByTagName("d:getcontenttype").length>0&&c.push(this.parseAttachment(p))}return{attachments:c}}else return}async getAttachment(t,e){const n=await fetch(this.getAttachmentBasePath(e,t),{method:"PROPFIND",headers:{...this.getBaseHeaders(),Depth:"1",Accept:"application/json"}});if(n.status>=200&&n.status<300){const o=await n.text(),c=new window.DOMParser().parseFromString(o,"text/xml").getElementsByTagName("d:response")[0];return this.parseAttachment(c)}else return}getAttachmentsBasePath(t){return`${this.getWikiConfig().baseRestURL}/${Xt}/.cristal/${t}/${this.ATTACHMENTS}`}getAttachmentBasePath(t,e){return`${this.getAttachmentsBasePath(e)}/${t}`}async save(t,e,n){const o=t.split("/"),s=`${this.getWikiConfig().baseRestURL}/${Xt}/.cristal`;await this.createIntermediateDirectories(s,o),await fetch(`${s}/${o.join("/")}/page.json`,{method:"PUT",headers:this.getBaseHeaders(),body:JSON.stringify({source:e,name:n,syntax:"markdown/1.2"})})}async createIntermediateDirectories(t,e){await this.createDirectory(t);for(let n=0;n<e.length;n++)await this.createDirectory(`${t}/${e.slice(0,n+1).join("/")}`)}async saveAttachments(t,e){return Promise.all(e.map(n=>this.saveAttachment(t,n)))}async saveAttachment(t,e){const n=t.split("/"),o=`${this.getWikiConfig().baseRestURL}/${Xt}/.cristal`;await this.createIntermediateDirectories(o,[...n,this.ATTACHMENTS]);const s=this.getAttachmentsBasePath(t)+"/"+e.name;await fetch(s,{method:"PUT",headers:this.getBaseHeaders(),body:e})}getPageFromViewURL(){return null}getPageRestURL(){return""}async getPanelContent(){return new Tn}async delete(t){const e=`${this.getWikiConfig().baseRestURL}/${Xt}/.cristal`;return await fetch(`${e}/${t}`,{method:"DELETE",headers:this.getBaseHeaders()}).then(async o=>o.ok?{success:!0}:{success:!1,error:await o.text()})}async isStorageReady(){return!0}async createDirectory(t){await fetch(t,{method:"MKCOL",headers:this.getBaseHeaders()})}getBaseHeaders(){return{Authorization:`Basic ${btoa(`${Xt}:${xd}`)}`}}parseAttachment(t){const e=t.getElementsByTagName("d:href")[0].textContent,n=t.getElementsByTagName("d:getcontenttype")[0].textContent,o=parseInt(t.getElementsByTagName("d:getcontentlength")[0].textContent),s=Date.parse(t.getElementsByTagName("d:getlastmodified")[0].textContent),c=e.split("/"),f=`${this.getWikiConfig().baseRestURL}/${Xt}/${c.slice(5).join("/")}`,p=c[c.length-1];return{mimetype:n,reference:p,id:e,href:f,size:o,date:new Date(s),author:void 0}}};Uo=Od([Ne(),Ad(0,Se("Logger"))],Uo);let Cd=class{constructor(e){e.bind("WikiConfig").to(Wo).whenTargetNamed("Nextcloud"),e.bind("Storage").to(Uo).whenTargetNamed("Nextcloud")}};var Pd=Object.defineProperty,Dd=Object.getOwnPropertyDescriptor,Id=(t,e,n,o)=>{for(var s=o>1?void 0:o?Dd(e,n):e,c=t.length-1,f;c>=0;c--)(f=t[c])&&(s=(o?f(e,n,s):f(s))||s);return o&&s&&Pd(e,n,s),s},ni=(t,e)=>(n,o)=>e(n,o,t);let Ho=class extends ir{constructor(t,e,n){super(t),this.cristal=n,this.storage=e,this.storage.setWikiConfig(this),this.homePage==""&&(this.homePage="Main.WebHome")}isSupported(t){return t=="html"||t=="jsonld"}defaultPageName(){return"Main.WebHome"}getType(){return"XWiki"}getNewPageDefaultName(){return"NewPage"}};Ho=Id([Ne(),ni(0,Se("Logger")),ni(1,Se("Storage")),ni(1,ro("XWiki")),ni(2,Se("CristalApp"))],Ho);function Td(t,e){const n=e.split(":"),o=n.length>1?n[0]:"xwiki",s=n.length>1?n[1]:n[0];return`${t.baseURL}/rest/wikis/${o}/spaces/${encodeURIComponent(s).replace(/((?:%5C%5C)*)%5C\./g,"$1%2E").replace(/%5C%5C/g,"%5C").replace(/\.(?=.*\.)/g,"/spaces/").replace(/\./,"/pages/")}`}var Rd=Object.defineProperty,Md=Object.getOwnPropertyDescriptor,Nd=(t,e,n,o)=>{for(var s=o>1?void 0:o?Md(e,n):e,c=t.length-1,f;c>=0;c--)(f=t[c])&&(s=(o?f(e,n,s):f(s))||s);return o&&s&&Rd(e,n,s),s},zo=(t,e)=>(n,o)=>e(n,o,t);let Go=class extends or{constructor(t,e,n){super(t,"storage.components.xwikiStorage"),this.authenticationManagerProvider=e,this.alertsServiceProvider=n}async isStorageReady(){return!0}getPageRestURL(t,e,n){var c;(c=this.logger)==null||c.debug("XWiki Loading page",t);const o=new URL(this.wikiConfig.baseURL+this.wikiConfig.baseRestURL),s=new URLSearchParams([["page",t],["format",e]]);return n&&s.append("revision",n),o.search=s.toString(),o.toString()}getPageFromViewURL(t){let e;return t.startsWith(this.wikiConfig.baseURL)?(e=t.replace(this.wikiConfig.baseURL,"").replace("/bin","").replace("/view/","").replaceAll("%5C","%5C%5C").replaceAll(".","%5C.").replaceAll("/","."),e.endsWith(".")&&(e+="WebHome"),e=decodeURIComponent(e)):e=null,e}getImageURL(t,e){var o;t==""&&(t="Main.WebHome");const n=this.wikiConfig.baseURL+"/bin/download/"+t.replace(".","/")+"/"+e;return(o=this.logger)==null||o.debug("final image url ",n),n}async getPageContent(t,e,n){var $,S,F,H,oe,fe;($=this.logger)==null||$.debug("XWiki Loading page",t),t==""&&(t="Main.WebHome");const o=this.getPageRestURL(t,e,n);(S=this.logger)==null||S.debug("XWiki Loading url",o);const s=await fetch(o,{cache:"no-store",headers:{...await this.getCredentials()}});let c;try{if(c=await s.json(),!s.ok){this.alertsServiceProvider.get().error(`Could not load page ${t}. Reason: ${c.error}`);return}}catch{return}let f="",p="",m={};e=="jsonld"?(m=c,this.wikiConfig.serverRendering?((F=this.logger)==null||F.debug("Using server side rendering for jsonld"),f=c.source,p=c.html):((H=this.logger)==null||H.debug("Using client side rendering for jsonld"),f=c.source,p="")):e=="html"?this.wikiConfig.serverRendering?((oe=this.logger)==null||oe.debug("Using server side rendering for html"),f=c.source,p=""):((fe=this.logger)==null||fe.debug("Using client side rendering for html"),f=c.source,p=""):(f="",p="");const T=new Tn;return T.source=f,T.syntax="xwiki",T.html=p,T.document=new $o(m),T.css=c.css,T.js=c.js,T.version=T.document.get("version"),T.headlineRaw=c.headlineRaw,T.headline=c.headline,T.name=c.name,T.lastModificationDate=new Date(Date.parse(c.dateModified)),T.lastAuthor={name:c.editor},T.canEdit=c.canEdit,T}async getAttachments(t){return{attachments:(await(await fetch(this.buildAttachmentsURL(t),{headers:{Accept:"application/json",...await this.getCredentials()}})).json()).attachments.map(({id:s,name:c,mimeType:f,xwikiAbsoluteUrl:p,size:m,date:T,author:$})=>({id:s,reference:c,mimetype:f,href:p,size:m,date:T,author:$}))}}async getAttachment(t,e){const n=await this.getAttachments(t);if(n)return n.attachments.filter(o=>o.reference==e)[0]}async getPanelContent(t,e){var f;const n=this.wikiConfig.baseURL+"/rest/cristal/panel?media=json&page="+e+"&panel="+t;(f=this.logger)==null||f.debug("XWiki Loading url",n);const s=await(await fetch(n,{cache:"no-store"})).json(),c=new Tn;return c.source=s.source,c.syntax="xwiki",c.html=s.content,c.css=s.css,c.js=s.js,c}async getEditField(t,e){var n,o;try{const s=t.get("xwikiMapping")[e];let c=s.type,f=s.fieldName;c==null&&(c="document"),f==null&&(f=e);const p=this.wikiConfig.baseURL+"/bin/get/"+t.getIdentifier().replaceAll(".","/")+"?xpage=display&mode=edit&type="+c+"&property="+t.get("className")+"."+f;return(n=this.logger)==null||n.debug("XWiki Loading Field url",p),await(await fetch(p,{cache:"no-store"})).text()}catch(s){return(o=this.logger)==null||o.error("Exception looking for edit field for field",e,s),""}}async save(t,e,n){const o=this.buildSavePageURL(t,["rest","wikis","xwiki"]),s=await fetch(o,{method:"PUT",headers:{"Content-Type":"application/json",...await this.getCredentials()},body:JSON.stringify({content:e,title:n,syntax:"markdown/1.2"})});if(!s.ok){const c=await s.text();throw this.alertsServiceProvider.get().error(`Could not save page ${t}. Reason: ${c}`),new Error(c)}}async saveAttachments(t,e){return Promise.all(e.map(n=>this.saveAttachment(t,n)))}async saveAttachment(t,e){const n=await fetch(`${this.buildAttachmentsURL(t)}/${e.name}`,{method:"PUT",body:e,headers:{...await this.getCredentials(),"Content-Type":e.type}});if(!n.ok)throw new Error(`Failed to upload the attachment. Reason: [${n.statusText}]`)}async delete(t){const e=this.buildSavePageURL(t,["rest","wikis","xwiki"]);return await fetch(e,{method:"DELETE",headers:{"Content-Type":"application/json",...await this.getCredentials()}}).then(async o=>o.ok?{success:!0}:{success:!1,error:await o.text()})}async getCredentials(){var n;const t=await((n=this.authenticationManagerProvider.get())==null?void 0:n.getAuthorizationHeader()),e={};return t&&(e.Authorization=t),e}buildSavePageURL(t,e){const n=this.wikiConfig.baseURL,o=t.split(".");for(let s=0;s<o.length;s++){const c=s<o.length-1?"spaces":"pages";e.push(c),e.push(o[s])}return`${n}/${e.join("/")}`}buildAttachmentsURL(t){return`${Td(this.wikiConfig,t)}/attachments`}};Go=Nd([Ne(),zo(0,Se("Logger")),zo(1,Se("AuthenticationManagerProvider")),zo(2,Se("AlertsServiceProvider"))],Go);let kd=class{constructor(e){e.bind("WikiConfig").to(Ho).whenTargetNamed("XWiki"),e.bind("Storage").to(Go).whenTargetNamed("XWiki")}};var jd=Object.defineProperty,$d=Object.getOwnPropertyDescriptor,Fd=(t,e,n,o)=>{for(var s=o>1?void 0:o?$d(e,n):e,c=t.length-1,f;c>=0;c--)(f=t[c])&&(s=(o?f(e,n,s):f(s))||s);return o&&s&&jd(e,n,s),s};let Yo=class{constructor(){this.name="component.name",this.hint="default",this.priority=1e3,this.singleton=!1}getName(){return this.name}getHint(){return this.hint}getPriority(){return this.priority}isSingleton(){return this.singleton}};Yo=Fd([Ne()],Yo);class Ld{constructor(e,n,o){this.name=e,this.entryFile=n,this.staticModule=o}}var Kd=Object.defineProperty,Bd=Object.getOwnPropertyDescriptor,qd=(t,e,n,o)=>{for(var s=o>1?void 0:o?Bd(e,n):e,c=t.length-1,f;c>=0;c--)(f=t[c])&&(s=(o?f(e,n,s):f(s))||s);return o&&s&&Kd(e,n,s),s},Vd=(t,e)=>(n,o)=>e(n,o,t);let Qo=class extends Yo{constructor(t){super(),this.remoteExtensions=new Map,this.remoteExtensionDefaultURL="/apps/",this.remoteExtensionDefaultEntryFile="main.bundle.js",this.logger=t,this.logger.setModule("extensionmanager.components.defaultExtensionManager")}addRemoteExtension(t,e,n){this.remoteExtensions.set(t,new Ld(t,e,n))}setRemoteExtensionsConfig(t,e){this.remoteExtensionDefaultURL=t,this.remoteExtensionDefaultEntryFile=e}async loadExtension(t,e){var n,o,s,c,f;try{const p=this.remoteExtensions.get(t),m=p&&p.entryFile?p.entryFile:this.remoteExtensionDefaultEntryFile,T=this.remoteExtensionDefaultURL+t+"/"+m,$=this.remoteExtensionDefaultURL+t+"/style.css";(n=this.logger)==null||n.debug("Ready to import ",T);try{const F=await import($);document.adoptedStyleSheets=[F.default]}catch{}const S=await import(T);if(S!=null){(o=this.logger)==null||o.debug("Found components Init for ",t,S);const F=S.ComponentInit;new F(e),(s=this.logger)==null||s.debug("Succesfull components Init for ",t)}else(c=this.logger)==null||c.debug("No components to load for ",t);return}catch(p){(f=this.logger)==null||f.error("Exception while loading components from ",t,p)}}async loadExtensions(t){for(const e of this.remoteExtensions.keys())await this.loadExtension(e,t)}};Qo=qd([Ne(),Vd(0,Se("Logger"))],Qo);class Wd{constructor(e){var n,o;this.logger=e.get("Logger"),this.logger.setModule("extensionmanager.components.componentsInit"),(n=this.logger)==null||n.debug("Init Extension Manager components begin"),e.bind("ExtensionManager").to(Qo),(o=this.logger)==null||o.debug("Init Extension Manager components end")}}class Ud{constructor(e){this.extensionList=e}getLogger(e){let n=this.container.get("Logger");return n||(n=new Zr),n.setModule(e),n}async loadExtensionManager(e){var s,c,f,p,m,T;const n="extension-manager",o="/apps/"+n+"/main.bundle.dev.js";try{if(e)(s=this.logger)==null||s.debug("Loading static extension Manager"),new Wd(this.container);else{(c=this.logger)==null||c.debug("Dynamic extension Manager. Ready to import ",o);const $=await import(o);if($!=null){(f=this.logger)==null||f.debug("Found components Init for ",n,$);const S=$.ComponentInit;new S(this.container),(p=this.logger)==null||p.debug("Succesfull components Init for ",n)}else(m=this.logger)==null||m.debug("No components to load for ",n)}}catch($){(T=this.logger)==null||T.error("Exception while loading extension Manager from ",o,$)}}async loadExtensions(e,n){var s,c,f,p;(s=this.logger)==null||s.debug("Start app"),await this.loadExtensionManager(e);const o=this.container.get("ExtensionManager");if((c=this.logger)==null||c.debug("Extension Manager is ",o),o!=null){if(!n){o.setRemoteExtensionsConfig("/apps/","main.bundle.dev.js");for(const m in this.extensionList)o.addRemoteExtension(m,"",!0);await o.loadExtensions(this.container)}(f=this.logger)==null||f.debug("After extensions loading")}else(p=this.logger)==null||p.debug("Could not start extension Manager");return o}initializeContainer(){var n;this.container=new Tr,this.container.bind("LoggerConfig").to(Fo).inSingletonScope(),this.container.bind("Logger").to(Zr);const e=this.container.get("LoggerConfig");e&&e.setDefaultLevel("debug"),this.logger=this.getLogger("index.ts"),(n=this.logger)==null||n.info("Logging initialized")}getConfigFromPathName(e){let n="";if(e.startsWith("/")){const o=e.indexOf("/",1);o!=-1&&(n=e.substring(1,o))}return(n==null||n=="")&&(n="XWiki"),n}}/**
53
- * @license
54
- * Copyright 2019 Google LLC
55
- * SPDX-License-Identifier: Apache-2.0
56
- */const du=Symbol("Comlink.proxy"),Hd=Symbol("Comlink.endpoint"),zd=Symbol("Comlink.releaseProxy"),Xo=Symbol("Comlink.finalizer"),ri=Symbol("Comlink.thrown"),hu=t=>typeof t=="object"&&t!==null||typeof t=="function",Gd={canHandle:t=>hu(t)&&t[du],serialize(t){const{port1:e,port2:n}=new MessageChannel;return Jo(t,e),[n,[n]]},deserialize(t){return t.start(),Jd(t)}},Yd={canHandle:t=>hu(t)&&ri in t,serialize({value:t}){let e;return t instanceof Error?e={isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:e={isError:!1,value:t},[e,[]]},deserialize(t){throw t.isError?Object.assign(new Error(t.value.message),t.value):t.value}},pu=new Map([["proxy",Gd],["throw",Yd]]);function Qd(t,e){for(const n of t)if(e===n||n==="*"||n instanceof RegExp&&n.test(e))return!0;return!1}function Jo(t,e=globalThis,n=["*"]){e.addEventListener("message",function o(s){if(!s||!s.data)return;if(!Qd(n,s.origin)){console.warn(`Invalid origin '${s.origin}' for comlink proxy`);return}const{id:c,type:f,path:p}=Object.assign({path:[]},s.data),m=(s.data.argumentList||[]).map(ln);let T;try{const $=p.slice(0,-1).reduce((F,H)=>F[H],t),S=p.reduce((F,H)=>F[H],t);switch(f){case"GET":T=S;break;case"SET":$[p.slice(-1)[0]]=ln(s.data.value),T=!0;break;case"APPLY":T=S.apply($,m);break;case"CONSTRUCT":{const F=new S(...m);T=rh(F)}break;case"ENDPOINT":{const{port1:F,port2:H}=new MessageChannel;Jo(t,H),T=nh(F,[F])}break;case"RELEASE":T=void 0;break;default:return}}catch($){T={value:$,[ri]:0}}Promise.resolve(T).catch($=>({value:$,[ri]:0})).then($=>{const[S,F]=ai($);e.postMessage(Object.assign(Object.assign({},S),{id:c}),F),f==="RELEASE"&&(e.removeEventListener("message",o),gu(e),Xo in t&&typeof t[Xo]=="function"&&t[Xo]())}).catch($=>{const[S,F]=ai({value:new TypeError("Unserializable return value"),[ri]:0});e.postMessage(Object.assign(Object.assign({},S),{id:c}),F)})}),e.start&&e.start()}function Xd(t){return t.constructor.name==="MessagePort"}function gu(t){Xd(t)&&t.close()}function Jd(t,e){const n=new Map;return t.addEventListener("message",function(s){const{data:c}=s;if(!c||!c.id)return;const f=n.get(c.id);if(f)try{f(c)}finally{n.delete(c.id)}}),Zo(t,n,[],e)}function ii(t){if(t)throw new Error("Proxy has been released and is not useable")}function yu(t){return Rn(t,new Map,{type:"RELEASE"}).then(()=>{gu(t)})}const oi=new WeakMap,si="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(oi.get(t)||0)-1;oi.set(t,e),e===0&&yu(t)});function Zd(t,e){const n=(oi.get(e)||0)+1;oi.set(e,n),si&&si.register(t,e,t)}function eh(t){si&&si.unregister(t)}function Zo(t,e,n=[],o=function(){}){let s=!1;const c=new Proxy(o,{get(f,p){if(ii(s),p===zd)return()=>{eh(c),yu(t),e.clear(),s=!0};if(p==="then"){if(n.length===0)return{then:()=>c};const m=Rn(t,e,{type:"GET",path:n.map(T=>T.toString())}).then(ln);return m.then.bind(m)}return Zo(t,e,[...n,p])},set(f,p,m){ii(s);const[T,$]=ai(m);return Rn(t,e,{type:"SET",path:[...n,p].map(S=>S.toString()),value:T},$).then(ln)},apply(f,p,m){ii(s);const T=n[n.length-1];if(T===Hd)return Rn(t,e,{type:"ENDPOINT"}).then(ln);if(T==="bind")return Zo(t,e,n.slice(0,-1));const[$,S]=mu(m);return Rn(t,e,{type:"APPLY",path:n.map(F=>F.toString()),argumentList:$},S).then(ln)},construct(f,p){ii(s);const[m,T]=mu(p);return Rn(t,e,{type:"CONSTRUCT",path:n.map($=>$.toString()),argumentList:m},T).then(ln)}});return Zd(c,t),c}function th(t){return Array.prototype.concat.apply([],t)}function mu(t){const e=t.map(ai);return[e.map(n=>n[0]),th(e.map(n=>n[1]))]}const vu=new WeakMap;function nh(t,e){return vu.set(t,e),t}function rh(t){return Object.assign(t,{[du]:!0})}function ai(t){for(const[e,n]of pu)if(n.canHandle(t)){const[o,s]=n.serialize(t);return[{type:"HANDLER",name:e,value:o},s]}return[{type:"RAW",value:t},vu.get(t)||[]]}function ln(t){switch(t.type){case"HANDLER":return pu.get(t.name).deserialize(t.value);case"RAW":return t.value}}function Rn(t,e,n,o){return new Promise(s=>{const c=ih();e.set(c,s),t.start&&t.start(),t.postMessage(Object.assign({id:c},n),o)})}function ih(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}class oh{constructor(){this.currentNumber=0,this.queue=[],this.initialized=!1}async start(){for(console.log("Starting worker thread"),await this.initialize();;)await this.sleep(1e3),await this.checkQueue()}setPageLoadedCallback(e){this.fct=e}sleep(e){return new Promise(n=>setTimeout(n,e))}async checkQueue(){if(this.getQueueSize()>0)if(this.initialized){const n=this.queue.pop();n&&await this.handleQueueItem(n),await this.checkQueue()}else console.log("Worker cristal code not initialized yet. Cannot process queue items.")}async handleQueueItem(e){console.log("Handling queue item code ready to process",e);try{let n=null,o=null,s=null;const c=e.indexOf(":"),f=e.lastIndexOf("_");if(c!=-1&&f!=-1){n=e.substring(0,c),o=e.substring(c+1,f),s=e.substring(f+1);const p=this.getWikiConfig(n);p==null?console.log("Could not find config for page",e):(console.log("Updating page ",o,s),await p.storage.updatePageContent(o,s)&&(console.log("Page updated. Calling back to main thread"),this.fct(e)))}else console.log("Could not process page",e)}catch(n){console.log("Exception while trying to load",e,n)}}add(e){return console.log("Worker in add"),this.currentNumber+=e,this.currentNumber}addToQueue(e){console.log("Worker in addToQueue",e),this.queue.includes(e)||this.queue.push(e)}getQueueSize(){return console.log("Worker in getQueueSize"),this.queue.length}getWikiConfig(e){const n=this.configMap.get(e);if(n==null){console.error("Failed to find wikiConfig for configName",e);return}const s=new Map(Object.entries(n)).get("configType");console.log("Looking for wikiConfig for name",e,"and type",s);let c;try{return c=this.container.getNamed("WikiConfig",s),this.cristal.setWikiConfig(c),c.setConfigFromObject(n),c.initialize(),console.debug("Found wikiConfig for",e,"and type",s,":",c),c}catch(f){console.error("Failed to find wikiConfig for name",e,"and type",s,f);return}}async initialize(){console.log("Starting initialize");const e=["storage"],o=await(await fetch("/config.json")).json();this.configMap=new Map(Object.entries(o)),console.log("Loaded json config",this.configMap);const s=new Ud(e);s.initializeContainer(),this.container=s.container,console.log("Container status",this.container),this.container.bind("CristalApp").to(io).inSingletonScope(),this.container.bind("QueueWorker").to(oo).inSingletonScope(),this.cristal=this.container.get("CristalApp"),this.cristal.setContainer(this.container),console.log("Container status",this.container),new nd(s.container),new vd(s.container),new Cd(s.container),new kd(s.container),new Yc(s.container),console.log("Loading storage components"),this.initialized=!0,console.log("Finished initialize")}}const bu=new oh;bu.start(),onconnect=t=>{Jo(bu,t.ports[0])},console.log("Worker code loaded")})();
57
- //# sourceMappingURL=worker-89Qy0euM.js.map