@xwiki/cristal-sharedworker-impl 0.8.0 → 0.9.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.
- package/CHANGELOG.md +17 -0
- package/dist/assets/worker-CSpj1p6r.js +47 -0
- package/dist/assets/worker-CSpj1p6r.js.map +1 -0
- package/dist/index.es.js +4 -28
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -24
- package/dist/index.umd.js.map +1 -1
- package/package.json +13 -12
- package/src/components/componentsInit.ts +4 -9
- package/src/components/defaultQueueWorker.ts +6 -11
- package/src/components/worker.ts +18 -15
- package/src/components/workerCristalApp.ts +5 -10
- package/src/components/workerQueueWorker.ts +5 -10
- package/src/index.ts +4 -9
- package/src/vite-env.d.ts +5 -10
- package/src/vue.d.ts +4 -9
- package/vite-env.d.ts +4 -9
- package/vite.config.ts +4 -9
- package/dist/assets/worker-D2exZhnK.js +0 -231
- package/dist/assets/worker-D2exZhnK.js.map +0 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
(function(){"use strict";/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/const Xo=Symbol("Comlink.proxy"),cu=Symbol("Comlink.endpoint"),lu=Symbol("Comlink.releaseProxy"),Si=Symbol("Comlink.finalizer"),ir=Symbol("Comlink.thrown"),Zo=e=>typeof e=="object"&&e!==null||typeof e=="function",fu={canHandle:e=>Zo(e)&&e[Xo],serialize(e){const{port1:t,port2:n}=new MessageChannel;return Oi(e,t),[n,[n]]},deserialize(e){return e.start(),gu(e)}},hu={canHandle:e=>Zo(e)&&ir in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},ea=new Map([["proxy",fu],["throw",hu]]);function du(e,t){for(const n of e)if(t===n||n==="*"||n instanceof RegExp&&n.test(t))return!0;return!1}function Oi(e,t=globalThis,n=["*"]){t.addEventListener("message",function o(a){if(!a||!a.data)return;if(!du(n,a.origin)){console.warn(`Invalid origin '${a.origin}' for comlink proxy`);return}const{id:u,type:f,path:p}=Object.assign({path:[]},a.data),E=(a.data.argumentList||[]).map(Ft);let g;try{const T=p.slice(0,-1).reduce((B,Q)=>B[Q],e),P=p.reduce((B,Q)=>B[Q],e);switch(f){case"GET":g=P;break;case"SET":T[p.slice(-1)[0]]=Ft(a.data.value),g=!0;break;case"APPLY":g=P.apply(T,E);break;case"CONSTRUCT":{const B=new P(...E);g=_u(B)}break;case"ENDPOINT":{const{port1:B,port2:Q}=new MessageChannel;Oi(e,Q),g=bu(B,[B])}break;case"RELEASE":g=void 0;break;default:return}}catch(T){g={value:T,[ir]:0}}Promise.resolve(g).catch(T=>({value:T,[ir]:0})).then(T=>{const[P,B]=ur(T);t.postMessage(Object.assign(Object.assign({},P),{id:u}),B),f==="RELEASE"&&(t.removeEventListener("message",o),ta(t),Si in e&&typeof e[Si]=="function"&&e[Si]())}).catch(T=>{const[P,B]=ur({value:new TypeError("Unserializable return value"),[ir]:0});t.postMessage(Object.assign(Object.assign({},P),{id:u}),B)})}),t.start&&t.start()}function pu(e){return e.constructor.name==="MessagePort"}function ta(e){pu(e)&&e.close()}function gu(e,t){return Ci(e,[],t)}function or(e){if(e)throw new Error("Proxy has been released and is not useable")}function na(e){return an(e,{type:"RELEASE"}).then(()=>{ta(e)})}const ar=new WeakMap,sr="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(ar.get(e)||0)-1;ar.set(e,t),t===0&&na(e)});function vu(e,t){const n=(ar.get(t)||0)+1;ar.set(t,n),sr&&sr.register(e,t,e)}function yu(e){sr&&sr.unregister(e)}function Ci(e,t=[],n=function(){}){let o=!1;const a=new Proxy(n,{get(u,f){if(or(o),f===lu)return()=>{yu(a),na(e),o=!0};if(f==="then"){if(t.length===0)return{then:()=>a};const p=an(e,{type:"GET",path:t.map(E=>E.toString())}).then(Ft);return p.then.bind(p)}return Ci(e,[...t,f])},set(u,f,p){or(o);const[E,g]=ur(p);return an(e,{type:"SET",path:[...t,f].map(T=>T.toString()),value:E},g).then(Ft)},apply(u,f,p){or(o);const E=t[t.length-1];if(E===cu)return an(e,{type:"ENDPOINT"}).then(Ft);if(E==="bind")return Ci(e,t.slice(0,-1));const[g,T]=ra(p);return an(e,{type:"APPLY",path:t.map(P=>P.toString()),argumentList:g},T).then(Ft)},construct(u,f){or(o);const[p,E]=ra(f);return an(e,{type:"CONSTRUCT",path:t.map(g=>g.toString()),argumentList:p},E).then(Ft)}});return vu(a,e),a}function mu(e){return Array.prototype.concat.apply([],e)}function ra(e){const t=e.map(ur);return[t.map(n=>n[0]),mu(t.map(n=>n[1]))]}const ia=new WeakMap;function bu(e,t){return ia.set(e,t),e}function _u(e){return Object.assign(e,{[Xo]:!0})}function ur(e){for(const[t,n]of ea)if(n.canHandle(e)){const[o,a]=n.serialize(e);return[{type:"HANDLER",name:t,value:o},a]}return[{type:"RAW",value:e},ia.get(e)||[]]}function Ft(e){switch(e.type){case"HANDLER":return ea.get(e.name).deserialize(e.value);case"RAW":return e.value}}function an(e,t,n){return new Promise(o=>{const a=wu();e.addEventListener("message",function u(f){!f.data||!f.data.id||f.data.id!==a||(e.removeEventListener("message",u),o(f.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:a},t),n)})}function wu(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var qe="named",oa="name",cr="unmanaged",aa="optional",lr="inject",xn="multi_inject",sa="inversify:tagged",ua="inversify:tagged_props",Ai="inversify:paramtypes",Eu="design:paramtypes",ca="post_construct",xi="pre_destroy";function Su(){return[lr,xn,oa,cr,qe,aa]}var la=Su(),Ee={Request:"Request",Singleton:"Singleton",Transient:"Transient"},pe={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},Pn={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"},Ou=0;function Tn(){return Ou++}var Cu=function(){function e(t,n){this.id=Tn(),this.activated=!1,this.serviceIdentifier=t,this.scope=n,this.type=pe.Invalid,this.constraint=function(o){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.onDeactivation=null,this.dynamicValue=null}return e.prototype.clone=function(){var t=new e(this.serviceIdentifier,this.scope);return t.activated=t.scope===Ee.Singleton?this.activated:!1,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.factory=this.factory,t.provider=this.provider,t.constraint=this.constraint,t.onActivation=this.onActivation,t.onDeactivation=this.onDeactivation,t.cache=this.cache,t},e}(),Au="Cannot apply @injectable decorator multiple times.",fa="Metadata key was used more than once in a parameter:",In="NULL argument",ha="Key Not Found",xu="Ambiguous match found for serviceIdentifier:",Pu="Could not unbind serviceIdentifier:",Tu="No matching bindings found for serviceIdentifier:",da="Missing required @injectable annotation in:",Iu="Missing required @inject or @multiInject annotation in:",Du=function(e){return"@inject called with undefined this could mean that the class "+e+" has a circular dependency problem. You can use a LazyServiceIdentifier to overcome this limitation."},Nu="Circular dependency found:",Ru="Invalid binding type:",Mu="No snapshot available to restore.",ku="Invalid return type in middleware. Middleware must return!",ju="Value provided to function binding must be a function!",Lu=function(e){return"You are attempting to construct '"+e+`' in a synchronous way
|
|
6
|
+
but it has asynchronous dependencies.`},Fu="The toSelf function can only be applied when a constructor is used as service identifier",pa="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",Bu=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return"The number of constructor arguments in the derived class "+(e[0]+" must be >= than the number of constructor arguments of its base class.")},Ku="Invalid Container constructor argument. Container options must be an object.",Vu='Invalid Container option. Default scope must be a string ("singleton" or "transient").',$u="Invalid Container option. Auto bind injectable must be a boolean",Wu="Invalid Container option. Skip base check must be a boolean",Uu="Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)",qu=function(e,t){return"@postConstruct error in class "+e+": "+t},Hu=function(e,t){return"@preDestroy error in class "+e+": "+t},Pi=function(e,t){return"onDeactivation() error in class "+e+": "+t},zu=function(e,t){return"It looks like there is a circular dependency in one of the '"+e+"' bindings. Please investigate bindings with "+("service identifier '"+t+"'.")},Gu="Maximum call stack size exceeded",Yu=function(){function e(){}return e.prototype.getConstructorMetadata=function(t){var n=Reflect.getMetadata(Ai,t),o=Reflect.getMetadata(sa,t);return{compilerGeneratedMetadata:n,userGeneratedMetadata:o||{}}},e.prototype.getPropertiesMetadata=function(t){var n=Reflect.getMetadata(ua,t)||[];return n},e}(),fr={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};function ga(e){return e instanceof RangeError||e.message===Gu}var Qu=function(e,t){try{return e()}catch(n){throw ga(n)&&(n=t()),n}};function Dn(e){if(typeof e=="function"){var t=e;return t.name}else{if(typeof e=="symbol")return e.toString();var t=e;return t}}function va(e,t,n){var o="",a=n(e,t);return a.length!==0&&(o=`
|
|
7
|
+
Registered bindings:`,a.forEach(function(u){var f="Object";u.implementationType!==null&&(f=hr(u.implementationType)),o=o+`
|
|
8
|
+
`+f,u.constraint.metaData&&(o=o+" - "+u.constraint.metaData)})),o}function ya(e,t){return e.parentRequest===null?!1:e.parentRequest.serviceIdentifier===t?!0:ya(e.parentRequest,t)}function Ju(e){function t(o,a){a===void 0&&(a=[]);var u=Dn(o.serviceIdentifier);return a.push(u),o.parentRequest!==null?t(o.parentRequest,a):a}var n=t(e);return n.reverse().join(" --> ")}function ma(e){e.childRequests.forEach(function(t){if(ya(t,t.serviceIdentifier)){var n=Ju(t);throw new Error(Nu+" "+n)}else ma(t)})}function Xu(e,t){if(t.isTagged()||t.isNamed()){var n="",o=t.getNamedTag(),a=t.getCustomTags();return o!==null&&(n+=o.toString()+`
|
|
9
|
+
`),a!==null&&a.forEach(function(u){n+=u.toString()+`
|
|
10
|
+
`})," "+e+`
|
|
11
|
+
`+e+" - "+n}else return" "+e}function hr(e){if(e.name)return e.name;var t=e.toString(),n=t.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+t}function Zu(e){return e.toString().slice(7,-1)}var ba=function(){function e(t){this.id=Tn(),this.container=t}return e.prototype.addPlan=function(t){this.plan=t},e.prototype.setCurrentRequest=function(t){this.currentRequest=t},e}(),dt=function(){function e(t,n){this.key=t,this.value=n}return e.prototype.toString=function(){return this.key===qe?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},e}(),ec=function(){function e(t,n){this.parentContext=t,this.rootRequest=n}return e}(),tc=function(){function e(t){this._cb=t}return e.prototype.unwrap=function(){return this._cb()},e}(),nc=function(){function e(t){this.str=t}return e.prototype.startsWith=function(t){return this.str.indexOf(t)===0},e.prototype.endsWith=function(t){var n="",o=t.split("").reverse().join("");return n=this.str.split("").reverse().join(""),this.startsWith.call({str:n},o)},e.prototype.contains=function(t){return this.str.indexOf(t)!==-1},e.prototype.equals=function(t){return this.str===t},e.prototype.value=function(){return this.str},e}(),dr=function(){function e(t,n,o,a){this.id=Tn(),this.type=t,this.serviceIdentifier=o;var u=typeof n=="symbol"?Zu(n):n;this.name=new nc(u||""),this.identifier=n,this.metadata=new Array;var f=null;typeof a=="string"?f=new dt(qe,a):a instanceof dt&&(f=a),f!==null&&this.metadata.push(f)}return e.prototype.hasTag=function(t){for(var n=0,o=this.metadata;n<o.length;n++){var a=o[n];if(a.key===t)return!0}return!1},e.prototype.isArray=function(){return this.hasTag(xn)},e.prototype.matchesArray=function(t){return this.matchesTag(xn)(t)},e.prototype.isNamed=function(){return this.hasTag(qe)},e.prototype.isTagged=function(){return this.metadata.some(function(t){return la.every(function(n){return t.key!==n})})},e.prototype.isOptional=function(){return this.matchesTag(aa)(!0)},e.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter(function(t){return t.key===qe})[0]:null},e.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter(function(t){return la.every(function(n){return t.key!==n})}):null},e.prototype.matchesNamedTag=function(t){return this.matchesTag(qe)(t)},e.prototype.matchesTag=function(t){var n=this;return function(o){for(var a=0,u=n.metadata;a<u.length;a++){var f=u[a];if(f.key===t&&f.value===o)return!0}return!1}},e}(),pr=function(e,t,n){if(n||arguments.length===2)for(var o=0,a=t.length,u;o<a;o++)(u||!(o in t))&&(u||(u=Array.prototype.slice.call(t,0,o)),u[o]=t[o]);return e.concat(u||Array.prototype.slice.call(t))};function rc(e,t){var n=hr(t);return _a(e,n,t,!1)}function _a(e,t,n,o){var a=e.getConstructorMetadata(n),u=a.compilerGeneratedMetadata;if(u===void 0){var f=da+" "+t+".";throw new Error(f)}var p=a.userGeneratedMetadata,E=Object.keys(p),g=n.length===0&&E.length>0,T=E.length>n.length,P=g||T?E.length:n.length,B=oc(o,t,u,p,P),Q=wa(e,n,t),Z=pr(pr([],B,!0),Q,!0);return Z}function ic(e,t,n,o,a){var u=a[e.toString()]||[],f=Sa(u),p=f.unmanaged!==!0,E=o[e],g=f.inject||f.multiInject;if(E=g||E,E instanceof tc&&(E=E.unwrap()),p){var T=E===Object,P=E===Function,B=E===void 0,Q=T||P||B;if(!t&&Q){var Z=Iu+" argument "+e+" in class "+n+".";throw new Error(Z)}var fe=new dr(Pn.ConstructorArgument,f.targetName,E);return fe.metadata=u,fe}return null}function oc(e,t,n,o,a){for(var u=[],f=0;f<a;f++){var p=f,E=ic(p,e,t,n,o);E!==null&&u.push(E)}return u}function ac(e,t,n,o){var a=e||t;if(a===void 0){var u=da+" for property "+String(n)+" in class "+o+".";throw new Error(u)}return a}function wa(e,t,n){for(var o=e.getPropertiesMetadata(t),a=[],u=Object.getOwnPropertySymbols(o),f=Object.keys(o),p=f.concat(u),E=0,g=p;E<g.length;E++){var T=g[E],P=o[T],B=Sa(P),Q=B.targetName||T,Z=ac(B.inject,B.multiInject,T,n),fe=new dr(Pn.ClassProperty,Q,Z);fe.metadata=P,a.push(fe)}var He=Object.getPrototypeOf(t.prototype).constructor;if(He!==Object){var $e=wa(e,He,n);a=pr(pr([],a,!0),$e,!0)}return a}function Ea(e,t){var n=Object.getPrototypeOf(t.prototype).constructor;if(n!==Object){var o=hr(n),a=_a(e,o,n,!0),u=a.map(function(E){return E.metadata.filter(function(g){return g.key===cr})}),f=[].concat.apply([],u).length,p=a.length-f;return p>0?p:Ea(e,n)}else return 0}function Sa(e){var t={};return e.forEach(function(n){t[n.key.toString()]=n.value}),{inject:t[lr],multiInject:t[xn],targetName:t[oa],unmanaged:t[cr]}}var Ti=function(){function e(t,n,o,a,u){this.id=Tn(),this.serviceIdentifier=t,this.parentContext=n,this.parentRequest=o,this.target=u,this.childRequests=[],this.bindings=Array.isArray(a)?a:[a],this.requestScope=o===null?new Map:null}return e.prototype.addChildRequest=function(t,n,o){var a=new e(t,this.parentContext,this,n,o);return this.childRequests.push(a),a},e}();function gr(e){return e._bindingDictionary}function sc(e,t,n,o,a,u){var f=e?xn:lr,p=new dt(f,n),E=new dr(t,o,n,p);if(a!==void 0){var g=new dt(a,u);E.metadata.push(g)}return E}function Oa(e,t,n,o,a){var u=Nn(n.container,a.serviceIdentifier),f=[];return u.length===fr.NoBindingsAvailable&&n.container.options.autoBindInjectable&&typeof a.serviceIdentifier=="function"&&e.getConstructorMetadata(a.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(a.serviceIdentifier).toSelf(),u=Nn(n.container,a.serviceIdentifier)),t?f=u:f=u.filter(function(p){var E=new Ti(p.serviceIdentifier,n,o,p,a);return p.constraint(E)}),uc(a.serviceIdentifier,f,a,n.container),f}function uc(e,t,n,o){switch(t.length){case fr.NoBindingsAvailable:if(n.isOptional())return t;var a=Dn(e),u=Tu;throw u+=Xu(a,n),u+=va(o,a,Nn),new Error(u);case fr.OnlyOneBindingAvailable:return t;case fr.MultipleBindingsAvailable:default:if(n.isArray())return t;var a=Dn(e),u=xu+" "+a;throw u+=va(o,a,Nn),new Error(u)}}function Ca(e,t,n,o,a,u){var f,p;if(a===null){f=Oa(e,t,o,null,u),p=new Ti(n,o,null,f,u);var E=new ec(o,p);o.addPlan(E)}else f=Oa(e,t,o,a,u),p=a.addChildRequest(u.serviceIdentifier,f,u);f.forEach(function(g){var T=null;if(u.isArray())T=p.addChildRequest(g.serviceIdentifier,g,u);else{if(g.cache)return;T=p}if(g.type===pe.Instance&&g.implementationType!==null){var P=rc(e,g.implementationType);if(!o.container.options.skipBaseClassChecks){var B=Ea(e,g.implementationType);if(P.length<B){var Q=Bu(hr(g.implementationType));throw new Error(Q)}}P.forEach(function(Z){Ca(e,!1,Z.serviceIdentifier,o,T,Z)})}})}function Nn(e,t){var n=[],o=gr(e);return o.hasKey(t)?n=o.get(t):e.parent!==null&&(n=Nn(e.parent,t)),n}function cc(e,t,n,o,a,u,f,p){p===void 0&&(p=!1);var E=new ba(t),g=sc(n,o,a,"",u,f);try{return Ca(e,p,a,E,null,g),E}catch(T){throw ga(T)&&ma(E.plan.rootRequest),T}}function lc(e,t,n,o){var a=new dr(Pn.Variable,"",t,new dt(n,o)),u=new ba(e),f=new Ti(t,u,null,[],a);return f}function Ke(e){var t=typeof e=="object"&&e!==null||typeof e=="function";return t&&typeof e.then=="function"}function Aa(e){return Ke(e)?!0:Array.isArray(e)&&e.some(Ke)}var fc=function(e,t,n,o){function a(u){return u instanceof n?u:new n(function(f){f(u)})}return new(n||(n=Promise))(function(u,f){function p(T){try{g(o.next(T))}catch(P){f(P)}}function E(T){try{g(o.throw(T))}catch(P){f(P)}}function g(T){T.done?u(T.value):a(T.value).then(p,E)}g((o=o.apply(e,t||[])).next())})},hc=function(e,t){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,f;return f={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function p(g){return function(T){return E([g,T])}}function E(g){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=g[0]&2?a.return:g[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,g[1])).done)return u;switch(a=0,u&&(g=[g[0]&2,u.value]),g[0]){case 0:case 1:u=g;break;case 4:return n.label++,{value:g[1],done:!1};case 5:n.label++,a=g[1],g=[0];continue;case 7:g=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(g[0]===6||g[0]===2)){n=0;continue}if(g[0]===3&&(!u||g[1]>u[0]&&g[1]<u[3])){n.label=g[1];break}if(g[0]===6&&n.label<u[1]){n.label=u[1],u=g;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(g);break}u[2]&&n.ops.pop(),n.trys.pop();continue}g=t.call(e,n)}catch(T){g=[6,T],a=0}finally{o=u=0}if(g[0]&5)throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}},dc=function(e,t){return t.scope===Ee.Singleton&&t.activated?t.cache:t.scope===Ee.Request&&e.has(t.id)?e.get(t.id):null},pc=function(e,t,n){t.scope===Ee.Singleton&&vc(t,n),t.scope===Ee.Request&&gc(e,t,n)},gc=function(e,t,n){e.has(t.id)||e.set(t.id,n)},vc=function(e,t){e.cache=t,e.activated=!0,Ke(t)&&yc(e,t)},yc=function(e,t){return fc(void 0,void 0,void 0,function(){var n,o;return hc(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,t];case 1:return n=a.sent(),e.cache=n,[3,3];case 2:throw o=a.sent(),e.cache=null,e.activated=!1,o;case 3:return[2]}})})},Rn;(function(e){e.DynamicValue="toDynamicValue",e.Factory="toFactory",e.Provider="toProvider"})(Rn||(Rn={}));var mc=function(e){var t=null;switch(e.type){case pe.ConstantValue:case pe.Function:t=e.cache;break;case pe.Constructor:case pe.Instance:t=e.implementationType;break;case pe.DynamicValue:t=e.dynamicValue;break;case pe.Provider:t=e.provider;break;case pe.Factory:t=e.factory;break}if(t===null){var n=Dn(e.serviceIdentifier);throw new Error(Ru+" "+n)}},bc=function(e){switch(e.type){case pe.Factory:return{factory:e.factory,factoryType:Rn.Factory};case pe.Provider:return{factory:e.provider,factoryType:Rn.Provider};case pe.DynamicValue:return{factory:e.dynamicValue,factoryType:Rn.DynamicValue};default:throw new Error("Unexpected factory type "+e.type)}},sn=function(){return sn=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},sn.apply(this,arguments)},xa=function(e,t,n,o){function a(u){return u instanceof n?u:new n(function(f){f(u)})}return new(n||(n=Promise))(function(u,f){function p(T){try{g(o.next(T))}catch(P){f(P)}}function E(T){try{g(o.throw(T))}catch(P){f(P)}}function g(T){T.done?u(T.value):a(T.value).then(p,E)}g((o=o.apply(e,t||[])).next())})},Pa=function(e,t){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,f;return f={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function p(g){return function(T){return E([g,T])}}function E(g){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=g[0]&2?a.return:g[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,g[1])).done)return u;switch(a=0,u&&(g=[g[0]&2,u.value]),g[0]){case 0:case 1:u=g;break;case 4:return n.label++,{value:g[1],done:!1};case 5:n.label++,a=g[1],g=[0];continue;case 7:g=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(g[0]===6||g[0]===2)){n=0;continue}if(g[0]===3&&(!u||g[1]>u[0]&&g[1]<u[3])){n.label=g[1];break}if(g[0]===6&&n.label<u[1]){n.label=u[1],u=g;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(g);break}u[2]&&n.ops.pop(),n.trys.pop();continue}g=t.call(e,n)}catch(T){g=[6,T],a=0}finally{o=u=0}if(g[0]&5)throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}},_c=function(e,t,n){if(n||arguments.length===2)for(var o=0,a=t.length,u;o<a;o++)(u||!(o in t))&&(u||(u=Array.prototype.slice.call(t,0,o)),u[o]=t[o]);return e.concat(u||Array.prototype.slice.call(t))};function wc(e,t){return e.reduce(function(n,o){var a=t(o),u=o.target.type;return u===Pn.ConstructorArgument?n.constructorInjections.push(a):(n.propertyRequests.push(o),n.propertyInjections.push(a)),n.isAsync||(n.isAsync=Aa(a)),n},{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}function Ec(e,t,n){var o;if(t.length>0){var a=wc(t,n),u=sn(sn({},a),{constr:e});a.isAsync?o=Sc(u):o=Ta(u)}else o=new e;return o}function Ta(e){var t,n=new((t=e.constr).bind.apply(t,_c([void 0],e.constructorInjections,!1)));return e.propertyRequests.forEach(function(o,a){var u=o.target.identifier,f=e.propertyInjections[a];(!o.target.isOptional()||f!==void 0)&&(n[u]=f)}),n}function Sc(e){return xa(this,void 0,void 0,function(){var t,n;return Pa(this,function(o){switch(o.label){case 0:return[4,Ia(e.constructorInjections)];case 1:return t=o.sent(),[4,Ia(e.propertyInjections)];case 2:return n=o.sent(),[2,Ta(sn(sn({},e),{constructorInjections:t,propertyInjections:n}))]}})})}function Ia(e){return xa(this,void 0,void 0,function(){var t,n,o,a;return Pa(this,function(u){for(t=[],n=0,o=e;n<o.length;n++)a=o[n],Array.isArray(a)?t.push(Promise.all(a)):t.push(a);return[2,Promise.all(t)]})})}function Da(e,t){var n=Oc(e,t);return Ke(n)?n.then(function(){return t}):t}function Oc(e,t){var n,o;if(Reflect.hasMetadata(ca,e)){var a=Reflect.getMetadata(ca,e);try{return(o=(n=t)[a.value])===null||o===void 0?void 0:o.call(n)}catch(u){if(u instanceof Error)throw new Error(qu(e.name,u.message))}}}function Cc(e,t){e.scope!==Ee.Singleton&&Ac(e,t)}function Ac(e,t){var n="Class cannot be instantiated in "+(e.scope===Ee.Request?"request":"transient")+" scope.";if(typeof e.onDeactivation=="function")throw new Error(Pi(t.name,n));if(Reflect.hasMetadata(xi,t))throw new Error(Hu(t.name,n))}function xc(e,t,n,o){Cc(e,t);var a=Ec(t,n,o);return Ke(a)?a.then(function(u){return Da(t,u)}):Da(t,a)}var Pc=function(e,t,n,o){function a(u){return u instanceof n?u:new n(function(f){f(u)})}return new(n||(n=Promise))(function(u,f){function p(T){try{g(o.next(T))}catch(P){f(P)}}function E(T){try{g(o.throw(T))}catch(P){f(P)}}function g(T){T.done?u(T.value):a(T.value).then(p,E)}g((o=o.apply(e,t||[])).next())})},Tc=function(e,t){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,f;return f={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function p(g){return function(T){return E([g,T])}}function E(g){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=g[0]&2?a.return:g[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,g[1])).done)return u;switch(a=0,u&&(g=[g[0]&2,u.value]),g[0]){case 0:case 1:u=g;break;case 4:return n.label++,{value:g[1],done:!1};case 5:n.label++,a=g[1],g=[0];continue;case 7:g=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(g[0]===6||g[0]===2)){n=0;continue}if(g[0]===3&&(!u||g[1]>u[0]&&g[1]<u[3])){n.label=g[1];break}if(g[0]===6&&n.label<u[1]){n.label=u[1],u=g;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(g);break}u[2]&&n.ops.pop(),n.trys.pop();continue}g=t.call(e,n)}catch(T){g=[6,T],a=0}finally{o=u=0}if(g[0]&5)throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}},Ii=function(e){return function(t){t.parentContext.setCurrentRequest(t);var n=t.bindings,o=t.childRequests,a=t.target&&t.target.isArray(),u=!t.parentRequest||!t.parentRequest.target||!t.target||!t.parentRequest.target.matchesArray(t.target.serviceIdentifier);if(a&&u)return o.map(function(p){var E=Ii(e);return E(p)});if(t.target.isOptional()&&n.length===0)return;var f=n[0];return Rc(e,t,f)}},Ic=function(e,t){var n=bc(e);return Qu(function(){return n.factory.bind(e)(t)},function(){return new Error(zu(n.factoryType,t.currentRequest.serviceIdentifier.toString()))})},Dc=function(e,t,n){var o,a=t.childRequests;switch(mc(n),n.type){case pe.ConstantValue:case pe.Function:o=n.cache;break;case pe.Constructor:o=n.implementationType;break;case pe.Instance:o=xc(n,n.implementationType,a,Ii(e));break;default:o=Ic(n,t.parentContext)}return o},Nc=function(e,t,n){var o=dc(e,t);return o!==null||(o=n(),pc(e,t,o)),o},Rc=function(e,t,n){return Nc(e,n,function(){var o=Dc(e,t,n);return Ke(o)?o=o.then(function(a){return Na(t,n,a)}):o=Na(t,n,o),o})};function Na(e,t,n){var o=Mc(e.parentContext,t,n),a=Lc(e.parentContext.container),u,f=a.next();do{u=f.value;var p=e.parentContext,E=e.serviceIdentifier,g=jc(u,E);Ke(o)?o=Ra(g,p,o):o=kc(g,p,o),f=a.next()}while(f.done!==!0&&!gr(u).hasKey(e.serviceIdentifier));return o}var Mc=function(e,t,n){var o;return typeof t.onActivation=="function"?o=t.onActivation(e,n):o=n,o},kc=function(e,t,n){for(var o=e.next();!o.done;){if(n=o.value(t,n),Ke(n))return Ra(e,t,n);o=e.next()}return n},Ra=function(e,t,n){return Pc(void 0,void 0,void 0,function(){var o,a;return Tc(this,function(u){switch(u.label){case 0:return[4,n];case 1:o=u.sent(),a=e.next(),u.label=2;case 2:return a.done?[3,4]:[4,a.value(t,o)];case 3:return o=u.sent(),a=e.next(),[3,2];case 4:return[2,o]}})})},jc=function(e,t){var n=e._activations;return n.hasKey(t)?n.get(t).values():[].values()},Lc=function(e){for(var t=[e],n=e.parent;n!==null;)t.push(n),n=n.parent;var o=function(){var u=t.pop();return u!==void 0?{done:!1,value:u}:{done:!0,value:void 0}},a={next:o};return a};function Fc(e){var t=Ii(e.plan.rootRequest.requestScope);return t(e.plan.rootRequest)}var pt=function(e,t){var n=e.parentRequest;return n!==null?t(n)?!0:pt(n,t):!1},Mn=function(e){return function(t){var n=function(o){return o!==null&&o.target!==null&&o.target.matchesTag(e)(t)};return n.metaData=new dt(e,t),n}},vr=Mn(qe),Di=function(e){return function(t){var n=null;if(t!==null)if(n=t.bindings[0],typeof e=="string"){var o=n.serviceIdentifier;return o===e}else{var a=t.bindings[0].implementationType;return e===a}return!1}},yr=function(){function e(t){this._binding=t}return e.prototype.when=function(t){return this._binding.constraint=t,new De(this._binding)},e.prototype.whenTargetNamed=function(t){return this._binding.constraint=vr(t),new De(this._binding)},e.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){if(t===null)return!1;var n=t.target!==null&&!t.target.isNamed()&&!t.target.isTagged();return n},new De(this._binding)},e.prototype.whenTargetTagged=function(t,n){return this._binding.constraint=Mn(t)(n),new De(this._binding)},e.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(n){return n!==null&&Di(t)(n.parentRequest)},new De(this._binding)},e.prototype.whenParentNamed=function(t){return this._binding.constraint=function(n){return n!==null&&vr(t)(n.parentRequest)},new De(this._binding)},e.prototype.whenParentTagged=function(t,n){return this._binding.constraint=function(o){return o!==null&&Mn(t)(n)(o.parentRequest)},new De(this._binding)},e.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(n){return n!==null&&pt(n,Di(t))},new De(this._binding)},e.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(n){return n!==null&&!pt(n,Di(t))},new De(this._binding)},e.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(n){return n!==null&&pt(n,vr(t))},new De(this._binding)},e.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(n){return n!==null&&!pt(n,vr(t))},new De(this._binding)},e.prototype.whenAnyAncestorTagged=function(t,n){return this._binding.constraint=function(o){return o!==null&&pt(o,Mn(t)(n))},new De(this._binding)},e.prototype.whenNoAncestorTagged=function(t,n){return this._binding.constraint=function(o){return o!==null&&!pt(o,Mn(t)(n))},new De(this._binding)},e.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(n){return n!==null&&pt(n,t)},new De(this._binding)},e.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(n){return n!==null&&!pt(n,t)},new De(this._binding)},e}(),De=function(){function e(t){this._binding=t}return e.prototype.onActivation=function(t){return this._binding.onActivation=t,new yr(this._binding)},e.prototype.onDeactivation=function(t){return this._binding.onDeactivation=t,new yr(this._binding)},e}(),gt=function(){function e(t){this._binding=t,this._bindingWhenSyntax=new yr(this._binding),this._bindingOnSyntax=new De(this._binding)}return e.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},e.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},e.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},e.prototype.whenTargetTagged=function(t,n){return this._bindingWhenSyntax.whenTargetTagged(t,n)},e.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},e.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},e.prototype.whenParentTagged=function(t,n){return this._bindingWhenSyntax.whenParentTagged(t,n)},e.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},e.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},e.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},e.prototype.whenAnyAncestorTagged=function(t,n){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,n)},e.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},e.prototype.whenNoAncestorTagged=function(t,n){return this._bindingWhenSyntax.whenNoAncestorTagged(t,n)},e.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},e.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},e.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},e.prototype.onDeactivation=function(t){return this._bindingOnSyntax.onDeactivation(t)},e}(),Bc=function(){function e(t){this._binding=t}return e.prototype.inRequestScope=function(){return this._binding.scope=Ee.Request,new gt(this._binding)},e.prototype.inSingletonScope=function(){return this._binding.scope=Ee.Singleton,new gt(this._binding)},e.prototype.inTransientScope=function(){return this._binding.scope=Ee.Transient,new gt(this._binding)},e}(),Ma=function(){function e(t){this._binding=t,this._bindingWhenSyntax=new yr(this._binding),this._bindingOnSyntax=new De(this._binding),this._bindingInSyntax=new Bc(t)}return e.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},e.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},e.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},e.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},e.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},e.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},e.prototype.whenTargetTagged=function(t,n){return this._bindingWhenSyntax.whenTargetTagged(t,n)},e.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},e.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},e.prototype.whenParentTagged=function(t,n){return this._bindingWhenSyntax.whenParentTagged(t,n)},e.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},e.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},e.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},e.prototype.whenAnyAncestorTagged=function(t,n){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,n)},e.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},e.prototype.whenNoAncestorTagged=function(t,n){return this._bindingWhenSyntax.whenNoAncestorTagged(t,n)},e.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},e.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},e.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},e.prototype.onDeactivation=function(t){return this._bindingOnSyntax.onDeactivation(t)},e}(),Kc=function(){function e(t){this._binding=t}return e.prototype.to=function(t){return this._binding.type=pe.Instance,this._binding.implementationType=t,new Ma(this._binding)},e.prototype.toSelf=function(){if(typeof this._binding.serviceIdentifier!="function")throw new Error(""+Fu);var t=this._binding.serviceIdentifier;return this.to(t)},e.prototype.toConstantValue=function(t){return this._binding.type=pe.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=Ee.Singleton,new gt(this._binding)},e.prototype.toDynamicValue=function(t){return this._binding.type=pe.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new Ma(this._binding)},e.prototype.toConstructor=function(t){return this._binding.type=pe.Constructor,this._binding.implementationType=t,this._binding.scope=Ee.Singleton,new gt(this._binding)},e.prototype.toFactory=function(t){return this._binding.type=pe.Factory,this._binding.factory=t,this._binding.scope=Ee.Singleton,new gt(this._binding)},e.prototype.toFunction=function(t){if(typeof t!="function")throw new Error(ju);var n=this.toConstantValue(t);return this._binding.type=pe.Function,this._binding.scope=Ee.Singleton,n},e.prototype.toAutoFactory=function(t){return this._binding.type=pe.Factory,this._binding.factory=function(n){var o=function(){return n.container.get(t)};return o},this._binding.scope=Ee.Singleton,new gt(this._binding)},e.prototype.toAutoNamedFactory=function(t){return this._binding.type=pe.Factory,this._binding.factory=function(n){return function(o){return n.container.getNamed(t,o)}},new gt(this._binding)},e.prototype.toProvider=function(t){return this._binding.type=pe.Provider,this._binding.provider=t,this._binding.scope=Ee.Singleton,new gt(this._binding)},e.prototype.toService=function(t){this.toDynamicValue(function(n){return n.container.get(t)})},e}(),Vc=function(){function e(){}return e.of=function(t,n,o,a,u){var f=new e;return f.bindings=t,f.middleware=n,f.deactivations=a,f.activations=o,f.moduleActivationStore=u,f},e}();function $c(e){return typeof e=="object"&&e!==null&&"clone"in e&&typeof e.clone=="function"}var Bt=function(){function e(){this._map=new Map}return e.prototype.getMap=function(){return this._map},e.prototype.add=function(t,n){if(t==null)throw new Error(In);if(n==null)throw new Error(In);var o=this._map.get(t);o!==void 0?o.push(n):this._map.set(t,[n])},e.prototype.get=function(t){if(t==null)throw new Error(In);var n=this._map.get(t);if(n!==void 0)return n;throw new Error(ha)},e.prototype.remove=function(t){if(t==null)throw new Error(In);if(!this._map.delete(t))throw new Error(ha)},e.prototype.removeIntersection=function(t){var n=this;this.traverse(function(o,a){var u=t.hasKey(o)?t.get(o):void 0;if(u!==void 0){var f=a.filter(function(p){return!u.some(function(E){return p===E})});n._setValue(o,f)}})},e.prototype.removeByCondition=function(t){var n=this,o=[];return this._map.forEach(function(a,u){for(var f=[],p=0,E=a;p<E.length;p++){var g=E[p],T=t(g);T?o.push(g):f.push(g)}n._setValue(u,f)}),o},e.prototype.hasKey=function(t){if(t==null)throw new Error(In);return this._map.has(t)},e.prototype.clone=function(){var t=new e;return this._map.forEach(function(n,o){n.forEach(function(a){return t.add(o,$c(a)?a.clone():a)})}),t},e.prototype.traverse=function(t){this._map.forEach(function(n,o){t(o,n)})},e.prototype._setValue=function(t,n){n.length>0?this._map.set(t,n):this._map.delete(t)},e}(),Wc=function(){function e(){this._map=new Map}return e.prototype.remove=function(t){if(this._map.has(t)){var n=this._map.get(t);return this._map.delete(t),n}return this._getEmptyHandlersStore()},e.prototype.addDeactivation=function(t,n,o){this._getModuleActivationHandlers(t).onDeactivations.add(n,o)},e.prototype.addActivation=function(t,n,o){this._getModuleActivationHandlers(t).onActivations.add(n,o)},e.prototype.clone=function(){var t=new e;return this._map.forEach(function(n,o){t._map.set(o,{onActivations:n.onActivations.clone(),onDeactivations:n.onDeactivations.clone()})}),t},e.prototype._getModuleActivationHandlers=function(t){var n=this._map.get(t);return n===void 0&&(n=this._getEmptyHandlersStore(),this._map.set(t,n)),n},e.prototype._getEmptyHandlersStore=function(){var t={onActivations:new Bt,onDeactivations:new Bt};return t},e}(),mr=function(){return mr=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},mr.apply(this,arguments)},Je=function(e,t,n,o){function a(u){return u instanceof n?u:new n(function(f){f(u)})}return new(n||(n=Promise))(function(u,f){function p(T){try{g(o.next(T))}catch(P){f(P)}}function E(T){try{g(o.throw(T))}catch(P){f(P)}}function g(T){T.done?u(T.value):a(T.value).then(p,E)}g((o=o.apply(e,t||[])).next())})},Xe=function(e,t){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,f;return f={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function p(g){return function(T){return E([g,T])}}function E(g){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=g[0]&2?a.return:g[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,g[1])).done)return u;switch(a=0,u&&(g=[g[0]&2,u.value]),g[0]){case 0:case 1:u=g;break;case 4:return n.label++,{value:g[1],done:!1};case 5:n.label++,a=g[1],g=[0];continue;case 7:g=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(g[0]===6||g[0]===2)){n=0;continue}if(g[0]===3&&(!u||g[1]>u[0]&&g[1]<u[3])){n.label=g[1];break}if(g[0]===6&&n.label<u[1]){n.label=u[1],u=g;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(g);break}u[2]&&n.ops.pop(),n.trys.pop();continue}g=t.call(e,n)}catch(T){g=[6,T],a=0}finally{o=u=0}if(g[0]&5)throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}},Uc=function(e,t,n){if(n||arguments.length===2)for(var o=0,a=t.length,u;o<a;o++)(u||!(o in t))&&(u||(u=Array.prototype.slice.call(t,0,o)),u[o]=t[o]);return e.concat(u||Array.prototype.slice.call(t))},qc=function(){function e(t){var n=t||{};if(typeof n!="object")throw new Error(""+Ku);if(n.defaultScope===void 0)n.defaultScope=Ee.Transient;else if(n.defaultScope!==Ee.Singleton&&n.defaultScope!==Ee.Transient&&n.defaultScope!==Ee.Request)throw new Error(""+Vu);if(n.autoBindInjectable===void 0)n.autoBindInjectable=!1;else if(typeof n.autoBindInjectable!="boolean")throw new Error(""+$u);if(n.skipBaseClassChecks===void 0)n.skipBaseClassChecks=!1;else if(typeof n.skipBaseClassChecks!="boolean")throw new Error(""+Wu);this.options={autoBindInjectable:n.autoBindInjectable,defaultScope:n.defaultScope,skipBaseClassChecks:n.skipBaseClassChecks},this.id=Tn(),this._bindingDictionary=new Bt,this._snapshots=[],this._middleware=null,this._activations=new Bt,this._deactivations=new Bt,this.parent=null,this._metadataReader=new Yu,this._moduleActivationStore=new Wc}return e.merge=function(t,n){for(var o=[],a=2;a<arguments.length;a++)o[a-2]=arguments[a];var u=new e,f=Uc([t,n],o,!0).map(function(g){return gr(g)}),p=gr(u);function E(g,T){g.traverse(function(P,B){B.forEach(function(Q){T.add(Q.serviceIdentifier,Q.clone())})})}return f.forEach(function(g){E(g,p)}),u},e.prototype.load=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var o=this._getContainerModuleHelpersFactory(),a=0,u=t;a<u.length;a++){var f=u[a],p=o(f.id);f.registry(p.bindFunction,p.unbindFunction,p.isboundFunction,p.rebindFunction,p.unbindAsyncFunction,p.onActivationFunction,p.onDeactivationFunction)}},e.prototype.loadAsync=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Je(this,void 0,void 0,function(){var o,a,u,f,p;return Xe(this,function(E){switch(E.label){case 0:o=this._getContainerModuleHelpersFactory(),a=0,u=t,E.label=1;case 1:return a<u.length?(f=u[a],p=o(f.id),[4,f.registry(p.bindFunction,p.unbindFunction,p.isboundFunction,p.rebindFunction,p.unbindAsyncFunction,p.onActivationFunction,p.onDeactivationFunction)]):[3,4];case 2:E.sent(),E.label=3;case 3:return a++,[3,1];case 4:return[2]}})})},e.prototype.unload=function(){for(var t=this,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];n.forEach(function(a){var u=t._removeModuleBindings(a.id);t._deactivateSingletons(u),t._removeModuleHandlers(a.id)})},e.prototype.unloadAsync=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Je(this,void 0,void 0,function(){var o,a,u,f;return Xe(this,function(p){switch(p.label){case 0:o=0,a=t,p.label=1;case 1:return o<a.length?(u=a[o],f=this._removeModuleBindings(u.id),[4,this._deactivateSingletonsAsync(f)]):[3,4];case 2:p.sent(),this._removeModuleHandlers(u.id),p.label=3;case 3:return o++,[3,1];case 4:return[2]}})})},e.prototype.bind=function(t){var n=this.options.defaultScope||Ee.Transient,o=new Cu(t,n);return this._bindingDictionary.add(t,o),new Kc(o)},e.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},e.prototype.rebindAsync=function(t){return Je(this,void 0,void 0,function(){return Xe(this,function(n){switch(n.label){case 0:return[4,this.unbindAsync(t)];case 1:return n.sent(),[2,this.bind(t)]}})})},e.prototype.unbind=function(t){if(this._bindingDictionary.hasKey(t)){var n=this._bindingDictionary.get(t);this._deactivateSingletons(n)}this._removeServiceFromDictionary(t)},e.prototype.unbindAsync=function(t){return Je(this,void 0,void 0,function(){var n;return Xe(this,function(o){switch(o.label){case 0:return this._bindingDictionary.hasKey(t)?(n=this._bindingDictionary.get(t),[4,this._deactivateSingletonsAsync(n)]):[3,2];case 1:o.sent(),o.label=2;case 2:return this._removeServiceFromDictionary(t),[2]}})})},e.prototype.unbindAll=function(){var t=this;this._bindingDictionary.traverse(function(n,o){t._deactivateSingletons(o)}),this._bindingDictionary=new Bt},e.prototype.unbindAllAsync=function(){return Je(this,void 0,void 0,function(){var t,n=this;return Xe(this,function(o){switch(o.label){case 0:return t=[],this._bindingDictionary.traverse(function(a,u){t.push(n._deactivateSingletonsAsync(u))}),[4,Promise.all(t)];case 1:return o.sent(),this._bindingDictionary=new Bt,[2]}})})},e.prototype.onActivation=function(t,n){this._activations.add(t,n)},e.prototype.onDeactivation=function(t,n){this._deactivations.add(t,n)},e.prototype.isBound=function(t){var n=this._bindingDictionary.hasKey(t);return!n&&this.parent&&(n=this.parent.isBound(t)),n},e.prototype.isCurrentBound=function(t){return this._bindingDictionary.hasKey(t)},e.prototype.isBoundNamed=function(t,n){return this.isBoundTagged(t,qe,n)},e.prototype.isBoundTagged=function(t,n,o){var a=!1;if(this._bindingDictionary.hasKey(t)){var u=this._bindingDictionary.get(t),f=lc(this,t,n,o);a=u.some(function(p){return p.constraint(f)})}return!a&&this.parent&&(a=this.parent.isBoundTagged(t,n,o)),a},e.prototype.snapshot=function(){this._snapshots.push(Vc.of(this._bindingDictionary.clone(),this._middleware,this._activations.clone(),this._deactivations.clone(),this._moduleActivationStore.clone()))},e.prototype.restore=function(){var t=this._snapshots.pop();if(t===void 0)throw new Error(Mu);this._bindingDictionary=t.bindings,this._activations=t.activations,this._deactivations=t.deactivations,this._middleware=t.middleware,this._moduleActivationStore=t.moduleActivationStore},e.prototype.createChild=function(t){var n=new e(t||this.options);return n.parent=this,n},e.prototype.applyMiddleware=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce(function(a,u){return u(a)},o)},e.prototype.applyCustomMetadataReader=function(t){this._metadataReader=t},e.prototype.get=function(t){var n=this._getNotAllArgs(t,!1);return this._getButThrowIfAsync(n)},e.prototype.getAsync=function(t){return Je(this,void 0,void 0,function(){var n;return Xe(this,function(o){return n=this._getNotAllArgs(t,!1),[2,this._get(n)]})})},e.prototype.getTagged=function(t,n,o){var a=this._getNotAllArgs(t,!1,n,o);return this._getButThrowIfAsync(a)},e.prototype.getTaggedAsync=function(t,n,o){return Je(this,void 0,void 0,function(){var a;return Xe(this,function(u){return a=this._getNotAllArgs(t,!1,n,o),[2,this._get(a)]})})},e.prototype.getNamed=function(t,n){return this.getTagged(t,qe,n)},e.prototype.getNamedAsync=function(t,n){return this.getTaggedAsync(t,qe,n)},e.prototype.getAll=function(t){var n=this._getAllArgs(t);return this._getButThrowIfAsync(n)},e.prototype.getAllAsync=function(t){var n=this._getAllArgs(t);return this._getAll(n)},e.prototype.getAllTagged=function(t,n,o){var a=this._getNotAllArgs(t,!0,n,o);return this._getButThrowIfAsync(a)},e.prototype.getAllTaggedAsync=function(t,n,o){var a=this._getNotAllArgs(t,!0,n,o);return this._getAll(a)},e.prototype.getAllNamed=function(t,n){return this.getAllTagged(t,qe,n)},e.prototype.getAllNamedAsync=function(t,n){return this.getAllTaggedAsync(t,qe,n)},e.prototype.resolve=function(t){var n=this.isBound(t);n||this.bind(t).toSelf();var o=this.get(t);return n||this.unbind(t),o},e.prototype._preDestroy=function(t,n){var o,a;if(Reflect.hasMetadata(xi,t)){var u=Reflect.getMetadata(xi,t);return(a=(o=n)[u.value])===null||a===void 0?void 0:a.call(o)}},e.prototype._removeModuleHandlers=function(t){var n=this._moduleActivationStore.remove(t);this._activations.removeIntersection(n.onActivations),this._deactivations.removeIntersection(n.onDeactivations)},e.prototype._removeModuleBindings=function(t){return this._bindingDictionary.removeByCondition(function(n){return n.moduleId===t})},e.prototype._deactivate=function(t,n){var o=this,a=Object.getPrototypeOf(n).constructor;try{if(this._deactivations.hasKey(t.serviceIdentifier)){var u=this._deactivateContainer(n,this._deactivations.get(t.serviceIdentifier).values());if(Ke(u))return this._handleDeactivationError(u.then(function(){return o._propagateContainerDeactivationThenBindingAndPreDestroyAsync(t,n,a)}),a)}var f=this._propagateContainerDeactivationThenBindingAndPreDestroy(t,n,a);if(Ke(f))return this._handleDeactivationError(f,a)}catch(p){if(p instanceof Error)throw new Error(Pi(a.name,p.message))}},e.prototype._handleDeactivationError=function(t,n){return Je(this,void 0,void 0,function(){var o;return Xe(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,t];case 1:return a.sent(),[3,3];case 2:if(o=a.sent(),o instanceof Error)throw new Error(Pi(n.name,o.message));return[3,3];case 3:return[2]}})})},e.prototype._deactivateContainer=function(t,n){for(var o=this,a=n.next();a.value;){var u=a.value(t);if(Ke(u))return u.then(function(){return o._deactivateContainerAsync(t,n)});a=n.next()}},e.prototype._deactivateContainerAsync=function(t,n){return Je(this,void 0,void 0,function(){var o;return Xe(this,function(a){switch(a.label){case 0:o=n.next(),a.label=1;case 1:return o.value?[4,o.value(t)]:[3,3];case 2:return a.sent(),o=n.next(),[3,1];case 3:return[2]}})})},e.prototype._getContainerModuleHelpersFactory=function(){var t=this,n=function(T,P){T._binding.moduleId=P},o=function(T){return function(P){var B=t.bind(P);return n(B,T),B}},a=function(){return function(T){return t.unbind(T)}},u=function(){return function(T){return t.unbindAsync(T)}},f=function(){return function(T){return t.isBound(T)}},p=function(T){return function(P){var B=t.rebind(P);return n(B,T),B}},E=function(T){return function(P,B){t._moduleActivationStore.addActivation(T,P,B),t.onActivation(P,B)}},g=function(T){return function(P,B){t._moduleActivationStore.addDeactivation(T,P,B),t.onDeactivation(P,B)}};return function(T){return{bindFunction:o(T),isboundFunction:f(),onActivationFunction:E(T),onDeactivationFunction:g(T),rebindFunction:p(T),unbindFunction:a(),unbindAsyncFunction:u()}}},e.prototype._getAll=function(t){return Promise.all(this._get(t))},e.prototype._get=function(t){var n=mr(mr({},t),{contextInterceptor:function(a){return a},targetType:Pn.Variable});if(this._middleware){var o=this._middleware(n);if(o==null)throw new Error(ku);return o}return this._planAndResolve()(n)},e.prototype._getButThrowIfAsync=function(t){var n=this._get(t);if(Aa(n))throw new Error(Lu(t.serviceIdentifier));return n},e.prototype._getAllArgs=function(t){var n={avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t};return n},e.prototype._getNotAllArgs=function(t,n,o,a){var u={avoidConstraints:!1,isMultiInject:n,serviceIdentifier:t,key:o,value:a};return u},e.prototype._planAndResolve=function(){var t=this;return function(n){var o=cc(t._metadataReader,t,n.isMultiInject,n.targetType,n.serviceIdentifier,n.key,n.value,n.avoidConstraints);o=n.contextInterceptor(o);var a=Fc(o);return a}},e.prototype._deactivateIfSingleton=function(t){var n=this;if(t.activated)return Ke(t.cache)?t.cache.then(function(o){return n._deactivate(t,o)}):this._deactivate(t,t.cache)},e.prototype._deactivateSingletons=function(t){for(var n=0,o=t;n<o.length;n++){var a=o[n],u=this._deactivateIfSingleton(a);if(Ke(u))throw new Error(Uu)}},e.prototype._deactivateSingletonsAsync=function(t){return Je(this,void 0,void 0,function(){var n=this;return Xe(this,function(o){switch(o.label){case 0:return[4,Promise.all(t.map(function(a){return n._deactivateIfSingleton(a)}))];case 1:return o.sent(),[2]}})})},e.prototype._propagateContainerDeactivationThenBindingAndPreDestroy=function(t,n,o){return this.parent?this._deactivate.bind(this.parent)(t,n):this._bindingDeactivationAndPreDestroy(t,n,o)},e.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync=function(t,n,o){return Je(this,void 0,void 0,function(){return Xe(this,function(a){switch(a.label){case 0:return this.parent?[4,this._deactivate.bind(this.parent)(t,n)]:[3,2];case 1:return a.sent(),[3,4];case 2:return[4,this._bindingDeactivationAndPreDestroyAsync(t,n,o)];case 3:a.sent(),a.label=4;case 4:return[2]}})})},e.prototype._removeServiceFromDictionary=function(t){try{this._bindingDictionary.remove(t)}catch{throw new Error(Pu+" "+Dn(t))}},e.prototype._bindingDeactivationAndPreDestroy=function(t,n,o){var a=this;if(typeof t.onDeactivation=="function"){var u=t.onDeactivation(n);if(Ke(u))return u.then(function(){return a._preDestroy(o,n)})}return this._preDestroy(o,n)},e.prototype._bindingDeactivationAndPreDestroyAsync=function(t,n,o){return Je(this,void 0,void 0,function(){return Xe(this,function(a){switch(a.label){case 0:return typeof t.onDeactivation!="function"?[3,2]:[4,t.onDeactivation(n)];case 1:a.sent(),a.label=2;case 2:return[4,this._preDestroy(o,n)];case 3:return a.sent(),[2]}})})},e}();function Hc(e){for(var t=new Set,n=0,o=e;n<o.length;n++){var a=o[n];if(t.has(a))return a;t.add(a)}}function zc(e){return e.prototype!==void 0}function Gc(e){if(e!==void 0)throw new Error(pa)}function ka(e,t,n,o){Gc(t),ja(sa,e,n.toString(),o)}function Yc(e,t,n){if(zc(e))throw new Error(pa);ja(ua,e.constructor,t,n)}function Qc(e){var t=[];if(Array.isArray(e)){t=e;var n=Hc(t.map(function(o){return o.key}));if(n!==void 0)throw new Error(fa+" "+n.toString())}else t=[e];return t}function ja(e,t,n,o){var a=Qc(o),u={};Reflect.hasOwnMetadata(e,t)&&(u=Reflect.getMetadata(e,t));var f=u[n];if(f===void 0)f=[];else for(var p=function(P){if(a.some(function(B){return B.key===P.key}))throw new Error(fa+" "+P.key.toString())},E=0,g=f;E<g.length;E++){var T=g[E];p(T)}f.push.apply(f,a),u[n]=f,Reflect.defineMetadata(e,u,t)}function La(e){return function(t,n,o){typeof o=="number"?ka(t,n,o,e):Yc(t,n,e)}}function Re(){return function(e){if(Reflect.hasOwnMetadata(Ai,e))throw new Error(Au);var t=Reflect.getMetadata(Eu,e)||[];return Reflect.defineMetadata(Ai,t,e),e}}function Ni(e){return La(new dt(qe,e))}function Jc(e){return function(t){return function(n,o,a){if(t===void 0){var u=typeof n=="function"?n.name:n.constructor.name;throw new Error(Du(u))}return La(new dt(e,t))(n,o,a)}}}var xe=Jc(lr);function Xc(){return function(e,t,n){var o=new dt(cr,!0);ka(e,t,n,o)}}var br=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}/*! *****************************************************************************
|
|
12
|
+
Copyright (C) Microsoft. All rights reserved.
|
|
13
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
14
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
15
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
|
|
17
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
18
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
19
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
20
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
21
|
+
|
|
22
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
23
|
+
and limitations under the License.
|
|
24
|
+
***************************************************************************** */var Fa;(function(e){(function(t){var n=typeof globalThis=="object"?globalThis:typeof br=="object"?br:typeof self=="object"?self:typeof this=="object"?this:p(),o=a(e);typeof n.Reflect<"u"&&(o=a(n.Reflect,o)),t(o,n),typeof n.Reflect>"u"&&(n.Reflect=e);function a(E,g){return function(T,P){Object.defineProperty(E,T,{configurable:!0,writable:!0,value:P}),g&&g(T,P)}}function u(){try{return Function("return this;")()}catch{}}function f(){try{return(0,eval)("(function() { return this; })()")}catch{}}function p(){return u()||f()}})(function(t,n){var o=Object.prototype.hasOwnProperty,a=typeof Symbol=="function",u=a&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",f=a&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",p=typeof Object.create=="function",E={__proto__:[]}instanceof Array,g=!p&&!E,T={create:p?function(){return It(Object.create(null))}:E?function(){return It({__proto__:null})}:function(){return It({})},has:g?function(x,D){return o.call(x,D)}:function(x,D){return D in x},get:g?function(x,D){return o.call(x,D)?x[D]:void 0}:function(x,D){return x[D]}},P=Object.getPrototypeOf(Function),B=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Hn(),Q=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Xt(),Z=typeof WeakMap=="function"?WeakMap:zn(),fe=a?Symbol.for("@reflect-metadata:registry"):void 0,He=Qt(),$e=Zr(He);function We(x,D,j,V){if(J(j)){if(!Yt(x))throw new TypeError;if(!Tt(D))throw new TypeError;return zt(x,D)}else{if(!Yt(x))throw new TypeError;if(!ye(D))throw new TypeError;if(!ye(V)&&!J(V)&&!ze(V))throw new TypeError;return ze(V)&&(V=void 0),j=Ge(j),ct(x,D,j,V)}}t("decorate",We);function yt(x,D){function j(V,L){if(!ye(V))throw new TypeError;if(!J(L)&&!Eo(L))throw new TypeError;lt(x,D,V,L)}return j}t("metadata",yt);function Se(x,D,j,V){if(!ye(j))throw new TypeError;return J(V)||(V=Ge(V)),lt(x,D,j,V)}t("defineMetadata",Se);function xt(x,D,j){if(!ye(D))throw new TypeError;return J(j)||(j=Ge(j)),Ur(x,D,j)}t("hasMetadata",xt);function ne(x,D,j){if(!ye(D))throw new TypeError;return J(j)||(j=Ge(j)),Gt(x,D,j)}t("hasOwnMetadata",ne);function Pe(x,D,j){if(!ye(D))throw new TypeError;return J(j)||(j=Ge(j)),bn(x,D,j)}t("getMetadata",Pe);function mn(x,D,j){if(!ye(D))throw new TypeError;return J(j)||(j=Ge(j)),qr(x,D,j)}t("getOwnMetadata",mn);function wo(x,D){if(!ye(x))throw new TypeError;return J(D)||(D=Ge(D)),mt(x,D)}t("getMetadataKeys",wo);function $r(x,D){if(!ye(x))throw new TypeError;return J(D)||(D=Ge(D)),et(x,D)}t("getOwnMetadataKeys",$r);function Wr(x,D,j){if(!ye(D))throw new TypeError;if(J(j)||(j=Ge(j)),!ye(D))throw new TypeError;J(j)||(j=Ge(j));var V=at(D,j,!1);return J(V)?!1:V.OrdinaryDeleteMetadata(x,D,j)}t("deleteMetadata",Wr);function zt(x,D){for(var j=x.length-1;j>=0;--j){var V=x[j],L=V(D);if(!J(L)&&!ze(L)){if(!Tt(L))throw new TypeError;D=L}}return D}function ct(x,D,j,V){for(var L=x.length-1;L>=0;--L){var me=x[L],de=me(D,j,V);if(!J(de)&&!ze(de)){if(!ye(de))throw new TypeError;V=de}}return V}function Ur(x,D,j){var V=Gt(x,D,j);if(V)return!0;var L=Ue(D);return ze(L)?!1:Ur(x,L,j)}function Gt(x,D,j){var V=at(D,j,!1);return J(V)?!1:zr(V.OrdinaryHasOwnMetadata(x,D,j))}function bn(x,D,j){var V=Gt(x,D,j);if(V)return qr(x,D,j);var L=Ue(D);if(!ze(L))return bn(x,L,j)}function qr(x,D,j){var V=at(D,j,!1);if(!J(V))return V.OrdinaryGetOwnMetadata(x,D,j)}function lt(x,D,j,V){var L=at(j,V,!0);L.OrdinaryDefineOwnMetadata(x,D,j,V)}function mt(x,D){var j=et(x,D),V=Ue(x);if(V===null)return j;var L=mt(V,D);if(L.length<=0)return j;if(j.length<=0)return L;for(var me=new Q,de=[],ee=0,N=j;ee<N.length;ee++){var H=N[ee],z=me.has(H);z||(me.add(H),de.push(H))}for(var G=0,re=L;G<re.length;G++){var H=re[G],z=me.has(H);z||(me.add(H),de.push(H))}return de}function et(x,D){var j=at(x,D,!1);return j?j.OrdinaryOwnMetadataKeys(x,D):[]}function _n(x){if(x===null)return 1;switch(typeof x){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return x===null?1:6;default:return 6}}function J(x){return x===void 0}function ze(x){return x===null}function Hr(x){return typeof x=="symbol"}function ye(x){return typeof x=="object"?x!==null:typeof x=="function"}function Pt(x,D){switch(_n(x)){case 0:return x;case 1:return x;case 2:return x;case 3:return x;case 4:return x;case 5:return x}var j="string",V=Gr(x,u);if(V!==void 0){var L=V.call(x,j);if(ye(L))throw new TypeError;return L}return qn(x)}function qn(x,D){var j,V;{var L=x.toString;if(se(L)){var V=L.call(x);if(!ye(V))return V}var j=x.valueOf;if(se(j)){var V=j.call(x);if(!ye(V))return V}}throw new TypeError}function zr(x){return!!x}function Y(x){return""+x}function Ge(x){var D=Pt(x);return Hr(D)?D:Y(D)}function Yt(x){return Array.isArray?Array.isArray(x):x instanceof Object?x instanceof Array:Object.prototype.toString.call(x)==="[object Array]"}function se(x){return typeof x=="function"}function Tt(x){return typeof x=="function"}function Eo(x){switch(_n(x)){case 3:return!0;case 4:return!0;default:return!1}}function ot(x,D){return x===D||x!==x&&D!==D}function Gr(x,D){var j=x[D];if(j!=null){if(!se(j))throw new TypeError;return j}}function Yr(x){var D=Gr(x,f);if(!se(D))throw new TypeError;var j=D.call(x);if(!ye(j))throw new TypeError;return j}function Qr(x){return x.value}function Jr(x){var D=x.next();return D.done?!1:D}function wn(x){var D=x.return;D&&D.call(x)}function Ue(x){var D=Object.getPrototypeOf(x);if(typeof x!="function"||x===P||D!==P)return D;var j=x.prototype,V=j&&Object.getPrototypeOf(j);if(V==null||V===Object.prototype)return D;var L=V.constructor;return typeof L!="function"||L===x?D:L}function Xr(){var x;!J(fe)&&typeof n.Reflect<"u"&&!(fe in n.Reflect)&&typeof n.Reflect.defineMetadata=="function"&&(x=Jt(n.Reflect));var D,j,V,L=new Z,me={registerProvider:de,getProvider:N,setProvider:z};return me;function de(G){if(!Object.isExtensible(me))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case x===G:break;case J(D):D=G;break;case D===G:break;case J(j):j=G;break;case j===G:break;default:V===void 0&&(V=new Q),V.add(G);break}}function ee(G,re){if(!J(D)){if(D.isProviderFor(G,re))return D;if(!J(j)){if(j.isProviderFor(G,re))return D;if(!J(V))for(var he=Yr(V);;){var we=Jr(he);if(!we)return;var Ye=Qr(we);if(Ye.isProviderFor(G,re))return wn(he),Ye}}}if(!J(x)&&x.isProviderFor(G,re))return x}function N(G,re){var he=L.get(G),we;return J(he)||(we=he.get(re)),J(we)&&(we=ee(G,re),J(we)||(J(he)&&(he=new B,L.set(G,he)),he.set(re,we))),we}function H(G){if(J(G))throw new TypeError;return D===G||j===G||!J(V)&&V.has(G)}function z(G,re,he){if(!H(he))throw new Error("Metadata provider not registered.");var we=N(G,re);if(we!==he){if(!J(we))return!1;var Ye=L.get(G);J(Ye)&&(Ye=new B,L.set(G,Ye)),Ye.set(re,he)}return!0}}function Qt(){var x;return!J(fe)&&ye(n.Reflect)&&Object.isExtensible(n.Reflect)&&(x=n.Reflect[fe]),J(x)&&(x=Xr()),!J(fe)&&ye(n.Reflect)&&Object.isExtensible(n.Reflect)&&Object.defineProperty(n.Reflect,fe,{enumerable:!1,configurable:!1,writable:!1,value:x}),x}function Zr(x){var D=new Z,j={isProviderFor:function(H,z){var G=D.get(H);return J(G)?!1:G.has(z)},OrdinaryDefineOwnMetadata:de,OrdinaryHasOwnMetadata:L,OrdinaryGetOwnMetadata:me,OrdinaryOwnMetadataKeys:ee,OrdinaryDeleteMetadata:N};return He.registerProvider(j),j;function V(H,z,G){var re=D.get(H),he=!1;if(J(re)){if(!G)return;re=new B,D.set(H,re),he=!0}var we=re.get(z);if(J(we)){if(!G)return;if(we=new B,re.set(z,we),!x.setProvider(H,z,j))throw re.delete(z),he&&D.delete(H),new Error("Wrong provider for target.")}return we}function L(H,z,G){var re=V(z,G,!1);return J(re)?!1:zr(re.has(H))}function me(H,z,G){var re=V(z,G,!1);if(!J(re))return re.get(H)}function de(H,z,G,re){var he=V(G,re,!0);he.set(H,z)}function ee(H,z){var G=[],re=V(H,z,!1);if(J(re))return G;for(var he=re.keys(),we=Yr(he),Ye=0;;){var bt=Jr(we);if(!bt)return G.length=Ye,G;var Dt=Qr(bt);try{G[Ye]=Dt}catch(Gn){try{wn(we)}finally{throw Gn}}Ye++}}function N(H,z,G){var re=V(z,G,!1);if(J(re)||!re.delete(H))return!1;if(re.size===0){var he=D.get(z);J(he)||(he.delete(G),he.size===0&&D.delete(he))}return!0}}function Jt(x){var D=x.defineMetadata,j=x.hasOwnMetadata,V=x.getOwnMetadata,L=x.getOwnMetadataKeys,me=x.deleteMetadata,de=new Z,ee={isProviderFor:function(N,H){var z=de.get(N);return!J(z)&&z.has(H)?!0:L(N,H).length?(J(z)&&(z=new Q,de.set(N,z)),z.add(H),!0):!1},OrdinaryDefineOwnMetadata:D,OrdinaryHasOwnMetadata:j,OrdinaryGetOwnMetadata:V,OrdinaryOwnMetadataKeys:L,OrdinaryDeleteMetadata:me};return ee}function at(x,D,j){var V=He.getProvider(x,D);if(!J(V))return V;if(j){if(He.setProvider(x,D,$e))return $e;throw new Error("Illegal state.")}}function Hn(){var x={},D=[],j=function(){function ee(N,H,z){this._index=0,this._keys=N,this._values=H,this._selector=z}return ee.prototype["@@iterator"]=function(){return this},ee.prototype[f]=function(){return this},ee.prototype.next=function(){var N=this._index;if(N>=0&&N<this._keys.length){var H=this._selector(this._keys[N],this._values[N]);return N+1>=this._keys.length?(this._index=-1,this._keys=D,this._values=D):this._index++,{value:H,done:!1}}return{value:void 0,done:!0}},ee.prototype.throw=function(N){throw this._index>=0&&(this._index=-1,this._keys=D,this._values=D),N},ee.prototype.return=function(N){return this._index>=0&&(this._index=-1,this._keys=D,this._values=D),{value:N,done:!0}},ee}(),V=function(){function ee(){this._keys=[],this._values=[],this._cacheKey=x,this._cacheIndex=-2}return Object.defineProperty(ee.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),ee.prototype.has=function(N){return this._find(N,!1)>=0},ee.prototype.get=function(N){var H=this._find(N,!1);return H>=0?this._values[H]:void 0},ee.prototype.set=function(N,H){var z=this._find(N,!0);return this._values[z]=H,this},ee.prototype.delete=function(N){var H=this._find(N,!1);if(H>=0){for(var z=this._keys.length,G=H+1;G<z;G++)this._keys[G-1]=this._keys[G],this._values[G-1]=this._values[G];return this._keys.length--,this._values.length--,ot(N,this._cacheKey)&&(this._cacheKey=x,this._cacheIndex=-2),!0}return!1},ee.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=x,this._cacheIndex=-2},ee.prototype.keys=function(){return new j(this._keys,this._values,L)},ee.prototype.values=function(){return new j(this._keys,this._values,me)},ee.prototype.entries=function(){return new j(this._keys,this._values,de)},ee.prototype["@@iterator"]=function(){return this.entries()},ee.prototype[f]=function(){return this.entries()},ee.prototype._find=function(N,H){if(!ot(this._cacheKey,N)){this._cacheIndex=-1;for(var z=0;z<this._keys.length;z++)if(ot(this._keys[z],N)){this._cacheIndex=z;break}}return this._cacheIndex<0&&H&&(this._cacheIndex=this._keys.length,this._keys.push(N),this._values.push(void 0)),this._cacheIndex},ee}();return V;function L(ee,N){return ee}function me(ee,N){return N}function de(ee,N){return[ee,N]}}function Xt(){var x=function(){function D(){this._map=new B}return Object.defineProperty(D.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),D.prototype.has=function(j){return this._map.has(j)},D.prototype.add=function(j){return this._map.set(j,j),this},D.prototype.delete=function(j){return this._map.delete(j)},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[f]=function(){return this.keys()},D}();return x}function zn(){var x=16,D=T.create(),j=V();return function(){function N(){this._key=V()}return N.prototype.has=function(H){var z=L(H,!1);return z!==void 0?T.has(z,this._key):!1},N.prototype.get=function(H){var z=L(H,!1);return z!==void 0?T.get(z,this._key):void 0},N.prototype.set=function(H,z){var G=L(H,!0);return G[this._key]=z,this},N.prototype.delete=function(H){var z=L(H,!1);return z!==void 0?delete z[this._key]:!1},N.prototype.clear=function(){this._key=V()},N}();function V(){var N;do N="@@WeakMap@@"+ee();while(T.has(D,N));return D[N]=!0,N}function L(N,H){if(!o.call(N,j)){if(!H)return;Object.defineProperty(N,j,{value:T.create()})}return N[j]}function me(N,H){for(var z=0;z<H;++z)N[z]=Math.random()*255|0;return N}function de(N){if(typeof Uint8Array=="function"){var H=new Uint8Array(N);return typeof crypto<"u"?crypto.getRandomValues(H):typeof msCrypto<"u"?msCrypto.getRandomValues(H):me(H,N),H}return me(new Array(N),N)}function ee(){var N=de(x);N[6]=N[6]&79|64,N[8]=N[8]&191|128;for(var H="",z=0;z<x;++z){var G=N[z];(z===4||z===6||z===8)&&(H+="-"),G<16&&(H+="0"),H+=G.toString(16).toLowerCase()}return H}}function It(x){return x.__=void 0,delete x.__,x}})})(Fa||(Fa={}));var el=Object.defineProperty,tl=Object.getOwnPropertyDescriptor,nl=(e,t,n,o)=>{for(var a=o>1?void 0:o?tl(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&el(t,n,a),a};let Ri=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}};Ri=nl([Re()],Ri);class rl{constructor(t,n,o){this.name=t,this.entryFile=n,this.staticModule=o}}var il=Object.defineProperty,ol=Object.getOwnPropertyDescriptor,al=(e,t,n,o)=>{for(var a=o>1?void 0:o?ol(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&il(t,n,a),a},sl=(e,t)=>(n,o)=>t(n,o,e);let Mi=class extends Ri{constructor(e){super(),this.remoteExtensions=new Map,this.remoteExtensionDefaultURL="/apps/",this.remoteExtensionDefaultEntryFile="main.bundle.js",this.logger=e,this.logger.setModule("extensionmanager.components.defaultExtensionManager")}addRemoteExtension(e,t,n){this.remoteExtensions.set(e,new rl(e,t,n))}setRemoteExtensionsConfig(e,t){this.remoteExtensionDefaultURL=e,this.remoteExtensionDefaultEntryFile=t}async loadExtension(e,t){var n,o,a,u,f;try{const p=this.remoteExtensions.get(e),E=p&&p.entryFile?p.entryFile:this.remoteExtensionDefaultEntryFile,g=this.remoteExtensionDefaultURL+e+"/"+E,T=this.remoteExtensionDefaultURL+e+"/style.css";(n=this.logger)==null||n.debug("Ready to import ",g);try{const B=await import(T);document.adoptedStyleSheets=[B.default]}catch{}const P=await import(g);if(P!=null){(o=this.logger)==null||o.debug("Found components Init for ",e,P);const B=P.ComponentInit;new B(t),(a=this.logger)==null||a.debug("Succesfull components Init for ",e)}else(u=this.logger)==null||u.debug("No components to load for ",e);return}catch(p){(f=this.logger)==null||f.error("Exception while loading components from ",e,p)}}async loadExtensions(e){for(const t of this.remoteExtensions.keys())await this.loadExtension(t,e)}};Mi=al([Re(),sl(0,xe("Logger"))],Mi);let ul=class{constructor(t){var n,o;this.logger=t.get("Logger"),this.logger.setModule("extensionmanager.components.componentsInit"),(n=this.logger)==null||n.debug("Init Extension Manager components begin"),t.bind("ExtensionManager").to(Mi),(o=this.logger)==null||o.debug("Init Extension Manager components end")}};/**
|
|
25
|
+
* @vue/shared v3.4.29
|
|
26
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
27
|
+
* @license MIT
|
|
28
|
+
**//*! #__NO_SIDE_EFFECTS__ */function cl(e,t){const n=new Set(e.split(","));return o=>n.has(o)}const ut=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Kt=()=>{},ll=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),nt=Object.assign,fl=Object.prototype.hasOwnProperty,Ae=(e,t)=>fl.call(e,t),ge=Array.isArray,un=e=>_r(e)==="[object Map]",hl=e=>_r(e)==="[object Set]",Ne=e=>typeof e=="function",rt=e=>typeof e=="string",kn=e=>typeof e=="symbol",Ve=e=>e!==null&&typeof e=="object",dl=e=>(Ve(e)||Ne(e))&&Ne(e.then)&&Ne(e.catch),pl=Object.prototype.toString,_r=e=>pl.call(e),Ba=e=>_r(e).slice(8,-1),gl=e=>_r(e)==="[object Object]",ki=e=>rt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,vl=(e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))})(e=>e.charAt(0).toUpperCase()+e.slice(1)),cn=(e,t)=>!Object.is(e,t),yl=(e,t,n,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})};let Ka;const Va=()=>Ka||(Ka=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ji(e){if(ge(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],a=rt(o)?wl(o):ji(o);if(a)for(const u in a)t[u]=a[u]}return t}else if(rt(e)||Ve(e))return e}const ml=/;(?![^(]*\))/g,bl=/:([^]+)/,_l=/\/\*[^]*?\*\//g;function wl(e){const t={};return e.replace(_l,"").split(ml).forEach(n=>{if(n){const o=n.split(bl);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function Li(e){let t="";if(rt(e))t=e;else if(ge(e))for(let n=0;n<e.length;n++){const o=Li(e[n]);o&&(t+=o+" ")}else if(Ve(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}/**
|
|
29
|
+
* @vue/reactivity v3.4.29
|
|
30
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
31
|
+
* @license MIT
|
|
32
|
+
**/function jn(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let El;function Sl(e,t=El){t&&t.active&&t.effects.push(e)}let Ln;class Ol{constructor(t,n,o,a){this.fn=t,this.trigger=n,this.scheduler=o,this.active=!0,this.deps=[],this._dirtyLevel=5,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,Sl(this,a)}get dirty(){if(this._dirtyLevel===2)return!1;if(this._dirtyLevel===3||this._dirtyLevel===4){this._dirtyLevel=1,wr();for(let t=0;t<this._depsLength;t++){const n=this.deps[t];if(n.computed){if(n.computed.effect._dirtyLevel===2)return!0;if(Cl(n.computed),this._dirtyLevel>=5)break}}this._dirtyLevel===1&&(this._dirtyLevel=0),Er()}return this._dirtyLevel>=5}set dirty(t){this._dirtyLevel=t?5:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let t=Vt,n=Ln;try{return Vt=!0,Ln=this,this._runnings++,$a(this),this.fn()}finally{Wa(this),this._runnings--,Ln=n,Vt=t}}stop(){this.active&&($a(this),Wa(this),this.onStop&&this.onStop(),this.active=!1)}}function Cl(e){return e.value}function $a(e){e._trackId++,e._depsLength=0}function Wa(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t<e.deps.length;t++)Ua(e.deps[t],e);e.deps.length=e._depsLength}}function Ua(e,t){const n=e.get(t);n!==void 0&&t._trackId!==n&&(e.delete(t),e.size===0&&e.cleanup())}let Vt=!0,Fi=0;const qa=[];function wr(){qa.push(Vt),Vt=!1}function Er(){const e=qa.pop();Vt=e===void 0?!0:e}function Bi(){Fi++}function Ki(){for(Fi--;!Fi&&Vi.length;)Vi.shift()()}function Al(e,t,n){var o;if(t.get(e)!==e._trackId){t.set(e,e._trackId);const a=e.deps[e._depsLength];a!==t?(a&&Ua(a,e),e.deps[e._depsLength++]=t):e._depsLength++,process.env.NODE_ENV!=="production"&&((o=e.onTrack)==null||o.call(e,nt({effect:e},n)))}}const Vi=[];function xl(e,t,n){var o;Bi();for(const a of e.keys()){if(!e.computed&&a.computed&&e.get(a)===a._trackId&&a._runnings>0){a._dirtyLevel=2;continue}let u;a._dirtyLevel<t&&(u??(u=e.get(a)===a._trackId))&&(a._shouldSchedule||(a._shouldSchedule=a._dirtyLevel===0),a.computed&&a._dirtyLevel===2&&(a._shouldSchedule=!0),a._dirtyLevel=t),a._shouldSchedule&&(u??(u=e.get(a)===a._trackId))&&(process.env.NODE_ENV!=="production"&&((o=a.onTrigger)==null||o.call(a,nt({effect:a},n))),a.trigger(),(!a._runnings||a.allowRecurse)&&a._dirtyLevel!==3&&(a._shouldSchedule=!1,a.scheduler&&Vi.push(a.scheduler)))}Ki()}const Pl=(e,t)=>{const n=new Map;return n.cleanup=e,n.computed=t,n},$i=new WeakMap,$t=Symbol(process.env.NODE_ENV!=="production"?"iterate":""),Wi=Symbol(process.env.NODE_ENV!=="production"?"Map key iterate":"");function Me(e,t,n){if(Vt&&Ln){let o=$i.get(e);o||$i.set(e,o=new Map);let a=o.get(n);a||o.set(n,a=Pl(()=>o.delete(n))),Al(Ln,a,process.env.NODE_ENV!=="production"?{target:e,type:t,key:n}:void 0)}}function St(e,t,n,o,a,u){const f=$i.get(e);if(!f)return;let p=[];if(t==="clear")p=[...f.values()];else if(n==="length"&&ge(e)){const E=Number(o);f.forEach((g,T)=>{(T==="length"||!kn(T)&&T>=E)&&p.push(g)})}else switch(n!==void 0&&p.push(f.get(n)),t){case"add":ge(e)?ki(n)&&p.push(f.get("length")):(p.push(f.get($t)),un(e)&&p.push(f.get(Wi)));break;case"delete":ge(e)||(p.push(f.get($t)),un(e)&&p.push(f.get(Wi)));break;case"set":un(e)&&p.push(f.get($t));break}Bi();for(const E of p)E&&xl(E,5,process.env.NODE_ENV!=="production"?{target:e,type:t,key:n,newValue:o,oldValue:a,oldTarget:u}:void 0);Ki()}const Tl=cl("__proto__,__v_isRef,__isVue"),Ha=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(kn)),za=Il();function Il(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const o=ce(this);for(let u=0,f=this.length;u<f;u++)Me(o,"get",u+"");const a=o[t](...n);return a===-1||a===!1?o[t](...n.map(ce)):a}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...n){wr(),Bi();const o=ce(this)[t].apply(this,n);return Ki(),Er(),o}}),e}function Dl(e){kn(e)||(e=String(e));const t=ce(this);return Me(t,"has",e),t.hasOwnProperty(e)}class Ga{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){const a=this._isReadonly,u=this._isShallow;if(n==="__v_isReactive")return!a;if(n==="__v_isReadonly")return a;if(n==="__v_isShallow")return u;if(n==="__v_raw")return o===(a?u?rs:ns:u?Ul:ts).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const f=ge(t);if(!a){if(f&&Ae(za,n))return Reflect.get(za,n,o);if(n==="hasOwnProperty")return Dl}const p=Reflect.get(t,n,o);return(kn(n)?Ha.has(n):Tl(n))||(a||Me(t,"get",n),u)?p:Ze(p)?f&&ki(n)?p:p.value:Ve(p)?a?os(p):is(p):p}}class Nl extends Ga{constructor(t=!1){super(!1,t)}set(t,n,o,a){let u=t[n];if(!this._isShallow){const E=fn(u);if(!hn(o)&&!fn(o)&&(u=ce(u),o=ce(o)),!ge(t)&&Ze(u)&&!Ze(o))return E?!1:(u.value=o,!0)}const f=ge(t)&&ki(n)?Number(n)<t.length:Ae(t,n),p=Reflect.set(t,n,o,a);return t===ce(a)&&(f?cn(o,u)&&St(t,"set",n,o,u):St(t,"add",n,o)),p}deleteProperty(t,n){const o=Ae(t,n),a=t[n],u=Reflect.deleteProperty(t,n);return u&&o&&St(t,"delete",n,void 0,a),u}has(t,n){const o=Reflect.has(t,n);return(!kn(n)||!Ha.has(n))&&Me(t,"has",n),o}ownKeys(t){return Me(t,"iterate",ge(t)?"length":$t),Reflect.ownKeys(t)}}class Ya extends Ga{constructor(t=!1){super(!0,t)}set(t,n){return process.env.NODE_ENV!=="production"&&jn(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return process.env.NODE_ENV!=="production"&&jn(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const Rl=new Nl,Ml=new Ya,kl=new Ya(!0),Ui=e=>e,Sr=e=>Reflect.getPrototypeOf(e);function Or(e,t,n=!1,o=!1){e=e.__v_raw;const a=ce(e),u=ce(t);n||(cn(t,u)&&Me(a,"get",t),Me(a,"get",u));const{has:f}=Sr(a),p=o?Ui:n?Yi:Gi;if(f.call(a,t))return p(e.get(t));if(f.call(a,u))return p(e.get(u));e!==a&&e.get(t)}function Cr(e,t=!1){const n=this.__v_raw,o=ce(n),a=ce(e);return t||(cn(e,a)&&Me(o,"has",e),Me(o,"has",a)),e===a?n.has(e):n.has(e)||n.has(a)}function Ar(e,t=!1){return e=e.__v_raw,!t&&Me(ce(e),"iterate",$t),Reflect.get(e,"size",e)}function Qa(e){e=ce(e);const t=ce(this);return Sr(t).has.call(t,e)||(t.add(e),St(t,"add",e,e)),this}function Ja(e,t){t=ce(t);const n=ce(this),{has:o,get:a}=Sr(n);let u=o.call(n,e);u?process.env.NODE_ENV!=="production"&&es(n,o,e):(e=ce(e),u=o.call(n,e));const f=a.call(n,e);return n.set(e,t),u?cn(t,f)&&St(n,"set",e,t,f):St(n,"add",e,t),this}function Xa(e){const t=ce(this),{has:n,get:o}=Sr(t);let a=n.call(t,e);a?process.env.NODE_ENV!=="production"&&es(t,n,e):(e=ce(e),a=n.call(t,e));const u=o?o.call(t,e):void 0,f=t.delete(e);return a&&St(t,"delete",e,void 0,u),f}function Za(){const e=ce(this),t=e.size!==0,n=process.env.NODE_ENV!=="production"?un(e)?new Map(e):new Set(e):void 0,o=e.clear();return t&&St(e,"clear",void 0,void 0,n),o}function xr(e,t){return function(o,a){const u=this,f=u.__v_raw,p=ce(f),E=t?Ui:e?Yi:Gi;return!e&&Me(p,"iterate",$t),f.forEach((g,T)=>o.call(a,E(g),E(T),u))}}function Pr(e,t,n){return function(...o){const a=this.__v_raw,u=ce(a),f=un(u),p=e==="entries"||e===Symbol.iterator&&f,E=e==="keys"&&f,g=a[e](...o),T=n?Ui:t?Yi:Gi;return!t&&Me(u,"iterate",E?Wi:$t),{next(){const{value:P,done:B}=g.next();return B?{value:P,done:B}:{value:p?[T(P[0]),T(P[1])]:T(P),done:B}},[Symbol.iterator](){return this}}}}function Ot(e){return function(...t){if(process.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";jn(`${vl(e)} operation ${n}failed: target is readonly.`,ce(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function jl(){const e={get(u){return Or(this,u)},get size(){return Ar(this)},has:Cr,add:Qa,set:Ja,delete:Xa,clear:Za,forEach:xr(!1,!1)},t={get(u){return Or(this,u,!1,!0)},get size(){return Ar(this)},has:Cr,add:Qa,set:Ja,delete:Xa,clear:Za,forEach:xr(!1,!0)},n={get(u){return Or(this,u,!0)},get size(){return Ar(this,!0)},has(u){return Cr.call(this,u,!0)},add:Ot("add"),set:Ot("set"),delete:Ot("delete"),clear:Ot("clear"),forEach:xr(!0,!1)},o={get(u){return Or(this,u,!0,!0)},get size(){return Ar(this,!0)},has(u){return Cr.call(this,u,!0)},add:Ot("add"),set:Ot("set"),delete:Ot("delete"),clear:Ot("clear"),forEach:xr(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(u=>{e[u]=Pr(u,!1,!1),n[u]=Pr(u,!0,!1),t[u]=Pr(u,!1,!0),o[u]=Pr(u,!0,!0)}),[e,n,t,o]}const[Ll,Fl,Bl,Kl]=jl();function qi(e,t){const n=t?e?Kl:Bl:e?Fl:Ll;return(o,a,u)=>a==="__v_isReactive"?!e:a==="__v_isReadonly"?e:a==="__v_raw"?o:Reflect.get(Ae(n,a)&&a in o?n:o,a,u)}const Vl={get:qi(!1,!1)},$l={get:qi(!0,!1)},Wl={get:qi(!0,!0)};function es(e,t,n){const o=ce(n);if(o!==n&&t.call(e,o)){const a=Ba(e);jn(`Reactive ${a} contains both the raw and reactive versions of the same object${a==="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 ts=new WeakMap,Ul=new WeakMap,ns=new WeakMap,rs=new WeakMap;function ql(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Hl(e){return e.__v_skip||!Object.isExtensible(e)?0:ql(Ba(e))}function is(e){return fn(e)?e:Hi(e,!1,Rl,Vl,ts)}function os(e){return Hi(e,!0,Ml,$l,ns)}function Tr(e){return Hi(e,!0,kl,Wl,rs)}function Hi(e,t,n,o,a){if(!Ve(e))return process.env.NODE_ENV!=="production"&&jn(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const u=a.get(e);if(u)return u;const f=Hl(e);if(f===0)return e;const p=new Proxy(e,f===2?o:n);return a.set(e,p),p}function ln(e){return fn(e)?ln(e.__v_raw):!!(e&&e.__v_isReactive)}function fn(e){return!!(e&&e.__v_isReadonly)}function hn(e){return!!(e&&e.__v_isShallow)}function zi(e){return e?!!e.__v_raw:!1}function ce(e){const t=e&&e.__v_raw;return t?ce(t):e}function zl(e){return Object.isExtensible(e)&&yl(e,"__v_skip",!0),e}const Gi=e=>Ve(e)?is(e):e,Yi=e=>Ve(e)?os(e):e;function Ze(e){return!!(e&&e.__v_isRef===!0)}function Gl(e){return Ze(e)?e.value:e}const Yl={get:(e,t,n)=>Gl(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const a=e[t];return Ze(a)&&!Ze(n)?(a.value=n,!0):Reflect.set(e,t,n,o)}};function Ql(e){return ln(e)?e:new Proxy(e,Yl)}/**
|
|
33
|
+
* @vue/runtime-core v3.4.29
|
|
34
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
35
|
+
* @license MIT
|
|
36
|
+
**/const Wt=[];function Jl(e){Wt.push(e)}function Xl(){Wt.pop()}function _e(e,...t){wr();const n=Wt.length?Wt[Wt.length-1].component:null,o=n&&n.appContext.config.warnHandler,a=Zl();if(o)Ut(o,n,11,[e+t.map(u=>{var f,p;return(p=(f=u.toString)==null?void 0:f.call(u))!=null?p:JSON.stringify(u)}).join(""),n&&n.proxy,a.map(({vnode:u})=>`at <${Ts(n,u.type)}>`).join(`
|
|
37
|
+
`),a]);else{const u=[`[Vue warn]: ${e}`,...t];a.length&&u.push(`
|
|
38
|
+
`,...ef(a)),console.warn(...u)}Er()}function Zl(){let e=Wt[Wt.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const o=e.component&&e.component.parent;e=o&&o.vnode}return t}function ef(e){const t=[];return e.forEach((n,o)=>{t.push(...o===0?[]:[`
|
|
39
|
+
`],...tf(n))}),t}function tf({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",o=e.component?e.component.parent==null:!1,a=` at <${Ts(e.component,e.type,o)}`,u=">"+n;return e.props?[a,...nf(e.props),u]:[a+u]}function nf(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(o=>{t.push(...as(o,e[o]))}),n.length>3&&t.push(" ..."),t}function as(e,t,n){return rt(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:Ze(t)?(t=as(e,ce(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):Ne(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=ce(t),n?t:[`${e}=`,t])}const ss={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. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."};function Ut(e,t,n,o){try{return o?e(...o):e()}catch(a){Qi(a,t,n)}}function Ir(e,t,n,o){if(Ne(e)){const a=Ut(e,t,n,o);return a&&dl(a)&&a.catch(u=>{Qi(u,t,n)}),a}if(ge(e)){const a=[];for(let u=0;u<e.length;u++)a.push(Ir(e[u],t,n,o));return a}else process.env.NODE_ENV!=="production"&&_e(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function Qi(e,t,n,o=!0){const a=t?t.vnode:null;if(t){let u=t.parent;const f=t.proxy,p=process.env.NODE_ENV!=="production"?ss[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;u;){const g=u.ec;if(g){for(let T=0;T<g.length;T++)if(g[T](e,f,p)===!1)return}u=u.parent}const E=t.appContext.config.errorHandler;if(E){wr(),Ut(E,null,10,[e,f,p]),Er();return}}rf(e,n,a,o)}function rf(e,t,n,o=!0){if(process.env.NODE_ENV!=="production"){const a=ss[t];if(n&&Jl(n),_e(`Unhandled error${a?` during execution of ${a}`:""}`),n&&Xl(),o)throw e;console.error(e)}else console.error(e)}let Dr=!1,Ji=!1;const it=[];let Ct=0;const dn=[];let At=null,qt=0;const us=Promise.resolve();let Xi=null;const of=100;function af(e){const t=Xi||us;return e?t.then(this?e.bind(this):e):t}function sf(e){let t=Ct+1,n=it.length;for(;t<n;){const o=t+n>>>1,a=it[o],u=Fn(a);u<e||u===e&&a.pre?t=o+1:n=o}return t}function Zi(e){(!it.length||!it.includes(e,Dr&&e.allowRecurse?Ct+1:Ct))&&(e.id==null?it.push(e):it.splice(sf(e.id),0,e),cs())}function cs(){!Dr&&!Ji&&(Ji=!0,Xi=us.then(fs))}function ls(e){ge(e)?dn.push(...e):(!At||!At.includes(e,e.allowRecurse?qt+1:qt))&&dn.push(e),cs()}function uf(e){if(dn.length){const t=[...new Set(dn)].sort((n,o)=>Fn(n)-Fn(o));if(dn.length=0,At){At.push(...t);return}for(At=t,process.env.NODE_ENV!=="production"&&(e=e||new Map),qt=0;qt<At.length;qt++){const n=At[qt];process.env.NODE_ENV!=="production"&&hs(e,n)||n.active!==!1&&n()}At=null,qt=0}}const Fn=e=>e.id==null?1/0:e.id,cf=(e,t)=>{const n=Fn(e)-Fn(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function fs(e){Ji=!1,Dr=!0,process.env.NODE_ENV!=="production"&&(e=e||new Map),it.sort(cf);const t=process.env.NODE_ENV!=="production"?n=>hs(e,n):Kt;try{for(Ct=0;Ct<it.length;Ct++){const n=it[Ct];if(n&&n.active!==!1){if(process.env.NODE_ENV!=="production"&&t(n))continue;Ut(n,null,14)}}}finally{Ct=0,it.length=0,uf(e),Dr=!1,Xi=null,(it.length||dn.length)&&fs(e)}}function hs(e,t){if(!e.has(t))e.set(t,1);else{const n=e.get(t);if(n>of){const o=t.ownerInstance,a=o&&Ps(o.type);return Qi(`Maximum recursive updates exceeded${a?` in component <${a}>`:""}. 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}else e.set(t,n+1)}}const pn=new Set;process.env.NODE_ENV!=="production"&&(Va().__VUE_HMR_RUNTIME__={createRecord:eo(lf),rerender:eo(ff),reload:eo(hf)});const Nr=new Map;function lf(e,t){return Nr.has(e)?!1:(Nr.set(e,{initialDef:Bn(t),instances:new Set}),!0)}function Bn(e){return Is(e)?e.__vccOpts:e}function ff(e,t){const n=Nr.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(o=>{t&&(o.render=t,Bn(o.type).render=t),o.renderCache=[],o.effect.dirty=!0,o.update()}))}function hf(e,t){const n=Nr.get(e);if(!n)return;t=Bn(t),ds(n.initialDef,t);const o=[...n.instances];for(const a of o){const u=Bn(a.type);pn.has(u)||(u!==n.initialDef&&ds(u,t),pn.add(u)),a.appContext.propsCache.delete(a.type),a.appContext.emitsCache.delete(a.type),a.appContext.optionsCache.delete(a.type),a.ceReload?(pn.add(u),a.ceReload(t.styles),pn.delete(u)):a.parent?(a.parent.effect.dirty=!0,Zi(()=>{a.parent.update(),pn.delete(u)})):a.appContext.reload?a.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")}ls(()=>{for(const a of o)pn.delete(Bn(a.type))})}function ds(e,t){nt(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function eo(e){return(t,n)=>{try{return e(t,n)}catch(o){console.error(o),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let gn,Rr=[];function ps(e,t){var n,o;gn=e,gn?(gn.enabled=!0,Rr.forEach(({event:a,args:u})=>gn.emit(a,...u)),Rr=[]):typeof window<"u"&&window.HTMLElement&&!((o=(n=window.navigator)==null?void 0:n.userAgent)!=null&&o.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(u=>{ps(u,t)}),setTimeout(()=>{gn||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Rr=[])},3e3)):Rr=[]}let vt=null,df=null;function bd(){}const pf=Symbol.for("v-ndc"),gf=e=>e.__isSuspense;function vf(e,t){t&&t.pendingBranch?ge(e)?t.effects.push(...e):t.effects.push(e):ls(e)}const to=e=>e?$f(e)?Wf(e):to(e.parent):null,Kn=nt(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>process.env.NODE_ENV!=="production"?Tr(e.props):e.props,$attrs:e=>process.env.NODE_ENV!=="production"?Tr(e.attrs):e.attrs,$slots:e=>process.env.NODE_ENV!=="production"?Tr(e.slots):e.slots,$refs:e=>process.env.NODE_ENV!=="production"?Tr(e.refs):e.refs,$parent:e=>to(e.parent),$root:e=>to(e.root),$emit:e=>e.emit,$options:e=>__VUE_OPTIONS_API__?_f(e):e.type,$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,Zi(e.update)}),$nextTick:e=>e.n||(e.n=af.bind(e.proxy)),$watch:e=>__VUE_OPTIONS_API__?Tf.bind(e):Kt}),yf=e=>e==="_"||e==="$",no=(e,t)=>e!==ut&&!e.__isScriptSetup&&Ae(e,t),mf={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:a,props:u,accessCache:f,type:p,appContext:E}=e;if(process.env.NODE_ENV!=="production"&&t==="__isVue")return!0;let g;if(t[0]!=="$"){const Q=f[t];if(Q!==void 0)switch(Q){case 1:return o[t];case 2:return a[t];case 4:return n[t];case 3:return u[t]}else{if(no(o,t))return f[t]=1,o[t];if(a!==ut&&Ae(a,t))return f[t]=2,a[t];if((g=e.propsOptions[0])&&Ae(g,t))return f[t]=3,u[t];if(n!==ut&&Ae(n,t))return f[t]=4,n[t];(!__VUE_OPTIONS_API__||bf)&&(f[t]=0)}}const T=Kn[t];let P,B;if(T)return t==="$attrs"?(Me(e.attrs,"get",""),process.env.NODE_ENV!=="production"&&void 0):process.env.NODE_ENV!=="production"&&t==="$slots"&&Me(e,"get",t),T(e);if((P=p.__cssModules)&&(P=P[t]))return P;if(n!==ut&&Ae(n,t))return f[t]=4,n[t];if(B=E.config.globalProperties,Ae(B,t))return B[t];process.env.NODE_ENV!=="production"&&vt&&(!rt(t)||t.indexOf("__v")!==0)&&(a!==ut&&yf(t[0])&&Ae(a,t)?_e(`Property ${JSON.stringify(t)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`):e===vt&&_e(`Property ${JSON.stringify(t)} was accessed during render but is not defined on instance.`))},set({_:e},t,n){const{data:o,setupState:a,ctx:u}=e;return no(a,t)?(a[t]=n,!0):process.env.NODE_ENV!=="production"&&a.__isScriptSetup&&Ae(a,t)?(_e(`Cannot mutate <script setup> binding "${t}" from Options API.`),!1):o!==ut&&Ae(o,t)?(o[t]=n,!0):Ae(e.props,t)?(process.env.NODE_ENV!=="production"&&_e(`Attempting to mutate prop "${t}". Props are readonly.`),!1):t[0]==="$"&&t.slice(1)in e?(process.env.NODE_ENV!=="production"&&_e(`Attempting to mutate public property "${t}". Properties starting with $ are reserved and readonly.`),!1):(process.env.NODE_ENV!=="production"&&t in e.appContext.config.globalProperties?Object.defineProperty(u,t,{enumerable:!0,configurable:!0,value:n}):u[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:a,propsOptions:u}},f){let p;return!!n[f]||e!==ut&&Ae(e,f)||no(t,f)||(p=u[0])&&Ae(p,f)||Ae(o,f)||Ae(Kn,f)||Ae(a.config.globalProperties,f)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Ae(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};process.env.NODE_ENV!=="production"&&(mf.ownKeys=e=>(_e("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));function gs(e){return ge(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let bf=!0;function _f(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:a,optionsCache:u,config:{optionMergeStrategies:f}}=e.appContext,p=u.get(t);let E;return p?E=p:!a.length&&!n&&!o?E=t:(E={},a.length&&a.forEach(g=>Mr(E,g,f,!0)),Mr(E,t,f)),Ve(t)&&u.set(t,E),E}function Mr(e,t,n,o=!1){const{mixins:a,extends:u}=t;u&&Mr(e,u,n,!0),a&&a.forEach(f=>Mr(e,f,n,!0));for(const f in t)if(o&&f==="expose")process.env.NODE_ENV!=="production"&&_e('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const p=wf[f]||n&&n[f];e[f]=p?p(e[f],t[f]):t[f]}return e}const wf={data:vs,props:ms,emits:ms,methods:Vn,computed:Vn,beforeCreate:Fe,created:Fe,beforeMount:Fe,mounted:Fe,beforeUpdate:Fe,updated:Fe,beforeDestroy:Fe,beforeUnmount:Fe,destroyed:Fe,unmounted:Fe,activated:Fe,deactivated:Fe,errorCaptured:Fe,serverPrefetch:Fe,components:Vn,directives:Vn,watch:Sf,provide:vs,inject:Ef};function vs(e,t){return t?e?function(){return nt(Ne(e)?e.call(this,this):e,Ne(t)?t.call(this,this):t)}:t:e}function Ef(e,t){return Vn(ys(e),ys(t))}function ys(e){if(ge(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Fe(e,t){return e?[...new Set([].concat(e,t))]:t}function Vn(e,t){return e?nt(Object.create(null),e,t):t}function ms(e,t){return e?ge(e)&&ge(t)?[...new Set([...e,...t])]:nt(Object.create(null),gs(e),gs(t??{})):t}function Sf(e,t){if(!e)return t;if(!t)return e;const n=nt(Object.create(null),e);for(const o in t)n[o]=Fe(e[o],t[o]);return n}let bs=null;function Of(e,t,n=!1){const o=Fr||vt;if(o||bs){const a=o?o.parent==null?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:bs._context.provides;if(a&&e in a)return a[e];if(arguments.length>1)return n&&Ne(t)?t.call(o&&o.proxy):t;process.env.NODE_ENV!=="production"&&_e(`injection "${String(e)}" not found.`)}else process.env.NODE_ENV!=="production"&&_e("inject() can only be used inside setup() or functional components.")}const Cf={},_s=e=>Object.getPrototypeOf(e)===Cf,ws=vf,Af=Symbol.for("v-scx"),xf=()=>{{const e=Of(Af);return e||process.env.NODE_ENV!=="production"&&_e("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}},kr={};function Pf(e,t,{immediate:n,deep:o,flush:a,once:u,onTrack:f,onTrigger:p}=ut){if(t&&u){const ne=t;t=(...Pe)=>{ne(...Pe),xt()}}process.env.NODE_ENV!=="production"&&o!==void 0&&typeof o=="number"&&_e('watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.'),process.env.NODE_ENV!=="production"&&!t&&(n!==void 0&&_e('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),o!==void 0&&_e('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),u!==void 0&&_e('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const E=ne=>{_e("Invalid watch source: ",ne,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},g=Fr,T=ne=>o===!0?ne:Ht(ne,o===!1?1:void 0);let P,B=!1,Q=!1;if(Ze(e)?(P=()=>e.value,B=hn(e)):ln(e)?(P=()=>T(e),B=!0):ge(e)?(Q=!0,B=e.some(ne=>ln(ne)||hn(ne)),P=()=>e.map(ne=>{if(Ze(ne))return ne.value;if(ln(ne))return T(ne);if(Ne(ne))return Ut(ne,g,2);process.env.NODE_ENV!=="production"&&E(ne)})):Ne(e)?t?P=()=>Ut(e,g,2):P=()=>(Z&&Z(),Ir(e,g,3,[fe])):(P=Kt,process.env.NODE_ENV!=="production"&&E(e)),t&&o){const ne=P;P=()=>Ht(ne())}let Z,fe=ne=>{Z=Se.onStop=()=>{Ut(ne,g,4),Z=Se.onStop=void 0}},He;if(xs)if(fe=Kt,t?n&&Ir(t,g,3,[P(),Q?[]:void 0,fe]):P(),a==="sync"){const ne=xf();He=ne.__watcherHandles||(ne.__watcherHandles=[])}else return Kt;let $e=Q?new Array(e.length).fill(kr):kr;const We=()=>{if(!(!Se.active||!Se.dirty))if(t){const ne=Se.run();(o||B||(Q?ne.some((Pe,mn)=>cn(Pe,$e[mn])):cn(ne,$e)))&&(Z&&Z(),Ir(t,g,3,[ne,$e===kr?void 0:Q&&$e[0]===kr?[]:$e,fe]),$e=ne)}else Se.run()};We.allowRecurse=!!t;let yt;a==="sync"?yt=We:a==="post"?yt=()=>ws(We,g&&g.suspense):(We.pre=!0,g&&(We.id=g.uid),yt=()=>Zi(We));const Se=new Ol(P,Kt,yt),xt=()=>{Se.stop()};return process.env.NODE_ENV!=="production"&&(Se.onTrack=f,Se.onTrigger=p),t?n?We():$e=Se.run():a==="post"?ws(Se.run.bind(Se),g&&g.suspense):Se.run(),He&&He.push(xt),xt}function Tf(e,t,n){const o=this.proxy,a=rt(e)?e.includes(".")?If(o,e):()=>o[e]:e.bind(o,o);let u;Ne(t)?u=t:(u=t.handler,n=t);const f=Vf(this),p=Pf(a,u.bind(o),n);return f(),p}function If(e,t){const n=t.split(".");return()=>{let o=e;for(let a=0;a<n.length&&o;a++)o=o[n[a]];return o}}function Ht(e,t=1/0,n){if(t<=0||!Ve(e)||e.__v_skip||(n=n||new Set,n.has(e)))return e;if(n.add(e),t--,Ze(e))Ht(e.value,t,n);else if(ge(e))for(let o=0;o<e.length;o++)Ht(e[o],t,n);else if(hl(e)||un(e))e.forEach(o=>{Ht(o,t,n)});else if(gl(e)){for(const o in e)Ht(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&Ht(e[o],t,n)}return e}function Es(e,t){e.shapeFlag&6&&e.component?Es(e.component.subTree,t):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}const Df=e=>e.__isTeleport,Ss=Symbol.for("v-fgt"),Nf=Symbol.for("v-txt"),Rf=Symbol.for("v-cmt");let vn=null;function Mf(e){return e?e.__v_isVNode===!0:!1}const kf=(...e)=>Cs(...e),Os=({key:e})=>e??null,jr=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?rt(e)||Ze(e)||Ne(e)?{i:vt,r:e,k:t,f:!!n}:e:null);function jf(e,t=null,n=null,o=0,a=null,u=e===Ss?0:1,f=!1,p=!1){const E={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Os(t),ref:t&&jr(t),scopeId:df,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:u,patchFlag:o,dynamicProps:a,dynamicChildren:null,appContext:null,ctx:vt};return p?(ro(E,n),u&128&&e.normalize(E)):n&&(E.shapeFlag|=rt(n)?8:16),process.env.NODE_ENV!=="production"&&E.key!==E.key&&_e("VNode created with invalid key (NaN). VNode type:",E.type),!f&&vn&&(E.patchFlag>0||u&6)&&E.patchFlag!==32&&vn.push(E),E}const Lf=process.env.NODE_ENV!=="production"?kf:Cs;function Cs(e,t=null,n=null,o=0,a=null,u=!1){if((!e||e===pf)&&(process.env.NODE_ENV!=="production"&&!e&&_e(`Invalid vnode type when creating vnode: ${e}.`),e=Rf),Mf(e)){const p=Lr(e,t,!0);return n&&ro(p,n),!u&&vn&&(p.shapeFlag&6?vn[vn.indexOf(e)]=p:vn.push(p)),p.patchFlag=-2,p}if(Is(e)&&(e=e.__vccOpts),t){t=Ff(t);let{class:p,style:E}=t;p&&!rt(p)&&(t.class=Li(p)),Ve(E)&&(zi(E)&&!ge(E)&&(E=nt({},E)),t.style=ji(E))}const f=rt(e)?1:gf(e)?128:Df(e)?64:Ve(e)?4:Ne(e)?2:0;return process.env.NODE_ENV!=="production"&&f&4&&zi(e)&&(e=ce(e),_e("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
|
|
40
|
+
Component that was made reactive: `,e)),jf(e,t,n,o,a,f,u,!0)}function Ff(e){return e?zi(e)||_s(e)?nt({},e):e:null}function Lr(e,t,n=!1,o=!1){const{props:a,ref:u,patchFlag:f,children:p,transition:E}=e,g=t?Kf(a||{},t):a,T={__v_isVNode:!0,__v_skip:!0,type:e.type,props:g,key:g&&Os(g),ref:t&&t.ref?n&&u?ge(u)?u.concat(jr(t)):[u,jr(t)]:jr(t):u,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&f===-1&&ge(p)?p.map(As):p,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ss?f===-1?16:f|16:f,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:E,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Lr(e.ssContent),ssFallback:e.ssFallback&&Lr(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return E&&o&&Es(T,E.clone(T)),T}function As(e){const t=Lr(e);return ge(e.children)&&(t.children=e.children.map(As)),t}function Bf(e=" ",t=0){return Lf(Nf,null,e,t)}function ro(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(ge(t))n=16;else if(typeof t=="object")if(o&65){const a=t.default;a&&(a._c&&(a._d=!1),ro(e,a()),a._c&&(a._d=!0));return}else{n=32;const a=t._;!a&&!_s(t)?t._ctx=vt:a===3&&vt&&(vt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Ne(t)?(t={default:t,_ctx:vt},n=32):(t=String(t),o&64?(n=16,t=[Bf(t)]):n=8);e.children=t,e.shapeFlag|=n}function Kf(...e){const t={};for(let n=0;n<e.length;n++){const o=e[n];for(const a in o)if(a==="class")t.class!==o.class&&(t.class=Li([t.class,o.class]));else if(a==="style")t.style=ji([t.style,o.style]);else if(ll(a)){const u=t[a],f=o[a];f&&u!==f&&!(ge(u)&&u.includes(f))&&(t[a]=u?[].concat(u,f):f)}else a!==""&&(t[a]=o[a])}return t}let Fr=null,io;{const e=Va(),t=(n,o)=>{let a;return(a=e[n])||(a=e[n]=[]),a.push(o),u=>{a.length>1?a.forEach(f=>f(u)):a[0](u)}};io=t("__VUE_INSTANCE_SETTERS__",n=>Fr=n),t("__VUE_SSR_SETTERS__",n=>xs=n)}const Vf=e=>{const t=Fr;return io(e),e.scope.on(),()=>{e.scope.off(),io(t)}};function $f(e){return e.vnode.shapeFlag&4}let xs=!1;process.env.NODE_ENV;function Wf(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Ql(zl(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Kn)return Kn[n](e)},has(t,n){return n in t||n in Kn}})):e.proxy}const Uf=/(?:^|[-_])(\w)/g,qf=e=>e.replace(Uf,t=>t.toUpperCase()).replace(/[-_]/g,"");function Ps(e,t=!0){return Ne(e)?e.displayName||e.name:e.name||t&&e.__name}function Ts(e,t,n=!1){let o=Ps(t);if(!o&&t.__file){const a=t.__file.match(/([^/\\]+)\.\w+$/);a&&(o=a[1])}if(!o&&e&&e.parent){const a=u=>{for(const f in u)if(u[f]===t)return f};o=a(e.components||e.parent.type.components)||a(e.appContext.components)}return o?qf(o):n?"App":"Anonymous"}function Is(e){return Ne(e)&&"__vccOpts"in e}function Hf(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},n={style:"color:#f5222d"},o={style:"color:#eb2f96"},a={header(P){return Ve(P)?P.__isVue?["div",e,"VueInstance"]:Ze(P)?["div",{},["span",e,T(P)],"<",p(P.value),">"]:ln(P)?["div",{},["span",e,hn(P)?"ShallowReactive":"Reactive"],"<",p(P),`>${fn(P)?" (readonly)":""}`]:fn(P)?["div",{},["span",e,hn(P)?"ShallowReadonly":"Readonly"],"<",p(P),">"]:null:null},hasBody(P){return P&&P.__isVue},body(P){if(P&&P.__isVue)return["div",{},...u(P.$)]}};function u(P){const B=[];P.type.props&&P.props&&B.push(f("props",ce(P.props))),P.setupState!==ut&&B.push(f("setup",P.setupState)),P.data!==ut&&B.push(f("data",ce(P.data)));const Q=E(P,"computed");Q&&B.push(f("computed",Q));const Z=E(P,"inject");return Z&&B.push(f("injected",Z)),B.push(["div",{},["span",{style:o.style+";opacity:0.66"},"$ (internal): "],["object",{object:P}]]),B}function f(P,B){return B=nt({},B),Object.keys(B).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},P],["div",{style:"padding-left:1.25em"},...Object.keys(B).map(Q=>["div",{},["span",o,Q+": "],p(B[Q],!1)])]]:["span",{}]}function p(P,B=!0){return typeof P=="number"?["span",t,P]:typeof P=="string"?["span",n,JSON.stringify(P)]:typeof P=="boolean"?["span",o,P]:Ve(P)?["object",{object:B?ce(P):P}]:["span",n,String(P)]}function E(P,B){const Q=P.type;if(Ne(Q))return;const Z={};for(const fe in P.ctx)g(Q,fe,B)&&(Z[fe]=P.ctx[fe]);return Z}function g(P,B,Q){const Z=P[Q];if(ge(Z)&&Z.includes(B)||Ve(Z)&&B in Z||P.extends&&g(P.extends,B,Q)||P.mixins&&P.mixins.some(fe=>g(fe,B,Q)))return!0}function T(P){return hn(P)?"ShallowRef":P.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(a):window.devtoolsFormatters=[a]}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;/**
|
|
41
|
+
* vue v3.4.29
|
|
42
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
43
|
+
* @license MIT
|
|
44
|
+
**/function zf(){Hf()}process.env.NODE_ENV!=="production"&&zf();class oo{constructor(t){this.jsonld=t}getIdentifier(){return this.jsonld.identifier}setIdentifier(t){this.jsonld.identifier=t}getName(){return this.jsonld.name}setName(t){this.jsonld.name=t}getText(){return this.jsonld.text}setText(t){this.jsonld.text=t}get(t){return this.jsonld[t]}set(t,n){this.jsonld[t]=n}getSource(){return this.jsonld}}class yn{constructor(t="",n="",o="",a=""){this.document=new oo({}),this.source=o,this.syntax=a,this.html="",this.name=n,this.id=t,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(t){this.id=t.id,this.name=t.name,this.source=t.source,this.syntax=t.syntax,this.html=t.html,this.document=new oo(t.document),this.css=t.css,this.js=t.js,this.version=t.version}}var Gf=Object.defineProperty,Yf=Object.getOwnPropertyDescriptor,Qf=(e,t,n,o)=>{for(var a=o>1?void 0:o?Yf(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&Gf(t,n,a),a},Jf=(e,t)=>(n,o)=>t(n,o,e);let $n=class{constructor(e){this.logger=e,this.logger.setModule("storage.components.defaultWikiStorage"),this.offlineSetup=!1}setConfig(e,t,n,o,a,u,f){this.name=e,this.baseURL=t,this.baseRestURL=n,this.homePage=o,this.serverRendering=a,this.designSystem=u,this.offline=f}setConfigFromObject(e){this.name=e.name,this.baseURL=e.baseURL,this.baseRestURL=e.baseRestURL,this.homePage=e.homePage,this.serverRendering=e.serverRendering,this.offline=e.offline,this.designSystem=e.designSystem}setupOfflineStorage(){if(this.logger.debug("Checking offline storage"),this.offline&&this.cristal){this.logger.debug("Looking for wrapping offline storage");const e=this.cristal.getContainer().get("WrappingStorage");e?(this.logger.debug("Offline local storage is ready"),e.setStorage(this.storage),e.setWikiConfig(this.storage.getWikiConfig()),this.storage=e):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(e){return e=="html"}initialize(){this.offline&&!this.offlineSetup&&(this.setupOfflineStorage(),this.offlineSetup=!0,this.storage.isStorageReady())}defaultPageName(){return"index"}getType(){return"Default"}};$n=Qf([Re(),Jf(0,xe("Logger"))],$n);var Xf=Object.defineProperty,Zf=Object.getOwnPropertyDescriptor,Ds=(e,t,n,o)=>{for(var a=o>1?void 0:o?Zf(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&Xf(t,n,a),a};let Wn=class{setModule(e){this.module=e}debug(...e){(!this.loggerConfig||this.loggerConfig.hasLevelId(this.module,4))&&e.unshift(this.module+":"),console.debug.apply(null,e)}info(...e){e.unshift(this.module+":"),console.info.apply(null,e)}warn(...e){e.unshift(this.module+":"),console.warn.apply(null,e)}error(...e){e.unshift(this.module+":"),console.error.apply(null,e)}};Ds([xe("LoggerConfig")],Wn.prototype,"loggerConfig",2),Wn=Ds([Re()],Wn);var eh=Object.defineProperty,th=Object.getOwnPropertyDescriptor,nh=(e,t,n,o)=>{for(var a=o>1?void 0:o?th(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&eh(t,n,a),a};let ao=class{constructor(e="error"){this.levels=new Map,this.config=new Map,this.defaultLevel=e,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(e,t){const n=this.levels.get(t);n!=null&&this.config.forEach(o=>{if(o.startsWith(e)){const a=this.computedConfig.get(o);(a==null||n&&n>a)&&n&&this.computedConfig.set(o,n)}})}getLevels(){return this.config}getLevel(e){let t=this.config.get(e);return t||(t=this.defaultLevel),t}getLevelId(e){const t=this.levels.get(e);return t||10}setDefaultLevel(e){this.defaultLevel=e,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(e,t){let n=this.computedConfig.get(e);n||(n=this.getDefaultLevelId());const o=this.getLevelId(t);return!!(o&&n>=o)}hasLevelId(e,t){let n=this.computedConfig.get(e);n||(n=this.getDefaultLevelId());const o=t;return!!(o&&n>=o)}};ao=nh([Re()],ao);class rh{constructor(t){this.extensionList=t}getLogger(t){let n=this.container.get("Logger");return n||(n=new Wn),n.setModule(t),n}async loadExtensionManager(t){var a,u,f,p,E,g;const n="extension-manager",o="/apps/"+n+"/main.bundle.dev.js";try{if(t)(a=this.logger)==null||a.debug("Loading static extension Manager"),new ul(this.container);else{(u=this.logger)==null||u.debug("Dynamic extension Manager. Ready to import ",o);const T=await import(o);if(T!=null){(f=this.logger)==null||f.debug("Found components Init for ",n,T);const P=T.ComponentInit;new P(this.container),(p=this.logger)==null||p.debug("Succesfull components Init for ",n)}else(E=this.logger)==null||E.debug("No components to load for ",n)}}catch(T){(g=this.logger)==null||g.error("Exception while loading extension Manager from ",o,T)}}async loadExtensions(t,n){var a,u,f,p;(a=this.logger)==null||a.debug("Start app"),await this.loadExtensionManager(t);const o=this.container.get("ExtensionManager");if((u=this.logger)==null||u.debug("Extension Manager is ",o),o!=null){if(!n){o.setRemoteExtensionsConfig("/apps/","main.bundle.dev.js");for(const E in this.extensionList)o.addRemoteExtension(E,"",!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 qc,this.container.bind("LoggerConfig").to(ao).inSingletonScope(),this.container.bind("Logger").to(Wn);const t=this.container.get("LoggerConfig");t&&t.setDefaultLevel("debug"),this.logger=this.getLogger("index.ts"),(n=this.logger)==null||n.info("Logging initialized")}getConfigFromPathName(t){let n="";if(t.startsWith("/")){const o=t.indexOf("/",1);o!=-1&&(n=t.substring(1,o))}return(n==null||n=="")&&(n="XWiki"),n}}var Ns={exports:{}};(function(e,t){(function(n,o){e.exports=o()})(br,function(){var n=function(r,i){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,c){s.__proto__=c}||function(s,c){for(var l in c)Object.prototype.hasOwnProperty.call(c,l)&&(s[l]=c[l])})(r,i)},o=function(){return(o=Object.assign||function(r){for(var i,s=1,c=arguments.length;s<c;s++)for(var l in i=arguments[s])Object.prototype.hasOwnProperty.call(i,l)&&(r[l]=i[l]);return r}).apply(this,arguments)};function a(r,i,s){for(var c,l=0,h=i.length;l<h;l++)!c&&l in i||((c=c||Array.prototype.slice.call(i,0,l))[l]=i[l]);return r.concat(c||Array.prototype.slice.call(i))}var u=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:br,f=Object.keys,p=Array.isArray;function E(r,i){return typeof i!="object"||f(i).forEach(function(s){r[s]=i[s]}),r}typeof Promise>"u"||u.Promise||(u.Promise=Promise);var g=Object.getPrototypeOf,T={}.hasOwnProperty;function P(r,i){return T.call(r,i)}function B(r,i){typeof i=="function"&&(i=i(g(r))),(typeof Reflect>"u"?f:Reflect.ownKeys)(i).forEach(function(s){Z(r,s,i[s])})}var Q=Object.defineProperty;function Z(r,i,s,c){Q(r,i,E(s&&P(s,"get")&&typeof s.get=="function"?{get:s.get,set:s.set,configurable:!0}:{value:s,configurable:!0,writable:!0},c))}function fe(r){return{from:function(i){return r.prototype=Object.create(i.prototype),Z(r.prototype,"constructor",r),{extend:B.bind(null,r.prototype)}}}}var He=Object.getOwnPropertyDescriptor,$e=[].slice;function We(r,i,s){return $e.call(r,i,s)}function yt(r,i){return i(r)}function Se(r){if(!r)throw new Error("Assertion Failed")}function xt(r){u.setImmediate?setImmediate(r):setTimeout(r,0)}function ne(r,i){if(typeof i=="string"&&P(r,i))return r[i];if(!i)return r;if(typeof i!="string"){for(var s=[],c=0,l=i.length;c<l;++c){var h=ne(r,i[c]);s.push(h)}return s}var d=i.indexOf(".");if(d!==-1){var v=r[i.substr(0,d)];return v==null?void 0:ne(v,i.substr(d+1))}}function Pe(r,i,s){if(r&&i!==void 0&&!("isFrozen"in Object&&Object.isFrozen(r)))if(typeof i!="string"&&"length"in i){Se(typeof s!="string"&&"length"in s);for(var c=0,l=i.length;c<l;++c)Pe(r,i[c],s[c])}else{var h,d,v=i.indexOf(".");v!==-1?(h=i.substr(0,v),(d=i.substr(v+1))===""?s===void 0?p(r)&&!isNaN(parseInt(h))?r.splice(h,1):delete r[h]:r[h]=s:Pe(v=!(v=r[h])||!P(r,h)?r[h]={}:v,d,s)):s===void 0?p(r)&&!isNaN(parseInt(i))?r.splice(i,1):delete r[i]:r[i]=s}}function mn(r){var i,s={};for(i in r)P(r,i)&&(s[i]=r[i]);return s}var wo=[].concat;function $r(r){return wo.apply([],r)}var wt="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat($r([8,16,32,64].map(function(r){return["Int","Uint","Float"].map(function(i){return i+r+"Array"})}))).filter(function(r){return u[r]}),Wr=new Set(wt.map(function(r){return u[r]})),zt=null;function ct(r){return zt=new WeakMap,r=function i(s){if(!s||typeof s!="object")return s;var c=zt.get(s);if(c)return c;if(p(s)){c=[],zt.set(s,c);for(var l=0,h=s.length;l<h;++l)c.push(i(s[l]))}else if(Wr.has(s.constructor))c=s;else{var d,v=g(s);for(d in c=v===Object.prototype?{}:Object.create(v),zt.set(s,c),s)P(s,d)&&(c[d]=i(s[d]))}return c}(r),zt=null,r}var Ur={}.toString;function Gt(r){return Ur.call(r).slice(8,-1)}var bn=typeof Symbol<"u"?Symbol.iterator:"@@iterator",qr=typeof bn=="symbol"?function(r){var i;return r!=null&&(i=r[bn])&&i.apply(r)}:function(){return null};function lt(r,i){return i=r.indexOf(i),0<=i&&r.splice(i,1),0<=i}var mt={};function et(r){var i,s,c,l;if(arguments.length===1){if(p(r))return r.slice();if(this===mt&&typeof r=="string")return[r];if(l=qr(r)){for(s=[];!(c=l.next()).done;)s.push(c.value);return s}if(r==null)return[r];if(typeof(i=r.length)!="number")return[r];for(s=new Array(i);i--;)s[i]=r[i];return s}for(i=arguments.length,s=new Array(i);i--;)s[i]=arguments[i];return s}var _n=typeof Symbol<"u"?function(r){return r[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},Jt=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],tt=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Jt),J={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 ze(r,i){this.name=r,this.message=i}function Hr(r,i){return r+". Errors: "+Object.keys(i).map(function(s){return i[s].toString()}).filter(function(s,c,l){return l.indexOf(s)===c}).join(`
|
|
45
|
+
`)}function ye(r,i,s,c){this.failures=i,this.failedKeys=c,this.successCount=s,this.message=Hr(r,i)}function Pt(r,i){this.name="BulkError",this.failures=Object.keys(i).map(function(s){return i[s]}),this.failuresByPos=i,this.message=Hr(r,this.failures)}fe(ze).from(Error).extend({toString:function(){return this.name+": "+this.message}}),fe(ye).from(ze),fe(Pt).from(ze);var qn=tt.reduce(function(r,i){return r[i]=i+"Error",r},{}),zr=ze,Y=tt.reduce(function(r,i){var s=i+"Error";function c(l,h){this.name=s,l?typeof l=="string"?(this.message="".concat(l).concat(h?`
|
|
46
|
+
`+h:""),this.inner=h||null):typeof l=="object"&&(this.message="".concat(l.name," ").concat(l.message),this.inner=l):(this.message=J[i]||s,this.inner=null)}return fe(c).from(zr),r[i]=c,r},{});Y.Syntax=SyntaxError,Y.Type=TypeError,Y.Range=RangeError;var Ge=Jt.reduce(function(r,i){return r[i+"Error"]=Y[i],r},{}),Yt=tt.reduce(function(r,i){return["Syntax","Type","Range"].indexOf(i)===-1&&(r[i+"Error"]=Y[i]),r},{});function se(){}function Tt(r){return r}function Eo(r,i){return r==null||r===Tt?i:function(s){return i(r(s))}}function ot(r,i){return function(){r.apply(this,arguments),i.apply(this,arguments)}}function Gr(r,i){return r===se?i:function(){var s=r.apply(this,arguments);s!==void 0&&(arguments[0]=s);var c=this.onsuccess,l=this.onerror;this.onsuccess=null,this.onerror=null;var h=i.apply(this,arguments);return c&&(this.onsuccess=this.onsuccess?ot(c,this.onsuccess):c),l&&(this.onerror=this.onerror?ot(l,this.onerror):l),h!==void 0?h:s}}function Yr(r,i){return r===se?i:function(){r.apply(this,arguments);var s=this.onsuccess,c=this.onerror;this.onsuccess=this.onerror=null,i.apply(this,arguments),s&&(this.onsuccess=this.onsuccess?ot(s,this.onsuccess):s),c&&(this.onerror=this.onerror?ot(c,this.onerror):c)}}function Qr(r,i){return r===se?i:function(s){var c=r.apply(this,arguments);E(s,c);var l=this.onsuccess,h=this.onerror;return this.onsuccess=null,this.onerror=null,s=i.apply(this,arguments),l&&(this.onsuccess=this.onsuccess?ot(l,this.onsuccess):l),h&&(this.onerror=this.onerror?ot(h,this.onerror):h),c===void 0?s===void 0?void 0:s:E(c,s)}}function Jr(r,i){return r===se?i:function(){return i.apply(this,arguments)!==!1&&r.apply(this,arguments)}}function wn(r,i){return r===se?i:function(){var s=r.apply(this,arguments);if(s&&typeof s.then=="function"){for(var c=this,l=arguments.length,h=new Array(l);l--;)h[l]=arguments[l];return s.then(function(){return i.apply(c,h)})}return i.apply(this,arguments)}}Yt.ModifyError=ye,Yt.DexieError=ze,Yt.BulkError=Pt;var Ue=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Xr(r){Ue=r}var Qt={},Zr=100,wt=typeof Promise>"u"?[]:function(){var r=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[r,g(r),r];var i=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[i,g(i),r]}(),Jt=wt[0],tt=wt[1],wt=wt[2],tt=tt&&tt.then,at=Jt&&Jt.constructor,Hn=!!wt,Xt=function(r,i){me.push([r,i]),It&&(queueMicrotask(Ye),It=!1)},zn=!0,It=!0,x=[],D=[],j=Tt,V={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:se,pgp:!1,env:{},finalize:se},L=V,me=[],de=0,ee=[];function N(r){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var i=this._PSD=L;if(typeof r!="function"){if(r!==Qt)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 s(c,l){try{l(function(h){if(c._state===null){if(h===c)throw new TypeError("A promise cannot be resolved with itself.");var d=c._lib&&bt();h&&typeof h.then=="function"?s(c,function(v,_){h instanceof N?h._then(v,_):h.then(v,_)}):(c._state=!0,c._value=h,re(c)),d&&Dt()}},G.bind(null,c))}catch(h){G(c,h)}}(this,r)}var H={get:function(){var r=L,i=ri;function s(c,l){var h=this,d=!r.global&&(r!==L||i!==ri),v=d&&!Rt(),_=new N(function(m,O){he(h,new z(js(c,r,d,v),js(l,r,d,v),m,O,r))});return this._consoleTask&&(_._consoleTask=this._consoleTask),_}return s.prototype=Qt,s},set:function(r){Z(this,"then",r&&r.prototype===Qt?H:{get:function(){return r},set:H.set})}};function z(r,i,s,c,l){this.onFulfilled=typeof r=="function"?r:null,this.onRejected=typeof i=="function"?i:null,this.resolve=s,this.reject=c,this.psd=l}function G(r,i){var s,c;D.push(i),r._state===null&&(s=r._lib&&bt(),i=j(i),r._state=!1,r._value=i,c=r,x.some(function(l){return l._value===c._value})||x.push(c),re(r),s&&Dt())}function re(r){var i=r._listeners;r._listeners=[];for(var s=0,c=i.length;s<c;++s)he(r,i[s]);var l=r._PSD;--l.ref||l.finalize(),de===0&&(++de,Xt(function(){--de==0&&Gn()},[]))}function he(r,i){if(r._state!==null){var s=r._state?i.onFulfilled:i.onRejected;if(s===null)return(r._state?i.resolve:i.reject)(r._value);++i.psd.ref,++de,Xt(we,[s,r,i])}else r._listeners.push(i)}function we(r,i,s){try{var c,l=i._value;!i._state&&D.length&&(D=[]),c=Ue&&i._consoleTask?i._consoleTask.run(function(){return r(l)}):r(l),i._state||D.indexOf(l)!==-1||function(h){for(var d=x.length;d;)if(x[--d]._value===h._value)return x.splice(d,1)}(i),s.resolve(c)}catch(h){s.reject(h)}finally{--de==0&&Gn(),--s.psd.ref||s.psd.finalize()}}function Ye(){Zt(V,function(){bt()&&Dt()})}function bt(){var r=zn;return It=zn=!1,r}function Dt(){var r,i,s;do for(;0<me.length;)for(r=me,me=[],s=r.length,i=0;i<s;++i){var c=r[i];c[0].apply(null,c[1])}while(0<me.length);It=zn=!0}function Gn(){var r=x;x=[],r.forEach(function(c){c._PSD.onunhandled.call(null,c._value,c)});for(var i=ee.slice(0),s=i.length;s;)i[--s]()}function ei(r){return new N(Qt,!1,r)}function be(r,i){var s=L;return function(){var c=bt(),l=L;try{return Mt(s,!0),r.apply(this,arguments)}catch(h){i&&i(h)}finally{Mt(l,!1),c&&Dt()}}}B(N.prototype,{then:H,_then:function(r,i){he(this,new z(null,null,r,i,L))},catch:function(r){if(arguments.length===1)return this.then(null,r);var i=r,s=arguments[1];return typeof i=="function"?this.then(null,function(c){return(c instanceof i?s:ei)(c)}):this.then(null,function(c){return(c&&c.name===i?s:ei)(c)})},finally:function(r){return this.then(function(i){return N.resolve(r()).then(function(){return i})},function(i){return N.resolve(r()).then(function(){return ei(i)})})},timeout:function(r,i){var s=this;return r<1/0?new N(function(c,l){var h=setTimeout(function(){return l(new Y.Timeout(i))},r);s.then(c,l).finally(clearTimeout.bind(null,h))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&Z(N.prototype,Symbol.toStringTag,"Dexie.Promise"),V.env=ks(),B(N,{all:function(){var r=et.apply(null,arguments).map(ii);return new N(function(i,s){r.length===0&&i([]);var c=r.length;r.forEach(function(l,h){return N.resolve(l).then(function(d){r[h]=d,--c||i(r)},s)})})},resolve:function(r){return r instanceof N?r:r&&typeof r.then=="function"?new N(function(i,s){r.then(i,s)}):new N(Qt,!0,r)},reject:ei,race:function(){var r=et.apply(null,arguments).map(ii);return new N(function(i,s){r.map(function(c){return N.resolve(c).then(i,s)})})},PSD:{get:function(){return L},set:function(r){return L=r}},totalEchoes:{get:function(){return ri}},newPSD:Nt,usePSD:Zt,scheduler:{get:function(){return Xt},set:function(r){Xt=r}},rejectionMapper:{get:function(){return j},set:function(r){j=r}},follow:function(r,i){return new N(function(s,c){return Nt(function(l,h){var d=L;d.unhandleds=[],d.onunhandled=h,d.finalize=ot(function(){var v,_=this;v=function(){_.unhandleds.length===0?l():h(_.unhandleds[0])},ee.push(function m(){v(),ee.splice(ee.indexOf(m),1)}),++de,Xt(function(){--de==0&&Gn()},[])},d.finalize),r()},i,s,c)})}}),at&&(at.allSettled&&Z(N,"allSettled",function(){var r=et.apply(null,arguments).map(ii);return new N(function(i){r.length===0&&i([]);var s=r.length,c=new Array(s);r.forEach(function(l,h){return N.resolve(l).then(function(d){return c[h]={status:"fulfilled",value:d}},function(d){return c[h]={status:"rejected",reason:d}}).then(function(){return--s||i(c)})})})}),at.any&&typeof AggregateError<"u"&&Z(N,"any",function(){var r=et.apply(null,arguments).map(ii);return new N(function(i,s){r.length===0&&s(new AggregateError([]));var c=r.length,l=new Array(c);r.forEach(function(h,d){return N.resolve(h).then(function(v){return i(v)},function(v){l[d]=v,--c||s(new AggregateError(l))})})})}));var Te={awaits:0,echoes:0,id:0},Yh=0,ti=[],ni=0,ri=0,Qh=0;function Nt(r,i,s,c){var l=L,h=Object.create(l);return h.parent=l,h.ref=0,h.global=!1,h.id=++Qh,V.env,h.env=Hn?{Promise:N,PromiseProp:{value:N,configurable:!0,writable:!0},all:N.all,race:N.race,allSettled:N.allSettled,any:N.any,resolve:N.resolve,reject:N.reject}:{},i&&E(h,i),++l.ref,h.finalize=function(){--this.parent.ref||this.parent.finalize()},c=Zt(h,r,s,c),h.ref===0&&h.finalize(),c}function En(){return Te.id||(Te.id=++Yh),++Te.awaits,Te.echoes+=Zr,Te.id}function Rt(){return!!Te.awaits&&(--Te.awaits==0&&(Te.id=0),Te.echoes=Te.awaits*Zr,!0)}function ii(r){return Te.echoes&&r&&r.constructor===at?(En(),r.then(function(i){return Rt(),i},function(i){return Rt(),Oe(i)})):r}function Jh(){var r=ti[ti.length-1];ti.pop(),Mt(r,!1)}function Mt(r,i){var s,c=L;(i?!Te.echoes||ni++&&r===L:!ni||--ni&&r===L)||queueMicrotask(i?(function(l){++ri,Te.echoes&&--Te.echoes!=0||(Te.echoes=Te.awaits=Te.id=0),ti.push(L),Mt(l,!0)}).bind(null,r):Jh),r!==L&&(L=r,c===V&&(V.env=ks()),Hn&&(s=V.env.Promise,i=r.env,(c.global||r.global)&&(Object.defineProperty(u,"Promise",i.PromiseProp),s.all=i.all,s.race=i.race,s.resolve=i.resolve,s.reject=i.reject,i.allSettled&&(s.allSettled=i.allSettled),i.any&&(s.any=i.any))))}function ks(){var r=u.Promise;return Hn?{Promise:r,PromiseProp:Object.getOwnPropertyDescriptor(u,"Promise"),all:r.all,race:r.race,allSettled:r.allSettled,any:r.any,resolve:r.resolve,reject:r.reject}:{}}function Zt(r,i,s,c,l){var h=L;try{return Mt(r,!0),i(s,c,l)}finally{Mt(h,!1)}}function js(r,i,s,c){return typeof r!="function"?r:function(){var l=L;s&&En(),Mt(i,!0);try{return r.apply(this,arguments)}finally{Mt(l,!1),c&&queueMicrotask(Rt)}}}function So(r){Promise===at&&Te.echoes===0?ni===0?r():enqueueNativeMicroTask(r):setTimeout(r,0)}(""+tt).indexOf("[native code]")===-1&&(En=Rt=se);var Oe=N.reject,en="",_t="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Ls="String expected.",Sn=[],oi="__dbnames",Oo="readonly",Co="readwrite";function tn(r,i){return r?i?function(){return r.apply(this,arguments)&&i.apply(this,arguments)}:r:i}var Fs={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function ai(r){return typeof r!="string"||/\./.test(r)?function(i){return i}:function(i){return i[r]===void 0&&r in i&&delete(i=ct(i))[r],i}}function Bs(){throw Y.Type()}function le(r,i){try{var s=Ks(r),c=Ks(i);if(s!==c)return s==="Array"?1:c==="Array"?-1:s==="binary"?1:c==="binary"?-1:s==="string"?1:c==="string"?-1:s==="Date"?1:c!=="Date"?NaN:-1;switch(s){case"number":case"Date":case"string":return i<r?1:r<i?-1:0;case"binary":return function(l,h){for(var d=l.length,v=h.length,_=d<v?d:v,m=0;m<_;++m)if(l[m]!==h[m])return l[m]<h[m]?-1:1;return d===v?0:d<v?-1:1}(Vs(r),Vs(i));case"Array":return function(l,h){for(var d=l.length,v=h.length,_=d<v?d:v,m=0;m<_;++m){var O=le(l[m],h[m]);if(O!==0)return O}return d===v?0:d<v?-1:1}(r,i)}}catch{}return NaN}function Ks(r){var i=typeof r;return i!="object"?i:ArrayBuffer.isView(r)?"binary":(r=Gt(r),r==="ArrayBuffer"?"binary":r)}function Vs(r){return r instanceof Uint8Array?r:ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):new Uint8Array(r)}var $s=(ve.prototype._trans=function(r,i,s){var c=this._tx||L.trans,l=this.name,h=Ue&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(r==="readonly"?"read":"write"," ").concat(this.name));function d(m,O,y){if(!y.schema[l])throw new Y.NotFound("Table "+l+" not part of transaction");return i(y.idbtrans,y)}var v=bt();try{var _=c&&c.db._novip===this.db._novip?c===L.trans?c._promise(r,d,s):Nt(function(){return c._promise(r,d,s)},{trans:c,transless:L.transless||L}):function m(O,y,C,b){if(O.idbdb&&(O._state.openComplete||L.letThrough||O._vip)){var S=O._createTransaction(y,C,O._dbSchema);try{S.create(),O._state.PR1398_maxLoop=3}catch(A){return A.name===qn.InvalidState&&O.isOpen()&&0<--O._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),O.close({disableAutoOpen:!1}),O.open().then(function(){return m(O,y,C,b)})):Oe(A)}return S._promise(y,function(A,w){return Nt(function(){return L.trans=S,b(A,w,S)})}).then(function(A){if(y==="readwrite")try{S.idbtrans.commit()}catch{}return y==="readonly"?A:S._completion.then(function(){return A})})}if(O._state.openComplete)return Oe(new Y.DatabaseClosed(O._state.dbOpenError));if(!O._state.isBeingOpened){if(!O._state.autoOpen)return Oe(new Y.DatabaseClosed);O.open().catch(se)}return O._state.dbReadyPromise.then(function(){return m(O,y,C,b)})}(this.db,r,[this.name],d);return h&&(_._consoleTask=h,_=_.catch(function(m){return console.trace(m),Oe(m)})),_}finally{v&&Dt()}},ve.prototype.get=function(r,i){var s=this;return r&&r.constructor===Object?this.where(r).first(i):r==null?Oe(new Y.Type("Invalid argument to Table.get()")):this._trans("readonly",function(c){return s.core.get({trans:c,key:r}).then(function(l){return s.hook.reading.fire(l)})}).then(i)},ve.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 s=this.schema.indexes.concat(this.schema.primKey).filter(function(_){if(_.compound&&i.every(function(O){return 0<=_.keyPath.indexOf(O)})){for(var m=0;m<i.length;++m)if(i.indexOf(_.keyPath[m])===-1)return!1;return!0}return!1}).sort(function(_,m){return _.keyPath.length-m.keyPath.length})[0];if(s&&this.db._maxKey!==en){var d=s.keyPath.slice(0,i.length);return this.where(d).equals(d.map(function(m){return r[m]}))}!s&&Ue&&console.warn("The query ".concat(JSON.stringify(r)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(i.join("+"),"]"));var c=this.schema.idxByName,l=this.db._deps.indexedDB;function h(_,m){return l.cmp(_,m)===0}var v=i.reduce(function(C,m){var O=C[0],y=C[1],C=c[m],b=r[m];return[O||C,O||!C?tn(y,C&&C.multi?function(S){return S=ne(S,m),p(S)&&S.some(function(A){return h(b,A)})}:function(S){return h(b,ne(S,m))}):y]},[null,null]),d=v[0],v=v[1];return d?this.where(d.name).equals(r[d.keyPath]).filter(v):s?this.filter(v):this.where(i).equals("")},ve.prototype.filter=function(r){return this.toCollection().and(r)},ve.prototype.count=function(r){return this.toCollection().count(r)},ve.prototype.offset=function(r){return this.toCollection().offset(r)},ve.prototype.limit=function(r){return this.toCollection().limit(r)},ve.prototype.each=function(r){return this.toCollection().each(r)},ve.prototype.toArray=function(r){return this.toCollection().toArray(r)},ve.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},ve.prototype.orderBy=function(r){return new this.db.Collection(new this.db.WhereClause(this,p(r)?"[".concat(r.join("+"),"]"):r))},ve.prototype.reverse=function(){return this.toCollection().reverse()},ve.prototype.mapToClass=function(r){var i,s=this.db,c=this.name;function l(){return i!==null&&i.apply(this,arguments)||this}(this.schema.mappedClass=r).prototype instanceof Bs&&(function(_,m){if(typeof m!="function"&&m!==null)throw new TypeError("Class extends value "+String(m)+" is not a constructor or null");function O(){this.constructor=_}n(_,m),_.prototype=m===null?Object.create(m):(O.prototype=m.prototype,new O)}(l,i=r),Object.defineProperty(l.prototype,"db",{get:function(){return s},enumerable:!1,configurable:!0}),l.prototype.table=function(){return c},r=l);for(var h=new Set,d=r.prototype;d;d=g(d))Object.getOwnPropertyNames(d).forEach(function(_){return h.add(_)});function v(_){if(!_)return _;var m,O=Object.create(r.prototype);for(m in _)if(!h.has(m))try{O[m]=_[m]}catch{}return O}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=v,this.hook("reading",v),r},ve.prototype.defineClass=function(){return this.mapToClass(function(r){E(this,r)})},ve.prototype.add=function(r,i){var s=this,c=this.schema.primKey,l=c.auto,h=c.keyPath,d=r;return h&&l&&(d=ai(h)(r)),this._trans("readwrite",function(v){return s.core.mutate({trans:v,type:"add",keys:i!=null?[i]:null,values:[d]})}).then(function(v){return v.numFailures?N.reject(v.failures[0]):v.lastResult}).then(function(v){if(h)try{Pe(r,h,v)}catch{}return v})},ve.prototype.update=function(r,i){return typeof r!="object"||p(r)?this.where(":id").equals(r).modify(i):(r=ne(r,this.schema.primKey.keyPath),r===void 0?Oe(new Y.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(r).modify(i))},ve.prototype.put=function(r,i){var s=this,c=this.schema.primKey,l=c.auto,h=c.keyPath,d=r;return h&&l&&(d=ai(h)(r)),this._trans("readwrite",function(v){return s.core.mutate({trans:v,type:"put",values:[d],keys:i!=null?[i]:null})}).then(function(v){return v.numFailures?N.reject(v.failures[0]):v.lastResult}).then(function(v){if(h)try{Pe(r,h,v)}catch{}return v})},ve.prototype.delete=function(r){var i=this;return this._trans("readwrite",function(s){return i.core.mutate({trans:s,type:"delete",keys:[r]})}).then(function(s){return s.numFailures?N.reject(s.failures[0]):void 0})},ve.prototype.clear=function(){var r=this;return this._trans("readwrite",function(i){return r.core.mutate({trans:i,type:"deleteRange",range:Fs})}).then(function(i){return i.numFailures?N.reject(i.failures[0]):void 0})},ve.prototype.bulkGet=function(r){var i=this;return this._trans("readonly",function(s){return i.core.getMany({keys:r,trans:s}).then(function(c){return c.map(function(l){return i.hook.reading.fire(l)})})})},ve.prototype.bulkAdd=function(r,i,s){var c=this,l=Array.isArray(i)?i:void 0,h=(s=s||(l?void 0:i))?s.allKeys:void 0;return this._trans("readwrite",function(d){var m=c.schema.primKey,v=m.auto,m=m.keyPath;if(m&&l)throw new Y.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(l&&l.length!==r.length)throw new Y.InvalidArgument("Arguments objects and keys must have the same length");var _=r.length,m=m&&v?r.map(ai(m)):r;return c.core.mutate({trans:d,type:"add",keys:l,values:m,wantResults:h}).then(function(S){var y=S.numFailures,C=S.results,b=S.lastResult,S=S.failures;if(y===0)return h?C:b;throw new Pt("".concat(c.name,".bulkAdd(): ").concat(y," of ").concat(_," operations failed"),S)})})},ve.prototype.bulkPut=function(r,i,s){var c=this,l=Array.isArray(i)?i:void 0,h=(s=s||(l?void 0:i))?s.allKeys:void 0;return this._trans("readwrite",function(d){var m=c.schema.primKey,v=m.auto,m=m.keyPath;if(m&&l)throw new Y.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(l&&l.length!==r.length)throw new Y.InvalidArgument("Arguments objects and keys must have the same length");var _=r.length,m=m&&v?r.map(ai(m)):r;return c.core.mutate({trans:d,type:"put",keys:l,values:m,wantResults:h}).then(function(S){var y=S.numFailures,C=S.results,b=S.lastResult,S=S.failures;if(y===0)return h?C:b;throw new Pt("".concat(c.name,".bulkPut(): ").concat(y," of ").concat(_," operations failed"),S)})})},ve.prototype.bulkUpdate=function(r){var i=this,s=this.core,c=r.map(function(d){return d.key}),l=r.map(function(d){return d.changes}),h=[];return this._trans("readwrite",function(d){return s.getMany({trans:d,keys:c,cache:"clone"}).then(function(v){var _=[],m=[];r.forEach(function(y,C){var b=y.key,S=y.changes,A=v[C];if(A){for(var w=0,I=Object.keys(S);w<I.length;w++){var R=I[w],M=S[R];if(R===i.schema.primKey.keyPath){if(le(M,b)!==0)throw new Y.Constraint("Cannot update primary key in bulkUpdate()")}else Pe(A,R,M)}h.push(C),_.push(b),m.push(A)}});var O=_.length;return s.mutate({trans:d,type:"put",keys:_,values:m,updates:{keys:c,changeSpecs:l}}).then(function(y){var C=y.numFailures,b=y.failures;if(C===0)return O;for(var S=0,A=Object.keys(b);S<A.length;S++){var w,I=A[S],R=h[Number(I)];R!=null&&(w=b[I],delete b[I],b[R]=w)}throw new Pt("".concat(i.name,".bulkUpdate(): ").concat(C," of ").concat(O," operations failed"),b)})})})},ve.prototype.bulkDelete=function(r){var i=this,s=r.length;return this._trans("readwrite",function(c){return i.core.mutate({trans:c,type:"delete",keys:r})}).then(function(d){var l=d.numFailures,h=d.lastResult,d=d.failures;if(l===0)return h;throw new Pt("".concat(i.name,".bulkDelete(): ").concat(l," of ").concat(s," operations failed"),d)})},ve);function ve(){}function Yn(r){function i(d,v){if(v){for(var _=arguments.length,m=new Array(_-1);--_;)m[_-1]=arguments[_];return s[d].subscribe.apply(null,m),r}if(typeof d=="string")return s[d]}var s={};i.addEventType=h;for(var c=1,l=arguments.length;c<l;++c)h(arguments[c]);return i;function h(d,v,_){if(typeof d!="object"){var m;v=v||Jr;var O={subscribers:[],fire:_=_||se,subscribe:function(y){O.subscribers.indexOf(y)===-1&&(O.subscribers.push(y),O.fire=v(O.fire,y))},unsubscribe:function(y){O.subscribers=O.subscribers.filter(function(C){return C!==y}),O.fire=O.subscribers.reduce(v,_)}};return s[d]=i[d]=O}f(m=d).forEach(function(y){var C=m[y];if(p(C))h(y,m[y][0],m[y][1]);else{if(C!=="asap")throw new Y.InvalidArgument("Invalid event config");var b=h(y,Tt,function(){for(var S=arguments.length,A=new Array(S);S--;)A[S]=arguments[S];b.subscribers.forEach(function(w){xt(function(){w.apply(null,A)})})})}})}}function Qn(r,i){return fe(i).from({prototype:r}),i}function On(r,i){return!(r.filter||r.algorithm||r.or)&&(i?r.justLimit:!r.replayFilter)}function Ao(r,i){r.filter=tn(r.filter,i)}function xo(r,i,s){var c=r.replayFilter;r.replayFilter=c?function(){return tn(c(),i())}:i,r.justLimit=s&&!c}function si(r,i){if(r.isPrimKey)return i.primaryKey;var s=i.getIndexByKeyPath(r.index);if(!s)throw new Y.Schema("KeyPath "+r.index+" on object store "+i.name+" is not indexed");return s}function Ws(r,i,s){var c=si(r,i.schema);return i.openCursor({trans:s,values:!r.keysOnly,reverse:r.dir==="prev",unique:!!r.unique,query:{index:c,range:r.range}})}function ui(r,i,s,c){var l=r.replayFilter?tn(r.filter,r.replayFilter()):r.filter;if(r.or){var h={},d=function(v,_,m){var O,y;l&&!l(_,m,function(C){return _.stop(C)},function(C){return _.fail(C)})||((y=""+(O=_.primaryKey))=="[object ArrayBuffer]"&&(y=""+new Uint8Array(O)),P(h,y)||(h[y]=!0,i(v,_,m)))};return Promise.all([r.or._iterate(d,s),Us(Ws(r,c,s),r.algorithm,d,!r.keysOnly&&r.valueMapper)])}return Us(Ws(r,c,s),tn(r.algorithm,l),i,!r.keysOnly&&r.valueMapper)}function Us(r,i,s,c){var l=be(c?function(h,d,v){return s(c(h),d,v)}:s);return r.then(function(h){if(h)return h.start(function(){var d=function(){return h.continue()};i&&!i(h,function(v){return d=v},function(v){h.stop(v),d=se},function(v){h.fail(v),d=se})||l(h.value,h,function(v){return d=v}),d()})})}var wt=Symbol(),Jn=(qs.prototype.execute=function(r){if(this.add!==void 0){var i=this.add;if(p(i))return a(a([],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 s=this.remove;if(p(s))return p(r)?r.filter(function(c){return!s.includes(c)}).sort():[];if(typeof s=="number")return Number(r)-s;if(typeof s=="bigint")try{return BigInt(r)-s}catch{return BigInt(0)-s}throw new TypeError("Invalid subtrahend ".concat(s))}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},qs);function qs(r){Object.assign(this,r)}var Xh=(ue.prototype._read=function(r,i){var s=this._ctx;return s.error?s.table._trans(null,Oe.bind(null,s.error)):s.table._trans("readonly",r).then(i)},ue.prototype._write=function(r){var i=this._ctx;return i.error?i.table._trans(null,Oe.bind(null,i.error)):i.table._trans("readwrite",r,"locked")},ue.prototype._addAlgorithm=function(r){var i=this._ctx;i.algorithm=tn(i.algorithm,r)},ue.prototype._iterate=function(r,i){return ui(this._ctx,r,i,this._ctx.table.core)},ue.prototype.clone=function(r){var i=Object.create(this.constructor.prototype),s=Object.create(this._ctx);return r&&E(s,r),i._ctx=s,i},ue.prototype.raw=function(){return this._ctx.valueMapper=null,this},ue.prototype.each=function(r){var i=this._ctx;return this._read(function(s){return ui(i,r,s,i.table.core)})},ue.prototype.count=function(r){var i=this;return this._read(function(s){var c=i._ctx,l=c.table.core;if(On(c,!0))return l.count({trans:s,query:{index:si(c,l.schema),range:c.range}}).then(function(d){return Math.min(d,c.limit)});var h=0;return ui(c,function(){return++h,!1},s,l).then(function(){return h})}).then(r)},ue.prototype.sortBy=function(r,i){var s=r.split(".").reverse(),c=s[0],l=s.length-1;function h(_,m){return m?h(_[s[m]],m-1):_[c]}var d=this._ctx.dir==="next"?1:-1;function v(_,m){return _=h(_,l),m=h(m,l),_<m?-d:m<_?d:0}return this.toArray(function(_){return _.sort(v)}).then(i)},ue.prototype.toArray=function(r){var i=this;return this._read(function(s){var c=i._ctx;if(c.dir==="next"&&On(c,!0)&&0<c.limit){var l=c.valueMapper,h=si(c,c.table.core.schema);return c.table.core.query({trans:s,limit:c.limit,values:!0,query:{index:h,range:c.range}}).then(function(v){return v=v.result,l?v.map(l):v})}var d=[];return ui(c,function(v){return d.push(v)},s,c.table.core).then(function(){return d})},r)},ue.prototype.offset=function(r){var i=this._ctx;return r<=0||(i.offset+=r,On(i)?xo(i,function(){var s=r;return function(c,l){return s===0||(s===1?--s:l(function(){c.advance(s),s=0}),!1)}}):xo(i,function(){var s=r;return function(){return--s<0}})),this},ue.prototype.limit=function(r){return this._ctx.limit=Math.min(this._ctx.limit,r),xo(this._ctx,function(){var i=r;return function(s,c,l){return--i<=0&&c(l),0<=i}},!0),this},ue.prototype.until=function(r,i){return Ao(this._ctx,function(s,c,l){return!r(s.value)||(c(l),i)}),this},ue.prototype.first=function(r){return this.limit(1).toArray(function(i){return i[0]}).then(r)},ue.prototype.last=function(r){return this.reverse().first(r)},ue.prototype.filter=function(r){var i;return Ao(this._ctx,function(s){return r(s.value)}),(i=this._ctx).isMatch=tn(i.isMatch,r),this},ue.prototype.and=function(r){return this.filter(r)},ue.prototype.or=function(r){return new this.db.WhereClause(this._ctx.table,r,this)},ue.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},ue.prototype.desc=function(){return this.reverse()},ue.prototype.eachKey=function(r){var i=this._ctx;return i.keysOnly=!i.isMatch,this.each(function(s,c){r(c.key,c)})},ue.prototype.eachUniqueKey=function(r){return this._ctx.unique="unique",this.eachKey(r)},ue.prototype.eachPrimaryKey=function(r){var i=this._ctx;return i.keysOnly=!i.isMatch,this.each(function(s,c){r(c.primaryKey,c)})},ue.prototype.keys=function(r){var i=this._ctx;i.keysOnly=!i.isMatch;var s=[];return this.each(function(c,l){s.push(l.key)}).then(function(){return s}).then(r)},ue.prototype.primaryKeys=function(r){var i=this._ctx;if(i.dir==="next"&&On(i,!0)&&0<i.limit)return this._read(function(c){var l=si(i,i.table.core.schema);return i.table.core.query({trans:c,values:!1,limit:i.limit,query:{index:l,range:i.range}})}).then(function(c){return c.result}).then(r);i.keysOnly=!i.isMatch;var s=[];return this.each(function(c,l){s.push(l.primaryKey)}).then(function(){return s}).then(r)},ue.prototype.uniqueKeys=function(r){return this._ctx.unique="unique",this.keys(r)},ue.prototype.firstKey=function(r){return this.limit(1).keys(function(i){return i[0]}).then(r)},ue.prototype.lastKey=function(r){return this.reverse().firstKey(r)},ue.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 Ao(this._ctx,function(l){var c=l.primaryKey.toString(),l=P(i,c);return i[c]=!0,!l}),this},ue.prototype.modify=function(r){var i=this,s=this._ctx;return this._write(function(c){var l,h,d;d=typeof r=="function"?r:(l=f(r),h=l.length,function(w){for(var I=!1,R=0;R<h;++R){var M=l[R],k=r[M],F=ne(w,M);k instanceof Jn?(Pe(w,M,k.execute(F)),I=!0):F!==k&&(Pe(w,M,k),I=!0)}return I});function v(w,M){var R=M.failures,M=M.numFailures;S+=w-M;for(var k=0,F=f(R);k<F.length;k++){var U=F[k];b.push(R[U])}}var _=s.table.core,m=_.schema.primaryKey,O=m.outbound,y=m.extractKey,C=i.db._options.modifyChunkSize||200,b=[],S=0,A=[];return i.clone().primaryKeys().then(function(w){function I(M){var k=Math.min(C,w.length-M);return _.getMany({trans:c,keys:w.slice(M,M+k),cache:"immutable"}).then(function(F){for(var U=[],K=[],W=O?[]:null,q=[],$=0;$<k;++$){var X=F[$],te={value:ct(X),primKey:w[M+$]};d.call(te,te.value,te)!==!1&&(te.value==null?q.push(w[M+$]):O||le(y(X),y(te.value))===0?(K.push(te.value),O&&W.push(w[M+$])):(q.push(w[M+$]),U.push(te.value)))}return Promise.resolve(0<U.length&&_.mutate({trans:c,type:"add",values:U}).then(function(ae){for(var ie in ae.failures)q.splice(parseInt(ie),1);v(U.length,ae)})).then(function(){return(0<K.length||R&&typeof r=="object")&&_.mutate({trans:c,type:"put",keys:W,values:K,criteria:R,changeSpec:typeof r!="function"&&r,isAdditionalChunk:0<M}).then(function(ae){return v(K.length,ae)})}).then(function(){return(0<q.length||R&&r===Po)&&_.mutate({trans:c,type:"delete",keys:q,criteria:R,isAdditionalChunk:0<M}).then(function(ae){return v(q.length,ae)})}).then(function(){return w.length>M+k&&I(M+C)})})}var R=On(s)&&s.limit===1/0&&(typeof r!="function"||r===Po)&&{index:s.index,range:s.range};return I(0).then(function(){if(0<b.length)throw new ye("Error modifying one or more objects",b,S,A);return w.length})})})},ue.prototype.delete=function(){var r=this._ctx,i=r.range;return On(r)&&(r.isPrimKey||i.type===3)?this._write(function(s){var c=r.table.core.schema.primaryKey,l=i;return r.table.core.count({trans:s,query:{index:c,range:l}}).then(function(h){return r.table.core.mutate({trans:s,type:"deleteRange",range:l}).then(function(d){var v=d.failures;if(d.lastResult,d.results,d=d.numFailures,d)throw new ye("Could not delete some values",Object.keys(v).map(function(_){return v[_]}),h-d);return h-d})})}):this.modify(Po)},ue);function ue(){}var Po=function(r,i){return i.value=null};function Zh(r,i){return r<i?-1:r===i?0:1}function ed(r,i){return i<r?-1:r===i?0:1}function Qe(r,i,s){return r=r instanceof zs?new r.Collection(r):r,r._ctx.error=new(s||TypeError)(i),r}function Cn(r){return new r.Collection(r,function(){return Hs("")}).limit(0)}function ci(r,i,s,c){var l,h,d,v,_,m,O,y=s.length;if(!s.every(function(S){return typeof S=="string"}))return Qe(r,Ls);function C(S){l=S==="next"?function(w){return w.toUpperCase()}:function(w){return w.toLowerCase()},h=S==="next"?function(w){return w.toLowerCase()}:function(w){return w.toUpperCase()},d=S==="next"?Zh:ed;var A=s.map(function(w){return{lower:h(w),upper:l(w)}}).sort(function(w,I){return d(w.lower,I.lower)});v=A.map(function(w){return w.upper}),_=A.map(function(w){return w.lower}),O=(m=S)==="next"?"":c}C("next"),r=new r.Collection(r,function(){return kt(v[0],_[y-1]+c)}),r._ondirectionchange=function(S){C(S)};var b=0;return r._addAlgorithm(function(S,A,w){var I=S.key;if(typeof I!="string")return!1;var R=h(I);if(i(R,_,b))return!0;for(var M=null,k=b;k<y;++k){var F=function(U,K,W,q,$,X){for(var te=Math.min(U.length,q.length),ae=-1,ie=0;ie<te;++ie){var st=K[ie];if(st!==q[ie])return $(U[ie],W[ie])<0?U.substr(0,ie)+W[ie]+W.substr(ie+1):$(U[ie],q[ie])<0?U.substr(0,ie)+q[ie]+W.substr(ie+1):0<=ae?U.substr(0,ae)+K[ae]+W.substr(ae+1):null;$(U[ie],st)<0&&(ae=ie)}return te<q.length&&X==="next"?U+W.substr(U.length):te<U.length&&X==="prev"?U.substr(0,W.length):ae<0?null:U.substr(0,ae)+q[ae]+W.substr(ae+1)}(I,R,v[k],_[k],d,m);F===null&&M===null?b=k+1:(M===null||0<d(M,F))&&(M=F)}return A(M!==null?function(){S.continue(M+O)}:w),!1}),r}function kt(r,i,s,c){return{type:2,lower:r,upper:i,lowerOpen:s,upperOpen:c}}function Hs(r){return{type:1,lower:r,upper:r}}var zs=(Object.defineProperty(Ie.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Ie.prototype.between=function(r,i,s,c){s=s!==!1,c=c===!0;try{return 0<this._cmp(r,i)||this._cmp(r,i)===0&&(s||c)&&(!s||!c)?Cn(this):new this.Collection(this,function(){return kt(r,i,!s,!c)})}catch{return Qe(this,_t)}},Ie.prototype.equals=function(r){return r==null?Qe(this,_t):new this.Collection(this,function(){return Hs(r)})},Ie.prototype.above=function(r){return r==null?Qe(this,_t):new this.Collection(this,function(){return kt(r,void 0,!0)})},Ie.prototype.aboveOrEqual=function(r){return r==null?Qe(this,_t):new this.Collection(this,function(){return kt(r,void 0,!1)})},Ie.prototype.below=function(r){return r==null?Qe(this,_t):new this.Collection(this,function(){return kt(void 0,r,!1,!0)})},Ie.prototype.belowOrEqual=function(r){return r==null?Qe(this,_t):new this.Collection(this,function(){return kt(void 0,r)})},Ie.prototype.startsWith=function(r){return typeof r!="string"?Qe(this,Ls):this.between(r,r+en,!0,!0)},Ie.prototype.startsWithIgnoreCase=function(r){return r===""?this.startsWith(r):ci(this,function(i,s){return i.indexOf(s[0])===0},[r],en)},Ie.prototype.equalsIgnoreCase=function(r){return ci(this,function(i,s){return i===s[0]},[r],"")},Ie.prototype.anyOfIgnoreCase=function(){var r=et.apply(mt,arguments);return r.length===0?Cn(this):ci(this,function(i,s){return s.indexOf(i)!==-1},r,"")},Ie.prototype.startsWithAnyOfIgnoreCase=function(){var r=et.apply(mt,arguments);return r.length===0?Cn(this):ci(this,function(i,s){return s.some(function(c){return i.indexOf(c)===0})},r,en)},Ie.prototype.anyOf=function(){var r=this,i=et.apply(mt,arguments),s=this._cmp;try{i.sort(s)}catch{return Qe(this,_t)}if(i.length===0)return Cn(this);var c=new this.Collection(this,function(){return kt(i[0],i[i.length-1])});c._ondirectionchange=function(h){s=h==="next"?r._ascending:r._descending,i.sort(s)};var l=0;return c._addAlgorithm(function(h,d,v){for(var _=h.key;0<s(_,i[l]);)if(++l===i.length)return d(v),!1;return s(_,i[l])===0||(d(function(){h.continue(i[l])}),!1)}),c},Ie.prototype.notEqual=function(r){return this.inAnyRange([[-1/0,r],[r,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Ie.prototype.noneOf=function(){var r=et.apply(mt,arguments);if(r.length===0)return new this.Collection(this);try{r.sort(this._ascending)}catch{return Qe(this,_t)}var i=r.reduce(function(s,c){return s?s.concat([[s[s.length-1][1],c]]):[[-1/0,c]]},null);return i.push([r[r.length-1],this.db._maxKey]),this.inAnyRange(i,{includeLowers:!1,includeUppers:!1})},Ie.prototype.inAnyRange=function(I,i){var s=this,c=this._cmp,l=this._ascending,h=this._descending,d=this._min,v=this._max;if(I.length===0)return Cn(this);if(!I.every(function(R){return R[0]!==void 0&&R[1]!==void 0&&l(R[0],R[1])<=0}))return Qe(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Y.InvalidArgument);var _=!i||i.includeLowers!==!1,m=i&&i.includeUppers===!0,O,y=l;function C(R,M){return y(R[0],M[0])}try{(O=I.reduce(function(R,M){for(var k=0,F=R.length;k<F;++k){var U=R[k];if(c(M[0],U[1])<0&&0<c(M[1],U[0])){U[0]=d(U[0],M[0]),U[1]=v(U[1],M[1]);break}}return k===F&&R.push(M),R},[])).sort(C)}catch{return Qe(this,_t)}var b=0,S=m?function(R){return 0<l(R,O[b][1])}:function(R){return 0<=l(R,O[b][1])},A=_?function(R){return 0<h(R,O[b][0])}:function(R){return 0<=h(R,O[b][0])},w=S,I=new this.Collection(this,function(){return kt(O[0][0],O[O.length-1][1],!_,!m)});return I._ondirectionchange=function(R){y=R==="next"?(w=S,l):(w=A,h),O.sort(C)},I._addAlgorithm(function(R,M,k){for(var F,U=R.key;w(U);)if(++b===O.length)return M(k),!1;return!S(F=U)&&!A(F)||(s._cmp(U,O[b][1])===0||s._cmp(U,O[b][0])===0||M(function(){y===l?R.continue(O[b][0]):R.continue(O[b][1])}),!1)}),I},Ie.prototype.startsWithAnyOf=function(){var r=et.apply(mt,arguments);return r.every(function(i){return typeof i=="string"})?r.length===0?Cn(this):this.inAnyRange(r.map(function(i){return[i,i+en]})):Qe(this,"startsWithAnyOf() only works with strings")},Ie);function Ie(){}function ft(r){return be(function(i){return Xn(i),r(i.target.error),!1})}function Xn(r){r.stopPropagation&&r.stopPropagation(),r.preventDefault&&r.preventDefault()}var Zn="storagemutated",To="x-storagemutated-1",jt=Yn(null,Zn),td=(ht.prototype._lock=function(){return Se(!L.global),++this._reculock,this._reculock!==1||L.global||(L.lockOwnerFor=this),this},ht.prototype._unlock=function(){if(Se(!L.global),--this._reculock==0)for(L.global||(L.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var r=this._blockedFuncs.shift();try{Zt(r[1],r[0])}catch{}}return this},ht.prototype._locked=function(){return this._reculock&&L.lockOwnerFor!==this},ht.prototype.create=function(r){var i=this;if(!this.mode)return this;var s=this.db.idbdb,c=this.db._state.dbOpenError;if(Se(!this.idbtrans),!r&&!s)switch(c&&c.name){case"DatabaseClosedError":throw new Y.DatabaseClosed(c);case"MissingAPIError":throw new Y.MissingAPI(c.message,c);default:throw new Y.OpenFailed(c)}if(!this.active)throw new Y.TransactionInactive;return Se(this._completion._state===null),(r=this.idbtrans=r||(this.db.core||s).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=be(function(l){Xn(l),i._reject(r.error)}),r.onabort=be(function(l){Xn(l),i.active&&i._reject(new Y.Abort(r.error)),i.active=!1,i.on("abort").fire(l)}),r.oncomplete=be(function(){i.active=!1,i._resolve(),"mutatedParts"in r&&jt.storagemutated.fire(r.mutatedParts)}),this},ht.prototype._promise=function(r,i,s){var c=this;if(r==="readwrite"&&this.mode!=="readwrite")return Oe(new Y.ReadOnly("Transaction is readonly"));if(!this.active)return Oe(new Y.TransactionInactive);if(this._locked())return new N(function(h,d){c._blockedFuncs.push([function(){c._promise(r,i,s).then(h,d)},L])});if(s)return Nt(function(){var h=new N(function(d,v){c._lock();var _=i(d,v,c);_&&_.then&&_.then(d,v)});return h.finally(function(){return c._unlock()}),h._lib=!0,h});var l=new N(function(h,d){var v=i(h,d,c);v&&v.then&&v.then(h,d)});return l._lib=!0,l},ht.prototype._root=function(){return this.parent?this.parent._root():this},ht.prototype.waitFor=function(r){var i,s=this._root(),c=N.resolve(r);s._waitingFor?s._waitingFor=s._waitingFor.then(function(){return c}):(s._waitingFor=c,s._waitingQueue=[],i=s.idbtrans.objectStore(s.storeNames[0]),function h(){for(++s._spinCount;s._waitingQueue.length;)s._waitingQueue.shift()();s._waitingFor&&(i.get(-1/0).onsuccess=h)}());var l=s._waitingFor;return new N(function(h,d){c.then(function(v){return s._waitingQueue.push(be(h.bind(null,v)))},function(v){return s._waitingQueue.push(be(d.bind(null,v)))}).finally(function(){s._waitingFor===l&&(s._waitingFor=null)})})},ht.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Y.Abort))},ht.prototype.table=function(r){var i=this._memoizedTables||(this._memoizedTables={});if(P(i,r))return i[r];var s=this.schema[r];if(!s)throw new Y.NotFound("Table "+r+" not part of transaction");return s=new this.db.Table(r,s,this),s.core=this.db.core.table(r),i[r]=s},ht);function ht(){}function Io(r,i,s,c,l,h,d){return{name:r,keyPath:i,unique:s,multi:c,auto:l,compound:h,src:(s&&!d?"&":"")+(c?"*":"")+(l?"++":"")+Gs(i)}}function Gs(r){return typeof r=="string"?r:r?"["+[].join.call(r,"+")+"]":""}function Do(r,i,s){return{name:r,primKey:i,indexes:s,mappedClass:null,idxByName:(c=function(l){return[l.name,l]},s.reduce(function(l,h,d){return d=c(h,d),d&&(l[d[0]]=d[1]),l},{}))};var c}var er=function(r){try{return r.only([[]]),er=function(){return[[]]},[[]]}catch{return er=function(){return en},en}};function No(r){return r==null?function(){}:typeof r=="string"?(i=r).split(".").length===1?function(s){return s[i]}:function(s){return ne(s,i)}:function(s){return ne(s,r)};var i}function Ys(r){return[].slice.call(r)}var nd=0;function tr(r){return r==null?":id":typeof r=="string"?r:"[".concat(r.join("+"),"]")}function rd(r,i,_){function c(w){if(w.type===3)return null;if(w.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var b=w.lower,S=w.upper,A=w.lowerOpen,w=w.upperOpen;return b===void 0?S===void 0?null:i.upperBound(S,!!w):S===void 0?i.lowerBound(b,!!A):i.bound(b,S,!!A,!!w)}function l(C){var b,S=C.name;return{name:S,schema:C,mutate:function(A){var w=A.trans,I=A.type,R=A.keys,M=A.values,k=A.range;return new Promise(function(F,U){F=be(F);var K=w.objectStore(S),W=K.keyPath==null,q=I==="put"||I==="add";if(!q&&I!=="delete"&&I!=="deleteRange")throw new Error("Invalid operation type: "+I);var $,X=(R||M||{length:1}).length;if(R&&M&&R.length!==M.length)throw new Error("Given keys array must have same length as given values array.");if(X===0)return F({numFailures:0,failures:{},results:[],lastResult:void 0});function te(Be){++st,Xn(Be)}var ae=[],ie=[],st=0;if(I==="deleteRange"){if(k.type===4)return F({numFailures:st,failures:ie,results:[],lastResult:void 0});k.type===3?ae.push($=K.clear()):ae.push($=K.delete(c(k)))}else{var W=q?W?[M,R]:[M,null]:[R,null],oe=W[0],je=W[1];if(q)for(var Le=0;Le<X;++Le)ae.push($=je&&je[Le]!==void 0?K[I](oe[Le],je[Le]):K[I](oe[Le])),$.onerror=te;else for(Le=0;Le<X;++Le)ae.push($=K[I](oe[Le])),$.onerror=te}function Ei(Be){Be=Be.target.result,ae.forEach(function(on,Jo){return on.error!=null&&(ie[Jo]=on.error)}),F({numFailures:st,failures:ie,results:I==="delete"?R:ae.map(function(on){return on.result}),lastResult:Be})}$.onerror=function(Be){te(Be),Ei(Be)},$.onsuccess=Ei})},getMany:function(A){var w=A.trans,I=A.keys;return new Promise(function(R,M){R=be(R);for(var k,F=w.objectStore(S),U=I.length,K=new Array(U),W=0,q=0,$=function(ae){ae=ae.target,K[ae._pos]=ae.result,++q===W&&R(K)},X=ft(M),te=0;te<U;++te)I[te]!=null&&((k=F.get(I[te]))._pos=te,k.onsuccess=$,k.onerror=X,++W);W===0&&R(K)})},get:function(A){var w=A.trans,I=A.key;return new Promise(function(R,M){R=be(R);var k=w.objectStore(S).get(I);k.onsuccess=function(F){return R(F.target.result)},k.onerror=ft(M)})},query:(b=m,function(A){return new Promise(function(w,I){w=be(w);var R,M,k,W=A.trans,F=A.values,U=A.limit,$=A.query,K=U===1/0?void 0:U,q=$.index,$=$.range,W=W.objectStore(S),q=q.isPrimaryKey?W:W.index(q.name),$=c($);if(U===0)return w({result:[]});b?((K=F?q.getAll($,K):q.getAllKeys($,K)).onsuccess=function(X){return w({result:X.target.result})},K.onerror=ft(I)):(R=0,M=!F&&"openKeyCursor"in q?q.openKeyCursor($):q.openCursor($),k=[],M.onsuccess=function(X){var te=M.result;return te?(k.push(F?te.value:te.primaryKey),++R===U?w({result:k}):void te.continue()):w({result:k})},M.onerror=ft(I))})}),openCursor:function(A){var w=A.trans,I=A.values,R=A.query,M=A.reverse,k=A.unique;return new Promise(function(F,U){F=be(F);var q=R.index,K=R.range,W=w.objectStore(S),W=q.isPrimaryKey?W:W.index(q.name),q=M?k?"prevunique":"prev":k?"nextunique":"next",$=!I&&"openKeyCursor"in W?W.openKeyCursor(c(K),q):W.openCursor(c(K),q);$.onerror=ft(U),$.onsuccess=be(function(X){var te,ae,ie,st,oe=$.result;oe?(oe.___id=++nd,oe.done=!1,te=oe.continue.bind(oe),ae=(ae=oe.continuePrimaryKey)&&ae.bind(oe),ie=oe.advance.bind(oe),st=function(){throw new Error("Cursor not stopped")},oe.trans=w,oe.stop=oe.continue=oe.continuePrimaryKey=oe.advance=function(){throw new Error("Cursor not started")},oe.fail=be(U),oe.next=function(){var je=this,Le=1;return this.start(function(){return Le--?je.continue():je.stop()}).then(function(){return je})},oe.start=function(je){function Le(){if($.result)try{je()}catch(Be){oe.fail(Be)}else oe.done=!0,oe.start=function(){throw new Error("Cursor behind last entry")},oe.stop()}var Ei=new Promise(function(Be,on){Be=be(Be),$.onerror=ft(on),oe.fail=on,oe.stop=function(Jo){oe.stop=oe.continue=oe.continuePrimaryKey=oe.advance=st,Be(Jo)}});return $.onsuccess=be(function(Be){$.onsuccess=Le,Le()}),oe.continue=te,oe.continuePrimaryKey=ae,oe.advance=ie,Le(),Ei},F(oe)):F(null)},U)})},count:function(A){var w=A.query,I=A.trans,R=w.index,M=w.range;return new Promise(function(k,F){var U=I.objectStore(S),K=R.isPrimaryKey?U:U.index(R.name),U=c(M),K=U?K.count(U):K.count();K.onsuccess=be(function(W){return k(W.target.result)}),K.onerror=ft(F)})}}}var h,d,v,O=(d=_,v=Ys((h=r).objectStoreNames),{schema:{name:h.name,tables:v.map(function(C){return d.objectStore(C)}).map(function(C){var b=C.keyPath,w=C.autoIncrement,S=p(b),A={},w={name:C.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:b==null,compound:S,keyPath:b,autoIncrement:w,unique:!0,extractKey:No(b)},indexes:Ys(C.indexNames).map(function(I){return C.index(I)}).map(function(k){var R=k.name,M=k.unique,F=k.multiEntry,k=k.keyPath,F={name:R,compound:p(k),keyPath:k,unique:M,multiEntry:F,extractKey:No(k)};return A[tr(k)]=F}),getIndexByKeyPath:function(I){return A[tr(I)]}};return A[":id"]=w.primaryKey,b!=null&&(A[tr(b)]=w.primaryKey),w})},hasGetAll:0<v.length&&"getAll"in d.objectStore(v[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),_=O.schema,m=O.hasGetAll,O=_.tables.map(l),y={};return O.forEach(function(C){return y[C.name]=C}),{stack:"dbcore",transaction:r.transaction.bind(r),table:function(C){if(!y[C])throw new Error("Table '".concat(C,"' not found"));return y[C]},MIN_KEY:-1/0,MAX_KEY:er(i),schema:_}}function id(r,i,s,c){var l=s.IDBKeyRange;return s.indexedDB,{dbcore:(c=rd(i,l,c),r.dbcore.reduce(function(h,d){return d=d.create,o(o({},h),d(h))},c))}}function li(r,c){var s=c.db,c=id(r._middlewares,s,r._deps,c);r.core=c.dbcore,r.tables.forEach(function(l){var h=l.name;r.core.schema.tables.some(function(d){return d.name===h})&&(l.core=r.core.table(h),r[h]instanceof r.Table&&(r[h].core=l.core))})}function fi(r,i,s,c){s.forEach(function(l){var h=c[l];i.forEach(function(d){var v=function _(m,O){return He(m,O)||(m=g(m))&&_(m,O)}(d,l);(!v||"value"in v&&v.value===void 0)&&(d===r.Transaction.prototype||d instanceof r.Transaction?Z(d,l,{get:function(){return this.table(l)},set:function(_){Q(this,l,{value:_,writable:!0,configurable:!0,enumerable:!0})}}):d[l]=new r.Table(l,h))})})}function Ro(r,i){i.forEach(function(s){for(var c in s)s[c]instanceof r.Table&&delete s[c]})}function od(r,i){return r._cfg.version-i._cfg.version}function ad(r,i,s,c){var l=r._dbSchema;s.objectStoreNames.contains("$meta")&&!l.$meta&&(l.$meta=Do("$meta",Js("")[0],[]),r._storeNames.push("$meta"));var h=r._createTransaction("readwrite",r._storeNames,l);h.create(s),h._completion.catch(c);var d=h._reject.bind(h),v=L.transless||L;Nt(function(){return L.trans=h,L.transless=v,i!==0?(li(r,s),m=i,((_=h).storeNames.includes("$meta")?_.table("$meta").get("version").then(function(O){return O??m}):N.resolve(m)).then(function(O){return C=O,b=h,S=s,A=[],O=(y=r)._versions,w=y._dbSchema=di(0,y.idbdb,S),(O=O.filter(function(I){return I._cfg.version>=C})).length!==0?(O.forEach(function(I){A.push(function(){var R=w,M=I._cfg.dbschema;pi(y,R,S),pi(y,M,S),w=y._dbSchema=M;var k=Mo(R,M);k.add.forEach(function(q){ko(S,q[0],q[1].primKey,q[1].indexes)}),k.change.forEach(function(q){if(q.recreate)throw new Y.Upgrade("Not yet support for changing primary key");var $=S.objectStore(q.name);q.add.forEach(function(X){return hi($,X)}),q.change.forEach(function(X){$.deleteIndex(X.name),hi($,X)}),q.del.forEach(function(X){return $.deleteIndex(X)})});var F=I._cfg.contentUpgrade;if(F&&I._cfg.version>C){li(y,S),b._memoizedTables={};var U=mn(M);k.del.forEach(function(q){U[q]=R[q]}),Ro(y,[y.Transaction.prototype]),fi(y,[y.Transaction.prototype],f(U),U),b.schema=U;var K,W=_n(F);return W&&En(),k=N.follow(function(){var q;(K=F(b))&&W&&(q=Rt.bind(null,null),K.then(q,q))}),K&&typeof K.then=="function"?N.resolve(K):k.then(function(){return K})}}),A.push(function(R){var M,k,F=I._cfg.dbschema;M=F,k=R,[].slice.call(k.db.objectStoreNames).forEach(function(U){return M[U]==null&&k.db.deleteObjectStore(U)}),Ro(y,[y.Transaction.prototype]),fi(y,[y.Transaction.prototype],y._storeNames,y._dbSchema),b.schema=y._dbSchema}),A.push(function(R){y.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(y.idbdb.version/10)===I._cfg.version?(y.idbdb.deleteObjectStore("$meta"),delete y._dbSchema.$meta,y._storeNames=y._storeNames.filter(function(M){return M!=="$meta"})):R.objectStore("$meta").put(I._cfg.version,"version"))})}),function I(){return A.length?N.resolve(A.shift()(b.idbtrans)).then(I):N.resolve()}().then(function(){Qs(w,S)})):N.resolve();var y,C,b,S,A,w}).catch(d)):(f(l).forEach(function(O){ko(s,O,l[O].primKey,l[O].indexes)}),li(r,s),void N.follow(function(){return r.on.populate.fire(h)}).catch(d));var _,m})}function sd(r,i){Qs(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 s=di(0,r.idbdb,i);pi(r,r._dbSchema,i);for(var c=0,l=Mo(s,r._dbSchema).change;c<l.length;c++){var h=function(d){if(d.change.length||d.recreate)return console.warn("Unable to patch indexes of table ".concat(d.name," because it has changes on the type of index or primary key.")),{value:void 0};var v=i.objectStore(d.name);d.add.forEach(function(_){Ue&&console.debug("Dexie upgrade patch: Creating missing index ".concat(d.name,".").concat(_.src)),hi(v,_)})}(l[c]);if(typeof h=="object")return h.value}}function Mo(r,i){var s,c={del:[],add:[],change:[]};for(s in r)i[s]||c.del.push(s);for(s in i){var l=r[s],h=i[s];if(l){var d={name:s,def:h,recreate:!1,del:[],add:[],change:[]};if(""+(l.primKey.keyPath||"")!=""+(h.primKey.keyPath||"")||l.primKey.auto!==h.primKey.auto)d.recreate=!0,c.change.push(d);else{var v=l.idxByName,_=h.idxByName,m=void 0;for(m in v)_[m]||d.del.push(m);for(m in _){var O=v[m],y=_[m];O?O.src!==y.src&&d.change.push(y):d.add.push(y)}(0<d.del.length||0<d.add.length||0<d.change.length)&&c.change.push(d)}}else c.add.push([s,h])}return c}function ko(r,i,s,c){var l=r.db.createObjectStore(i,s.keyPath?{keyPath:s.keyPath,autoIncrement:s.auto}:{autoIncrement:s.auto});return c.forEach(function(h){return hi(l,h)}),l}function Qs(r,i){f(r).forEach(function(s){i.db.objectStoreNames.contains(s)||(Ue&&console.debug("Dexie: Creating missing table",s),ko(i,s,r[s].primKey,r[s].indexes))})}function hi(r,i){r.createIndex(i.name,i.keyPath,{unique:i.unique,multiEntry:i.multi})}function di(r,i,s){var c={};return We(i.objectStoreNames,0).forEach(function(l){for(var h=s.objectStore(l),d=Io(Gs(m=h.keyPath),m||"",!0,!1,!!h.autoIncrement,m&&typeof m!="string",!0),v=[],_=0;_<h.indexNames.length;++_){var O=h.index(h.indexNames[_]),m=O.keyPath,O=Io(O.name,m,!!O.unique,!!O.multiEntry,!1,m&&typeof m!="string",!1);v.push(O)}c[l]=Do(l,d,v)}),c}function pi(r,i,s){for(var c=s.db.objectStoreNames,l=0;l<c.length;++l){var h=c[l],d=s.objectStore(h);r._hasGetAll="getAll"in d;for(var v=0;v<d.indexNames.length;++v){var _=d.indexNames[v],m=d.index(_).keyPath,O=typeof m=="string"?m:"["+We(m).join("+")+"]";!i[h]||(m=i[h].idxByName[O])&&(m.name=_,delete i[h].idxByName[O],i[h].idxByName[_]=m)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&u.WorkerGlobalScope&&u instanceof u.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(r._hasGetAll=!1)}function Js(r){return r.split(",").map(function(i,s){var c=(i=i.trim()).replace(/([&*]|\+\+)/g,""),l=/^\[/.test(c)?c.match(/^\[(.*)\]$/)[1].split("+"):c;return Io(c,l||null,/\&/.test(i),/\*/.test(i),/\+\+/.test(i),p(l),s===0)})}var ud=(gi.prototype._parseStoresSpec=function(r,i){f(r).forEach(function(s){if(r[s]!==null){var c=Js(r[s]),l=c.shift();if(l.unique=!0,l.multi)throw new Y.Schema("Primary key cannot be multi-valued");c.forEach(function(h){if(h.auto)throw new Y.Schema("Only primary key can be marked as autoIncrement (++)");if(!h.keyPath)throw new Y.Schema("Index must have a name and cannot be an empty string")}),i[s]=Do(s,l,c)}})},gi.prototype.stores=function(s){var i=this.db;this._cfg.storesSource=this._cfg.storesSource?E(this._cfg.storesSource,s):s;var s=i._versions,c={},l={};return s.forEach(function(h){E(c,h._cfg.storesSource),l=h._cfg.dbschema={},h._parseStoresSpec(c,l)}),i._dbSchema=l,Ro(i,[i._allTables,i,i.Transaction.prototype]),fi(i,[i._allTables,i,i.Transaction.prototype,this._cfg.tables],f(l),l),i._storeNames=f(l),this},gi.prototype.upgrade=function(r){return this._cfg.contentUpgrade=wn(this._cfg.contentUpgrade||se,r),this},gi);function gi(){}function jo(r,i){var s=r._dbNamesDB;return s||(s=r._dbNamesDB=new Et(oi,{addons:[],indexedDB:r,IDBKeyRange:i})).version(1).stores({dbnames:"name"}),s.table("dbnames")}function Lo(r){return r&&typeof r.databases=="function"}function Fo(r){return Nt(function(){return L.letThrough=!0,r()})}function Bo(r){return!("from"in r)}var ke=function(r,i){if(!this){var s=new ke;return r&&"d"in r&&E(s,r),s}E(this,arguments.length?{d:1,from:r,to:1<arguments.length?i:r}:{d:0})};function nr(r,i,s){var c=le(i,s);if(!isNaN(c)){if(0<c)throw RangeError();if(Bo(r))return E(r,{from:i,to:s,d:1});var l=r.l,c=r.r;if(le(s,r.from)<0)return l?nr(l,i,s):r.l={from:i,to:s,d:1,l:null,r:null},Xs(r);if(0<le(i,r.to))return c?nr(c,i,s):r.r={from:i,to:s,d:1,l:null,r:null},Xs(r);le(i,r.from)<0&&(r.from=i,r.l=null,r.d=c?c.d+1:1),0<le(s,r.to)&&(r.to=s,r.r=null,r.d=r.l?r.l.d+1:1),s=!r.r,l&&!r.l&&rr(r,l),c&&s&&rr(r,c)}}function rr(r,i){Bo(i)||function s(c,_){var h=_.from,d=_.to,v=_.l,_=_.r;nr(c,h,d),v&&s(c,v),_&&s(c,_)}(r,i)}function vi(r,i){var s=Ko(i),c=s.next();if(c.done)return!1;for(var l=c.value,h=Ko(r),d=h.next(l.from),v=d.value;!c.done&&!d.done;){if(le(v.from,l.to)<=0&&0<=le(v.to,l.from))return!0;le(l.from,v.from)<0?l=(c=s.next(v.from)).value:v=(d=h.next(l.from)).value}return!1}function Ko(r){var i=Bo(r)?null:{s:0,n:r};return{next:function(s){for(var c=0<arguments.length;i;)switch(i.s){case 0:if(i.s=1,c)for(;i.n.l&&le(s,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,!c||le(s,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 Xs(r){var i,s,c=(((i=r.r)===null||i===void 0?void 0:i.d)||0)-(((s=r.l)===null||s===void 0?void 0:s.d)||0),l=1<c?"r":c<-1?"l":"";l&&(i=l=="r"?"l":"r",s=o({},r),c=r[l],r.from=c.from,r.to=c.to,r[l]=c[l],s[l]=c[i],(r[i]=s).d=Zs(s)),r.d=Zs(r)}function Zs(s){var i=s.r,s=s.l;return(i?s?Math.max(i.d,s.d):i.d:s?s.d:0)+1}function yi(r,i){return f(i).forEach(function(s){r[s]?rr(r[s],i[s]):r[s]=function c(l){var h,d,v={};for(h in l)P(l,h)&&(d=l[h],v[h]=!d||typeof d!="object"||Wr.has(d.constructor)?d:c(d));return v}(i[s])}),r}function Vo(r,i){return r.all||i.all||Object.keys(r).some(function(s){return i[s]&&vi(i[s],r[s])})}B(ke.prototype,((tt={add:function(r){return rr(this,r),this},addKey:function(r){return nr(this,r,r),this},addKeys:function(r){var i=this;return r.forEach(function(s){return nr(i,s,s)}),this}})[bn]=function(){return Ko(this)},tt));var nn={},$o={},Wo=!1;function mi(r){yi($o,r),Wo||(Wo=!0,setTimeout(function(){Wo=!1,Uo($o,!($o={}))},0))}function Uo(r,i){i===void 0&&(i=!1);var s=new Set;if(r.all)for(var c=0,l=Object.values(nn);c<l.length;c++)eu(d=l[c],r,s,i);else for(var h in r){var d,v=/^idb\:\/\/(.*)\/(.*)\//.exec(h);v&&(h=v[1],v=v[2],(d=nn["idb://".concat(h,"/").concat(v)])&&eu(d,r,s,i))}s.forEach(function(_){return _()})}function eu(r,i,s,c){for(var l=[],h=0,d=Object.entries(r.queries.query);h<d.length;h++){for(var v=d[h],_=v[0],m=[],O=0,y=v[1];O<y.length;O++){var C=y[O];Vo(i,C.obsSet)?C.subscribers.forEach(function(w){return s.add(w)}):c&&m.push(C)}c&&l.push([_,m])}if(c)for(var b=0,S=l;b<S.length;b++){var A=S[b],_=A[0],m=A[1];r.queries.query[_]=m}}function cd(r){var i=r._state,s=r._deps.indexedDB;if(i.isBeingOpened||r.idbdb)return i.dbReadyPromise.then(function(){return i.dbOpenError?Oe(i.dbOpenError):r});i.isBeingOpened=!0,i.dbOpenError=null,i.openComplete=!1;var c=i.openCanceller,l=Math.round(10*r.verno),h=!1;function d(){if(i.openCanceller!==c)throw new Y.DatabaseClosed("db.open() was cancelled")}function v(){return new N(function(C,b){if(d(),!s)throw new Y.MissingAPI;var S=r.name,A=i.autoSchema||!l?s.open(S):s.open(S,l);if(!A)throw new Y.MissingAPI;A.onerror=ft(b),A.onblocked=be(r._fireOnBlocked),A.onupgradeneeded=be(function(w){var I;O=A.transaction,i.autoSchema&&!r._options.allowEmptyDB?(A.onerror=Xn,O.abort(),A.result.close(),(I=s.deleteDatabase(S)).onsuccess=I.onerror=be(function(){b(new Y.NoSuchDatabase("Database ".concat(S," doesnt exist")))})):(O.onerror=ft(b),w=w.oldVersion>Math.pow(2,62)?0:w.oldVersion,y=w<1,r.idbdb=A.result,h&&sd(r,O),ad(r,w/10,O,b))},b),A.onsuccess=be(function(){O=null;var w,I,R,M,k,F=r.idbdb=A.result,U=We(F.objectStoreNames);if(0<U.length)try{var K=F.transaction((M=U).length===1?M[0]:M,"readonly");if(i.autoSchema)I=F,R=K,(w=r).verno=I.version/10,R=w._dbSchema=di(0,I,R),w._storeNames=We(I.objectStoreNames,0),fi(w,[w._allTables],f(R),R);else if(pi(r,r._dbSchema,K),((k=Mo(di(0,(k=r).idbdb,K),k._dbSchema)).add.length||k.change.some(function(W){return W.add.length||W.change.length}))&&!h)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."),F.close(),l=F.version+1,h=!0,C(v());li(r,K)}catch{}Sn.push(r),F.onversionchange=be(function(W){i.vcFired=!0,r.on("versionchange").fire(W)}),F.onclose=be(function(W){r.on("close").fire(W)}),y&&(k=r._deps,K=S,F=k.indexedDB,k=k.IDBKeyRange,Lo(F)||K===oi||jo(F,k).put({name:K}).catch(se)),C()},b)}).catch(function(C){switch(C==null?void 0:C.name){case"UnknownError":if(0<i.PR1398_maxLoop)return i.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),v();break;case"VersionError":if(0<l)return l=0,v()}return N.reject(C)})}var _,m=i.dbReadyResolve,O=null,y=!1;return N.race([c,(typeof navigator>"u"?N.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(C){function b(){return indexedDB.databases().finally(C)}_=setInterval(b,100),b()}).finally(function(){return clearInterval(_)}):Promise.resolve()).then(v)]).then(function(){return d(),i.onReadyBeingFired=[],N.resolve(Fo(function(){return r.on.ready.fire(r.vip)})).then(function C(){if(0<i.onReadyBeingFired.length){var b=i.onReadyBeingFired.reduce(wn,se);return i.onReadyBeingFired=[],N.resolve(Fo(function(){return b(r.vip)})).then(C)}})}).finally(function(){i.openCanceller===c&&(i.onReadyBeingFired=null,i.isBeingOpened=!1)}).catch(function(C){i.dbOpenError=C;try{O&&O.abort()}catch{}return c===i.openCanceller&&r._close(),Oe(C)}).finally(function(){i.openComplete=!0,m()}).then(function(){var C;return y&&(C={},r.tables.forEach(function(b){b.schema.indexes.forEach(function(S){S.name&&(C["idb://".concat(r.name,"/").concat(b.name,"/").concat(S.name)]=new ke(-1/0,[[[]]]))}),C["idb://".concat(r.name,"/").concat(b.name,"/")]=C["idb://".concat(r.name,"/").concat(b.name,"/:dels")]=new ke(-1/0,[[[]]])}),jt(Zn).fire(C),Uo(C,!0)),r})}function qo(r){function i(h){return r.next(h)}var s=l(i),c=l(function(h){return r.throw(h)});function l(h){return function(_){var v=h(_),_=v.value;return v.done?_:_&&typeof _.then=="function"?_.then(s,c):p(_)?Promise.all(_).then(s,c):s(_)}}return l(i)()}function bi(r,i,s){for(var c=p(r)?r.slice():[r],l=0;l<s;++l)c.push(i);return c}var ld={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(r){return o(o({},r),{table:function(i){var s=r.table(i),c=s.schema,l={},h=[];function d(y,C,b){var S=tr(y),A=l[S]=l[S]||[],w=y==null?0:typeof y=="string"?1:y.length,I=0<C,I=o(o({},b),{name:I?"".concat(S,"(virtual-from:").concat(b.name,")"):b.name,lowLevelIndex:b,isVirtual:I,keyTail:C,keyLength:w,extractKey:No(y),unique:!I&&b.unique});return A.push(I),I.isPrimaryKey||h.push(I),1<w&&d(w===2?y[0]:y.slice(0,w-1),C+1,b),A.sort(function(R,M){return R.keyTail-M.keyTail}),I}i=d(c.primaryKey.keyPath,0,c.primaryKey),l[":id"]=[i];for(var v=0,_=c.indexes;v<_.length;v++){var m=_[v];d(m.keyPath,0,m)}function O(y){var C,b=y.query.index;return b.isVirtual?o(o({},y),{query:{index:b.lowLevelIndex,range:(C=y.query.range,b=b.keyTail,{type:C.type===1?2:C.type,lower:bi(C.lower,C.lowerOpen?r.MAX_KEY:r.MIN_KEY,b),lowerOpen:!0,upper:bi(C.upper,C.upperOpen?r.MIN_KEY:r.MAX_KEY,b),upperOpen:!0})}}):y}return o(o({},s),{schema:o(o({},c),{primaryKey:i,indexes:h,getIndexByKeyPath:function(y){return(y=l[tr(y)])&&y[0]}}),count:function(y){return s.count(O(y))},query:function(y){return s.query(O(y))},openCursor:function(y){var C=y.query.index,b=C.keyTail,S=C.isVirtual,A=C.keyLength;return S?s.openCursor(O(y)).then(function(I){return I&&w(I)}):s.openCursor(y);function w(I){return Object.create(I,{continue:{value:function(R){R!=null?I.continue(bi(R,y.reverse?r.MAX_KEY:r.MIN_KEY,b)):y.unique?I.continue(I.key.slice(0,A).concat(y.reverse?r.MIN_KEY:r.MAX_KEY,b)):I.continue()}},continuePrimaryKey:{value:function(R,M){I.continuePrimaryKey(bi(R,r.MAX_KEY,b),M)}},primaryKey:{get:function(){return I.primaryKey}},key:{get:function(){var R=I.key;return A===1?R[0]:R.slice(0,A)}},value:{get:function(){return I.value}}})}}})}})}};function Ho(r,i,s,c){return s=s||{},c=c||"",f(r).forEach(function(l){var h,d,v;P(i,l)?(h=r[l],d=i[l],typeof h=="object"&&typeof d=="object"&&h&&d?(v=Gt(h))!==Gt(d)?s[c+l]=i[l]:v==="Object"?Ho(h,d,s,c+l+"."):h!==d&&(s[c+l]=i[l]):h!==d&&(s[c+l]=i[l])):s[c+l]=void 0}),f(i).forEach(function(l){P(r,l)||(s[c+l]=i[l])}),s}function zo(r,i){return i.type==="delete"?i.keys:i.keys||i.values.map(r.extractKey)}var fd={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(r){return o(o({},r),{table:function(i){var s=r.table(i),c=s.schema.primaryKey;return o(o({},s),{mutate:function(l){var h=L.trans,d=h.table(i).hook,v=d.deleting,_=d.creating,m=d.updating;switch(l.type){case"add":if(_.fire===se)break;return h._promise("readwrite",function(){return O(l)},!0);case"put":if(_.fire===se&&m.fire===se)break;return h._promise("readwrite",function(){return O(l)},!0);case"delete":if(v.fire===se)break;return h._promise("readwrite",function(){return O(l)},!0);case"deleteRange":if(v.fire===se)break;return h._promise("readwrite",function(){return function y(C,b,S){return s.query({trans:C,values:!1,query:{index:c,range:b},limit:S}).then(function(A){var w=A.result;return O({type:"delete",keys:w,trans:C}).then(function(I){return 0<I.numFailures?Promise.reject(I.failures[0]):w.length<S?{failures:[],numFailures:0,lastResult:void 0}:y(C,o(o({},b),{lower:w[w.length-1],lowerOpen:!0}),S)})})}(l.trans,l.range,1e4)},!0)}return s.mutate(l);function O(y){var C,b,S,A=L.trans,w=y.keys||zo(c,y);if(!w)throw new Error("Keys missing");return(y=y.type==="add"||y.type==="put"?o(o({},y),{keys:w}):o({},y)).type!=="delete"&&(y.values=a([],y.values)),y.keys&&(y.keys=a([],y.keys)),C=s,S=w,((b=y).type==="add"?Promise.resolve([]):C.getMany({trans:b.trans,keys:S,cache:"immutable"})).then(function(I){var R=w.map(function(M,k){var F,U,K,W=I[k],q={onerror:null,onsuccess:null};return y.type==="delete"?v.fire.call(q,M,W,A):y.type==="add"||W===void 0?(F=_.fire.call(q,M,y.values[k],A),M==null&&F!=null&&(y.keys[k]=M=F,c.outbound||Pe(y.values[k],c.keyPath,M))):(F=Ho(W,y.values[k]),(U=m.fire.call(q,F,M,W,A))&&(K=y.values[k],Object.keys(U).forEach(function($){P(K,$)?K[$]=U[$]:Pe(K,$,U[$])}))),q});return s.mutate(y).then(function(M){for(var k=M.failures,F=M.results,U=M.numFailures,M=M.lastResult,K=0;K<w.length;++K){var W=(F||w)[K],q=R[K];W==null?q.onerror&&q.onerror(k[K]):q.onsuccess&&q.onsuccess(y.type==="put"&&I[K]?y.values[K]:W)}return{failures:k,results:F,numFailures:U,lastResult:M}}).catch(function(M){return R.forEach(function(k){return k.onerror&&k.onerror(M)}),Promise.reject(M)})})}}})}})}};function tu(r,i,s){try{if(!i||i.keys.length<r.length)return null;for(var c=[],l=0,h=0;l<i.keys.length&&h<r.length;++l)le(i.keys[l],r[h])===0&&(c.push(s?ct(i.values[l]):i.values[l]),++h);return c.length===r.length?c:null}catch{return null}}var hd={stack:"dbcore",level:-1,create:function(r){return{table:function(i){var s=r.table(i);return o(o({},s),{getMany:function(c){if(!c.cache)return s.getMany(c);var l=tu(c.keys,c.trans._cache,c.cache==="clone");return l?N.resolve(l):s.getMany(c).then(function(h){return c.trans._cache={keys:c.keys,values:c.cache==="clone"?ct(h):h},h})},mutate:function(c){return c.type!=="add"&&(c.trans._cache=null),s.mutate(c)}})}}}};function nu(r,i){return r.trans.mode==="readonly"&&!!r.subscr&&!r.trans.explicit&&r.trans.db._options.cache!=="disabled"&&!i.schema.primaryKey.outbound}function ru(r,i){switch(r){case"query":return i.values&&!i.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var dd={stack:"dbcore",level:0,name:"Observability",create:function(r){var i=r.schema.name,s=new ke(r.MIN_KEY,r.MAX_KEY);return o(o({},r),{transaction:function(c,l,h){if(L.subscr&&l!=="readonly")throw new Y.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(L.querier));return r.transaction(c,l,h)},table:function(c){var l=r.table(c),h=l.schema,d=h.primaryKey,y=h.indexes,v=d.extractKey,_=d.outbound,m=d.autoIncrement&&y.filter(function(b){return b.compound&&b.keyPath.includes(d.keyPath)}),O=o(o({},l),{mutate:function(b){function S($){return $="idb://".concat(i,"/").concat(c,"/").concat($),M[$]||(M[$]=new ke)}var A,w,I,R=b.trans,M=b.mutatedParts||(b.mutatedParts={}),k=S(""),F=S(":dels"),U=b.type,q=b.type==="deleteRange"?[b.range]:b.type==="delete"?[b.keys]:b.values.length<50?[zo(d,b).filter(function($){return $}),b.values]:[],K=q[0],W=q[1],q=b.trans._cache;return p(K)?(k.addKeys(K),(q=U==="delete"||K.length===W.length?tu(K,q):null)||F.addKeys(K),(q||W)&&(A=S,w=q,I=W,h.indexes.forEach(function($){var X=A($.name||"");function te(ie){return ie!=null?$.extractKey(ie):null}function ae(ie){return $.multiEntry&&p(ie)?ie.forEach(function(st){return X.addKey(st)}):X.addKey(ie)}(w||I).forEach(function(ie,je){var oe=w&&te(w[je]),je=I&&te(I[je]);le(oe,je)!==0&&(oe!=null&&ae(oe),je!=null&&ae(je))})}))):K?(W={from:K.lower,to:K.upper},F.add(W),k.add(W)):(k.add(s),F.add(s),h.indexes.forEach(function($){return S($.name).add(s)})),l.mutate(b).then(function($){return!K||b.type!=="add"&&b.type!=="put"||(k.addKeys($.results),m&&m.forEach(function(X){var te=b.values.map(function(ie){return X.extractKey(ie)}),ae=X.keyPath.findIndex(function(ie){return ie===d.keyPath});$.results.forEach(function(ie){return te[ae]=ie}),S(X.name).addKeys(te)})),R.mutatedParts=yi(R.mutatedParts||{},M),$})}}),y=function(S){var A=S.query,S=A.index,A=A.range;return[S,new ke((S=A.lower)!==null&&S!==void 0?S:r.MIN_KEY,(A=A.upper)!==null&&A!==void 0?A:r.MAX_KEY)]},C={get:function(b){return[d,new ke(b.key)]},getMany:function(b){return[d,new ke().addKeys(b.keys)]},count:y,query:y,openCursor:y};return f(C).forEach(function(b){O[b]=function(S){var A=L.subscr,w=!!A,I=nu(L,l)&&ru(b,S)?S.obsSet={}:A;if(w){var R=function(W){return W="idb://".concat(i,"/").concat(c,"/").concat(W),I[W]||(I[W]=new ke)},M=R(""),k=R(":dels"),A=C[b](S),w=A[0],A=A[1];if((b==="query"&&w.isPrimaryKey&&!S.values?k:R(w.name||"")).add(A),!w.isPrimaryKey){if(b!=="count"){var F=b==="query"&&_&&S.values&&l.query(o(o({},S),{values:!1}));return l[b].apply(this,arguments).then(function(W){if(b==="query"){if(_&&S.values)return F.then(function(te){return te=te.result,M.addKeys(te),W});var q=S.values?W.result.map(v):W.result;(S.values?M:k).addKeys(q)}else if(b==="openCursor"){var $=W,X=S.values;return $&&Object.create($,{key:{get:function(){return k.addKey($.primaryKey),$.key}},primaryKey:{get:function(){var te=$.primaryKey;return k.addKey(te),te}},value:{get:function(){return X&&M.addKey($.primaryKey),$.value}}})}return W})}k.add(s)}}return l[b].apply(this,arguments)}}),O}})}};function iu(r,i,s){if(s.numFailures===0)return i;if(i.type==="deleteRange")return null;var c=i.keys?i.keys.length:"values"in i&&i.values?i.values.length:1;return s.numFailures===c?null:(i=o({},i),p(i.keys)&&(i.keys=i.keys.filter(function(l,h){return!(h in s.failures)})),"values"in i&&p(i.values)&&(i.values=i.values.filter(function(l,h){return!(h in s.failures)})),i)}function Go(r,i){return s=r,((c=i).lower===void 0||(c.lowerOpen?0<le(s,c.lower):0<=le(s,c.lower)))&&(r=r,(i=i).upper===void 0||(i.upperOpen?le(r,i.upper)<0:le(r,i.upper)<=0));var s,c}function ou(r,i,C,c,l,h){if(!C||C.length===0)return r;var d=i.query.index,v=d.multiEntry,_=i.query.range,m=c.schema.primaryKey.extractKey,O=d.extractKey,y=(d.lowLevelIndex||d).extractKey,C=C.reduce(function(b,S){var A=b,w=S.type==="add"||S.type==="put"?S.values.filter(function(k){return k=O(k),v&&p(k)?k.some(function(F){return Go(F,_)}):Go(k,_)}).map(function(k){return k=ct(k),h&&Object.freeze(k),k}):[];switch(S.type){case"add":A=b.concat(i.values?w:w.map(function(F){return m(F)}));break;case"put":var I=new ke().addKeys(S.values.map(function(F){return m(F)})),A=b.filter(function(F){return F=i.values?m(F):F,!vi(new ke(F),I)}).concat(i.values?w:w.map(function(F){return m(F)}));break;case"delete":var R=new ke().addKeys(S.keys);A=b.filter(function(F){return F=i.values?m(F):F,!vi(new ke(F),R)});break;case"deleteRange":var M=S.range;A=b.filter(function(F){return!Go(m(F),M)})}return A},r);return C===r?r:(C.sort(function(b,S){return le(y(b),y(S))||le(m(b),m(S))}),i.limit&&i.limit<1/0&&(C.length>i.limit?C.length=i.limit:r.length===i.limit&&C.length<i.limit&&(l.dirty=!0)),h?Object.freeze(C):C)}function au(r,i){return le(r.lower,i.lower)===0&&le(r.upper,i.upper)===0&&!!r.lowerOpen==!!i.lowerOpen&&!!r.upperOpen==!!i.upperOpen}function pd(r,i){return function(s,c,l,h){if(s===void 0)return c!==void 0?-1:0;if(c===void 0)return 1;if((c=le(s,c))===0){if(l&&h)return 0;if(l)return 1;if(h)return-1}return c}(r.lower,i.lower,r.lowerOpen,i.lowerOpen)<=0&&0<=function(s,c,l,h){if(s===void 0)return c!==void 0?1:0;if(c===void 0)return-1;if((c=le(s,c))===0){if(l&&h)return 0;if(l)return-1;if(h)return 1}return c}(r.upper,i.upper,r.upperOpen,i.upperOpen)}function gd(r,i,s,c){r.subscribers.add(s),c.addEventListener("abort",function(){var l,h;r.subscribers.delete(s),r.subscribers.size===0&&(l=r,h=i,setTimeout(function(){l.subscribers.size===0&<(h,l)},3e3))})}var vd={stack:"dbcore",level:0,name:"Cache",create:function(r){var i=r.schema.name;return o(o({},r),{transaction:function(s,c,l){var h,d,v=r.transaction(s,c,l);return c==="readwrite"&&(d=(h=new AbortController).signal,l=function(_){return function(){if(h.abort(),c==="readwrite"){for(var m=new Set,O=0,y=s;O<y.length;O++){var C=y[O],b=nn["idb://".concat(i,"/").concat(C)];if(b){var S=r.table(C),A=b.optimisticOps.filter(function(X){return X.trans===v});if(v._explicit&&_&&v.mutatedParts)for(var w=0,I=Object.values(b.queries.query);w<I.length;w++)for(var R=0,M=(U=I[w]).slice();R<M.length;R++)Vo((K=M[R]).obsSet,v.mutatedParts)&&(lt(U,K),K.subscribers.forEach(function(X){return m.add(X)}));else if(0<A.length){b.optimisticOps=b.optimisticOps.filter(function(X){return X.trans!==v});for(var k=0,F=Object.values(b.queries.query);k<F.length;k++)for(var U,K,W,q=0,$=(U=F[k]).slice();q<$.length;q++)(K=$[q]).res!=null&&v.mutatedParts&&(_&&!K.dirty?(W=Object.isFrozen(K.res),W=ou(K.res,K.req,A,S,K,W),K.dirty?(lt(U,K),K.subscribers.forEach(function(X){return m.add(X)})):W!==K.res&&(K.res=W,K.promise=N.resolve({result:W}))):(K.dirty&<(U,K),K.subscribers.forEach(function(X){return m.add(X)})))}}}m.forEach(function(X){return X()})}}},v.addEventListener("abort",l(!1),{signal:d}),v.addEventListener("error",l(!1),{signal:d}),v.addEventListener("complete",l(!0),{signal:d})),v},table:function(s){var c=r.table(s),l=c.schema.primaryKey;return o(o({},c),{mutate:function(h){var d=L.trans;if(l.outbound||d.db._options.cache==="disabled"||d.explicit)return c.mutate(h);var v=nn["idb://".concat(i,"/").concat(s)];return v?(d=c.mutate(h),h.type!=="add"&&h.type!=="put"||!(50<=h.values.length||zo(l,h).some(function(_){return _==null}))?(v.optimisticOps.push(h),h.mutatedParts&&mi(h.mutatedParts),d.then(function(_){0<_.numFailures&&(lt(v.optimisticOps,h),(_=iu(0,h,_))&&v.optimisticOps.push(_),h.mutatedParts&&mi(h.mutatedParts))}),d.catch(function(){lt(v.optimisticOps,h),h.mutatedParts&&mi(h.mutatedParts)})):d.then(function(_){var m=iu(0,o(o({},h),{values:h.values.map(function(b,y){var C,b=(C=l.keyPath)!==null&&C!==void 0&&C.includes(".")?ct(b):o({},b);return Pe(b,l.keyPath,_.results[y]),b})}),_);v.optimisticOps.push(m),queueMicrotask(function(){return h.mutatedParts&&mi(h.mutatedParts)})}),d):c.mutate(h)},query:function(h){if(!nu(L,c)||!ru("query",h))return c.query(h);var d=((m=L.trans)===null||m===void 0?void 0:m.db._options.cache)==="immutable",y=L,v=y.requery,_=y.signal,m=function(S,A,w,I){var R=nn["idb://".concat(S,"/").concat(A)];if(!R)return[];if(!(A=R.queries[w]))return[null,!1,R,null];var M=A[(I.query?I.query.index.name:null)||""];if(!M)return[null,!1,R,null];switch(w){case"query":var k=M.find(function(F){return F.req.limit===I.limit&&F.req.values===I.values&&au(F.req.query.range,I.query.range)});return k?[k,!0,R,M]:[M.find(function(F){return("limit"in F.req?F.req.limit:1/0)>=I.limit&&(!I.values||F.req.values)&&pd(F.req.query.range,I.query.range)}),!1,R,M];case"count":return k=M.find(function(F){return au(F.req.query.range,I.query.range)}),[k,!!k,R,M]}}(i,s,"query",h),O=m[0],y=m[1],C=m[2],b=m[3];return O&&y?O.obsSet=h.obsSet:(y=c.query(h).then(function(S){var A=S.result;if(O&&(O.res=A),d){for(var w=0,I=A.length;w<I;++w)Object.freeze(A[w]);Object.freeze(A)}else S.result=ct(A);return S}).catch(function(S){return b&&O&<(b,O),Promise.reject(S)}),O={obsSet:h.obsSet,promise:y,subscribers:new Set,type:"query",req:h,dirty:!1},b?b.push(O):(b=[O],(C=C||(nn["idb://".concat(i,"/").concat(s)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[h.query.index.name||""]=b)),gd(O,b,v,_),O.promise.then(function(S){return{result:ou(S.result,h,C==null?void 0:C.optimisticOps,c,O,d)}})}})}})}};function _i(r,i){return new Proxy(r,{get:function(s,c,l){return c==="db"?i:Reflect.get(s,c,l)}})}var Et=(Ce.prototype.version=function(r){if(isNaN(r)||r<.1)throw new Y.Type("Given version is not a positive number");if(r=Math.round(10*r)/10,this.idbdb||this._state.isBeingOpened)throw new Y.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,r);var i=this._versions,s=i.filter(function(c){return c._cfg.version===r})[0];return s||(s=new this.Version(r),i.push(s),i.sort(od),s.stores({}),this._state.autoSchema=!1,s)},Ce.prototype._whenReady=function(r){var i=this;return this.idbdb&&(this._state.openComplete||L.letThrough||this._vip)?r():new N(function(s,c){if(i._state.openComplete)return c(new Y.DatabaseClosed(i._state.dbOpenError));if(!i._state.isBeingOpened){if(!i._state.autoOpen)return void c(new Y.DatabaseClosed);i.open().catch(se)}i._state.dbReadyPromise.then(s,c)}).then(r)},Ce.prototype.use=function(r){var i=r.stack,s=r.create,c=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:s,level:c??10,name:l}),r.sort(function(h,d){return h.level-d.level}),this},Ce.prototype.unuse=function(r){var i=r.stack,s=r.name,c=r.create;return i&&this._middlewares[i]&&(this._middlewares[i]=this._middlewares[i].filter(function(l){return c?l.create!==c:!!s&&l.name!==s})),this},Ce.prototype.open=function(){var r=this;return Zt(V,function(){return cd(r)})},Ce.prototype._close=function(){var r=this._state,i=Sn.indexOf(this);if(0<=i&&Sn.splice(i,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}r.isBeingOpened||(r.dbReadyPromise=new N(function(s){r.dbReadyResolve=s}),r.openCanceller=new N(function(s,c){r.cancelOpen=c}))},Ce.prototype.close=function(s){var i=(s===void 0?{disableAutoOpen:!0}:s).disableAutoOpen,s=this._state;i?(s.isBeingOpened&&s.cancelOpen(new Y.DatabaseClosed),this._close(),s.autoOpen=!1,s.dbOpenError=new Y.DatabaseClosed):(this._close(),s.autoOpen=this._options.autoOpen||s.isBeingOpened,s.openComplete=!1,s.dbOpenError=null)},Ce.prototype.delete=function(r){var i=this;r===void 0&&(r={disableAutoOpen:!0});var s=0<arguments.length&&typeof arguments[0]!="object",c=this._state;return new N(function(l,h){function d(){i.close(r);var v=i._deps.indexedDB.deleteDatabase(i.name);v.onsuccess=be(function(){var _,m,O;_=i._deps,m=i.name,O=_.indexedDB,_=_.IDBKeyRange,Lo(O)||m===oi||jo(O,_).delete(m).catch(se),l()}),v.onerror=ft(h),v.onblocked=i._fireOnBlocked}if(s)throw new Y.InvalidArgument("Invalid closeOptions argument to db.delete()");c.isBeingOpened?c.dbReadyPromise.then(d):d()})},Ce.prototype.backendDB=function(){return this.idbdb},Ce.prototype.isOpen=function(){return this.idbdb!==null},Ce.prototype.hasBeenClosed=function(){var r=this._state.dbOpenError;return r&&r.name==="DatabaseClosed"},Ce.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Ce.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Ce.prototype,"tables",{get:function(){var r=this;return f(this._allTables).map(function(i){return r._allTables[i]})},enumerable:!1,configurable:!0}),Ce.prototype.transaction=function(){var r=(function(i,s,c){var l=arguments.length;if(l<2)throw new Y.InvalidArgument("Too few arguments");for(var h=new Array(l-1);--l;)h[l-1]=arguments[l];return c=h.pop(),[i,$r(h),c]}).apply(this,arguments);return this._transaction.apply(this,r)},Ce.prototype._transaction=function(r,i,s){var c=this,l=L.trans;l&&l.db===this&&r.indexOf("!")===-1||(l=null);var h,d,v=r.indexOf("?")!==-1;r=r.replace("!","").replace("?","");try{if(d=i.map(function(m){if(m=m instanceof c.Table?m.name:m,typeof m!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return m}),r=="r"||r===Oo)h=Oo;else{if(r!="rw"&&r!=Co)throw new Y.InvalidArgument("Invalid transaction mode: "+r);h=Co}if(l){if(l.mode===Oo&&h===Co){if(!v)throw new Y.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");l=null}l&&d.forEach(function(m){if(l&&l.storeNames.indexOf(m)===-1){if(!v)throw new Y.SubTransaction("Table "+m+" not included in parent transaction.");l=null}}),v&&l&&!l.active&&(l=null)}}catch(m){return l?l._promise(null,function(O,y){y(m)}):Oe(m)}var _=(function m(O,y,C,b,S){return N.resolve().then(function(){var A=L.transless||L,w=O._createTransaction(y,C,O._dbSchema,b);if(w.explicit=!0,A={trans:w,transless:A},b)w.idbtrans=b.idbtrans;else try{w.create(),w.idbtrans._explicit=!0,O._state.PR1398_maxLoop=3}catch(M){return M.name===qn.InvalidState&&O.isOpen()&&0<--O._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),O.close({disableAutoOpen:!1}),O.open().then(function(){return m(O,y,C,null,S)})):Oe(M)}var I,R=_n(S);return R&&En(),A=N.follow(function(){var M;(I=S.call(w,w))&&(R?(M=Rt.bind(null,null),I.then(M,M)):typeof I.next=="function"&&typeof I.throw=="function"&&(I=qo(I)))},A),(I&&typeof I.then=="function"?N.resolve(I).then(function(M){return w.active?M:Oe(new Y.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):A.then(function(){return I})).then(function(M){return b&&w._resolve(),w._completion.then(function(){return M})}).catch(function(M){return w._reject(M),Oe(M)})})}).bind(null,this,h,d,l,s);return l?l._promise(h,_,"lock"):L.trans?Zt(L.transless,function(){return c._whenReady(_)}):this._whenReady(_)},Ce.prototype.table=function(r){if(!P(this._allTables,r))throw new Y.InvalidTable("Table ".concat(r," does not exist"));return this._allTables[r]},Ce);function Ce(r,i){var s=this;this._middlewares={},this.verno=0;var c=Ce.dependencies;this._options=i=o({addons:Ce.addons,autoOpen:!0,indexedDB:c.indexedDB,IDBKeyRange:c.IDBKeyRange,cache:"cloned"},i),this._deps={indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange},c=i.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var l,h,d,v,_,m={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:se,dbReadyPromise:null,cancelOpen:se,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:i.autoOpen};m.dbReadyPromise=new N(function(y){m.dbReadyResolve=y}),m.openCanceller=new N(function(y,C){m.cancelOpen=C}),this._state=m,this.name=r,this.on=Yn(this,"populate","blocked","versionchange","close",{ready:[wn,se]}),this.on.ready.subscribe=yt(this.on.ready.subscribe,function(y){return function(C,b){Ce.vip(function(){var S,A=s._state;A.openComplete?(A.dbOpenError||N.resolve().then(C),b&&y(C)):A.onReadyBeingFired?(A.onReadyBeingFired.push(C),b&&y(C)):(y(C),S=s,b||y(function w(){S.on.ready.unsubscribe(C),S.on.ready.unsubscribe(w)}))})}}),this.Collection=(l=this,Qn(Xh.prototype,function(I,w){this.db=l;var b=Fs,S=null;if(w)try{b=w()}catch(R){S=R}var A=I._ctx,w=A.table,I=w.hook.reading.fire;this._ctx={table:w,index:A.index,isPrimKey:!A.index||w.schema.primKey.keyPath&&A.index===w.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:S,or:A.or,valueMapper:I!==Tt?I:null}})),this.Table=(h=this,Qn($s.prototype,function(y,C,b){this.db=h,this._tx=b,this.name=y,this.schema=C,this.hook=h._allTables[y]?h._allTables[y].hook:Yn(null,{creating:[Gr,se],reading:[Eo,Tt],updating:[Qr,se],deleting:[Yr,se]})})),this.Transaction=(d=this,Qn(td.prototype,function(y,C,b,S,A){var w=this;this.db=d,this.mode=y,this.storeNames=C,this.schema=b,this.chromeTransactionDurability=S,this.idbtrans=null,this.on=Yn(this,"complete","error","abort"),this.parent=A||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 N(function(I,R){w._resolve=I,w._reject=R}),this._completion.then(function(){w.active=!1,w.on.complete.fire()},function(I){var R=w.active;return w.active=!1,w.on.error.fire(I),w.parent?w.parent._reject(I):R&&w.idbtrans&&w.idbtrans.abort(),Oe(I)})})),this.Version=(v=this,Qn(ud.prototype,function(y){this.db=v,this._cfg={version:y,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(_=this,Qn(zs.prototype,function(y,C,b){if(this.db=_,this._ctx={table:y,index:C===":id"?null:C,or:b},this._cmp=this._ascending=le,this._descending=function(S,A){return le(A,S)},this._max=function(S,A){return 0<le(S,A)?S:A},this._min=function(S,A){return le(S,A)<0?S:A},this._IDBKeyRange=_._deps.IDBKeyRange,!this._IDBKeyRange)throw new Y.MissingAPI})),this.on("versionchange",function(y){0<y.newVersion?console.warn("Another connection wants to upgrade database '".concat(s.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(s.name,"'. Closing db now to resume the delete request.")),s.close({disableAutoOpen:!1})}),this.on("blocked",function(y){!y.newVersion||y.newVersion<y.oldVersion?console.warn("Dexie.delete('".concat(s.name,"') was blocked")):console.warn("Upgrade '".concat(s.name,"' blocked by other connection holding version ").concat(y.oldVersion/10))}),this._maxKey=er(i.IDBKeyRange),this._createTransaction=function(y,C,b,S){return new s.Transaction(y,C,b,s._options.chromeTransactionDurability,S)},this._fireOnBlocked=function(y){s.on("blocked").fire(y),Sn.filter(function(C){return C.name===s.name&&C!==s&&!C._state.vcFired}).map(function(C){return C.on("versionchange").fire(y)})},this.use(hd),this.use(vd),this.use(dd),this.use(ld),this.use(fd);var O=new Proxy(this,{get:function(y,C,b){if(C==="_vip")return!0;if(C==="table")return function(A){return _i(s.table(A),O)};var S=Reflect.get(y,C,b);return S instanceof $s?_i(S,O):C==="tables"?S.map(function(A){return _i(A,O)}):C==="_createTransaction"?function(){return _i(S.apply(this,arguments),O)}:S}});this.vip=O,c.forEach(function(y){return y(s)})}var wi,tt=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",yd=(Yo.prototype.subscribe=function(r,i,s){return this._subscribe(r&&typeof r!="function"?r:{next:r,error:i,complete:s})},Yo.prototype[tt]=function(){return this},Yo);function Yo(r){this._subscribe=r}try{wi={indexedDB:u.indexedDB||u.mozIndexedDB||u.webkitIndexedDB||u.msIndexedDB,IDBKeyRange:u.IDBKeyRange||u.webkitIDBKeyRange}}catch{wi={indexedDB:null,IDBKeyRange:null}}function su(r){var i,s=!1,c=new yd(function(l){var h=_n(r),d,v=!1,_={},m={},O={get closed(){return v},unsubscribe:function(){v||(v=!0,d&&d.abort(),y&&jt.storagemutated.unsubscribe(b))}};l.start&&l.start(O);var y=!1,C=function(){return So(S)},b=function(A){yi(_,A),Vo(m,_)&&C()},S=function(){var A,w,I;!v&&wi.indexedDB&&(_={},A={},d&&d.abort(),d=new AbortController,I=function(R){var M=bt();try{h&&En();var k=Nt(r,R);return k=h?k.finally(Rt):k}finally{M&&Dt()}}(w={subscr:A,signal:d.signal,requery:C,querier:r,trans:null}),Promise.resolve(I).then(function(R){s=!0,i=R,v||w.signal.aborted||(_={},function(M){for(var k in M)if(P(M,k))return;return 1}(m=A)||y||(jt(Zn,b),y=!0),So(function(){return!v&&l.next&&l.next(R)}))},function(R){s=!1,["DatabaseClosedError","AbortError"].includes(R==null?void 0:R.name)||v||So(function(){v||l.error&&l.error(R)})}))};return setTimeout(C,0),O});return c.hasValue=function(){return s},c.getValue=function(){return i},c}var rn=Et;function Qo(r){var i=Lt;try{Lt=!0,jt.storagemutated.fire(r),Uo(r,!0)}finally{Lt=i}}B(rn,o(o({},Yt),{delete:function(r){return new rn(r,{addons:[]}).delete()},exists:function(r){return new rn(r,{addons:[]}).open().then(function(i){return i.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(r){try{return i=rn.dependencies,s=i.indexedDB,i=i.IDBKeyRange,(Lo(s)?Promise.resolve(s.databases()).then(function(c){return c.map(function(l){return l.name}).filter(function(l){return l!==oi})}):jo(s,i).toCollection().primaryKeys()).then(r)}catch{return Oe(new Y.MissingAPI)}var i,s},defineClass:function(){return function(r){E(this,r)}},ignoreTransaction:function(r){return L.trans?Zt(L.transless,r):r()},vip:Fo,async:function(r){return function(){try{var i=qo(r.apply(this,arguments));return i&&typeof i.then=="function"?i:N.resolve(i)}catch(s){return Oe(s)}}},spawn:function(r,i,s){try{var c=qo(r.apply(s,i||[]));return c&&typeof c.then=="function"?c:N.resolve(c)}catch(l){return Oe(l)}},currentTransaction:{get:function(){return L.trans||null}},waitFor:function(r,i){return i=N.resolve(typeof r=="function"?rn.ignoreTransaction(r):r).timeout(i||6e4),L.trans?L.trans.waitFor(i):i},Promise:N,debug:{get:function(){return Ue},set:function(r){Xr(r)}},derive:fe,extend:E,props:B,override:yt,Events:Yn,on:jt,liveQuery:su,extendObservabilitySet:yi,getByKeyPath:ne,setByKeyPath:Pe,delByKeyPath:function(r,i){typeof i=="string"?Pe(r,i,void 0):"length"in i&&[].map.call(i,function(s){Pe(r,s,void 0)})},shallowClone:mn,deepClone:ct,getObjectDiff:Ho,cmp:le,asap:xt,minKey:-1/0,addons:[],connections:Sn,errnames:qn,dependencies:wi,cache:nn,semVer:"4.0.7",version:"4.0.7".split(".").map(function(r){return parseInt(r)}).reduce(function(r,i,s){return r+i/Math.pow(10,2*s)})})),rn.maxKey=er(rn.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(jt(Zn,function(r){Lt||(r=new CustomEvent(To,{detail:r}),Lt=!0,dispatchEvent(r),Lt=!1)}),addEventListener(To,function(r){r=r.detail,Lt||Qo(r)}));var An,Lt=!1,uu=function(){};return typeof BroadcastChannel<"u"&&((uu=function(){(An=new BroadcastChannel(To)).onmessage=function(r){return r.data&&Qo(r.data)}})(),typeof An.unref=="function"&&An.unref(),jt(Zn,function(r){Lt||An.postMessage(r)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(r){if(!Et.disableBfCache&&r.persisted){Ue&&console.debug("Dexie: handling persisted pagehide"),An!=null&&An.close();for(var i=0,s=Sn;i<s.length;i++)s[i].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(r){!Et.disableBfCache&&r.persisted&&(Ue&&console.debug("Dexie: handling persisted pageshow"),uu(),Qo({all:new ke(-1/0,[[]])}))})),N.rejectionMapper=function(r,i){return!r||r instanceof ze||r instanceof TypeError||r instanceof SyntaxError||!r.name||!Ge[r.name]?r:(i=new Ge[r.name](i||r.message,r),"stack"in r&&Z(i,"stack",{get:function(){return this.inner.stack}}),i)},Xr(Ue),o(Et,Object.freeze({__proto__:null,Dexie:Et,liveQuery:su,Entity:Bs,cmp:le,PropModSymbol:wt,PropModification:Jn,replacePrefix:function(r,i){return new Jn({replacePrefix:[r,i]})},add:function(r){return new Jn({add:r})},remove:function(r){return new Jn({remove:r})},default:Et,RangeSet:ke,mergeRanges:rr,rangesOverlap:vi}),{default:Et}),Et})})(Ns);var ih=Ns.exports,so=Zc(ih);const Rs=Symbol.for("Dexie"),uo=globalThis[Rs]||(globalThis[Rs]=so);if(so.semVer!==uo.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${so.semVer} and ${uo.semVer}`);class oh extends uo{constructor(t){super("pages_"+t),this.version(2).stores({pages:"id, name, content, document, css, js, document.name, document.headline, document.creator"})}}var ah=Object.defineProperty,sh=Object.getOwnPropertyDescriptor,uh=(e,t,n,o)=>{for(var a=o>1?void 0:o?sh(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&ah(t,n,a),a},ch=(e,t)=>(n,o)=>t(n,o,e);let co=class{constructor(e){this.pageStorageMap=new Map,this.logger=e,this.logger.setModule("storage.components.dexieOfflineStorage")}getPageStorage(e){let t=this.pageStorageMap.get(e);return t==null&&(t=new oh(e),this.pageStorageMap.set(e,t)),t}async getPage(e,t){try{this.logger.debug("Ready to load page from local storage",t);const n=this.getPageStorage(e);this.logger.debug("pageStorage is ready, asking for page");const o=await n.pages.get(t),a=new yn;return a.fromObject(o),a}catch(n){this.logger.debug("Exception while trying to read from local storage",n);return}}async savePage(e,t,n){try{await this.getPageStorage(e).pages.put(n.toObject(),t)}catch(o){this.logger.debug("Exception while trying to store in local storage",e,t,n,o)}}async updatePage(e,t,n){try{const o=this.getPageStorage(e);this.logger.debug("Ready to store",n),await o.pages.update(t,n.toObject())}catch(o){this.logger.debug("Exception while trying to store in local storage",e,t,n,o)}}};co=uh([Re(),ch(0,xe("Logger"))],co);var lh=Object.defineProperty,fh=Object.getOwnPropertyDescriptor,hh=(e,t,n,o)=>{for(var a=o>1?void 0:o?fh(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&lh(t,n,a),a},lo=(e,t)=>(n,o)=>t(n,o,e);let fo=class{constructor(e,t,n){this.logger=e,this.logger.setModule("storage.components.wrappingOfflineStorage"),this.offlineStorage=t,this.queueWorker=n}setStorage(e){this.storage=e}getStorage(){return this.storage}setWikiConfig(e){return this.storage.setWikiConfig(e)}getWikiConfig(){return this.storage.getWikiConfig()}async isStorageReady(){return this.storage.isStorageReady()}getPageRestURL(e,t){return this.storage.getPageRestURL(e,t)}getPageFromViewURL(e){return this.storage.getPageFromViewURL(e)}getImageURL(e,t){return this.storage.getImageURL(e,t)}async getPageContent(e,t,n){if(this.logger.debug("Trying to get data for page ",e),this.offlineStorage){this.logger.debug("Asking offline storage for ",e);const o=await this.offlineStorage.getPage(this.getWikiConfig().name,e+"_"+t);return o!=null&&o!=null?(this.logger.debug("Loading data from local storage for page",e),(n==null||n)&&this.queueWorker.addToQueue(this.getWikiConfig().name+":"+e+"_"+t),o):(this.logger.debug("Could not find data in local storage for page",e),this.savePageContent(e,t))}else return this.logger.debug("No offline local storage available"),this.storage.getPageContent(e,t)}getAttachments(e){return this.storage.getAttachments(e)}async savePageContent(e,t){const n=await this.storage.getPageContent(e,t);if(n)return n.id=e+"_"+t,this.logger.debug("Saving page to offline storage",e),this.offlineStorage.savePage(this.getWikiConfig().name,e+"_"+t,n),n;throw new Error("Can't save missing page.")}async updatePageContent(e,t){const n=await this.offlineStorage.getPage(this.getWikiConfig().name,e+"_"+t),o=await this.storage.getPageContent(e,t);return n&&o?(o.id=e+"_"+t,this.logger.debug("Saving page to offline storage",e),this.offlineStorage.savePage(this.getWikiConfig().name,e+"_"+t,o),!0):(n==null?void 0:n.version)!=(o==null?void 0:o.version)&&o?(o.id=e+"_"+t,this.logger.debug("Updating page to offline storage",e),this.offlineStorage.updatePage(this.getWikiConfig().name,e+"_"+t,o),!0):(this.logger.debug("Local storage not updated, because version are identical"),!1)}async getPanelContent(e,t,n){return this.storage.getPanelContent(e,t,n)}async getEditField(e,t){return await this.storage.getEditField(e,t)}save(e,t,n,o){return this.storage.save(e,t,n,o)}async saveAttachments(e,t){return this.storage.saveAttachments(e,t)}};fo=hh([Re(),lo(0,xe("Logger")),lo(1,xe("OfflineStorage")),lo(2,xe("QueueWorker"))],fo);let dh=class{constructor(t){t.bind("WrappingStorage").to(fo).inSingletonScope(),t.bind("OfflineStorage").to(co).inSingletonScope()}};var ph=Object.defineProperty,gh=Object.getOwnPropertyDescriptor,vh=(e,t,n,o)=>{for(var a=o>1?void 0:o?gh(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&ph(t,n,a),a},Br=(e,t)=>(n,o)=>t(n,o,e);let ho=class extends $n{constructor(e,t,n){super(e),this.storage=t,this.cristal=n,this.storage.setWikiConfig(this),this.homePage==""&&(this.homePage="README.md")}defaultPageName(){return"README"}getType(){return"GitHub"}};ho=vh([Re(),Br(0,xe("Logger")),Br(1,xe("Storage")),Br(1,Ni("GitHub")),Br(2,xe("CristalApp"))],ho);var yh=Object.defineProperty,mh=Object.getOwnPropertyDescriptor,bh=(e,t,n,o)=>{for(var a=o>1?void 0:o?mh(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&yh(t,n,a),a},_h=(e,t)=>(n,o)=>t(n,o,e);let Un=class{constructor(e,t){this.logger=e,this.logger.setModule(t)}setWikiConfig(e){this.logger.debug("Setting wiki Config: ",e),this.wikiConfig=e}getWikiConfig(){return this.wikiConfig}};Un=bh([Re(),_h(0,Xc())],Un);var wh=Object.defineProperty,Eh=Object.getOwnPropertyDescriptor,Sh=(e,t,n,o)=>{for(var a=o>1?void 0:o?Eh(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&wh(t,n,a),a},Oh=(e,t)=>(n,o)=>t(n,o,e);let po=class extends Un{constructor(e){super(e,"storage.components.githubStorage"),this.hashCode=function(t){let n=0,o,a;if(t.length===0)return""+n;for(o=0;o<t.length;o++)a=t.charCodeAt(o),n=(n<<5)-n+a,n|=0;return""+n}}async isStorageReady(){return!0}getPageRestURL(e,t){var n;return(n=this.logger)==null||n.debug("GitHub Loading page",e),this.wikiConfig.baseRestURL+e}getPageFromViewURL(e){let t=null;return e.startsWith(this.wikiConfig.baseURL)&&(t=e.replace(this.wikiConfig.baseURL,"")),t}getImageURL(e,t){return this.wikiConfig.baseRestURL+decodeURIComponent(t)}async getPageContent(e,t){var E;(E=this.logger)==null||E.debug("GitHub Loading page",e);const n=decodeURIComponent(e),o=this.getPageRestURL(n,t),u=await(await fetch(o,{cache:"no-store"})).text();let f="";t=="json"?f="":t=="md"||t=="html"?f=u:f="";const p=new yn;return p.id=n,p.name=n.split("/").pop(),p.source=f,p.syntax="md",p.css=[],p.version=this.hashCode(f),p}getAttachments(){throw new Error("unsupported")}async getPanelContent(){return new yn}async getEditField(){return""}save(){throw new Error("Save not supported")}async saveAttachments(){throw new Error("unsupported")}};po=Sh([Re(),Oh(0,xe("Logger"))],po);let Ch=class{constructor(t){t.bind("WikiConfig").to(ho).whenTargetNamed("GitHub"),t.bind("Storage").to(po).whenTargetNamed("GitHub")}};var Ah=Object.defineProperty,xh=Object.getOwnPropertyDescriptor,Ph=(e,t,n,o)=>{for(var a=o>1?void 0:o?xh(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&Ah(t,n,a),a},Kr=(e,t)=>(n,o)=>t(n,o,e);let go=class extends $n{constructor(e,t,n){super(e),this.cristal=n,this.storage=t,this.storage.setWikiConfig(this)}isSupported(e){return e=="html"}defaultPageName(){return"home"}};go=Ph([Re(),Kr(0,xe("Logger")),Kr(1,xe("Storage")),Kr(1,Ni("Nextcloud")),Kr(2,xe("CristalApp"))],go);var Th=Object.defineProperty,Ih=Object.getOwnPropertyDescriptor,Dh=(e,t,n,o)=>{for(var a=o>1?void 0:o?Ih(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&Th(t,n,a),a},Nh=(e,t)=>(n,o)=>t(n,o,e);let vo=class extends Un{constructor(e){super(e,"storage.components.nextcloudStorage"),this.ATTACHMENTS="attachments"}async getEditField(){return""}getImageURL(){return""}async getPageContent(e){const t=this.getWikiConfig().baseRestURL,n=this.getBaseHeaders();try{const o=await fetch(`${t}/.cristal/${e}/page.json`,{method:"GET",headers:n});if(o.status>=200&&o.status<300){const a=await o.json();return{...a,headline:a.name,headlineRaw:a.name}}else return}catch{return}}async getAttachments(e){const t=await fetch(this.getAttachmentsBasePath(e),{method:"PROPFIND",headers:{...this.getBaseHeaders(),Depth:"1",Accept:"application/json"}});if(t.status>=200&&t.status<300){const n=await t.text(),a=new window.DOMParser().parseFromString(n,"text/xml").getElementsByTagName("d:response"),u=[];for(let f=0;f<a.length;f++){const p=a[f];if(p.getElementsByTagName("d:getcontenttype").length>0){const E=p.getElementsByTagName("d:href")[0].textContent,g=p.getElementsByTagName("d:getcontenttype")[0].textContent,T=E.split("/"),P=`${this.getWikiConfig().baseRestURL}/${T.slice(5).join("/")}`,B=T[T.length-1];u.push({mimetype:g,reference:B,id:E,href:P})}}return{attachments:u}}else return}getAttachmentsBasePath(e){return`${this.getWikiConfig().baseRestURL}/.cristal/${e}/${this.ATTACHMENTS}`}async save(e,t,n){const o=e.split("/"),a=`${this.getWikiConfig().baseRestURL}/.cristal`;await this.createIntermediateDirectories(a,o),await fetch(`${a}/${o.join("/")}/page.json`,{method:"PUT",headers:this.getBaseHeaders(),body:JSON.stringify({source:t,name:n,syntax:"markdown/1.2"})})}async createIntermediateDirectories(e,t){await this.createDirectory(e);for(let n=0;n<t.length;n++)await this.createDirectory(`${e}/${t.slice(0,n+1).join("/")}`)}async saveAttachments(e,t){return Promise.all(t.map(n=>this.saveAttachment(e,n)))}async saveAttachment(e,t){const n=e.split("/"),o=`${this.getWikiConfig().baseRestURL}/.cristal`;await this.createIntermediateDirectories(o,[...n,this.ATTACHMENTS]);const a=this.getAttachmentsBasePath(e)+"/"+t.name,u=new FormData;u.append(t.name,t),await fetch(a,{method:"PUT",headers:this.getBaseHeaders(),body:u})}getPageFromViewURL(){return null}getPageRestURL(){return""}async getPanelContent(){return new yn}async isStorageReady(){return!0}async createDirectory(e){await fetch(e,{method:"MKCOL",headers:this.getBaseHeaders()})}getBaseHeaders(){return{Authorization:`Basic ${btoa("test:test")}`}}};vo=Dh([Re(),Nh(0,xe("Logger"))],vo);let Rh=class{constructor(t){t.bind("WikiConfig").to(go).whenTargetNamed("Nextcloud"),t.bind("Storage").to(vo).whenTargetNamed("Nextcloud")}};var Mh=Object.defineProperty,kh=Object.getOwnPropertyDescriptor,jh=(e,t,n,o)=>{for(var a=o>1?void 0:o?kh(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&Mh(t,n,a),a},Vr=(e,t)=>(n,o)=>t(n,o,e);let yo=class extends $n{constructor(e,t,n){super(e),this.cristal=n,this.storage=t,this.storage.setWikiConfig(this),this.homePage==""&&(this.homePage="Main.WebHome")}isSupported(e){return e=="html"||e=="jsonld"}defaultPageName(){return"Main.WebHome"}getType(){return"XWiki"}};yo=jh([Re(),Vr(0,xe("Logger")),Vr(1,xe("Storage")),Vr(1,Ni("XWiki")),Vr(2,xe("CristalApp"))],yo);var Lh=Object.defineProperty,Fh=Object.getOwnPropertyDescriptor,Bh=(e,t,n,o)=>{for(var a=o>1?void 0:o?Fh(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&Lh(t,n,a),a},Kh=(e,t)=>(n,o)=>t(n,o,e);let mo=class extends Un{constructor(e){super(e,"storage.components.xwikiStorage")}async isStorageReady(){return!0}getPageRestURL(e,t){var n;return(n=this.logger)==null||n.debug("XWiki Loading page",e),this.wikiConfig.baseURL+this.wikiConfig.baseRestURL+"&page="+e+"&format="+t}getPageFromViewURL(e){let t;return e.startsWith(this.wikiConfig.baseURL)?(t=e.replace(this.wikiConfig.baseURL,"").replace("/bin","").replace("/view/","").replaceAll("%5C","%5C%5C").replaceAll(".","%5C.").replaceAll("/","."),t.endsWith(".")&&(t+="WebHome")):t=null,t}getImageURL(e,t){var o;e==""&&(e="Main.WebHome");const n=this.wikiConfig.baseURL+"/bin/download/"+e.replace(".","/")+"/"+t;return(o=this.logger)==null||o.debug("final image url ",n),n}async getPageContent(e,t){var g,T,P,B,Q,Z;(g=this.logger)==null||g.debug("XWiki Loading page",e),e==""&&(e="Main.WebHome");const n=this.getPageRestURL(e,t);(T=this.logger)==null||T.debug("XWiki Loading url",n);const a=await(await fetch(n,{cache:"no-store"})).json();let u="",f="",p={};t=="jsonld"?(p=a,this.wikiConfig.serverRendering?((P=this.logger)==null||P.debug("Using server side rendering for jsonld"),u=a.source,f=a.html):((B=this.logger)==null||B.debug("Using client side rendering for jsonld"),u=a.source,f="")):t=="html"?this.wikiConfig.serverRendering?((Q=this.logger)==null||Q.debug("Using server side rendering for html"),u=a.source,f=""):((Z=this.logger)==null||Z.debug("Using client side rendering for html"),u=a.source,f=""):(u="",f="");const E=new yn;return E.source=u,E.syntax="xwiki",E.html=f,E.document=new oo(p),E.css=a.css,E.js=a.js,E.version=E.document.get("version"),E.headlineRaw=a.headlineRaw,E.headline=a.headline,E.name=a.name,E}async getAttachments(e){return{attachments:(await(await fetch(this.buildAttachmentsURL(e),{headers:{Accept:"application/json",...this.getCredentials()}})).json()).attachments.map(({id:a,name:u,mimeType:f,xwikiAbsoluteUrl:p})=>({id:a,reference:u,mimetype:f,href:p}))}}async getPanelContent(e,t){var f;const n=this.wikiConfig.baseURL+"/rest/cristal/panel?media=json&page="+t+"&panel="+e;(f=this.logger)==null||f.debug("XWiki Loading url",n);const a=await(await fetch(n,{cache:"no-store"})).json(),u=new yn;return u.source=a.source,u.syntax="xwiki",u.html=a.content,u.css=a.css,u.js=a.js,u}async getEditField(e,t){var n,o;try{const a=e.get("xwikiMapping")[t];let u=a.type,f=a.fieldName;u==null&&(u="document"),f==null&&(f=t);const p=this.wikiConfig.baseURL+"/bin/get/"+e.getIdentifier().replaceAll(".","/")+"?xpage=display&mode=edit&type="+u+"&property="+e.get("className")+"."+f;return(n=this.logger)==null||n.debug("XWiki Loading Field url",p),await(await fetch(p,{cache:"no-store"})).text()}catch(a){return(o=this.logger)==null||o.error("Exception looking for edit field for field",t,a),""}}async save(e,t,n){const o=this.buildSavePageURL(e,["rest","wikis","xwiki"]);await fetch(o,{method:"PUT",headers:{"Content-Type":"application/json",...this.getCredentials()},body:JSON.stringify({content:t,title:n,syntax:"markdown/1.2"})})}async saveAttachments(e,t){return Promise.all(t.map(n=>this.saveAttachment(e,n)))}async saveAttachment(e,t){const n=new FormData;n.append(t.name,t),await fetch(this.buildAttachmentsURL(e)+"/"+t.name,{method:"PUT",body:n,headers:{...this.getCredentials(),"Content-Type":t.type}})}getCredentials(){return{Authorization:`Basic ${btoa("Admin:admin")}`}}buildSavePageURL(e,t){const n=this.wikiConfig.baseURL,o=e.split(".");for(let a=0;a<o.length;a++){const u=a<o.length-1?"spaces":"pages";t.push(u),t.push(o[a])}return`${n}/${t.join("/")}`}buildAttachmentsURL(e){const t=e.split("."),n=t.length-1,o=t.splice(0,n).join("/spaces/"),a=t[n]||"WebHome";return`${this.wikiConfig.baseURL}/rest/wikis/xwiki/spaces/${o}/pages/${a}/attachments`}};mo=Bh([Re(),Kh(0,xe("Logger"))],mo);class Vh{constructor(t){t.bind("WikiConfig").to(yo).whenTargetNamed("XWiki"),t.bind("Storage").to(mo).whenTargetNamed("XWiki")}}var $h=Object.defineProperty,Wh=Object.getOwnPropertyDescriptor,Uh=(e,t,n,o)=>{for(var a=o>1?void 0:o?Wh(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&$h(t,n,a),a};let bo=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(e){this.container=e}getWikiConfig(){return this.wikiConfig}setWikiConfig(e){this.wikiConfig=e}getSkinManager(){throw new Error("Method not implemented.")}switchConfig(){}setAvailableConfigurations(e){console.log(e),e.forEach((t,n)=>{const o=t==null?void 0:t.configType;if(t){const a=this.container.getNamed("WikiConfig",o);a.setConfigFromObject(t),this.availableConfigurations.set(n,a)}})}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.")}};bo=Uh([Re()],bo);var qh=Object.defineProperty,Hh=Object.getOwnPropertyDescriptor,zh=(e,t,n,o)=>{for(var a=o>1?void 0:o?Hh(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&qh(t,n,a),a};let _o=class{constructor(){this.initialize()}initialize(){}getStatus(){return!0}async increment(){return 0}async addToQueue(){}async getQueueSize(){return 0}};_o=zh([Re()],_o);class Gh{constructor(){this.currentNumber=0,this.queue=[],this.initialized=!1}async start(){for(console.log("Starting worker thread"),this.initialize();;)await this.sleep(1e3),this.checkQueue()}setPageLoadedCallback(t){this.fct=t}sleep(t){return new Promise(n=>setTimeout(n,t))}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(t){console.log("Handling queue item code ready to process",t);try{let n=null,o=null,a=null;const u=t.indexOf(":"),f=t.lastIndexOf("_");if(u!=-1&&f!=-1){n=t.substring(0,u),o=t.substring(u+1,f),a=t.substring(f+1);const p=this.getWikiConfig(n);p==null?console.log("Could not find config for page",t):(console.log("Updating page ",o,a),await p.storage.updatePageContent(o,a)&&(console.log("Page updated. Calling back to main thread"),this.fct(t)))}else console.log("Could not process page",t)}catch(n){console.log("Exception while trying to load",t,n)}}add(t){return console.log("Worker in add"),this.currentNumber+=t,this.currentNumber}addToQueue(t){console.log("Worker in addToQueue",t),this.queue.includes(t)||this.queue.push(t)}getQueueSize(){return console.log("Worker in getQueueSize"),this.queue.length}getWikiConfig(t){const n=this.configMap.get(t);if(n==null){console.error("Failed to find wikiConfig for configName",t);return}const a=new Map(Object.entries(n)).get("configType");console.log("Looking for wikiConfig for name",t,"and type",a);let u;try{return u=this.container.getNamed("WikiConfig",a),this.cristal.setWikiConfig(u),u.setConfigFromObject(n),u.initialize(),console.debug("Found wikiConfig for",t,"and type",a,":",u),u}catch(f){console.error("Failed to find wikiConfig for name",t,"and type",a,f);return}}async initialize(){console.log("Starting initialize");const t=["storage"],o=await(await fetch("/config.json")).json();this.configMap=new Map(Object.entries(o)),console.log("Loaded json config",this.configMap);const a=new rh(t);a.initializeContainer(),this.container=a.container,console.log("Container status",this.container),this.container.bind("CristalApp").to(bo).inSingletonScope(),this.container.bind("QueueWorker").to(_o).inSingletonScope(),this.cristal=this.container.get("CristalApp"),this.cristal.setContainer(this.container),console.log("Container status",this.container),new dh(a.container),new Ch(a.container),new Rh(a.container),new Vh(a.container),console.log("Loading storage components"),this.initialized=!0,console.log("Finished initialize")}}const Ms=new Gh;Ms.start(),onconnect=e=>{Oi(Ms,e.ports[0])},console.log("Worker code loaded")})();
|
|
47
|
+
//# sourceMappingURL=worker-CSpj1p6r.js.map
|