diff --git a/docs/index.html b/docs/index.html index ae13411..11a4226 100755 --- a/docs/index.html +++ b/docs/index.html @@ -39,5 +39,5 @@ - + diff --git a/docs/main.4e9d34b93942ca88.js b/docs/main.d376e674c23bb6ef.js similarity index 58% rename from docs/main.4e9d34b93942ca88.js rename to docs/main.d376e674c23bb6ef.js index 4ce8b68..73954a2 100755 --- a/docs/main.4e9d34b93942ca88.js +++ b/docs/main.d376e674c23bb6ef.js @@ -1 +1 @@ -"use strict";(self.webpackChunkomeglestr=self.webpackChunkomeglestr||[]).push([[792],{433:(cm,RC,Gc)=>{var Wc={};Gc.r(Wc),Gc.d(Wc,{OG:()=>Pw,My:()=>yc,Ph:()=>Nn,lX:()=>Ow,Id:()=>Ao,fg:()=>Gk,qj:()=>un,aT:()=>vc,lq:()=>Ts,z:()=>kw,Q5:()=>qu});var lm={};function OC(e,t){return Object.is(e,t)}Gc.r(lm),Gc.d(lm,{aK:()=>jo,e8:()=>Rc,DO:()=>nd,dJ:()=>dL,OG:()=>hE,My:()=>Oc,Ph:()=>Uo,lX:()=>uE,Id:()=>rd,fg:()=>hL,qj:()=>kr,aT:()=>Pc,r4:()=>Dg,aY:()=>Vo,x:()=>gE,lq:()=>Lc,z:()=>dE,zW:()=>kc,Q5:()=>id});let Nt=null,Zc=!1,Md=1;const gr=Symbol("SIGNAL");function _e(e){const t=Nt;return Nt=e,t}const Nd={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function um(e){if(Zc)throw new Error("");if(null===Nt)return;Nt.consumerOnSignalRead(e);const t=Nt.nextProducerIndex++;kd(Nt),te.nextProducerIndex;)e.producerNode.pop(),e.producerLastReadVersion.pop(),e.producerIndexOfThis.pop()}}function fm(e){kd(e);for(let t=0;t0}function kd(e){e.producerNode??=[],e.producerIndexOfThis??=[],e.producerLastReadVersion??=[]}function UC(e){e.liveConsumerNode??=[],e.liveConsumerIndexOfThis??=[]}function jC(e){return void 0!==e.producerNode}const pm=Symbol("UNSET"),gm=Symbol("COMPUTING"),Pd=Symbol("ERRORED"),m3={...Nd,value:pm,dirty:!0,error:null,equal:OC,producerMustRecompute:e=>e.value===pm||e.value===gm,producerRecomputeValue(e){if(e.value===gm)throw new Error("Detected cycle in computations.");const t=e.value;e.value=gm;const r=Rd(e);let i;try{i=e.computation()}catch(s){i=Pd,e.error=s}finally{dm(e,r)}t!==pm&&t!==Pd&&i!==Pd&&e.equal(t,i)?e.value=t:(e.value=i,e.version++)}};let $C=function y3(){throw new Error};function HC(){$C()}let Ld=null;function zC(e,t){FC()||HC(),e.equal(e.value,t)||(e.value=t,function E3(e){e.version++,function p3(){Md++}(),LC(e),Ld?.()}(e))}const b3={...Nd,equal:OC,value:void 0};function at(e){return"function"==typeof e}function Fd(e){const r=e(i=>{Error.call(i),i.stack=(new Error).stack});return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}const mm=Fd(e=>function(r){e(this),this.message=r?`${r.length} errors occurred during unsubscription:\n${r.map((i,s)=>`${s+1}) ${i.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=r});function Bd(e,t){if(e){const r=e.indexOf(t);0<=r&&e.splice(r,1)}}class vt{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;const{_parentage:r}=this;if(r)if(this._parentage=null,Array.isArray(r))for(const o of r)o.remove(this);else r.remove(this);const{initialTeardown:i}=this;if(at(i))try{i()}catch(o){t=o instanceof mm?o.errors:[o]}const{_finalizers:s}=this;if(s){this._finalizers=null;for(const o of s)try{ZC(o)}catch(a){t=t??[],a instanceof mm?t=[...t,...a.errors]:t.push(a)}}if(t)throw new mm(t)}}add(t){var r;if(t&&t!==this)if(this.closed)ZC(t);else{if(t instanceof vt){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}}_hasParent(t){const{_parentage:r}=this;return r===t||Array.isArray(r)&&r.includes(t)}_addParent(t){const{_parentage:r}=this;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t}_removeParent(t){const{_parentage:r}=this;r===t?this._parentage=null:Array.isArray(r)&&Bd(r,t)}remove(t){const{_finalizers:r}=this;r&&Bd(r,t),t instanceof vt&&t._removeParent(this)}}vt.EMPTY=(()=>{const e=new vt;return e.closed=!0,e})();const GC=vt.EMPTY;function WC(e){return e instanceof vt||e&&"closed"in e&&at(e.remove)&&at(e.add)&&at(e.unsubscribe)}function ZC(e){at(e)?e():e.unsubscribe()}const Gs={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Vd={setTimeout(e,t,...r){const{delegate:i}=Vd;return i?.setTimeout?i.setTimeout(e,t,...r):setTimeout(e,t,...r)},clearTimeout(e){const{delegate:t}=Vd;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function KC(e){Vd.setTimeout(()=>{const{onUnhandledError:t}=Gs;if(!t)throw e;t(e)})}function ym(){}const D3=vm("C",void 0,void 0);function vm(e,t,r){return{kind:e,value:t,error:r}}let Ws=null;function Ud(e){if(Gs.useDeprecatedSynchronousErrorHandling){const t=!Ws;if(t&&(Ws={errorThrown:!1,error:null}),e(),t){const{errorThrown:r,error:i}=Ws;if(Ws=null,r)throw i}}else e()}class _m extends vt{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,WC(t)&&t.add(this)):this.destination=N3}static create(t,r,i){return new bm(t,r,i)}next(t){this.isStopped?Em(function T3(e){return vm("N",e,void 0)}(t),this):this._next(t)}error(t){this.isStopped?Em(function S3(e){return vm("E",void 0,e)}(t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?Em(D3,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const x3=Function.prototype.bind;function wm(e,t){return x3.call(e,t)}class A3{constructor(t){this.partialObserver=t}next(t){const{partialObserver:r}=this;if(r.next)try{r.next(t)}catch(i){jd(i)}}error(t){const{partialObserver:r}=this;if(r.error)try{r.error(t)}catch(i){jd(i)}else jd(t)}complete(){const{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(r){jd(r)}}}class bm extends _m{constructor(t,r,i){let s;if(super(),at(t)||!t)s={next:t??void 0,error:r??void 0,complete:i??void 0};else{let o;this&&Gs.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=()=>this.unsubscribe(),s={next:t.next&&wm(t.next,o),error:t.error&&wm(t.error,o),complete:t.complete&&wm(t.complete,o)}):s=t}this.destination=new A3(s)}}function jd(e){Gs.useDeprecatedSynchronousErrorHandling?function I3(e){Gs.useDeprecatedSynchronousErrorHandling&&Ws&&(Ws.errorThrown=!0,Ws.error=e)}(e):KC(e)}function Em(e,t){const{onStoppedNotification:r}=Gs;r&&Vd.setTimeout(()=>r(e,t))}const N3={closed:!0,next:ym,error:function M3(e){throw e},complete:ym},Cm="function"==typeof Symbol&&Symbol.observable||"@@observable";function Zs(e){return e}function QC(e){return 0===e.length?Zs:1===e.length?e[0]:function(r){return e.reduce((i,s)=>s(i),r)}}let Ht=(()=>{class e{constructor(r){r&&(this._subscribe=r)}lift(r){const i=new e;return i.source=this,i.operator=r,i}subscribe(r,i,s){const o=function k3(e){return e&&e instanceof _m||function O3(e){return e&&at(e.next)&&at(e.error)&&at(e.complete)}(e)&&WC(e)}(r)?r:new bm(r,i,s);return Ud(()=>{const{operator:a,source:c}=this;o.add(a?a.call(o,c):c?this._subscribe(o):this._trySubscribe(o))}),o}_trySubscribe(r){try{return this._subscribe(r)}catch(i){r.error(i)}}forEach(r,i){return new(i=YC(i))((s,o)=>{const a=new bm({next:c=>{try{r(c)}catch(l){o(l),a.unsubscribe()}},error:o,complete:s});this.subscribe(a)})}_subscribe(r){var i;return null===(i=this.source)||void 0===i?void 0:i.subscribe(r)}[Cm](){return this}pipe(...r){return QC(r)(this)}toPromise(r){return new(r=YC(r))((i,s)=>{let o;this.subscribe(a=>o=a,a=>s(a),()=>i(o))})}}return e.create=t=>new e(t),e})();function YC(e){var t;return null!==(t=e??Gs.Promise)&&void 0!==t?t:Promise}const P3=Fd(e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});let Ze=(()=>{class e extends Ht{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(r){const i=new JC(this,this);return i.operator=r,i}_throwIfClosed(){if(this.closed)throw new P3}next(r){Ud(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const i of this.currentObservers)i.next(r)}})}error(r){Ud(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=r;const{observers:i}=this;for(;i.length;)i.shift().error(r)}})}complete(){Ud(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:r}=this;for(;r.length;)r.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var r;return(null===(r=this.observers)||void 0===r?void 0:r.length)>0}_trySubscribe(r){return this._throwIfClosed(),super._trySubscribe(r)}_subscribe(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)}_innerSubscribe(r){const{hasError:i,isStopped:s,observers:o}=this;return i||s?GC:(this.currentObservers=null,o.push(r),new vt(()=>{this.currentObservers=null,Bd(o,r)}))}_checkFinalizedStatuses(r){const{hasError:i,thrownError:s,isStopped:o}=this;i?r.error(s):o&&r.complete()}asObservable(){const r=new Ht;return r.source=this,r}}return e.create=(t,r)=>new JC(t,r),e})();class JC extends Ze{constructor(t,r){super(),this.destination=t,this.source=r}next(t){var r,i;null===(i=null===(r=this.destination)||void 0===r?void 0:r.next)||void 0===i||i.call(r,t)}error(t){var r,i;null===(i=null===(r=this.destination)||void 0===r?void 0:r.error)||void 0===i||i.call(r,t)}complete(){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===r||r.call(t)}_subscribe(t){var r,i;return null!==(i=null===(r=this.source)||void 0===r?void 0:r.subscribe(t))&&void 0!==i?i:GC}}class Jn extends Ze{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){const r=super._subscribe(t);return!r.closed&&t.next(this._value),r}getValue(){const{hasError:t,thrownError:r,_value:i}=this;if(t)throw r;return this._throwIfClosed(),i}next(t){super.next(this._value=t)}}function XC(e){return at(e?.lift)}function zt(e){return t=>{if(XC(t))return t.lift(function(r){try{return e(r,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function Dt(e,t,r,i,s){return new L3(e,t,r,i,s)}class L3 extends _m{constructor(t,r,i,s,o,a){super(t),this.onFinalize=o,this.shouldUnsubscribe=a,this._next=r?function(c){try{r(c)}catch(l){t.error(l)}}:super._next,this._error=s?function(c){try{s(c)}catch(l){t.error(l)}finally{this.unsubscribe()}}:super._error,this._complete=i?function(){try{i()}catch(c){t.error(c)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:r}=this;super.unsubscribe(),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}}}function Ue(e,t){return zt((r,i)=>{let s=0;r.subscribe(Dt(i,o=>{i.next(e.call(t,o,s++))}))})}const eD="https://g.co/ng/security#xss";class A extends Error{constructor(t,r){super(function Qo(e,t){return`NG0${Math.abs(e)}${t?": "+t:""}`}(t,r)),this.code=t}}function bi(e){return{toString:e}.toString()}const Jo="__parameters__";function ea(e,t,r){return bi(()=>{const i=function Dm(e){return function(...r){if(e){const i=e(...r);for(const s in i)this[s]=i[s]}}}(t);function s(...o){if(this instanceof s)return i.apply(this,o),this;const a=new s(...o);return c.annotation=a,c;function c(l,u,d){const f=l.hasOwnProperty(Jo)?l[Jo]:Object.defineProperty(l,Jo,{value:[]})[Jo];for(;f.length<=d;)f.push(null);return(f[d]=f[d]||[]).push(a),l}}return r&&(s.prototype=Object.create(r.prototype)),s.prototype.ngMetadataName=e,s.annotationCls=s,s})}const ct=globalThis;function He(e){for(let t in e)if(e[t]===He)return t;throw Error("Could not find renamed property on target object.")}function F3(e,t){for(const r in t)t.hasOwnProperty(r)&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Rt(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(Rt).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return`${e.overriddenName}`;if(e.name)return`${e.name}`;const t=e.toString();if(null==t)return""+t;const r=t.indexOf("\n");return-1===r?t:t.substring(0,r)}function Sm(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}const B3=He({__forward_ref__:He});function et(e){return e.__forward_ref__=et,e.toString=function(){return Rt(this())},e}function ie(e){return Hd(e)?e():e}function Hd(e){return"function"==typeof e&&e.hasOwnProperty(B3)&&e.__forward_ref__===et}function j(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function St(e){return{providers:e.providers||[],imports:e.imports||[]}}function zd(e){return iD(e,Gd)||iD(e,sD)}function iD(e,t){return e.hasOwnProperty(t)?e[t]:null}function qd(e){return e&&(e.hasOwnProperty(Tm)||e.hasOwnProperty(z3))?e[Tm]:null}const Gd=He({\u0275prov:He}),Tm=He({\u0275inj:He}),sD=He({ngInjectableDef:He}),z3=He({ngInjectorDef:He});class z{constructor(t,r){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof r?this.__NG_ELEMENT_ID__=r:void 0!==r&&(this.\u0275prov=j({token:this,providedIn:r.providedIn||"root",factory:r.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}function Nm(e){return e&&!!e.\u0275providers}const Qc=He({\u0275cmp:He}),Rm=He({\u0275dir:He}),Om=He({\u0275pipe:He}),aD=He({\u0275mod:He}),Ei=He({\u0275fac:He}),Yc=He({__NG_ELEMENT_ID__:He}),cD=He({__NG_ENV_ID__:He});function pe(e){return"string"==typeof e?e:null==e?"":String(e)}function km(e,t){throw new A(-201,!1)}var Te=function(e){return e[e.Default=0]="Default",e[e.Host=1]="Host",e[e.Self=2]="Self",e[e.SkipSelf=4]="SkipSelf",e[e.Optional=8]="Optional",e}(Te||{});let Pm;function lD(){return Pm}function Sn(e){const t=Pm;return Pm=e,t}function uD(e,t,r){const i=zd(e);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:r&Te.Optional?null:void 0!==t?t:void km()}const Jc={},Lm="__NG_DI_FLAG__",Wd="ngTempTokenPath",Q3=/\n/gm,dD="__source";let ta;function es(e){const t=ta;return ta=e,t}function X3(e,t=Te.Default){if(void 0===ta)throw new A(-203,!1);return null===ta?uD(e,void 0,t):ta.get(e,t&Te.Optional?null:void 0,t)}function q(e,t=Te.Default){return(lD()||X3)(ie(e),t)}function O(e,t=Te.Default){return q(e,Zd(t))}function Zd(e){return typeof e>"u"||"number"==typeof e?e:(e.optional&&8)|(e.host&&1)|(e.self&&2)|(e.skipSelf&&4)}function Fm(e){const t=[];for(let r=0;rArray.isArray(r)?na(r,t):t(r))}function hD(e,t,r){t>=e.length?e.push(r):e.splice(t,0,r)}function Yd(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}function Bn(e,t,r){let i=ra(e,t);return i>=0?e[1|i]=r:(i=~i,function pD(e,t,r,i){let s=e.length;if(s==t)e.push(r,i);else if(1===s)e.push(i,e[0]),e[0]=r;else{for(s--,e.push(e[s-1],e[s]);s>t;)e[s]=e[s-2],s--;e[t]=r,e[t+1]=i}}(e,i,t,r)),i}function Vm(e,t){const r=ra(e,t);if(r>=0)return e[1|r]}function ra(e,t){return function gD(e,t,r){let i=0,s=e.length>>r;for(;s!==i;){const o=i+(s-i>>1),a=e[o<t?s=o:i=o+1}return~(s<t){a=o-1;break}}}for(;o-1){let o;for(;++so?"":s[d+1].toLowerCase(),2&i&&u!==f){if(yr(i))return!1;a=!0}}}}else{if(!a&&!yr(i)&&!yr(l))return!1;if(a&&yr(l))continue;a=!1,i=l|1&i}}return yr(i)||a}function yr(e){return!(1&e)}function dB(e,t,r,i){if(null===t)return-1;let s=0;if(i||!r){let o=!1;for(;s-1)for(r++;r0?'="'+c+'"':"")+"]"}else 8&i?s+="."+a:4&i&&(s+=" "+a);else""!==s&&!yr(a)&&(t+=ED(o,s),s=""),i=a,o=o||!yr(i);r++}return""!==s&&(t+=ED(o,s)),t}function ns(e){return bi(()=>{const t=DD(e),r={...t,decls:e.decls,vars:e.vars,template:e.template,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,onPush:e.changeDetection===ef.OnPush,directiveDefs:null,pipeDefs:null,dependencies:t.standalone&&e.dependencies||null,getStandaloneInjector:null,signals:e.signals??!1,data:e.data||{},encapsulation:e.encapsulation||mr.Emulated,styles:e.styles||ke,_:null,schemas:e.schemas||null,tView:null,id:""};SD(r);const i=e.dependencies;return r.directiveDefs=tf(i,!1),r.pipeDefs=tf(i,!0),r.id=function EB(e){let t=0;const r=[e.selectors,e.ngContentSelectors,e.hostVars,e.hostAttrs,e.consts,e.vars,e.decls,e.encapsulation,e.standalone,e.signals,e.exportAs,JSON.stringify(e.inputs),JSON.stringify(e.outputs),Object.getOwnPropertyNames(e.type.prototype),!!e.contentQueries,!!e.viewQuery].join("|");for(const s of r)t=Math.imul(31,t)+s.charCodeAt(0)|0;return t+=2147483648,"c"+t}(r),r})}function _B(e){return De(e)||kt(e)}function wB(e){return null!==e}function Ot(e){return bi(()=>({type:e.type,bootstrap:e.bootstrap||ke,declarations:e.declarations||ke,imports:e.imports||ke,exports:e.exports||ke,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null}))}function CD(e,t){if(null==e)return Vr;const r={};for(const i in e)if(e.hasOwnProperty(i)){const s=e[i];let o,a,c=ts.None;Array.isArray(s)?(c=s[0],o=s[1],a=s[2]??o):(o=s,a=s),t?(r[o]=c!==ts.None?[i,c]:i,t[o]=a):r[o]=i}return r}function de(e){return bi(()=>{const t=DD(e);return SD(t),t})}function fn(e){return{type:e.type,name:e.name,factory:null,pure:!1!==e.pure,standalone:!0===e.standalone,onDestroy:e.type.prototype.ngOnDestroy||null}}function De(e){return e[Qc]||null}function kt(e){return e[Rm]||null}function Wt(e){return e[Om]||null}function nn(e,t){const r=e[aD]||null;if(!r&&!0===t)throw new Error(`Type ${Rt(e)} does not have '\u0275mod' property.`);return r}function DD(e){const t={};return{type:e.type,providersResolver:null,factory:null,hostBindings:e.hostBindings||null,hostVars:e.hostVars||0,hostAttrs:e.hostAttrs||null,contentQueries:e.contentQueries||null,declaredInputs:t,inputTransforms:null,inputConfig:e.inputs||Vr,exportAs:e.exportAs||null,standalone:!0===e.standalone,signals:!0===e.signals,selectors:e.selectors||ke,viewQuery:e.viewQuery||null,features:e.features||null,setInput:null,findHostDirectiveDefs:null,hostDirectives:null,inputs:CD(e.inputs,t),outputs:CD(e.outputs),debugInfo:null}}function SD(e){e.features?.forEach(t=>t(e))}function tf(e,t){if(!e)return null;const r=t?Wt:_B;return()=>("function"==typeof e?e():e).map(i=>r(i)).filter(wB)}function CB(...e){return{\u0275providers:Hm(0,e),\u0275fromNgModule:!0}}function Hm(e,...t){const r=[],i=new Set;let s;const o=a=>{r.push(a)};return na(t,a=>{const c=a;nf(c,o,[],i)&&(s||=[],s.push(c))}),void 0!==s&&TD(s,o),r}function TD(e,t){for(let r=0;r{t(o,i)})}}function nf(e,t,r,i){if(!(e=ie(e)))return!1;let s=null,o=qd(e);const a=!o&&De(e);if(o||a){if(a&&!a.standalone)return!1;s=e}else{const l=e.ngModule;if(o=qd(l),!o)return!1;s=l}const c=i.has(s);if(a){if(c)return!1;if(i.add(s),a.dependencies){const l="function"==typeof a.dependencies?a.dependencies():a.dependencies;for(const u of l)nf(u,t,r,i)}}else{if(!o)return!1;{if(null!=o.imports&&!c){let u;i.add(s);try{na(o.imports,d=>{nf(d,t,r,i)&&(u||=[],u.push(d))})}finally{}void 0!==u&&TD(u,t)}if(!c){const u=Ks(s)||(()=>new s);t({provide:s,useFactory:u,deps:ke},s),t({provide:Um,useValue:s,multi:!0},s),t({provide:Ur,useValue:()=>q(s),multi:!0},s)}const l=o.providers;if(null!=l&&!c){const u=e;zm(l,d=>{t(d,u)})}}}return s!==e&&void 0!==e.providers}function zm(e,t){for(let r of e)Nm(r)&&(r=r.\u0275providers),Array.isArray(r)?zm(r,t):t(r)}const DB=He({provide:String,useValue:He});function qm(e){return null!==e&&"object"==typeof e&&DB in e}function Qs(e){return"function"==typeof e}const Gm=new z(""),rf={},TB={};let Wm;function sf(){return void 0===Wm&&(Wm=new Xd),Wm}class In{}class ia extends In{get destroyed(){return this._destroyed}constructor(t,r,i,s){super(),this.parent=r,this.source=i,this.scopes=s,this.records=new Map,this._ngOnDestroyHooks=new Set,this._onDestroyHooks=[],this._destroyed=!1,Km(t,a=>this.processProvider(a)),this.records.set(mD,sa(void 0,this)),s.has("environment")&&this.records.set(In,sa(void 0,this));const o=this.records.get(Gm);null!=o&&"string"==typeof o.value&&this.scopes.add(o.value),this.injectorDefTypes=new Set(this.get(Um,ke,Te.Self))}destroy(){this.assertNotDestroyed(),this._destroyed=!0;const t=_e(null);try{for(const i of this._ngOnDestroyHooks)i.ngOnDestroy();const r=this._onDestroyHooks;this._onDestroyHooks=[];for(const i of r)i()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),_e(t)}}onDestroy(t){return this.assertNotDestroyed(),this._onDestroyHooks.push(t),()=>this.removeOnDestroy(t)}runInContext(t){this.assertNotDestroyed();const r=es(this),i=Sn(void 0);try{return t()}finally{es(r),Sn(i)}}get(t,r=Jc,i=Te.Default){if(this.assertNotDestroyed(),t.hasOwnProperty(cD))return t[cD](this);i=Zd(i);const o=es(this),a=Sn(void 0);try{if(!(i&Te.SkipSelf)){let l=this.records.get(t);if(void 0===l){const u=function NB(e){return"function"==typeof e||"object"==typeof e&&e instanceof z}(t)&&zd(t);l=u&&this.injectableDefInScope(u)?sa(Zm(t),rf):null,this.records.set(t,l)}if(null!=l)return this.hydrate(t,l)}return(i&Te.Self?sf():this.parent).get(t,r=i&Te.Optional&&r===Jc?null:r)}catch(c){if("NullInjectorError"===c.name){if((c[Wd]=c[Wd]||[]).unshift(Rt(t)),o)throw c;return function tB(e,t,r,i){const s=e[Wd];throw t[dD]&&s.unshift(t[dD]),e.message=function nB(e,t,r,i=null){e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.slice(2):e;let s=Rt(t);if(Array.isArray(t))s=t.map(Rt).join(" -> ");else if("object"==typeof t){let o=[];for(let a in t)if(t.hasOwnProperty(a)){let c=t[a];o.push(a+":"+("string"==typeof c?JSON.stringify(c):Rt(c)))}s=`{${o.join(", ")}}`}return`${r}${i?"("+i+")":""}[${s}]: ${e.replace(Q3,"\n ")}`}("\n"+e.message,s,r,i),e.ngTokenPath=s,e[Wd]=null,e}(c,t,"R3InjectorError",this.source)}throw c}finally{Sn(a),es(o)}}resolveInjectorInitializers(){const t=_e(null),r=es(this),i=Sn(void 0);try{const o=this.get(Ur,ke,Te.Self);for(const a of o)a()}finally{es(r),Sn(i),_e(t)}}toString(){const t=[],r=this.records;for(const i of r.keys())t.push(Rt(i));return`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new A(205,!1)}processProvider(t){let r=Qs(t=ie(t))?t:ie(t&&t.provide);const i=function xB(e){return qm(e)?sa(void 0,e.useValue):sa(AD(e),rf)}(t);if(!Qs(t)&&!0===t.multi){let s=this.records.get(r);s||(s=sa(void 0,rf,!0),s.factory=()=>Fm(s.multi),this.records.set(r,s)),r=t,s.multi.push(t)}this.records.set(r,i)}hydrate(t,r){const i=_e(null);try{return r.value===rf&&(r.value=TB,r.value=r.factory()),"object"==typeof r.value&&r.value&&function MB(e){return null!==e&&"object"==typeof e&&"function"==typeof e.ngOnDestroy}(r.value)&&this._ngOnDestroyHooks.add(r.value),r.value}finally{_e(i)}}injectableDefInScope(t){if(!t.providedIn)return!1;const r=ie(t.providedIn);return"string"==typeof r?"any"===r||this.scopes.has(r):this.injectorDefTypes.has(r)}removeOnDestroy(t){const r=this._onDestroyHooks.indexOf(t);-1!==r&&this._onDestroyHooks.splice(r,1)}}function Zm(e){const t=zd(e),r=null!==t?t.factory:Ks(e);if(null!==r)return r;if(e instanceof z)throw new A(204,!1);if(e instanceof Function)return function IB(e){if(e.length>0)throw new A(204,!1);const r=function H3(e){return e&&(e[Gd]||e[sD])||null}(e);return null!==r?()=>r.factory(e):()=>new e}(e);throw new A(204,!1)}function AD(e,t,r){let i;if(Qs(e)){const s=ie(e);return Ks(s)||Zm(s)}if(qm(e))i=()=>ie(e.useValue);else if(function xD(e){return!(!e||!e.useFactory)}(e))i=()=>e.useFactory(...Fm(e.deps||[]));else if(function ID(e){return!(!e||!e.useExisting)}(e))i=()=>q(ie(e.useExisting));else{const s=ie(e&&(e.useClass||e.provide));if(!function AB(e){return!!e.deps}(e))return Ks(s)||Zm(s);i=()=>new s(...Fm(e.deps))}return i}function sa(e,t,r=!1){return{factory:e,value:t,multi:r?[]:void 0}}function Km(e,t){for(const r of e)Array.isArray(r)?Km(r,t):r&&Nm(r)?Km(r.\u0275providers,t):t(r)}function Ci(e,t){e instanceof ia&&e.assertNotDestroyed();const i=es(e),s=Sn(void 0);try{return t()}finally{es(i),Sn(s)}}function MD(){return void 0!==lD()||null!=function J3(){return ta}()}const lt=0,F=1,ne=2,Tt=3,vr=4,Zt=5,hn=6,aa=7,tt=8,It=9,jr=10,se=11,rl=12,RD=13,ca=14,ut=15,Ys=16,la=17,Di=18,ua=19,OD=20,is=21,cf=22,Xn=23,Y=25,Jm=1,$r=7,da=9,_t=10;var uf=function(e){return e[e.None=0]="None",e[e.HasTransplantedViews=2]="HasTransplantedViews",e}(uf||{});function Lt(e){return Array.isArray(e)&&"object"==typeof e[Jm]}function rn(e){return Array.isArray(e)&&!0===e[Jm]}function Xm(e){return!!(4&e.flags)}function Js(e){return e.componentOffset>-1}function df(e){return!(1&~e.flags)}function _r(e){return!!e.template}function sl(e){return!!(512&e[ne])}class HB{constructor(t,r,i){this.previousValue=t,this.currentValue=r,this.firstChange=i}isFirstChange(){return this.firstChange}}function BD(e,t,r,i){null!==t?t.applyValueToInputSignal(t,i):e[r]=i}function er(){return VD}function VD(e){return e.type.prototype.ngOnChanges&&(e.setInput=qB),zB}function zB(){const e=jD(this),t=e?.current;if(t){const r=e.previous;if(r===Vr)e.previous=t;else for(let i in t)r[i]=t[i];e.current=null,this.ngOnChanges(t)}}function qB(e,t,r,i,s){const o=this.declaredInputs[i],a=jD(e)||function GB(e,t){return e[UD]=t}(e,{previous:Vr,current:null}),c=a.current||(a.current={}),l=a.previous,u=l[o];c[o]=new HB(u&&u.currentValue,r,l===Vr),BD(e,t,s,r)}er.ngInherit=!0;const UD="__ngSimpleChanges__";function jD(e){return e[UD]||null}const Hr=function(e,t,r){},$D="svg";function Pe(e){for(;Array.isArray(e);)e=e[lt];return e}function ol(e,t){return Pe(t[e])}function pn(e,t){return Pe(t[e.index])}function al(e,t){return e.data[t]}function Xs(e,t){return e[t]}function Vn(e,t){const r=t[e];return Lt(r)?r:r[lt]}function iy(e){return!(128&~e[ne])}function tr(e,t){return null==t?null:e[t]}function zD(e){e[la]=0}function qD(e){1024&e[ne]||(e[ne]|=1024,iy(e)&&hf(e))}function ff(e){return!!(9216&e[ne]||e[Xn]?.dirty)}function sy(e){e[jr].changeDetectionScheduler?.notify(8),64&e[ne]&&(e[ne]|=1024),ff(e)&&hf(e)}function hf(e){e[jr].changeDetectionScheduler?.notify(0);let t=Si(e);for(;null!==t&&!(8192&t[ne])&&(t[ne]|=8192,iy(t));)t=Si(t)}function pf(e,t){if(!(256&~e[ne]))throw new A(911,!1);null===e[is]&&(e[is]=[]),e[is].push(t)}function Si(e){const t=e[Tt];return rn(t)?t[Tt]:t}const oe={lFrame:iS(null),bindingsEnabled:!0,skipHydrationRootTNode:null};let WD=!1;function ZD(){return oe.bindingsEnabled}function N(){return oe.lFrame.lView}function we(){return oe.lFrame.tView}function Kt(e){return oe.lFrame.contextLView=e,e[tt]}function Qt(e){return oe.lFrame.contextLView=null,e}function ze(){let e=KD();for(;null!==e&&64===e.type;)e=e.parent;return e}function KD(){return oe.lFrame.currentTNode}function wr(e,t){const r=oe.lFrame;r.currentTNode=e,r.isParent=t}function cy(){return oe.lFrame.isParent}function ly(){oe.lFrame.isParent=!1}function JD(){return WD}function XD(e){WD=e}function br(){return oe.lFrame.bindingIndex++}function Ii(e){const t=oe.lFrame,r=t.bindingIndex;return t.bindingIndex=t.bindingIndex+e,r}function oV(e,t){const r=oe.lFrame;r.bindingIndex=r.bindingRootIndex=e,uy(t)}function uy(e){oe.lFrame.currentDirectiveIndex=e}function dy(e){const t=oe.lFrame.currentDirectiveIndex;return-1===t?null:e[t]}function fy(){return oe.lFrame.currentQueryIndex}function mf(e){oe.lFrame.currentQueryIndex=e}function cV(e){const t=e[F];return 2===t.type?t.declTNode:1===t.type?e[Zt]:null}function nS(e,t,r){if(r&Te.SkipSelf){let s=t,o=e;for(;!(s=s.parent,null!==s||r&Te.Host||(s=cV(o),null===s||(o=o[ca],10&s.type))););if(null===s)return!1;t=s,e=o}const i=oe.lFrame=rS();return i.currentTNode=t,i.lView=e,!0}function hy(e){const t=rS(),r=e[F];oe.lFrame=t,t.currentTNode=r.firstChild,t.lView=e,t.tView=r,t.contextLView=e,t.bindingIndex=r.bindingStartIndex,t.inI18n=!1}function rS(){const e=oe.lFrame,t=null===e?null:e.child;return null===t?iS(e):t}function iS(e){const t={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:e,child:null,inI18n:!1};return null!==e&&(e.child=t),t}function sS(){const e=oe.lFrame;return oe.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}const oS=sS;function py(){const e=sS();e.isParent=!0,e.tView=null,e.selectedIndex=-1,e.contextLView=null,e.elementDepthCount=0,e.currentDirectiveIndex=-1,e.currentNamespace=null,e.bindingRootIndex=-1,e.bindingIndex=-1,e.currentQueryIndex=0}function Yt(){return oe.lFrame.selectedIndex}function to(e){oe.lFrame.selectedIndex=e}function nt(){const e=oe.lFrame;return al(e.tView,e.selectedIndex)}function yf(){oe.lFrame.currentNamespace=$D}function vf(){!function dV(){oe.lFrame.currentNamespace=null}()}let cS=!0;function ll(){return cS}function zr(e){cS=e}function _f(e,t){for(let r=t.directiveStart,i=t.directiveEnd;r=i)break}else t[l]<0&&(e[la]+=65536),(c>14>16&&(3&e[ne])===t&&(e[ne]+=16384,uS(c,o)):uS(c,o)}const fa=-1;class ul{constructor(t,r,i){this.factory=t,this.resolving=!1,this.canSeeViewProviders=r,this.injectImpl=i}}const yy={};class no{constructor(t,r){this.injector=t,this.parentInjector=r}get(t,r,i){i=Zd(i);const s=this.injector.get(t,yy,i);return s!==yy||r===yy?s:this.parentInjector.get(t,r,i)}}function vy(e){return e!==fa}function dl(e){return 32767&e}function fl(e,t){let r=function vV(e){return e>>16}(e),i=t;for(;r>0;)i=i[ca],r--;return i}let _y=!0;function Ef(e){const t=_y;return _y=e,t}const fS=255,hS=5;let wV=0;const qr={};function Cf(e,t){const r=pS(e,t);if(-1!==r)return r;const i=t[F];i.firstCreatePass&&(e.injectorIndex=t.length,wy(i.data,e),wy(t,null),wy(i.blueprint,null));const s=Df(e,t),o=e.injectorIndex;if(vy(s)){const a=dl(s),c=fl(s,t),l=c[F].data;for(let u=0;u<8;u++)t[o+u]=c[a+u]|l[a+u]}return t[o+8]=s,o}function wy(e,t){e.push(0,0,0,0,0,0,0,0,t)}function pS(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:e.injectorIndex}function Df(e,t){if(e.parent&&-1!==e.parent.injectorIndex)return e.parent.injectorIndex;let r=0,i=null,s=t;for(;null!==s;){if(i=bS(s),null===i)return fa;if(r++,s=s[ca],-1!==i.injectorIndex)return i.injectorIndex|r<<16}return fa}function by(e,t,r){!function bV(e,t,r){let i;"string"==typeof r?i=r.charCodeAt(0)||0:r.hasOwnProperty(Yc)&&(i=r[Yc]),null==i&&(i=r[Yc]=wV++);const s=i&fS;t.data[e+(s>>hS)]|=1<=0?t&fS:SV:t}(r);if("function"==typeof o){if(!nS(t,e,i))return i&Te.Host?gS(s,0,i):mS(t,r,i,s);try{let a;if(a=o(i),null!=a||i&Te.Optional)return a;km()}finally{oS()}}else if("number"==typeof o){let a=null,c=pS(e,t),l=fa,u=i&Te.Host?t[ut][Zt]:null;for((-1===c||i&Te.SkipSelf)&&(l=-1===c?Df(e,t):t[c+8],l!==fa&&wS(i,!1)?(a=t[F],c=dl(l),t=fl(l,t)):c=-1);-1!==c;){const d=t[F];if(_S(o,c,d.data)){const f=CV(c,t,r,a,i,u);if(f!==qr)return f}l=t[c+8],l!==fa&&wS(i,t[F].data[c+8]===u)&&_S(o,c,t)?(a=d,c=dl(l),t=fl(l,t)):c=-1}}return s}function CV(e,t,r,i,s,o){const a=t[F],c=a.data[e+8],d=Sf(c,a,r,null==i?Js(c)&&_y:i!=a&&!!(3&c.type),s&Te.Host&&o===c);return null!==d?ro(t,a,d,c):qr}function Sf(e,t,r,i,s){const o=e.providerIndexes,a=t.data,c=1048575&o,l=e.directiveStart,d=o>>20,h=s?c+d:e.directiveEnd;for(let p=i?c:c+d;p=l&&g.type===r)return p}if(s){const p=a[l];if(p&&_r(p)&&p.type===r)return l}return null}function ro(e,t,r,i){let s=e[r];const o=t.data;if(function pV(e){return e instanceof ul}(s)){const a=s;a.resolving&&function W3(e,t){throw t&&t.join(" > "),new A(-200,e)}(function Fe(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():pe(e)}(o[r]));const c=Ef(a.canSeeViewProviders);a.resolving=!0;const u=a.injectImpl?Sn(a.injectImpl):null;nS(e,i,Te.Default);try{s=e[r]=a.factory(void 0,o,e,i),t.firstCreatePass&&r>=i.directiveStart&&function fV(e,t,r){const{ngOnChanges:i,ngOnInit:s,ngDoCheck:o}=t.type.prototype;if(i){const a=VD(t);(r.preOrderHooks??=[]).push(e,a),(r.preOrderCheckHooks??=[]).push(e,a)}s&&(r.preOrderHooks??=[]).push(0-e,s),o&&((r.preOrderHooks??=[]).push(e,o),(r.preOrderCheckHooks??=[]).push(e,o))}(r,o[r],t)}finally{null!==u&&Sn(u),Ef(c),a.resolving=!1,oS()}}return s}function _S(e,t,r){return!!(r[t+(e>>hS)]&1<{const t=e.prototype.constructor,r=t[Ei]||Ey(t),i=Object.prototype;let s=Object.getPrototypeOf(e.prototype).constructor;for(;s&&s!==i;){const o=s[Ei]||Ey(s);if(o&&o!==r)return o;s=Object.getPrototypeOf(s)}return o=>new o})}function Ey(e){return Hd(e)?()=>{const t=Ey(ie(e));return t&&t()}:Ks(e)}function bS(e){const t=e[F],r=t.type;return 2===r?t.declTNode:1===r?e[Zt]:null}function TS(e,t=null,r=null,i){const s=IS(e,t,r,i);return s.resolveInjectorInitializers(),s}function IS(e,t=null,r=null,i,s=new Set){const o=[r||ke,CB(e)];return i=i||("object"==typeof e?void 0:Rt(e)),new ia(o,t||sf(),i||null,s)}class xt{static{this.THROW_IF_NOT_FOUND=Jc}static{this.NULL=new Xd}static create(t,r){if(Array.isArray(t))return TS({name:""},r,t,"");{const i=t.name??"";return TS({name:i},t.parent,t.providers,i)}}static{this.\u0275prov=j({token:xt,providedIn:"any",factory:()=>q(mD)})}static{this.__NG_ELEMENT_ID__=-1}}new z("").__NG_ELEMENT_ID__=e=>{const t=ze();if(null===t)throw new A(204,!1);if(2&t.type)return t.value;if(e&Te.Optional)return null;throw new A(204,!1)};function Dy(e){return e.ngOriginalError}const AS=!0;let pl=(()=>{class e{static{this.__NG_ELEMENT_ID__=LV}static{this.__NG_ENV_ID__=r=>r}}return e})();class PV extends pl{constructor(t){super(),this._lView=t}onDestroy(t){return pf(this._lView,t),()=>function oy(e,t){if(null===e[is])return;const r=e[is].indexOf(t);-1!==r&&e[is].splice(r,1)}(this._lView,t)}}function LV(){return new PV(N())}let io=(()=>{class e{constructor(){this.taskId=0,this.pendingTasks=new Set,this.hasPendingTasks=new Jn(!1)}get _hasPendingTasks(){return this.hasPendingTasks.value}add(){this._hasPendingTasks||this.hasPendingTasks.next(!0);const r=this.taskId++;return this.pendingTasks.add(r),r}remove(r){this.pendingTasks.delete(r),0===this.pendingTasks.size&&this._hasPendingTasks&&this.hasPendingTasks.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this._hasPendingTasks&&this.hasPendingTasks.next(!1)}static{this.\u0275prov=j({token:e,providedIn:"root",factory:()=>new e})}}return e})();const dt=class FV extends Ze{constructor(t=!1){super(),this.destroyRef=void 0,this.pendingTasks=void 0,this.__isAsync=t,MD()&&(this.destroyRef=O(pl,{optional:!0})??void 0,this.pendingTasks=O(io,{optional:!0})??void 0)}emit(t){const r=_e(null);try{super.next(t)}finally{_e(r)}}subscribe(t,r,i){let s=t,o=r||(()=>null),a=i;if(t&&"object"==typeof t){const l=t;s=l.next?.bind(l),o=l.error?.bind(l),a=l.complete?.bind(l)}this.__isAsync&&(o=this.wrapInTimeout(o),s&&(s=this.wrapInTimeout(s)),a&&(a=this.wrapInTimeout(a)));const c=super.subscribe({next:s,error:o,complete:a});return t instanceof vt&&t.add(c),c}wrapInTimeout(t){return r=>{const i=this.pendingTasks?.add();setTimeout(()=>{t(r),void 0!==i&&this.pendingTasks?.remove(i)})}}};function If(...e){}function MS(e){let t,r;function i(){e=If;try{void 0!==r&&"function"==typeof cancelAnimationFrame&&cancelAnimationFrame(r),void 0!==t&&clearTimeout(t)}catch{}}return t=setTimeout(()=>{e(),i()}),"function"==typeof requestAnimationFrame&&(r=requestAnimationFrame(()=>{e(),i()})),()=>i()}function NS(e){return queueMicrotask(()=>e()),()=>{e=If}}const Sy="isAngularZone",xf=Sy+"_ID";let BV=0;class Ne{constructor(t){this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new dt(!1),this.onMicrotaskEmpty=new dt(!1),this.onStable=new dt(!1),this.onError=new dt(!1);const{enableLongStackTrace:r=!1,shouldCoalesceEventChangeDetection:i=!1,shouldCoalesceRunChangeDetection:s=!1,scheduleInRootZone:o=AS}=t;if(typeof Zone>"u")throw new A(908,!1);Zone.assertZonePatched();const a=this;a._nesting=0,a._outer=a._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(a._inner=a._inner.fork(new Zone.TaskTrackingZoneSpec)),r&&Zone.longStackTraceZoneSpec&&(a._inner=a._inner.fork(Zone.longStackTraceZoneSpec)),a.shouldCoalesceEventChangeDetection=!s&&i,a.shouldCoalesceRunChangeDetection=s,a.callbackScheduled=!1,a.scheduleInRootZone=o,function jV(e){const t=()=>{!function UV(e){function t(){MS(()=>{e.callbackScheduled=!1,Iy(e),e.isCheckStableRunning=!0,Ty(e),e.isCheckStableRunning=!1})}e.isCheckStableRunning||e.callbackScheduled||(e.callbackScheduled=!0,e.scheduleInRootZone?Zone.root.run(()=>{t()}):e._outer.run(()=>{t()}),Iy(e))}(e)},r=BV++;e._inner=e._inner.fork({name:"angular",properties:{[Sy]:!0,[xf]:r,[xf+r]:!0},onInvokeTask:(i,s,o,a,c,l)=>{if(function $V(e){return kS(e,"__ignore_ng_zone__")}(l))return i.invokeTask(o,a,c,l);try{return RS(e),i.invokeTask(o,a,c,l)}finally{(e.shouldCoalesceEventChangeDetection&&"eventTask"===a.type||e.shouldCoalesceRunChangeDetection)&&t(),OS(e)}},onInvoke:(i,s,o,a,c,l,u)=>{try{return RS(e),i.invoke(o,a,c,l,u)}finally{e.shouldCoalesceRunChangeDetection&&!e.callbackScheduled&&!function HV(e){return kS(e,"__scheduler_tick__")}(l)&&t(),OS(e)}},onHasTask:(i,s,o,a)=>{i.hasTask(o,a),s===o&&("microTask"==a.change?(e._hasPendingMicrotasks=a.microTask,Iy(e),Ty(e)):"macroTask"==a.change&&(e.hasPendingMacrotasks=a.macroTask))},onHandleError:(i,s,o,a)=>(i.handleError(o,a),e.runOutsideAngular(()=>e.onError.emit(a)),!1)})}(a)}static isInAngularZone(){return typeof Zone<"u"&&!0===Zone.current.get(Sy)}static assertInAngularZone(){if(!Ne.isInAngularZone())throw new A(909,!1)}static assertNotInAngularZone(){if(Ne.isInAngularZone())throw new A(909,!1)}run(t,r,i){return this._inner.run(t,r,i)}runTask(t,r,i,s){const o=this._inner,a=o.scheduleEventTask("NgZoneEvent: "+s,t,VV,If,If);try{return o.runTask(a,r,i)}finally{o.cancelTask(a)}}runGuarded(t,r,i){return this._inner.runGuarded(t,r,i)}runOutsideAngular(t){return this._outer.run(t)}}const VV={};function Ty(e){if(0==e._nesting&&!e.hasPendingMicrotasks&&!e.isStable)try{e._nesting++,e.onMicrotaskEmpty.emit(null)}finally{if(e._nesting--,!e.hasPendingMicrotasks)try{e.runOutsideAngular(()=>e.onStable.emit(null))}finally{e.isStable=!0}}}function Iy(e){e.hasPendingMicrotasks=!!(e._hasPendingMicrotasks||(e.shouldCoalesceEventChangeDetection||e.shouldCoalesceRunChangeDetection)&&!0===e.callbackScheduled)}function RS(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function OS(e){e._nesting--,Ty(e)}class xy{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new dt,this.onMicrotaskEmpty=new dt,this.onStable=new dt,this.onError=new dt}run(t,r,i){return t.apply(r,i)}runGuarded(t,r,i){return t.apply(r,i)}runOutsideAngular(t){return t()}runTask(t,r,i,s){return t.apply(r,i)}}function kS(e,t){return!(!Array.isArray(e)||1!==e.length)&&!0===e[0]?.data?.[t]}class nr{constructor(){this._console=console}handleError(t){const r=this._findOriginalError(t);this._console.error("ERROR",t),r&&this._console.error("ORIGINAL ERROR",r)}_findOriginalError(t){let r=t&&Dy(t);for(;r&&Dy(r);)r=Dy(r);return r||null}}const qV=new z("",{providedIn:"root",factory:()=>{const e=O(Ne),t=O(nr);return r=>e.runOutsideAngular(()=>t.handleError(r))}});function GV(){return ga(ze(),N())}function ga(e,t){return new Un(pn(e,t))}let Un=(()=>{class e{constructor(r){this.nativeElement=r}static{this.__NG_ELEMENT_ID__=GV}}return e})();function LS(e){return e instanceof Un?e.nativeElement:e}function WV(){return this._results[Symbol.iterator]()}class Ay{get changes(){return this._changes??=new dt}constructor(t=!1){this._emitDistinctChangesOnly=t,this.dirty=!0,this._onDirty=void 0,this._results=[],this._changesDetected=!1,this._changes=void 0,this.length=0,this.first=void 0,this.last=void 0;const r=Ay.prototype;r[Symbol.iterator]||(r[Symbol.iterator]=WV)}get(t){return this._results[t]}map(t){return this._results.map(t)}filter(t){return this._results.filter(t)}find(t){return this._results.find(t)}reduce(t,r){return this._results.reduce(t,r)}forEach(t){this._results.forEach(t)}some(t){return this._results.some(t)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(t,r){this.dirty=!1;const i=function Tn(e){return e.flat(Number.POSITIVE_INFINITY)}(t);(this._changesDetected=!function oB(e,t,r){if(e.length!==t.length)return!1;for(let i=0;ip8}),p8="ng",nT=new z(""),os=new z("",{providedIn:"platform",factory:()=>"unknown"}),rT=new z(""),iT=new z("",{providedIn:"root",factory:()=>ss().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});let sT=()=>null;function jy(e,t,r=!1){return sT(e,t,r)}const hT=new z("",{providedIn:"root",factory:()=>!1});let Ff,Bf;function wa(e){return function Gy(){if(void 0===Ff&&(Ff=null,ct.trustedTypes))try{Ff=ct.trustedTypes.createPolicy("angular",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})}catch{}return Ff}()?.createHTML(e)||e}function mT(e){return function Wy(){if(void 0===Bf&&(Bf=null,ct.trustedTypes))try{Bf=ct.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})}catch{}return Bf}()?.createHTML(e)||e}class oo{constructor(t){this.changingThisBreaksApplicationSecurity=t}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${eD})`}}class x8 extends oo{getTypeName(){return"HTML"}}class A8 extends oo{getTypeName(){return"Style"}}class M8 extends oo{getTypeName(){return"Script"}}class N8 extends oo{getTypeName(){return"URL"}}class R8 extends oo{getTypeName(){return"ResourceURL"}}function jn(e){return e instanceof oo?e.changingThisBreaksApplicationSecurity:e}function Gr(e,t){const r=function O8(e){return e instanceof oo&&e.getTypeName()||null}(e);if(null!=r&&r!==t){if("ResourceURL"===r&&"URL"===t)return!0;throw new Error(`Required a safe ${t}, got a ${r} (see ${eD})`)}return r===t}class V8{constructor(t){this.inertDocumentHelper=t}getInertBodyElement(t){t=""+t;try{const r=(new window.DOMParser).parseFromString(wa(t),"text/html").body;return null===r?this.inertDocumentHelper.getInertBodyElement(t):(r.firstChild?.remove(),r)}catch{return null}}}class U8{constructor(t){this.defaultDoc=t,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert")}getInertBodyElement(t){const r=this.inertDocument.createElement("template");return r.innerHTML=wa(t),r}}const $8=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function Vf(e){return(e=String(e)).match($8)?e:"unsafe:"+e}function xi(e){const t={};for(const r of e.split(","))t[r]=!0;return t}function Cl(...e){const t={};for(const r of e)for(const i in r)r.hasOwnProperty(i)&&(t[i]=!0);return t}const wT=xi("area,br,col,hr,img,wbr"),bT=xi("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),ET=xi("rp,rt"),Zy=Cl(wT,Cl(bT,xi("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),Cl(ET,xi("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),Cl(ET,bT)),Ky=xi("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),CT=Cl(Ky,xi("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),xi("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),H8=xi("script,style,template");class z8{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(t){let r=t.firstChild,i=!0,s=[];for(;r;)if(r.nodeType===Node.ELEMENT_NODE?i=this.startElement(r):r.nodeType===Node.TEXT_NODE?this.chars(r.nodeValue):this.sanitizedSomething=!0,i&&r.firstChild)s.push(r),r=W8(r);else for(;r;){r.nodeType===Node.ELEMENT_NODE&&this.endElement(r);let o=G8(r);if(o){r=o;break}r=s.pop()}return this.buf.join("")}startElement(t){const r=DT(t).toLowerCase();if(!Zy.hasOwnProperty(r))return this.sanitizedSomething=!0,!H8.hasOwnProperty(r);this.buf.push("<"),this.buf.push(r);const i=t.attributes;for(let s=0;s"),!0}endElement(t){const r=DT(t).toLowerCase();Zy.hasOwnProperty(r)&&!wT.hasOwnProperty(r)&&(this.buf.push(""))}chars(t){this.buf.push(TT(t))}}function G8(e){const t=e.nextSibling;if(t&&e!==t.previousSibling)throw ST(t);return t}function W8(e){const t=e.firstChild;if(t&&function q8(e,t){return(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)!==Node.DOCUMENT_POSITION_CONTAINED_BY}(e,t))throw ST(t);return t}function DT(e){const t=e.nodeName;return"string"==typeof t?t:"FORM"}function ST(e){return new Error(`Failed to sanitize html because the element is clobbered: ${e.outerHTML}`)}const Z8=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,K8=/([^\#-~ |!])/g;function TT(e){return e.replace(/&/g,"&").replace(Z8,function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"}).replace(K8,function(t){return"&#"+t.charCodeAt(0)+";"}).replace(//g,">")}let Uf;function IT(e,t){let r=null;try{Uf=Uf||function _T(e){const t=new U8(e);return function j8(){try{return!!(new window.DOMParser).parseFromString(wa(""),"text/html")}catch{return!1}}()?new V8(t):t}(e);let i=t?String(t):"";r=Uf.getInertBodyElement(i);let s=5,o=i;do{if(0===s)throw new Error("Failed to sanitize html because the input is unstable");s--,i=o,o=r.innerHTML,r=Uf.getInertBodyElement(i)}while(i!==o);return wa((new z8).sanitizeChildren(Qy(r)||r))}finally{if(r){const i=Qy(r)||r;for(;i.firstChild;)i.firstChild.remove()}}}function Qy(e){return"content"in e&&function Q8(e){return e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.nodeName}(e)?e.content:null}var $n=function(e){return e[e.NONE=0]="NONE",e[e.HTML=1]="HTML",e[e.STYLE=2]="STYLE",e[e.SCRIPT=3]="SCRIPT",e[e.URL=4]="URL",e[e.RESOURCE_URL=5]="RESOURCE_URL",e}($n||{});function Yy(e){const t=function Dl(){const e=N();return e&&e[jr].sanitizer}();return t?mT(t.sanitize($n.HTML,e)||""):Gr(e,"HTML")?mT(jn(e)):IT(ss(),pe(e))}const nU=/^>|^->||--!>|)/g,iU="\u200b$1\u200b";function PT(e){return e.ownerDocument.defaultView}function Hn(e){return e instanceof Function?e():e}var as=function(e){return e[e.Important=1]="Important",e[e.DashCase=2]="DashCase",e}(as||{});let ev;function tv(e,t){return ev(e,t)}function Ea(e,t,r,i,s){if(null!=i){let o,a=!1;rn(i)?o=i:Lt(i)&&(a=!0,i=i[lt]);const c=Pe(i);0===e&&null!==r?null==s?zT(t,r,c):ao(t,r,c,s||null,!0):1===e&&null!==r?ao(t,r,c,s||null,!0):2===e?function Tl(e,t,r){e.removeChild(null,t,r)}(t,c,a):3===e&&t.destroyNode(c),null!=o&&function CU(e,t,r,i,s){const o=r[$r];o!==Pe(r)&&Ea(t,e,i,o,s);for(let c=_t;ct.replace(rU,iU))}(t))}function Hf(e,t,r){return e.createElement(t,r)}function jT(e,t){t[jr].changeDetectionScheduler?.notify(9),Gf(e,t,t[se],2,null,null)}function $T(e,t){const r=e[da],i=t[Tt];(Lt(i)||t[ut]!==i[Tt][ut])&&(e[ne]|=uf.HasTransplantedViews),null===r?e[da]=[t]:r.push(t)}function iv(e,t){const r=e[da],i=r.indexOf(t);r.splice(i,1)}function Sl(e,t){if(e.length<=_t)return;const r=_t+t,i=e[r];if(i){const s=i[Ys];null!==s&&s!==e&&iv(s,i),t>0&&(e[r-1][vr]=i[vr]);const o=Yd(e,_t+t);!function gU(e,t){jT(e,t),t[lt]=null,t[Zt]=null}(i[F],i);const a=o[Di];null!==a&&a.detachView(o[F]),i[Tt]=null,i[vr]=null,i[ne]&=-129}return i}function zf(e,t){if(!(256&t[ne])){const r=t[se];r.destroyNode&&Gf(e,t,r,3,null,null),function yU(e){let t=e[rl];if(!t)return sv(e[F],e);for(;t;){let r=null;if(Lt(t))r=t[rl];else{const i=t[_t];i&&(r=i)}if(!r){for(;t&&!t[vr]&&t!==e;)Lt(t)&&sv(t[F],t),t=t[Tt];null===t&&(t=e),Lt(t)&&sv(t[F],t),r=t&&t[vr]}t=r}}(t)}}function sv(e,t){if(256&t[ne])return;const r=_e(null);try{t[ne]&=-129,t[ne]|=256,t[Xn]&&hm(t[Xn]),function wU(e,t){let r;if(null!=e&&null!=(r=e.destroyHooks))for(let i=0;i=0?i[a]():i[-a].unsubscribe(),o+=2}else r[o].call(i[r[o+1]]);null!==i&&(t[aa]=null);const s=t[is];if(null!==s){t[is]=null;for(let o=0;o-1){const{encapsulation:o}=e.data[i.directiveStart+s];if(o===mr.None||o===mr.Emulated)return null}return pn(i,r)}}(e,t.parent,r)}function ao(e,t,r,i,s){e.insertBefore(t,r,i,s)}function zT(e,t,r){e.appendChild(t,r)}function qT(e,t,r,i,s){null!==i?ao(e,t,r,i,s):zT(e,t,r)}function av(e,t){return e.parentNode(t)}let cv,ZT=function WT(e,t,r){return 40&e.type?pn(e,r):null};function qf(e,t,r,i){const s=ov(e,i,t),o=t[se],c=function GT(e,t,r){return ZT(e,t,r)}(i.parent||t[Zt],i,t);if(null!=s)if(Array.isArray(r))for(let l=0;lY&&tI(e,t,Y,!1),Hr(a?2:0,s),r(i,s)}finally{to(o),Hr(a?3:1,s)}}function fv(e,t,r){if(Xm(t)){const i=_e(null);try{const o=t.directiveEnd;for(let a=t.directiveStart;anull;function aI(e,t,r,i,s){for(let o in t){if(!t.hasOwnProperty(o))continue;const a=t[o];if(void 0===a)continue;i??={};let c,l=ts.None;Array.isArray(a)?(c=a[0],l=a[1]):c=a;let u=o;if(null!==s){if(!s.hasOwnProperty(o))continue;u=s[o]}0===e?cI(i,r,u,c,l):cI(i,r,u,c)}return i}function cI(e,t,r,i,s){let o;e.hasOwnProperty(r)?(o=e[r]).push(t,i):o=e[r]=[t,i],void 0!==s&&o.push(s)}function An(e,t,r,i,s,o,a,c){const l=pn(t,r);let d,u=t.inputs;!c&&null!=u&&(d=u[i])?(wv(e,r,d,i,s),Js(t)&&function LU(e,t){const r=Vn(t,e);16&r[ne]||(r[ne]|=64)}(r,t.index)):3&t.type&&(i=function PU(e){return"class"===e?"className":"for"===e?"htmlFor":"formaction"===e?"formAction":"innerHtml"===e?"innerHTML":"readonly"===e?"readOnly":"tabindex"===e?"tabIndex":e}(i),s=null!=a?a(s,t.value||"",i):s,o.setProperty(l,i,s))}function mv(e,t,r,i){if(ZD()){const s=null===i?null:{"":-1},o=function $U(e,t){const r=e.directiveRegistry;let i=null,s=null;if(r)for(let o=0;o0;){const r=e[--t];if("number"==typeof r&&r<0)return r}return 0})(a)!=c&&a.push(c),a.push(r,i,o)}}(e,t,i,Il(e,r,s.hostVars,ge),s)}function Wr(e,t,r,i,s,o){const a=pn(e,t);!function vv(e,t,r,i,s,o,a){if(null==o)e.removeAttribute(t,s,r);else{const c=null==a?pe(o):a(o,i||"",s);e.setAttribute(t,s,c,r)}}(t[se],a,o,e.value,r,i,s)}function ZU(e,t,r,i,s,o){const a=o[t];if(null!==a)for(let c=0;c{hf(e.lView)},consumerOnSignalRead(){this.lView[Xn]=this}},i4={...Nd,consumerIsAlwaysLive:!0,consumerMarkedDirty:e=>{let t=Si(e.lView);for(;t&&!_I(t[F]);)t=Si(t);t&&qD(t)},consumerOnSignalRead(){this.lView[Xn]=this}};function _I(e){return 2!==e.type}const s4=100;function Qf(e,t=!0,r=0){const i=e[jr],s=i.rendererFactory;s.begin?.();try{!function o4(e,t){const r=JD();try{XD(!0),Cv(e,t);let i=0;for(;ff(e);){if(i===s4)throw new A(103,!1);i++,Cv(e,1)}}finally{XD(r)}}(e,r)}catch(a){throw t&&Kf(e,a),a}finally{s.end?.(),i.inlineEffectRunner?.flush()}}function a4(e,t,r,i){const s=t[ne];if(!(256&~s))return;t[jr].inlineEffectRunner?.flush(),hy(t);let c=!0,l=null,u=null;_I(e)?(u=function XU(e){return e[Xn]??function e4(e){const t=vI.pop()??Object.create(n4);return t.lView=e,t}(e)}(t),l=Rd(u)):null===function kC(){return Nt}()?(c=!1,u=function r4(e){const t=e[Xn]??Object.create(i4);return t.lView=e,t}(t),l=Rd(u)):t[Xn]&&(hm(t[Xn]),t[Xn]=null);try{zD(t),function eS(e){return oe.lFrame.bindingIndex=e}(e.bindingStartIndex),null!==r&&iI(e,t,r,2,i);const d=!(3&~s);if(d){const p=e.preOrderCheckHooks;null!==p&&wf(t,p,null)}else{const p=e.preOrderHooks;null!==p&&bf(t,p,0,null),gy(t,0)}if(function c4(e){for(let t=GS(e);null!==t;t=WS(t)){if(!(t[ne]&uf.HasTransplantedViews))continue;const r=t[da];for(let i=0;i-1&&(Sl(t,i),Yd(r,i))}this._attachedToViewContainer=!1}zf(this._lView[F],this._lView)}onDestroy(t){pf(this._lView,t)}markForCheck(){Al(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[ne]&=-129}reattach(){sy(this._lView),this._lView[ne]|=128}detectChanges(){this._lView[ne]|=1024,Qf(this._lView,this.notifyErrorHandler)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new A(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;const t=sl(this._lView),r=this._lView[Ys];null!==r&&!t&&iv(r,this._lView),jT(this._lView[F],this._lView)}attachToAppRef(t){if(this._attachedToViewContainer)throw new A(902,!1);this._appRef=t;const r=sl(this._lView),i=this._lView[Ys];null!==i&&!r&&$T(i,this._lView),sy(this._lView)}}let Mi=(()=>{class e{static{this.__NG_ELEMENT_ID__=f4}}return e})();const u4=Mi,d4=class extends u4{constructor(t,r,i){super(),this._declarationLView=t,this._declarationTContainer=r,this.elementRef=i}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(t,r){return this.createEmbeddedViewImpl(t,r)}createEmbeddedViewImpl(t,r,i){const s=function Ca(e,t,r,i){const s=_e(null);try{const o=t.tView,l=Wf(e,o,r,4096&e[ne]?4096:16,null,t,null,null,i?.injector??null,i?.embeddedViewInjector??null,i?.dehydratedView??null);l[Ys]=e[t.index];const d=e[Di];return null!==d&&(l[Di]=d.createEmbeddedView(o)),bv(o,l,r),l}finally{_e(s)}}(this._declarationLView,this._declarationTContainer,t,{embeddedViewInjector:r,dehydratedView:i});return new Ml(s)}};function f4(){return Yf(ze(),N())}function Yf(e,t){return 4&e.type?new d4(t,e,ga(e,t)):null}class Ta{}const Bl=new z("",{providedIn:"root",factory:()=>!1}),qI=new z(""),kv=new z("");class ij{}class GI{}class oj{resolveComponentFactory(t){throw function sj(e){const t=Error(`No component factory found for ${Rt(e)}.`);return t.ngComponent=e,t}(t)}}class Vl{static{this.NULL=new oj}}class rh{}let cj=(()=>{class e{static{this.\u0275prov=j({token:e,providedIn:"root",factory:()=>null})}}return e})();function sh(e,t,r){let i=r?e.styles:null,s=r?e.classes:null,o=0;if(null!==t)for(let a=0;a0&&XT(e,r,o.join(" "))}}(h,C,g,i),void 0!==r&&function vj(e,t,r){const i=e.projection=[];for(let s=0;s{class e{static{this.__NG_ELEMENT_ID__=wj}}return e})();function wj(){return e1(ze(),N())}const bj=rr,JI=class extends bj{constructor(t,r,i){super(),this._lContainer=t,this._hostTNode=r,this._hostLView=i}get element(){return ga(this._hostTNode,this._hostLView)}get injector(){return new Ft(this._hostTNode,this._hostLView)}get parentInjector(){const t=Df(this._hostTNode,this._hostLView);if(vy(t)){const r=fl(t,this._hostLView),i=dl(t);return new Ft(r[F].data[i+8],r)}return new Ft(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const r=XI(this._lContainer);return null!==r&&r[t]||null}get length(){return this._lContainer.length-_t}createEmbeddedView(t,r,i){let s,o;"number"==typeof i?s=i:null!=i&&(s=i.index,o=i.injector);const c=t.createEmbeddedViewImpl(r||{},o,null);return this.insertImpl(c,s,uo(this._hostTNode,null)),c}createComponent(t,r,i,s,o){const a=t&&!function nl(e){return"function"==typeof e}(t);let c;if(a)c=r;else{const g=r||{};c=g.index,i=g.injector,s=g.projectableNodes,o=g.environmentInjector||g.ngModuleRef}const l=a?t:new $l(De(t)),u=i||this.parentInjector;if(!o&&null==l.ngModule){const m=(a?u:this.parentInjector).get(In,null);m&&(o=m)}De(l.componentType??{});const p=l.create(u,s,null,o);return this.insertImpl(p.hostView,c,uo(this._hostTNode,null)),p}insert(t,r){return this.insertImpl(t,r,!0)}insertImpl(t,r,i){const s=t._lView;if(function QB(e){return rn(e[Tt])}(s)){const c=this.indexOf(t);if(-1!==c)this.detach(c);else{const l=s[Tt],u=new JI(l,l[Zt],l[Tt]);u.detach(u.indexOf(t))}}const o=this._adjustIndex(r),a=this._lContainer;return function Da(e,t,r,i=!0){const s=t[F];if(function vU(e,t,r,i){const s=_t+i,o=r.length;i>0&&(r[s-1][vr]=t),i!1;class Vv{constructor(t){this.queryList=t,this.matches=null}clone(){return new Vv(this.queryList)}setDirty(){this.queryList.setDirty()}}class Uv{constructor(t=[]){this.queries=t}createEmbeddedView(t){const r=t.queries;if(null!==r){const i=null!==t.contentQueries?t.contentQueries[0]:r.length,s=[];for(let o=0;ot.trim())}(t):t}}class jv{constructor(t=[]){this.queries=t}elementStart(t,r){for(let i=0;i0)i.push(a[c/2]);else{const u=o[c+1],d=t[-l];for(let f=_t;f(um(t),t.value);return r[gr]=t,r}(e),i=r[gr];return t?.equal&&(i.equal=t.equal),r.set=s=>zC(i,s),r.update=s=>function w3(e,t){FC()||HC(),zC(e,t(e.value))}(i,s),r.asReadonly=h1.bind(r),r}function h1(){const e=this[gr];if(void 0===e.readonlyFn){const t=()=>this();t[gr]=e,e.readonlyFn=t}return e.readonlyFn}function je(e){let t=function S1(e){return Object.getPrototypeOf(e.prototype).constructor}(e.type),r=!0;const i=[e];for(;t;){let s;if(_r(e))s=t.\u0275cmp||t.\u0275dir;else{if(t.\u0275cmp)throw new A(903,!1);s=t.\u0275dir}if(s){if(r){i.push(s);const a=e;a.inputs=ah(e.inputs),a.inputTransforms=ah(e.inputTransforms),a.declaredInputs=ah(e.declaredInputs),a.outputs=ah(e.outputs);const c=s.hostBindings;c&&qj(e,c);const l=s.viewQuery,u=s.contentQueries;if(l&&Hj(e,l),u&&zj(e,u),jj(e,s),F3(e.outputs,s.outputs),_r(s)&&s.data.animation){const d=e.data;d.animation=(d.animation||[]).concat(s.data.animation)}}const o=s.features;if(o)for(let a=0;a=0;i--){const s=e[i];s.hostVars=t+=s.hostVars,s.hostAttrs=el(s.hostAttrs,r=el(r,s.hostAttrs))}}(i)}function jj(e,t){for(const r in t.inputs){if(!t.inputs.hasOwnProperty(r)||e.inputs.hasOwnProperty(r))continue;const i=t.inputs[r];if(void 0!==i&&(e.inputs[r]=i,e.declaredInputs[r]=t.declaredInputs[r],null!==t.inputTransforms)){const s=Array.isArray(i)?i[0]:i;if(!t.inputTransforms.hasOwnProperty(s))continue;e.inputTransforms??={},e.inputTransforms[s]=t.inputTransforms[s]}}}function ah(e){return e===Vr?{}:e===ke?[]:e}function Hj(e,t){const r=e.viewQuery;e.viewQuery=r?(i,s)=>{t(i,s),r(i,s)}:t}function zj(e,t){const r=e.contentQueries;e.contentQueries=r?(i,s,o)=>{t(i,s,o),r(i,s,o)}:t}function qj(e,t){const r=e.hostBindings;e.hostBindings=r?(i,s)=>{t(i,s),r(i,s)}:t}class po{}class N1{}class Zv extends po{constructor(t,r,i,s=!0){super(),this.ngModuleType=t,this._parent=r,this._bootstrapComponents=[],this.destroyCbs=[],this.componentFactoryResolver=new QI(this);const o=nn(t);this._bootstrapComponents=Hn(o.bootstrap),this._r3Injector=IS(t,r,[{provide:po,useValue:this},{provide:Vl,useValue:this.componentFactoryResolver},...i],Rt(t),new Set(["environment"])),s&&this.resolveInjectorInitializers()}resolveInjectorInitializers(){this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(this.ngModuleType)}get injector(){return this._r3Injector}destroy(){const t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(r=>r()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class Kv extends N1{constructor(t){super(),this.moduleType=t}create(t){return new Zv(this.moduleType,t,[])}}class R1 extends po{constructor(t){super(),this.componentFactoryResolver=new QI(this),this.instance=null;const r=new ia([...t.providers,{provide:po,useValue:this},{provide:Vl,useValue:this.componentFactoryResolver}],t.parent||sf(),t.debugName,new Set(["environment"]));this.injector=r,t.runEnvironmentInitializers&&r.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(t){this.injector.onDestroy(t)}}function ch(e,t,r=null){return new R1({providers:e,parent:t,debugName:r,runEnvironmentInitializers:!0}).injector}function lh(e){return!!function Qv(e){return null!==e&&("function"==typeof e||"object"==typeof e)}(e)&&(Array.isArray(e)||!(e instanceof Map)&&Symbol.iterator in e)}function wt(e,t,r){return!Object.is(e[t],r)&&(e[t]=r,!0)}function ql(e,t,r,i,s,o,a,c,l,u){const d=r+Y,f=t.firstCreatePass?function r6(e,t,r,i,s,o,a,c,l){const u=t.consts,d=lo(t,e,4,a||null,c||null);mv(t,r,d,tr(u,l)),_f(t,d);const f=d.tView=gv(2,d,i,s,o,t.directiveRegistry,t.pipeRegistry,null,t.schemas,u,null);return null!==t.queries&&(t.queries.template(t,d),f.queries=t.queries.embeddedTView(d)),d}(d,t,e,i,s,o,a,c,l):t.data[d];wr(f,!1);const h=O1(t,e,f,r);ll()&&qf(t,e,h,f),sn(h,e);const p=dI(h,e,h,f);return e[d]=p,Zf(e,p),function n1(e,t,r){return Bv(e,t,r)}(p,f,e),df(f)&&hv(t,e,f),null!=l&&pv(e,f,u),f}function sr(e,t,r,i,s,o,a,c){const l=N(),u=we();return ql(l,u,e,t,r,i,s,tr(u.consts,o),a,c),sr}let O1=function k1(e,t,r,i){return zr(!0),t[se].createComment("")};var Ma=function(e){return e[e.EarlyRead=0]="EarlyRead",e[e.Write=1]="Write",e[e.MixedReadWrite=2]="MixedReadWrite",e[e.Read=3]="Read",e}(Ma||{});let U1=(()=>{class e{constructor(){this.impl=null}execute(){this.impl?.execute()}static{this.\u0275prov=j({token:e,providedIn:"root",factory:()=>new e})}}return e})();class Zl{constructor(){this.ngZone=O(Ne),this.scheduler=O(Ta),this.errorHandler=O(nr,{optional:!0}),this.sequences=new Set,this.deferredRegistrations=new Set,this.executing=!1}static{this.PHASES=[Ma.EarlyRead,Ma.Write,Ma.MixedReadWrite,Ma.Read]}execute(){this.executing=!0;for(const t of Zl.PHASES)for(const r of this.sequences)if(!r.erroredOrDestroyed&&r.hooks[t])try{r.pipelinedValue=this.ngZone.runOutsideAngular(()=>r.hooks[t](r.pipelinedValue))}catch(i){r.erroredOrDestroyed=!0,this.errorHandler?.handleError(i)}this.executing=!1;for(const t of this.sequences)t.afterRun(),t.once&&(this.sequences.delete(t),t.destroy());for(const t of this.deferredRegistrations)this.sequences.add(t);this.deferredRegistrations.size>0&&this.scheduler.notify(7),this.deferredRegistrations.clear()}register(t){this.executing?this.deferredRegistrations.add(t):(this.sequences.add(t),this.scheduler.notify(6))}unregister(t){this.executing&&this.sequences.has(t)?(t.erroredOrDestroyed=!0,t.pipelinedValue=void 0,t.once=!0):(this.sequences.delete(t),this.deferredRegistrations.delete(t))}static{this.\u0275prov=j({token:Zl,providedIn:"root",factory:()=>new Zl})}}class a6{constructor(t,r,i,s){this.impl=t,this.hooks=r,this.once=i,this.erroredOrDestroyed=!1,this.pipelinedValue=void 0,this.unregisterOnDestroy=s?.onDestroy(()=>this.destroy())}afterRun(){this.erroredOrDestroyed=!1,this.pipelinedValue=void 0}destroy(){this.impl.unregister(this),this.unregisterOnDestroy?.()}}function ph(e,t){!t?.injector&&function Qm(e){if(!MD())throw new A(-203,!1)}();const r=t?.injector??O(xt);return function zn(e){return"browser"===(e??O(xt)).get(os)}(r)?(mn("NgAfterNextRender"),function j1(e,t,r,i){const s=t.get(U1);s.impl??=t.get(Zl);const o=r?.phase??Ma.MixedReadWrite,a=!0!==r?.manualCleanup?t.get(pl):null,c=new a6(s.impl,function l6(e,t){if(e instanceof Function){const r=[void 0,void 0,void 0,void 0];return r[t]=e,r}return[e.earlyRead,e.write,e.mixedReadWrite,e.read]}(e,o),i,a);return s.impl.register(c),c}(e,r,t,!0)):$1}const $1={destroy(){}};function on(e,t,r,i){const s=N();return wt(s,br(),t)&&(we(),Wr(nt(),s,e,t,r,i)),on}function yh(e,t){return e<<17|t<<2}function ds(e){return e>>17&32767}function c0(e){return 2|e}function yo(e){return(131068&e)>>2}function l0(e,t){return-131069&e|t<<2}function u0(e){return 1|e}function px(e,t,r,i){const s=e[r+1],o=null===t;let a=i?ds(s):yo(s),c=!1;for(;0!==a&&(!1===c||o);){const u=e[a+1];q6(e[a],t)&&(c=!0,e[a+1]=i?u0(u):c0(u)),a=i?ds(u):yo(u)}c&&(e[r+1]=i?c0(s):u0(s))}function q6(e,t){return null===e||null==t||(Array.isArray(e)?e[1]:e)===t||!(!Array.isArray(e)||"string"!=typeof t)&&ra(e,t)>=0}const Bt={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function gx(e){return e.substring(Bt.key,Bt.keyEnd)}function mx(e,t){const r=Bt.textEnd;return r===t?-1:(t=Bt.keyEnd=function K6(e,t,r){for(;t32;)t++;return t}(e,Bt.key=t,r),qa(e,t,r))}function qa(e,t,r){for(;t=0;r=mx(t,r))Bn(e,gx(t),!0)}function Er(e,t,r,i){const s=N(),o=we(),a=Ii(2);o.firstUpdatePass&&Ex(o,e,a,i),t!==ge&&wt(s,a,t)&&Dx(o,o.data[Yt()],s,s[se],e,s[a+1]=function o$(e,t){return null==e||""===e||("string"==typeof t?e+=t:"object"==typeof e&&(e=Rt(jn(e)))),e}(t,r),i,a)}function bx(e,t){return t>=e.expandoStartIndex}function Ex(e,t,r,i){const s=e.data;if(null===s[r+1]){const o=s[Yt()],a=bx(e,r);Tx(o,i)&&null===t&&!a&&(t=!1),t=function X6(e,t,r,i){const s=dy(e);let o=i?t.residualClasses:t.residualStyles;if(null===s)0===(i?t.classBindings:t.styleBindings)&&(r=Yl(r=f0(null,e,t,r,i),t.attrs,i),o=null);else{const a=t.directiveStylingLast;if(-1===a||e[a]!==s)if(r=f0(s,e,t,r,i),null===o){let l=function e$(e,t,r){const i=r?t.classBindings:t.styleBindings;if(0!==yo(i))return e[ds(i)]}(e,t,i);void 0!==l&&Array.isArray(l)&&(l=f0(null,e,t,l[1],i),l=Yl(l,t.attrs,i),function t$(e,t,r,i){e[ds(r?t.classBindings:t.styleBindings)]=i}(e,t,i,l))}else o=function n$(e,t,r){let i;const s=t.directiveEnd;for(let o=1+t.directiveStylingLast;o0)&&(u=!0)):d=r,s)if(0!==l){const h=ds(e[c+1]);e[i+1]=yh(h,c),0!==h&&(e[h+1]=l0(e[h+1],i)),e[c+1]=function j6(e,t){return 131071&e|t<<17}(e[c+1],i)}else e[i+1]=yh(c,0),0!==c&&(e[c+1]=l0(e[c+1],i)),c=i;else e[i+1]=yh(l,0),0===c?c=i:e[l+1]=l0(e[l+1],i),l=i;u&&(e[i+1]=c0(e[i+1])),px(e,d,i,!0),px(e,d,i,!1),function z6(e,t,r,i,s){const o=s?e.residualClasses:e.residualStyles;null!=o&&"string"==typeof t&&ra(o,t)>=0&&(r[i+1]=u0(r[i+1]))}(t,d,e,i,o),a=yh(c,l),o?t.classBindings=a:t.styleBindings=a}(s,o,t,r,a,i)}}function f0(e,t,r,i,s){let o=null;const a=r.directiveEnd;let c=r.directiveStylingLast;for(-1===c?c=r.directiveStart:c++;c0;){const l=e[s],u=Array.isArray(l),d=u?l[1]:l,f=null===d;let h=r[s+1];h===ge&&(h=f?ke:void 0);let p=f?Vm(h,i):d===i?h:void 0;if(u&&!vh(p)&&(p=Vm(l,i)),vh(p)&&(c=p,a))return c;const g=e[s+1];s=a?ds(g):yo(g)}if(null!==t){let l=o?t.residualClasses:t.residualStyles;null!=l&&(c=Vm(l,i))}return c}function vh(e){return void 0!==e}function Tx(e,t){return!!(e.flags&(t?8:16))}function fe(e,t,r,i){const s=N(),o=we(),a=Y+e,c=s[se],l=o.firstCreatePass?function A$(e,t,r,i,s,o){const a=t.consts,l=lo(t,e,2,i,tr(a,s));return mv(t,r,l,tr(a,o)),null!==l.attrs&&sh(l,l.attrs,!1),null!==l.mergedAttrs&&sh(l,l.mergedAttrs,!0),null!==t.queries&&t.queries.elementStart(t,l),l}(a,o,s,t,r,i):o.data[a],u=Mx(o,s,l,c,t,e);s[a]=u;const d=df(l);return wr(l,!0),eI(c,u,l),!function xa(e){return!(32&~e.flags)}(l)&&ll()&&qf(o,s,u,l),0===function YB(){return oe.lFrame.elementDepthCount}()&&sn(u,s),function JB(){oe.lFrame.elementDepthCount++}(),d&&(hv(o,s,l),fv(o,l,s)),null!==i&&pv(s,l),fe}function me(){let e=ze();cy()?ly():(e=e.parent,wr(e,!1));const t=e;(function eV(e){return oe.skipHydrationRootTNode===e})(t)&&function iV(){oe.skipHydrationRootTNode=null}(),function XB(){oe.lFrame.elementDepthCount--}();const r=we();return r.firstCreatePass&&(_f(r,e),Xm(e)&&r.queries.elementEnd(e)),null!=t.classesWithoutHost&&function mV(e){return!!(8&e.flags)}(t)&&d0(r,t,N(),t.classesWithoutHost,!0),null!=t.stylesWithoutHost&&function yV(e){return!!(16&e.flags)}(t)&&d0(r,t,N(),t.stylesWithoutHost,!1),me}function or(e,t,r,i){return fe(e,t,r,i),me(),or}let Mx=(e,t,r,i,s,o)=>(zr(!0),Hf(i,s,function aS(){return oe.lFrame.currentNamespace}()));function Ga(e,t,r){const i=N(),s=we(),o=e+Y,a=s.firstCreatePass?function R$(e,t,r,i,s){const o=t.consts,a=tr(o,i),c=lo(t,e,8,"ng-container",a);return null!==a&&sh(c,a,!0),mv(t,r,c,tr(o,s)),null!==t.queries&&t.queries.elementStart(t,c),c}(o,s,i,t,r):s.data[o];wr(a,!0);const c=Rx(s,i,a,e);return i[o]=c,ll()&&qf(s,i,c,a),sn(c,i),df(a)&&(hv(s,i,a),fv(s,a,i)),null!=r&&pv(i,a),Ga}function Wa(){let e=ze();const t=we();return cy()?ly():(e=e.parent,wr(e,!1)),t.firstCreatePass&&(_f(t,e),Xm(e)&&t.queries.elementEnd(e)),Wa}let Rx=(e,t,r,i)=>(zr(!0),rv(t[se],""));function Jr(){return N()}function m0(e,t,r){const i=N();if(wt(i,br(),t)){const o=we(),a=nt();An(o,a,i,e,t,gI(dy(o.data),a,i),r,!0)}return m0}const wh="en-US";let Lx=wh,eA=(e,t,r)=>{};function $e(e,t,r,i){const s=N(),o=we(),a=ze();return function _0(e,t,r,i,s,o,a){const c=df(i),u=e.firstCreatePass&&pI(e),d=t[tt],f=hI(t);let h=!0;if(3&i.type||a){const m=pn(i,t),y=a?a(m):m,_=f.length,v=a?b=>a(Pe(b[i.index])):i.index;let w=null;if(!a&&c&&(w=function S5(e,t,r,i){const s=e.cleanup;if(null!=s)for(let o=0;ol?c[l]:null}"string"==typeof a&&(o+=2)}return null}(e,t,s,i.index)),null!==w)(w.__ngLastListenerFn__||w).__ngNextListenerFn__=o,w.__ngLastListenerFn__=o,h=!1;else{o=iA(i,t,d,o),eA(m,s,o);const b=r.listen(y,s,o);f.push(o,b),u&&u.push(s,v,_,_+1)}}else o=iA(i,t,d,o);const p=i.outputs;let g;if(h&&null!==p&&(g=p[s])){const m=g.length;if(m)for(let y=0;y-1?Vn(e.index,t):t,5);let c=rA(t,r,i,o),l=s.__ngNextListenerFn__;for(;l;)c=rA(t,r,l,o)&&c,l=l.__ngNextListenerFn__;return c}}function Ct(e=1){return function lV(e){return(oe.lFrame.contextLView=function GD(e,t){for(;e>0;)t=t[ca],e--;return t}(e,oe.lFrame.contextLView))[tt]}(e)}function b0(e,t,r){a1(e,t,r)}function Dh(e){const t=N(),r=we(),i=fy();mf(i+1);const s=qv(r,i);if(e.dirty&&function KB(e){return!(4&~e[ne])}(t)===!(2&~s.metadata.flags)){if(null===s.matches)e.reset([]);else{const o=u1(t,i);e.reset(o,LS),e.notifyOnChanges()}return!0}return!1}function Sh(){return function zv(e,t){return e[Di].queries[t].queryList}(N(),fy())}function Ka(e){return Xs(function QD(){return oe.lFrame.contextLView}(),Y+e)}function Le(e,t=""){const r=N(),i=we(),s=e+Y,o=i.firstCreatePass?lo(i,s,1,t,null):i.data[s],a=DA(i,r,o,t,e);r[s]=a,ll()&&qf(i,r,a,o),wr(o,!1)}let DA=(e,t,r,i,s)=>(zr(!0),function nv(e,t){return e.createText(t)}(t[se],i));function Qa(e){return Xr("",e,""),Qa}function Xr(e,t,r){const i=N(),s=function Fa(e,t,r,i){return wt(e,br(),r)?t+pe(r)+i:ge}(i,e,t,r);return s!==ge&&function Ai(e,t,r){const i=ol(t,e);!function UT(e,t,r){e.setValue(t,r)}(e[se],i,r)}(i,Yt(),s),Xr}function C0(e,t,r,i,s){if(e=ie(e),Array.isArray(e))for(let o=0;o>20;if(Qs(e)||!e.multi){const p=new ul(u,s,k),g=S0(l,t,s?d:d+h,f);-1===g?(by(Cf(c,a),o,l),D0(o,e,t.length),t.push(l),c.directiveStart++,c.directiveEnd++,s&&(c.providerIndexes+=1048576),r.push(p),a.push(p)):(r[g]=p,a[g]=p)}else{const p=S0(l,t,d+h,f),g=S0(l,t,d,d+h),y=g>=0&&r[g];if(s&&!y||!s&&!(p>=0&&r[p])){by(Cf(c,a),o,l);const _=function Q5(e,t,r,i,s){const o=new ul(e,r,k);return o.multi=[],o.index=t,o.componentProviders=0,FA(o,s,i&&!r),o}(s?K5:Z5,r.length,s,i,u);!s&&y&&(r[g].providerFactory=_),D0(o,e,t.length,0),t.push(l),c.directiveStart++,c.directiveEnd++,s&&(c.providerIndexes+=1048576),r.push(_),a.push(_)}else D0(o,e,p>-1?p:g,FA(r[s?g:p],u,!s&&i));!s&&i&&y&&r[g].componentProviders++}}}function D0(e,t,r,i){const s=Qs(t),o=function SB(e){return!!e.useClass}(t);if(s||o){const l=(o?ie(t.useClass):t).prototype.ngOnDestroy;if(l){const u=e.destroyHooks||(e.destroyHooks=[]);if(!s&&t.multi){const d=u.indexOf(r);-1===d?u.push(r,[i,l]):u[d+1].push(i,l)}else u.push(r,l)}}}function FA(e,t,r){return r&&e.componentProviders++,e.multi.push(t)-1}function S0(e,t,r,i){for(let s=r;s{r.providersResolver=(i,s)=>function W5(e,t,r){const i=we();if(i.firstCreatePass){const s=_r(e);C0(r,i.data,i.blueprint,s,!0),C0(t,i.data,i.blueprint,s,!1)}}(i,s?s(e):e,t)}}let Y5=(()=>{class e{constructor(r){this._injector=r,this.cachedInjectors=new Map}getOrCreateStandaloneInjector(r){if(!r.standalone)return null;if(!this.cachedInjectors.has(r)){const i=Hm(0,r.type),s=i.length>0?ch([i],this._injector,`Standalone[${r.type.name}]`):null;this.cachedInjectors.set(r,s)}return this.cachedInjectors.get(r)}ngOnDestroy(){try{for(const r of this.cachedInjectors.values())null!==r&&r.destroy()}finally{this.cachedInjectors.clear()}}static{this.\u0275prov=j({token:e,providedIn:"environment",factory:()=>new e(q(In))})}}return e})();function Th(e){mn("NgStandalone"),e.getStandaloneInjector=t=>t.get(Y5).getOrCreateStandaloneInjector(e)}function UA(e,t,r,i,s,o){const a=t+r;return wt(e,a,s)?function Kr(e,t,r){return e[t]=r}(e,a+1,o?i.call(o,s):i(s)):function ru(e,t){const r=e[t];return r===ge?void 0:r}(e,a+1)}function GA(e,t,r){const i=e+Y,s=N(),o=Xs(s,i);return function iu(e,t){return e[F].data[t].pure}(s,i)?UA(s,function gn(){const e=oe.lFrame;let t=e.bindingRootIndex;return-1===t&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}(),t,o.transform,r,o):o.transform(r)}function WA(e,t){return Yf(e,t)}let lM=(()=>{class e{log(r){console.log(r)}warn(r){console.warn(r)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"platform"})}}return e})();const pM=new z(""),Nh=new z("");let k0,R0=(()=>{class e{constructor(r,i,s){this._ngZone=r,this.registry=i,this._isZoneStable=!0,this._callbacks=[],this.taskTrackingZone=null,k0||(function cz(e){k0=e}(s),s.addToWindow(i)),this._watchAngularEvents(),r.run(()=>{this.taskTrackingZone=typeof Zone>"u"?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{Ne.assertNotInAngularZone(),queueMicrotask(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}isStable(){return this._isZoneStable&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())queueMicrotask(()=>{for(;0!==this._callbacks.length;){let r=this._callbacks.pop();clearTimeout(r.timeoutId),r.doneCb()}});else{let r=this.getPendingTasks();this._callbacks=this._callbacks.filter(i=>!i.updateCb||!i.updateCb(r)||(clearTimeout(i.timeoutId),!1))}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(r=>({source:r.source,creationLocation:r.creationLocation,data:r.data})):[]}addCallback(r,i,s){let o=-1;i&&i>0&&(o=setTimeout(()=>{this._callbacks=this._callbacks.filter(a=>a.timeoutId!==o),r()},i)),this._callbacks.push({doneCb:r,timeoutId:o,updateCb:s})}whenStable(r,i,s){if(s&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(r,i,s),this._runCallbacksIfReady()}registerApplication(r){this.registry.registerApplication(r,this)}unregisterApplication(r){this.registry.unregisterApplication(r)}findProviders(r,i,s){return[]}static{this.\u0275fac=function(i){return new(i||e)(q(Ne),q(O0),q(Nh))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})(),O0=(()=>{class e{constructor(){this._applications=new Map}registerApplication(r,i){this._applications.set(r,i)}unregisterApplication(r){this._applications.delete(r)}unregisterAllApplications(){this._applications.clear()}getTestability(r){return this._applications.get(r)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(r,i=!0){return k0?.findTestabilityInTree(this,r,i)??null}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"platform"})}}return e})();function cu(e){return!!e&&"function"==typeof e.then}function gM(e){return!!e&&"function"==typeof e.subscribe}const P0=new z("");let mM=(()=>{class e{constructor(){this.initialized=!1,this.done=!1,this.donePromise=new Promise((r,i)=>{this.resolve=r,this.reject=i}),this.appInits=O(P0,{optional:!0})??[]}runInitializers(){if(this.initialized)return;const r=[];for(const s of this.appInits){const o=s();if(cu(o))r.push(o);else if(gM(o)){const a=new Promise((c,l)=>{o.subscribe({complete:c,error:l})});r.push(a)}}const i=()=>{this.done=!0,this.resolve()};Promise.all(r).then(()=>{i()}).catch(s=>{this.reject(s)}),0===r.length&&i(),this.initialized=!0}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const Rh=new z("");function vM(e,t){return Array.isArray(t)?t.reduce(vM,e):{...e,...t}}let ar=(()=>{class e{constructor(){this._bootstrapListeners=[],this._runningTick=!1,this._destroyed=!1,this._destroyListeners=[],this._views=[],this.internalErrorHandler=O(qV),this.afterRenderManager=O(U1),this.zonelessEnabled=O(Bl),this.dirtyFlags=0,this.deferredDirtyFlags=0,this.externalTestViews=new Set,this.beforeRender=new Ze,this.afterTick=new Ze,this.componentTypes=[],this.components=[],this.isStable=O(io).hasPendingTasks.pipe(Ue(r=>!r)),this._injector=O(In)}get allViews(){return[...this.externalTestViews.keys(),...this._views]}get destroyed(){return this._destroyed}whenStable(){let r;return new Promise(i=>{r=this.isStable.subscribe({next:s=>{s&&i()}})}).finally(()=>{r.unsubscribe()})}get injector(){return this._injector}bootstrap(r,i){const s=r instanceof GI;if(!this._injector.get(mM).done)throw!s&&function rs(e){const t=De(e)||kt(e)||Wt(e);return null!==t&&t.standalone}(r),new A(405,!1);let a;a=s?r:this._injector.get(Vl).resolveComponentFactory(r),this.componentTypes.push(a.componentType);const c=function lz(e){return e.isBoundToModule}(a)?void 0:this._injector.get(po),u=a.create(xt.NULL,[],i||a.selector,c),d=u.location.nativeElement,f=u.injector.get(pM,null);return f?.registerApplication(d),u.onDestroy(()=>{this.detachView(u.hostView),Oh(this.components,u),f?.unregisterApplication(d)}),this._loadComponent(u),u}tick(){this.zonelessEnabled||(this.dirtyFlags|=1),this._tick()}_tick(){if(this._runningTick)throw new A(101,!1);const r=_e(null);try{this._runningTick=!0,this.synchronize()}catch(i){this.internalErrorHandler(i)}finally{this._runningTick=!1,_e(r),this.afterTick.next()}}synchronize(){let r=null;this._injector.destroyed||(r=this._injector.get(rh,null,{optional:!0})),this.dirtyFlags|=this.deferredDirtyFlags,this.deferredDirtyFlags=0;let i=0;for(;0!==this.dirtyFlags&&i++<10;)this.synchronizeOnce(r)}synchronizeOnce(r){if(this.dirtyFlags|=this.deferredDirtyFlags,this.deferredDirtyFlags=0,7&this.dirtyFlags){const i=!!(1&this.dirtyFlags);this.dirtyFlags&=-8,this.dirtyFlags|=8,this.beforeRender.next(i);for(let{_lView:s,notifyErrorHandler:o}of this._views)fz(s,o,i,this.zonelessEnabled);if(this.dirtyFlags&=-5,this.syncDirtyFlagsWithViews(),7&this.dirtyFlags)return}else r?.begin?.(),r?.end?.();8&this.dirtyFlags&&(this.dirtyFlags&=-9,this.afterRenderManager.execute()),this.syncDirtyFlagsWithViews()}syncDirtyFlagsWithViews(){this.allViews.some(({_lView:r})=>ff(r))?this.dirtyFlags|=2:this.dirtyFlags&=-8}attachView(r){const i=r;this._views.push(i),i.attachToAppRef(this)}detachView(r){const i=r;Oh(this._views,i),i.detachFromAppRef()}_loadComponent(r){this.attachView(r.hostView),this.tick(),this.components.push(r);const i=this._injector.get(Rh,[]);[...this._bootstrapListeners,...i].forEach(s=>s(r))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(r=>r()),this._views.slice().forEach(r=>r.destroy())}finally{this._destroyed=!0,this._views=[],this._bootstrapListeners=[],this._destroyListeners=[]}}onDestroy(r){return this._destroyListeners.push(r),()=>Oh(this._destroyListeners,r)}destroy(){if(this._destroyed)throw new A(406,!1);const r=this._injector;r.destroy&&!r.destroyed&&r.destroy()}get viewCount(){return this._views.length}warnIfDestroyed(){}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function Oh(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}function fz(e,t,r,i){(r||ff(e))&&Qf(e,t,r&&!i?0:1)}class hz{constructor(t,r){this.ngModuleFactory=t,this.componentFactories=r}}let wM=(()=>{class e{compileModuleSync(r){return new Kv(r)}compileModuleAsync(r){return Promise.resolve(this.compileModuleSync(r))}compileModuleAndAllComponentsSync(r){const i=this.compileModuleSync(r),o=Hn(nn(r).declarations).reduce((a,c)=>{const l=De(c);return l&&a.push(new $l(l)),a},[]);return new hz(i,o)}compileModuleAndAllComponentsAsync(r){return Promise.resolve(this.compileModuleAndAllComponentsSync(r))}clearCache(){}clearCacheFor(r){}getModuleId(r){}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),mz=(()=>{class e{constructor(){this.zone=O(Ne),this.changeDetectionScheduler=O(Ta),this.applicationRef=O(ar)}initialize(){this._onMicrotaskEmptySubscription||(this._onMicrotaskEmptySubscription=this.zone.onMicrotaskEmpty.subscribe({next:()=>{this.changeDetectionScheduler.runningTick||this.zone.run(()=>{this.applicationRef.tick()})}}))}ngOnDestroy(){this._onMicrotaskEmptySubscription?.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function L0({ngZoneFactory:e,ignoreChangesOutsideZone:t,scheduleInRootZone:r}){return e??=()=>new Ne({...F0(),scheduleInRootZone:r}),[{provide:Ne,useFactory:e},{provide:Ur,multi:!0,useFactory:()=>{const i=O(mz,{optional:!0});return()=>i.initialize()}},{provide:Ur,multi:!0,useFactory:()=>{const i=O(vz);return()=>{i.initialize()}}},!0===t?{provide:qI,useValue:!0}:[],{provide:kv,useValue:r??AS}]}function F0(e){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:e?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:e?.runCoalescing??!1}}let vz=(()=>{class e{constructor(){this.subscription=new vt,this.initialized=!1,this.zone=O(Ne),this.pendingTasks=O(io)}initialize(){if(this.initialized)return;this.initialized=!0;let r=null;!this.zone.isStable&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(r=this.pendingTasks.add()),this.zone.runOutsideAngular(()=>{this.subscription.add(this.zone.onStable.subscribe(()=>{Ne.assertNotInAngularZone(),queueMicrotask(()=>{null!==r&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(this.pendingTasks.remove(r),r=null)})}))}),this.subscription.add(this.zone.onUnstable.subscribe(()=>{Ne.assertInAngularZone(),r??=this.pendingTasks.add()}))}ngOnDestroy(){this.subscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),lu=(()=>{class e{constructor(){this.appRef=O(ar),this.taskService=O(io),this.ngZone=O(Ne),this.zonelessEnabled=O(Bl),this.disableScheduling=O(qI,{optional:!0})??!1,this.zoneIsDefined=typeof Zone<"u"&&!!Zone.root.run,this.schedulerTickApplyArgs=[{data:{__scheduler_tick__:!0}}],this.subscriptions=new vt,this.angularZoneId=this.zoneIsDefined?this.ngZone._inner?.get(xf):null,this.scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(O(kv,{optional:!0})??!1),this.cancelScheduledCallback=null,this.useMicrotaskScheduler=!1,this.runningTick=!1,this.pendingRenderTaskId=null,this.subscriptions.add(this.appRef.afterTick.subscribe(()=>{this.runningTick||this.cleanup()})),this.subscriptions.add(this.ngZone.onUnstable.subscribe(()=>{this.runningTick||this.cleanup()})),this.disableScheduling||=!this.zonelessEnabled&&(this.ngZone instanceof xy||!this.zoneIsDefined)}notify(r){if(!this.zonelessEnabled&&5===r)return;switch(r){case 0:this.appRef.dirtyFlags|=2;break;case 3:case 2:case 4:case 5:case 1:this.appRef.dirtyFlags|=4;break;case 7:this.appRef.deferredDirtyFlags|=8;break;default:this.appRef.dirtyFlags|=8}if(!this.shouldScheduleTick())return;const i=this.useMicrotaskScheduler?NS:MS;this.pendingRenderTaskId=this.taskService.add(),this.cancelScheduledCallback=this.scheduleInRootZone?Zone.root.run(()=>i(()=>this.tick())):this.ngZone.runOutsideAngular(()=>i(()=>this.tick()))}shouldScheduleTick(){return!(this.disableScheduling||null!==this.pendingRenderTaskId||this.runningTick||this.appRef._runningTick||!this.zonelessEnabled&&this.zoneIsDefined&&Zone.current.get(xf+this.angularZoneId))}tick(){if(this.runningTick||this.appRef.destroyed)return;!this.zonelessEnabled&&7&this.appRef.dirtyFlags&&(this.appRef.dirtyFlags|=1);const r=this.taskService.add();try{this.ngZone.run(()=>{this.runningTick=!0,this.appRef._tick()},void 0,this.schedulerTickApplyArgs)}catch(i){throw this.taskService.remove(r),i}finally{this.cleanup()}this.useMicrotaskScheduler=!0,NS(()=>{this.useMicrotaskScheduler=!1,this.taskService.remove(r)})}ngOnDestroy(){this.subscriptions.unsubscribe(),this.cleanup()}cleanup(){if(this.runningTick=!1,this.cancelScheduledCallback?.(),this.cancelScheduledCallback=null,null!==this.pendingRenderTaskId){const r=this.pendingRenderTaskId;this.pendingRenderTaskId=null,this.taskService.remove(r)}}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const fs=new z("",{providedIn:"root",factory:()=>O(fs,Te.Optional|Te.SkipSelf)||function _z(){return typeof $localize<"u"&&$localize.locale||wh}()}),Ph=new z("");function Lh(e){return!e.moduleRef}let TM=(()=>{class e{constructor(r){this._injector=r,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(r,i){const s=i?.scheduleInRootZone,a=i?.ignoreChangesOutsideZone,c=[L0({ngZoneFactory:()=>function zV(e="zone.js",t){return"noop"===e?new xy:"zone.js"===e?new Ne(t):e}(i?.ngZone,{...F0({eventCoalescing:i?.ngZoneEventCoalescing,runCoalescing:i?.ngZoneRunCoalescing}),scheduleInRootZone:s}),ignoreChangesOutsideZone:a}),{provide:Ta,useExisting:lu}],l=function Jj(e,t,r){return new Zv(e,t,r,!1)}(r.moduleType,this.injector,c);return function SM(e){const t=Lh(e)?e.r3Injector:e.moduleRef.injector,r=t.get(Ne);return r.run(()=>{Lh(e)?e.r3Injector.resolveInjectorInitializers():e.moduleRef.resolveInjectorInitializers();const i=t.get(nr,null);let s;if(r.runOutsideAngular(()=>{s=r.onError.subscribe({next:o=>{i.handleError(o)}})}),Lh(e)){const o=()=>t.destroy(),a=e.platformInjector.get(Ph);a.add(o),t.onDestroy(()=>{s.unsubscribe(),a.delete(o)})}else{const o=()=>e.moduleRef.destroy(),a=e.platformInjector.get(Ph);a.add(o),e.moduleRef.onDestroy(()=>{Oh(e.allPlatformModules,e.moduleRef),s.unsubscribe(),a.delete(o)})}return function dz(e,t,r){try{const i=r();return cu(i)?i.catch(s=>{throw t.runOutsideAngular(()=>e.handleError(s)),s}):i}catch(i){throw t.runOutsideAngular(()=>e.handleError(i)),i}}(i,r,()=>{const o=t.get(mM);return o.runInitializers(),o.donePromise.then(()=>{if(function j$(e){"string"==typeof e&&(Lx=e.toLowerCase().replace(/_/g,"-"))}(t.get(fs,wh)||wh),Lh(e)){const c=t.get(ar);return void 0!==e.rootComponent&&c.bootstrap(e.rootComponent),c}return function Sz(e,t){const r=e.injector.get(ar);if(e._bootstrapComponents.length>0)e._bootstrapComponents.forEach(i=>r.bootstrap(i));else{if(!e.instance.ngDoBootstrap)throw new A(-403,!1);e.instance.ngDoBootstrap(r)}t.push(e)}(e.moduleRef,e.allPlatformModules),e.moduleRef})})})}({moduleRef:l,allPlatformModules:this._modules,platformInjector:this.injector})}bootstrapModule(r,i=[]){const s=vM({},i);return function gz(e,t,r){const i=new Kv(r);return Promise.resolve(i)}(0,0,r).then(o=>this.bootstrapModuleFactory(o,s))}onDestroy(r){this._destroyListeners.push(r)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new A(404,!1);this._modules.slice().forEach(i=>i.destroy()),this._destroyListeners.forEach(i=>i());const r=this._injector.get(Ph,null);r&&(r.forEach(i=>i()),r.clear()),this._destroyed=!0}get destroyed(){return this._destroyed}static{this.\u0275fac=function(i){return new(i||e)(q(xt))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"platform"})}}return e})(),hs=null;const IM=new z("");function xM(e,t,r=[]){const i=`Platform: ${t}`,s=new z(i);return(o=[])=>{let a=V0();if(!a||a.injector.get(IM,!1)){const c=[...r,...o,{provide:s,useValue:!0}];e?e(c):function Tz(e){if(hs&&!hs.get(IM,!1))throw new A(400,!1);(function yM(){!function v3(e){$C=e}(()=>{throw new A(600,!1)})})(),hs=e;const t=e.get(TM);(function MM(e){e.get(nT,null)?.forEach(r=>r())})(e)}(function AM(e=[],t){return xt.create({name:t,providers:[{provide:Gm,useValue:"platform"},{provide:Ph,useValue:new Set([()=>hs=null])},...e]})}(c,i))}return function Iz(){const t=V0();if(!t)throw new A(401,!1);return t}()}}function V0(){return hs?.get(TM)??null}let uu=(()=>{class e{static{this.__NG_ELEMENT_ID__=Az}}return e})();function Az(e){return function Mz(e,t,r){if(Js(e)&&!r){const i=Vn(e.index,t);return new Ml(i,i)}return 175&e.type?new Ml(t[ut],t):null}(ze(),N(),!(16&~e))}class PM{constructor(){}supports(t){return lh(t)}create(t){return new Pz(t)}}const kz=(e,t)=>t;class Pz{constructor(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||kz}forEachItem(t){let r;for(r=this._itHead;null!==r;r=r._next)t(r)}forEachOperation(t){let r=this._itHead,i=this._removalsHead,s=0,o=null;for(;r||i;){const a=!i||r&&r.currentIndex{a=this._trackByFn(s,c),null!==r&&Object.is(r.trackById,a)?(i&&(r=this._verifyReinsertion(r,c,a,s)),Object.is(r.item,c)||this._addIdentityChange(r,c)):(r=this._mismatch(r,c,a,s),i=!0),r=r._next,s++}),this.length=s;return this._truncate(r),this.collection=t,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let t;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=t._nextMoved)t.previousIndex=t.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(t,r,i,s){let o;return null===t?o=this._itTail:(o=t._prev,this._remove(t)),null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null))?(Object.is(t.item,r)||this._addIdentityChange(t,r),this._reinsertAfter(t,o,s)):null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(i,s))?(Object.is(t.item,r)||this._addIdentityChange(t,r),this._moveAfter(t,o,s)):t=this._addAfter(new Lz(r,i),o,s),t}_verifyReinsertion(t,r,i,s){let o=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null);return null!==o?t=this._reinsertAfter(o,t._prev,s):t.currentIndex!=s&&(t.currentIndex=s,this._addToMoves(t,s)),t}_truncate(t){for(;null!==t;){const r=t._next;this._addToRemovals(this._unlink(t)),t=r}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(t,r,i){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);const s=t._prevRemoved,o=t._nextRemoved;return null===s?this._removalsHead=o:s._nextRemoved=o,null===o?this._removalsTail=s:o._prevRemoved=s,this._insertAfter(t,r,i),this._addToMoves(t,i),t}_moveAfter(t,r,i){return this._unlink(t),this._insertAfter(t,r,i),this._addToMoves(t,i),t}_addAfter(t,r,i){return this._insertAfter(t,r,i),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t}_insertAfter(t,r,i){const s=null===r?this._itHead:r._next;return t._next=s,t._prev=r,null===s?this._itTail=t:s._prev=t,null===r?this._itHead=t:r._next=t,null===this._linkedRecords&&(this._linkedRecords=new LM),this._linkedRecords.put(t),t.currentIndex=i,t}_remove(t){return this._addToRemovals(this._unlink(t))}_unlink(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);const r=t._prev,i=t._next;return null===r?this._itHead=i:r._next=i,null===i?this._itTail=r:i._prev=r,t}_addToMoves(t,r){return t.previousIndex===r||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t}_addToRemovals(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new LM),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t}_addIdentityChange(t,r){return t.item=r,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t}}class Lz{constructor(t,r){this.item=t,this.trackById=r,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class Fz{constructor(){this._head=null,this._tail=null}add(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)}get(t,r){let i;for(i=this._head;null!==i;i=i._nextDup)if((null===r||r<=i.currentIndex)&&Object.is(i.trackById,t))return i;return null}remove(t){const r=t._prevDup,i=t._nextDup;return null===r?this._head=i:r._nextDup=i,null===i?this._tail=r:i._prevDup=r,null===this._head}}class LM{constructor(){this.map=new Map}put(t){const r=t.trackById;let i=this.map.get(r);i||(i=new Fz,this.map.set(r,i)),i.add(t)}get(t,r){const s=this.map.get(t);return s?s.get(t,r):null}remove(t){const r=t.trackById;return this.map.get(r).remove(t)&&this.map.delete(r),t}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function FM(e,t,r){const i=e.previousIndex;if(null===i)return i;let s=0;return r&&i{class e{static{this.\u0275prov=j({token:e,providedIn:"root",factory:VM})}constructor(r){this.factories=r}static create(r,i){if(null!=i){const s=i.factories.slice();r=r.concat(s)}return new e(r)}static extend(r){return{provide:e,useFactory:i=>e.create(r,i||VM()),deps:[[e,new Qd,new Kd]]}}find(r){const i=this.factories.find(s=>s.supports(r));if(null!=i)return i;throw new A(901,!1)}}return e})();const $z=xM(null,"core",[]);let Hz=(()=>{class e{constructor(r){}static{this.\u0275fac=function(i){return new(i||e)(q(ar))}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({})}}return e})();function pu(e,t){mn("NgSignals");const r=function g3(e){const t=Object.create(m3);t.computation=e;const r=()=>{if(PC(t),um(t),t.value===Pd)throw t.error;return t.value};return r[gr]=t,r}(e);return t?.equal&&(r[gr].equal=t.equal),r}function ei(e){const t=_e(null);try{return e()}finally{_e(t)}}let lN=null;function ps(){return lN}class x9{}const an=new z("");let W0=(()=>{class e{historyGo(r){throw new Error("")}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:()=>O(M9),providedIn:"platform"})}}return e})();const A9=new z("");let M9=(()=>{class e extends W0{constructor(){super(),this._doc=O(an),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return ps().getBaseHref(this._doc)}onPopState(r){const i=ps().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",r,!1),()=>i.removeEventListener("popstate",r)}onHashChange(r){const i=ps().getGlobalEventTarget(this._doc,"window");return i.addEventListener("hashchange",r,!1),()=>i.removeEventListener("hashchange",r)}get href(){return this._location.href}get protocol(){return this._location.protocol}get hostname(){return this._location.hostname}get port(){return this._location.port}get pathname(){return this._location.pathname}get search(){return this._location.search}get hash(){return this._location.hash}set pathname(r){this._location.pathname=r}pushState(r,i,s){this._history.pushState(r,i,s)}replaceState(r,i,s){this._history.replaceState(r,i,s)}forward(){this._history.forward()}back(){this._history.back()}historyGo(r=0){this._history.go(r)}getState(){return this._history.state}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:()=>new e,providedIn:"platform"})}}return e})();function Z0(e,t){if(0==e.length)return t;if(0==t.length)return e;let r=0;return e.endsWith("/")&&r++,t.startsWith("/")&&r++,2==r?e+t.substring(1):1==r?e+t:e+"/"+t}function uN(e){const t=e.match(/#|\?|$/),r=t&&t.index||e.length;return e.slice(0,r-("/"===e[r-1]?1:0))+e.slice(r)}function Oi(e){return e&&"?"!==e[0]?"?"+e:e}let bo=(()=>{class e{historyGo(r){throw new Error("")}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:()=>O(fN),providedIn:"root"})}}return e})();const dN=new z("");let fN=(()=>{class e extends bo{constructor(r,i){super(),this._platformLocation=r,this._removeListenerFns=[],this._baseHref=i??this._platformLocation.getBaseHrefFromDOM()??O(an).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(r){this._removeListenerFns.push(this._platformLocation.onPopState(r),this._platformLocation.onHashChange(r))}getBaseHref(){return this._baseHref}prepareExternalUrl(r){return Z0(this._baseHref,r)}path(r=!1){const i=this._platformLocation.pathname+Oi(this._platformLocation.search),s=this._platformLocation.hash;return s&&r?`${i}${s}`:i}pushState(r,i,s,o){const a=this.prepareExternalUrl(s+Oi(o));this._platformLocation.pushState(r,i,a)}replaceState(r,i,s,o){const a=this.prepareExternalUrl(s+Oi(o));this._platformLocation.replaceState(r,i,a)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(r=0){this._platformLocation.historyGo?.(r)}static{this.\u0275fac=function(i){return new(i||e)(q(W0),q(dN,8))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),N9=(()=>{class e extends bo{constructor(r,i){super(),this._platformLocation=r,this._baseHref="",this._removeListenerFns=[],null!=i&&(this._baseHref=i)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(r){this._removeListenerFns.push(this._platformLocation.onPopState(r),this._platformLocation.onHashChange(r))}getBaseHref(){return this._baseHref}path(r=!1){const i=this._platformLocation.hash??"#";return i.length>0?i.substring(1):i}prepareExternalUrl(r){const i=Z0(this._baseHref,r);return i.length>0?"#"+i:i}pushState(r,i,s,o){let a=this.prepareExternalUrl(s+Oi(o));0==a.length&&(a=this._platformLocation.pathname),this._platformLocation.pushState(r,i,a)}replaceState(r,i,s,o){let a=this.prepareExternalUrl(s+Oi(o));0==a.length&&(a=this._platformLocation.pathname),this._platformLocation.replaceState(r,i,a)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(r=0){this._platformLocation.historyGo?.(r)}static{this.\u0275fac=function(i){return new(i||e)(q(W0),q(dN,8))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})(),gu=(()=>{class e{constructor(r){this._subject=new dt,this._urlChangeListeners=[],this._urlChangeSubscription=null,this._locationStrategy=r;const i=this._locationStrategy.getBaseHref();this._basePath=function k9(e){if(new RegExp("^(https?:)?//").test(e)){const[,r]=e.split(/\/\/[^\/]+/);return r}return e}(uN(hN(i))),this._locationStrategy.onPopState(s=>{this._subject.emit({url:this.path(!0),pop:!0,state:s.state,type:s.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(r=!1){return this.normalize(this._locationStrategy.path(r))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(r,i=""){return this.path()==this.normalize(r+Oi(i))}normalize(r){return e.stripTrailingSlash(function O9(e,t){if(!e||!t.startsWith(e))return t;const r=t.substring(e.length);return""===r||["/",";","?","#"].includes(r[0])?r:t}(this._basePath,hN(r)))}prepareExternalUrl(r){return r&&"/"!==r[0]&&(r="/"+r),this._locationStrategy.prepareExternalUrl(r)}go(r,i="",s=null){this._locationStrategy.pushState(s,"",r,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(r+Oi(i)),s)}replaceState(r,i="",s=null){this._locationStrategy.replaceState(s,"",r,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(r+Oi(i)),s)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(r=0){this._locationStrategy.historyGo?.(r)}onUrlChange(r){return this._urlChangeListeners.push(r),this._urlChangeSubscription??=this.subscribe(i=>{this._notifyUrlChangeListeners(i.url,i.state)}),()=>{const i=this._urlChangeListeners.indexOf(r);this._urlChangeListeners.splice(i,1),0===this._urlChangeListeners.length&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(r="",i){this._urlChangeListeners.forEach(s=>s(r,i))}subscribe(r,i,s){return this._subject.subscribe({next:r,error:i,complete:s})}static{this.normalizeQueryParams=Oi}static{this.joinWithSlash=Z0}static{this.stripTrailingSlash=uN}static{this.\u0275fac=function(i){return new(i||e)(q(bo))}}static{this.\u0275prov=j({token:e,factory:()=>function R9(){return new gu(q(bo))}(),providedIn:"root"})}}return e})();function hN(e){return e.replace(/\/index.html$/,"")}class b7{constructor(t,r,i,s){this.$implicit=t,this.ngForOf=r,this.index=i,this.count=s}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let s_=(()=>{class e{set ngForOf(r){this._ngForOf=r,this._ngForOfDirty=!0}set ngForTrackBy(r){this._trackByFn=r}get ngForTrackBy(){return this._trackByFn}constructor(r,i,s){this._viewContainer=r,this._template=i,this._differs=s,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForTemplate(r){r&&(this._template=r)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const r=this._ngForOf;!this._differ&&r&&(this._differ=this._differs.find(r).create(this.ngForTrackBy))}if(this._differ){const r=this._differ.diff(this._ngForOf);r&&this._applyChanges(r)}}_applyChanges(r){const i=this._viewContainer;r.forEachOperation((s,o,a)=>{if(null==s.previousIndex)i.createEmbeddedView(this._template,new b7(s.item,this._ngForOf,-1,-1),null===a?void 0:a);else if(null==a)i.remove(null===o?void 0:o);else if(null!==o){const c=i.get(o);i.move(c,a),DN(c,s)}});for(let s=0,o=i.length;s{DN(i.get(s.currentIndex),s)})}static ngTemplateContextGuard(r,i){return!0}static{this.\u0275fac=function(i){return new(i||e)(k(rr),k(Mi),k(z0))}}static{this.\u0275dir=de({type:e,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"},standalone:!0})}}return e})();function DN(e,t){e.context.$implicit=t.item}let rp=(()=>{class e{constructor(r,i){this._viewContainer=r,this._context=new E7,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=i}set ngIf(r){this._context.$implicit=this._context.ngIf=r,this._updateView()}set ngIfThen(r){SN("ngIfThen",r),this._thenTemplateRef=r,this._thenViewRef=null,this._updateView()}set ngIfElse(r){SN("ngIfElse",r),this._elseTemplateRef=r,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(r,i){return!0}static{this.\u0275fac=function(i){return new(i||e)(k(rr),k(Mi))}}static{this.\u0275dir=de({type:e,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"},standalone:!0})}}return e})();class E7{constructor(){this.$implicit=null,this.ngIf=null}}function SN(e,t){if(t&&!t.createEmbeddedView)throw new Error(`${e} must be a TemplateRef, but received '${Rt(t)}'.`)}let gs=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({})}}return e})();const xN="browser";function AN(e){return"server"===e}let K7=(()=>{class e{static{this.\u0275prov=j({token:e,providedIn:"root",factory:()=>function Z7(e){return e===xN}(O(os))?new Q7(O(an),window):new J7})}}return e})();class Q7{constructor(t,r){this.document=t,this.window=r,this.offset=()=>[0,0]}setOffset(t){this.offset=Array.isArray(t)?()=>t:t}getScrollPosition(){return[this.window.scrollX,this.window.scrollY]}scrollToPosition(t){this.window.scrollTo(t[0],t[1])}scrollToAnchor(t){const r=function Y7(e,t){const r=e.getElementById(t)||e.getElementsByName(t)[0];if(r)return r;if("function"==typeof e.createTreeWalker&&e.body&&"function"==typeof e.body.attachShadow){const i=e.createTreeWalker(e.body,NodeFilter.SHOW_ELEMENT);let s=i.currentNode;for(;s;){const o=s.shadowRoot;if(o){const a=o.getElementById(t)||o.querySelector(`[name="${t}"]`);if(a)return a}s=i.nextNode()}}return null}(this.document,t);r&&(this.scrollToElement(r),r.focus())}setHistoryScrollRestoration(t){this.window.history.scrollRestoration=t}scrollToElement(t){const r=t.getBoundingClientRect(),i=r.left+this.window.pageXOffset,s=r.top+this.window.pageYOffset,o=this.offset();this.window.scrollTo(i-o[0],s-o[1])}}class J7{setOffset(t){}getScrollPosition(){return[0,0]}scrollToPosition(t){}scrollToAnchor(t){}setHistoryScrollRestoration(t){}}class Iq extends x9{constructor(){super(...arguments),this.supportsDOMEvents=!0}}class h_ extends Iq{static makeCurrent(){!function I9(e){lN??=e}(new h_)}onAndCancel(t,r,i){return t.addEventListener(r,i),()=>{t.removeEventListener(r,i)}}dispatchEvent(t,r){t.dispatchEvent(r)}remove(t){t.remove()}createElement(t,r){return(r=r||this.getDefaultDocument()).createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,r){return"window"===r?window:"document"===r?t:"body"===r?t.body:null}getBaseHref(t){const r=function xq(){return _u=_u||document.querySelector("base"),_u?_u.getAttribute("href"):null}();return null==r?null:function Aq(e){return new URL(e,document.baseURI).pathname}(r)}resetBaseElement(){_u=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return function v7(e,t){t=encodeURIComponent(t);for(const r of e.split(";")){const i=r.indexOf("="),[s,o]=-1==i?[r,""]:[r.slice(0,i),r.slice(i+1)];if(s.trim()===t)return decodeURIComponent(o)}return null}(document.cookie,t)}}let _u=null,Nq=(()=>{class e{build(){return new XMLHttpRequest}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})();const p_=new z("");let UN=(()=>{class e{constructor(r,i){this._zone=i,this._eventNameToPlugin=new Map,r.forEach(s=>{s.manager=this}),this._plugins=r.slice().reverse()}addEventListener(r,i,s){return this._findPluginFor(i).addEventListener(r,i,s)}getZone(){return this._zone}_findPluginFor(r){let i=this._eventNameToPlugin.get(r);if(i)return i;if(i=this._plugins.find(o=>o.supports(r)),!i)throw new A(5101,!1);return this._eventNameToPlugin.set(r,i),i}static{this.\u0275fac=function(i){return new(i||e)(q(p_),q(Ne))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})();class jN{constructor(t){this._doc=t}}const g_="ng-app-id";let $N=(()=>{class e{constructor(r,i,s,o={}){this.doc=r,this.appId=i,this.nonce=s,this.platformId=o,this.styleRef=new Map,this.hostNodes=new Set,this.styleNodesInDOM=this.collectServerRenderedStyles(),this.platformIsServer=AN(o),this.resetHostNodes()}addStyles(r){for(const i of r)1===this.changeUsageCount(i,1)&&this.onStyleAdded(i)}removeStyles(r){for(const i of r)this.changeUsageCount(i,-1)<=0&&this.onStyleRemoved(i)}ngOnDestroy(){const r=this.styleNodesInDOM;r&&(r.forEach(i=>i.remove()),r.clear());for(const i of this.getAllStyles())this.onStyleRemoved(i);this.resetHostNodes()}addHost(r){this.hostNodes.add(r);for(const i of this.getAllStyles())this.addStyleToHost(r,i)}removeHost(r){this.hostNodes.delete(r)}getAllStyles(){return this.styleRef.keys()}onStyleAdded(r){for(const i of this.hostNodes)this.addStyleToHost(i,r)}onStyleRemoved(r){const i=this.styleRef;i.get(r)?.elements?.forEach(s=>s.remove()),i.delete(r)}collectServerRenderedStyles(){const r=this.doc.head?.querySelectorAll(`style[${g_}="${this.appId}"]`);if(r?.length){const i=new Map;return r.forEach(s=>{null!=s.textContent&&i.set(s.textContent,s)}),i}return null}changeUsageCount(r,i){const s=this.styleRef;if(s.has(r)){const o=s.get(r);return o.usage+=i,o.usage}return s.set(r,{usage:i,elements:[]}),i}getStyleElement(r,i){const s=this.styleNodesInDOM,o=s?.get(i);if(o?.parentNode===r)return s.delete(i),o.removeAttribute(g_),o;{const a=this.doc.createElement("style");return this.nonce&&a.setAttribute("nonce",this.nonce),a.textContent=i,this.platformIsServer&&a.setAttribute(g_,this.appId),r.appendChild(a),a}}addStyleToHost(r,i){const s=this.getStyleElement(r,i),o=this.styleRef,a=o.get(i)?.elements;a?a.push(s):o.set(i,{elements:[s],usage:1})}resetHostNodes(){const r=this.hostNodes;r.clear(),r.add(this.doc.head)}static{this.\u0275fac=function(i){return new(i||e)(q(an),q(ya),q(iT,8),q(os))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})();const m_={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/Math/MathML"},y_=/%COMP%/g,Pq=new z("",{providedIn:"root",factory:()=>!0});function zN(e,t){return t.map(r=>r.replace(y_,e))}let v_=(()=>{class e{constructor(r,i,s,o,a,c,l,u=null){this.eventManager=r,this.sharedStylesHost=i,this.appId=s,this.removeStylesOnCompDestroy=o,this.doc=a,this.platformId=c,this.ngZone=l,this.nonce=u,this.rendererByCompId=new Map,this.platformIsServer=AN(c),this.defaultRenderer=new __(r,a,l,this.platformIsServer)}createRenderer(r,i){if(!r||!i)return this.defaultRenderer;this.platformIsServer&&i.encapsulation===mr.ShadowDom&&(i={...i,encapsulation:mr.Emulated});const s=this.getOrCreateRenderer(r,i);return s instanceof GN?s.applyToHost(r):s instanceof w_&&s.applyStyles(),s}getOrCreateRenderer(r,i){const s=this.rendererByCompId;let o=s.get(i.id);if(!o){const a=this.doc,c=this.ngZone,l=this.eventManager,u=this.sharedStylesHost,d=this.removeStylesOnCompDestroy,f=this.platformIsServer;switch(i.encapsulation){case mr.Emulated:o=new GN(l,u,i,this.appId,d,a,c,f);break;case mr.ShadowDom:return new Vq(l,u,r,i,a,c,this.nonce,f);default:o=new w_(l,u,i,d,a,c,f)}s.set(i.id,o)}return o}ngOnDestroy(){this.rendererByCompId.clear()}static{this.\u0275fac=function(i){return new(i||e)(q(UN),q($N),q(ya),q(Pq),q(an),q(os),q(Ne),q(iT))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})();class __{constructor(t,r,i,s){this.eventManager=t,this.doc=r,this.ngZone=i,this.platformIsServer=s,this.data=Object.create(null),this.throwOnSyntheticProps=!0,this.destroyNode=null}destroy(){}createElement(t,r){return r?this.doc.createElementNS(m_[r]||r,t):this.doc.createElement(t)}createComment(t){return this.doc.createComment(t)}createText(t){return this.doc.createTextNode(t)}appendChild(t,r){(qN(t)?t.content:t).appendChild(r)}insertBefore(t,r,i){t&&(qN(t)?t.content:t).insertBefore(r,i)}removeChild(t,r){r.remove()}selectRootElement(t,r){let i="string"==typeof t?this.doc.querySelector(t):t;if(!i)throw new A(-5104,!1);return r||(i.textContent=""),i}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,r,i,s){if(s){r=s+":"+r;const o=m_[s];o?t.setAttributeNS(o,r,i):t.setAttribute(r,i)}else t.setAttribute(r,i)}removeAttribute(t,r,i){if(i){const s=m_[i];s?t.removeAttributeNS(s,r):t.removeAttribute(`${i}:${r}`)}else t.removeAttribute(r)}addClass(t,r){t.classList.add(r)}removeClass(t,r){t.classList.remove(r)}setStyle(t,r,i,s){s&(as.DashCase|as.Important)?t.style.setProperty(r,i,s&as.Important?"important":""):t.style[r]=i}removeStyle(t,r,i){i&as.DashCase?t.style.removeProperty(r):t.style[r]=""}setProperty(t,r,i){null!=t&&(t[r]=i)}setValue(t,r){t.nodeValue=r}listen(t,r,i){if("string"==typeof t&&!(t=ps().getGlobalEventTarget(this.doc,t)))throw new Error(`Unsupported event target ${t} for event ${r}`);return this.eventManager.addEventListener(t,r,this.decoratePreventDefault(i))}decoratePreventDefault(t){return r=>{if("__ngUnwrap__"===r)return t;!1===(this.platformIsServer?this.ngZone.runGuarded(()=>t(r)):t(r))&&r.preventDefault()}}}function qN(e){return"TEMPLATE"===e.tagName&&void 0!==e.content}class Vq extends __{constructor(t,r,i,s,o,a,c,l){super(t,o,a,l),this.sharedStylesHost=r,this.hostEl=i,this.shadowRoot=i.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const u=zN(s.id,s.styles);for(const d of u){const f=document.createElement("style");c&&f.setAttribute("nonce",c),f.textContent=d,this.shadowRoot.appendChild(f)}}nodeOrShadowRoot(t){return t===this.hostEl?this.shadowRoot:t}appendChild(t,r){return super.appendChild(this.nodeOrShadowRoot(t),r)}insertBefore(t,r,i){return super.insertBefore(this.nodeOrShadowRoot(t),r,i)}removeChild(t,r){return super.removeChild(null,r)}parentNode(t){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(t)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}}class w_ extends __{constructor(t,r,i,s,o,a,c,l){super(t,o,a,c),this.sharedStylesHost=r,this.removeStylesOnCompDestroy=s,this.styles=l?zN(l,i.styles):i.styles}applyStyles(){this.sharedStylesHost.addStyles(this.styles)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles)}}class GN extends w_{constructor(t,r,i,s,o,a,c,l){const u=s+"-"+i.id;super(t,r,i,o,a,c,l,u),this.contentAttr=function Lq(e){return"_ngcontent-%COMP%".replace(y_,e)}(u),this.hostAttr=function Fq(e){return"_nghost-%COMP%".replace(y_,e)}(u)}applyToHost(t){this.applyStyles(),this.setAttribute(t,this.hostAttr,"")}createElement(t,r){const i=super.createElement(t,r);return super.setAttribute(i,this.contentAttr,""),i}}let Uq=(()=>{class e extends jN{constructor(r){super(r)}supports(r){return!0}addEventListener(r,i,s){return r.addEventListener(i,s,!1),()=>this.removeEventListener(r,i,s)}removeEventListener(r,i,s){return r.removeEventListener(i,s)}static{this.\u0275fac=function(i){return new(i||e)(q(an))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})();const WN=["alt","control","meta","shift"],jq={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},$q={alt:e=>e.altKey,control:e=>e.ctrlKey,meta:e=>e.metaKey,shift:e=>e.shiftKey};let Hq=(()=>{class e extends jN{constructor(r){super(r)}supports(r){return null!=e.parseEventName(r)}addEventListener(r,i,s){const o=e.parseEventName(i),a=e.eventCallback(o.fullKey,s,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>ps().onAndCancel(r,o.domEventName,a))}static parseEventName(r){const i=r.toLowerCase().split("."),s=i.shift();if(0===i.length||"keydown"!==s&&"keyup"!==s)return null;const o=e._normalizeKey(i.pop());let a="",c=i.indexOf("code");if(c>-1&&(i.splice(c,1),a="code."),WN.forEach(u=>{const d=i.indexOf(u);d>-1&&(i.splice(d,1),a+=u+".")}),a+=o,0!=i.length||0===o.length)return null;const l={};return l.domEventName=s,l.fullKey=a,l}static matchEventFullKeyCode(r,i){let s=jq[r.key]||r.key,o="";return i.indexOf("code.")>-1&&(s=r.code,o="code."),!(null==s||!s)&&(s=s.toLowerCase()," "===s?s="space":"."===s&&(s="dot"),WN.forEach(a=>{a!==s&&(0,$q[a])(r)&&(o+=a+".")}),o+=s,o===i)}static eventCallback(r,i,s){return o=>{e.matchEventFullKeyCode(o,r)&&s.runGuarded(()=>i(o))}}static _normalizeKey(r){return"esc"===r?"escape":r}static{this.\u0275fac=function(i){return new(i||e)(q(an))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})();const KN=[{provide:os,useValue:xN},{provide:nT,useValue:function zq(){h_.makeCurrent()},multi:!0},{provide:an,useFactory:function Gq(){return function h8(e){ky=e}(document),document},deps:[]}],Wq=xM($z,"browser",KN),Zq=new z(""),QN=[{provide:Nh,useClass:class Mq{addToWindow(t){ct.getAngularTestability=(i,s=!0)=>{const o=t.findTestabilityInTree(i,s);if(null==o)throw new A(5103,!1);return o},ct.getAllAngularTestabilities=()=>t.getAllTestabilities(),ct.getAllAngularRootElements=()=>t.getAllRootElements(),ct.frameworkStabilizers||(ct.frameworkStabilizers=[]),ct.frameworkStabilizers.push(i=>{const s=ct.getAllAngularTestabilities();let o=s.length;const a=function(){o--,0==o&&i()};s.forEach(c=>{c.whenStable(a)})})}findTestabilityInTree(t,r,i){return null==r?null:t.getTestability(r)??(i?ps().isShadowRoot(r)?this.findTestabilityInTree(t,r.host,!0):this.findTestabilityInTree(t,r.parentElement,!0):null)}},deps:[]},{provide:pM,useClass:R0,deps:[Ne,O0,Nh]},{provide:R0,useClass:R0,deps:[Ne,O0,Nh]}],YN=[{provide:Gm,useValue:"root"},{provide:nr,useFactory:function qq(){return new nr},deps:[]},{provide:p_,useClass:Uq,multi:!0,deps:[an,Ne,os]},{provide:p_,useClass:Hq,multi:!0,deps:[an]},v_,$N,UN,{provide:rh,useExisting:v_},{provide:class X7{},useClass:Nq,deps:[]},[]];let JN=(()=>{class e{constructor(r){}static withServerTransition(r){return{ngModule:e,providers:[{provide:ya,useValue:r.appId}]}}static{this.\u0275fac=function(i){return new(i||e)(q(Zq,12))}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({providers:[...YN,...QN],imports:[gs,Hz]})}}return e})(),Kq=(()=>{class e{constructor(r){this._doc=r}getTitle(){return this._doc.title}setTitle(r){this._doc.title=r||""}static{this.\u0275fac=function(i){return new(i||e)(q(an))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),tR=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:function(i){let s=null;return s=i?new(i||e):q(Xq),s},providedIn:"root"})}}return e})(),Xq=(()=>{class e extends tR{constructor(r){super(),this._doc=r}sanitize(r,i){if(null==i)return null;switch(r){case $n.NONE:return i;case $n.HTML:return Gr(i,"HTML")?jn(i):IT(this._doc,String(i)).toString();case $n.STYLE:return Gr(i,"Style")?jn(i):i;case $n.SCRIPT:if(Gr(i,"Script"))return jn(i);throw new A(5200,!1);case $n.URL:return Gr(i,"URL")?jn(i):Vf(String(i));case $n.RESOURCE_URL:if(Gr(i,"ResourceURL"))return jn(i);throw new A(5201,!1);default:throw new A(5202,!1)}}bypassSecurityTrustHtml(r){return function k8(e){return new x8(e)}(r)}bypassSecurityTrustStyle(r){return function P8(e){return new A8(e)}(r)}bypassSecurityTrustScript(r){return function L8(e){return new M8(e)}(r)}bypassSecurityTrustUrl(r){return function F8(e){return new N8(e)}(r)}bypassSecurityTrustResourceUrl(r){return function B8(e){return new R8(e)}(r)}static{this.\u0275fac=function(i){return new(i||e)(q(an))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function ms(e){return this instanceof ms?(this.v=e,this):new ms(e)}function sR(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,t=e[Symbol.asyncIterator];return t?t.call(e):(e=function D_(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(o){r[o]=e[o]&&function(a){return new Promise(function(c,l){!function s(o,a,c,l){Promise.resolve(l).then(function(u){o({value:u,done:c})},a)}(c,l,(a=e[o](a)).done,a.value)})}}}"function"==typeof SuppressedError&&SuppressedError;const oR=e=>e&&"number"==typeof e.length&&"function"!=typeof e;function aR(e){return at(e?.then)}function cR(e){return at(e[Cm])}function lR(e){return Symbol.asyncIterator&&at(e?.[Symbol.asyncIterator])}function uR(e){return new TypeError(`You provided ${null!==e&&"object"==typeof e?"an invalid object":`'${e}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}const dR=function IG(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}();function fR(e){return at(e?.[dR])}function hR(e){return function iR(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s,i=r.apply(e,t||[]),o=[];return s=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),c("next"),c("throw"),c("return",function a(p){return function(g){return Promise.resolve(g).then(p,f)}}),s[Symbol.asyncIterator]=function(){return this},s;function c(p,g){i[p]&&(s[p]=function(m){return new Promise(function(y,_){o.push([p,m,y,_])>1||l(p,m)})},g&&(s[p]=g(s[p])))}function l(p,g){try{!function u(p){p.value instanceof ms?Promise.resolve(p.value.v).then(d,f):h(o[0][2],p)}(i[p](g))}catch(m){h(o[0][3],m)}}function d(p){l("next",p)}function f(p){l("throw",p)}function h(p,g){p(g),o.shift(),o.length&&l(o[0][0],o[0][1])}}(this,arguments,function*(){const r=e.getReader();try{for(;;){const{value:i,done:s}=yield ms(r.read());if(s)return yield ms(void 0);yield yield ms(i)}}finally{r.releaseLock()}})}function pR(e){return at(e?.getReader)}function Tr(e){if(e instanceof Ht)return e;if(null!=e){if(cR(e))return function xG(e){return new Ht(t=>{const r=e[Cm]();if(at(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(e);if(oR(e))return function AG(e){return new Ht(t=>{for(let r=0;r{e.then(r=>{t.closed||(t.next(r),t.complete())},r=>t.error(r)).then(null,KC)})}(e);if(lR(e))return gR(e);if(fR(e))return function NG(e){return new Ht(t=>{for(const r of e)if(t.next(r),t.closed)return;t.complete()})}(e);if(pR(e))return function RG(e){return gR(hR(e))}(e)}throw uR(e)}function gR(e){return new Ht(t=>{(function OG(e,t){var r,i,s,o;return function nR(e,t,r,i){return new(r||(r=Promise))(function(o,a){function c(d){try{u(i.next(d))}catch(f){a(f)}}function l(d){try{u(i.throw(d))}catch(f){a(f)}}function u(d){d.done?o(d.value):function s(o){return o instanceof r?o:new r(function(a){a(o)})}(d.value).then(c,l)}u((i=i.apply(e,t||[])).next())})}(this,void 0,void 0,function*(){try{for(r=sR(e);!(i=yield r.next()).done;)if(t.next(i.value),t.closed)return}catch(a){s={error:a}}finally{try{i&&!i.done&&(o=r.return)&&(yield o.call(r))}finally{if(s)throw s.error}}t.complete()})})(e,t).catch(r=>t.error(r))})}function ti(e,t,r,i=0,s=!1){const o=t.schedule(function(){r(),s?e.add(this.schedule(null,i)):this.unsubscribe()},i);if(e.add(o),!s)return o}function mR(e,t=0){return zt((r,i)=>{r.subscribe(Dt(i,s=>ti(i,e,()=>i.next(s),t),()=>ti(i,e,()=>i.complete(),t),s=>ti(i,e,()=>i.error(s),t)))})}function yR(e,t=0){return zt((r,i)=>{i.add(e.schedule(()=>r.subscribe(i),t))})}function vR(e,t){if(!e)throw new Error("Iterable cannot be null");return new Ht(r=>{ti(r,t,()=>{const i=e[Symbol.asyncIterator]();ti(r,t,()=>{i.next().then(s=>{s.done?r.complete():r.next(s.value)})},0,!0)})})}function Gt(e,t){return t?function VG(e,t){if(null!=e){if(cR(e))return function kG(e,t){return Tr(e).pipe(yR(t),mR(t))}(e,t);if(oR(e))return function LG(e,t){return new Ht(r=>{let i=0;return t.schedule(function(){i===e.length?r.complete():(r.next(e[i++]),r.closed||this.schedule())})})}(e,t);if(aR(e))return function PG(e,t){return Tr(e).pipe(yR(t),mR(t))}(e,t);if(lR(e))return vR(e,t);if(fR(e))return function FG(e,t){return new Ht(r=>{let i;return ti(r,t,()=>{i=e[dR](),ti(r,t,()=>{let s,o;try{({value:s,done:o}=i.next())}catch(a){return void r.error(a)}o?r.complete():r.next(s)},0,!0)}),()=>at(i?.return)&&i.return()})}(e,t);if(pR(e))return function BG(e,t){return vR(hR(e),t)}(e,t)}throw uR(e)}(e,t):Tr(e)}function T_(e){return e[e.length-1]}function _R(e){return at(T_(e))?e.pop():void 0}function cp(e){return function UG(e){return e&&at(e.schedule)}(T_(e))?e.pop():void 0}function he(...e){return Gt(e,cp(e))}const{isArray:jG}=Array,{getPrototypeOf:$G,prototype:HG,keys:zG}=Object;function wR(e){if(1===e.length){const t=e[0];if(jG(t))return{args:t,keys:null};if(function qG(e){return e&&"object"==typeof e&&$G(e)===HG}(t)){const r=zG(t);return{args:r.map(i=>t[i]),keys:r}}}return{args:e,keys:null}}const{isArray:GG}=Array;function bR(e){return Ue(t=>function WG(e,t){return GG(t)?e(...t):e(t)}(e,t))}function ER(e,t){return e.reduce((r,i,s)=>(r[i]=t[s],r),{})}function I_(...e){const t=cp(e),r=_R(e),{args:i,keys:s}=wR(e);if(0===i.length)return Gt([],t);const o=new Ht(function ZG(e,t,r=Zs){return i=>{CR(t,()=>{const{length:s}=e,o=new Array(s);let a=s,c=s;for(let l=0;l{const u=Gt(e[l],t);let d=!1;u.subscribe(Dt(i,f=>{o[l]=f,d||(d=!0,c--),c||i.next(r(o.slice()))},()=>{--a||i.complete()}))},i)},i)}}(i,t,s?a=>ER(s,a):Zs));return r?o.pipe(bR(r)):o}function CR(e,t,r){e?ti(r,e,t):t()}const lp=Fd(e=>function(){e(this),this.name="EmptyError",this.message="no elements in sequence"});function cn(e,t,r=1/0){return at(t)?cn((i,s)=>Ue((o,a)=>t(i,o,s,a))(Tr(e(i,s))),r):("number"==typeof t&&(r=t),zt((i,s)=>function KG(e,t,r,i,s,o,a,c){const l=[];let u=0,d=0,f=!1;const h=()=>{f&&!l.length&&!u&&t.complete()},p=m=>u{o&&t.next(m),u++;let y=!1;Tr(r(m,d++)).subscribe(Dt(t,_=>{s?.(_),o?p(_):t.next(_)},()=>{y=!0},void 0,()=>{if(y)try{for(u--;l.length&&ug(_)):g(_)}h()}catch(_){t.error(_)}}))};return e.subscribe(Dt(t,p,()=>{f=!0,h()})),()=>{c?.()}}(i,s,e,r)))}function wu(e=1/0){return cn(Zs,e)}function x_(...e){return function QG(){return wu(1)}()(Gt(e,cp(e)))}function DR(e){return new Ht(t=>{Tr(e()).subscribe(t)})}function nc(e,t){const r=at(e)?e:()=>e,i=s=>s.error(r());return new Ht(t?s=>t.schedule(i,0,s):i)}const ni=new Ht(e=>e.complete());function A_(){return zt((e,t)=>{let r=null;e._refCount++;const i=Dt(t,void 0,void 0,void 0,()=>{if(!e||e._refCount<=0||0<--e._refCount)return void(r=null);const s=e._connection,o=r;r=null,s&&(!o||s===o)&&s.unsubscribe(),t.unsubscribe()});e.subscribe(i),i.closed||(r=e.connect())})}class SR extends Ht{constructor(t,r){super(),this.source=t,this.subjectFactory=r,this._subject=null,this._refCount=0,this._connection=null,XC(t)&&(this.lift=t.lift)}_subscribe(t){return this.getSubject().subscribe(t)}getSubject(){const t=this._subject;return(!t||t.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;const{_connection:t}=this;this._subject=this._connection=null,t?.unsubscribe()}connect(){let t=this._connection;if(!t){t=this._connection=new vt;const r=this.getSubject();t.add(this.source.subscribe(Dt(r,void 0,()=>{this._teardown(),r.complete()},i=>{this._teardown(),r.error(i)},()=>this._teardown()))),t.closed&&(this._connection=null,t=vt.EMPTY)}return t}refCount(){return A_()(this)}}function ri(e,t){return zt((r,i)=>{let s=null,o=0,a=!1;const c=()=>a&&!s&&i.complete();r.subscribe(Dt(i,l=>{s?.unsubscribe();let u=0;const d=o++;Tr(e(l,d)).subscribe(s=Dt(i,f=>i.next(t?t(l,f,d,u++):f),()=>{s=null,c()}))},()=>{a=!0,c()}))})}function rc(e){return e<=0?()=>ni:zt((t,r)=>{let i=0;t.subscribe(Dt(r,s=>{++i<=e&&(r.next(s),e<=i&&r.complete())}))})}function Li(e,t){return zt((r,i)=>{let s=0;r.subscribe(Dt(i,o=>e.call(t,o,s++)&&i.next(o)))})}function up(e){return zt((t,r)=>{let i=!1;t.subscribe(Dt(r,s=>{i=!0,r.next(s)},()=>{i||r.next(e),r.complete()}))})}function TR(e=XG){return zt((t,r)=>{let i=!1;t.subscribe(Dt(r,s=>{i=!0,r.next(s)},()=>i?r.complete():r.error(e())))})}function XG(){return new lp}function ys(e,t){const r=arguments.length>=2;return i=>i.pipe(e?Li((s,o)=>e(s,o,i)):Zs,rc(1),r?up(t):TR(()=>new lp))}function bu(e,t){return at(t)?cn(e,t,1):cn(e,1)}function wn(e,t,r){const i=at(e)||t||r?{next:e,error:t,complete:r}:e;return i?zt((s,o)=>{var a;null===(a=i.subscribe)||void 0===a||a.call(i);let c=!0;s.subscribe(Dt(o,l=>{var u;null===(u=i.next)||void 0===u||u.call(i,l),o.next(l)},()=>{var l;c=!1,null===(l=i.complete)||void 0===l||l.call(i),o.complete()},l=>{var u;c=!1,null===(u=i.error)||void 0===u||u.call(i,l),o.error(l)},()=>{var l,u;c&&(null===(l=i.unsubscribe)||void 0===l||l.call(i)),null===(u=i.finalize)||void 0===u||u.call(i)}))}):Zs}function vs(e){return zt((t,r)=>{let o,i=null,s=!1;i=t.subscribe(Dt(r,void 0,void 0,a=>{o=Tr(e(a,vs(e)(t))),i?(i.unsubscribe(),i=null,o.subscribe(r)):s=!0})),s&&(i.unsubscribe(),i=null,o.subscribe(r))})}function M_(e){return e<=0?()=>ni:zt((t,r)=>{let i=[];t.subscribe(Dt(r,s=>{i.push(s),e{for(const s of i)r.next(s);r.complete()},void 0,()=>{i=null}))})}function Eu(e){return zt((t,r)=>{try{t.subscribe(r)}finally{r.add(e)}})}const ve="primary",Cu=Symbol("RouteTitle");class sW{constructor(t){this.params=t||{}}has(t){return Object.prototype.hasOwnProperty.call(this.params,t)}get(t){if(this.has(t)){const r=this.params[t];return Array.isArray(r)?r[0]:r}return null}getAll(t){if(this.has(t)){const r=this.params[t];return Array.isArray(r)?r:[r]}return[]}get keys(){return Object.keys(this.params)}}function ic(e){return new sW(e)}function oW(e,t,r){const i=r.path.split("/");if(i.length>e.length||"full"===r.pathMatch&&(t.hasChildren()||i.lengthi[o]===s)}return e===t}function xR(e){return e.length>0?e[e.length-1]:null}function _s(e){return function eG(e){return!!e&&(e instanceof Ht||at(e.lift)&&at(e.subscribe))}(e)?e:cu(e)?Gt(Promise.resolve(e)):he(e)}const cW={exact:function NR(e,t,r){if(!Do(e.segments,t.segments)||!dp(e.segments,t.segments,r)||e.numberOfChildren!==t.numberOfChildren)return!1;for(const i in t.children)if(!e.children[i]||!NR(e.children[i],t.children[i],r))return!1;return!0},subset:RR},AR={exact:function lW(e,t){return ii(e,t)},subset:function uW(e,t){return Object.keys(t).length<=Object.keys(e).length&&Object.keys(t).every(r=>IR(e[r],t[r]))},ignored:()=>!0};function MR(e,t,r){return cW[r.paths](e.root,t.root,r.matrixParams)&&AR[r.queryParams](e.queryParams,t.queryParams)&&!("exact"===r.fragment&&e.fragment!==t.fragment)}function RR(e,t,r){return OR(e,t,t.segments,r)}function OR(e,t,r,i){if(e.segments.length>r.length){const s=e.segments.slice(0,r.length);return!(!Do(s,r)||t.hasChildren()||!dp(s,r,i))}if(e.segments.length===r.length){if(!Do(e.segments,r)||!dp(e.segments,r,i))return!1;for(const s in t.children)if(!e.children[s]||!RR(e.children[s],t.children[s],i))return!1;return!0}{const s=r.slice(0,e.segments.length),o=r.slice(e.segments.length);return!!(Do(e.segments,s)&&dp(e.segments,s,i)&&e.children[ve])&&OR(e.children[ve],t,o,i)}}function dp(e,t,r){return t.every((i,s)=>AR[r](e[s].parameters,i.parameters))}class Co{constructor(t=new Ge([],{}),r={},i=null){this.root=t,this.queryParams=r,this.fragment=i}get queryParamMap(){return this._queryParamMap??=ic(this.queryParams),this._queryParamMap}toString(){return hW.serialize(this)}}class Ge{constructor(t,r){this.segments=t,this.children=r,this.parent=null,Object.values(r).forEach(i=>i.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return hp(this)}}class Du{constructor(t,r){this.path=t,this.parameters=r}get parameterMap(){return this._parameterMap??=ic(this.parameters),this._parameterMap}toString(){return LR(this)}}function Do(e,t){return e.length===t.length&&e.every((r,i)=>r.path===t[i].path)}let sc=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:()=>new fp,providedIn:"root"})}}return e})();class fp{parse(t){const r=new DW(t);return new Co(r.parseRootSegment(),r.parseQueryParams(),r.parseFragment())}serialize(t){const r=`/${Su(t.root,!0)}`,i=function mW(e){const t=Object.entries(e).map(([r,i])=>Array.isArray(i)?i.map(s=>`${pp(r)}=${pp(s)}`).join("&"):`${pp(r)}=${pp(i)}`).filter(r=>r);return t.length?`?${t.join("&")}`:""}(t.queryParams);return`${r}${i}${"string"==typeof t.fragment?`#${function pW(e){return encodeURI(e)}(t.fragment)}`:""}`}}const hW=new fp;function hp(e){return e.segments.map(t=>LR(t)).join("/")}function Su(e,t){if(!e.hasChildren())return hp(e);if(t){const r=e.children[ve]?Su(e.children[ve],!1):"",i=[];return Object.entries(e.children).forEach(([s,o])=>{s!==ve&&i.push(`${s}:${Su(o,!1)}`)}),i.length>0?`${r}(${i.join("//")})`:r}{const r=function fW(e,t){let r=[];return Object.entries(e.children).forEach(([i,s])=>{i===ve&&(r=r.concat(t(s,i)))}),Object.entries(e.children).forEach(([i,s])=>{i!==ve&&(r=r.concat(t(s,i)))}),r}(e,(i,s)=>s===ve?[Su(e.children[ve],!1)]:[`${s}:${Su(i,!1)}`]);return 1===Object.keys(e.children).length&&null!=e.children[ve]?`${hp(e)}/${r[0]}`:`${hp(e)}/(${r.join("//")})`}}function kR(e){return encodeURIComponent(e).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function pp(e){return kR(e).replace(/%3B/gi,";")}function R_(e){return kR(e).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function gp(e){return decodeURIComponent(e)}function PR(e){return gp(e.replace(/\+/g,"%20"))}function LR(e){return`${R_(e.path)}${function gW(e){return Object.entries(e).map(([t,r])=>`;${R_(t)}=${R_(r)}`).join("")}(e.parameters)}`}const yW=/^[^\/()?;#]+/;function O_(e){const t=e.match(yW);return t?t[0]:""}const vW=/^[^\/()?;=#]+/,wW=/^[^=?&#]+/,EW=/^[^&#]+/;class DW{constructor(t){this.url=t,this.remaining=t}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new Ge([],{}):new Ge([],this.parseChildren())}parseQueryParams(){const t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());let r={};this.peekStartsWith("/(")&&(this.capture("/"),r=this.parseParens(!0));let i={};return this.peekStartsWith("(")&&(i=this.parseParens(!1)),(t.length>0||Object.keys(r).length>0)&&(i[ve]=new Ge(t,r)),i}parseSegment(){const t=O_(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new A(4009,!1);return this.capture(t),new Du(gp(t),this.parseMatrixParams())}parseMatrixParams(){const t={};for(;this.consumeOptional(";");)this.parseParam(t);return t}parseParam(t){const r=function _W(e){const t=e.match(vW);return t?t[0]:""}(this.remaining);if(!r)return;this.capture(r);let i="";if(this.consumeOptional("=")){const s=O_(this.remaining);s&&(i=s,this.capture(i))}t[gp(r)]=gp(i)}parseQueryParam(t){const r=function bW(e){const t=e.match(wW);return t?t[0]:""}(this.remaining);if(!r)return;this.capture(r);let i="";if(this.consumeOptional("=")){const a=function CW(e){const t=e.match(EW);return t?t[0]:""}(this.remaining);a&&(i=a,this.capture(i))}const s=PR(r),o=PR(i);if(t.hasOwnProperty(s)){let a=t[s];Array.isArray(a)||(a=[a],t[s]=a),a.push(o)}else t[s]=o}parseParens(t){const r={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const i=O_(this.remaining),s=this.remaining[i.length];if("/"!==s&&")"!==s&&";"!==s)throw new A(4010,!1);let o;i.indexOf(":")>-1?(o=i.slice(0,i.indexOf(":")),this.capture(o),this.capture(":")):t&&(o=ve);const a=this.parseChildren();r[o]=1===Object.keys(a).length?a[ve]:new Ge([],a),this.consumeOptional("//")}return r}peekStartsWith(t){return this.remaining.startsWith(t)}consumeOptional(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)}capture(t){if(!this.consumeOptional(t))throw new A(4011,!1)}}function FR(e){return e.segments.length>0?new Ge([],{[ve]:e}):e}function BR(e){const t={};for(const[i,s]of Object.entries(e.children)){const o=BR(s);if(i===ve&&0===o.segments.length&&o.hasChildren())for(const[a,c]of Object.entries(o.children))t[a]=c;else(o.segments.length>0||o.hasChildren())&&(t[i]=o)}return function SW(e){if(1===e.numberOfChildren&&e.children[ve]){const t=e.children[ve];return new Ge(e.segments.concat(t.segments),t.children)}return e}(new Ge(e.segments,t))}function So(e){return e instanceof Co}function VR(e){let t;const s=FR(function r(o){const a={};for(const l of o.children){const u=r(l);a[l.outlet]=u}const c=new Ge(o.url,a);return o===e&&(t=c),c}(e.root));return t??s}function UR(e,t,r,i){let s=e;for(;s.parent;)s=s.parent;if(0===t.length)return k_(s,s,s,r,i);const o=function IW(e){if("string"==typeof e[0]&&1===e.length&&"/"===e[0])return new $R(!0,0,e);let t=0,r=!1;const i=e.reduce((s,o,a)=>{if("object"==typeof o&&null!=o){if(o.outlets){const c={};return Object.entries(o.outlets).forEach(([l,u])=>{c[l]="string"==typeof u?u.split("/"):u}),[...s,{outlets:c}]}if(o.segmentPath)return[...s,o.segmentPath]}return"string"!=typeof o?[...s,o]:0===a?(o.split("/").forEach((c,l)=>{0==l&&"."===c||(0==l&&""===c?r=!0:".."===c?t++:""!=c&&s.push(c))}),s):[...s,o]},[]);return new $R(r,t,i)}(t);if(o.toRoot())return k_(s,s,new Ge([],{}),r,i);const a=function xW(e,t,r){if(e.isAbsolute)return new yp(t,!0,0);if(!r)return new yp(t,!1,NaN);if(null===r.parent)return new yp(r,!0,0);const i=mp(e.commands[0])?0:1;return function AW(e,t,r){let i=e,s=t,o=r;for(;o>s;){if(o-=s,i=i.parent,!i)throw new A(4005,!1);s=i.segments.length}return new yp(i,!1,s-o)}(r,r.segments.length-1+i,e.numberOfDoubleDots)}(o,s,e),c=a.processChildren?Iu(a.segmentGroup,a.index,o.commands):HR(a.segmentGroup,a.index,o.commands);return k_(s,a.segmentGroup,c,r,i)}function mp(e){return"object"==typeof e&&null!=e&&!e.outlets&&!e.segmentPath}function Tu(e){return"object"==typeof e&&null!=e&&e.outlets}function k_(e,t,r,i,s){let a,o={};i&&Object.entries(i).forEach(([l,u])=>{o[l]=Array.isArray(u)?u.map(d=>`${d}`):`${u}`}),a=e===t?r:jR(e,t,r);const c=FR(BR(a));return new Co(c,o,s)}function jR(e,t,r){const i={};return Object.entries(e.children).forEach(([s,o])=>{i[s]=o===t?r:jR(o,t,r)}),new Ge(e.segments,i)}class $R{constructor(t,r,i){if(this.isAbsolute=t,this.numberOfDoubleDots=r,this.commands=i,t&&i.length>0&&mp(i[0]))throw new A(4003,!1);const s=i.find(Tu);if(s&&s!==xR(i))throw new A(4004,!1)}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class yp{constructor(t,r,i){this.segmentGroup=t,this.processChildren=r,this.index=i}}function HR(e,t,r){if(e??=new Ge([],{}),0===e.segments.length&&e.hasChildren())return Iu(e,t,r);const i=function NW(e,t,r){let i=0,s=t;const o={match:!1,pathIndex:0,commandIndex:0};for(;s=r.length)return o;const a=e.segments[s],c=r[i];if(Tu(c))break;const l=`${c}`,u=i0&&void 0===l)break;if(l&&u&&"object"==typeof u&&void 0===u.outlets){if(!qR(l,u,a))return o;i+=2}else{if(!qR(l,{},a))return o;i++}s++}return{match:!0,pathIndex:s,commandIndex:i}}(e,t,r),s=r.slice(i.commandIndex);if(i.match&&i.pathIndexo!==ve)&&e.children[ve]&&1===e.numberOfChildren&&0===e.children[ve].segments.length){const o=Iu(e.children[ve],t,r);return new Ge(e.segments,o.children)}return Object.entries(i).forEach(([o,a])=>{"string"==typeof a&&(a=[a]),null!==a&&(s[o]=HR(e.children[o],t,a))}),Object.entries(e.children).forEach(([o,a])=>{void 0===i[o]&&(s[o]=a)}),new Ge(e.segments,s)}}function P_(e,t,r){const i=e.segments.slice(0,t);let s=0;for(;s{"string"==typeof i&&(i=[i]),null!==i&&(t[r]=P_(new Ge([],{}),0,i))}),t}function zR(e){const t={};return Object.entries(e).forEach(([r,i])=>t[r]=`${i}`),t}function qR(e,t,r){return e==r.path&&ii(t,r.parameters)}const xu="imperative";var Me=function(e){return e[e.NavigationStart=0]="NavigationStart",e[e.NavigationEnd=1]="NavigationEnd",e[e.NavigationCancel=2]="NavigationCancel",e[e.NavigationError=3]="NavigationError",e[e.RoutesRecognized=4]="RoutesRecognized",e[e.ResolveStart=5]="ResolveStart",e[e.ResolveEnd=6]="ResolveEnd",e[e.GuardsCheckStart=7]="GuardsCheckStart",e[e.GuardsCheckEnd=8]="GuardsCheckEnd",e[e.RouteConfigLoadStart=9]="RouteConfigLoadStart",e[e.RouteConfigLoadEnd=10]="RouteConfigLoadEnd",e[e.ChildActivationStart=11]="ChildActivationStart",e[e.ChildActivationEnd=12]="ChildActivationEnd",e[e.ActivationStart=13]="ActivationStart",e[e.ActivationEnd=14]="ActivationEnd",e[e.Scroll=15]="Scroll",e[e.NavigationSkipped=16]="NavigationSkipped",e}(Me||{});class si{constructor(t,r){this.id=t,this.url=r}}class Au extends si{constructor(t,r,i="imperative",s=null){super(t,r),this.type=Me.NavigationStart,this.navigationTrigger=i,this.restoredState=s}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class Fi extends si{constructor(t,r,i){super(t,r),this.urlAfterRedirects=i,this.type=Me.NavigationEnd}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}var Wn=function(e){return e[e.Redirect=0]="Redirect",e[e.SupersededByNewNavigation=1]="SupersededByNewNavigation",e[e.NoDataFromResolver=2]="NoDataFromResolver",e[e.GuardRejected=3]="GuardRejected",e}(Wn||{}),vp=function(e){return e[e.IgnoredSameUrlNavigation=0]="IgnoredSameUrlNavigation",e[e.IgnoredByUrlHandlingStrategy=1]="IgnoredByUrlHandlingStrategy",e}(vp||{});class To extends si{constructor(t,r,i,s){super(t,r),this.reason=i,this.code=s,this.type=Me.NavigationCancel}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class oc extends si{constructor(t,r,i,s){super(t,r),this.reason=i,this.code=s,this.type=Me.NavigationSkipped}}class L_ extends si{constructor(t,r,i,s){super(t,r),this.error=i,this.target=s,this.type=Me.NavigationError}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class GR extends si{constructor(t,r,i,s){super(t,r),this.urlAfterRedirects=i,this.state=s,this.type=Me.RoutesRecognized}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class OW extends si{constructor(t,r,i,s){super(t,r),this.urlAfterRedirects=i,this.state=s,this.type=Me.GuardsCheckStart}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class kW extends si{constructor(t,r,i,s,o){super(t,r),this.urlAfterRedirects=i,this.state=s,this.shouldActivate=o,this.type=Me.GuardsCheckEnd}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class PW extends si{constructor(t,r,i,s){super(t,r),this.urlAfterRedirects=i,this.state=s,this.type=Me.ResolveStart}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class LW extends si{constructor(t,r,i,s){super(t,r),this.urlAfterRedirects=i,this.state=s,this.type=Me.ResolveEnd}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class FW{constructor(t){this.route=t,this.type=Me.RouteConfigLoadStart}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class BW{constructor(t){this.route=t,this.type=Me.RouteConfigLoadEnd}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class VW{constructor(t){this.snapshot=t,this.type=Me.ChildActivationStart}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class UW{constructor(t){this.snapshot=t,this.type=Me.ChildActivationEnd}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class jW{constructor(t){this.snapshot=t,this.type=Me.ActivationStart}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class $W{constructor(t){this.snapshot=t,this.type=Me.ActivationEnd}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class WR{constructor(t,r,i){this.routerEvent=t,this.position=r,this.anchor=i,this.type=Me.Scroll}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}class F_{}class _p{constructor(t,r){this.url=t,this.navigationBehaviorOptions=r}}function Ir(e){return e.outlet||ve}function Mu(e){if(!e)return null;if(e.routeConfig?._injector)return e.routeConfig._injector;for(let t=e.parent;t;t=t.parent){const r=t.routeConfig;if(r?._loadedInjector)return r._loadedInjector;if(r?._injector)return r._injector}return null}class ZW{get injector(){return Mu(this.route?.snapshot)??this.rootInjector}set injector(t){}constructor(t){this.rootInjector=t,this.outlet=null,this.route=null,this.children=new Nu(this.rootInjector),this.attachRef=null}}let Nu=(()=>{class e{constructor(r){this.rootInjector=r,this.contexts=new Map}onChildOutletCreated(r,i){const s=this.getOrCreateContext(r);s.outlet=i,this.contexts.set(r,s)}onChildOutletDestroyed(r){const i=this.getContext(r);i&&(i.outlet=null,i.attachRef=null)}onOutletDeactivated(){const r=this.contexts;return this.contexts=new Map,r}onOutletReAttached(r){this.contexts=r}getOrCreateContext(r){let i=this.getContext(r);return i||(i=new ZW(this.rootInjector),this.contexts.set(r,i)),i}getContext(r){return this.contexts.get(r)||null}static{this.\u0275fac=function(i){return new(i||e)(q(In))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();class ZR{constructor(t){this._root=t}get root(){return this._root.value}parent(t){const r=this.pathFromRoot(t);return r.length>1?r[r.length-2]:null}children(t){const r=B_(t,this._root);return r?r.children.map(i=>i.value):[]}firstChild(t){const r=B_(t,this._root);return r&&r.children.length>0?r.children[0].value:null}siblings(t){const r=V_(t,this._root);return r.length<2?[]:r[r.length-2].children.map(s=>s.value).filter(s=>s!==t)}pathFromRoot(t){return V_(t,this._root).map(r=>r.value)}}function B_(e,t){if(e===t.value)return t;for(const r of t.children){const i=B_(e,r);if(i)return i}return null}function V_(e,t){if(e===t.value)return[t];for(const r of t.children){const i=V_(e,r);if(i.length)return i.unshift(t),i}return[]}class xr{constructor(t,r){this.value=t,this.children=r}toString(){return`TreeNode(${this.value})`}}function ac(e){const t={};return e&&e.children.forEach(r=>t[r.value.outlet]=r),t}class KR extends ZR{constructor(t,r){super(t),this.snapshot=r,U_(this,t)}toString(){return this.snapshot.toString()}}function QR(e){const t=function KW(e){const o=new bp([],{},{},"",{},ve,e,null,{});return new YR("",new xr(o,[]))}(e),r=new Jn([new Du("",{})]),i=new Jn({}),s=new Jn({}),o=new Jn({}),a=new Jn(""),c=new cc(r,i,o,a,s,ve,e,t.root);return c.snapshot=t.root,new KR(new xr(c,[]),t)}class cc{constructor(t,r,i,s,o,a,c,l){this.urlSubject=t,this.paramsSubject=r,this.queryParamsSubject=i,this.fragmentSubject=s,this.dataSubject=o,this.outlet=a,this.component=c,this._futureSnapshot=l,this.title=this.dataSubject?.pipe(Ue(u=>u[Cu]))??he(void 0),this.url=t,this.params=r,this.queryParams=i,this.fragment=s,this.data=o}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=this.params.pipe(Ue(t=>ic(t))),this._paramMap}get queryParamMap(){return this._queryParamMap??=this.queryParams.pipe(Ue(t=>ic(t))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function wp(e,t,r="emptyOnly"){let i;const{routeConfig:s}=e;return i=null===t||"always"!==r&&""!==s?.path&&(t.component||t.routeConfig?.loadComponent)?{params:{...e.params},data:{...e.data},resolve:{...e.data,...e._resolvedData??{}}}:{params:{...t.params,...e.params},data:{...t.data,...e.data},resolve:{...e.data,...t.data,...s?.data,...e._resolvedData}},s&&XR(s)&&(i.resolve[Cu]=s.title),i}class bp{get title(){return this.data?.[Cu]}constructor(t,r,i,s,o,a,c,l,u){this.url=t,this.params=r,this.queryParams=i,this.fragment=s,this.data=o,this.outlet=a,this.component=c,this.routeConfig=l,this._resolve=u}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=ic(this.params),this._paramMap}get queryParamMap(){return this._queryParamMap??=ic(this.queryParams),this._queryParamMap}toString(){return`Route(url:'${this.url.map(i=>i.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class YR extends ZR{constructor(t,r){super(r),this.url=t,U_(this,r)}toString(){return JR(this._root)}}function U_(e,t){t.value._routerState=e,t.children.forEach(r=>U_(e,r))}function JR(e){const t=e.children.length>0?` { ${e.children.map(JR).join(", ")} } `:"";return`${e.value}${t}`}function j_(e){if(e.snapshot){const t=e.snapshot,r=e._futureSnapshot;e.snapshot=r,ii(t.queryParams,r.queryParams)||e.queryParamsSubject.next(r.queryParams),t.fragment!==r.fragment&&e.fragmentSubject.next(r.fragment),ii(t.params,r.params)||e.paramsSubject.next(r.params),function aW(e,t){if(e.length!==t.length)return!1;for(let r=0;rii(r.parameters,t[i].parameters))}(e.url,t.url);return r&&!(!e.parent!=!t.parent)&&(!e.parent||$_(e.parent,t.parent))}function XR(e){return"string"==typeof e.title||null===e.title}let H_=(()=>{class e{constructor(){this.activated=null,this._activatedRoute=null,this.name=ve,this.activateEvents=new dt,this.deactivateEvents=new dt,this.attachEvents=new dt,this.detachEvents=new dt,this.parentContexts=O(Nu),this.location=O(rr),this.changeDetector=O(uu),this.inputBinder=O(Ep,{optional:!0}),this.supportsBindingToComponentInputs=!0}get activatedComponentRef(){return this.activated}ngOnChanges(r){if(r.name){const{firstChange:i,previousValue:s}=r.name;if(i)return;this.isTrackedInParentContexts(s)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(s)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(r){return this.parentContexts.getContext(r)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;const r=this.parentContexts.getContext(this.name);r?.route&&(r.attachRef?this.attach(r.attachRef,r.route):this.activateWith(r.route,r.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new A(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new A(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new A(4012,!1);this.location.detach();const r=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(r.instance),r}attach(r,i){this.activated=r,this._activatedRoute=i,this.location.insert(r.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(r.instance)}deactivate(){if(this.activated){const r=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(r)}}activateWith(r,i){if(this.isActivated)throw new A(4013,!1);this._activatedRoute=r;const s=this.location,a=r.snapshot.component,c=this.parentContexts.getOrCreateContext(this.name).children,l=new z_(r,c,s.injector);this.activated=s.createComponent(a,{index:s.length,injector:l,environmentInjector:i}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275dir=de({type:e,selectors:[["router-outlet"]],inputs:{name:"name"},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],standalone:!0,features:[er]})}}return e})();class z_{__ngOutletInjector(t){return new z_(this.route,this.childContexts,t)}constructor(t,r,i){this.route=t,this.childContexts=r,this.parent=i}get(t,r){return t===cc?this.route:t===Nu?this.childContexts:this.parent.get(t,r)}}const Ep=new z("");let eO=(()=>{class e{constructor(){this.outletDataSubscriptions=new Map}bindActivatedRouteToOutletComponent(r){this.unsubscribeFromRouteData(r),this.subscribeToRouteData(r)}unsubscribeFromRouteData(r){this.outletDataSubscriptions.get(r)?.unsubscribe(),this.outletDataSubscriptions.delete(r)}subscribeToRouteData(r){const{activatedRoute:i}=r,s=I_([i.queryParams,i.params,i.data]).pipe(ri(([o,a,c],l)=>(c={...o,...a,...c},0===l?he(c):Promise.resolve(c)))).subscribe(o=>{if(!r.isActivated||!r.activatedComponentRef||r.activatedRoute!==i||null===i.component)return void this.unsubscribeFromRouteData(r);const a=function T9(e){const t=De(e);if(!t)return null;const r=new $l(t);return{get selector(){return r.selector},get type(){return r.componentType},get inputs(){return r.inputs},get outputs(){return r.outputs},get ngContentSelectors(){return r.ngContentSelectors},get isStandalone(){return t.standalone},get isSignal(){return t.signals}}}(i.component);if(a)for(const{templateName:c}of a.inputs)r.activatedComponentRef.setInput(c,o[c]);else this.unsubscribeFromRouteData(r)});this.outletDataSubscriptions.set(r,s)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})();function Ru(e,t,r){if(r&&e.shouldReuseRoute(t.value,r.value.snapshot)){const i=r.value;i._futureSnapshot=t.value;const s=function YW(e,t,r){return t.children.map(i=>{for(const s of r.children)if(e.shouldReuseRoute(i.value,s.value.snapshot))return Ru(e,i,s);return Ru(e,i)})}(e,t,r);return new xr(i,s)}{if(e.shouldAttach(t.value)){const o=e.retrieve(t.value);if(null!==o){const a=o.route;return a.value._futureSnapshot=t.value,a.children=t.children.map(c=>Ru(e,c)),a}}const i=function JW(e){return new cc(new Jn(e.url),new Jn(e.params),new Jn(e.queryParams),new Jn(e.fragment),new Jn(e.data),e.outlet,e.component,e)}(t.value),s=t.children.map(o=>Ru(e,o));return new xr(i,s)}}class q_{constructor(t,r){this.redirectTo=t,this.navigationBehaviorOptions=r}}const tO="ngNavigationCancelingError";function Cp(e,t){const{redirectTo:r,navigationBehaviorOptions:i}=So(t)?{redirectTo:t,navigationBehaviorOptions:void 0}:t,s=nO(!1,Wn.Redirect);return s.url=r,s.navigationBehaviorOptions=i,s}function nO(e,t){const r=new Error(`NavigationCancelingError: ${e||""}`);return r[tO]=!0,r.cancellationCode=t,r}function rO(e){return!!e&&e[tO]}class tZ{constructor(t,r,i,s,o){this.routeReuseStrategy=t,this.futureState=r,this.currState=i,this.forwardEvent=s,this.inputBindingEnabled=o}activate(t){const r=this.futureState._root,i=this.currState?this.currState._root:null;this.deactivateChildRoutes(r,i,t),j_(this.futureState.root),this.activateChildRoutes(r,i,t)}deactivateChildRoutes(t,r,i){const s=ac(r);t.children.forEach(o=>{const a=o.value.outlet;this.deactivateRoutes(o,s[a],i),delete s[a]}),Object.values(s).forEach(o=>{this.deactivateRouteAndItsChildren(o,i)})}deactivateRoutes(t,r,i){const s=t.value,o=r?r.value:null;if(s===o)if(s.component){const a=i.getContext(s.outlet);a&&this.deactivateChildRoutes(t,r,a.children)}else this.deactivateChildRoutes(t,r,i);else o&&this.deactivateRouteAndItsChildren(r,i)}deactivateRouteAndItsChildren(t,r){t.value.component&&this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,r):this.deactivateRouteAndOutlet(t,r)}detachAndStoreRouteSubtree(t,r){const i=r.getContext(t.value.outlet),s=i&&t.value.component?i.children:r,o=ac(t);for(const a of Object.values(o))this.deactivateRouteAndItsChildren(a,s);if(i&&i.outlet){const a=i.outlet.detach(),c=i.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:a,route:t,contexts:c})}}deactivateRouteAndOutlet(t,r){const i=r.getContext(t.value.outlet),s=i&&t.value.component?i.children:r,o=ac(t);for(const a of Object.values(o))this.deactivateRouteAndItsChildren(a,s);i&&(i.outlet&&(i.outlet.deactivate(),i.children.onOutletDeactivated()),i.attachRef=null,i.route=null)}activateChildRoutes(t,r,i){const s=ac(r);t.children.forEach(o=>{this.activateRoutes(o,s[o.value.outlet],i),this.forwardEvent(new $W(o.value.snapshot))}),t.children.length&&this.forwardEvent(new UW(t.value.snapshot))}activateRoutes(t,r,i){const s=t.value,o=r?r.value:null;if(j_(s),s===o)if(s.component){const a=i.getOrCreateContext(s.outlet);this.activateChildRoutes(t,r,a.children)}else this.activateChildRoutes(t,r,i);else if(s.component){const a=i.getOrCreateContext(s.outlet);if(this.routeReuseStrategy.shouldAttach(s.snapshot)){const c=this.routeReuseStrategy.retrieve(s.snapshot);this.routeReuseStrategy.store(s.snapshot,null),a.children.onOutletReAttached(c.contexts),a.attachRef=c.componentRef,a.route=c.route.value,a.outlet&&a.outlet.attach(c.componentRef,c.route.value),j_(c.route.value),this.activateChildRoutes(t,null,a.children)}else a.attachRef=null,a.route=s,a.outlet&&a.outlet.activateWith(s,a.injector),this.activateChildRoutes(t,null,a.children)}else this.activateChildRoutes(t,null,i)}}class iO{constructor(t){this.path=t,this.route=this.path[this.path.length-1]}}class Dp{constructor(t,r){this.component=t,this.route=r}}function nZ(e,t,r){const i=e._root;return Ou(i,t?t._root:null,r,[i.value])}function lc(e,t){const r=Symbol(),i=t.get(e,r);return i===r?"function"!=typeof e||function $3(e){return null!==zd(e)}(e)?t.get(e):e:i}function Ou(e,t,r,i,s={canDeactivateChecks:[],canActivateChecks:[]}){const o=ac(t);return e.children.forEach(a=>{(function iZ(e,t,r,i,s={canDeactivateChecks:[],canActivateChecks:[]}){const o=e.value,a=t?t.value:null,c=r?r.getContext(e.value.outlet):null;if(a&&o.routeConfig===a.routeConfig){const l=function sZ(e,t,r){if("function"==typeof r)return r(e,t);switch(r){case"pathParamsChange":return!Do(e.url,t.url);case"pathParamsOrQueryParamsChange":return!Do(e.url,t.url)||!ii(e.queryParams,t.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!$_(e,t)||!ii(e.queryParams,t.queryParams);default:return!$_(e,t)}}(a,o,o.routeConfig.runGuardsAndResolvers);l?s.canActivateChecks.push(new iO(i)):(o.data=a.data,o._resolvedData=a._resolvedData),Ou(e,t,o.component?c?c.children:null:r,i,s),l&&c&&c.outlet&&c.outlet.isActivated&&s.canDeactivateChecks.push(new Dp(c.outlet.component,a))}else a&&ku(t,c,s),s.canActivateChecks.push(new iO(i)),Ou(e,null,o.component?c?c.children:null:r,i,s)})(a,o[a.value.outlet],r,i.concat([a.value]),s),delete o[a.value.outlet]}),Object.entries(o).forEach(([a,c])=>ku(c,r.getContext(a),s)),s}function ku(e,t,r){const i=ac(e),s=e.value;Object.entries(i).forEach(([o,a])=>{ku(a,s.component?t?t.children.getContext(o):null:t,r)}),r.canDeactivateChecks.push(new Dp(s.component&&t&&t.outlet&&t.outlet.isActivated?t.outlet.component:null,s))}function Pu(e){return"function"==typeof e}function sO(e){return e instanceof lp||"EmptyError"===e?.name}const Sp=Symbol("INITIAL_VALUE");function uc(){return ri(e=>I_(e.map(t=>t.pipe(rc(1),function JG(...e){const t=cp(e);return zt((r,i)=>{(t?x_(e,r,t):x_(e,r)).subscribe(i)})}(Sp)))).pipe(Ue(t=>{for(const r of t)if(!0!==r){if(r===Sp)return Sp;if(!1===r||fZ(r))return r}return!0}),Li(t=>t!==Sp),rc(1)))}function fZ(e){return So(e)||e instanceof q_}function oO(e){return function R3(...e){return QC(e)}(wn(t=>{if("boolean"!=typeof t)throw Cp(0,t)}),Ue(t=>!0===t))}class G_{constructor(t){this.segmentGroup=t||null}}class Tp extends Error{constructor(t){super(),this.urlTree=t}}function dc(e){return nc(new G_(e))}class SZ{constructor(t,r){this.urlSerializer=t,this.urlTree=r}lineralizeSegments(t,r){let i=[],s=r.root;for(;;){if(i=i.concat(s.segments),0===s.numberOfChildren)return he(i);if(s.numberOfChildren>1||!s.children[ve])return nc(new A(4e3,!1));s=s.children[ve]}}applyRedirectCommands(t,r,i,s,o){if("string"!=typeof r){const c=r,{queryParams:l,fragment:u,routeConfig:d,url:f,outlet:h,params:p,data:g,title:m}=s,y=Ci(o,()=>c({params:p,data:g,queryParams:l,fragment:u,routeConfig:d,url:f,outlet:h,title:m}));if(y instanceof Co)throw new Tp(y);r=y}const a=this.applyRedirectCreateUrlTree(r,this.urlSerializer.parse(r),t,i);if("/"===r[0])throw new Tp(a);return a}applyRedirectCreateUrlTree(t,r,i,s){const o=this.createSegmentGroup(t,r.root,i,s);return new Co(o,this.createQueryParams(r.queryParams,this.urlTree.queryParams),r.fragment)}createQueryParams(t,r){const i={};return Object.entries(t).forEach(([s,o])=>{if("string"==typeof o&&":"===o[0]){const c=o.substring(1);i[s]=r[c]}else i[s]=o}),i}createSegmentGroup(t,r,i,s){const o=this.createSegments(t,r.segments,i,s);let a={};return Object.entries(r.children).forEach(([c,l])=>{a[c]=this.createSegmentGroup(t,l,i,s)}),new Ge(o,a)}createSegments(t,r,i,s){return r.map(o=>":"===o.path[0]?this.findPosParam(t,o,s):this.findOrReturn(o,i))}findPosParam(t,r,i){const s=i[r.path.substring(1)];if(!s)throw new A(4001,!1);return s}findOrReturn(t,r){let i=0;for(const s of r){if(s.path===t.path)return r.splice(i),s;i++}return t}}const W_={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function TZ(e,t,r,i,s){const o=aO(e,t,r);return o.matched?(i=function HW(e,t){return e.providers&&!e._injector&&(e._injector=ch(e.providers,t,`Route: ${e.path}`)),e._injector??t}(t,i),function EZ(e,t,r,i){const s=t.canMatch;return s&&0!==s.length?he(s.map(a=>{const c=lc(a,e);return _s(function dZ(e){return e&&Pu(e.canMatch)}(c)?c.canMatch(t,r):Ci(e,()=>c(t,r)))})).pipe(uc(),oO()):he(!0)}(i,t,r).pipe(Ue(a=>!0===a?o:{...W_}))):he(o)}function aO(e,t,r){if("**"===t.path)return function IZ(e){return{matched:!0,parameters:e.length>0?xR(e).parameters:{},consumedSegments:e,remainingSegments:[],positionalParamSegments:{}}}(r);if(""===t.path)return"full"===t.pathMatch&&(e.hasChildren()||r.length>0)?{...W_}:{matched:!0,consumedSegments:[],remainingSegments:r,parameters:{},positionalParamSegments:{}};const s=(t.matcher||oW)(r,e,t);if(!s)return{...W_};const o={};Object.entries(s.posParams??{}).forEach(([c,l])=>{o[c]=l.path});const a=s.consumed.length>0?{...o,...s.consumed[s.consumed.length-1].parameters}:o;return{matched:!0,consumedSegments:s.consumed,remainingSegments:r.slice(s.consumed.length),parameters:a,positionalParamSegments:s.posParams??{}}}function cO(e,t,r,i){return r.length>0&&function MZ(e,t,r){return r.some(i=>Ip(e,t,i)&&Ir(i)!==ve)}(e,r,i)?{segmentGroup:new Ge(t,AZ(i,new Ge(r,e.children))),slicedSegments:[]}:0===r.length&&function NZ(e,t,r){return r.some(i=>Ip(e,t,i))}(e,r,i)?{segmentGroup:new Ge(e.segments,xZ(e,r,i,e.children)),slicedSegments:r}:{segmentGroup:new Ge(e.segments,e.children),slicedSegments:r}}function xZ(e,t,r,i){const s={};for(const o of r)if(Ip(e,t,o)&&!i[Ir(o)]){const a=new Ge([],{});s[Ir(o)]=a}return{...i,...s}}function AZ(e,t){const r={};r[ve]=t;for(const i of e)if(""===i.path&&Ir(i)!==ve){const s=new Ge([],{});r[Ir(i)]=s}return r}function Ip(e,t,r){return(!(e.hasChildren()||t.length>0)||"full"!==r.pathMatch)&&""===r.path}class OZ{}class LZ{constructor(t,r,i,s,o,a,c){this.injector=t,this.configLoader=r,this.rootComponentType=i,this.config=s,this.urlTree=o,this.paramsInheritanceStrategy=a,this.urlSerializer=c,this.applyRedirects=new SZ(this.urlSerializer,this.urlTree),this.absoluteRedirectCount=0,this.allowRedirects=!0}noMatchError(t){return new A(4002,`'${t.segmentGroup}'`)}recognize(){const t=cO(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(t).pipe(Ue(({children:r,rootSnapshot:i})=>{const s=new xr(i,r),o=new YR("",s),a=function TW(e,t,r=null,i=null){return UR(VR(e),t,r,i)}(i,[],this.urlTree.queryParams,this.urlTree.fragment);return a.queryParams=this.urlTree.queryParams,o.url=this.urlSerializer.serialize(a),{state:o,tree:a}}))}match(t){const r=new bp([],Object.freeze({}),Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,Object.freeze({}),ve,this.rootComponentType,null,{});return this.processSegmentGroup(this.injector,this.config,t,ve,r).pipe(Ue(i=>({children:i,rootSnapshot:r})),vs(i=>{if(i instanceof Tp)return this.urlTree=i.urlTree,this.match(i.urlTree.root);throw i instanceof G_?this.noMatchError(i):i}))}processSegmentGroup(t,r,i,s,o){return 0===i.segments.length&&i.hasChildren()?this.processChildren(t,r,i,o):this.processSegment(t,r,i,i.segments,s,!0,o).pipe(Ue(a=>a instanceof xr?[a]:[]))}processChildren(t,r,i,s){const o=[];for(const a of Object.keys(i.children))"primary"===a?o.unshift(a):o.push(a);return Gt(o).pipe(bu(a=>{const c=i.children[a],l=function WW(e,t){const r=e.filter(i=>Ir(i)===t);return r.push(...e.filter(i=>Ir(i)!==t)),r}(r,a);return this.processSegmentGroup(t,l,c,a,s)}),function tW(e,t){return zt(function eW(e,t,r,i,s){return(o,a)=>{let c=r,l=t,u=0;o.subscribe(Dt(a,d=>{const f=u++;l=c?e(l,d,f):(c=!0,d),i&&a.next(l)},s&&(()=>{c&&a.next(l),a.complete()})))}}(e,t,arguments.length>=2,!0))}((a,c)=>(a.push(...c),a)),up(null),function nW(e,t){const r=arguments.length>=2;return i=>i.pipe(e?Li((s,o)=>e(s,o,i)):Zs,M_(1),r?up(t):TR(()=>new lp))}(),cn(a=>{if(null===a)return dc(i);const c=lO(a);return function FZ(e){e.sort((t,r)=>t.value.outlet===ve?-1:r.value.outlet===ve?1:t.value.outlet.localeCompare(r.value.outlet))}(c),he(c)}))}processSegment(t,r,i,s,o,a,c){return Gt(r).pipe(bu(l=>this.processSegmentAgainstRoute(l._injector??t,r,l,i,s,o,a,c).pipe(vs(u=>{if(u instanceof G_)return he(null);throw u}))),ys(l=>!!l),vs(l=>{if(sO(l))return function RZ(e,t,r){return 0===t.length&&!e.children[r]}(i,s,o)?he(new OZ):dc(i);throw l}))}processSegmentAgainstRoute(t,r,i,s,o,a,c,l){return Ir(i)===a||a!==ve&&Ip(s,o,i)?void 0===i.redirectTo?this.matchSegmentAgainstRoute(t,s,i,o,a,l):this.allowRedirects&&c?this.expandSegmentAgainstRouteUsingRedirect(t,s,r,i,o,a,l):dc(s):dc(s)}expandSegmentAgainstRouteUsingRedirect(t,r,i,s,o,a,c){const{matched:l,parameters:u,consumedSegments:d,positionalParamSegments:f,remainingSegments:h}=aO(r,s,o);if(!l)return dc(r);"string"==typeof s.redirectTo&&"/"===s.redirectTo[0]&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>31&&(this.allowRedirects=!1));const p=new bp(o,u,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,uO(s),Ir(s),s.component??s._loadedComponent??null,s,dO(s)),g=wp(p,c,this.paramsInheritanceStrategy);p.params=Object.freeze(g.params),p.data=Object.freeze(g.data);const m=this.applyRedirects.applyRedirectCommands(d,s.redirectTo,f,p,t);return this.applyRedirects.lineralizeSegments(s,m).pipe(cn(y=>this.processSegment(t,i,r,y.concat(h),a,!1,c)))}matchSegmentAgainstRoute(t,r,i,s,o,a){const c=TZ(r,i,s,t);return"**"===i.path&&(r.children={}),c.pipe(ri(l=>l.matched?this.getChildConfig(t=i._injector??t,i,s).pipe(ri(({routes:u})=>{const d=i._loadedInjector??t,{parameters:f,consumedSegments:h,remainingSegments:p}=l,g=new bp(h,f,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,uO(i),Ir(i),i.component??i._loadedComponent??null,i,dO(i)),m=wp(g,a,this.paramsInheritanceStrategy);g.params=Object.freeze(m.params),g.data=Object.freeze(m.data);const{segmentGroup:y,slicedSegments:_}=cO(r,h,p,u);if(0===_.length&&y.hasChildren())return this.processChildren(d,u,y,g).pipe(Ue(w=>new xr(g,w)));if(0===u.length&&0===_.length)return he(new xr(g,[]));const v=Ir(i)===o;return this.processSegment(d,u,y,_,v?ve:o,!0,g).pipe(Ue(w=>new xr(g,w instanceof xr?[w]:[])))})):dc(r)))}getChildConfig(t,r,i){return r.children?he({routes:r.children,injector:t}):r.loadChildren?void 0!==r._loadedRoutes?he({routes:r._loadedRoutes,injector:r._loadedInjector}):function bZ(e,t,r,i){const s=t.canLoad;return void 0===s||0===s.length?he(!0):he(s.map(a=>{const c=lc(a,e);return _s(function aZ(e){return e&&Pu(e.canLoad)}(c)?c.canLoad(t,r):Ci(e,()=>c(t,r)))})).pipe(uc(),oO())}(t,r,i).pipe(cn(s=>s?this.configLoader.loadChildren(t,r).pipe(wn(o=>{r._loadedRoutes=o.routes,r._loadedInjector=o.injector})):function DZ(){return nc(nO(!1,Wn.GuardRejected))}())):he({routes:[],injector:t})}}function BZ(e){const t=e.value.routeConfig;return t&&""===t.path}function lO(e){const t=[],r=new Set;for(const i of e){if(!BZ(i)){t.push(i);continue}const s=t.find(o=>i.value.routeConfig===o.value.routeConfig);void 0!==s?(s.children.push(...i.children),r.add(s)):t.push(i)}for(const i of r){const s=lO(i.children);t.push(new xr(i.value,s))}return t.filter(i=>!r.has(i))}function uO(e){return e.data||{}}function dO(e){return e.resolve||{}}function fO(e){const t=e.children.map(r=>fO(r)).flat();return[e,...t]}function Z_(e){return ri(t=>{const r=e(t);return r?Gt(r).pipe(Ue(()=>t)):he(t)})}let hO=(()=>{class e{buildTitle(r){let i,s=r.root;for(;void 0!==s;)i=this.getResolvedTitleForRoute(s)??i,s=s.children.find(o=>o.outlet===ve);return i}getResolvedTitleForRoute(r){return r.data[Cu]}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:()=>O(zZ),providedIn:"root"})}}return e})(),zZ=(()=>{class e extends hO{constructor(r){super(),this.title=r}updateTitle(r){const i=this.buildTitle(r);void 0!==i&&this.title.setTitle(i)}static{this.\u0275fac=function(i){return new(i||e)(q(Kq))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const fc=new z("",{providedIn:"root",factory:()=>({})});let pO=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=ns({type:e,selectors:[["ng-component"]],standalone:!0,features:[Th],decls:1,vars:0,template:function(i,s){1&i&&or(0,"router-outlet")},dependencies:[H_],encapsulation:2})}}return e})();function K_(e){const t=e.children&&e.children.map(K_),r=t?{...e,children:t}:{...e};return!r.component&&!r.loadComponent&&(t||r.loadChildren)&&r.outlet&&r.outlet!==ve&&(r.component=pO),r}const hc=new z("");let Q_=(()=>{class e{constructor(){this.componentLoaders=new WeakMap,this.childrenLoaders=new WeakMap,this.compiler=O(wM)}loadComponent(r){if(this.componentLoaders.get(r))return this.componentLoaders.get(r);if(r._loadedComponent)return he(r._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(r);const i=_s(r.loadComponent()).pipe(Ue(gO),wn(o=>{this.onLoadEndListener&&this.onLoadEndListener(r),r._loadedComponent=o}),Eu(()=>{this.componentLoaders.delete(r)})),s=new SR(i,()=>new Ze).pipe(A_());return this.componentLoaders.set(r,s),s}loadChildren(r,i){if(this.childrenLoaders.get(i))return this.childrenLoaders.get(i);if(i._loadedRoutes)return he({routes:i._loadedRoutes,injector:i._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(i);const o=function qZ(e,t,r,i){return _s(e.loadChildren()).pipe(Ue(gO),cn(s=>s instanceof N1||Array.isArray(s)?he(s):Gt(t.compileModuleAsync(s))),Ue(s=>{i&&i(e);let o,a,c=!1;return Array.isArray(s)?(a=s,!0):(o=s.create(r).injector,a=o.get(hc,[],{optional:!0,self:!0}).flat()),{routes:a.map(K_),injector:o}}))}(i,this.compiler,r,this.onLoadEndListener).pipe(Eu(()=>{this.childrenLoaders.delete(i)})),a=new SR(o,()=>new Ze).pipe(A_());return this.childrenLoaders.set(i,a),a}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function gO(e){return function GZ(e){return e&&"object"==typeof e&&"default"in e}(e)?e.default:e}let Y_=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:()=>O(WZ),providedIn:"root"})}}return e})(),WZ=(()=>{class e{shouldProcessUrl(r){return!0}extract(r){return r}merge(r,i){return r}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const mO=new z(""),yO=new z("");function ZZ(e,t,r){const i=e.get(yO),s=e.get(an);return e.get(Ne).runOutsideAngular(()=>{if(!s.startViewTransition||i.skipNextTransition)return i.skipNextTransition=!1,new Promise(u=>setTimeout(u));let o;const a=new Promise(u=>{o=u}),c=s.startViewTransition(()=>(o(),function KZ(e){return new Promise(t=>{ph({read:()=>setTimeout(t)},{injector:e})})}(e))),{onViewTransitionCreated:l}=i;return l&&Ci(e,()=>l({transition:c,from:t,to:r})),a})}const vO=new z("");let xp=(()=>{class e{get hasRequestedNavigation(){return 0!==this.navigationId}constructor(){this.currentNavigation=null,this.currentTransition=null,this.lastSuccessfulNavigation=null,this.events=new Ze,this.transitionAbortSubject=new Ze,this.configLoader=O(Q_),this.environmentInjector=O(In),this.urlSerializer=O(sc),this.rootContexts=O(Nu),this.location=O(gu),this.inputBindingEnabled=null!==O(Ep,{optional:!0}),this.titleStrategy=O(hO),this.options=O(fc,{optional:!0})||{},this.paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly",this.urlHandlingStrategy=O(Y_),this.createViewTransition=O(mO,{optional:!0}),this.navigationErrorHandler=O(vO,{optional:!0}),this.navigationId=0,this.afterPreactivation=()=>he(void 0),this.rootComponentType=null,this.configLoader.onLoadEndListener=s=>this.events.next(new BW(s)),this.configLoader.onLoadStartListener=s=>this.events.next(new FW(s))}complete(){this.transitions?.complete()}handleNavigationRequest(r){const i=++this.navigationId;this.transitions?.next({...this.transitions.value,...r,id:i})}setupNavigations(r,i,s){return this.transitions=new Jn({id:0,currentUrlTree:i,currentRawUrl:i,extractedUrl:this.urlHandlingStrategy.extract(i),urlAfterRedirects:this.urlHandlingStrategy.extract(i),rawUrl:i,extras:{},resolve:()=>{},reject:()=>{},promise:Promise.resolve(!0),source:xu,restoredState:null,currentSnapshot:s.snapshot,targetSnapshot:null,currentRouterState:s,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.transitions.pipe(Li(o=>0!==o.id),Ue(o=>({...o,extractedUrl:this.urlHandlingStrategy.extract(o.rawUrl)})),ri(o=>{let a=!1,c=!1;return he(o).pipe(ri(l=>{if(this.navigationId>o.id)return this.cancelNavigationTransition(o,"",Wn.SupersededByNewNavigation),ni;this.currentTransition=o,this.currentNavigation={id:l.id,initialUrl:l.rawUrl,extractedUrl:l.extractedUrl,targetBrowserUrl:"string"==typeof l.extras.browserUrl?this.urlSerializer.parse(l.extras.browserUrl):l.extras.browserUrl,trigger:l.source,extras:l.extras,previousNavigation:this.lastSuccessfulNavigation?{...this.lastSuccessfulNavigation,previousNavigation:null}:null};const u=!r.navigated||this.isUpdatingInternalState()||this.isUpdatedBrowserUrl();if(!u&&"reload"!==(l.extras.onSameUrlNavigation??r.onSameUrlNavigation)){const f="";return this.events.next(new oc(l.id,this.urlSerializer.serialize(l.rawUrl),f,vp.IgnoredSameUrlNavigation)),l.resolve(!1),ni}if(this.urlHandlingStrategy.shouldProcessUrl(l.rawUrl))return he(l).pipe(ri(f=>{const h=this.transitions?.getValue();return this.events.next(new Au(f.id,this.urlSerializer.serialize(f.extractedUrl),f.source,f.restoredState)),h!==this.transitions?.getValue()?ni:Promise.resolve(f)}),function VZ(e,t,r,i,s,o){return cn(a=>function kZ(e,t,r,i,s,o,a="emptyOnly"){return new LZ(e,t,r,i,s,a,o).recognize()}(e,t,r,i,a.extractedUrl,s,o).pipe(Ue(({state:c,tree:l})=>({...a,targetSnapshot:c,urlAfterRedirects:l}))))}(this.environmentInjector,this.configLoader,this.rootComponentType,r.config,this.urlSerializer,this.paramsInheritanceStrategy),wn(f=>{o.targetSnapshot=f.targetSnapshot,o.urlAfterRedirects=f.urlAfterRedirects,this.currentNavigation={...this.currentNavigation,finalUrl:f.urlAfterRedirects};const h=new GR(f.id,this.urlSerializer.serialize(f.extractedUrl),this.urlSerializer.serialize(f.urlAfterRedirects),f.targetSnapshot);this.events.next(h)}));if(u&&this.urlHandlingStrategy.shouldProcessUrl(l.currentRawUrl)){const{id:f,extractedUrl:h,source:p,restoredState:g,extras:m}=l,y=new Au(f,this.urlSerializer.serialize(h),p,g);this.events.next(y);const _=QR(this.rootComponentType).snapshot;return this.currentTransition=o={...l,targetSnapshot:_,urlAfterRedirects:h,extras:{...m,skipLocationChange:!1,replaceUrl:!1}},this.currentNavigation.finalUrl=h,he(o)}{const f="";return this.events.next(new oc(l.id,this.urlSerializer.serialize(l.extractedUrl),f,vp.IgnoredByUrlHandlingStrategy)),l.resolve(!1),ni}}),wn(l=>{const u=new OW(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects),l.targetSnapshot);this.events.next(u)}),Ue(l=>(this.currentTransition=o={...l,guards:nZ(l.targetSnapshot,l.currentSnapshot,this.rootContexts)},o)),function hZ(e,t){return cn(r=>{const{targetSnapshot:i,currentSnapshot:s,guards:{canActivateChecks:o,canDeactivateChecks:a}}=r;return 0===a.length&&0===o.length?he({...r,guardsResult:!0}):function pZ(e,t,r,i){return Gt(e).pipe(cn(s=>function wZ(e,t,r,i,s){const o=t&&t.routeConfig?t.routeConfig.canDeactivate:null;return o&&0!==o.length?he(o.map(c=>{const l=Mu(t)??s,u=lc(c,l);return _s(function uZ(e){return e&&Pu(e.canDeactivate)}(u)?u.canDeactivate(e,t,r,i):Ci(l,()=>u(e,t,r,i))).pipe(ys())})).pipe(uc()):he(!0)}(s.component,s.route,r,t,i)),ys(s=>!0!==s,!0))}(a,i,s,e).pipe(cn(c=>c&&function oZ(e){return"boolean"==typeof e}(c)?function gZ(e,t,r,i){return Gt(t).pipe(bu(s=>x_(function yZ(e,t){return null!==e&&t&&t(new VW(e)),he(!0)}(s.route.parent,i),function mZ(e,t){return null!==e&&t&&t(new jW(e)),he(!0)}(s.route,i),function _Z(e,t,r){const i=t[t.length-1],o=t.slice(0,t.length-1).reverse().map(a=>function rZ(e){const t=e.routeConfig?e.routeConfig.canActivateChild:null;return t&&0!==t.length?{node:e,guards:t}:null}(a)).filter(a=>null!==a).map(a=>DR(()=>he(a.guards.map(l=>{const u=Mu(a.node)??r,d=lc(l,u);return _s(function lZ(e){return e&&Pu(e.canActivateChild)}(d)?d.canActivateChild(i,e):Ci(u,()=>d(i,e))).pipe(ys())})).pipe(uc())));return he(o).pipe(uc())}(e,s.path,r),function vZ(e,t,r){const i=t.routeConfig?t.routeConfig.canActivate:null;if(!i||0===i.length)return he(!0);const s=i.map(o=>DR(()=>{const a=Mu(t)??r,c=lc(o,a);return _s(function cZ(e){return e&&Pu(e.canActivate)}(c)?c.canActivate(t,e):Ci(a,()=>c(t,e))).pipe(ys())}));return he(s).pipe(uc())}(e,s.route,r))),ys(s=>!0!==s,!0))}(i,o,e,t):he(c)),Ue(c=>({...r,guardsResult:c})))})}(this.environmentInjector,l=>this.events.next(l)),wn(l=>{if(o.guardsResult=l.guardsResult,l.guardsResult&&"boolean"!=typeof l.guardsResult)throw Cp(0,l.guardsResult);const u=new kW(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects),l.targetSnapshot,!!l.guardsResult);this.events.next(u)}),Li(l=>!!l.guardsResult||(this.cancelNavigationTransition(l,"",Wn.GuardRejected),!1)),Z_(l=>{if(l.guards.canActivateChecks.length)return he(l).pipe(wn(u=>{const d=new PW(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects),u.targetSnapshot);this.events.next(d)}),ri(u=>{let d=!1;return he(u).pipe(function UZ(e,t){return cn(r=>{const{targetSnapshot:i,guards:{canActivateChecks:s}}=r;if(!s.length)return he(r);const o=new Set(s.map(l=>l.route)),a=new Set;for(const l of o)if(!a.has(l))for(const u of fO(l))a.add(u);let c=0;return Gt(a).pipe(bu(l=>o.has(l)?function jZ(e,t,r,i){const s=e.routeConfig,o=e._resolve;return void 0!==s?.title&&!XR(s)&&(o[Cu]=s.title),function $Z(e,t,r,i){const s=N_(e);if(0===s.length)return he({});const o={};return Gt(s).pipe(cn(a=>function HZ(e,t,r,i){const s=Mu(t)??i,o=lc(e,s);return _s(o.resolve?o.resolve(t,r):Ci(s,()=>o(t,r)))}(e[a],t,r,i).pipe(ys(),wn(c=>{if(c instanceof q_)throw Cp(new fp,c);o[a]=c}))),M_(1),function rW(e){return Ue(()=>e)}(o),vs(a=>sO(a)?ni:nc(a)))}(o,e,t,i).pipe(Ue(a=>(e._resolvedData=a,e.data=wp(e,e.parent,r).resolve,null)))}(l,i,e,t):(l.data=wp(l,l.parent,e).resolve,he(void 0))),wn(()=>c++),M_(1),cn(l=>c===a.size?he(r):ni))})}(this.paramsInheritanceStrategy,this.environmentInjector),wn({next:()=>d=!0,complete:()=>{d||this.cancelNavigationTransition(u,"",Wn.NoDataFromResolver)}}))}),wn(u=>{const d=new LW(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects),u.targetSnapshot);this.events.next(d)}))}),Z_(l=>{const u=d=>{const f=[];d.routeConfig?.loadComponent&&!d.routeConfig._loadedComponent&&f.push(this.configLoader.loadComponent(d.routeConfig).pipe(wn(h=>{d.component=h}),Ue(()=>{})));for(const h of d.children)f.push(...u(h));return f};return I_(u(l.targetSnapshot.root)).pipe(up(null),rc(1))}),Z_(()=>this.afterPreactivation()),ri(()=>{const{currentSnapshot:l,targetSnapshot:u}=o,d=this.createViewTransition?.(this.environmentInjector,l.root,u.root);return d?Gt(d).pipe(Ue(()=>o)):he(o)}),Ue(l=>{const u=function QW(e,t,r){const i=Ru(e,t._root,r?r._root:void 0);return new KR(i,t)}(r.routeReuseStrategy,l.targetSnapshot,l.currentRouterState);return this.currentTransition=o={...l,targetRouterState:u},this.currentNavigation.targetRouterState=u,o}),wn(()=>{this.events.next(new F_)}),((e,t,r,i)=>Ue(s=>(new tZ(t,s.targetRouterState,s.currentRouterState,r,i).activate(e),s)))(this.rootContexts,r.routeReuseStrategy,l=>this.events.next(l),this.inputBindingEnabled),rc(1),wn({next:l=>{a=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new Fi(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects))),this.titleStrategy?.updateTitle(l.targetRouterState.snapshot),l.resolve(!0)},complete:()=>{a=!0}}),function iW(e){return zt((t,r)=>{Tr(e).subscribe(Dt(r,()=>r.complete(),ym)),!r.closed&&t.subscribe(r)})}(this.transitionAbortSubject.pipe(wn(l=>{throw l}))),Eu(()=>{!a&&!c&&this.cancelNavigationTransition(o,"",Wn.SupersededByNewNavigation),this.currentTransition?.id===o.id&&(this.currentNavigation=null,this.currentTransition=null)}),vs(l=>{if(c=!0,rO(l))this.events.next(new To(o.id,this.urlSerializer.serialize(o.extractedUrl),l.message,l.cancellationCode)),function XW(e){return rO(e)&&So(e.url)}(l)?this.events.next(new _p(l.url,l.navigationBehaviorOptions)):o.resolve(!1);else{const u=new L_(o.id,this.urlSerializer.serialize(o.extractedUrl),l,o.targetSnapshot??void 0);try{const d=Ci(this.environmentInjector,()=>this.navigationErrorHandler?.(u));if(d instanceof q_){const{message:f,cancellationCode:h}=Cp(0,d);this.events.next(new To(o.id,this.urlSerializer.serialize(o.extractedUrl),f,h)),this.events.next(new _p(d.redirectTo,d.navigationBehaviorOptions))}else{this.events.next(u);const f=r.errorHandler(l);o.resolve(!!f)}}catch(d){this.options.resolveNavigationPromiseOnError?o.resolve(!1):o.reject(d)}}return ni}))}))}cancelNavigationTransition(r,i,s){const o=new To(r.id,this.urlSerializer.serialize(r.extractedUrl),i,s);this.events.next(o),r.resolve(!1)}isUpdatingInternalState(){return this.currentTransition?.extractedUrl.toString()!==this.currentTransition?.currentUrlTree.toString()}isUpdatedBrowserUrl(){const r=this.urlHandlingStrategy.extract(this.urlSerializer.parse(this.location.path(!0))),i=this.currentNavigation?.targetBrowserUrl??this.currentNavigation?.extractedUrl;return r.toString()!==i?.toString()&&!this.currentNavigation?.extras.skipLocationChange}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function QZ(e){return e!==xu}let YZ=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:()=>O(XZ),providedIn:"root"})}}return e})();class JZ{shouldDetach(t){return!1}store(t,r){}shouldAttach(t){return!1}retrieve(t){return null}shouldReuseRoute(t,r){return t.routeConfig===r.routeConfig}}let XZ=(()=>{class e extends JZ{static{this.\u0275fac=(()=>{let r;return function(s){return(r||(r=qt(e)))(s||e)}})()}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),_O=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:()=>O(eK),providedIn:"root"})}}return e})(),eK=(()=>{class e extends _O{constructor(){super(...arguments),this.location=O(gu),this.urlSerializer=O(sc),this.options=O(fc,{optional:!0})||{},this.canceledNavigationResolution=this.options.canceledNavigationResolution||"replace",this.urlHandlingStrategy=O(Y_),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.currentUrlTree=new Co,this.rawUrlTree=this.currentUrlTree,this.currentPageId=0,this.lastSuccessfulId=-1,this.routerState=QR(null),this.stateMemento=this.createStateMemento()}getCurrentUrlTree(){return this.currentUrlTree}getRawUrlTree(){return this.rawUrlTree}restoredState(){return this.location.getState()}get browserPageId(){return"computed"!==this.canceledNavigationResolution?this.currentPageId:this.restoredState()?.\u0275routerPageId??this.currentPageId}getRouterState(){return this.routerState}createStateMemento(){return{rawUrlTree:this.rawUrlTree,currentUrlTree:this.currentUrlTree,routerState:this.routerState}}registerNonRouterCurrentEntryChangeListener(r){return this.location.subscribe(i=>{"popstate"===i.type&&r(i.url,i.state)})}handleRouterEvent(r,i){if(r instanceof Au)this.stateMemento=this.createStateMemento();else if(r instanceof oc)this.rawUrlTree=i.initialUrl;else if(r instanceof GR){if("eager"===this.urlUpdateStrategy&&!i.extras.skipLocationChange){const s=this.urlHandlingStrategy.merge(i.finalUrl,i.initialUrl);this.setBrowserUrl(i.targetBrowserUrl??s,i)}}else r instanceof F_?(this.currentUrlTree=i.finalUrl,this.rawUrlTree=this.urlHandlingStrategy.merge(i.finalUrl,i.initialUrl),this.routerState=i.targetRouterState,"deferred"===this.urlUpdateStrategy&&!i.extras.skipLocationChange&&this.setBrowserUrl(i.targetBrowserUrl??this.rawUrlTree,i)):r instanceof To&&(r.code===Wn.GuardRejected||r.code===Wn.NoDataFromResolver)?this.restoreHistory(i):r instanceof L_?this.restoreHistory(i,!0):r instanceof Fi&&(this.lastSuccessfulId=r.id,this.currentPageId=this.browserPageId)}setBrowserUrl(r,i){const s=r instanceof Co?this.urlSerializer.serialize(r):r;if(this.location.isCurrentPathEqualTo(s)||i.extras.replaceUrl){const a={...i.extras.state,...this.generateNgRouterState(i.id,this.browserPageId)};this.location.replaceState(s,"",a)}else{const o={...i.extras.state,...this.generateNgRouterState(i.id,this.browserPageId+1)};this.location.go(s,"",o)}}restoreHistory(r,i=!1){if("computed"===this.canceledNavigationResolution){const o=this.currentPageId-this.browserPageId;0!==o?this.location.historyGo(o):this.currentUrlTree===r.finalUrl&&0===o&&(this.resetState(r),this.resetUrlToCurrentUrlTree())}else"replace"===this.canceledNavigationResolution&&(i&&this.resetState(r),this.resetUrlToCurrentUrlTree())}resetState(r){this.routerState=this.stateMemento.routerState,this.currentUrlTree=this.stateMemento.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,r.finalUrl??this.rawUrlTree)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(r,i){return"computed"===this.canceledNavigationResolution?{navigationId:r,\u0275routerPageId:i}:{navigationId:r}}static{this.\u0275fac=(()=>{let r;return function(s){return(r||(r=qt(e)))(s||e)}})()}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Lu=function(e){return e[e.COMPLETE=0]="COMPLETE",e[e.FAILED=1]="FAILED",e[e.REDIRECTING=2]="REDIRECTING",e}(Lu||{});function wO(e,t){e.events.pipe(Li(r=>r instanceof Fi||r instanceof To||r instanceof L_||r instanceof oc),Ue(r=>r instanceof Fi||r instanceof oc?Lu.COMPLETE:r instanceof To&&(r.code===Wn.Redirect||r.code===Wn.SupersededByNewNavigation)?Lu.REDIRECTING:Lu.FAILED),Li(r=>r!==Lu.REDIRECTING),rc(1)).subscribe(()=>{t()})}function tK(e){throw e}const nK={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},rK={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};let oi=(()=>{class e{get currentUrlTree(){return this.stateManager.getCurrentUrlTree()}get rawUrlTree(){return this.stateManager.getRawUrlTree()}get events(){return this._events}get routerState(){return this.stateManager.getRouterState()}constructor(){this.disposed=!1,this.console=O(lM),this.stateManager=O(_O),this.options=O(fc,{optional:!0})||{},this.pendingTasks=O(io),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.navigationTransitions=O(xp),this.urlSerializer=O(sc),this.location=O(gu),this.urlHandlingStrategy=O(Y_),this._events=new Ze,this.errorHandler=this.options.errorHandler||tK,this.navigated=!1,this.routeReuseStrategy=O(YZ),this.onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore",this.config=O(hc,{optional:!0})?.flat()??[],this.componentInputBindingEnabled=!!O(Ep,{optional:!0}),this.eventsSubscription=new vt,this.resetConfig(this.config),this.navigationTransitions.setupNavigations(this,this.currentUrlTree,this.routerState).subscribe({error:r=>{this.console.warn(r)}}),this.subscribeToNavigationEvents()}subscribeToNavigationEvents(){const r=this.navigationTransitions.events.subscribe(i=>{try{const s=this.navigationTransitions.currentTransition,o=this.navigationTransitions.currentNavigation;if(null!==s&&null!==o)if(this.stateManager.handleRouterEvent(i,o),i instanceof To&&i.code!==Wn.Redirect&&i.code!==Wn.SupersededByNewNavigation)this.navigated=!0;else if(i instanceof Fi)this.navigated=!0;else if(i instanceof _p){const a=i.navigationBehaviorOptions,c=this.urlHandlingStrategy.merge(i.url,s.currentRawUrl),l={browserUrl:s.extras.browserUrl,info:s.extras.info,skipLocationChange:s.extras.skipLocationChange,replaceUrl:s.extras.replaceUrl||"eager"===this.urlUpdateStrategy||QZ(s.source),...a};this.scheduleNavigation(c,xu,null,l,{resolve:s.resolve,reject:s.reject,promise:s.promise})}(function sK(e){return!(e instanceof F_||e instanceof _p)})(i)&&this._events.next(i)}catch(s){this.navigationTransitions.transitionAbortSubject.next(s)}});this.eventsSubscription.add(r)}resetRootComponentType(r){this.routerState.root.component=r,this.navigationTransitions.rootComponentType=r}initialNavigation(){this.setUpLocationChangeListener(),this.navigationTransitions.hasRequestedNavigation||this.navigateToSyncWithBrowser(this.location.path(!0),xu,this.stateManager.restoredState())}setUpLocationChangeListener(){this.nonRouterCurrentEntryChangeSubscription??=this.stateManager.registerNonRouterCurrentEntryChangeListener((r,i)=>{setTimeout(()=>{this.navigateToSyncWithBrowser(r,"popstate",i)},0)})}navigateToSyncWithBrowser(r,i,s){const o={replaceUrl:!0},a=s?.navigationId?s:null;if(s){const l={...s};delete l.navigationId,delete l.\u0275routerPageId,0!==Object.keys(l).length&&(o.state=l)}const c=this.parseUrl(r);this.scheduleNavigation(c,i,a,o)}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.navigationTransitions.currentNavigation}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(r){this.config=r.map(K_),this.navigated=!1}ngOnDestroy(){this.dispose()}dispose(){this.navigationTransitions.complete(),this.nonRouterCurrentEntryChangeSubscription&&(this.nonRouterCurrentEntryChangeSubscription.unsubscribe(),this.nonRouterCurrentEntryChangeSubscription=void 0),this.disposed=!0,this.eventsSubscription.unsubscribe()}createUrlTree(r,i={}){const{relativeTo:s,queryParams:o,fragment:a,queryParamsHandling:c,preserveFragment:l}=i,u=l?this.currentUrlTree.fragment:a;let f,d=null;switch(c??this.options.defaultQueryParamsHandling){case"merge":d={...this.currentUrlTree.queryParams,...o};break;case"preserve":d=this.currentUrlTree.queryParams;break;default:d=o||null}null!==d&&(d=this.removeEmptyProps(d));try{f=VR(s?s.snapshot:this.routerState.snapshot.root)}catch{("string"!=typeof r[0]||"/"!==r[0][0])&&(r=[]),f=this.currentUrlTree.root}return UR(f,r,d,u??null)}navigateByUrl(r,i={skipLocationChange:!1}){const s=So(r)?r:this.parseUrl(r),o=this.urlHandlingStrategy.merge(s,this.rawUrlTree);return this.scheduleNavigation(o,xu,null,i)}navigate(r,i={skipLocationChange:!1}){return function iK(e){for(let t=0;t(null!=o&&(i[s]=o),i),{})}scheduleNavigation(r,i,s,o,a){if(this.disposed)return Promise.resolve(!1);let c,l,u;a?(c=a.resolve,l=a.reject,u=a.promise):u=new Promise((f,h)=>{c=f,l=h});const d=this.pendingTasks.add();return wO(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(d))}),this.navigationTransitions.handleNavigationRequest({source:i,restoredState:s,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,rawUrl:r,extras:o,resolve:c,reject:l,promise:u,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),u.catch(f=>Promise.reject(f))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();class bO{}let cK=(()=>{class e{constructor(r,i,s,o,a){this.router=r,this.injector=s,this.preloadingStrategy=o,this.loader=a}setUpPreloading(){this.subscription=this.router.events.pipe(Li(r=>r instanceof Fi),bu(()=>this.preload())).subscribe(()=>{})}preload(){return this.processRoutes(this.injector,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(r,i){const s=[];for(const o of i){o.providers&&!o._injector&&(o._injector=ch(o.providers,r,`Route: ${o.path}`));const a=o._injector??r,c=o._loadedInjector??a;(o.loadChildren&&!o._loadedRoutes&&void 0===o.canLoad||o.loadComponent&&!o._loadedComponent)&&s.push(this.preloadConfig(a,o)),(o.children||o._loadedRoutes)&&s.push(this.processRoutes(c,o.children??o._loadedRoutes))}return Gt(s).pipe(wu())}preloadConfig(r,i){return this.preloadingStrategy.preload(i,()=>{let s;s=i.loadChildren&&void 0===i.canLoad?this.loader.loadChildren(r,i):he(null);const o=s.pipe(cn(a=>null===a?he(void 0):(i._loadedRoutes=a.routes,i._loadedInjector=a.injector,this.processRoutes(a.injector??r,a.routes))));return i.loadComponent&&!i._loadedComponent?Gt([o,this.loader.loadComponent(i)]).pipe(wu()):o})}static{this.\u0275fac=function(i){return new(i||e)(q(oi),q(wM),q(In),q(bO),q(Q_))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const X_=new z("");let EO=(()=>{class e{constructor(r,i,s,o,a={}){this.urlSerializer=r,this.transitions=i,this.viewportScroller=s,this.zone=o,this.options=a,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},a.scrollPositionRestoration||="disabled",a.anchorScrolling||="disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.transitions.events.subscribe(r=>{r instanceof Au?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=r.navigationTrigger,this.restoredId=r.restoredState?r.restoredState.navigationId:0):r instanceof Fi?(this.lastId=r.id,this.scheduleScrollEvent(r,this.urlSerializer.parse(r.urlAfterRedirects).fragment)):r instanceof oc&&r.code===vp.IgnoredSameUrlNavigation&&(this.lastSource=void 0,this.restoredId=0,this.scheduleScrollEvent(r,this.urlSerializer.parse(r.url).fragment))})}consumeScrollEvents(){return this.transitions.events.subscribe(r=>{r instanceof WR&&(r.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(r.position):r.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(r.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(r,i){this.zone.runOutsideAngular(()=>{setTimeout(()=>{this.zone.run(()=>{this.transitions.events.next(new WR(r,"popstate"===this.lastSource?this.store[this.restoredId]:null,i))})},0)})}ngOnDestroy(){this.routerEventsSubscription?.unsubscribe(),this.scrollEventsSubscription?.unsubscribe()}static{this.\u0275fac=function(i){!function nI(){throw new Error("invalid")}()}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})();function ai(e,t){return{\u0275kind:e,\u0275providers:t}}function DO(){const e=O(xt);return t=>{const r=e.get(ar);if(t!==r.components[0])return;const i=e.get(oi),s=e.get(SO);1===e.get(ew)&&i.initialNavigation(),e.get(TO,null,Te.Optional)?.setUpPreloading(),e.get(X_,null,Te.Optional)?.init(),i.resetRootComponentType(r.componentTypes[0]),s.closed||(s.next(),s.complete(),s.unsubscribe())}}const SO=new z("",{factory:()=>new Ze}),ew=new z("",{providedIn:"root",factory:()=>1}),TO=new z("");function fK(e){return ai(0,[{provide:TO,useExisting:cK},{provide:bO,useExisting:e}])}function pK(e){return ai(9,[{provide:mO,useValue:ZZ},{provide:yO,useValue:{skipNextTransition:!!e?.skipInitialTransition,...e}}])}const IO=new z("ROUTER_FORROOT_GUARD"),gK=[gu,{provide:sc,useClass:fp},oi,Nu,{provide:cc,useFactory:function CO(e){return e.routerState.root},deps:[oi]},Q_,[]];let xO=(()=>{class e{constructor(r){}static forRoot(r,i){return{ngModule:e,providers:[gK,[],{provide:hc,multi:!0,useValue:r},{provide:IO,useFactory:_K,deps:[[oi,new Kd,new Qd]]},{provide:fc,useValue:i||{}},i?.useHash?{provide:bo,useClass:N9}:{provide:bo,useClass:fN},{provide:X_,useFactory:()=>{const e=O(K7),t=O(Ne),r=O(fc),i=O(xp),s=O(sc);return r.scrollOffset&&e.setOffset(r.scrollOffset),new EO(s,i,e,t,r)}},i?.preloadingStrategy?fK(i.preloadingStrategy).\u0275providers:[],i?.initialNavigation?wK(i):[],i?.bindToComponentInputs?ai(8,[eO,{provide:Ep,useExisting:eO}]).\u0275providers:[],i?.enableViewTransitions?pK().\u0275providers:[],[{provide:AO,useFactory:DO},{provide:Rh,multi:!0,useExisting:AO}]]}}static forChild(r){return{ngModule:e,providers:[{provide:hc,multi:!0,useValue:r}]}}static{this.\u0275fac=function(i){return new(i||e)(q(IO,8))}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({})}}return e})();function _K(e){return"guarded"}function wK(e){return["disabled"===e.initialNavigation?ai(3,[{provide:P0,multi:!0,useFactory:()=>{const t=O(oi);return()=>{t.setUpLocationChangeListener()}}},{provide:ew,useValue:2}]).\u0275providers:[],"enabledBlocking"===e.initialNavigation?ai(2,[{provide:ew,useValue:0},{provide:P0,multi:!0,deps:[xt],useFactory:t=>{const r=t.get(A9,Promise.resolve());return()=>r.then(()=>new Promise(i=>{const s=t.get(oi),o=t.get(SO);wO(s,()=>{i(!0)}),t.get(xp).afterPreactivation=()=>(i(!0),o.closed?he(void 0):o),s.initialNavigation()}))}}]).\u0275providers:[]]}const AO=new z("");function MO(e,t,r,i,s,o,a){try{var c=e[o](a),l=c.value}catch(u){return void r(u)}c.done?t(l):Promise.resolve(l).then(i,s)}function U(e){return function(){var t=this,r=arguments;return new Promise(function(i,s){var o=e.apply(t,r);function a(l){MO(o,i,s,a,c,"next",l)}function c(l){MO(o,i,s,a,c,"throw",l)}a(void 0)})}}var Bi=function(e){return e.STRANGER="STRANGER",e.YOU="YOU",e}(Bi||{}),ci=function(e){return e.CONNECTED="CONNECTED",e.UP_TO_DISCONNECT="UP_TO_DISCONNECT",e.DISCONNECTED="DISCONNECTED",e.SEARCHING_STRANGER="SEARCHING_STRANGER",e}(ci||{});const EK=["modalContainer"];function CK(e,t){}class Fu{static{this.modalInjectSubject=new Ze}static{this.modalInject$=Fu.modalInjectSubject.asObservable()}constructor(t){this.component=t,this.injectData=null,this.cssClasses=[],this.outletName="default",this.subscription=new vt}setData(t){return this.injectData=t,this}setBindToRoute(t){return this.router=t,this}setRootCssClasses(t){return this.cssClasses=t,this}setOutletName(t){return this.outletName=t,this}build(){const t=new Ze,r=this.injectData,i=this.component,s=this.outletName;return this.router?(this.subscription.add(this.router.events.pipe(Li(o=>o instanceof Au)).pipe(ys()).subscribe(()=>{t.closed||t.complete()})),this.subscription.add(t.subscribe({complete:()=>this.subscription.unsubscribe()}))):console.warn(`Component "${i.name}" served as modal was not associated with the route and will not be automatically removed if the route is changed`),Fu.modalInjectSubject.next({component:i,data:r,outletName:s,cssClasses:this.cssClasses,response:t}),t.asObservable()}}let NO=(()=>{class e{createModal(r){return new Fu(r)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})(),DK=(()=>{class e{constructor(r){this.ngZone=r,this.modalInject$=Fu.modalInject$,this.classes=[],this.isOpen=!1,this.content=null,this.subscriptions=new vt,this.container=null,this.display="none",this.showingDisplay="block",this.name="default",this.opened=new dt,this.closed=new dt}ngOnInit(){this.listenModalInjection()}listenModalInjection(){this.subscriptions.add(this.modalInject$.subscribe({next:r=>this.renderModal(r)}))}renderModal(r){r.outletName===this.name&&setTimeout(()=>{this.open(),this.openModal(r)})}open(){this.ngZone.run(()=>{this.isOpen=!0,this.display=this.showingDisplay,this.opened.emit()})}close(){this.ngZone.run(()=>{this.isOpen=!1,this.display="none",this.closed.emit()})}getClasses(r){return(r=r||[]).concat(this.classes).join(" ")}openModal(r){const i=this.container;if(!i)return void console.error("Impossible to create modal: the this.container attribute is empty");i.clear();const s=this.content=i.createComponent(r.component).instance;this.classes=r.cssClasses,s?(s.response=r.response,s.onInjectData&&s.onInjectData(r.data||null),r.response.subscribe({error:this.closeModal.bind(this),complete:this.closeModal.bind(this)})):console.error(`Could not create component ${r.component.name} inside modal container.`)}closeModal(r){const i=this.container;i?setTimeout(()=>{i.clear(),this.close(),this.content?.response.complete()}):console.error("Impossible to create modal: the this.container attribute is empty",r)}ngOnDestroy(){this.subscriptions.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)(k(Ne))}}static{this.\u0275cmp=ns({type:e,selectors:[["modal-outlet"]],viewQuery:function(i,s){if(1&i&&b0(EK,5,rr),2&i){let o;Dh(o=Sh())&&(s.container=o.first)}},hostVars:2,hostBindings:function(i,s){2&i&&vo("display",s.display)},inputs:{showingDisplay:"showingDisplay",name:"name"},outputs:{opened:"opened",closed:"closed"},decls:2,vars:0,consts:[["modalContainer",""]],template:function(i,s){1&i&&sr(0,CK,0,0,"ng-template",null,0,WA)},encapsulation:2})}}return e})(),SK=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({providers:[NO]})}}return e})();class TK{close(){this.response.complete()}}function Bu(e){-1===e.indexOf("://")&&(e="wss://"+e);let t=new URL(e);return t.pathname=t.pathname.replace(/\/+/g,"/"),t.pathname.endsWith("/")&&(t.pathname=t.pathname.slice(0,-1)),("80"===t.port&&"ws:"===t.protocol||"443"===t.port&&"wss:"===t.protocol)&&(t.port=""),t.searchParams.sort(),t.hash="",t.toString()}new TextDecoder("utf-8"),new TextEncoder;let tw=(()=>{class e{saveConfig(r){localStorage.setItem("omeglestr",JSON.stringify({relays:r}))}getConfig(){const r=localStorage.getItem("omeglestr");try{if(r)return JSON.parse(r).relays.map(Bu)}catch{}return"wss://relay.nostr.net".split(",").map(Bu)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const ln=new z(""),bs=new z("");function zO(e){return null!=e}function qO(e){return cu(e)?Gt(e):e}function GO(e){let t={};return e.forEach(r=>{t=null!=r?{...t,...r}:t}),0===Object.keys(t).length?null:t}function WO(e,t){return t.map(r=>r(e))}function ZO(e){return e.map(t=>function kK(e){return!e.validate}(t)?t:r=>t.validate(r))}function rw(e){return null!=e?function KO(e){if(!e)return null;const t=e.filter(zO);return 0==t.length?null:function(r){return GO(WO(r,t))}}(ZO(e)):null}function iw(e){return null!=e?function QO(e){if(!e)return null;const t=e.filter(zO);return 0==t.length?null:function(r){return function xK(...e){const t=_R(e),{args:r,keys:i}=wR(e),s=new Ht(o=>{const{length:a}=r;if(!a)return void o.complete();const c=new Array(a);let l=a,u=a;for(let d=0;d{f||(f=!0,u--),c[d]=h},()=>l--,void 0,()=>{(!l||!f)&&(u||o.next(i?ER(i,c):c),o.complete())}))}});return t?s.pipe(bR(t)):s}(WO(r,t).map(qO)).pipe(Ue(GO))}}(ZO(e)):null}function YO(e,t){return null===e?[t]:Array.isArray(e)?[...e,t]:[e,t]}function sw(e){return e?Array.isArray(e)?e:[e]:[]}function Mp(e,t){return Array.isArray(e)?e.includes(t):e===t}function ek(e,t){const r=sw(t);return sw(e).forEach(s=>{Mp(r,s)||r.push(s)}),r}function tk(e,t){return sw(t).filter(r=>!Mp(e,r))}class nk{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=rw(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=iw(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t=void 0){this.control&&this.control.reset(t)}hasError(t,r){return!!this.control&&this.control.hasError(t,r)}getError(t,r){return this.control?this.control.getError(t,r):null}}class bn extends nk{get formDirective(){return null}get path(){return null}}class rk{constructor(t){this._cd=t}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}}let ik=(()=>{class e extends rk{constructor(r){super(r)}static{this.\u0275fac=function(i){return new(i||e)(k(bn,10))}}static{this.\u0275dir=de({type:e,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(i,s){2&i&&Ql("ng-untouched",s.isUntouched)("ng-touched",s.isTouched)("ng-pristine",s.isPristine)("ng-dirty",s.isDirty)("ng-valid",s.isValid)("ng-invalid",s.isInvalid)("ng-pending",s.isPending)("ng-submitted",s.isSubmitted)},features:[je]})}}return e})();const Vu="VALID",Rp="INVALID",pc="PENDING",Uu="DISABLED";class gc{}class ok extends gc{constructor(t,r){super(),this.value=t,this.source=r}}class cw extends gc{constructor(t,r){super(),this.pristine=t,this.source=r}}class lw extends gc{constructor(t,r){super(),this.touched=t,this.source=r}}class Op extends gc{constructor(t,r){super(),this.status=t,this.source=r}}function kp(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}class fw{constructor(t,r){this._pendingDirty=!1,this._hasOwnPendingAsyncValidator=null,this._pendingTouched=!1,this._onCollectionChange=()=>{},this._parent=null,this._status=pu(()=>this.statusReactive()),this.statusReactive=Zr(void 0),this._pristine=pu(()=>this.pristineReactive()),this.pristineReactive=Zr(!0),this._touched=pu(()=>this.touchedReactive()),this.touchedReactive=Zr(!1),this._events=new Ze,this.events=this._events.asObservable(),this._onDisabledChange=[],this._assignValidators(t),this._assignAsyncValidators(r)}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t}get parent(){return this._parent}get status(){return ei(this.statusReactive)}set status(t){ei(()=>this.statusReactive.set(t))}get valid(){return this.status===Vu}get invalid(){return this.status===Rp}get pending(){return this.status==pc}get disabled(){return this.status===Uu}get enabled(){return this.status!==Uu}get pristine(){return ei(this.pristineReactive)}set pristine(t){ei(()=>this.pristineReactive.set(t))}get dirty(){return!this.pristine}get touched(){return ei(this.touchedReactive)}set touched(t){ei(()=>this.touchedReactive.set(t))}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._assignValidators(t)}setAsyncValidators(t){this._assignAsyncValidators(t)}addValidators(t){this.setValidators(ek(t,this._rawValidators))}addAsyncValidators(t){this.setAsyncValidators(ek(t,this._rawAsyncValidators))}removeValidators(t){this.setValidators(tk(t,this._rawValidators))}removeAsyncValidators(t){this.setAsyncValidators(tk(t,this._rawAsyncValidators))}hasValidator(t){return Mp(this._rawValidators,t)}hasAsyncValidator(t){return Mp(this._rawAsyncValidators,t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){const r=!1===this.touched;this.touched=!0;const i=t.sourceControl??this;this._parent&&!t.onlySelf&&this._parent.markAsTouched({...t,sourceControl:i}),r&&!1!==t.emitEvent&&this._events.next(new lw(!0,i))}markAllAsTouched(t={}){this.markAsTouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(r=>r.markAllAsTouched(t))}markAsUntouched(t={}){const r=!0===this.touched;this.touched=!1,this._pendingTouched=!1;const i=t.sourceControl??this;this._forEachChild(s=>{s.markAsUntouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:i})}),this._parent&&!t.onlySelf&&this._parent._updateTouched(t,i),r&&!1!==t.emitEvent&&this._events.next(new lw(!1,i))}markAsDirty(t={}){const r=!0===this.pristine;this.pristine=!1;const i=t.sourceControl??this;this._parent&&!t.onlySelf&&this._parent.markAsDirty({...t,sourceControl:i}),r&&!1!==t.emitEvent&&this._events.next(new cw(!1,i))}markAsPristine(t={}){const r=!1===this.pristine;this.pristine=!0,this._pendingDirty=!1;const i=t.sourceControl??this;this._forEachChild(s=>{s.markAsPristine({onlySelf:!0,emitEvent:t.emitEvent})}),this._parent&&!t.onlySelf&&this._parent._updatePristine(t,i),r&&!1!==t.emitEvent&&this._events.next(new cw(!0,i))}markAsPending(t={}){this.status=pc;const r=t.sourceControl??this;!1!==t.emitEvent&&(this._events.next(new Op(this.status,r)),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.markAsPending({...t,sourceControl:r})}disable(t={}){const r=this._parentMarkedDirty(t.onlySelf);this.status=Uu,this.errors=null,this._forEachChild(s=>{s.disable({...t,onlySelf:!0})}),this._updateValue();const i=t.sourceControl??this;!1!==t.emitEvent&&(this._events.next(new ok(this.value,i)),this._events.next(new Op(this.status,i)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors({...t,skipPristineCheck:r},this),this._onDisabledChange.forEach(s=>s(!0))}enable(t={}){const r=this._parentMarkedDirty(t.onlySelf);this.status=Vu,this._forEachChild(i=>{i.enable({...t,onlySelf:!0})}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors({...t,skipPristineCheck:r},this),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(t,r){this._parent&&!t.onlySelf&&(this._parent.updateValueAndValidity(t),t.skipPristineCheck||this._parent._updatePristine({},r),this._parent._updateTouched({},r))}setParent(t){this._parent=t}getRawValue(){return this.value}updateValueAndValidity(t={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){const i=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===Vu||this.status===pc)&&this._runAsyncValidator(i,t.emitEvent)}const r=t.sourceControl??this;!1!==t.emitEvent&&(this._events.next(new ok(this.value,r)),this._events.next(new Op(this.status,r)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity({...t,sourceControl:r})}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(r=>r._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?Uu:Vu}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t,r){if(this.asyncValidator){this.status=pc,this._hasOwnPendingAsyncValidator={emitEvent:!1!==r};const i=qO(this.asyncValidator(this));this._asyncValidationSubscription=i.subscribe(s=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(s,{emitEvent:r,shouldHaveEmitted:t})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();const t=this._hasOwnPendingAsyncValidator?.emitEvent??!1;return this._hasOwnPendingAsyncValidator=null,t}return!1}setErrors(t,r={}){this.errors=t,this._updateControlsErrors(!1!==r.emitEvent,this,r.shouldHaveEmitted)}get(t){let r=t;return null==r||(Array.isArray(r)||(r=r.split(".")),0===r.length)?null:r.reduce((i,s)=>i&&i._find(s),this)}getError(t,r){const i=r?this.get(r):this;return i&&i.errors?i.errors[t]:null}hasError(t,r){return!!this.getError(t,r)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t,r,i){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),(t||i)&&this._events.next(new Op(this.status,r)),this._parent&&this._parent._updateControlsErrors(t,r,i)}_initObservables(){this.valueChanges=new dt,this.statusChanges=new dt}_calculateStatus(){return this._allControlsDisabled()?Uu:this.errors?Rp:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(pc)?pc:this._anyControlsHaveStatus(Rp)?Rp:Vu}_anyControlsHaveStatus(t){return this._anyControls(r=>r.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t,r){const i=!this._anyControlsDirty(),s=this.pristine!==i;this.pristine=i,this._parent&&!t.onlySelf&&this._parent._updatePristine(t,r),s&&this._events.next(new cw(this.pristine,r))}_updateTouched(t={},r){this.touched=this._anyControlsTouched(),this._events.next(new lw(this.touched,r)),this._parent&&!t.onlySelf&&this._parent._updateTouched(t,r)}_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){kp(t)&&null!=t.updateOn&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){return!t&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}_find(t){return null}_assignValidators(t){this._rawValidators=Array.isArray(t)?t.slice():t,this._composedValidatorFn=function $K(e){return Array.isArray(e)?rw(e):e||null}(this._rawValidators)}_assignAsyncValidators(t){this._rawAsyncValidators=Array.isArray(t)?t.slice():t,this._composedAsyncValidatorFn=function HK(e){return Array.isArray(e)?iw(e):e||null}(this._rawAsyncValidators)}}class hw extends fw{constructor(t,r,i){super(function uw(e){return(kp(e)?e.validators:e)||null}(r),function dw(e,t){return(kp(t)?t.asyncValidators:e)||null}(i,r)),this.controls=t,this._initObservables(),this._setUpdateStrategy(r),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}registerControl(t,r){return this.controls[t]?this.controls[t]:(this.controls[t]=r,r.setParent(this),r._registerOnCollectionChange(this._onCollectionChange),r)}addControl(t,r,i={}){this.registerControl(t,r),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(t,r={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity({emitEvent:r.emitEvent}),this._onCollectionChange()}setControl(t,r,i={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],r&&this.registerControl(t,r),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled}setValue(t,r={}){(function ck(e,t,r){e._forEachChild((i,s)=>{if(void 0===r[s])throw new A(1002,"")})})(this,0,t),Object.keys(t).forEach(i=>{(function ak(e,t,r){const i=e.controls;if(!(t?Object.keys(i):i).length)throw new A(1e3,"");if(!i[r])throw new A(1001,"")})(this,!0,i),this.controls[i].setValue(t[i],{onlySelf:!0,emitEvent:r.emitEvent})}),this.updateValueAndValidity(r)}patchValue(t,r={}){null!=t&&(Object.keys(t).forEach(i=>{const s=this.controls[i];s&&s.patchValue(t[i],{onlySelf:!0,emitEvent:r.emitEvent})}),this.updateValueAndValidity(r))}reset(t={},r={}){this._forEachChild((i,s)=>{i.reset(t?t[s]:null,{onlySelf:!0,emitEvent:r.emitEvent})}),this._updatePristine(r,this),this._updateTouched(r,this),this.updateValueAndValidity(r)}getRawValue(){return this._reduceChildren({},(t,r,i)=>(t[i]=r.getRawValue(),t))}_syncPendingControls(){let t=this._reduceChildren(!1,(r,i)=>!!i._syncPendingControls()||r);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_forEachChild(t){Object.keys(this.controls).forEach(r=>{const i=this.controls[r];i&&t(i,r)})}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(t){for(const[r,i]of Object.entries(this.controls))if(this.contains(r)&&t(i))return!0;return!1}_reduceValue(){return this._reduceChildren({},(r,i,s)=>((i.enabled||this.disabled)&&(r[s]=i.value),r))}_reduceChildren(t,r){let i=t;return this._forEachChild((s,o)=>{i=r(i,s,o)}),i}_allControlsDisabled(){for(const t of Object.keys(this.controls))if(this.controls[t].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(t){return this.controls.hasOwnProperty(t)?this.controls[t]:null}}const mc=new z("CallSetDisabledState",{providedIn:"root",factory:()=>Pp}),Pp="always";function Bp(e,t){e.forEach(r=>{r.registerOnValidatorChange&&r.registerOnValidatorChange(t)})}function pw(e,t){const r=function JO(e){return e._rawValidators}(e);null!==t.validator?e.setValidators(YO(r,t.validator)):"function"==typeof r&&e.setValidators([r]);const i=function XO(e){return e._rawAsyncValidators}(e);null!==t.asyncValidator?e.setAsyncValidators(YO(i,t.asyncValidator)):"function"==typeof i&&e.setAsyncValidators([i]);const s=()=>e.updateValueAndValidity();Bp(t._rawValidators,s),Bp(t._rawAsyncValidators,s)}function lk(e,t){e._pendingDirty&&e.markAsDirty(),e.setValue(e._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1}const XK={provide:bn,useExisting:et(()=>Up)},$u=Promise.resolve();let Up=(()=>{class e extends bn{get submitted(){return ei(this.submittedReactive)}constructor(r,i,s){super(),this.callSetDisabledState=s,this._submitted=pu(()=>this.submittedReactive()),this.submittedReactive=Zr(!1),this._directives=new Set,this.ngSubmit=new dt,this.form=new hw({},rw(r),iw(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(r){$u.then(()=>{const i=this._findContainer(r.path);r.control=i.registerControl(r.name,r.control),function ju(e,t,r=Pp){pw(e,t),t.valueAccessor.writeValue(e.value),(e.disabled||"always"===r)&&t.valueAccessor.setDisabledState?.(e.disabled),function GK(e,t){t.valueAccessor.registerOnChange(r=>{e._pendingValue=r,e._pendingChange=!0,e._pendingDirty=!0,"change"===e.updateOn&&lk(e,t)})}(e,t),function ZK(e,t){const r=(i,s)=>{t.valueAccessor.writeValue(i),s&&t.viewToModelUpdate(i)};e.registerOnChange(r),t._registerOnDestroy(()=>{e._unregisterOnChange(r)})}(e,t),function WK(e,t){t.valueAccessor.registerOnTouched(()=>{e._pendingTouched=!0,"blur"===e.updateOn&&e._pendingChange&&lk(e,t),"submit"!==e.updateOn&&e.markAsTouched()})}(e,t),function qK(e,t){if(t.valueAccessor.setDisabledState){const r=i=>{t.valueAccessor.setDisabledState(i)};e.registerOnDisabledChange(r),t._registerOnDestroy(()=>{e._unregisterOnDisabledChange(r)})}}(e,t)}(r.control,r,this.callSetDisabledState),r.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(r)})}getControl(r){return this.form.get(r.path)}removeControl(r){$u.then(()=>{const i=this._findContainer(r.path);i&&i.removeControl(r.name),this._directives.delete(r)})}addFormGroup(r){$u.then(()=>{const i=this._findContainer(r.path),s=new hw({});(function uk(e,t){pw(e,t)})(s,r),i.registerControl(r.name,s),s.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(r){$u.then(()=>{const i=this._findContainer(r.path);i&&i.removeControl(r.name)})}getFormGroup(r){return this.form.get(r.path)}updateModel(r,i){$u.then(()=>{this.form.get(r.path).setValue(i)})}setValue(r){this.control.setValue(r)}onSubmit(r){return this.submittedReactive.set(!0),function dk(e,t){e._syncPendingControls(),t.forEach(r=>{const i=r.control;"submit"===i.updateOn&&i._pendingChange&&(r.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}(this.form,this._directives),this.ngSubmit.emit(r),"dialog"===r?.target?.method}onReset(){this.resetForm()}resetForm(r=void 0){this.form.reset(r),this.submittedReactive.set(!1)}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)}_findContainer(r){return r.pop(),r.length?this.form.get(r):this.form}static{this.\u0275fac=function(i){return new(i||e)(k(ln,10),k(bs,10),k(mc,8))}}static{this.\u0275dir=de({type:e,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(i,s){1&i&&$e("submit",function(a){return s.onSubmit(a)})("reset",function(){return s.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[ft([XK]),je]})}}return e})();Promise.resolve();let _k=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275dir=de({type:e,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""]})}}return e})(),TQ=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({})}}return e})(),xQ=(()=>{class e{static withConfig(r){return{ngModule:e,providers:[{provide:mc,useValue:r.callSetDisabledState??Pp}]}}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({imports:[TQ]})}}return e})();function AQ(e,t){if(1&e){const r=Jr();fe(0,"li")(1,"span"),Le(2),me(),fe(3,"button",18),$e("click",function(){const s=Kt(r).$implicit;return Qt(Ct().removeRelay(s))}),Le(4,"\u2715"),me()()}if(2&e){const r=t.$implicit;be(2),Qa(r)}}let MQ=(()=>{class e extends TK{constructor(r){super(),this.relayConfigService=r,this.response=new Ze,this.relays=[]}ngOnInit(){this.relays=this.relayConfigService.getConfig()}removeRelay(r){const i=Bu(r),o=this.relays.indexOf(i);-1!==o&&this.relays.splice(o,1)}addRelay(r){r.value&&(this.relays=[...new Set([...this.relays,Bu(r.value)])],r.value="")}ok(){this.response.next(!0),this.close()}cancel(){this.response.next(!1),this.close()}useDefault(){this.relays="wss://relay.nostr.net".split(",").map(Bu),this.save()}save(){this.relayConfigService.saveConfig([...new Set(this.relays)]),this.close()}static{this.\u0275fac=function(i){return new(i||e)(k(tw))}}static{this.\u0275cmp=ns({type:e,selectors:[["omg-relay-config"]],features:[je],decls:30,vars:1,consts:[["relayField",""],["type","button",1,"closeButton","exitButton",3,"click"],[1,"relayList"],[4,"ngFor","ngForOf"],[1,"warn"],[1,"field"],[1,"fieldWithButton"],["name","relay","type","text","autocomplete","off","placeholder","wss://relay.example",3,"keyup.enter"],["type","button",3,"click"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["stroke","none","d","M0 0h24v24H0z","fill","none"],["d","M7 12l5 5l-1.5 1.5a3.536 3.536 0 1 1 -5 -5l1.5 -1.5z"],["d","M17 12l-5 -5l1.5 -1.5a3.536 3.536 0 1 1 5 5l-1.5 1.5z"],["d","M3 21l2.5 -2.5"],["d","M18.5 5.5l2.5 -2.5"],["d","M10 11l-2 2"],["d","M13 14l-2 2"],[1,"button-group"],["type","button",1,"closeButton",3,"click"]],template:function(i,s){if(1&i){const o=Jr();fe(0,"form")(1,"h1")(2,"span"),Le(3,"Configure nostr relays"),me(),fe(4,"button",1),$e("click",function(){return Kt(o),Qt(s.close())}),Le(5,"\u2715"),me()(),fe(6,"ul",2),sr(7,AQ,5,1,"li",3),me(),fe(8,"span",4),Le(9,"By changing default relays, will be harder find strangers"),me(),fe(10,"div",5)(11,"label"),Le(12,"Relay"),me(),fe(13,"div",6)(14,"input",7,0),$e("keyup.enter",function(){Kt(o);const c=Ka(15);return Qt(s.addRelay(c))}),me(),fe(16,"button",8),$e("click",function(){Kt(o);const c=Ka(15);return Qt(s.addRelay(c))}),yf(),fe(17,"svg",9),or(18,"path",10)(19,"path",11)(20,"path",12)(21,"path",13)(22,"path",14)(23,"path",15)(24,"path",16),me()()()(),vf(),fe(25,"div",17)(26,"button",8),$e("click",function(){return Kt(o),Qt(s.useDefault())}),Le(27,"Use default"),me(),fe(28,"button",8),$e("click",function(){return Kt(o),Qt(s.save())}),Le(29,"Save"),me()()()}2&i&&(be(7),qe("ngForOf",s.relays))},dependencies:[s_,_k,ik,Up],styles:[".closeButton[_ngcontent-%COMP%]{border:0;cursor:pointer;appearance:none;background-color:transparent;font-size:10px;margin-left:1rem}.closeButton.exitButton[_ngcontent-%COMP%]{float:right}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column}h1[_ngcontent-%COMP%]{font-size:14px;margin-bottom:1rem}.fieldWithButton[_ngcontent-%COMP%]{display:flex}.fieldWithButton[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{padding:3px 1rem;border-radius:5px 0 0 5px;border:1px solid black}.fieldWithButton[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border-left:0;border-radius:0 5px 5px 0}button[_ngcontent-%COMP%]{background-color:#fff;border:1px solid black;padding:.25rem .5rem;border-radius:5px;cursor:pointer}button[_ngcontent-%COMP%]:hover{background-color:#f1f1f1}button[_ngcontent-%COMP%]:active{background-color:#e6e6e6}.button-group[_ngcontent-%COMP%]{display:flex;margin:1rem 0 0;justify-content:space-between}"]})}}return e})(),Dw=(()=>{class e extends Ze{constructor(){super()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),Sw=(()=>{class e extends nr{constructor(r){super(),this.error$=r}handleError(r){/^AbortError/.test(String(r))||(r.errors&&r.errors.length?r.errors.forEach(i=>{console.error((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]",i.message),this.error$.next(i.message)}):r.message?(console.error((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]",r.message),this.error$.next(r.message)):(console.error((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","application throw unkown error"),this.error$.next("application throw unkown error")))}getErrorMessage(r){if(!/^AbortError/.test(String(r))){if(r.errors&&r.errors.length)return r.errors.map(i=>i.message);if(r.message)return[r.message]}return[]}static{this.\u0275fac=function(i){return new(i||e)(q(Dw))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function Cs(e){var t,r,i,s=2;for(typeof Symbol<"u"&&(r=Symbol.asyncIterator,i=Symbol.iterator);s--;){if(r&&null!=(t=e[r]))return t.call(e);if(i&&null!=(t=e[i]))return new jp(t.call(e));r="@@asyncIterator",i="@@iterator"}throw new TypeError("Object is not async iterable")}function jp(e){function t(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var i=r.done;return Promise.resolve(r.value).then(function(s){return{value:s,done:i}})}return(jp=function(i){this.s=i,this.n=i.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(i){var s=this.s.return;return void 0===s?Promise.resolve({value:i,done:!0}):t(s.apply(this.s,arguments))},throw:function(i){var s=this.s.return;return void 0===s?Promise.reject(i):t(s.apply(this.s,arguments))}},new jp(e)}function Tw(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function Iw(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function Hu(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}const xw="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,Aw=e=>e instanceof Uint8Array,Mw=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),ui=(e,t)=>e<<32-t|e>>>t;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");function zu(e){if("string"==typeof e&&(e=function kQ(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),!Aw(e))throw new Error("expected Uint8Array, got "+typeof e);return e}class Uk{clone(){return this._cloneInto()}}function FQ(e){const t=i=>e().update(zu(i)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function jk(e=32){if(xw&&"function"==typeof xw.getRandomValues)return xw.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}class VQ extends Uk{constructor(t,r,i,s){super(),this.blockLen=t,this.outputLen=r,this.padOffset=i,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Mw(this.buffer)}update(t){Hu(this);const{view:r,buffer:i,blockLen:s}=this,o=(t=zu(t)).length;for(let a=0;as-a&&(this.process(i,0),a=0);for(let f=a;f>s&o),c=Number(r&o),u=i?0:4;e.setUint32(t+(i?4:0),a,i),e.setUint32(t+u,c,i)})(i,s-8,BigInt(8*this.length),o),this.process(i,0);const c=Mw(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;fe&t^~e&r,jQ=(e,t,r)=>e&t^e&r^t&r,$Q=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ds=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ss=new Uint32Array(64);class $k extends VQ{constructor(){super(64,32,8,!1),this.A=0|Ds[0],this.B=0|Ds[1],this.C=0|Ds[2],this.D=0|Ds[3],this.E=0|Ds[4],this.F=0|Ds[5],this.G=0|Ds[6],this.H=0|Ds[7]}get(){const{A:t,B:r,C:i,D:s,E:o,F:a,G:c,H:l}=this;return[t,r,i,s,o,a,c,l]}set(t,r,i,s,o,a,c,l){this.A=0|t,this.B=0|r,this.C=0|i,this.D=0|s,this.E=0|o,this.F=0|a,this.G=0|c,this.H=0|l}process(t,r){for(let f=0;f<16;f++,r+=4)Ss[f]=t.getUint32(r,!1);for(let f=16;f<64;f++){const h=Ss[f-15],p=Ss[f-2],g=ui(h,7)^ui(h,18)^h>>>3,m=ui(p,17)^ui(p,19)^p>>>10;Ss[f]=m+Ss[f-7]+g+Ss[f-16]|0}let{A:i,B:s,C:o,D:a,E:c,F:l,G:u,H:d}=this;for(let f=0;f<64;f++){const p=d+(ui(c,6)^ui(c,11)^ui(c,25))+UQ(c,l,u)+$Q[f]+Ss[f]|0,m=(ui(i,2)^ui(i,13)^ui(i,22))+jQ(i,s,o)|0;d=u,u=l,l=c,c=a+p|0,a=o,o=s,s=i,i=p+m|0}i=i+this.A|0,s=s+this.B|0,o=o+this.C|0,a=a+this.D|0,c=c+this.E|0,l=l+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(i,s,o,a,c,l,u,d)}roundClean(){Ss.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Rw=FQ(()=>new $k),$p=(BigInt(0),BigInt(1)),HQ=BigInt(2),Hp=e=>e instanceof Uint8Array,zQ=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function yc(e){if(!Hp(e))throw new Error("Uint8Array expected");let t="";for(let r=0;ri+s.length,0));let r=0;return e.forEach(i=>{if(!Hp(i))throw new Error("Uint8Array expected");t.set(i,r),r+=i.length}),t}const Pw=e=>(HQ<new Uint8Array(e),qk=e=>Uint8Array.from(e);function Gk(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let i=Lw(e),s=Lw(e),o=0;const a=()=>{i.fill(1),s.fill(0),o=0},c=(...f)=>r(s,i,...f),l=(f=Lw())=>{s=c(qk([0]),f),i=c(),0!==f.length&&(s=c(qk([1]),f),i=c())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const h=[];for(;f{let p;for(a(),l(f);!(p=h(u()));)l();return a(),p}}const GQ={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function qu(e,t,r={}){const i=(s,o,a)=>{const c=GQ[o];if("function"!=typeof c)throw new Error(`Invalid validator "${o}", expected function`);const l=e[s];if(!(a&&void 0===l||c(l,e)))throw new Error(`Invalid param ${String(s)}=${l} (${typeof l}), expected ${o}`)};for(const[s,o]of Object.entries(t))i(s,o,!1);for(const[s,o]of Object.entries(r))i(s,o,!0);return e}const Ut=BigInt(0),Ye=BigInt(1),Is=BigInt(2),WQ=BigInt(3),Fw=BigInt(4),Wk=BigInt(5),Zk=BigInt(8);function jt(e,t){const r=e%t;return r>=Ut?r:t+r}function QQ(e,t,r){if(r<=Ut||t 0");if(r===Ye)return Ut;let i=Ye;for(;t>Ut;)t&Ye&&(i=i*e%r),e=e*e%r,t>>=Ye;return i}function ur(e,t,r){let i=e;for(;t-- >Ut;)i*=i,i%=r;return i}function zp(e,t){if(e===Ut||t<=Ut)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=jt(e,t),i=t,s=Ut,o=Ye,a=Ye,c=Ut;for(;r!==Ut;){const u=i/r,d=i%r,f=s-a*u,h=o-c*u;i=r,r=d,s=a,o=c,a=f,c=h}if(i!==Ye)throw new Error("invert: does not exist");return jt(s,t)}BigInt(9),BigInt(16);const XQ=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Bw(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function Kk(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function Qk(e){const t=Kk(e);return t+Math.ceil(t/2)}class Yk extends Uk{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,function Bk(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");Tw(e.outputLen),Tw(e.blockLen)}(t);const i=zu(r);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,o=new Uint8Array(s);o.set(i.length>s?t.create().update(i).digest():i);for(let a=0;anew Yk(e,t).update(r).digest();Jk.create=(e,t)=>new Yk(e,t);const sY=BigInt(0),Vw=BigInt(1);function Xk(e){return function eY(e){qu(e,XQ.reduce((i,s)=>(i[s]="function",i),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"}))}(e.Fp),qu(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Bw(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const{Ph:cY,aT:lY}=Wc,Mo={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=Mo;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");const r=e[1],i=e.subarray(2,r+2);if(!r||i.length!==r)throw new t("Invalid signature integer: wrong length");if(128&i[0])throw new t("Invalid signature integer: negative");if(0===i[0]&&!(128&i[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:cY(i),l:e.subarray(r+2)}},toSig(e){const{Err:t}=Mo,r="string"==typeof e?lY(e):e;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let i=r.length;if(i<2||48!=r[0])throw new t("Invalid signature tag");if(r[1]!==i-2)throw new t("Invalid signature: incorrect length");const{d:s,l:o}=Mo._parseInt(r.subarray(2)),{d:a,l:c}=Mo._parseInt(o);if(c.length)throw new t("Invalid signature: left bytes after parsing");return{r:s,s:a}},hexFromSig(e){const t=u=>8&Number.parseInt(u[0],16)?"00"+u:u,r=u=>{const d=u.toString(16);return 1&d.length?`0${d}`:d},i=t(r(e.s)),s=t(r(e.r)),o=i.length/2,a=s.length/2,c=r(o),l=r(a);return`30${r(a+o+4)}02${l}${s}02${c}${i}`}},Ar=BigInt(0),pt=BigInt(1),qp=(BigInt(2),BigInt(3));function fY(e){const t=function dY(e){const t=Xk(e);return qu(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:r,n:i}=t,s=r.BYTES+1,o=2*r.BYTES+1;function c(T){return jt(T,i)}function l(T){return zp(T,i)}const{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:h}=function uY(e){const t=function aY(e){const t=Xk(e);qu(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:i,a:s}=t;if(r){if(!i.eql(s,i.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:r}=t,i=t.toBytes||((g,m,y)=>{const _=m.toAffine();return Ao(Uint8Array.from([4]),r.toBytes(_.x),r.toBytes(_.y))}),s=t.fromBytes||(g=>{const m=g.subarray(1);return{x:r.fromBytes(m.subarray(0,r.BYTES)),y:r.fromBytes(m.subarray(r.BYTES,2*r.BYTES))}});function o(g){const{a:m,b:y}=t,_=r.sqr(g),v=r.mul(_,g);return r.add(r.add(v,r.mul(g,m)),y)}if(!r.eql(r.sqr(t.Gy),o(t.Gx)))throw new Error("bad generator point: equation left != right");function a(g){return"bigint"==typeof g&&Arr.eql(w,r.ZERO);return v(y)&&v(_)?f.ZERO:new f(y,_,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){const y=r.invertBatch(m.map(_=>_.pz));return m.map((_,v)=>_.toAffine(y[v])).map(f.fromAffine)}static fromHex(m){const y=f.fromAffine(s(un("pointHex",m)));return y.assertValidity(),y}static fromPrivateKey(m){return f.BASE.multiply(l(m))}_setWindowSize(m){this._WINDOW_SIZE=m,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:m,y}=this.toAffine();if(!r.isValid(m)||!r.isValid(y))throw new Error("bad point: x or y not FE");const _=r.sqr(y),v=o(m);if(!r.eql(_,v))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:m}=this.toAffine();if(r.isOdd)return!r.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){d(m);const{px:y,py:_,pz:v}=this,{px:w,py:b,pz:D}=m,C=r.eql(r.mul(y,D),r.mul(w,v)),S=r.eql(r.mul(_,D),r.mul(b,v));return C&&S}negate(){return new f(this.px,r.neg(this.py),this.pz)}double(){const{a:m,b:y}=t,_=r.mul(y,qp),{px:v,py:w,pz:b}=this;let D=r.ZERO,C=r.ZERO,S=r.ZERO,I=r.mul(v,v),P=r.mul(w,w),H=r.mul(b,b),V=r.mul(v,w);return V=r.add(V,V),S=r.mul(v,b),S=r.add(S,S),D=r.mul(m,S),C=r.mul(_,H),C=r.add(D,C),D=r.sub(P,C),C=r.add(P,C),C=r.mul(D,C),D=r.mul(V,D),S=r.mul(_,S),H=r.mul(m,H),V=r.sub(I,H),V=r.mul(m,V),V=r.add(V,S),S=r.add(I,I),I=r.add(S,I),I=r.add(I,H),I=r.mul(I,V),C=r.add(C,I),H=r.mul(w,b),H=r.add(H,H),I=r.mul(H,V),D=r.sub(D,I),S=r.mul(H,P),S=r.add(S,S),S=r.add(S,S),new f(D,C,S)}add(m){d(m);const{px:y,py:_,pz:v}=this,{px:w,py:b,pz:D}=m;let C=r.ZERO,S=r.ZERO,I=r.ZERO;const P=t.a,H=r.mul(t.b,qp);let V=r.mul(y,w),$=r.mul(_,b),X=r.mul(v,D),L=r.add(y,_),T=r.add(w,b);L=r.mul(L,T),T=r.add(V,$),L=r.sub(L,T),T=r.add(y,v);let E=r.add(w,D);return T=r.mul(T,E),E=r.add(V,X),T=r.sub(T,E),E=r.add(_,v),C=r.add(b,D),E=r.mul(E,C),C=r.add($,X),E=r.sub(E,C),I=r.mul(P,T),C=r.mul(H,X),I=r.add(C,I),C=r.sub($,I),I=r.add($,I),S=r.mul(C,I),$=r.add(V,V),$=r.add($,V),X=r.mul(P,X),T=r.mul(H,T),$=r.add($,X),X=r.sub(V,X),X=r.mul(P,X),T=r.add(T,X),V=r.mul($,T),S=r.add(S,V),V=r.mul(E,T),C=r.mul(L,C),C=r.sub(C,V),V=r.mul(L,$),I=r.mul(E,I),I=r.add(I,V),new f(C,S,I)}subtract(m){return this.add(m.negate())}is0(){return this.equals(f.ZERO)}wNAF(m){return p.wNAFCached(this,u,m,y=>{const _=r.invertBatch(y.map(v=>v.pz));return y.map((v,w)=>v.toAffine(_[w])).map(f.fromAffine)})}multiplyUnsafe(m){const y=f.ZERO;if(m===Ar)return y;if(c(m),m===pt)return this;const{endo:_}=t;if(!_)return p.unsafeLadder(this,m);let{k1neg:v,k1:w,k2neg:b,k2:D}=_.splitScalar(m),C=y,S=y,I=this;for(;w>Ar||D>Ar;)w&pt&&(C=C.add(I)),D&pt&&(S=S.add(I)),I=I.double(),w>>=pt,D>>=pt;return v&&(C=C.negate()),b&&(S=S.negate()),S=new f(r.mul(S.px,_.beta),S.py,S.pz),C.add(S)}multiply(m){c(m);let _,v,y=m;const{endo:w}=t;if(w){const{k1neg:b,k1:D,k2neg:C,k2:S}=w.splitScalar(y);let{p:I,f:P}=this.wNAF(D),{p:H,f:V}=this.wNAF(S);I=p.constTimeNegate(b,I),H=p.constTimeNegate(C,H),H=new f(r.mul(H.px,w.beta),H.py,H.pz),_=I.add(H),v=P.add(V)}else{const{p:b,f:D}=this.wNAF(y);_=b,v=D}return f.normalizeZ([_,v])[0]}multiplyAndAddUnsafe(m,y,_){const v=f.BASE,w=(D,C)=>C!==Ar&&C!==pt&&D.equals(v)?D.multiply(C):D.multiplyUnsafe(C),b=w(this,y).add(w(m,_));return b.is0()?void 0:b}toAffine(m){const{px:y,py:_,pz:v}=this,w=this.is0();null==m&&(m=w?r.ONE:r.inv(v));const b=r.mul(y,m),D=r.mul(_,m),C=r.mul(v,m);if(w)return{x:r.ZERO,y:r.ZERO};if(!r.eql(C,r.ONE))throw new Error("invZ was invalid");return{x:b,y:D}}isTorsionFree(){const{h:m,isTorsionFree:y}=t;if(m===pt)return!0;if(y)return y(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:m,clearCofactor:y}=t;return m===pt?this:y?y(f,this):this.multiplyUnsafe(t.h)}toRawBytes(m=!0){return this.assertValidity(),i(f,this,m)}toHex(m=!0){return yc(this.toRawBytes(m))}}f.BASE=new f(t.Gx,t.Gy,r.ONE),f.ZERO=new f(r.ZERO,r.ONE,r.ZERO);const h=t.nBitLength,p=function oY(e,t){const r=(s,o)=>{const a=o.negate();return s?a:o},i=s=>({windows:Math.ceil(t/s)+1,windowSize:2**(s-1)});return{constTimeNegate:r,unsafeLadder(s,o){let a=e.ZERO,c=s;for(;o>sY;)o&Vw&&(a=a.add(c)),c=c.double(),o>>=Vw;return a},precomputeWindow(s,o){const{windows:a,windowSize:c}=i(o),l=[];let u=s,d=u;for(let f=0;f>=p,y>l&&(y-=h,a+=Vw);const _=m,v=m+Math.abs(y)-1,b=y<0;0===y?d=d.add(r(g%2!=0,o[_])):u=u.add(r(b,o[v]))}return{p:u,f:d}},wNAFCached(s,o,a,c){const l=s._WINDOW_SIZE||1;let u=o.get(s);return u||(u=this.precomputeWindow(s,l),1!==l&&o.set(s,c(u))),this.wNAF(l,u,a)}}}(f,t.endo?Math.ceil(h/2):h);return{CURVE:t,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:o,isWithinCurveOrder:a}}({...t,toBytes(T,E,x){const R=E.toAffine(),M=r.toBytes(R.x),W=Ao;return x?W(Uint8Array.from([E.hasEvenY()?2:3]),M):W(Uint8Array.from([4]),M,r.toBytes(R.y))},fromBytes(T){const E=T.length,x=T[0],R=T.subarray(1);if(E!==s||2!==x&&3!==x){if(E===o&&4===x)return{x:r.fromBytes(R.subarray(0,r.BYTES)),y:r.fromBytes(R.subarray(r.BYTES,2*r.BYTES))};throw new Error(`Point of length ${E} was invalid. Expected ${s} compressed bytes or ${o} uncompressed bytes`)}{const M=Nn(R);if(!function a(T){return Aryc(Ts(T,t.nByteLength));function g(T){return T>i>>pt}const y=(T,E,x)=>Nn(T.slice(E,x));class _{constructor(E,x,R){this.r=E,this.s=x,this.recovery=R,this.assertValidity()}static fromCompact(E){const x=t.nByteLength;return E=un("compactSignature",E,2*x),new _(y(E,0,x),y(E,x,2*x))}static fromDER(E){const{r:x,s:R}=Mo.toSig(un("DER",E));return new _(x,R)}assertValidity(){if(!h(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!h(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(E){return new _(this.r,this.s,E)}recoverPublicKey(E){const{r:x,s:R,recovery:M}=this,W=S(un("msgHash",E));if(null==M||![0,1,2,3].includes(M))throw new Error("recovery id invalid");const J=2===M||3===M?x+t.n:x;if(J>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const Se=u.fromHex((1&M?"03":"02")+p(J)),ue=l(J),yt=c(-W*ue),ht=c(R*ue),Ae=u.BASE.multiplyAndAddUnsafe(Se,yt,ht);if(!Ae)throw new Error("point at infinify");return Ae.assertValidity(),Ae}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new _(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return vc(this.toDERHex())}toDERHex(){return Mo.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return vc(this.toCompactHex())}toCompactHex(){return p(this.r)+p(this.s)}}const v={isValidPrivateKey(T){try{return d(T),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const T=Qk(t.n);return function iY(e,t,r=!1){const i=e.length,s=Kk(t),o=Qk(t);if(i<16||i1024)throw new Error(`expected ${o}-1024 bytes of input, got ${i}`);const c=jt(r?Nn(e):Ow(e),t-Ye)+Ye;return r?kw(c,s):Ts(c,s)}(t.randomBytes(T),t.n)},precompute:(T=8,E=u.BASE)=>(E._setWindowSize(T),E.multiply(BigInt(3)),E)};function b(T){const E=T instanceof Uint8Array,x="string"==typeof T,R=(E||x)&&T.length;return E?R===s||R===o:x?R===2*s||R===2*o:T instanceof u}const C=t.bits2int||function(T){const E=Nn(T),x=8*T.length-t.nBitLength;return x>0?E>>BigInt(x):E},S=t.bits2int_modN||function(T){return c(C(T))},I=Pw(t.nBitLength);function P(T){if("bigint"!=typeof T)throw new Error("bigint expected");if(!(Ar<=T&&TOe in x))throw new Error("sign() legacy options not supported");const{hash:R,randomBytes:M}=t;let{lowS:W,prehash:J,extraEntropy:ee}=x;null==W&&(W=!0),T=un("msgHash",T),J&&(T=un("prehashed msgHash",R(T)));const Se=S(T),ue=d(E),yt=[P(ue),P(Se)];if(null!=ee){const Oe=!0===ee?M(r.BYTES):ee;yt.push(un("extraEntropy",Oe))}const ht=Ao(...yt),Ae=Se;return{seed:ht,k2sig:function ot(Oe){const Pn=C(Oe);if(!h(Pn))return;const en=l(Pn),tn=u.BASE.multiply(Pn).toAffine(),Br=c(tn.x);if(Br===Ar)return;const Ko=c(en*c(Ae+Br*ue));if(Ko===Ar)return;let Ad=(tn.x===Br?0:2)|Number(tn.y&pt),f3=Ko;return W&&g(Ko)&&(f3=function m(T){return g(T)?c(-T):T}(Ko),Ad^=1),new _(Br,f3,Ad)}}}(T,E,x);return Gk(t.hash.outputLen,t.nByteLength,t.hmac)(R,M)},verify:function L(T,E,x,R=$){const M=T;if(E=un("msgHash",E),x=un("publicKey",x),"strict"in R)throw new Error("options.strict was renamed to lowS");const{lowS:W,prehash:J}=R;let ee,Se;try{if("string"==typeof M||M instanceof Uint8Array)try{ee=_.fromDER(M)}catch(tn){if(!(tn instanceof Mo.Err))throw tn;ee=_.fromCompact(M)}else{if("object"!=typeof M||"bigint"!=typeof M.r||"bigint"!=typeof M.s)throw new Error("PARSE");{const{r:tn,s:Br}=M;ee=new _(tn,Br)}}Se=u.fromHex(x)}catch(tn){if("PARSE"===tn.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(W&&ee.hasHighS())return!1;J&&(E=t.hash(E));const{r:ue,s:yt}=ee,ht=S(E),Ae=l(yt),ot=c(ht*Ae),Oe=c(ue*Ae),Pn=u.BASE.multiplyAndAddUnsafe(Se,ot,Oe)?.toAffine();return!!Pn&&c(Pn.x)===ue},ProjectivePoint:u,Signature:_,utils:v}}function pY(e){return{hash:e,hmac:(t,...r)=>Jk(e,t,function PQ(...e){const t=new Uint8Array(e.reduce((i,s)=>i+s.length,0));let r=0;return e.forEach(i=>{if(!Aw(i))throw new Error("Uint8Array expected");t.set(i,r),r+=i.length}),t}(...r)),randomBytes:jk}}BigInt(4);const Gp=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Wp=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),t2=BigInt(1),Zp=BigInt(2),n2=(e,t)=>(e+t/Zp)/t;function r2(e){const t=Gp,r=BigInt(3),i=BigInt(6),s=BigInt(11),o=BigInt(22),a=BigInt(23),c=BigInt(44),l=BigInt(88),u=e*e*e%t,d=u*u*e%t,f=ur(d,r,t)*d%t,h=ur(f,r,t)*d%t,p=ur(h,Zp,t)*u%t,g=ur(p,s,t)*p%t,m=ur(g,o,t)*g%t,y=ur(m,c,t)*m%t,_=ur(y,l,t)*y%t,v=ur(_,c,t)*m%t,w=ur(v,r,t)*d%t,b=ur(w,a,t)*g%t,D=ur(b,i,t)*u%t,C=ur(D,Zp,t);if(!Uw.eql(Uw.sqr(C),e))throw new Error("Cannot find square root");return C}const Uw=function rY(e,t,r=!1,i={}){if(e<=Ut)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:o}=Bw(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=function JQ(e){if(e%Fw===WQ){const t=(e+Ye)/Fw;return function(i,s){const o=i.pow(s,t);if(!i.eql(i.sqr(o),s))throw new Error("Cannot find square root");return o}}if(e%Zk===Wk){const t=(e-Wk)/Zk;return function(i,s){const o=i.mul(s,Is),a=i.pow(o,t),c=i.mul(s,a),l=i.mul(i.mul(c,Is),a),u=i.mul(c,i.sub(l,i.ONE));if(!i.eql(i.sqr(u),s))throw new Error("Cannot find square root");return u}}return function YQ(e){const t=(e-Ye)/Is;let r,i,s;for(r=e-Ye,i=0;r%Is===Ut;r/=Is,i++);for(s=Is;sjt(l,e),isValid:l=>{if("bigint"!=typeof l)throw new Error("Invalid field element: expected bigint, got "+typeof l);return Ut<=l&&ll===Ut,isOdd:l=>(l&Ye)===Ye,neg:l=>jt(-l,e),eql:(l,u)=>l===u,sqr:l=>jt(l*l,e),add:(l,u)=>jt(l+u,e),sub:(l,u)=>jt(l-u,e),mul:(l,u)=>jt(l*u,e),pow:(l,u)=>function tY(e,t,r){if(r 0");if(r===Ut)return e.ONE;if(r===Ye)return t;let i=e.ONE,s=t;for(;r>Ut;)r&Ye&&(i=e.mul(i,s)),s=e.sqr(s),r>>=Ye;return i}(c,l,u),div:(l,u)=>jt(l*zp(u,e),e),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>zp(l,e),sqrt:i.sqrt||(l=>a(c,l)),invertBatch:l=>function nY(e,t){const r=new Array(t.length),i=t.reduce((o,a,c)=>e.is0(a)?o:(r[c]=o,e.mul(o,a)),e.ONE),s=e.inv(i);return t.reduceRight((o,a,c)=>e.is0(a)?o:(r[c]=e.mul(o,r[c]),e.mul(o,a)),s),r}(c,l),cmov:(l,u,d)=>d?u:l,toBytes:l=>r?kw(l,o):Ts(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return r?Ow(l):Nn(l)}});return Object.freeze(c)}(Gp,void 0,void 0,{sqrt:r2}),_c=function gY(e,t){const r=i=>fY({...e,...pY(i)});return Object.freeze({...r(t),create:r})}({a:BigInt(0),b:BigInt(7),Fp:Uw,n:Wp,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Wp,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-t2*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=BigInt("0x100000000000000000000000000000000"),c=n2(o*e,t),l=n2(-i*e,t);let u=jt(e-c*r-l*s,t),d=jt(-c*i-l*o,t);const f=u>a,h=d>a;if(f&&(u=t-u),h&&(d=t-d),u>a||d>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:h,k2:d}}}},Rw),Kp=BigInt(0),i2=e=>"bigint"==typeof e&&Kps.charCodeAt(0)));r=Ao(i,i),s2[e]=r}return Rw(Ao(r,...t))}const jw=e=>e.toRawBytes(!0).slice(1),$w=e=>Ts(e,32),Hw=e=>jt(e,Gp),Gu=e=>jt(e,Wp),zw=_c.ProjectivePoint;function qw(e){let t=_c.utils.normPrivateKeyToScalar(e),r=zw.fromPrivateKey(t);return{scalar:r.hasEvenY()?t:Gu(-t),bytes:jw(r)}}function o2(e){if(!i2(e))throw new Error("bad x: need 0 < x < p");const t=Hw(e*e);let i=r2(Hw(t*e+BigInt(7)));i%Zp!==Kp&&(i=Hw(-i));const s=new zw(e,i,t2);return s.assertValidity(),s}function a2(...e){return Gu(Nn(Qp("BIP0340/challenge",...e)))}function c2(e,t,r){const i=un("signature",e,64),s=un("message",t),o=un("publicKey",r,32);try{const a=o2(Nn(o)),c=Nn(i.subarray(0,32));if(!i2(c))return!1;const l=Nn(i.subarray(32,64));if(!(e=>"bigint"==typeof e&&Kpzw.BASE.multiplyAndAddUnsafe(e,t,r))(a,l,Gu(-u));return!(!d||!d.hasEvenY()||d.toAffine().x!==c)}catch{return!1}}const Wu={getPublicKey:function vY(e){return qw(e).bytes},sign:function _Y(e,t,r=jk(32)){const i=un("message",e),{bytes:s,scalar:o}=qw(t),a=un("auxRand",r,32),c=$w(o^Nn(Qp("BIP0340/aux",a))),l=Qp("BIP0340/nonce",c,s,i),u=Gu(Nn(l));if(u===Kp)throw new Error("sign failed: k is zero");const{bytes:d,scalar:f}=qw(u),h=a2(d,s,i),p=new Uint8Array(64);if(p.set(d,0),p.set($w(Gu(f+h*o)),32),!c2(p,i,s))throw new Error("sign: Invalid signature produced");return p},verify:c2,utils:{randomPrivateKey:_c.utils.randomPrivateKey,lift_x:o2,pointToBytes:jw,numberToBytesBE:Ts,bytesToNumberBE:Nn,taggedHash:Qp,mod:jt}},Gw="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,Ww=e=>e instanceof Uint8Array,Zw=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),di=(e,t)=>e<<32-t|e>>>t;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");const wY=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function gt(e){if(!Ww(e))throw new Error("Uint8Array expected");let t="";for(let r=0;ri+s.length,0));let r=0;return e.forEach(i=>{if(!Ww(i))throw new Error("Uint8Array expected");t.set(i,r),r+=i.length}),t}class l2{clone(){return this._cloneInto()}}function u2(e){const t=i=>e().update(Ro(i)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function d2(e=32){if(Gw&&"function"==typeof Gw.getRandomValues)return Gw.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function Qw(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function f2(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}const fi={number:Qw,bool:function DY(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)},bytes:f2,hash:function SY(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");Qw(e.outputLen),Qw(e.blockLen)},exists:function TY(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")},output:function IY(e,t){f2(e);const r=t.outputLen;if(e.lengths-a&&(this.process(i,0),a=0);for(let f=a;f>s&o),c=Number(r&o),u=i?0:4;e.setUint32(t+(i?4:0),a,i),e.setUint32(t+u,c,i)})(i,s-8,BigInt(8*this.length),o),this.process(i,0);const c=Zw(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;fe&t^~e&r,NY=(e,t,r)=>e&t^e&r^t&r,RY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),As=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ms=new Uint32Array(64);class h2 extends AY{constructor(){super(64,32,8,!1),this.A=0|As[0],this.B=0|As[1],this.C=0|As[2],this.D=0|As[3],this.E=0|As[4],this.F=0|As[5],this.G=0|As[6],this.H=0|As[7]}get(){const{A:t,B:r,C:i,D:s,E:o,F:a,G:c,H:l}=this;return[t,r,i,s,o,a,c,l]}set(t,r,i,s,o,a,c,l){this.A=0|t,this.B=0|r,this.C=0|i,this.D=0|s,this.E=0|o,this.F=0|a,this.G=0|c,this.H=0|l}process(t,r){for(let f=0;f<16;f++,r+=4)Ms[f]=t.getUint32(r,!1);for(let f=16;f<64;f++){const h=Ms[f-15],p=Ms[f-2],g=di(h,7)^di(h,18)^h>>>3,m=di(p,17)^di(p,19)^p>>>10;Ms[f]=m+Ms[f-7]+g+Ms[f-16]|0}let{A:i,B:s,C:o,D:a,E:c,F:l,G:u,H:d}=this;for(let f=0;f<64;f++){const p=d+(di(c,6)^di(c,11)^di(c,25))+MY(c,l,u)+RY[f]+Ms[f]|0,m=(di(i,2)^di(i,13)^di(i,22))+NY(i,s,o)|0;d=u,u=l,l=c,c=a+p|0,a=o,o=s,s=i,i=p+m|0}i=i+this.A|0,s=s+this.B|0,o=o+this.C|0,a=a+this.D|0,c=c+this.E|0,l=l+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(i,s,o,a,c,l,u,d)}roundClean(){Ms.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class OY extends h2{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const wc=u2(()=>new h2);function Oo(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function Mr(...e){const t=(s,o)=>a=>s(o(a));return{encode:Array.from(e).reverse().reduce((s,o)=>s?t(s,o.encode):o.encode,void 0),decode:e.reduce((s,o)=>s?t(s,o.decode):o.decode,void 0)}}function hi(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("alphabet.encode input should be an array of numbers");return t.map(r=>{if(Oo(r),r<0||r>=e.length)throw new Error(`Digit index outside alphabet: ${r} (alphabet: ${e.length})`);return e[r]})},decode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("alphabet.decode input should be array of strings");return t.map(r=>{if("string"!=typeof r)throw new Error(`alphabet.decode: not string element=${r}`);const i=e.indexOf(r);if(-1===i)throw new Error(`Unknown letter: "${r}". Allowed: ${e}`);return i})}}}function pi(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("join.encode input should be array of strings");for(let r of t)if("string"!=typeof r)throw new Error(`join.encode: non-string input=${r}`);return t.join(e)},decode:t=>{if("string"!=typeof t)throw new Error("join.decode input should be string");return t.split(e)}}}function Zu(e,t="="){if(Oo(e),"string"!=typeof t)throw new Error("padding chr should be string");return{encode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let i of r)if("string"!=typeof i)throw new Error(`padding.encode: non-string input=${i}`);for(;r.length*e%8;)r.push(t);return r},decode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let s of r)if("string"!=typeof s)throw new Error(`padding.decode: non-string input=${s}`);let i=r.length;if(i*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;i>0&&r[i-1]===t;i--)if(!((i-1)*e%8))throw new Error("Invalid padding: string has too much padding");return r.slice(0,i)}}}function p2(e){if("function"!=typeof e)throw new Error("normalize fn should be function");return{encode:t=>t,decode:t=>e(t)}}function g2(e,t,r){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: wrong to=${r}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let i=0;const s=[],o=Array.from(e);for(o.forEach(a=>{if(Oo(a),a<0||a>=t)throw new Error(`Wrong integer: ${a}`)});;){let a=0,c=!0;for(let l=i;lnew OY);const m2=(e,t)=>t?m2(t,e%t):e,Jp=(e,t)=>e+(t-m2(e,t));function Yw(e,t,r,i){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(Jp(t,r)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${Jp(t,r)}`);let s=0,o=0;const a=2**r-1,c=[];for(const l of e){if(Oo(l),l>=2**t)throw new Error(`convertRadix2: invalid data word=${l} from=${t}`);if(s=s<32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${t}`);for(o+=t;o>=r;o-=r)c.push((s>>o-r&a)>>>0);s&=2**o-1}if(s=s<=t)throw new Error("Excess padding");if(!i&&s)throw new Error(`Non-zero padding: ${s}`);return i&&o>0&&c.push(s>>>0),c}function Vi(e,t=!1){if(Oo(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(Jp(8,e)>32||Jp(e,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!(r instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return Yw(Array.from(r),8,e,!t)},decode:r=>{if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(Yw(r,e,8,t))}}}function v2(e){if("function"!=typeof e)throw new Error("unsafeWrapper fn should be function");return function(...t){try{return e.apply(null,t)}catch{}}}Mr(Vi(4),hi("0123456789ABCDEF"),pi("")),Mr(Vi(5),hi("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Zu(5),pi("")),Mr(Vi(5),hi("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Zu(5),pi("")),Mr(Vi(5),hi("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),pi(""),p2(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const Ui=Mr(Vi(6),hi("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Zu(6),pi("")),Jw=(Mr(Vi(6),hi("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Zu(6),pi("")),e=>Mr(function y2(e){return Oo(e),{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return g2(Array.from(t),256,e)},decode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("radix.decode input should be array of strings");return Uint8Array.from(g2(t,e,256))}}}(58),hi(e),pi(""))),Xw=(Jw("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),Jw("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),Jw("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"),Mr(hi("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),pi(""))),b2=[996825010,642813549,513874426,1027748829,705979059];function Ku(e){const t=e>>25;let r=(33554431&e)<<5;for(let i=0;i>i&1)&&(r^=b2[i]);return r}function E2(e,t,r=1){const i=e.length;let s=1;for(let o=0;o126)throw new Error(`Invalid prefix (${e})`);s=Ku(s)^a>>5}s=Ku(s);for(let o=0;of)throw new TypeError(`Wrong string length: ${d.length} (${d}). Expected (8..${f})`);const h=d.toLowerCase();if(d!==h&&d!==d.toUpperCase())throw new Error("String must be lowercase or uppercase");const p=(d=h).lastIndexOf("1");if(0===p||-1===p)throw new Error('Letter "1" must be present between prefix and data only');const g=d.slice(0,p),m=d.slice(p+1);if(m.length<6)throw new Error("Data must be at least 6 characters long");const y=Xw.decode(m).slice(0,-6),_=E2(g,y,t);if(!m.endsWith(_))throw new Error(`Invalid checksum in ${d}: expected "${_}"`);return{prefix:g,words:y}}return{encode:function a(d,f,h=90){if("string"!=typeof d)throw new Error("bech32.encode prefix should be string, not "+typeof d);if(!Array.isArray(f)||f.length&&"number"!=typeof f[0])throw new Error("bech32.encode words should be array of numbers, not "+typeof f);const p=d.length+7+f.length;if(!1!==h&&p>h)throw new TypeError(`Length ${p} exceeds limit ${h}`);return`${d=d.toLowerCase()}1${Xw.encode(f)}${E2(d,f,t)}`},decode:c,decodeToBytes:function u(d){const{prefix:f,words:h}=c(d,!1);return{prefix:f,words:h,bytes:i(h)}},decodeUnsafe:v2(c),fromWords:i,fromWordsUnsafe:o,toWords:s}}const gi=C2("bech32");function bc(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function eb(e){if("boolean"!=typeof e)throw new Error(`boolean expected, not ${e}`)}function S2(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function xe(e,...t){if(!S2(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function ko(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function tg(e,t){xe(e);const r=t.outputLen;if(e.length{if("string"!=typeof e||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));const Ie=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),Ec=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");function Ns(e){if("string"==typeof e)e=function GY(e){if("string"!=typeof e)throw new Error("string expected, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e);else{if(!S2(e))throw new Error("Uint8Array expected, got "+typeof e);e=e.slice()}return e}function ng(e,t){if(e.length!==t.length)return!1;let r=0;for(let i=0;i(Object.assign(t,e),t);function Po(e,t,r,i){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,i);const s=BigInt(32),o=BigInt(4294967295),a=Number(r>>s&o),c=Number(r&o),u=i?0:4;e.setUint32(t+(i?4:0),a,i),e.setUint32(t+u,c,i)}const rb=new Uint8Array(16),mi=Ie(rb),KY=(e,t,r,i)=>({s3:r<<31|i>>>1,s2:t<<31|r>>>1,s1:e<<31|t>>>1,s0:e>>>1^225<<24&-(1&i)}),dr=e=>(e>>>0&255)<<24|(e>>>8&255)<<16|(e>>>16&255)<<8|e>>>24&255;class I2{constructor(t,r){this.blockLen=16,this.outputLen=16,this.s0=0,this.s1=0,this.s2=0,this.s3=0,this.finished=!1,xe(t=Ns(t),16);const i=Ec(t);let s=i.getUint32(0,!1),o=i.getUint32(4,!1),a=i.getUint32(8,!1),c=i.getUint32(12,!1);const l=[];for(let g=0;g<128;g++)l.push({s0:dr(s),s1:dr(o),s2:dr(a),s3:dr(c)}),({s0:s,s1:o,s2:a,s3:c}=KY(s,o,a,c));const u=(e=r||1024)>65536?8:e>1024?4:2;var e;if(![1,2,4,8].includes(u))throw new Error(`ghash: wrong window size=${u}, should be 2, 4 or 8`);this.W=u;const f=128/u,h=this.windowSize=2**u,p=[];for(let g=0;g>>u-b-1&1))continue;const{s0:C,s1:S,s2:I,s3:P}=l[u*g+b];y^=C,_^=S,v^=I,w^=P}p.push({s0:y,s1:_,s2:v,s3:w})}this.t=p}_updateBlock(t,r,i,s){t^=this.s0,r^=this.s1,i^=this.s2,s^=this.s3;const{W:o,t:a,windowSize:c}=this;let l=0,u=0,d=0,f=0;const h=(1<>>8*m&255;for(let _=8/o-1;_>=0;_--){const v=y>>>o*_&h,{s0:w,s1:b,s2:D,s3:C}=a[p*c+v];l^=w,u^=b,d^=D,f^=C,p+=1}}this.s0=l,this.s1=u,this.s2=d,this.s3=f}update(t){t=Ns(t),ko(this);const r=Ie(t),i=Math.floor(t.length/16),s=t.length%16;for(let o=0;o>>1|r,r=(1&s)<<7}return e[0]^=225&-t,e}((t=Ns(t)).slice());super(i,r),i.fill(0)}update(t){t=Ns(t),ko(this);const r=Ie(t),i=t.length%16,s=Math.floor(t.length/16);for(let o=0;oe(s,i.length).update(Ns(i)).digest(),r=e(new Uint8Array(16),0);return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=(i,s)=>e(i,s),t}x2((e,t)=>new I2(e,t)),x2((e,t)=>new JY(e,t)),new Uint8Array(16);const eJ=283;function sb(e){return e<<1^eJ&-(e>>7)}function Cc(e,t){let r=0;for(;t>0;t>>=1)r^=e&-(1&t),e=sb(e);return r}const ob=(()=>{let e=new Uint8Array(256);for(let r=0,i=1;r<256;r++,i^=sb(i))e[r]=i;const t=new Uint8Array(256);t[0]=99;for(let r=0;r<255;r++){let i=e[255-r];i|=i<<8,t[e[r]]=255&(i^i>>4^i>>5^i>>6^i>>7^99)}return t})(),tJ=ob.map((e,t)=>ob.indexOf(t)),nJ=e=>e<<24|e>>>8,ab=e=>e<<8|e>>>24;function M2(e,t){if(256!==e.length)throw new Error("Wrong sbox length");const r=new Uint32Array(256).map((u,d)=>t(e[d])),i=r.map(ab),s=i.map(ab),o=s.map(ab),a=new Uint32Array(65536),c=new Uint32Array(65536),l=new Uint16Array(65536);for(let u=0;u<256;u++)for(let d=0;d<256;d++){const f=256*u+d;a[f]=r[u]^i[d],c[f]=s[u]^o[d],l[f]=e[u]<<8|e[d]}return{sbox:e,sbox2:l,T0:r,T1:i,T2:s,T3:o,T01:a,T23:c}}const cb=M2(ob,e=>Cc(e,3)<<24|e<<16|e<<8|Cc(e,2)),N2=M2(tJ,e=>Cc(e,11)<<24|Cc(e,13)<<16|Cc(e,9)<<8|Cc(e,14)),rJ=(()=>{const e=new Uint8Array(16);for(let t=0,r=1;t<16;t++,r=sb(r))e[t]=r;return e})();function Hi(e){xe(e);const t=e.length;if(![16,24,32].includes(t))throw new Error(`aes: wrong key size: should be 16, 24 or 32, got: ${t}`);const{sbox2:r}=cb,i=Ie(e),s=i.length,o=c=>yi(r,c,c,c,c),a=new Uint32Array(t+28);a.set(i);for(let c=s;c6&&c%s==4&&(l=o(l)),a[c]=a[c-s]^l}return a}function Os(e,t,r,i,s,o){return e[r<<8&65280|i>>>8&255]^t[s>>>8&65280|o>>>24&255]}function yi(e,t,r,i,s){return e[255&t|65280&r]|e[i>>>16&255|s>>>16&65280]<<16}function Rn(e,t,r,i,s){const{sbox2:o,T01:a,T23:c}=cb;let l=0;t^=e[l++],r^=e[l++],i^=e[l++],s^=e[l++];const u=e.length/4-2;for(let g=0;g{const c=Hi(t),{b:l,o:u,out:d}=function k2(e,t,r){let i=e.length;const s=i%16;if(!t&&0!==s)throw new Error("aec/(cbc-ecb): unpadded plaintext with disabled padding");const o=Ie(e);if(t){let l=16-s;l||(l=16),i+=l}const a=Dc(i,r);return{b:o,o:Ie(a),out:a}}(o,s,a),f=Ie(r);let h=f[0],p=f[1],g=f[2],m=f[3],y=0;for(;y+4<=l.length;)h^=l[y+0],p^=l[y+1],g^=l[y+2],m^=l[y+3],({s0:h,s1:p,s2:g,s3:m}=Rn(c,h,p,g,m)),u[y++]=h,u[y++]=p,u[y++]=g,u[y++]=m;if(s){const _=function L2(e){const t=new Uint8Array(16),r=Ie(t);t.set(e);const i=16-e.length;for(let s=16-i;s<16;s++)t[s]=i;return r}(o.subarray(4*y));h^=_[0],p^=_[1],g^=_[2],m^=_[3],({s0:h,s1:p,s2:g,s3:m}=Rn(c,h,p,g,m)),u[y++]=h,u[y++]=p,u[y++]=g,u[y++]=m}return c.fill(0),d},decrypt:(o,a)=>{!function O2(e){if(xe(e),e.length%16!=0)throw new Error("aes/(cbc-ecb).decrypt ciphertext should consist of blocks with size 16")}(o);const c=function lb(e){const t=Hi(e),r=t.slice(),i=t.length,{sbox2:s}=cb,{T0:o,T1:a,T2:c,T3:l}=N2;for(let u=0;u>>8&255]^c[f>>>16&255]^l[f>>>24]}return r}(t),l=Ie(r),u=Dc(o.length,a),d=Ie(o),f=Ie(u);let h=l[0],p=l[1],g=l[2],m=l[3];for(let y=0;y+4<=d.length;){const _=h,v=p,w=g,b=m;h=d[y+0],p=d[y+1],g=d[y+2],m=d[y+3];const{s0:D,s1:C,s2:S,s3:I}=ig(c,h,p,g,m);f[y++]=D^_,f[y++]=C^v,f[y++]=S^w,f[y++]=I^b}return c.fill(0),function P2(e,t){if(!t)return e;const r=e.length;if(!r)throw new Error("aes/pcks5: empty ciphertext not allowed");const i=e[r-1];if(i<=0||i>16)throw new Error(`aes/pcks5: wrong padding byte: ${i}`);const s=e.subarray(0,-i);for(let o=0;o255&e[t++]|(255&e[t++])<<8;class oJ{constructor(t){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,xe(t=Ns(t),32);const r=Jt(t,0),i=Jt(t,2),s=Jt(t,4),o=Jt(t,6),a=Jt(t,8),c=Jt(t,10),l=Jt(t,12),u=Jt(t,14);this.r[0]=8191&r,this.r[1]=8191&(r>>>13|i<<3),this.r[2]=7939&(i>>>10|s<<6),this.r[3]=8191&(s>>>7|o<<9),this.r[4]=255&(o>>>4|a<<12),this.r[5]=a>>>1&8190,this.r[6]=8191&(a>>>14|c<<2),this.r[7]=8065&(c>>>11|l<<5),this.r[8]=8191&(l>>>8|u<<8),this.r[9]=u>>>5&127;for(let d=0;d<8;d++)this.pad[d]=Jt(t,16+2*d)}process(t,r,i=!1){const s=i?0:2048,{h:o,r:a}=this,c=a[0],l=a[1],u=a[2],d=a[3],f=a[4],h=a[5],p=a[6],g=a[7],m=a[8],y=a[9],_=Jt(t,r+0),v=Jt(t,r+2),w=Jt(t,r+4),b=Jt(t,r+6),D=Jt(t,r+8),C=Jt(t,r+10),S=Jt(t,r+12),I=Jt(t,r+14);let P=o[0]+(8191&_),H=o[1]+(8191&(_>>>13|v<<3)),V=o[2]+(8191&(v>>>10|w<<6)),$=o[3]+(8191&(w>>>7|b<<9)),X=o[4]+(8191&(b>>>4|D<<12)),L=o[5]+(D>>>1&8191),T=o[6]+(8191&(D>>>14|C<<2)),E=o[7]+(8191&(C>>>11|S<<5)),x=o[8]+(8191&(S>>>8|I<<8)),R=o[9]+(I>>>5|s),M=0,W=M+P*c+H*(5*y)+V*(5*m)+$*(5*g)+X*(5*p);M=W>>>13,W&=8191,W+=L*(5*h)+T*(5*f)+E*(5*d)+x*(5*u)+R*(5*l),M+=W>>>13,W&=8191;let J=M+P*l+H*c+V*(5*y)+$*(5*m)+X*(5*g);M=J>>>13,J&=8191,J+=L*(5*p)+T*(5*h)+E*(5*f)+x*(5*d)+R*(5*u),M+=J>>>13,J&=8191;let ee=M+P*u+H*l+V*c+$*(5*y)+X*(5*m);M=ee>>>13,ee&=8191,ee+=L*(5*g)+T*(5*p)+E*(5*h)+x*(5*f)+R*(5*d),M+=ee>>>13,ee&=8191;let Se=M+P*d+H*u+V*l+$*c+X*(5*y);M=Se>>>13,Se&=8191,Se+=L*(5*m)+T*(5*g)+E*(5*p)+x*(5*h)+R*(5*f),M+=Se>>>13,Se&=8191;let ue=M+P*f+H*d+V*u+$*l+X*c;M=ue>>>13,ue&=8191,ue+=L*(5*y)+T*(5*m)+E*(5*g)+x*(5*p)+R*(5*h),M+=ue>>>13,ue&=8191;let yt=M+P*h+H*f+V*d+$*u+X*l;M=yt>>>13,yt&=8191,yt+=L*c+T*(5*y)+E*(5*m)+x*(5*g)+R*(5*p),M+=yt>>>13,yt&=8191;let ht=M+P*p+H*h+V*f+$*d+X*u;M=ht>>>13,ht&=8191,ht+=L*l+T*c+E*(5*y)+x*(5*m)+R*(5*g),M+=ht>>>13,ht&=8191;let Ae=M+P*g+H*p+V*h+$*f+X*d;M=Ae>>>13,Ae&=8191,Ae+=L*u+T*l+E*c+x*(5*y)+R*(5*m),M+=Ae>>>13,Ae&=8191;let ot=M+P*m+H*g+V*p+$*h+X*f;M=ot>>>13,ot&=8191,ot+=L*d+T*u+E*l+x*c+R*(5*y),M+=ot>>>13,ot&=8191;let Oe=M+P*y+H*m+V*g+$*p+X*h;M=Oe>>>13,Oe&=8191,Oe+=L*f+T*d+E*u+x*l+R*c,M+=Oe>>>13,Oe&=8191,M=(M<<2)+M|0,M=M+W|0,W=8191&M,M>>>=13,J+=M,o[0]=W,o[1]=J,o[2]=ee,o[3]=Se,o[4]=ue,o[5]=yt,o[6]=ht,o[7]=Ae,o[8]=ot,o[9]=Oe}finalize(){const{h:t,pad:r}=this,i=new Uint16Array(10);let s=t[1]>>>13;t[1]&=8191;for(let c=2;c<10;c++)t[c]+=s,s=t[c]>>>13,t[c]&=8191;t[0]+=5*s,s=t[0]>>>13,t[0]&=8191,t[1]+=s,s=t[1]>>>13,t[1]&=8191,t[2]+=s,i[0]=t[0]+5,s=i[0]>>>13,i[0]&=8191;for(let c=1;c<10;c++)i[c]=t[c]+s,s=i[c]>>>13,i[c]&=8191;i[9]-=8192;let o=(1^s)-1;for(let c=0;c<10;c++)i[c]&=o;o=~o;for(let c=0;c<10;c++)t[c]=t[c]&o|i[c];t[0]=65535&(t[0]|t[1]<<13),t[1]=65535&(t[1]>>>3|t[2]<<10),t[2]=65535&(t[2]>>>6|t[3]<<7),t[3]=65535&(t[3]>>>9|t[4]<<4),t[4]=65535&(t[4]>>>12|t[5]<<1|t[6]<<14),t[5]=65535&(t[6]>>>2|t[7]<<11),t[6]=65535&(t[7]>>>5|t[8]<<8),t[7]=65535&(t[8]>>>8|t[9]<<5);let a=t[0]+r[0];t[0]=65535&a;for(let c=1;c<8;c++)a=(t[c]+r[c]|0)+(a>>>16)|0,t[c]=65535&a}update(t){ko(this);const{buffer:r,blockLen:i}=this,s=(t=Ns(t)).length;for(let o=0;o>>0,t[o++]=i[a]>>>8;return t}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const i=t.slice(0,r);return this.destroy(),i}}const cJ=function aJ(e){const t=(i,s)=>e(s).update(Ns(i)).digest(),r=e(new Uint8Array(32));return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=i=>e(i),t}(e=>new oJ(e)),U2=e=>Uint8Array.from(e.split("").map(t=>t.charCodeAt(0))),lJ=U2("expand 16-byte k"),uJ=U2("expand 32-byte k"),dJ=Ie(lJ),j2=Ie(uJ);function Q(e,t){return e<>>32-t}function ub(e){return e.byteOffset%4==0}j2.slice();const $2=2**32-1,H2=new Uint32Array;function Qu(e,t){const{allowShortKeys:r,extendNonceFn:i,counterLength:s,counterRight:o,rounds:a}=function WY(e,t){if(null==t||"object"!=typeof t)throw new Error("options must be defined");return Object.assign(e,t)}({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if("function"!=typeof e)throw new Error("core must be a function");return bc(s),bc(a),eb(o),eb(r),(c,l,u,d,f=0)=>{xe(c),xe(l),xe(u);const h=u.length;if(d||(d=new Uint8Array(h)),xe(d),bc(f),f<0||f>=$2)throw new Error("arx: counter overflow");if(d.length=$2)throw new Error("arx: counter overflow");const m=Math.min(64,l-g);if(f&&64===m){const y=g/4;if(g%4!=0)throw new Error("arx: invalid block position");for(let v,_=0;_<16;_++)v=y+_,p[v]=h[v]^d[_];g+=64}else{for(let _,y=0;y0;)p.pop().fill(0);return d}}function Yu(e,t,r,i,s,o=20){let a=e[0],c=e[1],l=e[2],u=e[3],d=t[0],f=t[1],h=t[2],p=t[3],g=t[4],m=t[5],y=t[6],_=t[7],v=s,w=r[0],b=r[1],D=r[2],C=a,S=c,I=l,P=u,H=d,V=f,$=h,X=p,L=g,T=m,E=y,x=_,R=v,M=w,W=b,J=D;for(let Se=0;Se{e.update(t);const r=t.length%16;r&&e.update(mJ.subarray(r))},yJ=new Uint8Array(32);function q2(e,t,r,i,s){const o=e(t,r,yJ),a=cJ.create(o);s&&z2(a,s),z2(a,i);const c=new Uint8Array(16),l=Ec(c);Po(l,0,BigInt(s?s.length:0),!0),Po(l,8,BigInt(i.length),!0),a.update(c);const u=a.digest();return o.fill(0),u}const G2=e=>(t,r,i)=>(xe(t,32),xe(r),{encrypt:(o,a)=>{const c=o.length,l=c+16;a?xe(a,l):a=new Uint8Array(l),e(t,r,o,a,1);const u=q2(e,t,r,a.subarray(0,-16),i);return a.set(u,c),a},decrypt:(o,a)=>{const c=o.length,l=c-16;if(c<16)throw new Error("encrypted data must be at least 16 bytes");a?xe(a,l):a=new Uint8Array(l);const u=o.subarray(0,-16);if(!ng(o.subarray(-16),q2(e,t,r,u,i)))throw new Error("invalid tag");return e(t,r,u,a,1),a}});G2(db),G2(gJ);class W2 extends l2{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,fi.hash(t);const i=Ro(r);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,o=new Uint8Array(s);o.set(i.length>s?t.create().update(i).digest():i);for(let a=0;anew W2(e,t).update(r).digest();ag.create=(e,t)=>new W2(e,t);const fb=new Uint8Array([0]),K2=new Uint8Array;var vJ=Object.defineProperty,mt=(e,t)=>{for(var r in t)vJ(e,r,{get:t[r],enumerable:!0})},Lo=Symbol("verified"),_J=e=>e instanceof Object;function hb(e){if(!_J(e)||"number"!=typeof e.kind||"string"!=typeof e.content||"number"!=typeof e.created_at||"string"!=typeof e.pubkey||!e.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(e.tags))return!1;for(let t=0;tJ2,QueueNode:()=>Y2,binarySearch:()=>pb,insertEventIntoAscendingList:()=>EJ,insertEventIntoDescendingList:()=>bJ,normalizeURL:()=>Tc,utf8Decoder:()=>zi,utf8Encoder:()=>Nr});var zi=new TextDecoder("utf-8"),Nr=new TextEncoder;function Tc(e){-1===e.indexOf("://")&&(e="wss://"+e);let t=new URL(e);return t.pathname=t.pathname.replace(/\/+/g,"/"),t.pathname.endsWith("/")&&(t.pathname=t.pathname.slice(0,-1)),("80"===t.port&&"ws:"===t.protocol||"443"===t.port&&"wss:"===t.protocol)&&(t.port=""),t.searchParams.sort(),t.hash="",t.toString()}function bJ(e,t){const[r,i]=pb(e,s=>t.id===s.id?0:t.created_at===s.created_at?-1:s.created_at-t.created_at);return i||e.splice(r,0,t),e}function EJ(e,t){const[r,i]=pb(e,s=>t.id===s.id?0:t.created_at===s.created_at?-1:t.created_at-s.created_at);return i||e.splice(r,0,t),e}function pb(e,t){let r=0,i=e.length-1;for(;r<=i;){const s=Math.floor((r+i)/2),o=t(e[s]);if(0===o)return[s,!0];o<0?i=s-1:r=s+1}return[r,!1]}var Y2=class{value;next=null;prev=null;constructor(e){this.value=e}},J2=class{first;last;constructor(){this.first=null,this.last=null}enqueue(e){const t=new Y2(e);return this.last?this.last===this.first?(this.last=t,this.last.prev=this.first,this.first.next=t):(t.prev=this.last,this.last.next=t,this.last=t):(this.first=t,this.last=t),!0}dequeue(){if(!this.first)return null;if(this.first===this.last){const t=this.first;return this.first=null,this.last=null,t.value}const e=this.first;return this.first=e.next,e.value}};function cg(e){let t=wc(Nr.encode(function DJ(e){if(!hb(e))throw new Error("can't serialize event with wrong or missing properties");return JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content])}(e)));return gt(t)}var lg=new class{generateSecretKey(){return Wu.utils.randomPrivateKey()}getPublicKey(e){return gt(Wu.getPublicKey(e))}finalizeEvent(e,t){const r=e;return r.pubkey=gt(Wu.getPublicKey(t)),r.id=cg(r),r.sig=gt(Wu.sign(cg(r),t)),r[Lo]=!0,r}verifyEvent(e){if("boolean"==typeof e[Lo])return e[Lo];const t=cg(e);if(t!==e.id)return e[Lo]=!1,!1;try{const r=Wu.verify(e.sig,t,e.pubkey);return e[Lo]=r,r}catch{return e[Lo]=!1,!1}}},gb=lg.generateSecretKey,mb=lg.getPublicKey,Rr=lg.finalizeEvent,Ic=lg.verifyEvent,Zn={};function X2(e){return 1e3<=e&&e<1e4||[1,2,4,5,6,7,8,16,40,41,42,43,44].includes(e)}function yb(e){return[0,3].includes(e)||1e4<=e&&e<2e4}function eP(e){return 2e4<=e&&e<3e4}function vb(e){return 3e4<=e&&e<4e4}function SJ(e){return X2(e)?"regular":yb(e)?"replaceable":eP(e)?"ephemeral":vb(e)?"parameterized":"unknown"}function TJ(e,t){const r=t instanceof Array?t:[t];return hb(e)&&r.includes(e.kind)||!1}mt(Zn,{Application:()=>TX,BadgeAward:()=>OJ,BadgeDefinition:()=>_X,BlockedRelaysList:()=>rX,BookmarkList:()=>eX,Bookmarksets:()=>mX,Calendar:()=>OX,CalendarEventRSVP:()=>kX,ChannelCreation:()=>nP,ChannelHideMessage:()=>sP,ChannelMessage:()=>iP,ChannelMetadata:()=>rP,ChannelMuteUser:()=>oP,ClassifiedListing:()=>AX,ClientAuth:()=>cP,CommunitiesList:()=>tX,CommunityDefinition:()=>FX,CommunityPostApproval:()=>HJ,Contacts:()=>MJ,CreateOrUpdateProduct:()=>EX,CreateOrUpdateStall:()=>bX,Curationsets:()=>yX,Date:()=>NX,DirectMessageRelaysList:()=>aX,DraftClassifiedListing:()=>MX,DraftLong:()=>DX,Emojisets:()=>SX,EncryptedDirectMessage:()=>NJ,EventDeletion:()=>RJ,FileMetadata:()=>FJ,FileServerPreference:()=>cX,Followsets:()=>hX,GenericRepost:()=>PJ,Genericlists:()=>pX,GiftWrap:()=>aP,HTTPAuth:()=>bb,Handlerinformation:()=>LX,Handlerrecommendation:()=>PX,Highlights:()=>QJ,InterestsList:()=>sX,Interestsets:()=>wX,JobFeedback:()=>GJ,JobRequest:()=>zJ,JobResult:()=>qJ,Label:()=>$J,LightningPubRPC:()=>uX,LiveChatMessage:()=>BJ,LiveEvent:()=>IX,LongFormArticle:()=>CX,Metadata:()=>IJ,Mutelist:()=>YJ,NWCWalletInfo:()=>lX,NWCWalletRequest:()=>lP,NWCWalletResponse:()=>dX,NostrConnect:()=>fX,OpenTimestamps:()=>LJ,Pinlist:()=>JJ,PrivateDirectMessage:()=>kJ,ProblemTracker:()=>VJ,ProfileBadges:()=>vX,PublicChatsList:()=>nX,Reaction:()=>wb,RecommendRelay:()=>AJ,RelayList:()=>XJ,Relaysets:()=>gX,Report:()=>UJ,Reporting:()=>jJ,Repost:()=>_b,Seal:()=>tP,SearchRelaysList:()=>iX,ShortTextNote:()=>xJ,Time:()=>RX,UserEmojiList:()=>oX,UserStatuses:()=>xX,Zap:()=>KJ,ZapGoal:()=>WJ,ZapRequest:()=>ZJ,classifyKind:()=>SJ,isEphemeralKind:()=>eP,isKind:()=>TJ,isParameterizedReplaceableKind:()=>vb,isRegularKind:()=>X2,isReplaceableKind:()=>yb});var IJ=0,xJ=1,AJ=2,MJ=3,NJ=4,RJ=5,_b=6,wb=7,OJ=8,tP=13,kJ=14,PJ=16,nP=40,rP=41,iP=42,sP=43,oP=44,LJ=1040,aP=1059,FJ=1063,BJ=1311,VJ=1971,UJ=1984,jJ=1984,$J=1985,HJ=4550,zJ=5999,qJ=6999,GJ=7e3,WJ=9041,ZJ=9734,KJ=9735,QJ=9802,YJ=1e4,JJ=10001,XJ=10002,eX=10003,tX=10004,nX=10005,rX=10006,iX=10007,sX=10015,oX=10030,aX=10050,cX=10096,lX=13194,uX=21e3,cP=22242,lP=23194,dX=23195,fX=24133,bb=27235,hX=3e4,pX=30001,gX=30002,mX=30003,yX=30004,vX=30008,_X=30009,wX=30015,bX=30017,EX=30018,CX=30023,DX=30024,SX=30030,TX=30078,IX=30311,xX=30315,AX=30402,MX=30403,NX=31922,RX=31923,OX=31924,kX=31925,PX=31989,LX=31990,FX=34550;function BX(e,t){if(e.ids&&-1===e.ids.indexOf(t.id)||e.kinds&&-1===e.kinds.indexOf(t.kind)||e.authors&&-1===e.authors.indexOf(t.pubkey))return!1;for(let r in e)if("#"===r[0]){let s=e[`#${r.slice(1)}`];if(s&&!t.tags.find(([o,a])=>o===r.slice(1)&&-1!==s.indexOf(a)))return!1}return!(e.since&&t.created_ate.until)}function ug(e,t){for(let r=0;ryb(t))?e.authors.length*e.kinds.length:1/0,e.authors?.length&&e.kinds?.every(t=>vb(t))&&e["#d"]?.length?e.authors.length*e.kinds.length*e["#d"].length:1/0)}function dg(e,t){let r=t.length+3,i=e.indexOf(`"${t}":`)+r,s=e.slice(i).indexOf('"')+i+1;return e.slice(s,s+64)}function dP(e,t){let r=t.length,i=e.indexOf(`"${t}":`)+r+3,s=e.slice(i),o=Math.min(s.indexOf(","),s.indexOf("}"));return parseInt(s.slice(0,o),10)}function fP(e){let t=e.slice(0,22).indexOf('"EVENT"');if(-1===t)return null;let r=e.slice(t+7+1).indexOf('"');if(-1===r)return null;let i=t+7+1+r,s=e.slice(i+1,80).indexOf('"');return-1===s?null:e.slice(i+1,i+1+s)}function UX(e,t){return t===dg(e,"id")}function jX(e,t){return t===dg(e,"pubkey")}function $X(e,t){return t===dP(e,"kind")}function hP(e,t){return{kind:cP,created_at:Math.floor(Date.now()/1e3),tags:[["relay",e],["challenge",t]],content:""}}mt({},{getHex64:()=>dg,getInt:()=>dP,getSubscriptionId:()=>fP,matchEventId:()=>UX,matchEventKind:()=>$X,matchEventPubkey:()=>jX}),mt({},{makeAuthEvent:()=>hP});try{WebSocket}catch{}try{WebSocket}catch{}mt({},{BECH32_REGEX:()=>mP,Bech32MaxSize:()=>Db,NostrTypeGuard:()=>QX,decode:()=>Ju,encodeBytes:()=>hg,naddrEncode:()=>ree,neventEncode:()=>nee,noteEncode:()=>eee,nprofileEncode:()=>tee,npubEncode:()=>XX,nsecEncode:()=>JX});var QX={isNProfile:e=>/^nprofile1[a-z\d]+$/.test(e||""),isNEvent:e=>/^nevent1[a-z\d]+$/.test(e||""),isNAddr:e=>/^naddr1[a-z\d]+$/.test(e||""),isNSec:e=>/^nsec1[a-z\d]{58}$/.test(e||""),isNPub:e=>/^npub1[a-z\d]{58}$/.test(e||""),isNote:e=>/^note1[a-z\d]+$/.test(e||""),isNcryptsec:e=>/^ncryptsec1[a-z\d]+$/.test(e||"")},Db=5e3,mP=/[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}/;function Ju(e){let{prefix:t,words:r}=gi.decode(e,Db),i=new Uint8Array(gi.fromWords(r));switch(t){case"nprofile":{let s=Sb(i);if(!s[0]?.[0])throw new Error("missing TLV 0 for nprofile");if(32!==s[0][0].length)throw new Error("TLV 0 should be 32 bytes");return{type:"nprofile",data:{pubkey:gt(s[0][0]),relays:s[1]?s[1].map(o=>zi.decode(o)):[]}}}case"nevent":{let s=Sb(i);if(!s[0]?.[0])throw new Error("missing TLV 0 for nevent");if(32!==s[0][0].length)throw new Error("TLV 0 should be 32 bytes");if(s[2]&&32!==s[2][0].length)throw new Error("TLV 2 should be 32 bytes");if(s[3]&&4!==s[3][0].length)throw new Error("TLV 3 should be 4 bytes");return{type:"nevent",data:{id:gt(s[0][0]),relays:s[1]?s[1].map(o=>zi.decode(o)):[],author:s[2]?.[0]?gt(s[2][0]):void 0,kind:s[3]?.[0]?parseInt(gt(s[3][0]),16):void 0}}}case"naddr":{let s=Sb(i);if(!s[0]?.[0])throw new Error("missing TLV 0 for naddr");if(!s[2]?.[0])throw new Error("missing TLV 2 for naddr");if(32!==s[2][0].length)throw new Error("TLV 2 should be 32 bytes");if(!s[3]?.[0])throw new Error("missing TLV 3 for naddr");if(4!==s[3][0].length)throw new Error("TLV 3 should be 4 bytes");return{type:"naddr",data:{identifier:zi.decode(s[0][0]),pubkey:gt(s[2][0]),kind:parseInt(gt(s[3][0]),16),relays:s[1]?s[1].map(o=>zi.decode(o)):[]}}}case"nsec":return{type:t,data:i};case"npub":case"note":return{type:t,data:gt(i)};default:throw new Error(`unknown prefix ${t}`)}}function Sb(e){let t={},r=e;for(;r.length>0;){let i=r[0],s=r[1],o=r.slice(2,2+s);if(r=r.slice(2+s),o.lengthNr.encode(r))}))}function nee(e){let t;return void 0!==e.kind&&(t=function YX(e){const t=new Uint8Array(4);return t[0]=e>>24&255,t[1]=e>>16&255,t[2]=e>>8&255,t[3]=255&e,t}(e.kind)),fg("nevent",Tb({0:[No(e.id)],1:(e.relays||[]).map(i=>Nr.encode(i)),2:e.author?[No(e.author)]:[],3:t?[new Uint8Array(t)]:[]}))}function ree(e){let t=new ArrayBuffer(4);return new DataView(t).setUint32(0,e.kind,!1),fg("naddr",Tb({0:[Nr.encode(e.identifier)],1:(e.relays||[]).map(i=>Nr.encode(i)),2:[No(e.pubkey)],3:[new Uint8Array(t)]}))}function Tb(e){let t=[];return Object.entries(e).reverse().forEach(([r,i])=>{i.forEach(s=>{let o=new Uint8Array(s.length+2);o.set([parseInt(r)],0),o.set([s.length],1),o.set(s,2),t.push(o)})}),Yp(...t)}var Ib={};function yP(e,t,r){return xb.apply(this,arguments)}function xb(){return(xb=U(function*(e,t,r){const i=e instanceof Uint8Array?gt(e):e,o=vP(_c.getSharedSecret(i,"02"+t));let a=Uint8Array.from(d2(16)),c=Nr.encode(r),l=F2(o,a).encrypt(c);return`${Ui.encode(new Uint8Array(l))}?iv=${Ui.encode(new Uint8Array(a.buffer))}`})).apply(this,arguments)}function see(e,t,r){return Ab.apply(this,arguments)}function Ab(){return(Ab=U(function*(e,t,r){const i=e instanceof Uint8Array?gt(e):e;let[s,o]=r.split("?iv="),c=vP(_c.getSharedSecret(i,"02"+t)),l=Ui.decode(o),u=Ui.decode(s),d=F2(c,l).decrypt(u);return zi.decode(d)})).apply(this,arguments)}function vP(e){return e.slice(1,33)}mt(Ib,{decrypt:()=>see,encrypt:()=>yP}),mt({},{NIP05_REGEX:()=>Mb,isNip05:()=>aee,isValid:()=>uee,queryProfile:()=>_P,searchDomain:()=>lee,useFetchImplementation:()=>cee});var pg,Mb=/^(?:([\w.+-]+)@)?([\w_-]+(\.[\w_-]+)+)$/,aee=e=>Mb.test(e||"");try{pg=fetch}catch{}function cee(e){pg=e}function lee(e){return Nb.apply(this,arguments)}function Nb(){return(Nb=U(function*(e,t=""){try{const r=`https://${e}/.well-known/nostr.json?name=${t}`,i=yield pg(r,{redirect:"manual"});if(200!==i.status)throw Error("Wrong response code");return(yield i.json()).names}catch{return{}}})).apply(this,arguments)}function _P(e){return Rb.apply(this,arguments)}function Rb(){return(Rb=U(function*(e){const t=e.match(Mb);if(!t)return null;const[,r="_",i]=t;try{const s=`https://${i}/.well-known/nostr.json?name=${r}`,o=yield pg(s,{redirect:"manual"});if(200!==o.status)throw Error("Wrong response code");const a=yield o.json(),c=a.names[r];return c?{pubkey:c,relays:a.relays?.[c]}:null}catch{return null}})).apply(this,arguments)}function uee(e,t){return Ob.apply(this,arguments)}function Ob(){return(Ob=U(function*(e,t){const r=yield _P(t);return!!r&&r.pubkey===e})).apply(this,arguments)}function fee(e){const t={reply:void 0,root:void 0,mentions:[],profiles:[],quotes:[]};let r,i;for(let s=e.tags.length-1;s>=0;s--){const o=e.tags[s];if("e"===o[0]&&o[1]){const[a,c,l,u,d]=o,f={id:c,relays:l?[l]:[],author:d};if("root"===u){t.root=f;continue}if("reply"===u){t.reply=f;continue}if("mention"===u){t.mentions.push(f);continue}r?i=f:r=f,t.mentions.push(f)}else{if("q"===o[0]&&o[1]){const[a,c,l]=o;t.quotes.push({id:c,relays:l?[l]:[]})}"p"===o[0]&&o[1]&&t.profiles.push({pubkey:o[1],relays:o[2]?[o[2]]:[]})}}return t.root||(t.root=i||r||t.reply),t.reply||(t.reply=r||t.root),[t.reply,t.root].forEach(s=>{if(!s)return;let o=t.mentions.indexOf(s);if(-1!==o&&t.mentions.splice(o,1),s.author){let a=t.profiles.find(c=>c.pubkey===s.author);a&&a.relays&&(s.relays||(s.relays=[]),a.relays.forEach(c=>{-1===s.relays?.indexOf(c)&&s.relays.push(c)}),a.relays=s.relays)}}),t.mentions.forEach(s=>{if(s.author){let o=t.profiles.find(a=>a.pubkey===s.author);o&&o.relays&&(s.relays||(s.relays=[]),o.relays.forEach(a=>{-1===s.relays.indexOf(a)&&s.relays.push(a)}),o.relays=s.relays)}}),t}mt({},{parse:()=>fee}),mt({},{fetchRelayInformation:()=>gee,useFetchImplementation:()=>pee});try{fetch}catch{}function pee(e){}function gee(e){return kb.apply(this,arguments)}function kb(){return(kb=U(function*(e){return yield(yield fetch(e.replace("ws://","http://").replace("wss://","https://"),{headers:{Accept:"application/nostr+json"}})).json()})).apply(this,arguments)}function bP(e){let t=0;for(let r=0;r<64;r+=8){const i=parseInt(e.substring(r,r+8),16);if(0!==i){t+=Math.clz32(i);break}t+=32}return t}function yee(e,t){let r=0;const i=e,s=["nonce",r.toString(),t.toString()];for(i.tags.push(s);;){const o=Math.floor((new Date).getTime()/1e3);if(o!==i.created_at&&(r=0,i.created_at=o),s[1]=(++r).toString(),i.id=EP(i),bP(i.id)>=t)break}return i}function EP(e){return gt(wc(Nr.encode(JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content]))))}function _ee(e,t,r,i){return Rr({kind:_b,tags:[...e.tags??[],["e",t.id,r],["p",t.pubkey]],content:""===e.content?"":JSON.stringify(t),created_at:e.created_at},i)}function CP(e){if(e.kind!==_b)return;let t,r;for(let i=e.tags.length-1;i>=0&&(void 0===t||void 0===r);i--){const s=e.tags[i];s.length>=2&&("e"===s[0]&&void 0===t?t=s:"p"===s[0]&&void 0===r&&(r=s))}return void 0!==t?{id:t[1],relays:[t[2],r?.[2]].filter(i=>"string"==typeof i),author:r?.[1]}:void 0}function wee(e,{skipVerification:t}={}){const r=CP(e);if(void 0===r||""===e.content)return;let i;try{i=JSON.parse(e.content)}catch{return}return i.id===r.id&&(t||Ic(i))?i:void 0}mt({},{fastEventHash:()=>EP,getPow:()=>bP,minePow:()=>yee}),mt({},{finishRepostEvent:()=>_ee,getRepostedEvent:()=>wee,getRepostedEventPointer:()=>CP}),mt({},{NOSTR_URI_REGEX:()=>gg,parse:()=>Cee,test:()=>Eee});var gg=new RegExp(`nostr:(${mP.source})`);function Eee(e){return"string"==typeof e&&new RegExp(`^${gg.source}$`).test(e)}function Cee(e){const t=e.match(new RegExp(`^${gg.source}$`));if(!t)throw new Error(`Invalid Nostr URI: ${e}`);return{uri:t[0],value:t[1],decoded:Ju(t[1])}}function See(e,t,r){const i=t.tags.filter(s=>s.length>=2&&("e"===s[0]||"p"===s[0]));return Rr({...e,kind:wb,tags:[...e.tags??[],...i,["e",t.id],["p",t.pubkey]],content:e.content??"+"},r)}function Tee(e){if(e.kind!==wb)return;let t,r;for(let i=e.tags.length-1;i>=0&&(void 0===t||void 0===r);i--){const s=e.tags[i];s.length>=2&&("e"===s[0]&&void 0===t?t=s:"p"===s[0]&&void 0===r&&(r=s))}return void 0!==t&&void 0!==r?{id:t[1],relays:[t[2],r[2]].filter(i=>void 0!==i),author:r[1]}:void 0}mt({},{finishReactionEvent:()=>See,getReactedEventPointer:()=>Tee}),mt({},{matchAll:()=>xee,regex:()=>Pb,replaceAll:()=>Aee});var Pb=()=>new RegExp(`\\b${gg.source}\\b`,"g");function*xee(e){const t=e.matchAll(Pb());for(const r of t)try{const[i,s]=r;yield{uri:i,value:s,decoded:Ju(s),start:r.index,end:r.index+i.length}}catch{}}function Aee(e,t){return e.replaceAll(Pb(),(r,i)=>t({uri:r,value:i,decoded:Ju(i)}))}mt({},{channelCreateEvent:()=>Nee,channelHideMessageEvent:()=>kee,channelMessageEvent:()=>Oee,channelMetadataEvent:()=>Ree,channelMuteUserEvent:()=>Pee});var Nee=(e,t)=>{let r;if("object"==typeof e.content)r=JSON.stringify(e.content);else{if("string"!=typeof e.content)return;r=e.content}return Rr({kind:nP,tags:[...e.tags??[]],content:r,created_at:e.created_at},t)},Ree=(e,t)=>{let r;if("object"==typeof e.content)r=JSON.stringify(e.content);else{if("string"!=typeof e.content)return;r=e.content}return Rr({kind:rP,tags:[["e",e.channel_create_event_id],...e.tags??[]],content:r,created_at:e.created_at},t)},Oee=(e,t)=>{const r=[["e",e.channel_create_event_id,e.relay_url,"root"]];return e.reply_to_channel_message_event_id&&r.push(["e",e.reply_to_channel_message_event_id,e.relay_url,"reply"]),Rr({kind:iP,tags:[...r,...e.tags??[]],content:e.content,created_at:e.created_at},t)},kee=(e,t)=>{let r;if("object"==typeof e.content)r=JSON.stringify(e.content);else{if("string"!=typeof e.content)return;r=e.content}return Rr({kind:sP,tags:[["e",e.channel_message_event_id],...e.tags??[]],content:r,created_at:e.created_at},t)},Pee=(e,t)=>{let r;if("object"==typeof e.content)r=JSON.stringify(e.content);else{if("string"!=typeof e.content)return;r=e.content}return Rr({kind:oP,tags:[["p",e.pubkey_to_mute],...e.tags??[]],content:r,created_at:e.created_at},t)};mt({},{EMOJI_SHORTCODE_REGEX:()=>DP,matchAll:()=>Fee,regex:()=>Lb,replaceAll:()=>Bee});var Fb,DP=/:(\w+):/,Lb=()=>new RegExp(`\\B${DP.source}\\B`,"g");function*Fee(e){const t=e.matchAll(Lb());for(const r of t)try{const[i,s]=r;yield{shortcode:i,name:s,start:r.index,end:r.index+i.length}}catch{}}function Bee(e,t){return e.replaceAll(Lb(),(r,i)=>t({shortcode:r,name:i}))}mt({},{useFetchImplementation:()=>Uee,validateGithub:()=>jee});try{Fb=fetch}catch{}function Uee(e){Fb=e}function jee(e,t,r){return Bb.apply(this,arguments)}function Bb(){return(Bb=U(function*(e,t,r){try{return(yield(yield Fb(`https://gist.github.com/${t}/${r}/raw`)).text())===`Verifying that I control the following Nostr public key: ${e}`}catch{return!1}})).apply(this,arguments)}var mg={};mt(mg,{decrypt:()=>$b,encrypt:()=>jb,getConversationKey:()=>Vb,v2:()=>Gee});var SP=1,TP=65535;function Vb(e,t){const r=_c.getSharedSecret(e,"02"+t).subarray(1,33);return function Z2(e,t,r){return fi.hash(e),void 0===r&&(r=new Uint8Array(e.outputLen)),ag(e,Ro(r),Ro(t))}(wc,r,"nip44-v2")}function IP(e,t){const r=function Q2(e,t,r,i=32){if(fi.hash(e),fi.number(i),i>255*e.outputLen)throw new Error("Length should be <= 255*HashLen");const s=Math.ceil(i/e.outputLen);void 0===r&&(r=K2);const o=new Uint8Array(s*e.outputLen),a=ag.create(e,t),c=a._cloneInto(),l=new Uint8Array(a.outputLen);for(let u=0;uTP)throw new Error("invalid plaintext size: must be between 1 and 65535 bytes");const t=new Uint8Array(2);return new DataView(t.buffer).setUint16(0,e,!1),t}(r);return Yp(i,t,new Uint8Array(Ub(r)-r))}(e),c=db(i,s,a),l=xP(o,c,r);return Ui.encode(Yp(new Uint8Array([2]),r,c,l))}function $b(e,t){const{nonce:r,ciphertext:i,mac:s}=function qee(e){if("string"!=typeof e)throw new Error("payload must be a valid string");const t=e.length;if(t<132||t>87472)throw new Error("invalid payload length: "+t);if("#"===e[0])throw new Error("unknown encryption version");let r;try{r=Ui.decode(e)}catch(o){throw new Error("invalid base64: "+o.message)}const i=r.length;if(i<99||i>65603)throw new Error("invalid data length: "+i);const s=r[0];if(2!==s)throw new Error("unknown encryption version "+s);return{nonce:r.subarray(1,33),ciphertext:r.subarray(33,-32),mac:r.subarray(-32)}}(e),{chacha_key:o,chacha_nonce:a,hmac_key:c}=IP(t,r);if(!ng(xP(c,i,r),s))throw new Error("invalid MAC");return function zee(e){const t=new DataView(e.buffer).getUint16(0),r=e.subarray(2,2+t);if(tTP||r.length!==t||e.length!==2+Ub(t))throw new Error("invalid padding");return zi.decode(r)}(db(o,a,i))}var zb,Gee={utils:{getConversationKey:Vb,calcPaddedLen:Ub},encrypt:jb,decrypt:$b};function Zee(e){const{pathname:t,searchParams:r}=new URL(e),i=t,s=r.get("relay"),o=r.get("secret");if(!i||!s||!o)throw new Error("invalid connection string");return{pubkey:i,relay:s,secret:o}}function Kee(e,t,r){return Hb.apply(this,arguments)}function Hb(){return(Hb=U(function*(e,t,r){const s=yield yP(t,e,JSON.stringify({method:"pay_invoice",params:{invoice:r}})),o={kind:lP,created_at:Math.round(Date.now()/1e3),content:s,tags:[["p",e]]};return Rr(o,t)})).apply(this,arguments)}mt({},{makeNwcRequestEvent:()=>Kee,parseConnectionString:()=>Zee}),mt({},{getZapEndpoint:()=>Jee,makeZapReceipt:()=>tte,makeZapRequest:()=>Xee,useFetchImplementation:()=>Yee,validateZapRequest:()=>ete});try{zb=fetch}catch{}function Yee(e){zb=e}function Jee(e){return qb.apply(this,arguments)}function qb(){return(qb=U(function*(e){try{let t="",{lud06:r,lud16:i}=JSON.parse(e.content);if(r){let{words:a}=gi.decode(r,1e3),c=gi.fromWords(a);t=zi.decode(c)}else{if(!i)return null;{let[a,c]=i.split("@");t=new URL(`/.well-known/lnurlp/${a}`,`https://${c}`).toString()}}let o=yield(yield zb(t)).json();if(o.allowsNostr&&o.nostrPubkey)return o.callback}catch{}return null})).apply(this,arguments)}function Xee({profile:e,event:t,amount:r,relays:i,comment:s=""}){if(!r)throw new Error("amount not given");if(!e)throw new Error("profile not given");let o={kind:9734,created_at:Math.round(Date.now()/1e3),content:s,tags:[["p",e],["amount",r.toString()],["relays",...i]]};return t&&o.tags.push(["e",t]),o}function ete(e){let t;try{t=JSON.parse(e)}catch{return"Invalid zap request JSON."}if(!hb(t))return"Zap request is not a valid Nostr event.";if(!Ic(t))return"Invalid signature on zap request.";let r=t.tags.find(([o,a])=>"p"===o&&a);if(!r)return"Zap request doesn't have a 'p' tag.";if(!r[1].match(/^[a-f0-9]{64}$/))return"Zap request 'p' tag is not valid hex.";let i=t.tags.find(([o,a])=>"e"===o&&a);return i&&!i[1].match(/^[a-f0-9]{64}$/)?"Zap request 'e' tag is not valid hex.":t.tags.find(([o,a])=>"relays"===o&&a)?null:"Zap request doesn't have a 'relays' tag."}function tte({zapRequest:e,preimage:t,bolt11:r,paidAt:i}){let s=JSON.parse(e),o=s.tags.filter(([c])=>"e"===c||"p"===c||"a"===c),a={kind:9735,created_at:Math.round(i.getTime()/1e3),content:"",tags:[...o,["P",s.pubkey],["bolt11",r],["description",e]]};return t&&a.tags.push(["preimage",t]),a}mt({},{createRumor:()=>kP,createSeal:()=>PP,createWrap:()=>LP,unwrapEvent:()=>FP,unwrapManyEvents:()=>ste,wrapEvent:()=>Gb,wrapManyEvents:()=>ite});var AP=()=>Math.round(Date.now()/1e3),MP=()=>Math.round(AP()-172800*Math.random()),NP=(e,t)=>Vb(e,t),RP=(e,t,r)=>jb(JSON.stringify(e),NP(t,r)),OP=(e,t)=>JSON.parse($b(e.content,NP(t,e.pubkey)));function kP(e,t){const r={created_at:AP(),content:"",tags:[],...e,pubkey:mb(t)};return r.id=cg(r),r}function PP(e,t,r){return Rr({kind:tP,content:RP(e,t,r),created_at:MP(),tags:[]},t)}function LP(e,t){const r=gb();return Rr({kind:aP,content:RP(e,r,t),created_at:MP(),tags:[["p",t]]},r)}function Gb(e,t,r){return LP(PP(kP(e,t),t,r),r)}function ite(e,t,r){if(!r||0===r.length)throw new Error("At least one recipient is required.");const i=mb(t),s=[Gb(e,t,i)];return r.forEach(o=>{s.push(Gb(e,t,o))}),s}function FP(e,t){const r=OP(e,t);return OP(r,t)}function ste(e,t){let r=[];return e.forEach(i=>{r.push(FP(i,t))}),r.sort((i,s)=>i.created_at-s.created_at),r}mt({},{getToken:()=>ate,hashPayload:()=>Qb,unpackEventFromToken:()=>VP,validateEvent:()=>qP,validateEventKind:()=>jP,validateEventMethodTag:()=>HP,validateEventPayloadTag:()=>zP,validateEventTimestamp:()=>UP,validateEventUrlTag:()=>$P,validateToken:()=>cte});var BP="Nostr ";function ate(e,t,r){return Wb.apply(this,arguments)}function Wb(){return(Wb=U(function*(e,t,r,i=!1,s){const o={kind:bb,tags:[["u",e],["method",t]],created_at:Math.round((new Date).getTime()/1e3),content:""};s&&o.tags.push(["payload",Qb(s)]);const a=yield r(o);return(i?BP:"")+Ui.encode(Nr.encode(JSON.stringify(a)))})).apply(this,arguments)}function cte(e,t,r){return Zb.apply(this,arguments)}function Zb(){return(Zb=U(function*(e,t,r){const i=yield VP(e).catch(o=>{throw o});return yield qP(i,t,r).catch(o=>{throw o})})).apply(this,arguments)}function VP(e){return Kb.apply(this,arguments)}function Kb(){return(Kb=U(function*(e){if(!e)throw new Error("Missing token");e=e.replace(BP,"");const t=zi.decode(Ui.decode(e));if(!t||0===t.length||!t.startsWith("{"))throw new Error("Invalid token");return JSON.parse(t)})).apply(this,arguments)}function UP(e){return!!e.created_at&&Math.round((new Date).getTime()/1e3)-e.created_at<60}function jP(e){return e.kind===bb}function $P(e,t){const r=e.tags.find(i=>"u"===i[0]);return!!r&&r.length>0&&r[1]===t}function HP(e,t){const r=e.tags.find(i=>"method"===i[0]);return!!r&&r.length>0&&r[1].toLowerCase()===t.toLowerCase()}function Qb(e){return gt(wc(Nr.encode(JSON.stringify(e))))}function zP(e,t){const r=e.tags.find(s=>"payload"===s[0]);if(!r)return!1;const i=Qb(t);return r.length>0&&r[1]===i}function qP(e,t,r,i){return Yb.apply(this,arguments)}function Yb(){return(Yb=U(function*(e,t,r,i){if(!Ic(e))throw new Error("Invalid nostr event, signature invalid");if(!jP(e))throw new Error("Invalid nostr event, kind invalid");if(!UP(e))throw new Error("Invalid nostr event, created_at timestamp invalid");if(!$P(e,t))throw new Error("Invalid nostr event, url tag invalid");if(!HP(e,r))throw new Error("Invalid nostr event, method tag invalid");if(i&&"object"==typeof i&&Object.keys(i).length>0&&!zP(e,i))throw new Error("Invalid nostr event, payload tag does not match request body hash");return!0})).apply(this,arguments)}"object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date;const Jb="object"==typeof process&&process?process:{};let yg=globalThis.AbortController,ZP=globalThis.AbortSignal;if(typeof yg>"u"){ZP=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,s){this._onabort.push(s)}},yg=class{constructor(){t()}signal=new ZP;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(const s of this.signal._onabort)s(i);this.signal.onabort?.(i)}}};let e="1"!==Jb.env?.LRU_CACHE_IGNORE_AC_WARNING;const t=()=>{e&&(e=!1,((e,t,r,i)=>{"function"==typeof Jb.emitWarning?Jb.emitWarning(e,t,r,i):console.error(`[${r}] ${t}: ${e}`)})("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))}}var QP,YP;Symbol("type"),Symbol,Symbol,QP=Symbol.iterator,YP=Symbol.toStringTag;class fr{cache;constructor(t){this.cache=t??new Map}get size(){return this.cache.size}add(t){this.#t(t);for(const r of this){if(fr.deletes(r,t)||fr.replaces(r,t))return this;fr.replaces(t,r)&&this.delete(r)}return this.cache.set(t.id,t),this}#t(t){if(5===t.kind)for(const r of t.tags)if("e"===r[0]){const i=this.cache.get(r[1]);i&&i.pubkey===t.pubkey&&this.delete(i)}}clear(){this.cache.clear()}delete(t){return this.cache.delete(t.id)}forEach(t,r){return this.cache.forEach((i,s)=>t(i,i,this),r)}has(t){return this.cache.has(t.id)}*entries(){for(const t of this.values())yield[t,t]}keys(){return this.values()}*values(){for(const t of fr.sortEvents([...this.cache.values()]))yield t}[QP](){return this.values()}[YP]="NSet";static isReplaceable(t){return[0,3].includes(t)||1e4<=t&&t<2e4}static isParameterizedReplaceable(t){return 3e4<=t&&t<4e4}static replaces(t,r){const{kind:i,pubkey:s}=t;if(fr.isReplaceable(i))return i===r.kind&&s===r.pubkey&&fr.sortEvents([t,r])[0]===t;if(fr.isParameterizedReplaceable(i)){const o=t.tags.find(([c])=>"d"===c)?.[1]||"",a=r.tags.find(([c])=>"d"===c)?.[1]||"";return i===r.kind&&s===r.pubkey&&fr.sortEvents([t,r])[0]===t&&o===a}return!1}static deletes(t,r){const{kind:i,pubkey:s,tags:o}=t;if(5===i&&s===r.pubkey)for(const[a,c]of o)if("e"===a&&c===r.id)return!0;return!1}static sortEvents(t){return t.sort((r,i)=>r.created_at!==i.created_at?i.created_at-r.created_at:r.id.localeCompare(i.id))}union(t){throw new Error("Method not implemented.")}intersection(t){throw new Error("Method not implemented.")}difference(t){throw new Error("Method not implemented.")}symmetricDifference(t){throw new Error("Method not implemented.")}isSubsetOf(t){throw new Error("Method not implemented.")}isSupersetOf(t){throw new Error("Method not implemented.")}isDisjointFrom(t){throw new Error("Method not implemented.")}}function Mc(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function Or(e,...t){if(!function dte(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function Xu(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}Symbol;const Nc="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,Fo=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),vi=(e,t)=>e<<32-t|e>>>t;function tL(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function Bo(e){return"string"==typeof e&&(e=tL(e)),Or(e),e}new Uint8Array(new Uint32Array([287454020]).buffer);class nL{clone(){return this._cloneInto()}}function nE(e){const t=i=>e().update(Bo(i)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function _te(e=32){if(Nc&&"function"==typeof Nc.getRandomValues)return Nc.getRandomValues(new Uint8Array(e));if(Nc&&"function"==typeof Nc.randomBytes)return Nc.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}class rL extends nL{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,function eE(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");Mc(e.outputLen),Mc(e.blockLen)}(t);const i=Bo(r);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,o=new Uint8Array(s);o.set(i.length>s?t.create().update(i).digest():i);for(let a=0;anew rL(e,t).update(r).digest();td.create=(e,t)=>new rL(e,t);const bte=(e,t,r)=>e&t^~e&r,Ete=(e,t,r)=>e&t^e&r^t&r;class rE extends nL{constructor(t,r,i,s){super(),this.blockLen=t,this.outputLen=r,this.padOffset=i,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Fo(this.buffer)}update(t){Xu(this);const{view:r,buffer:i,blockLen:s}=this,o=(t=Bo(t)).length;for(let a=0;as-a&&(this.process(i,0),a=0);for(let f=a;f>s&o),c=Number(r&o),u=i?0:4;e.setUint32(t+(i?4:0),a,i),e.setUint32(t+u,c,i)})(i,s-8,BigInt(8*this.length),o),this.process(i,0);const c=Fo(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;ft)),Dte=iL.map(e=>(9*e+5)%16);let iE=[iL],sE=[Dte];for(let e=0;e<4;e++)for(let t of[iE,sE])t.push(t[e].map(r=>Cte[r]));const Nte=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ps=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ls=new Uint32Array(64);class aL extends rE{constructor(){super(64,32,8,!1),this.A=0|Ps[0],this.B=0|Ps[1],this.C=0|Ps[2],this.D=0|Ps[3],this.E=0|Ps[4],this.F=0|Ps[5],this.G=0|Ps[6],this.H=0|Ps[7]}get(){const{A:t,B:r,C:i,D:s,E:o,F:a,G:c,H:l}=this;return[t,r,i,s,o,a,c,l]}set(t,r,i,s,o,a,c,l){this.A=0|t,this.B=0|r,this.C=0|i,this.D=0|s,this.E=0|o,this.F=0|a,this.G=0|c,this.H=0|l}process(t,r){for(let f=0;f<16;f++,r+=4)Ls[f]=t.getUint32(r,!1);for(let f=16;f<64;f++){const h=Ls[f-15],p=Ls[f-2],g=vi(h,7)^vi(h,18)^h>>>3,m=vi(p,17)^vi(p,19)^p>>>10;Ls[f]=m+Ls[f-7]+g+Ls[f-16]|0}let{A:i,B:s,C:o,D:a,E:c,F:l,G:u,H:d}=this;for(let f=0;f<64;f++){const p=d+(vi(c,6)^vi(c,11)^vi(c,25))+bte(c,l,u)+Nte[f]+Ls[f]|0,m=(vi(i,2)^vi(i,13)^vi(i,22))+Ete(i,s,o)|0;d=u,u=l,l=c,c=a+p|0,a=o,o=s,s=i,i=p+m|0}i=i+this.A|0,s=s+this.B|0,o=o+this.C|0,a=a+this.D|0,c=c+this.E|0,l=l+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(i,s,o,a,c,l,u,d)}roundClean(){Ls.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const oE=nE(()=>new aL),bg=BigInt(2**32-1),aE=BigInt(32);function cL(e,t=!1){return t?{h:Number(e&bg),l:Number(e>>aE&bg)}:{h:0|Number(e>>aE&bg),l:0|Number(e&bg)}}const Ee_split=function Rte(e,t=!1){let r=new Uint32Array(e.length),i=new Uint32Array(e.length);for(let s=0;sBigInt(e))),lE=BigInt(0),Cg=BigInt(1),Kte=BigInt(2);function Vo(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function nd(e){if(!Vo(e))throw new Error("Uint8Array expected")}function Rc(e,t){if("boolean"!=typeof t)throw new Error(`${e} must be valid boolean, got "${t}".`)}const Qte=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Oc(e){nd(e);let t="";for(let r=0;r=Gi._0&&e<=Gi._9?e-Gi._0:e>=Gi._A&&e<=Gi._F?e-(Gi._A-10):e>=Gi._a&&e<=Gi._f?e-(Gi._a-10):void 0}function Pc(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const i=new Uint8Array(r);for(let s=0,o=0;s"bigint"==typeof e&&lE<=e;function Dg(e,t,r){return fE(e)&&fE(t)&&fE(r)&&t<=e&&elE;e>>=Cg,t+=1);return t}const hE=e=>(Kte<new Uint8Array(e),fL=e=>Uint8Array.from(e);function hL(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let i=pE(e),s=pE(e),o=0;const a=()=>{i.fill(1),s.fill(0),o=0},c=(...f)=>r(s,i,...f),l=(f=pE())=>{s=c(fL([0]),f),i=c(),0!==f.length&&(s=c(fL([1]),f),i=c())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const h=[];for(;f{let p;for(a(),l(f);!(p=h(u()));)l();return a(),p}}const Yte={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||Vo(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function id(e,t,r={}){const i=(s,o,a)=>{const c=Yte[o];if("function"!=typeof c)throw new Error(`Invalid validator "${o}", expected function`);const l=e[s];if(!(a&&void 0===l||c(l,e)))throw new Error(`Invalid param ${String(s)}=${l} (${typeof l}), expected ${o}`)};for(const[s,o]of Object.entries(t))i(s,o,!1);for(const[s,o]of Object.entries(r))i(s,o,!0);return e}function gE(e){const t=new WeakMap;return(r,...i)=>{const s=t.get(r);if(void 0!==s)return s;const o=e(r,...i);return t.set(r,o),o}}const $t=BigInt(0),Je=BigInt(1),Vs=BigInt(2),Jte=BigInt(3),mE=BigInt(4),pL=BigInt(5),gL=BigInt(8);function Xt(e,t){const r=e%t;return r>=$t?r:t+r}function tne(e,t,r){if(r<=$t||t<$t)throw new Error("Expected power/modulo > 0");if(r===Je)return $t;let i=Je;for(;t>$t;)t&Je&&(i=i*e%r),e=e*e%r,t>>=Je;return i}function hr(e,t,r){let i=e;for(;t-- >$t;)i*=i,i%=r;return i}function Sg(e,t){if(e===$t||t<=$t)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=Xt(e,t),i=t,s=$t,o=Je,a=Je,c=$t;for(;r!==$t;){const u=i/r,d=i%r,f=s-a*u,h=o-c*u;i=r,r=d,s=a,o=c,a=f,c=h}if(i!==Je)throw new Error("invert: does not exist");return Xt(s,t)}BigInt(9),BigInt(16);const ine=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function yE(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function mL(e,t,r=!1,i={}){if(e<=$t)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:o}=yE(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=function rne(e){if(e%mE===Jte){const t=(e+Je)/mE;return function(i,s){const o=i.pow(s,t);if(!i.eql(i.sqr(o),s))throw new Error("Cannot find square root");return o}}if(e%gL===pL){const t=(e-pL)/gL;return function(i,s){const o=i.mul(s,Vs),a=i.pow(o,t),c=i.mul(s,a),l=i.mul(i.mul(c,Vs),a),u=i.mul(c,i.sub(l,i.ONE));if(!i.eql(i.sqr(u),s))throw new Error("Cannot find square root");return u}}return function nne(e){const t=(e-Je)/Vs;let r,i,s;for(r=e-Je,i=0;r%Vs===$t;r/=Vs,i++);for(s=Vs;sXt(l,e),isValid:l=>{if("bigint"!=typeof l)throw new Error("Invalid field element: expected bigint, got "+typeof l);return $t<=l&&ll===$t,isOdd:l=>(l&Je)===Je,neg:l=>Xt(-l,e),eql:(l,u)=>l===u,sqr:l=>Xt(l*l,e),add:(l,u)=>Xt(l+u,e),sub:(l,u)=>Xt(l-u,e),mul:(l,u)=>Xt(l*u,e),pow:(l,u)=>function one(e,t,r){if(r<$t)throw new Error("Expected power > 0");if(r===$t)return e.ONE;if(r===Je)return t;let i=e.ONE,s=t;for(;r>$t;)r&Je&&(i=e.mul(i,s)),s=e.sqr(s),r>>=Je;return i}(c,l,u),div:(l,u)=>Xt(l*Sg(u,e),e),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>Sg(l,e),sqrt:i.sqrt||(l=>a(c,l)),invertBatch:l=>function ane(e,t){const r=new Array(t.length),i=t.reduce((o,a,c)=>e.is0(a)?o:(r[c]=o,e.mul(o,a)),e.ONE),s=e.inv(i);return t.reduceRight((o,a,c)=>e.is0(a)?o:(r[c]=e.mul(o,r[c]),e.mul(o,a)),s),r}(c,l),cmov:(l,u,d)=>d?u:l,toBytes:l=>r?dE(l,o):Lc(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return r?uE(l):Uo(l)}});return Object.freeze(c)}function yL(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function vL(e){const t=yL(e);return t+Math.ceil(t/2)}const une=BigInt(0),vE=BigInt(1),_E=new WeakMap,_L=new WeakMap;function wL(e){return function sne(e){id(e,ine.reduce((i,s)=>(i[s]="function",i),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"}))}(e.Fp),id(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...yE(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}function bL(e){void 0!==e.lowS&&Rc("lowS",e.lowS),void 0!==e.prehash&&Rc("prehash",e.prehash)}const{Ph:pne,aT:gne}=lm,Wi={Err:class extends Error{constructor(t=""){super(t)}},_tlv:{encode:(e,t)=>{const{Err:r}=Wi;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");const i=t.length/2,s=kc(i);if(s.length/2&128)throw new r("tlv.encode: long form length too big");const o=i>127?kc(s.length/2|128):"";return`${kc(e)}${o}${s}${t}`},decode(e,t){const{Err:r}=Wi;let i=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[i++]!==e)throw new r("tlv.decode: wrong tlv");const s=t[i++];let a=0;if(128&s){const l=127&s;if(!l)throw new r("tlv.decode(long): indefinite length not supported");if(l>4)throw new r("tlv.decode(long): byte length is too big");const u=t.subarray(i,i+l);if(u.length!==l)throw new r("tlv.decode: length bytes not complete");if(0===u[0])throw new r("tlv.decode(long): zero leftmost byte");for(const d of u)a=a<<8|d;if(i+=l,a<128)throw new r("tlv.decode(long): not minimal encoding")}else a=s;const c=t.subarray(i,i+a);if(c.length!==a)throw new r("tlv.decode: wrong value length");return{v:c,l:t.subarray(i+a)}}},_int:{encode(e){const{Err:t}=Wi;if(e{const v=y.toAffine();return rd(Uint8Array.from([4]),r.toBytes(v.x),r.toBytes(v.y))}),o=t.fromBytes||(m=>{const y=m.subarray(1);return{x:r.fromBytes(y.subarray(0,r.BYTES)),y:r.fromBytes(y.subarray(r.BYTES,2*r.BYTES))}});function a(m){const{a:y,b:_}=t,v=r.sqr(m),w=r.mul(v,m);return r.add(r.add(w,r.mul(m,y)),_)}if(!r.eql(r.sqr(t.Gy),a(t.Gx)))throw new Error("bad generator point: equation left != right");function l(m){const{allowedPrivateKeyLengths:y,nByteLength:_,wrapPrivateKey:v,n:w}=t;if(y&&"bigint"!=typeof m){if(Vo(m)&&(m=Oc(m)),"string"!=typeof m||!y.includes(m.length))throw new Error("Invalid key");m=m.padStart(2*_,"0")}let b;try{b="bigint"==typeof m?m:Uo(kr("private key",m,_))}catch{throw new Error(`private key must be ${_} bytes, hex or bigint, not ${typeof m}`)}return v&&(b=Xt(b,w)),jo("private key",b,We,w),b}function u(m){if(!(m instanceof h))throw new Error("ProjectivePoint expected")}const d=gE((m,y)=>{const{px:_,py:v,pz:w}=m;if(r.eql(w,r.ONE))return{x:_,y:v};const b=m.is0();null==y&&(y=b?r.ONE:r.inv(w));const D=r.mul(_,y),C=r.mul(v,y),S=r.mul(w,y);if(b)return{x:r.ZERO,y:r.ZERO};if(!r.eql(S,r.ONE))throw new Error("invZ was invalid");return{x:D,y:C}}),f=gE(m=>{if(m.is0()){if(t.allowInfinityPoint&&!r.is0(m.py))return;throw new Error("bad point: ZERO")}const{x:y,y:_}=m.toAffine();if(!r.isValid(y)||!r.isValid(_))throw new Error("bad point: x or y not FE");const v=r.sqr(_),w=a(y);if(!r.eql(v,w))throw new Error("bad point: equation left != right");if(!m.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class h{constructor(y,_,v){if(this.px=y,this.py=_,this.pz=v,null==y||!r.isValid(y))throw new Error("x required");if(null==_||!r.isValid(_))throw new Error("y required");if(null==v||!r.isValid(v))throw new Error("z required");Object.freeze(this)}static fromAffine(y){const{x:_,y:v}=y||{};if(!y||!r.isValid(_)||!r.isValid(v))throw new Error("invalid affine point");if(y instanceof h)throw new Error("projective point not allowed");const w=b=>r.eql(b,r.ZERO);return w(_)&&w(v)?h.ZERO:new h(_,v,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(y){const _=r.invertBatch(y.map(v=>v.pz));return y.map((v,w)=>v.toAffine(_[w])).map(h.fromAffine)}static fromHex(y){const _=h.fromAffine(o(kr("pointHex",y)));return _.assertValidity(),_}static fromPrivateKey(y){return h.BASE.multiply(l(y))}static msm(y,_){return function fne(e,t,r,i){if(!Array.isArray(r)||!Array.isArray(i)||i.length!==r.length)throw new Error("arrays of points and scalars must have equal length");i.forEach((d,f)=>{if(!t.isValid(d))throw new Error(`wrong scalar at index ${f}`)}),r.forEach((d,f)=>{if(!(d instanceof e))throw new Error(`wrong point at index ${f}`)});const s=dL(BigInt(r.length)),o=s>12?s-3:s>4?s-2:s?2:1,a=(1<=0;d-=o){c.fill(e.ZERO);for(let h=0;h>BigInt(d)&BigInt(a));c[g]=c[g].add(r[h])}let f=e.ZERO;for(let h=c.length-1,p=e.ZERO;h>0;h--)p=p.add(c[h]),f=f.add(p);if(u=u.add(f),0!==d)for(let h=0;hPr||C>Pr;)b&We&&(S=S.add(P)),C&We&&(I=I.add(P)),P=P.double(),b>>=We,C>>=We;return w&&(S=S.negate()),D&&(I=I.negate()),I=new h(r.mul(I.px,v.beta),I.py,I.pz),S.add(I)}multiply(y){const{endo:_,n:v}=t;let w,b;if(jo("scalar",y,We,v),_){const{k1neg:D,k1:C,k2neg:S,k2:I}=_.splitScalar(y);let{p:P,f:H}=this.wNAF(C),{p:V,f:$}=this.wNAF(I);P=g.constTimeNegate(D,P),V=g.constTimeNegate(S,V),V=new h(r.mul(V.px,_.beta),V.py,V.pz),w=P.add(V),b=H.add($)}else{const{p:D,f:C}=this.wNAF(y);w=D,b=C}return h.normalizeZ([w,b])[0]}multiplyAndAddUnsafe(y,_,v){const w=h.BASE,b=(C,S)=>S!==Pr&&S!==We&&C.equals(w)?C.multiply(S):C.multiplyUnsafe(S),D=b(this,_).add(b(y,v));return D.is0()?void 0:D}toAffine(y){return d(this,y)}isTorsionFree(){const{h:y,isTorsionFree:_}=t;if(y===We)return!0;if(_)return _(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:y,clearCofactor:_}=t;return y===We?this:_?_(h,this):this.multiplyUnsafe(t.h)}toRawBytes(y=!0){return Rc("isCompressed",y),this.assertValidity(),s(h,this,y)}toHex(y=!0){return Rc("isCompressed",y),Oc(this.toRawBytes(y))}}h.BASE=new h(t.Gx,t.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);const p=t.nBitLength,g=function dne(e,t){const r=(o,a)=>{const c=a.negate();return o?c:a},i=o=>{if(!Number.isSafeInteger(o)||o<=0||o>t)throw new Error(`Wrong window size=${o}, should be [1..${t}]`)},s=o=>(i(o),{windows:Math.ceil(t/o)+1,windowSize:2**(o-1)});return{constTimeNegate:r,unsafeLadder(o,a){let c=e.ZERO,l=o;for(;a>une;)a&vE&&(c=c.add(l)),l=l.double(),a>>=vE;return c},precomputeWindow(o,a){const{windows:c,windowSize:l}=s(a),u=[];let d=o,f=d;for(let h=0;h>=g,_>u&&(_-=p,c+=vE);const v=y,w=y+Math.abs(_)-1,D=_<0;0===_?f=f.add(r(m%2!=0,a[v])):d=d.add(r(D,a[w]))}return{p:d,f}},wNAFCached(o,a,c){const l=_L.get(o)||1;let u=_E.get(o);return u||(u=this.precomputeWindow(o,l),1!==l&&_E.set(o,c(u))),this.wNAF(l,u,a)},setWindowSize(o,a){i(a),_L.set(o,a),_E.delete(o)}}}(h,t.endo?Math.ceil(p/2):p);return{CURVE:t,ProjectivePoint:h,normPrivateKeyToScalar:l,weierstrassEquation:a,isWithinCurveOrder:function c(m){return Dg(m,We,t.n)}}}({...t,toBytes(L,T,E){const x=T.toAffine(),R=r.toBytes(x.x),M=rd;return Rc("isCompressed",E),E?M(Uint8Array.from([T.hasEvenY()?2:3]),R):M(Uint8Array.from([4]),R,r.toBytes(x.y))},fromBytes(L){const T=L.length,E=L[0],x=L.subarray(1);if(T!==s||2!==E&&3!==E){if(T===o&&4===E)return{x:r.fromBytes(x.subarray(0,r.BYTES)),y:r.fromBytes(x.subarray(r.BYTES,2*r.BYTES))};throw new Error(`Point of length ${T} was invalid. Expected ${s} compressed bytes or ${o} uncompressed bytes`)}{const R=Uo(x);if(!Dg(R,We,r.ORDER))throw new Error("Point is not on curve");const M=d(R);let W;try{W=r.sqrt(M)}catch(Se){const ue=Se instanceof Error?": "+Se.message:"";throw new Error("Point is not on curve"+ue)}return!(1&~E)!=((W&We)===We)&&(W=r.neg(W)),{x:R,y:W}}}}),h=L=>Oc(Lc(L,t.nByteLength));function p(L){return L>i>>We}const m=(L,T,E)=>Uo(L.slice(T,E));class y{constructor(T,E,x){this.r=T,this.s=E,this.recovery=x,this.assertValidity()}static fromCompact(T){const E=t.nByteLength;return T=kr("compactSignature",T,2*E),new y(m(T,0,E),m(T,E,2*E))}static fromDER(T){const{r:E,s:x}=Wi.toSig(kr("DER",T));return new y(E,x)}assertValidity(){jo("r",this.r,We,i),jo("s",this.s,We,i)}addRecoveryBit(T){return new y(this.r,this.s,T)}recoverPublicKey(T){const{r:E,s:x,recovery:R}=this,M=C(kr("msgHash",T));if(null==R||![0,1,2,3].includes(R))throw new Error("recovery id invalid");const W=2===R||3===R?E+t.n:E;if(W>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const ee=l.fromHex((1&R?"03":"02")+h(W)),Se=c(W),ue=a(-M*Se),yt=a(x*Se),ht=l.BASE.multiplyAndAddUnsafe(ee,ue,yt);if(!ht)throw new Error("point at infinify");return ht.assertValidity(),ht}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new y(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Pc(this.toDERHex())}toDERHex(){return Wi.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Pc(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const _={isValidPrivateKey(L){try{return u(L),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const L=vL(t.n);return function lne(e,t,r=!1){const i=e.length,s=yL(t),o=vL(t);if(i<16||i1024)throw new Error(`expected ${o}-1024 bytes of input, got ${i}`);const c=Xt(r?Uo(e):uE(e),t-Je)+Je;return r?dE(c,s):Lc(c,s)}(t.randomBytes(L),t.n)},precompute:(L=8,T=l.BASE)=>(T._setWindowSize(L),T.multiply(BigInt(3)),T)};function w(L){const T=Vo(L),E="string"==typeof L,x=(T||E)&&L.length;return T?x===s||x===o:E?x===2*s||x===2*o:L instanceof l}const D=t.bits2int||function(L){const T=Uo(L),E=8*L.length-t.nBitLength;return E>0?T>>BigInt(E):T},C=t.bits2int_modN||function(L){return a(D(L))},S=hE(t.nBitLength);function I(L){return jo(`num < 2^${t.nBitLength}`,L,Pr,S),Lc(L,t.nByteLength)}const H={lowS:t.lowS,prehash:!1},V={lowS:t.lowS,prehash:!1};return l.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function v(L,T=!0){return l.fromPrivateKey(L).toRawBytes(T)},getSharedSecret:function b(L,T,E=!0){if(w(L))throw new Error("first arg must be private key");if(!w(T))throw new Error("second arg must be public key");return l.fromHex(T).multiply(u(L)).toRawBytes(E)},sign:function $(L,T,E=H){const{seed:x,k2sig:R}=function P(L,T,E=H){if(["recovered","canonical"].some(ot=>ot in E))throw new Error("sign() legacy options not supported");const{hash:x,randomBytes:R}=t;let{lowS:M,prehash:W,extraEntropy:J}=E;null==M&&(M=!0),L=kr("msgHash",L),bL(E),W&&(L=kr("prehashed msgHash",x(L)));const ee=C(L),Se=u(T),ue=[I(Se),I(ee)];if(null!=J&&!1!==J){const ot=!0===J?R(r.BYTES):J;ue.push(kr("extraEntropy",ot))}const yt=rd(...ue),ht=ee;return{seed:yt,k2sig:function Ae(ot){const Oe=D(ot);if(!f(Oe))return;const Pn=c(Oe),en=l.BASE.multiply(Oe).toAffine(),tn=a(en.x);if(tn===Pr)return;const Br=a(Pn*a(ht+tn*Se));if(Br===Pr)return;let Ko=(en.x===tn?0:2)|Number(en.y&We),Ad=Br;return M&&p(Br)&&(Ad=function g(L){return p(L)?a(-L):L}(Br),Ko^=1),new y(tn,Ad,Ko)}}}(L,T,E);return hL(t.hash.outputLen,t.nByteLength,t.hmac)(x,R)},verify:function X(L,T,E,x=V){const R=L;if(T=kr("msgHash",T),E=kr("publicKey",E),"strict"in x)throw new Error("options.strict was renamed to lowS");bL(x);const{lowS:M,prehash:W}=x;let J,ee;try{if("string"==typeof R||Vo(R))try{J=y.fromDER(R)}catch(en){if(!(en instanceof Wi.Err))throw en;J=y.fromCompact(R)}else{if("object"!=typeof R||"bigint"!=typeof R.r||"bigint"!=typeof R.s)throw new Error("PARSE");{const{r:en,s:tn}=R;J=new y(en,tn)}}ee=l.fromHex(E)}catch(en){if("PARSE"===en.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(M&&J.hasHighS())return!1;W&&(T=t.hash(T));const{r:Se,s:ue}=J,yt=C(T),ht=c(ue),Ae=a(yt*ht),ot=a(Se*ht),Oe=l.BASE.multiplyAndAddUnsafe(ee,Ae,ot)?.toAffine();return!!Oe&&a(Oe.x)===Se},ProjectivePoint:l,Signature:y,utils:_}}function wne(e){return{hash:e,hmac:(t,...r)=>td(e,t,function ed(...e){let t=0;for(let i=0;i(e+t/xg)/t;const wE=mL(sd,void 0,void 0,{sqrt:function DL(e){const t=sd,r=BigInt(3),i=BigInt(6),s=BigInt(11),o=BigInt(22),a=BigInt(23),c=BigInt(44),l=BigInt(88),u=e*e*e%t,d=u*u*e%t,f=hr(d,r,t)*d%t,h=hr(f,r,t)*d%t,p=hr(h,xg,t)*u%t,g=hr(p,s,t)*p%t,m=hr(g,o,t)*g%t,y=hr(m,c,t)*m%t,_=hr(y,l,t)*y%t,v=hr(_,c,t)*m%t,w=hr(v,r,t)*d%t,b=hr(w,a,t)*g%t,D=hr(b,i,t)*u%t,C=hr(D,xg,t);if(!wE.eql(wE.sqr(C),e))throw new Error("Cannot find square root");return C}});(function bne(e,t){const r=i=>vne({...e,...wne(i)});Object.freeze({...r(t),create:r})})({a:BigInt(0),b:BigInt(7),Fp:wE,n:Ig,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Ig,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-od*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=BigInt("0x100000000000000000000000000000000"),c=CL(o*e,t),l=CL(-i*e,t);let u=Xt(e-c*r-l*s,t),d=Xt(-c*i-l*o,t);const f=u>a,h=d>a;if(f&&(u=t-u),h&&(d=t-d),u>a||d>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:h,k2:d}}}},oE),BigInt(0);var WL,QL;tL("Bitcoin seed");class NE{#t;constructor(t){this.#t=t}getPublicKey(){var t=this;return U(function*(){return mb(t.#t)})()}signEvent(t){var r=this;return U(function*(){return Rr(t,r.#t)})()}nip04={encrypt:(()=>{var r,t=this;return r=U(function*(i,s){return Ib.encrypt(t.#t,i,s)}),function(s,o){return r.apply(this,arguments)}})(),decrypt:(()=>{var r,t=this;return r=U(function*(i,s){return Ib.decrypt(t.#t,i,s)}),function(s,o){return r.apply(this,arguments)}})()};#i(t){return mg.v2.utils.getConversationKey(this.#t,t)}nip44={encrypt:(()=>{var r,t=this;return r=U(function*(i,s){const o=t.#i(i);return mg.v2.encrypt(s,o)}),function(s,o){return r.apply(this,arguments)}})(),decrypt:(()=>{var r,t=this;return r=U(function*(i,s){const o=t.#i(i);return mg.v2.decrypt(s,o)}),function(s,o){return r.apply(this,arguments)}})()}}function GL(e,t){this.v=e,this.k=t}function js(e){return new GL(e,0)}function Pg(e){return function(){return new dd(e.apply(this,arguments))}}function dd(e){var t,r;function i(o,a){try{var c=e[o](a),l=c.value,u=l instanceof GL;Promise.resolve(u?l.v:l).then(function(d){if(u){var f="return"===o?"return":"next";if(!l.k||d.done)return i(f,d);d=e[f](d).value}s(c.done?"return":"normal",d)},function(d){i("throw",d)})}catch(d){s("throw",d)}}function s(o,a){switch(o){case"return":t.resolve({value:a,done:!0});break;case"throw":t.reject(a);break;default:t.resolve({value:a,done:!1})}(t=t.next)?i(t.key,t.arg):r=null}this._invoke=function(o,a){return new Promise(function(c,l){var u={key:o,arg:a,resolve:c,reject:l,next:null};r?r=r.next=u:(t=r=u,i(o,a))})},"function"!=typeof e.return&&(this.return=void 0)}new TextEncoder,(new TextEncoder).encode("0123456789abcdef"),new TextEncoder,new TextDecoder,dd.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},dd.prototype.next=function(e){return this._invoke("next",e)},dd.prototype.throw=function(e){return this._invoke("throw",e)},dd.prototype.return=function(e){return this._invoke("return",e)},WL=Symbol.asyncIterator;class ZL{#t=[];#i;#f=!1;constructor(t){t?.aborted?this.abort():t?.addEventListener("abort",()=>this.abort(),{once:!0})}[WL](){var t=this;return Pg(function*(){for(;!t.#f;)t.#t.length?yield t.#t.shift():yield js(new Promise(r=>{t.#i=r}));throw new DOMException("The signal has been aborted","AbortError")})()}push(t){this.#t.push(t),this.#i?.()}abort(){this.#f=!0,this.#i?.()}}class KL{static regular(t){return 1e3<=t&&t<1e4||[1,2,4,5,6,7,8,16,40,41,42,43,44].includes(t)}static replaceable(t){return 1e4<=t&&t<2e4||[0,3].includes(t)}static ephemeral(t){return 2e4<=t&&t<3e4}static parameterizedReplaceable(t){return 3e4<=t&&t<4e4}}QL=Symbol.asyncDispose;class Zne{opts;_relays;constructor(t){this.opts=t,this._relays=new Map}relay(t){const r=this._relays.get(t);if(r)return r;{const i=this.opts.open(t);return this._relays.set(t,i),i}}get relays(){return this._relays}req(t,r){var i=this;return Pg(function*(){const s=new AbortController,o=r?.signal?AbortSignal.any([r.signal,s.signal]):s.signal,a=yield js(i.opts.reqRouter(t));if(a.size<1)return;const c=new ZL(o),l=new Set,u=new Set;for(const[m,y]of a.entries()){const _=i.relay(m);U(function*(){var b,v=!1,w=!1;try{for(var C,D=Cs(_.req(y,{signal:o}));v=!(C=yield D.next()).done;v=!1){const S=C.value;"EOSE"===S[0]&&(l.add(m),l.size===a.size&&c.push(S)),"CLOSED"===S[0]&&(u.add(m),u.size===a.size&&c.push(S)),"EVENT"===S[0]&&c.push(S)}}catch(S){w=!0,b=S}finally{try{v&&null!=D.return&&(yield D.return())}finally{if(w)throw b}}})().catch(()=>{})}try{var h,d=!1,f=!1;try{for(var g,p=Cs(c);d=!(g=yield js(p.next())).done;d=!1)yield g.value}catch(m){f=!0,h=m}finally{try{d&&null!=p.return&&(yield js(p.return()))}finally{if(f)throw h}}}finally{s.abort()}})()}event(t,r){var i=this;return U(function*(){const s=yield i.opts.eventRouter(t);s.length<1||(yield Promise.any(s.map(o=>i.relay(o).event(t,r))))})()}query(t,r){var i=this;return U(function*(){const s=new fr,o=t.reduce((h,p)=>h+uP(p),0);if(0===o)return[];const a=t.reduce((h,p)=>h||!!p.kinds?.some(g=>KL.replaceable(g)||KL.parameterizedReplaceable(g)),!1);try{var u,c=!1,l=!1;try{for(var f,d=Cs(i.req(t,r));c=!(f=yield d.next()).done;c=!1){const h=f.value;if("EOSE"===h[0])break;if("EVENT"===h[0]&&s.add(h[2]),"CLOSED"===h[0])throw new Error("Subscription closed");if(!a&&s.size>=o)break}}catch(h){l=!0,u=h}finally{try{c&&null!=d.return&&(yield d.return())}finally{if(l)throw u}}}catch{}return[...s]})()}close(){var t=this;return U(function*(){yield Promise.all([...t._relays.values()].map(r=>r.close()))})()}[QL](){var t=this;return U(function*(){yield t.close()})()}}class Kne{constructor(t,r){if(this._retries=0,!Number.isInteger(t)||t<0)throw new Error("Base must be a positive integer or zero");if(void 0!==r&&(!Number.isInteger(r)||r<0))throw new Error("ExpMax must be a undefined, a positive integer or zero");this.base=t,this.expMax=r,this.i=0}get retries(){return this._retries}get current(){return this.base*Math.pow(2,this.i)}next(){return this._retries++,this.i=void 0===this.expMax?this.i+1:Math.min(this.i+1,this.expMax),this.current}reset(){this._retries=0,this.i=0}}var Re,Xe=function(e){return e.open="open",e.close="close",e.error="error",e.message="message",e.retry="retry",e.reconnect="reconnect",e}(Xe||{});class Qne{constructor(t,r,i){var s,o,a,c,l,u,d,f,h,p,g,m,y,_,v;this._closedByUser=!1,this.handleOpenEvent=w=>this.handleEvent(Xe.open,w),this.handleErrorEvent=w=>this.handleEvent(Xe.error,w),this.handleCloseEvent=w=>this.handleEvent(Xe.close,w),this.handleMessageEvent=w=>this.handleEvent(Xe.message,w),this._url=t,this._protocols=r,this._options={buffer:i?.buffer,retry:{maxRetries:null===(s=i?.retry)||void 0===s?void 0:s.maxRetries,instantReconnect:null===(o=i?.retry)||void 0===o?void 0:o.instantReconnect,backoff:null===(a=i?.retry)||void 0===a?void 0:a.backoff},listeners:{open:[...null!==(l=null===(c=i?.listeners)||void 0===c?void 0:c.open)&&void 0!==l?l:[]],close:[...null!==(d=null===(u=i?.listeners)||void 0===u?void 0:u.close)&&void 0!==d?d:[]],error:[...null!==(h=null===(f=i?.listeners)||void 0===f?void 0:f.error)&&void 0!==h?h:[]],message:[...null!==(g=null===(p=i?.listeners)||void 0===p?void 0:p.message)&&void 0!==g?g:[]],retry:[...null!==(y=null===(m=i?.listeners)||void 0===m?void 0:m.retry)&&void 0!==y?y:[]],reconnect:[...null!==(v=null===(_=i?.listeners)||void 0===_?void 0:_.reconnect)&&void 0!==v?v:[]]}},this._underlyingWebsocket=this.tryConnect()}get url(){return this._url}get protocols(){return this._protocols}get buffer(){return this._options.buffer}get maxRetries(){return this._options.retry.maxRetries}get instantReconnect(){return this._options.retry.instantReconnect}get backoff(){return this._options.retry.backoff}get closedByUser(){return this._closedByUser}get lastConnection(){return this._lastConnection}get underlyingWebsocket(){return this._underlyingWebsocket}get readyState(){return this._underlyingWebsocket.readyState}get bufferedAmount(){return this._underlyingWebsocket.bufferedAmount}get extensions(){return this._underlyingWebsocket.extensions}get binaryType(){return this._underlyingWebsocket.binaryType}set binaryType(t){this._underlyingWebsocket.binaryType=t}send(t){this.closedByUser||(this._underlyingWebsocket.readyState===this._underlyingWebsocket.OPEN?this._underlyingWebsocket.send(t):void 0!==this.buffer&&this.buffer.add(t))}close(t,r){this.cancelScheduledConnectionRetry(),this._closedByUser=!0,this._underlyingWebsocket.close(t,r)}addEventListener(t,r,i){this._options.listeners[t].push({listener:r,options:i})}removeEventListener(t,r,i){this._options.listeners[t]=this._options.listeners[t].filter(o=>o.listener!==r||o.options!==i)}tryConnect(){return this._underlyingWebsocket=new WebSocket(this.url,this.protocols),this._underlyingWebsocket.addEventListener(Xe.open,this.handleOpenEvent),this._underlyingWebsocket.addEventListener(Xe.close,this.handleCloseEvent),this._underlyingWebsocket.addEventListener(Xe.error,this.handleErrorEvent),this._underlyingWebsocket.addEventListener(Xe.message,this.handleMessageEvent),this._underlyingWebsocket}clearWebsocket(){this._underlyingWebsocket.removeEventListener(Xe.open,this.handleOpenEvent),this._underlyingWebsocket.removeEventListener(Xe.close,this.handleCloseEvent),this._underlyingWebsocket.removeEventListener(Xe.error,this.handleErrorEvent),this._underlyingWebsocket.removeEventListener(Xe.message,this.handleMessageEvent),this._underlyingWebsocket.close()}dispatchEvent(t,r){const s=[];this._options.listeners[t].forEach(({listener:o,options:a})=>{o(this,r),(void 0===a||void 0===a.once||!a.once)&&s.push({listener:o,options:a})}),this._options.listeners[t]=s}handleEvent(t,r){switch(t){case Xe.close:this.dispatchEvent(t,r),this.scheduleConnectionRetryIfNeeded();break;case Xe.open:if(void 0!==this.backoff&&void 0!==this._lastConnection){const i={retries:this.backoff.retries,lastConnection:new Date(this._lastConnection)},s=new CustomEvent(Xe.reconnect,{detail:i});this.dispatchEvent(Xe.reconnect,s),this.backoff.reset()}this._lastConnection=new Date,this.dispatchEvent(t,r),this.sendBufferedData();break;case Xe.retry:this.dispatchEvent(t,r),this.clearWebsocket(),this.tryConnect();break;default:this.dispatchEvent(t,r)}}sendBufferedData(){if(void 0!==this.buffer)for(let t=this.buffer.read();void 0!==t;t=this.buffer.read())this.send(t)}scheduleConnectionRetryIfNeeded(){if(this.closedByUser||void 0===this.backoff)return;const t=i=>{const s=new CustomEvent(Xe.retry,{detail:i});this.handleEvent(Xe.retry,s)},r={backoff:!0===this._options.retry.instantReconnect?0:this.backoff.next(),retries:!0===this._options.retry.instantReconnect?0:this.backoff.retries,lastConnection:this._lastConnection};(void 0===this._options.retry.maxRetries||r.retries<=this._options.retry.maxRetries)&&(this.retryTimeout=globalThis.setTimeout(()=>t(r),r.backoff))}cancelScheduledConnectionRetry(){globalThis.clearTimeout(this.retryTimeout)}}class Yne{constructor(t){this._url=t}get url(){return this._url}withProtocols(t){return this._protocols=t,this}get protocols(){return this._protocols}withMaxRetries(t){var r;return this._options=Object.assign(Object.assign({},this._options),{retry:Object.assign(Object.assign({},null===(r=this._options)||void 0===r?void 0:r.retry),{maxRetries:t})}),this}get maxRetries(){var t,r;return null===(r=null===(t=this._options)||void 0===t?void 0:t.retry)||void 0===r?void 0:r.maxRetries}withInstantReconnect(t){var r;return this._options=Object.assign(Object.assign({},this._options),{retry:Object.assign(Object.assign({},null===(r=this._options)||void 0===r?void 0:r.retry),{instantReconnect:t})}),this}get instantReconnect(){var t,r;return null===(r=null===(t=this._options)||void 0===t?void 0:t.retry)||void 0===r?void 0:r.instantReconnect}withBackoff(t){var r;return this._options=Object.assign(Object.assign({},this._options),{retry:Object.assign(Object.assign({},null===(r=this._options)||void 0===r?void 0:r.retry),{backoff:t})}),this}get backoff(){var t,r;return null===(r=null===(t=this._options)||void 0===t?void 0:t.retry)||void 0===r?void 0:r.backoff}withBuffer(t){return this._options=Object.assign(Object.assign({},this._options),{buffer:t}),this}get buffer(){var t;return null===(t=this._options)||void 0===t?void 0:t.buffer}onOpen(t,r){return this.addListener(Xe.open,t,r),this}onClose(t,r){return this.addListener(Xe.close,t,r),this}onError(t,r){return this.addListener(Xe.error,t,r),this}onMessage(t,r){return this.addListener(Xe.message,t,r),this}onRetry(t,r){return this.addListener(Xe.retry,t,r),this}onReconnect(t,r){return this.addListener(Xe.reconnect,t,r),this}build(){return new Qne(this._url,this._protocols,this._options)}addListener(t,r,i){var s,o,a,c,l,u,d,f,h,p,g,m,y,_,v,w,b,D,C,S,I;return this._options=Object.assign(Object.assign({},this._options),{listeners:{open:null!==(a=null===(o=null===(s=this._options)||void 0===s?void 0:s.listeners)||void 0===o?void 0:o.open)&&void 0!==a?a:[],close:null!==(u=null===(l=null===(c=this._options)||void 0===c?void 0:c.listeners)||void 0===l?void 0:l.close)&&void 0!==u?u:[],error:null!==(h=null===(f=null===(d=this._options)||void 0===d?void 0:d.listeners)||void 0===f?void 0:f.error)&&void 0!==h?h:[],message:null!==(m=null===(g=null===(p=this._options)||void 0===p?void 0:p.listeners)||void 0===g?void 0:g.message)&&void 0!==m?m:[],retry:null!==(v=null===(_=null===(y=this._options)||void 0===y?void 0:y.listeners)||void 0===_?void 0:_.retry)&&void 0!==v?v:[],reconnect:null!==(D=null===(b=null===(w=this._options)||void 0===w?void 0:w.listeners)||void 0===b?void 0:b.reconnect)&&void 0!==D?D:[],[t]:[...null!==(I=null===(S=null===(C=this._options)||void 0===C?void 0:C.listeners)||void 0===S?void 0:S[t])&&void 0!==I?I:[],{listener:r,options:i}]}}),this}}class Jne{constructor(){this.elements=[]}add(t){this.elements.push(t)}clear(){this.elements.length=0}forEach(t){this.elements.forEach(t)}length(){return this.elements.length}isEmpty(){return 0===this.elements.length}peek(){return this.elements[0]}read(){return this.elements.shift()}}!function(e){e.assertEqual=s=>s,e.assertIs=function t(s){},e.assertNever=function r(s){throw new Error},e.arrayToEnum=s=>{const o={};for(const a of s)o[a]=a;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(c=>"number"!=typeof s[s[c]]),a={};for(const c of o)a[c]=s[c];return e.objectValues(a)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys="function"==typeof Object.keys?s=>Object.keys(s):s=>{const o=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&o.push(a);return o},e.find=(s,o)=>{for(const a of s)if(o(a))return a},e.isInteger="function"==typeof Number.isInteger?s=>Number.isInteger(s):s=>"number"==typeof s&&isFinite(s)&&Math.floor(s)===s,e.joinValues=function i(s,o=" | "){return s.map(a=>"string"==typeof a?`'${a}'`:a).join(o)},e.jsonStringifyReplacer=(s,o)=>"bigint"==typeof o?o.toString():o}(Re||(Re={}));var YL=function(e){return e.mergeShapes=(t,r)=>({...t,...r}),e}(YL||{});const K=Re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$s=e=>{switch(typeof e){case"undefined":return K.undefined;case"string":return K.string;case"number":return isNaN(e)?K.nan:K.number;case"boolean":return K.boolean;case"function":return K.function;case"bigint":return K.bigint;case"symbol":return K.symbol;case"object":return Array.isArray(e)?K.array:null===e?K.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?K.promise:typeof Map<"u"&&e instanceof Map?K.map:typeof Set<"u"&&e instanceof Set?K.set:typeof Date<"u"&&e instanceof Date?K.date:K.object;default:return K.unknown}},B=Re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);let Ki=(()=>{class e extends Error{constructor(r){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const i=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,i):this.__proto__=i,this.name="ZodError",this.issues=r}get errors(){return this.issues}format(r){const i=r||function(a){return a.message},s={_errors:[]},o=a=>{for(const c of a.issues)if("invalid_union"===c.code)c.unionErrors.map(o);else if("invalid_return_type"===c.code)o(c.returnTypeError);else if("invalid_arguments"===c.code)o(c.argumentsError);else if(0===c.path.length)s._errors.push(i(c));else{let l=s,u=0;for(;ui.message){const i={},s=[];for(const o of this.issues)o.path.length>0?(i[o.path[0]]=i[o.path[0]]||[],i[o.path[0]].push(r(o))):s.push(r(o));return{formErrors:s,fieldErrors:i}}get formErrors(){return this.flatten()}}return e.create=t=>new e(t),e})();const Bc=(e,t)=>{let r;switch(e.code){case B.invalid_type:r=e.received===K.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case B.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Re.jsonStringifyReplacer)}`;break;case B.unrecognized_keys:r=`Unrecognized key(s) in object: ${Re.joinValues(e.keys,", ")}`;break;case B.invalid_union:r="Invalid input";break;case B.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Re.joinValues(e.options)}`;break;case B.invalid_enum_value:r=`Invalid enum value. Expected ${Re.joinValues(e.options)}, received '${e.received}'`;break;case B.invalid_arguments:r="Invalid function arguments";break;case B.invalid_return_type:r="Invalid function return type";break;case B.invalid_date:r="Invalid date";break;case B.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Re.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case B.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case B.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case B.custom:r="Invalid input";break;case B.invalid_intersection_types:r="Intersection results could not be merged";break;case B.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case B.not_finite:r="Number must be finite";break;default:r=t.defaultError,Re.assertNever(e)}return{message:r}};let JL=Bc;function Lg(){return JL}const Fg=e=>{const{data:t,path:r,errorMaps:i,issueData:s}=e,o=[...r,...s.path||[]],a={...s,path:o};if(void 0!==s.message)return{...s,path:o,message:s.message};let c="";const l=i.filter(u=>!!u).slice().reverse();for(const u of l)c=u(a,{data:t,defaultError:c}).message;return{...s,path:o,message:c}};function Z(e,t){const r=Lg(),i=Fg({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Bc?void 0:Bc].filter(s=>!!s)});e.common.issues.push(i)}class dn{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(t,r){const i=[];for(const s of r){if("aborted"===s.status)return ae;"dirty"===s.status&&t.dirty(),i.push(s.value)}return{status:t.value,value:i}}static mergeObjectAsync(t,r){return U(function*(){const i=[];for(const s of r){const o=yield s.key,a=yield s.value;i.push({key:o,value:a})}return dn.mergeObjectSync(t,i)})()}static mergeObjectSync(t,r){const i={};for(const s of r){const{key:o,value:a}=s;if("aborted"===o.status||"aborted"===a.status)return ae;"dirty"===o.status&&t.dirty(),"dirty"===a.status&&t.dirty(),"__proto__"!==o.value&&(typeof a.value<"u"||s.alwaysSet)&&(i[o.value]=a.value)}return{status:t.value,value:i}}}const ae=Object.freeze({status:"aborted"}),Vc=e=>({status:"dirty",value:e}),Dn=e=>({status:"valid",value:e}),PE=e=>"aborted"===e.status,LE=e=>"dirty"===e.status,fd=e=>"valid"===e.status,hd=e=>typeof Promise<"u"&&e instanceof Promise;function Bg(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}function XL(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r}"function"==typeof SuppressedError&&SuppressedError;var pd,gd,te=function(e){return e.errToObj=t=>"string"==typeof t?{message:t}:t||{},e.toString=t=>"string"==typeof t?t:t?.message,e}(te||{});class _i{constructor(t,r,i,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=i,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const eF=(e,t)=>{if(fd(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Ki(e.common.issues);return this._error=r,this._error}}};function ye(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:i,description:s}=e;if(t&&(r||i))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:s}:{errorMap:(a,c)=>{var l,u;const{message:d}=e;return"invalid_enum_value"===a.code?{message:d??c.defaultError}:typeof c.data>"u"?{message:null!==(l=d??i)&&void 0!==l?l:c.defaultError}:"invalid_type"!==a.code?{message:c.defaultError}:{message:null!==(u=d??r)&&void 0!==u?u:c.defaultError}},description:s}}class Ce{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return $s(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:$s(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new dn,ctx:{common:t.parent.common,data:t.data,parsedType:$s(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(hd(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const i=this.safeParse(t,r);if(i.success)return i.data;throw i.error}safeParse(t,r){var i;const s={common:{issues:[],async:null!==(i=r?.async)&&void 0!==i&&i,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:$s(t)},o=this._parseSync({data:t,path:s.path,parent:s});return eF(s,o)}parseAsync(t,r){var i=this;return U(function*(){const s=yield i.safeParseAsync(t,r);if(s.success)return s.data;throw s.error})()}safeParseAsync(t,r){var i=this;return U(function*(){const s={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:i._def.errorMap,parent:null,data:t,parsedType:$s(t)},o=i._parse({data:t,path:s.path,parent:s}),a=yield hd(o)?o:Promise.resolve(o);return eF(s,a)})()}refine(t,r){const i=s=>"string"==typeof r||typeof r>"u"?{message:r}:"function"==typeof r?r(s):r;return this._refinement((s,o)=>{const a=t(s),c=()=>o.addIssue({code:B.custom,...i(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>!!l||(c(),!1)):!!a||(c(),!1)})}refinement(t,r){return this._refinement((i,s)=>!!t(i)||(s.addIssue("function"==typeof r?r(i,s):r),!1))}_refinement(t){return new qo({schema:this,typeName:ce.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return zs.create(this,this._def)}nullable(){return zc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return yd.create(this,this._def)}promise(){return $g.create(this,this._def)}or(t){return zE.create([this,t],this._def)}and(t){return GE.create(this,t,this._def)}transform(t){return new qo({...ye(this._def),schema:this,typeName:ce.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r="function"==typeof t?t:()=>t;return new KE({...ye(this._def),innerType:this,defaultValue:r,typeName:ce.ZodDefault})}brand(){return new YE({typeName:ce.ZodBranded,type:this,...ye(this._def)})}catch(t){const r="function"==typeof t?t:()=>t;return new QE({...ye(this._def),innerType:this,catchValue:r,typeName:ce.ZodCatch})}describe(t){return new(0,this.constructor)({...this._def,description:t})}pipe(t){return wd.create(this,t)}readonly(){return JE.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const nre=/^c[^\s-]{8,}$/i,rre=/^[0-9a-z]+$/,ire=/^[0-9A-HJKMNP-TV-Z]{26}$/,sre=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ore=/^[a-z0-9_-]{21}$/i,are=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,cre=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let FE;const ure=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,dre=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,fre=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,tF="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",hre=new RegExp(`^${tF}$`);function nF(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function pre(e){return new RegExp(`^${nF(e)}$`)}function rF(e){let t=`${tF}T${nF(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function gre(e,t){return!(("v4"!==t&&t||!ure.test(e))&&("v6"!==t&&t||!dre.test(e)))}let Vg=(()=>{class e extends Ce{_parse(r){if(this._def.coerce&&(r.data=String(r.data)),this._getType(r)!==K.string){const a=this._getOrReturnCtx(r);return Z(a,{code:B.invalid_type,expected:K.string,received:a.parsedType}),ae}const s=new dn;let o;for(const a of this._def.checks)if("min"===a.kind)r.data.lengtha.value&&(o=this._getOrReturnCtx(r,o),Z(o,{code:B.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if("length"===a.kind){const c=r.data.length>a.value,l=r.data.lengthr.test(o),{validation:i,code:B.invalid_string,...te.errToObj(s)})}_addCheck(r){return new e({...this._def,checks:[...this._def.checks,r]})}email(r){return this._addCheck({kind:"email",...te.errToObj(r)})}url(r){return this._addCheck({kind:"url",...te.errToObj(r)})}emoji(r){return this._addCheck({kind:"emoji",...te.errToObj(r)})}uuid(r){return this._addCheck({kind:"uuid",...te.errToObj(r)})}nanoid(r){return this._addCheck({kind:"nanoid",...te.errToObj(r)})}cuid(r){return this._addCheck({kind:"cuid",...te.errToObj(r)})}cuid2(r){return this._addCheck({kind:"cuid2",...te.errToObj(r)})}ulid(r){return this._addCheck({kind:"ulid",...te.errToObj(r)})}base64(r){return this._addCheck({kind:"base64",...te.errToObj(r)})}ip(r){return this._addCheck({kind:"ip",...te.errToObj(r)})}datetime(r){var i,s;return this._addCheck("string"==typeof r?{kind:"datetime",precision:null,offset:!1,local:!1,message:r}:{kind:"datetime",precision:typeof r?.precision>"u"?null:r?.precision,offset:null!==(i=r?.offset)&&void 0!==i&&i,local:null!==(s=r?.local)&&void 0!==s&&s,...te.errToObj(r?.message)})}date(r){return this._addCheck({kind:"date",message:r})}time(r){return this._addCheck("string"==typeof r?{kind:"time",precision:null,message:r}:{kind:"time",precision:typeof r?.precision>"u"?null:r?.precision,...te.errToObj(r?.message)})}duration(r){return this._addCheck({kind:"duration",...te.errToObj(r)})}regex(r,i){return this._addCheck({kind:"regex",regex:r,...te.errToObj(i)})}includes(r,i){return this._addCheck({kind:"includes",value:r,position:i?.position,...te.errToObj(i?.message)})}startsWith(r,i){return this._addCheck({kind:"startsWith",value:r,...te.errToObj(i)})}endsWith(r,i){return this._addCheck({kind:"endsWith",value:r,...te.errToObj(i)})}min(r,i){return this._addCheck({kind:"min",value:r,...te.errToObj(i)})}max(r,i){return this._addCheck({kind:"max",value:r,...te.errToObj(i)})}length(r,i){return this._addCheck({kind:"length",value:r,...te.errToObj(i)})}nonempty(r){return this.min(1,te.errToObj(r))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(r=>"datetime"===r.kind)}get isDate(){return!!this._def.checks.find(r=>"date"===r.kind)}get isTime(){return!!this._def.checks.find(r=>"time"===r.kind)}get isDuration(){return!!this._def.checks.find(r=>"duration"===r.kind)}get isEmail(){return!!this._def.checks.find(r=>"email"===r.kind)}get isURL(){return!!this._def.checks.find(r=>"url"===r.kind)}get isEmoji(){return!!this._def.checks.find(r=>"emoji"===r.kind)}get isUUID(){return!!this._def.checks.find(r=>"uuid"===r.kind)}get isNANOID(){return!!this._def.checks.find(r=>"nanoid"===r.kind)}get isCUID(){return!!this._def.checks.find(r=>"cuid"===r.kind)}get isCUID2(){return!!this._def.checks.find(r=>"cuid2"===r.kind)}get isULID(){return!!this._def.checks.find(r=>"ulid"===r.kind)}get isIP(){return!!this._def.checks.find(r=>"ip"===r.kind)}get isBase64(){return!!this._def.checks.find(r=>"base64"===r.kind)}get minLength(){let r=null;for(const i of this._def.checks)"min"===i.kind&&(null===r||i.value>r)&&(r=i.value);return r}get maxLength(){let r=null;for(const i of this._def.checks)"max"===i.kind&&(null===r||i.value{var r;return new e({checks:[],typeName:ce.ZodString,coerce:null!==(r=t?.coerce)&&void 0!==r&&r,...ye(t)})},e})();function mre(e,t){const r=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,s=r>i?r:i;return parseInt(e.toFixed(s).replace(".",""))%parseInt(t.toFixed(s).replace(".",""))/Math.pow(10,s)}let BE=(()=>{class e extends Ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(r){if(this._def.coerce&&(r.data=Number(r.data)),this._getType(r)!==K.number){const a=this._getOrReturnCtx(r);return Z(a,{code:B.invalid_type,expected:K.number,received:a.parsedType}),ae}let s;const o=new dn;for(const a of this._def.checks)"int"===a.kind?Re.isInteger(r.data)||(s=this._getOrReturnCtx(r,s),Z(s,{code:B.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()):"min"===a.kind?(a.inclusive?r.dataa.value:r.data>=a.value)&&(s=this._getOrReturnCtx(r,s),Z(s,{code:B.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):"multipleOf"===a.kind?0!==mre(r.data,a.value)&&(s=this._getOrReturnCtx(r,s),Z(s,{code:B.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):"finite"===a.kind?Number.isFinite(r.data)||(s=this._getOrReturnCtx(r,s),Z(s,{code:B.not_finite,message:a.message}),o.dirty()):Re.assertNever(a);return{status:o.value,value:r.data}}gte(r,i){return this.setLimit("min",r,!0,te.toString(i))}gt(r,i){return this.setLimit("min",r,!1,te.toString(i))}lte(r,i){return this.setLimit("max",r,!0,te.toString(i))}lt(r,i){return this.setLimit("max",r,!1,te.toString(i))}setLimit(r,i,s,o){return new e({...this._def,checks:[...this._def.checks,{kind:r,value:i,inclusive:s,message:te.toString(o)}]})}_addCheck(r){return new e({...this._def,checks:[...this._def.checks,r]})}int(r){return this._addCheck({kind:"int",message:te.toString(r)})}positive(r){return this._addCheck({kind:"min",value:0,inclusive:!1,message:te.toString(r)})}negative(r){return this._addCheck({kind:"max",value:0,inclusive:!1,message:te.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:0,inclusive:!0,message:te.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:0,inclusive:!0,message:te.toString(r)})}multipleOf(r,i){return this._addCheck({kind:"multipleOf",value:r,message:te.toString(i)})}finite(r){return this._addCheck({kind:"finite",message:te.toString(r)})}safe(r){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:te.toString(r)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:te.toString(r)})}get minValue(){let r=null;for(const i of this._def.checks)"min"===i.kind&&(null===r||i.value>r)&&(r=i.value);return r}get maxValue(){let r=null;for(const i of this._def.checks)"max"===i.kind&&(null===r||i.value"int"===r.kind||"multipleOf"===r.kind&&Re.isInteger(r.value))}get isFinite(){let r=null,i=null;for(const s of this._def.checks){if("finite"===s.kind||"int"===s.kind||"multipleOf"===s.kind)return!0;"min"===s.kind?(null===i||s.value>i)&&(i=s.value):"max"===s.kind&&(null===r||s.valuenew e({checks:[],typeName:ce.ZodNumber,coerce:t?.coerce||!1,...ye(t)}),e})(),VE=(()=>{class e extends Ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(r){if(this._def.coerce&&(r.data=BigInt(r.data)),this._getType(r)!==K.bigint){const a=this._getOrReturnCtx(r);return Z(a,{code:B.invalid_type,expected:K.bigint,received:a.parsedType}),ae}let s;const o=new dn;for(const a of this._def.checks)"min"===a.kind?(a.inclusive?r.dataa.value:r.data>=a.value)&&(s=this._getOrReturnCtx(r,s),Z(s,{code:B.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):"multipleOf"===a.kind?r.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(r,s),Z(s,{code:B.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):Re.assertNever(a);return{status:o.value,value:r.data}}gte(r,i){return this.setLimit("min",r,!0,te.toString(i))}gt(r,i){return this.setLimit("min",r,!1,te.toString(i))}lte(r,i){return this.setLimit("max",r,!0,te.toString(i))}lt(r,i){return this.setLimit("max",r,!1,te.toString(i))}setLimit(r,i,s,o){return new e({...this._def,checks:[...this._def.checks,{kind:r,value:i,inclusive:s,message:te.toString(o)}]})}_addCheck(r){return new e({...this._def,checks:[...this._def.checks,r]})}positive(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:te.toString(r)})}negative(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:te.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:te.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:te.toString(r)})}multipleOf(r,i){return this._addCheck({kind:"multipleOf",value:r,message:te.toString(i)})}get minValue(){let r=null;for(const i of this._def.checks)"min"===i.kind&&(null===r||i.value>r)&&(r=i.value);return r}get maxValue(){let r=null;for(const i of this._def.checks)"max"===i.kind&&(null===r||i.value{var r;return new e({checks:[],typeName:ce.ZodBigInt,coerce:null!==(r=t?.coerce)&&void 0!==r&&r,...ye(t)})},e})(),UE=(()=>{class e extends Ce{_parse(r){if(this._def.coerce&&(r.data=!!r.data),this._getType(r)!==K.boolean){const s=this._getOrReturnCtx(r);return Z(s,{code:B.invalid_type,expected:K.boolean,received:s.parsedType}),ae}return Dn(r.data)}}return e.create=t=>new e({typeName:ce.ZodBoolean,coerce:t?.coerce||!1,...ye(t)}),e})(),jE=(()=>{class e extends Ce{_parse(r){if(this._def.coerce&&(r.data=new Date(r.data)),this._getType(r)!==K.date){const a=this._getOrReturnCtx(r);return Z(a,{code:B.invalid_type,expected:K.date,received:a.parsedType}),ae}if(isNaN(r.data.getTime()))return Z(this._getOrReturnCtx(r),{code:B.invalid_date}),ae;const s=new dn;let o;for(const a of this._def.checks)"min"===a.kind?r.data.getTime()a.value&&(o=this._getOrReturnCtx(r,o),Z(o,{code:B.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):Re.assertNever(a);return{status:s.value,value:new Date(r.data.getTime())}}_addCheck(r){return new e({...this._def,checks:[...this._def.checks,r]})}min(r,i){return this._addCheck({kind:"min",value:r.getTime(),message:te.toString(i)})}max(r,i){return this._addCheck({kind:"max",value:r.getTime(),message:te.toString(i)})}get minDate(){let r=null;for(const i of this._def.checks)"min"===i.kind&&(null===r||i.value>r)&&(r=i.value);return null!=r?new Date(r):null}get maxDate(){let r=null;for(const i of this._def.checks)"max"===i.kind&&(null===r||i.valuenew e({checks:[],coerce:t?.coerce||!1,typeName:ce.ZodDate,...ye(t)}),e})(),iF=(()=>{class e extends Ce{_parse(r){if(this._getType(r)!==K.symbol){const s=this._getOrReturnCtx(r);return Z(s,{code:B.invalid_type,expected:K.symbol,received:s.parsedType}),ae}return Dn(r.data)}}return e.create=t=>new e({typeName:ce.ZodSymbol,...ye(t)}),e})(),$E=(()=>{class e extends Ce{_parse(r){if(this._getType(r)!==K.undefined){const s=this._getOrReturnCtx(r);return Z(s,{code:B.invalid_type,expected:K.undefined,received:s.parsedType}),ae}return Dn(r.data)}}return e.create=t=>new e({typeName:ce.ZodUndefined,...ye(t)}),e})(),HE=(()=>{class e extends Ce{_parse(r){if(this._getType(r)!==K.null){const s=this._getOrReturnCtx(r);return Z(s,{code:B.invalid_type,expected:K.null,received:s.parsedType}),ae}return Dn(r.data)}}return e.create=t=>new e({typeName:ce.ZodNull,...ye(t)}),e})(),Ug=(()=>{class e extends Ce{constructor(){super(...arguments),this._any=!0}_parse(r){return Dn(r.data)}}return e.create=t=>new e({typeName:ce.ZodAny,...ye(t)}),e})(),md=(()=>{class e extends Ce{constructor(){super(...arguments),this._unknown=!0}_parse(r){return Dn(r.data)}}return e.create=t=>new e({typeName:ce.ZodUnknown,...ye(t)}),e})(),zo=(()=>{class e extends Ce{_parse(r){const i=this._getOrReturnCtx(r);return Z(i,{code:B.invalid_type,expected:K.never,received:i.parsedType}),ae}}return e.create=t=>new e({typeName:ce.ZodNever,...ye(t)}),e})(),sF=(()=>{class e extends Ce{_parse(r){if(this._getType(r)!==K.undefined){const s=this._getOrReturnCtx(r);return Z(s,{code:B.invalid_type,expected:K.void,received:s.parsedType}),ae}return Dn(r.data)}}return e.create=t=>new e({typeName:ce.ZodVoid,...ye(t)}),e})(),yd=(()=>{class e extends Ce{_parse(r){const{ctx:i,status:s}=this._processInputParams(r),o=this._def;if(i.parsedType!==K.array)return Z(i,{code:B.invalid_type,expected:K.array,received:i.parsedType}),ae;if(null!==o.exactLength){const c=i.data.length>o.exactLength.value,l=i.data.lengtho.maxLength.value&&(Z(i,{code:B.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),s.dirty()),i.common.async)return Promise.all([...i.data].map((c,l)=>o.type._parseAsync(new _i(i,c,i.path,l)))).then(c=>dn.mergeArray(s,c));const a=[...i.data].map((c,l)=>o.type._parseSync(new _i(i,c,i.path,l)));return dn.mergeArray(s,a)}get element(){return this._def.type}min(r,i){return new e({...this._def,minLength:{value:r,message:te.toString(i)}})}max(r,i){return new e({...this._def,maxLength:{value:r,message:te.toString(i)}})}length(r,i){return new e({...this._def,exactLength:{value:r,message:te.toString(i)}})}nonempty(r){return this.min(1,r)}}return e.create=(t,r)=>new e({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ce.ZodArray,...ye(r)}),e})();function Uc(e){if(e instanceof jc){const t={};for(const r in e.shape)t[r]=zs.create(Uc(e.shape[r]));return new jc({...e._def,shape:()=>t})}return e instanceof yd?new yd({...e._def,type:Uc(e.element)}):e instanceof zs?zs.create(Uc(e.unwrap())):e instanceof zc?zc.create(Uc(e.unwrap())):e instanceof $c?$c.create(e.items.map(t=>Uc(t))):e}let jc=(()=>{class e extends Ce{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const r=this._def.shape(),i=Re.objectKeys(r);return this._cached={shape:r,keys:i}}_parse(r){if(this._getType(r)!==K.object){const d=this._getOrReturnCtx(r);return Z(d,{code:B.invalid_type,expected:K.object,received:d.parsedType}),ae}const{status:s,ctx:o}=this._processInputParams(r),{shape:a,keys:c}=this._getCached(),l=[];if(!(this._def.catchall instanceof zo&&"strip"===this._def.unknownKeys))for(const d in o.data)c.includes(d)||l.push(d);const u=[];for(const d of c)u.push({key:{status:"valid",value:d},value:a[d]._parse(new _i(o,o.data[d],o.path,d)),alwaysSet:d in o.data});if(this._def.catchall instanceof zo){const d=this._def.unknownKeys;if("passthrough"===d)for(const f of l)u.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if("strict"===d)l.length>0&&(Z(o,{code:B.unrecognized_keys,keys:l}),s.dirty());else if("strip"!==d)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const f of l)u.push({key:{status:"valid",value:f},value:d._parse(new _i(o,o.data[f],o.path,f)),alwaysSet:f in o.data})}return o.common.async?Promise.resolve().then(U(function*(){const d=[];for(const f of u){const h=yield f.key,p=yield f.value;d.push({key:h,value:p,alwaysSet:f.alwaysSet})}return d})).then(d=>dn.mergeObjectSync(s,d)):dn.mergeObjectSync(s,u)}get shape(){return this._def.shape()}strict(r){return new e({...this._def,unknownKeys:"strict",...void 0!==r?{errorMap:(i,s)=>{var o,a,c,l;const u=null!==(c=null===(a=(o=this._def).errorMap)||void 0===a?void 0:a.call(o,i,s).message)&&void 0!==c?c:s.defaultError;return"unrecognized_keys"===i.code?{message:null!==(l=te.errToObj(r).message)&&void 0!==l?l:u}:{message:u}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(r){return new e({...this._def,shape:()=>({...this._def.shape(),...r})})}merge(r){return new e({unknownKeys:r._def.unknownKeys,catchall:r._def.catchall,shape:()=>({...this._def.shape(),...r._def.shape()}),typeName:ce.ZodObject})}setKey(r,i){return this.augment({[r]:i})}catchall(r){return new e({...this._def,catchall:r})}pick(r){const i={};return Re.objectKeys(r).forEach(s=>{r[s]&&this.shape[s]&&(i[s]=this.shape[s])}),new e({...this._def,shape:()=>i})}omit(r){const i={};return Re.objectKeys(this.shape).forEach(s=>{r[s]||(i[s]=this.shape[s])}),new e({...this._def,shape:()=>i})}deepPartial(){return Uc(this)}partial(r){const i={};return Re.objectKeys(this.shape).forEach(s=>{const o=this.shape[s];i[s]=r&&!r[s]?o:o.optional()}),new e({...this._def,shape:()=>i})}required(r){const i={};return Re.objectKeys(this.shape).forEach(s=>{if(r&&!r[s])i[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof zs;)a=a._def.innerType;i[s]=a}}),new e({...this._def,shape:()=>i})}keyof(){return cF(Re.objectKeys(this.shape))}}return e.create=(t,r)=>new e({shape:()=>t,unknownKeys:"strip",catchall:zo.create(),typeName:ce.ZodObject,...ye(r)}),e.strictCreate=(t,r)=>new e({shape:()=>t,unknownKeys:"strict",catchall:zo.create(),typeName:ce.ZodObject,...ye(r)}),e.lazycreate=(t,r)=>new e({shape:t,unknownKeys:"strip",catchall:zo.create(),typeName:ce.ZodObject,...ye(r)}),e})(),zE=(()=>{class e extends Ce{_parse(r){const{ctx:i}=this._processInputParams(r),s=this._def.options;if(i.common.async)return Promise.all(s.map(function(){var a=U(function*(c){const l={...i,common:{...i.common,issues:[]},parent:null};return{result:yield c._parseAsync({data:i.data,path:i.path,parent:l}),ctx:l}});return function(c){return a.apply(this,arguments)}}())).then(function o(a){for(const l of a)if("valid"===l.result.status)return l.result;for(const l of a)if("dirty"===l.result.status)return i.common.issues.push(...l.ctx.common.issues),l.result;const c=a.map(l=>new Ki(l.ctx.common.issues));return Z(i,{code:B.invalid_union,unionErrors:c}),ae});{let a;const c=[];for(const u of s){const d={...i,common:{...i.common,issues:[]},parent:null},f=u._parseSync({data:i.data,path:i.path,parent:d});if("valid"===f.status)return f;"dirty"===f.status&&!a&&(a={result:f,ctx:d}),d.common.issues.length&&c.push(d.common.issues)}if(a)return i.common.issues.push(...a.ctx.common.issues),a.result;const l=c.map(u=>new Ki(u));return Z(i,{code:B.invalid_union,unionErrors:l}),ae}}get options(){return this._def.options}}return e.create=(t,r)=>new e({options:t,typeName:ce.ZodUnion,...ye(r)}),e})();const Qi=e=>e instanceof WE?Qi(e.schema):e instanceof qo?Qi(e.innerType()):e instanceof ZE?[e.value]:e instanceof Hs?e.options:e instanceof _d?Re.objectValues(e.enum):e instanceof KE?Qi(e._def.innerType):e instanceof $E?[void 0]:e instanceof HE?[null]:e instanceof zs?[void 0,...Qi(e.unwrap())]:e instanceof zc?[null,...Qi(e.unwrap())]:e instanceof YE||e instanceof JE?Qi(e.unwrap()):e instanceof QE?Qi(e._def.innerType):[];class jg extends Ce{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==K.object)return Z(r,{code:B.invalid_type,expected:K.object,received:r.parsedType}),ae;const i=this.discriminator,o=this.optionsMap.get(r.data[i]);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(Z(r,{code:B.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),ae)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,i){const s=new Map;for(const o of r){const a=Qi(o.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const c of a){if(s.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);s.set(c,o)}}return new jg({typeName:ce.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...ye(i)})}}function qE(e,t){const r=$s(e),i=$s(t);if(e===t)return{valid:!0,data:e};if(r===K.object&&i===K.object){const s=Re.objectKeys(t),o=Re.objectKeys(e).filter(c=>-1!==s.indexOf(c)),a={...e,...t};for(const c of o){const l=qE(e[c],t[c]);if(!l.valid)return{valid:!1};a[c]=l.data}return{valid:!0,data:a}}if(r===K.array&&i===K.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o{class e extends Ce{_parse(r){const{status:i,ctx:s}=this._processInputParams(r),o=(a,c)=>{if(PE(a)||PE(c))return ae;const l=qE(a.value,c.value);return l.valid?((LE(a)||LE(c))&&i.dirty(),{status:i.value,value:l.data}):(Z(s,{code:B.invalid_intersection_types}),ae)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,c])=>o(a,c)):o(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}return e.create=(t,r,i)=>new e({left:t,right:r,typeName:ce.ZodIntersection,...ye(i)}),e})(),$c=(()=>{class e extends Ce{_parse(r){const{status:i,ctx:s}=this._processInputParams(r);if(s.parsedType!==K.array)return Z(s,{code:B.invalid_type,expected:K.array,received:s.parsedType}),ae;if(s.data.lengththis._def.items.length&&(Z(s,{code:B.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty());const a=[...s.data].map((c,l)=>{const u=this._def.items[l]||this._def.rest;return u?u._parse(new _i(s,c,s.path,l)):null}).filter(c=>!!c);return s.common.async?Promise.all(a).then(c=>dn.mergeArray(i,c)):dn.mergeArray(i,a)}get items(){return this._def.items}rest(r){return new e({...this._def,rest:r})}}return e.create=(t,r)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new e({items:t,typeName:ce.ZodTuple,rest:null,...ye(r)})},e})();class vd extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==K.object)return Z(i,{code:B.invalid_type,expected:K.object,received:i.parsedType}),ae;const s=[],o=this._def.keyType,a=this._def.valueType;for(const c in i.data)s.push({key:o._parse(new _i(i,c,i.path,c)),value:a._parse(new _i(i,i.data[c],i.path,c)),alwaysSet:c in i.data});return i.common.async?dn.mergeObjectAsync(r,s):dn.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,i){return new vd(r instanceof Ce?{keyType:t,valueType:r,typeName:ce.ZodRecord,...ye(i)}:{keyType:Vg.create(),valueType:t,typeName:ce.ZodRecord,...ye(r)})}}let oF=(()=>{class e extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){const{status:i,ctx:s}=this._processInputParams(r);if(s.parsedType!==K.map)return Z(s,{code:B.invalid_type,expected:K.map,received:s.parsedType}),ae;const o=this._def.keyType,a=this._def.valueType,c=[...s.data.entries()].map(([l,u],d)=>({key:o._parse(new _i(s,l,s.path,[d,"key"])),value:a._parse(new _i(s,u,s.path,[d,"value"]))}));if(s.common.async){const l=new Map;return Promise.resolve().then(U(function*(){for(const u of c){const d=yield u.key,f=yield u.value;if("aborted"===d.status||"aborted"===f.status)return ae;("dirty"===d.status||"dirty"===f.status)&&i.dirty(),l.set(d.value,f.value)}return{status:i.value,value:l}}))}{const l=new Map;for(const u of c){const d=u.key,f=u.value;if("aborted"===d.status||"aborted"===f.status)return ae;("dirty"===d.status||"dirty"===f.status)&&i.dirty(),l.set(d.value,f.value)}return{status:i.value,value:l}}}}return e.create=(t,r,i)=>new e({valueType:r,keyType:t,typeName:ce.ZodMap,...ye(i)}),e})(),aF=(()=>{class e extends Ce{_parse(r){const{status:i,ctx:s}=this._processInputParams(r);if(s.parsedType!==K.set)return Z(s,{code:B.invalid_type,expected:K.set,received:s.parsedType}),ae;const o=this._def;null!==o.minSize&&s.data.sizeo.maxSize.value&&(Z(s,{code:B.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),i.dirty());const a=this._def.valueType;function c(u){const d=new Set;for(const f of u){if("aborted"===f.status)return ae;"dirty"===f.status&&i.dirty(),d.add(f.value)}return{status:i.value,value:d}}const l=[...s.data.values()].map((u,d)=>a._parse(new _i(s,u,s.path,d)));return s.common.async?Promise.all(l).then(u=>c(u)):c(l)}min(r,i){return new e({...this._def,minSize:{value:r,message:te.toString(i)}})}max(r,i){return new e({...this._def,maxSize:{value:r,message:te.toString(i)}})}size(r,i){return this.min(r,i).max(r,i)}nonempty(r){return this.min(1,r)}}return e.create=(t,r)=>new e({valueType:t,minSize:null,maxSize:null,typeName:ce.ZodSet,...ye(r)}),e})();class Hc extends Ce{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==K.function)return Z(r,{code:B.invalid_type,expected:K.function,received:r.parsedType}),ae;function i(c,l){return Fg({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Lg(),Bc].filter(u=>!!u),issueData:{code:B.invalid_arguments,argumentsError:l}})}function s(c,l){return Fg({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Lg(),Bc].filter(u=>!!u),issueData:{code:B.invalid_return_type,returnTypeError:l}})}const o={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof $g){const c=this;return Dn(U(function*(...l){const u=new Ki([]),d=yield c._def.args.parseAsync(l,o).catch(p=>{throw u.addIssue(i(l,p)),u}),f=yield Reflect.apply(a,this,d);return yield c._def.returns._def.type.parseAsync(f,o).catch(p=>{throw u.addIssue(s(f,p)),u})}))}{const c=this;return Dn(function(...l){const u=c._def.args.safeParse(l,o);if(!u.success)throw new Ki([i(l,u.error)]);const d=Reflect.apply(a,this,u.data),f=c._def.returns.safeParse(d,o);if(!f.success)throw new Ki([s(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Hc({...this._def,args:$c.create(t).rest(md.create())})}returns(t){return new Hc({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,i){return new Hc({args:t||$c.create([]).rest(md.create()),returns:r||md.create(),typeName:ce.ZodFunction,...ye(i)})}}let WE=(()=>{class e extends Ce{get schema(){return this._def.getter()}_parse(r){const{ctx:i}=this._processInputParams(r);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}return e.create=(t,r)=>new e({getter:t,typeName:ce.ZodLazy,...ye(r)}),e})(),ZE=(()=>{class e extends Ce{_parse(r){if(r.data!==this._def.value){const i=this._getOrReturnCtx(r);return Z(i,{received:i.data,code:B.invalid_literal,expected:this._def.value}),ae}return{status:"valid",value:r.data}}get value(){return this._def.value}}return e.create=(t,r)=>new e({value:t,typeName:ce.ZodLiteral,...ye(r)}),e})();function cF(e,t){return new Hs({values:e,typeName:ce.ZodEnum,...ye(t)})}class Hs extends Ce{constructor(){super(...arguments),pd.set(this,void 0)}_parse(t){if("string"!=typeof t.data){const r=this._getOrReturnCtx(t);return Z(r,{expected:Re.joinValues(this._def.values),received:r.parsedType,code:B.invalid_type}),ae}if(Bg(this,pd,"f")||XL(this,pd,new Set(this._def.values),"f"),!Bg(this,pd,"f").has(t.data)){const r=this._getOrReturnCtx(t);return Z(r,{received:r.data,code:B.invalid_enum_value,options:this._def.values}),ae}return Dn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return Hs.create(t,{...this._def,...r})}exclude(t,r=this._def){return Hs.create(this.options.filter(i=>!t.includes(i)),{...this._def,...r})}}pd=new WeakMap,Hs.create=cF;class _d extends Ce{constructor(){super(...arguments),gd.set(this,void 0)}_parse(t){const r=Re.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==K.string&&i.parsedType!==K.number){const s=Re.objectValues(r);return Z(i,{expected:Re.joinValues(s),received:i.parsedType,code:B.invalid_type}),ae}if(Bg(this,gd,"f")||XL(this,gd,new Set(Re.getValidEnumValues(this._def.values)),"f"),!Bg(this,gd,"f").has(t.data)){const s=Re.objectValues(r);return Z(i,{received:i.data,code:B.invalid_enum_value,options:s}),ae}return Dn(t.data)}get enum(){return this._def.values}}gd=new WeakMap,_d.create=(e,t)=>new _d({values:e,typeName:ce.ZodNativeEnum,...ye(t)});let $g=(()=>{class e extends Ce{unwrap(){return this._def.type}_parse(r){const{ctx:i}=this._processInputParams(r);if(i.parsedType!==K.promise&&!1===i.common.async)return Z(i,{code:B.invalid_type,expected:K.promise,received:i.parsedType}),ae;const s=i.parsedType===K.promise?i.data:Promise.resolve(i.data);return Dn(s.then(o=>this._def.type.parseAsync(o,{path:i.path,errorMap:i.common.contextualErrorMap})))}}return e.create=(t,r)=>new e({type:t,typeName:ce.ZodPromise,...ye(r)}),e})(),qo=(()=>{class e extends Ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ce.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(r){var i=this;const{status:s,ctx:o}=this._processInputParams(r),a=this._def.effect||null,c={addIssue:l=>{Z(o,l),l.fatal?s.abort():s.dirty()},get path(){return o.path}};if(c.addIssue=c.addIssue.bind(c),"preprocess"===a.type){const l=a.transform(o.data,c);if(o.common.async)return Promise.resolve(l).then(function(){var u=U(function*(d){if("aborted"===s.value)return ae;const f=yield i._def.schema._parseAsync({data:d,path:o.path,parent:o});return"aborted"===f.status?ae:"dirty"===f.status||"dirty"===s.value?Vc(f.value):f});return function(d){return u.apply(this,arguments)}}());{if("aborted"===s.value)return ae;const u=this._def.schema._parseSync({data:l,path:o.path,parent:o});return"aborted"===u.status?ae:"dirty"===u.status||"dirty"===s.value?Vc(u.value):u}}if("refinement"===a.type){const l=u=>{const d=a.refinement(u,c);if(o.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(!1===o.common.async){const u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return"aborted"===u.status?ae:("dirty"===u.status&&s.dirty(),l(u.value),{status:s.value,value:u.value})}return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>"aborted"===u.status?ae:("dirty"===u.status&&s.dirty(),l(u.value).then(()=>({status:s.value,value:u.value}))))}if("transform"===a.type){if(!1===o.common.async){const l=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!fd(l))return l;const u=a.transform(l.value,c);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:u}}return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(l=>fd(l)?Promise.resolve(a.transform(l.value,c)).then(u=>({status:s.value,value:u})):l)}Re.assertNever(a)}}return e.create=(t,r,i)=>new e({schema:t,typeName:ce.ZodEffects,effect:r,...ye(i)}),e.createWithPreprocess=(t,r,i)=>new e({schema:r,effect:{type:"preprocess",transform:t},typeName:ce.ZodEffects,...ye(i)}),e})(),zs=(()=>{class e extends Ce{_parse(r){return this._getType(r)===K.undefined?Dn(void 0):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}}return e.create=(t,r)=>new e({innerType:t,typeName:ce.ZodOptional,...ye(r)}),e})(),zc=(()=>{class e extends Ce{_parse(r){return this._getType(r)===K.null?Dn(null):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}}return e.create=(t,r)=>new e({innerType:t,typeName:ce.ZodNullable,...ye(r)}),e})(),KE=(()=>{class e extends Ce{_parse(r){const{ctx:i}=this._processInputParams(r);let s=i.data;return i.parsedType===K.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}return e.create=(t,r)=>new e({innerType:t,typeName:ce.ZodDefault,defaultValue:"function"==typeof r.default?r.default:()=>r.default,...ye(r)}),e})(),QE=(()=>{class e extends Ce{_parse(r){const{ctx:i}=this._processInputParams(r),s={...i,common:{...i.common,issues:[]}},o=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return hd(o)?o.then(a=>({status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new Ki(s.common.issues)},input:s.data})})):{status:"valid",value:"valid"===o.status?o.value:this._def.catchValue({get error(){return new Ki(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}return e.create=(t,r)=>new e({innerType:t,typeName:ce.ZodCatch,catchValue:"function"==typeof r.catch?r.catch:()=>r.catch,...ye(r)}),e})(),lF=(()=>{class e extends Ce{_parse(r){if(this._getType(r)!==K.nan){const s=this._getOrReturnCtx(r);return Z(s,{code:B.invalid_type,expected:K.nan,received:s.parsedType}),ae}return{status:"valid",value:r.data}}}return e.create=t=>new e({typeName:ce.ZodNaN,...ye(t)}),e})();const yre=Symbol("zod_brand");class YE extends Ce{_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.type._parse({data:r.data,path:r.path,parent:r})}unwrap(){return this._def.type}}class wd extends Ce{_parse(t){var r=this;const{status:i,ctx:s}=this._processInputParams(t);if(s.common.async)return function(){var a=U(function*(){const c=yield r._def.in._parseAsync({data:s.data,path:s.path,parent:s});return"aborted"===c.status?ae:"dirty"===c.status?(i.dirty(),Vc(c.value)):r._def.out._parseAsync({data:c.value,path:s.path,parent:s})});return function(){return a.apply(this,arguments)}}()();{const o=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===o.status?ae:"dirty"===o.status?(i.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:s.path,parent:s})}}static create(t,r){return new wd({in:t,out:r,typeName:ce.ZodPipeline})}}let JE=(()=>{class e extends Ce{_parse(r){const i=this._def.innerType._parse(r),s=o=>(fd(o)&&(o.value=Object.freeze(o.value)),o);return hd(i)?i.then(o=>s(o)):s(i)}unwrap(){return this._def.innerType}}return e.create=(t,r)=>new e({innerType:t,typeName:ce.ZodReadonly,...ye(r)}),e})();function uF(e,t={},r){return e?Ug.create().superRefine((i,s)=>{var o,a;if(!e(i)){const c="function"==typeof t?t(i):"string"==typeof t?{message:t}:t,l=null===(a=null!==(o=c.fatal)&&void 0!==o?o:r)||void 0===a||a;s.addIssue({code:"custom",..."string"==typeof c?{message:c}:c,fatal:l})}}):Ug.create()}const vre={object:jc.lazycreate};var ce=function(e){return e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly",e}(ce||{});const dF=Vg.create,fF=BE.create,wre=lF.create,bre=VE.create,hF=UE.create,Ere=jE.create,Cre=iF.create,Dre=$E.create,Sre=HE.create,Tre=Ug.create,Ire=md.create,xre=zo.create,Are=sF.create,Mre=yd.create,Nre=jc.create,Rre=jc.strictCreate,Ore=zE.create,kre=jg.create,Pre=GE.create,Lre=$c.create,Fre=vd.create,Bre=oF.create,Vre=aF.create,Ure=Hc.create,jre=WE.create,$re=ZE.create,Hre=Hs.create,zre=_d.create,qre=$g.create,pF=qo.create,Gre=zs.create,Wre=zc.create,Zre=qo.createWithPreprocess,Kre=wd.create;var gF,G=Object.freeze({__proto__:null,defaultErrorMap:Bc,setErrorMap:function ere(e){JL=e},getErrorMap:Lg,makeIssue:Fg,EMPTY_PATH:[],addIssueToContext:Z,ParseStatus:dn,INVALID:ae,DIRTY:Vc,OK:Dn,isAborted:PE,isDirty:LE,isValid:fd,isAsync:hd,get util(){return Re},get objectUtil(){return YL},ZodParsedType:K,getParsedType:$s,ZodType:Ce,datetimeRegex:rF,ZodString:Vg,ZodNumber:BE,ZodBigInt:VE,ZodBoolean:UE,ZodDate:jE,ZodSymbol:iF,ZodUndefined:$E,ZodNull:HE,ZodAny:Ug,ZodUnknown:md,ZodNever:zo,ZodVoid:sF,ZodArray:yd,ZodObject:jc,ZodUnion:zE,ZodDiscriminatedUnion:jg,ZodIntersection:GE,ZodTuple:$c,ZodRecord:vd,ZodMap:oF,ZodSet:aF,ZodFunction:Hc,ZodLazy:WE,ZodLiteral:ZE,ZodEnum:Hs,ZodNativeEnum:_d,ZodPromise:$g,ZodEffects:qo,ZodTransformer:qo,ZodOptional:zs,ZodNullable:zc,ZodDefault:KE,ZodCatch:QE,ZodNaN:lF,BRAND:yre,ZodBranded:YE,ZodPipeline:wd,ZodReadonly:JE,custom:uF,Schema:Ce,ZodSchema:Ce,late:vre,get ZodFirstPartyTypeKind(){return ce},coerce:{string:e=>Vg.create({...e,coerce:!0}),number:e=>BE.create({...e,coerce:!0}),boolean:e=>UE.create({...e,coerce:!0}),bigint:e=>VE.create({...e,coerce:!0}),date:e=>jE.create({...e,coerce:!0})},any:Tre,array:Mre,bigint:bre,boolean:hF,date:Ere,discriminatedUnion:kre,effect:pF,enum:Hre,function:Ure,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>uF(r=>r instanceof e,t),intersection:Pre,lazy:jre,literal:$re,map:Bre,nan:wre,nativeEnum:zre,never:xre,null:Sre,nullable:Wre,number:fF,object:Nre,oboolean:()=>hF().optional(),onumber:()=>fF().optional(),optional:Gre,ostring:()=>dF().optional(),pipeline:Kre,preprocess:Zre,promise:qre,record:Fre,set:Vre,strictObject:Rre,string:dF,symbol:Cre,transformer:pF,tuple:Lre,undefined:Dre,union:Ore,unknown:Ire,void:Are,NEVER:ae,ZodIssueCode:B,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:Ki});class st{static id(){return G.string().regex(/^[0-9a-f]{64}$/)}static event(){return G.object({id:st.id(),kind:G.number().int().nonnegative(),pubkey:st.id(),tags:G.string().array().array(),content:G.string(),created_at:G.number().int().nonnegative(),sig:G.string()})}static filter(){return G.object({kinds:G.number().int().nonnegative().array().optional(),ids:st.id().array().optional(),authors:st.id().array().optional(),since:G.number().int().nonnegative().optional(),until:G.number().int().nonnegative().optional(),limit:G.number().int().nonnegative().optional(),search:G.string().optional()}).passthrough().transform(t=>{const r=["kinds","ids","authors","since","until","limit","search"];return Object.entries(t).reduce((i,[s,o])=>((r.includes(s)||s.startsWith("#"))&&(i[s]=o),i),{})})}static bech32(t){return G.string().regex(/^[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}$/).refine(r=>!t||r.startsWith(`${t}1`))}static clientEVENT(){return G.tuple([G.literal("EVENT"),st.event()])}static clientREQ(){return G.tuple([G.literal("REQ"),G.string()]).rest(st.filter())}static clientCOUNT(){return G.tuple([G.literal("COUNT"),G.string()]).rest(st.filter())}static clientCLOSE(){return G.tuple([G.literal("CLOSE"),G.string()])}static clientAUTH(){return G.tuple([G.literal("AUTH"),st.event()])}static clientMsg(){return G.union([st.clientEVENT(),st.clientREQ(),st.clientCOUNT(),st.clientCLOSE(),st.clientAUTH()])}static relayEVENT(){return G.tuple([G.literal("EVENT"),G.string(),st.event()])}static relayOK(){return G.tuple([G.literal("OK"),st.id(),G.boolean(),G.string()])}static relayEOSE(){return G.tuple([G.literal("EOSE"),G.string()])}static relayNOTICE(){return G.tuple([G.literal("NOTICE"),G.string()])}static relayCLOSED(){return G.tuple([G.literal("CLOSED"),G.string(),G.string()])}static relayAUTH(){return G.tuple([G.literal("AUTH"),G.string()])}static relayCOUNT(){return G.tuple([G.literal("COUNT"),G.string(),G.object({count:G.number().int().nonnegative(),approximate:G.boolean().optional()})])}static relayMsg(){return G.union([st.relayEVENT(),st.relayOK(),st.relayEOSE(),st.relayNOTICE(),st.relayCLOSED(),st.relayAUTH(),st.relayCOUNT()])}static metadata(){return G.object({about:G.string().optional().catch(void 0),banner:G.string().url().optional().catch(void 0),bot:G.boolean().optional().catch(void 0),display_name:G.string().optional().catch(void 0),lud06:st.bech32("lnurl").optional().catch(void 0),lud16:G.string().email().optional().catch(void 0),name:G.string().optional().catch(void 0),nip05:G.string().email().optional().catch(void 0),picture:G.string().url().optional().catch(void 0),website:G.string().url().optional().catch(void 0)}).passthrough()}static connectRequest(){return G.object({id:G.string(),method:G.string(),params:G.string().array()})}static connectResponse(){return G.object({id:G.string(),result:G.string(),error:G.string().optional()})}static json(){return G.string().transform((t,r)=>{try{return JSON.parse(t)}catch{return r.addIssue({code:G.ZodIssueCode.custom,message:"Invalid JSON"}),G.NEVER}})}}gF=Symbol.asyncDispose;class Qre{url;opts;socket;subs;closedByUser;idleTimer;ee;get subscriptions(){return[...this.subs.values()]}constructor(t,r={}){this.url=t,this.opts=r,this.subs=new Map,this.closedByUser=!1,this.ee=new EventTarget,this.socket=this.createSocket(),this.maybeStartIdleTimer()}createSocket(){const{backoff:t=new Kne(1e3)}=this.opts;return new Yne(this.url).withBuffer(new Jne).withBackoff(!1===t?void 0:t).onOpen(()=>{for(const r of this.subs.values())this.send(r)}).onClose(()=>{this.subs.size||this.socket.close()}).onMessage((r,i)=>{const s=st.json().pipe(st.relayMsg()).safeParse(i.data);s.success&&this.receive(s.data)}).build()}receive(t){const{auth:r,verifyEvent:i=Ic}=this.opts;switch(t[0]){case"EVENT":if(!i(t[2]))break;this.ee.dispatchEvent(new CustomEvent(`sub:${t[1]}`,{detail:t}));break;case"EOSE":this.ee.dispatchEvent(new CustomEvent(`sub:${t[1]}`,{detail:t}));break;case"CLOSED":this.subs.delete(t[1]),this.maybeStartIdleTimer(),this.ee.dispatchEvent(new CustomEvent(`sub:${t[1]}`,{detail:t})),this.ee.dispatchEvent(new CustomEvent(`count:${t[1]}`,{detail:t}));break;case"OK":this.ee.dispatchEvent(new CustomEvent(`ok:${t[1]}`,{detail:t}));break;case"NOTICE":this.ee.dispatchEvent(new CustomEvent("notice",{detail:t}));break;case"COUNT":this.ee.dispatchEvent(new CustomEvent(`count:${t[1]}`,{detail:t}));break;case"AUTH":r?.(t[1]).then(s=>this.send(["AUTH",s])).catch(()=>{})}}send(t){switch(this.wake(),t[0]){case"REQ":this.subs.set(t[1],t);break;case"CLOSE":this.subs.delete(t[1]),this.maybeStartIdleTimer();break;case"EVENT":case"COUNT":return this.socket.send(JSON.stringify(t))}this.socket.readyState===WebSocket.OPEN&&this.socket.send(JSON.stringify(t))}req(t,r={}){var i=this;return Pg(function*(){const{signal:s}=r,o=crypto.randomUUID(),a=i.on(`sub:${o}`,s),c=["REQ",o,...t];i.send(c);try{var d,l=!1,u=!1;try{for(var h,f=Cs(a);l=!(h=yield js(f.next())).done;l=!1){const p=h.value;if("EOSE"===p[0]&&(yield p),"CLOSED"===p[0])break;if("EVENT"===p[0]){if(!ug(t,p[2]))continue;yield p}}}catch(p){u=!0,d=p}finally{try{l&&null!=f.return&&(yield js(f.return()))}finally{if(u)throw d}}}finally{i.send(["CLOSE",o])}})()}query(t,r){var i=this;return U(function*(){const s=new fr,o=t.reduce((f,h)=>f+uP(h),0);if(0===o)return[];var l,a=!1,c=!1;try{for(var d,u=Cs(i.req(t,r));a=!(d=yield u.next()).done;a=!1){const f=d.value;if("EOSE"===f[0])break;if("EVENT"===f[0]&&s.add(f[2]),"CLOSED"===f[0])throw new Error("Subscription closed");if(s.size>=o)break}}catch(f){c=!0,l=f}finally{try{a&&null!=u.return&&(yield u.return())}finally{if(c)throw l}}return[...s]})()}event(t,r){var i=this;return U(function*(){const s=i.once(`ok:${t.id}`,r?.signal);i.send(["EVENT",t]);const[,,o,a]=yield s;if(!o)throw new Error(a)})()}count(t,r){var i=this;return U(function*(){const s=crypto.randomUUID(),o=i.once(`count:${s}`,r?.signal);i.send(["COUNT",s,...t]);const a=yield o;switch(a[0]){case"CLOSED":throw new Error("Subscription closed");case"COUNT":{const[,,c]=a;return c}}})()}on(t,r){var i=this;return Pg(function*(){if(r?.aborted)throw i.abortError();const s=new ZL(r),o=f=>s.push(f.detail);i.ee.addEventListener(t,o);try{var l,a=!1,c=!1;try{for(var d,u=Cs(s);a=!(d=yield js(u.next())).done;a=!1)yield d.value}catch(f){c=!0,l=f}finally{try{a&&null!=u.return&&(yield js(u.return()))}finally{if(c)throw l}}}finally{i.ee.removeEventListener(t,o)}})()}once(t,r){var i=this;return U(function*(){var a,s=!1,o=!1;try{for(var l,c=Cs(i.on(t,r));s=!(l=yield c.next()).done;s=!1)return l.value}catch(u){o=!0,a=u}finally{try{s&&null!=c.return&&(yield c.return())}finally{if(o)throw a}}throw new Error("Unreachable")})()}abortError(){return new DOMException("The signal has been aborted","AbortError")}maybeStartIdleTimer(){const{idleTimeout:t=3e4}=this.opts;!1!==t&&(this.idleTimer||this.subs.size||this.closedByUser||(this.idleTimer=setTimeout(()=>this.socket.close(),t)))}stopIdleTimer(){clearTimeout(this.idleTimer),this.idleTimer=void 0}wake(){this.stopIdleTimer(),!this.closedByUser&&this.socket.closedByUser&&(this.socket=this.createSocket())}close(){var t=this;return U(function*(){t.closedByUser=!0,t.socket.close(),t.stopIdleTimer(),t.socket.readyState!==WebSocket.CLOSED&&(yield new Promise(r=>{t.socket.addEventListener(Xe.close,r,{once:!0})}))})()}[gF](){var t=this;return U(function*(){yield t.close()})()}}class Yre extends vt{constructor(t,r){super()}schedule(t,r=0){return this}}const Hg={setInterval(e,t,...r){const{delegate:i}=Hg;return i?.setInterval?i.setInterval(e,t,...r):setInterval(e,t,...r)},clearInterval(e){const{delegate:t}=Hg;return(t?.clearInterval||clearInterval)(e)},delegate:void 0},mF={now:()=>(mF.delegate||Date).now(),delegate:void 0};class bd{constructor(t,r=bd.now){this.schedulerActionCtor=t,this.now=r}schedule(t,r=0,i){return new this.schedulerActionCtor(this,t).schedule(i,r)}}bd.now=mF.now;const eie=new class Xre extends bd{constructor(t,r=bd.now){super(t,r),this.actions=[],this._active=!1}flush(t){const{actions:r}=this;if(this._active)return void r.push(t);let i;this._active=!0;do{if(i=t.execute(t.state,t.delay))break}while(t=r.shift());if(this._active=!1,i){for(;t=r.shift();)t.unsubscribe();throw i}}}(class Jre extends Yre{constructor(t,r){super(t,r),this.scheduler=t,this.work=r,this.pending=!1}schedule(t,r=0){var i;if(this.closed)return this;this.state=t;const s=this.id,o=this.scheduler;return null!=s&&(this.id=this.recycleAsyncId(o,s,r)),this.pending=!0,this.delay=r,this.id=null!==(i=this.id)&&void 0!==i?i:this.requestAsyncId(o,this.id,r),this}requestAsyncId(t,r,i=0){return Hg.setInterval(t.flush.bind(t,this),i)}recycleAsyncId(t,r,i=0){if(null!=i&&this.delay===i&&!1===this.pending)return r;null!=r&&Hg.clearInterval(r)}execute(t,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const i=this._execute(t,r);if(i)return i;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(t,r){let s,i=!1;try{this.work(t)}catch(o){i=!0,s=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),s}unsubscribe(){if(!this.closed){const{id:t,scheduler:r}=this,{actions:i}=r;this.work=this.state=this.scheduler=null,this.pending=!1,Bd(i,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,super.unsubscribe()}}}),nie=Fd(e=>function(r=null){e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=r});function yF(e,t){const{first:r,each:i,with:s=rie,scheduler:o=t??eie,meta:a=null}=function tie(e){return e instanceof Date&&!isNaN(e)}(e)?{first:e}:"number"==typeof e?{each:e}:e;if(null==r&&null==i)throw new TypeError("No timeout provided.");return zt((c,l)=>{let u,d,f=null,h=0;const p=g=>{d=ti(l,o,()=>{try{u.unsubscribe(),Tr(s({meta:a,lastValue:f,seen:h})).subscribe(l)}catch(m){l.error(m)}},g)};u=c.subscribe(Dt(l,g=>{d?.unsubscribe(),h++,l.next(f=g),i>0&&p(i)},void 0,void 0,()=>{d?.closed||d?.unsubscribe(),f=null})),!h&&p(null!=r?"number"==typeof r?r:+r-o.now():i)})}function rie(e){throw new nie(e)}var zg=new TextDecoder("utf-8"),vF=(new TextEncoder,5e3);function XE(e){let t={},r=e;for(;r.length>0;){let i=r[0],s=r[1],o=r.slice(2,2+s);if(r=r.slice(2+s),o.length{class e extends Zne{constructor(r){super(r)}observe(r,i){var s=this;console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","[[subscribe filter]]",r);const o=new AbortController,a=i?.signal?AbortSignal.any([i.signal,o.signal]):o.signal,c=new Ze,l=new Map;return U(function*(){var f,u=!1,d=!1;try{for(var p,h=Cs(s.req(r,{signal:a}));u=!(p=yield h.next()).done;u=!1){const g=p.value;if("CLOSED"===g[0]){c.error(g);break}if("EVENT"===g[0]){const m=l.size;l.set(g[2].id,g[2]),m!==l.size?c.next(g[2]):(console.debug((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","event deduplicated, not emiting again: ",g[2]),console.debug((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","current nset from request: ",l))}}}catch(g){d=!0,f=g}finally{try{u&&null!=h.return&&(yield h.return())}finally{if(d)throw f}}})(),c.asObservable().pipe(Eu(()=>{console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","[[unsubscribe filter]]",r),o.abort()}))}static \u0275fac=function(i){return new(i||e)(q(wF))};static \u0275prov=j({token:e,factory:e.\u0275fac})}return e})(),nC=(()=>{class e{pubkeySet=new Set;constructor(){this.loadList()}loadList(){try{const r=sessionStorage.getItem("talkToStrangerIgnoreList");if(r){let i=JSON.parse(r);i instanceof Array?this.pubkeySet=new Set(i):sessionStorage.setItem("talkToStrangerIgnoreList","[]")}}catch{sessionStorage.setItem("talkToStrangerIgnoreList","[]")}}saveInList(r){this.pubkeySet.add(r),sessionStorage.setItem("talkToStrangerIgnoreList",JSON.stringify([...this.pubkeySet]))}isInList(r){return this.pubkeySet.has(r)}static \u0275fac=function(i){return new(i||e)};static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),bF=(()=>{class e{npool;talkToStrangerSession;constructor(r,i){this.npool=r,this.talkToStrangerSession=i}listenUserStatusUpdate(r,i){const s=[{kinds:[Zn.UserStatuses],authors:[r]}];return console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","observing filter:",s),this.npool.observe(s,i)}queryChatConfirmation(r,i){const s=[{kinds:[Zn.UserStatuses],"#t":["confirm",...i.searchTags],"#p":[r.pubkey],limit:1}];return console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","quering filter:",s),this.npool.query(s,i)}listenChatConfirmation(r,i){const s=[{kinds:[Zn.UserStatuses],"#t":["confirm",...i.searchTags],"#p":[r.pubkey],limit:1}];return console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","observing filter:",s),this.npool.observe(s,i)}queryChatAvailable(r){var i=this;return U(function*(){const s=Math.floor((new Date).getTime()/1e3),c=[{kinds:[Zn.UserStatuses],"#t":[r.statusName||"wannachat",...r.searchTags],since:s-600}];console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","quering filter: ",c);let l=yield i.npool.query(c,r);l=l.filter(d=>!i.talkToStrangerSession.isInList(d.pubkey));const u=l[Math.floor(Math.random()*l.length)];return u?console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","wanna chat found:",u):console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","wanna chat NOT found..."),Promise.resolve(u||null)})()}static \u0275fac=function(i){return new(i||e)(q(Wg),q(nC))};static \u0275prov=j({token:e,factory:e.\u0275fac})}return e})(),rC=(()=>{class e{wannachatStatusDefaultTimeoutInSeconds=20;static \u0275fac=function(i){return new(i||e)};static \u0275prov=j({token:e,factory:e.\u0275fac})}return e})(),Zg=(()=>{class e{#t;constructor(){this.#t=new NE(gb())}recreateSession(){return this.#t=new NE(gb()),this.getPublicUser()}getPublicKey(){return this.#t.getPublicKey()}getPublicUser(){var r=this;return U(function*(){const i=yield r.#t.getPublicKey();return{pubkey:i,npub:_F(i)}})()}signEvent(r){return this.#t.signEvent(r)}nip04={encrypt:(()=>{var i,r=this;return i=U(function*(s,o){return r.#t.nip04.encrypt(s,o)}),function(o,a){return i.apply(this,arguments)}})(),decrypt:(()=>{var i,r=this;return i=U(function*(s,o){return r.#t.nip04.decrypt(s,o)}),function(o,a){return i.apply(this,arguments)}})()};nip44={encrypt:(()=>{var i,r=this;return i=U(function*(s,o){return r.#t.nip44.encrypt(s,o)}),function(o,a){return i.apply(this,arguments)}})(),decrypt:(()=>{var i,r=this;return i=U(function*(s,o){return r.#t.nip44.decrypt(s,o)}),function(o,a){return i.apply(this,arguments)}})()};static \u0275fac=function(i){return new(i||e)};static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),EF=(()=>{class e{talkToStrangerConfig;talkToStrangerSigner;largeExpirationTime=1800;constructor(r,i){this.talkToStrangerConfig=r,this.talkToStrangerSigner=i}unixTimeNow(){return Math.floor(Date.now()/1e3)}getExpirationTimestamp(r=this.talkToStrangerConfig.wannachatStatusDefaultTimeoutInSeconds){const s=Math.floor(Date.now()/1e3)+r;return String(s)}createEncryptedDirectMessage(r,i){var s=this;return U(function*(){const o=yield s.talkToStrangerSigner.nip04.encrypt(r.pubkey,i),a={kind:Zn.EncryptedDirectMessage,content:o,created_at:s.unixTimeNow(),tags:[["p",r.pubkey],["expiration",s.getExpirationTimestamp(s.largeExpirationTime)]]};return s.talkToStrangerSigner.signEvent(a)})()}createWannaChatUserStatus(r){const i=this.talkToStrangerConfig.wannachatStatusDefaultTimeoutInSeconds+5,s=r.statusName||"wannachat",o=r.userTags.map(a=>["t",a]);return this.createUserStatus(s,[["expiration",this.getExpirationTimestamp(i)],["t",s],...o])}createDisconnectedUserStatus(){return this.createUserStatus("disconnected",[["expiration",this.getExpirationTimestamp()]])}createTypingUserStatus(){return this.createUserStatus("typing",[["expiration",this.getExpirationTimestamp(this.largeExpirationTime)]])}createChatingUserStatus(r,i){const s=i.userTags.map(o=>["t",o]);return this.createUserStatus("confirm",[["expiration",this.getExpirationTimestamp(this.largeExpirationTime)],["p",r.pubkey],["t","confirm"],...s])}deleteUserHistory(){const r={kind:Zn.EventDeletion,tags:[["k",String(Zn.EncryptedDirectMessage)],["k",String(Zn.UserStatuses)],["expiration",this.getExpirationTimestamp()]],created_at:Math.floor((new Date).getTime()/1e3),content:""};return this.talkToStrangerSigner.signEvent(r)}cleanUserStatus(){return this.createUserStatus("",[["expiration",this.getExpirationTimestamp(this.largeExpirationTime)]])}createUserStatus(r,i){var s=this;return U(function*(){const o=[["d","general"],...i||[]];let a={kind:Zn.UserStatuses,content:r,created_at:s.unixTimeNow(),tags:o};return s.talkToStrangerSigner.signEvent(a)})()}static \u0275fac=function(i){return new(i||e)(q(rC),q(Zg))};static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),CF=(()=>{class e{convertPubkeyToPublicKeys(r){return{pubkey:r,npub:_F(r)}}convertNPubToPubkey(r){const{data:i}=function sie(e){let{prefix:t,words:r}=gi.decode(e,vF),i=new Uint8Array(gi.fromWords(r));switch(t){case"nprofile":{let s=XE(i);if(!s[0]?.[0])throw new Error("missing TLV 0 for nprofile");if(32!==s[0][0].length)throw new Error("TLV 0 should be 32 bytes");return{type:"nprofile",data:{pubkey:gt(s[0][0]),relays:s[1]?s[1].map(o=>zg.decode(o)):[]}}}case"nevent":{let s=XE(i);if(!s[0]?.[0])throw new Error("missing TLV 0 for nevent");if(32!==s[0][0].length)throw new Error("TLV 0 should be 32 bytes");if(s[2]&&32!==s[2][0].length)throw new Error("TLV 2 should be 32 bytes");if(s[3]&&4!==s[3][0].length)throw new Error("TLV 3 should be 4 bytes");return{type:"nevent",data:{id:gt(s[0][0]),relays:s[1]?s[1].map(o=>zg.decode(o)):[],author:s[2]?.[0]?gt(s[2][0]):void 0,kind:s[3]?.[0]?parseInt(gt(s[3][0]),16):void 0}}}case"naddr":{let s=XE(i);if(!s[0]?.[0])throw new Error("missing TLV 0 for naddr");if(!s[2]?.[0])throw new Error("missing TLV 2 for naddr");if(32!==s[2][0].length)throw new Error("TLV 2 should be 32 bytes");if(!s[3]?.[0])throw new Error("missing TLV 3 for naddr");if(4!==s[3][0].length)throw new Error("TLV 3 should be 4 bytes");return{type:"naddr",data:{identifier:zg.decode(s[0][0]),pubkey:gt(s[2][0]),kind:parseInt(gt(s[3][0]),16),relays:s[1]?s[1].map(o=>zg.decode(o)):[]}}}case"nsec":return{type:t,data:i};case"npub":case"note":return{type:t,data:gt(i)};default:throw new Error(`unknown prefix ${t}`)}}(r);return i}static \u0275fac=function(i){return new(i||e)};static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),DF=(()=>{class e{nostrEventFactory;findStrangerNostr;talkToStrangerSession;talkToStrangerSigner;nostrConverter;config;npool;constructor(r,i,s,o,a,c,l){this.nostrEventFactory=r,this.findStrangerNostr=i,this.talkToStrangerSession=s,this.talkToStrangerSigner=o,this.nostrConverter=a,this.config=c,this.npool=l}publish(r){return this.npool.event(r)}searchStranger(r){var i=this;return U(function*(){const s=yield i.findStrangerNostr.queryChatAvailable(r);if(s){console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","inviting ",s.pubkey," to chat and listening confirmation");const a=i.listenChatingConfirmation(s,r);yield i.inviteToChating(s,r);const c=yield a;return i.talkToStrangerSession.saveInList(s.pubkey),c?Promise.resolve(i.nostrConverter.convertPubkeyToPublicKeys(s.pubkey)):(yield i.endSession(),i.searchStranger(r))}const o=yield i.talkToStrangerSigner.getPublicUser();return yield i.publishWannaChatStatus(r),new Promise(a=>{const c=i.findStrangerNostr.listenChatConfirmation(o,r).pipe(yF(1e3*i.config.wannachatStatusDefaultTimeoutInSeconds),vs(l=>(c.unsubscribe(),i.deleteUserHistory().then(()=>i.searchStranger(r).then(u=>a(u))),nc(()=>new l)))).subscribe({next:l=>{i.talkToStrangerSession.saveInList(l.pubkey),i.replyChatInvitation(l,r).then(u=>{if(!u)throw new Error("internal error: user not found, please report this with the logs from developer tools (F12)");a(u)}).catch(u=>{throw console.error(u),u}),c.unsubscribe()},error:l=>console.error((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]",l)})})})()}replyChatInvitation(r,i){var s=this;return U(function*(){return console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","event was listen: ",r),console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","it must be a chating invitation from ",r.pubkey,", repling invitation..."),yield s.inviteToChating(r,i),console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","replied... resolving... "),console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","[searchStranger] unsubscribe"),Promise.resolve(s.nostrConverter.convertPubkeyToPublicKeys(r.pubkey))})()}isChatingToPubKey(r,i){console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","is wannachat reply with chating? event: ",r);const s=r.tags.filter(([o])=>"p"===o).find(([,o])=>o===i.pubkey)||[];return console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","is wannachat reply with chating?",s.length?"yes":"no"),!!s.length}inviteToChating(r,i){const s=this.nostrConverter.convertPubkeyToPublicKeys(r.pubkey);return this.publishChatInviteStatus(s,i)}listenChatingConfirmation(r,i){var s=this;return U(function*(){return new Promise(o=>{console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","listening status update from: ",r.pubkey);const a=s.findStrangerNostr.listenUserStatusUpdate(r.pubkey,i).pipe(yF(5e3),vs(c=>nc(()=>new Error("chat confirmation timeout after 5s waiting, there is no stranger connected to this session",{cause:c})))).subscribe({next:c=>s.receiveChatingConfirmation(a,c,r,i).then(l=>{"boolean"==typeof l&&o(l)}),error:c=>{console.error(c),o(!1)}})})})()}receiveChatingConfirmation(r,i,s,o){var a=this;return U(function*(){if(i.id===s.id&&i.content===(o.statusName||"wannachat"))return console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","stranger #wannachat status was listen, ignoring and waiting new status..."),Promise.resolve(void 0);console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]",`stranger #${i.content} status was listen.`),r.unsubscribe(),console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","[listenUserStatusUpdate] unsubscribe"),console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","stranger ",s.pubkey," update status: ",i);const l=yield a.talkToStrangerSigner.getPublicUser();return a.isChatingToPubKey(i,l)?(console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]",'is "confirm" status confirming chating, resolved with true'),Promise.resolve(!0)):(console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","unexpected status was given, resolved with false, event: ",i),Promise.resolve(!1))})()}publishWannaChatStatus(r){var i=this;return U(function*(){const s=yield i.nostrEventFactory.createWannaChatUserStatus(r);return console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","updating my status to: ",s),yield i.npool.event(s),Promise.resolve(s)})()}publishChatInviteStatus(r,i){var s=this;return U(function*(){const o=yield s.nostrEventFactory.createChatingUserStatus(r,i);return console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","updating my status to: ",o),yield s.npool.event(o),Promise.resolve(o)})()}deleteUserHistory(){var r=this;return U(function*(){const i=yield r.nostrEventFactory.deleteUserHistory();console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","deleting user history"),yield r.npool.event(i)})()}createSession(){var r=this;return U(function*(){const i=yield r.talkToStrangerSigner.recreateSession();return r.talkToStrangerSession.saveInList(i.pubkey),console.info((new Date).toLocaleString(),"me: ",i.pubkey),i})()}endSession(){var r=this;return U(function*(){const i=yield r.nostrEventFactory.createDisconnectedUserStatus();return console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","updating my status to: ",i),yield r.deleteUserHistory(),yield r.npool.event(i),Promise.resolve(i)})()}static \u0275fac=function(i){return new(i||e)(q(EF),q(bF),q(nC),q(Zg),q(CF),q(rC),q(Wg))};static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),SF=(()=>{class e{nostrEventFactory;talkToStrangerSigner;npool;updateUserCountTimeout=3e5;constructor(r,i,s){this.nostrEventFactory=r,this.talkToStrangerSigner=i,this.npool=s}openEncryptedDirectMessage(r,i){var s=this;return U(function*(){return s.talkToStrangerSigner.nip04.decrypt(r.pubkey,i.content)})()}listenMessages(r){const i=new Ze;return this.talkToStrangerSigner.getPublicKey().then(s=>{this.npool.observe([{kinds:[Zn.EncryptedDirectMessage],authors:[r.pubkey],"#p":[s]}]).subscribe({next:o=>i.next(o),error:o=>i.error(o),complete:()=>i.complete()})}),i.asObservable()}listenStrangerStatus(r){return this.npool.observe([{kinds:[Zn.UserStatuses],authors:[r.pubkey]}])}listenCurrenOnlineUsers(){const r=new Ze;let i=!1;const s=()=>{i||(i=!0,console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","user count requested"),this.npool.query([{kinds:[Zn.UserStatuses],"#t":["omegle"],since:Math.floor(Date.now()/1e3)-86400}]).then(a=>{const c=new Set;console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","count events",a),a.forEach(u=>c.add(u.pubkey));const l=[...c].length;console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","active users counted: ",l),r.next(l),i=!1}).catch(a=>{console.error((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","user count lauched error",a),i=!1,clearInterval(o)}))},o=setInterval(s,this.updateUserCountTimeout);return s(),r.asObservable().pipe(Eu(()=>clearInterval(o)))}sendMessage(r,i){var s=this;return U(function*(){yield s.stopTyping();const o=yield s.nostrEventFactory.createEncryptedDirectMessage(r,i);return s.npool.event(o)})()}isTyping(){var r=this;return U(function*(){const i=yield r.nostrEventFactory.createTypingUserStatus();return r.npool.event(i)})()}stopTyping(){var r=this;return U(function*(){const i=yield r.nostrEventFactory.cleanUserStatus();return r.npool.event(i)})()}static \u0275fac=function(i){return new(i||e)(q(EF),q(Zg),q(Wg))};static \u0275prov=j({token:e,factory:e.\u0275fac})}return e})(),oie=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275mod=Ot({type:e});static \u0275inj=St({providers:[CF,Wg],imports:[gs]})}return e})(),TF=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275mod=Ot({type:e});static \u0275inj=St({providers:[bF,DF,nC,SF,Zg,rC],imports:[gs,oie]})}return e})(),IF=(()=>{class e{notify(){new Audio("./assets/sound-notification.wav").play()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),aie=(()=>{class e{constructor(){this.authorTypes={[Bi.STRANGER]:"Stranger",[Bi.YOU]:"You"}}transform(r){return this.authorTypes[r]}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275pipe=fn({name:"author",type:e,pure:!0})}}return e})();const cie=["conversation"];function lie(e,t){1&e&&(fe(0,"div",22),Le(1," You're now chatting with a random stranger. "),me())}function uie(e,t){1&e&&(fe(0,"div",22),Le(1," Looking for someone you can chat with. "),me())}function die(e,t){if(1&e&&(fe(0,"span",26),yf(),fe(1,"svg",27),or(2,"path",7)(3,"path",28),me(),vf(),fe(4,"span",29),Le(5),me()()),2&e){const r=Ct().$implicit;be(5),Qa(r[1])}}function fie(e,t){if(1&e&&(fe(0,"div",23)(1,"span"),Le(2),function qA(e,t){const r=we();let i;const s=e+Y;r.firstCreatePass?(i=function dH(e,t){if(t)for(let r=t.length-1;r>=0;r--){const i=t[r];if(e===i.name)return i}}(t,r.pipeRegistry),r.data[s]=i,i.onDestroy&&(r.destroyHooks??=[]).push(s,i.onDestroy)):i=r.data[s];const o=i.factory||(i.factory=Ks(i.type)),c=Sn(k);try{const l=Ef(!1),u=o();return Ef(l),function E0(e,t,r,i){r>=e.data.length&&(e.data[r]=null,e.blueprint[r]=null),t[r]=i}(r,N(),s,u),u}finally{Sn(c)}}(3,"author"),me(),fe(4,"span",24),Le(5),me(),sr(6,die,6,1,"span",25),me()),2&e){const r=t.$implicit,i=Ct();be(),Ql("authorStranger",r[0].author===i.authorStranger)("authorYou",r[0].author===i.authorYou),be(),Xr("",GA(3,7,r[0].author),": "),be(3),Qa(r[0].text),be(),qe("ngIf",r[1])}}function hie(e,t){1&e&&(fe(0,"div",22),Le(1," Stranger is typing... "),me())}function pie(e,t){1&e&&(fe(0,"div",22),Le(1,"Stranger has disconnected."),me())}function gie(e,t){1&e&&(fe(0,"div",22),Le(1,"You have disconnected."),me())}function mie(e,t){if(1&e&&(Ga(0),sr(1,pie,2,0,"div",13)(2,gie,2,0,"div",13),Wa()),2&e){const r=Ct();be(),qe("ngIf",r.whoDisconnected===r.authorStranger),be(),qe("ngIf",r.whoDisconnected===r.authorYou)}}function yie(e,t){if(1&e){const r=Jr();fe(0,"button",30),$e("click",function(){return Kt(r),Qt(Ct().findStranger())}),Le(1," Start "),me()}}function vie(e,t){if(1&e){const r=Jr();fe(0,"button",31),$e("click",function(){return Kt(r),Qt(Ct().stopSearching())}),Le(1," Stop "),me()}}function _ie(e,t){if(1&e){const r=Jr();fe(0,"button",31),$e("click",function(){Kt(r);const s=Ct();return Qt(s.currentState=s.stateUpToDisconnect)}),Le(1," Stop "),me()}}function wie(e,t){if(1&e){const r=Jr();fe(0,"button",32),$e("click",function(){Kt(r);const s=Ct(),o=Ka(24);return s.endSession(),Qt(s.cleanMessageField(o))}),Le(1," Really? "),me()}}const bie=[{path:"chat",component:(()=>{class e{constructor(r,i,s,o,a){this.globalErrorHandler=r,this.findStrangerProxy=i,this.talkToStrangerNostr=s,this.soundNotificationService=o,this.modalService=a,this.stateConnected=ci.CONNECTED,this.stateUpToDisconnect=ci.UP_TO_DISCONNECT,this.stateDisconnected=ci.DISCONNECTED,this.stateSearchingStranger=ci.SEARCHING_STRANGER,this.authorStranger=Bi.STRANGER,this.authorYou=Bi.YOU,this.typingTimeoutAmount=2e3,this.typingTimeoutId=0,this.currentOnline=1,this.strangerIsTyping=!1,this.currentState=ci.DISCONNECTED,this.whoDisconnected=null,this.stranger=null,this.messages=[],this.controller=new AbortController,this.subscriptions=new vt}ngOnInit(){this.countStrangers()}countStrangers(){this.subscriptions.add(this.talkToStrangerNostr.listenCurrenOnlineUsers().subscribe(r=>this.currentOnline=r||1))}ngOnDestroy(){this.subscriptions.unsubscribe()}onBeforeUnload(){var r=this;return U(function*(){return yield r.endSession(),!0})()}configRelays(){this.modalService.createModal(MQ).build()}findStranger(){this.whoDisconnected=null,this.currentState=this.stateSearchingStranger,this.messages=[],this.findStrangerProxy.createSession(),this.findStrangerProxy.searchStranger({signal:this.controller.signal,searchTags:["omegle"],userTags:["omegle"]}).then(r=>this.startConversation(r)).catch(r=>{throw console.error((new Date).toLocaleString(),r),this.currentState=ci.DISCONNECTED,this.strangerIsTyping=!1,this.whoDisconnected=null,this.stranger=null,r})}endSession(){return this.subscriptions.unsubscribe(),this.subscriptions=new vt,this.stranger=null,this.findStrangerProxy.endSession().then(()=>(this.currentState=ci.DISCONNECTED,this.strangerIsTyping=!1,this.whoDisconnected||(this.whoDisconnected=Bi.YOU),Promise.resolve()))}startConversation(r){console.log((new Date).toLocaleString(),"starting conversation, stranger: ",r),this.stranger=r,this.currentState=ci.CONNECTED,1===this.currentOnline&&(this.currentOnline=2),this.soundNotificationService.notify(),this.subscriptions.add(this.talkToStrangerNostr.listenMessages(r).subscribe({next:i=>this.addMessageFromStranger(r,i)})),this.subscriptions.add(this.talkToStrangerNostr.listenStrangerStatus(r).subscribe({next:i=>this.handleStrangerStatus(i)}))}addMessageFromStranger(r,i){this.talkToStrangerNostr.openEncryptedDirectMessage(r,i).then(s=>{this.messages.push([{text:s,author:Bi.STRANGER,time:i.created_at},null]),this.scrollConversationToTheEnd()})}handleStrangerStatus(r){"typing"===r.content?(this.strangerIsTyping=!0,this.scrollConversationToTheEnd()):"disconnected"===r.content?(this.strangerIsTyping=!1,this.whoDisconnected=Bi.STRANGER,this.currentState=ci.DISCONNECTED,this.endSession()):this.strangerIsTyping=!1}sendMessage(r){var i=this;return U(function*(){const s=i.stranger;if(s&&r.length){const o=[{author:Bi.YOU,text:r,time:Math.floor((new Date).getTime()/1e3)},null];i.messages.push(o),i.scrollConversationToTheEnd();try{yield i.talkToStrangerNostr.sendMessage(s,r)}catch(a){o[1]=i.globalErrorHandler.getErrorMessage(a).join("; ")}}})()}scrollConversationToTheEnd(){setTimeout(()=>{const r=this.conversationEl.nativeElement;r.scrollTo({top:r.scrollHeight,behavior:"smooth"})})}cleanMessageField(r){setTimeout(()=>r.value="")}stopSearching(){this.controller.abort(),this.endSession()}onTyping(){this.typingTimeoutId||this.talkToStrangerNostr.isTyping(),clearTimeout(this.typingTimeoutId),this.typingTimeoutId=Number(setTimeout(()=>{this.talkToStrangerNostr.stopTyping(),this.typingTimeoutId=0},this.typingTimeoutAmount))}static{this.\u0275fac=function(i){return new(i||e)(k(Sw),k(DF),k(SF),k(IF),k(NO))}}static{this.\u0275cmp=ns({type:e,selectors:[["omg-chat"]],viewQuery:function(i,s){if(1&i&&b0(cie,5),2&i){let o;Dh(o=Sh())&&(s.conversationEl=o.first)}},hostBindings:function(i,s){1&i&&$e("beforeunload",function(){return s.onBeforeUnload()},0,PT)},decls:28,vars:12,consts:[["conversation",""],["messageField",""],["send",""],[1,"navbar"],["src","./assets/logo.png","alt","logo",1,"logo"],[1,"description"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"config",3,"click"],["stroke","none","d","M0 0h24v24H0z","fill","none"],["d","M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z"],["d","M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0"],[1,"online"],[1,"main"],[1,"conversation"],["class","message",4,"ngIf"],["class","chat",4,"ngFor","ngForOf"],[4,"ngIf"],["novalidate","","autocomplete","off",1,"form"],["type","button","class","btn start bottomLeftRadius",3,"click",4,"ngIf"],["type","button","class","btn bottomLeftRadius",3,"click",4,"ngIf"],["type","button","class","btn bottomLeftRadius bold",3,"click",4,"ngIf"],["name","text",1,"textarea",3,"keydown.enter","keydown"],["type","button",1,"btn","bottomRightRadius",3,"click"],[1,"message"],[1,"chat"],[1,"text"],["class","errorWrap",4,"ngIf"],[1,"errorWrap"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","currentColor",1,"messageNotSent"],["d","M17 3.34a10 10 0 1 1 -15 8.66l.005 -.324a10 10 0 0 1 14.995 -8.336m-5 11.66a1 1 0 0 0 -1 1v.01a1 1 0 0 0 2 0v-.01a1 1 0 0 0 -1 -1m0 -7a1 1 0 0 0 -1 1v4a1 1 0 0 0 2 0v-4a1 1 0 0 0 -1 -1"],[1,"errorMessage"],["type","button",1,"btn","start","bottomLeftRadius",3,"click"],["type","button",1,"btn","bottomLeftRadius",3,"click"],["type","button",1,"btn","bottomLeftRadius","bold",3,"click"]],template:function(i,s){if(1&i){const o=Jr();fe(0,"section",3),or(1,"img",4),fe(2,"h2",5),Le(3,"Talk to strangers!"),me(),yf(),fe(4,"svg",6),$e("click",function(){return Kt(o),Qt(s.configRelays())}),or(5,"path",7)(6,"path",8)(7,"path",9),me(),vf(),fe(8,"h2",10),Le(9),me()(),fe(10,"main",11)(11,"section",12,0),sr(13,lie,2,0,"div",13)(14,uie,2,0,"div",13)(15,fie,7,9,"div",14)(16,hie,2,0,"div",13)(17,mie,3,2,"ng-container",15),me(),fe(18,"form",16),sr(19,yie,2,0,"button",17)(20,vie,2,0,"button",18)(21,_ie,2,0,"button",18)(22,wie,2,0,"button",19),fe(23,"textarea",20,1),$e("keydown.enter",function(){Kt(o);const c=Ka(24);return s.sendMessage(c.value),Qt(s.cleanMessageField(c))})("keydown",function(){return Kt(o),Qt(s.onTyping())}),me(),fe(25,"button",21,2),$e("click",function(){Kt(o);const c=Ka(24);return s.sendMessage(c.value),Qt(s.cleanMessageField(c))}),Le(27," Send "),me()()()}2&i&&(be(9),Qa(s.currentOnline),be(4),qe("ngIf",s.stranger),be(),qe("ngIf",!s.stranger&&s.currentState===s.stateSearchingStranger),be(),qe("ngForOf",s.messages),be(),qe("ngIf",s.strangerIsTyping),be(),qe("ngIf",s.currentState===s.stateDisconnected),be(2),qe("ngIf",s.currentState===s.stateDisconnected),be(),qe("ngIf",s.currentState===s.stateSearchingStranger),be(),qe("ngIf",s.currentState===s.stateConnected),be(),qe("ngIf",s.currentState===s.stateUpToDisconnect),be(),on("disabled",s.currentState===s.stateDisconnected||s.currentState===s.stateSearchingStranger?"disabled":null),be(2),on("disabled",s.currentState===s.stateDisconnected||s.currentState===s.stateSearchingStranger?"disabled":null))},dependencies:[s_,rp,aie],encapsulation:2})}}return e})()},{path:"",redirectTo:"chat",pathMatch:"full"}];let Eie=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({imports:[xO.forRoot(bie,{useHash:!0}),xO]})}}return e})();var le=function(e){return e[e.State=0]="State",e[e.Transition=1]="Transition",e[e.Sequence=2]="Sequence",e[e.Group=3]="Group",e[e.Animate=4]="Animate",e[e.Keyframes=5]="Keyframes",e[e.Style=6]="Style",e[e.Trigger=7]="Trigger",e[e.Reference=8]="Reference",e[e.AnimateChild=9]="AnimateChild",e[e.AnimateRef=10]="AnimateRef",e[e.Query=11]="Query",e[e.Stagger=12]="Stagger",e}(le||{});const Yi="*";function Cie(e,t){return{type:le.Trigger,name:e,definitions:t,options:{}}}function xF(e,t=null){return{type:le.Animate,styles:t,timings:e}}function Ed(e){return{type:le.Style,styles:e,offset:null}}function iC(e,t,r){return{type:le.State,name:e,styles:t,options:r}}function AF(e,t,r=null){return{type:le.Transition,expr:e,animation:t,options:r}}class Cd{constructor(t=0,r=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._originalOnDoneFns=[],this._originalOnStartFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=t+r}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}onStart(t){this._originalOnStartFns.push(t),this._onStartFns.push(t)}onDone(t){this._originalOnDoneFns.push(t),this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(t){this._position=this.totalTime?t*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(t){const r="start"==t?this._onStartFns:this._onDoneFns;r.forEach(i=>i()),r.length=0}}class MF{constructor(t){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=t;let r=0,i=0,s=0;const o=this.players.length;0==o?queueMicrotask(()=>this._onFinish()):this.players.forEach(a=>{a.onDone(()=>{++r==o&&this._onFinish()}),a.onDestroy(()=>{++i==o&&this._onDestroy()}),a.onStart(()=>{++s==o&&this._onStart()})}),this.totalTime=this.players.reduce((a,c)=>Math.max(a,c.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this.players.forEach(t=>t.init())}onStart(t){this._onStartFns.push(t)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(t=>t()),this._onStartFns=[])}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(t=>t.play())}pause(){this.players.forEach(t=>t.pause())}restart(){this.players.forEach(t=>t.restart())}finish(){this._onFinish(),this.players.forEach(t=>t.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(t=>t.destroy()),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this.players.forEach(t=>t.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(t){const r=t*this.totalTime;this.players.forEach(i=>{const s=i.totalTime?Math.min(1,r/i.totalTime):1;i.setPosition(s)})}getPosition(){const t=this.players.reduce((r,i)=>null===r||i.totalTime>r.totalTime?i:r,null);return null!=t?t.getPosition():0}beforeDestroy(){this.players.forEach(t=>{t.beforeDestroy&&t.beforeDestroy()})}triggerCallback(t){const r="start"==t?this._onStartFns:this._onDoneFns;r.forEach(i=>i()),r.length=0}}const NF=["toast-component",""];function Aie(e,t){if(1&e){const r=Jr();fe(0,"button",5),$e("click",function(){return Kt(r),Qt(Ct().remove())}),fe(1,"span",6),Le(2,"\xd7"),me()()}}function Mie(e,t){if(1&e&&(Ga(0),Le(1),Wa()),2&e){const r=Ct(2);be(),Xr("[",r.duplicatesCount+1,"]")}}function Nie(e,t){if(1&e&&(fe(0,"div"),Le(1),sr(2,Mie,2,1,"ng-container",4),me()),2&e){const r=Ct();Ri(r.options.titleClass),on("aria-label",r.title),be(),Xr(" ",r.title," "),be(),qe("ngIf",r.duplicatesCount)}}function Rie(e,t){if(1&e&&or(0,"div",7),2&e){const r=Ct();Ri(r.options.messageClass),qe("innerHTML",r.message,Yy)}}function Oie(e,t){if(1&e&&(fe(0,"div",8),Le(1),me()),2&e){const r=Ct();Ri(r.options.messageClass),on("aria-label",r.message),be(),Xr(" ",r.message," ")}}function kie(e,t){if(1&e&&(fe(0,"div"),or(1,"div",9),me()),2&e){const r=Ct();be(),vo("width",r.width()+"%")}}class jie{_attachedHost;component;viewContainerRef;injector;constructor(t,r){this.component=t,this.injector=r}attach(t,r){return this._attachedHost=t,t.attach(this,r)}detach(){const t=this._attachedHost;if(t)return this._attachedHost=void 0,t.detach()}get isAttached(){return null!=this._attachedHost}setAttachedHost(t){this._attachedHost=t}}class $ie{_attachedPortal;_disposeFn;attach(t,r){return this._attachedPortal=t,this.attachComponentPortal(t,r)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(t){this._disposeFn=t}}class Hie{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new Ze;_activate=new Ze;_manualClose=new Ze;_resetTimeout=new Ze;_countDuplicate=new Ze;constructor(t){this._overlayRef=t}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(t,r){t&&this._resetTimeout.next(),r&&this._countDuplicate.next(++this.duplicatesCount)}}class Kg{toastId;config;message;title;toastType;toastRef;_onTap=new Ze;_onAction=new Ze;constructor(t,r,i,s,o,a){this.toastId=t,this.config=r,this.message=i,this.title=s,this.toastType=o,this.toastRef=a,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(t){this._onAction.next(t)}onAction(){return this._onAction.asObservable()}}const OF=new z("ToastConfig");class zie extends $ie{_hostDomElement;_componentFactoryResolver;_appRef;constructor(t,r,i){super(),this._hostDomElement=t,this._componentFactoryResolver=r,this._appRef=i}attachComponentPortal(t,r){const i=this._componentFactoryResolver.resolveComponentFactory(t.component);let s;return s=i.create(t.injector),this._appRef.attachView(s.hostView),this.setDisposeFn(()=>{this._appRef.detachView(s.hostView),s.destroy()}),r?this._hostDomElement.insertBefore(this._getComponentRootNode(s),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(s)),s}_getComponentRootNode(t){return t.hostView.rootNodes[0]}}let qie=(()=>{class e{_document=O(an);_containerElement;ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){const r=this._document.createElement("div");r.classList.add("overlay-container"),r.setAttribute("aria-live","polite"),this._document.body.appendChild(r),this._containerElement=r}static \u0275fac=function(i){return new(i||e)};static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();class Gie{_portalHost;constructor(t){this._portalHost=t}attach(t,r=!0){return this._portalHost.attach(t,r)}detach(){return this._portalHost.detach()}}let Wie=(()=>{class e{_overlayContainer=O(qie);_componentFactoryResolver=O(Vl);_appRef=O(ar);_document=O(an);_paneElements=new Map;create(r,i){return this._createOverlayRef(this.getPaneElement(r,i))}getPaneElement(r="",i){return this._paneElements.get(i)||this._paneElements.set(i,{}),this._paneElements.get(i)[r]||(this._paneElements.get(i)[r]=this._createPaneElement(r,i)),this._paneElements.get(i)[r]}_createPaneElement(r,i){const s=this._document.createElement("div");return s.id="toast-container",s.classList.add(r),s.classList.add("toast-container"),i?i.getContainerElement().appendChild(s):this._overlayContainer.getContainerElement().appendChild(s),s}_createPortalHost(r){return new zie(r,this._componentFactoryResolver,this._appRef)}_createOverlayRef(r){return new Gie(this._createPortalHost(r))}static \u0275fac=function(i){return new(i||e)};static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),oC=(()=>{class e{overlay;_injector;sanitizer;ngZone;toastrConfig;currentlyActive=0;toasts=[];overlayContainer;previousToastMessage;index=0;constructor(r,i,s,o,a){this.overlay=i,this._injector=s,this.sanitizer=o,this.ngZone=a,this.toastrConfig={...r.default,...r.config},r.config.iconClasses&&(this.toastrConfig.iconClasses={...r.default.iconClasses,...r.config.iconClasses})}show(r,i,s={},o=""){return this._preBuildNotification(o,r,i,this.applyConfig(s))}success(r,i,s={}){return this._preBuildNotification(this.toastrConfig.iconClasses.success||"",r,i,this.applyConfig(s))}error(r,i,s={}){return this._preBuildNotification(this.toastrConfig.iconClasses.error||"",r,i,this.applyConfig(s))}info(r,i,s={}){return this._preBuildNotification(this.toastrConfig.iconClasses.info||"",r,i,this.applyConfig(s))}warning(r,i,s={}){return this._preBuildNotification(this.toastrConfig.iconClasses.warning||"",r,i,this.applyConfig(s))}clear(r){for(const i of this.toasts)if(void 0!==r){if(i.toastId===r)return void i.toastRef.manualClose()}else i.toastRef.manualClose()}remove(r){const i=this._findToast(r);if(!i||(i.activeToast.toastRef.close(),this.toasts.splice(i.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length))return!1;if(this.currentlyActivethis._buildNotification(r,i,s,o)):this._buildNotification(r,i,s,o)}_buildNotification(r,i,s,o){if(!o.toastComponent)throw new Error("toastComponent required");const a=this.findDuplicate(s,i,this.toastrConfig.resetTimeoutOnDuplicate&&o.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&s||i)&&this.toastrConfig.preventDuplicates&&null!==a)return a;this.previousToastMessage=i;let c=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(c=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));const l=this.overlay.create(o.positionClass,this.overlayContainer);this.index=this.index+1;let u=i;i&&o.enableHtml&&(u=this.sanitizer.sanitize($n.HTML,i));const d=new Hie(l),f=new Kg(this.index,o,u,s,r,d),p=xt.create({providers:[{provide:Kg,useValue:f}],parent:this._injector}),g=new jie(o.toastComponent,p),m=l.attach(g,o.newestOnTop);d.componentInstance=m.instance;const y={toastId:this.index,title:s||"",message:i||"",toastRef:d,onShown:d.afterActivate(),onHidden:d.afterClosed(),onTap:f.onTap(),onAction:f.onAction(),portal:m};return c||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{y.toastRef.activate()})),this.toasts.push(y),y}static \u0275fac=function(i){return new(i||e)(q(OF),q(Wie),q(xt),q(tR),q(Ne))};static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const Zie={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing",toastComponent:(()=>{class e{toastrService;toastPackage;ngZone;message;title;options;duplicatesCount;originalTimeout;width=Zr(-1);toastClasses="";state;get _state(){return this.state()}get displayStyle(){if("inactive"===this.state().value)return"none"}timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(r,i,s){this.toastrService=r,this.toastPackage=i,this.ngZone=s,this.message=i.message,this.title=i.title,this.options=i.config,this.originalTimeout=i.config.timeOut,this.toastClasses=`${i.toastType} ${i.config.toastClass}`,this.sub=i.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=i.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=i.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=i.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o}),this.state=Zr({value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.update(r=>({...r,value:"active"})),!0!==this.options.disableTimeOut&&"timeOut"!==this.options.disableTimeOut&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=(new Date).getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(0===this.width()||100===this.width()||!this.options.timeOut)return;const r=(new Date).getTime();this.width.set((this.hideTime-r)/this.options.timeOut*100),"increasing"===this.options.progressAnimation&&this.width.update(s=>100-s),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.update(r=>({...r,value:"active"})),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){"removed"!==this.state().value&&(clearTimeout(this.timeout),this.state.update(r=>({...r,value:"removed"})),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){"removed"!==this.state().value&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){"removed"!==this.state().value&&"extendedTimeOut"!==this.options.disableTimeOut&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){!0===this.options.disableTimeOut||"extendedTimeOut"===this.options.disableTimeOut||0===this.options.extendedTimeOut||"removed"===this.state().value||(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(r,i){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(r),i)):this.timeout=setTimeout(()=>r(),i)}outsideInterval(r,i){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(r),i)):this.intervalId=setInterval(()=>r(),i)}runInsideAngular(r){this.ngZone?this.ngZone.run(()=>r()):r()}static \u0275fac=function(i){return new(i||e)(k(oC),k(Kg),k(Ne))};static \u0275cmp=ns({type:e,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(i,s){1&i&&$e("click",function(){return s.tapToast()})("mouseenter",function(){return s.stickAround()})("mouseleave",function(){return s.delayedHideToast()}),2&i&&(m0("@flyInOut",s._state),Ri(s.toastClasses),vo("display",s.displayStyle))},standalone:!0,features:[Th],attrs:NF,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(i,s){1&i&&sr(0,Aie,3,0,"button",0)(1,Nie,3,5,"div",1)(2,Rie,1,3,"div",2)(3,Oie,2,4,"div",3)(4,kie,2,2,"div",4),2&i&&(qe("ngIf",s.options.closeButton),be(),qe("ngIf",s.title),be(),qe("ngIf",s.message&&s.options.enableHtml),be(),qe("ngIf",s.message&&!s.options.enableHtml),be(),qe("ngIf",s.options.progressBar))},dependencies:[rp],encapsulation:2,data:{animation:[Cie("flyInOut",[iC("inactive",Ed({opacity:0})),iC("active",Ed({opacity:1})),iC("removed",Ed({opacity:0})),AF("inactive => active",xF("{{ easeTime }}ms {{ easing }}")),AF("active => removed",xF("{{ easeTime }}ms {{ easing }}"))])]},changeDetection:0})}return e})()},Kie=(e={})=>function tl(e){return{\u0275providers:e}}([{provide:OF,useValue:{default:Zie,config:e}}]);let Qie=(()=>{class e{static forRoot(r={}){return{ngModule:e,providers:[Kie(r)]}}static \u0275fac=function(i){return new(i||e)};static \u0275mod=Ot({type:e});static \u0275inj=St({})}return e})(),Yie=(()=>{class e{constructor(r,i){this.error$=r,this.toastrService=i,this.subscriptions=new vt}ngOnInit(){this.subscriptions.add(this.error$.subscribe(r=>this.toastrService.error(r)))}ngOnDestroy(){this.subscriptions.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)(k(Dw),k(oC))}}static{this.\u0275cmp=ns({type:e,selectors:[["app-root"]],decls:2,vars:0,template:function(i,s){1&i&&or(0,"modal-outlet")(1,"router-outlet")},dependencies:[H_,DK],encapsulation:2})}}return e})(),Jie=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({providers:[tw],imports:[gs,xQ]})}}return e})(),Xie=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({providers:[IF],imports:[gs]})}}return e})(),ese=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({imports:[gs,Xie,Jie]})}}return e})(),tse=(()=>{class e{constructor(r){this.relayConfigService=r}open(r){return new Qre(r)}reqRouter(r){var i=this;return U(function*(){const s=[];return i.relayConfigService.getConfig().forEach(o=>s.push([o,r])),new Map(s)})()}eventRouter(){var r=this;return U(function*(){return r.relayConfigService.getConfig()})()}static{this.\u0275fac=function(i){return new(i||e)(q(tw))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})(),nse=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({providers:[{provide:wF,useClass:tse}],imports:[gs,TF,TF]})}}return e})();function kF(e){return new A(3e3,!1)}function qs(e){switch(e.length){case 0:return new Cd;case 1:return e[0];default:return new MF(e)}}function PF(e,t,r=new Map,i=new Map){const s=[],o=[];let a=-1,c=null;if(t.forEach(l=>{const u=l.get("offset"),d=u==a,f=d&&c||new Map;l.forEach((h,p)=>{let g=p,m=h;if("offset"!==p)switch(g=e.normalizePropertyName(g,s),m){case"!":m=r.get(p);break;case Yi:m=i.get(p);break;default:m=e.normalizeStyleValue(p,g,m,s)}f.set(g,m)}),d||o.push(f),c=f,a=u}),s.length)throw function Sse(){return new A(3502,!1)}();return o}function aC(e,t,r,i){switch(t){case"start":e.onStart(()=>i(r&&cC(r,"start",e)));break;case"done":e.onDone(()=>i(r&&cC(r,"done",e)));break;case"destroy":e.onDestroy(()=>i(r&&cC(r,"destroy",e)))}}function cC(e,t,r){const o=lC(e.element,e.triggerName,e.fromState,e.toState,t||e.phaseName,r.totalTime??e.totalTime,!!r.disabled),a=e._data;return null!=a&&(o._data=a),o}function lC(e,t,r,i,s="",o=0,a){return{element:e,triggerName:t,fromState:r,toState:i,phaseName:s,totalTime:o,disabled:!!a}}function Qn(e,t,r){let i=e.get(t);return i||e.set(t,i=r),i}function LF(e){const t=e.indexOf(":");return[e.substring(1,t),e.slice(t+1)]}const Fse=typeof document>"u"?null:document.documentElement;function uC(e){const t=e.parentNode||e.host||null;return t===Fse?null:t}let Go=null,FF=!1;function BF(e,t){for(;t;){if(t===e)return!0;t=uC(t)}return!1}function VF(e,t,r){if(r)return Array.from(e.querySelectorAll(t));const i=e.querySelector(t);return i?[i]:[]}let dC=(()=>{class e{validateStyleProperty(r){return function Vse(e){Go||(Go=function Use(){return typeof document<"u"?document.body:null}()||{},FF=!!Go.style&&"WebkitAppearance"in Go.style);let t=!0;return Go.style&&!function Bse(e){return"ebkit"==e.substring(1,6)}(e)&&(t=e in Go.style,!t&&FF&&(t="Webkit"+e.charAt(0).toUpperCase()+e.slice(1)in Go.style)),t}(r)}containsElement(r,i){return BF(r,i)}getParentElement(r){return uC(r)}query(r,i,s){return VF(r,i,s)}computeStyle(r,i,s){return s||""}animate(r,i,s,o,a,c=[],l){return new Cd(s,o)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})();class fC{static{this.NOOP=new dC}}class hC{}const $se=1e3,pC="ng-enter",Qg="ng-leave",Yg="ng-trigger",Jg=".ng-trigger",jF="ng-animating",gC=".ng-animating";function Ji(e){if("number"==typeof e)return e;const t=e.match(/^(-?[\.\d]+)(m?s)/);return!t||t.length<2?0:mC(parseFloat(t[1]),t[2])}function mC(e,t){return"s"===t?e*$se:e}function Xg(e,t,r){return e.hasOwnProperty("duration")?e:function zse(e,t,r){let s,o=0,a="";if("string"==typeof e){const c=e.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===c)return t.push(kF()),{duration:0,delay:0,easing:""};s=mC(parseFloat(c[1]),c[2]);const l=c[3];null!=l&&(o=mC(parseFloat(l),c[4]));const u=c[5];u&&(a=u)}else s=e;if(!r){let c=!1,l=t.length;s<0&&(t.push(function rse(){return new A(3100,!1)}()),c=!0),o<0&&(t.push(function ise(){return new A(3101,!1)}()),c=!0),c&&t.splice(l,0,kF())}return{duration:s,delay:o,easing:a}}(e,t,r)}function wi(e,t,r){t.forEach((i,s)=>{const o=vC(s);r&&!r.has(s)&&r.set(s,e.style[o]),e.style[o]=i})}function Wo(e,t){t.forEach((r,i)=>{const s=vC(i);e.style[s]=""})}function Dd(e){return Array.isArray(e)?1==e.length?e[0]:function Die(e,t=null){return{type:le.Sequence,steps:e,options:t}}(e):e}const yC=new RegExp("{{\\s*(.+?)\\s*}}","g");function HF(e){let t=[];if("string"==typeof e){let r;for(;r=yC.exec(e);)t.push(r[1]);yC.lastIndex=0}return t}function Sd(e,t,r){const i=`${e}`,s=i.replace(yC,(o,a)=>{let c=t[a];return null==c&&(r.push(function ose(){return new A(3003,!1)}()),c=""),c.toString()});return s==i?e:s}const Wse=/-+([a-z0-9])/g;function vC(e){return e.replace(Wse,(...t)=>t[1].toUpperCase())}function Yn(e,t,r){switch(t.type){case le.Trigger:return e.visitTrigger(t,r);case le.State:return e.visitState(t,r);case le.Transition:return e.visitTransition(t,r);case le.Sequence:return e.visitSequence(t,r);case le.Group:return e.visitGroup(t,r);case le.Animate:return e.visitAnimate(t,r);case le.Keyframes:return e.visitKeyframes(t,r);case le.Style:return e.visitStyle(t,r);case le.Reference:return e.visitReference(t,r);case le.AnimateChild:return e.visitAnimateChild(t,r);case le.AnimateRef:return e.visitAnimateRef(t,r);case le.Query:return e.visitQuery(t,r);case le.Stagger:return e.visitStagger(t,r);default:throw function ase(){return new A(3004,!1)}()}}function _C(e,t){return window.getComputedStyle(e)[t]}const Qse=new Set(["width","height","minWidth","minHeight","maxWidth","maxHeight","left","top","bottom","right","fontSize","outlineWidth","outlineOffset","paddingTop","paddingLeft","paddingBottom","paddingRight","marginTop","marginLeft","marginBottom","marginRight","borderRadius","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","textIndent","perspective"]);class zF extends hC{normalizePropertyName(t,r){return vC(t)}normalizeStyleValue(t,r,i,s){let o="";const a=i.toString().trim();if(Qse.has(r)&&0!==i&&"0"!==i)if("number"==typeof i)o="px";else{const c=i.match(/^[+-]?[\d\.]+([a-z]*)$/);c&&0==c[1].length&&s.push(function cse(){return new A(3005,!1)}())}return a+o}}const em="*";const tm=new Set(["true","1"]),nm=new Set(["false","0"]);function qF(e,t){const r=tm.has(e)||nm.has(e),i=tm.has(t)||nm.has(t);return(s,o)=>{let a=e==em||e==s,c=t==em||t==o;return!a&&r&&"boolean"==typeof s&&(a=s?tm.has(e):nm.has(e)),!c&&i&&"boolean"==typeof o&&(c=o?tm.has(t):nm.has(t)),a&&c}}const eoe=new RegExp("s*:selfs*,?","g");function wC(e,t,r,i){return new toe(e).build(t,r,i)}class toe{constructor(t){this._driver=t}build(t,r,i){const s=new ioe(r);return this._resetContextStyleTimingState(s),Yn(this,Dd(t),s)}_resetContextStyleTimingState(t){t.currentQuerySelector="",t.collectedStyles=new Map,t.collectedStyles.set("",new Map),t.currentTime=0}visitTrigger(t,r){let i=r.queryCount=0,s=r.depCount=0;const o=[],a=[];return"@"==t.name.charAt(0)&&r.errors.push(function lse(){return new A(3006,!1)}()),t.definitions.forEach(c=>{if(this._resetContextStyleTimingState(r),c.type==le.State){const l=c,u=l.name;u.toString().split(/\s*,\s*/).forEach(d=>{l.name=d,o.push(this.visitState(l,r))}),l.name=u}else if(c.type==le.Transition){const l=this.visitTransition(c,r);i+=l.queryCount,s+=l.depCount,a.push(l)}else r.errors.push(function use(){return new A(3007,!1)}())}),{type:le.Trigger,name:t.name,states:o,transitions:a,queryCount:i,depCount:s,options:null}}visitState(t,r){const i=this.visitStyle(t.styles,r),s=t.options&&t.options.params||null;if(i.containsDynamicStyles){const o=new Set,a=s||{};i.styles.forEach(c=>{c instanceof Map&&c.forEach(l=>{HF(l).forEach(u=>{a.hasOwnProperty(u)||o.add(u)})})}),o.size&&r.errors.push(function dse(){return new A(3008,!1)}(0,o.values()))}return{type:le.State,name:t.name,style:i,options:s?{params:s}:null}}visitTransition(t,r){r.queryCount=0,r.depCount=0;const i=Yn(this,Dd(t.animation),r),s=function Yse(e,t){const r=[];return"string"==typeof e?e.split(/\s*,\s*/).forEach(i=>function Jse(e,t,r){if(":"==e[0]){const l=function Xse(e,t){switch(e){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(r,i)=>parseFloat(i)>parseFloat(r);case":decrement":return(r,i)=>parseFloat(i) *"}}(e,r);if("function"==typeof l)return void t.push(l);e=l}const i=e.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return r.push(function wse(){return new A(3015,!1)}()),t;const s=i[1],o=i[2],a=i[3];t.push(qF(s,a)),"<"==o[0]&&(s!=em||a!=em)&&t.push(qF(a,s))}(i,r,t)):r.push(e),r}(t.expr,r.errors);return{type:le.Transition,matchers:s,animation:i,queryCount:r.queryCount,depCount:r.depCount,options:Zo(t.options)}}visitSequence(t,r){return{type:le.Sequence,steps:t.steps.map(i=>Yn(this,i,r)),options:Zo(t.options)}}visitGroup(t,r){const i=r.currentTime;let s=0;const o=t.steps.map(a=>{r.currentTime=i;const c=Yn(this,a,r);return s=Math.max(s,r.currentTime),c});return r.currentTime=s,{type:le.Group,steps:o,options:Zo(t.options)}}visitAnimate(t,r){const i=function ooe(e,t){if(e.hasOwnProperty("duration"))return e;if("number"==typeof e)return bC(Xg(e,t).duration,0,"");const r=e;if(r.split(/\s+/).some(o=>"{"==o.charAt(0)&&"{"==o.charAt(1))){const o=bC(0,0,"");return o.dynamic=!0,o.strValue=r,o}const s=Xg(r,t);return bC(s.duration,s.delay,s.easing)}(t.timings,r.errors);r.currentAnimateTimings=i;let s,o=t.styles?t.styles:Ed({});if(o.type==le.Keyframes)s=this.visitKeyframes(o,r);else{let a=t.styles,c=!1;if(!a){c=!0;const u={};i.easing&&(u.easing=i.easing),a=Ed(u)}r.currentTime+=i.duration+i.delay;const l=this.visitStyle(a,r);l.isEmptyStep=c,s=l}return r.currentAnimateTimings=null,{type:le.Animate,timings:i,style:s,options:null}}visitStyle(t,r){const i=this._makeStyleAst(t,r);return this._validateStyleAst(i,r),i}_makeStyleAst(t,r){const i=[],s=Array.isArray(t.styles)?t.styles:[t.styles];for(let c of s)"string"==typeof c?c===Yi?i.push(c):r.errors.push(new A(3002,!1)):i.push(new Map(Object.entries(c)));let o=!1,a=null;return i.forEach(c=>{if(c instanceof Map&&(c.has("easing")&&(a=c.get("easing"),c.delete("easing")),!o))for(let l of c.values())if(l.toString().indexOf("{{")>=0){o=!0;break}}),{type:le.Style,styles:i,easing:a,offset:t.offset,containsDynamicStyles:o,options:null}}_validateStyleAst(t,r){const i=r.currentAnimateTimings;let s=r.currentTime,o=r.currentTime;i&&o>0&&(o-=i.duration+i.delay),t.styles.forEach(a=>{"string"!=typeof a&&a.forEach((c,l)=>{const u=r.collectedStyles.get(r.currentQuerySelector),d=u.get(l);let f=!0;d&&(o!=s&&o>=d.startTime&&s<=d.endTime&&(r.errors.push(function hse(){return new A(3010,!1)}()),f=!1),o=d.startTime),f&&u.set(l,{startTime:o,endTime:s}),r.options&&function Gse(e,t,r){const i=t.params||{},s=HF(e);s.length&&s.forEach(o=>{i.hasOwnProperty(o)||r.push(function sse(){return new A(3001,!1)}())})}(c,r.options,r.errors)})})}visitKeyframes(t,r){const i={type:le.Keyframes,styles:[],options:null};if(!r.currentAnimateTimings)return r.errors.push(function pse(){return new A(3011,!1)}()),i;let o=0;const a=[];let c=!1,l=!1,u=0;const d=t.steps.map(_=>{const v=this._makeStyleAst(_,r);let w=null!=v.offset?v.offset:function soe(e){if("string"==typeof e)return null;let t=null;if(Array.isArray(e))e.forEach(r=>{if(r instanceof Map&&r.has("offset")){const i=r;t=parseFloat(i.get("offset")),i.delete("offset")}});else if(e instanceof Map&&e.has("offset")){const r=e;t=parseFloat(r.get("offset")),r.delete("offset")}return t}(v.styles),b=0;return null!=w&&(o++,b=v.offset=w),l=l||b<0||b>1,c=c||b0&&o{const w=h>0?v==p?1:h*v:a[v],b=w*y;r.currentTime=g+m.delay+b,m.duration=b,this._validateStyleAst(_,r),_.offset=w,i.styles.push(_)}),i}visitReference(t,r){return{type:le.Reference,animation:Yn(this,Dd(t.animation),r),options:Zo(t.options)}}visitAnimateChild(t,r){return r.depCount++,{type:le.AnimateChild,options:Zo(t.options)}}visitAnimateRef(t,r){return{type:le.AnimateRef,animation:this.visitReference(t.animation,r),options:Zo(t.options)}}visitQuery(t,r){const i=r.currentQuerySelector,s=t.options||{};r.queryCount++,r.currentQuery=t;const[o,a]=function noe(e){const t=!!e.split(/\s*,\s*/).find(r=>":self"==r);return t&&(e=e.replace(eoe,"")),e=e.replace(/@\*/g,Jg).replace(/@\w+/g,r=>Jg+"-"+r.slice(1)).replace(/:animating/g,gC),[e,t]}(t.selector);r.currentQuerySelector=i.length?i+" "+o:o,Qn(r.collectedStyles,r.currentQuerySelector,new Map);const c=Yn(this,Dd(t.animation),r);return r.currentQuery=null,r.currentQuerySelector=i,{type:le.Query,selector:o,limit:s.limit||0,optional:!!s.optional,includeSelf:a,animation:c,originalSelector:t.selector,options:Zo(t.options)}}visitStagger(t,r){r.currentQuery||r.errors.push(function vse(){return new A(3013,!1)}());const i="full"===t.timings?{duration:0,delay:0,easing:"full"}:Xg(t.timings,r.errors,!0);return{type:le.Stagger,animation:Yn(this,Dd(t.animation),r),timings:i,options:null}}}class ioe{constructor(t){this.errors=t,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles=new Map,this.options=null,this.unsupportedCSSPropertiesFound=new Set}}function Zo(e){return e?(e={...e}).params&&(e.params=function roe(e){return e?{...e}:null}(e.params)):e={},e}function bC(e,t,r){return{duration:e,delay:t,easing:r}}function EC(e,t,r,i,s,o,a=null,c=!1){return{type:1,element:e,keyframes:t,preStyleProps:r,postStyleProps:i,duration:s,delay:o,totalTime:s+o,easing:a,subTimeline:c}}class rm{constructor(){this._map=new Map}get(t){return this._map.get(t)||[]}append(t,r){let i=this._map.get(t);i||this._map.set(t,i=[]),i.push(...r)}has(t){return this._map.has(t)}clear(){this._map.clear()}}const loe=new RegExp(":enter","g"),doe=new RegExp(":leave","g");function CC(e,t,r,i,s,o=new Map,a=new Map,c,l,u=[]){return(new foe).buildKeyframes(e,t,r,i,s,o,a,c,l,u)}class foe{buildKeyframes(t,r,i,s,o,a,c,l,u,d=[]){u=u||new rm;const f=new DC(t,r,u,s,o,d,[]);f.options=l;const h=l.delay?Ji(l.delay):0;f.currentTimeline.delayNextStep(h),f.currentTimeline.setStyles([a],null,f.errors,l),Yn(this,i,f);const p=f.timelines.filter(g=>g.containsAnimation());if(p.length&&c.size){let g;for(let m=p.length-1;m>=0;m--){const y=p[m];if(y.element===r){g=y;break}}g&&!g.allowOnlyTimelineStyles()&&g.setStyles([c],null,f.errors,l)}return p.length?p.map(g=>g.buildKeyframes()):[EC(r,[],[],[],0,h,"",!1)]}visitTrigger(t,r){}visitState(t,r){}visitTransition(t,r){}visitAnimateChild(t,r){const i=r.subInstructions.get(r.element);if(i){const s=r.createSubContext(t.options),o=r.currentTimeline.currentTime,a=this._visitSubInstructions(i,s,s.options);o!=a&&r.transformIntoNewTimeline(a)}r.previousNode=t}visitAnimateRef(t,r){const i=r.createSubContext(t.options);i.transformIntoNewTimeline(),this._applyAnimationRefDelays([t.options,t.animation.options],r,i),this.visitReference(t.animation,i),r.transformIntoNewTimeline(i.currentTimeline.currentTime),r.previousNode=t}_applyAnimationRefDelays(t,r,i){for(const s of t){const o=s?.delay;if(o){const a="number"==typeof o?o:Ji(Sd(o,s?.params??{},r.errors));i.delayNextStep(a)}}}_visitSubInstructions(t,r,i){let o=r.currentTimeline.currentTime;const a=null!=i.duration?Ji(i.duration):null,c=null!=i.delay?Ji(i.delay):null;return 0!==a&&t.forEach(l=>{const u=r.appendInstructionToTimeline(l,a,c);o=Math.max(o,u.duration+u.delay)}),o}visitReference(t,r){r.updateOptions(t.options,!0),Yn(this,t.animation,r),r.previousNode=t}visitSequence(t,r){const i=r.subContextCount;let s=r;const o=t.options;if(o&&(o.params||o.delay)&&(s=r.createSubContext(o),s.transformIntoNewTimeline(),null!=o.delay)){s.previousNode.type==le.Style&&(s.currentTimeline.snapshotCurrentStyles(),s.previousNode=im);const a=Ji(o.delay);s.delayNextStep(a)}t.steps.length&&(t.steps.forEach(a=>Yn(this,a,s)),s.currentTimeline.applyStylesToKeyframe(),s.subContextCount>i&&s.transformIntoNewTimeline()),r.previousNode=t}visitGroup(t,r){const i=[];let s=r.currentTimeline.currentTime;const o=t.options&&t.options.delay?Ji(t.options.delay):0;t.steps.forEach(a=>{const c=r.createSubContext(t.options);o&&c.delayNextStep(o),Yn(this,a,c),s=Math.max(s,c.currentTimeline.currentTime),i.push(c.currentTimeline)}),i.forEach(a=>r.currentTimeline.mergeTimelineCollectedStyles(a)),r.transformIntoNewTimeline(s),r.previousNode=t}_visitTiming(t,r){if(t.dynamic){const i=t.strValue;return Xg(r.params?Sd(i,r.params,r.errors):i,r.errors)}return{duration:t.duration,delay:t.delay,easing:t.easing}}visitAnimate(t,r){const i=r.currentAnimateTimings=this._visitTiming(t.timings,r),s=r.currentTimeline;i.delay&&(r.incrementTime(i.delay),s.snapshotCurrentStyles());const o=t.style;o.type==le.Keyframes?this.visitKeyframes(o,r):(r.incrementTime(i.duration),this.visitStyle(o,r),s.applyStylesToKeyframe()),r.currentAnimateTimings=null,r.previousNode=t}visitStyle(t,r){const i=r.currentTimeline,s=r.currentAnimateTimings;!s&&i.hasCurrentStyleProperties()&&i.forwardFrame();const o=s&&s.easing||t.easing;t.isEmptyStep?i.applyEmptyStep(o):i.setStyles(t.styles,o,r.errors,r.options),r.previousNode=t}visitKeyframes(t,r){const i=r.currentAnimateTimings,s=r.currentTimeline.duration,o=i.duration,c=r.createSubContext().currentTimeline;c.easing=i.easing,t.styles.forEach(l=>{c.forwardTime((l.offset||0)*o),c.setStyles(l.styles,l.easing,r.errors,r.options),c.applyStylesToKeyframe()}),r.currentTimeline.mergeTimelineCollectedStyles(c),r.transformIntoNewTimeline(s+o),r.previousNode=t}visitQuery(t,r){const i=r.currentTimeline.currentTime,s=t.options||{},o=s.delay?Ji(s.delay):0;o&&(r.previousNode.type===le.Style||0==i&&r.currentTimeline.hasCurrentStyleProperties())&&(r.currentTimeline.snapshotCurrentStyles(),r.previousNode=im);let a=i;const c=r.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!s.optional,r.errors);r.currentQueryTotal=c.length;let l=null;c.forEach((u,d)=>{r.currentQueryIndex=d;const f=r.createSubContext(t.options,u);o&&f.delayNextStep(o),u===r.element&&(l=f.currentTimeline),Yn(this,t.animation,f),f.currentTimeline.applyStylesToKeyframe(),a=Math.max(a,f.currentTimeline.currentTime)}),r.currentQueryIndex=0,r.currentQueryTotal=0,r.transformIntoNewTimeline(a),l&&(r.currentTimeline.mergeTimelineCollectedStyles(l),r.currentTimeline.snapshotCurrentStyles()),r.previousNode=t}visitStagger(t,r){const i=r.parentContext,s=r.currentTimeline,o=t.timings,a=Math.abs(o.duration),c=a*(r.currentQueryTotal-1);let l=a*r.currentQueryIndex;switch(o.duration<0?"reverse":o.easing){case"reverse":l=c-l;break;case"full":l=i.currentStaggerTime}const d=r.currentTimeline;l&&d.delayNextStep(l);const f=d.currentTime;Yn(this,t.animation,r),r.previousNode=t,i.currentStaggerTime=s.currentTime-f+(s.startTime-i.currentTimeline.startTime)}}const im={};class DC{constructor(t,r,i,s,o,a,c,l){this._driver=t,this.element=r,this.subInstructions=i,this._enterClassName=s,this._leaveClassName=o,this.errors=a,this.timelines=c,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=im,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=l||new sm(this._driver,r,0),c.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(t,r){if(!t)return;const i=t;let s=this.options;null!=i.duration&&(s.duration=Ji(i.duration)),null!=i.delay&&(s.delay=Ji(i.delay));const o=i.params;if(o){let a=s.params;a||(a=this.options.params={}),Object.keys(o).forEach(c=>{(!r||!a.hasOwnProperty(c))&&(a[c]=Sd(o[c],a,this.errors))})}}_copyOptions(){const t={};if(this.options){const r=this.options.params;if(r){const i=t.params={};Object.keys(r).forEach(s=>{i[s]=r[s]})}}return t}createSubContext(t=null,r,i){const s=r||this.element,o=new DC(this._driver,s,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(s,i||0));return o.previousNode=this.previousNode,o.currentAnimateTimings=this.currentAnimateTimings,o.options=this._copyOptions(),o.updateOptions(t),o.currentQueryIndex=this.currentQueryIndex,o.currentQueryTotal=this.currentQueryTotal,o.parentContext=this,this.subContextCount++,o}transformIntoNewTimeline(t){return this.previousNode=im,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(t,r,i){const s={duration:r??t.duration,delay:this.currentTimeline.currentTime+(i??0)+t.delay,easing:""},o=new hoe(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,s,t.stretchStartingKeyframe);return this.timelines.push(o),s}incrementTime(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)}delayNextStep(t){t>0&&this.currentTimeline.delayNextStep(t)}invokeQuery(t,r,i,s,o,a){let c=[];if(s&&c.push(this.element),t.length>0){t=(t=t.replace(loe,"."+this._enterClassName)).replace(doe,"."+this._leaveClassName);let u=this._driver.query(this.element,t,1!=i);0!==i&&(u=i<0?u.slice(u.length+i,u.length):u.slice(0,i)),c.push(...u)}return!o&&0==c.length&&a.push(function _se(){return new A(3014,!1)}()),c}}class sm{constructor(t,r,i,s){this._driver=t,this.element=r,this.startTime=i,this._elementTimelineStylesLookup=s,this.duration=0,this.easing=null,this._previousKeyframe=new Map,this._currentKeyframe=new Map,this._keyframes=new Map,this._styleSummary=new Map,this._localTimelineStyles=new Map,this._pendingStyles=new Map,this._backFill=new Map,this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(r),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(r,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(t){const r=1===this._keyframes.size&&this._pendingStyles.size;this.duration||r?(this.forwardTime(this.currentTime+t),r&&this.snapshotCurrentStyles()):this.startTime+=t}fork(t,r){return this.applyStylesToKeyframe(),new sm(this._driver,t,r||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=new Map,this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(t){this.applyStylesToKeyframe(),this.duration=t,this._loadKeyframe()}_updateStyle(t,r){this._localTimelineStyles.set(t,r),this._globalTimelineStyles.set(t,r),this._styleSummary.set(t,{time:this.currentTime,value:r})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(t){t&&this._previousKeyframe.set("easing",t);for(let[r,i]of this._globalTimelineStyles)this._backFill.set(r,i||Yi),this._currentKeyframe.set(r,Yi);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(t,r,i,s){r&&this._previousKeyframe.set("easing",r);const o=s&&s.params||{},a=function poe(e,t){const r=new Map;let i;return e.forEach(s=>{if("*"===s){i??=t.keys();for(let o of i)r.set(o,Yi)}else for(let[o,a]of s)r.set(o,a)}),r}(t,this._globalTimelineStyles);for(let[c,l]of a){const u=Sd(l,o,i);this._pendingStyles.set(c,u),this._localTimelineStyles.has(c)||this._backFill.set(c,this._globalTimelineStyles.get(c)??Yi),this._updateStyle(c,u)}}applyStylesToKeyframe(){0!=this._pendingStyles.size&&(this._pendingStyles.forEach((t,r)=>{this._currentKeyframe.set(r,t)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((t,r)=>{this._currentKeyframe.has(r)||this._currentKeyframe.set(r,t)}))}snapshotCurrentStyles(){for(let[t,r]of this._localTimelineStyles)this._pendingStyles.set(t,r),this._updateStyle(t,r)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const t=[];for(let r in this._currentKeyframe)t.push(r);return t}mergeTimelineCollectedStyles(t){t._styleSummary.forEach((r,i)=>{const s=this._styleSummary.get(i);(!s||r.time>s.time)&&this._updateStyle(i,r.value)})}buildKeyframes(){this.applyStylesToKeyframe();const t=new Set,r=new Set,i=1===this._keyframes.size&&0===this.duration;let s=[];this._keyframes.forEach((c,l)=>{const u=new Map([...this._backFill,...c]);u.forEach((d,f)=>{"!"===d?t.add(f):d===Yi&&r.add(f)}),i||u.set("offset",l/this.duration),s.push(u)});const o=[...t.values()],a=[...r.values()];if(i){const c=s[0],l=new Map(c);c.set("offset",0),l.set("offset",1),s=[c,l]}return EC(this.element,s,o,a,this.duration,this.startTime,this.easing,!1)}}class hoe extends sm{constructor(t,r,i,s,o,a,c=!1){super(t,r,a.delay),this.keyframes=i,this.preStyleProps=s,this.postStyleProps=o,this._stretchStartingKeyframe=c,this.timings={duration:a.duration,delay:a.delay,easing:a.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let t=this.keyframes,{delay:r,duration:i,easing:s}=this.timings;if(this._stretchStartingKeyframe&&r){const o=[],a=i+r,c=r/a,l=new Map(t[0]);l.set("offset",0),o.push(l);const u=new Map(t[0]);u.set("offset",ZF(c)),o.push(u);const d=t.length-1;for(let f=1;f<=d;f++){let h=new Map(t[f]);const p=h.get("offset");h.set("offset",ZF((r+p*i)/a)),o.push(h)}i=a,r=0,s="",t=o}return EC(this.element,t,this.preStyleProps,this.postStyleProps,i,r,s,!0)}}function ZF(e,t=3){const r=Math.pow(10,t-1);return Math.round(e*r)/r}function KF(e,t,r,i,s,o,a,c,l,u,d,f,h){return{type:0,element:e,triggerName:t,isRemovalTransition:s,fromState:r,fromStyles:o,toState:i,toStyles:a,timelines:c,queriedElements:l,preStyleProps:u,postStyleProps:d,totalTime:f,errors:h}}const SC={};class QF{constructor(t,r,i){this._triggerName=t,this.ast=r,this._stateStyles=i}match(t,r,i,s){return function goe(e,t,r,i,s){return e.some(o=>o(t,r,i,s))}(this.ast.matchers,t,r,i,s)}buildStyles(t,r,i){let s=this._stateStyles.get("*");return void 0!==t&&(s=this._stateStyles.get(t?.toString())||s),s?s.buildStyles(r,i):new Map}build(t,r,i,s,o,a,c,l,u,d){const f=[],h=this.ast.options&&this.ast.options.params||SC,g=this.buildStyles(i,c&&c.params||SC,f),m=l&&l.params||SC,y=this.buildStyles(s,m,f),_=new Set,v=new Map,w=new Map,b="void"===s,D={params:YF(m,h),delay:this.ast.options?.delay},C=d?[]:CC(t,r,this.ast.animation,o,a,g,y,D,u,f);let S=0;return C.forEach(I=>{S=Math.max(I.duration+I.delay,S)}),f.length?KF(r,this._triggerName,i,s,b,g,y,[],[],v,w,S,f):(C.forEach(I=>{const P=I.element,H=Qn(v,P,new Set);I.preStyleProps.forEach($=>H.add($));const V=Qn(w,P,new Set);I.postStyleProps.forEach($=>V.add($)),P!==r&&_.add(P)}),KF(r,this._triggerName,i,s,b,g,y,C,[..._.values()],v,w,S))}}function YF(e,t){const r={...t};return Object.entries(e).forEach(([i,s])=>{null!=s&&(r[i]=s)}),r}class moe{constructor(t,r,i){this.styles=t,this.defaultParams=r,this.normalizer=i}buildStyles(t,r){const i=new Map,s=YF(t,this.defaultParams);return this.styles.styles.forEach(o=>{"string"!=typeof o&&o.forEach((a,c)=>{a&&(a=Sd(a,s,r));const l=this.normalizer.normalizePropertyName(c,r);a=this.normalizer.normalizeStyleValue(c,l,a,r),i.set(c,a)})}),i}}class voe{constructor(t,r,i){this.name=t,this.ast=r,this._normalizer=i,this.transitionFactories=[],this.states=new Map,r.states.forEach(s=>{this.states.set(s.name,new moe(s.style,s.options&&s.options.params||{},i))}),JF(this.states,"true","1"),JF(this.states,"false","0"),r.transitions.forEach(s=>{this.transitionFactories.push(new QF(t,s,this.states))}),this.fallbackTransition=function _oe(e,t){return new QF(e,{type:le.Transition,animation:{type:le.Sequence,steps:[],options:null},matchers:[(a,c)=>!0],options:null,queryCount:0,depCount:0},t)}(t,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(t,r,i,s){return this.transitionFactories.find(a=>a.match(t,r,i,s))||null}matchStyles(t,r,i){return this.fallbackTransition.buildStyles(t,r,i)}}function JF(e,t,r){e.has(t)?e.has(r)||e.set(r,e.get(t)):e.has(r)&&e.set(t,e.get(r))}const woe=new rm;class boe{constructor(t,r,i){this.bodyNode=t,this._driver=r,this._normalizer=i,this._animations=new Map,this._playersById=new Map,this.players=[]}register(t,r){const i=[],o=wC(this._driver,r,i,[]);if(i.length)throw function Tse(){return new A(3503,!1)}();this._animations.set(t,o)}_buildPlayer(t,r,i){const s=t.element,o=PF(this._normalizer,t.keyframes,r,i);return this._driver.animate(s,o,t.duration,t.delay,t.easing,[],!0)}create(t,r,i={}){const s=[],o=this._animations.get(t);let a;const c=new Map;if(o?(a=CC(this._driver,r,o,pC,Qg,new Map,new Map,i,woe,s),a.forEach(d=>{const f=Qn(c,d.element,new Map);d.postStyleProps.forEach(h=>f.set(h,null))})):(s.push(function Ise(){return new A(3300,!1)}()),a=[]),s.length)throw function xse(){return new A(3504,!1)}();c.forEach((d,f)=>{d.forEach((h,p)=>{d.set(p,this._driver.computeStyle(f,p,Yi))})});const u=qs(a.map(d=>{const f=c.get(d.element);return this._buildPlayer(d,new Map,f)}));return this._playersById.set(t,u),u.onDestroy(()=>this.destroy(t)),this.players.push(u),u}destroy(t){const r=this._getPlayer(t);r.destroy(),this._playersById.delete(t);const i=this.players.indexOf(r);i>=0&&this.players.splice(i,1)}_getPlayer(t){const r=this._playersById.get(t);if(!r)throw function Ase(){return new A(3301,!1)}();return r}listen(t,r,i,s){const o=lC(r,"","","");return aC(this._getPlayer(t),i,o,s),()=>{}}command(t,r,i,s){if("register"==i)return void this.register(t,s[0]);if("create"==i)return void this.create(t,r,s[0]||{});const o=this._getPlayer(t);switch(i){case"play":o.play();break;case"pause":o.pause();break;case"reset":o.reset();break;case"restart":o.restart();break;case"finish":o.finish();break;case"init":o.init();break;case"setPosition":o.setPosition(parseFloat(s[0]));break;case"destroy":this.destroy(t)}}}const XF="ng-animate-queued",TC="ng-animate-disabled",Toe=[],e3={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Ioe={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Fr="__ng_removed";class IC{get params(){return this.options.params}constructor(t,r=""){this.namespaceId=r;const i=t&&t.hasOwnProperty("value");if(this.value=function Noe(e){return e??null}(i?t.value:t),i){const{value:o,...a}=t;this.options=a}else this.options={};this.options.params||(this.options.params={})}absorbOptions(t){const r=t.params;if(r){const i=this.options.params;Object.keys(r).forEach(s=>{null==i[s]&&(i[s]=r[s])})}}}const Td="void",xC=new IC(Td);class xoe{constructor(t,r,i){this.id=t,this.hostElement=r,this._engine=i,this.players=[],this._triggers=new Map,this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+t,pr(r,this._hostClassName)}listen(t,r,i,s){if(!this._triggers.has(r))throw function Mse(){return new A(3302,!1)}();if(null==i||0==i.length)throw function Nse(){return new A(3303,!1)}();if(!function Roe(e){return"start"==e||"done"==e}(i))throw function Rse(){return new A(3400,!1)}();const o=Qn(this._elementListeners,t,[]),a={name:r,phase:i,callback:s};o.push(a);const c=Qn(this._engine.statesByElement,t,new Map);return c.has(r)||(pr(t,Yg),pr(t,Yg+"-"+r),c.set(r,xC)),()=>{this._engine.afterFlush(()=>{const l=o.indexOf(a);l>=0&&o.splice(l,1),this._triggers.has(r)||c.delete(r)})}}register(t,r){return!this._triggers.has(t)&&(this._triggers.set(t,r),!0)}_getTrigger(t){const r=this._triggers.get(t);if(!r)throw function Ose(){return new A(3401,!1)}();return r}trigger(t,r,i,s=!0){const o=this._getTrigger(r),a=new AC(this.id,r,t);let c=this._engine.statesByElement.get(t);c||(pr(t,Yg),pr(t,Yg+"-"+r),this._engine.statesByElement.set(t,c=new Map));let l=c.get(r);const u=new IC(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&l&&u.absorbOptions(l.options),c.set(r,u),l||(l=xC),u.value!==Td&&l.value===u.value){if(!function Poe(e,t){const r=Object.keys(e),i=Object.keys(t);if(r.length!=i.length)return!1;for(let s=0;s{Wo(t,y),wi(t,_)})}return}const h=Qn(this._engine.playersByElement,t,[]);h.forEach(m=>{m.namespaceId==this.id&&m.triggerName==r&&m.queued&&m.destroy()});let p=o.matchTransition(l.value,u.value,t,u.params),g=!1;if(!p){if(!s)return;p=o.fallbackTransition,g=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:r,transition:p,fromState:l,toState:u,player:a,isFallbackTransition:g}),g||(pr(t,XF),a.onStart(()=>{qc(t,XF)})),a.onDone(()=>{let m=this.players.indexOf(a);m>=0&&this.players.splice(m,1);const y=this._engine.playersByElement.get(t);if(y){let _=y.indexOf(a);_>=0&&y.splice(_,1)}}),this.players.push(a),h.push(a),a}deregister(t){this._triggers.delete(t),this._engine.statesByElement.forEach(r=>r.delete(t)),this._elementListeners.forEach((r,i)=>{this._elementListeners.set(i,r.filter(s=>s.name!=t))})}clearElementCache(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);const r=this._engine.playersByElement.get(t);r&&(r.forEach(i=>i.destroy()),this._engine.playersByElement.delete(t))}_signalRemovalForInnerTriggers(t,r){const i=this._engine.driver.query(t,Jg,!0);i.forEach(s=>{if(s[Fr])return;const o=this._engine.fetchNamespacesByElement(s);o.size?o.forEach(a=>a.triggerLeaveAnimation(s,r,!1,!0)):this.clearElementCache(s)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(s=>this.clearElementCache(s)))}triggerLeaveAnimation(t,r,i,s){const o=this._engine.statesByElement.get(t),a=new Map;if(o){const c=[];if(o.forEach((l,u)=>{if(a.set(u,l.value),this._triggers.has(u)){const d=this.trigger(t,u,Td,s);d&&c.push(d)}}),c.length)return this._engine.markElementAsRemoved(this.id,t,!0,r,a),i&&qs(c).onDone(()=>this._engine.processLeaveNode(t)),!0}return!1}prepareLeaveAnimationListeners(t){const r=this._elementListeners.get(t),i=this._engine.statesByElement.get(t);if(r&&i){const s=new Set;r.forEach(o=>{const a=o.name;if(s.has(a))return;s.add(a);const l=this._triggers.get(a).fallbackTransition,u=i.get(a)||xC,d=new IC(Td),f=new AC(this.id,a,t);this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:a,transition:l,fromState:u,toState:d,player:f,isFallbackTransition:!0})})}}removeNode(t,r){const i=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,r),this.triggerLeaveAnimation(t,r,!0))return;let s=!1;if(i.totalAnimations){const o=i.players.length?i.playersByQueriedElement.get(t):[];if(o&&o.length)s=!0;else{let a=t;for(;a=a.parentNode;)if(i.statesByElement.get(a)){s=!0;break}}}if(this.prepareLeaveAnimationListeners(t),s)i.markElementAsRemoved(this.id,t,!1,r);else{const o=t[Fr];(!o||o===e3)&&(i.afterFlush(()=>this.clearElementCache(t)),i.destroyInnerAnimations(t),i._onRemovalComplete(t,r))}}insertNode(t,r){pr(t,this._hostClassName)}drainQueuedTransitions(t){const r=[];return this._queue.forEach(i=>{const s=i.player;if(s.destroyed)return;const o=i.element,a=this._elementListeners.get(o);a&&a.forEach(c=>{if(c.name==i.triggerName){const l=lC(o,i.triggerName,i.fromState.value,i.toState.value);l._data=t,aC(i.player,c.phase,l,c.callback)}}),s.markedForDestroy?this._engine.afterFlush(()=>{s.destroy()}):r.push(i)}),this._queue=[],r.sort((i,s)=>{const o=i.transition.ast.depCount,a=s.transition.ast.depCount;return 0==o||0==a?o-a:this._engine.driver.containsElement(i.element,s.element)?1:-1})}destroy(t){this.players.forEach(r=>r.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,t)}}class Aoe{_onRemovalComplete(t,r){this.onRemovalComplete(t,r)}constructor(t,r,i){this.bodyNode=t,this.driver=r,this._normalizer=i,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(s,o)=>{}}get queuedPlayers(){const t=[];return this._namespaceList.forEach(r=>{r.players.forEach(i=>{i.queued&&t.push(i)})}),t}createNamespace(t,r){const i=new xoe(t,r,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,r)?this._balanceNamespaceList(i,r):(this.newHostElements.set(r,i),this.collectEnterElement(r)),this._namespaceLookup[t]=i}_balanceNamespaceList(t,r){const i=this._namespaceList,s=this.namespacesByHostElement;if(i.length-1>=0){let a=!1,c=this.driver.getParentElement(r);for(;c;){const l=s.get(c);if(l){const u=i.indexOf(l);i.splice(u+1,0,t),a=!0;break}c=this.driver.getParentElement(c)}a||i.unshift(t)}else i.push(t);return s.set(r,t),t}register(t,r){let i=this._namespaceLookup[t];return i||(i=this.createNamespace(t,r)),i}registerTrigger(t,r,i){let s=this._namespaceLookup[t];s&&s.register(r,i)&&this.totalAnimations++}destroy(t,r){t&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{const i=this._fetchNamespace(t);this.namespacesByHostElement.delete(i.hostElement);const s=this._namespaceList.indexOf(i);s>=0&&this._namespaceList.splice(s,1),i.destroy(r),delete this._namespaceLookup[t]}))}_fetchNamespace(t){return this._namespaceLookup[t]}fetchNamespacesByElement(t){const r=new Set,i=this.statesByElement.get(t);if(i)for(let s of i.values())if(s.namespaceId){const o=this._fetchNamespace(s.namespaceId);o&&r.add(o)}return r}trigger(t,r,i,s){if(om(r)){const o=this._fetchNamespace(t);if(o)return o.trigger(r,i,s),!0}return!1}insertNode(t,r,i,s){if(!om(r))return;const o=r[Fr];if(o&&o.setForRemoval){o.setForRemoval=!1,o.setForMove=!0;const a=this.collectedLeaveElements.indexOf(r);a>=0&&this.collectedLeaveElements.splice(a,1)}if(t){const a=this._fetchNamespace(t);a&&a.insertNode(r,i)}s&&this.collectEnterElement(r)}collectEnterElement(t){this.collectedEnterElements.push(t)}markElementAsDisabled(t,r){r?this.disabledNodes.has(t)||(this.disabledNodes.add(t),pr(t,TC)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),qc(t,TC))}removeNode(t,r,i){if(om(r)){const s=t?this._fetchNamespace(t):null;s?s.removeNode(r,i):this.markElementAsRemoved(t,r,!1,i);const o=this.namespacesByHostElement.get(r);o&&o.id!==t&&o.removeNode(r,i)}else this._onRemovalComplete(r,i)}markElementAsRemoved(t,r,i,s,o){this.collectedLeaveElements.push(r),r[Fr]={namespaceId:t,setForRemoval:s,hasAnimation:i,removedBeforeQueried:!1,previousTriggersValues:o}}listen(t,r,i,s,o){return om(r)?this._fetchNamespace(t).listen(r,i,s,o):()=>{}}_buildInstruction(t,r,i,s,o){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,i,s,t.fromState.options,t.toState.options,r,o)}destroyInnerAnimations(t){let r=this.driver.query(t,Jg,!0);r.forEach(i=>this.destroyActiveAnimationsForElement(i)),0!=this.playersByQueriedElement.size&&(r=this.driver.query(t,gC,!0),r.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(t){const r=this.playersByElement.get(t);r&&r.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(t){const r=this.playersByQueriedElement.get(t);r&&r.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(t=>{if(this.players.length)return qs(this.players).onDone(()=>t());t()})}processLeaveNode(t){const r=t[Fr];if(r&&r.setForRemoval){if(t[Fr]=e3,r.namespaceId){this.destroyInnerAnimations(t);const i=this._fetchNamespace(r.namespaceId);i&&i.clearElementCache(t)}this._onRemovalComplete(t,r.setForRemoval)}t.classList?.contains(TC)&&this.markElementAsDisabled(t,!1),this.driver.query(t,".ng-animate-disabled",!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(t=-1){let r=[];if(this.newHostElements.size&&(this.newHostElements.forEach((i,s)=>this._balanceNamespaceList(i,s)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let i=0;ii()),this._flushFns=[],this._whenQuietFns.length){const i=this._whenQuietFns;this._whenQuietFns=[],r.length?qs(r).onDone(()=>{i.forEach(s=>s())}):i.forEach(s=>s())}}reportError(t){throw function kse(){return new A(3402,!1)}()}_flushAnimations(t,r){const i=new rm,s=[],o=new Map,a=[],c=new Map,l=new Map,u=new Map,d=new Set;this.disabledNodes.forEach(E=>{d.add(E);const x=this.driver.query(E,".ng-animate-queued",!0);for(let R=0;R{const R=pC+m++;g.set(x,R),E.forEach(M=>pr(M,R))});const y=[],_=new Set,v=new Set;for(let E=0;E_.add(M)):v.add(x))}const w=new Map,b=r3(h,Array.from(_));b.forEach((E,x)=>{const R=Qg+m++;w.set(x,R),E.forEach(M=>pr(M,R))}),t.push(()=>{p.forEach((E,x)=>{const R=g.get(x);E.forEach(M=>qc(M,R))}),b.forEach((E,x)=>{const R=w.get(x);E.forEach(M=>qc(M,R))}),y.forEach(E=>{this.processLeaveNode(E)})});const D=[],C=[];for(let E=this._namespaceList.length-1;E>=0;E--)this._namespaceList[E].drainQueuedTransitions(r).forEach(R=>{const M=R.player,W=R.element;if(D.push(M),this.collectedEnterElements.length){const Ae=W[Fr];if(Ae&&Ae.setForMove){if(Ae.previousTriggersValues&&Ae.previousTriggersValues.has(R.triggerName)){const ot=Ae.previousTriggersValues.get(R.triggerName),Oe=this.statesByElement.get(R.element);if(Oe&&Oe.has(R.triggerName)){const Pn=Oe.get(R.triggerName);Pn.value=ot,Oe.set(R.triggerName,Pn)}}return void M.destroy()}}const J=!f||!this.driver.containsElement(f,W),ee=w.get(W),Se=g.get(W),ue=this._buildInstruction(R,i,Se,ee,J);if(ue.errors&&ue.errors.length)return void C.push(ue);if(J)return M.onStart(()=>Wo(W,ue.fromStyles)),M.onDestroy(()=>wi(W,ue.toStyles)),void s.push(M);if(R.isFallbackTransition)return M.onStart(()=>Wo(W,ue.fromStyles)),M.onDestroy(()=>wi(W,ue.toStyles)),void s.push(M);const yt=[];ue.timelines.forEach(Ae=>{Ae.stretchStartingKeyframe=!0,this.disabledNodes.has(Ae.element)||yt.push(Ae)}),ue.timelines=yt,i.append(W,ue.timelines),a.push({instruction:ue,player:M,element:W}),ue.queriedElements.forEach(Ae=>Qn(c,Ae,[]).push(M)),ue.preStyleProps.forEach((Ae,ot)=>{if(Ae.size){let Oe=l.get(ot);Oe||l.set(ot,Oe=new Set),Ae.forEach((Pn,en)=>Oe.add(en))}}),ue.postStyleProps.forEach((Ae,ot)=>{let Oe=u.get(ot);Oe||u.set(ot,Oe=new Set),Ae.forEach((Pn,en)=>Oe.add(en))})});if(C.length){const E=[];C.forEach(x=>{E.push(function Pse(){return new A(3505,!1)}())}),D.forEach(x=>x.destroy()),this.reportError(E)}const S=new Map,I=new Map;a.forEach(E=>{const x=E.element;i.has(x)&&(I.set(x,x),this._beforeAnimationBuild(E.player.namespaceId,E.instruction,S))}),s.forEach(E=>{const x=E.element;this._getPreviousPlayers(x,!1,E.namespaceId,E.triggerName,null).forEach(M=>{Qn(S,x,[]).push(M),M.destroy()})});const P=y.filter(E=>s3(E,l,u)),H=new Map;n3(H,this.driver,v,u,Yi).forEach(E=>{s3(E,l,u)&&P.push(E)});const $=new Map;p.forEach((E,x)=>{n3($,this.driver,new Set(E),l,"!")}),P.forEach(E=>{const x=H.get(E),R=$.get(E);H.set(E,new Map([...x?.entries()??[],...R?.entries()??[]]))});const X=[],L=[],T={};a.forEach(E=>{const{element:x,player:R,instruction:M}=E;if(i.has(x)){if(d.has(x))return R.onDestroy(()=>wi(x,M.toStyles)),R.disabled=!0,R.overrideTotalTime(M.totalTime),void s.push(R);let W=T;if(I.size>1){let ee=x;const Se=[];for(;ee=ee.parentNode;){const ue=I.get(ee);if(ue){W=ue;break}Se.push(ee)}Se.forEach(ue=>I.set(ue,W))}const J=this._buildAnimation(R.namespaceId,M,S,o,$,H);if(R.setRealPlayer(J),W===T)X.push(R);else{const ee=this.playersByElement.get(W);ee&&ee.length&&(R.parentPlayer=qs(ee)),s.push(R)}}else Wo(x,M.fromStyles),R.onDestroy(()=>wi(x,M.toStyles)),L.push(R),d.has(x)&&s.push(R)}),L.forEach(E=>{const x=o.get(E.element);if(x&&x.length){const R=qs(x);E.setRealPlayer(R)}}),s.forEach(E=>{E.parentPlayer?E.syncPlayerEvents(E.parentPlayer):E.destroy()});for(let E=0;E!J.destroyed);W.length?Ooe(this,x,W):this.processLeaveNode(x)}return y.length=0,X.forEach(E=>{this.players.push(E),E.onDone(()=>{E.destroy();const x=this.players.indexOf(E);this.players.splice(x,1)}),E.play()}),X}afterFlush(t){this._flushFns.push(t)}afterFlushAnimationsDone(t){this._whenQuietFns.push(t)}_getPreviousPlayers(t,r,i,s,o){let a=[];if(r){const c=this.playersByQueriedElement.get(t);c&&(a=c)}else{const c=this.playersByElement.get(t);if(c){const l=!o||o==Td;c.forEach(u=>{u.queued||!l&&u.triggerName!=s||a.push(u)})}}return(i||s)&&(a=a.filter(c=>!(i&&i!=c.namespaceId||s&&s!=c.triggerName))),a}_beforeAnimationBuild(t,r,i){const o=r.element,a=r.isRemovalTransition?void 0:t,c=r.isRemovalTransition?void 0:r.triggerName;for(const l of r.timelines){const u=l.element,d=u!==o,f=Qn(i,u,[]);this._getPreviousPlayers(u,d,a,c,r.toState).forEach(p=>{const g=p.getRealPlayer();g.beforeDestroy&&g.beforeDestroy(),p.destroy(),f.push(p)})}Wo(o,r.fromStyles)}_buildAnimation(t,r,i,s,o,a){const c=r.triggerName,l=r.element,u=[],d=new Set,f=new Set,h=r.timelines.map(g=>{const m=g.element;d.add(m);const y=m[Fr];if(y&&y.removedBeforeQueried)return new Cd(g.duration,g.delay);const _=m!==l,v=function koe(e){const t=[];return i3(e,t),t}((i.get(m)||Toe).map(S=>S.getRealPlayer())).filter(S=>!!S.element&&S.element===m),w=o.get(m),b=a.get(m),D=PF(this._normalizer,g.keyframes,w,b),C=this._buildPlayer(g,D,v);if(g.subTimeline&&s&&f.add(m),_){const S=new AC(t,c,m);S.setRealPlayer(C),u.push(S)}return C});u.forEach(g=>{Qn(this.playersByQueriedElement,g.element,[]).push(g),g.onDone(()=>function Moe(e,t,r){let i=e.get(t);if(i){if(i.length){const s=i.indexOf(r);i.splice(s,1)}0==i.length&&e.delete(t)}return i}(this.playersByQueriedElement,g.element,g))}),d.forEach(g=>pr(g,jF));const p=qs(h);return p.onDestroy(()=>{d.forEach(g=>qc(g,jF)),wi(l,r.toStyles)}),f.forEach(g=>{Qn(s,g,[]).push(p)}),p}_buildPlayer(t,r,i){return r.length>0?this.driver.animate(t.element,r,t.duration,t.delay,t.easing,i):new Cd(t.duration,t.delay)}}class AC{constructor(t,r,i){this.namespaceId=t,this.triggerName=r,this.element=i,this._player=new Cd,this._containsRealPlayer=!1,this._queuedCallbacks=new Map,this.destroyed=!1,this.parentPlayer=null,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(t){this._containsRealPlayer||(this._player=t,this._queuedCallbacks.forEach((r,i)=>{r.forEach(s=>aC(t,i,void 0,s))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(t.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(t){this.totalTime=t}syncPlayerEvents(t){const r=this._player;r.triggerCallback&&t.onStart(()=>r.triggerCallback("start")),t.onDone(()=>this.finish()),t.onDestroy(()=>this.destroy())}_queueEvent(t,r){Qn(this._queuedCallbacks,t,[]).push(r)}onDone(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)}onStart(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)}onDestroy(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(t){this.queued||this._player.setPosition(t)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(t){const r=this._player;r.triggerCallback&&r.triggerCallback(t)}}function om(e){return e&&1===e.nodeType}function t3(e,t){const r=e.style.display;return e.style.display=t??"none",r}function n3(e,t,r,i,s){const o=[];r.forEach(l=>o.push(t3(l)));const a=[];i.forEach((l,u)=>{const d=new Map;l.forEach(f=>{const h=t.computeStyle(u,f,s);d.set(f,h),(!h||0==h.length)&&(u[Fr]=Ioe,a.push(u))}),e.set(u,d)});let c=0;return r.forEach(l=>t3(l,o[c++])),a}function r3(e,t){const r=new Map;if(e.forEach(c=>r.set(c,[])),0==t.length)return r;const s=new Set(t),o=new Map;function a(c){if(!c)return 1;let l=o.get(c);if(l)return l;const u=c.parentNode;return l=r.has(u)?u:s.has(u)?1:a(u),o.set(c,l),l}return t.forEach(c=>{const l=a(c);1!==l&&r.get(l).push(c)}),r}function pr(e,t){e.classList?.add(t)}function qc(e,t){e.classList?.remove(t)}function Ooe(e,t,r){qs(r).onDone(()=>e.processLeaveNode(t))}function i3(e,t){for(let r=0;rs.add(o)):t.set(e,i),r.delete(e),!0}class Id{constructor(t,r,i){this._driver=r,this._normalizer=i,this._triggerCache={},this.onRemovalComplete=(s,o)=>{},this._transitionEngine=new Aoe(t.body,r,i),this._timelineEngine=new boe(t.body,r,i),this._transitionEngine.onRemovalComplete=(s,o)=>this.onRemovalComplete(s,o)}registerTrigger(t,r,i,s,o){const a=t+"-"+s;let c=this._triggerCache[a];if(!c){const l=[],d=wC(this._driver,o,l,[]);if(l.length)throw function Dse(){return new A(3404,!1)}();c=function yoe(e,t,r){return new voe(e,t,r)}(s,d,this._normalizer),this._triggerCache[a]=c}this._transitionEngine.registerTrigger(r,s,c)}register(t,r){this._transitionEngine.register(t,r)}destroy(t,r){this._transitionEngine.destroy(t,r)}onInsert(t,r,i,s){this._transitionEngine.insertNode(t,r,i,s)}onRemove(t,r,i){this._transitionEngine.removeNode(t,r,i)}disableAnimations(t,r){this._transitionEngine.markElementAsDisabled(t,r)}process(t,r,i,s){if("@"==i.charAt(0)){const[o,a]=LF(i);this._timelineEngine.command(o,r,a,s)}else this._transitionEngine.trigger(t,r,i,s)}listen(t,r,i,s,o){if("@"==i.charAt(0)){const[a,c]=LF(i);return this._timelineEngine.listen(a,r,c,o)}return this._transitionEngine.listen(t,r,i,s,o)}flush(t=-1){this._transitionEngine.flush(t)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(t){this._transitionEngine.afterFlushAnimationsDone(t)}}class xd{static{this.initialStylesByElement=new WeakMap}constructor(t,r,i){this._element=t,this._startStyles=r,this._endStyles=i,this._state=0;let s=xd.initialStylesByElement.get(t);s||xd.initialStylesByElement.set(t,s=new Map),this._initialStyles=s}start(){this._state<1&&(this._startStyles&&wi(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(wi(this._element,this._initialStyles),this._endStyles&&(wi(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(xd.initialStylesByElement.delete(this._element),this._startStyles&&(Wo(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Wo(this._element,this._endStyles),this._endStyles=null),wi(this._element,this._initialStyles),this._state=3)}}function MC(e){let t=null;return e.forEach((r,i)=>{(function Foe(e){return"display"===e||"position"===e})(i)&&(t=t||new Map,t.set(i,r))}),t}class o3{constructor(t,r,i,s){this.element=t,this.keyframes=r,this.options=i,this._specialStyles=s,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this._originalOnDoneFns=[],this._originalOnStartFns=[],this.time=0,this.parentPlayer=null,this.currentSnapshot=new Map,this._duration=i.duration,this._delay=i.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:new Map;const r=()=>this._onFinish();this.domPlayer.addEventListener("finish",r),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",r)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(t){const r=[];return t.forEach(i=>{r.push(Object.fromEntries(i))}),r}_triggerWebAnimation(t,r,i){return t.animate(this._convertKeyframesToObject(r),i)}onStart(t){this._originalOnStartFns.push(t),this._onStartFns.push(t)}onDone(t){this._originalOnDoneFns.push(t),this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}setPosition(t){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=t*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const t=new Map;this.hasStarted()&&this._finalKeyframe.forEach((i,s)=>{"offset"!==s&&t.set(s,this._finished?i:_C(this.element,s))}),this.currentSnapshot=t}triggerCallback(t){const r="start"===t?this._onStartFns:this._onDoneFns;r.forEach(i=>i()),r.length=0}}class a3{validateStyleProperty(t){return!0}validateAnimatableStyleProperty(t){return!0}containsElement(t,r){return BF(t,r)}getParentElement(t){return uC(t)}query(t,r,i){return VF(t,r,i)}computeStyle(t,r,i){return _C(t,r)}animate(t,r,i,s,o,a=[]){const l={duration:i,delay:s,fill:0==s?"both":"forwards"};o&&(l.easing=o);const u=new Map,d=a.filter(p=>p instanceof o3);(function Zse(e,t){return 0===e||0===t})(i,s)&&d.forEach(p=>{p.currentSnapshot.forEach((g,m)=>u.set(m,g))});let f=function qse(e){return e.length?e[0]instanceof Map?e:e.map(t=>new Map(Object.entries(t))):[]}(r).map(p=>new Map(p));f=function Kse(e,t,r){if(r.size&&t.length){let i=t[0],s=[];if(r.forEach((o,a)=>{i.has(a)||s.push(a),i.set(a,o)}),s.length)for(let o=1;oa.set(c,_C(e,c)))}}return t}(t,f,u);const h=function Loe(e,t){let r=null,i=null;return Array.isArray(t)&&t.length?(r=MC(t[0]),t.length>1&&(i=MC(t[t.length-1]))):t instanceof Map&&(r=MC(t)),r||i?new xd(e,r,i):null}(t,f);return new o3(t,f,l,h)}}const c3="@.disabled";class l3{constructor(t,r,i,s){this.namespaceId=t,this.delegate=r,this.engine=i,this._onDestroy=s,this.\u0275type=0}get data(){return this.delegate.data}destroyNode(t){this.delegate.destroyNode?.(t)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(t,r){return this.delegate.createElement(t,r)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}appendChild(t,r){this.delegate.appendChild(t,r),this.engine.onInsert(this.namespaceId,r,t,!1)}insertBefore(t,r,i,s=!0){this.delegate.insertBefore(t,r,i),this.engine.onInsert(this.namespaceId,r,t,s)}removeChild(t,r,i){this.parentNode(r)&&this.engine.onRemove(this.namespaceId,r,this.delegate)}selectRootElement(t,r){return this.delegate.selectRootElement(t,r)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,r,i,s){this.delegate.setAttribute(t,r,i,s)}removeAttribute(t,r,i){this.delegate.removeAttribute(t,r,i)}addClass(t,r){this.delegate.addClass(t,r)}removeClass(t,r){this.delegate.removeClass(t,r)}setStyle(t,r,i,s){this.delegate.setStyle(t,r,i,s)}removeStyle(t,r,i){this.delegate.removeStyle(t,r,i)}setProperty(t,r,i){"@"==r.charAt(0)&&r==c3?this.disableAnimations(t,!!i):this.delegate.setProperty(t,r,i)}setValue(t,r){this.delegate.setValue(t,r)}listen(t,r,i){return this.delegate.listen(t,r,i)}disableAnimations(t,r){this.engine.disableAnimations(t,r)}}class Boe extends l3{constructor(t,r,i,s,o){super(r,i,s,o),this.factory=t,this.namespaceId=r}setProperty(t,r,i){"@"==r.charAt(0)?"."==r.charAt(1)&&r==c3?this.disableAnimations(t,i=void 0===i||!!i):this.engine.process(this.namespaceId,t,r.slice(1),i):this.delegate.setProperty(t,r,i)}listen(t,r,i){if("@"==r.charAt(0)){const s=function Voe(e){switch(e){case"body":return document.body;case"document":return document;case"window":return window;default:return e}}(t);let o=r.slice(1),a="";return"@"!=o.charAt(0)&&([o,a]=function Uoe(e){const t=e.indexOf(".");return[e.substring(0,t),e.slice(t+1)]}(o)),this.engine.listen(this.namespaceId,s,o,a,c=>{this.factory.scheduleListenerCallback(c._data||-1,i,c)})}return this.delegate.listen(t,r,i)}}class joe{constructor(t,r,i){this.delegate=t,this.engine=r,this._zone=i,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,r.onRemovalComplete=(s,o)=>{o?.removeChild(null,s)}}createRenderer(t,r){const s=this.delegate.createRenderer(t,r);if(!t||!r?.data?.animation){const u=this._rendererCache;let d=u.get(s);return d||(d=new l3("",s,this.engine,()=>u.delete(s)),u.set(s,d)),d}const o=r.id,a=r.id+"-"+this._currentId;this._currentId++,this.engine.register(a,t);const c=u=>{Array.isArray(u)?u.forEach(c):this.engine.registerTrigger(o,a,t,u.name,u)};return r.data.animation.forEach(c),new Boe(this,a,s,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(t,r,i){if(t>=0&&tr(i));const s=this._animationCallbacksBuffer;0==s.length&&queueMicrotask(()=>{this._zone.run(()=>{s.forEach(o=>{const[a,c]=o;a(c)}),this._animationCallbacksBuffer=[]})}),s.push([r,i])}end(){this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}}let $oe=(()=>{class e extends Id{constructor(r,i,s){super(r,i,s)}ngOnDestroy(){this.flush()}static{this.\u0275fac=function(i){return new(i||e)(q(an),q(fC),q(hC))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})();const u3=[{provide:hC,useFactory:function Hoe(){return new zF}},{provide:Id,useClass:$oe},{provide:rh,useFactory:function zoe(e,t,r){return new joe(e,t,r)},deps:[v_,Id,Ne]}],NC=[{provide:fC,useFactory:()=>new a3},{provide:rT,useValue:"BrowserAnimations"},...u3],d3=[{provide:fC,useClass:dC},{provide:rT,useValue:"NoopAnimations"},...u3];let qoe=(()=>{class e{static withConfig(r){return{ngModule:e,providers:r.disableAnimations?d3:NC}}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({providers:NC,imports:[JN]})}}return e})(),Goe=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({providers:[Dw,Sw,{provide:nr,useClass:Sw}],imports:[gs,qoe]})}}return e})(),Woe=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ot({type:e,bootstrap:[Yie]})}static{this.\u0275inj=St({imports:[ese,JN,Eie,SK,nse,Qie.forRoot({timeOut:1e4,positionClass:"toast-top-center",preventDuplicates:!0}),Goe]})}}return e})();Wq().bootstrapModule(Woe).catch(e=>console.error(e))}},cm=>{cm(cm.s=433)}]); \ No newline at end of file +"use strict";(self.webpackChunkomeglestr=self.webpackChunkomeglestr||[]).push([[792],{200:(um,kC,Gc)=>{var Wc={};Gc.r(Wc),Gc.d(Wc,{OG:()=>Fw,My:()=>yc,Ph:()=>Nn,lX:()=>Pw,Id:()=>Ao,fg:()=>Zk,qj:()=>un,aT:()=>vc,lq:()=>Ts,z:()=>Lw,Q5:()=>qu});var dm={};function PC(e,t){return Object.is(e,t)}Gc.r(dm),Gc.d(dm,{aK:()=>jo,e8:()=>Rc,DO:()=>rd,dJ:()=>hL,OG:()=>pE,My:()=>Oc,Ph:()=>Uo,lX:()=>dE,Id:()=>id,fg:()=>gL,qj:()=>kr,aT:()=>Pc,r4:()=>Sg,aY:()=>Vo,x:()=>mE,lq:()=>Lc,z:()=>fE,zW:()=>kc,Q5:()=>sd});let Nt=null,Zc=!1,Nd=1;const gr=Symbol("SIGNAL");function _e(e){const t=Nt;return Nt=e,t}const Rd={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function fm(e){if(Zc)throw new Error("");if(null===Nt)return;Nt.consumerOnSignalRead(e);const t=Nt.nextProducerIndex++;Pd(Nt),te.nextProducerIndex;)e.producerNode.pop(),e.producerLastReadVersion.pop(),e.producerIndexOfThis.pop()}}function pm(e){Pd(e);for(let t=0;t0}function Pd(e){e.producerNode??=[],e.producerIndexOfThis??=[],e.producerLastReadVersion??=[]}function $C(e){e.liveConsumerNode??=[],e.liveConsumerIndexOfThis??=[]}function HC(e){return void 0!==e.producerNode}const mm=Symbol("UNSET"),ym=Symbol("COMPUTING"),Ld=Symbol("ERRORED"),m3={...Rd,value:mm,dirty:!0,error:null,equal:PC,producerMustRecompute:e=>e.value===mm||e.value===ym,producerRecomputeValue(e){if(e.value===ym)throw new Error("Detected cycle in computations.");const t=e.value;e.value=ym;const r=Od(e);let i;try{i=e.computation()}catch(s){i=Ld,e.error=s}finally{hm(e,r)}t!==mm&&t!==Ld&&i!==Ld&&e.equal(t,i)?e.value=t:(e.value=i,e.version++)}};let zC=function y3(){throw new Error};function qC(){zC()}let Fd=null;function GC(e,t){VC()||qC(),e.equal(e.value,t)||(e.value=t,function E3(e){e.version++,function p3(){Nd++}(),BC(e),Fd?.()}(e))}const b3={...Rd,equal:PC,value:void 0};function at(e){return"function"==typeof e}function Bd(e){const r=e(i=>{Error.call(i),i.stack=(new Error).stack});return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}const vm=Bd(e=>function(r){e(this),this.message=r?`${r.length} errors occurred during unsubscription:\n${r.map((i,s)=>`${s+1}) ${i.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=r});function Vd(e,t){if(e){const r=e.indexOf(t);0<=r&&e.splice(r,1)}}class vt{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;const{_parentage:r}=this;if(r)if(this._parentage=null,Array.isArray(r))for(const o of r)o.remove(this);else r.remove(this);const{initialTeardown:i}=this;if(at(i))try{i()}catch(o){t=o instanceof vm?o.errors:[o]}const{_finalizers:s}=this;if(s){this._finalizers=null;for(const o of s)try{QC(o)}catch(a){t=t??[],a instanceof vm?t=[...t,...a.errors]:t.push(a)}}if(t)throw new vm(t)}}add(t){var r;if(t&&t!==this)if(this.closed)QC(t);else{if(t instanceof vt){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}}_hasParent(t){const{_parentage:r}=this;return r===t||Array.isArray(r)&&r.includes(t)}_addParent(t){const{_parentage:r}=this;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t}_removeParent(t){const{_parentage:r}=this;r===t?this._parentage=null:Array.isArray(r)&&Vd(r,t)}remove(t){const{_finalizers:r}=this;r&&Vd(r,t),t instanceof vt&&t._removeParent(this)}}vt.EMPTY=(()=>{const e=new vt;return e.closed=!0,e})();const ZC=vt.EMPTY;function KC(e){return e instanceof vt||e&&"closed"in e&&at(e.remove)&&at(e.add)&&at(e.unsubscribe)}function QC(e){at(e)?e():e.unsubscribe()}const Gs={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Ud={setTimeout(e,t,...r){const{delegate:i}=Ud;return i?.setTimeout?i.setTimeout(e,t,...r):setTimeout(e,t,...r)},clearTimeout(e){const{delegate:t}=Ud;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function YC(e){Ud.setTimeout(()=>{const{onUnhandledError:t}=Gs;if(!t)throw e;t(e)})}function _m(){}const D3=wm("C",void 0,void 0);function wm(e,t,r){return{kind:e,value:t,error:r}}let Ws=null;function jd(e){if(Gs.useDeprecatedSynchronousErrorHandling){const t=!Ws;if(t&&(Ws={errorThrown:!1,error:null}),e(),t){const{errorThrown:r,error:i}=Ws;if(Ws=null,r)throw i}}else e()}class bm extends vt{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,KC(t)&&t.add(this)):this.destination=N3}static create(t,r,i){return new Cm(t,r,i)}next(t){this.isStopped?Dm(function T3(e){return wm("N",e,void 0)}(t),this):this._next(t)}error(t){this.isStopped?Dm(function S3(e){return wm("E",void 0,e)}(t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?Dm(D3,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const x3=Function.prototype.bind;function Em(e,t){return x3.call(e,t)}class A3{constructor(t){this.partialObserver=t}next(t){const{partialObserver:r}=this;if(r.next)try{r.next(t)}catch(i){$d(i)}}error(t){const{partialObserver:r}=this;if(r.error)try{r.error(t)}catch(i){$d(i)}else $d(t)}complete(){const{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(r){$d(r)}}}class Cm extends bm{constructor(t,r,i){let s;if(super(),at(t)||!t)s={next:t??void 0,error:r??void 0,complete:i??void 0};else{let o;this&&Gs.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=()=>this.unsubscribe(),s={next:t.next&&Em(t.next,o),error:t.error&&Em(t.error,o),complete:t.complete&&Em(t.complete,o)}):s=t}this.destination=new A3(s)}}function $d(e){Gs.useDeprecatedSynchronousErrorHandling?function I3(e){Gs.useDeprecatedSynchronousErrorHandling&&Ws&&(Ws.errorThrown=!0,Ws.error=e)}(e):YC(e)}function Dm(e,t){const{onStoppedNotification:r}=Gs;r&&Ud.setTimeout(()=>r(e,t))}const N3={closed:!0,next:_m,error:function M3(e){throw e},complete:_m},Sm="function"==typeof Symbol&&Symbol.observable||"@@observable";function Zs(e){return e}function JC(e){return 0===e.length?Zs:1===e.length?e[0]:function(r){return e.reduce((i,s)=>s(i),r)}}let Ht=(()=>{class e{constructor(r){r&&(this._subscribe=r)}lift(r){const i=new e;return i.source=this,i.operator=r,i}subscribe(r,i,s){const o=function k3(e){return e&&e instanceof bm||function O3(e){return e&&at(e.next)&&at(e.error)&&at(e.complete)}(e)&&KC(e)}(r)?r:new Cm(r,i,s);return jd(()=>{const{operator:a,source:c}=this;o.add(a?a.call(o,c):c?this._subscribe(o):this._trySubscribe(o))}),o}_trySubscribe(r){try{return this._subscribe(r)}catch(i){r.error(i)}}forEach(r,i){return new(i=XC(i))((s,o)=>{const a=new Cm({next:c=>{try{r(c)}catch(l){o(l),a.unsubscribe()}},error:o,complete:s});this.subscribe(a)})}_subscribe(r){var i;return null===(i=this.source)||void 0===i?void 0:i.subscribe(r)}[Sm](){return this}pipe(...r){return JC(r)(this)}toPromise(r){return new(r=XC(r))((i,s)=>{let o;this.subscribe(a=>o=a,a=>s(a),()=>i(o))})}}return e.create=t=>new e(t),e})();function XC(e){var t;return null!==(t=e??Gs.Promise)&&void 0!==t?t:Promise}const P3=Bd(e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});let Ze=(()=>{class e extends Ht{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(r){const i=new eD(this,this);return i.operator=r,i}_throwIfClosed(){if(this.closed)throw new P3}next(r){jd(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const i of this.currentObservers)i.next(r)}})}error(r){jd(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=r;const{observers:i}=this;for(;i.length;)i.shift().error(r)}})}complete(){jd(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:r}=this;for(;r.length;)r.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var r;return(null===(r=this.observers)||void 0===r?void 0:r.length)>0}_trySubscribe(r){return this._throwIfClosed(),super._trySubscribe(r)}_subscribe(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)}_innerSubscribe(r){const{hasError:i,isStopped:s,observers:o}=this;return i||s?ZC:(this.currentObservers=null,o.push(r),new vt(()=>{this.currentObservers=null,Vd(o,r)}))}_checkFinalizedStatuses(r){const{hasError:i,thrownError:s,isStopped:o}=this;i?r.error(s):o&&r.complete()}asObservable(){const r=new Ht;return r.source=this,r}}return e.create=(t,r)=>new eD(t,r),e})();class eD extends Ze{constructor(t,r){super(),this.destination=t,this.source=r}next(t){var r,i;null===(i=null===(r=this.destination)||void 0===r?void 0:r.next)||void 0===i||i.call(r,t)}error(t){var r,i;null===(i=null===(r=this.destination)||void 0===r?void 0:r.error)||void 0===i||i.call(r,t)}complete(){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===r||r.call(t)}_subscribe(t){var r,i;return null!==(i=null===(r=this.source)||void 0===r?void 0:r.subscribe(t))&&void 0!==i?i:ZC}}class Ln extends Ze{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){const r=super._subscribe(t);return!r.closed&&t.next(this._value),r}getValue(){const{hasError:t,thrownError:r,_value:i}=this;if(t)throw r;return this._throwIfClosed(),i}next(t){super.next(this._value=t)}}function tD(e){return at(e?.lift)}function zt(e){return t=>{if(tD(t))return t.lift(function(r){try{return e(r,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function Dt(e,t,r,i,s){return new L3(e,t,r,i,s)}class L3 extends bm{constructor(t,r,i,s,o,a){super(t),this.onFinalize=o,this.shouldUnsubscribe=a,this._next=r?function(c){try{r(c)}catch(l){t.error(l)}}:super._next,this._error=s?function(c){try{s(c)}catch(l){t.error(l)}finally{this.unsubscribe()}}:super._error,this._complete=i?function(){try{i()}catch(c){t.error(c)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:r}=this;super.unsubscribe(),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}}}function Ue(e,t){return zt((r,i)=>{let s=0;r.subscribe(Dt(i,o=>{i.next(e.call(t,o,s++))}))})}const nD="https://g.co/ng/security#xss";class A extends Error{constructor(t,r){super(function Qo(e,t){return`NG0${Math.abs(e)}${t?": "+t:""}`}(t,r)),this.code=t}}function wi(e){return{toString:e}.toString()}const Jo="__parameters__";function ea(e,t,r){return wi(()=>{const i=function Tm(e){return function(...r){if(e){const i=e(...r);for(const s in i)this[s]=i[s]}}}(t);function s(...o){if(this instanceof s)return i.apply(this,o),this;const a=new s(...o);return c.annotation=a,c;function c(l,u,d){const f=l.hasOwnProperty(Jo)?l[Jo]:Object.defineProperty(l,Jo,{value:[]})[Jo];for(;f.length<=d;)f.push(null);return(f[d]=f[d]||[]).push(a),l}}return r&&(s.prototype=Object.create(r.prototype)),s.prototype.ngMetadataName=e,s.annotationCls=s,s})}const ct=globalThis;function He(e){for(let t in e)if(e[t]===He)return t;throw Error("Could not find renamed property on target object.")}function F3(e,t){for(const r in t)t.hasOwnProperty(r)&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Rt(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(Rt).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return`${e.overriddenName}`;if(e.name)return`${e.name}`;const t=e.toString();if(null==t)return""+t;const r=t.indexOf("\n");return-1===r?t:t.substring(0,r)}function Im(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}const B3=He({__forward_ref__:He});function et(e){return e.__forward_ref__=et,e.toString=function(){return Rt(this())},e}function ie(e){return zd(e)?e():e}function zd(e){return"function"==typeof e&&e.hasOwnProperty(B3)&&e.__forward_ref__===et}function j(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function St(e){return{providers:e.providers||[],imports:e.imports||[]}}function qd(e){return oD(e,Wd)||oD(e,aD)}function oD(e,t){return e.hasOwnProperty(t)?e[t]:null}function Gd(e){return e&&(e.hasOwnProperty(xm)||e.hasOwnProperty(z3))?e[xm]:null}const Wd=He({\u0275prov:He}),xm=He({\u0275inj:He}),aD=He({ngInjectableDef:He}),z3=He({ngInjectorDef:He});class q{constructor(t,r){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof r?this.__NG_ELEMENT_ID__=r:void 0!==r&&(this.\u0275prov=j({token:this,providedIn:r.providedIn||"root",factory:r.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}function Om(e){return e&&!!e.\u0275providers}const Qc=He({\u0275cmp:He}),km=He({\u0275dir:He}),Pm=He({\u0275pipe:He}),lD=He({\u0275mod:He}),bi=He({\u0275fac:He}),Yc=He({__NG_ELEMENT_ID__:He}),uD=He({__NG_ENV_ID__:He});function pe(e){return"string"==typeof e?e:null==e?"":String(e)}function Lm(e,t){throw new A(-201,!1)}var Te=function(e){return e[e.Default=0]="Default",e[e.Host=1]="Host",e[e.Self=2]="Self",e[e.SkipSelf=4]="SkipSelf",e[e.Optional=8]="Optional",e}(Te||{});let Fm;function dD(){return Fm}function Sn(e){const t=Fm;return Fm=e,t}function fD(e,t,r){const i=qd(e);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:r&Te.Optional?null:void 0!==t?t:void Lm()}const Jc={},Bm="__NG_DI_FLAG__",Zd="ngTempTokenPath",Q3=/\n/gm,hD="__source";let ta;function Xi(e){const t=ta;return ta=e,t}function X3(e,t=Te.Default){if(void 0===ta)throw new A(-203,!1);return null===ta?fD(e,void 0,t):ta.get(e,t&Te.Optional?null:void 0,t)}function z(e,t=Te.Default){return(dD()||X3)(ie(e),t)}function O(e,t=Te.Default){return z(e,Kd(t))}function Kd(e){return typeof e>"u"||"number"==typeof e?e:(e.optional&&8)|(e.host&&1)|(e.self&&2)|(e.skipSelf&&4)}function Vm(e){const t=[];for(let r=0;rArray.isArray(r)?na(r,t):t(r))}function gD(e,t,r){t>=e.length?e.push(r):e.splice(t,0,r)}function Jd(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}function Vn(e,t,r){let i=ra(e,t);return i>=0?e[1|i]=r:(i=~i,function mD(e,t,r,i){let s=e.length;if(s==t)e.push(r,i);else if(1===s)e.push(i,e[0]),e[0]=r;else{for(s--,e.push(e[s-1],e[s]);s>t;)e[s]=e[s-2],s--;e[t]=r,e[t+1]=i}}(e,i,t,r)),i}function jm(e,t){const r=ra(e,t);if(r>=0)return e[1|r]}function ra(e,t){return function yD(e,t,r){let i=0,s=e.length>>r;for(;s!==i;){const o=i+(s-i>>1),a=e[o<t?s=o:i=o+1}return~(s<t){a=o-1;break}}}for(;o-1){let o;for(;++so?"":s[d+1].toLowerCase(),2&i&&u!==f){if(yr(i))return!1;a=!0}}}}else{if(!a&&!yr(i)&&!yr(l))return!1;if(a&&yr(l))continue;a=!1,i=l|1&i}}return yr(i)||a}function yr(e){return!(1&e)}function dB(e,t,r,i){if(null===t)return-1;let s=0;if(i||!r){let o=!1;for(;s-1)for(r++;r0?'="'+c+'"':"")+"]"}else 8&i?s+="."+a:4&i&&(s+=" "+a);else""!==s&&!yr(a)&&(t+=DD(o,s),s=""),i=a,o=o||!yr(i);r++}return""!==s&&(t+=DD(o,s)),t}function ts(e){return wi(()=>{const t=TD(e),r={...t,decls:e.decls,vars:e.vars,template:e.template,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,onPush:e.changeDetection===tf.OnPush,directiveDefs:null,pipeDefs:null,dependencies:t.standalone&&e.dependencies||null,getStandaloneInjector:null,signals:e.signals??!1,data:e.data||{},encapsulation:e.encapsulation||mr.Emulated,styles:e.styles||ke,_:null,schemas:e.schemas||null,tView:null,id:""};ID(r);const i=e.dependencies;return r.directiveDefs=nf(i,!1),r.pipeDefs=nf(i,!0),r.id=function EB(e){let t=0;const r=[e.selectors,e.ngContentSelectors,e.hostVars,e.hostAttrs,e.consts,e.vars,e.decls,e.encapsulation,e.standalone,e.signals,e.exportAs,JSON.stringify(e.inputs),JSON.stringify(e.outputs),Object.getOwnPropertyNames(e.type.prototype),!!e.contentQueries,!!e.viewQuery].join("|");for(const s of r)t=Math.imul(31,t)+s.charCodeAt(0)|0;return t+=2147483648,"c"+t}(r),r})}function _B(e){return De(e)||kt(e)}function wB(e){return null!==e}function Ot(e){return wi(()=>({type:e.type,bootstrap:e.bootstrap||ke,declarations:e.declarations||ke,imports:e.imports||ke,exports:e.exports||ke,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null}))}function SD(e,t){if(null==e)return Vr;const r={};for(const i in e)if(e.hasOwnProperty(i)){const s=e[i];let o,a,c=es.None;Array.isArray(s)?(c=s[0],o=s[1],a=s[2]??o):(o=s,a=s),t?(r[o]=c!==es.None?[i,c]:i,t[o]=a):r[o]=i}return r}function de(e){return wi(()=>{const t=TD(e);return ID(t),t})}function fn(e){return{type:e.type,name:e.name,factory:null,pure:!1!==e.pure,standalone:!0===e.standalone,onDestroy:e.type.prototype.ngOnDestroy||null}}function De(e){return e[Qc]||null}function kt(e){return e[km]||null}function Wt(e){return e[Pm]||null}function nn(e,t){const r=e[lD]||null;if(!r&&!0===t)throw new Error(`Type ${Rt(e)} does not have '\u0275mod' property.`);return r}function TD(e){const t={};return{type:e.type,providersResolver:null,factory:null,hostBindings:e.hostBindings||null,hostVars:e.hostVars||0,hostAttrs:e.hostAttrs||null,contentQueries:e.contentQueries||null,declaredInputs:t,inputTransforms:null,inputConfig:e.inputs||Vr,exportAs:e.exportAs||null,standalone:!0===e.standalone,signals:!0===e.signals,selectors:e.selectors||ke,viewQuery:e.viewQuery||null,features:e.features||null,setInput:null,findHostDirectiveDefs:null,hostDirectives:null,inputs:SD(e.inputs,t),outputs:SD(e.outputs),debugInfo:null}}function ID(e){e.features?.forEach(t=>t(e))}function nf(e,t){if(!e)return null;const r=t?Wt:_B;return()=>("function"==typeof e?e():e).map(i=>r(i)).filter(wB)}function CB(...e){return{\u0275providers:qm(0,e),\u0275fromNgModule:!0}}function qm(e,...t){const r=[],i=new Set;let s;const o=a=>{r.push(a)};return na(t,a=>{const c=a;rf(c,o,[],i)&&(s||=[],s.push(c))}),void 0!==s&&xD(s,o),r}function xD(e,t){for(let r=0;r{t(o,i)})}}function rf(e,t,r,i){if(!(e=ie(e)))return!1;let s=null,o=Gd(e);const a=!o&&De(e);if(o||a){if(a&&!a.standalone)return!1;s=e}else{const l=e.ngModule;if(o=Gd(l),!o)return!1;s=l}const c=i.has(s);if(a){if(c)return!1;if(i.add(s),a.dependencies){const l="function"==typeof a.dependencies?a.dependencies():a.dependencies;for(const u of l)rf(u,t,r,i)}}else{if(!o)return!1;{if(null!=o.imports&&!c){let u;i.add(s);try{na(o.imports,d=>{rf(d,t,r,i)&&(u||=[],u.push(d))})}finally{}void 0!==u&&xD(u,t)}if(!c){const u=Ks(s)||(()=>new s);t({provide:s,useFactory:u,deps:ke},s),t({provide:$m,useValue:s,multi:!0},s),t({provide:Ur,useValue:()=>z(s),multi:!0},s)}const l=o.providers;if(null!=l&&!c){const u=e;Gm(l,d=>{t(d,u)})}}}return s!==e&&void 0!==e.providers}function Gm(e,t){for(let r of e)Om(r)&&(r=r.\u0275providers),Array.isArray(r)?Gm(r,t):t(r)}const DB=He({provide:String,useValue:He});function Wm(e){return null!==e&&"object"==typeof e&&DB in e}function Qs(e){return"function"==typeof e}const Zm=new q(""),sf={},TB={};let Km;function af(){return void 0===Km&&(Km=new ef),Km}class In{}class ia extends In{get destroyed(){return this._destroyed}constructor(t,r,i,s){super(),this.parent=r,this.source=i,this.scopes=s,this.records=new Map,this._ngOnDestroyHooks=new Set,this._onDestroyHooks=[],this._destroyed=!1,Ym(t,a=>this.processProvider(a)),this.records.set(vD,sa(void 0,this)),s.has("environment")&&this.records.set(In,sa(void 0,this));const o=this.records.get(Zm);null!=o&&"string"==typeof o.value&&this.scopes.add(o.value),this.injectorDefTypes=new Set(this.get($m,ke,Te.Self))}destroy(){this.assertNotDestroyed(),this._destroyed=!0;const t=_e(null);try{for(const i of this._ngOnDestroyHooks)i.ngOnDestroy();const r=this._onDestroyHooks;this._onDestroyHooks=[];for(const i of r)i()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),_e(t)}}onDestroy(t){return this.assertNotDestroyed(),this._onDestroyHooks.push(t),()=>this.removeOnDestroy(t)}runInContext(t){this.assertNotDestroyed();const r=Xi(this),i=Sn(void 0);try{return t()}finally{Xi(r),Sn(i)}}get(t,r=Jc,i=Te.Default){if(this.assertNotDestroyed(),t.hasOwnProperty(uD))return t[uD](this);i=Kd(i);const o=Xi(this),a=Sn(void 0);try{if(!(i&Te.SkipSelf)){let l=this.records.get(t);if(void 0===l){const u=function NB(e){return"function"==typeof e||"object"==typeof e&&e instanceof q}(t)&&qd(t);l=u&&this.injectableDefInScope(u)?sa(Qm(t),sf):null,this.records.set(t,l)}if(null!=l)return this.hydrate(t,l)}return(i&Te.Self?af():this.parent).get(t,r=i&Te.Optional&&r===Jc?null:r)}catch(c){if("NullInjectorError"===c.name){if((c[Zd]=c[Zd]||[]).unshift(Rt(t)),o)throw c;return function tB(e,t,r,i){const s=e[Zd];throw t[hD]&&s.unshift(t[hD]),e.message=function nB(e,t,r,i=null){e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.slice(2):e;let s=Rt(t);if(Array.isArray(t))s=t.map(Rt).join(" -> ");else if("object"==typeof t){let o=[];for(let a in t)if(t.hasOwnProperty(a)){let c=t[a];o.push(a+":"+("string"==typeof c?JSON.stringify(c):Rt(c)))}s=`{${o.join(", ")}}`}return`${r}${i?"("+i+")":""}[${s}]: ${e.replace(Q3,"\n ")}`}("\n"+e.message,s,r,i),e.ngTokenPath=s,e[Zd]=null,e}(c,t,"R3InjectorError",this.source)}throw c}finally{Sn(a),Xi(o)}}resolveInjectorInitializers(){const t=_e(null),r=Xi(this),i=Sn(void 0);try{const o=this.get(Ur,ke,Te.Self);for(const a of o)a()}finally{Xi(r),Sn(i),_e(t)}}toString(){const t=[],r=this.records;for(const i of r.keys())t.push(Rt(i));return`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new A(205,!1)}processProvider(t){let r=Qs(t=ie(t))?t:ie(t&&t.provide);const i=function xB(e){return Wm(e)?sa(void 0,e.useValue):sa(ND(e),sf)}(t);if(!Qs(t)&&!0===t.multi){let s=this.records.get(r);s||(s=sa(void 0,sf,!0),s.factory=()=>Vm(s.multi),this.records.set(r,s)),r=t,s.multi.push(t)}this.records.set(r,i)}hydrate(t,r){const i=_e(null);try{return r.value===sf&&(r.value=TB,r.value=r.factory()),"object"==typeof r.value&&r.value&&function MB(e){return null!==e&&"object"==typeof e&&"function"==typeof e.ngOnDestroy}(r.value)&&this._ngOnDestroyHooks.add(r.value),r.value}finally{_e(i)}}injectableDefInScope(t){if(!t.providedIn)return!1;const r=ie(t.providedIn);return"string"==typeof r?"any"===r||this.scopes.has(r):this.injectorDefTypes.has(r)}removeOnDestroy(t){const r=this._onDestroyHooks.indexOf(t);-1!==r&&this._onDestroyHooks.splice(r,1)}}function Qm(e){const t=qd(e),r=null!==t?t.factory:Ks(e);if(null!==r)return r;if(e instanceof q)throw new A(204,!1);if(e instanceof Function)return function IB(e){if(e.length>0)throw new A(204,!1);const r=function H3(e){return e&&(e[Wd]||e[aD])||null}(e);return null!==r?()=>r.factory(e):()=>new e}(e);throw new A(204,!1)}function ND(e,t,r){let i;if(Qs(e)){const s=ie(e);return Ks(s)||Qm(s)}if(Wm(e))i=()=>ie(e.useValue);else if(function MD(e){return!(!e||!e.useFactory)}(e))i=()=>e.useFactory(...Vm(e.deps||[]));else if(function AD(e){return!(!e||!e.useExisting)}(e))i=()=>z(ie(e.useExisting));else{const s=ie(e&&(e.useClass||e.provide));if(!function AB(e){return!!e.deps}(e))return Ks(s)||Qm(s);i=()=>new s(...Vm(e.deps))}return i}function sa(e,t,r=!1){return{factory:e,value:t,multi:r?[]:void 0}}function Ym(e,t){for(const r of e)Array.isArray(r)?Ym(r,t):r&&Om(r)?Ym(r.\u0275providers,t):t(r)}function Ei(e,t){e instanceof ia&&e.assertNotDestroyed();const i=Xi(e),s=Sn(void 0);try{return t()}finally{Xi(i),Sn(s)}}function RD(){return void 0!==dD()||null!=function J3(){return ta}()}const lt=0,F=1,ne=2,Tt=3,vr=4,Zt=5,hn=6,aa=7,tt=8,It=9,jr=10,se=11,rl=12,kD=13,ca=14,ut=15,Ys=16,la=17,Ci=18,ua=19,PD=20,rs=21,lf=22,Xn=23,Y=25,ey=1,$r=7,da=9,_t=10;var df=function(e){return e[e.None=0]="None",e[e.HasTransplantedViews=2]="HasTransplantedViews",e}(df||{});function Lt(e){return Array.isArray(e)&&"object"==typeof e[ey]}function rn(e){return Array.isArray(e)&&!0===e[ey]}function ty(e){return!!(4&e.flags)}function Js(e){return e.componentOffset>-1}function ff(e){return!(1&~e.flags)}function _r(e){return!!e.template}function sl(e){return!!(512&e[ne])}class HB{constructor(t,r,i){this.previousValue=t,this.currentValue=r,this.firstChange=i}isFirstChange(){return this.firstChange}}function UD(e,t,r,i){null!==t?t.applyValueToInputSignal(t,i):e[r]=i}function er(){return jD}function jD(e){return e.type.prototype.ngOnChanges&&(e.setInput=qB),zB}function zB(){const e=HD(this),t=e?.current;if(t){const r=e.previous;if(r===Vr)e.previous=t;else for(let i in t)r[i]=t[i];e.current=null,this.ngOnChanges(t)}}function qB(e,t,r,i,s){const o=this.declaredInputs[i],a=HD(e)||function GB(e,t){return e[$D]=t}(e,{previous:Vr,current:null}),c=a.current||(a.current={}),l=a.previous,u=l[o];c[o]=new HB(u&&u.currentValue,r,l===Vr),UD(e,t,s,r)}er.ngInherit=!0;const $D="__ngSimpleChanges__";function HD(e){return e[$D]||null}const Hr=function(e,t,r){},zD="svg";function Pe(e){for(;Array.isArray(e);)e=e[lt];return e}function ol(e,t){return Pe(t[e])}function pn(e,t){return Pe(t[e.index])}function al(e,t){return e.data[t]}function Xs(e,t){return e[t]}function Un(e,t){const r=t[e];return Lt(r)?r:r[lt]}function oy(e){return!(128&~e[ne])}function tr(e,t){return null==t?null:e[t]}function GD(e){e[la]=0}function WD(e){1024&e[ne]||(e[ne]|=1024,oy(e)&&pf(e))}function hf(e){return!!(9216&e[ne]||e[Xn]?.dirty)}function ay(e){e[jr].changeDetectionScheduler?.notify(8),64&e[ne]&&(e[ne]|=1024),hf(e)&&pf(e)}function pf(e){e[jr].changeDetectionScheduler?.notify(0);let t=Di(e);for(;null!==t&&!(8192&t[ne])&&(t[ne]|=8192,oy(t));)t=Di(t)}function gf(e,t){if(!(256&~e[ne]))throw new A(911,!1);null===e[rs]&&(e[rs]=[]),e[rs].push(t)}function Di(e){const t=e[Tt];return rn(t)?t[Tt]:t}const oe={lFrame:oS(null),bindingsEnabled:!0,skipHydrationRootTNode:null};let KD=!1;function QD(){return oe.bindingsEnabled}function N(){return oe.lFrame.lView}function we(){return oe.lFrame.tView}function Kt(e){return oe.lFrame.contextLView=e,e[tt]}function Qt(e){return oe.lFrame.contextLView=null,e}function ze(){let e=YD();for(;null!==e&&64===e.type;)e=e.parent;return e}function YD(){return oe.lFrame.currentTNode}function wr(e,t){const r=oe.lFrame;r.currentTNode=e,r.isParent=t}function uy(){return oe.lFrame.isParent}function dy(){oe.lFrame.isParent=!1}function eS(){return KD}function tS(e){KD=e}function br(){return oe.lFrame.bindingIndex++}function Ti(e){const t=oe.lFrame,r=t.bindingIndex;return t.bindingIndex=t.bindingIndex+e,r}function oV(e,t){const r=oe.lFrame;r.bindingIndex=r.bindingRootIndex=e,fy(t)}function fy(e){oe.lFrame.currentDirectiveIndex=e}function hy(e){const t=oe.lFrame.currentDirectiveIndex;return-1===t?null:e[t]}function py(){return oe.lFrame.currentQueryIndex}function yf(e){oe.lFrame.currentQueryIndex=e}function cV(e){const t=e[F];return 2===t.type?t.declTNode:1===t.type?e[Zt]:null}function iS(e,t,r){if(r&Te.SkipSelf){let s=t,o=e;for(;!(s=s.parent,null!==s||r&Te.Host||(s=cV(o),null===s||(o=o[ca],10&s.type))););if(null===s)return!1;t=s,e=o}const i=oe.lFrame=sS();return i.currentTNode=t,i.lView=e,!0}function gy(e){const t=sS(),r=e[F];oe.lFrame=t,t.currentTNode=r.firstChild,t.lView=e,t.tView=r,t.contextLView=e,t.bindingIndex=r.bindingStartIndex,t.inI18n=!1}function sS(){const e=oe.lFrame,t=null===e?null:e.child;return null===t?oS(e):t}function oS(e){const t={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:e,child:null,inI18n:!1};return null!==e&&(e.child=t),t}function aS(){const e=oe.lFrame;return oe.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}const cS=aS;function my(){const e=aS();e.isParent=!0,e.tView=null,e.selectedIndex=-1,e.contextLView=null,e.elementDepthCount=0,e.currentDirectiveIndex=-1,e.currentNamespace=null,e.bindingRootIndex=-1,e.bindingIndex=-1,e.currentQueryIndex=0}function Yt(){return oe.lFrame.selectedIndex}function to(e){oe.lFrame.selectedIndex=e}function nt(){const e=oe.lFrame;return al(e.tView,e.selectedIndex)}function vf(){oe.lFrame.currentNamespace=zD}function _f(){!function dV(){oe.lFrame.currentNamespace=null}()}let uS=!0;function ll(){return uS}function zr(e){uS=e}function wf(e,t){for(let r=t.directiveStart,i=t.directiveEnd;r=i)break}else t[l]<0&&(e[la]+=65536),(c>14>16&&(3&e[ne])===t&&(e[ne]+=16384,fS(c,o)):fS(c,o)}const fa=-1;class ul{constructor(t,r,i){this.factory=t,this.resolving=!1,this.canSeeViewProviders=r,this.injectImpl=i}}const _y={};class no{constructor(t,r){this.injector=t,this.parentInjector=r}get(t,r,i){i=Kd(i);const s=this.injector.get(t,_y,i);return s!==_y||r===_y?s:this.parentInjector.get(t,r,i)}}function wy(e){return e!==fa}function dl(e){return 32767&e}function fl(e,t){let r=function vV(e){return e>>16}(e),i=t;for(;r>0;)i=i[ca],r--;return i}let by=!0;function Cf(e){const t=by;return by=e,t}const pS=255,gS=5;let wV=0;const qr={};function Df(e,t){const r=mS(e,t);if(-1!==r)return r;const i=t[F];i.firstCreatePass&&(e.injectorIndex=t.length,Ey(i.data,e),Ey(t,null),Ey(i.blueprint,null));const s=Sf(e,t),o=e.injectorIndex;if(wy(s)){const a=dl(s),c=fl(s,t),l=c[F].data;for(let u=0;u<8;u++)t[o+u]=c[a+u]|l[a+u]}return t[o+8]=s,o}function Ey(e,t){e.push(0,0,0,0,0,0,0,0,t)}function mS(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:e.injectorIndex}function Sf(e,t){if(e.parent&&-1!==e.parent.injectorIndex)return e.parent.injectorIndex;let r=0,i=null,s=t;for(;null!==s;){if(i=CS(s),null===i)return fa;if(r++,s=s[ca],-1!==i.injectorIndex)return i.injectorIndex|r<<16}return fa}function Cy(e,t,r){!function bV(e,t,r){let i;"string"==typeof r?i=r.charCodeAt(0)||0:r.hasOwnProperty(Yc)&&(i=r[Yc]),null==i&&(i=r[Yc]=wV++);const s=i&pS;t.data[e+(s>>gS)]|=1<=0?t&pS:SV:t}(r);if("function"==typeof o){if(!iS(t,e,i))return i&Te.Host?yS(s,0,i):vS(t,r,i,s);try{let a;if(a=o(i),null!=a||i&Te.Optional)return a;Lm()}finally{cS()}}else if("number"==typeof o){let a=null,c=mS(e,t),l=fa,u=i&Te.Host?t[ut][Zt]:null;for((-1===c||i&Te.SkipSelf)&&(l=-1===c?Sf(e,t):t[c+8],l!==fa&&ES(i,!1)?(a=t[F],c=dl(l),t=fl(l,t)):c=-1);-1!==c;){const d=t[F];if(bS(o,c,d.data)){const f=CV(c,t,r,a,i,u);if(f!==qr)return f}l=t[c+8],l!==fa&&ES(i,t[F].data[c+8]===u)&&bS(o,c,t)?(a=d,c=dl(l),t=fl(l,t)):c=-1}}return s}function CV(e,t,r,i,s,o){const a=t[F],c=a.data[e+8],d=Tf(c,a,r,null==i?Js(c)&&by:i!=a&&!!(3&c.type),s&Te.Host&&o===c);return null!==d?ro(t,a,d,c):qr}function Tf(e,t,r,i,s){const o=e.providerIndexes,a=t.data,c=1048575&o,l=e.directiveStart,d=o>>20,h=s?c+d:e.directiveEnd;for(let p=i?c:c+d;p=l&&g.type===r)return p}if(s){const p=a[l];if(p&&_r(p)&&p.type===r)return l}return null}function ro(e,t,r,i){let s=e[r];const o=t.data;if(function pV(e){return e instanceof ul}(s)){const a=s;a.resolving&&function W3(e,t){throw t&&t.join(" > "),new A(-200,e)}(function Fe(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():pe(e)}(o[r]));const c=Cf(a.canSeeViewProviders);a.resolving=!0;const u=a.injectImpl?Sn(a.injectImpl):null;iS(e,i,Te.Default);try{s=e[r]=a.factory(void 0,o,e,i),t.firstCreatePass&&r>=i.directiveStart&&function fV(e,t,r){const{ngOnChanges:i,ngOnInit:s,ngDoCheck:o}=t.type.prototype;if(i){const a=jD(t);(r.preOrderHooks??=[]).push(e,a),(r.preOrderCheckHooks??=[]).push(e,a)}s&&(r.preOrderHooks??=[]).push(0-e,s),o&&((r.preOrderHooks??=[]).push(e,o),(r.preOrderCheckHooks??=[]).push(e,o))}(r,o[r],t)}finally{null!==u&&Sn(u),Cf(c),a.resolving=!1,cS()}}return s}function bS(e,t,r){return!!(r[t+(e>>gS)]&1<{const t=e.prototype.constructor,r=t[bi]||Dy(t),i=Object.prototype;let s=Object.getPrototypeOf(e.prototype).constructor;for(;s&&s!==i;){const o=s[bi]||Dy(s);if(o&&o!==r)return o;s=Object.getPrototypeOf(s)}return o=>new o})}function Dy(e){return zd(e)?()=>{const t=Dy(ie(e));return t&&t()}:Ks(e)}function CS(e){const t=e[F],r=t.type;return 2===r?t.declTNode:1===r?e[Zt]:null}function xS(e,t=null,r=null,i){const s=AS(e,t,r,i);return s.resolveInjectorInitializers(),s}function AS(e,t=null,r=null,i,s=new Set){const o=[r||ke,CB(e)];return i=i||("object"==typeof e?void 0:Rt(e)),new ia(o,t||af(),i||null,s)}class xt{static{this.THROW_IF_NOT_FOUND=Jc}static{this.NULL=new ef}static create(t,r){if(Array.isArray(t))return xS({name:""},r,t,"");{const i=t.name??"";return xS({name:i},t.parent,t.providers,i)}}static{this.\u0275prov=j({token:xt,providedIn:"any",factory:()=>z(vD)})}static{this.__NG_ELEMENT_ID__=-1}}new q("").__NG_ELEMENT_ID__=e=>{const t=ze();if(null===t)throw new A(204,!1);if(2&t.type)return t.value;if(e&Te.Optional)return null;throw new A(204,!1)};function Ty(e){return e.ngOriginalError}const NS=!0;let pl=(()=>{class e{static{this.__NG_ELEMENT_ID__=LV}static{this.__NG_ENV_ID__=r=>r}}return e})();class PV extends pl{constructor(t){super(),this._lView=t}onDestroy(t){return gf(this._lView,t),()=>function cy(e,t){if(null===e[rs])return;const r=e[rs].indexOf(t);-1!==r&&e[rs].splice(r,1)}(this._lView,t)}}function LV(){return new PV(N())}let io=(()=>{class e{constructor(){this.taskId=0,this.pendingTasks=new Set,this.hasPendingTasks=new Ln(!1)}get _hasPendingTasks(){return this.hasPendingTasks.value}add(){this._hasPendingTasks||this.hasPendingTasks.next(!0);const r=this.taskId++;return this.pendingTasks.add(r),r}remove(r){this.pendingTasks.delete(r),0===this.pendingTasks.size&&this._hasPendingTasks&&this.hasPendingTasks.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this._hasPendingTasks&&this.hasPendingTasks.next(!1)}static{this.\u0275prov=j({token:e,providedIn:"root",factory:()=>new e})}}return e})();const dt=class FV extends Ze{constructor(t=!1){super(),this.destroyRef=void 0,this.pendingTasks=void 0,this.__isAsync=t,RD()&&(this.destroyRef=O(pl,{optional:!0})??void 0,this.pendingTasks=O(io,{optional:!0})??void 0)}emit(t){const r=_e(null);try{super.next(t)}finally{_e(r)}}subscribe(t,r,i){let s=t,o=r||(()=>null),a=i;if(t&&"object"==typeof t){const l=t;s=l.next?.bind(l),o=l.error?.bind(l),a=l.complete?.bind(l)}this.__isAsync&&(o=this.wrapInTimeout(o),s&&(s=this.wrapInTimeout(s)),a&&(a=this.wrapInTimeout(a)));const c=super.subscribe({next:s,error:o,complete:a});return t instanceof vt&&t.add(c),c}wrapInTimeout(t){return r=>{const i=this.pendingTasks?.add();setTimeout(()=>{t(r),void 0!==i&&this.pendingTasks?.remove(i)})}}};function xf(...e){}function RS(e){let t,r;function i(){e=xf;try{void 0!==r&&"function"==typeof cancelAnimationFrame&&cancelAnimationFrame(r),void 0!==t&&clearTimeout(t)}catch{}}return t=setTimeout(()=>{e(),i()}),"function"==typeof requestAnimationFrame&&(r=requestAnimationFrame(()=>{e(),i()})),()=>i()}function OS(e){return queueMicrotask(()=>e()),()=>{e=xf}}const Iy="isAngularZone",Af=Iy+"_ID";let BV=0;class Ne{constructor(t){this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new dt(!1),this.onMicrotaskEmpty=new dt(!1),this.onStable=new dt(!1),this.onError=new dt(!1);const{enableLongStackTrace:r=!1,shouldCoalesceEventChangeDetection:i=!1,shouldCoalesceRunChangeDetection:s=!1,scheduleInRootZone:o=NS}=t;if(typeof Zone>"u")throw new A(908,!1);Zone.assertZonePatched();const a=this;a._nesting=0,a._outer=a._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(a._inner=a._inner.fork(new Zone.TaskTrackingZoneSpec)),r&&Zone.longStackTraceZoneSpec&&(a._inner=a._inner.fork(Zone.longStackTraceZoneSpec)),a.shouldCoalesceEventChangeDetection=!s&&i,a.shouldCoalesceRunChangeDetection=s,a.callbackScheduled=!1,a.scheduleInRootZone=o,function jV(e){const t=()=>{!function UV(e){function t(){RS(()=>{e.callbackScheduled=!1,Ay(e),e.isCheckStableRunning=!0,xy(e),e.isCheckStableRunning=!1})}e.isCheckStableRunning||e.callbackScheduled||(e.callbackScheduled=!0,e.scheduleInRootZone?Zone.root.run(()=>{t()}):e._outer.run(()=>{t()}),Ay(e))}(e)},r=BV++;e._inner=e._inner.fork({name:"angular",properties:{[Iy]:!0,[Af]:r,[Af+r]:!0},onInvokeTask:(i,s,o,a,c,l)=>{if(function $V(e){return LS(e,"__ignore_ng_zone__")}(l))return i.invokeTask(o,a,c,l);try{return kS(e),i.invokeTask(o,a,c,l)}finally{(e.shouldCoalesceEventChangeDetection&&"eventTask"===a.type||e.shouldCoalesceRunChangeDetection)&&t(),PS(e)}},onInvoke:(i,s,o,a,c,l,u)=>{try{return kS(e),i.invoke(o,a,c,l,u)}finally{e.shouldCoalesceRunChangeDetection&&!e.callbackScheduled&&!function HV(e){return LS(e,"__scheduler_tick__")}(l)&&t(),PS(e)}},onHasTask:(i,s,o,a)=>{i.hasTask(o,a),s===o&&("microTask"==a.change?(e._hasPendingMicrotasks=a.microTask,Ay(e),xy(e)):"macroTask"==a.change&&(e.hasPendingMacrotasks=a.macroTask))},onHandleError:(i,s,o,a)=>(i.handleError(o,a),e.runOutsideAngular(()=>e.onError.emit(a)),!1)})}(a)}static isInAngularZone(){return typeof Zone<"u"&&!0===Zone.current.get(Iy)}static assertInAngularZone(){if(!Ne.isInAngularZone())throw new A(909,!1)}static assertNotInAngularZone(){if(Ne.isInAngularZone())throw new A(909,!1)}run(t,r,i){return this._inner.run(t,r,i)}runTask(t,r,i,s){const o=this._inner,a=o.scheduleEventTask("NgZoneEvent: "+s,t,VV,xf,xf);try{return o.runTask(a,r,i)}finally{o.cancelTask(a)}}runGuarded(t,r,i){return this._inner.runGuarded(t,r,i)}runOutsideAngular(t){return this._outer.run(t)}}const VV={};function xy(e){if(0==e._nesting&&!e.hasPendingMicrotasks&&!e.isStable)try{e._nesting++,e.onMicrotaskEmpty.emit(null)}finally{if(e._nesting--,!e.hasPendingMicrotasks)try{e.runOutsideAngular(()=>e.onStable.emit(null))}finally{e.isStable=!0}}}function Ay(e){e.hasPendingMicrotasks=!!(e._hasPendingMicrotasks||(e.shouldCoalesceEventChangeDetection||e.shouldCoalesceRunChangeDetection)&&!0===e.callbackScheduled)}function kS(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function PS(e){e._nesting--,xy(e)}class My{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new dt,this.onMicrotaskEmpty=new dt,this.onStable=new dt,this.onError=new dt}run(t,r,i){return t.apply(r,i)}runGuarded(t,r,i){return t.apply(r,i)}runOutsideAngular(t){return t()}runTask(t,r,i,s){return t.apply(r,i)}}function LS(e,t){return!(!Array.isArray(e)||1!==e.length)&&!0===e[0]?.data?.[t]}class nr{constructor(){this._console=console}handleError(t){const r=this._findOriginalError(t);this._console.error("ERROR",t),r&&this._console.error("ORIGINAL ERROR",r)}_findOriginalError(t){let r=t&&Ty(t);for(;r&&Ty(r);)r=Ty(r);return r||null}}const qV=new q("",{providedIn:"root",factory:()=>{const e=O(Ne),t=O(nr);return r=>e.runOutsideAngular(()=>t.handleError(r))}});function GV(){return ga(ze(),N())}function ga(e,t){return new jn(pn(e,t))}let jn=(()=>{class e{constructor(r){this.nativeElement=r}static{this.__NG_ELEMENT_ID__=GV}}return e})();function BS(e){return e instanceof jn?e.nativeElement:e}function WV(){return this._results[Symbol.iterator]()}class Ny{get changes(){return this._changes??=new dt}constructor(t=!1){this._emitDistinctChangesOnly=t,this.dirty=!0,this._onDirty=void 0,this._results=[],this._changesDetected=!1,this._changes=void 0,this.length=0,this.first=void 0,this.last=void 0;const r=Ny.prototype;r[Symbol.iterator]||(r[Symbol.iterator]=WV)}get(t){return this._results[t]}map(t){return this._results.map(t)}filter(t){return this._results.filter(t)}find(t){return this._results.find(t)}reduce(t,r){return this._results.reduce(t,r)}forEach(t){this._results.forEach(t)}some(t){return this._results.some(t)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(t,r){this.dirty=!1;const i=function Tn(e){return e.flat(Number.POSITIVE_INFINITY)}(t);(this._changesDetected=!function oB(e,t,r){if(e.length!==t.length)return!1;for(let i=0;ip8}),p8="ng",iT=new q(""),ss=new q("",{providedIn:"platform",factory:()=>"unknown"}),sT=new q(""),oT=new q("",{providedIn:"root",factory:()=>is().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});let aT=()=>null;function Hy(e,t,r=!1){return aT(e,t,r)}const gT=new q("",{providedIn:"root",factory:()=>!1});let Bf,Vf;function wa(e){return function Zy(){if(void 0===Bf&&(Bf=null,ct.trustedTypes))try{Bf=ct.trustedTypes.createPolicy("angular",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})}catch{}return Bf}()?.createHTML(e)||e}function vT(e){return function Ky(){if(void 0===Vf&&(Vf=null,ct.trustedTypes))try{Vf=ct.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})}catch{}return Vf}()?.createHTML(e)||e}class oo{constructor(t){this.changingThisBreaksApplicationSecurity=t}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${nD})`}}class x8 extends oo{getTypeName(){return"HTML"}}class A8 extends oo{getTypeName(){return"Style"}}class M8 extends oo{getTypeName(){return"Script"}}class N8 extends oo{getTypeName(){return"URL"}}class R8 extends oo{getTypeName(){return"ResourceURL"}}function $n(e){return e instanceof oo?e.changingThisBreaksApplicationSecurity:e}function Gr(e,t){const r=function O8(e){return e instanceof oo&&e.getTypeName()||null}(e);if(null!=r&&r!==t){if("ResourceURL"===r&&"URL"===t)return!0;throw new Error(`Required a safe ${t}, got a ${r} (see ${nD})`)}return r===t}class V8{constructor(t){this.inertDocumentHelper=t}getInertBodyElement(t){t=""+t;try{const r=(new window.DOMParser).parseFromString(wa(t),"text/html").body;return null===r?this.inertDocumentHelper.getInertBodyElement(t):(r.firstChild?.remove(),r)}catch{return null}}}class U8{constructor(t){this.defaultDoc=t,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert")}getInertBodyElement(t){const r=this.inertDocument.createElement("template");return r.innerHTML=wa(t),r}}const $8=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function Uf(e){return(e=String(e)).match($8)?e:"unsafe:"+e}function Ii(e){const t={};for(const r of e.split(","))t[r]=!0;return t}function Cl(...e){const t={};for(const r of e)for(const i in r)r.hasOwnProperty(i)&&(t[i]=!0);return t}const ET=Ii("area,br,col,hr,img,wbr"),CT=Ii("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),DT=Ii("rp,rt"),Qy=Cl(ET,Cl(CT,Ii("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),Cl(DT,Ii("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),Cl(DT,CT)),Yy=Ii("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),ST=Cl(Yy,Ii("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),Ii("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),H8=Ii("script,style,template");class z8{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(t){let r=t.firstChild,i=!0,s=[];for(;r;)if(r.nodeType===Node.ELEMENT_NODE?i=this.startElement(r):r.nodeType===Node.TEXT_NODE?this.chars(r.nodeValue):this.sanitizedSomething=!0,i&&r.firstChild)s.push(r),r=W8(r);else for(;r;){r.nodeType===Node.ELEMENT_NODE&&this.endElement(r);let o=G8(r);if(o){r=o;break}r=s.pop()}return this.buf.join("")}startElement(t){const r=TT(t).toLowerCase();if(!Qy.hasOwnProperty(r))return this.sanitizedSomething=!0,!H8.hasOwnProperty(r);this.buf.push("<"),this.buf.push(r);const i=t.attributes;for(let s=0;s"),!0}endElement(t){const r=TT(t).toLowerCase();Qy.hasOwnProperty(r)&&!ET.hasOwnProperty(r)&&(this.buf.push(""))}chars(t){this.buf.push(xT(t))}}function G8(e){const t=e.nextSibling;if(t&&e!==t.previousSibling)throw IT(t);return t}function W8(e){const t=e.firstChild;if(t&&function q8(e,t){return(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)!==Node.DOCUMENT_POSITION_CONTAINED_BY}(e,t))throw IT(t);return t}function TT(e){const t=e.nodeName;return"string"==typeof t?t:"FORM"}function IT(e){return new Error(`Failed to sanitize html because the element is clobbered: ${e.outerHTML}`)}const Z8=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,K8=/([^\#-~ |!])/g;function xT(e){return e.replace(/&/g,"&").replace(Z8,function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"}).replace(K8,function(t){return"&#"+t.charCodeAt(0)+";"}).replace(//g,">")}let jf;function AT(e,t){let r=null;try{jf=jf||function bT(e){const t=new U8(e);return function j8(){try{return!!(new window.DOMParser).parseFromString(wa(""),"text/html")}catch{return!1}}()?new V8(t):t}(e);let i=t?String(t):"";r=jf.getInertBodyElement(i);let s=5,o=i;do{if(0===s)throw new Error("Failed to sanitize html because the input is unstable");s--,i=o,o=r.innerHTML,r=jf.getInertBodyElement(i)}while(i!==o);return wa((new z8).sanitizeChildren(Jy(r)||r))}finally{if(r){const i=Jy(r)||r;for(;i.firstChild;)i.firstChild.remove()}}}function Jy(e){return"content"in e&&function Q8(e){return e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.nodeName}(e)?e.content:null}var Hn=function(e){return e[e.NONE=0]="NONE",e[e.HTML=1]="HTML",e[e.STYLE=2]="STYLE",e[e.SCRIPT=3]="SCRIPT",e[e.URL=4]="URL",e[e.RESOURCE_URL=5]="RESOURCE_URL",e}(Hn||{});function Xy(e){const t=function Dl(){const e=N();return e&&e[jr].sanitizer}();return t?vT(t.sanitize(Hn.HTML,e)||""):Gr(e,"HTML")?vT($n(e)):AT(is(),pe(e))}const nU=/^>|^->||--!>|)/g,iU="\u200b$1\u200b";function FT(e){return e.ownerDocument.defaultView}function zn(e){return e instanceof Function?e():e}var os=function(e){return e[e.Important=1]="Important",e[e.DashCase=2]="DashCase",e}(os||{});let nv;function rv(e,t){return nv(e,t)}function Ea(e,t,r,i,s){if(null!=i){let o,a=!1;rn(i)?o=i:Lt(i)&&(a=!0,i=i[lt]);const c=Pe(i);0===e&&null!==r?null==s?GT(t,r,c):ao(t,r,c,s||null,!0):1===e&&null!==r?ao(t,r,c,s||null,!0):2===e?function Tl(e,t,r){e.removeChild(null,t,r)}(t,c,a):3===e&&t.destroyNode(c),null!=o&&function CU(e,t,r,i,s){const o=r[$r];o!==Pe(r)&&Ea(t,e,i,o,s);for(let c=_t;ct.replace(rU,iU))}(t))}function zf(e,t,r){return e.createElement(t,r)}function HT(e,t){t[jr].changeDetectionScheduler?.notify(9),Wf(e,t,t[se],2,null,null)}function zT(e,t){const r=e[da],i=t[Tt];(Lt(i)||t[ut]!==i[Tt][ut])&&(e[ne]|=df.HasTransplantedViews),null===r?e[da]=[t]:r.push(t)}function ov(e,t){const r=e[da],i=r.indexOf(t);r.splice(i,1)}function Sl(e,t){if(e.length<=_t)return;const r=_t+t,i=e[r];if(i){const s=i[Ys];null!==s&&s!==e&&ov(s,i),t>0&&(e[r-1][vr]=i[vr]);const o=Jd(e,_t+t);!function gU(e,t){HT(e,t),t[lt]=null,t[Zt]=null}(i[F],i);const a=o[Ci];null!==a&&a.detachView(o[F]),i[Tt]=null,i[vr]=null,i[ne]&=-129}return i}function qf(e,t){if(!(256&t[ne])){const r=t[se];r.destroyNode&&Wf(e,t,r,3,null,null),function yU(e){let t=e[rl];if(!t)return av(e[F],e);for(;t;){let r=null;if(Lt(t))r=t[rl];else{const i=t[_t];i&&(r=i)}if(!r){for(;t&&!t[vr]&&t!==e;)Lt(t)&&av(t[F],t),t=t[Tt];null===t&&(t=e),Lt(t)&&av(t[F],t),r=t&&t[vr]}t=r}}(t)}}function av(e,t){if(256&t[ne])return;const r=_e(null);try{t[ne]&=-129,t[ne]|=256,t[Xn]&&gm(t[Xn]),function wU(e,t){let r;if(null!=e&&null!=(r=e.destroyHooks))for(let i=0;i=0?i[a]():i[-a].unsubscribe(),o+=2}else r[o].call(i[r[o+1]]);null!==i&&(t[aa]=null);const s=t[rs];if(null!==s){t[rs]=null;for(let o=0;o-1){const{encapsulation:o}=e.data[i.directiveStart+s];if(o===mr.None||o===mr.Emulated)return null}return pn(i,r)}}(e,t.parent,r)}function ao(e,t,r,i,s){e.insertBefore(t,r,i,s)}function GT(e,t,r){e.appendChild(t,r)}function WT(e,t,r,i,s){null!==i?ao(e,t,r,i,s):GT(e,t,r)}function lv(e,t){return e.parentNode(t)}let uv,QT=function KT(e,t,r){return 40&e.type?pn(e,r):null};function Gf(e,t,r,i){const s=cv(e,i,t),o=t[se],c=function ZT(e,t,r){return QT(e,t,r)}(i.parent||t[Zt],i,t);if(null!=s)if(Array.isArray(r))for(let l=0;lY&&rI(e,t,Y,!1),Hr(a?2:0,s),r(i,s)}finally{to(o),Hr(a?3:1,s)}}function pv(e,t,r){if(ty(t)){const i=_e(null);try{const o=t.directiveEnd;for(let a=t.directiveStart;anull;function lI(e,t,r,i,s){for(let o in t){if(!t.hasOwnProperty(o))continue;const a=t[o];if(void 0===a)continue;i??={};let c,l=es.None;Array.isArray(a)?(c=a[0],l=a[1]):c=a;let u=o;if(null!==s){if(!s.hasOwnProperty(o))continue;u=s[o]}0===e?uI(i,r,u,c,l):uI(i,r,u,c)}return i}function uI(e,t,r,i,s){let o;e.hasOwnProperty(r)?(o=e[r]).push(t,i):o=e[r]=[t,i],void 0!==s&&o.push(s)}function An(e,t,r,i,s,o,a,c){const l=pn(t,r);let d,u=t.inputs;!c&&null!=u&&(d=u[i])?(Ev(e,r,d,i,s),Js(t)&&function LU(e,t){const r=Un(t,e);16&r[ne]||(r[ne]|=64)}(r,t.index)):3&t.type&&(i=function PU(e){return"class"===e?"className":"for"===e?"htmlFor":"formaction"===e?"formAction":"innerHtml"===e?"innerHTML":"readonly"===e?"readOnly":"tabindex"===e?"tabIndex":e}(i),s=null!=a?a(s,t.value||"",i):s,o.setProperty(l,i,s))}function vv(e,t,r,i){if(QD()){const s=null===i?null:{"":-1},o=function $U(e,t){const r=e.directiveRegistry;let i=null,s=null;if(r)for(let o=0;o0;){const r=e[--t];if("number"==typeof r&&r<0)return r}return 0})(a)!=c&&a.push(c),a.push(r,i,o)}}(e,t,i,Il(e,r,s.hostVars,ge),s)}function Wr(e,t,r,i,s,o){const a=pn(e,t);!function wv(e,t,r,i,s,o,a){if(null==o)e.removeAttribute(t,s,r);else{const c=null==a?pe(o):a(o,i||"",s);e.setAttribute(t,s,c,r)}}(t[se],a,o,e.value,r,i,s)}function ZU(e,t,r,i,s,o){const a=o[t];if(null!==a)for(let c=0;c{pf(e.lView)},consumerOnSignalRead(){this.lView[Xn]=this}},i4={...Rd,consumerIsAlwaysLive:!0,consumerMarkedDirty:e=>{let t=Di(e.lView);for(;t&&!bI(t[F]);)t=Di(t);t&&WD(t)},consumerOnSignalRead(){this.lView[Xn]=this}};function bI(e){return 2!==e.type}const s4=100;function Yf(e,t=!0,r=0){const i=e[jr],s=i.rendererFactory;s.begin?.();try{!function o4(e,t){const r=eS();try{tS(!0),Sv(e,t);let i=0;for(;hf(e);){if(i===s4)throw new A(103,!1);i++,Sv(e,1)}}finally{tS(r)}}(e,r)}catch(a){throw t&&Qf(e,a),a}finally{s.end?.(),i.inlineEffectRunner?.flush()}}function a4(e,t,r,i){const s=t[ne];if(!(256&~s))return;t[jr].inlineEffectRunner?.flush(),gy(t);let c=!0,l=null,u=null;bI(e)?(u=function XU(e){return e[Xn]??function e4(e){const t=wI.pop()??Object.create(n4);return t.lView=e,t}(e)}(t),l=Od(u)):null===function LC(){return Nt}()?(c=!1,u=function r4(e){const t=e[Xn]??Object.create(i4);return t.lView=e,t}(t),l=Od(u)):t[Xn]&&(gm(t[Xn]),t[Xn]=null);try{GD(t),function nS(e){return oe.lFrame.bindingIndex=e}(e.bindingStartIndex),null!==r&&oI(e,t,r,2,i);const d=!(3&~s);if(d){const p=e.preOrderCheckHooks;null!==p&&bf(t,p,null)}else{const p=e.preOrderHooks;null!==p&&Ef(t,p,0,null),yy(t,0)}if(function c4(e){for(let t=ZS(e);null!==t;t=KS(t)){if(!(t[ne]&df.HasTransplantedViews))continue;const r=t[da];for(let i=0;i-1&&(Sl(t,i),Jd(r,i))}this._attachedToViewContainer=!1}qf(this._lView[F],this._lView)}onDestroy(t){gf(this._lView,t)}markForCheck(){Al(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[ne]&=-129}reattach(){ay(this._lView),this._lView[ne]|=128}detectChanges(){this._lView[ne]|=1024,Yf(this._lView,this.notifyErrorHandler)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new A(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;const t=sl(this._lView),r=this._lView[Ys];null!==r&&!t&&ov(r,this._lView),HT(this._lView[F],this._lView)}attachToAppRef(t){if(this._attachedToViewContainer)throw new A(902,!1);this._appRef=t;const r=sl(this._lView),i=this._lView[Ys];null!==i&&!r&&zT(i,this._lView),ay(this._lView)}}let Ai=(()=>{class e{static{this.__NG_ELEMENT_ID__=f4}}return e})();const u4=Ai,d4=class extends u4{constructor(t,r,i){super(),this._declarationLView=t,this._declarationTContainer=r,this.elementRef=i}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(t,r){return this.createEmbeddedViewImpl(t,r)}createEmbeddedViewImpl(t,r,i){const s=function Ca(e,t,r,i){const s=_e(null);try{const o=t.tView,l=Zf(e,o,r,4096&e[ne]?4096:16,null,t,null,null,i?.injector??null,i?.embeddedViewInjector??null,i?.dehydratedView??null);l[Ys]=e[t.index];const d=e[Ci];return null!==d&&(l[Ci]=d.createEmbeddedView(o)),Cv(o,l,r),l}finally{_e(s)}}(this._declarationLView,this._declarationTContainer,t,{embeddedViewInjector:r,dehydratedView:i});return new Ml(s)}};function f4(){return Jf(ze(),N())}function Jf(e,t){return 4&e.type?new d4(t,e,ga(e,t)):null}class Ta{}const Bl=new q("",{providedIn:"root",factory:()=>!1}),WI=new q(""),Lv=new q("");class ij{}class ZI{}class oj{resolveComponentFactory(t){throw function sj(e){const t=Error(`No component factory found for ${Rt(e)}.`);return t.ngComponent=e,t}(t)}}class Vl{static{this.NULL=new oj}}class ih{}let cj=(()=>{class e{static{this.\u0275prov=j({token:e,providedIn:"root",factory:()=>null})}}return e})();function oh(e,t,r){let i=r?e.styles:null,s=r?e.classes:null,o=0;if(null!==t)for(let a=0;a0&&tI(e,r,o.join(" "))}}(h,C,g,i),void 0!==r&&function vj(e,t,r){const i=e.projection=[];for(let s=0;s{class e{static{this.__NG_ELEMENT_ID__=wj}}return e})();function wj(){return n1(ze(),N())}const bj=rr,e1=class extends bj{constructor(t,r,i){super(),this._lContainer=t,this._hostTNode=r,this._hostLView=i}get element(){return ga(this._hostTNode,this._hostLView)}get injector(){return new Ft(this._hostTNode,this._hostLView)}get parentInjector(){const t=Sf(this._hostTNode,this._hostLView);if(wy(t)){const r=fl(t,this._hostLView),i=dl(t);return new Ft(r[F].data[i+8],r)}return new Ft(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const r=t1(this._lContainer);return null!==r&&r[t]||null}get length(){return this._lContainer.length-_t}createEmbeddedView(t,r,i){let s,o;"number"==typeof i?s=i:null!=i&&(s=i.index,o=i.injector);const c=t.createEmbeddedViewImpl(r||{},o,null);return this.insertImpl(c,s,uo(this._hostTNode,null)),c}createComponent(t,r,i,s,o){const a=t&&!function nl(e){return"function"==typeof e}(t);let c;if(a)c=r;else{const g=r||{};c=g.index,i=g.injector,s=g.projectableNodes,o=g.environmentInjector||g.ngModuleRef}const l=a?t:new $l(De(t)),u=i||this.parentInjector;if(!o&&null==l.ngModule){const m=(a?u:this.parentInjector).get(In,null);m&&(o=m)}De(l.componentType??{});const p=l.create(u,s,null,o);return this.insertImpl(p.hostView,c,uo(this._hostTNode,null)),p}insert(t,r){return this.insertImpl(t,r,!0)}insertImpl(t,r,i){const s=t._lView;if(function QB(e){return rn(e[Tt])}(s)){const c=this.indexOf(t);if(-1!==c)this.detach(c);else{const l=s[Tt],u=new e1(l,l[Zt],l[Tt]);u.detach(u.indexOf(t))}}const o=this._adjustIndex(r),a=this._lContainer;return function Da(e,t,r,i=!0){const s=t[F];if(function vU(e,t,r,i){const s=_t+i,o=r.length;i>0&&(r[s-1][vr]=t),i!1;class jv{constructor(t){this.queryList=t,this.matches=null}clone(){return new jv(this.queryList)}setDirty(){this.queryList.setDirty()}}class $v{constructor(t=[]){this.queries=t}createEmbeddedView(t){const r=t.queries;if(null!==r){const i=null!==t.contentQueries?t.contentQueries[0]:r.length,s=[];for(let o=0;ot.trim())}(t):t}}class Hv{constructor(t=[]){this.queries=t}elementStart(t,r){for(let i=0;i0)i.push(a[c/2]);else{const u=o[c+1],d=t[-l];for(let f=_t;f(fm(t),t.value);return r[gr]=t,r}(e),i=r[gr];return t?.equal&&(i.equal=t.equal),r.set=s=>GC(i,s),r.update=s=>function w3(e,t){VC()||qC(),GC(e,t(e.value))}(i,s),r.asReadonly=g1.bind(r),r}function g1(){const e=this[gr];if(void 0===e.readonlyFn){const t=()=>this();t[gr]=e,e.readonlyFn=t}return e.readonlyFn}function je(e){let t=function I1(e){return Object.getPrototypeOf(e.prototype).constructor}(e.type),r=!0;const i=[e];for(;t;){let s;if(_r(e))s=t.\u0275cmp||t.\u0275dir;else{if(t.\u0275cmp)throw new A(903,!1);s=t.\u0275dir}if(s){if(r){i.push(s);const a=e;a.inputs=ch(e.inputs),a.inputTransforms=ch(e.inputTransforms),a.declaredInputs=ch(e.declaredInputs),a.outputs=ch(e.outputs);const c=s.hostBindings;c&&qj(e,c);const l=s.viewQuery,u=s.contentQueries;if(l&&Hj(e,l),u&&zj(e,u),jj(e,s),F3(e.outputs,s.outputs),_r(s)&&s.data.animation){const d=e.data;d.animation=(d.animation||[]).concat(s.data.animation)}}const o=s.features;if(o)for(let a=0;a=0;i--){const s=e[i];s.hostVars=t+=s.hostVars,s.hostAttrs=el(s.hostAttrs,r=el(r,s.hostAttrs))}}(i)}function jj(e,t){for(const r in t.inputs){if(!t.inputs.hasOwnProperty(r)||e.inputs.hasOwnProperty(r))continue;const i=t.inputs[r];if(void 0!==i&&(e.inputs[r]=i,e.declaredInputs[r]=t.declaredInputs[r],null!==t.inputTransforms)){const s=Array.isArray(i)?i[0]:i;if(!t.inputTransforms.hasOwnProperty(s))continue;e.inputTransforms??={},e.inputTransforms[s]=t.inputTransforms[s]}}}function ch(e){return e===Vr?{}:e===ke?[]:e}function Hj(e,t){const r=e.viewQuery;e.viewQuery=r?(i,s)=>{t(i,s),r(i,s)}:t}function zj(e,t){const r=e.contentQueries;e.contentQueries=r?(i,s,o)=>{t(i,s,o),r(i,s,o)}:t}function qj(e,t){const r=e.hostBindings;e.hostBindings=r?(i,s)=>{t(i,s),r(i,s)}:t}class po{}class O1{}class Qv extends po{constructor(t,r,i,s=!0){super(),this.ngModuleType=t,this._parent=r,this._bootstrapComponents=[],this.destroyCbs=[],this.componentFactoryResolver=new JI(this);const o=nn(t);this._bootstrapComponents=zn(o.bootstrap),this._r3Injector=AS(t,r,[{provide:po,useValue:this},{provide:Vl,useValue:this.componentFactoryResolver},...i],Rt(t),new Set(["environment"])),s&&this.resolveInjectorInitializers()}resolveInjectorInitializers(){this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(this.ngModuleType)}get injector(){return this._r3Injector}destroy(){const t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(r=>r()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class Yv extends O1{constructor(t){super(),this.moduleType=t}create(t){return new Qv(this.moduleType,t,[])}}class k1 extends po{constructor(t){super(),this.componentFactoryResolver=new JI(this),this.instance=null;const r=new ia([...t.providers,{provide:po,useValue:this},{provide:Vl,useValue:this.componentFactoryResolver}],t.parent||af(),t.debugName,new Set(["environment"]));this.injector=r,t.runEnvironmentInitializers&&r.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(t){this.injector.onDestroy(t)}}function lh(e,t,r=null){return new k1({providers:e,parent:t,debugName:r,runEnvironmentInitializers:!0}).injector}function uh(e){return!!function Jv(e){return null!==e&&("function"==typeof e||"object"==typeof e)}(e)&&(Array.isArray(e)||!(e instanceof Map)&&Symbol.iterator in e)}function wt(e,t,r){return!Object.is(e[t],r)&&(e[t]=r,!0)}function ql(e,t,r,i,s,o,a,c,l,u){const d=r+Y,f=t.firstCreatePass?function r6(e,t,r,i,s,o,a,c,l){const u=t.consts,d=lo(t,e,4,a||null,c||null);vv(t,r,d,tr(u,l)),wf(t,d);const f=d.tView=yv(2,d,i,s,o,t.directiveRegistry,t.pipeRegistry,null,t.schemas,u,null);return null!==t.queries&&(t.queries.template(t,d),f.queries=t.queries.embeddedTView(d)),d}(d,t,e,i,s,o,a,c,l):t.data[d];wr(f,!1);const h=P1(t,e,f,r);ll()&&Gf(t,e,h,f),sn(h,e);const p=hI(h,e,h,f);return e[d]=p,Kf(e,p),function i1(e,t,r){return Uv(e,t,r)}(p,f,e),ff(f)&&gv(t,e,f),null!=l&&mv(e,f,u),f}function sr(e,t,r,i,s,o,a,c){const l=N(),u=we();return ql(l,u,e,t,r,i,s,tr(u.consts,o),a,c),sr}let P1=function L1(e,t,r,i){return zr(!0),t[se].createComment("")};var Ma=function(e){return e[e.EarlyRead=0]="EarlyRead",e[e.Write=1]="Write",e[e.MixedReadWrite=2]="MixedReadWrite",e[e.Read=3]="Read",e}(Ma||{});let $1=(()=>{class e{constructor(){this.impl=null}execute(){this.impl?.execute()}static{this.\u0275prov=j({token:e,providedIn:"root",factory:()=>new e})}}return e})();class Zl{constructor(){this.ngZone=O(Ne),this.scheduler=O(Ta),this.errorHandler=O(nr,{optional:!0}),this.sequences=new Set,this.deferredRegistrations=new Set,this.executing=!1}static{this.PHASES=[Ma.EarlyRead,Ma.Write,Ma.MixedReadWrite,Ma.Read]}execute(){this.executing=!0;for(const t of Zl.PHASES)for(const r of this.sequences)if(!r.erroredOrDestroyed&&r.hooks[t])try{r.pipelinedValue=this.ngZone.runOutsideAngular(()=>r.hooks[t](r.pipelinedValue))}catch(i){r.erroredOrDestroyed=!0,this.errorHandler?.handleError(i)}this.executing=!1;for(const t of this.sequences)t.afterRun(),t.once&&(this.sequences.delete(t),t.destroy());for(const t of this.deferredRegistrations)this.sequences.add(t);this.deferredRegistrations.size>0&&this.scheduler.notify(7),this.deferredRegistrations.clear()}register(t){this.executing?this.deferredRegistrations.add(t):(this.sequences.add(t),this.scheduler.notify(6))}unregister(t){this.executing&&this.sequences.has(t)?(t.erroredOrDestroyed=!0,t.pipelinedValue=void 0,t.once=!0):(this.sequences.delete(t),this.deferredRegistrations.delete(t))}static{this.\u0275prov=j({token:Zl,providedIn:"root",factory:()=>new Zl})}}class a6{constructor(t,r,i,s){this.impl=t,this.hooks=r,this.once=i,this.erroredOrDestroyed=!1,this.pipelinedValue=void 0,this.unregisterOnDestroy=s?.onDestroy(()=>this.destroy())}afterRun(){this.erroredOrDestroyed=!1,this.pipelinedValue=void 0}destroy(){this.impl.unregister(this),this.unregisterOnDestroy?.()}}function gh(e,t){!t?.injector&&function Jm(e){if(!RD())throw new A(-203,!1)}();const r=t?.injector??O(xt);return function qn(e){return"browser"===(e??O(xt)).get(ss)}(r)?(mn("NgAfterNextRender"),function H1(e,t,r,i){const s=t.get($1);s.impl??=t.get(Zl);const o=r?.phase??Ma.MixedReadWrite,a=!0!==r?.manualCleanup?t.get(pl):null,c=new a6(s.impl,function l6(e,t){if(e instanceof Function){const r=[void 0,void 0,void 0,void 0];return r[t]=e,r}return[e.earlyRead,e.write,e.mixedReadWrite,e.read]}(e,o),i,a);return s.impl.register(c),c}(e,r,t,!0)):z1}const z1={destroy(){}};function on(e,t,r,i){const s=N();return wt(s,br(),t)&&(we(),Wr(nt(),s,e,t,r,i)),on}function vh(e,t){return e<<17|t<<2}function us(e){return e>>17&32767}function u0(e){return 2|e}function yo(e){return(131068&e)>>2}function d0(e,t){return-131069&e|t<<2}function f0(e){return 1|e}function mx(e,t,r,i){const s=e[r+1],o=null===t;let a=i?us(s):yo(s),c=!1;for(;0!==a&&(!1===c||o);){const u=e[a+1];q6(e[a],t)&&(c=!0,e[a+1]=i?f0(u):u0(u)),a=i?us(u):yo(u)}c&&(e[r+1]=i?u0(s):f0(s))}function q6(e,t){return null===e||null==t||(Array.isArray(e)?e[1]:e)===t||!(!Array.isArray(e)||"string"!=typeof t)&&ra(e,t)>=0}const Bt={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function yx(e){return e.substring(Bt.key,Bt.keyEnd)}function vx(e,t){const r=Bt.textEnd;return r===t?-1:(t=Bt.keyEnd=function K6(e,t,r){for(;t32;)t++;return t}(e,Bt.key=t,r),qa(e,t,r))}function qa(e,t,r){for(;t=0;r=vx(t,r))Vn(e,yx(t),!0)}function Er(e,t,r,i){const s=N(),o=we(),a=Ti(2);o.firstUpdatePass&&Dx(o,e,a,i),t!==ge&&wt(s,a,t)&&Tx(o,o.data[Yt()],s,s[se],e,s[a+1]=function o$(e,t){return null==e||""===e||("string"==typeof t?e+=t:"object"==typeof e&&(e=Rt($n(e)))),e}(t,r),i,a)}function Cx(e,t){return t>=e.expandoStartIndex}function Dx(e,t,r,i){const s=e.data;if(null===s[r+1]){const o=s[Yt()],a=Cx(e,r);xx(o,i)&&null===t&&!a&&(t=!1),t=function X6(e,t,r,i){const s=hy(e);let o=i?t.residualClasses:t.residualStyles;if(null===s)0===(i?t.classBindings:t.styleBindings)&&(r=Yl(r=p0(null,e,t,r,i),t.attrs,i),o=null);else{const a=t.directiveStylingLast;if(-1===a||e[a]!==s)if(r=p0(s,e,t,r,i),null===o){let l=function e$(e,t,r){const i=r?t.classBindings:t.styleBindings;if(0!==yo(i))return e[us(i)]}(e,t,i);void 0!==l&&Array.isArray(l)&&(l=p0(null,e,t,l[1],i),l=Yl(l,t.attrs,i),function t$(e,t,r,i){e[us(r?t.classBindings:t.styleBindings)]=i}(e,t,i,l))}else o=function n$(e,t,r){let i;const s=t.directiveEnd;for(let o=1+t.directiveStylingLast;o0)&&(u=!0)):d=r,s)if(0!==l){const h=us(e[c+1]);e[i+1]=vh(h,c),0!==h&&(e[h+1]=d0(e[h+1],i)),e[c+1]=function j6(e,t){return 131071&e|t<<17}(e[c+1],i)}else e[i+1]=vh(c,0),0!==c&&(e[c+1]=d0(e[c+1],i)),c=i;else e[i+1]=vh(l,0),0===c?c=i:e[l+1]=d0(e[l+1],i),l=i;u&&(e[i+1]=u0(e[i+1])),mx(e,d,i,!0),mx(e,d,i,!1),function z6(e,t,r,i,s){const o=s?e.residualClasses:e.residualStyles;null!=o&&"string"==typeof t&&ra(o,t)>=0&&(r[i+1]=f0(r[i+1]))}(t,d,e,i,o),a=vh(c,l),o?t.classBindings=a:t.styleBindings=a}(s,o,t,r,a,i)}}function p0(e,t,r,i,s){let o=null;const a=r.directiveEnd;let c=r.directiveStylingLast;for(-1===c?c=r.directiveStart:c++;c0;){const l=e[s],u=Array.isArray(l),d=u?l[1]:l,f=null===d;let h=r[s+1];h===ge&&(h=f?ke:void 0);let p=f?jm(h,i):d===i?h:void 0;if(u&&!_h(p)&&(p=jm(l,i)),_h(p)&&(c=p,a))return c;const g=e[s+1];s=a?us(g):yo(g)}if(null!==t){let l=o?t.residualClasses:t.residualStyles;null!=l&&(c=jm(l,i))}return c}function _h(e){return void 0!==e}function xx(e,t){return!!(e.flags&(t?8:16))}function fe(e,t,r,i){const s=N(),o=we(),a=Y+e,c=s[se],l=o.firstCreatePass?function A$(e,t,r,i,s,o){const a=t.consts,l=lo(t,e,2,i,tr(a,s));return vv(t,r,l,tr(a,o)),null!==l.attrs&&oh(l,l.attrs,!1),null!==l.mergedAttrs&&oh(l,l.mergedAttrs,!0),null!==t.queries&&t.queries.elementStart(t,l),l}(a,o,s,t,r,i):o.data[a],u=Rx(o,s,l,c,t,e);s[a]=u;const d=ff(l);return wr(l,!0),nI(c,u,l),!function xa(e){return!(32&~e.flags)}(l)&&ll()&&Gf(o,s,u,l),0===function YB(){return oe.lFrame.elementDepthCount}()&&sn(u,s),function JB(){oe.lFrame.elementDepthCount++}(),d&&(gv(o,s,l),pv(o,l,s)),null!==i&&mv(s,l),fe}function me(){let e=ze();uy()?dy():(e=e.parent,wr(e,!1));const t=e;(function eV(e){return oe.skipHydrationRootTNode===e})(t)&&function iV(){oe.skipHydrationRootTNode=null}(),function XB(){oe.lFrame.elementDepthCount--}();const r=we();return r.firstCreatePass&&(wf(r,e),ty(e)&&r.queries.elementEnd(e)),null!=t.classesWithoutHost&&function mV(e){return!!(8&e.flags)}(t)&&h0(r,t,N(),t.classesWithoutHost,!0),null!=t.stylesWithoutHost&&function yV(e){return!!(16&e.flags)}(t)&&h0(r,t,N(),t.stylesWithoutHost,!1),me}function or(e,t,r,i){return fe(e,t,r,i),me(),or}let Rx=(e,t,r,i,s,o)=>(zr(!0),zf(i,s,function lS(){return oe.lFrame.currentNamespace}()));function Ga(e,t,r){const i=N(),s=we(),o=e+Y,a=s.firstCreatePass?function R$(e,t,r,i,s){const o=t.consts,a=tr(o,i),c=lo(t,e,8,"ng-container",a);return null!==a&&oh(c,a,!0),vv(t,r,c,tr(o,s)),null!==t.queries&&t.queries.elementStart(t,c),c}(o,s,i,t,r):s.data[o];wr(a,!0);const c=kx(s,i,a,e);return i[o]=c,ll()&&Gf(s,i,c,a),sn(c,i),ff(a)&&(gv(s,i,a),pv(s,a,i)),null!=r&&mv(i,a),Ga}function Wa(){let e=ze();const t=we();return uy()?dy():(e=e.parent,wr(e,!1)),t.firstCreatePass&&(wf(t,e),ty(e)&&t.queries.elementEnd(e)),Wa}let kx=(e,t,r,i)=>(zr(!0),sv(t[se],""));function Jr(){return N()}function v0(e,t,r){const i=N();if(wt(i,br(),t)){const o=we(),a=nt();An(o,a,i,e,t,yI(hy(o.data),a,i),r,!0)}return v0}const bh="en-US";let Bx=bh,nA=(e,t,r)=>{};function $e(e,t,r,i){const s=N(),o=we(),a=ze();return function b0(e,t,r,i,s,o,a){const c=ff(i),u=e.firstCreatePass&&mI(e),d=t[tt],f=gI(t);let h=!0;if(3&i.type||a){const m=pn(i,t),y=a?a(m):m,_=f.length,v=a?b=>a(Pe(b[i.index])):i.index;let w=null;if(!a&&c&&(w=function S5(e,t,r,i){const s=e.cleanup;if(null!=s)for(let o=0;ol?c[l]:null}"string"==typeof a&&(o+=2)}return null}(e,t,s,i.index)),null!==w)(w.__ngLastListenerFn__||w).__ngNextListenerFn__=o,w.__ngLastListenerFn__=o,h=!1;else{o=oA(i,t,d,o),nA(m,s,o);const b=r.listen(y,s,o);f.push(o,b),u&&u.push(s,v,_,_+1)}}else o=oA(i,t,d,o);const p=i.outputs;let g;if(h&&null!==p&&(g=p[s])){const m=g.length;if(m)for(let y=0;y-1?Un(e.index,t):t,5);let c=sA(t,r,i,o),l=s.__ngNextListenerFn__;for(;l;)c=sA(t,r,l,o)&&c,l=l.__ngNextListenerFn__;return c}}function Ct(e=1){return function lV(e){return(oe.lFrame.contextLView=function ZD(e,t){for(;e>0;)t=t[ca],e--;return t}(e,oe.lFrame.contextLView))[tt]}(e)}function C0(e,t,r){l1(e,t,r)}function Sh(e){const t=N(),r=we(),i=py();yf(i+1);const s=Wv(r,i);if(e.dirty&&function KB(e){return!(4&~e[ne])}(t)===!(2&~s.metadata.flags)){if(null===s.matches)e.reset([]);else{const o=f1(t,i);e.reset(o,BS),e.notifyOnChanges()}return!0}return!1}function Th(){return function Gv(e,t){return e[Ci].queries[t].queryList}(N(),py())}function Ka(e){return Xs(function JD(){return oe.lFrame.contextLView}(),Y+e)}function Le(e,t=""){const r=N(),i=we(),s=e+Y,o=i.firstCreatePass?lo(i,s,1,t,null):i.data[s],a=TA(i,r,o,t,e);r[s]=a,ll()&&Gf(i,r,a,o),wr(o,!1)}let TA=(e,t,r,i,s)=>(zr(!0),function iv(e,t){return e.createText(t)}(t[se],i));function Qa(e){return Xr("",e,""),Qa}function Xr(e,t,r){const i=N(),s=function Fa(e,t,r,i){return wt(e,br(),r)?t+pe(r)+i:ge}(i,e,t,r);return s!==ge&&function xi(e,t,r){const i=ol(t,e);!function $T(e,t,r){e.setValue(t,r)}(e[se],i,r)}(i,Yt(),s),Xr}function S0(e,t,r,i,s){if(e=ie(e),Array.isArray(e))for(let o=0;o>20;if(Qs(e)||!e.multi){const p=new ul(u,s,k),g=I0(l,t,s?d:d+h,f);-1===g?(Cy(Df(c,a),o,l),T0(o,e,t.length),t.push(l),c.directiveStart++,c.directiveEnd++,s&&(c.providerIndexes+=1048576),r.push(p),a.push(p)):(r[g]=p,a[g]=p)}else{const p=I0(l,t,d+h,f),g=I0(l,t,d,d+h),y=g>=0&&r[g];if(s&&!y||!s&&!(p>=0&&r[p])){Cy(Df(c,a),o,l);const _=function Q5(e,t,r,i,s){const o=new ul(e,r,k);return o.multi=[],o.index=t,o.componentProviders=0,VA(o,s,i&&!r),o}(s?K5:Z5,r.length,s,i,u);!s&&y&&(r[g].providerFactory=_),T0(o,e,t.length,0),t.push(l),c.directiveStart++,c.directiveEnd++,s&&(c.providerIndexes+=1048576),r.push(_),a.push(_)}else T0(o,e,p>-1?p:g,VA(r[s?g:p],u,!s&&i));!s&&i&&y&&r[g].componentProviders++}}}function T0(e,t,r,i){const s=Qs(t),o=function SB(e){return!!e.useClass}(t);if(s||o){const l=(o?ie(t.useClass):t).prototype.ngOnDestroy;if(l){const u=e.destroyHooks||(e.destroyHooks=[]);if(!s&&t.multi){const d=u.indexOf(r);-1===d?u.push(r,[i,l]):u[d+1].push(i,l)}else u.push(r,l)}}}function VA(e,t,r){return r&&e.componentProviders++,e.multi.push(t)-1}function I0(e,t,r,i){for(let s=r;s{r.providersResolver=(i,s)=>function W5(e,t,r){const i=we();if(i.firstCreatePass){const s=_r(e);S0(r,i.data,i.blueprint,s,!0),S0(t,i.data,i.blueprint,s,!1)}}(i,s?s(e):e,t)}}let Y5=(()=>{class e{constructor(r){this._injector=r,this.cachedInjectors=new Map}getOrCreateStandaloneInjector(r){if(!r.standalone)return null;if(!this.cachedInjectors.has(r)){const i=qm(0,r.type),s=i.length>0?lh([i],this._injector,`Standalone[${r.type.name}]`):null;this.cachedInjectors.set(r,s)}return this.cachedInjectors.get(r)}ngOnDestroy(){try{for(const r of this.cachedInjectors.values())null!==r&&r.destroy()}finally{this.cachedInjectors.clear()}}static{this.\u0275prov=j({token:e,providedIn:"environment",factory:()=>new e(z(In))})}}return e})();function Ih(e){mn("NgStandalone"),e.getStandaloneInjector=t=>t.get(Y5).getOrCreateStandaloneInjector(e)}function $A(e,t,r,i,s,o){const a=t+r;return wt(e,a,s)?function Kr(e,t,r){return e[t]=r}(e,a+1,o?i.call(o,s):i(s)):function ru(e,t){const r=e[t];return r===ge?void 0:r}(e,a+1)}function ZA(e,t,r){const i=e+Y,s=N(),o=Xs(s,i);return function iu(e,t){return e[F].data[t].pure}(s,i)?$A(s,function gn(){const e=oe.lFrame;let t=e.bindingRootIndex;return-1===t&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}(),t,o.transform,r,o):o.transform(r)}function KA(e,t){return Jf(e,t)}let dM=(()=>{class e{log(r){console.log(r)}warn(r){console.warn(r)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"platform"})}}return e})();const mM=new q(""),Rh=new q("");let L0,k0=(()=>{class e{constructor(r,i,s){this._ngZone=r,this.registry=i,this._isZoneStable=!0,this._callbacks=[],this.taskTrackingZone=null,L0||(function cz(e){L0=e}(s),s.addToWindow(i)),this._watchAngularEvents(),r.run(()=>{this.taskTrackingZone=typeof Zone>"u"?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{Ne.assertNotInAngularZone(),queueMicrotask(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}isStable(){return this._isZoneStable&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())queueMicrotask(()=>{for(;0!==this._callbacks.length;){let r=this._callbacks.pop();clearTimeout(r.timeoutId),r.doneCb()}});else{let r=this.getPendingTasks();this._callbacks=this._callbacks.filter(i=>!i.updateCb||!i.updateCb(r)||(clearTimeout(i.timeoutId),!1))}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(r=>({source:r.source,creationLocation:r.creationLocation,data:r.data})):[]}addCallback(r,i,s){let o=-1;i&&i>0&&(o=setTimeout(()=>{this._callbacks=this._callbacks.filter(a=>a.timeoutId!==o),r()},i)),this._callbacks.push({doneCb:r,timeoutId:o,updateCb:s})}whenStable(r,i,s){if(s&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(r,i,s),this._runCallbacksIfReady()}registerApplication(r){this.registry.registerApplication(r,this)}unregisterApplication(r){this.registry.unregisterApplication(r)}findProviders(r,i,s){return[]}static{this.\u0275fac=function(i){return new(i||e)(z(Ne),z(P0),z(Rh))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})(),P0=(()=>{class e{constructor(){this._applications=new Map}registerApplication(r,i){this._applications.set(r,i)}unregisterApplication(r){this._applications.delete(r)}unregisterAllApplications(){this._applications.clear()}getTestability(r){return this._applications.get(r)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(r,i=!0){return L0?.findTestabilityInTree(this,r,i)??null}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"platform"})}}return e})();function cu(e){return!!e&&"function"==typeof e.then}function yM(e){return!!e&&"function"==typeof e.subscribe}const F0=new q("");let vM=(()=>{class e{constructor(){this.initialized=!1,this.done=!1,this.donePromise=new Promise((r,i)=>{this.resolve=r,this.reject=i}),this.appInits=O(F0,{optional:!0})??[]}runInitializers(){if(this.initialized)return;const r=[];for(const s of this.appInits){const o=s();if(cu(o))r.push(o);else if(yM(o)){const a=new Promise((c,l)=>{o.subscribe({complete:c,error:l})});r.push(a)}}const i=()=>{this.done=!0,this.resolve()};Promise.all(r).then(()=>{i()}).catch(s=>{this.reject(s)}),0===r.length&&i(),this.initialized=!0}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const Oh=new q("");function wM(e,t){return Array.isArray(t)?t.reduce(wM,e):{...e,...t}}let ar=(()=>{class e{constructor(){this._bootstrapListeners=[],this._runningTick=!1,this._destroyed=!1,this._destroyListeners=[],this._views=[],this.internalErrorHandler=O(qV),this.afterRenderManager=O($1),this.zonelessEnabled=O(Bl),this.dirtyFlags=0,this.deferredDirtyFlags=0,this.externalTestViews=new Set,this.beforeRender=new Ze,this.afterTick=new Ze,this.componentTypes=[],this.components=[],this.isStable=O(io).hasPendingTasks.pipe(Ue(r=>!r)),this._injector=O(In)}get allViews(){return[...this.externalTestViews.keys(),...this._views]}get destroyed(){return this._destroyed}whenStable(){let r;return new Promise(i=>{r=this.isStable.subscribe({next:s=>{s&&i()}})}).finally(()=>{r.unsubscribe()})}get injector(){return this._injector}bootstrap(r,i){const s=r instanceof ZI;if(!this._injector.get(vM).done)throw!s&&function ns(e){const t=De(e)||kt(e)||Wt(e);return null!==t&&t.standalone}(r),new A(405,!1);let a;a=s?r:this._injector.get(Vl).resolveComponentFactory(r),this.componentTypes.push(a.componentType);const c=function lz(e){return e.isBoundToModule}(a)?void 0:this._injector.get(po),u=a.create(xt.NULL,[],i||a.selector,c),d=u.location.nativeElement,f=u.injector.get(mM,null);return f?.registerApplication(d),u.onDestroy(()=>{this.detachView(u.hostView),kh(this.components,u),f?.unregisterApplication(d)}),this._loadComponent(u),u}tick(){this.zonelessEnabled||(this.dirtyFlags|=1),this._tick()}_tick(){if(this._runningTick)throw new A(101,!1);const r=_e(null);try{this._runningTick=!0,this.synchronize()}catch(i){this.internalErrorHandler(i)}finally{this._runningTick=!1,_e(r),this.afterTick.next()}}synchronize(){let r=null;this._injector.destroyed||(r=this._injector.get(ih,null,{optional:!0})),this.dirtyFlags|=this.deferredDirtyFlags,this.deferredDirtyFlags=0;let i=0;for(;0!==this.dirtyFlags&&i++<10;)this.synchronizeOnce(r)}synchronizeOnce(r){if(this.dirtyFlags|=this.deferredDirtyFlags,this.deferredDirtyFlags=0,7&this.dirtyFlags){const i=!!(1&this.dirtyFlags);this.dirtyFlags&=-8,this.dirtyFlags|=8,this.beforeRender.next(i);for(let{_lView:s,notifyErrorHandler:o}of this._views)fz(s,o,i,this.zonelessEnabled);if(this.dirtyFlags&=-5,this.syncDirtyFlagsWithViews(),7&this.dirtyFlags)return}else r?.begin?.(),r?.end?.();8&this.dirtyFlags&&(this.dirtyFlags&=-9,this.afterRenderManager.execute()),this.syncDirtyFlagsWithViews()}syncDirtyFlagsWithViews(){this.allViews.some(({_lView:r})=>hf(r))?this.dirtyFlags|=2:this.dirtyFlags&=-8}attachView(r){const i=r;this._views.push(i),i.attachToAppRef(this)}detachView(r){const i=r;kh(this._views,i),i.detachFromAppRef()}_loadComponent(r){this.attachView(r.hostView),this.tick(),this.components.push(r);const i=this._injector.get(Oh,[]);[...this._bootstrapListeners,...i].forEach(s=>s(r))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(r=>r()),this._views.slice().forEach(r=>r.destroy())}finally{this._destroyed=!0,this._views=[],this._bootstrapListeners=[],this._destroyListeners=[]}}onDestroy(r){return this._destroyListeners.push(r),()=>kh(this._destroyListeners,r)}destroy(){if(this._destroyed)throw new A(406,!1);const r=this._injector;r.destroy&&!r.destroyed&&r.destroy()}get viewCount(){return this._views.length}warnIfDestroyed(){}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function kh(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}function fz(e,t,r,i){(r||hf(e))&&Yf(e,t,r&&!i?0:1)}class hz{constructor(t,r){this.ngModuleFactory=t,this.componentFactories=r}}let EM=(()=>{class e{compileModuleSync(r){return new Yv(r)}compileModuleAsync(r){return Promise.resolve(this.compileModuleSync(r))}compileModuleAndAllComponentsSync(r){const i=this.compileModuleSync(r),o=zn(nn(r).declarations).reduce((a,c)=>{const l=De(c);return l&&a.push(new $l(l)),a},[]);return new hz(i,o)}compileModuleAndAllComponentsAsync(r){return Promise.resolve(this.compileModuleAndAllComponentsSync(r))}clearCache(){}clearCacheFor(r){}getModuleId(r){}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),mz=(()=>{class e{constructor(){this.zone=O(Ne),this.changeDetectionScheduler=O(Ta),this.applicationRef=O(ar)}initialize(){this._onMicrotaskEmptySubscription||(this._onMicrotaskEmptySubscription=this.zone.onMicrotaskEmpty.subscribe({next:()=>{this.changeDetectionScheduler.runningTick||this.zone.run(()=>{this.applicationRef.tick()})}}))}ngOnDestroy(){this._onMicrotaskEmptySubscription?.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function B0({ngZoneFactory:e,ignoreChangesOutsideZone:t,scheduleInRootZone:r}){return e??=()=>new Ne({...V0(),scheduleInRootZone:r}),[{provide:Ne,useFactory:e},{provide:Ur,multi:!0,useFactory:()=>{const i=O(mz,{optional:!0});return()=>i.initialize()}},{provide:Ur,multi:!0,useFactory:()=>{const i=O(vz);return()=>{i.initialize()}}},!0===t?{provide:WI,useValue:!0}:[],{provide:Lv,useValue:r??NS}]}function V0(e){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:e?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:e?.runCoalescing??!1}}let vz=(()=>{class e{constructor(){this.subscription=new vt,this.initialized=!1,this.zone=O(Ne),this.pendingTasks=O(io)}initialize(){if(this.initialized)return;this.initialized=!0;let r=null;!this.zone.isStable&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(r=this.pendingTasks.add()),this.zone.runOutsideAngular(()=>{this.subscription.add(this.zone.onStable.subscribe(()=>{Ne.assertNotInAngularZone(),queueMicrotask(()=>{null!==r&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(this.pendingTasks.remove(r),r=null)})}))}),this.subscription.add(this.zone.onUnstable.subscribe(()=>{Ne.assertInAngularZone(),r??=this.pendingTasks.add()}))}ngOnDestroy(){this.subscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),lu=(()=>{class e{constructor(){this.appRef=O(ar),this.taskService=O(io),this.ngZone=O(Ne),this.zonelessEnabled=O(Bl),this.disableScheduling=O(WI,{optional:!0})??!1,this.zoneIsDefined=typeof Zone<"u"&&!!Zone.root.run,this.schedulerTickApplyArgs=[{data:{__scheduler_tick__:!0}}],this.subscriptions=new vt,this.angularZoneId=this.zoneIsDefined?this.ngZone._inner?.get(Af):null,this.scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(O(Lv,{optional:!0})??!1),this.cancelScheduledCallback=null,this.useMicrotaskScheduler=!1,this.runningTick=!1,this.pendingRenderTaskId=null,this.subscriptions.add(this.appRef.afterTick.subscribe(()=>{this.runningTick||this.cleanup()})),this.subscriptions.add(this.ngZone.onUnstable.subscribe(()=>{this.runningTick||this.cleanup()})),this.disableScheduling||=!this.zonelessEnabled&&(this.ngZone instanceof My||!this.zoneIsDefined)}notify(r){if(!this.zonelessEnabled&&5===r)return;switch(r){case 0:this.appRef.dirtyFlags|=2;break;case 3:case 2:case 4:case 5:case 1:this.appRef.dirtyFlags|=4;break;case 7:this.appRef.deferredDirtyFlags|=8;break;default:this.appRef.dirtyFlags|=8}if(!this.shouldScheduleTick())return;const i=this.useMicrotaskScheduler?OS:RS;this.pendingRenderTaskId=this.taskService.add(),this.cancelScheduledCallback=this.scheduleInRootZone?Zone.root.run(()=>i(()=>this.tick())):this.ngZone.runOutsideAngular(()=>i(()=>this.tick()))}shouldScheduleTick(){return!(this.disableScheduling||null!==this.pendingRenderTaskId||this.runningTick||this.appRef._runningTick||!this.zonelessEnabled&&this.zoneIsDefined&&Zone.current.get(Af+this.angularZoneId))}tick(){if(this.runningTick||this.appRef.destroyed)return;!this.zonelessEnabled&&7&this.appRef.dirtyFlags&&(this.appRef.dirtyFlags|=1);const r=this.taskService.add();try{this.ngZone.run(()=>{this.runningTick=!0,this.appRef._tick()},void 0,this.schedulerTickApplyArgs)}catch(i){throw this.taskService.remove(r),i}finally{this.cleanup()}this.useMicrotaskScheduler=!0,OS(()=>{this.useMicrotaskScheduler=!1,this.taskService.remove(r)})}ngOnDestroy(){this.subscriptions.unsubscribe(),this.cleanup()}cleanup(){if(this.runningTick=!1,this.cancelScheduledCallback?.(),this.cancelScheduledCallback=null,null!==this.pendingRenderTaskId){const r=this.pendingRenderTaskId;this.pendingRenderTaskId=null,this.taskService.remove(r)}}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const ds=new q("",{providedIn:"root",factory:()=>O(ds,Te.Optional|Te.SkipSelf)||function _z(){return typeof $localize<"u"&&$localize.locale||bh}()}),Lh=new q("");function Fh(e){return!e.moduleRef}let xM=(()=>{class e{constructor(r){this._injector=r,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(r,i){const s=i?.scheduleInRootZone,a=i?.ignoreChangesOutsideZone,c=[B0({ngZoneFactory:()=>function zV(e="zone.js",t){return"noop"===e?new My:"zone.js"===e?new Ne(t):e}(i?.ngZone,{...V0({eventCoalescing:i?.ngZoneEventCoalescing,runCoalescing:i?.ngZoneRunCoalescing}),scheduleInRootZone:s}),ignoreChangesOutsideZone:a}),{provide:Ta,useExisting:lu}],l=function Jj(e,t,r){return new Qv(e,t,r,!1)}(r.moduleType,this.injector,c);return function IM(e){const t=Fh(e)?e.r3Injector:e.moduleRef.injector,r=t.get(Ne);return r.run(()=>{Fh(e)?e.r3Injector.resolveInjectorInitializers():e.moduleRef.resolveInjectorInitializers();const i=t.get(nr,null);let s;if(r.runOutsideAngular(()=>{s=r.onError.subscribe({next:o=>{i.handleError(o)}})}),Fh(e)){const o=()=>t.destroy(),a=e.platformInjector.get(Lh);a.add(o),t.onDestroy(()=>{s.unsubscribe(),a.delete(o)})}else{const o=()=>e.moduleRef.destroy(),a=e.platformInjector.get(Lh);a.add(o),e.moduleRef.onDestroy(()=>{kh(e.allPlatformModules,e.moduleRef),s.unsubscribe(),a.delete(o)})}return function dz(e,t,r){try{const i=r();return cu(i)?i.catch(s=>{throw t.runOutsideAngular(()=>e.handleError(s)),s}):i}catch(i){throw t.runOutsideAngular(()=>e.handleError(i)),i}}(i,r,()=>{const o=t.get(vM);return o.runInitializers(),o.donePromise.then(()=>{if(function j$(e){"string"==typeof e&&(Bx=e.toLowerCase().replace(/_/g,"-"))}(t.get(ds,bh)||bh),Fh(e)){const c=t.get(ar);return void 0!==e.rootComponent&&c.bootstrap(e.rootComponent),c}return function Sz(e,t){const r=e.injector.get(ar);if(e._bootstrapComponents.length>0)e._bootstrapComponents.forEach(i=>r.bootstrap(i));else{if(!e.instance.ngDoBootstrap)throw new A(-403,!1);e.instance.ngDoBootstrap(r)}t.push(e)}(e.moduleRef,e.allPlatformModules),e.moduleRef})})})}({moduleRef:l,allPlatformModules:this._modules,platformInjector:this.injector})}bootstrapModule(r,i=[]){const s=wM({},i);return function gz(e,t,r){const i=new Yv(r);return Promise.resolve(i)}(0,0,r).then(o=>this.bootstrapModuleFactory(o,s))}onDestroy(r){this._destroyListeners.push(r)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new A(404,!1);this._modules.slice().forEach(i=>i.destroy()),this._destroyListeners.forEach(i=>i());const r=this._injector.get(Lh,null);r&&(r.forEach(i=>i()),r.clear()),this._destroyed=!0}get destroyed(){return this._destroyed}static{this.\u0275fac=function(i){return new(i||e)(z(xt))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"platform"})}}return e})(),fs=null;const AM=new q("");function MM(e,t,r=[]){const i=`Platform: ${t}`,s=new q(i);return(o=[])=>{let a=j0();if(!a||a.injector.get(AM,!1)){const c=[...r,...o,{provide:s,useValue:!0}];e?e(c):function Tz(e){if(fs&&!fs.get(AM,!1))throw new A(400,!1);(function _M(){!function v3(e){zC=e}(()=>{throw new A(600,!1)})})(),fs=e;const t=e.get(xM);(function RM(e){e.get(iT,null)?.forEach(r=>r())})(e)}(function NM(e=[],t){return xt.create({name:t,providers:[{provide:Zm,useValue:"platform"},{provide:Lh,useValue:new Set([()=>fs=null])},...e]})}(c,i))}return function Iz(){const t=j0();if(!t)throw new A(401,!1);return t}()}}function j0(){return fs?.get(xM)??null}let uu=(()=>{class e{static{this.__NG_ELEMENT_ID__=Az}}return e})();function Az(e){return function Mz(e,t,r){if(Js(e)&&!r){const i=Un(e.index,t);return new Ml(i,i)}return 175&e.type?new Ml(t[ut],t):null}(ze(),N(),!(16&~e))}class FM{constructor(){}supports(t){return uh(t)}create(t){return new Pz(t)}}const kz=(e,t)=>t;class Pz{constructor(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||kz}forEachItem(t){let r;for(r=this._itHead;null!==r;r=r._next)t(r)}forEachOperation(t){let r=this._itHead,i=this._removalsHead,s=0,o=null;for(;r||i;){const a=!i||r&&r.currentIndex{a=this._trackByFn(s,c),null!==r&&Object.is(r.trackById,a)?(i&&(r=this._verifyReinsertion(r,c,a,s)),Object.is(r.item,c)||this._addIdentityChange(r,c)):(r=this._mismatch(r,c,a,s),i=!0),r=r._next,s++}),this.length=s;return this._truncate(r),this.collection=t,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let t;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=t._nextMoved)t.previousIndex=t.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(t,r,i,s){let o;return null===t?o=this._itTail:(o=t._prev,this._remove(t)),null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null))?(Object.is(t.item,r)||this._addIdentityChange(t,r),this._reinsertAfter(t,o,s)):null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(i,s))?(Object.is(t.item,r)||this._addIdentityChange(t,r),this._moveAfter(t,o,s)):t=this._addAfter(new Lz(r,i),o,s),t}_verifyReinsertion(t,r,i,s){let o=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null);return null!==o?t=this._reinsertAfter(o,t._prev,s):t.currentIndex!=s&&(t.currentIndex=s,this._addToMoves(t,s)),t}_truncate(t){for(;null!==t;){const r=t._next;this._addToRemovals(this._unlink(t)),t=r}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(t,r,i){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);const s=t._prevRemoved,o=t._nextRemoved;return null===s?this._removalsHead=o:s._nextRemoved=o,null===o?this._removalsTail=s:o._prevRemoved=s,this._insertAfter(t,r,i),this._addToMoves(t,i),t}_moveAfter(t,r,i){return this._unlink(t),this._insertAfter(t,r,i),this._addToMoves(t,i),t}_addAfter(t,r,i){return this._insertAfter(t,r,i),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t}_insertAfter(t,r,i){const s=null===r?this._itHead:r._next;return t._next=s,t._prev=r,null===s?this._itTail=t:s._prev=t,null===r?this._itHead=t:r._next=t,null===this._linkedRecords&&(this._linkedRecords=new BM),this._linkedRecords.put(t),t.currentIndex=i,t}_remove(t){return this._addToRemovals(this._unlink(t))}_unlink(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);const r=t._prev,i=t._next;return null===r?this._itHead=i:r._next=i,null===i?this._itTail=r:i._prev=r,t}_addToMoves(t,r){return t.previousIndex===r||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t}_addToRemovals(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new BM),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t}_addIdentityChange(t,r){return t.item=r,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t}}class Lz{constructor(t,r){this.item=t,this.trackById=r,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class Fz{constructor(){this._head=null,this._tail=null}add(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)}get(t,r){let i;for(i=this._head;null!==i;i=i._nextDup)if((null===r||r<=i.currentIndex)&&Object.is(i.trackById,t))return i;return null}remove(t){const r=t._prevDup,i=t._nextDup;return null===r?this._head=i:r._nextDup=i,null===i?this._tail=r:i._prevDup=r,null===this._head}}class BM{constructor(){this.map=new Map}put(t){const r=t.trackById;let i=this.map.get(r);i||(i=new Fz,this.map.set(r,i)),i.add(t)}get(t,r){const s=this.map.get(t);return s?s.get(t,r):null}remove(t){const r=t.trackById;return this.map.get(r).remove(t)&&this.map.delete(r),t}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function VM(e,t,r){const i=e.previousIndex;if(null===i)return i;let s=0;return r&&i{class e{static{this.\u0275prov=j({token:e,providedIn:"root",factory:jM})}constructor(r){this.factories=r}static create(r,i){if(null!=i){const s=i.factories.slice();r=r.concat(s)}return new e(r)}static extend(r){return{provide:e,useFactory:i=>e.create(r,i||jM()),deps:[[e,new Yd,new Qd]]}}find(r){const i=this.factories.find(s=>s.supports(r));if(null!=i)return i;throw new A(901,!1)}}return e})();const $z=MM(null,"core",[]);let Hz=(()=>{class e{constructor(r){}static{this.\u0275fac=function(i){return new(i||e)(z(ar))}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({})}}return e})();function pu(e,t){mn("NgSignals");const r=function g3(e){const t=Object.create(m3);t.computation=e;const r=()=>{if(FC(t),fm(t),t.value===Ld)throw t.error;return t.value};return r[gr]=t,r}(e);return t?.equal&&(r[gr].equal=t.equal),r}function ei(e){const t=_e(null);try{return e()}finally{_e(t)}}let dN=null;function hs(){return dN}class x9{}const an=new q("");let K0=(()=>{class e{historyGo(r){throw new Error("")}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:()=>O(M9),providedIn:"platform"})}}return e})();const A9=new q("");let M9=(()=>{class e extends K0{constructor(){super(),this._doc=O(an),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return hs().getBaseHref(this._doc)}onPopState(r){const i=hs().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",r,!1),()=>i.removeEventListener("popstate",r)}onHashChange(r){const i=hs().getGlobalEventTarget(this._doc,"window");return i.addEventListener("hashchange",r,!1),()=>i.removeEventListener("hashchange",r)}get href(){return this._location.href}get protocol(){return this._location.protocol}get hostname(){return this._location.hostname}get port(){return this._location.port}get pathname(){return this._location.pathname}get search(){return this._location.search}get hash(){return this._location.hash}set pathname(r){this._location.pathname=r}pushState(r,i,s){this._history.pushState(r,i,s)}replaceState(r,i,s){this._history.replaceState(r,i,s)}forward(){this._history.forward()}back(){this._history.back()}historyGo(r=0){this._history.go(r)}getState(){return this._history.state}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:()=>new e,providedIn:"platform"})}}return e})();function Q0(e,t){if(0==e.length)return t;if(0==t.length)return e;let r=0;return e.endsWith("/")&&r++,t.startsWith("/")&&r++,2==r?e+t.substring(1):1==r?e+t:e+"/"+t}function fN(e){const t=e.match(/#|\?|$/),r=t&&t.index||e.length;return e.slice(0,r-("/"===e[r-1]?1:0))+e.slice(r)}function Ri(e){return e&&"?"!==e[0]?"?"+e:e}let bo=(()=>{class e{historyGo(r){throw new Error("")}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:()=>O(pN),providedIn:"root"})}}return e})();const hN=new q("");let pN=(()=>{class e extends bo{constructor(r,i){super(),this._platformLocation=r,this._removeListenerFns=[],this._baseHref=i??this._platformLocation.getBaseHrefFromDOM()??O(an).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(r){this._removeListenerFns.push(this._platformLocation.onPopState(r),this._platformLocation.onHashChange(r))}getBaseHref(){return this._baseHref}prepareExternalUrl(r){return Q0(this._baseHref,r)}path(r=!1){const i=this._platformLocation.pathname+Ri(this._platformLocation.search),s=this._platformLocation.hash;return s&&r?`${i}${s}`:i}pushState(r,i,s,o){const a=this.prepareExternalUrl(s+Ri(o));this._platformLocation.pushState(r,i,a)}replaceState(r,i,s,o){const a=this.prepareExternalUrl(s+Ri(o));this._platformLocation.replaceState(r,i,a)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(r=0){this._platformLocation.historyGo?.(r)}static{this.\u0275fac=function(i){return new(i||e)(z(K0),z(hN,8))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),N9=(()=>{class e extends bo{constructor(r,i){super(),this._platformLocation=r,this._baseHref="",this._removeListenerFns=[],null!=i&&(this._baseHref=i)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(r){this._removeListenerFns.push(this._platformLocation.onPopState(r),this._platformLocation.onHashChange(r))}getBaseHref(){return this._baseHref}path(r=!1){const i=this._platformLocation.hash??"#";return i.length>0?i.substring(1):i}prepareExternalUrl(r){const i=Q0(this._baseHref,r);return i.length>0?"#"+i:i}pushState(r,i,s,o){let a=this.prepareExternalUrl(s+Ri(o));0==a.length&&(a=this._platformLocation.pathname),this._platformLocation.pushState(r,i,a)}replaceState(r,i,s,o){let a=this.prepareExternalUrl(s+Ri(o));0==a.length&&(a=this._platformLocation.pathname),this._platformLocation.replaceState(r,i,a)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(r=0){this._platformLocation.historyGo?.(r)}static{this.\u0275fac=function(i){return new(i||e)(z(K0),z(hN,8))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})(),gu=(()=>{class e{constructor(r){this._subject=new dt,this._urlChangeListeners=[],this._urlChangeSubscription=null,this._locationStrategy=r;const i=this._locationStrategy.getBaseHref();this._basePath=function k9(e){if(new RegExp("^(https?:)?//").test(e)){const[,r]=e.split(/\/\/[^\/]+/);return r}return e}(fN(gN(i))),this._locationStrategy.onPopState(s=>{this._subject.emit({url:this.path(!0),pop:!0,state:s.state,type:s.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(r=!1){return this.normalize(this._locationStrategy.path(r))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(r,i=""){return this.path()==this.normalize(r+Ri(i))}normalize(r){return e.stripTrailingSlash(function O9(e,t){if(!e||!t.startsWith(e))return t;const r=t.substring(e.length);return""===r||["/",";","?","#"].includes(r[0])?r:t}(this._basePath,gN(r)))}prepareExternalUrl(r){return r&&"/"!==r[0]&&(r="/"+r),this._locationStrategy.prepareExternalUrl(r)}go(r,i="",s=null){this._locationStrategy.pushState(s,"",r,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(r+Ri(i)),s)}replaceState(r,i="",s=null){this._locationStrategy.replaceState(s,"",r,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(r+Ri(i)),s)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(r=0){this._locationStrategy.historyGo?.(r)}onUrlChange(r){return this._urlChangeListeners.push(r),this._urlChangeSubscription??=this.subscribe(i=>{this._notifyUrlChangeListeners(i.url,i.state)}),()=>{const i=this._urlChangeListeners.indexOf(r);this._urlChangeListeners.splice(i,1),0===this._urlChangeListeners.length&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(r="",i){this._urlChangeListeners.forEach(s=>s(r,i))}subscribe(r,i,s){return this._subject.subscribe({next:r,error:i,complete:s})}static{this.normalizeQueryParams=Ri}static{this.joinWithSlash=Q0}static{this.stripTrailingSlash=fN}static{this.\u0275fac=function(i){return new(i||e)(z(bo))}}static{this.\u0275prov=j({token:e,factory:()=>function R9(){return new gu(z(bo))}(),providedIn:"root"})}}return e})();function gN(e){return e.replace(/\/index.html$/,"")}class b7{constructor(t,r,i,s){this.$implicit=t,this.ngForOf=r,this.index=i,this.count=s}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let a_=(()=>{class e{set ngForOf(r){this._ngForOf=r,this._ngForOfDirty=!0}set ngForTrackBy(r){this._trackByFn=r}get ngForTrackBy(){return this._trackByFn}constructor(r,i,s){this._viewContainer=r,this._template=i,this._differs=s,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForTemplate(r){r&&(this._template=r)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const r=this._ngForOf;!this._differ&&r&&(this._differ=this._differs.find(r).create(this.ngForTrackBy))}if(this._differ){const r=this._differ.diff(this._ngForOf);r&&this._applyChanges(r)}}_applyChanges(r){const i=this._viewContainer;r.forEachOperation((s,o,a)=>{if(null==s.previousIndex)i.createEmbeddedView(this._template,new b7(s.item,this._ngForOf,-1,-1),null===a?void 0:a);else if(null==a)i.remove(null===o?void 0:o);else if(null!==o){const c=i.get(o);i.move(c,a),TN(c,s)}});for(let s=0,o=i.length;s{TN(i.get(s.currentIndex),s)})}static ngTemplateContextGuard(r,i){return!0}static{this.\u0275fac=function(i){return new(i||e)(k(rr),k(Ai),k(G0))}}static{this.\u0275dir=de({type:e,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"},standalone:!0})}}return e})();function TN(e,t){e.context.$implicit=t.item}let ip=(()=>{class e{constructor(r,i){this._viewContainer=r,this._context=new E7,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=i}set ngIf(r){this._context.$implicit=this._context.ngIf=r,this._updateView()}set ngIfThen(r){IN("ngIfThen",r),this._thenTemplateRef=r,this._thenViewRef=null,this._updateView()}set ngIfElse(r){IN("ngIfElse",r),this._elseTemplateRef=r,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(r,i){return!0}static{this.\u0275fac=function(i){return new(i||e)(k(rr),k(Ai))}}static{this.\u0275dir=de({type:e,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"},standalone:!0})}}return e})();class E7{constructor(){this.$implicit=null,this.ngIf=null}}function IN(e,t){if(t&&!t.createEmbeddedView)throw new Error(`${e} must be a TemplateRef, but received '${Rt(t)}'.`)}let ps=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({})}}return e})();const MN="browser";function NN(e){return"server"===e}let K7=(()=>{class e{static{this.\u0275prov=j({token:e,providedIn:"root",factory:()=>function Z7(e){return e===MN}(O(ss))?new Q7(O(an),window):new J7})}}return e})();class Q7{constructor(t,r){this.document=t,this.window=r,this.offset=()=>[0,0]}setOffset(t){this.offset=Array.isArray(t)?()=>t:t}getScrollPosition(){return[this.window.scrollX,this.window.scrollY]}scrollToPosition(t){this.window.scrollTo(t[0],t[1])}scrollToAnchor(t){const r=function Y7(e,t){const r=e.getElementById(t)||e.getElementsByName(t)[0];if(r)return r;if("function"==typeof e.createTreeWalker&&e.body&&"function"==typeof e.body.attachShadow){const i=e.createTreeWalker(e.body,NodeFilter.SHOW_ELEMENT);let s=i.currentNode;for(;s;){const o=s.shadowRoot;if(o){const a=o.getElementById(t)||o.querySelector(`[name="${t}"]`);if(a)return a}s=i.nextNode()}}return null}(this.document,t);r&&(this.scrollToElement(r),r.focus())}setHistoryScrollRestoration(t){this.window.history.scrollRestoration=t}scrollToElement(t){const r=t.getBoundingClientRect(),i=r.left+this.window.pageXOffset,s=r.top+this.window.pageYOffset,o=this.offset();this.window.scrollTo(i-o[0],s-o[1])}}class J7{setOffset(t){}getScrollPosition(){return[0,0]}scrollToPosition(t){}scrollToAnchor(t){}setHistoryScrollRestoration(t){}}class Iq extends x9{constructor(){super(...arguments),this.supportsDOMEvents=!0}}class g_ extends Iq{static makeCurrent(){!function I9(e){dN??=e}(new g_)}onAndCancel(t,r,i){return t.addEventListener(r,i),()=>{t.removeEventListener(r,i)}}dispatchEvent(t,r){t.dispatchEvent(r)}remove(t){t.remove()}createElement(t,r){return(r=r||this.getDefaultDocument()).createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,r){return"window"===r?window:"document"===r?t:"body"===r?t.body:null}getBaseHref(t){const r=function xq(){return _u=_u||document.querySelector("base"),_u?_u.getAttribute("href"):null}();return null==r?null:function Aq(e){return new URL(e,document.baseURI).pathname}(r)}resetBaseElement(){_u=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return function v7(e,t){t=encodeURIComponent(t);for(const r of e.split(";")){const i=r.indexOf("="),[s,o]=-1==i?[r,""]:[r.slice(0,i),r.slice(i+1)];if(s.trim()===t)return decodeURIComponent(o)}return null}(document.cookie,t)}}let _u=null,Nq=(()=>{class e{build(){return new XMLHttpRequest}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})();const m_=new q("");let $N=(()=>{class e{constructor(r,i){this._zone=i,this._eventNameToPlugin=new Map,r.forEach(s=>{s.manager=this}),this._plugins=r.slice().reverse()}addEventListener(r,i,s){return this._findPluginFor(i).addEventListener(r,i,s)}getZone(){return this._zone}_findPluginFor(r){let i=this._eventNameToPlugin.get(r);if(i)return i;if(i=this._plugins.find(o=>o.supports(r)),!i)throw new A(5101,!1);return this._eventNameToPlugin.set(r,i),i}static{this.\u0275fac=function(i){return new(i||e)(z(m_),z(Ne))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})();class HN{constructor(t){this._doc=t}}const y_="ng-app-id";let zN=(()=>{class e{constructor(r,i,s,o={}){this.doc=r,this.appId=i,this.nonce=s,this.platformId=o,this.styleRef=new Map,this.hostNodes=new Set,this.styleNodesInDOM=this.collectServerRenderedStyles(),this.platformIsServer=NN(o),this.resetHostNodes()}addStyles(r){for(const i of r)1===this.changeUsageCount(i,1)&&this.onStyleAdded(i)}removeStyles(r){for(const i of r)this.changeUsageCount(i,-1)<=0&&this.onStyleRemoved(i)}ngOnDestroy(){const r=this.styleNodesInDOM;r&&(r.forEach(i=>i.remove()),r.clear());for(const i of this.getAllStyles())this.onStyleRemoved(i);this.resetHostNodes()}addHost(r){this.hostNodes.add(r);for(const i of this.getAllStyles())this.addStyleToHost(r,i)}removeHost(r){this.hostNodes.delete(r)}getAllStyles(){return this.styleRef.keys()}onStyleAdded(r){for(const i of this.hostNodes)this.addStyleToHost(i,r)}onStyleRemoved(r){const i=this.styleRef;i.get(r)?.elements?.forEach(s=>s.remove()),i.delete(r)}collectServerRenderedStyles(){const r=this.doc.head?.querySelectorAll(`style[${y_}="${this.appId}"]`);if(r?.length){const i=new Map;return r.forEach(s=>{null!=s.textContent&&i.set(s.textContent,s)}),i}return null}changeUsageCount(r,i){const s=this.styleRef;if(s.has(r)){const o=s.get(r);return o.usage+=i,o.usage}return s.set(r,{usage:i,elements:[]}),i}getStyleElement(r,i){const s=this.styleNodesInDOM,o=s?.get(i);if(o?.parentNode===r)return s.delete(i),o.removeAttribute(y_),o;{const a=this.doc.createElement("style");return this.nonce&&a.setAttribute("nonce",this.nonce),a.textContent=i,this.platformIsServer&&a.setAttribute(y_,this.appId),r.appendChild(a),a}}addStyleToHost(r,i){const s=this.getStyleElement(r,i),o=this.styleRef,a=o.get(i)?.elements;a?a.push(s):o.set(i,{elements:[s],usage:1})}resetHostNodes(){const r=this.hostNodes;r.clear(),r.add(this.doc.head)}static{this.\u0275fac=function(i){return new(i||e)(z(an),z(ya),z(oT,8),z(ss))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})();const v_={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/Math/MathML"},__=/%COMP%/g,Pq=new q("",{providedIn:"root",factory:()=>!0});function GN(e,t){return t.map(r=>r.replace(__,e))}let w_=(()=>{class e{constructor(r,i,s,o,a,c,l,u=null){this.eventManager=r,this.sharedStylesHost=i,this.appId=s,this.removeStylesOnCompDestroy=o,this.doc=a,this.platformId=c,this.ngZone=l,this.nonce=u,this.rendererByCompId=new Map,this.platformIsServer=NN(c),this.defaultRenderer=new b_(r,a,l,this.platformIsServer)}createRenderer(r,i){if(!r||!i)return this.defaultRenderer;this.platformIsServer&&i.encapsulation===mr.ShadowDom&&(i={...i,encapsulation:mr.Emulated});const s=this.getOrCreateRenderer(r,i);return s instanceof ZN?s.applyToHost(r):s instanceof E_&&s.applyStyles(),s}getOrCreateRenderer(r,i){const s=this.rendererByCompId;let o=s.get(i.id);if(!o){const a=this.doc,c=this.ngZone,l=this.eventManager,u=this.sharedStylesHost,d=this.removeStylesOnCompDestroy,f=this.platformIsServer;switch(i.encapsulation){case mr.Emulated:o=new ZN(l,u,i,this.appId,d,a,c,f);break;case mr.ShadowDom:return new Vq(l,u,r,i,a,c,this.nonce,f);default:o=new E_(l,u,i,d,a,c,f)}s.set(i.id,o)}return o}ngOnDestroy(){this.rendererByCompId.clear()}static{this.\u0275fac=function(i){return new(i||e)(z($N),z(zN),z(ya),z(Pq),z(an),z(ss),z(Ne),z(oT))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})();class b_{constructor(t,r,i,s){this.eventManager=t,this.doc=r,this.ngZone=i,this.platformIsServer=s,this.data=Object.create(null),this.throwOnSyntheticProps=!0,this.destroyNode=null}destroy(){}createElement(t,r){return r?this.doc.createElementNS(v_[r]||r,t):this.doc.createElement(t)}createComment(t){return this.doc.createComment(t)}createText(t){return this.doc.createTextNode(t)}appendChild(t,r){(WN(t)?t.content:t).appendChild(r)}insertBefore(t,r,i){t&&(WN(t)?t.content:t).insertBefore(r,i)}removeChild(t,r){r.remove()}selectRootElement(t,r){let i="string"==typeof t?this.doc.querySelector(t):t;if(!i)throw new A(-5104,!1);return r||(i.textContent=""),i}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,r,i,s){if(s){r=s+":"+r;const o=v_[s];o?t.setAttributeNS(o,r,i):t.setAttribute(r,i)}else t.setAttribute(r,i)}removeAttribute(t,r,i){if(i){const s=v_[i];s?t.removeAttributeNS(s,r):t.removeAttribute(`${i}:${r}`)}else t.removeAttribute(r)}addClass(t,r){t.classList.add(r)}removeClass(t,r){t.classList.remove(r)}setStyle(t,r,i,s){s&(os.DashCase|os.Important)?t.style.setProperty(r,i,s&os.Important?"important":""):t.style[r]=i}removeStyle(t,r,i){i&os.DashCase?t.style.removeProperty(r):t.style[r]=""}setProperty(t,r,i){null!=t&&(t[r]=i)}setValue(t,r){t.nodeValue=r}listen(t,r,i){if("string"==typeof t&&!(t=hs().getGlobalEventTarget(this.doc,t)))throw new Error(`Unsupported event target ${t} for event ${r}`);return this.eventManager.addEventListener(t,r,this.decoratePreventDefault(i))}decoratePreventDefault(t){return r=>{if("__ngUnwrap__"===r)return t;!1===(this.platformIsServer?this.ngZone.runGuarded(()=>t(r)):t(r))&&r.preventDefault()}}}function WN(e){return"TEMPLATE"===e.tagName&&void 0!==e.content}class Vq extends b_{constructor(t,r,i,s,o,a,c,l){super(t,o,a,l),this.sharedStylesHost=r,this.hostEl=i,this.shadowRoot=i.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const u=GN(s.id,s.styles);for(const d of u){const f=document.createElement("style");c&&f.setAttribute("nonce",c),f.textContent=d,this.shadowRoot.appendChild(f)}}nodeOrShadowRoot(t){return t===this.hostEl?this.shadowRoot:t}appendChild(t,r){return super.appendChild(this.nodeOrShadowRoot(t),r)}insertBefore(t,r,i){return super.insertBefore(this.nodeOrShadowRoot(t),r,i)}removeChild(t,r){return super.removeChild(null,r)}parentNode(t){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(t)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}}class E_ extends b_{constructor(t,r,i,s,o,a,c,l){super(t,o,a,c),this.sharedStylesHost=r,this.removeStylesOnCompDestroy=s,this.styles=l?GN(l,i.styles):i.styles}applyStyles(){this.sharedStylesHost.addStyles(this.styles)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles)}}class ZN extends E_{constructor(t,r,i,s,o,a,c,l){const u=s+"-"+i.id;super(t,r,i,o,a,c,l,u),this.contentAttr=function Lq(e){return"_ngcontent-%COMP%".replace(__,e)}(u),this.hostAttr=function Fq(e){return"_nghost-%COMP%".replace(__,e)}(u)}applyToHost(t){this.applyStyles(),this.setAttribute(t,this.hostAttr,"")}createElement(t,r){const i=super.createElement(t,r);return super.setAttribute(i,this.contentAttr,""),i}}let Uq=(()=>{class e extends HN{constructor(r){super(r)}supports(r){return!0}addEventListener(r,i,s){return r.addEventListener(i,s,!1),()=>this.removeEventListener(r,i,s)}removeEventListener(r,i,s){return r.removeEventListener(i,s)}static{this.\u0275fac=function(i){return new(i||e)(z(an))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})();const KN=["alt","control","meta","shift"],jq={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},$q={alt:e=>e.altKey,control:e=>e.ctrlKey,meta:e=>e.metaKey,shift:e=>e.shiftKey};let Hq=(()=>{class e extends HN{constructor(r){super(r)}supports(r){return null!=e.parseEventName(r)}addEventListener(r,i,s){const o=e.parseEventName(i),a=e.eventCallback(o.fullKey,s,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>hs().onAndCancel(r,o.domEventName,a))}static parseEventName(r){const i=r.toLowerCase().split("."),s=i.shift();if(0===i.length||"keydown"!==s&&"keyup"!==s)return null;const o=e._normalizeKey(i.pop());let a="",c=i.indexOf("code");if(c>-1&&(i.splice(c,1),a="code."),KN.forEach(u=>{const d=i.indexOf(u);d>-1&&(i.splice(d,1),a+=u+".")}),a+=o,0!=i.length||0===o.length)return null;const l={};return l.domEventName=s,l.fullKey=a,l}static matchEventFullKeyCode(r,i){let s=jq[r.key]||r.key,o="";return i.indexOf("code.")>-1&&(s=r.code,o="code."),!(null==s||!s)&&(s=s.toLowerCase()," "===s?s="space":"."===s&&(s="dot"),KN.forEach(a=>{a!==s&&(0,$q[a])(r)&&(o+=a+".")}),o+=s,o===i)}static eventCallback(r,i,s){return o=>{e.matchEventFullKeyCode(o,r)&&s.runGuarded(()=>i(o))}}static _normalizeKey(r){return"esc"===r?"escape":r}static{this.\u0275fac=function(i){return new(i||e)(z(an))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})();const YN=[{provide:ss,useValue:MN},{provide:iT,useValue:function zq(){g_.makeCurrent()},multi:!0},{provide:an,useFactory:function Gq(){return function h8(e){Ly=e}(document),document},deps:[]}],Wq=MM($z,"browser",YN),Zq=new q(""),JN=[{provide:Rh,useClass:class Mq{addToWindow(t){ct.getAngularTestability=(i,s=!0)=>{const o=t.findTestabilityInTree(i,s);if(null==o)throw new A(5103,!1);return o},ct.getAllAngularTestabilities=()=>t.getAllTestabilities(),ct.getAllAngularRootElements=()=>t.getAllRootElements(),ct.frameworkStabilizers||(ct.frameworkStabilizers=[]),ct.frameworkStabilizers.push(i=>{const s=ct.getAllAngularTestabilities();let o=s.length;const a=function(){o--,0==o&&i()};s.forEach(c=>{c.whenStable(a)})})}findTestabilityInTree(t,r,i){return null==r?null:t.getTestability(r)??(i?hs().isShadowRoot(r)?this.findTestabilityInTree(t,r.host,!0):this.findTestabilityInTree(t,r.parentElement,!0):null)}},deps:[]},{provide:mM,useClass:k0,deps:[Ne,P0,Rh]},{provide:k0,useClass:k0,deps:[Ne,P0,Rh]}],XN=[{provide:Zm,useValue:"root"},{provide:nr,useFactory:function qq(){return new nr},deps:[]},{provide:m_,useClass:Uq,multi:!0,deps:[an,Ne,ss]},{provide:m_,useClass:Hq,multi:!0,deps:[an]},w_,zN,$N,{provide:ih,useExisting:w_},{provide:class X7{},useClass:Nq,deps:[]},[]];let eR=(()=>{class e{constructor(r){}static withServerTransition(r){return{ngModule:e,providers:[{provide:ya,useValue:r.appId}]}}static{this.\u0275fac=function(i){return new(i||e)(z(Zq,12))}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({providers:[...XN,...JN],imports:[ps,Hz]})}}return e})(),Kq=(()=>{class e{constructor(r){this._doc=r}getTitle(){return this._doc.title}setTitle(r){this._doc.title=r||""}static{this.\u0275fac=function(i){return new(i||e)(z(an))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),rR=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:function(i){let s=null;return s=i?new(i||e):z(Xq),s},providedIn:"root"})}}return e})(),Xq=(()=>{class e extends rR{constructor(r){super(),this._doc=r}sanitize(r,i){if(null==i)return null;switch(r){case Hn.NONE:return i;case Hn.HTML:return Gr(i,"HTML")?$n(i):AT(this._doc,String(i)).toString();case Hn.STYLE:return Gr(i,"Style")?$n(i):i;case Hn.SCRIPT:if(Gr(i,"Script"))return $n(i);throw new A(5200,!1);case Hn.URL:return Gr(i,"URL")?$n(i):Uf(String(i));case Hn.RESOURCE_URL:if(Gr(i,"ResourceURL"))return $n(i);throw new A(5201,!1);default:throw new A(5202,!1)}}bypassSecurityTrustHtml(r){return function k8(e){return new x8(e)}(r)}bypassSecurityTrustStyle(r){return function P8(e){return new A8(e)}(r)}bypassSecurityTrustScript(r){return function L8(e){return new M8(e)}(r)}bypassSecurityTrustUrl(r){return function F8(e){return new N8(e)}(r)}bypassSecurityTrustResourceUrl(r){return function B8(e){return new R8(e)}(r)}static{this.\u0275fac=function(i){return new(i||e)(z(an))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function gs(e){return this instanceof gs?(this.v=e,this):new gs(e)}function aR(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,t=e[Symbol.asyncIterator];return t?t.call(e):(e=function T_(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(o){r[o]=e[o]&&function(a){return new Promise(function(c,l){!function s(o,a,c,l){Promise.resolve(l).then(function(u){o({value:u,done:c})},a)}(c,l,(a=e[o](a)).done,a.value)})}}}"function"==typeof SuppressedError&&SuppressedError;const cR=e=>e&&"number"==typeof e.length&&"function"!=typeof e;function lR(e){return at(e?.then)}function uR(e){return at(e[Sm])}function dR(e){return Symbol.asyncIterator&&at(e?.[Symbol.asyncIterator])}function fR(e){return new TypeError(`You provided ${null!==e&&"object"==typeof e?"an invalid object":`'${e}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}const hR=function IG(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}();function pR(e){return at(e?.[hR])}function gR(e){return function oR(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s,i=r.apply(e,t||[]),o=[];return s=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),c("next"),c("throw"),c("return",function a(p){return function(g){return Promise.resolve(g).then(p,f)}}),s[Symbol.asyncIterator]=function(){return this},s;function c(p,g){i[p]&&(s[p]=function(m){return new Promise(function(y,_){o.push([p,m,y,_])>1||l(p,m)})},g&&(s[p]=g(s[p])))}function l(p,g){try{!function u(p){p.value instanceof gs?Promise.resolve(p.value.v).then(d,f):h(o[0][2],p)}(i[p](g))}catch(m){h(o[0][3],m)}}function d(p){l("next",p)}function f(p){l("throw",p)}function h(p,g){p(g),o.shift(),o.length&&l(o[0][0],o[0][1])}}(this,arguments,function*(){const r=e.getReader();try{for(;;){const{value:i,done:s}=yield gs(r.read());if(s)return yield gs(void 0);yield yield gs(i)}}finally{r.releaseLock()}})}function mR(e){return at(e?.getReader)}function Tr(e){if(e instanceof Ht)return e;if(null!=e){if(uR(e))return function xG(e){return new Ht(t=>{const r=e[Sm]();if(at(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(e);if(cR(e))return function AG(e){return new Ht(t=>{for(let r=0;r{e.then(r=>{t.closed||(t.next(r),t.complete())},r=>t.error(r)).then(null,YC)})}(e);if(dR(e))return yR(e);if(pR(e))return function NG(e){return new Ht(t=>{for(const r of e)if(t.next(r),t.closed)return;t.complete()})}(e);if(mR(e))return function RG(e){return yR(gR(e))}(e)}throw fR(e)}function yR(e){return new Ht(t=>{(function OG(e,t){var r,i,s,o;return function iR(e,t,r,i){return new(r||(r=Promise))(function(o,a){function c(d){try{u(i.next(d))}catch(f){a(f)}}function l(d){try{u(i.throw(d))}catch(f){a(f)}}function u(d){d.done?o(d.value):function s(o){return o instanceof r?o:new r(function(a){a(o)})}(d.value).then(c,l)}u((i=i.apply(e,t||[])).next())})}(this,void 0,void 0,function*(){try{for(r=aR(e);!(i=yield r.next()).done;)if(t.next(i.value),t.closed)return}catch(a){s={error:a}}finally{try{i&&!i.done&&(o=r.return)&&(yield o.call(r))}finally{if(s)throw s.error}}t.complete()})})(e,t).catch(r=>t.error(r))})}function ti(e,t,r,i=0,s=!1){const o=t.schedule(function(){r(),s?e.add(this.schedule(null,i)):this.unsubscribe()},i);if(e.add(o),!s)return o}function vR(e,t=0){return zt((r,i)=>{r.subscribe(Dt(i,s=>ti(i,e,()=>i.next(s),t),()=>ti(i,e,()=>i.complete(),t),s=>ti(i,e,()=>i.error(s),t)))})}function _R(e,t=0){return zt((r,i)=>{i.add(e.schedule(()=>r.subscribe(i),t))})}function wR(e,t){if(!e)throw new Error("Iterable cannot be null");return new Ht(r=>{ti(r,t,()=>{const i=e[Symbol.asyncIterator]();ti(r,t,()=>{i.next().then(s=>{s.done?r.complete():r.next(s.value)})},0,!0)})})}function Gt(e,t){return t?function VG(e,t){if(null!=e){if(uR(e))return function kG(e,t){return Tr(e).pipe(_R(t),vR(t))}(e,t);if(cR(e))return function LG(e,t){return new Ht(r=>{let i=0;return t.schedule(function(){i===e.length?r.complete():(r.next(e[i++]),r.closed||this.schedule())})})}(e,t);if(lR(e))return function PG(e,t){return Tr(e).pipe(_R(t),vR(t))}(e,t);if(dR(e))return wR(e,t);if(pR(e))return function FG(e,t){return new Ht(r=>{let i;return ti(r,t,()=>{i=e[hR](),ti(r,t,()=>{let s,o;try{({value:s,done:o}=i.next())}catch(a){return void r.error(a)}o?r.complete():r.next(s)},0,!0)}),()=>at(i?.return)&&i.return()})}(e,t);if(mR(e))return function BG(e,t){return wR(gR(e),t)}(e,t)}throw fR(e)}(e,t):Tr(e)}function x_(e){return e[e.length-1]}function bR(e){return at(x_(e))?e.pop():void 0}function lp(e){return function UG(e){return e&&at(e.schedule)}(x_(e))?e.pop():void 0}function he(...e){return Gt(e,lp(e))}const{isArray:jG}=Array,{getPrototypeOf:$G,prototype:HG,keys:zG}=Object;function ER(e){if(1===e.length){const t=e[0];if(jG(t))return{args:t,keys:null};if(function qG(e){return e&&"object"==typeof e&&$G(e)===HG}(t)){const r=zG(t);return{args:r.map(i=>t[i]),keys:r}}}return{args:e,keys:null}}const{isArray:GG}=Array;function CR(e){return Ue(t=>function WG(e,t){return GG(t)?e(...t):e(t)}(e,t))}function DR(e,t){return e.reduce((r,i,s)=>(r[i]=t[s],r),{})}function A_(...e){const t=lp(e),r=bR(e),{args:i,keys:s}=ER(e);if(0===i.length)return Gt([],t);const o=new Ht(function ZG(e,t,r=Zs){return i=>{SR(t,()=>{const{length:s}=e,o=new Array(s);let a=s,c=s;for(let l=0;l{const u=Gt(e[l],t);let d=!1;u.subscribe(Dt(i,f=>{o[l]=f,d||(d=!0,c--),c||i.next(r(o.slice()))},()=>{--a||i.complete()}))},i)},i)}}(i,t,s?a=>DR(s,a):Zs));return r?o.pipe(CR(r)):o}function SR(e,t,r){e?ti(r,e,t):t()}const up=Bd(e=>function(){e(this),this.name="EmptyError",this.message="no elements in sequence"});function cn(e,t,r=1/0){return at(t)?cn((i,s)=>Ue((o,a)=>t(i,o,s,a))(Tr(e(i,s))),r):("number"==typeof t&&(r=t),zt((i,s)=>function KG(e,t,r,i,s,o,a,c){const l=[];let u=0,d=0,f=!1;const h=()=>{f&&!l.length&&!u&&t.complete()},p=m=>u{o&&t.next(m),u++;let y=!1;Tr(r(m,d++)).subscribe(Dt(t,_=>{s?.(_),o?p(_):t.next(_)},()=>{y=!0},void 0,()=>{if(y)try{for(u--;l.length&&ug(_)):g(_)}h()}catch(_){t.error(_)}}))};return e.subscribe(Dt(t,p,()=>{f=!0,h()})),()=>{c?.()}}(i,s,e,r)))}function wu(e=1/0){return cn(Zs,e)}function M_(...e){return function QG(){return wu(1)}()(Gt(e,lp(e)))}function TR(e){return new Ht(t=>{Tr(e()).subscribe(t)})}function nc(e,t){const r=at(e)?e:()=>e,i=s=>s.error(r());return new Ht(t?s=>t.schedule(i,0,s):i)}const ni=new Ht(e=>e.complete());function N_(){return zt((e,t)=>{let r=null;e._refCount++;const i=Dt(t,void 0,void 0,void 0,()=>{if(!e||e._refCount<=0||0<--e._refCount)return void(r=null);const s=e._connection,o=r;r=null,s&&(!o||s===o)&&s.unsubscribe(),t.unsubscribe()});e.subscribe(i),i.closed||(r=e.connect())})}class IR extends Ht{constructor(t,r){super(),this.source=t,this.subjectFactory=r,this._subject=null,this._refCount=0,this._connection=null,tD(t)&&(this.lift=t.lift)}_subscribe(t){return this.getSubject().subscribe(t)}getSubject(){const t=this._subject;return(!t||t.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;const{_connection:t}=this;this._subject=this._connection=null,t?.unsubscribe()}connect(){let t=this._connection;if(!t){t=this._connection=new vt;const r=this.getSubject();t.add(this.source.subscribe(Dt(r,void 0,()=>{this._teardown(),r.complete()},i=>{this._teardown(),r.error(i)},()=>this._teardown()))),t.closed&&(this._connection=null,t=vt.EMPTY)}return t}refCount(){return N_()(this)}}function ri(e,t){return zt((r,i)=>{let s=null,o=0,a=!1;const c=()=>a&&!s&&i.complete();r.subscribe(Dt(i,l=>{s?.unsubscribe();let u=0;const d=o++;Tr(e(l,d)).subscribe(s=Dt(i,f=>i.next(t?t(l,f,d,u++):f),()=>{s=null,c()}))},()=>{a=!0,c()}))})}function rc(e){return e<=0?()=>ni:zt((t,r)=>{let i=0;t.subscribe(Dt(r,s=>{++i<=e&&(r.next(s),e<=i&&r.complete())}))})}function Pi(e,t){return zt((r,i)=>{let s=0;r.subscribe(Dt(i,o=>e.call(t,o,s++)&&i.next(o)))})}function dp(e){return zt((t,r)=>{let i=!1;t.subscribe(Dt(r,s=>{i=!0,r.next(s)},()=>{i||r.next(e),r.complete()}))})}function xR(e=XG){return zt((t,r)=>{let i=!1;t.subscribe(Dt(r,s=>{i=!0,r.next(s)},()=>i?r.complete():r.error(e())))})}function XG(){return new up}function ms(e,t){const r=arguments.length>=2;return i=>i.pipe(e?Pi((s,o)=>e(s,o,i)):Zs,rc(1),r?dp(t):xR(()=>new up))}function bu(e,t){return at(t)?cn(e,t,1):cn(e,1)}function wn(e,t,r){const i=at(e)||t||r?{next:e,error:t,complete:r}:e;return i?zt((s,o)=>{var a;null===(a=i.subscribe)||void 0===a||a.call(i);let c=!0;s.subscribe(Dt(o,l=>{var u;null===(u=i.next)||void 0===u||u.call(i,l),o.next(l)},()=>{var l;c=!1,null===(l=i.complete)||void 0===l||l.call(i),o.complete()},l=>{var u;c=!1,null===(u=i.error)||void 0===u||u.call(i,l),o.error(l)},()=>{var l,u;c&&(null===(l=i.unsubscribe)||void 0===l||l.call(i)),null===(u=i.finalize)||void 0===u||u.call(i)}))}):Zs}function ys(e){return zt((t,r)=>{let o,i=null,s=!1;i=t.subscribe(Dt(r,void 0,void 0,a=>{o=Tr(e(a,ys(e)(t))),i?(i.unsubscribe(),i=null,o.subscribe(r)):s=!0})),s&&(i.unsubscribe(),i=null,o.subscribe(r))})}function R_(e){return e<=0?()=>ni:zt((t,r)=>{let i=[];t.subscribe(Dt(r,s=>{i.push(s),e{for(const s of i)r.next(s);r.complete()},void 0,()=>{i=null}))})}function Eu(e){return zt((t,r)=>{try{t.subscribe(r)}finally{r.add(e)}})}const ve="primary",Cu=Symbol("RouteTitle");class sW{constructor(t){this.params=t||{}}has(t){return Object.prototype.hasOwnProperty.call(this.params,t)}get(t){if(this.has(t)){const r=this.params[t];return Array.isArray(r)?r[0]:r}return null}getAll(t){if(this.has(t)){const r=this.params[t];return Array.isArray(r)?r:[r]}return[]}get keys(){return Object.keys(this.params)}}function ic(e){return new sW(e)}function oW(e,t,r){const i=r.path.split("/");if(i.length>e.length||"full"===r.pathMatch&&(t.hasChildren()||i.lengthi[o]===s)}return e===t}function MR(e){return e.length>0?e[e.length-1]:null}function vs(e){return function eG(e){return!!e&&(e instanceof Ht||at(e.lift)&&at(e.subscribe))}(e)?e:cu(e)?Gt(Promise.resolve(e)):he(e)}const cW={exact:function OR(e,t,r){if(!Do(e.segments,t.segments)||!fp(e.segments,t.segments,r)||e.numberOfChildren!==t.numberOfChildren)return!1;for(const i in t.children)if(!e.children[i]||!OR(e.children[i],t.children[i],r))return!1;return!0},subset:kR},NR={exact:function lW(e,t){return ii(e,t)},subset:function uW(e,t){return Object.keys(t).length<=Object.keys(e).length&&Object.keys(t).every(r=>AR(e[r],t[r]))},ignored:()=>!0};function RR(e,t,r){return cW[r.paths](e.root,t.root,r.matrixParams)&&NR[r.queryParams](e.queryParams,t.queryParams)&&!("exact"===r.fragment&&e.fragment!==t.fragment)}function kR(e,t,r){return PR(e,t,t.segments,r)}function PR(e,t,r,i){if(e.segments.length>r.length){const s=e.segments.slice(0,r.length);return!(!Do(s,r)||t.hasChildren()||!fp(s,r,i))}if(e.segments.length===r.length){if(!Do(e.segments,r)||!fp(e.segments,r,i))return!1;for(const s in t.children)if(!e.children[s]||!kR(e.children[s],t.children[s],i))return!1;return!0}{const s=r.slice(0,e.segments.length),o=r.slice(e.segments.length);return!!(Do(e.segments,s)&&fp(e.segments,s,i)&&e.children[ve])&&PR(e.children[ve],t,o,i)}}function fp(e,t,r){return t.every((i,s)=>NR[r](e[s].parameters,i.parameters))}class Co{constructor(t=new Ge([],{}),r={},i=null){this.root=t,this.queryParams=r,this.fragment=i}get queryParamMap(){return this._queryParamMap??=ic(this.queryParams),this._queryParamMap}toString(){return hW.serialize(this)}}class Ge{constructor(t,r){this.segments=t,this.children=r,this.parent=null,Object.values(r).forEach(i=>i.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return pp(this)}}class Du{constructor(t,r){this.path=t,this.parameters=r}get parameterMap(){return this._parameterMap??=ic(this.parameters),this._parameterMap}toString(){return BR(this)}}function Do(e,t){return e.length===t.length&&e.every((r,i)=>r.path===t[i].path)}let sc=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:()=>new hp,providedIn:"root"})}}return e})();class hp{parse(t){const r=new DW(t);return new Co(r.parseRootSegment(),r.parseQueryParams(),r.parseFragment())}serialize(t){const r=`/${Su(t.root,!0)}`,i=function mW(e){const t=Object.entries(e).map(([r,i])=>Array.isArray(i)?i.map(s=>`${gp(r)}=${gp(s)}`).join("&"):`${gp(r)}=${gp(i)}`).filter(r=>r);return t.length?`?${t.join("&")}`:""}(t.queryParams);return`${r}${i}${"string"==typeof t.fragment?`#${function pW(e){return encodeURI(e)}(t.fragment)}`:""}`}}const hW=new hp;function pp(e){return e.segments.map(t=>BR(t)).join("/")}function Su(e,t){if(!e.hasChildren())return pp(e);if(t){const r=e.children[ve]?Su(e.children[ve],!1):"",i=[];return Object.entries(e.children).forEach(([s,o])=>{s!==ve&&i.push(`${s}:${Su(o,!1)}`)}),i.length>0?`${r}(${i.join("//")})`:r}{const r=function fW(e,t){let r=[];return Object.entries(e.children).forEach(([i,s])=>{i===ve&&(r=r.concat(t(s,i)))}),Object.entries(e.children).forEach(([i,s])=>{i!==ve&&(r=r.concat(t(s,i)))}),r}(e,(i,s)=>s===ve?[Su(e.children[ve],!1)]:[`${s}:${Su(i,!1)}`]);return 1===Object.keys(e.children).length&&null!=e.children[ve]?`${pp(e)}/${r[0]}`:`${pp(e)}/(${r.join("//")})`}}function LR(e){return encodeURIComponent(e).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function gp(e){return LR(e).replace(/%3B/gi,";")}function k_(e){return LR(e).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function mp(e){return decodeURIComponent(e)}function FR(e){return mp(e.replace(/\+/g,"%20"))}function BR(e){return`${k_(e.path)}${function gW(e){return Object.entries(e).map(([t,r])=>`;${k_(t)}=${k_(r)}`).join("")}(e.parameters)}`}const yW=/^[^\/()?;#]+/;function P_(e){const t=e.match(yW);return t?t[0]:""}const vW=/^[^\/()?;=#]+/,wW=/^[^=?&#]+/,EW=/^[^&#]+/;class DW{constructor(t){this.url=t,this.remaining=t}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new Ge([],{}):new Ge([],this.parseChildren())}parseQueryParams(){const t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());let r={};this.peekStartsWith("/(")&&(this.capture("/"),r=this.parseParens(!0));let i={};return this.peekStartsWith("(")&&(i=this.parseParens(!1)),(t.length>0||Object.keys(r).length>0)&&(i[ve]=new Ge(t,r)),i}parseSegment(){const t=P_(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new A(4009,!1);return this.capture(t),new Du(mp(t),this.parseMatrixParams())}parseMatrixParams(){const t={};for(;this.consumeOptional(";");)this.parseParam(t);return t}parseParam(t){const r=function _W(e){const t=e.match(vW);return t?t[0]:""}(this.remaining);if(!r)return;this.capture(r);let i="";if(this.consumeOptional("=")){const s=P_(this.remaining);s&&(i=s,this.capture(i))}t[mp(r)]=mp(i)}parseQueryParam(t){const r=function bW(e){const t=e.match(wW);return t?t[0]:""}(this.remaining);if(!r)return;this.capture(r);let i="";if(this.consumeOptional("=")){const a=function CW(e){const t=e.match(EW);return t?t[0]:""}(this.remaining);a&&(i=a,this.capture(i))}const s=FR(r),o=FR(i);if(t.hasOwnProperty(s)){let a=t[s];Array.isArray(a)||(a=[a],t[s]=a),a.push(o)}else t[s]=o}parseParens(t){const r={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const i=P_(this.remaining),s=this.remaining[i.length];if("/"!==s&&")"!==s&&";"!==s)throw new A(4010,!1);let o;i.indexOf(":")>-1?(o=i.slice(0,i.indexOf(":")),this.capture(o),this.capture(":")):t&&(o=ve);const a=this.parseChildren();r[o]=1===Object.keys(a).length?a[ve]:new Ge([],a),this.consumeOptional("//")}return r}peekStartsWith(t){return this.remaining.startsWith(t)}consumeOptional(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)}capture(t){if(!this.consumeOptional(t))throw new A(4011,!1)}}function VR(e){return e.segments.length>0?new Ge([],{[ve]:e}):e}function UR(e){const t={};for(const[i,s]of Object.entries(e.children)){const o=UR(s);if(i===ve&&0===o.segments.length&&o.hasChildren())for(const[a,c]of Object.entries(o.children))t[a]=c;else(o.segments.length>0||o.hasChildren())&&(t[i]=o)}return function SW(e){if(1===e.numberOfChildren&&e.children[ve]){const t=e.children[ve];return new Ge(e.segments.concat(t.segments),t.children)}return e}(new Ge(e.segments,t))}function So(e){return e instanceof Co}function jR(e){let t;const s=VR(function r(o){const a={};for(const l of o.children){const u=r(l);a[l.outlet]=u}const c=new Ge(o.url,a);return o===e&&(t=c),c}(e.root));return t??s}function $R(e,t,r,i){let s=e;for(;s.parent;)s=s.parent;if(0===t.length)return L_(s,s,s,r,i);const o=function IW(e){if("string"==typeof e[0]&&1===e.length&&"/"===e[0])return new zR(!0,0,e);let t=0,r=!1;const i=e.reduce((s,o,a)=>{if("object"==typeof o&&null!=o){if(o.outlets){const c={};return Object.entries(o.outlets).forEach(([l,u])=>{c[l]="string"==typeof u?u.split("/"):u}),[...s,{outlets:c}]}if(o.segmentPath)return[...s,o.segmentPath]}return"string"!=typeof o?[...s,o]:0===a?(o.split("/").forEach((c,l)=>{0==l&&"."===c||(0==l&&""===c?r=!0:".."===c?t++:""!=c&&s.push(c))}),s):[...s,o]},[]);return new zR(r,t,i)}(t);if(o.toRoot())return L_(s,s,new Ge([],{}),r,i);const a=function xW(e,t,r){if(e.isAbsolute)return new vp(t,!0,0);if(!r)return new vp(t,!1,NaN);if(null===r.parent)return new vp(r,!0,0);const i=yp(e.commands[0])?0:1;return function AW(e,t,r){let i=e,s=t,o=r;for(;o>s;){if(o-=s,i=i.parent,!i)throw new A(4005,!1);s=i.segments.length}return new vp(i,!1,s-o)}(r,r.segments.length-1+i,e.numberOfDoubleDots)}(o,s,e),c=a.processChildren?Iu(a.segmentGroup,a.index,o.commands):qR(a.segmentGroup,a.index,o.commands);return L_(s,a.segmentGroup,c,r,i)}function yp(e){return"object"==typeof e&&null!=e&&!e.outlets&&!e.segmentPath}function Tu(e){return"object"==typeof e&&null!=e&&e.outlets}function L_(e,t,r,i,s){let a,o={};i&&Object.entries(i).forEach(([l,u])=>{o[l]=Array.isArray(u)?u.map(d=>`${d}`):`${u}`}),a=e===t?r:HR(e,t,r);const c=VR(UR(a));return new Co(c,o,s)}function HR(e,t,r){const i={};return Object.entries(e.children).forEach(([s,o])=>{i[s]=o===t?r:HR(o,t,r)}),new Ge(e.segments,i)}class zR{constructor(t,r,i){if(this.isAbsolute=t,this.numberOfDoubleDots=r,this.commands=i,t&&i.length>0&&yp(i[0]))throw new A(4003,!1);const s=i.find(Tu);if(s&&s!==MR(i))throw new A(4004,!1)}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class vp{constructor(t,r,i){this.segmentGroup=t,this.processChildren=r,this.index=i}}function qR(e,t,r){if(e??=new Ge([],{}),0===e.segments.length&&e.hasChildren())return Iu(e,t,r);const i=function NW(e,t,r){let i=0,s=t;const o={match:!1,pathIndex:0,commandIndex:0};for(;s=r.length)return o;const a=e.segments[s],c=r[i];if(Tu(c))break;const l=`${c}`,u=i0&&void 0===l)break;if(l&&u&&"object"==typeof u&&void 0===u.outlets){if(!WR(l,u,a))return o;i+=2}else{if(!WR(l,{},a))return o;i++}s++}return{match:!0,pathIndex:s,commandIndex:i}}(e,t,r),s=r.slice(i.commandIndex);if(i.match&&i.pathIndexo!==ve)&&e.children[ve]&&1===e.numberOfChildren&&0===e.children[ve].segments.length){const o=Iu(e.children[ve],t,r);return new Ge(e.segments,o.children)}return Object.entries(i).forEach(([o,a])=>{"string"==typeof a&&(a=[a]),null!==a&&(s[o]=qR(e.children[o],t,a))}),Object.entries(e.children).forEach(([o,a])=>{void 0===i[o]&&(s[o]=a)}),new Ge(e.segments,s)}}function F_(e,t,r){const i=e.segments.slice(0,t);let s=0;for(;s{"string"==typeof i&&(i=[i]),null!==i&&(t[r]=F_(new Ge([],{}),0,i))}),t}function GR(e){const t={};return Object.entries(e).forEach(([r,i])=>t[r]=`${i}`),t}function WR(e,t,r){return e==r.path&&ii(t,r.parameters)}const xu="imperative";var Me=function(e){return e[e.NavigationStart=0]="NavigationStart",e[e.NavigationEnd=1]="NavigationEnd",e[e.NavigationCancel=2]="NavigationCancel",e[e.NavigationError=3]="NavigationError",e[e.RoutesRecognized=4]="RoutesRecognized",e[e.ResolveStart=5]="ResolveStart",e[e.ResolveEnd=6]="ResolveEnd",e[e.GuardsCheckStart=7]="GuardsCheckStart",e[e.GuardsCheckEnd=8]="GuardsCheckEnd",e[e.RouteConfigLoadStart=9]="RouteConfigLoadStart",e[e.RouteConfigLoadEnd=10]="RouteConfigLoadEnd",e[e.ChildActivationStart=11]="ChildActivationStart",e[e.ChildActivationEnd=12]="ChildActivationEnd",e[e.ActivationStart=13]="ActivationStart",e[e.ActivationEnd=14]="ActivationEnd",e[e.Scroll=15]="Scroll",e[e.NavigationSkipped=16]="NavigationSkipped",e}(Me||{});class si{constructor(t,r){this.id=t,this.url=r}}class Au extends si{constructor(t,r,i="imperative",s=null){super(t,r),this.type=Me.NavigationStart,this.navigationTrigger=i,this.restoredState=s}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class Li extends si{constructor(t,r,i){super(t,r),this.urlAfterRedirects=i,this.type=Me.NavigationEnd}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}var Zn=function(e){return e[e.Redirect=0]="Redirect",e[e.SupersededByNewNavigation=1]="SupersededByNewNavigation",e[e.NoDataFromResolver=2]="NoDataFromResolver",e[e.GuardRejected=3]="GuardRejected",e}(Zn||{}),_p=function(e){return e[e.IgnoredSameUrlNavigation=0]="IgnoredSameUrlNavigation",e[e.IgnoredByUrlHandlingStrategy=1]="IgnoredByUrlHandlingStrategy",e}(_p||{});class To extends si{constructor(t,r,i,s){super(t,r),this.reason=i,this.code=s,this.type=Me.NavigationCancel}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class oc extends si{constructor(t,r,i,s){super(t,r),this.reason=i,this.code=s,this.type=Me.NavigationSkipped}}class B_ extends si{constructor(t,r,i,s){super(t,r),this.error=i,this.target=s,this.type=Me.NavigationError}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class ZR extends si{constructor(t,r,i,s){super(t,r),this.urlAfterRedirects=i,this.state=s,this.type=Me.RoutesRecognized}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class OW extends si{constructor(t,r,i,s){super(t,r),this.urlAfterRedirects=i,this.state=s,this.type=Me.GuardsCheckStart}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class kW extends si{constructor(t,r,i,s,o){super(t,r),this.urlAfterRedirects=i,this.state=s,this.shouldActivate=o,this.type=Me.GuardsCheckEnd}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class PW extends si{constructor(t,r,i,s){super(t,r),this.urlAfterRedirects=i,this.state=s,this.type=Me.ResolveStart}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class LW extends si{constructor(t,r,i,s){super(t,r),this.urlAfterRedirects=i,this.state=s,this.type=Me.ResolveEnd}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class FW{constructor(t){this.route=t,this.type=Me.RouteConfigLoadStart}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class BW{constructor(t){this.route=t,this.type=Me.RouteConfigLoadEnd}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class VW{constructor(t){this.snapshot=t,this.type=Me.ChildActivationStart}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class UW{constructor(t){this.snapshot=t,this.type=Me.ChildActivationEnd}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class jW{constructor(t){this.snapshot=t,this.type=Me.ActivationStart}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class $W{constructor(t){this.snapshot=t,this.type=Me.ActivationEnd}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class KR{constructor(t,r,i){this.routerEvent=t,this.position=r,this.anchor=i,this.type=Me.Scroll}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}class V_{}class wp{constructor(t,r){this.url=t,this.navigationBehaviorOptions=r}}function Ir(e){return e.outlet||ve}function Mu(e){if(!e)return null;if(e.routeConfig?._injector)return e.routeConfig._injector;for(let t=e.parent;t;t=t.parent){const r=t.routeConfig;if(r?._loadedInjector)return r._loadedInjector;if(r?._injector)return r._injector}return null}class ZW{get injector(){return Mu(this.route?.snapshot)??this.rootInjector}set injector(t){}constructor(t){this.rootInjector=t,this.outlet=null,this.route=null,this.children=new Nu(this.rootInjector),this.attachRef=null}}let Nu=(()=>{class e{constructor(r){this.rootInjector=r,this.contexts=new Map}onChildOutletCreated(r,i){const s=this.getOrCreateContext(r);s.outlet=i,this.contexts.set(r,s)}onChildOutletDestroyed(r){const i=this.getContext(r);i&&(i.outlet=null,i.attachRef=null)}onOutletDeactivated(){const r=this.contexts;return this.contexts=new Map,r}onOutletReAttached(r){this.contexts=r}getOrCreateContext(r){let i=this.getContext(r);return i||(i=new ZW(this.rootInjector),this.contexts.set(r,i)),i}getContext(r){return this.contexts.get(r)||null}static{this.\u0275fac=function(i){return new(i||e)(z(In))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();class QR{constructor(t){this._root=t}get root(){return this._root.value}parent(t){const r=this.pathFromRoot(t);return r.length>1?r[r.length-2]:null}children(t){const r=U_(t,this._root);return r?r.children.map(i=>i.value):[]}firstChild(t){const r=U_(t,this._root);return r&&r.children.length>0?r.children[0].value:null}siblings(t){const r=j_(t,this._root);return r.length<2?[]:r[r.length-2].children.map(s=>s.value).filter(s=>s!==t)}pathFromRoot(t){return j_(t,this._root).map(r=>r.value)}}function U_(e,t){if(e===t.value)return t;for(const r of t.children){const i=U_(e,r);if(i)return i}return null}function j_(e,t){if(e===t.value)return[t];for(const r of t.children){const i=j_(e,r);if(i.length)return i.unshift(t),i}return[]}class xr{constructor(t,r){this.value=t,this.children=r}toString(){return`TreeNode(${this.value})`}}function ac(e){const t={};return e&&e.children.forEach(r=>t[r.value.outlet]=r),t}class YR extends QR{constructor(t,r){super(t),this.snapshot=r,$_(this,t)}toString(){return this.snapshot.toString()}}function JR(e){const t=function KW(e){const o=new Ep([],{},{},"",{},ve,e,null,{});return new XR("",new xr(o,[]))}(e),r=new Ln([new Du("",{})]),i=new Ln({}),s=new Ln({}),o=new Ln({}),a=new Ln(""),c=new cc(r,i,o,a,s,ve,e,t.root);return c.snapshot=t.root,new YR(new xr(c,[]),t)}class cc{constructor(t,r,i,s,o,a,c,l){this.urlSubject=t,this.paramsSubject=r,this.queryParamsSubject=i,this.fragmentSubject=s,this.dataSubject=o,this.outlet=a,this.component=c,this._futureSnapshot=l,this.title=this.dataSubject?.pipe(Ue(u=>u[Cu]))??he(void 0),this.url=t,this.params=r,this.queryParams=i,this.fragment=s,this.data=o}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=this.params.pipe(Ue(t=>ic(t))),this._paramMap}get queryParamMap(){return this._queryParamMap??=this.queryParams.pipe(Ue(t=>ic(t))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function bp(e,t,r="emptyOnly"){let i;const{routeConfig:s}=e;return i=null===t||"always"!==r&&""!==s?.path&&(t.component||t.routeConfig?.loadComponent)?{params:{...e.params},data:{...e.data},resolve:{...e.data,...e._resolvedData??{}}}:{params:{...t.params,...e.params},data:{...t.data,...e.data},resolve:{...e.data,...t.data,...s?.data,...e._resolvedData}},s&&tO(s)&&(i.resolve[Cu]=s.title),i}class Ep{get title(){return this.data?.[Cu]}constructor(t,r,i,s,o,a,c,l,u){this.url=t,this.params=r,this.queryParams=i,this.fragment=s,this.data=o,this.outlet=a,this.component=c,this.routeConfig=l,this._resolve=u}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=ic(this.params),this._paramMap}get queryParamMap(){return this._queryParamMap??=ic(this.queryParams),this._queryParamMap}toString(){return`Route(url:'${this.url.map(i=>i.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class XR extends QR{constructor(t,r){super(r),this.url=t,$_(this,r)}toString(){return eO(this._root)}}function $_(e,t){t.value._routerState=e,t.children.forEach(r=>$_(e,r))}function eO(e){const t=e.children.length>0?` { ${e.children.map(eO).join(", ")} } `:"";return`${e.value}${t}`}function H_(e){if(e.snapshot){const t=e.snapshot,r=e._futureSnapshot;e.snapshot=r,ii(t.queryParams,r.queryParams)||e.queryParamsSubject.next(r.queryParams),t.fragment!==r.fragment&&e.fragmentSubject.next(r.fragment),ii(t.params,r.params)||e.paramsSubject.next(r.params),function aW(e,t){if(e.length!==t.length)return!1;for(let r=0;rii(r.parameters,t[i].parameters))}(e.url,t.url);return r&&!(!e.parent!=!t.parent)&&(!e.parent||z_(e.parent,t.parent))}function tO(e){return"string"==typeof e.title||null===e.title}let q_=(()=>{class e{constructor(){this.activated=null,this._activatedRoute=null,this.name=ve,this.activateEvents=new dt,this.deactivateEvents=new dt,this.attachEvents=new dt,this.detachEvents=new dt,this.parentContexts=O(Nu),this.location=O(rr),this.changeDetector=O(uu),this.inputBinder=O(Cp,{optional:!0}),this.supportsBindingToComponentInputs=!0}get activatedComponentRef(){return this.activated}ngOnChanges(r){if(r.name){const{firstChange:i,previousValue:s}=r.name;if(i)return;this.isTrackedInParentContexts(s)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(s)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(r){return this.parentContexts.getContext(r)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;const r=this.parentContexts.getContext(this.name);r?.route&&(r.attachRef?this.attach(r.attachRef,r.route):this.activateWith(r.route,r.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new A(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new A(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new A(4012,!1);this.location.detach();const r=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(r.instance),r}attach(r,i){this.activated=r,this._activatedRoute=i,this.location.insert(r.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(r.instance)}deactivate(){if(this.activated){const r=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(r)}}activateWith(r,i){if(this.isActivated)throw new A(4013,!1);this._activatedRoute=r;const s=this.location,a=r.snapshot.component,c=this.parentContexts.getOrCreateContext(this.name).children,l=new G_(r,c,s.injector);this.activated=s.createComponent(a,{index:s.length,injector:l,environmentInjector:i}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275dir=de({type:e,selectors:[["router-outlet"]],inputs:{name:"name"},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],standalone:!0,features:[er]})}}return e})();class G_{__ngOutletInjector(t){return new G_(this.route,this.childContexts,t)}constructor(t,r,i){this.route=t,this.childContexts=r,this.parent=i}get(t,r){return t===cc?this.route:t===Nu?this.childContexts:this.parent.get(t,r)}}const Cp=new q("");let nO=(()=>{class e{constructor(){this.outletDataSubscriptions=new Map}bindActivatedRouteToOutletComponent(r){this.unsubscribeFromRouteData(r),this.subscribeToRouteData(r)}unsubscribeFromRouteData(r){this.outletDataSubscriptions.get(r)?.unsubscribe(),this.outletDataSubscriptions.delete(r)}subscribeToRouteData(r){const{activatedRoute:i}=r,s=A_([i.queryParams,i.params,i.data]).pipe(ri(([o,a,c],l)=>(c={...o,...a,...c},0===l?he(c):Promise.resolve(c)))).subscribe(o=>{if(!r.isActivated||!r.activatedComponentRef||r.activatedRoute!==i||null===i.component)return void this.unsubscribeFromRouteData(r);const a=function T9(e){const t=De(e);if(!t)return null;const r=new $l(t);return{get selector(){return r.selector},get type(){return r.componentType},get inputs(){return r.inputs},get outputs(){return r.outputs},get ngContentSelectors(){return r.ngContentSelectors},get isStandalone(){return t.standalone},get isSignal(){return t.signals}}}(i.component);if(a)for(const{templateName:c}of a.inputs)r.activatedComponentRef.setInput(c,o[c]);else this.unsubscribeFromRouteData(r)});this.outletDataSubscriptions.set(r,s)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})();function Ru(e,t,r){if(r&&e.shouldReuseRoute(t.value,r.value.snapshot)){const i=r.value;i._futureSnapshot=t.value;const s=function YW(e,t,r){return t.children.map(i=>{for(const s of r.children)if(e.shouldReuseRoute(i.value,s.value.snapshot))return Ru(e,i,s);return Ru(e,i)})}(e,t,r);return new xr(i,s)}{if(e.shouldAttach(t.value)){const o=e.retrieve(t.value);if(null!==o){const a=o.route;return a.value._futureSnapshot=t.value,a.children=t.children.map(c=>Ru(e,c)),a}}const i=function JW(e){return new cc(new Ln(e.url),new Ln(e.params),new Ln(e.queryParams),new Ln(e.fragment),new Ln(e.data),e.outlet,e.component,e)}(t.value),s=t.children.map(o=>Ru(e,o));return new xr(i,s)}}class W_{constructor(t,r){this.redirectTo=t,this.navigationBehaviorOptions=r}}const rO="ngNavigationCancelingError";function Dp(e,t){const{redirectTo:r,navigationBehaviorOptions:i}=So(t)?{redirectTo:t,navigationBehaviorOptions:void 0}:t,s=iO(!1,Zn.Redirect);return s.url=r,s.navigationBehaviorOptions=i,s}function iO(e,t){const r=new Error(`NavigationCancelingError: ${e||""}`);return r[rO]=!0,r.cancellationCode=t,r}function sO(e){return!!e&&e[rO]}class tZ{constructor(t,r,i,s,o){this.routeReuseStrategy=t,this.futureState=r,this.currState=i,this.forwardEvent=s,this.inputBindingEnabled=o}activate(t){const r=this.futureState._root,i=this.currState?this.currState._root:null;this.deactivateChildRoutes(r,i,t),H_(this.futureState.root),this.activateChildRoutes(r,i,t)}deactivateChildRoutes(t,r,i){const s=ac(r);t.children.forEach(o=>{const a=o.value.outlet;this.deactivateRoutes(o,s[a],i),delete s[a]}),Object.values(s).forEach(o=>{this.deactivateRouteAndItsChildren(o,i)})}deactivateRoutes(t,r,i){const s=t.value,o=r?r.value:null;if(s===o)if(s.component){const a=i.getContext(s.outlet);a&&this.deactivateChildRoutes(t,r,a.children)}else this.deactivateChildRoutes(t,r,i);else o&&this.deactivateRouteAndItsChildren(r,i)}deactivateRouteAndItsChildren(t,r){t.value.component&&this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,r):this.deactivateRouteAndOutlet(t,r)}detachAndStoreRouteSubtree(t,r){const i=r.getContext(t.value.outlet),s=i&&t.value.component?i.children:r,o=ac(t);for(const a of Object.values(o))this.deactivateRouteAndItsChildren(a,s);if(i&&i.outlet){const a=i.outlet.detach(),c=i.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:a,route:t,contexts:c})}}deactivateRouteAndOutlet(t,r){const i=r.getContext(t.value.outlet),s=i&&t.value.component?i.children:r,o=ac(t);for(const a of Object.values(o))this.deactivateRouteAndItsChildren(a,s);i&&(i.outlet&&(i.outlet.deactivate(),i.children.onOutletDeactivated()),i.attachRef=null,i.route=null)}activateChildRoutes(t,r,i){const s=ac(r);t.children.forEach(o=>{this.activateRoutes(o,s[o.value.outlet],i),this.forwardEvent(new $W(o.value.snapshot))}),t.children.length&&this.forwardEvent(new UW(t.value.snapshot))}activateRoutes(t,r,i){const s=t.value,o=r?r.value:null;if(H_(s),s===o)if(s.component){const a=i.getOrCreateContext(s.outlet);this.activateChildRoutes(t,r,a.children)}else this.activateChildRoutes(t,r,i);else if(s.component){const a=i.getOrCreateContext(s.outlet);if(this.routeReuseStrategy.shouldAttach(s.snapshot)){const c=this.routeReuseStrategy.retrieve(s.snapshot);this.routeReuseStrategy.store(s.snapshot,null),a.children.onOutletReAttached(c.contexts),a.attachRef=c.componentRef,a.route=c.route.value,a.outlet&&a.outlet.attach(c.componentRef,c.route.value),H_(c.route.value),this.activateChildRoutes(t,null,a.children)}else a.attachRef=null,a.route=s,a.outlet&&a.outlet.activateWith(s,a.injector),this.activateChildRoutes(t,null,a.children)}else this.activateChildRoutes(t,null,i)}}class oO{constructor(t){this.path=t,this.route=this.path[this.path.length-1]}}class Sp{constructor(t,r){this.component=t,this.route=r}}function nZ(e,t,r){const i=e._root;return Ou(i,t?t._root:null,r,[i.value])}function lc(e,t){const r=Symbol(),i=t.get(e,r);return i===r?"function"!=typeof e||function $3(e){return null!==qd(e)}(e)?t.get(e):e:i}function Ou(e,t,r,i,s={canDeactivateChecks:[],canActivateChecks:[]}){const o=ac(t);return e.children.forEach(a=>{(function iZ(e,t,r,i,s={canDeactivateChecks:[],canActivateChecks:[]}){const o=e.value,a=t?t.value:null,c=r?r.getContext(e.value.outlet):null;if(a&&o.routeConfig===a.routeConfig){const l=function sZ(e,t,r){if("function"==typeof r)return r(e,t);switch(r){case"pathParamsChange":return!Do(e.url,t.url);case"pathParamsOrQueryParamsChange":return!Do(e.url,t.url)||!ii(e.queryParams,t.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!z_(e,t)||!ii(e.queryParams,t.queryParams);default:return!z_(e,t)}}(a,o,o.routeConfig.runGuardsAndResolvers);l?s.canActivateChecks.push(new oO(i)):(o.data=a.data,o._resolvedData=a._resolvedData),Ou(e,t,o.component?c?c.children:null:r,i,s),l&&c&&c.outlet&&c.outlet.isActivated&&s.canDeactivateChecks.push(new Sp(c.outlet.component,a))}else a&&ku(t,c,s),s.canActivateChecks.push(new oO(i)),Ou(e,null,o.component?c?c.children:null:r,i,s)})(a,o[a.value.outlet],r,i.concat([a.value]),s),delete o[a.value.outlet]}),Object.entries(o).forEach(([a,c])=>ku(c,r.getContext(a),s)),s}function ku(e,t,r){const i=ac(e),s=e.value;Object.entries(i).forEach(([o,a])=>{ku(a,s.component?t?t.children.getContext(o):null:t,r)}),r.canDeactivateChecks.push(new Sp(s.component&&t&&t.outlet&&t.outlet.isActivated?t.outlet.component:null,s))}function Pu(e){return"function"==typeof e}function aO(e){return e instanceof up||"EmptyError"===e?.name}const Tp=Symbol("INITIAL_VALUE");function uc(){return ri(e=>A_(e.map(t=>t.pipe(rc(1),function JG(...e){const t=lp(e);return zt((r,i)=>{(t?M_(e,r,t):M_(e,r)).subscribe(i)})}(Tp)))).pipe(Ue(t=>{for(const r of t)if(!0!==r){if(r===Tp)return Tp;if(!1===r||fZ(r))return r}return!0}),Pi(t=>t!==Tp),rc(1)))}function fZ(e){return So(e)||e instanceof W_}function cO(e){return function R3(...e){return JC(e)}(wn(t=>{if("boolean"!=typeof t)throw Dp(0,t)}),Ue(t=>!0===t))}class Z_{constructor(t){this.segmentGroup=t||null}}class Ip extends Error{constructor(t){super(),this.urlTree=t}}function dc(e){return nc(new Z_(e))}class SZ{constructor(t,r){this.urlSerializer=t,this.urlTree=r}lineralizeSegments(t,r){let i=[],s=r.root;for(;;){if(i=i.concat(s.segments),0===s.numberOfChildren)return he(i);if(s.numberOfChildren>1||!s.children[ve])return nc(new A(4e3,!1));s=s.children[ve]}}applyRedirectCommands(t,r,i,s,o){if("string"!=typeof r){const c=r,{queryParams:l,fragment:u,routeConfig:d,url:f,outlet:h,params:p,data:g,title:m}=s,y=Ei(o,()=>c({params:p,data:g,queryParams:l,fragment:u,routeConfig:d,url:f,outlet:h,title:m}));if(y instanceof Co)throw new Ip(y);r=y}const a=this.applyRedirectCreateUrlTree(r,this.urlSerializer.parse(r),t,i);if("/"===r[0])throw new Ip(a);return a}applyRedirectCreateUrlTree(t,r,i,s){const o=this.createSegmentGroup(t,r.root,i,s);return new Co(o,this.createQueryParams(r.queryParams,this.urlTree.queryParams),r.fragment)}createQueryParams(t,r){const i={};return Object.entries(t).forEach(([s,o])=>{if("string"==typeof o&&":"===o[0]){const c=o.substring(1);i[s]=r[c]}else i[s]=o}),i}createSegmentGroup(t,r,i,s){const o=this.createSegments(t,r.segments,i,s);let a={};return Object.entries(r.children).forEach(([c,l])=>{a[c]=this.createSegmentGroup(t,l,i,s)}),new Ge(o,a)}createSegments(t,r,i,s){return r.map(o=>":"===o.path[0]?this.findPosParam(t,o,s):this.findOrReturn(o,i))}findPosParam(t,r,i){const s=i[r.path.substring(1)];if(!s)throw new A(4001,!1);return s}findOrReturn(t,r){let i=0;for(const s of r){if(s.path===t.path)return r.splice(i),s;i++}return t}}const K_={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function TZ(e,t,r,i,s){const o=lO(e,t,r);return o.matched?(i=function HW(e,t){return e.providers&&!e._injector&&(e._injector=lh(e.providers,t,`Route: ${e.path}`)),e._injector??t}(t,i),function EZ(e,t,r,i){const s=t.canMatch;return s&&0!==s.length?he(s.map(a=>{const c=lc(a,e);return vs(function dZ(e){return e&&Pu(e.canMatch)}(c)?c.canMatch(t,r):Ei(e,()=>c(t,r)))})).pipe(uc(),cO()):he(!0)}(i,t,r).pipe(Ue(a=>!0===a?o:{...K_}))):he(o)}function lO(e,t,r){if("**"===t.path)return function IZ(e){return{matched:!0,parameters:e.length>0?MR(e).parameters:{},consumedSegments:e,remainingSegments:[],positionalParamSegments:{}}}(r);if(""===t.path)return"full"===t.pathMatch&&(e.hasChildren()||r.length>0)?{...K_}:{matched:!0,consumedSegments:[],remainingSegments:r,parameters:{},positionalParamSegments:{}};const s=(t.matcher||oW)(r,e,t);if(!s)return{...K_};const o={};Object.entries(s.posParams??{}).forEach(([c,l])=>{o[c]=l.path});const a=s.consumed.length>0?{...o,...s.consumed[s.consumed.length-1].parameters}:o;return{matched:!0,consumedSegments:s.consumed,remainingSegments:r.slice(s.consumed.length),parameters:a,positionalParamSegments:s.posParams??{}}}function uO(e,t,r,i){return r.length>0&&function MZ(e,t,r){return r.some(i=>xp(e,t,i)&&Ir(i)!==ve)}(e,r,i)?{segmentGroup:new Ge(t,AZ(i,new Ge(r,e.children))),slicedSegments:[]}:0===r.length&&function NZ(e,t,r){return r.some(i=>xp(e,t,i))}(e,r,i)?{segmentGroup:new Ge(e.segments,xZ(e,r,i,e.children)),slicedSegments:r}:{segmentGroup:new Ge(e.segments,e.children),slicedSegments:r}}function xZ(e,t,r,i){const s={};for(const o of r)if(xp(e,t,o)&&!i[Ir(o)]){const a=new Ge([],{});s[Ir(o)]=a}return{...i,...s}}function AZ(e,t){const r={};r[ve]=t;for(const i of e)if(""===i.path&&Ir(i)!==ve){const s=new Ge([],{});r[Ir(i)]=s}return r}function xp(e,t,r){return(!(e.hasChildren()||t.length>0)||"full"!==r.pathMatch)&&""===r.path}class OZ{}class LZ{constructor(t,r,i,s,o,a,c){this.injector=t,this.configLoader=r,this.rootComponentType=i,this.config=s,this.urlTree=o,this.paramsInheritanceStrategy=a,this.urlSerializer=c,this.applyRedirects=new SZ(this.urlSerializer,this.urlTree),this.absoluteRedirectCount=0,this.allowRedirects=!0}noMatchError(t){return new A(4002,`'${t.segmentGroup}'`)}recognize(){const t=uO(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(t).pipe(Ue(({children:r,rootSnapshot:i})=>{const s=new xr(i,r),o=new XR("",s),a=function TW(e,t,r=null,i=null){return $R(jR(e),t,r,i)}(i,[],this.urlTree.queryParams,this.urlTree.fragment);return a.queryParams=this.urlTree.queryParams,o.url=this.urlSerializer.serialize(a),{state:o,tree:a}}))}match(t){const r=new Ep([],Object.freeze({}),Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,Object.freeze({}),ve,this.rootComponentType,null,{});return this.processSegmentGroup(this.injector,this.config,t,ve,r).pipe(Ue(i=>({children:i,rootSnapshot:r})),ys(i=>{if(i instanceof Ip)return this.urlTree=i.urlTree,this.match(i.urlTree.root);throw i instanceof Z_?this.noMatchError(i):i}))}processSegmentGroup(t,r,i,s,o){return 0===i.segments.length&&i.hasChildren()?this.processChildren(t,r,i,o):this.processSegment(t,r,i,i.segments,s,!0,o).pipe(Ue(a=>a instanceof xr?[a]:[]))}processChildren(t,r,i,s){const o=[];for(const a of Object.keys(i.children))"primary"===a?o.unshift(a):o.push(a);return Gt(o).pipe(bu(a=>{const c=i.children[a],l=function WW(e,t){const r=e.filter(i=>Ir(i)===t);return r.push(...e.filter(i=>Ir(i)!==t)),r}(r,a);return this.processSegmentGroup(t,l,c,a,s)}),function tW(e,t){return zt(function eW(e,t,r,i,s){return(o,a)=>{let c=r,l=t,u=0;o.subscribe(Dt(a,d=>{const f=u++;l=c?e(l,d,f):(c=!0,d),i&&a.next(l)},s&&(()=>{c&&a.next(l),a.complete()})))}}(e,t,arguments.length>=2,!0))}((a,c)=>(a.push(...c),a)),dp(null),function nW(e,t){const r=arguments.length>=2;return i=>i.pipe(e?Pi((s,o)=>e(s,o,i)):Zs,R_(1),r?dp(t):xR(()=>new up))}(),cn(a=>{if(null===a)return dc(i);const c=dO(a);return function FZ(e){e.sort((t,r)=>t.value.outlet===ve?-1:r.value.outlet===ve?1:t.value.outlet.localeCompare(r.value.outlet))}(c),he(c)}))}processSegment(t,r,i,s,o,a,c){return Gt(r).pipe(bu(l=>this.processSegmentAgainstRoute(l._injector??t,r,l,i,s,o,a,c).pipe(ys(u=>{if(u instanceof Z_)return he(null);throw u}))),ms(l=>!!l),ys(l=>{if(aO(l))return function RZ(e,t,r){return 0===t.length&&!e.children[r]}(i,s,o)?he(new OZ):dc(i);throw l}))}processSegmentAgainstRoute(t,r,i,s,o,a,c,l){return Ir(i)===a||a!==ve&&xp(s,o,i)?void 0===i.redirectTo?this.matchSegmentAgainstRoute(t,s,i,o,a,l):this.allowRedirects&&c?this.expandSegmentAgainstRouteUsingRedirect(t,s,r,i,o,a,l):dc(s):dc(s)}expandSegmentAgainstRouteUsingRedirect(t,r,i,s,o,a,c){const{matched:l,parameters:u,consumedSegments:d,positionalParamSegments:f,remainingSegments:h}=lO(r,s,o);if(!l)return dc(r);"string"==typeof s.redirectTo&&"/"===s.redirectTo[0]&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>31&&(this.allowRedirects=!1));const p=new Ep(o,u,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,fO(s),Ir(s),s.component??s._loadedComponent??null,s,hO(s)),g=bp(p,c,this.paramsInheritanceStrategy);p.params=Object.freeze(g.params),p.data=Object.freeze(g.data);const m=this.applyRedirects.applyRedirectCommands(d,s.redirectTo,f,p,t);return this.applyRedirects.lineralizeSegments(s,m).pipe(cn(y=>this.processSegment(t,i,r,y.concat(h),a,!1,c)))}matchSegmentAgainstRoute(t,r,i,s,o,a){const c=TZ(r,i,s,t);return"**"===i.path&&(r.children={}),c.pipe(ri(l=>l.matched?this.getChildConfig(t=i._injector??t,i,s).pipe(ri(({routes:u})=>{const d=i._loadedInjector??t,{parameters:f,consumedSegments:h,remainingSegments:p}=l,g=new Ep(h,f,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,fO(i),Ir(i),i.component??i._loadedComponent??null,i,hO(i)),m=bp(g,a,this.paramsInheritanceStrategy);g.params=Object.freeze(m.params),g.data=Object.freeze(m.data);const{segmentGroup:y,slicedSegments:_}=uO(r,h,p,u);if(0===_.length&&y.hasChildren())return this.processChildren(d,u,y,g).pipe(Ue(w=>new xr(g,w)));if(0===u.length&&0===_.length)return he(new xr(g,[]));const v=Ir(i)===o;return this.processSegment(d,u,y,_,v?ve:o,!0,g).pipe(Ue(w=>new xr(g,w instanceof xr?[w]:[])))})):dc(r)))}getChildConfig(t,r,i){return r.children?he({routes:r.children,injector:t}):r.loadChildren?void 0!==r._loadedRoutes?he({routes:r._loadedRoutes,injector:r._loadedInjector}):function bZ(e,t,r,i){const s=t.canLoad;return void 0===s||0===s.length?he(!0):he(s.map(a=>{const c=lc(a,e);return vs(function aZ(e){return e&&Pu(e.canLoad)}(c)?c.canLoad(t,r):Ei(e,()=>c(t,r)))})).pipe(uc(),cO())}(t,r,i).pipe(cn(s=>s?this.configLoader.loadChildren(t,r).pipe(wn(o=>{r._loadedRoutes=o.routes,r._loadedInjector=o.injector})):function DZ(){return nc(iO(!1,Zn.GuardRejected))}())):he({routes:[],injector:t})}}function BZ(e){const t=e.value.routeConfig;return t&&""===t.path}function dO(e){const t=[],r=new Set;for(const i of e){if(!BZ(i)){t.push(i);continue}const s=t.find(o=>i.value.routeConfig===o.value.routeConfig);void 0!==s?(s.children.push(...i.children),r.add(s)):t.push(i)}for(const i of r){const s=dO(i.children);t.push(new xr(i.value,s))}return t.filter(i=>!r.has(i))}function fO(e){return e.data||{}}function hO(e){return e.resolve||{}}function pO(e){const t=e.children.map(r=>pO(r)).flat();return[e,...t]}function Q_(e){return ri(t=>{const r=e(t);return r?Gt(r).pipe(Ue(()=>t)):he(t)})}let gO=(()=>{class e{buildTitle(r){let i,s=r.root;for(;void 0!==s;)i=this.getResolvedTitleForRoute(s)??i,s=s.children.find(o=>o.outlet===ve);return i}getResolvedTitleForRoute(r){return r.data[Cu]}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:()=>O(zZ),providedIn:"root"})}}return e})(),zZ=(()=>{class e extends gO{constructor(r){super(),this.title=r}updateTitle(r){const i=this.buildTitle(r);void 0!==i&&this.title.setTitle(i)}static{this.\u0275fac=function(i){return new(i||e)(z(Kq))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const fc=new q("",{providedIn:"root",factory:()=>({})});let mO=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=ts({type:e,selectors:[["ng-component"]],standalone:!0,features:[Ih],decls:1,vars:0,template:function(i,s){1&i&&or(0,"router-outlet")},dependencies:[q_],encapsulation:2})}}return e})();function Y_(e){const t=e.children&&e.children.map(Y_),r=t?{...e,children:t}:{...e};return!r.component&&!r.loadComponent&&(t||r.loadChildren)&&r.outlet&&r.outlet!==ve&&(r.component=mO),r}const hc=new q("");let J_=(()=>{class e{constructor(){this.componentLoaders=new WeakMap,this.childrenLoaders=new WeakMap,this.compiler=O(EM)}loadComponent(r){if(this.componentLoaders.get(r))return this.componentLoaders.get(r);if(r._loadedComponent)return he(r._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(r);const i=vs(r.loadComponent()).pipe(Ue(yO),wn(o=>{this.onLoadEndListener&&this.onLoadEndListener(r),r._loadedComponent=o}),Eu(()=>{this.componentLoaders.delete(r)})),s=new IR(i,()=>new Ze).pipe(N_());return this.componentLoaders.set(r,s),s}loadChildren(r,i){if(this.childrenLoaders.get(i))return this.childrenLoaders.get(i);if(i._loadedRoutes)return he({routes:i._loadedRoutes,injector:i._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(i);const o=function qZ(e,t,r,i){return vs(e.loadChildren()).pipe(Ue(yO),cn(s=>s instanceof O1||Array.isArray(s)?he(s):Gt(t.compileModuleAsync(s))),Ue(s=>{i&&i(e);let o,a,c=!1;return Array.isArray(s)?(a=s,!0):(o=s.create(r).injector,a=o.get(hc,[],{optional:!0,self:!0}).flat()),{routes:a.map(Y_),injector:o}}))}(i,this.compiler,r,this.onLoadEndListener).pipe(Eu(()=>{this.childrenLoaders.delete(i)})),a=new IR(o,()=>new Ze).pipe(N_());return this.childrenLoaders.set(i,a),a}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function yO(e){return function GZ(e){return e&&"object"==typeof e&&"default"in e}(e)?e.default:e}let X_=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:()=>O(WZ),providedIn:"root"})}}return e})(),WZ=(()=>{class e{shouldProcessUrl(r){return!0}extract(r){return r}merge(r,i){return r}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const vO=new q(""),_O=new q("");function ZZ(e,t,r){const i=e.get(_O),s=e.get(an);return e.get(Ne).runOutsideAngular(()=>{if(!s.startViewTransition||i.skipNextTransition)return i.skipNextTransition=!1,new Promise(u=>setTimeout(u));let o;const a=new Promise(u=>{o=u}),c=s.startViewTransition(()=>(o(),function KZ(e){return new Promise(t=>{gh({read:()=>setTimeout(t)},{injector:e})})}(e))),{onViewTransitionCreated:l}=i;return l&&Ei(e,()=>l({transition:c,from:t,to:r})),a})}const wO=new q("");let Ap=(()=>{class e{get hasRequestedNavigation(){return 0!==this.navigationId}constructor(){this.currentNavigation=null,this.currentTransition=null,this.lastSuccessfulNavigation=null,this.events=new Ze,this.transitionAbortSubject=new Ze,this.configLoader=O(J_),this.environmentInjector=O(In),this.urlSerializer=O(sc),this.rootContexts=O(Nu),this.location=O(gu),this.inputBindingEnabled=null!==O(Cp,{optional:!0}),this.titleStrategy=O(gO),this.options=O(fc,{optional:!0})||{},this.paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly",this.urlHandlingStrategy=O(X_),this.createViewTransition=O(vO,{optional:!0}),this.navigationErrorHandler=O(wO,{optional:!0}),this.navigationId=0,this.afterPreactivation=()=>he(void 0),this.rootComponentType=null,this.configLoader.onLoadEndListener=s=>this.events.next(new BW(s)),this.configLoader.onLoadStartListener=s=>this.events.next(new FW(s))}complete(){this.transitions?.complete()}handleNavigationRequest(r){const i=++this.navigationId;this.transitions?.next({...this.transitions.value,...r,id:i})}setupNavigations(r,i,s){return this.transitions=new Ln({id:0,currentUrlTree:i,currentRawUrl:i,extractedUrl:this.urlHandlingStrategy.extract(i),urlAfterRedirects:this.urlHandlingStrategy.extract(i),rawUrl:i,extras:{},resolve:()=>{},reject:()=>{},promise:Promise.resolve(!0),source:xu,restoredState:null,currentSnapshot:s.snapshot,targetSnapshot:null,currentRouterState:s,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.transitions.pipe(Pi(o=>0!==o.id),Ue(o=>({...o,extractedUrl:this.urlHandlingStrategy.extract(o.rawUrl)})),ri(o=>{let a=!1,c=!1;return he(o).pipe(ri(l=>{if(this.navigationId>o.id)return this.cancelNavigationTransition(o,"",Zn.SupersededByNewNavigation),ni;this.currentTransition=o,this.currentNavigation={id:l.id,initialUrl:l.rawUrl,extractedUrl:l.extractedUrl,targetBrowserUrl:"string"==typeof l.extras.browserUrl?this.urlSerializer.parse(l.extras.browserUrl):l.extras.browserUrl,trigger:l.source,extras:l.extras,previousNavigation:this.lastSuccessfulNavigation?{...this.lastSuccessfulNavigation,previousNavigation:null}:null};const u=!r.navigated||this.isUpdatingInternalState()||this.isUpdatedBrowserUrl();if(!u&&"reload"!==(l.extras.onSameUrlNavigation??r.onSameUrlNavigation)){const f="";return this.events.next(new oc(l.id,this.urlSerializer.serialize(l.rawUrl),f,_p.IgnoredSameUrlNavigation)),l.resolve(!1),ni}if(this.urlHandlingStrategy.shouldProcessUrl(l.rawUrl))return he(l).pipe(ri(f=>{const h=this.transitions?.getValue();return this.events.next(new Au(f.id,this.urlSerializer.serialize(f.extractedUrl),f.source,f.restoredState)),h!==this.transitions?.getValue()?ni:Promise.resolve(f)}),function VZ(e,t,r,i,s,o){return cn(a=>function kZ(e,t,r,i,s,o,a="emptyOnly"){return new LZ(e,t,r,i,s,a,o).recognize()}(e,t,r,i,a.extractedUrl,s,o).pipe(Ue(({state:c,tree:l})=>({...a,targetSnapshot:c,urlAfterRedirects:l}))))}(this.environmentInjector,this.configLoader,this.rootComponentType,r.config,this.urlSerializer,this.paramsInheritanceStrategy),wn(f=>{o.targetSnapshot=f.targetSnapshot,o.urlAfterRedirects=f.urlAfterRedirects,this.currentNavigation={...this.currentNavigation,finalUrl:f.urlAfterRedirects};const h=new ZR(f.id,this.urlSerializer.serialize(f.extractedUrl),this.urlSerializer.serialize(f.urlAfterRedirects),f.targetSnapshot);this.events.next(h)}));if(u&&this.urlHandlingStrategy.shouldProcessUrl(l.currentRawUrl)){const{id:f,extractedUrl:h,source:p,restoredState:g,extras:m}=l,y=new Au(f,this.urlSerializer.serialize(h),p,g);this.events.next(y);const _=JR(this.rootComponentType).snapshot;return this.currentTransition=o={...l,targetSnapshot:_,urlAfterRedirects:h,extras:{...m,skipLocationChange:!1,replaceUrl:!1}},this.currentNavigation.finalUrl=h,he(o)}{const f="";return this.events.next(new oc(l.id,this.urlSerializer.serialize(l.extractedUrl),f,_p.IgnoredByUrlHandlingStrategy)),l.resolve(!1),ni}}),wn(l=>{const u=new OW(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects),l.targetSnapshot);this.events.next(u)}),Ue(l=>(this.currentTransition=o={...l,guards:nZ(l.targetSnapshot,l.currentSnapshot,this.rootContexts)},o)),function hZ(e,t){return cn(r=>{const{targetSnapshot:i,currentSnapshot:s,guards:{canActivateChecks:o,canDeactivateChecks:a}}=r;return 0===a.length&&0===o.length?he({...r,guardsResult:!0}):function pZ(e,t,r,i){return Gt(e).pipe(cn(s=>function wZ(e,t,r,i,s){const o=t&&t.routeConfig?t.routeConfig.canDeactivate:null;return o&&0!==o.length?he(o.map(c=>{const l=Mu(t)??s,u=lc(c,l);return vs(function uZ(e){return e&&Pu(e.canDeactivate)}(u)?u.canDeactivate(e,t,r,i):Ei(l,()=>u(e,t,r,i))).pipe(ms())})).pipe(uc()):he(!0)}(s.component,s.route,r,t,i)),ms(s=>!0!==s,!0))}(a,i,s,e).pipe(cn(c=>c&&function oZ(e){return"boolean"==typeof e}(c)?function gZ(e,t,r,i){return Gt(t).pipe(bu(s=>M_(function yZ(e,t){return null!==e&&t&&t(new VW(e)),he(!0)}(s.route.parent,i),function mZ(e,t){return null!==e&&t&&t(new jW(e)),he(!0)}(s.route,i),function _Z(e,t,r){const i=t[t.length-1],o=t.slice(0,t.length-1).reverse().map(a=>function rZ(e){const t=e.routeConfig?e.routeConfig.canActivateChild:null;return t&&0!==t.length?{node:e,guards:t}:null}(a)).filter(a=>null!==a).map(a=>TR(()=>he(a.guards.map(l=>{const u=Mu(a.node)??r,d=lc(l,u);return vs(function lZ(e){return e&&Pu(e.canActivateChild)}(d)?d.canActivateChild(i,e):Ei(u,()=>d(i,e))).pipe(ms())})).pipe(uc())));return he(o).pipe(uc())}(e,s.path,r),function vZ(e,t,r){const i=t.routeConfig?t.routeConfig.canActivate:null;if(!i||0===i.length)return he(!0);const s=i.map(o=>TR(()=>{const a=Mu(t)??r,c=lc(o,a);return vs(function cZ(e){return e&&Pu(e.canActivate)}(c)?c.canActivate(t,e):Ei(a,()=>c(t,e))).pipe(ms())}));return he(s).pipe(uc())}(e,s.route,r))),ms(s=>!0!==s,!0))}(i,o,e,t):he(c)),Ue(c=>({...r,guardsResult:c})))})}(this.environmentInjector,l=>this.events.next(l)),wn(l=>{if(o.guardsResult=l.guardsResult,l.guardsResult&&"boolean"!=typeof l.guardsResult)throw Dp(0,l.guardsResult);const u=new kW(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects),l.targetSnapshot,!!l.guardsResult);this.events.next(u)}),Pi(l=>!!l.guardsResult||(this.cancelNavigationTransition(l,"",Zn.GuardRejected),!1)),Q_(l=>{if(l.guards.canActivateChecks.length)return he(l).pipe(wn(u=>{const d=new PW(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects),u.targetSnapshot);this.events.next(d)}),ri(u=>{let d=!1;return he(u).pipe(function UZ(e,t){return cn(r=>{const{targetSnapshot:i,guards:{canActivateChecks:s}}=r;if(!s.length)return he(r);const o=new Set(s.map(l=>l.route)),a=new Set;for(const l of o)if(!a.has(l))for(const u of pO(l))a.add(u);let c=0;return Gt(a).pipe(bu(l=>o.has(l)?function jZ(e,t,r,i){const s=e.routeConfig,o=e._resolve;return void 0!==s?.title&&!tO(s)&&(o[Cu]=s.title),function $Z(e,t,r,i){const s=O_(e);if(0===s.length)return he({});const o={};return Gt(s).pipe(cn(a=>function HZ(e,t,r,i){const s=Mu(t)??i,o=lc(e,s);return vs(o.resolve?o.resolve(t,r):Ei(s,()=>o(t,r)))}(e[a],t,r,i).pipe(ms(),wn(c=>{if(c instanceof W_)throw Dp(new hp,c);o[a]=c}))),R_(1),function rW(e){return Ue(()=>e)}(o),ys(a=>aO(a)?ni:nc(a)))}(o,e,t,i).pipe(Ue(a=>(e._resolvedData=a,e.data=bp(e,e.parent,r).resolve,null)))}(l,i,e,t):(l.data=bp(l,l.parent,e).resolve,he(void 0))),wn(()=>c++),R_(1),cn(l=>c===a.size?he(r):ni))})}(this.paramsInheritanceStrategy,this.environmentInjector),wn({next:()=>d=!0,complete:()=>{d||this.cancelNavigationTransition(u,"",Zn.NoDataFromResolver)}}))}),wn(u=>{const d=new LW(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects),u.targetSnapshot);this.events.next(d)}))}),Q_(l=>{const u=d=>{const f=[];d.routeConfig?.loadComponent&&!d.routeConfig._loadedComponent&&f.push(this.configLoader.loadComponent(d.routeConfig).pipe(wn(h=>{d.component=h}),Ue(()=>{})));for(const h of d.children)f.push(...u(h));return f};return A_(u(l.targetSnapshot.root)).pipe(dp(null),rc(1))}),Q_(()=>this.afterPreactivation()),ri(()=>{const{currentSnapshot:l,targetSnapshot:u}=o,d=this.createViewTransition?.(this.environmentInjector,l.root,u.root);return d?Gt(d).pipe(Ue(()=>o)):he(o)}),Ue(l=>{const u=function QW(e,t,r){const i=Ru(e,t._root,r?r._root:void 0);return new YR(i,t)}(r.routeReuseStrategy,l.targetSnapshot,l.currentRouterState);return this.currentTransition=o={...l,targetRouterState:u},this.currentNavigation.targetRouterState=u,o}),wn(()=>{this.events.next(new V_)}),((e,t,r,i)=>Ue(s=>(new tZ(t,s.targetRouterState,s.currentRouterState,r,i).activate(e),s)))(this.rootContexts,r.routeReuseStrategy,l=>this.events.next(l),this.inputBindingEnabled),rc(1),wn({next:l=>{a=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new Li(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects))),this.titleStrategy?.updateTitle(l.targetRouterState.snapshot),l.resolve(!0)},complete:()=>{a=!0}}),function iW(e){return zt((t,r)=>{Tr(e).subscribe(Dt(r,()=>r.complete(),_m)),!r.closed&&t.subscribe(r)})}(this.transitionAbortSubject.pipe(wn(l=>{throw l}))),Eu(()=>{!a&&!c&&this.cancelNavigationTransition(o,"",Zn.SupersededByNewNavigation),this.currentTransition?.id===o.id&&(this.currentNavigation=null,this.currentTransition=null)}),ys(l=>{if(c=!0,sO(l))this.events.next(new To(o.id,this.urlSerializer.serialize(o.extractedUrl),l.message,l.cancellationCode)),function XW(e){return sO(e)&&So(e.url)}(l)?this.events.next(new wp(l.url,l.navigationBehaviorOptions)):o.resolve(!1);else{const u=new B_(o.id,this.urlSerializer.serialize(o.extractedUrl),l,o.targetSnapshot??void 0);try{const d=Ei(this.environmentInjector,()=>this.navigationErrorHandler?.(u));if(d instanceof W_){const{message:f,cancellationCode:h}=Dp(0,d);this.events.next(new To(o.id,this.urlSerializer.serialize(o.extractedUrl),f,h)),this.events.next(new wp(d.redirectTo,d.navigationBehaviorOptions))}else{this.events.next(u);const f=r.errorHandler(l);o.resolve(!!f)}}catch(d){this.options.resolveNavigationPromiseOnError?o.resolve(!1):o.reject(d)}}return ni}))}))}cancelNavigationTransition(r,i,s){const o=new To(r.id,this.urlSerializer.serialize(r.extractedUrl),i,s);this.events.next(o),r.resolve(!1)}isUpdatingInternalState(){return this.currentTransition?.extractedUrl.toString()!==this.currentTransition?.currentUrlTree.toString()}isUpdatedBrowserUrl(){const r=this.urlHandlingStrategy.extract(this.urlSerializer.parse(this.location.path(!0))),i=this.currentNavigation?.targetBrowserUrl??this.currentNavigation?.extractedUrl;return r.toString()!==i?.toString()&&!this.currentNavigation?.extras.skipLocationChange}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function QZ(e){return e!==xu}let YZ=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:()=>O(XZ),providedIn:"root"})}}return e})();class JZ{shouldDetach(t){return!1}store(t,r){}shouldAttach(t){return!1}retrieve(t){return null}shouldReuseRoute(t,r){return t.routeConfig===r.routeConfig}}let XZ=(()=>{class e extends JZ{static{this.\u0275fac=(()=>{let r;return function(s){return(r||(r=qt(e)))(s||e)}})()}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),bO=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:()=>O(eK),providedIn:"root"})}}return e})(),eK=(()=>{class e extends bO{constructor(){super(...arguments),this.location=O(gu),this.urlSerializer=O(sc),this.options=O(fc,{optional:!0})||{},this.canceledNavigationResolution=this.options.canceledNavigationResolution||"replace",this.urlHandlingStrategy=O(X_),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.currentUrlTree=new Co,this.rawUrlTree=this.currentUrlTree,this.currentPageId=0,this.lastSuccessfulId=-1,this.routerState=JR(null),this.stateMemento=this.createStateMemento()}getCurrentUrlTree(){return this.currentUrlTree}getRawUrlTree(){return this.rawUrlTree}restoredState(){return this.location.getState()}get browserPageId(){return"computed"!==this.canceledNavigationResolution?this.currentPageId:this.restoredState()?.\u0275routerPageId??this.currentPageId}getRouterState(){return this.routerState}createStateMemento(){return{rawUrlTree:this.rawUrlTree,currentUrlTree:this.currentUrlTree,routerState:this.routerState}}registerNonRouterCurrentEntryChangeListener(r){return this.location.subscribe(i=>{"popstate"===i.type&&r(i.url,i.state)})}handleRouterEvent(r,i){if(r instanceof Au)this.stateMemento=this.createStateMemento();else if(r instanceof oc)this.rawUrlTree=i.initialUrl;else if(r instanceof ZR){if("eager"===this.urlUpdateStrategy&&!i.extras.skipLocationChange){const s=this.urlHandlingStrategy.merge(i.finalUrl,i.initialUrl);this.setBrowserUrl(i.targetBrowserUrl??s,i)}}else r instanceof V_?(this.currentUrlTree=i.finalUrl,this.rawUrlTree=this.urlHandlingStrategy.merge(i.finalUrl,i.initialUrl),this.routerState=i.targetRouterState,"deferred"===this.urlUpdateStrategy&&!i.extras.skipLocationChange&&this.setBrowserUrl(i.targetBrowserUrl??this.rawUrlTree,i)):r instanceof To&&(r.code===Zn.GuardRejected||r.code===Zn.NoDataFromResolver)?this.restoreHistory(i):r instanceof B_?this.restoreHistory(i,!0):r instanceof Li&&(this.lastSuccessfulId=r.id,this.currentPageId=this.browserPageId)}setBrowserUrl(r,i){const s=r instanceof Co?this.urlSerializer.serialize(r):r;if(this.location.isCurrentPathEqualTo(s)||i.extras.replaceUrl){const a={...i.extras.state,...this.generateNgRouterState(i.id,this.browserPageId)};this.location.replaceState(s,"",a)}else{const o={...i.extras.state,...this.generateNgRouterState(i.id,this.browserPageId+1)};this.location.go(s,"",o)}}restoreHistory(r,i=!1){if("computed"===this.canceledNavigationResolution){const o=this.currentPageId-this.browserPageId;0!==o?this.location.historyGo(o):this.currentUrlTree===r.finalUrl&&0===o&&(this.resetState(r),this.resetUrlToCurrentUrlTree())}else"replace"===this.canceledNavigationResolution&&(i&&this.resetState(r),this.resetUrlToCurrentUrlTree())}resetState(r){this.routerState=this.stateMemento.routerState,this.currentUrlTree=this.stateMemento.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,r.finalUrl??this.rawUrlTree)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(r,i){return"computed"===this.canceledNavigationResolution?{navigationId:r,\u0275routerPageId:i}:{navigationId:r}}static{this.\u0275fac=(()=>{let r;return function(s){return(r||(r=qt(e)))(s||e)}})()}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Lu=function(e){return e[e.COMPLETE=0]="COMPLETE",e[e.FAILED=1]="FAILED",e[e.REDIRECTING=2]="REDIRECTING",e}(Lu||{});function EO(e,t){e.events.pipe(Pi(r=>r instanceof Li||r instanceof To||r instanceof B_||r instanceof oc),Ue(r=>r instanceof Li||r instanceof oc?Lu.COMPLETE:r instanceof To&&(r.code===Zn.Redirect||r.code===Zn.SupersededByNewNavigation)?Lu.REDIRECTING:Lu.FAILED),Pi(r=>r!==Lu.REDIRECTING),rc(1)).subscribe(()=>{t()})}function tK(e){throw e}const nK={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},rK={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};let oi=(()=>{class e{get currentUrlTree(){return this.stateManager.getCurrentUrlTree()}get rawUrlTree(){return this.stateManager.getRawUrlTree()}get events(){return this._events}get routerState(){return this.stateManager.getRouterState()}constructor(){this.disposed=!1,this.console=O(dM),this.stateManager=O(bO),this.options=O(fc,{optional:!0})||{},this.pendingTasks=O(io),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.navigationTransitions=O(Ap),this.urlSerializer=O(sc),this.location=O(gu),this.urlHandlingStrategy=O(X_),this._events=new Ze,this.errorHandler=this.options.errorHandler||tK,this.navigated=!1,this.routeReuseStrategy=O(YZ),this.onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore",this.config=O(hc,{optional:!0})?.flat()??[],this.componentInputBindingEnabled=!!O(Cp,{optional:!0}),this.eventsSubscription=new vt,this.resetConfig(this.config),this.navigationTransitions.setupNavigations(this,this.currentUrlTree,this.routerState).subscribe({error:r=>{this.console.warn(r)}}),this.subscribeToNavigationEvents()}subscribeToNavigationEvents(){const r=this.navigationTransitions.events.subscribe(i=>{try{const s=this.navigationTransitions.currentTransition,o=this.navigationTransitions.currentNavigation;if(null!==s&&null!==o)if(this.stateManager.handleRouterEvent(i,o),i instanceof To&&i.code!==Zn.Redirect&&i.code!==Zn.SupersededByNewNavigation)this.navigated=!0;else if(i instanceof Li)this.navigated=!0;else if(i instanceof wp){const a=i.navigationBehaviorOptions,c=this.urlHandlingStrategy.merge(i.url,s.currentRawUrl),l={browserUrl:s.extras.browserUrl,info:s.extras.info,skipLocationChange:s.extras.skipLocationChange,replaceUrl:s.extras.replaceUrl||"eager"===this.urlUpdateStrategy||QZ(s.source),...a};this.scheduleNavigation(c,xu,null,l,{resolve:s.resolve,reject:s.reject,promise:s.promise})}(function sK(e){return!(e instanceof V_||e instanceof wp)})(i)&&this._events.next(i)}catch(s){this.navigationTransitions.transitionAbortSubject.next(s)}});this.eventsSubscription.add(r)}resetRootComponentType(r){this.routerState.root.component=r,this.navigationTransitions.rootComponentType=r}initialNavigation(){this.setUpLocationChangeListener(),this.navigationTransitions.hasRequestedNavigation||this.navigateToSyncWithBrowser(this.location.path(!0),xu,this.stateManager.restoredState())}setUpLocationChangeListener(){this.nonRouterCurrentEntryChangeSubscription??=this.stateManager.registerNonRouterCurrentEntryChangeListener((r,i)=>{setTimeout(()=>{this.navigateToSyncWithBrowser(r,"popstate",i)},0)})}navigateToSyncWithBrowser(r,i,s){const o={replaceUrl:!0},a=s?.navigationId?s:null;if(s){const l={...s};delete l.navigationId,delete l.\u0275routerPageId,0!==Object.keys(l).length&&(o.state=l)}const c=this.parseUrl(r);this.scheduleNavigation(c,i,a,o)}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.navigationTransitions.currentNavigation}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(r){this.config=r.map(Y_),this.navigated=!1}ngOnDestroy(){this.dispose()}dispose(){this.navigationTransitions.complete(),this.nonRouterCurrentEntryChangeSubscription&&(this.nonRouterCurrentEntryChangeSubscription.unsubscribe(),this.nonRouterCurrentEntryChangeSubscription=void 0),this.disposed=!0,this.eventsSubscription.unsubscribe()}createUrlTree(r,i={}){const{relativeTo:s,queryParams:o,fragment:a,queryParamsHandling:c,preserveFragment:l}=i,u=l?this.currentUrlTree.fragment:a;let f,d=null;switch(c??this.options.defaultQueryParamsHandling){case"merge":d={...this.currentUrlTree.queryParams,...o};break;case"preserve":d=this.currentUrlTree.queryParams;break;default:d=o||null}null!==d&&(d=this.removeEmptyProps(d));try{f=jR(s?s.snapshot:this.routerState.snapshot.root)}catch{("string"!=typeof r[0]||"/"!==r[0][0])&&(r=[]),f=this.currentUrlTree.root}return $R(f,r,d,u??null)}navigateByUrl(r,i={skipLocationChange:!1}){const s=So(r)?r:this.parseUrl(r),o=this.urlHandlingStrategy.merge(s,this.rawUrlTree);return this.scheduleNavigation(o,xu,null,i)}navigate(r,i={skipLocationChange:!1}){return function iK(e){for(let t=0;t(null!=o&&(i[s]=o),i),{})}scheduleNavigation(r,i,s,o,a){if(this.disposed)return Promise.resolve(!1);let c,l,u;a?(c=a.resolve,l=a.reject,u=a.promise):u=new Promise((f,h)=>{c=f,l=h});const d=this.pendingTasks.add();return EO(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(d))}),this.navigationTransitions.handleNavigationRequest({source:i,restoredState:s,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,rawUrl:r,extras:o,resolve:c,reject:l,promise:u,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),u.catch(f=>Promise.reject(f))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();class CO{}let cK=(()=>{class e{constructor(r,i,s,o,a){this.router=r,this.injector=s,this.preloadingStrategy=o,this.loader=a}setUpPreloading(){this.subscription=this.router.events.pipe(Pi(r=>r instanceof Li),bu(()=>this.preload())).subscribe(()=>{})}preload(){return this.processRoutes(this.injector,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(r,i){const s=[];for(const o of i){o.providers&&!o._injector&&(o._injector=lh(o.providers,r,`Route: ${o.path}`));const a=o._injector??r,c=o._loadedInjector??a;(o.loadChildren&&!o._loadedRoutes&&void 0===o.canLoad||o.loadComponent&&!o._loadedComponent)&&s.push(this.preloadConfig(a,o)),(o.children||o._loadedRoutes)&&s.push(this.processRoutes(c,o.children??o._loadedRoutes))}return Gt(s).pipe(wu())}preloadConfig(r,i){return this.preloadingStrategy.preload(i,()=>{let s;s=i.loadChildren&&void 0===i.canLoad?this.loader.loadChildren(r,i):he(null);const o=s.pipe(cn(a=>null===a?he(void 0):(i._loadedRoutes=a.routes,i._loadedInjector=a.injector,this.processRoutes(a.injector??r,a.routes))));return i.loadComponent&&!i._loadedComponent?Gt([o,this.loader.loadComponent(i)]).pipe(wu()):o})}static{this.\u0275fac=function(i){return new(i||e)(z(oi),z(EM),z(In),z(CO),z(J_))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const tw=new q("");let DO=(()=>{class e{constructor(r,i,s,o,a={}){this.urlSerializer=r,this.transitions=i,this.viewportScroller=s,this.zone=o,this.options=a,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},a.scrollPositionRestoration||="disabled",a.anchorScrolling||="disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.transitions.events.subscribe(r=>{r instanceof Au?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=r.navigationTrigger,this.restoredId=r.restoredState?r.restoredState.navigationId:0):r instanceof Li?(this.lastId=r.id,this.scheduleScrollEvent(r,this.urlSerializer.parse(r.urlAfterRedirects).fragment)):r instanceof oc&&r.code===_p.IgnoredSameUrlNavigation&&(this.lastSource=void 0,this.restoredId=0,this.scheduleScrollEvent(r,this.urlSerializer.parse(r.url).fragment))})}consumeScrollEvents(){return this.transitions.events.subscribe(r=>{r instanceof KR&&(r.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(r.position):r.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(r.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(r,i){this.zone.runOutsideAngular(()=>{setTimeout(()=>{this.zone.run(()=>{this.transitions.events.next(new KR(r,"popstate"===this.lastSource?this.store[this.restoredId]:null,i))})},0)})}ngOnDestroy(){this.routerEventsSubscription?.unsubscribe(),this.scrollEventsSubscription?.unsubscribe()}static{this.\u0275fac=function(i){!function iI(){throw new Error("invalid")}()}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})();function ai(e,t){return{\u0275kind:e,\u0275providers:t}}function TO(){const e=O(xt);return t=>{const r=e.get(ar);if(t!==r.components[0])return;const i=e.get(oi),s=e.get(IO);1===e.get(nw)&&i.initialNavigation(),e.get(xO,null,Te.Optional)?.setUpPreloading(),e.get(tw,null,Te.Optional)?.init(),i.resetRootComponentType(r.componentTypes[0]),s.closed||(s.next(),s.complete(),s.unsubscribe())}}const IO=new q("",{factory:()=>new Ze}),nw=new q("",{providedIn:"root",factory:()=>1}),xO=new q("");function fK(e){return ai(0,[{provide:xO,useExisting:cK},{provide:CO,useExisting:e}])}function pK(e){return ai(9,[{provide:vO,useValue:ZZ},{provide:_O,useValue:{skipNextTransition:!!e?.skipInitialTransition,...e}}])}const AO=new q("ROUTER_FORROOT_GUARD"),gK=[gu,{provide:sc,useClass:hp},oi,Nu,{provide:cc,useFactory:function SO(e){return e.routerState.root},deps:[oi]},J_,[]];let MO=(()=>{class e{constructor(r){}static forRoot(r,i){return{ngModule:e,providers:[gK,[],{provide:hc,multi:!0,useValue:r},{provide:AO,useFactory:_K,deps:[[oi,new Qd,new Yd]]},{provide:fc,useValue:i||{}},i?.useHash?{provide:bo,useClass:N9}:{provide:bo,useClass:pN},{provide:tw,useFactory:()=>{const e=O(K7),t=O(Ne),r=O(fc),i=O(Ap),s=O(sc);return r.scrollOffset&&e.setOffset(r.scrollOffset),new DO(s,i,e,t,r)}},i?.preloadingStrategy?fK(i.preloadingStrategy).\u0275providers:[],i?.initialNavigation?wK(i):[],i?.bindToComponentInputs?ai(8,[nO,{provide:Cp,useExisting:nO}]).\u0275providers:[],i?.enableViewTransitions?pK().\u0275providers:[],[{provide:NO,useFactory:TO},{provide:Oh,multi:!0,useExisting:NO}]]}}static forChild(r){return{ngModule:e,providers:[{provide:hc,multi:!0,useValue:r}]}}static{this.\u0275fac=function(i){return new(i||e)(z(AO,8))}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({})}}return e})();function _K(e){return"guarded"}function wK(e){return["disabled"===e.initialNavigation?ai(3,[{provide:F0,multi:!0,useFactory:()=>{const t=O(oi);return()=>{t.setUpLocationChangeListener()}}},{provide:nw,useValue:2}]).\u0275providers:[],"enabledBlocking"===e.initialNavigation?ai(2,[{provide:nw,useValue:0},{provide:F0,multi:!0,deps:[xt],useFactory:t=>{const r=t.get(A9,Promise.resolve());return()=>r.then(()=>new Promise(i=>{const s=t.get(oi),o=t.get(IO);EO(s,()=>{i(!0)}),t.get(Ap).afterPreactivation=()=>(i(!0),o.closed?he(void 0):o),s.initialNavigation()}))}}]).\u0275providers:[]]}const NO=new q("");function RO(e,t,r,i,s,o,a){try{var c=e[o](a),l=c.value}catch(u){return void r(u)}c.done?t(l):Promise.resolve(l).then(i,s)}function U(e){return function(){var t=this,r=arguments;return new Promise(function(i,s){var o=e.apply(t,r);function a(l){RO(o,i,s,a,c,"next",l)}function c(l){RO(o,i,s,a,c,"throw",l)}a(void 0)})}}var _s=function(e){return e.STRANGER="STRANGER",e.YOU="YOU",e}(_s||{}),Fi=function(e){return e.CONNECTED="CONNECTED",e.UP_TO_DISCONNECT="UP_TO_DISCONNECT",e.DISCONNECTED="DISCONNECTED",e.SEARCHING_STRANGER="SEARCHING_STRANGER",e}(Fi||{});const EK=["modalContainer"];function CK(e,t){}class Fu{static{this.modalInjectSubject=new Ze}static{this.modalInject$=Fu.modalInjectSubject.asObservable()}constructor(t){this.component=t,this.injectData=null,this.cssClasses=[],this.outletName="default",this.subscription=new vt}setData(t){return this.injectData=t,this}setBindToRoute(t){return this.router=t,this}setRootCssClasses(t){return this.cssClasses=t,this}setOutletName(t){return this.outletName=t,this}build(){const t=new Ze,r=this.injectData,i=this.component,s=this.outletName;return this.router?(this.subscription.add(this.router.events.pipe(Pi(o=>o instanceof Au)).pipe(ms()).subscribe(()=>{t.closed||t.complete()})),this.subscription.add(t.subscribe({complete:()=>this.subscription.unsubscribe()}))):console.warn(`Component "${i.name}" served as modal was not associated with the route and will not be automatically removed if the route is changed`),Fu.modalInjectSubject.next({component:i,data:r,outletName:s,cssClasses:this.cssClasses,response:t}),t.asObservable()}}let OO=(()=>{class e{createModal(r){return new Fu(r)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})(),DK=(()=>{class e{constructor(r){this.ngZone=r,this.modalInject$=Fu.modalInject$,this.classes=[],this.isOpen=!1,this.content=null,this.subscriptions=new vt,this.container=null,this.display="none",this.showingDisplay="block",this.name="default",this.opened=new dt,this.closed=new dt}ngOnInit(){this.listenModalInjection()}listenModalInjection(){this.subscriptions.add(this.modalInject$.subscribe({next:r=>this.renderModal(r)}))}renderModal(r){r.outletName===this.name&&setTimeout(()=>{this.open(),this.openModal(r)})}open(){this.ngZone.run(()=>{this.isOpen=!0,this.display=this.showingDisplay,this.opened.emit()})}close(){this.ngZone.run(()=>{this.isOpen=!1,this.display="none",this.closed.emit()})}getClasses(r){return(r=r||[]).concat(this.classes).join(" ")}openModal(r){const i=this.container;if(!i)return void console.error("Impossible to create modal: the this.container attribute is empty");i.clear();const s=this.content=i.createComponent(r.component).instance;this.classes=r.cssClasses,s?(s.response=r.response,s.onInjectData&&s.onInjectData(r.data||null),r.response.subscribe({error:this.closeModal.bind(this),complete:this.closeModal.bind(this)})):console.error(`Could not create component ${r.component.name} inside modal container.`)}closeModal(r){const i=this.container;i?setTimeout(()=>{i.clear(),this.close(),this.content?.response.complete()}):console.error("Impossible to create modal: the this.container attribute is empty",r)}ngOnDestroy(){this.subscriptions.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)(k(Ne))}}static{this.\u0275cmp=ts({type:e,selectors:[["modal-outlet"]],viewQuery:function(i,s){if(1&i&&C0(EK,5,rr),2&i){let o;Sh(o=Th())&&(s.container=o.first)}},hostVars:2,hostBindings:function(i,s){2&i&&vo("display",s.display)},inputs:{showingDisplay:"showingDisplay",name:"name"},outputs:{opened:"opened",closed:"closed"},decls:2,vars:0,consts:[["modalContainer",""]],template:function(i,s){1&i&&sr(0,CK,0,0,"ng-template",null,0,KA)},encapsulation:2})}}return e})(),SK=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({providers:[OO]})}}return e})();class TK{close(){this.response.complete()}}function Bu(e){-1===e.indexOf("://")&&(e="wss://"+e);let t=new URL(e);return t.pathname=t.pathname.replace(/\/+/g,"/"),t.pathname.endsWith("/")&&(t.pathname=t.pathname.slice(0,-1)),("80"===t.port&&"ws:"===t.protocol||"443"===t.port&&"wss:"===t.protocol)&&(t.port=""),t.searchParams.sort(),t.hash="",t.toString()}new TextDecoder("utf-8"),new TextEncoder;let rw=(()=>{class e{saveConfig(r){localStorage.setItem("omeglestr",JSON.stringify({relays:r}))}getConfig(){const r=localStorage.getItem("omeglestr");try{if(r)return JSON.parse(r).relays.map(Bu)}catch{}return"wss://relay.nostr.net".split(",").map(Bu)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const ln=new q(""),bs=new q("");function GO(e){return null!=e}function WO(e){return cu(e)?Gt(e):e}function ZO(e){let t={};return e.forEach(r=>{t=null!=r?{...t,...r}:t}),0===Object.keys(t).length?null:t}function KO(e,t){return t.map(r=>r(e))}function QO(e){return e.map(t=>function kK(e){return!e.validate}(t)?t:r=>t.validate(r))}function sw(e){return null!=e?function YO(e){if(!e)return null;const t=e.filter(GO);return 0==t.length?null:function(r){return ZO(KO(r,t))}}(QO(e)):null}function ow(e){return null!=e?function JO(e){if(!e)return null;const t=e.filter(GO);return 0==t.length?null:function(r){return function xK(...e){const t=bR(e),{args:r,keys:i}=ER(e),s=new Ht(o=>{const{length:a}=r;if(!a)return void o.complete();const c=new Array(a);let l=a,u=a;for(let d=0;d{f||(f=!0,u--),c[d]=h},()=>l--,void 0,()=>{(!l||!f)&&(u||o.next(i?DR(i,c):c),o.complete())}))}});return t?s.pipe(CR(t)):s}(KO(r,t).map(WO)).pipe(Ue(ZO))}}(QO(e)):null}function XO(e,t){return null===e?[t]:Array.isArray(e)?[...e,t]:[e,t]}function aw(e){return e?Array.isArray(e)?e:[e]:[]}function Np(e,t){return Array.isArray(e)?e.includes(t):e===t}function nk(e,t){const r=aw(t);return aw(e).forEach(s=>{Np(r,s)||r.push(s)}),r}function rk(e,t){return aw(t).filter(r=>!Np(e,r))}class ik{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=sw(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=ow(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t=void 0){this.control&&this.control.reset(t)}hasError(t,r){return!!this.control&&this.control.hasError(t,r)}getError(t,r){return this.control?this.control.getError(t,r):null}}class bn extends ik{get formDirective(){return null}get path(){return null}}class sk{constructor(t){this._cd=t}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}}let ok=(()=>{class e extends sk{constructor(r){super(r)}static{this.\u0275fac=function(i){return new(i||e)(k(bn,10))}}static{this.\u0275dir=de({type:e,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(i,s){2&i&&Ql("ng-untouched",s.isUntouched)("ng-touched",s.isTouched)("ng-pristine",s.isPristine)("ng-dirty",s.isDirty)("ng-valid",s.isValid)("ng-invalid",s.isInvalid)("ng-pending",s.isPending)("ng-submitted",s.isSubmitted)},features:[je]})}}return e})();const Vu="VALID",Op="INVALID",pc="PENDING",Uu="DISABLED";class gc{}class ck extends gc{constructor(t,r){super(),this.value=t,this.source=r}}class uw extends gc{constructor(t,r){super(),this.pristine=t,this.source=r}}class dw extends gc{constructor(t,r){super(),this.touched=t,this.source=r}}class kp extends gc{constructor(t,r){super(),this.status=t,this.source=r}}function Pp(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}class pw{constructor(t,r){this._pendingDirty=!1,this._hasOwnPendingAsyncValidator=null,this._pendingTouched=!1,this._onCollectionChange=()=>{},this._parent=null,this._status=pu(()=>this.statusReactive()),this.statusReactive=Zr(void 0),this._pristine=pu(()=>this.pristineReactive()),this.pristineReactive=Zr(!0),this._touched=pu(()=>this.touchedReactive()),this.touchedReactive=Zr(!1),this._events=new Ze,this.events=this._events.asObservable(),this._onDisabledChange=[],this._assignValidators(t),this._assignAsyncValidators(r)}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t}get parent(){return this._parent}get status(){return ei(this.statusReactive)}set status(t){ei(()=>this.statusReactive.set(t))}get valid(){return this.status===Vu}get invalid(){return this.status===Op}get pending(){return this.status==pc}get disabled(){return this.status===Uu}get enabled(){return this.status!==Uu}get pristine(){return ei(this.pristineReactive)}set pristine(t){ei(()=>this.pristineReactive.set(t))}get dirty(){return!this.pristine}get touched(){return ei(this.touchedReactive)}set touched(t){ei(()=>this.touchedReactive.set(t))}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._assignValidators(t)}setAsyncValidators(t){this._assignAsyncValidators(t)}addValidators(t){this.setValidators(nk(t,this._rawValidators))}addAsyncValidators(t){this.setAsyncValidators(nk(t,this._rawAsyncValidators))}removeValidators(t){this.setValidators(rk(t,this._rawValidators))}removeAsyncValidators(t){this.setAsyncValidators(rk(t,this._rawAsyncValidators))}hasValidator(t){return Np(this._rawValidators,t)}hasAsyncValidator(t){return Np(this._rawAsyncValidators,t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){const r=!1===this.touched;this.touched=!0;const i=t.sourceControl??this;this._parent&&!t.onlySelf&&this._parent.markAsTouched({...t,sourceControl:i}),r&&!1!==t.emitEvent&&this._events.next(new dw(!0,i))}markAllAsTouched(t={}){this.markAsTouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(r=>r.markAllAsTouched(t))}markAsUntouched(t={}){const r=!0===this.touched;this.touched=!1,this._pendingTouched=!1;const i=t.sourceControl??this;this._forEachChild(s=>{s.markAsUntouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:i})}),this._parent&&!t.onlySelf&&this._parent._updateTouched(t,i),r&&!1!==t.emitEvent&&this._events.next(new dw(!1,i))}markAsDirty(t={}){const r=!0===this.pristine;this.pristine=!1;const i=t.sourceControl??this;this._parent&&!t.onlySelf&&this._parent.markAsDirty({...t,sourceControl:i}),r&&!1!==t.emitEvent&&this._events.next(new uw(!1,i))}markAsPristine(t={}){const r=!1===this.pristine;this.pristine=!0,this._pendingDirty=!1;const i=t.sourceControl??this;this._forEachChild(s=>{s.markAsPristine({onlySelf:!0,emitEvent:t.emitEvent})}),this._parent&&!t.onlySelf&&this._parent._updatePristine(t,i),r&&!1!==t.emitEvent&&this._events.next(new uw(!0,i))}markAsPending(t={}){this.status=pc;const r=t.sourceControl??this;!1!==t.emitEvent&&(this._events.next(new kp(this.status,r)),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.markAsPending({...t,sourceControl:r})}disable(t={}){const r=this._parentMarkedDirty(t.onlySelf);this.status=Uu,this.errors=null,this._forEachChild(s=>{s.disable({...t,onlySelf:!0})}),this._updateValue();const i=t.sourceControl??this;!1!==t.emitEvent&&(this._events.next(new ck(this.value,i)),this._events.next(new kp(this.status,i)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors({...t,skipPristineCheck:r},this),this._onDisabledChange.forEach(s=>s(!0))}enable(t={}){const r=this._parentMarkedDirty(t.onlySelf);this.status=Vu,this._forEachChild(i=>{i.enable({...t,onlySelf:!0})}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors({...t,skipPristineCheck:r},this),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(t,r){this._parent&&!t.onlySelf&&(this._parent.updateValueAndValidity(t),t.skipPristineCheck||this._parent._updatePristine({},r),this._parent._updateTouched({},r))}setParent(t){this._parent=t}getRawValue(){return this.value}updateValueAndValidity(t={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){const i=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===Vu||this.status===pc)&&this._runAsyncValidator(i,t.emitEvent)}const r=t.sourceControl??this;!1!==t.emitEvent&&(this._events.next(new ck(this.value,r)),this._events.next(new kp(this.status,r)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity({...t,sourceControl:r})}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(r=>r._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?Uu:Vu}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t,r){if(this.asyncValidator){this.status=pc,this._hasOwnPendingAsyncValidator={emitEvent:!1!==r};const i=WO(this.asyncValidator(this));this._asyncValidationSubscription=i.subscribe(s=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(s,{emitEvent:r,shouldHaveEmitted:t})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();const t=this._hasOwnPendingAsyncValidator?.emitEvent??!1;return this._hasOwnPendingAsyncValidator=null,t}return!1}setErrors(t,r={}){this.errors=t,this._updateControlsErrors(!1!==r.emitEvent,this,r.shouldHaveEmitted)}get(t){let r=t;return null==r||(Array.isArray(r)||(r=r.split(".")),0===r.length)?null:r.reduce((i,s)=>i&&i._find(s),this)}getError(t,r){const i=r?this.get(r):this;return i&&i.errors?i.errors[t]:null}hasError(t,r){return!!this.getError(t,r)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t,r,i){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),(t||i)&&this._events.next(new kp(this.status,r)),this._parent&&this._parent._updateControlsErrors(t,r,i)}_initObservables(){this.valueChanges=new dt,this.statusChanges=new dt}_calculateStatus(){return this._allControlsDisabled()?Uu:this.errors?Op:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(pc)?pc:this._anyControlsHaveStatus(Op)?Op:Vu}_anyControlsHaveStatus(t){return this._anyControls(r=>r.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t,r){const i=!this._anyControlsDirty(),s=this.pristine!==i;this.pristine=i,this._parent&&!t.onlySelf&&this._parent._updatePristine(t,r),s&&this._events.next(new uw(this.pristine,r))}_updateTouched(t={},r){this.touched=this._anyControlsTouched(),this._events.next(new dw(this.touched,r)),this._parent&&!t.onlySelf&&this._parent._updateTouched(t,r)}_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){Pp(t)&&null!=t.updateOn&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){return!t&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}_find(t){return null}_assignValidators(t){this._rawValidators=Array.isArray(t)?t.slice():t,this._composedValidatorFn=function $K(e){return Array.isArray(e)?sw(e):e||null}(this._rawValidators)}_assignAsyncValidators(t){this._rawAsyncValidators=Array.isArray(t)?t.slice():t,this._composedAsyncValidatorFn=function HK(e){return Array.isArray(e)?ow(e):e||null}(this._rawAsyncValidators)}}class gw extends pw{constructor(t,r,i){super(function fw(e){return(Pp(e)?e.validators:e)||null}(r),function hw(e,t){return(Pp(t)?t.asyncValidators:e)||null}(i,r)),this.controls=t,this._initObservables(),this._setUpdateStrategy(r),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}registerControl(t,r){return this.controls[t]?this.controls[t]:(this.controls[t]=r,r.setParent(this),r._registerOnCollectionChange(this._onCollectionChange),r)}addControl(t,r,i={}){this.registerControl(t,r),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(t,r={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity({emitEvent:r.emitEvent}),this._onCollectionChange()}setControl(t,r,i={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],r&&this.registerControl(t,r),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled}setValue(t,r={}){(function uk(e,t,r){e._forEachChild((i,s)=>{if(void 0===r[s])throw new A(1002,"")})})(this,0,t),Object.keys(t).forEach(i=>{(function lk(e,t,r){const i=e.controls;if(!(t?Object.keys(i):i).length)throw new A(1e3,"");if(!i[r])throw new A(1001,"")})(this,!0,i),this.controls[i].setValue(t[i],{onlySelf:!0,emitEvent:r.emitEvent})}),this.updateValueAndValidity(r)}patchValue(t,r={}){null!=t&&(Object.keys(t).forEach(i=>{const s=this.controls[i];s&&s.patchValue(t[i],{onlySelf:!0,emitEvent:r.emitEvent})}),this.updateValueAndValidity(r))}reset(t={},r={}){this._forEachChild((i,s)=>{i.reset(t?t[s]:null,{onlySelf:!0,emitEvent:r.emitEvent})}),this._updatePristine(r,this),this._updateTouched(r,this),this.updateValueAndValidity(r)}getRawValue(){return this._reduceChildren({},(t,r,i)=>(t[i]=r.getRawValue(),t))}_syncPendingControls(){let t=this._reduceChildren(!1,(r,i)=>!!i._syncPendingControls()||r);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_forEachChild(t){Object.keys(this.controls).forEach(r=>{const i=this.controls[r];i&&t(i,r)})}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(t){for(const[r,i]of Object.entries(this.controls))if(this.contains(r)&&t(i))return!0;return!1}_reduceValue(){return this._reduceChildren({},(r,i,s)=>((i.enabled||this.disabled)&&(r[s]=i.value),r))}_reduceChildren(t,r){let i=t;return this._forEachChild((s,o)=>{i=r(i,s,o)}),i}_allControlsDisabled(){for(const t of Object.keys(this.controls))if(this.controls[t].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(t){return this.controls.hasOwnProperty(t)?this.controls[t]:null}}const mc=new q("CallSetDisabledState",{providedIn:"root",factory:()=>Lp}),Lp="always";function Vp(e,t){e.forEach(r=>{r.registerOnValidatorChange&&r.registerOnValidatorChange(t)})}function mw(e,t){const r=function ek(e){return e._rawValidators}(e);null!==t.validator?e.setValidators(XO(r,t.validator)):"function"==typeof r&&e.setValidators([r]);const i=function tk(e){return e._rawAsyncValidators}(e);null!==t.asyncValidator?e.setAsyncValidators(XO(i,t.asyncValidator)):"function"==typeof i&&e.setAsyncValidators([i]);const s=()=>e.updateValueAndValidity();Vp(t._rawValidators,s),Vp(t._rawAsyncValidators,s)}function dk(e,t){e._pendingDirty&&e.markAsDirty(),e.setValue(e._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1}const XK={provide:bn,useExisting:et(()=>jp)},$u=Promise.resolve();let jp=(()=>{class e extends bn{get submitted(){return ei(this.submittedReactive)}constructor(r,i,s){super(),this.callSetDisabledState=s,this._submitted=pu(()=>this.submittedReactive()),this.submittedReactive=Zr(!1),this._directives=new Set,this.ngSubmit=new dt,this.form=new gw({},sw(r),ow(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(r){$u.then(()=>{const i=this._findContainer(r.path);r.control=i.registerControl(r.name,r.control),function ju(e,t,r=Lp){mw(e,t),t.valueAccessor.writeValue(e.value),(e.disabled||"always"===r)&&t.valueAccessor.setDisabledState?.(e.disabled),function GK(e,t){t.valueAccessor.registerOnChange(r=>{e._pendingValue=r,e._pendingChange=!0,e._pendingDirty=!0,"change"===e.updateOn&&dk(e,t)})}(e,t),function ZK(e,t){const r=(i,s)=>{t.valueAccessor.writeValue(i),s&&t.viewToModelUpdate(i)};e.registerOnChange(r),t._registerOnDestroy(()=>{e._unregisterOnChange(r)})}(e,t),function WK(e,t){t.valueAccessor.registerOnTouched(()=>{e._pendingTouched=!0,"blur"===e.updateOn&&e._pendingChange&&dk(e,t),"submit"!==e.updateOn&&e.markAsTouched()})}(e,t),function qK(e,t){if(t.valueAccessor.setDisabledState){const r=i=>{t.valueAccessor.setDisabledState(i)};e.registerOnDisabledChange(r),t._registerOnDestroy(()=>{e._unregisterOnDisabledChange(r)})}}(e,t)}(r.control,r,this.callSetDisabledState),r.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(r)})}getControl(r){return this.form.get(r.path)}removeControl(r){$u.then(()=>{const i=this._findContainer(r.path);i&&i.removeControl(r.name),this._directives.delete(r)})}addFormGroup(r){$u.then(()=>{const i=this._findContainer(r.path),s=new gw({});(function fk(e,t){mw(e,t)})(s,r),i.registerControl(r.name,s),s.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(r){$u.then(()=>{const i=this._findContainer(r.path);i&&i.removeControl(r.name)})}getFormGroup(r){return this.form.get(r.path)}updateModel(r,i){$u.then(()=>{this.form.get(r.path).setValue(i)})}setValue(r){this.control.setValue(r)}onSubmit(r){return this.submittedReactive.set(!0),function hk(e,t){e._syncPendingControls(),t.forEach(r=>{const i=r.control;"submit"===i.updateOn&&i._pendingChange&&(r.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}(this.form,this._directives),this.ngSubmit.emit(r),"dialog"===r?.target?.method}onReset(){this.resetForm()}resetForm(r=void 0){this.form.reset(r),this.submittedReactive.set(!1)}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)}_findContainer(r){return r.pop(),r.length?this.form.get(r):this.form}static{this.\u0275fac=function(i){return new(i||e)(k(ln,10),k(bs,10),k(mc,8))}}static{this.\u0275dir=de({type:e,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(i,s){1&i&&$e("submit",function(a){return s.onSubmit(a)})("reset",function(){return s.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[ft([XK]),je]})}}return e})();Promise.resolve();let bk=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275dir=de({type:e,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""]})}}return e})(),TQ=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({})}}return e})(),xQ=(()=>{class e{static withConfig(r){return{ngModule:e,providers:[{provide:mc,useValue:r.callSetDisabledState??Lp}]}}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({imports:[TQ]})}}return e})();function AQ(e,t){if(1&e){const r=Jr();fe(0,"li")(1,"span"),Le(2),me(),fe(3,"button",18),$e("click",function(){const s=Kt(r).$implicit;return Qt(Ct().removeRelay(s))}),Le(4,"\u2715"),me()()}if(2&e){const r=t.$implicit;be(2),Qa(r)}}let MQ=(()=>{class e extends TK{constructor(r){super(),this.relayConfigService=r,this.response=new Ze,this.relays=[]}ngOnInit(){this.relays=this.relayConfigService.getConfig()}removeRelay(r){const i=Bu(r),o=this.relays.indexOf(i);-1!==o&&this.relays.splice(o,1)}addRelay(r){r.value&&(this.relays=[...new Set([...this.relays,Bu(r.value)])],r.value="")}ok(){this.response.next(!0),this.close()}cancel(){this.response.next(!1),this.close()}useDefault(){this.relays="wss://relay.nostr.net".split(",").map(Bu),this.save()}save(){this.relayConfigService.saveConfig([...new Set(this.relays)]),this.close()}static{this.\u0275fac=function(i){return new(i||e)(k(rw))}}static{this.\u0275cmp=ts({type:e,selectors:[["omg-relay-config"]],features:[je],decls:30,vars:1,consts:[["relayField",""],["type","button",1,"closeButton","exitButton",3,"click"],[1,"relayList"],[4,"ngFor","ngForOf"],[1,"warn"],[1,"field"],[1,"fieldWithButton"],["name","relay","type","text","autocomplete","off","placeholder","wss://relay.example",3,"keyup.enter"],["type","button",3,"click"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["stroke","none","d","M0 0h24v24H0z","fill","none"],["d","M7 12l5 5l-1.5 1.5a3.536 3.536 0 1 1 -5 -5l1.5 -1.5z"],["d","M17 12l-5 -5l1.5 -1.5a3.536 3.536 0 1 1 5 5l-1.5 1.5z"],["d","M3 21l2.5 -2.5"],["d","M18.5 5.5l2.5 -2.5"],["d","M10 11l-2 2"],["d","M13 14l-2 2"],[1,"button-group"],["type","button",1,"closeButton",3,"click"]],template:function(i,s){if(1&i){const o=Jr();fe(0,"form")(1,"h1")(2,"span"),Le(3,"Configure nostr relays"),me(),fe(4,"button",1),$e("click",function(){return Kt(o),Qt(s.close())}),Le(5,"\u2715"),me()(),fe(6,"ul",2),sr(7,AQ,5,1,"li",3),me(),fe(8,"span",4),Le(9,"By changing default relays, will be harder find strangers"),me(),fe(10,"div",5)(11,"label"),Le(12,"Relay"),me(),fe(13,"div",6)(14,"input",7,0),$e("keyup.enter",function(){Kt(o);const c=Ka(15);return Qt(s.addRelay(c))}),me(),fe(16,"button",8),$e("click",function(){Kt(o);const c=Ka(15);return Qt(s.addRelay(c))}),vf(),fe(17,"svg",9),or(18,"path",10)(19,"path",11)(20,"path",12)(21,"path",13)(22,"path",14)(23,"path",15)(24,"path",16),me()()()(),_f(),fe(25,"div",17)(26,"button",8),$e("click",function(){return Kt(o),Qt(s.useDefault())}),Le(27,"Use default"),me(),fe(28,"button",8),$e("click",function(){return Kt(o),Qt(s.save())}),Le(29,"Save"),me()()()}2&i&&(be(7),qe("ngForOf",s.relays))},dependencies:[a_,bk,ok,jp],styles:[".closeButton[_ngcontent-%COMP%]{border:0;cursor:pointer;appearance:none;background-color:transparent;font-size:10px;margin-left:1rem}.closeButton.exitButton[_ngcontent-%COMP%]{float:right}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column}h1[_ngcontent-%COMP%]{font-size:14px;margin-bottom:1rem}.fieldWithButton[_ngcontent-%COMP%]{display:flex}.fieldWithButton[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{padding:3px 1rem;border-radius:5px 0 0 5px;border:1px solid black}.fieldWithButton[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border-left:0;border-radius:0 5px 5px 0}button[_ngcontent-%COMP%]{background-color:#fff;border:1px solid black;padding:.25rem .5rem;border-radius:5px;cursor:pointer}button[_ngcontent-%COMP%]:hover{background-color:#f1f1f1}button[_ngcontent-%COMP%]:active{background-color:#e6e6e6}.button-group[_ngcontent-%COMP%]{display:flex;margin:1rem 0 0;justify-content:space-between}"]})}}return e})(),Tw=(()=>{class e extends Ze{constructor(){super()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),Iw=(()=>{class e extends nr{constructor(r){super(),this.error$=r}handleError(r){/^AbortError/.test(String(r))||(r.errors&&r.errors.length?r.errors.forEach(i=>{console.error((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]",i.message),this.error$.next(i.message)}):r.message?(console.error((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]",r.message),this.error$.next(r.message)):(console.error((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","application throw unkown error"),this.error$.next("application throw unkown error")))}getErrorMessage(r){if(!/^AbortError/.test(String(r))){if(r.errors&&r.errors.length)return r.errors.map(i=>i.message);if(r.message)return[r.message]}return[]}static{this.\u0275fac=function(i){return new(i||e)(z(Tw))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function Cs(e){var t,r,i,s=2;for(typeof Symbol<"u"&&(r=Symbol.asyncIterator,i=Symbol.iterator);s--;){if(r&&null!=(t=e[r]))return t.call(e);if(i&&null!=(t=e[i]))return new $p(t.call(e));r="@@asyncIterator",i="@@iterator"}throw new TypeError("Object is not async iterable")}function $p(e){function t(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var i=r.done;return Promise.resolve(r.value).then(function(s){return{value:s,done:i}})}return($p=function(i){this.s=i,this.n=i.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(i){var s=this.s.return;return void 0===s?Promise.resolve({value:i,done:!0}):t(s.apply(this.s,arguments))},throw:function(i){var s=this.s.return;return void 0===s?Promise.reject(i):t(s.apply(this.s,arguments))}},new $p(e)}function xw(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function Aw(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function Hu(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}const Mw="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,Nw=e=>e instanceof Uint8Array,Rw=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),li=(e,t)=>e<<32-t|e>>>t;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");function zu(e){if("string"==typeof e&&(e=function kQ(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),!Nw(e))throw new Error("expected Uint8Array, got "+typeof e);return e}class $k{clone(){return this._cloneInto()}}function FQ(e){const t=i=>e().update(zu(i)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Hk(e=32){if(Mw&&"function"==typeof Mw.getRandomValues)return Mw.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}class VQ extends $k{constructor(t,r,i,s){super(),this.blockLen=t,this.outputLen=r,this.padOffset=i,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Rw(this.buffer)}update(t){Hu(this);const{view:r,buffer:i,blockLen:s}=this,o=(t=zu(t)).length;for(let a=0;as-a&&(this.process(i,0),a=0);for(let f=a;f>s&o),c=Number(r&o),u=i?0:4;e.setUint32(t+(i?4:0),a,i),e.setUint32(t+u,c,i)})(i,s-8,BigInt(8*this.length),o),this.process(i,0);const c=Rw(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;fe&t^~e&r,jQ=(e,t,r)=>e&t^e&r^t&r,$Q=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ds=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ss=new Uint32Array(64);class zk extends VQ{constructor(){super(64,32,8,!1),this.A=0|Ds[0],this.B=0|Ds[1],this.C=0|Ds[2],this.D=0|Ds[3],this.E=0|Ds[4],this.F=0|Ds[5],this.G=0|Ds[6],this.H=0|Ds[7]}get(){const{A:t,B:r,C:i,D:s,E:o,F:a,G:c,H:l}=this;return[t,r,i,s,o,a,c,l]}set(t,r,i,s,o,a,c,l){this.A=0|t,this.B=0|r,this.C=0|i,this.D=0|s,this.E=0|o,this.F=0|a,this.G=0|c,this.H=0|l}process(t,r){for(let f=0;f<16;f++,r+=4)Ss[f]=t.getUint32(r,!1);for(let f=16;f<64;f++){const h=Ss[f-15],p=Ss[f-2],g=li(h,7)^li(h,18)^h>>>3,m=li(p,17)^li(p,19)^p>>>10;Ss[f]=m+Ss[f-7]+g+Ss[f-16]|0}let{A:i,B:s,C:o,D:a,E:c,F:l,G:u,H:d}=this;for(let f=0;f<64;f++){const p=d+(li(c,6)^li(c,11)^li(c,25))+UQ(c,l,u)+$Q[f]+Ss[f]|0,m=(li(i,2)^li(i,13)^li(i,22))+jQ(i,s,o)|0;d=u,u=l,l=c,c=a+p|0,a=o,o=s,s=i,i=p+m|0}i=i+this.A|0,s=s+this.B|0,o=o+this.C|0,a=a+this.D|0,c=c+this.E|0,l=l+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(i,s,o,a,c,l,u,d)}roundClean(){Ss.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const kw=FQ(()=>new zk),Hp=(BigInt(0),BigInt(1)),HQ=BigInt(2),zp=e=>e instanceof Uint8Array,zQ=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function yc(e){if(!zp(e))throw new Error("Uint8Array expected");let t="";for(let r=0;ri+s.length,0));let r=0;return e.forEach(i=>{if(!zp(i))throw new Error("Uint8Array expected");t.set(i,r),r+=i.length}),t}const Fw=e=>(HQ<new Uint8Array(e),Wk=e=>Uint8Array.from(e);function Zk(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let i=Bw(e),s=Bw(e),o=0;const a=()=>{i.fill(1),s.fill(0),o=0},c=(...f)=>r(s,i,...f),l=(f=Bw())=>{s=c(Wk([0]),f),i=c(),0!==f.length&&(s=c(Wk([1]),f),i=c())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const h=[];for(;f{let p;for(a(),l(f);!(p=h(u()));)l();return a(),p}}const GQ={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function qu(e,t,r={}){const i=(s,o,a)=>{const c=GQ[o];if("function"!=typeof c)throw new Error(`Invalid validator "${o}", expected function`);const l=e[s];if(!(a&&void 0===l||c(l,e)))throw new Error(`Invalid param ${String(s)}=${l} (${typeof l}), expected ${o}`)};for(const[s,o]of Object.entries(t))i(s,o,!1);for(const[s,o]of Object.entries(r))i(s,o,!0);return e}const Ut=BigInt(0),Ye=BigInt(1),Is=BigInt(2),WQ=BigInt(3),Vw=BigInt(4),Kk=BigInt(5),Qk=BigInt(8);function jt(e,t){const r=e%t;return r>=Ut?r:t+r}function QQ(e,t,r){if(r<=Ut||t 0");if(r===Ye)return Ut;let i=Ye;for(;t>Ut;)t&Ye&&(i=i*e%r),e=e*e%r,t>>=Ye;return i}function ur(e,t,r){let i=e;for(;t-- >Ut;)i*=i,i%=r;return i}function qp(e,t){if(e===Ut||t<=Ut)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=jt(e,t),i=t,s=Ut,o=Ye,a=Ye,c=Ut;for(;r!==Ut;){const u=i/r,d=i%r,f=s-a*u,h=o-c*u;i=r,r=d,s=a,o=c,a=f,c=h}if(i!==Ye)throw new Error("invert: does not exist");return jt(s,t)}BigInt(9),BigInt(16);const XQ=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Uw(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function Yk(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function Jk(e){const t=Yk(e);return t+Math.ceil(t/2)}class Xk extends $k{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,function Uk(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");xw(e.outputLen),xw(e.blockLen)}(t);const i=zu(r);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,o=new Uint8Array(s);o.set(i.length>s?t.create().update(i).digest():i);for(let a=0;anew Xk(e,t).update(r).digest();e2.create=(e,t)=>new Xk(e,t);const sY=BigInt(0),jw=BigInt(1);function t2(e){return function eY(e){qu(e,XQ.reduce((i,s)=>(i[s]="function",i),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"}))}(e.Fp),qu(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Uw(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const{Ph:cY,aT:lY}=Wc,Mo={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=Mo;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");const r=e[1],i=e.subarray(2,r+2);if(!r||i.length!==r)throw new t("Invalid signature integer: wrong length");if(128&i[0])throw new t("Invalid signature integer: negative");if(0===i[0]&&!(128&i[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:cY(i),l:e.subarray(r+2)}},toSig(e){const{Err:t}=Mo,r="string"==typeof e?lY(e):e;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let i=r.length;if(i<2||48!=r[0])throw new t("Invalid signature tag");if(r[1]!==i-2)throw new t("Invalid signature: incorrect length");const{d:s,l:o}=Mo._parseInt(r.subarray(2)),{d:a,l:c}=Mo._parseInt(o);if(c.length)throw new t("Invalid signature: left bytes after parsing");return{r:s,s:a}},hexFromSig(e){const t=u=>8&Number.parseInt(u[0],16)?"00"+u:u,r=u=>{const d=u.toString(16);return 1&d.length?`0${d}`:d},i=t(r(e.s)),s=t(r(e.r)),o=i.length/2,a=s.length/2,c=r(o),l=r(a);return`30${r(a+o+4)}02${l}${s}02${c}${i}`}},Ar=BigInt(0),pt=BigInt(1),Gp=(BigInt(2),BigInt(3));function fY(e){const t=function dY(e){const t=t2(e);return qu(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:r,n:i}=t,s=r.BYTES+1,o=2*r.BYTES+1;function c(T){return jt(T,i)}function l(T){return qp(T,i)}const{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:h}=function uY(e){const t=function aY(e){const t=t2(e);qu(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:i,a:s}=t;if(r){if(!i.eql(s,i.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:r}=t,i=t.toBytes||((g,m,y)=>{const _=m.toAffine();return Ao(Uint8Array.from([4]),r.toBytes(_.x),r.toBytes(_.y))}),s=t.fromBytes||(g=>{const m=g.subarray(1);return{x:r.fromBytes(m.subarray(0,r.BYTES)),y:r.fromBytes(m.subarray(r.BYTES,2*r.BYTES))}});function o(g){const{a:m,b:y}=t,_=r.sqr(g),v=r.mul(_,g);return r.add(r.add(v,r.mul(g,m)),y)}if(!r.eql(r.sqr(t.Gy),o(t.Gx)))throw new Error("bad generator point: equation left != right");function a(g){return"bigint"==typeof g&&Arr.eql(w,r.ZERO);return v(y)&&v(_)?f.ZERO:new f(y,_,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){const y=r.invertBatch(m.map(_=>_.pz));return m.map((_,v)=>_.toAffine(y[v])).map(f.fromAffine)}static fromHex(m){const y=f.fromAffine(s(un("pointHex",m)));return y.assertValidity(),y}static fromPrivateKey(m){return f.BASE.multiply(l(m))}_setWindowSize(m){this._WINDOW_SIZE=m,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:m,y}=this.toAffine();if(!r.isValid(m)||!r.isValid(y))throw new Error("bad point: x or y not FE");const _=r.sqr(y),v=o(m);if(!r.eql(_,v))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:m}=this.toAffine();if(r.isOdd)return!r.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){d(m);const{px:y,py:_,pz:v}=this,{px:w,py:b,pz:D}=m,C=r.eql(r.mul(y,D),r.mul(w,v)),S=r.eql(r.mul(_,D),r.mul(b,v));return C&&S}negate(){return new f(this.px,r.neg(this.py),this.pz)}double(){const{a:m,b:y}=t,_=r.mul(y,Gp),{px:v,py:w,pz:b}=this;let D=r.ZERO,C=r.ZERO,S=r.ZERO,I=r.mul(v,v),P=r.mul(w,w),H=r.mul(b,b),V=r.mul(v,w);return V=r.add(V,V),S=r.mul(v,b),S=r.add(S,S),D=r.mul(m,S),C=r.mul(_,H),C=r.add(D,C),D=r.sub(P,C),C=r.add(P,C),C=r.mul(D,C),D=r.mul(V,D),S=r.mul(_,S),H=r.mul(m,H),V=r.sub(I,H),V=r.mul(m,V),V=r.add(V,S),S=r.add(I,I),I=r.add(S,I),I=r.add(I,H),I=r.mul(I,V),C=r.add(C,I),H=r.mul(w,b),H=r.add(H,H),I=r.mul(H,V),D=r.sub(D,I),S=r.mul(H,P),S=r.add(S,S),S=r.add(S,S),new f(D,C,S)}add(m){d(m);const{px:y,py:_,pz:v}=this,{px:w,py:b,pz:D}=m;let C=r.ZERO,S=r.ZERO,I=r.ZERO;const P=t.a,H=r.mul(t.b,Gp);let V=r.mul(y,w),$=r.mul(_,b),X=r.mul(v,D),L=r.add(y,_),T=r.add(w,b);L=r.mul(L,T),T=r.add(V,$),L=r.sub(L,T),T=r.add(y,v);let E=r.add(w,D);return T=r.mul(T,E),E=r.add(V,X),T=r.sub(T,E),E=r.add(_,v),C=r.add(b,D),E=r.mul(E,C),C=r.add($,X),E=r.sub(E,C),I=r.mul(P,T),C=r.mul(H,X),I=r.add(C,I),C=r.sub($,I),I=r.add($,I),S=r.mul(C,I),$=r.add(V,V),$=r.add($,V),X=r.mul(P,X),T=r.mul(H,T),$=r.add($,X),X=r.sub(V,X),X=r.mul(P,X),T=r.add(T,X),V=r.mul($,T),S=r.add(S,V),V=r.mul(E,T),C=r.mul(L,C),C=r.sub(C,V),V=r.mul(L,$),I=r.mul(E,I),I=r.add(I,V),new f(C,S,I)}subtract(m){return this.add(m.negate())}is0(){return this.equals(f.ZERO)}wNAF(m){return p.wNAFCached(this,u,m,y=>{const _=r.invertBatch(y.map(v=>v.pz));return y.map((v,w)=>v.toAffine(_[w])).map(f.fromAffine)})}multiplyUnsafe(m){const y=f.ZERO;if(m===Ar)return y;if(c(m),m===pt)return this;const{endo:_}=t;if(!_)return p.unsafeLadder(this,m);let{k1neg:v,k1:w,k2neg:b,k2:D}=_.splitScalar(m),C=y,S=y,I=this;for(;w>Ar||D>Ar;)w&pt&&(C=C.add(I)),D&pt&&(S=S.add(I)),I=I.double(),w>>=pt,D>>=pt;return v&&(C=C.negate()),b&&(S=S.negate()),S=new f(r.mul(S.px,_.beta),S.py,S.pz),C.add(S)}multiply(m){c(m);let _,v,y=m;const{endo:w}=t;if(w){const{k1neg:b,k1:D,k2neg:C,k2:S}=w.splitScalar(y);let{p:I,f:P}=this.wNAF(D),{p:H,f:V}=this.wNAF(S);I=p.constTimeNegate(b,I),H=p.constTimeNegate(C,H),H=new f(r.mul(H.px,w.beta),H.py,H.pz),_=I.add(H),v=P.add(V)}else{const{p:b,f:D}=this.wNAF(y);_=b,v=D}return f.normalizeZ([_,v])[0]}multiplyAndAddUnsafe(m,y,_){const v=f.BASE,w=(D,C)=>C!==Ar&&C!==pt&&D.equals(v)?D.multiply(C):D.multiplyUnsafe(C),b=w(this,y).add(w(m,_));return b.is0()?void 0:b}toAffine(m){const{px:y,py:_,pz:v}=this,w=this.is0();null==m&&(m=w?r.ONE:r.inv(v));const b=r.mul(y,m),D=r.mul(_,m),C=r.mul(v,m);if(w)return{x:r.ZERO,y:r.ZERO};if(!r.eql(C,r.ONE))throw new Error("invZ was invalid");return{x:b,y:D}}isTorsionFree(){const{h:m,isTorsionFree:y}=t;if(m===pt)return!0;if(y)return y(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:m,clearCofactor:y}=t;return m===pt?this:y?y(f,this):this.multiplyUnsafe(t.h)}toRawBytes(m=!0){return this.assertValidity(),i(f,this,m)}toHex(m=!0){return yc(this.toRawBytes(m))}}f.BASE=new f(t.Gx,t.Gy,r.ONE),f.ZERO=new f(r.ZERO,r.ONE,r.ZERO);const h=t.nBitLength,p=function oY(e,t){const r=(s,o)=>{const a=o.negate();return s?a:o},i=s=>({windows:Math.ceil(t/s)+1,windowSize:2**(s-1)});return{constTimeNegate:r,unsafeLadder(s,o){let a=e.ZERO,c=s;for(;o>sY;)o&jw&&(a=a.add(c)),c=c.double(),o>>=jw;return a},precomputeWindow(s,o){const{windows:a,windowSize:c}=i(o),l=[];let u=s,d=u;for(let f=0;f>=p,y>l&&(y-=h,a+=jw);const _=m,v=m+Math.abs(y)-1,b=y<0;0===y?d=d.add(r(g%2!=0,o[_])):u=u.add(r(b,o[v]))}return{p:u,f:d}},wNAFCached(s,o,a,c){const l=s._WINDOW_SIZE||1;let u=o.get(s);return u||(u=this.precomputeWindow(s,l),1!==l&&o.set(s,c(u))),this.wNAF(l,u,a)}}}(f,t.endo?Math.ceil(h/2):h);return{CURVE:t,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:o,isWithinCurveOrder:a}}({...t,toBytes(T,E,x){const R=E.toAffine(),M=r.toBytes(R.x),W=Ao;return x?W(Uint8Array.from([E.hasEvenY()?2:3]),M):W(Uint8Array.from([4]),M,r.toBytes(R.y))},fromBytes(T){const E=T.length,x=T[0],R=T.subarray(1);if(E!==s||2!==x&&3!==x){if(E===o&&4===x)return{x:r.fromBytes(R.subarray(0,r.BYTES)),y:r.fromBytes(R.subarray(r.BYTES,2*r.BYTES))};throw new Error(`Point of length ${E} was invalid. Expected ${s} compressed bytes or ${o} uncompressed bytes`)}{const M=Nn(R);if(!function a(T){return Aryc(Ts(T,t.nByteLength));function g(T){return T>i>>pt}const y=(T,E,x)=>Nn(T.slice(E,x));class _{constructor(E,x,R){this.r=E,this.s=x,this.recovery=R,this.assertValidity()}static fromCompact(E){const x=t.nByteLength;return E=un("compactSignature",E,2*x),new _(y(E,0,x),y(E,x,2*x))}static fromDER(E){const{r:x,s:R}=Mo.toSig(un("DER",E));return new _(x,R)}assertValidity(){if(!h(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!h(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(E){return new _(this.r,this.s,E)}recoverPublicKey(E){const{r:x,s:R,recovery:M}=this,W=S(un("msgHash",E));if(null==M||![0,1,2,3].includes(M))throw new Error("recovery id invalid");const J=2===M||3===M?x+t.n:x;if(J>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const Se=u.fromHex((1&M?"03":"02")+p(J)),ue=l(J),yt=c(-W*ue),ht=c(R*ue),Ae=u.BASE.multiplyAndAddUnsafe(Se,yt,ht);if(!Ae)throw new Error("point at infinify");return Ae.assertValidity(),Ae}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new _(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return vc(this.toDERHex())}toDERHex(){return Mo.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return vc(this.toCompactHex())}toCompactHex(){return p(this.r)+p(this.s)}}const v={isValidPrivateKey(T){try{return d(T),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const T=Jk(t.n);return function iY(e,t,r=!1){const i=e.length,s=Yk(t),o=Jk(t);if(i<16||i1024)throw new Error(`expected ${o}-1024 bytes of input, got ${i}`);const c=jt(r?Nn(e):Pw(e),t-Ye)+Ye;return r?Lw(c,s):Ts(c,s)}(t.randomBytes(T),t.n)},precompute:(T=8,E=u.BASE)=>(E._setWindowSize(T),E.multiply(BigInt(3)),E)};function b(T){const E=T instanceof Uint8Array,x="string"==typeof T,R=(E||x)&&T.length;return E?R===s||R===o:x?R===2*s||R===2*o:T instanceof u}const C=t.bits2int||function(T){const E=Nn(T),x=8*T.length-t.nBitLength;return x>0?E>>BigInt(x):E},S=t.bits2int_modN||function(T){return c(C(T))},I=Fw(t.nBitLength);function P(T){if("bigint"!=typeof T)throw new Error("bigint expected");if(!(Ar<=T&&TOe in x))throw new Error("sign() legacy options not supported");const{hash:R,randomBytes:M}=t;let{lowS:W,prehash:J,extraEntropy:ee}=x;null==W&&(W=!0),T=un("msgHash",T),J&&(T=un("prehashed msgHash",R(T)));const Se=S(T),ue=d(E),yt=[P(ue),P(Se)];if(null!=ee){const Oe=!0===ee?M(r.BYTES):ee;yt.push(un("extraEntropy",Oe))}const ht=Ao(...yt),Ae=Se;return{seed:ht,k2sig:function ot(Oe){const Pn=C(Oe);if(!h(Pn))return;const en=l(Pn),tn=u.BASE.multiply(Pn).toAffine(),Br=c(tn.x);if(Br===Ar)return;const Ko=c(en*c(Ae+Br*ue));if(Ko===Ar)return;let Md=(tn.x===Br?0:2)|Number(tn.y&pt),f3=Ko;return W&&g(Ko)&&(f3=function m(T){return g(T)?c(-T):T}(Ko),Md^=1),new _(Br,f3,Md)}}}(T,E,x);return Zk(t.hash.outputLen,t.nByteLength,t.hmac)(R,M)},verify:function L(T,E,x,R=$){const M=T;if(E=un("msgHash",E),x=un("publicKey",x),"strict"in R)throw new Error("options.strict was renamed to lowS");const{lowS:W,prehash:J}=R;let ee,Se;try{if("string"==typeof M||M instanceof Uint8Array)try{ee=_.fromDER(M)}catch(tn){if(!(tn instanceof Mo.Err))throw tn;ee=_.fromCompact(M)}else{if("object"!=typeof M||"bigint"!=typeof M.r||"bigint"!=typeof M.s)throw new Error("PARSE");{const{r:tn,s:Br}=M;ee=new _(tn,Br)}}Se=u.fromHex(x)}catch(tn){if("PARSE"===tn.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(W&&ee.hasHighS())return!1;J&&(E=t.hash(E));const{r:ue,s:yt}=ee,ht=S(E),Ae=l(yt),ot=c(ht*Ae),Oe=c(ue*Ae),Pn=u.BASE.multiplyAndAddUnsafe(Se,ot,Oe)?.toAffine();return!!Pn&&c(Pn.x)===ue},ProjectivePoint:u,Signature:_,utils:v}}function pY(e){return{hash:e,hmac:(t,...r)=>e2(e,t,function PQ(...e){const t=new Uint8Array(e.reduce((i,s)=>i+s.length,0));let r=0;return e.forEach(i=>{if(!Nw(i))throw new Error("Uint8Array expected");t.set(i,r),r+=i.length}),t}(...r)),randomBytes:Hk}}BigInt(4);const Wp=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Zp=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),r2=BigInt(1),Kp=BigInt(2),i2=(e,t)=>(e+t/Kp)/t;function s2(e){const t=Wp,r=BigInt(3),i=BigInt(6),s=BigInt(11),o=BigInt(22),a=BigInt(23),c=BigInt(44),l=BigInt(88),u=e*e*e%t,d=u*u*e%t,f=ur(d,r,t)*d%t,h=ur(f,r,t)*d%t,p=ur(h,Kp,t)*u%t,g=ur(p,s,t)*p%t,m=ur(g,o,t)*g%t,y=ur(m,c,t)*m%t,_=ur(y,l,t)*y%t,v=ur(_,c,t)*m%t,w=ur(v,r,t)*d%t,b=ur(w,a,t)*g%t,D=ur(b,i,t)*u%t,C=ur(D,Kp,t);if(!$w.eql($w.sqr(C),e))throw new Error("Cannot find square root");return C}const $w=function rY(e,t,r=!1,i={}){if(e<=Ut)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:o}=Uw(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=function JQ(e){if(e%Vw===WQ){const t=(e+Ye)/Vw;return function(i,s){const o=i.pow(s,t);if(!i.eql(i.sqr(o),s))throw new Error("Cannot find square root");return o}}if(e%Qk===Kk){const t=(e-Kk)/Qk;return function(i,s){const o=i.mul(s,Is),a=i.pow(o,t),c=i.mul(s,a),l=i.mul(i.mul(c,Is),a),u=i.mul(c,i.sub(l,i.ONE));if(!i.eql(i.sqr(u),s))throw new Error("Cannot find square root");return u}}return function YQ(e){const t=(e-Ye)/Is;let r,i,s;for(r=e-Ye,i=0;r%Is===Ut;r/=Is,i++);for(s=Is;sjt(l,e),isValid:l=>{if("bigint"!=typeof l)throw new Error("Invalid field element: expected bigint, got "+typeof l);return Ut<=l&&ll===Ut,isOdd:l=>(l&Ye)===Ye,neg:l=>jt(-l,e),eql:(l,u)=>l===u,sqr:l=>jt(l*l,e),add:(l,u)=>jt(l+u,e),sub:(l,u)=>jt(l-u,e),mul:(l,u)=>jt(l*u,e),pow:(l,u)=>function tY(e,t,r){if(r 0");if(r===Ut)return e.ONE;if(r===Ye)return t;let i=e.ONE,s=t;for(;r>Ut;)r&Ye&&(i=e.mul(i,s)),s=e.sqr(s),r>>=Ye;return i}(c,l,u),div:(l,u)=>jt(l*qp(u,e),e),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>qp(l,e),sqrt:i.sqrt||(l=>a(c,l)),invertBatch:l=>function nY(e,t){const r=new Array(t.length),i=t.reduce((o,a,c)=>e.is0(a)?o:(r[c]=o,e.mul(o,a)),e.ONE),s=e.inv(i);return t.reduceRight((o,a,c)=>e.is0(a)?o:(r[c]=e.mul(o,r[c]),e.mul(o,a)),s),r}(c,l),cmov:(l,u,d)=>d?u:l,toBytes:l=>r?Lw(l,o):Ts(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return r?Pw(l):Nn(l)}});return Object.freeze(c)}(Wp,void 0,void 0,{sqrt:s2}),_c=function gY(e,t){const r=i=>fY({...e,...pY(i)});return Object.freeze({...r(t),create:r})}({a:BigInt(0),b:BigInt(7),Fp:$w,n:Zp,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Zp,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-r2*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=BigInt("0x100000000000000000000000000000000"),c=i2(o*e,t),l=i2(-i*e,t);let u=jt(e-c*r-l*s,t),d=jt(-c*i-l*o,t);const f=u>a,h=d>a;if(f&&(u=t-u),h&&(d=t-d),u>a||d>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:h,k2:d}}}},kw),Qp=BigInt(0),o2=e=>"bigint"==typeof e&&Qps.charCodeAt(0)));r=Ao(i,i),a2[e]=r}return kw(Ao(r,...t))}const Hw=e=>e.toRawBytes(!0).slice(1),zw=e=>Ts(e,32),qw=e=>jt(e,Wp),Gu=e=>jt(e,Zp),Gw=_c.ProjectivePoint;function Ww(e){let t=_c.utils.normPrivateKeyToScalar(e),r=Gw.fromPrivateKey(t);return{scalar:r.hasEvenY()?t:Gu(-t),bytes:Hw(r)}}function c2(e){if(!o2(e))throw new Error("bad x: need 0 < x < p");const t=qw(e*e);let i=s2(qw(t*e+BigInt(7)));i%Kp!==Qp&&(i=qw(-i));const s=new Gw(e,i,r2);return s.assertValidity(),s}function l2(...e){return Gu(Nn(Yp("BIP0340/challenge",...e)))}function u2(e,t,r){const i=un("signature",e,64),s=un("message",t),o=un("publicKey",r,32);try{const a=c2(Nn(o)),c=Nn(i.subarray(0,32));if(!o2(c))return!1;const l=Nn(i.subarray(32,64));if(!(e=>"bigint"==typeof e&&QpGw.BASE.multiplyAndAddUnsafe(e,t,r))(a,l,Gu(-u));return!(!d||!d.hasEvenY()||d.toAffine().x!==c)}catch{return!1}}const Wu={getPublicKey:function vY(e){return Ww(e).bytes},sign:function _Y(e,t,r=Hk(32)){const i=un("message",e),{bytes:s,scalar:o}=Ww(t),a=un("auxRand",r,32),c=zw(o^Nn(Yp("BIP0340/aux",a))),l=Yp("BIP0340/nonce",c,s,i),u=Gu(Nn(l));if(u===Qp)throw new Error("sign failed: k is zero");const{bytes:d,scalar:f}=Ww(u),h=l2(d,s,i),p=new Uint8Array(64);if(p.set(d,0),p.set(zw(Gu(f+h*o)),32),!u2(p,i,s))throw new Error("sign: Invalid signature produced");return p},verify:u2,utils:{randomPrivateKey:_c.utils.randomPrivateKey,lift_x:c2,pointToBytes:Hw,numberToBytesBE:Ts,bytesToNumberBE:Nn,taggedHash:Yp,mod:jt}},Zw="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,Kw=e=>e instanceof Uint8Array,Qw=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),ui=(e,t)=>e<<32-t|e>>>t;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");const wY=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function gt(e){if(!Kw(e))throw new Error("Uint8Array expected");let t="";for(let r=0;ri+s.length,0));let r=0;return e.forEach(i=>{if(!Kw(i))throw new Error("Uint8Array expected");t.set(i,r),r+=i.length}),t}class d2{clone(){return this._cloneInto()}}function f2(e){const t=i=>e().update(Ro(i)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function h2(e=32){if(Zw&&"function"==typeof Zw.getRandomValues)return Zw.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function Jw(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function p2(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}const di={number:Jw,bool:function DY(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)},bytes:p2,hash:function SY(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");Jw(e.outputLen),Jw(e.blockLen)},exists:function TY(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")},output:function IY(e,t){p2(e);const r=t.outputLen;if(e.lengths-a&&(this.process(i,0),a=0);for(let f=a;f>s&o),c=Number(r&o),u=i?0:4;e.setUint32(t+(i?4:0),a,i),e.setUint32(t+u,c,i)})(i,s-8,BigInt(8*this.length),o),this.process(i,0);const c=Qw(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;fe&t^~e&r,NY=(e,t,r)=>e&t^e&r^t&r,RY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),As=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ms=new Uint32Array(64);class g2 extends AY{constructor(){super(64,32,8,!1),this.A=0|As[0],this.B=0|As[1],this.C=0|As[2],this.D=0|As[3],this.E=0|As[4],this.F=0|As[5],this.G=0|As[6],this.H=0|As[7]}get(){const{A:t,B:r,C:i,D:s,E:o,F:a,G:c,H:l}=this;return[t,r,i,s,o,a,c,l]}set(t,r,i,s,o,a,c,l){this.A=0|t,this.B=0|r,this.C=0|i,this.D=0|s,this.E=0|o,this.F=0|a,this.G=0|c,this.H=0|l}process(t,r){for(let f=0;f<16;f++,r+=4)Ms[f]=t.getUint32(r,!1);for(let f=16;f<64;f++){const h=Ms[f-15],p=Ms[f-2],g=ui(h,7)^ui(h,18)^h>>>3,m=ui(p,17)^ui(p,19)^p>>>10;Ms[f]=m+Ms[f-7]+g+Ms[f-16]|0}let{A:i,B:s,C:o,D:a,E:c,F:l,G:u,H:d}=this;for(let f=0;f<64;f++){const p=d+(ui(c,6)^ui(c,11)^ui(c,25))+MY(c,l,u)+RY[f]+Ms[f]|0,m=(ui(i,2)^ui(i,13)^ui(i,22))+NY(i,s,o)|0;d=u,u=l,l=c,c=a+p|0,a=o,o=s,s=i,i=p+m|0}i=i+this.A|0,s=s+this.B|0,o=o+this.C|0,a=a+this.D|0,c=c+this.E|0,l=l+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(i,s,o,a,c,l,u,d)}roundClean(){Ms.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class OY extends g2{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const wc=f2(()=>new g2);function Oo(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function Mr(...e){const t=(s,o)=>a=>s(o(a));return{encode:Array.from(e).reverse().reduce((s,o)=>s?t(s,o.encode):o.encode,void 0),decode:e.reduce((s,o)=>s?t(s,o.decode):o.decode,void 0)}}function fi(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("alphabet.encode input should be an array of numbers");return t.map(r=>{if(Oo(r),r<0||r>=e.length)throw new Error(`Digit index outside alphabet: ${r} (alphabet: ${e.length})`);return e[r]})},decode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("alphabet.decode input should be array of strings");return t.map(r=>{if("string"!=typeof r)throw new Error(`alphabet.decode: not string element=${r}`);const i=e.indexOf(r);if(-1===i)throw new Error(`Unknown letter: "${r}". Allowed: ${e}`);return i})}}}function hi(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("join.encode input should be array of strings");for(let r of t)if("string"!=typeof r)throw new Error(`join.encode: non-string input=${r}`);return t.join(e)},decode:t=>{if("string"!=typeof t)throw new Error("join.decode input should be string");return t.split(e)}}}function Zu(e,t="="){if(Oo(e),"string"!=typeof t)throw new Error("padding chr should be string");return{encode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let i of r)if("string"!=typeof i)throw new Error(`padding.encode: non-string input=${i}`);for(;r.length*e%8;)r.push(t);return r},decode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let s of r)if("string"!=typeof s)throw new Error(`padding.decode: non-string input=${s}`);let i=r.length;if(i*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;i>0&&r[i-1]===t;i--)if(!((i-1)*e%8))throw new Error("Invalid padding: string has too much padding");return r.slice(0,i)}}}function m2(e){if("function"!=typeof e)throw new Error("normalize fn should be function");return{encode:t=>t,decode:t=>e(t)}}function y2(e,t,r){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: wrong to=${r}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let i=0;const s=[],o=Array.from(e);for(o.forEach(a=>{if(Oo(a),a<0||a>=t)throw new Error(`Wrong integer: ${a}`)});;){let a=0,c=!0;for(let l=i;lnew OY);const v2=(e,t)=>t?v2(t,e%t):e,Xp=(e,t)=>e+(t-v2(e,t));function Xw(e,t,r,i){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(Xp(t,r)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${Xp(t,r)}`);let s=0,o=0;const a=2**r-1,c=[];for(const l of e){if(Oo(l),l>=2**t)throw new Error(`convertRadix2: invalid data word=${l} from=${t}`);if(s=s<32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${t}`);for(o+=t;o>=r;o-=r)c.push((s>>o-r&a)>>>0);s&=2**o-1}if(s=s<=t)throw new Error("Excess padding");if(!i&&s)throw new Error(`Non-zero padding: ${s}`);return i&&o>0&&c.push(s>>>0),c}function Bi(e,t=!1){if(Oo(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(Xp(8,e)>32||Xp(e,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!(r instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return Xw(Array.from(r),8,e,!t)},decode:r=>{if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(Xw(r,e,8,t))}}}function w2(e){if("function"!=typeof e)throw new Error("unsafeWrapper fn should be function");return function(...t){try{return e.apply(null,t)}catch{}}}Mr(Bi(4),fi("0123456789ABCDEF"),hi("")),Mr(Bi(5),fi("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Zu(5),hi("")),Mr(Bi(5),fi("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Zu(5),hi("")),Mr(Bi(5),fi("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),hi(""),m2(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const Vi=Mr(Bi(6),fi("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Zu(6),hi("")),eb=(Mr(Bi(6),fi("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Zu(6),hi("")),e=>Mr(function _2(e){return Oo(e),{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return y2(Array.from(t),256,e)},decode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("radix.decode input should be array of strings");return Uint8Array.from(y2(t,e,256))}}}(58),fi(e),hi(""))),tb=(eb("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),eb("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),eb("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"),Mr(fi("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),hi(""))),C2=[996825010,642813549,513874426,1027748829,705979059];function Ku(e){const t=e>>25;let r=(33554431&e)<<5;for(let i=0;i>i&1)&&(r^=C2[i]);return r}function D2(e,t,r=1){const i=e.length;let s=1;for(let o=0;o126)throw new Error(`Invalid prefix (${e})`);s=Ku(s)^a>>5}s=Ku(s);for(let o=0;of)throw new TypeError(`Wrong string length: ${d.length} (${d}). Expected (8..${f})`);const h=d.toLowerCase();if(d!==h&&d!==d.toUpperCase())throw new Error("String must be lowercase or uppercase");const p=(d=h).lastIndexOf("1");if(0===p||-1===p)throw new Error('Letter "1" must be present between prefix and data only');const g=d.slice(0,p),m=d.slice(p+1);if(m.length<6)throw new Error("Data must be at least 6 characters long");const y=tb.decode(m).slice(0,-6),_=D2(g,y,t);if(!m.endsWith(_))throw new Error(`Invalid checksum in ${d}: expected "${_}"`);return{prefix:g,words:y}}return{encode:function a(d,f,h=90){if("string"!=typeof d)throw new Error("bech32.encode prefix should be string, not "+typeof d);if(!Array.isArray(f)||f.length&&"number"!=typeof f[0])throw new Error("bech32.encode words should be array of numbers, not "+typeof f);const p=d.length+7+f.length;if(!1!==h&&p>h)throw new TypeError(`Length ${p} exceeds limit ${h}`);return`${d=d.toLowerCase()}1${tb.encode(f)}${D2(d,f,t)}`},decode:c,decodeToBytes:function u(d){const{prefix:f,words:h}=c(d,!1);return{prefix:f,words:h,bytes:i(h)}},decodeUnsafe:w2(c),fromWords:i,fromWordsUnsafe:o,toWords:s}}const pi=S2("bech32");function bc(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function nb(e){if("boolean"!=typeof e)throw new Error(`boolean expected, not ${e}`)}function I2(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function xe(e,...t){if(!I2(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function ko(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function ng(e,t){xe(e);const r=t.outputLen;if(e.length{if("string"!=typeof e||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));const Ie=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),Ec=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");function Ns(e){if("string"==typeof e)e=function GY(e){if("string"!=typeof e)throw new Error("string expected, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e);else{if(!I2(e))throw new Error("Uint8Array expected, got "+typeof e);e=e.slice()}return e}function rg(e,t){if(e.length!==t.length)return!1;let r=0;for(let i=0;i(Object.assign(t,e),t);function Po(e,t,r,i){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,i);const s=BigInt(32),o=BigInt(4294967295),a=Number(r>>s&o),c=Number(r&o),u=i?0:4;e.setUint32(t+(i?4:0),a,i),e.setUint32(t+u,c,i)}const sb=new Uint8Array(16),gi=Ie(sb),KY=(e,t,r,i)=>({s3:r<<31|i>>>1,s2:t<<31|r>>>1,s1:e<<31|t>>>1,s0:e>>>1^225<<24&-(1&i)}),dr=e=>(e>>>0&255)<<24|(e>>>8&255)<<16|(e>>>16&255)<<8|e>>>24&255;class A2{constructor(t,r){this.blockLen=16,this.outputLen=16,this.s0=0,this.s1=0,this.s2=0,this.s3=0,this.finished=!1,xe(t=Ns(t),16);const i=Ec(t);let s=i.getUint32(0,!1),o=i.getUint32(4,!1),a=i.getUint32(8,!1),c=i.getUint32(12,!1);const l=[];for(let g=0;g<128;g++)l.push({s0:dr(s),s1:dr(o),s2:dr(a),s3:dr(c)}),({s0:s,s1:o,s2:a,s3:c}=KY(s,o,a,c));const u=(e=r||1024)>65536?8:e>1024?4:2;var e;if(![1,2,4,8].includes(u))throw new Error(`ghash: wrong window size=${u}, should be 2, 4 or 8`);this.W=u;const f=128/u,h=this.windowSize=2**u,p=[];for(let g=0;g>>u-b-1&1))continue;const{s0:C,s1:S,s2:I,s3:P}=l[u*g+b];y^=C,_^=S,v^=I,w^=P}p.push({s0:y,s1:_,s2:v,s3:w})}this.t=p}_updateBlock(t,r,i,s){t^=this.s0,r^=this.s1,i^=this.s2,s^=this.s3;const{W:o,t:a,windowSize:c}=this;let l=0,u=0,d=0,f=0;const h=(1<>>8*m&255;for(let _=8/o-1;_>=0;_--){const v=y>>>o*_&h,{s0:w,s1:b,s2:D,s3:C}=a[p*c+v];l^=w,u^=b,d^=D,f^=C,p+=1}}this.s0=l,this.s1=u,this.s2=d,this.s3=f}update(t){t=Ns(t),ko(this);const r=Ie(t),i=Math.floor(t.length/16),s=t.length%16;for(let o=0;o>>1|r,r=(1&s)<<7}return e[0]^=225&-t,e}((t=Ns(t)).slice());super(i,r),i.fill(0)}update(t){t=Ns(t),ko(this);const r=Ie(t),i=t.length%16,s=Math.floor(t.length/16);for(let o=0;oe(s,i.length).update(Ns(i)).digest(),r=e(new Uint8Array(16),0);return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=(i,s)=>e(i,s),t}M2((e,t)=>new A2(e,t)),M2((e,t)=>new JY(e,t)),new Uint8Array(16);const eJ=283;function ab(e){return e<<1^eJ&-(e>>7)}function Cc(e,t){let r=0;for(;t>0;t>>=1)r^=e&-(1&t),e=ab(e);return r}const cb=(()=>{let e=new Uint8Array(256);for(let r=0,i=1;r<256;r++,i^=ab(i))e[r]=i;const t=new Uint8Array(256);t[0]=99;for(let r=0;r<255;r++){let i=e[255-r];i|=i<<8,t[e[r]]=255&(i^i>>4^i>>5^i>>6^i>>7^99)}return t})(),tJ=cb.map((e,t)=>cb.indexOf(t)),nJ=e=>e<<24|e>>>8,lb=e=>e<<8|e>>>24;function R2(e,t){if(256!==e.length)throw new Error("Wrong sbox length");const r=new Uint32Array(256).map((u,d)=>t(e[d])),i=r.map(lb),s=i.map(lb),o=s.map(lb),a=new Uint32Array(65536),c=new Uint32Array(65536),l=new Uint16Array(65536);for(let u=0;u<256;u++)for(let d=0;d<256;d++){const f=256*u+d;a[f]=r[u]^i[d],c[f]=s[u]^o[d],l[f]=e[u]<<8|e[d]}return{sbox:e,sbox2:l,T0:r,T1:i,T2:s,T3:o,T01:a,T23:c}}const ub=R2(cb,e=>Cc(e,3)<<24|e<<16|e<<8|Cc(e,2)),O2=R2(tJ,e=>Cc(e,11)<<24|Cc(e,13)<<16|Cc(e,9)<<8|Cc(e,14)),rJ=(()=>{const e=new Uint8Array(16);for(let t=0,r=1;t<16;t++,r=ab(r))e[t]=r;return e})();function $i(e){xe(e);const t=e.length;if(![16,24,32].includes(t))throw new Error(`aes: wrong key size: should be 16, 24 or 32, got: ${t}`);const{sbox2:r}=ub,i=Ie(e),s=i.length,o=c=>mi(r,c,c,c,c),a=new Uint32Array(t+28);a.set(i);for(let c=s;c6&&c%s==4&&(l=o(l)),a[c]=a[c-s]^l}return a}function Os(e,t,r,i,s,o){return e[r<<8&65280|i>>>8&255]^t[s>>>8&65280|o>>>24&255]}function mi(e,t,r,i,s){return e[255&t|65280&r]|e[i>>>16&255|s>>>16&65280]<<16}function Rn(e,t,r,i,s){const{sbox2:o,T01:a,T23:c}=ub;let l=0;t^=e[l++],r^=e[l++],i^=e[l++],s^=e[l++];const u=e.length/4-2;for(let g=0;g{const c=$i(t),{b:l,o:u,out:d}=function L2(e,t,r){let i=e.length;const s=i%16;if(!t&&0!==s)throw new Error("aec/(cbc-ecb): unpadded plaintext with disabled padding");const o=Ie(e);if(t){let l=16-s;l||(l=16),i+=l}const a=Dc(i,r);return{b:o,o:Ie(a),out:a}}(o,s,a),f=Ie(r);let h=f[0],p=f[1],g=f[2],m=f[3],y=0;for(;y+4<=l.length;)h^=l[y+0],p^=l[y+1],g^=l[y+2],m^=l[y+3],({s0:h,s1:p,s2:g,s3:m}=Rn(c,h,p,g,m)),u[y++]=h,u[y++]=p,u[y++]=g,u[y++]=m;if(s){const _=function B2(e){const t=new Uint8Array(16),r=Ie(t);t.set(e);const i=16-e.length;for(let s=16-i;s<16;s++)t[s]=i;return r}(o.subarray(4*y));h^=_[0],p^=_[1],g^=_[2],m^=_[3],({s0:h,s1:p,s2:g,s3:m}=Rn(c,h,p,g,m)),u[y++]=h,u[y++]=p,u[y++]=g,u[y++]=m}return c.fill(0),d},decrypt:(o,a)=>{!function P2(e){if(xe(e),e.length%16!=0)throw new Error("aes/(cbc-ecb).decrypt ciphertext should consist of blocks with size 16")}(o);const c=function db(e){const t=$i(e),r=t.slice(),i=t.length,{sbox2:s}=ub,{T0:o,T1:a,T2:c,T3:l}=O2;for(let u=0;u>>8&255]^c[f>>>16&255]^l[f>>>24]}return r}(t),l=Ie(r),u=Dc(o.length,a),d=Ie(o),f=Ie(u);let h=l[0],p=l[1],g=l[2],m=l[3];for(let y=0;y+4<=d.length;){const _=h,v=p,w=g,b=m;h=d[y+0],p=d[y+1],g=d[y+2],m=d[y+3];const{s0:D,s1:C,s2:S,s3:I}=sg(c,h,p,g,m);f[y++]=D^_,f[y++]=C^v,f[y++]=S^w,f[y++]=I^b}return c.fill(0),function F2(e,t){if(!t)return e;const r=e.length;if(!r)throw new Error("aes/pcks5: empty ciphertext not allowed");const i=e[r-1];if(i<=0||i>16)throw new Error(`aes/pcks5: wrong padding byte: ${i}`);const s=e.subarray(0,-i);for(let o=0;o255&e[t++]|(255&e[t++])<<8;class oJ{constructor(t){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,xe(t=Ns(t),32);const r=Jt(t,0),i=Jt(t,2),s=Jt(t,4),o=Jt(t,6),a=Jt(t,8),c=Jt(t,10),l=Jt(t,12),u=Jt(t,14);this.r[0]=8191&r,this.r[1]=8191&(r>>>13|i<<3),this.r[2]=7939&(i>>>10|s<<6),this.r[3]=8191&(s>>>7|o<<9),this.r[4]=255&(o>>>4|a<<12),this.r[5]=a>>>1&8190,this.r[6]=8191&(a>>>14|c<<2),this.r[7]=8065&(c>>>11|l<<5),this.r[8]=8191&(l>>>8|u<<8),this.r[9]=u>>>5&127;for(let d=0;d<8;d++)this.pad[d]=Jt(t,16+2*d)}process(t,r,i=!1){const s=i?0:2048,{h:o,r:a}=this,c=a[0],l=a[1],u=a[2],d=a[3],f=a[4],h=a[5],p=a[6],g=a[7],m=a[8],y=a[9],_=Jt(t,r+0),v=Jt(t,r+2),w=Jt(t,r+4),b=Jt(t,r+6),D=Jt(t,r+8),C=Jt(t,r+10),S=Jt(t,r+12),I=Jt(t,r+14);let P=o[0]+(8191&_),H=o[1]+(8191&(_>>>13|v<<3)),V=o[2]+(8191&(v>>>10|w<<6)),$=o[3]+(8191&(w>>>7|b<<9)),X=o[4]+(8191&(b>>>4|D<<12)),L=o[5]+(D>>>1&8191),T=o[6]+(8191&(D>>>14|C<<2)),E=o[7]+(8191&(C>>>11|S<<5)),x=o[8]+(8191&(S>>>8|I<<8)),R=o[9]+(I>>>5|s),M=0,W=M+P*c+H*(5*y)+V*(5*m)+$*(5*g)+X*(5*p);M=W>>>13,W&=8191,W+=L*(5*h)+T*(5*f)+E*(5*d)+x*(5*u)+R*(5*l),M+=W>>>13,W&=8191;let J=M+P*l+H*c+V*(5*y)+$*(5*m)+X*(5*g);M=J>>>13,J&=8191,J+=L*(5*p)+T*(5*h)+E*(5*f)+x*(5*d)+R*(5*u),M+=J>>>13,J&=8191;let ee=M+P*u+H*l+V*c+$*(5*y)+X*(5*m);M=ee>>>13,ee&=8191,ee+=L*(5*g)+T*(5*p)+E*(5*h)+x*(5*f)+R*(5*d),M+=ee>>>13,ee&=8191;let Se=M+P*d+H*u+V*l+$*c+X*(5*y);M=Se>>>13,Se&=8191,Se+=L*(5*m)+T*(5*g)+E*(5*p)+x*(5*h)+R*(5*f),M+=Se>>>13,Se&=8191;let ue=M+P*f+H*d+V*u+$*l+X*c;M=ue>>>13,ue&=8191,ue+=L*(5*y)+T*(5*m)+E*(5*g)+x*(5*p)+R*(5*h),M+=ue>>>13,ue&=8191;let yt=M+P*h+H*f+V*d+$*u+X*l;M=yt>>>13,yt&=8191,yt+=L*c+T*(5*y)+E*(5*m)+x*(5*g)+R*(5*p),M+=yt>>>13,yt&=8191;let ht=M+P*p+H*h+V*f+$*d+X*u;M=ht>>>13,ht&=8191,ht+=L*l+T*c+E*(5*y)+x*(5*m)+R*(5*g),M+=ht>>>13,ht&=8191;let Ae=M+P*g+H*p+V*h+$*f+X*d;M=Ae>>>13,Ae&=8191,Ae+=L*u+T*l+E*c+x*(5*y)+R*(5*m),M+=Ae>>>13,Ae&=8191;let ot=M+P*m+H*g+V*p+$*h+X*f;M=ot>>>13,ot&=8191,ot+=L*d+T*u+E*l+x*c+R*(5*y),M+=ot>>>13,ot&=8191;let Oe=M+P*y+H*m+V*g+$*p+X*h;M=Oe>>>13,Oe&=8191,Oe+=L*f+T*d+E*u+x*l+R*c,M+=Oe>>>13,Oe&=8191,M=(M<<2)+M|0,M=M+W|0,W=8191&M,M>>>=13,J+=M,o[0]=W,o[1]=J,o[2]=ee,o[3]=Se,o[4]=ue,o[5]=yt,o[6]=ht,o[7]=Ae,o[8]=ot,o[9]=Oe}finalize(){const{h:t,pad:r}=this,i=new Uint16Array(10);let s=t[1]>>>13;t[1]&=8191;for(let c=2;c<10;c++)t[c]+=s,s=t[c]>>>13,t[c]&=8191;t[0]+=5*s,s=t[0]>>>13,t[0]&=8191,t[1]+=s,s=t[1]>>>13,t[1]&=8191,t[2]+=s,i[0]=t[0]+5,s=i[0]>>>13,i[0]&=8191;for(let c=1;c<10;c++)i[c]=t[c]+s,s=i[c]>>>13,i[c]&=8191;i[9]-=8192;let o=(1^s)-1;for(let c=0;c<10;c++)i[c]&=o;o=~o;for(let c=0;c<10;c++)t[c]=t[c]&o|i[c];t[0]=65535&(t[0]|t[1]<<13),t[1]=65535&(t[1]>>>3|t[2]<<10),t[2]=65535&(t[2]>>>6|t[3]<<7),t[3]=65535&(t[3]>>>9|t[4]<<4),t[4]=65535&(t[4]>>>12|t[5]<<1|t[6]<<14),t[5]=65535&(t[6]>>>2|t[7]<<11),t[6]=65535&(t[7]>>>5|t[8]<<8),t[7]=65535&(t[8]>>>8|t[9]<<5);let a=t[0]+r[0];t[0]=65535&a;for(let c=1;c<8;c++)a=(t[c]+r[c]|0)+(a>>>16)|0,t[c]=65535&a}update(t){ko(this);const{buffer:r,blockLen:i}=this,s=(t=Ns(t)).length;for(let o=0;o>>0,t[o++]=i[a]>>>8;return t}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const i=t.slice(0,r);return this.destroy(),i}}const cJ=function aJ(e){const t=(i,s)=>e(s).update(Ns(i)).digest(),r=e(new Uint8Array(32));return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=i=>e(i),t}(e=>new oJ(e)),$2=e=>Uint8Array.from(e.split("").map(t=>t.charCodeAt(0))),lJ=$2("expand 16-byte k"),uJ=$2("expand 32-byte k"),dJ=Ie(lJ),H2=Ie(uJ);function Q(e,t){return e<>>32-t}function fb(e){return e.byteOffset%4==0}H2.slice();const z2=2**32-1,q2=new Uint32Array;function Qu(e,t){const{allowShortKeys:r,extendNonceFn:i,counterLength:s,counterRight:o,rounds:a}=function WY(e,t){if(null==t||"object"!=typeof t)throw new Error("options must be defined");return Object.assign(e,t)}({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if("function"!=typeof e)throw new Error("core must be a function");return bc(s),bc(a),nb(o),nb(r),(c,l,u,d,f=0)=>{xe(c),xe(l),xe(u);const h=u.length;if(d||(d=new Uint8Array(h)),xe(d),bc(f),f<0||f>=z2)throw new Error("arx: counter overflow");if(d.length=z2)throw new Error("arx: counter overflow");const m=Math.min(64,l-g);if(f&&64===m){const y=g/4;if(g%4!=0)throw new Error("arx: invalid block position");for(let v,_=0;_<16;_++)v=y+_,p[v]=h[v]^d[_];g+=64}else{for(let _,y=0;y0;)p.pop().fill(0);return d}}function Yu(e,t,r,i,s,o=20){let a=e[0],c=e[1],l=e[2],u=e[3],d=t[0],f=t[1],h=t[2],p=t[3],g=t[4],m=t[5],y=t[6],_=t[7],v=s,w=r[0],b=r[1],D=r[2],C=a,S=c,I=l,P=u,H=d,V=f,$=h,X=p,L=g,T=m,E=y,x=_,R=v,M=w,W=b,J=D;for(let Se=0;Se{e.update(t);const r=t.length%16;r&&e.update(mJ.subarray(r))},yJ=new Uint8Array(32);function W2(e,t,r,i,s){const o=e(t,r,yJ),a=cJ.create(o);s&&G2(a,s),G2(a,i);const c=new Uint8Array(16),l=Ec(c);Po(l,0,BigInt(s?s.length:0),!0),Po(l,8,BigInt(i.length),!0),a.update(c);const u=a.digest();return o.fill(0),u}const Z2=e=>(t,r,i)=>(xe(t,32),xe(r),{encrypt:(o,a)=>{const c=o.length,l=c+16;a?xe(a,l):a=new Uint8Array(l),e(t,r,o,a,1);const u=W2(e,t,r,a.subarray(0,-16),i);return a.set(u,c),a},decrypt:(o,a)=>{const c=o.length,l=c-16;if(c<16)throw new Error("encrypted data must be at least 16 bytes");a?xe(a,l):a=new Uint8Array(l);const u=o.subarray(0,-16);if(!rg(o.subarray(-16),W2(e,t,r,u,i)))throw new Error("invalid tag");return e(t,r,u,a,1),a}});Z2(hb),Z2(gJ);class K2 extends d2{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,di.hash(t);const i=Ro(r);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,o=new Uint8Array(s);o.set(i.length>s?t.create().update(i).digest():i);for(let a=0;anew K2(e,t).update(r).digest();cg.create=(e,t)=>new K2(e,t);const pb=new Uint8Array([0]),Y2=new Uint8Array;var vJ=Object.defineProperty,mt=(e,t)=>{for(var r in t)vJ(e,r,{get:t[r],enumerable:!0})},Lo=Symbol("verified"),_J=e=>e instanceof Object;function gb(e){if(!_J(e)||"number"!=typeof e.kind||"string"!=typeof e.content||"number"!=typeof e.created_at||"string"!=typeof e.pubkey||!e.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(e.tags))return!1;for(let t=0;teP,QueueNode:()=>X2,binarySearch:()=>mb,insertEventIntoAscendingList:()=>EJ,insertEventIntoDescendingList:()=>bJ,normalizeURL:()=>Tc,utf8Decoder:()=>Hi,utf8Encoder:()=>Nr});var Hi=new TextDecoder("utf-8"),Nr=new TextEncoder;function Tc(e){-1===e.indexOf("://")&&(e="wss://"+e);let t=new URL(e);return t.pathname=t.pathname.replace(/\/+/g,"/"),t.pathname.endsWith("/")&&(t.pathname=t.pathname.slice(0,-1)),("80"===t.port&&"ws:"===t.protocol||"443"===t.port&&"wss:"===t.protocol)&&(t.port=""),t.searchParams.sort(),t.hash="",t.toString()}function bJ(e,t){const[r,i]=mb(e,s=>t.id===s.id?0:t.created_at===s.created_at?-1:s.created_at-t.created_at);return i||e.splice(r,0,t),e}function EJ(e,t){const[r,i]=mb(e,s=>t.id===s.id?0:t.created_at===s.created_at?-1:t.created_at-s.created_at);return i||e.splice(r,0,t),e}function mb(e,t){let r=0,i=e.length-1;for(;r<=i;){const s=Math.floor((r+i)/2),o=t(e[s]);if(0===o)return[s,!0];o<0?i=s-1:r=s+1}return[r,!1]}var X2=class{value;next=null;prev=null;constructor(e){this.value=e}},eP=class{first;last;constructor(){this.first=null,this.last=null}enqueue(e){const t=new X2(e);return this.last?this.last===this.first?(this.last=t,this.last.prev=this.first,this.first.next=t):(t.prev=this.last,this.last.next=t,this.last=t):(this.first=t,this.last=t),!0}dequeue(){if(!this.first)return null;if(this.first===this.last){const t=this.first;return this.first=null,this.last=null,t.value}const e=this.first;return this.first=e.next,e.value}};function lg(e){let t=wc(Nr.encode(function DJ(e){if(!gb(e))throw new Error("can't serialize event with wrong or missing properties");return JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content])}(e)));return gt(t)}var ug=new class{generateSecretKey(){return Wu.utils.randomPrivateKey()}getPublicKey(e){return gt(Wu.getPublicKey(e))}finalizeEvent(e,t){const r=e;return r.pubkey=gt(Wu.getPublicKey(t)),r.id=lg(r),r.sig=gt(Wu.sign(lg(r),t)),r[Lo]=!0,r}verifyEvent(e){if("boolean"==typeof e[Lo])return e[Lo];const t=lg(e);if(t!==e.id)return e[Lo]=!1,!1;try{const r=Wu.verify(e.sig,t,e.pubkey);return e[Lo]=r,r}catch{return e[Lo]=!1,!1}}},yb=ug.generateSecretKey,Ju=ug.getPublicKey,Rr=ug.finalizeEvent,Ic=ug.verifyEvent,Kn={};function tP(e){return 1e3<=e&&e<1e4||[1,2,4,5,6,7,8,16,40,41,42,43,44].includes(e)}function vb(e){return[0,3].includes(e)||1e4<=e&&e<2e4}function nP(e){return 2e4<=e&&e<3e4}function _b(e){return 3e4<=e&&e<4e4}function SJ(e){return tP(e)?"regular":vb(e)?"replaceable":nP(e)?"ephemeral":_b(e)?"parameterized":"unknown"}function TJ(e,t){const r=t instanceof Array?t:[t];return gb(e)&&r.includes(e.kind)||!1}mt(Kn,{Application:()=>TX,BadgeAward:()=>OJ,BadgeDefinition:()=>_X,BlockedRelaysList:()=>rX,BookmarkList:()=>eX,Bookmarksets:()=>mX,Calendar:()=>OX,CalendarEventRSVP:()=>kX,ChannelCreation:()=>iP,ChannelHideMessage:()=>aP,ChannelMessage:()=>oP,ChannelMetadata:()=>sP,ChannelMuteUser:()=>cP,ClassifiedListing:()=>AX,ClientAuth:()=>uP,CommunitiesList:()=>tX,CommunityDefinition:()=>FX,CommunityPostApproval:()=>HJ,Contacts:()=>MJ,CreateOrUpdateProduct:()=>EX,CreateOrUpdateStall:()=>bX,Curationsets:()=>yX,Date:()=>NX,DirectMessageRelaysList:()=>aX,DraftClassifiedListing:()=>MX,DraftLong:()=>DX,Emojisets:()=>SX,EncryptedDirectMessage:()=>NJ,EventDeletion:()=>RJ,FileMetadata:()=>FJ,FileServerPreference:()=>cX,Followsets:()=>hX,GenericRepost:()=>PJ,Genericlists:()=>pX,GiftWrap:()=>lP,HTTPAuth:()=>Eb,Handlerinformation:()=>LX,Handlerrecommendation:()=>PX,Highlights:()=>QJ,InterestsList:()=>sX,Interestsets:()=>wX,JobFeedback:()=>GJ,JobRequest:()=>zJ,JobResult:()=>qJ,Label:()=>$J,LightningPubRPC:()=>uX,LiveChatMessage:()=>BJ,LiveEvent:()=>IX,LongFormArticle:()=>CX,Metadata:()=>IJ,Mutelist:()=>YJ,NWCWalletInfo:()=>lX,NWCWalletRequest:()=>dP,NWCWalletResponse:()=>dX,NostrConnect:()=>fX,OpenTimestamps:()=>LJ,Pinlist:()=>JJ,PrivateDirectMessage:()=>kJ,ProblemTracker:()=>VJ,ProfileBadges:()=>vX,PublicChatsList:()=>nX,Reaction:()=>bb,RecommendRelay:()=>AJ,RelayList:()=>XJ,Relaysets:()=>gX,Report:()=>UJ,Reporting:()=>jJ,Repost:()=>wb,Seal:()=>rP,SearchRelaysList:()=>iX,ShortTextNote:()=>xJ,Time:()=>RX,UserEmojiList:()=>oX,UserStatuses:()=>xX,Zap:()=>KJ,ZapGoal:()=>WJ,ZapRequest:()=>ZJ,classifyKind:()=>SJ,isEphemeralKind:()=>nP,isKind:()=>TJ,isParameterizedReplaceableKind:()=>_b,isRegularKind:()=>tP,isReplaceableKind:()=>vb});var IJ=0,xJ=1,AJ=2,MJ=3,NJ=4,RJ=5,wb=6,bb=7,OJ=8,rP=13,kJ=14,PJ=16,iP=40,sP=41,oP=42,aP=43,cP=44,LJ=1040,lP=1059,FJ=1063,BJ=1311,VJ=1971,UJ=1984,jJ=1984,$J=1985,HJ=4550,zJ=5999,qJ=6999,GJ=7e3,WJ=9041,ZJ=9734,KJ=9735,QJ=9802,YJ=1e4,JJ=10001,XJ=10002,eX=10003,tX=10004,nX=10005,rX=10006,iX=10007,sX=10015,oX=10030,aX=10050,cX=10096,lX=13194,uX=21e3,uP=22242,dP=23194,dX=23195,fX=24133,Eb=27235,hX=3e4,pX=30001,gX=30002,mX=30003,yX=30004,vX=30008,_X=30009,wX=30015,bX=30017,EX=30018,CX=30023,DX=30024,SX=30030,TX=30078,IX=30311,xX=30315,AX=30402,MX=30403,NX=31922,RX=31923,OX=31924,kX=31925,PX=31989,LX=31990,FX=34550;function BX(e,t){if(e.ids&&-1===e.ids.indexOf(t.id)||e.kinds&&-1===e.kinds.indexOf(t.kind)||e.authors&&-1===e.authors.indexOf(t.pubkey))return!1;for(let r in e)if("#"===r[0]){let s=e[`#${r.slice(1)}`];if(s&&!t.tags.find(([o,a])=>o===r.slice(1)&&-1!==s.indexOf(a)))return!1}return!(e.since&&t.created_ate.until)}function dg(e,t){for(let r=0;rvb(t))?e.authors.length*e.kinds.length:1/0,e.authors?.length&&e.kinds?.every(t=>_b(t))&&e["#d"]?.length?e.authors.length*e.kinds.length*e["#d"].length:1/0)}function fg(e,t){let r=t.length+3,i=e.indexOf(`"${t}":`)+r,s=e.slice(i).indexOf('"')+i+1;return e.slice(s,s+64)}function hP(e,t){let r=t.length,i=e.indexOf(`"${t}":`)+r+3,s=e.slice(i),o=Math.min(s.indexOf(","),s.indexOf("}"));return parseInt(s.slice(0,o),10)}function pP(e){let t=e.slice(0,22).indexOf('"EVENT"');if(-1===t)return null;let r=e.slice(t+7+1).indexOf('"');if(-1===r)return null;let i=t+7+1+r,s=e.slice(i+1,80).indexOf('"');return-1===s?null:e.slice(i+1,i+1+s)}function UX(e,t){return t===fg(e,"id")}function jX(e,t){return t===fg(e,"pubkey")}function $X(e,t){return t===hP(e,"kind")}function gP(e,t){return{kind:uP,created_at:Math.floor(Date.now()/1e3),tags:[["relay",e],["challenge",t]],content:""}}mt({},{getHex64:()=>fg,getInt:()=>hP,getSubscriptionId:()=>pP,matchEventId:()=>UX,matchEventKind:()=>$X,matchEventPubkey:()=>jX}),mt({},{makeAuthEvent:()=>gP});try{WebSocket}catch{}try{WebSocket}catch{}mt({},{BECH32_REGEX:()=>vP,Bech32MaxSize:()=>Sb,NostrTypeGuard:()=>QX,decode:()=>Xu,encodeBytes:()=>pg,naddrEncode:()=>ree,neventEncode:()=>nee,noteEncode:()=>eee,nprofileEncode:()=>tee,npubEncode:()=>XX,nsecEncode:()=>JX});var QX={isNProfile:e=>/^nprofile1[a-z\d]+$/.test(e||""),isNEvent:e=>/^nevent1[a-z\d]+$/.test(e||""),isNAddr:e=>/^naddr1[a-z\d]+$/.test(e||""),isNSec:e=>/^nsec1[a-z\d]{58}$/.test(e||""),isNPub:e=>/^npub1[a-z\d]{58}$/.test(e||""),isNote:e=>/^note1[a-z\d]+$/.test(e||""),isNcryptsec:e=>/^ncryptsec1[a-z\d]+$/.test(e||"")},Sb=5e3,vP=/[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}/;function Xu(e){let{prefix:t,words:r}=pi.decode(e,Sb),i=new Uint8Array(pi.fromWords(r));switch(t){case"nprofile":{let s=Tb(i);if(!s[0]?.[0])throw new Error("missing TLV 0 for nprofile");if(32!==s[0][0].length)throw new Error("TLV 0 should be 32 bytes");return{type:"nprofile",data:{pubkey:gt(s[0][0]),relays:s[1]?s[1].map(o=>Hi.decode(o)):[]}}}case"nevent":{let s=Tb(i);if(!s[0]?.[0])throw new Error("missing TLV 0 for nevent");if(32!==s[0][0].length)throw new Error("TLV 0 should be 32 bytes");if(s[2]&&32!==s[2][0].length)throw new Error("TLV 2 should be 32 bytes");if(s[3]&&4!==s[3][0].length)throw new Error("TLV 3 should be 4 bytes");return{type:"nevent",data:{id:gt(s[0][0]),relays:s[1]?s[1].map(o=>Hi.decode(o)):[],author:s[2]?.[0]?gt(s[2][0]):void 0,kind:s[3]?.[0]?parseInt(gt(s[3][0]),16):void 0}}}case"naddr":{let s=Tb(i);if(!s[0]?.[0])throw new Error("missing TLV 0 for naddr");if(!s[2]?.[0])throw new Error("missing TLV 2 for naddr");if(32!==s[2][0].length)throw new Error("TLV 2 should be 32 bytes");if(!s[3]?.[0])throw new Error("missing TLV 3 for naddr");if(4!==s[3][0].length)throw new Error("TLV 3 should be 4 bytes");return{type:"naddr",data:{identifier:Hi.decode(s[0][0]),pubkey:gt(s[2][0]),kind:parseInt(gt(s[3][0]),16),relays:s[1]?s[1].map(o=>Hi.decode(o)):[]}}}case"nsec":return{type:t,data:i};case"npub":case"note":return{type:t,data:gt(i)};default:throw new Error(`unknown prefix ${t}`)}}function Tb(e){let t={},r=e;for(;r.length>0;){let i=r[0],s=r[1],o=r.slice(2,2+s);if(r=r.slice(2+s),o.lengthNr.encode(r))}))}function nee(e){let t;return void 0!==e.kind&&(t=function YX(e){const t=new Uint8Array(4);return t[0]=e>>24&255,t[1]=e>>16&255,t[2]=e>>8&255,t[3]=255&e,t}(e.kind)),hg("nevent",Ib({0:[No(e.id)],1:(e.relays||[]).map(i=>Nr.encode(i)),2:e.author?[No(e.author)]:[],3:t?[new Uint8Array(t)]:[]}))}function ree(e){let t=new ArrayBuffer(4);return new DataView(t).setUint32(0,e.kind,!1),hg("naddr",Ib({0:[Nr.encode(e.identifier)],1:(e.relays||[]).map(i=>Nr.encode(i)),2:[No(e.pubkey)],3:[new Uint8Array(t)]}))}function Ib(e){let t=[];return Object.entries(e).reverse().forEach(([r,i])=>{i.forEach(s=>{let o=new Uint8Array(s.length+2);o.set([parseInt(r)],0),o.set([s.length],1),o.set(s,2),t.push(o)})}),Jp(...t)}var xb={};function _P(e,t,r){return Ab.apply(this,arguments)}function Ab(){return(Ab=U(function*(e,t,r){const i=e instanceof Uint8Array?gt(e):e,o=wP(_c.getSharedSecret(i,"02"+t));let a=Uint8Array.from(h2(16)),c=Nr.encode(r),l=V2(o,a).encrypt(c);return`${Vi.encode(new Uint8Array(l))}?iv=${Vi.encode(new Uint8Array(a.buffer))}`})).apply(this,arguments)}function see(e,t,r){return Mb.apply(this,arguments)}function Mb(){return(Mb=U(function*(e,t,r){const i=e instanceof Uint8Array?gt(e):e;let[s,o]=r.split("?iv="),c=wP(_c.getSharedSecret(i,"02"+t)),l=Vi.decode(o),u=Vi.decode(s),d=V2(c,l).decrypt(u);return Hi.decode(d)})).apply(this,arguments)}function wP(e){return e.slice(1,33)}mt(xb,{decrypt:()=>see,encrypt:()=>_P}),mt({},{NIP05_REGEX:()=>Nb,isNip05:()=>aee,isValid:()=>uee,queryProfile:()=>bP,searchDomain:()=>lee,useFetchImplementation:()=>cee});var gg,Nb=/^(?:([\w.+-]+)@)?([\w_-]+(\.[\w_-]+)+)$/,aee=e=>Nb.test(e||"");try{gg=fetch}catch{}function cee(e){gg=e}function lee(e){return Rb.apply(this,arguments)}function Rb(){return(Rb=U(function*(e,t=""){try{const r=`https://${e}/.well-known/nostr.json?name=${t}`,i=yield gg(r,{redirect:"manual"});if(200!==i.status)throw Error("Wrong response code");return(yield i.json()).names}catch{return{}}})).apply(this,arguments)}function bP(e){return Ob.apply(this,arguments)}function Ob(){return(Ob=U(function*(e){const t=e.match(Nb);if(!t)return null;const[,r="_",i]=t;try{const s=`https://${i}/.well-known/nostr.json?name=${r}`,o=yield gg(s,{redirect:"manual"});if(200!==o.status)throw Error("Wrong response code");const a=yield o.json(),c=a.names[r];return c?{pubkey:c,relays:a.relays?.[c]}:null}catch{return null}})).apply(this,arguments)}function uee(e,t){return kb.apply(this,arguments)}function kb(){return(kb=U(function*(e,t){const r=yield bP(t);return!!r&&r.pubkey===e})).apply(this,arguments)}function fee(e){const t={reply:void 0,root:void 0,mentions:[],profiles:[],quotes:[]};let r,i;for(let s=e.tags.length-1;s>=0;s--){const o=e.tags[s];if("e"===o[0]&&o[1]){const[a,c,l,u,d]=o,f={id:c,relays:l?[l]:[],author:d};if("root"===u){t.root=f;continue}if("reply"===u){t.reply=f;continue}if("mention"===u){t.mentions.push(f);continue}r?i=f:r=f,t.mentions.push(f)}else{if("q"===o[0]&&o[1]){const[a,c,l]=o;t.quotes.push({id:c,relays:l?[l]:[]})}"p"===o[0]&&o[1]&&t.profiles.push({pubkey:o[1],relays:o[2]?[o[2]]:[]})}}return t.root||(t.root=i||r||t.reply),t.reply||(t.reply=r||t.root),[t.reply,t.root].forEach(s=>{if(!s)return;let o=t.mentions.indexOf(s);if(-1!==o&&t.mentions.splice(o,1),s.author){let a=t.profiles.find(c=>c.pubkey===s.author);a&&a.relays&&(s.relays||(s.relays=[]),a.relays.forEach(c=>{-1===s.relays?.indexOf(c)&&s.relays.push(c)}),a.relays=s.relays)}}),t.mentions.forEach(s=>{if(s.author){let o=t.profiles.find(a=>a.pubkey===s.author);o&&o.relays&&(s.relays||(s.relays=[]),o.relays.forEach(a=>{-1===s.relays.indexOf(a)&&s.relays.push(a)}),o.relays=s.relays)}}),t}mt({},{parse:()=>fee}),mt({},{fetchRelayInformation:()=>gee,useFetchImplementation:()=>pee});try{fetch}catch{}function pee(e){}function gee(e){return Pb.apply(this,arguments)}function Pb(){return(Pb=U(function*(e){return yield(yield fetch(e.replace("ws://","http://").replace("wss://","https://"),{headers:{Accept:"application/nostr+json"}})).json()})).apply(this,arguments)}function CP(e){let t=0;for(let r=0;r<64;r+=8){const i=parseInt(e.substring(r,r+8),16);if(0!==i){t+=Math.clz32(i);break}t+=32}return t}function yee(e,t){let r=0;const i=e,s=["nonce",r.toString(),t.toString()];for(i.tags.push(s);;){const o=Math.floor((new Date).getTime()/1e3);if(o!==i.created_at&&(r=0,i.created_at=o),s[1]=(++r).toString(),i.id=DP(i),CP(i.id)>=t)break}return i}function DP(e){return gt(wc(Nr.encode(JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content]))))}function _ee(e,t,r,i){return Rr({kind:wb,tags:[...e.tags??[],["e",t.id,r],["p",t.pubkey]],content:""===e.content?"":JSON.stringify(t),created_at:e.created_at},i)}function SP(e){if(e.kind!==wb)return;let t,r;for(let i=e.tags.length-1;i>=0&&(void 0===t||void 0===r);i--){const s=e.tags[i];s.length>=2&&("e"===s[0]&&void 0===t?t=s:"p"===s[0]&&void 0===r&&(r=s))}return void 0!==t?{id:t[1],relays:[t[2],r?.[2]].filter(i=>"string"==typeof i),author:r?.[1]}:void 0}function wee(e,{skipVerification:t}={}){const r=SP(e);if(void 0===r||""===e.content)return;let i;try{i=JSON.parse(e.content)}catch{return}return i.id===r.id&&(t||Ic(i))?i:void 0}mt({},{fastEventHash:()=>DP,getPow:()=>CP,minePow:()=>yee}),mt({},{finishRepostEvent:()=>_ee,getRepostedEvent:()=>wee,getRepostedEventPointer:()=>SP}),mt({},{NOSTR_URI_REGEX:()=>mg,parse:()=>Cee,test:()=>Eee});var mg=new RegExp(`nostr:(${vP.source})`);function Eee(e){return"string"==typeof e&&new RegExp(`^${mg.source}$`).test(e)}function Cee(e){const t=e.match(new RegExp(`^${mg.source}$`));if(!t)throw new Error(`Invalid Nostr URI: ${e}`);return{uri:t[0],value:t[1],decoded:Xu(t[1])}}function See(e,t,r){const i=t.tags.filter(s=>s.length>=2&&("e"===s[0]||"p"===s[0]));return Rr({...e,kind:bb,tags:[...e.tags??[],...i,["e",t.id],["p",t.pubkey]],content:e.content??"+"},r)}function Tee(e){if(e.kind!==bb)return;let t,r;for(let i=e.tags.length-1;i>=0&&(void 0===t||void 0===r);i--){const s=e.tags[i];s.length>=2&&("e"===s[0]&&void 0===t?t=s:"p"===s[0]&&void 0===r&&(r=s))}return void 0!==t&&void 0!==r?{id:t[1],relays:[t[2],r[2]].filter(i=>void 0!==i),author:r[1]}:void 0}mt({},{finishReactionEvent:()=>See,getReactedEventPointer:()=>Tee}),mt({},{matchAll:()=>xee,regex:()=>Lb,replaceAll:()=>Aee});var Lb=()=>new RegExp(`\\b${mg.source}\\b`,"g");function*xee(e){const t=e.matchAll(Lb());for(const r of t)try{const[i,s]=r;yield{uri:i,value:s,decoded:Xu(s),start:r.index,end:r.index+i.length}}catch{}}function Aee(e,t){return e.replaceAll(Lb(),(r,i)=>t({uri:r,value:i,decoded:Xu(i)}))}mt({},{channelCreateEvent:()=>Nee,channelHideMessageEvent:()=>kee,channelMessageEvent:()=>Oee,channelMetadataEvent:()=>Ree,channelMuteUserEvent:()=>Pee});var Nee=(e,t)=>{let r;if("object"==typeof e.content)r=JSON.stringify(e.content);else{if("string"!=typeof e.content)return;r=e.content}return Rr({kind:iP,tags:[...e.tags??[]],content:r,created_at:e.created_at},t)},Ree=(e,t)=>{let r;if("object"==typeof e.content)r=JSON.stringify(e.content);else{if("string"!=typeof e.content)return;r=e.content}return Rr({kind:sP,tags:[["e",e.channel_create_event_id],...e.tags??[]],content:r,created_at:e.created_at},t)},Oee=(e,t)=>{const r=[["e",e.channel_create_event_id,e.relay_url,"root"]];return e.reply_to_channel_message_event_id&&r.push(["e",e.reply_to_channel_message_event_id,e.relay_url,"reply"]),Rr({kind:oP,tags:[...r,...e.tags??[]],content:e.content,created_at:e.created_at},t)},kee=(e,t)=>{let r;if("object"==typeof e.content)r=JSON.stringify(e.content);else{if("string"!=typeof e.content)return;r=e.content}return Rr({kind:aP,tags:[["e",e.channel_message_event_id],...e.tags??[]],content:r,created_at:e.created_at},t)},Pee=(e,t)=>{let r;if("object"==typeof e.content)r=JSON.stringify(e.content);else{if("string"!=typeof e.content)return;r=e.content}return Rr({kind:cP,tags:[["p",e.pubkey_to_mute],...e.tags??[]],content:r,created_at:e.created_at},t)};mt({},{EMOJI_SHORTCODE_REGEX:()=>TP,matchAll:()=>Fee,regex:()=>Fb,replaceAll:()=>Bee});var Bb,TP=/:(\w+):/,Fb=()=>new RegExp(`\\B${TP.source}\\B`,"g");function*Fee(e){const t=e.matchAll(Fb());for(const r of t)try{const[i,s]=r;yield{shortcode:i,name:s,start:r.index,end:r.index+i.length}}catch{}}function Bee(e,t){return e.replaceAll(Fb(),(r,i)=>t({shortcode:r,name:i}))}mt({},{useFetchImplementation:()=>Uee,validateGithub:()=>jee});try{Bb=fetch}catch{}function Uee(e){Bb=e}function jee(e,t,r){return Vb.apply(this,arguments)}function Vb(){return(Vb=U(function*(e,t,r){try{return(yield(yield Bb(`https://gist.github.com/${t}/${r}/raw`)).text())===`Verifying that I control the following Nostr public key: ${e}`}catch{return!1}})).apply(this,arguments)}var yg={};mt(yg,{decrypt:()=>Hb,encrypt:()=>$b,getConversationKey:()=>Ub,v2:()=>Gee});var IP=1,xP=65535;function Ub(e,t){const r=_c.getSharedSecret(e,"02"+t).subarray(1,33);return function Q2(e,t,r){return di.hash(e),void 0===r&&(r=new Uint8Array(e.outputLen)),cg(e,Ro(r),Ro(t))}(wc,r,"nip44-v2")}function AP(e,t){const r=function J2(e,t,r,i=32){if(di.hash(e),di.number(i),i>255*e.outputLen)throw new Error("Length should be <= 255*HashLen");const s=Math.ceil(i/e.outputLen);void 0===r&&(r=Y2);const o=new Uint8Array(s*e.outputLen),a=cg.create(e,t),c=a._cloneInto(),l=new Uint8Array(a.outputLen);for(let u=0;uxP)throw new Error("invalid plaintext size: must be between 1 and 65535 bytes");const t=new Uint8Array(2);return new DataView(t.buffer).setUint16(0,e,!1),t}(r);return Jp(i,t,new Uint8Array(jb(r)-r))}(e),c=hb(i,s,a),l=MP(o,c,r);return Vi.encode(Jp(new Uint8Array([2]),r,c,l))}function Hb(e,t){const{nonce:r,ciphertext:i,mac:s}=function qee(e){if("string"!=typeof e)throw new Error("payload must be a valid string");const t=e.length;if(t<132||t>87472)throw new Error("invalid payload length: "+t);if("#"===e[0])throw new Error("unknown encryption version");let r;try{r=Vi.decode(e)}catch(o){throw new Error("invalid base64: "+o.message)}const i=r.length;if(i<99||i>65603)throw new Error("invalid data length: "+i);const s=r[0];if(2!==s)throw new Error("unknown encryption version "+s);return{nonce:r.subarray(1,33),ciphertext:r.subarray(33,-32),mac:r.subarray(-32)}}(e),{chacha_key:o,chacha_nonce:a,hmac_key:c}=AP(t,r);if(!rg(MP(c,i,r),s))throw new Error("invalid MAC");return function zee(e){const t=new DataView(e.buffer).getUint16(0),r=e.subarray(2,2+t);if(txP||r.length!==t||e.length!==2+jb(t))throw new Error("invalid padding");return Hi.decode(r)}(hb(o,a,i))}var qb,Gee={utils:{getConversationKey:Ub,calcPaddedLen:jb},encrypt:$b,decrypt:Hb};function Zee(e){const{pathname:t,searchParams:r}=new URL(e),i=t,s=r.get("relay"),o=r.get("secret");if(!i||!s||!o)throw new Error("invalid connection string");return{pubkey:i,relay:s,secret:o}}function Kee(e,t,r){return zb.apply(this,arguments)}function zb(){return(zb=U(function*(e,t,r){const s=yield _P(t,e,JSON.stringify({method:"pay_invoice",params:{invoice:r}})),o={kind:dP,created_at:Math.round(Date.now()/1e3),content:s,tags:[["p",e]]};return Rr(o,t)})).apply(this,arguments)}mt({},{makeNwcRequestEvent:()=>Kee,parseConnectionString:()=>Zee}),mt({},{getZapEndpoint:()=>Jee,makeZapReceipt:()=>tte,makeZapRequest:()=>Xee,useFetchImplementation:()=>Yee,validateZapRequest:()=>ete});try{qb=fetch}catch{}function Yee(e){qb=e}function Jee(e){return Gb.apply(this,arguments)}function Gb(){return(Gb=U(function*(e){try{let t="",{lud06:r,lud16:i}=JSON.parse(e.content);if(r){let{words:a}=pi.decode(r,1e3),c=pi.fromWords(a);t=Hi.decode(c)}else{if(!i)return null;{let[a,c]=i.split("@");t=new URL(`/.well-known/lnurlp/${a}`,`https://${c}`).toString()}}let o=yield(yield qb(t)).json();if(o.allowsNostr&&o.nostrPubkey)return o.callback}catch{}return null})).apply(this,arguments)}function Xee({profile:e,event:t,amount:r,relays:i,comment:s=""}){if(!r)throw new Error("amount not given");if(!e)throw new Error("profile not given");let o={kind:9734,created_at:Math.round(Date.now()/1e3),content:s,tags:[["p",e],["amount",r.toString()],["relays",...i]]};return t&&o.tags.push(["e",t]),o}function ete(e){let t;try{t=JSON.parse(e)}catch{return"Invalid zap request JSON."}if(!gb(t))return"Zap request is not a valid Nostr event.";if(!Ic(t))return"Invalid signature on zap request.";let r=t.tags.find(([o,a])=>"p"===o&&a);if(!r)return"Zap request doesn't have a 'p' tag.";if(!r[1].match(/^[a-f0-9]{64}$/))return"Zap request 'p' tag is not valid hex.";let i=t.tags.find(([o,a])=>"e"===o&&a);return i&&!i[1].match(/^[a-f0-9]{64}$/)?"Zap request 'e' tag is not valid hex.":t.tags.find(([o,a])=>"relays"===o&&a)?null:"Zap request doesn't have a 'relays' tag."}function tte({zapRequest:e,preimage:t,bolt11:r,paidAt:i}){let s=JSON.parse(e),o=s.tags.filter(([c])=>"e"===c||"p"===c||"a"===c),a={kind:9735,created_at:Math.round(i.getTime()/1e3),content:"",tags:[...o,["P",s.pubkey],["bolt11",r],["description",e]]};return t&&a.tags.push(["preimage",t]),a}mt({},{createRumor:()=>LP,createSeal:()=>FP,createWrap:()=>BP,unwrapEvent:()=>VP,unwrapManyEvents:()=>ste,wrapEvent:()=>Wb,wrapManyEvents:()=>ite});var NP=()=>Math.round(Date.now()/1e3),RP=()=>Math.round(NP()-172800*Math.random()),OP=(e,t)=>Ub(e,t),kP=(e,t,r)=>$b(JSON.stringify(e),OP(t,r)),PP=(e,t)=>JSON.parse(Hb(e.content,OP(t,e.pubkey)));function LP(e,t){const r={created_at:NP(),content:"",tags:[],...e,pubkey:Ju(t)};return r.id=lg(r),r}function FP(e,t,r){return Rr({kind:rP,content:kP(e,t,r),created_at:RP(),tags:[]},t)}function BP(e,t){const r=yb();return Rr({kind:lP,content:kP(e,r,t),created_at:RP(),tags:[["p",t]]},r)}function Wb(e,t,r){return BP(FP(LP(e,t),t,r),r)}function ite(e,t,r){if(!r||0===r.length)throw new Error("At least one recipient is required.");const i=Ju(t),s=[Wb(e,t,i)];return r.forEach(o=>{s.push(Wb(e,t,o))}),s}function VP(e,t){const r=PP(e,t);return PP(r,t)}function ste(e,t){let r=[];return e.forEach(i=>{r.push(VP(i,t))}),r.sort((i,s)=>i.created_at-s.created_at),r}mt({},{getToken:()=>ate,hashPayload:()=>Yb,unpackEventFromToken:()=>jP,validateEvent:()=>WP,validateEventKind:()=>HP,validateEventMethodTag:()=>qP,validateEventPayloadTag:()=>GP,validateEventTimestamp:()=>$P,validateEventUrlTag:()=>zP,validateToken:()=>cte});var UP="Nostr ";function ate(e,t,r){return Zb.apply(this,arguments)}function Zb(){return(Zb=U(function*(e,t,r,i=!1,s){const o={kind:Eb,tags:[["u",e],["method",t]],created_at:Math.round((new Date).getTime()/1e3),content:""};s&&o.tags.push(["payload",Yb(s)]);const a=yield r(o);return(i?UP:"")+Vi.encode(Nr.encode(JSON.stringify(a)))})).apply(this,arguments)}function cte(e,t,r){return Kb.apply(this,arguments)}function Kb(){return(Kb=U(function*(e,t,r){const i=yield jP(e).catch(o=>{throw o});return yield WP(i,t,r).catch(o=>{throw o})})).apply(this,arguments)}function jP(e){return Qb.apply(this,arguments)}function Qb(){return(Qb=U(function*(e){if(!e)throw new Error("Missing token");e=e.replace(UP,"");const t=Hi.decode(Vi.decode(e));if(!t||0===t.length||!t.startsWith("{"))throw new Error("Invalid token");return JSON.parse(t)})).apply(this,arguments)}function $P(e){return!!e.created_at&&Math.round((new Date).getTime()/1e3)-e.created_at<60}function HP(e){return e.kind===Eb}function zP(e,t){const r=e.tags.find(i=>"u"===i[0]);return!!r&&r.length>0&&r[1]===t}function qP(e,t){const r=e.tags.find(i=>"method"===i[0]);return!!r&&r.length>0&&r[1].toLowerCase()===t.toLowerCase()}function Yb(e){return gt(wc(Nr.encode(JSON.stringify(e))))}function GP(e,t){const r=e.tags.find(s=>"payload"===s[0]);if(!r)return!1;const i=Yb(t);return r.length>0&&r[1]===i}function WP(e,t,r,i){return Jb.apply(this,arguments)}function Jb(){return(Jb=U(function*(e,t,r,i){if(!Ic(e))throw new Error("Invalid nostr event, signature invalid");if(!HP(e))throw new Error("Invalid nostr event, kind invalid");if(!$P(e))throw new Error("Invalid nostr event, created_at timestamp invalid");if(!zP(e,t))throw new Error("Invalid nostr event, url tag invalid");if(!qP(e,r))throw new Error("Invalid nostr event, method tag invalid");if(i&&"object"==typeof i&&Object.keys(i).length>0&&!GP(e,i))throw new Error("Invalid nostr event, payload tag does not match request body hash");return!0})).apply(this,arguments)}"object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date;const Xb="object"==typeof process&&process?process:{};let vg=globalThis.AbortController,QP=globalThis.AbortSignal;if(typeof vg>"u"){QP=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,s){this._onabort.push(s)}},vg=class{constructor(){t()}signal=new QP;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(const s of this.signal._onabort)s(i);this.signal.onabort?.(i)}}};let e="1"!==Xb.env?.LRU_CACHE_IGNORE_AC_WARNING;const t=()=>{e&&(e=!1,((e,t,r,i)=>{"function"==typeof Xb.emitWarning?Xb.emitWarning(e,t,r,i):console.error(`[${r}] ${t}: ${e}`)})("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))}}var JP,XP;Symbol("type"),Symbol,Symbol,JP=Symbol.iterator,XP=Symbol.toStringTag;class fr{cache;constructor(t){this.cache=t??new Map}get size(){return this.cache.size}add(t){this.#t(t);for(const r of this){if(fr.deletes(r,t)||fr.replaces(r,t))return this;fr.replaces(t,r)&&this.delete(r)}return this.cache.set(t.id,t),this}#t(t){if(5===t.kind)for(const r of t.tags)if("e"===r[0]){const i=this.cache.get(r[1]);i&&i.pubkey===t.pubkey&&this.delete(i)}}clear(){this.cache.clear()}delete(t){return this.cache.delete(t.id)}forEach(t,r){return this.cache.forEach((i,s)=>t(i,i,this),r)}has(t){return this.cache.has(t.id)}*entries(){for(const t of this.values())yield[t,t]}keys(){return this.values()}*values(){for(const t of fr.sortEvents([...this.cache.values()]))yield t}[JP](){return this.values()}[XP]="NSet";static isReplaceable(t){return[0,3].includes(t)||1e4<=t&&t<2e4}static isParameterizedReplaceable(t){return 3e4<=t&&t<4e4}static replaces(t,r){const{kind:i,pubkey:s}=t;if(fr.isReplaceable(i))return i===r.kind&&s===r.pubkey&&fr.sortEvents([t,r])[0]===t;if(fr.isParameterizedReplaceable(i)){const o=t.tags.find(([c])=>"d"===c)?.[1]||"",a=r.tags.find(([c])=>"d"===c)?.[1]||"";return i===r.kind&&s===r.pubkey&&fr.sortEvents([t,r])[0]===t&&o===a}return!1}static deletes(t,r){const{kind:i,pubkey:s,tags:o}=t;if(5===i&&s===r.pubkey)for(const[a,c]of o)if("e"===a&&c===r.id)return!0;return!1}static sortEvents(t){return t.sort((r,i)=>r.created_at!==i.created_at?i.created_at-r.created_at:r.id.localeCompare(i.id))}union(t){throw new Error("Method not implemented.")}intersection(t){throw new Error("Method not implemented.")}difference(t){throw new Error("Method not implemented.")}symmetricDifference(t){throw new Error("Method not implemented.")}isSubsetOf(t){throw new Error("Method not implemented.")}isSupersetOf(t){throw new Error("Method not implemented.")}isDisjointFrom(t){throw new Error("Method not implemented.")}}function Mc(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function Or(e,...t){if(!function dte(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function ed(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}Symbol;const Nc="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,Fo=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),yi=(e,t)=>e<<32-t|e>>>t;function rL(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function Bo(e){return"string"==typeof e&&(e=rL(e)),Or(e),e}new Uint8Array(new Uint32Array([287454020]).buffer);class iL{clone(){return this._cloneInto()}}function rE(e){const t=i=>e().update(Bo(i)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function _te(e=32){if(Nc&&"function"==typeof Nc.getRandomValues)return Nc.getRandomValues(new Uint8Array(e));if(Nc&&"function"==typeof Nc.randomBytes)return Nc.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}class sL extends iL{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,function tE(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");Mc(e.outputLen),Mc(e.blockLen)}(t);const i=Bo(r);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,o=new Uint8Array(s);o.set(i.length>s?t.create().update(i).digest():i);for(let a=0;anew sL(e,t).update(r).digest();nd.create=(e,t)=>new sL(e,t);const bte=(e,t,r)=>e&t^~e&r,Ete=(e,t,r)=>e&t^e&r^t&r;class iE extends iL{constructor(t,r,i,s){super(),this.blockLen=t,this.outputLen=r,this.padOffset=i,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Fo(this.buffer)}update(t){ed(this);const{view:r,buffer:i,blockLen:s}=this,o=(t=Bo(t)).length;for(let a=0;as-a&&(this.process(i,0),a=0);for(let f=a;f>s&o),c=Number(r&o),u=i?0:4;e.setUint32(t+(i?4:0),a,i),e.setUint32(t+u,c,i)})(i,s-8,BigInt(8*this.length),o),this.process(i,0);const c=Fo(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;ft)),Dte=oL.map(e=>(9*e+5)%16);let sE=[oL],oE=[Dte];for(let e=0;e<4;e++)for(let t of[sE,oE])t.push(t[e].map(r=>Cte[r]));const Nte=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ps=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ls=new Uint32Array(64);class lL extends iE{constructor(){super(64,32,8,!1),this.A=0|Ps[0],this.B=0|Ps[1],this.C=0|Ps[2],this.D=0|Ps[3],this.E=0|Ps[4],this.F=0|Ps[5],this.G=0|Ps[6],this.H=0|Ps[7]}get(){const{A:t,B:r,C:i,D:s,E:o,F:a,G:c,H:l}=this;return[t,r,i,s,o,a,c,l]}set(t,r,i,s,o,a,c,l){this.A=0|t,this.B=0|r,this.C=0|i,this.D=0|s,this.E=0|o,this.F=0|a,this.G=0|c,this.H=0|l}process(t,r){for(let f=0;f<16;f++,r+=4)Ls[f]=t.getUint32(r,!1);for(let f=16;f<64;f++){const h=Ls[f-15],p=Ls[f-2],g=yi(h,7)^yi(h,18)^h>>>3,m=yi(p,17)^yi(p,19)^p>>>10;Ls[f]=m+Ls[f-7]+g+Ls[f-16]|0}let{A:i,B:s,C:o,D:a,E:c,F:l,G:u,H:d}=this;for(let f=0;f<64;f++){const p=d+(yi(c,6)^yi(c,11)^yi(c,25))+bte(c,l,u)+Nte[f]+Ls[f]|0,m=(yi(i,2)^yi(i,13)^yi(i,22))+Ete(i,s,o)|0;d=u,u=l,l=c,c=a+p|0,a=o,o=s,s=i,i=p+m|0}i=i+this.A|0,s=s+this.B|0,o=o+this.C|0,a=a+this.D|0,c=c+this.E|0,l=l+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(i,s,o,a,c,l,u,d)}roundClean(){Ls.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const aE=rE(()=>new lL),Eg=BigInt(2**32-1),cE=BigInt(32);function uL(e,t=!1){return t?{h:Number(e&Eg),l:Number(e>>cE&Eg)}:{h:0|Number(e>>cE&Eg),l:0|Number(e&Eg)}}const Ee_split=function Rte(e,t=!1){let r=new Uint32Array(e.length),i=new Uint32Array(e.length);for(let s=0;sBigInt(e))),uE=BigInt(0),Dg=BigInt(1),Kte=BigInt(2);function Vo(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function rd(e){if(!Vo(e))throw new Error("Uint8Array expected")}function Rc(e,t){if("boolean"!=typeof t)throw new Error(`${e} must be valid boolean, got "${t}".`)}const Qte=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Oc(e){rd(e);let t="";for(let r=0;r=qi._0&&e<=qi._9?e-qi._0:e>=qi._A&&e<=qi._F?e-(qi._A-10):e>=qi._a&&e<=qi._f?e-(qi._a-10):void 0}function Pc(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const i=new Uint8Array(r);for(let s=0,o=0;s"bigint"==typeof e&&uE<=e;function Sg(e,t,r){return hE(e)&&hE(t)&&hE(r)&&t<=e&&euE;e>>=Dg,t+=1);return t}const pE=e=>(Kte<new Uint8Array(e),pL=e=>Uint8Array.from(e);function gL(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let i=gE(e),s=gE(e),o=0;const a=()=>{i.fill(1),s.fill(0),o=0},c=(...f)=>r(s,i,...f),l=(f=gE())=>{s=c(pL([0]),f),i=c(),0!==f.length&&(s=c(pL([1]),f),i=c())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const h=[];for(;f{let p;for(a(),l(f);!(p=h(u()));)l();return a(),p}}const Yte={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||Vo(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function sd(e,t,r={}){const i=(s,o,a)=>{const c=Yte[o];if("function"!=typeof c)throw new Error(`Invalid validator "${o}", expected function`);const l=e[s];if(!(a&&void 0===l||c(l,e)))throw new Error(`Invalid param ${String(s)}=${l} (${typeof l}), expected ${o}`)};for(const[s,o]of Object.entries(t))i(s,o,!1);for(const[s,o]of Object.entries(r))i(s,o,!0);return e}function mE(e){const t=new WeakMap;return(r,...i)=>{const s=t.get(r);if(void 0!==s)return s;const o=e(r,...i);return t.set(r,o),o}}const $t=BigInt(0),Je=BigInt(1),Vs=BigInt(2),Jte=BigInt(3),yE=BigInt(4),mL=BigInt(5),yL=BigInt(8);function Xt(e,t){const r=e%t;return r>=$t?r:t+r}function tne(e,t,r){if(r<=$t||t<$t)throw new Error("Expected power/modulo > 0");if(r===Je)return $t;let i=Je;for(;t>$t;)t&Je&&(i=i*e%r),e=e*e%r,t>>=Je;return i}function hr(e,t,r){let i=e;for(;t-- >$t;)i*=i,i%=r;return i}function Tg(e,t){if(e===$t||t<=$t)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=Xt(e,t),i=t,s=$t,o=Je,a=Je,c=$t;for(;r!==$t;){const u=i/r,d=i%r,f=s-a*u,h=o-c*u;i=r,r=d,s=a,o=c,a=f,c=h}if(i!==Je)throw new Error("invert: does not exist");return Xt(s,t)}BigInt(9),BigInt(16);const ine=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function vE(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function vL(e,t,r=!1,i={}){if(e<=$t)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:o}=vE(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=function rne(e){if(e%yE===Jte){const t=(e+Je)/yE;return function(i,s){const o=i.pow(s,t);if(!i.eql(i.sqr(o),s))throw new Error("Cannot find square root");return o}}if(e%yL===mL){const t=(e-mL)/yL;return function(i,s){const o=i.mul(s,Vs),a=i.pow(o,t),c=i.mul(s,a),l=i.mul(i.mul(c,Vs),a),u=i.mul(c,i.sub(l,i.ONE));if(!i.eql(i.sqr(u),s))throw new Error("Cannot find square root");return u}}return function nne(e){const t=(e-Je)/Vs;let r,i,s;for(r=e-Je,i=0;r%Vs===$t;r/=Vs,i++);for(s=Vs;sXt(l,e),isValid:l=>{if("bigint"!=typeof l)throw new Error("Invalid field element: expected bigint, got "+typeof l);return $t<=l&&ll===$t,isOdd:l=>(l&Je)===Je,neg:l=>Xt(-l,e),eql:(l,u)=>l===u,sqr:l=>Xt(l*l,e),add:(l,u)=>Xt(l+u,e),sub:(l,u)=>Xt(l-u,e),mul:(l,u)=>Xt(l*u,e),pow:(l,u)=>function one(e,t,r){if(r<$t)throw new Error("Expected power > 0");if(r===$t)return e.ONE;if(r===Je)return t;let i=e.ONE,s=t;for(;r>$t;)r&Je&&(i=e.mul(i,s)),s=e.sqr(s),r>>=Je;return i}(c,l,u),div:(l,u)=>Xt(l*Tg(u,e),e),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>Tg(l,e),sqrt:i.sqrt||(l=>a(c,l)),invertBatch:l=>function ane(e,t){const r=new Array(t.length),i=t.reduce((o,a,c)=>e.is0(a)?o:(r[c]=o,e.mul(o,a)),e.ONE),s=e.inv(i);return t.reduceRight((o,a,c)=>e.is0(a)?o:(r[c]=e.mul(o,r[c]),e.mul(o,a)),s),r}(c,l),cmov:(l,u,d)=>d?u:l,toBytes:l=>r?fE(l,o):Lc(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return r?dE(l):Uo(l)}});return Object.freeze(c)}function _L(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function wL(e){const t=_L(e);return t+Math.ceil(t/2)}const une=BigInt(0),_E=BigInt(1),wE=new WeakMap,bL=new WeakMap;function EL(e){return function sne(e){sd(e,ine.reduce((i,s)=>(i[s]="function",i),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"}))}(e.Fp),sd(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...vE(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}function CL(e){void 0!==e.lowS&&Rc("lowS",e.lowS),void 0!==e.prehash&&Rc("prehash",e.prehash)}const{Ph:pne,aT:gne}=dm,Gi={Err:class extends Error{constructor(t=""){super(t)}},_tlv:{encode:(e,t)=>{const{Err:r}=Gi;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");const i=t.length/2,s=kc(i);if(s.length/2&128)throw new r("tlv.encode: long form length too big");const o=i>127?kc(s.length/2|128):"";return`${kc(e)}${o}${s}${t}`},decode(e,t){const{Err:r}=Gi;let i=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[i++]!==e)throw new r("tlv.decode: wrong tlv");const s=t[i++];let a=0;if(128&s){const l=127&s;if(!l)throw new r("tlv.decode(long): indefinite length not supported");if(l>4)throw new r("tlv.decode(long): byte length is too big");const u=t.subarray(i,i+l);if(u.length!==l)throw new r("tlv.decode: length bytes not complete");if(0===u[0])throw new r("tlv.decode(long): zero leftmost byte");for(const d of u)a=a<<8|d;if(i+=l,a<128)throw new r("tlv.decode(long): not minimal encoding")}else a=s;const c=t.subarray(i,i+a);if(c.length!==a)throw new r("tlv.decode: wrong value length");return{v:c,l:t.subarray(i+a)}}},_int:{encode(e){const{Err:t}=Gi;if(e{const v=y.toAffine();return id(Uint8Array.from([4]),r.toBytes(v.x),r.toBytes(v.y))}),o=t.fromBytes||(m=>{const y=m.subarray(1);return{x:r.fromBytes(y.subarray(0,r.BYTES)),y:r.fromBytes(y.subarray(r.BYTES,2*r.BYTES))}});function a(m){const{a:y,b:_}=t,v=r.sqr(m),w=r.mul(v,m);return r.add(r.add(w,r.mul(m,y)),_)}if(!r.eql(r.sqr(t.Gy),a(t.Gx)))throw new Error("bad generator point: equation left != right");function l(m){const{allowedPrivateKeyLengths:y,nByteLength:_,wrapPrivateKey:v,n:w}=t;if(y&&"bigint"!=typeof m){if(Vo(m)&&(m=Oc(m)),"string"!=typeof m||!y.includes(m.length))throw new Error("Invalid key");m=m.padStart(2*_,"0")}let b;try{b="bigint"==typeof m?m:Uo(kr("private key",m,_))}catch{throw new Error(`private key must be ${_} bytes, hex or bigint, not ${typeof m}`)}return v&&(b=Xt(b,w)),jo("private key",b,We,w),b}function u(m){if(!(m instanceof h))throw new Error("ProjectivePoint expected")}const d=mE((m,y)=>{const{px:_,py:v,pz:w}=m;if(r.eql(w,r.ONE))return{x:_,y:v};const b=m.is0();null==y&&(y=b?r.ONE:r.inv(w));const D=r.mul(_,y),C=r.mul(v,y),S=r.mul(w,y);if(b)return{x:r.ZERO,y:r.ZERO};if(!r.eql(S,r.ONE))throw new Error("invZ was invalid");return{x:D,y:C}}),f=mE(m=>{if(m.is0()){if(t.allowInfinityPoint&&!r.is0(m.py))return;throw new Error("bad point: ZERO")}const{x:y,y:_}=m.toAffine();if(!r.isValid(y)||!r.isValid(_))throw new Error("bad point: x or y not FE");const v=r.sqr(_),w=a(y);if(!r.eql(v,w))throw new Error("bad point: equation left != right");if(!m.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class h{constructor(y,_,v){if(this.px=y,this.py=_,this.pz=v,null==y||!r.isValid(y))throw new Error("x required");if(null==_||!r.isValid(_))throw new Error("y required");if(null==v||!r.isValid(v))throw new Error("z required");Object.freeze(this)}static fromAffine(y){const{x:_,y:v}=y||{};if(!y||!r.isValid(_)||!r.isValid(v))throw new Error("invalid affine point");if(y instanceof h)throw new Error("projective point not allowed");const w=b=>r.eql(b,r.ZERO);return w(_)&&w(v)?h.ZERO:new h(_,v,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(y){const _=r.invertBatch(y.map(v=>v.pz));return y.map((v,w)=>v.toAffine(_[w])).map(h.fromAffine)}static fromHex(y){const _=h.fromAffine(o(kr("pointHex",y)));return _.assertValidity(),_}static fromPrivateKey(y){return h.BASE.multiply(l(y))}static msm(y,_){return function fne(e,t,r,i){if(!Array.isArray(r)||!Array.isArray(i)||i.length!==r.length)throw new Error("arrays of points and scalars must have equal length");i.forEach((d,f)=>{if(!t.isValid(d))throw new Error(`wrong scalar at index ${f}`)}),r.forEach((d,f)=>{if(!(d instanceof e))throw new Error(`wrong point at index ${f}`)});const s=hL(BigInt(r.length)),o=s>12?s-3:s>4?s-2:s?2:1,a=(1<=0;d-=o){c.fill(e.ZERO);for(let h=0;h>BigInt(d)&BigInt(a));c[g]=c[g].add(r[h])}let f=e.ZERO;for(let h=c.length-1,p=e.ZERO;h>0;h--)p=p.add(c[h]),f=f.add(p);if(u=u.add(f),0!==d)for(let h=0;hPr||C>Pr;)b&We&&(S=S.add(P)),C&We&&(I=I.add(P)),P=P.double(),b>>=We,C>>=We;return w&&(S=S.negate()),D&&(I=I.negate()),I=new h(r.mul(I.px,v.beta),I.py,I.pz),S.add(I)}multiply(y){const{endo:_,n:v}=t;let w,b;if(jo("scalar",y,We,v),_){const{k1neg:D,k1:C,k2neg:S,k2:I}=_.splitScalar(y);let{p:P,f:H}=this.wNAF(C),{p:V,f:$}=this.wNAF(I);P=g.constTimeNegate(D,P),V=g.constTimeNegate(S,V),V=new h(r.mul(V.px,_.beta),V.py,V.pz),w=P.add(V),b=H.add($)}else{const{p:D,f:C}=this.wNAF(y);w=D,b=C}return h.normalizeZ([w,b])[0]}multiplyAndAddUnsafe(y,_,v){const w=h.BASE,b=(C,S)=>S!==Pr&&S!==We&&C.equals(w)?C.multiply(S):C.multiplyUnsafe(S),D=b(this,_).add(b(y,v));return D.is0()?void 0:D}toAffine(y){return d(this,y)}isTorsionFree(){const{h:y,isTorsionFree:_}=t;if(y===We)return!0;if(_)return _(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:y,clearCofactor:_}=t;return y===We?this:_?_(h,this):this.multiplyUnsafe(t.h)}toRawBytes(y=!0){return Rc("isCompressed",y),this.assertValidity(),s(h,this,y)}toHex(y=!0){return Rc("isCompressed",y),Oc(this.toRawBytes(y))}}h.BASE=new h(t.Gx,t.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);const p=t.nBitLength,g=function dne(e,t){const r=(o,a)=>{const c=a.negate();return o?c:a},i=o=>{if(!Number.isSafeInteger(o)||o<=0||o>t)throw new Error(`Wrong window size=${o}, should be [1..${t}]`)},s=o=>(i(o),{windows:Math.ceil(t/o)+1,windowSize:2**(o-1)});return{constTimeNegate:r,unsafeLadder(o,a){let c=e.ZERO,l=o;for(;a>une;)a&_E&&(c=c.add(l)),l=l.double(),a>>=_E;return c},precomputeWindow(o,a){const{windows:c,windowSize:l}=s(a),u=[];let d=o,f=d;for(let h=0;h>=g,_>u&&(_-=p,c+=_E);const v=y,w=y+Math.abs(_)-1,D=_<0;0===_?f=f.add(r(m%2!=0,a[v])):d=d.add(r(D,a[w]))}return{p:d,f}},wNAFCached(o,a,c){const l=bL.get(o)||1;let u=wE.get(o);return u||(u=this.precomputeWindow(o,l),1!==l&&wE.set(o,c(u))),this.wNAF(l,u,a)},setWindowSize(o,a){i(a),bL.set(o,a),wE.delete(o)}}}(h,t.endo?Math.ceil(p/2):p);return{CURVE:t,ProjectivePoint:h,normPrivateKeyToScalar:l,weierstrassEquation:a,isWithinCurveOrder:function c(m){return Sg(m,We,t.n)}}}({...t,toBytes(L,T,E){const x=T.toAffine(),R=r.toBytes(x.x),M=id;return Rc("isCompressed",E),E?M(Uint8Array.from([T.hasEvenY()?2:3]),R):M(Uint8Array.from([4]),R,r.toBytes(x.y))},fromBytes(L){const T=L.length,E=L[0],x=L.subarray(1);if(T!==s||2!==E&&3!==E){if(T===o&&4===E)return{x:r.fromBytes(x.subarray(0,r.BYTES)),y:r.fromBytes(x.subarray(r.BYTES,2*r.BYTES))};throw new Error(`Point of length ${T} was invalid. Expected ${s} compressed bytes or ${o} uncompressed bytes`)}{const R=Uo(x);if(!Sg(R,We,r.ORDER))throw new Error("Point is not on curve");const M=d(R);let W;try{W=r.sqrt(M)}catch(Se){const ue=Se instanceof Error?": "+Se.message:"";throw new Error("Point is not on curve"+ue)}return!(1&~E)!=((W&We)===We)&&(W=r.neg(W)),{x:R,y:W}}}}),h=L=>Oc(Lc(L,t.nByteLength));function p(L){return L>i>>We}const m=(L,T,E)=>Uo(L.slice(T,E));class y{constructor(T,E,x){this.r=T,this.s=E,this.recovery=x,this.assertValidity()}static fromCompact(T){const E=t.nByteLength;return T=kr("compactSignature",T,2*E),new y(m(T,0,E),m(T,E,2*E))}static fromDER(T){const{r:E,s:x}=Gi.toSig(kr("DER",T));return new y(E,x)}assertValidity(){jo("r",this.r,We,i),jo("s",this.s,We,i)}addRecoveryBit(T){return new y(this.r,this.s,T)}recoverPublicKey(T){const{r:E,s:x,recovery:R}=this,M=C(kr("msgHash",T));if(null==R||![0,1,2,3].includes(R))throw new Error("recovery id invalid");const W=2===R||3===R?E+t.n:E;if(W>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const ee=l.fromHex((1&R?"03":"02")+h(W)),Se=c(W),ue=a(-M*Se),yt=a(x*Se),ht=l.BASE.multiplyAndAddUnsafe(ee,ue,yt);if(!ht)throw new Error("point at infinify");return ht.assertValidity(),ht}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new y(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Pc(this.toDERHex())}toDERHex(){return Gi.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Pc(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const _={isValidPrivateKey(L){try{return u(L),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const L=wL(t.n);return function lne(e,t,r=!1){const i=e.length,s=_L(t),o=wL(t);if(i<16||i1024)throw new Error(`expected ${o}-1024 bytes of input, got ${i}`);const c=Xt(r?Uo(e):dE(e),t-Je)+Je;return r?fE(c,s):Lc(c,s)}(t.randomBytes(L),t.n)},precompute:(L=8,T=l.BASE)=>(T._setWindowSize(L),T.multiply(BigInt(3)),T)};function w(L){const T=Vo(L),E="string"==typeof L,x=(T||E)&&L.length;return T?x===s||x===o:E?x===2*s||x===2*o:L instanceof l}const D=t.bits2int||function(L){const T=Uo(L),E=8*L.length-t.nBitLength;return E>0?T>>BigInt(E):T},C=t.bits2int_modN||function(L){return a(D(L))},S=pE(t.nBitLength);function I(L){return jo(`num < 2^${t.nBitLength}`,L,Pr,S),Lc(L,t.nByteLength)}const H={lowS:t.lowS,prehash:!1},V={lowS:t.lowS,prehash:!1};return l.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function v(L,T=!0){return l.fromPrivateKey(L).toRawBytes(T)},getSharedSecret:function b(L,T,E=!0){if(w(L))throw new Error("first arg must be private key");if(!w(T))throw new Error("second arg must be public key");return l.fromHex(T).multiply(u(L)).toRawBytes(E)},sign:function $(L,T,E=H){const{seed:x,k2sig:R}=function P(L,T,E=H){if(["recovered","canonical"].some(ot=>ot in E))throw new Error("sign() legacy options not supported");const{hash:x,randomBytes:R}=t;let{lowS:M,prehash:W,extraEntropy:J}=E;null==M&&(M=!0),L=kr("msgHash",L),CL(E),W&&(L=kr("prehashed msgHash",x(L)));const ee=C(L),Se=u(T),ue=[I(Se),I(ee)];if(null!=J&&!1!==J){const ot=!0===J?R(r.BYTES):J;ue.push(kr("extraEntropy",ot))}const yt=id(...ue),ht=ee;return{seed:yt,k2sig:function Ae(ot){const Oe=D(ot);if(!f(Oe))return;const Pn=c(Oe),en=l.BASE.multiply(Oe).toAffine(),tn=a(en.x);if(tn===Pr)return;const Br=a(Pn*a(ht+tn*Se));if(Br===Pr)return;let Ko=(en.x===tn?0:2)|Number(en.y&We),Md=Br;return M&&p(Br)&&(Md=function g(L){return p(L)?a(-L):L}(Br),Ko^=1),new y(tn,Md,Ko)}}}(L,T,E);return gL(t.hash.outputLen,t.nByteLength,t.hmac)(x,R)},verify:function X(L,T,E,x=V){const R=L;if(T=kr("msgHash",T),E=kr("publicKey",E),"strict"in x)throw new Error("options.strict was renamed to lowS");CL(x);const{lowS:M,prehash:W}=x;let J,ee;try{if("string"==typeof R||Vo(R))try{J=y.fromDER(R)}catch(en){if(!(en instanceof Gi.Err))throw en;J=y.fromCompact(R)}else{if("object"!=typeof R||"bigint"!=typeof R.r||"bigint"!=typeof R.s)throw new Error("PARSE");{const{r:en,s:tn}=R;J=new y(en,tn)}}ee=l.fromHex(E)}catch(en){if("PARSE"===en.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(M&&J.hasHighS())return!1;W&&(T=t.hash(T));const{r:Se,s:ue}=J,yt=C(T),ht=c(ue),Ae=a(yt*ht),ot=a(Se*ht),Oe=l.BASE.multiplyAndAddUnsafe(ee,Ae,ot)?.toAffine();return!!Oe&&a(Oe.x)===Se},ProjectivePoint:l,Signature:y,utils:_}}function wne(e){return{hash:e,hmac:(t,...r)=>nd(e,t,function td(...e){let t=0;for(let i=0;i(e+t/Ag)/t;const bE=vL(od,void 0,void 0,{sqrt:function TL(e){const t=od,r=BigInt(3),i=BigInt(6),s=BigInt(11),o=BigInt(22),a=BigInt(23),c=BigInt(44),l=BigInt(88),u=e*e*e%t,d=u*u*e%t,f=hr(d,r,t)*d%t,h=hr(f,r,t)*d%t,p=hr(h,Ag,t)*u%t,g=hr(p,s,t)*p%t,m=hr(g,o,t)*g%t,y=hr(m,c,t)*m%t,_=hr(y,l,t)*y%t,v=hr(_,c,t)*m%t,w=hr(v,r,t)*d%t,b=hr(w,a,t)*g%t,D=hr(b,i,t)*u%t,C=hr(D,Ag,t);if(!bE.eql(bE.sqr(C),e))throw new Error("Cannot find square root");return C}});(function bne(e,t){const r=i=>vne({...e,...wne(i)});Object.freeze({...r(t),create:r})})({a:BigInt(0),b:BigInt(7),Fp:bE,n:xg,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=xg,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-ad*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=BigInt("0x100000000000000000000000000000000"),c=SL(o*e,t),l=SL(-i*e,t);let u=Xt(e-c*r-l*s,t),d=Xt(-c*i-l*o,t);const f=u>a,h=d>a;if(f&&(u=t-u),h&&(d=t-d),u>a||d>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:h,k2:d}}}},aE),BigInt(0);var KL,JL;rL("Bitcoin seed");class RE{#t;constructor(t){this.#t=t}getPublicKey(){var t=this;return U(function*(){return Ju(t.#t)})()}signEvent(t){var r=this;return U(function*(){return Rr(t,r.#t)})()}nip04={encrypt:(()=>{var r,t=this;return r=U(function*(i,s){return xb.encrypt(t.#t,i,s)}),function(s,o){return r.apply(this,arguments)}})(),decrypt:(()=>{var r,t=this;return r=U(function*(i,s){return xb.decrypt(t.#t,i,s)}),function(s,o){return r.apply(this,arguments)}})()};#i(t){return yg.v2.utils.getConversationKey(this.#t,t)}nip44={encrypt:(()=>{var r,t=this;return r=U(function*(i,s){const o=t.#i(i);return yg.v2.encrypt(s,o)}),function(s,o){return r.apply(this,arguments)}})(),decrypt:(()=>{var r,t=this;return r=U(function*(i,s){const o=t.#i(i);return yg.v2.decrypt(s,o)}),function(s,o){return r.apply(this,arguments)}})()}}function ZL(e,t){this.v=e,this.k=t}function js(e){return new ZL(e,0)}function Lg(e){return function(){return new fd(e.apply(this,arguments))}}function fd(e){var t,r;function i(o,a){try{var c=e[o](a),l=c.value,u=l instanceof ZL;Promise.resolve(u?l.v:l).then(function(d){if(u){var f="return"===o?"return":"next";if(!l.k||d.done)return i(f,d);d=e[f](d).value}s(c.done?"return":"normal",d)},function(d){i("throw",d)})}catch(d){s("throw",d)}}function s(o,a){switch(o){case"return":t.resolve({value:a,done:!0});break;case"throw":t.reject(a);break;default:t.resolve({value:a,done:!1})}(t=t.next)?i(t.key,t.arg):r=null}this._invoke=function(o,a){return new Promise(function(c,l){var u={key:o,arg:a,resolve:c,reject:l,next:null};r?r=r.next=u:(t=r=u,i(o,a))})},"function"!=typeof e.return&&(this.return=void 0)}new TextEncoder,(new TextEncoder).encode("0123456789abcdef"),new TextEncoder,new TextDecoder,fd.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},fd.prototype.next=function(e){return this._invoke("next",e)},fd.prototype.throw=function(e){return this._invoke("throw",e)},fd.prototype.return=function(e){return this._invoke("return",e)},KL=Symbol.asyncIterator;class QL{#t=[];#i;#f=!1;constructor(t){t?.aborted?this.abort():t?.addEventListener("abort",()=>this.abort(),{once:!0})}[KL](){var t=this;return Lg(function*(){for(;!t.#f;)t.#t.length?yield t.#t.shift():yield js(new Promise(r=>{t.#i=r}));throw new DOMException("The signal has been aborted","AbortError")})()}push(t){this.#t.push(t),this.#i?.()}abort(){this.#f=!0,this.#i?.()}}class YL{static regular(t){return 1e3<=t&&t<1e4||[1,2,4,5,6,7,8,16,40,41,42,43,44].includes(t)}static replaceable(t){return 1e4<=t&&t<2e4||[0,3].includes(t)}static ephemeral(t){return 2e4<=t&&t<3e4}static parameterizedReplaceable(t){return 3e4<=t&&t<4e4}}JL=Symbol.asyncDispose;class Zne{opts;_relays;constructor(t){this.opts=t,this._relays=new Map}relay(t){const r=this._relays.get(t);if(r)return r;{const i=this.opts.open(t);return this._relays.set(t,i),i}}get relays(){return this._relays}req(t,r){var i=this;return Lg(function*(){const s=new AbortController,o=r?.signal?AbortSignal.any([r.signal,s.signal]):s.signal,a=yield js(i.opts.reqRouter(t));if(a.size<1)return;const c=new QL(o),l=new Set,u=new Set;for(const[m,y]of a.entries()){const _=i.relay(m);U(function*(){var b,v=!1,w=!1;try{for(var C,D=Cs(_.req(y,{signal:o}));v=!(C=yield D.next()).done;v=!1){const S=C.value;"EOSE"===S[0]&&(l.add(m),l.size===a.size&&c.push(S)),"CLOSED"===S[0]&&(u.add(m),u.size===a.size&&c.push(S)),"EVENT"===S[0]&&c.push(S)}}catch(S){w=!0,b=S}finally{try{v&&null!=D.return&&(yield D.return())}finally{if(w)throw b}}})().catch(()=>{})}try{var h,d=!1,f=!1;try{for(var g,p=Cs(c);d=!(g=yield js(p.next())).done;d=!1)yield g.value}catch(m){f=!0,h=m}finally{try{d&&null!=p.return&&(yield js(p.return()))}finally{if(f)throw h}}}finally{s.abort()}})()}event(t,r){var i=this;return U(function*(){const s=yield i.opts.eventRouter(t);s.length<1||(yield Promise.any(s.map(o=>i.relay(o).event(t,r))))})()}query(t,r){var i=this;return U(function*(){const s=new fr,o=t.reduce((h,p)=>h+fP(p),0);if(0===o)return[];const a=t.reduce((h,p)=>h||!!p.kinds?.some(g=>YL.replaceable(g)||YL.parameterizedReplaceable(g)),!1);try{var u,c=!1,l=!1;try{for(var f,d=Cs(i.req(t,r));c=!(f=yield d.next()).done;c=!1){const h=f.value;if("EOSE"===h[0])break;if("EVENT"===h[0]&&s.add(h[2]),"CLOSED"===h[0])throw new Error("Subscription closed");if(!a&&s.size>=o)break}}catch(h){l=!0,u=h}finally{try{c&&null!=d.return&&(yield d.return())}finally{if(l)throw u}}}catch{}return[...s]})()}close(){var t=this;return U(function*(){yield Promise.all([...t._relays.values()].map(r=>r.close()))})()}[JL](){var t=this;return U(function*(){yield t.close()})()}}class Kne{constructor(t,r){if(this._retries=0,!Number.isInteger(t)||t<0)throw new Error("Base must be a positive integer or zero");if(void 0!==r&&(!Number.isInteger(r)||r<0))throw new Error("ExpMax must be a undefined, a positive integer or zero");this.base=t,this.expMax=r,this.i=0}get retries(){return this._retries}get current(){return this.base*Math.pow(2,this.i)}next(){return this._retries++,this.i=void 0===this.expMax?this.i+1:Math.min(this.i+1,this.expMax),this.current}reset(){this._retries=0,this.i=0}}var Re,Xe=function(e){return e.open="open",e.close="close",e.error="error",e.message="message",e.retry="retry",e.reconnect="reconnect",e}(Xe||{});class Qne{constructor(t,r,i){var s,o,a,c,l,u,d,f,h,p,g,m,y,_,v;this._closedByUser=!1,this.handleOpenEvent=w=>this.handleEvent(Xe.open,w),this.handleErrorEvent=w=>this.handleEvent(Xe.error,w),this.handleCloseEvent=w=>this.handleEvent(Xe.close,w),this.handleMessageEvent=w=>this.handleEvent(Xe.message,w),this._url=t,this._protocols=r,this._options={buffer:i?.buffer,retry:{maxRetries:null===(s=i?.retry)||void 0===s?void 0:s.maxRetries,instantReconnect:null===(o=i?.retry)||void 0===o?void 0:o.instantReconnect,backoff:null===(a=i?.retry)||void 0===a?void 0:a.backoff},listeners:{open:[...null!==(l=null===(c=i?.listeners)||void 0===c?void 0:c.open)&&void 0!==l?l:[]],close:[...null!==(d=null===(u=i?.listeners)||void 0===u?void 0:u.close)&&void 0!==d?d:[]],error:[...null!==(h=null===(f=i?.listeners)||void 0===f?void 0:f.error)&&void 0!==h?h:[]],message:[...null!==(g=null===(p=i?.listeners)||void 0===p?void 0:p.message)&&void 0!==g?g:[]],retry:[...null!==(y=null===(m=i?.listeners)||void 0===m?void 0:m.retry)&&void 0!==y?y:[]],reconnect:[...null!==(v=null===(_=i?.listeners)||void 0===_?void 0:_.reconnect)&&void 0!==v?v:[]]}},this._underlyingWebsocket=this.tryConnect()}get url(){return this._url}get protocols(){return this._protocols}get buffer(){return this._options.buffer}get maxRetries(){return this._options.retry.maxRetries}get instantReconnect(){return this._options.retry.instantReconnect}get backoff(){return this._options.retry.backoff}get closedByUser(){return this._closedByUser}get lastConnection(){return this._lastConnection}get underlyingWebsocket(){return this._underlyingWebsocket}get readyState(){return this._underlyingWebsocket.readyState}get bufferedAmount(){return this._underlyingWebsocket.bufferedAmount}get extensions(){return this._underlyingWebsocket.extensions}get binaryType(){return this._underlyingWebsocket.binaryType}set binaryType(t){this._underlyingWebsocket.binaryType=t}send(t){this.closedByUser||(this._underlyingWebsocket.readyState===this._underlyingWebsocket.OPEN?this._underlyingWebsocket.send(t):void 0!==this.buffer&&this.buffer.add(t))}close(t,r){this.cancelScheduledConnectionRetry(),this._closedByUser=!0,this._underlyingWebsocket.close(t,r)}addEventListener(t,r,i){this._options.listeners[t].push({listener:r,options:i})}removeEventListener(t,r,i){this._options.listeners[t]=this._options.listeners[t].filter(o=>o.listener!==r||o.options!==i)}tryConnect(){return this._underlyingWebsocket=new WebSocket(this.url,this.protocols),this._underlyingWebsocket.addEventListener(Xe.open,this.handleOpenEvent),this._underlyingWebsocket.addEventListener(Xe.close,this.handleCloseEvent),this._underlyingWebsocket.addEventListener(Xe.error,this.handleErrorEvent),this._underlyingWebsocket.addEventListener(Xe.message,this.handleMessageEvent),this._underlyingWebsocket}clearWebsocket(){this._underlyingWebsocket.removeEventListener(Xe.open,this.handleOpenEvent),this._underlyingWebsocket.removeEventListener(Xe.close,this.handleCloseEvent),this._underlyingWebsocket.removeEventListener(Xe.error,this.handleErrorEvent),this._underlyingWebsocket.removeEventListener(Xe.message,this.handleMessageEvent),this._underlyingWebsocket.close()}dispatchEvent(t,r){const s=[];this._options.listeners[t].forEach(({listener:o,options:a})=>{o(this,r),(void 0===a||void 0===a.once||!a.once)&&s.push({listener:o,options:a})}),this._options.listeners[t]=s}handleEvent(t,r){switch(t){case Xe.close:this.dispatchEvent(t,r),this.scheduleConnectionRetryIfNeeded();break;case Xe.open:if(void 0!==this.backoff&&void 0!==this._lastConnection){const i={retries:this.backoff.retries,lastConnection:new Date(this._lastConnection)},s=new CustomEvent(Xe.reconnect,{detail:i});this.dispatchEvent(Xe.reconnect,s),this.backoff.reset()}this._lastConnection=new Date,this.dispatchEvent(t,r),this.sendBufferedData();break;case Xe.retry:this.dispatchEvent(t,r),this.clearWebsocket(),this.tryConnect();break;default:this.dispatchEvent(t,r)}}sendBufferedData(){if(void 0!==this.buffer)for(let t=this.buffer.read();void 0!==t;t=this.buffer.read())this.send(t)}scheduleConnectionRetryIfNeeded(){if(this.closedByUser||void 0===this.backoff)return;const t=i=>{const s=new CustomEvent(Xe.retry,{detail:i});this.handleEvent(Xe.retry,s)},r={backoff:!0===this._options.retry.instantReconnect?0:this.backoff.next(),retries:!0===this._options.retry.instantReconnect?0:this.backoff.retries,lastConnection:this._lastConnection};(void 0===this._options.retry.maxRetries||r.retries<=this._options.retry.maxRetries)&&(this.retryTimeout=globalThis.setTimeout(()=>t(r),r.backoff))}cancelScheduledConnectionRetry(){globalThis.clearTimeout(this.retryTimeout)}}class Yne{constructor(t){this._url=t}get url(){return this._url}withProtocols(t){return this._protocols=t,this}get protocols(){return this._protocols}withMaxRetries(t){var r;return this._options=Object.assign(Object.assign({},this._options),{retry:Object.assign(Object.assign({},null===(r=this._options)||void 0===r?void 0:r.retry),{maxRetries:t})}),this}get maxRetries(){var t,r;return null===(r=null===(t=this._options)||void 0===t?void 0:t.retry)||void 0===r?void 0:r.maxRetries}withInstantReconnect(t){var r;return this._options=Object.assign(Object.assign({},this._options),{retry:Object.assign(Object.assign({},null===(r=this._options)||void 0===r?void 0:r.retry),{instantReconnect:t})}),this}get instantReconnect(){var t,r;return null===(r=null===(t=this._options)||void 0===t?void 0:t.retry)||void 0===r?void 0:r.instantReconnect}withBackoff(t){var r;return this._options=Object.assign(Object.assign({},this._options),{retry:Object.assign(Object.assign({},null===(r=this._options)||void 0===r?void 0:r.retry),{backoff:t})}),this}get backoff(){var t,r;return null===(r=null===(t=this._options)||void 0===t?void 0:t.retry)||void 0===r?void 0:r.backoff}withBuffer(t){return this._options=Object.assign(Object.assign({},this._options),{buffer:t}),this}get buffer(){var t;return null===(t=this._options)||void 0===t?void 0:t.buffer}onOpen(t,r){return this.addListener(Xe.open,t,r),this}onClose(t,r){return this.addListener(Xe.close,t,r),this}onError(t,r){return this.addListener(Xe.error,t,r),this}onMessage(t,r){return this.addListener(Xe.message,t,r),this}onRetry(t,r){return this.addListener(Xe.retry,t,r),this}onReconnect(t,r){return this.addListener(Xe.reconnect,t,r),this}build(){return new Qne(this._url,this._protocols,this._options)}addListener(t,r,i){var s,o,a,c,l,u,d,f,h,p,g,m,y,_,v,w,b,D,C,S,I;return this._options=Object.assign(Object.assign({},this._options),{listeners:{open:null!==(a=null===(o=null===(s=this._options)||void 0===s?void 0:s.listeners)||void 0===o?void 0:o.open)&&void 0!==a?a:[],close:null!==(u=null===(l=null===(c=this._options)||void 0===c?void 0:c.listeners)||void 0===l?void 0:l.close)&&void 0!==u?u:[],error:null!==(h=null===(f=null===(d=this._options)||void 0===d?void 0:d.listeners)||void 0===f?void 0:f.error)&&void 0!==h?h:[],message:null!==(m=null===(g=null===(p=this._options)||void 0===p?void 0:p.listeners)||void 0===g?void 0:g.message)&&void 0!==m?m:[],retry:null!==(v=null===(_=null===(y=this._options)||void 0===y?void 0:y.listeners)||void 0===_?void 0:_.retry)&&void 0!==v?v:[],reconnect:null!==(D=null===(b=null===(w=this._options)||void 0===w?void 0:w.listeners)||void 0===b?void 0:b.reconnect)&&void 0!==D?D:[],[t]:[...null!==(I=null===(S=null===(C=this._options)||void 0===C?void 0:C.listeners)||void 0===S?void 0:S[t])&&void 0!==I?I:[],{listener:r,options:i}]}}),this}}class Jne{constructor(){this.elements=[]}add(t){this.elements.push(t)}clear(){this.elements.length=0}forEach(t){this.elements.forEach(t)}length(){return this.elements.length}isEmpty(){return 0===this.elements.length}peek(){return this.elements[0]}read(){return this.elements.shift()}}!function(e){e.assertEqual=s=>s,e.assertIs=function t(s){},e.assertNever=function r(s){throw new Error},e.arrayToEnum=s=>{const o={};for(const a of s)o[a]=a;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(c=>"number"!=typeof s[s[c]]),a={};for(const c of o)a[c]=s[c];return e.objectValues(a)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys="function"==typeof Object.keys?s=>Object.keys(s):s=>{const o=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&o.push(a);return o},e.find=(s,o)=>{for(const a of s)if(o(a))return a},e.isInteger="function"==typeof Number.isInteger?s=>Number.isInteger(s):s=>"number"==typeof s&&isFinite(s)&&Math.floor(s)===s,e.joinValues=function i(s,o=" | "){return s.map(a=>"string"==typeof a?`'${a}'`:a).join(o)},e.jsonStringifyReplacer=(s,o)=>"bigint"==typeof o?o.toString():o}(Re||(Re={}));var XL=function(e){return e.mergeShapes=(t,r)=>({...t,...r}),e}(XL||{});const K=Re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$s=e=>{switch(typeof e){case"undefined":return K.undefined;case"string":return K.string;case"number":return isNaN(e)?K.nan:K.number;case"boolean":return K.boolean;case"function":return K.function;case"bigint":return K.bigint;case"symbol":return K.symbol;case"object":return Array.isArray(e)?K.array:null===e?K.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?K.promise:typeof Map<"u"&&e instanceof Map?K.map:typeof Set<"u"&&e instanceof Set?K.set:typeof Date<"u"&&e instanceof Date?K.date:K.object;default:return K.unknown}},B=Re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);let Zi=(()=>{class e extends Error{constructor(r){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const i=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,i):this.__proto__=i,this.name="ZodError",this.issues=r}get errors(){return this.issues}format(r){const i=r||function(a){return a.message},s={_errors:[]},o=a=>{for(const c of a.issues)if("invalid_union"===c.code)c.unionErrors.map(o);else if("invalid_return_type"===c.code)o(c.returnTypeError);else if("invalid_arguments"===c.code)o(c.argumentsError);else if(0===c.path.length)s._errors.push(i(c));else{let l=s,u=0;for(;ui.message){const i={},s=[];for(const o of this.issues)o.path.length>0?(i[o.path[0]]=i[o.path[0]]||[],i[o.path[0]].push(r(o))):s.push(r(o));return{formErrors:s,fieldErrors:i}}get formErrors(){return this.flatten()}}return e.create=t=>new e(t),e})();const Bc=(e,t)=>{let r;switch(e.code){case B.invalid_type:r=e.received===K.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case B.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Re.jsonStringifyReplacer)}`;break;case B.unrecognized_keys:r=`Unrecognized key(s) in object: ${Re.joinValues(e.keys,", ")}`;break;case B.invalid_union:r="Invalid input";break;case B.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Re.joinValues(e.options)}`;break;case B.invalid_enum_value:r=`Invalid enum value. Expected ${Re.joinValues(e.options)}, received '${e.received}'`;break;case B.invalid_arguments:r="Invalid function arguments";break;case B.invalid_return_type:r="Invalid function return type";break;case B.invalid_date:r="Invalid date";break;case B.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Re.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case B.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case B.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case B.custom:r="Invalid input";break;case B.invalid_intersection_types:r="Intersection results could not be merged";break;case B.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case B.not_finite:r="Number must be finite";break;default:r=t.defaultError,Re.assertNever(e)}return{message:r}};let eF=Bc;function Fg(){return eF}const Bg=e=>{const{data:t,path:r,errorMaps:i,issueData:s}=e,o=[...r,...s.path||[]],a={...s,path:o};if(void 0!==s.message)return{...s,path:o,message:s.message};let c="";const l=i.filter(u=>!!u).slice().reverse();for(const u of l)c=u(a,{data:t,defaultError:c}).message;return{...s,path:o,message:c}};function Z(e,t){const r=Fg(),i=Bg({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Bc?void 0:Bc].filter(s=>!!s)});e.common.issues.push(i)}class dn{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(t,r){const i=[];for(const s of r){if("aborted"===s.status)return ae;"dirty"===s.status&&t.dirty(),i.push(s.value)}return{status:t.value,value:i}}static mergeObjectAsync(t,r){return U(function*(){const i=[];for(const s of r){const o=yield s.key,a=yield s.value;i.push({key:o,value:a})}return dn.mergeObjectSync(t,i)})()}static mergeObjectSync(t,r){const i={};for(const s of r){const{key:o,value:a}=s;if("aborted"===o.status||"aborted"===a.status)return ae;"dirty"===o.status&&t.dirty(),"dirty"===a.status&&t.dirty(),"__proto__"!==o.value&&(typeof a.value<"u"||s.alwaysSet)&&(i[o.value]=a.value)}return{status:t.value,value:i}}}const ae=Object.freeze({status:"aborted"}),Vc=e=>({status:"dirty",value:e}),Dn=e=>({status:"valid",value:e}),LE=e=>"aborted"===e.status,FE=e=>"dirty"===e.status,hd=e=>"valid"===e.status,pd=e=>typeof Promise<"u"&&e instanceof Promise;function Vg(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}function tF(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r}"function"==typeof SuppressedError&&SuppressedError;var gd,md,te=function(e){return e.errToObj=t=>"string"==typeof t?{message:t}:t||{},e.toString=t=>"string"==typeof t?t:t?.message,e}(te||{});class vi{constructor(t,r,i,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=i,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const nF=(e,t)=>{if(hd(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Zi(e.common.issues);return this._error=r,this._error}}};function ye(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:i,description:s}=e;if(t&&(r||i))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:s}:{errorMap:(a,c)=>{var l,u;const{message:d}=e;return"invalid_enum_value"===a.code?{message:d??c.defaultError}:typeof c.data>"u"?{message:null!==(l=d??i)&&void 0!==l?l:c.defaultError}:"invalid_type"!==a.code?{message:c.defaultError}:{message:null!==(u=d??r)&&void 0!==u?u:c.defaultError}},description:s}}class Ce{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return $s(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:$s(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new dn,ctx:{common:t.parent.common,data:t.data,parsedType:$s(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(pd(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const i=this.safeParse(t,r);if(i.success)return i.data;throw i.error}safeParse(t,r){var i;const s={common:{issues:[],async:null!==(i=r?.async)&&void 0!==i&&i,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:$s(t)},o=this._parseSync({data:t,path:s.path,parent:s});return nF(s,o)}parseAsync(t,r){var i=this;return U(function*(){const s=yield i.safeParseAsync(t,r);if(s.success)return s.data;throw s.error})()}safeParseAsync(t,r){var i=this;return U(function*(){const s={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:i._def.errorMap,parent:null,data:t,parsedType:$s(t)},o=i._parse({data:t,path:s.path,parent:s}),a=yield pd(o)?o:Promise.resolve(o);return nF(s,a)})()}refine(t,r){const i=s=>"string"==typeof r||typeof r>"u"?{message:r}:"function"==typeof r?r(s):r;return this._refinement((s,o)=>{const a=t(s),c=()=>o.addIssue({code:B.custom,...i(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>!!l||(c(),!1)):!!a||(c(),!1)})}refinement(t,r){return this._refinement((i,s)=>!!t(i)||(s.addIssue("function"==typeof r?r(i,s):r),!1))}_refinement(t){return new qo({schema:this,typeName:ce.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return zs.create(this,this._def)}nullable(){return zc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return vd.create(this,this._def)}promise(){return Hg.create(this,this._def)}or(t){return qE.create([this,t],this._def)}and(t){return WE.create(this,t,this._def)}transform(t){return new qo({...ye(this._def),schema:this,typeName:ce.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r="function"==typeof t?t:()=>t;return new QE({...ye(this._def),innerType:this,defaultValue:r,typeName:ce.ZodDefault})}brand(){return new JE({typeName:ce.ZodBranded,type:this,...ye(this._def)})}catch(t){const r="function"==typeof t?t:()=>t;return new YE({...ye(this._def),innerType:this,catchValue:r,typeName:ce.ZodCatch})}describe(t){return new(0,this.constructor)({...this._def,description:t})}pipe(t){return bd.create(this,t)}readonly(){return XE.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const nre=/^c[^\s-]{8,}$/i,rre=/^[0-9a-z]+$/,ire=/^[0-9A-HJKMNP-TV-Z]{26}$/,sre=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ore=/^[a-z0-9_-]{21}$/i,are=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,cre=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let BE;const ure=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,dre=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,fre=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,rF="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",hre=new RegExp(`^${rF}$`);function iF(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function pre(e){return new RegExp(`^${iF(e)}$`)}function sF(e){let t=`${rF}T${iF(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function gre(e,t){return!(("v4"!==t&&t||!ure.test(e))&&("v6"!==t&&t||!dre.test(e)))}let Ug=(()=>{class e extends Ce{_parse(r){if(this._def.coerce&&(r.data=String(r.data)),this._getType(r)!==K.string){const a=this._getOrReturnCtx(r);return Z(a,{code:B.invalid_type,expected:K.string,received:a.parsedType}),ae}const s=new dn;let o;for(const a of this._def.checks)if("min"===a.kind)r.data.lengtha.value&&(o=this._getOrReturnCtx(r,o),Z(o,{code:B.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if("length"===a.kind){const c=r.data.length>a.value,l=r.data.lengthr.test(o),{validation:i,code:B.invalid_string,...te.errToObj(s)})}_addCheck(r){return new e({...this._def,checks:[...this._def.checks,r]})}email(r){return this._addCheck({kind:"email",...te.errToObj(r)})}url(r){return this._addCheck({kind:"url",...te.errToObj(r)})}emoji(r){return this._addCheck({kind:"emoji",...te.errToObj(r)})}uuid(r){return this._addCheck({kind:"uuid",...te.errToObj(r)})}nanoid(r){return this._addCheck({kind:"nanoid",...te.errToObj(r)})}cuid(r){return this._addCheck({kind:"cuid",...te.errToObj(r)})}cuid2(r){return this._addCheck({kind:"cuid2",...te.errToObj(r)})}ulid(r){return this._addCheck({kind:"ulid",...te.errToObj(r)})}base64(r){return this._addCheck({kind:"base64",...te.errToObj(r)})}ip(r){return this._addCheck({kind:"ip",...te.errToObj(r)})}datetime(r){var i,s;return this._addCheck("string"==typeof r?{kind:"datetime",precision:null,offset:!1,local:!1,message:r}:{kind:"datetime",precision:typeof r?.precision>"u"?null:r?.precision,offset:null!==(i=r?.offset)&&void 0!==i&&i,local:null!==(s=r?.local)&&void 0!==s&&s,...te.errToObj(r?.message)})}date(r){return this._addCheck({kind:"date",message:r})}time(r){return this._addCheck("string"==typeof r?{kind:"time",precision:null,message:r}:{kind:"time",precision:typeof r?.precision>"u"?null:r?.precision,...te.errToObj(r?.message)})}duration(r){return this._addCheck({kind:"duration",...te.errToObj(r)})}regex(r,i){return this._addCheck({kind:"regex",regex:r,...te.errToObj(i)})}includes(r,i){return this._addCheck({kind:"includes",value:r,position:i?.position,...te.errToObj(i?.message)})}startsWith(r,i){return this._addCheck({kind:"startsWith",value:r,...te.errToObj(i)})}endsWith(r,i){return this._addCheck({kind:"endsWith",value:r,...te.errToObj(i)})}min(r,i){return this._addCheck({kind:"min",value:r,...te.errToObj(i)})}max(r,i){return this._addCheck({kind:"max",value:r,...te.errToObj(i)})}length(r,i){return this._addCheck({kind:"length",value:r,...te.errToObj(i)})}nonempty(r){return this.min(1,te.errToObj(r))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(r=>"datetime"===r.kind)}get isDate(){return!!this._def.checks.find(r=>"date"===r.kind)}get isTime(){return!!this._def.checks.find(r=>"time"===r.kind)}get isDuration(){return!!this._def.checks.find(r=>"duration"===r.kind)}get isEmail(){return!!this._def.checks.find(r=>"email"===r.kind)}get isURL(){return!!this._def.checks.find(r=>"url"===r.kind)}get isEmoji(){return!!this._def.checks.find(r=>"emoji"===r.kind)}get isUUID(){return!!this._def.checks.find(r=>"uuid"===r.kind)}get isNANOID(){return!!this._def.checks.find(r=>"nanoid"===r.kind)}get isCUID(){return!!this._def.checks.find(r=>"cuid"===r.kind)}get isCUID2(){return!!this._def.checks.find(r=>"cuid2"===r.kind)}get isULID(){return!!this._def.checks.find(r=>"ulid"===r.kind)}get isIP(){return!!this._def.checks.find(r=>"ip"===r.kind)}get isBase64(){return!!this._def.checks.find(r=>"base64"===r.kind)}get minLength(){let r=null;for(const i of this._def.checks)"min"===i.kind&&(null===r||i.value>r)&&(r=i.value);return r}get maxLength(){let r=null;for(const i of this._def.checks)"max"===i.kind&&(null===r||i.value{var r;return new e({checks:[],typeName:ce.ZodString,coerce:null!==(r=t?.coerce)&&void 0!==r&&r,...ye(t)})},e})();function mre(e,t){const r=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,s=r>i?r:i;return parseInt(e.toFixed(s).replace(".",""))%parseInt(t.toFixed(s).replace(".",""))/Math.pow(10,s)}let VE=(()=>{class e extends Ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(r){if(this._def.coerce&&(r.data=Number(r.data)),this._getType(r)!==K.number){const a=this._getOrReturnCtx(r);return Z(a,{code:B.invalid_type,expected:K.number,received:a.parsedType}),ae}let s;const o=new dn;for(const a of this._def.checks)"int"===a.kind?Re.isInteger(r.data)||(s=this._getOrReturnCtx(r,s),Z(s,{code:B.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()):"min"===a.kind?(a.inclusive?r.dataa.value:r.data>=a.value)&&(s=this._getOrReturnCtx(r,s),Z(s,{code:B.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):"multipleOf"===a.kind?0!==mre(r.data,a.value)&&(s=this._getOrReturnCtx(r,s),Z(s,{code:B.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):"finite"===a.kind?Number.isFinite(r.data)||(s=this._getOrReturnCtx(r,s),Z(s,{code:B.not_finite,message:a.message}),o.dirty()):Re.assertNever(a);return{status:o.value,value:r.data}}gte(r,i){return this.setLimit("min",r,!0,te.toString(i))}gt(r,i){return this.setLimit("min",r,!1,te.toString(i))}lte(r,i){return this.setLimit("max",r,!0,te.toString(i))}lt(r,i){return this.setLimit("max",r,!1,te.toString(i))}setLimit(r,i,s,o){return new e({...this._def,checks:[...this._def.checks,{kind:r,value:i,inclusive:s,message:te.toString(o)}]})}_addCheck(r){return new e({...this._def,checks:[...this._def.checks,r]})}int(r){return this._addCheck({kind:"int",message:te.toString(r)})}positive(r){return this._addCheck({kind:"min",value:0,inclusive:!1,message:te.toString(r)})}negative(r){return this._addCheck({kind:"max",value:0,inclusive:!1,message:te.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:0,inclusive:!0,message:te.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:0,inclusive:!0,message:te.toString(r)})}multipleOf(r,i){return this._addCheck({kind:"multipleOf",value:r,message:te.toString(i)})}finite(r){return this._addCheck({kind:"finite",message:te.toString(r)})}safe(r){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:te.toString(r)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:te.toString(r)})}get minValue(){let r=null;for(const i of this._def.checks)"min"===i.kind&&(null===r||i.value>r)&&(r=i.value);return r}get maxValue(){let r=null;for(const i of this._def.checks)"max"===i.kind&&(null===r||i.value"int"===r.kind||"multipleOf"===r.kind&&Re.isInteger(r.value))}get isFinite(){let r=null,i=null;for(const s of this._def.checks){if("finite"===s.kind||"int"===s.kind||"multipleOf"===s.kind)return!0;"min"===s.kind?(null===i||s.value>i)&&(i=s.value):"max"===s.kind&&(null===r||s.valuenew e({checks:[],typeName:ce.ZodNumber,coerce:t?.coerce||!1,...ye(t)}),e})(),UE=(()=>{class e extends Ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(r){if(this._def.coerce&&(r.data=BigInt(r.data)),this._getType(r)!==K.bigint){const a=this._getOrReturnCtx(r);return Z(a,{code:B.invalid_type,expected:K.bigint,received:a.parsedType}),ae}let s;const o=new dn;for(const a of this._def.checks)"min"===a.kind?(a.inclusive?r.dataa.value:r.data>=a.value)&&(s=this._getOrReturnCtx(r,s),Z(s,{code:B.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):"multipleOf"===a.kind?r.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(r,s),Z(s,{code:B.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):Re.assertNever(a);return{status:o.value,value:r.data}}gte(r,i){return this.setLimit("min",r,!0,te.toString(i))}gt(r,i){return this.setLimit("min",r,!1,te.toString(i))}lte(r,i){return this.setLimit("max",r,!0,te.toString(i))}lt(r,i){return this.setLimit("max",r,!1,te.toString(i))}setLimit(r,i,s,o){return new e({...this._def,checks:[...this._def.checks,{kind:r,value:i,inclusive:s,message:te.toString(o)}]})}_addCheck(r){return new e({...this._def,checks:[...this._def.checks,r]})}positive(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:te.toString(r)})}negative(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:te.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:te.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:te.toString(r)})}multipleOf(r,i){return this._addCheck({kind:"multipleOf",value:r,message:te.toString(i)})}get minValue(){let r=null;for(const i of this._def.checks)"min"===i.kind&&(null===r||i.value>r)&&(r=i.value);return r}get maxValue(){let r=null;for(const i of this._def.checks)"max"===i.kind&&(null===r||i.value{var r;return new e({checks:[],typeName:ce.ZodBigInt,coerce:null!==(r=t?.coerce)&&void 0!==r&&r,...ye(t)})},e})(),jE=(()=>{class e extends Ce{_parse(r){if(this._def.coerce&&(r.data=!!r.data),this._getType(r)!==K.boolean){const s=this._getOrReturnCtx(r);return Z(s,{code:B.invalid_type,expected:K.boolean,received:s.parsedType}),ae}return Dn(r.data)}}return e.create=t=>new e({typeName:ce.ZodBoolean,coerce:t?.coerce||!1,...ye(t)}),e})(),$E=(()=>{class e extends Ce{_parse(r){if(this._def.coerce&&(r.data=new Date(r.data)),this._getType(r)!==K.date){const a=this._getOrReturnCtx(r);return Z(a,{code:B.invalid_type,expected:K.date,received:a.parsedType}),ae}if(isNaN(r.data.getTime()))return Z(this._getOrReturnCtx(r),{code:B.invalid_date}),ae;const s=new dn;let o;for(const a of this._def.checks)"min"===a.kind?r.data.getTime()a.value&&(o=this._getOrReturnCtx(r,o),Z(o,{code:B.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):Re.assertNever(a);return{status:s.value,value:new Date(r.data.getTime())}}_addCheck(r){return new e({...this._def,checks:[...this._def.checks,r]})}min(r,i){return this._addCheck({kind:"min",value:r.getTime(),message:te.toString(i)})}max(r,i){return this._addCheck({kind:"max",value:r.getTime(),message:te.toString(i)})}get minDate(){let r=null;for(const i of this._def.checks)"min"===i.kind&&(null===r||i.value>r)&&(r=i.value);return null!=r?new Date(r):null}get maxDate(){let r=null;for(const i of this._def.checks)"max"===i.kind&&(null===r||i.valuenew e({checks:[],coerce:t?.coerce||!1,typeName:ce.ZodDate,...ye(t)}),e})(),oF=(()=>{class e extends Ce{_parse(r){if(this._getType(r)!==K.symbol){const s=this._getOrReturnCtx(r);return Z(s,{code:B.invalid_type,expected:K.symbol,received:s.parsedType}),ae}return Dn(r.data)}}return e.create=t=>new e({typeName:ce.ZodSymbol,...ye(t)}),e})(),HE=(()=>{class e extends Ce{_parse(r){if(this._getType(r)!==K.undefined){const s=this._getOrReturnCtx(r);return Z(s,{code:B.invalid_type,expected:K.undefined,received:s.parsedType}),ae}return Dn(r.data)}}return e.create=t=>new e({typeName:ce.ZodUndefined,...ye(t)}),e})(),zE=(()=>{class e extends Ce{_parse(r){if(this._getType(r)!==K.null){const s=this._getOrReturnCtx(r);return Z(s,{code:B.invalid_type,expected:K.null,received:s.parsedType}),ae}return Dn(r.data)}}return e.create=t=>new e({typeName:ce.ZodNull,...ye(t)}),e})(),jg=(()=>{class e extends Ce{constructor(){super(...arguments),this._any=!0}_parse(r){return Dn(r.data)}}return e.create=t=>new e({typeName:ce.ZodAny,...ye(t)}),e})(),yd=(()=>{class e extends Ce{constructor(){super(...arguments),this._unknown=!0}_parse(r){return Dn(r.data)}}return e.create=t=>new e({typeName:ce.ZodUnknown,...ye(t)}),e})(),zo=(()=>{class e extends Ce{_parse(r){const i=this._getOrReturnCtx(r);return Z(i,{code:B.invalid_type,expected:K.never,received:i.parsedType}),ae}}return e.create=t=>new e({typeName:ce.ZodNever,...ye(t)}),e})(),aF=(()=>{class e extends Ce{_parse(r){if(this._getType(r)!==K.undefined){const s=this._getOrReturnCtx(r);return Z(s,{code:B.invalid_type,expected:K.void,received:s.parsedType}),ae}return Dn(r.data)}}return e.create=t=>new e({typeName:ce.ZodVoid,...ye(t)}),e})(),vd=(()=>{class e extends Ce{_parse(r){const{ctx:i,status:s}=this._processInputParams(r),o=this._def;if(i.parsedType!==K.array)return Z(i,{code:B.invalid_type,expected:K.array,received:i.parsedType}),ae;if(null!==o.exactLength){const c=i.data.length>o.exactLength.value,l=i.data.lengtho.maxLength.value&&(Z(i,{code:B.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),s.dirty()),i.common.async)return Promise.all([...i.data].map((c,l)=>o.type._parseAsync(new vi(i,c,i.path,l)))).then(c=>dn.mergeArray(s,c));const a=[...i.data].map((c,l)=>o.type._parseSync(new vi(i,c,i.path,l)));return dn.mergeArray(s,a)}get element(){return this._def.type}min(r,i){return new e({...this._def,minLength:{value:r,message:te.toString(i)}})}max(r,i){return new e({...this._def,maxLength:{value:r,message:te.toString(i)}})}length(r,i){return new e({...this._def,exactLength:{value:r,message:te.toString(i)}})}nonempty(r){return this.min(1,r)}}return e.create=(t,r)=>new e({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ce.ZodArray,...ye(r)}),e})();function Uc(e){if(e instanceof jc){const t={};for(const r in e.shape)t[r]=zs.create(Uc(e.shape[r]));return new jc({...e._def,shape:()=>t})}return e instanceof vd?new vd({...e._def,type:Uc(e.element)}):e instanceof zs?zs.create(Uc(e.unwrap())):e instanceof zc?zc.create(Uc(e.unwrap())):e instanceof $c?$c.create(e.items.map(t=>Uc(t))):e}let jc=(()=>{class e extends Ce{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const r=this._def.shape(),i=Re.objectKeys(r);return this._cached={shape:r,keys:i}}_parse(r){if(this._getType(r)!==K.object){const d=this._getOrReturnCtx(r);return Z(d,{code:B.invalid_type,expected:K.object,received:d.parsedType}),ae}const{status:s,ctx:o}=this._processInputParams(r),{shape:a,keys:c}=this._getCached(),l=[];if(!(this._def.catchall instanceof zo&&"strip"===this._def.unknownKeys))for(const d in o.data)c.includes(d)||l.push(d);const u=[];for(const d of c)u.push({key:{status:"valid",value:d},value:a[d]._parse(new vi(o,o.data[d],o.path,d)),alwaysSet:d in o.data});if(this._def.catchall instanceof zo){const d=this._def.unknownKeys;if("passthrough"===d)for(const f of l)u.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if("strict"===d)l.length>0&&(Z(o,{code:B.unrecognized_keys,keys:l}),s.dirty());else if("strip"!==d)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const f of l)u.push({key:{status:"valid",value:f},value:d._parse(new vi(o,o.data[f],o.path,f)),alwaysSet:f in o.data})}return o.common.async?Promise.resolve().then(U(function*(){const d=[];for(const f of u){const h=yield f.key,p=yield f.value;d.push({key:h,value:p,alwaysSet:f.alwaysSet})}return d})).then(d=>dn.mergeObjectSync(s,d)):dn.mergeObjectSync(s,u)}get shape(){return this._def.shape()}strict(r){return new e({...this._def,unknownKeys:"strict",...void 0!==r?{errorMap:(i,s)=>{var o,a,c,l;const u=null!==(c=null===(a=(o=this._def).errorMap)||void 0===a?void 0:a.call(o,i,s).message)&&void 0!==c?c:s.defaultError;return"unrecognized_keys"===i.code?{message:null!==(l=te.errToObj(r).message)&&void 0!==l?l:u}:{message:u}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(r){return new e({...this._def,shape:()=>({...this._def.shape(),...r})})}merge(r){return new e({unknownKeys:r._def.unknownKeys,catchall:r._def.catchall,shape:()=>({...this._def.shape(),...r._def.shape()}),typeName:ce.ZodObject})}setKey(r,i){return this.augment({[r]:i})}catchall(r){return new e({...this._def,catchall:r})}pick(r){const i={};return Re.objectKeys(r).forEach(s=>{r[s]&&this.shape[s]&&(i[s]=this.shape[s])}),new e({...this._def,shape:()=>i})}omit(r){const i={};return Re.objectKeys(this.shape).forEach(s=>{r[s]||(i[s]=this.shape[s])}),new e({...this._def,shape:()=>i})}deepPartial(){return Uc(this)}partial(r){const i={};return Re.objectKeys(this.shape).forEach(s=>{const o=this.shape[s];i[s]=r&&!r[s]?o:o.optional()}),new e({...this._def,shape:()=>i})}required(r){const i={};return Re.objectKeys(this.shape).forEach(s=>{if(r&&!r[s])i[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof zs;)a=a._def.innerType;i[s]=a}}),new e({...this._def,shape:()=>i})}keyof(){return uF(Re.objectKeys(this.shape))}}return e.create=(t,r)=>new e({shape:()=>t,unknownKeys:"strip",catchall:zo.create(),typeName:ce.ZodObject,...ye(r)}),e.strictCreate=(t,r)=>new e({shape:()=>t,unknownKeys:"strict",catchall:zo.create(),typeName:ce.ZodObject,...ye(r)}),e.lazycreate=(t,r)=>new e({shape:t,unknownKeys:"strip",catchall:zo.create(),typeName:ce.ZodObject,...ye(r)}),e})(),qE=(()=>{class e extends Ce{_parse(r){const{ctx:i}=this._processInputParams(r),s=this._def.options;if(i.common.async)return Promise.all(s.map(function(){var a=U(function*(c){const l={...i,common:{...i.common,issues:[]},parent:null};return{result:yield c._parseAsync({data:i.data,path:i.path,parent:l}),ctx:l}});return function(c){return a.apply(this,arguments)}}())).then(function o(a){for(const l of a)if("valid"===l.result.status)return l.result;for(const l of a)if("dirty"===l.result.status)return i.common.issues.push(...l.ctx.common.issues),l.result;const c=a.map(l=>new Zi(l.ctx.common.issues));return Z(i,{code:B.invalid_union,unionErrors:c}),ae});{let a;const c=[];for(const u of s){const d={...i,common:{...i.common,issues:[]},parent:null},f=u._parseSync({data:i.data,path:i.path,parent:d});if("valid"===f.status)return f;"dirty"===f.status&&!a&&(a={result:f,ctx:d}),d.common.issues.length&&c.push(d.common.issues)}if(a)return i.common.issues.push(...a.ctx.common.issues),a.result;const l=c.map(u=>new Zi(u));return Z(i,{code:B.invalid_union,unionErrors:l}),ae}}get options(){return this._def.options}}return e.create=(t,r)=>new e({options:t,typeName:ce.ZodUnion,...ye(r)}),e})();const Ki=e=>e instanceof ZE?Ki(e.schema):e instanceof qo?Ki(e.innerType()):e instanceof KE?[e.value]:e instanceof Hs?e.options:e instanceof wd?Re.objectValues(e.enum):e instanceof QE?Ki(e._def.innerType):e instanceof HE?[void 0]:e instanceof zE?[null]:e instanceof zs?[void 0,...Ki(e.unwrap())]:e instanceof zc?[null,...Ki(e.unwrap())]:e instanceof JE||e instanceof XE?Ki(e.unwrap()):e instanceof YE?Ki(e._def.innerType):[];class $g extends Ce{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==K.object)return Z(r,{code:B.invalid_type,expected:K.object,received:r.parsedType}),ae;const i=this.discriminator,o=this.optionsMap.get(r.data[i]);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(Z(r,{code:B.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),ae)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,i){const s=new Map;for(const o of r){const a=Ki(o.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const c of a){if(s.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);s.set(c,o)}}return new $g({typeName:ce.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...ye(i)})}}function GE(e,t){const r=$s(e),i=$s(t);if(e===t)return{valid:!0,data:e};if(r===K.object&&i===K.object){const s=Re.objectKeys(t),o=Re.objectKeys(e).filter(c=>-1!==s.indexOf(c)),a={...e,...t};for(const c of o){const l=GE(e[c],t[c]);if(!l.valid)return{valid:!1};a[c]=l.data}return{valid:!0,data:a}}if(r===K.array&&i===K.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o{class e extends Ce{_parse(r){const{status:i,ctx:s}=this._processInputParams(r),o=(a,c)=>{if(LE(a)||LE(c))return ae;const l=GE(a.value,c.value);return l.valid?((FE(a)||FE(c))&&i.dirty(),{status:i.value,value:l.data}):(Z(s,{code:B.invalid_intersection_types}),ae)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,c])=>o(a,c)):o(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}return e.create=(t,r,i)=>new e({left:t,right:r,typeName:ce.ZodIntersection,...ye(i)}),e})(),$c=(()=>{class e extends Ce{_parse(r){const{status:i,ctx:s}=this._processInputParams(r);if(s.parsedType!==K.array)return Z(s,{code:B.invalid_type,expected:K.array,received:s.parsedType}),ae;if(s.data.lengththis._def.items.length&&(Z(s,{code:B.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty());const a=[...s.data].map((c,l)=>{const u=this._def.items[l]||this._def.rest;return u?u._parse(new vi(s,c,s.path,l)):null}).filter(c=>!!c);return s.common.async?Promise.all(a).then(c=>dn.mergeArray(i,c)):dn.mergeArray(i,a)}get items(){return this._def.items}rest(r){return new e({...this._def,rest:r})}}return e.create=(t,r)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new e({items:t,typeName:ce.ZodTuple,rest:null,...ye(r)})},e})();class _d extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==K.object)return Z(i,{code:B.invalid_type,expected:K.object,received:i.parsedType}),ae;const s=[],o=this._def.keyType,a=this._def.valueType;for(const c in i.data)s.push({key:o._parse(new vi(i,c,i.path,c)),value:a._parse(new vi(i,i.data[c],i.path,c)),alwaysSet:c in i.data});return i.common.async?dn.mergeObjectAsync(r,s):dn.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,i){return new _d(r instanceof Ce?{keyType:t,valueType:r,typeName:ce.ZodRecord,...ye(i)}:{keyType:Ug.create(),valueType:t,typeName:ce.ZodRecord,...ye(r)})}}let cF=(()=>{class e extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){const{status:i,ctx:s}=this._processInputParams(r);if(s.parsedType!==K.map)return Z(s,{code:B.invalid_type,expected:K.map,received:s.parsedType}),ae;const o=this._def.keyType,a=this._def.valueType,c=[...s.data.entries()].map(([l,u],d)=>({key:o._parse(new vi(s,l,s.path,[d,"key"])),value:a._parse(new vi(s,u,s.path,[d,"value"]))}));if(s.common.async){const l=new Map;return Promise.resolve().then(U(function*(){for(const u of c){const d=yield u.key,f=yield u.value;if("aborted"===d.status||"aborted"===f.status)return ae;("dirty"===d.status||"dirty"===f.status)&&i.dirty(),l.set(d.value,f.value)}return{status:i.value,value:l}}))}{const l=new Map;for(const u of c){const d=u.key,f=u.value;if("aborted"===d.status||"aborted"===f.status)return ae;("dirty"===d.status||"dirty"===f.status)&&i.dirty(),l.set(d.value,f.value)}return{status:i.value,value:l}}}}return e.create=(t,r,i)=>new e({valueType:r,keyType:t,typeName:ce.ZodMap,...ye(i)}),e})(),lF=(()=>{class e extends Ce{_parse(r){const{status:i,ctx:s}=this._processInputParams(r);if(s.parsedType!==K.set)return Z(s,{code:B.invalid_type,expected:K.set,received:s.parsedType}),ae;const o=this._def;null!==o.minSize&&s.data.sizeo.maxSize.value&&(Z(s,{code:B.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),i.dirty());const a=this._def.valueType;function c(u){const d=new Set;for(const f of u){if("aborted"===f.status)return ae;"dirty"===f.status&&i.dirty(),d.add(f.value)}return{status:i.value,value:d}}const l=[...s.data.values()].map((u,d)=>a._parse(new vi(s,u,s.path,d)));return s.common.async?Promise.all(l).then(u=>c(u)):c(l)}min(r,i){return new e({...this._def,minSize:{value:r,message:te.toString(i)}})}max(r,i){return new e({...this._def,maxSize:{value:r,message:te.toString(i)}})}size(r,i){return this.min(r,i).max(r,i)}nonempty(r){return this.min(1,r)}}return e.create=(t,r)=>new e({valueType:t,minSize:null,maxSize:null,typeName:ce.ZodSet,...ye(r)}),e})();class Hc extends Ce{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==K.function)return Z(r,{code:B.invalid_type,expected:K.function,received:r.parsedType}),ae;function i(c,l){return Bg({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Fg(),Bc].filter(u=>!!u),issueData:{code:B.invalid_arguments,argumentsError:l}})}function s(c,l){return Bg({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Fg(),Bc].filter(u=>!!u),issueData:{code:B.invalid_return_type,returnTypeError:l}})}const o={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof Hg){const c=this;return Dn(U(function*(...l){const u=new Zi([]),d=yield c._def.args.parseAsync(l,o).catch(p=>{throw u.addIssue(i(l,p)),u}),f=yield Reflect.apply(a,this,d);return yield c._def.returns._def.type.parseAsync(f,o).catch(p=>{throw u.addIssue(s(f,p)),u})}))}{const c=this;return Dn(function(...l){const u=c._def.args.safeParse(l,o);if(!u.success)throw new Zi([i(l,u.error)]);const d=Reflect.apply(a,this,u.data),f=c._def.returns.safeParse(d,o);if(!f.success)throw new Zi([s(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Hc({...this._def,args:$c.create(t).rest(yd.create())})}returns(t){return new Hc({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,i){return new Hc({args:t||$c.create([]).rest(yd.create()),returns:r||yd.create(),typeName:ce.ZodFunction,...ye(i)})}}let ZE=(()=>{class e extends Ce{get schema(){return this._def.getter()}_parse(r){const{ctx:i}=this._processInputParams(r);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}return e.create=(t,r)=>new e({getter:t,typeName:ce.ZodLazy,...ye(r)}),e})(),KE=(()=>{class e extends Ce{_parse(r){if(r.data!==this._def.value){const i=this._getOrReturnCtx(r);return Z(i,{received:i.data,code:B.invalid_literal,expected:this._def.value}),ae}return{status:"valid",value:r.data}}get value(){return this._def.value}}return e.create=(t,r)=>new e({value:t,typeName:ce.ZodLiteral,...ye(r)}),e})();function uF(e,t){return new Hs({values:e,typeName:ce.ZodEnum,...ye(t)})}class Hs extends Ce{constructor(){super(...arguments),gd.set(this,void 0)}_parse(t){if("string"!=typeof t.data){const r=this._getOrReturnCtx(t);return Z(r,{expected:Re.joinValues(this._def.values),received:r.parsedType,code:B.invalid_type}),ae}if(Vg(this,gd,"f")||tF(this,gd,new Set(this._def.values),"f"),!Vg(this,gd,"f").has(t.data)){const r=this._getOrReturnCtx(t);return Z(r,{received:r.data,code:B.invalid_enum_value,options:this._def.values}),ae}return Dn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return Hs.create(t,{...this._def,...r})}exclude(t,r=this._def){return Hs.create(this.options.filter(i=>!t.includes(i)),{...this._def,...r})}}gd=new WeakMap,Hs.create=uF;class wd extends Ce{constructor(){super(...arguments),md.set(this,void 0)}_parse(t){const r=Re.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==K.string&&i.parsedType!==K.number){const s=Re.objectValues(r);return Z(i,{expected:Re.joinValues(s),received:i.parsedType,code:B.invalid_type}),ae}if(Vg(this,md,"f")||tF(this,md,new Set(Re.getValidEnumValues(this._def.values)),"f"),!Vg(this,md,"f").has(t.data)){const s=Re.objectValues(r);return Z(i,{received:i.data,code:B.invalid_enum_value,options:s}),ae}return Dn(t.data)}get enum(){return this._def.values}}md=new WeakMap,wd.create=(e,t)=>new wd({values:e,typeName:ce.ZodNativeEnum,...ye(t)});let Hg=(()=>{class e extends Ce{unwrap(){return this._def.type}_parse(r){const{ctx:i}=this._processInputParams(r);if(i.parsedType!==K.promise&&!1===i.common.async)return Z(i,{code:B.invalid_type,expected:K.promise,received:i.parsedType}),ae;const s=i.parsedType===K.promise?i.data:Promise.resolve(i.data);return Dn(s.then(o=>this._def.type.parseAsync(o,{path:i.path,errorMap:i.common.contextualErrorMap})))}}return e.create=(t,r)=>new e({type:t,typeName:ce.ZodPromise,...ye(r)}),e})(),qo=(()=>{class e extends Ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ce.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(r){var i=this;const{status:s,ctx:o}=this._processInputParams(r),a=this._def.effect||null,c={addIssue:l=>{Z(o,l),l.fatal?s.abort():s.dirty()},get path(){return o.path}};if(c.addIssue=c.addIssue.bind(c),"preprocess"===a.type){const l=a.transform(o.data,c);if(o.common.async)return Promise.resolve(l).then(function(){var u=U(function*(d){if("aborted"===s.value)return ae;const f=yield i._def.schema._parseAsync({data:d,path:o.path,parent:o});return"aborted"===f.status?ae:"dirty"===f.status||"dirty"===s.value?Vc(f.value):f});return function(d){return u.apply(this,arguments)}}());{if("aborted"===s.value)return ae;const u=this._def.schema._parseSync({data:l,path:o.path,parent:o});return"aborted"===u.status?ae:"dirty"===u.status||"dirty"===s.value?Vc(u.value):u}}if("refinement"===a.type){const l=u=>{const d=a.refinement(u,c);if(o.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(!1===o.common.async){const u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return"aborted"===u.status?ae:("dirty"===u.status&&s.dirty(),l(u.value),{status:s.value,value:u.value})}return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>"aborted"===u.status?ae:("dirty"===u.status&&s.dirty(),l(u.value).then(()=>({status:s.value,value:u.value}))))}if("transform"===a.type){if(!1===o.common.async){const l=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!hd(l))return l;const u=a.transform(l.value,c);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:u}}return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(l=>hd(l)?Promise.resolve(a.transform(l.value,c)).then(u=>({status:s.value,value:u})):l)}Re.assertNever(a)}}return e.create=(t,r,i)=>new e({schema:t,typeName:ce.ZodEffects,effect:r,...ye(i)}),e.createWithPreprocess=(t,r,i)=>new e({schema:r,effect:{type:"preprocess",transform:t},typeName:ce.ZodEffects,...ye(i)}),e})(),zs=(()=>{class e extends Ce{_parse(r){return this._getType(r)===K.undefined?Dn(void 0):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}}return e.create=(t,r)=>new e({innerType:t,typeName:ce.ZodOptional,...ye(r)}),e})(),zc=(()=>{class e extends Ce{_parse(r){return this._getType(r)===K.null?Dn(null):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}}return e.create=(t,r)=>new e({innerType:t,typeName:ce.ZodNullable,...ye(r)}),e})(),QE=(()=>{class e extends Ce{_parse(r){const{ctx:i}=this._processInputParams(r);let s=i.data;return i.parsedType===K.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}return e.create=(t,r)=>new e({innerType:t,typeName:ce.ZodDefault,defaultValue:"function"==typeof r.default?r.default:()=>r.default,...ye(r)}),e})(),YE=(()=>{class e extends Ce{_parse(r){const{ctx:i}=this._processInputParams(r),s={...i,common:{...i.common,issues:[]}},o=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return pd(o)?o.then(a=>({status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new Zi(s.common.issues)},input:s.data})})):{status:"valid",value:"valid"===o.status?o.value:this._def.catchValue({get error(){return new Zi(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}return e.create=(t,r)=>new e({innerType:t,typeName:ce.ZodCatch,catchValue:"function"==typeof r.catch?r.catch:()=>r.catch,...ye(r)}),e})(),dF=(()=>{class e extends Ce{_parse(r){if(this._getType(r)!==K.nan){const s=this._getOrReturnCtx(r);return Z(s,{code:B.invalid_type,expected:K.nan,received:s.parsedType}),ae}return{status:"valid",value:r.data}}}return e.create=t=>new e({typeName:ce.ZodNaN,...ye(t)}),e})();const yre=Symbol("zod_brand");class JE extends Ce{_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.type._parse({data:r.data,path:r.path,parent:r})}unwrap(){return this._def.type}}class bd extends Ce{_parse(t){var r=this;const{status:i,ctx:s}=this._processInputParams(t);if(s.common.async)return function(){var a=U(function*(){const c=yield r._def.in._parseAsync({data:s.data,path:s.path,parent:s});return"aborted"===c.status?ae:"dirty"===c.status?(i.dirty(),Vc(c.value)):r._def.out._parseAsync({data:c.value,path:s.path,parent:s})});return function(){return a.apply(this,arguments)}}()();{const o=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===o.status?ae:"dirty"===o.status?(i.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:s.path,parent:s})}}static create(t,r){return new bd({in:t,out:r,typeName:ce.ZodPipeline})}}let XE=(()=>{class e extends Ce{_parse(r){const i=this._def.innerType._parse(r),s=o=>(hd(o)&&(o.value=Object.freeze(o.value)),o);return pd(i)?i.then(o=>s(o)):s(i)}unwrap(){return this._def.innerType}}return e.create=(t,r)=>new e({innerType:t,typeName:ce.ZodReadonly,...ye(r)}),e})();function fF(e,t={},r){return e?jg.create().superRefine((i,s)=>{var o,a;if(!e(i)){const c="function"==typeof t?t(i):"string"==typeof t?{message:t}:t,l=null===(a=null!==(o=c.fatal)&&void 0!==o?o:r)||void 0===a||a;s.addIssue({code:"custom",..."string"==typeof c?{message:c}:c,fatal:l})}}):jg.create()}const vre={object:jc.lazycreate};var ce=function(e){return e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly",e}(ce||{});const hF=Ug.create,pF=VE.create,wre=dF.create,bre=UE.create,gF=jE.create,Ere=$E.create,Cre=oF.create,Dre=HE.create,Sre=zE.create,Tre=jg.create,Ire=yd.create,xre=zo.create,Are=aF.create,Mre=vd.create,Nre=jc.create,Rre=jc.strictCreate,Ore=qE.create,kre=$g.create,Pre=WE.create,Lre=$c.create,Fre=_d.create,Bre=cF.create,Vre=lF.create,Ure=Hc.create,jre=ZE.create,$re=KE.create,Hre=Hs.create,zre=wd.create,qre=Hg.create,mF=qo.create,Gre=zs.create,Wre=zc.create,Zre=qo.createWithPreprocess,Kre=bd.create;var yF,G=Object.freeze({__proto__:null,defaultErrorMap:Bc,setErrorMap:function ere(e){eF=e},getErrorMap:Fg,makeIssue:Bg,EMPTY_PATH:[],addIssueToContext:Z,ParseStatus:dn,INVALID:ae,DIRTY:Vc,OK:Dn,isAborted:LE,isDirty:FE,isValid:hd,isAsync:pd,get util(){return Re},get objectUtil(){return XL},ZodParsedType:K,getParsedType:$s,ZodType:Ce,datetimeRegex:sF,ZodString:Ug,ZodNumber:VE,ZodBigInt:UE,ZodBoolean:jE,ZodDate:$E,ZodSymbol:oF,ZodUndefined:HE,ZodNull:zE,ZodAny:jg,ZodUnknown:yd,ZodNever:zo,ZodVoid:aF,ZodArray:vd,ZodObject:jc,ZodUnion:qE,ZodDiscriminatedUnion:$g,ZodIntersection:WE,ZodTuple:$c,ZodRecord:_d,ZodMap:cF,ZodSet:lF,ZodFunction:Hc,ZodLazy:ZE,ZodLiteral:KE,ZodEnum:Hs,ZodNativeEnum:wd,ZodPromise:Hg,ZodEffects:qo,ZodTransformer:qo,ZodOptional:zs,ZodNullable:zc,ZodDefault:QE,ZodCatch:YE,ZodNaN:dF,BRAND:yre,ZodBranded:JE,ZodPipeline:bd,ZodReadonly:XE,custom:fF,Schema:Ce,ZodSchema:Ce,late:vre,get ZodFirstPartyTypeKind(){return ce},coerce:{string:e=>Ug.create({...e,coerce:!0}),number:e=>VE.create({...e,coerce:!0}),boolean:e=>jE.create({...e,coerce:!0}),bigint:e=>UE.create({...e,coerce:!0}),date:e=>$E.create({...e,coerce:!0})},any:Tre,array:Mre,bigint:bre,boolean:gF,date:Ere,discriminatedUnion:kre,effect:mF,enum:Hre,function:Ure,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>fF(r=>r instanceof e,t),intersection:Pre,lazy:jre,literal:$re,map:Bre,nan:wre,nativeEnum:zre,never:xre,null:Sre,nullable:Wre,number:pF,object:Nre,oboolean:()=>gF().optional(),onumber:()=>pF().optional(),optional:Gre,ostring:()=>hF().optional(),pipeline:Kre,preprocess:Zre,promise:qre,record:Fre,set:Vre,strictObject:Rre,string:hF,symbol:Cre,transformer:mF,tuple:Lre,undefined:Dre,union:Ore,unknown:Ire,void:Are,NEVER:ae,ZodIssueCode:B,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:Zi});class st{static id(){return G.string().regex(/^[0-9a-f]{64}$/)}static event(){return G.object({id:st.id(),kind:G.number().int().nonnegative(),pubkey:st.id(),tags:G.string().array().array(),content:G.string(),created_at:G.number().int().nonnegative(),sig:G.string()})}static filter(){return G.object({kinds:G.number().int().nonnegative().array().optional(),ids:st.id().array().optional(),authors:st.id().array().optional(),since:G.number().int().nonnegative().optional(),until:G.number().int().nonnegative().optional(),limit:G.number().int().nonnegative().optional(),search:G.string().optional()}).passthrough().transform(t=>{const r=["kinds","ids","authors","since","until","limit","search"];return Object.entries(t).reduce((i,[s,o])=>((r.includes(s)||s.startsWith("#"))&&(i[s]=o),i),{})})}static bech32(t){return G.string().regex(/^[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}$/).refine(r=>!t||r.startsWith(`${t}1`))}static clientEVENT(){return G.tuple([G.literal("EVENT"),st.event()])}static clientREQ(){return G.tuple([G.literal("REQ"),G.string()]).rest(st.filter())}static clientCOUNT(){return G.tuple([G.literal("COUNT"),G.string()]).rest(st.filter())}static clientCLOSE(){return G.tuple([G.literal("CLOSE"),G.string()])}static clientAUTH(){return G.tuple([G.literal("AUTH"),st.event()])}static clientMsg(){return G.union([st.clientEVENT(),st.clientREQ(),st.clientCOUNT(),st.clientCLOSE(),st.clientAUTH()])}static relayEVENT(){return G.tuple([G.literal("EVENT"),G.string(),st.event()])}static relayOK(){return G.tuple([G.literal("OK"),st.id(),G.boolean(),G.string()])}static relayEOSE(){return G.tuple([G.literal("EOSE"),G.string()])}static relayNOTICE(){return G.tuple([G.literal("NOTICE"),G.string()])}static relayCLOSED(){return G.tuple([G.literal("CLOSED"),G.string(),G.string()])}static relayAUTH(){return G.tuple([G.literal("AUTH"),G.string()])}static relayCOUNT(){return G.tuple([G.literal("COUNT"),G.string(),G.object({count:G.number().int().nonnegative(),approximate:G.boolean().optional()})])}static relayMsg(){return G.union([st.relayEVENT(),st.relayOK(),st.relayEOSE(),st.relayNOTICE(),st.relayCLOSED(),st.relayAUTH(),st.relayCOUNT()])}static metadata(){return G.object({about:G.string().optional().catch(void 0),banner:G.string().url().optional().catch(void 0),bot:G.boolean().optional().catch(void 0),display_name:G.string().optional().catch(void 0),lud06:st.bech32("lnurl").optional().catch(void 0),lud16:G.string().email().optional().catch(void 0),name:G.string().optional().catch(void 0),nip05:G.string().email().optional().catch(void 0),picture:G.string().url().optional().catch(void 0),website:G.string().url().optional().catch(void 0)}).passthrough()}static connectRequest(){return G.object({id:G.string(),method:G.string(),params:G.string().array()})}static connectResponse(){return G.object({id:G.string(),result:G.string(),error:G.string().optional()})}static json(){return G.string().transform((t,r)=>{try{return JSON.parse(t)}catch{return r.addIssue({code:G.ZodIssueCode.custom,message:"Invalid JSON"}),G.NEVER}})}}yF=Symbol.asyncDispose;class Qre{url;opts;socket;subs;closedByUser;idleTimer;ee;get subscriptions(){return[...this.subs.values()]}constructor(t,r={}){this.url=t,this.opts=r,this.subs=new Map,this.closedByUser=!1,this.ee=new EventTarget,this.socket=this.createSocket(),this.maybeStartIdleTimer()}createSocket(){const{backoff:t=new Kne(1e3)}=this.opts;return new Yne(this.url).withBuffer(new Jne).withBackoff(!1===t?void 0:t).onOpen(()=>{for(const r of this.subs.values())this.send(r)}).onClose(()=>{this.subs.size||this.socket.close()}).onMessage((r,i)=>{const s=st.json().pipe(st.relayMsg()).safeParse(i.data);s.success&&this.receive(s.data)}).build()}receive(t){const{auth:r,verifyEvent:i=Ic}=this.opts;switch(t[0]){case"EVENT":if(!i(t[2]))break;this.ee.dispatchEvent(new CustomEvent(`sub:${t[1]}`,{detail:t}));break;case"EOSE":this.ee.dispatchEvent(new CustomEvent(`sub:${t[1]}`,{detail:t}));break;case"CLOSED":this.subs.delete(t[1]),this.maybeStartIdleTimer(),this.ee.dispatchEvent(new CustomEvent(`sub:${t[1]}`,{detail:t})),this.ee.dispatchEvent(new CustomEvent(`count:${t[1]}`,{detail:t}));break;case"OK":this.ee.dispatchEvent(new CustomEvent(`ok:${t[1]}`,{detail:t}));break;case"NOTICE":this.ee.dispatchEvent(new CustomEvent("notice",{detail:t}));break;case"COUNT":this.ee.dispatchEvent(new CustomEvent(`count:${t[1]}`,{detail:t}));break;case"AUTH":r?.(t[1]).then(s=>this.send(["AUTH",s])).catch(()=>{})}}send(t){switch(this.wake(),t[0]){case"REQ":this.subs.set(t[1],t);break;case"CLOSE":this.subs.delete(t[1]),this.maybeStartIdleTimer();break;case"EVENT":case"COUNT":return this.socket.send(JSON.stringify(t))}this.socket.readyState===WebSocket.OPEN&&this.socket.send(JSON.stringify(t))}req(t,r={}){var i=this;return Lg(function*(){const{signal:s}=r,o=crypto.randomUUID(),a=i.on(`sub:${o}`,s),c=["REQ",o,...t];i.send(c);try{var d,l=!1,u=!1;try{for(var h,f=Cs(a);l=!(h=yield js(f.next())).done;l=!1){const p=h.value;if("EOSE"===p[0]&&(yield p),"CLOSED"===p[0])break;if("EVENT"===p[0]){if(!dg(t,p[2]))continue;yield p}}}catch(p){u=!0,d=p}finally{try{l&&null!=f.return&&(yield js(f.return()))}finally{if(u)throw d}}}finally{i.send(["CLOSE",o])}})()}query(t,r){var i=this;return U(function*(){const s=new fr,o=t.reduce((f,h)=>f+fP(h),0);if(0===o)return[];var l,a=!1,c=!1;try{for(var d,u=Cs(i.req(t,r));a=!(d=yield u.next()).done;a=!1){const f=d.value;if("EOSE"===f[0])break;if("EVENT"===f[0]&&s.add(f[2]),"CLOSED"===f[0])throw new Error("Subscription closed");if(s.size>=o)break}}catch(f){c=!0,l=f}finally{try{a&&null!=u.return&&(yield u.return())}finally{if(c)throw l}}return[...s]})()}event(t,r){var i=this;return U(function*(){const s=i.once(`ok:${t.id}`,r?.signal);i.send(["EVENT",t]);const[,,o,a]=yield s;if(!o)throw new Error(a)})()}count(t,r){var i=this;return U(function*(){const s=crypto.randomUUID(),o=i.once(`count:${s}`,r?.signal);i.send(["COUNT",s,...t]);const a=yield o;switch(a[0]){case"CLOSED":throw new Error("Subscription closed");case"COUNT":{const[,,c]=a;return c}}})()}on(t,r){var i=this;return Lg(function*(){if(r?.aborted)throw i.abortError();const s=new QL(r),o=f=>s.push(f.detail);i.ee.addEventListener(t,o);try{var l,a=!1,c=!1;try{for(var d,u=Cs(s);a=!(d=yield js(u.next())).done;a=!1)yield d.value}catch(f){c=!0,l=f}finally{try{a&&null!=u.return&&(yield js(u.return()))}finally{if(c)throw l}}}finally{i.ee.removeEventListener(t,o)}})()}once(t,r){var i=this;return U(function*(){var a,s=!1,o=!1;try{for(var l,c=Cs(i.on(t,r));s=!(l=yield c.next()).done;s=!1)return l.value}catch(u){o=!0,a=u}finally{try{s&&null!=c.return&&(yield c.return())}finally{if(o)throw a}}throw new Error("Unreachable")})()}abortError(){return new DOMException("The signal has been aborted","AbortError")}maybeStartIdleTimer(){const{idleTimeout:t=3e4}=this.opts;!1!==t&&(this.idleTimer||this.subs.size||this.closedByUser||(this.idleTimer=setTimeout(()=>this.socket.close(),t)))}stopIdleTimer(){clearTimeout(this.idleTimer),this.idleTimer=void 0}wake(){this.stopIdleTimer(),!this.closedByUser&&this.socket.closedByUser&&(this.socket=this.createSocket())}close(){var t=this;return U(function*(){t.closedByUser=!0,t.socket.close(),t.stopIdleTimer(),t.socket.readyState!==WebSocket.CLOSED&&(yield new Promise(r=>{t.socket.addEventListener(Xe.close,r,{once:!0})}))})()}[yF](){var t=this;return U(function*(){yield t.close()})()}}class Yre extends vt{constructor(t,r){super()}schedule(t,r=0){return this}}const zg={setInterval(e,t,...r){const{delegate:i}=zg;return i?.setInterval?i.setInterval(e,t,...r):setInterval(e,t,...r)},clearInterval(e){const{delegate:t}=zg;return(t?.clearInterval||clearInterval)(e)},delegate:void 0},vF={now:()=>(vF.delegate||Date).now(),delegate:void 0};class Ed{constructor(t,r=Ed.now){this.schedulerActionCtor=t,this.now=r}schedule(t,r=0,i){return new this.schedulerActionCtor(this,t).schedule(i,r)}}Ed.now=vF.now;const eie=new class Xre extends Ed{constructor(t,r=Ed.now){super(t,r),this.actions=[],this._active=!1}flush(t){const{actions:r}=this;if(this._active)return void r.push(t);let i;this._active=!0;do{if(i=t.execute(t.state,t.delay))break}while(t=r.shift());if(this._active=!1,i){for(;t=r.shift();)t.unsubscribe();throw i}}}(class Jre extends Yre{constructor(t,r){super(t,r),this.scheduler=t,this.work=r,this.pending=!1}schedule(t,r=0){var i;if(this.closed)return this;this.state=t;const s=this.id,o=this.scheduler;return null!=s&&(this.id=this.recycleAsyncId(o,s,r)),this.pending=!0,this.delay=r,this.id=null!==(i=this.id)&&void 0!==i?i:this.requestAsyncId(o,this.id,r),this}requestAsyncId(t,r,i=0){return zg.setInterval(t.flush.bind(t,this),i)}recycleAsyncId(t,r,i=0){if(null!=i&&this.delay===i&&!1===this.pending)return r;null!=r&&zg.clearInterval(r)}execute(t,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const i=this._execute(t,r);if(i)return i;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(t,r){let s,i=!1;try{this.work(t)}catch(o){i=!0,s=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),s}unsubscribe(){if(!this.closed){const{id:t,scheduler:r}=this,{actions:i}=r;this.work=this.state=this.scheduler=null,this.pending=!1,Vd(i,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,super.unsubscribe()}}}),nie=Bd(e=>function(r=null){e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=r});function _F(e,t){const{first:r,each:i,with:s=rie,scheduler:o=t??eie,meta:a=null}=function tie(e){return e instanceof Date&&!isNaN(e)}(e)?{first:e}:"number"==typeof e?{each:e}:e;if(null==r&&null==i)throw new TypeError("No timeout provided.");return zt((c,l)=>{let u,d,f=null,h=0;const p=g=>{d=ti(l,o,()=>{try{u.unsubscribe(),Tr(s({meta:a,lastValue:f,seen:h})).subscribe(l)}catch(m){l.error(m)}},g)};u=c.subscribe(Dt(l,g=>{d?.unsubscribe(),h++,l.next(f=g),i>0&&p(i)},void 0,void 0,()=>{d?.closed||d?.unsubscribe(),f=null})),!h&&p(null!=r?"number"==typeof r?r:+r-o.now():i)})}function rie(e){throw new nie(e)}var qg=new TextDecoder("utf-8"),wF=(new TextEncoder,5e3);function eC(e){let t={},r=e;for(;r.length>0;){let i=r[0],s=r[1],o=r.slice(2,2+s);if(r=r.slice(2+s),o.length{class e extends Zne{constructor(r){super(r)}observe(r,i){var s=this;console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","[[subscribe filter]]",r);const o=new AbortController,a=i?.signal?AbortSignal.any([i.signal,o.signal]):o.signal,c=new Ze,l=new Map;return U(function*(){var f,u=!1,d=!1;try{for(var p,h=Cs(s.req(r,{signal:a}));u=!(p=yield h.next()).done;u=!1){const g=p.value;if("CLOSED"===g[0]){c.error(g);break}if("EVENT"===g[0]){const m=l.size;l.set(g[2].id,g[2]),m!==l.size?c.next(g[2]):(console.debug((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","event deduplicated, not emiting again: ",g[2]),console.debug((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","current nset from request: ",l))}}}catch(g){d=!0,f=g}finally{try{u&&null!=h.return&&(yield h.return())}finally{if(d)throw f}}})(),c.asObservable().pipe(Eu(()=>{console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","[[unsubscribe filter]]",r),o.abort()}))}static \u0275fac=function(i){return new(i||e)(z(bF))};static \u0275prov=j({token:e,factory:e.\u0275fac})}return e})(),rC=(()=>{class e{pubkeySet=new Set;constructor(){this.loadList()}loadList(){try{const r=sessionStorage.getItem("talkToStrangerIgnoreList");if(r){let i=JSON.parse(r);i instanceof Array?this.pubkeySet=new Set(i):sessionStorage.setItem("talkToStrangerIgnoreList","[]")}}catch{sessionStorage.setItem("talkToStrangerIgnoreList","[]")}}saveInList(r){this.pubkeySet.add(r),sessionStorage.setItem("talkToStrangerIgnoreList",JSON.stringify([...this.pubkeySet]))}isInList(r){return this.pubkeySet.has(r)}static \u0275fac=function(i){return new(i||e)};static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),EF=(()=>{class e{npool;talkToStrangerSession;constructor(r,i){this.npool=r,this.talkToStrangerSession=i}listenUserStatusUpdate(r,i){const s=[{kinds:[Kn.UserStatuses],authors:[r]}];return console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","observing filter:",s),this.npool.observe(s,i)}queryChatConfirmation(r,i){const s=[{kinds:[Kn.UserStatuses],"#t":["confirm",...i.searchTags],"#p":[r.pubkey],limit:1}];return console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","quering filter:",s),this.npool.query(s,i)}listenChatConfirmation(r,i){const s=[{kinds:[Kn.UserStatuses],"#t":["confirm",...i.searchTags],"#p":[r.pubkey],limit:1}];return console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","observing filter:",s),this.npool.observe(s,i)}queryChatAvailable(r){var i=this;return U(function*(){const s=Math.floor((new Date).getTime()/1e3),c=[{kinds:[Kn.UserStatuses],"#t":[r.statusName||"wannachat",...r.searchTags],since:s-600}];console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","quering filter: ",c);let l=yield i.npool.query(c,r);l=l.filter(d=>!i.talkToStrangerSession.isInList(d.pubkey));const u=l[Math.floor(Math.random()*l.length)];return u?console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","wanna chat found:",u):console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","wanna chat NOT found..."),Promise.resolve(u||null)})()}static \u0275fac=function(i){return new(i||e)(z(Kg),z(rC))};static \u0275prov=j({token:e,factory:e.\u0275fac})}return e})(),iC=(()=>{class e{wannachatStatusDefaultTimeoutInSeconds=20;static \u0275fac=function(i){return new(i||e)};static \u0275prov=j({token:e,factory:e.\u0275fac})}return e})(),Qg=(()=>{class e{#t;currentSession;constructor(){const r=yb();this.#t=new RE(r);const i=Ju(r),s={pubkey:i,npub:Wg(i)};this.currentSession=new Ln(s)}recreateSession(){const r=yb();this.#t=new RE(r);const i=Ju(r),s={pubkey:i,npub:Wg(i)};return this.currentSession.next(s),s}getPublicKey(){return this.#t.getPublicKey()}getPublicUser(){var r=this;return U(function*(){const i=yield r.#t.getPublicKey();return{pubkey:i,npub:Wg(i)}})()}listenCurrentUser(){return this.currentSession.asObservable()}signEvent(r){return this.#t.signEvent(r)}nip04={encrypt:(()=>{var i,r=this;return i=U(function*(s,o){return r.#t.nip04.encrypt(s,o)}),function(o,a){return i.apply(this,arguments)}})(),decrypt:(()=>{var i,r=this;return i=U(function*(s,o){return r.#t.nip04.decrypt(s,o)}),function(o,a){return i.apply(this,arguments)}})()};nip44={encrypt:(()=>{var i,r=this;return i=U(function*(s,o){return r.#t.nip44.encrypt(s,o)}),function(o,a){return i.apply(this,arguments)}})(),decrypt:(()=>{var i,r=this;return i=U(function*(s,o){return r.#t.nip44.decrypt(s,o)}),function(o,a){return i.apply(this,arguments)}})()};static \u0275fac=function(i){return new(i||e)};static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),CF=(()=>{class e{talkToStrangerConfig;talkToStrangerSigner;largeExpirationTime=1800;constructor(r,i){this.talkToStrangerConfig=r,this.talkToStrangerSigner=i}unixTimeNow(){return Math.floor(Date.now()/1e3)}getExpirationTimestamp(r=this.talkToStrangerConfig.wannachatStatusDefaultTimeoutInSeconds){const s=Math.floor(Date.now()/1e3)+r;return String(s)}createEncryptedDirectMessage(r,i){var s=this;return U(function*(){const o=yield s.talkToStrangerSigner.nip04.encrypt(r.pubkey,i),a={kind:Kn.EncryptedDirectMessage,content:o,created_at:s.unixTimeNow(),tags:[["p",r.pubkey],["expiration",s.getExpirationTimestamp(s.largeExpirationTime)]]};return s.talkToStrangerSigner.signEvent(a)})()}createWannaChatUserStatus(r){const i=this.talkToStrangerConfig.wannachatStatusDefaultTimeoutInSeconds+5,s=r.statusName||"wannachat",o=r.userTags.map(a=>["t",a]);return this.createUserStatus(s,[["expiration",this.getExpirationTimestamp(i)],["t",s],...o])}createDisconnectedUserStatus(){return this.createUserStatus("disconnected",[["expiration",this.getExpirationTimestamp()]])}createTypingUserStatus(){return this.createUserStatus("typing",[["expiration",this.getExpirationTimestamp(this.largeExpirationTime)]])}createChatingUserStatus(r,i){const s=i.userTags.map(o=>["t",o]);return this.createUserStatus("confirm",[["expiration",this.getExpirationTimestamp(this.largeExpirationTime)],["p",r.pubkey],["t","confirm"],...s])}deleteUserHistory(){const r={kind:Kn.EventDeletion,tags:[["k",String(Kn.EncryptedDirectMessage)],["k",String(Kn.UserStatuses)],["expiration",this.getExpirationTimestamp()]],created_at:Math.floor((new Date).getTime()/1e3),content:""};return this.talkToStrangerSigner.signEvent(r)}cleanUserStatus(){return this.createUserStatus("",[["expiration",this.getExpirationTimestamp(this.largeExpirationTime)]])}createUserStatus(r,i){var s=this;return U(function*(){const o=[["d","general"],...i||[]];let a={kind:Kn.UserStatuses,content:r,created_at:s.unixTimeNow(),tags:o};return s.talkToStrangerSigner.signEvent(a)})()}static \u0275fac=function(i){return new(i||e)(z(iC),z(Qg))};static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),DF=(()=>{class e{convertPubkeyToPublicKeys(r){return{pubkey:r,npub:Wg(r)}}convertNPubToPubkey(r){const{data:i}=function sie(e){let{prefix:t,words:r}=pi.decode(e,wF),i=new Uint8Array(pi.fromWords(r));switch(t){case"nprofile":{let s=eC(i);if(!s[0]?.[0])throw new Error("missing TLV 0 for nprofile");if(32!==s[0][0].length)throw new Error("TLV 0 should be 32 bytes");return{type:"nprofile",data:{pubkey:gt(s[0][0]),relays:s[1]?s[1].map(o=>qg.decode(o)):[]}}}case"nevent":{let s=eC(i);if(!s[0]?.[0])throw new Error("missing TLV 0 for nevent");if(32!==s[0][0].length)throw new Error("TLV 0 should be 32 bytes");if(s[2]&&32!==s[2][0].length)throw new Error("TLV 2 should be 32 bytes");if(s[3]&&4!==s[3][0].length)throw new Error("TLV 3 should be 4 bytes");return{type:"nevent",data:{id:gt(s[0][0]),relays:s[1]?s[1].map(o=>qg.decode(o)):[],author:s[2]?.[0]?gt(s[2][0]):void 0,kind:s[3]?.[0]?parseInt(gt(s[3][0]),16):void 0}}}case"naddr":{let s=eC(i);if(!s[0]?.[0])throw new Error("missing TLV 0 for naddr");if(!s[2]?.[0])throw new Error("missing TLV 2 for naddr");if(32!==s[2][0].length)throw new Error("TLV 2 should be 32 bytes");if(!s[3]?.[0])throw new Error("missing TLV 3 for naddr");if(4!==s[3][0].length)throw new Error("TLV 3 should be 4 bytes");return{type:"naddr",data:{identifier:qg.decode(s[0][0]),pubkey:gt(s[2][0]),kind:parseInt(gt(s[3][0]),16),relays:s[1]?s[1].map(o=>qg.decode(o)):[]}}}case"nsec":return{type:t,data:i};case"npub":case"note":return{type:t,data:gt(i)};default:throw new Error(`unknown prefix ${t}`)}}(r);return i}static \u0275fac=function(i){return new(i||e)};static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),sC=(()=>{class e{nostrEventFactory;findStrangerNostr;talkToStrangerSession;talkToStrangerSigner;nostrConverter;config;npool;constructor(r,i,s,o,a,c,l){this.nostrEventFactory=r,this.findStrangerNostr=i,this.talkToStrangerSession=s,this.talkToStrangerSigner=o,this.nostrConverter=a,this.config=c,this.npool=l}publish(r){return this.npool.event(r)}searchStranger(r){var i=this;return U(function*(){i.createSession();const s=yield i.findStrangerNostr.queryChatAvailable(r);if(s){console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","inviting ",s.pubkey," to chat and listening confirmation");const a=i.listenChatingConfirmation(s,r);yield i.inviteToChating(s,r);const c=yield a;return i.talkToStrangerSession.saveInList(s.pubkey),c?Promise.resolve(i.nostrConverter.convertPubkeyToPublicKeys(s.pubkey)):(yield i.endSession(),i.searchStranger(r))}const o=yield i.talkToStrangerSigner.getPublicUser();return yield i.publishWannaChatStatus(r),new Promise(a=>{const c=i.findStrangerNostr.listenChatConfirmation(o,r).pipe(_F(1e3*i.config.wannachatStatusDefaultTimeoutInSeconds),ys(l=>(c.unsubscribe(),i.deleteUserHistory().then(()=>i.searchStranger(r).then(u=>a(u))),nc(()=>new l)))).subscribe({next:l=>{i.talkToStrangerSession.saveInList(l.pubkey),i.replyChatInvitation(l,r).then(u=>{if(!u)throw new Error("internal error: user not found, please report this with the logs from developer tools (F12)");a(u)}).catch(u=>{throw console.error(u),u}),c.unsubscribe()},error:l=>console.error((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]",l)})})})()}replyChatInvitation(r,i){var s=this;return U(function*(){return console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","event was listen: ",r),console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","it must be a chating invitation from ",r.pubkey,", repling invitation..."),yield s.inviteToChating(r,i),console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","replied... resolving... "),console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","[searchStranger] unsubscribe"),Promise.resolve(s.nostrConverter.convertPubkeyToPublicKeys(r.pubkey))})()}isChatingToPubKey(r,i){console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","is wannachat reply with chating? event: ",r);const s=r.tags.filter(([o])=>"p"===o).find(([,o])=>o===i.pubkey)||[];return console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","is wannachat reply with chating?",s.length?"yes":"no"),!!s.length}inviteToChating(r,i){const s=this.nostrConverter.convertPubkeyToPublicKeys(r.pubkey);return this.publishChatInviteStatus(s,i)}listenChatingConfirmation(r,i){var s=this;return U(function*(){return new Promise(o=>{console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","listening status update from: ",r.pubkey);const a=s.findStrangerNostr.listenUserStatusUpdate(r.pubkey,i).pipe(_F(5e3),ys(c=>nc(()=>new Error("chat confirmation timeout after 5s waiting, there is no stranger connected to this session",{cause:c})))).subscribe({next:c=>s.receiveChatingConfirmation(a,c,r,i).then(l=>{"boolean"==typeof l&&o(l)}),error:c=>{console.error(c),o(!1)}})})})()}receiveChatingConfirmation(r,i,s,o){var a=this;return U(function*(){if(i.id===s.id&&i.content===(o.statusName||"wannachat"))return console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","stranger #wannachat status was listen, ignoring and waiting new status..."),Promise.resolve(void 0);console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]",`stranger #${i.content} status was listen.`),r.unsubscribe(),console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","[listenUserStatusUpdate] unsubscribe"),console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","stranger ",s.pubkey," update status: ",i);const l=yield a.talkToStrangerSigner.getPublicUser();return a.isChatingToPubKey(i,l)?(console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]",'is "confirm" status confirming chating, resolved with true'),Promise.resolve(!0)):(console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","unexpected status was given, resolved with false, event: ",i),Promise.resolve(!1))})()}publishWannaChatStatus(r){var i=this;return U(function*(){const s=yield i.nostrEventFactory.createWannaChatUserStatus(r);return console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","updating my status to: ",s),yield i.npool.event(s),Promise.resolve(s)})()}publishChatInviteStatus(r,i){var s=this;return U(function*(){const o=yield s.nostrEventFactory.createChatingUserStatus(r,i);return console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","updating my status to: ",o),yield s.npool.event(o),Promise.resolve(o)})()}deleteUserHistory(){var r=this;return U(function*(){const i=yield r.nostrEventFactory.deleteUserHistory();console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","deleting user history"),yield r.npool.event(i)})()}createSession(){const r=this.talkToStrangerSigner.recreateSession();return this.talkToStrangerSession.saveInList(r.pubkey),console.info((new Date).toLocaleString(),"me: ",r.pubkey),r}endSession(){var r=this;return U(function*(){const i=yield r.nostrEventFactory.createDisconnectedUserStatus();return console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","updating my status to: ",i),yield r.deleteUserHistory(),yield r.npool.event(i),Promise.resolve(i)})()}static \u0275fac=function(i){return new(i||e)(z(CF),z(EF),z(rC),z(Qg),z(DF),z(iC),z(Kg))};static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),SF=(()=>{class e{nostrEventFactory;findStrangerService;talkToStrangerSigner;npool;updateUserCountTimeout=3e5;constructor(r,i,s,o){this.nostrEventFactory=r,this.findStrangerService=i,this.talkToStrangerSigner=s,this.npool=o}getPublicKey(){return this.talkToStrangerSigner.getPublicKey()}getPublicUser(){var r=this;return U(function*(){return r.talkToStrangerSigner.getPublicUser()})()}listenCurrentUser(){return this.talkToStrangerSigner.listenCurrentUser()}openEncryptedDirectMessage(r,i){var s=this;return U(function*(){return s.talkToStrangerSigner.nip04.decrypt(r.pubkey,i.content)})()}listenMessages(r){const i=new Ze;return this.talkToStrangerSigner.getPublicKey().then(s=>{this.npool.observe([{kinds:[Kn.EncryptedDirectMessage],authors:[r.pubkey],"#p":[s]}]).subscribe({next:o=>i.next(o),error:o=>i.error(o),complete:()=>i.complete()})}),i.asObservable()}listenStrangerStatus(r){const i=this.npool.observe([{kinds:[Kn.UserStatuses],authors:[r.pubkey]}]);return i.subscribe(s=>{"disconnected"===s.content&&this.findStrangerService.endSession()}),i}listenCurrenOnlineUsers(){const r=new Ze;let i=!1;const s=()=>{i||(i=!0,console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","user count requested"),this.npool.query([{kinds:[Kn.UserStatuses],"#t":["omegle"],since:Math.floor(Date.now()/1e3)-86400}]).then(a=>{const c=new Set;console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","count events",a),a.forEach(u=>c.add(u.pubkey));const l=[...c].length;console.info((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","active users counted: ",l),r.next(l),i=!1}).catch(a=>{console.error((new Date).toLocaleString(),"["+Math.floor((new Date).getTime()/1e3)+"]","user count lauched error",a),i=!1,clearInterval(o)}))},o=setInterval(s,this.updateUserCountTimeout);return s(),r.asObservable().pipe(Eu(()=>clearInterval(o)))}sendMessage(r,i){var s=this;return U(function*(){yield s.stopTyping();const o=yield s.nostrEventFactory.createEncryptedDirectMessage(r,i);return s.npool.event(o)})()}isTyping(){var r=this;return U(function*(){const i=yield r.nostrEventFactory.createTypingUserStatus();return r.npool.event(i)})()}stopTyping(){var r=this;return U(function*(){const i=yield r.nostrEventFactory.cleanUserStatus();return r.npool.event(i)})()}static \u0275fac=function(i){return new(i||e)(z(CF),z(sC),z(Qg),z(Kg))};static \u0275prov=j({token:e,factory:e.\u0275fac})}return e})(),oie=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275mod=Ot({type:e});static \u0275inj=St({providers:[DF,Kg],imports:[ps]})}return e})(),TF=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275mod=Ot({type:e});static \u0275inj=St({providers:[EF,sC,rC,SF,Qg,iC],imports:[ps,oie]})}return e})(),IF=(()=>{class e{notify(){new Audio("./assets/sound-notification.wav").play()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),aie=(()=>{class e{constructor(){this.authorTypes={[_s.STRANGER]:"Stranger",[_s.YOU]:"You"}}transform(r){return this.authorTypes[r]}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275pipe=fn({name:"author",type:e,pure:!0})}}return e})();const cie=["conversation"];function lie(e,t){1&e&&(fe(0,"div",22),Le(1," You're now chatting with a random stranger. "),me())}function uie(e,t){1&e&&(fe(0,"div",22),Le(1," Looking for someone you can chat with. "),me())}function die(e,t){if(1&e&&(fe(0,"span",26),vf(),fe(1,"svg",27),or(2,"path",7)(3,"path",28),me(),_f(),fe(4,"span",29),Le(5),me()()),2&e){const r=Ct().$implicit;be(5),Qa(r[1])}}function fie(e,t){if(1&e&&(fe(0,"div",23)(1,"span"),Le(2),function WA(e,t){const r=we();let i;const s=e+Y;r.firstCreatePass?(i=function dH(e,t){if(t)for(let r=t.length-1;r>=0;r--){const i=t[r];if(e===i.name)return i}}(t,r.pipeRegistry),r.data[s]=i,i.onDestroy&&(r.destroyHooks??=[]).push(s,i.onDestroy)):i=r.data[s];const o=i.factory||(i.factory=Ks(i.type)),c=Sn(k);try{const l=Cf(!1),u=o();return Cf(l),function D0(e,t,r,i){r>=e.data.length&&(e.data[r]=null,e.blueprint[r]=null),t[r]=i}(r,N(),s,u),u}finally{Sn(c)}}(3,"author"),me(),fe(4,"span",24),Le(5),me(),sr(6,die,6,1,"span",25),me()),2&e){const r=t.$implicit,i=Ct();be(),Ql("authorStranger",r[0].author===i.authorStranger)("authorYou",r[0].author===i.authorYou),be(),Xr("",ZA(3,7,r[0].author),": "),be(3),Qa(r[0].text),be(),qe("ngIf",r[1])}}function hie(e,t){1&e&&(fe(0,"div",22),Le(1," Stranger is typing... "),me())}function pie(e,t){1&e&&(fe(0,"div",22),Le(1,"Stranger has disconnected."),me())}function gie(e,t){1&e&&(fe(0,"div",22),Le(1,"You have disconnected."),me())}function mie(e,t){if(1&e&&(Ga(0),sr(1,pie,2,0,"div",13)(2,gie,2,0,"div",13),Wa()),2&e){const r=Ct();be(),qe("ngIf",r.whoDisconnected===r.authorStranger),be(),qe("ngIf",r.whoDisconnected===r.authorYou)}}function yie(e,t){if(1&e){const r=Jr();fe(0,"button",30),$e("click",function(){return Kt(r),Qt(Ct().findStranger())}),Le(1," Start "),me()}}function vie(e,t){if(1&e){const r=Jr();fe(0,"button",31),$e("click",function(){return Kt(r),Qt(Ct().stopSearching())}),Le(1," Stop "),me()}}function _ie(e,t){if(1&e){const r=Jr();fe(0,"button",31),$e("click",function(){Kt(r);const s=Ct();return Qt(s.currentState=s.stateUpToDisconnect)}),Le(1," Stop "),me()}}function wie(e,t){if(1&e){const r=Jr();fe(0,"button",32),$e("click",function(){Kt(r);const s=Ct(),o=Ka(24);return s.endSession(),Qt(s.cleanMessageField(o))}),Le(1," Really? "),me()}}const bie=[{path:"chat",component:(()=>{class e{constructor(r,i,s,o,a){this.globalErrorHandler=r,this.findStrangerParody=i,this.talkToStrangerParody=s,this.soundNotificationService=o,this.modalService=a,this.stateConnected=Fi.CONNECTED,this.stateUpToDisconnect=Fi.UP_TO_DISCONNECT,this.stateDisconnected=Fi.DISCONNECTED,this.stateSearchingStranger=Fi.SEARCHING_STRANGER,this.authorStranger=_s.STRANGER,this.authorYou=_s.YOU,this.typingTimeoutAmount=2e3,this.typingTimeoutId=0,this.currentOnline=1,this.strangerIsTyping=!1,this.currentState=Fi.DISCONNECTED,this.whoDisconnected=null,this.stranger=null,this.messages=[],this.controller=new AbortController,this.subscriptions=new vt}ngOnInit(){this.countStrangers()}countStrangers(){this.subscriptions.add(this.talkToStrangerParody.listenCurrenOnlineUsers().subscribe(r=>this.currentOnline=r||1))}ngOnDestroy(){this.subscriptions.unsubscribe()}onBeforeUnload(){var r=this;return U(function*(){return yield r.endSession(),!0})()}configRelays(){this.modalService.createModal(MQ).build()}findStranger(){this.whoDisconnected=null,this.currentState=this.stateSearchingStranger,this.messages=[],this.findStrangerParody.searchStranger({signal:this.controller.signal,searchTags:["omegle"],userTags:["omegle"]}).then(r=>this.startConversation(r)).catch(r=>{throw console.error((new Date).toLocaleString(),r),this.clearSession(),r})}clearSession(){this.currentState=Fi.DISCONNECTED,this.strangerIsTyping=!1,this.whoDisconnected=null,this.stranger=null,this.subscriptions.unsubscribe(),this.subscriptions=new vt}endSession(){return this.findStrangerParody.endSession().then(()=>this.clearSession())}startConversation(r){console.log((new Date).toLocaleString(),"starting conversation, stranger: ",r),this.stranger=r,this.currentState=Fi.CONNECTED,1===this.currentOnline&&(this.currentOnline=2),this.soundNotificationService.notify(),this.subscriptions.add(this.talkToStrangerParody.listenMessages(r).subscribe({next:i=>this.addMessageFromStranger(r,i)})),this.subscriptions.add(this.talkToStrangerParody.listenStrangerStatus(r).subscribe({next:i=>this.handleStrangerStatus(i)}))}addMessageFromStranger(r,i){this.talkToStrangerParody.openEncryptedDirectMessage(r,i).then(s=>{this.messages.push([{text:s,author:_s.STRANGER,time:i.created_at},null]),this.scrollConversationToTheEnd()})}handleStrangerStatus(r){"typing"===r.content?(this.strangerIsTyping=!0,this.scrollConversationToTheEnd()):"disconnected"===r.content?(this.strangerIsTyping=!1,this.whoDisconnected=_s.STRANGER,this.currentState=Fi.DISCONNECTED,this.endSession()):this.strangerIsTyping=!1}sendMessage(r){var i=this;return U(function*(){const s=i.stranger;if(s&&r.length){const o=[{author:_s.YOU,text:r,time:Math.floor((new Date).getTime()/1e3)},null];i.messages.push(o),i.scrollConversationToTheEnd();try{const a=i.talkToStrangerParody.stopTyping(),c=i.talkToStrangerParody.sendMessage(s,r);yield Promise.all([a,c])}catch(a){o[1]=i.globalErrorHandler.getErrorMessage(a).join("; ")}}})()}scrollConversationToTheEnd(){setTimeout(()=>{const r=this.conversationEl.nativeElement;r.scrollTo({top:r.scrollHeight,behavior:"smooth"})})}cleanMessageField(r){setTimeout(()=>r.value="")}stopSearching(){this.controller.abort(),this.endSession()}onTyping(){this.typingTimeoutId||this.talkToStrangerParody.isTyping(),clearTimeout(this.typingTimeoutId),this.typingTimeoutId=Number(setTimeout(()=>{this.talkToStrangerParody.stopTyping(),this.typingTimeoutId=0},this.typingTimeoutAmount))}static{this.\u0275fac=function(i){return new(i||e)(k(Iw),k(sC),k(SF),k(IF),k(OO))}}static{this.\u0275cmp=ts({type:e,selectors:[["omg-chat"]],viewQuery:function(i,s){if(1&i&&C0(cie,5),2&i){let o;Sh(o=Th())&&(s.conversationEl=o.first)}},hostBindings:function(i,s){1&i&&$e("beforeunload",function(){return s.onBeforeUnload()},0,FT)},decls:28,vars:12,consts:[["conversation",""],["messageField",""],["send",""],[1,"navbar"],["src","./assets/logo.png","alt","logo",1,"logo"],[1,"description"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"config",3,"click"],["stroke","none","d","M0 0h24v24H0z","fill","none"],["d","M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z"],["d","M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0"],[1,"online"],[1,"main"],[1,"conversation"],["class","message",4,"ngIf"],["class","chat",4,"ngFor","ngForOf"],[4,"ngIf"],["novalidate","","autocomplete","off",1,"form"],["type","button","class","btn start bottomLeftRadius",3,"click",4,"ngIf"],["type","button","class","btn bottomLeftRadius",3,"click",4,"ngIf"],["type","button","class","btn bottomLeftRadius bold",3,"click",4,"ngIf"],["name","text",1,"textarea",3,"keydown.enter","keydown"],["type","button",1,"btn","bottomRightRadius",3,"click"],[1,"message"],[1,"chat"],[1,"text"],["class","errorWrap",4,"ngIf"],[1,"errorWrap"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","currentColor",1,"messageNotSent"],["d","M17 3.34a10 10 0 1 1 -15 8.66l.005 -.324a10 10 0 0 1 14.995 -8.336m-5 11.66a1 1 0 0 0 -1 1v.01a1 1 0 0 0 2 0v-.01a1 1 0 0 0 -1 -1m0 -7a1 1 0 0 0 -1 1v4a1 1 0 0 0 2 0v-4a1 1 0 0 0 -1 -1"],[1,"errorMessage"],["type","button",1,"btn","start","bottomLeftRadius",3,"click"],["type","button",1,"btn","bottomLeftRadius",3,"click"],["type","button",1,"btn","bottomLeftRadius","bold",3,"click"]],template:function(i,s){if(1&i){const o=Jr();fe(0,"section",3),or(1,"img",4),fe(2,"h2",5),Le(3,"Talk to strangers!"),me(),vf(),fe(4,"svg",6),$e("click",function(){return Kt(o),Qt(s.configRelays())}),or(5,"path",7)(6,"path",8)(7,"path",9),me(),_f(),fe(8,"h2",10),Le(9),me()(),fe(10,"main",11)(11,"section",12,0),sr(13,lie,2,0,"div",13)(14,uie,2,0,"div",13)(15,fie,7,9,"div",14)(16,hie,2,0,"div",13)(17,mie,3,2,"ng-container",15),me(),fe(18,"form",16),sr(19,yie,2,0,"button",17)(20,vie,2,0,"button",18)(21,_ie,2,0,"button",18)(22,wie,2,0,"button",19),fe(23,"textarea",20,1),$e("keydown.enter",function(){Kt(o);const c=Ka(24);return s.sendMessage(c.value),Qt(s.cleanMessageField(c))})("keydown",function(){return Kt(o),Qt(s.onTyping())}),me(),fe(25,"button",21,2),$e("click",function(){Kt(o);const c=Ka(24);return s.sendMessage(c.value),Qt(s.cleanMessageField(c))}),Le(27," Send "),me()()()}2&i&&(be(9),Qa(s.currentOnline),be(4),qe("ngIf",s.stranger),be(),qe("ngIf",!s.stranger&&s.currentState===s.stateSearchingStranger),be(),qe("ngForOf",s.messages),be(),qe("ngIf",s.strangerIsTyping),be(),qe("ngIf",s.currentState===s.stateDisconnected),be(2),qe("ngIf",s.currentState===s.stateDisconnected),be(),qe("ngIf",s.currentState===s.stateSearchingStranger),be(),qe("ngIf",s.currentState===s.stateConnected),be(),qe("ngIf",s.currentState===s.stateUpToDisconnect),be(),on("disabled",s.currentState===s.stateDisconnected||s.currentState===s.stateSearchingStranger?"disabled":null),be(2),on("disabled",s.currentState===s.stateDisconnected||s.currentState===s.stateSearchingStranger?"disabled":null))},dependencies:[a_,ip,aie],encapsulation:2})}}return e})()},{path:"",redirectTo:"chat",pathMatch:"full"}];let Eie=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({imports:[MO.forRoot(bie,{useHash:!0}),MO]})}}return e})();var le=function(e){return e[e.State=0]="State",e[e.Transition=1]="Transition",e[e.Sequence=2]="Sequence",e[e.Group=3]="Group",e[e.Animate=4]="Animate",e[e.Keyframes=5]="Keyframes",e[e.Style=6]="Style",e[e.Trigger=7]="Trigger",e[e.Reference=8]="Reference",e[e.AnimateChild=9]="AnimateChild",e[e.AnimateRef=10]="AnimateRef",e[e.Query=11]="Query",e[e.Stagger=12]="Stagger",e}(le||{});const Qi="*";function Cie(e,t){return{type:le.Trigger,name:e,definitions:t,options:{}}}function xF(e,t=null){return{type:le.Animate,styles:t,timings:e}}function Cd(e){return{type:le.Style,styles:e,offset:null}}function oC(e,t,r){return{type:le.State,name:e,styles:t,options:r}}function AF(e,t,r=null){return{type:le.Transition,expr:e,animation:t,options:r}}class Dd{constructor(t=0,r=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._originalOnDoneFns=[],this._originalOnStartFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=t+r}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}onStart(t){this._originalOnStartFns.push(t),this._onStartFns.push(t)}onDone(t){this._originalOnDoneFns.push(t),this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(t){this._position=this.totalTime?t*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(t){const r="start"==t?this._onStartFns:this._onDoneFns;r.forEach(i=>i()),r.length=0}}class MF{constructor(t){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=t;let r=0,i=0,s=0;const o=this.players.length;0==o?queueMicrotask(()=>this._onFinish()):this.players.forEach(a=>{a.onDone(()=>{++r==o&&this._onFinish()}),a.onDestroy(()=>{++i==o&&this._onDestroy()}),a.onStart(()=>{++s==o&&this._onStart()})}),this.totalTime=this.players.reduce((a,c)=>Math.max(a,c.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this.players.forEach(t=>t.init())}onStart(t){this._onStartFns.push(t)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(t=>t()),this._onStartFns=[])}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(t=>t.play())}pause(){this.players.forEach(t=>t.pause())}restart(){this.players.forEach(t=>t.restart())}finish(){this._onFinish(),this.players.forEach(t=>t.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(t=>t.destroy()),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this.players.forEach(t=>t.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(t){const r=t*this.totalTime;this.players.forEach(i=>{const s=i.totalTime?Math.min(1,r/i.totalTime):1;i.setPosition(s)})}getPosition(){const t=this.players.reduce((r,i)=>null===r||i.totalTime>r.totalTime?i:r,null);return null!=t?t.getPosition():0}beforeDestroy(){this.players.forEach(t=>{t.beforeDestroy&&t.beforeDestroy()})}triggerCallback(t){const r="start"==t?this._onStartFns:this._onDoneFns;r.forEach(i=>i()),r.length=0}}const NF=["toast-component",""];function Aie(e,t){if(1&e){const r=Jr();fe(0,"button",5),$e("click",function(){return Kt(r),Qt(Ct().remove())}),fe(1,"span",6),Le(2,"\xd7"),me()()}}function Mie(e,t){if(1&e&&(Ga(0),Le(1),Wa()),2&e){const r=Ct(2);be(),Xr("[",r.duplicatesCount+1,"]")}}function Nie(e,t){if(1&e&&(fe(0,"div"),Le(1),sr(2,Mie,2,1,"ng-container",4),me()),2&e){const r=Ct();Ni(r.options.titleClass),on("aria-label",r.title),be(),Xr(" ",r.title," "),be(),qe("ngIf",r.duplicatesCount)}}function Rie(e,t){if(1&e&&or(0,"div",7),2&e){const r=Ct();Ni(r.options.messageClass),qe("innerHTML",r.message,Xy)}}function Oie(e,t){if(1&e&&(fe(0,"div",8),Le(1),me()),2&e){const r=Ct();Ni(r.options.messageClass),on("aria-label",r.message),be(),Xr(" ",r.message," ")}}function kie(e,t){if(1&e&&(fe(0,"div"),or(1,"div",9),me()),2&e){const r=Ct();be(),vo("width",r.width()+"%")}}class jie{_attachedHost;component;viewContainerRef;injector;constructor(t,r){this.component=t,this.injector=r}attach(t,r){return this._attachedHost=t,t.attach(this,r)}detach(){const t=this._attachedHost;if(t)return this._attachedHost=void 0,t.detach()}get isAttached(){return null!=this._attachedHost}setAttachedHost(t){this._attachedHost=t}}class $ie{_attachedPortal;_disposeFn;attach(t,r){return this._attachedPortal=t,this.attachComponentPortal(t,r)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(t){this._disposeFn=t}}class Hie{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new Ze;_activate=new Ze;_manualClose=new Ze;_resetTimeout=new Ze;_countDuplicate=new Ze;constructor(t){this._overlayRef=t}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(t,r){t&&this._resetTimeout.next(),r&&this._countDuplicate.next(++this.duplicatesCount)}}class Yg{toastId;config;message;title;toastType;toastRef;_onTap=new Ze;_onAction=new Ze;constructor(t,r,i,s,o,a){this.toastId=t,this.config=r,this.message=i,this.title=s,this.toastType=o,this.toastRef=a,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(t){this._onAction.next(t)}onAction(){return this._onAction.asObservable()}}const OF=new q("ToastConfig");class zie extends $ie{_hostDomElement;_componentFactoryResolver;_appRef;constructor(t,r,i){super(),this._hostDomElement=t,this._componentFactoryResolver=r,this._appRef=i}attachComponentPortal(t,r){const i=this._componentFactoryResolver.resolveComponentFactory(t.component);let s;return s=i.create(t.injector),this._appRef.attachView(s.hostView),this.setDisposeFn(()=>{this._appRef.detachView(s.hostView),s.destroy()}),r?this._hostDomElement.insertBefore(this._getComponentRootNode(s),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(s)),s}_getComponentRootNode(t){return t.hostView.rootNodes[0]}}let qie=(()=>{class e{_document=O(an);_containerElement;ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){const r=this._document.createElement("div");r.classList.add("overlay-container"),r.setAttribute("aria-live","polite"),this._document.body.appendChild(r),this._containerElement=r}static \u0275fac=function(i){return new(i||e)};static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();class Gie{_portalHost;constructor(t){this._portalHost=t}attach(t,r=!0){return this._portalHost.attach(t,r)}detach(){return this._portalHost.detach()}}let Wie=(()=>{class e{_overlayContainer=O(qie);_componentFactoryResolver=O(Vl);_appRef=O(ar);_document=O(an);_paneElements=new Map;create(r,i){return this._createOverlayRef(this.getPaneElement(r,i))}getPaneElement(r="",i){return this._paneElements.get(i)||this._paneElements.set(i,{}),this._paneElements.get(i)[r]||(this._paneElements.get(i)[r]=this._createPaneElement(r,i)),this._paneElements.get(i)[r]}_createPaneElement(r,i){const s=this._document.createElement("div");return s.id="toast-container",s.classList.add(r),s.classList.add("toast-container"),i?i.getContainerElement().appendChild(s):this._overlayContainer.getContainerElement().appendChild(s),s}_createPortalHost(r){return new zie(r,this._componentFactoryResolver,this._appRef)}_createOverlayRef(r){return new Gie(this._createPortalHost(r))}static \u0275fac=function(i){return new(i||e)};static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),cC=(()=>{class e{overlay;_injector;sanitizer;ngZone;toastrConfig;currentlyActive=0;toasts=[];overlayContainer;previousToastMessage;index=0;constructor(r,i,s,o,a){this.overlay=i,this._injector=s,this.sanitizer=o,this.ngZone=a,this.toastrConfig={...r.default,...r.config},r.config.iconClasses&&(this.toastrConfig.iconClasses={...r.default.iconClasses,...r.config.iconClasses})}show(r,i,s={},o=""){return this._preBuildNotification(o,r,i,this.applyConfig(s))}success(r,i,s={}){return this._preBuildNotification(this.toastrConfig.iconClasses.success||"",r,i,this.applyConfig(s))}error(r,i,s={}){return this._preBuildNotification(this.toastrConfig.iconClasses.error||"",r,i,this.applyConfig(s))}info(r,i,s={}){return this._preBuildNotification(this.toastrConfig.iconClasses.info||"",r,i,this.applyConfig(s))}warning(r,i,s={}){return this._preBuildNotification(this.toastrConfig.iconClasses.warning||"",r,i,this.applyConfig(s))}clear(r){for(const i of this.toasts)if(void 0!==r){if(i.toastId===r)return void i.toastRef.manualClose()}else i.toastRef.manualClose()}remove(r){const i=this._findToast(r);if(!i||(i.activeToast.toastRef.close(),this.toasts.splice(i.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length))return!1;if(this.currentlyActivethis._buildNotification(r,i,s,o)):this._buildNotification(r,i,s,o)}_buildNotification(r,i,s,o){if(!o.toastComponent)throw new Error("toastComponent required");const a=this.findDuplicate(s,i,this.toastrConfig.resetTimeoutOnDuplicate&&o.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&s||i)&&this.toastrConfig.preventDuplicates&&null!==a)return a;this.previousToastMessage=i;let c=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(c=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));const l=this.overlay.create(o.positionClass,this.overlayContainer);this.index=this.index+1;let u=i;i&&o.enableHtml&&(u=this.sanitizer.sanitize(Hn.HTML,i));const d=new Hie(l),f=new Yg(this.index,o,u,s,r,d),p=xt.create({providers:[{provide:Yg,useValue:f}],parent:this._injector}),g=new jie(o.toastComponent,p),m=l.attach(g,o.newestOnTop);d.componentInstance=m.instance;const y={toastId:this.index,title:s||"",message:i||"",toastRef:d,onShown:d.afterActivate(),onHidden:d.afterClosed(),onTap:f.onTap(),onAction:f.onAction(),portal:m};return c||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{y.toastRef.activate()})),this.toasts.push(y),y}static \u0275fac=function(i){return new(i||e)(z(OF),z(Wie),z(xt),z(rR),z(Ne))};static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const Zie={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing",toastComponent:(()=>{class e{toastrService;toastPackage;ngZone;message;title;options;duplicatesCount;originalTimeout;width=Zr(-1);toastClasses="";state;get _state(){return this.state()}get displayStyle(){if("inactive"===this.state().value)return"none"}timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(r,i,s){this.toastrService=r,this.toastPackage=i,this.ngZone=s,this.message=i.message,this.title=i.title,this.options=i.config,this.originalTimeout=i.config.timeOut,this.toastClasses=`${i.toastType} ${i.config.toastClass}`,this.sub=i.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=i.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=i.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=i.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o}),this.state=Zr({value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.update(r=>({...r,value:"active"})),!0!==this.options.disableTimeOut&&"timeOut"!==this.options.disableTimeOut&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=(new Date).getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(0===this.width()||100===this.width()||!this.options.timeOut)return;const r=(new Date).getTime();this.width.set((this.hideTime-r)/this.options.timeOut*100),"increasing"===this.options.progressAnimation&&this.width.update(s=>100-s),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.update(r=>({...r,value:"active"})),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){"removed"!==this.state().value&&(clearTimeout(this.timeout),this.state.update(r=>({...r,value:"removed"})),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){"removed"!==this.state().value&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){"removed"!==this.state().value&&"extendedTimeOut"!==this.options.disableTimeOut&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){!0===this.options.disableTimeOut||"extendedTimeOut"===this.options.disableTimeOut||0===this.options.extendedTimeOut||"removed"===this.state().value||(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(r,i){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(r),i)):this.timeout=setTimeout(()=>r(),i)}outsideInterval(r,i){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(r),i)):this.intervalId=setInterval(()=>r(),i)}runInsideAngular(r){this.ngZone?this.ngZone.run(()=>r()):r()}static \u0275fac=function(i){return new(i||e)(k(cC),k(Yg),k(Ne))};static \u0275cmp=ts({type:e,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(i,s){1&i&&$e("click",function(){return s.tapToast()})("mouseenter",function(){return s.stickAround()})("mouseleave",function(){return s.delayedHideToast()}),2&i&&(v0("@flyInOut",s._state),Ni(s.toastClasses),vo("display",s.displayStyle))},standalone:!0,features:[Ih],attrs:NF,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(i,s){1&i&&sr(0,Aie,3,0,"button",0)(1,Nie,3,5,"div",1)(2,Rie,1,3,"div",2)(3,Oie,2,4,"div",3)(4,kie,2,2,"div",4),2&i&&(qe("ngIf",s.options.closeButton),be(),qe("ngIf",s.title),be(),qe("ngIf",s.message&&s.options.enableHtml),be(),qe("ngIf",s.message&&!s.options.enableHtml),be(),qe("ngIf",s.options.progressBar))},dependencies:[ip],encapsulation:2,data:{animation:[Cie("flyInOut",[oC("inactive",Cd({opacity:0})),oC("active",Cd({opacity:1})),oC("removed",Cd({opacity:0})),AF("inactive => active",xF("{{ easeTime }}ms {{ easing }}")),AF("active => removed",xF("{{ easeTime }}ms {{ easing }}"))])]},changeDetection:0})}return e})()},Kie=(e={})=>function tl(e){return{\u0275providers:e}}([{provide:OF,useValue:{default:Zie,config:e}}]);let Qie=(()=>{class e{static forRoot(r={}){return{ngModule:e,providers:[Kie(r)]}}static \u0275fac=function(i){return new(i||e)};static \u0275mod=Ot({type:e});static \u0275inj=St({})}return e})(),Yie=(()=>{class e{constructor(r,i){this.error$=r,this.toastrService=i,this.subscriptions=new vt}ngOnInit(){this.subscriptions.add(this.error$.subscribe(r=>this.toastrService.error(r)))}ngOnDestroy(){this.subscriptions.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)(k(Tw),k(cC))}}static{this.\u0275cmp=ts({type:e,selectors:[["app-root"]],decls:2,vars:0,template:function(i,s){1&i&&or(0,"modal-outlet")(1,"router-outlet")},dependencies:[q_,DK],encapsulation:2})}}return e})(),Jie=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({providers:[rw],imports:[ps,xQ]})}}return e})(),Xie=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({providers:[IF],imports:[ps]})}}return e})(),ese=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({imports:[ps,Xie,Jie]})}}return e})(),tse=(()=>{class e{constructor(r){this.relayConfigService=r}open(r){return new Qre(r)}reqRouter(r){var i=this;return U(function*(){const s=[];return i.relayConfigService.getConfig().forEach(o=>s.push([o,r])),new Map(s)})()}eventRouter(){var r=this;return U(function*(){return r.relayConfigService.getConfig()})()}static{this.\u0275fac=function(i){return new(i||e)(z(rw))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})(),nse=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({providers:[{provide:bF,useClass:tse}],imports:[ps,TF,TF]})}}return e})();function kF(e){return new A(3e3,!1)}function qs(e){switch(e.length){case 0:return new Dd;case 1:return e[0];default:return new MF(e)}}function PF(e,t,r=new Map,i=new Map){const s=[],o=[];let a=-1,c=null;if(t.forEach(l=>{const u=l.get("offset"),d=u==a,f=d&&c||new Map;l.forEach((h,p)=>{let g=p,m=h;if("offset"!==p)switch(g=e.normalizePropertyName(g,s),m){case"!":m=r.get(p);break;case Qi:m=i.get(p);break;default:m=e.normalizeStyleValue(p,g,m,s)}f.set(g,m)}),d||o.push(f),c=f,a=u}),s.length)throw function Sse(){return new A(3502,!1)}();return o}function lC(e,t,r,i){switch(t){case"start":e.onStart(()=>i(r&&uC(r,"start",e)));break;case"done":e.onDone(()=>i(r&&uC(r,"done",e)));break;case"destroy":e.onDestroy(()=>i(r&&uC(r,"destroy",e)))}}function uC(e,t,r){const o=dC(e.element,e.triggerName,e.fromState,e.toState,t||e.phaseName,r.totalTime??e.totalTime,!!r.disabled),a=e._data;return null!=a&&(o._data=a),o}function dC(e,t,r,i,s="",o=0,a){return{element:e,triggerName:t,fromState:r,toState:i,phaseName:s,totalTime:o,disabled:!!a}}function Yn(e,t,r){let i=e.get(t);return i||e.set(t,i=r),i}function LF(e){const t=e.indexOf(":");return[e.substring(1,t),e.slice(t+1)]}const Fse=typeof document>"u"?null:document.documentElement;function fC(e){const t=e.parentNode||e.host||null;return t===Fse?null:t}let Go=null,FF=!1;function BF(e,t){for(;t;){if(t===e)return!0;t=fC(t)}return!1}function VF(e,t,r){if(r)return Array.from(e.querySelectorAll(t));const i=e.querySelector(t);return i?[i]:[]}let hC=(()=>{class e{validateStyleProperty(r){return function Vse(e){Go||(Go=function Use(){return typeof document<"u"?document.body:null}()||{},FF=!!Go.style&&"WebkitAppearance"in Go.style);let t=!0;return Go.style&&!function Bse(e){return"ebkit"==e.substring(1,6)}(e)&&(t=e in Go.style,!t&&FF&&(t="Webkit"+e.charAt(0).toUpperCase()+e.slice(1)in Go.style)),t}(r)}containsElement(r,i){return BF(r,i)}getParentElement(r){return fC(r)}query(r,i,s){return VF(r,i,s)}computeStyle(r,i,s){return s||""}animate(r,i,s,o,a,c=[],l){return new Dd(s,o)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})();class pC{static{this.NOOP=new hC}}class gC{}const $se=1e3,mC="ng-enter",Jg="ng-leave",Xg="ng-trigger",em=".ng-trigger",jF="ng-animating",yC=".ng-animating";function Yi(e){if("number"==typeof e)return e;const t=e.match(/^(-?[\.\d]+)(m?s)/);return!t||t.length<2?0:vC(parseFloat(t[1]),t[2])}function vC(e,t){return"s"===t?e*$se:e}function tm(e,t,r){return e.hasOwnProperty("duration")?e:function zse(e,t,r){let s,o=0,a="";if("string"==typeof e){const c=e.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===c)return t.push(kF()),{duration:0,delay:0,easing:""};s=vC(parseFloat(c[1]),c[2]);const l=c[3];null!=l&&(o=vC(parseFloat(l),c[4]));const u=c[5];u&&(a=u)}else s=e;if(!r){let c=!1,l=t.length;s<0&&(t.push(function rse(){return new A(3100,!1)}()),c=!0),o<0&&(t.push(function ise(){return new A(3101,!1)}()),c=!0),c&&t.splice(l,0,kF())}return{duration:s,delay:o,easing:a}}(e,t,r)}function _i(e,t,r){t.forEach((i,s)=>{const o=wC(s);r&&!r.has(s)&&r.set(s,e.style[o]),e.style[o]=i})}function Wo(e,t){t.forEach((r,i)=>{const s=wC(i);e.style[s]=""})}function Sd(e){return Array.isArray(e)?1==e.length?e[0]:function Die(e,t=null){return{type:le.Sequence,steps:e,options:t}}(e):e}const _C=new RegExp("{{\\s*(.+?)\\s*}}","g");function HF(e){let t=[];if("string"==typeof e){let r;for(;r=_C.exec(e);)t.push(r[1]);_C.lastIndex=0}return t}function Td(e,t,r){const i=`${e}`,s=i.replace(_C,(o,a)=>{let c=t[a];return null==c&&(r.push(function ose(){return new A(3003,!1)}()),c=""),c.toString()});return s==i?e:s}const Wse=/-+([a-z0-9])/g;function wC(e){return e.replace(Wse,(...t)=>t[1].toUpperCase())}function Jn(e,t,r){switch(t.type){case le.Trigger:return e.visitTrigger(t,r);case le.State:return e.visitState(t,r);case le.Transition:return e.visitTransition(t,r);case le.Sequence:return e.visitSequence(t,r);case le.Group:return e.visitGroup(t,r);case le.Animate:return e.visitAnimate(t,r);case le.Keyframes:return e.visitKeyframes(t,r);case le.Style:return e.visitStyle(t,r);case le.Reference:return e.visitReference(t,r);case le.AnimateChild:return e.visitAnimateChild(t,r);case le.AnimateRef:return e.visitAnimateRef(t,r);case le.Query:return e.visitQuery(t,r);case le.Stagger:return e.visitStagger(t,r);default:throw function ase(){return new A(3004,!1)}()}}function bC(e,t){return window.getComputedStyle(e)[t]}const Qse=new Set(["width","height","minWidth","minHeight","maxWidth","maxHeight","left","top","bottom","right","fontSize","outlineWidth","outlineOffset","paddingTop","paddingLeft","paddingBottom","paddingRight","marginTop","marginLeft","marginBottom","marginRight","borderRadius","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","textIndent","perspective"]);class zF extends gC{normalizePropertyName(t,r){return wC(t)}normalizeStyleValue(t,r,i,s){let o="";const a=i.toString().trim();if(Qse.has(r)&&0!==i&&"0"!==i)if("number"==typeof i)o="px";else{const c=i.match(/^[+-]?[\d\.]+([a-z]*)$/);c&&0==c[1].length&&s.push(function cse(){return new A(3005,!1)}())}return a+o}}const nm="*";const rm=new Set(["true","1"]),im=new Set(["false","0"]);function qF(e,t){const r=rm.has(e)||im.has(e),i=rm.has(t)||im.has(t);return(s,o)=>{let a=e==nm||e==s,c=t==nm||t==o;return!a&&r&&"boolean"==typeof s&&(a=s?rm.has(e):im.has(e)),!c&&i&&"boolean"==typeof o&&(c=o?rm.has(t):im.has(t)),a&&c}}const eoe=new RegExp("s*:selfs*,?","g");function EC(e,t,r,i){return new toe(e).build(t,r,i)}class toe{constructor(t){this._driver=t}build(t,r,i){const s=new ioe(r);return this._resetContextStyleTimingState(s),Jn(this,Sd(t),s)}_resetContextStyleTimingState(t){t.currentQuerySelector="",t.collectedStyles=new Map,t.collectedStyles.set("",new Map),t.currentTime=0}visitTrigger(t,r){let i=r.queryCount=0,s=r.depCount=0;const o=[],a=[];return"@"==t.name.charAt(0)&&r.errors.push(function lse(){return new A(3006,!1)}()),t.definitions.forEach(c=>{if(this._resetContextStyleTimingState(r),c.type==le.State){const l=c,u=l.name;u.toString().split(/\s*,\s*/).forEach(d=>{l.name=d,o.push(this.visitState(l,r))}),l.name=u}else if(c.type==le.Transition){const l=this.visitTransition(c,r);i+=l.queryCount,s+=l.depCount,a.push(l)}else r.errors.push(function use(){return new A(3007,!1)}())}),{type:le.Trigger,name:t.name,states:o,transitions:a,queryCount:i,depCount:s,options:null}}visitState(t,r){const i=this.visitStyle(t.styles,r),s=t.options&&t.options.params||null;if(i.containsDynamicStyles){const o=new Set,a=s||{};i.styles.forEach(c=>{c instanceof Map&&c.forEach(l=>{HF(l).forEach(u=>{a.hasOwnProperty(u)||o.add(u)})})}),o.size&&r.errors.push(function dse(){return new A(3008,!1)}(0,o.values()))}return{type:le.State,name:t.name,style:i,options:s?{params:s}:null}}visitTransition(t,r){r.queryCount=0,r.depCount=0;const i=Jn(this,Sd(t.animation),r),s=function Yse(e,t){const r=[];return"string"==typeof e?e.split(/\s*,\s*/).forEach(i=>function Jse(e,t,r){if(":"==e[0]){const l=function Xse(e,t){switch(e){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(r,i)=>parseFloat(i)>parseFloat(r);case":decrement":return(r,i)=>parseFloat(i) *"}}(e,r);if("function"==typeof l)return void t.push(l);e=l}const i=e.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return r.push(function wse(){return new A(3015,!1)}()),t;const s=i[1],o=i[2],a=i[3];t.push(qF(s,a)),"<"==o[0]&&(s!=nm||a!=nm)&&t.push(qF(a,s))}(i,r,t)):r.push(e),r}(t.expr,r.errors);return{type:le.Transition,matchers:s,animation:i,queryCount:r.queryCount,depCount:r.depCount,options:Zo(t.options)}}visitSequence(t,r){return{type:le.Sequence,steps:t.steps.map(i=>Jn(this,i,r)),options:Zo(t.options)}}visitGroup(t,r){const i=r.currentTime;let s=0;const o=t.steps.map(a=>{r.currentTime=i;const c=Jn(this,a,r);return s=Math.max(s,r.currentTime),c});return r.currentTime=s,{type:le.Group,steps:o,options:Zo(t.options)}}visitAnimate(t,r){const i=function ooe(e,t){if(e.hasOwnProperty("duration"))return e;if("number"==typeof e)return CC(tm(e,t).duration,0,"");const r=e;if(r.split(/\s+/).some(o=>"{"==o.charAt(0)&&"{"==o.charAt(1))){const o=CC(0,0,"");return o.dynamic=!0,o.strValue=r,o}const s=tm(r,t);return CC(s.duration,s.delay,s.easing)}(t.timings,r.errors);r.currentAnimateTimings=i;let s,o=t.styles?t.styles:Cd({});if(o.type==le.Keyframes)s=this.visitKeyframes(o,r);else{let a=t.styles,c=!1;if(!a){c=!0;const u={};i.easing&&(u.easing=i.easing),a=Cd(u)}r.currentTime+=i.duration+i.delay;const l=this.visitStyle(a,r);l.isEmptyStep=c,s=l}return r.currentAnimateTimings=null,{type:le.Animate,timings:i,style:s,options:null}}visitStyle(t,r){const i=this._makeStyleAst(t,r);return this._validateStyleAst(i,r),i}_makeStyleAst(t,r){const i=[],s=Array.isArray(t.styles)?t.styles:[t.styles];for(let c of s)"string"==typeof c?c===Qi?i.push(c):r.errors.push(new A(3002,!1)):i.push(new Map(Object.entries(c)));let o=!1,a=null;return i.forEach(c=>{if(c instanceof Map&&(c.has("easing")&&(a=c.get("easing"),c.delete("easing")),!o))for(let l of c.values())if(l.toString().indexOf("{{")>=0){o=!0;break}}),{type:le.Style,styles:i,easing:a,offset:t.offset,containsDynamicStyles:o,options:null}}_validateStyleAst(t,r){const i=r.currentAnimateTimings;let s=r.currentTime,o=r.currentTime;i&&o>0&&(o-=i.duration+i.delay),t.styles.forEach(a=>{"string"!=typeof a&&a.forEach((c,l)=>{const u=r.collectedStyles.get(r.currentQuerySelector),d=u.get(l);let f=!0;d&&(o!=s&&o>=d.startTime&&s<=d.endTime&&(r.errors.push(function hse(){return new A(3010,!1)}()),f=!1),o=d.startTime),f&&u.set(l,{startTime:o,endTime:s}),r.options&&function Gse(e,t,r){const i=t.params||{},s=HF(e);s.length&&s.forEach(o=>{i.hasOwnProperty(o)||r.push(function sse(){return new A(3001,!1)}())})}(c,r.options,r.errors)})})}visitKeyframes(t,r){const i={type:le.Keyframes,styles:[],options:null};if(!r.currentAnimateTimings)return r.errors.push(function pse(){return new A(3011,!1)}()),i;let o=0;const a=[];let c=!1,l=!1,u=0;const d=t.steps.map(_=>{const v=this._makeStyleAst(_,r);let w=null!=v.offset?v.offset:function soe(e){if("string"==typeof e)return null;let t=null;if(Array.isArray(e))e.forEach(r=>{if(r instanceof Map&&r.has("offset")){const i=r;t=parseFloat(i.get("offset")),i.delete("offset")}});else if(e instanceof Map&&e.has("offset")){const r=e;t=parseFloat(r.get("offset")),r.delete("offset")}return t}(v.styles),b=0;return null!=w&&(o++,b=v.offset=w),l=l||b<0||b>1,c=c||b0&&o{const w=h>0?v==p?1:h*v:a[v],b=w*y;r.currentTime=g+m.delay+b,m.duration=b,this._validateStyleAst(_,r),_.offset=w,i.styles.push(_)}),i}visitReference(t,r){return{type:le.Reference,animation:Jn(this,Sd(t.animation),r),options:Zo(t.options)}}visitAnimateChild(t,r){return r.depCount++,{type:le.AnimateChild,options:Zo(t.options)}}visitAnimateRef(t,r){return{type:le.AnimateRef,animation:this.visitReference(t.animation,r),options:Zo(t.options)}}visitQuery(t,r){const i=r.currentQuerySelector,s=t.options||{};r.queryCount++,r.currentQuery=t;const[o,a]=function noe(e){const t=!!e.split(/\s*,\s*/).find(r=>":self"==r);return t&&(e=e.replace(eoe,"")),e=e.replace(/@\*/g,em).replace(/@\w+/g,r=>em+"-"+r.slice(1)).replace(/:animating/g,yC),[e,t]}(t.selector);r.currentQuerySelector=i.length?i+" "+o:o,Yn(r.collectedStyles,r.currentQuerySelector,new Map);const c=Jn(this,Sd(t.animation),r);return r.currentQuery=null,r.currentQuerySelector=i,{type:le.Query,selector:o,limit:s.limit||0,optional:!!s.optional,includeSelf:a,animation:c,originalSelector:t.selector,options:Zo(t.options)}}visitStagger(t,r){r.currentQuery||r.errors.push(function vse(){return new A(3013,!1)}());const i="full"===t.timings?{duration:0,delay:0,easing:"full"}:tm(t.timings,r.errors,!0);return{type:le.Stagger,animation:Jn(this,Sd(t.animation),r),timings:i,options:null}}}class ioe{constructor(t){this.errors=t,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles=new Map,this.options=null,this.unsupportedCSSPropertiesFound=new Set}}function Zo(e){return e?(e={...e}).params&&(e.params=function roe(e){return e?{...e}:null}(e.params)):e={},e}function CC(e,t,r){return{duration:e,delay:t,easing:r}}function DC(e,t,r,i,s,o,a=null,c=!1){return{type:1,element:e,keyframes:t,preStyleProps:r,postStyleProps:i,duration:s,delay:o,totalTime:s+o,easing:a,subTimeline:c}}class sm{constructor(){this._map=new Map}get(t){return this._map.get(t)||[]}append(t,r){let i=this._map.get(t);i||this._map.set(t,i=[]),i.push(...r)}has(t){return this._map.has(t)}clear(){this._map.clear()}}const loe=new RegExp(":enter","g"),doe=new RegExp(":leave","g");function SC(e,t,r,i,s,o=new Map,a=new Map,c,l,u=[]){return(new foe).buildKeyframes(e,t,r,i,s,o,a,c,l,u)}class foe{buildKeyframes(t,r,i,s,o,a,c,l,u,d=[]){u=u||new sm;const f=new TC(t,r,u,s,o,d,[]);f.options=l;const h=l.delay?Yi(l.delay):0;f.currentTimeline.delayNextStep(h),f.currentTimeline.setStyles([a],null,f.errors,l),Jn(this,i,f);const p=f.timelines.filter(g=>g.containsAnimation());if(p.length&&c.size){let g;for(let m=p.length-1;m>=0;m--){const y=p[m];if(y.element===r){g=y;break}}g&&!g.allowOnlyTimelineStyles()&&g.setStyles([c],null,f.errors,l)}return p.length?p.map(g=>g.buildKeyframes()):[DC(r,[],[],[],0,h,"",!1)]}visitTrigger(t,r){}visitState(t,r){}visitTransition(t,r){}visitAnimateChild(t,r){const i=r.subInstructions.get(r.element);if(i){const s=r.createSubContext(t.options),o=r.currentTimeline.currentTime,a=this._visitSubInstructions(i,s,s.options);o!=a&&r.transformIntoNewTimeline(a)}r.previousNode=t}visitAnimateRef(t,r){const i=r.createSubContext(t.options);i.transformIntoNewTimeline(),this._applyAnimationRefDelays([t.options,t.animation.options],r,i),this.visitReference(t.animation,i),r.transformIntoNewTimeline(i.currentTimeline.currentTime),r.previousNode=t}_applyAnimationRefDelays(t,r,i){for(const s of t){const o=s?.delay;if(o){const a="number"==typeof o?o:Yi(Td(o,s?.params??{},r.errors));i.delayNextStep(a)}}}_visitSubInstructions(t,r,i){let o=r.currentTimeline.currentTime;const a=null!=i.duration?Yi(i.duration):null,c=null!=i.delay?Yi(i.delay):null;return 0!==a&&t.forEach(l=>{const u=r.appendInstructionToTimeline(l,a,c);o=Math.max(o,u.duration+u.delay)}),o}visitReference(t,r){r.updateOptions(t.options,!0),Jn(this,t.animation,r),r.previousNode=t}visitSequence(t,r){const i=r.subContextCount;let s=r;const o=t.options;if(o&&(o.params||o.delay)&&(s=r.createSubContext(o),s.transformIntoNewTimeline(),null!=o.delay)){s.previousNode.type==le.Style&&(s.currentTimeline.snapshotCurrentStyles(),s.previousNode=om);const a=Yi(o.delay);s.delayNextStep(a)}t.steps.length&&(t.steps.forEach(a=>Jn(this,a,s)),s.currentTimeline.applyStylesToKeyframe(),s.subContextCount>i&&s.transformIntoNewTimeline()),r.previousNode=t}visitGroup(t,r){const i=[];let s=r.currentTimeline.currentTime;const o=t.options&&t.options.delay?Yi(t.options.delay):0;t.steps.forEach(a=>{const c=r.createSubContext(t.options);o&&c.delayNextStep(o),Jn(this,a,c),s=Math.max(s,c.currentTimeline.currentTime),i.push(c.currentTimeline)}),i.forEach(a=>r.currentTimeline.mergeTimelineCollectedStyles(a)),r.transformIntoNewTimeline(s),r.previousNode=t}_visitTiming(t,r){if(t.dynamic){const i=t.strValue;return tm(r.params?Td(i,r.params,r.errors):i,r.errors)}return{duration:t.duration,delay:t.delay,easing:t.easing}}visitAnimate(t,r){const i=r.currentAnimateTimings=this._visitTiming(t.timings,r),s=r.currentTimeline;i.delay&&(r.incrementTime(i.delay),s.snapshotCurrentStyles());const o=t.style;o.type==le.Keyframes?this.visitKeyframes(o,r):(r.incrementTime(i.duration),this.visitStyle(o,r),s.applyStylesToKeyframe()),r.currentAnimateTimings=null,r.previousNode=t}visitStyle(t,r){const i=r.currentTimeline,s=r.currentAnimateTimings;!s&&i.hasCurrentStyleProperties()&&i.forwardFrame();const o=s&&s.easing||t.easing;t.isEmptyStep?i.applyEmptyStep(o):i.setStyles(t.styles,o,r.errors,r.options),r.previousNode=t}visitKeyframes(t,r){const i=r.currentAnimateTimings,s=r.currentTimeline.duration,o=i.duration,c=r.createSubContext().currentTimeline;c.easing=i.easing,t.styles.forEach(l=>{c.forwardTime((l.offset||0)*o),c.setStyles(l.styles,l.easing,r.errors,r.options),c.applyStylesToKeyframe()}),r.currentTimeline.mergeTimelineCollectedStyles(c),r.transformIntoNewTimeline(s+o),r.previousNode=t}visitQuery(t,r){const i=r.currentTimeline.currentTime,s=t.options||{},o=s.delay?Yi(s.delay):0;o&&(r.previousNode.type===le.Style||0==i&&r.currentTimeline.hasCurrentStyleProperties())&&(r.currentTimeline.snapshotCurrentStyles(),r.previousNode=om);let a=i;const c=r.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!s.optional,r.errors);r.currentQueryTotal=c.length;let l=null;c.forEach((u,d)=>{r.currentQueryIndex=d;const f=r.createSubContext(t.options,u);o&&f.delayNextStep(o),u===r.element&&(l=f.currentTimeline),Jn(this,t.animation,f),f.currentTimeline.applyStylesToKeyframe(),a=Math.max(a,f.currentTimeline.currentTime)}),r.currentQueryIndex=0,r.currentQueryTotal=0,r.transformIntoNewTimeline(a),l&&(r.currentTimeline.mergeTimelineCollectedStyles(l),r.currentTimeline.snapshotCurrentStyles()),r.previousNode=t}visitStagger(t,r){const i=r.parentContext,s=r.currentTimeline,o=t.timings,a=Math.abs(o.duration),c=a*(r.currentQueryTotal-1);let l=a*r.currentQueryIndex;switch(o.duration<0?"reverse":o.easing){case"reverse":l=c-l;break;case"full":l=i.currentStaggerTime}const d=r.currentTimeline;l&&d.delayNextStep(l);const f=d.currentTime;Jn(this,t.animation,r),r.previousNode=t,i.currentStaggerTime=s.currentTime-f+(s.startTime-i.currentTimeline.startTime)}}const om={};class TC{constructor(t,r,i,s,o,a,c,l){this._driver=t,this.element=r,this.subInstructions=i,this._enterClassName=s,this._leaveClassName=o,this.errors=a,this.timelines=c,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=om,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=l||new am(this._driver,r,0),c.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(t,r){if(!t)return;const i=t;let s=this.options;null!=i.duration&&(s.duration=Yi(i.duration)),null!=i.delay&&(s.delay=Yi(i.delay));const o=i.params;if(o){let a=s.params;a||(a=this.options.params={}),Object.keys(o).forEach(c=>{(!r||!a.hasOwnProperty(c))&&(a[c]=Td(o[c],a,this.errors))})}}_copyOptions(){const t={};if(this.options){const r=this.options.params;if(r){const i=t.params={};Object.keys(r).forEach(s=>{i[s]=r[s]})}}return t}createSubContext(t=null,r,i){const s=r||this.element,o=new TC(this._driver,s,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(s,i||0));return o.previousNode=this.previousNode,o.currentAnimateTimings=this.currentAnimateTimings,o.options=this._copyOptions(),o.updateOptions(t),o.currentQueryIndex=this.currentQueryIndex,o.currentQueryTotal=this.currentQueryTotal,o.parentContext=this,this.subContextCount++,o}transformIntoNewTimeline(t){return this.previousNode=om,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(t,r,i){const s={duration:r??t.duration,delay:this.currentTimeline.currentTime+(i??0)+t.delay,easing:""},o=new hoe(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,s,t.stretchStartingKeyframe);return this.timelines.push(o),s}incrementTime(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)}delayNextStep(t){t>0&&this.currentTimeline.delayNextStep(t)}invokeQuery(t,r,i,s,o,a){let c=[];if(s&&c.push(this.element),t.length>0){t=(t=t.replace(loe,"."+this._enterClassName)).replace(doe,"."+this._leaveClassName);let u=this._driver.query(this.element,t,1!=i);0!==i&&(u=i<0?u.slice(u.length+i,u.length):u.slice(0,i)),c.push(...u)}return!o&&0==c.length&&a.push(function _se(){return new A(3014,!1)}()),c}}class am{constructor(t,r,i,s){this._driver=t,this.element=r,this.startTime=i,this._elementTimelineStylesLookup=s,this.duration=0,this.easing=null,this._previousKeyframe=new Map,this._currentKeyframe=new Map,this._keyframes=new Map,this._styleSummary=new Map,this._localTimelineStyles=new Map,this._pendingStyles=new Map,this._backFill=new Map,this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(r),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(r,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(t){const r=1===this._keyframes.size&&this._pendingStyles.size;this.duration||r?(this.forwardTime(this.currentTime+t),r&&this.snapshotCurrentStyles()):this.startTime+=t}fork(t,r){return this.applyStylesToKeyframe(),new am(this._driver,t,r||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=new Map,this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(t){this.applyStylesToKeyframe(),this.duration=t,this._loadKeyframe()}_updateStyle(t,r){this._localTimelineStyles.set(t,r),this._globalTimelineStyles.set(t,r),this._styleSummary.set(t,{time:this.currentTime,value:r})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(t){t&&this._previousKeyframe.set("easing",t);for(let[r,i]of this._globalTimelineStyles)this._backFill.set(r,i||Qi),this._currentKeyframe.set(r,Qi);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(t,r,i,s){r&&this._previousKeyframe.set("easing",r);const o=s&&s.params||{},a=function poe(e,t){const r=new Map;let i;return e.forEach(s=>{if("*"===s){i??=t.keys();for(let o of i)r.set(o,Qi)}else for(let[o,a]of s)r.set(o,a)}),r}(t,this._globalTimelineStyles);for(let[c,l]of a){const u=Td(l,o,i);this._pendingStyles.set(c,u),this._localTimelineStyles.has(c)||this._backFill.set(c,this._globalTimelineStyles.get(c)??Qi),this._updateStyle(c,u)}}applyStylesToKeyframe(){0!=this._pendingStyles.size&&(this._pendingStyles.forEach((t,r)=>{this._currentKeyframe.set(r,t)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((t,r)=>{this._currentKeyframe.has(r)||this._currentKeyframe.set(r,t)}))}snapshotCurrentStyles(){for(let[t,r]of this._localTimelineStyles)this._pendingStyles.set(t,r),this._updateStyle(t,r)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const t=[];for(let r in this._currentKeyframe)t.push(r);return t}mergeTimelineCollectedStyles(t){t._styleSummary.forEach((r,i)=>{const s=this._styleSummary.get(i);(!s||r.time>s.time)&&this._updateStyle(i,r.value)})}buildKeyframes(){this.applyStylesToKeyframe();const t=new Set,r=new Set,i=1===this._keyframes.size&&0===this.duration;let s=[];this._keyframes.forEach((c,l)=>{const u=new Map([...this._backFill,...c]);u.forEach((d,f)=>{"!"===d?t.add(f):d===Qi&&r.add(f)}),i||u.set("offset",l/this.duration),s.push(u)});const o=[...t.values()],a=[...r.values()];if(i){const c=s[0],l=new Map(c);c.set("offset",0),l.set("offset",1),s=[c,l]}return DC(this.element,s,o,a,this.duration,this.startTime,this.easing,!1)}}class hoe extends am{constructor(t,r,i,s,o,a,c=!1){super(t,r,a.delay),this.keyframes=i,this.preStyleProps=s,this.postStyleProps=o,this._stretchStartingKeyframe=c,this.timings={duration:a.duration,delay:a.delay,easing:a.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let t=this.keyframes,{delay:r,duration:i,easing:s}=this.timings;if(this._stretchStartingKeyframe&&r){const o=[],a=i+r,c=r/a,l=new Map(t[0]);l.set("offset",0),o.push(l);const u=new Map(t[0]);u.set("offset",ZF(c)),o.push(u);const d=t.length-1;for(let f=1;f<=d;f++){let h=new Map(t[f]);const p=h.get("offset");h.set("offset",ZF((r+p*i)/a)),o.push(h)}i=a,r=0,s="",t=o}return DC(this.element,t,this.preStyleProps,this.postStyleProps,i,r,s,!0)}}function ZF(e,t=3){const r=Math.pow(10,t-1);return Math.round(e*r)/r}function KF(e,t,r,i,s,o,a,c,l,u,d,f,h){return{type:0,element:e,triggerName:t,isRemovalTransition:s,fromState:r,fromStyles:o,toState:i,toStyles:a,timelines:c,queriedElements:l,preStyleProps:u,postStyleProps:d,totalTime:f,errors:h}}const IC={};class QF{constructor(t,r,i){this._triggerName=t,this.ast=r,this._stateStyles=i}match(t,r,i,s){return function goe(e,t,r,i,s){return e.some(o=>o(t,r,i,s))}(this.ast.matchers,t,r,i,s)}buildStyles(t,r,i){let s=this._stateStyles.get("*");return void 0!==t&&(s=this._stateStyles.get(t?.toString())||s),s?s.buildStyles(r,i):new Map}build(t,r,i,s,o,a,c,l,u,d){const f=[],h=this.ast.options&&this.ast.options.params||IC,g=this.buildStyles(i,c&&c.params||IC,f),m=l&&l.params||IC,y=this.buildStyles(s,m,f),_=new Set,v=new Map,w=new Map,b="void"===s,D={params:YF(m,h),delay:this.ast.options?.delay},C=d?[]:SC(t,r,this.ast.animation,o,a,g,y,D,u,f);let S=0;return C.forEach(I=>{S=Math.max(I.duration+I.delay,S)}),f.length?KF(r,this._triggerName,i,s,b,g,y,[],[],v,w,S,f):(C.forEach(I=>{const P=I.element,H=Yn(v,P,new Set);I.preStyleProps.forEach($=>H.add($));const V=Yn(w,P,new Set);I.postStyleProps.forEach($=>V.add($)),P!==r&&_.add(P)}),KF(r,this._triggerName,i,s,b,g,y,C,[..._.values()],v,w,S))}}function YF(e,t){const r={...t};return Object.entries(e).forEach(([i,s])=>{null!=s&&(r[i]=s)}),r}class moe{constructor(t,r,i){this.styles=t,this.defaultParams=r,this.normalizer=i}buildStyles(t,r){const i=new Map,s=YF(t,this.defaultParams);return this.styles.styles.forEach(o=>{"string"!=typeof o&&o.forEach((a,c)=>{a&&(a=Td(a,s,r));const l=this.normalizer.normalizePropertyName(c,r);a=this.normalizer.normalizeStyleValue(c,l,a,r),i.set(c,a)})}),i}}class voe{constructor(t,r,i){this.name=t,this.ast=r,this._normalizer=i,this.transitionFactories=[],this.states=new Map,r.states.forEach(s=>{this.states.set(s.name,new moe(s.style,s.options&&s.options.params||{},i))}),JF(this.states,"true","1"),JF(this.states,"false","0"),r.transitions.forEach(s=>{this.transitionFactories.push(new QF(t,s,this.states))}),this.fallbackTransition=function _oe(e,t){return new QF(e,{type:le.Transition,animation:{type:le.Sequence,steps:[],options:null},matchers:[(a,c)=>!0],options:null,queryCount:0,depCount:0},t)}(t,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(t,r,i,s){return this.transitionFactories.find(a=>a.match(t,r,i,s))||null}matchStyles(t,r,i){return this.fallbackTransition.buildStyles(t,r,i)}}function JF(e,t,r){e.has(t)?e.has(r)||e.set(r,e.get(t)):e.has(r)&&e.set(t,e.get(r))}const woe=new sm;class boe{constructor(t,r,i){this.bodyNode=t,this._driver=r,this._normalizer=i,this._animations=new Map,this._playersById=new Map,this.players=[]}register(t,r){const i=[],o=EC(this._driver,r,i,[]);if(i.length)throw function Tse(){return new A(3503,!1)}();this._animations.set(t,o)}_buildPlayer(t,r,i){const s=t.element,o=PF(this._normalizer,t.keyframes,r,i);return this._driver.animate(s,o,t.duration,t.delay,t.easing,[],!0)}create(t,r,i={}){const s=[],o=this._animations.get(t);let a;const c=new Map;if(o?(a=SC(this._driver,r,o,mC,Jg,new Map,new Map,i,woe,s),a.forEach(d=>{const f=Yn(c,d.element,new Map);d.postStyleProps.forEach(h=>f.set(h,null))})):(s.push(function Ise(){return new A(3300,!1)}()),a=[]),s.length)throw function xse(){return new A(3504,!1)}();c.forEach((d,f)=>{d.forEach((h,p)=>{d.set(p,this._driver.computeStyle(f,p,Qi))})});const u=qs(a.map(d=>{const f=c.get(d.element);return this._buildPlayer(d,new Map,f)}));return this._playersById.set(t,u),u.onDestroy(()=>this.destroy(t)),this.players.push(u),u}destroy(t){const r=this._getPlayer(t);r.destroy(),this._playersById.delete(t);const i=this.players.indexOf(r);i>=0&&this.players.splice(i,1)}_getPlayer(t){const r=this._playersById.get(t);if(!r)throw function Ase(){return new A(3301,!1)}();return r}listen(t,r,i,s){const o=dC(r,"","","");return lC(this._getPlayer(t),i,o,s),()=>{}}command(t,r,i,s){if("register"==i)return void this.register(t,s[0]);if("create"==i)return void this.create(t,r,s[0]||{});const o=this._getPlayer(t);switch(i){case"play":o.play();break;case"pause":o.pause();break;case"reset":o.reset();break;case"restart":o.restart();break;case"finish":o.finish();break;case"init":o.init();break;case"setPosition":o.setPosition(parseFloat(s[0]));break;case"destroy":this.destroy(t)}}}const XF="ng-animate-queued",xC="ng-animate-disabled",Toe=[],e3={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Ioe={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Fr="__ng_removed";class AC{get params(){return this.options.params}constructor(t,r=""){this.namespaceId=r;const i=t&&t.hasOwnProperty("value");if(this.value=function Noe(e){return e??null}(i?t.value:t),i){const{value:o,...a}=t;this.options=a}else this.options={};this.options.params||(this.options.params={})}absorbOptions(t){const r=t.params;if(r){const i=this.options.params;Object.keys(r).forEach(s=>{null==i[s]&&(i[s]=r[s])})}}}const Id="void",MC=new AC(Id);class xoe{constructor(t,r,i){this.id=t,this.hostElement=r,this._engine=i,this.players=[],this._triggers=new Map,this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+t,pr(r,this._hostClassName)}listen(t,r,i,s){if(!this._triggers.has(r))throw function Mse(){return new A(3302,!1)}();if(null==i||0==i.length)throw function Nse(){return new A(3303,!1)}();if(!function Roe(e){return"start"==e||"done"==e}(i))throw function Rse(){return new A(3400,!1)}();const o=Yn(this._elementListeners,t,[]),a={name:r,phase:i,callback:s};o.push(a);const c=Yn(this._engine.statesByElement,t,new Map);return c.has(r)||(pr(t,Xg),pr(t,Xg+"-"+r),c.set(r,MC)),()=>{this._engine.afterFlush(()=>{const l=o.indexOf(a);l>=0&&o.splice(l,1),this._triggers.has(r)||c.delete(r)})}}register(t,r){return!this._triggers.has(t)&&(this._triggers.set(t,r),!0)}_getTrigger(t){const r=this._triggers.get(t);if(!r)throw function Ose(){return new A(3401,!1)}();return r}trigger(t,r,i,s=!0){const o=this._getTrigger(r),a=new NC(this.id,r,t);let c=this._engine.statesByElement.get(t);c||(pr(t,Xg),pr(t,Xg+"-"+r),this._engine.statesByElement.set(t,c=new Map));let l=c.get(r);const u=new AC(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&l&&u.absorbOptions(l.options),c.set(r,u),l||(l=MC),u.value!==Id&&l.value===u.value){if(!function Poe(e,t){const r=Object.keys(e),i=Object.keys(t);if(r.length!=i.length)return!1;for(let s=0;s{Wo(t,y),_i(t,_)})}return}const h=Yn(this._engine.playersByElement,t,[]);h.forEach(m=>{m.namespaceId==this.id&&m.triggerName==r&&m.queued&&m.destroy()});let p=o.matchTransition(l.value,u.value,t,u.params),g=!1;if(!p){if(!s)return;p=o.fallbackTransition,g=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:r,transition:p,fromState:l,toState:u,player:a,isFallbackTransition:g}),g||(pr(t,XF),a.onStart(()=>{qc(t,XF)})),a.onDone(()=>{let m=this.players.indexOf(a);m>=0&&this.players.splice(m,1);const y=this._engine.playersByElement.get(t);if(y){let _=y.indexOf(a);_>=0&&y.splice(_,1)}}),this.players.push(a),h.push(a),a}deregister(t){this._triggers.delete(t),this._engine.statesByElement.forEach(r=>r.delete(t)),this._elementListeners.forEach((r,i)=>{this._elementListeners.set(i,r.filter(s=>s.name!=t))})}clearElementCache(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);const r=this._engine.playersByElement.get(t);r&&(r.forEach(i=>i.destroy()),this._engine.playersByElement.delete(t))}_signalRemovalForInnerTriggers(t,r){const i=this._engine.driver.query(t,em,!0);i.forEach(s=>{if(s[Fr])return;const o=this._engine.fetchNamespacesByElement(s);o.size?o.forEach(a=>a.triggerLeaveAnimation(s,r,!1,!0)):this.clearElementCache(s)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(s=>this.clearElementCache(s)))}triggerLeaveAnimation(t,r,i,s){const o=this._engine.statesByElement.get(t),a=new Map;if(o){const c=[];if(o.forEach((l,u)=>{if(a.set(u,l.value),this._triggers.has(u)){const d=this.trigger(t,u,Id,s);d&&c.push(d)}}),c.length)return this._engine.markElementAsRemoved(this.id,t,!0,r,a),i&&qs(c).onDone(()=>this._engine.processLeaveNode(t)),!0}return!1}prepareLeaveAnimationListeners(t){const r=this._elementListeners.get(t),i=this._engine.statesByElement.get(t);if(r&&i){const s=new Set;r.forEach(o=>{const a=o.name;if(s.has(a))return;s.add(a);const l=this._triggers.get(a).fallbackTransition,u=i.get(a)||MC,d=new AC(Id),f=new NC(this.id,a,t);this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:a,transition:l,fromState:u,toState:d,player:f,isFallbackTransition:!0})})}}removeNode(t,r){const i=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,r),this.triggerLeaveAnimation(t,r,!0))return;let s=!1;if(i.totalAnimations){const o=i.players.length?i.playersByQueriedElement.get(t):[];if(o&&o.length)s=!0;else{let a=t;for(;a=a.parentNode;)if(i.statesByElement.get(a)){s=!0;break}}}if(this.prepareLeaveAnimationListeners(t),s)i.markElementAsRemoved(this.id,t,!1,r);else{const o=t[Fr];(!o||o===e3)&&(i.afterFlush(()=>this.clearElementCache(t)),i.destroyInnerAnimations(t),i._onRemovalComplete(t,r))}}insertNode(t,r){pr(t,this._hostClassName)}drainQueuedTransitions(t){const r=[];return this._queue.forEach(i=>{const s=i.player;if(s.destroyed)return;const o=i.element,a=this._elementListeners.get(o);a&&a.forEach(c=>{if(c.name==i.triggerName){const l=dC(o,i.triggerName,i.fromState.value,i.toState.value);l._data=t,lC(i.player,c.phase,l,c.callback)}}),s.markedForDestroy?this._engine.afterFlush(()=>{s.destroy()}):r.push(i)}),this._queue=[],r.sort((i,s)=>{const o=i.transition.ast.depCount,a=s.transition.ast.depCount;return 0==o||0==a?o-a:this._engine.driver.containsElement(i.element,s.element)?1:-1})}destroy(t){this.players.forEach(r=>r.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,t)}}class Aoe{_onRemovalComplete(t,r){this.onRemovalComplete(t,r)}constructor(t,r,i){this.bodyNode=t,this.driver=r,this._normalizer=i,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(s,o)=>{}}get queuedPlayers(){const t=[];return this._namespaceList.forEach(r=>{r.players.forEach(i=>{i.queued&&t.push(i)})}),t}createNamespace(t,r){const i=new xoe(t,r,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,r)?this._balanceNamespaceList(i,r):(this.newHostElements.set(r,i),this.collectEnterElement(r)),this._namespaceLookup[t]=i}_balanceNamespaceList(t,r){const i=this._namespaceList,s=this.namespacesByHostElement;if(i.length-1>=0){let a=!1,c=this.driver.getParentElement(r);for(;c;){const l=s.get(c);if(l){const u=i.indexOf(l);i.splice(u+1,0,t),a=!0;break}c=this.driver.getParentElement(c)}a||i.unshift(t)}else i.push(t);return s.set(r,t),t}register(t,r){let i=this._namespaceLookup[t];return i||(i=this.createNamespace(t,r)),i}registerTrigger(t,r,i){let s=this._namespaceLookup[t];s&&s.register(r,i)&&this.totalAnimations++}destroy(t,r){t&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{const i=this._fetchNamespace(t);this.namespacesByHostElement.delete(i.hostElement);const s=this._namespaceList.indexOf(i);s>=0&&this._namespaceList.splice(s,1),i.destroy(r),delete this._namespaceLookup[t]}))}_fetchNamespace(t){return this._namespaceLookup[t]}fetchNamespacesByElement(t){const r=new Set,i=this.statesByElement.get(t);if(i)for(let s of i.values())if(s.namespaceId){const o=this._fetchNamespace(s.namespaceId);o&&r.add(o)}return r}trigger(t,r,i,s){if(cm(r)){const o=this._fetchNamespace(t);if(o)return o.trigger(r,i,s),!0}return!1}insertNode(t,r,i,s){if(!cm(r))return;const o=r[Fr];if(o&&o.setForRemoval){o.setForRemoval=!1,o.setForMove=!0;const a=this.collectedLeaveElements.indexOf(r);a>=0&&this.collectedLeaveElements.splice(a,1)}if(t){const a=this._fetchNamespace(t);a&&a.insertNode(r,i)}s&&this.collectEnterElement(r)}collectEnterElement(t){this.collectedEnterElements.push(t)}markElementAsDisabled(t,r){r?this.disabledNodes.has(t)||(this.disabledNodes.add(t),pr(t,xC)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),qc(t,xC))}removeNode(t,r,i){if(cm(r)){const s=t?this._fetchNamespace(t):null;s?s.removeNode(r,i):this.markElementAsRemoved(t,r,!1,i);const o=this.namespacesByHostElement.get(r);o&&o.id!==t&&o.removeNode(r,i)}else this._onRemovalComplete(r,i)}markElementAsRemoved(t,r,i,s,o){this.collectedLeaveElements.push(r),r[Fr]={namespaceId:t,setForRemoval:s,hasAnimation:i,removedBeforeQueried:!1,previousTriggersValues:o}}listen(t,r,i,s,o){return cm(r)?this._fetchNamespace(t).listen(r,i,s,o):()=>{}}_buildInstruction(t,r,i,s,o){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,i,s,t.fromState.options,t.toState.options,r,o)}destroyInnerAnimations(t){let r=this.driver.query(t,em,!0);r.forEach(i=>this.destroyActiveAnimationsForElement(i)),0!=this.playersByQueriedElement.size&&(r=this.driver.query(t,yC,!0),r.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(t){const r=this.playersByElement.get(t);r&&r.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(t){const r=this.playersByQueriedElement.get(t);r&&r.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(t=>{if(this.players.length)return qs(this.players).onDone(()=>t());t()})}processLeaveNode(t){const r=t[Fr];if(r&&r.setForRemoval){if(t[Fr]=e3,r.namespaceId){this.destroyInnerAnimations(t);const i=this._fetchNamespace(r.namespaceId);i&&i.clearElementCache(t)}this._onRemovalComplete(t,r.setForRemoval)}t.classList?.contains(xC)&&this.markElementAsDisabled(t,!1),this.driver.query(t,".ng-animate-disabled",!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(t=-1){let r=[];if(this.newHostElements.size&&(this.newHostElements.forEach((i,s)=>this._balanceNamespaceList(i,s)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let i=0;ii()),this._flushFns=[],this._whenQuietFns.length){const i=this._whenQuietFns;this._whenQuietFns=[],r.length?qs(r).onDone(()=>{i.forEach(s=>s())}):i.forEach(s=>s())}}reportError(t){throw function kse(){return new A(3402,!1)}()}_flushAnimations(t,r){const i=new sm,s=[],o=new Map,a=[],c=new Map,l=new Map,u=new Map,d=new Set;this.disabledNodes.forEach(E=>{d.add(E);const x=this.driver.query(E,".ng-animate-queued",!0);for(let R=0;R{const R=mC+m++;g.set(x,R),E.forEach(M=>pr(M,R))});const y=[],_=new Set,v=new Set;for(let E=0;E_.add(M)):v.add(x))}const w=new Map,b=r3(h,Array.from(_));b.forEach((E,x)=>{const R=Jg+m++;w.set(x,R),E.forEach(M=>pr(M,R))}),t.push(()=>{p.forEach((E,x)=>{const R=g.get(x);E.forEach(M=>qc(M,R))}),b.forEach((E,x)=>{const R=w.get(x);E.forEach(M=>qc(M,R))}),y.forEach(E=>{this.processLeaveNode(E)})});const D=[],C=[];for(let E=this._namespaceList.length-1;E>=0;E--)this._namespaceList[E].drainQueuedTransitions(r).forEach(R=>{const M=R.player,W=R.element;if(D.push(M),this.collectedEnterElements.length){const Ae=W[Fr];if(Ae&&Ae.setForMove){if(Ae.previousTriggersValues&&Ae.previousTriggersValues.has(R.triggerName)){const ot=Ae.previousTriggersValues.get(R.triggerName),Oe=this.statesByElement.get(R.element);if(Oe&&Oe.has(R.triggerName)){const Pn=Oe.get(R.triggerName);Pn.value=ot,Oe.set(R.triggerName,Pn)}}return void M.destroy()}}const J=!f||!this.driver.containsElement(f,W),ee=w.get(W),Se=g.get(W),ue=this._buildInstruction(R,i,Se,ee,J);if(ue.errors&&ue.errors.length)return void C.push(ue);if(J)return M.onStart(()=>Wo(W,ue.fromStyles)),M.onDestroy(()=>_i(W,ue.toStyles)),void s.push(M);if(R.isFallbackTransition)return M.onStart(()=>Wo(W,ue.fromStyles)),M.onDestroy(()=>_i(W,ue.toStyles)),void s.push(M);const yt=[];ue.timelines.forEach(Ae=>{Ae.stretchStartingKeyframe=!0,this.disabledNodes.has(Ae.element)||yt.push(Ae)}),ue.timelines=yt,i.append(W,ue.timelines),a.push({instruction:ue,player:M,element:W}),ue.queriedElements.forEach(Ae=>Yn(c,Ae,[]).push(M)),ue.preStyleProps.forEach((Ae,ot)=>{if(Ae.size){let Oe=l.get(ot);Oe||l.set(ot,Oe=new Set),Ae.forEach((Pn,en)=>Oe.add(en))}}),ue.postStyleProps.forEach((Ae,ot)=>{let Oe=u.get(ot);Oe||u.set(ot,Oe=new Set),Ae.forEach((Pn,en)=>Oe.add(en))})});if(C.length){const E=[];C.forEach(x=>{E.push(function Pse(){return new A(3505,!1)}())}),D.forEach(x=>x.destroy()),this.reportError(E)}const S=new Map,I=new Map;a.forEach(E=>{const x=E.element;i.has(x)&&(I.set(x,x),this._beforeAnimationBuild(E.player.namespaceId,E.instruction,S))}),s.forEach(E=>{const x=E.element;this._getPreviousPlayers(x,!1,E.namespaceId,E.triggerName,null).forEach(M=>{Yn(S,x,[]).push(M),M.destroy()})});const P=y.filter(E=>s3(E,l,u)),H=new Map;n3(H,this.driver,v,u,Qi).forEach(E=>{s3(E,l,u)&&P.push(E)});const $=new Map;p.forEach((E,x)=>{n3($,this.driver,new Set(E),l,"!")}),P.forEach(E=>{const x=H.get(E),R=$.get(E);H.set(E,new Map([...x?.entries()??[],...R?.entries()??[]]))});const X=[],L=[],T={};a.forEach(E=>{const{element:x,player:R,instruction:M}=E;if(i.has(x)){if(d.has(x))return R.onDestroy(()=>_i(x,M.toStyles)),R.disabled=!0,R.overrideTotalTime(M.totalTime),void s.push(R);let W=T;if(I.size>1){let ee=x;const Se=[];for(;ee=ee.parentNode;){const ue=I.get(ee);if(ue){W=ue;break}Se.push(ee)}Se.forEach(ue=>I.set(ue,W))}const J=this._buildAnimation(R.namespaceId,M,S,o,$,H);if(R.setRealPlayer(J),W===T)X.push(R);else{const ee=this.playersByElement.get(W);ee&&ee.length&&(R.parentPlayer=qs(ee)),s.push(R)}}else Wo(x,M.fromStyles),R.onDestroy(()=>_i(x,M.toStyles)),L.push(R),d.has(x)&&s.push(R)}),L.forEach(E=>{const x=o.get(E.element);if(x&&x.length){const R=qs(x);E.setRealPlayer(R)}}),s.forEach(E=>{E.parentPlayer?E.syncPlayerEvents(E.parentPlayer):E.destroy()});for(let E=0;E!J.destroyed);W.length?Ooe(this,x,W):this.processLeaveNode(x)}return y.length=0,X.forEach(E=>{this.players.push(E),E.onDone(()=>{E.destroy();const x=this.players.indexOf(E);this.players.splice(x,1)}),E.play()}),X}afterFlush(t){this._flushFns.push(t)}afterFlushAnimationsDone(t){this._whenQuietFns.push(t)}_getPreviousPlayers(t,r,i,s,o){let a=[];if(r){const c=this.playersByQueriedElement.get(t);c&&(a=c)}else{const c=this.playersByElement.get(t);if(c){const l=!o||o==Id;c.forEach(u=>{u.queued||!l&&u.triggerName!=s||a.push(u)})}}return(i||s)&&(a=a.filter(c=>!(i&&i!=c.namespaceId||s&&s!=c.triggerName))),a}_beforeAnimationBuild(t,r,i){const o=r.element,a=r.isRemovalTransition?void 0:t,c=r.isRemovalTransition?void 0:r.triggerName;for(const l of r.timelines){const u=l.element,d=u!==o,f=Yn(i,u,[]);this._getPreviousPlayers(u,d,a,c,r.toState).forEach(p=>{const g=p.getRealPlayer();g.beforeDestroy&&g.beforeDestroy(),p.destroy(),f.push(p)})}Wo(o,r.fromStyles)}_buildAnimation(t,r,i,s,o,a){const c=r.triggerName,l=r.element,u=[],d=new Set,f=new Set,h=r.timelines.map(g=>{const m=g.element;d.add(m);const y=m[Fr];if(y&&y.removedBeforeQueried)return new Dd(g.duration,g.delay);const _=m!==l,v=function koe(e){const t=[];return i3(e,t),t}((i.get(m)||Toe).map(S=>S.getRealPlayer())).filter(S=>!!S.element&&S.element===m),w=o.get(m),b=a.get(m),D=PF(this._normalizer,g.keyframes,w,b),C=this._buildPlayer(g,D,v);if(g.subTimeline&&s&&f.add(m),_){const S=new NC(t,c,m);S.setRealPlayer(C),u.push(S)}return C});u.forEach(g=>{Yn(this.playersByQueriedElement,g.element,[]).push(g),g.onDone(()=>function Moe(e,t,r){let i=e.get(t);if(i){if(i.length){const s=i.indexOf(r);i.splice(s,1)}0==i.length&&e.delete(t)}return i}(this.playersByQueriedElement,g.element,g))}),d.forEach(g=>pr(g,jF));const p=qs(h);return p.onDestroy(()=>{d.forEach(g=>qc(g,jF)),_i(l,r.toStyles)}),f.forEach(g=>{Yn(s,g,[]).push(p)}),p}_buildPlayer(t,r,i){return r.length>0?this.driver.animate(t.element,r,t.duration,t.delay,t.easing,i):new Dd(t.duration,t.delay)}}class NC{constructor(t,r,i){this.namespaceId=t,this.triggerName=r,this.element=i,this._player=new Dd,this._containsRealPlayer=!1,this._queuedCallbacks=new Map,this.destroyed=!1,this.parentPlayer=null,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(t){this._containsRealPlayer||(this._player=t,this._queuedCallbacks.forEach((r,i)=>{r.forEach(s=>lC(t,i,void 0,s))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(t.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(t){this.totalTime=t}syncPlayerEvents(t){const r=this._player;r.triggerCallback&&t.onStart(()=>r.triggerCallback("start")),t.onDone(()=>this.finish()),t.onDestroy(()=>this.destroy())}_queueEvent(t,r){Yn(this._queuedCallbacks,t,[]).push(r)}onDone(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)}onStart(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)}onDestroy(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(t){this.queued||this._player.setPosition(t)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(t){const r=this._player;r.triggerCallback&&r.triggerCallback(t)}}function cm(e){return e&&1===e.nodeType}function t3(e,t){const r=e.style.display;return e.style.display=t??"none",r}function n3(e,t,r,i,s){const o=[];r.forEach(l=>o.push(t3(l)));const a=[];i.forEach((l,u)=>{const d=new Map;l.forEach(f=>{const h=t.computeStyle(u,f,s);d.set(f,h),(!h||0==h.length)&&(u[Fr]=Ioe,a.push(u))}),e.set(u,d)});let c=0;return r.forEach(l=>t3(l,o[c++])),a}function r3(e,t){const r=new Map;if(e.forEach(c=>r.set(c,[])),0==t.length)return r;const s=new Set(t),o=new Map;function a(c){if(!c)return 1;let l=o.get(c);if(l)return l;const u=c.parentNode;return l=r.has(u)?u:s.has(u)?1:a(u),o.set(c,l),l}return t.forEach(c=>{const l=a(c);1!==l&&r.get(l).push(c)}),r}function pr(e,t){e.classList?.add(t)}function qc(e,t){e.classList?.remove(t)}function Ooe(e,t,r){qs(r).onDone(()=>e.processLeaveNode(t))}function i3(e,t){for(let r=0;rs.add(o)):t.set(e,i),r.delete(e),!0}class xd{constructor(t,r,i){this._driver=r,this._normalizer=i,this._triggerCache={},this.onRemovalComplete=(s,o)=>{},this._transitionEngine=new Aoe(t.body,r,i),this._timelineEngine=new boe(t.body,r,i),this._transitionEngine.onRemovalComplete=(s,o)=>this.onRemovalComplete(s,o)}registerTrigger(t,r,i,s,o){const a=t+"-"+s;let c=this._triggerCache[a];if(!c){const l=[],d=EC(this._driver,o,l,[]);if(l.length)throw function Dse(){return new A(3404,!1)}();c=function yoe(e,t,r){return new voe(e,t,r)}(s,d,this._normalizer),this._triggerCache[a]=c}this._transitionEngine.registerTrigger(r,s,c)}register(t,r){this._transitionEngine.register(t,r)}destroy(t,r){this._transitionEngine.destroy(t,r)}onInsert(t,r,i,s){this._transitionEngine.insertNode(t,r,i,s)}onRemove(t,r,i){this._transitionEngine.removeNode(t,r,i)}disableAnimations(t,r){this._transitionEngine.markElementAsDisabled(t,r)}process(t,r,i,s){if("@"==i.charAt(0)){const[o,a]=LF(i);this._timelineEngine.command(o,r,a,s)}else this._transitionEngine.trigger(t,r,i,s)}listen(t,r,i,s,o){if("@"==i.charAt(0)){const[a,c]=LF(i);return this._timelineEngine.listen(a,r,c,o)}return this._transitionEngine.listen(t,r,i,s,o)}flush(t=-1){this._transitionEngine.flush(t)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(t){this._transitionEngine.afterFlushAnimationsDone(t)}}class Ad{static{this.initialStylesByElement=new WeakMap}constructor(t,r,i){this._element=t,this._startStyles=r,this._endStyles=i,this._state=0;let s=Ad.initialStylesByElement.get(t);s||Ad.initialStylesByElement.set(t,s=new Map),this._initialStyles=s}start(){this._state<1&&(this._startStyles&&_i(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(_i(this._element,this._initialStyles),this._endStyles&&(_i(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(Ad.initialStylesByElement.delete(this._element),this._startStyles&&(Wo(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Wo(this._element,this._endStyles),this._endStyles=null),_i(this._element,this._initialStyles),this._state=3)}}function RC(e){let t=null;return e.forEach((r,i)=>{(function Foe(e){return"display"===e||"position"===e})(i)&&(t=t||new Map,t.set(i,r))}),t}class o3{constructor(t,r,i,s){this.element=t,this.keyframes=r,this.options=i,this._specialStyles=s,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this._originalOnDoneFns=[],this._originalOnStartFns=[],this.time=0,this.parentPlayer=null,this.currentSnapshot=new Map,this._duration=i.duration,this._delay=i.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:new Map;const r=()=>this._onFinish();this.domPlayer.addEventListener("finish",r),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",r)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(t){const r=[];return t.forEach(i=>{r.push(Object.fromEntries(i))}),r}_triggerWebAnimation(t,r,i){return t.animate(this._convertKeyframesToObject(r),i)}onStart(t){this._originalOnStartFns.push(t),this._onStartFns.push(t)}onDone(t){this._originalOnDoneFns.push(t),this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}setPosition(t){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=t*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const t=new Map;this.hasStarted()&&this._finalKeyframe.forEach((i,s)=>{"offset"!==s&&t.set(s,this._finished?i:bC(this.element,s))}),this.currentSnapshot=t}triggerCallback(t){const r="start"===t?this._onStartFns:this._onDoneFns;r.forEach(i=>i()),r.length=0}}class a3{validateStyleProperty(t){return!0}validateAnimatableStyleProperty(t){return!0}containsElement(t,r){return BF(t,r)}getParentElement(t){return fC(t)}query(t,r,i){return VF(t,r,i)}computeStyle(t,r,i){return bC(t,r)}animate(t,r,i,s,o,a=[]){const l={duration:i,delay:s,fill:0==s?"both":"forwards"};o&&(l.easing=o);const u=new Map,d=a.filter(p=>p instanceof o3);(function Zse(e,t){return 0===e||0===t})(i,s)&&d.forEach(p=>{p.currentSnapshot.forEach((g,m)=>u.set(m,g))});let f=function qse(e){return e.length?e[0]instanceof Map?e:e.map(t=>new Map(Object.entries(t))):[]}(r).map(p=>new Map(p));f=function Kse(e,t,r){if(r.size&&t.length){let i=t[0],s=[];if(r.forEach((o,a)=>{i.has(a)||s.push(a),i.set(a,o)}),s.length)for(let o=1;oa.set(c,bC(e,c)))}}return t}(t,f,u);const h=function Loe(e,t){let r=null,i=null;return Array.isArray(t)&&t.length?(r=RC(t[0]),t.length>1&&(i=RC(t[t.length-1]))):t instanceof Map&&(r=RC(t)),r||i?new Ad(e,r,i):null}(t,f);return new o3(t,f,l,h)}}const c3="@.disabled";class l3{constructor(t,r,i,s){this.namespaceId=t,this.delegate=r,this.engine=i,this._onDestroy=s,this.\u0275type=0}get data(){return this.delegate.data}destroyNode(t){this.delegate.destroyNode?.(t)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(t,r){return this.delegate.createElement(t,r)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}appendChild(t,r){this.delegate.appendChild(t,r),this.engine.onInsert(this.namespaceId,r,t,!1)}insertBefore(t,r,i,s=!0){this.delegate.insertBefore(t,r,i),this.engine.onInsert(this.namespaceId,r,t,s)}removeChild(t,r,i){this.parentNode(r)&&this.engine.onRemove(this.namespaceId,r,this.delegate)}selectRootElement(t,r){return this.delegate.selectRootElement(t,r)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,r,i,s){this.delegate.setAttribute(t,r,i,s)}removeAttribute(t,r,i){this.delegate.removeAttribute(t,r,i)}addClass(t,r){this.delegate.addClass(t,r)}removeClass(t,r){this.delegate.removeClass(t,r)}setStyle(t,r,i,s){this.delegate.setStyle(t,r,i,s)}removeStyle(t,r,i){this.delegate.removeStyle(t,r,i)}setProperty(t,r,i){"@"==r.charAt(0)&&r==c3?this.disableAnimations(t,!!i):this.delegate.setProperty(t,r,i)}setValue(t,r){this.delegate.setValue(t,r)}listen(t,r,i){return this.delegate.listen(t,r,i)}disableAnimations(t,r){this.engine.disableAnimations(t,r)}}class Boe extends l3{constructor(t,r,i,s,o){super(r,i,s,o),this.factory=t,this.namespaceId=r}setProperty(t,r,i){"@"==r.charAt(0)?"."==r.charAt(1)&&r==c3?this.disableAnimations(t,i=void 0===i||!!i):this.engine.process(this.namespaceId,t,r.slice(1),i):this.delegate.setProperty(t,r,i)}listen(t,r,i){if("@"==r.charAt(0)){const s=function Voe(e){switch(e){case"body":return document.body;case"document":return document;case"window":return window;default:return e}}(t);let o=r.slice(1),a="";return"@"!=o.charAt(0)&&([o,a]=function Uoe(e){const t=e.indexOf(".");return[e.substring(0,t),e.slice(t+1)]}(o)),this.engine.listen(this.namespaceId,s,o,a,c=>{this.factory.scheduleListenerCallback(c._data||-1,i,c)})}return this.delegate.listen(t,r,i)}}class joe{constructor(t,r,i){this.delegate=t,this.engine=r,this._zone=i,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,r.onRemovalComplete=(s,o)=>{o?.removeChild(null,s)}}createRenderer(t,r){const s=this.delegate.createRenderer(t,r);if(!t||!r?.data?.animation){const u=this._rendererCache;let d=u.get(s);return d||(d=new l3("",s,this.engine,()=>u.delete(s)),u.set(s,d)),d}const o=r.id,a=r.id+"-"+this._currentId;this._currentId++,this.engine.register(a,t);const c=u=>{Array.isArray(u)?u.forEach(c):this.engine.registerTrigger(o,a,t,u.name,u)};return r.data.animation.forEach(c),new Boe(this,a,s,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(t,r,i){if(t>=0&&tr(i));const s=this._animationCallbacksBuffer;0==s.length&&queueMicrotask(()=>{this._zone.run(()=>{s.forEach(o=>{const[a,c]=o;a(c)}),this._animationCallbacksBuffer=[]})}),s.push([r,i])}end(){this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}}let $oe=(()=>{class e extends xd{constructor(r,i,s){super(r,i,s)}ngOnDestroy(){this.flush()}static{this.\u0275fac=function(i){return new(i||e)(z(an),z(pC),z(gC))}}static{this.\u0275prov=j({token:e,factory:e.\u0275fac})}}return e})();const u3=[{provide:gC,useFactory:function Hoe(){return new zF}},{provide:xd,useClass:$oe},{provide:ih,useFactory:function zoe(e,t,r){return new joe(e,t,r)},deps:[w_,xd,Ne]}],OC=[{provide:pC,useFactory:()=>new a3},{provide:sT,useValue:"BrowserAnimations"},...u3],d3=[{provide:pC,useClass:hC},{provide:sT,useValue:"NoopAnimations"},...u3];let qoe=(()=>{class e{static withConfig(r){return{ngModule:e,providers:r.disableAnimations?d3:OC}}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({providers:OC,imports:[eR]})}}return e})(),Goe=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ot({type:e})}static{this.\u0275inj=St({providers:[Tw,Iw,{provide:nr,useClass:Iw}],imports:[ps,qoe]})}}return e})(),Woe=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ot({type:e,bootstrap:[Yie]})}static{this.\u0275inj=St({imports:[ese,eR,Eie,SK,nse,Qie.forRoot({timeOut:1e4,positionClass:"toast-top-center",preventDuplicates:!0}),Goe]})}}return e})();Wq().bootstrapModule(Woe).catch(e=>console.error(e))}},um=>{um(um.s=200)}]); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json old mode 100644 new mode 100755 index 1fcaa4e..8c7353a --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@angular/platform-browser-dynamic": "^18.2.8", "@angular/router": "^18.2.8", "@belomonte/async-modal-ngx": "^1.0.0", - "@belomonte/ngx-parody-api": "file:belomonte-ngx-parody-api-0.1.0.tgz", + "@belomonte/ngx-parody-api": "^0.1.1", "@nostrify/nostrify": "npm:@jsr/nostrify__nostrify@^0.36.1", "ngx-toastr": "^19.0.0", "nostr-tools": "^2.10.1", @@ -458,6 +458,36 @@ "typescript": ">=5.4 <5.6" } }, + "node_modules/@angular/compiler-cli/node_modules/chokidar": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.1.tgz", + "integrity": "sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@angular/compiler-cli/node_modules/readdirp": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.0.2.tgz", + "integrity": "sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@angular/core": { "version": "18.2.12", "resolved": "https://registry.npmjs.org/@angular/core/-/core-18.2.12.tgz", @@ -2488,9 +2518,9 @@ } }, "node_modules/@belomonte/ngx-parody-api": { - "version": "0.1.0", - "resolved": "file:belomonte-ngx-parody-api-0.1.0.tgz", - "integrity": "sha512-slrGNBistYIfjjrPVVS+dtMwPFgZAkUHCHqf1kWcN2EFTz+Atuef45xwCdmpb91DZw/UZ995Ny/0clCpGpTvtg==", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@belomonte/ngx-parody-api/-/ngx-parody-api-0.1.1.tgz", + "integrity": "sha512-nllt6GUbm08Qk7t+2eBTjlH8RJ1/QPJxuRlMSa6/f4e0uAI6pt4w/pTb7VmgJFxWFxi5Lg4Likxrniii9HS5Kg==", "license": "Ungovernable", "dependencies": { "tslib": "^2.3.0" @@ -2536,9 +2566,9 @@ } }, "node_modules/@dotenv-run/webpack": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@dotenv-run/webpack/-/webpack-1.4.1.tgz", - "integrity": "sha512-C6nDTaMzqzvZjkeGY3azJ5pvtuGYZudj2KnDo8dJ2k7qHLmUA+6GyMlY81hnl/r6UpMdvkDitd8SVHQq3NpmVQ==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@dotenv-run/webpack/-/webpack-1.5.0.tgz", + "integrity": "sha512-OXHWKbG7bsJ+I21CytLP/YLT5BaLesrE8QSJgEGzorLAMklgr8FkRWvZMpAYg7R7lQ5/r/67ei36QH7gAdBkpA==", "dev": true, "license": "ISC", "dependencies": { @@ -3661,9 +3691,9 @@ } }, "node_modules/@ngx-env/builder/node_modules/@dotenv-run/esbuild": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/@dotenv-run/esbuild/-/esbuild-1.4.2.tgz", - "integrity": "sha512-/2lBaezAWQ3+2qW9VjhXfQxoub20u8ImXzknOCeBWZde/n5Sp13s6oXCgwrQysMClqz7az2VB1giqpHRKxC9Dw==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@dotenv-run/esbuild/-/esbuild-1.5.0.tgz", + "integrity": "sha512-uzmbgoUl9+A1fcm3S+3TBGH4jPGdhxsNhSnl1FvJIt48S/5vWuTaC15bgOfYyt5bnnUscvoh0VjeNBDBKR8igg==", "dev": true, "license": "ISC", "dependencies": { @@ -6007,9 +6037,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001680", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001680.tgz", - "integrity": "sha512-rPQy70G6AGUMnbwS1z6Xg+RkHYPAi18ihs47GH0jcxIG7wArmPgY3XbS2sRdBbxJljp3thdT8BIqv9ccCypiPA==", + "version": "1.0.30001683", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001683.tgz", + "integrity": "sha512-iqmNnThZ0n70mNwvxpEC2nBJ037ZHZUoBI5Gorh1Mw6IlEAZujEoU1tXA628iZfzm7R9FvFzxbfdgml82a3k8Q==", "dev": true, "funding": [ { @@ -6052,19 +6082,41 @@ "license": "MIT" }, "node_modules/chokidar": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.1.tgz", - "integrity": "sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", "dev": true, "license": "MIT", "dependencies": { - "readdirp": "^4.0.1" + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" }, "engines": { - "node": ">= 14.16.0" + "node": ">= 8.10.0" }, "funding": { "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" } }, "node_modules/chownr": { @@ -9195,31 +9247,6 @@ "concat-map": "0.0.1" } }, - "node_modules/karma/node_modules/chokidar": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", - "dev": true, - "license": "MIT", - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, "node_modules/karma/node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -9261,19 +9288,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/karma/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/karma/node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -9297,32 +9311,6 @@ "node": "*" } }, - "node_modules/karma/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/karma/node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "license": "MIT", - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, "node_modules/karma/node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -11922,17 +11910,29 @@ } }, "node_modules/readdirp": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.0.2.tgz", - "integrity": "sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, "engines": { - "node": ">= 14.16.0" + "node": ">=8.10.0" + } + }, + "node_modules/readdirp/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" }, "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" + "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/reflect-metadata": { @@ -12411,70 +12411,6 @@ } } }, - "node_modules/sass/node_modules/chokidar": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", - "dev": true, - "license": "MIT", - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/sass/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/sass/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/sass/node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "license": "MIT", - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, "node_modules/sax": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", @@ -14640,44 +14576,6 @@ } } }, - "node_modules/webpack-dev-server/node_modules/chokidar": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", - "dev": true, - "license": "MIT", - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/webpack-dev-server/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/webpack-dev-server/node_modules/http-proxy-middleware": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz", @@ -14703,32 +14601,6 @@ } } }, - "node_modules/webpack-dev-server/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/webpack-dev-server/node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "license": "MIT", - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, "node_modules/webpack-dev-server/node_modules/rimraf": { "version": "5.0.10", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", diff --git a/package.json b/package.json index 4881353..4a5a360 100755 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@angular/platform-browser-dynamic": "^18.2.8", "@angular/router": "^18.2.8", "@belomonte/async-modal-ngx": "^1.0.0", - "@belomonte/ngx-parody-api": "file:belomonte-ngx-parody-api-0.1.0.tgz", + "@belomonte/ngx-parody-api": "^0.1.1", "@nostrify/nostrify": "npm:@jsr/nostrify__nostrify@^0.36.1", "ngx-toastr": "^19.0.0", "nostr-tools": "^2.10.1", diff --git a/src/app/pages/chat/chat.component.ts b/src/app/pages/chat/chat.component.ts index a638f6e..575838b 100755 --- a/src/app/pages/chat/chat.component.ts +++ b/src/app/pages/chat/chat.component.ts @@ -173,7 +173,7 @@ export class ChatComponent implements OnDestroy, OnInit { this.scrollConversationToTheEnd(); try { - const typingPromise = this.talkToStrangerParody.isTyping(); + const typingPromise = this.talkToStrangerParody.stopTyping(); const messagePromise = this.talkToStrangerParody.sendMessage(stranger, message); await Promise.all([typingPromise, messagePromise]); } catch (e) {