@xwiki/cristal-sharedworker-impl 0.8.0 → 0.10.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.
@@ -0,0 +1,47 @@
1
+ (function(){"use strict";/**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */const ea=Symbol("Comlink.proxy"),cu=Symbol("Comlink.endpoint"),lu=Symbol("Comlink.releaseProxy"),Si=Symbol("Comlink.finalizer"),rr=Symbol("Comlink.thrown"),ta=e=>typeof e=="object"&&e!==null||typeof e=="function",fu={canHandle:e=>ta(e)&&e[ea],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=>ta(e)&&rr 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}},na=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:g}=Object.assign({path:[]},a.data),S=(a.data.argumentList||[]).map(Ft);let p;try{const T=g.slice(0,-1).reduce((B,Q)=>B[Q],e),P=g.reduce((B,Q)=>B[Q],e);switch(f){case"GET":p=P;break;case"SET":T[g.slice(-1)[0]]=Ft(a.data.value),p=!0;break;case"APPLY":p=P.apply(T,S);break;case"CONSTRUCT":{const B=new P(...S);p=_u(B)}break;case"ENDPOINT":{const{port1:B,port2:Q}=new MessageChannel;Oi(e,Q),p=bu(B,[B])}break;case"RELEASE":p=void 0;break;default:return}}catch(T){p={value:T,[rr]:0}}Promise.resolve(p).catch(T=>({value:T,[rr]:0})).then(T=>{const[P,B]=sr(T);t.postMessage(Object.assign(Object.assign({},P),{id:u}),B),f==="RELEASE"&&(t.removeEventListener("message",o),ra(t),Si in e&&typeof e[Si]=="function"&&e[Si]())}).catch(T=>{const[P,B]=sr({value:new TypeError("Unserializable return value"),[rr]:0});t.postMessage(Object.assign(Object.assign({},P),{id:u}),B)})}),t.start&&t.start()}function pu(e){return e.constructor.name==="MessagePort"}function ra(e){pu(e)&&e.close()}function gu(e,t){return Ci(e,[],t)}function ir(e){if(e)throw new Error("Proxy has been released and is not useable")}function ia(e){return an(e,{type:"RELEASE"}).then(()=>{ra(e)})}const or=new WeakMap,ar="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(or.get(e)||0)-1;or.set(e,t),t===0&&ia(e)});function vu(e,t){const n=(or.get(t)||0)+1;or.set(t,n),ar&&ar.register(e,t,e)}function yu(e){ar&&ar.unregister(e)}function Ci(e,t=[],n=function(){}){let o=!1;const a=new Proxy(n,{get(u,f){if(ir(o),f===lu)return()=>{yu(a),ia(e),o=!0};if(f==="then"){if(t.length===0)return{then:()=>a};const g=an(e,{type:"GET",path:t.map(S=>S.toString())}).then(Ft);return g.then.bind(g)}return Ci(e,[...t,f])},set(u,f,g){ir(o);const[S,p]=sr(g);return an(e,{type:"SET",path:[...t,f].map(T=>T.toString()),value:S},p).then(Ft)},apply(u,f,g){ir(o);const S=t[t.length-1];if(S===cu)return an(e,{type:"ENDPOINT"}).then(Ft);if(S==="bind")return Ci(e,t.slice(0,-1));const[p,T]=oa(g);return an(e,{type:"APPLY",path:t.map(P=>P.toString()),argumentList:p},T).then(Ft)},construct(u,f){ir(o);const[g,S]=oa(f);return an(e,{type:"CONSTRUCT",path:t.map(p=>p.toString()),argumentList:g},S).then(Ft)}});return vu(a,e),a}function mu(e){return Array.prototype.concat.apply([],e)}function oa(e){const t=e.map(sr);return[t.map(n=>n[0]),mu(t.map(n=>n[1]))]}const aa=new WeakMap;function bu(e,t){return aa.set(e,t),e}function _u(e){return Object.assign(e,{[ea]:!0})}function sr(e){for(const[t,n]of na)if(n.canHandle(e)){const[o,a]=n.serialize(e);return[{type:"HANDLER",name:t,value:o},a]}return[{type:"RAW",value:e},aa.get(e)||[]]}function Ft(e){switch(e.type){case"HANDLER":return na.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",sa="name",ur="unmanaged",Ai="optional",cr="inject",xn="multi_inject",ua="inversify:tagged",ca="inversify:tagged_props",xi="inversify:paramtypes",Eu="design:paramtypes",la="post_construct",Pi="pre_destroy";function Su(){return[cr,xn,sa,ur,qe,Ai]}var fa=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.",ha="Metadata key was used more than once in a parameter:",In="NULL argument",da="Key Not Found",xu="Ambiguous match found for serviceIdentifier:",Pu="Could not unbind serviceIdentifier:",Tu="No matching bindings found for serviceIdentifier:",pa="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",ga="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},Ti=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(xi,t),o=Reflect.getMetadata(ua,t);return{compilerGeneratedMetadata:n,userGeneratedMetadata:o||{}}},e.prototype.getPropertiesMetadata=function(t){var n=Reflect.getMetadata(ca,t)||[];return n},e}(),lr={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};function va(e){return e instanceof RangeError||e.message===Gu}var Qu=function(e,t){try{return e()}catch(n){throw va(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 ya(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=fr(u.implementationType)),o=o+`
8
+ `+f,u.constraint.metaData&&(o=o+" - "+u.constraint.metaData)})),o}function ma(e,t){return e.parentRequest===null?!1:e.parentRequest.serviceIdentifier===t?!0:ma(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 ba(e){e.childRequests.forEach(function(t){if(ma(t,t.serviceIdentifier)){var n=Ju(t);throw new Error(Nu+" "+n)}else ba(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 fr(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 _a=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}(),ut=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}(),hr=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 ut(qe,a):a instanceof ut&&(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 fa.every(function(n){return t.key!==n})})},e.prototype.isOptional=function(){return this.matchesTag(Ai)(!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 fa.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}(),dr=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=fr(t);return wa(e,n,t,!1)}function wa(e,t,n,o){var a=e.getConstructorMetadata(n),u=a.compilerGeneratedMetadata;if(u===void 0){var f=pa+" "+t+".";throw new Error(f)}var g=a.userGeneratedMetadata,S=Object.keys(g),p=n.length===0&&S.length>0,T=S.length>n.length,P=p||T?S.length:n.length,B=oc(o,t,u,g,P),Q=Ea(e,n,t),Z=dr(dr([],B,!0),Q,!0);return Z}function ic(e,t,n,o,a){var u=a[e.toString()]||[],f=Oa(u),g=f.unmanaged!==!0,S=o[e],p=f.inject||f.multiInject;if(S=p||S,S instanceof tc&&(S=S.unwrap()),g){var T=S===Object,P=S===Function,B=S===void 0,Q=T||P||B;if(!t&&Q){var Z=Iu+" argument "+e+" in class "+n+".";throw new Error(Z)}var fe=new hr(Pn.ConstructorArgument,f.targetName,S);return fe.metadata=u,fe}return null}function oc(e,t,n,o,a){for(var u=[],f=0;f<a;f++){var g=f,S=ic(g,e,t,n,o);S!==null&&u.push(S)}return u}function ac(e,t,n,o){var a=e||t;if(a===void 0){var u=pa+" for property "+String(n)+" in class "+o+".";throw new Error(u)}return a}function Ea(e,t,n){for(var o=e.getPropertiesMetadata(t),a=[],u=Object.getOwnPropertySymbols(o),f=Object.keys(o),g=f.concat(u),S=0,p=g;S<p.length;S++){var T=p[S],P=o[T],B=Oa(P),Q=B.targetName||T,Z=ac(B.inject,B.multiInject,T,n),fe=new hr(Pn.ClassProperty,Q,Z);fe.metadata=P,a.push(fe)}var He=Object.getPrototypeOf(t.prototype).constructor;if(He!==Object){var $e=Ea(e,He,n);a=dr(dr([],a,!0),$e,!0)}return a}function Sa(e,t){var n=Object.getPrototypeOf(t.prototype).constructor;if(n!==Object){var o=fr(n),a=wa(e,o,n,!0),u=a.map(function(S){return S.metadata.filter(function(p){return p.key===ur})}),f=[].concat.apply([],u).length,g=a.length-f;return g>0?g:Sa(e,n)}else return 0}function Oa(e){var t={};return e.forEach(function(n){t[n.key.toString()]=n.value}),{inject:t[cr],multiInject:t[xn],targetName:t[sa],unmanaged:t[ur]}}var Ii=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 pr(e){return e._bindingDictionary}function sc(e,t,n,o,a,u){var f=e?xn:cr,g=new ut(f,n),S=new hr(t,o,n,g);if(a!==void 0){var p=new ut(a,u);S.metadata.push(p)}return S}function Ca(e,t,n,o,a){var u=Nn(n.container,a.serviceIdentifier),f=[];return u.length===lr.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(g){var S=new Ii(g.serviceIdentifier,n,o,g,a);return g.constraint(S)}),uc(a.serviceIdentifier,f,a,n.container),f}function uc(e,t,n,o){switch(t.length){case lr.NoBindingsAvailable:if(n.isOptional())return t;var a=Dn(e),u=Tu;throw u+=Xu(a,n),u+=ya(o,a,Nn),new Error(u);case lr.OnlyOneBindingAvailable:return t;case lr.MultipleBindingsAvailable:default:if(n.isArray())return t;var a=Dn(e),u=xu+" "+a;throw u+=ya(o,a,Nn),new Error(u)}}function Aa(e,t,n,o,a,u){var f,g;if(a===null){f=Ca(e,t,o,null,u),g=new Ii(n,o,null,f,u);var S=new ec(o,g);o.addPlan(S)}else f=Ca(e,t,o,a,u),g=a.addChildRequest(u.serviceIdentifier,f,u);f.forEach(function(p){var T=null;if(u.isArray())T=g.addChildRequest(p.serviceIdentifier,p,u);else{if(p.cache)return;T=g}if(p.type===pe.Instance&&p.implementationType!==null){var P=rc(e,p.implementationType);if(!o.container.options.skipBaseClassChecks){var B=Sa(e,p.implementationType);if(P.length<B){var Q=Bu(fr(p.implementationType));throw new Error(Q)}}P.forEach(function(Z){Aa(e,!1,Z.serviceIdentifier,o,T,Z)})}})}function Nn(e,t){var n=[],o=pr(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,g){g===void 0&&(g=!1);var S=new _a(t),p=sc(n,o,a,"",u,f);try{return Aa(e,g,a,S,null,p),S}catch(T){throw va(T)&&ba(S.plan.rootRequest),T}}function lc(e,t,n,o){var a=new hr(Pn.Variable,"",t,new ut(n,o)),u=new _a(e),f=new Ii(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 xa(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 g(T){try{p(o.next(T))}catch(P){f(P)}}function S(T){try{p(o.throw(T))}catch(P){f(P)}}function p(T){T.done?u(T.value):a(T.value).then(g,S)}p((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:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function g(p){return function(T){return S([p,T])}}function S(p){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=p[0]&2?a.return:p[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,p[1])).done)return u;switch(a=0,u&&(p=[p[0]&2,u.value]),p[0]){case 0:case 1:u=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,a=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!u||p[1]>u[0]&&p[1]<u[3])){n.label=p[1];break}if(p[0]===6&&n.label<u[1]){n.label=u[1],u=p;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(p);break}u[2]&&n.ops.pop(),n.trys.pop();continue}p=t.call(e,n)}catch(T){p=[6,T],a=0}finally{o=u=0}if(p[0]&5)throw p[1];return{value:p[0]?p[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)},Pa=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 g(T){try{p(o.next(T))}catch(P){f(P)}}function S(T){try{p(o.throw(T))}catch(P){f(P)}}function p(T){T.done?u(T.value):a(T.value).then(g,S)}p((o=o.apply(e,t||[])).next())})},Ta=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:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function g(p){return function(T){return S([p,T])}}function S(p){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=p[0]&2?a.return:p[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,p[1])).done)return u;switch(a=0,u&&(p=[p[0]&2,u.value]),p[0]){case 0:case 1:u=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,a=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!u||p[1]>u[0]&&p[1]<u[3])){n.label=p[1];break}if(p[0]===6&&n.label<u[1]){n.label=u[1],u=p;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(p);break}u[2]&&n.ops.pop(),n.trys.pop();continue}p=t.call(e,n)}catch(T){p=[6,T],a=0}finally{o=u=0}if(p[0]&5)throw p[1];return{value:p[0]?p[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=xa(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=Ia(u)}else o=new e;return o}function Ia(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 Pa(this,void 0,void 0,function(){var t,n;return Ta(this,function(o){switch(o.label){case 0:return[4,Da(e.constructorInjections)];case 1:return t=o.sent(),[4,Da(e.propertyInjections)];case 2:return n=o.sent(),[2,Ia(sn(sn({},e),{constructorInjections:t,propertyInjections:n}))]}})})}function Da(e){return Pa(this,void 0,void 0,function(){var t,n,o,a;return Ta(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 Na(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(la,e)){var a=Reflect.getMetadata(la,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(Ti(t.name,n));if(Reflect.hasMetadata(Pi,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 Na(t,u)}):Na(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 g(T){try{p(o.next(T))}catch(P){f(P)}}function S(T){try{p(o.throw(T))}catch(P){f(P)}}function p(T){T.done?u(T.value):a(T.value).then(g,S)}p((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:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function g(p){return function(T){return S([p,T])}}function S(p){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=p[0]&2?a.return:p[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,p[1])).done)return u;switch(a=0,u&&(p=[p[0]&2,u.value]),p[0]){case 0:case 1:u=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,a=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!u||p[1]>u[0]&&p[1]<u[3])){n.label=p[1];break}if(p[0]===6&&n.label<u[1]){n.label=u[1],u=p;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(p);break}u[2]&&n.ops.pop(),n.trys.pop();continue}p=t.call(e,n)}catch(T){p=[6,T],a=0}finally{o=u=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},Di=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(g){var S=Di(e);return S(g)});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,Di(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 Ra(t,n,a)}):o=Ra(t,n,o),o})};function Ra(e,t,n){var o=Mc(e.parentContext,t,n),a=Lc(e.parentContext.container),u,f=a.next();do{u=f.value;var g=e.parentContext,S=e.serviceIdentifier,p=jc(u,S);Ke(o)?o=Ma(p,g,o):o=kc(p,g,o),f=a.next()}while(f.done!==!0&&!pr(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 Ma(e,t,n);o=e.next()}return n},Ma=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=Di(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 ut(e,t),n}},gr=Mn(qe),Ni=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}},vr=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=gr(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&&Ni(t)(n.parentRequest)},new De(this._binding)},e.prototype.whenParentNamed=function(t){return this._binding.constraint=function(n){return n!==null&&gr(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,Ni(t))},new De(this._binding)},e.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(n){return n!==null&&!pt(n,Ni(t))},new De(this._binding)},e.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(n){return n!==null&&pt(n,gr(t))},new De(this._binding)},e.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(n){return n!==null&&!pt(n,gr(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 vr(this._binding)},e.prototype.onDeactivation=function(t){return this._binding.onDeactivation=t,new vr(this._binding)},e}(),gt=function(){function e(t){this._binding=t,this._bindingWhenSyntax=new vr(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}(),ka=function(){function e(t){this._binding=t,this._bindingWhenSyntax=new vr(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 ka(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 ka(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(da)},e.prototype.remove=function(t){if(t==null)throw new Error(In);if(!this._map.delete(t))throw new Error(da)},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(g){return!u.some(function(S){return g===S})});n._setValue(o,f)}})},e.prototype.removeByCondition=function(t){var n=this,o=[];return this._map.forEach(function(a,u){for(var f=[],g=0,S=a;g<S.length;g++){var p=S[g],T=t(p);T?o.push(p):f.push(p)}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}(),yr=function(){return yr=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},yr.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 g(T){try{p(o.next(T))}catch(P){f(P)}}function S(T){try{p(o.throw(T))}catch(P){f(P)}}function p(T){T.done?u(T.value):a(T.value).then(g,S)}p((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:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function g(p){return function(T){return S([p,T])}}function S(p){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=p[0]&2?a.return:p[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,p[1])).done)return u;switch(a=0,u&&(p=[p[0]&2,u.value]),p[0]){case 0:case 1:u=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,a=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!u||p[1]>u[0]&&p[1]<u[3])){n.label=p[1];break}if(p[0]===6&&n.label<u[1]){n.label=u[1],u=p;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(p);break}u[2]&&n.ops.pop(),n.trys.pop();continue}p=t.call(e,n)}catch(T){p=[6,T],a=0}finally{o=u=0}if(p[0]&5)throw p[1];return{value:p[0]?p[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(p){return pr(p)}),g=pr(u);function S(p,T){p.traverse(function(P,B){B.forEach(function(Q){T.add(Q.serviceIdentifier,Q.clone())})})}return f.forEach(function(p){S(p,g)}),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],g=o(f.id);f.registry(g.bindFunction,g.unbindFunction,g.isboundFunction,g.rebindFunction,g.unbindAsyncFunction,g.onActivationFunction,g.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,g;return Xe(this,function(S){switch(S.label){case 0:o=this._getContainerModuleHelpersFactory(),a=0,u=t,S.label=1;case 1:return a<u.length?(f=u[a],g=o(f.id),[4,f.registry(g.bindFunction,g.unbindFunction,g.isboundFunction,g.rebindFunction,g.unbindAsyncFunction,g.onActivationFunction,g.onDeactivationFunction)]):[3,4];case 2:S.sent(),S.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(g){switch(g.label){case 0:o=0,a=t,g.label=1;case 1:return o<a.length?(u=a[o],f=this._removeModuleBindings(u.id),[4,this._deactivateSingletonsAsync(f)]):[3,4];case 2:g.sent(),this._removeModuleHandlers(u.id),g.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(g){return g.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(Pi,t)){var u=Reflect.getMetadata(Pi,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(g){if(g instanceof Error)throw new Error(Ti(a.name,g.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(Ti(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)}},g=function(T){return function(P){var B=t.rebind(P);return n(B,T),B}},S=function(T){return function(P,B){t._moduleActivationStore.addActivation(T,P,B),t.onActivation(P,B)}},p=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:S(T),onDeactivationFunction:p(T),rebindFunction:g(T),unbindFunction:a(),unbindAsyncFunction:u()}}},e.prototype._getAll=function(t){return Promise.all(this._get(t))},e.prototype._get=function(t){var n=yr(yr({},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(xa(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(ga)}function ja(e,t,n,o){Gc(t),La(ua,e,n.toString(),o)}function Yc(e,t,n){if(zc(e))throw new Error(ga);La(ca,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(ha+" "+n.toString())}else t=[e];return t}function La(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 g=function(P){if(a.some(function(B){return B.key===P.key}))throw new Error(ha+" "+P.key.toString())},S=0,p=f;S<p.length;S++){var T=p[S];g(T)}f.push.apply(f,a),u[n]=f,Reflect.defineMetadata(e,u,t)}function Ri(e){return function(t,n,o){typeof o=="number"?ja(t,n,o,e):Yc(t,n,e)}}function Re(){return function(e){if(Reflect.hasOwnMetadata(xi,e))throw new Error(Au);var t=Reflect.getMetadata(Eu,e)||[];return Reflect.defineMetadata(xi,t,e),e}}function Mi(e){return Ri(new ut(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 Ri(new ut(e,t))(n,o,a)}}}var xe=Jc(cr);function Xc(){return Ri(new ut(Ai,!0))}function Zc(){return function(e,t,n){var o=new ut(ur,!0);ja(e,t,n,o)}}var mr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function el(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 mr=="object"?mr:typeof self=="object"?self:typeof this=="object"?this:g(),o=a(e);typeof n.Reflect<"u"&&(o=a(n.Reflect,o)),t(o,n),typeof n.Reflect>"u"&&(n.Reflect=e);function a(S,p){return function(T,P){Object.defineProperty(S,T,{configurable:!0,writable:!0,value:P}),p&&p(T,P)}}function u(){try{return Function("return this;")()}catch{}}function f(){try{return(0,eval)("(function() { return this; })()")}catch{}}function g(){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",g=typeof Object.create=="function",S={__proto__:[]}instanceof Array,p=!g&&!S,T={create:g?function(){return It(Object.create(null))}:S?function(){return It({__proto__:null})}:function(){return It({})},has:p?function(x,D){return o.call(x,D)}:function(x,D){return D in x},get:p?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:qn(),Q=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Xt(),Z=typeof WeakMap=="function"?WeakMap:Hn(),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),lt(x,D,j,V)}}t("decorate",We);function yt(x,D){function j(V,L){if(!ye(V))throw new TypeError;if(!J(L)&&!Oo(L))throw new TypeError;ft(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)),ft(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 So(x,D){if(!ye(x))throw new TypeError;return J(D)||(D=Ge(D)),mt(x,D)}t("getMetadataKeys",So);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 lt(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 ft(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 Un(x)}function Un(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 Oo(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(zn){try{wn(we)}finally{throw zn}}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 qn(){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 Hn(){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 tl=Object.defineProperty,nl=Object.getOwnPropertyDescriptor,rl=(e,t,n,o)=>{for(var a=o>1?void 0:o?nl(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&&tl(t,n,a),a};let ki=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}};ki=rl([Re()],ki);class il{constructor(t,n,o){this.name=t,this.entryFile=n,this.staticModule=o}}var ol=Object.defineProperty,al=Object.getOwnPropertyDescriptor,sl=(e,t,n,o)=>{for(var a=o>1?void 0:o?al(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&&ol(t,n,a),a},ul=(e,t)=>(n,o)=>t(n,o,e);let ji=class extends ki{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 il(e,t,n))}setRemoteExtensionsConfig(e,t){this.remoteExtensionDefaultURL=e,this.remoteExtensionDefaultEntryFile=t}async loadExtension(e,t){var n,o,a,u,f;try{const g=this.remoteExtensions.get(e),S=g&&g.entryFile?g.entryFile:this.remoteExtensionDefaultEntryFile,p=this.remoteExtensionDefaultURL+e+"/"+S,T=this.remoteExtensionDefaultURL+e+"/style.css";(n=this.logger)==null||n.debug("Ready to import ",p);try{const B=await import(T);document.adoptedStyleSheets=[B.default]}catch{}const P=await import(p);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(g){(f=this.logger)==null||f.error("Exception while loading components from ",e,g)}}async loadExtensions(e){for(const t of this.remoteExtensions.keys())await this.loadExtension(t,e)}};ji=sl([Re(),ul(0,xe("Logger"))],ji);let cl=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(ji),(o=this.logger)==null||o.debug("Init Extension Manager components end")}};/**
25
+ * @vue/shared v3.4.31
26
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
27
+ * @license MIT
28
+ **//*! #__NO_SIDE_EFFECTS__ */function ll(e,t){const n=new Set(e.split(","));return o=>n.has(o)}const ct=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Kt=()=>{},fl=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),nt=Object.assign,hl=Object.prototype.hasOwnProperty,Ae=(e,t)=>hl.call(e,t),ge=Array.isArray,un=e=>br(e)==="[object Map]",dl=e=>br(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",pl=e=>(Ve(e)||Ne(e))&&Ne(e.then)&&Ne(e.catch),gl=Object.prototype.toString,br=e=>gl.call(e),Ba=e=>br(e).slice(8,-1),vl=e=>br(e)==="[object Object]",Li=e=>rt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,yl=(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),ml=(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 Fi(e){if(ge(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],a=rt(o)?El(o):Fi(o);if(a)for(const u in a)t[u]=a[u]}return t}else if(rt(e)||Ve(e))return e}const bl=/;(?![^(]*\))/g,_l=/:([^]+)/,wl=/\/\*[^]*?\*\//g;function El(e){const t={};return e.replace(wl,"").split(bl).forEach(n=>{if(n){const o=n.split(_l);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function Bi(e){let t="";if(rt(e))t=e;else if(ge(e))for(let n=0;n<e.length;n++){const o=Bi(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.31
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 Sl;function Ol(e,t=Sl){t&&t.active&&t.effects.push(e)}let Ln;class Cl{constructor(t,n,o,a){this.fn=t,this.trigger=n,this.scheduler=o,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,Ol(this,a)}get dirty(){if(this._dirtyLevel===2||this._dirtyLevel===3){this._dirtyLevel=1,_r();for(let t=0;t<this._depsLength;t++){const n=this.deps[t];if(n.computed&&(Al(n.computed),this._dirtyLevel>=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),wr()}return this._dirtyLevel>=4}set dirty(t){this._dirtyLevel=t?4: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 Al(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,Ki=0;const qa=[];function _r(){qa.push(Vt),Vt=!1}function wr(){const e=qa.pop();Vt=e===void 0?!0:e}function Vi(){Ki++}function $i(){for(Ki--;!Ki&&Wi.length;)Wi.shift()()}function xl(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 Wi=[];function Pl(e,t,n){var o;Vi();for(const a of e.keys()){let u;a._dirtyLevel<t&&(u??(u=e.get(a)===a._trackId))&&(a._shouldSchedule||(a._shouldSchedule=a._dirtyLevel===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!==2&&(a._shouldSchedule=!1,a.scheduler&&Wi.push(a.scheduler)))}$i()}const Tl=(e,t)=>{const n=new Map;return n.cleanup=e,n.computed=t,n},Ui=new WeakMap,$t=Symbol(process.env.NODE_ENV!=="production"?"iterate":""),qi=Symbol(process.env.NODE_ENV!=="production"?"Map key iterate":"");function Me(e,t,n){if(Vt&&Ln){let o=Ui.get(e);o||Ui.set(e,o=new Map);let a=o.get(n);a||o.set(n,a=Tl(()=>o.delete(n))),xl(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=Ui.get(e);if(!f)return;let g=[];if(t==="clear")g=[...f.values()];else if(n==="length"&&ge(e)){const S=Number(o);f.forEach((p,T)=>{(T==="length"||!kn(T)&&T>=S)&&g.push(p)})}else switch(n!==void 0&&g.push(f.get(n)),t){case"add":ge(e)?Li(n)&&g.push(f.get("length")):(g.push(f.get($t)),un(e)&&g.push(f.get(qi)));break;case"delete":ge(e)||(g.push(f.get($t)),un(e)&&g.push(f.get(qi)));break;case"set":un(e)&&g.push(f.get($t));break}Vi();for(const S of g)S&&Pl(S,4,process.env.NODE_ENV!=="production"?{target:e,type:t,key:n,newValue:o,oldValue:a,oldTarget:u}:void 0);$i()}const Il=ll("__proto__,__v_isRef,__isVue"),Ha=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(kn)),za=Dl();function Dl(){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){_r(),Vi();const o=ce(this)[t].apply(this,n);return $i(),wr(),o}}),e}function Nl(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?ql: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 Nl}const g=Reflect.get(t,n,o);return(kn(n)?Ha.has(n):Il(n))||(a||Me(t,"get",n),u)?g:Ze(g)?f&&Li(n)?g:g.value:Ve(g)?a?os(g):is(g):g}}class Rl extends Ga{constructor(t=!1){super(!1,t)}set(t,n,o,a){let u=t[n];if(!this._isShallow){const S=fn(u);if(!hn(o)&&!fn(o)&&(u=ce(u),o=ce(o)),!ge(t)&&Ze(u)&&!Ze(o))return S?!1:(u.value=o,!0)}const f=ge(t)&&Li(n)?Number(n)<t.length:Ae(t,n),g=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)),g}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 Ml=new Rl,kl=new Ya,jl=new Ya(!0),Hi=e=>e,Er=e=>Reflect.getPrototypeOf(e);function Sr(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}=Er(a),g=o?Hi:n?Ji:Qi;if(f.call(a,t))return g(e.get(t));if(f.call(a,u))return g(e.get(u));e!==a&&e.get(t)}function Or(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 Cr(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 Er(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}=Er(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}=Er(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 Ar(e,t){return function(o,a){const u=this,f=u.__v_raw,g=ce(f),S=t?Hi:e?Ji:Qi;return!e&&Me(g,"iterate",$t),f.forEach((p,T)=>o.call(a,S(p),S(T),u))}}function xr(e,t,n){return function(...o){const a=this.__v_raw,u=ce(a),f=un(u),g=e==="entries"||e===Symbol.iterator&&f,S=e==="keys"&&f,p=a[e](...o),T=n?Hi:t?Ji:Qi;return!t&&Me(u,"iterate",S?qi:$t),{next(){const{value:P,done:B}=p.next();return B?{value:P,done:B}:{value:g?[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(`${yl(e)} operation ${n}failed: target is readonly.`,ce(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function Ll(){const e={get(u){return Sr(this,u)},get size(){return Cr(this)},has:Or,add:Qa,set:Ja,delete:Xa,clear:Za,forEach:Ar(!1,!1)},t={get(u){return Sr(this,u,!1,!0)},get size(){return Cr(this)},has:Or,add:Qa,set:Ja,delete:Xa,clear:Za,forEach:Ar(!1,!0)},n={get(u){return Sr(this,u,!0)},get size(){return Cr(this,!0)},has(u){return Or.call(this,u,!0)},add:Ot("add"),set:Ot("set"),delete:Ot("delete"),clear:Ot("clear"),forEach:Ar(!0,!1)},o={get(u){return Sr(this,u,!0,!0)},get size(){return Cr(this,!0)},has(u){return Or.call(this,u,!0)},add:Ot("add"),set:Ot("set"),delete:Ot("delete"),clear:Ot("clear"),forEach:Ar(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(u=>{e[u]=xr(u,!1,!1),n[u]=xr(u,!0,!1),t[u]=xr(u,!1,!0),o[u]=xr(u,!0,!0)}),[e,n,t,o]}const[Fl,Bl,Kl,Vl]=Ll();function zi(e,t){const n=t?e?Vl:Kl:e?Bl:Fl;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 $l={get:zi(!1,!1)},Wl={get:zi(!0,!1)},Ul={get:zi(!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,ql=new WeakMap,ns=new WeakMap,rs=new WeakMap;function Hl(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function zl(e){return e.__v_skip||!Object.isExtensible(e)?0:Hl(Ba(e))}function is(e){return fn(e)?e:Gi(e,!1,Ml,$l,ts)}function os(e){return Gi(e,!0,kl,Wl,ns)}function Pr(e){return Gi(e,!0,jl,Ul,rs)}function Gi(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=zl(e);if(f===0)return e;const g=new Proxy(e,f===2?o:n);return a.set(e,g),g}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 Yi(e){return e?!!e.__v_raw:!1}function ce(e){const t=e&&e.__v_raw;return t?ce(t):e}function Gl(e){return Object.isExtensible(e)&&ml(e,"__v_skip",!0),e}const Qi=e=>Ve(e)?is(e):e,Ji=e=>Ve(e)?os(e):e;function Ze(e){return!!(e&&e.__v_isRef===!0)}function Yl(e){return Ze(e)?e.value:e}const Ql={get:(e,t,n)=>Yl(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 Jl(e){return ln(e)?e:new Proxy(e,Ql)}/**
33
+ * @vue/runtime-core v3.4.31
34
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
35
+ * @license MIT
36
+ **/const Wt=[];function Xl(e){Wt.push(e)}function Zl(){Wt.pop()}function _e(e,...t){_r();const n=Wt.length?Wt[Wt.length-1].component:null,o=n&&n.appContext.config.warnHandler,a=ef();if(o)Ut(o,n,11,[e+t.map(u=>{var f,g;return(g=(f=u.toString)==null?void 0:f.call(u))!=null?g: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
+ `,...tf(a)),console.warn(...u)}wr()}function ef(){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 tf(e){const t=[];return e.forEach((n,o)=>{t.push(...o===0?[]:[`
39
+ `],...nf(n))}),t}function nf({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,...rf(e.props),u]:[a+u]}function rf(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){Xi(a,t,n)}}function Tr(e,t,n,o){if(Ne(e)){const a=Ut(e,t,n,o);return a&&pl(a)&&a.catch(u=>{Xi(u,t,n)}),a}if(ge(e)){const a=[];for(let u=0;u<e.length;u++)a.push(Tr(e[u],t,n,o));return a}else process.env.NODE_ENV!=="production"&&_e(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function Xi(e,t,n,o=!0){const a=t?t.vnode:null;if(t){let u=t.parent;const f=t.proxy,g=process.env.NODE_ENV!=="production"?ss[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;u;){const p=u.ec;if(p){for(let T=0;T<p.length;T++)if(p[T](e,f,g)===!1)return}u=u.parent}const S=t.appContext.config.errorHandler;if(S){_r(),Ut(S,null,10,[e,f,g]),wr();return}}of(e,n,a,o)}function of(e,t,n,o=!0){if(process.env.NODE_ENV!=="production"){const a=ss[t];if(n&&Xl(n),_e(`Unhandled error${a?` during execution of ${a}`:""}`),n&&Zl(),o)throw e;console.error(e)}else console.error(e)}let Ir=!1,Zi=!1;const it=[];let Ct=0;const dn=[];let At=null,qt=0;const us=Promise.resolve();let eo=null;const af=100;function sf(e){const t=eo||us;return e?t.then(this?e.bind(this):e):t}function uf(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 to(e){(!it.length||!it.includes(e,Ir&&e.allowRecurse?Ct+1:Ct))&&(e.id==null?it.push(e):it.splice(uf(e.id),0,e),cs())}function cs(){!Ir&&!Zi&&(Zi=!0,eo=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 cf(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,lf=(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){Zi=!1,Ir=!0,process.env.NODE_ENV!=="production"&&(e=e||new Map),it.sort(lf);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,cf(e),Ir=!1,eo=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>af){const o=t.ownerInstance,a=o&&Ps(o.type);return Xi(`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:no(ff),rerender:no(hf),reload:no(df)});const Dr=new Map;function ff(e,t){return Dr.has(e)?!1:(Dr.set(e,{initialDef:Bn(t),instances:new Set}),!0)}function Bn(e){return Is(e)?e.__vccOpts:e}function hf(e,t){const n=Dr.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 df(e,t){const n=Dr.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,to(()=>{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 no(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,Nr=[];function ps(e,t){var n,o;gn=e,gn?(gn.enabled=!0,Nr.forEach(({event:a,args:u})=>gn.emit(a,...u)),Nr=[]):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,Nr=[])},3e3)):Nr=[]}let vt=null,pf=null;function wd(){}const gf=Symbol.for("v-ndc"),vf=e=>e.__isSuspense;function yf(e,t){t&&t.pendingBranch?ge(e)?t.effects.push(...e):t.effects.push(e):ls(e)}const ro=e=>e?Wf(e)?Uf(e):ro(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"?Pr(e.props):e.props,$attrs:e=>process.env.NODE_ENV!=="production"?Pr(e.attrs):e.attrs,$slots:e=>process.env.NODE_ENV!=="production"?Pr(e.slots):e.slots,$refs:e=>process.env.NODE_ENV!=="production"?Pr(e.refs):e.refs,$parent:e=>ro(e.parent),$root:e=>ro(e.root),$emit:e=>e.emit,$options:e=>__VUE_OPTIONS_API__?wf(e):e.type,$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,to(e.update)}),$nextTick:e=>e.n||(e.n=sf.bind(e.proxy)),$watch:e=>__VUE_OPTIONS_API__?If.bind(e):Kt}),mf=e=>e==="_"||e==="$",io=(e,t)=>e!==ct&&!e.__isScriptSetup&&Ae(e,t),bf={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:a,props:u,accessCache:f,type:g,appContext:S}=e;if(process.env.NODE_ENV!=="production"&&t==="__isVue")return!0;let p;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(io(o,t))return f[t]=1,o[t];if(a!==ct&&Ae(a,t))return f[t]=2,a[t];if((p=e.propsOptions[0])&&Ae(p,t))return f[t]=3,u[t];if(n!==ct&&Ae(n,t))return f[t]=4,n[t];(!__VUE_OPTIONS_API__||_f)&&(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=g.__cssModules)&&(P=P[t]))return P;if(n!==ct&&Ae(n,t))return f[t]=4,n[t];if(B=S.config.globalProperties,Ae(B,t))return B[t];process.env.NODE_ENV!=="production"&&vt&&(!rt(t)||t.indexOf("__v")!==0)&&(a!==ct&&mf(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 io(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!==ct&&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 g;return!!n[f]||e!==ct&&Ae(e,f)||io(t,f)||(g=u[0])&&Ae(g,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"&&(bf.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 _f=!0;function wf(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:a,optionsCache:u,config:{optionMergeStrategies:f}}=e.appContext,g=u.get(t);let S;return g?S=g:!a.length&&!n&&!o?S=t:(S={},a.length&&a.forEach(p=>Rr(S,p,f,!0)),Rr(S,t,f)),Ve(t)&&u.set(t,S),S}function Rr(e,t,n,o=!1){const{mixins:a,extends:u}=t;u&&Rr(e,u,n,!0),a&&a.forEach(f=>Rr(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 g=Ef[f]||n&&n[f];e[f]=g?g(e[f],t[f]):t[f]}return e}const Ef={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:Of,provide:vs,inject:Sf};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 Sf(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 Of(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 Cf(e,t,n=!1){const o=Lr||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 Af={},_s=e=>Object.getPrototypeOf(e)===Af,ws=yf,xf=Symbol.for("v-scx"),Pf=()=>{{const e=Cf(xf);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}},Mr={};function Tf(e,t,{immediate:n,deep:o,flush:a,once:u,onTrack:f,onTrigger:g}=ct){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 S=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.")},p=Lr,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,p,2);process.env.NODE_ENV!=="production"&&S(ne)})):Ne(e)?t?P=()=>Ut(e,p,2):P=()=>(Z&&Z(),Tr(e,p,3,[fe])):(P=Kt,process.env.NODE_ENV!=="production"&&S(e)),t&&o){const ne=P;P=()=>Ht(ne())}let Z,fe=ne=>{Z=Se.onStop=()=>{Ut(ne,p,4),Z=Se.onStop=void 0}},He;if(xs)if(fe=Kt,t?n&&Tr(t,p,3,[P(),Q?[]:void 0,fe]):P(),a==="sync"){const ne=Pf();He=ne.__watcherHandles||(ne.__watcherHandles=[])}else return Kt;let $e=Q?new Array(e.length).fill(Mr):Mr;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(),Tr(t,p,3,[ne,$e===Mr?void 0:Q&&$e[0]===Mr?[]:$e,fe]),$e=ne)}else Se.run()};We.allowRecurse=!!t;let yt;a==="sync"?yt=We:a==="post"?yt=()=>ws(We,p&&p.suspense):(We.pre=!0,p&&(We.id=p.uid),yt=()=>to(We));const Se=new Cl(P,Kt,yt),xt=()=>{Se.stop()};return process.env.NODE_ENV!=="production"&&(Se.onTrack=f,Se.onTrigger=g),t?n?We():$e=Se.run():a==="post"?ws(Se.run.bind(Se),p&&p.suspense):Se.run(),He&&He.push(xt),xt}function If(e,t,n){const o=this.proxy,a=rt(e)?e.includes(".")?Df(o,e):()=>o[e]:e.bind(o,o);let u;Ne(t)?u=t:(u=t.handler,n=t);const f=$f(this),g=Tf(a,u.bind(o),n);return f(),g}function Df(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(dl(e)||un(e))e.forEach(o=>{Ht(o,t,n)});else if(vl(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 Nf=e=>e.__isTeleport,Ss=Symbol.for("v-fgt"),Rf=Symbol.for("v-txt"),Mf=Symbol.for("v-cmt");let vn=null;function kf(e){return e?e.__v_isVNode===!0:!1}const jf=(...e)=>Cs(...e),Os=({key:e})=>e??null,kr=({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 Lf(e,t=null,n=null,o=0,a=null,u=e===Ss?0:1,f=!1,g=!1){const S={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Os(t),ref:t&&kr(t),scopeId:pf,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 g?(oo(S,n),u&128&&e.normalize(S)):n&&(S.shapeFlag|=rt(n)?8:16),process.env.NODE_ENV!=="production"&&S.key!==S.key&&_e("VNode created with invalid key (NaN). VNode type:",S.type),!f&&vn&&(S.patchFlag>0||u&6)&&S.patchFlag!==32&&vn.push(S),S}const Ff=process.env.NODE_ENV!=="production"?jf:Cs;function Cs(e,t=null,n=null,o=0,a=null,u=!1){if((!e||e===gf)&&(process.env.NODE_ENV!=="production"&&!e&&_e(`Invalid vnode type when creating vnode: ${e}.`),e=Mf),kf(e)){const g=jr(e,t,!0);return n&&oo(g,n),!u&&vn&&(g.shapeFlag&6?vn[vn.indexOf(e)]=g:vn.push(g)),g.patchFlag=-2,g}if(Is(e)&&(e=e.__vccOpts),t){t=Bf(t);let{class:g,style:S}=t;g&&!rt(g)&&(t.class=Bi(g)),Ve(S)&&(Yi(S)&&!ge(S)&&(S=nt({},S)),t.style=Fi(S))}const f=rt(e)?1:vf(e)?128:Nf(e)?64:Ve(e)?4:Ne(e)?2:0;return process.env.NODE_ENV!=="production"&&f&4&&Yi(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)),Lf(e,t,n,o,a,f,u,!0)}function Bf(e){return e?Yi(e)||_s(e)?nt({},e):e:null}function jr(e,t,n=!1,o=!1){const{props:a,ref:u,patchFlag:f,children:g,transition:S}=e,p=t?Vf(a||{},t):a,T={__v_isVNode:!0,__v_skip:!0,type:e.type,props:p,key:p&&Os(p),ref:t&&t.ref?n&&u?ge(u)?u.concat(kr(t)):[u,kr(t)]:kr(t):u,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&f===-1&&ge(g)?g.map(As):g,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:S,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&jr(e.ssContent),ssFallback:e.ssFallback&&jr(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return S&&o&&Es(T,S.clone(T)),T}function As(e){const t=jr(e);return ge(e.children)&&(t.children=e.children.map(As)),t}function Kf(e=" ",t=0){return Ff(Rf,null,e,t)}function oo(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),oo(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=[Kf(t)]):n=8);e.children=t,e.shapeFlag|=n}function Vf(...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=Bi([t.class,o.class]));else if(a==="style")t.style=Fi([t.style,o.style]);else if(fl(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 Lr=null,ao;{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)}};ao=t("__VUE_INSTANCE_SETTERS__",n=>Lr=n),t("__VUE_SSR_SETTERS__",n=>xs=n)}const $f=e=>{const t=Lr;return ao(e),e.scope.on(),()=>{e.scope.off(),ao(t)}};function Wf(e){return e.vnode.shapeFlag&4}let xs=!1;process.env.NODE_ENV;function Uf(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Jl(Gl(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 qf=/(?:^|[-_])(\w)/g,Hf=e=>e.replace(qf,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?Hf(o):n?"App":"Anonymous"}function Is(e){return Ne(e)&&"__vccOpts"in e}function zf(){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)],"<",g(P.value),">"]:ln(P)?["div",{},["span",e,hn(P)?"ShallowReactive":"Reactive"],"<",g(P),`>${fn(P)?" (readonly)":""}`]:fn(P)?["div",{},["span",e,hn(P)?"ShallowReadonly":"Readonly"],"<",g(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!==ct&&B.push(f("setup",P.setupState)),P.data!==ct&&B.push(f("data",ce(P.data)));const Q=S(P,"computed");Q&&B.push(f("computed",Q));const Z=S(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+": "],g(B[Q],!1)])]]:["span",{}]}function g(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 S(P,B){const Q=P.type;if(Ne(Q))return;const Z={};for(const fe in P.ctx)p(Q,fe,B)&&(Z[fe]=P.ctx[fe]);return Z}function p(P,B,Q){const Z=P[Q];if(ge(Z)&&Z.includes(B)||Ve(Z)&&B in Z||P.extends&&p(P.extends,B,Q)||P.mixins&&P.mixins.some(fe=>p(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.31
42
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
43
+ * @license MIT
44
+ **/function Gf(){zf()}process.env.NODE_ENV!=="production"&&Gf();class so{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.mode="",this.headline="",this.headlineRaw="",this.document=new so({}),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 so(t.document),this.css=t.css,this.js=t.js,this.version=t.version}}var Yf=Object.defineProperty,Qf=Object.getOwnPropertyDescriptor,Jf=(e,t,n,o)=>{for(var a=o>1?void 0:o?Qf(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&&Yf(t,n,a),a},Xf=(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"}getNewPageDefaultName(){return"newpage"}};$n=Jf([Re(),Xf(0,xe("Logger"))],$n);var Zf=Object.defineProperty,eh=Object.getOwnPropertyDescriptor,th=(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&&Zf(t,n,a),a},Ds=(e,t)=>(n,o)=>t(n,o,e);let Fr=class{constructor(e){this.loggerConfig=e}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)}};Fr=th([Re(),Ds(0,xe("LoggerConfig")),Ds(0,Xc())],Fr);var nh=Object.defineProperty,rh=Object.getOwnPropertyDescriptor,ih=(e,t,n,o)=>{for(var a=o>1?void 0:o?rh(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&&nh(t,n,a),a};let uo=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)}};uo=ih([Re()],uo);class oh{constructor(t){this.extensionList=t}getLogger(t){let n=this.container.get("Logger");return n||(n=new Fr),n.setModule(t),n}async loadExtensionManager(t){var a,u,f,g,S,p;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 cl(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),(g=this.logger)==null||g.debug("Succesfull components Init for ",n)}else(S=this.logger)==null||S.debug("No components to load for ",n)}}catch(T){(p=this.logger)==null||p.error("Exception while loading extension Manager from ",o,T)}}async loadExtensions(t,n){var a,u,f,g;(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 S in this.extensionList)o.addRemoteExtension(S,"",!0);await o.loadExtensions(this.container)}(f=this.logger)==null||f.debug("After extensions loading")}else(g=this.logger)==null||g.debug("Could not start extension Manager");return o}initializeContainer(){var n;this.container=new qc,this.container.bind("LoggerConfig").to(uo).inSingletonScope(),this.container.bind("Logger").to(Fr);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()})(mr,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:mr,f=Object.keys,g=Array.isArray;function S(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 p=Object.getPrototypeOf,T={}.hasOwnProperty;function P(r,i){return T.call(r,i)}function B(r,i){typeof i=="function"&&(i=i(p(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,S(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?g(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?g(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 So=[].concat;function $r(r){return So.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 lt(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(g(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=p(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 ft(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(g(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 Un=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 Oo(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);S(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:S(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,p(r),r];var i=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[i,p(i),r]}(),Jt=wt[0],tt=wt[1],wt=wt[2],tt=tt&&tt.then,at=Jt&&Jt.constructor,qn=!!wt,Xt=function(r,i){me.push([r,i]),It&&(queueMicrotask(Ye),It=!1)},Hn=!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&&zn()},[]))}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&&zn(),--s.psd.ref||s.psd.finalize()}}function Ye(){Zt(V,function(){bt()&&Dt()})}function bt(){var r=Hn;return It=Hn=!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=Hn=!0}function zn(){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&&zn()},[])},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},Jh=0,ti=[],ni=0,ri=0,Xh=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=++Xh,V.env,h.env=qn?{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&&S(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=++Jh),++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 Zh(){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):Zh),r!==L&&(L=r,c===V&&(V.env=ks()),qn&&(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 qn?{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 Co(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",Ao="readonly",xo="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=lt(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 E=O._createTransaction(y,C,O._dbSchema);try{E.create(),O._state.PR1398_maxLoop=3}catch(A){return A.name===Un.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 E._promise(y,function(A,w){return Nt(function(){return L.trans=E,b(A,w,E)})}).then(function(A){if(y==="readwrite")try{E.idbtrans.commit()}catch{}return y==="readonly"?A:E._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(g(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(E){return E=ne(E,m),g(E)&&E.some(function(A){return h(b,A)})}:function(E){return h(b,ne(E,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,g(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=p(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){S(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"||g(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(E){var y=E.numFailures,C=E.results,b=E.lastResult,E=E.failures;if(y===0)return h?C:b;throw new Pt("".concat(c.name,".bulkAdd(): ").concat(y," of ").concat(_," operations failed"),E)})})},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(E){var y=E.numFailures,C=E.results,b=E.lastResult,E=E.failures;if(y===0)return h?C:b;throw new Pt("".concat(c.name,".bulkPut(): ").concat(y," of ").concat(_," operations failed"),E)})})},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,E=y.changes,A=v[C];if(A){for(var w=0,I=Object.keys(E);w<I.length;w++){var R=I[w],M=E[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 E=0,A=Object.keys(b);E<A.length;E++){var w,I=A[E],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 Gn(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(g(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 E=arguments.length,A=new Array(E);E--;)A[E]=arguments[E];b.subscribers.forEach(function(w){xt(function(){w.apply(null,A)})})})}})}}function Yn(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 Po(r,i){r.filter=tn(r.filter,i)}function To(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(),Qn=(qs.prototype.execute=function(r){if(this.add!==void 0){var i=this.add;if(g(i))return a(a([],g(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(g(s))return g(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 ed=(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&&S(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)?To(i,function(){var s=r;return function(c,l){return s===0||(s===1?--s:l(function(){c.advance(s),s=0}),!1)}}):To(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),To(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 Po(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 Po(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 Po(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 Qn?(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;E+=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=[],E=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:lt(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===Io)&&_.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===Io)&&{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,E,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(Io)},ue);function ue(){}var Io=function(r,i){return i.value=null};function td(r,i){return r<i?-1:r===i?0:1}function nd(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(E){return typeof E=="string"}))return Qe(r,Ls);function C(E){l=E==="next"?function(w){return w.toUpperCase()}:function(w){return w.toLowerCase()},h=E==="next"?function(w){return w.toLowerCase()}:function(w){return w.toUpperCase()},d=E==="next"?td:nd;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=E)==="next"?"":c}C("next"),r=new r.Collection(r,function(){return kt(v[0],_[y-1]+c)}),r._ondirectionchange=function(E){C(E)};var b=0;return r._addAlgorithm(function(E,A,w){var I=E.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(){E.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,E=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=E,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=E,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!E(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 ht(r){return be(function(i){return Jn(i),r(i.target.error),!1})}function Jn(r){r.stopPropagation&&r.stopPropagation(),r.preventDefault&&r.preventDefault()}var Xn="storagemutated",Do="x-storagemutated-1",jt=Gn(null,Xn),rd=(dt.prototype._lock=function(){return Se(!L.global),++this._reculock,this._reculock!==1||L.global||(L.lockOwnerFor=this),this},dt.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},dt.prototype._locked=function(){return this._reculock&&L.lockOwnerFor!==this},dt.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){Jn(l),i._reject(r.error)}),r.onabort=be(function(l){Jn(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},dt.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},dt.prototype._root=function(){return this.parent?this.parent._root():this},dt.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)})})},dt.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Y.Abort))},dt.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},dt);function dt(){}function No(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 Ro(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 Zn=function(r){try{return r.only([[]]),Zn=function(){return[[]]},[[]]}catch{return Zn=function(){return en},en}};function Mo(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 id=0;function er(r){return r==null?":id":typeof r=="string"?r:"[".concat(r.join("+"),"]")}function od(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,E=w.upper,A=w.lowerOpen,w=w.upperOpen;return b===void 0?E===void 0?null:i.upperBound(E,!!w):E===void 0?i.lowerBound(b,!!A):i.bound(b,E,!!A,!!w)}function l(C){var b,E=C.name;return{name:E,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(E),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,Jn(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,Zo){return on.error!=null&&(ie[Zo]=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(E),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=ht(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(E).get(I);k.onsuccess=function(F){return R(F.target.result)},k.onerror=ht(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(E),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=ht(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=ht(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(E),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=ht(U),$.onsuccess=be(function(X){var te,ae,ie,st,oe=$.result;oe?(oe.___id=++id,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=ht(on),oe.fail=on,oe.stop=function(Zo){oe.stop=oe.continue=oe.continuePrimaryKey=oe.advance=st,Be(Zo)}});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(E),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=ht(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,E=g(b),A={},w={name:C.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:b==null,compound:E,keyPath:b,autoIncrement:w,unique:!0,extractKey:Mo(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:g(k),keyPath:k,unique:M,multiEntry:F,extractKey:Mo(k)};return A[er(k)]=F}),getIndexByKeyPath:function(I){return A[er(I)]}};return A[":id"]=w.primaryKey,b!=null&&(A[er(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:Zn(i),schema:_}}function ad(r,i,s,c){var l=s.IDBKeyRange;return s.indexedDB,{dbcore:(c=od(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=ad(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=p(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 ko(r,i){i.forEach(function(s){for(var c in s)s[c]instanceof r.Table&&delete s[c]})}function sd(r,i){return r._cfg.version-i._cfg.version}function ud(r,i,s,c){var l=r._dbSchema;s.objectStoreNames.contains("$meta")&&!l.$meta&&(l.$meta=Ro("$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,E=s,A=[],O=(y=r)._versions,w=y._dbSchema=di(0,y.idbdb,E),(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,E),pi(y,M,E),w=y._dbSchema=M;var k=jo(R,M);k.add.forEach(function(q){Lo(E,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 $=E.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,E),b._memoizedTables={};var U=mn(M);k.del.forEach(function(q){U[q]=R[q]}),ko(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)}),ko(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,E)})):N.resolve();var y,C,b,E,A,w}).catch(d)):(f(l).forEach(function(O){Lo(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 cd(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=jo(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 jo(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 Lo(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),Lo(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=No(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=No(O.name,m,!!O.unique,!!O.multiEntry,!1,m&&typeof m!="string",!1);v.push(O)}c[l]=Ro(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 No(c,l||null,/\&/.test(i),/\*/.test(i),/\+\+/.test(i),g(l),s===0)})}var ld=(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]=Ro(s,l,c)}})},gi.prototype.stores=function(s){var i=this.db;this._cfg.storesSource=this._cfg.storesSource?S(this._cfg.storesSource,s):s;var s=i._versions,c={},l={};return s.forEach(function(h){S(c,h._cfg.storesSource),l=h._cfg.dbschema={},h._parseStoresSpec(c,l)}),i._dbSchema=l,ko(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 Fo(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 Bo(r){return r&&typeof r.databases=="function"}function Ko(r){return Nt(function(){return L.letThrough=!0,r()})}function Vo(r){return!("from"in r)}var ke=function(r,i){if(!this){var s=new ke;return r&&"d"in r&&S(s,r),s}S(this,arguments.length?{d:1,from:r,to:1<arguments.length?i:r}:{d:0})};function tr(r,i,s){var c=le(i,s);if(!isNaN(c)){if(0<c)throw RangeError();if(Vo(r))return S(r,{from:i,to:s,d:1});var l=r.l,c=r.r;if(le(s,r.from)<0)return l?tr(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?tr(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&&nr(r,l),c&&s&&nr(r,c)}}function nr(r,i){Vo(i)||function s(c,_){var h=_.from,d=_.to,v=_.l,_=_.r;tr(c,h,d),v&&s(c,v),_&&s(c,_)}(r,i)}function vi(r,i){var s=$o(i),c=s.next();if(c.done)return!1;for(var l=c.value,h=$o(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 $o(r){var i=Vo(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]?nr(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 Wo(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 nr(this,r),this},addKey:function(r){return tr(this,r,r),this},addKeys:function(r){var i=this;return r.forEach(function(s){return tr(i,s,s)}),this}})[bn]=function(){return $o(this)},tt));var nn={},Uo={},qo=!1;function mi(r){yi(Uo,r),qo||(qo=!0,setTimeout(function(){qo=!1,Ho(Uo,!(Uo={}))},0))}function Ho(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];Wo(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,E=l;b<E.length;b++){var A=E[b],_=A[0],m=A[1];r.queries.query[_]=m}}function fd(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 E=r.name,A=i.autoSchema||!l?s.open(E):s.open(E,l);if(!A)throw new Y.MissingAPI;A.onerror=ht(b),A.onblocked=be(r._fireOnBlocked),A.onupgradeneeded=be(function(w){var I;O=A.transaction,i.autoSchema&&!r._options.allowEmptyDB?(A.onerror=Jn,O.abort(),A.result.close(),(I=s.deleteDatabase(E)).onsuccess=I.onerror=be(function(){b(new Y.NoSuchDatabase("Database ".concat(E," doesnt exist")))})):(O.onerror=ht(b),w=w.oldVersion>Math.pow(2,62)?0:w.oldVersion,y=w<1,r.idbdb=A.result,h&&cd(r,O),ud(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=jo(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=E,F=k.indexedDB,k=k.IDBKeyRange,Bo(F)||K===oi||Fo(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(Ko(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(Ko(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(E){E.name&&(C["idb://".concat(r.name,"/").concat(b.name,"/").concat(E.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(Xn).fire(C),Ho(C,!0)),r})}function zo(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):g(_)?Promise.all(_).then(s,c):s(_)}}return l(i)()}function bi(r,i,s){for(var c=g(r)?r.slice():[r],l=0;l<s;++l)c.push(i);return c}var hd={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 E=er(y),A=l[E]=l[E]||[],w=y==null?0:typeof y=="string"?1:y.length,I=0<C,I=o(o({},b),{name:I?"".concat(E,"(virtual-from:").concat(b.name,")"):b.name,lowLevelIndex:b,isVirtual:I,keyTail:C,keyLength:w,extractKey:Mo(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[er(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,E=C.isVirtual,A=C.keyLength;return E?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 Go(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"?Go(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 Yo(r,i){return i.type==="delete"?i.keys:i.keys||i.values.map(r.extractKey)}var dd={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,E){return s.query({trans:C,values:!1,query:{index:c,range:b},limit:E}).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<E?{failures:[],numFailures:0,lastResult:void 0}:y(C,o(o({},b),{lower:w[w.length-1],lowerOpen:!0}),E)})})}(l.trans,l.range,1e4)},!0)}return s.mutate(l);function O(y){var C,b,E,A=L.trans,w=y.keys||Yo(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,E=w,((b=y).type==="add"?Promise.resolve([]):C.getMany({trans:b.trans,keys:E,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=Go(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?lt(i.values[l]):i.values[l]),++h);return c.length===r.length?c:null}catch{return null}}var pd={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"?lt(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 gd={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 E($){return $="idb://".concat(i,"/").concat(c,"/").concat($),M[$]||(M[$]=new ke)}var A,w,I,R=b.trans,M=b.mutatedParts||(b.mutatedParts={}),k=E(""),F=E(":dels"),U=b.type,q=b.type==="deleteRange"?[b.range]:b.type==="delete"?[b.keys]:b.values.length<50?[Yo(d,b).filter(function($){return $}),b.values]:[],K=q[0],W=q[1],q=b.trans._cache;return g(K)?(k.addKeys(K),(q=U==="delete"||K.length===W.length?tu(K,q):null)||F.addKeys(K),(q||W)&&(A=E,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&&g(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 E($.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}),E(X.name).addKeys(te)})),R.mutatedParts=yi(R.mutatedParts||{},M),$})}}),y=function(E){var A=E.query,E=A.index,A=A.range;return[E,new ke((E=A.lower)!==null&&E!==void 0?E: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(E){var A=L.subscr,w=!!A,I=nu(L,l)&&ru(b,E)?E.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](E),w=A[0],A=A[1];if((b==="query"&&w.isPrimaryKey&&!E.values?k:R(w.name||"")).add(A),!w.isPrimaryKey){if(b!=="count"){var F=b==="query"&&_&&E.values&&l.query(o(o({},E),{values:!1}));return l[b].apply(this,arguments).then(function(W){if(b==="query"){if(_&&E.values)return F.then(function(te){return te=te.result,M.addKeys(te),W});var q=E.values?W.result.map(v):W.result;(E.values?M:k).addKeys(q)}else if(b==="openCursor"){var $=W,X=E.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),g(i.keys)&&(i.keys=i.keys.filter(function(l,h){return!(h in s.failures)})),"values"in i&&g(i.values)&&(i.values=i.values.filter(function(l,h){return!(h in s.failures)})),i)}function Qo(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,E){var A=b,w=E.type==="add"||E.type==="put"?E.values.filter(function(k){return k=O(k),v&&g(k)?k.some(function(F){return Qo(F,_)}):Qo(k,_)}).map(function(k){return k=lt(k),h&&Object.freeze(k),k}):[];switch(E.type){case"add":A=b.concat(i.values?w:w.map(function(F){return m(F)}));break;case"put":var I=new ke().addKeys(E.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(E.keys);A=b.filter(function(F){return F=i.values?m(F):F,!vi(new ke(F),R)});break;case"deleteRange":var M=E.range;A=b.filter(function(F){return!Qo(m(F),M)})}return A},r);return C===r?r:(C.sort(function(b,E){return le(y(b),y(E))||le(m(b),m(E))}),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 vd(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 yd(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&&ft(h,l)},3e3))})}var md={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 E=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++)Wo((K=M[R]).obsSet,v.mutatedParts)&&(ft(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,E,K,W),K.dirty?(ft(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&&ft(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||Yo(l,h).some(function(_){return _==null}))?(v.optimisticOps.push(h),h.mutatedParts&&mi(h.mutatedParts),d.then(function(_){0<_.numFailures&&(ft(v.optimisticOps,h),(_=iu(0,h,_))&&v.optimisticOps.push(_),h.mutatedParts&&mi(h.mutatedParts))}),d.catch(function(){ft(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(".")?lt(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(E,A,w,I){var R=nn["idb://".concat(E,"/").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)&&vd(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(E){var A=E.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 E.result=lt(A);return E}).catch(function(E){return b&&O&&ft(b,O),Promise.reject(E)}),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)),yd(O,b,v,_),O.promise.then(function(E){return{result:ou(E.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(sd),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 fd(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,Bo(O)||m===oi||Fo(O,_).delete(m).catch(se),l()}),v.onerror=ht(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===Ao)h=Ao;else{if(r!="rw"&&r!=xo)throw new Y.InvalidArgument("Invalid transaction mode: "+r);h=xo}if(l){if(l.mode===Ao&&h===xo){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,E){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===Un.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,E)})):Oe(M)}var I,R=_n(E);return R&&En(),A=N.follow(function(){var M;(I=E.call(w,w))&&(R?(M=Rt.bind(null,null),I.then(M,M)):typeof I.next=="function"&&typeof I.throw=="function"&&(I=zo(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=Gn(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 E,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),E=s,b||y(function w(){E.on.ready.unsubscribe(C),E.on.ready.unsubscribe(w)}))})}}),this.Collection=(l=this,Yn(ed.prototype,function(I,w){this.db=l;var b=Fs,E=null;if(w)try{b=w()}catch(R){E=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:E,or:A.or,valueMapper:I!==Tt?I:null}})),this.Table=(h=this,Yn($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:Gn(null,{creating:[Gr,se],reading:[Oo,Tt],updating:[Qr,se],deleting:[Yr,se]})})),this.Transaction=(d=this,Yn(rd.prototype,function(y,C,b,E,A){var w=this;this.db=d,this.mode=y,this.storeNames=C,this.schema=b,this.chromeTransactionDurability=E,this.idbtrans=null,this.on=Gn(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,Yn(ld.prototype,function(y){this.db=v,this._cfg={version:y,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(_=this,Yn(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(E,A){return le(A,E)},this._max=function(E,A){return 0<le(E,A)?E:A},this._min=function(E,A){return le(E,A)<0?E: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=Zn(i.IDBKeyRange),this._createTransaction=function(y,C,b,E){return new s.Transaction(y,C,b,s._options.chromeTransactionDurability,E)},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(pd),this.use(md),this.use(gd),this.use(hd),this.use(dd);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 E=Reflect.get(y,C,b);return E instanceof $s?_i(E,O):C==="tables"?E.map(function(A){return _i(A,O)}):C==="_createTransaction"?function(){return _i(E.apply(this,arguments),O)}:E}});this.vip=O,c.forEach(function(y){return y(s)})}var wi,tt=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",bd=(Jo.prototype.subscribe=function(r,i,s){return this._subscribe(r&&typeof r!="function"?r:{next:r,error:i,complete:s})},Jo.prototype[tt]=function(){return this},Jo);function Jo(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 bd(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 Co(E)},b=function(A){yi(_,A),Wo(m,_)&&C()},E=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(Xn,b),y=!0),Co(function(){return!v&&l.next&&l.next(R)}))},function(R){s=!1,["DatabaseClosedError","AbortError"].includes(R==null?void 0:R.name)||v||Co(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 Xo(r){var i=Lt;try{Lt=!0,jt.storagemutated.fire(r),Ho(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,(Bo(s)?Promise.resolve(s.databases()).then(function(c){return c.map(function(l){return l.name}).filter(function(l){return l!==oi})}):Fo(s,i).toCollection().primaryKeys()).then(r)}catch{return Oe(new Y.MissingAPI)}var i,s},defineClass:function(){return function(r){S(this,r)}},ignoreTransaction:function(r){return L.trans?Zt(L.transless,r):r()},vip:Ko,async:function(r){return function(){try{var i=zo(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=zo(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:S,props:B,override:yt,Events:Gn,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:lt,getObjectDiff:Go,cmp:le,asap:xt,minKey:-1/0,addons:[],connections:Sn,errnames:Un,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=Zn(rn.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(jt(Xn,function(r){Lt||(r=new CustomEvent(Do,{detail:r}),Lt=!0,dispatchEvent(r),Lt=!1)}),addEventListener(Do,function(r){r=r.detail,Lt||Xo(r)}));var An,Lt=!1,uu=function(){};return typeof BroadcastChannel<"u"&&((uu=function(){(An=new BroadcastChannel(Do)).onmessage=function(r){return r.data&&Xo(r.data)}})(),typeof An.unref=="function"&&An.unref(),jt(Xn,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(),Xo({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:Qn,replacePrefix:function(r,i){return new Qn({replacePrefix:[r,i]})},add:function(r){return new Qn({add:r})},remove:function(r){return new Qn({remove:r})},default:Et,RangeSet:ke,mergeRanges:nr,rangesOverlap:vi}),{default:Et}),Et})})(Ns);var ah=Ns.exports,co=el(ah);const Rs=Symbol.for("Dexie"),lo=globalThis[Rs]||(globalThis[Rs]=co);if(co.semVer!==lo.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${co.semVer} and ${lo.semVer}`);class sh extends lo{constructor(t){super("pages_"+t),this.version(2).stores({pages:"id, name, content, document, css, js, document.name, document.headline, document.creator"})}}var uh=Object.defineProperty,ch=Object.getOwnPropertyDescriptor,lh=(e,t,n,o)=>{for(var a=o>1?void 0:o?ch(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&&uh(t,n,a),a},fh=(e,t)=>(n,o)=>t(n,o,e);let fo=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 sh(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)}}};fo=lh([Re(),fh(0,xe("Logger"))],fo);var hh=Object.defineProperty,dh=Object.getOwnPropertyDescriptor,ph=(e,t,n,o)=>{for(var a=o>1?void 0:o?dh(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&&hh(t,n,a),a},ho=(e,t)=>(n,o)=>t(n,o,e);let po=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)}};po=ph([Re(),ho(0,xe("Logger")),ho(1,xe("OfflineStorage")),ho(2,xe("QueueWorker"))],po);let gh=class{constructor(t){t.bind("WrappingStorage").to(po).inSingletonScope(),t.bind("OfflineStorage").to(fo).inSingletonScope()}};var vh=Object.defineProperty,yh=Object.getOwnPropertyDescriptor,mh=(e,t,n,o)=>{for(var a=o>1?void 0:o?yh(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&&vh(t,n,a),a},Br=(e,t)=>(n,o)=>t(n,o,e);let go=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"}};go=mh([Re(),Br(0,xe("Logger")),Br(1,xe("Storage")),Br(1,Mi("GitHub")),Br(2,xe("CristalApp"))],go);var bh=Object.defineProperty,_h=Object.getOwnPropertyDescriptor,wh=(e,t,n,o)=>{for(var a=o>1?void 0:o?_h(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&&bh(t,n,a),a},Eh=(e,t)=>(n,o)=>t(n,o,e);let Wn=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}};Wn=wh([Re(),Eh(0,Zc())],Wn);var Sh=Object.defineProperty,Oh=Object.getOwnPropertyDescriptor,Ch=(e,t,n,o)=>{for(var a=o>1?void 0:o?Oh(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&&Sh(t,n,a),a},Ah=(e,t)=>(n,o)=>t(n,o,e);let vo=class extends Wn{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){const n=e.replace(/[^/]*$/,"");return`${this.wikiConfig.baseRestURL}${n}${t}`}async getPageContent(e,t){var g;(g=this.logger)==null||g.debug("GitHub Loading page",e);const n=this.getPageRestURL(e,t),a=await(await fetch(n,{cache:"no-store"})).text();let u="";t=="json"?u="":t=="md"||t=="html"?u=a:u="";const f=new yn;return f.id=e,f.name=e.split("/").pop(),f.source=u,f.syntax="md",f.css=[],f.version=this.hashCode(u),f}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")}};vo=Ch([Re(),Ah(0,xe("Logger"))],vo);let xh=class{constructor(t){t.bind("WikiConfig").to(go).whenTargetNamed("GitHub"),t.bind("Storage").to(vo).whenTargetNamed("GitHub")}};var Ph=Object.defineProperty,Th=Object.getOwnPropertyDescriptor,Ih=(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&&Ph(t,n,a),a},Kr=(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)}isSupported(e){return e=="html"}defaultPageName(){return"home"}getType(){return"Nextcloud"}};yo=Ih([Re(),Kr(0,xe("Logger")),Kr(1,xe("Storage")),Kr(1,Mi("Nextcloud")),Kr(2,xe("CristalApp"))],yo);var Dh=Object.defineProperty,Nh=Object.getOwnPropertyDescriptor,Rh=(e,t,n,o)=>{for(var a=o>1?void 0:o?Nh(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&&Dh(t,n,a),a},Mh=(e,t)=>(n,o)=>t(n,o,e);let mo=class extends Wn{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,id:e,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 g=a[f];if(g.getElementsByTagName("d:getcontenttype").length>0){const S=g.getElementsByTagName("d:href")[0].textContent,p=g.getElementsByTagName("d:getcontenttype")[0].textContent,T=S.split("/"),P=`${this.getWikiConfig().baseRestURL}/${T.slice(5).join("/")}`,B=T[T.length-1];u.push({mimetype:p,reference:B,id:S,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")}`}}};mo=Rh([Re(),Mh(0,xe("Logger"))],mo);let kh=class{constructor(t){t.bind("WikiConfig").to(yo).whenTargetNamed("Nextcloud"),t.bind("Storage").to(mo).whenTargetNamed("Nextcloud")}};var jh=Object.defineProperty,Lh=Object.getOwnPropertyDescriptor,Fh=(e,t,n,o)=>{for(var a=o>1?void 0:o?Lh(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&&jh(t,n,a),a},Vr=(e,t)=>(n,o)=>t(n,o,e);let bo=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"}getNewPageDefaultName(){return"NewPage.WebHome"}};bo=Fh([Re(),Vr(0,xe("Logger")),Vr(1,xe("Storage")),Vr(1,Mi("XWiki")),Vr(2,xe("CristalApp"))],bo);var Bh=Object.defineProperty,Kh=Object.getOwnPropertyDescriptor,Vh=(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&&Bh(t,n,a),a},$h=(e,t)=>(n,o)=>t(n,o,e);let _o=class extends Wn{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="+encodeURIComponent(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=decodeURIComponent(t)):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 p,T,P,B,Q,Z;(p=this.logger)==null||p.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="",g={};t=="jsonld"?(g=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 S=new yn;return S.source=u,S.syntax="xwiki",S.html=f,S.document=new so(g),S.css=a.css,S.js=a.js,S.version=S.document.get("version"),S.headlineRaw=a.headlineRaw,S.headline=a.headline,S.name=a.name,S}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:g})=>({id:a,reference:u,mimetype:f,href:g}))}}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 g=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",g),await(await fetch(g,{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`}};_o=Vh([Re(),$h(0,xe("Logger"))],_o);class Wh{constructor(t){t.bind("WikiConfig").to(bo).whenTargetNamed("XWiki"),t.bind("Storage").to(_o).whenTargetNamed("XWiki")}}var Uh=Object.defineProperty,qh=Object.getOwnPropertyDescriptor,Hh=(e,t,n,o)=>{for(var a=o>1?void 0:o?qh(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&&Uh(t,n,a),a};let wo=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.")}};wo=Hh([Re()],wo);var zh=Object.defineProperty,Gh=Object.getOwnPropertyDescriptor,Yh=(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&&zh(t,n,a),a};let Eo=class{constructor(){this.initialize()}initialize(){}getStatus(){return!0}async increment(){return 0}async addToQueue(){}async getQueueSize(){return 0}};Eo=Yh([Re()],Eo);class Qh{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 g=this.getWikiConfig(n);g==null?console.log("Could not find config for page",t):(console.log("Updating page ",o,a),await g.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 oh(t);a.initializeContainer(),this.container=a.container,console.log("Container status",this.container),this.container.bind("CristalApp").to(wo).inSingletonScope(),this.container.bind("QueueWorker").to(Eo).inSingletonScope(),this.cristal=this.container.get("CristalApp"),this.cristal.setContainer(this.container),console.log("Container status",this.container),new gh(a.container),new xh(a.container),new kh(a.container),new Wh(a.container),console.log("Loading storage components"),this.initialized=!0,console.log("Finished initialize")}}const Ms=new Qh;Ms.start(),onconnect=e=>{Oi(Ms,e.ports[0])},console.log("Worker code loaded")})();
47
+ //# sourceMappingURL=worker-Beh36sMF.js.map