@ember-nexus/app-core 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/esm/Type/Definition/PluginInit.js +2 -0
- package/dist/esm/Type/Definition/PluginInit.js.map +1 -0
- package/dist/esm/Type/Definition/index.js +1 -0
- package/dist/esm/Type/Definition/index.js.map +1 -1
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/{Init.js → init.js} +6 -11
- package/dist/esm/init.js.map +1 -0
- package/dist/esm/initEventListeners.js +9 -0
- package/dist/esm/initEventListeners.js.map +1 -0
- package/dist/esm/optimizeDynamicConfigurations.js +5 -0
- package/dist/esm/optimizeDynamicConfigurations.js.map +1 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/Type/Definition/PluginInit.d.ts +10 -0
- package/dist/types/Type/Definition/index.d.ts +1 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/init.d.ts +3 -0
- package/dist/types/initEventListeners.d.ts +3 -0
- package/dist/types/optimizeDynamicConfigurations.d.ts +3 -0
- package/package.json +1 -1
- package/dist/esm/Init.js.map +0 -1
- package/dist/types/Init.d.ts +0 -3
package/dist/browser/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e,t=/* @__PURE__ */(e=>(e.GetServiceResolver="ember-nexus.app-core.get-service-resolver",e))(t||{}),r=/* @__PURE__ */(e=>(e.NormalizedValueToRawValueEvent="ember-nexus.app-core.event.normalized-value-to-raw-value",e.RawValueToNormalizedValueEvent="ember-nexus.app-core.event.raw-value-to-normalized-value",e))(r||{}),s=/* @__PURE__ */(e=>(e.GET="GET",e.POST="POST",e.PATCH="PATCH",e.PUT="PUT",e.DELETE="DELETE",e.HEAD="HEAD",e.COPY="COPY",e.LOCK="LOCK",e.UNLOCK="UNLOCK",e.MKCOL="MKCOL",e.MOVE="MOVE",e.PROPFIND="PROPFIND",e.PROPPATCH="PROPPATCH",e))(s||{}),n=/* @__PURE__ */(e=>(e[e.Debug=2]="Debug",e[e.Info=3]="Info",e[e.Warn=4]="Warn",e[e.Error=5]="Error",e))(n||{}),i=/* @__PURE__ */(e=>(e.ClientSide="client",e.ServerSide="server",e.Logic="Logic",e))(i||{}),o=/* @__PURE__ */(e=>(e.emberNexusWebSDK="ember-nexus.web-sdk",e.logger="global.logger",e.action="global.action-registry",e.setting="global.setting-registry",e.icon="global.icon-registry",e.routeResolver="global.route-resolver",e.serviceFetchHelper="ember-nexus.app-core.service.fetch-helper-service",e.serviceApiConfiguration="ember-nexus.app-core.service.api-configuration-service",e.serviceElementParser="ember-nexus.app-core.service.element-parser-service",e.serviceCollectionParser="ember-nexus.app-core.service.collection-parser-service",e.serviceTokenParser="ember-nexus.app-core.service.token-parser-service",e.serviceApiWrapper="ember-nexus.app-core.service.api-wrapper",e.serviceEventDispatcher="ember-nexus.app-core.service.event-dispatcher",e.endpointElementDeleteElementEndpoint="ember-nexus.app-core.endpoint.element.delete-element-endpoint",e.endpointElementGetElementEndpoint="ember-nexus.app-core.endpoint.element.get-element-endpoint",e.endpointElementGetElementChildrenEndpoint="ember-nexus.app-core.endpoint.element.get-element-children-endpoint",e.endpointElementGetElementParentsEndpoint="ember-nexus.app-core.endpoint.element.get-element-parents-endpoint",e.endpointElementGetElementRelatedEndpoint="ember-nexus.app-core.endpoint.element.get-element-related-endpoint",e.endpointElementGetIndexEndpoint="ember-nexus.app-core.endpoint.element.get-index-endpoint",e.endpointElementPatchElementEndpoint="ember-nexus.app-core.endpoint.element.patch-element-endpoint",e.endpointElementPostElementEndpoint="ember-nexus.app-core.endpoint.element.post-element-endpoint",e.endpointElementPostIndexEndpoint="ember-nexus.app-core.endpoint.element.post-index-endpoint",e.endpointElementPutElementEndpoint="ember-nexus.app-core.endpoint.element.put-element-endpoint",e.endpointUserDeleteTokenEndpoint="ember-nexus.app-core.endpoint.user.delete-token-endpoint",e.endpointUserGetMeEndpoint="ember-nexus.app-core.endpoint.user.get-me-endpoint",e.endpointUserGetTokenEndpoint="ember-nexus.app-core.endpoint.user.get-token-endpoint",e.endpointUserPostChangePasswordEndpoint="ember-nexus.app-core.endpoint.user.post-change-password-endpoint",e.endpointUserPostRegisterEndpoint="ember-nexus.app-core.endpoint.user.post-register-endpoint",e.endpointUserPostTokenEndpoint="ember-nexus.app-core.endpoint.user.post-token-endpoint",e.cacheElement="ember-nexus.app-core.cache.element-cache",e.cacheElementChildren="ember-nexus.app-core.cache.element-children-cache",e.cacheElementParents="ember-nexus.app-core.cache.element-parents-cache",e.cacheElementRelated="ember-nexus.app-core.cache.element-related-cache",e.cacheIndex="ember-nexus.app-core.cache.index-cache",e))(o||{});const a=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,BrowserEventIdentifier:t,EventIdentifier:r,HttpRequestMethod:s,LogLevel:n,RequestProblemCategory:i,ServiceIdentifier:o},Symbol.toStringTag,{value:"Module"})),l={bubbles:!0,composed:!0,cancelable:!0},c=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,customEventDefaultInit:l},Symbol.toStringTag,{value:"Module"})),u=class e extends CustomEvent{constructor(){super(e.type,{...l,detail:{serviceResolver:null}})}getServiceResolver(){return this.detail.serviceResolver}setServiceResolver(e){this.detail.serviceResolver=e}};u.type=t.GetServiceResolver;let h=u;const d=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,GetServiceResolverEvent:h},Symbol.toStringTag,{value:"Module"})),f=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,exportPlaceholder:!1},Symbol.toStringTag,{value:"Module"}));class p extends Error{constructor(e){super(e)}}class m extends p{constructor(e){super(e),this.name="LogicError"}}class g extends p{constructor(e,t){super(e),this.name="NetworkError",this.cause=t}}class y extends p{constructor(e){super(e),this.name="ParseError"}}class v extends p{constructor(e){super(e),this._type=null,this._title=null,this._detail=null,this._status=null}getType(){return this._type}setType(e){return this._type=e,this}getTitle(){return this._title}setTitle(e){return this._title=e,this}getDetail(){return this._detail}setDetail(e){return this._detail=e,this}getStatus(){return this._status}setStatus(e){return this._status=e,this}}class w extends v{constructor(e){super(e),this.name="Response401UnauthorizedError",this.setStatus(401)}}class E extends v{constructor(e){super(e),this.name="Response403ForbiddenError",this.setStatus(403)}}class S extends v{constructor(e){super(e),this.name="Response404NotFoundError",this.setStatus(404)}}class b extends v{constructor(e){super(e),this.name="Response429TooManyRequestsError",this.setStatus(429)}}class T extends p{constructor(e){super(e),this.name="ValidationError"}}const O=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,EmberNexusError:p,LogicError:m,NetworkError:g,ParseError:y,Response401UnauthorizedError:w,Response403ForbiddenError:E,Response404NotFoundError:S,Response429TooManyRequestsError:b,ResponseError:v,ValidationError:T},Symbol.toStringTag,{value:"Module"}));class k{has(e){return this.cache.has(e)}get(e){return this.cache.get(e)}set(e,t){return this.cache.set(e,t),this}delete(e){return this.cache.delete(e),this}setFromDataEtag(e,t,r){const s=this.cache.get(e);s&&void 0===r&&(r=s.etag);const n={data:t,etag:r};return this.cache.set(e,n),this}setFromParsedResponse(e,t){const r=t.response.headers.get("ETag");if(null===r)throw new m("Expected parsedResponse to contain ETag header.");const s={data:t.data,etag:r};return this.cache.set(e,s),this}refresh(e){return this}}const x="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,C=/* @__PURE__ */new Set,_="object"==typeof process&&process?process:{},A=(e,t,r,s)=>{"function"==typeof _.emitWarning?_.emitWarning(e,t,r,s):console.error(`[${r}] ${t}: ${e}`)};let F=globalThis.AbortController,$=globalThis.AbortSignal;if(void 0===F){$=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},F=class{constructor(){t()}signal=new $;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(const t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e="1"!==_.env?.LRU_CACHE_IGNORE_AC_WARNING;const t=()=>{e&&(e=!1,A("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}const N=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),P=e=>N(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?L:null:null;class L extends Array{constructor(e){super(e),this.fill(0)}}class R{heap;length;static#e=!1;static create(e){const t=P(e);if(!t)return[];R.#e=!0;const r=new R(e,t);return R.#e=!1,r}constructor(e,t){if(!R.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class M{#t;#r;#s;#n;#i;#o;#a;#l;get perf(){return this.#l}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#c;#u;#h;#d;#f;#p;#m;#g;#y;#v;#w;#E;#S;#b;#T;#O;#k;#x;#C;static unsafeExposeInternals(e){return{starts:e.#S,ttls:e.#b,autopurgeTimers:e.#T,sizes:e.#E,keyMap:e.#h,keyList:e.#d,valList:e.#f,next:e.#p,prev:e.#m,get head(){return e.#g},get tail(){return e.#y},free:e.#v,isBackgroundFetch:t=>e.#_(t),backgroundFetch:(t,r,s,n)=>e.#A(t,r,s,n),moveToTail:t=>e.#F(t),indexes:t=>e.#$(t),rindexes:t=>e.#N(t),isStale:t=>e.#P(t)}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#u}get size(){return this.#c}get fetchMethod(){return this.#o}get memoMethod(){return this.#a}get dispose(){return this.#s}get onInsert(){return this.#n}get disposeAfter(){return this.#i}constructor(e){const{max:t=0,ttl:r,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:i,updateAgeOnHas:o,allowStale:a,dispose:l,onInsert:c,disposeAfter:u,noDisposeOnSet:h,noUpdateTTL:d,maxSize:f=0,maxEntrySize:p=0,sizeCalculation:m,fetchMethod:g,memoMethod:y,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:E,allowStaleOnFetchAbort:S,ignoreFetchAbort:b,perf:T}=e;if(void 0!==T&&"function"!=typeof T?.now)throw new TypeError("perf option must have a now() method if specified");if(this.#l=T??x,0!==t&&!N(t))throw new TypeError("max option must be a nonnegative integer");const O=t?P(t):Array;if(!O)throw new Error("invalid max value: "+t);if(this.#t=t,this.#r=f,this.maxEntrySize=p||this.#r,this.sizeCalculation=m,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==y&&"function"!=typeof y)throw new TypeError("memoMethod must be a function if defined");if(this.#a=y,void 0!==g&&"function"!=typeof g)throw new TypeError("fetchMethod must be a function if specified");if(this.#o=g,this.#k=!!g,this.#h=/* @__PURE__ */new Map,this.#d=new Array(t).fill(void 0),this.#f=new Array(t).fill(void 0),this.#p=new O(t),this.#m=new O(t),this.#g=0,this.#y=0,this.#v=R.create(t),this.#c=0,this.#u=0,"function"==typeof l&&(this.#s=l),"function"==typeof c&&(this.#n=c),"function"==typeof u?(this.#i=u,this.#w=[]):(this.#i=void 0,this.#w=void 0),this.#O=!!this.#s,this.#C=!!this.#n,this.#x=!!this.#i,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!E,this.allowStaleOnFetchAbort=!!S,this.ignoreFetchAbort=!!b,0!==this.maxEntrySize){if(0!==this.#r&&!N(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!N(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#L()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!i,this.updateAgeOnHas=!!o,this.ttlResolution=N(s)||0===s?s:1,this.ttlAutopurge=!!n,this.ttl=r||0,this.ttl){if(!N(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#R()}if(0===this.#t&&0===this.ttl&&0===this.#r)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){const e="LRU_CACHE_UNBOUNDED";if((e=>!C.has(e))(e)){C.add(e);A("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,M)}}}getRemainingTTL(e){return this.#h.has(e)?1/0:0}#R(){const e=new L(this.#t),t=new L(this.#t);this.#b=e,this.#S=t;const r=this.ttlAutopurge?new Array(this.#t):void 0;this.#T=r,this.#M=(s,n,i=this.#l.now())=>{if(t[s]=0!==n?i:0,e[s]=n,r?.[s]&&(clearTimeout(r[s]),r[s]=void 0),0!==n&&r){const e=setTimeout(()=>{this.#P(s)&&this.#D(this.#d[s],"expire")},n+1);e.unref&&e.unref(),r[s]=e}},this.#z=r=>{t[r]=0!==e[r]?this.#l.now():0},this.#I=(r,i)=>{if(e[i]){const o=e[i],a=t[i];if(!o||!a)return;r.ttl=o,r.start=a,r.now=s||n();const l=r.now-a;r.remainingTTL=o-l}};let s=0;const n=()=>{const e=this.#l.now();if(this.ttlResolution>0){s=e;const t=setTimeout(()=>s=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=r=>{const i=this.#h.get(r);if(void 0===i)return 0;const o=e[i],a=t[i];if(!o||!a)return 1/0;return o-((s||n())-a)},this.#P=r=>{const i=t[r],o=e[r];return!!o&&!!i&&(s||n())-i>o}}#z=()=>{};#I=()=>{};#M=()=>{};#P=()=>!1;#L(){const e=new L(this.#t);this.#u=0,this.#E=e,this.#H=t=>{this.#u-=e[t],e[t]=0},this.#j=(e,t,r,s)=>{if(this.#_(t))return 0;if(!N(r)){if(!s)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof s)throw new TypeError("sizeCalculation must be a function");if(r=s(t,e),!N(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.#V=(t,r,s)=>{if(e[t]=r,this.#r){const r=this.#r-e[t];for(;this.#u>r;)this.#U(!0)}this.#u+=e[t],s&&(s.entrySize=r,s.totalCalculatedSize=this.#u)}}#H=e=>{};#V=(e,t,r)=>{};#j=(e,t,r,s)=>{if(r||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#$({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#y;this.#W(t)&&(!e&&this.#P(t)||(yield t),t!==this.#g);)t=this.#m[t]}*#N({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#g;this.#W(t)&&(!e&&this.#P(t)||(yield t),t!==this.#y);)t=this.#p[t]}#W(e){return void 0!==e&&this.#h.get(this.#d[e])===e}*entries(){for(const e of this.#$())void 0===this.#f[e]||void 0===this.#d[e]||this.#_(this.#f[e])||(yield[this.#d[e],this.#f[e]])}*rentries(){for(const e of this.#N())void 0===this.#f[e]||void 0===this.#d[e]||this.#_(this.#f[e])||(yield[this.#d[e],this.#f[e]])}*keys(){for(const e of this.#$()){const t=this.#d[e];void 0===t||this.#_(this.#f[e])||(yield t)}}*rkeys(){for(const e of this.#N()){const t=this.#d[e];void 0===t||this.#_(this.#f[e])||(yield t)}}*values(){for(const e of this.#$()){void 0===this.#f[e]||this.#_(this.#f[e])||(yield this.#f[e])}}*rvalues(){for(const e of this.#N()){void 0===this.#f[e]||this.#_(this.#f[e])||(yield this.#f[e])}}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(const r of this.#$()){const s=this.#f[r],n=this.#_(s)?s.__staleWhileFetching:s;if(void 0!==n&&e(n,this.#d[r],this))return this.get(this.#d[r],t)}}forEach(e,t=this){for(const r of this.#$()){const s=this.#f[r],n=this.#_(s)?s.__staleWhileFetching:s;void 0!==n&&e.call(t,n,this.#d[r],this)}}rforEach(e,t=this){for(const r of this.#N()){const s=this.#f[r],n=this.#_(s)?s.__staleWhileFetching:s;void 0!==n&&e.call(t,n,this.#d[r],this)}}purgeStale(){let e=!1;for(const t of this.#N({allowStale:!0}))this.#P(t)&&(this.#D(this.#d[t],"expire"),e=!0);return e}info(e){const t=this.#h.get(e);if(void 0===t)return;const r=this.#f[t],s=this.#_(r)?r.__staleWhileFetching:r;if(void 0===s)return;const n={value:s};if(this.#b&&this.#S){const e=this.#b[t],r=this.#S[t];if(e&&r){const t=e-(this.#l.now()-r);n.ttl=t,n.start=Date.now()}}return this.#E&&(n.size=this.#E[t]),n}dump(){const e=[];for(const t of this.#$({allowStale:!0})){const r=this.#d[t],s=this.#f[t],n=this.#_(s)?s.__staleWhileFetching:s;if(void 0===n||void 0===r)continue;const i={value:n};if(this.#b&&this.#S){i.ttl=this.#b[t];const e=this.#l.now()-this.#S[t];i.start=Math.floor(Date.now()-e)}this.#E&&(i.size=this.#E[t]),e.unshift([r,i])}return e}load(e){this.clear();for(const[t,r]of e){if(r.start){const e=Date.now()-r.start;r.start=this.#l.now()-e}this.set(t,r.value,r)}}set(e,t,r={}){if(void 0===t)return this.delete(e),this;const{ttl:s=this.ttl,start:n,noDisposeOnSet:i=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:a}=r;let{noUpdateTTL:l=this.noUpdateTTL}=r;const c=this.#j(e,t,r.size||0,o);if(this.maxEntrySize&&c>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#D(e,"set"),this;let u=0===this.#c?void 0:this.#h.get(e);if(void 0===u)u=0===this.#c?this.#y:0!==this.#v.length?this.#v.pop():this.#c===this.#t?this.#U(!1):this.#c,this.#d[u]=e,this.#f[u]=t,this.#h.set(e,u),this.#p[this.#y]=u,this.#m[u]=this.#y,this.#y=u,this.#c++,this.#V(u,c,a),a&&(a.set="add"),l=!1,this.#C&&this.#n?.(t,e,"add");else{this.#F(u);const r=this.#f[u];if(t!==r){if(this.#k&&this.#_(r)){r.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:t}=r;void 0===t||i||(this.#O&&this.#s?.(t,e,"set"),this.#x&&this.#w?.push([t,e,"set"]))}else i||(this.#O&&this.#s?.(r,e,"set"),this.#x&&this.#w?.push([r,e,"set"]));if(this.#H(u),this.#V(u,c,a),this.#f[u]=t,a){a.set="replace";const e=r&&this.#_(r)?r.__staleWhileFetching:r;void 0!==e&&(a.oldValue=e)}}else a&&(a.set="update");this.#C&&this.onInsert?.(t,e,t===r?"update":"replace")}if(0===s||this.#b||this.#R(),this.#b&&(l||this.#M(u,s,n),a&&this.#I(a,u)),!i&&this.#x&&this.#w){const e=this.#w;let t;for(;t=e?.shift();)this.#i?.(...t)}return this}pop(){try{for(;this.#c;){const e=this.#f[this.#g];if(this.#U(!0),this.#_(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#x&&this.#w){const e=this.#w;let t;for(;t=e?.shift();)this.#i?.(...t)}}}#U(e){const t=this.#g,r=this.#d[t],s=this.#f[t];return this.#k&&this.#_(s)?s.__abortController.abort(new Error("evicted")):(this.#O||this.#x)&&(this.#O&&this.#s?.(s,r,"evict"),this.#x&&this.#w?.push([s,r,"evict"])),this.#H(t),this.#T?.[t]&&(clearTimeout(this.#T[t]),this.#T[t]=void 0),e&&(this.#d[t]=void 0,this.#f[t]=void 0,this.#v.push(t)),1===this.#c?(this.#g=this.#y=0,this.#v.length=0):this.#g=this.#p[t],this.#h.delete(r),this.#c--,t}has(e,t={}){const{updateAgeOnHas:r=this.updateAgeOnHas,status:s}=t,n=this.#h.get(e);if(void 0!==n){const e=this.#f[n];if(this.#_(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#P(n))return r&&this.#z(n),s&&(s.has="hit",this.#I(s,n)),!0;s&&(s.has="stale",this.#I(s,n))}else s&&(s.has="miss");return!1}peek(e,t={}){const{allowStale:r=this.allowStale}=t,s=this.#h.get(e);if(void 0===s||!r&&this.#P(s))return;const n=this.#f[s];return this.#_(n)?n.__staleWhileFetching:n}#A(e,t,r,s){const n=void 0===t?void 0:this.#f[t];if(this.#_(n))return n;const i=new F,{signal:o}=r;o?.addEventListener("abort",()=>i.abort(o.reason),{signal:i.signal});const a={signal:i.signal,options:r,context:s},l=(s,n=!1)=>{const{aborted:o}=i.signal,l=r.ignoreFetchAbort&&void 0!==s;if(r.status&&(o&&!n?(r.status.fetchAborted=!0,r.status.fetchError=i.signal.reason,l&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),o&&!l&&!n)return c(i.signal.reason);const h=u,d=this.#f[t];return(d===u||l&&n&&void 0===d)&&(void 0===s?void 0!==h.__staleWhileFetching?this.#f[t]=h.__staleWhileFetching:this.#D(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,s,a.options))),s},c=s=>{const{aborted:n}=i.signal,o=n&&r.allowStaleOnFetchAbort,a=o||r.allowStaleOnFetchRejection,l=a||r.noDeleteOnFetchRejection,c=u;if(this.#f[t]===u){!l||void 0===c.__staleWhileFetching?this.#D(e,"fetch"):o||(this.#f[t]=c.__staleWhileFetching)}if(a)return r.status&&void 0!==c.__staleWhileFetching&&(r.status.returnedStale=!0),c.__staleWhileFetching;if(c.__returned===c)throw s};r.status&&(r.status.fetchDispatched=!0);const u=new Promise((t,s)=>{const o=this.#o?.(e,n,a);o&&o instanceof Promise&&o.then(e=>t(void 0===e?void 0:e),s),i.signal.addEventListener("abort",()=>{r.ignoreFetchAbort&&!r.allowStaleOnFetchAbort||(t(void 0),r.allowStaleOnFetchAbort&&(t=e=>l(e,!0)))})}).then(l,e=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=e),c(e))),h=Object.assign(u,{__abortController:i,__staleWhileFetching:n,__returned:void 0});return void 0===t?(this.set(e,h,{...a.options,status:void 0}),t=this.#h.get(e)):this.#f[t]=h,h}#_(e){if(!this.#k)return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof F}async fetch(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:f=this.allowStaleOnFetchAbort,context:p,forceRefresh:m=!1,status:g,signal:y}=t;if(!this.#k)return g&&(g.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:g});const v={allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:i,noDisposeOnSet:o,size:a,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:f,ignoreFetchAbort:d,status:g,signal:y};let w=this.#h.get(e);if(void 0===w){g&&(g.fetch="miss");const t=this.#A(e,w,v,p);return t.__returned=t}{const t=this.#f[w];if(this.#_(t)){const e=r&&void 0!==t.__staleWhileFetching;return g&&(g.fetch="inflight",e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}const n=this.#P(w);if(!m&&!n)return g&&(g.fetch="hit"),this.#F(w),s&&this.#z(w),g&&this.#I(g,w),t;const i=this.#A(e,w,v,p),o=void 0!==i.__staleWhileFetching&&r;return g&&(g.fetch=n?"stale":"refresh",o&&n&&(g.returnedStale=!0)),o?i.__staleWhileFetching:i.__returned=i}}async forceFetch(e,t={}){const r=await this.fetch(e,t);if(void 0===r)throw new Error("fetch() returned undefined");return r}memo(e,t={}){const r=this.#a;if(!r)throw new Error("no memoMethod provided to constructor");const{context:s,forceRefresh:n,...i}=t,o=this.get(e,i);if(!n&&void 0!==o)return o;const a=r(e,o,{options:i,context:s});return this.set(e,a,i),a}get(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:i}=t,o=this.#h.get(e);if(void 0!==o){const t=this.#f[o],a=this.#_(t);return i&&this.#I(i,o),this.#P(o)?(i&&(i.get="stale"),a?(i&&r&&void 0!==t.__staleWhileFetching&&(i.returnedStale=!0),r?t.__staleWhileFetching:void 0):(n||this.#D(e,"expire"),i&&r&&(i.returnedStale=!0),r?t:void 0)):(i&&(i.get="hit"),a?t.__staleWhileFetching:(this.#F(o),s&&this.#z(o),t))}i&&(i.get="miss")}#B(e,t){this.#m[t]=e,this.#p[e]=t}#F(e){e!==this.#y&&(e===this.#g?this.#g=this.#p[e]:this.#B(this.#m[e],this.#p[e]),this.#B(this.#y,e),this.#y=e)}delete(e){return this.#D(e,"delete")}#D(e,t){let r=!1;if(0!==this.#c){const s=this.#h.get(e);if(void 0!==s)if(this.#T?.[s]&&(clearTimeout(this.#T?.[s]),this.#T[s]=void 0),r=!0,1===this.#c)this.#Z(t);else{this.#H(s);const r=this.#f[s];if(this.#_(r)?r.__abortController.abort(new Error("deleted")):(this.#O||this.#x)&&(this.#O&&this.#s?.(r,e,t),this.#x&&this.#w?.push([r,e,t])),this.#h.delete(e),this.#d[s]=void 0,this.#f[s]=void 0,s===this.#y)this.#y=this.#m[s];else if(s===this.#g)this.#g=this.#p[s];else{const e=this.#m[s];this.#p[e]=this.#p[s];const t=this.#p[s];this.#m[t]=this.#m[s]}this.#c--,this.#v.push(s)}}if(this.#x&&this.#w?.length){const e=this.#w;let t;for(;t=e?.shift();)this.#i?.(...t)}return r}clear(){return this.#Z("delete")}#Z(e){for(const t of this.#N({allowStale:!0})){const r=this.#f[t];if(this.#_(r))r.__abortController.abort(new Error("deleted"));else{const s=this.#d[t];this.#O&&this.#s?.(r,s,e),this.#x&&this.#w?.push([r,s,e])}}if(this.#h.clear(),this.#f.fill(void 0),this.#d.fill(void 0),this.#b&&this.#S){this.#b.fill(0),this.#S.fill(0);for(const e of this.#T??[])void 0!==e&&clearTimeout(e);this.#T?.fill(void 0)}if(this.#E&&this.#E.fill(0),this.#g=0,this.#y=0,this.#v.length=0,this.#u=0,this.#c=0,this.#x&&this.#w){const e=this.#w;let t;for(;t=e?.shift();)this.#i?.(...t)}}}const D=class e extends k{constructor(){super(),this.cache=new M({max:500})}static constructFromServiceResolver(){return new e}static createCacheKey(e){return`${e}`}setFromCollection(t){for(let r=0;r<t.nodes.length;r++)this.setFromDataEtag(e.createCacheKey(t.nodes[r].id),t.nodes[r]);for(let r=0;r<t.relations.length;r++)this.setFromDataEtag(e.createCacheKey(t.relations[r].id),t.relations[r]);return this}};D.identifier=o.cacheElement;let z=D;const I=class e extends k{constructor(){super(),this.cache=new M({max:50})}static constructFromServiceResolver(){return new e}static createCacheKey(e,t,r){return`${e}-${t}-${r}`}};I.identifier=o.cacheElementChildren;let H=I;const j=class e extends k{constructor(){super(),this.cache=new M({max:50})}static constructFromServiceResolver(){return new e}static createCacheKey(e,t,r){return`${e}-${t}-${r}`}};j.identifier=o.cacheElementParents;let V=j;const U=class e extends k{constructor(){super(),this.cache=new M({max:50})}static constructFromServiceResolver(){return new e}static createCacheKey(e,t,r){return`${e}-${t}-${r}`}};U.identifier=o.cacheElementRelated;let W=U;const B=class e extends k{constructor(){super(),this.cache=new M({max:50})}static constructFromServiceResolver(){return new e}static createCacheKey(e,t){return`${e}-${t}`}};B.identifier=o.cacheIndex;let Z=B;const q=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,Cache:k,ElementCache:z,ElementChildrenCache:H,ElementParentsCache:V,ElementRelatedCache:W,IndexCache:Z},Symbol.toStringTag,{value:"Module"})),G=globalThis,J=G.ShadowRoot&&(void 0===G.ShadyCSS||G.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Y=/* @__PURE__ */Symbol(),K=/* @__PURE__ */new WeakMap;let Q=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==Y)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(J&&void 0===e){const r=void 0!==t&&1===t.length;r&&(e=K.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&K.set(t,e))}return e}toString(){return this.cssText}};const X=J?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return(e=>new Q("string"==typeof e?e:e+"",void 0,Y))(t)})(e):e,{is:ee,defineProperty:te,getOwnPropertyDescriptor:re,getOwnPropertyNames:se,getOwnPropertySymbols:ne,getPrototypeOf:ie}=Object,oe=globalThis,ae=oe.trustedTypes,le=ae?ae.emptyScript:"",ce=oe.reactiveElementPolyfillSupport,ue=(e,t)=>e,he={toAttribute(e,t){switch(t){case Boolean:e=e?le:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=null!==e;break;case Number:r=null===e?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch(s){r=null}}return r}},de=(e,t)=>!ee(e,t),fe={attribute:!0,type:String,converter:he,reflect:!1,useDefault:!1,hasChanged:de};Symbol.metadata??=/* @__PURE__ */Symbol("metadata"),oe.litPropertyMetadata??=/* @__PURE__ */new WeakMap;let pe=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=fe){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const r=/* @__PURE__ */Symbol(),s=this.getPropertyDescriptor(e,r,t);void 0!==s&&te(this.prototype,e,s)}}static getPropertyDescriptor(e,t,r){const{get:s,set:n}=re(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:s,set(t){const i=s?.call(this);n?.call(this,t),this.requestUpdate(e,i,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??fe}static _$Ei(){if(this.hasOwnProperty(ue("elementProperties")))return;const e=ie(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ue("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ue("properties"))){const e=this.properties,t=[...se(e),...ne(e)];for(const r of t)this.createProperty(r,e[r])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,r]of t)this.elementProperties.set(e,r)}this._$Eh=/* @__PURE__ */new Map;for(const[t,r]of this.elementProperties){const e=this._$Eu(t,r);void 0!==e&&this._$Eh.set(e,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const e of r)t.unshift(X(e))}else void 0!==e&&t.push(X(e));return t}static _$Eu(e,t){const r=t.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=/* @__PURE__ */new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=/* @__PURE__ */new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=/* @__PURE__ */new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(J)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const r of t){const t=document.createElement("style"),s=G.litNonce;void 0!==s&&t.setAttribute("nonce",s),t.textContent=r.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){const r=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,r);if(void 0!==s&&!0===r.reflect){const n=(void 0!==r.converter?.toAttribute?r.converter:he).toAttribute(t,r.type);this._$Em=e,null==n?this.removeAttribute(s):this.setAttribute(s,n),this._$Em=null}}_$AK(e,t){const r=this.constructor,s=r._$Eh.get(e);if(void 0!==s&&this._$Em!==s){const e=r.getPropertyOptions(s),n="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:he;this._$Em=s;const i=n.fromAttribute(t,e.type);this[s]=i??this._$Ej?.get(s)??i,this._$Em=null}}requestUpdate(e,t,r,s=!1,n){if(void 0!==e){const i=this.constructor;if(!1===s&&(n=this[e]),r??=i.getPropertyOptions(e),!((r.hasChanged??de)(n,t)||r.useDefault&&r.reflect&&n===this._$Ej?.get(e)&&!this.hasAttribute(i._$Eu(e,r))))return;this.C(e,t,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:s,wrapped:n},i){r&&!(this._$Ej??=/* @__PURE__ */new Map).has(e)&&(this._$Ej.set(e,i??t??this[e]),!0!==n||void 0!==i)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),!0===s&&this._$Em!==e&&(this._$Eq??=/* @__PURE__ */new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,r]of e){const{wrapped:e}=r,s=this[t];!0!==e||this._$AL.has(t)||void 0===s||this.C(t,void 0,r,s)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(r){throw e=!1,this._$EM(),r}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=/* @__PURE__ */new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};pe.elementStyles=[],pe.shadowRootOptions={mode:"open"},pe[ue("elementProperties")]=/* @__PURE__ */new Map,pe[ue("finalized")]=/* @__PURE__ */new Map,ce?.({ReactiveElement:pe}),(oe.reactiveElementVersions??=[]).push("2.1.2");const me=globalThis,ge=e=>e,ye=me.trustedTypes,ve=ye?ye.createPolicy("lit-html",{createHTML:e=>e}):void 0,we="$lit$",Ee=`lit$${Math.random().toFixed(9).slice(2)}$`,Se="?"+Ee,be=`<${Se}>`,Te=document,Oe=()=>Te.createComment(""),ke=e=>null===e||"object"!=typeof e&&"function"!=typeof e,xe=Array.isArray,Ce="[ \t\n\f\r]",_e=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ae=/-->/g,Fe=/>/g,$e=RegExp(`>|${Ce}(?:([^\\s"'>=/]+)(${Ce}*=${Ce}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),Ne=/'/g,Pe=/"/g,Le=/^(?:script|style|textarea|title)$/i,Re=(He=1,(e,...t)=>({_$litType$:He,strings:e,values:t})),Me=/* @__PURE__ */Symbol.for("lit-noChange"),De=/* @__PURE__ */Symbol.for("lit-nothing"),ze=/* @__PURE__ */new WeakMap,Ie=Te.createTreeWalker(Te,129);var He;function je(e,t){if(!xe(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==ve?ve.createHTML(t):t}class Ve{constructor({strings:e,_$litType$:t},r){let s;this.parts=[];let n=0,i=0;const o=e.length-1,a=this.parts,[l,c]=((e,t)=>{const r=e.length-1,s=[];let n,i=2===t?"<svg>":3===t?"<math>":"",o=_e;for(let a=0;a<r;a++){const t=e[a];let r,l,c=-1,u=0;for(;u<t.length&&(o.lastIndex=u,l=o.exec(t),null!==l);)u=o.lastIndex,o===_e?"!--"===l[1]?o=Ae:void 0!==l[1]?o=Fe:void 0!==l[2]?(Le.test(l[2])&&(n=RegExp("</"+l[2],"g")),o=$e):void 0!==l[3]&&(o=$e):o===$e?">"===l[0]?(o=n??_e,c=-1):void 0===l[1]?c=-2:(c=o.lastIndex-l[2].length,r=l[1],o=void 0===l[3]?$e:'"'===l[3]?Pe:Ne):o===Pe||o===Ne?o=$e:o===Ae||o===Fe?o=_e:(o=$e,n=void 0);const h=o===$e&&e[a+1].startsWith("/>")?" ":"";i+=o===_e?t+be:c>=0?(s.push(r),t.slice(0,c)+we+t.slice(c)+Ee+h):t+Ee+(-2===c?a:h)}return[je(e,i+(e[r]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),s]})(e,t);if(this.el=Ve.createElement(l,r),Ie.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(s=Ie.nextNode())&&a.length<o;){if(1===s.nodeType){if(s.hasAttributes())for(const e of s.getAttributeNames())if(e.endsWith(we)){const t=c[i++],r=s.getAttribute(e).split(Ee),o=/([.?@])?(.*)/.exec(t);a.push({type:1,index:n,name:o[2],strings:r,ctor:"."===o[1]?qe:"?"===o[1]?Ge:"@"===o[1]?Je:Ze}),s.removeAttribute(e)}else e.startsWith(Ee)&&(a.push({type:6,index:n}),s.removeAttribute(e));if(Le.test(s.tagName)){const e=s.textContent.split(Ee),t=e.length-1;if(t>0){s.textContent=ye?ye.emptyScript:"";for(let r=0;r<t;r++)s.append(e[r],Oe()),Ie.nextNode(),a.push({type:2,index:++n});s.append(e[t],Oe())}}}else if(8===s.nodeType)if(s.data===Se)a.push({type:2,index:n});else{let e=-1;for(;-1!==(e=s.data.indexOf(Ee,e+1));)a.push({type:7,index:n}),e+=Ee.length-1}n++}}static createElement(e,t){const r=Te.createElement("template");return r.innerHTML=e,r}}function Ue(e,t,r=e,s){if(t===Me)return t;let n=void 0!==s?r._$Co?.[s]:r._$Cl;const i=ke(t)?void 0:t._$litDirective$;return n?.constructor!==i&&(n?._$AO?.(!1),void 0===i?n=void 0:(n=new i(e),n._$AT(e,r,s)),void 0!==s?(r._$Co??=[])[s]=n:r._$Cl=n),void 0!==n&&(t=Ue(e,n._$AS(e,t.values),n,s)),t}class We{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:r}=this._$AD,s=(e?.creationScope??Te).importNode(t,!0);Ie.currentNode=s;let n=Ie.nextNode(),i=0,o=0,a=r[0];for(;void 0!==a;){if(i===a.index){let t;2===a.type?t=new Be(n,n.nextSibling,this,e):1===a.type?t=new a.ctor(n,a.name,a.strings,this,e):6===a.type&&(t=new Ye(n,this,e)),this._$AV.push(t),a=r[++o]}i!==a?.index&&(n=Ie.nextNode(),i++)}return Ie.currentNode=Te,s}p(e){let t=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}}class Be{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,s){this.type=2,this._$AH=De,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Ue(this,e,t),ke(e)?e===De||null==e||""===e?(this._$AH!==De&&this._$AR(),this._$AH=De):e!==this._$AH&&e!==Me&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>xe(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==De&&ke(this._$AH)?this._$AA.nextSibling.data=e:this.T(Te.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:r}=e,s="number"==typeof r?this._$AC(e):(void 0===r.el&&(r.el=Ve.createElement(je(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===s)this._$AH.p(t);else{const e=new We(s,this),r=e.u(this.options);e.p(t),this.T(r),this._$AH=e}}_$AC(e){let t=ze.get(e.strings);return void 0===t&&ze.set(e.strings,t=new Ve(e)),t}k(e){xe(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,s=0;for(const n of e)s===t.length?t.push(r=new Be(this.O(Oe()),this.O(Oe()),this,this.options)):r=t[s],r._$AI(n),s++;s<t.length&&(this._$AR(r&&r._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=ge(e).nextSibling;ge(e).remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class Ze{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,s,n){this.type=1,this._$AH=De,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=n,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=De}_$AI(e,t=this,r,s){const n=this.strings;let i=!1;if(void 0===n)e=Ue(this,e,t,0),i=!ke(e)||e!==this._$AH&&e!==Me,i&&(this._$AH=e);else{const s=e;let o,a;for(e=n[0],o=0;o<n.length-1;o++)a=Ue(this,s[r+o],t,o),a===Me&&(a=this._$AH[o]),i||=!ke(a)||a!==this._$AH[o],a===De?e=De:e!==De&&(e+=(a??"")+n[o+1]),this._$AH[o]=a}i&&!s&&this.j(e)}j(e){e===De?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class qe extends Ze{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===De?void 0:e}}class Ge extends Ze{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==De)}}class Je extends Ze{constructor(e,t,r,s,n){super(e,t,r,s,n),this.type=5}_$AI(e,t=this){if((e=Ue(this,e,t,0)??De)===Me)return;const r=this._$AH,s=e===De&&r!==De||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,n=e!==De&&(r===De||s);s&&this.element.removeEventListener(this.name,this,r),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class Ye{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){Ue(this,e)}}const Ke=me.litHtmlPolyfillSupport;Ke?.(Ve,Be),(me.litHtmlVersions??=[]).push("3.3.2");const Qe=globalThis;class Xe extends pe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,r)=>{const s=r?.renderBefore??t;let n=s._$litPart$;if(void 0===n){const e=r?.renderBefore??null;s._$litPart$=n=new Be(t.insertBefore(Oe(),e),e,void 0,r??{})}return n._$AI(e),n})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Me}}Xe._$litElement$=!0,Xe.finalized=!0,Qe.litElementHydrateSupport?.({LitElement:Xe});const et=Qe.litElementPolyfillSupport;et?.({LitElement:Xe}),(Qe.litElementVersions??=[]).push("4.2.2");const tt=e=>(t,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},rt=/* @__PURE__ */Symbol.for(""),st=e=>{if(e?.r===rt)return e?._$litStatic$},nt=/* @__PURE__ */new Map,it=(e=>(t,...r)=>{const s=r.length;let n,i;const o=[],a=[];let l,c=0,u=!1;for(;c<s;){for(l=t[c];c<s&&void 0!==(i=r[c],n=st(i));)l+=n+t[++c],u=!0;c!==s&&a.push(i),o.push(l),c++}if(c===s&&o.push(t[s]),u){const e=o.join("$$lit$$");void 0===(t=nt.get(e))&&(o.raw=o,nt.set(e,t=o)),r=a}return e(t,...r)})(Re);var ot=Object.getOwnPropertyDescriptor;let at=class extends Xe{render(){return it`<div>Error 404: Route could not be resolved.</div>`}};at=((e,t,r,s)=>{for(var n,i=s>1?void 0:s?ot(t,r):t,o=e.length-1;o>=0;o--)(n=e[o])&&(i=n(i)||i);return i})([tt("ember-nexus-app-core-page-error-404")],at);const lt=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,get PageError404(){return at}},Symbol.toStringTag,{value:"Module"})),ct=class e{constructor(e){this.logger=e,this.token=null,this.apiHost="",this.elementCacheMaxEntries=100,this.collectionCacheMaxEntries=50,this.collectionPageSize=25}static constructFromServiceResolver(t){const r=t.getServiceOrFail(o.logger);return new e(r)}hasToken(){return null!==this.token}getToken(){return this.token}setToken(e){return this.token=e,this}getApiHost(){return this.apiHost}setApiHost(e){return e.endsWith("/")&&(this.logger.warn("Removed trailing slash from API host configuration due to internal requirement. Please check if trailing slash can be directly removed."),e=e.replace(/\/+$/,"")),this.apiHost=e,this}getElementCacheMaxEntries(){return this.elementCacheMaxEntries}setElementCacheMaxEntries(e){return this.elementCacheMaxEntries=e,this}getCollectionCacheMaxEntries(){return this.collectionCacheMaxEntries}setCollectionCacheMaxEntries(e){return this.collectionCacheMaxEntries=e,this}getCollectionPageSize(){return this.collectionPageSize}setCollectionPageSize(e){return this.collectionPageSize=e,this}};ct.identifier=o.serviceApiConfiguration;let ut=ct;const ht=class e{constructor(e,t,r,s,n,i,o,a,l,c,u,h,d,f,p,m,g,y,v,w,E){this.getElementEndpoint=e,this.getElementChildrenEndpoint=t,this.getElementParentsEndpoint=r,this.getElementRelatedEndpoint=s,this.getIndexEndpoint=n,this.postIndexEndpoint=i,this.postElementEndpoint=o,this.putElementEndpoint=a,this.patchElementEndpoint=l,this.deleteElementEndpoint=c,this.postRegisterEndpoint=u,this.postChangePasswordEndpoint=h,this.getMeEndpoint=d,this.postTokenEndpoint=f,this.getTokenEndpoint=p,this.deleteTokenEndpoint=m,this.elementCache=g,this.elementChildrenCache=y,this.elementParentsCache=v,this.elementRelatedCache=w,this.indexCache=E}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.endpointElementGetElementEndpoint),t.getServiceOrFail(o.endpointElementGetElementChildrenEndpoint),t.getServiceOrFail(o.endpointElementGetElementParentsEndpoint),t.getServiceOrFail(o.endpointElementGetElementRelatedEndpoint),t.getServiceOrFail(o.endpointElementGetIndexEndpoint),t.getServiceOrFail(o.endpointElementPostIndexEndpoint),t.getServiceOrFail(o.endpointElementPostElementEndpoint),t.getServiceOrFail(o.endpointElementPutElementEndpoint),t.getServiceOrFail(o.endpointElementPatchElementEndpoint),t.getServiceOrFail(o.endpointElementDeleteElementEndpoint),t.getServiceOrFail(o.endpointUserPostRegisterEndpoint),t.getServiceOrFail(o.endpointUserPostChangePasswordEndpoint),t.getServiceOrFail(o.endpointUserGetMeEndpoint),t.getServiceOrFail(o.endpointUserPostTokenEndpoint),t.getServiceOrFail(o.endpointUserGetTokenEndpoint),t.getServiceOrFail(o.endpointUserDeleteTokenEndpoint),t.getServiceOrFail(o.cacheElement),t.getServiceOrFail(o.cacheElementChildren),t.getServiceOrFail(o.cacheElementParents),t.getServiceOrFail(o.cacheElementRelated),t.getServiceOrFail(o.cacheIndex))}async getElement(e,{forceLoad:t=!1}={}){const r=z.createCacheKey(e),s=this.elementCache.get(r);if(s&&!t)return s.data;if(s){const t=await this.getElementEndpoint.getElement(e,s.etag);return"data"in t?(this.elementCache.setFromParsedResponse(r,t),t.data):(this.elementCache.refresh(r),s.data)}const n=await this.getElementEndpoint.getElement(e);return this.elementCache.setFromParsedResponse(r,n),n.data}async getElementChildren(e,{page:t=1,pageSize:r=25,forceLoad:s=!1}={}){const n=H.createCacheKey(e,t,r),i=this.elementChildrenCache.get(n);if(i&&!s)return i.data;if(i){const s=await this.getElementChildrenEndpoint.getElementChildren(e,t,r,i.etag);return"data"in s?(this.elementChildrenCache.setFromParsedResponse(n,s),this.elementCache.setFromCollection(s.data),s.data):(this.elementChildrenCache.refresh(n),i.data)}const o=await this.getElementChildrenEndpoint.getElementChildren(e,t,r);return this.elementChildrenCache.setFromParsedResponse(n,o),this.elementCache.setFromCollection(o.data),o.data}async getElementParents(e,{page:t=1,pageSize:r=25,forceLoad:s=!1}={}){const n=V.createCacheKey(e,t,r),i=this.elementParentsCache.get(n);if(i&&!s)return i.data;if(i){const s=await this.getElementParentsEndpoint.getElementParents(e,t,r,i.etag);return"data"in s?(this.elementParentsCache.setFromParsedResponse(n,s),this.elementCache.setFromCollection(s.data),s.data):(this.elementParentsCache.refresh(n),i.data)}const o=await this.getElementParentsEndpoint.getElementParents(e,t,r);return this.elementParentsCache.setFromParsedResponse(n,o),this.elementCache.setFromCollection(o.data),o.data}async getElementRelated(e,{page:t=1,pageSize:r=25,forceLoad:s=!1}={}){const n=W.createCacheKey(e,t,r),i=this.elementRelatedCache.get(n);if(i&&!s)return i.data;if(i){const s=await this.getElementRelatedEndpoint.getElementRelated(e,t,r,i.etag);return"data"in s?(this.elementRelatedCache.setFromParsedResponse(n,s),this.elementCache.setFromCollection(s.data),s.data):(this.elementRelatedCache.refresh(n),i.data)}const o=await this.getElementRelatedEndpoint.getElementRelated(e,t,r);return this.elementRelatedCache.setFromParsedResponse(n,o),this.elementCache.setFromCollection(o.data),o.data}async getIndex({page:e=1,pageSize:t=25,forceLoad:r=!1}={}){const s=Z.createCacheKey(e,t),n=this.indexCache.get(s);if(n&&!r)return n.data;if(n){const r=await this.getIndexEndpoint.getIndex(e,t,n.etag);return"data"in r?(this.indexCache.setFromParsedResponse(s,r),this.elementCache.setFromCollection(r.data),r.data):(this.indexCache.refresh(s),n.data)}const i=await this.getIndexEndpoint.getIndex(e,t);return this.indexCache.setFromParsedResponse(s,i),this.elementCache.setFromCollection(i.data),i.data}async postIndex(e){return(await this.postIndexEndpoint.postIndex(e)).data}async postElement(e,t){return(await this.postElementEndpoint.postElement(e,t)).data}async putElement(e,t){await this.putElementEndpoint.putElement(e,t),this.elementCache.delete(z.createCacheKey(e))}async patchElement(e,t){await this.patchElementEndpoint.patchElement(e,t),this.elementCache.delete(z.createCacheKey(e))}async deleteElement(e){await this.deleteElementEndpoint.deleteElement(e),this.elementCache.delete(z.createCacheKey(e))}async postRegister(e,t,r={}){return(await this.postRegisterEndpoint.postRegister(e,t,r)).data}async postChangePassword(e,t,r){await this.postChangePasswordEndpoint.postChangePassword(e,t,r)}async getMe(){const e=(await this.getMeEndpoint.getMe()).data;return this.elementCache.setFromDataEtag(z.createCacheKey(e.id),e),e}async postToken(e,t,r={}){return(await this.postTokenEndpoint.postToken(e,t,r)).data}async getToken(){const e=(await this.getTokenEndpoint.getToken()).data;return this.elementCache.setFromDataEtag(z.createCacheKey(e.id),e),e}async deleteToken(){await this.deleteTokenEndpoint.deleteToken()}};ht.identifier=o.serviceApiWrapper;let dt=ht;const ft=class e{constructor(e){this.elementParser=e}static constructFromServiceResolver(t){const r=t.getServiceOrFail(o.serviceElementParser);return new e(r)}async deserializeCollection(e){if(!("id"in e))throw new Error("Raw collection must contain property 'id' in order to be parsed to a collection.");const t=String(e.id);if(!("totalNodes"in e))throw new Error("Raw collection must contain property 'totalNodes' in order to be parsed to a collection.");const r=Number(e.totalNodes);if(!("links"in e))throw new Error("Raw collection must contain property 'links' in order to be parsed to a collection.");if("object"!=typeof e.links||null===e.links)throw new Error("Links property in raw collection must be of type object.");const s=e.links;if(!("first"in s))throw new Error("Raw collection must contain property 'links.first' in order to be parsed to a collection.");const n=String(s.first);if(!("previous"in s))throw new Error("Raw collection must contain property 'links.previous' in order to be parsed to a collection.");const i=null===s.previous?null:String(s.previous);if(!("next"in s))throw new Error("Raw collection must contain property 'links.next' in order to be parsed to a collection.");const o=null===s.next?null:String(s.next);if(!("last"in s))throw new Error("Raw collection must contain property 'links.last' in order to be parsed to a collection.");const a=String(s.last);if(!("nodes"in e))throw new Error("Raw collection must contain property 'nodes' in order to be parsed to a collection.");if(!Array.isArray(e.nodes))throw new Error("Nodes property in raw collection must be of type array.");const l=[];for(const u of e.nodes)l.push(await this.elementParser.deserializeElement(u));if(!("relations"in e))throw new Error("Raw collection must contain property 'relations' in order to be parsed to a collection.");if(!Array.isArray(e.relations))throw new Error("Relations property in raw collection must be of type array.");const c=[];for(const u of e.relations)c.push(await this.elementParser.deserializeElement(u));return{id:t,totalNodes:r,links:{first:n,previous:i,next:o,last:a},nodes:l,relations:c}}};ft.identifier=o.serviceCollectionParser;let pt=ft;class mt{constructor(e){this.stopped=!1,this.identifier=e}getIdentifier(){return this.identifier}isPropagationStopped(){return this.stopped}stopPropagation(){return this.stopped=!0,this}}const gt=/^([a-z][a-z0-9-]*)(\.([a-z][a-z0-9-]*))*$/;const yt=/^(?:([a-z][a-z0-9-]*)(\.([a-z][a-z0-9-]*))*|\*|([a-z][a-z0-9-]*)(\.([a-z][a-z0-9-]*))*(\.\*))$/;function vt(e){if(!yt.test(e))throw new y("Passed variable is not a valid event listener target.");return e}function wt(e){const t=e.split("."),r=[];r.push(vt(e));for(let s=t.length-1;s>0;s--)r.push(vt(t.slice(0,s).join(".")+".*"));return r.push(vt("*")),r}const Et=/^([a-z]+)(-*[a-z0-9]+)*$/;class St{constructor(){this.entries=/* @__PURE__ */new Map}clearEntries(){return this.entries.clear(),this}deleteEntry(e){return this.entries.delete(e),this}getEntry(e){if(!this.hasEntry(e))return null;const t=this.entries.get(e);return t[t.length-1].entry}hasEntry(e){return this.entries.has(e)}setEntry(e,t,r){let s;void 0===r&&(r=0),this.entries.has(e)?s=this.entries.get(e):(s=[],this.entries.set(e,s));let n=0,i=s.length-1,o=-1;for(;n<=i;){const e=Math.floor((n+i)/2);s[e].priority>=r?(o=e,i=e-1):n=e+1}const a=-1===o?n:o;return s.splice(a,0,{priority:r,entry:t}),this}getAllEntriesForKey(e){return this.entries.has(e)?this.entries.get(e).map(e=>e.entry):null}}class bt{constructor(){this.entries=/* @__PURE__ */new Map}clearEntries(){return this.entries.clear(),this}deleteEntry(e){return this.entries.delete(e),this}getEntry(e){return this.hasEntry(e)?this.entries.get(e):null}hasEntry(e){return this.entries.has(e)}setEntry(e,t){return this.entries.set(e,t),this}}const Tt=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Ot=/^([a-z]+)(-*[a-z0-9]+)*$/;class kt{constructor(){this.childRouteNodes={},this.routeHandler=[]}getChildRouteNode(e){return e in this.childRouteNodes||(this.childRouteNodes[e]=new kt),this.childRouteNodes[e]}hasChildRouteNode(e){return e in this.childRouteNodes}addRouteHandler(e){return this.routeHandler.includes(e)||this.routeHandler.push(e),this}getRouteHandlers(){return this.routeHandler}}const xt=/^([a-z][a-z0-9-]*)(\.([a-z][a-z0-9-]*))*$/;const Ct=/^secret-token:.+$/;function _t(e){if(!Ct.test(e))throw new Error("Passed variable is not a valid token.");return e}const At=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;function Ft(e){if(!At.test(e))throw new y("Passed variable is not a valid UUID v4.");return e}const $t=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,Event:mt,PriorityRegistry:St,Registry:bt,Response:Tt,RouteNode:kt,createUniqueUserIdentifierFromString:function(e){return e},eventIdentifierRegex:gt,eventListenerTargetRegex:yt,getEventListenerTargetsFromEventIdentifier:wt,pluginIdentifierRegex:Et,routeIdentifierRegex:Ot,serviceIdentifierRegex:xt,tokenRegex:Ct,uuidv4Regex:At,validateEventIdentifierFromString:function(e){if(!gt.test(e))throw new y("Passed variable is not a valid event identifier.");return e},validateEventListenerTargetFromString:vt,validatePluginIdentifierFromString:function(e){if(!Et.test(e))throw new y("Passed variable is not a valid plugin identifier.");return e},validateRouteIdentifierFromString:function(e){if(!Ot.test(e))throw new y("Passed variable is not a valid route identifier.");return e},validateServiceIdentifierFromString:function(e){if(!xt.test(e))throw new y("Passed variable is not a valid service identifier.");return e},validateTokenFromString:_t,validateUuidFromString:Ft},Symbol.toStringTag,{value:"Module"})),Nt=class e extends mt{constructor(t){super(e.identifier),this.normalizedValue=t,this.rawValue=null}getNormalizedValue(){return this.normalizedValue}getRawValue(){return this.rawValue}setRawValue(e){return this.isPropagationStopped()||(this.rawValue=e),this}};Nt.identifier=r.NormalizedValueToRawValueEvent;let Pt=Nt;const Lt=class e extends mt{constructor(t){super(e.identifier),this.rawValue=t,this.normalizedValue=null}getRawValue(){return this.rawValue}getNormalizedValue(){return this.normalizedValue}setNormalizedValue(e){return this.isPropagationStopped()||(this.normalizedValue=e),this}};Lt.identifier=r.RawValueToNormalizedValueEvent;let Rt=Lt;const Mt=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,NormalizedValueToRawValueEvent:Pt,RawValueToNormalizedValueEvent:Rt},Symbol.toStringTag,{value:"Module"})),Dt=class e{constructor(e){this.eventDispatcher=e}static constructFromServiceResolver(t){const r=t.getServiceOrFail(o.serviceEventDispatcher);return new e(r)}async deserializeElement(e){if(!("id"in e))throw new Error("Raw element must contain property 'id' in order to be parsed to a node or relation.");const t=Ft(String(e.id));if(!("type"in e))throw new Error("Raw element must contain property 'type' in order to be parsed to a node or relation.");const r=String(e.type);if(!("data"in e))throw new Error("Raw element must contain property 'data' in order to be parsed to a node or relation.");const s=e.data;for(const n in s){const e=new Rt(s[n]);if(await this.eventDispatcher.dispatchEvent(e),!e.isPropagationStopped())throw new Error(`Unable to deserialize property "${n}".`);s[n]=e.getNormalizedValue()}if("start"in e&&"end"in e){return{id:t,start:Ft(String(e.start)),end:Ft(String(e.end)),type:r,data:s}}return{id:t,type:r,data:s}}};Dt.identifier=o.serviceElementParser;let zt=Dt;const It=class e{constructor(e){this.logger=e,this.isSilent=!0,this.eventListenerTargets=/* @__PURE__ */new Map}static constructFromServiceResolver(t){const r=t.getServiceOrFail(o.logger);return new e(r)}setSilent(e){return this.isSilent=e,this}async dispatchEvent(e){if(this.isSilent||this.logger.debug(`Dispatching event of identifier ${e.getIdentifier()}.`,{event:e}),e.isPropagationStopped())return void(this.isSilent||this.logger.debug("Stopped event propagation because it is already stopped.",{event:e}));const t=wt(e.getIdentifier());for(let s=0;s<t.length;++s){const n=t[s],i=this.eventListenerTargets.get(n);if(void 0!==i){this.isSilent||this.logger.debug(`Iterating over resolved event listeners of identifier ${n}`,{event:e});for(let t=i.length-1;t>=0;t--){try{await Promise.resolve(i[t].eventListener.onEvent(e))}catch(r){this.logger.error("Event handler threw exception, dispatcher continues with next event listener.",{event:e,error:r})}if(e.isPropagationStopped())return void(this.isSilent||this.logger.debug("Stopped event propagation as it got stopped.",{event:e}))}}}this.isSilent||this.logger.debug("Event got handled by all event listeners.",{event:e})}addListener(e,t,r){let s;void 0===r&&(r=0),s=this.eventListenerTargets.has(e)?this.eventListenerTargets.get(e):[];let n=0,i=s.length-1,o=-1;for(;n<=i;){const e=Math.floor((n+i)/2);s[e].priority>=r?(o=e,i=e-1):n=e+1}const a=-1===o?n:o;return s.splice(a,0,{priority:r,eventListener:t}),this.eventListenerTargets.set(e,s),this}removeListener(e,t){const r=this.eventListenerTargets.get(e);if(!r)return this;for(let s=0;s<r.length;++s)if(r[s].eventListener===t){r.splice(s,1);break}return 0===r.length&&this.eventListenerTargets.delete(e),this}getListeners(e){const t=this.eventListenerTargets.get(e);return t?t.map(e=>e.eventListener):[]}hasListeners(e){return this.eventListenerTargets.has(e)}};It.identifier=o.serviceEventDispatcher;let Ht=It;const jt=class e{constructor(e,t){this.logger=e,this.apiConfiguration=t}static constructFromServiceResolver(t){const r=t.getServiceOrFail(o.logger),s=t.getServiceOrFail(o.serviceApiConfiguration);return new e(r,s)}rethrowErrorAsNetworkError(e){if(e instanceof p)throw e;throw new g("Network error occurred during fetch.",e)}logAndThrowError(e){const t=e instanceof Error?e:new Error(String(e));throw this.logger.error(t.message,t),t}async parseJsonResponse(e){const t=e.headers.get("Content-Type");if(!t)return Promise.reject(new y("Response does not contain a Content-Type header."));if(!t.includes("application/json")&&!t.includes("application/problem+json"))return Promise.reject(new y(`Unexpected Content-Type: "${t}". Expected JSON-compatible format.`));const r=await e.json().catch(e=>{throw new y(`Failed to parse response body as JSON: ${e}`)});if(!e.ok)throw this.createResponseErrorFromBadResponse(e,r);return r}async parseEmptyResponse(e){if(e.ok&&204===e.status)return;const t=e.headers.get("Content-Type");if(null===t)throw new y("Response does not contain content type header.");if(!t.includes("application/problem+json"))throw new y("Unable to parse response as content type is not 'application/problem+json'.");const r=await e.json().catch(e=>{throw new y(`Failed to parse response body as JSON: ${e}`)});throw this.createResponseErrorFromBadResponse(e,r)}parseLocationResponse(e){if(e.ok&&(201===e.status||204===e.status)&&e.headers.has("Location")){const t=e.headers.get("Location").split("/").at(-1);return Promise.resolve(Ft(t))}const t=e.headers.get("Content-Type");return null===t?Promise.reject(new y("Response does not contain content type header.")):t.includes("application/problem+json")?e.json().catch(e=>{throw new y(`Failed to parse response body as JSON: ${e}`)}).then(t=>{throw this.createResponseErrorFromBadResponse(e,t)}):Promise.reject(new y("Unable to parse response as content type is not 'application/problem+json'."))}createResponseErrorFromBadResponse(e,t){let r=null;return 401===e.status&&(r=new w("Server returned 401 unauthorized.")),403===e.status&&(r=new E("Server returned 403 forbidden.")),404===e.status&&(r=new S("Server returned 404 not found.")),429===e.status&&(r=new b("Server returned 429 too many requests.")),null===r&&(r=new v("Generic response error.")),"type"in t&&r.setType(String(t.type)),"title"in t&&r.setTitle(String(t.title)),"detail"in t&&r.setDetail(String(t.detail)),"status"in t&&null===r.getStatus()&&r.setStatus(Number(t.status)),r}addAuthorizationHeader(e){this.apiConfiguration.hasToken()&&(e.Authorization=`Bearer ${this.apiConfiguration.getToken()}`)}addAcceptJsonAndProblemJsonHeader(e){e.Accept="application/json, application/problem+json"}addIfNoneMatchHeader(e,t){e["If-None-Match"]=t}addContentTypeJsonHeader(e){e["Content-Type"]="application/json"}getDefaultGetOptions(e){const t={};return this.addAuthorizationHeader(t),this.addAcceptJsonAndProblemJsonHeader(t),void 0!==e&&this.addIfNoneMatchHeader(t,e),{method:s.GET,headers:t,redirect:"follow",referrerPolicy:"no-referrer",cache:"no-store"}}getDefaultDeleteOptions(){const e={};return this.addAuthorizationHeader(e),this.addAcceptJsonAndProblemJsonHeader(e),{method:s.DELETE,headers:e,redirect:"follow",referrerPolicy:"no-referrer"}}getDefaultPostOptions(e){const t={};return this.addAuthorizationHeader(t),this.addAcceptJsonAndProblemJsonHeader(t),this.addContentTypeJsonHeader(t),{method:s.POST,headers:t,redirect:"follow",referrerPolicy:"no-referrer",body:e}}getDefaultPatchOptions(e){const t={};return this.addAuthorizationHeader(t),this.addAcceptJsonAndProblemJsonHeader(t),this.addContentTypeJsonHeader(t),{method:s.PATCH,headers:t,redirect:"follow",referrerPolicy:"no-referrer",body:e}}getDefaultPutOptions(e){const t={};return this.addAuthorizationHeader(t),this.addAcceptJsonAndProblemJsonHeader(t),this.addContentTypeJsonHeader(t),{method:s.PUT,headers:t,redirect:"follow",referrerPolicy:"no-referrer",body:e}}buildUrl(e){return`${this.apiConfiguration.getApiHost()}${e}`}runWrappedFetch(e,t){return e=`${this.apiConfiguration.getApiHost()}${e}`,this.logger.debug(`Executing HTTP ${t?.method??"-"} request against url ${e} .`),fetch(e,t)}};jt.identifier=o.serviceFetchHelper;let Vt=jt;const Ut=class{constructor(){this.routes=/* @__PURE__ */new Map,this.rootNode=new kt}hasRouteConfiguration(e){return this.routes.has(String(e))}getRouteConfiguration(e){const t=this.routes.get(String(e));return void 0===t?null:t}getRouteConfigurationOrFail(e){const t=this.routes.get(String(e));if(void 0===t)throw new Error(`Requested route with identifier ${String(e)} could not be resolved.`);return t}getSegmentsFromRoute(e){return e.replace(/^\/+|\/+$/g,"").split("/").filter(Boolean)}addRouteConfiguration(e){this.routes.set(String(e.routeIdentifier),e);const t=this.getSegmentsFromRoute(e.route);let r=this.rootNode;for(let s=0;s<t.length;s++)r=r.getChildRouteNode(t[s]);return r.addRouteHandler(e.routeIdentifier),this}findRouteConfigurationsByNodeAndSegments(e,t){if(0===t.length)return e.getRouteHandlers();const r=[];return e.hasChildRouteNode(t[0])&&r.push(...this.findRouteConfigurationsByNodeAndSegments(e.getChildRouteNode(t[0]),t.slice(1))),e.hasChildRouteNode("*")&&r.push(...this.findRouteConfigurationsByNodeAndSegments(e.getChildRouteNode("*"),t.slice(1))),r}async findRouteConfiguration(e){const t=this.getSegmentsFromRoute(e);let r=this.findRouteConfigurationsByNodeAndSegments(this.rootNode,t);r=[...new Set(r)];const s=r.map(e=>this.getRouteConfiguration(e)).filter(e=>null!==e).sort((e,t)=>t.priority-e.priority);for(const n of s)if(await n.guard(e,[],null))return n;return null}deleteRouteConfiguration(e){return this.routes.delete(String(e)),this}getRouteIdentifiers(){return[...this.routes.keys()]}getRoutesConfigurations(){return[...this.routes.values()]}clearRoutes(){return this.routes.clear(),this}};Ut.identifier=o.routeResolver;let Wt=Ut;class Bt{constructor(){this.services=/* @__PURE__ */new Map}createServiceProxy(e){let t=e;return{proxy:new Proxy({},{get(e,r,s){const n=Reflect.get(t,r,s);return"function"==typeof n?n.bind(t):n},set:(e,r,s)=>Reflect.set(t,r,s),has:(e,r)=>r in t,ownKeys:()=>Reflect.ownKeys(t),getOwnPropertyDescriptor(e,r){const s=Object.getOwnPropertyDescriptor(t,r);if(s)return{...s,configurable:!0}},defineProperty:(e,r,s)=>Reflect.defineProperty(t,r,s),getPrototypeOf:()=>Object.getPrototypeOf(t)}),targetReplaceFunction(e){t=e}}}hasService(e){return this.services.has(String(e))}getService(e){const t=this.services.get(String(e));return void 0===t?null:t.proxy}getServiceOrFail(e){const t=this.services.get(String(e));if(void 0===t)throw new Error(`Requested service with identifier ${String(e)} could not be resolved.`);return t.proxy}setService(e,t){let r=this.services.get(String(e));return void 0===r?(r=this.createServiceProxy(t),this.services.set(String(e),r),this):(r.targetReplaceFunction(t),this)}deleteService(e){return this.services.delete(String(e)),this}getServiceIdentifiers(){return[...this.services.keys()]}getServices(){return[...this.services.values()].map(e=>e.proxy)}clearServices(){return this.services.clear(),this}}let Zt=((e=class{constructor(){}static constructFromServiceResolver(){return new e}rawTokenToToken(e){if(!("type"in e))throw new Error("Raw token must contain property 'type' in order to be parsed to a token.");if("_TokenResponse"!==String(e.type))throw new Error("Type must be '_TokenResponse' in order to be parsed to a token.");if(!("token"in e))throw new Error("Raw token must contain property 'token' in order to be parsed to a token.");return _t(String(e.token))}}).identifier=o.serviceTokenParser,e);const qt=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,ApiConfiguration:ut,ApiWrapper:dt,CollectionParser:pt,ElementParser:zt,EventDispatcher:Ht,FetchHelper:Vt,Logger:class{constructor(e){this.logger=e}debug(...e){return this.logger.debug(e)}error(...e){return this.logger.error(e)}info(...e){return this.logger.info(e)}warn(...e){return this.logger.warn(e)}},RouteResolver:Wt,ServiceResolver:Bt,TokenParser:Zt},Symbol.toStringTag,{value:"Module"}));var Gt=Object.getOwnPropertyDescriptor;let Jt=class extends Xe{constructor(){super(...arguments),this._routeConfiguration=null,this._routeResolver=null}handleNewRoute(e){console.log(`handle new route: ${e}`),this._routeResolver?.findRouteConfiguration(e).then(t=>{null!==t?this._routeConfiguration=t:console.log(`unable to resolve route: ${e}`)}).catch(e=>{console.log("error during resolving route"),console.log(e)})}handlePopStateEvent(){console.log("(popstate) Location changed to: ",window.location.pathname),this.handleNewRoute(window.location.pathname)}handleLinkClickEvent(e){const t=e.target;if(null===t)return;if(!(t instanceof HTMLElement))return;const r=t.attributes.getNamedItem("href")?.value;if(null==r)return;const s=window.location.origin,n=new URL(r,s);n.host===window.location.host&&(console.log(`new absolute url: ${n}`),history.pushState({},"",n),e.preventDefault(),this.handleNewRoute(n.pathname))}connectedCallback(){super.connectedCallback(),window.addEventListener("popstate",this.handlePopStateEvent.bind(this)),document.addEventListener("click",this.handleLinkClickEvent.bind(this));const e=new h;this.dispatchEvent(e);const t=e.getServiceResolver();if(null!==t){const e=t.getService(Wt.identifier);null!==e&&(console.log("router init complete"),this._routeResolver=e,this.handleNewRoute(window.location.pathname))}}disconnectedCallback(){window.removeEventListener("popstate",this.handlePopStateEvent),document.removeEventListener("click",this.handleLinkClickEvent),super.disconnectedCallback()}getRouteWebComponentTag(){return null===this._routeConfiguration?null:"string"==typeof this._routeConfiguration.webComponent?typeof this._routeConfiguration.webComponent:null}render(){const e=(e=>({_$litStatic$:e,r:rt}))(this.getRouteWebComponentTag()??"ember-nexus-app-core-page-error-404");return it`<${e}></${e}>`}};Jt=((e,t,r,s)=>{for(var n,i=s>1?void 0:s?Gt(t,r):t,o=e.length-1;o>=0;o--)(n=e[o])&&(i=n(i)||i);return i})([tt("ember-nexus-app-core-router")],Jt);const Yt=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,Page:lt,get Router(){return Jt}},Symbol.toStringTag,{value:"Module"})),Kt=class e{constructor(e,t){this.logger=e,this.fetchHelper=t}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper))}async deleteElement(e){try{const t=this.fetchHelper.buildUrl(`/${e}`);this.logger.debug(`Executing HTTP DELETE request against URL: ${t}`);const r=await fetch(t,this.fetchHelper.getDefaultDeleteOptions()).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));return await this.fetchHelper.parseEmptyResponse(r),{response:r}}catch(t){this.fetchHelper.logAndThrowError(t)}}};Kt.identifier=o.endpointElementDeleteElementEndpoint;let Qt=Kt;const Xt=class e{constructor(e,t,r){this.logger=e,this.fetchHelper=t,this.collectionParser=r}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper),t.getServiceOrFail(o.serviceCollectionParser))}async getElementChildren(e,t=1,r=25,s){try{if(t<1)throw new T("Page number must be at least 1.");if(r<1)throw new T("Page size must be at least 1.");const n=this.fetchHelper.buildUrl(`/${e}/children?page=${t}&pageSize=${r}`);this.logger.debug(`Executing HTTP GET request against URL: ${n}`);const i=await fetch(n,this.fetchHelper.getDefaultGetOptions(s)).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));if(304===i.status)return{response:i};const o=await this.fetchHelper.parseJsonResponse(i);return{data:await this.collectionParser.deserializeCollection(o),response:i}}catch(n){this.fetchHelper.logAndThrowError(n)}}};Xt.identifier=o.endpointElementGetElementChildrenEndpoint;let er=Xt;const tr=class e{constructor(e,t,r){this.logger=e,this.fetchHelper=t,this.elementParser=r}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper),t.getServiceOrFail(o.serviceElementParser))}async getElement(e,t){try{const r=this.fetchHelper.buildUrl(`/${e}`);this.logger.debug(`Executing HTTP GET request against URL: ${r}`);const s=await fetch(r,this.fetchHelper.getDefaultGetOptions(t)).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));if(304===s.status)return{response:s};const n=await this.fetchHelper.parseJsonResponse(s);return{data:await this.elementParser.deserializeElement(n),response:s}}catch(r){this.fetchHelper.logAndThrowError(r)}}};tr.identifier=o.endpointElementGetElementEndpoint;let rr=tr;const sr=class e{constructor(e,t,r){this.logger=e,this.fetchHelper=t,this.collectionParser=r}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper),t.getServiceOrFail(o.serviceCollectionParser))}async getElementParents(e,t=1,r=25,s){try{if(t<1)throw new T("Page number must be at least 1.");if(r<1)throw new T("Page size must be at least 1.");const n=this.fetchHelper.buildUrl(`/${e}/parents?page=${t}&pageSize=${r}`);this.logger.debug(`Executing HTTP GET request against URL: ${n}`);const i=await fetch(n,this.fetchHelper.getDefaultGetOptions(s)).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));if(304===i.status)return{response:i};const o=await this.fetchHelper.parseJsonResponse(i);return{data:await this.collectionParser.deserializeCollection(o),response:i}}catch(n){this.fetchHelper.logAndThrowError(n)}}};sr.identifier=o.endpointElementGetElementParentsEndpoint;let nr=sr;const ir=class e{constructor(e,t,r){this.logger=e,this.fetchHelper=t,this.collectionParser=r}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper),t.getServiceOrFail(o.serviceCollectionParser))}async getElementRelated(e,t=1,r=25,s){try{if(t<1)throw new T("Page number must be at least 1.");if(r<1)throw new T("Page size must be at least 1.");const n=this.fetchHelper.buildUrl(`/${e}/related?page=${t}&pageSize=${r}`);this.logger.debug(`Executing HTTP GET request against URL: ${n}`);const i=await fetch(n,this.fetchHelper.getDefaultGetOptions(s)).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));if(304===i.status)return{response:i};const o=await this.fetchHelper.parseJsonResponse(i);return{data:await this.collectionParser.deserializeCollection(o),response:i}}catch(n){this.fetchHelper.logAndThrowError(n)}}};ir.identifier=o.endpointElementGetElementRelatedEndpoint;let or=ir;const ar=class e{constructor(e,t,r){this.logger=e,this.fetchHelper=t,this.collectionParser=r}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper),t.getServiceOrFail(o.serviceCollectionParser))}async getIndex(e=1,t=25,r){try{if(e<1)throw new T("Page number must be at least 1.");if(t<1)throw new T("Page size must be at least 1.");const s=this.fetchHelper.buildUrl(`/?page=${e}&pageSize=${t}`);this.logger.debug(`Executing HTTP GET request against URL: ${s}`);const n=await fetch(s,this.fetchHelper.getDefaultGetOptions(r)).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));if(304===n.status)return{response:n};const i=await this.fetchHelper.parseJsonResponse(n);return{data:await this.collectionParser.deserializeCollection(i),response:n}}catch(s){this.fetchHelper.logAndThrowError(s)}}};ar.identifier=o.endpointElementGetIndexEndpoint;let lr=ar;const cr=class e{constructor(e,t){this.logger=e,this.fetchHelper=t}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper))}async patchElement(e,t){try{const r=this.fetchHelper.buildUrl(`/${e}`);this.logger.debug(`Executing HTTP PATCH request against URL: ${r}`);const s=await fetch(r,this.fetchHelper.getDefaultPatchOptions(JSON.stringify(t))).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));return await this.fetchHelper.parseEmptyResponse(s),{response:s}}catch(r){this.fetchHelper.logAndThrowError(r)}}};cr.identifier=o.endpointElementPatchElementEndpoint;let ur=cr;const hr=class e{constructor(e,t){this.logger=e,this.fetchHelper=t}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper))}async postElement(e,t){try{const r=this.fetchHelper.buildUrl(`/${e}`);this.logger.debug(`Executing HTTP POST request against URL: ${r}`);const s=await fetch(r,this.fetchHelper.getDefaultPostOptions(JSON.stringify(t))).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));return{data:await this.fetchHelper.parseLocationResponse(s),response:s}}catch(r){this.fetchHelper.logAndThrowError(r)}}};hr.identifier=o.endpointElementPostElementEndpoint;let dr=hr;const fr=class e{constructor(e,t){this.logger=e,this.fetchHelper=t}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper))}async postIndex(e){try{const t=this.fetchHelper.buildUrl("/");this.logger.debug(`Executing HTTP POST request against URL: ${t}`);const r=await fetch(t,this.fetchHelper.getDefaultPostOptions(JSON.stringify(e))).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));return{data:await this.fetchHelper.parseLocationResponse(r),response:r}}catch(t){this.fetchHelper.logAndThrowError(t)}}};fr.identifier=o.endpointElementPostIndexEndpoint;let pr=fr;const mr=class e{constructor(e,t){this.logger=e,this.fetchHelper=t}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper))}async putElement(e,t){try{const r=this.fetchHelper.buildUrl(`/${e}`);this.logger.debug(`Executing HTTP PUT request against URL: ${r}`);const s=await fetch(r,this.fetchHelper.getDefaultPutOptions(JSON.stringify(t))).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));return await this.fetchHelper.parseEmptyResponse(s),{response:s}}catch(r){this.fetchHelper.logAndThrowError(r)}}};mr.identifier=o.endpointElementPutElementEndpoint;let gr=mr;const yr=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,DeleteElementEndpoint:Qt,GetElementChildrenEndpoint:er,GetElementEndpoint:rr,GetElementParentsEndpoint:nr,GetElementRelatedEndpoint:or,GetIndexEndpoint:lr,PatchElementEndpoint:ur,PostElementEndpoint:dr,PostIndexEndpoint:pr,PutElementEndpoint:gr},Symbol.toStringTag,{value:"Module"})),vr=class e{constructor(e,t){this.logger=e,this.fetchHelper=t}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper))}async deleteToken(){try{const e=this.fetchHelper.buildUrl("/token");this.logger.debug(`Executing HTTP DELETE request against URL: ${e}`);const t=await fetch(e,this.fetchHelper.getDefaultDeleteOptions()).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));return await this.fetchHelper.parseEmptyResponse(t),{response:t}}catch(e){this.fetchHelper.logAndThrowError(e)}}};vr.identifier=o.endpointUserDeleteTokenEndpoint;let wr=vr;const Er=class e{constructor(e,t,r){this.logger=e,this.fetchHelper=t,this.elementParser=r}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper),t.getServiceOrFail(o.serviceElementParser))}async getMe(){try{const e=this.fetchHelper.buildUrl("/me");this.logger.debug(`Executing HTTP GET request against URL: ${e}`);const t=await fetch(e,this.fetchHelper.getDefaultGetOptions()).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e)),r=await this.fetchHelper.parseJsonResponse(t),s=await this.elementParser.deserializeElement(r);if("User"!==s.type)throw new m("Expected node to be of type 'User'.");return{data:s,response:t}}catch(e){this.fetchHelper.logAndThrowError(e)}}};Er.identifier=o.endpointUserGetMeEndpoint;let Sr=Er;const br=class e{constructor(e,t,r){this.logger=e,this.fetchHelper=t,this.elementParser=r}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper),t.getServiceOrFail(o.serviceElementParser))}async getToken(){try{const e=this.fetchHelper.buildUrl("/token");this.logger.debug(`Executing HTTP GET request against URL: ${e}`);const t=await fetch(e,this.fetchHelper.getDefaultGetOptions()).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e)),r=await this.fetchHelper.parseJsonResponse(t),s=await this.elementParser.deserializeElement(r);if("Token"!==s.type)throw new m("Expected node to be of type 'Token'.");return{data:s,response:t}}catch(e){this.fetchHelper.logAndThrowError(e)}}};br.identifier=o.endpointUserGetTokenEndpoint;let Tr=br;const Or=class e{constructor(e,t){this.logger=e,this.fetchHelper=t}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper))}async postChangePassword(e,t,r){try{const s=this.fetchHelper.buildUrl("/change-password");this.logger.debug(`Executing HTTP POST request against URL: ${s}`);const n={type:"ActionChangePassword",currentPassword:t,newPassword:r,uniqueUserIdentifier:e},i=await fetch(s,this.fetchHelper.getDefaultPostOptions(JSON.stringify(n))).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));return await this.fetchHelper.parseEmptyResponse(i),{response:i}}catch(s){this.fetchHelper.logAndThrowError(s)}}};Or.identifier=o.endpointUserPostChangePasswordEndpoint;let kr=Or;const xr=class e{constructor(e,t){this.logger=e,this.fetchHelper=t}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper))}async postRegister(e,t,r={}){try{const s=this.fetchHelper.buildUrl("/register");this.logger.debug(`Executing HTTP POST request against URL: ${s}`);const n={type:"User",uniqueUserIdentifier:e,password:t,data:r},i=await fetch(s,this.fetchHelper.getDefaultPostOptions(JSON.stringify(n))).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));return{data:await this.fetchHelper.parseLocationResponse(i),response:i}}catch(s){this.fetchHelper.logAndThrowError(s)}}};xr.identifier=o.endpointUserPostRegisterEndpoint;let Cr=xr;const _r=class e{constructor(e,t,r){this.logger=e,this.tokenParser=t,this.fetchHelper=r}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceTokenParser),t.getServiceOrFail(o.serviceFetchHelper))}async postToken(e,t,r={}){try{const s=this.fetchHelper.buildUrl("/token");this.logger.debug(`Executing HTTP POST request against URL: ${s}`);const n={type:"Token",uniqueUserIdentifier:e,password:t,data:r},i=await fetch(s,this.fetchHelper.getDefaultPostOptions(JSON.stringify(n))).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e)),o=await this.fetchHelper.parseJsonResponse(i);return{data:this.tokenParser.rawTokenToToken(o),response:i}}catch(s){this.fetchHelper.logAndThrowError(s)}}};_r.identifier=o.endpointUserPostTokenEndpoint;let Ar=_r;const Fr=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,DeleteTokenEndpoint:wr,GetMeEndpoint:Sr,GetTokenEndpoint:Tr,PostChangePasswordEndpoint:kr,PostRegisterEndpoint:Cr,PostTokenEndpoint:Ar},Symbol.toStringTag,{value:"Module"})),$r=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,Element:yr,User:Fr},Symbol.toStringTag,{value:"Module"}));class Nr extends Error{}class Pr extends Nr{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Lr extends Nr{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Rr extends Nr{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Mr extends Nr{}class Dr extends Nr{constructor(e){super(`Invalid unit ${e}`)}}class zr extends Nr{}class Ir extends Nr{constructor(){super("Zone is an abstract class")}}const Hr="numeric",jr="short",Vr="long",Ur={year:Hr,month:Hr,day:Hr},Wr={year:Hr,month:jr,day:Hr},Br={year:Hr,month:jr,day:Hr,weekday:jr},Zr={year:Hr,month:Vr,day:Hr},qr={year:Hr,month:Vr,day:Hr,weekday:Vr},Gr={hour:Hr,minute:Hr},Jr={hour:Hr,minute:Hr,second:Hr},Yr={hour:Hr,minute:Hr,second:Hr,timeZoneName:jr},Kr={hour:Hr,minute:Hr,second:Hr,timeZoneName:Vr},Qr={hour:Hr,minute:Hr,hourCycle:"h23"},Xr={hour:Hr,minute:Hr,second:Hr,hourCycle:"h23"},es={hour:Hr,minute:Hr,second:Hr,hourCycle:"h23",timeZoneName:jr},ts={hour:Hr,minute:Hr,second:Hr,hourCycle:"h23",timeZoneName:Vr},rs={year:Hr,month:Hr,day:Hr,hour:Hr,minute:Hr},ss={year:Hr,month:Hr,day:Hr,hour:Hr,minute:Hr,second:Hr},ns={year:Hr,month:jr,day:Hr,hour:Hr,minute:Hr},is={year:Hr,month:jr,day:Hr,hour:Hr,minute:Hr,second:Hr},os={year:Hr,month:jr,day:Hr,weekday:jr,hour:Hr,minute:Hr},as={year:Hr,month:Vr,day:Hr,hour:Hr,minute:Hr,timeZoneName:jr},ls={year:Hr,month:Vr,day:Hr,hour:Hr,minute:Hr,second:Hr,timeZoneName:jr},cs={year:Hr,month:Vr,day:Hr,weekday:Vr,hour:Hr,minute:Hr,timeZoneName:Vr},us={year:Hr,month:Vr,day:Hr,weekday:Vr,hour:Hr,minute:Hr,second:Hr,timeZoneName:Vr};class hs{get type(){throw new Ir}get name(){throw new Ir}get ianaName(){return this.name}get isUniversal(){throw new Ir}offsetName(e,t){throw new Ir}formatOffset(e,t){throw new Ir}offset(e){throw new Ir}equals(e){throw new Ir}get isValid(){throw new Ir}}let ds=null;class fs extends hs{static get instance(){return null===ds&&(ds=new fs),ds}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return Ln(e,t,r)}formatOffset(e,t){return zn(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"system"===e.type}get isValid(){return!0}}const ps=/* @__PURE__ */new Map;const ms={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};const gs=/* @__PURE__ */new Map;class ys extends hs{static create(e){let t=gs.get(e);return void 0===t&&gs.set(e,t=new ys(e)),t}static resetCache(){gs.clear(),ps.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(t){return!1}}constructor(e){super(),this.zoneName=e,this.valid=ys.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return Ln(e,t,r,this.name)}formatOffset(e,t){return zn(this.offset(e),t)}offset(e){if(!this.valid)return NaN;const t=new Date(e);if(isNaN(t))return NaN;const r=function(e){let t=ps.get(e);return void 0===t&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),ps.set(e,t)),t}(this.name);let[s,n,i,o,a,l,c]=r.formatToParts?function(e,t){const r=e.formatToParts(t),s=[];for(let n=0;n<r.length;n++){const{type:e,value:t}=r[n],i=ms[e];"era"===e?s[i]=t:fn(i)||(s[i]=parseInt(t,10))}return s}(r,t):function(e,t){const r=e.format(t).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,n,i,o,a,l,c,u]=s;return[o,n,i,a,l,c,u]}(r,t);"BC"===o&&(s=1-Math.abs(s));let u=+t;const h=u%1e3;return u-=h>=0?h:1e3+h,(Fn({year:s,month:n,day:i,hour:24===a?0:a,minute:l,second:c,millisecond:0})-u)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let vs={};const ws=/* @__PURE__ */new Map;function Es(e,t={}){const r=JSON.stringify([e,t]);let s=ws.get(r);return void 0===s&&(s=new Intl.DateTimeFormat(e,t),ws.set(r,s)),s}const Ss=/* @__PURE__ */new Map;const bs=/* @__PURE__ */new Map;let Ts=null;const Os=/* @__PURE__ */new Map;function ks(e){let t=Os.get(e);return void 0===t&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),Os.set(e,t)),t}const xs=/* @__PURE__ */new Map;function Cs(e,t,r,s){const n=e.listingMode();return"error"===n?null:"en"===n?r(t):s(t)}class _s{constructor(e,t,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:s,floor:n,...i}=r;if(!t||Object.keys(i).length>0){const t={useGrouping:!1,...r};r.padTo>0&&(t.minimumIntegerDigits=r.padTo),this.inf=function(e,t={}){const r=JSON.stringify([e,t]);let s=Ss.get(r);return void 0===s&&(s=new Intl.NumberFormat(e,t),Ss.set(r,s)),s}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return bn(this.floor?Math.floor(e):xn(e,3),this.padTo)}}class As{constructor(e,t,r){let s;if(this.opts=r,this.originalZone=void 0,this.opts.timeZone)this.dt=e;else if("fixed"===e.zone.type){const t=e.offset/60*-1,r=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;0!==e.offset&&ys.create(r).valid?(s=r,this.dt=e):(s="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else"system"===e.zone.type?this.dt=e:"iana"===e.zone.type?(this.dt=e,s=e.zone.name):(s="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const n={...this.opts};n.timeZone=n.timeZone||s,this.dtf=Es(t,n)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(e=>{if("timeZoneName"===e.type){const t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:t}}return e}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class Fs{constructor(e,t,r){this.opts={style:"long",...r},!t&&gn()&&(this.rtf=function(e,t={}){const{base:r,...s}=t,n=JSON.stringify([e,s]);let i=bs.get(n);return void 0===i&&(i=new Intl.RelativeTimeFormat(e,t),bs.set(n,i)),i}(e,r))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,r="always",s=!1){const n={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===r&&i){const r="days"===e;switch(t){case 1:return r?"tomorrow":`next ${n[e][0]}`;case-1:return r?"yesterday":`last ${n[e][0]}`;case 0:return r?"today":`this ${n[e][0]}`}}const o=Object.is(t,-0)||t<0,a=Math.abs(t),l=1===a,c=n[e],u=s?l?c[1]:c[2]||c[1]:l?n[e][0]:e;return o?`${a} ${u} ago`:`in ${a} ${u}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const $s={firstDay:1,minimalDays:4,weekend:[6,7]};class Ns{static fromOpts(e){return Ns.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,r,s,n=!1){const i=e||Ys.defaultLocale,o=i||(n?"en-US":Ts||(Ts=(new Intl.DateTimeFormat).resolvedOptions().locale,Ts)),a=t||Ys.defaultNumberingSystem,l=r||Ys.defaultOutputCalendar,c=En(s)||Ys.defaultWeekSettings;return new Ns(o,a,l,c,i)}static resetCache(){Ts=null,ws.clear(),Ss.clear(),bs.clear(),Os.clear(),xs.clear()}static fromObject({locale:e,numberingSystem:t,outputCalendar:r,weekSettings:s}={}){return Ns.create(e,t,r,s)}constructor(e,t,r,s,n){const[i,o,a]=function(e){const t=e.indexOf("-x-");-1!==t&&(e=e.substring(0,t));const r=e.indexOf("-u-");if(-1===r)return[e];{let t,n;try{t=Es(e).resolvedOptions(),n=e}catch(s){const i=e.substring(0,r);t=Es(i).resolvedOptions(),n=i}const{numberingSystem:i,calendar:o}=t;return[n,i,o]}}(e);this.locale=i,this.numberingSystem=t||o||null,this.outputCalendar=r||a||null,this.weekSettings=s,this.intl=function(e,t,r){return r||t?(e.includes("-u-")||(e+="-u"),r&&(e+=`-ca-${r}`),t&&(e+=`-nu-${t}`),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=n,this.fastNumbersCached=null}get fastNumbers(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===ks(e.locale).numberingSystem)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?Ns.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,En(e.weekSettings)||this.weekSettings,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return Cs(this,e,Un,()=>{const r="ja"===this.intl||this.intl.startsWith("ja-"),s=(t&=!r)?{month:e,day:"numeric"}:{month:e},n=t?"format":"standalone";if(!this.monthsCache[n][e]){const t=r?e=>this.dtFormatter(e,s).format():e=>this.extract(e,s,"month");this.monthsCache[n][e]=function(e){const t=[];for(let r=1;r<=12;r++){const s=Jo.utc(2009,r,1);t.push(e(s))}return t}(t)}return this.monthsCache[n][e]})}weekdays(e,t=!1){return Cs(this,e,qn,()=>{const r=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},s=t?"format":"standalone";return this.weekdaysCache[s][e]||(this.weekdaysCache[s][e]=function(e){const t=[];for(let r=1;r<=7;r++){const s=Jo.utc(2016,11,13+r);t.push(e(s))}return t}(e=>this.extract(e,r,"weekday"))),this.weekdaysCache[s][e]})}meridiems(){return Cs(this,void 0,()=>Gn,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Jo.utc(2016,11,13,9),Jo.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Cs(this,e,Qn,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[Jo.utc(-40,1,1),Jo.utc(2017,1,1)].map(e=>this.extract(e,t,"era"))),this.eraCache[e]})}extract(e,t,r){const s=this.dtFormatter(e,t).formatToParts().find(e=>e.type.toLowerCase()===r);return s?s.value:null}numberFormatter(e={}){return new _s(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new As(e,this.intl,t)}relFormatter(e={}){return new Fs(this.intl,this.isEnglish(),e)}listFormatter(e={}){return function(e,t={}){const r=JSON.stringify([e,t]);let s=vs[r];return s||(s=new Intl.ListFormat(e,t),vs[r]=s),s}(this.intl,e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||ks(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:yn()?function(e){let t=xs.get(e);if(!t){const r=new Intl.Locale(e);t="getWeekInfo"in r?r.getWeekInfo():r.weekInfo,"minimalDays"in t||(t={...$s,...t}),xs.set(e,t)}return t}(this.locale):$s}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Ps=null;class Ls extends hs{static get utcInstance(){return null===Ps&&(Ps=new Ls(0)),Ps}static instance(e){return 0===e?Ls.utcInstance:new Ls(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new Ls(Rn(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${zn(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${zn(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return zn(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class Rs extends hs{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Ms(e,t){if(fn(e)||null===e)return t;if(e instanceof hs)return e;if("string"==typeof e){const r=e.toLowerCase();return"default"===r?t:"local"===r||"system"===r?fs.instance:"utc"===r||"gmt"===r?Ls.utcInstance:Ls.parseSpecifier(r)||ys.create(e)}return pn(e)?Ls.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new Rs(e)}const Ds={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},zs={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Is=Ds.hanidec.replace(/[\[|\]]/g,"").split("");const Hs=/* @__PURE__ */new Map;function js({numberingSystem:e},t=""){const r=e||"latn";let s=Hs.get(r);void 0===s&&(s=/* @__PURE__ */new Map,Hs.set(r,s));let n=s.get(t);return void 0===n&&(n=new RegExp(`${Ds[r]}${t}`),s.set(t,n)),n}let Vs,Us=()=>Date.now(),Ws="system",Bs=null,Zs=null,qs=null,Gs=60,Js=null;class Ys{static get now(){return Us}static set now(e){Us=e}static set defaultZone(e){Ws=e}static get defaultZone(){return Ms(Ws,fs.instance)}static get defaultLocale(){return Bs}static set defaultLocale(e){Bs=e}static get defaultNumberingSystem(){return Zs}static set defaultNumberingSystem(e){Zs=e}static get defaultOutputCalendar(){return qs}static set defaultOutputCalendar(e){qs=e}static get defaultWeekSettings(){return Js}static set defaultWeekSettings(e){Js=En(e)}static get twoDigitCutoffYear(){return Gs}static set twoDigitCutoffYear(e){Gs=e%100}static get throwOnInvalid(){return Vs}static set throwOnInvalid(e){Vs=e}static resetCaches(){Ns.resetCache(),ys.resetCache(),Jo.resetCache(),Hs.clear()}}class Ks{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Qs=[0,31,59,90,120,151,181,212,243,273,304,334],Xs=[0,31,60,91,121,152,182,213,244,274,305,335];function en(e,t){return new Ks("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function tn(e,t,r){const s=new Date(Date.UTC(e,t-1,r));e<100&&e>=0&&s.setUTCFullYear(s.getUTCFullYear()-1900);const n=s.getUTCDay();return 0===n?7:n}function rn(e,t,r){return r+(Cn(e)?Xs:Qs)[t-1]}function sn(e,t){const r=Cn(e)?Xs:Qs,s=r.findIndex(e=>e<t);return{month:s+1,day:t-r[s]}}function nn(e,t){return(e-t+7)%7+1}function on(e,t=4,r=1){const{year:s,month:n,day:i}=e,o=rn(s,n,i),a=nn(tn(s,n,i),r);let l,c=Math.floor((o-a+14-t)/7);return c<1?(l=s-1,c=Nn(l,t,r)):c>Nn(s,t,r)?(l=s+1,c=1):l=s,{weekYear:l,weekNumber:c,weekday:a,...In(e)}}function an(e,t=4,r=1){const{weekYear:s,weekNumber:n,weekday:i}=e,o=nn(tn(s,1,t),r),a=_n(s);let l,c=7*n+i-o-7+t;c<1?(l=s-1,c+=_n(l)):c>a?(l=s+1,c-=_n(s)):l=s;const{month:u,day:h}=sn(l,c);return{year:l,month:u,day:h,...In(e)}}function ln(e){const{year:t,month:r,day:s}=e;return{year:t,ordinal:rn(t,r,s),...In(e)}}function cn(e){const{year:t,ordinal:r}=e,{month:s,day:n}=sn(t,r);return{year:t,month:s,day:n,...In(e)}}function un(e,t){if(!fn(e.localWeekday)||!fn(e.localWeekNumber)||!fn(e.localWeekYear)){if(!fn(e.weekday)||!fn(e.weekNumber)||!fn(e.weekYear))throw new Mr("Cannot mix locale-based week fields with ISO-based week fields");return fn(e.localWeekday)||(e.weekday=e.localWeekday),fn(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),fn(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function hn(e){const t=mn(e.year),r=Sn(e.month,1,12),s=Sn(e.day,1,An(e.year,e.month));return t?r?!s&&en("day",e.day):en("month",e.month):en("year",e.year)}function dn(e){const{hour:t,minute:r,second:s,millisecond:n}=e,i=Sn(t,0,23)||24===t&&0===r&&0===s&&0===n,o=Sn(r,0,59),a=Sn(s,0,59),l=Sn(n,0,999);return i?o?a?!l&&en("millisecond",n):en("second",s):en("minute",r):en("hour",t)}function fn(e){return void 0===e}function pn(e){return"number"==typeof e}function mn(e){return"number"==typeof e&&e%1==0}function gn(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function yn(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function vn(e,t,r){if(0!==e.length)return e.reduce((e,s)=>{const n=[t(s),s];return e&&r(e[0],n[0])===e[0]?e:n},null)[1]}function wn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function En(e){if(null==e)return null;if("object"!=typeof e)throw new zr("Week settings must be an object");if(!Sn(e.firstDay,1,7)||!Sn(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(e=>!Sn(e,1,7)))throw new zr("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function Sn(e,t,r){return mn(e)&&e>=t&&e<=r}function bn(e,t=2){let r;return r=e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0"),r}function Tn(e){return fn(e)||null===e||""===e?void 0:parseInt(e,10)}function On(e){return fn(e)||null===e||""===e?void 0:parseFloat(e)}function kn(e){if(!fn(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function xn(e,t,r="round"){const s=10**t;switch(r){case"expand":return e>0?Math.ceil(e*s)/s:Math.floor(e*s)/s;case"trunc":return Math.trunc(e*s)/s;case"round":return Math.round(e*s)/s;case"floor":return Math.floor(e*s)/s;case"ceil":return Math.ceil(e*s)/s;default:throw new RangeError(`Value rounding ${r} is out of range`)}}function Cn(e){return e%4==0&&(e%100!=0||e%400==0)}function _n(e){return Cn(e)?366:365}function An(e,t){const r=(s=t-1)-(n=12)*Math.floor(s/n)+1;var s,n;return 2===r?Cn(e+(t-r)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function Fn(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function $n(e,t,r){return-nn(tn(e,1,t),r)+t-1}function Nn(e,t=4,r=1){const s=$n(e,t,r),n=$n(e+1,t,r);return(_n(e)-s+n)/7}function Pn(e){return e>99?e:e>Ys.twoDigitCutoffYear?1900+e:2e3+e}function Ln(e,t,r,s=null){const n=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(i.timeZone=s);const o={timeZoneName:t,...i},a=new Intl.DateTimeFormat(r,o).formatToParts(n).find(e=>"timezonename"===e.type.toLowerCase());return a?a.value:null}function Rn(e,t){let r=parseInt(e,10);Number.isNaN(r)&&(r=0);const s=parseInt(t,10)||0;return 60*r+(r<0||Object.is(r,-0)?-s:s)}function Mn(e){const t=Number(e);if("boolean"==typeof e||""===e||!Number.isFinite(t))throw new zr(`Invalid unit value ${e}`);return t}function Dn(e,t){const r={};for(const s in e)if(wn(e,s)){const n=e[s];if(null==n)continue;r[t(s)]=Mn(n)}return r}function zn(e,t){const r=Math.trunc(Math.abs(e/60)),s=Math.trunc(Math.abs(e%60)),n=e>=0?"+":"-";switch(t){case"short":return`${n}${bn(r,2)}:${bn(s,2)}`;case"narrow":return`${n}${r}${s>0?`:${s}`:""}`;case"techie":return`${n}${bn(r,2)}${bn(s,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function In(e){return function(e,t){return t.reduce((t,r)=>(t[r]=e[r],t),{})}(e,["hour","minute","second","millisecond"])}const Hn=["January","February","March","April","May","June","July","August","September","October","November","December"],jn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Vn=["J","F","M","A","M","J","J","A","S","O","N","D"];function Un(e){switch(e){case"narrow":return[...Vn];case"short":return[...jn];case"long":return[...Hn];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Wn=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Bn=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Zn=["M","T","W","T","F","S","S"];function qn(e){switch(e){case"narrow":return[...Zn];case"short":return[...Bn];case"long":return[...Wn];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Gn=["AM","PM"],Jn=["Before Christ","Anno Domini"],Yn=["BC","AD"],Kn=["B","A"];function Qn(e){switch(e){case"narrow":return[...Kn];case"short":return[...Yn];case"long":return[...Jn];default:return null}}function Xn(e,t){let r="";for(const s of e)s.literal?r+=s.val:r+=t(s.val);return r}const ei={D:Ur,DD:Wr,DDD:Zr,DDDD:qr,t:Gr,tt:Jr,ttt:Yr,tttt:Kr,T:Qr,TT:Xr,TTT:es,TTTT:ts,f:rs,ff:ns,fff:as,ffff:cs,F:ss,FF:is,FFF:ls,FFFF:us};class ti{static create(e,t={}){return new ti(e,t)}static parseFormat(e){let t=null,r="",s=!1;const n=[];for(let i=0;i<e.length;i++){const o=e.charAt(i);"'"===o?((r.length>0||s)&&n.push({literal:s||/^\s+$/.test(r),val:""===r?"'":r}),t=null,r="",s=!s):s||o===t?r+=o:(r.length>0&&n.push({literal:/^\s+$/.test(r),val:r}),r=o,t=o)}return r.length>0&&n.push({literal:s||/^\s+$/.test(r),val:r}),n}static macroTokenToFormatOpts(e){return ei[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0,r=void 0){if(this.opts.forceSimple)return bn(e,t);const s={...this.opts};return t>0&&(s.padTo=t),r&&(s.signDisplay=r),this.loc.numberFormatter(s).format(e)}formatDateTimeFromString(e,t){const r="en"===this.loc.listingMode(),s=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,n=(t,r)=>this.loc.extract(e,t,r),i=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",o=()=>r?function(e){return Gn[e.hour<12?0:1]}(e):n({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(t,s)=>r?function(e,t){return Un(t)[e.month-1]}(e,t):n(s?{month:t}:{month:t,day:"numeric"},"month"),l=(t,s)=>r?function(e,t){return qn(t)[e.weekday-1]}(e,t):n(s?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),c=t=>{const r=ti.macroTokenToFormatOpts(t);return r?this.formatWithSystemDefault(e,r):t},u=t=>r?function(e,t){return Qn(t)[e.year<0?0:1]}(e,t):n({era:t},"era");return Xn(ti.parseFormat(t),t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return i({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return i({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return i({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return o();case"d":return s?n({day:"numeric"},"day"):this.num(e.day);case"dd":return s?n({day:"2-digit"},"day"):this.num(e.day,2);case"c":case"E":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return s?n({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?n({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return s?n({month:"numeric"},"month"):this.num(e.month);case"MM":return s?n({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return s?n({year:"numeric"},"year"):this.num(e.year);case"yy":return s?n({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?n({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?n({year:"numeric"},"year"):this.num(e.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return c(t)}})}formatDurationFromString(e,t){const r="negativeLargestOnly"===this.opts.signMode?-1:1,s=e=>{switch(e[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},n=ti.parseFormat(t),i=n.reduce((e,{literal:t,val:r})=>t?e:e.concat(r),[]),o=e.shiftTo(...i.map(s).filter(e=>e));return Xn(n,((e,t)=>n=>{const i=s(n);if(i){const s=t.isNegativeDuration&&i!==t.largestUnit?r:1;let o;return o="negativeLargestOnly"===this.opts.signMode&&i!==t.largestUnit?"never":"all"===this.opts.signMode?"always":"auto",this.num(e.get(i)*s,n.length,o)}return n})(o,{isNegativeDuration:o<0,largestUnit:Object.keys(o.values)[0]}))}}const ri=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function si(...e){const t=e.reduce((e,t)=>e+t.source,"");return RegExp(`^${t}$`)}function ni(...e){return t=>e.reduce(([e,r,s],n)=>{const[i,o,a]=n(t,s);return[{...e,...i},o||r,a]},[{},null,1]).slice(0,2)}function ii(e,...t){if(null==e)return[null,null];for(const[r,s]of t){const t=r.exec(e);if(t)return s(t)}return[null,null]}function oi(...e){return(t,r)=>{const s={};let n;for(n=0;n<e.length;n++)s[e[n]]=Tn(t[r+n]);return[s,null,r+n]}}const ai=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,li=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,ci=RegExp(`${li.source}${`(?:${ai.source}?(?:\\[(${ri.source})\\])?)?`}`),ui=RegExp(`(?:[Tt]${ci.source})?`),hi=oi("weekYear","weekNumber","weekDay"),di=oi("year","ordinal"),fi=RegExp(`${li.source} ?(?:${ai.source}|(${ri.source}))?`),pi=RegExp(`(?: ${fi.source})?`);function mi(e,t,r){const s=e[t];return fn(s)?r:Tn(s)}function gi(e,t){return[{hours:mi(e,t,0),minutes:mi(e,t+1,0),seconds:mi(e,t+2,0),milliseconds:kn(e[t+3])},null,t+4]}function yi(e,t){const r=!e[t]&&!e[t+1],s=Rn(e[t+1],e[t+2]);return[{},r?null:Ls.instance(s),t+3]}function vi(e,t){return[{},e[t]?ys.create(e[t]):null,t+1]}const wi=RegExp(`^T?${li.source}$`),Ei=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Si(e){const[t,r,s,n,i,o,a,l,c]=e,u="-"===t[0],h=l&&"-"===l[0],d=(e,t=!1)=>void 0!==e&&(t||e&&u)?-e:e;return[{years:d(On(r)),months:d(On(s)),weeks:d(On(n)),days:d(On(i)),hours:d(On(o)),minutes:d(On(a)),seconds:d(On(l),"-0"===l),milliseconds:d(kn(c),h)}]}const bi={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ti(e,t,r,s,n,i,o){const a={year:2===t.length?Pn(Tn(t)):Tn(t),month:jn.indexOf(r)+1,day:Tn(s),hour:Tn(n),minute:Tn(i)};return o&&(a.second=Tn(o)),e&&(a.weekday=e.length>3?Wn.indexOf(e)+1:Bn.indexOf(e)+1),a}const Oi=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function ki(e){const[,t,r,s,n,i,o,a,l,c,u,h]=e,d=Ti(t,n,s,r,i,o,a);let f;return f=l?bi[l]:c?0:Rn(u,h),[d,new Ls(f)]}const xi=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Ci=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,_i=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Ai(e){const[,t,r,s,n,i,o,a]=e;return[Ti(t,n,s,r,i,o,a),Ls.utcInstance]}function Fi(e){const[,t,r,s,n,i,o,a]=e;return[Ti(t,a,r,s,n,i,o),Ls.utcInstance]}const $i=si(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,ui),Ni=si(/(\d{4})-?W(\d\d)(?:-?(\d))?/,ui),Pi=si(/(\d{4})-?(\d{3})/,ui),Li=si(ci),Ri=ni(function(e,t){return[{year:mi(e,t),month:mi(e,t+1,1),day:mi(e,t+2,1)},null,t+3]},gi,yi,vi),Mi=ni(hi,gi,yi,vi),Di=ni(di,gi,yi,vi),zi=ni(gi,yi,vi);const Ii=ni(gi);const Hi=si(/(\d{4})-(\d\d)-(\d\d)/,pi),ji=si(fi),Vi=ni(gi,yi,vi);const Ui="Invalid Duration",Wi={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},Bi={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...Wi},Zi=365.2425,qi=30.436875,Gi={years:{quarters:4,months:12,weeks:52.1775,days:Zi,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:qi,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...Wi},Ji=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Yi=Ji.slice(0).reverse();function Ki(e,t,r=!1){const s={values:r?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new to(s)}function Qi(e,t){let r=t.milliseconds??0;for(const s of Yi.slice(1))t[s]&&(r+=t[s]*e[s].milliseconds);return r}function Xi(e,t){const r=Qi(e,t)<0?-1:1;Ji.reduceRight((s,n)=>{if(fn(t[n]))return s;if(s){const i=t[s]*r,o=e[n][s],a=Math.floor(i/o);t[n]+=a*r,t[s]-=a*o*r}return n},null),Ji.reduce((r,s)=>{if(fn(t[s]))return r;if(r){const n=t[r]%1;t[r]-=n,t[s]+=n*e[r][s]}return s},null)}function eo(e){const t={};for(const[r,s]of Object.entries(e))0!==s&&(t[r]=s);return t}class to{constructor(e){const t="longterm"===e.conversionAccuracy||!1;let r=t?Gi:Bi;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||Ns.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,t){return to.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(null==e||"object"!=typeof e)throw new zr("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new to({values:Dn(e,to.normalizeUnit),loc:Ns.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(pn(e))return to.fromMillis(e);if(to.isDuration(e))return e;if("object"==typeof e)return to.fromObject(e);throw new zr(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[r]=ii(e,[Ei,Si]);return r?to.fromObject(r,t):to.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[r]=ii(e,[wi,Ii]);return r?to.fromObject(r,t):to.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new zr("need to specify a reason the Duration is invalid");const r=e instanceof Ks?e:new Ks(e,t);if(Ys.throwOnInvalid)throw new Rr(r);return new to({invalid:r})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new Dr(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const r={...t,floor:!1!==t.round&&!1!==t.floor};return this.isValid?ti.create(this.loc,r).formatDurationFromString(this,e):Ui}toHuman(e={}){if(!this.isValid)return Ui;const t=!1!==e.showZeros,r=Ji.map(r=>{const s=this.values[r];return fn(s)||0===s&&!t?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:r.slice(0,-1)}).format(s)}).filter(e=>e);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=xn(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1};return Jo.fromMillis(t,{zone:"UTC"}).toISOTime(e)}toJSON(){return this.toISO()}toString(){return this.toISO()}[/* @__PURE__ */Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Qi(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=to.fromDurationLike(e),r={};for(const s of Ji)(wn(t.values,s)||wn(this.values,s))&&(r[s]=t.get(s)+this.get(s));return Ki(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const t=to.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const r of Object.keys(this.values))t[r]=Mn(e(this.values[r],r));return Ki(this,{values:t},!0)}get(e){return this[to.normalizeUnit(e)]}set(e){if(!this.isValid)return this;return Ki(this,{values:{...this.values,...Dn(e,to.normalizeUnit)}})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:r,matrix:s}={}){return Ki(this,{loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:s,conversionAccuracy:r})}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Xi(this.matrix,e),Ki(this,{values:e},!0)}rescale(){if(!this.isValid)return this;return Ki(this,{values:eo(this.normalize().shiftToAll().toObject())},!0)}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map(e=>to.normalizeUnit(e));const t={},r={},s=this.toObject();let n;for(const i of Ji)if(e.indexOf(i)>=0){n=i;let e=0;for(const t in r)e+=this.matrix[t][i]*r[t],r[t]=0;pn(s[i])&&(e+=s[i]);const o=Math.trunc(e);t[i]=o,r[i]=(1e3*e-1e3*o)/1e3}else pn(s[i])&&(r[i]=s[i]);for(const i in r)0!==r[i]&&(t[n]+=i===n?r[i]:r[i]/this.matrix[n][i]);return Xi(this.matrix,t),Ki(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=0===this.values[t]?0:-this.values[t];return Ki(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;return Ki(this,{values:eo(this.values)},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;function t(e,t){return void 0===e||0===e?void 0===t||0===t:e===t}for(const r of Ji)if(!t(this.values[r],e.values[r]))return!1;return!0}}const ro="Invalid Interval";class so{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new zr("need to specify a reason the Interval is invalid");const r=e instanceof Ks?e:new Ks(e,t);if(Ys.throwOnInvalid)throw new Lr(r);return new so({invalid:r})}static fromDateTimes(e,t){const r=Yo(e),s=Yo(t),n=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?so.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null:so.invalid("missing or invalid end"):so.invalid("missing or invalid start")}(r,s);return null==n?new so({start:r,end:s}):n}static after(e,t){const r=to.fromDurationLike(t),s=Yo(e);return so.fromDateTimes(s,s.plus(r))}static before(e,t){const r=to.fromDurationLike(t),s=Yo(e);return so.fromDateTimes(s.minus(r),s)}static fromISO(e,t){const[r,s]=(e||"").split("/",2);if(r&&s){let e,i,o,a;try{e=Jo.fromISO(r,t),i=e.isValid}catch(n){i=!1}try{o=Jo.fromISO(s,t),a=o.isValid}catch(n){a=!1}if(i&&a)return so.fromDateTimes(e,o);if(i){const r=to.fromISO(s,t);if(r.isValid)return so.after(e,r)}else if(a){const e=to.fromISO(r,t);if(e.isValid)return so.before(o,e)}}return so.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return null===this.invalidReason}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",t){if(!this.isValid)return NaN;const r=this.start.startOf(e,t);let s;return s=t?.useLocaleWeeks?this.end.reconfigure({locale:r.locale}):this.end,s=s.startOf(e,t),Math.floor(s.diff(r,e).get(e))+(s.valueOf()!==this.end.valueOf())}hasSame(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return!!this.isValid&&this.s>e}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&(this.s<=e&&this.e>e)}set({start:e,end:t}={}){return this.isValid?so.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Yo).filter(e=>this.contains(e)).sort((e,t)=>e.toMillis()-t.toMillis()),r=[];let{s:s}=this,n=0;for(;s<this.e;){const e=t[n]||this.e,i=+e>+this.e?this.e:e;r.push(so.fromDateTimes(s,i)),s=i,n+=1}return r}splitBy(e){const t=to.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let r,{s:s}=this,n=1;const i=[];for(;s<this.e;){const e=this.start.plus(t.mapUnits(e=>e*n));r=+e>+this.e?this.e:e,i.push(so.fromDateTimes(s,r)),s=r,n+=1}return i}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return!!this.isValid&&+this.e===+e.s}abutsEnd(e){return!!this.isValid&&+e.e===+this.s}engulfs(e){return!!this.isValid&&(this.s<=e.s&&this.e>=e.e)}equals(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return t>=r?null:so.fromDateTimes(t,r)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return so.fromDateTimes(t,r)}static merge(e){const[t,r]=e.sort((e,t)=>e.s-t.s).reduce(([e,t],r)=>t?t.overlaps(r)||t.abutsStart(r)?[e,t.union(r)]:[e.concat([t]),r]:[e,r],[[],null]);return r&&t.push(r),t}static xor(e){let t=null,r=0;const s=[],n=e.map(e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}]),i=Array.prototype.concat(...n).sort((e,t)=>e.time-t.time);for(const o of i)r+="s"===o.type?1:-1,1===r?t=o.time:(t&&+t!==+o.time&&s.push(so.fromDateTimes(t,o.time)),t=null);return so.merge(s)}difference(...e){return so.xor([this].concat(e)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:ro}[/* @__PURE__ */Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=Ur,t={}){return this.isValid?ti.create(this.s.loc.clone(t),e).formatInterval(this):ro}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:ro}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:ro}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:ro}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:ro}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):to.invalid(this.invalidReason)}mapEndpoints(e){return so.fromDateTimes(e(this.s),e(this.e))}}class no{static hasDST(e=Ys.defaultZone){const t=Jo.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return ys.isValidZone(e)}static normalizeZone(e){return Ms(e,Ys.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||Ns.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||Ns.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||Ns.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:r=null,locObj:s=null,outputCalendar:n="gregory"}={}){return(s||Ns.create(t,r,n)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:s=null,outputCalendar:n="gregory"}={}){return(s||Ns.create(t,r,n)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:r=null,locObj:s=null}={}){return(s||Ns.create(t,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:s=null}={}){return(s||Ns.create(t,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Ns.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Ns.create(t,null,"gregory").eras(e)}static features(){return{relative:gn(),localeWeek:yn()}}}function io(e,t){const r=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),s=r(t)-r(e);return Math.floor(to.fromMillis(s).as("days"))}function oo(e,t,r,s){let[n,i,o,a]=function(e,t,r){const s=[["years",(e,t)=>t.year-e.year],["quarters",(e,t)=>t.quarter-e.quarter+4*(t.year-e.year)],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const r=io(e,t);return(r-r%7)/7}],["days",io]],n={},i=e;let o,a;for(const[l,c]of s)r.indexOf(l)>=0&&(o=l,n[l]=c(e,t),a=i.plus(n),a>t?(n[l]--,(e=i.plus(n))>t&&(a=e,n[l]--,e=i.plus(n))):e=a);return[e,n,a,o]}(e,t,r);const l=t-n,c=r.filter(e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0);0===c.length&&(o<t&&(o=n.plus({[a]:1})),o!==n&&(i[a]=(i[a]||0)+l/(o-n)));const u=to.fromObject(i,s);return c.length>0?to.fromMillis(l,s).shiftTo(...c).plus(u):u}function ao(e,t=e=>e){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let r=0;r<e.length;r++){const s=e.charCodeAt(r);if(-1!==e[r].search(Ds.hanidec))t+=Is.indexOf(e[r]);else for(const e in zs){const[r,n]=zs[e];s>=r&&s<=n&&(t+=s-r)}}return parseInt(t,10)}return t}(e))}}const lo=`[ ${String.fromCharCode(160)}]`,co=new RegExp(lo,"g");function uo(e){return e.replace(/\./g,"\\.?").replace(co,lo)}function ho(e){return e.replace(/\./g,"").replace(co," ").toLowerCase()}function fo(e,t){return null===e?null:{regex:RegExp(e.map(uo).join("|")),deser:([r])=>e.findIndex(e=>ho(r)===ho(e))+t}}function po(e,t){return{regex:e,deser:([,e,t])=>Rn(e,t),groups:t}}function mo(e){return{regex:e,deser:([e])=>e}}const go={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};let yo=null;function vo(e,t){return Array.prototype.concat(...e.map(e=>function(e,t){if(e.literal)return e;const r=So(ti.macroTokenToFormatOpts(e.val),t);return null==r||r.includes(void 0)?e:r}(e,t)))}class wo{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=vo(ti.parseFormat(t),e),this.units=this.tokens.map(t=>function(e,t){const r=js(t),s=js(t,"{2}"),n=js(t,"{3}"),i=js(t,"{4}"),o=js(t,"{6}"),a=js(t,"{1,2}"),l=js(t,"{1,3}"),c=js(t,"{1,6}"),u=js(t,"{1,9}"),h=js(t,"{2,4}"),d=js(t,"{4,6}"),f=e=>{return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([e])=>e,literal:!0};var t},p=(p=>{if(e.literal)return f(p);switch(p.val){case"G":return fo(t.eras("short"),0);case"GG":return fo(t.eras("long"),0);case"y":return ao(c);case"yy":case"kk":return ao(h,Pn);case"yyyy":case"kkkk":return ao(i);case"yyyyy":return ao(d);case"yyyyyy":return ao(o);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return ao(a);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return ao(s);case"MMM":return fo(t.months("short",!0),1);case"MMMM":return fo(t.months("long",!0),1);case"LLL":return fo(t.months("short",!1),1);case"LLLL":return fo(t.months("long",!1),1);case"o":case"S":return ao(l);case"ooo":case"SSS":return ao(n);case"u":return mo(u);case"uu":return mo(a);case"uuu":case"E":case"c":return ao(r);case"a":return fo(t.meridiems(),0);case"EEE":return fo(t.weekdays("short",!1),1);case"EEEE":return fo(t.weekdays("long",!1),1);case"ccc":return fo(t.weekdays("short",!0),1);case"cccc":return fo(t.weekdays("long",!0),1);case"Z":case"ZZ":return po(new RegExp(`([+-]${a.source})(?::(${s.source}))?`),2);case"ZZZ":return po(new RegExp(`([+-]${a.source})(${s.source})?`),2);case"z":return mo(/[a-z_+-/]{1,256}?/i);case" ":return mo(/[^\S\n\r]/);default:return f(p)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return p.token=e,p}(t,e)),this.disqualifyingUnit=this.units.find(e=>e.invalidReason),!this.disqualifyingUnit){const[e,t]=[`^${(r=this.units).map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,"")}$`,r];this.regex=RegExp(e,"i"),this.handlers=t}var r}explainFromTokens(e){if(this.isValid){const[t,r]=function(e,t,r){const s=e.match(t);if(s){const e={};let t=1;for(const n in r)if(wn(r,n)){const i=r[n],o=i.groups?i.groups+1:1;!i.literal&&i.token&&(e[i.token.val[0]]=i.deser(s.slice(t,t+o))),t+=o}return[s,e]}return[s,{}]}(e,this.regex,this.handlers),[s,n,i]=r?function(e){let t,r=null;return fn(e.z)||(r=ys.create(e.z)),fn(e.Z)||(r||(r=new Ls(e.Z)),t=e.Z),fn(e.q)||(e.M=3*(e.q-1)+1),fn(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),fn(e.u)||(e.S=kn(e.u)),[Object.keys(e).reduce((t,r)=>{const s=(e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(r);return s&&(t[s]=e[r]),t},{}),r,t]}(r):[null,null,void 0];if(wn(r,"a")&&wn(r,"H"))throw new Mr("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:r,result:s,zone:n,specificOffset:i}}return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function Eo(e,t,r){return new wo(e,r).explainFromTokens(t)}function So(e,t){if(!e)return null;const r=ti.create(t,e).dtFormatter((yo||(yo=Jo.fromMillis(1555555555555)),yo)),s=r.formatToParts(),n=r.resolvedOptions();return s.map(t=>function(e,t,r){const{type:s,value:n}=e;if("literal"===s){const e=/^\s+$/.test(n);return{literal:!e,val:e?" ":n}}const i=t[s];let o=s;"hour"===s&&(o=null!=t.hour12?t.hour12?"hour12":"hour24":null!=t.hourCycle?"h11"===t.hourCycle||"h12"===t.hourCycle?"hour12":"hour24":r.hour12?"hour12":"hour24");let a=go[o];if("object"==typeof a&&(a=a[i]),a)return{literal:!1,val:a}}(t,e,n))}const bo="Invalid DateTime",To=864e13;function Oo(e){return new Ks("unsupported zone",`the zone "${e.name}" is not supported`)}function ko(e){return null===e.weekData&&(e.weekData=on(e.c)),e.weekData}function xo(e){return null===e.localWeekData&&(e.localWeekData=on(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Co(e,t){const r={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Jo({...r,...t,old:r})}function _o(e,t,r){let s=e-60*t*1e3;const n=r.offset(s);if(t===n)return[s,t];s-=60*(n-t)*1e3;const i=r.offset(s);return n===i?[s,n]:[e-60*Math.min(n,i)*1e3,Math.max(n,i)]}function Ao(e,t){const r=new Date(e+=60*t*1e3);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function Fo(e,t,r){return _o(Fn(e),t,r)}function $o(e,t){const r=e.o,s=e.c.year+Math.trunc(t.years),n=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),i={...e.c,year:s,month:n,day:Math.min(e.c.day,An(s,n))+Math.trunc(t.days)+7*Math.trunc(t.weeks)},o=to.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=Fn(i);let[l,c]=_o(a,r,e.zone);return 0!==o&&(l+=o,c=e.zone.offset(l)),{ts:l,o:c}}function No(e,t,r,s,n,i){const{setZone:o,zone:a}=r;if(e&&0!==Object.keys(e).length||t){const s=t||a,n=Jo.fromObject(e,{...r,zone:s,specificOffset:i});return o?n:n.setZone(a)}return Jo.invalid(new Ks("unparsable",`the input "${n}" can't be parsed as ${s}`))}function Po(e,t,r=!0){return e.isValid?ti.create(Ns.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(e,t):null}function Lo(e,t,r){const s=e.c.year>9999||e.c.year<0;let n="";if(s&&e.c.year>=0&&(n+="+"),n+=bn(e.c.year,s?6:4),"year"===r)return n;if(t){if(n+="-",n+=bn(e.c.month),"month"===r)return n;n+="-"}else if(n+=bn(e.c.month),"month"===r)return n;return n+=bn(e.c.day),n}function Ro(e,t,r,s,n,i,o){let a=!r||0!==e.c.millisecond||0!==e.c.second,l="";switch(o){case"day":case"month":case"year":break;default:if(l+=bn(e.c.hour),"hour"===o)break;if(t){if(l+=":",l+=bn(e.c.minute),"minute"===o)break;a&&(l+=":",l+=bn(e.c.second))}else{if(l+=bn(e.c.minute),"minute"===o)break;a&&(l+=bn(e.c.second))}if("second"===o)break;!a||s&&0===e.c.millisecond||(l+=".",l+=bn(e.c.millisecond,3))}return n&&(e.isOffsetFixed&&0===e.offset&&!i?l+="Z":e.o<0?(l+="-",l+=bn(Math.trunc(-e.o/60)),l+=":",l+=bn(Math.trunc(-e.o%60))):(l+="+",l+=bn(Math.trunc(e.o/60)),l+=":",l+=bn(Math.trunc(e.o%60)))),i&&(l+="["+e.zone.ianaName+"]"),l}const Mo={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Do={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},zo={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Io=["year","month","day","hour","minute","second","millisecond"],Ho=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],jo=["year","ordinal","hour","minute","second","millisecond"];function Vo(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new Dr(e);return t}function Uo(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Vo(e)}}function Wo(e,t){const r=Ms(t.zone,Ys.defaultZone);if(!r.isValid)return Jo.invalid(Oo(r));const s=Ns.fromObject(t);let n,i;if(fn(e.year))n=Ys.now();else{for(const r of Io)fn(e[r])&&(e[r]=Mo[r]);const t=hn(e)||dn(e);if(t)return Jo.invalid(t);const s=function(e){if(void 0===qo&&(qo=Ys.now()),"iana"!==e.type)return e.offset(qo);const t=e.name;let r=Go.get(t);return void 0===r&&(r=e.offset(qo),Go.set(t,r)),r}(r);[n,i]=Fo(e,s,r)}return new Jo({ts:n,zone:r,loc:s,o:i})}function Bo(e,t,r){const s=!!fn(r.round)||r.round,n=fn(r.rounding)?"trunc":r.rounding,i=(e,i)=>{e=xn(e,s||r.calendary?0:2,r.calendary?"round":n);return t.loc.clone(r).relFormatter(r).format(e,i)},o=s=>r.calendary?t.hasSame(e,s)?0:t.startOf(s).diff(e.startOf(s),s).get(s):t.diff(e,s).get(s);if(r.unit)return i(o(r.unit),r.unit);for(const a of r.units){const e=o(a);if(Math.abs(e)>=1)return i(e,a)}return i(e>t?-0:0,r.units[r.units.length-1])}function Zo(e){let t,r={};return e.length>0&&"object"==typeof e[e.length-1]?(r=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[r,t]}let qo;const Go=/* @__PURE__ */new Map;class Jo{constructor(e){const t=e.zone||Ys.defaultZone;let r=e.invalid||(Number.isNaN(e.ts)?new Ks("invalid input"):null)||(t.isValid?null:Oo(t));this.ts=fn(e.ts)?Ys.now():e.ts;let s=null,n=null;if(!r){if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[s,n]=[e.old.c,e.old.o];else{const i=pn(e.o)&&!e.old?e.o:t.offset(this.ts);s=Ao(this.ts,i),r=Number.isNaN(s.year)?new Ks("invalid input"):null,s=r?null:s,n=r?null:i}}this._zone=t,this.loc=e.loc||Ns.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=s,this.o=n,this.isLuxonDateTime=!0}static now(){return new Jo({})}static local(){const[e,t]=Zo(arguments),[r,s,n,i,o,a,l]=t;return Wo({year:r,month:s,day:n,hour:i,minute:o,second:a,millisecond:l},e)}static utc(){const[e,t]=Zo(arguments),[r,s,n,i,o,a,l]=t;return e.zone=Ls.utcInstance,Wo({year:r,month:s,day:n,hour:i,minute:o,second:a,millisecond:l},e)}static fromJSDate(e,t={}){const r=(s=e,"[object Date]"===Object.prototype.toString.call(s)?e.valueOf():NaN);var s;if(Number.isNaN(r))return Jo.invalid("invalid input");const n=Ms(t.zone,Ys.defaultZone);return n.isValid?new Jo({ts:r,zone:n,loc:Ns.fromObject(t)}):Jo.invalid(Oo(n))}static fromMillis(e,t={}){if(pn(e))return e<-To||e>To?Jo.invalid("Timestamp out of range"):new Jo({ts:e,zone:Ms(t.zone,Ys.defaultZone),loc:Ns.fromObject(t)});throw new zr(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(pn(e))return new Jo({ts:1e3*e,zone:Ms(t.zone,Ys.defaultZone),loc:Ns.fromObject(t)});throw new zr("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const r=Ms(t.zone,Ys.defaultZone);if(!r.isValid)return Jo.invalid(Oo(r));const s=Ns.fromObject(t),n=Dn(e,Uo),{minDaysInFirstWeek:i,startOfWeek:o}=un(n,s),a=Ys.now(),l=fn(t.specificOffset)?r.offset(a):t.specificOffset,c=!fn(n.ordinal),u=!fn(n.year),h=!fn(n.month)||!fn(n.day),d=u||h,f=n.weekYear||n.weekNumber;if((d||c)&&f)throw new Mr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&c)throw new Mr("Can't mix ordinal dates with month/day");const p=f||n.weekday&&!d;let m,g,y=Ao(a,l);p?(m=Ho,g=Do,y=on(y,i,o)):c?(m=jo,g=zo,y=ln(y)):(m=Io,g=Mo);let v=!1;for(const k of m){fn(n[k])?n[k]=v?g[k]:y[k]:v=!0}const w=p?function(e,t=4,r=1){const s=mn(e.weekYear),n=Sn(e.weekNumber,1,Nn(e.weekYear,t,r)),i=Sn(e.weekday,1,7);return s?n?!i&&en("weekday",e.weekday):en("week",e.weekNumber):en("weekYear",e.weekYear)}(n,i,o):c?function(e){const t=mn(e.year),r=Sn(e.ordinal,1,_n(e.year));return t?!r&&en("ordinal",e.ordinal):en("year",e.year)}(n):hn(n),E=w||dn(n);if(E)return Jo.invalid(E);const S=p?an(n,i,o):c?cn(n):n,[b,T]=Fo(S,l,r),O=new Jo({ts:b,zone:r,o:T,loc:s});return n.weekday&&d&&e.weekday!==O.weekday?Jo.invalid("mismatched weekday",`you can't specify both a weekday of ${n.weekday} and a date of ${O.toISO()}`):O.isValid?O:Jo.invalid(O.invalid)}static fromISO(e,t={}){const[r,s]=ii(e,[$i,Ri],[Ni,Mi],[Pi,Di],[Li,zi]);return No(r,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[r,s]=ii(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[Oi,ki]);return No(r,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[r,s]=ii(e,[xi,Ai],[Ci,Ai],[_i,Fi]);return No(r,s,t,"HTTP",t)}static fromFormat(e,t,r={}){if(fn(e)||fn(t))throw new zr("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:n=null}=r,i=Ns.fromOpts({locale:s,numberingSystem:n,defaultToEN:!0}),[o,a,l,c]=function(e,t,r){const{result:s,zone:n,specificOffset:i,invalidReason:o}=Eo(e,t,r);return[s,n,i,o]}(i,e,t);return c?Jo.invalid(c):No(o,a,r,`format ${t}`,e,l)}static fromString(e,t,r={}){return Jo.fromFormat(e,t,r)}static fromSQL(e,t={}){const[r,s]=ii(e,[Hi,Ri],[ji,Vi]);return No(r,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new zr("need to specify a reason the DateTime is invalid");const r=e instanceof Ks?e:new Ks(e,t);if(Ys.throwOnInvalid)throw new Pr(r);return new Jo({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const r=So(e,Ns.fromObject(t));return r?r.map(e=>e?e.val:null).join(""):null}static expandFormat(e,t={}){return vo(ti.parseFormat(e),Ns.fromObject(t)).map(e=>e.val).join("")}static resetCache(){qo=void 0,Go.clear()}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?ko(this).weekYear:NaN}get weekNumber(){return this.isValid?ko(this).weekNumber:NaN}get weekday(){return this.isValid?ko(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?xo(this).weekday:NaN}get localWeekNumber(){return this.isValid?xo(this).weekNumber:NaN}get localWeekYear(){return this.isValid?xo(this).weekYear:NaN}get ordinal(){return this.isValid?ln(this.c).ordinal:NaN}get monthShort(){return this.isValid?no.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?no.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?no.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?no.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,r=Fn(this.c),s=this.zone.offset(r-e),n=this.zone.offset(r+e),i=this.zone.offset(r-s*t),o=this.zone.offset(r-n*t);if(i===o)return[this];const a=r-i*t,l=r-o*t,c=Ao(a,i),u=Ao(l,o);return c.hour===u.hour&&c.minute===u.minute&&c.second===u.second&&c.millisecond===u.millisecond?[Co(this,{ts:a}),Co(this,{ts:l})]:[this]}get isInLeapYear(){return Cn(this.year)}get daysInMonth(){return An(this.year,this.month)}get daysInYear(){return this.isValid?_n(this.year):NaN}get weeksInWeekYear(){return this.isValid?Nn(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Nn(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:r,calendar:s}=ti.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:r,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(Ls.instance(e),t)}toLocal(){return this.setZone(Ys.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:r=!1}={}){if((e=Ms(e,Ys.defaultZone)).equals(this.zone))return this;if(e.isValid){let s=this.ts;if(t||r){const t=e.offset(this.ts),r=this.toObject();[s]=Fo(r,t,e)}return Co(this,{ts:s,zone:e})}return Jo.invalid(Oo(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:r}={}){return Co(this,{loc:this.loc.clone({locale:e,numberingSystem:t,outputCalendar:r})})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=Dn(e,Uo),{minDaysInFirstWeek:r,startOfWeek:s}=un(t,this.loc),n=!fn(t.weekYear)||!fn(t.weekNumber)||!fn(t.weekday),i=!fn(t.ordinal),o=!fn(t.year),a=!fn(t.month)||!fn(t.day),l=o||a,c=t.weekYear||t.weekNumber;if((l||i)&&c)throw new Mr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&i)throw new Mr("Can't mix ordinal dates with month/day");let u;n?u=an({...on(this.c,r,s),...t},r,s):fn(t.ordinal)?(u={...this.toObject(),...t},fn(t.day)&&(u.day=Math.min(An(u.year,u.month),u.day))):u=cn({...ln(this.c),...t});const[h,d]=Fo(u,this.o,this.zone);return Co(this,{ts:h,o:d})}plus(e){if(!this.isValid)return this;return Co(this,$o(this,to.fromDurationLike(e)))}minus(e){if(!this.isValid)return this;return Co(this,$o(this,to.fromDurationLike(e).negate()))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const r={},s=to.normalizeUnit(e);switch(s){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0}if("weeks"===s)if(t){const e=this.loc.getStartOfWeek(),{weekday:t}=this;t<e&&(r.weekNumber=this.weekNumber-1),r.weekday=e}else r.weekday=1;if("quarters"===s){const e=Math.ceil(this.month/3);r.month=3*(e-1)+1}return this.set(r)}endOf(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?ti.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):bo}toLocaleString(e=Ur,t={}){return this.isValid?ti.create(this.loc.clone(t),e).formatDateTime(this):bo}toLocaleParts(e={}){return this.isValid?ti.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:r=!1,includeOffset:s=!0,extendedZone:n=!1,precision:i="milliseconds"}={}){if(!this.isValid)return null;const o="extended"===e;let a=Lo(this,o,i=Vo(i));return Io.indexOf(i)>=3&&(a+="T"),a+=Ro(this,o,t,r,s,n,i),a}toISODate({format:e="extended",precision:t="day"}={}){return this.isValid?Lo(this,"extended"===e,Vo(t)):null}toISOWeekDate(){return Po(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:r=!0,includePrefix:s=!1,extendedZone:n=!1,format:i="extended",precision:o="milliseconds"}={}){if(!this.isValid)return null;return o=Vo(o),(s&&Io.indexOf(o)>=3?"T":"")+Ro(this,"extended"===i,t,e,r,n,o)}toRFC2822(){return Po(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Po(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Lo(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:r=!0}={}){let s="HH:mm:ss.SSS";return(t||e)&&(r&&(s+=" "),t?s+="z":e&&(s+="ZZ")),Po(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():bo}[/* @__PURE__ */Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",r={}){if(!this.isValid||!e.isValid)return to.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...r},n=(a=t,Array.isArray(a)?a:[a]).map(to.normalizeUnit),i=e.valueOf()>this.valueOf(),o=oo(i?this:e,i?e:this,n,s);var a;return i?o.negate():o}diffNow(e="milliseconds",t={}){return this.diff(Jo.now(),e,t)}until(e){return this.isValid?so.fromDateTimes(this,e):this}hasSame(e,t,r){if(!this.isValid)return!1;const s=e.valueOf(),n=this.setZone(e.zone,{keepLocalTime:!0});return n.startOf(t,r)<=s&&s<=n.endOf(t,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Jo.fromObject({},{zone:this.zone}),r=e.padding?this<t?-e.padding:e.padding:0;let s=["years","months","days","hours","minutes","seconds"],n=e.unit;return Array.isArray(e.unit)&&(s=e.unit,n=void 0),Bo(t,this.plus(r),{...e,numeric:"always",units:s,unit:n})}toRelativeCalendar(e={}){return this.isValid?Bo(e.base||Jo.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(Jo.isDateTime))throw new zr("min requires all arguments be DateTimes");return vn(e,e=>e.valueOf(),Math.min)}static max(...e){if(!e.every(Jo.isDateTime))throw new zr("max requires all arguments be DateTimes");return vn(e,e=>e.valueOf(),Math.max)}static fromFormatExplain(e,t,r={}){const{locale:s=null,numberingSystem:n=null}=r;return Eo(Ns.fromOpts({locale:s,numberingSystem:n,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,r={}){return Jo.fromFormatExplain(e,t,r)}static buildFormatParser(e,t={}){const{locale:r=null,numberingSystem:s=null}=t,n=Ns.fromOpts({locale:r,numberingSystem:s,defaultToEN:!0});return new wo(n,e)}static fromFormatParser(e,t,r={}){if(fn(e)||fn(t))throw new zr("fromFormatParser requires an input string and a format parser");const{locale:s=null,numberingSystem:n=null}=r,i=Ns.fromOpts({locale:s,numberingSystem:n,defaultToEN:!0});if(!i.equals(t.locale))throw new zr(`fromFormatParser called with a locale of ${i}, but the format parser was created for ${t.locale}`);const{result:o,zone:a,specificOffset:l,invalidReason:c}=t.explainFromTokens(e);return c?Jo.invalid(c):No(o,a,r,`format ${t.format}`,e,l)}static get DATE_SHORT(){return Ur}static get DATE_MED(){return Wr}static get DATE_MED_WITH_WEEKDAY(){return Br}static get DATE_FULL(){return Zr}static get DATE_HUGE(){return qr}static get TIME_SIMPLE(){return Gr}static get TIME_WITH_SECONDS(){return Jr}static get TIME_WITH_SHORT_OFFSET(){return Yr}static get TIME_WITH_LONG_OFFSET(){return Kr}static get TIME_24_SIMPLE(){return Qr}static get TIME_24_WITH_SECONDS(){return Xr}static get TIME_24_WITH_SHORT_OFFSET(){return es}static get TIME_24_WITH_LONG_OFFSET(){return ts}static get DATETIME_SHORT(){return rs}static get DATETIME_SHORT_WITH_SECONDS(){return ss}static get DATETIME_MED(){return ns}static get DATETIME_MED_WITH_SECONDS(){return is}static get DATETIME_MED_WITH_WEEKDAY(){return os}static get DATETIME_FULL(){return as}static get DATETIME_FULL_WITH_SECONDS(){return ls}static get DATETIME_HUGE(){return cs}static get DATETIME_HUGE_WITH_SECONDS(){return us}}function Yo(e){if(Jo.isDateTime(e))return e;if(e&&e.valueOf&&pn(e.valueOf()))return Jo.fromJSDate(e);if(e&&"object"==typeof e)return Jo.fromObject(e);throw new zr(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const Ko=class e{constructor(){}static constructFromServiceResolver(){return new e}onEvent(t){if(t.getIdentifier()!==e.eventListenerTarget)return;const r=t.getNormalizedValue();if(!(r instanceof Date))return;const s=Jo.fromJSDate(r).toFormat("yyyy-MM-dd'T'HH:mm:ssZZ");t.setRawValue(s),t.stopPropagation()}};Ko.eventListenerTarget=r.NormalizedValueToRawValueEvent,Ko.priority=50;let Qo=Ko;const Xo=class e{constructor(){}static constructFromServiceResolver(){return new e}onEvent(t){if(t.getIdentifier()!==e.eventListenerTarget)return;const r=t.getRawValue();if("string"!=typeof r)return;if(!e.dateRegex.test(r))return;const s=new Date(r);t.setNormalizedValue(s),t.stopPropagation()}};Xo.eventListenerTarget=r.RawValueToNormalizedValueEvent,Xo.priority=50,Xo.dateRegex=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\+\d{2}:\d{2}$/;let ea=Xo;const ta=class e{constructor(){}static constructFromServiceResolver(){return new e}onEvent(t){if(t.getIdentifier()!==e.eventListenerTarget)return;const r=t.getNormalizedValue();(Array.isArray(r)||"number"==typeof r||"boolean"==typeof r||"string"==typeof r||r instanceof String||null===r)&&(t.setRawValue(r),t.stopPropagation())}};ta.eventListenerTarget=r.NormalizedValueToRawValueEvent,ta.priority=0;let ra=ta;const sa=class e{constructor(){}static constructFromServiceResolver(){return new e}onEvent(t){if(t.getIdentifier()!==e.eventListenerTarget)return;const r=t.getRawValue();(Array.isArray(r)||"number"==typeof r||"boolean"==typeof r||"string"==typeof r||null===r)&&(t.setNormalizedValue(r),t.stopPropagation())}};sa.eventListenerTarget=r.RawValueToNormalizedValueEvent,sa.priority=0;let na=sa;function ia(e){const t=e.getServiceOrFail(Ht.identifier),r=[Qo,ea,ra,na];for(let s=0;s<r.length;s++)t.addListener(r[s].eventListenerTarget,r[s].constructFromServiceResolver(),r[s].priority)}const oa=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,DateTimeNormalizedValueToRawValueEventListener:Qo,DateTimeRawValueToNormalizedValueEventListener:ea,GenericNormalizedValueToRawValueEventListener:ra,GenericRawValueToNormalizedValueEventListener:na,initEventListener:ia},Symbol.toStringTag,{value:"Module"}));const aa={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]};function la(e,t,r,s=!1){const n=String(t),i=(e,t)=>`[${t[0]}m${e}[${t[1]}m`,o=(e,t)=>null!=t&&"string"==typeof t?i(e,aa[t]):null!=t&&Array.isArray(t)?t.reduce((e,t)=>o(e,t),e):null!=t&&null!=t[e.trim()]?o(e,t[e.trim()]):null!=t&&null!=t["*"]?o(e,t["*"]):e;return n.replace(/{{(.+?)}}/g,(t,n)=>{const a=null!=r[n]?String(r[n]):s?"":t;return e.stylePrettyLogs?o(a,e?.prettyLogStyles?.[n]??null)+i("",aa.reset):a})}function ca(e,t=2,r=0){return null!=e&&isNaN(e)?"":(e=null!=e?e+r:e,2===t?null==e?"--":e<10?"0"+e:e.toString():null==e?"---":e<10?"00"+e:e<100?"0"+e:e.toString())}function ua(e,t){if(null==t)return{text:"",template:e.prettyLogTemplate,placeholders:{}};let r=e.prettyLogTemplate;const s={};r.includes("{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}")?r=r.replace("{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}","{{dateIsoStr}}"):"UTC"===e.prettyLogTimeZone?(s.yyyy=t.date?.getUTCFullYear()??"----",s.mm=ca(t.date?.getUTCMonth(),2,1),s.dd=ca(t.date?.getUTCDate(),2),s.hh=ca(t.date?.getUTCHours(),2),s.MM=ca(t.date?.getUTCMinutes(),2),s.ss=ca(t.date?.getUTCSeconds(),2),s.ms=ca(t.date?.getUTCMilliseconds(),3)):(s.yyyy=t.date?.getFullYear()??"----",s.mm=ca(t.date?.getMonth(),2,1),s.dd=ca(t.date?.getDate(),2),s.hh=ca(t.date?.getHours(),2),s.MM=ca(t.date?.getMinutes(),2),s.ss=ca(t.date?.getSeconds(),2),s.ms=ca(t.date?.getMilliseconds(),3));const n="UTC"===e.prettyLogTimeZone?t.date:null!=t.date?new Date(t.date.getTime()-6e4*t.date.getTimezoneOffset()):void 0;s.rawIsoStr=n?.toISOString()??"",s.dateIsoStr=n?.toISOString().replace("T"," ").replace("Z","")??"",s.logLevelName=t.logLevelName,s.fileNameWithLine=t.path?.fileNameWithLine??"",s.filePathWithLine=t.path?.filePathWithLine??"",s.fullFilePath=t.path?.fullFilePath??"";let i=e.parentNames?.join(e.prettyErrorParentNamesSeparator);i=null!=i&&null!=t.name?i+e.prettyErrorParentNamesSeparator:void 0;const o=null!=t.name||null!=i?`${i??""}${t.name??""}`:"";return s.name=o,s.nameWithDelimiterPrefix=o.length>0?e.prettyErrorLoggerNameDelimiter+o:"",s.nameWithDelimiterSuffix=o.length>0?o+e.prettyErrorLoggerNameDelimiter:"",null!=e.overwrite?.addPlaceholders&&e.overwrite.addPlaceholders(t,s),{text:la(e,r,s),template:r,placeholders:s}}const ha=[/(?:^|[\\/])node_modules[\\/].*tslog/i,/(?:^|[\\/])deps[\\/].*tslog/i,/tslog[\\/]+src[\\/]+internal[\\/]/i,/tslog[\\/]+src[\\/]BaseLogger/i,/tslog[\\/]+src[\\/]index/i];function da(e,t){return function(e,t){const r=[];for(const s of e){const e=t(s);null!=e&&r.push(e)}return r}(function(e){return t=function(e){const t="string"==typeof e?.stack?e.stack:void 0;return null==t||0===t.length?[]:t.split("\n").map(e=>e.trimEnd())}(e),t.filter(e=>e.length>0&&!/^\s*Error\b/.test(e));var t}(e),t)}function fa(e,t){return e<0?0:e>=t?Math.max(0,t-1):e}function pa(){return[...ha]}function ma(e){if(e instanceof Error)return e;const t=new Error("string"==typeof e?e:JSON.stringify(e));return"object"==typeof e&&null!=e&&Object.assign(t,e),t}function ga(e){const t=/* @__PURE__ */new Set;return JSON.stringify(e,(e,r)=>{if("object"==typeof r&&null!==r){if(t.has(r))return"[Circular]";t.add(r)}return"bigint"==typeof r?`${r}`:void 0===r?"[undefined]":r})}function ya(e,t){const r={seen:[],stylize:wa};return null!=t&&La(r,t),va(r.showHidden)&&(r.showHidden=!1),va(r.depth)&&(r.depth=2),va(r.colors)&&(r.colors=!0),va(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=Ea),$a(r,e,r.depth)}function va(e){return void 0===e}function wa(e){return e}function Ea(e,t){const r=ya.styles[t];return null!=r&&null!=ya?.colors?.[r]?.[0]&&null!=ya?.colors?.[r]?.[1]?"["+ya.colors[r][0]+"m"+e+"["+ya.colors[r][1]+"m":e}function Sa(e){return"function"==typeof e}function ba(e){return"string"==typeof e}function Ta(e){return null===e}function Oa(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ka(e){return xa(e)&&"[object RegExp]"===Aa(e)}function xa(e){return"object"==typeof e&&null!==e}function Ca(e){return xa(e)&&("[object Error]"===Aa(e)||e instanceof Error)}function _a(e){return xa(e)&&"[object Date]"===Aa(e)}function Aa(e){return Object.prototype.toString.call(e)}function Fa(e){return"["+Error.prototype.toString.call(e)+"]"}function $a(e,t,r=0){if(e.customInspect&&null!=t&&Sa(t)&&t?.inspect!==ya&&(!t?.constructor||t?.constructor.prototype!==t)){if("function"!=typeof t.inspect&&null!=t.toString)return t.toString();let s=t?.inspect(r,e);return ba(s)||(s=$a(e,s,r)),s}const s=Pa(e,t);if(s)return s;let n=Object.keys(t);const i=function(e){const t={};return e.forEach(e=>{t[e]=!0}),t}(n);try{e.showHidden&&Object.getOwnPropertyNames&&(n=Object.getOwnPropertyNames(t))}catch{}if(Ca(t)&&(n.indexOf("message")>=0||n.indexOf("description")>=0))return Fa(t);if(0===n.length){if(!Sa(e.stylize))return t;if(Sa(t)){const r=t.name?": "+t.name:"";return e.stylize("[Function"+r+"]","special")}if(ka(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(_a(t))return e.stylize(Date.prototype.toISOString.call(t),"date");if(Ca(t))return Fa(t)}let o,a="",l=!1,c=["{\n","\n}"];if(Array.isArray(t)&&(l=!0,c=["[\n","\n]"]),Sa(t)){a=" [Function"+(t.name?": "+t.name:"")+"]"}return ka(t)&&(a=" "+RegExp.prototype.toString.call(t)),_a(t)&&(a=" "+Date.prototype.toUTCString.call(t)),Ca(t)&&(a=" "+Fa(t)),0!==n.length||l&&0!=t.length?r<0?ka(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),o=l?function(e,t,r,s,n){const i=[];for(let o=0,a=t.length;o<a;++o)Oa(t,String(o))?i.push(Na(e,t,r,s,String(o),!0)):i.push("");return n.forEach(n=>{n.match(/^\d+$/)||i.push(Na(e,t,r,s,n,!0))}),i}(e,t,r,i,n):n.map(s=>Na(e,t,r,i,s,l)),e.seen.pop(),function(e,t,r){return r[0]+(""===t?"":t+"\n")+" "+e.join(",\n ")+" "+r[1]}(o,a,c)):c[0]+a+c[1]}function Na(e,t,r,s,n,i){let o,a,l={value:void 0};try{l.value=t[n]}catch{}try{Object.getOwnPropertyDescriptor&&(l=Object.getOwnPropertyDescriptor(t,n)||l)}catch{}if(l.get?a=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(a=e.stylize("[Setter]","special")),Oa(s,n)||(o="["+n+"]"),a||(e.seen.indexOf(l.value)<0?(a=Ta(r)?$a(e,l.value,void 0):$a(e,l.value,r-1),a.indexOf("\n")>-1&&(a=i?a.split("\n").map(e=>" "+e).join("\n").substr(2):"\n"+a.split("\n").map(e=>" "+e).join("\n"))):a=e.stylize("[Circular]","special")),va(o)){if(i&&n.match(/^\d+$/))return a;o=JSON.stringify(""+n),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,"\\'").replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+a}function Pa(e,t){if(va(t))return e.stylize("undefined","undefined");if(ba(t)){const r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,"\\'")+"'";return e.stylize(r,"string")}return"number"==typeof t?e.stylize(""+t,"number"):function(e){return"boolean"==typeof e}(t)?e.stylize(""+t,"boolean"):Ta(t)?e.stylize("null","null"):void 0}function La(e,t){const r={...e};if(!t||!xa(t))return e;const s={...t},n=Object.keys(t);let i=n.length;for(;i--;)r[n[i]]=s[n[i]];return r}function Ra(){return"undefined"!=typeof window&&"undefined"!=typeof document}ya.colors=aa,ya.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};const Ma=/\u001b\[[0-9;]*m/g,Da={black:"#000000",red:"#ef5350",green:"#66bb6a",yellow:"#fdd835",blue:"#42a5f5",magenta:"#ab47bc",cyan:"#26c6da",white:"#fafafa",blackBright:"#424242",redBright:"#ff7043",greenBright:"#81c784",yellowBright:"#ffe082",blueBright:"#64b5f6",magentaBright:"#ce93d8",cyanBright:"#4dd0e1",whiteBright:"#ffffff"},za={bgBlack:"#000000",bgRed:"#ef5350",bgGreen:"#66bb6a",bgYellow:"#fdd835",bgBlue:"#42a5f5",bgMagenta:"#ab47bc",bgCyan:"#26c6da",bgWhite:"#fafafa",bgBlackBright:"#424242",bgRedBright:"#ff7043",bgGreenBright:"#81c784",bgYellowBright:"#ffe082",bgBlueBright:"#64b5f6",bgMagentaBright:"#ce93d8",bgCyanBright:"#4dd0e1",bgWhiteBright:"#ffffff"},Ia=/(?:(?:file|https?|global code|[^@]+)@)?(?:file:)?((?:\/[^:/]+){2,})(?::(\d+))?(?::(\d+))?/,Ha=function(){const e=function(){if(Ra()){const e=globalThis.navigator;return{name:"browser",userAgent:e?.userAgent}}const e=globalThis;if("function"==typeof e.importScripts)return{name:"worker",userAgent:e.navigator?.userAgent};const t=globalThis;if(null!=t.Bun){const e=t.Bun.version;return{name:"bun",version:null!=e?`bun/${e}`:void 0,hostname:p(t.process,t.Deno,t.Bun,t.location)}}if(null!=t.Deno){const e=function(e){try{if("function"==typeof e?.hostname){const t=e.hostname();if(null!=t&&t.length>0)return t}}catch{}const t=globalThis.location?.hostname;if(null!=t&&t.length>0)return t;return}(t.Deno),r=t.Deno?.version?.deno;return{name:"deno",version:null!=r?`deno/${r}`:void 0,hostname:e??p(t.process,t.Deno,t.Bun,t.location)}}if(null!=t.process?.versions?.node||null!=t.process?.version)return{name:"node",version:t.process?.versions?.node??t.process?.version,hostname:p(t.process,t.Deno,t.Bun,t.location)};if(null!=t.process)return{name:"node",version:"unknown",hostname:p(t.process,t.Deno,t.Bun,t.location)};return{name:"unknown"}}(),t=function(t){if("browser"===t.name||"worker"===t.name)return{runtime:t.name,browser:t.userAgent};const r={runtime:t.name};"node"!==e.name&&"deno"!==e.name&&"bun"!==e.name||(r.runtimeVersion=t.version??"unknown");"node"!==e.name&&"deno"!==e.name&&"bun"!==e.name||(r.hostname=t.hostname??"unknown");return r}(e),r="browser"===e.name||"worker"===e.name,s=r?[...pa(),/node_modules[\\/].*tslog/i]:[...pa(),/node:(?:internal|vm)/i,/\binternal[\\/]/i];let n;const i={getMeta:(e,r,s,n,o,a)=>Object.assign({},t,{name:o,parentNames:a,date:/* @__PURE__ */new Date,logLevelId:e,logLevelName:r,path:n?void 0:i.getCallerStackFrame(s)}),getCallerStackFrame(e,t=new Error){const r=da(t,e=>o(e));if(0===r.length)return{};const n=function(e,t=ha){for(let r=0;r<e.length;r+=1){const s=e[r],n=s.filePath??"",i=s.fullFilePath??"";if(!t.some(e=>e.test(n)||e.test(i)))return r}return 0}(r,s);return r[fa(Number.isFinite(e)&&e>=0?e:n,r.length)]??{}},getErrorTrace:e=>da(e,e=>o(e)),isError:e=>function(e){if(e instanceof Error)return!0;if(null!=e&&"object"==typeof e){const t=Object.prototype.toString.call(e);if(/\[object .*Error\]/.test(t))return!0;const r=e.name;if("string"==typeof r&&r.endsWith("Error"))return!0}return!1}(e),isBuffer:e=>"undefined"!=typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(e),prettyFormatLogObj:(e,t)=>e.reduce((e,r)=>(i.isError(r)?e.errors.push(i.prettyFormatErrorObj(r,t)):e.args.push(r),e),{args:[],errors:[]}),prettyFormatErrorObj(e,t){const r=a(i.getErrorTrace(e),t),s=function(e,t={}){const r=t.maxDepth??5,s=[],n=/* @__PURE__ */new Set;let i=e,o=0;for(;null!=i&&o<r;){const e=i?.cause;if(null==e||n.has(e))break;n.add(e),s.push(ma(e)),i=e,o+=1}return s}(e).map((e,r)=>[`Caused by (${r+1}): ${e.name??"Error"}${e.message?`: ${e.message}`:""}`,...a(da(e,e=>o(e)),t)].join("\n")),n={errorName:` ${e.name} `,errorMessage:l(e),errorStack:[...r,...s].join("\n")};return la(t,t.prettyErrorTemplate,n)},transportFormatted(t,r,s,n,i){const o=!1!==i.stylePrettyLogs,a=(s.length>0&&r.length>0?"\n":"")+s.join("\n"),l=t.replace(Ma,"");const h=o?t:l;if(function(t){return t&&("browser"===e.name||"worker"===e.name)&&function(){if(!Ra())return!1;const e=globalThis?.navigator,t=e?.userAgent??"";if(/firefox/i.test(t))return!0;const r=globalThis;return!!r?.CSS?.supports?.("color","#000")||/safari/i.test(t)&&!/chrome/i.test(t)}()}(o)){i.prettyInspectOptions.colors=!1;const e=d(i.prettyInspectOptions,r),t=null!=n?function(e,t){if(null==t)return{text:"",styles:[]};const{template:r,placeholders:s}=ua(e,t),n=[],i=[];let o=0;const a=/{{(.+?)}}/g;let l;for(;null!=(l=a.exec(r));){l.index>o&&n.push(r.slice(o,l.index));const t=l[1],h=null!=s[t]?String(s[t]):"",d=u(c(e.prettyLogStyles?.[t],h));d.length>0?(n.push(`%c${h}%c`),i.push(d,"")):n.push(h),o=a.lastIndex}o<r.length&&n.push(r.slice(o));return{text:n.join(""),styles:i}}(i,n):{text:l,styles:[]},s=t.text.length>0&&t.styles.length>0,o=(s?t.text:l)+e+a;return void(s?console.log(o,...t.styles):console.log(o))}i.prettyInspectOptions.colors=o;const f=d(i.prettyInspectOptions,r);console.log(h+f+a)},transportJSON(e){console.log(ga(e))}};return"test"===function(){const e=globalThis?.process;return e?.env?.NODE_ENV}()&&(i.__resetWorkingDirectoryCacheForTests=()=>{n=void 0}),i;function o(e){return r?function(e){const t=globalThis.location?.origin;if(null==e)return;const r=e.match(Ia);if(!r)return;const s=r[1]?.replace(/\?.*$/,"");if(null==s)return;const n=s.split("/"),i=r[2],o=r[3],a=n[n.length-1];return{fullFilePath:t?`${t}${s}`:s,fileName:a,fileNameWithLine:a&&i?`${a}:${i}`:void 0,fileColumn:o,fileLine:i,filePath:s,filePathWithLine:i?`${s}:${i}`:void 0,method:void 0}}(e):function(e){if("string"!=typeof e||0===e.length)return;const t=e.trim();if(!t.includes(" at ")&&!t.startsWith("at "))return;const r=t.replace(/^at\s+/,"");let s,i=r;const o=r.match(/^(.*?)\s+\((.*)\)$/);o&&(s=o[1],i=o[2]);const a=i.replace(/^\(/,"").replace(/\)$/,""),l=a.replace(/\?.*$/,"");let c,u,h=l;const d=l.split(":");d.length>=3&&/^\d+$/.test(d[d.length-1]??"")?(u=d.pop(),c=d.pop(),h=d.join(":")):d.length>=2&&/^\d+$/.test(d[d.length-1]??"")&&(c=d.pop(),h=d.join(":"));let f=h.replace(/^file:\/\//,"");const p=function(){void 0===n&&(n=function(){try{const e=globalThis?.process;if("function"==typeof e?.cwd)return e.cwd()}catch{}try{const e=globalThis?.Deno;if("function"==typeof e?.cwd)return e.cwd()}catch{}}()??null);return n??void 0}();null!=p&&f.startsWith(p)&&(f=f.slice(p.length),f=f.replace(/^[\\/]/,""));0===f.length&&(f=h);const m=function(e){if("string"!=typeof e||0===e.length)return e;const t=e.replace(/\\+/g,"\\").replace(/\\/g,"/"),r=t.startsWith("//"),s=t.startsWith("/")&&!r,n=t.match(/^[A-Za-z]:/),i=n?n[0]:"",o=(i?t.slice(i.length):t).split("/"),a=[];for(const c of o)""!==c&&"."!==c&&(".."!==c?a.push(c):a.length>0&&a.pop());let l=a.join("/");r?l=`//${l}`:s?l=`/${l}`:""!==i&&(l=`${i}${l.length>0?`/${l}`:""}`);if(0===l.length)return e;return l}(f),g=m.length>0?m:f,y=g.split(/\\|\//),v=y[y.length-1];return{fullFilePath:a,fileName:v,fileNameWithLine:v&&c?`${v}:${c}`:void 0,fileColumn:u,fileLine:c,filePath:g,filePathWithLine:g&&c?`${g}:${c}`:void 0,method:s}}(e)}function a(e,t){return e.map(e=>la(t,t.prettyErrorStackTemplate,{...e},!0))}function l(e){return Object.getOwnPropertyNames(e).filter(e=>"stack"!==e&&"cause"!==e).reduce((t,r)=>{const s=e[r];return"function"==typeof s||t.push(String(s)),t},[]).join(", ")}function c(e,t){if(null==e)return[];if("string"==typeof e)return[e];if(Array.isArray(e))return e.flatMap(e=>c(e,t));if("object"==typeof e){const r=e[t.trim()]??e["*"];return null==r?[]:c(r,t)}return[]}function u(e){const t=/* @__PURE__ */new Set,r=[];for(const s of e){const e=h(s);null!=e&&e.length>0&&!t.has(e)&&(t.add(e),r.push(e))}return r.join("; ")}function h(e){const t=Da[e];if(null!=t)return`color: ${t}`;const r=za[e];if(null!=r)return`background-color: ${r}`;switch(e){case"bold":return"font-weight: bold";case"dim":return"opacity: 0.75";case"italic":return"font-style: italic";case"underline":return"text-decoration: underline";case"overline":return"text-decoration: overline";case"inverse":return"filter: invert(1)";case"hidden":return"visibility: hidden";case"strikethrough":return"text-decoration: line-through";default:return}}function d(e,t){try{return function(e,...t){const r={seen:[],stylize:wa};null!=e&&La(r,e);const s=t[0];let n=0,i="",o="";if("string"==typeof s){if(1===t.length)return s;let a,l=0;for(let o=0;o<s.length-1;o++)if(37===s.charCodeAt(o)){const c=s.charCodeAt(++o);if(n+1!==t.length){switch(c){case 115:{const s=t[++n];a="number"==typeof s||"bigint"==typeof s?Pa(r,s):"object"!=typeof s||null===s?String(s):ya(s,{...e,compact:3,colors:!1,depth:0});break}case 106:a=ga(t[++n]);break;case 100:{const e=t[++n];a="bigint"==typeof e?Pa(r,e):"symbol"==typeof e?"NaN":Pa(r,e);break}case 79:a=ya(t[++n],e);break;case 111:a=ya(t[++n],{...e,showHidden:!0,showProxy:!0,depth:4});break;case 105:{const e=t[++n];a="bigint"==typeof e?Pa(r,e):"symbol"==typeof e?"NaN":Pa(r,parseInt(a));break}case 102:{const e=t[++n];a="symbol"==typeof e?"NaN":Pa(r,parseInt(e));break}case 99:n+=1,a="";break;case 37:i+=s.slice(l,o),l=o+1;continue;default:continue}l!==o-1&&(i+=s.slice(l,o-1)),i+=a,l=o+1}else 37===c&&(i+=s.slice(l,o),l=o+1)}0!==l&&(n++,o=" ",l<s.length&&(i+=s.slice(l)))}for(;n<t.length;){const r=t[n];i+=o,i+="string"!=typeof r?ya(r,e):r,o=" ",n++}return i}(e,...t)}catch{return t.map(f).join(" ")}}function f(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch{return String(e)}}function p(e,t,r,s){const n=e?.env?.HOSTNAME??e?.env?.HOST??e?.env?.COMPUTERNAME;if(null!=n&&n.length>0)return n;const i=r?.env?.HOSTNAME??r?.env?.HOST??r?.env?.COMPUTERNAME;if(null!=i&&i.length>0)return i;try{const e=t?.env?.get;if("function"==typeof e){const t=e("HOSTNAME");if(null!=t&&t.length>0)return t}}catch{}return null!=s?.hostname&&s.hostname.length>0?s.hostname:void 0}}();class ja{constructor(e,t,r=Number.NaN){this.logObj=t,this.stackDepthLevel=r,this.runtime=Ha,this.maxErrorCauseDepth=5,this.settings={type:e?.type??"pretty",name:e?.name,parentNames:e?.parentNames,minLevel:e?.minLevel??0,argumentsArrayName:e?.argumentsArrayName,hideLogPositionForProduction:e?.hideLogPositionForProduction??!1,prettyLogTemplate:e?.prettyLogTemplate??"{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}\t{{logLevelName}}\t{{filePathWithLine}}{{nameWithDelimiterPrefix}}\t",prettyErrorTemplate:e?.prettyErrorTemplate??"\n{{errorName}} {{errorMessage}}\nerror stack:\n{{errorStack}}",prettyErrorStackTemplate:e?.prettyErrorStackTemplate??" • {{fileName}}\t{{method}}\n\t{{filePathWithLine}}",prettyErrorParentNamesSeparator:e?.prettyErrorParentNamesSeparator??":",prettyErrorLoggerNameDelimiter:e?.prettyErrorLoggerNameDelimiter??"\t",stylePrettyLogs:e?.stylePrettyLogs??!0,prettyLogTimeZone:e?.prettyLogTimeZone??"UTC",prettyLogStyles:e?.prettyLogStyles??{logLevelName:{"*":["bold","black","bgWhiteBright","dim"],SILLY:["bold","white"],TRACE:["bold","whiteBright"],DEBUG:["bold","green"],INFO:["bold","blue"],WARN:["bold","yellow"],ERROR:["bold","red"],FATAL:["bold","redBright"]},dateIsoStr:"white",filePathWithLine:"white",name:["white","bold"],nameWithDelimiterPrefix:["white","bold"],nameWithDelimiterSuffix:["white","bold"],errorName:["bold","bgRedBright","whiteBright"],fileName:["yellow"],fileNameWithLine:"white"},prettyInspectOptions:e?.prettyInspectOptions??{colors:!0,compact:!1,depth:1/0},metaProperty:e?.metaProperty??"_meta",maskPlaceholder:e?.maskPlaceholder??"[***]",maskValuesOfKeys:e?.maskValuesOfKeys??["password"],maskValuesOfKeysCaseInsensitive:e?.maskValuesOfKeysCaseInsensitive??!1,maskValuesRegEx:e?.maskValuesRegEx,prefix:[...e?.prefix??[]],attachedTransports:[...e?.attachedTransports??[]],overwrite:{mask:e?.overwrite?.mask,toLogObj:e?.overwrite?.toLogObj,addMeta:e?.overwrite?.addMeta,addPlaceholders:e?.overwrite?.addPlaceholders,formatMeta:e?.overwrite?.formatMeta,formatLogObj:e?.overwrite?.formatLogObj,transportFormatted:e?.overwrite?.transportFormatted,transportJSON:e?.overwrite?.transportJSON}},this.captureStackForMeta=this._shouldCaptureStack()}log(e,t,...r){if(e<this.settings.minLevel)return;const s=this._resolveLogArguments(r),n=[...this.settings.prefix,...s],i=null!=this.settings.overwrite?.mask?this.settings.overwrite?.mask(n):null!=this.settings.maskValuesOfKeys&&this.settings.maskValuesOfKeys.length>0?this._mask(n):n,o=null!=this.logObj?this._recursiveCloneAndExecuteFunctions(this.logObj):void 0,a=null!=this.settings.overwrite?.toLogObj?this.settings.overwrite?.toLogObj(i,o):this._toLogObj(i,o),l=null!=this.settings.overwrite?.addMeta?this.settings.overwrite?.addMeta(a,e,t):this._addMetaToLogObj(a,e,t),c=l?.[this.settings.metaProperty];let u,h;if(null!=this.settings.overwrite?.formatMeta&&(u=this.settings.overwrite?.formatMeta(l?.[this.settings.metaProperty])),null!=this.settings.overwrite?.formatLogObj&&(h=this.settings.overwrite?.formatLogObj(i,this.settings)),"pretty"===this.settings.type&&(u=u??this._prettyFormatLogObjMeta(l?.[this.settings.metaProperty]),h=h??Ha.prettyFormatLogObj(i,this.settings)),null!=u&&null!=h)if(null!=this.settings.overwrite?.transportFormatted){const e=this.settings.overwrite.transportFormatted,t=e.length;t<4?e(u,h.args,h.errors):4===t?e(u,h.args,h.errors,c):e(u,h.args,h.errors,c,this.settings)}else Ha.transportFormatted(u,h.args,h.errors,c,this.settings);else null!=this.settings.overwrite?.transportJSON?this.settings.overwrite.transportJSON(l):"hidden"!==this.settings.type&&Ha.transportJSON(l);return null!=this.settings.attachedTransports&&this.settings.attachedTransports.length>0&&this.settings.attachedTransports.forEach(e=>{e(l)}),l}attachTransport(e){this.settings.attachedTransports.push(e)}getSubLogger(e,t){const r={...this.settings,...e,parentNames:null!=this.settings?.parentNames&&null!=this.settings?.name?[...this.settings.parentNames,this.settings.name]:null!=this.settings?.name?[this.settings.name]:void 0,prefix:[...this.settings.prefix,...e?.prefix??[]]};return new this.constructor(r,t??this.logObj,this.stackDepthLevel)}_mask(e){const t=this._getMaskKeys();return e?.map(e=>this._recursiveCloneAndMaskValuesOfKeys(e,t))}_getMaskKeys(){const e=this.settings.maskValuesOfKeys??[],t=e.map(String).join("|");if(!0===this.settings.maskValuesOfKeysCaseInsensitive){if(this.maskKeysCache?.source===e&&!0===this.maskKeysCache.caseInsensitive&&this.maskKeysCache.signature===t)return this.maskKeysCache.normalized;const r=e.map(e=>"string"==typeof e?e.toLowerCase():String(e).toLowerCase());return this.maskKeysCache={source:e,caseInsensitive:!0,normalized:r,signature:t},r}return this.maskKeysCache={source:e,caseInsensitive:!1,normalized:e,signature:t},e}_resolveLogArguments(e){if(1===e.length&&"function"==typeof e[0]){const t=e[0];if(0===t.length){const e=t();return Array.isArray(e)?e:[e]}}return e}_recursiveCloneAndMaskValuesOfKeys(e,t,r=[]){if(r.includes(e))return{...e};if("object"==typeof e&&null!==e&&r.push(e),Ha.isError(e)||Ha.isBuffer(e))return e;if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(Array.isArray(e))return e.map(e=>this._recursiveCloneAndMaskValuesOfKeys(e,t,r));if(e instanceof Date)return new Date(e.getTime());if(e instanceof URL)return{href:(s=e).href,protocol:s.protocol,username:s.username,password:s.password,host:s.host,hostname:s.hostname,port:s.port,pathname:s.pathname,search:s.search,searchParams:[...s.searchParams].map(([e,t])=>({key:e,value:t})),hash:s.hash,origin:s.origin};if(null!==e&&"object"==typeof e){const s=Ha.isError(e)?this._cloneError(e):Object.create(Object.getPrototypeOf(e));return Object.getOwnPropertyNames(e).reduce((s,n)=>{const i=!0!==this.settings?.maskValuesOfKeysCaseInsensitive?n:"string"==typeof n?n.toLowerCase():String(n).toLowerCase();return s[n]=t.includes(i)?this.settings.maskPlaceholder:(()=>{try{return this._recursiveCloneAndMaskValuesOfKeys(e[n],t,r)}catch{return null}})(),s},s)}if("string"==typeof e){let t=e;for(const e of this.settings?.maskValuesRegEx||[])t=t.replace(e,this.settings?.maskPlaceholder||"");return t}return e;var s}_recursiveCloneAndExecuteFunctions(e,t=[]){return this.isObjectOrArray(e)&&t.includes(e)?this.shallowCopy(e):(this.isObjectOrArray(e)&&t.push(e),Array.isArray(e)?e.map(e=>this._recursiveCloneAndExecuteFunctions(e,t)):e instanceof Date?new Date(e.getTime()):this.isObject(e)?Object.getOwnPropertyNames(e).reduce((r,s)=>{const n=Object.getOwnPropertyDescriptor(e,s);if(n){Object.defineProperty(r,s,n);const i=e[s];r[s]="function"==typeof i?i():this._recursiveCloneAndExecuteFunctions(i,t)}return r},Object.create(Object.getPrototypeOf(e))):e)}isObjectOrArray(e){return"object"==typeof e&&null!==e}isObject(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}shallowCopy(e){return Array.isArray(e)?[...e]:{...e}}_toLogObj(e,t={}){return e=e?.map(e=>Ha.isError(e)?this._toErrorObject(e):e),t=null==this.settings.argumentsArrayName?1!==e.length||Array.isArray(e[0])||!0===Ha.isBuffer(e[0])||e[0]instanceof Date?{...t,...e}:"object"==typeof e[0]&&null!=e[0]?{...e[0],...t}:{0:e[0],...t}:{...t,[this.settings.argumentsArrayName]:e}}_cloneError(e){const t=new e.constructor;return Object.getOwnPropertyNames(e).forEach(r=>{t[r]=e[r]}),t}_toErrorObject(e,t=0,r=/* @__PURE__ */new Set){r.has(e)||r.add(e);const s={nativeError:e,name:e.name??"Error",message:e.message,stack:Ha.getErrorTrace(e)};if(t>=this.maxErrorCauseDepth)return s;const n=e.cause;if(null!=n){const e=ma(n);r.has(e)||(s.cause=this._toErrorObject(e,t+1,r))}return s}_addMetaToLogObj(e,t,r){return{...e,[this.settings.metaProperty]:Ha.getMeta(t,r,this.stackDepthLevel,!this.captureStackForMeta,this.settings.name,this.settings.parentNames)}}_shouldCaptureStack(){if(this.settings.hideLogPositionForProduction)return!1;if("json"===this.settings.type)return!0;const e=this.settings.prettyLogTemplate??"";return!!/{{\s*(file(Name|Path|Line|PathWithLine|NameWithLine)|fullFilePath)\s*}}/.test(e)}_prettyFormatLogObjMeta(e){return ua(this.settings,e).text}}class Va extends ja{constructor(e,t){const r={...e??{}};"undefined"!=typeof window&&"undefined"!=typeof document&&(r.stylePrettyLogs=e?.stylePrettyLogs??!0),super(r,t,Number.NaN)}log(e,t,...r){return super.log(e,t,...r)}silly(...e){return super.log(0,"SILLY",...e)}trace(...e){return super.log(1,"TRACE",...e)}debug(...e){return super.log(2,"DEBUG",...e)}info(...e){return super.log(3,"INFO",...e)}warn(...e){return super.log(4,"WARN",...e)}error(...e){return super.log(5,"ERROR",...e)}fatal(...e){return super.log(6,"FATAL",...e)}getSubLogger(e,t){return super.getSubLogger(e,t)}}function Ua(e){const r=new Bt;r.setService(o.action,new St),r.setService(o.setting,new bt),r.setService(o.icon,new bt),r.setService(o.routeResolver,new Wt);const s=new Va({name:"app-core",type:"pretty"});r.setService(o.logger,s);const n=[Ht,zt,pt,Zt,ut,Vt,Qt,rr,er,nr,or,lr,ur,dr,pr,gr,wr,Sr,Tr,kr,Cr,Ar,z,H,V,W,Z,dt];for(let t=0;t<n.length;t++)r.setService(n[t].identifier,n[t].constructFromServiceResolver(r));return ia(r),e.addEventListener(t.GetServiceResolver,e=>{e.setServiceResolver(r),e.stopPropagation()}),r}const Wa=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,Definition:$t,Enum:a,Partial:c},Symbol.toStringTag,{value:"Module"}));export{d as BrowserEvent,f as BrowserEventListener,q as Cache,Yt as Component,$r as Endpoint,O as Error,Mt as Event,oa as EventListener,qt as Service,Wa as Type,Ua as init};
|
|
1
|
+
var e,t=/* @__PURE__ */(e=>(e.GetServiceResolver="ember-nexus.app-core.get-service-resolver",e))(t||{}),r=/* @__PURE__ */(e=>(e.NormalizedValueToRawValueEvent="ember-nexus.app-core.event.normalized-value-to-raw-value",e.RawValueToNormalizedValueEvent="ember-nexus.app-core.event.raw-value-to-normalized-value",e))(r||{}),s=/* @__PURE__ */(e=>(e.GET="GET",e.POST="POST",e.PATCH="PATCH",e.PUT="PUT",e.DELETE="DELETE",e.HEAD="HEAD",e.COPY="COPY",e.LOCK="LOCK",e.UNLOCK="UNLOCK",e.MKCOL="MKCOL",e.MOVE="MOVE",e.PROPFIND="PROPFIND",e.PROPPATCH="PROPPATCH",e))(s||{}),n=/* @__PURE__ */(e=>(e[e.Debug=2]="Debug",e[e.Info=3]="Info",e[e.Warn=4]="Warn",e[e.Error=5]="Error",e))(n||{}),i=/* @__PURE__ */(e=>(e.ClientSide="client",e.ServerSide="server",e.Logic="Logic",e))(i||{}),o=/* @__PURE__ */(e=>(e.emberNexusWebSDK="ember-nexus.web-sdk",e.logger="global.logger",e.action="global.action-registry",e.setting="global.setting-registry",e.icon="global.icon-registry",e.routeResolver="global.route-resolver",e.serviceFetchHelper="ember-nexus.app-core.service.fetch-helper-service",e.serviceApiConfiguration="ember-nexus.app-core.service.api-configuration-service",e.serviceElementParser="ember-nexus.app-core.service.element-parser-service",e.serviceCollectionParser="ember-nexus.app-core.service.collection-parser-service",e.serviceTokenParser="ember-nexus.app-core.service.token-parser-service",e.serviceApiWrapper="ember-nexus.app-core.service.api-wrapper",e.serviceEventDispatcher="ember-nexus.app-core.service.event-dispatcher",e.endpointElementDeleteElementEndpoint="ember-nexus.app-core.endpoint.element.delete-element-endpoint",e.endpointElementGetElementEndpoint="ember-nexus.app-core.endpoint.element.get-element-endpoint",e.endpointElementGetElementChildrenEndpoint="ember-nexus.app-core.endpoint.element.get-element-children-endpoint",e.endpointElementGetElementParentsEndpoint="ember-nexus.app-core.endpoint.element.get-element-parents-endpoint",e.endpointElementGetElementRelatedEndpoint="ember-nexus.app-core.endpoint.element.get-element-related-endpoint",e.endpointElementGetIndexEndpoint="ember-nexus.app-core.endpoint.element.get-index-endpoint",e.endpointElementPatchElementEndpoint="ember-nexus.app-core.endpoint.element.patch-element-endpoint",e.endpointElementPostElementEndpoint="ember-nexus.app-core.endpoint.element.post-element-endpoint",e.endpointElementPostIndexEndpoint="ember-nexus.app-core.endpoint.element.post-index-endpoint",e.endpointElementPutElementEndpoint="ember-nexus.app-core.endpoint.element.put-element-endpoint",e.endpointUserDeleteTokenEndpoint="ember-nexus.app-core.endpoint.user.delete-token-endpoint",e.endpointUserGetMeEndpoint="ember-nexus.app-core.endpoint.user.get-me-endpoint",e.endpointUserGetTokenEndpoint="ember-nexus.app-core.endpoint.user.get-token-endpoint",e.endpointUserPostChangePasswordEndpoint="ember-nexus.app-core.endpoint.user.post-change-password-endpoint",e.endpointUserPostRegisterEndpoint="ember-nexus.app-core.endpoint.user.post-register-endpoint",e.endpointUserPostTokenEndpoint="ember-nexus.app-core.endpoint.user.post-token-endpoint",e.cacheElement="ember-nexus.app-core.cache.element-cache",e.cacheElementChildren="ember-nexus.app-core.cache.element-children-cache",e.cacheElementParents="ember-nexus.app-core.cache.element-parents-cache",e.cacheElementRelated="ember-nexus.app-core.cache.element-related-cache",e.cacheIndex="ember-nexus.app-core.cache.index-cache",e))(o||{});const a=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,BrowserEventIdentifier:t,EventIdentifier:r,HttpRequestMethod:s,LogLevel:n,RequestProblemCategory:i,ServiceIdentifier:o},Symbol.toStringTag,{value:"Module"})),l={bubbles:!0,composed:!0,cancelable:!0},c=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,customEventDefaultInit:l},Symbol.toStringTag,{value:"Module"})),u=class e extends CustomEvent{constructor(){super(e.type,{...l,detail:{serviceResolver:null}})}getServiceResolver(){return this.detail.serviceResolver}setServiceResolver(e){this.detail.serviceResolver=e}};u.type=t.GetServiceResolver;let h=u;const d=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,GetServiceResolverEvent:h},Symbol.toStringTag,{value:"Module"})),f=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,exportPlaceholder:!1},Symbol.toStringTag,{value:"Module"}));class p extends Error{constructor(e){super(e)}}class m extends p{constructor(e){super(e),this.name="LogicError"}}class g extends p{constructor(e,t){super(e),this.name="NetworkError",this.cause=t}}class y extends p{constructor(e){super(e),this.name="ParseError"}}class v extends p{constructor(e){super(e),this._type=null,this._title=null,this._detail=null,this._status=null}getType(){return this._type}setType(e){return this._type=e,this}getTitle(){return this._title}setTitle(e){return this._title=e,this}getDetail(){return this._detail}setDetail(e){return this._detail=e,this}getStatus(){return this._status}setStatus(e){return this._status=e,this}}class w extends v{constructor(e){super(e),this.name="Response401UnauthorizedError",this.setStatus(401)}}class E extends v{constructor(e){super(e),this.name="Response403ForbiddenError",this.setStatus(403)}}class S extends v{constructor(e){super(e),this.name="Response404NotFoundError",this.setStatus(404)}}class b extends v{constructor(e){super(e),this.name="Response429TooManyRequestsError",this.setStatus(429)}}class T extends p{constructor(e){super(e),this.name="ValidationError"}}const O=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,EmberNexusError:p,LogicError:m,NetworkError:g,ParseError:y,Response401UnauthorizedError:w,Response403ForbiddenError:E,Response404NotFoundError:S,Response429TooManyRequestsError:b,ResponseError:v,ValidationError:T},Symbol.toStringTag,{value:"Module"}));class k{has(e){return this.cache.has(e)}get(e){return this.cache.get(e)}set(e,t){return this.cache.set(e,t),this}delete(e){return this.cache.delete(e),this}setFromDataEtag(e,t,r){const s=this.cache.get(e);s&&void 0===r&&(r=s.etag);const n={data:t,etag:r};return this.cache.set(e,n),this}setFromParsedResponse(e,t){const r=t.response.headers.get("ETag");if(null===r)throw new m("Expected parsedResponse to contain ETag header.");const s={data:t.data,etag:r};return this.cache.set(e,s),this}refresh(e){return this}}const x="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,C=/* @__PURE__ */new Set,_="object"==typeof process&&process?process:{},A=(e,t,r,s)=>{"function"==typeof _.emitWarning?_.emitWarning(e,t,r,s):console.error(`[${r}] ${t}: ${e}`)};let F=globalThis.AbortController,$=globalThis.AbortSignal;if(void 0===F){$=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},F=class{constructor(){t()}signal=new $;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(const t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e="1"!==_.env?.LRU_CACHE_IGNORE_AC_WARNING;const t=()=>{e&&(e=!1,A("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}const N=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),P=e=>N(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?L:null:null;class L extends Array{constructor(e){super(e),this.fill(0)}}class R{heap;length;static#e=!1;static create(e){const t=P(e);if(!t)return[];R.#e=!0;const r=new R(e,t);return R.#e=!1,r}constructor(e,t){if(!R.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class M{#t;#r;#s;#n;#i;#o;#a;#l;get perf(){return this.#l}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#c;#u;#h;#d;#f;#p;#m;#g;#y;#v;#w;#E;#S;#b;#T;#O;#k;#x;#C;static unsafeExposeInternals(e){return{starts:e.#S,ttls:e.#b,autopurgeTimers:e.#T,sizes:e.#E,keyMap:e.#h,keyList:e.#d,valList:e.#f,next:e.#p,prev:e.#m,get head(){return e.#g},get tail(){return e.#y},free:e.#v,isBackgroundFetch:t=>e.#_(t),backgroundFetch:(t,r,s,n)=>e.#A(t,r,s,n),moveToTail:t=>e.#F(t),indexes:t=>e.#$(t),rindexes:t=>e.#N(t),isStale:t=>e.#P(t)}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#u}get size(){return this.#c}get fetchMethod(){return this.#o}get memoMethod(){return this.#a}get dispose(){return this.#s}get onInsert(){return this.#n}get disposeAfter(){return this.#i}constructor(e){const{max:t=0,ttl:r,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:i,updateAgeOnHas:o,allowStale:a,dispose:l,onInsert:c,disposeAfter:u,noDisposeOnSet:h,noUpdateTTL:d,maxSize:f=0,maxEntrySize:p=0,sizeCalculation:m,fetchMethod:g,memoMethod:y,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:E,allowStaleOnFetchAbort:S,ignoreFetchAbort:b,perf:T}=e;if(void 0!==T&&"function"!=typeof T?.now)throw new TypeError("perf option must have a now() method if specified");if(this.#l=T??x,0!==t&&!N(t))throw new TypeError("max option must be a nonnegative integer");const O=t?P(t):Array;if(!O)throw new Error("invalid max value: "+t);if(this.#t=t,this.#r=f,this.maxEntrySize=p||this.#r,this.sizeCalculation=m,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==y&&"function"!=typeof y)throw new TypeError("memoMethod must be a function if defined");if(this.#a=y,void 0!==g&&"function"!=typeof g)throw new TypeError("fetchMethod must be a function if specified");if(this.#o=g,this.#k=!!g,this.#h=/* @__PURE__ */new Map,this.#d=new Array(t).fill(void 0),this.#f=new Array(t).fill(void 0),this.#p=new O(t),this.#m=new O(t),this.#g=0,this.#y=0,this.#v=R.create(t),this.#c=0,this.#u=0,"function"==typeof l&&(this.#s=l),"function"==typeof c&&(this.#n=c),"function"==typeof u?(this.#i=u,this.#w=[]):(this.#i=void 0,this.#w=void 0),this.#O=!!this.#s,this.#C=!!this.#n,this.#x=!!this.#i,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!E,this.allowStaleOnFetchAbort=!!S,this.ignoreFetchAbort=!!b,0!==this.maxEntrySize){if(0!==this.#r&&!N(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!N(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#L()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!i,this.updateAgeOnHas=!!o,this.ttlResolution=N(s)||0===s?s:1,this.ttlAutopurge=!!n,this.ttl=r||0,this.ttl){if(!N(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#R()}if(0===this.#t&&0===this.ttl&&0===this.#r)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){const e="LRU_CACHE_UNBOUNDED";if((e=>!C.has(e))(e)){C.add(e);A("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,M)}}}getRemainingTTL(e){return this.#h.has(e)?1/0:0}#R(){const e=new L(this.#t),t=new L(this.#t);this.#b=e,this.#S=t;const r=this.ttlAutopurge?new Array(this.#t):void 0;this.#T=r,this.#M=(s,n,i=this.#l.now())=>{if(t[s]=0!==n?i:0,e[s]=n,r?.[s]&&(clearTimeout(r[s]),r[s]=void 0),0!==n&&r){const e=setTimeout(()=>{this.#P(s)&&this.#D(this.#d[s],"expire")},n+1);e.unref&&e.unref(),r[s]=e}},this.#z=r=>{t[r]=0!==e[r]?this.#l.now():0},this.#I=(r,i)=>{if(e[i]){const o=e[i],a=t[i];if(!o||!a)return;r.ttl=o,r.start=a,r.now=s||n();const l=r.now-a;r.remainingTTL=o-l}};let s=0;const n=()=>{const e=this.#l.now();if(this.ttlResolution>0){s=e;const t=setTimeout(()=>s=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=r=>{const i=this.#h.get(r);if(void 0===i)return 0;const o=e[i],a=t[i];if(!o||!a)return 1/0;return o-((s||n())-a)},this.#P=r=>{const i=t[r],o=e[r];return!!o&&!!i&&(s||n())-i>o}}#z=()=>{};#I=()=>{};#M=()=>{};#P=()=>!1;#L(){const e=new L(this.#t);this.#u=0,this.#E=e,this.#H=t=>{this.#u-=e[t],e[t]=0},this.#j=(e,t,r,s)=>{if(this.#_(t))return 0;if(!N(r)){if(!s)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof s)throw new TypeError("sizeCalculation must be a function");if(r=s(t,e),!N(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.#V=(t,r,s)=>{if(e[t]=r,this.#r){const r=this.#r-e[t];for(;this.#u>r;)this.#U(!0)}this.#u+=e[t],s&&(s.entrySize=r,s.totalCalculatedSize=this.#u)}}#H=e=>{};#V=(e,t,r)=>{};#j=(e,t,r,s)=>{if(r||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#$({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#y;this.#W(t)&&(!e&&this.#P(t)||(yield t),t!==this.#g);)t=this.#m[t]}*#N({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#g;this.#W(t)&&(!e&&this.#P(t)||(yield t),t!==this.#y);)t=this.#p[t]}#W(e){return void 0!==e&&this.#h.get(this.#d[e])===e}*entries(){for(const e of this.#$())void 0===this.#f[e]||void 0===this.#d[e]||this.#_(this.#f[e])||(yield[this.#d[e],this.#f[e]])}*rentries(){for(const e of this.#N())void 0===this.#f[e]||void 0===this.#d[e]||this.#_(this.#f[e])||(yield[this.#d[e],this.#f[e]])}*keys(){for(const e of this.#$()){const t=this.#d[e];void 0===t||this.#_(this.#f[e])||(yield t)}}*rkeys(){for(const e of this.#N()){const t=this.#d[e];void 0===t||this.#_(this.#f[e])||(yield t)}}*values(){for(const e of this.#$()){void 0===this.#f[e]||this.#_(this.#f[e])||(yield this.#f[e])}}*rvalues(){for(const e of this.#N()){void 0===this.#f[e]||this.#_(this.#f[e])||(yield this.#f[e])}}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(const r of this.#$()){const s=this.#f[r],n=this.#_(s)?s.__staleWhileFetching:s;if(void 0!==n&&e(n,this.#d[r],this))return this.get(this.#d[r],t)}}forEach(e,t=this){for(const r of this.#$()){const s=this.#f[r],n=this.#_(s)?s.__staleWhileFetching:s;void 0!==n&&e.call(t,n,this.#d[r],this)}}rforEach(e,t=this){for(const r of this.#N()){const s=this.#f[r],n=this.#_(s)?s.__staleWhileFetching:s;void 0!==n&&e.call(t,n,this.#d[r],this)}}purgeStale(){let e=!1;for(const t of this.#N({allowStale:!0}))this.#P(t)&&(this.#D(this.#d[t],"expire"),e=!0);return e}info(e){const t=this.#h.get(e);if(void 0===t)return;const r=this.#f[t],s=this.#_(r)?r.__staleWhileFetching:r;if(void 0===s)return;const n={value:s};if(this.#b&&this.#S){const e=this.#b[t],r=this.#S[t];if(e&&r){const t=e-(this.#l.now()-r);n.ttl=t,n.start=Date.now()}}return this.#E&&(n.size=this.#E[t]),n}dump(){const e=[];for(const t of this.#$({allowStale:!0})){const r=this.#d[t],s=this.#f[t],n=this.#_(s)?s.__staleWhileFetching:s;if(void 0===n||void 0===r)continue;const i={value:n};if(this.#b&&this.#S){i.ttl=this.#b[t];const e=this.#l.now()-this.#S[t];i.start=Math.floor(Date.now()-e)}this.#E&&(i.size=this.#E[t]),e.unshift([r,i])}return e}load(e){this.clear();for(const[t,r]of e){if(r.start){const e=Date.now()-r.start;r.start=this.#l.now()-e}this.set(t,r.value,r)}}set(e,t,r={}){if(void 0===t)return this.delete(e),this;const{ttl:s=this.ttl,start:n,noDisposeOnSet:i=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:a}=r;let{noUpdateTTL:l=this.noUpdateTTL}=r;const c=this.#j(e,t,r.size||0,o);if(this.maxEntrySize&&c>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#D(e,"set"),this;let u=0===this.#c?void 0:this.#h.get(e);if(void 0===u)u=0===this.#c?this.#y:0!==this.#v.length?this.#v.pop():this.#c===this.#t?this.#U(!1):this.#c,this.#d[u]=e,this.#f[u]=t,this.#h.set(e,u),this.#p[this.#y]=u,this.#m[u]=this.#y,this.#y=u,this.#c++,this.#V(u,c,a),a&&(a.set="add"),l=!1,this.#C&&this.#n?.(t,e,"add");else{this.#F(u);const r=this.#f[u];if(t!==r){if(this.#k&&this.#_(r)){r.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:t}=r;void 0===t||i||(this.#O&&this.#s?.(t,e,"set"),this.#x&&this.#w?.push([t,e,"set"]))}else i||(this.#O&&this.#s?.(r,e,"set"),this.#x&&this.#w?.push([r,e,"set"]));if(this.#H(u),this.#V(u,c,a),this.#f[u]=t,a){a.set="replace";const e=r&&this.#_(r)?r.__staleWhileFetching:r;void 0!==e&&(a.oldValue=e)}}else a&&(a.set="update");this.#C&&this.onInsert?.(t,e,t===r?"update":"replace")}if(0===s||this.#b||this.#R(),this.#b&&(l||this.#M(u,s,n),a&&this.#I(a,u)),!i&&this.#x&&this.#w){const e=this.#w;let t;for(;t=e?.shift();)this.#i?.(...t)}return this}pop(){try{for(;this.#c;){const e=this.#f[this.#g];if(this.#U(!0),this.#_(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#x&&this.#w){const e=this.#w;let t;for(;t=e?.shift();)this.#i?.(...t)}}}#U(e){const t=this.#g,r=this.#d[t],s=this.#f[t];return this.#k&&this.#_(s)?s.__abortController.abort(new Error("evicted")):(this.#O||this.#x)&&(this.#O&&this.#s?.(s,r,"evict"),this.#x&&this.#w?.push([s,r,"evict"])),this.#H(t),this.#T?.[t]&&(clearTimeout(this.#T[t]),this.#T[t]=void 0),e&&(this.#d[t]=void 0,this.#f[t]=void 0,this.#v.push(t)),1===this.#c?(this.#g=this.#y=0,this.#v.length=0):this.#g=this.#p[t],this.#h.delete(r),this.#c--,t}has(e,t={}){const{updateAgeOnHas:r=this.updateAgeOnHas,status:s}=t,n=this.#h.get(e);if(void 0!==n){const e=this.#f[n];if(this.#_(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#P(n))return r&&this.#z(n),s&&(s.has="hit",this.#I(s,n)),!0;s&&(s.has="stale",this.#I(s,n))}else s&&(s.has="miss");return!1}peek(e,t={}){const{allowStale:r=this.allowStale}=t,s=this.#h.get(e);if(void 0===s||!r&&this.#P(s))return;const n=this.#f[s];return this.#_(n)?n.__staleWhileFetching:n}#A(e,t,r,s){const n=void 0===t?void 0:this.#f[t];if(this.#_(n))return n;const i=new F,{signal:o}=r;o?.addEventListener("abort",()=>i.abort(o.reason),{signal:i.signal});const a={signal:i.signal,options:r,context:s},l=(s,n=!1)=>{const{aborted:o}=i.signal,l=r.ignoreFetchAbort&&void 0!==s;if(r.status&&(o&&!n?(r.status.fetchAborted=!0,r.status.fetchError=i.signal.reason,l&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),o&&!l&&!n)return c(i.signal.reason);const h=u,d=this.#f[t];return(d===u||l&&n&&void 0===d)&&(void 0===s?void 0!==h.__staleWhileFetching?this.#f[t]=h.__staleWhileFetching:this.#D(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,s,a.options))),s},c=s=>{const{aborted:n}=i.signal,o=n&&r.allowStaleOnFetchAbort,a=o||r.allowStaleOnFetchRejection,l=a||r.noDeleteOnFetchRejection,c=u;if(this.#f[t]===u){!l||void 0===c.__staleWhileFetching?this.#D(e,"fetch"):o||(this.#f[t]=c.__staleWhileFetching)}if(a)return r.status&&void 0!==c.__staleWhileFetching&&(r.status.returnedStale=!0),c.__staleWhileFetching;if(c.__returned===c)throw s};r.status&&(r.status.fetchDispatched=!0);const u=new Promise((t,s)=>{const o=this.#o?.(e,n,a);o&&o instanceof Promise&&o.then(e=>t(void 0===e?void 0:e),s),i.signal.addEventListener("abort",()=>{r.ignoreFetchAbort&&!r.allowStaleOnFetchAbort||(t(void 0),r.allowStaleOnFetchAbort&&(t=e=>l(e,!0)))})}).then(l,e=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=e),c(e))),h=Object.assign(u,{__abortController:i,__staleWhileFetching:n,__returned:void 0});return void 0===t?(this.set(e,h,{...a.options,status:void 0}),t=this.#h.get(e)):this.#f[t]=h,h}#_(e){if(!this.#k)return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof F}async fetch(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:f=this.allowStaleOnFetchAbort,context:p,forceRefresh:m=!1,status:g,signal:y}=t;if(!this.#k)return g&&(g.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:g});const v={allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:i,noDisposeOnSet:o,size:a,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:f,ignoreFetchAbort:d,status:g,signal:y};let w=this.#h.get(e);if(void 0===w){g&&(g.fetch="miss");const t=this.#A(e,w,v,p);return t.__returned=t}{const t=this.#f[w];if(this.#_(t)){const e=r&&void 0!==t.__staleWhileFetching;return g&&(g.fetch="inflight",e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}const n=this.#P(w);if(!m&&!n)return g&&(g.fetch="hit"),this.#F(w),s&&this.#z(w),g&&this.#I(g,w),t;const i=this.#A(e,w,v,p),o=void 0!==i.__staleWhileFetching&&r;return g&&(g.fetch=n?"stale":"refresh",o&&n&&(g.returnedStale=!0)),o?i.__staleWhileFetching:i.__returned=i}}async forceFetch(e,t={}){const r=await this.fetch(e,t);if(void 0===r)throw new Error("fetch() returned undefined");return r}memo(e,t={}){const r=this.#a;if(!r)throw new Error("no memoMethod provided to constructor");const{context:s,forceRefresh:n,...i}=t,o=this.get(e,i);if(!n&&void 0!==o)return o;const a=r(e,o,{options:i,context:s});return this.set(e,a,i),a}get(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:i}=t,o=this.#h.get(e);if(void 0!==o){const t=this.#f[o],a=this.#_(t);return i&&this.#I(i,o),this.#P(o)?(i&&(i.get="stale"),a?(i&&r&&void 0!==t.__staleWhileFetching&&(i.returnedStale=!0),r?t.__staleWhileFetching:void 0):(n||this.#D(e,"expire"),i&&r&&(i.returnedStale=!0),r?t:void 0)):(i&&(i.get="hit"),a?t.__staleWhileFetching:(this.#F(o),s&&this.#z(o),t))}i&&(i.get="miss")}#B(e,t){this.#m[t]=e,this.#p[e]=t}#F(e){e!==this.#y&&(e===this.#g?this.#g=this.#p[e]:this.#B(this.#m[e],this.#p[e]),this.#B(this.#y,e),this.#y=e)}delete(e){return this.#D(e,"delete")}#D(e,t){let r=!1;if(0!==this.#c){const s=this.#h.get(e);if(void 0!==s)if(this.#T?.[s]&&(clearTimeout(this.#T?.[s]),this.#T[s]=void 0),r=!0,1===this.#c)this.#Z(t);else{this.#H(s);const r=this.#f[s];if(this.#_(r)?r.__abortController.abort(new Error("deleted")):(this.#O||this.#x)&&(this.#O&&this.#s?.(r,e,t),this.#x&&this.#w?.push([r,e,t])),this.#h.delete(e),this.#d[s]=void 0,this.#f[s]=void 0,s===this.#y)this.#y=this.#m[s];else if(s===this.#g)this.#g=this.#p[s];else{const e=this.#m[s];this.#p[e]=this.#p[s];const t=this.#p[s];this.#m[t]=this.#m[s]}this.#c--,this.#v.push(s)}}if(this.#x&&this.#w?.length){const e=this.#w;let t;for(;t=e?.shift();)this.#i?.(...t)}return r}clear(){return this.#Z("delete")}#Z(e){for(const t of this.#N({allowStale:!0})){const r=this.#f[t];if(this.#_(r))r.__abortController.abort(new Error("deleted"));else{const s=this.#d[t];this.#O&&this.#s?.(r,s,e),this.#x&&this.#w?.push([r,s,e])}}if(this.#h.clear(),this.#f.fill(void 0),this.#d.fill(void 0),this.#b&&this.#S){this.#b.fill(0),this.#S.fill(0);for(const e of this.#T??[])void 0!==e&&clearTimeout(e);this.#T?.fill(void 0)}if(this.#E&&this.#E.fill(0),this.#g=0,this.#y=0,this.#v.length=0,this.#u=0,this.#c=0,this.#x&&this.#w){const e=this.#w;let t;for(;t=e?.shift();)this.#i?.(...t)}}}const D=class e extends k{constructor(){super(),this.cache=new M({max:500})}static constructFromServiceResolver(){return new e}static createCacheKey(e){return`${e}`}setFromCollection(t){for(let r=0;r<t.nodes.length;r++)this.setFromDataEtag(e.createCacheKey(t.nodes[r].id),t.nodes[r]);for(let r=0;r<t.relations.length;r++)this.setFromDataEtag(e.createCacheKey(t.relations[r].id),t.relations[r]);return this}};D.identifier=o.cacheElement;let z=D;const I=class e extends k{constructor(){super(),this.cache=new M({max:50})}static constructFromServiceResolver(){return new e}static createCacheKey(e,t,r){return`${e}-${t}-${r}`}};I.identifier=o.cacheElementChildren;let H=I;const j=class e extends k{constructor(){super(),this.cache=new M({max:50})}static constructFromServiceResolver(){return new e}static createCacheKey(e,t,r){return`${e}-${t}-${r}`}};j.identifier=o.cacheElementParents;let V=j;const U=class e extends k{constructor(){super(),this.cache=new M({max:50})}static constructFromServiceResolver(){return new e}static createCacheKey(e,t,r){return`${e}-${t}-${r}`}};U.identifier=o.cacheElementRelated;let W=U;const B=class e extends k{constructor(){super(),this.cache=new M({max:50})}static constructFromServiceResolver(){return new e}static createCacheKey(e,t){return`${e}-${t}`}};B.identifier=o.cacheIndex;let Z=B;const q=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,Cache:k,ElementCache:z,ElementChildrenCache:H,ElementParentsCache:V,ElementRelatedCache:W,IndexCache:Z},Symbol.toStringTag,{value:"Module"})),G=globalThis,J=G.ShadowRoot&&(void 0===G.ShadyCSS||G.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Y=/* @__PURE__ */Symbol(),K=/* @__PURE__ */new WeakMap;let Q=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==Y)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(J&&void 0===e){const r=void 0!==t&&1===t.length;r&&(e=K.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&K.set(t,e))}return e}toString(){return this.cssText}};const X=J?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return(e=>new Q("string"==typeof e?e:e+"",void 0,Y))(t)})(e):e,{is:ee,defineProperty:te,getOwnPropertyDescriptor:re,getOwnPropertyNames:se,getOwnPropertySymbols:ne,getPrototypeOf:ie}=Object,oe=globalThis,ae=oe.trustedTypes,le=ae?ae.emptyScript:"",ce=oe.reactiveElementPolyfillSupport,ue=(e,t)=>e,he={toAttribute(e,t){switch(t){case Boolean:e=e?le:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=null!==e;break;case Number:r=null===e?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch(s){r=null}}return r}},de=(e,t)=>!ee(e,t),fe={attribute:!0,type:String,converter:he,reflect:!1,useDefault:!1,hasChanged:de};Symbol.metadata??=/* @__PURE__ */Symbol("metadata"),oe.litPropertyMetadata??=/* @__PURE__ */new WeakMap;let pe=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=fe){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const r=/* @__PURE__ */Symbol(),s=this.getPropertyDescriptor(e,r,t);void 0!==s&&te(this.prototype,e,s)}}static getPropertyDescriptor(e,t,r){const{get:s,set:n}=re(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:s,set(t){const i=s?.call(this);n?.call(this,t),this.requestUpdate(e,i,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??fe}static _$Ei(){if(this.hasOwnProperty(ue("elementProperties")))return;const e=ie(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ue("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ue("properties"))){const e=this.properties,t=[...se(e),...ne(e)];for(const r of t)this.createProperty(r,e[r])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,r]of t)this.elementProperties.set(e,r)}this._$Eh=/* @__PURE__ */new Map;for(const[t,r]of this.elementProperties){const e=this._$Eu(t,r);void 0!==e&&this._$Eh.set(e,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const e of r)t.unshift(X(e))}else void 0!==e&&t.push(X(e));return t}static _$Eu(e,t){const r=t.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=/* @__PURE__ */new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=/* @__PURE__ */new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=/* @__PURE__ */new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(J)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const r of t){const t=document.createElement("style"),s=G.litNonce;void 0!==s&&t.setAttribute("nonce",s),t.textContent=r.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){const r=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,r);if(void 0!==s&&!0===r.reflect){const n=(void 0!==r.converter?.toAttribute?r.converter:he).toAttribute(t,r.type);this._$Em=e,null==n?this.removeAttribute(s):this.setAttribute(s,n),this._$Em=null}}_$AK(e,t){const r=this.constructor,s=r._$Eh.get(e);if(void 0!==s&&this._$Em!==s){const e=r.getPropertyOptions(s),n="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:he;this._$Em=s;const i=n.fromAttribute(t,e.type);this[s]=i??this._$Ej?.get(s)??i,this._$Em=null}}requestUpdate(e,t,r,s=!1,n){if(void 0!==e){const i=this.constructor;if(!1===s&&(n=this[e]),r??=i.getPropertyOptions(e),!((r.hasChanged??de)(n,t)||r.useDefault&&r.reflect&&n===this._$Ej?.get(e)&&!this.hasAttribute(i._$Eu(e,r))))return;this.C(e,t,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:s,wrapped:n},i){r&&!(this._$Ej??=/* @__PURE__ */new Map).has(e)&&(this._$Ej.set(e,i??t??this[e]),!0!==n||void 0!==i)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),!0===s&&this._$Em!==e&&(this._$Eq??=/* @__PURE__ */new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,r]of e){const{wrapped:e}=r,s=this[t];!0!==e||this._$AL.has(t)||void 0===s||this.C(t,void 0,r,s)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(r){throw e=!1,this._$EM(),r}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=/* @__PURE__ */new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};pe.elementStyles=[],pe.shadowRootOptions={mode:"open"},pe[ue("elementProperties")]=/* @__PURE__ */new Map,pe[ue("finalized")]=/* @__PURE__ */new Map,ce?.({ReactiveElement:pe}),(oe.reactiveElementVersions??=[]).push("2.1.2");const me=globalThis,ge=e=>e,ye=me.trustedTypes,ve=ye?ye.createPolicy("lit-html",{createHTML:e=>e}):void 0,we="$lit$",Ee=`lit$${Math.random().toFixed(9).slice(2)}$`,Se="?"+Ee,be=`<${Se}>`,Te=document,Oe=()=>Te.createComment(""),ke=e=>null===e||"object"!=typeof e&&"function"!=typeof e,xe=Array.isArray,Ce="[ \t\n\f\r]",_e=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ae=/-->/g,Fe=/>/g,$e=RegExp(`>|${Ce}(?:([^\\s"'>=/]+)(${Ce}*=${Ce}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),Ne=/'/g,Pe=/"/g,Le=/^(?:script|style|textarea|title)$/i,Re=(He=1,(e,...t)=>({_$litType$:He,strings:e,values:t})),Me=/* @__PURE__ */Symbol.for("lit-noChange"),De=/* @__PURE__ */Symbol.for("lit-nothing"),ze=/* @__PURE__ */new WeakMap,Ie=Te.createTreeWalker(Te,129);var He;function je(e,t){if(!xe(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==ve?ve.createHTML(t):t}class Ve{constructor({strings:e,_$litType$:t},r){let s;this.parts=[];let n=0,i=0;const o=e.length-1,a=this.parts,[l,c]=((e,t)=>{const r=e.length-1,s=[];let n,i=2===t?"<svg>":3===t?"<math>":"",o=_e;for(let a=0;a<r;a++){const t=e[a];let r,l,c=-1,u=0;for(;u<t.length&&(o.lastIndex=u,l=o.exec(t),null!==l);)u=o.lastIndex,o===_e?"!--"===l[1]?o=Ae:void 0!==l[1]?o=Fe:void 0!==l[2]?(Le.test(l[2])&&(n=RegExp("</"+l[2],"g")),o=$e):void 0!==l[3]&&(o=$e):o===$e?">"===l[0]?(o=n??_e,c=-1):void 0===l[1]?c=-2:(c=o.lastIndex-l[2].length,r=l[1],o=void 0===l[3]?$e:'"'===l[3]?Pe:Ne):o===Pe||o===Ne?o=$e:o===Ae||o===Fe?o=_e:(o=$e,n=void 0);const h=o===$e&&e[a+1].startsWith("/>")?" ":"";i+=o===_e?t+be:c>=0?(s.push(r),t.slice(0,c)+we+t.slice(c)+Ee+h):t+Ee+(-2===c?a:h)}return[je(e,i+(e[r]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),s]})(e,t);if(this.el=Ve.createElement(l,r),Ie.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(s=Ie.nextNode())&&a.length<o;){if(1===s.nodeType){if(s.hasAttributes())for(const e of s.getAttributeNames())if(e.endsWith(we)){const t=c[i++],r=s.getAttribute(e).split(Ee),o=/([.?@])?(.*)/.exec(t);a.push({type:1,index:n,name:o[2],strings:r,ctor:"."===o[1]?qe:"?"===o[1]?Ge:"@"===o[1]?Je:Ze}),s.removeAttribute(e)}else e.startsWith(Ee)&&(a.push({type:6,index:n}),s.removeAttribute(e));if(Le.test(s.tagName)){const e=s.textContent.split(Ee),t=e.length-1;if(t>0){s.textContent=ye?ye.emptyScript:"";for(let r=0;r<t;r++)s.append(e[r],Oe()),Ie.nextNode(),a.push({type:2,index:++n});s.append(e[t],Oe())}}}else if(8===s.nodeType)if(s.data===Se)a.push({type:2,index:n});else{let e=-1;for(;-1!==(e=s.data.indexOf(Ee,e+1));)a.push({type:7,index:n}),e+=Ee.length-1}n++}}static createElement(e,t){const r=Te.createElement("template");return r.innerHTML=e,r}}function Ue(e,t,r=e,s){if(t===Me)return t;let n=void 0!==s?r._$Co?.[s]:r._$Cl;const i=ke(t)?void 0:t._$litDirective$;return n?.constructor!==i&&(n?._$AO?.(!1),void 0===i?n=void 0:(n=new i(e),n._$AT(e,r,s)),void 0!==s?(r._$Co??=[])[s]=n:r._$Cl=n),void 0!==n&&(t=Ue(e,n._$AS(e,t.values),n,s)),t}class We{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:r}=this._$AD,s=(e?.creationScope??Te).importNode(t,!0);Ie.currentNode=s;let n=Ie.nextNode(),i=0,o=0,a=r[0];for(;void 0!==a;){if(i===a.index){let t;2===a.type?t=new Be(n,n.nextSibling,this,e):1===a.type?t=new a.ctor(n,a.name,a.strings,this,e):6===a.type&&(t=new Ye(n,this,e)),this._$AV.push(t),a=r[++o]}i!==a?.index&&(n=Ie.nextNode(),i++)}return Ie.currentNode=Te,s}p(e){let t=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}}class Be{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,s){this.type=2,this._$AH=De,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Ue(this,e,t),ke(e)?e===De||null==e||""===e?(this._$AH!==De&&this._$AR(),this._$AH=De):e!==this._$AH&&e!==Me&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>xe(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==De&&ke(this._$AH)?this._$AA.nextSibling.data=e:this.T(Te.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:r}=e,s="number"==typeof r?this._$AC(e):(void 0===r.el&&(r.el=Ve.createElement(je(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===s)this._$AH.p(t);else{const e=new We(s,this),r=e.u(this.options);e.p(t),this.T(r),this._$AH=e}}_$AC(e){let t=ze.get(e.strings);return void 0===t&&ze.set(e.strings,t=new Ve(e)),t}k(e){xe(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,s=0;for(const n of e)s===t.length?t.push(r=new Be(this.O(Oe()),this.O(Oe()),this,this.options)):r=t[s],r._$AI(n),s++;s<t.length&&(this._$AR(r&&r._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=ge(e).nextSibling;ge(e).remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class Ze{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,s,n){this.type=1,this._$AH=De,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=n,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=De}_$AI(e,t=this,r,s){const n=this.strings;let i=!1;if(void 0===n)e=Ue(this,e,t,0),i=!ke(e)||e!==this._$AH&&e!==Me,i&&(this._$AH=e);else{const s=e;let o,a;for(e=n[0],o=0;o<n.length-1;o++)a=Ue(this,s[r+o],t,o),a===Me&&(a=this._$AH[o]),i||=!ke(a)||a!==this._$AH[o],a===De?e=De:e!==De&&(e+=(a??"")+n[o+1]),this._$AH[o]=a}i&&!s&&this.j(e)}j(e){e===De?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class qe extends Ze{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===De?void 0:e}}class Ge extends Ze{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==De)}}class Je extends Ze{constructor(e,t,r,s,n){super(e,t,r,s,n),this.type=5}_$AI(e,t=this){if((e=Ue(this,e,t,0)??De)===Me)return;const r=this._$AH,s=e===De&&r!==De||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,n=e!==De&&(r===De||s);s&&this.element.removeEventListener(this.name,this,r),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class Ye{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){Ue(this,e)}}const Ke=me.litHtmlPolyfillSupport;Ke?.(Ve,Be),(me.litHtmlVersions??=[]).push("3.3.2");const Qe=globalThis;class Xe extends pe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,r)=>{const s=r?.renderBefore??t;let n=s._$litPart$;if(void 0===n){const e=r?.renderBefore??null;s._$litPart$=n=new Be(t.insertBefore(Oe(),e),e,void 0,r??{})}return n._$AI(e),n})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Me}}Xe._$litElement$=!0,Xe.finalized=!0,Qe.litElementHydrateSupport?.({LitElement:Xe});const et=Qe.litElementPolyfillSupport;et?.({LitElement:Xe}),(Qe.litElementVersions??=[]).push("4.2.2");const tt=e=>(t,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},rt=/* @__PURE__ */Symbol.for(""),st=e=>{if(e?.r===rt)return e?._$litStatic$},nt=/* @__PURE__ */new Map,it=(e=>(t,...r)=>{const s=r.length;let n,i;const o=[],a=[];let l,c=0,u=!1;for(;c<s;){for(l=t[c];c<s&&void 0!==(i=r[c],n=st(i));)l+=n+t[++c],u=!0;c!==s&&a.push(i),o.push(l),c++}if(c===s&&o.push(t[s]),u){const e=o.join("$$lit$$");void 0===(t=nt.get(e))&&(o.raw=o,nt.set(e,t=o)),r=a}return e(t,...r)})(Re);var ot=Object.getOwnPropertyDescriptor;let at=class extends Xe{render(){return it`<div>Error 404: Route could not be resolved.</div>`}};at=((e,t,r,s)=>{for(var n,i=s>1?void 0:s?ot(t,r):t,o=e.length-1;o>=0;o--)(n=e[o])&&(i=n(i)||i);return i})([tt("ember-nexus-app-core-page-error-404")],at);const lt=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,get PageError404(){return at}},Symbol.toStringTag,{value:"Module"})),ct=class e{constructor(e){this.logger=e,this.token=null,this.apiHost="",this.elementCacheMaxEntries=100,this.collectionCacheMaxEntries=50,this.collectionPageSize=25}static constructFromServiceResolver(t){const r=t.getServiceOrFail(o.logger);return new e(r)}hasToken(){return null!==this.token}getToken(){return this.token}setToken(e){return this.token=e,this}getApiHost(){return this.apiHost}setApiHost(e){return e.endsWith("/")&&(this.logger.warn("Removed trailing slash from API host configuration due to internal requirement. Please check if trailing slash can be directly removed."),e=e.replace(/\/+$/,"")),this.apiHost=e,this}getElementCacheMaxEntries(){return this.elementCacheMaxEntries}setElementCacheMaxEntries(e){return this.elementCacheMaxEntries=e,this}getCollectionCacheMaxEntries(){return this.collectionCacheMaxEntries}setCollectionCacheMaxEntries(e){return this.collectionCacheMaxEntries=e,this}getCollectionPageSize(){return this.collectionPageSize}setCollectionPageSize(e){return this.collectionPageSize=e,this}};ct.identifier=o.serviceApiConfiguration;let ut=ct;const ht=class e{constructor(e,t,r,s,n,i,o,a,l,c,u,h,d,f,p,m,g,y,v,w,E){this.getElementEndpoint=e,this.getElementChildrenEndpoint=t,this.getElementParentsEndpoint=r,this.getElementRelatedEndpoint=s,this.getIndexEndpoint=n,this.postIndexEndpoint=i,this.postElementEndpoint=o,this.putElementEndpoint=a,this.patchElementEndpoint=l,this.deleteElementEndpoint=c,this.postRegisterEndpoint=u,this.postChangePasswordEndpoint=h,this.getMeEndpoint=d,this.postTokenEndpoint=f,this.getTokenEndpoint=p,this.deleteTokenEndpoint=m,this.elementCache=g,this.elementChildrenCache=y,this.elementParentsCache=v,this.elementRelatedCache=w,this.indexCache=E}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.endpointElementGetElementEndpoint),t.getServiceOrFail(o.endpointElementGetElementChildrenEndpoint),t.getServiceOrFail(o.endpointElementGetElementParentsEndpoint),t.getServiceOrFail(o.endpointElementGetElementRelatedEndpoint),t.getServiceOrFail(o.endpointElementGetIndexEndpoint),t.getServiceOrFail(o.endpointElementPostIndexEndpoint),t.getServiceOrFail(o.endpointElementPostElementEndpoint),t.getServiceOrFail(o.endpointElementPutElementEndpoint),t.getServiceOrFail(o.endpointElementPatchElementEndpoint),t.getServiceOrFail(o.endpointElementDeleteElementEndpoint),t.getServiceOrFail(o.endpointUserPostRegisterEndpoint),t.getServiceOrFail(o.endpointUserPostChangePasswordEndpoint),t.getServiceOrFail(o.endpointUserGetMeEndpoint),t.getServiceOrFail(o.endpointUserPostTokenEndpoint),t.getServiceOrFail(o.endpointUserGetTokenEndpoint),t.getServiceOrFail(o.endpointUserDeleteTokenEndpoint),t.getServiceOrFail(o.cacheElement),t.getServiceOrFail(o.cacheElementChildren),t.getServiceOrFail(o.cacheElementParents),t.getServiceOrFail(o.cacheElementRelated),t.getServiceOrFail(o.cacheIndex))}async getElement(e,{forceLoad:t=!1}={}){const r=z.createCacheKey(e),s=this.elementCache.get(r);if(s&&!t)return s.data;if(s){const t=await this.getElementEndpoint.getElement(e,s.etag);return"data"in t?(this.elementCache.setFromParsedResponse(r,t),t.data):(this.elementCache.refresh(r),s.data)}const n=await this.getElementEndpoint.getElement(e);return this.elementCache.setFromParsedResponse(r,n),n.data}async getElementChildren(e,{page:t=1,pageSize:r=25,forceLoad:s=!1}={}){const n=H.createCacheKey(e,t,r),i=this.elementChildrenCache.get(n);if(i&&!s)return i.data;if(i){const s=await this.getElementChildrenEndpoint.getElementChildren(e,t,r,i.etag);return"data"in s?(this.elementChildrenCache.setFromParsedResponse(n,s),this.elementCache.setFromCollection(s.data),s.data):(this.elementChildrenCache.refresh(n),i.data)}const o=await this.getElementChildrenEndpoint.getElementChildren(e,t,r);return this.elementChildrenCache.setFromParsedResponse(n,o),this.elementCache.setFromCollection(o.data),o.data}async getElementParents(e,{page:t=1,pageSize:r=25,forceLoad:s=!1}={}){const n=V.createCacheKey(e,t,r),i=this.elementParentsCache.get(n);if(i&&!s)return i.data;if(i){const s=await this.getElementParentsEndpoint.getElementParents(e,t,r,i.etag);return"data"in s?(this.elementParentsCache.setFromParsedResponse(n,s),this.elementCache.setFromCollection(s.data),s.data):(this.elementParentsCache.refresh(n),i.data)}const o=await this.getElementParentsEndpoint.getElementParents(e,t,r);return this.elementParentsCache.setFromParsedResponse(n,o),this.elementCache.setFromCollection(o.data),o.data}async getElementRelated(e,{page:t=1,pageSize:r=25,forceLoad:s=!1}={}){const n=W.createCacheKey(e,t,r),i=this.elementRelatedCache.get(n);if(i&&!s)return i.data;if(i){const s=await this.getElementRelatedEndpoint.getElementRelated(e,t,r,i.etag);return"data"in s?(this.elementRelatedCache.setFromParsedResponse(n,s),this.elementCache.setFromCollection(s.data),s.data):(this.elementRelatedCache.refresh(n),i.data)}const o=await this.getElementRelatedEndpoint.getElementRelated(e,t,r);return this.elementRelatedCache.setFromParsedResponse(n,o),this.elementCache.setFromCollection(o.data),o.data}async getIndex({page:e=1,pageSize:t=25,forceLoad:r=!1}={}){const s=Z.createCacheKey(e,t),n=this.indexCache.get(s);if(n&&!r)return n.data;if(n){const r=await this.getIndexEndpoint.getIndex(e,t,n.etag);return"data"in r?(this.indexCache.setFromParsedResponse(s,r),this.elementCache.setFromCollection(r.data),r.data):(this.indexCache.refresh(s),n.data)}const i=await this.getIndexEndpoint.getIndex(e,t);return this.indexCache.setFromParsedResponse(s,i),this.elementCache.setFromCollection(i.data),i.data}async postIndex(e){return(await this.postIndexEndpoint.postIndex(e)).data}async postElement(e,t){return(await this.postElementEndpoint.postElement(e,t)).data}async putElement(e,t){await this.putElementEndpoint.putElement(e,t),this.elementCache.delete(z.createCacheKey(e))}async patchElement(e,t){await this.patchElementEndpoint.patchElement(e,t),this.elementCache.delete(z.createCacheKey(e))}async deleteElement(e){await this.deleteElementEndpoint.deleteElement(e),this.elementCache.delete(z.createCacheKey(e))}async postRegister(e,t,r={}){return(await this.postRegisterEndpoint.postRegister(e,t,r)).data}async postChangePassword(e,t,r){await this.postChangePasswordEndpoint.postChangePassword(e,t,r)}async getMe(){const e=(await this.getMeEndpoint.getMe()).data;return this.elementCache.setFromDataEtag(z.createCacheKey(e.id),e),e}async postToken(e,t,r={}){return(await this.postTokenEndpoint.postToken(e,t,r)).data}async getToken(){const e=(await this.getTokenEndpoint.getToken()).data;return this.elementCache.setFromDataEtag(z.createCacheKey(e.id),e),e}async deleteToken(){await this.deleteTokenEndpoint.deleteToken()}};ht.identifier=o.serviceApiWrapper;let dt=ht;const ft=class e{constructor(e){this.elementParser=e}static constructFromServiceResolver(t){const r=t.getServiceOrFail(o.serviceElementParser);return new e(r)}async deserializeCollection(e){if(!("id"in e))throw new Error("Raw collection must contain property 'id' in order to be parsed to a collection.");const t=String(e.id);if(!("totalNodes"in e))throw new Error("Raw collection must contain property 'totalNodes' in order to be parsed to a collection.");const r=Number(e.totalNodes);if(!("links"in e))throw new Error("Raw collection must contain property 'links' in order to be parsed to a collection.");if("object"!=typeof e.links||null===e.links)throw new Error("Links property in raw collection must be of type object.");const s=e.links;if(!("first"in s))throw new Error("Raw collection must contain property 'links.first' in order to be parsed to a collection.");const n=String(s.first);if(!("previous"in s))throw new Error("Raw collection must contain property 'links.previous' in order to be parsed to a collection.");const i=null===s.previous?null:String(s.previous);if(!("next"in s))throw new Error("Raw collection must contain property 'links.next' in order to be parsed to a collection.");const o=null===s.next?null:String(s.next);if(!("last"in s))throw new Error("Raw collection must contain property 'links.last' in order to be parsed to a collection.");const a=String(s.last);if(!("nodes"in e))throw new Error("Raw collection must contain property 'nodes' in order to be parsed to a collection.");if(!Array.isArray(e.nodes))throw new Error("Nodes property in raw collection must be of type array.");const l=[];for(const u of e.nodes)l.push(await this.elementParser.deserializeElement(u));if(!("relations"in e))throw new Error("Raw collection must contain property 'relations' in order to be parsed to a collection.");if(!Array.isArray(e.relations))throw new Error("Relations property in raw collection must be of type array.");const c=[];for(const u of e.relations)c.push(await this.elementParser.deserializeElement(u));return{id:t,totalNodes:r,links:{first:n,previous:i,next:o,last:a},nodes:l,relations:c}}};ft.identifier=o.serviceCollectionParser;let pt=ft;class mt{constructor(e){this.stopped=!1,this.identifier=e}getIdentifier(){return this.identifier}isPropagationStopped(){return this.stopped}stopPropagation(){return this.stopped=!0,this}}const gt=/^([a-z][a-z0-9-]*)(\.([a-z][a-z0-9-]*))*$/;const yt=/^(?:([a-z][a-z0-9-]*)(\.([a-z][a-z0-9-]*))*|\*|([a-z][a-z0-9-]*)(\.([a-z][a-z0-9-]*))*(\.\*))$/;function vt(e){if(!yt.test(e))throw new y("Passed variable is not a valid event listener target.");return e}function wt(e){const t=e.split("."),r=[];r.push(vt(e));for(let s=t.length-1;s>0;s--)r.push(vt(t.slice(0,s).join(".")+".*"));return r.push(vt("*")),r}const Et=/^([a-z]+)(-*[a-z0-9]+)*$/;class St{constructor(){this.entries=/* @__PURE__ */new Map}clearEntries(){return this.entries.clear(),this}deleteEntry(e){return this.entries.delete(e),this}getEntry(e){if(!this.hasEntry(e))return null;const t=this.entries.get(e);return t[t.length-1].entry}hasEntry(e){return this.entries.has(e)}setEntry(e,t,r){let s;void 0===r&&(r=0),this.entries.has(e)?s=this.entries.get(e):(s=[],this.entries.set(e,s));let n=0,i=s.length-1,o=-1;for(;n<=i;){const e=Math.floor((n+i)/2);s[e].priority>=r?(o=e,i=e-1):n=e+1}const a=-1===o?n:o;return s.splice(a,0,{priority:r,entry:t}),this}getAllEntriesForKey(e){return this.entries.has(e)?this.entries.get(e).map(e=>e.entry):null}}class bt{constructor(){this.entries=/* @__PURE__ */new Map}clearEntries(){return this.entries.clear(),this}deleteEntry(e){return this.entries.delete(e),this}getEntry(e){return this.hasEntry(e)?this.entries.get(e):null}hasEntry(e){return this.entries.has(e)}setEntry(e,t){return this.entries.set(e,t),this}}const Tt=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Ot=/^([a-z]+)(-*[a-z0-9]+)*$/;class kt{constructor(){this.childRouteNodes={},this.routeHandler=[]}getChildRouteNode(e){return e in this.childRouteNodes||(this.childRouteNodes[e]=new kt),this.childRouteNodes[e]}hasChildRouteNode(e){return e in this.childRouteNodes}addRouteHandler(e){return this.routeHandler.includes(e)||this.routeHandler.push(e),this}getRouteHandlers(){return this.routeHandler}}const xt=/^([a-z][a-z0-9-]*)(\.([a-z][a-z0-9-]*))*$/;const Ct=/^secret-token:.+$/;function _t(e){if(!Ct.test(e))throw new Error("Passed variable is not a valid token.");return e}const At=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;function Ft(e){if(!At.test(e))throw new y("Passed variable is not a valid UUID v4.");return e}const $t=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,Event:mt,PriorityRegistry:St,Registry:bt,Response:Tt,RouteNode:kt,createUniqueUserIdentifierFromString:function(e){return e},eventIdentifierRegex:gt,eventListenerTargetRegex:yt,getEventListenerTargetsFromEventIdentifier:wt,pluginIdentifierRegex:Et,routeIdentifierRegex:Ot,serviceIdentifierRegex:xt,tokenRegex:Ct,uuidv4Regex:At,validateEventIdentifierFromString:function(e){if(!gt.test(e))throw new y("Passed variable is not a valid event identifier.");return e},validateEventListenerTargetFromString:vt,validatePluginIdentifierFromString:function(e){if(!Et.test(e))throw new y("Passed variable is not a valid plugin identifier.");return e},validateRouteIdentifierFromString:function(e){if(!Ot.test(e))throw new y("Passed variable is not a valid route identifier.");return e},validateServiceIdentifierFromString:function(e){if(!xt.test(e))throw new y("Passed variable is not a valid service identifier.");return e},validateTokenFromString:_t,validateUuidFromString:Ft},Symbol.toStringTag,{value:"Module"})),Nt=class e extends mt{constructor(t){super(e.identifier),this.normalizedValue=t,this.rawValue=null}getNormalizedValue(){return this.normalizedValue}getRawValue(){return this.rawValue}setRawValue(e){return this.isPropagationStopped()||(this.rawValue=e),this}};Nt.identifier=r.NormalizedValueToRawValueEvent;let Pt=Nt;const Lt=class e extends mt{constructor(t){super(e.identifier),this.rawValue=t,this.normalizedValue=null}getRawValue(){return this.rawValue}getNormalizedValue(){return this.normalizedValue}setNormalizedValue(e){return this.isPropagationStopped()||(this.normalizedValue=e),this}};Lt.identifier=r.RawValueToNormalizedValueEvent;let Rt=Lt;const Mt=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,NormalizedValueToRawValueEvent:Pt,RawValueToNormalizedValueEvent:Rt},Symbol.toStringTag,{value:"Module"})),Dt=class e{constructor(e){this.eventDispatcher=e}static constructFromServiceResolver(t){const r=t.getServiceOrFail(o.serviceEventDispatcher);return new e(r)}async deserializeElement(e){if(!("id"in e))throw new Error("Raw element must contain property 'id' in order to be parsed to a node or relation.");const t=Ft(String(e.id));if(!("type"in e))throw new Error("Raw element must contain property 'type' in order to be parsed to a node or relation.");const r=String(e.type);if(!("data"in e))throw new Error("Raw element must contain property 'data' in order to be parsed to a node or relation.");const s=e.data;for(const n in s){const e=new Rt(s[n]);if(await this.eventDispatcher.dispatchEvent(e),!e.isPropagationStopped())throw new Error(`Unable to deserialize property "${n}".`);s[n]=e.getNormalizedValue()}if("start"in e&&"end"in e){return{id:t,start:Ft(String(e.start)),end:Ft(String(e.end)),type:r,data:s}}return{id:t,type:r,data:s}}};Dt.identifier=o.serviceElementParser;let zt=Dt;const It=class e{constructor(e){this.logger=e,this.isSilent=!0,this.eventListenerTargets=/* @__PURE__ */new Map}static constructFromServiceResolver(t){const r=t.getServiceOrFail(o.logger);return new e(r)}setSilent(e){return this.isSilent=e,this}async dispatchEvent(e){if(this.isSilent||this.logger.debug(`Dispatching event of identifier ${e.getIdentifier()}.`,{event:e}),e.isPropagationStopped())return void(this.isSilent||this.logger.debug("Stopped event propagation because it is already stopped.",{event:e}));const t=wt(e.getIdentifier());for(let s=0;s<t.length;++s){const n=t[s],i=this.eventListenerTargets.get(n);if(void 0!==i){this.isSilent||this.logger.debug(`Iterating over resolved event listeners of identifier ${n}`,{event:e});for(let t=i.length-1;t>=0;t--){try{await Promise.resolve(i[t].eventListener.onEvent(e))}catch(r){this.logger.error("Event handler threw exception, dispatcher continues with next event listener.",{event:e,error:r})}if(e.isPropagationStopped())return void(this.isSilent||this.logger.debug("Stopped event propagation as it got stopped.",{event:e}))}}}this.isSilent||this.logger.debug("Event got handled by all event listeners.",{event:e})}addListener(e,t,r){let s;void 0===r&&(r=0),s=this.eventListenerTargets.has(e)?this.eventListenerTargets.get(e):[];let n=0,i=s.length-1,o=-1;for(;n<=i;){const e=Math.floor((n+i)/2);s[e].priority>=r?(o=e,i=e-1):n=e+1}const a=-1===o?n:o;return s.splice(a,0,{priority:r,eventListener:t}),this.eventListenerTargets.set(e,s),this}removeListener(e,t){const r=this.eventListenerTargets.get(e);if(!r)return this;for(let s=0;s<r.length;++s)if(r[s].eventListener===t){r.splice(s,1);break}return 0===r.length&&this.eventListenerTargets.delete(e),this}getListeners(e){const t=this.eventListenerTargets.get(e);return t?t.map(e=>e.eventListener):[]}hasListeners(e){return this.eventListenerTargets.has(e)}};It.identifier=o.serviceEventDispatcher;let Ht=It;const jt=class e{constructor(e,t){this.logger=e,this.apiConfiguration=t}static constructFromServiceResolver(t){const r=t.getServiceOrFail(o.logger),s=t.getServiceOrFail(o.serviceApiConfiguration);return new e(r,s)}rethrowErrorAsNetworkError(e){if(e instanceof p)throw e;throw new g("Network error occurred during fetch.",e)}logAndThrowError(e){const t=e instanceof Error?e:new Error(String(e));throw this.logger.error(t.message,t),t}async parseJsonResponse(e){const t=e.headers.get("Content-Type");if(!t)return Promise.reject(new y("Response does not contain a Content-Type header."));if(!t.includes("application/json")&&!t.includes("application/problem+json"))return Promise.reject(new y(`Unexpected Content-Type: "${t}". Expected JSON-compatible format.`));const r=await e.json().catch(e=>{throw new y(`Failed to parse response body as JSON: ${e}`)});if(!e.ok)throw this.createResponseErrorFromBadResponse(e,r);return r}async parseEmptyResponse(e){if(e.ok&&204===e.status)return;const t=e.headers.get("Content-Type");if(null===t)throw new y("Response does not contain content type header.");if(!t.includes("application/problem+json"))throw new y("Unable to parse response as content type is not 'application/problem+json'.");const r=await e.json().catch(e=>{throw new y(`Failed to parse response body as JSON: ${e}`)});throw this.createResponseErrorFromBadResponse(e,r)}parseLocationResponse(e){if(e.ok&&(201===e.status||204===e.status)&&e.headers.has("Location")){const t=e.headers.get("Location").split("/").at(-1);return Promise.resolve(Ft(t))}const t=e.headers.get("Content-Type");return null===t?Promise.reject(new y("Response does not contain content type header.")):t.includes("application/problem+json")?e.json().catch(e=>{throw new y(`Failed to parse response body as JSON: ${e}`)}).then(t=>{throw this.createResponseErrorFromBadResponse(e,t)}):Promise.reject(new y("Unable to parse response as content type is not 'application/problem+json'."))}createResponseErrorFromBadResponse(e,t){let r=null;return 401===e.status&&(r=new w("Server returned 401 unauthorized.")),403===e.status&&(r=new E("Server returned 403 forbidden.")),404===e.status&&(r=new S("Server returned 404 not found.")),429===e.status&&(r=new b("Server returned 429 too many requests.")),null===r&&(r=new v("Generic response error.")),"type"in t&&r.setType(String(t.type)),"title"in t&&r.setTitle(String(t.title)),"detail"in t&&r.setDetail(String(t.detail)),"status"in t&&null===r.getStatus()&&r.setStatus(Number(t.status)),r}addAuthorizationHeader(e){this.apiConfiguration.hasToken()&&(e.Authorization=`Bearer ${this.apiConfiguration.getToken()}`)}addAcceptJsonAndProblemJsonHeader(e){e.Accept="application/json, application/problem+json"}addIfNoneMatchHeader(e,t){e["If-None-Match"]=t}addContentTypeJsonHeader(e){e["Content-Type"]="application/json"}getDefaultGetOptions(e){const t={};return this.addAuthorizationHeader(t),this.addAcceptJsonAndProblemJsonHeader(t),void 0!==e&&this.addIfNoneMatchHeader(t,e),{method:s.GET,headers:t,redirect:"follow",referrerPolicy:"no-referrer",cache:"no-store"}}getDefaultDeleteOptions(){const e={};return this.addAuthorizationHeader(e),this.addAcceptJsonAndProblemJsonHeader(e),{method:s.DELETE,headers:e,redirect:"follow",referrerPolicy:"no-referrer"}}getDefaultPostOptions(e){const t={};return this.addAuthorizationHeader(t),this.addAcceptJsonAndProblemJsonHeader(t),this.addContentTypeJsonHeader(t),{method:s.POST,headers:t,redirect:"follow",referrerPolicy:"no-referrer",body:e}}getDefaultPatchOptions(e){const t={};return this.addAuthorizationHeader(t),this.addAcceptJsonAndProblemJsonHeader(t),this.addContentTypeJsonHeader(t),{method:s.PATCH,headers:t,redirect:"follow",referrerPolicy:"no-referrer",body:e}}getDefaultPutOptions(e){const t={};return this.addAuthorizationHeader(t),this.addAcceptJsonAndProblemJsonHeader(t),this.addContentTypeJsonHeader(t),{method:s.PUT,headers:t,redirect:"follow",referrerPolicy:"no-referrer",body:e}}buildUrl(e){return`${this.apiConfiguration.getApiHost()}${e}`}runWrappedFetch(e,t){return e=`${this.apiConfiguration.getApiHost()}${e}`,this.logger.debug(`Executing HTTP ${t?.method??"-"} request against url ${e} .`),fetch(e,t)}};jt.identifier=o.serviceFetchHelper;let Vt=jt;const Ut=class{constructor(){this.routes=/* @__PURE__ */new Map,this.rootNode=new kt}hasRouteConfiguration(e){return this.routes.has(String(e))}getRouteConfiguration(e){const t=this.routes.get(String(e));return void 0===t?null:t}getRouteConfigurationOrFail(e){const t=this.routes.get(String(e));if(void 0===t)throw new Error(`Requested route with identifier ${String(e)} could not be resolved.`);return t}getSegmentsFromRoute(e){return e.replace(/^\/+|\/+$/g,"").split("/").filter(Boolean)}addRouteConfiguration(e){this.routes.set(String(e.routeIdentifier),e);const t=this.getSegmentsFromRoute(e.route);let r=this.rootNode;for(let s=0;s<t.length;s++)r=r.getChildRouteNode(t[s]);return r.addRouteHandler(e.routeIdentifier),this}findRouteConfigurationsByNodeAndSegments(e,t){if(0===t.length)return e.getRouteHandlers();const r=[];return e.hasChildRouteNode(t[0])&&r.push(...this.findRouteConfigurationsByNodeAndSegments(e.getChildRouteNode(t[0]),t.slice(1))),e.hasChildRouteNode("*")&&r.push(...this.findRouteConfigurationsByNodeAndSegments(e.getChildRouteNode("*"),t.slice(1))),r}async findRouteConfiguration(e){const t=this.getSegmentsFromRoute(e);let r=this.findRouteConfigurationsByNodeAndSegments(this.rootNode,t);r=[...new Set(r)];const s=r.map(e=>this.getRouteConfiguration(e)).filter(e=>null!==e).sort((e,t)=>t.priority-e.priority);for(const n of s)if(await n.guard(e,[],null))return n;return null}deleteRouteConfiguration(e){return this.routes.delete(String(e)),this}getRouteIdentifiers(){return[...this.routes.keys()]}getRoutesConfigurations(){return[...this.routes.values()]}clearRoutes(){return this.routes.clear(),this}};Ut.identifier=o.routeResolver;let Wt=Ut;let Bt=((e=class{constructor(){}static constructFromServiceResolver(){return new e}rawTokenToToken(e){if(!("type"in e))throw new Error("Raw token must contain property 'type' in order to be parsed to a token.");if("_TokenResponse"!==String(e.type))throw new Error("Type must be '_TokenResponse' in order to be parsed to a token.");if(!("token"in e))throw new Error("Raw token must contain property 'token' in order to be parsed to a token.");return _t(String(e.token))}}).identifier=o.serviceTokenParser,e);const Zt=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,ApiConfiguration:ut,ApiWrapper:dt,CollectionParser:pt,ElementParser:zt,EventDispatcher:Ht,FetchHelper:Vt,Logger:class{constructor(e){this.logger=e}debug(...e){return this.logger.debug(e)}error(...e){return this.logger.error(e)}info(...e){return this.logger.info(e)}warn(...e){return this.logger.warn(e)}},RouteResolver:Wt,ServiceResolver:class{constructor(){this.services=/* @__PURE__ */new Map}createServiceProxy(e){let t=e;return{proxy:new Proxy({},{get(e,r,s){const n=Reflect.get(t,r,s);return"function"==typeof n?n.bind(t):n},set:(e,r,s)=>Reflect.set(t,r,s),has:(e,r)=>r in t,ownKeys:()=>Reflect.ownKeys(t),getOwnPropertyDescriptor(e,r){const s=Object.getOwnPropertyDescriptor(t,r);if(s)return{...s,configurable:!0}},defineProperty:(e,r,s)=>Reflect.defineProperty(t,r,s),getPrototypeOf:()=>Object.getPrototypeOf(t)}),targetReplaceFunction(e){t=e}}}hasService(e){return this.services.has(String(e))}getService(e){const t=this.services.get(String(e));return void 0===t?null:t.proxy}getServiceOrFail(e){const t=this.services.get(String(e));if(void 0===t)throw new Error(`Requested service with identifier ${String(e)} could not be resolved.`);return t.proxy}setService(e,t){let r=this.services.get(String(e));return void 0===r?(r=this.createServiceProxy(t),this.services.set(String(e),r),this):(r.targetReplaceFunction(t),this)}deleteService(e){return this.services.delete(String(e)),this}getServiceIdentifiers(){return[...this.services.keys()]}getServices(){return[...this.services.values()].map(e=>e.proxy)}clearServices(){return this.services.clear(),this}},TokenParser:Bt},Symbol.toStringTag,{value:"Module"}));var qt=Object.getOwnPropertyDescriptor;let Gt=class extends Xe{constructor(){super(...arguments),this._routeConfiguration=null,this._routeResolver=null}handleNewRoute(e){console.log(`handle new route: ${e}`),this._routeResolver?.findRouteConfiguration(e).then(t=>{null!==t?this._routeConfiguration=t:console.log(`unable to resolve route: ${e}`)}).catch(e=>{console.log("error during resolving route"),console.log(e)})}handlePopStateEvent(){console.log("(popstate) Location changed to: ",window.location.pathname),this.handleNewRoute(window.location.pathname)}handleLinkClickEvent(e){const t=e.target;if(null===t)return;if(!(t instanceof HTMLElement))return;const r=t.attributes.getNamedItem("href")?.value;if(null==r)return;const s=window.location.origin,n=new URL(r,s);n.host===window.location.host&&(console.log(`new absolute url: ${n}`),history.pushState({},"",n),e.preventDefault(),this.handleNewRoute(n.pathname))}connectedCallback(){super.connectedCallback(),window.addEventListener("popstate",this.handlePopStateEvent.bind(this)),document.addEventListener("click",this.handleLinkClickEvent.bind(this));const e=new h;this.dispatchEvent(e);const t=e.getServiceResolver();if(null!==t){const e=t.getService(Wt.identifier);null!==e&&(console.log("router init complete"),this._routeResolver=e,this.handleNewRoute(window.location.pathname))}}disconnectedCallback(){window.removeEventListener("popstate",this.handlePopStateEvent),document.removeEventListener("click",this.handleLinkClickEvent),super.disconnectedCallback()}getRouteWebComponentTag(){return null===this._routeConfiguration?null:"string"==typeof this._routeConfiguration.webComponent?typeof this._routeConfiguration.webComponent:null}render(){const e=(e=>({_$litStatic$:e,r:rt}))(this.getRouteWebComponentTag()??"ember-nexus-app-core-page-error-404");return it`<${e}></${e}>`}};Gt=((e,t,r,s)=>{for(var n,i=s>1?void 0:s?qt(t,r):t,o=e.length-1;o>=0;o--)(n=e[o])&&(i=n(i)||i);return i})([tt("ember-nexus-app-core-router")],Gt);const Jt=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,Page:lt,get Router(){return Gt}},Symbol.toStringTag,{value:"Module"})),Yt=class e{constructor(e,t){this.logger=e,this.fetchHelper=t}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper))}async deleteElement(e){try{const t=this.fetchHelper.buildUrl(`/${e}`);this.logger.debug(`Executing HTTP DELETE request against URL: ${t}`);const r=await fetch(t,this.fetchHelper.getDefaultDeleteOptions()).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));return await this.fetchHelper.parseEmptyResponse(r),{response:r}}catch(t){this.fetchHelper.logAndThrowError(t)}}};Yt.identifier=o.endpointElementDeleteElementEndpoint;let Kt=Yt;const Qt=class e{constructor(e,t,r){this.logger=e,this.fetchHelper=t,this.collectionParser=r}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper),t.getServiceOrFail(o.serviceCollectionParser))}async getElementChildren(e,t=1,r=25,s){try{if(t<1)throw new T("Page number must be at least 1.");if(r<1)throw new T("Page size must be at least 1.");const n=this.fetchHelper.buildUrl(`/${e}/children?page=${t}&pageSize=${r}`);this.logger.debug(`Executing HTTP GET request against URL: ${n}`);const i=await fetch(n,this.fetchHelper.getDefaultGetOptions(s)).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));if(304===i.status)return{response:i};const o=await this.fetchHelper.parseJsonResponse(i);return{data:await this.collectionParser.deserializeCollection(o),response:i}}catch(n){this.fetchHelper.logAndThrowError(n)}}};Qt.identifier=o.endpointElementGetElementChildrenEndpoint;let Xt=Qt;const er=class e{constructor(e,t,r){this.logger=e,this.fetchHelper=t,this.elementParser=r}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper),t.getServiceOrFail(o.serviceElementParser))}async getElement(e,t){try{const r=this.fetchHelper.buildUrl(`/${e}`);this.logger.debug(`Executing HTTP GET request against URL: ${r}`);const s=await fetch(r,this.fetchHelper.getDefaultGetOptions(t)).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));if(304===s.status)return{response:s};const n=await this.fetchHelper.parseJsonResponse(s);return{data:await this.elementParser.deserializeElement(n),response:s}}catch(r){this.fetchHelper.logAndThrowError(r)}}};er.identifier=o.endpointElementGetElementEndpoint;let tr=er;const rr=class e{constructor(e,t,r){this.logger=e,this.fetchHelper=t,this.collectionParser=r}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper),t.getServiceOrFail(o.serviceCollectionParser))}async getElementParents(e,t=1,r=25,s){try{if(t<1)throw new T("Page number must be at least 1.");if(r<1)throw new T("Page size must be at least 1.");const n=this.fetchHelper.buildUrl(`/${e}/parents?page=${t}&pageSize=${r}`);this.logger.debug(`Executing HTTP GET request against URL: ${n}`);const i=await fetch(n,this.fetchHelper.getDefaultGetOptions(s)).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));if(304===i.status)return{response:i};const o=await this.fetchHelper.parseJsonResponse(i);return{data:await this.collectionParser.deserializeCollection(o),response:i}}catch(n){this.fetchHelper.logAndThrowError(n)}}};rr.identifier=o.endpointElementGetElementParentsEndpoint;let sr=rr;const nr=class e{constructor(e,t,r){this.logger=e,this.fetchHelper=t,this.collectionParser=r}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper),t.getServiceOrFail(o.serviceCollectionParser))}async getElementRelated(e,t=1,r=25,s){try{if(t<1)throw new T("Page number must be at least 1.");if(r<1)throw new T("Page size must be at least 1.");const n=this.fetchHelper.buildUrl(`/${e}/related?page=${t}&pageSize=${r}`);this.logger.debug(`Executing HTTP GET request against URL: ${n}`);const i=await fetch(n,this.fetchHelper.getDefaultGetOptions(s)).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));if(304===i.status)return{response:i};const o=await this.fetchHelper.parseJsonResponse(i);return{data:await this.collectionParser.deserializeCollection(o),response:i}}catch(n){this.fetchHelper.logAndThrowError(n)}}};nr.identifier=o.endpointElementGetElementRelatedEndpoint;let ir=nr;const or=class e{constructor(e,t,r){this.logger=e,this.fetchHelper=t,this.collectionParser=r}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper),t.getServiceOrFail(o.serviceCollectionParser))}async getIndex(e=1,t=25,r){try{if(e<1)throw new T("Page number must be at least 1.");if(t<1)throw new T("Page size must be at least 1.");const s=this.fetchHelper.buildUrl(`/?page=${e}&pageSize=${t}`);this.logger.debug(`Executing HTTP GET request against URL: ${s}`);const n=await fetch(s,this.fetchHelper.getDefaultGetOptions(r)).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));if(304===n.status)return{response:n};const i=await this.fetchHelper.parseJsonResponse(n);return{data:await this.collectionParser.deserializeCollection(i),response:n}}catch(s){this.fetchHelper.logAndThrowError(s)}}};or.identifier=o.endpointElementGetIndexEndpoint;let ar=or;const lr=class e{constructor(e,t){this.logger=e,this.fetchHelper=t}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper))}async patchElement(e,t){try{const r=this.fetchHelper.buildUrl(`/${e}`);this.logger.debug(`Executing HTTP PATCH request against URL: ${r}`);const s=await fetch(r,this.fetchHelper.getDefaultPatchOptions(JSON.stringify(t))).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));return await this.fetchHelper.parseEmptyResponse(s),{response:s}}catch(r){this.fetchHelper.logAndThrowError(r)}}};lr.identifier=o.endpointElementPatchElementEndpoint;let cr=lr;const ur=class e{constructor(e,t){this.logger=e,this.fetchHelper=t}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper))}async postElement(e,t){try{const r=this.fetchHelper.buildUrl(`/${e}`);this.logger.debug(`Executing HTTP POST request against URL: ${r}`);const s=await fetch(r,this.fetchHelper.getDefaultPostOptions(JSON.stringify(t))).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));return{data:await this.fetchHelper.parseLocationResponse(s),response:s}}catch(r){this.fetchHelper.logAndThrowError(r)}}};ur.identifier=o.endpointElementPostElementEndpoint;let hr=ur;const dr=class e{constructor(e,t){this.logger=e,this.fetchHelper=t}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper))}async postIndex(e){try{const t=this.fetchHelper.buildUrl("/");this.logger.debug(`Executing HTTP POST request against URL: ${t}`);const r=await fetch(t,this.fetchHelper.getDefaultPostOptions(JSON.stringify(e))).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));return{data:await this.fetchHelper.parseLocationResponse(r),response:r}}catch(t){this.fetchHelper.logAndThrowError(t)}}};dr.identifier=o.endpointElementPostIndexEndpoint;let fr=dr;const pr=class e{constructor(e,t){this.logger=e,this.fetchHelper=t}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper))}async putElement(e,t){try{const r=this.fetchHelper.buildUrl(`/${e}`);this.logger.debug(`Executing HTTP PUT request against URL: ${r}`);const s=await fetch(r,this.fetchHelper.getDefaultPutOptions(JSON.stringify(t))).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));return await this.fetchHelper.parseEmptyResponse(s),{response:s}}catch(r){this.fetchHelper.logAndThrowError(r)}}};pr.identifier=o.endpointElementPutElementEndpoint;let mr=pr;const gr=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,DeleteElementEndpoint:Kt,GetElementChildrenEndpoint:Xt,GetElementEndpoint:tr,GetElementParentsEndpoint:sr,GetElementRelatedEndpoint:ir,GetIndexEndpoint:ar,PatchElementEndpoint:cr,PostElementEndpoint:hr,PostIndexEndpoint:fr,PutElementEndpoint:mr},Symbol.toStringTag,{value:"Module"})),yr=class e{constructor(e,t){this.logger=e,this.fetchHelper=t}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper))}async deleteToken(){try{const e=this.fetchHelper.buildUrl("/token");this.logger.debug(`Executing HTTP DELETE request against URL: ${e}`);const t=await fetch(e,this.fetchHelper.getDefaultDeleteOptions()).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));return await this.fetchHelper.parseEmptyResponse(t),{response:t}}catch(e){this.fetchHelper.logAndThrowError(e)}}};yr.identifier=o.endpointUserDeleteTokenEndpoint;let vr=yr;const wr=class e{constructor(e,t,r){this.logger=e,this.fetchHelper=t,this.elementParser=r}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper),t.getServiceOrFail(o.serviceElementParser))}async getMe(){try{const e=this.fetchHelper.buildUrl("/me");this.logger.debug(`Executing HTTP GET request against URL: ${e}`);const t=await fetch(e,this.fetchHelper.getDefaultGetOptions()).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e)),r=await this.fetchHelper.parseJsonResponse(t),s=await this.elementParser.deserializeElement(r);if("User"!==s.type)throw new m("Expected node to be of type 'User'.");return{data:s,response:t}}catch(e){this.fetchHelper.logAndThrowError(e)}}};wr.identifier=o.endpointUserGetMeEndpoint;let Er=wr;const Sr=class e{constructor(e,t,r){this.logger=e,this.fetchHelper=t,this.elementParser=r}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper),t.getServiceOrFail(o.serviceElementParser))}async getToken(){try{const e=this.fetchHelper.buildUrl("/token");this.logger.debug(`Executing HTTP GET request against URL: ${e}`);const t=await fetch(e,this.fetchHelper.getDefaultGetOptions()).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e)),r=await this.fetchHelper.parseJsonResponse(t),s=await this.elementParser.deserializeElement(r);if("Token"!==s.type)throw new m("Expected node to be of type 'Token'.");return{data:s,response:t}}catch(e){this.fetchHelper.logAndThrowError(e)}}};Sr.identifier=o.endpointUserGetTokenEndpoint;let br=Sr;const Tr=class e{constructor(e,t){this.logger=e,this.fetchHelper=t}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper))}async postChangePassword(e,t,r){try{const s=this.fetchHelper.buildUrl("/change-password");this.logger.debug(`Executing HTTP POST request against URL: ${s}`);const n={type:"ActionChangePassword",currentPassword:t,newPassword:r,uniqueUserIdentifier:e},i=await fetch(s,this.fetchHelper.getDefaultPostOptions(JSON.stringify(n))).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));return await this.fetchHelper.parseEmptyResponse(i),{response:i}}catch(s){this.fetchHelper.logAndThrowError(s)}}};Tr.identifier=o.endpointUserPostChangePasswordEndpoint;let Or=Tr;const kr=class e{constructor(e,t){this.logger=e,this.fetchHelper=t}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceFetchHelper))}async postRegister(e,t,r={}){try{const s=this.fetchHelper.buildUrl("/register");this.logger.debug(`Executing HTTP POST request against URL: ${s}`);const n={type:"User",uniqueUserIdentifier:e,password:t,data:r},i=await fetch(s,this.fetchHelper.getDefaultPostOptions(JSON.stringify(n))).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e));return{data:await this.fetchHelper.parseLocationResponse(i),response:i}}catch(s){this.fetchHelper.logAndThrowError(s)}}};kr.identifier=o.endpointUserPostRegisterEndpoint;let xr=kr;const Cr=class e{constructor(e,t,r){this.logger=e,this.tokenParser=t,this.fetchHelper=r}static constructFromServiceResolver(t){return new e(t.getServiceOrFail(o.logger),t.getServiceOrFail(o.serviceTokenParser),t.getServiceOrFail(o.serviceFetchHelper))}async postToken(e,t,r={}){try{const s=this.fetchHelper.buildUrl("/token");this.logger.debug(`Executing HTTP POST request against URL: ${s}`);const n={type:"Token",uniqueUserIdentifier:e,password:t,data:r},i=await fetch(s,this.fetchHelper.getDefaultPostOptions(JSON.stringify(n))).catch(e=>this.fetchHelper.rethrowErrorAsNetworkError(e)),o=await this.fetchHelper.parseJsonResponse(i);return{data:this.tokenParser.rawTokenToToken(o),response:i}}catch(s){this.fetchHelper.logAndThrowError(s)}}};Cr.identifier=o.endpointUserPostTokenEndpoint;let _r=Cr;const Ar=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,DeleteTokenEndpoint:vr,GetMeEndpoint:Er,GetTokenEndpoint:br,PostChangePasswordEndpoint:Or,PostRegisterEndpoint:xr,PostTokenEndpoint:_r},Symbol.toStringTag,{value:"Module"})),Fr=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,Element:gr,User:Ar},Symbol.toStringTag,{value:"Module"}));class $r extends Error{}class Nr extends $r{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Pr extends $r{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Lr extends $r{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Rr extends $r{}class Mr extends $r{constructor(e){super(`Invalid unit ${e}`)}}class Dr extends $r{}class zr extends $r{constructor(){super("Zone is an abstract class")}}const Ir="numeric",Hr="short",jr="long",Vr={year:Ir,month:Ir,day:Ir},Ur={year:Ir,month:Hr,day:Ir},Wr={year:Ir,month:Hr,day:Ir,weekday:Hr},Br={year:Ir,month:jr,day:Ir},Zr={year:Ir,month:jr,day:Ir,weekday:jr},qr={hour:Ir,minute:Ir},Gr={hour:Ir,minute:Ir,second:Ir},Jr={hour:Ir,minute:Ir,second:Ir,timeZoneName:Hr},Yr={hour:Ir,minute:Ir,second:Ir,timeZoneName:jr},Kr={hour:Ir,minute:Ir,hourCycle:"h23"},Qr={hour:Ir,minute:Ir,second:Ir,hourCycle:"h23"},Xr={hour:Ir,minute:Ir,second:Ir,hourCycle:"h23",timeZoneName:Hr},es={hour:Ir,minute:Ir,second:Ir,hourCycle:"h23",timeZoneName:jr},ts={year:Ir,month:Ir,day:Ir,hour:Ir,minute:Ir},rs={year:Ir,month:Ir,day:Ir,hour:Ir,minute:Ir,second:Ir},ss={year:Ir,month:Hr,day:Ir,hour:Ir,minute:Ir},ns={year:Ir,month:Hr,day:Ir,hour:Ir,minute:Ir,second:Ir},is={year:Ir,month:Hr,day:Ir,weekday:Hr,hour:Ir,minute:Ir},os={year:Ir,month:jr,day:Ir,hour:Ir,minute:Ir,timeZoneName:Hr},as={year:Ir,month:jr,day:Ir,hour:Ir,minute:Ir,second:Ir,timeZoneName:Hr},ls={year:Ir,month:jr,day:Ir,weekday:jr,hour:Ir,minute:Ir,timeZoneName:jr},cs={year:Ir,month:jr,day:Ir,weekday:jr,hour:Ir,minute:Ir,second:Ir,timeZoneName:jr};class us{get type(){throw new zr}get name(){throw new zr}get ianaName(){return this.name}get isUniversal(){throw new zr}offsetName(e,t){throw new zr}formatOffset(e,t){throw new zr}offset(e){throw new zr}equals(e){throw new zr}get isValid(){throw new zr}}let hs=null;class ds extends us{static get instance(){return null===hs&&(hs=new ds),hs}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return Pn(e,t,r)}formatOffset(e,t){return Dn(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"system"===e.type}get isValid(){return!0}}const fs=/* @__PURE__ */new Map;const ps={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};const ms=/* @__PURE__ */new Map;class gs extends us{static create(e){let t=ms.get(e);return void 0===t&&ms.set(e,t=new gs(e)),t}static resetCache(){ms.clear(),fs.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(t){return!1}}constructor(e){super(),this.zoneName=e,this.valid=gs.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return Pn(e,t,r,this.name)}formatOffset(e,t){return Dn(this.offset(e),t)}offset(e){if(!this.valid)return NaN;const t=new Date(e);if(isNaN(t))return NaN;const r=function(e){let t=fs.get(e);return void 0===t&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),fs.set(e,t)),t}(this.name);let[s,n,i,o,a,l,c]=r.formatToParts?function(e,t){const r=e.formatToParts(t),s=[];for(let n=0;n<r.length;n++){const{type:e,value:t}=r[n],i=ps[e];"era"===e?s[i]=t:dn(i)||(s[i]=parseInt(t,10))}return s}(r,t):function(e,t){const r=e.format(t).replace(/\u200E/g,""),s=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,n,i,o,a,l,c,u]=s;return[o,n,i,a,l,c,u]}(r,t);"BC"===o&&(s=1-Math.abs(s));let u=+t;const h=u%1e3;return u-=h>=0?h:1e3+h,(An({year:s,month:n,day:i,hour:24===a?0:a,minute:l,second:c,millisecond:0})-u)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let ys={};const vs=/* @__PURE__ */new Map;function ws(e,t={}){const r=JSON.stringify([e,t]);let s=vs.get(r);return void 0===s&&(s=new Intl.DateTimeFormat(e,t),vs.set(r,s)),s}const Es=/* @__PURE__ */new Map;const Ss=/* @__PURE__ */new Map;let bs=null;const Ts=/* @__PURE__ */new Map;function Os(e){let t=Ts.get(e);return void 0===t&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),Ts.set(e,t)),t}const ks=/* @__PURE__ */new Map;function xs(e,t,r,s){const n=e.listingMode();return"error"===n?null:"en"===n?r(t):s(t)}class Cs{constructor(e,t,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:s,floor:n,...i}=r;if(!t||Object.keys(i).length>0){const t={useGrouping:!1,...r};r.padTo>0&&(t.minimumIntegerDigits=r.padTo),this.inf=function(e,t={}){const r=JSON.stringify([e,t]);let s=Es.get(r);return void 0===s&&(s=new Intl.NumberFormat(e,t),Es.set(r,s)),s}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return Sn(this.floor?Math.floor(e):kn(e,3),this.padTo)}}class _s{constructor(e,t,r){let s;if(this.opts=r,this.originalZone=void 0,this.opts.timeZone)this.dt=e;else if("fixed"===e.zone.type){const t=e.offset/60*-1,r=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;0!==e.offset&&gs.create(r).valid?(s=r,this.dt=e):(s="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else"system"===e.zone.type?this.dt=e:"iana"===e.zone.type?(this.dt=e,s=e.zone.name):(s="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const n={...this.opts};n.timeZone=n.timeZone||s,this.dtf=ws(t,n)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(e=>{if("timeZoneName"===e.type){const t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:t}}return e}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class As{constructor(e,t,r){this.opts={style:"long",...r},!t&&mn()&&(this.rtf=function(e,t={}){const{base:r,...s}=t,n=JSON.stringify([e,s]);let i=Ss.get(n);return void 0===i&&(i=new Intl.RelativeTimeFormat(e,t),Ss.set(n,i)),i}(e,r))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,r="always",s=!1){const n={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===r&&i){const r="days"===e;switch(t){case 1:return r?"tomorrow":`next ${n[e][0]}`;case-1:return r?"yesterday":`last ${n[e][0]}`;case 0:return r?"today":`this ${n[e][0]}`}}const o=Object.is(t,-0)||t<0,a=Math.abs(t),l=1===a,c=n[e],u=s?l?c[1]:c[2]||c[1]:l?n[e][0]:e;return o?`${a} ${u} ago`:`in ${a} ${u}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const Fs={firstDay:1,minimalDays:4,weekend:[6,7]};class $s{static fromOpts(e){return $s.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,r,s,n=!1){const i=e||Js.defaultLocale,o=i||(n?"en-US":bs||(bs=(new Intl.DateTimeFormat).resolvedOptions().locale,bs)),a=t||Js.defaultNumberingSystem,l=r||Js.defaultOutputCalendar,c=wn(s)||Js.defaultWeekSettings;return new $s(o,a,l,c,i)}static resetCache(){bs=null,vs.clear(),Es.clear(),Ss.clear(),Ts.clear(),ks.clear()}static fromObject({locale:e,numberingSystem:t,outputCalendar:r,weekSettings:s}={}){return $s.create(e,t,r,s)}constructor(e,t,r,s,n){const[i,o,a]=function(e){const t=e.indexOf("-x-");-1!==t&&(e=e.substring(0,t));const r=e.indexOf("-u-");if(-1===r)return[e];{let t,n;try{t=ws(e).resolvedOptions(),n=e}catch(s){const i=e.substring(0,r);t=ws(i).resolvedOptions(),n=i}const{numberingSystem:i,calendar:o}=t;return[n,i,o]}}(e);this.locale=i,this.numberingSystem=t||o||null,this.outputCalendar=r||a||null,this.weekSettings=s,this.intl=function(e,t,r){return r||t?(e.includes("-u-")||(e+="-u"),r&&(e+=`-ca-${r}`),t&&(e+=`-nu-${t}`),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=n,this.fastNumbersCached=null}get fastNumbers(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===Os(e.locale).numberingSystem)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?$s.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,wn(e.weekSettings)||this.weekSettings,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return xs(this,e,Vn,()=>{const r="ja"===this.intl||this.intl.startsWith("ja-"),s=(t&=!r)?{month:e,day:"numeric"}:{month:e},n=t?"format":"standalone";if(!this.monthsCache[n][e]){const t=r?e=>this.dtFormatter(e,s).format():e=>this.extract(e,s,"month");this.monthsCache[n][e]=function(e){const t=[];for(let r=1;r<=12;r++){const s=Go.utc(2009,r,1);t.push(e(s))}return t}(t)}return this.monthsCache[n][e]})}weekdays(e,t=!1){return xs(this,e,Zn,()=>{const r=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},s=t?"format":"standalone";return this.weekdaysCache[s][e]||(this.weekdaysCache[s][e]=function(e){const t=[];for(let r=1;r<=7;r++){const s=Go.utc(2016,11,13+r);t.push(e(s))}return t}(e=>this.extract(e,r,"weekday"))),this.weekdaysCache[s][e]})}meridiems(){return xs(this,void 0,()=>qn,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Go.utc(2016,11,13,9),Go.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return xs(this,e,Kn,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[Go.utc(-40,1,1),Go.utc(2017,1,1)].map(e=>this.extract(e,t,"era"))),this.eraCache[e]})}extract(e,t,r){const s=this.dtFormatter(e,t).formatToParts().find(e=>e.type.toLowerCase()===r);return s?s.value:null}numberFormatter(e={}){return new Cs(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new _s(e,this.intl,t)}relFormatter(e={}){return new As(this.intl,this.isEnglish(),e)}listFormatter(e={}){return function(e,t={}){const r=JSON.stringify([e,t]);let s=ys[r];return s||(s=new Intl.ListFormat(e,t),ys[r]=s),s}(this.intl,e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||Os(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:gn()?function(e){let t=ks.get(e);if(!t){const r=new Intl.Locale(e);t="getWeekInfo"in r?r.getWeekInfo():r.weekInfo,"minimalDays"in t||(t={...Fs,...t}),ks.set(e,t)}return t}(this.locale):Fs}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Ns=null;class Ps extends us{static get utcInstance(){return null===Ns&&(Ns=new Ps(0)),Ns}static instance(e){return 0===e?Ps.utcInstance:new Ps(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new Ps(Ln(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${Dn(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${Dn(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Dn(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class Ls extends us{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Rs(e,t){if(dn(e)||null===e)return t;if(e instanceof us)return e;if("string"==typeof e){const r=e.toLowerCase();return"default"===r?t:"local"===r||"system"===r?ds.instance:"utc"===r||"gmt"===r?Ps.utcInstance:Ps.parseSpecifier(r)||gs.create(e)}return fn(e)?Ps.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new Ls(e)}const Ms={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Ds={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},zs=Ms.hanidec.replace(/[\[|\]]/g,"").split("");const Is=/* @__PURE__ */new Map;function Hs({numberingSystem:e},t=""){const r=e||"latn";let s=Is.get(r);void 0===s&&(s=/* @__PURE__ */new Map,Is.set(r,s));let n=s.get(t);return void 0===n&&(n=new RegExp(`${Ms[r]}${t}`),s.set(t,n)),n}let js,Vs=()=>Date.now(),Us="system",Ws=null,Bs=null,Zs=null,qs=60,Gs=null;class Js{static get now(){return Vs}static set now(e){Vs=e}static set defaultZone(e){Us=e}static get defaultZone(){return Rs(Us,ds.instance)}static get defaultLocale(){return Ws}static set defaultLocale(e){Ws=e}static get defaultNumberingSystem(){return Bs}static set defaultNumberingSystem(e){Bs=e}static get defaultOutputCalendar(){return Zs}static set defaultOutputCalendar(e){Zs=e}static get defaultWeekSettings(){return Gs}static set defaultWeekSettings(e){Gs=wn(e)}static get twoDigitCutoffYear(){return qs}static set twoDigitCutoffYear(e){qs=e%100}static get throwOnInvalid(){return js}static set throwOnInvalid(e){js=e}static resetCaches(){$s.resetCache(),gs.resetCache(),Go.resetCache(),Is.clear()}}class Ys{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Ks=[0,31,59,90,120,151,181,212,243,273,304,334],Qs=[0,31,60,91,121,152,182,213,244,274,305,335];function Xs(e,t){return new Ys("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function en(e,t,r){const s=new Date(Date.UTC(e,t-1,r));e<100&&e>=0&&s.setUTCFullYear(s.getUTCFullYear()-1900);const n=s.getUTCDay();return 0===n?7:n}function tn(e,t,r){return r+(xn(e)?Qs:Ks)[t-1]}function rn(e,t){const r=xn(e)?Qs:Ks,s=r.findIndex(e=>e<t);return{month:s+1,day:t-r[s]}}function sn(e,t){return(e-t+7)%7+1}function nn(e,t=4,r=1){const{year:s,month:n,day:i}=e,o=tn(s,n,i),a=sn(en(s,n,i),r);let l,c=Math.floor((o-a+14-t)/7);return c<1?(l=s-1,c=$n(l,t,r)):c>$n(s,t,r)?(l=s+1,c=1):l=s,{weekYear:l,weekNumber:c,weekday:a,...zn(e)}}function on(e,t=4,r=1){const{weekYear:s,weekNumber:n,weekday:i}=e,o=sn(en(s,1,t),r),a=Cn(s);let l,c=7*n+i-o-7+t;c<1?(l=s-1,c+=Cn(l)):c>a?(l=s+1,c-=Cn(s)):l=s;const{month:u,day:h}=rn(l,c);return{year:l,month:u,day:h,...zn(e)}}function an(e){const{year:t,month:r,day:s}=e;return{year:t,ordinal:tn(t,r,s),...zn(e)}}function ln(e){const{year:t,ordinal:r}=e,{month:s,day:n}=rn(t,r);return{year:t,month:s,day:n,...zn(e)}}function cn(e,t){if(!dn(e.localWeekday)||!dn(e.localWeekNumber)||!dn(e.localWeekYear)){if(!dn(e.weekday)||!dn(e.weekNumber)||!dn(e.weekYear))throw new Rr("Cannot mix locale-based week fields with ISO-based week fields");return dn(e.localWeekday)||(e.weekday=e.localWeekday),dn(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),dn(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function un(e){const t=pn(e.year),r=En(e.month,1,12),s=En(e.day,1,_n(e.year,e.month));return t?r?!s&&Xs("day",e.day):Xs("month",e.month):Xs("year",e.year)}function hn(e){const{hour:t,minute:r,second:s,millisecond:n}=e,i=En(t,0,23)||24===t&&0===r&&0===s&&0===n,o=En(r,0,59),a=En(s,0,59),l=En(n,0,999);return i?o?a?!l&&Xs("millisecond",n):Xs("second",s):Xs("minute",r):Xs("hour",t)}function dn(e){return void 0===e}function fn(e){return"number"==typeof e}function pn(e){return"number"==typeof e&&e%1==0}function mn(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function gn(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function yn(e,t,r){if(0!==e.length)return e.reduce((e,s)=>{const n=[t(s),s];return e&&r(e[0],n[0])===e[0]?e:n},null)[1]}function vn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function wn(e){if(null==e)return null;if("object"!=typeof e)throw new Dr("Week settings must be an object");if(!En(e.firstDay,1,7)||!En(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(e=>!En(e,1,7)))throw new Dr("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function En(e,t,r){return pn(e)&&e>=t&&e<=r}function Sn(e,t=2){let r;return r=e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0"),r}function bn(e){return dn(e)||null===e||""===e?void 0:parseInt(e,10)}function Tn(e){return dn(e)||null===e||""===e?void 0:parseFloat(e)}function On(e){if(!dn(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function kn(e,t,r="round"){const s=10**t;switch(r){case"expand":return e>0?Math.ceil(e*s)/s:Math.floor(e*s)/s;case"trunc":return Math.trunc(e*s)/s;case"round":return Math.round(e*s)/s;case"floor":return Math.floor(e*s)/s;case"ceil":return Math.ceil(e*s)/s;default:throw new RangeError(`Value rounding ${r} is out of range`)}}function xn(e){return e%4==0&&(e%100!=0||e%400==0)}function Cn(e){return xn(e)?366:365}function _n(e,t){const r=(s=t-1)-(n=12)*Math.floor(s/n)+1;var s,n;return 2===r?xn(e+(t-r)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function An(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Fn(e,t,r){return-sn(en(e,1,t),r)+t-1}function $n(e,t=4,r=1){const s=Fn(e,t,r),n=Fn(e+1,t,r);return(Cn(e)-s+n)/7}function Nn(e){return e>99?e:e>Js.twoDigitCutoffYear?1900+e:2e3+e}function Pn(e,t,r,s=null){const n=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(i.timeZone=s);const o={timeZoneName:t,...i},a=new Intl.DateTimeFormat(r,o).formatToParts(n).find(e=>"timezonename"===e.type.toLowerCase());return a?a.value:null}function Ln(e,t){let r=parseInt(e,10);Number.isNaN(r)&&(r=0);const s=parseInt(t,10)||0;return 60*r+(r<0||Object.is(r,-0)?-s:s)}function Rn(e){const t=Number(e);if("boolean"==typeof e||""===e||!Number.isFinite(t))throw new Dr(`Invalid unit value ${e}`);return t}function Mn(e,t){const r={};for(const s in e)if(vn(e,s)){const n=e[s];if(null==n)continue;r[t(s)]=Rn(n)}return r}function Dn(e,t){const r=Math.trunc(Math.abs(e/60)),s=Math.trunc(Math.abs(e%60)),n=e>=0?"+":"-";switch(t){case"short":return`${n}${Sn(r,2)}:${Sn(s,2)}`;case"narrow":return`${n}${r}${s>0?`:${s}`:""}`;case"techie":return`${n}${Sn(r,2)}${Sn(s,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function zn(e){return function(e,t){return t.reduce((t,r)=>(t[r]=e[r],t),{})}(e,["hour","minute","second","millisecond"])}const In=["January","February","March","April","May","June","July","August","September","October","November","December"],Hn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],jn=["J","F","M","A","M","J","J","A","S","O","N","D"];function Vn(e){switch(e){case"narrow":return[...jn];case"short":return[...Hn];case"long":return[...In];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Un=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Wn=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Bn=["M","T","W","T","F","S","S"];function Zn(e){switch(e){case"narrow":return[...Bn];case"short":return[...Wn];case"long":return[...Un];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const qn=["AM","PM"],Gn=["Before Christ","Anno Domini"],Jn=["BC","AD"],Yn=["B","A"];function Kn(e){switch(e){case"narrow":return[...Yn];case"short":return[...Jn];case"long":return[...Gn];default:return null}}function Qn(e,t){let r="";for(const s of e)s.literal?r+=s.val:r+=t(s.val);return r}const Xn={D:Vr,DD:Ur,DDD:Br,DDDD:Zr,t:qr,tt:Gr,ttt:Jr,tttt:Yr,T:Kr,TT:Qr,TTT:Xr,TTTT:es,f:ts,ff:ss,fff:os,ffff:ls,F:rs,FF:ns,FFF:as,FFFF:cs};class ei{static create(e,t={}){return new ei(e,t)}static parseFormat(e){let t=null,r="",s=!1;const n=[];for(let i=0;i<e.length;i++){const o=e.charAt(i);"'"===o?((r.length>0||s)&&n.push({literal:s||/^\s+$/.test(r),val:""===r?"'":r}),t=null,r="",s=!s):s||o===t?r+=o:(r.length>0&&n.push({literal:/^\s+$/.test(r),val:r}),r=o,t=o)}return r.length>0&&n.push({literal:s||/^\s+$/.test(r),val:r}),n}static macroTokenToFormatOpts(e){return Xn[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0,r=void 0){if(this.opts.forceSimple)return Sn(e,t);const s={...this.opts};return t>0&&(s.padTo=t),r&&(s.signDisplay=r),this.loc.numberFormatter(s).format(e)}formatDateTimeFromString(e,t){const r="en"===this.loc.listingMode(),s=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,n=(t,r)=>this.loc.extract(e,t,r),i=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",o=()=>r?function(e){return qn[e.hour<12?0:1]}(e):n({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(t,s)=>r?function(e,t){return Vn(t)[e.month-1]}(e,t):n(s?{month:t}:{month:t,day:"numeric"},"month"),l=(t,s)=>r?function(e,t){return Zn(t)[e.weekday-1]}(e,t):n(s?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),c=t=>{const r=ei.macroTokenToFormatOpts(t);return r?this.formatWithSystemDefault(e,r):t},u=t=>r?function(e,t){return Kn(t)[e.year<0?0:1]}(e,t):n({era:t},"era");return Qn(ei.parseFormat(t),t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return i({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return i({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return i({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return o();case"d":return s?n({day:"numeric"},"day"):this.num(e.day);case"dd":return s?n({day:"2-digit"},"day"):this.num(e.day,2);case"c":case"E":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return s?n({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?n({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return s?n({month:"numeric"},"month"):this.num(e.month);case"MM":return s?n({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return s?n({year:"numeric"},"year"):this.num(e.year);case"yy":return s?n({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?n({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?n({year:"numeric"},"year"):this.num(e.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return c(t)}})}formatDurationFromString(e,t){const r="negativeLargestOnly"===this.opts.signMode?-1:1,s=e=>{switch(e[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},n=ei.parseFormat(t),i=n.reduce((e,{literal:t,val:r})=>t?e:e.concat(r),[]),o=e.shiftTo(...i.map(s).filter(e=>e));return Qn(n,((e,t)=>n=>{const i=s(n);if(i){const s=t.isNegativeDuration&&i!==t.largestUnit?r:1;let o;return o="negativeLargestOnly"===this.opts.signMode&&i!==t.largestUnit?"never":"all"===this.opts.signMode?"always":"auto",this.num(e.get(i)*s,n.length,o)}return n})(o,{isNegativeDuration:o<0,largestUnit:Object.keys(o.values)[0]}))}}const ti=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function ri(...e){const t=e.reduce((e,t)=>e+t.source,"");return RegExp(`^${t}$`)}function si(...e){return t=>e.reduce(([e,r,s],n)=>{const[i,o,a]=n(t,s);return[{...e,...i},o||r,a]},[{},null,1]).slice(0,2)}function ni(e,...t){if(null==e)return[null,null];for(const[r,s]of t){const t=r.exec(e);if(t)return s(t)}return[null,null]}function ii(...e){return(t,r)=>{const s={};let n;for(n=0;n<e.length;n++)s[e[n]]=bn(t[r+n]);return[s,null,r+n]}}const oi=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,ai=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,li=RegExp(`${ai.source}${`(?:${oi.source}?(?:\\[(${ti.source})\\])?)?`}`),ci=RegExp(`(?:[Tt]${li.source})?`),ui=ii("weekYear","weekNumber","weekDay"),hi=ii("year","ordinal"),di=RegExp(`${ai.source} ?(?:${oi.source}|(${ti.source}))?`),fi=RegExp(`(?: ${di.source})?`);function pi(e,t,r){const s=e[t];return dn(s)?r:bn(s)}function mi(e,t){return[{hours:pi(e,t,0),minutes:pi(e,t+1,0),seconds:pi(e,t+2,0),milliseconds:On(e[t+3])},null,t+4]}function gi(e,t){const r=!e[t]&&!e[t+1],s=Ln(e[t+1],e[t+2]);return[{},r?null:Ps.instance(s),t+3]}function yi(e,t){return[{},e[t]?gs.create(e[t]):null,t+1]}const vi=RegExp(`^T?${ai.source}$`),wi=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Ei(e){const[t,r,s,n,i,o,a,l,c]=e,u="-"===t[0],h=l&&"-"===l[0],d=(e,t=!1)=>void 0!==e&&(t||e&&u)?-e:e;return[{years:d(Tn(r)),months:d(Tn(s)),weeks:d(Tn(n)),days:d(Tn(i)),hours:d(Tn(o)),minutes:d(Tn(a)),seconds:d(Tn(l),"-0"===l),milliseconds:d(On(c),h)}]}const Si={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function bi(e,t,r,s,n,i,o){const a={year:2===t.length?Nn(bn(t)):bn(t),month:Hn.indexOf(r)+1,day:bn(s),hour:bn(n),minute:bn(i)};return o&&(a.second=bn(o)),e&&(a.weekday=e.length>3?Un.indexOf(e)+1:Wn.indexOf(e)+1),a}const Ti=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Oi(e){const[,t,r,s,n,i,o,a,l,c,u,h]=e,d=bi(t,n,s,r,i,o,a);let f;return f=l?Si[l]:c?0:Ln(u,h),[d,new Ps(f)]}const ki=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,xi=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Ci=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function _i(e){const[,t,r,s,n,i,o,a]=e;return[bi(t,n,s,r,i,o,a),Ps.utcInstance]}function Ai(e){const[,t,r,s,n,i,o,a]=e;return[bi(t,a,r,s,n,i,o),Ps.utcInstance]}const Fi=ri(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,ci),$i=ri(/(\d{4})-?W(\d\d)(?:-?(\d))?/,ci),Ni=ri(/(\d{4})-?(\d{3})/,ci),Pi=ri(li),Li=si(function(e,t){return[{year:pi(e,t),month:pi(e,t+1,1),day:pi(e,t+2,1)},null,t+3]},mi,gi,yi),Ri=si(ui,mi,gi,yi),Mi=si(hi,mi,gi,yi),Di=si(mi,gi,yi);const zi=si(mi);const Ii=ri(/(\d{4})-(\d\d)-(\d\d)/,fi),Hi=ri(di),ji=si(mi,gi,yi);const Vi="Invalid Duration",Ui={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},Wi={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...Ui},Bi=365.2425,Zi=30.436875,qi={years:{quarters:4,months:12,weeks:52.1775,days:Bi,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:Zi,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...Ui},Gi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Ji=Gi.slice(0).reverse();function Yi(e,t,r=!1){const s={values:r?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new eo(s)}function Ki(e,t){let r=t.milliseconds??0;for(const s of Ji.slice(1))t[s]&&(r+=t[s]*e[s].milliseconds);return r}function Qi(e,t){const r=Ki(e,t)<0?-1:1;Gi.reduceRight((s,n)=>{if(dn(t[n]))return s;if(s){const i=t[s]*r,o=e[n][s],a=Math.floor(i/o);t[n]+=a*r,t[s]-=a*o*r}return n},null),Gi.reduce((r,s)=>{if(dn(t[s]))return r;if(r){const n=t[r]%1;t[r]-=n,t[s]+=n*e[r][s]}return s},null)}function Xi(e){const t={};for(const[r,s]of Object.entries(e))0!==s&&(t[r]=s);return t}class eo{constructor(e){const t="longterm"===e.conversionAccuracy||!1;let r=t?qi:Wi;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||$s.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,t){return eo.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(null==e||"object"!=typeof e)throw new Dr("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new eo({values:Mn(e,eo.normalizeUnit),loc:$s.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(fn(e))return eo.fromMillis(e);if(eo.isDuration(e))return e;if("object"==typeof e)return eo.fromObject(e);throw new Dr(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[r]=ni(e,[wi,Ei]);return r?eo.fromObject(r,t):eo.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[r]=ni(e,[vi,zi]);return r?eo.fromObject(r,t):eo.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Dr("need to specify a reason the Duration is invalid");const r=e instanceof Ys?e:new Ys(e,t);if(Js.throwOnInvalid)throw new Lr(r);return new eo({invalid:r})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new Mr(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const r={...t,floor:!1!==t.round&&!1!==t.floor};return this.isValid?ei.create(this.loc,r).formatDurationFromString(this,e):Vi}toHuman(e={}){if(!this.isValid)return Vi;const t=!1!==e.showZeros,r=Gi.map(r=>{const s=this.values[r];return dn(s)||0===s&&!t?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:r.slice(0,-1)}).format(s)}).filter(e=>e);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=kn(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1};return Go.fromMillis(t,{zone:"UTC"}).toISOTime(e)}toJSON(){return this.toISO()}toString(){return this.toISO()}[/* @__PURE__ */Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Ki(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=eo.fromDurationLike(e),r={};for(const s of Gi)(vn(t.values,s)||vn(this.values,s))&&(r[s]=t.get(s)+this.get(s));return Yi(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const t=eo.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const r of Object.keys(this.values))t[r]=Rn(e(this.values[r],r));return Yi(this,{values:t},!0)}get(e){return this[eo.normalizeUnit(e)]}set(e){if(!this.isValid)return this;return Yi(this,{values:{...this.values,...Mn(e,eo.normalizeUnit)}})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:r,matrix:s}={}){return Yi(this,{loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:s,conversionAccuracy:r})}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Qi(this.matrix,e),Yi(this,{values:e},!0)}rescale(){if(!this.isValid)return this;return Yi(this,{values:Xi(this.normalize().shiftToAll().toObject())},!0)}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map(e=>eo.normalizeUnit(e));const t={},r={},s=this.toObject();let n;for(const i of Gi)if(e.indexOf(i)>=0){n=i;let e=0;for(const t in r)e+=this.matrix[t][i]*r[t],r[t]=0;fn(s[i])&&(e+=s[i]);const o=Math.trunc(e);t[i]=o,r[i]=(1e3*e-1e3*o)/1e3}else fn(s[i])&&(r[i]=s[i]);for(const i in r)0!==r[i]&&(t[n]+=i===n?r[i]:r[i]/this.matrix[n][i]);return Qi(this.matrix,t),Yi(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=0===this.values[t]?0:-this.values[t];return Yi(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;return Yi(this,{values:Xi(this.values)},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;function t(e,t){return void 0===e||0===e?void 0===t||0===t:e===t}for(const r of Gi)if(!t(this.values[r],e.values[r]))return!1;return!0}}const to="Invalid Interval";class ro{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new Dr("need to specify a reason the Interval is invalid");const r=e instanceof Ys?e:new Ys(e,t);if(Js.throwOnInvalid)throw new Pr(r);return new ro({invalid:r})}static fromDateTimes(e,t){const r=Jo(e),s=Jo(t),n=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?ro.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null:ro.invalid("missing or invalid end"):ro.invalid("missing or invalid start")}(r,s);return null==n?new ro({start:r,end:s}):n}static after(e,t){const r=eo.fromDurationLike(t),s=Jo(e);return ro.fromDateTimes(s,s.plus(r))}static before(e,t){const r=eo.fromDurationLike(t),s=Jo(e);return ro.fromDateTimes(s.minus(r),s)}static fromISO(e,t){const[r,s]=(e||"").split("/",2);if(r&&s){let e,i,o,a;try{e=Go.fromISO(r,t),i=e.isValid}catch(n){i=!1}try{o=Go.fromISO(s,t),a=o.isValid}catch(n){a=!1}if(i&&a)return ro.fromDateTimes(e,o);if(i){const r=eo.fromISO(s,t);if(r.isValid)return ro.after(e,r)}else if(a){const e=eo.fromISO(r,t);if(e.isValid)return ro.before(o,e)}}return ro.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return null===this.invalidReason}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",t){if(!this.isValid)return NaN;const r=this.start.startOf(e,t);let s;return s=t?.useLocaleWeeks?this.end.reconfigure({locale:r.locale}):this.end,s=s.startOf(e,t),Math.floor(s.diff(r,e).get(e))+(s.valueOf()!==this.end.valueOf())}hasSame(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return!!this.isValid&&this.s>e}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&(this.s<=e&&this.e>e)}set({start:e,end:t}={}){return this.isValid?ro.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Jo).filter(e=>this.contains(e)).sort((e,t)=>e.toMillis()-t.toMillis()),r=[];let{s:s}=this,n=0;for(;s<this.e;){const e=t[n]||this.e,i=+e>+this.e?this.e:e;r.push(ro.fromDateTimes(s,i)),s=i,n+=1}return r}splitBy(e){const t=eo.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let r,{s:s}=this,n=1;const i=[];for(;s<this.e;){const e=this.start.plus(t.mapUnits(e=>e*n));r=+e>+this.e?this.e:e,i.push(ro.fromDateTimes(s,r)),s=r,n+=1}return i}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return!!this.isValid&&+this.e===+e.s}abutsEnd(e){return!!this.isValid&&+e.e===+this.s}engulfs(e){return!!this.isValid&&(this.s<=e.s&&this.e>=e.e)}equals(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return t>=r?null:ro.fromDateTimes(t,r)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return ro.fromDateTimes(t,r)}static merge(e){const[t,r]=e.sort((e,t)=>e.s-t.s).reduce(([e,t],r)=>t?t.overlaps(r)||t.abutsStart(r)?[e,t.union(r)]:[e.concat([t]),r]:[e,r],[[],null]);return r&&t.push(r),t}static xor(e){let t=null,r=0;const s=[],n=e.map(e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}]),i=Array.prototype.concat(...n).sort((e,t)=>e.time-t.time);for(const o of i)r+="s"===o.type?1:-1,1===r?t=o.time:(t&&+t!==+o.time&&s.push(ro.fromDateTimes(t,o.time)),t=null);return ro.merge(s)}difference(...e){return ro.xor([this].concat(e)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:to}[/* @__PURE__ */Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=Vr,t={}){return this.isValid?ei.create(this.s.loc.clone(t),e).formatInterval(this):to}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:to}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:to}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:to}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:to}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):eo.invalid(this.invalidReason)}mapEndpoints(e){return ro.fromDateTimes(e(this.s),e(this.e))}}class so{static hasDST(e=Js.defaultZone){const t=Go.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return gs.isValidZone(e)}static normalizeZone(e){return Rs(e,Js.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||$s.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||$s.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||$s.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:r=null,locObj:s=null,outputCalendar:n="gregory"}={}){return(s||$s.create(t,r,n)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:s=null,outputCalendar:n="gregory"}={}){return(s||$s.create(t,r,n)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:r=null,locObj:s=null}={}){return(s||$s.create(t,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:s=null}={}){return(s||$s.create(t,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return $s.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return $s.create(t,null,"gregory").eras(e)}static features(){return{relative:mn(),localeWeek:gn()}}}function no(e,t){const r=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),s=r(t)-r(e);return Math.floor(eo.fromMillis(s).as("days"))}function io(e,t,r,s){let[n,i,o,a]=function(e,t,r){const s=[["years",(e,t)=>t.year-e.year],["quarters",(e,t)=>t.quarter-e.quarter+4*(t.year-e.year)],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const r=no(e,t);return(r-r%7)/7}],["days",no]],n={},i=e;let o,a;for(const[l,c]of s)r.indexOf(l)>=0&&(o=l,n[l]=c(e,t),a=i.plus(n),a>t?(n[l]--,(e=i.plus(n))>t&&(a=e,n[l]--,e=i.plus(n))):e=a);return[e,n,a,o]}(e,t,r);const l=t-n,c=r.filter(e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0);0===c.length&&(o<t&&(o=n.plus({[a]:1})),o!==n&&(i[a]=(i[a]||0)+l/(o-n)));const u=eo.fromObject(i,s);return c.length>0?eo.fromMillis(l,s).shiftTo(...c).plus(u):u}function oo(e,t=e=>e){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let r=0;r<e.length;r++){const s=e.charCodeAt(r);if(-1!==e[r].search(Ms.hanidec))t+=zs.indexOf(e[r]);else for(const e in Ds){const[r,n]=Ds[e];s>=r&&s<=n&&(t+=s-r)}}return parseInt(t,10)}return t}(e))}}const ao=`[ ${String.fromCharCode(160)}]`,lo=new RegExp(ao,"g");function co(e){return e.replace(/\./g,"\\.?").replace(lo,ao)}function uo(e){return e.replace(/\./g,"").replace(lo," ").toLowerCase()}function ho(e,t){return null===e?null:{regex:RegExp(e.map(co).join("|")),deser:([r])=>e.findIndex(e=>uo(r)===uo(e))+t}}function fo(e,t){return{regex:e,deser:([,e,t])=>Ln(e,t),groups:t}}function po(e){return{regex:e,deser:([e])=>e}}const mo={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};let go=null;function yo(e,t){return Array.prototype.concat(...e.map(e=>function(e,t){if(e.literal)return e;const r=Eo(ei.macroTokenToFormatOpts(e.val),t);return null==r||r.includes(void 0)?e:r}(e,t)))}class vo{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=yo(ei.parseFormat(t),e),this.units=this.tokens.map(t=>function(e,t){const r=Hs(t),s=Hs(t,"{2}"),n=Hs(t,"{3}"),i=Hs(t,"{4}"),o=Hs(t,"{6}"),a=Hs(t,"{1,2}"),l=Hs(t,"{1,3}"),c=Hs(t,"{1,6}"),u=Hs(t,"{1,9}"),h=Hs(t,"{2,4}"),d=Hs(t,"{4,6}"),f=e=>{return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([e])=>e,literal:!0};var t},p=(p=>{if(e.literal)return f(p);switch(p.val){case"G":return ho(t.eras("short"),0);case"GG":return ho(t.eras("long"),0);case"y":return oo(c);case"yy":case"kk":return oo(h,Nn);case"yyyy":case"kkkk":return oo(i);case"yyyyy":return oo(d);case"yyyyyy":return oo(o);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return oo(a);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return oo(s);case"MMM":return ho(t.months("short",!0),1);case"MMMM":return ho(t.months("long",!0),1);case"LLL":return ho(t.months("short",!1),1);case"LLLL":return ho(t.months("long",!1),1);case"o":case"S":return oo(l);case"ooo":case"SSS":return oo(n);case"u":return po(u);case"uu":return po(a);case"uuu":case"E":case"c":return oo(r);case"a":return ho(t.meridiems(),0);case"EEE":return ho(t.weekdays("short",!1),1);case"EEEE":return ho(t.weekdays("long",!1),1);case"ccc":return ho(t.weekdays("short",!0),1);case"cccc":return ho(t.weekdays("long",!0),1);case"Z":case"ZZ":return fo(new RegExp(`([+-]${a.source})(?::(${s.source}))?`),2);case"ZZZ":return fo(new RegExp(`([+-]${a.source})(${s.source})?`),2);case"z":return po(/[a-z_+-/]{1,256}?/i);case" ":return po(/[^\S\n\r]/);default:return f(p)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return p.token=e,p}(t,e)),this.disqualifyingUnit=this.units.find(e=>e.invalidReason),!this.disqualifyingUnit){const[e,t]=[`^${(r=this.units).map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,"")}$`,r];this.regex=RegExp(e,"i"),this.handlers=t}var r}explainFromTokens(e){if(this.isValid){const[t,r]=function(e,t,r){const s=e.match(t);if(s){const e={};let t=1;for(const n in r)if(vn(r,n)){const i=r[n],o=i.groups?i.groups+1:1;!i.literal&&i.token&&(e[i.token.val[0]]=i.deser(s.slice(t,t+o))),t+=o}return[s,e]}return[s,{}]}(e,this.regex,this.handlers),[s,n,i]=r?function(e){let t,r=null;return dn(e.z)||(r=gs.create(e.z)),dn(e.Z)||(r||(r=new Ps(e.Z)),t=e.Z),dn(e.q)||(e.M=3*(e.q-1)+1),dn(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),dn(e.u)||(e.S=On(e.u)),[Object.keys(e).reduce((t,r)=>{const s=(e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(r);return s&&(t[s]=e[r]),t},{}),r,t]}(r):[null,null,void 0];if(vn(r,"a")&&vn(r,"H"))throw new Rr("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:r,result:s,zone:n,specificOffset:i}}return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function wo(e,t,r){return new vo(e,r).explainFromTokens(t)}function Eo(e,t){if(!e)return null;const r=ei.create(t,e).dtFormatter((go||(go=Go.fromMillis(1555555555555)),go)),s=r.formatToParts(),n=r.resolvedOptions();return s.map(t=>function(e,t,r){const{type:s,value:n}=e;if("literal"===s){const e=/^\s+$/.test(n);return{literal:!e,val:e?" ":n}}const i=t[s];let o=s;"hour"===s&&(o=null!=t.hour12?t.hour12?"hour12":"hour24":null!=t.hourCycle?"h11"===t.hourCycle||"h12"===t.hourCycle?"hour12":"hour24":r.hour12?"hour12":"hour24");let a=mo[o];if("object"==typeof a&&(a=a[i]),a)return{literal:!1,val:a}}(t,e,n))}const So="Invalid DateTime",bo=864e13;function To(e){return new Ys("unsupported zone",`the zone "${e.name}" is not supported`)}function Oo(e){return null===e.weekData&&(e.weekData=nn(e.c)),e.weekData}function ko(e){return null===e.localWeekData&&(e.localWeekData=nn(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function xo(e,t){const r={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Go({...r,...t,old:r})}function Co(e,t,r){let s=e-60*t*1e3;const n=r.offset(s);if(t===n)return[s,t];s-=60*(n-t)*1e3;const i=r.offset(s);return n===i?[s,n]:[e-60*Math.min(n,i)*1e3,Math.max(n,i)]}function _o(e,t){const r=new Date(e+=60*t*1e3);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function Ao(e,t,r){return Co(An(e),t,r)}function Fo(e,t){const r=e.o,s=e.c.year+Math.trunc(t.years),n=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),i={...e.c,year:s,month:n,day:Math.min(e.c.day,_n(s,n))+Math.trunc(t.days)+7*Math.trunc(t.weeks)},o=eo.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=An(i);let[l,c]=Co(a,r,e.zone);return 0!==o&&(l+=o,c=e.zone.offset(l)),{ts:l,o:c}}function $o(e,t,r,s,n,i){const{setZone:o,zone:a}=r;if(e&&0!==Object.keys(e).length||t){const s=t||a,n=Go.fromObject(e,{...r,zone:s,specificOffset:i});return o?n:n.setZone(a)}return Go.invalid(new Ys("unparsable",`the input "${n}" can't be parsed as ${s}`))}function No(e,t,r=!0){return e.isValid?ei.create($s.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(e,t):null}function Po(e,t,r){const s=e.c.year>9999||e.c.year<0;let n="";if(s&&e.c.year>=0&&(n+="+"),n+=Sn(e.c.year,s?6:4),"year"===r)return n;if(t){if(n+="-",n+=Sn(e.c.month),"month"===r)return n;n+="-"}else if(n+=Sn(e.c.month),"month"===r)return n;return n+=Sn(e.c.day),n}function Lo(e,t,r,s,n,i,o){let a=!r||0!==e.c.millisecond||0!==e.c.second,l="";switch(o){case"day":case"month":case"year":break;default:if(l+=Sn(e.c.hour),"hour"===o)break;if(t){if(l+=":",l+=Sn(e.c.minute),"minute"===o)break;a&&(l+=":",l+=Sn(e.c.second))}else{if(l+=Sn(e.c.minute),"minute"===o)break;a&&(l+=Sn(e.c.second))}if("second"===o)break;!a||s&&0===e.c.millisecond||(l+=".",l+=Sn(e.c.millisecond,3))}return n&&(e.isOffsetFixed&&0===e.offset&&!i?l+="Z":e.o<0?(l+="-",l+=Sn(Math.trunc(-e.o/60)),l+=":",l+=Sn(Math.trunc(-e.o%60))):(l+="+",l+=Sn(Math.trunc(e.o/60)),l+=":",l+=Sn(Math.trunc(e.o%60)))),i&&(l+="["+e.zone.ianaName+"]"),l}const Ro={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Mo={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Do={ordinal:1,hour:0,minute:0,second:0,millisecond:0},zo=["year","month","day","hour","minute","second","millisecond"],Io=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Ho=["year","ordinal","hour","minute","second","millisecond"];function jo(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new Mr(e);return t}function Vo(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return jo(e)}}function Uo(e,t){const r=Rs(t.zone,Js.defaultZone);if(!r.isValid)return Go.invalid(To(r));const s=$s.fromObject(t);let n,i;if(dn(e.year))n=Js.now();else{for(const r of zo)dn(e[r])&&(e[r]=Ro[r]);const t=un(e)||hn(e);if(t)return Go.invalid(t);const s=function(e){if(void 0===Zo&&(Zo=Js.now()),"iana"!==e.type)return e.offset(Zo);const t=e.name;let r=qo.get(t);return void 0===r&&(r=e.offset(Zo),qo.set(t,r)),r}(r);[n,i]=Ao(e,s,r)}return new Go({ts:n,zone:r,loc:s,o:i})}function Wo(e,t,r){const s=!!dn(r.round)||r.round,n=dn(r.rounding)?"trunc":r.rounding,i=(e,i)=>{e=kn(e,s||r.calendary?0:2,r.calendary?"round":n);return t.loc.clone(r).relFormatter(r).format(e,i)},o=s=>r.calendary?t.hasSame(e,s)?0:t.startOf(s).diff(e.startOf(s),s).get(s):t.diff(e,s).get(s);if(r.unit)return i(o(r.unit),r.unit);for(const a of r.units){const e=o(a);if(Math.abs(e)>=1)return i(e,a)}return i(e>t?-0:0,r.units[r.units.length-1])}function Bo(e){let t,r={};return e.length>0&&"object"==typeof e[e.length-1]?(r=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[r,t]}let Zo;const qo=/* @__PURE__ */new Map;class Go{constructor(e){const t=e.zone||Js.defaultZone;let r=e.invalid||(Number.isNaN(e.ts)?new Ys("invalid input"):null)||(t.isValid?null:To(t));this.ts=dn(e.ts)?Js.now():e.ts;let s=null,n=null;if(!r){if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[s,n]=[e.old.c,e.old.o];else{const i=fn(e.o)&&!e.old?e.o:t.offset(this.ts);s=_o(this.ts,i),r=Number.isNaN(s.year)?new Ys("invalid input"):null,s=r?null:s,n=r?null:i}}this._zone=t,this.loc=e.loc||$s.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=s,this.o=n,this.isLuxonDateTime=!0}static now(){return new Go({})}static local(){const[e,t]=Bo(arguments),[r,s,n,i,o,a,l]=t;return Uo({year:r,month:s,day:n,hour:i,minute:o,second:a,millisecond:l},e)}static utc(){const[e,t]=Bo(arguments),[r,s,n,i,o,a,l]=t;return e.zone=Ps.utcInstance,Uo({year:r,month:s,day:n,hour:i,minute:o,second:a,millisecond:l},e)}static fromJSDate(e,t={}){const r=(s=e,"[object Date]"===Object.prototype.toString.call(s)?e.valueOf():NaN);var s;if(Number.isNaN(r))return Go.invalid("invalid input");const n=Rs(t.zone,Js.defaultZone);return n.isValid?new Go({ts:r,zone:n,loc:$s.fromObject(t)}):Go.invalid(To(n))}static fromMillis(e,t={}){if(fn(e))return e<-bo||e>bo?Go.invalid("Timestamp out of range"):new Go({ts:e,zone:Rs(t.zone,Js.defaultZone),loc:$s.fromObject(t)});throw new Dr(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(fn(e))return new Go({ts:1e3*e,zone:Rs(t.zone,Js.defaultZone),loc:$s.fromObject(t)});throw new Dr("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const r=Rs(t.zone,Js.defaultZone);if(!r.isValid)return Go.invalid(To(r));const s=$s.fromObject(t),n=Mn(e,Vo),{minDaysInFirstWeek:i,startOfWeek:o}=cn(n,s),a=Js.now(),l=dn(t.specificOffset)?r.offset(a):t.specificOffset,c=!dn(n.ordinal),u=!dn(n.year),h=!dn(n.month)||!dn(n.day),d=u||h,f=n.weekYear||n.weekNumber;if((d||c)&&f)throw new Rr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&c)throw new Rr("Can't mix ordinal dates with month/day");const p=f||n.weekday&&!d;let m,g,y=_o(a,l);p?(m=Io,g=Mo,y=nn(y,i,o)):c?(m=Ho,g=Do,y=an(y)):(m=zo,g=Ro);let v=!1;for(const k of m){dn(n[k])?n[k]=v?g[k]:y[k]:v=!0}const w=p?function(e,t=4,r=1){const s=pn(e.weekYear),n=En(e.weekNumber,1,$n(e.weekYear,t,r)),i=En(e.weekday,1,7);return s?n?!i&&Xs("weekday",e.weekday):Xs("week",e.weekNumber):Xs("weekYear",e.weekYear)}(n,i,o):c?function(e){const t=pn(e.year),r=En(e.ordinal,1,Cn(e.year));return t?!r&&Xs("ordinal",e.ordinal):Xs("year",e.year)}(n):un(n),E=w||hn(n);if(E)return Go.invalid(E);const S=p?on(n,i,o):c?ln(n):n,[b,T]=Ao(S,l,r),O=new Go({ts:b,zone:r,o:T,loc:s});return n.weekday&&d&&e.weekday!==O.weekday?Go.invalid("mismatched weekday",`you can't specify both a weekday of ${n.weekday} and a date of ${O.toISO()}`):O.isValid?O:Go.invalid(O.invalid)}static fromISO(e,t={}){const[r,s]=ni(e,[Fi,Li],[$i,Ri],[Ni,Mi],[Pi,Di]);return $o(r,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[r,s]=ni(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[Ti,Oi]);return $o(r,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[r,s]=ni(e,[ki,_i],[xi,_i],[Ci,Ai]);return $o(r,s,t,"HTTP",t)}static fromFormat(e,t,r={}){if(dn(e)||dn(t))throw new Dr("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:n=null}=r,i=$s.fromOpts({locale:s,numberingSystem:n,defaultToEN:!0}),[o,a,l,c]=function(e,t,r){const{result:s,zone:n,specificOffset:i,invalidReason:o}=wo(e,t,r);return[s,n,i,o]}(i,e,t);return c?Go.invalid(c):$o(o,a,r,`format ${t}`,e,l)}static fromString(e,t,r={}){return Go.fromFormat(e,t,r)}static fromSQL(e,t={}){const[r,s]=ni(e,[Ii,Li],[Hi,ji]);return $o(r,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Dr("need to specify a reason the DateTime is invalid");const r=e instanceof Ys?e:new Ys(e,t);if(Js.throwOnInvalid)throw new Nr(r);return new Go({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const r=Eo(e,$s.fromObject(t));return r?r.map(e=>e?e.val:null).join(""):null}static expandFormat(e,t={}){return yo(ei.parseFormat(e),$s.fromObject(t)).map(e=>e.val).join("")}static resetCache(){Zo=void 0,qo.clear()}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Oo(this).weekYear:NaN}get weekNumber(){return this.isValid?Oo(this).weekNumber:NaN}get weekday(){return this.isValid?Oo(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?ko(this).weekday:NaN}get localWeekNumber(){return this.isValid?ko(this).weekNumber:NaN}get localWeekYear(){return this.isValid?ko(this).weekYear:NaN}get ordinal(){return this.isValid?an(this.c).ordinal:NaN}get monthShort(){return this.isValid?so.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?so.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?so.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?so.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,r=An(this.c),s=this.zone.offset(r-e),n=this.zone.offset(r+e),i=this.zone.offset(r-s*t),o=this.zone.offset(r-n*t);if(i===o)return[this];const a=r-i*t,l=r-o*t,c=_o(a,i),u=_o(l,o);return c.hour===u.hour&&c.minute===u.minute&&c.second===u.second&&c.millisecond===u.millisecond?[xo(this,{ts:a}),xo(this,{ts:l})]:[this]}get isInLeapYear(){return xn(this.year)}get daysInMonth(){return _n(this.year,this.month)}get daysInYear(){return this.isValid?Cn(this.year):NaN}get weeksInWeekYear(){return this.isValid?$n(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?$n(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:r,calendar:s}=ei.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:r,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(Ps.instance(e),t)}toLocal(){return this.setZone(Js.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:r=!1}={}){if((e=Rs(e,Js.defaultZone)).equals(this.zone))return this;if(e.isValid){let s=this.ts;if(t||r){const t=e.offset(this.ts),r=this.toObject();[s]=Ao(r,t,e)}return xo(this,{ts:s,zone:e})}return Go.invalid(To(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:r}={}){return xo(this,{loc:this.loc.clone({locale:e,numberingSystem:t,outputCalendar:r})})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=Mn(e,Vo),{minDaysInFirstWeek:r,startOfWeek:s}=cn(t,this.loc),n=!dn(t.weekYear)||!dn(t.weekNumber)||!dn(t.weekday),i=!dn(t.ordinal),o=!dn(t.year),a=!dn(t.month)||!dn(t.day),l=o||a,c=t.weekYear||t.weekNumber;if((l||i)&&c)throw new Rr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&i)throw new Rr("Can't mix ordinal dates with month/day");let u;n?u=on({...nn(this.c,r,s),...t},r,s):dn(t.ordinal)?(u={...this.toObject(),...t},dn(t.day)&&(u.day=Math.min(_n(u.year,u.month),u.day))):u=ln({...an(this.c),...t});const[h,d]=Ao(u,this.o,this.zone);return xo(this,{ts:h,o:d})}plus(e){if(!this.isValid)return this;return xo(this,Fo(this,eo.fromDurationLike(e)))}minus(e){if(!this.isValid)return this;return xo(this,Fo(this,eo.fromDurationLike(e).negate()))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const r={},s=eo.normalizeUnit(e);switch(s){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0}if("weeks"===s)if(t){const e=this.loc.getStartOfWeek(),{weekday:t}=this;t<e&&(r.weekNumber=this.weekNumber-1),r.weekday=e}else r.weekday=1;if("quarters"===s){const e=Math.ceil(this.month/3);r.month=3*(e-1)+1}return this.set(r)}endOf(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?ei.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):So}toLocaleString(e=Vr,t={}){return this.isValid?ei.create(this.loc.clone(t),e).formatDateTime(this):So}toLocaleParts(e={}){return this.isValid?ei.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:r=!1,includeOffset:s=!0,extendedZone:n=!1,precision:i="milliseconds"}={}){if(!this.isValid)return null;const o="extended"===e;let a=Po(this,o,i=jo(i));return zo.indexOf(i)>=3&&(a+="T"),a+=Lo(this,o,t,r,s,n,i),a}toISODate({format:e="extended",precision:t="day"}={}){return this.isValid?Po(this,"extended"===e,jo(t)):null}toISOWeekDate(){return No(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:r=!0,includePrefix:s=!1,extendedZone:n=!1,format:i="extended",precision:o="milliseconds"}={}){if(!this.isValid)return null;return o=jo(o),(s&&zo.indexOf(o)>=3?"T":"")+Lo(this,"extended"===i,t,e,r,n,o)}toRFC2822(){return No(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return No(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Po(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:r=!0}={}){let s="HH:mm:ss.SSS";return(t||e)&&(r&&(s+=" "),t?s+="z":e&&(s+="ZZ")),No(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():So}[/* @__PURE__ */Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",r={}){if(!this.isValid||!e.isValid)return eo.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...r},n=(a=t,Array.isArray(a)?a:[a]).map(eo.normalizeUnit),i=e.valueOf()>this.valueOf(),o=io(i?this:e,i?e:this,n,s);var a;return i?o.negate():o}diffNow(e="milliseconds",t={}){return this.diff(Go.now(),e,t)}until(e){return this.isValid?ro.fromDateTimes(this,e):this}hasSame(e,t,r){if(!this.isValid)return!1;const s=e.valueOf(),n=this.setZone(e.zone,{keepLocalTime:!0});return n.startOf(t,r)<=s&&s<=n.endOf(t,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Go.fromObject({},{zone:this.zone}),r=e.padding?this<t?-e.padding:e.padding:0;let s=["years","months","days","hours","minutes","seconds"],n=e.unit;return Array.isArray(e.unit)&&(s=e.unit,n=void 0),Wo(t,this.plus(r),{...e,numeric:"always",units:s,unit:n})}toRelativeCalendar(e={}){return this.isValid?Wo(e.base||Go.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(Go.isDateTime))throw new Dr("min requires all arguments be DateTimes");return yn(e,e=>e.valueOf(),Math.min)}static max(...e){if(!e.every(Go.isDateTime))throw new Dr("max requires all arguments be DateTimes");return yn(e,e=>e.valueOf(),Math.max)}static fromFormatExplain(e,t,r={}){const{locale:s=null,numberingSystem:n=null}=r;return wo($s.fromOpts({locale:s,numberingSystem:n,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,r={}){return Go.fromFormatExplain(e,t,r)}static buildFormatParser(e,t={}){const{locale:r=null,numberingSystem:s=null}=t,n=$s.fromOpts({locale:r,numberingSystem:s,defaultToEN:!0});return new vo(n,e)}static fromFormatParser(e,t,r={}){if(dn(e)||dn(t))throw new Dr("fromFormatParser requires an input string and a format parser");const{locale:s=null,numberingSystem:n=null}=r,i=$s.fromOpts({locale:s,numberingSystem:n,defaultToEN:!0});if(!i.equals(t.locale))throw new Dr(`fromFormatParser called with a locale of ${i}, but the format parser was created for ${t.locale}`);const{result:o,zone:a,specificOffset:l,invalidReason:c}=t.explainFromTokens(e);return c?Go.invalid(c):$o(o,a,r,`format ${t.format}`,e,l)}static get DATE_SHORT(){return Vr}static get DATE_MED(){return Ur}static get DATE_MED_WITH_WEEKDAY(){return Wr}static get DATE_FULL(){return Br}static get DATE_HUGE(){return Zr}static get TIME_SIMPLE(){return qr}static get TIME_WITH_SECONDS(){return Gr}static get TIME_WITH_SHORT_OFFSET(){return Jr}static get TIME_WITH_LONG_OFFSET(){return Yr}static get TIME_24_SIMPLE(){return Kr}static get TIME_24_WITH_SECONDS(){return Qr}static get TIME_24_WITH_SHORT_OFFSET(){return Xr}static get TIME_24_WITH_LONG_OFFSET(){return es}static get DATETIME_SHORT(){return ts}static get DATETIME_SHORT_WITH_SECONDS(){return rs}static get DATETIME_MED(){return ss}static get DATETIME_MED_WITH_SECONDS(){return ns}static get DATETIME_MED_WITH_WEEKDAY(){return is}static get DATETIME_FULL(){return os}static get DATETIME_FULL_WITH_SECONDS(){return as}static get DATETIME_HUGE(){return ls}static get DATETIME_HUGE_WITH_SECONDS(){return cs}}function Jo(e){if(Go.isDateTime(e))return e;if(e&&e.valueOf&&fn(e.valueOf()))return Go.fromJSDate(e);if(e&&"object"==typeof e)return Go.fromObject(e);throw new Dr(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const Yo=class e{constructor(){}static constructFromServiceResolver(){return new e}onEvent(t){if(t.getIdentifier()!==e.eventListenerTarget)return;const r=t.getNormalizedValue();if(!(r instanceof Date))return;const s=Go.fromJSDate(r).toFormat("yyyy-MM-dd'T'HH:mm:ssZZ");t.setRawValue(s),t.stopPropagation()}};Yo.eventListenerTarget=r.NormalizedValueToRawValueEvent,Yo.priority=50;let Ko=Yo;const Qo=class e{constructor(){}static constructFromServiceResolver(){return new e}onEvent(t){if(t.getIdentifier()!==e.eventListenerTarget)return;const r=t.getRawValue();if("string"!=typeof r)return;if(!e.dateRegex.test(r))return;const s=new Date(r);t.setNormalizedValue(s),t.stopPropagation()}};Qo.eventListenerTarget=r.RawValueToNormalizedValueEvent,Qo.priority=50,Qo.dateRegex=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\+\d{2}:\d{2}$/;let Xo=Qo;const ea=class e{constructor(){}static constructFromServiceResolver(){return new e}onEvent(t){if(t.getIdentifier()!==e.eventListenerTarget)return;const r=t.getNormalizedValue();(Array.isArray(r)||"number"==typeof r||"boolean"==typeof r||"string"==typeof r||r instanceof String||null===r)&&(t.setRawValue(r),t.stopPropagation())}};ea.eventListenerTarget=r.NormalizedValueToRawValueEvent,ea.priority=0;let ta=ea;const ra=class e{constructor(){}static constructFromServiceResolver(){return new e}onEvent(t){if(t.getIdentifier()!==e.eventListenerTarget)return;const r=t.getRawValue();(Array.isArray(r)||"number"==typeof r||"boolean"==typeof r||"string"==typeof r||null===r)&&(t.setNormalizedValue(r),t.stopPropagation())}};ra.eventListenerTarget=r.RawValueToNormalizedValueEvent,ra.priority=0;let sa=ra;function na(e){const t=e.getServiceOrFail(Ht.identifier),r=[Ko,Xo,ta,sa];for(let s=0;s<r.length;s++)t.addListener(r[s].eventListenerTarget,r[s].constructFromServiceResolver(),r[s].priority)}const ia=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,DateTimeNormalizedValueToRawValueEventListener:Ko,DateTimeRawValueToNormalizedValueEventListener:Xo,GenericNormalizedValueToRawValueEventListener:ta,GenericRawValueToNormalizedValueEventListener:sa,initEventListener:na},Symbol.toStringTag,{value:"Module"}));const oa={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]};function aa(e,t,r,s=!1){const n=String(t),i=(e,t)=>`[${t[0]}m${e}[${t[1]}m`,o=(e,t)=>null!=t&&"string"==typeof t?i(e,oa[t]):null!=t&&Array.isArray(t)?t.reduce((e,t)=>o(e,t),e):null!=t&&null!=t[e.trim()]?o(e,t[e.trim()]):null!=t&&null!=t["*"]?o(e,t["*"]):e;return n.replace(/{{(.+?)}}/g,(t,n)=>{const a=null!=r[n]?String(r[n]):s?"":t;return e.stylePrettyLogs?o(a,e?.prettyLogStyles?.[n]??null)+i("",oa.reset):a})}function la(e,t=2,r=0){return null!=e&&isNaN(e)?"":(e=null!=e?e+r:e,2===t?null==e?"--":e<10?"0"+e:e.toString():null==e?"---":e<10?"00"+e:e<100?"0"+e:e.toString())}function ca(e,t){if(null==t)return{text:"",template:e.prettyLogTemplate,placeholders:{}};let r=e.prettyLogTemplate;const s={};r.includes("{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}")?r=r.replace("{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}","{{dateIsoStr}}"):"UTC"===e.prettyLogTimeZone?(s.yyyy=t.date?.getUTCFullYear()??"----",s.mm=la(t.date?.getUTCMonth(),2,1),s.dd=la(t.date?.getUTCDate(),2),s.hh=la(t.date?.getUTCHours(),2),s.MM=la(t.date?.getUTCMinutes(),2),s.ss=la(t.date?.getUTCSeconds(),2),s.ms=la(t.date?.getUTCMilliseconds(),3)):(s.yyyy=t.date?.getFullYear()??"----",s.mm=la(t.date?.getMonth(),2,1),s.dd=la(t.date?.getDate(),2),s.hh=la(t.date?.getHours(),2),s.MM=la(t.date?.getMinutes(),2),s.ss=la(t.date?.getSeconds(),2),s.ms=la(t.date?.getMilliseconds(),3));const n="UTC"===e.prettyLogTimeZone?t.date:null!=t.date?new Date(t.date.getTime()-6e4*t.date.getTimezoneOffset()):void 0;s.rawIsoStr=n?.toISOString()??"",s.dateIsoStr=n?.toISOString().replace("T"," ").replace("Z","")??"",s.logLevelName=t.logLevelName,s.fileNameWithLine=t.path?.fileNameWithLine??"",s.filePathWithLine=t.path?.filePathWithLine??"",s.fullFilePath=t.path?.fullFilePath??"";let i=e.parentNames?.join(e.prettyErrorParentNamesSeparator);i=null!=i&&null!=t.name?i+e.prettyErrorParentNamesSeparator:void 0;const o=null!=t.name||null!=i?`${i??""}${t.name??""}`:"";return s.name=o,s.nameWithDelimiterPrefix=o.length>0?e.prettyErrorLoggerNameDelimiter+o:"",s.nameWithDelimiterSuffix=o.length>0?o+e.prettyErrorLoggerNameDelimiter:"",null!=e.overwrite?.addPlaceholders&&e.overwrite.addPlaceholders(t,s),{text:aa(e,r,s),template:r,placeholders:s}}const ua=[/(?:^|[\\/])node_modules[\\/].*tslog/i,/(?:^|[\\/])deps[\\/].*tslog/i,/tslog[\\/]+src[\\/]+internal[\\/]/i,/tslog[\\/]+src[\\/]BaseLogger/i,/tslog[\\/]+src[\\/]index/i];function ha(e,t){return function(e,t){const r=[];for(const s of e){const e=t(s);null!=e&&r.push(e)}return r}(function(e){return t=function(e){const t="string"==typeof e?.stack?e.stack:void 0;return null==t||0===t.length?[]:t.split("\n").map(e=>e.trimEnd())}(e),t.filter(e=>e.length>0&&!/^\s*Error\b/.test(e));var t}(e),t)}function da(e,t){return e<0?0:e>=t?Math.max(0,t-1):e}function fa(){return[...ua]}function pa(e){if(e instanceof Error)return e;const t=new Error("string"==typeof e?e:JSON.stringify(e));return"object"==typeof e&&null!=e&&Object.assign(t,e),t}function ma(e){const t=/* @__PURE__ */new Set;return JSON.stringify(e,(e,r)=>{if("object"==typeof r&&null!==r){if(t.has(r))return"[Circular]";t.add(r)}return"bigint"==typeof r?`${r}`:void 0===r?"[undefined]":r})}function ga(e,t){const r={seen:[],stylize:va};return null!=t&&Pa(r,t),ya(r.showHidden)&&(r.showHidden=!1),ya(r.depth)&&(r.depth=2),ya(r.colors)&&(r.colors=!0),ya(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=wa),Fa(r,e,r.depth)}function ya(e){return void 0===e}function va(e){return e}function wa(e,t){const r=ga.styles[t];return null!=r&&null!=ga?.colors?.[r]?.[0]&&null!=ga?.colors?.[r]?.[1]?"["+ga.colors[r][0]+"m"+e+"["+ga.colors[r][1]+"m":e}function Ea(e){return"function"==typeof e}function Sa(e){return"string"==typeof e}function ba(e){return null===e}function Ta(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Oa(e){return ka(e)&&"[object RegExp]"===_a(e)}function ka(e){return"object"==typeof e&&null!==e}function xa(e){return ka(e)&&("[object Error]"===_a(e)||e instanceof Error)}function Ca(e){return ka(e)&&"[object Date]"===_a(e)}function _a(e){return Object.prototype.toString.call(e)}function Aa(e){return"["+Error.prototype.toString.call(e)+"]"}function Fa(e,t,r=0){if(e.customInspect&&null!=t&&Ea(t)&&t?.inspect!==ga&&(!t?.constructor||t?.constructor.prototype!==t)){if("function"!=typeof t.inspect&&null!=t.toString)return t.toString();let s=t?.inspect(r,e);return Sa(s)||(s=Fa(e,s,r)),s}const s=Na(e,t);if(s)return s;let n=Object.keys(t);const i=function(e){const t={};return e.forEach(e=>{t[e]=!0}),t}(n);try{e.showHidden&&Object.getOwnPropertyNames&&(n=Object.getOwnPropertyNames(t))}catch{}if(xa(t)&&(n.indexOf("message")>=0||n.indexOf("description")>=0))return Aa(t);if(0===n.length){if(!Ea(e.stylize))return t;if(Ea(t)){const r=t.name?": "+t.name:"";return e.stylize("[Function"+r+"]","special")}if(Oa(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(Ca(t))return e.stylize(Date.prototype.toISOString.call(t),"date");if(xa(t))return Aa(t)}let o,a="",l=!1,c=["{\n","\n}"];if(Array.isArray(t)&&(l=!0,c=["[\n","\n]"]),Ea(t)){a=" [Function"+(t.name?": "+t.name:"")+"]"}return Oa(t)&&(a=" "+RegExp.prototype.toString.call(t)),Ca(t)&&(a=" "+Date.prototype.toUTCString.call(t)),xa(t)&&(a=" "+Aa(t)),0!==n.length||l&&0!=t.length?r<0?Oa(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),o=l?function(e,t,r,s,n){const i=[];for(let o=0,a=t.length;o<a;++o)Ta(t,String(o))?i.push($a(e,t,r,s,String(o),!0)):i.push("");return n.forEach(n=>{n.match(/^\d+$/)||i.push($a(e,t,r,s,n,!0))}),i}(e,t,r,i,n):n.map(s=>$a(e,t,r,i,s,l)),e.seen.pop(),function(e,t,r){return r[0]+(""===t?"":t+"\n")+" "+e.join(",\n ")+" "+r[1]}(o,a,c)):c[0]+a+c[1]}function $a(e,t,r,s,n,i){let o,a,l={value:void 0};try{l.value=t[n]}catch{}try{Object.getOwnPropertyDescriptor&&(l=Object.getOwnPropertyDescriptor(t,n)||l)}catch{}if(l.get?a=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(a=e.stylize("[Setter]","special")),Ta(s,n)||(o="["+n+"]"),a||(e.seen.indexOf(l.value)<0?(a=ba(r)?Fa(e,l.value,void 0):Fa(e,l.value,r-1),a.indexOf("\n")>-1&&(a=i?a.split("\n").map(e=>" "+e).join("\n").substr(2):"\n"+a.split("\n").map(e=>" "+e).join("\n"))):a=e.stylize("[Circular]","special")),ya(o)){if(i&&n.match(/^\d+$/))return a;o=JSON.stringify(""+n),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,"\\'").replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+a}function Na(e,t){if(ya(t))return e.stylize("undefined","undefined");if(Sa(t)){const r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,"\\'")+"'";return e.stylize(r,"string")}return"number"==typeof t?e.stylize(""+t,"number"):function(e){return"boolean"==typeof e}(t)?e.stylize(""+t,"boolean"):ba(t)?e.stylize("null","null"):void 0}function Pa(e,t){const r={...e};if(!t||!ka(t))return e;const s={...t},n=Object.keys(t);let i=n.length;for(;i--;)r[n[i]]=s[n[i]];return r}function La(){return"undefined"!=typeof window&&"undefined"!=typeof document}ga.colors=oa,ga.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};const Ra=/\u001b\[[0-9;]*m/g,Ma={black:"#000000",red:"#ef5350",green:"#66bb6a",yellow:"#fdd835",blue:"#42a5f5",magenta:"#ab47bc",cyan:"#26c6da",white:"#fafafa",blackBright:"#424242",redBright:"#ff7043",greenBright:"#81c784",yellowBright:"#ffe082",blueBright:"#64b5f6",magentaBright:"#ce93d8",cyanBright:"#4dd0e1",whiteBright:"#ffffff"},Da={bgBlack:"#000000",bgRed:"#ef5350",bgGreen:"#66bb6a",bgYellow:"#fdd835",bgBlue:"#42a5f5",bgMagenta:"#ab47bc",bgCyan:"#26c6da",bgWhite:"#fafafa",bgBlackBright:"#424242",bgRedBright:"#ff7043",bgGreenBright:"#81c784",bgYellowBright:"#ffe082",bgBlueBright:"#64b5f6",bgMagentaBright:"#ce93d8",bgCyanBright:"#4dd0e1",bgWhiteBright:"#ffffff"},za=/(?:(?:file|https?|global code|[^@]+)@)?(?:file:)?((?:\/[^:/]+){2,})(?::(\d+))?(?::(\d+))?/,Ia=function(){const e=function(){if(La()){const e=globalThis.navigator;return{name:"browser",userAgent:e?.userAgent}}const e=globalThis;if("function"==typeof e.importScripts)return{name:"worker",userAgent:e.navigator?.userAgent};const t=globalThis;if(null!=t.Bun){const e=t.Bun.version;return{name:"bun",version:null!=e?`bun/${e}`:void 0,hostname:p(t.process,t.Deno,t.Bun,t.location)}}if(null!=t.Deno){const e=function(e){try{if("function"==typeof e?.hostname){const t=e.hostname();if(null!=t&&t.length>0)return t}}catch{}const t=globalThis.location?.hostname;if(null!=t&&t.length>0)return t;return}(t.Deno),r=t.Deno?.version?.deno;return{name:"deno",version:null!=r?`deno/${r}`:void 0,hostname:e??p(t.process,t.Deno,t.Bun,t.location)}}if(null!=t.process?.versions?.node||null!=t.process?.version)return{name:"node",version:t.process?.versions?.node??t.process?.version,hostname:p(t.process,t.Deno,t.Bun,t.location)};if(null!=t.process)return{name:"node",version:"unknown",hostname:p(t.process,t.Deno,t.Bun,t.location)};return{name:"unknown"}}(),t=function(t){if("browser"===t.name||"worker"===t.name)return{runtime:t.name,browser:t.userAgent};const r={runtime:t.name};"node"!==e.name&&"deno"!==e.name&&"bun"!==e.name||(r.runtimeVersion=t.version??"unknown");"node"!==e.name&&"deno"!==e.name&&"bun"!==e.name||(r.hostname=t.hostname??"unknown");return r}(e),r="browser"===e.name||"worker"===e.name,s=r?[...fa(),/node_modules[\\/].*tslog/i]:[...fa(),/node:(?:internal|vm)/i,/\binternal[\\/]/i];let n;const i={getMeta:(e,r,s,n,o,a)=>Object.assign({},t,{name:o,parentNames:a,date:/* @__PURE__ */new Date,logLevelId:e,logLevelName:r,path:n?void 0:i.getCallerStackFrame(s)}),getCallerStackFrame(e,t=new Error){const r=ha(t,e=>o(e));if(0===r.length)return{};const n=function(e,t=ua){for(let r=0;r<e.length;r+=1){const s=e[r],n=s.filePath??"",i=s.fullFilePath??"";if(!t.some(e=>e.test(n)||e.test(i)))return r}return 0}(r,s);return r[da(Number.isFinite(e)&&e>=0?e:n,r.length)]??{}},getErrorTrace:e=>ha(e,e=>o(e)),isError:e=>function(e){if(e instanceof Error)return!0;if(null!=e&&"object"==typeof e){const t=Object.prototype.toString.call(e);if(/\[object .*Error\]/.test(t))return!0;const r=e.name;if("string"==typeof r&&r.endsWith("Error"))return!0}return!1}(e),isBuffer:e=>"undefined"!=typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(e),prettyFormatLogObj:(e,t)=>e.reduce((e,r)=>(i.isError(r)?e.errors.push(i.prettyFormatErrorObj(r,t)):e.args.push(r),e),{args:[],errors:[]}),prettyFormatErrorObj(e,t){const r=a(i.getErrorTrace(e),t),s=function(e,t={}){const r=t.maxDepth??5,s=[],n=/* @__PURE__ */new Set;let i=e,o=0;for(;null!=i&&o<r;){const e=i?.cause;if(null==e||n.has(e))break;n.add(e),s.push(pa(e)),i=e,o+=1}return s}(e).map((e,r)=>[`Caused by (${r+1}): ${e.name??"Error"}${e.message?`: ${e.message}`:""}`,...a(ha(e,e=>o(e)),t)].join("\n")),n={errorName:` ${e.name} `,errorMessage:l(e),errorStack:[...r,...s].join("\n")};return aa(t,t.prettyErrorTemplate,n)},transportFormatted(t,r,s,n,i){const o=!1!==i.stylePrettyLogs,a=(s.length>0&&r.length>0?"\n":"")+s.join("\n"),l=t.replace(Ra,"");const h=o?t:l;if(function(t){return t&&("browser"===e.name||"worker"===e.name)&&function(){if(!La())return!1;const e=globalThis?.navigator,t=e?.userAgent??"";if(/firefox/i.test(t))return!0;const r=globalThis;return!!r?.CSS?.supports?.("color","#000")||/safari/i.test(t)&&!/chrome/i.test(t)}()}(o)){i.prettyInspectOptions.colors=!1;const e=d(i.prettyInspectOptions,r),t=null!=n?function(e,t){if(null==t)return{text:"",styles:[]};const{template:r,placeholders:s}=ca(e,t),n=[],i=[];let o=0;const a=/{{(.+?)}}/g;let l;for(;null!=(l=a.exec(r));){l.index>o&&n.push(r.slice(o,l.index));const t=l[1],h=null!=s[t]?String(s[t]):"",d=u(c(e.prettyLogStyles?.[t],h));d.length>0?(n.push(`%c${h}%c`),i.push(d,"")):n.push(h),o=a.lastIndex}o<r.length&&n.push(r.slice(o));return{text:n.join(""),styles:i}}(i,n):{text:l,styles:[]},s=t.text.length>0&&t.styles.length>0,o=(s?t.text:l)+e+a;return void(s?console.log(o,...t.styles):console.log(o))}i.prettyInspectOptions.colors=o;const f=d(i.prettyInspectOptions,r);console.log(h+f+a)},transportJSON(e){console.log(ma(e))}};return"test"===function(){const e=globalThis?.process;return e?.env?.NODE_ENV}()&&(i.__resetWorkingDirectoryCacheForTests=()=>{n=void 0}),i;function o(e){return r?function(e){const t=globalThis.location?.origin;if(null==e)return;const r=e.match(za);if(!r)return;const s=r[1]?.replace(/\?.*$/,"");if(null==s)return;const n=s.split("/"),i=r[2],o=r[3],a=n[n.length-1];return{fullFilePath:t?`${t}${s}`:s,fileName:a,fileNameWithLine:a&&i?`${a}:${i}`:void 0,fileColumn:o,fileLine:i,filePath:s,filePathWithLine:i?`${s}:${i}`:void 0,method:void 0}}(e):function(e){if("string"!=typeof e||0===e.length)return;const t=e.trim();if(!t.includes(" at ")&&!t.startsWith("at "))return;const r=t.replace(/^at\s+/,"");let s,i=r;const o=r.match(/^(.*?)\s+\((.*)\)$/);o&&(s=o[1],i=o[2]);const a=i.replace(/^\(/,"").replace(/\)$/,""),l=a.replace(/\?.*$/,"");let c,u,h=l;const d=l.split(":");d.length>=3&&/^\d+$/.test(d[d.length-1]??"")?(u=d.pop(),c=d.pop(),h=d.join(":")):d.length>=2&&/^\d+$/.test(d[d.length-1]??"")&&(c=d.pop(),h=d.join(":"));let f=h.replace(/^file:\/\//,"");const p=function(){void 0===n&&(n=function(){try{const e=globalThis?.process;if("function"==typeof e?.cwd)return e.cwd()}catch{}try{const e=globalThis?.Deno;if("function"==typeof e?.cwd)return e.cwd()}catch{}}()??null);return n??void 0}();null!=p&&f.startsWith(p)&&(f=f.slice(p.length),f=f.replace(/^[\\/]/,""));0===f.length&&(f=h);const m=function(e){if("string"!=typeof e||0===e.length)return e;const t=e.replace(/\\+/g,"\\").replace(/\\/g,"/"),r=t.startsWith("//"),s=t.startsWith("/")&&!r,n=t.match(/^[A-Za-z]:/),i=n?n[0]:"",o=(i?t.slice(i.length):t).split("/"),a=[];for(const c of o)""!==c&&"."!==c&&(".."!==c?a.push(c):a.length>0&&a.pop());let l=a.join("/");r?l=`//${l}`:s?l=`/${l}`:""!==i&&(l=`${i}${l.length>0?`/${l}`:""}`);if(0===l.length)return e;return l}(f),g=m.length>0?m:f,y=g.split(/\\|\//),v=y[y.length-1];return{fullFilePath:a,fileName:v,fileNameWithLine:v&&c?`${v}:${c}`:void 0,fileColumn:u,fileLine:c,filePath:g,filePathWithLine:g&&c?`${g}:${c}`:void 0,method:s}}(e)}function a(e,t){return e.map(e=>aa(t,t.prettyErrorStackTemplate,{...e},!0))}function l(e){return Object.getOwnPropertyNames(e).filter(e=>"stack"!==e&&"cause"!==e).reduce((t,r)=>{const s=e[r];return"function"==typeof s||t.push(String(s)),t},[]).join(", ")}function c(e,t){if(null==e)return[];if("string"==typeof e)return[e];if(Array.isArray(e))return e.flatMap(e=>c(e,t));if("object"==typeof e){const r=e[t.trim()]??e["*"];return null==r?[]:c(r,t)}return[]}function u(e){const t=/* @__PURE__ */new Set,r=[];for(const s of e){const e=h(s);null!=e&&e.length>0&&!t.has(e)&&(t.add(e),r.push(e))}return r.join("; ")}function h(e){const t=Ma[e];if(null!=t)return`color: ${t}`;const r=Da[e];if(null!=r)return`background-color: ${r}`;switch(e){case"bold":return"font-weight: bold";case"dim":return"opacity: 0.75";case"italic":return"font-style: italic";case"underline":return"text-decoration: underline";case"overline":return"text-decoration: overline";case"inverse":return"filter: invert(1)";case"hidden":return"visibility: hidden";case"strikethrough":return"text-decoration: line-through";default:return}}function d(e,t){try{return function(e,...t){const r={seen:[],stylize:va};null!=e&&Pa(r,e);const s=t[0];let n=0,i="",o="";if("string"==typeof s){if(1===t.length)return s;let a,l=0;for(let o=0;o<s.length-1;o++)if(37===s.charCodeAt(o)){const c=s.charCodeAt(++o);if(n+1!==t.length){switch(c){case 115:{const s=t[++n];a="number"==typeof s||"bigint"==typeof s?Na(r,s):"object"!=typeof s||null===s?String(s):ga(s,{...e,compact:3,colors:!1,depth:0});break}case 106:a=ma(t[++n]);break;case 100:{const e=t[++n];a="bigint"==typeof e?Na(r,e):"symbol"==typeof e?"NaN":Na(r,e);break}case 79:a=ga(t[++n],e);break;case 111:a=ga(t[++n],{...e,showHidden:!0,showProxy:!0,depth:4});break;case 105:{const e=t[++n];a="bigint"==typeof e?Na(r,e):"symbol"==typeof e?"NaN":Na(r,parseInt(a));break}case 102:{const e=t[++n];a="symbol"==typeof e?"NaN":Na(r,parseInt(e));break}case 99:n+=1,a="";break;case 37:i+=s.slice(l,o),l=o+1;continue;default:continue}l!==o-1&&(i+=s.slice(l,o-1)),i+=a,l=o+1}else 37===c&&(i+=s.slice(l,o),l=o+1)}0!==l&&(n++,o=" ",l<s.length&&(i+=s.slice(l)))}for(;n<t.length;){const r=t[n];i+=o,i+="string"!=typeof r?ga(r,e):r,o=" ",n++}return i}(e,...t)}catch{return t.map(f).join(" ")}}function f(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch{return String(e)}}function p(e,t,r,s){const n=e?.env?.HOSTNAME??e?.env?.HOST??e?.env?.COMPUTERNAME;if(null!=n&&n.length>0)return n;const i=r?.env?.HOSTNAME??r?.env?.HOST??r?.env?.COMPUTERNAME;if(null!=i&&i.length>0)return i;try{const e=t?.env?.get;if("function"==typeof e){const t=e("HOSTNAME");if(null!=t&&t.length>0)return t}}catch{}return null!=s?.hostname&&s.hostname.length>0?s.hostname:void 0}}();class Ha{constructor(e,t,r=Number.NaN){this.logObj=t,this.stackDepthLevel=r,this.runtime=Ia,this.maxErrorCauseDepth=5,this.settings={type:e?.type??"pretty",name:e?.name,parentNames:e?.parentNames,minLevel:e?.minLevel??0,argumentsArrayName:e?.argumentsArrayName,hideLogPositionForProduction:e?.hideLogPositionForProduction??!1,prettyLogTemplate:e?.prettyLogTemplate??"{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}\t{{logLevelName}}\t{{filePathWithLine}}{{nameWithDelimiterPrefix}}\t",prettyErrorTemplate:e?.prettyErrorTemplate??"\n{{errorName}} {{errorMessage}}\nerror stack:\n{{errorStack}}",prettyErrorStackTemplate:e?.prettyErrorStackTemplate??" • {{fileName}}\t{{method}}\n\t{{filePathWithLine}}",prettyErrorParentNamesSeparator:e?.prettyErrorParentNamesSeparator??":",prettyErrorLoggerNameDelimiter:e?.prettyErrorLoggerNameDelimiter??"\t",stylePrettyLogs:e?.stylePrettyLogs??!0,prettyLogTimeZone:e?.prettyLogTimeZone??"UTC",prettyLogStyles:e?.prettyLogStyles??{logLevelName:{"*":["bold","black","bgWhiteBright","dim"],SILLY:["bold","white"],TRACE:["bold","whiteBright"],DEBUG:["bold","green"],INFO:["bold","blue"],WARN:["bold","yellow"],ERROR:["bold","red"],FATAL:["bold","redBright"]},dateIsoStr:"white",filePathWithLine:"white",name:["white","bold"],nameWithDelimiterPrefix:["white","bold"],nameWithDelimiterSuffix:["white","bold"],errorName:["bold","bgRedBright","whiteBright"],fileName:["yellow"],fileNameWithLine:"white"},prettyInspectOptions:e?.prettyInspectOptions??{colors:!0,compact:!1,depth:1/0},metaProperty:e?.metaProperty??"_meta",maskPlaceholder:e?.maskPlaceholder??"[***]",maskValuesOfKeys:e?.maskValuesOfKeys??["password"],maskValuesOfKeysCaseInsensitive:e?.maskValuesOfKeysCaseInsensitive??!1,maskValuesRegEx:e?.maskValuesRegEx,prefix:[...e?.prefix??[]],attachedTransports:[...e?.attachedTransports??[]],overwrite:{mask:e?.overwrite?.mask,toLogObj:e?.overwrite?.toLogObj,addMeta:e?.overwrite?.addMeta,addPlaceholders:e?.overwrite?.addPlaceholders,formatMeta:e?.overwrite?.formatMeta,formatLogObj:e?.overwrite?.formatLogObj,transportFormatted:e?.overwrite?.transportFormatted,transportJSON:e?.overwrite?.transportJSON}},this.captureStackForMeta=this._shouldCaptureStack()}log(e,t,...r){if(e<this.settings.minLevel)return;const s=this._resolveLogArguments(r),n=[...this.settings.prefix,...s],i=null!=this.settings.overwrite?.mask?this.settings.overwrite?.mask(n):null!=this.settings.maskValuesOfKeys&&this.settings.maskValuesOfKeys.length>0?this._mask(n):n,o=null!=this.logObj?this._recursiveCloneAndExecuteFunctions(this.logObj):void 0,a=null!=this.settings.overwrite?.toLogObj?this.settings.overwrite?.toLogObj(i,o):this._toLogObj(i,o),l=null!=this.settings.overwrite?.addMeta?this.settings.overwrite?.addMeta(a,e,t):this._addMetaToLogObj(a,e,t),c=l?.[this.settings.metaProperty];let u,h;if(null!=this.settings.overwrite?.formatMeta&&(u=this.settings.overwrite?.formatMeta(l?.[this.settings.metaProperty])),null!=this.settings.overwrite?.formatLogObj&&(h=this.settings.overwrite?.formatLogObj(i,this.settings)),"pretty"===this.settings.type&&(u=u??this._prettyFormatLogObjMeta(l?.[this.settings.metaProperty]),h=h??Ia.prettyFormatLogObj(i,this.settings)),null!=u&&null!=h)if(null!=this.settings.overwrite?.transportFormatted){const e=this.settings.overwrite.transportFormatted,t=e.length;t<4?e(u,h.args,h.errors):4===t?e(u,h.args,h.errors,c):e(u,h.args,h.errors,c,this.settings)}else Ia.transportFormatted(u,h.args,h.errors,c,this.settings);else null!=this.settings.overwrite?.transportJSON?this.settings.overwrite.transportJSON(l):"hidden"!==this.settings.type&&Ia.transportJSON(l);return null!=this.settings.attachedTransports&&this.settings.attachedTransports.length>0&&this.settings.attachedTransports.forEach(e=>{e(l)}),l}attachTransport(e){this.settings.attachedTransports.push(e)}getSubLogger(e,t){const r={...this.settings,...e,parentNames:null!=this.settings?.parentNames&&null!=this.settings?.name?[...this.settings.parentNames,this.settings.name]:null!=this.settings?.name?[this.settings.name]:void 0,prefix:[...this.settings.prefix,...e?.prefix??[]]};return new this.constructor(r,t??this.logObj,this.stackDepthLevel)}_mask(e){const t=this._getMaskKeys();return e?.map(e=>this._recursiveCloneAndMaskValuesOfKeys(e,t))}_getMaskKeys(){const e=this.settings.maskValuesOfKeys??[],t=e.map(String).join("|");if(!0===this.settings.maskValuesOfKeysCaseInsensitive){if(this.maskKeysCache?.source===e&&!0===this.maskKeysCache.caseInsensitive&&this.maskKeysCache.signature===t)return this.maskKeysCache.normalized;const r=e.map(e=>"string"==typeof e?e.toLowerCase():String(e).toLowerCase());return this.maskKeysCache={source:e,caseInsensitive:!0,normalized:r,signature:t},r}return this.maskKeysCache={source:e,caseInsensitive:!1,normalized:e,signature:t},e}_resolveLogArguments(e){if(1===e.length&&"function"==typeof e[0]){const t=e[0];if(0===t.length){const e=t();return Array.isArray(e)?e:[e]}}return e}_recursiveCloneAndMaskValuesOfKeys(e,t,r=[]){if(r.includes(e))return{...e};if("object"==typeof e&&null!==e&&r.push(e),Ia.isError(e)||Ia.isBuffer(e))return e;if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(Array.isArray(e))return e.map(e=>this._recursiveCloneAndMaskValuesOfKeys(e,t,r));if(e instanceof Date)return new Date(e.getTime());if(e instanceof URL)return{href:(s=e).href,protocol:s.protocol,username:s.username,password:s.password,host:s.host,hostname:s.hostname,port:s.port,pathname:s.pathname,search:s.search,searchParams:[...s.searchParams].map(([e,t])=>({key:e,value:t})),hash:s.hash,origin:s.origin};if(null!==e&&"object"==typeof e){const s=Ia.isError(e)?this._cloneError(e):Object.create(Object.getPrototypeOf(e));return Object.getOwnPropertyNames(e).reduce((s,n)=>{const i=!0!==this.settings?.maskValuesOfKeysCaseInsensitive?n:"string"==typeof n?n.toLowerCase():String(n).toLowerCase();return s[n]=t.includes(i)?this.settings.maskPlaceholder:(()=>{try{return this._recursiveCloneAndMaskValuesOfKeys(e[n],t,r)}catch{return null}})(),s},s)}if("string"==typeof e){let t=e;for(const e of this.settings?.maskValuesRegEx||[])t=t.replace(e,this.settings?.maskPlaceholder||"");return t}return e;var s}_recursiveCloneAndExecuteFunctions(e,t=[]){return this.isObjectOrArray(e)&&t.includes(e)?this.shallowCopy(e):(this.isObjectOrArray(e)&&t.push(e),Array.isArray(e)?e.map(e=>this._recursiveCloneAndExecuteFunctions(e,t)):e instanceof Date?new Date(e.getTime()):this.isObject(e)?Object.getOwnPropertyNames(e).reduce((r,s)=>{const n=Object.getOwnPropertyDescriptor(e,s);if(n){Object.defineProperty(r,s,n);const i=e[s];r[s]="function"==typeof i?i():this._recursiveCloneAndExecuteFunctions(i,t)}return r},Object.create(Object.getPrototypeOf(e))):e)}isObjectOrArray(e){return"object"==typeof e&&null!==e}isObject(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}shallowCopy(e){return Array.isArray(e)?[...e]:{...e}}_toLogObj(e,t={}){return e=e?.map(e=>Ia.isError(e)?this._toErrorObject(e):e),t=null==this.settings.argumentsArrayName?1!==e.length||Array.isArray(e[0])||!0===Ia.isBuffer(e[0])||e[0]instanceof Date?{...t,...e}:"object"==typeof e[0]&&null!=e[0]?{...e[0],...t}:{0:e[0],...t}:{...t,[this.settings.argumentsArrayName]:e}}_cloneError(e){const t=new e.constructor;return Object.getOwnPropertyNames(e).forEach(r=>{t[r]=e[r]}),t}_toErrorObject(e,t=0,r=/* @__PURE__ */new Set){r.has(e)||r.add(e);const s={nativeError:e,name:e.name??"Error",message:e.message,stack:Ia.getErrorTrace(e)};if(t>=this.maxErrorCauseDepth)return s;const n=e.cause;if(null!=n){const e=pa(n);r.has(e)||(s.cause=this._toErrorObject(e,t+1,r))}return s}_addMetaToLogObj(e,t,r){return{...e,[this.settings.metaProperty]:Ia.getMeta(t,r,this.stackDepthLevel,!this.captureStackForMeta,this.settings.name,this.settings.parentNames)}}_shouldCaptureStack(){if(this.settings.hideLogPositionForProduction)return!1;if("json"===this.settings.type)return!0;const e=this.settings.prettyLogTemplate??"";return!!/{{\s*(file(Name|Path|Line|PathWithLine|NameWithLine)|fullFilePath)\s*}}/.test(e)}_prettyFormatLogObjMeta(e){return ca(this.settings,e).text}}class ja extends Ha{constructor(e,t){const r={...e??{}};"undefined"!=typeof window&&"undefined"!=typeof document&&(r.stylePrettyLogs=e?.stylePrettyLogs??!0),super(r,t,Number.NaN)}log(e,t,...r){return super.log(e,t,...r)}silly(...e){return super.log(0,"SILLY",...e)}trace(...e){return super.log(1,"TRACE",...e)}debug(...e){return super.log(2,"DEBUG",...e)}info(...e){return super.log(3,"INFO",...e)}warn(...e){return super.log(4,"WARN",...e)}error(...e){return super.log(5,"ERROR",...e)}fatal(...e){return super.log(6,"FATAL",...e)}getSubLogger(e,t){return super.getSubLogger(e,t)}}const Va=e=>{e.setService(o.action,new St),e.setService(o.setting,new bt),e.setService(o.icon,new bt),e.setService(o.routeResolver,new Wt);const t=new ja({name:"app-core",type:"pretty"});e.setService(o.logger,t);const r=[Ht,zt,pt,Bt,ut,Vt,Kt,tr,Xt,sr,ir,ar,cr,hr,fr,mr,vr,Er,br,Or,xr,_r,z,H,V,W,Z,dt];for(let s=0;s<r.length;s++)e.setService(r[s].identifier,r[s].constructFromServiceResolver(e));return na(e),Promise.resolve()};function Ua(e,r){e.addEventListener(t.GetServiceResolver,e=>{e.setServiceResolver(r),e.stopPropagation()})}const Wa=()=>Promise.resolve(),Ba=/* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,Definition:$t,Enum:a,Partial:c},Symbol.toStringTag,{value:"Module"}));export{d as BrowserEvent,f as BrowserEventListener,q as Cache,Jt as Component,Fr as Endpoint,O as Error,Mt as Event,ia as EventListener,Zt as Service,Ba as Type,Va as init,Ua as initEventListeners,Wa as optimizeDynamicConfigurations};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|