diff --git a/docs/3rdpartylicenses.txt b/docs/3rdpartylicenses.txt old mode 100755 new mode 100644 diff --git a/docs/929.3327f3f3a9dc4b18.js b/docs/929.3327f3f3a9dc4b18.js old mode 100755 new mode 100644 diff --git a/docs/assets/sound-notification.wav b/docs/assets/sound-notification.wav new file mode 100755 index 0000000..de73fbe Binary files /dev/null and b/docs/assets/sound-notification.wav differ diff --git a/docs/index.html b/docs/index.html old mode 100755 new mode 100644 index c69bb3e..c090acc --- a/docs/index.html +++ b/docs/index.html @@ -26,16 +26,18 @@ - - - + + + - - + + + + - + diff --git a/docs/main.c5b676f8f08b1fd2.js b/docs/main.dbfbdeccc154b083.js old mode 100755 new mode 100644 similarity index 51% rename from docs/main.c5b676f8f08b1fd2.js rename to docs/main.dbfbdeccc154b083.js index 96e8a48..52875a0 --- a/docs/main.c5b676f8f08b1fd2.js +++ b/docs/main.dbfbdeccc154b083.js @@ -1 +1 @@ -"use strict";(self.webpackChunkomeglestr=self.webpackChunkomeglestr||[]).push([[792],{999:(am,yC,_i)=>{var Wc={};_i.r(Wc),_i.d(Wc,{OG:()=>A_,My:()=>nc,Ph:()=>Nn,lX:()=>T_,Id:()=>Co,fg:()=>KN,qj:()=>an,aT:()=>rc,lq:()=>ys,z:()=>x_,Q5:()=>Eu});var cm={};function vC(e,t){return Object.is(e,t)}_i.r(cm),_i.d(cm,{aK:()=>ko,e8:()=>vc,DO:()=>Lu,dJ:()=>ak,OG:()=>Xw,My:()=>_c,Ph:()=>Oo,lX:()=>Qw,Id:()=>Fu,fg:()=>lk,qj:()=>Mr,aT:()=>bc,r4:()=>Zp,aY:()=>Ro,x:()=>tb,lq:()=>Ec,z:()=>Yw,zW:()=>wc,Q5:()=>Bu});let At=null,Zc=!1,Od=1;const mr=Symbol("SIGNAL");function ve(e){const t=At;return At=e,t}const kd={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 lm(e){if(Zc)throw new Error("");if(null===At)return;At.consumerOnSignalRead(e);const t=At.nextProducerIndex++;Fd(At),te.nextProducerIndex;)e.producerNode.pop(),e.producerLastReadVersion.pop(),e.producerIndexOfThis.pop()}}function dm(e){Fd(e);for(let t=0;t0}function Fd(e){e.producerNode??=[],e.producerIndexOfThis??=[],e.producerLastReadVersion??=[]}function SC(e){e.liveConsumerNode??=[],e.liveConsumerIndexOfThis??=[]}function IC(e){return void 0!==e.producerNode}const hm=Symbol("UNSET"),pm=Symbol("COMPUTING"),Bd=Symbol("ERRORED"),jF={...kd,value:hm,dirty:!0,error:null,equal:vC,producerMustRecompute:e=>e.value===hm||e.value===pm,producerRecomputeValue(e){if(e.value===pm)throw new Error("Detected cycle in computations.");const t=e.value;e.value=pm;const r=Pd(e);let i;try{i=e.computation()}catch(s){i=Bd,e.error=s}finally{um(e,r)}t!==hm&&t!==Bd&&i!==Bd&&e.equal(t,i)?e.value=t:(e.value=i,e.version++)}};let TC=function $F(){throw new Error};function xC(){TC()}let Vd=null;function AC(e,t){EC()||xC(),e.equal(e.value,t)||(e.value=t,function WF(e){e.version++,function VF(){Od++}(),bC(e),Vd?.()}(e))}const GF={...kd,equal:vC,value:void 0};function at(e){return"function"==typeof e}function Ud(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 gm=Ud(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 jd(e,t){if(e){const r=e.indexOf(t);0<=r&&e.splice(r,1)}}class Et{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 gm?o.errors:[o]}const{_finalizers:s}=this;if(s){this._finalizers=null;for(const o of s)try{OC(o)}catch(a){t=t??[],a instanceof gm?t=[...t,...a.errors]:t.push(a)}}if(t)throw new gm(t)}}add(t){var r;if(t&&t!==this)if(this.closed)OC(t);else{if(t instanceof Et){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)&&jd(r,t)}remove(t){const{_finalizers:r}=this;r&&jd(r,t),t instanceof Et&&t._removeParent(this)}}Et.EMPTY=(()=>{const e=new Et;return e.closed=!0,e})();const NC=Et.EMPTY;function RC(e){return e instanceof Et||e&&"closed"in e&&at(e.remove)&&at(e.add)&&at(e.unsubscribe)}function OC(e){at(e)?e():e.unsubscribe()}const qs={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},$d={setTimeout(e,t,...r){const{delegate:i}=$d;return i?.setTimeout?i.setTimeout(e,t,...r):setTimeout(e,t,...r)},clearTimeout(e){const{delegate:t}=$d;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function kC(e){$d.setTimeout(()=>{const{onUnhandledError:t}=qs;if(!t)throw e;t(e)})}function mm(){}const KF=ym("C",void 0,void 0);function ym(e,t,r){return{kind:e,value:t,error:r}}let Gs=null;function Hd(e){if(qs.useDeprecatedSynchronousErrorHandling){const t=!Gs;if(t&&(Gs={errorThrown:!1,error:null}),e(),t){const{errorThrown:r,error:i}=Gs;if(Gs=null,r)throw i}}else e()}class vm extends Et{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,RC(t)&&t.add(this)):this.destination=n3}static create(t,r,i){return new wm(t,r,i)}next(t){this.isStopped?bm(function YF(e){return ym("N",e,void 0)}(t),this):this._next(t)}error(t){this.isStopped?bm(function QF(e){return ym("E",void 0,e)}(t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?bm(KF,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 XF=Function.prototype.bind;function _m(e,t){return XF.call(e,t)}class e3{constructor(t){this.partialObserver=t}next(t){const{partialObserver:r}=this;if(r.next)try{r.next(t)}catch(i){zd(i)}}error(t){const{partialObserver:r}=this;if(r.error)try{r.error(t)}catch(i){zd(i)}else zd(t)}complete(){const{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(r){zd(r)}}}class wm extends vm{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&&qs.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=()=>this.unsubscribe(),s={next:t.next&&_m(t.next,o),error:t.error&&_m(t.error,o),complete:t.complete&&_m(t.complete,o)}):s=t}this.destination=new e3(s)}}function zd(e){qs.useDeprecatedSynchronousErrorHandling?function JF(e){qs.useDeprecatedSynchronousErrorHandling&&Gs&&(Gs.errorThrown=!0,Gs.error=e)}(e):kC(e)}function bm(e,t){const{onStoppedNotification:r}=qs;r&&$d.setTimeout(()=>r(e,t))}const n3={closed:!0,next:mm,error:function t3(e){throw e},complete:mm},Em="function"==typeof Symbol&&Symbol.observable||"@@observable";function Ws(e){return e}function PC(e){return 0===e.length?Ws:1===e.length?e[0]:function(r){return e.reduce((i,s)=>s(i),r)}}let jt=(()=>{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 s3(e){return e&&e instanceof vm||function i3(e){return e&&at(e.next)&&at(e.error)&&at(e.complete)}(e)&&RC(e)}(r)?r:new wm(r,i,s);return Hd(()=>{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=LC(i))((s,o)=>{const a=new wm({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)}[Em](){return this}pipe(...r){return PC(r)(this)}toPromise(r){return new(r=LC(r))((i,s)=>{let o;this.subscribe(a=>o=a,a=>s(a),()=>i(o))})}}return e.create=t=>new e(t),e})();function LC(e){var t;return null!==(t=e??qs.Promise)&&void 0!==t?t:Promise}const o3=Ud(e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});let Xe=(()=>{class e extends jt{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(r){const i=new FC(this,this);return i.operator=r,i}_throwIfClosed(){if(this.closed)throw new o3}next(r){Hd(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const i of this.currentObservers)i.next(r)}})}error(r){Hd(()=>{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(){Hd(()=>{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?NC:(this.currentObservers=null,o.push(r),new Et(()=>{this.currentObservers=null,jd(o,r)}))}_checkFinalizedStatuses(r){const{hasError:i,thrownError:s,isStopped:o}=this;i?r.error(s):o&&r.complete()}asObservable(){const r=new jt;return r.source=this,r}}return e.create=(t,r)=>new FC(t,r),e})();class FC extends Xe{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:NC}}class Jn extends Xe{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 BC(e){return at(e?.lift)}function $t(e){return t=>{if(BC(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 Ct(e,t,r,i,s){return new a3(e,t,r,i,s)}class a3 extends vm{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 Ve(e,t){return $t((r,i)=>{let s=0;r.subscribe(Ct(i,o=>{i.next(e.call(t,o,s++))}))})}const VC="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 Cm(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 $e(e){for(let t in e)if(e[t]===$e)return t;throw Error("Could not find renamed property on target object.")}function c3(e,t){for(const r in t)t.hasOwnProperty(r)&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Mt(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(Mt).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 Dm(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}const l3=$e({__forward_ref__:$e});function et(e){return e.__forward_ref__=et,e.toString=function(){return Mt(this())},e}function ie(e){return Gd(e)?e():e}function Gd(e){return"function"==typeof e&&e.hasOwnProperty(l3)&&e.__forward_ref__===et}function H(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function Nt(e){return{providers:e.providers||[],imports:e.imports||[]}}function Wd(e){return HC(e,Kd)||HC(e,zC)}function HC(e,t){return e.hasOwnProperty(t)?e[t]:null}function Zd(e){return e&&(e.hasOwnProperty(Sm)||e.hasOwnProperty(g3))?e[Sm]:null}const Kd=$e({\u0275prov:$e}),Sm=$e({\u0275inj:$e}),zC=$e({ngInjectableDef:$e}),g3=$e({ngInjectorDef:$e});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=H({token:this,providedIn:r.providedIn||"root",factory:r.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}function Mm(e){return e&&!!e.\u0275providers}const Qc=$e({\u0275cmp:$e}),Nm=$e({\u0275dir:$e}),Rm=$e({\u0275pipe:$e}),GC=$e({\u0275mod:$e}),bi=$e({\u0275fac:$e}),Yc=$e({__NG_ELEMENT_ID__:$e}),WC=$e({__NG_ENV_ID__:$e});function he(e){return"string"==typeof e?e:null==e?"":String(e)}function Om(e,t){throw new A(-201,!1)}var Ie=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}(Ie||{});let km;function ZC(){return km}function Sn(e){const t=km;return km=e,t}function KC(e,t,r){const i=Wd(e);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:r&Ie.Optional?null:void 0!==t?t:void Om()}const Jc={},Pm="__NG_DI_FLAG__",Qd="ngTempTokenPath",b3=/\n/gm,QC="__source";let ta;function es(e){const t=ta;return ta=e,t}function D3(e,t=Ie.Default){if(void 0===ta)throw new A(-203,!1);return null===ta?KC(e,void 0,t):ta.get(e,t&Ie.Optional?null:void 0,t)}function Z(e,t=Ie.Default){return(ZC()||D3)(ie(e),t)}function O(e,t=Ie.Default){return Z(e,Yd(t))}function Yd(e){return typeof e>"u"||"number"==typeof e?e:(e.optional&&8)|(e.host&&1)|(e.self&&2)|(e.skipSelf&&4)}function Lm(e){const t=[];for(let r=0;rArray.isArray(r)?na(r,t):t(r))}function JC(e,t,r){t>=e.length?e.push(r):e.splice(t,0,r)}function ef(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 XC(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 Bm(e,t){const r=ra(e,t);if(r>=0)return e[1|r]}function ra(e,t){return function eD(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(vr(i))return!1;a=!0}}}}else{if(!a&&!vr(i)&&!vr(l))return!1;if(a&&vr(l))continue;a=!1,i=l|1&i}}return vr(i)||a}function vr(e){return!(1&e)}function L3(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&&!vr(a)&&(t+=aD(o,s),s=""),i=a,o=o||!vr(i);r++}return""!==s&&(t+=aD(o,s)),t}function ns(e){return wi(()=>{const t=lD(e),r={...t,decls:e.decls,vars:e.vars,template:e.template,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,onPush:e.changeDetection===rf.OnPush,directiveDefs:null,pipeDefs:null,dependencies:t.standalone&&e.dependencies||null,getStandaloneInjector:null,signals:e.signals??!1,data:e.data||{},encapsulation:e.encapsulation||yr.Emulated,styles:e.styles||ke,_:null,schemas:e.schemas||null,tView:null,id:""};uD(r);const i=e.dependencies;return r.directiveDefs=sf(i,!1),r.pipeDefs=sf(i,!0),r.id=function W3(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 z3(e){return Ce(e)||Rt(e)}function q3(e){return null!==e}function Ht(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 cD(e,t){if(null==e)return Br;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 wi(()=>{const t=lD(e);return uD(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 Ce(e){return e[Qc]||null}function Rt(e){return e[Nm]||null}function Gt(e){return e[Rm]||null}function en(e,t){const r=e[GC]||null;if(!r&&!0===t)throw new Error(`Type ${Mt(e)} does not have '\u0275mod' property.`);return r}function lD(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||Br,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 uD(e){e.features?.forEach(t=>t(e))}function sf(e,t){if(!e)return null;const r=t?Gt:z3;return()=>("function"==typeof e?e():e).map(i=>r(i)).filter(q3)}function Z3(...e){return{\u0275providers:$m(0,e),\u0275fromNgModule:!0}}function $m(e,...t){const r=[],i=new Set;let s;const o=a=>{r.push(a)};return na(t,a=>{const c=a;af(c,o,[],i)&&(s||=[],s.push(c))}),void 0!==s&&dD(s,o),r}function dD(e,t){for(let r=0;r{t(o,i)})}}function af(e,t,r,i){if(!(e=ie(e)))return!1;let s=null,o=Zd(e);const a=!o&&Ce(e);if(o||a){if(a&&!a.standalone)return!1;s=e}else{const l=e.ngModule;if(o=Zd(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)af(u,t,r,i)}}else{if(!o)return!1;{if(null!=o.imports&&!c){let u;i.add(s);try{na(o.imports,d=>{af(d,t,r,i)&&(u||=[],u.push(d))})}finally{}void 0!==u&&dD(u,t)}if(!c){const u=Zs(s)||(()=>new s);t({provide:s,useFactory:u,deps:ke},s),t({provide:Vm,useValue:s,multi:!0},s),t({provide:Vr,useValue:()=>Z(s),multi:!0},s)}const l=o.providers;if(null!=l&&!c){const u=e;Hm(l,d=>{t(d,u)})}}}return s!==e&&void 0!==e.providers}function Hm(e,t){for(let r of e)Mm(r)&&(r=r.\u0275providers),Array.isArray(r)?Hm(r,t):t(r)}const K3=$e({provide:String,useValue:$e});function zm(e){return null!==e&&"object"==typeof e&&K3 in e}function Ks(e){return"function"==typeof e}const qm=new q(""),cf={},Y3={};let Gm;function lf(){return void 0===Gm&&(Gm=new nf),Gm}class Tn{}class ia extends Tn{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,Zm(t,a=>this.processProvider(a)),this.records.set(tD,sa(void 0,this)),s.has("environment")&&this.records.set(Tn,sa(void 0,this));const o=this.records.get(qm);null!=o&&"string"==typeof o.value&&this.scopes.add(o.value),this.injectorDefTypes=new Set(this.get(Vm,ke,Ie.Self))}destroy(){this.assertNotDestroyed(),this._destroyed=!0;const t=ve(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(),ve(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=Ie.Default){if(this.assertNotDestroyed(),t.hasOwnProperty(WC))return t[WC](this);i=Yd(i);const o=es(this),a=Sn(void 0);try{if(!(i&Ie.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)&&Wd(t);l=u&&this.injectableDefInScope(u)?sa(Wm(t),cf):null,this.records.set(t,l)}if(null!=l)return this.hydrate(t,l)}return(i&Ie.Self?lf():this.parent).get(t,r=i&Ie.Optional&&r===Jc?null:r)}catch(c){if("NullInjectorError"===c.name){if((c[Qd]=c[Qd]||[]).unshift(Mt(t)),o)throw c;return function I3(e,t,r,i){const s=e[Qd];throw t[QC]&&s.unshift(t[QC]),e.message=function T3(e,t,r,i=null){e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.slice(2):e;let s=Mt(t);if(Array.isArray(t))s=t.map(Mt).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):Mt(c)))}s=`{${o.join(", ")}}`}return`${r}${i?"("+i+")":""}[${s}]: ${e.replace(b3,"\n ")}`}("\n"+e.message,s,r,i),e.ngTokenPath=s,e[Qd]=null,e}(c,t,"R3InjectorError",this.source)}throw c}finally{Sn(a),es(o)}}resolveInjectorInitializers(){const t=ve(null),r=es(this),i=Sn(void 0);try{const o=this.get(Vr,ke,Ie.Self);for(const a of o)a()}finally{es(r),Sn(i),ve(t)}}toString(){const t=[],r=this.records;for(const i of r.keys())t.push(Mt(i));return`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new A(205,!1)}processProvider(t){let r=Ks(t=ie(t))?t:ie(t&&t.provide);const i=function X3(e){return zm(e)?sa(void 0,e.useValue):sa(pD(e),cf)}(t);if(!Ks(t)&&!0===t.multi){let s=this.records.get(r);s||(s=sa(void 0,cf,!0),s.factory=()=>Lm(s.multi),this.records.set(r,s)),r=t,s.multi.push(t)}this.records.set(r,i)}hydrate(t,r){const i=ve(null);try{return r.value===cf&&(r.value=Y3,r.value=r.factory()),"object"==typeof r.value&&r.value&&function tB(e){return null!==e&&"object"==typeof e&&"function"==typeof e.ngOnDestroy}(r.value)&&this._ngOnDestroyHooks.add(r.value),r.value}finally{ve(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 Wm(e){const t=Wd(e),r=null!==t?t.factory:Zs(e);if(null!==r)return r;if(e instanceof q)throw new A(204,!1);if(e instanceof Function)return function J3(e){if(e.length>0)throw new A(204,!1);const r=function p3(e){return e&&(e[Kd]||e[zC])||null}(e);return null!==r?()=>r.factory(e):()=>new e}(e);throw new A(204,!1)}function pD(e,t,r){let i;if(Ks(e)){const s=ie(e);return Zs(s)||Wm(s)}if(zm(e))i=()=>ie(e.useValue);else if(function hD(e){return!(!e||!e.useFactory)}(e))i=()=>e.useFactory(...Lm(e.deps||[]));else if(function fD(e){return!(!e||!e.useExisting)}(e))i=()=>Z(ie(e.useExisting));else{const s=ie(e&&(e.useClass||e.provide));if(!function eB(e){return!!e.deps}(e))return Zs(s)||Wm(s);i=()=>new s(...Lm(e.deps))}return i}function sa(e,t,r=!1){return{factory:e,value:t,multi:r?[]:void 0}}function Zm(e,t){for(const r of e)Array.isArray(r)?Zm(r,t):r&&Mm(r)?Zm(r.\u0275providers,t):t(r)}function Ei(e,t){e instanceof ia&&e.assertNotDestroyed();const i=es(e),s=Sn(void 0);try{return t()}finally{es(i),Sn(s)}}function gD(){return void 0!==ZC()||null!=function C3(){return ta}()}const lt=0,F=1,ne=2,Dt=3,_r=4,Wt=5,hn=6,aa=7,tt=8,St=9,Ur=10,se=11,rl=12,yD=13,ca=14,ut=15,Qs=16,la=17,Ci=18,ua=19,vD=20,is=21,df=22,Xn=23,Y=25,Ym=1,jr=7,da=9,mt=10;var hf=function(e){return e[e.None=0]="None",e[e.HasTransplantedViews=2]="HasTransplantedViews",e}(hf||{});function kt(e){return Array.isArray(e)&&"object"==typeof e[Ym]}function tn(e){return Array.isArray(e)&&!0===e[Ym]}function Jm(e){return!!(4&e.flags)}function Ys(e){return e.componentOffset>-1}function pf(e){return!(1&~e.flags)}function wr(e){return!!e.template}function sl(e){return!!(512&e[ne])}class pB{constructor(t,r,i){this.previousValue=t,this.currentValue=r,this.firstChange=i}isFirstChange(){return this.firstChange}}function CD(e,t,r,i){null!==t?t.applyValueToInputSignal(t,i):e[r]=i}function er(){return DD}function DD(e){return e.type.prototype.ngOnChanges&&(e.setInput=mB),gB}function gB(){const e=ID(this),t=e?.current;if(t){const r=e.previous;if(r===Br)e.previous=t;else for(let i in t)r[i]=t[i];e.current=null,this.ngOnChanges(t)}}function mB(e,t,r,i,s){const o=this.declaredInputs[i],a=ID(e)||function yB(e,t){return e[SD]=t}(e,{previous:Br,current:null}),c=a.current||(a.current={}),l=a.previous,u=l[o];c[o]=new pB(u&&u.currentValue,r,l===Br),CD(e,t,s,r)}er.ngInherit=!0;const SD="__ngSimpleChanges__";function ID(e){return e[SD]||null}const $r=function(e,t,r){},TD="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 Js(e,t){return e[t]}function Un(e,t){const r=t[e];return kt(r)?r:r[lt]}function ry(e){return!(128&~e[ne])}function tr(e,t){return null==t?null:e[t]}function AD(e){e[la]=0}function MD(e){1024&e[ne]||(e[ne]|=1024,ry(e)&&mf(e))}function gf(e){return!!(9216&e[ne]||e[Xn]?.dirty)}function iy(e){e[Ur].changeDetectionScheduler?.notify(8),64&e[ne]&&(e[ne]|=1024),gf(e)&&mf(e)}function mf(e){e[Ur].changeDetectionScheduler?.notify(0);let t=Di(e);for(;null!==t&&!(8192&t[ne])&&(t[ne]|=8192,ry(t));)t=Di(t)}function yf(e,t){if(!(256&~e[ne]))throw new A(911,!1);null===e[is]&&(e[is]=[]),e[is].push(t)}function Di(e){const t=e[Dt];return tn(t)?t[Dt]:t}const oe={lFrame:HD(null),bindingsEnabled:!0,skipHydrationRootTNode:null};let RD=!1;function OD(){return oe.bindingsEnabled}function N(){return oe.lFrame.lView}function _e(){return oe.lFrame.tView}function nn(e){return oe.lFrame.contextLView=e,e[tt]}function rn(e){return oe.lFrame.contextLView=null,e}function He(){let e=kD();for(;null!==e&&64===e.type;)e=e.parent;return e}function kD(){return oe.lFrame.currentTNode}function br(e,t){const r=oe.lFrame;r.currentTNode=e,r.isParent=t}function ay(){return oe.lFrame.isParent}function cy(){oe.lFrame.isParent=!1}function FD(){return RD}function BD(e){RD=e}function Er(){return oe.lFrame.bindingIndex++}function Ii(e){const t=oe.lFrame,r=t.bindingIndex;return t.bindingIndex=t.bindingIndex+e,r}function NB(e,t){const r=oe.lFrame;r.bindingIndex=r.bindingRootIndex=e,ly(t)}function ly(e){oe.lFrame.currentDirectiveIndex=e}function uy(e){const t=oe.lFrame.currentDirectiveIndex;return-1===t?null:e[t]}function dy(){return oe.lFrame.currentQueryIndex}function _f(e){oe.lFrame.currentQueryIndex=e}function OB(e){const t=e[F];return 2===t.type?t.declTNode:1===t.type?e[Wt]:null}function jD(e,t,r){if(r&Ie.SkipSelf){let s=t,o=e;for(;!(s=s.parent,null!==s||r&Ie.Host||(s=OB(o),null===s||(o=o[ca],10&s.type))););if(null===s)return!1;t=s,e=o}const i=oe.lFrame=$D();return i.currentTNode=t,i.lView=e,!0}function fy(e){const t=$D(),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 $D(){const e=oe.lFrame,t=null===e?null:e.child;return null===t?HD(e):t}function HD(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 zD(){const e=oe.lFrame;return oe.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}const qD=zD;function hy(){const e=zD();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 Zt(){return oe.lFrame.selectedIndex}function eo(e){oe.lFrame.selectedIndex=e}function nt(){const e=oe.lFrame;return al(e.tView,e.selectedIndex)}function wf(){oe.lFrame.currentNamespace=TD}function bf(){!function LB(){oe.lFrame.currentNamespace=null}()}let WD=!0;function ll(){return WD}function Hr(e){WD=e}function Ef(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,KD(c,o)):KD(c,o)}const fa=-1;class ul{constructor(t,r,i){this.factory=t,this.resolving=!1,this.canSeeViewProviders=r,this.injectImpl=i}}const my={};class to{constructor(t,r){this.injector=t,this.parentInjector=r}get(t,r,i){i=Yd(i);const s=this.injector.get(t,my,i);return s!==my||r===my?s:this.parentInjector.get(t,r,i)}}function yy(e){return e!==fa}function dl(e){return 32767&e}function fl(e,t){let r=function HB(e){return e>>16}(e),i=t;for(;r>0;)i=i[ca],r--;return i}let vy=!0;function Sf(e){const t=vy;return vy=e,t}const YD=255,JD=5;let qB=0;const zr={};function If(e,t){const r=XD(e,t);if(-1!==r)return r;const i=t[F];i.firstCreatePass&&(e.injectorIndex=t.length,_y(i.data,e),_y(t,null),_y(i.blueprint,null));const s=Tf(e,t),o=e.injectorIndex;if(yy(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 _y(e,t){e.push(0,0,0,0,0,0,0,0,t)}function XD(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:e.injectorIndex}function Tf(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=oS(s),null===i)return fa;if(r++,s=s[ca],-1!==i.injectorIndex)return i.injectorIndex|r<<16}return fa}function wy(e,t,r){!function GB(e,t,r){let i;"string"==typeof r?i=r.charCodeAt(0)||0:r.hasOwnProperty(Yc)&&(i=r[Yc]),null==i&&(i=r[Yc]=qB++);const s=i&YD;t.data[e+(s>>JD)]|=1<=0?t&YD:QB:t}(r);if("function"==typeof o){if(!jD(t,e,i))return i&Ie.Host?eS(s,0,i):tS(t,r,i,s);try{let a;if(a=o(i),null!=a||i&Ie.Optional)return a;Om()}finally{qD()}}else if("number"==typeof o){let a=null,c=XD(e,t),l=fa,u=i&Ie.Host?t[ut][Wt]:null;for((-1===c||i&Ie.SkipSelf)&&(l=-1===c?Tf(e,t):t[c+8],l!==fa&&sS(i,!1)?(a=t[F],c=dl(l),t=fl(l,t)):c=-1);-1!==c;){const d=t[F];if(iS(o,c,d.data)){const f=ZB(c,t,r,a,i,u);if(f!==zr)return f}l=t[c+8],l!==fa&&sS(i,t[F].data[c+8]===u)&&iS(o,c,t)?(a=d,c=dl(l),t=fl(l,t)):c=-1}}return s}function ZB(e,t,r,i,s,o){const a=t[F],c=a.data[e+8],d=xf(c,a,r,null==i?Ys(c)&&vy:i!=a&&!!(3&c.type),s&Ie.Host&&o===c);return null!==d?no(t,a,d,c):zr}function xf(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&&wr(p)&&p.type===r)return l}return null}function no(e,t,r,i){let s=e[r];const o=t.data;if(function VB(e){return e instanceof ul}(s)){const a=s;a.resolving&&function v3(e,t){throw t&&t.join(" > "),new A(-200,e)}(function Le(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():he(e)}(o[r]));const c=Sf(a.canSeeViewProviders);a.resolving=!0;const u=a.injectImpl?Sn(a.injectImpl):null;jD(e,i,Ie.Default);try{s=e[r]=a.factory(void 0,o,e,i),t.firstCreatePass&&r>=i.directiveStart&&function FB(e,t,r){const{ngOnChanges:i,ngOnInit:s,ngDoCheck:o}=t.type.prototype;if(i){const a=DD(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),Sf(c),a.resolving=!1,qD()}}return s}function iS(e,t,r){return!!(r[t+(e>>JD)]&1<{const t=e.prototype.constructor,r=t[bi]||by(t),i=Object.prototype;let s=Object.getPrototypeOf(e.prototype).constructor;for(;s&&s!==i;){const o=s[bi]||by(s);if(o&&o!==r)return o;s=Object.getPrototypeOf(s)}return o=>new o})}function by(e){return Gd(e)?()=>{const t=by(ie(e));return t&&t()}:Zs(e)}function oS(e){const t=e[F],r=t.type;return 2===r?t.declTNode:1===r?e[Wt]:null}function dS(e,t=null,r=null,i){const s=fS(e,t,r,i);return s.resolveInjectorInitializers(),s}function fS(e,t=null,r=null,i,s=new Set){const o=[r||ke,Z3(e)];return i=i||("object"==typeof e?void 0:Mt(e)),new ia(o,t||lf(),i||null,s)}class It{static{this.THROW_IF_NOT_FOUND=Jc}static{this.NULL=new nf}static create(t,r){if(Array.isArray(t))return dS({name:""},r,t,"");{const i=t.name??"";return dS({name:i},t.parent,t.providers,i)}}static{this.\u0275prov=H({token:It,providedIn:"any",factory:()=>Z(tD)})}static{this.__NG_ELEMENT_ID__=-1}}new q("").__NG_ELEMENT_ID__=e=>{const t=He();if(null===t)throw new A(204,!1);if(2&t.type)return t.value;if(e&Ie.Optional)return null;throw new A(204,!1)};function Cy(e){return e.ngOriginalError}const pS=!0;let pl=(()=>{class e{static{this.__NG_ELEMENT_ID__=aV}static{this.__NG_ENV_ID__=r=>r}}return e})();class oV extends pl{constructor(t){super(),this._lView=t}onDestroy(t){return yf(this._lView,t),()=>function sy(e,t){if(null===e[is])return;const r=e[is].indexOf(t);-1!==r&&e[is].splice(r,1)}(this._lView,t)}}function aV(){return new oV(N())}let ro=(()=>{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=H({token:e,providedIn:"root",factory:()=>new e})}}return e})();const dt=class cV extends Xe{constructor(t=!1){super(),this.destroyRef=void 0,this.pendingTasks=void 0,this.__isAsync=t,gD()&&(this.destroyRef=O(pl,{optional:!0})??void 0,this.pendingTasks=O(ro,{optional:!0})??void 0)}emit(t){const r=ve(null);try{super.next(t)}finally{ve(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 Et&&t.add(c),c}wrapInTimeout(t){return r=>{const i=this.pendingTasks?.add();setTimeout(()=>{t(r),void 0!==i&&this.pendingTasks?.remove(i)})}}};function Mf(...e){}function gS(e){let t,r;function i(){e=Mf;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 mS(e){return queueMicrotask(()=>e()),()=>{e=Mf}}const Dy="isAngularZone",Nf=Dy+"_ID";let lV=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=pS}=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 fV(e){const t=()=>{!function dV(e){function t(){gS(()=>{e.callbackScheduled=!1,Iy(e),e.isCheckStableRunning=!0,Sy(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=lV++;e._inner=e._inner.fork({name:"angular",properties:{[Dy]:!0,[Nf]:r,[Nf+r]:!0},onInvokeTask:(i,s,o,a,c,l)=>{if(function hV(e){return _S(e,"__ignore_ng_zone__")}(l))return i.invokeTask(o,a,c,l);try{return yS(e),i.invokeTask(o,a,c,l)}finally{(e.shouldCoalesceEventChangeDetection&&"eventTask"===a.type||e.shouldCoalesceRunChangeDetection)&&t(),vS(e)}},onInvoke:(i,s,o,a,c,l,u)=>{try{return yS(e),i.invoke(o,a,c,l,u)}finally{e.shouldCoalesceRunChangeDetection&&!e.callbackScheduled&&!function pV(e){return _S(e,"__scheduler_tick__")}(l)&&t(),vS(e)}},onHasTask:(i,s,o,a)=>{i.hasTask(o,a),s===o&&("microTask"==a.change?(e._hasPendingMicrotasks=a.microTask,Iy(e),Sy(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(Dy)}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,uV,Mf,Mf);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 uV={};function Sy(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 yS(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function vS(e){e._nesting--,Sy(e)}class Ty{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 _S(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&&Cy(t);for(;r&&Cy(r);)r=Cy(r);return r||null}}const mV=new q("",{providedIn:"root",factory:()=>{const e=O(Ne),t=O(nr);return r=>e.runOutsideAngular(()=>t.handleError(r))}});function yV(){return ga(He(),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__=yV}}return e})();function bS(e){return e instanceof jn?e.nativeElement:e}function vV(){return this._results[Symbol.iterator]()}class xy{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=xy.prototype;r[Symbol.iterator]||(r[Symbol.iterator]=vV)}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 In(e){return e.flat(Number.POSITIVE_INFINITY)}(t);(this._changesDetected=!function N3(e,t,r){if(e.length!==t.length)return!1;for(let i=0;iVV}),VV="ng",jS=new q(""),os=new q("",{providedIn:"platform",factory:()=>"unknown"}),$S=new q(""),HS=new q("",{providedIn:"root",factory:()=>ss().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});let zS=()=>null;function Uy(e,t,r=!1){return zS(e,t,r)}const JS=new q("",{providedIn:"root",factory:()=>!1});let Uf,jf;function wa(e){return function qy(){if(void 0===Uf&&(Uf=null,ct.trustedTypes))try{Uf=ct.trustedTypes.createPolicy("angular",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})}catch{}return Uf}()?.createHTML(e)||e}function tI(e){return function Gy(){if(void 0===jf&&(jf=null,ct.trustedTypes))try{jf=ct.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})}catch{}return jf}()?.createHTML(e)||e}class so{constructor(t){this.changingThisBreaksApplicationSecurity=t}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${VC})`}}class XV extends so{getTypeName(){return"HTML"}}class e8 extends so{getTypeName(){return"Style"}}class t8 extends so{getTypeName(){return"Script"}}class n8 extends so{getTypeName(){return"URL"}}class r8 extends so{getTypeName(){return"ResourceURL"}}function $n(e){return e instanceof so?e.changingThisBreaksApplicationSecurity:e}function qr(e,t){const r=function i8(e){return e instanceof so&&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 ${VC})`)}return r===t}class u8{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 d8{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 h8=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function $f(e){return(e=String(e)).match(h8)?e:"unsafe:"+e}function Ti(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 sI=Ti("area,br,col,hr,img,wbr"),oI=Ti("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),aI=Ti("rp,rt"),Wy=Cl(sI,Cl(oI,Ti("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(aI,Ti("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(aI,oI)),Zy=Ti("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),cI=Cl(Zy,Ti("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"),Ti("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")),p8=Ti("script,style,template");class g8{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=v8(r);else for(;r;){r.nodeType===Node.ELEMENT_NODE&&this.endElement(r);let o=y8(r);if(o){r=o;break}r=s.pop()}return this.buf.join("")}startElement(t){const r=lI(t).toLowerCase();if(!Wy.hasOwnProperty(r))return this.sanitizedSomething=!0,!p8.hasOwnProperty(r);this.buf.push("<"),this.buf.push(r);const i=t.attributes;for(let s=0;s"),!0}endElement(t){const r=lI(t).toLowerCase();Wy.hasOwnProperty(r)&&!sI.hasOwnProperty(r)&&(this.buf.push(""))}chars(t){this.buf.push(dI(t))}}function y8(e){const t=e.nextSibling;if(t&&e!==t.previousSibling)throw uI(t);return t}function v8(e){const t=e.firstChild;if(t&&function m8(e,t){return(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)!==Node.DOCUMENT_POSITION_CONTAINED_BY}(e,t))throw uI(t);return t}function lI(e){const t=e.nodeName;return"string"==typeof t?t:"FORM"}function uI(e){return new Error(`Failed to sanitize html because the element is clobbered: ${e.outerHTML}`)}const _8=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,w8=/([^\#-~ |!])/g;function dI(e){return e.replace(/&/g,"&").replace(_8,function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"}).replace(w8,function(t){return"&#"+t.charCodeAt(0)+";"}).replace(//g,">")}let Hf;function fI(e,t){let r=null;try{Hf=Hf||function iI(e){const t=new d8(e);return function f8(){try{return!!(new window.DOMParser).parseFromString(wa(""),"text/html")}catch{return!1}}()?new u8(t):t}(e);let i=t?String(t):"";r=Hf.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=Hf.getInertBodyElement(i)}while(i!==o);return wa((new g8).sanitizeChildren(Ky(r)||r))}finally{if(r){const i=Ky(r)||r;for(;i.firstChild;)i.firstChild.remove()}}}function Ky(e){return"content"in e&&function b8(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 Qy(e){const t=function Dl(){const e=N();return e&&e[Ur].sanitizer}();return t?tI(t.sanitize(Hn.HTML,e)||""):qr(e,"HTML")?tI($n(e)):fI(ss(),he(e))}const T8=/^>|^->||--!>|)/g,A8="\u200b$1\u200b";function wI(e){return e.ownerDocument.defaultView}function zn(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 Xy;function ev(e,t){return Xy(e,t)}function Ea(e,t,r,i,s){if(null!=i){let o,a=!1;tn(i)?o=i:kt(i)&&(a=!0,i=i[lt]);const c=Pe(i);0===e&&null!==r?null==s?AI(t,r,c):oo(t,r,c,s||null,!0):1===e&&null!==r?oo(t,r,c,s||null,!0):2===e?function Il(e,t,r){e.removeChild(null,t,r)}(t,c,a):3===e&&t.destroyNode(c),null!=o&&function Z8(e,t,r,i,s){const o=r[jr];o!==Pe(r)&&Ea(t,e,i,o,s);for(let c=mt;ct.replace(x8,A8))}(t))}function Gf(e,t,r){return e.createElement(t,r)}function II(e,t){t[Ur].changeDetectionScheduler?.notify(9),Kf(e,t,t[se],2,null,null)}function TI(e,t){const r=e[da],i=t[Dt];(kt(i)||t[ut]!==i[Dt][ut])&&(e[ne]|=hf.HasTransplantedViews),null===r?e[da]=[t]:r.push(t)}function rv(e,t){const r=e[da],i=r.indexOf(t);r.splice(i,1)}function Sl(e,t){if(e.length<=mt)return;const r=mt+t,i=e[r];if(i){const s=i[Qs];null!==s&&s!==e&&rv(s,i),t>0&&(e[r-1][_r]=i[_r]);const o=ef(e,mt+t);!function U8(e,t){II(e,t),t[lt]=null,t[Wt]=null}(i[F],i);const a=o[Ci];null!==a&&a.detachView(o[F]),i[Dt]=null,i[_r]=null,i[ne]&=-129}return i}function Wf(e,t){if(!(256&t[ne])){const r=t[se];r.destroyNode&&Kf(e,t,r,3,null,null),function $8(e){let t=e[rl];if(!t)return iv(e[F],e);for(;t;){let r=null;if(kt(t))r=t[rl];else{const i=t[mt];i&&(r=i)}if(!r){for(;t&&!t[_r]&&t!==e;)kt(t)&&iv(t[F],t),t=t[Dt];null===t&&(t=e),kt(t)&&iv(t[F],t),r=t&&t[_r]}t=r}}(t)}}function iv(e,t){if(256&t[ne])return;const r=ve(null);try{t[ne]&=-129,t[ne]|=256,t[Xn]&&fm(t[Xn]),function q8(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===yr.None||o===yr.Emulated)return null}return pn(i,r)}}(e,t.parent,r)}function oo(e,t,r,i,s){e.insertBefore(t,r,i,s)}function AI(e,t,r){e.appendChild(t,r)}function MI(e,t,r,i,s){null!==i?oo(e,t,r,i,s):AI(e,t,r)}function ov(e,t){return e.parentNode(t)}let av,OI=function RI(e,t,r){return 40&e.type?pn(e,r):null};function Zf(e,t,r,i){const s=sv(e,i,t),o=t[se],c=function NI(e,t,r){return OI(e,t,r)}(i.parent||t[Wt],i,t);if(null!=s)if(Array.isArray(r))for(let l=0;lY&&UI(e,t,Y,!1),$r(a?2:0,s),r(i,s)}finally{eo(o),$r(a?3:1,s)}}function dv(e,t,r){if(Jm(t)){const i=ve(null);try{const o=t.directiveEnd;for(let a=t.directiveStart;anull;function GI(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?WI(i,r,u,c,l):WI(i,r,u,c)}return i}function WI(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])?(_v(e,r,d,i,s),Ys(t)&&function aU(e,t){const r=Un(t,e);16&r[ne]||(r[ne]|=64)}(r,t.index)):3&t.type&&(i=function oU(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 gv(e,t,r,i){if(OD()){const s=null===i?null:{"":-1},o=function hU(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,Tl(e,r,s.hostVars,pe),s)}function Gr(e,t,r,i,s,o){const a=pn(e,t);!function yv(e,t,r,i,s,o,a){if(null==o)e.removeAttribute(t,s,r);else{const c=null==a?he(o):a(o,i||"",s);e.setAttribute(t,s,c,r)}}(t[se],a,o,e.value,r,i,s)}function _U(e,t,r,i,s,o){const a=o[t];if(null!==a)for(let c=0;c{mf(e.lView)},consumerOnSignalRead(){this.lView[Xn]=this}},AU={...kd,consumerIsAlwaysLive:!0,consumerMarkedDirty:e=>{let t=Di(e.lView);for(;t&&!iT(t[F]);)t=Di(t);t&&MD(t)},consumerOnSignalRead(){this.lView[Xn]=this}};function iT(e){return 2!==e.type}const MU=100;function Xf(e,t=!0,r=0){const i=e[Ur],s=i.rendererFactory;s.begin?.();try{!function NU(e,t){const r=FD();try{BD(!0),Ev(e,t);let i=0;for(;gf(e);){if(i===MU)throw new A(103,!1);i++,Ev(e,1)}}finally{BD(r)}}(e,r)}catch(a){throw t&&Jf(e,a),a}finally{s.end?.(),i.inlineEffectRunner?.flush()}}function RU(e,t,r,i){const s=t[ne];if(!(256&~s))return;t[Ur].inlineEffectRunner?.flush(),fy(t);let c=!0,l=null,u=null;iT(e)?(u=function DU(e){return e[Xn]??function SU(e){const t=rT.pop()??Object.create(TU);return t.lView=e,t}(e)}(t),l=Pd(u)):null===function _C(){return At}()?(c=!1,u=function xU(e){const t=e[Xn]??Object.create(AU);return t.lView=e,t}(t),l=Pd(u)):t[Xn]&&(fm(t[Xn]),t[Xn]=null);try{AD(t),function VD(e){return oe.lFrame.bindingIndex=e}(e.bindingStartIndex),null!==r&&HI(e,t,r,2,i);const d=!(3&~s);if(d){const p=e.preOrderCheckHooks;null!==p&&Cf(t,p,null)}else{const p=e.preOrderHooks;null!==p&&Df(t,p,0,null),py(t,0)}if(function OU(e){for(let t=NS(e);null!==t;t=RS(t)){if(!(t[ne]&hf.HasTransplantedViews))continue;const r=t[da];for(let i=0;i-1&&(Sl(t,i),ef(r,i))}this._attachedToViewContainer=!1}Wf(this._lView[F],this._lView)}onDestroy(t){yf(this._lView,t)}markForCheck(){Al(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[ne]&=-129}reattach(){iy(this._lView),this._lView[ne]|=128}detectChanges(){this._lView[ne]|=1024,Xf(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[Qs];null!==r&&!t&&rv(r,this._lView),II(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[Qs];null!==i&&!r&&TI(i,this._lView),iy(this._lView)}}let Ai=(()=>{class e{static{this.__NG_ELEMENT_ID__=FU}}return e})();const PU=Ai,LU=class extends PU{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=ve(null);try{const o=t.tView,l=Qf(e,o,r,4096&e[ne]?4096:16,null,t,null,null,i?.injector??null,i?.embeddedViewInjector??null,i?.dehydratedView??null);l[Qs]=e[t.index];const d=e[Ci];return null!==d&&(l[Ci]=d.createEmbeddedView(o)),wv(o,l,r),l}finally{ve(s)}}(this._declarationLView,this._declarationTContainer,t,{embeddedViewInjector:r,dehydratedView:i});return new Ml(s)}};function FU(){return eh(He(),N())}function eh(e,t){return 4&e.type?new LU(t,e,ga(e,t)):null}class Ia{}const Bl=new q("",{providedIn:"root",factory:()=>!1}),MT=new q(""),Ov=new q("");class Aj{}class NT{}class Nj{resolveComponentFactory(t){throw function Mj(e){const t=Error(`No component factory found for ${Mt(e)}.`);return t.ngComponent=e,t}(t)}}class Vl{static{this.NULL=new Nj}}class oh{}let Oj=(()=>{class e{static{this.\u0275prov=H({token:e,providedIn:"root",factory:()=>null})}}return e})();function ch(e,t,r){let i=r?e.styles:null,s=r?e.classes:null,o=0;if(null!==t)for(let a=0;a0&&BI(e,r,o.join(" "))}}(h,C,g,i),void 0!==r&&function Hj(e,t,r){const i=e.projection=[];for(let s=0;s{class e{static{this.__NG_ELEMENT_ID__=qj}}return e})();function qj(){return VT(He(),N())}const Gj=rr,FT=class extends Gj{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 Pt(this._hostTNode,this._hostLView)}get parentInjector(){const t=Tf(this._hostTNode,this._hostLView);if(yy(t)){const r=fl(t,this._hostLView),i=dl(t);return new Pt(r[F].data[i+8],r)}return new Pt(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const r=BT(this._lContainer);return null!==r&&r[t]||null}get length(){return this._lContainer.length-mt}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,lo(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(Ce(t)),u=i||this.parentInjector;if(!o&&null==l.ngModule){const m=(a?u:this.parentInjector).get(Tn,null);m&&(o=m)}Ce(l.componentType??{});const p=l.create(u,s,null,o);return this.insertImpl(p.hostView,c,lo(this._hostTNode,null)),p}insert(t,r){return this.insertImpl(t,r,!0)}insertImpl(t,r,i){const s=t._lView;if(function bB(e){return tn(e[Dt])}(s)){const c=this.indexOf(t);if(-1!==c)this.detach(c);else{const l=s[Dt],u=new FT(l,l[Wt],l[Dt]);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 H8(e,t,r,i){const s=mt+i,o=r.length;i>0&&(r[s-1][_r]=t),i!1;class Bv{constructor(t){this.queryList=t,this.matches=null}clone(){return new Bv(this.queryList)}setDirty(){this.queryList.setDirty()}}class Vv{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 Uv{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=mt;f(lm(t),t.value);return r[mr]=t,r}(e),i=r[mr];return t?.equal&&(i.equal=t.equal),r.set=s=>AC(i,s),r.update=s=>function qF(e,t){EC()||xC(),AC(e,t(e.value))}(i,s),r.asReadonly=JT.bind(r),r}function JT(){const e=this[mr];if(void 0===e.readonlyFn){const t=()=>this();t[mr]=e,e.readonlyFn=t}return e.readonlyFn}function Ue(e){let t=function u1(e){return Object.getPrototypeOf(e.prototype).constructor}(e.type),r=!0;const i=[e];for(;t;){let s;if(wr(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=uh(e.inputs),a.inputTransforms=uh(e.inputTransforms),a.declaredInputs=uh(e.declaredInputs),a.outputs=uh(e.outputs);const c=s.hostBindings;c&&m4(e,c);const l=s.viewQuery,u=s.contentQueries;if(l&&p4(e,l),u&&g4(e,u),f4(e,s),c3(e.outputs,s.outputs),wr(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 f4(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 uh(e){return e===Br?{}:e===ke?[]:e}function p4(e,t){const r=e.viewQuery;e.viewQuery=r?(i,s)=>{t(i,s),r(i,s)}:t}function g4(e,t){const r=e.contentQueries;e.contentQueries=r?(i,s,o)=>{t(i,s,o),r(i,s,o)}:t}function m4(e,t){const r=e.hostBindings;e.hostBindings=r?(i,s)=>{t(i,s),r(i,s)}:t}class ho{}class g1{}class Gv extends ho{constructor(t,r,i,s=!0){super(),this.ngModuleType=t,this._parent=r,this._bootstrapComponents=[],this.destroyCbs=[],this.componentFactoryResolver=new PT(this);const o=en(t);this._bootstrapComponents=zn(o.bootstrap),this._r3Injector=fS(t,r,[{provide:ho,useValue:this},{provide:Vl,useValue:this.componentFactoryResolver},...i],Mt(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 Wv extends g1{constructor(t){super(),this.moduleType=t}create(t){return new Gv(this.moduleType,t,[])}}class m1 extends ho{constructor(t){super(),this.componentFactoryResolver=new PT(this),this.instance=null;const r=new ia([...t.providers,{provide:ho,useValue:this},{provide:Vl,useValue:this.componentFactoryResolver}],t.parent||lf(),t.debugName,new Set(["environment"]));this.injector=r,t.runEnvironmentInitializers&&r.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(t){this.injector.onDestroy(t)}}function dh(e,t,r=null){return new m1({providers:e,parent:t,debugName:r,runEnvironmentInitializers:!0}).injector}function fh(e){return!!function Zv(e){return null!==e&&("function"==typeof e||"object"==typeof e)}(e)&&(Array.isArray(e)||!(e instanceof Map)&&Symbol.iterator in e)}function yt(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 x4(e,t,r,i,s,o,a,c,l){const u=t.consts,d=co(t,e,4,a||null,c||null);gv(t,r,d,tr(u,l)),Ef(t,d);const f=d.tView=pv(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];br(f,!1);const h=y1(t,e,f,r);ll()&&Zf(t,e,h,f),sn(h,e);const p=QI(h,e,h,f);return e[d]=p,Yf(e,p),function jT(e,t,r){return Fv(e,t,r)}(p,f,e),pf(f)&&fv(t,e,f),null!=l&&hv(e,f,u),f}function sr(e,t,r,i,s,o,a,c){const l=N(),u=_e();return ql(l,u,e,t,r,i,s,tr(u.consts,o),a,c),sr}let y1=function v1(e,t,r,i){return Hr(!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 D1=(()=>{class e{constructor(){this.impl=null}execute(){this.impl?.execute()}static{this.\u0275prov=H({token:e,providedIn:"root",factory:()=>new e})}}return e})();class Zl{constructor(){this.ngZone=O(Ne),this.scheduler=O(Ia),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=H({token:Zl,providedIn:"root",factory:()=>new Zl})}}class R4{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 yh(e,t){!t?.injector&&function Km(e){if(!gD())throw new A(-203,!1)}();const r=t?.injector??O(It);return function qn(e){return"browser"===(e??O(It)).get(os)}(r)?(mn("NgAfterNextRender"),function S1(e,t,r,i){const s=t.get(D1);s.impl??=t.get(Zl);const o=r?.phase??Ma.MixedReadWrite,a=!0!==r?.manualCleanup?t.get(pl):null,c=new R4(s.impl,function k4(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)):I1}const I1={destroy(){}};function Kt(e,t,r,i){const s=N();return yt(s,Er(),t)&&(_e(),Gr(nt(),s,e,t,r,i)),Kt}function wh(e,t){return e<<17|t<<2}function ds(e){return e>>17&32767}function o0(e){return 2|e}function mo(e){return(131068&e)>>2}function a0(e,t){return-131069&e|t<<2}function c0(e){return 1|e}function J1(e,t,r,i){const s=e[r+1],o=null===t;let a=i?ds(s):mo(s),c=!1;for(;0!==a&&(!1===c||o);){const u=e[a+1];m6(e[a],t)&&(c=!0,e[a+1]=i?c0(u):o0(u)),a=i?ds(u):mo(u)}c&&(e[r+1]=i?o0(s):c0(s))}function m6(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 Lt={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function X1(e){return e.substring(Lt.key,Lt.keyEnd)}function ex(e,t){const r=Lt.textEnd;return r===t?-1:(t=Lt.keyEnd=function w6(e,t,r){for(;t32;)t++;return t}(e,Lt.key=t,r),qa(e,t,r))}function qa(e,t,r){for(;t=0;r=ex(t,r))Vn(e,X1(t),!0)}function Cr(e,t,r,i){const s=N(),o=_e(),a=Ii(2);o.firstUpdatePass&&ox(o,e,a,i),t!==pe&&yt(s,a,t)&&cx(o,o.data[Zt()],s,s[se],e,s[a+1]=function N6(e,t){return null==e||""===e||("string"==typeof t?e+=t:"object"==typeof e&&(e=Mt($n(e)))),e}(t,r),i,a)}function sx(e,t){return t>=e.expandoStartIndex}function ox(e,t,r,i){const s=e.data;if(null===s[r+1]){const o=s[Zt()],a=sx(e,r);ux(o,i)&&null===t&&!a&&(t=!1),t=function D6(e,t,r,i){const s=uy(e);let o=i?t.residualClasses:t.residualStyles;if(null===s)0===(i?t.classBindings:t.styleBindings)&&(r=Yl(r=u0(null,e,t,r,i),t.attrs,i),o=null);else{const a=t.directiveStylingLast;if(-1===a||e[a]!==s)if(r=u0(s,e,t,r,i),null===o){let l=function S6(e,t,r){const i=r?t.classBindings:t.styleBindings;if(0!==mo(i))return e[ds(i)]}(e,t,i);void 0!==l&&Array.isArray(l)&&(l=u0(null,e,t,l[1],i),l=Yl(l,t.attrs,i),function I6(e,t,r,i){e[ds(r?t.classBindings:t.styleBindings)]=i}(e,t,i,l))}else o=function T6(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]=wh(h,c),0!==h&&(e[h+1]=a0(e[h+1],i)),e[c+1]=function f6(e,t){return 131071&e|t<<17}(e[c+1],i)}else e[i+1]=wh(c,0),0!==c&&(e[c+1]=a0(e[c+1],i)),c=i;else e[i+1]=wh(l,0),0===c?c=i:e[l+1]=a0(e[l+1],i),l=i;u&&(e[i+1]=o0(e[i+1])),J1(e,d,i,!0),J1(e,d,i,!1),function g6(e,t,r,i,s){const o=s?e.residualClasses:e.residualStyles;null!=o&&"string"==typeof t&&ra(o,t)>=0&&(r[i+1]=c0(r[i+1]))}(t,d,e,i,o),a=wh(c,l),o?t.classBindings=a:t.styleBindings=a}(s,o,t,r,a,i)}}function u0(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===pe&&(h=f?ke:void 0);let p=f?Bm(h,i):d===i?h:void 0;if(u&&!bh(p)&&(p=Bm(l,i)),bh(p)&&(c=p,a))return c;const g=e[s+1];s=a?ds(g):mo(g)}if(null!==t){let l=o?t.residualClasses:t.residualStyles;null!=l&&(c=Bm(l,i))}return c}function bh(e){return void 0!==e}function ux(e,t){return!!(e.flags&(t?8:16))}function ge(e,t,r,i){const s=N(),o=_e(),a=Y+e,c=s[se],l=o.firstCreatePass?function e$(e,t,r,i,s,o){const a=t.consts,l=co(t,e,2,i,tr(a,s));return gv(t,r,l,tr(a,o)),null!==l.attrs&&ch(l,l.attrs,!1),null!==l.mergedAttrs&&ch(l,l.mergedAttrs,!0),null!==t.queries&&t.queries.elementStart(t,l),l}(a,o,s,t,r,i):o.data[a],u=px(o,s,l,c,t,e);s[a]=u;const d=pf(l);return br(l,!0),VI(c,u,l),!function xa(e){return!(32&~e.flags)}(l)&&ll()&&Zf(o,s,u,l),0===function EB(){return oe.lFrame.elementDepthCount}()&&sn(u,s),function CB(){oe.lFrame.elementDepthCount++}(),d&&(fv(o,s,l),dv(o,l,s)),null!==i&&hv(s,l),ge}function we(){let e=He();ay()?cy():(e=e.parent,br(e,!1));const t=e;(function SB(e){return oe.skipHydrationRootTNode===e})(t)&&function AB(){oe.skipHydrationRootTNode=null}(),function DB(){oe.lFrame.elementDepthCount--}();const r=_e();return r.firstCreatePass&&(Ef(r,e),Jm(e)&&r.queries.elementEnd(e)),null!=t.classesWithoutHost&&function jB(e){return!!(8&e.flags)}(t)&&l0(r,t,N(),t.classesWithoutHost,!0),null!=t.stylesWithoutHost&&function $B(e){return!!(16&e.flags)}(t)&&l0(r,t,N(),t.stylesWithoutHost,!1),we}function or(e,t,r,i){return ge(e,t,r,i),we(),or}let px=(e,t,r,i,s,o)=>(Hr(!0),Gf(i,s,function GD(){return oe.lFrame.currentNamespace}()));function Ga(e,t,r){const i=N(),s=_e(),o=e+Y,a=s.firstCreatePass?function r$(e,t,r,i,s){const o=t.consts,a=tr(o,i),c=co(t,e,8,"ng-container",a);return null!==a&&ch(c,a,!0),gv(t,r,c,tr(o,s)),null!==t.queries&&t.queries.elementStart(t,c),c}(o,s,i,t,r):s.data[o];br(a,!0);const c=mx(s,i,a,e);return i[o]=c,ll()&&Zf(s,i,c,a),sn(c,i),pf(a)&&(fv(s,i,a),dv(s,a,i)),null!=r&&hv(i,a),Ga}function Wa(){let e=He();const t=_e();return ay()?cy():(e=e.parent,br(e,!1)),t.firstCreatePass&&(Ef(t,e),Jm(e)&&t.queries.elementEnd(e)),Wa}let mx=(e,t,r,i)=>(Hr(!0),nv(t[se],""));function Ri(){return N()}function p0(e,t,r){const i=N();if(yt(i,Er(),t)){const o=_e(),a=nt();An(o,a,i,e,t,eT(uy(o.data),a,i),r,!0)}return p0}const Ch="en-US";let wx=Ch,Bx=(e,t,r)=>{};function ze(e,t,r,i){const s=N(),o=_e(),a=He();return function y0(e,t,r,i,s,o,a){const c=pf(i),u=e.firstCreatePass&&XI(e),d=t[tt],f=JI(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 Q$(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=$x(i,t,d,o),Bx(m,s,o);const b=r.listen(y,s,o);f.push(o,b),u&&u.push(s,v,_,_+1)}}else o=$x(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=jx(t,r,i,o),l=s.__ngNextListenerFn__;for(;l;)c=jx(t,r,l,o)&&c,l=l.__ngNextListenerFn__;return c}}function wt(e=1){return function kB(e){return(oe.lFrame.contextLView=function ND(e,t){for(;e>0;)t=t[ca],e--;return t}(e,oe.lFrame.contextLView))[tt]}(e)}function _0(e,t,r){GT(e,t,r)}function Th(e){const t=N(),r=_e(),i=dy();_f(i+1);const s=zv(r,i);if(e.dirty&&function wB(e){return!(4&~e[ne])}(t)===!(2&~s.metadata.flags)){if(null===s.matches)e.reset([]);else{const o=KT(t,i);e.reset(o,bS),e.notifyOnChanges()}return!0}return!1}function xh(){return function Hv(e,t){return e[Ci].queries[t].queryList}(N(),dy())}function Ka(e){return Js(function PD(){return oe.lFrame.contextLView}(),Y+e)}function je(e,t=""){const r=N(),i=_e(),s=e+Y,o=i.firstCreatePass?co(i,s,1,t,null):i.data[s],a=cA(i,r,o,t,e);r[s]=a,ll()&&Zf(i,r,a,o),br(o,!1)}let cA=(e,t,r,i,s)=>(Hr(!0),function tv(e,t){return e.createText(t)}(t[se],i));function Qa(e){return Yr("",e,""),Qa}function Yr(e,t,r){const i=N(),s=function Fa(e,t,r,i){return yt(e,Er(),r)?t+he(r)+i:pe}(i,e,t,r);return s!==pe&&function xi(e,t,r){const i=ol(t,e);!function SI(e,t,r){e.setValue(t,r)}(e[se],i,r)}(i,Zt(),s),Yr}function b0(e,t,r,i,s){if(e=ie(e),Array.isArray(e))for(let o=0;o>20;if(Ks(e)||!e.multi){const p=new ul(u,s,k),g=C0(l,t,s?d:d+h,f);-1===g?(wy(If(c,a),o,l),E0(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=C0(l,t,d+h,f),g=C0(l,t,d,d+h),y=g>=0&&r[g];if(s&&!y||!s&&!(p>=0&&r[p])){wy(If(c,a),o,l);const _=function b5(e,t,r,i,s){const o=new ul(e,r,k);return o.multi=[],o.index=t,o.componentProviders=0,bA(o,s,i&&!r),o}(s?w5:_5,r.length,s,i,u);!s&&y&&(r[g].providerFactory=_),E0(o,e,t.length,0),t.push(l),c.directiveStart++,c.directiveEnd++,s&&(c.providerIndexes+=1048576),r.push(_),a.push(_)}else E0(o,e,p>-1?p:g,bA(r[s?g:p],u,!s&&i));!s&&i&&y&&r[g].componentProviders++}}}function E0(e,t,r,i){const s=Ks(t),o=function Q3(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 bA(e,t,r){return r&&e.componentProviders++,e.multi.push(t)-1}function C0(e,t,r,i){for(let s=r;s{r.providersResolver=(i,s)=>function v5(e,t,r){const i=_e();if(i.firstCreatePass){const s=wr(e);b0(r,i.data,i.blueprint,s,!0),b0(t,i.data,i.blueprint,s,!1)}}(i,s?s(e):e,t)}}let E5=(()=>{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=$m(0,r.type),s=i.length>0?dh([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=H({token:e,providedIn:"environment",factory:()=>new e(Z(Tn))})}}return e})();function Ah(e){mn("NgStandalone"),e.getStandaloneInjector=t=>t.get(E5).getOrCreateStandaloneInjector(e)}function DA(e,t,r,i,s,o){const a=t+r;return yt(e,a,s)?function Zr(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===pe?void 0:r}(e,a+1)}function MA(e,t,r){const i=e+Y,s=N(),o=Js(s,i);return function iu(e,t){return e[F].data[t].pure}(s,i)?DA(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 NA(e,t){return eh(e,t)}let WA=(()=>{class e{log(r){console.log(r)}warn(r){console.warn(r)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"platform"})}}return e})();const JA=new q(""),kh=new q("");let R0,M0=(()=>{class e{constructor(r,i,s){this._ngZone=r,this.registry=i,this._isZoneStable=!0,this._callbacks=[],this.taskTrackingZone=null,R0||(function OH(e){R0=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(N0),Z(kh))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})(),N0=(()=>{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 R0?.findTestabilityInTree(this,r,i)??null}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"platform"})}}return e})();function cu(e){return!!e&&"function"==typeof e.then}function XA(e){return!!e&&"function"==typeof e.subscribe}const O0=new q("");let eM=(()=>{class e{constructor(){this.initialized=!1,this.done=!1,this.donePromise=new Promise((r,i)=>{this.resolve=r,this.reject=i}),this.appInits=O(O0,{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(XA(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=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const Ph=new q("");function nM(e,t){return Array.isArray(t)?t.reduce(nM,e):{...e,...t}}let ar=(()=>{class e{constructor(){this._bootstrapListeners=[],this._runningTick=!1,this._destroyed=!1,this._destroyListeners=[],this._views=[],this.internalErrorHandler=O(mV),this.afterRenderManager=O(D1),this.zonelessEnabled=O(Bl),this.dirtyFlags=0,this.deferredDirtyFlags=0,this.externalTestViews=new Set,this.beforeRender=new Xe,this.afterTick=new Xe,this.componentTypes=[],this.components=[],this.isStable=O(ro).hasPendingTasks.pipe(Ve(r=>!r)),this._injector=O(Tn)}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 NT;if(!this._injector.get(eM).done)throw!s&&function rs(e){const t=Ce(e)||Rt(e)||Gt(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 kH(e){return e.isBoundToModule}(a)?void 0:this._injector.get(ho),u=a.create(It.NULL,[],i||a.selector,c),d=u.location.nativeElement,f=u.injector.get(JA,null);return f?.registerApplication(d),u.onDestroy(()=>{this.detachView(u.hostView),Lh(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=ve(null);try{this._runningTick=!0,this.synchronize()}catch(i){this.internalErrorHandler(i)}finally{this._runningTick=!1,ve(r),this.afterTick.next()}}synchronize(){let r=null;this._injector.destroyed||(r=this._injector.get(oh,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)FH(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})=>gf(r))?this.dirtyFlags|=2:this.dirtyFlags&=-8}attachView(r){const i=r;this._views.push(i),i.attachToAppRef(this)}detachView(r){const i=r;Lh(this._views,i),i.detachFromAppRef()}_loadComponent(r){this.attachView(r.hostView),this.tick(),this.components.push(r);const i=this._injector.get(Ph,[]);[...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),()=>Lh(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=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function Lh(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}function FH(e,t,r,i){(r||gf(e))&&Xf(e,t,r&&!i?0:1)}class BH{constructor(t,r){this.ngModuleFactory=t,this.componentFactories=r}}let iM=(()=>{class e{compileModuleSync(r){return new Wv(r)}compileModuleAsync(r){return Promise.resolve(this.compileModuleSync(r))}compileModuleAndAllComponentsSync(r){const i=this.compileModuleSync(r),o=zn(en(r).declarations).reduce((a,c)=>{const l=Ce(c);return l&&a.push(new $l(l)),a},[]);return new BH(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=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),jH=(()=>{class e{constructor(){this.zone=O(Ne),this.changeDetectionScheduler=O(Ia),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=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function k0({ngZoneFactory:e,ignoreChangesOutsideZone:t,scheduleInRootZone:r}){return e??=()=>new Ne({...P0(),scheduleInRootZone:r}),[{provide:Ne,useFactory:e},{provide:Vr,multi:!0,useFactory:()=>{const i=O(jH,{optional:!0});return()=>i.initialize()}},{provide:Vr,multi:!0,useFactory:()=>{const i=O(HH);return()=>{i.initialize()}}},!0===t?{provide:MT,useValue:!0}:[],{provide:Ov,useValue:r??pS}]}function P0(e){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:e?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:e?.runCoalescing??!1}}let HH=(()=>{class e{constructor(){this.subscription=new Et,this.initialized=!1,this.zone=O(Ne),this.pendingTasks=O(ro)}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=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),lu=(()=>{class e{constructor(){this.appRef=O(ar),this.taskService=O(ro),this.ngZone=O(Ne),this.zonelessEnabled=O(Bl),this.disableScheduling=O(MT,{optional:!0})??!1,this.zoneIsDefined=typeof Zone<"u"&&!!Zone.root.run,this.schedulerTickApplyArgs=[{data:{__scheduler_tick__:!0}}],this.subscriptions=new Et,this.angularZoneId=this.zoneIsDefined?this.ngZone._inner?.get(Nf):null,this.scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(O(Ov,{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 Ty||!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?mS:gS;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(Nf+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,mS(()=>{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=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const fs=new q("",{providedIn:"root",factory:()=>O(fs,Ie.Optional|Ie.SkipSelf)||function zH(){return typeof $localize<"u"&&$localize.locale||Ch}()}),Bh=new q("");function Vh(e){return!e.moduleRef}let uM=(()=>{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=[k0({ngZoneFactory:()=>function gV(e="zone.js",t){return"noop"===e?new Ty:"zone.js"===e?new Ne(t):e}(i?.ngZone,{...P0({eventCoalescing:i?.ngZoneEventCoalescing,runCoalescing:i?.ngZoneRunCoalescing}),scheduleInRootZone:s}),ignoreChangesOutsideZone:a}),{provide:Ia,useExisting:lu}],l=function C4(e,t,r){return new Gv(e,t,r,!1)}(r.moduleType,this.injector,c);return function lM(e){const t=Vh(e)?e.r3Injector:e.moduleRef.injector,r=t.get(Ne);return r.run(()=>{Vh(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)}})}),Vh(e)){const o=()=>t.destroy(),a=e.platformInjector.get(Bh);a.add(o),t.onDestroy(()=>{s.unsubscribe(),a.delete(o)})}else{const o=()=>e.moduleRef.destroy(),a=e.platformInjector.get(Bh);a.add(o),e.moduleRef.onDestroy(()=>{Lh(e.allPlatformModules,e.moduleRef),s.unsubscribe(),a.delete(o)})}return function LH(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(eM);return o.runInitializers(),o.donePromise.then(()=>{if(function f$(e){"string"==typeof e&&(wx=e.toLowerCase().replace(/_/g,"-"))}(t.get(fs,Ch)||Ch),Vh(e)){const c=t.get(ar);return void 0!==e.rootComponent&&c.bootstrap(e.rootComponent),c}return function QH(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=nM({},i);return function UH(e,t,r){const i=new Wv(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(Bh,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(It))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"platform"})}}return e})(),hs=null;const dM=new q("");function fM(e,t,r=[]){const i=`Platform: ${t}`,s=new q(i);return(o=[])=>{let a=F0();if(!a||a.injector.get(dM,!1)){const c=[...r,...o,{provide:s,useValue:!0}];e?e(c):function YH(e){if(hs&&!hs.get(dM,!1))throw new A(400,!1);(function tM(){!function HF(e){TC=e}(()=>{throw new A(600,!1)})})(),hs=e;const t=e.get(uM);(function pM(e){e.get(jS,null)?.forEach(r=>r())})(e)}(function hM(e=[],t){return It.create({name:t,providers:[{provide:qm,useValue:"platform"},{provide:Bh,useValue:new Set([()=>hs=null])},...e]})}(c,i))}return function JH(){const t=F0();if(!t)throw new A(401,!1);return t}()}}function F0(){return hs?.get(uM)??null}let uu=(()=>{class e{static{this.__NG_ELEMENT_ID__=ez}}return e})();function ez(e){return function tz(e,t,r){if(Ys(e)&&!r){const i=Un(e.index,t);return new Ml(i,i)}return 175&e.type?new Ml(t[ut],t):null}(He(),N(),!(16&~e))}class _M{constructor(){}supports(t){return fh(t)}create(t){return new oz(t)}}const sz=(e,t)=>t;class oz{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||sz}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 az(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 wM),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 wM),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 az{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 cz{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 wM{constructor(){this.map=new Map}put(t){const r=t.trackById;let i=this.map.get(r);i||(i=new cz,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 bM(e,t,r){const i=e.previousIndex;if(null===i)return i;let s=0;return r&&i{class e{static{this.\u0275prov=H({token:e,providedIn:"root",factory:CM})}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||CM()),deps:[[e,new Xd,new Jd]]}}find(r){const i=this.factories.find(s=>s.supports(r));if(null!=i)return i;throw new A(901,!1)}}return e})();const hz=fM(null,"core",[]);let pz=(()=>{class e{constructor(r){}static{this.\u0275fac=function(i){return new(i||e)(Z(ar))}}static{this.\u0275mod=Ht({type:e})}static{this.\u0275inj=Nt({})}}return e})();function pu(e,t){mn("NgSignals");const r=function UF(e){const t=Object.create(jF);t.computation=e;const r=()=>{if(wC(t),lm(t),t.value===Bd)throw t.error;return t.value};return r[mr]=t,r}(e);return t?.equal&&(r[mr].equal=t.equal),r}function Jr(e){const t=ve(null);try{return e()}finally{ve(t)}}let WM=null;function ps(){return WM}class Xz{}const on=new q("");let q0=(()=>{class e{historyGo(r){throw new Error("")}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:()=>O(t7),providedIn:"platform"})}}return e})();const e7=new q("");let t7=(()=>{class e extends q0{constructor(){super(),this._doc=O(on),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=H({token:e,factory:()=>new e,providedIn:"platform"})}}return e})();function G0(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 ZM(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 wo=(()=>{class e{historyGo(r){throw new Error("")}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:()=>O(QM),providedIn:"root"})}}return e})();const KM=new q("");let QM=(()=>{class e extends wo{constructor(r,i){super(),this._platformLocation=r,this._removeListenerFns=[],this._baseHref=i??this._platformLocation.getBaseHrefFromDOM()??O(on).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 G0(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)(Z(q0),Z(KM,8))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),n7=(()=>{class e extends wo{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=G0(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)(Z(q0),Z(KM,8))}}static{this.\u0275prov=H({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 s7(e){if(new RegExp("^(https?:)?//").test(e)){const[,r]=e.split(/\/\/[^\/]+/);return r}return e}(ZM(YM(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 i7(e,t){if(!e||!t.startsWith(e))return t;const r=t.substring(e.length);return""===r||["/",";","?","#"].includes(r[0])?r:t}(this._basePath,YM(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=G0}static{this.stripTrailingSlash=ZM}static{this.\u0275fac=function(i){return new(i||e)(Z(wo))}}static{this.\u0275prov=H({token:e,factory:()=>function r7(){return new gu(Z(wo))}(),providedIn:"root"})}}return e})();function YM(e){return e.replace(/\/index.html$/,"")}class G7{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 r_=(()=>{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 G7(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),cN(c,s)}});for(let s=0,o=i.length;s{cN(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($0))}}static{this.\u0275dir=de({type:e,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"},standalone:!0})}}return e})();function cN(e,t){e.context.$implicit=t.item}let op=(()=>{class e{constructor(r,i){this._viewContainer=r,this._context=new W7,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){lN("ngIfThen",r),this._thenTemplateRef=r,this._thenViewRef=null,this._updateView()}set ngIfElse(r){lN("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 W7{constructor(){this.$implicit=null,this.ngIf=null}}function lN(e,t){if(t&&!t.createEmbeddedView)throw new Error(`${e} must be a TemplateRef, but received '${Mt(t)}'.`)}let bo=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ht({type:e})}static{this.\u0275inj=Nt({})}}return e})();const fN="browser";function hN(e){return"server"===e}let w9=(()=>{class e{static{this.\u0275prov=H({token:e,providedIn:"root",factory:()=>function _9(e){return e===fN}(O(os))?new b9(O(on),window):new C9})}}return e})();class b9{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 E9(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 C9{setOffset(t){}getScrollPosition(){return[0,0]}scrollToPosition(t){}scrollToAnchor(t){}setHistoryScrollRestoration(t){}}class J9 extends Xz{constructor(){super(...arguments),this.supportsDOMEvents=!0}}class d_ extends J9{static makeCurrent(){!function Jz(e){WM??=e}(new d_)}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 X9(){return _u=_u||document.querySelector("base"),_u?_u.getAttribute("href"):null}();return null==r?null:function eq(e){return new URL(e,document.baseURI).pathname}(r)}resetBaseElement(){_u=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return function H7(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=H({token:e,factory:e.\u0275fac})}}return e})();const f_=new q("");let DN=(()=>{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(f_),Z(Ne))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})();class SN{constructor(t){this._doc=t}}const h_="ng-app-id";let IN=(()=>{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=hN(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[${h_}="${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(h_),o;{const a=this.doc.createElement("style");return this.nonce&&a.setAttribute("nonce",this.nonce),a.textContent=i,this.platformIsServer&&a.setAttribute(h_,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(on),Z(ya),Z(HS,8),Z(os))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})();const p_={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"},g_=/%COMP%/g,oq=new q("",{providedIn:"root",factory:()=>!0});function xN(e,t){return t.map(r=>r.replace(g_,e))}let m_=(()=>{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=hN(c),this.defaultRenderer=new y_(r,a,l,this.platformIsServer)}createRenderer(r,i){if(!r||!i)return this.defaultRenderer;this.platformIsServer&&i.encapsulation===yr.ShadowDom&&(i={...i,encapsulation:yr.Emulated});const s=this.getOrCreateRenderer(r,i);return s instanceof MN?s.applyToHost(r):s instanceof v_&&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 yr.Emulated:o=new MN(l,u,i,this.appId,d,a,c,f);break;case yr.ShadowDom:return new uq(l,u,r,i,a,c,this.nonce,f);default:o=new v_(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(DN),Z(IN),Z(ya),Z(oq),Z(on),Z(os),Z(Ne),Z(HS))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})();class y_{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(p_[r]||r,t):this.doc.createElement(t)}createComment(t){return this.doc.createComment(t)}createText(t){return this.doc.createTextNode(t)}appendChild(t,r){(AN(t)?t.content:t).appendChild(r)}insertBefore(t,r,i){t&&(AN(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=p_[s];o?t.setAttributeNS(o,r,i):t.setAttribute(r,i)}else t.setAttribute(r,i)}removeAttribute(t,r,i){if(i){const s=p_[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 AN(e){return"TEMPLATE"===e.tagName&&void 0!==e.content}class uq extends y_{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=xN(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 v_ extends y_{constructor(t,r,i,s,o,a,c,l){super(t,o,a,c),this.sharedStylesHost=r,this.removeStylesOnCompDestroy=s,this.styles=l?xN(l,i.styles):i.styles}applyStyles(){this.sharedStylesHost.addStyles(this.styles)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles)}}class MN extends v_{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 aq(e){return"_ngcontent-%COMP%".replace(g_,e)}(u),this.hostAttr=function cq(e){return"_nghost-%COMP%".replace(g_,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 dq=(()=>{class e extends SN{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(on))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})();const NN=["alt","control","meta","shift"],fq={"\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"},hq={alt:e=>e.altKey,control:e=>e.ctrlKey,meta:e=>e.metaKey,shift:e=>e.shiftKey};let pq=(()=>{class e extends SN{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."),NN.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=fq[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"),NN.forEach(a=>{a!==s&&(0,hq[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(on))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})();const ON=[{provide:os,useValue:fN},{provide:jS,useValue:function gq(){d_.makeCurrent()},multi:!0},{provide:on,useFactory:function yq(){return function BV(e){Oy=e}(document),document},deps:[]}],vq=fM(hz,"browser",ON),_q=new q(""),kN=[{provide:kh,useClass:class tq{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:JA,useClass:M0,deps:[Ne,N0,kh]},{provide:M0,useClass:M0,deps:[Ne,N0,kh]}],PN=[{provide:qm,useValue:"root"},{provide:nr,useFactory:function mq(){return new nr},deps:[]},{provide:f_,useClass:dq,multi:!0,deps:[on,Ne,os]},{provide:f_,useClass:pq,multi:!0,deps:[on]},m_,IN,DN,{provide:oh,useExisting:m_},{provide:class D9{},useClass:nq,deps:[]},[]];let LN=(()=>{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(_q,12))}}static{this.\u0275mod=Ht({type:e})}static{this.\u0275inj=Nt({providers:[...PN,...kN],imports:[bo,pz]})}}return e})(),wq=(()=>{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(on))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),VN=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:function(i){let s=null;return s=i?new(i||e):Z(Dq),s},providedIn:"root"})}}return e})(),Dq=(()=>{class e extends VN{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 qr(i,"HTML")?$n(i):fI(this._doc,String(i)).toString();case Hn.STYLE:return qr(i,"Style")?$n(i):i;case Hn.SCRIPT:if(qr(i,"Script"))return $n(i);throw new A(5200,!1);case Hn.URL:return qr(i,"URL")?$n(i):$f(String(i));case Hn.RESOURCE_URL:if(qr(i,"ResourceURL"))return $n(i);throw new A(5201,!1);default:throw new A(5202,!1)}}bypassSecurityTrustHtml(r){return function s8(e){return new XV(e)}(r)}bypassSecurityTrustStyle(r){return function o8(e){return new e8(e)}(r)}bypassSecurityTrustScript(r){return function a8(e){return new t8(e)}(r)}bypassSecurityTrustUrl(r){return function c8(e){return new n8(e)}(r)}bypassSecurityTrustResourceUrl(r){return function l8(e){return new r8(e)}(r)}static{this.\u0275fac=function(i){return new(i||e)(Z(on))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),__=(()=>{class e{constructor(){this.wannachatStatusDefaultTimeoutInSeconds=20}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})(),Sq=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ht({type:e})}static{this.\u0275inj=Nt({providers:[__],imports:[bo]})}}return e})();function UN(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){UN(o,i,s,a,c,"next",l)}function c(l){UN(o,i,s,a,c,"throw",l)}a(void 0)})}}function w_(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function b_(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 wu(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 E_="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,C_=e=>e instanceof Uint8Array,D_=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Xr=(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 bu(e){if("string"==typeof e&&(e=function Aq(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),!C_(e))throw new Error("expected Uint8Array, got "+typeof e);return e}class HN{clone(){return this._cloneInto()}}function Rq(e){const t=i=>e().update(bu(i)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function zN(e=32){if(E_&&"function"==typeof E_.getRandomValues)return E_.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}class kq extends HN{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=D_(this.buffer)}update(t){wu(this);const{view:r,buffer:i,blockLen:s}=this,o=(t=bu(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=D_(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,Lq=(e,t,r)=>e&t^e&r^t&r,Fq=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]),gs=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ms=new Uint32Array(64);class qN extends kq{constructor(){super(64,32,8,!1),this.A=0|gs[0],this.B=0|gs[1],this.C=0|gs[2],this.D=0|gs[3],this.E=0|gs[4],this.F=0|gs[5],this.G=0|gs[6],this.H=0|gs[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=Xr(h,7)^Xr(h,18)^h>>>3,m=Xr(p,17)^Xr(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+(Xr(c,6)^Xr(c,11)^Xr(c,25))+Pq(c,l,u)+Fq[f]+ms[f]|0,m=(Xr(i,2)^Xr(i,13)^Xr(i,22))+Lq(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)}}const I_=Rq(()=>new qN),dp=(BigInt(0),BigInt(1)),Bq=BigInt(2),fp=e=>e instanceof Uint8Array,Vq=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function nc(e){if(!fp(e))throw new Error("Uint8Array expected");let t="";for(let r=0;ri+s.length,0));let r=0;return e.forEach(i=>{if(!fp(i))throw new Error("Uint8Array expected");t.set(i,r),r+=i.length}),t}const A_=e=>(Bq<new Uint8Array(e),ZN=e=>Uint8Array.from(e);function KN(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=M_(e),s=M_(e),o=0;const a=()=>{i.fill(1),s.fill(0),o=0},c=(...f)=>r(s,i,...f),l=(f=M_())=>{s=c(ZN([0]),f),i=c(),0!==f.length&&(s=c(ZN([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 jq={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 Eu(e,t,r={}){const i=(s,o,a)=>{const c=jq[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 Bt=BigInt(0),Qe=BigInt(1),vs=BigInt(2),$q=BigInt(3),N_=BigInt(4),QN=BigInt(5),YN=BigInt(8);function Vt(e,t){const r=e%t;return r>=Bt?r:t+r}function qq(e,t,r){if(r<=Bt||t 0");if(r===Qe)return Bt;let i=Qe;for(;t>Bt;)t&Qe&&(i=i*e%r),e=e*e%r,t>>=Qe;return i}function ur(e,t,r){let i=e;for(;t-- >Bt;)i*=i,i%=r;return i}function hp(e,t){if(e===Bt||t<=Bt)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=Vt(e,t),i=t,s=Bt,o=Qe,a=Qe,c=Bt;for(;r!==Bt;){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!==Qe)throw new Error("invert: does not exist");return Vt(s,t)}BigInt(9),BigInt(16);const Zq=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function R_(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function JN(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 XN(e){const t=JN(e);return t+Math.ceil(t/2)}class eR extends HN{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,function jN(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");w_(e.outputLen),w_(e.blockLen)}(t);const i=bu(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 eR(e,t).update(r).digest();tR.create=(e,t)=>new eR(e,t);const eG=BigInt(0),O_=BigInt(1);function nR(e){return function Kq(e){Eu(e,Zq.reduce((i,s)=>(i[s]="function",i),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"}))}(e.Fp),Eu(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...R_(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const{Ph:rG,aT:iG}=Wc,Do={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=Do;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:rG(i),l:e.subarray(r+2)}},toSig(e){const{Err:t}=Do,r="string"==typeof e?iG(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}=Do._parseInt(r.subarray(2)),{d:a,l:c}=Do._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}`}},Tr=BigInt(0),pt=BigInt(1),pp=(BigInt(2),BigInt(3));function aG(e){const t=function oG(e){const t=nR(e);return Eu(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(I){return Vt(I,i)}function l(I){return hp(I,i)}const{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:h}=function sG(e){const t=function nG(e){const t=nR(e);Eu(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 Co(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&&Trr.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(an("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,pp),{px:v,py:w,pz:b}=this;let D=r.ZERO,C=r.ZERO,S=r.ZERO,T=r.mul(v,v),P=r.mul(w,w),$=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(_,$),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),$=r.mul(m,$),V=r.sub(T,$),V=r.mul(m,V),V=r.add(V,S),S=r.add(T,T),T=r.add(S,T),T=r.add(T,$),T=r.mul(T,V),C=r.add(C,T),$=r.mul(w,b),$=r.add($,$),T=r.mul($,V),D=r.sub(D,T),S=r.mul($,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,T=r.ZERO;const P=t.a,$=r.mul(t.b,pp);let V=r.mul(y,w),j=r.mul(_,b),X=r.mul(v,D),L=r.add(y,_),I=r.add(w,b);L=r.mul(L,I),I=r.add(V,j),L=r.sub(L,I),I=r.add(y,v);let E=r.add(w,D);return I=r.mul(I,E),E=r.add(V,X),I=r.sub(I,E),E=r.add(_,v),C=r.add(b,D),E=r.mul(E,C),C=r.add(j,X),E=r.sub(E,C),T=r.mul(P,I),C=r.mul($,X),T=r.add(C,T),C=r.sub(j,T),T=r.add(j,T),S=r.mul(C,T),j=r.add(V,V),j=r.add(j,V),X=r.mul(P,X),I=r.mul($,I),j=r.add(j,X),X=r.sub(V,X),X=r.mul(P,X),I=r.add(I,X),V=r.mul(j,I),S=r.add(S,V),V=r.mul(E,I),C=r.mul(L,C),C=r.sub(C,V),V=r.mul(L,j),T=r.mul(E,T),T=r.add(T,V),new f(C,S,T)}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===Tr)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,T=this;for(;w>Tr||D>Tr;)w&pt&&(C=C.add(T)),D&pt&&(S=S.add(T)),T=T.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:T,f:P}=this.wNAF(D),{p:$,f:V}=this.wNAF(S);T=p.constTimeNegate(b,T),$=p.constTimeNegate(C,$),$=new f(r.mul($.px,w.beta),$.py,$.pz),_=T.add($),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!==Tr&&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 nc(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 tG(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>eG;)o&O_&&(a=a.add(c)),c=c.double(),o>>=O_;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+=O_);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(I,E,x){const R=E.toAffine(),M=r.toBytes(R.x),G=Co;return x?G(Uint8Array.from([E.hasEvenY()?2:3]),M):G(Uint8Array.from([4]),M,r.toBytes(R.y))},fromBytes(I){const E=I.length,x=I[0],R=I.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(I){return Trnc(ys(I,t.nByteLength));function g(I){return I>i>>pt}const y=(I,E,x)=>Nn(I.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=an("compactSignature",E,2*x),new _(y(E,0,x),y(E,x,2*x))}static fromDER(E){const{r:x,s:R}=Do.toSig(an("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,G=S(an("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),gt=c(-G*ue),ht=c(R*ue),Ae=u.BASE.multiplyAndAddUnsafe(Se,gt,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 rc(this.toDERHex())}toDERHex(){return Do.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return rc(this.toCompactHex())}toCompactHex(){return p(this.r)+p(this.s)}}const v={isValidPrivateKey(I){try{return d(I),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const I=XN(t.n);return function Xq(e,t,r=!1){const i=e.length,s=JN(t),o=XN(t);if(i<16||i1024)throw new Error(`expected ${o}-1024 bytes of input, got ${i}`);const c=Vt(r?Nn(e):T_(e),t-Qe)+Qe;return r?x_(c,s):ys(c,s)}(t.randomBytes(I),t.n)},precompute:(I=8,E=u.BASE)=>(E._setWindowSize(I),E.multiply(BigInt(3)),E)};function b(I){const E=I instanceof Uint8Array,x="string"==typeof I,R=(E||x)&&I.length;return E?R===s||R===o:x?R===2*s||R===2*o:I instanceof u}const C=t.bits2int||function(I){const E=Nn(I),x=8*I.length-t.nBitLength;return x>0?E>>BigInt(x):E},S=t.bits2int_modN||function(I){return c(C(I))},T=A_(t.nBitLength);function P(I){if("bigint"!=typeof I)throw new Error("bigint expected");if(!(Tr<=I&&IOe in x))throw new Error("sign() legacy options not supported");const{hash:R,randomBytes:M}=t;let{lowS:G,prehash:J,extraEntropy:ee}=x;null==G&&(G=!0),I=an("msgHash",I),J&&(I=an("prehashed msgHash",R(I)));const Se=S(I),ue=d(E),gt=[P(ue),P(Se)];if(null!=ee){const Oe=!0===ee?M(r.BYTES):ee;gt.push(an("extraEntropy",Oe))}const ht=Co(...gt),Ae=Se;return{seed:ht,k2sig:function ot(Oe){const Ln=C(Oe);if(!h(Ln))return;const Jt=l(Ln),Xt=u.BASE.multiply(Ln).toAffine(),Fr=c(Xt.x);if(Fr===Tr)return;const Ko=c(Jt*c(Ae+Fr*ue));if(Ko===Tr)return;let Rd=(Xt.x===Fr?0:2)|Number(Xt.y&pt),FF=Ko;return G&&g(Ko)&&(FF=function m(I){return g(I)?c(-I):I}(Ko),Rd^=1),new _(Fr,FF,Rd)}}}(I,E,x);return KN(t.hash.outputLen,t.nByteLength,t.hmac)(R,M)},verify:function L(I,E,x,R=j){const M=I;if(E=an("msgHash",E),x=an("publicKey",x),"strict"in R)throw new Error("options.strict was renamed to lowS");const{lowS:G,prehash:J}=R;let ee,Se;try{if("string"==typeof M||M instanceof Uint8Array)try{ee=_.fromDER(M)}catch(Xt){if(!(Xt instanceof Do.Err))throw Xt;ee=_.fromCompact(M)}else{if("object"!=typeof M||"bigint"!=typeof M.r||"bigint"!=typeof M.s)throw new Error("PARSE");{const{r:Xt,s:Fr}=M;ee=new _(Xt,Fr)}}Se=u.fromHex(x)}catch(Xt){if("PARSE"===Xt.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(G&&ee.hasHighS())return!1;J&&(E=t.hash(E));const{r:ue,s:gt}=ee,ht=S(E),Ae=l(gt),ot=c(ht*Ae),Oe=c(ue*Ae),Ln=u.BASE.multiplyAndAddUnsafe(Se,ot,Oe)?.toAffine();return!!Ln&&c(Ln.x)===ue},ProjectivePoint:u,Signature:_,utils:v}}function lG(e){return{hash:e,hmac:(t,...r)=>tR(e,t,function Mq(...e){const t=new Uint8Array(e.reduce((i,s)=>i+s.length,0));let r=0;return e.forEach(i=>{if(!C_(i))throw new Error("Uint8Array expected");t.set(i,r),r+=i.length}),t}(...r)),randomBytes:zN}}BigInt(4);const gp=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),mp=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),iR=BigInt(1),yp=BigInt(2),sR=(e,t)=>(e+t/yp)/t;function oR(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,yp,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,yp,t);if(!k_.eql(k_.sqr(C),e))throw new Error("Cannot find square root");return C}const k_=function Jq(e,t,r=!1,i={}){if(e<=Bt)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:o}=R_(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=function Wq(e){if(e%N_===$q){const t=(e+Qe)/N_;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%YN===QN){const t=(e-QN)/YN;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 Gq(e){const t=(e-Qe)/vs;let r,i,s;for(r=e-Qe,i=0;r%vs===Bt;r/=vs,i++);for(s=vs;sVt(l,e),isValid:l=>{if("bigint"!=typeof l)throw new Error("Invalid field element: expected bigint, got "+typeof l);return Bt<=l&&ll===Bt,isOdd:l=>(l&Qe)===Qe,neg:l=>Vt(-l,e),eql:(l,u)=>l===u,sqr:l=>Vt(l*l,e),add:(l,u)=>Vt(l+u,e),sub:(l,u)=>Vt(l-u,e),mul:(l,u)=>Vt(l*u,e),pow:(l,u)=>function Qq(e,t,r){if(r 0");if(r===Bt)return e.ONE;if(r===Qe)return t;let i=e.ONE,s=t;for(;r>Bt;)r&Qe&&(i=e.mul(i,s)),s=e.sqr(s),r>>=Qe;return i}(c,l,u),div:(l,u)=>Vt(l*hp(u,e),e),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>hp(l,e),sqrt:i.sqrt||(l=>a(c,l)),invertBatch:l=>function Yq(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?x_(l,o):ys(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return r?T_(l):Nn(l)}});return Object.freeze(c)}(gp,void 0,void 0,{sqrt:oR}),ic=function uG(e,t){const r=i=>aG({...e,...lG(i)});return Object.freeze({...r(t),create:r})}({a:BigInt(0),b:BigInt(7),Fp:k_,n:mp,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=mp,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-iR*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=BigInt("0x100000000000000000000000000000000"),c=sR(o*e,t),l=sR(-i*e,t);let u=Vt(e-c*r-l*s,t),d=Vt(-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}}}},I_),vp=BigInt(0),aR=e=>"bigint"==typeof e&&vps.charCodeAt(0)));r=Co(i,i),cR[e]=r}return I_(Co(r,...t))}const P_=e=>e.toRawBytes(!0).slice(1),L_=e=>ys(e,32),F_=e=>Vt(e,gp),Cu=e=>Vt(e,mp),B_=ic.ProjectivePoint;function V_(e){let t=ic.utils.normPrivateKeyToScalar(e),r=B_.fromPrivateKey(t);return{scalar:r.hasEvenY()?t:Cu(-t),bytes:P_(r)}}function lR(e){if(!aR(e))throw new Error("bad x: need 0 < x < p");const t=F_(e*e);let i=oR(F_(t*e+BigInt(7)));i%yp!==vp&&(i=F_(-i));const s=new B_(e,i,iR);return s.assertValidity(),s}function uR(...e){return Cu(Nn(_p("BIP0340/challenge",...e)))}function dR(e,t,r){const i=an("signature",e,64),s=an("message",t),o=an("publicKey",r,32);try{const a=lR(Nn(o)),c=Nn(i.subarray(0,32));if(!aR(c))return!1;const l=Nn(i.subarray(32,64));if(!(e=>"bigint"==typeof e&&vpB_.BASE.multiplyAndAddUnsafe(e,t,r))(a,l,Cu(-u));return!(!d||!d.hasEvenY()||d.toAffine().x!==c)}catch{return!1}}const Du={getPublicKey:function hG(e){return V_(e).bytes},sign:function pG(e,t,r=zN(32)){const i=an("message",e),{bytes:s,scalar:o}=V_(t),a=an("auxRand",r,32),c=L_(o^Nn(_p("BIP0340/aux",a))),l=_p("BIP0340/nonce",c,s,i),u=Cu(Nn(l));if(u===vp)throw new Error("sign failed: k is zero");const{bytes:d,scalar:f}=V_(u),h=uR(d,s,i),p=new Uint8Array(64);if(p.set(d,0),p.set(L_(Cu(f+h*o)),32),!dR(p,i,s))throw new Error("sign: Invalid signature produced");return p},verify:dR,utils:{randomPrivateKey:ic.utils.randomPrivateKey,lift_x:lR,pointToBytes:P_,numberToBytesBE:ys,bytesToNumberBE:Nn,taggedHash:_p,mod:Vt}},U_="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,j_=e=>e instanceof Uint8Array,$_=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),ei=(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 gG=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Rn(e){if(!j_(e))throw new Error("Uint8Array expected");let t="";for(let r=0;ri+s.length,0));let r=0;return e.forEach(i=>{if(!j_(i))throw new Error("Uint8Array expected");t.set(i,r),r+=i.length}),t}class fR{clone(){return this._cloneInto()}}function hR(e){const t=i=>e().update(So(i)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function pR(e=32){if(U_&&"function"==typeof U_.getRandomValues)return U_.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function z_(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function gR(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 ti={number:z_,bool:function _G(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)},bytes:gR,hash:function wG(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");z_(e.outputLen),z_(e.blockLen)},exists:function bG(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 EG(e,t){gR(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=$_(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,IG=(e,t,r)=>e&t^e&r^t&r,TG=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]),ws=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),bs=new Uint32Array(64);class mR extends DG{constructor(){super(64,32,8,!1),this.A=0|ws[0],this.B=0|ws[1],this.C=0|ws[2],this.D=0|ws[3],this.E=0|ws[4],this.F=0|ws[5],this.G=0|ws[6],this.H=0|ws[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)bs[f]=t.getUint32(r,!1);for(let f=16;f<64;f++){const h=bs[f-15],p=bs[f-2],g=ei(h,7)^ei(h,18)^h>>>3,m=ei(p,17)^ei(p,19)^p>>>10;bs[f]=m+bs[f-7]+g+bs[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+(ei(c,6)^ei(c,11)^ei(c,25))+SG(c,l,u)+TG[f]+bs[f]|0,m=(ei(i,2)^ei(i,13)^ei(i,22))+IG(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(){bs.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class xG extends mR{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 Su=hR(()=>new mR);function Io(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function xr(...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 ni(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(Io(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 ri(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 Iu(e,t="="){if(Io(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 yR(e){if("function"!=typeof e)throw new Error("normalize fn should be function");return{encode:t=>t,decode:t=>e(t)}}function vR(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(Io(a),a<0||a>=t)throw new Error(`Wrong integer: ${a}`)});;){let a=0,c=!0;for(let l=i;lnew xG);const _R=(e,t)=>t?_R(t,e%t):e,bp=(e,t)=>e+(t-_R(e,t));function q_(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(bp(t,r)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${bp(t,r)}`);let s=0,o=0;const a=2**r-1,c=[];for(const l of e){if(Io(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 Li(e,t=!1){if(Io(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(bp(8,e)>32||bp(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 q_(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(q_(r,e,8,t))}}}function bR(e){if("function"!=typeof e)throw new Error("unsafeWrapper fn should be function");return function(...t){try{return e.apply(null,t)}catch{}}}xr(Li(4),ni("0123456789ABCDEF"),ri("")),xr(Li(5),ni("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Iu(5),ri("")),xr(Li(5),ni("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Iu(5),ri("")),xr(Li(5),ni("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),ri(""),yR(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const Fi=xr(Li(6),ni("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Iu(6),ri("")),G_=(xr(Li(6),ni("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Iu(6),ri("")),e=>xr(function wR(e){return Io(e),{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return vR(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(vR(t,e,256))}}}(58),ni(e),ri(""))),W_=(G_("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),G_("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),G_("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"),xr(ni("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),ri(""))),DR=[996825010,642813549,513874426,1027748829,705979059];function Tu(e){const t=e>>25;let r=(33554431&e)<<5;for(let i=0;i>i&1)&&(r^=DR[i]);return r}function SR(e,t,r=1){const i=e.length;let s=1;for(let o=0;o126)throw new Error(`Invalid prefix (${e})`);s=Tu(s)^a>>5}s=Tu(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=W_.decode(m).slice(0,-6),_=SR(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${W_.encode(f)}${SR(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:bR(c),fromWords:i,fromWordsUnsafe:o,toWords:s}}const oc=IR("bech32");function ac(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function Z_(e){if("boolean"!=typeof e)throw new Error(`boolean expected, not ${e}`)}function xR(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function xe(e,...t){if(!xR(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 To(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 Dp(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 Te=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),cc=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 Es(e){if("string"==typeof e)e=function jG(e){if("string"!=typeof e)throw new Error("string expected, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e);else{if(!xR(e))throw new Error("Uint8Array expected, got "+typeof e);e=e.slice()}return e}function Sp(e,t){if(e.length!==t.length)return!1;let r=0;for(let i=0;i(Object.assign(t,e),t);function xo(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 Y_=new Uint8Array(16),ii=Te(Y_),zG=(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 MR{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=Es(t),16);const i=cc(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}=zG(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:T,s3:P}=l[u*g+b];y^=C,_^=S,v^=T,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=Es(t),To(this);const r=Te(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=Es(t)).slice());super(i,r),i.fill(0)}update(t){t=Es(t),To(this);const r=Te(t),i=t.length%16,s=Math.floor(t.length/16);for(let o=0;oe(s,i.length).update(Es(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}NR((e,t)=>new MR(e,t)),NR((e,t)=>new WG(e,t)),new Uint8Array(16);const KG=283;function X_(e){return e<<1^KG&-(e>>7)}function lc(e,t){let r=0;for(;t>0;t>>=1)r^=e&-(1&t),e=X_(e);return r}const ew=(()=>{let e=new Uint8Array(256);for(let r=0,i=1;r<256;r++,i^=X_(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})(),QG=ew.map((e,t)=>ew.indexOf(t)),YG=e=>e<<24|e>>>8,tw=e=>e<<8|e>>>24;function OR(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(tw),s=i.map(tw),o=s.map(tw),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 nw=OR(ew,e=>lc(e,3)<<24|e<<16|e<<8|lc(e,2)),kR=OR(QG,e=>lc(e,11)<<24|lc(e,13)<<16|lc(e,9)<<8|lc(e,14)),JG=(()=>{const e=new Uint8Array(16);for(let t=0,r=1;t<16;t++,r=X_(r))e[t]=r;return e})();function Ui(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}=nw,i=Te(e),s=i.length,o=c=>si(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 Ds(e,t,r,i,s,o){return e[r<<8&65280|i>>>8&255]^t[s>>>8&65280|o>>>24&255]}function si(e,t,r,i,s){return e[255&t|65280&r]|e[i>>>16&255|s>>>16&65280]<<16}function On(e,t,r,i,s){const{sbox2:o,T01:a,T23:c}=nw;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=Ui(t),{b:l,o:u,out:d}=function FR(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=Te(e);if(t){let l=16-s;l||(l=16),i+=l}const a=uc(i,r);return{b:o,o:Te(a),out:a}}(o,s,a),f=Te(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}=On(c,h,p,g,m)),u[y++]=h,u[y++]=p,u[y++]=g,u[y++]=m;if(s){const _=function VR(e){const t=new Uint8Array(16),r=Te(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}=On(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 LR(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 rw(e){const t=Ui(e),r=t.slice(),i=t.length,{sbox2:s}=nw,{T0:o,T1:a,T2:c,T3:l}=kR;for(let u=0;u>>8&255]^c[f>>>16&255]^l[f>>>24]}return r}(t),l=Te(r),u=uc(o.length,a),d=Te(o),f=Te(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:T}=Tp(c,h,p,g,m);f[y++]=D^_,f[y++]=C^v,f[y++]=S^w,f[y++]=T^b}return c.fill(0),function BR(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 tW{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=Es(t),32);const r=Qt(t,0),i=Qt(t,2),s=Qt(t,4),o=Qt(t,6),a=Qt(t,8),c=Qt(t,10),l=Qt(t,12),u=Qt(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]=Qt(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],_=Qt(t,r+0),v=Qt(t,r+2),w=Qt(t,r+4),b=Qt(t,r+6),D=Qt(t,r+8),C=Qt(t,r+10),S=Qt(t,r+12),T=Qt(t,r+14);let P=o[0]+(8191&_),$=o[1]+(8191&(_>>>13|v<<3)),V=o[2]+(8191&(v>>>10|w<<6)),j=o[3]+(8191&(w>>>7|b<<9)),X=o[4]+(8191&(b>>>4|D<<12)),L=o[5]+(D>>>1&8191),I=o[6]+(8191&(D>>>14|C<<2)),E=o[7]+(8191&(C>>>11|S<<5)),x=o[8]+(8191&(S>>>8|T<<8)),R=o[9]+(T>>>5|s),M=0,G=M+P*c+$*(5*y)+V*(5*m)+j*(5*g)+X*(5*p);M=G>>>13,G&=8191,G+=L*(5*h)+I*(5*f)+E*(5*d)+x*(5*u)+R*(5*l),M+=G>>>13,G&=8191;let J=M+P*l+$*c+V*(5*y)+j*(5*m)+X*(5*g);M=J>>>13,J&=8191,J+=L*(5*p)+I*(5*h)+E*(5*f)+x*(5*d)+R*(5*u),M+=J>>>13,J&=8191;let ee=M+P*u+$*l+V*c+j*(5*y)+X*(5*m);M=ee>>>13,ee&=8191,ee+=L*(5*g)+I*(5*p)+E*(5*h)+x*(5*f)+R*(5*d),M+=ee>>>13,ee&=8191;let Se=M+P*d+$*u+V*l+j*c+X*(5*y);M=Se>>>13,Se&=8191,Se+=L*(5*m)+I*(5*g)+E*(5*p)+x*(5*h)+R*(5*f),M+=Se>>>13,Se&=8191;let ue=M+P*f+$*d+V*u+j*l+X*c;M=ue>>>13,ue&=8191,ue+=L*(5*y)+I*(5*m)+E*(5*g)+x*(5*p)+R*(5*h),M+=ue>>>13,ue&=8191;let gt=M+P*h+$*f+V*d+j*u+X*l;M=gt>>>13,gt&=8191,gt+=L*c+I*(5*y)+E*(5*m)+x*(5*g)+R*(5*p),M+=gt>>>13,gt&=8191;let ht=M+P*p+$*h+V*f+j*d+X*u;M=ht>>>13,ht&=8191,ht+=L*l+I*c+E*(5*y)+x*(5*m)+R*(5*g),M+=ht>>>13,ht&=8191;let Ae=M+P*g+$*p+V*h+j*f+X*d;M=Ae>>>13,Ae&=8191,Ae+=L*u+I*l+E*c+x*(5*y)+R*(5*m),M+=Ae>>>13,Ae&=8191;let ot=M+P*m+$*g+V*p+j*h+X*f;M=ot>>>13,ot&=8191,ot+=L*d+I*u+E*l+x*c+R*(5*y),M+=ot>>>13,ot&=8191;let Oe=M+P*y+$*m+V*g+j*p+X*h;M=Oe>>>13,Oe&=8191,Oe+=L*f+I*d+E*u+x*l+R*c,M+=Oe>>>13,Oe&=8191,M=(M<<2)+M|0,M=M+G|0,G=8191&M,M>>>=13,J+=M,o[0]=G,o[1]=J,o[2]=ee,o[3]=Se,o[4]=ue,o[5]=gt,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){To(this);const{buffer:r,blockLen:i}=this,s=(t=Es(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 rW=function nW(e){const t=(i,s)=>e(s).update(Es(i)).digest(),r=e(new Uint8Array(32));return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=i=>e(i),t}(e=>new tW(e)),HR=e=>Uint8Array.from(e.split("").map(t=>t.charCodeAt(0))),iW=HR("expand 16-byte k"),sW=HR("expand 32-byte k"),oW=Te(iW),zR=Te(sW);function Q(e,t){return e<>>32-t}function iw(e){return e.byteOffset%4==0}zR.slice();const qR=2**32-1,GR=new Uint32Array;function xu(e,t){const{allowShortKeys:r,extendNonceFn:i,counterLength:s,counterRight:o,rounds:a}=function $G(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 ac(s),ac(a),Z_(o),Z_(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),ac(f),f<0||f>=qR)throw new Error("arx: counter overflow");if(d.length=qR)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 Au(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,T=l,P=u,$=d,V=f,j=h,X=p,L=g,I=m,E=y,x=_,R=v,M=w,G=b,J=D;for(let Se=0;Se{e.update(t);const r=t.length%16;r&&e.update(dW.subarray(r))},fW=new Uint8Array(32);function ZR(e,t,r,i,s){const o=e(t,r,fW),a=rW.create(o);s&&WR(a,s),WR(a,i);const c=new Uint8Array(16),l=cc(c);xo(l,0,BigInt(s?s.length:0),!0),xo(l,8,BigInt(i.length),!0),a.update(c);const u=a.digest();return o.fill(0),u}const KR=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=ZR(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(!Sp(o.subarray(-16),ZR(e,t,r,u,i)))throw new Error("invalid tag");return e(t,r,u,a,1),a}});KR(sw),KR(uW);class QR extends fR{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,ti.hash(t);const i=So(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 QR(e,t).update(r).digest();Mp.create=(e,t)=>new QR(e,t);const ow=new Uint8Array([0]),JR=new Uint8Array;var hW=Object.defineProperty,bt=(e,t)=>{for(var r in t)hW(e,r,{get:t[r],enumerable:!0})},Ao=Symbol("verified"),pW=e=>e instanceof Object;function eO(e){if(!pW(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;tnO,QueueNode:()=>tO,binarySearch:()=>aw,insertEventIntoAscendingList:()=>yW,insertEventIntoDescendingList:()=>mW,normalizeURL:()=>fc,utf8Decoder:()=>ji,utf8Encoder:()=>oi});var ji=new TextDecoder("utf-8"),oi=new TextEncoder;function fc(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 mW(e,t){const[r,i]=aw(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 yW(e,t){const[r,i]=aw(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 aw(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 tO=class{value;next=null;prev=null;constructor(e){this.value=e}},nO=class{first;last;constructor(){this.first=null,this.last=null}enqueue(e){const t=new tO(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 Np(e){let t=Su(oi.encode(function _W(e){if(!eO(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 Rn(t)}var Rp=new class{generateSecretKey(){return Du.utils.randomPrivateKey()}getPublicKey(e){return Rn(Du.getPublicKey(e))}finalizeEvent(e,t){const r=e;return r.pubkey=Rn(Du.getPublicKey(t)),r.id=Np(r),r.sig=Rn(Du.sign(Np(r),t)),r[Ao]=!0,r}verifyEvent(e){if("boolean"==typeof e[Ao])return e[Ao];const t=Np(e);if(t!==e.id)return e[Ao]=!1,!1;try{const r=Du.verify(e.sig,t,e.pubkey);return e[Ao]=r,r}catch{return e[Ao]=!1,!1}}},wW=Rp.generateSecretKey,rO=Rp.getPublicKey,fr=Rp.finalizeEvent,hc=Rp.verifyEvent,cn={};function iO(e){return 1e3<=e&&e<1e4||[1,2,4,5,6,7,8,16,40,41,42,43,44].includes(e)}function cw(e){return[0,3].includes(e)||1e4<=e&&e<2e4}function sO(e){return 2e4<=e&&e<3e4}function lw(e){return 3e4<=e&&e<4e4}function bW(e){return iO(e)?"regular":cw(e)?"replaceable":sO(e)?"ephemeral":lw(e)?"parameterized":"unknown"}bt(cn,{Application:()=>CZ,BadgeAward:()=>xW,BadgeDefinition:()=>mZ,BlockedRelaysList:()=>XW,BookmarkList:()=>QW,Bookmarksets:()=>hZ,Calendar:()=>MZ,CalendarEventRSVP:()=>NZ,ChannelCreation:()=>oO,ChannelHideMessage:()=>lO,ChannelMessage:()=>cO,ChannelMetadata:()=>aO,ChannelMuteUser:()=>uO,ClassifiedListing:()=>IZ,ClientAuth:()=>dO,CommunitiesList:()=>YW,CommunityDefinition:()=>kZ,CommunityPostApproval:()=>VW,Contacts:()=>SW,CreateOrUpdateProduct:()=>_Z,CreateOrUpdateStall:()=>vZ,Curationsets:()=>pZ,Date:()=>xZ,DirectMessageRelaysList:()=>rZ,DraftClassifiedListing:()=>TZ,DraftLong:()=>bZ,Emojisets:()=>EZ,EncryptedDirectMessage:()=>IW,EventDeletion:()=>TW,FileMetadata:()=>OW,FileServerPreference:()=>sZ,Followsets:()=>uZ,GenericRepost:()=>NW,Genericlists:()=>dZ,GiftWrap:()=>iZ,HTTPAuth:()=>fw,Handlerinformation:()=>OZ,Handlerrecommendation:()=>RZ,Highlights:()=>GW,InterestsList:()=>tZ,Interestsets:()=>yZ,JobFeedback:()=>$W,JobRequest:()=>UW,JobResult:()=>jW,Label:()=>BW,LightningPubRPC:()=>aZ,LiveChatMessage:()=>kW,LiveEvent:()=>DZ,LongFormArticle:()=>wZ,Metadata:()=>EW,Mutelist:()=>WW,NWCWalletInfo:()=>oZ,NWCWalletRequest:()=>fO,NWCWalletResponse:()=>cZ,NostrConnect:()=>lZ,OpenTimestamps:()=>RW,Pinlist:()=>ZW,PrivateDirectMessage:()=>MW,ProblemTracker:()=>PW,ProfileBadges:()=>gZ,PublicChatsList:()=>JW,Reaction:()=>dw,RecommendRelay:()=>DW,RelayList:()=>KW,Relaysets:()=>fZ,Report:()=>LW,Reporting:()=>FW,Repost:()=>uw,Seal:()=>AW,SearchRelaysList:()=>eZ,ShortTextNote:()=>CW,Time:()=>AZ,UserEmojiList:()=>nZ,UserStatuses:()=>SZ,Zap:()=>qW,ZapGoal:()=>HW,ZapRequest:()=>zW,classifyKind:()=>bW,isEphemeralKind:()=>sO,isParameterizedReplaceableKind:()=>lw,isRegularKind:()=>iO,isReplaceableKind:()=>cw});var EW=0,CW=1,DW=2,SW=3,IW=4,TW=5,uw=6,dw=7,xW=8,AW=13,MW=14,NW=16,oO=40,aO=41,cO=42,lO=43,uO=44,RW=1040,OW=1063,kW=1311,PW=1971,LW=1984,FW=1984,BW=1985,VW=4550,UW=5999,jW=6999,$W=7e3,HW=9041,zW=9734,qW=9735,GW=9802,WW=1e4,ZW=10001,KW=10002,QW=10003,YW=10004,JW=10005,XW=10006,eZ=10007,tZ=10015,nZ=10030,rZ=10050,iZ=10059,sZ=10096,oZ=13194,aZ=21e3,dO=22242,fO=23194,cZ=23195,lZ=24133,fw=27235,uZ=3e4,dZ=30001,fZ=30002,hZ=30003,pZ=30004,gZ=30008,mZ=30009,yZ=30015,vZ=30017,_Z=30018,wZ=30023,bZ=30024,EZ=30030,CZ=30078,DZ=30311,SZ=30315,IZ=30402,TZ=30403,xZ=31922,AZ=31923,MZ=31924,NZ=31925,RZ=31989,OZ=31990,kZ=34550;function PZ(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 Op(e,t){for(let r=0;rcw(t))?e.authors.length*e.kinds.length:1/0,e.authors?.length&&e.kinds?.every(t=>lw(t))&&e["#d"]?.length?e.authors.length*e.kinds.length*e["#d"].length:1/0)}function kp(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 pO(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 gO(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 FZ(e,t){return t===kp(e,"id")}function BZ(e,t){return t===kp(e,"pubkey")}function VZ(e,t){return t===pO(e,"kind")}function mO(e,t){return{kind:dO,created_at:Math.floor(Date.now()/1e3),tags:[["relay",e],["challenge",t]],content:""}}bt({},{getHex64:()=>kp,getInt:()=>pO,getSubscriptionId:()=>gO,matchEventId:()=>FZ,matchEventKind:()=>VZ,matchEventPubkey:()=>BZ}),bt({},{makeAuthEvent:()=>mO});try{WebSocket}catch{}try{WebSocket}catch{}var Mu={};bt(Mu,{BECH32_REGEX:()=>_O,Bech32MaxSize:()=>gw,NostrTypeGuard:()=>GZ,decode:()=>Nu,encodeBytes:()=>Lp,naddrEncode:()=>XZ,neventEncode:()=>JZ,noteEncode:()=>QZ,nprofileEncode:()=>YZ,npubEncode:()=>KZ,nsecEncode:()=>ZZ});var GZ={isNProfile:e=>/^nprofile1[a-z\d]+$/.test(e||""),isNRelay:e=>/^nrelay1[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||"")},gw=5e3,_O=/[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}/;function Nu(e){let{prefix:t,words:r}=oc.decode(e,gw),i=new Uint8Array(oc.fromWords(r));switch(t){case"nprofile":{let s=mw(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:Rn(s[0][0]),relays:s[1]?s[1].map(o=>ji.decode(o)):[]}}}case"nevent":{let s=mw(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:Rn(s[0][0]),relays:s[1]?s[1].map(o=>ji.decode(o)):[],author:s[2]?.[0]?Rn(s[2][0]):void 0,kind:s[3]?.[0]?parseInt(Rn(s[3][0]),16):void 0}}}case"naddr":{let s=mw(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:ji.decode(s[0][0]),pubkey:Rn(s[2][0]),kind:parseInt(Rn(s[3][0]),16),relays:s[1]?s[1].map(o=>ji.decode(o)):[]}}}case"nsec":return{type:t,data:i};case"npub":case"note":return{type:t,data:Rn(i)};default:throw new Error(`unknown prefix ${t}`)}}function mw(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.lengthoi.encode(r))}))}function JZ(e){let t;return void 0!==e.kind&&(t=function WZ(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)),Pp("nevent",yw({0:[sc(e.id)],1:(e.relays||[]).map(i=>oi.encode(i)),2:e.author?[sc(e.author)]:[],3:t?[new Uint8Array(t)]:[]}))}function XZ(e){let t=new ArrayBuffer(4);return new DataView(t).setUint32(0,e.kind,!1),Pp("naddr",yw({0:[oi.encode(e.identifier)],1:(e.relays||[]).map(i=>oi.encode(i)),2:[sc(e.pubkey)],3:[new Uint8Array(t)]}))}function yw(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)})}),wp(...t)}var Ru={};function wO(e,t,r){return vw.apply(this,arguments)}function vw(){return(vw=U(function*(e,t,r){const i=e instanceof Uint8Array?Rn(e):e,o=bO(ic.getSharedSecret(i,"02"+t));let a=Uint8Array.from(pR(16)),c=oi.encode(r),l=UR(o,a).encrypt(c);return`${Fi.encode(new Uint8Array(l))}?iv=${Fi.encode(new Uint8Array(a.buffer))}`})).apply(this,arguments)}function tK(e,t,r){return _w.apply(this,arguments)}function _w(){return(_w=U(function*(e,t,r){const i=e instanceof Uint8Array?Rn(e):e;let[s,o]=r.split("?iv="),c=bO(ic.getSharedSecret(i,"02"+t)),l=Fi.decode(o),u=Fi.decode(s),d=UR(c,l).decrypt(u);return ji.decode(d)})).apply(this,arguments)}function bO(e){return e.slice(1,33)}bt(Ru,{decrypt:()=>tK,encrypt:()=>wO}),bt({},{NIP05_REGEX:()=>ww,isNip05:()=>rK,isValid:()=>oK,queryProfile:()=>EO,searchDomain:()=>sK,useFetchImplementation:()=>iK});var Fp,ww=/^(?:([\w.+-]+)@)?([\w_-]+(\.[\w_-]+)+)$/,rK=e=>ww.test(e||"");try{Fp=fetch}catch{}function iK(e){Fp=e}function sK(e){return bw.apply(this,arguments)}function bw(){return(bw=U(function*(e,t=""){try{const r=`https://${e}/.well-known/nostr.json?name=${t}`;return(yield(yield Fp(r,{redirect:"error"})).json()).names}catch{return{}}})).apply(this,arguments)}function EO(e){return Ew.apply(this,arguments)}function Ew(){return(Ew=U(function*(e){const t=e.match(ww);if(!t)return null;const[r,i="_",s]=t;try{const o=`https://${s}/.well-known/nostr.json?name=${i}`,a=yield(yield Fp(o,{redirect:"error"})).json();let c=a.names[i];return c?{pubkey:c,relays:a.relays?.[c]}:null}catch{return null}})).apply(this,arguments)}function oK(e,t){return Cw.apply(this,arguments)}function Cw(){return(Cw=U(function*(e,t){let r=yield EO(t);return!!r&&r.pubkey===e})).apply(this,arguments)}function cK(e){const t={reply:void 0,root:void 0,mentions:[],profiles:[]},r=[];for(const i of e.tags)"e"===i[0]&&i[1]&&r.push(i),"p"===i[0]&&i[1]&&t.profiles.push({pubkey:i[1],relays:i[2]?[i[2]]:[]});for(let i=0;icK}),bt({},{fetchRelayInformation:()=>dK,useFetchImplementation:()=>uK});try{fetch}catch{}function uK(e){}function dK(e){return Dw.apply(this,arguments)}function Dw(){return(Dw=U(function*(e){return yield(yield fetch(e.replace("ws://","http://").replace("wss://","https://"),{headers:{Accept:"application/nostr+json"}})).json()})).apply(this,arguments)}function DO(e){let t=0;for(let r=0;r=t)break}return i}function gK(e,t,r,i){return fr({kind:uw,tags:[...e.tags??[],["e",t.id,r],["p",t.pubkey]],content:""===e.content?"":JSON.stringify(t),created_at:e.created_at},i)}function SO(e){if(e.kind!==uw)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 mK(e,{skipVerification:t}={}){const r=SO(e);if(void 0===r||""===e.content)return;let i;try{i=JSON.parse(e.content)}catch{return}return i.id===r.id&&(t||hc(i))?i:void 0}bt({},{getPow:()=>DO,minePow:()=>hK}),bt({},{finishRepostEvent:()=>gK,getRepostedEvent:()=>mK,getRepostedEventPointer:()=>SO}),bt({},{NOSTR_URI_REGEX:()=>Bp,parse:()=>_K,test:()=>vK});var Bp=new RegExp(`nostr:(${_O.source})`);function vK(e){return"string"==typeof e&&new RegExp(`^${Bp.source}$`).test(e)}function _K(e){const t=e.match(new RegExp(`^${Bp.source}$`));if(!t)throw new Error(`Invalid Nostr URI: ${e}`);return{uri:t[0],value:t[1],decoded:Nu(t[1])}}function bK(e,t,r){const i=t.tags.filter(s=>s.length>=2&&("e"===s[0]||"p"===s[0]));return fr({...e,kind:dw,tags:[...e.tags??[],...i,["e",t.id],["p",t.pubkey]],content:e.content??"+"},r)}function EK(e){if(e.kind!==dw)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}bt({},{finishReactionEvent:()=>bK,getReactedEventPointer:()=>EK}),bt({},{matchAll:()=>DK,regex:()=>Sw,replaceAll:()=>SK});var Sw=()=>new RegExp(`\\b${Bp.source}\\b`,"g");function*DK(e){const t=e.matchAll(Sw());for(const r of t)try{const[i,s]=r;yield{uri:i,value:s,decoded:Nu(s),start:r.index,end:r.index+i.length}}catch{}}function SK(e,t){return e.replaceAll(Sw(),(r,i)=>t({uri:r,value:i,decoded:Nu(i)}))}bt({},{channelCreateEvent:()=>TK,channelHideMessageEvent:()=>MK,channelMessageEvent:()=>AK,channelMetadataEvent:()=>xK,channelMuteUserEvent:()=>NK});var TK=(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 fr({kind:oO,tags:[...e.tags??[]],content:r,created_at:e.created_at},t)},xK=(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 fr({kind:aO,tags:[["e",e.channel_create_event_id],...e.tags??[]],content:r,created_at:e.created_at},t)},AK=(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"]),fr({kind:cO,tags:[...r,...e.tags??[]],content:e.content,created_at:e.created_at},t)},MK=(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 fr({kind:lO,tags:[["e",e.channel_message_event_id],...e.tags??[]],content:r,created_at:e.created_at},t)},NK=(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 fr({kind:uO,tags:[["p",e.pubkey_to_mute],...e.tags??[]],content:r,created_at:e.created_at},t)};bt({},{EMOJI_SHORTCODE_REGEX:()=>IO,matchAll:()=>OK,regex:()=>Iw,replaceAll:()=>kK});var Tw,IO=/:(\w+):/,Iw=()=>new RegExp(`\\B${IO.source}\\B`,"g");function*OK(e){const t=e.matchAll(Iw());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 kK(e,t){return e.replaceAll(Iw(),(r,i)=>t({shortcode:r,name:i}))}bt({},{useFetchImplementation:()=>LK,validateGithub:()=>FK});try{Tw=fetch}catch{}function LK(e){Tw=e}function FK(e,t,r){return xw.apply(this,arguments)}function xw(){return(xw=U(function*(e,t,r){try{return(yield(yield Tw(`https://gist.github.com/${t}/${r}/raw`)).text())===`Verifying that I control the following Nostr public key: ${e}`}catch{return!1}})).apply(this,arguments)}bt({},{decrypt:()=>OO,encrypt:()=>RO,getConversationKey:()=>AO,v2:()=>$K});var TO=1,xO=65535;function AO(e,t){const r=ic.getSharedSecret(e,"02"+t).subarray(1,33);return function YR(e,t,r){return ti.hash(e),void 0===r&&(r=new Uint8Array(e.outputLen)),Mp(e,So(r),So(t))}(Su,r,"nip44-v2")}function MO(e,t){const r=function XR(e,t,r,i=32){if(ti.hash(e),ti.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=JR);const o=new Uint8Array(s*e.outputLen),a=Mp.create(e,t),c=a._cloneInto(),l=new Uint8Array(a.outputLen);for(let u=0;uxO)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 wp(i,t,new Uint8Array(Aw(r)-r))}(e),c=sw(i,s,a),l=NO(o,c,r);return Fi.encode(wp(new Uint8Array([2]),r,c,l))}function OO(e,t){const{nonce:r,ciphertext:i,mac:s}=function jK(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=Fi.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}=MO(t,r);if(!Sp(NO(c,i,r),s))throw new Error("invalid MAC");return function UK(e){const t=new DataView(e.buffer).getUint16(0),r=e.subarray(2,2+t);if(txO||r.length!==t||e.length!==2+Aw(t))throw new Error("invalid padding");return ji.decode(r)}(sw(o,a,i))}var Nw,$K={utils:{getConversationKey:AO,calcPaddedLen:Aw},encrypt:RO,decrypt:OO};function zK(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 qK(e,t,r){return Mw.apply(this,arguments)}function Mw(){return(Mw=U(function*(e,t,r){const s=yield wO(t,e,JSON.stringify({method:"pay_invoice",params:{invoice:r}})),o={kind:fO,created_at:Math.round(Date.now()/1e3),content:s,tags:[["p",e]]};return fr(o,t)})).apply(this,arguments)}bt({},{makeNwcRequestEvent:()=>qK,parseConnectionString:()=>zK}),bt({},{getZapEndpoint:()=>ZK,makeZapReceipt:()=>YK,makeZapRequest:()=>KK,useFetchImplementation:()=>WK,validateZapRequest:()=>QK});try{Nw=fetch}catch{}function WK(e){Nw=e}function ZK(e){return Rw.apply(this,arguments)}function Rw(){return(Rw=U(function*(e){try{let t="",{lud06:r,lud16:i}=JSON.parse(e.content);if(r){let{words:a}=oc.decode(r,1e3),c=oc.fromWords(a);t=ji.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 Nw(t)).json();if(o.allowsNostr&&o.nostrPubkey)return o.callback}catch{}return null})).apply(this,arguments)}function KK({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 QK(e){let t;try{t=JSON.parse(e)}catch{return"Invalid zap request JSON."}if(!eO(t))return"Zap request is not a valid Nostr event.";if(!hc(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 YK({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}bt({},{getToken:()=>XK,hashPayload:()=>Lw,unpackEventFromToken:()=>PO,validateEvent:()=>jO,validateEventKind:()=>FO,validateEventMethodTag:()=>VO,validateEventPayloadTag:()=>UO,validateEventTimestamp:()=>LO,validateEventUrlTag:()=>BO,validateToken:()=>eQ});var kO="Nostr ";function XK(e,t,r){return Ow.apply(this,arguments)}function Ow(){return(Ow=U(function*(e,t,r,i=!1,s){const o={kind:fw,tags:[["u",e],["method",t]],created_at:Math.round((new Date).getTime()/1e3),content:""};s&&o.tags.push(["payload",Lw(s)]);const a=yield r(o);return(i?kO:"")+Fi.encode(oi.encode(JSON.stringify(a)))})).apply(this,arguments)}function eQ(e,t,r){return kw.apply(this,arguments)}function kw(){return(kw=U(function*(e,t,r){const i=yield PO(e).catch(o=>{throw o});return yield jO(i,t,r).catch(o=>{throw o})})).apply(this,arguments)}function PO(e){return Pw.apply(this,arguments)}function Pw(){return(Pw=U(function*(e){if(!e)throw new Error("Missing token");e=e.replace(kO,"");const t=ji.decode(Fi.decode(e));if(!t||0===t.length||!t.startsWith("{"))throw new Error("Invalid token");return JSON.parse(t)})).apply(this,arguments)}function LO(e){return!!e.created_at&&Math.round((new Date).getTime()/1e3)-e.created_at<60}function FO(e){return e.kind===fw}function BO(e,t){const r=e.tags.find(i=>"u"===i[0]);return!!r&&r.length>0&&r[1]===t}function VO(e,t){const r=e.tags.find(i=>"method"===i[0]);return!!r&&r.length>0&&r[1].toLowerCase()===t.toLowerCase()}function Lw(e){return Rn(Su(oi.encode(JSON.stringify(e))))}function UO(e,t){const r=e.tags.find(s=>"payload"===s[0]);if(!r)return!1;const i=Lw(t);return r.length>0&&r[1]===i}function jO(e,t,r,i){return Fw.apply(this,arguments)}function Fw(){return(Fw=U(function*(e,t,r,i){if(!hc(e))throw new Error("Invalid nostr event, signature invalid");if(!FO(e))throw new Error("Invalid nostr event, kind invalid");if(!LO(e))throw new Error("Invalid nostr event, created_at timestamp invalid");if(!BO(e,t))throw new Error("Invalid nostr event, url tag invalid");if(!VO(e,r))throw new Error("Invalid nostr event, method tag invalid");if(i&&"object"==typeof i&&Object.keys(i).length>0&&!UO(e,i))throw new Error("Invalid nostr event, payload tag does not match request body hash");return!0})).apply(this,arguments)}function Ss(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 Up(t.call(e));r="@@asyncIterator",i="@@iterator"}throw new TypeError("Object is not async iterable")}function Up(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(Up=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 Up(e)}"object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date;const Bw="object"==typeof process&&process?process:{};let jp=globalThis.AbortController,zO=globalThis.AbortSignal;if(typeof jp>"u"){zO=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,s){this._onabort.push(s)}},jp=class{constructor(){t()}signal=new zO;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"!==Bw.env?.LRU_CACHE_IGNORE_AC_WARNING;const t=()=>{e&&(e=!1,((e,t,r,i)=>{"function"==typeof Bw.emitWarning?Bw.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 GO,WO;Symbol("type"),Symbol,Symbol,GO=Symbol.iterator,WO=Symbol.toStringTag;class hr{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(hr.deletes(r,t)||hr.replaces(r,t))return this;hr.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 hr.sortEvents([...this.cache.values()]))yield t}[GO](){return this.values()}[WO]="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(hr.isReplaceable(i))return i===r.kind&&s===r.pubkey&&hr.sortEvents([t,r])[0]===t;if(hr.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&&hr.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 Ar(e,...t){if(!function rQ(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 Ou(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 yc="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,Mo=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),ai=(e,t)=>e<<32-t|e>>>t;function YO(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function No(e){return"string"==typeof e&&(e=YO(e)),Ar(e),e}new Uint8Array(new Uint32Array([287454020]).buffer);class JO{clone(){return this._cloneInto()}}function $w(e){const t=i=>e().update(No(i)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function dQ(e=32){if(yc&&"function"==typeof yc.getRandomValues)return yc.getRandomValues(new Uint8Array(e));if(yc&&"function"==typeof yc.randomBytes)return yc.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}class XO extends JO{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,function Uw(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=No(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 XO(e,t).update(r).digest();Pu.create=(e,t)=>new XO(e,t);const hQ=(e,t,r)=>e&t^~e&r,pQ=(e,t,r)=>e&t^e&r^t&r;class Hw extends JO{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=Mo(this.buffer)}update(t){Ou(this);const{view:r,buffer:i,blockLen:s}=this,o=(t=No(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=Mo(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)),mQ=ek.map(e=>(9*e+5)%16);let zw=[ek],qw=[mQ];for(let e=0;e<4;e++)for(let t of[zw,qw])t.push(t[e].map(r=>gQ[r]));const CQ=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]),Ts=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),xs=new Uint32Array(64);class rk extends Hw{constructor(){super(64,32,8,!1),this.A=0|Ts[0],this.B=0|Ts[1],this.C=0|Ts[2],this.D=0|Ts[3],this.E=0|Ts[4],this.F=0|Ts[5],this.G=0|Ts[6],this.H=0|Ts[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)xs[f]=t.getUint32(r,!1);for(let f=16;f<64;f++){const h=xs[f-15],p=xs[f-2],g=ai(h,7)^ai(h,18)^h>>>3,m=ai(p,17)^ai(p,19)^p>>>10;xs[f]=m+xs[f-7]+g+xs[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+(ai(c,6)^ai(c,11)^ai(c,25))+hQ(c,l,u)+CQ[f]+xs[f]|0,m=(ai(i,2)^ai(i,13)^ai(i,22))+pQ(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(){xs.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Gw=$w(()=>new rk),qp=BigInt(2**32-1),Ww=BigInt(32);function ik(e,t=!1){return t?{h:Number(e&qp),l:Number(e>>Ww&qp)}:{h:0|Number(e>>Ww&qp),l:0|Number(e&qp)}}const be_split=function DQ(e,t=!1){let r=new Uint32Array(e.length),i=new Uint32Array(e.length);for(let s=0;sBigInt(e))),Kw=BigInt(0),Wp=BigInt(1),jQ=BigInt(2);function Ro(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function Lu(e){if(!Ro(e))throw new Error("Uint8Array expected")}function vc(e,t){if("boolean"!=typeof t)throw new Error(`${e} must be valid boolean, got "${t}".`)}const $Q=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function _c(e){Lu(e);let t="";for(let r=0;r=Hi._0&&e<=Hi._9?e-Hi._0:e>=Hi._A&&e<=Hi._F?e-(Hi._A-10):e>=Hi._a&&e<=Hi._f?e-(Hi._a-10):void 0}function bc(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&&Kw<=e;function Zp(e,t,r){return Jw(e)&&Jw(t)&&Jw(r)&&t<=e&&eKw;e>>=Wp,t+=1);return t}const Xw=e=>(jQ<new Uint8Array(e),ck=e=>Uint8Array.from(e);function lk(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=eb(e),s=eb(e),o=0;const a=()=>{i.fill(1),s.fill(0),o=0},c=(...f)=>r(s,i,...f),l=(f=eb())=>{s=c(ck([0]),f),i=c(),0!==f.length&&(s=c(ck([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 HQ={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||Ro(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 Bu(e,t,r={}){const i=(s,o,a)=>{const c=HQ[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 tb(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 Ut=BigInt(0),Ye=BigInt(1),Ns=BigInt(2),zQ=BigInt(3),nb=BigInt(4),uk=BigInt(5),dk=BigInt(8);function Yt(e,t){const r=e%t;return r>=Ut?r:t+r}function WQ(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 pr(e,t,r){let i=e;for(;t-- >Ut;)i*=i,i%=r;return i}function Kp(e,t){if(e===Ut||t<=Ut)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=Yt(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 Yt(s,t)}BigInt(9),BigInt(16);const QQ=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function rb(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function fk(e,t,r=!1,i={}){if(e<=Ut)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:o}=rb(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=function KQ(e){if(e%nb===zQ){const t=(e+Ye)/nb;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%dk===uk){const t=(e-uk)/dk;return function(i,s){const o=i.mul(s,Ns),a=i.pow(o,t),c=i.mul(s,a),l=i.mul(i.mul(c,Ns),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 ZQ(e){const t=(e-Ye)/Ns;let r,i,s;for(r=e-Ye,i=0;r%Ns===Ut;r/=Ns,i++);for(s=Ns;sYt(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=>Yt(-l,e),eql:(l,u)=>l===u,sqr:l=>Yt(l*l,e),add:(l,u)=>Yt(l+u,e),sub:(l,u)=>Yt(l-u,e),mul:(l,u)=>Yt(l*u,e),pow:(l,u)=>function JQ(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)=>Yt(l*Kp(u,e),e),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>Kp(l,e),sqrt:i.sqrt||(l=>a(c,l)),invertBatch:l=>function XQ(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?Yw(l,o):Ec(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return r?Qw(l):Oo(l)}});return Object.freeze(c)}function hk(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 pk(e){const t=hk(e);return t+Math.ceil(t/2)}const nY=BigInt(0),ib=BigInt(1),sb=new WeakMap,gk=new WeakMap;function mk(e){return function YQ(e){Bu(e,QQ.reduce((i,s)=>(i[s]="function",i),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"}))}(e.Fp),Bu(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...rb(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}function yk(e){void 0!==e.lowS&&vc("lowS",e.lowS),void 0!==e.prehash&&vc("prehash",e.prehash)}const{Ph:oY,aT:aY}=cm,zi={Err:class extends Error{constructor(t=""){super(t)}},_tlv:{encode:(e,t)=>{const{Err:r}=zi;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=wc(i);if(s.length/2&128)throw new r("tlv.encode: long form length too big");const o=i>127?wc(s.length/2|128):"";return`${wc(e)}${o}${s}${t}`},decode(e,t){const{Err:r}=zi;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}=zi;if(e{const v=y.toAffine();return Fu(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(Ro(m)&&(m=_c(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:Oo(Mr("private key",m,_))}catch{throw new Error(`private key must be ${_} bytes, hex or bigint, not ${typeof m}`)}return v&&(b=Yt(b,w)),ko("private key",b,Ge,w),b}function u(m){if(!(m instanceof h))throw new Error("ProjectivePoint expected")}const d=tb((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=tb(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(Mr("pointHex",y)));return _.assertValidity(),_}static fromPrivateKey(y){return h.BASE.multiply(l(y))}static msm(y,_){return function iY(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=ak(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;hNr||C>Nr;)b&Ge&&(S=S.add(P)),C&Ge&&(T=T.add(P)),P=P.double(),b>>=Ge,C>>=Ge;return w&&(S=S.negate()),D&&(T=T.negate()),T=new h(r.mul(T.px,v.beta),T.py,T.pz),S.add(T)}multiply(y){const{endo:_,n:v}=t;let w,b;if(ko("scalar",y,Ge,v),_){const{k1neg:D,k1:C,k2neg:S,k2:T}=_.splitScalar(y);let{p:P,f:$}=this.wNAF(C),{p:V,f:j}=this.wNAF(T);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=$.add(j)}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!==Nr&&S!==Ge&&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===Ge)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===Ge?this:_?_(h,this):this.multiplyUnsafe(t.h)}toRawBytes(y=!0){return vc("isCompressed",y),this.assertValidity(),s(h,this,y)}toHex(y=!0){return vc("isCompressed",y),_c(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 rY(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>nY;)a&ib&&(c=c.add(l)),l=l.double(),a>>=ib;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+=ib);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=gk.get(o)||1;let u=sb.get(o);return u||(u=this.precomputeWindow(o,l),1!==l&&sb.set(o,c(u))),this.wNAF(l,u,a)},setWindowSize(o,a){i(a),gk.set(o,a),sb.delete(o)}}}(h,t.endo?Math.ceil(p/2):p);return{CURVE:t,ProjectivePoint:h,normPrivateKeyToScalar:l,weierstrassEquation:a,isWithinCurveOrder:function c(m){return Zp(m,Ge,t.n)}}}({...t,toBytes(L,I,E){const x=I.toAffine(),R=r.toBytes(x.x),M=Fu;return vc("isCompressed",E),E?M(Uint8Array.from([I.hasEvenY()?2:3]),R):M(Uint8Array.from([4]),R,r.toBytes(x.y))},fromBytes(L){const I=L.length,E=L[0],x=L.subarray(1);if(I!==s||2!==E&&3!==E){if(I===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 ${I} was invalid. Expected ${s} compressed bytes or ${o} uncompressed bytes`)}{const R=Oo(x);if(!Zp(R,Ge,r.ORDER))throw new Error("Point is not on curve");const M=d(R);let G;try{G=r.sqrt(M)}catch(Se){const ue=Se instanceof Error?": "+Se.message:"";throw new Error("Point is not on curve"+ue)}return!(1&~E)!=((G&Ge)===Ge)&&(G=r.neg(G)),{x:R,y:G}}}}),h=L=>_c(Ec(L,t.nByteLength));function p(L){return L>i>>Ge}const m=(L,I,E)=>Oo(L.slice(I,E));class y{constructor(I,E,x){this.r=I,this.s=E,this.recovery=x,this.assertValidity()}static fromCompact(I){const E=t.nByteLength;return I=Mr("compactSignature",I,2*E),new y(m(I,0,E),m(I,E,2*E))}static fromDER(I){const{r:E,s:x}=zi.toSig(Mr("DER",I));return new y(E,x)}assertValidity(){ko("r",this.r,Ge,i),ko("s",this.s,Ge,i)}addRecoveryBit(I){return new y(this.r,this.s,I)}recoverPublicKey(I){const{r:E,s:x,recovery:R}=this,M=C(Mr("msgHash",I));if(null==R||![0,1,2,3].includes(R))throw new Error("recovery id invalid");const G=2===R||3===R?E+t.n:E;if(G>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const ee=l.fromHex((1&R?"03":"02")+h(G)),Se=c(G),ue=a(-M*Se),gt=a(x*Se),ht=l.BASE.multiplyAndAddUnsafe(ee,ue,gt);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 bc(this.toDERHex())}toDERHex(){return zi.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return bc(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=pk(t.n);return function tY(e,t,r=!1){const i=e.length,s=hk(t),o=pk(t);if(i<16||i1024)throw new Error(`expected ${o}-1024 bytes of input, got ${i}`);const c=Yt(r?Oo(e):Qw(e),t-Ye)+Ye;return r?Yw(c,s):Ec(c,s)}(t.randomBytes(L),t.n)},precompute:(L=8,I=l.BASE)=>(I._setWindowSize(L),I.multiply(BigInt(3)),I)};function w(L){const I=Ro(L),E="string"==typeof L,x=(I||E)&&L.length;return I?x===s||x===o:E?x===2*s||x===2*o:L instanceof l}const D=t.bits2int||function(L){const I=Oo(L),E=8*L.length-t.nBitLength;return E>0?I>>BigInt(E):I},C=t.bits2int_modN||function(L){return a(D(L))},S=Xw(t.nBitLength);function T(L){return ko(`num < 2^${t.nBitLength}`,L,Nr,S),Ec(L,t.nByteLength)}const $={lowS:t.lowS,prehash:!1},V={lowS:t.lowS,prehash:!1};return l.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function v(L,I=!0){return l.fromPrivateKey(L).toRawBytes(I)},getSharedSecret:function b(L,I,E=!0){if(w(L))throw new Error("first arg must be private key");if(!w(I))throw new Error("second arg must be public key");return l.fromHex(I).multiply(u(L)).toRawBytes(E)},sign:function j(L,I,E=$){const{seed:x,k2sig:R}=function P(L,I,E=$){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:G,extraEntropy:J}=E;null==M&&(M=!0),L=Mr("msgHash",L),yk(E),G&&(L=Mr("prehashed msgHash",x(L)));const ee=C(L),Se=u(I),ue=[T(Se),T(ee)];if(null!=J&&!1!==J){const ot=!0===J?R(r.BYTES):J;ue.push(Mr("extraEntropy",ot))}const gt=Fu(...ue),ht=ee;return{seed:gt,k2sig:function Ae(ot){const Oe=D(ot);if(!f(Oe))return;const Ln=c(Oe),Jt=l.BASE.multiply(Oe).toAffine(),Xt=a(Jt.x);if(Xt===Nr)return;const Fr=a(Ln*a(ht+Xt*Se));if(Fr===Nr)return;let Ko=(Jt.x===Xt?0:2)|Number(Jt.y&Ge),Rd=Fr;return M&&p(Fr)&&(Rd=function g(L){return p(L)?a(-L):L}(Fr),Ko^=1),new y(Xt,Rd,Ko)}}}(L,I,E);return lk(t.hash.outputLen,t.nByteLength,t.hmac)(x,R)},verify:function X(L,I,E,x=V){const R=L;if(I=Mr("msgHash",I),E=Mr("publicKey",E),"strict"in x)throw new Error("options.strict was renamed to lowS");yk(x);const{lowS:M,prehash:G}=x;let J,ee;try{if("string"==typeof R||Ro(R))try{J=y.fromDER(R)}catch(Jt){if(!(Jt instanceof zi.Err))throw Jt;J=y.fromCompact(R)}else{if("object"!=typeof R||"bigint"!=typeof R.r||"bigint"!=typeof R.s)throw new Error("PARSE");{const{r:Jt,s:Xt}=R;J=new y(Jt,Xt)}}ee=l.fromHex(E)}catch(Jt){if("PARSE"===Jt.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(M&&J.hasHighS())return!1;G&&(I=t.hash(I));const{r:Se,s:ue}=J,gt=C(I),ht=c(ue),Ae=a(gt*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 fY(e){return{hash:e,hmac:(t,...r)=>Pu(e,t,function ku(...e){let t=0;for(let i=0;i(e+t/Jp)/t;const ob=fk(Vu,void 0,void 0,{sqrt:function wk(e){const t=Vu,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=pr(d,r,t)*d%t,h=pr(f,r,t)*d%t,p=pr(h,Jp,t)*u%t,g=pr(p,s,t)*p%t,m=pr(g,o,t)*g%t,y=pr(m,c,t)*m%t,_=pr(y,l,t)*y%t,v=pr(_,c,t)*m%t,w=pr(v,r,t)*d%t,b=pr(w,a,t)*g%t,D=pr(b,i,t)*u%t,C=pr(D,Jp,t);if(!ob.eql(ob.sqr(C),e))throw new Error("Cannot find square root");return C}});(function hY(e,t){const r=i=>uY({...e,...fY(i)});Object.freeze({...r(t),create:r})})({a:BigInt(0),b:BigInt(7),Fp:ob,n:Yp,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Yp,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-Uu*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=BigInt("0x100000000000000000000000000000000"),c=_k(o*e,t),l=_k(-i*e,t);let u=Yt(e-c*r-l*s,t),d=Yt(-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}}}},Gw),BigInt(0);var Hk,Gk;function $k(e,t){this.v=e,this.k=t}function Os(e){return new $k(e,0)}function sg(e){return function(){return new qu(e.apply(this,arguments))}}function qu(e){var t,r;function i(o,a){try{var c=e[o](a),l=c.value,u=l instanceof $k;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)}YO("Bitcoin seed"),new TextEncoder,(new TextEncoder).encode("0123456789abcdef"),new TextEncoder,new TextDecoder,qu.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},qu.prototype.next=function(e){return this._invoke("next",e)},qu.prototype.throw=function(e){return this._invoke("throw",e)},qu.prototype.return=function(e){return this._invoke("return",e)},Hk=Symbol.asyncIterator;class zk{#t=[];#i;#f=!1;constructor(t){t?.aborted?this.abort():t?.addEventListener("abort",()=>this.abort(),{once:!0})}[Hk](){var t=this;return sg(function*(){for(;!t.#f;)t.#t.length?yield t.#t.shift():yield Os(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 qk{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}}Gk=Symbol.asyncDispose;class jY{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 sg(function*(){const s=new AbortController,o=r?.signal?AbortSignal.any([r.signal,s.signal]):s.signal,a=yield Os(i.opts.reqRouter(t));if(a.size<1)return;const c=new zk(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=Ss(_.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=Ss(c);d=!(g=yield Os(p.next())).done;d=!1)yield g.value}catch(m){f=!0,h=m}finally{try{d&&null!=p.return&&(yield Os(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 hr,o=t.reduce((h,p)=>h+hO(p),0);if(0===o)return[];const a=t.reduce((h,p)=>h||!!p.kinds?.some(g=>qk.replaceable(g)||qk.parameterizedReplaceable(g)),!1);try{var u,c=!1,l=!1;try{for(var f,d=Ss(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()))})()}[Gk](){var t=this;return U(function*(){yield t.close()})()}}class $Y{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,Je=function(e){return e.open="open",e.close="close",e.error="error",e.message="message",e.retry="retry",e.reconnect="reconnect",e}(Je||{});class HY{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(Je.open,w),this.handleErrorEvent=w=>this.handleEvent(Je.error,w),this.handleCloseEvent=w=>this.handleEvent(Je.close,w),this.handleMessageEvent=w=>this.handleEvent(Je.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(Je.open,this.handleOpenEvent),this._underlyingWebsocket.addEventListener(Je.close,this.handleCloseEvent),this._underlyingWebsocket.addEventListener(Je.error,this.handleErrorEvent),this._underlyingWebsocket.addEventListener(Je.message,this.handleMessageEvent),this._underlyingWebsocket}clearWebsocket(){this._underlyingWebsocket.removeEventListener(Je.open,this.handleOpenEvent),this._underlyingWebsocket.removeEventListener(Je.close,this.handleCloseEvent),this._underlyingWebsocket.removeEventListener(Je.error,this.handleErrorEvent),this._underlyingWebsocket.removeEventListener(Je.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 Je.close:this.dispatchEvent(t,r),this.scheduleConnectionRetryIfNeeded();break;case Je.open:if(void 0!==this.backoff&&void 0!==this._lastConnection){const i={retries:this.backoff.retries,lastConnection:new Date(this._lastConnection)},s=new CustomEvent(Je.reconnect,{detail:i});this.dispatchEvent(Je.reconnect,s),this.backoff.reset()}this._lastConnection=new Date,this.dispatchEvent(t,r),this.sendBufferedData();break;case Je.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(Je.retry,{detail:i});this.handleEvent(Je.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 zY{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(Je.open,t,r),this}onClose(t,r){return this.addListener(Je.close,t,r),this}onError(t,r){return this.addListener(Je.error,t,r),this}onMessage(t,r){return this.addListener(Je.message,t,r),this}onRetry(t,r){return this.addListener(Je.retry,t,r),this}onReconnect(t,r){return this.addListener(Je.reconnect,t,r),this}build(){return new HY(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,T;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!==(T=null===(S=null===(C=this._options)||void 0===C?void 0:C.listeners)||void 0===S?void 0:S[t])&&void 0!==T?T:[],{listener:r,options:i}]}}),this}}class qY{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 Wk=function(e){return e.mergeShapes=(t,r)=>({...t,...r}),e}(Wk||{});const K=Re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ks=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 Gi=(()=>{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 Dc=(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 Zk=Dc;function og(){return Zk}const ag=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 W(e,t){const r=og(),i=ag({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Dc?void 0:Dc].filter(s=>!!s)});e.common.issues.push(i)}class ln{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 ln.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"}),Sc=e=>({status:"dirty",value:e}),En=e=>({status:"valid",value:e}),wb=e=>"aborted"===e.status,bb=e=>"dirty"===e.status,Gu=e=>"valid"===e.status,Wu=e=>typeof Promise<"u"&&e instanceof Promise;function cg(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 Kk(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 Zu,Ku,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 ci{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 Qk=(e,t)=>{if(Gu(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 Gi(e.common.issues);return this._error=r,this._error}}};function me(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 Ee{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 ks(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:ks(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ln,ctx:{common:t.parent.common,data:t.data,parsedType:ks(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Wu(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:ks(t)},o=this._parseSync({data:t,path:s.path,parent:s});return Qk(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:ks(t)},o=i._parse({data:t,path:s.path,parent:s}),a=yield Wu(o)?o:Promise.resolve(o);return Qk(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 Bo({schema:this,typeName:ce.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Ls.create(this,this._def)}nullable(){return Mc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Yu.create(this,this._def)}promise(){return fg.create(this,this._def)}or(t){return Ab.create([this,t],this._def)}and(t){return Nb.create(this,t,this._def)}transform(t){return new Bo({...me(this._def),schema:this,typeName:ce.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r="function"==typeof t?t:()=>t;return new kb({...me(this._def),innerType:this,defaultValue:r,typeName:ce.ZodDefault})}brand(){return new Lb({typeName:ce.ZodBranded,type:this,...me(this._def)})}catch(t){const r="function"==typeof t?t:()=>t;return new Pb({...me(this._def),innerType:this,catchValue:r,typeName:ce.ZodCatch})}describe(t){return new(0,this.constructor)({...this._def,description:t})}pipe(t){return ed.create(this,t)}readonly(){return Fb.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const KY=/^c[^\s-]{8,}$/i,QY=/^[0-9a-z]+$/,YY=/^[0-9A-HJKMNP-TV-Z]{26}$/,JY=/^[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,XY=/^[a-z0-9_-]{21}$/i,eJ=/^[-+]?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)?)??$/,tJ=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let Eb;const rJ=/^(?:(?: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])$/,iJ=/^(([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})))$/,sJ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Yk="((\\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])))",oJ=new RegExp(`^${Yk}$`);function Jk(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 aJ(e){return new RegExp(`^${Jk(e)}$`)}function Xk(e){let t=`${Yk}T${Jk(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 cJ(e,t){return!(("v4"!==t&&t||!rJ.test(e))&&("v6"!==t&&t||!iJ.test(e)))}let lg=(()=>{class e extends Ee{_parse(r){if(this._def.coerce&&(r.data=String(r.data)),this._getType(r)!==K.string){const a=this._getOrReturnCtx(r);return W(a,{code:B.invalid_type,expected:K.string,received:a.parsedType}),ae}const s=new ln;let o;for(const a of this._def.checks)if("min"===a.kind)r.data.lengtha.value&&(o=this._getOrReturnCtx(r,o),W(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,...me(t)})},e})();function lJ(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 Cb=(()=>{class e extends Ee{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 W(a,{code:B.invalid_type,expected:K.number,received:a.parsedType}),ae}let s;const o=new ln;for(const a of this._def.checks)"int"===a.kind?Re.isInteger(r.data)||(s=this._getOrReturnCtx(r,s),W(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),W(s,{code:B.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):"multipleOf"===a.kind?0!==lJ(r.data,a.value)&&(s=this._getOrReturnCtx(r,s),W(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),W(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,...me(t)}),e})(),Db=(()=>{class e extends Ee{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 W(a,{code:B.invalid_type,expected:K.bigint,received:a.parsedType}),ae}let s;const o=new ln;for(const a of this._def.checks)"min"===a.kind?(a.inclusive?r.dataa.value:r.data>=a.value)&&(s=this._getOrReturnCtx(r,s),W(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),W(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,...me(t)})},e})(),Sb=(()=>{class e extends Ee{_parse(r){if(this._def.coerce&&(r.data=!!r.data),this._getType(r)!==K.boolean){const s=this._getOrReturnCtx(r);return W(s,{code:B.invalid_type,expected:K.boolean,received:s.parsedType}),ae}return En(r.data)}}return e.create=t=>new e({typeName:ce.ZodBoolean,coerce:t?.coerce||!1,...me(t)}),e})(),Ib=(()=>{class e extends Ee{_parse(r){if(this._def.coerce&&(r.data=new Date(r.data)),this._getType(r)!==K.date){const a=this._getOrReturnCtx(r);return W(a,{code:B.invalid_type,expected:K.date,received:a.parsedType}),ae}if(isNaN(r.data.getTime()))return W(this._getOrReturnCtx(r),{code:B.invalid_date}),ae;const s=new ln;let o;for(const a of this._def.checks)"min"===a.kind?r.data.getTime()a.value&&(o=this._getOrReturnCtx(r,o),W(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,...me(t)}),e})(),e2=(()=>{class e extends Ee{_parse(r){if(this._getType(r)!==K.symbol){const s=this._getOrReturnCtx(r);return W(s,{code:B.invalid_type,expected:K.symbol,received:s.parsedType}),ae}return En(r.data)}}return e.create=t=>new e({typeName:ce.ZodSymbol,...me(t)}),e})(),Tb=(()=>{class e extends Ee{_parse(r){if(this._getType(r)!==K.undefined){const s=this._getOrReturnCtx(r);return W(s,{code:B.invalid_type,expected:K.undefined,received:s.parsedType}),ae}return En(r.data)}}return e.create=t=>new e({typeName:ce.ZodUndefined,...me(t)}),e})(),xb=(()=>{class e extends Ee{_parse(r){if(this._getType(r)!==K.null){const s=this._getOrReturnCtx(r);return W(s,{code:B.invalid_type,expected:K.null,received:s.parsedType}),ae}return En(r.data)}}return e.create=t=>new e({typeName:ce.ZodNull,...me(t)}),e})(),ug=(()=>{class e extends Ee{constructor(){super(...arguments),this._any=!0}_parse(r){return En(r.data)}}return e.create=t=>new e({typeName:ce.ZodAny,...me(t)}),e})(),Qu=(()=>{class e extends Ee{constructor(){super(...arguments),this._unknown=!0}_parse(r){return En(r.data)}}return e.create=t=>new e({typeName:ce.ZodUnknown,...me(t)}),e})(),Fo=(()=>{class e extends Ee{_parse(r){const i=this._getOrReturnCtx(r);return W(i,{code:B.invalid_type,expected:K.never,received:i.parsedType}),ae}}return e.create=t=>new e({typeName:ce.ZodNever,...me(t)}),e})(),t2=(()=>{class e extends Ee{_parse(r){if(this._getType(r)!==K.undefined){const s=this._getOrReturnCtx(r);return W(s,{code:B.invalid_type,expected:K.void,received:s.parsedType}),ae}return En(r.data)}}return e.create=t=>new e({typeName:ce.ZodVoid,...me(t)}),e})(),Yu=(()=>{class e extends Ee{_parse(r){const{ctx:i,status:s}=this._processInputParams(r),o=this._def;if(i.parsedType!==K.array)return W(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&&(W(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 ci(i,c,i.path,l)))).then(c=>ln.mergeArray(s,c));const a=[...i.data].map((c,l)=>o.type._parseSync(new ci(i,c,i.path,l)));return ln.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,...me(r)}),e})();function Ic(e){if(e instanceof Tc){const t={};for(const r in e.shape)t[r]=Ls.create(Ic(e.shape[r]));return new Tc({...e._def,shape:()=>t})}return e instanceof Yu?new Yu({...e._def,type:Ic(e.element)}):e instanceof Ls?Ls.create(Ic(e.unwrap())):e instanceof Mc?Mc.create(Ic(e.unwrap())):e instanceof xc?xc.create(e.items.map(t=>Ic(t))):e}let Tc=(()=>{class e extends Ee{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 W(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 Fo&&"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 ci(o,o.data[d],o.path,d)),alwaysSet:d in o.data});if(this._def.catchall instanceof Fo){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&&(W(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 ci(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=>ln.mergeObjectSync(s,d)):ln.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 Ic(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 Ls;)a=a._def.innerType;i[s]=a}}),new e({...this._def,shape:()=>i})}keyof(){return i2(Re.objectKeys(this.shape))}}return e.create=(t,r)=>new e({shape:()=>t,unknownKeys:"strip",catchall:Fo.create(),typeName:ce.ZodObject,...me(r)}),e.strictCreate=(t,r)=>new e({shape:()=>t,unknownKeys:"strict",catchall:Fo.create(),typeName:ce.ZodObject,...me(r)}),e.lazycreate=(t,r)=>new e({shape:t,unknownKeys:"strip",catchall:Fo.create(),typeName:ce.ZodObject,...me(r)}),e})(),Ab=(()=>{class e extends Ee{_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 Gi(l.ctx.common.issues));return W(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 Gi(u));return W(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,...me(r)}),e})();const Wi=e=>e instanceof Rb?Wi(e.schema):e instanceof Bo?Wi(e.innerType()):e instanceof Ob?[e.value]:e instanceof Ps?e.options:e instanceof Xu?Re.objectValues(e.enum):e instanceof kb?Wi(e._def.innerType):e instanceof Tb?[void 0]:e instanceof xb?[null]:e instanceof Ls?[void 0,...Wi(e.unwrap())]:e instanceof Mc?[null,...Wi(e.unwrap())]:e instanceof Lb||e instanceof Fb?Wi(e.unwrap()):e instanceof Pb?Wi(e._def.innerType):[];class dg extends Ee{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==K.object)return W(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}):(W(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=Wi(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 dg({typeName:ce.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...me(i)})}}function Mb(e,t){const r=ks(e),i=ks(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=Mb(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 Ee{_parse(r){const{status:i,ctx:s}=this._processInputParams(r),o=(a,c)=>{if(wb(a)||wb(c))return ae;const l=Mb(a.value,c.value);return l.valid?((bb(a)||bb(c))&&i.dirty(),{status:i.value,value:l.data}):(W(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,...me(i)}),e})(),xc=(()=>{class e extends Ee{_parse(r){const{status:i,ctx:s}=this._processInputParams(r);if(s.parsedType!==K.array)return W(s,{code:B.invalid_type,expected:K.array,received:s.parsedType}),ae;if(s.data.lengththis._def.items.length&&(W(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 ci(s,c,s.path,l)):null}).filter(c=>!!c);return s.common.async?Promise.all(a).then(c=>ln.mergeArray(i,c)):ln.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,...me(r)})},e})();class Ju extends Ee{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 W(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 ci(i,c,i.path,c)),value:a._parse(new ci(i,i.data[c],i.path,c)),alwaysSet:c in i.data});return i.common.async?ln.mergeObjectAsync(r,s):ln.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,i){return new Ju(r instanceof Ee?{keyType:t,valueType:r,typeName:ce.ZodRecord,...me(i)}:{keyType:lg.create(),valueType:t,typeName:ce.ZodRecord,...me(r)})}}let n2=(()=>{class e extends Ee{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 W(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 ci(s,l,s.path,[d,"key"])),value:a._parse(new ci(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,...me(i)}),e})(),r2=(()=>{class e extends Ee{_parse(r){const{status:i,ctx:s}=this._processInputParams(r);if(s.parsedType!==K.set)return W(s,{code:B.invalid_type,expected:K.set,received:s.parsedType}),ae;const o=this._def;null!==o.minSize&&s.data.sizeo.maxSize.value&&(W(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 ci(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,...me(r)}),e})();class Ac extends Ee{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==K.function)return W(r,{code:B.invalid_type,expected:K.function,received:r.parsedType}),ae;function i(c,l){return ag({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,og(),Dc].filter(u=>!!u),issueData:{code:B.invalid_arguments,argumentsError:l}})}function s(c,l){return ag({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,og(),Dc].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 fg){const c=this;return En(U(function*(...l){const u=new Gi([]),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 En(function(...l){const u=c._def.args.safeParse(l,o);if(!u.success)throw new Gi([i(l,u.error)]);const d=Reflect.apply(a,this,u.data),f=c._def.returns.safeParse(d,o);if(!f.success)throw new Gi([s(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Ac({...this._def,args:xc.create(t).rest(Qu.create())})}returns(t){return new Ac({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,i){return new Ac({args:t||xc.create([]).rest(Qu.create()),returns:r||Qu.create(),typeName:ce.ZodFunction,...me(i)})}}let Rb=(()=>{class e extends Ee{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,...me(r)}),e})(),Ob=(()=>{class e extends Ee{_parse(r){if(r.data!==this._def.value){const i=this._getOrReturnCtx(r);return W(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,...me(r)}),e})();function i2(e,t){return new Ps({values:e,typeName:ce.ZodEnum,...me(t)})}class Ps extends Ee{constructor(){super(...arguments),Zu.set(this,void 0)}_parse(t){if("string"!=typeof t.data){const r=this._getOrReturnCtx(t);return W(r,{expected:Re.joinValues(this._def.values),received:r.parsedType,code:B.invalid_type}),ae}if(cg(this,Zu,"f")||Kk(this,Zu,new Set(this._def.values),"f"),!cg(this,Zu,"f").has(t.data)){const r=this._getOrReturnCtx(t);return W(r,{received:r.data,code:B.invalid_enum_value,options:this._def.values}),ae}return En(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 Ps.create(t,{...this._def,...r})}exclude(t,r=this._def){return Ps.create(this.options.filter(i=>!t.includes(i)),{...this._def,...r})}}Zu=new WeakMap,Ps.create=i2;class Xu extends Ee{constructor(){super(...arguments),Ku.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 W(i,{expected:Re.joinValues(s),received:i.parsedType,code:B.invalid_type}),ae}if(cg(this,Ku,"f")||Kk(this,Ku,new Set(Re.getValidEnumValues(this._def.values)),"f"),!cg(this,Ku,"f").has(t.data)){const s=Re.objectValues(r);return W(i,{received:i.data,code:B.invalid_enum_value,options:s}),ae}return En(t.data)}get enum(){return this._def.values}}Ku=new WeakMap,Xu.create=(e,t)=>new Xu({values:e,typeName:ce.ZodNativeEnum,...me(t)});let fg=(()=>{class e extends Ee{unwrap(){return this._def.type}_parse(r){const{ctx:i}=this._processInputParams(r);if(i.parsedType!==K.promise&&!1===i.common.async)return W(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 En(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,...me(r)}),e})(),Bo=(()=>{class e extends Ee{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=>{W(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?Sc(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?Sc(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(!Gu(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=>Gu(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,...me(i)}),e.createWithPreprocess=(t,r,i)=>new e({schema:r,effect:{type:"preprocess",transform:t},typeName:ce.ZodEffects,...me(i)}),e})(),Ls=(()=>{class e extends Ee{_parse(r){return this._getType(r)===K.undefined?En(void 0):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}}return e.create=(t,r)=>new e({innerType:t,typeName:ce.ZodOptional,...me(r)}),e})(),Mc=(()=>{class e extends Ee{_parse(r){return this._getType(r)===K.null?En(null):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}}return e.create=(t,r)=>new e({innerType:t,typeName:ce.ZodNullable,...me(r)}),e})(),kb=(()=>{class e extends Ee{_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,...me(r)}),e})(),Pb=(()=>{class e extends Ee{_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 Wu(o)?o.then(a=>({status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new Gi(s.common.issues)},input:s.data})})):{status:"valid",value:"valid"===o.status?o.value:this._def.catchValue({get error(){return new Gi(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,...me(r)}),e})(),s2=(()=>{class e extends Ee{_parse(r){if(this._getType(r)!==K.nan){const s=this._getOrReturnCtx(r);return W(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,...me(t)}),e})();const uJ=Symbol("zod_brand");class Lb extends Ee{_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 ed extends Ee{_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(),Sc(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 ed({in:t,out:r,typeName:ce.ZodPipeline})}}let Fb=(()=>{class e extends Ee{_parse(r){const i=this._def.innerType._parse(r),s=o=>(Gu(o)&&(o.value=Object.freeze(o.value)),o);return Wu(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,...me(r)}),e})();function o2(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 dJ={object:Tc.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 a2=lg.create,c2=Cb.create,hJ=s2.create,pJ=Db.create,l2=Sb.create,gJ=Ib.create,mJ=e2.create,yJ=Tb.create,vJ=xb.create,_J=ug.create,wJ=Qu.create,bJ=Fo.create,EJ=t2.create,CJ=Yu.create,DJ=Tc.create,SJ=Tc.strictCreate,IJ=Ab.create,TJ=dg.create,xJ=Nb.create,AJ=xc.create,MJ=Ju.create,NJ=n2.create,RJ=r2.create,OJ=Ac.create,kJ=Rb.create,PJ=Ob.create,LJ=Ps.create,FJ=Xu.create,BJ=fg.create,u2=Bo.create,VJ=Ls.create,UJ=Mc.create,jJ=Bo.createWithPreprocess,$J=ed.create;var d2,z=Object.freeze({__proto__:null,defaultErrorMap:Dc,setErrorMap:function WY(e){Zk=e},getErrorMap:og,makeIssue:ag,EMPTY_PATH:[],addIssueToContext:W,ParseStatus:ln,INVALID:ae,DIRTY:Sc,OK:En,isAborted:wb,isDirty:bb,isValid:Gu,isAsync:Wu,get util(){return Re},get objectUtil(){return Wk},ZodParsedType:K,getParsedType:ks,ZodType:Ee,datetimeRegex:Xk,ZodString:lg,ZodNumber:Cb,ZodBigInt:Db,ZodBoolean:Sb,ZodDate:Ib,ZodSymbol:e2,ZodUndefined:Tb,ZodNull:xb,ZodAny:ug,ZodUnknown:Qu,ZodNever:Fo,ZodVoid:t2,ZodArray:Yu,ZodObject:Tc,ZodUnion:Ab,ZodDiscriminatedUnion:dg,ZodIntersection:Nb,ZodTuple:xc,ZodRecord:Ju,ZodMap:n2,ZodSet:r2,ZodFunction:Ac,ZodLazy:Rb,ZodLiteral:Ob,ZodEnum:Ps,ZodNativeEnum:Xu,ZodPromise:fg,ZodEffects:Bo,ZodTransformer:Bo,ZodOptional:Ls,ZodNullable:Mc,ZodDefault:kb,ZodCatch:Pb,ZodNaN:s2,BRAND:uJ,ZodBranded:Lb,ZodPipeline:ed,ZodReadonly:Fb,custom:o2,Schema:Ee,ZodSchema:Ee,late:dJ,get ZodFirstPartyTypeKind(){return ce},coerce:{string:e=>lg.create({...e,coerce:!0}),number:e=>Cb.create({...e,coerce:!0}),boolean:e=>Sb.create({...e,coerce:!0}),bigint:e=>Db.create({...e,coerce:!0}),date:e=>Ib.create({...e,coerce:!0})},any:_J,array:CJ,bigint:pJ,boolean:l2,date:gJ,discriminatedUnion:TJ,effect:u2,enum:LJ,function:OJ,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>o2(r=>r instanceof e,t),intersection:xJ,lazy:kJ,literal:PJ,map:NJ,nan:hJ,nativeEnum:FJ,never:bJ,null:vJ,nullable:UJ,number:c2,object:DJ,oboolean:()=>l2().optional(),onumber:()=>c2().optional(),optional:VJ,ostring:()=>a2().optional(),pipeline:$J,preprocess:jJ,promise:BJ,record:MJ,set:RJ,strictObject:SJ,string:a2,symbol:mJ,transformer:u2,tuple:AJ,undefined:yJ,union:IJ,unknown:wJ,void:EJ,NEVER:ae,ZodIssueCode:B,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:Gi});class st{static id(){return z.string().regex(/^[0-9a-f]{64}$/)}static event(){return z.object({id:st.id(),kind:z.number().int().nonnegative(),pubkey:st.id(),tags:z.string().array().array(),content:z.string(),created_at:z.number().int().nonnegative(),sig:z.string()})}static filter(){return z.object({kinds:z.number().int().nonnegative().array().optional(),ids:st.id().array().optional(),authors:st.id().array().optional(),since:z.number().int().nonnegative().optional(),until:z.number().int().nonnegative().optional(),limit:z.number().int().nonnegative().optional(),search:z.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 z.string().regex(/^[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}$/).refine(r=>!t||r.startsWith(`${t}1`))}static clientEVENT(){return z.tuple([z.literal("EVENT"),st.event()])}static clientREQ(){return z.tuple([z.literal("REQ"),z.string()]).rest(st.filter())}static clientCOUNT(){return z.tuple([z.literal("COUNT"),z.string()]).rest(st.filter())}static clientCLOSE(){return z.tuple([z.literal("CLOSE"),z.string()])}static clientAUTH(){return z.tuple([z.literal("AUTH"),st.event()])}static clientMsg(){return z.union([st.clientEVENT(),st.clientREQ(),st.clientCOUNT(),st.clientCLOSE(),st.clientAUTH()])}static relayEVENT(){return z.tuple([z.literal("EVENT"),z.string(),st.event()])}static relayOK(){return z.tuple([z.literal("OK"),st.id(),z.boolean(),z.string()])}static relayEOSE(){return z.tuple([z.literal("EOSE"),z.string()])}static relayNOTICE(){return z.tuple([z.literal("NOTICE"),z.string()])}static relayCLOSED(){return z.tuple([z.literal("CLOSED"),z.string(),z.string()])}static relayAUTH(){return z.tuple([z.literal("AUTH"),z.string()])}static relayCOUNT(){return z.tuple([z.literal("COUNT"),z.string(),z.object({count:z.number().int().nonnegative(),approximate:z.boolean().optional()})])}static relayMsg(){return z.union([st.relayEVENT(),st.relayOK(),st.relayEOSE(),st.relayNOTICE(),st.relayCLOSED(),st.relayAUTH(),st.relayCOUNT()])}static metadata(){return z.object({about:z.string().optional().catch(void 0),banner:z.string().url().optional().catch(void 0),bot:z.boolean().optional().catch(void 0),display_name:z.string().optional().catch(void 0),lud06:st.bech32("lnurl").optional().catch(void 0),lud16:z.string().email().optional().catch(void 0),name:z.string().optional().catch(void 0),nip05:z.string().email().optional().catch(void 0),picture:z.string().url().optional().catch(void 0),website:z.string().url().optional().catch(void 0)}).passthrough()}static connectRequest(){return z.object({id:z.string(),method:z.string(),params:z.string().array()})}static connectResponse(){return z.object({id:z.string(),result:z.string(),error:z.string().optional()})}static json(){return z.string().transform((t,r)=>{try{return JSON.parse(t)}catch{return r.addIssue({code:z.ZodIssueCode.custom,message:"Invalid JSON"}),z.NEVER}})}}d2=Symbol.asyncDispose;class HJ{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 $Y(1e3)}=this.opts;return new zY(this.url).withBuffer(new qY).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=hc}=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 sg(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=Ss(a);l=!(h=yield Os(f.next())).done;l=!1){const p=h.value;if("EOSE"===p[0]&&(yield p),"CLOSED"===p[0])break;if("EVENT"===p[0]){if(!Op(t,p[2]))continue;yield p}}}catch(p){u=!0,d=p}finally{try{l&&null!=f.return&&(yield Os(f.return()))}finally{if(u)throw d}}}finally{i.send(["CLOSE",o])}})()}query(t,r){var i=this;return U(function*(){const s=new hr,o=t.reduce((f,h)=>f+hO(h),0);if(0===o)return[];var l,a=!1,c=!1;try{for(var d,u=Ss(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 sg(function*(){if(r?.aborted)throw i.abortError();const s=new zk(r),o=f=>s.push(f.detail);i.ee.addEventListener(t,o);try{var l,a=!1,c=!1;try{for(var d,u=Ss(s);a=!(d=yield Os(u.next())).done;a=!1)yield d.value}catch(f){c=!0,l=f}finally{try{a&&null!=u.return&&(yield Os(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=Ss(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(Je.close,r,{once:!0})}))})()}[d2](){var t=this;return U(function*(){yield t.close()})()}}function td(e){return $t((t,r)=>{try{t.subscribe(r)}finally{r.add(e)}})}function nd(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 Bb=(()=>{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(nd)}catch{}return"wss://relay.nostr.net".split(",").map(nd)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),hg=(()=>{class e extends jY{constructor(r){var i,s;super({open:s=>new HJ(s),reqRouter:(s=U(function*(o){const a=[];return i.relayConfigService.getConfig().forEach(c=>{a.push([c,o])}),new Map(a)}),function(a){return s.apply(this,arguments)}),eventRouter:function(){var s=U(function*(){return i.relayConfigService.getConfig()});return function(){return s.apply(this,arguments)}}()}),i=this,this.relayConfigService=r}observe(r){var i=this;console.info((new Date).toLocaleString(),"[[subscribe filter]]",r);const s=new AbortController,o=new Xe,a=new Map;return U(function*(){var u,c=!1,l=!1;try{for(var f,d=Ss(i.req(r,s));c=!(f=yield d.next()).done;c=!1){const h=f.value;if("CLOSED"===h[0]){o.error(h);break}if("EVENT"===h[0]){const p=a.size;a.set(h[2].id,h[2]),p!==a.size?o.next(h[2]):(console.debug((new Date).toLocaleString(),"event deduplicated, not emiting again: ",h[2]),console.debug((new Date).toLocaleString(),"current nset from request: ",a))}}}catch(h){l=!0,u=h}finally{try{c&&null!=d.return&&(yield d.return())}finally{if(l)throw u}}})(),o.asObservable().pipe(td(()=>{console.info((new Date).toLocaleString(),"[[unsubscribe filter]]",r),s.abort()}))}static{this.\u0275fac=function(i){return new(i||e)(Z(Bb))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})(),h2=(()=>{class e{constructor(){this.pubkeySet=new Set,this.loadList()}loadList(){try{const r=sessionStorage.getItem("alwaysIgnoreWannachat");if(r){let i=JSON.parse(r);i instanceof Array?this.pubkeySet=new Set(i):sessionStorage.setItem("alwaysIgnoreWannachat","[]")}}catch{sessionStorage.setItem("alwaysIgnoreWannachat","[]")}}saveInList(r){this.pubkeySet.add(r),sessionStorage.setItem("alwaysIgnoreWannachat",JSON.stringify([...this.pubkeySet]))}isInList(r){return this.pubkeySet.has(r)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),p2=(()=>{class e{constructor(r,i){this.npool=r,this.ignoreListService=i}listenUserStatusUpdate(r){return console.info((new Date).toLocaleString(),"observing filter:",[{kinds:[cn.UserStatuses],authors:[r]}]),this.npool.observe([{kinds:[cn.UserStatuses],authors:[r]}])}queryWannachatResponse(r){return console.info((new Date).toLocaleString(),"quering filter:",[{kinds:[cn.UserStatuses],"#t":["chating","omegle"],"#p":[r.pubkey],limit:1}]),this.npool.query([{kinds:[cn.UserStatuses],"#t":["chating","omegle"],"#p":[r.pubkey],limit:1}])}listenWannachatResponse(r){return console.info((new Date).toLocaleString(),"observing filter:",[{kinds:[cn.UserStatuses],"#t":["chating","omegle"],"#p":[r.pubkey],limit:1}]),this.npool.observe([{kinds:[cn.UserStatuses],"#t":["chating","omegle"],"#p":[r.pubkey],limit:1}])}queryChatAvailable(){var r=this;return U(function*(){const i=Math.floor((new Date).getTime()/1e3);console.info((new Date).toLocaleString(),"quering filter: ",[{kinds:[cn.UserStatuses],"#t":["wannachat","omegle"],since:i-600}]);let o=yield r.npool.query([{kinds:[cn.UserStatuses],"#t":["wannachat","omegle"],since:i-600}]);o=o.filter(c=>!r.ignoreListService.isInList(c.pubkey));const a=o[Math.floor(Math.random()*o.length)];return a?console.info((new Date).toLocaleString(),"wanna chat found:",a):console.info((new Date).toLocaleString(),"wanna chat NOT found..."),Promise.resolve(a||null)})()}static{this.\u0275fac=function(i){return new(i||e)(Z(hg),Z(h2))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})();class Vo{constructor(t){const{type:r,data:i}=Mu.decode(t);if("nsec"===r)this.nsec=t,this.secretKey=i,this.pubkey=rO(this.secretKey),this.npub=Mu.npubEncode(this.pubkey);else{if("npub"!==r)throw new Error("Invalid argument, NostrUser expect nsec or npub string");this.npub=t,this.pubkey=i.toString(),this.nsec=void 0,this.secretKey=void 0}}static fromPubkey(t){return new Vo(Mu.npubEncode(t))}static fromSecretKeyBytes(t){return new Vo(Mu.nsecEncode(t))}static create(){return this.fromSecretKeyBytes(wW())}toString(){return this.pubkey}}class qJ extends Et{constructor(t,r){super()}schedule(t,r=0){return this}}const pg={setInterval(e,t,...r){const{delegate:i}=pg;return i?.setInterval?i.setInterval(e,t,...r):setInterval(e,t,...r)},clearInterval(e){const{delegate:t}=pg;return(t?.clearInterval||clearInterval)(e)},delegate:void 0},g2={now:()=>(g2.delegate||Date).now(),delegate:void 0};class rd{constructor(t,r=rd.now){this.schedulerActionCtor=t,this.now=r}schedule(t,r=0,i){return new this.schedulerActionCtor(this,t).schedule(i,r)}}rd.now=g2.now;const ZJ=new class WJ extends rd{constructor(t,r=rd.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 GJ extends qJ{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 pg.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&&pg.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,jd(i,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,super.unsubscribe()}}});function Fs(e){return this instanceof Fs?(this.v=e,this):new Fs(e)}function _2(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 $b(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 w2=e=>e&&"number"==typeof e.length&&"function"!=typeof e;function b2(e){return at(e?.then)}function E2(e){return at(e[Em])}function C2(e){return Symbol.asyncIterator&&at(e?.[Symbol.asyncIterator])}function D2(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 S2=function EX(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}();function I2(e){return at(e?.[S2])}function T2(e){return function v2(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 Fs?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 Fs(r.read());if(s)return yield Fs(void 0);yield yield Fs(i)}}finally{r.releaseLock()}})}function x2(e){return at(e?.getReader)}function Or(e){if(e instanceof jt)return e;if(null!=e){if(E2(e))return function CX(e){return new jt(t=>{const r=e[Em]();if(at(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(e);if(w2(e))return function DX(e){return new jt(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(C2(e))return A2(e);if(I2(e))return function IX(e){return new jt(t=>{for(const r of e)if(t.next(r),t.closed)return;t.complete()})}(e);if(x2(e))return function TX(e){return A2(T2(e))}(e)}throw D2(e)}function A2(e){return new jt(t=>{(function xX(e,t){var r,i,s,o;return function m2(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=_2(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 li(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}const AX=Ud(e=>function(r=null){e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=r});function M2(e,t){const{first:r,each:i,with:s=MX,scheduler:o=t??ZJ,meta:a=null}=function KJ(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 $t((c,l)=>{let u,d,f=null,h=0;const p=g=>{d=li(l,o,()=>{try{u.unsubscribe(),Or(s({meta:a,lastValue:f,seen:h})).subscribe(l)}catch(m){l.error(m)}},g)};u=c.subscribe(Ct(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 MX(e){throw new AX(e)}function Bs(e){return $t((t,r)=>{let o,i=null,s=!1;i=t.subscribe(Ct(r,void 0,void 0,a=>{o=Or(e(a,Bs(e)(t))),i?(i.unsubscribe(),i=null,o.subscribe(r)):s=!0})),s&&(i.unsubscribe(),i=null,o.subscribe(r))})}function Nc(e,t){const r=at(e)?e:()=>e,i=s=>s.error(r());return new jt(t?s=>t.schedule(i,0,s):i)}let Hb=(()=>{class e{constructor(r){this.globalConfigService=r,this.largeExpirationTime=1800}getCurrentTimestamp(){return Math.floor(Date.now()/1e3)}getExpirationTimestamp(r=this.globalConfigService.wannachatStatusDefaultTimeoutInSeconds){const s=Math.floor(Date.now()/1e3)+r;return String(s)}createEncryptedDirectMessage(r,i,s){var o=this;return U(function*(){const a=yield Ru.encrypt(r.secretKey,i.pubkey,s),c={kind:cn.EncryptedDirectMessage,content:a,created_at:o.getCurrentTimestamp(),tags:[["p",i.pubkey],["expiration",o.getExpirationTimestamp(o.largeExpirationTime)]]},l=fr(c,r.secretKey);return Promise.resolve(l)})()}createWannaChatUserStatus(r,i=!1){return this.createUserStatus(r,"wannachat",[["expiration",this.getExpirationTimestamp()],["t","omegle"],["t","wannachat"]],i)}createDisconnectedUserStatus(r){return this.createUserStatus(r,"disconnected",[["expiration",this.getExpirationTimestamp()]])}createTypingUserStatus(r){return this.createUserStatus(r,"typing",[["t","omegle"],["expiration",this.getExpirationTimestamp(this.largeExpirationTime)]])}createChatingUserStatus(r,i,s=!1){return this.createUserStatus(r,"chating",[["expiration",this.getExpirationTimestamp(this.largeExpirationTime)],["p",i.pubkey],["t","omegle"],["t","chating"]],s)}deleteUserHistory(r){const i={kind:5,tags:[["k",String(cn.EncryptedDirectMessage)],["k",String(cn.UserStatuses)],["expiration",this.getExpirationTimestamp()]],created_at:Math.floor((new Date).getTime()/1e3),content:""};return fr(i,r.secretKey)}cleanUserStatus(r){return this.createUserStatus(r,"",[["expiration",this.getExpirationTimestamp(this.largeExpirationTime)],["t","omegle"]])}createUserStatus(r,i,s,o=!1){var a=this;return U(function*(){const c=[["d","general"],...s||[]];let l={kind:cn.UserStatuses,content:i,created_at:a.getCurrentTimestamp(),tags:c};if(o){const{data:u}=yield new Promise(d=>{const f=new Worker(_i.tu(new URL(_i.p+_i.u(929),_i.b)));f.onmessage=({data:h})=>d(h),f.postMessage({...l,pubkey:r.pubkey})});l=u}return fr(l,r.secretKey)})()}static{this.\u0275fac=function(i){return new(i||e)(Z(__))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),N2=(()=>{class e{constructor(r,i,s,o,a){this.nostrEventFactory=r,this.findStrangerNostr=i,this.ignoreListService=s,this.config=o,this.npool=a}publish(r){return this.npool.event(r)}searchStranger(r){var i=this;return U(function*(){const s=yield i.findStrangerNostr.queryChatAvailable(),o=!0;if(s){console.info((new Date).toLocaleString(),"inviting ",s.pubkey," to chat and listening confirmation");const a=i.listenChatingConfirmation(s,r);yield i.inviteToChating(r,s,o);const c=yield a;return i.ignoreListService.saveInList(s.pubkey),c?Promise.resolve(Vo.fromPubkey(s.pubkey)):(yield i.disconnect(r),i.searchStranger(r))}return yield i.publishWannaChatStatus(r,o),new Promise(a=>{const c=i.findStrangerNostr.listenWannachatResponse(r).pipe(M2(1e3*i.config.wannachatStatusDefaultTimeoutInSeconds),Bs(l=>(c.unsubscribe(),i.deleteUserHistory(r).then(()=>i.searchStranger(r).then(u=>a(u))),Nc(()=>new l)))).subscribe({next:l=>{i.ignoreListService.saveInList(l.pubkey),i.replyChatInvitation(l,r).then(u=>u&&a(u)).catch(u=>{throw console.error(u),u}),c.unsubscribe()},error:l=>console.error((new Date).toLocaleString(),l)})})})()}replyChatInvitation(r,i){var s=this;return U(function*(){return console.info((new Date).toLocaleString(),"event was listen: ",r),console.info((new Date).toLocaleString(),"it must be a chating invitation from ",r.pubkey,", repling invitation..."),yield s.inviteToChating(i,r),console.info((new Date).toLocaleString(),"replied... resolving... "),console.info((new Date).toLocaleString(),"[searchStranger] unsubscribe"),Promise.resolve(Vo.fromPubkey(r.pubkey))})()}isChatingToMe(r,i){console.info((new Date).toLocaleString(),"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(),"is wannachat reply with chating?",s.length?"yes":"no"),!!s.length}inviteToChating(r,i,s=!1){const o=Vo.fromPubkey(i.pubkey);return this.publishChatInviteStatus(r,o,s)}listenChatingConfirmation(r,i){var s=this;return U(function*(){return new Promise(o=>{console.info((new Date).toLocaleString(),"listening status update from: ",r.pubkey);const a=s.findStrangerNostr.listenUserStatusUpdate(r.pubkey).pipe(M2(5e3),Bs(c=>Nc(()=>new Error("chat confirmation timeout after 5s waiting, there is no stranger connected to this session")))).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){return i.id===s.id&&"wannachat"===i.content?(console.info((new Date).toLocaleString(),"stranger #wannachat status was listen, ignoring and waiting new status..."),Promise.resolve(void 0)):(r.unsubscribe(),console.info((new Date).toLocaleString(),"[listenUserStatusUpdate] unsubscribe"),console.info((new Date).toLocaleString(),"stranger ",s.pubkey," update status: ",i),this.isChatingToMe(i,o)?(console.info((new Date).toLocaleString(),'is "chating" status confirmed, resolved with true'),Promise.resolve(!0)):(console.info((new Date).toLocaleString(),"unexpected status was given, resolved with false, event: ",i),Promise.resolve(!1)))}publishWannaChatStatus(r,i=!1){var s=this;return U(function*(){const o=yield s.nostrEventFactory.createWannaChatUserStatus(r,i);return console.info((new Date).toLocaleString(),"updating my status to: ",o),yield s.npool.event(o),Promise.resolve(o)})()}publishChatInviteStatus(r,i,s=!1){var o=this;return U(function*(){const a=yield o.nostrEventFactory.createChatingUserStatus(r,i,s);return console.info((new Date).toLocaleString(),"updating my status to: ",a),yield o.npool.event(a),Promise.resolve(a)})()}deleteUserHistory(r){var i=this;return U(function*(){const s=i.nostrEventFactory.deleteUserHistory(r);console.info((new Date).toLocaleString(),"deleting user history"),yield i.npool.event(s)})()}connect(){const r=Vo.create();return this.ignoreListService.saveInList(r.pubkey),r}disconnect(r){var i=this;return U(function*(){const s=yield i.nostrEventFactory.createDisconnectedUserStatus(r);return console.info((new Date).toLocaleString(),"updating my status to: ",s),yield i.deleteUserHistory(r),yield i.npool.event(s),Promise.resolve(s)})()}static{this.\u0275fac=function(i){return new(i||e)(Z(Hb),Z(p2),Z(h2),Z(__),Z(hg))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})(),R2=(()=>{class e{constructor(r,i){this.nostrEventFactory=r,this.npool=i,this.updateUserCountTimeout=3e5}openEncryptedDirectMessage(r,i,s){return U(function*(){return Ru.decrypt(r.secretKey,i.pubkey,s.content)})()}listenMessages(r,i){return this.npool.observe([{kinds:[cn.EncryptedDirectMessage],authors:[i.pubkey],"#p":[r.pubkey]}])}listenStrangerStatus(r){return this.npool.observe([{kinds:[cn.UserStatuses],authors:[r.pubkey]}])}listenCurrenOnlineUsers(){const r=new Xe;let i=!1;const s=()=>{i||(i=!0,console.info((new Date).toLocaleString(),"user count requested"),this.npool.query([{kinds:[cn.UserStatuses],"#t":["omegle"],since:Math.floor(Date.now()/1e3)-86400}]).then(a=>{const c=new Set;console.info((new Date).toLocaleString(),"count events",a),a.forEach(u=>c.add(u.pubkey));const l=[...c].length;console.info((new Date).toLocaleString(),"active users counted: ",l),r.next(l),i=!1}).catch(a=>{console.error((new Date).toLocaleString(),"user count lauched error",a),i=!1,clearInterval(o)}))},o=setInterval(s,this.updateUserCountTimeout);return s(),r.asObservable().pipe(td(()=>clearInterval(o)))}sendMessage(r,i,s){var o=this;return U(function*(){yield o.stopTyping(r);const a=yield o.nostrEventFactory.createEncryptedDirectMessage(r,i,s);return o.npool.event(a)})()}isTyping(r){var i=this;return U(function*(){const s=yield i.nostrEventFactory.createTypingUserStatus(r);return i.npool.event(s)})()}stopTyping(r){var i=this;return U(function*(){const s=yield i.nostrEventFactory.cleanUserStatus(r);return i.npool.event(s)})()}static{this.\u0275fac=function(i){return new(i||e)(Z(Hb),Z(hg))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})(),NX=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ht({type:e})}static{this.\u0275inj=Nt({providers:[p2,N2,R2],imports:[bo]})}}return e})();function O2(e,t=0){return $t((r,i)=>{r.subscribe(Ct(i,s=>li(i,e,()=>i.next(s),t),()=>li(i,e,()=>i.complete(),t),s=>li(i,e,()=>i.error(s),t)))})}function k2(e,t=0){return $t((r,i)=>{i.add(e.schedule(()=>r.subscribe(i),t))})}function P2(e,t){if(!e)throw new Error("Iterable cannot be null");return new jt(r=>{li(r,t,()=>{const i=e[Symbol.asyncIterator]();li(r,t,()=>{i.next().then(s=>{s.done?r.complete():r.next(s.value)})},0,!0)})})}function qt(e,t){return t?function BX(e,t){if(null!=e){if(E2(e))return function OX(e,t){return Or(e).pipe(k2(t),O2(t))}(e,t);if(w2(e))return function PX(e,t){return new jt(r=>{let i=0;return t.schedule(function(){i===e.length?r.complete():(r.next(e[i++]),r.closed||this.schedule())})})}(e,t);if(b2(e))return function kX(e,t){return Or(e).pipe(k2(t),O2(t))}(e,t);if(C2(e))return P2(e,t);if(I2(e))return function LX(e,t){return new jt(r=>{let i;return li(r,t,()=>{i=e[S2](),li(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(x2(e))return function FX(e,t){return P2(T2(e),t)}(e,t)}throw D2(e)}(e,t):Or(e)}function zb(e){return e[e.length-1]}function L2(e){return at(zb(e))?e.pop():void 0}function gg(e){return function VX(e){return e&&at(e.schedule)}(zb(e))?e.pop():void 0}function fe(...e){return qt(e,gg(e))}const{isArray:UX}=Array,{getPrototypeOf:jX,prototype:$X,keys:HX}=Object;function F2(e){if(1===e.length){const t=e[0];if(UX(t))return{args:t,keys:null};if(function zX(e){return e&&"object"==typeof e&&jX(e)===$X}(t)){const r=HX(t);return{args:r.map(i=>t[i]),keys:r}}}return{args:e,keys:null}}const{isArray:qX}=Array;function B2(e){return Ve(t=>function GX(e,t){return qX(t)?e(...t):e(t)}(e,t))}function V2(e,t){return e.reduce((r,i,s)=>(r[i]=t[s],r),{})}function qb(...e){const t=gg(e),r=L2(e),{args:i,keys:s}=F2(e);if(0===i.length)return qt([],t);const o=new jt(function WX(e,t,r=Ws){return i=>{U2(t,()=>{const{length:s}=e,o=new Array(s);let a=s,c=s;for(let l=0;l{const u=qt(e[l],t);let d=!1;u.subscribe(Ct(i,f=>{o[l]=f,d||(d=!0,c--),c||i.next(r(o.slice()))},()=>{--a||i.complete()}))},i)},i)}}(i,t,s?a=>V2(s,a):Ws));return r?o.pipe(B2(r)):o}function U2(e,t,r){e?li(r,e,t):t()}const mg=Ud(e=>function(){e(this),this.name="EmptyError",this.message="no elements in sequence"});function un(e,t,r=1/0){return at(t)?un((i,s)=>Ve((o,a)=>t(i,o,s,a))(Or(e(i,s))),r):("number"==typeof t&&(r=t),$t((i,s)=>function ZX(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;Or(r(m,d++)).subscribe(Ct(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(Ct(t,p,()=>{f=!0,h()})),()=>{c?.()}}(i,s,e,r)))}function id(e=1/0){return un(Ws,e)}function Gb(...e){return function KX(){return id(1)}()(qt(e,gg(e)))}function j2(e){return new jt(t=>{Or(e()).subscribe(t)})}const ui=new jt(e=>e.complete());function Wb(){return $t((e,t)=>{let r=null;e._refCount++;const i=Ct(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 $2 extends jt{constructor(t,r){super(),this.source=t,this.subjectFactory=r,this._subject=null,this._refCount=0,this._connection=null,BC(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 Et;const r=this.getSubject();t.add(this.source.subscribe(Ct(r,void 0,()=>{this._teardown(),r.complete()},i=>{this._teardown(),r.error(i)},()=>this._teardown()))),t.closed&&(this._connection=null,t=Et.EMPTY)}return t}refCount(){return Wb()(this)}}function di(e,t){return $t((r,i)=>{let s=null,o=0,a=!1;const c=()=>a&&!s&&i.complete();r.subscribe(Ct(i,l=>{s?.unsubscribe();let u=0;const d=o++;Or(e(l,d)).subscribe(s=Ct(i,f=>i.next(t?t(l,f,d,u++):f),()=>{s=null,c()}))},()=>{a=!0,c()}))})}function Rc(e){return e<=0?()=>ui:$t((t,r)=>{let i=0;t.subscribe(Ct(r,s=>{++i<=e&&(r.next(s),e<=i&&r.complete())}))})}function Zi(e,t){return $t((r,i)=>{let s=0;r.subscribe(Ct(i,o=>e.call(t,o,s++)&&i.next(o)))})}function yg(e){return $t((t,r)=>{let i=!1;t.subscribe(Ct(r,s=>{i=!0,r.next(s)},()=>{i||r.next(e),r.complete()}))})}function H2(e=JX){return $t((t,r)=>{let i=!1;t.subscribe(Ct(r,s=>{i=!0,r.next(s)},()=>i?r.complete():r.error(e())))})}function JX(){return new mg}function Vs(e,t){const r=arguments.length>=2;return i=>i.pipe(e?Zi((s,o)=>e(s,o,i)):Ws,Rc(1),r?yg(t):H2(()=>new mg))}function sd(e,t){return at(t)?un(e,t,1):un(e,1)}function Cn(e,t,r){const i=at(e)||t||r?{next:e,error:t,complete:r}:e;return i?$t((s,o)=>{var a;null===(a=i.subscribe)||void 0===a||a.call(i);let c=!0;s.subscribe(Ct(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)}))}):Ws}function Zb(e){return e<=0?()=>ui:$t((t,r)=>{let i=[];t.subscribe(Ct(r,s=>{i.push(s),e{for(const s of i)r.next(s);r.complete()},void 0,()=>{i=null}))})}const ye="primary",od=Symbol("RouteTitle");class iee{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 Oc(e){return new iee(e)}function see(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 q2(e){return e.length>0?e[e.length-1]:null}function Us(e){return function RX(e){return!!e&&(e instanceof jt||at(e.lift)&&at(e.subscribe))}(e)?e:cu(e)?qt(Promise.resolve(e)):fe(e)}const aee={exact:function Z2(e,t,r){if(!jo(e.segments,t.segments)||!vg(e.segments,t.segments,r)||e.numberOfChildren!==t.numberOfChildren)return!1;for(const i in t.children)if(!e.children[i]||!Z2(e.children[i],t.children[i],r))return!1;return!0},subset:K2},G2={exact:function cee(e,t){return fi(e,t)},subset:function lee(e,t){return Object.keys(t).length<=Object.keys(e).length&&Object.keys(t).every(r=>z2(e[r],t[r]))},ignored:()=>!0};function W2(e,t,r){return aee[r.paths](e.root,t.root,r.matrixParams)&&G2[r.queryParams](e.queryParams,t.queryParams)&&!("exact"===r.fragment&&e.fragment!==t.fragment)}function K2(e,t,r){return Q2(e,t,t.segments,r)}function Q2(e,t,r,i){if(e.segments.length>r.length){const s=e.segments.slice(0,r.length);return!(!jo(s,r)||t.hasChildren()||!vg(s,r,i))}if(e.segments.length===r.length){if(!jo(e.segments,r)||!vg(e.segments,r,i))return!1;for(const s in t.children)if(!e.children[s]||!K2(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!!(jo(e.segments,s)&&vg(e.segments,s,i)&&e.children[ye])&&Q2(e.children[ye],t,o,i)}}function vg(e,t,r){return t.every((i,s)=>G2[r](e[s].parameters,i.parameters))}class Uo{constructor(t=new We([],{}),r={},i=null){this.root=t,this.queryParams=r,this.fragment=i}get queryParamMap(){return this._queryParamMap??=Oc(this.queryParams),this._queryParamMap}toString(){return fee.serialize(this)}}class We{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 wg(this)}}class ad{constructor(t,r){this.path=t,this.parameters=r}get parameterMap(){return this._parameterMap??=Oc(this.parameters),this._parameterMap}toString(){return X2(this)}}function jo(e,t){return e.length===t.length&&e.every((r,i)=>r.path===t[i].path)}let kc=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:()=>new _g,providedIn:"root"})}}return e})();class _g{parse(t){const r=new Cee(t);return new Uo(r.parseRootSegment(),r.parseQueryParams(),r.parseFragment())}serialize(t){const r=`/${cd(t.root,!0)}`,i=function gee(e){const t=Object.entries(e).map(([r,i])=>Array.isArray(i)?i.map(s=>`${bg(r)}=${bg(s)}`).join("&"):`${bg(r)}=${bg(i)}`).filter(r=>r);return t.length?`?${t.join("&")}`:""}(t.queryParams),s="string"==typeof t.fragment?`#${function hee(e){return encodeURI(e)}(t.fragment)}`:"";return`${r}${i}${s}`}}const fee=new _g;function wg(e){return e.segments.map(t=>X2(t)).join("/")}function cd(e,t){if(!e.hasChildren())return wg(e);if(t){const r=e.children[ye]?cd(e.children[ye],!1):"",i=[];return Object.entries(e.children).forEach(([s,o])=>{s!==ye&&i.push(`${s}:${cd(o,!1)}`)}),i.length>0?`${r}(${i.join("//")})`:r}{const r=function dee(e,t){let r=[];return Object.entries(e.children).forEach(([i,s])=>{i===ye&&(r=r.concat(t(s,i)))}),Object.entries(e.children).forEach(([i,s])=>{i!==ye&&(r=r.concat(t(s,i)))}),r}(e,(i,s)=>s===ye?[cd(e.children[ye],!1)]:[`${s}:${cd(i,!1)}`]);return 1===Object.keys(e.children).length&&null!=e.children[ye]?`${wg(e)}/${r[0]}`:`${wg(e)}/(${r.join("//")})`}}function Y2(e){return encodeURIComponent(e).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function bg(e){return Y2(e).replace(/%3B/gi,";")}function Qb(e){return Y2(e).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function Eg(e){return decodeURIComponent(e)}function J2(e){return Eg(e.replace(/\+/g,"%20"))}function X2(e){return`${Qb(e.path)}${function pee(e){return Object.entries(e).map(([t,r])=>`;${Qb(t)}=${Qb(r)}`).join("")}(e.parameters)}`}const mee=/^[^\/()?;#]+/;function Yb(e){const t=e.match(mee);return t?t[0]:""}const yee=/^[^\/()?;=#]+/,_ee=/^[^=?&#]+/,bee=/^[^&#]+/;class Cee{constructor(t){this.url=t,this.remaining=t}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new We([],{}):new We([],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[ye]=new We(t,r)),i}parseSegment(){const t=Yb(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new A(4009,!1);return this.capture(t),new ad(Eg(t),this.parseMatrixParams())}parseMatrixParams(){const t={};for(;this.consumeOptional(";");)this.parseParam(t);return t}parseParam(t){const r=function vee(e){const t=e.match(yee);return t?t[0]:""}(this.remaining);if(!r)return;this.capture(r);let i="";if(this.consumeOptional("=")){const s=Yb(this.remaining);s&&(i=s,this.capture(i))}t[Eg(r)]=Eg(i)}parseQueryParam(t){const r=function wee(e){const t=e.match(_ee);return t?t[0]:""}(this.remaining);if(!r)return;this.capture(r);let i="";if(this.consumeOptional("=")){const a=function Eee(e){const t=e.match(bee);return t?t[0]:""}(this.remaining);a&&(i=a,this.capture(i))}const s=J2(r),o=J2(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=Yb(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=ye);const a=this.parseChildren();r[o]=1===Object.keys(a).length?a[ye]:new We([],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 eP(e){return e.segments.length>0?new We([],{[ye]:e}):e}function tP(e){const t={};for(const[i,s]of Object.entries(e.children)){const o=tP(s);if(i===ye&&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 Dee(e){if(1===e.numberOfChildren&&e.children[ye]){const t=e.children[ye];return new We(e.segments.concat(t.segments),t.children)}return e}(new We(e.segments,t))}function $o(e){return e instanceof Uo}function nP(e){let t;const s=eP(function r(o){const a={};for(const l of o.children){const u=r(l);a[l.outlet]=u}const c=new We(o.url,a);return o===e&&(t=c),c}(e.root));return t??s}function rP(e,t,r,i){let s=e;for(;s.parent;)s=s.parent;if(0===t.length)return Jb(s,s,s,r,i);const o=function Iee(e){if("string"==typeof e[0]&&1===e.length&&"/"===e[0])return new sP(!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 sP(r,t,i)}(t);if(o.toRoot())return Jb(s,s,new We([],{}),r,i);const a=function Tee(e,t,r){if(e.isAbsolute)return new Dg(t,!0,0);if(!r)return new Dg(t,!1,NaN);if(null===r.parent)return new Dg(r,!0,0);const i=Cg(e.commands[0])?0:1;return function xee(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 Dg(i,!1,s-o)}(r,r.segments.length-1+i,e.numberOfDoubleDots)}(o,s,e),c=a.processChildren?ud(a.segmentGroup,a.index,o.commands):oP(a.segmentGroup,a.index,o.commands);return Jb(s,a.segmentGroup,c,r,i)}function Cg(e){return"object"==typeof e&&null!=e&&!e.outlets&&!e.segmentPath}function ld(e){return"object"==typeof e&&null!=e&&e.outlets}function Jb(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:iP(e,t,r);const c=eP(tP(a));return new Uo(c,o,s)}function iP(e,t,r){const i={};return Object.entries(e.children).forEach(([s,o])=>{i[s]=o===t?r:iP(o,t,r)}),new We(e.segments,i)}class sP{constructor(t,r,i){if(this.isAbsolute=t,this.numberOfDoubleDots=r,this.commands=i,t&&i.length>0&&Cg(i[0]))throw new A(4003,!1);const s=i.find(ld);if(s&&s!==q2(i))throw new A(4004,!1)}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class Dg{constructor(t,r,i){this.segmentGroup=t,this.processChildren=r,this.index=i}}function oP(e,t,r){if(e??=new We([],{}),0===e.segments.length&&e.hasChildren())return ud(e,t,r);const i=function Mee(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(ld(c))break;const l=`${c}`,u=i0&&void 0===l)break;if(l&&u&&"object"==typeof u&&void 0===u.outlets){if(!cP(l,u,a))return o;i+=2}else{if(!cP(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!==ye)&&e.children[ye]&&1===e.numberOfChildren&&0===e.children[ye].segments.length){const o=ud(e.children[ye],t,r);return new We(e.segments,o.children)}return Object.entries(i).forEach(([o,a])=>{"string"==typeof a&&(a=[a]),null!==a&&(s[o]=oP(e.children[o],t,a))}),Object.entries(e.children).forEach(([o,a])=>{void 0===i[o]&&(s[o]=a)}),new We(e.segments,s)}}function Xb(e,t,r){const i=e.segments.slice(0,t);let s=0;for(;s{"string"==typeof i&&(i=[i]),null!==i&&(t[r]=Xb(new We([],{}),0,i))}),t}function aP(e){const t={};return Object.entries(e).forEach(([r,i])=>t[r]=`${i}`),t}function cP(e,t,r){return e==r.path&&fi(t,r.parameters)}const dd="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 hi{constructor(t,r){this.id=t,this.url=r}}class fd extends hi{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 Ki extends hi{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 Kn=function(e){return e[e.Redirect=0]="Redirect",e[e.SupersededByNewNavigation=1]="SupersededByNewNavigation",e[e.NoDataFromResolver=2]="NoDataFromResolver",e[e.GuardRejected=3]="GuardRejected",e}(Kn||{}),Sg=function(e){return e[e.IgnoredSameUrlNavigation=0]="IgnoredSameUrlNavigation",e[e.IgnoredByUrlHandlingStrategy=1]="IgnoredByUrlHandlingStrategy",e}(Sg||{});class Ho extends hi{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 Pc extends hi{constructor(t,r,i,s){super(t,r),this.reason=i,this.code=s,this.type=Me.NavigationSkipped}}class eE extends hi{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 lP extends hi{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 Ree extends hi{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 Oee extends hi{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 kee extends hi{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 Pee extends hi{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 Lee{constructor(t){this.route=t,this.type=Me.RouteConfigLoadStart}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class Fee{constructor(t){this.route=t,this.type=Me.RouteConfigLoadEnd}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class Bee{constructor(t){this.snapshot=t,this.type=Me.ChildActivationStart}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Vee{constructor(t){this.snapshot=t,this.type=Me.ChildActivationEnd}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Uee{constructor(t){this.snapshot=t,this.type=Me.ActivationStart}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class jee{constructor(t){this.snapshot=t,this.type=Me.ActivationEnd}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class uP{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 tE{}class Ig{constructor(t,r){this.url=t,this.navigationBehaviorOptions=r}}function kr(e){return e.outlet||ye}function hd(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 Wee{get injector(){return hd(this.route?.snapshot)??this.rootInjector}set injector(t){}constructor(t){this.rootInjector=t,this.outlet=null,this.route=null,this.children=new pd(this.rootInjector),this.attachRef=null}}let pd=(()=>{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 Wee(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(Tn))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();class dP{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=nE(t,this._root);return r?r.children.map(i=>i.value):[]}firstChild(t){const r=nE(t,this._root);return r&&r.children.length>0?r.children[0].value:null}siblings(t){const r=rE(t,this._root);return r.length<2?[]:r[r.length-2].children.map(s=>s.value).filter(s=>s!==t)}pathFromRoot(t){return rE(t,this._root).map(r=>r.value)}}function nE(e,t){if(e===t.value)return t;for(const r of t.children){const i=nE(e,r);if(i)return i}return null}function rE(e,t){if(e===t.value)return[t];for(const r of t.children){const i=rE(e,r);if(i.length)return i.unshift(t),i}return[]}class Pr{constructor(t,r){this.value=t,this.children=r}toString(){return`TreeNode(${this.value})`}}function Lc(e){const t={};return e&&e.children.forEach(r=>t[r.value.outlet]=r),t}class fP extends dP{constructor(t,r){super(t),this.snapshot=r,iE(this,t)}toString(){return this.snapshot.toString()}}function hP(e){const t=function Zee(e){const o=new xg([],{},{},"",{},ye,e,null,{});return new pP("",new Pr(o,[]))}(e),r=new Jn([new ad("",{})]),i=new Jn({}),s=new Jn({}),o=new Jn({}),a=new Jn(""),c=new Fc(r,i,o,a,s,ye,e,t.root);return c.snapshot=t.root,new fP(new Pr(c,[]),t)}class Fc{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(Ve(u=>u[od]))??fe(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(Ve(t=>Oc(t))),this._paramMap}get queryParamMap(){return this._queryParamMap??=this.queryParams.pipe(Ve(t=>Oc(t))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function Tg(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&&mP(s)&&(i.resolve[od]=s.title),i}class xg{get title(){return this.data?.[od]}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??=Oc(this.params),this._paramMap}get queryParamMap(){return this._queryParamMap??=Oc(this.queryParams),this._queryParamMap}toString(){return`Route(url:'${this.url.map(i=>i.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class pP extends dP{constructor(t,r){super(r),this.url=t,iE(this,r)}toString(){return gP(this._root)}}function iE(e,t){t.value._routerState=e,t.children.forEach(r=>iE(e,r))}function gP(e){const t=e.children.length>0?` { ${e.children.map(gP).join(", ")} } `:"";return`${e.value}${t}`}function sE(e){if(e.snapshot){const t=e.snapshot,r=e._futureSnapshot;e.snapshot=r,fi(t.queryParams,r.queryParams)||e.queryParamsSubject.next(r.queryParams),t.fragment!==r.fragment&&e.fragmentSubject.next(r.fragment),fi(t.params,r.params)||e.paramsSubject.next(r.params),function oee(e,t){if(e.length!==t.length)return!1;for(let r=0;rfi(r.parameters,t[i].parameters))}(e.url,t.url);return r&&!(!e.parent!=!t.parent)&&(!e.parent||oE(e.parent,t.parent))}function mP(e){return"string"==typeof e.title||null===e.title}let aE=(()=>{class e{constructor(){this.activated=null,this._activatedRoute=null,this.name=ye,this.activateEvents=new dt,this.deactivateEvents=new dt,this.attachEvents=new dt,this.detachEvents=new dt,this.parentContexts=O(pd),this.location=O(rr),this.changeDetector=O(uu),this.inputBinder=O(Ag,{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 cE(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 cE{__ngOutletInjector(t){return new cE(this.route,this.childContexts,t)}constructor(t,r,i){this.route=t,this.childContexts=r,this.parent=i}get(t,r){return t===Fc?this.route:t===pd?this.childContexts:this.parent.get(t,r)}}const Ag=new q("");let yP=(()=>{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=qb([i.queryParams,i.params,i.data]).pipe(di(([o,a,c],l)=>(c={...o,...a,...c},0===l?fe(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 Yz(e){const t=Ce(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=H({token:e,factory:e.\u0275fac})}}return e})();function gd(e,t,r){if(r&&e.shouldReuseRoute(t.value,r.value.snapshot)){const i=r.value;i._futureSnapshot=t.value;const s=function Qee(e,t,r){return t.children.map(i=>{for(const s of r.children)if(e.shouldReuseRoute(i.value,s.value.snapshot))return gd(e,i,s);return gd(e,i)})}(e,t,r);return new Pr(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=>gd(e,c)),a}}const i=function Yee(e){return new Fc(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=>gd(e,o));return new Pr(i,s)}}class lE{constructor(t,r){this.redirectTo=t,this.navigationBehaviorOptions=r}}const vP="ngNavigationCancelingError";function Mg(e,t){const{redirectTo:r,navigationBehaviorOptions:i}=$o(t)?{redirectTo:t,navigationBehaviorOptions:void 0}:t,s=_P(!1,Kn.Redirect);return s.url=r,s.navigationBehaviorOptions=i,s}function _P(e,t){const r=new Error(`NavigationCancelingError: ${e||""}`);return r[vP]=!0,r.cancellationCode=t,r}function wP(e){return!!e&&e[vP]}class ete{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),sE(this.futureState.root),this.activateChildRoutes(r,i,t)}deactivateChildRoutes(t,r,i){const s=Lc(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=Lc(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=Lc(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=Lc(r);t.children.forEach(o=>{this.activateRoutes(o,s[o.value.outlet],i),this.forwardEvent(new jee(o.value.snapshot))}),t.children.length&&this.forwardEvent(new Vee(t.value.snapshot))}activateRoutes(t,r,i){const s=t.value,o=r?r.value:null;if(sE(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),sE(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 bP{constructor(t){this.path=t,this.route=this.path[this.path.length-1]}}class Ng{constructor(t,r){this.component=t,this.route=r}}function tte(e,t,r){const i=e._root;return md(i,t?t._root:null,r,[i.value])}function Bc(e,t){const r=Symbol(),i=t.get(e,r);return i===r?"function"!=typeof e||function h3(e){return null!==Wd(e)}(e)?t.get(e):e:i}function md(e,t,r,i,s={canDeactivateChecks:[],canActivateChecks:[]}){const o=Lc(t);return e.children.forEach(a=>{(function rte(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 ite(e,t,r){if("function"==typeof r)return r(e,t);switch(r){case"pathParamsChange":return!jo(e.url,t.url);case"pathParamsOrQueryParamsChange":return!jo(e.url,t.url)||!fi(e.queryParams,t.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!oE(e,t)||!fi(e.queryParams,t.queryParams);default:return!oE(e,t)}}(a,o,o.routeConfig.runGuardsAndResolvers);l?s.canActivateChecks.push(new bP(i)):(o.data=a.data,o._resolvedData=a._resolvedData),md(e,t,o.component?c?c.children:null:r,i,s),l&&c&&c.outlet&&c.outlet.isActivated&&s.canDeactivateChecks.push(new Ng(c.outlet.component,a))}else a&&yd(t,c,s),s.canActivateChecks.push(new bP(i)),md(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])=>yd(c,r.getContext(a),s)),s}function yd(e,t,r){const i=Lc(e),s=e.value;Object.entries(i).forEach(([o,a])=>{yd(a,s.component?t?t.children.getContext(o):null:t,r)}),r.canDeactivateChecks.push(new Ng(s.component&&t&&t.outlet&&t.outlet.isActivated?t.outlet.component:null,s))}function vd(e){return"function"==typeof e}function EP(e){return e instanceof mg||"EmptyError"===e?.name}const Rg=Symbol("INITIAL_VALUE");function Vc(){return di(e=>qb(e.map(t=>t.pipe(Rc(1),function YX(...e){const t=gg(e);return $t((r,i)=>{(t?Gb(e,r,t):Gb(e,r)).subscribe(i)})}(Rg)))).pipe(Ve(t=>{for(const r of t)if(!0!==r){if(r===Rg)return Rg;if(!1===r||dte(r))return r}return!0}),Zi(t=>t!==Rg),Rc(1)))}function dte(e){return $o(e)||e instanceof lE}function CP(e){return function r3(...e){return PC(e)}(Cn(t=>{if("boolean"!=typeof t)throw Mg(0,t)}),Ve(t=>!0===t))}class uE{constructor(t){this.segmentGroup=t||null}}class Og extends Error{constructor(t){super(),this.urlTree=t}}function Uc(e){return Nc(new uE(e))}class Dte{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 fe(i);if(s.numberOfChildren>1||!s.children[ye])return Nc(new A(4e3,!1));s=s.children[ye]}}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 Uo)throw new Og(y);r=y}const a=this.applyRedirectCreateUrlTree(r,this.urlSerializer.parse(r),t,i);if("/"===r[0])throw new Og(a);return a}applyRedirectCreateUrlTree(t,r,i,s){const o=this.createSegmentGroup(t,r.root,i,s);return new Uo(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 We(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 dE={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function Ste(e,t,r,i,s){const o=DP(e,t,r);return o.matched?(i=function $ee(e,t){return e.providers&&!e._injector&&(e._injector=dh(e.providers,t,`Route: ${e.path}`)),e._injector??t}(t,i),function bte(e,t,r,i){const s=t.canMatch;return s&&0!==s.length?fe(s.map(a=>{const c=Bc(a,e);return Us(function ute(e){return e&&vd(e.canMatch)}(c)?c.canMatch(t,r):Ei(e,()=>c(t,r)))})).pipe(Vc(),CP()):fe(!0)}(i,t,r).pipe(Ve(a=>!0===a?o:{...dE}))):fe(o)}function DP(e,t,r){if("**"===t.path)return function Ite(e){return{matched:!0,parameters:e.length>0?q2(e).parameters:{},consumedSegments:e,remainingSegments:[],positionalParamSegments:{}}}(r);if(""===t.path)return"full"===t.pathMatch&&(e.hasChildren()||r.length>0)?{...dE}:{matched:!0,consumedSegments:[],remainingSegments:r,parameters:{},positionalParamSegments:{}};const s=(t.matcher||see)(r,e,t);if(!s)return{...dE};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 SP(e,t,r,i){return r.length>0&&function Ate(e,t,r){return r.some(i=>kg(e,t,i)&&kr(i)!==ye)}(e,r,i)?{segmentGroup:new We(t,xte(i,new We(r,e.children))),slicedSegments:[]}:0===r.length&&function Mte(e,t,r){return r.some(i=>kg(e,t,i))}(e,r,i)?{segmentGroup:new We(e.segments,Tte(e,r,i,e.children)),slicedSegments:r}:{segmentGroup:new We(e.segments,e.children),slicedSegments:r}}function Tte(e,t,r,i){const s={};for(const o of r)if(kg(e,t,o)&&!i[kr(o)]){const a=new We([],{});s[kr(o)]=a}return{...i,...s}}function xte(e,t){const r={};r[ye]=t;for(const i of e)if(""===i.path&&kr(i)!==ye){const s=new We([],{});r[kr(i)]=s}return r}function kg(e,t,r){return(!(e.hasChildren()||t.length>0)||"full"!==r.pathMatch)&&""===r.path}class Rte{}class Pte{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 Dte(this.urlSerializer,this.urlTree),this.absoluteRedirectCount=0,this.allowRedirects=!0}noMatchError(t){return new A(4002,`'${t.segmentGroup}'`)}recognize(){const t=SP(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(t).pipe(Ve(({children:r,rootSnapshot:i})=>{const s=new Pr(i,r),o=new pP("",s),a=function See(e,t,r=null,i=null){return rP(nP(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 xg([],Object.freeze({}),Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,Object.freeze({}),ye,this.rootComponentType,null,{});return this.processSegmentGroup(this.injector,this.config,t,ye,r).pipe(Ve(i=>({children:i,rootSnapshot:r})),Bs(i=>{if(i instanceof Og)return this.urlTree=i.urlTree,this.match(i.urlTree.root);throw i instanceof uE?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(Ve(a=>a instanceof Pr?[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 qt(o).pipe(sd(a=>{const c=i.children[a],l=function Gee(e,t){const r=e.filter(i=>kr(i)===t);return r.push(...e.filter(i=>kr(i)!==t)),r}(r,a);return this.processSegmentGroup(t,l,c,a,s)}),function eee(e,t){return $t(function XX(e,t,r,i,s){return(o,a)=>{let c=r,l=t,u=0;o.subscribe(Ct(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)),yg(null),function tee(e,t){const r=arguments.length>=2;return i=>i.pipe(e?Zi((s,o)=>e(s,o,i)):Ws,Zb(1),r?yg(t):H2(()=>new mg))}(),un(a=>{if(null===a)return Uc(i);const c=IP(a);return function Lte(e){e.sort((t,r)=>t.value.outlet===ye?-1:r.value.outlet===ye?1:t.value.outlet.localeCompare(r.value.outlet))}(c),fe(c)}))}processSegment(t,r,i,s,o,a,c){return qt(r).pipe(sd(l=>this.processSegmentAgainstRoute(l._injector??t,r,l,i,s,o,a,c).pipe(Bs(u=>{if(u instanceof uE)return fe(null);throw u}))),Vs(l=>!!l),Bs(l=>{if(EP(l))return function Nte(e,t,r){return 0===t.length&&!e.children[r]}(i,s,o)?fe(new Rte):Uc(i);throw l}))}processSegmentAgainstRoute(t,r,i,s,o,a,c,l){return kr(i)===a||a!==ye&&kg(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):Uc(s):Uc(s)}expandSegmentAgainstRouteUsingRedirect(t,r,i,s,o,a,c){const{matched:l,parameters:u,consumedSegments:d,positionalParamSegments:f,remainingSegments:h}=DP(r,s,o);if(!l)return Uc(r);"string"==typeof s.redirectTo&&"/"===s.redirectTo[0]&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>31&&(this.allowRedirects=!1));const p=new xg(o,u,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,TP(s),kr(s),s.component??s._loadedComponent??null,s,xP(s)),g=Tg(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(un(y=>this.processSegment(t,i,r,y.concat(h),a,!1,c)))}matchSegmentAgainstRoute(t,r,i,s,o,a){const c=Ste(r,i,s,t);return"**"===i.path&&(r.children={}),c.pipe(di(l=>l.matched?this.getChildConfig(t=i._injector??t,i,s).pipe(di(({routes:u})=>{const d=i._loadedInjector??t,{parameters:f,consumedSegments:h,remainingSegments:p}=l,g=new xg(h,f,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,TP(i),kr(i),i.component??i._loadedComponent??null,i,xP(i)),m=Tg(g,a,this.paramsInheritanceStrategy);g.params=Object.freeze(m.params),g.data=Object.freeze(m.data);const{segmentGroup:y,slicedSegments:_}=SP(r,h,p,u);if(0===_.length&&y.hasChildren())return this.processChildren(d,u,y,g).pipe(Ve(w=>new Pr(g,w)));if(0===u.length&&0===_.length)return fe(new Pr(g,[]));const v=kr(i)===o;return this.processSegment(d,u,y,_,v?ye:o,!0,g).pipe(Ve(w=>new Pr(g,w instanceof Pr?[w]:[])))})):Uc(r)))}getChildConfig(t,r,i){return r.children?fe({routes:r.children,injector:t}):r.loadChildren?void 0!==r._loadedRoutes?fe({routes:r._loadedRoutes,injector:r._loadedInjector}):function wte(e,t,r,i){const s=t.canLoad;return void 0===s||0===s.length?fe(!0):fe(s.map(a=>{const c=Bc(a,e);return Us(function ote(e){return e&&vd(e.canLoad)}(c)?c.canLoad(t,r):Ei(e,()=>c(t,r)))})).pipe(Vc(),CP())}(t,r,i).pipe(un(s=>s?this.configLoader.loadChildren(t,r).pipe(Cn(o=>{r._loadedRoutes=o.routes,r._loadedInjector=o.injector})):function Cte(){return Nc(_P(!1,Kn.GuardRejected))}())):fe({routes:[],injector:t})}}function Fte(e){const t=e.value.routeConfig;return t&&""===t.path}function IP(e){const t=[],r=new Set;for(const i of e){if(!Fte(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=IP(i.children);t.push(new Pr(i.value,s))}return t.filter(i=>!r.has(i))}function TP(e){return e.data||{}}function xP(e){return e.resolve||{}}function AP(e){const t=e.children.map(r=>AP(r)).flat();return[e,...t]}function fE(e){return di(t=>{const r=e(t);return r?qt(r).pipe(Ve(()=>t)):fe(t)})}let MP=(()=>{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===ye);return i}getResolvedTitleForRoute(r){return r.data[od]}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:()=>O(Hte),providedIn:"root"})}}return e})(),Hte=(()=>{class e extends MP{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(wq))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const jc=new q("",{providedIn:"root",factory:()=>({})});let NP=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=ns({type:e,selectors:[["ng-component"]],standalone:!0,features:[Ah],decls:1,vars:0,template:function(i,s){1&i&&or(0,"router-outlet")},dependencies:[aE],encapsulation:2})}}return e})();function hE(e){const t=e.children&&e.children.map(hE),r=t?{...e,children:t}:{...e};return!r.component&&!r.loadComponent&&(t||r.loadChildren)&&r.outlet&&r.outlet!==ye&&(r.component=NP),r}const $c=new q("");let pE=(()=>{class e{constructor(){this.componentLoaders=new WeakMap,this.childrenLoaders=new WeakMap,this.compiler=O(iM)}loadComponent(r){if(this.componentLoaders.get(r))return this.componentLoaders.get(r);if(r._loadedComponent)return fe(r._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(r);const i=Us(r.loadComponent()).pipe(Ve(RP),Cn(o=>{this.onLoadEndListener&&this.onLoadEndListener(r),r._loadedComponent=o}),td(()=>{this.componentLoaders.delete(r)})),s=new $2(i,()=>new Xe).pipe(Wb());return this.componentLoaders.set(r,s),s}loadChildren(r,i){if(this.childrenLoaders.get(i))return this.childrenLoaders.get(i);if(i._loadedRoutes)return fe({routes:i._loadedRoutes,injector:i._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(i);const o=function zte(e,t,r,i){return Us(e.loadChildren()).pipe(Ve(RP),un(s=>s instanceof g1||Array.isArray(s)?fe(s):qt(t.compileModuleAsync(s))),Ve(s=>{i&&i(e);let o,a,c=!1;return Array.isArray(s)?(a=s,!0):(o=s.create(r).injector,a=o.get($c,[],{optional:!0,self:!0}).flat()),{routes:a.map(hE),injector:o}}))}(i,this.compiler,r,this.onLoadEndListener).pipe(td(()=>{this.childrenLoaders.delete(i)})),a=new $2(o,()=>new Xe).pipe(Wb());return this.childrenLoaders.set(i,a),a}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function RP(e){return function qte(e){return e&&"object"==typeof e&&"default"in e}(e)?e.default:e}let gE=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:()=>O(Gte),providedIn:"root"})}}return e})(),Gte=(()=>{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=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const OP=new q(""),kP=new q("");function Wte(e,t,r){const i=e.get(kP),s=e.get(on);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 Zte(e){return new Promise(t=>{yh({read:()=>setTimeout(t)},{injector:e})})}(e))),{onViewTransitionCreated:l}=i;return l&&Ei(e,()=>l({transition:c,from:t,to:r})),a})}const PP=new q("");let Pg=(()=>{class e{get hasRequestedNavigation(){return 0!==this.navigationId}constructor(){this.currentNavigation=null,this.currentTransition=null,this.lastSuccessfulNavigation=null,this.events=new Xe,this.transitionAbortSubject=new Xe,this.configLoader=O(pE),this.environmentInjector=O(Tn),this.urlSerializer=O(kc),this.rootContexts=O(pd),this.location=O(gu),this.inputBindingEnabled=null!==O(Ag,{optional:!0}),this.titleStrategy=O(MP),this.options=O(jc,{optional:!0})||{},this.paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly",this.urlHandlingStrategy=O(gE),this.createViewTransition=O(OP,{optional:!0}),this.navigationErrorHandler=O(PP,{optional:!0}),this.navigationId=0,this.afterPreactivation=()=>fe(void 0),this.rootComponentType=null,this.configLoader.onLoadEndListener=s=>this.events.next(new Fee(s)),this.configLoader.onLoadStartListener=s=>this.events.next(new Lee(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:dd,restoredState:null,currentSnapshot:s.snapshot,targetSnapshot:null,currentRouterState:s,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.transitions.pipe(Zi(o=>0!==o.id),Ve(o=>({...o,extractedUrl:this.urlHandlingStrategy.extract(o.rawUrl)})),di(o=>{let a=!1,c=!1;return fe(o).pipe(di(l=>{if(this.navigationId>o.id)return this.cancelNavigationTransition(o,"",Kn.SupersededByNewNavigation),ui;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 Pc(l.id,this.urlSerializer.serialize(l.rawUrl),f,Sg.IgnoredSameUrlNavigation)),l.resolve(!1),ui}if(this.urlHandlingStrategy.shouldProcessUrl(l.rawUrl))return fe(l).pipe(di(f=>{const h=this.transitions?.getValue();return this.events.next(new fd(f.id,this.urlSerializer.serialize(f.extractedUrl),f.source,f.restoredState)),h!==this.transitions?.getValue()?ui:Promise.resolve(f)}),function Bte(e,t,r,i,s,o){return un(a=>function Ote(e,t,r,i,s,o,a="emptyOnly"){return new Pte(e,t,r,i,s,a,o).recognize()}(e,t,r,i,a.extractedUrl,s,o).pipe(Ve(({state:c,tree:l})=>({...a,targetSnapshot:c,urlAfterRedirects:l}))))}(this.environmentInjector,this.configLoader,this.rootComponentType,r.config,this.urlSerializer,this.paramsInheritanceStrategy),Cn(f=>{o.targetSnapshot=f.targetSnapshot,o.urlAfterRedirects=f.urlAfterRedirects,this.currentNavigation={...this.currentNavigation,finalUrl:f.urlAfterRedirects};const h=new lP(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 fd(f,this.urlSerializer.serialize(h),p,g);this.events.next(y);const _=hP(this.rootComponentType).snapshot;return this.currentTransition=o={...l,targetSnapshot:_,urlAfterRedirects:h,extras:{...m,skipLocationChange:!1,replaceUrl:!1}},this.currentNavigation.finalUrl=h,fe(o)}{const f="";return this.events.next(new Pc(l.id,this.urlSerializer.serialize(l.extractedUrl),f,Sg.IgnoredByUrlHandlingStrategy)),l.resolve(!1),ui}}),Cn(l=>{const u=new Ree(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects),l.targetSnapshot);this.events.next(u)}),Ve(l=>(this.currentTransition=o={...l,guards:tte(l.targetSnapshot,l.currentSnapshot,this.rootContexts)},o)),function fte(e,t){return un(r=>{const{targetSnapshot:i,currentSnapshot:s,guards:{canActivateChecks:o,canDeactivateChecks:a}}=r;return 0===a.length&&0===o.length?fe({...r,guardsResult:!0}):function hte(e,t,r,i){return qt(e).pipe(un(s=>function _te(e,t,r,i,s){const o=t&&t.routeConfig?t.routeConfig.canDeactivate:null;return o&&0!==o.length?fe(o.map(c=>{const l=hd(t)??s,u=Bc(c,l);return Us(function lte(e){return e&&vd(e.canDeactivate)}(u)?u.canDeactivate(e,t,r,i):Ei(l,()=>u(e,t,r,i))).pipe(Vs())})).pipe(Vc()):fe(!0)}(s.component,s.route,r,t,i)),Vs(s=>!0!==s,!0))}(a,i,s,e).pipe(un(c=>c&&function ste(e){return"boolean"==typeof e}(c)?function pte(e,t,r,i){return qt(t).pipe(sd(s=>Gb(function mte(e,t){return null!==e&&t&&t(new Bee(e)),fe(!0)}(s.route.parent,i),function gte(e,t){return null!==e&&t&&t(new Uee(e)),fe(!0)}(s.route,i),function vte(e,t,r){const i=t[t.length-1],o=t.slice(0,t.length-1).reverse().map(a=>function nte(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=>j2(()=>fe(a.guards.map(l=>{const u=hd(a.node)??r,d=Bc(l,u);return Us(function cte(e){return e&&vd(e.canActivateChild)}(d)?d.canActivateChild(i,e):Ei(u,()=>d(i,e))).pipe(Vs())})).pipe(Vc())));return fe(o).pipe(Vc())}(e,s.path,r),function yte(e,t,r){const i=t.routeConfig?t.routeConfig.canActivate:null;if(!i||0===i.length)return fe(!0);const s=i.map(o=>j2(()=>{const a=hd(t)??r,c=Bc(o,a);return Us(function ate(e){return e&&vd(e.canActivate)}(c)?c.canActivate(t,e):Ei(a,()=>c(t,e))).pipe(Vs())}));return fe(s).pipe(Vc())}(e,s.route,r))),Vs(s=>!0!==s,!0))}(i,o,e,t):fe(c)),Ve(c=>({...r,guardsResult:c})))})}(this.environmentInjector,l=>this.events.next(l)),Cn(l=>{if(o.guardsResult=l.guardsResult,l.guardsResult&&"boolean"!=typeof l.guardsResult)throw Mg(0,l.guardsResult);const u=new Oee(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects),l.targetSnapshot,!!l.guardsResult);this.events.next(u)}),Zi(l=>!!l.guardsResult||(this.cancelNavigationTransition(l,"",Kn.GuardRejected),!1)),fE(l=>{if(l.guards.canActivateChecks.length)return fe(l).pipe(Cn(u=>{const d=new kee(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects),u.targetSnapshot);this.events.next(d)}),di(u=>{let d=!1;return fe(u).pipe(function Vte(e,t){return un(r=>{const{targetSnapshot:i,guards:{canActivateChecks:s}}=r;if(!s.length)return fe(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 AP(l))a.add(u);let c=0;return qt(a).pipe(sd(l=>o.has(l)?function Ute(e,t,r,i){const s=e.routeConfig,o=e._resolve;return void 0!==s?.title&&!mP(s)&&(o[od]=s.title),function jte(e,t,r,i){const s=Kb(e);if(0===s.length)return fe({});const o={};return qt(s).pipe(un(a=>function $te(e,t,r,i){const s=hd(t)??i,o=Bc(e,s);return Us(o.resolve?o.resolve(t,r):Ei(s,()=>o(t,r)))}(e[a],t,r,i).pipe(Vs(),Cn(c=>{if(c instanceof lE)throw Mg(new _g,c);o[a]=c}))),Zb(1),function nee(e){return Ve(()=>e)}(o),Bs(a=>EP(a)?ui:Nc(a)))}(o,e,t,i).pipe(Ve(a=>(e._resolvedData=a,e.data=Tg(e,e.parent,r).resolve,null)))}(l,i,e,t):(l.data=Tg(l,l.parent,e).resolve,fe(void 0))),Cn(()=>c++),Zb(1),un(l=>c===a.size?fe(r):ui))})}(this.paramsInheritanceStrategy,this.environmentInjector),Cn({next:()=>d=!0,complete:()=>{d||this.cancelNavigationTransition(u,"",Kn.NoDataFromResolver)}}))}),Cn(u=>{const d=new Pee(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects),u.targetSnapshot);this.events.next(d)}))}),fE(l=>{const u=d=>{const f=[];d.routeConfig?.loadComponent&&!d.routeConfig._loadedComponent&&f.push(this.configLoader.loadComponent(d.routeConfig).pipe(Cn(h=>{d.component=h}),Ve(()=>{})));for(const h of d.children)f.push(...u(h));return f};return qb(u(l.targetSnapshot.root)).pipe(yg(null),Rc(1))}),fE(()=>this.afterPreactivation()),di(()=>{const{currentSnapshot:l,targetSnapshot:u}=o,d=this.createViewTransition?.(this.environmentInjector,l.root,u.root);return d?qt(d).pipe(Ve(()=>o)):fe(o)}),Ve(l=>{const u=function Kee(e,t,r){const i=gd(e,t._root,r?r._root:void 0);return new fP(i,t)}(r.routeReuseStrategy,l.targetSnapshot,l.currentRouterState);return this.currentTransition=o={...l,targetRouterState:u},this.currentNavigation.targetRouterState=u,o}),Cn(()=>{this.events.next(new tE)}),((e,t,r,i)=>Ve(s=>(new ete(t,s.targetRouterState,s.currentRouterState,r,i).activate(e),s)))(this.rootContexts,r.routeReuseStrategy,l=>this.events.next(l),this.inputBindingEnabled),Rc(1),Cn({next:l=>{a=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new Ki(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 ree(e){return $t((t,r)=>{Or(e).subscribe(Ct(r,()=>r.complete(),mm)),!r.closed&&t.subscribe(r)})}(this.transitionAbortSubject.pipe(Cn(l=>{throw l}))),td(()=>{!a&&!c&&this.cancelNavigationTransition(o,"",Kn.SupersededByNewNavigation),this.currentTransition?.id===o.id&&(this.currentNavigation=null,this.currentTransition=null)}),Bs(l=>{if(c=!0,wP(l))this.events.next(new Ho(o.id,this.urlSerializer.serialize(o.extractedUrl),l.message,l.cancellationCode)),function Jee(e){return wP(e)&&$o(e.url)}(l)?this.events.next(new Ig(l.url,l.navigationBehaviorOptions)):o.resolve(!1);else{const u=new eE(o.id,this.urlSerializer.serialize(o.extractedUrl),l,o.targetSnapshot??void 0);try{const d=Ei(this.environmentInjector,()=>this.navigationErrorHandler?.(u));if(d instanceof lE){const{message:f,cancellationCode:h}=Mg(0,d);this.events.next(new Ho(o.id,this.urlSerializer.serialize(o.extractedUrl),f,h)),this.events.next(new Ig(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 ui}))}))}cancelNavigationTransition(r,i,s){const o=new Ho(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=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function Kte(e){return e!==dd}let Qte=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:()=>O(Jte),providedIn:"root"})}}return e})();class Yte{shouldDetach(t){return!1}store(t,r){}shouldAttach(t){return!1}retrieve(t){return null}shouldReuseRoute(t,r){return t.routeConfig===r.routeConfig}}let Jte=(()=>{class e extends Yte{static{this.\u0275fac=(()=>{let r;return function(s){return(r||(r=zt(e)))(s||e)}})()}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),LP=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:()=>O(Xte),providedIn:"root"})}}return e})(),Xte=(()=>{class e extends LP{constructor(){super(...arguments),this.location=O(gu),this.urlSerializer=O(kc),this.options=O(jc,{optional:!0})||{},this.canceledNavigationResolution=this.options.canceledNavigationResolution||"replace",this.urlHandlingStrategy=O(gE),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.currentUrlTree=new Uo,this.rawUrlTree=this.currentUrlTree,this.currentPageId=0,this.lastSuccessfulId=-1,this.routerState=hP(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 fd)this.stateMemento=this.createStateMemento();else if(r instanceof Pc)this.rawUrlTree=i.initialUrl;else if(r instanceof lP){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 tE?(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 Ho&&(r.code===Kn.GuardRejected||r.code===Kn.NoDataFromResolver)?this.restoreHistory(i):r instanceof eE?this.restoreHistory(i,!0):r instanceof Ki&&(this.lastSuccessfulId=r.id,this.currentPageId=this.browserPageId)}setBrowserUrl(r,i){const s=r instanceof Uo?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=zt(e)))(s||e)}})()}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var _d=function(e){return e[e.COMPLETE=0]="COMPLETE",e[e.FAILED=1]="FAILED",e[e.REDIRECTING=2]="REDIRECTING",e}(_d||{});function FP(e,t){e.events.pipe(Zi(r=>r instanceof Ki||r instanceof Ho||r instanceof eE||r instanceof Pc),Ve(r=>r instanceof Ki||r instanceof Pc?_d.COMPLETE:r instanceof Ho&&(r.code===Kn.Redirect||r.code===Kn.SupersededByNewNavigation)?_d.REDIRECTING:_d.FAILED),Zi(r=>r!==_d.REDIRECTING),Rc(1)).subscribe(()=>{t()})}function ene(e){throw e}const tne={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},nne={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};let pi=(()=>{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(WA),this.stateManager=O(LP),this.options=O(jc,{optional:!0})||{},this.pendingTasks=O(ro),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.navigationTransitions=O(Pg),this.urlSerializer=O(kc),this.location=O(gu),this.urlHandlingStrategy=O(gE),this._events=new Xe,this.errorHandler=this.options.errorHandler||ene,this.navigated=!1,this.routeReuseStrategy=O(Qte),this.onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore",this.config=O($c,{optional:!0})?.flat()??[],this.componentInputBindingEnabled=!!O(Ag,{optional:!0}),this.eventsSubscription=new Et,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 Ho&&i.code!==Kn.Redirect&&i.code!==Kn.SupersededByNewNavigation)this.navigated=!0;else if(i instanceof Ki)this.navigated=!0;else if(i instanceof Ig){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||Kte(s.source),...a};this.scheduleNavigation(c,dd,null,l,{resolve:s.resolve,reject:s.reject,promise:s.promise})}(function ine(e){return!(e instanceof tE||e instanceof Ig)})(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),dd,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(hE),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=nP(s?s.snapshot:this.routerState.snapshot.root)}catch{("string"!=typeof r[0]||"/"!==r[0][0])&&(r=[]),f=this.currentUrlTree.root}return rP(f,r,d,u??null)}navigateByUrl(r,i={skipLocationChange:!1}){const s=$o(r)?r:this.parseUrl(r),o=this.urlHandlingStrategy.merge(s,this.rawUrlTree);return this.scheduleNavigation(o,dd,null,i)}navigate(r,i={skipLocationChange:!1}){return function rne(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 FP(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=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();class BP{}let ane=(()=>{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(Zi(r=>r instanceof Ki),sd(()=>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=dh(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 qt(s).pipe(id())}preloadConfig(r,i){return this.preloadingStrategy.preload(i,()=>{let s;s=i.loadChildren&&void 0===i.canLoad?this.loader.loadChildren(r,i):fe(null);const o=s.pipe(un(a=>null===a?fe(void 0):(i._loadedRoutes=a.routes,i._loadedInjector=a.injector,this.processRoutes(a.injector??r,a.routes))));return i.loadComponent&&!i._loadedComponent?qt([o,this.loader.loadComponent(i)]).pipe(id()):o})}static{this.\u0275fac=function(i){return new(i||e)(Z(pi),Z(iM),Z(Tn),Z(BP),Z(pE))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const yE=new q("");let VP=(()=>{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 fd?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=r.navigationTrigger,this.restoredId=r.restoredState?r.restoredState.navigationId:0):r instanceof Ki?(this.lastId=r.id,this.scheduleScrollEvent(r,this.urlSerializer.parse(r.urlAfterRedirects).fragment)):r instanceof Pc&&r.code===Sg.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 uP&&(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 uP(r,"popstate"===this.lastSource?this.store[this.restoredId]:null,i))})},0)})}ngOnDestroy(){this.routerEventsSubscription?.unsubscribe(),this.scrollEventsSubscription?.unsubscribe()}static{this.\u0275fac=function(i){!function jI(){throw new Error("invalid")}()}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})();function gi(e,t){return{\u0275kind:e,\u0275providers:t}}function jP(){const e=O(It);return t=>{const r=e.get(ar);if(t!==r.components[0])return;const i=e.get(pi),s=e.get($P);1===e.get(vE)&&i.initialNavigation(),e.get(HP,null,Ie.Optional)?.setUpPreloading(),e.get(yE,null,Ie.Optional)?.init(),i.resetRootComponentType(r.componentTypes[0]),s.closed||(s.next(),s.complete(),s.unsubscribe())}}const $P=new q("",{factory:()=>new Xe}),vE=new q("",{providedIn:"root",factory:()=>1}),HP=new q("");function dne(e){return gi(0,[{provide:HP,useExisting:ane},{provide:BP,useExisting:e}])}function hne(e){return gi(9,[{provide:OP,useValue:Wte},{provide:kP,useValue:{skipNextTransition:!!e?.skipInitialTransition,...e}}])}const zP=new q("ROUTER_FORROOT_GUARD"),pne=[gu,{provide:kc,useClass:_g},pi,pd,{provide:Fc,useFactory:function UP(e){return e.routerState.root},deps:[pi]},pE,[]];let qP=(()=>{class e{constructor(r){}static forRoot(r,i){return{ngModule:e,providers:[pne,[],{provide:$c,multi:!0,useValue:r},{provide:zP,useFactory:vne,deps:[[pi,new Jd,new Xd]]},{provide:jc,useValue:i||{}},i?.useHash?{provide:wo,useClass:n7}:{provide:wo,useClass:QM},{provide:yE,useFactory:()=>{const e=O(w9),t=O(Ne),r=O(jc),i=O(Pg),s=O(kc);return r.scrollOffset&&e.setOffset(r.scrollOffset),new VP(s,i,e,t,r)}},i?.preloadingStrategy?dne(i.preloadingStrategy).\u0275providers:[],i?.initialNavigation?_ne(i):[],i?.bindToComponentInputs?gi(8,[yP,{provide:Ag,useExisting:yP}]).\u0275providers:[],i?.enableViewTransitions?hne().\u0275providers:[],[{provide:GP,useFactory:jP},{provide:Ph,multi:!0,useExisting:GP}]]}}static forChild(r){return{ngModule:e,providers:[{provide:$c,multi:!0,useValue:r}]}}static{this.\u0275fac=function(i){return new(i||e)(Z(zP,8))}}static{this.\u0275mod=Ht({type:e})}static{this.\u0275inj=Nt({})}}return e})();function vne(e){return"guarded"}function _ne(e){return["disabled"===e.initialNavigation?gi(3,[{provide:O0,multi:!0,useFactory:()=>{const t=O(pi);return()=>{t.setUpLocationChangeListener()}}},{provide:vE,useValue:2}]).\u0275providers:[],"enabledBlocking"===e.initialNavigation?gi(2,[{provide:vE,useValue:0},{provide:O0,multi:!0,deps:[It],useFactory:t=>{const r=t.get(e7,Promise.resolve());return()=>r.then(()=>new Promise(i=>{const s=t.get(pi),o=t.get($P);FP(s,()=>{i(!0)}),t.get(Pg).afterPreactivation=()=>(i(!0),o.closed?fe(void 0):o),s.initialNavigation()}))}}]).\u0275providers:[]]}const GP=new q("");var Qi=function(e){return e.STRANGE="STRANGE",e.YOU="YOU",e}(Qi||{}),mi=function(e){return e.CONNECTED="CONNECTED",e.UP_TO_DISCONNECT="UP_TO_DISCONNECT",e.DISCONNECTED="DISCONNECTED",e.SEARCHING_STRANGER="SEARCHING_STRANGER",e}(mi||{});const bne=["modalContainer"];function Ene(e,t){}class wd{static{this.modalInjectSubject=new Xe}static{this.modalInject$=wd.modalInjectSubject.asObservable()}constructor(t){this.component=t,this.injectData=null,this.cssClasses=[],this.outletName="default",this.subscription=new Et}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 Xe,r=this.injectData,i=this.component,s=this.outletName;return this.router?(this.subscription.add(this.router.events.pipe(Zi(o=>o instanceof fd)).pipe(Vs()).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`),wd.modalInjectSubject.next({component:i,data:r,outletName:s,cssClasses:this.cssClasses,response:t}),t.asObservable()}}let WP=(()=>{class e{createModal(r){return new wd(r)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})(),Cne=(()=>{class e{constructor(r){this.ngZone=r,this.modalInject$=wd.modalInject$,this.classes=[],this.isOpen=!1,this.content=null,this.subscriptions=new Et,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&&_0(bne,5,rr),2&i){let o;Th(o=xh())&&(s.container=o.first)}},hostVars:2,hostBindings:function(i,s){2&i&&yo("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,Ene,0,0,"ng-template",null,0,NA)},encapsulation:2})}}return e})(),Dne=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ht({type:e})}static{this.\u0275inj=Nt({providers:[WP]})}}return e})();class Sne{close(){this.response.complete()}}const dn=new q(""),$s=new q("");function sL(e){return null!=e}function oL(e){return cu(e)?qt(e):e}function aL(e){let t={};return e.forEach(r=>{t=null!=r?{...t,...r}:t}),0===Object.keys(t).length?null:t}function cL(e,t){return t.map(r=>r(e))}function lL(e){return e.map(t=>function Rne(e){return!e.validate}(t)?t:r=>t.validate(r))}function wE(e){return null!=e?function uL(e){if(!e)return null;const t=e.filter(sL);return 0==t.length?null:function(r){return aL(cL(r,t))}}(lL(e)):null}function bE(e){return null!=e?function dL(e){if(!e)return null;const t=e.filter(sL);return 0==t.length?null:function(r){return function Ine(...e){const t=L2(e),{args:r,keys:i}=F2(e),s=new jt(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?V2(i,c):c),o.complete())}))}});return t?s.pipe(B2(t)):s}(cL(r,t).map(oL)).pipe(Ve(aL))}}(lL(e)):null}function fL(e,t){return null===e?[t]:Array.isArray(e)?[...e,t]:[e,t]}function EE(e){return e?Array.isArray(e)?e:[e]:[]}function Fg(e,t){return Array.isArray(e)?e.includes(t):e===t}function gL(e,t){const r=EE(t);return EE(e).forEach(s=>{Fg(r,s)||r.push(s)}),r}function mL(e,t){return EE(t).filter(r=>!Fg(e,r))}class yL{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=wE(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=bE(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 Dn extends yL{get formDirective(){return null}get path(){return null}}class vL{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 _L=(()=>{class e extends vL{constructor(r){super(r)}static{this.\u0275fac=function(i){return new(i||e)(k(Dn,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:[Ue]})}}return e})();const bd="VALID",Vg="INVALID",Hc="PENDING",Ed="DISABLED";class zc{}class bL extends zc{constructor(t,r){super(),this.value=t,this.source=r}}class SE extends zc{constructor(t,r){super(),this.pristine=t,this.source=r}}class IE extends zc{constructor(t,r){super(),this.touched=t,this.source=r}}class Ug extends zc{constructor(t,r){super(),this.status=t,this.source=r}}function jg(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}class AE{constructor(t,r){this._pendingDirty=!1,this._hasOwnPendingAsyncValidator=null,this._pendingTouched=!1,this._onCollectionChange=()=>{},this._parent=null,this._status=pu(()=>this.statusReactive()),this.statusReactive=Wr(void 0),this._pristine=pu(()=>this.pristineReactive()),this.pristineReactive=Wr(!0),this._touched=pu(()=>this.touchedReactive()),this.touchedReactive=Wr(!1),this._events=new Xe,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 Jr(this.statusReactive)}set status(t){Jr(()=>this.statusReactive.set(t))}get valid(){return this.status===bd}get invalid(){return this.status===Vg}get pending(){return this.status==Hc}get disabled(){return this.status===Ed}get enabled(){return this.status!==Ed}get pristine(){return Jr(this.pristineReactive)}set pristine(t){Jr(()=>this.pristineReactive.set(t))}get dirty(){return!this.pristine}get touched(){return Jr(this.touchedReactive)}set touched(t){Jr(()=>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(gL(t,this._rawValidators))}addAsyncValidators(t){this.setAsyncValidators(gL(t,this._rawAsyncValidators))}removeValidators(t){this.setValidators(mL(t,this._rawValidators))}removeAsyncValidators(t){this.setAsyncValidators(mL(t,this._rawAsyncValidators))}hasValidator(t){return Fg(this._rawValidators,t)}hasAsyncValidator(t){return Fg(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 IE(!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 IE(!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 SE(!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 SE(!0,i))}markAsPending(t={}){this.status=Hc;const r=t.sourceControl??this;!1!==t.emitEvent&&(this._events.next(new Ug(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=Ed,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 bL(this.value,i)),this._events.next(new Ug(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=bd,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===bd||this.status===Hc)&&this._runAsyncValidator(i,t.emitEvent)}const r=t.sourceControl??this;!1!==t.emitEvent&&(this._events.next(new bL(this.value,r)),this._events.next(new Ug(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()?Ed:bd}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t,r){if(this.asyncValidator){this.status=Hc,this._hasOwnPendingAsyncValidator={emitEvent:!1!==r};const i=oL(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 Ug(this.status,r)),this._parent&&this._parent._updateControlsErrors(t,r,i)}_initObservables(){this.valueChanges=new dt,this.statusChanges=new dt}_calculateStatus(){return this._allControlsDisabled()?Ed:this.errors?Vg:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(Hc)?Hc:this._anyControlsHaveStatus(Vg)?Vg:bd}_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 SE(this.pristine,r))}_updateTouched(t={},r){this.touched=this._anyControlsTouched(),this._events.next(new IE(this.touched,r)),this._parent&&!t.onlySelf&&this._parent._updateTouched(t,r)}_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){jg(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 Une(e){return Array.isArray(e)?wE(e):e||null}(this._rawValidators)}_assignAsyncValidators(t){this._rawAsyncValidators=Array.isArray(t)?t.slice():t,this._composedAsyncValidatorFn=function jne(e){return Array.isArray(e)?bE(e):e||null}(this._rawAsyncValidators)}}class ME extends AE{constructor(t,r,i){super(function TE(e){return(jg(e)?e.validators:e)||null}(r),function xE(e,t){return(jg(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 CL(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 EL(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 qc=new q("CallSetDisabledState",{providedIn:"root",factory:()=>$g}),$g="always";function qg(e,t){e.forEach(r=>{r.registerOnValidatorChange&&r.registerOnValidatorChange(t)})}function NE(e,t){const r=function hL(e){return e._rawValidators}(e);null!==t.validator?e.setValidators(fL(r,t.validator)):"function"==typeof r&&e.setValidators([r]);const i=function pL(e){return e._rawAsyncValidators}(e);null!==t.asyncValidator?e.setAsyncValidators(fL(i,t.asyncValidator)):"function"==typeof i&&e.setAsyncValidators([i]);const s=()=>e.updateValueAndValidity();qg(t._rawValidators,s),qg(t._rawAsyncValidators,s)}function DL(e,t){e._pendingDirty&&e.markAsDirty(),e.setValue(e._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1}const Yne={provide:Dn,useExisting:et(()=>Wg)},Dd=Promise.resolve();let Wg=(()=>{class e extends Dn{get submitted(){return Jr(this.submittedReactive)}constructor(r,i,s){super(),this.callSetDisabledState=s,this._submitted=pu(()=>this.submittedReactive()),this.submittedReactive=Wr(!1),this._directives=new Set,this.ngSubmit=new dt,this.form=new ME({},wE(r),bE(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(r){Dd.then(()=>{const i=this._findContainer(r.path);r.control=i.registerControl(r.name,r.control),function Cd(e,t,r=$g){NE(e,t),t.valueAccessor.writeValue(e.value),(e.disabled||"always"===r)&&t.valueAccessor.setDisabledState?.(e.disabled),function zne(e,t){t.valueAccessor.registerOnChange(r=>{e._pendingValue=r,e._pendingChange=!0,e._pendingDirty=!0,"change"===e.updateOn&&DL(e,t)})}(e,t),function Gne(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 qne(e,t){t.valueAccessor.registerOnTouched(()=>{e._pendingTouched=!0,"blur"===e.updateOn&&e._pendingChange&&DL(e,t),"submit"!==e.updateOn&&e.markAsTouched()})}(e,t),function Hne(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){Dd.then(()=>{const i=this._findContainer(r.path);i&&i.removeControl(r.name),this._directives.delete(r)})}addFormGroup(r){Dd.then(()=>{const i=this._findContainer(r.path),s=new ME({});(function SL(e,t){NE(e,t)})(s,r),i.registerControl(r.name,s),s.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(r){Dd.then(()=>{const i=this._findContainer(r.path);i&&i.removeControl(r.name)})}getFormGroup(r){return this.form.get(r.path)}updateModel(r,i){Dd.then(()=>{this.form.get(r.path).setValue(i)})}setValue(r){this.control.setValue(r)}onSubmit(r){return this.submittedReactive.set(!0),function IL(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(dn,10),k($s,10),k(qc,8))}}static{this.\u0275dir=de({type:e,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(i,s){1&i&&ze("submit",function(a){return s.onSubmit(a)})("reset",function(){return s.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],features:[ft([Yne]),Ue]})}}return e})();Promise.resolve();let kL=(()=>{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})(),Dre=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ht({type:e})}static{this.\u0275inj=Nt({})}}return e})(),Ire=(()=>{class e{static withConfig(r){return{ngModule:e,providers:[{provide:qc,useValue:r.callSetDisabledState??$g}]}}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ht({type:e})}static{this.\u0275inj=Nt({imports:[Dre]})}}return e})();function Tre(e,t){if(1&e){const r=Ri();ge(0,"li")(1,"span"),je(2),we(),ge(3,"button",17),ze("click",function(){const s=nn(r).$implicit;return rn(wt().removeRelay(s))}),je(4,"\u2715"),we()()}if(2&e){const r=t.$implicit;De(2),Qa(r)}}let xre=(()=>{class e extends Sne{constructor(r){super(),this.relayConfigService=r,this.response=new Xe,this.relays=[]}ngOnInit(){this.relays=this.relayConfigService.getConfig()}removeRelay(r){const i=nd(r),o=this.relays.indexOf(i);-1!==o&&this.relays.splice(o,1)}addRelay(r){r.value&&(this.relays=[...new Set([...this.relays,nd(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(nd),this.save()}save(){this.relayConfigService.saveConfig([...new Set(this.relays)]),this.close()}static{this.\u0275fac=function(i){return new(i||e)(k(Bb))}}static{this.\u0275cmp=ns({type:e,selectors:[["omg-relay-config"]],features:[Ue],decls:28,vars:1,consts:[["relayField",""],["type","button",1,"closeButton","exitButton",3,"click"],[1,"relayList"],[4,"ngFor","ngForOf"],[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=Ri();ge(0,"form")(1,"h1")(2,"span"),je(3,"Configure nostr relays"),we(),ge(4,"button",1),ze("click",function(){return nn(o),rn(s.close())}),je(5,"\u2715"),we()(),ge(6,"ul",2),sr(7,Tre,5,1,"li",3),we(),ge(8,"div",4)(9,"label"),je(10,"Relay"),we(),ge(11,"div",5)(12,"input",6,0),ze("keyup.enter",function(){nn(o);const c=Ka(13);return rn(s.addRelay(c))}),we(),ge(14,"button",7),ze("click",function(){nn(o);const c=Ka(13);return rn(s.addRelay(c))}),wf(),ge(15,"svg",8),or(16,"path",9)(17,"path",10)(18,"path",11)(19,"path",12)(20,"path",13)(21,"path",14)(22,"path",15),we()()()(),bf(),ge(23,"div",16)(24,"button",7),ze("click",function(){return nn(o),rn(s.useDefault())}),je(25,"Use default"),we(),ge(26,"button",7),ze("click",function(){return nn(o),rn(s.save())}),je(27,"Save"),we()()()}2&i&&(De(7),qe("ngForOf",s.relays))},dependencies:[r_,kL,_L,Wg],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})(),jE=(()=>{class e extends Xe{constructor(){super()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),$E=(()=>{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(),i.message),this.error$.next(i.message)}):r.message?(console.error((new Date).toLocaleString(),r.message),this.error$.next(r.message)):(console.error((new Date).toLocaleString(),"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(jE))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),Are=(()=>{class e{constructor(){this.authorTypes={[Qi.STRANGE]:"Stranger",[Qi.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 Mre=["conversation"];function Nre(e,t){1&e&&(ge(0,"div",22),je(1," You're now chatting with a random stranger. "),we())}function Rre(e,t){1&e&&(ge(0,"div",22),je(1," Looking for someone you can chat with. "),we())}function Ore(e,t){if(1&e&&(ge(0,"span",26),wf(),ge(1,"svg",27),or(2,"path",7)(3,"path",28),we(),bf(),ge(4,"span",29),je(5),we()()),2&e){const r=wt().$implicit;De(5),Qa(r[1])}}function kre(e,t){if(1&e&&(ge(0,"div",23)(1,"span"),je(2),function AA(e,t){const r=_e();let i;const s=e+Y;r.firstCreatePass?(i=function L5(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=Zs(i.type)),c=Sn(k);try{const l=Sf(!1),u=o();return Sf(l),function w0(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"),we(),ge(4,"span",24),je(5),we(),sr(6,Ore,6,1,"span",25),we()),2&e){const r=t.$implicit,i=wt();De(),Ql("authorStranger",r[0].author===i.authorStrange)("authorYou",r[0].author===i.authorYou),De(),Yr("",MA(3,7,r[0].author),": "),De(3),Qa(r[0].text),De(),qe("ngIf",r[1])}}function Pre(e,t){1&e&&(ge(0,"div",22),je(1," Stranger is typing... "),we())}function Lre(e,t){1&e&&(ge(0,"div",22),je(1,"Stranger has disconnected."),we())}function Fre(e,t){1&e&&(ge(0,"div",22),je(1,"You have disconnected."),we())}function Bre(e,t){if(1&e&&(Ga(0),sr(1,Lre,2,0,"div",13)(2,Fre,2,0,"div",13),Wa()),2&e){const r=wt();De(),qe("ngIf",r.whoDisconnected===r.authorStrange),De(),qe("ngIf",r.whoDisconnected===r.authorYou)}}function Vre(e,t){if(1&e){const r=Ri();ge(0,"button",30),ze("click",function(){return nn(r),rn(wt().findStranger())}),je(1," Start "),we()}if(2&e){const r=wt();Kt("disabled",r.currentState===r.stateSearchingStranger?"disabled":null)}}function Ure(e,t){if(1&e){const r=Ri();ge(0,"button",31),ze("click",function(){nn(r);const s=wt();return rn(s.currentState=s.stateUpToDisconnect)}),je(1," Stop "),we()}}function jre(e,t){if(1&e){const r=Ri();ge(0,"button",32),ze("click",function(){nn(r);const s=wt(),o=Ka(23);return s.disconnect(),rn(s.cleanMessageField(o))}),je(1," Really? "),we()}}const $re=[{path:"chat",component:(()=>{class e{constructor(r,i,s,o){this.globalErrorHandler=r,this.findStrangerProxy=i,this.talkToStrangerNostr=s,this.modalService=o,this.stateConnected=mi.CONNECTED,this.stateUpToDisconnect=mi.UP_TO_DISCONNECT,this.stateDisconnected=mi.DISCONNECTED,this.stateSearchingStranger=mi.SEARCHING_STRANGER,this.authorStrange=Qi.STRANGE,this.authorYou=Qi.YOU,this.typingTimeoutAmount=2e3,this.typingTimeoutId=0,this.currentOnline=1,this.strangeIsTyping=!1,this.currentState=mi.DISCONNECTED,this.whoDisconnected=null,this.you=null,this.stranger=null,this.messages=[],this.subscriptions=new Et}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.disconnect(),!0})()}configRelays(){this.modalService.createModal(xre).build()}findStranger(){this.whoDisconnected=null,this.currentState=this.stateSearchingStranger,this.messages=[];const r=this.you=this.findStrangerProxy.connect();console.info((new Date).toLocaleString(),"me: ",r.pubkey),this.findStrangerProxy.searchStranger(this.you).then(i=>this.startConversation(r,i)).catch(i=>{throw console.error((new Date).toLocaleString(),i),this.strangeIsTyping=!1,this.currentState=mi.DISCONNECTED,this.whoDisconnected=null,this.stranger=null,i})}disconnect(){return this.you?(this.stranger=null,this.findStrangerProxy.disconnect(this.you).then(()=>(this.currentState=mi.DISCONNECTED,this.strangeIsTyping=!1,this.whoDisconnected||(this.whoDisconnected=Qi.YOU),Promise.resolve()))):Promise.resolve()}startConversation(r,i){console.log((new Date).toLocaleString(),"starting conversation, stranger: ",i),this.stranger=i,this.currentState=mi.CONNECTED,1===this.currentOnline&&(this.currentOnline=2),this.subscriptions.add(this.talkToStrangerNostr.listenMessages(r,i).subscribe({next:s=>this.addMessageFromStranger(r,i,s)})),this.subscriptions.add(this.talkToStrangerNostr.listenStrangerStatus(i).subscribe({next:s=>this.handleStrangerStatus(s)}))}addMessageFromStranger(r,i,s){this.talkToStrangerNostr.openEncryptedDirectMessage(r,i,s).then(o=>{this.messages.push([{text:o,author:Qi.STRANGE,time:s.created_at},null]),this.scrollConversationToTheEnd()})}handleStrangerStatus(r){"typing"===r.content?(this.strangeIsTyping=!0,this.scrollConversationToTheEnd()):"disconnected"===r.content?(this.strangeIsTyping=!1,this.whoDisconnected=Qi.STRANGE,this.currentState=mi.DISCONNECTED,this.disconnect()):this.strangeIsTyping=!1}sendMessage(r){var i=this;return U(function*(){const s=i.you,o=i.stranger;if(s&&o&&r.length){const a=[{author:Qi.YOU,text:r,time:Math.floor((new Date).getTime()/1e3)},null];i.messages.push(a),i.scrollConversationToTheEnd();try{yield i.talkToStrangerNostr.sendMessage(s,o,r)}catch(c){a[1]=i.globalErrorHandler.getErrorMessage(c).join("; ")}}})()}scrollConversationToTheEnd(){setTimeout(()=>{const r=this.conversationEl.nativeElement;r.scrollTo({top:r.scrollHeight,behavior:"smooth"})})}cleanMessageField(r){setTimeout(()=>r.value="")}onTyping(){const r=this.you;r&&(this.typingTimeoutId||this.talkToStrangerNostr.isTyping(r),clearTimeout(this.typingTimeoutId),this.typingTimeoutId=Number(setTimeout(()=>{this.talkToStrangerNostr.stopTyping(r),this.typingTimeoutId=0},this.typingTimeoutAmount)))}static{this.\u0275fac=function(i){return new(i||e)(k($E),k(N2),k(R2),k(WP))}}static{this.\u0275cmp=ns({type:e,selectors:[["omg-chat"]],viewQuery:function(i,s){if(1&i&&_0(Mre,5),2&i){let o;Th(o=xh())&&(s.conversationEl=o.first)}},hostBindings:function(i,s){1&i&&ze("beforeunload",function(){return s.onBeforeUnload()},0,wI)},decls:27,vars:11,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=Ri();ge(0,"section",3),or(1,"img",4),ge(2,"h2",5),je(3,"Talk to strangers!"),we(),wf(),ge(4,"svg",6),ze("click",function(){return nn(o),rn(s.configRelays())}),or(5,"path",7)(6,"path",8)(7,"path",9),we(),bf(),ge(8,"h2",10),je(9),we()(),ge(10,"main",11)(11,"section",12,0),sr(13,Nre,2,0,"div",13)(14,Rre,2,0,"div",13)(15,kre,7,9,"div",14)(16,Pre,2,0,"div",13)(17,Bre,3,2,"ng-container",15),we(),ge(18,"form",16),sr(19,Vre,2,1,"button",17)(20,Ure,2,0,"button",18)(21,jre,2,0,"button",19),ge(22,"textarea",20,1),ze("keydown.enter",function(){nn(o);const c=Ka(23);return s.sendMessage(c.value),rn(s.cleanMessageField(c))})("keydown",function(){return nn(o),rn(s.onTyping())}),we(),ge(24,"button",21,2),ze("click",function(){nn(o);const c=Ka(23);return s.sendMessage(c.value),rn(s.cleanMessageField(c))}),je(26," Send "),we()()()}2&i&&(De(9),Qa(s.currentOnline),De(4),qe("ngIf",s.stranger),De(),qe("ngIf",!s.stranger&&s.currentState===s.stateSearchingStranger),De(),qe("ngForOf",s.messages),De(),qe("ngIf",s.strangeIsTyping),De(),qe("ngIf",s.currentState===s.stateDisconnected),De(2),qe("ngIf",s.currentState===s.stateDisconnected||s.currentState===s.stateSearchingStranger),De(),qe("ngIf",s.currentState===s.stateConnected),De(),qe("ngIf",s.currentState===s.stateUpToDisconnect),De(),Kt("disabled",s.currentState===s.stateDisconnected||s.currentState===s.stateSearchingStranger?"disabled":null),De(2),Kt("disabled",s.currentState===s.stateDisconnected||s.currentState===s.stateSearchingStranger?"disabled":null))},dependencies:[r_,op,Are],encapsulation:2})}}return e})()},{path:"",redirectTo:"chat",pathMatch:"full"}];let Hre=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ht({type:e})}static{this.\u0275inj=Nt({imports:[qP.forRoot($re,{useHash:!0}),qP]})}}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 zre(e,t){return{type:le.Trigger,name:e,definitions:t,options:{}}}function XL(e,t=null){return{type:le.Animate,styles:t,timings:e}}function Sd(e){return{type:le.Style,styles:e,offset:null}}function HE(e,t,r){return{type:le.State,name:e,styles:t,options:r}}function eF(e,t,r=null){return{type:le.Transition,expr:e,animation:t,options:r}}class Id{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 tF{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 Qre(e,t){if(1&e){const r=Ri();ge(0,"button",5),ze("click",function(){return nn(r),rn(wt().remove())}),ge(1,"span",6),je(2,"\xd7"),we()()}}function Yre(e,t){if(1&e&&(Ga(0),je(1),Wa()),2&e){const r=wt(2);De(),Yr("[",r.duplicatesCount+1,"]")}}function Jre(e,t){if(1&e&&(ge(0,"div"),je(1),sr(2,Yre,2,1,"ng-container",4),we()),2&e){const r=wt();Ni(r.options.titleClass),Kt("aria-label",r.title),De(),Yr(" ",r.title," "),De(),qe("ngIf",r.duplicatesCount)}}function Xre(e,t){if(1&e&&or(0,"div",7),2&e){const r=wt();Ni(r.options.messageClass),qe("innerHTML",r.message,Qy)}}function eie(e,t){if(1&e&&(ge(0,"div",8),je(1),we()),2&e){const r=wt();Ni(r.options.messageClass),Kt("aria-label",r.message),De(),Yr(" ",r.message," ")}}function tie(e,t){if(1&e&&(ge(0,"div"),or(1,"div",9),we()),2&e){const r=wt();De(),yo("width",r.width()+"%")}}class cie{_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 lie{_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 uie{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new Xe;_activate=new Xe;_manualClose=new Xe;_resetTimeout=new Xe;_countDuplicate=new Xe;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 Zg{toastId;config;message;title;toastType;toastRef;_onTap=new Xe;_onAction=new Xe;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 iF=new q("ToastConfig");class die extends lie{_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 fie=(()=>{class e{_document=O(on);_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=H({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();class hie{_portalHost;constructor(t){this._portalHost=t}attach(t,r=!0){return this._portalHost.attach(t,r)}detach(){return this._portalHost.detach()}}let pie=(()=>{class e{_overlayContainer=O(fie);_componentFactoryResolver=O(Vl);_appRef=O(ar);_document=O(on);_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 die(r,this._componentFactoryResolver,this._appRef)}_createOverlayRef(r){return new hie(this._createPortalHost(r))}static \u0275fac=function(i){return new(i||e)};static \u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),qE=(()=>{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 uie(l),f=new Zg(this.index,o,u,s,r,d),p=It.create({providers:[{provide:Zg,useValue:f}],parent:this._injector}),g=new cie(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(iF),Z(pie),Z(It),Z(VN),Z(Ne))};static \u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const gie={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=Wr(-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=Wr({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(qE),k(Zg),k(Ne))};static \u0275cmp=ns({type:e,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(i,s){1&i&&ze("click",function(){return s.tapToast()})("mouseenter",function(){return s.stickAround()})("mouseleave",function(){return s.delayedHideToast()}),2&i&&(p0("@flyInOut",s._state),Ni(s.toastClasses),yo("display",s.displayStyle))},standalone:!0,features:[Ah],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,Qre,3,0,"button",0)(1,Jre,3,5,"div",1)(2,Xre,1,3,"div",2)(3,eie,2,4,"div",3)(4,tie,2,2,"div",4),2&i&&(qe("ngIf",s.options.closeButton),De(),qe("ngIf",s.title),De(),qe("ngIf",s.message&&s.options.enableHtml),De(),qe("ngIf",s.message&&!s.options.enableHtml),De(),qe("ngIf",s.options.progressBar))},dependencies:[op],encapsulation:2,data:{animation:[zre("flyInOut",[HE("inactive",Sd({opacity:0})),HE("active",Sd({opacity:1})),HE("removed",Sd({opacity:0})),eF("inactive => active",XL("{{ easeTime }}ms {{ easing }}")),eF("active => removed",XL("{{ easeTime }}ms {{ easing }}"))])]},changeDetection:0})}return e})()},mie=(e={})=>function tl(e){return{\u0275providers:e}}([{provide:iF,useValue:{default:gie,config:e}}]);let yie=(()=>{class e{static forRoot(r={}){return{ngModule:e,providers:[mie(r)]}}static \u0275fac=function(i){return new(i||e)};static \u0275mod=Ht({type:e});static \u0275inj=Nt({})}return e})(),vie=(()=>{class e{constructor(r,i){this.error$=r,this.toastrService=i,this.subscriptions=new Et}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(jE),k(qE))}}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:[aE,Cne],encapsulation:2})}}return e})(),_ie=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ht({type:e})}static{this.\u0275inj=Nt({providers:[Bb],imports:[bo,Ire]})}}return e})(),wie=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ht({type:e})}static{this.\u0275inj=Nt({imports:[bo,_ie]})}}return e})(),bie=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ht({type:e})}static{this.\u0275inj=Nt({providers:[Hb,hg],imports:[bo]})}}return e})();function sF(e){return new A(3e3,!1)}function zs(e){switch(e.length){case 0:return new Id;case 1:return e[0];default:return new tF(e)}}function oF(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 zie(){return new A(3502,!1)}();return o}function GE(e,t,r,i){switch(t){case"start":e.onStart(()=>i(r&&WE(r,"start",e)));break;case"done":e.onDone(()=>i(r&&WE(r,"done",e)));break;case"destroy":e.onDestroy(()=>i(r&&WE(r,"destroy",e)))}}function WE(e,t,r){const o=ZE(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 ZE(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 aF(e){const t=e.indexOf(":");return[e.substring(1,t),e.slice(t+1)]}const nse=typeof document>"u"?null:document.documentElement;function KE(e){const t=e.parentNode||e.host||null;return t===nse?null:t}let Go=null,cF=!1;function lF(e,t){for(;t;){if(t===e)return!0;t=KE(t)}return!1}function uF(e,t,r){if(r)return Array.from(e.querySelectorAll(t));const i=e.querySelector(t);return i?[i]:[]}let QE=(()=>{class e{validateStyleProperty(r){return function ise(e){Go||(Go=function sse(){return typeof document<"u"?document.body:null}()||{},cF=!!Go.style&&"WebkitAppearance"in Go.style);let t=!0;return Go.style&&!function rse(e){return"ebkit"==e.substring(1,6)}(e)&&(t=e in Go.style,!t&&cF&&(t="Webkit"+e.charAt(0).toUpperCase()+e.slice(1)in Go.style)),t}(r)}containsElement(r,i){return lF(r,i)}getParentElement(r){return KE(r)}query(r,i,s){return uF(r,i,s)}computeStyle(r,i,s){return s||""}animate(r,i,s,o,a,c=[],l){return new Id(s,o)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})();class YE{static{this.NOOP=new QE}}class JE{}const ase=1e3,XE="ng-enter",Kg="ng-leave",Qg="ng-trigger",Yg=".ng-trigger",fF="ng-animating",eC=".ng-animating";function Ji(e){if("number"==typeof e)return e;const t=e.match(/^(-?[\.\d]+)(m?s)/);return!t||t.length<2?0:tC(parseFloat(t[1]),t[2])}function tC(e,t){return"s"===t?e*ase:e}function Jg(e,t,r){return e.hasOwnProperty("duration")?e:function lse(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(sF()),{duration:0,delay:0,easing:""};s=tC(parseFloat(c[1]),c[2]);const l=c[3];null!=l&&(o=tC(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 Eie(){return new A(3100,!1)}()),c=!0),o<0&&(t.push(function Cie(){return new A(3101,!1)}()),c=!0),c&&t.splice(l,0,sF())}return{duration:s,delay:o,easing:a}}(e,t,r)}function vi(e,t,r){t.forEach((i,s)=>{const o=rC(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=rC(i);e.style[s]=""})}function Td(e){return Array.isArray(e)?1==e.length?e[0]:function qre(e,t=null){return{type:le.Sequence,steps:e,options:t}}(e):e}const nC=new RegExp("{{\\s*(.+?)\\s*}}","g");function pF(e){let t=[];if("string"==typeof e){let r;for(;r=nC.exec(e);)t.push(r[1]);nC.lastIndex=0}return t}function xd(e,t,r){const i=`${e}`,s=i.replace(nC,(o,a)=>{let c=t[a];return null==c&&(r.push(function Sie(){return new A(3003,!1)}()),c=""),c.toString()});return s==i?e:s}const fse=/-+([a-z0-9])/g;function rC(e){return e.replace(fse,(...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 Iie(){return new A(3004,!1)}()}}function iC(e,t){return window.getComputedStyle(e)[t]}const gse=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 gF extends JE{normalizePropertyName(t,r){return rC(t)}normalizeStyleValue(t,r,i,s){let o="";const a=i.toString().trim();if(gse.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 Tie(){return new A(3005,!1)}())}return a+o}}const Xg="*";const em=new Set(["true","1"]),tm=new Set(["false","0"]);function mF(e,t){const r=em.has(e)||tm.has(e),i=em.has(t)||tm.has(t);return(s,o)=>{let a=e==Xg||e==s,c=t==Xg||t==o;return!a&&r&&"boolean"==typeof s&&(a=s?em.has(e):tm.has(e)),!c&&i&&"boolean"==typeof o&&(c=o?em.has(t):tm.has(t)),a&&c}}const _se=new RegExp("s*:selfs*,?","g");function sC(e,t,r,i){return new wse(e).build(t,r,i)}class wse{constructor(t){this._driver=t}build(t,r,i){const s=new Cse(r);return this._resetContextStyleTimingState(s),Yn(this,Td(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 xie(){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 Aie(){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=>{pF(l).forEach(u=>{a.hasOwnProperty(u)||o.add(u)})})}),o.size&&r.errors.push(function Mie(){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,Td(t.animation),r),s=function mse(e,t){const r=[];return"string"==typeof e?e.split(/\s*,\s*/).forEach(i=>function yse(e,t,r){if(":"==e[0]){const l=function vse(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 Vie(){return new A(3015,!1)}()),t;const s=i[1],o=i[2],a=i[3];t.push(mF(s,a)),"<"==o[0]&&(s!=Xg||a!=Xg)&&t.push(mF(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 Sse(e,t){if(e.hasOwnProperty("duration"))return e;if("number"==typeof e)return oC(Jg(e,t).duration,0,"");const r=e;if(r.split(/\s+/).some(o=>"{"==o.charAt(0)&&"{"==o.charAt(1))){const o=oC(0,0,"");return o.dynamic=!0,o.strValue=r,o}const s=Jg(r,t);return oC(s.duration,s.delay,s.easing)}(t.timings,r.errors);r.currentAnimateTimings=i;let s,o=t.styles?t.styles:Sd({});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=Sd(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 Rie(){return new A(3010,!1)}()),f=!1),o=d.startTime),f&&u.set(l,{startTime:o,endTime:s}),r.options&&function dse(e,t,r){const i=t.params||{},s=pF(e);s.length&&s.forEach(o=>{i.hasOwnProperty(o)||r.push(function Die(){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 Oie(){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 Dse(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,Td(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 bse(e){const t=!!e.split(/\s*,\s*/).find(r=>":self"==r);return t&&(e=e.replace(_se,"")),e=e.replace(/@\*/g,Yg).replace(/@\w+/g,r=>Yg+"-"+r.slice(1)).replace(/:animating/g,eC),[e,t]}(t.selector);r.currentQuerySelector=i.length?i+" "+o:o,Qn(r.collectedStyles,r.currentQuerySelector,new Map);const c=Yn(this,Td(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 Fie(){return new A(3013,!1)}());const i="full"===t.timings?{duration:0,delay:0,easing:"full"}:Jg(t.timings,r.errors,!0);return{type:le.Stagger,animation:Yn(this,Td(t.animation),r),timings:i,options:null}}}class Cse{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 Ese(e){return e?{...e}:null}(e.params)):e={},e}function oC(e,t,r){return{duration:e,delay:t,easing:r}}function aC(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 nm{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 xse=new RegExp(":enter","g"),Mse=new RegExp(":leave","g");function cC(e,t,r,i,s,o=new Map,a=new Map,c,l,u=[]){return(new Nse).buildKeyframes(e,t,r,i,s,o,a,c,l,u)}class Nse{buildKeyframes(t,r,i,s,o,a,c,l,u,d=[]){u=u||new nm;const f=new lC(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()):[aC(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(xd(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=rm);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 Jg(r.params?xd(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=rm);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 rm={};class lC{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=rm,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=l||new im(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]=xd(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 lC(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=rm,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 Rse(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(xse,"."+this._enterClassName)).replace(Mse,"."+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 Bie(){return new A(3014,!1)}()),c}}class im{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 im(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 Ose(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=xd(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 aC(this.element,s,o,a,this.duration,this.startTime,this.easing,!1)}}class Rse extends im{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",_F(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",_F((r+p*i)/a)),o.push(h)}i=a,r=0,s="",t=o}return aC(this.element,t,this.preStyleProps,this.postStyleProps,i,r,s,!0)}}function _F(e,t=3){const r=Math.pow(10,t-1);return Math.round(e*r)/r}function wF(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 uC={};class bF{constructor(t,r,i){this._triggerName=t,this.ast=r,this._stateStyles=i}match(t,r,i,s){return function kse(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||uC,g=this.buildStyles(i,c&&c.params||uC,f),m=l&&l.params||uC,y=this.buildStyles(s,m,f),_=new Set,v=new Map,w=new Map,b="void"===s,D={params:EF(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(T=>{S=Math.max(T.duration+T.delay,S)}),f.length?wF(r,this._triggerName,i,s,b,g,y,[],[],v,w,S,f):(C.forEach(T=>{const P=T.element,$=Qn(v,P,new Set);T.preStyleProps.forEach(j=>$.add(j));const V=Qn(w,P,new Set);T.postStyleProps.forEach(j=>V.add(j)),P!==r&&_.add(P)}),wF(r,this._triggerName,i,s,b,g,y,C,[..._.values()],v,w,S))}}function EF(e,t){const r={...t};return Object.entries(e).forEach(([i,s])=>{null!=s&&(r[i]=s)}),r}class Pse{constructor(t,r,i){this.styles=t,this.defaultParams=r,this.normalizer=i}buildStyles(t,r){const i=new Map,s=EF(t,this.defaultParams);return this.styles.styles.forEach(o=>{"string"!=typeof o&&o.forEach((a,c)=>{a&&(a=xd(a,s,r));const l=this.normalizer.normalizePropertyName(c,r);a=this.normalizer.normalizeStyleValue(c,l,a,r),i.set(c,a)})}),i}}class Fse{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 Pse(s.style,s.options&&s.options.params||{},i))}),CF(this.states,"true","1"),CF(this.states,"false","0"),r.transitions.forEach(s=>{this.transitionFactories.push(new bF(t,s,this.states))}),this.fallbackTransition=function Bse(e,t){return new bF(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 CF(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 Vse=new nm;class Use{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=sC(this._driver,r,i,[]);if(i.length)throw function qie(){return new A(3503,!1)}();this._animations.set(t,o)}_buildPlayer(t,r,i){const s=t.element,o=oF(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,XE,Kg,new Map,new Map,i,Vse,s),a.forEach(d=>{const f=Qn(c,d.element,new Map);d.postStyleProps.forEach(h=>f.set(h,null))})):(s.push(function Gie(){return new A(3300,!1)}()),a=[]),s.length)throw function Wie(){return new A(3504,!1)}();c.forEach((d,f)=>{d.forEach((h,p)=>{d.set(p,this._driver.computeStyle(f,p,Yi))})});const u=zs(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 Zie(){return new A(3301,!1)}();return r}listen(t,r,i,s){const o=ZE(r,"","","");return GE(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 DF="ng-animate-queued",dC="ng-animate-disabled",qse=[],SF={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Gse={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Lr="__ng_removed";class fC{get params(){return this.options.params}constructor(t,r=""){this.namespaceId=r;const i=t&&t.hasOwnProperty("value");if(this.value=function Qse(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 Ad="void",hC=new fC(Ad);class Wse{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,gr(r,this._hostClassName)}listen(t,r,i,s){if(!this._triggers.has(r))throw function Kie(){return new A(3302,!1)}();if(null==i||0==i.length)throw function Qie(){return new A(3303,!1)}();if(!function Yse(e){return"start"==e||"done"==e}(i))throw function Yie(){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)||(gr(t,Qg),gr(t,Qg+"-"+r),c.set(r,hC)),()=>{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 Jie(){return new A(3401,!1)}();return r}trigger(t,r,i,s=!0){const o=this._getTrigger(r),a=new pC(this.id,r,t);let c=this._engine.statesByElement.get(t);c||(gr(t,Qg),gr(t,Qg+"-"+r),this._engine.statesByElement.set(t,c=new Map));let l=c.get(r);const u=new fC(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&l&&u.absorbOptions(l.options),c.set(r,u),l||(l=hC),u.value!==Ad&&l.value===u.value){if(!function eoe(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),vi(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||(gr(t,DF),a.onStart(()=>{Gc(t,DF)})),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,Yg,!0);i.forEach(s=>{if(s[Lr])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,Ad,s);d&&c.push(d)}}),c.length)return this._engine.markElementAsRemoved(this.id,t,!0,r,a),i&&zs(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)||hC,d=new fC(Ad),f=new pC(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[Lr];(!o||o===SF)&&(i.afterFlush(()=>this.clearElementCache(t)),i.destroyInnerAnimations(t),i._onRemovalComplete(t,r))}}insertNode(t,r){gr(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=ZE(o,i.triggerName,i.fromState.value,i.toState.value);l._data=t,GE(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 Zse{_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 Wse(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(sm(r)){const o=this._fetchNamespace(t);if(o)return o.trigger(r,i,s),!0}return!1}insertNode(t,r,i,s){if(!sm(r))return;const o=r[Lr];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),gr(t,dC)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),Gc(t,dC))}removeNode(t,r,i){if(sm(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[Lr]={namespaceId:t,setForRemoval:s,hasAnimation:i,removedBeforeQueried:!1,previousTriggersValues:o}}listen(t,r,i,s,o){return sm(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,Yg,!0);r.forEach(i=>this.destroyActiveAnimationsForElement(i)),0!=this.playersByQueriedElement.size&&(r=this.driver.query(t,eC,!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 zs(this.players).onDone(()=>t());t()})}processLeaveNode(t){const r=t[Lr];if(r&&r.setForRemoval){if(t[Lr]=SF,r.namespaceId){this.destroyInnerAnimations(t);const i=this._fetchNamespace(r.namespaceId);i&&i.clearElementCache(t)}this._onRemovalComplete(t,r.setForRemoval)}t.classList?.contains(dC)&&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?zs(r).onDone(()=>{i.forEach(s=>s())}):i.forEach(s=>s())}}reportError(t){throw function Xie(){return new A(3402,!1)}()}_flushAnimations(t,r){const i=new nm,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=XE+m++;g.set(x,R),E.forEach(M=>gr(M,R))});const y=[],_=new Set,v=new Set;for(let E=0;E_.add(M)):v.add(x))}const w=new Map,b=xF(h,Array.from(_));b.forEach((E,x)=>{const R=Kg+m++;w.set(x,R),E.forEach(M=>gr(M,R))}),t.push(()=>{p.forEach((E,x)=>{const R=g.get(x);E.forEach(M=>Gc(M,R))}),b.forEach((E,x)=>{const R=w.get(x);E.forEach(M=>Gc(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,G=R.element;if(D.push(M),this.collectedEnterElements.length){const Ae=G[Lr];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 Ln=Oe.get(R.triggerName);Ln.value=ot,Oe.set(R.triggerName,Ln)}}return void M.destroy()}}const J=!f||!this.driver.containsElement(f,G),ee=w.get(G),Se=g.get(G),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(G,ue.fromStyles)),M.onDestroy(()=>vi(G,ue.toStyles)),void s.push(M);if(R.isFallbackTransition)return M.onStart(()=>Wo(G,ue.fromStyles)),M.onDestroy(()=>vi(G,ue.toStyles)),void s.push(M);const gt=[];ue.timelines.forEach(Ae=>{Ae.stretchStartingKeyframe=!0,this.disabledNodes.has(Ae.element)||gt.push(Ae)}),ue.timelines=gt,i.append(G,ue.timelines),a.push({instruction:ue,player:M,element:G}),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((Ln,Jt)=>Oe.add(Jt))}}),ue.postStyleProps.forEach((Ae,ot)=>{let Oe=u.get(ot);Oe||u.set(ot,Oe=new Set),Ae.forEach((Ln,Jt)=>Oe.add(Jt))})});if(C.length){const E=[];C.forEach(x=>{E.push(function ese(){return new A(3505,!1)}())}),D.forEach(x=>x.destroy()),this.reportError(E)}const S=new Map,T=new Map;a.forEach(E=>{const x=E.element;i.has(x)&&(T.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=>MF(E,l,u)),$=new Map;TF($,this.driver,v,u,Yi).forEach(E=>{MF(E,l,u)&&P.push(E)});const j=new Map;p.forEach((E,x)=>{TF(j,this.driver,new Set(E),l,"!")}),P.forEach(E=>{const x=$.get(E),R=j.get(E);$.set(E,new Map([...x?.entries()??[],...R?.entries()??[]]))});const X=[],L=[],I={};a.forEach(E=>{const{element:x,player:R,instruction:M}=E;if(i.has(x)){if(d.has(x))return R.onDestroy(()=>vi(x,M.toStyles)),R.disabled=!0,R.overrideTotalTime(M.totalTime),void s.push(R);let G=I;if(T.size>1){let ee=x;const Se=[];for(;ee=ee.parentNode;){const ue=T.get(ee);if(ue){G=ue;break}Se.push(ee)}Se.forEach(ue=>T.set(ue,G))}const J=this._buildAnimation(R.namespaceId,M,S,o,j,$);if(R.setRealPlayer(J),G===I)X.push(R);else{const ee=this.playersByElement.get(G);ee&&ee.length&&(R.parentPlayer=zs(ee)),s.push(R)}}else Wo(x,M.fromStyles),R.onDestroy(()=>vi(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=zs(x);E.setRealPlayer(R)}}),s.forEach(E=>{E.parentPlayer?E.syncPlayerEvents(E.parentPlayer):E.destroy()});for(let E=0;E!J.destroyed);G.length?Jse(this,x,G):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==Ad;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[Lr];if(y&&y.removedBeforeQueried)return new Id(g.duration,g.delay);const _=m!==l,v=function Xse(e){const t=[];return AF(e,t),t}((i.get(m)||qse).map(S=>S.getRealPlayer())).filter(S=>!!S.element&&S.element===m),w=o.get(m),b=a.get(m),D=oF(this._normalizer,g.keyframes,w,b),C=this._buildPlayer(g,D,v);if(g.subTimeline&&s&&f.add(m),_){const S=new pC(t,c,m);S.setRealPlayer(C),u.push(S)}return C});u.forEach(g=>{Qn(this.playersByQueriedElement,g.element,[]).push(g),g.onDone(()=>function Kse(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=>gr(g,fF));const p=zs(h);return p.onDestroy(()=>{d.forEach(g=>Gc(g,fF)),vi(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 Id(t.duration,t.delay)}}class pC{constructor(t,r,i){this.namespaceId=t,this.triggerName=r,this.element=i,this._player=new Id,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=>GE(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 sm(e){return e&&1===e.nodeType}function IF(e,t){const r=e.style.display;return e.style.display=t??"none",r}function TF(e,t,r,i,s){const o=[];r.forEach(l=>o.push(IF(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[Lr]=Gse,a.push(u))}),e.set(u,d)});let c=0;return r.forEach(l=>IF(l,o[c++])),a}function xF(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 gr(e,t){e.classList?.add(t)}function Gc(e,t){e.classList?.remove(t)}function Jse(e,t,r){zs(r).onDone(()=>e.processLeaveNode(t))}function AF(e,t){for(let r=0;rs.add(o)):t.set(e,i),r.delete(e),!0}class Md{constructor(t,r,i){this._driver=r,this._normalizer=i,this._triggerCache={},this.onRemovalComplete=(s,o)=>{},this._transitionEngine=new Zse(t.body,r,i),this._timelineEngine=new Use(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=sC(this._driver,o,l,[]);if(l.length)throw function Hie(){return new A(3404,!1)}();c=function Lse(e,t,r){return new Fse(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]=aF(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]=aF(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 Nd{static{this.initialStylesByElement=new WeakMap}constructor(t,r,i){this._element=t,this._startStyles=r,this._endStyles=i,this._state=0;let s=Nd.initialStylesByElement.get(t);s||Nd.initialStylesByElement.set(t,s=new Map),this._initialStyles=s}start(){this._state<1&&(this._startStyles&&vi(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(vi(this._element,this._initialStyles),this._endStyles&&(vi(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(Nd.initialStylesByElement.delete(this._element),this._startStyles&&(Wo(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Wo(this._element,this._endStyles),this._endStyles=null),vi(this._element,this._initialStyles),this._state=3)}}function gC(e){let t=null;return e.forEach((r,i)=>{(function noe(e){return"display"===e||"position"===e})(i)&&(t=t||new Map,t.set(i,r))}),t}class NF{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:iC(this.element,s))}),this.currentSnapshot=t}triggerCallback(t){const r="start"===t?this._onStartFns:this._onDoneFns;r.forEach(i=>i()),r.length=0}}class RF{validateStyleProperty(t){return!0}validateAnimatableStyleProperty(t){return!0}containsElement(t,r){return lF(t,r)}getParentElement(t){return KE(t)}query(t,r,i){return uF(t,r,i)}computeStyle(t,r,i){return iC(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 NF);(function hse(e,t){return 0===e||0===t})(i,s)&&d.forEach(p=>{p.currentSnapshot.forEach((g,m)=>u.set(m,g))});let f=function use(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 pse(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,iC(e,c)))}}return t}(t,f,u);const h=function toe(e,t){let r=null,i=null;return Array.isArray(t)&&t.length?(r=gC(t[0]),t.length>1&&(i=gC(t[t.length-1]))):t instanceof Map&&(r=gC(t)),r||i?new Nd(e,r,i):null}(t,f);return new NF(t,f,l,h)}}const OF="@.disabled";class kF{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==OF?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 roe extends kF{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==OF?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 ioe(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 soe(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 ooe{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 kF("",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 roe(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 aoe=(()=>{class e extends Md{constructor(r,i,s){super(r,i,s)}ngOnDestroy(){this.flush()}static{this.\u0275fac=function(i){return new(i||e)(Z(on),Z(YE),Z(JE))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})();const PF=[{provide:JE,useFactory:function coe(){return new gF}},{provide:Md,useClass:aoe},{provide:oh,useFactory:function loe(e,t,r){return new ooe(e,t,r)},deps:[m_,Md,Ne]}],mC=[{provide:YE,useFactory:()=>new RF},{provide:$S,useValue:"BrowserAnimations"},...PF],LF=[{provide:YE,useClass:QE},{provide:$S,useValue:"NoopAnimations"},...PF];let uoe=(()=>{class e{static withConfig(r){return{ngModule:e,providers:r.disableAnimations?LF:mC}}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ht({type:e})}static{this.\u0275inj=Nt({providers:mC,imports:[LN]})}}return e})(),doe=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ht({type:e})}static{this.\u0275inj=Nt({providers:[jE,$E,{provide:nr,useClass:$E}],imports:[bo,uoe]})}}return e})(),foe=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ht({type:e,bootstrap:[vie]})}static{this.\u0275inj=Nt({imports:[wie,LN,Hre,Sq,NX,Dne,bie,yie.forRoot({timeOut:1e4,positionClass:"toast-top-center",preventDuplicates:!0}),doe]})}}return e})();vq().bootstrapModule(foe).catch(e=>console.error(e))}},am=>{am(am.s=999)}]); \ No newline at end of file +"use strict";(self.webpackChunkomeglestr=self.webpackChunkomeglestr||[]).push([[792],{363:(am,yC,wi)=>{var Wc={};wi.r(Wc),wi.d(Wc,{OG:()=>A_,My:()=>nc,Ph:()=>Nn,lX:()=>T_,Id:()=>Co,fg:()=>KN,qj:()=>an,aT:()=>rc,lq:()=>vs,z:()=>x_,Q5:()=>Eu});var cm={};function vC(e,t){return Object.is(e,t)}wi.r(cm),wi.d(cm,{aK:()=>ko,e8:()=>vc,DO:()=>Lu,dJ:()=>ak,OG:()=>Xw,My:()=>_c,Ph:()=>Oo,lX:()=>Qw,Id:()=>Fu,fg:()=>lk,qj:()=>Mr,aT:()=>bc,r4:()=>Zp,aY:()=>Ro,x:()=>tb,lq:()=>Ec,z:()=>Yw,zW:()=>wc,Q5:()=>Bu});let Mt=null,Zc=!1,Od=1;const mr=Symbol("SIGNAL");function _e(e){const t=Mt;return Mt=e,t}const kd={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 lm(e){if(Zc)throw new Error("");if(null===Mt)return;Mt.consumerOnSignalRead(e);const t=Mt.nextProducerIndex++;Fd(Mt),te.nextProducerIndex;)e.producerNode.pop(),e.producerLastReadVersion.pop(),e.producerIndexOfThis.pop()}}function dm(e){Fd(e);for(let t=0;t0}function Fd(e){e.producerNode??=[],e.producerIndexOfThis??=[],e.producerLastReadVersion??=[]}function SC(e){e.liveConsumerNode??=[],e.liveConsumerIndexOfThis??=[]}function IC(e){return void 0!==e.producerNode}const hm=Symbol("UNSET"),pm=Symbol("COMPUTING"),Bd=Symbol("ERRORED"),$F={...kd,value:hm,dirty:!0,error:null,equal:vC,producerMustRecompute:e=>e.value===hm||e.value===pm,producerRecomputeValue(e){if(e.value===pm)throw new Error("Detected cycle in computations.");const t=e.value;e.value=pm;const r=Pd(e);let i;try{i=e.computation()}catch(s){i=Bd,e.error=s}finally{um(e,r)}t!==hm&&t!==Bd&&i!==Bd&&e.equal(t,i)?e.value=t:(e.value=i,e.version++)}};let TC=function HF(){throw new Error};function xC(){TC()}let Vd=null;function AC(e,t){EC()||xC(),e.equal(e.value,t)||(e.value=t,function ZF(e){e.version++,function UF(){Od++}(),bC(e),Vd?.()}(e))}const WF={...kd,equal:vC,value:void 0};function at(e){return"function"==typeof e}function Ud(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 gm=Ud(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 jd(e,t){if(e){const r=e.indexOf(t);0<=r&&e.splice(r,1)}}class Et{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 gm?o.errors:[o]}const{_finalizers:s}=this;if(s){this._finalizers=null;for(const o of s)try{OC(o)}catch(a){t=t??[],a instanceof gm?t=[...t,...a.errors]:t.push(a)}}if(t)throw new gm(t)}}add(t){var r;if(t&&t!==this)if(this.closed)OC(t);else{if(t instanceof Et){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)&&jd(r,t)}remove(t){const{_finalizers:r}=this;r&&jd(r,t),t instanceof Et&&t._removeParent(this)}}Et.EMPTY=(()=>{const e=new Et;return e.closed=!0,e})();const NC=Et.EMPTY;function RC(e){return e instanceof Et||e&&"closed"in e&&at(e.remove)&&at(e.add)&&at(e.unsubscribe)}function OC(e){at(e)?e():e.unsubscribe()}const Gs={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},$d={setTimeout(e,t,...r){const{delegate:i}=$d;return i?.setTimeout?i.setTimeout(e,t,...r):setTimeout(e,t,...r)},clearTimeout(e){const{delegate:t}=$d;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function kC(e){$d.setTimeout(()=>{const{onUnhandledError:t}=Gs;if(!t)throw e;t(e)})}function mm(){}const QF=ym("C",void 0,void 0);function ym(e,t,r){return{kind:e,value:t,error:r}}let Ws=null;function Hd(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 vm extends Et{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,RC(t)&&t.add(this)):this.destination=r3}static create(t,r,i){return new wm(t,r,i)}next(t){this.isStopped?bm(function JF(e){return ym("N",e,void 0)}(t),this):this._next(t)}error(t){this.isStopped?bm(function YF(e){return ym("E",void 0,e)}(t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?bm(QF,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 e3=Function.prototype.bind;function _m(e,t){return e3.call(e,t)}class t3{constructor(t){this.partialObserver=t}next(t){const{partialObserver:r}=this;if(r.next)try{r.next(t)}catch(i){zd(i)}}error(t){const{partialObserver:r}=this;if(r.error)try{r.error(t)}catch(i){zd(i)}else zd(t)}complete(){const{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(r){zd(r)}}}class wm extends vm{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&&_m(t.next,o),error:t.error&&_m(t.error,o),complete:t.complete&&_m(t.complete,o)}):s=t}this.destination=new t3(s)}}function zd(e){Gs.useDeprecatedSynchronousErrorHandling?function XF(e){Gs.useDeprecatedSynchronousErrorHandling&&Ws&&(Ws.errorThrown=!0,Ws.error=e)}(e):kC(e)}function bm(e,t){const{onStoppedNotification:r}=Gs;r&&$d.setTimeout(()=>r(e,t))}const r3={closed:!0,next:mm,error:function n3(e){throw e},complete:mm},Em="function"==typeof Symbol&&Symbol.observable||"@@observable";function Zs(e){return e}function PC(e){return 0===e.length?Zs:1===e.length?e[0]:function(r){return e.reduce((i,s)=>s(i),r)}}let $t=(()=>{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 o3(e){return e&&e instanceof vm||function s3(e){return e&&at(e.next)&&at(e.error)&&at(e.complete)}(e)&&RC(e)}(r)?r:new wm(r,i,s);return Hd(()=>{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=LC(i))((s,o)=>{const a=new wm({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)}[Em](){return this}pipe(...r){return PC(r)(this)}toPromise(r){return new(r=LC(r))((i,s)=>{let o;this.subscribe(a=>o=a,a=>s(a),()=>i(o))})}}return e.create=t=>new e(t),e})();function LC(e){var t;return null!==(t=e??Gs.Promise)&&void 0!==t?t:Promise}const a3=Ud(e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});let Xe=(()=>{class e extends $t{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(r){const i=new FC(this,this);return i.operator=r,i}_throwIfClosed(){if(this.closed)throw new a3}next(r){Hd(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const i of this.currentObservers)i.next(r)}})}error(r){Hd(()=>{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(){Hd(()=>{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?NC:(this.currentObservers=null,o.push(r),new Et(()=>{this.currentObservers=null,jd(o,r)}))}_checkFinalizedStatuses(r){const{hasError:i,thrownError:s,isStopped:o}=this;i?r.error(s):o&&r.complete()}asObservable(){const r=new $t;return r.source=this,r}}return e.create=(t,r)=>new FC(t,r),e})();class FC extends Xe{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:NC}}class Jn extends Xe{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 BC(e){return at(e?.lift)}function Ht(e){return t=>{if(BC(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 Ct(e,t,r,i,s){return new c3(e,t,r,i,s)}class c3 extends vm{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 Ht((r,i)=>{let s=0;r.subscribe(Ct(i,o=>{i.next(e.call(t,o,s++))}))})}const VC="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 Cm(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 l3(e,t){for(const r in t)t.hasOwnProperty(r)&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Nt(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(Nt).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 Dm(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}const u3=He({__forward_ref__:He});function et(e){return e.__forward_ref__=et,e.toString=function(){return Nt(this())},e}function ie(e){return Gd(e)?e():e}function Gd(e){return"function"==typeof e&&e.hasOwnProperty(u3)&&e.__forward_ref__===et}function H(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function Dt(e){return{providers:e.providers||[],imports:e.imports||[]}}function Wd(e){return HC(e,Kd)||HC(e,zC)}function HC(e,t){return e.hasOwnProperty(t)?e[t]:null}function Zd(e){return e&&(e.hasOwnProperty(Sm)||e.hasOwnProperty(m3))?e[Sm]:null}const Kd=He({\u0275prov:He}),Sm=He({\u0275inj:He}),zC=He({ngInjectableDef:He}),m3=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=H({token:this,providedIn:r.providedIn||"root",factory:r.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}function Mm(e){return e&&!!e.\u0275providers}const Qc=He({\u0275cmp:He}),Nm=He({\u0275dir:He}),Rm=He({\u0275pipe:He}),GC=He({\u0275mod:He}),Ei=He({\u0275fac:He}),Yc=He({__NG_ELEMENT_ID__:He}),WC=He({__NG_ENV_ID__:He});function pe(e){return"string"==typeof e?e:null==e?"":String(e)}function Om(e,t){throw new A(-201,!1)}var Ie=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}(Ie||{});let km;function ZC(){return km}function Sn(e){const t=km;return km=e,t}function KC(e,t,r){const i=Wd(e);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:r&Ie.Optional?null:void 0!==t?t:void Om()}const Jc={},Pm="__NG_DI_FLAG__",Qd="ngTempTokenPath",E3=/\n/gm,QC="__source";let ta;function es(e){const t=ta;return ta=e,t}function S3(e,t=Ie.Default){if(void 0===ta)throw new A(-203,!1);return null===ta?KC(e,void 0,t):ta.get(e,t&Ie.Optional?null:void 0,t)}function Z(e,t=Ie.Default){return(ZC()||S3)(ie(e),t)}function O(e,t=Ie.Default){return Z(e,Yd(t))}function Yd(e){return typeof e>"u"||"number"==typeof e?e:(e.optional&&8)|(e.host&&1)|(e.self&&2)|(e.skipSelf&&4)}function Lm(e){const t=[];for(let r=0;rArray.isArray(r)?na(r,t):t(r))}function JC(e,t,r){t>=e.length?e.push(r):e.splice(t,0,r)}function ef(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 XC(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 Bm(e,t){const r=ra(e,t);if(r>=0)return e[1|r]}function ra(e,t){return function eD(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(vr(i))return!1;a=!0}}}}else{if(!a&&!vr(i)&&!vr(l))return!1;if(a&&vr(l))continue;a=!1,i=l|1&i}}return vr(i)||a}function vr(e){return!(1&e)}function F3(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&&!vr(a)&&(t+=aD(o,s),s=""),i=a,o=o||!vr(i);r++}return""!==s&&(t+=aD(o,s)),t}function ns(e){return bi(()=>{const t=lD(e),r={...t,decls:e.decls,vars:e.vars,template:e.template,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,onPush:e.changeDetection===rf.OnPush,directiveDefs:null,pipeDefs:null,dependencies:t.standalone&&e.dependencies||null,getStandaloneInjector:null,signals:e.signals??!1,data:e.data||{},encapsulation:e.encapsulation||yr.Emulated,styles:e.styles||ke,_:null,schemas:e.schemas||null,tView:null,id:""};uD(r);const i=e.dependencies;return r.directiveDefs=sf(i,!1),r.pipeDefs=sf(i,!0),r.id=function Z3(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 q3(e){return De(e)||Ot(e)}function G3(e){return null!==e}function Rt(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 Br;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=lD(e);return uD(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 Ot(e){return e[Nm]||null}function Gt(e){return e[Rm]||null}function tn(e,t){const r=e[GC]||null;if(!r&&!0===t)throw new Error(`Type ${Nt(e)} does not have '\u0275mod' property.`);return r}function lD(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||Br,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 uD(e){e.features?.forEach(t=>t(e))}function sf(e,t){if(!e)return null;const r=t?Gt:q3;return()=>("function"==typeof e?e():e).map(i=>r(i)).filter(G3)}function K3(...e){return{\u0275providers:$m(0,e),\u0275fromNgModule:!0}}function $m(e,...t){const r=[],i=new Set;let s;const o=a=>{r.push(a)};return na(t,a=>{const c=a;af(c,o,[],i)&&(s||=[],s.push(c))}),void 0!==s&&dD(s,o),r}function dD(e,t){for(let r=0;r{t(o,i)})}}function af(e,t,r,i){if(!(e=ie(e)))return!1;let s=null,o=Zd(e);const a=!o&&De(e);if(o||a){if(a&&!a.standalone)return!1;s=e}else{const l=e.ngModule;if(o=Zd(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)af(u,t,r,i)}}else{if(!o)return!1;{if(null!=o.imports&&!c){let u;i.add(s);try{na(o.imports,d=>{af(d,t,r,i)&&(u||=[],u.push(d))})}finally{}void 0!==u&&dD(u,t)}if(!c){const u=Ks(s)||(()=>new s);t({provide:s,useFactory:u,deps:ke},s),t({provide:Vm,useValue:s,multi:!0},s),t({provide:Vr,useValue:()=>Z(s),multi:!0},s)}const l=o.providers;if(null!=l&&!c){const u=e;Hm(l,d=>{t(d,u)})}}}return s!==e&&void 0!==e.providers}function Hm(e,t){for(let r of e)Mm(r)&&(r=r.\u0275providers),Array.isArray(r)?Hm(r,t):t(r)}const Q3=He({provide:String,useValue:He});function zm(e){return null!==e&&"object"==typeof e&&Q3 in e}function Qs(e){return"function"==typeof e}const qm=new q(""),cf={},J3={};let Gm;function lf(){return void 0===Gm&&(Gm=new nf),Gm}class Tn{}class ia extends Tn{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,Zm(t,a=>this.processProvider(a)),this.records.set(tD,sa(void 0,this)),s.has("environment")&&this.records.set(Tn,sa(void 0,this));const o=this.records.get(qm);null!=o&&"string"==typeof o.value&&this.scopes.add(o.value),this.injectorDefTypes=new Set(this.get(Vm,ke,Ie.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=Ie.Default){if(this.assertNotDestroyed(),t.hasOwnProperty(WC))return t[WC](this);i=Yd(i);const o=es(this),a=Sn(void 0);try{if(!(i&Ie.SkipSelf)){let l=this.records.get(t);if(void 0===l){const u=function rB(e){return"function"==typeof e||"object"==typeof e&&e instanceof q}(t)&&Wd(t);l=u&&this.injectableDefInScope(u)?sa(Wm(t),cf):null,this.records.set(t,l)}if(null!=l)return this.hydrate(t,l)}return(i&Ie.Self?lf():this.parent).get(t,r=i&Ie.Optional&&r===Jc?null:r)}catch(c){if("NullInjectorError"===c.name){if((c[Qd]=c[Qd]||[]).unshift(Nt(t)),o)throw c;return function T3(e,t,r,i){const s=e[Qd];throw t[QC]&&s.unshift(t[QC]),e.message=function x3(e,t,r,i=null){e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.slice(2):e;let s=Nt(t);if(Array.isArray(t))s=t.map(Nt).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):Nt(c)))}s=`{${o.join(", ")}}`}return`${r}${i?"("+i+")":""}[${s}]: ${e.replace(E3,"\n ")}`}("\n"+e.message,s,r,i),e.ngTokenPath=s,e[Qd]=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(Vr,ke,Ie.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(Nt(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 eB(e){return zm(e)?sa(void 0,e.useValue):sa(pD(e),cf)}(t);if(!Qs(t)&&!0===t.multi){let s=this.records.get(r);s||(s=sa(void 0,cf,!0),s.factory=()=>Lm(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===cf&&(r.value=J3,r.value=r.factory()),"object"==typeof r.value&&r.value&&function nB(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 Wm(e){const t=Wd(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 X3(e){if(e.length>0)throw new A(204,!1);const r=function g3(e){return e&&(e[Kd]||e[zC])||null}(e);return null!==r?()=>r.factory(e):()=>new e}(e);throw new A(204,!1)}function pD(e,t,r){let i;if(Qs(e)){const s=ie(e);return Ks(s)||Wm(s)}if(zm(e))i=()=>ie(e.useValue);else if(function hD(e){return!(!e||!e.useFactory)}(e))i=()=>e.useFactory(...Lm(e.deps||[]));else if(function fD(e){return!(!e||!e.useExisting)}(e))i=()=>Z(ie(e.useExisting));else{const s=ie(e&&(e.useClass||e.provide));if(!function tB(e){return!!e.deps}(e))return Ks(s)||Wm(s);i=()=>new s(...Lm(e.deps))}return i}function sa(e,t,r=!1){return{factory:e,value:t,multi:r?[]:void 0}}function Zm(e,t){for(const r of e)Array.isArray(r)?Zm(r,t):r&&Mm(r)?Zm(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 gD(){return void 0!==ZC()||null!=function D3(){return ta}()}const lt=0,F=1,ne=2,St=3,_r=4,Wt=5,hn=6,aa=7,tt=8,It=9,Ur=10,se=11,rl=12,yD=13,ca=14,ut=15,Ys=16,la=17,Di=18,ua=19,vD=20,is=21,df=22,Xn=23,Y=25,Ym=1,jr=7,da=9,mt=10;var hf=function(e){return e[e.None=0]="None",e[e.HasTransplantedViews=2]="HasTransplantedViews",e}(hf||{});function Pt(e){return Array.isArray(e)&&"object"==typeof e[Ym]}function nn(e){return Array.isArray(e)&&!0===e[Ym]}function Jm(e){return!!(4&e.flags)}function Js(e){return e.componentOffset>-1}function pf(e){return!(1&~e.flags)}function wr(e){return!!e.template}function sl(e){return!!(512&e[ne])}class gB{constructor(t,r,i){this.previousValue=t,this.currentValue=r,this.firstChange=i}isFirstChange(){return this.firstChange}}function CD(e,t,r,i){null!==t?t.applyValueToInputSignal(t,i):e[r]=i}function er(){return DD}function DD(e){return e.type.prototype.ngOnChanges&&(e.setInput=yB),mB}function mB(){const e=ID(this),t=e?.current;if(t){const r=e.previous;if(r===Br)e.previous=t;else for(let i in t)r[i]=t[i];e.current=null,this.ngOnChanges(t)}}function yB(e,t,r,i,s){const o=this.declaredInputs[i],a=ID(e)||function vB(e,t){return e[SD]=t}(e,{previous:Br,current:null}),c=a.current||(a.current={}),l=a.previous,u=l[o];c[o]=new gB(u&&u.currentValue,r,l===Br),CD(e,t,s,r)}er.ngInherit=!0;const SD="__ngSimpleChanges__";function ID(e){return e[SD]||null}const $r=function(e,t,r){},TD="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 Pt(r)?r:r[lt]}function ry(e){return!(128&~e[ne])}function tr(e,t){return null==t?null:e[t]}function AD(e){e[la]=0}function MD(e){1024&e[ne]||(e[ne]|=1024,ry(e)&&mf(e))}function gf(e){return!!(9216&e[ne]||e[Xn]?.dirty)}function iy(e){e[Ur].changeDetectionScheduler?.notify(8),64&e[ne]&&(e[ne]|=1024),gf(e)&&mf(e)}function mf(e){e[Ur].changeDetectionScheduler?.notify(0);let t=Si(e);for(;null!==t&&!(8192&t[ne])&&(t[ne]|=8192,ry(t));)t=Si(t)}function yf(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[St];return nn(t)?t[St]:t}const oe={lFrame:HD(null),bindingsEnabled:!0,skipHydrationRootTNode:null};let RD=!1;function OD(){return oe.bindingsEnabled}function N(){return oe.lFrame.lView}function we(){return oe.lFrame.tView}function Zt(e){return oe.lFrame.contextLView=e,e[tt]}function Kt(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 br(e,t){const r=oe.lFrame;r.currentTNode=e,r.isParent=t}function ay(){return oe.lFrame.isParent}function cy(){oe.lFrame.isParent=!1}function FD(){return RD}function BD(e){RD=e}function Er(){return oe.lFrame.bindingIndex++}function Ti(e){const t=oe.lFrame,r=t.bindingIndex;return t.bindingIndex=t.bindingIndex+e,r}function RB(e,t){const r=oe.lFrame;r.bindingIndex=r.bindingRootIndex=e,ly(t)}function ly(e){oe.lFrame.currentDirectiveIndex=e}function uy(e){const t=oe.lFrame.currentDirectiveIndex;return-1===t?null:e[t]}function dy(){return oe.lFrame.currentQueryIndex}function _f(e){oe.lFrame.currentQueryIndex=e}function kB(e){const t=e[F];return 2===t.type?t.declTNode:1===t.type?e[Wt]:null}function jD(e,t,r){if(r&Ie.SkipSelf){let s=t,o=e;for(;!(s=s.parent,null!==s||r&Ie.Host||(s=kB(o),null===s||(o=o[ca],10&s.type))););if(null===s)return!1;t=s,e=o}const i=oe.lFrame=$D();return i.currentTNode=t,i.lView=e,!0}function fy(e){const t=$D(),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 $D(){const e=oe.lFrame,t=null===e?null:e.child;return null===t?HD(e):t}function HD(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 zD(){const e=oe.lFrame;return oe.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}const qD=zD;function hy(){const e=zD();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 Qt(){return oe.lFrame.selectedIndex}function to(e){oe.lFrame.selectedIndex=e}function nt(){const e=oe.lFrame;return al(e.tView,e.selectedIndex)}function wf(){oe.lFrame.currentNamespace=TD}function bf(){!function FB(){oe.lFrame.currentNamespace=null}()}let WD=!0;function ll(){return WD}function Hr(e){WD=e}function Ef(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,KD(c,o)):KD(c,o)}const fa=-1;class ul{constructor(t,r,i){this.factory=t,this.resolving=!1,this.canSeeViewProviders=r,this.injectImpl=i}}const my={};class no{constructor(t,r){this.injector=t,this.parentInjector=r}get(t,r,i){i=Yd(i);const s=this.injector.get(t,my,i);return s!==my||r===my?s:this.parentInjector.get(t,r,i)}}function yy(e){return e!==fa}function dl(e){return 32767&e}function fl(e,t){let r=function zB(e){return e>>16}(e),i=t;for(;r>0;)i=i[ca],r--;return i}let vy=!0;function Sf(e){const t=vy;return vy=e,t}const YD=255,JD=5;let GB=0;const zr={};function If(e,t){const r=XD(e,t);if(-1!==r)return r;const i=t[F];i.firstCreatePass&&(e.injectorIndex=t.length,_y(i.data,e),_y(t,null),_y(i.blueprint,null));const s=Tf(e,t),o=e.injectorIndex;if(yy(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 _y(e,t){e.push(0,0,0,0,0,0,0,0,t)}function XD(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:e.injectorIndex}function Tf(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=oS(s),null===i)return fa;if(r++,s=s[ca],-1!==i.injectorIndex)return i.injectorIndex|r<<16}return fa}function wy(e,t,r){!function WB(e,t,r){let i;"string"==typeof r?i=r.charCodeAt(0)||0:r.hasOwnProperty(Yc)&&(i=r[Yc]),null==i&&(i=r[Yc]=GB++);const s=i&YD;t.data[e+(s>>JD)]|=1<=0?t&YD:YB:t}(r);if("function"==typeof o){if(!jD(t,e,i))return i&Ie.Host?eS(s,0,i):tS(t,r,i,s);try{let a;if(a=o(i),null!=a||i&Ie.Optional)return a;Om()}finally{qD()}}else if("number"==typeof o){let a=null,c=XD(e,t),l=fa,u=i&Ie.Host?t[ut][Wt]:null;for((-1===c||i&Ie.SkipSelf)&&(l=-1===c?Tf(e,t):t[c+8],l!==fa&&sS(i,!1)?(a=t[F],c=dl(l),t=fl(l,t)):c=-1);-1!==c;){const d=t[F];if(iS(o,c,d.data)){const f=KB(c,t,r,a,i,u);if(f!==zr)return f}l=t[c+8],l!==fa&&sS(i,t[F].data[c+8]===u)&&iS(o,c,t)?(a=d,c=dl(l),t=fl(l,t)):c=-1}}return s}function KB(e,t,r,i,s,o){const a=t[F],c=a.data[e+8],d=xf(c,a,r,null==i?Js(c)&&vy:i!=a&&!!(3&c.type),s&Ie.Host&&o===c);return null!==d?ro(t,a,d,c):zr}function xf(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&&wr(p)&&p.type===r)return l}return null}function ro(e,t,r,i){let s=e[r];const o=t.data;if(function UB(e){return e instanceof ul}(s)){const a=s;a.resolving&&function _3(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=Sf(a.canSeeViewProviders);a.resolving=!0;const u=a.injectImpl?Sn(a.injectImpl):null;jD(e,i,Ie.Default);try{s=e[r]=a.factory(void 0,o,e,i),t.firstCreatePass&&r>=i.directiveStart&&function BB(e,t,r){const{ngOnChanges:i,ngOnInit:s,ngDoCheck:o}=t.type.prototype;if(i){const a=DD(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),Sf(c),a.resolving=!1,qD()}}return s}function iS(e,t,r){return!!(r[t+(e>>JD)]&1<{const t=e.prototype.constructor,r=t[Ei]||by(t),i=Object.prototype;let s=Object.getPrototypeOf(e.prototype).constructor;for(;s&&s!==i;){const o=s[Ei]||by(s);if(o&&o!==r)return o;s=Object.getPrototypeOf(s)}return o=>new o})}function by(e){return Gd(e)?()=>{const t=by(ie(e));return t&&t()}:Ks(e)}function oS(e){const t=e[F],r=t.type;return 2===r?t.declTNode:1===r?e[Wt]:null}function dS(e,t=null,r=null,i){const s=fS(e,t,r,i);return s.resolveInjectorInitializers(),s}function fS(e,t=null,r=null,i,s=new Set){const o=[r||ke,K3(e)];return i=i||("object"==typeof e?void 0:Nt(e)),new ia(o,t||lf(),i||null,s)}class Tt{static{this.THROW_IF_NOT_FOUND=Jc}static{this.NULL=new nf}static create(t,r){if(Array.isArray(t))return dS({name:""},r,t,"");{const i=t.name??"";return dS({name:i},t.parent,t.providers,i)}}static{this.\u0275prov=H({token:Tt,providedIn:"any",factory:()=>Z(tD)})}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&Ie.Optional)return null;throw new A(204,!1)};function Cy(e){return e.ngOriginalError}const pS=!0;let pl=(()=>{class e{static{this.__NG_ELEMENT_ID__=cV}static{this.__NG_ENV_ID__=r=>r}}return e})();class aV extends pl{constructor(t){super(),this._lView=t}onDestroy(t){return yf(this._lView,t),()=>function sy(e,t){if(null===e[is])return;const r=e[is].indexOf(t);-1!==r&&e[is].splice(r,1)}(this._lView,t)}}function cV(){return new aV(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=H({token:e,providedIn:"root",factory:()=>new e})}}return e})();const dt=class lV extends Xe{constructor(t=!1){super(),this.destroyRef=void 0,this.pendingTasks=void 0,this.__isAsync=t,gD()&&(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 Et&&t.add(c),c}wrapInTimeout(t){return r=>{const i=this.pendingTasks?.add();setTimeout(()=>{t(r),void 0!==i&&this.pendingTasks?.remove(i)})}}};function Mf(...e){}function gS(e){let t,r;function i(){e=Mf;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 mS(e){return queueMicrotask(()=>e()),()=>{e=Mf}}const Dy="isAngularZone",Nf=Dy+"_ID";let uV=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=pS}=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 hV(e){const t=()=>{!function fV(e){function t(){gS(()=>{e.callbackScheduled=!1,Iy(e),e.isCheckStableRunning=!0,Sy(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=uV++;e._inner=e._inner.fork({name:"angular",properties:{[Dy]:!0,[Nf]:r,[Nf+r]:!0},onInvokeTask:(i,s,o,a,c,l)=>{if(function pV(e){return _S(e,"__ignore_ng_zone__")}(l))return i.invokeTask(o,a,c,l);try{return yS(e),i.invokeTask(o,a,c,l)}finally{(e.shouldCoalesceEventChangeDetection&&"eventTask"===a.type||e.shouldCoalesceRunChangeDetection)&&t(),vS(e)}},onInvoke:(i,s,o,a,c,l,u)=>{try{return yS(e),i.invoke(o,a,c,l,u)}finally{e.shouldCoalesceRunChangeDetection&&!e.callbackScheduled&&!function gV(e){return _S(e,"__scheduler_tick__")}(l)&&t(),vS(e)}},onHasTask:(i,s,o,a)=>{i.hasTask(o,a),s===o&&("microTask"==a.change?(e._hasPendingMicrotasks=a.microTask,Iy(e),Sy(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(Dy)}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,dV,Mf,Mf);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 dV={};function Sy(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 yS(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function vS(e){e._nesting--,Sy(e)}class Ty{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 _S(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&&Cy(t);for(;r&&Cy(r);)r=Cy(r);return r||null}}const yV=new q("",{providedIn:"root",factory:()=>{const e=O(Ne),t=O(nr);return r=>e.runOutsideAngular(()=>t.handleError(r))}});function vV(){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__=vV}}return e})();function bS(e){return e instanceof jn?e.nativeElement:e}function _V(){return this._results[Symbol.iterator]()}class xy{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=xy.prototype;r[Symbol.iterator]||(r[Symbol.iterator]=_V)}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 In(e){return e.flat(Number.POSITIVE_INFINITY)}(t);(this._changesDetected=!function R3(e,t,r){if(e.length!==t.length)return!1;for(let i=0;iUV}),UV="ng",jS=new q(""),os=new q("",{providedIn:"platform",factory:()=>"unknown"}),$S=new q(""),HS=new q("",{providedIn:"root",factory:()=>ss().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});let zS=()=>null;function Uy(e,t,r=!1){return zS(e,t,r)}const JS=new q("",{providedIn:"root",factory:()=>!1});let Uf,jf;function wa(e){return function qy(){if(void 0===Uf&&(Uf=null,ct.trustedTypes))try{Uf=ct.trustedTypes.createPolicy("angular",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})}catch{}return Uf}()?.createHTML(e)||e}function tI(e){return function Gy(){if(void 0===jf&&(jf=null,ct.trustedTypes))try{jf=ct.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})}catch{}return jf}()?.createHTML(e)||e}class oo{constructor(t){this.changingThisBreaksApplicationSecurity=t}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${VC})`}}class e8 extends oo{getTypeName(){return"HTML"}}class t8 extends oo{getTypeName(){return"Style"}}class n8 extends oo{getTypeName(){return"Script"}}class r8 extends oo{getTypeName(){return"URL"}}class i8 extends oo{getTypeName(){return"ResourceURL"}}function $n(e){return e instanceof oo?e.changingThisBreaksApplicationSecurity:e}function qr(e,t){const r=function s8(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 ${VC})`)}return r===t}class d8{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 f8{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 p8=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function $f(e){return(e=String(e)).match(p8)?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 sI=xi("area,br,col,hr,img,wbr"),oI=xi("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),aI=xi("rp,rt"),Wy=Cl(sI,Cl(oI,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(aI,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(aI,oI)),Zy=xi("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),cI=Cl(Zy,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")),g8=xi("script,style,template");class m8{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=_8(r);else for(;r;){r.nodeType===Node.ELEMENT_NODE&&this.endElement(r);let o=v8(r);if(o){r=o;break}r=s.pop()}return this.buf.join("")}startElement(t){const r=lI(t).toLowerCase();if(!Wy.hasOwnProperty(r))return this.sanitizedSomething=!0,!g8.hasOwnProperty(r);this.buf.push("<"),this.buf.push(r);const i=t.attributes;for(let s=0;s"),!0}endElement(t){const r=lI(t).toLowerCase();Wy.hasOwnProperty(r)&&!sI.hasOwnProperty(r)&&(this.buf.push(""))}chars(t){this.buf.push(dI(t))}}function v8(e){const t=e.nextSibling;if(t&&e!==t.previousSibling)throw uI(t);return t}function _8(e){const t=e.firstChild;if(t&&function y8(e,t){return(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)!==Node.DOCUMENT_POSITION_CONTAINED_BY}(e,t))throw uI(t);return t}function lI(e){const t=e.nodeName;return"string"==typeof t?t:"FORM"}function uI(e){return new Error(`Failed to sanitize html because the element is clobbered: ${e.outerHTML}`)}const w8=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b8=/([^\#-~ |!])/g;function dI(e){return e.replace(/&/g,"&").replace(w8,function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"}).replace(b8,function(t){return"&#"+t.charCodeAt(0)+";"}).replace(//g,">")}let Hf;function fI(e,t){let r=null;try{Hf=Hf||function iI(e){const t=new f8(e);return function h8(){try{return!!(new window.DOMParser).parseFromString(wa(""),"text/html")}catch{return!1}}()?new d8(t):t}(e);let i=t?String(t):"";r=Hf.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=Hf.getInertBodyElement(i)}while(i!==o);return wa((new m8).sanitizeChildren(Ky(r)||r))}finally{if(r){const i=Ky(r)||r;for(;i.firstChild;)i.firstChild.remove()}}}function Ky(e){return"content"in e&&function E8(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 Qy(e){const t=function Dl(){const e=N();return e&&e[Ur].sanitizer}();return t?tI(t.sanitize(Hn.HTML,e)||""):qr(e,"HTML")?tI($n(e)):fI(ss(),pe(e))}const x8=/^>|^->||--!>|)/g,M8="\u200b$1\u200b";function wI(e){return e.ownerDocument.defaultView}function zn(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 Xy;function ev(e,t){return Xy(e,t)}function Ea(e,t,r,i,s){if(null!=i){let o,a=!1;nn(i)?o=i:Pt(i)&&(a=!0,i=i[lt]);const c=Pe(i);0===e&&null!==r?null==s?AI(t,r,c):ao(t,r,c,s||null,!0):1===e&&null!==r?ao(t,r,c,s||null,!0):2===e?function Il(e,t,r){e.removeChild(null,t,r)}(t,c,a):3===e&&t.destroyNode(c),null!=o&&function K8(e,t,r,i,s){const o=r[jr];o!==Pe(r)&&Ea(t,e,i,o,s);for(let c=mt;ct.replace(A8,M8))}(t))}function Gf(e,t,r){return e.createElement(t,r)}function II(e,t){t[Ur].changeDetectionScheduler?.notify(9),Kf(e,t,t[se],2,null,null)}function TI(e,t){const r=e[da],i=t[St];(Pt(i)||t[ut]!==i[St][ut])&&(e[ne]|=hf.HasTransplantedViews),null===r?e[da]=[t]:r.push(t)}function rv(e,t){const r=e[da],i=r.indexOf(t);r.splice(i,1)}function Sl(e,t){if(e.length<=mt)return;const r=mt+t,i=e[r];if(i){const s=i[Ys];null!==s&&s!==e&&rv(s,i),t>0&&(e[r-1][_r]=i[_r]);const o=ef(e,mt+t);!function j8(e,t){II(e,t),t[lt]=null,t[Wt]=null}(i[F],i);const a=o[Di];null!==a&&a.detachView(o[F]),i[St]=null,i[_r]=null,i[ne]&=-129}return i}function Wf(e,t){if(!(256&t[ne])){const r=t[se];r.destroyNode&&Kf(e,t,r,3,null,null),function H8(e){let t=e[rl];if(!t)return iv(e[F],e);for(;t;){let r=null;if(Pt(t))r=t[rl];else{const i=t[mt];i&&(r=i)}if(!r){for(;t&&!t[_r]&&t!==e;)Pt(t)&&iv(t[F],t),t=t[St];null===t&&(t=e),Pt(t)&&iv(t[F],t),r=t&&t[_r]}t=r}}(t)}}function iv(e,t){if(256&t[ne])return;const r=_e(null);try{t[ne]&=-129,t[ne]|=256,t[Xn]&&fm(t[Xn]),function G8(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===yr.None||o===yr.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 AI(e,t,r){e.appendChild(t,r)}function MI(e,t,r,i,s){null!==i?ao(e,t,r,i,s):AI(e,t,r)}function ov(e,t){return e.parentNode(t)}let av,OI=function RI(e,t,r){return 40&e.type?pn(e,r):null};function Zf(e,t,r,i){const s=sv(e,i,t),o=t[se],c=function NI(e,t,r){return OI(e,t,r)}(i.parent||t[Wt],i,t);if(null!=s)if(Array.isArray(r))for(let l=0;lY&&UI(e,t,Y,!1),$r(a?2:0,s),r(i,s)}finally{to(o),$r(a?3:1,s)}}function dv(e,t,r){if(Jm(t)){const i=_e(null);try{const o=t.directiveEnd;for(let a=t.directiveStart;anull;function GI(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?WI(i,r,u,c,l):WI(i,r,u,c)}return i}function WI(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])?(_v(e,r,d,i,s),Js(t)&&function cU(e,t){const r=Un(t,e);16&r[ne]||(r[ne]|=64)}(r,t.index)):3&t.type&&(i=function aU(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 gv(e,t,r,i){if(OD()){const s=null===i?null:{"":-1},o=function pU(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,Tl(e,r,s.hostVars,ge),s)}function Gr(e,t,r,i,s,o){const a=pn(e,t);!function yv(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 wU(e,t,r,i,s,o){const a=o[t];if(null!==a)for(let c=0;c{mf(e.lView)},consumerOnSignalRead(){this.lView[Xn]=this}},MU={...kd,consumerIsAlwaysLive:!0,consumerMarkedDirty:e=>{let t=Si(e.lView);for(;t&&!iT(t[F]);)t=Si(t);t&&MD(t)},consumerOnSignalRead(){this.lView[Xn]=this}};function iT(e){return 2!==e.type}const NU=100;function Xf(e,t=!0,r=0){const i=e[Ur],s=i.rendererFactory;s.begin?.();try{!function RU(e,t){const r=FD();try{BD(!0),Ev(e,t);let i=0;for(;gf(e);){if(i===NU)throw new A(103,!1);i++,Ev(e,1)}}finally{BD(r)}}(e,r)}catch(a){throw t&&Jf(e,a),a}finally{s.end?.(),i.inlineEffectRunner?.flush()}}function OU(e,t,r,i){const s=t[ne];if(!(256&~s))return;t[Ur].inlineEffectRunner?.flush(),fy(t);let c=!0,l=null,u=null;iT(e)?(u=function SU(e){return e[Xn]??function IU(e){const t=rT.pop()??Object.create(xU);return t.lView=e,t}(e)}(t),l=Pd(u)):null===function _C(){return Mt}()?(c=!1,u=function AU(e){const t=e[Xn]??Object.create(MU);return t.lView=e,t}(t),l=Pd(u)):t[Xn]&&(fm(t[Xn]),t[Xn]=null);try{AD(t),function VD(e){return oe.lFrame.bindingIndex=e}(e.bindingStartIndex),null!==r&&HI(e,t,r,2,i);const d=!(3&~s);if(d){const p=e.preOrderCheckHooks;null!==p&&Cf(t,p,null)}else{const p=e.preOrderHooks;null!==p&&Df(t,p,0,null),py(t,0)}if(function kU(e){for(let t=NS(e);null!==t;t=RS(t)){if(!(t[ne]&hf.HasTransplantedViews))continue;const r=t[da];for(let i=0;i-1&&(Sl(t,i),ef(r,i))}this._attachedToViewContainer=!1}Wf(this._lView[F],this._lView)}onDestroy(t){yf(this._lView,t)}markForCheck(){Al(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[ne]&=-129}reattach(){iy(this._lView),this._lView[ne]|=128}detectChanges(){this._lView[ne]|=1024,Xf(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&&rv(r,this._lView),II(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&&TI(i,this._lView),iy(this._lView)}}let Mi=(()=>{class e{static{this.__NG_ELEMENT_ID__=BU}}return e})();const LU=Mi,FU=class extends LU{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=Qf(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)),wv(o,l,r),l}finally{_e(s)}}(this._declarationLView,this._declarationTContainer,t,{embeddedViewInjector:r,dehydratedView:i});return new Ml(s)}};function BU(){return eh(ze(),N())}function eh(e,t){return 4&e.type?new FU(t,e,ga(e,t)):null}class Ia{}const Bl=new q("",{providedIn:"root",factory:()=>!1}),MT=new q(""),Ov=new q("");class Mj{}class NT{}class Rj{resolveComponentFactory(t){throw function Nj(e){const t=Error(`No component factory found for ${Nt(e)}.`);return t.ngComponent=e,t}(t)}}class Vl{static{this.NULL=new Rj}}class oh{}let kj=(()=>{class e{static{this.\u0275prov=H({token:e,providedIn:"root",factory:()=>null})}}return e})();function ch(e,t,r){let i=r?e.styles:null,s=r?e.classes:null,o=0;if(null!==t)for(let a=0;a0&&BI(e,r,o.join(" "))}}(h,C,g,i),void 0!==r&&function zj(e,t,r){const i=e.projection=[];for(let s=0;s{class e{static{this.__NG_ELEMENT_ID__=Gj}}return e})();function Gj(){return VT(ze(),N())}const Wj=rr,FT=class extends Wj{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 Lt(this._hostTNode,this._hostLView)}get parentInjector(){const t=Tf(this._hostTNode,this._hostLView);if(yy(t)){const r=fl(t,this._hostLView),i=dl(t);return new Lt(r[F].data[i+8],r)}return new Lt(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const r=BT(this._lContainer);return null!==r&&r[t]||null}get length(){return this._lContainer.length-mt}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(Tn,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 EB(e){return nn(e[St])}(s)){const c=this.indexOf(t);if(-1!==c)this.detach(c);else{const l=s[St],u=new FT(l,l[Wt],l[St]);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 z8(e,t,r,i){const s=mt+i,o=r.length;i>0&&(r[s-1][_r]=t),i!1;class Bv{constructor(t){this.queryList=t,this.matches=null}clone(){return new Bv(this.queryList)}setDirty(){this.queryList.setDirty()}}class Vv{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 Uv{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=mt;f(lm(t),t.value);return r[mr]=t,r}(e),i=r[mr];return t?.equal&&(i.equal=t.equal),r.set=s=>AC(i,s),r.update=s=>function GF(e,t){EC()||xC(),AC(e,t(e.value))}(i,s),r.asReadonly=JT.bind(r),r}function JT(){const e=this[mr];if(void 0===e.readonlyFn){const t=()=>this();t[mr]=e,e.readonlyFn=t}return e.readonlyFn}function je(e){let t=function u1(e){return Object.getPrototypeOf(e.prototype).constructor}(e.type),r=!0;const i=[e];for(;t;){let s;if(wr(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=uh(e.inputs),a.inputTransforms=uh(e.inputTransforms),a.declaredInputs=uh(e.declaredInputs),a.outputs=uh(e.outputs);const c=s.hostBindings;c&&y4(e,c);const l=s.viewQuery,u=s.contentQueries;if(l&&g4(e,l),u&&m4(e,u),h4(e,s),l3(e.outputs,s.outputs),wr(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 h4(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 uh(e){return e===Br?{}:e===ke?[]:e}function g4(e,t){const r=e.viewQuery;e.viewQuery=r?(i,s)=>{t(i,s),r(i,s)}:t}function m4(e,t){const r=e.contentQueries;e.contentQueries=r?(i,s,o)=>{t(i,s,o),r(i,s,o)}:t}function y4(e,t){const r=e.hostBindings;e.hostBindings=r?(i,s)=>{t(i,s),r(i,s)}:t}class po{}class g1{}class Gv extends po{constructor(t,r,i,s=!0){super(),this.ngModuleType=t,this._parent=r,this._bootstrapComponents=[],this.destroyCbs=[],this.componentFactoryResolver=new PT(this);const o=tn(t);this._bootstrapComponents=zn(o.bootstrap),this._r3Injector=fS(t,r,[{provide:po,useValue:this},{provide:Vl,useValue:this.componentFactoryResolver},...i],Nt(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 Wv extends g1{constructor(t){super(),this.moduleType=t}create(t){return new Gv(this.moduleType,t,[])}}class m1 extends po{constructor(t){super(),this.componentFactoryResolver=new PT(this),this.instance=null;const r=new ia([...t.providers,{provide:po,useValue:this},{provide:Vl,useValue:this.componentFactoryResolver}],t.parent||lf(),t.debugName,new Set(["environment"]));this.injector=r,t.runEnvironmentInitializers&&r.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(t){this.injector.onDestroy(t)}}function dh(e,t,r=null){return new m1({providers:e,parent:t,debugName:r,runEnvironmentInitializers:!0}).injector}function fh(e){return!!function Zv(e){return null!==e&&("function"==typeof e||"object"==typeof e)}(e)&&(Array.isArray(e)||!(e instanceof Map)&&Symbol.iterator in e)}function yt(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 A4(e,t,r,i,s,o,a,c,l){const u=t.consts,d=lo(t,e,4,a||null,c||null);gv(t,r,d,tr(u,l)),Ef(t,d);const f=d.tView=pv(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];br(f,!1);const h=y1(t,e,f,r);ll()&&Zf(t,e,h,f),rn(h,e);const p=QI(h,e,h,f);return e[d]=p,Yf(e,p),function jT(e,t,r){return Fv(e,t,r)}(p,f,e),pf(f)&&fv(t,e,f),null!=l&&hv(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 y1=function v1(e,t,r,i){return Hr(!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 D1=(()=>{class e{constructor(){this.impl=null}execute(){this.impl?.execute()}static{this.\u0275prov=H({token:e,providedIn:"root",factory:()=>new e})}}return e})();class Zl{constructor(){this.ngZone=O(Ne),this.scheduler=O(Ia),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=H({token:Zl,providedIn:"root",factory:()=>new Zl})}}class O4{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 yh(e,t){!t?.injector&&function Km(e){if(!gD())throw new A(-203,!1)}();const r=t?.injector??O(Tt);return function qn(e){return"browser"===(e??O(Tt)).get(os)}(r)?(mn("NgAfterNextRender"),function S1(e,t,r,i){const s=t.get(D1);s.impl??=t.get(Zl);const o=r?.phase??Ma.MixedReadWrite,a=!0!==r?.manualCleanup?t.get(pl):null,c=new O4(s.impl,function P4(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)):I1}const I1={destroy(){}};function sn(e,t,r,i){const s=N();return yt(s,Er(),t)&&(we(),Gr(nt(),s,e,t,r,i)),sn}function wh(e,t){return e<<17|t<<2}function ds(e){return e>>17&32767}function o0(e){return 2|e}function yo(e){return(131068&e)>>2}function a0(e,t){return-131069&e|t<<2}function c0(e){return 1|e}function J1(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];y6(e[a],t)&&(c=!0,e[a+1]=i?c0(u):o0(u)),a=i?ds(u):yo(u)}c&&(e[r+1]=i?o0(s):c0(s))}function y6(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 Ft={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function X1(e){return e.substring(Ft.key,Ft.keyEnd)}function ex(e,t){const r=Ft.textEnd;return r===t?-1:(t=Ft.keyEnd=function b6(e,t,r){for(;t32;)t++;return t}(e,Ft.key=t,r),qa(e,t,r))}function qa(e,t,r){for(;t=0;r=ex(t,r))Vn(e,X1(t),!0)}function Cr(e,t,r,i){const s=N(),o=we(),a=Ti(2);o.firstUpdatePass&&ox(o,e,a,i),t!==ge&&yt(s,a,t)&&cx(o,o.data[Qt()],s,s[se],e,s[a+1]=function R6(e,t){return null==e||""===e||("string"==typeof t?e+=t:"object"==typeof e&&(e=Nt($n(e)))),e}(t,r),i,a)}function sx(e,t){return t>=e.expandoStartIndex}function ox(e,t,r,i){const s=e.data;if(null===s[r+1]){const o=s[Qt()],a=sx(e,r);ux(o,i)&&null===t&&!a&&(t=!1),t=function S6(e,t,r,i){const s=uy(e);let o=i?t.residualClasses:t.residualStyles;if(null===s)0===(i?t.classBindings:t.styleBindings)&&(r=Yl(r=u0(null,e,t,r,i),t.attrs,i),o=null);else{const a=t.directiveStylingLast;if(-1===a||e[a]!==s)if(r=u0(s,e,t,r,i),null===o){let l=function I6(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=u0(null,e,t,l[1],i),l=Yl(l,t.attrs,i),function T6(e,t,r,i){e[ds(r?t.classBindings:t.styleBindings)]=i}(e,t,i,l))}else o=function x6(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]=wh(h,c),0!==h&&(e[h+1]=a0(e[h+1],i)),e[c+1]=function h6(e,t){return 131071&e|t<<17}(e[c+1],i)}else e[i+1]=wh(c,0),0!==c&&(e[c+1]=a0(e[c+1],i)),c=i;else e[i+1]=wh(l,0),0===c?c=i:e[l+1]=a0(e[l+1],i),l=i;u&&(e[i+1]=o0(e[i+1])),J1(e,d,i,!0),J1(e,d,i,!1),function m6(e,t,r,i,s){const o=s?e.residualClasses:e.residualStyles;null!=o&&"string"==typeof t&&ra(o,t)>=0&&(r[i+1]=c0(r[i+1]))}(t,d,e,i,o),a=wh(c,l),o?t.classBindings=a:t.styleBindings=a}(s,o,t,r,a,i)}}function u0(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?Bm(h,i):d===i?h:void 0;if(u&&!bh(p)&&(p=Bm(l,i)),bh(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=Bm(l,i))}return c}function bh(e){return void 0!==e}function ux(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 t$(e,t,r,i,s,o){const a=t.consts,l=lo(t,e,2,i,tr(a,s));return gv(t,r,l,tr(a,o)),null!==l.attrs&&ch(l,l.attrs,!1),null!==l.mergedAttrs&&ch(l,l.mergedAttrs,!0),null!==t.queries&&t.queries.elementStart(t,l),l}(a,o,s,t,r,i):o.data[a],u=px(o,s,l,c,t,e);s[a]=u;const d=pf(l);return br(l,!0),VI(c,u,l),!function xa(e){return!(32&~e.flags)}(l)&&ll()&&Zf(o,s,u,l),0===function CB(){return oe.lFrame.elementDepthCount}()&&rn(u,s),function DB(){oe.lFrame.elementDepthCount++}(),d&&(fv(o,s,l),dv(o,l,s)),null!==i&&hv(s,l),fe}function me(){let e=ze();ay()?cy():(e=e.parent,br(e,!1));const t=e;(function IB(e){return oe.skipHydrationRootTNode===e})(t)&&function MB(){oe.skipHydrationRootTNode=null}(),function SB(){oe.lFrame.elementDepthCount--}();const r=we();return r.firstCreatePass&&(Ef(r,e),Jm(e)&&r.queries.elementEnd(e)),null!=t.classesWithoutHost&&function $B(e){return!!(8&e.flags)}(t)&&l0(r,t,N(),t.classesWithoutHost,!0),null!=t.stylesWithoutHost&&function HB(e){return!!(16&e.flags)}(t)&&l0(r,t,N(),t.stylesWithoutHost,!1),me}function or(e,t,r,i){return fe(e,t,r,i),me(),or}let px=(e,t,r,i,s,o)=>(Hr(!0),Gf(i,s,function GD(){return oe.lFrame.currentNamespace}()));function Ga(e,t,r){const i=N(),s=we(),o=e+Y,a=s.firstCreatePass?function i$(e,t,r,i,s){const o=t.consts,a=tr(o,i),c=lo(t,e,8,"ng-container",a);return null!==a&&ch(c,a,!0),gv(t,r,c,tr(o,s)),null!==t.queries&&t.queries.elementStart(t,c),c}(o,s,i,t,r):s.data[o];br(a,!0);const c=mx(s,i,a,e);return i[o]=c,ll()&&Zf(s,i,c,a),rn(c,i),pf(a)&&(fv(s,i,a),dv(s,a,i)),null!=r&&hv(i,a),Ga}function Wa(){let e=ze();const t=we();return ay()?cy():(e=e.parent,br(e,!1)),t.firstCreatePass&&(Ef(t,e),Jm(e)&&t.queries.elementEnd(e)),Wa}let mx=(e,t,r,i)=>(Hr(!0),nv(t[se],""));function Yr(){return N()}function p0(e,t,r){const i=N();if(yt(i,Er(),t)){const o=we(),a=nt();An(o,a,i,e,t,eT(uy(o.data),a,i),r,!0)}return p0}const Ch="en-US";let wx=Ch,Bx=(e,t,r)=>{};function $e(e,t,r,i){const s=N(),o=we(),a=ze();return function y0(e,t,r,i,s,o,a){const c=pf(i),u=e.firstCreatePass&&XI(e),d=t[tt],f=JI(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 Y$(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=$x(i,t,d,o),Bx(m,s,o);const b=r.listen(y,s,o);f.push(o,b),u&&u.push(s,v,_,_+1)}}else o=$x(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=jx(t,r,i,o),l=s.__ngNextListenerFn__;for(;l;)c=jx(t,r,l,o)&&c,l=l.__ngNextListenerFn__;return c}}function wt(e=1){return function PB(e){return(oe.lFrame.contextLView=function ND(e,t){for(;e>0;)t=t[ca],e--;return t}(e,oe.lFrame.contextLView))[tt]}(e)}function _0(e,t,r){GT(e,t,r)}function Th(e){const t=N(),r=we(),i=dy();_f(i+1);const s=zv(r,i);if(e.dirty&&function bB(e){return!(4&~e[ne])}(t)===!(2&~s.metadata.flags)){if(null===s.matches)e.reset([]);else{const o=KT(t,i);e.reset(o,bS),e.notifyOnChanges()}return!0}return!1}function xh(){return function Hv(e,t){return e[Di].queries[t].queryList}(N(),dy())}function Ka(e){return Xs(function PD(){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=cA(i,r,o,t,e);r[s]=a,ll()&&Zf(i,r,a,o),br(o,!1)}let cA=(e,t,r,i,s)=>(Hr(!0),function tv(e,t){return e.createText(t)}(t[se],i));function Qa(e){return Jr("",e,""),Qa}function Jr(e,t,r){const i=N(),s=function Fa(e,t,r,i){return yt(e,Er(),r)?t+pe(r)+i:ge}(i,e,t,r);return s!==ge&&function Ai(e,t,r){const i=ol(t,e);!function SI(e,t,r){e.setValue(t,r)}(e[se],i,r)}(i,Qt(),s),Jr}function b0(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=C0(l,t,s?d:d+h,f);-1===g?(wy(If(c,a),o,l),E0(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=C0(l,t,d+h,f),g=C0(l,t,d,d+h),y=g>=0&&r[g];if(s&&!y||!s&&!(p>=0&&r[p])){wy(If(c,a),o,l);const _=function E5(e,t,r,i,s){const o=new ul(e,r,k);return o.multi=[],o.index=t,o.componentProviders=0,bA(o,s,i&&!r),o}(s?b5:w5,r.length,s,i,u);!s&&y&&(r[g].providerFactory=_),E0(o,e,t.length,0),t.push(l),c.directiveStart++,c.directiveEnd++,s&&(c.providerIndexes+=1048576),r.push(_),a.push(_)}else E0(o,e,p>-1?p:g,bA(r[s?g:p],u,!s&&i));!s&&i&&y&&r[g].componentProviders++}}}function E0(e,t,r,i){const s=Qs(t),o=function Y3(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 bA(e,t,r){return r&&e.componentProviders++,e.multi.push(t)-1}function C0(e,t,r,i){for(let s=r;s{r.providersResolver=(i,s)=>function _5(e,t,r){const i=we();if(i.firstCreatePass){const s=wr(e);b0(r,i.data,i.blueprint,s,!0),b0(t,i.data,i.blueprint,s,!1)}}(i,s?s(e):e,t)}}let C5=(()=>{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=$m(0,r.type),s=i.length>0?dh([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=H({token:e,providedIn:"environment",factory:()=>new e(Z(Tn))})}}return e})();function Ah(e){mn("NgStandalone"),e.getStandaloneInjector=t=>t.get(C5).getOrCreateStandaloneInjector(e)}function DA(e,t,r,i,s,o){const a=t+r;return yt(e,a,s)?function Zr(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 MA(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)?DA(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 NA(e,t){return eh(e,t)}let WA=(()=>{class e{log(r){console.log(r)}warn(r){console.warn(r)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"platform"})}}return e})();const JA=new q(""),kh=new q("");let R0,M0=(()=>{class e{constructor(r,i,s){this._ngZone=r,this.registry=i,this._isZoneStable=!0,this._callbacks=[],this.taskTrackingZone=null,R0||(function kH(e){R0=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(N0),Z(kh))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})(),N0=(()=>{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 R0?.findTestabilityInTree(this,r,i)??null}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"platform"})}}return e})();function cu(e){return!!e&&"function"==typeof e.then}function XA(e){return!!e&&"function"==typeof e.subscribe}const O0=new q("");let eM=(()=>{class e{constructor(){this.initialized=!1,this.done=!1,this.donePromise=new Promise((r,i)=>{this.resolve=r,this.reject=i}),this.appInits=O(O0,{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(XA(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=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const Ph=new q("");function nM(e,t){return Array.isArray(t)?t.reduce(nM,e):{...e,...t}}let ar=(()=>{class e{constructor(){this._bootstrapListeners=[],this._runningTick=!1,this._destroyed=!1,this._destroyListeners=[],this._views=[],this.internalErrorHandler=O(yV),this.afterRenderManager=O(D1),this.zonelessEnabled=O(Bl),this.dirtyFlags=0,this.deferredDirtyFlags=0,this.externalTestViews=new Set,this.beforeRender=new Xe,this.afterTick=new Xe,this.componentTypes=[],this.components=[],this.isStable=O(io).hasPendingTasks.pipe(Ue(r=>!r)),this._injector=O(Tn)}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 NT;if(!this._injector.get(eM).done)throw!s&&function rs(e){const t=De(e)||Ot(e)||Gt(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 PH(e){return e.isBoundToModule}(a)?void 0:this._injector.get(po),u=a.create(Tt.NULL,[],i||a.selector,c),d=u.location.nativeElement,f=u.injector.get(JA,null);return f?.registerApplication(d),u.onDestroy(()=>{this.detachView(u.hostView),Lh(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(oh,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)BH(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})=>gf(r))?this.dirtyFlags|=2:this.dirtyFlags&=-8}attachView(r){const i=r;this._views.push(i),i.attachToAppRef(this)}detachView(r){const i=r;Lh(this._views,i),i.detachFromAppRef()}_loadComponent(r){this.attachView(r.hostView),this.tick(),this.components.push(r);const i=this._injector.get(Ph,[]);[...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),()=>Lh(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=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function Lh(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}function BH(e,t,r,i){(r||gf(e))&&Xf(e,t,r&&!i?0:1)}class VH{constructor(t,r){this.ngModuleFactory=t,this.componentFactories=r}}let iM=(()=>{class e{compileModuleSync(r){return new Wv(r)}compileModuleAsync(r){return Promise.resolve(this.compileModuleSync(r))}compileModuleAndAllComponentsSync(r){const i=this.compileModuleSync(r),o=zn(tn(r).declarations).reduce((a,c)=>{const l=De(c);return l&&a.push(new $l(l)),a},[]);return new VH(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=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),$H=(()=>{class e{constructor(){this.zone=O(Ne),this.changeDetectionScheduler=O(Ia),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=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function k0({ngZoneFactory:e,ignoreChangesOutsideZone:t,scheduleInRootZone:r}){return e??=()=>new Ne({...P0(),scheduleInRootZone:r}),[{provide:Ne,useFactory:e},{provide:Vr,multi:!0,useFactory:()=>{const i=O($H,{optional:!0});return()=>i.initialize()}},{provide:Vr,multi:!0,useFactory:()=>{const i=O(zH);return()=>{i.initialize()}}},!0===t?{provide:MT,useValue:!0}:[],{provide:Ov,useValue:r??pS}]}function P0(e){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:e?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:e?.runCoalescing??!1}}let zH=(()=>{class e{constructor(){this.subscription=new Et,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=H({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(MT,{optional:!0})??!1,this.zoneIsDefined=typeof Zone<"u"&&!!Zone.root.run,this.schedulerTickApplyArgs=[{data:{__scheduler_tick__:!0}}],this.subscriptions=new Et,this.angularZoneId=this.zoneIsDefined?this.ngZone._inner?.get(Nf):null,this.scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(O(Ov,{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 Ty||!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?mS:gS;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(Nf+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,mS(()=>{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=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const fs=new q("",{providedIn:"root",factory:()=>O(fs,Ie.Optional|Ie.SkipSelf)||function qH(){return typeof $localize<"u"&&$localize.locale||Ch}()}),Bh=new q("");function Vh(e){return!e.moduleRef}let uM=(()=>{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=[k0({ngZoneFactory:()=>function mV(e="zone.js",t){return"noop"===e?new Ty:"zone.js"===e?new Ne(t):e}(i?.ngZone,{...P0({eventCoalescing:i?.ngZoneEventCoalescing,runCoalescing:i?.ngZoneRunCoalescing}),scheduleInRootZone:s}),ignoreChangesOutsideZone:a}),{provide:Ia,useExisting:lu}],l=function D4(e,t,r){return new Gv(e,t,r,!1)}(r.moduleType,this.injector,c);return function lM(e){const t=Vh(e)?e.r3Injector:e.moduleRef.injector,r=t.get(Ne);return r.run(()=>{Vh(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)}})}),Vh(e)){const o=()=>t.destroy(),a=e.platformInjector.get(Bh);a.add(o),t.onDestroy(()=>{s.unsubscribe(),a.delete(o)})}else{const o=()=>e.moduleRef.destroy(),a=e.platformInjector.get(Bh);a.add(o),e.moduleRef.onDestroy(()=>{Lh(e.allPlatformModules,e.moduleRef),s.unsubscribe(),a.delete(o)})}return function FH(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(eM);return o.runInitializers(),o.donePromise.then(()=>{if(function h$(e){"string"==typeof e&&(wx=e.toLowerCase().replace(/_/g,"-"))}(t.get(fs,Ch)||Ch),Vh(e)){const c=t.get(ar);return void 0!==e.rootComponent&&c.bootstrap(e.rootComponent),c}return function YH(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=nM({},i);return function jH(e,t,r){const i=new Wv(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(Bh,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(Tt))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"platform"})}}return e})(),hs=null;const dM=new q("");function fM(e,t,r=[]){const i=`Platform: ${t}`,s=new q(i);return(o=[])=>{let a=F0();if(!a||a.injector.get(dM,!1)){const c=[...r,...o,{provide:s,useValue:!0}];e?e(c):function JH(e){if(hs&&!hs.get(dM,!1))throw new A(400,!1);(function tM(){!function zF(e){TC=e}(()=>{throw new A(600,!1)})})(),hs=e;const t=e.get(uM);(function pM(e){e.get(jS,null)?.forEach(r=>r())})(e)}(function hM(e=[],t){return Tt.create({name:t,providers:[{provide:qm,useValue:"platform"},{provide:Bh,useValue:new Set([()=>hs=null])},...e]})}(c,i))}return function XH(){const t=F0();if(!t)throw new A(401,!1);return t}()}}function F0(){return hs?.get(uM)??null}let uu=(()=>{class e{static{this.__NG_ELEMENT_ID__=tz}}return e})();function tz(e){return function nz(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 _M{constructor(){}supports(t){return fh(t)}create(t){return new az(t)}}const oz=(e,t)=>t;class az{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||oz}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 cz(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 wM),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 wM),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 cz{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 lz{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 wM{constructor(){this.map=new Map}put(t){const r=t.trackById;let i=this.map.get(r);i||(i=new lz,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 bM(e,t,r){const i=e.previousIndex;if(null===i)return i;let s=0;return r&&i{class e{static{this.\u0275prov=H({token:e,providedIn:"root",factory:CM})}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||CM()),deps:[[e,new Xd,new Jd]]}}find(r){const i=this.factories.find(s=>s.supports(r));if(null!=i)return i;throw new A(901,!1)}}return e})();const pz=fM(null,"core",[]);let gz=(()=>{class e{constructor(r){}static{this.\u0275fac=function(i){return new(i||e)(Z(ar))}}static{this.\u0275mod=Rt({type:e})}static{this.\u0275inj=Dt({})}}return e})();function pu(e,t){mn("NgSignals");const r=function jF(e){const t=Object.create($F);t.computation=e;const r=()=>{if(wC(t),lm(t),t.value===Bd)throw t.error;return t.value};return r[mr]=t,r}(e);return t?.equal&&(r[mr].equal=t.equal),r}function Xr(e){const t=_e(null);try{return e()}finally{_e(t)}}let WM=null;function ps(){return WM}class e7{}const on=new q("");let q0=(()=>{class e{historyGo(r){throw new Error("")}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:()=>O(n7),providedIn:"platform"})}}return e})();const t7=new q("");let n7=(()=>{class e extends q0{constructor(){super(),this._doc=O(on),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=H({token:e,factory:()=>new e,providedIn:"platform"})}}return e})();function G0(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 ZM(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=H({token:e,factory:()=>O(QM),providedIn:"root"})}}return e})();const KM=new q("");let QM=(()=>{class e extends bo{constructor(r,i){super(),this._platformLocation=r,this._removeListenerFns=[],this._baseHref=i??this._platformLocation.getBaseHrefFromDOM()??O(on).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 G0(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)(Z(q0),Z(KM,8))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),r7=(()=>{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=G0(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)(Z(q0),Z(KM,8))}}static{this.\u0275prov=H({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 o7(e){if(new RegExp("^(https?:)?//").test(e)){const[,r]=e.split(/\/\/[^\/]+/);return r}return e}(ZM(YM(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 s7(e,t){if(!e||!t.startsWith(e))return t;const r=t.substring(e.length);return""===r||["/",";","?","#"].includes(r[0])?r:t}(this._basePath,YM(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=G0}static{this.stripTrailingSlash=ZM}static{this.\u0275fac=function(i){return new(i||e)(Z(bo))}}static{this.\u0275prov=H({token:e,factory:()=>function i7(){return new gu(Z(bo))}(),providedIn:"root"})}}return e})();function YM(e){return e.replace(/\/index.html$/,"")}class W7{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 r_=(()=>{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 W7(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),cN(c,s)}});for(let s=0,o=i.length;s{cN(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($0))}}static{this.\u0275dir=de({type:e,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"},standalone:!0})}}return e})();function cN(e,t){e.context.$implicit=t.item}let op=(()=>{class e{constructor(r,i){this._viewContainer=r,this._context=new Z7,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){lN("ngIfThen",r),this._thenTemplateRef=r,this._thenViewRef=null,this._updateView()}set ngIfElse(r){lN("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 Z7{constructor(){this.$implicit=null,this.ngIf=null}}function lN(e,t){if(t&&!t.createEmbeddedView)throw new Error(`${e} must be a TemplateRef, but received '${Nt(t)}'.`)}let gs=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Rt({type:e})}static{this.\u0275inj=Dt({})}}return e})();const fN="browser";function hN(e){return"server"===e}let b9=(()=>{class e{static{this.\u0275prov=H({token:e,providedIn:"root",factory:()=>function w9(e){return e===fN}(O(os))?new E9(O(on),window):new D9})}}return e})();class E9{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 C9(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 D9{setOffset(t){}getScrollPosition(){return[0,0]}scrollToPosition(t){}scrollToAnchor(t){}setHistoryScrollRestoration(t){}}class X9 extends e7{constructor(){super(...arguments),this.supportsDOMEvents=!0}}class d_ extends X9{static makeCurrent(){!function Xz(e){WM??=e}(new d_)}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 eq(){return _u=_u||document.querySelector("base"),_u?_u.getAttribute("href"):null}();return null==r?null:function tq(e){return new URL(e,document.baseURI).pathname}(r)}resetBaseElement(){_u=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return function z7(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,rq=(()=>{class e{build(){return new XMLHttpRequest}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})();const f_=new q("");let DN=(()=>{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(f_),Z(Ne))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})();class SN{constructor(t){this._doc=t}}const h_="ng-app-id";let IN=(()=>{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=hN(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[${h_}="${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(h_),o;{const a=this.doc.createElement("style");return this.nonce&&a.setAttribute("nonce",this.nonce),a.textContent=i,this.platformIsServer&&a.setAttribute(h_,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(on),Z(ya),Z(HS,8),Z(os))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})();const p_={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"},g_=/%COMP%/g,aq=new q("",{providedIn:"root",factory:()=>!0});function xN(e,t){return t.map(r=>r.replace(g_,e))}let m_=(()=>{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=hN(c),this.defaultRenderer=new y_(r,a,l,this.platformIsServer)}createRenderer(r,i){if(!r||!i)return this.defaultRenderer;this.platformIsServer&&i.encapsulation===yr.ShadowDom&&(i={...i,encapsulation:yr.Emulated});const s=this.getOrCreateRenderer(r,i);return s instanceof MN?s.applyToHost(r):s instanceof v_&&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 yr.Emulated:o=new MN(l,u,i,this.appId,d,a,c,f);break;case yr.ShadowDom:return new dq(l,u,r,i,a,c,this.nonce,f);default:o=new v_(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(DN),Z(IN),Z(ya),Z(aq),Z(on),Z(os),Z(Ne),Z(HS))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})();class y_{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(p_[r]||r,t):this.doc.createElement(t)}createComment(t){return this.doc.createComment(t)}createText(t){return this.doc.createTextNode(t)}appendChild(t,r){(AN(t)?t.content:t).appendChild(r)}insertBefore(t,r,i){t&&(AN(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=p_[s];o?t.setAttributeNS(o,r,i):t.setAttribute(r,i)}else t.setAttribute(r,i)}removeAttribute(t,r,i){if(i){const s=p_[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 AN(e){return"TEMPLATE"===e.tagName&&void 0!==e.content}class dq extends y_{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=xN(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 v_ extends y_{constructor(t,r,i,s,o,a,c,l){super(t,o,a,c),this.sharedStylesHost=r,this.removeStylesOnCompDestroy=s,this.styles=l?xN(l,i.styles):i.styles}applyStyles(){this.sharedStylesHost.addStyles(this.styles)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles)}}class MN extends v_{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 cq(e){return"_ngcontent-%COMP%".replace(g_,e)}(u),this.hostAttr=function lq(e){return"_nghost-%COMP%".replace(g_,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 fq=(()=>{class e extends SN{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(on))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})();const NN=["alt","control","meta","shift"],hq={"\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"},pq={alt:e=>e.altKey,control:e=>e.ctrlKey,meta:e=>e.metaKey,shift:e=>e.shiftKey};let gq=(()=>{class e extends SN{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."),NN.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=hq[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"),NN.forEach(a=>{a!==s&&(0,pq[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(on))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})();const ON=[{provide:os,useValue:fN},{provide:jS,useValue:function mq(){d_.makeCurrent()},multi:!0},{provide:on,useFactory:function vq(){return function VV(e){Oy=e}(document),document},deps:[]}],_q=fM(pz,"browser",ON),wq=new q(""),kN=[{provide:kh,useClass:class nq{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:JA,useClass:M0,deps:[Ne,N0,kh]},{provide:M0,useClass:M0,deps:[Ne,N0,kh]}],PN=[{provide:qm,useValue:"root"},{provide:nr,useFactory:function yq(){return new nr},deps:[]},{provide:f_,useClass:fq,multi:!0,deps:[on,Ne,os]},{provide:f_,useClass:gq,multi:!0,deps:[on]},m_,IN,DN,{provide:oh,useExisting:m_},{provide:class S9{},useClass:rq,deps:[]},[]];let LN=(()=>{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(wq,12))}}static{this.\u0275mod=Rt({type:e})}static{this.\u0275inj=Dt({providers:[...PN,...kN],imports:[gs,gz]})}}return e})(),bq=(()=>{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(on))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),VN=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:function(i){let s=null;return s=i?new(i||e):Z(Sq),s},providedIn:"root"})}}return e})(),Sq=(()=>{class e extends VN{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 qr(i,"HTML")?$n(i):fI(this._doc,String(i)).toString();case Hn.STYLE:return qr(i,"Style")?$n(i):i;case Hn.SCRIPT:if(qr(i,"Script"))return $n(i);throw new A(5200,!1);case Hn.URL:return qr(i,"URL")?$n(i):$f(String(i));case Hn.RESOURCE_URL:if(qr(i,"ResourceURL"))return $n(i);throw new A(5201,!1);default:throw new A(5202,!1)}}bypassSecurityTrustHtml(r){return function o8(e){return new e8(e)}(r)}bypassSecurityTrustStyle(r){return function a8(e){return new t8(e)}(r)}bypassSecurityTrustScript(r){return function c8(e){return new n8(e)}(r)}bypassSecurityTrustUrl(r){return function l8(e){return new r8(e)}(r)}bypassSecurityTrustResourceUrl(r){return function u8(e){return new i8(e)}(r)}static{this.\u0275fac=function(i){return new(i||e)(Z(on))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),__=(()=>{class e{constructor(){this.wannachatStatusDefaultTimeoutInSeconds=20}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})(),Iq=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Rt({type:e})}static{this.\u0275inj=Dt({providers:[__],imports:[gs]})}}return e})();function UN(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){UN(o,i,s,a,c,"next",l)}function c(l){UN(o,i,s,a,c,"throw",l)}a(void 0)})}}function w_(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function b_(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 wu(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 E_="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,C_=e=>e instanceof Uint8Array,D_=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),ei=(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 bu(e){if("string"==typeof e&&(e=function Mq(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),!C_(e))throw new Error("expected Uint8Array, got "+typeof e);return e}class HN{clone(){return this._cloneInto()}}function Oq(e){const t=i=>e().update(bu(i)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function zN(e=32){if(E_&&"function"==typeof E_.getRandomValues)return E_.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}class Pq extends HN{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=D_(this.buffer)}update(t){wu(this);const{view:r,buffer:i,blockLen:s}=this,o=(t=bu(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=D_(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,Fq=(e,t,r)=>e&t^e&r^t&r,Bq=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]),ms=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ys=new Uint32Array(64);class qN extends Pq{constructor(){super(64,32,8,!1),this.A=0|ms[0],this.B=0|ms[1],this.C=0|ms[2],this.D=0|ms[3],this.E=0|ms[4],this.F=0|ms[5],this.G=0|ms[6],this.H=0|ms[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)ys[f]=t.getUint32(r,!1);for(let f=16;f<64;f++){const h=ys[f-15],p=ys[f-2],g=ei(h,7)^ei(h,18)^h>>>3,m=ei(p,17)^ei(p,19)^p>>>10;ys[f]=m+ys[f-7]+g+ys[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+(ei(c,6)^ei(c,11)^ei(c,25))+Lq(c,l,u)+Bq[f]+ys[f]|0,m=(ei(i,2)^ei(i,13)^ei(i,22))+Fq(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(){ys.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const I_=Oq(()=>new qN),dp=(BigInt(0),BigInt(1)),Vq=BigInt(2),fp=e=>e instanceof Uint8Array,Uq=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function nc(e){if(!fp(e))throw new Error("Uint8Array expected");let t="";for(let r=0;ri+s.length,0));let r=0;return e.forEach(i=>{if(!fp(i))throw new Error("Uint8Array expected");t.set(i,r),r+=i.length}),t}const A_=e=>(Vq<new Uint8Array(e),ZN=e=>Uint8Array.from(e);function KN(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=M_(e),s=M_(e),o=0;const a=()=>{i.fill(1),s.fill(0),o=0},c=(...f)=>r(s,i,...f),l=(f=M_())=>{s=c(ZN([0]),f),i=c(),0!==f.length&&(s=c(ZN([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 $q={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 Eu(e,t,r={}){const i=(s,o,a)=>{const c=$q[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 Vt=BigInt(0),Qe=BigInt(1),_s=BigInt(2),Hq=BigInt(3),N_=BigInt(4),QN=BigInt(5),YN=BigInt(8);function Ut(e,t){const r=e%t;return r>=Vt?r:t+r}function Gq(e,t,r){if(r<=Vt||t 0");if(r===Qe)return Vt;let i=Qe;for(;t>Vt;)t&Qe&&(i=i*e%r),e=e*e%r,t>>=Qe;return i}function ur(e,t,r){let i=e;for(;t-- >Vt;)i*=i,i%=r;return i}function hp(e,t){if(e===Vt||t<=Vt)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=Ut(e,t),i=t,s=Vt,o=Qe,a=Qe,c=Vt;for(;r!==Vt;){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!==Qe)throw new Error("invert: does not exist");return Ut(s,t)}BigInt(9),BigInt(16);const Kq=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function R_(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function JN(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 XN(e){const t=JN(e);return t+Math.ceil(t/2)}class eR extends HN{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,function jN(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");w_(e.outputLen),w_(e.blockLen)}(t);const i=bu(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 eR(e,t).update(r).digest();tR.create=(e,t)=>new eR(e,t);const tG=BigInt(0),O_=BigInt(1);function nR(e){return function Qq(e){Eu(e,Kq.reduce((i,s)=>(i[s]="function",i),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"}))}(e.Fp),Eu(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...R_(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const{Ph:iG,aT:sG}=Wc,Do={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=Do;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:iG(i),l:e.subarray(r+2)}},toSig(e){const{Err:t}=Do,r="string"==typeof e?sG(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}=Do._parseInt(r.subarray(2)),{d:a,l:c}=Do._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}`}},Tr=BigInt(0),pt=BigInt(1),pp=(BigInt(2),BigInt(3));function cG(e){const t=function aG(e){const t=nR(e);return Eu(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(I){return Ut(I,i)}function l(I){return hp(I,i)}const{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:h}=function oG(e){const t=function rG(e){const t=nR(e);Eu(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 Co(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&&Trr.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(an("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,pp),{px:v,py:w,pz:b}=this;let D=r.ZERO,C=r.ZERO,S=r.ZERO,T=r.mul(v,v),P=r.mul(w,w),$=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(_,$),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),$=r.mul(m,$),V=r.sub(T,$),V=r.mul(m,V),V=r.add(V,S),S=r.add(T,T),T=r.add(S,T),T=r.add(T,$),T=r.mul(T,V),C=r.add(C,T),$=r.mul(w,b),$=r.add($,$),T=r.mul($,V),D=r.sub(D,T),S=r.mul($,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,T=r.ZERO;const P=t.a,$=r.mul(t.b,pp);let V=r.mul(y,w),j=r.mul(_,b),X=r.mul(v,D),L=r.add(y,_),I=r.add(w,b);L=r.mul(L,I),I=r.add(V,j),L=r.sub(L,I),I=r.add(y,v);let E=r.add(w,D);return I=r.mul(I,E),E=r.add(V,X),I=r.sub(I,E),E=r.add(_,v),C=r.add(b,D),E=r.mul(E,C),C=r.add(j,X),E=r.sub(E,C),T=r.mul(P,I),C=r.mul($,X),T=r.add(C,T),C=r.sub(j,T),T=r.add(j,T),S=r.mul(C,T),j=r.add(V,V),j=r.add(j,V),X=r.mul(P,X),I=r.mul($,I),j=r.add(j,X),X=r.sub(V,X),X=r.mul(P,X),I=r.add(I,X),V=r.mul(j,I),S=r.add(S,V),V=r.mul(E,I),C=r.mul(L,C),C=r.sub(C,V),V=r.mul(L,j),T=r.mul(E,T),T=r.add(T,V),new f(C,S,T)}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===Tr)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,T=this;for(;w>Tr||D>Tr;)w&pt&&(C=C.add(T)),D&pt&&(S=S.add(T)),T=T.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:T,f:P}=this.wNAF(D),{p:$,f:V}=this.wNAF(S);T=p.constTimeNegate(b,T),$=p.constTimeNegate(C,$),$=new f(r.mul($.px,w.beta),$.py,$.pz),_=T.add($),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!==Tr&&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 nc(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 nG(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>tG;)o&O_&&(a=a.add(c)),c=c.double(),o>>=O_;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+=O_);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(I,E,x){const R=E.toAffine(),M=r.toBytes(R.x),G=Co;return x?G(Uint8Array.from([E.hasEvenY()?2:3]),M):G(Uint8Array.from([4]),M,r.toBytes(R.y))},fromBytes(I){const E=I.length,x=I[0],R=I.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(I){return Trnc(vs(I,t.nByteLength));function g(I){return I>i>>pt}const y=(I,E,x)=>Nn(I.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=an("compactSignature",E,2*x),new _(y(E,0,x),y(E,x,2*x))}static fromDER(E){const{r:x,s:R}=Do.toSig(an("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,G=S(an("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),gt=c(-G*ue),ht=c(R*ue),Ae=u.BASE.multiplyAndAddUnsafe(Se,gt,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 rc(this.toDERHex())}toDERHex(){return Do.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return rc(this.toCompactHex())}toCompactHex(){return p(this.r)+p(this.s)}}const v={isValidPrivateKey(I){try{return d(I),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const I=XN(t.n);return function eG(e,t,r=!1){const i=e.length,s=JN(t),o=XN(t);if(i<16||i1024)throw new Error(`expected ${o}-1024 bytes of input, got ${i}`);const c=Ut(r?Nn(e):T_(e),t-Qe)+Qe;return r?x_(c,s):vs(c,s)}(t.randomBytes(I),t.n)},precompute:(I=8,E=u.BASE)=>(E._setWindowSize(I),E.multiply(BigInt(3)),E)};function b(I){const E=I instanceof Uint8Array,x="string"==typeof I,R=(E||x)&&I.length;return E?R===s||R===o:x?R===2*s||R===2*o:I instanceof u}const C=t.bits2int||function(I){const E=Nn(I),x=8*I.length-t.nBitLength;return x>0?E>>BigInt(x):E},S=t.bits2int_modN||function(I){return c(C(I))},T=A_(t.nBitLength);function P(I){if("bigint"!=typeof I)throw new Error("bigint expected");if(!(Tr<=I&&IOe in x))throw new Error("sign() legacy options not supported");const{hash:R,randomBytes:M}=t;let{lowS:G,prehash:J,extraEntropy:ee}=x;null==G&&(G=!0),I=an("msgHash",I),J&&(I=an("prehashed msgHash",R(I)));const Se=S(I),ue=d(E),gt=[P(ue),P(Se)];if(null!=ee){const Oe=!0===ee?M(r.BYTES):ee;gt.push(an("extraEntropy",Oe))}const ht=Co(...gt),Ae=Se;return{seed:ht,k2sig:function ot(Oe){const Ln=C(Oe);if(!h(Ln))return;const Xt=l(Ln),en=u.BASE.multiply(Ln).toAffine(),Fr=c(en.x);if(Fr===Tr)return;const Ko=c(Xt*c(Ae+Fr*ue));if(Ko===Tr)return;let Rd=(en.x===Fr?0:2)|Number(en.y&pt),BF=Ko;return G&&g(Ko)&&(BF=function m(I){return g(I)?c(-I):I}(Ko),Rd^=1),new _(Fr,BF,Rd)}}}(I,E,x);return KN(t.hash.outputLen,t.nByteLength,t.hmac)(R,M)},verify:function L(I,E,x,R=j){const M=I;if(E=an("msgHash",E),x=an("publicKey",x),"strict"in R)throw new Error("options.strict was renamed to lowS");const{lowS:G,prehash:J}=R;let ee,Se;try{if("string"==typeof M||M instanceof Uint8Array)try{ee=_.fromDER(M)}catch(en){if(!(en instanceof Do.Err))throw en;ee=_.fromCompact(M)}else{if("object"!=typeof M||"bigint"!=typeof M.r||"bigint"!=typeof M.s)throw new Error("PARSE");{const{r:en,s:Fr}=M;ee=new _(en,Fr)}}Se=u.fromHex(x)}catch(en){if("PARSE"===en.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(G&&ee.hasHighS())return!1;J&&(E=t.hash(E));const{r:ue,s:gt}=ee,ht=S(E),Ae=l(gt),ot=c(ht*Ae),Oe=c(ue*Ae),Ln=u.BASE.multiplyAndAddUnsafe(Se,ot,Oe)?.toAffine();return!!Ln&&c(Ln.x)===ue},ProjectivePoint:u,Signature:_,utils:v}}function uG(e){return{hash:e,hmac:(t,...r)=>tR(e,t,function Nq(...e){const t=new Uint8Array(e.reduce((i,s)=>i+s.length,0));let r=0;return e.forEach(i=>{if(!C_(i))throw new Error("Uint8Array expected");t.set(i,r),r+=i.length}),t}(...r)),randomBytes:zN}}BigInt(4);const gp=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),mp=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),iR=BigInt(1),yp=BigInt(2),sR=(e,t)=>(e+t/yp)/t;function oR(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,yp,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,yp,t);if(!k_.eql(k_.sqr(C),e))throw new Error("Cannot find square root");return C}const k_=function Xq(e,t,r=!1,i={}){if(e<=Vt)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:o}=R_(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=function Zq(e){if(e%N_===Hq){const t=(e+Qe)/N_;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%YN===QN){const t=(e-QN)/YN;return function(i,s){const o=i.mul(s,_s),a=i.pow(o,t),c=i.mul(s,a),l=i.mul(i.mul(c,_s),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 Wq(e){const t=(e-Qe)/_s;let r,i,s;for(r=e-Qe,i=0;r%_s===Vt;r/=_s,i++);for(s=_s;sUt(l,e),isValid:l=>{if("bigint"!=typeof l)throw new Error("Invalid field element: expected bigint, got "+typeof l);return Vt<=l&&ll===Vt,isOdd:l=>(l&Qe)===Qe,neg:l=>Ut(-l,e),eql:(l,u)=>l===u,sqr:l=>Ut(l*l,e),add:(l,u)=>Ut(l+u,e),sub:(l,u)=>Ut(l-u,e),mul:(l,u)=>Ut(l*u,e),pow:(l,u)=>function Yq(e,t,r){if(r 0");if(r===Vt)return e.ONE;if(r===Qe)return t;let i=e.ONE,s=t;for(;r>Vt;)r&Qe&&(i=e.mul(i,s)),s=e.sqr(s),r>>=Qe;return i}(c,l,u),div:(l,u)=>Ut(l*hp(u,e),e),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>hp(l,e),sqrt:i.sqrt||(l=>a(c,l)),invertBatch:l=>function Jq(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?x_(l,o):vs(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return r?T_(l):Nn(l)}});return Object.freeze(c)}(gp,void 0,void 0,{sqrt:oR}),ic=function dG(e,t){const r=i=>cG({...e,...uG(i)});return Object.freeze({...r(t),create:r})}({a:BigInt(0),b:BigInt(7),Fp:k_,n:mp,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=mp,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-iR*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=BigInt("0x100000000000000000000000000000000"),c=sR(o*e,t),l=sR(-i*e,t);let u=Ut(e-c*r-l*s,t),d=Ut(-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}}}},I_),vp=BigInt(0),aR=e=>"bigint"==typeof e&&vps.charCodeAt(0)));r=Co(i,i),cR[e]=r}return I_(Co(r,...t))}const P_=e=>e.toRawBytes(!0).slice(1),L_=e=>vs(e,32),F_=e=>Ut(e,gp),Cu=e=>Ut(e,mp),B_=ic.ProjectivePoint;function V_(e){let t=ic.utils.normPrivateKeyToScalar(e),r=B_.fromPrivateKey(t);return{scalar:r.hasEvenY()?t:Cu(-t),bytes:P_(r)}}function lR(e){if(!aR(e))throw new Error("bad x: need 0 < x < p");const t=F_(e*e);let i=oR(F_(t*e+BigInt(7)));i%yp!==vp&&(i=F_(-i));const s=new B_(e,i,iR);return s.assertValidity(),s}function uR(...e){return Cu(Nn(_p("BIP0340/challenge",...e)))}function dR(e,t,r){const i=an("signature",e,64),s=an("message",t),o=an("publicKey",r,32);try{const a=lR(Nn(o)),c=Nn(i.subarray(0,32));if(!aR(c))return!1;const l=Nn(i.subarray(32,64));if(!(e=>"bigint"==typeof e&&vpB_.BASE.multiplyAndAddUnsafe(e,t,r))(a,l,Cu(-u));return!(!d||!d.hasEvenY()||d.toAffine().x!==c)}catch{return!1}}const Du={getPublicKey:function pG(e){return V_(e).bytes},sign:function gG(e,t,r=zN(32)){const i=an("message",e),{bytes:s,scalar:o}=V_(t),a=an("auxRand",r,32),c=L_(o^Nn(_p("BIP0340/aux",a))),l=_p("BIP0340/nonce",c,s,i),u=Cu(Nn(l));if(u===vp)throw new Error("sign failed: k is zero");const{bytes:d,scalar:f}=V_(u),h=uR(d,s,i),p=new Uint8Array(64);if(p.set(d,0),p.set(L_(Cu(f+h*o)),32),!dR(p,i,s))throw new Error("sign: Invalid signature produced");return p},verify:dR,utils:{randomPrivateKey:ic.utils.randomPrivateKey,lift_x:lR,pointToBytes:P_,numberToBytesBE:vs,bytesToNumberBE:Nn,taggedHash:_p,mod:Ut}},U_="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,j_=e=>e instanceof Uint8Array,$_=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),ti=(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 mG=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Rn(e){if(!j_(e))throw new Error("Uint8Array expected");let t="";for(let r=0;ri+s.length,0));let r=0;return e.forEach(i=>{if(!j_(i))throw new Error("Uint8Array expected");t.set(i,r),r+=i.length}),t}class fR{clone(){return this._cloneInto()}}function hR(e){const t=i=>e().update(So(i)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function pR(e=32){if(U_&&"function"==typeof U_.getRandomValues)return U_.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function z_(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function gR(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 ni={number:z_,bool:function wG(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)},bytes:gR,hash:function bG(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");z_(e.outputLen),z_(e.blockLen)},exists:function EG(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 CG(e,t){gR(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=$_(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,TG=(e,t,r)=>e&t^e&r^t&r,xG=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]),bs=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Es=new Uint32Array(64);class mR extends SG{constructor(){super(64,32,8,!1),this.A=0|bs[0],this.B=0|bs[1],this.C=0|bs[2],this.D=0|bs[3],this.E=0|bs[4],this.F=0|bs[5],this.G=0|bs[6],this.H=0|bs[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)Es[f]=t.getUint32(r,!1);for(let f=16;f<64;f++){const h=Es[f-15],p=Es[f-2],g=ti(h,7)^ti(h,18)^h>>>3,m=ti(p,17)^ti(p,19)^p>>>10;Es[f]=m+Es[f-7]+g+Es[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+(ti(c,6)^ti(c,11)^ti(c,25))+IG(c,l,u)+xG[f]+Es[f]|0,m=(ti(i,2)^ti(i,13)^ti(i,22))+TG(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(){Es.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class AG extends mR{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 Su=hR(()=>new mR);function Io(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function xr(...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 ri(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(Io(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 ii(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 Iu(e,t="="){if(Io(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 yR(e){if("function"!=typeof e)throw new Error("normalize fn should be function");return{encode:t=>t,decode:t=>e(t)}}function vR(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(Io(a),a<0||a>=t)throw new Error(`Wrong integer: ${a}`)});;){let a=0,c=!0;for(let l=i;lnew AG);const _R=(e,t)=>t?_R(t,e%t):e,bp=(e,t)=>e+(t-_R(e,t));function q_(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(bp(t,r)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${bp(t,r)}`);let s=0,o=0;const a=2**r-1,c=[];for(const l of e){if(Io(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 Li(e,t=!1){if(Io(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(bp(8,e)>32||bp(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 q_(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(q_(r,e,8,t))}}}function bR(e){if("function"!=typeof e)throw new Error("unsafeWrapper fn should be function");return function(...t){try{return e.apply(null,t)}catch{}}}xr(Li(4),ri("0123456789ABCDEF"),ii("")),xr(Li(5),ri("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Iu(5),ii("")),xr(Li(5),ri("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Iu(5),ii("")),xr(Li(5),ri("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),ii(""),yR(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const Fi=xr(Li(6),ri("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Iu(6),ii("")),G_=(xr(Li(6),ri("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Iu(6),ii("")),e=>xr(function wR(e){return Io(e),{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return vR(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(vR(t,e,256))}}}(58),ri(e),ii(""))),W_=(G_("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),G_("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),G_("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"),xr(ri("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),ii(""))),DR=[996825010,642813549,513874426,1027748829,705979059];function Tu(e){const t=e>>25;let r=(33554431&e)<<5;for(let i=0;i>i&1)&&(r^=DR[i]);return r}function SR(e,t,r=1){const i=e.length;let s=1;for(let o=0;o126)throw new Error(`Invalid prefix (${e})`);s=Tu(s)^a>>5}s=Tu(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=W_.decode(m).slice(0,-6),_=SR(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${W_.encode(f)}${SR(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:bR(c),fromWords:i,fromWordsUnsafe:o,toWords:s}}const oc=IR("bech32");function ac(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function Z_(e){if("boolean"!=typeof e)throw new Error(`boolean expected, not ${e}`)}function xR(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function xe(e,...t){if(!xR(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 To(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 Dp(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 Te=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),cc=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 Cs(e){if("string"==typeof e)e=function $G(e){if("string"!=typeof e)throw new Error("string expected, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e);else{if(!xR(e))throw new Error("Uint8Array expected, got "+typeof e);e=e.slice()}return e}function Sp(e,t){if(e.length!==t.length)return!1;let r=0;for(let i=0;i(Object.assign(t,e),t);function xo(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 Y_=new Uint8Array(16),si=Te(Y_),qG=(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 MR{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=Cs(t),16);const i=cc(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}=qG(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:T,s3:P}=l[u*g+b];y^=C,_^=S,v^=T,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=Cs(t),To(this);const r=Te(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=Cs(t)).slice());super(i,r),i.fill(0)}update(t){t=Cs(t),To(this);const r=Te(t),i=t.length%16,s=Math.floor(t.length/16);for(let o=0;oe(s,i.length).update(Cs(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}NR((e,t)=>new MR(e,t)),NR((e,t)=>new ZG(e,t)),new Uint8Array(16);const QG=283;function X_(e){return e<<1^QG&-(e>>7)}function lc(e,t){let r=0;for(;t>0;t>>=1)r^=e&-(1&t),e=X_(e);return r}const ew=(()=>{let e=new Uint8Array(256);for(let r=0,i=1;r<256;r++,i^=X_(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})(),YG=ew.map((e,t)=>ew.indexOf(t)),JG=e=>e<<24|e>>>8,tw=e=>e<<8|e>>>24;function OR(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(tw),s=i.map(tw),o=s.map(tw),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 nw=OR(ew,e=>lc(e,3)<<24|e<<16|e<<8|lc(e,2)),kR=OR(YG,e=>lc(e,11)<<24|lc(e,13)<<16|lc(e,9)<<8|lc(e,14)),XG=(()=>{const e=new Uint8Array(16);for(let t=0,r=1;t<16;t++,r=X_(r))e[t]=r;return e})();function Ui(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}=nw,i=Te(e),s=i.length,o=c=>oi(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 Ss(e,t,r,i,s,o){return e[r<<8&65280|i>>>8&255]^t[s>>>8&65280|o>>>24&255]}function oi(e,t,r,i,s){return e[255&t|65280&r]|e[i>>>16&255|s>>>16&65280]<<16}function On(e,t,r,i,s){const{sbox2:o,T01:a,T23:c}=nw;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=Ui(t),{b:l,o:u,out:d}=function FR(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=Te(e);if(t){let l=16-s;l||(l=16),i+=l}const a=uc(i,r);return{b:o,o:Te(a),out:a}}(o,s,a),f=Te(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}=On(c,h,p,g,m)),u[y++]=h,u[y++]=p,u[y++]=g,u[y++]=m;if(s){const _=function VR(e){const t=new Uint8Array(16),r=Te(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}=On(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 LR(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 rw(e){const t=Ui(e),r=t.slice(),i=t.length,{sbox2:s}=nw,{T0:o,T1:a,T2:c,T3:l}=kR;for(let u=0;u>>8&255]^c[f>>>16&255]^l[f>>>24]}return r}(t),l=Te(r),u=uc(o.length,a),d=Te(o),f=Te(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:T}=Tp(c,h,p,g,m);f[y++]=D^_,f[y++]=C^v,f[y++]=S^w,f[y++]=T^b}return c.fill(0),function BR(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 nW{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=Cs(t),32);const r=Yt(t,0),i=Yt(t,2),s=Yt(t,4),o=Yt(t,6),a=Yt(t,8),c=Yt(t,10),l=Yt(t,12),u=Yt(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]=Yt(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],_=Yt(t,r+0),v=Yt(t,r+2),w=Yt(t,r+4),b=Yt(t,r+6),D=Yt(t,r+8),C=Yt(t,r+10),S=Yt(t,r+12),T=Yt(t,r+14);let P=o[0]+(8191&_),$=o[1]+(8191&(_>>>13|v<<3)),V=o[2]+(8191&(v>>>10|w<<6)),j=o[3]+(8191&(w>>>7|b<<9)),X=o[4]+(8191&(b>>>4|D<<12)),L=o[5]+(D>>>1&8191),I=o[6]+(8191&(D>>>14|C<<2)),E=o[7]+(8191&(C>>>11|S<<5)),x=o[8]+(8191&(S>>>8|T<<8)),R=o[9]+(T>>>5|s),M=0,G=M+P*c+$*(5*y)+V*(5*m)+j*(5*g)+X*(5*p);M=G>>>13,G&=8191,G+=L*(5*h)+I*(5*f)+E*(5*d)+x*(5*u)+R*(5*l),M+=G>>>13,G&=8191;let J=M+P*l+$*c+V*(5*y)+j*(5*m)+X*(5*g);M=J>>>13,J&=8191,J+=L*(5*p)+I*(5*h)+E*(5*f)+x*(5*d)+R*(5*u),M+=J>>>13,J&=8191;let ee=M+P*u+$*l+V*c+j*(5*y)+X*(5*m);M=ee>>>13,ee&=8191,ee+=L*(5*g)+I*(5*p)+E*(5*h)+x*(5*f)+R*(5*d),M+=ee>>>13,ee&=8191;let Se=M+P*d+$*u+V*l+j*c+X*(5*y);M=Se>>>13,Se&=8191,Se+=L*(5*m)+I*(5*g)+E*(5*p)+x*(5*h)+R*(5*f),M+=Se>>>13,Se&=8191;let ue=M+P*f+$*d+V*u+j*l+X*c;M=ue>>>13,ue&=8191,ue+=L*(5*y)+I*(5*m)+E*(5*g)+x*(5*p)+R*(5*h),M+=ue>>>13,ue&=8191;let gt=M+P*h+$*f+V*d+j*u+X*l;M=gt>>>13,gt&=8191,gt+=L*c+I*(5*y)+E*(5*m)+x*(5*g)+R*(5*p),M+=gt>>>13,gt&=8191;let ht=M+P*p+$*h+V*f+j*d+X*u;M=ht>>>13,ht&=8191,ht+=L*l+I*c+E*(5*y)+x*(5*m)+R*(5*g),M+=ht>>>13,ht&=8191;let Ae=M+P*g+$*p+V*h+j*f+X*d;M=Ae>>>13,Ae&=8191,Ae+=L*u+I*l+E*c+x*(5*y)+R*(5*m),M+=Ae>>>13,Ae&=8191;let ot=M+P*m+$*g+V*p+j*h+X*f;M=ot>>>13,ot&=8191,ot+=L*d+I*u+E*l+x*c+R*(5*y),M+=ot>>>13,ot&=8191;let Oe=M+P*y+$*m+V*g+j*p+X*h;M=Oe>>>13,Oe&=8191,Oe+=L*f+I*d+E*u+x*l+R*c,M+=Oe>>>13,Oe&=8191,M=(M<<2)+M|0,M=M+G|0,G=8191&M,M>>>=13,J+=M,o[0]=G,o[1]=J,o[2]=ee,o[3]=Se,o[4]=ue,o[5]=gt,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){To(this);const{buffer:r,blockLen:i}=this,s=(t=Cs(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 iW=function rW(e){const t=(i,s)=>e(s).update(Cs(i)).digest(),r=e(new Uint8Array(32));return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=i=>e(i),t}(e=>new nW(e)),HR=e=>Uint8Array.from(e.split("").map(t=>t.charCodeAt(0))),sW=HR("expand 16-byte k"),oW=HR("expand 32-byte k"),aW=Te(sW),zR=Te(oW);function Q(e,t){return e<>>32-t}function iw(e){return e.byteOffset%4==0}zR.slice();const qR=2**32-1,GR=new Uint32Array;function xu(e,t){const{allowShortKeys:r,extendNonceFn:i,counterLength:s,counterRight:o,rounds:a}=function HG(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 ac(s),ac(a),Z_(o),Z_(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),ac(f),f<0||f>=qR)throw new Error("arx: counter overflow");if(d.length=qR)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 Au(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,T=l,P=u,$=d,V=f,j=h,X=p,L=g,I=m,E=y,x=_,R=v,M=w,G=b,J=D;for(let Se=0;Se{e.update(t);const r=t.length%16;r&&e.update(fW.subarray(r))},hW=new Uint8Array(32);function ZR(e,t,r,i,s){const o=e(t,r,hW),a=iW.create(o);s&&WR(a,s),WR(a,i);const c=new Uint8Array(16),l=cc(c);xo(l,0,BigInt(s?s.length:0),!0),xo(l,8,BigInt(i.length),!0),a.update(c);const u=a.digest();return o.fill(0),u}const KR=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=ZR(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(!Sp(o.subarray(-16),ZR(e,t,r,u,i)))throw new Error("invalid tag");return e(t,r,u,a,1),a}});KR(sw),KR(dW);class QR extends fR{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,ni.hash(t);const i=So(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 QR(e,t).update(r).digest();Mp.create=(e,t)=>new QR(e,t);const ow=new Uint8Array([0]),JR=new Uint8Array;var pW=Object.defineProperty,bt=(e,t)=>{for(var r in t)pW(e,r,{get:t[r],enumerable:!0})},Ao=Symbol("verified"),gW=e=>e instanceof Object;function eO(e){if(!gW(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;tnO,QueueNode:()=>tO,binarySearch:()=>aw,insertEventIntoAscendingList:()=>vW,insertEventIntoDescendingList:()=>yW,normalizeURL:()=>fc,utf8Decoder:()=>ji,utf8Encoder:()=>ai});var ji=new TextDecoder("utf-8"),ai=new TextEncoder;function fc(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 yW(e,t){const[r,i]=aw(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 vW(e,t){const[r,i]=aw(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 aw(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 tO=class{value;next=null;prev=null;constructor(e){this.value=e}},nO=class{first;last;constructor(){this.first=null,this.last=null}enqueue(e){const t=new tO(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 Np(e){let t=Su(ai.encode(function wW(e){if(!eO(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 Rn(t)}var Rp=new class{generateSecretKey(){return Du.utils.randomPrivateKey()}getPublicKey(e){return Rn(Du.getPublicKey(e))}finalizeEvent(e,t){const r=e;return r.pubkey=Rn(Du.getPublicKey(t)),r.id=Np(r),r.sig=Rn(Du.sign(Np(r),t)),r[Ao]=!0,r}verifyEvent(e){if("boolean"==typeof e[Ao])return e[Ao];const t=Np(e);if(t!==e.id)return e[Ao]=!1,!1;try{const r=Du.verify(e.sig,t,e.pubkey);return e[Ao]=r,r}catch{return e[Ao]=!1,!1}}},bW=Rp.generateSecretKey,rO=Rp.getPublicKey,fr=Rp.finalizeEvent,hc=Rp.verifyEvent,cn={};function iO(e){return 1e3<=e&&e<1e4||[1,2,4,5,6,7,8,16,40,41,42,43,44].includes(e)}function cw(e){return[0,3].includes(e)||1e4<=e&&e<2e4}function sO(e){return 2e4<=e&&e<3e4}function lw(e){return 3e4<=e&&e<4e4}function EW(e){return iO(e)?"regular":cw(e)?"replaceable":sO(e)?"ephemeral":lw(e)?"parameterized":"unknown"}bt(cn,{Application:()=>DZ,BadgeAward:()=>AW,BadgeDefinition:()=>yZ,BlockedRelaysList:()=>eZ,BookmarkList:()=>YW,Bookmarksets:()=>pZ,Calendar:()=>NZ,CalendarEventRSVP:()=>RZ,ChannelCreation:()=>oO,ChannelHideMessage:()=>lO,ChannelMessage:()=>cO,ChannelMetadata:()=>aO,ChannelMuteUser:()=>uO,ClassifiedListing:()=>TZ,ClientAuth:()=>dO,CommunitiesList:()=>JW,CommunityDefinition:()=>PZ,CommunityPostApproval:()=>UW,Contacts:()=>IW,CreateOrUpdateProduct:()=>wZ,CreateOrUpdateStall:()=>_Z,Curationsets:()=>gZ,Date:()=>AZ,DirectMessageRelaysList:()=>iZ,DraftClassifiedListing:()=>xZ,DraftLong:()=>EZ,Emojisets:()=>CZ,EncryptedDirectMessage:()=>TW,EventDeletion:()=>xW,FileMetadata:()=>kW,FileServerPreference:()=>oZ,Followsets:()=>dZ,GenericRepost:()=>RW,Genericlists:()=>fZ,GiftWrap:()=>sZ,HTTPAuth:()=>fw,Handlerinformation:()=>kZ,Handlerrecommendation:()=>OZ,Highlights:()=>WW,InterestsList:()=>nZ,Interestsets:()=>vZ,JobFeedback:()=>HW,JobRequest:()=>jW,JobResult:()=>$W,Label:()=>VW,LightningPubRPC:()=>cZ,LiveChatMessage:()=>PW,LiveEvent:()=>SZ,LongFormArticle:()=>bZ,Metadata:()=>CW,Mutelist:()=>ZW,NWCWalletInfo:()=>aZ,NWCWalletRequest:()=>fO,NWCWalletResponse:()=>lZ,NostrConnect:()=>uZ,OpenTimestamps:()=>OW,Pinlist:()=>KW,PrivateDirectMessage:()=>NW,ProblemTracker:()=>LW,ProfileBadges:()=>mZ,PublicChatsList:()=>XW,Reaction:()=>dw,RecommendRelay:()=>SW,RelayList:()=>QW,Relaysets:()=>hZ,Report:()=>FW,Reporting:()=>BW,Repost:()=>uw,Seal:()=>MW,SearchRelaysList:()=>tZ,ShortTextNote:()=>DW,Time:()=>MZ,UserEmojiList:()=>rZ,UserStatuses:()=>IZ,Zap:()=>GW,ZapGoal:()=>zW,ZapRequest:()=>qW,classifyKind:()=>EW,isEphemeralKind:()=>sO,isParameterizedReplaceableKind:()=>lw,isRegularKind:()=>iO,isReplaceableKind:()=>cw});var CW=0,DW=1,SW=2,IW=3,TW=4,xW=5,uw=6,dw=7,AW=8,MW=13,NW=14,RW=16,oO=40,aO=41,cO=42,lO=43,uO=44,OW=1040,kW=1063,PW=1311,LW=1971,FW=1984,BW=1984,VW=1985,UW=4550,jW=5999,$W=6999,HW=7e3,zW=9041,qW=9734,GW=9735,WW=9802,ZW=1e4,KW=10001,QW=10002,YW=10003,JW=10004,XW=10005,eZ=10006,tZ=10007,nZ=10015,rZ=10030,iZ=10050,sZ=10059,oZ=10096,aZ=13194,cZ=21e3,dO=22242,fO=23194,lZ=23195,uZ=24133,fw=27235,dZ=3e4,fZ=30001,hZ=30002,pZ=30003,gZ=30004,mZ=30008,yZ=30009,vZ=30015,_Z=30017,wZ=30018,bZ=30023,EZ=30024,CZ=30030,DZ=30078,SZ=30311,IZ=30315,TZ=30402,xZ=30403,AZ=31922,MZ=31923,NZ=31924,RZ=31925,OZ=31989,kZ=31990,PZ=34550;function LZ(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 Op(e,t){for(let r=0;rcw(t))?e.authors.length*e.kinds.length:1/0,e.authors?.length&&e.kinds?.every(t=>lw(t))&&e["#d"]?.length?e.authors.length*e.kinds.length*e["#d"].length:1/0)}function kp(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 pO(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 gO(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 BZ(e,t){return t===kp(e,"id")}function VZ(e,t){return t===kp(e,"pubkey")}function UZ(e,t){return t===pO(e,"kind")}function mO(e,t){return{kind:dO,created_at:Math.floor(Date.now()/1e3),tags:[["relay",e],["challenge",t]],content:""}}bt({},{getHex64:()=>kp,getInt:()=>pO,getSubscriptionId:()=>gO,matchEventId:()=>BZ,matchEventKind:()=>UZ,matchEventPubkey:()=>VZ}),bt({},{makeAuthEvent:()=>mO});try{WebSocket}catch{}try{WebSocket}catch{}var Mu={};bt(Mu,{BECH32_REGEX:()=>_O,Bech32MaxSize:()=>gw,NostrTypeGuard:()=>WZ,decode:()=>Nu,encodeBytes:()=>Lp,naddrEncode:()=>eK,neventEncode:()=>XZ,noteEncode:()=>YZ,nprofileEncode:()=>JZ,npubEncode:()=>QZ,nsecEncode:()=>KZ});var WZ={isNProfile:e=>/^nprofile1[a-z\d]+$/.test(e||""),isNRelay:e=>/^nrelay1[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||"")},gw=5e3,_O=/[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}/;function Nu(e){let{prefix:t,words:r}=oc.decode(e,gw),i=new Uint8Array(oc.fromWords(r));switch(t){case"nprofile":{let s=mw(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:Rn(s[0][0]),relays:s[1]?s[1].map(o=>ji.decode(o)):[]}}}case"nevent":{let s=mw(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:Rn(s[0][0]),relays:s[1]?s[1].map(o=>ji.decode(o)):[],author:s[2]?.[0]?Rn(s[2][0]):void 0,kind:s[3]?.[0]?parseInt(Rn(s[3][0]),16):void 0}}}case"naddr":{let s=mw(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:ji.decode(s[0][0]),pubkey:Rn(s[2][0]),kind:parseInt(Rn(s[3][0]),16),relays:s[1]?s[1].map(o=>ji.decode(o)):[]}}}case"nsec":return{type:t,data:i};case"npub":case"note":return{type:t,data:Rn(i)};default:throw new Error(`unknown prefix ${t}`)}}function mw(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.lengthai.encode(r))}))}function XZ(e){let t;return void 0!==e.kind&&(t=function ZZ(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)),Pp("nevent",yw({0:[sc(e.id)],1:(e.relays||[]).map(i=>ai.encode(i)),2:e.author?[sc(e.author)]:[],3:t?[new Uint8Array(t)]:[]}))}function eK(e){let t=new ArrayBuffer(4);return new DataView(t).setUint32(0,e.kind,!1),Pp("naddr",yw({0:[ai.encode(e.identifier)],1:(e.relays||[]).map(i=>ai.encode(i)),2:[sc(e.pubkey)],3:[new Uint8Array(t)]}))}function yw(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)})}),wp(...t)}var Ru={};function wO(e,t,r){return vw.apply(this,arguments)}function vw(){return(vw=U(function*(e,t,r){const i=e instanceof Uint8Array?Rn(e):e,o=bO(ic.getSharedSecret(i,"02"+t));let a=Uint8Array.from(pR(16)),c=ai.encode(r),l=UR(o,a).encrypt(c);return`${Fi.encode(new Uint8Array(l))}?iv=${Fi.encode(new Uint8Array(a.buffer))}`})).apply(this,arguments)}function nK(e,t,r){return _w.apply(this,arguments)}function _w(){return(_w=U(function*(e,t,r){const i=e instanceof Uint8Array?Rn(e):e;let[s,o]=r.split("?iv="),c=bO(ic.getSharedSecret(i,"02"+t)),l=Fi.decode(o),u=Fi.decode(s),d=UR(c,l).decrypt(u);return ji.decode(d)})).apply(this,arguments)}function bO(e){return e.slice(1,33)}bt(Ru,{decrypt:()=>nK,encrypt:()=>wO}),bt({},{NIP05_REGEX:()=>ww,isNip05:()=>iK,isValid:()=>aK,queryProfile:()=>EO,searchDomain:()=>oK,useFetchImplementation:()=>sK});var Fp,ww=/^(?:([\w.+-]+)@)?([\w_-]+(\.[\w_-]+)+)$/,iK=e=>ww.test(e||"");try{Fp=fetch}catch{}function sK(e){Fp=e}function oK(e){return bw.apply(this,arguments)}function bw(){return(bw=U(function*(e,t=""){try{const r=`https://${e}/.well-known/nostr.json?name=${t}`;return(yield(yield Fp(r,{redirect:"error"})).json()).names}catch{return{}}})).apply(this,arguments)}function EO(e){return Ew.apply(this,arguments)}function Ew(){return(Ew=U(function*(e){const t=e.match(ww);if(!t)return null;const[r,i="_",s]=t;try{const o=`https://${s}/.well-known/nostr.json?name=${i}`,a=yield(yield Fp(o,{redirect:"error"})).json();let c=a.names[i];return c?{pubkey:c,relays:a.relays?.[c]}:null}catch{return null}})).apply(this,arguments)}function aK(e,t){return Cw.apply(this,arguments)}function Cw(){return(Cw=U(function*(e,t){let r=yield EO(t);return!!r&&r.pubkey===e})).apply(this,arguments)}function lK(e){const t={reply:void 0,root:void 0,mentions:[],profiles:[]},r=[];for(const i of e.tags)"e"===i[0]&&i[1]&&r.push(i),"p"===i[0]&&i[1]&&t.profiles.push({pubkey:i[1],relays:i[2]?[i[2]]:[]});for(let i=0;ilK}),bt({},{fetchRelayInformation:()=>fK,useFetchImplementation:()=>dK});try{fetch}catch{}function dK(e){}function fK(e){return Dw.apply(this,arguments)}function Dw(){return(Dw=U(function*(e){return yield(yield fetch(e.replace("ws://","http://").replace("wss://","https://"),{headers:{Accept:"application/nostr+json"}})).json()})).apply(this,arguments)}function DO(e){let t=0;for(let r=0;r=t)break}return i}function mK(e,t,r,i){return fr({kind:uw,tags:[...e.tags??[],["e",t.id,r],["p",t.pubkey]],content:""===e.content?"":JSON.stringify(t),created_at:e.created_at},i)}function SO(e){if(e.kind!==uw)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 yK(e,{skipVerification:t}={}){const r=SO(e);if(void 0===r||""===e.content)return;let i;try{i=JSON.parse(e.content)}catch{return}return i.id===r.id&&(t||hc(i))?i:void 0}bt({},{getPow:()=>DO,minePow:()=>pK}),bt({},{finishRepostEvent:()=>mK,getRepostedEvent:()=>yK,getRepostedEventPointer:()=>SO}),bt({},{NOSTR_URI_REGEX:()=>Bp,parse:()=>wK,test:()=>_K});var Bp=new RegExp(`nostr:(${_O.source})`);function _K(e){return"string"==typeof e&&new RegExp(`^${Bp.source}$`).test(e)}function wK(e){const t=e.match(new RegExp(`^${Bp.source}$`));if(!t)throw new Error(`Invalid Nostr URI: ${e}`);return{uri:t[0],value:t[1],decoded:Nu(t[1])}}function EK(e,t,r){const i=t.tags.filter(s=>s.length>=2&&("e"===s[0]||"p"===s[0]));return fr({...e,kind:dw,tags:[...e.tags??[],...i,["e",t.id],["p",t.pubkey]],content:e.content??"+"},r)}function CK(e){if(e.kind!==dw)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}bt({},{finishReactionEvent:()=>EK,getReactedEventPointer:()=>CK}),bt({},{matchAll:()=>SK,regex:()=>Sw,replaceAll:()=>IK});var Sw=()=>new RegExp(`\\b${Bp.source}\\b`,"g");function*SK(e){const t=e.matchAll(Sw());for(const r of t)try{const[i,s]=r;yield{uri:i,value:s,decoded:Nu(s),start:r.index,end:r.index+i.length}}catch{}}function IK(e,t){return e.replaceAll(Sw(),(r,i)=>t({uri:r,value:i,decoded:Nu(i)}))}bt({},{channelCreateEvent:()=>xK,channelHideMessageEvent:()=>NK,channelMessageEvent:()=>MK,channelMetadataEvent:()=>AK,channelMuteUserEvent:()=>RK});var xK=(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 fr({kind:oO,tags:[...e.tags??[]],content:r,created_at:e.created_at},t)},AK=(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 fr({kind:aO,tags:[["e",e.channel_create_event_id],...e.tags??[]],content:r,created_at:e.created_at},t)},MK=(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"]),fr({kind:cO,tags:[...r,...e.tags??[]],content:e.content,created_at:e.created_at},t)},NK=(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 fr({kind:lO,tags:[["e",e.channel_message_event_id],...e.tags??[]],content:r,created_at:e.created_at},t)},RK=(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 fr({kind:uO,tags:[["p",e.pubkey_to_mute],...e.tags??[]],content:r,created_at:e.created_at},t)};bt({},{EMOJI_SHORTCODE_REGEX:()=>IO,matchAll:()=>kK,regex:()=>Iw,replaceAll:()=>PK});var Tw,IO=/:(\w+):/,Iw=()=>new RegExp(`\\B${IO.source}\\B`,"g");function*kK(e){const t=e.matchAll(Iw());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 PK(e,t){return e.replaceAll(Iw(),(r,i)=>t({shortcode:r,name:i}))}bt({},{useFetchImplementation:()=>FK,validateGithub:()=>BK});try{Tw=fetch}catch{}function FK(e){Tw=e}function BK(e,t,r){return xw.apply(this,arguments)}function xw(){return(xw=U(function*(e,t,r){try{return(yield(yield Tw(`https://gist.github.com/${t}/${r}/raw`)).text())===`Verifying that I control the following Nostr public key: ${e}`}catch{return!1}})).apply(this,arguments)}bt({},{decrypt:()=>OO,encrypt:()=>RO,getConversationKey:()=>AO,v2:()=>HK});var TO=1,xO=65535;function AO(e,t){const r=ic.getSharedSecret(e,"02"+t).subarray(1,33);return function YR(e,t,r){return ni.hash(e),void 0===r&&(r=new Uint8Array(e.outputLen)),Mp(e,So(r),So(t))}(Su,r,"nip44-v2")}function MO(e,t){const r=function XR(e,t,r,i=32){if(ni.hash(e),ni.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=JR);const o=new Uint8Array(s*e.outputLen),a=Mp.create(e,t),c=a._cloneInto(),l=new Uint8Array(a.outputLen);for(let u=0;uxO)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 wp(i,t,new Uint8Array(Aw(r)-r))}(e),c=sw(i,s,a),l=NO(o,c,r);return Fi.encode(wp(new Uint8Array([2]),r,c,l))}function OO(e,t){const{nonce:r,ciphertext:i,mac:s}=function $K(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=Fi.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}=MO(t,r);if(!Sp(NO(c,i,r),s))throw new Error("invalid MAC");return function jK(e){const t=new DataView(e.buffer).getUint16(0),r=e.subarray(2,2+t);if(txO||r.length!==t||e.length!==2+Aw(t))throw new Error("invalid padding");return ji.decode(r)}(sw(o,a,i))}var Nw,HK={utils:{getConversationKey:AO,calcPaddedLen:Aw},encrypt:RO,decrypt:OO};function qK(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 GK(e,t,r){return Mw.apply(this,arguments)}function Mw(){return(Mw=U(function*(e,t,r){const s=yield wO(t,e,JSON.stringify({method:"pay_invoice",params:{invoice:r}})),o={kind:fO,created_at:Math.round(Date.now()/1e3),content:s,tags:[["p",e]]};return fr(o,t)})).apply(this,arguments)}bt({},{makeNwcRequestEvent:()=>GK,parseConnectionString:()=>qK}),bt({},{getZapEndpoint:()=>KK,makeZapReceipt:()=>JK,makeZapRequest:()=>QK,useFetchImplementation:()=>ZK,validateZapRequest:()=>YK});try{Nw=fetch}catch{}function ZK(e){Nw=e}function KK(e){return Rw.apply(this,arguments)}function Rw(){return(Rw=U(function*(e){try{let t="",{lud06:r,lud16:i}=JSON.parse(e.content);if(r){let{words:a}=oc.decode(r,1e3),c=oc.fromWords(a);t=ji.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 Nw(t)).json();if(o.allowsNostr&&o.nostrPubkey)return o.callback}catch{}return null})).apply(this,arguments)}function QK({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 YK(e){let t;try{t=JSON.parse(e)}catch{return"Invalid zap request JSON."}if(!eO(t))return"Zap request is not a valid Nostr event.";if(!hc(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 JK({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}bt({},{getToken:()=>eQ,hashPayload:()=>Lw,unpackEventFromToken:()=>PO,validateEvent:()=>jO,validateEventKind:()=>FO,validateEventMethodTag:()=>VO,validateEventPayloadTag:()=>UO,validateEventTimestamp:()=>LO,validateEventUrlTag:()=>BO,validateToken:()=>tQ});var kO="Nostr ";function eQ(e,t,r){return Ow.apply(this,arguments)}function Ow(){return(Ow=U(function*(e,t,r,i=!1,s){const o={kind:fw,tags:[["u",e],["method",t]],created_at:Math.round((new Date).getTime()/1e3),content:""};s&&o.tags.push(["payload",Lw(s)]);const a=yield r(o);return(i?kO:"")+Fi.encode(ai.encode(JSON.stringify(a)))})).apply(this,arguments)}function tQ(e,t,r){return kw.apply(this,arguments)}function kw(){return(kw=U(function*(e,t,r){const i=yield PO(e).catch(o=>{throw o});return yield jO(i,t,r).catch(o=>{throw o})})).apply(this,arguments)}function PO(e){return Pw.apply(this,arguments)}function Pw(){return(Pw=U(function*(e){if(!e)throw new Error("Missing token");e=e.replace(kO,"");const t=ji.decode(Fi.decode(e));if(!t||0===t.length||!t.startsWith("{"))throw new Error("Invalid token");return JSON.parse(t)})).apply(this,arguments)}function LO(e){return!!e.created_at&&Math.round((new Date).getTime()/1e3)-e.created_at<60}function FO(e){return e.kind===fw}function BO(e,t){const r=e.tags.find(i=>"u"===i[0]);return!!r&&r.length>0&&r[1]===t}function VO(e,t){const r=e.tags.find(i=>"method"===i[0]);return!!r&&r.length>0&&r[1].toLowerCase()===t.toLowerCase()}function Lw(e){return Rn(Su(ai.encode(JSON.stringify(e))))}function UO(e,t){const r=e.tags.find(s=>"payload"===s[0]);if(!r)return!1;const i=Lw(t);return r.length>0&&r[1]===i}function jO(e,t,r,i){return Fw.apply(this,arguments)}function Fw(){return(Fw=U(function*(e,t,r,i){if(!hc(e))throw new Error("Invalid nostr event, signature invalid");if(!FO(e))throw new Error("Invalid nostr event, kind invalid");if(!LO(e))throw new Error("Invalid nostr event, created_at timestamp invalid");if(!BO(e,t))throw new Error("Invalid nostr event, url tag invalid");if(!VO(e,r))throw new Error("Invalid nostr event, method tag invalid");if(i&&"object"==typeof i&&Object.keys(i).length>0&&!UO(e,i))throw new Error("Invalid nostr event, payload tag does not match request body hash");return!0})).apply(this,arguments)}function Is(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 Up(t.call(e));r="@@asyncIterator",i="@@iterator"}throw new TypeError("Object is not async iterable")}function Up(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(Up=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 Up(e)}"object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date;const Bw="object"==typeof process&&process?process:{};let jp=globalThis.AbortController,zO=globalThis.AbortSignal;if(typeof jp>"u"){zO=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,s){this._onabort.push(s)}},jp=class{constructor(){t()}signal=new zO;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"!==Bw.env?.LRU_CACHE_IGNORE_AC_WARNING;const t=()=>{e&&(e=!1,((e,t,r,i)=>{"function"==typeof Bw.emitWarning?Bw.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 GO,WO;Symbol("type"),Symbol,Symbol,GO=Symbol.iterator,WO=Symbol.toStringTag;class hr{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(hr.deletes(r,t)||hr.replaces(r,t))return this;hr.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 hr.sortEvents([...this.cache.values()]))yield t}[GO](){return this.values()}[WO]="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(hr.isReplaceable(i))return i===r.kind&&s===r.pubkey&&hr.sortEvents([t,r])[0]===t;if(hr.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&&hr.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 Ar(e,...t){if(!function iQ(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 Ou(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 yc="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,Mo=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),ci=(e,t)=>e<<32-t|e>>>t;function YO(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function No(e){return"string"==typeof e&&(e=YO(e)),Ar(e),e}new Uint8Array(new Uint32Array([287454020]).buffer);class JO{clone(){return this._cloneInto()}}function $w(e){const t=i=>e().update(No(i)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function fQ(e=32){if(yc&&"function"==typeof yc.getRandomValues)return yc.getRandomValues(new Uint8Array(e));if(yc&&"function"==typeof yc.randomBytes)return yc.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}class XO extends JO{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,function Uw(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=No(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 XO(e,t).update(r).digest();Pu.create=(e,t)=>new XO(e,t);const pQ=(e,t,r)=>e&t^~e&r,gQ=(e,t,r)=>e&t^e&r^t&r;class Hw extends JO{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=Mo(this.buffer)}update(t){Ou(this);const{view:r,buffer:i,blockLen:s}=this,o=(t=No(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=Mo(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)),yQ=ek.map(e=>(9*e+5)%16);let zw=[ek],qw=[yQ];for(let e=0;e<4;e++)for(let t of[zw,qw])t.push(t[e].map(r=>mQ[r]));const DQ=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]),xs=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),As=new Uint32Array(64);class rk extends Hw{constructor(){super(64,32,8,!1),this.A=0|xs[0],this.B=0|xs[1],this.C=0|xs[2],this.D=0|xs[3],this.E=0|xs[4],this.F=0|xs[5],this.G=0|xs[6],this.H=0|xs[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)As[f]=t.getUint32(r,!1);for(let f=16;f<64;f++){const h=As[f-15],p=As[f-2],g=ci(h,7)^ci(h,18)^h>>>3,m=ci(p,17)^ci(p,19)^p>>>10;As[f]=m+As[f-7]+g+As[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+(ci(c,6)^ci(c,11)^ci(c,25))+pQ(c,l,u)+DQ[f]+As[f]|0,m=(ci(i,2)^ci(i,13)^ci(i,22))+gQ(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(){As.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Gw=$w(()=>new rk),qp=BigInt(2**32-1),Ww=BigInt(32);function ik(e,t=!1){return t?{h:Number(e&qp),l:Number(e>>Ww&qp)}:{h:0|Number(e>>Ww&qp),l:0|Number(e&qp)}}const Ee_split=function SQ(e,t=!1){let r=new Uint32Array(e.length),i=new Uint32Array(e.length);for(let s=0;sBigInt(e))),Kw=BigInt(0),Wp=BigInt(1),$Q=BigInt(2);function Ro(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function Lu(e){if(!Ro(e))throw new Error("Uint8Array expected")}function vc(e,t){if("boolean"!=typeof t)throw new Error(`${e} must be valid boolean, got "${t}".`)}const HQ=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function _c(e){Lu(e);let t="";for(let r=0;r=Hi._0&&e<=Hi._9?e-Hi._0:e>=Hi._A&&e<=Hi._F?e-(Hi._A-10):e>=Hi._a&&e<=Hi._f?e-(Hi._a-10):void 0}function bc(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&&Kw<=e;function Zp(e,t,r){return Jw(e)&&Jw(t)&&Jw(r)&&t<=e&&eKw;e>>=Wp,t+=1);return t}const Xw=e=>($Q<new Uint8Array(e),ck=e=>Uint8Array.from(e);function lk(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=eb(e),s=eb(e),o=0;const a=()=>{i.fill(1),s.fill(0),o=0},c=(...f)=>r(s,i,...f),l=(f=eb())=>{s=c(ck([0]),f),i=c(),0!==f.length&&(s=c(ck([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 zQ={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||Ro(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 Bu(e,t,r={}){const i=(s,o,a)=>{const c=zQ[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 tb(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 jt=BigInt(0),Ye=BigInt(1),Rs=BigInt(2),qQ=BigInt(3),nb=BigInt(4),uk=BigInt(5),dk=BigInt(8);function Jt(e,t){const r=e%t;return r>=jt?r:t+r}function ZQ(e,t,r){if(r<=jt||t 0");if(r===Ye)return jt;let i=Ye;for(;t>jt;)t&Ye&&(i=i*e%r),e=e*e%r,t>>=Ye;return i}function pr(e,t,r){let i=e;for(;t-- >jt;)i*=i,i%=r;return i}function Kp(e,t){if(e===jt||t<=jt)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=Jt(e,t),i=t,s=jt,o=Ye,a=Ye,c=jt;for(;r!==jt;){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 YQ=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function rb(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function fk(e,t,r=!1,i={}){if(e<=jt)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:o}=rb(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=function QQ(e){if(e%nb===qQ){const t=(e+Ye)/nb;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%dk===uk){const t=(e-uk)/dk;return function(i,s){const o=i.mul(s,Rs),a=i.pow(o,t),c=i.mul(s,a),l=i.mul(i.mul(c,Rs),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 KQ(e){const t=(e-Ye)/Rs;let r,i,s;for(r=e-Ye,i=0;r%Rs===jt;r/=Rs,i++);for(s=Rs;sJt(l,e),isValid:l=>{if("bigint"!=typeof l)throw new Error("Invalid field element: expected bigint, got "+typeof l);return jt<=l&&ll===jt,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 XQ(e,t,r){if(r 0");if(r===jt)return e.ONE;if(r===Ye)return t;let i=e.ONE,s=t;for(;r>jt;)r&Ye&&(i=e.mul(i,s)),s=e.sqr(s),r>>=Ye;return i}(c,l,u),div:(l,u)=>Jt(l*Kp(u,e),e),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>Kp(l,e),sqrt:i.sqrt||(l=>a(c,l)),invertBatch:l=>function eY(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?Yw(l,o):Ec(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return r?Qw(l):Oo(l)}});return Object.freeze(c)}function hk(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 pk(e){const t=hk(e);return t+Math.ceil(t/2)}const rY=BigInt(0),ib=BigInt(1),sb=new WeakMap,gk=new WeakMap;function mk(e){return function JQ(e){Bu(e,YQ.reduce((i,s)=>(i[s]="function",i),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"}))}(e.Fp),Bu(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...rb(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}function yk(e){void 0!==e.lowS&&vc("lowS",e.lowS),void 0!==e.prehash&&vc("prehash",e.prehash)}const{Ph:aY,aT:cY}=cm,zi={Err:class extends Error{constructor(t=""){super(t)}},_tlv:{encode:(e,t)=>{const{Err:r}=zi;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=wc(i);if(s.length/2&128)throw new r("tlv.encode: long form length too big");const o=i>127?wc(s.length/2|128):"";return`${wc(e)}${o}${s}${t}`},decode(e,t){const{Err:r}=zi;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}=zi;if(e{const v=y.toAffine();return Fu(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(Ro(m)&&(m=_c(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:Oo(Mr("private key",m,_))}catch{throw new Error(`private key must be ${_} bytes, hex or bigint, not ${typeof m}`)}return v&&(b=Jt(b,w)),ko("private key",b,Ge,w),b}function u(m){if(!(m instanceof h))throw new Error("ProjectivePoint expected")}const d=tb((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=tb(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(Mr("pointHex",y)));return _.assertValidity(),_}static fromPrivateKey(y){return h.BASE.multiply(l(y))}static msm(y,_){return function sY(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=ak(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;hNr||C>Nr;)b&Ge&&(S=S.add(P)),C&Ge&&(T=T.add(P)),P=P.double(),b>>=Ge,C>>=Ge;return w&&(S=S.negate()),D&&(T=T.negate()),T=new h(r.mul(T.px,v.beta),T.py,T.pz),S.add(T)}multiply(y){const{endo:_,n:v}=t;let w,b;if(ko("scalar",y,Ge,v),_){const{k1neg:D,k1:C,k2neg:S,k2:T}=_.splitScalar(y);let{p:P,f:$}=this.wNAF(C),{p:V,f:j}=this.wNAF(T);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=$.add(j)}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!==Nr&&S!==Ge&&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===Ge)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===Ge?this:_?_(h,this):this.multiplyUnsafe(t.h)}toRawBytes(y=!0){return vc("isCompressed",y),this.assertValidity(),s(h,this,y)}toHex(y=!0){return vc("isCompressed",y),_c(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 iY(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>rY;)a&ib&&(c=c.add(l)),l=l.double(),a>>=ib;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+=ib);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=gk.get(o)||1;let u=sb.get(o);return u||(u=this.precomputeWindow(o,l),1!==l&&sb.set(o,c(u))),this.wNAF(l,u,a)},setWindowSize(o,a){i(a),gk.set(o,a),sb.delete(o)}}}(h,t.endo?Math.ceil(p/2):p);return{CURVE:t,ProjectivePoint:h,normPrivateKeyToScalar:l,weierstrassEquation:a,isWithinCurveOrder:function c(m){return Zp(m,Ge,t.n)}}}({...t,toBytes(L,I,E){const x=I.toAffine(),R=r.toBytes(x.x),M=Fu;return vc("isCompressed",E),E?M(Uint8Array.from([I.hasEvenY()?2:3]),R):M(Uint8Array.from([4]),R,r.toBytes(x.y))},fromBytes(L){const I=L.length,E=L[0],x=L.subarray(1);if(I!==s||2!==E&&3!==E){if(I===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 ${I} was invalid. Expected ${s} compressed bytes or ${o} uncompressed bytes`)}{const R=Oo(x);if(!Zp(R,Ge,r.ORDER))throw new Error("Point is not on curve");const M=d(R);let G;try{G=r.sqrt(M)}catch(Se){const ue=Se instanceof Error?": "+Se.message:"";throw new Error("Point is not on curve"+ue)}return!(1&~E)!=((G&Ge)===Ge)&&(G=r.neg(G)),{x:R,y:G}}}}),h=L=>_c(Ec(L,t.nByteLength));function p(L){return L>i>>Ge}const m=(L,I,E)=>Oo(L.slice(I,E));class y{constructor(I,E,x){this.r=I,this.s=E,this.recovery=x,this.assertValidity()}static fromCompact(I){const E=t.nByteLength;return I=Mr("compactSignature",I,2*E),new y(m(I,0,E),m(I,E,2*E))}static fromDER(I){const{r:E,s:x}=zi.toSig(Mr("DER",I));return new y(E,x)}assertValidity(){ko("r",this.r,Ge,i),ko("s",this.s,Ge,i)}addRecoveryBit(I){return new y(this.r,this.s,I)}recoverPublicKey(I){const{r:E,s:x,recovery:R}=this,M=C(Mr("msgHash",I));if(null==R||![0,1,2,3].includes(R))throw new Error("recovery id invalid");const G=2===R||3===R?E+t.n:E;if(G>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const ee=l.fromHex((1&R?"03":"02")+h(G)),Se=c(G),ue=a(-M*Se),gt=a(x*Se),ht=l.BASE.multiplyAndAddUnsafe(ee,ue,gt);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 bc(this.toDERHex())}toDERHex(){return zi.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return bc(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=pk(t.n);return function nY(e,t,r=!1){const i=e.length,s=hk(t),o=pk(t);if(i<16||i1024)throw new Error(`expected ${o}-1024 bytes of input, got ${i}`);const c=Jt(r?Oo(e):Qw(e),t-Ye)+Ye;return r?Yw(c,s):Ec(c,s)}(t.randomBytes(L),t.n)},precompute:(L=8,I=l.BASE)=>(I._setWindowSize(L),I.multiply(BigInt(3)),I)};function w(L){const I=Ro(L),E="string"==typeof L,x=(I||E)&&L.length;return I?x===s||x===o:E?x===2*s||x===2*o:L instanceof l}const D=t.bits2int||function(L){const I=Oo(L),E=8*L.length-t.nBitLength;return E>0?I>>BigInt(E):I},C=t.bits2int_modN||function(L){return a(D(L))},S=Xw(t.nBitLength);function T(L){return ko(`num < 2^${t.nBitLength}`,L,Nr,S),Ec(L,t.nByteLength)}const $={lowS:t.lowS,prehash:!1},V={lowS:t.lowS,prehash:!1};return l.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function v(L,I=!0){return l.fromPrivateKey(L).toRawBytes(I)},getSharedSecret:function b(L,I,E=!0){if(w(L))throw new Error("first arg must be private key");if(!w(I))throw new Error("second arg must be public key");return l.fromHex(I).multiply(u(L)).toRawBytes(E)},sign:function j(L,I,E=$){const{seed:x,k2sig:R}=function P(L,I,E=$){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:G,extraEntropy:J}=E;null==M&&(M=!0),L=Mr("msgHash",L),yk(E),G&&(L=Mr("prehashed msgHash",x(L)));const ee=C(L),Se=u(I),ue=[T(Se),T(ee)];if(null!=J&&!1!==J){const ot=!0===J?R(r.BYTES):J;ue.push(Mr("extraEntropy",ot))}const gt=Fu(...ue),ht=ee;return{seed:gt,k2sig:function Ae(ot){const Oe=D(ot);if(!f(Oe))return;const Ln=c(Oe),Xt=l.BASE.multiply(Oe).toAffine(),en=a(Xt.x);if(en===Nr)return;const Fr=a(Ln*a(ht+en*Se));if(Fr===Nr)return;let Ko=(Xt.x===en?0:2)|Number(Xt.y&Ge),Rd=Fr;return M&&p(Fr)&&(Rd=function g(L){return p(L)?a(-L):L}(Fr),Ko^=1),new y(en,Rd,Ko)}}}(L,I,E);return lk(t.hash.outputLen,t.nByteLength,t.hmac)(x,R)},verify:function X(L,I,E,x=V){const R=L;if(I=Mr("msgHash",I),E=Mr("publicKey",E),"strict"in x)throw new Error("options.strict was renamed to lowS");yk(x);const{lowS:M,prehash:G}=x;let J,ee;try{if("string"==typeof R||Ro(R))try{J=y.fromDER(R)}catch(Xt){if(!(Xt instanceof zi.Err))throw Xt;J=y.fromCompact(R)}else{if("object"!=typeof R||"bigint"!=typeof R.r||"bigint"!=typeof R.s)throw new Error("PARSE");{const{r:Xt,s:en}=R;J=new y(Xt,en)}}ee=l.fromHex(E)}catch(Xt){if("PARSE"===Xt.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(M&&J.hasHighS())return!1;G&&(I=t.hash(I));const{r:Se,s:ue}=J,gt=C(I),ht=c(ue),Ae=a(gt*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 hY(e){return{hash:e,hmac:(t,...r)=>Pu(e,t,function ku(...e){let t=0;for(let i=0;i(e+t/Jp)/t;const ob=fk(Vu,void 0,void 0,{sqrt:function wk(e){const t=Vu,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=pr(d,r,t)*d%t,h=pr(f,r,t)*d%t,p=pr(h,Jp,t)*u%t,g=pr(p,s,t)*p%t,m=pr(g,o,t)*g%t,y=pr(m,c,t)*m%t,_=pr(y,l,t)*y%t,v=pr(_,c,t)*m%t,w=pr(v,r,t)*d%t,b=pr(w,a,t)*g%t,D=pr(b,i,t)*u%t,C=pr(D,Jp,t);if(!ob.eql(ob.sqr(C),e))throw new Error("Cannot find square root");return C}});(function pY(e,t){const r=i=>dY({...e,...hY(i)});Object.freeze({...r(t),create:r})})({a:BigInt(0),b:BigInt(7),Fp:ob,n:Yp,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Yp,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-Uu*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=BigInt("0x100000000000000000000000000000000"),c=_k(o*e,t),l=_k(-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}}}},Gw),BigInt(0);var Hk,Gk;function $k(e,t){this.v=e,this.k=t}function ks(e){return new $k(e,0)}function sg(e){return function(){return new qu(e.apply(this,arguments))}}function qu(e){var t,r;function i(o,a){try{var c=e[o](a),l=c.value,u=l instanceof $k;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)}YO("Bitcoin seed"),new TextEncoder,(new TextEncoder).encode("0123456789abcdef"),new TextEncoder,new TextDecoder,qu.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},qu.prototype.next=function(e){return this._invoke("next",e)},qu.prototype.throw=function(e){return this._invoke("throw",e)},qu.prototype.return=function(e){return this._invoke("return",e)},Hk=Symbol.asyncIterator;class zk{#t=[];#i;#f=!1;constructor(t){t?.aborted?this.abort():t?.addEventListener("abort",()=>this.abort(),{once:!0})}[Hk](){var t=this;return sg(function*(){for(;!t.#f;)t.#t.length?yield t.#t.shift():yield ks(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 qk{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}}Gk=Symbol.asyncDispose;class $Y{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 sg(function*(){const s=new AbortController,o=r?.signal?AbortSignal.any([r.signal,s.signal]):s.signal,a=yield ks(i.opts.reqRouter(t));if(a.size<1)return;const c=new zk(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=Is(_.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=Is(c);d=!(g=yield ks(p.next())).done;d=!1)yield g.value}catch(m){f=!0,h=m}finally{try{d&&null!=p.return&&(yield ks(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 hr,o=t.reduce((h,p)=>h+hO(p),0);if(0===o)return[];const a=t.reduce((h,p)=>h||!!p.kinds?.some(g=>qk.replaceable(g)||qk.parameterizedReplaceable(g)),!1);try{var u,c=!1,l=!1;try{for(var f,d=Is(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()))})()}[Gk](){var t=this;return U(function*(){yield t.close()})()}}class HY{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,Je=function(e){return e.open="open",e.close="close",e.error="error",e.message="message",e.retry="retry",e.reconnect="reconnect",e}(Je||{});class zY{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(Je.open,w),this.handleErrorEvent=w=>this.handleEvent(Je.error,w),this.handleCloseEvent=w=>this.handleEvent(Je.close,w),this.handleMessageEvent=w=>this.handleEvent(Je.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(Je.open,this.handleOpenEvent),this._underlyingWebsocket.addEventListener(Je.close,this.handleCloseEvent),this._underlyingWebsocket.addEventListener(Je.error,this.handleErrorEvent),this._underlyingWebsocket.addEventListener(Je.message,this.handleMessageEvent),this._underlyingWebsocket}clearWebsocket(){this._underlyingWebsocket.removeEventListener(Je.open,this.handleOpenEvent),this._underlyingWebsocket.removeEventListener(Je.close,this.handleCloseEvent),this._underlyingWebsocket.removeEventListener(Je.error,this.handleErrorEvent),this._underlyingWebsocket.removeEventListener(Je.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 Je.close:this.dispatchEvent(t,r),this.scheduleConnectionRetryIfNeeded();break;case Je.open:if(void 0!==this.backoff&&void 0!==this._lastConnection){const i={retries:this.backoff.retries,lastConnection:new Date(this._lastConnection)},s=new CustomEvent(Je.reconnect,{detail:i});this.dispatchEvent(Je.reconnect,s),this.backoff.reset()}this._lastConnection=new Date,this.dispatchEvent(t,r),this.sendBufferedData();break;case Je.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(Je.retry,{detail:i});this.handleEvent(Je.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 qY{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(Je.open,t,r),this}onClose(t,r){return this.addListener(Je.close,t,r),this}onError(t,r){return this.addListener(Je.error,t,r),this}onMessage(t,r){return this.addListener(Je.message,t,r),this}onRetry(t,r){return this.addListener(Je.retry,t,r),this}onReconnect(t,r){return this.addListener(Je.reconnect,t,r),this}build(){return new zY(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,T;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!==(T=null===(S=null===(C=this._options)||void 0===C?void 0:C.listeners)||void 0===S?void 0:S[t])&&void 0!==T?T:[],{listener:r,options:i}]}}),this}}class GY{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 Wk=function(e){return e.mergeShapes=(t,r)=>({...t,...r}),e}(Wk||{});const K=Re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ps=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 Gi=(()=>{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 Dc=(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 Zk=Dc;function og(){return Zk}const ag=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 W(e,t){const r=og(),i=ag({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Dc?void 0:Dc].filter(s=>!!s)});e.common.issues.push(i)}class ln{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 ln.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"}),Sc=e=>({status:"dirty",value:e}),En=e=>({status:"valid",value:e}),wb=e=>"aborted"===e.status,bb=e=>"dirty"===e.status,Gu=e=>"valid"===e.status,Wu=e=>typeof Promise<"u"&&e instanceof Promise;function cg(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 Kk(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 Zu,Ku,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 li{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 Qk=(e,t)=>{if(Gu(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 Gi(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 Ps(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Ps(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ln,ctx:{common:t.parent.common,data:t.data,parsedType:Ps(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Wu(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:Ps(t)},o=this._parseSync({data:t,path:s.path,parent:s});return Qk(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:Ps(t)},o=i._parse({data:t,path:s.path,parent:s}),a=yield Wu(o)?o:Promise.resolve(o);return Qk(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 Bo({schema:this,typeName:ce.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Fs.create(this,this._def)}nullable(){return Mc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Yu.create(this,this._def)}promise(){return fg.create(this,this._def)}or(t){return Ab.create([this,t],this._def)}and(t){return Nb.create(this,t,this._def)}transform(t){return new Bo({...ye(this._def),schema:this,typeName:ce.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r="function"==typeof t?t:()=>t;return new kb({...ye(this._def),innerType:this,defaultValue:r,typeName:ce.ZodDefault})}brand(){return new Lb({typeName:ce.ZodBranded,type:this,...ye(this._def)})}catch(t){const r="function"==typeof t?t:()=>t;return new Pb({...ye(this._def),innerType:this,catchValue:r,typeName:ce.ZodCatch})}describe(t){return new(0,this.constructor)({...this._def,description:t})}pipe(t){return ed.create(this,t)}readonly(){return Fb.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const QY=/^c[^\s-]{8,}$/i,YY=/^[0-9a-z]+$/,JY=/^[0-9A-HJKMNP-TV-Z]{26}$/,XY=/^[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,eJ=/^[a-z0-9_-]{21}$/i,tJ=/^[-+]?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)?)??$/,nJ=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let Eb;const iJ=/^(?:(?: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])$/,sJ=/^(([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})))$/,oJ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Yk="((\\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])))",aJ=new RegExp(`^${Yk}$`);function Jk(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 cJ(e){return new RegExp(`^${Jk(e)}$`)}function Xk(e){let t=`${Yk}T${Jk(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 lJ(e,t){return!(("v4"!==t&&t||!iJ.test(e))&&("v6"!==t&&t||!sJ.test(e)))}let lg=(()=>{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 W(a,{code:B.invalid_type,expected:K.string,received:a.parsedType}),ae}const s=new ln;let o;for(const a of this._def.checks)if("min"===a.kind)r.data.lengtha.value&&(o=this._getOrReturnCtx(r,o),W(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 uJ(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 Cb=(()=>{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 W(a,{code:B.invalid_type,expected:K.number,received:a.parsedType}),ae}let s;const o=new ln;for(const a of this._def.checks)"int"===a.kind?Re.isInteger(r.data)||(s=this._getOrReturnCtx(r,s),W(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),W(s,{code:B.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):"multipleOf"===a.kind?0!==uJ(r.data,a.value)&&(s=this._getOrReturnCtx(r,s),W(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),W(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})(),Db=(()=>{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 W(a,{code:B.invalid_type,expected:K.bigint,received:a.parsedType}),ae}let s;const o=new ln;for(const a of this._def.checks)"min"===a.kind?(a.inclusive?r.dataa.value:r.data>=a.value)&&(s=this._getOrReturnCtx(r,s),W(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),W(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})(),Sb=(()=>{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 W(s,{code:B.invalid_type,expected:K.boolean,received:s.parsedType}),ae}return En(r.data)}}return e.create=t=>new e({typeName:ce.ZodBoolean,coerce:t?.coerce||!1,...ye(t)}),e})(),Ib=(()=>{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 W(a,{code:B.invalid_type,expected:K.date,received:a.parsedType}),ae}if(isNaN(r.data.getTime()))return W(this._getOrReturnCtx(r),{code:B.invalid_date}),ae;const s=new ln;let o;for(const a of this._def.checks)"min"===a.kind?r.data.getTime()a.value&&(o=this._getOrReturnCtx(r,o),W(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})(),e2=(()=>{class e extends Ce{_parse(r){if(this._getType(r)!==K.symbol){const s=this._getOrReturnCtx(r);return W(s,{code:B.invalid_type,expected:K.symbol,received:s.parsedType}),ae}return En(r.data)}}return e.create=t=>new e({typeName:ce.ZodSymbol,...ye(t)}),e})(),Tb=(()=>{class e extends Ce{_parse(r){if(this._getType(r)!==K.undefined){const s=this._getOrReturnCtx(r);return W(s,{code:B.invalid_type,expected:K.undefined,received:s.parsedType}),ae}return En(r.data)}}return e.create=t=>new e({typeName:ce.ZodUndefined,...ye(t)}),e})(),xb=(()=>{class e extends Ce{_parse(r){if(this._getType(r)!==K.null){const s=this._getOrReturnCtx(r);return W(s,{code:B.invalid_type,expected:K.null,received:s.parsedType}),ae}return En(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 En(r.data)}}return e.create=t=>new e({typeName:ce.ZodAny,...ye(t)}),e})(),Qu=(()=>{class e extends Ce{constructor(){super(...arguments),this._unknown=!0}_parse(r){return En(r.data)}}return e.create=t=>new e({typeName:ce.ZodUnknown,...ye(t)}),e})(),Fo=(()=>{class e extends Ce{_parse(r){const i=this._getOrReturnCtx(r);return W(i,{code:B.invalid_type,expected:K.never,received:i.parsedType}),ae}}return e.create=t=>new e({typeName:ce.ZodNever,...ye(t)}),e})(),t2=(()=>{class e extends Ce{_parse(r){if(this._getType(r)!==K.undefined){const s=this._getOrReturnCtx(r);return W(s,{code:B.invalid_type,expected:K.void,received:s.parsedType}),ae}return En(r.data)}}return e.create=t=>new e({typeName:ce.ZodVoid,...ye(t)}),e})(),Yu=(()=>{class e extends Ce{_parse(r){const{ctx:i,status:s}=this._processInputParams(r),o=this._def;if(i.parsedType!==K.array)return W(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&&(W(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 li(i,c,i.path,l)))).then(c=>ln.mergeArray(s,c));const a=[...i.data].map((c,l)=>o.type._parseSync(new li(i,c,i.path,l)));return ln.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 Ic(e){if(e instanceof Tc){const t={};for(const r in e.shape)t[r]=Fs.create(Ic(e.shape[r]));return new Tc({...e._def,shape:()=>t})}return e instanceof Yu?new Yu({...e._def,type:Ic(e.element)}):e instanceof Fs?Fs.create(Ic(e.unwrap())):e instanceof Mc?Mc.create(Ic(e.unwrap())):e instanceof xc?xc.create(e.items.map(t=>Ic(t))):e}let Tc=(()=>{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 W(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 Fo&&"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 li(o,o.data[d],o.path,d)),alwaysSet:d in o.data});if(this._def.catchall instanceof Fo){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&&(W(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 li(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=>ln.mergeObjectSync(s,d)):ln.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 Ic(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 Fs;)a=a._def.innerType;i[s]=a}}),new e({...this._def,shape:()=>i})}keyof(){return i2(Re.objectKeys(this.shape))}}return e.create=(t,r)=>new e({shape:()=>t,unknownKeys:"strip",catchall:Fo.create(),typeName:ce.ZodObject,...ye(r)}),e.strictCreate=(t,r)=>new e({shape:()=>t,unknownKeys:"strict",catchall:Fo.create(),typeName:ce.ZodObject,...ye(r)}),e.lazycreate=(t,r)=>new e({shape:t,unknownKeys:"strip",catchall:Fo.create(),typeName:ce.ZodObject,...ye(r)}),e})(),Ab=(()=>{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 Gi(l.ctx.common.issues));return W(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 Gi(u));return W(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 Wi=e=>e instanceof Rb?Wi(e.schema):e instanceof Bo?Wi(e.innerType()):e instanceof Ob?[e.value]:e instanceof Ls?e.options:e instanceof Xu?Re.objectValues(e.enum):e instanceof kb?Wi(e._def.innerType):e instanceof Tb?[void 0]:e instanceof xb?[null]:e instanceof Fs?[void 0,...Wi(e.unwrap())]:e instanceof Mc?[null,...Wi(e.unwrap())]:e instanceof Lb||e instanceof Fb?Wi(e.unwrap()):e instanceof Pb?Wi(e._def.innerType):[];class dg extends Ce{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==K.object)return W(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}):(W(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=Wi(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 dg({typeName:ce.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...ye(i)})}}function Mb(e,t){const r=Ps(e),i=Ps(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=Mb(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(wb(a)||wb(c))return ae;const l=Mb(a.value,c.value);return l.valid?((bb(a)||bb(c))&&i.dirty(),{status:i.value,value:l.data}):(W(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})(),xc=(()=>{class e extends Ce{_parse(r){const{status:i,ctx:s}=this._processInputParams(r);if(s.parsedType!==K.array)return W(s,{code:B.invalid_type,expected:K.array,received:s.parsedType}),ae;if(s.data.lengththis._def.items.length&&(W(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 li(s,c,s.path,l)):null}).filter(c=>!!c);return s.common.async?Promise.all(a).then(c=>ln.mergeArray(i,c)):ln.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 Ju 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 W(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 li(i,c,i.path,c)),value:a._parse(new li(i,i.data[c],i.path,c)),alwaysSet:c in i.data});return i.common.async?ln.mergeObjectAsync(r,s):ln.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,i){return new Ju(r instanceof Ce?{keyType:t,valueType:r,typeName:ce.ZodRecord,...ye(i)}:{keyType:lg.create(),valueType:t,typeName:ce.ZodRecord,...ye(r)})}}let n2=(()=>{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 W(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 li(s,l,s.path,[d,"key"])),value:a._parse(new li(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})(),r2=(()=>{class e extends Ce{_parse(r){const{status:i,ctx:s}=this._processInputParams(r);if(s.parsedType!==K.set)return W(s,{code:B.invalid_type,expected:K.set,received:s.parsedType}),ae;const o=this._def;null!==o.minSize&&s.data.sizeo.maxSize.value&&(W(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 li(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 Ac extends Ce{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==K.function)return W(r,{code:B.invalid_type,expected:K.function,received:r.parsedType}),ae;function i(c,l){return ag({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,og(),Dc].filter(u=>!!u),issueData:{code:B.invalid_arguments,argumentsError:l}})}function s(c,l){return ag({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,og(),Dc].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 fg){const c=this;return En(U(function*(...l){const u=new Gi([]),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 En(function(...l){const u=c._def.args.safeParse(l,o);if(!u.success)throw new Gi([i(l,u.error)]);const d=Reflect.apply(a,this,u.data),f=c._def.returns.safeParse(d,o);if(!f.success)throw new Gi([s(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Ac({...this._def,args:xc.create(t).rest(Qu.create())})}returns(t){return new Ac({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,i){return new Ac({args:t||xc.create([]).rest(Qu.create()),returns:r||Qu.create(),typeName:ce.ZodFunction,...ye(i)})}}let Rb=(()=>{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})(),Ob=(()=>{class e extends Ce{_parse(r){if(r.data!==this._def.value){const i=this._getOrReturnCtx(r);return W(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 i2(e,t){return new Ls({values:e,typeName:ce.ZodEnum,...ye(t)})}class Ls extends Ce{constructor(){super(...arguments),Zu.set(this,void 0)}_parse(t){if("string"!=typeof t.data){const r=this._getOrReturnCtx(t);return W(r,{expected:Re.joinValues(this._def.values),received:r.parsedType,code:B.invalid_type}),ae}if(cg(this,Zu,"f")||Kk(this,Zu,new Set(this._def.values),"f"),!cg(this,Zu,"f").has(t.data)){const r=this._getOrReturnCtx(t);return W(r,{received:r.data,code:B.invalid_enum_value,options:this._def.values}),ae}return En(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 Ls.create(t,{...this._def,...r})}exclude(t,r=this._def){return Ls.create(this.options.filter(i=>!t.includes(i)),{...this._def,...r})}}Zu=new WeakMap,Ls.create=i2;class Xu extends Ce{constructor(){super(...arguments),Ku.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 W(i,{expected:Re.joinValues(s),received:i.parsedType,code:B.invalid_type}),ae}if(cg(this,Ku,"f")||Kk(this,Ku,new Set(Re.getValidEnumValues(this._def.values)),"f"),!cg(this,Ku,"f").has(t.data)){const s=Re.objectValues(r);return W(i,{received:i.data,code:B.invalid_enum_value,options:s}),ae}return En(t.data)}get enum(){return this._def.values}}Ku=new WeakMap,Xu.create=(e,t)=>new Xu({values:e,typeName:ce.ZodNativeEnum,...ye(t)});let fg=(()=>{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 W(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 En(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})(),Bo=(()=>{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=>{W(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?Sc(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?Sc(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(!Gu(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=>Gu(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})(),Fs=(()=>{class e extends Ce{_parse(r){return this._getType(r)===K.undefined?En(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})(),Mc=(()=>{class e extends Ce{_parse(r){return this._getType(r)===K.null?En(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})(),kb=(()=>{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})(),Pb=(()=>{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 Wu(o)?o.then(a=>({status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new Gi(s.common.issues)},input:s.data})})):{status:"valid",value:"valid"===o.status?o.value:this._def.catchValue({get error(){return new Gi(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})(),s2=(()=>{class e extends Ce{_parse(r){if(this._getType(r)!==K.nan){const s=this._getOrReturnCtx(r);return W(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 dJ=Symbol("zod_brand");class Lb 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 ed 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(),Sc(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 ed({in:t,out:r,typeName:ce.ZodPipeline})}}let Fb=(()=>{class e extends Ce{_parse(r){const i=this._def.innerType._parse(r),s=o=>(Gu(o)&&(o.value=Object.freeze(o.value)),o);return Wu(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 o2(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 fJ={object:Tc.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 a2=lg.create,c2=Cb.create,pJ=s2.create,gJ=Db.create,l2=Sb.create,mJ=Ib.create,yJ=e2.create,vJ=Tb.create,_J=xb.create,wJ=ug.create,bJ=Qu.create,EJ=Fo.create,CJ=t2.create,DJ=Yu.create,SJ=Tc.create,IJ=Tc.strictCreate,TJ=Ab.create,xJ=dg.create,AJ=Nb.create,MJ=xc.create,NJ=Ju.create,RJ=n2.create,OJ=r2.create,kJ=Ac.create,PJ=Rb.create,LJ=Ob.create,FJ=Ls.create,BJ=Xu.create,VJ=fg.create,u2=Bo.create,UJ=Fs.create,jJ=Mc.create,$J=Bo.createWithPreprocess,HJ=ed.create;var d2,z=Object.freeze({__proto__:null,defaultErrorMap:Dc,setErrorMap:function ZY(e){Zk=e},getErrorMap:og,makeIssue:ag,EMPTY_PATH:[],addIssueToContext:W,ParseStatus:ln,INVALID:ae,DIRTY:Sc,OK:En,isAborted:wb,isDirty:bb,isValid:Gu,isAsync:Wu,get util(){return Re},get objectUtil(){return Wk},ZodParsedType:K,getParsedType:Ps,ZodType:Ce,datetimeRegex:Xk,ZodString:lg,ZodNumber:Cb,ZodBigInt:Db,ZodBoolean:Sb,ZodDate:Ib,ZodSymbol:e2,ZodUndefined:Tb,ZodNull:xb,ZodAny:ug,ZodUnknown:Qu,ZodNever:Fo,ZodVoid:t2,ZodArray:Yu,ZodObject:Tc,ZodUnion:Ab,ZodDiscriminatedUnion:dg,ZodIntersection:Nb,ZodTuple:xc,ZodRecord:Ju,ZodMap:n2,ZodSet:r2,ZodFunction:Ac,ZodLazy:Rb,ZodLiteral:Ob,ZodEnum:Ls,ZodNativeEnum:Xu,ZodPromise:fg,ZodEffects:Bo,ZodTransformer:Bo,ZodOptional:Fs,ZodNullable:Mc,ZodDefault:kb,ZodCatch:Pb,ZodNaN:s2,BRAND:dJ,ZodBranded:Lb,ZodPipeline:ed,ZodReadonly:Fb,custom:o2,Schema:Ce,ZodSchema:Ce,late:fJ,get ZodFirstPartyTypeKind(){return ce},coerce:{string:e=>lg.create({...e,coerce:!0}),number:e=>Cb.create({...e,coerce:!0}),boolean:e=>Sb.create({...e,coerce:!0}),bigint:e=>Db.create({...e,coerce:!0}),date:e=>Ib.create({...e,coerce:!0})},any:wJ,array:DJ,bigint:gJ,boolean:l2,date:mJ,discriminatedUnion:xJ,effect:u2,enum:FJ,function:kJ,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>o2(r=>r instanceof e,t),intersection:AJ,lazy:PJ,literal:LJ,map:RJ,nan:pJ,nativeEnum:BJ,never:EJ,null:_J,nullable:jJ,number:c2,object:SJ,oboolean:()=>l2().optional(),onumber:()=>c2().optional(),optional:UJ,ostring:()=>a2().optional(),pipeline:HJ,preprocess:$J,promise:VJ,record:NJ,set:OJ,strictObject:IJ,string:a2,symbol:yJ,transformer:u2,tuple:MJ,undefined:vJ,union:TJ,unknown:bJ,void:CJ,NEVER:ae,ZodIssueCode:B,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:Gi});class st{static id(){return z.string().regex(/^[0-9a-f]{64}$/)}static event(){return z.object({id:st.id(),kind:z.number().int().nonnegative(),pubkey:st.id(),tags:z.string().array().array(),content:z.string(),created_at:z.number().int().nonnegative(),sig:z.string()})}static filter(){return z.object({kinds:z.number().int().nonnegative().array().optional(),ids:st.id().array().optional(),authors:st.id().array().optional(),since:z.number().int().nonnegative().optional(),until:z.number().int().nonnegative().optional(),limit:z.number().int().nonnegative().optional(),search:z.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 z.string().regex(/^[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}$/).refine(r=>!t||r.startsWith(`${t}1`))}static clientEVENT(){return z.tuple([z.literal("EVENT"),st.event()])}static clientREQ(){return z.tuple([z.literal("REQ"),z.string()]).rest(st.filter())}static clientCOUNT(){return z.tuple([z.literal("COUNT"),z.string()]).rest(st.filter())}static clientCLOSE(){return z.tuple([z.literal("CLOSE"),z.string()])}static clientAUTH(){return z.tuple([z.literal("AUTH"),st.event()])}static clientMsg(){return z.union([st.clientEVENT(),st.clientREQ(),st.clientCOUNT(),st.clientCLOSE(),st.clientAUTH()])}static relayEVENT(){return z.tuple([z.literal("EVENT"),z.string(),st.event()])}static relayOK(){return z.tuple([z.literal("OK"),st.id(),z.boolean(),z.string()])}static relayEOSE(){return z.tuple([z.literal("EOSE"),z.string()])}static relayNOTICE(){return z.tuple([z.literal("NOTICE"),z.string()])}static relayCLOSED(){return z.tuple([z.literal("CLOSED"),z.string(),z.string()])}static relayAUTH(){return z.tuple([z.literal("AUTH"),z.string()])}static relayCOUNT(){return z.tuple([z.literal("COUNT"),z.string(),z.object({count:z.number().int().nonnegative(),approximate:z.boolean().optional()})])}static relayMsg(){return z.union([st.relayEVENT(),st.relayOK(),st.relayEOSE(),st.relayNOTICE(),st.relayCLOSED(),st.relayAUTH(),st.relayCOUNT()])}static metadata(){return z.object({about:z.string().optional().catch(void 0),banner:z.string().url().optional().catch(void 0),bot:z.boolean().optional().catch(void 0),display_name:z.string().optional().catch(void 0),lud06:st.bech32("lnurl").optional().catch(void 0),lud16:z.string().email().optional().catch(void 0),name:z.string().optional().catch(void 0),nip05:z.string().email().optional().catch(void 0),picture:z.string().url().optional().catch(void 0),website:z.string().url().optional().catch(void 0)}).passthrough()}static connectRequest(){return z.object({id:z.string(),method:z.string(),params:z.string().array()})}static connectResponse(){return z.object({id:z.string(),result:z.string(),error:z.string().optional()})}static json(){return z.string().transform((t,r)=>{try{return JSON.parse(t)}catch{return r.addIssue({code:z.ZodIssueCode.custom,message:"Invalid JSON"}),z.NEVER}})}}d2=Symbol.asyncDispose;class zJ{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 HY(1e3)}=this.opts;return new qY(this.url).withBuffer(new GY).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=hc}=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 sg(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=Is(a);l=!(h=yield ks(f.next())).done;l=!1){const p=h.value;if("EOSE"===p[0]&&(yield p),"CLOSED"===p[0])break;if("EVENT"===p[0]){if(!Op(t,p[2]))continue;yield p}}}catch(p){u=!0,d=p}finally{try{l&&null!=f.return&&(yield ks(f.return()))}finally{if(u)throw d}}}finally{i.send(["CLOSE",o])}})()}query(t,r){var i=this;return U(function*(){const s=new hr,o=t.reduce((f,h)=>f+hO(h),0);if(0===o)return[];var l,a=!1,c=!1;try{for(var d,u=Is(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 sg(function*(){if(r?.aborted)throw i.abortError();const s=new zk(r),o=f=>s.push(f.detail);i.ee.addEventListener(t,o);try{var l,a=!1,c=!1;try{for(var d,u=Is(s);a=!(d=yield ks(u.next())).done;a=!1)yield d.value}catch(f){c=!0,l=f}finally{try{a&&null!=u.return&&(yield ks(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=Is(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(Je.close,r,{once:!0})}))})()}[d2](){var t=this;return U(function*(){yield t.close()})()}}function td(e){return Ht((t,r)=>{try{t.subscribe(r)}finally{r.add(e)}})}function nd(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 Bb=(()=>{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(nd)}catch{}return"wss://relay.nostr.net".split(",").map(nd)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),hg=(()=>{class e extends $Y{constructor(r){var i,s;super({open:s=>new zJ(s),reqRouter:(s=U(function*(o){const a=[];return i.relayConfigService.getConfig().forEach(c=>{a.push([c,o])}),new Map(a)}),function(a){return s.apply(this,arguments)}),eventRouter:function(){var s=U(function*(){return i.relayConfigService.getConfig()});return function(){return s.apply(this,arguments)}}()}),i=this,this.relayConfigService=r}observe(r,i){var s=this;console.info((new Date).toLocaleString(),"[[subscribe filter]]",r);const o=new AbortController,a=i?.signal?AbortSignal.any([i.signal,o.signal]):o.signal,c=new Xe,l=new Map;return U(function*(){var f,u=!1,d=!1;try{for(var p,h=Is(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(),"event deduplicated, not emiting again: ",g[2]),console.debug((new Date).toLocaleString(),"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(td(()=>{console.info((new Date).toLocaleString(),"[[unsubscribe filter]]",r),o.abort()}))}static{this.\u0275fac=function(i){return new(i||e)(Z(Bb))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})(),h2=(()=>{class e{constructor(){this.pubkeySet=new Set,this.loadList()}loadList(){try{const r=sessionStorage.getItem("alwaysIgnoreWannachat");if(r){let i=JSON.parse(r);i instanceof Array?this.pubkeySet=new Set(i):sessionStorage.setItem("alwaysIgnoreWannachat","[]")}}catch{sessionStorage.setItem("alwaysIgnoreWannachat","[]")}}saveInList(r){this.pubkeySet.add(r),sessionStorage.setItem("alwaysIgnoreWannachat",JSON.stringify([...this.pubkeySet]))}isInList(r){return this.pubkeySet.has(r)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),p2=(()=>{class e{constructor(r,i){this.npool=r,this.ignoreListService=i}listenUserStatusUpdate(r,i){return console.info((new Date).toLocaleString(),"observing filter:",[{kinds:[cn.UserStatuses],authors:[r]}]),this.npool.observe([{kinds:[cn.UserStatuses],authors:[r]}],i)}queryWannachatResponse(r,i){return console.info((new Date).toLocaleString(),"quering filter:",[{kinds:[cn.UserStatuses],"#t":["chating","omegle"],"#p":[r.pubkey],limit:1}]),this.npool.query([{kinds:[cn.UserStatuses],"#t":["chating","omegle"],"#p":[r.pubkey],limit:1}],i)}listenWannachatResponse(r,i){return console.info((new Date).toLocaleString(),"observing filter:",[{kinds:[cn.UserStatuses],"#t":["chating","omegle"],"#p":[r.pubkey],limit:1}]),this.npool.observe([{kinds:[cn.UserStatuses],"#t":["chating","omegle"],"#p":[r.pubkey],limit:1}],i)}queryChatAvailable(r){var i=this;return U(function*(){const s=Math.floor((new Date).getTime()/1e3);console.info((new Date).toLocaleString(),"quering filter: ",[{kinds:[cn.UserStatuses],"#t":["wannachat","omegle"],since:s-600}]);let a=yield i.npool.query([{kinds:[cn.UserStatuses],"#t":["wannachat","omegle"],since:s-600}],r);a=a.filter(l=>!i.ignoreListService.isInList(l.pubkey));const c=a[Math.floor(Math.random()*a.length)];return c?console.info((new Date).toLocaleString(),"wanna chat found:",c):console.info((new Date).toLocaleString(),"wanna chat NOT found..."),Promise.resolve(c||null)})()}static{this.\u0275fac=function(i){return new(i||e)(Z(hg),Z(h2))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})();class Vo{constructor(t){const{type:r,data:i}=Mu.decode(t);if("nsec"===r)this.nsec=t,this.secretKey=i,this.pubkey=rO(this.secretKey),this.npub=Mu.npubEncode(this.pubkey);else{if("npub"!==r)throw new Error("Invalid argument, NostrUser expect nsec or npub string");this.npub=t,this.pubkey=i.toString(),this.nsec=void 0,this.secretKey=void 0}}static fromPubkey(t){return new Vo(Mu.npubEncode(t))}static fromSecretKeyBytes(t){return new Vo(Mu.nsecEncode(t))}static create(){return this.fromSecretKeyBytes(bW())}toString(){return this.pubkey}}class GJ extends Et{constructor(t,r){super()}schedule(t,r=0){return this}}const pg={setInterval(e,t,...r){const{delegate:i}=pg;return i?.setInterval?i.setInterval(e,t,...r):setInterval(e,t,...r)},clearInterval(e){const{delegate:t}=pg;return(t?.clearInterval||clearInterval)(e)},delegate:void 0},g2={now:()=>(g2.delegate||Date).now(),delegate:void 0};class rd{constructor(t,r=rd.now){this.schedulerActionCtor=t,this.now=r}schedule(t,r=0,i){return new this.schedulerActionCtor(this,t).schedule(i,r)}}rd.now=g2.now;const KJ=new class ZJ extends rd{constructor(t,r=rd.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 WJ extends GJ{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 pg.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&&pg.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,jd(i,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,super.unsubscribe()}}});function Bs(e){return this instanceof Bs?(this.v=e,this):new Bs(e)}function _2(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 $b(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 w2=e=>e&&"number"==typeof e.length&&"function"!=typeof e;function b2(e){return at(e?.then)}function E2(e){return at(e[Em])}function C2(e){return Symbol.asyncIterator&&at(e?.[Symbol.asyncIterator])}function D2(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 S2=function CX(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}();function I2(e){return at(e?.[S2])}function T2(e){return function v2(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 Bs?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 Bs(r.read());if(s)return yield Bs(void 0);yield yield Bs(i)}}finally{r.releaseLock()}})}function x2(e){return at(e?.getReader)}function Or(e){if(e instanceof $t)return e;if(null!=e){if(E2(e))return function DX(e){return new $t(t=>{const r=e[Em]();if(at(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(e);if(w2(e))return function SX(e){return new $t(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(C2(e))return A2(e);if(I2(e))return function TX(e){return new $t(t=>{for(const r of e)if(t.next(r),t.closed)return;t.complete()})}(e);if(x2(e))return function xX(e){return A2(T2(e))}(e)}throw D2(e)}function A2(e){return new $t(t=>{(function AX(e,t){var r,i,s,o;return function m2(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=_2(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 ui(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}const MX=Ud(e=>function(r=null){e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=r});function M2(e,t){const{first:r,each:i,with:s=NX,scheduler:o=t??KJ,meta:a=null}=function QJ(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 Ht((c,l)=>{let u,d,f=null,h=0;const p=g=>{d=ui(l,o,()=>{try{u.unsubscribe(),Or(s({meta:a,lastValue:f,seen:h})).subscribe(l)}catch(m){l.error(m)}},g)};u=c.subscribe(Ct(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 NX(e){throw new MX(e)}function Vs(e){return Ht((t,r)=>{let o,i=null,s=!1;i=t.subscribe(Ct(r,void 0,void 0,a=>{o=Or(e(a,Vs(e)(t))),i?(i.unsubscribe(),i=null,o.subscribe(r)):s=!0})),s&&(i.unsubscribe(),i=null,o.subscribe(r))})}function Nc(e,t){const r=at(e)?e:()=>e,i=s=>s.error(r());return new $t(t?s=>t.schedule(i,0,s):i)}let Hb=(()=>{class e{constructor(r){this.globalConfigService=r,this.largeExpirationTime=1800}getCurrentTimestamp(){return Math.floor(Date.now()/1e3)}getExpirationTimestamp(r=this.globalConfigService.wannachatStatusDefaultTimeoutInSeconds){const s=Math.floor(Date.now()/1e3)+r;return String(s)}createEncryptedDirectMessage(r,i,s){var o=this;return U(function*(){const a=yield Ru.encrypt(r.secretKey,i.pubkey,s),c={kind:cn.EncryptedDirectMessage,content:a,created_at:o.getCurrentTimestamp(),tags:[["p",i.pubkey],["expiration",o.getExpirationTimestamp(o.largeExpirationTime)]]},l=fr(c,r.secretKey);return Promise.resolve(l)})()}createWannaChatUserStatus(r,i=!1){return this.createUserStatus(r,"wannachat",[["expiration",this.getExpirationTimestamp()],["t","omegle"],["t","wannachat"]],i)}createDisconnectedUserStatus(r){return this.createUserStatus(r,"disconnected",[["expiration",this.getExpirationTimestamp()]])}createTypingUserStatus(r){return this.createUserStatus(r,"typing",[["t","omegle"],["expiration",this.getExpirationTimestamp(this.largeExpirationTime)]])}createChatingUserStatus(r,i,s=!1){return this.createUserStatus(r,"chating",[["expiration",this.getExpirationTimestamp(this.largeExpirationTime)],["p",i.pubkey],["t","omegle"],["t","chating"]],s)}deleteUserHistory(r){const i={kind:5,tags:[["k",String(cn.EncryptedDirectMessage)],["k",String(cn.UserStatuses)],["expiration",this.getExpirationTimestamp()]],created_at:Math.floor((new Date).getTime()/1e3),content:""};return fr(i,r.secretKey)}cleanUserStatus(r){return this.createUserStatus(r,"",[["expiration",this.getExpirationTimestamp(this.largeExpirationTime)],["t","omegle"]])}createUserStatus(r,i,s,o=!1){var a=this;return U(function*(){const c=[["d","general"],...s||[]];let l={kind:cn.UserStatuses,content:i,created_at:a.getCurrentTimestamp(),tags:c};if(o){const{data:u}=yield new Promise(d=>{const f=new Worker(wi.tu(new URL(wi.p+wi.u(929),wi.b)));f.onmessage=({data:h})=>d(h),f.postMessage({...l,pubkey:r.pubkey})});l=u}return fr(l,r.secretKey)})()}static{this.\u0275fac=function(i){return new(i||e)(Z(__))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),N2=(()=>{class e{constructor(r,i,s,o,a){this.nostrEventFactory=r,this.findStrangerNostr=i,this.ignoreListService=s,this.config=o,this.npool=a}publish(r){return this.npool.event(r)}searchStranger(r,i){var s=this;return U(function*(){const o=yield s.findStrangerNostr.queryChatAvailable(i),a=!0;if(o){console.info((new Date).toLocaleString(),"inviting ",o.pubkey," to chat and listening confirmation");const c=s.listenChatingConfirmation(o,r,i);yield s.inviteToChating(r,o,a);const l=yield c;return s.ignoreListService.saveInList(o.pubkey),l?Promise.resolve(Vo.fromPubkey(o.pubkey)):(yield s.disconnect(r),s.searchStranger(r,i))}return yield s.publishWannaChatStatus(r,a),new Promise(c=>{const l=s.findStrangerNostr.listenWannachatResponse(r,i).pipe(M2(1e3*s.config.wannachatStatusDefaultTimeoutInSeconds),Vs(u=>(l.unsubscribe(),s.deleteUserHistory(r).then(()=>s.searchStranger(r,i).then(d=>c(d))),Nc(()=>new u)))).subscribe({next:u=>{s.ignoreListService.saveInList(u.pubkey),s.replyChatInvitation(u,r).then(d=>d&&c(d)).catch(d=>{throw console.error(d),d}),l.unsubscribe()},error:u=>console.error((new Date).toLocaleString(),u)})})})()}replyChatInvitation(r,i){var s=this;return U(function*(){return console.info((new Date).toLocaleString(),"event was listen: ",r),console.info((new Date).toLocaleString(),"it must be a chating invitation from ",r.pubkey,", repling invitation..."),yield s.inviteToChating(i,r),console.info((new Date).toLocaleString(),"replied... resolving... "),console.info((new Date).toLocaleString(),"[searchStranger] unsubscribe"),Promise.resolve(Vo.fromPubkey(r.pubkey))})()}isChatingToMe(r,i){console.info((new Date).toLocaleString(),"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(),"is wannachat reply with chating?",s.length?"yes":"no"),!!s.length}inviteToChating(r,i,s=!1){const o=Vo.fromPubkey(i.pubkey);return this.publishChatInviteStatus(r,o,s)}listenChatingConfirmation(r,i,s){var o=this;return U(function*(){return new Promise(a=>{console.info((new Date).toLocaleString(),"listening status update from: ",r.pubkey);const c=o.findStrangerNostr.listenUserStatusUpdate(r.pubkey,s).pipe(M2(5e3),Vs(l=>Nc(()=>new Error("chat confirmation timeout after 5s waiting, there is no stranger connected to this session")))).subscribe({next:l=>o.receiveChatingConfirmation(c,l,r,i).then(u=>{"boolean"==typeof u&&a(u)}),error:l=>{console.error(l),a(!1)}})})})()}receiveChatingConfirmation(r,i,s,o){return i.id===s.id&&"wannachat"===i.content?(console.info((new Date).toLocaleString(),"stranger #wannachat status was listen, ignoring and waiting new status..."),Promise.resolve(void 0)):(r.unsubscribe(),console.info((new Date).toLocaleString(),"[listenUserStatusUpdate] unsubscribe"),console.info((new Date).toLocaleString(),"stranger ",s.pubkey," update status: ",i),this.isChatingToMe(i,o)?(console.info((new Date).toLocaleString(),'is "chating" status confirmed, resolved with true'),Promise.resolve(!0)):(console.info((new Date).toLocaleString(),"unexpected status was given, resolved with false, event: ",i),Promise.resolve(!1)))}publishWannaChatStatus(r,i=!1){var s=this;return U(function*(){const o=yield s.nostrEventFactory.createWannaChatUserStatus(r,i);return console.info((new Date).toLocaleString(),"updating my status to: ",o),yield s.npool.event(o),Promise.resolve(o)})()}publishChatInviteStatus(r,i,s=!1){var o=this;return U(function*(){const a=yield o.nostrEventFactory.createChatingUserStatus(r,i,s);return console.info((new Date).toLocaleString(),"updating my status to: ",a),yield o.npool.event(a),Promise.resolve(a)})()}deleteUserHistory(r){var i=this;return U(function*(){const s=i.nostrEventFactory.deleteUserHistory(r);console.info((new Date).toLocaleString(),"deleting user history"),yield i.npool.event(s)})()}connect(){const r=Vo.create();return this.ignoreListService.saveInList(r.pubkey),r}disconnect(r){var i=this;return U(function*(){const s=yield i.nostrEventFactory.createDisconnectedUserStatus(r);return console.info((new Date).toLocaleString(),"updating my status to: ",s),yield i.deleteUserHistory(r),yield i.npool.event(s),Promise.resolve(s)})()}static{this.\u0275fac=function(i){return new(i||e)(Z(Hb),Z(p2),Z(h2),Z(__),Z(hg))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})(),R2=(()=>{class e{constructor(r,i){this.nostrEventFactory=r,this.npool=i,this.updateUserCountTimeout=3e5}openEncryptedDirectMessage(r,i,s){return U(function*(){return Ru.decrypt(r.secretKey,i.pubkey,s.content)})()}listenMessages(r,i){return this.npool.observe([{kinds:[cn.EncryptedDirectMessage],authors:[i.pubkey],"#p":[r.pubkey]}])}listenStrangerStatus(r){return this.npool.observe([{kinds:[cn.UserStatuses],authors:[r.pubkey]}])}listenCurrenOnlineUsers(){const r=new Xe;let i=!1;const s=()=>{i||(i=!0,console.info((new Date).toLocaleString(),"user count requested"),this.npool.query([{kinds:[cn.UserStatuses],"#t":["omegle"],since:Math.floor(Date.now()/1e3)-86400}]).then(a=>{const c=new Set;console.info((new Date).toLocaleString(),"count events",a),a.forEach(u=>c.add(u.pubkey));const l=[...c].length;console.info((new Date).toLocaleString(),"active users counted: ",l),r.next(l),i=!1}).catch(a=>{console.error((new Date).toLocaleString(),"user count lauched error",a),i=!1,clearInterval(o)}))},o=setInterval(s,this.updateUserCountTimeout);return s(),r.asObservable().pipe(td(()=>clearInterval(o)))}sendMessage(r,i,s){var o=this;return U(function*(){yield o.stopTyping(r);const a=yield o.nostrEventFactory.createEncryptedDirectMessage(r,i,s);return o.npool.event(a)})()}isTyping(r){var i=this;return U(function*(){const s=yield i.nostrEventFactory.createTypingUserStatus(r);return i.npool.event(s)})()}stopTyping(r){var i=this;return U(function*(){const s=yield i.nostrEventFactory.cleanUserStatus(r);return i.npool.event(s)})()}static{this.\u0275fac=function(i){return new(i||e)(Z(Hb),Z(hg))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})(),RX=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Rt({type:e})}static{this.\u0275inj=Dt({providers:[p2,N2,R2],imports:[gs]})}}return e})();function O2(e,t=0){return Ht((r,i)=>{r.subscribe(Ct(i,s=>ui(i,e,()=>i.next(s),t),()=>ui(i,e,()=>i.complete(),t),s=>ui(i,e,()=>i.error(s),t)))})}function k2(e,t=0){return Ht((r,i)=>{i.add(e.schedule(()=>r.subscribe(i),t))})}function P2(e,t){if(!e)throw new Error("Iterable cannot be null");return new $t(r=>{ui(r,t,()=>{const i=e[Symbol.asyncIterator]();ui(r,t,()=>{i.next().then(s=>{s.done?r.complete():r.next(s.value)})},0,!0)})})}function qt(e,t){return t?function VX(e,t){if(null!=e){if(E2(e))return function kX(e,t){return Or(e).pipe(k2(t),O2(t))}(e,t);if(w2(e))return function LX(e,t){return new $t(r=>{let i=0;return t.schedule(function(){i===e.length?r.complete():(r.next(e[i++]),r.closed||this.schedule())})})}(e,t);if(b2(e))return function PX(e,t){return Or(e).pipe(k2(t),O2(t))}(e,t);if(C2(e))return P2(e,t);if(I2(e))return function FX(e,t){return new $t(r=>{let i;return ui(r,t,()=>{i=e[S2](),ui(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(x2(e))return function BX(e,t){return P2(T2(e),t)}(e,t)}throw D2(e)}(e,t):Or(e)}function zb(e){return e[e.length-1]}function L2(e){return at(zb(e))?e.pop():void 0}function gg(e){return function UX(e){return e&&at(e.schedule)}(zb(e))?e.pop():void 0}function he(...e){return qt(e,gg(e))}const{isArray:jX}=Array,{getPrototypeOf:$X,prototype:HX,keys:zX}=Object;function F2(e){if(1===e.length){const t=e[0];if(jX(t))return{args:t,keys:null};if(function qX(e){return e&&"object"==typeof e&&$X(e)===HX}(t)){const r=zX(t);return{args:r.map(i=>t[i]),keys:r}}}return{args:e,keys:null}}const{isArray:GX}=Array;function B2(e){return Ue(t=>function WX(e,t){return GX(t)?e(...t):e(t)}(e,t))}function V2(e,t){return e.reduce((r,i,s)=>(r[i]=t[s],r),{})}function qb(...e){const t=gg(e),r=L2(e),{args:i,keys:s}=F2(e);if(0===i.length)return qt([],t);const o=new $t(function ZX(e,t,r=Zs){return i=>{U2(t,()=>{const{length:s}=e,o=new Array(s);let a=s,c=s;for(let l=0;l{const u=qt(e[l],t);let d=!1;u.subscribe(Ct(i,f=>{o[l]=f,d||(d=!0,c--),c||i.next(r(o.slice()))},()=>{--a||i.complete()}))},i)},i)}}(i,t,s?a=>V2(s,a):Zs));return r?o.pipe(B2(r)):o}function U2(e,t,r){e?ui(r,e,t):t()}const mg=Ud(e=>function(){e(this),this.name="EmptyError",this.message="no elements in sequence"});function un(e,t,r=1/0){return at(t)?un((i,s)=>Ue((o,a)=>t(i,o,s,a))(Or(e(i,s))),r):("number"==typeof t&&(r=t),Ht((i,s)=>function KX(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;Or(r(m,d++)).subscribe(Ct(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(Ct(t,p,()=>{f=!0,h()})),()=>{c?.()}}(i,s,e,r)))}function id(e=1/0){return un(Zs,e)}function Gb(...e){return function QX(){return id(1)}()(qt(e,gg(e)))}function j2(e){return new $t(t=>{Or(e()).subscribe(t)})}const di=new $t(e=>e.complete());function Wb(){return Ht((e,t)=>{let r=null;e._refCount++;const i=Ct(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 $2 extends $t{constructor(t,r){super(),this.source=t,this.subjectFactory=r,this._subject=null,this._refCount=0,this._connection=null,BC(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 Et;const r=this.getSubject();t.add(this.source.subscribe(Ct(r,void 0,()=>{this._teardown(),r.complete()},i=>{this._teardown(),r.error(i)},()=>this._teardown()))),t.closed&&(this._connection=null,t=Et.EMPTY)}return t}refCount(){return Wb()(this)}}function fi(e,t){return Ht((r,i)=>{let s=null,o=0,a=!1;const c=()=>a&&!s&&i.complete();r.subscribe(Ct(i,l=>{s?.unsubscribe();let u=0;const d=o++;Or(e(l,d)).subscribe(s=Ct(i,f=>i.next(t?t(l,f,d,u++):f),()=>{s=null,c()}))},()=>{a=!0,c()}))})}function Rc(e){return e<=0?()=>di:Ht((t,r)=>{let i=0;t.subscribe(Ct(r,s=>{++i<=e&&(r.next(s),e<=i&&r.complete())}))})}function Zi(e,t){return Ht((r,i)=>{let s=0;r.subscribe(Ct(i,o=>e.call(t,o,s++)&&i.next(o)))})}function yg(e){return Ht((t,r)=>{let i=!1;t.subscribe(Ct(r,s=>{i=!0,r.next(s)},()=>{i||r.next(e),r.complete()}))})}function H2(e=XX){return Ht((t,r)=>{let i=!1;t.subscribe(Ct(r,s=>{i=!0,r.next(s)},()=>i?r.complete():r.error(e())))})}function XX(){return new mg}function Us(e,t){const r=arguments.length>=2;return i=>i.pipe(e?Zi((s,o)=>e(s,o,i)):Zs,Rc(1),r?yg(t):H2(()=>new mg))}function sd(e,t){return at(t)?un(e,t,1):un(e,1)}function Cn(e,t,r){const i=at(e)||t||r?{next:e,error:t,complete:r}:e;return i?Ht((s,o)=>{var a;null===(a=i.subscribe)||void 0===a||a.call(i);let c=!0;s.subscribe(Ct(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 Zb(e){return e<=0?()=>di:Ht((t,r)=>{let i=[];t.subscribe(Ct(r,s=>{i.push(s),e{for(const s of i)r.next(s);r.complete()},void 0,()=>{i=null}))})}const ve="primary",od=Symbol("RouteTitle");class see{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 Oc(e){return new see(e)}function oee(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 q2(e){return e.length>0?e[e.length-1]:null}function js(e){return function OX(e){return!!e&&(e instanceof $t||at(e.lift)&&at(e.subscribe))}(e)?e:cu(e)?qt(Promise.resolve(e)):he(e)}const cee={exact:function Z2(e,t,r){if(!jo(e.segments,t.segments)||!vg(e.segments,t.segments,r)||e.numberOfChildren!==t.numberOfChildren)return!1;for(const i in t.children)if(!e.children[i]||!Z2(e.children[i],t.children[i],r))return!1;return!0},subset:K2},G2={exact:function lee(e,t){return hi(e,t)},subset:function uee(e,t){return Object.keys(t).length<=Object.keys(e).length&&Object.keys(t).every(r=>z2(e[r],t[r]))},ignored:()=>!0};function W2(e,t,r){return cee[r.paths](e.root,t.root,r.matrixParams)&&G2[r.queryParams](e.queryParams,t.queryParams)&&!("exact"===r.fragment&&e.fragment!==t.fragment)}function K2(e,t,r){return Q2(e,t,t.segments,r)}function Q2(e,t,r,i){if(e.segments.length>r.length){const s=e.segments.slice(0,r.length);return!(!jo(s,r)||t.hasChildren()||!vg(s,r,i))}if(e.segments.length===r.length){if(!jo(e.segments,r)||!vg(e.segments,r,i))return!1;for(const s in t.children)if(!e.children[s]||!K2(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!!(jo(e.segments,s)&&vg(e.segments,s,i)&&e.children[ve])&&Q2(e.children[ve],t,o,i)}}function vg(e,t,r){return t.every((i,s)=>G2[r](e[s].parameters,i.parameters))}class Uo{constructor(t=new We([],{}),r={},i=null){this.root=t,this.queryParams=r,this.fragment=i}get queryParamMap(){return this._queryParamMap??=Oc(this.queryParams),this._queryParamMap}toString(){return hee.serialize(this)}}class We{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 wg(this)}}class ad{constructor(t,r){this.path=t,this.parameters=r}get parameterMap(){return this._parameterMap??=Oc(this.parameters),this._parameterMap}toString(){return X2(this)}}function jo(e,t){return e.length===t.length&&e.every((r,i)=>r.path===t[i].path)}let kc=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:()=>new _g,providedIn:"root"})}}return e})();class _g{parse(t){const r=new Dee(t);return new Uo(r.parseRootSegment(),r.parseQueryParams(),r.parseFragment())}serialize(t){const r=`/${cd(t.root,!0)}`,i=function mee(e){const t=Object.entries(e).map(([r,i])=>Array.isArray(i)?i.map(s=>`${bg(r)}=${bg(s)}`).join("&"):`${bg(r)}=${bg(i)}`).filter(r=>r);return t.length?`?${t.join("&")}`:""}(t.queryParams),s="string"==typeof t.fragment?`#${function pee(e){return encodeURI(e)}(t.fragment)}`:"";return`${r}${i}${s}`}}const hee=new _g;function wg(e){return e.segments.map(t=>X2(t)).join("/")}function cd(e,t){if(!e.hasChildren())return wg(e);if(t){const r=e.children[ve]?cd(e.children[ve],!1):"",i=[];return Object.entries(e.children).forEach(([s,o])=>{s!==ve&&i.push(`${s}:${cd(o,!1)}`)}),i.length>0?`${r}(${i.join("//")})`:r}{const r=function fee(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?[cd(e.children[ve],!1)]:[`${s}:${cd(i,!1)}`]);return 1===Object.keys(e.children).length&&null!=e.children[ve]?`${wg(e)}/${r[0]}`:`${wg(e)}/(${r.join("//")})`}}function Y2(e){return encodeURIComponent(e).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function bg(e){return Y2(e).replace(/%3B/gi,";")}function Qb(e){return Y2(e).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function Eg(e){return decodeURIComponent(e)}function J2(e){return Eg(e.replace(/\+/g,"%20"))}function X2(e){return`${Qb(e.path)}${function gee(e){return Object.entries(e).map(([t,r])=>`;${Qb(t)}=${Qb(r)}`).join("")}(e.parameters)}`}const yee=/^[^\/()?;#]+/;function Yb(e){const t=e.match(yee);return t?t[0]:""}const vee=/^[^\/()?;=#]+/,wee=/^[^=?&#]+/,Eee=/^[^&#]+/;class Dee{constructor(t){this.url=t,this.remaining=t}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new We([],{}):new We([],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 We(t,r)),i}parseSegment(){const t=Yb(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new A(4009,!1);return this.capture(t),new ad(Eg(t),this.parseMatrixParams())}parseMatrixParams(){const t={};for(;this.consumeOptional(";");)this.parseParam(t);return t}parseParam(t){const r=function _ee(e){const t=e.match(vee);return t?t[0]:""}(this.remaining);if(!r)return;this.capture(r);let i="";if(this.consumeOptional("=")){const s=Yb(this.remaining);s&&(i=s,this.capture(i))}t[Eg(r)]=Eg(i)}parseQueryParam(t){const r=function bee(e){const t=e.match(wee);return t?t[0]:""}(this.remaining);if(!r)return;this.capture(r);let i="";if(this.consumeOptional("=")){const a=function Cee(e){const t=e.match(Eee);return t?t[0]:""}(this.remaining);a&&(i=a,this.capture(i))}const s=J2(r),o=J2(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=Yb(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 We([],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 eP(e){return e.segments.length>0?new We([],{[ve]:e}):e}function tP(e){const t={};for(const[i,s]of Object.entries(e.children)){const o=tP(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 See(e){if(1===e.numberOfChildren&&e.children[ve]){const t=e.children[ve];return new We(e.segments.concat(t.segments),t.children)}return e}(new We(e.segments,t))}function $o(e){return e instanceof Uo}function nP(e){let t;const s=eP(function r(o){const a={};for(const l of o.children){const u=r(l);a[l.outlet]=u}const c=new We(o.url,a);return o===e&&(t=c),c}(e.root));return t??s}function rP(e,t,r,i){let s=e;for(;s.parent;)s=s.parent;if(0===t.length)return Jb(s,s,s,r,i);const o=function Tee(e){if("string"==typeof e[0]&&1===e.length&&"/"===e[0])return new sP(!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 sP(r,t,i)}(t);if(o.toRoot())return Jb(s,s,new We([],{}),r,i);const a=function xee(e,t,r){if(e.isAbsolute)return new Dg(t,!0,0);if(!r)return new Dg(t,!1,NaN);if(null===r.parent)return new Dg(r,!0,0);const i=Cg(e.commands[0])?0:1;return function Aee(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 Dg(i,!1,s-o)}(r,r.segments.length-1+i,e.numberOfDoubleDots)}(o,s,e),c=a.processChildren?ud(a.segmentGroup,a.index,o.commands):oP(a.segmentGroup,a.index,o.commands);return Jb(s,a.segmentGroup,c,r,i)}function Cg(e){return"object"==typeof e&&null!=e&&!e.outlets&&!e.segmentPath}function ld(e){return"object"==typeof e&&null!=e&&e.outlets}function Jb(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:iP(e,t,r);const c=eP(tP(a));return new Uo(c,o,s)}function iP(e,t,r){const i={};return Object.entries(e.children).forEach(([s,o])=>{i[s]=o===t?r:iP(o,t,r)}),new We(e.segments,i)}class sP{constructor(t,r,i){if(this.isAbsolute=t,this.numberOfDoubleDots=r,this.commands=i,t&&i.length>0&&Cg(i[0]))throw new A(4003,!1);const s=i.find(ld);if(s&&s!==q2(i))throw new A(4004,!1)}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class Dg{constructor(t,r,i){this.segmentGroup=t,this.processChildren=r,this.index=i}}function oP(e,t,r){if(e??=new We([],{}),0===e.segments.length&&e.hasChildren())return ud(e,t,r);const i=function Nee(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(ld(c))break;const l=`${c}`,u=i0&&void 0===l)break;if(l&&u&&"object"==typeof u&&void 0===u.outlets){if(!cP(l,u,a))return o;i+=2}else{if(!cP(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=ud(e.children[ve],t,r);return new We(e.segments,o.children)}return Object.entries(i).forEach(([o,a])=>{"string"==typeof a&&(a=[a]),null!==a&&(s[o]=oP(e.children[o],t,a))}),Object.entries(e.children).forEach(([o,a])=>{void 0===i[o]&&(s[o]=a)}),new We(e.segments,s)}}function Xb(e,t,r){const i=e.segments.slice(0,t);let s=0;for(;s{"string"==typeof i&&(i=[i]),null!==i&&(t[r]=Xb(new We([],{}),0,i))}),t}function aP(e){const t={};return Object.entries(e).forEach(([r,i])=>t[r]=`${i}`),t}function cP(e,t,r){return e==r.path&&hi(t,r.parameters)}const dd="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 pi{constructor(t,r){this.id=t,this.url=r}}class fd extends pi{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 Ki extends pi{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 Kn=function(e){return e[e.Redirect=0]="Redirect",e[e.SupersededByNewNavigation=1]="SupersededByNewNavigation",e[e.NoDataFromResolver=2]="NoDataFromResolver",e[e.GuardRejected=3]="GuardRejected",e}(Kn||{}),Sg=function(e){return e[e.IgnoredSameUrlNavigation=0]="IgnoredSameUrlNavigation",e[e.IgnoredByUrlHandlingStrategy=1]="IgnoredByUrlHandlingStrategy",e}(Sg||{});class Ho extends pi{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 Pc extends pi{constructor(t,r,i,s){super(t,r),this.reason=i,this.code=s,this.type=Me.NavigationSkipped}}class eE extends pi{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 lP extends pi{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 Oee extends pi{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 kee extends pi{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 Pee extends pi{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 Lee extends pi{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 Fee{constructor(t){this.route=t,this.type=Me.RouteConfigLoadStart}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class Bee{constructor(t){this.route=t,this.type=Me.RouteConfigLoadEnd}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class Vee{constructor(t){this.snapshot=t,this.type=Me.ChildActivationStart}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Uee{constructor(t){this.snapshot=t,this.type=Me.ChildActivationEnd}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class jee{constructor(t){this.snapshot=t,this.type=Me.ActivationStart}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class $ee{constructor(t){this.snapshot=t,this.type=Me.ActivationEnd}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class uP{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 tE{}class Ig{constructor(t,r){this.url=t,this.navigationBehaviorOptions=r}}function kr(e){return e.outlet||ve}function hd(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 Zee{get injector(){return hd(this.route?.snapshot)??this.rootInjector}set injector(t){}constructor(t){this.rootInjector=t,this.outlet=null,this.route=null,this.children=new pd(this.rootInjector),this.attachRef=null}}let pd=(()=>{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 Zee(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(Tn))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();class dP{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=nE(t,this._root);return r?r.children.map(i=>i.value):[]}firstChild(t){const r=nE(t,this._root);return r&&r.children.length>0?r.children[0].value:null}siblings(t){const r=rE(t,this._root);return r.length<2?[]:r[r.length-2].children.map(s=>s.value).filter(s=>s!==t)}pathFromRoot(t){return rE(t,this._root).map(r=>r.value)}}function nE(e,t){if(e===t.value)return t;for(const r of t.children){const i=nE(e,r);if(i)return i}return null}function rE(e,t){if(e===t.value)return[t];for(const r of t.children){const i=rE(e,r);if(i.length)return i.unshift(t),i}return[]}class Pr{constructor(t,r){this.value=t,this.children=r}toString(){return`TreeNode(${this.value})`}}function Lc(e){const t={};return e&&e.children.forEach(r=>t[r.value.outlet]=r),t}class fP extends dP{constructor(t,r){super(t),this.snapshot=r,iE(this,t)}toString(){return this.snapshot.toString()}}function hP(e){const t=function Kee(e){const o=new xg([],{},{},"",{},ve,e,null,{});return new pP("",new Pr(o,[]))}(e),r=new Jn([new ad("",{})]),i=new Jn({}),s=new Jn({}),o=new Jn({}),a=new Jn(""),c=new Fc(r,i,o,a,s,ve,e,t.root);return c.snapshot=t.root,new fP(new Pr(c,[]),t)}class Fc{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[od]))??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=>Oc(t))),this._paramMap}get queryParamMap(){return this._queryParamMap??=this.queryParams.pipe(Ue(t=>Oc(t))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function Tg(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&&mP(s)&&(i.resolve[od]=s.title),i}class xg{get title(){return this.data?.[od]}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??=Oc(this.params),this._paramMap}get queryParamMap(){return this._queryParamMap??=Oc(this.queryParams),this._queryParamMap}toString(){return`Route(url:'${this.url.map(i=>i.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class pP extends dP{constructor(t,r){super(r),this.url=t,iE(this,r)}toString(){return gP(this._root)}}function iE(e,t){t.value._routerState=e,t.children.forEach(r=>iE(e,r))}function gP(e){const t=e.children.length>0?` { ${e.children.map(gP).join(", ")} } `:"";return`${e.value}${t}`}function sE(e){if(e.snapshot){const t=e.snapshot,r=e._futureSnapshot;e.snapshot=r,hi(t.queryParams,r.queryParams)||e.queryParamsSubject.next(r.queryParams),t.fragment!==r.fragment&&e.fragmentSubject.next(r.fragment),hi(t.params,r.params)||e.paramsSubject.next(r.params),function aee(e,t){if(e.length!==t.length)return!1;for(let r=0;rhi(r.parameters,t[i].parameters))}(e.url,t.url);return r&&!(!e.parent!=!t.parent)&&(!e.parent||oE(e.parent,t.parent))}function mP(e){return"string"==typeof e.title||null===e.title}let aE=(()=>{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(pd),this.location=O(rr),this.changeDetector=O(uu),this.inputBinder=O(Ag,{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 cE(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 cE{__ngOutletInjector(t){return new cE(this.route,this.childContexts,t)}constructor(t,r,i){this.route=t,this.childContexts=r,this.parent=i}get(t,r){return t===Fc?this.route:t===pd?this.childContexts:this.parent.get(t,r)}}const Ag=new q("");let yP=(()=>{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=qb([i.queryParams,i.params,i.data]).pipe(fi(([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 Jz(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=H({token:e,factory:e.\u0275fac})}}return e})();function gd(e,t,r){if(r&&e.shouldReuseRoute(t.value,r.value.snapshot)){const i=r.value;i._futureSnapshot=t.value;const s=function Yee(e,t,r){return t.children.map(i=>{for(const s of r.children)if(e.shouldReuseRoute(i.value,s.value.snapshot))return gd(e,i,s);return gd(e,i)})}(e,t,r);return new Pr(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=>gd(e,c)),a}}const i=function Jee(e){return new Fc(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=>gd(e,o));return new Pr(i,s)}}class lE{constructor(t,r){this.redirectTo=t,this.navigationBehaviorOptions=r}}const vP="ngNavigationCancelingError";function Mg(e,t){const{redirectTo:r,navigationBehaviorOptions:i}=$o(t)?{redirectTo:t,navigationBehaviorOptions:void 0}:t,s=_P(!1,Kn.Redirect);return s.url=r,s.navigationBehaviorOptions=i,s}function _P(e,t){const r=new Error(`NavigationCancelingError: ${e||""}`);return r[vP]=!0,r.cancellationCode=t,r}function wP(e){return!!e&&e[vP]}class tte{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),sE(this.futureState.root),this.activateChildRoutes(r,i,t)}deactivateChildRoutes(t,r,i){const s=Lc(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=Lc(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=Lc(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=Lc(r);t.children.forEach(o=>{this.activateRoutes(o,s[o.value.outlet],i),this.forwardEvent(new $ee(o.value.snapshot))}),t.children.length&&this.forwardEvent(new Uee(t.value.snapshot))}activateRoutes(t,r,i){const s=t.value,o=r?r.value:null;if(sE(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),sE(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 bP{constructor(t){this.path=t,this.route=this.path[this.path.length-1]}}class Ng{constructor(t,r){this.component=t,this.route=r}}function nte(e,t,r){const i=e._root;return md(i,t?t._root:null,r,[i.value])}function Bc(e,t){const r=Symbol(),i=t.get(e,r);return i===r?"function"!=typeof e||function p3(e){return null!==Wd(e)}(e)?t.get(e):e:i}function md(e,t,r,i,s={canDeactivateChecks:[],canActivateChecks:[]}){const o=Lc(t);return e.children.forEach(a=>{(function ite(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 ste(e,t,r){if("function"==typeof r)return r(e,t);switch(r){case"pathParamsChange":return!jo(e.url,t.url);case"pathParamsOrQueryParamsChange":return!jo(e.url,t.url)||!hi(e.queryParams,t.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!oE(e,t)||!hi(e.queryParams,t.queryParams);default:return!oE(e,t)}}(a,o,o.routeConfig.runGuardsAndResolvers);l?s.canActivateChecks.push(new bP(i)):(o.data=a.data,o._resolvedData=a._resolvedData),md(e,t,o.component?c?c.children:null:r,i,s),l&&c&&c.outlet&&c.outlet.isActivated&&s.canDeactivateChecks.push(new Ng(c.outlet.component,a))}else a&&yd(t,c,s),s.canActivateChecks.push(new bP(i)),md(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])=>yd(c,r.getContext(a),s)),s}function yd(e,t,r){const i=Lc(e),s=e.value;Object.entries(i).forEach(([o,a])=>{yd(a,s.component?t?t.children.getContext(o):null:t,r)}),r.canDeactivateChecks.push(new Ng(s.component&&t&&t.outlet&&t.outlet.isActivated?t.outlet.component:null,s))}function vd(e){return"function"==typeof e}function EP(e){return e instanceof mg||"EmptyError"===e?.name}const Rg=Symbol("INITIAL_VALUE");function Vc(){return fi(e=>qb(e.map(t=>t.pipe(Rc(1),function JX(...e){const t=gg(e);return Ht((r,i)=>{(t?Gb(e,r,t):Gb(e,r)).subscribe(i)})}(Rg)))).pipe(Ue(t=>{for(const r of t)if(!0!==r){if(r===Rg)return Rg;if(!1===r||fte(r))return r}return!0}),Zi(t=>t!==Rg),Rc(1)))}function fte(e){return $o(e)||e instanceof lE}function CP(e){return function i3(...e){return PC(e)}(Cn(t=>{if("boolean"!=typeof t)throw Mg(0,t)}),Ue(t=>!0===t))}class uE{constructor(t){this.segmentGroup=t||null}}class Og extends Error{constructor(t){super(),this.urlTree=t}}function Uc(e){return Nc(new uE(e))}class Ste{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 Uo)throw new Og(y);r=y}const a=this.applyRedirectCreateUrlTree(r,this.urlSerializer.parse(r),t,i);if("/"===r[0])throw new Og(a);return a}applyRedirectCreateUrlTree(t,r,i,s){const o=this.createSegmentGroup(t,r.root,i,s);return new Uo(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 We(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 dE={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function Ite(e,t,r,i,s){const o=DP(e,t,r);return o.matched?(i=function Hee(e,t){return e.providers&&!e._injector&&(e._injector=dh(e.providers,t,`Route: ${e.path}`)),e._injector??t}(t,i),function Ete(e,t,r,i){const s=t.canMatch;return s&&0!==s.length?he(s.map(a=>{const c=Bc(a,e);return js(function dte(e){return e&&vd(e.canMatch)}(c)?c.canMatch(t,r):Ci(e,()=>c(t,r)))})).pipe(Vc(),CP()):he(!0)}(i,t,r).pipe(Ue(a=>!0===a?o:{...dE}))):he(o)}function DP(e,t,r){if("**"===t.path)return function Tte(e){return{matched:!0,parameters:e.length>0?q2(e).parameters:{},consumedSegments:e,remainingSegments:[],positionalParamSegments:{}}}(r);if(""===t.path)return"full"===t.pathMatch&&(e.hasChildren()||r.length>0)?{...dE}:{matched:!0,consumedSegments:[],remainingSegments:r,parameters:{},positionalParamSegments:{}};const s=(t.matcher||oee)(r,e,t);if(!s)return{...dE};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 SP(e,t,r,i){return r.length>0&&function Mte(e,t,r){return r.some(i=>kg(e,t,i)&&kr(i)!==ve)}(e,r,i)?{segmentGroup:new We(t,Ate(i,new We(r,e.children))),slicedSegments:[]}:0===r.length&&function Nte(e,t,r){return r.some(i=>kg(e,t,i))}(e,r,i)?{segmentGroup:new We(e.segments,xte(e,r,i,e.children)),slicedSegments:r}:{segmentGroup:new We(e.segments,e.children),slicedSegments:r}}function xte(e,t,r,i){const s={};for(const o of r)if(kg(e,t,o)&&!i[kr(o)]){const a=new We([],{});s[kr(o)]=a}return{...i,...s}}function Ate(e,t){const r={};r[ve]=t;for(const i of e)if(""===i.path&&kr(i)!==ve){const s=new We([],{});r[kr(i)]=s}return r}function kg(e,t,r){return(!(e.hasChildren()||t.length>0)||"full"!==r.pathMatch)&&""===r.path}class Ote{}class Lte{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 Ste(this.urlSerializer,this.urlTree),this.absoluteRedirectCount=0,this.allowRedirects=!0}noMatchError(t){return new A(4002,`'${t.segmentGroup}'`)}recognize(){const t=SP(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(t).pipe(Ue(({children:r,rootSnapshot:i})=>{const s=new Pr(i,r),o=new pP("",s),a=function Iee(e,t,r=null,i=null){return rP(nP(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 xg([],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 Og)return this.urlTree=i.urlTree,this.match(i.urlTree.root);throw i instanceof uE?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 Pr?[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 qt(o).pipe(sd(a=>{const c=i.children[a],l=function Wee(e,t){const r=e.filter(i=>kr(i)===t);return r.push(...e.filter(i=>kr(i)!==t)),r}(r,a);return this.processSegmentGroup(t,l,c,a,s)}),function tee(e,t){return Ht(function eee(e,t,r,i,s){return(o,a)=>{let c=r,l=t,u=0;o.subscribe(Ct(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)),yg(null),function nee(e,t){const r=arguments.length>=2;return i=>i.pipe(e?Zi((s,o)=>e(s,o,i)):Zs,Zb(1),r?yg(t):H2(()=>new mg))}(),un(a=>{if(null===a)return Uc(i);const c=IP(a);return function Fte(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 qt(r).pipe(sd(l=>this.processSegmentAgainstRoute(l._injector??t,r,l,i,s,o,a,c).pipe(Vs(u=>{if(u instanceof uE)return he(null);throw u}))),Us(l=>!!l),Vs(l=>{if(EP(l))return function Rte(e,t,r){return 0===t.length&&!e.children[r]}(i,s,o)?he(new Ote):Uc(i);throw l}))}processSegmentAgainstRoute(t,r,i,s,o,a,c,l){return kr(i)===a||a!==ve&&kg(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):Uc(s):Uc(s)}expandSegmentAgainstRouteUsingRedirect(t,r,i,s,o,a,c){const{matched:l,parameters:u,consumedSegments:d,positionalParamSegments:f,remainingSegments:h}=DP(r,s,o);if(!l)return Uc(r);"string"==typeof s.redirectTo&&"/"===s.redirectTo[0]&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>31&&(this.allowRedirects=!1));const p=new xg(o,u,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,TP(s),kr(s),s.component??s._loadedComponent??null,s,xP(s)),g=Tg(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(un(y=>this.processSegment(t,i,r,y.concat(h),a,!1,c)))}matchSegmentAgainstRoute(t,r,i,s,o,a){const c=Ite(r,i,s,t);return"**"===i.path&&(r.children={}),c.pipe(fi(l=>l.matched?this.getChildConfig(t=i._injector??t,i,s).pipe(fi(({routes:u})=>{const d=i._loadedInjector??t,{parameters:f,consumedSegments:h,remainingSegments:p}=l,g=new xg(h,f,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,TP(i),kr(i),i.component??i._loadedComponent??null,i,xP(i)),m=Tg(g,a,this.paramsInheritanceStrategy);g.params=Object.freeze(m.params),g.data=Object.freeze(m.data);const{segmentGroup:y,slicedSegments:_}=SP(r,h,p,u);if(0===_.length&&y.hasChildren())return this.processChildren(d,u,y,g).pipe(Ue(w=>new Pr(g,w)));if(0===u.length&&0===_.length)return he(new Pr(g,[]));const v=kr(i)===o;return this.processSegment(d,u,y,_,v?ve:o,!0,g).pipe(Ue(w=>new Pr(g,w instanceof Pr?[w]:[])))})):Uc(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 bte(e,t,r,i){const s=t.canLoad;return void 0===s||0===s.length?he(!0):he(s.map(a=>{const c=Bc(a,e);return js(function ate(e){return e&&vd(e.canLoad)}(c)?c.canLoad(t,r):Ci(e,()=>c(t,r)))})).pipe(Vc(),CP())}(t,r,i).pipe(un(s=>s?this.configLoader.loadChildren(t,r).pipe(Cn(o=>{r._loadedRoutes=o.routes,r._loadedInjector=o.injector})):function Dte(){return Nc(_P(!1,Kn.GuardRejected))}())):he({routes:[],injector:t})}}function Bte(e){const t=e.value.routeConfig;return t&&""===t.path}function IP(e){const t=[],r=new Set;for(const i of e){if(!Bte(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=IP(i.children);t.push(new Pr(i.value,s))}return t.filter(i=>!r.has(i))}function TP(e){return e.data||{}}function xP(e){return e.resolve||{}}function AP(e){const t=e.children.map(r=>AP(r)).flat();return[e,...t]}function fE(e){return fi(t=>{const r=e(t);return r?qt(r).pipe(Ue(()=>t)):he(t)})}let MP=(()=>{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[od]}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:()=>O(zte),providedIn:"root"})}}return e})(),zte=(()=>{class e extends MP{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(bq))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const jc=new q("",{providedIn:"root",factory:()=>({})});let NP=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=ns({type:e,selectors:[["ng-component"]],standalone:!0,features:[Ah],decls:1,vars:0,template:function(i,s){1&i&&or(0,"router-outlet")},dependencies:[aE],encapsulation:2})}}return e})();function hE(e){const t=e.children&&e.children.map(hE),r=t?{...e,children:t}:{...e};return!r.component&&!r.loadComponent&&(t||r.loadChildren)&&r.outlet&&r.outlet!==ve&&(r.component=NP),r}const $c=new q("");let pE=(()=>{class e{constructor(){this.componentLoaders=new WeakMap,this.childrenLoaders=new WeakMap,this.compiler=O(iM)}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=js(r.loadComponent()).pipe(Ue(RP),Cn(o=>{this.onLoadEndListener&&this.onLoadEndListener(r),r._loadedComponent=o}),td(()=>{this.componentLoaders.delete(r)})),s=new $2(i,()=>new Xe).pipe(Wb());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 qte(e,t,r,i){return js(e.loadChildren()).pipe(Ue(RP),un(s=>s instanceof g1||Array.isArray(s)?he(s):qt(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($c,[],{optional:!0,self:!0}).flat()),{routes:a.map(hE),injector:o}}))}(i,this.compiler,r,this.onLoadEndListener).pipe(td(()=>{this.childrenLoaders.delete(i)})),a=new $2(o,()=>new Xe).pipe(Wb());return this.childrenLoaders.set(i,a),a}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function RP(e){return function Gte(e){return e&&"object"==typeof e&&"default"in e}(e)?e.default:e}let gE=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:()=>O(Wte),providedIn:"root"})}}return e})(),Wte=(()=>{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=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const OP=new q(""),kP=new q("");function Zte(e,t,r){const i=e.get(kP),s=e.get(on);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 Kte(e){return new Promise(t=>{yh({read:()=>setTimeout(t)},{injector:e})})}(e))),{onViewTransitionCreated:l}=i;return l&&Ci(e,()=>l({transition:c,from:t,to:r})),a})}const PP=new q("");let Pg=(()=>{class e{get hasRequestedNavigation(){return 0!==this.navigationId}constructor(){this.currentNavigation=null,this.currentTransition=null,this.lastSuccessfulNavigation=null,this.events=new Xe,this.transitionAbortSubject=new Xe,this.configLoader=O(pE),this.environmentInjector=O(Tn),this.urlSerializer=O(kc),this.rootContexts=O(pd),this.location=O(gu),this.inputBindingEnabled=null!==O(Ag,{optional:!0}),this.titleStrategy=O(MP),this.options=O(jc,{optional:!0})||{},this.paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly",this.urlHandlingStrategy=O(gE),this.createViewTransition=O(OP,{optional:!0}),this.navigationErrorHandler=O(PP,{optional:!0}),this.navigationId=0,this.afterPreactivation=()=>he(void 0),this.rootComponentType=null,this.configLoader.onLoadEndListener=s=>this.events.next(new Bee(s)),this.configLoader.onLoadStartListener=s=>this.events.next(new Fee(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:dd,restoredState:null,currentSnapshot:s.snapshot,targetSnapshot:null,currentRouterState:s,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.transitions.pipe(Zi(o=>0!==o.id),Ue(o=>({...o,extractedUrl:this.urlHandlingStrategy.extract(o.rawUrl)})),fi(o=>{let a=!1,c=!1;return he(o).pipe(fi(l=>{if(this.navigationId>o.id)return this.cancelNavigationTransition(o,"",Kn.SupersededByNewNavigation),di;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 Pc(l.id,this.urlSerializer.serialize(l.rawUrl),f,Sg.IgnoredSameUrlNavigation)),l.resolve(!1),di}if(this.urlHandlingStrategy.shouldProcessUrl(l.rawUrl))return he(l).pipe(fi(f=>{const h=this.transitions?.getValue();return this.events.next(new fd(f.id,this.urlSerializer.serialize(f.extractedUrl),f.source,f.restoredState)),h!==this.transitions?.getValue()?di:Promise.resolve(f)}),function Vte(e,t,r,i,s,o){return un(a=>function kte(e,t,r,i,s,o,a="emptyOnly"){return new Lte(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),Cn(f=>{o.targetSnapshot=f.targetSnapshot,o.urlAfterRedirects=f.urlAfterRedirects,this.currentNavigation={...this.currentNavigation,finalUrl:f.urlAfterRedirects};const h=new lP(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 fd(f,this.urlSerializer.serialize(h),p,g);this.events.next(y);const _=hP(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 Pc(l.id,this.urlSerializer.serialize(l.extractedUrl),f,Sg.IgnoredByUrlHandlingStrategy)),l.resolve(!1),di}}),Cn(l=>{const u=new Oee(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:nte(l.targetSnapshot,l.currentSnapshot,this.rootContexts)},o)),function hte(e,t){return un(r=>{const{targetSnapshot:i,currentSnapshot:s,guards:{canActivateChecks:o,canDeactivateChecks:a}}=r;return 0===a.length&&0===o.length?he({...r,guardsResult:!0}):function pte(e,t,r,i){return qt(e).pipe(un(s=>function wte(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=hd(t)??s,u=Bc(c,l);return js(function ute(e){return e&&vd(e.canDeactivate)}(u)?u.canDeactivate(e,t,r,i):Ci(l,()=>u(e,t,r,i))).pipe(Us())})).pipe(Vc()):he(!0)}(s.component,s.route,r,t,i)),Us(s=>!0!==s,!0))}(a,i,s,e).pipe(un(c=>c&&function ote(e){return"boolean"==typeof e}(c)?function gte(e,t,r,i){return qt(t).pipe(sd(s=>Gb(function yte(e,t){return null!==e&&t&&t(new Vee(e)),he(!0)}(s.route.parent,i),function mte(e,t){return null!==e&&t&&t(new jee(e)),he(!0)}(s.route,i),function _te(e,t,r){const i=t[t.length-1],o=t.slice(0,t.length-1).reverse().map(a=>function rte(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=>j2(()=>he(a.guards.map(l=>{const u=hd(a.node)??r,d=Bc(l,u);return js(function lte(e){return e&&vd(e.canActivateChild)}(d)?d.canActivateChild(i,e):Ci(u,()=>d(i,e))).pipe(Us())})).pipe(Vc())));return he(o).pipe(Vc())}(e,s.path,r),function vte(e,t,r){const i=t.routeConfig?t.routeConfig.canActivate:null;if(!i||0===i.length)return he(!0);const s=i.map(o=>j2(()=>{const a=hd(t)??r,c=Bc(o,a);return js(function cte(e){return e&&vd(e.canActivate)}(c)?c.canActivate(t,e):Ci(a,()=>c(t,e))).pipe(Us())}));return he(s).pipe(Vc())}(e,s.route,r))),Us(s=>!0!==s,!0))}(i,o,e,t):he(c)),Ue(c=>({...r,guardsResult:c})))})}(this.environmentInjector,l=>this.events.next(l)),Cn(l=>{if(o.guardsResult=l.guardsResult,l.guardsResult&&"boolean"!=typeof l.guardsResult)throw Mg(0,l.guardsResult);const u=new kee(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects),l.targetSnapshot,!!l.guardsResult);this.events.next(u)}),Zi(l=>!!l.guardsResult||(this.cancelNavigationTransition(l,"",Kn.GuardRejected),!1)),fE(l=>{if(l.guards.canActivateChecks.length)return he(l).pipe(Cn(u=>{const d=new Pee(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects),u.targetSnapshot);this.events.next(d)}),fi(u=>{let d=!1;return he(u).pipe(function Ute(e,t){return un(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 AP(l))a.add(u);let c=0;return qt(a).pipe(sd(l=>o.has(l)?function jte(e,t,r,i){const s=e.routeConfig,o=e._resolve;return void 0!==s?.title&&!mP(s)&&(o[od]=s.title),function $te(e,t,r,i){const s=Kb(e);if(0===s.length)return he({});const o={};return qt(s).pipe(un(a=>function Hte(e,t,r,i){const s=hd(t)??i,o=Bc(e,s);return js(o.resolve?o.resolve(t,r):Ci(s,()=>o(t,r)))}(e[a],t,r,i).pipe(Us(),Cn(c=>{if(c instanceof lE)throw Mg(new _g,c);o[a]=c}))),Zb(1),function ree(e){return Ue(()=>e)}(o),Vs(a=>EP(a)?di:Nc(a)))}(o,e,t,i).pipe(Ue(a=>(e._resolvedData=a,e.data=Tg(e,e.parent,r).resolve,null)))}(l,i,e,t):(l.data=Tg(l,l.parent,e).resolve,he(void 0))),Cn(()=>c++),Zb(1),un(l=>c===a.size?he(r):di))})}(this.paramsInheritanceStrategy,this.environmentInjector),Cn({next:()=>d=!0,complete:()=>{d||this.cancelNavigationTransition(u,"",Kn.NoDataFromResolver)}}))}),Cn(u=>{const d=new Lee(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects),u.targetSnapshot);this.events.next(d)}))}),fE(l=>{const u=d=>{const f=[];d.routeConfig?.loadComponent&&!d.routeConfig._loadedComponent&&f.push(this.configLoader.loadComponent(d.routeConfig).pipe(Cn(h=>{d.component=h}),Ue(()=>{})));for(const h of d.children)f.push(...u(h));return f};return qb(u(l.targetSnapshot.root)).pipe(yg(null),Rc(1))}),fE(()=>this.afterPreactivation()),fi(()=>{const{currentSnapshot:l,targetSnapshot:u}=o,d=this.createViewTransition?.(this.environmentInjector,l.root,u.root);return d?qt(d).pipe(Ue(()=>o)):he(o)}),Ue(l=>{const u=function Qee(e,t,r){const i=gd(e,t._root,r?r._root:void 0);return new fP(i,t)}(r.routeReuseStrategy,l.targetSnapshot,l.currentRouterState);return this.currentTransition=o={...l,targetRouterState:u},this.currentNavigation.targetRouterState=u,o}),Cn(()=>{this.events.next(new tE)}),((e,t,r,i)=>Ue(s=>(new tte(t,s.targetRouterState,s.currentRouterState,r,i).activate(e),s)))(this.rootContexts,r.routeReuseStrategy,l=>this.events.next(l),this.inputBindingEnabled),Rc(1),Cn({next:l=>{a=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new Ki(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 iee(e){return Ht((t,r)=>{Or(e).subscribe(Ct(r,()=>r.complete(),mm)),!r.closed&&t.subscribe(r)})}(this.transitionAbortSubject.pipe(Cn(l=>{throw l}))),td(()=>{!a&&!c&&this.cancelNavigationTransition(o,"",Kn.SupersededByNewNavigation),this.currentTransition?.id===o.id&&(this.currentNavigation=null,this.currentTransition=null)}),Vs(l=>{if(c=!0,wP(l))this.events.next(new Ho(o.id,this.urlSerializer.serialize(o.extractedUrl),l.message,l.cancellationCode)),function Xee(e){return wP(e)&&$o(e.url)}(l)?this.events.next(new Ig(l.url,l.navigationBehaviorOptions)):o.resolve(!1);else{const u=new eE(o.id,this.urlSerializer.serialize(o.extractedUrl),l,o.targetSnapshot??void 0);try{const d=Ci(this.environmentInjector,()=>this.navigationErrorHandler?.(u));if(d instanceof lE){const{message:f,cancellationCode:h}=Mg(0,d);this.events.next(new Ho(o.id,this.urlSerializer.serialize(o.extractedUrl),f,h)),this.events.next(new Ig(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 di}))}))}cancelNavigationTransition(r,i,s){const o=new Ho(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=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function Qte(e){return e!==dd}let Yte=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:()=>O(Xte),providedIn:"root"})}}return e})();class Jte{shouldDetach(t){return!1}store(t,r){}shouldAttach(t){return!1}retrieve(t){return null}shouldReuseRoute(t,r){return t.routeConfig===r.routeConfig}}let Xte=(()=>{class e extends Jte{static{this.\u0275fac=(()=>{let r;return function(s){return(r||(r=zt(e)))(s||e)}})()}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),LP=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:()=>O(ene),providedIn:"root"})}}return e})(),ene=(()=>{class e extends LP{constructor(){super(...arguments),this.location=O(gu),this.urlSerializer=O(kc),this.options=O(jc,{optional:!0})||{},this.canceledNavigationResolution=this.options.canceledNavigationResolution||"replace",this.urlHandlingStrategy=O(gE),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.currentUrlTree=new Uo,this.rawUrlTree=this.currentUrlTree,this.currentPageId=0,this.lastSuccessfulId=-1,this.routerState=hP(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 fd)this.stateMemento=this.createStateMemento();else if(r instanceof Pc)this.rawUrlTree=i.initialUrl;else if(r instanceof lP){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 tE?(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 Ho&&(r.code===Kn.GuardRejected||r.code===Kn.NoDataFromResolver)?this.restoreHistory(i):r instanceof eE?this.restoreHistory(i,!0):r instanceof Ki&&(this.lastSuccessfulId=r.id,this.currentPageId=this.browserPageId)}setBrowserUrl(r,i){const s=r instanceof Uo?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=zt(e)))(s||e)}})()}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var _d=function(e){return e[e.COMPLETE=0]="COMPLETE",e[e.FAILED=1]="FAILED",e[e.REDIRECTING=2]="REDIRECTING",e}(_d||{});function FP(e,t){e.events.pipe(Zi(r=>r instanceof Ki||r instanceof Ho||r instanceof eE||r instanceof Pc),Ue(r=>r instanceof Ki||r instanceof Pc?_d.COMPLETE:r instanceof Ho&&(r.code===Kn.Redirect||r.code===Kn.SupersededByNewNavigation)?_d.REDIRECTING:_d.FAILED),Zi(r=>r!==_d.REDIRECTING),Rc(1)).subscribe(()=>{t()})}function tne(e){throw e}const nne={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},rne={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};let gi=(()=>{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(WA),this.stateManager=O(LP),this.options=O(jc,{optional:!0})||{},this.pendingTasks=O(io),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.navigationTransitions=O(Pg),this.urlSerializer=O(kc),this.location=O(gu),this.urlHandlingStrategy=O(gE),this._events=new Xe,this.errorHandler=this.options.errorHandler||tne,this.navigated=!1,this.routeReuseStrategy=O(Yte),this.onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore",this.config=O($c,{optional:!0})?.flat()??[],this.componentInputBindingEnabled=!!O(Ag,{optional:!0}),this.eventsSubscription=new Et,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 Ho&&i.code!==Kn.Redirect&&i.code!==Kn.SupersededByNewNavigation)this.navigated=!0;else if(i instanceof Ki)this.navigated=!0;else if(i instanceof Ig){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||Qte(s.source),...a};this.scheduleNavigation(c,dd,null,l,{resolve:s.resolve,reject:s.reject,promise:s.promise})}(function sne(e){return!(e instanceof tE||e instanceof Ig)})(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),dd,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(hE),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=nP(s?s.snapshot:this.routerState.snapshot.root)}catch{("string"!=typeof r[0]||"/"!==r[0][0])&&(r=[]),f=this.currentUrlTree.root}return rP(f,r,d,u??null)}navigateByUrl(r,i={skipLocationChange:!1}){const s=$o(r)?r:this.parseUrl(r),o=this.urlHandlingStrategy.merge(s,this.rawUrlTree);return this.scheduleNavigation(o,dd,null,i)}navigate(r,i={skipLocationChange:!1}){return function ine(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 FP(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=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();class BP{}let cne=(()=>{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(Zi(r=>r instanceof Ki),sd(()=>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=dh(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 qt(s).pipe(id())}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(un(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?qt([o,this.loader.loadComponent(i)]).pipe(id()):o})}static{this.\u0275fac=function(i){return new(i||e)(Z(gi),Z(iM),Z(Tn),Z(BP),Z(pE))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const yE=new q("");let VP=(()=>{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 fd?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=r.navigationTrigger,this.restoredId=r.restoredState?r.restoredState.navigationId:0):r instanceof Ki?(this.lastId=r.id,this.scheduleScrollEvent(r,this.urlSerializer.parse(r.urlAfterRedirects).fragment)):r instanceof Pc&&r.code===Sg.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 uP&&(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 uP(r,"popstate"===this.lastSource?this.store[this.restoredId]:null,i))})},0)})}ngOnDestroy(){this.routerEventsSubscription?.unsubscribe(),this.scrollEventsSubscription?.unsubscribe()}static{this.\u0275fac=function(i){!function jI(){throw new Error("invalid")}()}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})();function mi(e,t){return{\u0275kind:e,\u0275providers:t}}function jP(){const e=O(Tt);return t=>{const r=e.get(ar);if(t!==r.components[0])return;const i=e.get(gi),s=e.get($P);1===e.get(vE)&&i.initialNavigation(),e.get(HP,null,Ie.Optional)?.setUpPreloading(),e.get(yE,null,Ie.Optional)?.init(),i.resetRootComponentType(r.componentTypes[0]),s.closed||(s.next(),s.complete(),s.unsubscribe())}}const $P=new q("",{factory:()=>new Xe}),vE=new q("",{providedIn:"root",factory:()=>1}),HP=new q("");function fne(e){return mi(0,[{provide:HP,useExisting:cne},{provide:BP,useExisting:e}])}function pne(e){return mi(9,[{provide:OP,useValue:Zte},{provide:kP,useValue:{skipNextTransition:!!e?.skipInitialTransition,...e}}])}const zP=new q("ROUTER_FORROOT_GUARD"),gne=[gu,{provide:kc,useClass:_g},gi,pd,{provide:Fc,useFactory:function UP(e){return e.routerState.root},deps:[gi]},pE,[]];let qP=(()=>{class e{constructor(r){}static forRoot(r,i){return{ngModule:e,providers:[gne,[],{provide:$c,multi:!0,useValue:r},{provide:zP,useFactory:_ne,deps:[[gi,new Jd,new Xd]]},{provide:jc,useValue:i||{}},i?.useHash?{provide:bo,useClass:r7}:{provide:bo,useClass:QM},{provide:yE,useFactory:()=>{const e=O(b9),t=O(Ne),r=O(jc),i=O(Pg),s=O(kc);return r.scrollOffset&&e.setOffset(r.scrollOffset),new VP(s,i,e,t,r)}},i?.preloadingStrategy?fne(i.preloadingStrategy).\u0275providers:[],i?.initialNavigation?wne(i):[],i?.bindToComponentInputs?mi(8,[yP,{provide:Ag,useExisting:yP}]).\u0275providers:[],i?.enableViewTransitions?pne().\u0275providers:[],[{provide:GP,useFactory:jP},{provide:Ph,multi:!0,useExisting:GP}]]}}static forChild(r){return{ngModule:e,providers:[{provide:$c,multi:!0,useValue:r}]}}static{this.\u0275fac=function(i){return new(i||e)(Z(zP,8))}}static{this.\u0275mod=Rt({type:e})}static{this.\u0275inj=Dt({})}}return e})();function _ne(e){return"guarded"}function wne(e){return["disabled"===e.initialNavigation?mi(3,[{provide:O0,multi:!0,useFactory:()=>{const t=O(gi);return()=>{t.setUpLocationChangeListener()}}},{provide:vE,useValue:2}]).\u0275providers:[],"enabledBlocking"===e.initialNavigation?mi(2,[{provide:vE,useValue:0},{provide:O0,multi:!0,deps:[Tt],useFactory:t=>{const r=t.get(t7,Promise.resolve());return()=>r.then(()=>new Promise(i=>{const s=t.get(gi),o=t.get($P);FP(s,()=>{i(!0)}),t.get(Pg).afterPreactivation=()=>(i(!0),o.closed?he(void 0):o),s.initialNavigation()}))}}]).\u0275providers:[]]}const GP=new q("");var Qi=function(e){return e.STRANGE="STRANGE",e.YOU="YOU",e}(Qi||{}),yi=function(e){return e.CONNECTED="CONNECTED",e.UP_TO_DISCONNECT="UP_TO_DISCONNECT",e.DISCONNECTED="DISCONNECTED",e.SEARCHING_STRANGER="SEARCHING_STRANGER",e}(yi||{});const Ene=["modalContainer"];function Cne(e,t){}class wd{static{this.modalInjectSubject=new Xe}static{this.modalInject$=wd.modalInjectSubject.asObservable()}constructor(t){this.component=t,this.injectData=null,this.cssClasses=[],this.outletName="default",this.subscription=new Et}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 Xe,r=this.injectData,i=this.component,s=this.outletName;return this.router?(this.subscription.add(this.router.events.pipe(Zi(o=>o instanceof fd)).pipe(Us()).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`),wd.modalInjectSubject.next({component:i,data:r,outletName:s,cssClasses:this.cssClasses,response:t}),t.asObservable()}}let WP=(()=>{class e{createModal(r){return new wd(r)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})(),Dne=(()=>{class e{constructor(r){this.ngZone=r,this.modalInject$=wd.modalInject$,this.classes=[],this.isOpen=!1,this.content=null,this.subscriptions=new Et,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&&_0(Ene,5,rr),2&i){let o;Th(o=xh())&&(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,Cne,0,0,"ng-template",null,0,NA)},encapsulation:2})}}return e})(),Sne=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Rt({type:e})}static{this.\u0275inj=Dt({providers:[WP]})}}return e})();class Ine{close(){this.response.complete()}}const dn=new q(""),Hs=new q("");function sL(e){return null!=e}function oL(e){return cu(e)?qt(e):e}function aL(e){let t={};return e.forEach(r=>{t=null!=r?{...t,...r}:t}),0===Object.keys(t).length?null:t}function cL(e,t){return t.map(r=>r(e))}function lL(e){return e.map(t=>function One(e){return!e.validate}(t)?t:r=>t.validate(r))}function wE(e){return null!=e?function uL(e){if(!e)return null;const t=e.filter(sL);return 0==t.length?null:function(r){return aL(cL(r,t))}}(lL(e)):null}function bE(e){return null!=e?function dL(e){if(!e)return null;const t=e.filter(sL);return 0==t.length?null:function(r){return function Tne(...e){const t=L2(e),{args:r,keys:i}=F2(e),s=new $t(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?V2(i,c):c),o.complete())}))}});return t?s.pipe(B2(t)):s}(cL(r,t).map(oL)).pipe(Ue(aL))}}(lL(e)):null}function fL(e,t){return null===e?[t]:Array.isArray(e)?[...e,t]:[e,t]}function EE(e){return e?Array.isArray(e)?e:[e]:[]}function Fg(e,t){return Array.isArray(e)?e.includes(t):e===t}function gL(e,t){const r=EE(t);return EE(e).forEach(s=>{Fg(r,s)||r.push(s)}),r}function mL(e,t){return EE(t).filter(r=>!Fg(e,r))}class yL{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=wE(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=bE(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 Dn extends yL{get formDirective(){return null}get path(){return null}}class vL{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 _L=(()=>{class e extends vL{constructor(r){super(r)}static{this.\u0275fac=function(i){return new(i||e)(k(Dn,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 bd="VALID",Vg="INVALID",Hc="PENDING",Ed="DISABLED";class zc{}class bL extends zc{constructor(t,r){super(),this.value=t,this.source=r}}class SE extends zc{constructor(t,r){super(),this.pristine=t,this.source=r}}class IE extends zc{constructor(t,r){super(),this.touched=t,this.source=r}}class Ug extends zc{constructor(t,r){super(),this.status=t,this.source=r}}function jg(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}class AE{constructor(t,r){this._pendingDirty=!1,this._hasOwnPendingAsyncValidator=null,this._pendingTouched=!1,this._onCollectionChange=()=>{},this._parent=null,this._status=pu(()=>this.statusReactive()),this.statusReactive=Wr(void 0),this._pristine=pu(()=>this.pristineReactive()),this.pristineReactive=Wr(!0),this._touched=pu(()=>this.touchedReactive()),this.touchedReactive=Wr(!1),this._events=new Xe,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 Xr(this.statusReactive)}set status(t){Xr(()=>this.statusReactive.set(t))}get valid(){return this.status===bd}get invalid(){return this.status===Vg}get pending(){return this.status==Hc}get disabled(){return this.status===Ed}get enabled(){return this.status!==Ed}get pristine(){return Xr(this.pristineReactive)}set pristine(t){Xr(()=>this.pristineReactive.set(t))}get dirty(){return!this.pristine}get touched(){return Xr(this.touchedReactive)}set touched(t){Xr(()=>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(gL(t,this._rawValidators))}addAsyncValidators(t){this.setAsyncValidators(gL(t,this._rawAsyncValidators))}removeValidators(t){this.setValidators(mL(t,this._rawValidators))}removeAsyncValidators(t){this.setAsyncValidators(mL(t,this._rawAsyncValidators))}hasValidator(t){return Fg(this._rawValidators,t)}hasAsyncValidator(t){return Fg(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 IE(!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 IE(!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 SE(!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 SE(!0,i))}markAsPending(t={}){this.status=Hc;const r=t.sourceControl??this;!1!==t.emitEvent&&(this._events.next(new Ug(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=Ed,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 bL(this.value,i)),this._events.next(new Ug(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=bd,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===bd||this.status===Hc)&&this._runAsyncValidator(i,t.emitEvent)}const r=t.sourceControl??this;!1!==t.emitEvent&&(this._events.next(new bL(this.value,r)),this._events.next(new Ug(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()?Ed:bd}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t,r){if(this.asyncValidator){this.status=Hc,this._hasOwnPendingAsyncValidator={emitEvent:!1!==r};const i=oL(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 Ug(this.status,r)),this._parent&&this._parent._updateControlsErrors(t,r,i)}_initObservables(){this.valueChanges=new dt,this.statusChanges=new dt}_calculateStatus(){return this._allControlsDisabled()?Ed:this.errors?Vg:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(Hc)?Hc:this._anyControlsHaveStatus(Vg)?Vg:bd}_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 SE(this.pristine,r))}_updateTouched(t={},r){this.touched=this._anyControlsTouched(),this._events.next(new IE(this.touched,r)),this._parent&&!t.onlySelf&&this._parent._updateTouched(t,r)}_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){jg(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 jne(e){return Array.isArray(e)?wE(e):e||null}(this._rawValidators)}_assignAsyncValidators(t){this._rawAsyncValidators=Array.isArray(t)?t.slice():t,this._composedAsyncValidatorFn=function $ne(e){return Array.isArray(e)?bE(e):e||null}(this._rawAsyncValidators)}}class ME extends AE{constructor(t,r,i){super(function TE(e){return(jg(e)?e.validators:e)||null}(r),function xE(e,t){return(jg(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 CL(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 EL(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 qc=new q("CallSetDisabledState",{providedIn:"root",factory:()=>$g}),$g="always";function qg(e,t){e.forEach(r=>{r.registerOnValidatorChange&&r.registerOnValidatorChange(t)})}function NE(e,t){const r=function hL(e){return e._rawValidators}(e);null!==t.validator?e.setValidators(fL(r,t.validator)):"function"==typeof r&&e.setValidators([r]);const i=function pL(e){return e._rawAsyncValidators}(e);null!==t.asyncValidator?e.setAsyncValidators(fL(i,t.asyncValidator)):"function"==typeof i&&e.setAsyncValidators([i]);const s=()=>e.updateValueAndValidity();qg(t._rawValidators,s),qg(t._rawAsyncValidators,s)}function DL(e,t){e._pendingDirty&&e.markAsDirty(),e.setValue(e._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1}const Jne={provide:Dn,useExisting:et(()=>Wg)},Dd=Promise.resolve();let Wg=(()=>{class e extends Dn{get submitted(){return Xr(this.submittedReactive)}constructor(r,i,s){super(),this.callSetDisabledState=s,this._submitted=pu(()=>this.submittedReactive()),this.submittedReactive=Wr(!1),this._directives=new Set,this.ngSubmit=new dt,this.form=new ME({},wE(r),bE(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(r){Dd.then(()=>{const i=this._findContainer(r.path);r.control=i.registerControl(r.name,r.control),function Cd(e,t,r=$g){NE(e,t),t.valueAccessor.writeValue(e.value),(e.disabled||"always"===r)&&t.valueAccessor.setDisabledState?.(e.disabled),function qne(e,t){t.valueAccessor.registerOnChange(r=>{e._pendingValue=r,e._pendingChange=!0,e._pendingDirty=!0,"change"===e.updateOn&&DL(e,t)})}(e,t),function Wne(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 Gne(e,t){t.valueAccessor.registerOnTouched(()=>{e._pendingTouched=!0,"blur"===e.updateOn&&e._pendingChange&&DL(e,t),"submit"!==e.updateOn&&e.markAsTouched()})}(e,t),function zne(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){Dd.then(()=>{const i=this._findContainer(r.path);i&&i.removeControl(r.name),this._directives.delete(r)})}addFormGroup(r){Dd.then(()=>{const i=this._findContainer(r.path),s=new ME({});(function SL(e,t){NE(e,t)})(s,r),i.registerControl(r.name,s),s.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(r){Dd.then(()=>{const i=this._findContainer(r.path);i&&i.removeControl(r.name)})}getFormGroup(r){return this.form.get(r.path)}updateModel(r,i){Dd.then(()=>{this.form.get(r.path).setValue(i)})}setValue(r){this.control.setValue(r)}onSubmit(r){return this.submittedReactive.set(!0),function IL(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(dn,10),k(Hs,10),k(qc,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([Jne]),je]})}}return e})();Promise.resolve();let kL=(()=>{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})(),Sre=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Rt({type:e})}static{this.\u0275inj=Dt({})}}return e})(),Tre=(()=>{class e{static withConfig(r){return{ngModule:e,providers:[{provide:qc,useValue:r.callSetDisabledState??$g}]}}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Rt({type:e})}static{this.\u0275inj=Dt({imports:[Sre]})}}return e})();function xre(e,t){if(1&e){const r=Yr();fe(0,"li")(1,"span"),Le(2),me(),fe(3,"button",18),$e("click",function(){const s=Zt(r).$implicit;return Kt(wt().removeRelay(s))}),Le(4,"\u2715"),me()()}if(2&e){const r=t.$implicit;be(2),Qa(r)}}let Are=(()=>{class e extends Ine{constructor(r){super(),this.relayConfigService=r,this.response=new Xe,this.relays=[]}ngOnInit(){this.relays=this.relayConfigService.getConfig()}removeRelay(r){const i=nd(r),o=this.relays.indexOf(i);-1!==o&&this.relays.splice(o,1)}addRelay(r){r.value&&(this.relays=[...new Set([...this.relays,nd(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(nd),this.save()}save(){this.relayConfigService.saveConfig([...new Set(this.relays)]),this.close()}static{this.\u0275fac=function(i){return new(i||e)(k(Bb))}}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=Yr();fe(0,"form")(1,"h1")(2,"span"),Le(3,"Configure nostr relays"),me(),fe(4,"button",1),$e("click",function(){return Zt(o),Kt(s.close())}),Le(5,"\u2715"),me()(),fe(6,"ul",2),sr(7,xre,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(){Zt(o);const c=Ka(15);return Kt(s.addRelay(c))}),me(),fe(16,"button",8),$e("click",function(){Zt(o);const c=Ka(15);return Kt(s.addRelay(c))}),wf(),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()()()(),bf(),fe(25,"div",17)(26,"button",8),$e("click",function(){return Zt(o),Kt(s.useDefault())}),Le(27,"Use default"),me(),fe(28,"button",8),$e("click",function(){return Zt(o),Kt(s.save())}),Le(29,"Save"),me()()()}2&i&&(be(7),qe("ngForOf",s.relays))},dependencies:[r_,kL,_L,Wg],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})(),jE=(()=>{class e extends Xe{constructor(){super()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),$E=(()=>{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(),i.message),this.error$.next(i.message)}):r.message?(console.error((new Date).toLocaleString(),r.message),this.error$.next(r.message)):(console.error((new Date).toLocaleString(),"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(jE))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),XL=(()=>{class e{notify(){new Audio("./assets/sound-notification.wav").play()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),Mre=(()=>{class e{constructor(){this.authorTypes={[Qi.STRANGE]:"Stranger",[Qi.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 Nre=["conversation"];function Rre(e,t){1&e&&(fe(0,"div",22),Le(1," You're now chatting with a random stranger. "),me())}function Ore(e,t){1&e&&(fe(0,"div",22),Le(1," Looking for someone you can chat with. "),me())}function kre(e,t){if(1&e&&(fe(0,"span",26),wf(),fe(1,"svg",27),or(2,"path",7)(3,"path",28),me(),bf(),fe(4,"span",29),Le(5),me()()),2&e){const r=wt().$implicit;be(5),Qa(r[1])}}function Pre(e,t){if(1&e&&(fe(0,"div",23)(1,"span"),Le(2),function AA(e,t){const r=we();let i;const s=e+Y;r.firstCreatePass?(i=function F5(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=Sf(!1),u=o();return Sf(l),function w0(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,kre,6,1,"span",25),me()),2&e){const r=t.$implicit,i=wt();be(),Ql("authorStranger",r[0].author===i.authorStrange)("authorYou",r[0].author===i.authorYou),be(),Jr("",MA(3,7,r[0].author),": "),be(3),Qa(r[0].text),be(),qe("ngIf",r[1])}}function Lre(e,t){1&e&&(fe(0,"div",22),Le(1," Stranger is typing... "),me())}function Fre(e,t){1&e&&(fe(0,"div",22),Le(1,"Stranger has disconnected."),me())}function Bre(e,t){1&e&&(fe(0,"div",22),Le(1,"You have disconnected."),me())}function Vre(e,t){if(1&e&&(Ga(0),sr(1,Fre,2,0,"div",13)(2,Bre,2,0,"div",13),Wa()),2&e){const r=wt();be(),qe("ngIf",r.whoDisconnected===r.authorStrange),be(),qe("ngIf",r.whoDisconnected===r.authorYou)}}function Ure(e,t){if(1&e){const r=Yr();fe(0,"button",30),$e("click",function(){return Zt(r),Kt(wt().findStranger())}),Le(1," Start "),me()}}function jre(e,t){if(1&e){const r=Yr();fe(0,"button",31),$e("click",function(){return Zt(r),Kt(wt().stopSearching())}),Le(1," Stop "),me()}}function $re(e,t){if(1&e){const r=Yr();fe(0,"button",31),$e("click",function(){Zt(r);const s=wt();return Kt(s.currentState=s.stateUpToDisconnect)}),Le(1," Stop "),me()}}function Hre(e,t){if(1&e){const r=Yr();fe(0,"button",32),$e("click",function(){Zt(r);const s=wt(),o=Ka(24);return s.disconnect(),Kt(s.cleanMessageField(o))}),Le(1," Really? "),me()}}const zre=[{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=yi.CONNECTED,this.stateUpToDisconnect=yi.UP_TO_DISCONNECT,this.stateDisconnected=yi.DISCONNECTED,this.stateSearchingStranger=yi.SEARCHING_STRANGER,this.authorStrange=Qi.STRANGE,this.authorYou=Qi.YOU,this.typingTimeoutAmount=2e3,this.typingTimeoutId=0,this.currentOnline=1,this.strangeIsTyping=!1,this.currentState=yi.DISCONNECTED,this.whoDisconnected=null,this.you=null,this.stranger=null,this.messages=[],this.controller=new AbortController,this.subscriptions=new Et}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.disconnect(),!0})()}configRelays(){this.modalService.createModal(Are).build()}findStranger(){this.whoDisconnected=null,this.currentState=this.stateSearchingStranger,this.messages=[];const r=this.you=this.findStrangerProxy.connect();console.info((new Date).toLocaleString(),"me: ",r.pubkey),this.findStrangerProxy.searchStranger(this.you,{signal:this.controller.signal}).then(i=>this.startConversation(r,i)).catch(i=>{throw console.error((new Date).toLocaleString(),i),this.strangeIsTyping=!1,this.currentState=yi.DISCONNECTED,this.whoDisconnected=null,this.stranger=null,i})}disconnect(){return this.you?(this.stranger=null,this.findStrangerProxy.disconnect(this.you).then(()=>(this.currentState=yi.DISCONNECTED,this.strangeIsTyping=!1,this.whoDisconnected||(this.whoDisconnected=Qi.YOU),Promise.resolve()))):Promise.resolve()}startConversation(r,i){console.log((new Date).toLocaleString(),"starting conversation, stranger: ",i),this.stranger=i,this.currentState=yi.CONNECTED,1===this.currentOnline&&(this.currentOnline=2),this.soundNotificationService.notify(),this.subscriptions.add(this.talkToStrangerNostr.listenMessages(r,i).subscribe({next:s=>this.addMessageFromStranger(r,i,s)})),this.subscriptions.add(this.talkToStrangerNostr.listenStrangerStatus(i).subscribe({next:s=>this.handleStrangerStatus(s)}))}addMessageFromStranger(r,i,s){this.talkToStrangerNostr.openEncryptedDirectMessage(r,i,s).then(o=>{this.messages.push([{text:o,author:Qi.STRANGE,time:s.created_at},null]),this.scrollConversationToTheEnd()})}handleStrangerStatus(r){"typing"===r.content?(this.strangeIsTyping=!0,this.scrollConversationToTheEnd()):"disconnected"===r.content?(this.strangeIsTyping=!1,this.whoDisconnected=Qi.STRANGE,this.currentState=yi.DISCONNECTED,this.disconnect()):this.strangeIsTyping=!1}sendMessage(r){var i=this;return U(function*(){const s=i.you,o=i.stranger;if(s&&o&&r.length){const a=[{author:Qi.YOU,text:r,time:Math.floor((new Date).getTime()/1e3)},null];i.messages.push(a),i.scrollConversationToTheEnd();try{yield i.talkToStrangerNostr.sendMessage(s,o,r)}catch(c){a[1]=i.globalErrorHandler.getErrorMessage(c).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.disconnect()}onTyping(){const r=this.you;r&&(this.typingTimeoutId||this.talkToStrangerNostr.isTyping(r),clearTimeout(this.typingTimeoutId),this.typingTimeoutId=Number(setTimeout(()=>{this.talkToStrangerNostr.stopTyping(r),this.typingTimeoutId=0},this.typingTimeoutAmount)))}static{this.\u0275fac=function(i){return new(i||e)(k($E),k(N2),k(R2),k(XL),k(WP))}}static{this.\u0275cmp=ns({type:e,selectors:[["omg-chat"]],viewQuery:function(i,s){if(1&i&&_0(Nre,5),2&i){let o;Th(o=xh())&&(s.conversationEl=o.first)}},hostBindings:function(i,s){1&i&&$e("beforeunload",function(){return s.onBeforeUnload()},0,wI)},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=Yr();fe(0,"section",3),or(1,"img",4),fe(2,"h2",5),Le(3,"Talk to strangers!"),me(),wf(),fe(4,"svg",6),$e("click",function(){return Zt(o),Kt(s.configRelays())}),or(5,"path",7)(6,"path",8)(7,"path",9),me(),bf(),fe(8,"h2",10),Le(9),me()(),fe(10,"main",11)(11,"section",12,0),sr(13,Rre,2,0,"div",13)(14,Ore,2,0,"div",13)(15,Pre,7,9,"div",14)(16,Lre,2,0,"div",13)(17,Vre,3,2,"ng-container",15),me(),fe(18,"form",16),sr(19,Ure,2,0,"button",17)(20,jre,2,0,"button",18)(21,$re,2,0,"button",18)(22,Hre,2,0,"button",19),fe(23,"textarea",20,1),$e("keydown.enter",function(){Zt(o);const c=Ka(24);return s.sendMessage(c.value),Kt(s.cleanMessageField(c))})("keydown",function(){return Zt(o),Kt(s.onTyping())}),me(),fe(25,"button",21,2),$e("click",function(){Zt(o);const c=Ka(24);return s.sendMessage(c.value),Kt(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.strangeIsTyping),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(),sn("disabled",s.currentState===s.stateDisconnected||s.currentState===s.stateSearchingStranger?"disabled":null),be(2),sn("disabled",s.currentState===s.stateDisconnected||s.currentState===s.stateSearchingStranger?"disabled":null))},dependencies:[r_,op,Mre],encapsulation:2})}}return e})()},{path:"",redirectTo:"chat",pathMatch:"full"}];let qre=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Rt({type:e})}static{this.\u0275inj=Dt({imports:[qP.forRoot(zre,{useHash:!0}),qP]})}}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 Gre(e,t){return{type:le.Trigger,name:e,definitions:t,options:{}}}function eF(e,t=null){return{type:le.Animate,styles:t,timings:e}}function Sd(e){return{type:le.Style,styles:e,offset:null}}function HE(e,t,r){return{type:le.State,name:e,styles:t,options:r}}function tF(e,t,r=null){return{type:le.Transition,expr:e,animation:t,options:r}}class Id{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 nF{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 rF=["toast-component",""];function Jre(e,t){if(1&e){const r=Yr();fe(0,"button",5),$e("click",function(){return Zt(r),Kt(wt().remove())}),fe(1,"span",6),Le(2,"\xd7"),me()()}}function Xre(e,t){if(1&e&&(Ga(0),Le(1),Wa()),2&e){const r=wt(2);be(),Jr("[",r.duplicatesCount+1,"]")}}function eie(e,t){if(1&e&&(fe(0,"div"),Le(1),sr(2,Xre,2,1,"ng-container",4),me()),2&e){const r=wt();Ri(r.options.titleClass),sn("aria-label",r.title),be(),Jr(" ",r.title," "),be(),qe("ngIf",r.duplicatesCount)}}function tie(e,t){if(1&e&&or(0,"div",7),2&e){const r=wt();Ri(r.options.messageClass),qe("innerHTML",r.message,Qy)}}function nie(e,t){if(1&e&&(fe(0,"div",8),Le(1),me()),2&e){const r=wt();Ri(r.options.messageClass),sn("aria-label",r.message),be(),Jr(" ",r.message," ")}}function rie(e,t){if(1&e&&(fe(0,"div"),or(1,"div",9),me()),2&e){const r=wt();be(),vo("width",r.width()+"%")}}class uie{_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 die{_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 fie{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new Xe;_activate=new Xe;_manualClose=new Xe;_resetTimeout=new Xe;_countDuplicate=new Xe;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 Zg{toastId;config;message;title;toastType;toastRef;_onTap=new Xe;_onAction=new Xe;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 sF=new q("ToastConfig");class hie extends die{_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 pie=(()=>{class e{_document=O(on);_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=H({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 mie=(()=>{class e{_overlayContainer=O(pie);_componentFactoryResolver=O(Vl);_appRef=O(ar);_document=O(on);_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 hie(r,this._componentFactoryResolver,this._appRef)}_createOverlayRef(r){return new gie(this._createPortalHost(r))}static \u0275fac=function(i){return new(i||e)};static \u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),qE=(()=>{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 fie(l),f=new Zg(this.index,o,u,s,r,d),p=Tt.create({providers:[{provide:Zg,useValue:f}],parent:this._injector}),g=new uie(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(sF),Z(mie),Z(Tt),Z(VN),Z(Ne))};static \u0275prov=H({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const yie={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=Wr(-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=Wr({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(qE),k(Zg),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&&(p0("@flyInOut",s._state),Ri(s.toastClasses),vo("display",s.displayStyle))},standalone:!0,features:[Ah],attrs:rF,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,Jre,3,0,"button",0)(1,eie,3,5,"div",1)(2,tie,1,3,"div",2)(3,nie,2,4,"div",3)(4,rie,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:[op],encapsulation:2,data:{animation:[Gre("flyInOut",[HE("inactive",Sd({opacity:0})),HE("active",Sd({opacity:1})),HE("removed",Sd({opacity:0})),tF("inactive => active",eF("{{ easeTime }}ms {{ easing }}")),tF("active => removed",eF("{{ easeTime }}ms {{ easing }}"))])]},changeDetection:0})}return e})()},vie=(e={})=>function tl(e){return{\u0275providers:e}}([{provide:sF,useValue:{default:yie,config:e}}]);let _ie=(()=>{class e{static forRoot(r={}){return{ngModule:e,providers:[vie(r)]}}static \u0275fac=function(i){return new(i||e)};static \u0275mod=Rt({type:e});static \u0275inj=Dt({})}return e})(),wie=(()=>{class e{constructor(r,i){this.error$=r,this.toastrService=i,this.subscriptions=new Et}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(jE),k(qE))}}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:[aE,Dne],encapsulation:2})}}return e})(),bie=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Rt({type:e})}static{this.\u0275inj=Dt({providers:[Bb],imports:[gs,Tre]})}}return e})(),Eie=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Rt({type:e})}static{this.\u0275inj=Dt({providers:[XL],imports:[gs]})}}return e})(),Cie=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Rt({type:e})}static{this.\u0275inj=Dt({imports:[gs,Eie,bie]})}}return e})(),Die=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Rt({type:e})}static{this.\u0275inj=Dt({providers:[Hb,hg],imports:[gs]})}}return e})();function oF(e){return new A(3e3,!1)}function qs(e){switch(e.length){case 0:return new Id;case 1:return e[0];default:return new nF(e)}}function aF(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 Wie(){return new A(3502,!1)}();return o}function GE(e,t,r,i){switch(t){case"start":e.onStart(()=>i(r&&WE(r,"start",e)));break;case"done":e.onDone(()=>i(r&&WE(r,"done",e)));break;case"destroy":e.onDestroy(()=>i(r&&WE(r,"destroy",e)))}}function WE(e,t,r){const o=ZE(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 ZE(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 cF(e){const t=e.indexOf(":");return[e.substring(1,t),e.slice(t+1)]}const sse=typeof document>"u"?null:document.documentElement;function KE(e){const t=e.parentNode||e.host||null;return t===sse?null:t}let Go=null,lF=!1;function uF(e,t){for(;t;){if(t===e)return!0;t=KE(t)}return!1}function dF(e,t,r){if(r)return Array.from(e.querySelectorAll(t));const i=e.querySelector(t);return i?[i]:[]}let QE=(()=>{class e{validateStyleProperty(r){return function ase(e){Go||(Go=function cse(){return typeof document<"u"?document.body:null}()||{},lF=!!Go.style&&"WebkitAppearance"in Go.style);let t=!0;return Go.style&&!function ose(e){return"ebkit"==e.substring(1,6)}(e)&&(t=e in Go.style,!t&&lF&&(t="Webkit"+e.charAt(0).toUpperCase()+e.slice(1)in Go.style)),t}(r)}containsElement(r,i){return uF(r,i)}getParentElement(r){return KE(r)}query(r,i,s){return dF(r,i,s)}computeStyle(r,i,s){return s||""}animate(r,i,s,o,a,c=[],l){return new Id(s,o)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})();class YE{static{this.NOOP=new QE}}class JE{}const use=1e3,XE="ng-enter",Kg="ng-leave",Qg="ng-trigger",Yg=".ng-trigger",hF="ng-animating",eC=".ng-animating";function Ji(e){if("number"==typeof e)return e;const t=e.match(/^(-?[\.\d]+)(m?s)/);return!t||t.length<2?0:tC(parseFloat(t[1]),t[2])}function tC(e,t){return"s"===t?e*use:e}function Jg(e,t,r){return e.hasOwnProperty("duration")?e:function fse(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(oF()),{duration:0,delay:0,easing:""};s=tC(parseFloat(c[1]),c[2]);const l=c[3];null!=l&&(o=tC(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 Sie(){return new A(3100,!1)}()),c=!0),o<0&&(t.push(function Iie(){return new A(3101,!1)}()),c=!0),c&&t.splice(l,0,oF())}return{duration:s,delay:o,easing:a}}(e,t,r)}function _i(e,t,r){t.forEach((i,s)=>{const o=rC(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=rC(i);e.style[s]=""})}function Td(e){return Array.isArray(e)?1==e.length?e[0]:function Wre(e,t=null){return{type:le.Sequence,steps:e,options:t}}(e):e}const nC=new RegExp("{{\\s*(.+?)\\s*}}","g");function gF(e){let t=[];if("string"==typeof e){let r;for(;r=nC.exec(e);)t.push(r[1]);nC.lastIndex=0}return t}function xd(e,t,r){const i=`${e}`,s=i.replace(nC,(o,a)=>{let c=t[a];return null==c&&(r.push(function xie(){return new A(3003,!1)}()),c=""),c.toString()});return s==i?e:s}const gse=/-+([a-z0-9])/g;function rC(e){return e.replace(gse,(...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 Aie(){return new A(3004,!1)}()}}function iC(e,t){return window.getComputedStyle(e)[t]}const vse=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 mF extends JE{normalizePropertyName(t,r){return rC(t)}normalizeStyleValue(t,r,i,s){let o="";const a=i.toString().trim();if(vse.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 Mie(){return new A(3005,!1)}())}return a+o}}const Xg="*";const em=new Set(["true","1"]),tm=new Set(["false","0"]);function yF(e,t){const r=em.has(e)||tm.has(e),i=em.has(t)||tm.has(t);return(s,o)=>{let a=e==Xg||e==s,c=t==Xg||t==o;return!a&&r&&"boolean"==typeof s&&(a=s?em.has(e):tm.has(e)),!c&&i&&"boolean"==typeof o&&(c=o?em.has(t):tm.has(t)),a&&c}}const Ese=new RegExp("s*:selfs*,?","g");function sC(e,t,r,i){return new Cse(e).build(t,r,i)}class Cse{constructor(t){this._driver=t}build(t,r,i){const s=new Ise(r);return this._resetContextStyleTimingState(s),Yn(this,Td(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 Nie(){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 Rie(){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=>{gF(l).forEach(u=>{a.hasOwnProperty(u)||o.add(u)})})}),o.size&&r.errors.push(function Oie(){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,Td(t.animation),r),s=function _se(e,t){const r=[];return"string"==typeof e?e.split(/\s*,\s*/).forEach(i=>function wse(e,t,r){if(":"==e[0]){const l=function bse(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 $ie(){return new A(3015,!1)}()),t;const s=i[1],o=i[2],a=i[3];t.push(yF(s,a)),"<"==o[0]&&(s!=Xg||a!=Xg)&&t.push(yF(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 xse(e,t){if(e.hasOwnProperty("duration"))return e;if("number"==typeof e)return oC(Jg(e,t).duration,0,"");const r=e;if(r.split(/\s+/).some(o=>"{"==o.charAt(0)&&"{"==o.charAt(1))){const o=oC(0,0,"");return o.dynamic=!0,o.strValue=r,o}const s=Jg(r,t);return oC(s.duration,s.delay,s.easing)}(t.timings,r.errors);r.currentAnimateTimings=i;let s,o=t.styles?t.styles:Sd({});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=Sd(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 Pie(){return new A(3010,!1)}()),f=!1),o=d.startTime),f&&u.set(l,{startTime:o,endTime:s}),r.options&&function pse(e,t,r){const i=t.params||{},s=gF(e);s.length&&s.forEach(o=>{i.hasOwnProperty(o)||r.push(function Tie(){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 Lie(){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 Tse(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,Td(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 Dse(e){const t=!!e.split(/\s*,\s*/).find(r=>":self"==r);return t&&(e=e.replace(Ese,"")),e=e.replace(/@\*/g,Yg).replace(/@\w+/g,r=>Yg+"-"+r.slice(1)).replace(/:animating/g,eC),[e,t]}(t.selector);r.currentQuerySelector=i.length?i+" "+o:o,Qn(r.collectedStyles,r.currentQuerySelector,new Map);const c=Yn(this,Td(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 Uie(){return new A(3013,!1)}());const i="full"===t.timings?{duration:0,delay:0,easing:"full"}:Jg(t.timings,r.errors,!0);return{type:le.Stagger,animation:Yn(this,Td(t.animation),r),timings:i,options:null}}}class Ise{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 Sse(e){return e?{...e}:null}(e.params)):e={},e}function oC(e,t,r){return{duration:e,delay:t,easing:r}}function aC(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 nm{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 Nse=new RegExp(":enter","g"),Ose=new RegExp(":leave","g");function cC(e,t,r,i,s,o=new Map,a=new Map,c,l,u=[]){return(new kse).buildKeyframes(e,t,r,i,s,o,a,c,l,u)}class kse{buildKeyframes(t,r,i,s,o,a,c,l,u,d=[]){u=u||new nm;const f=new lC(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()):[aC(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(xd(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=rm);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 Jg(r.params?xd(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=rm);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 rm={};class lC{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=rm,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=l||new im(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]=xd(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 lC(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=rm,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 Pse(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(Nse,"."+this._enterClassName)).replace(Ose,"."+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 jie(){return new A(3014,!1)}()),c}}class im{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 im(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 Lse(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=xd(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 aC(this.element,s,o,a,this.duration,this.startTime,this.easing,!1)}}class Pse extends im{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",wF(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",wF((r+p*i)/a)),o.push(h)}i=a,r=0,s="",t=o}return aC(this.element,t,this.preStyleProps,this.postStyleProps,i,r,s,!0)}}function wF(e,t=3){const r=Math.pow(10,t-1);return Math.round(e*r)/r}function bF(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 uC={};class EF{constructor(t,r,i){this._triggerName=t,this.ast=r,this._stateStyles=i}match(t,r,i,s){return function Fse(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||uC,g=this.buildStyles(i,c&&c.params||uC,f),m=l&&l.params||uC,y=this.buildStyles(s,m,f),_=new Set,v=new Map,w=new Map,b="void"===s,D={params:CF(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(T=>{S=Math.max(T.duration+T.delay,S)}),f.length?bF(r,this._triggerName,i,s,b,g,y,[],[],v,w,S,f):(C.forEach(T=>{const P=T.element,$=Qn(v,P,new Set);T.preStyleProps.forEach(j=>$.add(j));const V=Qn(w,P,new Set);T.postStyleProps.forEach(j=>V.add(j)),P!==r&&_.add(P)}),bF(r,this._triggerName,i,s,b,g,y,C,[..._.values()],v,w,S))}}function CF(e,t){const r={...t};return Object.entries(e).forEach(([i,s])=>{null!=s&&(r[i]=s)}),r}class Bse{constructor(t,r,i){this.styles=t,this.defaultParams=r,this.normalizer=i}buildStyles(t,r){const i=new Map,s=CF(t,this.defaultParams);return this.styles.styles.forEach(o=>{"string"!=typeof o&&o.forEach((a,c)=>{a&&(a=xd(a,s,r));const l=this.normalizer.normalizePropertyName(c,r);a=this.normalizer.normalizeStyleValue(c,l,a,r),i.set(c,a)})}),i}}class Use{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 Bse(s.style,s.options&&s.options.params||{},i))}),DF(this.states,"true","1"),DF(this.states,"false","0"),r.transitions.forEach(s=>{this.transitionFactories.push(new EF(t,s,this.states))}),this.fallbackTransition=function jse(e,t){return new EF(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 DF(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 $se=new nm;class Hse{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=sC(this._driver,r,i,[]);if(i.length)throw function Zie(){return new A(3503,!1)}();this._animations.set(t,o)}_buildPlayer(t,r,i){const s=t.element,o=aF(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,XE,Kg,new Map,new Map,i,$se,s),a.forEach(d=>{const f=Qn(c,d.element,new Map);d.postStyleProps.forEach(h=>f.set(h,null))})):(s.push(function Kie(){return new A(3300,!1)}()),a=[]),s.length)throw function Qie(){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 Yie(){return new A(3301,!1)}();return r}listen(t,r,i,s){const o=ZE(r,"","","");return GE(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 SF="ng-animate-queued",dC="ng-animate-disabled",Zse=[],IF={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Kse={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Lr="__ng_removed";class fC{get params(){return this.options.params}constructor(t,r=""){this.namespaceId=r;const i=t&&t.hasOwnProperty("value");if(this.value=function Xse(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 Ad="void",hC=new fC(Ad);class Qse{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,gr(r,this._hostClassName)}listen(t,r,i,s){if(!this._triggers.has(r))throw function Jie(){return new A(3302,!1)}();if(null==i||0==i.length)throw function Xie(){return new A(3303,!1)}();if(!function eoe(e){return"start"==e||"done"==e}(i))throw function ese(){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)||(gr(t,Qg),gr(t,Qg+"-"+r),c.set(r,hC)),()=>{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 tse(){return new A(3401,!1)}();return r}trigger(t,r,i,s=!0){const o=this._getTrigger(r),a=new pC(this.id,r,t);let c=this._engine.statesByElement.get(t);c||(gr(t,Qg),gr(t,Qg+"-"+r),this._engine.statesByElement.set(t,c=new Map));let l=c.get(r);const u=new fC(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&l&&u.absorbOptions(l.options),c.set(r,u),l||(l=hC),u.value!==Ad&&l.value===u.value){if(!function roe(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=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||(gr(t,SF),a.onStart(()=>{Gc(t,SF)})),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,Yg,!0);i.forEach(s=>{if(s[Lr])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,Ad,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)||hC,d=new fC(Ad),f=new pC(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[Lr];(!o||o===IF)&&(i.afterFlush(()=>this.clearElementCache(t)),i.destroyInnerAnimations(t),i._onRemovalComplete(t,r))}}insertNode(t,r){gr(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=ZE(o,i.triggerName,i.fromState.value,i.toState.value);l._data=t,GE(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 Yse{_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 Qse(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(sm(r)){const o=this._fetchNamespace(t);if(o)return o.trigger(r,i,s),!0}return!1}insertNode(t,r,i,s){if(!sm(r))return;const o=r[Lr];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),gr(t,dC)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),Gc(t,dC))}removeNode(t,r,i){if(sm(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[Lr]={namespaceId:t,setForRemoval:s,hasAnimation:i,removedBeforeQueried:!1,previousTriggersValues:o}}listen(t,r,i,s,o){return sm(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,Yg,!0);r.forEach(i=>this.destroyActiveAnimationsForElement(i)),0!=this.playersByQueriedElement.size&&(r=this.driver.query(t,eC,!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[Lr];if(r&&r.setForRemoval){if(t[Lr]=IF,r.namespaceId){this.destroyInnerAnimations(t);const i=this._fetchNamespace(r.namespaceId);i&&i.clearElementCache(t)}this._onRemovalComplete(t,r.setForRemoval)}t.classList?.contains(dC)&&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 nse(){return new A(3402,!1)}()}_flushAnimations(t,r){const i=new nm,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=XE+m++;g.set(x,R),E.forEach(M=>gr(M,R))});const y=[],_=new Set,v=new Set;for(let E=0;E_.add(M)):v.add(x))}const w=new Map,b=AF(h,Array.from(_));b.forEach((E,x)=>{const R=Kg+m++;w.set(x,R),E.forEach(M=>gr(M,R))}),t.push(()=>{p.forEach((E,x)=>{const R=g.get(x);E.forEach(M=>Gc(M,R))}),b.forEach((E,x)=>{const R=w.get(x);E.forEach(M=>Gc(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,G=R.element;if(D.push(M),this.collectedEnterElements.length){const Ae=G[Lr];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 Ln=Oe.get(R.triggerName);Ln.value=ot,Oe.set(R.triggerName,Ln)}}return void M.destroy()}}const J=!f||!this.driver.containsElement(f,G),ee=w.get(G),Se=g.get(G),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(G,ue.fromStyles)),M.onDestroy(()=>_i(G,ue.toStyles)),void s.push(M);if(R.isFallbackTransition)return M.onStart(()=>Wo(G,ue.fromStyles)),M.onDestroy(()=>_i(G,ue.toStyles)),void s.push(M);const gt=[];ue.timelines.forEach(Ae=>{Ae.stretchStartingKeyframe=!0,this.disabledNodes.has(Ae.element)||gt.push(Ae)}),ue.timelines=gt,i.append(G,ue.timelines),a.push({instruction:ue,player:M,element:G}),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((Ln,Xt)=>Oe.add(Xt))}}),ue.postStyleProps.forEach((Ae,ot)=>{let Oe=u.get(ot);Oe||u.set(ot,Oe=new Set),Ae.forEach((Ln,Xt)=>Oe.add(Xt))})});if(C.length){const E=[];C.forEach(x=>{E.push(function rse(){return new A(3505,!1)}())}),D.forEach(x=>x.destroy()),this.reportError(E)}const S=new Map,T=new Map;a.forEach(E=>{const x=E.element;i.has(x)&&(T.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=>NF(E,l,u)),$=new Map;xF($,this.driver,v,u,Yi).forEach(E=>{NF(E,l,u)&&P.push(E)});const j=new Map;p.forEach((E,x)=>{xF(j,this.driver,new Set(E),l,"!")}),P.forEach(E=>{const x=$.get(E),R=j.get(E);$.set(E,new Map([...x?.entries()??[],...R?.entries()??[]]))});const X=[],L=[],I={};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 G=I;if(T.size>1){let ee=x;const Se=[];for(;ee=ee.parentNode;){const ue=T.get(ee);if(ue){G=ue;break}Se.push(ee)}Se.forEach(ue=>T.set(ue,G))}const J=this._buildAnimation(R.namespaceId,M,S,o,j,$);if(R.setRealPlayer(J),G===I)X.push(R);else{const ee=this.playersByElement.get(G);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);G.length?toe(this,x,G):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==Ad;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[Lr];if(y&&y.removedBeforeQueried)return new Id(g.duration,g.delay);const _=m!==l,v=function noe(e){const t=[];return MF(e,t),t}((i.get(m)||Zse).map(S=>S.getRealPlayer())).filter(S=>!!S.element&&S.element===m),w=o.get(m),b=a.get(m),D=aF(this._normalizer,g.keyframes,w,b),C=this._buildPlayer(g,D,v);if(g.subTimeline&&s&&f.add(m),_){const S=new pC(t,c,m);S.setRealPlayer(C),u.push(S)}return C});u.forEach(g=>{Qn(this.playersByQueriedElement,g.element,[]).push(g),g.onDone(()=>function Jse(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=>gr(g,hF));const p=qs(h);return p.onDestroy(()=>{d.forEach(g=>Gc(g,hF)),_i(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 Id(t.duration,t.delay)}}class pC{constructor(t,r,i){this.namespaceId=t,this.triggerName=r,this.element=i,this._player=new Id,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=>GE(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 sm(e){return e&&1===e.nodeType}function TF(e,t){const r=e.style.display;return e.style.display=t??"none",r}function xF(e,t,r,i,s){const o=[];r.forEach(l=>o.push(TF(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[Lr]=Kse,a.push(u))}),e.set(u,d)});let c=0;return r.forEach(l=>TF(l,o[c++])),a}function AF(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 gr(e,t){e.classList?.add(t)}function Gc(e,t){e.classList?.remove(t)}function toe(e,t,r){qs(r).onDone(()=>e.processLeaveNode(t))}function MF(e,t){for(let r=0;rs.add(o)):t.set(e,i),r.delete(e),!0}class Md{constructor(t,r,i){this._driver=r,this._normalizer=i,this._triggerCache={},this.onRemovalComplete=(s,o)=>{},this._transitionEngine=new Yse(t.body,r,i),this._timelineEngine=new Hse(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=sC(this._driver,o,l,[]);if(l.length)throw function Gie(){return new A(3404,!1)}();c=function Vse(e,t,r){return new Use(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]=cF(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]=cF(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 Nd{static{this.initialStylesByElement=new WeakMap}constructor(t,r,i){this._element=t,this._startStyles=r,this._endStyles=i,this._state=0;let s=Nd.initialStylesByElement.get(t);s||Nd.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&&(Nd.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 gC(e){let t=null;return e.forEach((r,i)=>{(function soe(e){return"display"===e||"position"===e})(i)&&(t=t||new Map,t.set(i,r))}),t}class RF{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:iC(this.element,s))}),this.currentSnapshot=t}triggerCallback(t){const r="start"===t?this._onStartFns:this._onDoneFns;r.forEach(i=>i()),r.length=0}}class OF{validateStyleProperty(t){return!0}validateAnimatableStyleProperty(t){return!0}containsElement(t,r){return uF(t,r)}getParentElement(t){return KE(t)}query(t,r,i){return dF(t,r,i)}computeStyle(t,r,i){return iC(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 RF);(function mse(e,t){return 0===e||0===t})(i,s)&&d.forEach(p=>{p.currentSnapshot.forEach((g,m)=>u.set(m,g))});let f=function hse(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 yse(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,iC(e,c)))}}return t}(t,f,u);const h=function ioe(e,t){let r=null,i=null;return Array.isArray(t)&&t.length?(r=gC(t[0]),t.length>1&&(i=gC(t[t.length-1]))):t instanceof Map&&(r=gC(t)),r||i?new Nd(e,r,i):null}(t,f);return new RF(t,f,l,h)}}const kF="@.disabled";class PF{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==kF?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 ooe extends PF{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==kF?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 aoe(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 coe(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 loe{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 PF("",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 ooe(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 uoe=(()=>{class e extends Md{constructor(r,i,s){super(r,i,s)}ngOnDestroy(){this.flush()}static{this.\u0275fac=function(i){return new(i||e)(Z(on),Z(YE),Z(JE))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})();const LF=[{provide:JE,useFactory:function doe(){return new mF}},{provide:Md,useClass:uoe},{provide:oh,useFactory:function foe(e,t,r){return new loe(e,t,r)},deps:[m_,Md,Ne]}],mC=[{provide:YE,useFactory:()=>new OF},{provide:$S,useValue:"BrowserAnimations"},...LF],FF=[{provide:YE,useClass:QE},{provide:$S,useValue:"NoopAnimations"},...LF];let hoe=(()=>{class e{static withConfig(r){return{ngModule:e,providers:r.disableAnimations?FF:mC}}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Rt({type:e})}static{this.\u0275inj=Dt({providers:mC,imports:[LN]})}}return e})(),poe=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Rt({type:e})}static{this.\u0275inj=Dt({providers:[jE,$E,{provide:nr,useClass:$E}],imports:[gs,hoe]})}}return e})(),goe=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Rt({type:e,bootstrap:[wie]})}static{this.\u0275inj=Dt({imports:[Cie,LN,qre,Iq,RX,Sne,Die,_ie.forRoot({timeOut:1e4,positionClass:"toast-top-center",preventDuplicates:!0}),poe]})}}return e})();_q().bootstrapModule(goe).catch(e=>console.error(e))}},am=>{am(am.s=363)}]); \ No newline at end of file diff --git a/docs/polyfills.76501f31eddd659a.js b/docs/polyfills.76501f31eddd659a.js old mode 100755 new mode 100644 diff --git a/docs/runtime.36e1908757eb47d0.js b/docs/runtime.36e1908757eb47d0.js old mode 100755 new mode 100644 diff --git a/docs/styles.61a2f82fbeccb50e.css b/docs/styles.61a2f82fbeccb50e.css deleted file mode 100755 index a113a18..0000000 --- a/docs/styles.61a2f82fbeccb50e.css +++ /dev/null @@ -1 +0,0 @@ -*,*:before,*:after{margin:0;padding:0;box-sizing:inherit}html{box-sizing:border-box;font-size:62.5%}body{font-family:sans-serif;font-weight:400;line-height:1.6;background-color:#fff7ee;height:100vh}.navbar{display:flex;align-items:center;height:12%;box-shadow:0 .2rem 1rem #0000001a;background-color:#fff;padding:1rem}.logo{height:20rem}.description{font-size:2.7rem;margin-left:8rem;margin-top:1rem;transform:rotate(-6deg)}.config{margin:0 2rem 0 auto;cursor:pointer;color:#a5a5a5}.online{margin-right:1rem;font-size:2.7rem;color:#6cb5ff}.main{padding:1rem;display:flex;flex-direction:column;height:88%}.conversation{height:83%;background-color:#fff;border:1px solid #cccccc;border-top-left-radius:7px;border-top-right-radius:7px;padding:1.5rem 1.5rem 2rem;font-size:2rem;word-break:break-word;overflow-y:auto}.message{font-size:2rem;font-weight:700;color:#565656;margin-bottom:.7rem}.errorWrap{position:relative}.errorWrap .messageNotSent{color:#ff8100;margin:-.5rem 1rem;cursor:pointer}.errorWrap .messageNotSent:hover~.errorMessage{display:block}.errorWrap .errorMessage{border:1px solid;border-radius:5px;padding:.5rem 1rem;background-color:#ffdebd;position:absolute;display:none;top:-1rem;left:100%;white-space:nowrap}.errorWrap .errorMessage:before,.errorWrap .errorMessage:after{content:"";display:block;border:10px solid transparent;width:0px;height:0px;z-index:1;position:absolute;border-right-color:#000;white-space:nowrap;left:-20px;top:10px}.errorWrap .errorMessage:after{z-index:2;border:8px solid transparent;border-right-color:#ffdebd;left:-16px;top:12px}.chat{position:relative;margin-bottom:.7rem}.authorStranger{color:#ff0101;font-weight:700}.authorYou{color:#0101ff;font-weight:700}.form{height:17%;margin-top:1rem;display:grid;grid-template-columns:15rem 1fr 15rem;gap:1rem}.btn{height:100%;color:#121830;background-color:#fff;font-size:3rem;border:1px solid #cccccc;cursor:pointer}.btn:focus{outline:none}.btn:disabled{color:#999;cursor:default;background-color:#efefef4d}.bottomLeftRadius{border-bottom-left-radius:7px}.bottomRightRadius{border-bottom-right-radius:7px}.start:focus{outline:none}.textarea{height:100%;resize:none;font-family:inherit;font-size:2rem;border:1px solid #cccccc;padding:20px 15px}.textarea:focus{outline:none}.hide{display:none}.bold{font-weight:700}ul.relayList{list-style-type:none;margin:0;padding:0;overflow:auto;max-height:150px;margin-bottom:1rem}ul.relayList>li{margin:.5rem}ul.relayList>li .removeButton{color:#fff;background-color:transparent}ul.relayList>li:before{content:"";display:inline-block;background-color:#0c0;border-radius:2px;width:6px;height:6px;margin-right:8px}@media only screen and (max-width: 56.25em){.description{margin-left:6rem;font-size:2rem}.online{font-size:2rem}}@media only screen and (max-width: 48.125em){.online{display:none}}@media only screen and (max-width: 43.75em){.form{grid-template-columns:10rem 1fr 10rem}.btn{font-size:1.4rem}}@media only screen and (max-width: 31.25em){.conversation{height:90%}.form{height:10%;grid-template-columns:7rem 1fr 7rem}.btn{font-size:1.2rem}}@media only screen and (max-width: 32.5em){.description{display:none}}@media only screen and (max-width: 28.125em){.logo{height:12rem}}modal-outlet{display:flex;justify-content:center;align-items:center;background-color:#0000001a;border:0;position:fixed;inset:0;z-index:500}modal-outlet>*{margin:4rem auto;display:block;min-width:200px;max-width:250px;background-color:#fff;border-radius:15px;padding:1rem;box-sizing:border-box}.toast-center-center{top:50%;left:50%;transform:translate(-50%,-50%)}.toast-top-center{top:0;right:0;width:100%}.toast-bottom-center{bottom:0;right:0;width:100%}.toast-top-full-width{top:0;right:0;width:100%}.toast-bottom-full-width{bottom:0;right:0;width:100%}.toast-top-left{top:12px;left:12px}.toast-top-right{top:12px;right:12px}.toast-bottom-right{right:12px;bottom:12px}.toast-bottom-left{bottom:12px;left:12px}.toast-title{font-weight:700}.toast-message{word-wrap:break-word}.toast-message a,.toast-message label{color:#fff}.toast-message a:hover{color:#ccc;text-decoration:none}.toast-close-button{position:relative;right:-.3em;top:-.3em;float:right;font-size:20px;font-weight:700;color:#fff;text-shadow:0 1px 0 #ffffff}.toast-close-button:hover,.toast-close-button:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.4}button.toast-close-button{padding:0;cursor:pointer;background:transparent;border:0}.toast-container{pointer-events:none;position:fixed;z-index:999999}.toast-container *{box-sizing:border-box}.toast-container .ngx-toastr{position:relative;overflow:hidden;margin:0 0 6px;padding:15px 15px 15px 50px;width:300px;border-radius:3px;background-position:15px center;background-repeat:no-repeat;background-size:24px;box-shadow:0 0 12px #999;color:#fff}.toast-container .ngx-toastr:hover{box-shadow:0 0 12px #000;opacity:1;cursor:pointer}.toast-info{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA1MTIgNTEyJyB3aWR0aD0nNTEyJyBoZWlnaHQ9JzUxMic+PHBhdGggZmlsbD0ncmdiKDI1NSwyNTUsMjU1KScgZD0nTTI1NiA4QzExOS4wNDMgOCA4IDExOS4wODMgOCAyNTZjMCAxMzYuOTk3IDExMS4wNDMgMjQ4IDI0OCAyNDhzMjQ4LTExMS4wMDMgMjQ4LTI0OEM1MDQgMTE5LjA4MyAzOTIuOTU3IDggMjU2IDh6bTAgMTEwYzIzLjE5NiAwIDQyIDE4LjgwNCA0MiA0MnMtMTguODA0IDQyLTQyIDQyLTQyLTE4LjgwNC00Mi00MiAxOC44MDQtNDIgNDItNDJ6bTU2IDI1NGMwIDYuNjI3LTUuMzczIDEyLTEyIDEyaC04OGMtNi42MjcgMC0xMi01LjM3My0xMi0xMnYtMjRjMC02LjYyNyA1LjM3My0xMiAxMi0xMmgxMnYtNjRoLTEyYy02LjYyNyAwLTEyLTUuMzczLTEyLTEydi0yNGMwLTYuNjI3IDUuMzczLTEyIDEyLTEyaDY0YzYuNjI3IDAgMTIgNS4zNzMgMTIgMTJ2MTAwaDEyYzYuNjI3IDAgMTIgNS4zNzMgMTIgMTJ2MjR6Jy8+PC9zdmc+)}.toast-error{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA1MTIgNTEyJyB3aWR0aD0nNTEyJyBoZWlnaHQ9JzUxMic+PHBhdGggZmlsbD0ncmdiKDI1NSwyNTUsMjU1KScgZD0nTTI1NiA4QzExOSA4IDggMTE5IDggMjU2czExMSAyNDggMjQ4IDI0OCAyNDgtMTExIDI0OC0yNDhTMzkzIDggMjU2IDh6bTEyMS42IDMxMy4xYzQuNyA0LjcgNC43IDEyLjMgMCAxN0wzMzggMzc3LjZjLTQuNyA0LjctMTIuMyA0LjctMTcgMEwyNTYgMzEybC02NS4xIDY1LjZjLTQuNyA0LjctMTIuMyA0LjctMTcgMEwxMzQuNCAzMzhjLTQuNy00LjctNC43LTEyLjMgMC0xN2w2NS42LTY1LTY1LjYtNjUuMWMtNC43LTQuNy00LjctMTIuMyAwLTE3bDM5LjYtMzkuNmM0LjctNC43IDEyLjMtNC43IDE3IDBsNjUgNjUuNyA2NS4xLTY1LjZjNC43LTQuNyAxMi4zLTQuNyAxNyAwbDM5LjYgMzkuNmM0LjcgNC43IDQuNyAxMi4zIDAgMTdMMzEyIDI1Nmw2NS42IDY1LjF6Jy8+PC9zdmc+)}.toast-success{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA1MTIgNTEyJyB3aWR0aD0nNTEyJyBoZWlnaHQ9JzUxMic+PHBhdGggZmlsbD0ncmdiKDI1NSwyNTUsMjU1KScgZD0nTTE3My44OTggNDM5LjQwNGwtMTY2LjQtMTY2LjRjLTkuOTk3LTkuOTk3LTkuOTk3LTI2LjIwNiAwLTM2LjIwNGwzNi4yMDMtMzYuMjA0YzkuOTk3LTkuOTk4IDI2LjIwNy05Ljk5OCAzNi4yMDQgMEwxOTIgMzEyLjY5IDQzMi4wOTUgNzIuNTk2YzkuOTk3LTkuOTk3IDI2LjIwNy05Ljk5NyAzNi4yMDQgMGwzNi4yMDMgMzYuMjA0YzkuOTk3IDkuOTk3IDkuOTk3IDI2LjIwNiAwIDM2LjIwNGwtMjk0LjQgMjk0LjQwMWMtOS45OTggOS45OTctMjYuMjA3IDkuOTk3LTM2LjIwNC0uMDAxeicvPjwvc3ZnPg==)}.toast-warning{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA1NzYgNTEyJyB3aWR0aD0nNTc2JyBoZWlnaHQ9JzUxMic+PHBhdGggZmlsbD0ncmdiKDI1NSwyNTUsMjU1KScgZD0nTTU2OS41MTcgNDQwLjAxM0M1ODcuOTc1IDQ3Mi4wMDcgNTY0LjgwNiA1MTIgNTI3Ljk0IDUxMkg0OC4wNTRjLTM2LjkzNyAwLTU5Ljk5OS00MC4wNTUtNDEuNTc3LTcxLjk4N0wyNDYuNDIzIDIzLjk4NWMxOC40NjctMzIuMDA5IDY0LjcyLTMxLjk1MSA4My4xNTQgMGwyMzkuOTQgNDE2LjAyOHpNMjg4IDM1NGMtMjUuNDA1IDAtNDYgMjAuNTk1LTQ2IDQ2czIwLjU5NSA0NiA0NiA0NiA0Ni0yMC41OTUgNDYtNDYtMjAuNTk1LTQ2LTQ2LTQ2em0tNDMuNjczLTE2NS4zNDZsNy40MTggMTM2Yy4zNDcgNi4zNjQgNS42MDkgMTEuMzQ2IDExLjk4MiAxMS4zNDZoNDguNTQ2YzYuMzczIDAgMTEuNjM1LTQuOTgyIDExLjk4Mi0xMS4zNDZsNy40MTgtMTM2Yy4zNzUtNi44NzQtNS4wOTgtMTIuNjU0LTExLjk4Mi0xMi42NTRoLTYzLjM4M2MtNi44ODQgMC0xMi4zNTYgNS43OC0xMS45ODEgMTIuNjU0eicvPjwvc3ZnPg==)}.toast-container.toast-top-center .ngx-toastr,.toast-container.toast-bottom-center .ngx-toastr{width:300px;margin-left:auto;margin-right:auto}.toast-container.toast-top-full-width .ngx-toastr,.toast-container.toast-bottom-full-width .ngx-toastr{width:96%;margin-left:auto;margin-right:auto}.ngx-toastr{background-color:#030303;pointer-events:auto}.toast-success{background-color:#51a351}.toast-error{background-color:#bd362f}.toast-info{background-color:#2f96b4}.toast-warning{background-color:#f89406}.toast-progress{position:absolute;left:0;bottom:0;height:4px;background-color:#000;opacity:.4}@media all and (max-width: 240px){.toast-container .ngx-toastr.div{padding:8px 8px 8px 50px;width:11em}.toast-container .toast-close-button{right:-.2em;top:-.2em}}@media all and (min-width: 241px) and (max-width: 480px){.toast-container .ngx-toastr.div{padding:8px 8px 8px 50px;width:18em}.toast-container .toast-close-button{right:-.2em;top:-.2em}}@media all and (min-width: 481px) and (max-width: 768px){.toast-container .ngx-toastr.div{padding:15px 15px 15px 50px;width:25em}} diff --git a/docs/styles.d3fe2249b4699859.css b/docs/styles.d3fe2249b4699859.css new file mode 100644 index 0000000..a971e47 --- /dev/null +++ b/docs/styles.d3fe2249b4699859.css @@ -0,0 +1 @@ +*,*:before,*:after{margin:0;padding:0;box-sizing:inherit}html{box-sizing:border-box;font-size:62.5%}body{font-family:sans-serif;font-weight:400;line-height:1.6;background-color:#fff7ee;height:100vh}.navbar{display:flex;align-items:center;height:12%;box-shadow:0 .2rem 1rem #0000001a;background-color:#fff;padding:1rem}.logo{height:20rem}.description{font-size:2.7rem;margin-left:8rem;margin-top:1rem;transform:rotate(-6deg)}.config{margin:0 2rem 0 auto;cursor:pointer;color:#a5a5a5}.online{margin-right:1rem;font-size:2.7rem;color:#6cb5ff}.main{padding:1rem;display:flex;flex-direction:column;height:88%}.conversation{height:83%;background-color:#fff;border:1px solid #cccccc;border-top-left-radius:7px;border-top-right-radius:7px;padding:1.5rem 1.5rem 2rem;font-size:2rem;word-break:break-word;overflow-y:auto}.message{font-size:2rem;font-weight:700;color:#565656;margin-bottom:.7rem}.warn{border:1px solid;border-radius:5px;display:block;padding:.5rem 1rem;background-color:#ffdebd;text-wrap:balance;text-align:center;width:70%;margin:.5rem auto}.errorWrap{position:relative}.errorWrap .messageNotSent{color:#ff8100;margin:-.5rem 1rem;cursor:pointer}.errorWrap .messageNotSent:hover~.errorMessage{display:block}.errorWrap .errorMessage{border:1px solid;border-radius:5px;padding:.5rem 1rem;background-color:#ffdebd;position:absolute;display:none;top:-1rem;left:100%;white-space:nowrap}.errorWrap .errorMessage:before,.errorWrap .errorMessage:after{content:"";display:block;border:10px solid transparent;width:0px;height:0px;z-index:1;position:absolute;border-right-color:#000;white-space:nowrap;left:-20px;top:10px}.errorWrap .errorMessage:after{z-index:2;border:8px solid transparent;border-right-color:#ffdebd;left:-16px;top:12px}.chat{position:relative;margin-bottom:.7rem}.authorStranger{color:#ff0101;font-weight:700}.authorYou{color:#0101ff;font-weight:700}.form{height:17%;margin-top:1rem;display:grid;grid-template-columns:15rem 1fr 15rem;gap:1rem}.btn{height:100%;color:#121830;background-color:#fff;font-size:3rem;border:1px solid #cccccc;cursor:pointer}.btn:focus{outline:none}.btn:disabled{color:#999;cursor:default;background-color:#efefef4d}.bottomLeftRadius{border-bottom-left-radius:7px}.bottomRightRadius{border-bottom-right-radius:7px}.start:focus{outline:none}.textarea{height:100%;resize:none;font-family:inherit;font-size:2rem;border:1px solid #cccccc;padding:20px 15px}.textarea:focus{outline:none}.hide{display:none}.bold{font-weight:700}ul.relayList{list-style-type:none;margin:0;padding:0;overflow:auto;max-height:150px;margin-bottom:1rem}ul.relayList>li{margin:.5rem}ul.relayList>li .removeButton{color:#fff;background-color:transparent}ul.relayList>li:before{content:"";display:inline-block;background-color:#0c0;border-radius:2px;width:6px;height:6px;margin-right:8px}@media only screen and (max-width: 56.25em){.description{margin-left:6rem;font-size:2rem}.online{font-size:2rem}}@media only screen and (max-width: 48.125em){.online{display:none}}@media only screen and (max-width: 43.75em){.form{grid-template-columns:10rem 1fr 10rem}.btn{font-size:1.4rem}}@media only screen and (max-width: 31.25em){.conversation{height:90%}.form{height:10%;grid-template-columns:7rem 1fr 7rem}.btn{font-size:1.2rem}}@media only screen and (max-width: 32.5em){.description{display:none}}@media only screen and (max-width: 28.125em){.logo{height:12rem}}modal-outlet{display:flex;justify-content:center;align-items:center;background-color:#0000001a;border:0;position:fixed;inset:0;z-index:500}modal-outlet>*{margin:4rem auto;display:block;min-width:200px;max-width:250px;background-color:#fff;border-radius:15px;padding:1rem;box-sizing:border-box}.toast-center-center{top:50%;left:50%;transform:translate(-50%,-50%)}.toast-top-center{top:0;right:0;width:100%}.toast-bottom-center{bottom:0;right:0;width:100%}.toast-top-full-width{top:0;right:0;width:100%}.toast-bottom-full-width{bottom:0;right:0;width:100%}.toast-top-left{top:12px;left:12px}.toast-top-right{top:12px;right:12px}.toast-bottom-right{right:12px;bottom:12px}.toast-bottom-left{bottom:12px;left:12px}.toast-title{font-weight:700}.toast-message{word-wrap:break-word}.toast-message a,.toast-message label{color:#fff}.toast-message a:hover{color:#ccc;text-decoration:none}.toast-close-button{position:relative;right:-.3em;top:-.3em;float:right;font-size:20px;font-weight:700;color:#fff;text-shadow:0 1px 0 #ffffff}.toast-close-button:hover,.toast-close-button:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.4}button.toast-close-button{padding:0;cursor:pointer;background:transparent;border:0}.toast-container{pointer-events:none;position:fixed;z-index:999999}.toast-container *{box-sizing:border-box}.toast-container .ngx-toastr{position:relative;overflow:hidden;margin:0 0 6px;padding:15px 15px 15px 50px;width:300px;border-radius:3px;background-position:15px center;background-repeat:no-repeat;background-size:24px;box-shadow:0 0 12px #999;color:#fff}.toast-container .ngx-toastr:hover{box-shadow:0 0 12px #000;opacity:1;cursor:pointer}.toast-info{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA1MTIgNTEyJyB3aWR0aD0nNTEyJyBoZWlnaHQ9JzUxMic+PHBhdGggZmlsbD0ncmdiKDI1NSwyNTUsMjU1KScgZD0nTTI1NiA4QzExOS4wNDMgOCA4IDExOS4wODMgOCAyNTZjMCAxMzYuOTk3IDExMS4wNDMgMjQ4IDI0OCAyNDhzMjQ4LTExMS4wMDMgMjQ4LTI0OEM1MDQgMTE5LjA4MyAzOTIuOTU3IDggMjU2IDh6bTAgMTEwYzIzLjE5NiAwIDQyIDE4LjgwNCA0MiA0MnMtMTguODA0IDQyLTQyIDQyLTQyLTE4LjgwNC00Mi00MiAxOC44MDQtNDIgNDItNDJ6bTU2IDI1NGMwIDYuNjI3LTUuMzczIDEyLTEyIDEyaC04OGMtNi42MjcgMC0xMi01LjM3My0xMi0xMnYtMjRjMC02LjYyNyA1LjM3My0xMiAxMi0xMmgxMnYtNjRoLTEyYy02LjYyNyAwLTEyLTUuMzczLTEyLTEydi0yNGMwLTYuNjI3IDUuMzczLTEyIDEyLTEyaDY0YzYuNjI3IDAgMTIgNS4zNzMgMTIgMTJ2MTAwaDEyYzYuNjI3IDAgMTIgNS4zNzMgMTIgMTJ2MjR6Jy8+PC9zdmc+)}.toast-error{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA1MTIgNTEyJyB3aWR0aD0nNTEyJyBoZWlnaHQ9JzUxMic+PHBhdGggZmlsbD0ncmdiKDI1NSwyNTUsMjU1KScgZD0nTTI1NiA4QzExOSA4IDggMTE5IDggMjU2czExMSAyNDggMjQ4IDI0OCAyNDgtMTExIDI0OC0yNDhTMzkzIDggMjU2IDh6bTEyMS42IDMxMy4xYzQuNyA0LjcgNC43IDEyLjMgMCAxN0wzMzggMzc3LjZjLTQuNyA0LjctMTIuMyA0LjctMTcgMEwyNTYgMzEybC02NS4xIDY1LjZjLTQuNyA0LjctMTIuMyA0LjctMTcgMEwxMzQuNCAzMzhjLTQuNy00LjctNC43LTEyLjMgMC0xN2w2NS42LTY1LTY1LjYtNjUuMWMtNC43LTQuNy00LjctMTIuMyAwLTE3bDM5LjYtMzkuNmM0LjctNC43IDEyLjMtNC43IDE3IDBsNjUgNjUuNyA2NS4xLTY1LjZjNC43LTQuNyAxMi4zLTQuNyAxNyAwbDM5LjYgMzkuNmM0LjcgNC43IDQuNyAxMi4zIDAgMTdMMzEyIDI1Nmw2NS42IDY1LjF6Jy8+PC9zdmc+)}.toast-success{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA1MTIgNTEyJyB3aWR0aD0nNTEyJyBoZWlnaHQ9JzUxMic+PHBhdGggZmlsbD0ncmdiKDI1NSwyNTUsMjU1KScgZD0nTTE3My44OTggNDM5LjQwNGwtMTY2LjQtMTY2LjRjLTkuOTk3LTkuOTk3LTkuOTk3LTI2LjIwNiAwLTM2LjIwNGwzNi4yMDMtMzYuMjA0YzkuOTk3LTkuOTk4IDI2LjIwNy05Ljk5OCAzNi4yMDQgMEwxOTIgMzEyLjY5IDQzMi4wOTUgNzIuNTk2YzkuOTk3LTkuOTk3IDI2LjIwNy05Ljk5NyAzNi4yMDQgMGwzNi4yMDMgMzYuMjA0YzkuOTk3IDkuOTk3IDkuOTk3IDI2LjIwNiAwIDM2LjIwNGwtMjk0LjQgMjk0LjQwMWMtOS45OTggOS45OTctMjYuMjA3IDkuOTk3LTM2LjIwNC0uMDAxeicvPjwvc3ZnPg==)}.toast-warning{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA1NzYgNTEyJyB3aWR0aD0nNTc2JyBoZWlnaHQ9JzUxMic+PHBhdGggZmlsbD0ncmdiKDI1NSwyNTUsMjU1KScgZD0nTTU2OS41MTcgNDQwLjAxM0M1ODcuOTc1IDQ3Mi4wMDcgNTY0LjgwNiA1MTIgNTI3Ljk0IDUxMkg0OC4wNTRjLTM2LjkzNyAwLTU5Ljk5OS00MC4wNTUtNDEuNTc3LTcxLjk4N0wyNDYuNDIzIDIzLjk4NWMxOC40NjctMzIuMDA5IDY0LjcyLTMxLjk1MSA4My4xNTQgMGwyMzkuOTQgNDE2LjAyOHpNMjg4IDM1NGMtMjUuNDA1IDAtNDYgMjAuNTk1LTQ2IDQ2czIwLjU5NSA0NiA0NiA0NiA0Ni0yMC41OTUgNDYtNDYtMjAuNTk1LTQ2LTQ2LTQ2em0tNDMuNjczLTE2NS4zNDZsNy40MTggMTM2Yy4zNDcgNi4zNjQgNS42MDkgMTEuMzQ2IDExLjk4MiAxMS4zNDZoNDguNTQ2YzYuMzczIDAgMTEuNjM1LTQuOTgyIDExLjk4Mi0xMS4zNDZsNy40MTgtMTM2Yy4zNzUtNi44NzQtNS4wOTgtMTIuNjU0LTExLjk4Mi0xMi42NTRoLTYzLjM4M2MtNi44ODQgMC0xMi4zNTYgNS43OC0xMS45ODEgMTIuNjU0eicvPjwvc3ZnPg==)}.toast-container.toast-top-center .ngx-toastr,.toast-container.toast-bottom-center .ngx-toastr{width:300px;margin-left:auto;margin-right:auto}.toast-container.toast-top-full-width .ngx-toastr,.toast-container.toast-bottom-full-width .ngx-toastr{width:96%;margin-left:auto;margin-right:auto}.ngx-toastr{background-color:#030303;pointer-events:auto}.toast-success{background-color:#51a351}.toast-error{background-color:#bd362f}.toast-info{background-color:#2f96b4}.toast-warning{background-color:#f89406}.toast-progress{position:absolute;left:0;bottom:0;height:4px;background-color:#000;opacity:.4}@media all and (max-width: 240px){.toast-container .ngx-toastr.div{padding:8px 8px 8px 50px;width:11em}.toast-container .toast-close-button{right:-.2em;top:-.2em}}@media all and (min-width: 241px) and (max-width: 480px){.toast-container .ngx-toastr.div{padding:8px 8px 8px 50px;width:18em}.toast-container .toast-close-button{right:-.2em;top:-.2em}}@media all and (min-width: 481px) and (max-width: 768px){.toast-container .ngx-toastr.div{padding:15px 15px 15px 50px;width:25em}}