diff --git a/404.html b/404.html index 71113242..53a1d2ac 100644 --- a/404.html +++ b/404.html @@ -3,7 +3,7 @@ BlogApp - + @@ -11,5 +11,5 @@ - + diff --git a/index.html b/index.html index 71113242..53a1d2ac 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ BlogApp - + @@ -11,5 +11,5 @@ - + diff --git a/main.2c0c5aa3864683f1.js b/main.5b76b47d32cd7bc8.js similarity index 98% rename from main.2c0c5aa3864683f1.js rename to main.5b76b47d32cd7bc8.js index ce4dd387..9e41c2f7 100644 --- a/main.2c0c5aa3864683f1.js +++ b/main.5b76b47d32cd7bc8.js @@ -1 +1 @@ -"use strict";(self.webpackChunkblog_app=self.webpackChunkblog_app||[]).push([[792],{791:()=>{function zf(n,e,t,r,i,o,s){try{var a=n[o](s),l=a.value}catch(c){return void t(c)}a.done?e(l):Promise.resolve(l).then(r,i)}function T(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(l){zf(o,r,i,s,a,"next",l)}function a(l){zf(o,r,i,s,a,"throw",l)}s(void 0)})}}function yy(n,e){return Object.is(n,e)}let hn=null,jf=!1,yC=1;const In=Symbol("SIGNAL");function Se(n){const e=hn;return hn=n,e}const $l={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,kind:"unknown",producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function Vu(n){if(jf)throw new Error("");if(null===hn)return;hn.consumerOnSignalRead(n);const e=hn.nextProducerIndex++;wy(hn),en.nextProducerIndex;)n.producerNode.pop(),n.producerLastReadVersion.pop(),n.producerIndexOfThis.pop()}}function $f(n){wy(n);for(let e=0;e0}function wy(n){n.producerNode??=[],n.producerIndexOfThis??=[],n.producerLastReadVersion??=[]}function $L(n){n.liveConsumerNode??=[],n.liveConsumerIndexOfThis??=[]}function qL(n){return void 0!==n.producerNode}function WL(n){const e=Object.create(Nte);e.computation=n;const t=()=>{if(Hf(e),Vu(e),e.value===pa)throw e.error;return e.value};return t[In]=e,t}const Wl=Symbol("UNSET"),Uu=Symbol("COMPUTING"),pa=Symbol("ERRORED"),Nte={...$l,value:Wl,dirty:!0,error:null,equal:yy,kind:"computed",producerMustRecompute:n=>n.value===Wl||n.value===Uu,producerRecomputeValue(n){if(n.value===Uu)throw new Error("Detected cycle in computations.");const e=n.value;n.value=Uu;const t=ql(n);let r,i=!1;try{r=n.computation(),Se(null),i=e!==Wl&&e!==pa&&r!==pa&&n.equal(e,r)}catch(o){r=pa,n.error=o}finally{Bu(n,t)}i?n.value=e:(n.value=r,n.version++)}};let GL=function Pte(){throw new Error};function KL(){GL()}function Iy(n,e){zL()||KL(),n.equal(n.value,e)||(n.value=e,function Lte(n){n.version++,function kte(){yC++}(),UL(n)}(n))}const bC={...$l,equal:yy,value:void 0,kind:"signal"};const wC=()=>{};function kt(n){return"function"==typeof n}function EC(n){const t=n(r=>{Error.call(r),r.stack=(new Error).stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}const IC=EC(n=>function(t){n(this),this.message=t?`${t.length} errors occurred during unsubscription:\n${t.map((r,i)=>`${i+1}) ${r.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=t});function Ty(n,e){if(n){const t=n.indexOf(e);0<=t&&n.splice(t,1)}}class Kt{constructor(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let e;if(!this.closed){this.closed=!0;const{_parentage:t}=this;if(t)if(this._parentage=null,Array.isArray(t))for(const o of t)o.remove(this);else t.remove(this);const{initialTeardown:r}=this;if(kt(r))try{r()}catch(o){e=o instanceof IC?o.errors:[o]}const{_finalizers:i}=this;if(i){this._finalizers=null;for(const o of i)try{JL(o)}catch(s){e=e??[],s instanceof IC?e=[...e,...s.errors]:e.push(s)}}if(e)throw new IC(e)}}add(e){var t;if(e&&e!==this)if(this.closed)JL(e);else{if(e instanceof Kt){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(t=this._finalizers)&&void 0!==t?t:[]).push(e)}}_hasParent(e){const{_parentage:t}=this;return t===e||Array.isArray(t)&&t.includes(e)}_addParent(e){const{_parentage:t}=this;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e}_removeParent(e){const{_parentage:t}=this;t===e?this._parentage=null:Array.isArray(t)&&Ty(t,e)}remove(e){const{_finalizers:t}=this;t&&Ty(t,e),e instanceof Kt&&e._removeParent(this)}}Kt.EMPTY=(()=>{const n=new Kt;return n.closed=!0,n})();const XL=Kt.EMPTY;function ZL(n){return n instanceof Kt||n&&"closed"in n&&kt(n.remove)&&kt(n.add)&&kt(n.unsubscribe)}function JL(n){kt(n)?n():n.unsubscribe()}const Gl={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Cy={setTimeout(n,e,...t){const{delegate:r}=Cy;return r?.setTimeout?r.setTimeout(n,e,...t):setTimeout(n,e,...t)},clearTimeout(n){const{delegate:e}=Cy;return(e?.clearTimeout||clearTimeout)(n)},delegate:void 0};function eV(n){Cy.setTimeout(()=>{const{onUnhandledError:e}=Gl;if(!e)throw n;e(n)})}function TC(){}const Hte=CC("C",void 0,void 0);function CC(n,e,t){return{kind:n,value:e,error:t}}let Kl=null;function xy(n){if(Gl.useDeprecatedSynchronousErrorHandling){const e=!Kl;if(e&&(Kl={errorThrown:!1,error:null}),n(),e){const{errorThrown:t,error:r}=Kl;if(Kl=null,t)throw r}}else n()}class xC extends Kt{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,ZL(e)&&e.add(this)):this.destination=Yte}static create(e,t,r){return new Gf(e,t,r)}next(e){this.isStopped?DC(function qte(n){return CC("N",n,void 0)}(e),this):this._next(e)}error(e){this.isStopped?DC(function $te(n){return CC("E",void 0,n)}(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?DC(Hte,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(e){this.destination.next(e)}_error(e){try{this.destination.error(e)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const Gte=Function.prototype.bind;function SC(n,e){return Gte.call(n,e)}class Kte{constructor(e){this.partialObserver=e}next(e){const{partialObserver:t}=this;if(t.next)try{t.next(e)}catch(r){Sy(r)}}error(e){const{partialObserver:t}=this;if(t.error)try{t.error(e)}catch(r){Sy(r)}else Sy(e)}complete(){const{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(t){Sy(t)}}}class Gf extends xC{constructor(e,t,r){let i;if(super(),kt(e)||!e)i={next:e??void 0,error:t??void 0,complete:r??void 0};else{let o;this&&Gl.useDeprecatedNextContext?(o=Object.create(e),o.unsubscribe=()=>this.unsubscribe(),i={next:e.next&&SC(e.next,o),error:e.error&&SC(e.error,o),complete:e.complete&&SC(e.complete,o)}):i=e}this.destination=new Kte(i)}}function Sy(n){Gl.useDeprecatedSynchronousErrorHandling?function Wte(n){Gl.useDeprecatedSynchronousErrorHandling&&Kl&&(Kl.errorThrown=!0,Kl.error=n)}(n):eV(n)}function DC(n,e){const{onStoppedNotification:t}=Gl;t&&Cy.setTimeout(()=>t(n,e))}const Yte={closed:!0,next:TC,error:function Qte(n){throw n},complete:TC},AC="function"==typeof Symbol&&Symbol.observable||"@@observable";function ma(n){return n}function tV(n){return 0===n.length?ma:1===n.length?n[0]:function(t){return n.reduce((r,i)=>i(r),t)}}let vt=(()=>{class n{constructor(t){t&&(this._subscribe=t)}lift(t){const r=new n;return r.source=this,r.operator=t,r}subscribe(t,r,i){const o=function Jte(n){return n&&n instanceof xC||function Zte(n){return n&&kt(n.next)&&kt(n.error)&&kt(n.complete)}(n)&&ZL(n)}(t)?t:new Gf(t,r,i);return xy(()=>{const{operator:s,source:a}=this;o.add(s?s.call(o,a):a?this._subscribe(o):this._trySubscribe(o))}),o}_trySubscribe(t){try{return this._subscribe(t)}catch(r){t.error(r)}}forEach(t,r){return new(r=nV(r))((i,o)=>{const s=new Gf({next:a=>{try{t(a)}catch(l){o(l),s.unsubscribe()}},error:o,complete:i});this.subscribe(s)})}_subscribe(t){var r;return null===(r=this.source)||void 0===r?void 0:r.subscribe(t)}[AC](){return this}pipe(...t){return tV(t)(this)}toPromise(t){return new(t=nV(t))((r,i)=>{let o;this.subscribe(s=>o=s,s=>i(s),()=>r(o))})}}return n.create=e=>new n(e),n})();function nV(n){var e;return null!==(e=n??Gl.Promise)&&void 0!==e?e:Promise}const ene=EC(n=>function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});let fe=(()=>{class n extends vt{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(t){const r=new rV(this,this);return r.operator=t,r}_throwIfClosed(){if(this.closed)throw new ene}next(t){xy(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const r of this.currentObservers)r.next(t)}})}error(t){xy(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=t;const{observers:r}=this;for(;r.length;)r.shift().error(t)}})}complete(){xy(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:t}=this;for(;t.length;)t.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0}_trySubscribe(t){return this._throwIfClosed(),super._trySubscribe(t)}_subscribe(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)}_innerSubscribe(t){const{hasError:r,isStopped:i,observers:o}=this;return r||i?XL:(this.currentObservers=null,o.push(t),new Kt(()=>{this.currentObservers=null,Ty(o,t)}))}_checkFinalizedStatuses(t){const{hasError:r,thrownError:i,isStopped:o}=this;r?t.error(i):o&&t.complete()}asObservable(){const t=new vt;return t.source=this,t}}return n.create=(e,t)=>new rV(e,t),n})();class rV extends fe{constructor(e,t){super(),this.destination=e,this.source=t}next(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,e)}error(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,e)}complete(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)}_subscribe(e){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==r?r:XL}}class mi extends fe{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return!t.closed&&e.next(this._value),t}getValue(){const{hasError:e,thrownError:t,_value:r}=this;if(e)throw t;return this._throwIfClosed(),r}next(e){super.next(this._value=e)}}function iV(n){return kt(n?.lift)}function Jt(n){return e=>{if(iV(e))return e.lift(function(t){try{return n(t,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function zt(n,e,t,r,i){return new tne(n,e,t,r,i)}class tne extends xC{constructor(e,t,r,i,o,s){super(e),this.onFinalize=o,this.shouldUnsubscribe=s,this._next=t?function(a){try{t(a)}catch(l){e.error(l)}}:super._next,this._error=i?function(a){try{i(a)}catch(l){e.error(l)}finally{this.unsubscribe()}}:super._error,this._complete=r?function(){try{r()}catch(a){e.error(a)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:t}=this;super.unsubscribe(),!t&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}}}function Te(n,e){return Jt((t,r)=>{let i=0;t.subscribe(zt(r,o=>{r.next(n.call(e,o,i++))}))})}const oV="https://g.co/ng/security#xss";class O extends Error{code;constructor(e,t){super(function Ql(n,e){return`NG0${Math.abs(n)}${e?": "+e:""}`}(e,t)),this.code=e}}const Dy=Symbol("InputSignalNode#UNSET"),sV={...bC,transformFn:void 0,applyValueToInputSignal(n,e){Iy(n,e)}};function aV(n,e){const t=Object.create(sV);function r(){if(Vu(t),t.value===Dy)throw new O(-950,!1);return t.value}return t.value=n,t.transformFn=e?.transform,r[In]=t,r}function fs(n){return{toString:n}.toString()}const ju="__parameters__";function $u(n,e,t){return fs(()=>{const r=function RC(n){return function(...t){if(n){const r=n(...t);for(const i in r)this[i]=r[i]}}}(e);function i(...o){if(this instanceof i)return r.apply(this,o),this;const s=new i(...o);return a.annotation=s,a;function a(l,c,u){const d=l.hasOwnProperty(ju)?l[ju]:Object.defineProperty(l,ju,{value:[]})[ju];for(;d.length<=u;)d.push(null);return(d[u]=d[u]||[]).push(s),l}}return t&&(i.prototype=Object.create(t.prototype)),i.prototype.ngMetadataName=n,i.annotationCls=i,i})}const Nt=globalThis;function ct(n){for(let e in n)if(n[e]===ct)return e;throw Error("Could not find renamed property on target object.")}function nne(n,e){for(const t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function Mn(n){if("string"==typeof n)return n;if(Array.isArray(n))return`[${n.map(Mn).join(", ")}]`;if(null==n)return""+n;const e=n.overriddenName||n.name;if(e)return`${e}`;const t=n.toString();if(null==t)return""+t;const r=t.indexOf("\n");return r>=0?t.slice(0,r):t}function MC(n,e){return n?e?`${n} ${e}`:n:e||""}const rne=ct({__forward_ref__:ct});function ft(n){return n.__forward_ref__=ft,n.toString=function(){return Mn(this())},n}function ye(n){return Ay(n)?n():n}function Ay(n){return"function"==typeof n&&n.hasOwnProperty(rne)&&n.__forward_ref__===ft}function G(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function pt(n){return{providers:n.providers||[],imports:n.imports||[]}}function Ry(n){return cV(n,ky)||cV(n,uV)}function cV(n,e){return n.hasOwnProperty(e)?n[e]:null}function My(n){return n&&(n.hasOwnProperty(kC)||n.hasOwnProperty(cne))?n[kC]:null}const ky=ct({\u0275prov:ct}),kC=ct({\u0275inj:ct}),uV=ct({ngInjectableDef:ct}),cne=ct({ngInjectorDef:ct});class B{_desc;ngMetadataName="InjectionToken";\u0275prov;constructor(e,t){this._desc=e,this.\u0275prov=void 0,"number"==typeof t?this.__NG_ELEMENT_ID__=t:void 0!==t&&(this.\u0275prov=G({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}function OC(n){return n&&!!n.\u0275providers}const qu=ct({\u0275cmp:ct}),FC=ct({\u0275dir:ct}),LC=ct({\u0275pipe:ct}),hV=ct({\u0275mod:ct}),ps=ct({\u0275fac:ct}),Kf=ct({__NG_ELEMENT_ID__:ct}),fV=ct({__NG_ENV_ID__:ct});function Ce(n){return"string"==typeof n?n:null==n?"":String(n)}function VC(n,e){throw new O(-201,!1)}var Le=function(n){return n[n.Default=0]="Default",n[n.Host=1]="Host",n[n.Self=2]="Self",n[n.SkipSelf=4]="SkipSelf",n[n.Optional=8]="Optional",n}(Le||{});let BC;function pV(){return BC}function Xr(n){const e=BC;return BC=n,e}function mV(n,e,t){const r=Ry(n);return r&&"root"==r.providedIn?void 0===r.value?r.value=r.factory():r.value:t&Le.Optional?null:void 0!==e?e:void VC()}const Qf={},UC="__NG_DI_FLAG__",Oy="ngTempTokenPath",mne=/\n/gm,gV="__source";let Wu;function _a(n){const e=Wu;return Wu=n,e}function yne(n,e=Le.Default){if(void 0===Wu)throw new O(-203,!1);return null===Wu?mV(n,void 0,e):Wu.get(n,e&Le.Optional?null:void 0,e)}function me(n,e=Le.Default){return(pV()||yne)(ye(n),e)}function b(n,e=Le.Default){return me(n,Fy(e))}function Fy(n){return typeof n>"u"||"number"==typeof n?n:(n.optional&&8)|(n.host&&1)|(n.self&&2)|(n.skipSelf&&4)}function zC(n){const e=[];for(let t=0;tArray.isArray(t)?Gu(t,e):e(t))}function yV(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Vy(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function _i(n,e,t){let r=Ku(n,e);return r>=0?n[1|r]=t:(r=~r,function vV(n,e,t,r){let i=n.length;if(i==e)n.push(t,r);else if(1===i)n.push(r,n[0]),n[0]=t;else{for(i--,n.push(n[i-1],n[i]);i>e;)n[i]=n[i-2],i--;n[e]=t,n[e+1]=r}}(n,r,e,t)),r}function HC(n,e){const t=Ku(n,e);if(t>=0)return n[1|t]}function Ku(n,e){return function bV(n,e,t){let r=0,i=n.length>>t;for(;i!==r;){const o=r+(i-r>>1),s=n[o<e?i=o:r=o+1}return~(i<{t.push(s)};return Gu(e,s=>{const a=s;zy(a,o,[],r)&&(i||=[],i.push(a))}),void 0!==i&&EV(i,o),t}function EV(n,e){for(let t=0;t{e(o,r)})}}function zy(n,e,t,r){if(!(n=ye(n)))return!1;let i=null,o=My(n);const s=!o&&Me(n);if(o||s){if(s&&!s.standalone)return!1;i=n}else{const l=n.ngModule;if(o=My(l),!o)return!1;i=l}const a=r.has(i);if(s){if(a)return!1;if(r.add(i),s.dependencies){const l="function"==typeof s.dependencies?s.dependencies():s.dependencies;for(const c of l)zy(c,e,t,r)}}else{if(!o)return!1;{if(null!=o.imports&&!a){let c;r.add(i);try{Gu(o.imports,u=>{zy(u,e,t,r)&&(c||=[],c.push(u))})}finally{}void 0!==c&&EV(c,e)}if(!a){const c=Yl(i)||(()=>new i);e({provide:i,useFactory:c,deps:it},i),e({provide:$C,useValue:i,multi:!0},i),e({provide:Bi,useValue:()=>me(i),multi:!0},i)}const l=o.providers;if(null!=l&&!a){const c=n;WC(l,u=>{e(u,c)})}}}return i!==n&&void 0!==n.providers}function WC(n,e){for(let t of n)OC(t)&&(t=t.\u0275providers),Array.isArray(t)?WC(t,e):e(t)}const Sne=ct({provide:String,useValue:ct});function GC(n){return null!==n&&"object"==typeof n&&Sne in n}function Xl(n){return"function"==typeof n}const KC=new B(""),jy={},Ane={};let QC;function Hy(){return void 0===QC&&(QC=new Uy),QC}class mr{}class Zl extends mr{parent;source;scopes;records=new Map;_ngOnDestroyHooks=new Set;_onDestroyHooks=[];get destroyed(){return this._destroyed}_destroyed=!1;injectorDefTypes;constructor(e,t,r,i){super(),this.parent=t,this.source=r,this.scopes=i,XC(e,s=>this.processProvider(s)),this.records.set(wV,Qu(void 0,this)),i.has("environment")&&this.records.set(mr,Qu(void 0,this));const o=this.records.get(KC);null!=o&&"string"==typeof o.value&&this.scopes.add(o.value),this.injectorDefTypes=new Set(this.get($C,it,Le.Self))}destroy(){Xf(this),this._destroyed=!0;const e=Se(null);try{for(const r of this._ngOnDestroyHooks)r.ngOnDestroy();const t=this._onDestroyHooks;this._onDestroyHooks=[];for(const r of t)r()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),Se(e)}}onDestroy(e){return Xf(this),this._onDestroyHooks.push(e),()=>this.removeOnDestroy(e)}runInContext(e){Xf(this);const t=_a(this),r=Xr(void 0);try{return e()}finally{_a(t),Xr(r)}}get(e,t=Qf,r=Le.Default){if(Xf(this),e.hasOwnProperty(fV))return e[fV](this);r=Fy(r);const o=_a(this),s=Xr(void 0);try{if(!(r&Le.SkipSelf)){let l=this.records.get(e);if(void 0===l){const c=function Pne(n){return"function"==typeof n||"object"==typeof n&&n instanceof B}(e)&&Ry(e);l=c&&this.injectableDefInScope(c)?Qu(YC(e),jy):null,this.records.set(e,l)}if(null!=l)return this.hydrate(e,l)}return(r&Le.Self?Hy():this.parent).get(e,t=r&Le.Optional&&t===Qf?null:t)}catch(a){if("NullInjectorError"===a.name){if((a[Oy]=a[Oy]||[]).unshift(Mn(e)),o)throw a;return function bne(n,e,t,r){const i=n[Oy];throw e[gV]&&i.unshift(e[gV]),n.message=function wne(n,e,t,r=null){n=n&&"\n"===n.charAt(0)&&"\u0275"==n.charAt(1)?n.slice(2):n;let i=Mn(e);if(Array.isArray(e))i=e.map(Mn).join(" -> ");else if("object"==typeof e){let o=[];for(let s in e)if(e.hasOwnProperty(s)){let a=e[s];o.push(s+":"+("string"==typeof a?JSON.stringify(a):Mn(a)))}i=`{${o.join(", ")}}`}return`${t}${r?"("+r+")":""}[${i}]: ${n.replace(mne,"\n ")}`}("\n"+n.message,i,t,r),n.ngTokenPath=i,n[Oy]=null,n}(a,e,"R3InjectorError",this.source)}throw a}finally{Xr(s),_a(o)}}resolveInjectorInitializers(){const e=Se(null),t=_a(this),r=Xr(void 0);try{const o=this.get(Bi,it,Le.Self);for(const s of o)s()}finally{_a(t),Xr(r),Se(e)}}toString(){const e=[],t=this.records;for(const r of t.keys())e.push(Mn(r));return`R3Injector[${e.join(", ")}]`}processProvider(e){let t=Xl(e=ye(e))?e:ye(e&&e.provide);const r=function Mne(n){return GC(n)?Qu(void 0,n.useValue):Qu(CV(n),jy)}(e);if(!Xl(e)&&!0===e.multi){let i=this.records.get(t);i||(i=Qu(void 0,jy,!0),i.factory=()=>zC(i.multi),this.records.set(t,i)),t=e,i.multi.push(e)}this.records.set(t,r)}hydrate(e,t){const r=Se(null);try{return t.value===jy&&(t.value=Ane,t.value=t.factory()),"object"==typeof t.value&&t.value&&function Nne(n){return null!==n&&"object"==typeof n&&"function"==typeof n.ngOnDestroy}(t.value)&&this._ngOnDestroyHooks.add(t.value),t.value}finally{Se(r)}}injectableDefInScope(e){if(!e.providedIn)return!1;const t=ye(e.providedIn);return"string"==typeof t?"any"===t||this.scopes.has(t):this.injectorDefTypes.has(t)}removeOnDestroy(e){const t=this._onDestroyHooks.indexOf(e);-1!==t&&this._onDestroyHooks.splice(t,1)}}function YC(n){const e=Ry(n),t=null!==e?e.factory:Yl(n);if(null!==t)return t;if(n instanceof B)throw new O(204,!1);if(n instanceof Function)return function Rne(n){if(n.length>0)throw new O(204,!1);const t=function lne(n){return n&&(n[ky]||n[uV])||null}(n);return null!==t?()=>t.factory(n):()=>new n}(n);throw new O(204,!1)}function CV(n,e,t){let r;if(Xl(n)){const i=ye(n);return Yl(i)||YC(i)}if(GC(n))r=()=>ye(n.useValue);else if(function TV(n){return!(!n||!n.useFactory)}(n))r=()=>n.useFactory(...zC(n.deps||[]));else if(function IV(n){return!(!n||!n.useExisting)}(n))r=()=>me(ye(n.useExisting));else{const i=ye(n&&(n.useClass||n.provide));if(!function kne(n){return!!n.deps}(n))return Yl(i)||YC(i);r=()=>new i(...zC(n.deps))}return r}function Xf(n){if(n.destroyed)throw new O(205,!1)}function Qu(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function XC(n,e){for(const t of n)Array.isArray(t)?XC(t,e):t&&OC(t)?XC(t.\u0275providers,e):e(t)}function yi(n,e){n instanceof Zl&&Xf(n);const r=_a(n),i=Xr(void 0);try{return e()}finally{_a(r),Xr(i)}}function xV(){return void 0!==pV()||null!=function _ne(){return Wu}()}function va(n){if(!xV())throw new O(-203,!1)}function Qt(n){return Array.isArray(n)&&"object"==typeof n[1]}function Pn(n){return Array.isArray(n)&&!0===n[1]}function e0(n){return!!(4&n.flags)}function zi(n){return n.componentOffset>-1}function Ky(n){return!(1&~n.flags)}function ji(n){return!!n.template}function _s(n){return!!(512&n[2])}function wa(n){return!(256&~n[2])}class Wne{previousValue;currentValue;firstChange;constructor(e,t,r){this.previousValue=e,this.currentValue=t,this.firstChange=r}isFirstChange(){return this.firstChange}}function PV(n,e,t,r){null!==e?e.applyValueToInputSignal(e,r):n[t]=r}const ei=(()=>{const n=()=>OV;return n.ngInherit=!0,n})();function OV(n){return n.type.prototype.ngOnChanges&&(n.setInput=Kne),Gne}function Gne(){const n=LV(this),e=n?.current;if(e){const t=n.previous;if(t===lo)n.previous=e;else for(let r in e)t[r]=e[r];n.current=null,this.ngOnChanges(e)}}function Kne(n,e,t,r,i){const o=this.declaredInputs[r],s=LV(n)||function Qne(n,e){return n[FV]=e}(n,{previous:lo,current:null}),a=s.current||(s.current={}),l=s.previous,c=l[o];a[o]=new Wne(c&&c.currentValue,t,l===lo),PV(n,e,i,t)}const FV="__ngSimpleChanges__";function LV(n){return n[FV]||null}function Je(n){for(;Array.isArray(n);)n=n[0];return n}function nd(n,e){return Je(e[n])}function _r(n,e){return Je(e[n.index])}function nc(n,e){return n.data[e]}function kr(n,e){const t=e[n];return Qt(t)?t:t[0]}function r0(n){return!(128&~n[2])}function $i(n,e){return null==e?null:n[e]}function UV(n){n[17]=0}function o0(n){1024&n[2]||(n[2]|=1024,r0(n)&&Jf(n))}function Yy(n){return!!(9216&n[2]||n[24]?.dirty)}function s0(n){n[10].changeDetectionScheduler?.notify(9),64&n[2]&&(n[2]|=1024),Yy(n)&&Jf(n)}function Jf(n){n[10].changeDetectionScheduler?.notify(0);let e=ys(n);for(;null!==e&&!(8192&e[2])&&(e[2]|=8192,r0(e));)e=ys(e)}function Xy(n,e){if(wa(n))throw new O(911,!1);null===n[21]&&(n[21]=[]),n[21].push(e)}function ys(n){const e=n[3];return Pn(e)?e[3]:e}function jV(n){return n[7]??=[]}function HV(n){return n.cleanup??=[]}const be={lFrame:ZV(null),bindingsEnabled:!0,skipHydrationRootTNode:null};let c0=!1;function Jy(){return be.bindingsEnabled}function ic(){return null!==be.skipHydrationRootTNode}function L(){return be.lFrame.lView}function ve(){return be.lFrame.tView}function vi(n){return be.lFrame.contextLView=n,n[8]}function bi(n){return be.lFrame.contextLView=null,n}function Fe(){let n=$V();for(;null!==n&&64===n.type;)n=n.parent;return n}function $V(){return be.lFrame.currentTNode}function co(n,e){const t=be.lFrame;t.currentTNode=n,t.isParent=e}function u0(){return be.lFrame.isParent}function d0(){be.lFrame.isParent=!1}function GV(){return c0}function ev(n){const e=c0;return c0=n,e}function qi(){return be.lFrame.bindingIndex++}function bs(n){const e=be.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function ure(n,e){const t=be.lFrame;t.bindingIndex=t.bindingRootIndex=n,h0(e)}function h0(n){be.lFrame.currentDirectiveIndex=n}function f0(n){const e=be.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}function p0(){return be.lFrame.currentQueryIndex}function tv(n){be.lFrame.currentQueryIndex=n}function hre(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[5]:null}function YV(n,e,t){if(t&Le.SkipSelf){let i=e,o=n;for(;!(i=i.parent,null!==i||t&Le.Host||(i=hre(o),null===i||(o=o[14],10&i.type))););if(null===i)return!1;e=i,n=o}const r=be.lFrame=XV();return r.currentTNode=e,r.lView=n,!0}function m0(n){const e=XV(),t=n[1];be.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function XV(){const n=be.lFrame,e=null===n?null:n.child;return null===e?ZV(n):e}function ZV(n){const e={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:n,child:null,inI18n:!1};return null!==n&&(n.child=e),e}function JV(){const n=be.lFrame;return be.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const e2=JV;function g0(){const n=JV();n.isParent=!0,n.tView=null,n.selectedIndex=-1,n.contextLView=null,n.elementDepthCount=0,n.currentDirectiveIndex=-1,n.currentNamespace=null,n.bindingRootIndex=-1,n.bindingIndex=-1,n.currentQueryIndex=0}function Jn(){return be.lFrame.selectedIndex}function oc(n){be.lFrame.selectedIndex=n}function gt(){const n=be.lFrame;return nc(n.tView,n.selectedIndex)}function tp(){be.lFrame.currentNamespace="svg"}function _0(){!function mre(){be.lFrame.currentNamespace=null}()}let n2=!0;function np(){return n2}function Ro(n){n2=n}function y0(n,e){for(let t=e.directiveStart,r=e.directiveEnd;t=r)break}else e[l]<0&&(n[17]+=65536),(a>14>16&&(3&n[2])===e&&(n[2]+=16384,i2(a,o)):i2(a,o)}class rp{factory;injectImpl;resolving=!1;canSeeViewProviders;multi;componentProviders;index;providerFactory;constructor(e,t,r){this.factory=e,this.canSeeViewProviders=t,this.injectImpl=r}}function o2(n){return 3===n||4===n||6===n}function s2(n){return 64===n.charCodeAt(0)}function id(n,e){if(null!==e&&0!==e.length)if(null===n||0===n.length)n=e.slice();else{let t=-1;for(let r=0;re){s=o-1;break}}}for(;o>16}(n),r=e;for(;t>0;)r=r[14],t--;return r}let T0=!0;function iv(n){const e=T0;return T0=n,e}let Cre=0;const Mo={};function ov(n,e){const t=u2(n,e);if(-1!==t)return t;const r=e[1];r.firstCreatePass&&(n.injectorIndex=e.length,C0(r.data,n),C0(e,null),C0(r.blueprint,null));const i=sv(n,e),o=n.injectorIndex;if(I0(i)){const s=ip(i),a=op(i,e),l=a[1].data;for(let c=0;c<8;c++)e[o+c]=a[s+c]|l[s+c]}return e[o+8]=i,o}function C0(n,e){n.push(0,0,0,0,0,0,0,0,e)}function u2(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function sv(n,e){if(n.parent&&-1!==n.parent.injectorIndex)return n.parent.injectorIndex;let t=0,r=null,i=e;for(;null!==i;){if(r=_2(i),null===r)return-1;if(t++,i=i[14],-1!==r.injectorIndex)return r.injectorIndex|t<<16}return-1}function x0(n,e,t){!function xre(n,e,t){let r;"string"==typeof t?r=t.charCodeAt(0)||0:t.hasOwnProperty(Kf)&&(r=t[Kf]),null==r&&(r=t[Kf]=Cre++);const i=255&r;e.data[n+(i>>5)]|=1<=0?255&e:Rre:e}(t);if("function"==typeof o){if(!YV(e,n,r))return r&Le.Host?d2(i,0,r):h2(e,t,r,i);try{let s;if(s=o(r),null!=s||r&Le.Optional)return s;VC()}finally{e2()}}else if("number"==typeof o){let s=null,a=u2(n,e),l=-1,c=r&Le.Host?e[15][5]:null;for((-1===a||r&Le.SkipSelf)&&(l=-1===a?sv(n,e):e[a+8],-1!==l&&g2(r,!1)?(s=e[1],a=ip(l),e=op(l,e)):a=-1);-1!==a;){const u=e[1];if(m2(o,a,u.data)){const d=Dre(a,e,t,s,r,c);if(d!==Mo)return d}l=e[a+8],-1!==l&&g2(r,e[1].data[a+8]===c)&&m2(o,a,e)?(s=u,a=ip(l),e=op(l,e)):a=-1}}return i}function Dre(n,e,t,r,i,o){const s=e[1],a=s.data[n+8],u=av(a,s,t,null==r?zi(a)&&T0:r!=s&&!!(3&a.type),i&Le.Host&&o===a);return null!==u?sp(e,s,u,a):Mo}function av(n,e,t,r,i){const o=n.providerIndexes,s=e.data,a=1048575&o,l=n.directiveStart,u=o>>20,f=i?a+u:n.directiveEnd;for(let p=r?a:a+u;p=l&&m.type===t)return p}if(i){const p=s[l];if(p&&ji(p)&&p.type===t)return l}return null}function sp(n,e,t,r){let i=n[t];const o=e.data;if(function yre(n){return n instanceof rp}(i)){const s=i;s.resolving&&function hne(n,e){throw e&&e.join(" > "),new O(-200,n)}(function st(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():Ce(n)}(o[t]));const a=iv(s.canSeeViewProviders);s.resolving=!0;const c=s.injectImpl?Xr(s.injectImpl):null;YV(n,r,Le.Default);try{i=n[t]=s.factory(void 0,o,n,r),e.firstCreatePass&&t>=r.directiveStart&&function gre(n,e,t){const{ngOnChanges:r,ngOnInit:i,ngDoCheck:o}=e.type.prototype;if(r){const s=OV(e);(t.preOrderHooks??=[]).push(n,s),(t.preOrderCheckHooks??=[]).push(n,s)}i&&(t.preOrderHooks??=[]).push(0-n,i),o&&((t.preOrderHooks??=[]).push(n,o),(t.preOrderCheckHooks??=[]).push(n,o))}(t,o[t],e)}finally{null!==c&&Xr(c),iv(a),s.resolving=!1,e2()}}return i}function m2(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[ps]||S0(e),r=Object.prototype;let i=Object.getPrototypeOf(n.prototype).constructor;for(;i&&i!==r;){const o=i[ps]||S0(i);if(o&&o!==t)return o;i=Object.getPrototypeOf(i)}return o=>new o})}function S0(n){return Ay(n)?()=>{const e=S0(ye(n));return e&&e()}:Yl(n)}function _2(n){const e=n[1],t=e.type;return 2===t?e.declTNode:1===t?n[5]:null}function ap(n){return function Sre(n,e){if("class"===e)return n.classes;if("style"===e)return n.styles;const t=n.attrs;if(t){const r=t.length;let i=0;for(;ime(wV)});static __NG_ELEMENT_ID__=-1}class T2{attributeName;constructor(e){this.attributeName=e}__NG_ELEMENT_ID__=()=>ap(this.attributeName);toString(){return`HostAttributeToken ${this.attributeName}`}}new B("").__NG_ELEMENT_ID__=n=>{const e=Fe();if(null===e)throw new O(204,!1);if(2&e.type)return e.value;if(n&Le.Optional)return null;throw new O(204,!1)};const C2=!1;let uo=(()=>class n{static __NG_ELEMENT_ID__=Ure;static __NG_ENV_ID__=t=>t})();class x2 extends uo{_lView;constructor(e){super(),this._lView=e}onDestroy(e){return Xy(this._lView,e),()=>function a0(n,e){if(null===n[21])return;const t=n[21].indexOf(e);-1!==t&&n[21].splice(t,1)}(this._lView,e)}}function Ure(){return new x2(L())}class ws{}const lp=new B("",{providedIn:"root",factory:()=>!1}),S2=new B(""),A0=new B("");let Es=(()=>{class n{taskId=0;pendingTasks=new Set;get _hasPendingTasks(){return this.hasPendingTasks.value}hasPendingTasks=new mi(!1);add(){this._hasPendingTasks||this.hasPendingTasks.next(!0);const t=this.taskId++;return this.pendingTasks.add(t),t}has(t){return this.pendingTasks.has(t)}remove(t){this.pendingTasks.delete(t),0===this.pendingTasks.size&&this._hasPendingTasks&&this.hasPendingTasks.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this._hasPendingTasks&&this.hasPendingTasks.next(!1)}static \u0275prov=G({token:n,providedIn:"root",factory:()=>new n})}return n})(),R0=(()=>{class n{internalPendingTasks=b(Es);scheduler=b(ws);add(){const t=this.internalPendingTasks.add();return()=>{this.internalPendingTasks.has(t)&&(this.scheduler.notify(12),this.internalPendingTasks.remove(t))}}run(t){var r=this;return T(function*(){const i=r.add();try{return yield t()}finally{i()}})()}static \u0275prov=G({token:n,providedIn:"root",factory:()=>new n})}return n})();const nt=class zre extends fe{__isAsync;destroyRef=void 0;pendingTasks=void 0;constructor(e=!1){super(),this.__isAsync=e,xV()&&(this.destroyRef=b(uo,{optional:!0})??void 0,this.pendingTasks=b(Es,{optional:!0})??void 0)}emit(e){const t=Se(null);try{super.next(e)}finally{Se(t)}}subscribe(e,t,r){let i=e,o=t||(()=>null),s=r;if(e&&"object"==typeof e){const l=e;i=l.next?.bind(l),o=l.error?.bind(l),s=l.complete?.bind(l)}this.__isAsync&&(o=this.wrapInTimeout(o),i&&(i=this.wrapInTimeout(i)),s&&(s=this.wrapInTimeout(s)));const a=super.subscribe({next:i,error:o,complete:s});return e instanceof Kt&&e.add(a),a}wrapInTimeout(e){return t=>{const r=this.pendingTasks?.add();setTimeout(()=>{e(t),void 0!==r&&this.pendingTasks?.remove(r)})}}};function cp(...n){}function D2(n){let e,t;function r(){n=cp;try{void 0!==t&&"function"==typeof cancelAnimationFrame&&cancelAnimationFrame(t),void 0!==e&&clearTimeout(e)}catch{}}return e=setTimeout(()=>{n(),r()}),"function"==typeof requestAnimationFrame&&(t=requestAnimationFrame(()=>{n(),r()})),()=>r()}function A2(n){return queueMicrotask(()=>n()),()=>{n=cp}}const M0="isAngularZone",cv=M0+"_ID";let jre=0;class ue{hasPendingMacrotasks=!1;hasPendingMicrotasks=!1;isStable=!0;onUnstable=new nt(!1);onMicrotaskEmpty=new nt(!1);onStable=new nt(!1);onError=new nt(!1);constructor(e){const{enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:r=!1,shouldCoalesceRunChangeDetection:i=!1,scheduleInRootZone:o=C2}=e;if(typeof Zone>"u")throw new O(908,!1);Zone.assertZonePatched();const s=this;s._nesting=0,s._outer=s._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(s._inner=s._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(s._inner=s._inner.fork(Zone.longStackTraceZoneSpec)),s.shouldCoalesceEventChangeDetection=!i&&r,s.shouldCoalesceRunChangeDetection=i,s.callbackScheduled=!1,s.scheduleInRootZone=o,function qre(n){const e=()=>{!function $re(n){function e(){D2(()=>{n.callbackScheduled=!1,N0(n),n.isCheckStableRunning=!0,k0(n),n.isCheckStableRunning=!1})}n.isCheckStableRunning||n.callbackScheduled||(n.callbackScheduled=!0,n.scheduleInRootZone?Zone.root.run(()=>{e()}):n._outer.run(()=>{e()}),N0(n))}(n)},t=jre++;n._inner=n._inner.fork({name:"angular",properties:{[M0]:!0,[cv]:t,[cv+t]:!0},onInvokeTask:(r,i,o,s,a,l)=>{if(function Wre(n){return k2(n,"__ignore_ng_zone__")}(l))return r.invokeTask(o,s,a,l);try{return R2(n),r.invokeTask(o,s,a,l)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),M2(n)}},onInvoke:(r,i,o,s,a,l,c)=>{try{return R2(n),r.invoke(o,s,a,l,c)}finally{n.shouldCoalesceRunChangeDetection&&!n.callbackScheduled&&!function Gre(n){return k2(n,"__scheduler_tick__")}(l)&&e(),M2(n)}},onHasTask:(r,i,o,s)=>{r.hasTask(o,s),i===o&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,N0(n),k0(n)):"macroTask"==s.change&&(n.hasPendingMacrotasks=s.macroTask))},onHandleError:(r,i,o,s)=>(r.handleError(o,s),n.runOutsideAngular(()=>n.onError.emit(s)),!1)})}(s)}static isInAngularZone(){return typeof Zone<"u"&&!0===Zone.current.get(M0)}static assertInAngularZone(){if(!ue.isInAngularZone())throw new O(909,!1)}static assertNotInAngularZone(){if(ue.isInAngularZone())throw new O(909,!1)}run(e,t,r){return this._inner.run(e,t,r)}runTask(e,t,r,i){const o=this._inner,s=o.scheduleEventTask("NgZoneEvent: "+i,e,Hre,cp,cp);try{return o.runTask(s,t,r)}finally{o.cancelTask(s)}}runGuarded(e,t,r){return this._inner.runGuarded(e,t,r)}runOutsideAngular(e){return this._outer.run(e)}}const Hre={};function k0(n){if(0==n._nesting&&!n.hasPendingMicrotasks&&!n.isStable)try{n._nesting++,n.onMicrotaskEmpty.emit(null)}finally{if(n._nesting--,!n.hasPendingMicrotasks)try{n.runOutsideAngular(()=>n.onStable.emit(null))}finally{n.isStable=!0}}}function N0(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&!0===n.callbackScheduled)}function R2(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function M2(n){n._nesting--,k0(n)}class P0{hasPendingMicrotasks=!1;hasPendingMacrotasks=!1;isStable=!0;onUnstable=new nt;onMicrotaskEmpty=new nt;onStable=new nt;onError=new nt;run(e,t,r){return e.apply(t,r)}runGuarded(e,t,r){return e.apply(t,r)}runOutsideAngular(e){return e()}runTask(e,t,r,i){return e.apply(t,r)}}function k2(n,e){return!(!Array.isArray(n)||1!==n.length)&&!0===n[0]?.data?.[e]}class wi{_console=console;handleError(e){this._console.error("ERROR",e)}}const Qre=new B("",{providedIn:"root",factory:()=>{const n=b(ue),e=b(wi);return t=>n.runOutsideAngular(()=>e.handleError(t))}});function P2(n,e){return aV(n,e)}const Xre=(P2.required=function Yre(n){return aV(Dy,n)},P2);function Zre(){return od(Fe(),L())}function od(n,e){return new je(_r(n,e))}let je=(()=>class n{nativeElement;constructor(t){this.nativeElement=t}static __NG_ELEMENT_ID__=Zre})();function O2(n){return n instanceof je?n.nativeElement:n}const F2=new Set;function On(n){F2.has(n)||(F2.add(n),performance?.mark?.("mark_feature_usage",{detail:{feature:n}}))}function up(n){return"function"==typeof n&&void 0!==n[In]}function ti(n,e){On("NgSignals");const t=function Fte(n){const e=Object.create(bC);e.value=n;const t=()=>(Vu(e),e.value);return t[In]=e,t}(n),r=t[In];return e?.equal&&(r.equal=e.equal),t.set=i=>Iy(r,i),t.update=i=>function QL(n,e){zL()||KL(),Iy(n,e(n.value))}(r,i),t.asReadonly=uv.bind(t),t}function uv(){const n=this[In];if(void 0===n.readonlyFn){const e=()=>this();e[In]=n,n.readonlyFn=e}return n.readonlyFn}function Jre(){return this._results[Symbol.iterator]()}class dp{_emitDistinctChangesOnly;dirty=!0;_onDirty=void 0;_results=[];_changesDetected=!1;_changes=void 0;length=0;first=void 0;last=void 0;get changes(){return this._changes??=new fe}constructor(e=!1){this._emitDistinctChangesOnly=e}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){this.dirty=!1;const r=function Zr(n){return n.flat(Number.POSITIVE_INFINITY)}(e);(this._changesDetected=!function Cne(n,e,t){if(n.length!==e.length)return!1;for(let r=0;rwie}),wie="ng",U0=new B(""),Ia=new B("",{providedIn:"platform",factory:()=>"unknown"}),Ts=new B(""),z0=new B("",{providedIn:"root",factory:()=>function ko(){if(void 0!==B0)return B0;if(typeof document<"u")return document;throw new O(210,!1)}().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null}),oB=new B("",{providedIn:"root",factory:()=>!1});var Z0=function(n){return n[n.CHANGE_DETECTION=0]="CHANGE_DETECTION",n[n.AFTER_NEXT_RENDER=1]="AFTER_NEXT_RENDER",n}(Z0||{});const ld=new B("");var cd=function(n){return n[n.EarlyRead=0]="EarlyRead",n[n.Write=1]="Write",n[n.MixedReadWrite=2]="MixedReadWrite",n[n.Read=3]="Read",n}(cd||{});let J0=(()=>{class n{impl=null;execute(){this.impl?.execute()}static \u0275prov=G({token:n,providedIn:"root",factory:()=>new n})}return n})();const cB=[cd.EarlyRead,cd.Write,cd.MixedReadWrite,cd.Read];let uB=(()=>{class n{ngZone=b(ue);scheduler=b(ws);errorHandler=b(wi,{optional:!0});sequences=new Set;deferredRegistrations=new Set;executing=!1;constructor(){b(ld,{optional:!0})}execute(){this.executing=!0;for(const t of cB)for(const r of this.sequences)if(!r.erroredOrDestroyed&&r.hooks[t])try{r.pipelinedValue=this.ngZone.runOutsideAngular(()=>this.maybeTrace(()=>r.hooks[t](r.pipelinedValue),r.snapshot))}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(8),this.deferredRegistrations.clear()}register(t){this.executing?this.deferredRegistrations.add(t):(this.sequences.add(t),this.scheduler.notify(7))}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))}maybeTrace(t,r){return r?r.run(Z0.AFTER_NEXT_RENDER,t):t()}static \u0275prov=G({token:n,providedIn:"root",factory:()=>new n})}return n})();class dB{impl;hooks;once;snapshot;erroredOrDestroyed=!1;pipelinedValue=void 0;unregisterOnDestroy;constructor(e,t,r,i,o=null){this.impl=e,this.hooks=t,this.once=r,this.snapshot=o,this.unregisterOnDestroy=i?.onDestroy(()=>this.destroy())}afterRun(){this.erroredOrDestroyed=!1,this.pipelinedValue=void 0,this.snapshot?.dispose(),this.snapshot=null}destroy(){this.impl.unregister(this),this.unregisterOnDestroy?.()}}function ex(n,e){!e?.injector&&va();const t=e?.injector??b(ze);return On("NgAfterRender"),hB(n,t,e,!1)}function Cs(n,e){!e?.injector&&va();const t=e?.injector??b(ze);return On("NgAfterNextRender"),hB(n,t,e,!0)}function hB(n,e,t,r){const i=e.get(J0);i.impl??=e.get(uB);const o=e.get(ld,null,{optional:!0}),s=t?.phase??cd.MixedReadWrite,a=!0!==t?.manualCleanup?e.get(uo):null,l=new dB(i.impl,function xie(n,e){if(n instanceof Function){const t=[void 0,void 0,void 0,void 0];return t[e]=n,t}return[n.earlyRead,n.write,n.mixedReadWrite,n.read]}(n,s),r,a,o?.snapshot(null));return i.impl.register(l),l}function OB(n,e){const t=n.contentQueries;if(null!==t){const r=Se(null);try{for(let i=0;in,createScript:n=>n,createScriptURL:n=>n})}catch{}return Sv}()?.createHTML(n)||n}function VB(n){return function mx(){if(void 0===Dv&&(Dv=null,Nt.trustedTypes))try{Dv=Nt.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch{}return Dv}()?.createScriptURL(n)||n}class uc{changingThisBreaksApplicationSecurity;constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${oV})`}}class loe extends uc{getTypeName(){return"HTML"}}class coe extends uc{getTypeName(){return"Style"}}class uoe extends uc{getTypeName(){return"Script"}}class doe extends uc{getTypeName(){return"URL"}}class hoe extends uc{getTypeName(){return"ResourceURL"}}function Ei(n){return n instanceof uc?n.changingThisBreaksApplicationSecurity:n}function No(n,e){const t=function foe(n){return n instanceof uc&&n.getTypeName()||null}(n);if(null!=t&&t!==e){if("ResourceURL"===t&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${t} (see ${oV})`)}return t===e}class voe{inertDocumentHelper;constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e=""+e;try{const t=(new window.DOMParser).parseFromString(_d(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.firstChild?.remove(),t)}catch{return null}}}class boe{defaultDoc;inertDocument;constructor(e){this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert")}getInertBodyElement(e){const t=this.inertDocument.createElement("template");return t.innerHTML=_d(e),t}}const Eoe=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function Av(n){return(n=String(n)).match(Eoe)?n:"unsafe:"+n}function xs(n){const e={};for(const t of n.split(","))e[t]=!0;return e}function Cp(...n){const e={};for(const t of n)for(const r in t)t.hasOwnProperty(r)&&(e[r]=!0);return e}const UB=xs("area,br,col,hr,img,wbr"),zB=xs("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),jB=xs("rp,rt"),gx=Cp(UB,Cp(zB,xs("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")),Cp(jB,xs("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")),Cp(jB,zB)),_x=xs("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),HB=Cp(_x,xs("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"),xs("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")),Ioe=xs("script,style,template");class Toe{sanitizedSomething=!1;buf=[];sanitizeChildren(e){let t=e.firstChild,r=!0,i=[];for(;t;)if(t.nodeType===Node.ELEMENT_NODE?r=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,r&&t.firstChild)i.push(t),t=Soe(t);else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let o=xoe(t);if(o){t=o;break}t=i.pop()}return this.buf.join("")}startElement(e){const t=$B(e).toLowerCase();if(!gx.hasOwnProperty(t))return this.sanitizedSomething=!0,!Ioe.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const r=e.attributes;for(let i=0;i"),!0}endElement(e){const t=$B(e).toLowerCase();gx.hasOwnProperty(t)&&!UB.hasOwnProperty(t)&&(this.buf.push(""))}chars(e){this.buf.push(WB(e))}}function xoe(n){const e=n.nextSibling;if(e&&n!==e.previousSibling)throw qB(e);return e}function Soe(n){const e=n.firstChild;if(e&&function Coe(n,e){return(n.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)!==Node.DOCUMENT_POSITION_CONTAINED_BY}(n,e))throw qB(e);return e}function $B(n){const e=n.nodeName;return"string"==typeof e?e:"FORM"}function qB(n){return new Error(`Failed to sanitize html because the element is clobbered: ${n.outerHTML}`)}const Doe=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Aoe=/([^\#-~ |!])/g;function WB(n){return n.replace(/&/g,"&").replace(Doe,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(Aoe,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}let Rv;function GB(n,e){let t=null;try{Rv=Rv||function BB(n){const e=new boe(n);return function woe(){try{return!!(new window.DOMParser).parseFromString(_d(""),"text/html")}catch{return!1}}()?new voe(e):e}(n);let r=e?String(e):"";t=Rv.getInertBodyElement(r);let i=5,o=r;do{if(0===i)throw new Error("Failed to sanitize html because the input is unstable");i--,r=o,o=t.innerHTML,t=Rv.getInertBodyElement(r)}while(r!==o);return _d((new Toe).sanitizeChildren(yx(t)||t))}finally{if(t){const r=yx(t)||t;for(;r.firstChild;)r.firstChild.remove()}}}function yx(n){return"content"in n&&function Roe(n){return n.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===n.nodeName}(n)?n.content:null}var er=function(n){return n[n.NONE=0]="NONE",n[n.HTML=1]="HTML",n[n.STYLE=2]="STYLE",n[n.SCRIPT=3]="SCRIPT",n[n.URL=4]="URL",n[n.RESOURCE_URL=5]="RESOURCE_URL",n}(er||{});function vx(n){const e=xp();return e?e.sanitize(er.URL,n)||"":No(n,"URL")?Ei(n):Av(Ce(n))}function KB(n){const e=xp();if(e)return VB(e.sanitize(er.RESOURCE_URL,n)||"");if(No(n,"ResourceURL"))return VB(Ei(n));throw new O(904,!1)}function xp(){const n=L();return n&&n[10].sanitizer}const Loe=/^>|^->||--!>|)/g;function Ii(n){return n instanceof Function?n():n}function Yoe(n,e,t){let r=n.length;for(;;){const i=n.indexOf(e,t);if(-1===i)return i;if(0===i||n.charCodeAt(i-1)<=32){const o=e.length;if(i+o===r||n.charCodeAt(i+o)<=32)return i}t=i+1}}const iU="ng-template";function Xoe(n,e,t,r){let i=0;if(r){for(;i-1){let o;for(;++io?"":i[u+1].toLowerCase(),2&r&&c!==d){if(ho(r))return!1;s=!0}}}}else{if(!s&&!ho(r)&&!ho(l))return!1;if(s&&ho(l))continue;s=!1,r=l|1&r}}return ho(r)||s}function ho(n){return!(1&n)}function ese(n,e,t,r){if(null===e)return-1;let i=0;if(r||!t){let o=!1;for(;i-1)for(t++;t0?'="'+a+'"':"")+"]"}else 8&r?i+="."+s:4&r&&(i+=" "+s);else""!==i&&!ho(s)&&(e+=sU(o,i),i=""),r=s,o=o||!ho(r);t++}return""!==i&&(e+=sU(o,i)),e}const xe={};function Tx(n,e){return n.createComment(function YB(n){return n.replace(Loe,e=>e.replace(Voe,"\u200b$1\u200b"))}(e))}function Nv(n,e,t){return n.createElement(e,t)}function dc(n,e,t,r,i){n.insertBefore(e,t,r,i)}function lU(n,e,t){n.appendChild(e,t)}function cU(n,e,t,r,i){null!==r?dc(n,e,t,r,i):lU(n,e,t)}function dU(n,e,t){const{mergedAttrs:r,classes:i,styles:o}=t;null!==r&&function Ere(n,e,t){let r=0;for(;r25&&fU(n,e,25,!1),t(r,i)}finally{oc(o)}}function Dx(n,e,t){Jy()&&(Or(_r(t,e),e),gU(n,e,t))}function gU(n,e,t){(function vse(n,e,t){const r=t.directiveStart,i=t.directiveEnd;zi(t)&&function dse(n,e,t){const r=_r(e,n),i=function hU(n){const e=n.tView;return null===e||e.incompleteFirstPass?n.tView=Cx(1,null,n.template,n.decls,n.vars,n.directiveDefs,n.pipeDefs,n.viewQuery,n.schemas,n.consts,n.id):e}(t),o=n[10].rendererFactory,s=Sx(n,Pv(n,i,null,xx(t),r,e,null,o.createRenderer(r,t),null,null,null));n[e.index]=s}(e,t,n.data[r+t.componentOffset]),n.firstCreatePass||ov(t,e);const o=t.initialInputs;for(let s=r;snull;function ri(n,e,t,r,i,o,s,a){let c,l=e.inputs;if(!a&&null!=l&&(c=l[r]))kx(n,t,c,0,i),zi(e)&&function _se(n,e){const t=kr(e,n);16&t[2]||(t[2]|=64)}(t,e.index);else if(3&e.type){const u=_r(e,t);r=function gse(n){return"class"===n?"className":"for"===n?"htmlFor":"formaction"===n?"formAction":"innerHtml"===n?"innerHTML":"readonly"===n?"readOnly":"tabindex"===n?"tabIndex":n}(r),i=null!=s?s(i,e.value||"",r):i,o.setProperty(u,r,i)}}function wse(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function Rx(n,e){const t=n.directiveRegistry;let r=null;if(t)for(let i=0;i=0?r[a]():r[-a].unsubscribe(),s+=2}else t[s].call(r[t[s+1]]);null!==r&&(e[7]=null);const i=e[21];if(null!==i){e[21]=null;for(let s=0;s{Jf(n.lView)},consumerOnSignalRead(){this.lView[24]=this}},Bse={...$l,consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:n=>{let e=ys(n.lView);for(;e&&!AU(e[1]);)e=ys(e);e&&o0(e)},consumerOnSignalRead(){this.lView[24]=this}};function AU(n){return 2!==n.type}function RU(n){if(null===n[23])return;let e=!0;for(;e;){let t=!1;for(const r of n[23])r.dirty&&(t=!0,null===r.zone||Zone.current===r.zone?r.run():r.zone.run(()=>r.run()));e=t&&!!(8192&n[2])}}function Uv(n,e=!0,t=0){const i=n[10].rendererFactory;i.begin?.();try{!function zse(n,e){const t=GV();try{ev(!0),jx(n,e);let r=0;for(;Yy(n);){if(100===r)throw new O(103,!1);r++,jx(n,1)}}finally{ev(t)}}(n,t)}catch(s){throw e&&Fv(n,s),s}finally{i.end?.()}}function kU(n,e,t,r){if(wa(e))return;const i=e[2];m0(e);let a=!0,l=null,c=null;AU(n)?(c=function Pse(n){return n[24]??function Ose(n){const e=DU.pop()??Object.create(Lse);return e.lView=n,e}(n)}(e),l=ql(c)):null===function vC(){return hn}()?(a=!1,c=function Vse(n){const e=n[24]??Object.create(Bse);return e.lView=n,e}(e),l=ql(c)):e[24]&&(qf(e[24]),e[24]=null);try{UV(e),function KV(n){return be.lFrame.bindingIndex=n}(n.bindingStartIndex),null!==t&&mU(n,e,t,2,r);const u=!(3&~i);if(u){const p=n.preOrderCheckHooks;null!==p&&nv(e,p,null)}else{const p=n.preOrderHooks;null!==p&&rv(e,p,0,null),v0(e,0)}if(function jse(n){for(let e=W2(n);null!==e;e=G2(e)){if(!(2&e[2]))continue;const t=e[9];for(let r=0;r0&&(t[i-1][4]=e),r0&&(n[t-1][4]=r[4]);const o=Vy(n,10+e);!function vU(n,e){bU(n,e),e[0]=null,e[5]=null}(r[1],r);const s=o[18];null!==s&&s.detachView(o[1]),r[3]=null,r[4]=null,r[2]&=-129}return r}function VU(n,e){const t=n[9],r=e[3];(Qt(r)||e[15]!==r[3][15])&&(n[2]|=2),null===t?n[9]=[e]:t.push(e)}class kp{_lView;_cdRefInjectingView;notifyErrorHandler;_appRef=null;_attachedToViewContainer=!1;get rootNodes(){const e=this._lView,t=e[1];return wd(t,e,t.firstChild,[])}constructor(e,t,r=!0){this._lView=e,this._cdRefInjectingView=t,this.notifyErrorHandler=r}get context(){return this._lView[8]}get dirty(){return!!(9280&this._lView[2])||!!this._lView[24]?.dirty}set context(e){this._lView[8]=e}get destroyed(){return wa(this._lView)}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._attachedToViewContainer){const e=this._lView[3];if(Pn(e)){const t=e[8],r=t?t.indexOf(this):-1;r>-1&&(Mp(e,r),Vy(t,r))}this._attachedToViewContainer=!1}Ap(this._lView[1],this._lView)}onDestroy(e){Xy(this._lView,e)}markForCheck(){Rp(this._cdRefInjectingView||this._lView,4)}markForRefresh(){o0(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){s0(this._lView),this._lView[2]|=128}detectChanges(){this._lView[2]|=1024,Uv(this._lView,this.notifyErrorHandler)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new O(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;const e=_s(this._lView),t=this._lView[16];null!==t&&!e&&Ox(t,this._lView),bU(this._lView[1],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new O(902,!1);this._appRef=e;const t=_s(this._lView),r=this._lView[16];null!==r&&!t&&VU(r,this._lView),s0(this._lView)}}let Oo=(()=>class n{static __NG_ELEMENT_ID__=Kse})();const Wse=Oo,Gse=class extends Wse{_declarationLView;_declarationTContainer;elementRef;constructor(e,t,r){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=r}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(e,t){return this.createEmbeddedViewImpl(e,t)}createEmbeddedViewImpl(e,t,r){const i=vd(this._declarationLView,this._declarationTContainer,e,{embeddedViewInjector:t,dehydratedView:r});return new kp(i)}};function Kse(){return zv(Fe(),L())}function zv(n,e){return 4&n.type?new Gse(e,n,od(n,e)):null}function Id(n,e,t,r,i){let o=n.data[e];if(null===o)o=function Gx(n,e,t,r,i){const o=$V(),s=u0(),l=n.data[e]=function iae(n,e,t,r,i,o){let s=e?e.injectorIndex:-1,a=0;return ic()&&(a|=128),{type:t,index:r,insertBeforeIndex:null,injectorIndex:s,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,propertyBindings:null,flags:a,providerIndexes:0,value:i,attrs:o,mergedAttrs:null,localNames:null,initialInputs:void 0,inputs:null,outputs:null,tView:null,next:null,prev:null,projectionNext:null,child:null,parent:e,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}(0,s?o:o&&o.parent,t,e,r,i);return function rae(n,e,t,r){null===n.firstChild&&(n.firstChild=e),null!==t&&(r?null==t.child&&null!==e.parent&&(t.child=e):null===t.next&&(t.next=e,e.prev=t))}(n,l,o,s),l}(n,e,t,r,i),function cre(){return be.lFrame.inI18n}()&&(o.flags|=32);else if(64&o.type){o.type=t,o.value=r,o.attrs=i;const s=function ep(){const n=be.lFrame,e=n.currentTNode;return n.isParent?e:e.parent}();o.injectorIndex=null===s?-1:s.injectorIndex}return co(o,!0),o}class $ae{}class sz{}class qae{resolveComponentFactory(e){throw Error(`No component factory found for ${Mn(e)}.`)}}class Gv{static NULL=new qae}class Aa{}let Ti=(()=>class n{destroyNode=null;static __NG_ELEMENT_ID__=()=>function Wae(){const n=L(),t=kr(Fe().index,n);return(Qt(t)?t:n)[11]}()})(),Gae=(()=>{class n{static \u0275prov=G({token:n,providedIn:"root",factory:()=>null})}return n})();function iS(n,e,t){let r=t?n.styles:null,i=t?n.classes:null,o=0;if(null!==e)for(let s=0;s0;){const t=n[--e];if("number"==typeof t&&t<0)return t}return 0})(s)!=a&&s.push(a),s.push(t,r,o)}}(n,e,r,Dp(n,t,i.hostVars,xe),i)}function sle(n,e,t){if(t){if(e.exportAs)for(let r=0;r{const[t,r,i]=n[e],o={propName:t,templateName:e,isSignal:!!(r&Ov.SignalBased)};return i&&(o.transform=i),o})}(this.componentDef.inputs)}get outputs(){return function cle(n){return Object.keys(n).map(e=>({propName:n[e],templateName:e}))}(this.componentDef.outputs)}constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function sse(n){return n.map(ose).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors??[],this.isBoundToModule=!!t}create(e,t,r,i){const o=Se(null);try{const s=this.componentDef,a=r?["ng-version","19.1.7"]:function ase(n){const e=[],t=[];let r=1,i=2;for(;r[this.componentDef],!0,0);f&&(dU(d,f,_),Or(f,p)),gU(l,p,_),fx(l,_,p),hz(l,_),void 0!==t&&function ple(n,e,t){const r=n.projection=[];for(let i=0;iclass n{static __NG_ELEMENT_ID__=mle})();function mle(){return gz(Fe(),L())}const gle=Ci,pz=class extends gle{_lContainer;_hostTNode;_hostLView;constructor(e,t,r){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=r}get element(){return od(this._hostTNode,this._hostLView)}get injector(){return new nn(this._hostTNode,this._hostLView)}get parentInjector(){const e=sv(this._hostTNode,this._hostLView);if(I0(e)){const t=op(e,this._hostLView),r=ip(e);return new nn(t[1].data[r+8],t)}return new nn(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=mz(this._lContainer);return null!==t&&t[e]||null}get length(){return this._lContainer.length-10}createEmbeddedView(e,t,r){let i,o;"number"==typeof r?i=r:null!=r&&(i=r.index,o=r.injector);const a=e.createEmbeddedViewImpl(t||{},o,null);return this.insertImpl(a,i,hc(this._hostTNode,null)),a}createComponent(e,t,r,i,o){const s=e&&!function Zf(n){return"function"==typeof n}(e);let a;if(s)a=t;else{const m=t||{};a=m.index,r=m.injector,i=m.projectableNodes,o=m.environmentInjector||m.ngModuleRef}const l=s?e:new jp(Me(e)),c=r||this.parentInjector;if(!o&&null==l.ngModule){const _=(s?c:this.parentInjector).get(mr,null);_&&(o=_)}Me(l.componentType??{});const p=l.create(c,i,null,o);return this.insertImpl(p.hostView,a,hc(this._hostTNode,null)),p}insert(e,t){return this.insertImpl(e,t,!0)}insertImpl(e,t,r){const i=e._lView;if(function Jne(n){return Pn(n[3])}(i)){const a=this.indexOf(e);if(-1!==a)this.detach(a);else{const l=i[3],c=new pz(l,l[5],l[3]);c.detach(c.indexOf(e))}}const o=this._adjustIndex(t),s=this._lContainer;return Ed(s,i,o,r),e.attachToViewContainerRef(),yV(sS(s),o,e),e}move(e,t){return this.insert(e,t)}indexOf(e){const t=mz(this._lContainer);return null!==t?t.indexOf(e):-1}remove(e){const t=this._adjustIndex(e,-1),r=Mp(this._lContainer,t);r&&(Vy(sS(this._lContainer),t),Ap(r[1],r))}detach(e){const t=this._adjustIndex(e,-1),r=Mp(this._lContainer,t);return r&&null!=Vy(sS(this._lContainer),t)?new kp(r):null}_adjustIndex(e,t=0){return e??this.length+t}};function mz(n){return n[8]}function sS(n){return n[8]||(n[8]=[])}function gz(n,e){let t;const r=e[n.index];return Pn(r)?t=r:(t=FU(r,e,null,n),e[n.index]=t,Sx(e,t)),_z(t,e,n,r),new pz(t,n,e)}let _z=function vz(n,e,t,r){if(n[7])return;let i;i=8&t.type?Je(r):function _le(n,e){const t=n[11],r=t.createComment(""),i=_r(e,n),o=t.parentNode(i);return dc(t,o,r,t.nextSibling(i),!1),r}(e,t),n[7]=i};class lS{queryList;matches=null;constructor(e){this.queryList=e}clone(){return new lS(this.queryList)}setDirty(){this.queryList.setDirty()}}class cS{queries;constructor(e=[]){this.queries=e}createEmbeddedView(e){const t=e.queries;if(null!==t){const r=null!==e.contentQueries?e.contentQueries[0]:t.length,i=[];for(let o=0;oe.trim())}(e):e}}class uS{queries;constructor(e=[]){this.queries=e}elementStart(e,t){for(let r=0;r0)r.push(s[a/2]);else{const c=o[a+1],u=e[-l];for(let d=10;d{r._dirtyCounter();const o=function Sle(n,e){const t=n._lView,r=n._queryIndex;if(void 0===t||void 0===r||4&t[2])return e?void 0:it;const i=fS(t,r),o=xz(t,r);return i.reset(o,O2),e?i.first:i._changesDetected||void 0===n._flatValue?n._flatValue=i.toArray():n._flatValue}(r,n);if(e&&void 0===o)throw new O(-951,!1);return o});return r=i[In],r._dirtyCounter=ti(0),r._flatValue=void 0,i}function Mz(n,e){return function Sz(n){return mS(!0,!1)}()}const Ale=(Mz.required=function Dle(n,e){return function Dz(n){return mS(!0,!0)}()},Mz);class Ss{}class Vz{}class gS extends Ss{ngModuleType;_parent;_bootstrapComponents=[];_r3Injector;instance;destroyCbs=[];componentFactoryResolver=new fz(this);constructor(e,t,r,i=!0){super(),this.ngModuleType=e,this._parent=t;const o=pr(e);this._bootstrapComponents=Ii(o.bootstrap),this._r3Injector=I2(e,t,[{provide:Ss,useValue:this},{provide:Gv,useValue:this.componentFactoryResolver},...r],Mn(e),new Set(["environment"])),i&&this.resolveInjectorInitializers()}resolveInjectorInitializers(){this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(this.ngModuleType)}get injector(){return this._r3Injector}destroy(){const e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}}class _S extends Vz{moduleType;constructor(e){super(),this.moduleType=e}create(e){return new gS(this.moduleType,e,[])}}class Bz extends Ss{injector;componentFactoryResolver=new fz(this);instance=null;constructor(e){super();const t=new Zl([...e.providers,{provide:Ss,useValue:this},{provide:Gv,useValue:this.componentFactoryResolver}],e.parent||Hy(),e.debugName,new Set(["environment"]));this.injector=t,e.runEnvironmentInitializers&&t.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(e){this.injector.onDestroy(e)}}function yS(n,e,t=null){return new Bz({providers:n,parent:e,debugName:t,runEnvironmentInitializers:!0}).injector}let Ule=(()=>{class n{_injector;cachedInjectors=new Map;constructor(t){this._injector=t}getOrCreateStandaloneInjector(t){if(!t.standalone)return null;if(!this.cachedInjectors.has(t)){const r=qC(0,t.type),i=r.length>0?yS([r],this._injector,`Standalone[${t.type.name}]`):null;this.cachedInjectors.set(t,i)}return this.cachedInjectors.get(t)}ngOnDestroy(){try{for(const t of this.cachedInjectors.values())null!==t&&t.destroy()}finally{this.cachedInjectors.clear()}}static \u0275prov=G({token:n,providedIn:"environment",factory:()=>new n(me(mr))})}return n})();function He(n){return fs(()=>{const e=Uz(n),t={...e,decls:n.decls,vars:n.vars,template:n.template,consts:n.consts||null,ngContentSelectors:n.ngContentSelectors,onPush:n.changeDetection===dv.OnPush,directiveDefs:null,pipeDefs:null,dependencies:e.standalone&&n.dependencies||null,getStandaloneInjector:e.standalone?i=>i.get(Ule).getOrCreateStandaloneInjector(t):null,getExternalStyles:null,signals:n.signals??!1,data:n.data||{},encapsulation:n.encapsulation||Wi.Emulated,styles:n.styles||it,_:null,schemas:n.schemas||null,tView:null,id:""};e.standalone&&On("NgStandalone"),zz(t);const r=n.dependencies;return t.directiveDefs=Yv(r,!1),t.pipeDefs=Yv(r,!0),t.id=function Wle(n){let e=0;const r=[n.selectors,n.ngContentSelectors,n.hostVars,n.hostAttrs,"function"==typeof n.consts?"":n.consts,n.vars,n.decls,n.encapsulation,n.standalone,n.signals,n.exportAs,JSON.stringify(n.inputs),JSON.stringify(n.outputs),Object.getOwnPropertyNames(n.type.prototype),!!n.contentQueries,!!n.viewQuery];for(const o of r.join("|"))e=Math.imul(31,e)+o.charCodeAt(0)|0;return e+=2147483648,"c"+e}(t),t})}function zle(n){return Me(n)||kn(n)}function jle(n){return null!==n}function Et(n){return fs(()=>({type:n.type,bootstrap:n.bootstrap||it,declarations:n.declarations||it,imports:n.imports||it,exports:n.exports||it,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null}))}function Hle(n,e){if(null==n)return lo;const t={};for(const r in n)if(n.hasOwnProperty(r)){const i=n[r];let o,s,a,l;Array.isArray(i)?(a=i[0],o=i[1],s=i[2]??o,l=i[3]||null):(o=i,s=i,a=Ov.None,l=null),t[o]=[r,a,l],e[o]=s}return t}function $le(n){if(null==n)return lo;const e={};for(const t in n)n.hasOwnProperty(t)&&(e[n[t]]=t);return e}function ee(n){return fs(()=>{const e=Uz(n);return zz(e),e})}function Fr(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,standalone:n.standalone??!0,onDestroy:n.type.prototype.ngOnDestroy||null}}function Uz(n){const e={};return{type:n.type,providersResolver:null,factory:null,hostBindings:n.hostBindings||null,hostVars:n.hostVars||0,hostAttrs:n.hostAttrs||null,contentQueries:n.contentQueries||null,declaredInputs:e,inputConfig:n.inputs||lo,exportAs:n.exportAs||null,standalone:n.standalone??!0,signals:!0===n.signals,selectors:n.selectors||it,viewQuery:n.viewQuery||null,features:n.features||null,setInput:null,findHostDirectiveDefs:null,hostDirectives:null,inputs:Hle(n.inputs,e),outputs:$le(n.outputs),debugInfo:null}}function zz(n){n.features?.forEach(e=>e(n))}function Yv(n,e){if(!n)return null;const t=e?Zn:zle;return()=>("function"==typeof n?n():n).map(r=>t(r)).filter(jle)}function ke(n){let e=function jz(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const r=[n];for(;e;){let i;if(ji(n))i=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new O(903,!1);i=e.\u0275dir}if(i){if(t){r.push(i);const s=n;s.inputs=vS(n.inputs),s.declaredInputs=vS(n.declaredInputs),s.outputs=vS(n.outputs);const a=i.hostBindings;a&&Xle(n,a);const l=i.viewQuery,c=i.contentQueries;if(l&&Qle(n,l),c&&Yle(n,c),Gle(n,i),nne(n.outputs,i.outputs),ji(i)&&i.data.animation){const u=n.data;u.animation=(u.animation||[]).concat(i.data.animation)}}const o=i.features;if(o)for(let s=0;s=0;r--){const i=n[r];i.hostVars=e+=i.hostVars,i.hostAttrs=id(i.hostAttrs,t=id(t,i.hostAttrs))}}(r)}function Gle(n,e){for(const t in e.inputs){if(!e.inputs.hasOwnProperty(t)||n.inputs.hasOwnProperty(t))continue;const r=e.inputs[t];void 0!==r&&(n.inputs[t]=r,n.declaredInputs[t]=e.declaredInputs[t])}}function vS(n){return n===lo?{}:n===it?[]:n}function Qle(n,e){const t=n.viewQuery;n.viewQuery=t?(r,i)=>{e(r,i),t(r,i)}:e}function Yle(n,e){const t=n.contentQueries;n.contentQueries=t?(r,i,o)=>{e(r,i,o),t(r,i,o)}:e}function Xle(n,e){const t=n.hostBindings;n.hostBindings=t?(r,i)=>{e(r,i),t(r,i)}:e}function rn(n,e,t){return!Object.is(n[e],t)&&(n[e]=t,!0)}function qp(n,e,t,r,i,o,s,a,l,c){const u=t+25,d=e.firstCreatePass?function sce(n,e,t,r,i,o,s,a,l){const c=e.consts,u=Id(e,n,4,s||null,a||null);Jy()&&oS(e,t,u,$i(c,l),Rx),u.mergedAttrs=id(u.mergedAttrs,u.attrs),y0(e,u);const d=u.tView=Cx(2,u,r,i,o,e.directiveRegistry,e.pipeRegistry,null,e.schemas,c,null);return null!==e.queries&&(e.queries.template(e,u),d.queries=e.queries.embeddedTView(u)),u}(u,e,n,r,i,o,s,a,l):e.data[u];co(d,!1);const f=Gz(e,n,d,t);np()&&Vv(e,n,f,d),Or(f,n);const p=FU(f,n,f,d);return n[u]=p,Sx(n,p),Ky(d)&&Dx(e,n,d),null!=l&&Ax(n,d,c),d}function et(n,e,t,r,i,o,s,a){const l=L(),c=ve();return qp(l,c,n,e,t,r,i,$i(c.consts,o),s,a),et}let Gz=function Kz(n,e,t,r){return Ro(!0),e[11].createComment("")};let tj=(()=>{class n{log(t){console.log(t)}warn(t){console.warn(t)}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"platform"})}return n})();const lj=new B("");function Gp(n){return!!n&&"function"==typeof n.then}function cj(n){return!!n&&"function"==typeof n.subscribe}const uj=new B("");let dj=(()=>{class n{resolve;reject;initialized=!1;done=!1;donePromise=new Promise((t,r)=>{this.resolve=t,this.reject=r});appInits=b(uj,{optional:!0})??[];injector=b(ze);constructor(){}runInitializers(){if(this.initialized)return;const t=[];for(const i of this.appInits){const o=yi(this.injector,i);if(Gp(o))t.push(o);else if(cj(o)){const s=new Promise((a,l)=>{o.subscribe({complete:a,error:l})});t.push(s)}}const r=()=>{this.done=!0,this.resolve()};Promise.all(t).then(()=>{r()}).catch(i=>{this.reject(i)}),0===t.length&&r(),this.initialized=!0}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),RS=(()=>{class n{static \u0275prov=G({token:n,providedIn:"root",factory:()=>new hj})}return n})();class hj{queuedEffectCount=0;queues=new Map;schedule(e){this.enqueue(e)}remove(e){const r=this.queues.get(e.zone);r.has(e)&&(r.delete(e),this.queuedEffectCount--)}enqueue(e){const t=e.zone;this.queues.has(t)||this.queues.set(t,new Set);const r=this.queues.get(t);r.has(e)||(this.queuedEffectCount++,r.add(e))}flush(){for(;this.queuedEffectCount>0;)for(const[e,t]of this.queues)null===e?this.flushQueue(t):e.run(()=>this.flushQueue(t))}flushQueue(e){for(const t of e)e.delete(t),this.queuedEffectCount--,t.run()}}const Kp=new B("");let tr=(()=>{class n{_runningTick=!1;_destroyed=!1;_destroyListeners=[];_views=[];internalErrorHandler=b(Qre);afterRenderManager=b(J0);zonelessEnabled=b(lp);rootEffectScheduler=b(RS);dirtyFlags=0;deferredDirtyFlags=0;tracingSnapshot=null;externalTestViews=new Set;afterTick=new fe;get allViews(){return[...this.externalTestViews.keys(),...this._views]}get destroyed(){return this._destroyed}componentTypes=[];components=[];isStable=b(Es).hasPendingTasks.pipe(Te(t=>!t));constructor(){b(ld,{optional:!0})}whenStable(){let t;return new Promise(r=>{t=this.isStable.subscribe({next:i=>{i&&r()}})}).finally(()=>{t.unsubscribe()})}_injector=b(mr);_rendererFactory=null;get injector(){return this._injector}bootstrap(t,r){const i=t instanceof sz;if(!this._injector.get(dj).done)throw!i&&function ya(n){const e=Me(n)||kn(n)||Zn(n);return null!==e&&e.standalone}(t),new O(405,!1);let s;s=i?t:this._injector.get(Gv).resolveComponentFactory(t),this.componentTypes.push(s.componentType);const a=function sue(n){return n.isBoundToModule}(s)?void 0:this._injector.get(Ss),c=s.create(ze.NULL,[],r||s.selector,a),u=c.location.nativeElement,d=c.injector.get(lj,null);return d?.registerApplication(u),c.onDestroy(()=>{this.detachView(c.hostView),rb(this.components,c),d?.unregisterApplication(u)}),this._loadComponent(c),c}tick(){this.zonelessEnabled||(this.dirtyFlags|=1),this._tick()}_tick=()=>{if(null!==this.tracingSnapshot){const r=this.tracingSnapshot;return this.tracingSnapshot=null,r.run(Z0.CHANGE_DETECTION,this._tick),void r.dispose()}if(this._runningTick)throw new O(101,!1);const t=Se(null);try{this._runningTick=!0,this.synchronize()}catch(r){this.internalErrorHandler(r)}finally{this._runningTick=!1,Se(t),this.afterTick.next()}};synchronize(){null===this._rendererFactory&&!this._injector.destroyed&&(this._rendererFactory=this._injector.get(Aa,null,{optional:!0})),this.dirtyFlags|=this.deferredDirtyFlags,this.deferredDirtyFlags=0;let t=0;for(;0!==this.dirtyFlags&&t++<10;)this.synchronizeOnce()}synchronizeOnce(){if(this.dirtyFlags|=this.deferredDirtyFlags,this.deferredDirtyFlags=0,16&this.dirtyFlags&&(this.dirtyFlags&=-17,this.rootEffectScheduler.flush()),7&this.dirtyFlags){const t=!!(1&this.dirtyFlags);this.dirtyFlags&=-8,this.dirtyFlags|=8;for(let{_lView:r,notifyErrorHandler:i}of this.allViews)lue(r,i,t,this.zonelessEnabled);if(this.dirtyFlags&=-5,this.syncDirtyFlagsWithViews(),23&this.dirtyFlags)return}else this._rendererFactory?.begin?.(),this._rendererFactory?.end?.();8&this.dirtyFlags&&(this.dirtyFlags&=-9,this.afterRenderManager.execute()),this.syncDirtyFlagsWithViews()}syncDirtyFlagsWithViews(){this.allViews.some(({_lView:t})=>Yy(t))?this.dirtyFlags|=2:this.dirtyFlags&=-8}attachView(t){const r=t;this._views.push(r),r.attachToAppRef(this)}detachView(t){const r=t;rb(this._views,r),r.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(Kp,[]).forEach(i=>i(t))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(t=>t()),this._views.slice().forEach(t=>t.destroy())}finally{this._destroyed=!0,this._views=[],this._destroyListeners=[]}}onDestroy(t){return this._destroyListeners.push(t),()=>rb(this._destroyListeners,t)}destroy(){if(this._destroyed)throw new O(406,!1);const t=this._injector;t.destroy&&!t.destroyed&&t.destroy()}get viewCount(){return this._views.length}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function rb(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}function lue(n,e,t,r){(t||Yy(n))&&Uv(n,e,t&&!r?0:1)}function Ke(n,e,t,r){const i=L();return rn(i,qi(),e)&&(ve(),Po(gt(),i,n,e,t,r)),Ke}function ib(n,e){return n<<17|e<<2}function Oa(n){return n>>17&32767}function PS(n){return 2|n}function _c(n){return(131068&n)>>2}function OS(n,e){return-131069&n|e<<2}function FS(n){return 1|n}function Aj(n,e,t,r){const i=n[t+1],o=null===e;let s=r?Oa(i):_c(i),a=!1;for(;0!==s&&(!1===a||o);){const c=n[s+1];Wue(n[s],e)&&(a=!0,n[s+1]=r?FS(c):PS(c)),s=r?Oa(c):_c(c)}a&&(n[t+1]=r?PS(i):FS(i))}function Wue(n,e){return null===n||null==e||(Array.isArray(n)?n[1]:n)===e||!(!Array.isArray(n)||"string"!=typeof e)&&Ku(n,e)>=0}const Fn={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function Rj(n){return n.substring(Fn.key,Fn.keyEnd)}function Mj(n,e){const t=Fn.textEnd;return t===e?-1:(e=Fn.keyEnd=function Yue(n,e,t){for(;e32;)e++;return e}(n,Fn.key=e,t),Vd(n,e,t))}function Vd(n,e,t){for(;e=0;t=Mj(e,t))_i(n,Rj(e),!0)}function fo(n,e,t,r){const i=L(),o=ve(),s=bs(2);o.firstUpdatePass&&Lj(o,n,s,r),e!==xe&&rn(i,s,e)&&Bj(o,o.data[Jn()],i,i[11],n,i[s+1]=function ade(n,e){return null==n||""===n||("string"==typeof e?n+=e:"object"==typeof n&&(n=Mn(Ei(n)))),n}(e,t),r,s)}function Fj(n,e){return e>=n.expandoStartIndex}function Lj(n,e,t,r){const i=n.data;if(null===i[t+1]){const o=i[Jn()],s=Fj(n,t);zj(o,r)&&null===e&&!s&&(e=!1),e=function ede(n,e,t,r){const i=f0(n);let o=r?e.residualClasses:e.residualStyles;if(null===i)0===(r?e.classBindings:e.styleBindings)&&(t=Yp(t=VS(null,n,e,t,r),e.attrs,r),o=null);else{const s=e.directiveStylingLast;if(-1===s||n[s]!==i)if(t=VS(i,n,e,t,r),null===o){let l=function tde(n,e,t){const r=t?e.classBindings:e.styleBindings;if(0!==_c(r))return n[Oa(r)]}(n,e,r);void 0!==l&&Array.isArray(l)&&(l=VS(null,n,e,l[1],r),l=Yp(l,e.attrs,r),function nde(n,e,t,r){n[Oa(t?e.classBindings:e.styleBindings)]=r}(n,e,r,l))}else o=function rde(n,e,t){let r;const i=e.directiveEnd;for(let o=1+e.directiveStylingLast;o0)&&(c=!0)):u=t,i)if(0!==l){const f=Oa(n[a+1]);n[r+1]=ib(f,a),0!==f&&(n[f+1]=OS(n[f+1],r)),n[a+1]=function jue(n,e){return 131071&n|e<<17}(n[a+1],r)}else n[r+1]=ib(a,0),0!==a&&(n[a+1]=OS(n[a+1],r)),a=r;else n[r+1]=ib(l,0),0===a?a=r:n[l+1]=OS(n[l+1],r),l=r;c&&(n[r+1]=PS(n[r+1])),Aj(n,u,r,!0),Aj(n,u,r,!1),function que(n,e,t,r,i){const o=i?n.residualClasses:n.residualStyles;null!=o&&"string"==typeof e&&Ku(o,e)>=0&&(t[r+1]=FS(t[r+1]))}(e,u,n,r,o),s=ib(a,l),o?e.classBindings=s:e.styleBindings=s}(i,o,e,t,s,r)}}function VS(n,e,t,r,i){let o=null;const s=t.directiveEnd;let a=t.directiveStylingLast;for(-1===a?a=t.directiveStart:a++;a0;){const l=n[i],c=Array.isArray(l),u=c?l[1]:l,d=null===u;let f=t[i+1];f===xe&&(f=d?it:void 0);let p=d?HC(f,r):u===r?f:void 0;if(c&&!ob(p)&&(p=HC(l,r)),ob(p)&&(a=p,s))return a;const m=n[i+1];i=s?Oa(m):_c(m)}if(null!==e){let l=o?e.residualClasses:e.residualStyles;null!=l&&(a=HC(l,r))}return a}function ob(n){return void 0!==n}function zj(n,e){return!!(n.flags&(e?8:16))}class yde{destroy(e){}updateValue(e,t){}swap(e,t){const r=Math.min(e,t),i=Math.max(e,t),o=this.detach(i);if(i-r>1){const s=this.detach(r);this.attach(r,o),this.attach(i,s)}else this.attach(r,o)}move(e,t){this.attach(t,this.detach(e))}}function BS(n,e,t,r,i){return n===t&&Object.is(e,r)?1:Object.is(i(n,e),i(t,r))?-1:0}function US(n,e,t,r){return!(void 0===e||!e.has(r)||(n.attach(t,e.get(r)),e.delete(r),0))}function jj(n,e,t,r,i){if(US(n,e,r,t(r,i)))n.updateValue(r,i);else{const o=n.create(r,i);n.attach(r,o)}}function Hj(n,e,t,r){const i=new Set;for(let o=e;o<=t;o++)i.add(r(o,n.at(o)));return i}class $j{kvMap=new Map;_vMap=void 0;has(e){return this.kvMap.has(e)}delete(e){if(!this.has(e))return!1;const t=this.kvMap.get(e);return void 0!==this._vMap&&this._vMap.has(t)?(this.kvMap.set(e,this._vMap.get(t)),this._vMap.delete(t)):this.kvMap.delete(e),!0}get(e){return this.kvMap.get(e)}set(e,t){if(this.kvMap.has(e)){let r=this.kvMap.get(e);void 0===this._vMap&&(this._vMap=new Map);const i=this._vMap;for(;i.has(r);)r=i.get(r);i.set(r,t)}else this.kvMap.set(e,t)}forEach(e){for(let[t,r]of this.kvMap)if(e(r,t),void 0!==this._vMap){const i=this._vMap;for(;i.has(r);)r=i.get(r),e(r,t)}}}function Pt(n,e){On("NgControlFlow");const t=L(),r=qi(),i=t[r]!==xe?t[r]:-1,o=-1!==i?sb(t,25+i):void 0;if(rn(t,r,n)){const a=Se(null);try{if(void 0!==o&&Hx(o,0),-1!==n){const l=25+n,c=sb(t,l),u=zS(t[1],l),d=null;Ed(c,vd(t,u,e,{dehydratedView:d}),0,hc(u,d))}}finally{Se(a)}}else if(void 0!==o){const a=LU(o,0);void 0!==a&&(a[8]=e)}}class bde{lContainer;$implicit;$index;constructor(e,t,r){this.lContainer=e,this.$implicit=t,this.$index=r}get $count(){return this.lContainer.length-10}}function qj(n,e){return e}class Ede{hasEmptyBlock;trackByFn;liveCollection;constructor(e,t,r){this.hasEmptyBlock=e,this.trackByFn=t,this.liveCollection=r}}class Ide extends yde{lContainer;hostLView;templateTNode;operationsCounter=void 0;needsIndexUpdate=!1;constructor(e,t,r){super(),this.lContainer=e,this.hostLView=t,this.templateTNode=r}get length(){return this.lContainer.length-10}at(e){return this.getLView(e)[8].$implicit}attach(e,t){const r=t[6];this.needsIndexUpdate||=e!==this.length,Ed(this.lContainer,t,e,hc(this.templateTNode,r))}detach(e){return this.needsIndexUpdate||=e!==this.length-1,function Tde(n,e){return Mp(n,e)}(this.lContainer,e)}create(e,t){const i=vd(this.hostLView,this.templateTNode,new bde(this.lContainer,t,e),{dehydratedView:null});return this.operationsCounter?.recordCreate(),i}destroy(e){Ap(e[1],e),this.operationsCounter?.recordDestroy()}updateValue(e,t){this.getLView(e)[8].$implicit=t}reset(){this.needsIndexUpdate=!1,this.operationsCounter?.reset()}updateIndexes(){if(this.needsIndexUpdate)for(let e=0;e(Ro(!0),Nv(r,i,function t2(){return be.lFrame.currentNamespace}()));function jS(n,e,t){const r=L(),i=ve(),o=n+25,s=i.firstCreatePass?function Dde(n,e,t,r,i){const o=e.consts,s=$i(o,r),a=Id(e,n,8,"ng-container",s);null!==s&&iS(a,s,!0);const l=$i(o,i);return Jy()&&oS(e,t,a,l,Rx),a.mergedAttrs=id(a.mergedAttrs,a.attrs),null!==e.queries&&e.queries.elementStart(e,a),a}(o,i,r,e,t):i.data[o];co(s,!0);const a=Qj(i,r,s,n);return r[o]=a,np()&&Vv(i,r,a,s),Or(a,r),Ky(s)&&(Dx(i,r,s),fx(i,s,r)),null!=t&&Ax(r,s),jS}function HS(){let n=Fe();const e=ve();return u0()?d0():(n=n.parent,co(n,!1)),e.firstCreatePass&&(y0(e,n),e0(n)&&e.queries.elementEnd(n)),HS}function Xp(n,e,t){return jS(n,e,t),HS(),Xp}let Qj=(n,e,t,r)=>(Ro(!0),Tx(e[11],""));function La(){return L()}function Bo(n,e,t){const r=L();return rn(r,qi(),e)&&ri(ve(),gt(),r,n,e,r[11],t,!0),Bo}function $S(n,e,t){const r=L();if(rn(r,qi(),e)){const o=ve(),s=gt();ri(o,s,r,n,e,yU(f0(o.data),s,r),t,!0)}return $S}const ab="en-US";let Zj=ab;function Ve(n,e,t,r){const i=L(),o=ve(),s=Fe();return KS(o,i,i[11],s,n,e,r),Ve}function GS(n,e){const t=Fe(),r=L(),i=ve();return KS(i,r,yU(f0(i.data),t,r),t,n,e),GS}function KS(n,e,t,r,i,o,s){const a=Ky(r),c=n.firstCreatePass&&HV(n),u=e[8],d=jV(e);let f=!0;if(3&r.type||s){const _=_r(r,e),v=s?s(_):_,E=d.length,C=s?V=>s(Je(V[r.index])):r.index;let R=null;if(!s&&a&&(R=function whe(n,e,t,r){const i=n.cleanup;if(null!=i)for(let o=0;ol?a[l]:null}"string"==typeof s&&(o+=2)}return null}(n,e,i,r.index)),null!==R)(R.__ngLastListenerFn__||R).__ngNextListenerFn__=o,R.__ngLastListenerFn__=o,f=!1;else{o=vH(r,e,u,o);const V=t.listen(v,i,o);d.push(o,V),c&&c.push(i,C,E,E+1)}}else o=vH(r,e,u,o);const p=r.outputs;let m;if(f&&null!==p&&(m=p[i])){const _=m.length;if(_)for(let v=0;v<_;v+=2){const H=e[m[v]][m[v+1]].subscribe(o),Q=d.length;d.push(o,H),c&&c.push(i,r.index,Q,-(Q+1))}}}function yH(n,e,t,r){const i=Se(null);try{return!1!==t(r)}catch(o){return Fv(n,o),!1}finally{Se(i)}}function vH(n,e,t,r){return function i(o){if(o===Function)return r;Rp(zi(n)?kr(n.index,e):e,5);let a=yH(e,0,r,o),l=i.__ngNextListenerFn__;for(;l;)a=yH(e,0,l,o)&&a,l=l.__ngNextListenerFn__;return a}}function Ln(n=1){return function fre(n){return(be.lFrame.contextLView=function zV(n,e){for(;n>0;)e=e[14],n--;return e}(n,be.lFrame.contextLView))[8]}(n)}function Ehe(n,e){let t=null;const r=function tse(n){const e=n.attrs;if(null!=e){const t=e.indexOf(5);if(!(1&t))return e[t+1]}return null}(n);for(let i=0;it._dirtyCounter.update(r=>r+1))}(e,Tz(n,t,r,i))}function rm(n){return function rc(n,e){return n[e]}(function qV(){return be.lFrame.contextLView}(),25+n)}function Oe(n,e=""){const t=L(),r=ve(),i=n+25,o=r.firstCreatePass?Id(r,i,1,e,null):r.data[i],s=UH(r,t,o,e,n);t[i]=s,np()&&Vv(r,t,s,o),co(o,!1)}let UH=(n,e,t,r,i)=>(Ro(!0),function Ix(n,e){return n.createText(e)}(e[11],r));function zd(n){return Va("",n,""),zd}function Va(n,e,t){const r=L(),i=function Rd(n,e,t,r){return rn(n,qi(),t)?e+Ce(t)+r:xe}(r,n,e,t);return i!==xe&&function Ds(n,e,t){const r=nd(e,n);!function aU(n,e,t){n.setValue(e,t)}(n[11],r,t)}(r,Jn(),i),Va}function XS(n,e,t,r,i){if(n=ye(n),Array.isArray(n))for(let o=0;o>20;if(Xl(n)||!n.multi){const p=new rp(c,i,$),m=JS(l,e,i?u:u+f,d);-1===m?(x0(ov(a,s),o,l),ZS(o,n,e.length),e.push(l),a.directiveStart++,a.directiveEnd++,i&&(a.providerIndexes+=1048576),t.push(p),s.push(p)):(t[m]=p,s[m]=p)}else{const p=JS(l,e,u+f,d),m=JS(l,e,u,u+f),v=m>=0&&t[m];if(i&&!v||!i&&!(p>=0&&t[p])){x0(ov(a,s),o,l);const E=function Hhe(n,e,t,r,i){const o=new rp(n,t,$);return o.multi=[],o.index=e,o.componentProviders=0,JH(o,i,r&&!t),o}(i?jhe:zhe,t.length,i,r,c);!i&&v&&(t[m].providerFactory=E),ZS(o,n,e.length,0),e.push(l),a.directiveStart++,a.directiveEnd++,i&&(a.providerIndexes+=1048576),t.push(E),s.push(E)}else ZS(o,n,p>-1?p:m,JH(t[i?m:p],c,!i&&r));!i&&r&&v&&t[m].componentProviders++}}}function ZS(n,e,t,r){const i=Xl(e),o=function Dne(n){return!!n.useClass}(e);if(i||o){const l=(o?ye(e.useClass):e).prototype.ngOnDestroy;if(l){const c=n.destroyHooks||(n.destroyHooks=[]);if(!i&&e.multi){const u=c.indexOf(t);-1===u?c.push(t,[r,l]):c[u+1].push(r,l)}else c.push(t,l)}}}function JH(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function JS(n,e,t,r){for(let i=t;i{t.providersResolver=(r,i)=>function Uhe(n,e,t){const r=ve();if(r.firstCreatePass){const i=ji(n);XS(t,r.data,r.blueprint,i,!0),XS(e,r.data,r.blueprint,i,!1)}}(r,i?i(n):n,e)}}function t$(n,e,t,r){return function n$(n,e,t,r,i,o){const s=e+t;return rn(n,s,i)?function Fo(n,e,t){return n[e]=t}(n,s+1,o?r.call(o,i):r(i)):function im(n,e){const t=n[e];return t===xe?void 0:t}(n,s+1)}(L(),function Nr(){const n=be.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}(),n,e,t,r)}function tD(n,e){return zv(n,e)}class vc{full;major;minor;patch;constructor(e){this.full=e;const t=e.split(".");this.major=t[0],this.minor=t[1],this.patch=t.slice(2).join(".")}}const Ffe=new vc("19.1.7");class Lfe{ngModuleFactory;componentFactories;constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}let Vfe=(()=>{class n{compileModuleSync(t){return new _S(t)}compileModuleAsync(t){return Promise.resolve(this.compileModuleSync(t))}compileModuleAndAllComponentsSync(t){const r=this.compileModuleSync(t),o=Ii(pr(t).declarations).reduce((s,a)=>{const l=Me(a);return l&&s.push(new jp(l)),s},[]);return new Lfe(r,o)}compileModuleAndAllComponentsAsync(t){return Promise.resolve(this.compileModuleAndAllComponentsSync(t))}clearCache(){}clearCacheFor(t){}getModuleId(t){}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),zfe=(()=>{class n{zone=b(ue);changeDetectionScheduler=b(ws);applicationRef=b(tr);_onMicrotaskEmptySubscription;initialize(){this._onMicrotaskEmptySubscription||(this._onMicrotaskEmptySubscription=this.zone.onMicrotaskEmpty.subscribe({next:()=>{this.changeDetectionScheduler.runningTick||this.zone.run(()=>{this.applicationRef.tick()})}}))}ngOnDestroy(){this._onMicrotaskEmptySubscription?.unsubscribe()}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function sD({ngZoneFactory:n,ignoreChangesOutsideZone:e,scheduleInRootZone:t}){return n??=()=>new ue({...aD(),scheduleInRootZone:t}),[{provide:ue,useFactory:n},{provide:Bi,multi:!0,useFactory:()=>{const r=b(zfe,{optional:!0});return()=>r.initialize()}},{provide:Bi,multi:!0,useFactory:()=>{const r=b(Hfe);return()=>{r.initialize()}}},!0===e?{provide:S2,useValue:!0}:[],{provide:A0,useValue:t??C2}]}function aD(n){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:n?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:n?.runCoalescing??!1}}let Hfe=(()=>{class n{subscription=new Kt;initialized=!1;zone=b(ue);pendingTasks=b(Es);initialize(){if(this.initialized)return;this.initialized=!0;let t=null;!this.zone.isStable&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(t=this.pendingTasks.add()),this.zone.runOutsideAngular(()=>{this.subscription.add(this.zone.onStable.subscribe(()=>{ue.assertNotInAngularZone(),queueMicrotask(()=>{null!==t&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(this.pendingTasks.remove(t),t=null)})}))}),this.subscription.add(this.zone.onUnstable.subscribe(()=>{ue.assertInAngularZone(),t??=this.pendingTasks.add()}))}ngOnDestroy(){this.subscription.unsubscribe()}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),am=(()=>{class n{appRef=b(tr);taskService=b(Es);ngZone=b(ue);zonelessEnabled=b(lp);tracing=b(ld,{optional:!0});disableScheduling=b(S2,{optional:!0})??!1;zoneIsDefined=typeof Zone<"u"&&!!Zone.root.run;schedulerTickApplyArgs=[{data:{__scheduler_tick__:!0}}];subscriptions=new Kt;angularZoneId=this.zoneIsDefined?this.ngZone._inner?.get(cv):null;scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(b(A0,{optional:!0})??!1);cancelScheduledCallback=null;useMicrotaskScheduler=!1;runningTick=!1;pendingRenderTaskId=null;constructor(){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 P0||!this.zoneIsDefined)}notify(t){if(!this.zonelessEnabled&&5===t)return;let r=!1;switch(t){case 0:this.appRef.dirtyFlags|=2;break;case 3:case 2:case 4:case 5:case 1:this.appRef.dirtyFlags|=4;break;case 8:this.appRef.deferredDirtyFlags|=8;break;case 6:case 14:this.appRef.dirtyFlags|=2,r=!0;break;case 13:this.appRef.dirtyFlags|=16,r=!0;break;case 12:r=!0;break;default:this.appRef.dirtyFlags|=8}if(this.appRef.tracingSnapshot=this.tracing?.snapshot(this.appRef.tracingSnapshot)??null,!this.shouldScheduleTick(r))return;const i=this.useMicrotaskScheduler?A2:D2;this.pendingRenderTaskId=this.taskService.add(),this.cancelScheduledCallback=this.scheduleInRootZone?Zone.root.run(()=>i(()=>this.tick())):this.ngZone.runOutsideAngular(()=>i(()=>this.tick()))}shouldScheduleTick(t){return!(this.disableScheduling&&!t||this.appRef.destroyed||null!==this.pendingRenderTaskId||this.runningTick||this.appRef._runningTick||!this.zonelessEnabled&&this.zoneIsDefined&&Zone.current.get(cv+this.angularZoneId))}tick(){if(this.runningTick||this.appRef.destroyed)return;if(0===this.appRef.dirtyFlags)return void this.cleanup();!this.zonelessEnabled&&7&this.appRef.dirtyFlags&&(this.appRef.dirtyFlags|=1);const t=this.taskService.add();try{this.ngZone.run(()=>{this.runningTick=!0,this.appRef._tick()},void 0,this.schedulerTickApplyArgs)}catch(r){throw this.taskService.remove(t),r}finally{this.cleanup()}this.useMicrotaskScheduler=!0,A2(()=>{this.useMicrotaskScheduler=!1,this.taskService.remove(t)})}ngOnDestroy(){this.subscriptions.unsubscribe(),this.cleanup()}cleanup(){if(this.runningTick=!1,this.cancelScheduledCallback?.(),this.cancelScheduledCallback=null,null!==this.pendingRenderTaskId){const t=this.pendingRenderTaskId;this.pendingRenderTaskId=null,this.taskService.remove(t)}}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const As=new B("",{providedIn:"root",factory:()=>b(As,Le.Optional|Le.SkipSelf)||function $fe(){return typeof $localize<"u"&&$localize.locale||ab}()}),pb=new B(""),Yfe=new B("");function lm(n){return!n.moduleRef}let Ba=null;function k$(){return!1}let Uo=(()=>class n{static __NG_ELEMENT_ID__=npe})();function npe(n){return function rpe(n,e,t){if(zi(n)&&!t){const r=kr(n.index,e);return new kp(r,r)}return 175&n.type?new kp(e[15],e):null}(Fe(),L(),!(16&~n))}function xpe(n){try{const{rootComponent:e,appProviders:t,platformProviders:r}=n,i=function tpe(n=[]){if(Ba)return Ba;const e=function R$(n=[],e){return ze.create({name:e,providers:[{provide:KC,useValue:"platform"},{provide:pb,useValue:new Set([()=>Ba=null])},...n]})}(n);return Ba=e,function fj(){!function Ote(n){GL=n}(()=>{throw new O(600,!1)})}(),function M$(n){const e=n.get(U0,null);yi(n,()=>{e?.forEach(t=>t())})}(e),e}(r),o=[sD({}),{provide:ws,useExisting:am},...t||[]];return function S$(n){const e=lm(n)?n.r3Injector:n.moduleRef.injector,t=e.get(ue);return t.run(()=>{lm(n)?n.r3Injector.resolveInjectorInitializers():n.moduleRef.resolveInjectorInitializers();const r=e.get(wi,null);let i;if(t.runOutsideAngular(()=>{i=t.onError.subscribe({next:o=>{r.handleError(o)}})}),lm(n)){const o=()=>e.destroy(),s=n.platformInjector.get(pb);s.add(o),e.onDestroy(()=>{i.unsubscribe(),s.delete(o)})}else{const o=()=>n.moduleRef.destroy(),s=n.platformInjector.get(pb);s.add(o),n.moduleRef.onDestroy(()=>{rb(n.allPlatformModules,n.moduleRef),i.unsubscribe(),s.delete(o)})}return function Zfe(n,e,t){try{const r=t();return Gp(r)?r.catch(i=>{throw e.runOutsideAngular(()=>n.handleError(i)),i}):r}catch(r){throw e.runOutsideAngular(()=>n.handleError(r)),r}}(r,t,()=>{const o=e.get(dj);return o.runInitializers(),o.donePromise.then(()=>{if(function Lde(n){"string"==typeof n&&(Zj=n.toLowerCase().replace(/_/g,"-"))}(e.get(As,ab)||ab),!e.get(Yfe,!0))return lm(n)?e.get(tr):(n.allPlatformModules.push(n.moduleRef),n.moduleRef);if(lm(n)){const l=e.get(tr);return void 0!==n.rootComponent&&l.bootstrap(n.rootComponent),l}return function Xfe(n,e){const t=n.injector.get(tr);if(n._bootstrapComponents.length>0)n._bootstrapComponents.forEach(r=>t.bootstrap(r));else{if(!n.instance.ngDoBootstrap)throw new O(-403,!1);n.instance.ngDoBootstrap(t)}e.push(n)}(n.moduleRef,n.allPlatformModules),n.moduleRef})})})}({r3Injector:new Bz({providers:o,parent:i,debugName:"",runEnvironmentInitializers:!1}).injector,platformInjector:i,rootComponent:e})}catch(e){return Promise.reject(e)}}function _t(n){return"boolean"==typeof n?n:null!=n&&"false"!==n}function $d(n,e=NaN){return isNaN(parseFloat(n))||isNaN(Number(n))?e:Number(n)}function xi(n,e){On("NgSignals");const t=WL(n);return e?.equal&&(t[In].equal=e.equal),t}function Wn(n){const e=Se(null);try{return n()}finally{Se(e)}}let _3=(()=>class n{view;node;constructor(t,r){this.view=t,this.node=r}static __NG_ELEMENT_ID__=Jpe})();function Jpe(){return new _3(L(),Fe())}class ome{[In];constructor(e){this[In]=e}destroy(){this[In].destroy()}}function pm(n,e){On("NgSignals"),!e?.injector&&va();const t=e?.injector??b(ze);let i,r=!0!==e?.manualCleanup?t.get(uo):null;const o=t.get(_3,null,{optional:!0}),s=t.get(ws);return null===o||e?.forceRoot?i=function cme(n,e,t){const r=Object.create(sme);return r.fn=n,r.scheduler=e,r.notifier=t,r.zone=typeof Zone<"u"?Zone.current:null,r.scheduler.schedule(r),r.notifier.notify(13),r}(n,t.get(RS),s):(i=function lme(n,e,t){const r=Object.create(ame);return r.view=n,r.zone=typeof Zone<"u"?Zone.current:null,r.notifier=e,r.fn=t,n[23]??=new Set,n[23].add(r),r.consumerMarkedDirty(r),r}(o.view,s,n),r instanceof x2&&r._lView===o.view&&(r=null)),i.injector=t,null!==r&&(i.onDestroyFn=r.onDestroy(()=>i.destroy())),new ome(i)}const y3={...$l,consumerIsAlwaysLive:!0,consumerAllowSignalWrites:!0,dirty:!0,hasRun:!1,cleanupFns:void 0,zone:null,kind:"effect",onDestroyFn:cp,run(){if(this.dirty=!1,this.hasRun&&!$f(this))return;this.hasRun=!0;const n=r=>(this.cleanupFns??=[]).push(r),e=ql(this),t=ev(!1);try{this.maybeCleanup(),this.fn(n)}finally{ev(t),Bu(this,e)}},maybeCleanup(){if(this.cleanupFns?.length)try{for(;this.cleanupFns.length;)this.cleanupFns.pop()()}finally{this.cleanupFns=[]}}},sme={...y3,consumerMarkedDirty(){this.scheduler.schedule(this),this.notifier.notify(13)},destroy(){qf(this),this.onDestroyFn(),this.maybeCleanup(),this.scheduler.remove(this)}},ame={...y3,consumerMarkedDirty(){this.view[2]|=8192,Jf(this.view),this.notifier.notify(14)},destroy(){qf(this),this.onDestroyFn(),this.maybeCleanup(),this.view[23]?.delete(this)}};function vD(n,e){const t=Me(n),r=e.elementInjector||Hy();return new jp(t).create(r,e.projectableNodes,e.hostElement,e.environmentInjector)}let b3=null;function Ua(){return b3}class yme{}const Xe=new B("");let w3=(()=>{class n{historyGo(t){throw new Error("")}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:()=>b(vme),providedIn:"platform"})}return n})(),vme=(()=>{class n extends w3{_location;_history;_doc=b(Xe);constructor(){super(),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Ua().getBaseHref(this._doc)}onPopState(t){const r=Ua().getGlobalEventTarget(this._doc,"window");return r.addEventListener("popstate",t,!1),()=>r.removeEventListener("popstate",t)}onHashChange(t){const r=Ua().getGlobalEventTarget(this._doc,"window");return r.addEventListener("hashchange",t,!1),()=>r.removeEventListener("hashchange",t)}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(t){this._location.pathname=t}pushState(t,r,i){this._history.pushState(t,r,i)}replaceState(t,r,i){this._history.replaceState(t,r,i)}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:()=>new n,providedIn:"platform"})}return n})();function E3(n,e){return n?e?n.endsWith("/")?e.startsWith("/")?n+e.slice(1):n+e:e.startsWith("/")?n+e:`${n}/${e}`:n:e}function I3(n){const e=n.search(/#|\?|$/);return"/"===n[e-1]?n.slice(0,e-1)+n.slice(e):n}function wc(n){return n&&"?"!==n[0]?`?${n}`:n}let Sb=(()=>{class n{historyGo(t){throw new Error("")}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:()=>b(wme),providedIn:"root"})}return n})();const bme=new B("");let wme=(()=>{class n extends Sb{_platformLocation;_baseHref;_removeListenerFns=[];constructor(t,r){super(),this._platformLocation=t,this._baseHref=r??this._platformLocation.getBaseHrefFromDOM()??b(Xe).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return E3(this._baseHref,t)}path(t=!1){const r=this._platformLocation.pathname+wc(this._platformLocation.search),i=this._platformLocation.hash;return i&&t?`${r}${i}`:r}pushState(t,r,i,o){const s=this.prepareExternalUrl(i+wc(o));this._platformLocation.pushState(t,r,s)}replaceState(t,r,i,o){const s=this.prepareExternalUrl(i+wc(o));this._platformLocation.replaceState(t,r,s)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(t=0){this._platformLocation.historyGo?.(t)}static \u0275fac=function(r){return new(r||n)(me(w3),me(bme,8))};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),qd=(()=>{class n{_subject=new fe;_basePath;_locationStrategy;_urlChangeListeners=[];_urlChangeSubscription=null;constructor(t){this._locationStrategy=t;const r=this._locationStrategy.getBaseHref();this._basePath=function Tme(n){if(new RegExp("^(https?:)?//").test(n)){const[,t]=n.split(/\/\/[^\/]+/);return t}return n}(I3(T3(r))),this._locationStrategy.onPopState(i=>{this._subject.next({url:this.path(!0),pop:!0,state:i.state,type:i.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(t=!1){return this.normalize(this._locationStrategy.path(t))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(t,r=""){return this.path()==this.normalize(t+wc(r))}normalize(t){return n.stripTrailingSlash(function Ime(n,e){if(!n||!e.startsWith(n))return e;const t=e.substring(n.length);return""===t||["/",";","?","#"].includes(t[0])?t:e}(this._basePath,T3(t)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._locationStrategy.prepareExternalUrl(t)}go(t,r="",i=null){this._locationStrategy.pushState(i,"",t,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+wc(r)),i)}replaceState(t,r="",i=null){this._locationStrategy.replaceState(i,"",t,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+wc(r)),i)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(t=0){this._locationStrategy.historyGo?.(t)}onUrlChange(t){return this._urlChangeListeners.push(t),this._urlChangeSubscription??=this.subscribe(r=>{this._notifyUrlChangeListeners(r.url,r.state)}),()=>{const r=this._urlChangeListeners.indexOf(t);this._urlChangeListeners.splice(r,1),0===this._urlChangeListeners.length&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(t="",r){this._urlChangeListeners.forEach(i=>i(t,r))}subscribe(t,r,i){return this._subject.subscribe({next:t,error:r??void 0,complete:i??void 0})}static normalizeQueryParams=wc;static joinWithSlash=E3;static stripTrailingSlash=I3;static \u0275fac=function(r){return new(r||n)(me(Sb))};static \u0275prov=G({token:n,factory:()=>function Eme(){return new qd(me(Sb))}(),providedIn:"root"})}return n})();function T3(n){return n.replace(/\/index.html$/,"")}const AD=/\s+/,N3=[];let RD=(()=>{class n{_ngEl;_renderer;initialClasses=N3;rawClass;stateMap=new Map;constructor(t,r){this._ngEl=t,this._renderer=r}set klass(t){this.initialClasses=null!=t?t.trim().split(AD):N3}set ngClass(t){this.rawClass="string"==typeof t?t.trim().split(AD):t}ngDoCheck(){for(const r of this.initialClasses)this._updateState(r,!0);const t=this.rawClass;if(Array.isArray(t)||t instanceof Set)for(const r of t)this._updateState(r,!0);else if(null!=t)for(const r of Object.keys(t))this._updateState(r,!!t[r]);this._applyStateDiff()}_updateState(t,r){const i=this.stateMap.get(t);void 0!==i?(i.enabled!==r&&(i.changed=!0,i.enabled=r),i.touched=!0):this.stateMap.set(t,{enabled:r,changed:!0,touched:!0})}_applyStateDiff(){for(const t of this.stateMap){const r=t[0],i=t[1];i.changed?(this._toggleClass(r,i.enabled),i.changed=!1):i.touched||(i.enabled&&this._toggleClass(r,!1),this.stateMap.delete(r)),i.touched=!1}}_toggleClass(t,r){(t=t.trim()).length>0&&t.split(AD).forEach(i=>{r?this._renderer.addClass(this._ngEl.nativeElement,i):this._renderer.removeClass(this._ngEl.nativeElement,i)})}static \u0275fac=function(r){return new(r||n)($(je),$(Ti))};static \u0275dir=ee({type:n,selectors:[["","ngClass",""]],inputs:{klass:[0,"class","klass"],ngClass:"ngClass"}})}return n})(),Bb=(()=>{class n{_viewContainer;_context=new hge;_thenTemplateRef=null;_elseTemplateRef=null;_thenViewRef=null;_elseViewRef=null;constructor(t,r){this._viewContainer=t,this._thenTemplateRef=r}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){F3("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){F3("ngIfElse",t),this._elseTemplateRef=t,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 ngIfUseIfTypeGuard;static ngTemplateGuard_ngIf;static ngTemplateContextGuard(t,r){return!0}static \u0275fac=function(r){return new(r||n)($(Ci),$(Oo))};static \u0275dir=ee({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}})}return n})();class hge{$implicit=null;ngIf=null}function F3(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${Mn(e)}'.`)}let ND=(()=>{class n{_viewContainerRef;_viewRef=null;ngTemplateOutletContext=null;ngTemplateOutlet=null;ngTemplateOutletInjector=null;constructor(t){this._viewContainerRef=t}ngOnChanges(t){if(this._shouldRecreateView(t)){const r=this._viewContainerRef;if(this._viewRef&&r.remove(r.indexOf(this._viewRef)),!this.ngTemplateOutlet)return void(this._viewRef=null);const i=this._createContextForwardProxy();this._viewRef=r.createEmbeddedView(this.ngTemplateOutlet,i,{injector:this.ngTemplateOutletInjector??void 0})}}_shouldRecreateView(t){return!!t.ngTemplateOutlet||!!t.ngTemplateOutletInjector}_createContextForwardProxy(){return new Proxy({},{set:(t,r,i)=>!!this.ngTemplateOutletContext&&Reflect.set(this.ngTemplateOutletContext,r,i),get:(t,r,i)=>{if(this.ngTemplateOutletContext)return Reflect.get(this.ngTemplateOutletContext,r,i)}})}static \u0275fac=function(r){return new(r||n)($(Ci))};static \u0275dir=ee({type:n,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet",ngTemplateOutletInjector:"ngTemplateOutletInjector"},features:[ei]})}return n})(),za=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({})}return n})();const B3="browser";function U3(n){return"server"===n}class g_e extends yme{supportsDOMEvents=!0}class BD extends g_e{static makeCurrent(){!function _me(n){b3??=n}(new BD)}onAndCancel(e,t,r,i){return e.addEventListener(t,r,i),()=>{e.removeEventListener(t,r,i)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){e.remove()}createElement(e,t){return(t=t||this.getDefaultDocument()).createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null}getBaseHref(e){const t=function __e(){return ym=ym||document.querySelector("base"),ym?ym.getAttribute("href"):null}();return null==t?null:function y_e(n){return new URL(n,document.baseURI).pathname}(t)}resetBaseElement(){ym=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return function lge(n,e){e=encodeURIComponent(e);for(const t of n.split(";")){const r=t.indexOf("="),[i,o]=-1==r?[t,""]:[t.slice(0,r),t.slice(r+1)];if(i.trim()===e)return decodeURIComponent(o)}return null}(document.cookie,e)}}let ym=null,b_e=(()=>{class n{build(){return new XMLHttpRequest}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac})}return n})();const UD=new B("");let X3=(()=>{class n{_zone;_plugins;_eventNameToPlugin=new Map;constructor(t,r){this._zone=r,t.forEach(i=>{i.manager=this}),this._plugins=t.slice().reverse()}addEventListener(t,r,i,o){return this._findPluginFor(r).addEventListener(t,r,i,o)}getZone(){return this._zone}_findPluginFor(t){let r=this._eventNameToPlugin.get(t);if(r)return r;if(r=this._plugins.find(o=>o.supports(t)),!r)throw new O(5101,!1);return this._eventNameToPlugin.set(t,r),r}static \u0275fac=function(r){return new(r||n)(me(UD),me(ue))};static \u0275prov=G({token:n,factory:n.\u0275fac})}return n})();class Z3{_doc;constructor(e){this._doc=e}manager}const Hb="ng-app-id";function J3(n){for(const e of n)e.remove()}function e4(n,e){const t=e.createElement("style");return t.textContent=n,t}function zD(n,e){const t=e.createElement("link");return t.setAttribute("rel","stylesheet"),t.setAttribute("href",n),t}let t4=(()=>{class n{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;isServer;constructor(t,r,i,o={}){this.doc=t,this.appId=r,this.nonce=i,this.isServer=U3(o),function w_e(n,e,t,r){const i=n.head?.querySelectorAll(`style[${Hb}="${e}"],link[${Hb}="${e}"]`);if(i)for(const o of i)o.removeAttribute(Hb),o instanceof HTMLLinkElement?r.set(o.href.slice(o.href.lastIndexOf("/")+1),{usage:0,elements:[o]}):o.textContent&&t.set(o.textContent,{usage:0,elements:[o]})}(t,r,this.inline,this.external),this.hosts.add(t.head)}addStyles(t,r){for(const i of t)this.addUsage(i,this.inline,e4);r?.forEach(i=>this.addUsage(i,this.external,zD))}removeStyles(t,r){for(const i of t)this.removeUsage(i,this.inline);r?.forEach(i=>this.removeUsage(i,this.external))}addUsage(t,r,i){const o=r.get(t);o?o.usage++:r.set(t,{usage:1,elements:[...this.hosts].map(s=>this.addElement(s,i(t,this.doc)))})}removeUsage(t,r){const i=r.get(t);i&&(i.usage--,i.usage<=0&&(J3(i.elements),r.delete(t)))}ngOnDestroy(){for(const[,{elements:t}]of[...this.inline,...this.external])J3(t);this.hosts.clear()}addHost(t){this.hosts.add(t);for(const[r,{elements:i}]of this.inline)i.push(this.addElement(t,e4(r,this.doc)));for(const[r,{elements:i}]of this.external)i.push(this.addElement(t,zD(r,this.doc)))}removeHost(t){this.hosts.delete(t)}addElement(t,r){return this.nonce&&r.setAttribute("nonce",this.nonce),this.isServer&&r.setAttribute(Hb,this.appId),t.appendChild(r)}static \u0275fac=function(r){return new(r||n)(me(Xe),me(Is),me(z0,8),me(Ia))};static \u0275prov=G({token:n,factory:n.\u0275fac})}return n})();const jD={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"},HD=/%COMP%/g,S_e=new B("",{providedIn:"root",factory:()=>!0});function r4(n,e){return e.map(t=>t.replace(HD,n))}let $D=(()=>{class n{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;platformId;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;platformIsServer;constructor(t,r,i,o,s,a,l,c=null,u=null){this.eventManager=t,this.sharedStylesHost=r,this.appId=i,this.removeStylesOnCompDestroy=o,this.doc=s,this.platformId=a,this.ngZone=l,this.nonce=c,this.tracingService=u,this.platformIsServer=U3(a),this.defaultRenderer=new qD(t,s,l,this.platformIsServer,this.tracingService)}createRenderer(t,r){if(!t||!r)return this.defaultRenderer;this.platformIsServer&&r.encapsulation===Wi.ShadowDom&&(r={...r,encapsulation:Wi.Emulated});const i=this.getOrCreateRenderer(t,r);return i instanceof s4?i.applyToHost(t):i instanceof WD&&i.applyStyles(),i}getOrCreateRenderer(t,r){const i=this.rendererByCompId;let o=i.get(r.id);if(!o){const s=this.doc,a=this.ngZone,l=this.eventManager,c=this.sharedStylesHost,u=this.removeStylesOnCompDestroy,d=this.platformIsServer,f=this.tracingService;switch(r.encapsulation){case Wi.Emulated:o=new s4(l,c,r,this.appId,u,s,a,d,f);break;case Wi.ShadowDom:return new M_e(l,c,t,r,s,a,this.nonce,d,f);default:o=new WD(l,c,r,u,s,a,d,f)}i.set(r.id,o)}return o}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(t){this.rendererByCompId.delete(t)}static \u0275fac=function(r){return new(r||n)(me(X3),me(t4),me(Is),me(S_e),me(Xe),me(Ia),me(ue),me(z0),me(ld,8))};static \u0275prov=G({token:n,factory:n.\u0275fac})}return n})();class qD{eventManager;doc;ngZone;platformIsServer;tracingService;data=Object.create(null);throwOnSyntheticProps=!0;constructor(e,t,r,i,o){this.eventManager=e,this.doc=t,this.ngZone=r,this.platformIsServer=i,this.tracingService=o}destroy(){}destroyNode=null;createElement(e,t){return t?this.doc.createElementNS(jD[t]||t,e):this.doc.createElement(e)}createComment(e){return this.doc.createComment(e)}createText(e){return this.doc.createTextNode(e)}appendChild(e,t){(o4(e)?e.content:e).appendChild(t)}insertBefore(e,t,r){e&&(o4(e)?e.content:e).insertBefore(t,r)}removeChild(e,t){t.remove()}selectRootElement(e,t){let r="string"==typeof e?this.doc.querySelector(e):e;if(!r)throw new O(-5104,!1);return t||(r.textContent=""),r}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,r,i){if(i){t=i+":"+t;const o=jD[i];o?e.setAttributeNS(o,t,r):e.setAttribute(t,r)}else e.setAttribute(t,r)}removeAttribute(e,t,r){if(r){const i=jD[r];i?e.removeAttributeNS(i,t):e.removeAttribute(`${r}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,r,i){i&(Sa.DashCase|Sa.Important)?e.style.setProperty(t,r,i&Sa.Important?"important":""):e.style[t]=r}removeStyle(e,t,r){r&Sa.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,r){null!=e&&(e[t]=r)}setValue(e,t){e.nodeValue=t}listen(e,t,r,i){if("string"==typeof e&&!(e=Ua().getGlobalEventTarget(this.doc,e)))throw new Error(`Unsupported event target ${e} for event ${t}`);let o=this.decoratePreventDefault(r);return null!==this.tracingService&&this.tracingService.wrapEventListener&&(o=this.tracingService.wrapEventListener(e,t,o)),this.eventManager.addEventListener(e,t,o,i)}decoratePreventDefault(e){return t=>{if("__ngUnwrap__"===t)return e;!1===(this.platformIsServer?this.ngZone.runGuarded(()=>e(t)):e(t))&&t.preventDefault()}}}function o4(n){return"TEMPLATE"===n.tagName&&void 0!==n.content}class M_e extends qD{sharedStylesHost;hostEl;shadowRoot;constructor(e,t,r,i,o,s,a,l,c){super(e,o,s,l,c),this.sharedStylesHost=t,this.hostEl=r,this.shadowRoot=r.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);let u=i.styles;u=r4(i.id,u);for(const f of u){const p=document.createElement("style");a&&p.setAttribute("nonce",a),p.textContent=f,this.shadowRoot.appendChild(p)}const d=i.getExternalStyles?.();if(d)for(const f of d){const p=zD(f,o);a&&p.setAttribute("nonce",a),this.shadowRoot.appendChild(p)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}appendChild(e,t){return super.appendChild(this.nodeOrShadowRoot(e),t)}insertBefore(e,t,r){return super.insertBefore(this.nodeOrShadowRoot(e),t,r)}removeChild(e,t){return super.removeChild(null,t)}parentNode(e){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(e)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}}class WD extends qD{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(e,t,r,i,o,s,a,l,c){super(e,o,s,a,l),this.sharedStylesHost=t,this.removeStylesOnCompDestroy=i;let u=r.styles;this.styles=c?r4(c,u):u,this.styleUrls=r.getExternalStyles?.(c)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}}class s4 extends WD{contentAttr;hostAttr;constructor(e,t,r,i,o,s,a,l,c){const u=i+"-"+r.id;super(e,t,r,o,s,a,l,c,u),this.contentAttr=function D_e(n){return"_ngcontent-%COMP%".replace(HD,n)}(u),this.hostAttr=function A_e(n){return"_nghost-%COMP%".replace(HD,n)}(u)}applyToHost(e){this.applyStyles(),this.setAttribute(e,this.hostAttr,"")}createElement(e,t){const r=super.createElement(e,t);return super.setAttribute(r,this.contentAttr,""),r}}const a4=["alt","control","meta","shift"],N_e={"\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"},P_e={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};function l4(n){return{appProviders:[...j_e,...n?.providers??[]],platformProviders:U_e}}const U_e=[{provide:Ia,useValue:B3},{provide:U0,useValue:function L_e(){BD.makeCurrent()},multi:!0},{provide:Xe,useFactory:function B_e(){return function bie(n){B0=n}(document),document},deps:[]}],j_e=[{provide:KC,useValue:"root"},{provide:wi,useFactory:function V_e(){return new wi},deps:[]},{provide:UD,useClass:(()=>{class n extends Z3{constructor(t){super(t)}supports(t){return!0}addEventListener(t,r,i,o){return t.addEventListener(r,i,o),()=>this.removeEventListener(t,r,i,o)}removeEventListener(t,r,i,o){return t.removeEventListener(r,i,o)}static \u0275fac=function(r){return new(r||n)(me(Xe))};static \u0275prov=G({token:n,factory:n.\u0275fac})}return n})(),multi:!0,deps:[Xe]},{provide:UD,useClass:(()=>{class n extends Z3{constructor(t){super(t)}supports(t){return null!=n.parseEventName(t)}addEventListener(t,r,i,o){const s=n.parseEventName(r),a=n.eventCallback(s.fullKey,i,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Ua().onAndCancel(t,s.domEventName,a,o))}static parseEventName(t){const r=t.toLowerCase().split("."),i=r.shift();if(0===r.length||"keydown"!==i&&"keyup"!==i)return null;const o=n._normalizeKey(r.pop());let s="",a=r.indexOf("code");if(a>-1&&(r.splice(a,1),s="code."),a4.forEach(c=>{const u=r.indexOf(c);u>-1&&(r.splice(u,1),s+=c+".")}),s+=o,0!=r.length||0===o.length)return null;const l={};return l.domEventName=i,l.fullKey=s,l}static matchEventFullKeyCode(t,r){let i=N_e[t.key]||t.key,o="";return r.indexOf("code.")>-1&&(i=t.code,o="code."),!(null==i||!i)&&(i=i.toLowerCase()," "===i?i="space":"."===i&&(i="dot"),a4.forEach(s=>{s!==i&&(0,P_e[s])(t)&&(o+=s+".")}),o+=i,o===r)}static eventCallback(t,r,i){return o=>{n.matchEventFullKeyCode(o,t)&&i.runGuarded(()=>r(o))}}static _normalizeKey(t){return"esc"===t?"escape":t}static \u0275fac=function(r){return new(r||n)(me(Xe))};static \u0275prov=G({token:n,factory:n.\u0275fac})}return n})(),multi:!0,deps:[Xe]},$D,t4,X3,{provide:Aa,useExisting:$D},{provide:class jge{},useClass:b_e,deps:[]},[]];let H_e=(()=>{class n{_doc;constructor(t){this._doc=t}getTitle(){return this._doc.title}setTitle(t){this._doc.title=t||""}static \u0275fac=function(r){return new(r||n)(me(Xe))};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),$b=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:function(r){let i=null;return i=r?new(r||n):me(G_e),i},providedIn:"root"})}return n})(),G_e=(()=>{class n extends $b{_doc;constructor(t){super(),this._doc=t}sanitize(t,r){if(null==r)return null;switch(t){case er.NONE:return r;case er.HTML:return No(r,"HTML")?Ei(r):GB(this._doc,String(r)).toString();case er.STYLE:return No(r,"Style")?Ei(r):r;case er.SCRIPT:if(No(r,"Script"))return Ei(r);throw new O(5200,!1);case er.URL:return No(r,"URL")?Ei(r):Av(String(r));case er.RESOURCE_URL:if(No(r,"ResourceURL"))return Ei(r);throw new O(5201,!1);default:throw new O(5202,!1)}}bypassSecurityTrustHtml(t){return function poe(n){return new loe(n)}(t)}bypassSecurityTrustStyle(t){return function moe(n){return new coe(n)}(t)}bypassSecurityTrustScript(t){return function goe(n){return new uoe(n)}(t)}bypassSecurityTrustUrl(t){return function _oe(n){return new doe(n)}(t)}bypassSecurityTrustResourceUrl(t){return function yoe(n){return new hoe(n)}(t)}static \u0275fac=function(r){return new(r||n)(me(Xe))};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function qb(n){return!!n&&(n instanceof vt||kt(n.lift)&&kt(n.subscribe))}function Wb(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(n);i=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(n),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(o){t[o]=n[o]&&function(s){return new Promise(function(a,l){!function i(o,s,a,l){Promise.resolve(l).then(function(c){o({value:c,done:a})},s)}(a,l,(s=n[o](s)).done,s.value)})}}}"function"==typeof SuppressedError&&SuppressedError;const m4=n=>n&&"number"==typeof n.length&&"function"!=typeof n;function g4(n){return kt(n?.then)}function _4(n){return kt(n[AC])}function y4(n){return Symbol.asyncIterator&&kt(n?.[Symbol.asyncIterator])}function v4(n){return new TypeError(`You provided ${null!==n&&"object"==typeof n?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}const b4=function vye(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}();function w4(n){return kt(n?.[b4])}function E4(n){return function f4(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,r=t.apply(n,e||[]),o=[];return i=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",function s(p){return function(m){return Promise.resolve(m).then(p,d)}}),i[Symbol.asyncIterator]=function(){return this},i;function a(p,m){r[p]&&(i[p]=function(_){return new Promise(function(v,E){o.push([p,_,v,E])>1||l(p,_)})},m&&(i[p]=m(i[p])))}function l(p,m){try{!function c(p){p.value instanceof Ha?Promise.resolve(p.value.v).then(u,d):f(o[0][2],p)}(r[p](m))}catch(_){f(o[0][3],_)}}function u(p){l("next",p)}function d(p){l("throw",p)}function f(p,m){p(m),o.shift(),o.length&&l(o[0][0],o[0][1])}}(this,arguments,function*(){const t=n.getReader();try{for(;;){const{value:r,done:i}=yield Ha(t.read());if(i)return yield Ha(void 0);yield yield Ha(r)}}finally{t.releaseLock()}})}function I4(n){return kt(n?.getReader)}function oi(n){if(n instanceof vt)return n;if(null!=n){if(_4(n))return function bye(n){return new vt(e=>{const t=n[AC]();if(kt(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(n);if(m4(n))return function wye(n){return new vt(e=>{for(let t=0;t{n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,eV)})}(n);if(y4(n))return T4(n);if(w4(n))return function Iye(n){return new vt(e=>{for(const t of n)if(e.next(t),e.closed)return;e.complete()})}(n);if(I4(n))return function Tye(n){return T4(E4(n))}(n)}throw v4(n)}function T4(n){return new vt(e=>{(function Cye(n,e){var t,r,i,o;return function d4(n,e,t,r){return new(t||(t=Promise))(function(o,s){function a(u){try{c(r.next(u))}catch(d){s(d)}}function l(u){try{c(r.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):function i(o){return o instanceof t?o:new t(function(s){s(o)})}(u.value).then(a,l)}c((r=r.apply(n,e||[])).next())})}(this,void 0,void 0,function*(){try{for(t=p4(n);!(r=yield t.next()).done;)if(e.next(r.value),e.closed)return}catch(s){i={error:s}}finally{try{r&&!r.done&&(o=t.return)&&(yield o.call(t))}finally{if(i)throw i.error}}e.complete()})})(n,e).catch(t=>e.error(t))})}function Ms(n,e,t,r=0,i=!1){const o=e.schedule(function(){t(),i?n.add(this.schedule(null,r)):this.unsubscribe()},r);if(n.add(o),!i)return o}function Gb(n,e=0){return Jt((t,r)=>{t.subscribe(zt(r,i=>Ms(r,n,()=>r.next(i),e),()=>Ms(r,n,()=>r.complete(),e),i=>Ms(r,n,()=>r.error(i),e)))})}function Kb(n,e=0){return Jt((t,r)=>{r.add(n.schedule(()=>t.subscribe(r),e))})}function C4(n,e){if(!n)throw new Error("Iterable cannot be null");return new vt(t=>{Ms(t,e,()=>{const r=n[Symbol.asyncIterator]();Ms(t,e,()=>{r.next().then(i=>{i.done?t.complete():t.next(i.value)})},0,!0)})})}function nr(n,e){return e?function Mye(n,e){if(null!=n){if(_4(n))return function xye(n,e){return oi(n).pipe(Kb(e),Gb(e))}(n,e);if(m4(n))return function Dye(n,e){return new vt(t=>{let r=0;return e.schedule(function(){r===n.length?t.complete():(t.next(n[r++]),t.closed||this.schedule())})})}(n,e);if(g4(n))return function Sye(n,e){return oi(n).pipe(Kb(e),Gb(e))}(n,e);if(y4(n))return C4(n,e);if(w4(n))return function Aye(n,e){return new vt(t=>{let r;return Ms(t,e,()=>{r=n[b4](),Ms(t,e,()=>{let i,o;try{({value:i,done:o}=r.next())}catch(s){return void t.error(s)}o?t.complete():t.next(i)},0,!0)}),()=>kt(r?.return)&&r.return()})}(n,e);if(I4(n))return function Rye(n,e){return C4(E4(n),e)}(n,e)}throw v4(n)}(n,e):oi(n)}function x4(n){return n&&kt(n.schedule)}function ZD(n){return n[n.length-1]}function S4(n){return kt(ZD(n))?n.pop():void 0}function bm(n){return x4(ZD(n))?n.pop():void 0}function de(...n){return nr(n,bm(n))}const Qb=EC(n=>function(){n(this),this.name="EmptyError",this.message="no elements in sequence"}),{isArray:Nye}=Array,{getPrototypeOf:Pye,prototype:Oye,keys:Fye}=Object;function D4(n){if(1===n.length){const e=n[0];if(Nye(e))return{args:e,keys:null};if(function Lye(n){return n&&"object"==typeof n&&Pye(n)===Oye}(e)){const t=Fye(e);return{args:t.map(r=>e[r]),keys:t}}}return{args:n,keys:null}}const{isArray:Vye}=Array;function A4(n){return Te(e=>function Bye(n,e){return Vye(e)?n(...e):n(e)}(n,e))}function R4(n,e){return n.reduce((t,r,i)=>(t[r]=e[i],t),{})}function JD(...n){const e=bm(n),t=S4(n),{args:r,keys:i}=D4(n);if(0===r.length)return nr([],e);const o=new vt(function Uye(n,e,t=ma){return r=>{M4(e,()=>{const{length:i}=n,o=new Array(i);let s=i,a=i;for(let l=0;l{const c=nr(n[l],e);let u=!1;c.subscribe(zt(r,d=>{o[l]=d,u||(u=!0,a--),a||r.next(t(o.slice()))},()=>{--s||r.complete()}))},r)},r)}}(r,e,i?s=>R4(i,s):ma));return t?o.pipe(A4(t)):o}function M4(n,e,t){n?Ms(t,n,e):e()}function Ur(n,e,t=1/0){return kt(e)?Ur((r,i)=>Te((o,s)=>e(r,o,i,s))(oi(n(r,i))),t):("number"==typeof e&&(t=e),Jt((r,i)=>function zye(n,e,t,r,i,o,s,a){const l=[];let c=0,u=0,d=!1;const f=()=>{d&&!l.length&&!c&&e.complete()},p=_=>c{o&&e.next(_),c++;let v=!1;oi(t(_,u++)).subscribe(zt(e,E=>{i?.(E),o?p(E):e.next(E)},()=>{v=!0},void 0,()=>{if(v)try{for(c--;l.length&&cm(E)):m(E)}f()}catch(E){e.error(E)}}))};return n.subscribe(zt(e,p,()=>{d=!0,f()})),()=>{a?.()}}(r,i,n,t)))}function Yb(n=1/0){return Ur(ma,n)}function Xb(...n){return function jye(){return Yb(1)}()(nr(n,bm(n)))}function k4(n){return new vt(e=>{oi(n()).subscribe(e)})}function wm(n,e){const t=kt(n)?n:()=>n,r=i=>i.error(t());return new vt(e?i=>e.schedule(r,0,i):r)}const Di=new vt(n=>n.complete());function eA(){return Jt((n,e)=>{let t=null;n._refCount++;const r=zt(e,void 0,void 0,void 0,()=>{if(!n||n._refCount<=0||0<--n._refCount)return void(t=null);const i=n._connection,o=t;t=null,i&&(!o||i===o)&&i.unsubscribe(),e.unsubscribe()});n.subscribe(r),r.closed||(t=n.connect())})}class N4 extends vt{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._subject=null,this._refCount=0,this._connection=null,iV(e)&&(this.lift=e.lift)}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){const e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;const{_connection:e}=this;this._subject=this._connection=null,e?.unsubscribe()}connect(){let e=this._connection;if(!e){e=this._connection=new Kt;const t=this.getSubject();e.add(this.source.subscribe(zt(t,void 0,()=>{this._teardown(),t.complete()},r=>{this._teardown(),t.error(r)},()=>this._teardown()))),e.closed&&(this._connection=null,e=Kt.EMPTY)}return e}refCount(){return eA()(this)}}function _o(n,e){return Jt((t,r)=>{let i=null,o=0,s=!1;const a=()=>s&&!i&&r.complete();t.subscribe(zt(r,l=>{i?.unsubscribe();let c=0;const u=o++;oi(n(l,u)).subscribe(i=zt(r,d=>r.next(e?e(l,d,u,c++):d),()=>{i=null,a()}))},()=>{s=!0,a()}))})}function zo(n){return n<=0?()=>Di:Jt((e,t)=>{let r=0;e.subscribe(zt(t,i=>{++r<=n&&(t.next(i),n<=r&&t.complete())}))})}function Ec(...n){const e=bm(n);return Jt((t,r)=>{(e?Xb(n,t,e):Xb(n,t)).subscribe(r)})}function si(n,e){return Jt((t,r)=>{let i=0;t.subscribe(zt(r,o=>n.call(e,o,i++)&&r.next(o)))})}function Zb(n){return Jt((e,t)=>{let r=!1;e.subscribe(zt(t,i=>{r=!0,t.next(i)},()=>{r||t.next(n),t.complete()}))})}function P4(n=$ye){return Jt((e,t)=>{let r=!1;e.subscribe(zt(t,i=>{r=!0,t.next(i)},()=>r?t.complete():t.error(n())))})}function $ye(){return new Qb}function Ic(n,e){const t=arguments.length>=2;return r=>r.pipe(n?si((i,o)=>n(i,o,r)):ma,zo(1),t?Zb(e):P4(()=>new Qb))}function Em(n,e){return kt(e)?Ur(n,e,1):Ur(n,1)}function Bn(n,e,t){const r=kt(n)||e||t?{next:n,error:e,complete:t}:n;return r?Jt((i,o)=>{var s;null===(s=r.subscribe)||void 0===s||s.call(r);let a=!0;i.subscribe(zt(o,l=>{var c;null===(c=r.next)||void 0===c||c.call(r,l),o.next(l)},()=>{var l;a=!1,null===(l=r.complete)||void 0===l||l.call(r),o.complete()},l=>{var c;a=!1,null===(c=r.error)||void 0===c||c.call(r,l),o.error(l)},()=>{var l,c;a&&(null===(l=r.unsubscribe)||void 0===l||l.call(r)),null===(c=r.finalize)||void 0===c||c.call(r)}))}):ma}function Tc(n){return Jt((e,t)=>{let o,r=null,i=!1;r=e.subscribe(zt(t,void 0,void 0,s=>{o=oi(n(s,Tc(n)(e))),r?(r.unsubscribe(),r=null,o.subscribe(t)):i=!0})),i&&(r.unsubscribe(),r=null,o.subscribe(t))})}function tA(n){return n<=0?()=>Di:Jt((e,t)=>{let r=[];e.subscribe(zt(t,i=>{r.push(i),n{for(const i of r)t.next(i);t.complete()},void 0,()=>{r=null}))})}function Jb(n){return Jt((e,t)=>{try{e.subscribe(t)}finally{t.add(n)}})}function At(n){return Jt((e,t)=>{oi(n).subscribe(zt(t,()=>t.complete(),TC)),!t.closed&&e.subscribe(t)})}const Ne="primary",Im=Symbol("RouteTitle");class Kye{params;constructor(e){this.params=e||{}}has(e){return Object.prototype.hasOwnProperty.call(this.params,e)}get(e){if(this.has(e)){const t=this.params[e];return Array.isArray(t)?t[0]:t}return null}getAll(e){if(this.has(e)){const t=this.params[e];return Array.isArray(t)?t:[t]}return[]}get keys(){return Object.keys(this.params)}}function Kd(n){return new Kye(n)}function Qye(n,e,t){const r=t.path.split("/");if(r.length>n.length||"full"===t.pathMatch&&(e.hasChildren()||r.lengthr[o]===i)}return n===e}function F4(n){return n.length>0?n[n.length-1]:null}function $a(n){return qb(n)?n:Gp(n)?nr(Promise.resolve(n)):de(n)}const Xye={exact:function B4(n,e,t){if(!xc(n.segments,e.segments)||!ew(n.segments,e.segments,t)||n.numberOfChildren!==e.numberOfChildren)return!1;for(const r in e.children)if(!n.children[r]||!B4(n.children[r],e.children[r],t))return!1;return!0},subset:U4},L4={exact:function Zye(n,e){return jo(n,e)},subset:function Jye(n,e){return Object.keys(e).length<=Object.keys(n).length&&Object.keys(e).every(t=>O4(n[t],e[t]))},ignored:()=>!0};function V4(n,e,t){return Xye[t.paths](n.root,e.root,t.matrixParams)&&L4[t.queryParams](n.queryParams,e.queryParams)&&!("exact"===t.fragment&&n.fragment!==e.fragment)}function U4(n,e,t){return z4(n,e,e.segments,t)}function z4(n,e,t,r){if(n.segments.length>t.length){const i=n.segments.slice(0,t.length);return!(!xc(i,t)||e.hasChildren()||!ew(i,t,r))}if(n.segments.length===t.length){if(!xc(n.segments,t)||!ew(n.segments,t,r))return!1;for(const i in e.children)if(!n.children[i]||!U4(n.children[i],e.children[i],r))return!1;return!0}{const i=t.slice(0,n.segments.length),o=t.slice(n.segments.length);return!!(xc(n.segments,i)&&ew(n.segments,i,r)&&n.children[Ne])&&z4(n.children[Ne],e,o,r)}}function ew(n,e,t){return e.every((r,i)=>L4[t](n[i].parameters,r.parameters))}class Cc{root;queryParams;fragment;_queryParamMap;constructor(e=new yt([],{}),t={},r=null){this.root=e,this.queryParams=t,this.fragment=r}get queryParamMap(){return this._queryParamMap??=Kd(this.queryParams),this._queryParamMap}toString(){return nve.serialize(this)}}class yt{segments;children;parent=null;constructor(e,t){this.segments=e,this.children=t,Object.values(t).forEach(r=>r.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return nw(this)}}class Tm{path;parameters;_parameterMap;constructor(e,t){this.path=e,this.parameters=t}get parameterMap(){return this._parameterMap??=Kd(this.parameters),this._parameterMap}toString(){return $4(this)}}function xc(n,e){return n.length===e.length&&n.every((t,r)=>t.path===e[r].path)}let Qd=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:()=>new tw,providedIn:"root"})}return n})();class tw{parse(e){const t=new fve(e);return new Cc(t.parseRootSegment(),t.parseQueryParams(),t.parseFragment())}serialize(e){const t=`/${Cm(e.root,!0)}`,r=function ove(n){const e=Object.entries(n).map(([t,r])=>Array.isArray(r)?r.map(i=>`${rw(t)}=${rw(i)}`).join("&"):`${rw(t)}=${rw(r)}`).filter(t=>t);return e.length?`?${e.join("&")}`:""}(e.queryParams);return`${t}${r}${"string"==typeof e.fragment?`#${function rve(n){return encodeURI(n)}(e.fragment)}`:""}`}}const nve=new tw;function nw(n){return n.segments.map(e=>$4(e)).join("/")}function Cm(n,e){if(!n.hasChildren())return nw(n);if(e){const t=n.children[Ne]?Cm(n.children[Ne],!1):"",r=[];return Object.entries(n.children).forEach(([i,o])=>{i!==Ne&&r.push(`${i}:${Cm(o,!1)}`)}),r.length>0?`${t}(${r.join("//")})`:t}{const t=function tve(n,e){let t=[];return Object.entries(n.children).forEach(([r,i])=>{r===Ne&&(t=t.concat(e(i,r)))}),Object.entries(n.children).forEach(([r,i])=>{r!==Ne&&(t=t.concat(e(i,r)))}),t}(n,(r,i)=>i===Ne?[Cm(n.children[Ne],!1)]:[`${i}:${Cm(r,!1)}`]);return 1===Object.keys(n.children).length&&null!=n.children[Ne]?`${nw(n)}/${t[0]}`:`${nw(n)}/(${t.join("//")})`}}function j4(n){return encodeURIComponent(n).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function rw(n){return j4(n).replace(/%3B/gi,";")}function rA(n){return j4(n).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function iw(n){return decodeURIComponent(n)}function H4(n){return iw(n.replace(/\+/g,"%20"))}function $4(n){return`${rA(n.path)}${function ive(n){return Object.entries(n).map(([e,t])=>`;${rA(e)}=${rA(t)}`).join("")}(n.parameters)}`}const sve=/^[^\/()?;#]+/;function iA(n){const e=n.match(sve);return e?e[0]:""}const ave=/^[^\/()?;=#]+/,cve=/^[^=?&#]+/,dve=/^[^&#]+/;class fve{url;remaining;constructor(e){this.url=e,this.remaining=e}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new yt([],{}):new yt([],this.parseChildren())}parseQueryParams(){const e={};if(this.consumeOptional("?"))do{this.parseQueryParam(e)}while(this.consumeOptional("&"));return e}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const e=[];for(this.peekStartsWith("(")||e.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),e.push(this.parseSegment());let t={};this.peekStartsWith("/(")&&(this.capture("/"),t=this.parseParens(!0));let r={};return this.peekStartsWith("(")&&(r=this.parseParens(!1)),(e.length>0||Object.keys(t).length>0)&&(r[Ne]=new yt(e,t)),r}parseSegment(){const e=iA(this.remaining);if(""===e&&this.peekStartsWith(";"))throw new O(4009,!1);return this.capture(e),new Tm(iw(e),this.parseMatrixParams())}parseMatrixParams(){const e={};for(;this.consumeOptional(";");)this.parseParam(e);return e}parseParam(e){const t=function lve(n){const e=n.match(ave);return e?e[0]:""}(this.remaining);if(!t)return;this.capture(t);let r="";if(this.consumeOptional("=")){const i=iA(this.remaining);i&&(r=i,this.capture(r))}e[iw(t)]=iw(r)}parseQueryParam(e){const t=function uve(n){const e=n.match(cve);return e?e[0]:""}(this.remaining);if(!t)return;this.capture(t);let r="";if(this.consumeOptional("=")){const s=function hve(n){const e=n.match(dve);return e?e[0]:""}(this.remaining);s&&(r=s,this.capture(r))}const i=H4(t),o=H4(r);if(e.hasOwnProperty(i)){let s=e[i];Array.isArray(s)||(s=[s],e[i]=s),s.push(o)}else e[i]=o}parseParens(e){const t={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const r=iA(this.remaining),i=this.remaining[r.length];if("/"!==i&&")"!==i&&";"!==i)throw new O(4010,!1);let o;r.indexOf(":")>-1?(o=r.slice(0,r.indexOf(":")),this.capture(o),this.capture(":")):e&&(o=Ne);const s=this.parseChildren();t[o]=1===Object.keys(s).length?s[Ne]:new yt([],s),this.consumeOptional("//")}return t}peekStartsWith(e){return this.remaining.startsWith(e)}consumeOptional(e){return!!this.peekStartsWith(e)&&(this.remaining=this.remaining.substring(e.length),!0)}capture(e){if(!this.consumeOptional(e))throw new O(4011,!1)}}function q4(n){return n.segments.length>0?new yt([],{[Ne]:n}):n}function W4(n){const e={};for(const[r,i]of Object.entries(n.children)){const o=W4(i);if(r===Ne&&0===o.segments.length&&o.hasChildren())for(const[s,a]of Object.entries(o.children))e[s]=a;else(o.segments.length>0||o.hasChildren())&&(e[r]=o)}return function pve(n){if(1===n.numberOfChildren&&n.children[Ne]){const e=n.children[Ne];return new yt(n.segments.concat(e.segments),e.children)}return n}(new yt(n.segments,e))}function Sc(n){return n instanceof Cc}function G4(n){let e;const i=q4(function t(o){const s={};for(const l of o.children){const c=t(l);s[l.outlet]=c}const a=new yt(o.url,s);return o===n&&(e=a),a}(n.root));return e??i}function K4(n,e,t,r){let i=n;for(;i.parent;)i=i.parent;if(0===e.length)return oA(i,i,i,t,r);const o=function gve(n){if("string"==typeof n[0]&&1===n.length&&"/"===n[0])return new Y4(!0,0,n);let e=0,t=!1;const r=n.reduce((i,o,s)=>{if("object"==typeof o&&null!=o){if(o.outlets){const a={};return Object.entries(o.outlets).forEach(([l,c])=>{a[l]="string"==typeof c?c.split("/"):c}),[...i,{outlets:a}]}if(o.segmentPath)return[...i,o.segmentPath]}return"string"!=typeof o?[...i,o]:0===s?(o.split("/").forEach((a,l)=>{0==l&&"."===a||(0==l&&""===a?t=!0:".."===a?e++:""!=a&&i.push(a))}),i):[...i,o]},[]);return new Y4(t,e,r)}(e);if(o.toRoot())return oA(i,i,new yt([],{}),t,r);const s=function _ve(n,e,t){if(n.isAbsolute)return new sw(e,!0,0);if(!t)return new sw(e,!1,NaN);if(null===t.parent)return new sw(t,!0,0);const r=ow(n.commands[0])?0:1;return function yve(n,e,t){let r=n,i=e,o=t;for(;o>i;){if(o-=i,r=r.parent,!r)throw new O(4005,!1);i=r.segments.length}return new sw(r,!1,i-o)}(t,t.segments.length-1+r,n.numberOfDoubleDots)}(o,i,n),a=s.processChildren?Sm(s.segmentGroup,s.index,o.commands):X4(s.segmentGroup,s.index,o.commands);return oA(i,s.segmentGroup,a,t,r)}function ow(n){return"object"==typeof n&&null!=n&&!n.outlets&&!n.segmentPath}function xm(n){return"object"==typeof n&&null!=n&&n.outlets}function oA(n,e,t,r,i){let s,o={};r&&Object.entries(r).forEach(([l,c])=>{o[l]=Array.isArray(c)?c.map(u=>`${u}`):`${c}`}),s=n===e?t:Q4(n,e,t);const a=q4(W4(s));return new Cc(a,o,i)}function Q4(n,e,t){const r={};return Object.entries(n.children).forEach(([i,o])=>{r[i]=o===e?t:Q4(o,e,t)}),new yt(n.segments,r)}class Y4{isAbsolute;numberOfDoubleDots;commands;constructor(e,t,r){if(this.isAbsolute=e,this.numberOfDoubleDots=t,this.commands=r,e&&r.length>0&&ow(r[0]))throw new O(4003,!1);const i=r.find(xm);if(i&&i!==F4(r))throw new O(4004,!1)}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class sw{segmentGroup;processChildren;index;constructor(e,t,r){this.segmentGroup=e,this.processChildren=t,this.index=r}}function X4(n,e,t){if(n??=new yt([],{}),0===n.segments.length&&n.hasChildren())return Sm(n,e,t);const r=function bve(n,e,t){let r=0,i=e;const o={match:!1,pathIndex:0,commandIndex:0};for(;i=t.length)return o;const s=n.segments[i],a=t[r];if(xm(a))break;const l=`${a}`,c=r0&&void 0===l)break;if(l&&c&&"object"==typeof c&&void 0===c.outlets){if(!J4(l,c,s))return o;r+=2}else{if(!J4(l,{},s))return o;r++}i++}return{match:!0,pathIndex:i,commandIndex:r}}(n,e,t),i=t.slice(r.commandIndex);if(r.match&&r.pathIndexo!==Ne)&&n.children[Ne]&&1===n.numberOfChildren&&0===n.children[Ne].segments.length){const o=Sm(n.children[Ne],e,t);return new yt(n.segments,o.children)}return Object.entries(r).forEach(([o,s])=>{"string"==typeof s&&(s=[s]),null!==s&&(i[o]=X4(n.children[o],e,s))}),Object.entries(n.children).forEach(([o,s])=>{void 0===r[o]&&(i[o]=s)}),new yt(n.segments,i)}}function sA(n,e,t){const r=n.segments.slice(0,e);let i=0;for(;i{"string"==typeof r&&(r=[r]),null!==r&&(e[t]=sA(new yt([],{}),0,r))}),e}function Z4(n){const e={};return Object.entries(n).forEach(([t,r])=>e[t]=`${r}`),e}function J4(n,e,t){return n==t.path&&jo(e,t.parameters)}const Dm="imperative";var Ze=function(n){return n[n.NavigationStart=0]="NavigationStart",n[n.NavigationEnd=1]="NavigationEnd",n[n.NavigationCancel=2]="NavigationCancel",n[n.NavigationError=3]="NavigationError",n[n.RoutesRecognized=4]="RoutesRecognized",n[n.ResolveStart=5]="ResolveStart",n[n.ResolveEnd=6]="ResolveEnd",n[n.GuardsCheckStart=7]="GuardsCheckStart",n[n.GuardsCheckEnd=8]="GuardsCheckEnd",n[n.RouteConfigLoadStart=9]="RouteConfigLoadStart",n[n.RouteConfigLoadEnd=10]="RouteConfigLoadEnd",n[n.ChildActivationStart=11]="ChildActivationStart",n[n.ChildActivationEnd=12]="ChildActivationEnd",n[n.ActivationStart=13]="ActivationStart",n[n.ActivationEnd=14]="ActivationEnd",n[n.Scroll=15]="Scroll",n[n.NavigationSkipped=16]="NavigationSkipped",n}(Ze||{});class Ho{id;url;constructor(e,t){this.id=e,this.url=t}}class aA extends Ho{type=Ze.NavigationStart;navigationTrigger;restoredState;constructor(e,t,r="imperative",i=null){super(e,t),this.navigationTrigger=r,this.restoredState=i}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class Dc extends Ho{urlAfterRedirects;type=Ze.NavigationEnd;constructor(e,t,r){super(e,t),this.urlAfterRedirects=r}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}var Ai=function(n){return n[n.Redirect=0]="Redirect",n[n.SupersededByNewNavigation=1]="SupersededByNewNavigation",n[n.NoDataFromResolver=2]="NoDataFromResolver",n[n.GuardRejected=3]="GuardRejected",n}(Ai||{}),lA=function(n){return n[n.IgnoredSameUrlNavigation=0]="IgnoredSameUrlNavigation",n[n.IgnoredByUrlHandlingStrategy=1]="IgnoredByUrlHandlingStrategy",n}(lA||{});class Ac extends Ho{reason;code;type=Ze.NavigationCancel;constructor(e,t,r,i){super(e,t),this.reason=r,this.code=i}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class Am extends Ho{reason;code;type=Ze.NavigationSkipped;constructor(e,t,r,i){super(e,t),this.reason=r,this.code=i}}class cA extends Ho{error;target;type=Ze.NavigationError;constructor(e,t,r,i){super(e,t),this.error=r,this.target=i}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class eq extends Ho{urlAfterRedirects;state;type=Ze.RoutesRecognized;constructor(e,t,r,i){super(e,t),this.urlAfterRedirects=r,this.state=i}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Eve extends Ho{urlAfterRedirects;state;type=Ze.GuardsCheckStart;constructor(e,t,r,i){super(e,t),this.urlAfterRedirects=r,this.state=i}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Ive extends Ho{urlAfterRedirects;state;shouldActivate;type=Ze.GuardsCheckEnd;constructor(e,t,r,i,o){super(e,t),this.urlAfterRedirects=r,this.state=i,this.shouldActivate=o}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class Tve extends Ho{urlAfterRedirects;state;type=Ze.ResolveStart;constructor(e,t,r,i){super(e,t),this.urlAfterRedirects=r,this.state=i}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Cve extends Ho{urlAfterRedirects;state;type=Ze.ResolveEnd;constructor(e,t,r,i){super(e,t),this.urlAfterRedirects=r,this.state=i}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class xve{route;type=Ze.RouteConfigLoadStart;constructor(e){this.route=e}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class Sve{route;type=Ze.RouteConfigLoadEnd;constructor(e){this.route=e}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class Dve{snapshot;type=Ze.ChildActivationStart;constructor(e){this.snapshot=e}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Ave{snapshot;type=Ze.ChildActivationEnd;constructor(e){this.snapshot=e}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Rve{snapshot;type=Ze.ActivationStart;constructor(e){this.snapshot=e}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Mve{snapshot;type=Ze.ActivationEnd;constructor(e){this.snapshot=e}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class uA{}class aw{url;navigationBehaviorOptions;constructor(e,t){this.url=e,this.navigationBehaviorOptions=t}}function yo(n){return n.outlet||Ne}function Rm(n){if(!n)return null;if(n.routeConfig?._injector)return n.routeConfig._injector;for(let e=n.parent;e;e=e.parent){const t=e.routeConfig;if(t?._loadedInjector)return t._loadedInjector;if(t?._injector)return t._injector}return null}class Lve{rootInjector;outlet=null;route=null;children;attachRef=null;get injector(){return Rm(this.route?.snapshot)??this.rootInjector}constructor(e){this.rootInjector=e,this.children=new Mm(this.rootInjector)}}let Mm=(()=>{class n{rootInjector;contexts=new Map;constructor(t){this.rootInjector=t}onChildOutletCreated(t,r){const i=this.getOrCreateContext(t);i.outlet=r,this.contexts.set(t,i)}onChildOutletDestroyed(t){const r=this.getContext(t);r&&(r.outlet=null,r.attachRef=null)}onOutletDeactivated(){const t=this.contexts;return this.contexts=new Map,t}onOutletReAttached(t){this.contexts=t}getOrCreateContext(t){let r=this.getContext(t);return r||(r=new Lve(this.rootInjector),this.contexts.set(t,r)),r}getContext(t){return this.contexts.get(t)||null}static \u0275fac=function(r){return new(r||n)(me(mr))};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();class tq{_root;constructor(e){this._root=e}get root(){return this._root.value}parent(e){const t=this.pathFromRoot(e);return t.length>1?t[t.length-2]:null}children(e){const t=dA(e,this._root);return t?t.children.map(r=>r.value):[]}firstChild(e){const t=dA(e,this._root);return t&&t.children.length>0?t.children[0].value:null}siblings(e){const t=hA(e,this._root);return t.length<2?[]:t[t.length-2].children.map(i=>i.value).filter(i=>i!==e)}pathFromRoot(e){return hA(e,this._root).map(t=>t.value)}}function dA(n,e){if(n===e.value)return e;for(const t of e.children){const r=dA(n,t);if(r)return r}return null}function hA(n,e){if(n===e.value)return[e];for(const t of e.children){const r=hA(n,t);if(r.length)return r.unshift(e),r}return[]}class vo{value;children;constructor(e,t){this.value=e,this.children=t}toString(){return`TreeNode(${this.value})`}}function Yd(n){const e={};return n&&n.children.forEach(t=>e[t.value.outlet]=t),e}class nq extends tq{snapshot;constructor(e,t){super(e),this.snapshot=t,fA(this,e)}toString(){return this.snapshot.toString()}}function rq(n){const e=function Vve(n){const o=new cw([],{},{},"",{},Ne,n,null,{});return new iq("",new vo(o,[]))}(n),t=new mi([new Tm("",{})]),r=new mi({}),i=new mi({}),o=new mi({}),s=new mi(""),a=new Xd(t,r,o,s,i,Ne,n,e.root);return a.snapshot=e.root,new nq(new vo(a,[]),e)}class Xd{urlSubject;paramsSubject;queryParamsSubject;fragmentSubject;dataSubject;outlet;component;snapshot;_futureSnapshot;_routerState;_paramMap;_queryParamMap;title;url;params;queryParams;fragment;data;constructor(e,t,r,i,o,s,a,l){this.urlSubject=e,this.paramsSubject=t,this.queryParamsSubject=r,this.fragmentSubject=i,this.dataSubject=o,this.outlet=s,this.component=a,this._futureSnapshot=l,this.title=this.dataSubject?.pipe(Te(c=>c[Im]))??de(void 0),this.url=e,this.params=t,this.queryParams=r,this.fragment=i,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(Te(e=>Kd(e))),this._paramMap}get queryParamMap(){return this._queryParamMap??=this.queryParams.pipe(Te(e=>Kd(e))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function lw(n,e,t="emptyOnly"){let r;const{routeConfig:i}=n;return r=null===e||"always"!==t&&""!==i?.path&&(e.component||e.routeConfig?.loadComponent)?{params:{...n.params},data:{...n.data},resolve:{...n.data,...n._resolvedData??{}}}:{params:{...e.params,...n.params},data:{...e.data,...n.data},resolve:{...n.data,...e.data,...i?.data,...n._resolvedData}},i&&sq(i)&&(r.resolve[Im]=i.title),r}class cw{url;params;queryParams;fragment;data;outlet;component;routeConfig;_resolve;_resolvedData;_routerState;_paramMap;_queryParamMap;get title(){return this.data?.[Im]}constructor(e,t,r,i,o,s,a,l,c){this.url=e,this.params=t,this.queryParams=r,this.fragment=i,this.data=o,this.outlet=s,this.component=a,this.routeConfig=l,this._resolve=c}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??=Kd(this.params),this._paramMap}get queryParamMap(){return this._queryParamMap??=Kd(this.queryParams),this._queryParamMap}toString(){return`Route(url:'${this.url.map(r=>r.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class iq extends tq{url;constructor(e,t){super(t),this.url=e,fA(this,t)}toString(){return oq(this._root)}}function fA(n,e){e.value._routerState=n,e.children.forEach(t=>fA(n,t))}function oq(n){const e=n.children.length>0?` { ${n.children.map(oq).join(", ")} } `:"";return`${n.value}${e}`}function pA(n){if(n.snapshot){const e=n.snapshot,t=n._futureSnapshot;n.snapshot=t,jo(e.queryParams,t.queryParams)||n.queryParamsSubject.next(t.queryParams),e.fragment!==t.fragment&&n.fragmentSubject.next(t.fragment),jo(e.params,t.params)||n.paramsSubject.next(t.params),function Yye(n,e){if(n.length!==e.length)return!1;for(let t=0;tjo(t.parameters,e[r].parameters))}(n.url,e.url);return t&&!(!n.parent!=!e.parent)&&(!n.parent||mA(n.parent,e.parent))}function sq(n){return"string"==typeof n.title||null===n.title}const Bve=new B("");let gA=(()=>{class n{activated=null;get activatedComponentRef(){return this.activated}_activatedRoute=null;name=Ne;activateEvents=new nt;deactivateEvents=new nt;attachEvents=new nt;detachEvents=new nt;routerOutletData=Xre(void 0);parentContexts=b(Mm);location=b(Ci);changeDetector=b(Uo);inputBinder=b(uw,{optional:!0});supportsBindingToComponentInputs=!0;ngOnChanges(t){if(t.name){const{firstChange:r,previousValue:i}=t.name;if(r)return;this.isTrackedInParentContexts(i)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(i)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(t){return this.parentContexts.getContext(t)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;const t=this.parentContexts.getContext(this.name);t?.route&&(t.attachRef?this.attach(t.attachRef,t.route):this.activateWith(t.route,t.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new O(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new O(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new O(4012,!1);this.location.detach();const t=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(t.instance),t}attach(t,r){this.activated=t,this._activatedRoute=r,this.location.insert(t.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(t.instance)}deactivate(){if(this.activated){const t=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(t)}}activateWith(t,r){if(this.isActivated)throw new O(4013,!1);this._activatedRoute=t;const i=this.location,s=t.snapshot.component,a=this.parentContexts.getOrCreateContext(this.name).children,l=new _A(t,a,i.injector,this.routerOutletData);this.activated=i.createComponent(s,{index:i.length,injector:l,environmentInjector:r}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["router-outlet"]],inputs:{name:"name",routerOutletData:[1,"routerOutletData"]},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],features:[ei]})}return n})();class _A{route;childContexts;parent;outletData;__ngOutletInjector(e){return new _A(this.route,this.childContexts,e,this.outletData)}constructor(e,t,r,i){this.route=e,this.childContexts=t,this.parent=r,this.outletData=i}get(e,t){return e===Xd?this.route:e===Mm?this.childContexts:e===Bve?this.outletData:this.parent.get(e,t)}}const uw=new B("");function km(n,e,t){if(t&&n.shouldReuseRoute(e.value,t.value.snapshot)){const r=t.value;r._futureSnapshot=e.value;const i=function zve(n,e,t){return e.children.map(r=>{for(const i of t.children)if(n.shouldReuseRoute(r.value,i.value.snapshot))return km(n,r,i);return km(n,r)})}(n,e,t);return new vo(r,i)}{if(n.shouldAttach(e.value)){const o=n.retrieve(e.value);if(null!==o){const s=o.route;return s.value._futureSnapshot=e.value,s.children=e.children.map(a=>km(n,a)),s}}const r=function jve(n){return new Xd(new mi(n.url),new mi(n.params),new mi(n.queryParams),new mi(n.fragment),new mi(n.data),n.outlet,n.component,n)}(e.value),i=e.children.map(o=>km(n,o));return new vo(r,i)}}class yA{redirectTo;navigationBehaviorOptions;constructor(e,t){this.redirectTo=e,this.navigationBehaviorOptions=t}}const lq="ngNavigationCancelingError";function dw(n,e){const{redirectTo:t,navigationBehaviorOptions:r}=Sc(e)?{redirectTo:e,navigationBehaviorOptions:void 0}:e,i=cq(!1,Ai.Redirect);return i.url=t,i.navigationBehaviorOptions=r,i}function cq(n,e){const t=new Error(`NavigationCancelingError: ${n||""}`);return t[lq]=!0,t.cancellationCode=e,t}function uq(n){return!!n&&n[lq]}class qve{routeReuseStrategy;futureState;currState;forwardEvent;inputBindingEnabled;constructor(e,t,r,i,o){this.routeReuseStrategy=e,this.futureState=t,this.currState=r,this.forwardEvent=i,this.inputBindingEnabled=o}activate(e){const t=this.futureState._root,r=this.currState?this.currState._root:null;this.deactivateChildRoutes(t,r,e),pA(this.futureState.root),this.activateChildRoutes(t,r,e)}deactivateChildRoutes(e,t,r){const i=Yd(t);e.children.forEach(o=>{const s=o.value.outlet;this.deactivateRoutes(o,i[s],r),delete i[s]}),Object.values(i).forEach(o=>{this.deactivateRouteAndItsChildren(o,r)})}deactivateRoutes(e,t,r){const i=e.value,o=t?t.value:null;if(i===o)if(i.component){const s=r.getContext(i.outlet);s&&this.deactivateChildRoutes(e,t,s.children)}else this.deactivateChildRoutes(e,t,r);else o&&this.deactivateRouteAndItsChildren(t,r)}deactivateRouteAndItsChildren(e,t){e.value.component&&this.routeReuseStrategy.shouldDetach(e.value.snapshot)?this.detachAndStoreRouteSubtree(e,t):this.deactivateRouteAndOutlet(e,t)}detachAndStoreRouteSubtree(e,t){const r=t.getContext(e.value.outlet),i=r&&e.value.component?r.children:t,o=Yd(e);for(const s of Object.values(o))this.deactivateRouteAndItsChildren(s,i);if(r&&r.outlet){const s=r.outlet.detach(),a=r.children.onOutletDeactivated();this.routeReuseStrategy.store(e.value.snapshot,{componentRef:s,route:e,contexts:a})}}deactivateRouteAndOutlet(e,t){const r=t.getContext(e.value.outlet),i=r&&e.value.component?r.children:t,o=Yd(e);for(const s of Object.values(o))this.deactivateRouteAndItsChildren(s,i);r&&(r.outlet&&(r.outlet.deactivate(),r.children.onOutletDeactivated()),r.attachRef=null,r.route=null)}activateChildRoutes(e,t,r){const i=Yd(t);e.children.forEach(o=>{this.activateRoutes(o,i[o.value.outlet],r),this.forwardEvent(new Mve(o.value.snapshot))}),e.children.length&&this.forwardEvent(new Ave(e.value.snapshot))}activateRoutes(e,t,r){const i=e.value,o=t?t.value:null;if(pA(i),i===o)if(i.component){const s=r.getOrCreateContext(i.outlet);this.activateChildRoutes(e,t,s.children)}else this.activateChildRoutes(e,t,r);else if(i.component){const s=r.getOrCreateContext(i.outlet);if(this.routeReuseStrategy.shouldAttach(i.snapshot)){const a=this.routeReuseStrategy.retrieve(i.snapshot);this.routeReuseStrategy.store(i.snapshot,null),s.children.onOutletReAttached(a.contexts),s.attachRef=a.componentRef,s.route=a.route.value,s.outlet&&s.outlet.attach(a.componentRef,a.route.value),pA(a.route.value),this.activateChildRoutes(e,null,s.children)}else s.attachRef=null,s.route=i,s.outlet&&s.outlet.activateWith(i,s.injector),this.activateChildRoutes(e,null,s.children)}else this.activateChildRoutes(e,null,r)}}class dq{path;route;constructor(e){this.path=e,this.route=this.path[this.path.length-1]}}class hw{component;route;constructor(e,t){this.component=e,this.route=t}}function Wve(n,e,t){const r=n._root;return Nm(r,e?e._root:null,t,[r.value])}function Zd(n,e){const t=Symbol(),r=e.get(n,t);return r===t?"function"!=typeof n||function ane(n){return null!==Ry(n)}(n)?e.get(n):n:r}function Nm(n,e,t,r,i={canDeactivateChecks:[],canActivateChecks:[]}){const o=Yd(e);return n.children.forEach(s=>{(function Kve(n,e,t,r,i={canDeactivateChecks:[],canActivateChecks:[]}){const o=n.value,s=e?e.value:null,a=t?t.getContext(n.value.outlet):null;if(s&&o.routeConfig===s.routeConfig){const l=function Qve(n,e,t){if("function"==typeof t)return t(n,e);switch(t){case"pathParamsChange":return!xc(n.url,e.url);case"pathParamsOrQueryParamsChange":return!xc(n.url,e.url)||!jo(n.queryParams,e.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!mA(n,e)||!jo(n.queryParams,e.queryParams);default:return!mA(n,e)}}(s,o,o.routeConfig.runGuardsAndResolvers);l?i.canActivateChecks.push(new dq(r)):(o.data=s.data,o._resolvedData=s._resolvedData),Nm(n,e,o.component?a?a.children:null:t,r,i),l&&a&&a.outlet&&a.outlet.isActivated&&i.canDeactivateChecks.push(new hw(a.outlet.component,s))}else s&&Pm(e,a,i),i.canActivateChecks.push(new dq(r)),Nm(n,null,o.component?a?a.children:null:t,r,i)})(s,o[s.value.outlet],t,r.concat([s.value]),i),delete o[s.value.outlet]}),Object.entries(o).forEach(([s,a])=>Pm(a,t.getContext(s),i)),i}function Pm(n,e,t){const r=Yd(n),i=n.value;Object.entries(r).forEach(([o,s])=>{Pm(s,i.component?e?e.children.getContext(o):null:e,t)}),t.canDeactivateChecks.push(new hw(i.component&&e&&e.outlet&&e.outlet.isActivated?e.outlet.component:null,i))}function Om(n){return"function"==typeof n}function hq(n){return n instanceof Qb||"EmptyError"===n?.name}const fw=Symbol("INITIAL_VALUE");function Jd(){return _o(n=>JD(n.map(e=>e.pipe(zo(1),Ec(fw)))).pipe(Te(e=>{for(const t of e)if(!0!==t){if(t===fw)return fw;if(!1===t||nbe(t))return t}return!0}),si(e=>e!==fw),zo(1)))}function nbe(n){return Sc(n)||n instanceof yA}function fq(n){return function Xte(...n){return tV(n)}(Bn(e=>{if("boolean"!=typeof e)throw dw(0,e)}),Te(e=>!0===e))}class vA{segmentGroup;constructor(e){this.segmentGroup=e||null}}class pw extends Error{urlTree;constructor(e){super(),this.urlTree=e}}function eh(n){return wm(new vA(n))}class mbe{urlSerializer;urlTree;constructor(e,t){this.urlSerializer=e,this.urlTree=t}lineralizeSegments(e,t){let r=[],i=t.root;for(;;){if(r=r.concat(i.segments),0===i.numberOfChildren)return de(r);if(i.numberOfChildren>1||!i.children[Ne])return wm(new O(4e3,!1));i=i.children[Ne]}}applyRedirectCommands(e,t,r,i,o){if("string"!=typeof t){const a=t,{queryParams:l,fragment:c,routeConfig:u,url:d,outlet:f,params:p,data:m,title:_}=i,v=yi(o,()=>a({params:p,data:m,queryParams:l,fragment:c,routeConfig:u,url:d,outlet:f,title:_}));if(v instanceof Cc)throw new pw(v);t=v}const s=this.applyRedirectCreateUrlTree(t,this.urlSerializer.parse(t),e,r);if("/"===t[0])throw new pw(s);return s}applyRedirectCreateUrlTree(e,t,r,i){const o=this.createSegmentGroup(e,t.root,r,i);return new Cc(o,this.createQueryParams(t.queryParams,this.urlTree.queryParams),t.fragment)}createQueryParams(e,t){const r={};return Object.entries(e).forEach(([i,o])=>{if("string"==typeof o&&":"===o[0]){const a=o.substring(1);r[i]=t[a]}else r[i]=o}),r}createSegmentGroup(e,t,r,i){const o=this.createSegments(e,t.segments,r,i);let s={};return Object.entries(t.children).forEach(([a,l])=>{s[a]=this.createSegmentGroup(e,l,r,i)}),new yt(o,s)}createSegments(e,t,r,i){return t.map(o=>":"===o.path[0]?this.findPosParam(e,o,i):this.findOrReturn(o,r))}findPosParam(e,t,r){const i=r[t.path.substring(1)];if(!i)throw new O(4001,!1);return i}findOrReturn(e,t){let r=0;for(const i of t){if(i.path===e.path)return t.splice(r),i;r++}return e}}const bA={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function gbe(n,e,t,r,i){const o=pq(n,e,t);return o.matched?(r=function kve(n,e){return n.providers&&!n._injector&&(n._injector=yS(n.providers,e,`Route: ${n.path}`)),n._injector??e}(e,r),function hbe(n,e,t,r){const i=e.canMatch;return i&&0!==i.length?de(i.map(s=>{const a=Zd(s,n);return $a(function tbe(n){return n&&Om(n.canMatch)}(a)?a.canMatch(e,t):yi(n,()=>a(e,t)))})).pipe(Jd(),fq()):de(!0)}(r,e,t).pipe(Te(s=>!0===s?o:{...bA}))):de(o)}function pq(n,e,t){if("**"===e.path)return function _be(n){return{matched:!0,parameters:n.length>0?F4(n).parameters:{},consumedSegments:n,remainingSegments:[],positionalParamSegments:{}}}(t);if(""===e.path)return"full"===e.pathMatch&&(n.hasChildren()||t.length>0)?{...bA}:{matched:!0,consumedSegments:[],remainingSegments:t,parameters:{},positionalParamSegments:{}};const i=(e.matcher||Qye)(t,n,e);if(!i)return{...bA};const o={};Object.entries(i.posParams??{}).forEach(([a,l])=>{o[a]=l.path});const s=i.consumed.length>0?{...o,...i.consumed[i.consumed.length-1].parameters}:o;return{matched:!0,consumedSegments:i.consumed,remainingSegments:t.slice(i.consumed.length),parameters:s,positionalParamSegments:i.posParams??{}}}function mq(n,e,t,r){return t.length>0&&function bbe(n,e,t){return t.some(r=>mw(n,e,r)&&yo(r)!==Ne)}(n,t,r)?{segmentGroup:new yt(e,vbe(r,new yt(t,n.children))),slicedSegments:[]}:0===t.length&&function wbe(n,e,t){return t.some(r=>mw(n,e,r))}(n,t,r)?{segmentGroup:new yt(n.segments,ybe(n,t,r,n.children)),slicedSegments:t}:{segmentGroup:new yt(n.segments,n.children),slicedSegments:t}}function ybe(n,e,t,r){const i={};for(const o of t)if(mw(n,e,o)&&!r[yo(o)]){const s=new yt([],{});i[yo(o)]=s}return{...r,...i}}function vbe(n,e){const t={};t[Ne]=e;for(const r of n)if(""===r.path&&yo(r)!==Ne){const i=new yt([],{});t[yo(r)]=i}return t}function mw(n,e,t){return(!(n.hasChildren()||e.length>0)||"full"!==t.pathMatch)&&""===t.path}class Ibe{}class xbe{injector;configLoader;rootComponentType;config;urlTree;paramsInheritanceStrategy;urlSerializer;applyRedirects;absoluteRedirectCount=0;allowRedirects=!0;constructor(e,t,r,i,o,s,a){this.injector=e,this.configLoader=t,this.rootComponentType=r,this.config=i,this.urlTree=o,this.paramsInheritanceStrategy=s,this.urlSerializer=a,this.applyRedirects=new mbe(this.urlSerializer,this.urlTree)}noMatchError(e){return new O(4002,`'${e.segmentGroup}'`)}recognize(){const e=mq(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(e).pipe(Te(({children:t,rootSnapshot:r})=>{const i=new vo(r,t),o=new iq("",i),s=function mve(n,e,t=null,r=null){return K4(G4(n),e,t,r)}(r,[],this.urlTree.queryParams,this.urlTree.fragment);return s.queryParams=this.urlTree.queryParams,o.url=this.urlSerializer.serialize(s),{state:o,tree:s}}))}match(e){const t=new cw([],Object.freeze({}),Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,Object.freeze({}),Ne,this.rootComponentType,null,{});return this.processSegmentGroup(this.injector,this.config,e,Ne,t).pipe(Te(r=>({children:r,rootSnapshot:t})),Tc(r=>{if(r instanceof pw)return this.urlTree=r.urlTree,this.match(r.urlTree.root);throw r instanceof vA?this.noMatchError(r):r}))}processSegmentGroup(e,t,r,i,o){return 0===r.segments.length&&r.hasChildren()?this.processChildren(e,t,r,o):this.processSegment(e,t,r,r.segments,i,!0,o).pipe(Te(s=>s instanceof vo?[s]:[]))}processChildren(e,t,r,i){const o=[];for(const s of Object.keys(r.children))"primary"===s?o.unshift(s):o.push(s);return nr(o).pipe(Em(s=>{const a=r.children[s],l=function Fve(n,e){const t=n.filter(r=>yo(r)===e);return t.push(...n.filter(r=>yo(r)!==e)),t}(t,s);return this.processSegmentGroup(e,l,a,s,i)}),function Wye(n,e){return Jt(function qye(n,e,t,r,i){return(o,s)=>{let a=t,l=e,c=0;o.subscribe(zt(s,u=>{const d=c++;l=a?n(l,u,d):(a=!0,u),r&&s.next(l)},i&&(()=>{a&&s.next(l),s.complete()})))}}(n,e,arguments.length>=2,!0))}((s,a)=>(s.push(...a),s)),Zb(null),function Gye(n,e){const t=arguments.length>=2;return r=>r.pipe(n?si((i,o)=>n(i,o,r)):ma,tA(1),t?Zb(e):P4(()=>new Qb))}(),Ur(s=>{if(null===s)return eh(r);const a=gq(s);return function Sbe(n){n.sort((e,t)=>e.value.outlet===Ne?-1:t.value.outlet===Ne?1:e.value.outlet.localeCompare(t.value.outlet))}(a),de(a)}))}processSegment(e,t,r,i,o,s,a){return nr(t).pipe(Em(l=>this.processSegmentAgainstRoute(l._injector??e,t,l,r,i,o,s,a).pipe(Tc(c=>{if(c instanceof vA)return de(null);throw c}))),Ic(l=>!!l),Tc(l=>{if(hq(l))return function Ebe(n,e,t){return 0===e.length&&!n.children[t]}(r,i,o)?de(new Ibe):eh(r);throw l}))}processSegmentAgainstRoute(e,t,r,i,o,s,a,l){return yo(r)===s||s!==Ne&&mw(i,o,r)?void 0===r.redirectTo?this.matchSegmentAgainstRoute(e,i,r,o,s,l):this.allowRedirects&&a?this.expandSegmentAgainstRouteUsingRedirect(e,i,t,r,o,s,l):eh(i):eh(i)}expandSegmentAgainstRouteUsingRedirect(e,t,r,i,o,s,a){const{matched:l,parameters:c,consumedSegments:u,positionalParamSegments:d,remainingSegments:f}=pq(t,i,o);if(!l)return eh(t);"string"==typeof i.redirectTo&&"/"===i.redirectTo[0]&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>31&&(this.allowRedirects=!1));const p=new cw(o,c,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,_q(i),yo(i),i.component??i._loadedComponent??null,i,yq(i)),m=lw(p,a,this.paramsInheritanceStrategy);p.params=Object.freeze(m.params),p.data=Object.freeze(m.data);const _=this.applyRedirects.applyRedirectCommands(u,i.redirectTo,d,p,e);return this.applyRedirects.lineralizeSegments(i,_).pipe(Ur(v=>this.processSegment(e,r,t,v.concat(f),s,!1,a)))}matchSegmentAgainstRoute(e,t,r,i,o,s){const a=gbe(t,r,i,e);return"**"===r.path&&(t.children={}),a.pipe(_o(l=>l.matched?this.getChildConfig(e=r._injector??e,r,i).pipe(_o(({routes:c})=>{const u=r._loadedInjector??e,{parameters:d,consumedSegments:f,remainingSegments:p}=l,m=new cw(f,d,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,_q(r),yo(r),r.component??r._loadedComponent??null,r,yq(r)),_=lw(m,s,this.paramsInheritanceStrategy);m.params=Object.freeze(_.params),m.data=Object.freeze(_.data);const{segmentGroup:v,slicedSegments:E}=mq(t,f,p,c);if(0===E.length&&v.hasChildren())return this.processChildren(u,c,v,m).pipe(Te(R=>new vo(m,R)));if(0===c.length&&0===E.length)return de(new vo(m,[]));const C=yo(r)===o;return this.processSegment(u,c,v,E,C?Ne:o,!0,m).pipe(Te(R=>new vo(m,R instanceof vo?[R]:[])))})):eh(t)))}getChildConfig(e,t,r){return t.children?de({routes:t.children,injector:e}):t.loadChildren?void 0!==t._loadedRoutes?de({routes:t._loadedRoutes,injector:t._loadedInjector}):function dbe(n,e,t,r){const i=e.canLoad;return void 0===i||0===i.length?de(!0):de(i.map(s=>{const a=Zd(s,n);return $a(function Xve(n){return n&&Om(n.canLoad)}(a)?a.canLoad(e,t):yi(n,()=>a(e,t)))})).pipe(Jd(),fq())}(e,t,r).pipe(Ur(i=>i?this.configLoader.loadChildren(e,t).pipe(Bn(o=>{t._loadedRoutes=o.routes,t._loadedInjector=o.injector})):function pbe(){return wm(cq(!1,Ai.GuardRejected))}())):de({routes:[],injector:e})}}function Dbe(n){const e=n.value.routeConfig;return e&&""===e.path}function gq(n){const e=[],t=new Set;for(const r of n){if(!Dbe(r)){e.push(r);continue}const i=e.find(o=>r.value.routeConfig===o.value.routeConfig);void 0!==i?(i.children.push(...r.children),t.add(i)):e.push(r)}for(const r of t){const i=gq(r.children);e.push(new vo(r.value,i))}return e.filter(r=>!t.has(r))}function _q(n){return n.data||{}}function yq(n){return n.resolve||{}}function vq(n){const e=n.children.map(t=>vq(t)).flat();return[n,...e]}function wA(n){return _o(e=>{const t=n(e);return t?nr(t).pipe(Te(()=>e)):de(e)})}let bq=(()=>{class n{buildTitle(t){let r,i=t.root;for(;void 0!==i;)r=this.getResolvedTitleForRoute(i)??r,i=i.children.find(o=>o.outlet===Ne);return r}getResolvedTitleForRoute(t){return t.data[Im]}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:()=>b(Pbe),providedIn:"root"})}return n})(),Pbe=(()=>{class n extends bq{title;constructor(t){super(),this.title=t}updateTitle(t){const r=this.buildTitle(t);void 0!==r&&this.title.setTitle(r)}static \u0275fac=function(r){return new(r||n)(me(H_e))};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const Fm=new B("",{providedIn:"root",factory:()=>({})});let wq=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["ng-component"]],exportAs:["emptyRouterOutlet"],decls:1,vars:0,template:function(r,i){1&r&&Pe(0,"router-outlet")},dependencies:[gA],encapsulation:2})}return n})();function EA(n){const e=n.children&&n.children.map(EA),t=e?{...n,children:e}:{...n};return!t.component&&!t.loadComponent&&(e||t.loadChildren)&&t.outlet&&t.outlet!==Ne&&(t.component=wq),t}const gw=new B("");let Eq=(()=>{class n{componentLoaders=new WeakMap;childrenLoaders=new WeakMap;onLoadStartListener;onLoadEndListener;compiler=b(Vfe);loadComponent(t){if(this.componentLoaders.get(t))return this.componentLoaders.get(t);if(t._loadedComponent)return de(t._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(t);const r=$a(t.loadComponent()).pipe(Te(Iq),Bn(o=>{this.onLoadEndListener&&this.onLoadEndListener(t),t._loadedComponent=o}),Jb(()=>{this.componentLoaders.delete(t)})),i=new N4(r,()=>new fe).pipe(eA());return this.componentLoaders.set(t,i),i}loadChildren(t,r){if(this.childrenLoaders.get(r))return this.childrenLoaders.get(r);if(r._loadedRoutes)return de({routes:r._loadedRoutes,injector:r._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(r);const o=function Obe(n,e,t,r){return $a(n.loadChildren()).pipe(Te(Iq),Ur(i=>i instanceof Vz||Array.isArray(i)?de(i):nr(e.compileModuleAsync(i))),Te(i=>{r&&r(n);let o,s,a=!1;return Array.isArray(i)?(s=i,!0):(o=i.create(t).injector,s=o.get(gw,[],{optional:!0,self:!0}).flat()),{routes:s.map(EA),injector:o}}))}(r,this.compiler,t,this.onLoadEndListener).pipe(Jb(()=>{this.childrenLoaders.delete(r)})),s=new N4(o,()=>new fe).pipe(eA());return this.childrenLoaders.set(r,s),s}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function Iq(n){return function Fbe(n){return n&&"object"==typeof n&&"default"in n}(n)?n.default:n}let IA=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:()=>b(Lbe),providedIn:"root"})}return n})(),Lbe=(()=>{class n{shouldProcessUrl(t){return!0}extract(t){return t}merge(t,r){return t}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const Tq=new B(""),xq=new B("");let _w=(()=>{class n{currentNavigation=null;currentTransition=null;lastSuccessfulNavigation=null;events=new fe;transitionAbortSubject=new fe;configLoader=b(Eq);environmentInjector=b(mr);destroyRef=b(uo);urlSerializer=b(Qd);rootContexts=b(Mm);location=b(qd);inputBindingEnabled=null!==b(uw,{optional:!0});titleStrategy=b(bq);options=b(Fm,{optional:!0})||{};paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly";urlHandlingStrategy=b(IA);createViewTransition=b(Tq,{optional:!0});navigationErrorHandler=b(xq,{optional:!0});navigationId=0;get hasRequestedNavigation(){return 0!==this.navigationId}transitions;afterPreactivation=()=>de(void 0);rootComponentType=null;destroyed=!1;constructor(){this.configLoader.onLoadEndListener=i=>this.events.next(new Sve(i)),this.configLoader.onLoadStartListener=i=>this.events.next(new xve(i)),this.destroyRef.onDestroy(()=>{this.destroyed=!0})}complete(){this.transitions?.complete()}handleNavigationRequest(t){const r=++this.navigationId;this.transitions?.next({...this.transitions.value,...t,id:r})}setupNavigations(t,r,i){return this.transitions=new mi({id:0,currentUrlTree:r,currentRawUrl:r,extractedUrl:this.urlHandlingStrategy.extract(r),urlAfterRedirects:this.urlHandlingStrategy.extract(r),rawUrl:r,extras:{},resolve:()=>{},reject:()=>{},promise:Promise.resolve(!0),source:Dm,restoredState:null,currentSnapshot:i.snapshot,targetSnapshot:null,currentRouterState:i,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.transitions.pipe(si(o=>0!==o.id),Te(o=>({...o,extractedUrl:this.urlHandlingStrategy.extract(o.rawUrl)})),_o(o=>{let s=!1,a=!1;return de(o).pipe(_o(l=>{if(this.navigationId>o.id)return this.cancelNavigationTransition(o,"",Ai.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 c=!t.navigated||this.isUpdatingInternalState()||this.isUpdatedBrowserUrl();if(!c&&"reload"!==(l.extras.onSameUrlNavigation??t.onSameUrlNavigation)){const d="";return this.events.next(new Am(l.id,this.urlSerializer.serialize(l.rawUrl),d,lA.IgnoredSameUrlNavigation)),l.resolve(!1),Di}if(this.urlHandlingStrategy.shouldProcessUrl(l.rawUrl))return de(l).pipe(_o(d=>{const f=this.transitions?.getValue();return this.events.next(new aA(d.id,this.urlSerializer.serialize(d.extractedUrl),d.source,d.restoredState)),f!==this.transitions?.getValue()?Di:Promise.resolve(d)}),function Abe(n,e,t,r,i,o){return Ur(s=>function Tbe(n,e,t,r,i,o,s="emptyOnly"){return new xbe(n,e,t,r,i,s,o).recognize()}(n,e,t,r,s.extractedUrl,i,o).pipe(Te(({state:a,tree:l})=>({...s,targetSnapshot:a,urlAfterRedirects:l}))))}(this.environmentInjector,this.configLoader,this.rootComponentType,t.config,this.urlSerializer,this.paramsInheritanceStrategy),Bn(d=>{o.targetSnapshot=d.targetSnapshot,o.urlAfterRedirects=d.urlAfterRedirects,this.currentNavigation={...this.currentNavigation,finalUrl:d.urlAfterRedirects};const f=new eq(d.id,this.urlSerializer.serialize(d.extractedUrl),this.urlSerializer.serialize(d.urlAfterRedirects),d.targetSnapshot);this.events.next(f)}));if(c&&this.urlHandlingStrategy.shouldProcessUrl(l.currentRawUrl)){const{id:d,extractedUrl:f,source:p,restoredState:m,extras:_}=l,v=new aA(d,this.urlSerializer.serialize(f),p,m);this.events.next(v);const E=rq(this.rootComponentType).snapshot;return this.currentTransition=o={...l,targetSnapshot:E,urlAfterRedirects:f,extras:{..._,skipLocationChange:!1,replaceUrl:!1}},this.currentNavigation.finalUrl=f,de(o)}{const d="";return this.events.next(new Am(l.id,this.urlSerializer.serialize(l.extractedUrl),d,lA.IgnoredByUrlHandlingStrategy)),l.resolve(!1),Di}}),Bn(l=>{const c=new Eve(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects),l.targetSnapshot);this.events.next(c)}),Te(l=>(this.currentTransition=o={...l,guards:Wve(l.targetSnapshot,l.currentSnapshot,this.rootContexts)},o)),function rbe(n,e){return Ur(t=>{const{targetSnapshot:r,currentSnapshot:i,guards:{canActivateChecks:o,canDeactivateChecks:s}}=t;return 0===s.length&&0===o.length?de({...t,guardsResult:!0}):function ibe(n,e,t,r){return nr(n).pipe(Ur(i=>function ube(n,e,t,r,i){const o=e&&e.routeConfig?e.routeConfig.canDeactivate:null;return o&&0!==o.length?de(o.map(a=>{const l=Rm(e)??i,c=Zd(a,l);return $a(function ebe(n){return n&&Om(n.canDeactivate)}(c)?c.canDeactivate(n,e,t,r):yi(l,()=>c(n,e,t,r))).pipe(Ic())})).pipe(Jd()):de(!0)}(i.component,i.route,t,e,r)),Ic(i=>!0!==i,!0))}(s,r,i,n).pipe(Ur(a=>a&&function Yve(n){return"boolean"==typeof n}(a)?function obe(n,e,t,r){return nr(e).pipe(Em(i=>Xb(function abe(n,e){return null!==n&&e&&e(new Dve(n)),de(!0)}(i.route.parent,r),function sbe(n,e){return null!==n&&e&&e(new Rve(n)),de(!0)}(i.route,r),function cbe(n,e,t){const r=e[e.length-1],o=e.slice(0,e.length-1).reverse().map(s=>function Gve(n){const e=n.routeConfig?n.routeConfig.canActivateChild:null;return e&&0!==e.length?{node:n,guards:e}:null}(s)).filter(s=>null!==s).map(s=>k4(()=>de(s.guards.map(l=>{const c=Rm(s.node)??t,u=Zd(l,c);return $a(function Jve(n){return n&&Om(n.canActivateChild)}(u)?u.canActivateChild(r,n):yi(c,()=>u(r,n))).pipe(Ic())})).pipe(Jd())));return de(o).pipe(Jd())}(n,i.path,t),function lbe(n,e,t){const r=e.routeConfig?e.routeConfig.canActivate:null;if(!r||0===r.length)return de(!0);const i=r.map(o=>k4(()=>{const s=Rm(e)??t,a=Zd(o,s);return $a(function Zve(n){return n&&Om(n.canActivate)}(a)?a.canActivate(e,n):yi(s,()=>a(e,n))).pipe(Ic())}));return de(i).pipe(Jd())}(n,i.route,t))),Ic(i=>!0!==i,!0))}(r,o,n,e):de(a)),Te(a=>({...t,guardsResult:a})))})}(this.environmentInjector,l=>this.events.next(l)),Bn(l=>{if(o.guardsResult=l.guardsResult,l.guardsResult&&"boolean"!=typeof l.guardsResult)throw dw(0,l.guardsResult);const c=new Ive(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects),l.targetSnapshot,!!l.guardsResult);this.events.next(c)}),si(l=>!!l.guardsResult||(this.cancelNavigationTransition(l,"",Ai.GuardRejected),!1)),wA(l=>{if(l.guards.canActivateChecks.length)return de(l).pipe(Bn(c=>{const u=new Tve(c.id,this.urlSerializer.serialize(c.extractedUrl),this.urlSerializer.serialize(c.urlAfterRedirects),c.targetSnapshot);this.events.next(u)}),_o(c=>{let u=!1;return de(c).pipe(function Rbe(n,e){return Ur(t=>{const{targetSnapshot:r,guards:{canActivateChecks:i}}=t;if(!i.length)return de(t);const o=new Set(i.map(l=>l.route)),s=new Set;for(const l of o)if(!s.has(l))for(const c of vq(l))s.add(c);let a=0;return nr(s).pipe(Em(l=>o.has(l)?function Mbe(n,e,t,r){const i=n.routeConfig,o=n._resolve;return void 0!==i?.title&&!sq(i)&&(o[Im]=i.title),function kbe(n,e,t,r){const i=nA(n);if(0===i.length)return de({});const o={};return nr(i).pipe(Ur(s=>function Nbe(n,e,t,r){const i=Rm(e)??r,o=Zd(n,i);return $a(o.resolve?o.resolve(e,t):yi(i,()=>o(e,t)))}(n[s],e,t,r).pipe(Ic(),Bn(a=>{if(a instanceof yA)throw dw(new tw,a);o[s]=a}))),tA(1),Te(()=>o),Tc(s=>hq(s)?Di:wm(s)))}(o,n,e,r).pipe(Te(s=>(n._resolvedData=s,n.data=lw(n,n.parent,t).resolve,null)))}(l,r,n,e):(l.data=lw(l,l.parent,n).resolve,de(void 0))),Bn(()=>a++),tA(1),Ur(l=>a===s.size?de(t):Di))})}(this.paramsInheritanceStrategy,this.environmentInjector),Bn({next:()=>u=!0,complete:()=>{u||this.cancelNavigationTransition(c,"",Ai.NoDataFromResolver)}}))}),Bn(c=>{const u=new Cve(c.id,this.urlSerializer.serialize(c.extractedUrl),this.urlSerializer.serialize(c.urlAfterRedirects),c.targetSnapshot);this.events.next(u)}))}),wA(l=>{const c=u=>{const d=[];u.routeConfig?.loadComponent&&!u.routeConfig._loadedComponent&&d.push(this.configLoader.loadComponent(u.routeConfig).pipe(Bn(f=>{u.component=f}),Te(()=>{})));for(const f of u.children)d.push(...c(f));return d};return JD(c(l.targetSnapshot.root)).pipe(Zb(null),zo(1))}),wA(()=>this.afterPreactivation()),_o(()=>{const{currentSnapshot:l,targetSnapshot:c}=o,u=this.createViewTransition?.(this.environmentInjector,l.root,c.root);return u?nr(u).pipe(Te(()=>o)):de(o)}),Te(l=>{const c=function Uve(n,e,t){const r=km(n,e._root,t?t._root:void 0);return new nq(r,e)}(t.routeReuseStrategy,l.targetSnapshot,l.currentRouterState);return this.currentTransition=o={...l,targetRouterState:c},this.currentNavigation.targetRouterState=c,o}),Bn(()=>{this.events.next(new uA)}),((n,e,t,r)=>Te(i=>(new qve(e,i.targetRouterState,i.currentRouterState,t,r).activate(n),i)))(this.rootContexts,t.routeReuseStrategy,l=>this.events.next(l),this.inputBindingEnabled),zo(1),Bn({next:l=>{s=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new Dc(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects))),this.titleStrategy?.updateTitle(l.targetRouterState.snapshot),l.resolve(!0)},complete:()=>{s=!0}}),At(this.transitionAbortSubject.pipe(Bn(l=>{throw l}))),Jb(()=>{!s&&!a&&this.cancelNavigationTransition(o,"",Ai.SupersededByNewNavigation),this.currentTransition?.id===o.id&&(this.currentNavigation=null,this.currentTransition=null)}),Tc(l=>{if(this.destroyed)return o.resolve(!1),Di;if(a=!0,uq(l))this.events.next(new Ac(o.id,this.urlSerializer.serialize(o.extractedUrl),l.message,l.cancellationCode)),function Hve(n){return uq(n)&&Sc(n.url)}(l)?this.events.next(new aw(l.url,l.navigationBehaviorOptions)):o.resolve(!1);else{const c=new cA(o.id,this.urlSerializer.serialize(o.extractedUrl),l,o.targetSnapshot??void 0);try{const u=yi(this.environmentInjector,()=>this.navigationErrorHandler?.(c));if(!(u instanceof yA))throw this.events.next(c),l;{const{message:d,cancellationCode:f}=dw(0,u);this.events.next(new Ac(o.id,this.urlSerializer.serialize(o.extractedUrl),d,f)),this.events.next(new aw(u.redirectTo,u.navigationBehaviorOptions))}}catch(u){this.options.resolveNavigationPromiseOnError?o.resolve(!1):o.reject(u)}}return Di}))}))}cancelNavigationTransition(t,r,i){const o=new Ac(t.id,this.urlSerializer.serialize(t.extractedUrl),r,i);this.events.next(o),t.resolve(!1)}isUpdatingInternalState(){return this.currentTransition?.extractedUrl.toString()!==this.currentTransition?.currentUrlTree.toString()}isUpdatedBrowserUrl(){const t=this.urlHandlingStrategy.extract(this.urlSerializer.parse(this.location.path(!0))),r=this.currentNavigation?.targetBrowserUrl??this.currentNavigation?.extractedUrl;return t.toString()!==r?.toString()&&!this.currentNavigation?.extras.skipLocationChange}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function Ube(n){return n!==Dm}let zbe=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:()=>b(Hbe),providedIn:"root"})}return n})();class jbe{shouldDetach(e){return!1}store(e,t){}shouldAttach(e){return!1}retrieve(e){return null}shouldReuseRoute(e,t){return e.routeConfig===t.routeConfig}}let Hbe=(()=>{class n extends jbe{static \u0275fac=(()=>{let t;return function(i){return(t||(t=bt(n)))(i||n)}})();static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Sq=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:()=>b($be),providedIn:"root"})}return n})(),$be=(()=>{class n extends Sq{location=b(qd);urlSerializer=b(Qd);options=b(Fm,{optional:!0})||{};canceledNavigationResolution=this.options.canceledNavigationResolution||"replace";urlHandlingStrategy=b(IA);urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred";currentUrlTree=new Cc;getCurrentUrlTree(){return this.currentUrlTree}rawUrlTree=this.currentUrlTree;getRawUrlTree(){return this.rawUrlTree}currentPageId=0;lastSuccessfulId=-1;restoredState(){return this.location.getState()}get browserPageId(){return"computed"!==this.canceledNavigationResolution?this.currentPageId:this.restoredState()?.\u0275routerPageId??this.currentPageId}routerState=rq(null);getRouterState(){return this.routerState}stateMemento=this.createStateMemento();createStateMemento(){return{rawUrlTree:this.rawUrlTree,currentUrlTree:this.currentUrlTree,routerState:this.routerState}}registerNonRouterCurrentEntryChangeListener(t){return this.location.subscribe(r=>{"popstate"===r.type&&t(r.url,r.state)})}handleRouterEvent(t,r){if(t instanceof aA)this.stateMemento=this.createStateMemento();else if(t instanceof Am)this.rawUrlTree=r.initialUrl;else if(t instanceof eq){if("eager"===this.urlUpdateStrategy&&!r.extras.skipLocationChange){const i=this.urlHandlingStrategy.merge(r.finalUrl,r.initialUrl);this.setBrowserUrl(r.targetBrowserUrl??i,r)}}else t instanceof uA?(this.currentUrlTree=r.finalUrl,this.rawUrlTree=this.urlHandlingStrategy.merge(r.finalUrl,r.initialUrl),this.routerState=r.targetRouterState,"deferred"===this.urlUpdateStrategy&&!r.extras.skipLocationChange&&this.setBrowserUrl(r.targetBrowserUrl??this.rawUrlTree,r)):t instanceof Ac&&(t.code===Ai.GuardRejected||t.code===Ai.NoDataFromResolver)?this.restoreHistory(r):t instanceof cA?this.restoreHistory(r,!0):t instanceof Dc&&(this.lastSuccessfulId=t.id,this.currentPageId=this.browserPageId)}setBrowserUrl(t,r){const i=t instanceof Cc?this.urlSerializer.serialize(t):t;if(this.location.isCurrentPathEqualTo(i)||r.extras.replaceUrl){const s={...r.extras.state,...this.generateNgRouterState(r.id,this.browserPageId)};this.location.replaceState(i,"",s)}else{const o={...r.extras.state,...this.generateNgRouterState(r.id,this.browserPageId+1)};this.location.go(i,"",o)}}restoreHistory(t,r=!1){if("computed"===this.canceledNavigationResolution){const o=this.currentPageId-this.browserPageId;0!==o?this.location.historyGo(o):this.currentUrlTree===t.finalUrl&&0===o&&(this.resetState(t),this.resetUrlToCurrentUrlTree())}else"replace"===this.canceledNavigationResolution&&(r&&this.resetState(t),this.resetUrlToCurrentUrlTree())}resetState(t){this.routerState=this.stateMemento.routerState,this.currentUrlTree=this.stateMemento.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,t.finalUrl??this.rawUrlTree)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(t,r){return"computed"===this.canceledNavigationResolution?{navigationId:t,\u0275routerPageId:r}:{navigationId:t}}static \u0275fac=(()=>{let t;return function(i){return(t||(t=bt(n)))(i||n)}})();static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const qbe={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},Wbe={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};let bo=(()=>{class n{get currentUrlTree(){return this.stateManager.getCurrentUrlTree()}get rawUrlTree(){return this.stateManager.getRawUrlTree()}disposed=!1;nonRouterCurrentEntryChangeSubscription;console=b(tj);stateManager=b(Sq);options=b(Fm,{optional:!0})||{};pendingTasks=b(Es);urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred";navigationTransitions=b(_w);urlSerializer=b(Qd);location=b(qd);urlHandlingStrategy=b(IA);_events=new fe;get events(){return this._events}get routerState(){return this.stateManager.getRouterState()}navigated=!1;routeReuseStrategy=b(zbe);onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore";config=b(gw,{optional:!0})?.flat()??[];componentInputBindingEnabled=!!b(uw,{optional:!0});constructor(){this.resetConfig(this.config),this.navigationTransitions.setupNavigations(this,this.currentUrlTree,this.routerState).subscribe({error:t=>{this.console.warn(t)}}),this.subscribeToNavigationEvents()}eventsSubscription=new Kt;subscribeToNavigationEvents(){const t=this.navigationTransitions.events.subscribe(r=>{try{const i=this.navigationTransitions.currentTransition,o=this.navigationTransitions.currentNavigation;if(null!==i&&null!==o)if(this.stateManager.handleRouterEvent(r,o),r instanceof Ac&&r.code!==Ai.Redirect&&r.code!==Ai.SupersededByNewNavigation)this.navigated=!0;else if(r instanceof Dc)this.navigated=!0;else if(r instanceof aw){const s=r.navigationBehaviorOptions,a=this.urlHandlingStrategy.merge(r.url,i.currentRawUrl),l={browserUrl:i.extras.browserUrl,info:i.extras.info,skipLocationChange:i.extras.skipLocationChange,replaceUrl:i.extras.replaceUrl||"eager"===this.urlUpdateStrategy||Ube(i.source),...s};this.scheduleNavigation(a,Dm,null,l,{resolve:i.resolve,reject:i.reject,promise:i.promise})}(function Kbe(n){return!(n instanceof uA||n instanceof aw)})(r)&&this._events.next(r)}catch(i){this.navigationTransitions.transitionAbortSubject.next(i)}});this.eventsSubscription.add(t)}resetRootComponentType(t){this.routerState.root.component=t,this.navigationTransitions.rootComponentType=t}initialNavigation(){this.setUpLocationChangeListener(),this.navigationTransitions.hasRequestedNavigation||this.navigateToSyncWithBrowser(this.location.path(!0),Dm,this.stateManager.restoredState())}setUpLocationChangeListener(){this.nonRouterCurrentEntryChangeSubscription??=this.stateManager.registerNonRouterCurrentEntryChangeListener((t,r)=>{setTimeout(()=>{this.navigateToSyncWithBrowser(t,"popstate",r)},0)})}navigateToSyncWithBrowser(t,r,i){const o={replaceUrl:!0},s=i?.navigationId?i:null;if(i){const l={...i};delete l.navigationId,delete l.\u0275routerPageId,0!==Object.keys(l).length&&(o.state=l)}const a=this.parseUrl(t);this.scheduleNavigation(a,r,s,o)}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.navigationTransitions.currentNavigation}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(t){this.config=t.map(EA),this.navigated=!1}ngOnDestroy(){this.dispose()}dispose(){this._events.unsubscribe(),this.navigationTransitions.complete(),this.nonRouterCurrentEntryChangeSubscription&&(this.nonRouterCurrentEntryChangeSubscription.unsubscribe(),this.nonRouterCurrentEntryChangeSubscription=void 0),this.disposed=!0,this.eventsSubscription.unsubscribe()}createUrlTree(t,r={}){const{relativeTo:i,queryParams:o,fragment:s,queryParamsHandling:a,preserveFragment:l}=r,c=l?this.currentUrlTree.fragment:s;let d,u=null;switch(a??this.options.defaultQueryParamsHandling){case"merge":u={...this.currentUrlTree.queryParams,...o};break;case"preserve":u=this.currentUrlTree.queryParams;break;default:u=o||null}null!==u&&(u=this.removeEmptyProps(u));try{d=G4(i?i.snapshot:this.routerState.snapshot.root)}catch{("string"!=typeof t[0]||"/"!==t[0][0])&&(t=[]),d=this.currentUrlTree.root}return K4(d,t,u,c??null)}navigateByUrl(t,r={skipLocationChange:!1}){const i=Sc(t)?t:this.parseUrl(t),o=this.urlHandlingStrategy.merge(i,this.rawUrlTree);return this.scheduleNavigation(o,Dm,null,r)}navigate(t,r={skipLocationChange:!1}){return function Gbe(n){for(let e=0;e(null!=o&&(r[i]=o),r),{})}scheduleNavigation(t,r,i,o,s){if(this.disposed)return Promise.resolve(!1);let a,l,c;s?(a=s.resolve,l=s.reject,c=s.promise):c=new Promise((d,f)=>{a=d,l=f});const u=this.pendingTasks.add();return function Dq(n,e){n.events.pipe(si(t=>t instanceof Dc||t instanceof Ac||t instanceof cA||t instanceof Am),Te(t=>t instanceof Dc||t instanceof Am?0:t instanceof Ac&&(t.code===Ai.Redirect||t.code===Ai.SupersededByNewNavigation)?2:1),si(t=>2!==t),zo(1)).subscribe(()=>{e()})}(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(u))}),this.navigationTransitions.handleNavigationRequest({source:r,restoredState:i,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,rawUrl:t,extras:o,resolve:a,reject:l,promise:c,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),c.catch(d=>Promise.reject(d))}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),th=(()=>{class n{router;route;tabIndexAttribute;renderer;el;locationStrategy;href=null;target;queryParams;fragment;queryParamsHandling;state;info;relativeTo;isAnchorElement;subscription;onChanges=new fe;constructor(t,r,i,o,s,a){this.router=t,this.route=r,this.tabIndexAttribute=i,this.renderer=o,this.el=s,this.locationStrategy=a;const l=s.nativeElement.tagName?.toLowerCase();this.isAnchorElement="a"===l||"area"===l,this.isAnchorElement?this.subscription=t.events.subscribe(c=>{c instanceof Dc&&this.updateHref()}):this.setTabIndexIfNotOnNativeEl("0")}preserveFragment=!1;skipLocationChange=!1;replaceUrl=!1;setTabIndexIfNotOnNativeEl(t){null!=this.tabIndexAttribute||this.isAnchorElement||this.applyAttributeValue("tabindex",t)}ngOnChanges(t){this.isAnchorElement&&this.updateHref(),this.onChanges.next(this)}routerLinkInput=null;set routerLink(t){null==t?(this.routerLinkInput=null,this.setTabIndexIfNotOnNativeEl(null)):(this.routerLinkInput=Sc(t)||Array.isArray(t)?t:[t],this.setTabIndexIfNotOnNativeEl("0"))}onClick(t,r,i,o,s){const a=this.urlTree;return!!(null===a||this.isAnchorElement&&(0!==t||r||i||o||s||"string"==typeof this.target&&"_self"!=this.target))||(this.router.navigateByUrl(a,{skipLocationChange:this.skipLocationChange,replaceUrl:this.replaceUrl,state:this.state,info:this.info}),!this.isAnchorElement)}ngOnDestroy(){this.subscription?.unsubscribe()}updateHref(){const t=this.urlTree;this.href=null!==t&&this.locationStrategy?this.locationStrategy?.prepareExternalUrl(this.router.serializeUrl(t)):null;const r=null===this.href?null:function QB(n,e,t){return function Foe(n,e){return"src"===e&&("embed"===n||"frame"===n||"iframe"===n||"media"===n||"script"===n)||"href"===e&&("base"===n||"link"===n)?KB:vx}(e,t)(n)}(this.href,this.el.nativeElement.tagName.toLowerCase(),"href");this.applyAttributeValue("href",r)}applyAttributeValue(t,r){const i=this.renderer,o=this.el.nativeElement;null!==r?i.setAttribute(o,t,r):i.removeAttribute(o,t)}get urlTree(){return null===this.routerLinkInput?null:Sc(this.routerLinkInput)?this.routerLinkInput:this.router.createUrlTree(this.routerLinkInput,{relativeTo:void 0!==this.relativeTo?this.relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:this.preserveFragment})}static \u0275fac=function(r){return new(r||n)($(bo),$(Xd),ap("tabindex"),$(Ti),$(je),$(Sb))};static \u0275dir=ee({type:n,selectors:[["","routerLink",""]],hostVars:1,hostBindings:function(r,i){1&r&&Ve("click",function(s){return i.onClick(s.button,s.ctrlKey,s.shiftKey,s.altKey,s.metaKey)}),2&r&&Ke("target",i.target)},inputs:{target:"target",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",state:"state",info:"info",relativeTo:"relativeTo",preserveFragment:[2,"preserveFragment","preserveFragment",_t],skipLocationChange:[2,"skipLocationChange","skipLocationChange",_t],replaceUrl:[2,"replaceUrl","replaceUrl",_t],routerLink:"routerLink"},features:[ei]})}return n})();const TA=new B("");function Rq(n){return n.routerState.root}function Mq(){const n=b(ze);return e=>{const t=n.get(tr);if(e!==t.components[0])return;const r=n.get(bo),i=n.get(kq);1===n.get(CA)&&r.initialNavigation(),n.get(Nq,null,Le.Optional)?.setUpPreloading(),n.get(TA,null,Le.Optional)?.init(),r.resetRootComponentType(t.componentTypes[0]),i.closed||(i.next(),i.complete(),i.unsubscribe())}}const kq=new B("",{factory:()=>new fe}),CA=new B("",{providedIn:"root",factory:()=>1}),Nq=new B("");function Oq(...n){const e=S4(n),{args:t,keys:r}=D4(n),i=new vt(o=>{const{length:s}=t;if(!s)return void o.complete();const a=new Array(s);let l=s,c=s;for(let u=0;u{d||(d=!0,c--),a[u]=f},()=>l--,void 0,()=>{(!l||!d)&&(c||o.next(r?R4(r,a):a),o.complete())}))}});return e?i.pipe(A4(e)):i}let Fq=(()=>{class n{_renderer;_elementRef;onChange=t=>{};onTouched=()=>{};constructor(t,r){this._renderer=t,this._elementRef=r}setProperty(t,r){this._renderer.setProperty(this._elementRef.nativeElement,t,r)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}static \u0275fac=function(r){return new(r||n)($(Ti),$(je))};static \u0275dir=ee({type:n})}return n})(),Rc=(()=>{class n extends Fq{static \u0275fac=(()=>{let t;return function(i){return(t||(t=bt(n)))(i||n)}})();static \u0275dir=ee({type:n,features:[ke]})}return n})();const Yi=new B(""),owe={provide:Yi,useExisting:ft(()=>nh),multi:!0},awe=new B("");let nh=(()=>{class n extends Fq{_compositionMode;_composing=!1;constructor(t,r,i){super(t,r),this._compositionMode=i,null==this._compositionMode&&(this._compositionMode=!function swe(){const n=Ua()?Ua().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}())}writeValue(t){this.setProperty("value",t??"")}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}static \u0275fac=function(r){return new(r||n)($(Ti),$(je),$(awe,8))};static \u0275dir=ee({type:n,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(r,i){1&r&&Ve("input",function(s){return i._handleInput(s.target.value)})("blur",function(){return i.onTouched()})("compositionstart",function(){return i._compositionStart()})("compositionend",function(s){return i._compositionEnd(s.target.value)})},standalone:!1,features:[$e([owe]),ke]})}return n})();function qa(n){return null==n||("string"==typeof n||Array.isArray(n))&&0===n.length}function Vq(n){return null!=n&&"number"==typeof n.length}const yr=new B(""),Wa=new B(""),lwe=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;class Ri{static min(e){return function Bq(n){return e=>{if(qa(e.value)||qa(n))return null;const t=parseFloat(e.value);return!isNaN(t)&&t{if(qa(e.value)||qa(n))return null;const t=parseFloat(e.value);return!isNaN(t)&&t>n?{max:{max:n,actual:e.value}}:null}}(e)}static required(e){return function zq(n){return qa(n.value)?{required:!0}:null}(e)}static requiredTrue(e){return function jq(n){return!0===n.value?null:{required:!0}}(e)}static email(e){return function Hq(n){return qa(n.value)||lwe.test(n.value)?null:{email:!0}}(e)}static minLength(e){return function $q(n){return e=>qa(e.value)||!Vq(e.value)?null:e.value.lengthVq(e.value)&&e.value.length>n?{maxlength:{requiredLength:n,actualLength:e.value.length}}:null}(e)}static pattern(e){return function Wq(n){if(!n)return yw;let e,t;return"string"==typeof n?(t="","^"!==n.charAt(0)&&(t+="^"),t+=n,"$"!==n.charAt(n.length-1)&&(t+="$"),e=new RegExp(t)):(t=n.toString(),e=n),r=>{if(qa(r.value))return null;const i=r.value;return e.test(i)?null:{pattern:{requiredPattern:t,actualValue:i}}}}(e)}static nullValidator(e){return null}static compose(e){return Zq(e)}static composeAsync(e){return Jq(e)}}function yw(n){return null}function Gq(n){return null!=n}function Kq(n){return Gp(n)?nr(n):n}function Qq(n){let e={};return n.forEach(t=>{e=null!=t?{...e,...t}:e}),0===Object.keys(e).length?null:e}function Yq(n,e){return e.map(t=>t(n))}function Xq(n){return n.map(e=>function cwe(n){return!n.validate}(e)?e:t=>e.validate(t))}function Zq(n){if(!n)return null;const e=n.filter(Gq);return 0==e.length?null:function(t){return Qq(Yq(t,e))}}function xA(n){return null!=n?Zq(Xq(n)):null}function Jq(n){if(!n)return null;const e=n.filter(Gq);return 0==e.length?null:function(t){return Oq(Yq(t,e).map(Kq)).pipe(Te(Qq))}}function SA(n){return null!=n?Jq(Xq(n)):null}function e5(n,e){return null===n?[e]:Array.isArray(n)?[...n,e]:[n,e]}function t5(n){return n._rawValidators}function n5(n){return n._rawAsyncValidators}function DA(n){return n?Array.isArray(n)?n:[n]:[]}function vw(n,e){return Array.isArray(n)?n.includes(e):n===e}function r5(n,e){const t=DA(e);return DA(n).forEach(i=>{vw(t,i)||t.push(i)}),t}function i5(n,e){return DA(e).filter(t=>!vw(n,t))}class o5{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}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(e){this._rawValidators=e||[],this._composedValidatorFn=xA(this._rawValidators)}_setAsyncValidators(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=SA(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(e){this._onDestroyCallbacks.push(e)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(e=>e()),this._onDestroyCallbacks=[]}reset(e=void 0){this.control&&this.control.reset(e)}hasError(e,t){return!!this.control&&this.control.hasError(e,t)}getError(e,t){return this.control?this.control.getError(e,t):null}}class zr extends o5{name;get formDirective(){return null}get path(){return null}}class qo extends o5{_parent=null;name=null;valueAccessor=null}class s5{_cd;constructor(e){this._cd=e}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 bw=(()=>{class n extends s5{constructor(t){super(t)}static \u0275fac=function(r){return new(r||n)($(qo,2))};static \u0275dir=ee({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(r,i){2&r&&at("ng-untouched",i.isUntouched)("ng-touched",i.isTouched)("ng-pristine",i.isPristine)("ng-dirty",i.isDirty)("ng-valid",i.isValid)("ng-invalid",i.isInvalid)("ng-pending",i.isPending)},standalone:!1,features:[ke]})}return n})(),ww=(()=>{class n extends s5{constructor(t){super(t)}static \u0275fac=function(r){return new(r||n)($(zr,10))};static \u0275dir=ee({type:n,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(r,i){2&r&&at("ng-untouched",i.isUntouched)("ng-touched",i.isTouched)("ng-pristine",i.isPristine)("ng-dirty",i.isDirty)("ng-valid",i.isValid)("ng-invalid",i.isInvalid)("ng-pending",i.isPending)("ng-submitted",i.isSubmitted)},standalone:!1,features:[ke]})}return n})();const Lm="VALID",Iw="INVALID",rh="PENDING",Vm="DISABLED";class ih{}class l5 extends ih{value;source;constructor(e,t){super(),this.value=e,this.source=t}}class MA extends ih{pristine;source;constructor(e,t){super(),this.pristine=e,this.source=t}}class kA extends ih{touched;source;constructor(e,t){super(),this.touched=e,this.source=t}}class Tw extends ih{status;source;constructor(e,t){super(),this.status=e,this.source=t}}class pwe extends ih{source;constructor(e){super(),this.source=e}}class mwe extends ih{source;constructor(e){super(),this.source=e}}function NA(n){return(Cw(n)?n.validators:n)||null}function PA(n,e){return(Cw(e)?e.asyncValidators:n)||null}function Cw(n){return null!=n&&!Array.isArray(n)&&"object"==typeof n}function c5(n,e,t){const r=n.controls;if(!(e?Object.keys(r):r).length)throw new O(1e3,"");if(!r[t])throw new O(1001,"")}function u5(n,e,t){n._forEachChild((r,i)=>{if(void 0===t[i])throw new O(1002,"")})}class xw{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(e,t){this._assignValidators(e),this._assignAsyncValidators(t)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get status(){return Wn(this.statusReactive)}set status(e){Wn(()=>this.statusReactive.set(e))}_status=xi(()=>this.statusReactive());statusReactive=ti(void 0);get valid(){return this.status===Lm}get invalid(){return this.status===Iw}get pending(){return this.status==rh}get disabled(){return this.status===Vm}get enabled(){return this.status!==Vm}errors;get pristine(){return Wn(this.pristineReactive)}set pristine(e){Wn(()=>this.pristineReactive.set(e))}_pristine=xi(()=>this.pristineReactive());pristineReactive=ti(!0);get dirty(){return!this.pristine}get touched(){return Wn(this.touchedReactive)}set touched(e){Wn(()=>this.touchedReactive.set(e))}_touched=xi(()=>this.touchedReactive());touchedReactive=ti(!1);get untouched(){return!this.touched}_events=new fe;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._assignValidators(e)}setAsyncValidators(e){this._assignAsyncValidators(e)}addValidators(e){this.setValidators(r5(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(r5(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(i5(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(i5(e,this._rawAsyncValidators))}hasValidator(e){return vw(this._rawValidators,e)}hasAsyncValidator(e){return vw(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){const t=!1===this.touched;this.touched=!0;const r=e.sourceControl??this;this._parent&&!e.onlySelf&&this._parent.markAsTouched({...e,sourceControl:r}),t&&!1!==e.emitEvent&&this._events.next(new kA(!0,r))}markAllAsTouched(e={}){this.markAsTouched({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:this}),this._forEachChild(t=>t.markAllAsTouched(e))}markAsUntouched(e={}){const t=!0===this.touched;this.touched=!1,this._pendingTouched=!1;const r=e.sourceControl??this;this._forEachChild(i=>{i.markAsUntouched({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:r})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e,r),t&&!1!==e.emitEvent&&this._events.next(new kA(!1,r))}markAsDirty(e={}){const t=!0===this.pristine;this.pristine=!1;const r=e.sourceControl??this;this._parent&&!e.onlySelf&&this._parent.markAsDirty({...e,sourceControl:r}),t&&!1!==e.emitEvent&&this._events.next(new MA(!1,r))}markAsPristine(e={}){const t=!1===this.pristine;this.pristine=!0,this._pendingDirty=!1;const r=e.sourceControl??this;this._forEachChild(i=>{i.markAsPristine({onlySelf:!0,emitEvent:e.emitEvent})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e,r),t&&!1!==e.emitEvent&&this._events.next(new MA(!0,r))}markAsPending(e={}){this.status=rh;const t=e.sourceControl??this;!1!==e.emitEvent&&(this._events.next(new Tw(this.status,t)),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.markAsPending({...e,sourceControl:t})}disable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=Vm,this.errors=null,this._forEachChild(i=>{i.disable({...e,onlySelf:!0})}),this._updateValue();const r=e.sourceControl??this;!1!==e.emitEvent&&(this._events.next(new l5(this.value,r)),this._events.next(new Tw(this.status,r)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors({...e,skipPristineCheck:t},this),this._onDisabledChange.forEach(i=>i(!0))}enable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=Lm,this._forEachChild(r=>{r.enable({...e,onlySelf:!0})}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors({...e,skipPristineCheck:t},this),this._onDisabledChange.forEach(r=>r(!1))}_updateAncestors(e,t){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine({},t),this._parent._updateTouched({},t))}setParent(e){this._parent=e}getRawValue(){return this.value}updateValueAndValidity(e={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){const r=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===Lm||this.status===rh)&&this._runAsyncValidator(r,e.emitEvent)}const t=e.sourceControl??this;!1!==e.emitEvent&&(this._events.next(new l5(this.value,t)),this._events.next(new Tw(this.status,t)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity({...e,sourceControl:t})}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?Vm:Lm}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e,t){if(this.asyncValidator){this.status=rh,this._hasOwnPendingAsyncValidator={emitEvent:!1!==t};const r=Kq(this.asyncValidator(this));this._asyncValidationSubscription=r.subscribe(i=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(i,{emitEvent:t,shouldHaveEmitted:e})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();const e=this._hasOwnPendingAsyncValidator?.emitEvent??!1;return this._hasOwnPendingAsyncValidator=null,e}return!1}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(!1!==t.emitEvent,this,t.shouldHaveEmitted)}get(e){let t=e;return null==t||(Array.isArray(t)||(t=t.split(".")),0===t.length)?null:t.reduce((r,i)=>r&&r._find(i),this)}getError(e,t){const r=t?this.get(t):this;return r&&r.errors?r.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e,t,r){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),(e||r)&&this._events.next(new Tw(this.status,t)),this._parent&&this._parent._updateControlsErrors(e,t,r)}_initObservables(){this.valueChanges=new nt,this.statusChanges=new nt}_calculateStatus(){return this._allControlsDisabled()?Vm:this.errors?Iw:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(rh)?rh:this._anyControlsHaveStatus(Iw)?Iw:Lm}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e,t){const r=!this._anyControlsDirty(),i=this.pristine!==r;this.pristine=r,this._parent&&!e.onlySelf&&this._parent._updatePristine(e,t),i&&this._events.next(new MA(this.pristine,t))}_updateTouched(e={},t){this.touched=this._anyControlsTouched(),this._events.next(new kA(this.touched,t)),this._parent&&!e.onlySelf&&this._parent._updateTouched(e,t)}_onDisabledChange=[];_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){Cw(e)&&null!=e.updateOn&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){return!e&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}_find(e){return null}_assignValidators(e){this._rawValidators=Array.isArray(e)?e.slice():e,this._composedValidatorFn=function gwe(n){return Array.isArray(n)?xA(n):n||null}(this._rawValidators)}_assignAsyncValidators(e){this._rawAsyncValidators=Array.isArray(e)?e.slice():e,this._composedAsyncValidatorFn=function _we(n){return Array.isArray(n)?SA(n):n||null}(this._rawAsyncValidators)}}class Bm extends xw{constructor(e,t,r){super(NA(t),PA(r,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t,r={}){this.registerControl(e,t),this.updateValueAndValidity({emitEvent:r.emitEvent}),this._onCollectionChange()}removeControl(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}setControl(e,t,r={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity({emitEvent:r.emitEvent}),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){u5(this,0,e),Object.keys(e).forEach(r=>{c5(this,!0,r),this.controls[r].setValue(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(Object.keys(e).forEach(r=>{const i=this.controls[r];i&&i.patchValue(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e={},t={}){this._forEachChild((r,i)=>{r.reset(e?e[i]:null,{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t,this),this._updateTouched(t,this),this.updateValueAndValidity(t)}getRawValue(){return this._reduceChildren({},(e,t,r)=>(e[r]=t.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(t,r)=>!!r._syncPendingControls()||t);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_forEachChild(e){Object.keys(this.controls).forEach(t=>{const r=this.controls[t];r&&e(r,t)})}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(const[t,r]of Object.entries(this.controls))if(this.contains(t)&&e(r))return!0;return!1}_reduceValue(){return this._reduceChildren({},(t,r,i)=>((r.enabled||this.disabled)&&(t[i]=r.value),t))}_reduceChildren(e,t){let r=e;return this._forEachChild((i,o)=>{r=t(r,i,o)}),r}_allControlsDisabled(){for(const e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(e){return this.controls.hasOwnProperty(e)?this.controls[e]:null}}class d5 extends Bm{}const oh=new B("",{providedIn:"root",factory:()=>Sw}),Sw="always";function Um(n,e,t=Sw){OA(n,e),e.valueAccessor.writeValue(n.value),(n.disabled||"always"===t)&&e.valueAccessor.setDisabledState?.(n.disabled),function vwe(n,e){e.valueAccessor.registerOnChange(t=>{n._pendingValue=t,n._pendingChange=!0,n._pendingDirty=!0,"change"===n.updateOn&&h5(n,e)})}(n,e),function wwe(n,e){const t=(r,i)=>{e.valueAccessor.writeValue(r),i&&e.viewToModelUpdate(r)};n.registerOnChange(t),e._registerOnDestroy(()=>{n._unregisterOnChange(t)})}(n,e),function bwe(n,e){e.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,"blur"===n.updateOn&&n._pendingChange&&h5(n,e),"submit"!==n.updateOn&&n.markAsTouched()})}(n,e),function ywe(n,e){if(e.valueAccessor.setDisabledState){const t=r=>{e.valueAccessor.setDisabledState(r)};n.registerOnDisabledChange(t),e._registerOnDestroy(()=>{n._unregisterOnDisabledChange(t)})}}(n,e)}function Aw(n,e,t=!0){const r=()=>{};e.valueAccessor&&(e.valueAccessor.registerOnChange(r),e.valueAccessor.registerOnTouched(r)),Mw(n,e),n&&(e._invokeOnDestroyCallbacks(),n._registerOnCollectionChange(()=>{}))}function Rw(n,e){n.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function OA(n,e){const t=t5(n);null!==e.validator?n.setValidators(e5(t,e.validator)):"function"==typeof t&&n.setValidators([t]);const r=n5(n);null!==e.asyncValidator?n.setAsyncValidators(e5(r,e.asyncValidator)):"function"==typeof r&&n.setAsyncValidators([r]);const i=()=>n.updateValueAndValidity();Rw(e._rawValidators,i),Rw(e._rawAsyncValidators,i)}function Mw(n,e){let t=!1;if(null!==n){if(null!==e.validator){const i=t5(n);if(Array.isArray(i)&&i.length>0){const o=i.filter(s=>s!==e.validator);o.length!==i.length&&(t=!0,n.setValidators(o))}}if(null!==e.asyncValidator){const i=n5(n);if(Array.isArray(i)&&i.length>0){const o=i.filter(s=>s!==e.asyncValidator);o.length!==i.length&&(t=!0,n.setAsyncValidators(o))}}}const r=()=>{};return Rw(e._rawValidators,r),Rw(e._rawAsyncValidators,r),t}function h5(n,e){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function f5(n,e){OA(n,e)}function p5(n,e){n._syncPendingControls(),e.forEach(t=>{const r=t.control;"submit"===r.updateOn&&r._pendingChange&&(t.viewToModelUpdate(r._pendingValue),r._pendingChange=!1)})}const xwe={provide:zr,useExisting:ft(()=>jm)},zm=Promise.resolve();let jm=(()=>{class n extends zr{callSetDisabledState;get submitted(){return Wn(this.submittedReactive)}_submitted=xi(()=>this.submittedReactive());submittedReactive=ti(!1);_directives=new Set;form;ngSubmit=new nt;options;constructor(t,r,i){super(),this.callSetDisabledState=i,this.form=new Bm({},xA(t),SA(r))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){zm.then(()=>{const r=this._findContainer(t.path);t.control=r.registerControl(t.name,t.control),Um(t.control,t,this.callSetDisabledState),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){zm.then(()=>{const r=this._findContainer(t.path);r&&r.removeControl(t.name),this._directives.delete(t)})}addFormGroup(t){zm.then(()=>{const r=this._findContainer(t.path),i=new Bm({});f5(i,t),r.registerControl(t.name,i),i.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){zm.then(()=>{const r=this._findContainer(t.path);r&&r.removeControl(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,r){zm.then(()=>{this.form.get(t.path).setValue(r)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submittedReactive.set(!0),p5(this.form,this._directives),this.ngSubmit.emit(t),"dialog"===t?.target?.method}onReset(){this.resetForm()}resetForm(t=void 0){this.form.reset(t),this.submittedReactive.set(!1)}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)}_findContainer(t){return t.pop(),t.length?this.form.get(t):this.form}static \u0275fac=function(r){return new(r||n)($(yr,10),$(Wa,10),$(oh,8))};static \u0275dir=ee({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(r,i){1&r&&Ve("submit",function(s){return i.onSubmit(s)})("reset",function(){return i.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[$e([xwe]),ke]})}return n})();function m5(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}function g5(n){return"object"==typeof n&&null!==n&&2===Object.keys(n).length&&"value"in n&&"disabled"in n}const Hm=class extends xw{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(e=null,t,r){super(NA(t),PA(r,t)),this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),Cw(t)&&(t.nonNullable||t.initialValueIsDefault)&&(this.defaultValue=g5(e)?e.value:e)}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&!1!==t.emitModelToViewChange&&this._onChange.forEach(r=>r(this.value,!1!==t.emitViewToModelChange)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=this.defaultValue,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){m5(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){m5(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(e){g5(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}};Promise.resolve();let kw=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""],standalone:!1})}return n})();const BA=new B(""),Owe={provide:zr,useExisting:ft(()=>Ga)};let Ga=(()=>{class n extends zr{callSetDisabledState;get submitted(){return Wn(this._submittedReactive)}set submitted(t){this._submittedReactive.set(t)}_submitted=xi(()=>this._submittedReactive());_submittedReactive=ti(!1);_oldForm;_onCollectionChange=()=>this._updateDomValue();directives=[];form=null;ngSubmit=new nt;constructor(t,r,i){super(),this.callSetDisabledState=i,this._setValidators(t),this._setAsyncValidators(r)}ngOnChanges(t){t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(Mw(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(t){const r=this.form.get(t.path);return Um(r,t,this.callSetDisabledState),r.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),r}getControl(t){return this.form.get(t.path)}removeControl(t){Aw(t.control||null,t,!1),function Cwe(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}(this.directives,t)}addFormGroup(t){this._setUpFormContainer(t)}removeFormGroup(t){this._cleanUpFormContainer(t)}getFormGroup(t){return this.form.get(t.path)}addFormArray(t){this._setUpFormContainer(t)}removeFormArray(t){this._cleanUpFormContainer(t)}getFormArray(t){return this.form.get(t.path)}updateModel(t,r){this.form.get(t.path).setValue(r)}onSubmit(t){return this._submittedReactive.set(!0),p5(this.form,this.directives),this.ngSubmit.emit(t),this.form._events.next(new pwe(this.control)),"dialog"===t?.target?.method}onReset(){this.resetForm()}resetForm(t=void 0){this.form.reset(t),this._submittedReactive.set(!1),this.form._events.next(new mwe(this.form))}_updateDomValue(){this.directives.forEach(t=>{const r=t.control,i=this.form.get(t.path);r!==i&&(Aw(r||null,t),(n=>n instanceof Hm)(i)&&(Um(i,t,this.callSetDisabledState),t.control=i))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(t){const r=this.form.get(t.path);f5(r,t),r.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(t){if(this.form){const r=this.form.get(t.path);r&&function Ewe(n,e){return Mw(n,e)}(r,t)&&r.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){OA(this.form,this),this._oldForm&&Mw(this._oldForm,this)}static \u0275fac=function(r){return new(r||n)($(yr,10),$(Wa,10),$(oh,8))};static \u0275dir=ee({type:n,selectors:[["","formGroup",""]],hostBindings:function(r,i){1&r&&Ve("submit",function(s){return i.onSubmit(s)})("reset",function(){return i.onReset()})},inputs:{form:[0,"formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[$e([Owe]),ke,ei]})}return n})();const Vwe={provide:qo,useExisting:ft(()=>$m)};let $m=(()=>{class n extends qo{_ngModelWarningConfig;_added=!1;viewModel;control;name=null;set isDisabled(t){}model;update=new nt;static _ngModelWarningSentOnce=!1;_ngModelWarningSent=!1;constructor(t,r,i,o,s){super(),this._ngModelWarningConfig=s,this._parent=t,this._setValidators(r),this._setAsyncValidators(i),this.valueAccessor=function VA(n,e){if(!e)return null;let t,r,i;return Array.isArray(e),e.forEach(o=>{o.constructor===nh?t=o:function Twe(n){return Object.getPrototypeOf(n.constructor)===Rc}(o)?r=o:i=o}),i||r||t||null}(0,o)}ngOnChanges(t){this._added||this._setUpControl(),function LA(n,e){if(!n.hasOwnProperty("model"))return!1;const t=n.model;return!!t.isFirstChange()||!Object.is(e,t.currentValue)}(t,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}get path(){return function Dw(n,e){return[...e.path,n]}(null==this.name?this.name:this.name.toString(),this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}_checkParentType(){}_setUpControl(){this.control=this.formDirective.addControl(this),this._added=!0}static \u0275fac=function(r){return new(r||n)($(zr,13),$(yr,10),$(Wa,10),$(Yi,10),$(BA,8))};static \u0275dir=ee({type:n,selectors:[["","formControlName",""]],inputs:{name:[0,"formControlName","name"],isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"]},outputs:{update:"ngModelChange"},standalone:!1,features:[$e([Vwe]),ke,ei]})}return n})(),Jwe=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({})}return n})();class L5 extends xw{constructor(e,t,r){super(NA(t),PA(r,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;at(e){return this.controls[this._adjustIndex(e)]}push(e,t={}){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}insert(e,t,r={}){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity({emitEvent:r.emitEvent})}removeAt(e,t={}){let r=this._adjustIndex(e);r<0&&(r=0),this.controls[r]&&this.controls[r]._registerOnCollectionChange(()=>{}),this.controls.splice(r,1),this.updateValueAndValidity({emitEvent:t.emitEvent})}setControl(e,t,r={}){let i=this._adjustIndex(e);i<0&&(i=0),this.controls[i]&&this.controls[i]._registerOnCollectionChange(()=>{}),this.controls.splice(i,1),t&&(this.controls.splice(i,0,t),this._registerControl(t)),this.updateValueAndValidity({emitEvent:r.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(e,t={}){u5(this,0,e),e.forEach((r,i)=>{c5(this,!1,i),this.at(i).setValue(r,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(e.forEach((r,i)=>{this.at(i)&&this.at(i).patchValue(r,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e=[],t={}){this._forEachChild((r,i)=>{r.reset(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t,this),this._updateTouched(t,this),this.updateValueAndValidity(t)}getRawValue(){return this.controls.map(e=>e.getRawValue())}clear(e={}){this.controls.length<1||(this._forEachChild(t=>t._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:e.emitEvent}))}_adjustIndex(e){return e<0?e+this.length:e}_syncPendingControls(){let e=this.controls.reduce((t,r)=>!!r._syncPendingControls()||t,!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_forEachChild(e){this.controls.forEach((t,r)=>{e(t,r)})}_updateValue(){this.value=this.controls.filter(e=>e.enabled||this.disabled).map(e=>e.value)}_anyControls(e){return this.controls.some(t=>t.enabled&&e(t))}_setUpControls(){this._forEachChild(e=>this._registerControl(e))}_allControlsDisabled(){for(const e of this.controls)if(e.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)}_find(e){return this.at(e)??null}}function V5(n){return!!n&&(void 0!==n.asyncValidators||void 0!==n.validators||void 0!==n.updateOn)}let qA,Nw=(()=>{class n{useNonNullable=!1;get nonNullable(){const t=new n;return t.useNonNullable=!0,t}group(t,r=null){const i=this._reduceControls(t);let o={};return V5(r)?o=r:null!==r&&(o.validators=r.validator,o.asyncValidators=r.asyncValidator),new Bm(i,o)}record(t,r=null){const i=this._reduceControls(t);return new d5(i,r)}control(t,r,i){let o={};return this.useNonNullable?(V5(r)?o=r:(o.validators=r,o.asyncValidators=i),new Hm(t,{...o,nonNullable:!0})):new Hm(t,r,i)}array(t,r,i){const o=t.map(s=>this._createControl(s));return new L5(o,r,i)}_reduceControls(t){const r={};return Object.keys(t).forEach(i=>{r[i]=this._createControl(t[i])}),r}_createControl(t){return t instanceof Hm||t instanceof xw?t:Array.isArray(t)?this.control(t[0],t.length>1?t[1]:null,t.length>2?t[2]:null):this.control(t)}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Pw=(()=>{class n{static withConfig(t){return{ngModule:n,providers:[{provide:BA,useValue:t.warnOnNgModelWithFormControl??"always"},{provide:oh,useValue:t.callSetDisabledState??Sw}]}}static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[Jwe]})}return n})();try{qA=typeof Intl<"u"&&Intl.v8BreakIterator}catch{qA=!1}let sh,rr=(()=>{class n{_platformId=b(Ia);isBrowser=this._platformId?function Uge(n){return n===B3}(this._platformId):"object"==typeof document&&!!document;EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent);TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent);BLINK=this.isBrowser&&!(!window.chrome&&!qA)&&typeof CSS<"u"&&!this.EDGE&&!this.TRIDENT;WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT;IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window);FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent);ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT;SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT;constructor(){}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const B5=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function U5(){if(sh)return sh;if("object"!=typeof document||!document)return sh=new Set(B5),sh;let n=document.createElement("input");return sh=new Set(B5.filter(e=>(n.setAttribute("type",e),n.type===e))),sh}let qm,kc,WA;function ah(n){return function eEe(){if(null==qm&&typeof window<"u")try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>qm=!0}))}finally{qm=qm||!1}return qm}()?n:!!n.capture}function tEe(){if(null==kc){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return kc=!1,kc;if("scrollBehavior"in document.documentElement.style)kc=!0;else{const n=Element.prototype.scrollTo;kc=!!n&&!/\{\s*\[native code\]\s*\}/.test(n.toString())}}return kc}function ks(n){return n.composedPath?n.composedPath()[0]:n.target}function z5(){return typeof __karma__<"u"&&!!__karma__||typeof jasmine<"u"&&!!jasmine||typeof jest<"u"&&!!jest||typeof Mocha<"u"&&!!Mocha}const Fw=new WeakMap;let Ka=(()=>{class n{_appRef;_injector=b(ze);_environmentInjector=b(mr);load(t){const r=this._appRef=this._appRef||this._injector.get(tr);let i=Fw.get(r);i||(i={loaders:new Set,refs:[]},Fw.set(r,i),r.onDestroy(()=>{Fw.get(r)?.refs.forEach(o=>o.destroy()),Fw.delete(r)})),i.loaders.has(t)||(i.loaders.add(t),i.refs.push(vD(t,{environmentInjector:this._environmentInjector})))}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),j5=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["ng-component"]],exportAs:["cdkVisuallyHidden"],decls:0,vars:0,template:function(r,i){},styles:[".cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none;left:0}[dir=rtl] .cdk-visually-hidden{left:auto;right:0}"],encapsulation:2,changeDetection:0})}return n})();function Lw(n,...e){return e.length?e.some(t=>n[t]):n.altKey||n.shiftKey||n.ctrlKey||n.metaKey}class EEe extends Kt{constructor(e,t){super()}schedule(e,t=0){return this}}const Vw={setInterval(n,e,...t){const{delegate:r}=Vw;return r?.setInterval?r.setInterval(n,e,...t):setInterval(n,e,...t)},clearInterval(n){const{delegate:e}=Vw;return(e?.clearInterval||clearInterval)(n)},delegate:void 0};class Bw extends EEe{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){var r;if(this.closed)return this;this.state=e;const i=this.id,o=this.scheduler;return null!=i&&(this.id=this.recycleAsyncId(o,i,t)),this.pending=!0,this.delay=t,this.id=null!==(r=this.id)&&void 0!==r?r:this.requestAsyncId(o,this.id,t),this}requestAsyncId(e,t,r=0){return Vw.setInterval(e.flush.bind(e,this),r)}recycleAsyncId(e,t,r=0){if(null!=r&&this.delay===r&&!1===this.pending)return t;null!=t&&Vw.clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let i,r=!1;try{this.work(e)}catch(o){r=!0,i=o||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),i}unsubscribe(){if(!this.closed){const{id:e,scheduler:t}=this,{actions:r}=t;this.work=this.state=this.scheduler=null,this.pending=!1,Ty(r,this),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null,super.unsubscribe()}}}const QA={now:()=>(QA.delegate||Date).now(),delegate:void 0};class Gm{constructor(e,t=Gm.now){this.schedulerActionCtor=e,this.now=t}schedule(e,t=0,r){return new this.schedulerActionCtor(this,e).schedule(r,t)}}Gm.now=QA.now;class Uw extends Gm{constructor(e,t=Gm.now){super(e,t),this.actions=[],this._active=!1}flush(e){const{actions:t}=this;if(this._active)return void t.push(e);let r;this._active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}}const zw=new Uw(Bw),IEe=zw;function W5(n,e=zw){return Jt((t,r)=>{let i=null,o=null,s=null;const a=()=>{if(i){i.unsubscribe(),i=null;const c=o;o=null,r.next(c)}};function l(){const c=s+n,u=e.now();if(u{o=c,s=e.now(),i||(i=e.schedule(l,n),r.add(i))},()=>{a(),r.complete()},void 0,()=>{o=i=null}))})}function G5(n){return si((e,t)=>n<=t)}function CEe(n,e){return n===e}let xEe=(()=>{class n{create(t){return typeof MutationObserver>"u"?null:new MutationObserver(t)}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Q5=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({providers:[xEe]})}return n})();function Qa(n){return null!=n&&"false"!=`${n}`}function Y5(n,e=0){return function SEe(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}(n)?Number(n):2===arguments.length?e:0}function jw(n){return Array.isArray(n)?n:[n]}function xn(n){return null==n?"":"string"==typeof n?n:`${n}px`}function Ya(n){return n instanceof je?n.nativeElement:n}const X5=new Set;let Nc,DEe=(()=>{class n{_platform=b(rr);_nonce=b(z0,{optional:!0});_matchMedia;constructor(){this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):REe}matchMedia(t){return(this._platform.WEBKIT||this._platform.BLINK)&&function AEe(n,e){if(!X5.has(n))try{Nc||(Nc=document.createElement("style"),e&&Nc.setAttribute("nonce",e),Nc.setAttribute("type","text/css"),document.head.appendChild(Nc)),Nc.sheet&&(Nc.sheet.insertRule(`@media ${n} {body{ }}`,0),X5.add(n))}catch(t){console.error(t)}}(t,this._nonce),this._matchMedia(t)}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function REe(n){return{matches:"all"===n||""===n,media:n,addListener:()=>{},removeListener:()=>{}}}let Z5=(()=>{class n{_mediaMatcher=b(DEe);_zone=b(ue);_queries=new Map;_destroySubject=new fe;constructor(){}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(t){return J5(jw(t)).some(i=>this._registerQuery(i).mql.matches)}observe(t){let o=JD(J5(jw(t)).map(s=>this._registerQuery(s).observable));return o=Xb(o.pipe(zo(1)),o.pipe(G5(1),W5(0))),o.pipe(Te(s=>{const a={matches:!1,breakpoints:{}};return s.forEach(({matches:l,query:c})=>{a.matches=a.matches||l,a.breakpoints[c]=l}),a}))}_registerQuery(t){if(this._queries.has(t))return this._queries.get(t);const r=this._mediaMatcher.matchMedia(t),o={observable:new vt(s=>{const a=l=>this._zone.run(()=>s.next(l));return r.addListener(a),()=>{r.removeListener(a)}}).pipe(Ec(r),Te(({matches:s})=>({query:t,matches:s})),At(this._destroySubject)),mql:r};return this._queries.set(t,o),o}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function J5(n){return n.map(e=>e.split(",")).reduce((e,t)=>e.concat(t)).map(e=>e.trim())}function Hw(n,e){return n.getAttribute(e)?.match(/\S+/g)??[]}const tW="cdk-describedby-message",$w="cdk-describedby-host";let YA=0,PEe=(()=>{class n{_platform=b(rr);_document=b(Xe);_messageRegistry=new Map;_messagesContainer=null;_id=""+YA++;constructor(){b(Ka).load(j5),this._id=b(Is)+"-"+YA++}describe(t,r,i){if(!this._canBeDescribed(t,r))return;const o=XA(r,i);"string"!=typeof r?(nW(r,this._id),this._messageRegistry.set(o,{messageElement:r,referenceCount:0})):this._messageRegistry.has(o)||this._createMessageElement(r,i),this._isElementDescribedByMessage(t,o)||this._addMessageReference(t,o)}removeDescription(t,r,i){if(!r||!this._isElementNode(t))return;const o=XA(r,i);if(this._isElementDescribedByMessage(t,o)&&this._removeMessageReference(t,o),"string"==typeof r){const s=this._messageRegistry.get(o);s&&0===s.referenceCount&&this._deleteMessageElement(o)}0===this._messagesContainer?.childNodes.length&&(this._messagesContainer.remove(),this._messagesContainer=null)}ngOnDestroy(){const t=this._document.querySelectorAll(`[${$w}="${this._id}"]`);for(let r=0;r0!=i.indexOf(tW));t.setAttribute("aria-describedby",r.join(" "))}_addMessageReference(t,r){const i=this._messageRegistry.get(r);(function kEe(n,e,t){const r=Hw(n,e);t=t.trim(),!r.some(i=>i.trim()===t)&&(r.push(t),n.setAttribute(e,r.join(" ")))})(t,"aria-describedby",i.messageElement.id),t.setAttribute($w,this._id),i.referenceCount++}_removeMessageReference(t,r){const i=this._messageRegistry.get(r);i.referenceCount--,function NEe(n,e,t){const r=Hw(n,e);t=t.trim();const i=r.filter(o=>o!==t);i.length?n.setAttribute(e,i.join(" ")):n.removeAttribute(e)}(t,"aria-describedby",i.messageElement.id),t.removeAttribute($w)}_isElementDescribedByMessage(t,r){const i=Hw(t,"aria-describedby"),o=this._messageRegistry.get(r),s=o&&o.messageElement.id;return!!s&&-1!=i.indexOf(s)}_canBeDescribed(t,r){if(!this._isElementNode(t))return!1;if(r&&"object"==typeof r)return!0;const i=null==r?"":`${r}`.trim(),o=t.getAttribute("aria-label");return!(!i||o&&o.trim()===i)}_isElementNode(t){return t.nodeType===this._document.ELEMENT_NODE}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function XA(n,e){return"string"==typeof n?`${e||""}/${n}`:n}function nW(n,e){n.id||(n.id=`${tW}-${e}-${YA++}`)}class rW{_letterKeyStream=new fe;_items=[];_selectedItemIndex=-1;_pressedLetters=[];_skipPredicateFn;_selectedItem=new fe;selectedItem=this._selectedItem;constructor(e,t){const r="number"==typeof t?.debounceInterval?t.debounceInterval:200;t?.skipPredicate&&(this._skipPredicateFn=t.skipPredicate),this.setItems(e),this._setupKeyHandler(r)}destroy(){this._pressedLetters=[],this._letterKeyStream.complete(),this._selectedItem.complete()}setCurrentSelectedItemIndex(e){this._selectedItemIndex=e}setItems(e){this._items=e}handleKey(e){const t=e.keyCode;e.key&&1===e.key.length?this._letterKeyStream.next(e.key.toLocaleUpperCase()):(t>=65&&t<=90||t>=48&&t<=57)&&this._letterKeyStream.next(String.fromCharCode(t))}isTyping(){return this._pressedLetters.length>0}reset(){this._pressedLetters=[]}_setupKeyHandler(e){this._letterKeyStream.pipe(Bn(t=>this._pressedLetters.push(t)),W5(e),si(()=>this._pressedLetters.length>0),Te(()=>this._pressedLetters.join("").toLocaleUpperCase())).subscribe(t=>{for(let r=1;re.disabled;constructor(e,t){this._items=e,e instanceof dp?this._itemChangesSubscription=e.changes.subscribe(r=>this._itemsChanged(r.toArray())):up(e)&&(this._effectRef=pm(()=>this._itemsChanged(e()),{injector:t}))}tabOut=new fe;change=new fe;skipPredicate(e){return this._skipPredicateFn=e,this}withWrap(e=!0){return this._wrap=e,this}withVerticalOrientation(e=!0){return this._vertical=e,this}withHorizontalOrientation(e){return this._horizontal=e,this}withAllowedModifierKeys(e){return this._allowedModifierKeys=e,this}withTypeAhead(e=200){this._typeaheadSubscription.unsubscribe();const t=this._getItemsArray();return this._typeahead=new rW(t,{debounceInterval:"number"==typeof e?e:void 0,skipPredicate:r=>this._skipPredicateFn(r)}),this._typeaheadSubscription=this._typeahead.selectedItem.subscribe(r=>{this.setActiveItem(r)}),this}cancelTypeahead(){return this._typeahead?.reset(),this}withHomeAndEnd(e=!0){return this._homeAndEnd=e,this}withPageUpDown(e=!0,t=10){return this._pageUpAndDown={enabled:e,delta:t},this}setActiveItem(e){const t=this._activeItem();this.updateActiveItem(e),this._activeItem()!==t&&this.change.next(this._activeItemIndex)}onKeydown(e){const t=e.keyCode,i=["altKey","ctrlKey","metaKey","shiftKey"].every(o=>!e[o]||this._allowedModifierKeys.indexOf(o)>-1);switch(t){case 9:return void this.tabOut.next();case 40:if(this._vertical&&i){this.setNextItemActive();break}return;case 38:if(this._vertical&&i){this.setPreviousItemActive();break}return;case 39:if(this._horizontal&&i){"rtl"===this._horizontal?this.setPreviousItemActive():this.setNextItemActive();break}return;case 37:if(this._horizontal&&i){"rtl"===this._horizontal?this.setNextItemActive():this.setPreviousItemActive();break}return;case 36:if(this._homeAndEnd&&i){this.setFirstItemActive();break}return;case 35:if(this._homeAndEnd&&i){this.setLastItemActive();break}return;case 33:if(this._pageUpAndDown.enabled&&i){const o=this._activeItemIndex-this._pageUpAndDown.delta;this._setActiveItemByIndex(o>0?o:0,1);break}return;case 34:if(this._pageUpAndDown.enabled&&i){const o=this._activeItemIndex+this._pageUpAndDown.delta,s=this._getItemsArray().length;this._setActiveItemByIndex(o-1&&r!==this._activeItemIndex&&(this._activeItemIndex=r,this._typeahead?.setCurrentSelectedItemIndex(r))}}}class LEe extends FEe{_origin="program";setFocusOrigin(e){return this._origin=e,this}setActiveItem(e){super.setActiveItem(e),this.activeItem&&this.activeItem.focus(this._origin)}}function aW(n){return 0===n.buttons||0===n.detail}function lW(n){const e=n.touches&&n.touches[0]||n.changedTouches&&n.changedTouches[0];return!(!e||-1!==e.identifier||null!=e.radiusX&&1!==e.radiusX||null!=e.radiusY&&1!==e.radiusY)}const GEe=new B("cdk-input-modality-detector-options"),KEe={ignoreKeys:[18,17,224,91,16]},ch=ah({passive:!0,capture:!0});let QEe=(()=>{class n{_platform=b(rr);modalityDetected;modalityChanged;get mostRecentModality(){return this._modality.value}_mostRecentTarget=null;_modality=new mi(null);_options;_lastTouchMs=0;_onKeydown=t=>{this._options?.ignoreKeys?.some(r=>r===t.keyCode)||(this._modality.next("keyboard"),this._mostRecentTarget=ks(t))};_onMousedown=t=>{Date.now()-this._lastTouchMs<650||(this._modality.next(aW(t)?"keyboard":"mouse"),this._mostRecentTarget=ks(t))};_onTouchstart=t=>{lW(t)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=ks(t))};constructor(){const t=b(ue),r=b(Xe),i=b(GEe,{optional:!0});this._options={...KEe,...i},this.modalityDetected=this._modality.pipe(G5(1)),this.modalityChanged=this.modalityDetected.pipe(function TEe(n,e=ma){return n=n??CEe,Jt((t,r)=>{let i,o=!0;t.subscribe(zt(r,s=>{const a=e(s);(o||!n(i,a))&&(o=!1,i=a,r.next(s))}))})}()),this._platform.isBrowser&&t.runOutsideAngular(()=>{r.addEventListener("keydown",this._onKeydown,ch),r.addEventListener("mousedown",this._onMousedown,ch),r.addEventListener("touchstart",this._onTouchstart,ch)})}ngOnDestroy(){this._modality.complete(),this._platform.isBrowser&&(document.removeEventListener("keydown",this._onKeydown,ch),document.removeEventListener("mousedown",this._onMousedown,ch),document.removeEventListener("touchstart",this._onTouchstart,ch))}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const YEe=new B("liveAnnouncerElement",{providedIn:"root",factory:function XEe(){return null}}),ZEe=new B("LIVE_ANNOUNCER_DEFAULT_OPTIONS");let JEe=0,eIe=(()=>{class n{_ngZone=b(ue);_defaultOptions=b(ZEe,{optional:!0});_liveElement;_document=b(Xe);_previousTimeout;_currentPromise;_currentResolve;constructor(){const t=b(YEe,{optional:!0});this._liveElement=t||this._createLiveElement()}announce(t,...r){const i=this._defaultOptions;let o,s;return 1===r.length&&"number"==typeof r[0]?s=r[0]:[o,s]=r,this.clear(),clearTimeout(this._previousTimeout),o||(o=i&&i.politeness?i.politeness:"polite"),null==s&&i&&(s=i.duration),this._liveElement.setAttribute("aria-live",o),this._liveElement.id&&this._exposeAnnouncerToModals(this._liveElement.id),this._ngZone.runOutsideAngular(()=>(this._currentPromise||(this._currentPromise=new Promise(a=>this._currentResolve=a)),clearTimeout(this._previousTimeout),this._previousTimeout=setTimeout(()=>{this._liveElement.textContent=t,"number"==typeof s&&(this._previousTimeout=setTimeout(()=>this.clear(),s)),this._currentResolve?.(),this._currentPromise=this._currentResolve=void 0},100),this._currentPromise))}clear(){this._liveElement&&(this._liveElement.textContent="")}ngOnDestroy(){clearTimeout(this._previousTimeout),this._liveElement?.remove(),this._liveElement=null,this._currentResolve?.(),this._currentPromise=this._currentResolve=void 0}_createLiveElement(){const t="cdk-live-announcer-element",r=this._document.getElementsByClassName(t),i=this._document.createElement("div");for(let o=0;o .cdk-overlay-container [aria-modal="true"]');for(let i=0;i{class n{_ngZone=b(ue);_platform=b(rr);_inputModalityDetector=b(QEe);_origin=null;_lastFocusOrigin;_windowFocused=!1;_windowFocusTimeoutId;_originTimeoutId;_originFromTouchInteraction=!1;_elementInfo=new Map;_monitoredElementCount=0;_rootNodeFocusListenerCount=new Map;_detectionMode;_windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=setTimeout(()=>this._windowFocused=!1)};_document=b(Xe,{optional:!0});_stopInputModalityDetector=new fe;constructor(){const t=b(tIe,{optional:!0});this._detectionMode=t?.detectionMode||qw.IMMEDIATE}_rootNodeFocusAndBlurListener=t=>{for(let i=ks(t);i;i=i.parentElement)"focus"===t.type?this._onFocus(t,i):this._onBlur(t,i)};monitor(t,r=!1){const i=Ya(t);if(!this._platform.isBrowser||1!==i.nodeType)return de();const o=function rEe(n){if(function nEe(){if(null==WA){const n=typeof document<"u"?document.head:null;WA=!(!n||!n.createShadowRoot&&!n.attachShadow)}return WA}()){const e=n.getRootNode?n.getRootNode():null;if(typeof ShadowRoot<"u"&&ShadowRoot&&e instanceof ShadowRoot)return e}return null}(i)||this._getDocument(),s=this._elementInfo.get(i);if(s)return r&&(s.checkChildren=!0),s.subject;const a={checkChildren:r,subject:new fe,rootNode:o};return this._elementInfo.set(i,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(t){const r=Ya(t),i=this._elementInfo.get(r);i&&(i.subject.complete(),this._setClasses(r),this._elementInfo.delete(r),this._removeGlobalListeners(i))}focusVia(t,r,i){const o=Ya(t);o===this._getDocument().activeElement?this._getClosestElementsInfo(o).forEach(([a,l])=>this._originChanged(a,r,l)):(this._setOrigin(r),"function"==typeof o.focus&&o.focus(i))}ngOnDestroy(){this._elementInfo.forEach((t,r)=>this.stopMonitoring(r))}_getDocument(){return this._document||document}_getWindow(){return this._getDocument().defaultView||window}_getFocusOrigin(t){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(t)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:t&&this._isLastInteractionFromInputLabel(t)?"mouse":"program"}_shouldBeAttributedToTouch(t){return this._detectionMode===qw.EVENTUAL||!!t?.contains(this._inputModalityDetector._mostRecentTarget)}_setClasses(t,r){t.classList.toggle("cdk-focused",!!r),t.classList.toggle("cdk-touch-focused","touch"===r),t.classList.toggle("cdk-keyboard-focused","keyboard"===r),t.classList.toggle("cdk-mouse-focused","mouse"===r),t.classList.toggle("cdk-program-focused","program"===r)}_setOrigin(t,r=!1){this._ngZone.runOutsideAngular(()=>{this._origin=t,this._originFromTouchInteraction="touch"===t&&r,this._detectionMode===qw.IMMEDIATE&&(clearTimeout(this._originTimeoutId),this._originTimeoutId=setTimeout(()=>this._origin=null,this._originFromTouchInteraction?650:1))})}_onFocus(t,r){const i=this._elementInfo.get(r),o=ks(t);!i||!i.checkChildren&&r!==o||this._originChanged(r,this._getFocusOrigin(o),i)}_onBlur(t,r){const i=this._elementInfo.get(r);!i||i.checkChildren&&t.relatedTarget instanceof Node&&r.contains(t.relatedTarget)||(this._setClasses(r),this._emitOrigin(i,null))}_emitOrigin(t,r){t.subject.observers.length&&this._ngZone.run(()=>t.subject.next(r))}_registerGlobalListeners(t){if(!this._platform.isBrowser)return;const r=t.rootNode,i=this._rootNodeFocusListenerCount.get(r)||0;i||this._ngZone.runOutsideAngular(()=>{r.addEventListener("focus",this._rootNodeFocusAndBlurListener,Ww),r.addEventListener("blur",this._rootNodeFocusAndBlurListener,Ww)}),this._rootNodeFocusListenerCount.set(r,i+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(At(this._stopInputModalityDetector)).subscribe(o=>{this._setOrigin(o,!0)}))}_removeGlobalListeners(t){const r=t.rootNode;if(this._rootNodeFocusListenerCount.has(r)){const i=this._rootNodeFocusListenerCount.get(r);i>1?this._rootNodeFocusListenerCount.set(r,i-1):(r.removeEventListener("focus",this._rootNodeFocusAndBlurListener,Ww),r.removeEventListener("blur",this._rootNodeFocusAndBlurListener,Ww),this._rootNodeFocusListenerCount.delete(r))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(t,r,i){this._setClasses(t,r),this._emitOrigin(i,r),this._lastFocusOrigin=r}_getClosestElementsInfo(t){const r=[];return this._elementInfo.forEach((i,o)=>{(o===t||i.checkChildren&&o.contains(t))&&r.push([o,i])}),r}_isLastInteractionFromInputLabel(t){const{_mostRecentTarget:r,mostRecentModality:i}=this._inputModalityDetector;if("mouse"!==i||!r||r===t||"INPUT"!==t.nodeName&&"TEXTAREA"!==t.nodeName||t.disabled)return!1;const o=t.labels;if(o)for(let s=0;s{class n{_platform=b(rr);_hasCheckedHighContrastMode;_document=b(Xe);_breakpointSubscription;constructor(){this._breakpointSubscription=b(Z5).observe("(forced-colors: active)").subscribe(()=>{this._hasCheckedHighContrastMode&&(this._hasCheckedHighContrastMode=!1,this._applyBodyHighContrastModeCssClasses())})}getHighContrastMode(){if(!this._platform.isBrowser)return Pc.NONE;const t=this._document.createElement("div");t.style.backgroundColor="rgb(1,2,3)",t.style.position="absolute",this._document.body.appendChild(t);const r=this._document.defaultView||window,i=r&&r.getComputedStyle?r.getComputedStyle(t):null,o=(i&&i.backgroundColor||"").replace(/ /g,"");switch(t.remove(),o){case"rgb(0,0,0)":case"rgb(45,50,54)":case"rgb(32,32,32)":return Pc.WHITE_ON_BLACK;case"rgb(255,255,255)":case"rgb(255,250,239)":return Pc.BLACK_ON_WHITE}return Pc.NONE}ngOnDestroy(){this._breakpointSubscription.unsubscribe()}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){const t=this._document.body.classList;t.remove(JA,uW,dW),this._hasCheckedHighContrastMode=!0;const r=this.getHighContrastMode();r===Pc.BLACK_ON_WHITE?t.add(JA,uW):r===Pc.WHITE_ON_BLACK&&t.add(JA,dW)}}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),nIe=(()=>{class n{constructor(){b(hW)._applyBodyHighContrastModeCssClasses()}static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[Q5]})}return n})();const eR={};let Xa=(()=>{class n{_appId=b(Is);getId(t){return"ng"!==this._appId&&(t+=this._appId),eR.hasOwnProperty(t)||(eR[t]=0),`${t}${eR[t]++}`}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const rIe=new B("cdk-dir-doc",{providedIn:"root",factory:function iIe(){return b(Xe)}}),oIe=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;let Gw=(()=>{class n{value="ltr";change=new nt;constructor(){const t=b(rIe,{optional:!0});t&&(this.value=function sIe(n){const e=n?.toLowerCase()||"";return"auto"===e&&typeof navigator<"u"&&navigator?.language?oIe.test(navigator.language)?"rtl":"ltr":"rtl"===e?"rtl":"ltr"}((t.body?t.body.dir:null)||(t.documentElement?t.documentElement.dir:null)||"ltr"))}ngOnDestroy(){this.change.complete()}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Km=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({})}return n})(),gn=(()=>{class n{constructor(){b(hW)._applyBodyHighContrastModeCssClasses()}static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[Km,Km]})}return n})();class fW{_defaultMatcher;ngControl;_parentFormGroup;_parentForm;_stateChanges;errorState=!1;matcher;constructor(e,t,r,i,o){this._defaultMatcher=e,this.ngControl=t,this._parentFormGroup=r,this._parentForm=i,this._stateChanges=o}updateErrorState(){const e=this.errorState,t=this._parentFormGroup||this._parentForm,r=this.matcher||this._defaultMatcher,i=this.ngControl?this.ngControl.control:null,o=r?.isErrorState(i,t)??!1;o!==e&&(this.errorState=o,this._stateChanges.next())}}let tR=(()=>{class n{isErrorState(t,r){return!!(t&&t.invalid&&(t.touched||r&&r.submitted))}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),nR=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["structural-styles"]],decls:0,vars:0,template:function(r,i){},styles:['.mat-focus-indicator{position:relative}.mat-focus-indicator::before{top:0;left:0;right:0;bottom:0;position:absolute;box-sizing:border-box;pointer-events:none;display:var(--mat-focus-indicator-display, none);border-width:var(--mat-focus-indicator-border-width, 3px);border-style:var(--mat-focus-indicator-border-style, solid);border-color:var(--mat-focus-indicator-border-color, transparent);border-radius:var(--mat-focus-indicator-border-radius, 4px)}.mat-focus-indicator:focus::before{content:""}@media(forced-colors: active){html{--mat-focus-indicator-display: block}}'],encapsulation:2,changeDetection:0})}return n})();var Xi=function(n){return n[n.FADING_IN=0]="FADING_IN",n[n.VISIBLE=1]="VISIBLE",n[n.FADING_OUT=2]="FADING_OUT",n[n.HIDDEN=3]="HIDDEN",n}(Xi||{});class hIe{_renderer;element;config;_animationForciblyDisabledThroughCss;state=Xi.HIDDEN;constructor(e,t,r,i=!1){this._renderer=e,this.element=t,this.config=r,this._animationForciblyDisabledThroughCss=i}fadeOut(){this._renderer.fadeOutRipple(this)}}const pW=ah({passive:!0,capture:!0});class fIe{_events=new Map;addHandler(e,t,r,i){const o=this._events.get(t);if(o){const s=o.get(r);s?s.add(i):o.set(r,new Set([i]))}else this._events.set(t,new Map([[r,new Set([i])]])),e.runOutsideAngular(()=>{document.addEventListener(t,this._delegateEventHandler,pW)})}removeHandler(e,t,r){const i=this._events.get(e);if(!i)return;const o=i.get(t);o&&(o.delete(r),0===o.size&&i.delete(t),0===i.size&&(this._events.delete(e),document.removeEventListener(e,this._delegateEventHandler,pW)))}_delegateEventHandler=e=>{const t=ks(e);t&&this._events.get(e.type)?.forEach((r,i)=>{(i===t||i.contains(t))&&r.forEach(o=>o.handleEvent(e))})}}const Kw={enterDuration:225,exitDuration:150},mW=ah({passive:!0,capture:!0}),gW=["mousedown","touchstart"],_W=["mouseup","mouseleave","touchend","touchcancel"];let mIe=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["ng-component"]],hostAttrs:["mat-ripple-style-loader",""],decls:0,vars:0,template:function(r,i){},styles:[".mat-ripple{overflow:hidden;position:relative}.mat-ripple:not(:empty){transform:translateZ(0)}.mat-ripple.mat-ripple-unbounded{overflow:visible}.mat-ripple-element{position:absolute;border-radius:50%;pointer-events:none;transition:opacity,transform 0ms cubic-bezier(0, 0, 0.2, 1);transform:scale3d(0, 0, 0);background-color:var(--mat-ripple-color, color-mix(in srgb, var(--mat-sys-on-surface) 10%, transparent))}@media(forced-colors: active){.mat-ripple-element{display:none}}.cdk-drag-preview .mat-ripple-element,.cdk-drag-placeholder .mat-ripple-element{display:none}"],encapsulation:2,changeDetection:0})}return n})();class Qw{_target;_ngZone;_platform;_containerElement;_triggerElement;_isPointerDown=!1;_activeRipples=new Map;_mostRecentTransientRipple;_lastTouchStartEvent;_pointerUpEventsRegistered=!1;_containerRect;static _eventManager=new fIe;constructor(e,t,r,i,o){this._target=e,this._ngZone=t,this._platform=i,i.isBrowser&&(this._containerElement=Ya(r)),o&&o.get(Ka).load(mIe)}fadeInRipple(e,t,r={}){const i=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),o={...Kw,...r.animation};r.centered&&(e=i.left+i.width/2,t=i.top+i.height/2);const s=r.radius||function gIe(n,e,t){const r=Math.max(Math.abs(n-t.left),Math.abs(n-t.right)),i=Math.max(Math.abs(e-t.top),Math.abs(e-t.bottom));return Math.sqrt(r*r+i*i)}(e,t,i),a=e-i.left,l=t-i.top,c=o.enterDuration,u=document.createElement("div");u.classList.add("mat-ripple-element"),u.style.left=a-s+"px",u.style.top=l-s+"px",u.style.height=2*s+"px",u.style.width=2*s+"px",null!=r.color&&(u.style.backgroundColor=r.color),u.style.transitionDuration=`${c}ms`,this._containerElement.appendChild(u);const d=window.getComputedStyle(u),p=d.transitionDuration,m="none"===d.transitionProperty||"0s"===p||"0s, 0s"===p||0===i.width&&0===i.height,_=new hIe(this,u,r,m);u.style.transform="scale3d(1, 1, 1)",_.state=Xi.FADING_IN,r.persistent||(this._mostRecentTransientRipple=_);let v=null;return!m&&(c||o.exitDuration)&&this._ngZone.runOutsideAngular(()=>{const E=()=>{v&&(v.fallbackTimer=null),clearTimeout(R),this._finishRippleTransition(_)},C=()=>this._destroyRipple(_),R=setTimeout(C,c+100);u.addEventListener("transitionend",E),u.addEventListener("transitioncancel",C),v={onTransitionEnd:E,onTransitionCancel:C,fallbackTimer:R}}),this._activeRipples.set(_,v),(m||!c)&&this._finishRippleTransition(_),_}fadeOutRipple(e){if(e.state===Xi.FADING_OUT||e.state===Xi.HIDDEN)return;const t=e.element,r={...Kw,...e.config.animation};t.style.transitionDuration=`${r.exitDuration}ms`,t.style.opacity="0",e.state=Xi.FADING_OUT,(e._animationForciblyDisabledThroughCss||!r.exitDuration)&&this._finishRippleTransition(e)}fadeOutAll(){this._getActiveRipples().forEach(e=>e.fadeOut())}fadeOutAllNonPersistent(){this._getActiveRipples().forEach(e=>{e.config.persistent||e.fadeOut()})}setupTriggerEvents(e){const t=Ya(e);!this._platform.isBrowser||!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,gW.forEach(r=>{Qw._eventManager.addHandler(this._ngZone,r,t,this)}))}handleEvent(e){"mousedown"===e.type?this._onMousedown(e):"touchstart"===e.type?this._onTouchStart(e):this._onPointerUp(),this._pointerUpEventsRegistered||(this._ngZone.runOutsideAngular(()=>{_W.forEach(t=>{this._triggerElement.addEventListener(t,this,mW)})}),this._pointerUpEventsRegistered=!0)}_finishRippleTransition(e){e.state===Xi.FADING_IN?this._startFadeOutTransition(e):e.state===Xi.FADING_OUT&&this._destroyRipple(e)}_startFadeOutTransition(e){const t=e===this._mostRecentTransientRipple,{persistent:r}=e.config;e.state=Xi.VISIBLE,!r&&(!t||!this._isPointerDown)&&e.fadeOut()}_destroyRipple(e){const t=this._activeRipples.get(e)??null;this._activeRipples.delete(e),this._activeRipples.size||(this._containerRect=null),e===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),e.state=Xi.HIDDEN,null!==t&&(e.element.removeEventListener("transitionend",t.onTransitionEnd),e.element.removeEventListener("transitioncancel",t.onTransitionCancel),null!==t.fallbackTimer&&clearTimeout(t.fallbackTimer)),e.element.remove()}_onMousedown(e){const t=aW(e),r=this._lastTouchStartEvent&&Date.now(){!e.config.persistent&&(e.state===Xi.VISIBLE||e.config.terminateOnPointerUp&&e.state===Xi.FADING_IN)&&e.fadeOut()}))}_getActiveRipples(){return Array.from(this._activeRipples.keys())}_removeTriggerEvents(){const e=this._triggerElement;e&&(gW.forEach(t=>Qw._eventManager.removeHandler(t,e,this)),this._pointerUpEventsRegistered&&(_W.forEach(t=>e.removeEventListener(t,this,mW)),this._pointerUpEventsRegistered=!1))}}const yW=new B("mat-ripple-global-options");let vW=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[gn,gn]})}return n})();const bW={capture:!0},wW=["focus","mousedown","mouseenter","touchstart"],rR="mat-ripple-loader-uninitialized",iR="mat-ripple-loader-class-name",EW="mat-ripple-loader-centered",Yw="mat-ripple-loader-disabled";let IW=(()=>{class n{_document=b(Xe,{optional:!0});_animationMode=b(Ts,{optional:!0});_globalRippleOptions=b(yW,{optional:!0});_platform=b(rr);_ngZone=b(ue);_injector=b(ze);_hosts=new Map;constructor(){this._ngZone.runOutsideAngular(()=>{for(const t of wW)this._document?.addEventListener(t,this._onInteraction,bW)})}ngOnDestroy(){const t=this._hosts.keys();for(const r of t)this.destroyRipple(r);for(const r of wW)this._document?.removeEventListener(r,this._onInteraction,bW)}configureRipple(t,r){t.setAttribute(rR,this._globalRippleOptions?.namespace??""),(r.className||!t.hasAttribute(iR))&&t.setAttribute(iR,r.className||""),r.centered&&t.setAttribute(EW,""),r.disabled&&t.setAttribute(Yw,"")}setDisabled(t,r){const i=this._hosts.get(t);i?(i.target.rippleDisabled=r,!r&&!i.hasSetUpEvents&&(i.hasSetUpEvents=!0,i.renderer.setupTriggerEvents(t))):r?t.setAttribute(Yw,""):t.removeAttribute(Yw)}_onInteraction=t=>{const r=ks(t);if(r instanceof HTMLElement){const i=r.closest(`[${rR}="${this._globalRippleOptions?.namespace??""}"]`);i&&this._createRipple(i)}};_createRipple(t){if(!this._document||this._hosts.has(t))return;t.querySelector(".mat-ripple")?.remove();const r=this._document.createElement("span");r.classList.add("mat-ripple",t.getAttribute(iR)),t.append(r);const i="NoopAnimations"===this._animationMode,o=this._globalRippleOptions,s=i?0:o?.animation?.enterDuration??Kw.enterDuration,a=i?0:o?.animation?.exitDuration??Kw.exitDuration,l={rippleDisabled:i||o?.disabled||t.hasAttribute(Yw),rippleConfig:{centered:t.hasAttribute(EW),terminateOnPointerUp:o?.terminateOnPointerUp,animation:{enterDuration:s,exitDuration:a}}},c=new Qw(l,this._ngZone,r,this._platform,this._injector),u=!l.rippleDisabled;u&&c.setupTriggerEvents(t),this._hosts.set(t,{target:l,renderer:c,hasSetUpEvents:u}),t.removeAttribute(rR)}destroyRipple(t){const r=this._hosts.get(t);r&&(r.renderer._removeTriggerEvents(),this._hosts.delete(t))}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const _Ie=["*"],bIe=[[["","mat-card-avatar",""],["","matCardAvatar",""]],[["mat-card-title"],["mat-card-subtitle"],["","mat-card-title",""],["","mat-card-subtitle",""],["","matCardTitle",""],["","matCardSubtitle",""]],"*"],wIe=["[mat-card-avatar], [matCardAvatar]","mat-card-title, mat-card-subtitle,\n [mat-card-title], [mat-card-subtitle],\n [matCardTitle], [matCardSubtitle]","*"],EIe=new B("MAT_CARD_CONFIG");let Xw=(()=>{class n{appearance;constructor(){const t=b(EIe,{optional:!0});this.appearance=t?.appearance||"raised"}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-card"]],hostAttrs:[1,"mat-mdc-card","mdc-card"],hostVars:4,hostBindings:function(r,i){2&r&&at("mat-mdc-card-outlined","outlined"===i.appearance)("mdc-card--outlined","outlined"===i.appearance)},inputs:{appearance:"appearance"},exportAs:["matCard"],ngContentSelectors:_Ie,decls:1,vars:0,template:function(r,i){1&r&&(Hn(),Ae(0))},styles:['.mat-mdc-card{display:flex;flex-direction:column;box-sizing:border-box;position:relative;border-style:solid;border-width:0;background-color:var(--mdc-elevated-card-container-color, var(--mat-sys-surface-container-low));border-color:var(--mdc-elevated-card-container-color, var(--mat-sys-surface-container-low));border-radius:var(--mdc-elevated-card-container-shape, var(--mat-sys-corner-medium));box-shadow:var(--mdc-elevated-card-container-elevation, var(--mat-sys-level1))}.mat-mdc-card::after{position:absolute;top:0;left:0;width:100%;height:100%;border:solid 1px rgba(0,0,0,0);content:"";display:block;pointer-events:none;box-sizing:border-box;border-radius:var(--mdc-elevated-card-container-shape, var(--mat-sys-corner-medium))}.mat-mdc-card-outlined{background-color:var(--mdc-outlined-card-container-color, var(--mat-sys-surface));border-radius:var(--mdc-outlined-card-container-shape, var(--mat-sys-corner-medium));border-width:var(--mdc-outlined-card-outline-width, 1px);border-color:var(--mdc-outlined-card-outline-color, var(--mat-sys-outline-variant));box-shadow:var(--mdc-outlined-card-container-elevation, var(--mat-sys-level0))}.mat-mdc-card-outlined::after{border:none}.mdc-card__media{position:relative;box-sizing:border-box;background-repeat:no-repeat;background-position:center;background-size:cover}.mdc-card__media::before{display:block;content:""}.mdc-card__media:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.mdc-card__media:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.mat-mdc-card-actions{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;min-height:52px;padding:8px}.mat-mdc-card-title{font-family:var(--mat-card-title-text-font, var(--mat-sys-title-large-font));line-height:var(--mat-card-title-text-line-height, var(--mat-sys-title-large-line-height));font-size:var(--mat-card-title-text-size, var(--mat-sys-title-large-size));letter-spacing:var(--mat-card-title-text-tracking, var(--mat-sys-title-large-tracking));font-weight:var(--mat-card-title-text-weight, var(--mat-sys-title-large-weight))}.mat-mdc-card-subtitle{color:var(--mat-card-subtitle-text-color, var(--mat-sys-on-surface));font-family:var(--mat-card-subtitle-text-font, var(--mat-sys-title-medium-font));line-height:var(--mat-card-subtitle-text-line-height, var(--mat-sys-title-medium-line-height));font-size:var(--mat-card-subtitle-text-size, var(--mat-sys-title-medium-size));letter-spacing:var(--mat-card-subtitle-text-tracking, var(--mat-sys-title-medium-tracking));font-weight:var(--mat-card-subtitle-text-weight, var(--mat-sys-title-medium-weight))}.mat-mdc-card-title,.mat-mdc-card-subtitle{display:block;margin:0}.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-title,.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-subtitle{padding:16px 16px 0}.mat-mdc-card-header{display:flex;padding:16px 16px 0}.mat-mdc-card-content{display:block;padding:0 16px}.mat-mdc-card-content:first-child{padding-top:16px}.mat-mdc-card-content:last-child{padding-bottom:16px}.mat-mdc-card-title-group{display:flex;justify-content:space-between;width:100%}.mat-mdc-card-avatar{height:40px;width:40px;border-radius:50%;flex-shrink:0;margin-bottom:16px;object-fit:cover}.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-subtitle,.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-title{line-height:normal}.mat-mdc-card-sm-image{width:80px;height:80px}.mat-mdc-card-md-image{width:112px;height:112px}.mat-mdc-card-lg-image{width:152px;height:152px}.mat-mdc-card-xl-image{width:240px;height:240px}.mat-mdc-card-subtitle~.mat-mdc-card-title,.mat-mdc-card-title~.mat-mdc-card-subtitle,.mat-mdc-card-header .mat-mdc-card-header-text .mat-mdc-card-title,.mat-mdc-card-header .mat-mdc-card-header-text .mat-mdc-card-subtitle,.mat-mdc-card-title-group .mat-mdc-card-title,.mat-mdc-card-title-group .mat-mdc-card-subtitle{padding-top:0}.mat-mdc-card-content>:last-child:not(.mat-mdc-card-footer){margin-bottom:0}.mat-mdc-card-actions-align-end{justify-content:flex-end}'],encapsulation:2,changeDetection:0})}return n})(),Zw=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["mat-card-title"],["","mat-card-title",""],["","matCardTitle",""]],hostAttrs:[1,"mat-mdc-card-title"]})}return n})(),Jw=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["mat-card-content"]],hostAttrs:[1,"mat-mdc-card-content"]})}return n})(),eE=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-card-header"]],hostAttrs:[1,"mat-mdc-card-header"],ngContentSelectors:wIe,decls:4,vars:0,consts:[[1,"mat-mdc-card-header-text"]],template:function(r,i){1&r&&(Hn(bIe),Ae(0),W(1,"div",0),Ae(2,1),K(),Ae(3,2))},encapsulation:2,changeDetection:0})}return n})(),oR=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[gn,gn]})}return n})();function Ym(...n){const e=bm(n),t=function kye(n,e){return"number"==typeof ZD(n)?n.pop():e}(n,1/0),r=n;return r.length?1===r.length?oi(r[0]):Yb(t)(nr(r,e)):Di}class SIe extends fe{constructor(e=1/0,t=1/0,r=QA){super(),this._bufferSize=e,this._windowTime=t,this._timestampProvider=r,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=t===1/0,this._bufferSize=Math.max(1,e),this._windowTime=Math.max(1,t)}next(e){const{isStopped:t,_buffer:r,_infiniteTimeWindow:i,_timestampProvider:o,_windowTime:s}=this;t||(r.push(e),!i&&r.push(o.now()+s)),this._trimBuffer(),super.next(e)}_subscribe(e){this._throwIfClosed(),this._trimBuffer();const t=this._innerSubscribe(e),{_infiniteTimeWindow:r,_buffer:i}=this,o=i.slice();for(let s=0;snew fe,resetOnError:t=!0,resetOnComplete:r=!0,resetOnRefCountZero:i=!0}=n;return o=>{let s,a,l,c=0,u=!1,d=!1;const f=()=>{a?.unsubscribe(),a=void 0},p=()=>{f(),s=l=void 0,u=d=!1},m=()=>{const _=s;p(),_?.unsubscribe()};return Jt((_,v)=>{c++,!d&&!u&&f();const E=l=l??e();v.add(()=>{c--,0===c&&!d&&!u&&(a=sR(m,i))}),E.subscribe(v),!s&&c>0&&(s=new Gf({next:C=>E.next(C),error:C=>{d=!0,f(),a=sR(p,t,C),E.error(C)},complete:()=>{u=!0,f(),a=sR(p,r),E.complete()}}),oi(_).subscribe(s))})(o)}}function sR(n,e,...t){if(!0===e)return void n();if(!1===e)return;const r=new Gf({next:()=>{r.unsubscribe(),n()}});return oi(e(...t)).subscribe(r)}class AIe{_box;_destroyed=new fe;_resizeSubject=new fe;_resizeObserver;_elementObservables=new Map;constructor(e){this._box=e,typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(t=>this._resizeSubject.next(t)))}observe(e){return this._elementObservables.has(e)||this._elementObservables.set(e,new vt(t=>{const r=this._resizeSubject.subscribe(t);return this._resizeObserver?.observe(e,{box:this._box}),()=>{this._resizeObserver?.unobserve(e),r.unsubscribe(),this._elementObservables.delete(e)}}).pipe(si(t=>t.some(r=>r.target===e)),function DIe(n,e,t){let r,i=!1;return n&&"object"==typeof n?({bufferSize:r=1/0,windowTime:e=1/0,refCount:i=!1,scheduler:t}=n):r=n??1/0,TW({connector:()=>new SIe(r,e,t),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}({bufferSize:1,refCount:!0}),At(this._destroyed))),this._elementObservables.get(e)}destroy(){this._destroyed.next(),this._destroyed.complete(),this._resizeSubject.complete(),this._elementObservables.clear()}}let RIe=(()=>{class n{_cleanupErrorListener;_observers=new Map;_ngZone=b(ue);constructor(){}ngOnDestroy(){for(const[,t]of this._observers)t.destroy();this._observers.clear(),this._cleanupErrorListener?.()}observe(t,r){const i=r?.box||"content-box";return this._observers.has(i)||this._observers.set(i,new AIe(i)),this._observers.get(i).observe(t)}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var we=function(n){return n[n.State=0]="State",n[n.Transition=1]="Transition",n[n.Sequence=2]="Sequence",n[n.Group=3]="Group",n[n.Animate=4]="Animate",n[n.Keyframes=5]="Keyframes",n[n.Style=6]="Style",n[n.Trigger=7]="Trigger",n[n.Reference=8]="Reference",n[n.AnimateChild=9]="AnimateChild",n[n.AnimateRef=10]="AnimateRef",n[n.Query=11]="Query",n[n.Stagger=12]="Stagger",n}(we||{});const Ns="*";function aR(n,e){return{type:we.Trigger,name:n,definitions:e,options:{}}}function Xm(n,e=null){return{type:we.Animate,styles:e,timings:n}}function Ps(n){return{type:we.Style,styles:n,offset:null}}function Zm(n,e,t){return{type:we.State,name:n,styles:e,options:t}}function Jm(n,e,t=null){return{type:we.Transition,expr:n,animation:e,options:t}}class eg{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(e=0,t=0){this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(r=>r()),t.length=0}}class CW{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(e){this.players=e;let t=0,r=0,i=0;const o=this.players.length;0==o?queueMicrotask(()=>this._onFinish()):this.players.forEach(s=>{s.onDone(()=>{++t==o&&this._onFinish()}),s.onDestroy(()=>{++r==o&&this._onDestroy()}),s.onStart(()=>{++i==o&&this._onStart()})}),this.totalTime=this.players.reduce((s,a)=>Math.max(s,a.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this.players.forEach(e=>e.init())}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(e=>e()),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(e=>e.play())}pause(){this.players.forEach(e=>e.pause())}restart(){this.players.forEach(e=>e.restart())}finish(){this._onFinish(),this.players.forEach(e=>e.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(e=>e.destroy()),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this.players.forEach(e=>e.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){const t=e*this.totalTime;this.players.forEach(r=>{const i=r.totalTime?Math.min(1,t/r.totalTime):1;r.setPosition(i)})}getPosition(){const e=this.players.reduce((t,r)=>null===t||r.totalTime>t.totalTime?r:t,null);return null!=e?e.getPosition():0}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(r=>r()),t.length=0}}const FIe=["notch"],LIe=["matFormFieldNotchedOutline",""],VIe=["*"],BIe=["textField"],UIe=["iconPrefixContainer"],zIe=["textPrefixContainer"],jIe=["iconSuffixContainer"],HIe=["textSuffixContainer"],$Ie=["*",[["mat-label"]],[["","matPrefix",""],["","matIconPrefix",""]],[["","matTextPrefix",""]],[["","matTextSuffix",""]],[["","matSuffix",""],["","matIconSuffix",""]],[["mat-error"],["","matError",""]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],qIe=["*","mat-label","[matPrefix], [matIconPrefix]","[matTextPrefix]","[matTextSuffix]","[matSuffix], [matIconSuffix]","mat-error, [matError]","mat-hint:not([align='end'])","mat-hint[align='end']"];function WIe(n,e){1&n&&Pe(0,"span",21)}function GIe(n,e){if(1&n&&(W(0,"label",20),Ae(1,1),et(2,WIe,1,0,"span",21),K()),2&n){const t=Ln(2);De("floating",t._shouldLabelFloat())("monitorResize",t._hasOutline())("id",t._labelId),Ke("for",t._control.disableAutomaticLabeling?null:t._control.id),re(2),Pt(!t.hideRequiredMarker&&t._control.required?2:-1)}}function KIe(n,e){1&n&&et(0,GIe,3,5,"label",20),2&n&&Pt(Ln()._hasFloatingLabel()?0:-1)}function QIe(n,e){1&n&&Pe(0,"div",7)}function YIe(n,e){}function XIe(n,e){1&n&&et(0,YIe,0,0,"ng-template",13),2&n&&(Ln(2),De("ngTemplateOutlet",rm(1)))}function ZIe(n,e){if(1&n&&(W(0,"div",9),et(1,XIe,1,1,null,13),K()),2&n){const t=Ln();De("matFormFieldNotchedOutlineOpen",t._shouldLabelFloat()),re(),Pt(t._forceDisplayInfixLabel()?-1:1)}}function JIe(n,e){1&n&&(W(0,"div",10,2),Ae(2,2),K())}function eTe(n,e){1&n&&(W(0,"div",11,3),Ae(2,3),K())}function tTe(n,e){}function nTe(n,e){1&n&&et(0,tTe,0,0,"ng-template",13),2&n&&(Ln(),De("ngTemplateOutlet",rm(1)))}function rTe(n,e){1&n&&(W(0,"div",14,4),Ae(2,4),K())}function iTe(n,e){1&n&&(W(0,"div",15,5),Ae(2,5),K())}function oTe(n,e){1&n&&Pe(0,"div",16)}function sTe(n,e){1&n&&(W(0,"div",18),Ae(1,6),K()),2&n&&De("@transitionMessages",Ln()._subscriptAnimationState)}function aTe(n,e){if(1&n&&(W(0,"mat-hint",22),Oe(1),K()),2&n){const t=Ln(2);De("id",t._hintLabelId),re(),zd(t.hintLabel)}}function lTe(n,e){if(1&n&&(W(0,"div",19),et(1,aTe,2,2,"mat-hint",22),Ae(2,7),Pe(3,"div",23),Ae(4,8),K()),2&n){const t=Ln();De("@transitionMessages",t._subscriptAnimationState),re(),Pt(t.hintLabel?1:-1)}}let tg=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["mat-label"]]})}return n})();const xW=new B("MatError");let SW=(()=>{class n{id=b(Xa).getId("mat-mdc-error-");constructor(){b(new T2("aria-live"),{optional:!0})||b(je).nativeElement.setAttribute("aria-live","polite")}static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["mat-error"],["","matError",""]],hostAttrs:["aria-atomic","true",1,"mat-mdc-form-field-error","mat-mdc-form-field-bottom-align"],hostVars:1,hostBindings:function(r,i){2&r&&Bo("id",i.id)},inputs:{id:"id"},features:[$e([{provide:xW,useExisting:n}])]})}return n})(),DW=(()=>{class n{align="start";id=b(Xa).getId("mat-mdc-hint-");static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["mat-hint"]],hostAttrs:[1,"mat-mdc-form-field-hint","mat-mdc-form-field-bottom-align"],hostVars:4,hostBindings:function(r,i){2&r&&(Bo("id",i.id),Ke("align",null),at("mat-mdc-form-field-hint-end","end"===i.align))},inputs:{align:"align",id:"id"}})}return n})();const cTe=new B("MatPrefix"),uTe=new B("MatSuffix"),AW=new B("FloatingLabelParent");let RW=(()=>{class n{_elementRef=b(je);get floating(){return this._floating}set floating(t){this._floating=t,this.monitorResize&&this._handleResize()}_floating=!1;get monitorResize(){return this._monitorResize}set monitorResize(t){this._monitorResize=t,this._monitorResize?this._subscribeToResize():this._resizeSubscription.unsubscribe()}_monitorResize=!1;_resizeObserver=b(RIe);_ngZone=b(ue);_parent=b(AW);_resizeSubscription=new Kt;constructor(){}ngOnDestroy(){this._resizeSubscription.unsubscribe()}getWidth(){return function dTe(n){if(null!==n.offsetParent)return n.scrollWidth;const t=n.cloneNode(!0);t.style.setProperty("position","absolute"),t.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(t);const r=t.scrollWidth;return t.remove(),r}(this._elementRef.nativeElement)}get element(){return this._elementRef.nativeElement}_handleResize(){setTimeout(()=>this._parent._handleLabelResized())}_subscribeToResize(){this._resizeSubscription.unsubscribe(),this._ngZone.runOutsideAngular(()=>{this._resizeSubscription=this._resizeObserver.observe(this._elementRef.nativeElement,{box:"border-box"}).subscribe(()=>this._handleResize())})}static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["label","matFormFieldFloatingLabel",""]],hostAttrs:[1,"mdc-floating-label","mat-mdc-floating-label"],hostVars:2,hostBindings:function(r,i){2&r&&at("mdc-floating-label--float-above",i.floating)},inputs:{floating:"floating",monitorResize:"monitorResize"}})}return n})();const MW="mdc-line-ripple--active",tE="mdc-line-ripple--deactivating";let kW=(()=>{class n{_elementRef=b(je);_cleanupTransitionEnd;constructor(){const t=b(ue),r=b(Ti);t.runOutsideAngular(()=>{this._cleanupTransitionEnd=r.listen(this._elementRef.nativeElement,"transitionend",this._handleTransitionEnd)})}activate(){const t=this._elementRef.nativeElement.classList;t.remove(tE),t.add(MW)}deactivate(){this._elementRef.nativeElement.classList.add(tE)}_handleTransitionEnd=t=>{const r=this._elementRef.nativeElement.classList,i=r.contains(tE);"opacity"===t.propertyName&&i&&r.remove(MW,tE)};ngOnDestroy(){this._cleanupTransitionEnd()}static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["div","matFormFieldLineRipple",""]],hostAttrs:[1,"mdc-line-ripple"]})}return n})(),NW=(()=>{class n{_elementRef=b(je);_ngZone=b(ue);open=!1;_notch;constructor(){}ngAfterViewInit(){const t=this._elementRef.nativeElement.querySelector(".mdc-floating-label");t?(this._elementRef.nativeElement.classList.add("mdc-notched-outline--upgraded"),"function"==typeof requestAnimationFrame&&(t.style.transitionDuration="0s",this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>t.style.transitionDuration="")}))):this._elementRef.nativeElement.classList.add("mdc-notched-outline--no-label")}_setNotchWidth(t){this._notch.nativeElement.style.width=this.open&&t?`calc(${t}px * var(--mat-mdc-form-field-floating-label-scale, 0.75) + 9px)`:""}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["div","matFormFieldNotchedOutline",""]],viewQuery:function(r,i){if(1&r&&qn(FIe,5),2&r){let o;Qe(o=Ye())&&(i._notch=o.first)}},hostAttrs:[1,"mdc-notched-outline"],hostVars:2,hostBindings:function(r,i){2&r&&at("mdc-notched-outline--notched",i.open)},inputs:{open:[0,"matFormFieldNotchedOutlineOpen","open"]},attrs:LIe,ngContentSelectors:VIe,decls:5,vars:0,consts:[["notch",""],[1,"mat-mdc-notch-piece","mdc-notched-outline__leading"],[1,"mat-mdc-notch-piece","mdc-notched-outline__notch"],[1,"mat-mdc-notch-piece","mdc-notched-outline__trailing"]],template:function(r,i){1&r&&(Hn(),Pe(0,"div",1),W(1,"div",2,0),Ae(3),K(),Pe(4,"div",3))},encapsulation:2,changeDetection:0})}return n})();const hTe={transitionMessages:aR("transitionMessages",[Zm("enter",Ps({opacity:1,transform:"translateY(0%)"})),Jm("void => enter",[Ps({opacity:0,transform:"translateY(-5px)"}),Xm("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])};let cR=(()=>{class n{value;stateChanges;id;placeholder;ngControl;focused;empty;shouldLabelFloat;required;disabled;errorState;controlType;autofilled;userAriaDescribedBy;disableAutomaticLabeling;static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n})}return n})();const uR=new B("MatFormField"),fTe=new B("MAT_FORM_FIELD_DEFAULT_OPTIONS");let dR=(()=>{class n{_elementRef=b(je);_changeDetectorRef=b(Uo);_dir=b(Gw);_platform=b(rr);_idGenerator=b(Xa);_defaults=b(fTe,{optional:!0});_animationMode=b(Ts,{optional:!0});_textField;_iconPrefixContainer;_textPrefixContainer;_iconSuffixContainer;_textSuffixContainer;_floatingLabel;_notchedOutline;_lineRipple;_formFieldControl;_prefixChildren;_suffixChildren;_errorChildren;_hintChildren;_labelChild=Ale(tg);get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(t){this._hideRequiredMarker=Qa(t)}_hideRequiredMarker=!1;color="primary";get floatLabel(){return this._floatLabel||this._defaults?.floatLabel||"auto"}set floatLabel(t){t!==this._floatLabel&&(this._floatLabel=t,this._changeDetectorRef.markForCheck())}_floatLabel;get appearance(){return this._appearance}set appearance(t){const r=this._appearance;this._appearance=t||this._defaults?.appearance||"fill","outline"===this._appearance&&this._appearance!==r&&(this._needsOutlineLabelOffsetUpdate=!0)}_appearance="fill";get subscriptSizing(){return this._subscriptSizing||this._defaults?.subscriptSizing||"fixed"}set subscriptSizing(t){this._subscriptSizing=t||this._defaults?.subscriptSizing||"fixed"}_subscriptSizing=null;get hintLabel(){return this._hintLabel}set hintLabel(t){this._hintLabel=t,this._processHints()}_hintLabel="";_hasIconPrefix=!1;_hasTextPrefix=!1;_hasIconSuffix=!1;_hasTextSuffix=!1;_labelId=this._idGenerator.getId("mat-mdc-form-field-label-");_hintLabelId=this._idGenerator.getId("mat-mdc-hint-");_subscriptAnimationState="";get _control(){return this._explicitFormFieldControl||this._formFieldControl}set _control(t){this._explicitFormFieldControl=t}_destroyed=new fe;_isFocused=null;_explicitFormFieldControl;_needsOutlineLabelOffsetUpdate=!1;_previousControl=null;_stateChanges;_valueChanges;_describedByChanges;_injector=b(ze);constructor(){const t=this._defaults;t&&(t.appearance&&(this.appearance=t.appearance),this._hideRequiredMarker=!!t?.hideRequiredMarker,t.color&&(this.color=t.color))}ngAfterViewInit(){this._updateFocusState(),this._subscriptAnimationState="enter",this._changeDetectorRef.detectChanges()}ngAfterContentInit(){this._assertFormFieldControl(),this._initializeSubscript(),this._initializePrefixAndSuffix(),this._initializeOutlineLabelOffsetSubscriptions()}ngAfterContentChecked(){this._assertFormFieldControl(),this._control!==this._previousControl&&(this._initializeControl(this._previousControl),this._previousControl=this._control)}ngOnDestroy(){this._stateChanges?.unsubscribe(),this._valueChanges?.unsubscribe(),this._describedByChanges?.unsubscribe(),this._destroyed.next(),this._destroyed.complete()}getLabelId=xi(()=>this._hasFloatingLabel()?this._labelId:null);getConnectedOverlayOrigin(){return this._textField||this._elementRef}_animateAndLockLabel(){this._hasFloatingLabel()&&(this.floatLabel="always")}_initializeControl(t){const r=this._control,i="mat-mdc-form-field-type-";t&&this._elementRef.nativeElement.classList.remove(i+t.controlType),r.controlType&&this._elementRef.nativeElement.classList.add(i+r.controlType),this._stateChanges?.unsubscribe(),this._stateChanges=r.stateChanges.subscribe(()=>{this._updateFocusState(),this._changeDetectorRef.markForCheck()}),this._describedByChanges?.unsubscribe(),this._describedByChanges=r.stateChanges.pipe(Ec([void 0,void 0]),Te(()=>[r.errorState,r.userAriaDescribedBy]),function xIe(){return Jt((n,e)=>{let t,r=!1;n.subscribe(zt(e,i=>{const o=t;t=i,r&&e.next([o,i]),r=!0}))})}(),si(([[o,s],[a,l]])=>o!==a||s!==l)).subscribe(()=>this._syncDescribedByIds()),this._valueChanges?.unsubscribe(),r.ngControl&&r.ngControl.valueChanges&&(this._valueChanges=r.ngControl.valueChanges.pipe(At(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()))}_checkPrefixAndSuffixTypes(){this._hasIconPrefix=!!this._prefixChildren.find(t=>!t._isText),this._hasTextPrefix=!!this._prefixChildren.find(t=>t._isText),this._hasIconSuffix=!!this._suffixChildren.find(t=>!t._isText),this._hasTextSuffix=!!this._suffixChildren.find(t=>t._isText)}_initializePrefixAndSuffix(){this._checkPrefixAndSuffixTypes(),Ym(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._checkPrefixAndSuffixTypes(),this._changeDetectorRef.markForCheck()})}_initializeSubscript(){this._hintChildren.changes.subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._validateHints(),this._syncDescribedByIds()}_assertFormFieldControl(){}_updateFocusState(){this._control.focused&&!this._isFocused?(this._isFocused=!0,this._lineRipple?.activate()):!this._control.focused&&(this._isFocused||null===this._isFocused)&&(this._isFocused=!1,this._lineRipple?.deactivate()),this._textField?.nativeElement.classList.toggle("mdc-text-field--focused",this._control.focused)}_initializeOutlineLabelOffsetSubscriptions(){this._prefixChildren.changes.subscribe(()=>this._needsOutlineLabelOffsetUpdate=!0),ex(()=>{this._needsOutlineLabelOffsetUpdate&&(this._needsOutlineLabelOffsetUpdate=!1,this._updateOutlineLabelOffset())},{injector:this._injector}),this._dir.change.pipe(At(this._destroyed)).subscribe(()=>this._needsOutlineLabelOffsetUpdate=!0)}_shouldAlwaysFloat(){return"always"===this.floatLabel}_hasOutline(){return"outline"===this.appearance}_forceDisplayInfixLabel(){return!this._platform.isBrowser&&this._prefixChildren.length&&!this._shouldLabelFloat()}_hasFloatingLabel=xi(()=>!!this._labelChild());_shouldLabelFloat(){return!!this._hasFloatingLabel()&&(this._control.shouldLabelFloat||this._shouldAlwaysFloat())}_shouldForward(t){const r=this._control?this._control.ngControl:null;return r&&r[t]}_getDisplayedMessages(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}_handleLabelResized(){this._refreshOutlineNotchWidth()}_refreshOutlineNotchWidth(){this._hasOutline()&&this._floatingLabel&&this._shouldLabelFloat()?this._notchedOutline?._setNotchWidth(this._floatingLabel.getWidth()):this._notchedOutline?._setNotchWidth(0)}_processHints(){this._validateHints(),this._syncDescribedByIds()}_validateHints(){}_syncDescribedByIds(){if(this._control){let t=[];if(this._control.userAriaDescribedBy&&"string"==typeof this._control.userAriaDescribedBy&&t.push(...this._control.userAriaDescribedBy.split(" ")),"hint"===this._getDisplayedMessages()){const r=this._hintChildren?this._hintChildren.find(o=>"start"===o.align):null,i=this._hintChildren?this._hintChildren.find(o=>"end"===o.align):null;r?t.push(r.id):this._hintLabel&&t.push(this._hintLabelId),i&&t.push(i.id)}else this._errorChildren&&t.push(...this._errorChildren.map(r=>r.id));this._control.setDescribedByIds(t)}}_updateOutlineLabelOffset(){if(!this._hasOutline()||!this._floatingLabel)return;const t=this._floatingLabel.element;if(!this._iconPrefixContainer&&!this._textPrefixContainer)return void(t.style.transform="");if(!this._isAttachedToDom())return void(this._needsOutlineLabelOffsetUpdate=!0);const r=this._iconPrefixContainer?.nativeElement,i=this._textPrefixContainer?.nativeElement,o=this._iconSuffixContainer?.nativeElement,s=this._textSuffixContainer?.nativeElement,a=r?.getBoundingClientRect().width??0,l=i?.getBoundingClientRect().width??0,c=o?.getBoundingClientRect().width??0,u=s?.getBoundingClientRect().width??0;t.style.transform=`var(\n --mat-mdc-form-field-label-transform,\n translateY(-50%) translateX(calc(${"rtl"===this._dir.value?"-1":"1"} * (${a+l}px + var(--mat-mdc-form-field-label-offset-x, 0px))))\n )`,this._elementRef.nativeElement.style.setProperty("--mat-form-field-notch-max-width",`calc(100% - ${a+l+c+u}px)`)}_isAttachedToDom(){const t=this._elementRef.nativeElement;if(t.getRootNode){const r=t.getRootNode();return r&&r!==t}return document.documentElement.contains(t)}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-form-field"]],contentQueries:function(r,i,o){if(1&r&&(AH(o,i._labelChild,tg,5),$n(o,cR,5),$n(o,cTe,5),$n(o,uTe,5),$n(o,xW,5),$n(o,DW,5)),2&r){let s;(function RH(n=1){tv(p0()+n)})(),Qe(s=Ye())&&(i._formFieldControl=s.first),Qe(s=Ye())&&(i._prefixChildren=s),Qe(s=Ye())&&(i._suffixChildren=s),Qe(s=Ye())&&(i._errorChildren=s),Qe(s=Ye())&&(i._hintChildren=s)}},viewQuery:function(r,i){if(1&r&&(qn(BIe,5),qn(UIe,5),qn(zIe,5),qn(jIe,5),qn(HIe,5),qn(RW,5),qn(NW,5),qn(kW,5)),2&r){let o;Qe(o=Ye())&&(i._textField=o.first),Qe(o=Ye())&&(i._iconPrefixContainer=o.first),Qe(o=Ye())&&(i._textPrefixContainer=o.first),Qe(o=Ye())&&(i._iconSuffixContainer=o.first),Qe(o=Ye())&&(i._textSuffixContainer=o.first),Qe(o=Ye())&&(i._floatingLabel=o.first),Qe(o=Ye())&&(i._notchedOutline=o.first),Qe(o=Ye())&&(i._lineRipple=o.first)}},hostAttrs:[1,"mat-mdc-form-field"],hostVars:42,hostBindings:function(r,i){2&r&&at("mat-mdc-form-field-label-always-float",i._shouldAlwaysFloat())("mat-mdc-form-field-has-icon-prefix",i._hasIconPrefix)("mat-mdc-form-field-has-icon-suffix",i._hasIconSuffix)("mat-form-field-invalid",i._control.errorState)("mat-form-field-disabled",i._control.disabled)("mat-form-field-autofilled",i._control.autofilled)("mat-form-field-no-animations","NoopAnimations"===i._animationMode)("mat-form-field-appearance-fill","fill"==i.appearance)("mat-form-field-appearance-outline","outline"==i.appearance)("mat-form-field-hide-placeholder",i._hasFloatingLabel()&&!i._shouldLabelFloat())("mat-focused",i._control.focused)("mat-primary","accent"!==i.color&&"warn"!==i.color)("mat-accent","accent"===i.color)("mat-warn","warn"===i.color)("ng-untouched",i._shouldForward("untouched"))("ng-touched",i._shouldForward("touched"))("ng-pristine",i._shouldForward("pristine"))("ng-dirty",i._shouldForward("dirty"))("ng-valid",i._shouldForward("valid"))("ng-invalid",i._shouldForward("invalid"))("ng-pending",i._shouldForward("pending"))},inputs:{hideRequiredMarker:"hideRequiredMarker",color:"color",floatLabel:"floatLabel",appearance:"appearance",subscriptSizing:"subscriptSizing",hintLabel:"hintLabel"},exportAs:["matFormField"],features:[$e([{provide:uR,useExisting:n},{provide:AW,useExisting:n}])],ngContentSelectors:qIe,decls:18,vars:21,consts:[["labelTemplate",""],["textField",""],["iconPrefixContainer",""],["textPrefixContainer",""],["textSuffixContainer",""],["iconSuffixContainer",""],[1,"mat-mdc-text-field-wrapper","mdc-text-field",3,"click"],[1,"mat-mdc-form-field-focus-overlay"],[1,"mat-mdc-form-field-flex"],["matFormFieldNotchedOutline","",3,"matFormFieldNotchedOutlineOpen"],[1,"mat-mdc-form-field-icon-prefix"],[1,"mat-mdc-form-field-text-prefix"],[1,"mat-mdc-form-field-infix"],[3,"ngTemplateOutlet"],[1,"mat-mdc-form-field-text-suffix"],[1,"mat-mdc-form-field-icon-suffix"],["matFormFieldLineRipple",""],[1,"mat-mdc-form-field-subscript-wrapper","mat-mdc-form-field-bottom-align"],[1,"mat-mdc-form-field-error-wrapper"],[1,"mat-mdc-form-field-hint-wrapper"],["matFormFieldFloatingLabel","",3,"floating","monitorResize","id"],["aria-hidden","true",1,"mat-mdc-form-field-required-marker","mdc-floating-label--required"],[3,"id"],[1,"mat-mdc-form-field-hint-spacer"]],template:function(r,i){if(1&r){const o=La();Hn($Ie),et(0,KIe,1,1,"ng-template",null,0,tD),W(2,"div",6,1),Ve("click",function(a){return vi(o),bi(i._control.onContainerClick(a))}),et(4,QIe,1,0,"div",7),W(5,"div",8),et(6,ZIe,2,2,"div",9)(7,JIe,3,0,"div",10)(8,eTe,3,0,"div",11),W(9,"div",12),et(10,nTe,1,1,null,13),Ae(11),K(),et(12,rTe,3,0,"div",14)(13,iTe,3,0,"div",15),K(),et(14,oTe,1,0,"div",16),K(),W(15,"div",17),et(16,sTe,2,1,"div",18)(17,lTe,5,2,"div",19),K()}if(2&r){let o;re(2),at("mdc-text-field--filled",!i._hasOutline())("mdc-text-field--outlined",i._hasOutline())("mdc-text-field--no-label",!i._hasFloatingLabel())("mdc-text-field--disabled",i._control.disabled)("mdc-text-field--invalid",i._control.errorState),re(2),Pt(i._hasOutline()||i._control.disabled?-1:4),re(2),Pt(i._hasOutline()?6:-1),re(),Pt(i._hasIconPrefix?7:-1),re(),Pt(i._hasTextPrefix?8:-1),re(2),Pt(!i._hasOutline()||i._forceDisplayInfixLabel()?10:-1),re(2),Pt(i._hasTextSuffix?12:-1),re(),Pt(i._hasIconSuffix?13:-1),re(),Pt(i._hasOutline()?-1:14),re(),at("mat-mdc-form-field-subscript-dynamic-size","dynamic"===i.subscriptSizing),re(),Pt("error"===(o=i._getDisplayedMessages())?16:"hint"===o?17:-1)}},dependencies:[RW,NW,ND,kW,DW],styles:['.mdc-text-field{display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity,transform,color;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.mdc-text-field__input{width:100%;min-width:0;border:none;border-radius:0;background:none;padding:0;-moz-appearance:none;-webkit-appearance:none;height:28px}.mdc-text-field__input::-webkit-calendar-picker-indicator{display:none}.mdc-text-field__input::-ms-clear{display:none}.mdc-text-field__input:focus{outline:none}.mdc-text-field__input:invalid{box-shadow:none}.mdc-text-field__input::placeholder{opacity:0}.mdc-text-field__input::-moz-placeholder{opacity:0}.mdc-text-field__input::-webkit-input-placeholder{opacity:0}.mdc-text-field__input:-ms-input-placeholder{opacity:0}.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mdc-text-field--focused .mdc-text-field__input::placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{opacity:1}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-moz-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-webkit-input-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive:-ms-input-placeholder{opacity:0}.mdc-text-field--outlined .mdc-text-field__input,.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__input{height:100%}.mdc-text-field--outlined .mdc-text-field__input{display:flex;border:none !important;background-color:rgba(0,0,0,0)}.mdc-text-field--disabled .mdc-text-field__input{pointer-events:auto}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mdc-filled-text-field-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mdc-filled-text-field-caret-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mdc-filled-text-field-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mdc-filled-text-field-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mdc-filled-text-field-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mdc-filled-text-field-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mdc-filled-text-field-error-caret-color)}.mdc-text-field--filled.mdc-text-field--disabled .mdc-text-field__input{color:var(--mdc-filled-text-field-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mdc-outlined-text-field-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mdc-outlined-text-field-caret-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mdc-outlined-text-field-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mdc-outlined-text-field-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mdc-outlined-text-field-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mdc-outlined-text-field-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mdc-outlined-text-field-error-caret-color)}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-text-field__input{color:var(--mdc-outlined-text-field-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-text-field--disabled .mdc-text-field__input{background-color:Window}}.mdc-text-field--filled{height:56px;border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:var(--mdc-filled-text-field-container-shape, var(--mat-sys-corner-extra-small));border-top-right-radius:var(--mdc-filled-text-field-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:var(--mdc-filled-text-field-container-color, var(--mat-sys-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled{background-color:var(--mdc-filled-text-field-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 4%, transparent))}.mdc-text-field--outlined{height:56px;overflow:visible;padding-right:max(16px,var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small)));padding-left:max(16px,var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small)) + 4px)}[dir=rtl] .mdc-text-field--outlined{padding-right:max(16px,var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small)) + 4px);padding-left:max(16px,var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small)))}.mdc-floating-label{position:absolute;left:0;transform-origin:left top;line-height:1.15rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform}[dir=rtl] .mdc-floating-label{right:0;left:auto;transform-origin:right top;text-align:right}.mdc-text-field .mdc-floating-label{top:50%;transform:translateY(-50%);pointer-events:none}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-text-field--outlined .mdc-floating-label{left:4px;right:auto}[dir=rtl] .mdc-text-field--outlined .mdc-floating-label{left:auto;right:4px}.mdc-text-field--filled .mdc-floating-label{left:16px;right:auto}[dir=rtl] .mdc-text-field--filled .mdc-floating-label{left:auto;right:16px}.mdc-text-field--disabled .mdc-floating-label{cursor:default}@media(forced-colors: active){.mdc-text-field--disabled .mdc-floating-label{z-index:1}}.mdc-text-field--filled.mdc-text-field--no-label .mdc-floating-label{display:none}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mdc-filled-text-field-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mdc-filled-text-field-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mdc-filled-text-field-hover-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-floating-label{color:var(--mdc-filled-text-field-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mdc-filled-text-field-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mdc-filled-text-field-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mdc-filled-text-field-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--filled .mdc-floating-label{font-family:var(--mdc-filled-text-field-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mdc-filled-text-field-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mdc-filled-text-field-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mdc-filled-text-field-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mdc-outlined-text-field-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mdc-outlined-text-field-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mdc-outlined-text-field-hover-label-text-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-floating-label{color:var(--mdc-outlined-text-field-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mdc-outlined-text-field-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mdc-outlined-text-field-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mdc-outlined-text-field-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined .mdc-floating-label{font-family:var(--mdc-outlined-text-field-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mdc-outlined-text-field-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mdc-outlined-text-field-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mdc-outlined-text-field-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-floating-label--float-above{cursor:auto;transform:translateY(-106%) scale(0.75)}.mdc-text-field--filled .mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-37.25px) scale(1);font-size:.75rem}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:133.3333333333%}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) scale(0.75)}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:1px;margin-right:0;content:"*"}[dir=rtl] .mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:0;margin-right:1px}.mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline{text-align:right}.mdc-text-field--outlined .mdc-notched-outline{z-index:1}.mat-mdc-notch-piece{box-sizing:border-box;height:100%;pointer-events:none;border-top:1px solid;border-bottom:1px solid}.mdc-text-field--focused .mat-mdc-notch-piece{border-width:2px}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mat-mdc-notch-piece{border-color:var(--mdc-outlined-text-field-outline-color, var(--mat-sys-outline));border-width:var(--mdc-outlined-text-field-outline-width, 1px)}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mat-mdc-notch-piece{border-color:var(--mdc-outlined-text-field-hover-outline-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mdc-outlined-text-field-focus-outline-color, var(--mat-sys-primary))}.mdc-text-field--outlined.mdc-text-field--disabled .mat-mdc-notch-piece{border-color:var(--mdc-outlined-text-field-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mat-mdc-notch-piece{border-color:var(--mdc-outlined-text-field-error-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-notched-outline .mat-mdc-notch-piece{border-color:var(--mdc-outlined-text-field-error-hover-outline-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mdc-outlined-text-field-error-focus-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline .mat-mdc-notch-piece{border-width:var(--mdc-outlined-text-field-focus-outline-width, 2px)}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{width:max(12px,var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small)))}[dir=rtl] .mdc-notched-outline__leading{border-left:none;border-right:1px solid;border-bottom-left-radius:0;border-top-left-radius:0;border-top-right-radius:var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__trailing{flex-grow:1;border-left:none;border-right:1px solid;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small))}[dir=rtl] .mdc-notched-outline__trailing{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__notch{flex:0 0 auto;width:auto}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__notch{max-width:min(var(--mat-form-field-notch-max-width, 100%),100% - max(12px,var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small)))*2)}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:1px}.mdc-text-field--focused.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:2px}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none;--mat-form-field-notch-max-width: 100%}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{display:none}.mdc-line-ripple::before,.mdc-line-ripple::after{position:absolute;bottom:0;left:0;width:100%;border-bottom-style:solid;content:""}.mdc-line-ripple::before{z-index:1;border-bottom-width:var(--mdc-filled-text-field-active-indicator-height, 1px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-active-indicator-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-hover-active-indicator-color, var(--mat-sys-on-surface))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-disabled-active-indicator-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-error-active-indicator-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-error-hover-active-indicator-color, var(--mat-sys-on-error-container))}.mdc-line-ripple::after{transform:scaleX(0);opacity:0;z-index:2}.mdc-text-field--filled .mdc-line-ripple::after{border-bottom-width:var(--mdc-filled-text-field-focus-active-indicator-height, 2px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mdc-filled-text-field-focus-active-indicator-color, var(--mat-sys-primary))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mdc-filled-text-field-error-focus-active-indicator-color, var(--mat-sys-error))}.mdc-line-ripple--active::after{transform:scaleX(1);opacity:1}.mdc-line-ripple--deactivating::after{opacity:0}.mdc-text-field--disabled{pointer-events:none}.mat-mdc-form-field-textarea-control{vertical-align:middle;resize:vertical;box-sizing:border-box;height:auto;margin:0;padding:0;border:none;overflow:auto}.mat-mdc-form-field-input-control.mat-mdc-form-field-input-control{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font:inherit;letter-spacing:inherit;text-decoration:inherit;text-transform:inherit;border:none}.mat-mdc-form-field .mat-mdc-floating-label.mdc-floating-label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;line-height:normal;pointer-events:all;will-change:auto}.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-floating-label.mdc-floating-label{cursor:inherit}.mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input,.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control{height:auto}.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control.mdc-text-field__input[type=color]{height:23px}.mat-mdc-text-field-wrapper{height:auto;flex:auto;will-change:auto}.mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-left:0;--mat-mdc-form-field-label-offset-x: -16px}.mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-right:0}[dir=rtl] .mat-mdc-text-field-wrapper{padding-left:16px;padding-right:16px}[dir=rtl] .mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-left:0}[dir=rtl] .mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-right:0}.mat-form-field-disabled .mdc-text-field__input::placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-label-always-float .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms;opacity:1}.mat-mdc-text-field-wrapper .mat-mdc-form-field-infix .mat-mdc-floating-label{left:auto;right:auto}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-text-field__input{display:inline-block}.mat-mdc-form-field .mat-mdc-text-field-wrapper.mdc-text-field .mdc-notched-outline__notch{padding-top:0}.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:1px solid rgba(0,0,0,0)}[dir=rtl] .mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:none;border-right:1px solid rgba(0,0,0,0)}.mat-mdc-form-field-infix{min-height:var(--mat-form-field-container-height, 56px);padding-top:var(--mat-form-field-filled-with-label-container-padding-top, 24px);padding-bottom:var(--mat-form-field-filled-with-label-container-padding-bottom, 8px)}.mdc-text-field--outlined .mat-mdc-form-field-infix,.mdc-text-field--no-label .mat-mdc-form-field-infix{padding-top:var(--mat-form-field-container-vertical-padding, 16px);padding-bottom:var(--mat-form-field-container-vertical-padding, 16px)}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:calc(var(--mat-form-field-container-height, 56px)/2)}.mdc-text-field--filled .mat-mdc-floating-label{display:var(--mat-form-field-filled-label-display, block)}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{--mat-mdc-form-field-label-transform: translateY(calc(calc(6.75px + var(--mat-form-field-container-height, 56px) / 2) * -1)) scale(var(--mat-mdc-form-field-floating-label-scale, 0.75));transform:var(--mat-mdc-form-field-label-transform)}.mat-mdc-form-field-subscript-wrapper{box-sizing:border-box;width:100%;position:relative}.mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-error-wrapper{position:absolute;top:0;left:0;right:0;padding:0 16px}.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-error-wrapper{position:static}.mat-mdc-form-field-bottom-align::before{content:"";display:inline-block;height:16px}.mat-mdc-form-field-bottom-align.mat-mdc-form-field-subscript-dynamic-size::before{content:unset}.mat-mdc-form-field-hint-end{order:1}.mat-mdc-form-field-hint-wrapper{display:flex}.mat-mdc-form-field-hint-spacer{flex:1 0 1em}.mat-mdc-form-field-error{display:block;color:var(--mat-form-field-error-text-color, var(--mat-sys-error))}.mat-mdc-form-field-subscript-wrapper,.mat-mdc-form-field-bottom-align::before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-subscript-text-font, var(--mat-sys-body-small-font));line-height:var(--mat-form-field-subscript-text-line-height, var(--mat-sys-body-small-line-height));font-size:var(--mat-form-field-subscript-text-size, var(--mat-sys-body-small-size));letter-spacing:var(--mat-form-field-subscript-text-tracking, var(--mat-sys-body-small-tracking));font-weight:var(--mat-form-field-subscript-text-weight, var(--mat-sys-body-small-weight))}.mat-mdc-form-field-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;opacity:0;pointer-events:none;background-color:var(--mat-form-field-state-layer-color, var(--mat-sys-on-surface))}.mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-form-field.mat-focused .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-focus-state-layer-opacity, 0)}select.mat-mdc-form-field-input-control{-moz-appearance:none;-webkit-appearance:none;background-color:rgba(0,0,0,0);display:inline-flex;box-sizing:border-box}select.mat-mdc-form-field-input-control:not(:disabled){cursor:pointer}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option{color:var(--mat-form-field-select-option-text-color, var(--mat-sys-neutral10))}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option:disabled{color:var(--mat-form-field-select-disabled-option-text-color, color-mix(in srgb, var(--mat-sys-neutral10) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{content:"";width:0;height:0;border-left:5px solid rgba(0,0,0,0);border-right:5px solid rgba(0,0,0,0);border-top:5px solid;position:absolute;right:0;top:50%;margin-top:-2.5px;pointer-events:none;color:var(--mat-form-field-enabled-select-arrow-color, var(--mat-sys-on-surface-variant))}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{right:auto;left:0}.mat-mdc-form-field-type-mat-native-select.mat-focused .mat-mdc-form-field-infix::after{color:var(--mat-form-field-focus-select-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field-type-mat-native-select.mat-form-field-disabled .mat-mdc-form-field-infix::after{color:var(--mat-form-field-disabled-select-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:15px}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:0;padding-left:15px}@media(forced-colors: active){.mat-form-field-appearance-fill .mat-mdc-text-field-wrapper{outline:solid 1px}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-text-field-wrapper{outline-color:GrayText}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-focused .mat-mdc-text-field-wrapper{outline:dashed 3px}}@media(forced-colors: active){.mat-mdc-form-field.mat-focused .mdc-notched-outline{border:dashed 3px}}.mat-mdc-form-field-input-control[type=date],.mat-mdc-form-field-input-control[type=datetime],.mat-mdc-form-field-input-control[type=datetime-local],.mat-mdc-form-field-input-control[type=month],.mat-mdc-form-field-input-control[type=week],.mat-mdc-form-field-input-control[type=time]{line-height:1}.mat-mdc-form-field-input-control::-webkit-datetime-edit{line-height:1;padding:0;margin-bottom:-2px}.mat-mdc-form-field{--mat-mdc-form-field-floating-label-scale: 0.75;display:inline-flex;flex-direction:column;min-width:0;text-align:left;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-container-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-form-field-container-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-form-field-container-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-form-field-container-text-tracking, var(--mat-sys-body-large-tracking));font-weight:var(--mat-form-field-container-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-floating-label--float-above{font-size:calc(var(--mat-form-field-outlined-label-text-populated-size)*var(--mat-mdc-form-field-floating-label-scale))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:var(--mat-form-field-outlined-label-text-populated-size)}[dir=rtl] .mat-mdc-form-field{text-align:right}.mat-mdc-form-field-flex{display:inline-flex;align-items:baseline;box-sizing:border-box;width:100%}.mat-mdc-text-field-wrapper{width:100%;z-index:0}.mat-mdc-form-field-icon-prefix,.mat-mdc-form-field-icon-suffix{align-self:center;line-height:0;pointer-events:auto;position:relative;z-index:1}.mat-mdc-form-field-icon-prefix>.mat-icon,.mat-mdc-form-field-icon-suffix>.mat-icon{padding:0 12px;box-sizing:content-box}.mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-leading-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-disabled-leading-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-disabled-trailing-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-invalid .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-trailing-icon-color, var(--mat-sys-error))}.mat-form-field-invalid:not(.mat-focused):not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-hover-trailing-icon-color, var(--mat-sys-on-error-container))}.mat-form-field-invalid.mat-focused .mat-mdc-text-field-wrapper .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-focus-trailing-icon-color, var(--mat-sys-error))}.mat-mdc-form-field-icon-prefix,[dir=rtl] .mat-mdc-form-field-icon-suffix{padding:0 4px 0 0}.mat-mdc-form-field-icon-suffix,[dir=rtl] .mat-mdc-form-field-icon-prefix{padding:0 0 0 4px}.mat-mdc-form-field-subscript-wrapper .mat-icon,.mat-mdc-form-field label .mat-icon{width:1em;height:1em;font-size:inherit}.mat-mdc-form-field-infix{flex:auto;min-width:0;width:180px;position:relative;box-sizing:border-box}.mat-mdc-form-field-infix:has(textarea[cols]){width:auto}.mat-mdc-form-field .mdc-notched-outline__notch{margin-left:-1px;-webkit-clip-path:inset(-9em -999em -9em 1px);clip-path:inset(-9em -999em -9em 1px)}[dir=rtl] .mat-mdc-form-field .mdc-notched-outline__notch{margin-left:0;margin-right:-1px;-webkit-clip-path:inset(-9em 1px -9em -999em);clip-path:inset(-9em 1px -9em -999em)}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-floating-label{transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input{transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input::placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input::-moz-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input::-webkit-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input:-ms-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field:not(.mat-form-field-no-animations).mdc-text-field--no-label .mdc-text-field__input::placeholder,.mat-mdc-form-field:not(.mat-form-field-no-animations).mdc-text-field--focused .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field:not(.mat-form-field-no-animations).mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mat-mdc-form-field:not(.mat-form-field-no-animations).mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field:not(.mat-form-field-no-animations).mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mat-mdc-form-field:not(.mat-form-field-no-animations).mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field:not(.mat-form-field-no-animations).mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mat-mdc-form-field:not(.mat-form-field-no-animations).mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field--filled:not(.mdc-ripple-upgraded):focus .mdc-text-field__ripple::before{transition-duration:75ms}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-line-ripple::after{transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-notched-outline .mdc-floating-label{max-width:calc(100% + 1px)}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(133.3333333333% + 1px)}'],encapsulation:2,data:{animation:[hTe.transitionMessages]},changeDetection:0})}return n})(),ng=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[gn,Q5,gn]})}return n})(),gTe=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["ng-component"]],hostAttrs:["cdk-text-field-style-loader",""],decls:0,vars:0,template:function(r,i){},styles:["textarea.cdk-textarea-autosize{resize:none}textarea.cdk-textarea-autosize-measuring{padding:2px 0 !important;box-sizing:content-box !important;height:auto !important;overflow:hidden !important}textarea.cdk-textarea-autosize-measuring-firefox{padding:2px 0 !important;box-sizing:content-box !important;height:0 !important}@keyframes cdk-text-field-autofill-start{/*!*/}@keyframes cdk-text-field-autofill-end{/*!*/}.cdk-text-field-autofill-monitored:-webkit-autofill{animation:cdk-text-field-autofill-start 0s 1ms}.cdk-text-field-autofill-monitored:not(:-webkit-autofill){animation:cdk-text-field-autofill-end 0s 1ms}"],encapsulation:2,changeDetection:0})}return n})();const FW=ah({passive:!0});let _Te=(()=>{class n{_platform=b(rr);_ngZone=b(ue);_styleLoader=b(Ka);_monitoredElements=new Map;constructor(){}monitor(t){if(!this._platform.isBrowser)return Di;this._styleLoader.load(gTe);const r=Ya(t),i=this._monitoredElements.get(r);if(i)return i.subject;const o=new fe,s="cdk-text-field-autofilled",a=l=>{"cdk-text-field-autofill-start"!==l.animationName||r.classList.contains(s)?"cdk-text-field-autofill-end"===l.animationName&&r.classList.contains(s)&&(r.classList.remove(s),this._ngZone.run(()=>o.next({target:l.target,isAutofilled:!1}))):(r.classList.add(s),this._ngZone.run(()=>o.next({target:l.target,isAutofilled:!0})))};return this._ngZone.runOutsideAngular(()=>{r.addEventListener("animationstart",a,FW),r.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(r,{subject:o,unlisten:()=>{r.removeEventListener("animationstart",a,FW)}}),o}stopMonitoring(t){const r=Ya(t),i=this._monitoredElements.get(r);i&&(i.unlisten(),i.subject.complete(),r.classList.remove("cdk-text-field-autofill-monitored"),r.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(r))}ngOnDestroy(){this._monitoredElements.forEach((t,r)=>this.stopMonitoring(r))}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),yTe=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({})}return n})();const vTe=new B("MAT_INPUT_VALUE_ACCESSOR"),bTe=["button","checkbox","file","hidden","image","radio","range","reset","submit"],wTe=new B("MAT_INPUT_CONFIG");let hR=(()=>{class n{_elementRef=b(je);_platform=b(rr);ngControl=b(qo,{optional:!0,self:!0});_autofillMonitor=b(_Te);_ngZone=b(ue);_formField=b(uR,{optional:!0});_renderer=b(Ti);_uid=b(Xa).getId("mat-input-");_previousNativeValue;_inputValueAccessor;_signalBasedValueAccessor;_previousPlaceholder;_errorStateTracker;_config=b(wTe,{optional:!0});_cleanupIosKeyup;_cleanupWebkitWheel;_formFieldDescribedBy;_isServer;_isNativeSelect;_isTextarea;_isInFormField;focused=!1;stateChanges=new fe;controlType="mat-input";autofilled=!1;get disabled(){return this._disabled}set disabled(t){this._disabled=Qa(t),this.focused&&(this.focused=!1,this.stateChanges.next())}_disabled=!1;get id(){return this._id}set id(t){this._id=t||this._uid}_id;placeholder;name;get required(){return this._required??this.ngControl?.control?.hasValidator(Ri.required)??!1}set required(t){this._required=Qa(t)}_required;get type(){return this._type}set type(t){const r=this._type;this._type=t||"text",this._validateType(),!this._isTextarea&&U5().has(this._type)&&(this._elementRef.nativeElement.type=this._type),this._type!==r&&this._ensureWheelDefaultBehavior()}_type="text";get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(t){this._errorStateTracker.matcher=t}userAriaDescribedBy;get value(){return this._signalBasedValueAccessor?this._signalBasedValueAccessor.value():this._inputValueAccessor.value}set value(t){t!==this.value&&(this._signalBasedValueAccessor?this._signalBasedValueAccessor.value.set(t):this._inputValueAccessor.value=t,this.stateChanges.next())}get readonly(){return this._readonly}set readonly(t){this._readonly=Qa(t)}_readonly=!1;disabledInteractive;get errorState(){return this._errorStateTracker.errorState}set errorState(t){this._errorStateTracker.errorState=t}_neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(t=>U5().has(t));constructor(){const t=b(jm,{optional:!0}),r=b(Ga,{optional:!0}),i=b(tR),o=b(vTe,{optional:!0,self:!0}),s=this._elementRef.nativeElement,a=s.nodeName.toLowerCase();o?up(o.value)?this._signalBasedValueAccessor=o:this._inputValueAccessor=o:this._inputValueAccessor=s,this._previousNativeValue=this.value,this.id=this.id,this._platform.IOS&&this._ngZone.runOutsideAngular(()=>{this._cleanupIosKeyup=this._renderer.listen(s,"keyup",this._iOSKeyupListener)}),this._errorStateTracker=new fW(i,this.ngControl,r,t,this.stateChanges),this._isServer=!this._platform.isBrowser,this._isNativeSelect="select"===a,this._isTextarea="textarea"===a,this._isInFormField=!!this._formField,this.disabledInteractive=this._config?.disabledInteractive||!1,this._isNativeSelect&&(this.controlType=s.multiple?"mat-native-select-multiple":"mat-native-select"),this._signalBasedValueAccessor&&pm(()=>{this._signalBasedValueAccessor.value(),this.stateChanges.next()})}ngAfterViewInit(){this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(t=>{this.autofilled=t.isAutofilled,this.stateChanges.next()})}ngOnChanges(){this.stateChanges.next()}ngOnDestroy(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement),this._cleanupIosKeyup?.(),this._cleanupWebkitWheel?.()}ngDoCheck(){this.ngControl&&(this.updateErrorState(),null!==this.ngControl.disabled&&this.ngControl.disabled!==this.disabled&&(this.disabled=this.ngControl.disabled,this.stateChanges.next())),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}focus(t){this._elementRef.nativeElement.focus(t)}updateErrorState(){this._errorStateTracker.updateErrorState()}_focusChanged(t){if(t!==this.focused){if(!this._isNativeSelect&&t&&this.disabled&&this.disabledInteractive){const r=this._elementRef.nativeElement;"number"===r.type?(r.type="text",r.setSelectionRange(0,0),r.type="number"):r.setSelectionRange(0,0)}this.focused=t,this.stateChanges.next()}}_onInput(){}_dirtyCheckNativeValue(){const t=this._elementRef.nativeElement.value;this._previousNativeValue!==t&&(this._previousNativeValue=t,this.stateChanges.next())}_dirtyCheckPlaceholder(){const t=this._getPlaceholder();if(t!==this._previousPlaceholder){const r=this._elementRef.nativeElement;this._previousPlaceholder=t,t?r.setAttribute("placeholder",t):r.removeAttribute("placeholder")}}_getPlaceholder(){return this.placeholder||null}_validateType(){bTe.indexOf(this._type)}_isNeverEmpty(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}_isBadInput(){let t=this._elementRef.nativeElement.validity;return t&&t.badInput}get empty(){return!(this._isNeverEmpty()||this._elementRef.nativeElement.value||this._isBadInput()||this.autofilled)}get shouldLabelFloat(){if(this._isNativeSelect){const t=this._elementRef.nativeElement,r=t.options[0];return this.focused||t.multiple||!this.empty||!!(t.selectedIndex>-1&&r&&r.label)}return this.focused&&!this.disabled||!this.empty}setDescribedByIds(t){const r=this._elementRef.nativeElement,i=r.getAttribute("aria-describedby");let o;if(i){const s=this._formFieldDescribedBy||t;o=t.concat(i.split(" ").filter(a=>a&&!s.includes(a)))}else o=t;this._formFieldDescribedBy=t,o.length?r.setAttribute("aria-describedby",o.join(" ")):r.removeAttribute("aria-describedby")}onContainerClick(){this.focused||this.focus()}_isInlineSelect(){const t=this._elementRef.nativeElement;return this._isNativeSelect&&(t.multiple||t.size>1)}_iOSKeyupListener=t=>{const r=t.target;!r.value&&0===r.selectionStart&&0===r.selectionEnd&&(r.setSelectionRange(1,1),r.setSelectionRange(0,0))};_webkitBlinkWheelListener=()=>{};_ensureWheelDefaultBehavior(){this._cleanupWebkitWheel?.(),"number"===this._type&&(this._platform.BLINK||this._platform.WEBKIT)&&(this._cleanupWebkitWheel=this._renderer.listen(this._elementRef.nativeElement,"wheel",this._webkitBlinkWheelListener))}_getReadonlyAttribute(){return this._isNativeSelect?null:this.readonly||this.disabled&&this.disabledInteractive?"true":null}static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-mdc-input-element"],hostVars:21,hostBindings:function(r,i){1&r&&Ve("focus",function(){return i._focusChanged(!0)})("blur",function(){return i._focusChanged(!1)})("input",function(){return i._onInput()}),2&r&&(Bo("id",i.id)("disabled",i.disabled&&!i.disabledInteractive)("required",i.required),Ke("name",i.name||null)("readonly",i._getReadonlyAttribute())("aria-disabled",i.disabled&&i.disabledInteractive?"true":null)("aria-invalid",i.empty&&i.required?null:i.errorState)("aria-required",i.required)("id",i.id),at("mat-input-server",i._isServer)("mat-mdc-form-field-textarea-control",i._isInFormField&&i._isTextarea)("mat-mdc-form-field-input-control",i._isInFormField)("mat-mdc-input-disabled-interactive",i.disabledInteractive)("mdc-text-field__input",i._isInFormField)("mat-mdc-native-select-inline",i._isInlineSelect()))},inputs:{disabled:"disabled",id:"id",placeholder:"placeholder",name:"name",required:"required",type:"type",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],value:"value",readonly:"readonly",disabledInteractive:[2,"disabledInteractive","disabledInteractive",_t]},exportAs:["matInput"],features:[$e([{provide:cR,useExisting:n}]),ei]})}return n})(),fR=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[gn,ng,ng,yTe,gn]})}return n})();const LW=["mat-button",""],VW=[[["",8,"material-icons",3,"iconPositionEnd",""],["mat-icon",3,"iconPositionEnd",""],["","matButtonIcon","",3,"iconPositionEnd",""]],"*",[["","iconPositionEnd","",8,"material-icons"],["mat-icon","iconPositionEnd",""],["","matButtonIcon","","iconPositionEnd",""]]],BW=[".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])","*",".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]"],UW="@media(forced-colors: active){.mat-mdc-button:not(.mdc-button--outlined),.mat-mdc-unelevated-button:not(.mdc-button--outlined),.mat-mdc-raised-button:not(.mdc-button--outlined),.mat-mdc-outlined-button:not(.mdc-button--outlined),.mat-mdc-icon-button.mat-mdc-icon-button{outline:solid 1px}}",ITe=["mat-icon-button",""],TTe=["*"],CTe=new B("MAT_BUTTON_CONFIG"),xTe=[{attribute:"mat-button",mdcClasses:["mdc-button","mat-mdc-button"]},{attribute:"mat-flat-button",mdcClasses:["mdc-button","mdc-button--unelevated","mat-mdc-unelevated-button"]},{attribute:"mat-raised-button",mdcClasses:["mdc-button","mdc-button--raised","mat-mdc-raised-button"]},{attribute:"mat-stroked-button",mdcClasses:["mdc-button","mdc-button--outlined","mat-mdc-outlined-button"]},{attribute:"mat-fab",mdcClasses:["mdc-fab","mat-mdc-fab-base","mat-mdc-fab"]},{attribute:"mat-mini-fab",mdcClasses:["mdc-fab","mat-mdc-fab-base","mdc-fab--mini","mat-mdc-mini-fab"]},{attribute:"mat-icon-button",mdcClasses:["mdc-icon-button","mat-mdc-icon-button"]}];let pR=(()=>{class n{_elementRef=b(je);_ngZone=b(ue);_animationMode=b(Ts,{optional:!0});_focusMonitor=b(ZA);_rippleLoader=b(IW);_isFab=!1;color;get disableRipple(){return this._disableRipple}set disableRipple(t){this._disableRipple=t,this._updateRippleDisabled()}_disableRipple=!1;get disabled(){return this._disabled}set disabled(t){this._disabled=t,this._updateRippleDisabled()}_disabled=!1;ariaDisabled;disabledInteractive;constructor(){b(Ka).load(nR);const t=b(CTe,{optional:!0}),r=this._elementRef.nativeElement,i=r.classList;this.disabledInteractive=t?.disabledInteractive??!1,this.color=t?.color??null,this._rippleLoader?.configureRipple(r,{className:"mat-mdc-button-ripple"});for(const{attribute:o,mdcClasses:s}of xTe)r.hasAttribute(o)&&i.add(...s)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._rippleLoader?.destroyRipple(this._elementRef.nativeElement)}focus(t="program",r){t?this._focusMonitor.focusVia(this._elementRef.nativeElement,t,r):this._elementRef.nativeElement.focus(r)}_getAriaDisabled(){return null!=this.ariaDisabled?this.ariaDisabled:!(!this.disabled||!this.disabledInteractive)||null}_getDisabledAttribute(){return!(this.disabledInteractive||!this.disabled)||null}_updateRippleDisabled(){this._rippleLoader?.setDisabled(this._elementRef.nativeElement,this.disableRipple||this.disabled)}static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,inputs:{color:"color",disableRipple:[2,"disableRipple","disableRipple",_t],disabled:[2,"disabled","disabled",_t],ariaDisabled:[2,"aria-disabled","ariaDisabled",_t],disabledInteractive:[2,"disabledInteractive","disabledInteractive",_t]}})}return n})(),STe=(()=>{class n extends pR{_renderer=b(Ti);_cleanupClick;tabIndex;ngOnInit(){this._ngZone.runOutsideAngular(()=>{this._cleanupClick=this._renderer.listen(this._elementRef.nativeElement,"click",this._haltDisabledEvents)})}ngOnDestroy(){super.ngOnDestroy(),this._cleanupClick?.()}_haltDisabledEvents=t=>{this.disabled&&(t.preventDefault(),t.stopImmediatePropagation())};_getAriaDisabled(){return null!=this.ariaDisabled?this.ariaDisabled:this.disabled||null}static \u0275fac=(()=>{let t;return function(i){return(t||(t=bt(n)))(i||n)}})();static \u0275dir=ee({type:n,inputs:{tabIndex:[2,"tabIndex","tabIndex",t=>null==t?void 0:$d(t)]},features:[ke]})}return n})(),dh=(()=>{class n extends pR{static \u0275fac=(()=>{let t;return function(i){return(t||(t=bt(n)))(i||n)}})();static \u0275cmp=He({type:n,selectors:[["button","mat-button",""],["button","mat-raised-button",""],["button","mat-flat-button",""],["button","mat-stroked-button",""]],hostVars:14,hostBindings:function(r,i){2&r&&(Ke("disabled",i._getDisabledAttribute())("aria-disabled",i._getAriaDisabled()),Fa(i.color?"mat-"+i.color:""),at("mat-mdc-button-disabled",i.disabled)("mat-mdc-button-disabled-interactive",i.disabledInteractive)("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-unthemed",!i.color)("mat-mdc-button-base",!0))},exportAs:["matButton"],features:[ke],attrs:LW,ngContentSelectors:BW,decls:7,vars:4,consts:[[1,"mat-mdc-button-persistent-ripple"],[1,"mdc-button__label"],[1,"mat-focus-indicator"],[1,"mat-mdc-button-touch-target"]],template:function(r,i){1&r&&(Hn(VW),Pe(0,"span",0),Ae(1),W(2,"span",1),Ae(3,1),K(),Ae(4,2),Pe(5,"span",2)(6,"span",3)),2&r&&at("mdc-button__ripple",!i._isFab)("mdc-fab__ripple",i._isFab)},styles:['.mat-mdc-button-base{text-decoration:none}.mdc-button{-webkit-user-select:none;user-select:none;position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:64px;border:none;outline:none;line-height:inherit;-webkit-appearance:none;overflow:visible;vertical-align:middle;background:rgba(0,0,0,0);padding:0 8px}.mdc-button::-moz-focus-inner{padding:0;border:0}.mdc-button:active{outline:none}.mdc-button:hover{cursor:pointer}.mdc-button:disabled{cursor:default;pointer-events:none}.mdc-button[hidden]{display:none}.mdc-button .mdc-button__label{position:relative}.mat-mdc-button{padding:0 var(--mat-text-button-horizontal-padding, 12px);height:var(--mdc-text-button-container-height, 40px);font-family:var(--mdc-text-button-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-text-button-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mdc-text-button-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mdc-text-button-label-text-transform);font-weight:var(--mdc-text-button-label-text-weight, var(--mat-sys-label-large-weight))}.mat-mdc-button,.mat-mdc-button .mdc-button__ripple{border-radius:var(--mdc-text-button-container-shape, var(--mat-sys-corner-full))}.mat-mdc-button:not(:disabled){color:var(--mdc-text-button-label-text-color, var(--mat-sys-primary))}.mat-mdc-button[disabled],.mat-mdc-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-text-button-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-button:has(.material-icons,mat-icon,[matButtonIcon]){padding:0 var(--mat-text-button-with-icon-horizontal-padding, 16px)}.mat-mdc-button>.mat-icon{margin-right:var(--mat-text-button-icon-spacing, 8px);margin-left:var(--mat-text-button-icon-offset, -4px)}[dir=rtl] .mat-mdc-button>.mat-icon{margin-right:var(--mat-text-button-icon-offset, -4px);margin-left:var(--mat-text-button-icon-spacing, 8px)}.mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-text-button-icon-offset, -4px);margin-left:var(--mat-text-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-text-button-icon-spacing, 8px);margin-left:var(--mat-text-button-icon-offset, -4px)}.mat-mdc-button .mat-ripple-element{background-color:var(--mat-text-button-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-text-button-state-layer-color, var(--mat-sys-primary))}.mat-mdc-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-text-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-text-button-touch-target-display, block)}.mat-mdc-unelevated-button{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mdc-filled-button-container-height, 40px);font-family:var(--mdc-filled-button-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-filled-button-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mdc-filled-button-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mdc-filled-button-label-text-transform);font-weight:var(--mdc-filled-button-label-text-weight, var(--mat-sys-label-large-weight));padding:0 var(--mat-filled-button-horizontal-padding, 24px)}.mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-filled-button-icon-spacing, 8px);margin-left:var(--mat-filled-button-icon-offset, -8px)}[dir=rtl] .mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-filled-button-icon-offset, -8px);margin-left:var(--mat-filled-button-icon-spacing, 8px)}.mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-filled-button-icon-offset, -8px);margin-left:var(--mat-filled-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-filled-button-icon-spacing, 8px);margin-left:var(--mat-filled-button-icon-offset, -8px)}.mat-mdc-unelevated-button .mat-ripple-element{background-color:var(--mat-filled-button-ripple-color, color-mix(in srgb, var(--mat-sys-on-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-filled-button-state-layer-color, var(--mat-sys-on-primary))}.mat-mdc-unelevated-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-filled-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-unelevated-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-unelevated-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-unelevated-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-unelevated-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-filled-button-touch-target-display, block)}.mat-mdc-unelevated-button:not(:disabled){color:var(--mdc-filled-button-label-text-color, var(--mat-sys-on-primary));background-color:var(--mdc-filled-button-container-color, var(--mat-sys-primary))}.mat-mdc-unelevated-button,.mat-mdc-unelevated-button .mdc-button__ripple{border-radius:var(--mdc-filled-button-container-shape, var(--mat-sys-corner-full))}.mat-mdc-unelevated-button[disabled],.mat-mdc-unelevated-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-filled-button-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mdc-filled-button-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-raised-button{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);box-shadow:var(--mdc-protected-button-container-elevation-shadow, var(--mat-sys-level1));height:var(--mdc-protected-button-container-height, 40px);font-family:var(--mdc-protected-button-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-protected-button-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mdc-protected-button-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mdc-protected-button-label-text-transform);font-weight:var(--mdc-protected-button-label-text-weight, var(--mat-sys-label-large-weight));padding:0 var(--mat-protected-button-horizontal-padding, 24px)}.mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-protected-button-icon-spacing, 8px);margin-left:var(--mat-protected-button-icon-offset, -8px)}[dir=rtl] .mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-protected-button-icon-offset, -8px);margin-left:var(--mat-protected-button-icon-spacing, 8px)}.mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-protected-button-icon-offset, -8px);margin-left:var(--mat-protected-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-protected-button-icon-spacing, 8px);margin-left:var(--mat-protected-button-icon-offset, -8px)}.mat-mdc-raised-button .mat-ripple-element{background-color:var(--mat-protected-button-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-protected-button-state-layer-color, var(--mat-sys-primary))}.mat-mdc-raised-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-protected-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-raised-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-raised-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-raised-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-raised-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-protected-button-touch-target-display, block)}.mat-mdc-raised-button:not(:disabled){color:var(--mdc-protected-button-label-text-color, var(--mat-sys-primary));background-color:var(--mdc-protected-button-container-color, var(--mat-sys-surface))}.mat-mdc-raised-button,.mat-mdc-raised-button .mdc-button__ripple{border-radius:var(--mdc-protected-button-container-shape, var(--mat-sys-corner-full))}.mat-mdc-raised-button:hover{box-shadow:var(--mdc-protected-button-hover-container-elevation-shadow, var(--mat-sys-level2))}.mat-mdc-raised-button:focus{box-shadow:var(--mdc-protected-button-focus-container-elevation-shadow, var(--mat-sys-level1))}.mat-mdc-raised-button:active,.mat-mdc-raised-button:focus:active{box-shadow:var(--mdc-protected-button-pressed-container-elevation-shadow, var(--mat-sys-level1))}.mat-mdc-raised-button[disabled],.mat-mdc-raised-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-protected-button-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mdc-protected-button-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-raised-button[disabled].mat-mdc-button-disabled,.mat-mdc-raised-button.mat-mdc-button-disabled.mat-mdc-button-disabled{box-shadow:var(--mdc-protected-button-disabled-container-elevation-shadow, var(--mat-sys-level0))}.mat-mdc-raised-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-outlined-button{border-style:solid;transition:border 280ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mdc-outlined-button-container-height, 40px);font-family:var(--mdc-outlined-button-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-outlined-button-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mdc-outlined-button-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mdc-outlined-button-label-text-transform);font-weight:var(--mdc-outlined-button-label-text-weight, var(--mat-sys-label-large-weight));border-radius:var(--mdc-outlined-button-container-shape, var(--mat-sys-corner-full));border-width:var(--mdc-outlined-button-outline-width, 1px);padding:0 var(--mat-outlined-button-horizontal-padding, 24px)}.mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-outlined-button-icon-spacing, 8px);margin-left:var(--mat-outlined-button-icon-offset, -8px)}[dir=rtl] .mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-outlined-button-icon-offset, -8px);margin-left:var(--mat-outlined-button-icon-spacing, 8px)}.mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-outlined-button-icon-offset, -8px);margin-left:var(--mat-outlined-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-outlined-button-icon-spacing, 8px);margin-left:var(--mat-outlined-button-icon-offset, -8px)}.mat-mdc-outlined-button .mat-ripple-element{background-color:var(--mat-outlined-button-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-outlined-button-state-layer-color, var(--mat-sys-primary))}.mat-mdc-outlined-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-outlined-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-outlined-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-outlined-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-outlined-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-outlined-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-outlined-button-touch-target-display, block)}.mat-mdc-outlined-button:not(:disabled){color:var(--mdc-outlined-button-label-text-color, var(--mat-sys-primary));border-color:var(--mdc-outlined-button-outline-color, var(--mat-sys-outline))}.mat-mdc-outlined-button[disabled],.mat-mdc-outlined-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-outlined-button-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:var(--mdc-outlined-button-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-outlined-button .mdc-button__ripple{border-width:var(--mdc-outlined-button-outline-width, 1px);border-style:solid;border-color:rgba(0,0,0,0)}.mat-mdc-button,.mat-mdc-unelevated-button,.mat-mdc-raised-button,.mat-mdc-outlined-button{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-button .mdc-button__label,.mat-mdc-button .mat-icon,.mat-mdc-unelevated-button .mdc-button__label,.mat-mdc-unelevated-button .mat-icon,.mat-mdc-raised-button .mdc-button__label,.mat-mdc-raised-button .mat-icon,.mat-mdc-outlined-button .mdc-button__label,.mat-mdc-outlined-button .mat-icon{z-index:1;position:relative}.mat-mdc-button .mat-focus-indicator,.mat-mdc-unelevated-button .mat-focus-indicator,.mat-mdc-raised-button .mat-focus-indicator,.mat-mdc-outlined-button .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-button:focus>.mat-focus-indicator::before,.mat-mdc-unelevated-button:focus>.mat-focus-indicator::before,.mat-mdc-raised-button:focus>.mat-focus-indicator::before,.mat-mdc-outlined-button:focus>.mat-focus-indicator::before{content:""}.mat-mdc-button._mat-animation-noopable,.mat-mdc-unelevated-button._mat-animation-noopable,.mat-mdc-raised-button._mat-animation-noopable,.mat-mdc-outlined-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-button>.mat-icon,.mat-mdc-unelevated-button>.mat-icon,.mat-mdc-raised-button>.mat-icon,.mat-mdc-outlined-button>.mat-icon{display:inline-block;position:relative;vertical-align:top;font-size:1.125rem;height:1.125rem;width:1.125rem}.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mdc-button__ripple{top:-1px;left:-1px;bottom:-1px;right:-1px}.mat-mdc-unelevated-button .mat-focus-indicator::before,.mat-mdc-raised-button .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-outlined-button .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 3px)*-1)}',"@media(forced-colors: active){.mat-mdc-button:not(.mdc-button--outlined),.mat-mdc-unelevated-button:not(.mdc-button--outlined),.mat-mdc-raised-button:not(.mdc-button--outlined),.mat-mdc-outlined-button:not(.mdc-button--outlined),.mat-mdc-icon-button.mat-mdc-icon-button{outline:solid 1px}}"],encapsulation:2,changeDetection:0})}return n})(),zW=(()=>{class n extends STe{static \u0275fac=(()=>{let t;return function(i){return(t||(t=bt(n)))(i||n)}})();static \u0275cmp=He({type:n,selectors:[["a","mat-button",""],["a","mat-raised-button",""],["a","mat-flat-button",""],["a","mat-stroked-button",""]],hostVars:15,hostBindings:function(r,i){2&r&&(Ke("disabled",i._getDisabledAttribute())("tabindex",i.disabled&&!i.disabledInteractive?-1:i.tabIndex)("aria-disabled",i._getAriaDisabled()),Fa(i.color?"mat-"+i.color:""),at("mat-mdc-button-disabled",i.disabled)("mat-mdc-button-disabled-interactive",i.disabledInteractive)("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-unthemed",!i.color)("mat-mdc-button-base",!0))},exportAs:["matButton","matAnchor"],features:[ke],attrs:LW,ngContentSelectors:BW,decls:7,vars:4,consts:[[1,"mat-mdc-button-persistent-ripple"],[1,"mdc-button__label"],[1,"mat-focus-indicator"],[1,"mat-mdc-button-touch-target"]],template:function(r,i){1&r&&(Hn(VW),Pe(0,"span",0),Ae(1),W(2,"span",1),Ae(3,1),K(),Ae(4,2),Pe(5,"span",2)(6,"span",3)),2&r&&at("mdc-button__ripple",!i._isFab)("mdc-fab__ripple",i._isFab)},styles:['.mat-mdc-button-base{text-decoration:none}.mdc-button{-webkit-user-select:none;user-select:none;position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:64px;border:none;outline:none;line-height:inherit;-webkit-appearance:none;overflow:visible;vertical-align:middle;background:rgba(0,0,0,0);padding:0 8px}.mdc-button::-moz-focus-inner{padding:0;border:0}.mdc-button:active{outline:none}.mdc-button:hover{cursor:pointer}.mdc-button:disabled{cursor:default;pointer-events:none}.mdc-button[hidden]{display:none}.mdc-button .mdc-button__label{position:relative}.mat-mdc-button{padding:0 var(--mat-text-button-horizontal-padding, 12px);height:var(--mdc-text-button-container-height, 40px);font-family:var(--mdc-text-button-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-text-button-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mdc-text-button-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mdc-text-button-label-text-transform);font-weight:var(--mdc-text-button-label-text-weight, var(--mat-sys-label-large-weight))}.mat-mdc-button,.mat-mdc-button .mdc-button__ripple{border-radius:var(--mdc-text-button-container-shape, var(--mat-sys-corner-full))}.mat-mdc-button:not(:disabled){color:var(--mdc-text-button-label-text-color, var(--mat-sys-primary))}.mat-mdc-button[disabled],.mat-mdc-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-text-button-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-button:has(.material-icons,mat-icon,[matButtonIcon]){padding:0 var(--mat-text-button-with-icon-horizontal-padding, 16px)}.mat-mdc-button>.mat-icon{margin-right:var(--mat-text-button-icon-spacing, 8px);margin-left:var(--mat-text-button-icon-offset, -4px)}[dir=rtl] .mat-mdc-button>.mat-icon{margin-right:var(--mat-text-button-icon-offset, -4px);margin-left:var(--mat-text-button-icon-spacing, 8px)}.mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-text-button-icon-offset, -4px);margin-left:var(--mat-text-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-text-button-icon-spacing, 8px);margin-left:var(--mat-text-button-icon-offset, -4px)}.mat-mdc-button .mat-ripple-element{background-color:var(--mat-text-button-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-text-button-state-layer-color, var(--mat-sys-primary))}.mat-mdc-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-text-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-text-button-touch-target-display, block)}.mat-mdc-unelevated-button{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mdc-filled-button-container-height, 40px);font-family:var(--mdc-filled-button-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-filled-button-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mdc-filled-button-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mdc-filled-button-label-text-transform);font-weight:var(--mdc-filled-button-label-text-weight, var(--mat-sys-label-large-weight));padding:0 var(--mat-filled-button-horizontal-padding, 24px)}.mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-filled-button-icon-spacing, 8px);margin-left:var(--mat-filled-button-icon-offset, -8px)}[dir=rtl] .mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-filled-button-icon-offset, -8px);margin-left:var(--mat-filled-button-icon-spacing, 8px)}.mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-filled-button-icon-offset, -8px);margin-left:var(--mat-filled-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-filled-button-icon-spacing, 8px);margin-left:var(--mat-filled-button-icon-offset, -8px)}.mat-mdc-unelevated-button .mat-ripple-element{background-color:var(--mat-filled-button-ripple-color, color-mix(in srgb, var(--mat-sys-on-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-filled-button-state-layer-color, var(--mat-sys-on-primary))}.mat-mdc-unelevated-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-filled-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-unelevated-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-unelevated-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-unelevated-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-unelevated-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-filled-button-touch-target-display, block)}.mat-mdc-unelevated-button:not(:disabled){color:var(--mdc-filled-button-label-text-color, var(--mat-sys-on-primary));background-color:var(--mdc-filled-button-container-color, var(--mat-sys-primary))}.mat-mdc-unelevated-button,.mat-mdc-unelevated-button .mdc-button__ripple{border-radius:var(--mdc-filled-button-container-shape, var(--mat-sys-corner-full))}.mat-mdc-unelevated-button[disabled],.mat-mdc-unelevated-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-filled-button-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mdc-filled-button-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-raised-button{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);box-shadow:var(--mdc-protected-button-container-elevation-shadow, var(--mat-sys-level1));height:var(--mdc-protected-button-container-height, 40px);font-family:var(--mdc-protected-button-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-protected-button-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mdc-protected-button-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mdc-protected-button-label-text-transform);font-weight:var(--mdc-protected-button-label-text-weight, var(--mat-sys-label-large-weight));padding:0 var(--mat-protected-button-horizontal-padding, 24px)}.mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-protected-button-icon-spacing, 8px);margin-left:var(--mat-protected-button-icon-offset, -8px)}[dir=rtl] .mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-protected-button-icon-offset, -8px);margin-left:var(--mat-protected-button-icon-spacing, 8px)}.mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-protected-button-icon-offset, -8px);margin-left:var(--mat-protected-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-protected-button-icon-spacing, 8px);margin-left:var(--mat-protected-button-icon-offset, -8px)}.mat-mdc-raised-button .mat-ripple-element{background-color:var(--mat-protected-button-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-protected-button-state-layer-color, var(--mat-sys-primary))}.mat-mdc-raised-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-protected-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-raised-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-raised-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-raised-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-raised-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-protected-button-touch-target-display, block)}.mat-mdc-raised-button:not(:disabled){color:var(--mdc-protected-button-label-text-color, var(--mat-sys-primary));background-color:var(--mdc-protected-button-container-color, var(--mat-sys-surface))}.mat-mdc-raised-button,.mat-mdc-raised-button .mdc-button__ripple{border-radius:var(--mdc-protected-button-container-shape, var(--mat-sys-corner-full))}.mat-mdc-raised-button:hover{box-shadow:var(--mdc-protected-button-hover-container-elevation-shadow, var(--mat-sys-level2))}.mat-mdc-raised-button:focus{box-shadow:var(--mdc-protected-button-focus-container-elevation-shadow, var(--mat-sys-level1))}.mat-mdc-raised-button:active,.mat-mdc-raised-button:focus:active{box-shadow:var(--mdc-protected-button-pressed-container-elevation-shadow, var(--mat-sys-level1))}.mat-mdc-raised-button[disabled],.mat-mdc-raised-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-protected-button-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mdc-protected-button-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-raised-button[disabled].mat-mdc-button-disabled,.mat-mdc-raised-button.mat-mdc-button-disabled.mat-mdc-button-disabled{box-shadow:var(--mdc-protected-button-disabled-container-elevation-shadow, var(--mat-sys-level0))}.mat-mdc-raised-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-outlined-button{border-style:solid;transition:border 280ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mdc-outlined-button-container-height, 40px);font-family:var(--mdc-outlined-button-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-outlined-button-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mdc-outlined-button-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mdc-outlined-button-label-text-transform);font-weight:var(--mdc-outlined-button-label-text-weight, var(--mat-sys-label-large-weight));border-radius:var(--mdc-outlined-button-container-shape, var(--mat-sys-corner-full));border-width:var(--mdc-outlined-button-outline-width, 1px);padding:0 var(--mat-outlined-button-horizontal-padding, 24px)}.mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-outlined-button-icon-spacing, 8px);margin-left:var(--mat-outlined-button-icon-offset, -8px)}[dir=rtl] .mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-outlined-button-icon-offset, -8px);margin-left:var(--mat-outlined-button-icon-spacing, 8px)}.mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-outlined-button-icon-offset, -8px);margin-left:var(--mat-outlined-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-outlined-button-icon-spacing, 8px);margin-left:var(--mat-outlined-button-icon-offset, -8px)}.mat-mdc-outlined-button .mat-ripple-element{background-color:var(--mat-outlined-button-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-outlined-button-state-layer-color, var(--mat-sys-primary))}.mat-mdc-outlined-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-outlined-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-outlined-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-outlined-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-outlined-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-outlined-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-outlined-button-touch-target-display, block)}.mat-mdc-outlined-button:not(:disabled){color:var(--mdc-outlined-button-label-text-color, var(--mat-sys-primary));border-color:var(--mdc-outlined-button-outline-color, var(--mat-sys-outline))}.mat-mdc-outlined-button[disabled],.mat-mdc-outlined-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-outlined-button-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:var(--mdc-outlined-button-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-outlined-button .mdc-button__ripple{border-width:var(--mdc-outlined-button-outline-width, 1px);border-style:solid;border-color:rgba(0,0,0,0)}.mat-mdc-button,.mat-mdc-unelevated-button,.mat-mdc-raised-button,.mat-mdc-outlined-button{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-button .mdc-button__label,.mat-mdc-button .mat-icon,.mat-mdc-unelevated-button .mdc-button__label,.mat-mdc-unelevated-button .mat-icon,.mat-mdc-raised-button .mdc-button__label,.mat-mdc-raised-button .mat-icon,.mat-mdc-outlined-button .mdc-button__label,.mat-mdc-outlined-button .mat-icon{z-index:1;position:relative}.mat-mdc-button .mat-focus-indicator,.mat-mdc-unelevated-button .mat-focus-indicator,.mat-mdc-raised-button .mat-focus-indicator,.mat-mdc-outlined-button .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-button:focus>.mat-focus-indicator::before,.mat-mdc-unelevated-button:focus>.mat-focus-indicator::before,.mat-mdc-raised-button:focus>.mat-focus-indicator::before,.mat-mdc-outlined-button:focus>.mat-focus-indicator::before{content:""}.mat-mdc-button._mat-animation-noopable,.mat-mdc-unelevated-button._mat-animation-noopable,.mat-mdc-raised-button._mat-animation-noopable,.mat-mdc-outlined-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-button>.mat-icon,.mat-mdc-unelevated-button>.mat-icon,.mat-mdc-raised-button>.mat-icon,.mat-mdc-outlined-button>.mat-icon{display:inline-block;position:relative;vertical-align:top;font-size:1.125rem;height:1.125rem;width:1.125rem}.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mdc-button__ripple{top:-1px;left:-1px;bottom:-1px;right:-1px}.mat-mdc-unelevated-button .mat-focus-indicator::before,.mat-mdc-raised-button .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-outlined-button .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 3px)*-1)}',UW],encapsulation:2,changeDetection:0})}return n})(),ATe=(()=>{class n extends pR{constructor(){super(),this._rippleLoader.configureRipple(this._elementRef.nativeElement,{centered:!0})}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["button","mat-icon-button",""]],hostVars:14,hostBindings:function(r,i){2&r&&(Ke("disabled",i._getDisabledAttribute())("aria-disabled",i._getAriaDisabled()),Fa(i.color?"mat-"+i.color:""),at("mat-mdc-button-disabled",i.disabled)("mat-mdc-button-disabled-interactive",i.disabledInteractive)("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-unthemed",!i.color)("mat-mdc-button-base",!0))},exportAs:["matButton"],features:[ke],attrs:ITe,ngContentSelectors:TTe,decls:4,vars:0,consts:[[1,"mat-mdc-button-persistent-ripple","mdc-icon-button__ripple"],[1,"mat-focus-indicator"],[1,"mat-mdc-button-touch-target"]],template:function(r,i){1&r&&(Hn(),Pe(0,"span",0),Ae(1),Pe(2,"span",1)(3,"span",2))},styles:['.mat-mdc-icon-button{-webkit-user-select:none;user-select:none;display:inline-block;position:relative;box-sizing:border-box;border:none;outline:none;background-color:rgba(0,0,0,0);fill:currentColor;color:inherit;text-decoration:none;cursor:pointer;z-index:0;overflow:visible;border-radius:50%;flex-shrink:0;text-align:center;width:var(--mdc-icon-button-state-layer-size, 40px);height:var(--mdc-icon-button-state-layer-size, 40px);padding:calc(calc(var(--mdc-icon-button-state-layer-size, 40px) - var(--mdc-icon-button-icon-size, 24px)) / 2);font-size:var(--mdc-icon-button-icon-size, 24px);color:var(--mdc-icon-button-icon-color, var(--mat-sys-on-surface-variant));-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-icon-button .mat-mdc-button-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-icon-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-icon-button .mdc-button__label,.mat-mdc-icon-button .mat-icon{z-index:1;position:relative}.mat-mdc-icon-button .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-icon-button:focus>.mat-focus-indicator::before{content:""}.mat-mdc-icon-button .mat-ripple-element{background-color:var(--mat-icon-button-ripple-color, color-mix(in srgb, var(--mat-sys-on-surface-variant) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-icon-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-icon-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-icon-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-icon-button-touch-target-display, block)}.mat-mdc-icon-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-icon-button[disabled],.mat-mdc-icon-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-icon-button-disabled-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-icon-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-icon-button img,.mat-mdc-icon-button svg{width:var(--mdc-icon-button-icon-size, 24px);height:var(--mdc-icon-button-icon-size, 24px);vertical-align:baseline}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple{border-radius:50%}.mat-mdc-icon-button[hidden]{display:none}.mat-mdc-icon-button.mat-unthemed:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-primary:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-accent:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-warn:not(.mdc-ripple-upgraded):focus::before{background:rgba(0,0,0,0);opacity:1}',UW],encapsulation:2,changeDetection:0})}return n})(),hh=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[gn,vW,gn]})}return n})(),jW=(()=>{class n{get vertical(){return this._vertical}set vertical(t){this._vertical=Qa(t)}_vertical=!1;get inset(){return this._inset}set inset(t){this._inset=Qa(t)}_inset=!1;static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-divider"]],hostAttrs:["role","separator",1,"mat-divider"],hostVars:7,hostBindings:function(r,i){2&r&&(Ke("aria-orientation",i.vertical?"vertical":"horizontal"),at("mat-divider-vertical",i.vertical)("mat-divider-horizontal",!i.vertical)("mat-divider-inset",i.inset))},inputs:{vertical:"vertical",inset:"inset"},decls:0,vars:0,template:function(r,i){},styles:[".mat-divider{display:block;margin:0;border-top-style:solid;border-top-color:var(--mat-divider-color, var(--mat-sys-outline));border-top-width:var(--mat-divider-width, 1px)}.mat-divider.mat-divider-vertical{border-top:0;border-right-style:solid;border-right-color:var(--mat-divider-color, var(--mat-sys-outline));border-right-width:var(--mat-divider-width, 1px)}.mat-divider.mat-divider-inset{margin-left:80px}[dir=rtl] .mat-divider.mat-divider-inset{margin-left:auto;margin-right:80px}"],encapsulation:2,changeDetection:0})}return n})(),HW=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[gn,gn]})}return n})();const RTe=["determinateSpinner"];function MTe(n,e){if(1&n&&(tp(),W(0,"svg",11),Pe(1,"circle",12),K()),2&n){const t=Ln();Ke("viewBox",t._viewBox()),re(),Bd("stroke-dasharray",t._strokeCircumference(),"px")("stroke-dashoffset",t._strokeCircumference()/2,"px")("stroke-width",t._circleStrokeWidth(),"%"),Ke("r",t._circleRadius())}}const kTe=new B("mat-progress-spinner-default-options",{providedIn:"root",factory:function NTe(){return{diameter:$W}}}),$W=100;let OTe=(()=>{class n{_elementRef=b(je);_noopAnimations;get color(){return this._color||this._defaultColor}set color(t){this._color=t}_color;_defaultColor="primary";_determinateCircle;constructor(){const t=b(Ts,{optional:!0}),r=b(kTe);this._noopAnimations="NoopAnimations"===t&&!!r&&!r._forceAnimations,this.mode="mat-spinner"===this._elementRef.nativeElement.nodeName.toLowerCase()?"indeterminate":"determinate",r&&(r.color&&(this.color=this._defaultColor=r.color),r.diameter&&(this.diameter=r.diameter),r.strokeWidth&&(this.strokeWidth=r.strokeWidth))}mode;get value(){return"determinate"===this.mode?this._value:0}set value(t){this._value=Math.max(0,Math.min(100,t||0))}_value=0;get diameter(){return this._diameter}set diameter(t){this._diameter=t||0}_diameter=$W;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(t){this._strokeWidth=t||0}_strokeWidth;_circleRadius(){return(this.diameter-10)/2}_viewBox(){const t=2*this._circleRadius()+this.strokeWidth;return`0 0 ${t} ${t}`}_strokeCircumference(){return 2*Math.PI*this._circleRadius()}_strokeDashOffset(){return"determinate"===this.mode?this._strokeCircumference()*(100-this._value)/100:null}_circleStrokeWidth(){return this.strokeWidth/this.diameter*100}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(r,i){if(1&r&&qn(RTe,5),2&r){let o;Qe(o=Ye())&&(i._determinateCircle=o.first)}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(r,i){2&r&&(Ke("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow","determinate"===i.mode?i.value:null)("mode",i.mode),Fa("mat-"+i.color),Bd("width",i.diameter,"px")("height",i.diameter,"px")("--mdc-circular-progress-size",i.diameter+"px")("--mdc-circular-progress-active-indicator-width",i.diameter+"px"),at("_mat-animation-noopable",i._noopAnimations)("mdc-circular-progress--indeterminate","indeterminate"===i.mode))},inputs:{color:"color",mode:"mode",value:[2,"value","value",$d],diameter:[2,"diameter","diameter",$d],strokeWidth:[2,"strokeWidth","strokeWidth",$d]},exportAs:["matProgressSpinner"],decls:14,vars:11,consts:[["circle",""],["determinateSpinner",""],["aria-hidden","true",1,"mdc-circular-progress__determinate-container"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__determinate-circle-graphic"],["cx","50%","cy","50%",1,"mdc-circular-progress__determinate-circle"],["aria-hidden","true",1,"mdc-circular-progress__indeterminate-container"],[1,"mdc-circular-progress__spinner-layer"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-left"],[3,"ngTemplateOutlet"],[1,"mdc-circular-progress__gap-patch"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-right"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__indeterminate-circle-graphic"],["cx","50%","cy","50%"]],template:function(r,i){if(1&r&&(et(0,MTe,2,8,"ng-template",null,0,tD),W(2,"div",2,1),tp(),W(4,"svg",3),Pe(5,"circle",4),K()(),_0(),W(6,"div",5)(7,"div",6)(8,"div",7),Xp(9,8),K(),W(10,"div",9),Xp(11,8),K(),W(12,"div",10),Xp(13,8),K()()()),2&r){const o=rm(1);re(4),Ke("viewBox",i._viewBox()),re(),Bd("stroke-dasharray",i._strokeCircumference(),"px")("stroke-dashoffset",i._strokeDashOffset(),"px")("stroke-width",i._circleStrokeWidth(),"%"),Ke("r",i._circleRadius()),re(4),De("ngTemplateOutlet",o),re(2),De("ngTemplateOutlet",o),re(2),De("ngTemplateOutlet",o)}},dependencies:[ND],styles:[".mat-mdc-progress-spinner{display:block;overflow:hidden;line-height:0;position:relative;direction:ltr;transition:opacity 250ms cubic-bezier(0.4, 0, 0.6, 1)}.mat-mdc-progress-spinner circle{stroke-width:var(--mdc-circular-progress-active-indicator-width, 4px)}.mat-mdc-progress-spinner._mat-animation-noopable,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__determinate-circle{transition:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__spinner-layer,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container{animation:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container circle{stroke-dasharray:0 !important}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle{stroke:currentColor;stroke:CanvasText}}.mdc-circular-progress__determinate-container,.mdc-circular-progress__indeterminate-circle-graphic,.mdc-circular-progress__indeterminate-container,.mdc-circular-progress__spinner-layer{position:absolute;width:100%;height:100%}.mdc-circular-progress__determinate-container{transform:rotate(-90deg)}.mdc-circular-progress--indeterminate .mdc-circular-progress__determinate-container{opacity:0}.mdc-circular-progress__indeterminate-container{font-size:0;letter-spacing:0;white-space:nowrap;opacity:0}.mdc-circular-progress--indeterminate .mdc-circular-progress__indeterminate-container{opacity:1;animation:mdc-circular-progress-container-rotate 1568.2352941176ms linear infinite}.mdc-circular-progress__determinate-circle-graphic,.mdc-circular-progress__indeterminate-circle-graphic{fill:rgba(0,0,0,0)}.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:var(--mdc-circular-progress-active-indicator-color, var(--mat-sys-primary))}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:CanvasText}}.mdc-circular-progress__determinate-circle{transition:stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1)}.mdc-circular-progress__gap-patch{position:absolute;top:0;left:47.5%;box-sizing:border-box;width:5%;height:100%;overflow:hidden}.mdc-circular-progress__gap-patch .mdc-circular-progress__indeterminate-circle-graphic{left:-900%;width:2000%;transform:rotate(180deg)}.mdc-circular-progress__circle-clipper .mdc-circular-progress__indeterminate-circle-graphic{width:200%}.mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{left:-100%}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-left .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-left-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-right-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress__circle-clipper{display:inline-flex;position:relative;width:50%;height:100%;overflow:hidden}.mdc-circular-progress--indeterminate .mdc-circular-progress__spinner-layer{animation:mdc-circular-progress-spinner-layer-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}@keyframes mdc-circular-progress-container-rotate{to{transform:rotate(360deg)}}@keyframes mdc-circular-progress-spinner-layer-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes mdc-circular-progress-left-spin{from{transform:rotate(265deg)}50%{transform:rotate(130deg)}to{transform:rotate(265deg)}}@keyframes mdc-circular-progress-right-spin{from{transform:rotate(-265deg)}50%{transform:rotate(-130deg)}to{transform:rotate(-265deg)}}"],encapsulation:2,changeDetection:0})}return n})(),qW=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[gn]})}return n})();const WW=function(n){const e=[];let t=0;for(let r=0;r>6|192,e[t++]=63&i|128):55296==(64512&i)&&r+1>18|240,e[t++]=i>>12&63|128,e[t++]=i>>6&63|128,e[t++]=63&i|128):(e[t++]=i>>12|224,e[t++]=i>>6&63|128,e[t++]=63&i|128)}return e},gR={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();const t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i>6,p=63&c;l||(p=64,s||(f=64)),r.push(t[o>>2],t[(3&o)<<4|a>>4],t[f],t[p])}return r.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(WW(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):function(n){const e=[];let t=0,r=0;for(;t191&&i<224){const o=n[t++];e[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){const l=((7&i)<<18|(63&n[t++])<<12|(63&n[t++])<<6|63&n[t++])-65536;e[r++]=String.fromCharCode(55296+(l>>10)),e[r++]=String.fromCharCode(56320+(1023&l))}else{const o=n[t++],s=n[t++];e[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&s)}}return e.join("")}(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();const t=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i>4),64!==c&&(r.push(a<<4&240|c>>2),64!==d&&r.push(c<<6&192|d))}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}};class BTe extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const nE=function(n){return function(n){const e=WW(n);return gR.encodeByteArray(e,!0)}(n).replace(/\./g,"")},rg=function(n){try{return gR.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null},rE=()=>{try{return function jTe(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}().__FIREBASE_DEFAULTS__||(()=>{if(typeof process>"u")return;const n="MISSING_ENV_VAR".__FIREBASE_DEFAULTS__;return n?JSON.parse(n):void 0})()||(()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=n&&rg(n[1]);return e&&JSON.parse(e)})()}catch(n){return void console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`)}},KW=n=>{var e,t;return null===(t=null===(e=rE())||void 0===e?void 0:e.emulatorHosts)||void 0===t?void 0:t[n]},QW=n=>{const e=KW(n);if(!e)return;const t=e.lastIndexOf(":");if(t<=0||t+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const r=parseInt(e.substring(t+1),10);return"["===e[0]?[e.substring(1,t-1),r]:[e.substring(0,t),r]},YW=()=>{var n;return null===(n=rE())||void 0===n?void 0:n.config},XW=n=>{var e;return null===(e=rE())||void 0===e?void 0:e[`_${n}`]};class iE{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,r)=>{t?this.reject(t):this.resolve(r),"function"==typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,r))}}}function ZW(n,e){if(n.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const r=e||"demo-project",i=n.iat||0,o=n.sub||n.user_id;if(!o)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const s=Object.assign({iss:`https://securetoken.google.com/${r}`,aud:r,iat:i,exp:i+3600,auth_time:i,sub:o,user_id:o,firebase:{sign_in_provider:"custom",identities:{}}},n);return[nE(JSON.stringify({alg:"none",type:"JWT"})),nE(JSON.stringify(s)),""].join(".")}function _n(){return typeof navigator<"u"&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function JW(){return!function GTe(){var n;const e=null===(n=rE())||void 0===n?void 0:n.forceEnvironment;if("node"===e)return!0;if("browser"===e)return!1;try{return"[object process]"===Object.prototype.toString.call(global.process)}catch{return!1}}()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function _R(){try{return"object"==typeof indexedDB}catch{return!1}}class Wo extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name="FirebaseError",Object.setPrototypeOf(this,Wo.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,fh.prototype.create)}}class fh{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){const r=t[0]||{},i=`${this.service}/${e}`,o=this.errors[e],s=o?function tCe(n,e){return n.replace(nCe,(t,r)=>{const i=e[r];return null!=i?String(i):`<${r}?>`})}(o,r):"Error";return new Wo(i,`${this.serviceName}: ${s} (${i}).`,r)}}const nCe=/\{\$([^}]+)}/g;function ph(n,e){if(n===e)return!0;const t=Object.keys(n),r=Object.keys(e);for(const i of t){if(!r.includes(i))return!1;const o=n[i],s=e[i];if(tG(o)&&tG(s)){if(!ph(o,s))return!1}else if(o!==s)return!1}for(const i of r)if(!t.includes(i))return!1;return!0}function tG(n){return null!==n&&"object"==typeof n}function ig(n){const e=[];for(const[t,r]of Object.entries(n))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function og(n){const e={};return n.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[i,o]=r.split("=");e[decodeURIComponent(i)]=decodeURIComponent(o)}}),e}function sg(n){const e=n.indexOf("?");if(!e)return"";const t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}class oCe{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,r){let i;if(void 0===e&&void 0===t&&void 0===r)throw new Error("Missing Observer.");i=function sCe(n,e){if("object"!=typeof n||null===n)return!1;for(const t of e)if(t in n&&"function"==typeof n[t])return!0;return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:r},void 0===i.next&&(i.next=yR),void 0===i.error&&(i.error=yR),void 0===i.complete&&(i.complete=yR);const o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),o}unsubscribeOne(e){void 0===this.observers||void 0===this.observers[e]||(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function yR(){}function sn(n){return n&&n._delegate?n._delegate:n}class Go{constructor(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}const Oc="[DEFAULT]";class hCe{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const r=new iE;if(this.instancesDeferred.set(t,r),this.isInitialized(t)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:t});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const r=this.normalizeInstanceIdentifier(e?.identifier),i=null!==(t=e?.optional)&&void 0!==t&&t;if(!this.isInitialized(r)&&!this.shouldAutoInitialize()){if(i)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:r})}catch(o){if(i)return null;throw o}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,this.shouldAutoInitialize()){if(function pCe(n){return"EAGER"===n.instantiationMode}(e))try{this.getOrInitializeService({instanceIdentifier:Oc})}catch{}for(const[t,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(t);try{const o=this.getOrInitializeService({instanceIdentifier:i});r.resolve(o)}catch{}}}}clearInstance(e=Oc){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}delete(){var e=this;return T(function*(){const t=Array.from(e.instances.values());yield Promise.all([...t.filter(r=>"INTERNAL"in r).map(r=>r.INTERNAL.delete()),...t.filter(r=>"_delete"in r).map(r=>r._delete())])})()}isComponentSet(){return null!=this.component}isInitialized(e=Oc){return this.instances.has(e)}getOptions(e=Oc){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:r,options:t});for(const[o,s]of this.instancesDeferred.entries())r===this.normalizeInstanceIdentifier(o)&&s.resolve(i);return i}onInit(e,t){var r;const i=this.normalizeInstanceIdentifier(t),o=null!==(r=this.onInitCallbacks.get(i))&&void 0!==r?r:new Set;o.add(e),this.onInitCallbacks.set(i,o);const s=this.instances.get(i);return s&&e(s,i),()=>{o.delete(e)}}invokeOnInitCallbacks(e,t){const r=this.onInitCallbacks.get(t);if(r)for(const i of r)try{i(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:(n=e,n===Oc?void 0:n),options:t}),this.instances.set(e,r),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}var n;return r||null}normalizeInstanceIdentifier(e=Oc){return this.component?this.component.multipleInstances?e:Oc:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class mCe{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new hCe(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}const bR=[];var qe=function(n){return n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT",n}(qe||{});const nG={debug:qe.DEBUG,verbose:qe.VERBOSE,info:qe.INFO,warn:qe.WARN,error:qe.ERROR,silent:qe.SILENT},gCe=qe.INFO,_Ce={[qe.DEBUG]:"log",[qe.VERBOSE]:"log",[qe.INFO]:"info",[qe.WARN]:"warn",[qe.ERROR]:"error"},yCe=(n,e,...t)=>{if(e(n[e]=t,!0),has:(n,e)=>n instanceof IDBTransaction&&("done"===e||"store"===e)||e in n};function xCe(n){return"function"==typeof n?function CCe(n){return n!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?function wCe(){return iG||(iG=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}().includes(n)?function(...e){return n.apply(CR(this),e),Za(oG.get(this))}:function(...e){return Za(n.apply(CR(this),e))}:function(e,...t){const r=n.call(CR(this),e,...t);return sG.set(r,e.sort?e.sort():[e]),Za(r)}}(n):(n instanceof IDBTransaction&&function ICe(n){if(wR.has(n))return;const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("complete",o),n.removeEventListener("error",s),n.removeEventListener("abort",s)},o=()=>{t(),i()},s=()=>{r(n.error||new DOMException("AbortError","AbortError")),i()};n.addEventListener("complete",o),n.addEventListener("error",s),n.addEventListener("abort",s)});wR.set(n,e)}(n),((n,e)=>e.some(t=>n instanceof t))(n,function bCe(){return rG||(rG=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}())?new Proxy(n,TR):n)}function Za(n){if(n instanceof IDBRequest)return function ECe(n){const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("success",o),n.removeEventListener("error",s)},o=()=>{t(Za(n.result)),i()},s=()=>{r(n.error),i()};n.addEventListener("success",o),n.addEventListener("error",s)});return e.then(t=>{t instanceof IDBCursor&&oG.set(t,n)}).catch(()=>{}),IR.set(e,n),e}(n);if(ER.has(n))return ER.get(n);const e=xCe(n);return e!==n&&(ER.set(n,e),IR.set(e,n)),e}const CR=n=>IR.get(n),DCe=["get","getKey","getAll","getAllKeys","count"],ACe=["put","add","delete","clear"],xR=new Map;function aG(n,e){if(!(n instanceof IDBDatabase)||e in n||"string"!=typeof e)return;if(xR.get(e))return xR.get(e);const t=e.replace(/FromIndex$/,""),r=e!==t,i=ACe.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!i&&!DCe.includes(t))return;const o=function(){var s=T(function*(a,...l){const c=this.transaction(a,i?"readwrite":"readonly");let u=c.store;return r&&(u=u.index(l.shift())),(yield Promise.all([u[t](...l),i&&c.done]))[0]});return function(l){return s.apply(this,arguments)}}();return xR.set(e,o),o}!function TCe(n){TR=n(TR)}(n=>({...n,get:(e,t,r)=>aG(e,t)||n.get(e,t,r),has:(e,t)=>!!aG(e,t)||n.has(e,t)}));class RCe{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(function MCe(n){const e=n.getComponent();return"VERSION"===e?.type}(t)){const r=t.getImmediate();return`${r.library}/${r.version}`}return null}).filter(t=>t).join(" ")}}const aE="@firebase/app",Os=new sE("@firebase/app"),kCe="@firebase/app-compat",NCe="@firebase/analytics-compat",PCe="@firebase/analytics",OCe="@firebase/app-check-compat",FCe="@firebase/app-check",LCe="@firebase/auth",VCe="@firebase/auth-compat",BCe="@firebase/database",UCe="@firebase/data-connect",zCe="@firebase/database-compat",jCe="@firebase/functions",HCe="@firebase/functions-compat",$Ce="@firebase/installations",qCe="@firebase/installations-compat",WCe="@firebase/messaging",GCe="@firebase/messaging-compat",KCe="@firebase/performance",QCe="@firebase/performance-compat",YCe="@firebase/remote-config",XCe="@firebase/remote-config-compat",ZCe="@firebase/storage",JCe="@firebase/storage-compat",e0e="@firebase/firestore",t0e="@firebase/vertexai",n0e="@firebase/firestore-compat",r0e="firebase",lE="[DEFAULT]",o0e={[aE]:"fire-core",[kCe]:"fire-core-compat",[PCe]:"fire-analytics",[NCe]:"fire-analytics-compat",[FCe]:"fire-app-check",[OCe]:"fire-app-check-compat",[LCe]:"fire-auth",[VCe]:"fire-auth-compat",[BCe]:"fire-rtdb",[UCe]:"fire-data-connect",[zCe]:"fire-rtdb-compat",[jCe]:"fire-fn",[HCe]:"fire-fn-compat",[$Ce]:"fire-iid",[qCe]:"fire-iid-compat",[WCe]:"fire-fcm",[GCe]:"fire-fcm-compat",[KCe]:"fire-perf",[QCe]:"fire-perf-compat",[YCe]:"fire-rc",[XCe]:"fire-rc-compat",[ZCe]:"fire-gcs",[JCe]:"fire-gcs-compat",[e0e]:"fire-fst",[n0e]:"fire-fst-compat",[t0e]:"fire-vertex","fire-js":"fire-js",[r0e]:"fire-js-all"},Fc=new Map,ag=new Map,lg=new Map;function lG(n,e){try{n.container.addComponent(e)}catch(t){Os.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function Fs(n){const e=n.name;if(lg.has(e))return Os.debug(`There were multiple attempts to register component ${e}.`),!1;lg.set(e,n);for(const t of Fc.values())lG(t,n);for(const t of ag.values())lG(t,n);return!0}function cg(n,e){const t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}function ai(n){return null!=n&&void 0!==n.settings}const Zi=new fh("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."});class cG{constructor(e,t,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new Go("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw Zi.create("app-deleted",{appName:this._name})}}const Lc="11.3.1";function dG(n,e={}){let t=n;"object"!=typeof e&&(e={name:e});const r=Object.assign({name:lE,automaticDataCollectionEnabled:!1},e),i=r.name;if("string"!=typeof i||!i)throw Zi.create("bad-app-name",{appName:String(i)});if(t||(t=YW()),!t)throw Zi.create("no-options");const o=Fc.get(i);if(o){if(ph(t,o.options)&&ph(r,o.config))return o;throw Zi.create("duplicate-app",{appName:i})}const s=new mCe(i);for(const l of lg.values())s.addComponent(l);const a=new cG(t,r,s);return Fc.set(i,a),a}function cE(n=lE){const e=Fc.get(n);if(!e&&n===lE&&YW())return dG();if(!e)throw Zi.create("no-app",{appName:n});return e}function hG(){return Array.from(Fc.values())}function Gn(n,e,t){var r;let i=null!==(r=o0e[n])&&void 0!==r?r:n;t&&(i+=`-${t}`);const o=i.match(/\s|\//),s=e.match(/\s|\//);if(o||s){const a=[`Unable to register library "${i}" with version "${e}":`];return o&&a.push(`library name "${i}" contains illegal characters (whitespace or "/")`),o&&s&&a.push("and"),s&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),void Os.warn(a.join(" "))}Fs(new Go(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}const ug="firebase-heartbeat-store";let AR=null;function fG(){return AR||(AR=function SCe(n,e,{blocked:t,upgrade:r,blocking:i,terminated:o}={}){const s=indexedDB.open(n,e),a=Za(s);return r&&s.addEventListener("upgradeneeded",l=>{r(Za(s.result),l.oldVersion,l.newVersion,Za(s.transaction),l)}),t&&s.addEventListener("blocked",l=>t(l.oldVersion,l.newVersion,l)),a.then(l=>{o&&l.addEventListener("close",()=>o()),i&&l.addEventListener("versionchange",c=>i(c.oldVersion,c.newVersion,c))}).catch(()=>{}),a}("firebase-heartbeat-database",1,{upgrade:(n,e)=>{if(0===e)try{n.createObjectStore(ug)}catch(t){console.warn(t)}}}).catch(n=>{throw Zi.create("idb-open",{originalErrorMessage:n.message})})),AR}function RR(){return(RR=T(function*(n){try{const t=(yield fG()).transaction(ug),r=yield t.objectStore(ug).get(mG(n));return yield t.done,r}catch(e){if(e instanceof Wo)Os.warn(e.message);else{const t=Zi.create("idb-get",{originalErrorMessage:e?.message});Os.warn(t.message)}}})).apply(this,arguments)}function pG(n,e){return MR.apply(this,arguments)}function MR(){return(MR=T(function*(n,e){try{const r=(yield fG()).transaction(ug,"readwrite");yield r.objectStore(ug).put(e,mG(n)),yield r.done}catch(t){if(t instanceof Wo)Os.warn(t.message);else{const r=Zi.create("idb-set",{originalErrorMessage:t?.message});Os.warn(r.message)}}})).apply(this,arguments)}function mG(n){return`${n.name}!${n.options.appId}`}class m0e{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new _0e(t),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}triggerHeartbeat(){var e=this;return T(function*(){var t,r;try{const o=e.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=gG();if(null==(null===(t=e._heartbeatsCache)||void 0===t?void 0:t.heartbeats)&&(e._heartbeatsCache=yield e._heartbeatsCachePromise,null==(null===(r=e._heartbeatsCache)||void 0===r?void 0:r.heartbeats))||e._heartbeatsCache.lastSentHeartbeatDate===s||e._heartbeatsCache.heartbeats.some(a=>a.date===s))return;if(e._heartbeatsCache.heartbeats.push({date:s,agent:o}),e._heartbeatsCache.heartbeats.length>30){const a=function y0e(n){if(0===n.length)return-1;let e=0,t=n[0].date;for(let r=1;rs.agent===i.agent);if(o){if(o.dates.push(i.date),_G(t)>e){o.dates.pop();break}}else if(t.push({agent:i.agent,dates:[i.date]}),_G(t)>e){t.pop();break}r=r.slice(1)}return{heartbeatsToSend:t,unsentEntries:r}}(e._heartbeatsCache.heartbeats),s=nE(JSON.stringify({version:2,heartbeats:i}));return e._heartbeatsCache.lastSentHeartbeatDate=r,o.length>0?(e._heartbeatsCache.heartbeats=o,yield e._storage.overwrite(e._heartbeatsCache)):(e._heartbeatsCache.heartbeats=[],e._storage.overwrite(e._heartbeatsCache)),s}catch(r){return Os.warn(r),""}})()}}function gG(){return(new Date).toISOString().substring(0,10)}class _0e{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}runIndexedDBEnvironmentCheck(){return T(function*(){return!!_R()&&function JTe(){return new Promise((n,e)=>{try{let t=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),t||self.indexedDB.deleteDatabase(r),n(!0)},i.onupgradeneeded=()=>{t=!1},i.onerror=()=>{var o;e((null===(o=i.error)||void 0===o?void 0:o.message)||"")}}catch(t){e(t)}})}().then(()=>!0).catch(()=>!1)})()}read(){var e=this;return T(function*(){if(yield e._canUseIndexedDBPromise){const r=yield function h0e(n){return RR.apply(this,arguments)}(e.app);return r?.heartbeats?r:{heartbeats:[]}}return{heartbeats:[]}})()}overwrite(e){var t=this;return T(function*(){var r;if(yield t._canUseIndexedDBPromise){const o=yield t.read();return pG(t.app,{lastSentHeartbeatDate:null!==(r=e.lastSentHeartbeatDate)&&void 0!==r?r:o.lastSentHeartbeatDate,heartbeats:e.heartbeats})}})()}add(e){var t=this;return T(function*(){var r;if(yield t._canUseIndexedDBPromise){const o=yield t.read();return pG(t.app,{lastSentHeartbeatDate:null!==(r=e.lastSentHeartbeatDate)&&void 0!==r?r:o.lastSentHeartbeatDate,heartbeats:[...o.heartbeats,...e.heartbeats]})}})()}}function _G(n){return nE(JSON.stringify({version:2,heartbeats:n})).length}function kR(n,e){const t=!e?.manualCleanup;t&&!e?.injector&&va();const r=t?e?.injector?.get(uo)??b(uo):null,i=function I0e(n=Object.is){return(e,t)=>1===e.kind&&1===t.kind&&n(e.value,t.value)}(e?.equal);let o;o=ti(e?.requireSync?{kind:0}:{kind:1,value:e?.initialValue},{equal:i});const s=n.subscribe({next:a=>o.set({kind:1,value:a}),error:a=>{if(e?.rejectErrors)throw a;o.set({kind:2,error:a})}});if(e?.requireSync&&0===o().kind)throw new O(601,!1);return r?.onDestroy(s.unsubscribe.bind(s)),xi(()=>{const a=o();switch(a.kind){case 1:return a.value;case 2:throw a.error;case 0:throw new O(601,!1)}},{equal:e?.equal})}!function v0e(n){Fs(new Go("platform-logger",e=>new RCe(e),"PRIVATE")),Fs(new Go("heartbeat",e=>new m0e(e),"PRIVATE")),Gn(aE,"0.11.1",n),Gn(aE,"0.11.1","esm2017"),Gn("fire-js","")}(""),Gn("firebase","11.3.1","app");const S0e=new class x0e extends Uw{}(class C0e extends Bw{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,r=0){return null!=r&&r>0||null==r&&this.delay>0?super.requestAsyncId(e,t,r):(e.flush(this),0)}}),dg=new vc("ANGULARFIRE2_VERSION");function uE(n,e,t){if(e){if(1===e.length)return e[0];const o=e.filter(s=>s.app===t);if(1===o.length)return o[0]}return t.container.getProvider(n).getImmediate({optional:!0})}const dE=(n,e)=>{const t=e?[e]:hG(),r=[];return t.forEach(i=>{i.container.getProvider(n).instances.forEach(s=>{r.includes(s)||r.push(s)})}),r};var mh=function(n){return n[n.SILENT=0]="SILENT",n[n.WARN=1]="WARN",n[n.VERBOSE=2]="VERBOSE",n}(mh||{}),NR=k$()&&typeof Zone<"u"?mh.WARN:mh.SILENT;class wG{zone;delegate;constructor(e,t=S0e){this.zone=e,this.delegate=t}now(){return this.delegate.now()}schedule(e,t,r){const i=this.zone;return this.delegate.schedule(function(s){i?i.runGuarded(()=>{e.apply(this,[s])}):e.apply(this,[s])},t,r)}}let hg=(()=>{class n{outsideAngular;insideAngular;constructor(){const t=b(ue);this.outsideAngular=t.runOutsideAngular(()=>new wG(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=t.run(()=>new wG(typeof Zone>"u"?void 0:Zone.current,zw))}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var EG=!1;function Vc(n){const e=b(ue,{optional:!0});return e?e.run(()=>n()):n()}const R0e=(n,e,t)=>(...r)=>(e&&setTimeout(e,0),yi(t,()=>Vc(()=>n.apply(void 0,r)))),ir=(n,e,t)=>(t||=e?mh.WARN:mh.VERBOSE,function(){let r;const i=arguments;let o,s,a;try{o=b(hg),s=b(R0),a=b(mr)}catch{return function D0e(n,e){!EG&&(NR>mh.SILENT||!1)&&(EG=!0,console.warn("Calling Firebase APIs outside of an Injection context may destabilize your application leading to subtle change-detection and hydration bugs. Find more at https://github.com/angular/angularfire/blob/main/docs/zones.md")),NR>=e&&console.warn(`Firebase API called outside injection context: ${n.name}`)}(n,t),n.apply(this,i)}for(let c=0;cs.add())),i[c]=R0e(i[c],r,a));const l=function A0e(n){const e=b(ue,{optional:!0});return e?e.runOutsideAngular(()=>n()):n()}(()=>n.apply(this,i));return e?l instanceof vt?l.pipe(Kb(o.outsideAngular),Gb(o.insideAngular),function bG(n){void 0===n&&(va(),n=b(ze));const e=n.get(R0);return t=>new vt(r=>{const i=e.add();let o=!1;function s(){o||(i(),o=!0)}const a=t.subscribe({next:l=>{r.next(l),s()},complete:()=>{r.complete(),s()},error:l=>{r.error(l),s()}});return a.add(()=>{r.unsubscribe(),s()}),a})}(a)):l instanceof Promise?Vc(()=>new Promise((c,u)=>{s.run(()=>l).then(d=>yi(a,()=>Vc(()=>c(d))),d=>yi(a,()=>Vc(()=>u(d))))})):"function"==typeof l&&r?function(){return setTimeout(r,0),l.apply(this,arguments)}:Vc(()=>l):l instanceof vt?l.pipe(Kb(o.outsideAngular),Gb(o.insideAngular)):Vc(()=>l)});class Bc{constructor(e){return e}}class hE{constructor(){return hG()}}const PR=new B("angularfire2._apps"),k0e={provide:Bc,useFactory:function M0e(n){return n&&1===n.length?n[0]:new Bc(cE())},deps:[[new fn,PR]]},N0e={provide:hE,deps:[[new fn,PR]]};function P0e(n){return(e,t)=>{const r=t.get(Ia);Gn("angularfire",dg.full,"core"),Gn("angularfire",dg.full,"app"),Gn("angular",Ffe.full,r.toString());const i=e.runOutsideAngular(()=>n(t));return new Bc(i)}}const F0e=ir(dG,!0),OR=new Map,IG={activated:!1,tokenObservers:[]},L0e={initialized:!1,enabled:!1};function an(n){return OR.get(n)||Object.assign({},IG)}function fE(){return L0e}class H0e{constructor(e,t,r,i,o){if(this.operation=e,this.retryPolicy=t,this.getWaitDuration=r,this.lowerBound=i,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=i,i>o)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(e){var t=this;return T(function*(){t.stop();try{t.pending=new iE,t.pending.promise.catch(r=>{}),yield function $0e(n){return new Promise(e=>{setTimeout(e,n)})}(t.getNextRun(e)),t.pending.resolve(),yield t.pending.promise,t.pending=new iE,t.pending.promise.catch(r=>{}),yield t.operation(),t.pending.resolve(),yield t.pending.promise,t.process(!0).catch(()=>{})}catch(r){t.retryPolicy(r)?t.process(!1).catch(()=>{}):t.stop()}})()}getNextRun(e){if(e)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{const t=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),t}}}const or=new fh("appCheck","AppCheck",{"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.",throttled:"Requests throttled due to {$httpStatus} error. Attempts allowed again after {$time}"});function LR(n){if(!an(n).activated)throw or.create("use-before-activation",{appName:n.name})}function gE(n,e){return BR.apply(this,arguments)}function BR(){return(BR=T(function*({url:n,body:e},t){const r={"Content-Type":"application/json"},i=t.getImmediate({optional:!0});if(i){const d=yield i.getHeartbeatsHeader();d&&(r["X-Firebase-Client"]=d)}const o={method:"POST",body:JSON.stringify(e),headers:r};let s,a;try{s=yield fetch(n,o)}catch(d){throw or.create("fetch-network-error",{originalErrorMessage:d?.message})}if(200!==s.status)throw or.create("fetch-status-error",{httpStatus:s.status});try{a=yield s.json()}catch(d){throw or.create("fetch-parse-error",{originalErrorMessage:d?.message})}const l=a.ttl.match(/^([\d.]+)(s)$/);if(!l||!l[2]||isNaN(Number(l[1])))throw or.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${a.ttl}`});const c=1e3*Number(l[1]),u=Date.now();return{token:a.token,expireTimeMillis:u+c,issuedAtTimeMillis:u}})).apply(this,arguments)}function CG(n,e){const{projectId:t,appId:r,apiKey:i}=n.options;return{url:`https://content-firebaseappcheck.googleapis.com/v1/projects/${t}/apps/${r}:exchangeDebugToken?key=${i}`,body:{debug_token:e}}}const fg="firebase-app-check-store";let _E=null;function UR(){return(UR=T(function*(n,e){const r=(yield function SG(){return _E||(_E=new Promise((n,e)=>{try{const t=indexedDB.open("firebase-app-check-database",1);t.onsuccess=r=>{n(r.target.result)},t.onerror=r=>{var i;e(or.create("storage-open",{originalErrorMessage:null===(i=r.target.error)||void 0===i?void 0:i.message}))},t.onupgradeneeded=r=>{0===r.oldVersion&&r.target.result.createObjectStore(fg,{keyPath:"compositeKey"})}}catch(t){e(or.create("storage-open",{originalErrorMessage:t?.message}))}}),_E)}()).transaction(fg,"readwrite"),o=r.objectStore(fg).put({compositeKey:n,value:e});return new Promise((s,a)=>{o.onsuccess=l=>{s()},r.onerror=l=>{var c;a(or.create("storage-set",{originalErrorMessage:null===(c=l.target.error)||void 0===c?void 0:c.message}))}})})).apply(this,arguments)}const pg=new sE("@firebase/app-check");function HR(n,e){return _R()?function X0e(n,e){return function DG(n,e){return UR.apply(this,arguments)}(function RG(n){return`${n.options.appId}-${n.name}`}(n),e)}(n,e).catch(t=>{pg.warn(`Failed to write token to IndexedDB. Error: ${t}`)}):Promise.resolve()}function qR(){return fE().enabled}function WR(){return GR.apply(this,arguments)}function GR(){return(GR=T(function*(){const n=fE();if(n.enabled&&n.token)return n.token.promise;throw Error("\n Can't get debug token in production mode.\n ")})).apply(this,arguments)}const rxe={error:"UNKNOWN_ERROR"};function ixe(n){return gR.encodeString(JSON.stringify(n),!1)}function yE(n){return KR.apply(this,arguments)}function KR(){return(KR=T(function*(n,e=!1){const t=n.app;LR(t);const r=an(t);let o,i=r.token;if(i&&!gh(i)&&(r.token=void 0,i=void 0),!i){const l=yield r.cachedTokenPromise;l&&(gh(l)?i=l:yield HR(t,void 0))}if(!e&&i&&gh(i))return{token:i.token};let a,s=!1;if(qR()){r.exchangeTokenPromise||(r.exchangeTokenPromise=gE(CG(t,yield WR()),n.heartbeatServiceProvider).finally(()=>{r.exchangeTokenPromise=void 0}),s=!0);const l=yield r.exchangeTokenPromise;return yield HR(t,l),r.token=l,{token:l.token}}try{r.exchangeTokenPromise||(r.exchangeTokenPromise=r.provider.getToken().finally(()=>{r.exchangeTokenPromise=void 0}),s=!0),i=yield an(t).exchangeTokenPromise}catch(l){"appCheck/throttled"===l.code?pg.warn(l.message):pg.error(l),o=l}return i?o?a=gh(i)?{token:i.token,internalError:o}:PG(o):(a={token:i.token},r.token=i,yield HR(t,i)):a=PG(o),s&&function NG(n,e){const t=an(n).tokenObservers;for(const r of t)try{"EXTERNAL"===r.type&&null!=e.error?r.error(e.error):r.next(e)}catch{}}(t,a),a})).apply(this,arguments)}function QR(){return(QR=T(function*(n){const e=n.app;LR(e);const{provider:t}=an(e);if(qR()){const r=yield WR(),{token:i}=yield gE(CG(e,r),n.heartbeatServiceProvider);return{token:i}}{const{token:r}=yield t.getToken();return{token:r}}})).apply(this,arguments)}function XR(n,e){const t=an(n),r=t.tokenObservers.filter(i=>i.next!==e);0===r.length&&t.tokenRefresher&&t.tokenRefresher.isRunning()&&t.tokenRefresher.stop(),t.tokenObservers=r}function kG(n){const{app:e}=n,t=an(e);let r=t.tokenRefresher;r||(r=function oxe(n){const{app:e}=n;return new H0e(T(function*(){let r;if(r=an(e).token?yield yE(n,!0):yield yE(n),r.error)throw r.error;if(r.internalError)throw r.internalError}),()=>!0,()=>{const t=an(e);if(t.token){let r=t.token.issuedAtTimeMillis+.5*(t.token.expireTimeMillis-t.token.issuedAtTimeMillis)+3e5;return r=Math.min(r,t.token.expireTimeMillis-3e5),Math.max(0,r-Date.now())}return 0},3e4,96e4)}(n),t.tokenRefresher=r),!r.isRunning()&&t.isTokenAutoRefreshEnabled&&r.start()}function gh(n){return n.expireTimeMillis-Date.now()>0}function PG(n){return{token:ixe(rxe),error:n}}class sxe{constructor(e,t){this.app=e,this.heartbeatServiceProvider=t}_delete(){const{tokenObservers:e}=an(this.app);for(const t of e)XR(this.app,t.next);return Promise.resolve()}}const jG="app-check-internal";!function bxe(){Fs(new Go("app-check",n=>function axe(n,e){return new sxe(n,e)}(n.getProvider("app").getImmediate(),n.getProvider("heartbeat")),"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((n,e,t)=>{n.getProvider(jG).initialize()})),Fs(new Go(jG,n=>function lxe(n){return{getToken:e=>yE(n,e),getLimitedUseToken:()=>function MG(n){return QR.apply(this,arguments)}(n),addTokenListener:e=>function YR(n,e,t,r){const{app:i}=n,o=an(i);if(o.tokenObservers=[...o.tokenObservers,{next:t,error:r,type:e}],o.token&&gh(o.token)){const a=o.token;Promise.resolve().then(()=>{t({token:a.token}),kG(n)}).catch(()=>{})}o.cachedTokenPromise.then(()=>kG(n))}(n,"INTERNAL",e),removeTokenListener:e=>XR(n.app,e)}}(n.getProvider("app-check").getImmediate()),"PUBLIC").setInstantiationMode("EXPLICIT")),Gn("@firebase/app-check","0.8.11")}();class bE{constructor(){return dE("app-check")}}typeof window<"u"&&window;const xxe=function $G(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}},qG=new fh("auth","Firebase",{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}),wE=new sE("@firebase/auth");function EE(n,...e){wE.logLevel<=qe.ERROR&&wE.error(`Auth (${Lc}): ${n}`,...e)}function li(n,...e){throw rM(n,...e)}function jr(n,...e){return rM(n,...e)}function nM(n,e,t){const r=Object.assign(Object.assign({},xxe()),{[e]:t});return new fh("auth","Firebase",r).create(e,{appName:n.name})}function Kn(n){return nM(n,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function rM(n,...e){if("string"!=typeof n){const t=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=n.name),n._errorFactory.create(t,...r)}return qG.create(n,...e)}function X(n,e,...t){if(!n)throw rM(e,...t)}function Ko(n){const e="INTERNAL ASSERTION FAILED: "+n;throw EE(e),new Error(e)}function Ls(n,e){n||Ko(e)}function mg(){var n;return typeof self<"u"&&(null===(n=self.location)||void 0===n?void 0:n.href)||""}function WG(){var n;return typeof self<"u"&&(null===(n=self.location)||void 0===n?void 0:n.protocol)||null}function Dxe(){return!(typeof navigator<"u"&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&(function iM(){return"http:"===WG()||"https:"===WG()}()||function YTe(){const n="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof n&&void 0!==n.id}()||"connection"in navigator))||navigator.onLine}class gg{constructor(e,t){this.shortDelay=e,this.longDelay=t,Ls(t>e,"Short delay should be less than long delay!"),this.isMobile=function WTe(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(_n())}()||function XTe(){return"object"==typeof navigator&&"ReactNative"===navigator.product}()}get(){return Dxe()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}function oM(n,e){Ls(n.emulator,"Emulator should always be set here");const{url:t}=n.emulator;return e?`${t}${e.startsWith("/")?e.slice(1):e}`:t}class GG{static initialize(e,t,r){this.fetchImpl=e,t&&(this.headersImpl=t),r&&(this.responseImpl=r)}static fetch(){return this.fetchImpl?this.fetchImpl:typeof self<"u"&&"fetch"in self?self.fetch:typeof globalThis<"u"&&globalThis.fetch?globalThis.fetch:typeof fetch<"u"?fetch:void Ko("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:typeof self<"u"&&"Headers"in self?self.Headers:typeof globalThis<"u"&&globalThis.Headers?globalThis.Headers:typeof Headers<"u"?Headers:void Ko("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:typeof self<"u"&&"Response"in self?self.Response:typeof globalThis<"u"&&globalThis.Response?globalThis.Response:typeof Response<"u"?Response:void Ko("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}const Rxe={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"},Mxe=new gg(3e4,6e4);function Ot(n,e){return n.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:n.tenantId}):e}function Ft(n,e,t,r){return sM.apply(this,arguments)}function sM(){return(sM=T(function*(n,e,t,r,i={}){return KG(n,i,T(function*(){let o={},s={};r&&("GET"===e?s=r:o={body:JSON.stringify(r)});const a=ig(Object.assign({key:n.config.apiKey},s)).slice(1),l=yield n._getAdditionalHeaders();l["Content-Type"]="application/json",n.languageCode&&(l["X-Firebase-Locale"]=n.languageCode);const c=Object.assign({method:e,headers:l},o);return function QTe(){return typeof navigator<"u"&&"Cloudflare-Workers"===navigator.userAgent}()||(c.referrerPolicy="no-referrer"),GG.fetch()(QG(n,n.config.apiHost,t,a),c)}))})).apply(this,arguments)}function KG(n,e,t){return aM.apply(this,arguments)}function aM(){return(aM=T(function*(n,e,t){n._canInitEmulator=!1;const r=Object.assign(Object.assign({},Rxe),e);try{const i=new Nxe(n),o=yield Promise.race([t(),i.promise]);i.clearNetworkTimeout();const s=yield o.json();if("needConfirmation"in s)throw _g(n,"account-exists-with-different-credential",s);if(o.ok&&!("errorMessage"in s))return s;{const a=o.ok?s.errorMessage:s.error.message,[l,c]=a.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===l)throw _g(n,"credential-already-in-use",s);if("EMAIL_EXISTS"===l)throw _g(n,"email-already-in-use",s);if("USER_DISABLED"===l)throw _g(n,"user-disabled",s);const u=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(c)throw nM(n,u,c);li(n,u)}}catch(i){if(i instanceof Wo)throw i;li(n,"network-request-failed",{message:String(i)})}})).apply(this,arguments)}function Vs(n,e,t,r){return lM.apply(this,arguments)}function lM(){return(lM=T(function*(n,e,t,r,i={}){const o=yield Ft(n,e,t,r,i);return"mfaPendingCredential"in o&&li(n,"multi-factor-auth-required",{_serverResponse:o}),o})).apply(this,arguments)}function QG(n,e,t,r){const i=`${e}${t}?${r}`;return n.config.emulator?oM(n.config,i):`${n.config.apiScheme}://${i}`}function kxe(n){switch(n){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class Nxe{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(jr(this.auth,"network-request-failed")),Mxe.get())})}}function _g(n,e,t){const r={appName:n.name};t.email&&(r.email=t.email),t.phoneNumber&&(r.phoneNumber=t.phoneNumber);const i=jr(n,e,r);return i.customData._tokenResponse=t,i}function XG(n){return void 0!==n&&void 0!==n.enterprise}class ZG{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],void 0===e.recaptchaKey)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||0===this.recaptchaEnforcementState.length)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return kxe(t.enforcementState);return null}isProviderEnabled(e){return"ENFORCE"===this.getProviderEnforcementState(e)||"AUDIT"===this.getProviderEnforcementState(e)}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PROVIDER")}}function uM(){return(uM=T(function*(n,e){return Ft(n,"GET","/v2/recaptchaConfig",Ot(n,e))})).apply(this,arguments)}function dM(){return(dM=T(function*(n,e){return Ft(n,"POST","/v1/accounts:delete",e)})).apply(this,arguments)}function e8(n,e){return fM.apply(this,arguments)}function fM(){return(fM=T(function*(n,e){return Ft(n,"POST","/v1/accounts:lookup",e)})).apply(this,arguments)}function yg(n){if(n)try{const e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}function pM(){return(pM=T(function*(n,e=!1){const t=sn(n),r=yield t.getIdToken(e),i=IE(r);X(i&&i.exp&&i.auth_time&&i.iat,t.auth,"internal-error");const o="object"==typeof i.firebase?i.firebase:void 0,s=o?.sign_in_provider;return{claims:i,token:r,authTime:yg(mM(i.auth_time)),issuedAtTime:yg(mM(i.iat)),expirationTime:yg(mM(i.exp)),signInProvider:s||null,signInSecondFactor:o?.sign_in_second_factor||null}})).apply(this,arguments)}function mM(n){return 1e3*Number(n)}function IE(n){const[e,t,r]=n.split(".");if(void 0===e||void 0===t||void 0===r)return EE("JWT malformed, contained fewer than 3 sections"),null;try{const i=rg(t);return i?JSON.parse(i):(EE("Failed to decode base64 JWT payload"),null)}catch(i){return EE("Caught error parsing JWT payload as JSON",i?.toString()),null}}function t8(n){const e=IE(n);return X(e,"internal-error"),X(typeof e.exp<"u","internal-error"),X(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}function Bs(n,e){return gM.apply(this,arguments)}function gM(){return(gM=T(function*(n,e,t=!1){if(t)return e;try{return yield e}catch(r){throw r instanceof Wo&&function Vxe({code:n}){return"auth/user-disabled"===n||"auth/user-token-expired"===n}(r)&&n.auth.currentUser===n&&(yield n.auth.signOut()),r}})).apply(this,arguments)}class Bxe{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(e){var t;if(e){const r=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),r}{this.errorBackoff=3e4;const i=(null!==(t=this.user.stsTokenManager.expirationTime)&&void 0!==t?t:0)-Date.now()-3e5;return Math.max(0,i)}}schedule(e=!1){var t=this;if(!this.isRunning)return;const r=this.getInterval(e);this.timerId=setTimeout(T(function*(){yield t.iteration()}),r)}iteration(){var e=this;return T(function*(){try{yield e.user.getIdToken(!0)}catch(t){return void("auth/network-request-failed"===t?.code&&e.schedule(!0))}e.schedule()})()}}class _M{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=yg(this.lastLoginAt),this.creationTime=yg(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}function vg(n){return yM.apply(this,arguments)}function yM(){return(yM=T(function*(n){var e;const t=n.auth,r=yield n.getIdToken(),i=yield Bs(n,e8(t,{idToken:r}));X(i?.users.length,t,"internal-error");const o=i.users[0];n._notifyReloadListener(o);const s=null!==(e=o.providerUserInfo)&&void 0!==e&&e.length?n8(o.providerUserInfo):[],a=function zxe(n,e){return[...n.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}(n.providerData,s),u=!!n.isAnonymous&&!(n.email&&o.passwordHash||a?.length),d={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:a,metadata:new _M(o.createdAt,o.lastLoginAt),isAnonymous:u};Object.assign(n,d)})).apply(this,arguments)}function vM(){return(vM=T(function*(n){const e=sn(n);yield vg(e),yield e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)})).apply(this,arguments)}function n8(n){return n.map(e=>{var{providerId:t}=e,r=Wb(e,["providerId"]);return{providerId:t,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}function bM(){return(bM=T(function*(n,e){const t=yield KG(n,{},T(function*(){const r=ig({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:o}=n.config,s=QG(n,i,"/v1/token",`key=${o}`),a=yield n._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",GG.fetch()(s,{method:"POST",headers:a,body:r})}));return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}})).apply(this,arguments)}function wM(){return(wM=T(function*(n,e){return Ft(n,"POST","/v2/accounts:revokeToken",Ot(n,e))})).apply(this,arguments)}class yh{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){X(e.idToken,"internal-error"),X(typeof e.idToken<"u","internal-error"),X(typeof e.refreshToken<"u","internal-error");const t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):t8(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){X(0!==e.length,"internal-error");const t=t8(e);this.updateTokensAndExpiration(e,null,t)}getToken(e,t=!1){var r=this;return T(function*(){return t||!r.accessToken||r.isExpired?(X(r.refreshToken,e,"user-token-expired"),r.refreshToken?(yield r.refresh(e,r.refreshToken),r.accessToken):null):r.accessToken})()}clearRefreshToken(){this.refreshToken=null}refresh(e,t){var r=this;return T(function*(){const{accessToken:i,refreshToken:o,expiresIn:s}=yield function jxe(n,e){return bM.apply(this,arguments)}(e,t);r.updateTokensAndExpiration(i,o,Number(s))})()}updateTokensAndExpiration(e,t,r){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*r}static fromJSON(e,t){const{refreshToken:r,accessToken:i,expirationTime:o}=t,s=new yh;return r&&(X("string"==typeof r,"internal-error",{appName:e}),s.refreshToken=r),i&&(X("string"==typeof i,"internal-error",{appName:e}),s.accessToken=i),o&&(X("number"==typeof o,"internal-error",{appName:e}),s.expirationTime=o),s}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new yh,this.toJSON())}_performRefresh(){return Ko("not implemented")}}function Ja(n,e){X("string"==typeof n||typeof n>"u","internal-error",{appName:e})}class Us{constructor(e){var{uid:t,auth:r,stsTokenManager:i}=e,o=Wb(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new Bxe(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=o.displayName||null,this.email=o.email||null,this.emailVerified=o.emailVerified||!1,this.phoneNumber=o.phoneNumber||null,this.photoURL=o.photoURL||null,this.isAnonymous=o.isAnonymous||!1,this.tenantId=o.tenantId||null,this.providerData=o.providerData?[...o.providerData]:[],this.metadata=new _M(o.createdAt||void 0,o.lastLoginAt||void 0)}getIdToken(e){var t=this;return T(function*(){const r=yield Bs(t,t.stsTokenManager.getToken(t.auth,e));return X(r,t.auth,"internal-error"),t.accessToken!==r&&(t.accessToken=r,yield t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)),r})()}getIdTokenResult(e){return function Lxe(n){return pM.apply(this,arguments)}(this,e)}reload(){return function Uxe(n){return vM.apply(this,arguments)}(this)}_assign(e){this!==e&&(X(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>Object.assign({},t)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new Us(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){X(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}_updateTokensIfNecessary(e,t=!1){var r=this;return T(function*(){let i=!1;e.idToken&&e.idToken!==r.stsTokenManager.accessToken&&(r.stsTokenManager.updateFromServerResponse(e),i=!0),t&&(yield vg(r)),yield r.auth._persistUserIfCurrent(r),i&&r.auth._notifyListenersIfCurrent(r)})()}delete(){var e=this;return T(function*(){if(ai(e.auth.app))return Promise.reject(Kn(e.auth));const t=yield e.getIdToken();return yield Bs(e,function Oxe(n,e){return dM.apply(this,arguments)}(e.auth,{idToken:t})),e.stsTokenManager.clearRefreshToken(),e.auth.signOut()})()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var r,i,o,s,a,l,c,u;const d=null!==(r=t.displayName)&&void 0!==r?r:void 0,f=null!==(i=t.email)&&void 0!==i?i:void 0,p=null!==(o=t.phoneNumber)&&void 0!==o?o:void 0,m=null!==(s=t.photoURL)&&void 0!==s?s:void 0,_=null!==(a=t.tenantId)&&void 0!==a?a:void 0,v=null!==(l=t._redirectEventId)&&void 0!==l?l:void 0,E=null!==(c=t.createdAt)&&void 0!==c?c:void 0,C=null!==(u=t.lastLoginAt)&&void 0!==u?u:void 0,{uid:R,emailVerified:V,isAnonymous:H,providerData:Q,stsTokenManager:S}=t;X(R&&S,e,"internal-error");const I=yh.fromJSON(this.name,S);X("string"==typeof R,e,"internal-error"),Ja(d,e.name),Ja(f,e.name),X("boolean"==typeof V,e,"internal-error"),X("boolean"==typeof H,e,"internal-error"),Ja(p,e.name),Ja(m,e.name),Ja(_,e.name),Ja(v,e.name),Ja(E,e.name),Ja(C,e.name);const x=new Us({uid:R,auth:e,email:f,emailVerified:V,displayName:d,isAnonymous:H,photoURL:m,phoneNumber:p,tenantId:_,stsTokenManager:I,createdAt:E,lastLoginAt:C});return Q&&Array.isArray(Q)&&(x.providerData=Q.map(A=>Object.assign({},A))),v&&(x._redirectEventId=v),x}static _fromIdTokenResponse(e,t,r=!1){return T(function*(){const i=new yh;i.updateFromServerResponse(t);const o=new Us({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return yield vg(o),o})()}static _fromGetAccountInfoResponse(e,t,r){return T(function*(){const i=t.users[0];X(void 0!==i.localId,"internal-error");const o=void 0!==i.providerUserInfo?n8(i.providerUserInfo):[],s=!(i.email&&i.passwordHash||o?.length),a=new yh;a.updateFromIdToken(r);const l=new Us({uid:i.localId,auth:e,stsTokenManager:a,isAnonymous:s}),c={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:o,metadata:new _M(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash||o?.length)};return Object.assign(l,c),l})()}}const r8=new Map;function zs(n){Ls(n instanceof Function,"Expected a class definition");let e=r8.get(n);return e?(Ls(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,r8.set(n,e),e)}const i8=(()=>{class n{constructor(){this.type="NONE",this.storage={}}_isAvailable(){return T(function*(){return!0})()}_set(t,r){var i=this;return T(function*(){i.storage[t]=r})()}_get(t){var r=this;return T(function*(){const i=r.storage[t];return void 0===i?null:i})()}_remove(t){var r=this;return T(function*(){delete r.storage[t]})()}_addListener(t,r){}_removeListener(t,r){}}return n.type="NONE",n})();function TE(n,e,t){return`firebase:${n}:${e}:${t}`}class vh{constructor(e,t,r){this.persistence=e,this.auth=t,this.userKey=r;const{config:i,name:o}=this.auth;this.fullUserKey=TE(this.userKey,i.apiKey,o),this.fullPersistenceKey=TE("persistence",i.apiKey,o),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}getCurrentUser(){var e=this;return T(function*(){const t=yield e.persistence._get(e.fullUserKey);return t?Us._fromJSON(e.auth,t):null})()}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}setPersistence(e){var t=this;return T(function*(){if(t.persistence===e)return;const r=yield t.getCurrentUser();return yield t.removeCurrentUser(),t.persistence=e,r?t.setCurrentUser(r):void 0})()}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static create(e,t,r="authUser"){return T(function*(){if(!t.length)return new vh(zs(i8),e,r);const i=(yield Promise.all(t.map(function(){var c=T(function*(u){if(yield u._isAvailable())return u});return function(u){return c.apply(this,arguments)}}()))).filter(c=>c);let o=i[0]||zs(i8);const s=TE(r,e.config.apiKey,e.name);let a=null;for(const c of t)try{const u=yield c._get(s);if(u){const d=Us._fromJSON(e,u);c!==o&&(a=d),o=c;break}}catch{}const l=i.filter(c=>c._shouldAllowMigration);return o._shouldAllowMigration&&l.length?(o=l[0],a&&(yield o._set(s,a.toJSON())),yield Promise.all(t.map(function(){var c=T(function*(u){if(u!==o)try{yield u._remove(s)}catch{}});return function(u){return c.apply(this,arguments)}}())),new vh(o,e,r)):new vh(o,e,r)})()}}function o8(n){const e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(c8(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(s8(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(d8(e))return"Blackberry";if(h8(e))return"Webos";if(a8(e))return"Safari";if((e.includes("chrome/")||l8(e))&&!e.includes("edge/"))return"Chrome";if(u8(e))return"Android";{const r=n.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/);if(2===r?.length)return r[1]}return"Other"}function s8(n=_n()){return/firefox\//i.test(n)}function a8(n=_n()){const e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function l8(n=_n()){return/crios\//i.test(n)}function c8(n=_n()){return/iemobile/i.test(n)}function u8(n=_n()){return/android/i.test(n)}function d8(n=_n()){return/blackberry/i.test(n)}function h8(n=_n()){return/webos/i.test(n)}function EM(n=_n()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function f8(n=_n()){return EM(n)||u8(n)||h8(n)||d8(n)||/windows phone/i.test(n)||c8(n)}function p8(n,e=[]){let t;switch(n){case"Browser":t=o8(_n());break;case"Worker":t=`${o8(_n())}-${n}`;break;default:t=n}const r=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${Lc}/${r}`}class Wxe{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const r=o=>new Promise((s,a)=>{try{s(e(o))}catch(l){a(l)}});r.onAbort=t,this.queue.push(r);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}runMiddleware(e){var t=this;return T(function*(){if(t.auth.currentUser===e)return;const r=[];try{for(const i of t.queue)yield i(e),i.onAbort&&r.push(i.onAbort)}catch(i){r.reverse();for(const o of r)try{o()}catch{}throw t.auth._errorFactory.create("login-blocked",{originalMessage:i?.message})}})()}}function IM(){return(IM=T(function*(n,e={}){return Ft(n,"GET","/v2/passwordPolicy",Ot(n,e))})).apply(this,arguments)}class Qxe{constructor(e){var t,r,i,o;const s=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=null!==(t=s.minPasswordLength)&&void 0!==t?t:6,s.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=s.maxPasswordLength),void 0!==s.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=s.containsLowercaseCharacter),void 0!==s.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=s.containsUppercaseCharacter),void 0!==s.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=s.containsNumericCharacter),void 0!==s.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=s.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=null!==(i=null===(r=e.allowedNonAlphanumericCharacters)||void 0===r?void 0:r.join(""))&&void 0!==i?i:"",this.forceUpgradeOnSignin=null!==(o=e.forceUpgradeOnSignin)&&void 0!==o&&o,this.schemaVersion=e.schemaVersion}validatePassword(e){var t,r,i,o,s,a;const l={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,l),this.validatePasswordCharacterOptions(e,l),l.isValid&&(l.isValid=null===(t=l.meetsMinPasswordLength)||void 0===t||t),l.isValid&&(l.isValid=null===(r=l.meetsMaxPasswordLength)||void 0===r||r),l.isValid&&(l.isValid=null===(i=l.containsLowercaseLetter)||void 0===i||i),l.isValid&&(l.isValid=null===(o=l.containsUppercaseLetter)||void 0===o||o),l.isValid&&(l.isValid=null===(s=l.containsNumericCharacter)||void 0===s||s),l.isValid&&(l.isValid=null===(a=l.containsNonAlphanumericCharacter)||void 0===a||a),l}validatePasswordLengthOptions(e,t){const r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(t.meetsMinPasswordLength=e.length>=r),i&&(t.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,t){let r;this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);for(let i=0;i="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,t,r,i,o){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=o))}}class Yxe{constructor(e,t,r,i){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new m8(this),this.idTokenSubscription=new m8(this),this.beforeStateQueue=new Wxe(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=qG,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion}_initializeWithPersistence(e,t){var r=this;return t&&(this._popupRedirectResolver=zs(t)),this._initializationPromise=this.queue(T(function*(){var i,o;if(!r._deleted&&(r.persistenceManager=yield vh.create(r,e),!r._deleted)){if(null!==(i=r._popupRedirectResolver)&&void 0!==i&&i._shouldInitProactively)try{yield r._popupRedirectResolver._initialize(r)}catch{}yield r.initializeCurrentUser(t),r.lastNotifiedUid=(null===(o=r.currentUser)||void 0===o?void 0:o.uid)||null,!r._deleted&&(r._isInitialized=!0)}})),this._initializationPromise}_onStorageEvent(){var e=this;return T(function*(){if(e._deleted)return;const t=yield e.assertedPersistence.getCurrentUser();if(e.currentUser||t){if(e.currentUser&&t&&e.currentUser.uid===t.uid)return e._currentUser._assign(t),void(yield e.currentUser.getIdToken());yield e._updateCurrentUser(t,!0)}})()}initializeCurrentUserFromIdToken(e){var t=this;return T(function*(){try{const r=yield e8(t,{idToken:e}),i=yield Us._fromGetAccountInfoResponse(t,r,e);yield t.directlySetCurrentUser(i)}catch(r){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",r),yield t.directlySetCurrentUser(null)}})()}initializeCurrentUser(e){var t=this;return T(function*(){var r;if(ai(t.app)){const a=t.app.settings.authIdToken;return a?new Promise(l=>{setTimeout(()=>t.initializeCurrentUserFromIdToken(a).then(l,l))}):t.directlySetCurrentUser(null)}const i=yield t.assertedPersistence.getCurrentUser();let o=i,s=!1;if(e&&t.config.authDomain){yield t.getOrInitRedirectPersistenceManager();const a=null===(r=t.redirectUser)||void 0===r?void 0:r._redirectEventId,l=o?._redirectEventId,c=yield t.tryRedirectSignIn(e);(!a||a===l)&&c?.user&&(o=c.user,s=!0)}if(!o)return t.directlySetCurrentUser(null);if(!o._redirectEventId){if(s)try{yield t.beforeStateQueue.runMiddleware(o)}catch(a){o=i,t._popupRedirectResolver._overrideRedirectResult(t,()=>Promise.reject(a))}return o?t.reloadAndSetCurrentUserOrClear(o):t.directlySetCurrentUser(null)}return X(t._popupRedirectResolver,t,"argument-error"),yield t.getOrInitRedirectPersistenceManager(),t.redirectUser&&t.redirectUser._redirectEventId===o._redirectEventId?t.directlySetCurrentUser(o):t.reloadAndSetCurrentUserOrClear(o)})()}tryRedirectSignIn(e){var t=this;return T(function*(){let r=null;try{r=yield t._popupRedirectResolver._completeRedirectFn(t,e,!0)}catch{yield t._setRedirectUser(null)}return r})()}reloadAndSetCurrentUserOrClear(e){var t=this;return T(function*(){try{yield vg(e)}catch(r){if("auth/network-request-failed"!==r?.code)return t.directlySetCurrentUser(null)}return t.directlySetCurrentUser(e)})()}useDeviceLanguage(){this.languageCode=function Axe(){if(typeof navigator>"u")return null;const n=navigator;return n.languages&&n.languages[0]||n.language||null}()}_delete(){var e=this;return T(function*(){e._deleted=!0})()}updateCurrentUser(e){var t=this;return T(function*(){if(ai(t.app))return Promise.reject(Kn(t));const r=e?sn(e):null;return r&&X(r.auth.config.apiKey===t.config.apiKey,t,"invalid-user-token"),t._updateCurrentUser(r&&r._clone(t))})()}_updateCurrentUser(e,t=!1){var r=this;return T(function*(){if(!r._deleted)return e&&X(r.tenantId===e.tenantId,r,"tenant-id-mismatch"),t||(yield r.beforeStateQueue.runMiddleware(e)),r.queue(T(function*(){yield r.directlySetCurrentUser(e),r.notifyAuthListeners()}))})()}signOut(){var e=this;return T(function*(){return ai(e.app)?Promise.reject(Kn(e)):(yield e.beforeStateQueue.runMiddleware(null),(e.redirectPersistenceManager||e._popupRedirectResolver)&&(yield e._setRedirectUser(null)),e._updateCurrentUser(null,!0))})()}setPersistence(e){var t=this;return ai(this.app)?Promise.reject(Kn(this)):this.queue(T(function*(){yield t.assertedPersistence.setPersistence(zs(e))}))}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}validatePassword(e){var t=this;return T(function*(){t._getPasswordPolicyInternal()||(yield t._updatePasswordPolicy());const r=t._getPasswordPolicyInternal();return r.schemaVersion!==t.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(t._errorFactory.create("unsupported-password-policy-schema-version",{})):r.validatePassword(e)})()}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}_updatePasswordPolicy(){var e=this;return T(function*(){const t=yield function Gxe(n){return IM.apply(this,arguments)}(e),r=new Qxe(t);null===e.tenantId?e._projectPasswordPolicy=r:e._tenantPasswordPolicies[e.tenantId]=r})()}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new fh("auth","Firebase",e())}onAuthStateChanged(e,t,r){return this.registerStateListener(this.authStateSubscription,e,t,r)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,r){return this.registerStateListener(this.idTokenSubscription,e,t,r)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},t)}})}revokeAccessToken(e){var t=this;return T(function*(){if(t.currentUser){const r=yield t.currentUser.getIdToken(),i={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:r};null!=t.tenantId&&(i.tenantId=t.tenantId),yield function Hxe(n,e){return wM.apply(this,arguments)}(t,i)}})()}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(e=this._currentUser)||void 0===e?void 0:e.toJSON()}}_setRedirectUser(e,t){var r=this;return T(function*(){const i=yield r.getOrInitRedirectPersistenceManager(t);return null===e?i.removeCurrentUser():i.setCurrentUser(e)})()}getOrInitRedirectPersistenceManager(e){var t=this;return T(function*(){if(!t.redirectPersistenceManager){const r=e&&zs(e)||t._popupRedirectResolver;X(r,t,"argument-error"),t.redirectPersistenceManager=yield vh.create(t,[zs(r._redirectPersistence)],"redirectUser"),t.redirectUser=yield t.redirectPersistenceManager.getCurrentUser()}return t.redirectPersistenceManager})()}_redirectUserForId(e){var t=this;return T(function*(){var r,i;return t._isInitialized&&(yield t.queue(T(function*(){}))),(null===(r=t._currentUser)||void 0===r?void 0:r._redirectEventId)===e?t._currentUser:(null===(i=t.redirectUser)||void 0===i?void 0:i._redirectEventId)===e?t.redirectUser:null})()}_persistUserIfCurrent(e){var t=this;return T(function*(){if(e===t.currentUser)return t.queue(T(function*(){return t.directlySetCurrentUser(e)}))})()}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=null!==(t=null===(e=this.currentUser)||void 0===e?void 0:e.uid)&&void 0!==t?t:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,r,i){if(this._deleted)return()=>{};const o="function"==typeof t?t:t.next.bind(t);let s=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(X(a,this,"internal-error"),a.then(()=>{s||o(this.currentUser)}),"function"==typeof t){const l=e.addObserver(t,r,i);return()=>{s=!0,l()}}{const l=e.addObserver(t);return()=>{s=!0,l()}}}directlySetCurrentUser(e){var t=this;return T(function*(){t.currentUser&&t.currentUser!==e&&t._currentUser._stopProactiveRefresh(),e&&t.isProactiveRefreshEnabled&&e._startProactiveRefresh(),t.currentUser=e,e?yield t.assertedPersistence.setCurrentUser(e):yield t.assertedPersistence.removeCurrentUser()})()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return X(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=p8(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}_getAdditionalHeaders(){var e=this;return T(function*(){var t;const r={"X-Client-Version":e.clientVersion};e.app.options.appId&&(r["X-Firebase-gmpid"]=e.app.options.appId);const i=yield null===(t=e.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===t?void 0:t.getHeartbeatsHeader();i&&(r["X-Firebase-Client"]=i);const o=yield e._getAppCheckToken();return o&&(r["X-Firebase-AppCheck"]=o),r})()}_getAppCheckToken(){var e=this;return T(function*(){var t;if(ai(e.app)&&e.app.settings.appCheckToken)return e.app.settings.appCheckToken;const r=yield null===(t=e.appCheckServiceProvider.getImmediate({optional:!0}))||void 0===t?void 0:t.getToken();return r?.error&&function Sxe(n,...e){wE.logLevel<=qe.WARN&&wE.warn(`Auth (${Lc}): ${n}`,...e)}(`Error while retrieving App Check token: ${r.error}`),r?.token})()}}function yn(n){return sn(n)}class m8{constructor(e){this.auth=e,this.observer=null,this.addObserver=function iCe(n,e){const t=new oCe(n,e);return t.subscribe.bind(t)}(t=>this.observer=t)}get next(){return X(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}let bg={loadJS:()=>T(function*(){throw new Error("Unable to load external scripts")})(),recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function TM(n){return bg.loadJS(n)}function g8(n){return`__${n}${Math.floor(1e6*Math.random())}`}class iSe{constructor(){this.enterprise=new oSe}ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}class oSe{ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}const wg="NO_RECAPTCHA";class _8{constructor(e){this.type="recaptcha-enterprise",this.auth=yn(e)}verify(e="verify",t=!1){var r=this;return T(function*(){function o(){return o=T(function*(a){if(!t){if(null==a.tenantId&&null!=a._agentRecaptchaConfig)return a._agentRecaptchaConfig.siteKey;if(null!=a.tenantId&&void 0!==a._tenantRecaptchaConfigs[a.tenantId])return a._tenantRecaptchaConfigs[a.tenantId].siteKey}return new Promise(function(){var l=T(function*(c,u){(function JG(n,e){return uM.apply(this,arguments)})(a,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(d=>{if(void 0!==d.recaptchaKey){const f=new ZG(d);return null==a.tenantId?a._agentRecaptchaConfig=f:a._tenantRecaptchaConfigs[a.tenantId]=f,c(f.siteKey)}u(new Error("recaptcha Enterprise site key undefined"))}).catch(d=>{u(d)})});return function(c,u){return l.apply(this,arguments)}}())}),o.apply(this,arguments)}function s(a,l,c){const u=window.grecaptcha;XG(u)?u.enterprise.ready(()=>{u.enterprise.execute(a,{action:e}).then(d=>{l(d)}).catch(()=>{l(wg)})}):c(Error("No reCAPTCHA enterprise script loaded."))}return r.auth.settings.appVerificationDisabledForTesting?(new iSe).execute("siteKey",{action:"verify"}):new Promise((a,l)=>{(function i(a){return o.apply(this,arguments)})(r.auth).then(c=>{if(!t&&XG(window.grecaptcha))s(c,a,l);else{if(typeof window>"u")return void l(new Error("RecaptchaVerifier is only supported in browser"));let u=function Jxe(){return bg.recaptchaEnterpriseScript}();0!==u.length&&(u+=c),TM(u).then(()=>{s(c,a,l)}).catch(d=>{l(d)})}}).catch(c=>{l(c)})})})()}}function Eg(n,e,t){return CM.apply(this,arguments)}function CM(){return(CM=T(function*(n,e,t,r=!1,i=!1){const o=new _8(n);let s;if(i)s=wg;else try{s=yield o.verify(t)}catch{s=yield o.verify(t,!0)}const a=Object.assign({},e);return"mfaSmsEnrollment"===t||"mfaSmsSignIn"===t?("phoneEnrollmentInfo"in a?Object.assign(a,{phoneEnrollmentInfo:{phoneNumber:a.phoneEnrollmentInfo.phoneNumber,recaptchaToken:a.phoneEnrollmentInfo.recaptchaToken,captchaResponse:s,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}}):"phoneSignInInfo"in a&&Object.assign(a,{phoneSignInInfo:{recaptchaToken:a.phoneSignInInfo.recaptchaToken,captchaResponse:s,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}}),a):(Object.assign(a,r?{captchaResp:s}:{captchaResponse:s}),Object.assign(a,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(a,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),a)})).apply(this,arguments)}function el(n,e,t,r,i){return xM.apply(this,arguments)}function xM(){return xM=T(function*(n,e,t,r,i){var o,s;if("EMAIL_PASSWORD_PROVIDER"===i){if(null!==(o=n._getRecaptchaConfig())&&void 0!==o&&o.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const a=yield Eg(n,e,t,"getOobCode"===t);return r(n,a)}return r(n,e).catch(function(){var a=T(function*(l){if("auth/missing-recaptcha-token"===l.code){console.log(`${t} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const c=yield Eg(n,e,t,"getOobCode"===t);return r(n,c)}return Promise.reject(l)});return function(l){return a.apply(this,arguments)}}())}if("PHONE_PROVIDER"===i){if(null!==(s=n._getRecaptchaConfig())&&void 0!==s&&s.isProviderEnabled("PHONE_PROVIDER")){const a=yield Eg(n,e,t);return r(n,a).catch(function(){var l=T(function*(c){var u;if("AUDIT"===(null===(u=n._getRecaptchaConfig())||void 0===u?void 0:u.getProviderEnforcementState("PHONE_PROVIDER"))&&("auth/missing-recaptcha-token"===c.code||"auth/invalid-app-credential"===c.code)){console.log(`Failed to verify with reCAPTCHA Enterprise. Automatically triggering the reCAPTCHA v2 flow to complete the ${t} flow.`);const d=yield Eg(n,e,t,!1,!0);return r(n,d)}return Promise.reject(c)});return function(c){return l.apply(this,arguments)}}())}{const a=yield Eg(n,e,t,!1,!0);return r(n,a)}}return Promise.reject(i+" provider is not supported.")}),xM.apply(this,arguments)}function v8(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function b8(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}class Ig{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return Ko("not implemented")}_getIdTokenResponse(e){return Ko("not implemented")}_linkToIdToken(e,t){return Ko("not implemented")}_getReauthenticationResolver(e){return Ko("not implemented")}}function mSe(n,e){return RM.apply(this,arguments)}function RM(){return(RM=T(function*(n,e){return Ft(n,"POST","/v1/accounts:signUp",e)})).apply(this,arguments)}function _Se(n,e){return kM.apply(this,arguments)}function kM(){return(kM=T(function*(n,e){return Vs(n,"POST","/v1/accounts:signInWithPassword",Ot(n,e))})).apply(this,arguments)}function VM(){return(VM=T(function*(n,e){return Vs(n,"POST","/v1/accounts:signInWithEmailLink",Ot(n,e))})).apply(this,arguments)}function BM(){return(BM=T(function*(n,e){return Vs(n,"POST","/v1/accounts:signInWithEmailLink",Ot(n,e))})).apply(this,arguments)}class Tg extends Ig{constructor(e,t,r,i=null){super("password",r),this._email=e,this._password=t,this._tenantId=i}static _fromEmailAndPassword(e,t){return new Tg(e,t,"password")}static _fromEmailAndCode(e,t,r=null){return new Tg(e,t,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e;if(t?.email&&t?.password){if("password"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}_getIdTokenResponse(e){var t=this;return T(function*(){switch(t.signInMethod){case"password":return el(e,{returnSecureToken:!0,email:t._email,password:t._password,clientType:"CLIENT_TYPE_WEB"},"signInWithPassword",_Se,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return function ESe(n,e){return VM.apply(this,arguments)}(e,{email:t._email,oobCode:t._password});default:li(e,"internal-error")}})()}_linkToIdToken(e,t){var r=this;return T(function*(){switch(r.signInMethod){case"password":return el(e,{idToken:t,returnSecureToken:!0,email:r._email,password:r._password,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",mSe,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return function ISe(n,e){return BM.apply(this,arguments)}(e,{idToken:t,email:r._email,oobCode:r._password});default:li(e,"internal-error")}})()}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}function js(n,e){return UM.apply(this,arguments)}function UM(){return(UM=T(function*(n,e){return Vs(n,"POST","/v1/accounts:signInWithIdp",Ot(n,e))})).apply(this,arguments)}class bh extends Ig{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new bh(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):li("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e,{providerId:r,signInMethod:i}=t,o=Wb(t,["providerId","signInMethod"]);if(!r||!i)return null;const s=new bh(r,i);return s.idToken=o.idToken||void 0,s.accessToken=o.accessToken||void 0,s.secret=o.secret,s.nonce=o.nonce,s.pendingToken=o.pendingToken||null,s}_getIdTokenResponse(e){return js(e,this.buildRequest())}_linkToIdToken(e,t){const r=this.buildRequest();return r.idToken=t,js(e,r)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,js(e,t)}buildRequest(){const e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=ig(t)}return e}}class xg{constructor(e){var t,r,i,o,s,a;const l=og(sg(e)),c=null!==(t=l.apiKey)&&void 0!==t?t:null,u=null!==(r=l.oobCode)&&void 0!==r?r:null,d=function ASe(n){switch(n){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}(null!==(i=l.mode)&&void 0!==i?i:null);X(c&&u&&d,"argument-error"),this.apiKey=c,this.operation=d,this.code=u,this.continueUrl=null!==(o=l.continueUrl)&&void 0!==o?o:null,this.languageCode=null!==(s=l.languageCode)&&void 0!==s?s:null,this.tenantId=null!==(a=l.tenantId)&&void 0!==a?a:null}static parseLink(e){const t=function RSe(n){const e=og(sg(n)).link,t=e?og(sg(e)).deep_link_id:null,r=og(sg(n)).deep_link_id;return(r?og(sg(r)).link:null)||r||t||e||n}(e);try{return new xg(t)}catch{return null}}}let I8=(()=>{class n{constructor(){this.providerId=n.PROVIDER_ID}static credential(t,r){return Tg._fromEmailAndPassword(t,r)}static credentialWithLink(t,r){const i=xg.parseLink(r);return X(i,"argument-error"),Tg._fromEmailAndCode(t,i.code,i.tenantId)}}return n.PROVIDER_ID="password",n.EMAIL_PASSWORD_SIGN_IN_METHOD="password",n.EMAIL_LINK_SIGN_IN_METHOD="emailLink",n})();class Hs{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}class T8 extends Hs{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}let MSe=(()=>{class n extends T8{constructor(){super("google.com"),this.addScope("profile")}static credential(t,r){return bh._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:r})}static credentialFromResult(t){return n.credentialFromTaggedObject(t)}static credentialFromError(t){return n.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:r,oauthAccessToken:i}=t;if(!r&&!i)return null;try{return n.credential(r,i)}catch{return null}}}return n.GOOGLE_SIGN_IN_METHOD="google.com",n.PROVIDER_ID="google.com",n})();function C8(n,e){return WM.apply(this,arguments)}function WM(){return(WM=T(function*(n,e){return Vs(n,"POST","/v1/accounts:signUp",Ot(n,e))})).apply(this,arguments)}class Ji{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static _fromIdTokenResponse(e,t,r,i=!1){return T(function*(){const o=yield Us._fromIdTokenResponse(e,r,i),s=x8(r);return new Ji({user:o,providerId:s,_tokenResponse:r,operationType:t})})()}static _forOperation(e,t,r){return T(function*(){yield e._updateTokensIfNecessary(r,!0);const i=x8(r);return new Ji({user:e,providerId:i,_tokenResponse:r,operationType:t})})()}}function x8(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}class DE extends Wo{constructor(e,t,r,i){var o;super(t.code,t.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,DE.prototype),this.customData={appName:e.name,tenantId:null!==(o=e.tenantId)&&void 0!==o?o:void 0,_serverResponse:t.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,t,r,i){return new DE(e,t,r,i)}}function S8(n,e,t,r){return("reauthenticate"===e?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(o=>{throw"auth/multi-factor-auth-required"===o.code?DE._fromErrorAndOperation(n,o,e,r):o})}function YM(){return(YM=T(function*(n,e,t=!1){const r=yield Bs(n,e._linkToIdToken(n.auth,yield n.getIdToken()),t);return Ji._forOperation(n,"link",r)})).apply(this,arguments)}function ZM(){return(ZM=T(function*(n,e,t=!1){const{auth:r}=n;if(ai(r.app))return Promise.reject(Kn(r));const i="reauthenticate";try{const o=yield Bs(n,S8(r,i,e,n),t);X(o.idToken,r,"internal-error");const s=IE(o.idToken);X(s,r,"internal-error");const{sub:a}=s;return X(n.uid===a,r,"user-mismatch"),Ji._forOperation(n,i,o)}catch(o){throw"auth/user-not-found"===o?.code&&li(r,"user-mismatch"),o}})).apply(this,arguments)}function R8(n,e){return JM.apply(this,arguments)}function JM(){return(JM=T(function*(n,e,t=!1){if(ai(n.app))return Promise.reject(Kn(n));const r="signIn",i=yield S8(n,r,e),o=yield Ji._fromIdTokenResponse(n,r,i);return t||(yield n._updateCurrentUser(o.user)),o})).apply(this,arguments)}function tk(){return(tk=T(function*(n,e){return R8(yn(n),e)})).apply(this,arguments)}function lk(n){return ck.apply(this,arguments)}function ck(){return(ck=T(function*(n){const e=yn(n);e._getPasswordPolicyInternal()&&(yield e._updatePasswordPolicy())})).apply(this,arguments)}function VSe(n,e,t){return mk.apply(this,arguments)}function mk(){return(mk=T(function*(n,e,t){if(ai(n.app))return Promise.reject(Kn(n));const r=yn(n),s=yield el(r,{returnSecureToken:!0,email:e,password:t,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",C8,"EMAIL_PASSWORD_PROVIDER").catch(l=>{throw"auth/password-does-not-meet-requirements"===l.code&&lk(n),l}),a=yield Ji._fromIdTokenResponse(r,"signIn",s);return yield r._updateCurrentUser(a.user),a})).apply(this,arguments)}function BSe(n,e,t){return ai(n.app)?Promise.reject(Kn(n)):function ek(n,e){return tk.apply(this,arguments)}(sn(n),I8.credential(e,t)).catch(function(){var r=T(function*(i){throw"auth/password-does-not-meet-requirements"===i.code&&lk(n),i});return function(i){return r.apply(this,arguments)}}())}function N8(n,e,t,r){return sn(n).onIdTokenChanged(e,t,r)}function KSe(n){return sn(n).signOut()}const ME="__sak";class O8{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(ME,"1"),this.storage.removeItem(ME),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}const eDe=(()=>{class n extends O8{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,r)=>this.onStorageEvent(t,r),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=f8(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const r of Object.keys(this.listeners)){const i=this.storage.getItem(r),o=this.localCache[r];i!==o&&t(r,o,i)}}onStorageEvent(t,r=!1){if(!t.key)return void this.forAllChangedKeys((a,l,c)=>{this.notifyListeners(a,c)});const i=t.key;r?this.detachListener():this.stopPolling();const o=()=>{const a=this.storage.getItem(i);!r&&this.localCache[i]===a||this.notifyListeners(i,a)},s=this.storage.getItem(i);!function qxe(){return function ZTe(){const n=_n();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}()&&10===document.documentMode}()||s===t.newValue||t.newValue===t.oldValue?o():setTimeout(o,10)}notifyListeners(t,r){this.localCache[t]=r;const i=this.listeners[t];if(i)for(const o of Array.from(i))o(r&&JSON.parse(r))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((t,r,i)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:r,newValue:i}),!0)})},1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,r){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(r)}_removeListener(t,r){this.listeners[t]&&(this.listeners[t].delete(r),0===this.listeners[t].size&&delete this.listeners[t]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}_set(t,r){var i=()=>super._set,o=this;return T(function*(){yield i().call(o,t,r),o.localCache[t]=JSON.stringify(r)})()}_get(t){var r=()=>super._get,i=this;return T(function*(){const o=yield r().call(i,t);return i.localCache[t]=JSON.stringify(o),o})()}_remove(t){var r=()=>super._remove,i=this;return T(function*(){yield r().call(i,t),delete i.localCache[t]})()}}return n.type="LOCAL",n})(),F8=(()=>{class n extends O8{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,r){}_removeListener(t,r){}}return n.type="SESSION",n})();let nDe=(()=>{class n{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){const r=this.receivers.find(o=>o.isListeningto(t));if(r)return r;const i=new n(t);return this.receivers.push(i),i}isListeningto(t){return this.eventTarget===t}handleEvent(t){var r=this;return T(function*(){const i=t,{eventId:o,eventType:s,data:a}=i.data,l=r.handlersMap[s];if(!l?.size)return;i.ports[0].postMessage({status:"ack",eventId:o,eventType:s});const c=Array.from(l).map(function(){var d=T(function*(f){return f(i.origin,a)});return function(f){return d.apply(this,arguments)}}()),u=yield function tDe(n){return Promise.all(n.map(function(){var e=T(function*(t){try{return{fulfilled:!0,value:yield t}}catch(r){return{fulfilled:!1,reason:r}}});return function(t){return e.apply(this,arguments)}}()))}(c);i.ports[0].postMessage({status:"done",eventId:o,eventType:s,response:u})})()}_subscribe(t,r){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(r)}_unsubscribe(t,r){this.handlersMap[t]&&r&&this.handlersMap[t].delete(r),(!r||0===this.handlersMap[t].size)&&delete this.handlersMap[t],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}return n.receivers=[],n})();function kE(n="",e=10){let t="";for(let r=0;r{const u=kE("",20);o.port1.start();const d=setTimeout(()=>{c(new Error("unsupported_event"))},r);a={messageChannel:o,onMessage(f){const p=f;if(p.data.eventId===u)switch(p.data.status){case"ack":clearTimeout(d),s=setTimeout(()=>{c(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),l(p.data.response);break;default:clearTimeout(d),clearTimeout(s),c(new Error("invalid_response"))}}},i.handlers.add(a),o.port1.addEventListener("message",a.onMessage),i.target.postMessage({eventType:e,eventId:u,data:t},[o.port2])}).finally(()=>{a&&i.removeMessageHandler(a)})})()}}function Sn(){return window}function Rk(){return typeof Sn().WorkerGlobalScope<"u"&&"function"==typeof Sn().importScripts}function Mk(){return(Mk=T(function*(){if(!navigator?.serviceWorker)return null;try{return(yield navigator.serviceWorker.ready).active}catch{return null}})).apply(this,arguments)}const L8="firebaseLocalStorageDb",NE="firebaseLocalStorage",V8="fbase_key";class Ag{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function PE(n,e){return n.transaction([NE],e?"readwrite":"readonly").objectStore(NE)}function kk(){const n=indexedDB.open(L8,1);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const r=n.result;try{r.createObjectStore(NE,{keyPath:V8})}catch(i){t(i)}}),n.addEventListener("success",T(function*(){const r=n.result;r.objectStoreNames.contains(NE)?e(r):(r.close(),yield function cDe(){const n=indexedDB.deleteDatabase(L8);return new Ag(n).toPromise()}(),e(yield kk()))}))})}function B8(n,e,t){return Nk.apply(this,arguments)}function Nk(){return(Nk=T(function*(n,e,t){const r=PE(n,!0).put({[V8]:e,value:t});return new Ag(r).toPromise()})).apply(this,arguments)}function Pk(){return(Pk=T(function*(n,e){const t=PE(n,!1).get(e),r=yield new Ag(t).toPromise();return void 0===r?null:r.value})).apply(this,arguments)}function U8(n,e){const t=PE(n,!0).delete(e);return new Ag(t).toPromise()}const fDe=(()=>{class n{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}_openDb(){var t=this;return T(function*(){return t.db||(t.db=yield kk()),t.db})()}_withRetries(t){var r=this;return T(function*(){let i=0;for(;;)try{const o=yield r._openDb();return yield t(o)}catch(o){if(i++>3)throw o;r.db&&(r.db.close(),r.db=void 0)}})()}initializeServiceWorkerMessaging(){var t=this;return T(function*(){return Rk()?t.initializeReceiver():t.initializeSender()})()}initializeReceiver(){var t=this;return T(function*(){t.receiver=nDe._getInstance(function aDe(){return Rk()?self:null}()),t.receiver._subscribe("keyChanged",function(){var r=T(function*(i,o){return{keyProcessed:(yield t._poll()).includes(o.key)}});return function(i,o){return r.apply(this,arguments)}}()),t.receiver._subscribe("ping",function(){var r=T(function*(i,o){return["keyChanged"]});return function(i,o){return r.apply(this,arguments)}}())})()}initializeSender(){var t=this;return T(function*(){var r,i;if(t.activeServiceWorker=yield function oDe(){return Mk.apply(this,arguments)}(),!t.activeServiceWorker)return;t.sender=new rDe(t.activeServiceWorker);const o=yield t.sender._send("ping",{},800);o&&null!==(r=o[0])&&void 0!==r&&r.fulfilled&&null!==(i=o[0])&&void 0!==i&&i.value.includes("keyChanged")&&(t.serviceWorkerReceiverAvailable=!0)})()}notifyServiceWorker(t){var r=this;return T(function*(){if(r.sender&&r.activeServiceWorker&&function sDe(){var n;return(null===(n=navigator?.serviceWorker)||void 0===n?void 0:n.controller)||null}()===r.activeServiceWorker)try{yield r.sender._send("keyChanged",{key:t},r.serviceWorkerReceiverAvailable?800:50)}catch{}})()}_isAvailable(){return T(function*(){try{if(!indexedDB)return!1;const t=yield kk();return yield B8(t,ME,"1"),yield U8(t,ME),!0}catch{}return!1})()}_withPendingWrite(t){var r=this;return T(function*(){r.pendingWrites++;try{yield t()}finally{r.pendingWrites--}})()}_set(t,r){var i=this;return T(function*(){return i._withPendingWrite(T(function*(){return yield i._withRetries(o=>B8(o,t,r)),i.localCache[t]=r,i.notifyServiceWorker(t)}))})()}_get(t){var r=this;return T(function*(){const i=yield r._withRetries(o=>function uDe(n,e){return Pk.apply(this,arguments)}(o,t));return r.localCache[t]=i,i})()}_remove(t){var r=this;return T(function*(){return r._withPendingWrite(T(function*(){return yield r._withRetries(i=>U8(i,t)),delete r.localCache[t],r.notifyServiceWorker(t)}))})()}_poll(){var t=this;return T(function*(){const r=yield t._withRetries(s=>{const a=PE(s,!1).getAll();return new Ag(a).toPromise()});if(!r)return[];if(0!==t.pendingWrites)return[];const i=[],o=new Set;if(0!==r.length)for(const{fbase_key:s,value:a}of r)o.add(s),JSON.stringify(t.localCache[s])!==JSON.stringify(a)&&(t.notifyListeners(s,a),i.push(s));for(const s of Object.keys(t.localCache))t.localCache[s]&&!o.has(s)&&(t.notifyListeners(s,null),i.push(s));return i})()}notifyListeners(t,r){this.localCache[t]=r;const i=this.listeners[t];if(i)for(const o of Array.from(i))o(r)}startPolling(){var t=this;this.stopPolling(),this.pollTimer=setInterval(T(function*(){return t._poll()}),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,r){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(r)}_removeListener(t,r){this.listeners[t]&&(this.listeners[t].delete(r),0===this.listeners[t].size&&delete this.listeners[t]),0===Object.keys(this.listeners).length&&this.stopPolling()}}return n.type="LOCAL",n})();function zc(n,e){return e?zs(e):(X(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}g8("rcb"),new gg(3e4,6e4);class qk extends Ig{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return js(e,this._buildIdpRequest())}_linkToIdToken(e,t){return js(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return js(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function EDe(n){return R8(n.auth,new qk(n),n.bypassAuthState)}function IDe(n){const{auth:e,user:t}=n;return X(t,e,"internal-error"),function A8(n,e){return ZM.apply(this,arguments)}(t,new qk(n),n.bypassAuthState)}function TDe(n){return Wk.apply(this,arguments)}function Wk(){return(Wk=T(function*(n){const{auth:e,user:t}=n;return X(t,e,"internal-error"),function QM(n,e){return YM.apply(this,arguments)}(t,new qk(n),n.bypassAuthState)})).apply(this,arguments)}class j8{constructor(e,t,r,i,o=!1){this.auth=e,this.resolver=r,this.user=i,this.bypassAuthState=o,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){var e=this;return new Promise(function(){var t=T(function*(r,i){e.pendingPromise={resolve:r,reject:i};try{e.eventManager=yield e.resolver._initialize(e.auth),yield e.onExecution(),e.eventManager.registerConsumer(e)}catch(o){e.reject(o)}});return function(r,i){return t.apply(this,arguments)}}())}onAuthEvent(e){var t=this;return T(function*(){const{urlResponse:r,sessionId:i,postBody:o,tenantId:s,error:a,type:l}=e;if(a)return void t.reject(a);const c={auth:t.auth,requestUri:r,sessionId:i,tenantId:s||void 0,postBody:o||void 0,user:t.user,bypassAuthState:t.bypassAuthState};try{t.resolve(yield t.getIdpTask(l)(c))}catch(u){t.reject(u)}})()}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return EDe;case"linkViaPopup":case"linkViaRedirect":return TDe;case"reauthViaPopup":case"reauthViaRedirect":return IDe;default:li(this.auth,"internal-error")}}resolve(e){Ls(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){Ls(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}const CDe=new gg(2e3,1e4);function xDe(n,e,t){return Gk.apply(this,arguments)}function Gk(){return(Gk=T(function*(n,e,t){if(ai(n.app))return Promise.reject(jr(n,"operation-not-supported-in-this-environment"));const r=yn(n);!function _h(n,e,t){if(!(e instanceof t))throw t.name!==e.constructor.name&&li(n,"argument-error"),nM(n,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}(n,e,Hs);const i=zc(r,t);return new Yk(r,"signInViaPopup",e,i).executeNotNull()})).apply(this,arguments)}let Yk=(()=>{class n extends j8{constructor(t,r,i,o,s){super(t,r,o,s),this.provider=i,this.authWindow=null,this.pollId=null,n.currentPopupAction&&n.currentPopupAction.cancel(),n.currentPopupAction=this}executeNotNull(){var t=this;return T(function*(){const r=yield t.execute();return X(r,t.auth,"internal-error"),r})()}onExecution(){var t=this;return T(function*(){Ls(1===t.filter.length,"Popup operations only handle one event");const r=kE();t.authWindow=yield t.resolver._openPopup(t.auth,t.provider,t.filter[0],r),t.authWindow.associatedEvent=r,t.resolver._originValidation(t.auth).catch(i=>{t.reject(i)}),t.resolver._isIframeWebStorageSupported(t.auth,i=>{i||t.reject(jr(t.auth,"web-storage-unsupported"))}),t.pollUserCancellation()})()}get eventId(){var t;return(null===(t=this.authWindow)||void 0===t?void 0:t.associatedEvent)||null}cancel(){this.reject(jr(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,n.currentPopupAction=null}pollUserCancellation(){const t=()=>{var r,i;this.pollId=null!==(i=null===(r=this.authWindow)||void 0===r?void 0:r.window)&&void 0!==i&&i.closed?window.setTimeout(()=>{this.pollId=null,this.reject(jr(this.auth,"popup-closed-by-user"))},8e3):window.setTimeout(t,CDe.get())};t()}}return n.currentPopupAction=null,n})();const Mg=new Map;class DDe extends j8{constructor(e,t,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r),this.eventId=null}execute(){var e=()=>super.execute,t=this;return T(function*(){let r=Mg.get(t.auth._key());if(!r){try{const o=(yield function ADe(n,e){return Xk.apply(this,arguments)}(t.resolver,t.auth))?yield e().call(t):null;r=()=>Promise.resolve(o)}catch(i){r=()=>Promise.reject(i)}Mg.set(t.auth._key(),r)}return t.bypassAuthState||Mg.set(t.auth._key(),()=>Promise.resolve(null)),r()})()}onAuthEvent(e){var t=()=>super.onAuthEvent,r=this;return T(function*(){if("signInViaRedirect"===e.type)return t().call(r,e);if("unknown"!==e.type){if(e.eventId){const i=yield r.auth._redirectUserForId(e.eventId);if(i)return r.user=i,t().call(r,e);r.resolve(null)}}else r.resolve(null)})()}onExecution(){return T(function*(){})()}cleanUp(){}}function Xk(){return(Xk=T(function*(n,e){const t=function $8(n){return TE("pendingRedirect",n.config.apiKey,n.name)}(e),r=function H8(n){return zs(n._redirectPersistence)}(n);if(!(yield r._isAvailable()))return!1;const i="true"===(yield r._get(t));return yield r._remove(t),i})).apply(this,arguments)}function RDe(n,e){Mg.set(n._key(),e)}function q8(n,e){return o1.apply(this,arguments)}function o1(){return(o1=T(function*(n,e,t=!1){if(ai(n.app))return Promise.reject(Kn(n));const r=yn(n),i=zc(r,e),s=yield new DDe(r,i,t).execute();return s&&!t&&(delete s.user._redirectEventId,yield r._persistUserIfCurrent(s.user),yield r._setRedirectUser(null,e)),s})).apply(this,arguments)}class ODe{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(t=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!function FDe(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return K8(n);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var r;if(e.error&&!K8(e)){const i=(null===(r=e.error.code)||void 0===r?void 0:r.split("auth/")[1])||"internal-error";t.onError(jr(this.auth,i))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const r=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(G8(e))}saveEventToCache(e){this.cachedEventUids.add(G8(e)),this.lastProcessedEventTime=Date.now()}}function G8(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function K8({type:n,error:e}){return"unknown"===n&&"auth/no-auth-event"===e?.code}function a1(){return(a1=T(function*(n,e={}){return Ft(n,"GET","/v1/projects",e)})).apply(this,arguments)}const VDe=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,BDe=/^https?/;function l1(){return l1=T(function*(n){if(n.config.emulator)return;const{authorizedDomains:e}=yield function LDe(n){return a1.apply(this,arguments)}(n);for(const t of e)try{if(zDe(t))return}catch{}li(n,"unauthorized-domain")}),l1.apply(this,arguments)}function zDe(n){const e=mg(),{protocol:t,hostname:r}=new URL(e);if(n.startsWith("chrome-extension://")){const s=new URL(n);return""===s.hostname&&""===r?"chrome-extension:"===t&&n.replace("chrome-extension://","")===e.replace("chrome-extension://",""):"chrome-extension:"===t&&s.hostname===r}if(!BDe.test(t))return!1;if(VDe.test(n))return r===n;const i=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}const jDe=new gg(3e4,6e4);function Q8(){const n=Sn().___jsl;if(n?.H)for(const e of Object.keys(n.H))if(n.H[e].r=n.H[e].r||[],n.H[e].L=n.H[e].L||[],n.H[e].r=[...n.H[e].L],n.CP)for(let t=0;t{var r,i,o;function s(){Q8(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{Q8(),t(jr(n,"network-request-failed"))},timeout:jDe.get()})}if(null!==(i=null===(r=Sn().gapi)||void 0===r?void 0:r.iframes)&&void 0!==i&&i.Iframe)e(gapi.iframes.getContext());else{if(null===(o=Sn().gapi)||void 0===o||!o.load){const a=g8("iframefcb");return Sn()[a]=()=>{gapi.load?s():t(jr(n,"network-request-failed"))},TM(`${function eSe(){return bg.gapiScript}()}?onload=${a}`).catch(l=>t(l))}s()}}).catch(e=>{throw OE=null,e})}(n),OE}(n),t=Sn().gapi;return X(t,n,"internal-error"),e.open({where:document.body,url:YDe(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:KDe,dontclear:!0},r=>new Promise(function(){var i=T(function*(o,s){yield r.restyle({setHideOnLeave:!1});const a=jr(n,"network-request-failed"),l=Sn().setTimeout(()=>{s(a)},qDe.get());function c(){Sn().clearTimeout(l),o(r)}r.ping(c).then(c,()=>{s(a)})});return function(o,s){return i.apply(this,arguments)}}()))}),c1.apply(this,arguments)}const ZDe={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class Y8{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}const aAe=encodeURIComponent("fac");function X8(n,e,t,r,i,o){return u1.apply(this,arguments)}function u1(){return(u1=T(function*(n,e,t,r,i,o){X(n.config.authDomain,n,"auth-domain-config-required"),X(n.config.apiKey,n,"invalid-api-key");const s={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:r,v:Lc,eventId:i};if(e instanceof Hs){e.setDefaultLanguage(n.languageCode),s.providerId=e.providerId||"",function rCe(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}(e.getCustomParameters())||(s.customParameters=JSON.stringify(e.getCustomParameters()));for(const[u,d]of Object.entries(o||{}))s[u]=d}if(e instanceof T8){const u=e.getScopes().filter(d=>""!==d);u.length>0&&(s.scopes=u.join(","))}n.tenantId&&(s.tid=n.tenantId);const a=s;for(const u of Object.keys(a))void 0===a[u]&&delete a[u];const l=yield n._getAppCheckToken(),c=l?`#${aAe}=${encodeURIComponent(l)}`:"";return`${function lAe({config:n}){return n.emulator?oM(n,"emulator/auth/handler"):`https://${n.authDomain}/__/auth/handler`}(n)}?${ig(a).slice(1)}${c}`})).apply(this,arguments)}const d1="webStorageSupport",Z8=class cAe{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=F8,this._completeRedirectFn=q8,this._overrideRedirectResult=RDe}_openPopup(e,t,r,i){var o=this;return T(function*(){var s;Ls(null===(s=o.eventManagers[e._key()])||void 0===s?void 0:s.manager,"_initialize() not called before _openPopup()");const a=yield X8(e,t,r,mg(),i);return function rAe(n,e,t,r=500,i=600){const o=Math.max((window.screen.availHeight-i)/2,0).toString(),s=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const l=Object.assign(Object.assign({},ZDe),{width:r.toString(),height:i.toString(),top:o,left:s}),c=_n().toLowerCase();t&&(a=l8(c)?"_blank":t),s8(c)&&(e=e||"http://localhost",l.scrollbars="yes");const u=Object.entries(l).reduce((f,[p,m])=>`${f}${p}=${m},`,"");if(function $xe(n=_n()){var e;return EM(n)&&!(null===(e=window.navigator)||void 0===e||!e.standalone)}(c)&&"_self"!==a)return function iAe(n,e){const t=document.createElement("a");t.href=n,t.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(r)}(e||"",a),new Y8(null);const d=window.open(e||"",a,u);X(d,n,"popup-blocked");try{d.focus()}catch{}return new Y8(d)}(e,a,kE())})()}_openRedirect(e,t,r,i){var o=this;return T(function*(){return yield o._originValidation(e),function iDe(n){Sn().location.href=n}(yield X8(e,t,r,mg(),i)),new Promise(()=>{})})()}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:i,promise:o}=this.eventManagers[t];return i?Promise.resolve(i):(Ls(o,"If manager is not set, promise should be"),o)}const r=this.initAndGetManager(e);return this.eventManagers[t]={promise:r},r.catch(()=>{delete this.eventManagers[t]}),r}initAndGetManager(e){var t=this;return T(function*(){const r=yield function XDe(n){return c1.apply(this,arguments)}(e),i=new ODe(e);return r.register("authEvent",o=>(X(o?.authEvent,e,"invalid-auth-event"),{status:i.onEvent(o.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),t.eventManagers[e._key()]={manager:i},t.iframes[e._key()]=r,i})()}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(d1,{type:d1},i=>{var o;const s=null===(o=i?.[0])||void 0===o?void 0:o[d1];void 0!==s&&t(!!s),li(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=function UDe(n){return l1.apply(this,arguments)}(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return f8()||a8()||EM()}};var n6="@firebase/auth";class uAe{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),(null===(e=this.auth.currentUser)||void 0===e?void 0:e.uid)||null}getToken(e){var t=this;return T(function*(){return t.assertAuthConfigured(),yield t.auth._initializationPromise,t.auth.currentUser?{accessToken:yield t.auth.currentUser.getIdToken(e)}:null})()}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(r=>{e(r?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){X(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}const pAe=XW("authIdTokenMaxAge")||300;let i6=null;const mAe=n=>function(){var e=T(function*(t){const r=t&&(yield t.getIdTokenResult()),i=r&&((new Date).getTime()-Date.parse(r.issuedAtTime))/1e3;if(i&&i>pAe)return;const o=r?.token;i6!==o&&(i6=o,yield fetch(n,{method:o?"POST":"DELETE",headers:o?{Authorization:`Bearer ${o}`}:{}}))});return function(t){return e.apply(this,arguments)}}();function gAe(n=cE()){const e=cg(n,"auth");if(e.isInitialized())return e.getImmediate();const t=function cSe(n,e){const t=cg(n,"auth");if(t.isInitialized()){const i=t.getImmediate();if(ph(t.getOptions(),e??{}))return i;li(i,"already-initialized")}return t.initialize({options:e})}(n,{popupRedirectResolver:Z8,persistence:[fDe,eDe,F8]}),r=XW("authTokenSyncURL");if(r&&"boolean"==typeof isSecureContext&&isSecureContext){const o=new URL(r,location.origin);if(location.origin===o.origin){const s=mAe(o.toString());(function GSe(n,e,t){sn(n).beforeAuthStateChanged(e,t)})(t,s,()=>s(t.currentUser)),N8(t,a=>s(a))}}const i=KW("auth");return i&&function dSe(n,e,t){const r=yn(n);X(r._canInitEmulator,r,"emulator-config-failed"),X(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!!t?.disableWarnings,o=v8(e),{host:s,port:a}=function hSe(n){const e=v8(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};const r=t[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const o=i[1];return{host:o,port:b8(r.substr(o.length+1))}}{const[o,s]=r.split(":");return{host:o,port:b8(s)}}}(e);r.config.emulator={url:`${o}//${s}${null===a?"":`:${a}`}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:s,port:a,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||function fSe(){function n(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&"function"==typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",n):n())}()}(t,`http://${i}`),t}function o6(n){return new vt(function(e){return{unsubscribe:N8(n,e.next.bind(e),e.error.bind(e),e.complete.bind(e))}})}(function Xxe(n){bg=n})({loadJS:n=>new Promise((e,t)=>{const r=document.createElement("script");r.setAttribute("src",n),r.onload=e,r.onerror=i=>{const o=jr("internal-error");o.customData=i,t(o)},r.type="text/javascript",r.charset="UTF-8",function _Ae(){var n,e;return null!==(e=null===(n=document.getElementsByTagName("head"))||void 0===n?void 0:n[0])&&void 0!==e?e:document}().appendChild(r)}),gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="}),function hAe(n){Fs(new Go("auth",(e,{options:t})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),o=e.getProvider("app-check-internal"),{apiKey:s,authDomain:a}=r.options;X(s&&!s.includes(":"),"invalid-api-key",{appName:r.name});const l={apiKey:s,authDomain:a,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:p8(n)},c=new Yxe(r,i,o,l);return function uSe(n,e){const t=e?.persistence||[],r=(Array.isArray(t)?t:[t]).map(zs);e?.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(r,e?.popupRedirectResolver)}(c,t),c},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider("auth-internal").initialize()})),Fs(new Go("auth-internal",e=>{const t=yn(e.getProvider("auth").getImmediate());return new uAe(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),Gn(n6,"1.9.0",function dAe(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}(n)),Gn(n6,"1.9.0","esm2017")}("Browser");class LE{constructor(e){return e}}class f1{constructor(){return dE("auth")}}const p1=new B("angularfire2.auth-instances");function vAe(n){return(e,t)=>{const r=e.runOutsideAngular(()=>n(t));return new LE(r)}}const bAe={provide:f1,deps:[[new fn,p1]]},wAe={provide:LE,useFactory:function yAe(n,e){const t=uE("auth",n,e);return t&&new LE(t)},deps:[[new fn,p1],Bc]},IAe=ir(o6,!0),TAe=ir(VSe,!0,2),CAe=ir(gAe,!0),xAe=ir(BSe,!0,2),SAe=ir(xDe,!0,2),DAe=ir(KSe,!0,2);var tl,c6,a6=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},l6={};(function(){var n;function r(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.B=Array(this.blockSize),this.o=this.h=0,this.s()}function i(S,I,x){x||(x=0);var A=Array(16);if("string"==typeof I)for(var M=0;16>M;++M)A[M]=I.charCodeAt(x++)|I.charCodeAt(x++)<<8|I.charCodeAt(x++)<<16|I.charCodeAt(x++)<<24;else for(M=0;16>M;++M)A[M]=I[x++]|I[x++]<<8|I[x++]<<16|I[x++]<<24;var P=S.g[3],D=(I=S.g[0])+(P^(x=S.g[1])&((M=S.g[2])^P))+A[0]+3614090360&4294967295;D=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=x+(D<<7&4294967295|D>>>25))+((D=P+(M^I&(x^M))+A[1]+3905402710&4294967295)<<12&4294967295|D>>>20))+((D=M+(x^P&(I^x))+A[2]+606105819&4294967295)<<17&4294967295|D>>>15))+((D=x+(I^M&(P^I))+A[3]+3250441966&4294967295)<<22&4294967295|D>>>10))+((D=I+(P^x&(M^P))+A[4]+4118548399&4294967295)<<7&4294967295|D>>>25))+((D=P+(M^I&(x^M))+A[5]+1200080426&4294967295)<<12&4294967295|D>>>20))+((D=M+(x^P&(I^x))+A[6]+2821735955&4294967295)<<17&4294967295|D>>>15))+((D=x+(I^M&(P^I))+A[7]+4249261313&4294967295)<<22&4294967295|D>>>10))+((D=I+(P^x&(M^P))+A[8]+1770035416&4294967295)<<7&4294967295|D>>>25))+((D=P+(M^I&(x^M))+A[9]+2336552879&4294967295)<<12&4294967295|D>>>20))+((D=M+(x^P&(I^x))+A[10]+4294925233&4294967295)<<17&4294967295|D>>>15))+((D=x+(I^M&(P^I))+A[11]+2304563134&4294967295)<<22&4294967295|D>>>10))+((D=I+(P^x&(M^P))+A[12]+1804603682&4294967295)<<7&4294967295|D>>>25))+((D=P+(M^I&(x^M))+A[13]+4254626195&4294967295)<<12&4294967295|D>>>20))+((D=M+(x^P&(I^x))+A[14]+2792965006&4294967295)<<17&4294967295|D>>>15))+((D=x+(I^M&(P^I))+A[15]+1236535329&4294967295)<<22&4294967295|D>>>10))+((D=I+(M^P&(x^M))+A[1]+4129170786&4294967295)<<5&4294967295|D>>>27))+((D=P+(x^M&(I^x))+A[6]+3225465664&4294967295)<<9&4294967295|D>>>23))+((D=M+(I^x&(P^I))+A[11]+643717713&4294967295)<<14&4294967295|D>>>18))+((D=x+(P^I&(M^P))+A[0]+3921069994&4294967295)<<20&4294967295|D>>>12))+((D=I+(M^P&(x^M))+A[5]+3593408605&4294967295)<<5&4294967295|D>>>27))+((D=P+(x^M&(I^x))+A[10]+38016083&4294967295)<<9&4294967295|D>>>23))+((D=M+(I^x&(P^I))+A[15]+3634488961&4294967295)<<14&4294967295|D>>>18))+((D=x+(P^I&(M^P))+A[4]+3889429448&4294967295)<<20&4294967295|D>>>12))+((D=I+(M^P&(x^M))+A[9]+568446438&4294967295)<<5&4294967295|D>>>27))+((D=P+(x^M&(I^x))+A[14]+3275163606&4294967295)<<9&4294967295|D>>>23))+((D=M+(I^x&(P^I))+A[3]+4107603335&4294967295)<<14&4294967295|D>>>18))+((D=x+(P^I&(M^P))+A[8]+1163531501&4294967295)<<20&4294967295|D>>>12))+((D=I+(M^P&(x^M))+A[13]+2850285829&4294967295)<<5&4294967295|D>>>27))+((D=P+(x^M&(I^x))+A[2]+4243563512&4294967295)<<9&4294967295|D>>>23))+((D=M+(I^x&(P^I))+A[7]+1735328473&4294967295)<<14&4294967295|D>>>18))+((D=x+(P^I&(M^P))+A[12]+2368359562&4294967295)<<20&4294967295|D>>>12))+((D=I+(x^M^P)+A[5]+4294588738&4294967295)<<4&4294967295|D>>>28))+((D=P+(I^x^M)+A[8]+2272392833&4294967295)<<11&4294967295|D>>>21))+((D=M+(P^I^x)+A[11]+1839030562&4294967295)<<16&4294967295|D>>>16))+((D=x+(M^P^I)+A[14]+4259657740&4294967295)<<23&4294967295|D>>>9))+((D=I+(x^M^P)+A[1]+2763975236&4294967295)<<4&4294967295|D>>>28))+((D=P+(I^x^M)+A[4]+1272893353&4294967295)<<11&4294967295|D>>>21))+((D=M+(P^I^x)+A[7]+4139469664&4294967295)<<16&4294967295|D>>>16))+((D=x+(M^P^I)+A[10]+3200236656&4294967295)<<23&4294967295|D>>>9))+((D=I+(x^M^P)+A[13]+681279174&4294967295)<<4&4294967295|D>>>28))+((D=P+(I^x^M)+A[0]+3936430074&4294967295)<<11&4294967295|D>>>21))+((D=M+(P^I^x)+A[3]+3572445317&4294967295)<<16&4294967295|D>>>16))+((D=x+(M^P^I)+A[6]+76029189&4294967295)<<23&4294967295|D>>>9))+((D=I+(x^M^P)+A[9]+3654602809&4294967295)<<4&4294967295|D>>>28))+((D=P+(I^x^M)+A[12]+3873151461&4294967295)<<11&4294967295|D>>>21))+((D=M+(P^I^x)+A[15]+530742520&4294967295)<<16&4294967295|D>>>16))+((D=x+(M^P^I)+A[2]+3299628645&4294967295)<<23&4294967295|D>>>9))+((D=I+(M^(x|~P))+A[0]+4096336452&4294967295)<<6&4294967295|D>>>26))+((D=P+(x^(I|~M))+A[7]+1126891415&4294967295)<<10&4294967295|D>>>22))+((D=M+(I^(P|~x))+A[14]+2878612391&4294967295)<<15&4294967295|D>>>17))+((D=x+(P^(M|~I))+A[5]+4237533241&4294967295)<<21&4294967295|D>>>11))+((D=I+(M^(x|~P))+A[12]+1700485571&4294967295)<<6&4294967295|D>>>26))+((D=P+(x^(I|~M))+A[3]+2399980690&4294967295)<<10&4294967295|D>>>22))+((D=M+(I^(P|~x))+A[10]+4293915773&4294967295)<<15&4294967295|D>>>17))+((D=x+(P^(M|~I))+A[1]+2240044497&4294967295)<<21&4294967295|D>>>11))+((D=I+(M^(x|~P))+A[8]+1873313359&4294967295)<<6&4294967295|D>>>26))+((D=P+(x^(I|~M))+A[15]+4264355552&4294967295)<<10&4294967295|D>>>22))+((D=M+(I^(P|~x))+A[6]+2734768916&4294967295)<<15&4294967295|D>>>17))+((D=x+(P^(M|~I))+A[13]+1309151649&4294967295)<<21&4294967295|D>>>11))+((P=(I=x+((D=I+(M^(x|~P))+A[4]+4149444226&4294967295)<<6&4294967295|D>>>26))+((D=P+(x^(I|~M))+A[11]+3174756917&4294967295)<<10&4294967295|D>>>22))^((M=P+((D=M+(I^(P|~x))+A[2]+718787259&4294967295)<<15&4294967295|D>>>17))|~I))+A[9]+3951481745&4294967295,S.g[0]=S.g[0]+I&4294967295,S.g[1]=S.g[1]+(M+(D<<21&4294967295|D>>>11))&4294967295,S.g[2]=S.g[2]+M&4294967295,S.g[3]=S.g[3]+P&4294967295}function s(S,I){this.h=I;for(var x=[],A=!0,M=S.length-1;0<=M;M--){var P=0|S[M];A&&P==I||(x[M]=P,A=!1)}this.g=x}(function e(S,I){function x(){}x.prototype=I.prototype,S.D=I.prototype,S.prototype=new x,S.prototype.constructor=S,S.C=function(A,M,P){for(var D=Array(arguments.length-2),so=2;sothis.h?this.blockSize:2*this.blockSize)-this.h);S[0]=128;for(var I=1;II;++I)for(var A=0;32>A;A+=8)S[x++]=this.g[I]>>>A&255;return S};var a={};function l(S){return-128<=S&&128>S?function o(S,I){var x=a;return Object.prototype.hasOwnProperty.call(x,S)?x[S]:x[S]=I(S)}(S,function(I){return new s([0|I],0>I?-1:0)}):new s([0|S],0>S?-1:0)}function c(S){if(isNaN(S)||!isFinite(S))return d;if(0>S)return v(c(-S));for(var I=[],x=1,A=0;S>=x;A++)I[A]=S/x|0,x*=4294967296;return new s(I,0)}var d=l(0),f=l(1),p=l(16777216);function m(S){if(0!=S.h)return!1;for(var I=0;I>>16,S[I]&=65535,I++}function R(S,I){this.g=S,this.h=I}function V(S,I){if(m(I))throw Error("division by zero");if(m(S))return new R(d,d);if(_(S))return I=V(v(S),I),new R(v(I.g),v(I.h));if(_(I))return I=V(S,v(I)),new R(v(I.g),I.h);if(30=A.l(S);)x=H(x),A=H(A);var M=Q(x,1),P=Q(A,1);for(A=Q(A,2),x=Q(x,2);!m(A);){var D=P.add(A);0>=D.l(S)&&(M=M.add(x),P=D),A=Q(A,1),x=Q(x,1)}return I=E(S,M.j(I)),new R(M,I)}for(M=d;0<=S.l(I);){for(x=Math.max(1,Math.floor(S.m()/I.m())),A=48>=(A=Math.ceil(Math.log(x)/Math.LN2))?1:Math.pow(2,A-48),D=(P=c(x)).j(I);_(D)||0>>31;return new s(x,S.h)}function Q(S,I){var x=I>>5;I%=32;for(var A=S.g.length-x,M=[],P=0;P>>I|S.i(P+x+1)<<32-I:S.i(P+x);return new s(M,S.h)}(n=s.prototype).m=function(){if(_(this))return-v(this).m();for(var S=0,I=1,x=0;x(S=S||10)||36>>0).toString(S);if(m(x=M))return P+A;for(;6>P.length;)P="0"+P;A=P+A}},n.i=function(S){return 0>S?0:S>>16)+(this.i(M)>>>16)+(S.i(M)>>>16);A=D>>>16,x[M]=(D&=65535)<<16|(P&=65535)}return new s(x,-2147483648&x[x.length-1]?-1:0)},n.j=function(S){if(m(this)||m(S))return d;if(_(this))return _(S)?v(this).j(v(S)):v(v(this).j(S));if(_(S))return v(this.j(v(S)));if(0>this.l(p)&&0>S.l(p))return c(this.m()*S.m());for(var I=this.g.length+S.g.length,x=[],A=0;A<2*I;A++)x[A]=0;for(A=0;A>>16,D=65535&this.i(A),so=S.i(M)>>>16,Vl=65535&S.i(M);x[2*A+2*M]+=D*Vl,C(x,2*A+2*M),x[2*A+2*M+1]+=P*Vl,C(x,2*A+2*M+1),x[2*A+2*M+1]+=D*so,C(x,2*A+2*M+1),x[2*A+2*M+2]+=P*so,C(x,2*A+2*M+2)}for(A=0;A(I=I||10)||36P?(P=c(Math.pow(I,P)),A=A.j(P).add(c(D))):A=(A=A.j(x)).add(c(D))}return A},tl=l6.Integer=s}).apply(typeof a6<"u"?a6:typeof self<"u"?self:typeof window<"u"?window:{});var u6,kg,d6,BE,m1,h6,f6,p6,VE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},$s={};(function(){var n,e="function"==typeof Object.defineProperties?Object.defineProperty:function(h,g,y){return h==Array.prototype||h==Object.prototype||(h[g]=y.value),h},r=function t(h){h=["object"==typeof globalThis&&globalThis,h,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof VE&&VE];for(var g=0;g{throw h},0)}function D(){var h=Ue;let g=null;return h.g&&(g=h.g,h.g=h.g.next,h.g||(h.h=null),g.next=null),g}var Vl=new class E{constructor(g,y){this.i=g,this.j=y,this.h=0,this.g=null}get(){let g;return 0new ae,h=>h.reset());class ae{constructor(){this.next=this.g=this.h=null}set(g,y){this.h=g,this.g=y,this.next=null}reset(){this.next=this.g=this.h=null}}let ce,he=!1,Ue=new class so{constructor(){this.h=this.g=null}add(g,y){const w=Vl.get();w.set(g,y),this.h?this.h.next=w:this.g=w,this.h=w}},En=()=>{const h=a.Promise.resolve(void 0);ce=()=>{h.then(ao)}};var ao=()=>{for(var h;h=D();){try{h.h.call(h.g)}catch(y){P(y)}var g=Vl;g.j(h),100>g.h&&(g.h++,h.next=g.g,g.g=h)}he=!1};function cn(){this.s=this.s,this.C=this.C}function Vt(h,g){this.type=h,this.g=this.target=g,this.defaultPrevented=!1}cn.prototype.s=!1,cn.prototype.ma=function(){this.s||(this.s=!0,this.N())},cn.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()},Vt.prototype.h=function(){this.defaultPrevented=!0};var Bt=function(){if(!a.addEventListener||!Object.defineProperty)return!1;var h=!1,g=Object.defineProperty({},"passive",{get:function(){h=!0}});try{const y=()=>{};a.addEventListener("test",y,g),a.removeEventListener("test",y,g)}catch{}return h}();function Bl(h,g){if(Vt.call(this,h?h.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,h){var y=this.type=h.type,w=h.changedTouches&&h.changedTouches.length?h.changedTouches[0]:null;if(this.target=h.target||h.srcElement,this.g=g,g=h.relatedTarget){if(H){e:{try{V(g.nodeName);var k=!0;break e}catch{}k=!1}k||(g=null)}}else"mouseover"==y?g=h.fromElement:"mouseout"==y&&(g=h.toElement);this.relatedTarget=g,w?(this.clientX=void 0!==w.clientX?w.clientX:w.pageX,this.clientY=void 0!==w.clientY?w.clientY:w.pageY,this.screenX=w.screenX||0,this.screenY=w.screenY||0):(this.clientX=void 0!==h.clientX?h.clientX:h.pageX,this.clientY=void 0!==h.clientY?h.clientY:h.pageY,this.screenX=h.screenX||0,this.screenY=h.screenY||0),this.button=h.button,this.key=h.key||"",this.ctrlKey=h.ctrlKey,this.altKey=h.altKey,this.shiftKey=h.shiftKey,this.metaKey=h.metaKey,this.pointerId=h.pointerId||0,this.pointerType="string"==typeof h.pointerType?h.pointerType:mL[h.pointerType]||"",this.state=h.state,this.i=h,h.defaultPrevented&&Bl.aa.h.call(this)}}m(Bl,Vt);var mL={2:"touch",3:"pen",4:"mouse"};Bl.prototype.h=function(){Bl.aa.h.call(this);var h=this.i;h.preventDefault?h.preventDefault():h.returnValue=!1};var un="closure_listenable_"+(1e6*Math.random()|0),ua=0;function pi(h,g,y,w,k){this.listener=h,this.proxy=null,this.src=g,this.type=y,this.capture=!!w,this.ha=k,this.key=++ua,this.da=this.fa=!1}function da(h){h.da=!0,h.listener=null,h.proxy=null,h.src=null,h.ha=null}function Ul(h){this.src=h,this.g={},this.h=0}function gL(h,g){var y=g.type;if(y in h.g){var U,w=h.g[y],k=Array.prototype.indexOf.call(w,g,void 0);(U=0<=k)&&Array.prototype.splice.call(w,k,1),U&&(da(g),0==h.g[y].length&&(delete h.g[y],h.h--))}}function _L(h,g,y,w){for(var k=0;k>>0);function IL(h){return"function"==typeof h?h:(h[EL]||(h[EL]=function(g){return h.handleEvent(g)}),h[EL])}function Dr(){cn.call(this),this.i=new Ul(this),this.M=this,this.F=null}function Kr(h,g){var y,w=h.F;if(w)for(y=[];w;w=w.F)y.push(w);if(h=h.M,w=g.type||g,"string"==typeof g)g=new Vt(g,h);else if(g instanceof Vt)g.target=g.target||h;else{var k=g;A(g=new Vt(w,h),k)}if(k=!0,y)for(var U=y.length-1;0<=U;U--){var J=g.g=y[U];k=rC(J,w,!0,g)&&k}if(k=rC(J=g.g=h,w,!0,g)&&k,k=rC(J,w,!1,g)&&k,y)for(U=0;U{h.g=null,h.i&&(h.i=!1,Lee(h))},h.l);const g=h.h;h.h=null,h.m.apply(null,g)}m(Dr,cn),Dr.prototype[un]=!0,Dr.prototype.removeEventListener=function(h,g,y,w){Pee(this,h,g,y,w)},Dr.prototype.N=function(){if(Dr.aa.N.call(this),this.i){var g,h=this.i;for(g in h.g){for(var y=h.g[g],w=0;ww.length)){var k=w[1];if(Array.isArray(k)&&!(1>k.length)){var U=k[0];if("noop"!=U&&"stop"!=U&&"close"!=U)for(var J=1;Jg.length?AL:(g=g.slice(w,w+y),h.C=w+y,g))}function aC(h){h.S=Date.now()+h.I,Xee(h,h.I)}function Xee(h,g){if(null!=h.B)throw Error("WatchDog timer not null");h.B=ay(f(h.ba,h),g)}function ML(h){h.B&&(a.clearTimeout(h.B),h.B=null)}function cy(h){0==h.j.G||h.J||Ite(h.j,h)}function Ou(h){ML(h);var g=h.M;g&&"function"==typeof g.ma&&g.ma(),h.M=null,Bee(h.U),h.g&&(g=h.g,h.g=null,g.abort(),g.ma())}function kL(h,g){try{var y=h.j;if(0!=y.G&&(y.g==h||NL(y.h,h)))if(!h.K&&NL(y.h,h)&&3==y.G){try{var w=y.Da.g.parse(g)}catch{w=null}if(Array.isArray(w)&&3==w.length){var k=w;if(0==k[0]){e:if(!y.u){if(y.g){if(!(y.g.F+3e3k[2]&&y.F&&0==y.v&&!y.C&&(y.C=ay(f(y.Za,y),6e3));if(1>=ete(y.h)&&y.ca){try{y.ca()}catch{}y.ca=void 0}}else Lu(y,11)}else if((h.K||y.g==h)&&mC(y),!C(g))for(k=y.Da.g.parse(g),g=0;gRr)&&(3!=Rr||this.g&&(this.h.h||this.g.oa()||gte(this.g)))){this.J||4!=Rr||7==g||sy(),ML(this);var y=this.g.Z();this.X=y;t:if(Yee(this)){var w=gte(this.g);h="";var k=w.length,U=4==fa(this.g);if(!this.h.i){if(typeof TextDecoder>"u"){Ou(this),cy(this);var J="";break t}this.h.i=new a.TextDecoder}for(g=0;g=h.j}function ete(h){return h.h?1:h.g?h.g.size:0}function NL(h,g){return h.h?h.h==g:!!h.g&&h.g.has(g)}function PL(h,g){h.g?h.g.add(g):h.h=g}function tte(h,g){h.h&&h.h==g?h.h=null:h.g&&h.g.has(g)&&h.g.delete(g)}function nte(h){if(null!=h.h)return h.i.concat(h.h.D);if(null!=h.g&&0!==h.g.size){let g=h.i;for(const y of h.g.values())g=g.concat(y.D);return g}return _(h.i)}function rte(h,g){if(h.forEach&&"function"==typeof h.forEach)h.forEach(g,void 0);else if(l(h)||"string"==typeof h)Array.prototype.forEach.call(h,g,void 0);else for(var y=function S$e(h){if(h.na&&"function"==typeof h.na)return h.na();if(!h.V||"function"!=typeof h.V){if(typeof Map<"u"&&h instanceof Map)return Array.from(h.keys());if(!(typeof Set<"u"&&h instanceof Set)){if(l(h)||"string"==typeof h){var g=[];h=h.length;for(var y=0;yg)throw Error("Bad port number "+g);h.s=g}else h.s=null}function ote(h,g,y){g instanceof hy?(h.i=g,function P$e(h,g){g&&!h.j&&(jl(h),h.i=null,h.g.forEach(function(y,w){var k=w.toLowerCase();w!=k&&(ate(this,w),cte(this,k,y))},h)),h.j=g}(h.i,h.h)):(y||(g=dy(g,k$e)),h.i=new hy(g,h.h))}function Ut(h,g,y){h.i.set(g,y)}function uC(h){return Ut(h,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),h}function uy(h,g){return h?g?decodeURI(h.replace(/%25/g,"%2525")):decodeURIComponent(h):""}function dy(h,g,y){return"string"==typeof h?(h=encodeURI(h).replace(g,A$e),y&&(h=h.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),h):null}function A$e(h){return"%"+((h=h.charCodeAt(0))>>4&15).toString(16)+(15&h).toString(16)}Fu.prototype.toString=function(){var h=[],g=this.j;g&&h.push(dy(g,ste,!0),":");var y=this.g;return(y||"file"==g)&&(h.push("//"),(g=this.o)&&h.push(dy(g,ste,!0),"@"),h.push(encodeURIComponent(String(y)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(y=this.s)&&h.push(":",String(y))),(y=this.l)&&(this.g&&"/"!=y.charAt(0)&&h.push("/"),h.push(dy(y,"/"==y.charAt(0)?M$e:R$e,!0))),(y=this.i.toString())&&h.push("?",y),(y=this.m)&&h.push("#",dy(y,N$e)),h.join("")};var ste=/[#\/\?@]/g,R$e=/[#\?:]/g,M$e=/[#\?]/g,k$e=/[#\?@]/g,N$e=/#/g;function hy(h,g){this.h=this.g=null,this.i=h||null,this.j=!!g}function jl(h){h.g||(h.g=new Map,h.h=0,h.i&&function D$e(h,g){if(h){h=h.split("&");for(var y=0;y{}),1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,py(this)),this.readyState=0},n.Sa=function(h){if(this.g&&(this.l=h,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=h.headers,this.readyState=2,my(this)),this.g&&(this.readyState=3,my(this),this.g)))if("arraybuffer"===this.responseType)h.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof a.ReadableStream<"u"&&"body"in h){if(this.j=h.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.v=new TextDecoder;ute(this)}else h.text().then(this.Ra.bind(this),this.ga.bind(this))},n.Pa=function(h){if(this.g){if(this.o&&h.value)this.response.push(h.value);else if(!this.o){var g=h.value?h.value:new Uint8Array(0);(g=this.v.decode(g,{stream:!h.done}))&&(this.response=this.responseText+=g)}h.done?py(this):my(this),3==this.readyState&&ute(this)}},n.Ra=function(h){this.g&&(this.response=this.responseText=h,py(this))},n.Qa=function(h){this.g&&(this.response=h,py(this))},n.ga=function(){this.g&&py(this)},n.setRequestHeader=function(h,g){this.u.append(h,g)},n.getResponseHeader=function(h){return this.h&&this.h.get(h.toLowerCase())||""},n.getAllResponseHeaders=function(){if(!this.h)return"";const h=[],g=this.h.entries();for(var y=g.next();!y.done;)h.push((y=y.value)[0]+": "+y[1]),y=g.next();return h.join("\r\n")},Object.defineProperty(dC.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(h){this.m=h?"include":"same-origin"}}),m(dn,Dr);var B$e=/^https?$/i,U$e=["POST","PUT"];function hte(h,g){h.h=!1,h.g&&(h.j=!0,h.g.abort(),h.j=!1),h.l=g,h.m=5,fte(h),hC(h)}function fte(h){h.A||(h.A=!0,Kr(h,"complete"),Kr(h,"error"))}function pte(h){if(h.h&&typeof s<"u"&&(!h.v[1]||4!=fa(h)||2!=h.Z()))if(h.u&&4==fa(h))Fee(h.Ea,0,h);else if(Kr(h,"readystatechange"),4==fa(h)){h.h=!1;try{const J=h.Z();e:switch(J){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var g=!0;break e;default:g=!1}var y;if(!(y=g)){var w;if(w=0===J){var k=String(h.D).match(ite)[1]||null;!k&&a.self&&a.self.location&&(k=a.self.location.protocol.slice(0,-1)),w=!B$e.test(k?k.toLowerCase():"")}y=w}if(y)Kr(h,"complete"),Kr(h,"success");else{h.m=6;try{var U=2{}:null;h.g=null,h.v=null,g||Kr(h,"ready");try{y.onreadystatechange=w}catch{}}}function mte(h){h.I&&(a.clearTimeout(h.I),h.I=null)}function fa(h){return h.g?h.g.readyState:0}function gte(h){try{if(!h.g)return null;if("response"in h.g)return h.g.response;switch(h.H){case"":case"text":return h.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in h.g)return h.g.mozResponseArrayBuffer}return null}catch{return null}}function gy(h,g,y){return y&&y.internalChannelParams&&y.internalChannelParams[h]||g}function _te(h){this.Aa=0,this.i=[],this.j=new ly,this.ia=this.qa=this.I=this.W=this.g=this.ya=this.D=this.H=this.m=this.S=this.o=null,this.Ya=this.U=0,this.Va=gy("failFast",!1,h),this.F=this.C=this.u=this.s=this.l=null,this.X=!0,this.za=this.T=-1,this.Y=this.v=this.B=0,this.Ta=gy("baseRetryDelayMs",5e3,h),this.cb=gy("retryDelaySeedMs",1e4,h),this.Wa=gy("forwardChannelMaxRetries",2,h),this.wa=gy("forwardChannelRequestTimeoutMs",2e4,h),this.pa=h&&h.xmlHttpFactory||void 0,this.Xa=h&&h.Tb||void 0,this.Ca=h&&h.useFetchStreams||!1,this.L=void 0,this.J=h&&h.supportsCrossDomainXhr||!1,this.K="",this.h=new Zee(h&&h.concurrentRequestLimit),this.Da=new L$e,this.P=h&&h.fastHandshake||!1,this.O=h&&h.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.Ua=h&&h.Rb||!1,h&&h.xa&&this.j.xa(),h&&h.forceLongPolling&&(this.X=!1),this.ba=!this.P&&this.X&&h&&h.detectBufferingProxy||!1,this.ja=void 0,h&&h.longPollingTimeout&&0ot)U=Math.max(0,k[fr].g-100),xt=!1;else try{V$e(Ar,J,"req"+ot+"_")}catch{w&&w(Ar)}}if(xt){w=J.join("&");break e}}}return h=h.i.splice(0,y),g.D=h,w}function wte(h){if(!h.g&&!h.u){h.Y=1;var g=h.Fa;ce||En(),he||(ce(),he=!0),Ue.add(g,h),h.v=0}}function LL(h){return!(h.g||h.u||3<=h.v||(h.Y++,h.u=ay(f(h.Fa,h),Tte(h,h.v)),h.v++,0))}function VL(h){null!=h.A&&(a.clearTimeout(h.A),h.A=null)}function Ete(h){h.g=new zl(h,h.j,"rpc",h.Y),null===h.m&&(h.g.H=h.o),h.g.O=0;var g=ha(h.qa);Ut(g,"RID","rpc"),Ut(g,"SID",h.K),Ut(g,"AID",h.T),Ut(g,"CI",h.F?"0":"1"),!h.F&&h.ja&&Ut(g,"TO",h.ja),Ut(g,"TYPE","xmlhttp"),_y(h,g),h.m&&h.o&&OL(g,h.m,h.o),h.L&&(h.g.I=h.L);var y=h.g;h=h.ia,y.L=1,y.v=uC(ha(g)),y.m=null,y.P=!0,Qee(y,h)}function mC(h){null!=h.C&&(a.clearTimeout(h.C),h.C=null)}function Ite(h,g){var y=null;if(h.g==g){mC(h),VL(h),h.g=null;var w=2}else{if(!NL(h.h,g))return;y=g.D,tte(h.h,g),w=1}if(0!=h.G)if(g.o)if(1==w){y=g.m?g.m.length:0,g=Date.now()-g.F;var k=h.B;Kr(w=iC(),new qee(w,y)),pC(h)}else wte(h);else if(3==(k=g.s)||0==k&&0=h.h.j-(h.s?1:0)||(h.s?(h.i=g.D.concat(h.i),0):1==h.G||2==h.G||h.B>=(h.Va?0:h.Wa)||(h.s=ay(f(h.Ga,h,g),Tte(h,h.B)),h.B++,0)))}(h,g)||2==w&&LL(h)))switch(y&&0{w.abort(),Hl(0,0,!1,g)},1e4);fetch(h,{signal:w.signal}).then(U=>{clearTimeout(k),Hl(0,0,!!U.ok,g)}).catch(()=>{clearTimeout(k),Hl(0,0,!1,g)})}(w.toString(),y)}else Qr(2);h.G=0,h.l&&h.l.sa(g),Cte(h),yte(h)}function Cte(h){if(h.G=0,h.ka=[],h.l){const g=nte(h.h);(0!=g.length||0!=h.i.length)&&(v(h.ka,g),v(h.ka,h.i),h.h.i.length=0,_(h.i),h.i.length=0),h.l.ra()}}function xte(h,g,y){var w=y instanceof Fu?ha(y):new Fu(y);if(""!=w.g)g&&(w.g=g+"."+w.g),cC(w,w.s);else{var k=a.location;w=k.protocol,g=g?g+"."+k.hostname:k.hostname,k=+k.port;var U=new Fu(null);w&&lC(U,w),g&&(U.g=g),k&&cC(U,k),y&&(U.l=y),w=U}return g=h.ya,(y=h.D)&&g&&Ut(w,y,g),Ut(w,"VER",h.la),_y(h,w),w}function Ste(h,g,y){if(g&&!h.J)throw Error("Can't create secondary domain capable XhrIo object.");return(g=new dn(h.Ca&&!h.pa?new fy({eb:y}):h.pa)).Ha(h.J),g}function Dte(){}function gC(){}function Vi(h,g){Dr.call(this),this.g=new _te(g),this.l=h,this.h=g&&g.messageUrlParams||null,h=g&&g.messageHeaders||null,g&&g.clientProtocolHeaderRequired&&(h?h["X-Client-Protocol"]="webchannel":h={"X-Client-Protocol":"webchannel"}),this.g.o=h,h=g&&g.initMessageHeaders||null,g&&g.messageContentType&&(h?h["X-WebChannel-Content-Type"]=g.messageContentType:h={"X-WebChannel-Content-Type":g.messageContentType}),g&&g.va&&(h?h["X-WebChannel-Client-Profile"]=g.va:h={"X-WebChannel-Client-Profile":g.va}),this.g.S=h,(h=g&&g.Sb)&&!C(h)&&(this.g.m=h),this.v=g&&g.supportsCrossDomainXhr||!1,this.u=g&&g.sendRawJson||!1,(g=g&&g.httpSessionIdParam)&&!C(g)&&(this.g.D=g,null!==(h=this.h)&&g in h&&g in(h=this.h)&&delete h[g]),this.j=new Bf(this)}function Ate(h){xL.call(this),h.__headers__&&(this.headers=h.__headers__,this.statusCode=h.__status__,delete h.__headers__,delete h.__status__);var g=h.__sm__;if(g){e:{for(const y in g){h=y;break e}h=void 0}(this.i=h)&&(h=this.i,g=null!==g&&h in g?g[h]:void 0),this.data=g}else this.data=h}function Rte(){SL.call(this),this.status=1}function Bf(h){this.g=h}(n=dn.prototype).Ha=function(h){this.J=h},n.ea=function(h,g,y,w){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+h);g=g?g.toUpperCase():"GET",this.D=h,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():DL.g(),this.v=function Uee(h){return h.h||(h.h=h.i())}(this.o?this.o:DL),this.g.onreadystatechange=f(this.Ea,this);try{this.B=!0,this.g.open(g,String(h),!0),this.B=!1}catch(U){return void hte(this,U)}if(h=y||"",y=new Map(this.headers),w)if(Object.getPrototypeOf(w)===Object.prototype)for(var k in w)y.set(k,w[k]);else{if("function"!=typeof w.keys||"function"!=typeof w.get)throw Error("Unknown input type for opt_headers: "+String(w));for(const U of w.keys())y.set(U,w.get(U))}w=Array.from(y.keys()).find(U=>"content-type"==U.toLowerCase()),k=a.FormData&&h instanceof a.FormData,!(0<=Array.prototype.indexOf.call(U$e,g,void 0))||w||k||y.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[U,J]of y)this.g.setRequestHeader(U,J);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{mte(this),this.u=!0,this.g.send(h),this.u=!1}catch(U){hte(this,U)}},n.abort=function(h){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=h||7,Kr(this,"complete"),Kr(this,"abort"),hC(this))},n.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),hC(this,!0)),dn.aa.N.call(this)},n.Ea=function(){this.s||(this.B||this.u||this.j?pte(this):this.bb())},n.bb=function(){pte(this)},n.isActive=function(){return!!this.g},n.Z=function(){try{return 2=this.R)){var h=2*this.R;this.j.info("BP detection timer enabled: "+h),this.A=ay(f(this.ab,this),h)}},n.ab=function(){this.A&&(this.A=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.M=!0,Qr(10),fC(this),Ete(this))},n.Za=function(){null!=this.C&&(this.C=null,fC(this),LL(this),Qr(19))},n.fb=function(h){h?(this.j.info("Successfully pinged google.com"),Qr(2)):(this.j.info("Failed to ping google.com"),Qr(1))},n.isActive=function(){return!!this.l&&this.l.isActive(this)},(n=Dte.prototype).ua=function(){},n.ta=function(){},n.sa=function(){},n.ra=function(){},n.isActive=function(){return!0},n.Na=function(){},gC.prototype.g=function(h,g){return new Vi(h,g)},m(Vi,Dr),Vi.prototype.m=function(){this.g.l=this.j,this.v&&(this.g.J=!0),this.g.connect(this.l,this.h||void 0)},Vi.prototype.close=function(){FL(this.g)},Vi.prototype.o=function(h){var g=this.g;if("string"==typeof h){var y={};y.__data__=h,h=y}else this.u&&((y={}).__data__=TL(h),h=y);g.i.push(new C$e(g.Ya++,h)),3==g.G&&pC(g)},Vi.prototype.N=function(){this.g.l=null,delete this.j,FL(this.g),delete this.g,Vi.aa.N.call(this)},m(Ate,xL),m(Rte,SL),m(Bf,Dte),Bf.prototype.ua=function(){Kr(this.g,"a")},Bf.prototype.ta=function(h){Kr(this.g,new Ate(h))},Bf.prototype.sa=function(h){Kr(this.g,new Rte)},Bf.prototype.ra=function(){Kr(this.g,"b")},gC.prototype.createWebChannel=gC.prototype.g,Vi.prototype.send=Vi.prototype.o,Vi.prototype.open=Vi.prototype.m,Vi.prototype.close=Vi.prototype.close,p6=$s.createWebChannelTransport=function(){return new gC},f6=$s.getStatEventTarget=function(){return iC()},h6=$s.Event=Pu,m1=$s.Stat={mb:0,pb:1,qb:2,Jb:3,Ob:4,Lb:5,Mb:6,Kb:7,Ib:8,Nb:9,PROXY:10,NOPROXY:11,Gb:12,Cb:13,Db:14,Bb:15,Eb:16,Fb:17,ib:18,hb:19,jb:20},oC.NO_ERROR=0,oC.TIMEOUT=8,oC.HTTP_ERROR=6,BE=$s.ErrorCode=oC,Wee.COMPLETE="complete",d6=$s.EventType=Wee,zee.EventType=oy,oy.OPEN="a",oy.CLOSE="b",oy.ERROR="c",oy.MESSAGE="d",Dr.prototype.listen=Dr.prototype.K,kg=$s.WebChannel=zee,$s.FetchXmlHttpFactory=fy,dn.prototype.listenOnce=dn.prototype.L,dn.prototype.getLastError=dn.prototype.Ka,dn.prototype.getLastErrorCode=dn.prototype.Ba,dn.prototype.getStatus=dn.prototype.Z,dn.prototype.getResponseJson=dn.prototype.Oa,dn.prototype.getResponseText=dn.prototype.oa,dn.prototype.send=dn.prototype.ea,dn.prototype.setWithCredentials=dn.prototype.Ha,u6=$s.XhrIo=dn}).apply(typeof VE<"u"?VE:typeof self<"u"?self:typeof window<"u"?window:{});const m6="@firebase/firestore";class Qn{constructor(e){this.uid=e}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}Qn.UNAUTHENTICATED=new Qn(null),Qn.GOOGLE_CREDENTIALS=new Qn("google-credentials-uid"),Qn.FIRST_PARTY=new Qn("first-party-uid"),Qn.MOCK_USER=new Qn("mock-user");let Eh="11.3.1";const nl=new sE("@firebase/firestore");function Ih(){return nl.logLevel}function z(n,...e){if(nl.logLevel<=qe.DEBUG){const t=e.map(g1);nl.debug(`Firestore (${Eh}): ${n}`,...t)}}function vn(n,...e){if(nl.logLevel<=qe.ERROR){const t=e.map(g1);nl.error(`Firestore (${Eh}): ${n}`,...t)}}function eo(n,...e){if(nl.logLevel<=qe.WARN){const t=e.map(g1);nl.warn(`Firestore (${Eh}): ${n}`,...t)}}function g1(n){if("string"==typeof n)return n;try{return JSON.stringify(n)}catch{return n}}function ne(n="Unexpected state"){const e=`FIRESTORE (${Eh}) INTERNAL ASSERTION FAILED: `+n;throw vn(e),new Error(e)}function se(n,e){n||ne()}function Z(n,e){return n}const F={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class j extends Wo{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}class Yn{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}class _6{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class RAe{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable(()=>t(Qn.UNAUTHENTICATED))}shutdown(){}}class MAe{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable(()=>t(this.token.user))}shutdown(){this.changeListener=null}}class kAe{constructor(e){this.t=e,this.currentUser=Qn.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){var r=this;se(void 0===this.o);let i=this.i;const o=c=>this.i!==i?(i=this.i,t(c)):Promise.resolve();let s=new Yn;this.o=()=>{this.i++,this.currentUser=this.u(),s.resolve(),s=new Yn,e.enqueueRetryable(()=>o(this.currentUser))};const a=()=>{const c=s;e.enqueueRetryable(T(function*(){yield c.promise,yield o(r.currentUser)}))},l=c=>{z("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=c,this.o&&(this.auth.addAuthTokenListener(this.o),a())};this.t.onInit(c=>l(c)),setTimeout(()=>{if(!this.auth){const c=this.t.getImmediate({optional:!0});c?l(c):(z("FirebaseAuthCredentialsProvider","Auth not yet detected"),s.resolve(),s=new Yn)}},0),a()}getToken(){const e=this.i,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then(r=>this.i!==e?(z("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):r?(se("string"==typeof r.accessToken),new _6(r.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){const e=this.auth&&this.auth.getUid();return se(null===e||"string"==typeof e),new Qn(e)}}class NAe{constructor(e,t,r){this.l=e,this.h=t,this.P=r,this.type="FirstParty",this.user=Qn.FIRST_PARTY,this.T=new Map}I(){return this.P?this.P():null}get headers(){this.T.set("X-Goog-AuthUser",this.l);const e=this.I();return e&&this.T.set("Authorization",e),this.h&&this.T.set("X-Goog-Iam-Authorization-Token",this.h),this.T}}class PAe{constructor(e,t,r){this.l=e,this.h=t,this.P=r}getToken(){return Promise.resolve(new NAe(this.l,this.h,this.P))}start(e,t){e.enqueueRetryable(()=>t(Qn.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class _1{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class OAe{constructor(e,t){this.A=t,this.forceRefresh=!1,this.appCheck=null,this.R=null,this.V=null,ai(e)&&e.settings.appCheckToken&&(this.V=e.settings.appCheckToken)}start(e,t){se(void 0===this.o);const r=o=>{null!=o.error&&z("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${o.error.message}`);const s=o.token!==this.R;return this.R=o.token,z("FirebaseAppCheckTokenProvider",`Received ${s?"new":"existing"} token.`),s?t(o.token):Promise.resolve()};this.o=o=>{e.enqueueRetryable(()=>r(o))};const i=o=>{z("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=o,this.o&&this.appCheck.addTokenListener(this.o)};this.A.onInit(o=>i(o)),setTimeout(()=>{if(!this.appCheck){const o=this.A.getImmediate({optional:!0});o?i(o):z("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.V)return Promise.resolve(new _1(this.V));const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(t=>t?(se("string"==typeof t.token),this.R=t.token,new _1(t.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}function FAe(n){const e=typeof self<"u"&&(self.crypto||self.msCrypto),t=new Uint8Array(n);if(e&&"function"==typeof e.getRandomValues)e.getRandomValues(t);else for(let r=0;re?1:0}function Th(n,e,t){return n.length===e.length&&n.every((r,i)=>t(r,e[i]))}function v6(n){return n+"\0"}const b6=-62135596800;class Yt{static now(){return Yt.fromMillis(Date.now())}static fromDate(e){return Yt.fromMillis(e.getTime())}static fromMillis(e){const t=Math.floor(e/1e3),r=Math.floor(1e6*(e-1e3*t));return new Yt(t,r)}constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new j(F.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new j(F.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e=253402300800)throw new j(F.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(e){return this.seconds===e.seconds?Ee(this.nanoseconds,e.nanoseconds):Ee(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){return String(this.seconds-b6).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}class le{static fromTimestamp(e){return new le(e)}static min(){return new le(new Yt(0,0))}static max(){return new le(new Yt(253402300799,999999999))}constructor(e){this.timestamp=e}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}const y1="__name__";class Qo{constructor(e,t,r){void 0===t?t=0:t>e.length&&ne(),void 0===r?r=e.length-t:r>e.length-t&&ne(),this.segments=e,this.offset=t,this.len=r}get length(){return this.len}isEqual(e){return 0===Qo.comparator(this,e)}child(e){const t=this.segments.slice(this.offset,this.limit());return e instanceof Qo?e.forEach(r=>{t.push(r)}):t.push(e),this.construct(t)}limit(){return this.offset+this.length}popFirst(e){return this.construct(this.segments,this.offset+(e=void 0===e?1:e),this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return 0===this.length}isPrefixOf(e){if(e.lengtht?1:0}static isNumericId(e){return e.startsWith("__id")&&e.endsWith("__")}static extractNumericId(e){return tl.fromString(e.substring(4,e.length-2))}}class We extends Qo{construct(e,t,r){return new We(e,t,r)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){const t=[];for(const r of e){if(r.indexOf("//")>=0)throw new j(F.INVALID_ARGUMENT,`Invalid segment (${r}). Paths must not contain // in them.`);t.push(...r.split("/").filter(i=>i.length>0))}return new We(t)}static emptyPath(){return new We([])}}const LAe=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class $t extends Qo{construct(e,t,r){return new $t(e,t,r)}static isValidIdentifier(e){return LAe.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),$t.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&this.get(0)===y1}static keyField(){return new $t([y1])}static fromServerFormat(e){const t=[];let r="",i=0;const o=()=>{if(0===r.length)throw new j(F.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);t.push(r),r=""};let s=!1;for(;i=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return null!==e&&0===We.comparator(this.path,e.path)}toString(){return this.path.toString()}static comparator(e,t){return We.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new te(new We(e.slice()))}}class xh{constructor(e,t,r,i){this.indexId=e,this.collectionGroup=t,this.fields=r,this.indexState=i}}function v1(n){return n.fields.find(e=>2===e.kind)}function jc(n){return n.fields.filter(e=>2!==e.kind)}xh.UNKNOWN_ID=-1;class Hc{constructor(e,t){this.fieldPath=e,this.kind=t}}class Sh{constructor(e,t){this.sequenceNumber=e,this.offset=t}static empty(){return new Sh(0,Mi.min())}}function I6(n){return new Mi(n.readTime,n.key,-1)}class Mi{constructor(e,t,r){this.readTime=e,this.documentKey=t,this.largestBatchId=r}static min(){return new Mi(le.min(),te.empty(),-1)}static max(){return new Mi(le.max(),te.empty(),-1)}}function b1(n,e){let t=n.readTime.compareTo(e.readTime);return 0!==t?t:(t=te.comparator(n.documentKey,e.documentKey),0!==t?t:Ee(n.largestBatchId,e.largestBatchId))}const T6="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class C6{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}function rl(n){return w1.apply(this,arguments)}function w1(){return(w1=T(function*(n){if(n.code!==F.FAILED_PRECONDITION||n.message!==T6)throw n;z("LocalStore","Unexpectedly lost primary lease")})).apply(this,arguments)}class N{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(t=>{this.isDone=!0,this.result=t,this.nextCallback&&this.nextCallback(t)},t=>{this.isDone=!0,this.error=t,this.catchCallback&&this.catchCallback(t)})}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&ne(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new N((r,i)=>{this.nextCallback=o=>{this.wrapSuccess(e,o).next(r,i)},this.catchCallback=o=>{this.wrapFailure(t,o).next(r,i)}})}toPromise(){return new Promise((e,t)=>{this.next(e,t)})}wrapUserFunction(e){try{const t=e();return t instanceof N?t:N.resolve(t)}catch(t){return N.reject(t)}}wrapSuccess(e,t){return e?this.wrapUserFunction(()=>e(t)):N.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction(()=>e(t)):N.reject(t)}static resolve(e){return new N((t,r)=>{t(e)})}static reject(e){return new N((t,r)=>{r(e)})}static waitFor(e){return new N((t,r)=>{let i=0,o=0,s=!1;e.forEach(a=>{++i,a.next(()=>{++o,s&&o===i&&t()},l=>r(l))}),s=!0,o===i&&t()})}static or(e){let t=N.resolve(!1);for(const r of e)t=t.next(i=>i?N.resolve(i):r());return t}static forEach(e,t){const r=[];return e.forEach((i,o)=>{r.push(t.call(this,i,o))}),this.waitFor(r)}static mapArray(e,t){return new N((r,i)=>{const o=e.length,s=new Array(o);let a=0;for(let l=0;l{s[c]=u,++a,a===o&&r(s)},u=>i(u))}})}static doWhile(e,t){return new N((r,i)=>{const o=()=>{!0===e()?t().next(()=>{o()},i):r()};o()})}}const ki="SimpleDb";class UE{static open(e,t,r,i){try{return new UE(t,e.transaction(i,r))}catch(o){throw new Ng(t,o)}}constructor(e,t){this.action=e,this.transaction=t,this.aborted=!1,this.m=new Yn,this.transaction.oncomplete=()=>{this.m.resolve()},this.transaction.onabort=()=>{t.error?this.m.reject(new Ng(e,t.error)):this.m.resolve()},this.transaction.onerror=r=>{const i=E1(r.target.error);this.m.reject(new Ng(e,i))}}get p(){return this.m.promise}abort(e){e&&this.m.reject(e),this.aborted||(z(ki,"Aborting transaction:",e?e.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())}S(){const e=this.transaction;this.aborted||"function"!=typeof e.commit||e.commit()}store(e){const t=this.transaction.objectStore(e);return new zAe(t)}}class Yo{static delete(e){return z(ki,"Removing database:",e),$c(window.indexedDB.deleteDatabase(e)).toPromise()}static D(){if(!_R())return!1;if(Yo.v())return!0;const e=_n(),t=Yo.C(e),r=00||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||r||o)}static v(){var e;return typeof process<"u"&&"YES"===(null===(e=process.__PRIVATE_env)||void 0===e?void 0:e.F)}static M(e,t){return e.store(t)}static C(e){const t=e.match(/i(?:phone|pad|pod) os ([\d_]+)/i),r=t?t[1].split("_").slice(0,2).join("."):"-1";return Number(r)}constructor(e,t,r){this.name=e,this.version=t,this.O=r,12.2===Yo.C(_n())&&vn("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}N(e){var t=this;return T(function*(){return t.db||(z(ki,"Opening database:",t.name),t.db=yield new Promise((r,i)=>{const o=indexedDB.open(t.name,t.version);o.onsuccess=s=>{r(s.target.result)},o.onblocked=()=>{i(new Ng(e,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},o.onerror=s=>{const a=s.target.error;i("VersionError"===a.name?new j(F.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh."):"InvalidStateError"===a.name?new j(F.FAILED_PRECONDITION,"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: "+a):new Ng(e,a))},o.onupgradeneeded=s=>{z(ki,'Database "'+t.name+'" requires upgrade from version:',s.oldVersion),t.O.B(s.target.result,o.transaction,s.oldVersion,t.version).next(()=>{z(ki,"Database upgrade to version "+t.version+" complete")})}})),t.L&&(t.db.onversionchange=r=>t.L(r)),t.db})()}k(e){this.L=e,this.db&&(this.db.onversionchange=t=>e(t))}runTransaction(e,t,r,i){var o=this;return T(function*(){const s="readonly"===t;let a=0;for(;;){++a;try{o.db=yield o.N(e);const l=UE.open(o.db,e,s?"readonly":"readwrite",r),c=i(l).next(u=>(l.S(),u)).catch(u=>(l.abort(u),N.reject(u))).toPromise();return c.catch(()=>{}),yield l.p,c}catch(l){const c=l,u="FirebaseError"!==c.name&&a<3;if(z(ki,"Transaction failed with error:",c.message,"Retrying:",u),o.close(),!u)return Promise.reject(c)}}})()}close(){this.db&&this.db.close(),this.db=void 0}}function x6(n){const e=n.match(/Android ([\d.]+)/i),t=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(t)}class UAe{constructor(e){this.q=e,this.$=!1,this.K=null}get isDone(){return this.$}get U(){return this.K}set cursor(e){this.q=e}done(){this.$=!0}W(e){this.K=e}delete(){return $c(this.q.delete())}}class Ng extends j{constructor(e,t){super(F.UNAVAILABLE,`IndexedDB transaction '${e}' failed: ${t}`),this.name="IndexedDbTransactionError"}}function il(n){return"IndexedDbTransactionError"===n.name}class zAe{constructor(e){this.store=e}put(e,t){let r;return void 0!==t?(z(ki,"PUT",this.store.name,e,t),r=this.store.put(t,e)):(z(ki,"PUT",this.store.name,"",e),r=this.store.put(e)),$c(r)}add(e){return z(ki,"ADD",this.store.name,e,e),$c(this.store.add(e))}get(e){return $c(this.store.get(e)).next(t=>(void 0===t&&(t=null),z(ki,"GET",this.store.name,e,t),t))}delete(e){return z(ki,"DELETE",this.store.name,e),$c(this.store.delete(e))}count(){return z(ki,"COUNT",this.store.name),$c(this.store.count())}G(e,t){const r=this.options(e,t),i=r.index?this.store.index(r.index):this.store;if("function"==typeof i.getAll){const o=i.getAll(r.range);return new N((s,a)=>{o.onerror=l=>{a(l.target.error)},o.onsuccess=l=>{s(l.target.result)}})}{const o=this.cursor(r),s=[];return this.j(o,(a,l)=>{s.push(l)}).next(()=>s)}}H(e,t){const r=this.store.getAll(e,null===t?void 0:t);return new N((i,o)=>{r.onerror=s=>{o(s.target.error)},r.onsuccess=s=>{i(s.target.result)}})}J(e,t){z(ki,"DELETE ALL",this.store.name);const r=this.options(e,t);r.Y=!1;const i=this.cursor(r);return this.j(i,(o,s,a)=>a.delete())}Z(e,t){let r;t?r=e:(r={},t=e);const i=this.cursor(r);return this.j(i,t)}X(e){const t=this.cursor({});return new N((r,i)=>{t.onerror=o=>{const s=E1(o.target.error);i(s)},t.onsuccess=o=>{const s=o.target.result;s?e(s.primaryKey,s.value).next(a=>{a?s.continue():r()}):r()}})}j(e,t){const r=[];return new N((i,o)=>{e.onerror=s=>{o(s.target.error)},e.onsuccess=s=>{const a=s.target.result;if(!a)return void i();const l=new UAe(a),c=t(a.primaryKey,a.value,l);if(c instanceof N){const u=c.catch(d=>(l.done(),N.reject(d)));r.push(u)}l.isDone?i():null===l.U?a.continue():a.continue(l.U)}}).next(()=>N.waitFor(r))}options(e,t){let r;return void 0!==e&&("string"==typeof e?r=e:t=e),{index:r,range:t}}cursor(e){let t="next";if(e.reverse&&(t="prev"),e.index){const r=this.store.index(e.index);return e.Y?r.openKeyCursor(e.range,t):r.openCursor(e.range,t)}return this.store.openCursor(e.range,t)}}function $c(n){return new N((e,t)=>{n.onsuccess=r=>{e(r.target.result)},n.onerror=r=>{const i=E1(r.target.error);t(i)}})}let S6=!1;function E1(n){const e=Yo.C(_n());if(e>=12.2&&e<13){const t="An internal error was encountered in the Indexed Database server";if(n.message.indexOf(t)>=0){const r=new j("internal",`IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${t}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);return S6||(S6=!0,setTimeout(()=>{throw r},0)),r}}return n}const Pg="IndexBackfiller";class jAe{constructor(e,t){this.asyncQueue=e,this.ee=t,this.task=null}start(){this.te(15e3)}stop(){this.task&&(this.task.cancel(),this.task=null)}get started(){return null!==this.task}te(e){var t=this;z(Pg,`Scheduled in ${e}ms`),this.task=this.asyncQueue.enqueueAfterDelay("index_backfill",e,T(function*(){t.task=null;try{const r=yield t.ee.ne();z(Pg,`Documents written: ${r}`)}catch(r){il(r)?z(Pg,"Ignoring IndexedDB error during index backfill: ",r):yield rl(r)}yield t.te(6e4)}))}}class HAe{constructor(e,t){this.localStore=e,this.persistence=t}ne(e=50){var t=this;return T(function*(){return t.persistence.runTransaction("Backfill Indexes","readwrite-primary",r=>t.re(r,e))})()}re(e,t){const r=new Set;let i=t,o=!0;return N.doWhile(()=>!0===o&&i>0,()=>this.localStore.indexManager.getNextCollectionGroupToUpdate(e).next(s=>{if(null!==s&&!r.has(s))return z(Pg,`Processing collection: ${s}`),this.ie(e,s,i).next(a=>{i-=a,r.add(s)});o=!1})).next(()=>t-i)}ie(e,t,r){return this.localStore.indexManager.getMinOffsetFromCollectionGroup(e,t).next(i=>this.localStore.localDocuments.getNextDocuments(e,t,i,r).next(o=>{const s=o.changes;return this.localStore.indexManager.updateIndexEntries(e,s).next(()=>this.se(i,o)).next(a=>(z(Pg,`Updating offset: ${a}`),this.localStore.indexManager.updateCollectionGroup(e,t,a))).next(()=>s.size)}))}se(e,t){let r=e;return t.changes.forEach((i,o)=>{const s=I6(o);b1(s,r)>0&&(r=s)}),new Mi(r.readTime,r.documentKey,Math.max(t.batchId,e.largestBatchId))}}let Ni=(()=>{class n{constructor(t,r){this.previousValue=t,r&&(r.sequenceNumberHandler=i=>this.oe(i),this._e=i=>r.writeSequenceNumber(i))}oe(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue}next(){const t=++this.previousValue;return this._e&&this._e(t),t}}return n.ae=-1,n})();function Og(n){return null==n}function Fg(n){return 0===n&&1/n==-1/0}function vr(n){let e="";for(let t=0;t0&&(e=A6(e)),e=$Ae(n.get(t),e);return A6(e)}function $Ae(n,e){let t=e;const r=n.length;for(let i=0;i=2),2===e)return se("\x01"===n.charAt(0)&&"\x01"===n.charAt(1)),We.emptyPath();const t=e-2,r=[];let i="";for(let o=0;ot)&&ne(),n.charAt(s+1)){case"\x01":const a=n.substring(o,s);let l;0===i.length?l=a:(i+=a,l=i,i=""),r.push(l);break;case"\x10":i+=n.substring(o,s),i+="\0";break;case"\x11":i+=n.substring(o,s+1);break;default:ne()}o=s+2}return new We(r)}const qc="remoteDocuments",Lg="owner",Dh="owner",Vg="mutationQueues",wo="mutations",R6="batchId",Wc="userMutationsIndex",M6=["userId","batchId"];function jE(n,e){return[n,vr(e)]}function k6(n,e,t){return[n,vr(e),t]}const WAe={},Ah="documentMutations",HE="remoteDocumentsV14",GAe=["prefixPath","collectionGroup","readTime","documentId"],$E="documentKeyIndex",KAe=["prefixPath","collectionGroup","documentId"],N6="collectionGroupIndex",QAe=["collectionGroup","readTime","prefixPath","documentId"],Bg="remoteDocumentGlobal",I1="remoteDocumentGlobalKey",Rh="targets",P6="queryTargetsIndex",YAe=["canonicalId","targetId"],Mh="targetDocuments",XAe=["targetId","path"],T1="documentTargetsIndex",ZAe=["path","targetId"],qE="targetGlobalKey",Gc="targetGlobal",Ug="collectionParents",JAe=["collectionId","parent"],kh="clientMetadata",WE="bundles",GE="namedQueries",C1="indexConfiguration",x1="collectionGroupIndex",KE="indexState",oRe=["indexId","uid"],O6="sequenceNumberIndex",sRe=["uid","sequenceNumber"],QE="indexEntries",aRe=["indexId","uid","arrayValue","directionalValue","orderedDocumentKey","documentKey"],F6="documentKeyIndex",lRe=["indexId","uid","orderedDocumentKey"],YE="documentOverlays",cRe=["userId","collectionPath","documentId"],S1="collectionPathOverlayIndex",uRe=["userId","collectionPath","largestBatchId"],L6="collectionGroupOverlayIndex",dRe=["userId","collectionGroup","largestBatchId"],D1="globals",V6=[Vg,wo,Ah,qc,Rh,Lg,Gc,Mh,kh,Bg,Ug,WE,GE],fRe=[...V6,YE],B6=[Vg,wo,Ah,HE,Rh,Lg,Gc,Mh,kh,Bg,Ug,WE,GE,YE],U6=B6,A1=[...U6,C1,KE,QE],pRe=A1,mRe=[...A1,D1];class R1 extends C6{constructor(e,t){super(),this.ue=e,this.currentSequenceNumber=t}}function Un(n,e){const t=Z(n);return Yo.M(t.ue,e)}function z6(n){let e=0;for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&e++;return e}function sl(n,e){for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&e(t,n[t])}function H6(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}class Rt{constructor(e,t){this.comparator=e,this.root=t||sr.EMPTY}insert(e,t){return new Rt(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,sr.BLACK,null,null))}remove(e){return new Rt(this.comparator,this.root.remove(e,this.comparator).copy(null,null,sr.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){const r=this.comparator(e,t.key);if(0===r)return t.value;r<0?t=t.left:r>0&&(t=t.right)}return null}indexOf(e){let t=0,r=this.root;for(;!r.isEmpty();){const i=this.comparator(e,r.key);if(0===i)return t+r.left.size;i<0?r=r.left:(t+=r.left.size+1,r=r.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((t,r)=>(e(t,r),!1))}toString(){const e=[];return this.inorderTraversal((t,r)=>(e.push(`${t}:${r}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new XE(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new XE(this.root,e,this.comparator,!1)}getReverseIterator(){return new XE(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new XE(this.root,e,this.comparator,!0)}}class XE{constructor(e,t,r,i){this.isReverse=i,this.nodeStack=[];let o=1;for(;!e.isEmpty();)if(o=t?r(e.key,t):1,t&&i&&(o*=-1),o<0)e=this.isReverse?e.left:e.right;else{if(0===o){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class sr{constructor(e,t,r,i,o){this.key=e,this.value=t,this.color=r??sr.RED,this.left=i??sr.EMPTY,this.right=o??sr.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,r,i,o){return new sr(e??this.key,t??this.value,r??this.color,i??this.left,o??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,r){let i=this;const o=r(e,i.key);return i=o<0?i.copy(null,null,null,i.left.insert(e,t,r),null):0===o?i.copy(null,t,null,null,null):i.copy(null,null,null,null,i.right.insert(e,t,r)),i.fixUp()}removeMin(){if(this.left.isEmpty())return sr.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,t){let r,i=this;if(t(e,i.key)<0)i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(e,t),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),0===t(e,i.key)){if(i.right.isEmpty())return sr.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(e,t))}return i.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,sr.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,sr.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed()||this.right.isRed())throw ne();const e=this.left.check();if(e!==this.right.check())throw ne();return e+(this.isRed()?0:1)}}sr.EMPTY=null,sr.RED=!0,sr.BLACK=!1,sr.EMPTY=new class{constructor(){this.size=0}get key(){throw ne()}get value(){throw ne()}get color(){throw ne()}get left(){throw ne()}get right(){throw ne()}copy(e,t,r,i,o){return this}insert(e,t,r){return new sr(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};class dt{constructor(e){this.comparator=e,this.data=new Rt(this.comparator)}has(e){return null!==this.data.get(e)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((t,r)=>(e(t),!1))}forEachInRange(e,t){const r=this.data.getIteratorFrom(e[0]);for(;r.hasNext();){const i=r.getNext();if(this.comparator(i.key,e[1])>=0)return;t(i.key)}}forEachWhile(e,t){let r;for(r=void 0!==t?this.data.getIteratorFrom(t):this.data.getIterator();r.hasNext();)if(!e(r.getNext().key))return}firstAfterOrEqual(e){const t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new $6(this.data.getIterator())}getIteratorFrom(e){return new $6(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let t=this;return t.size{t=t.add(r)}),t}isEqual(e){if(!(e instanceof dt)||this.size!==e.size)return!1;const t=this.data.getIterator(),r=e.data.getIterator();for(;t.hasNext();){const i=t.getNext().key,o=r.getNext().key;if(0!==this.comparator(i,o))return!1}return!0}toArray(){const e=[];return this.forEach(t=>{e.push(t)}),e}toString(){const e=[];return this.forEach(t=>e.push(t)),"SortedSet("+e.toString()+")"}copy(e){const t=new dt(this.comparator);return t.data=e,t}}class $6{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}function Nh(n){return n.hasNext()?n.getNext():void 0}class ci{constructor(e){this.fields=e,e.sort($t.comparator)}static empty(){return new ci([])}unionWith(e){let t=new dt($t.comparator);for(const r of this.fields)t=t.add(r);for(const r of e)t=t.add(r);return new ci(t.toArray())}covers(e){for(const t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return Th(this.fields,e.fields,(t,r)=>t.isEqual(r))}}class q6 extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}class ln{constructor(e){this.binaryString=e}static fromBase64String(e){const t=function(i){try{return atob(i)}catch(o){throw typeof DOMException<"u"&&o instanceof DOMException?new q6("Invalid base64 string: "+o):o}}(e);return new ln(t)}static fromUint8Array(e){const t=function(i){let o="";for(let s=0;seZo(t,e))}function cl(n,e){if(n===e)return 0;const t=ll(n),r=ll(e);if(t!==r)return Ee(t,r);switch(t){case 0:case 9007199254740991:return 0;case 1:return Ee(n.booleanValue,e.booleanValue);case 2:return function(o,s){const a=qt(o.integerValue||o.doubleValue),l=qt(s.integerValue||s.doubleValue);return al?1:a===l?0:isNaN(a)?isNaN(l)?0:-1:1}(n,e);case 3:return X6(n.timestampValue,e.timestampValue);case 4:return X6(zg(n),zg(e));case 5:return Ee(n.stringValue,e.stringValue);case 6:return function(o,s){const a=Ws(o),l=Ws(s);return a.compareTo(l)}(n.bytesValue,e.bytesValue);case 7:return function(o,s){const a=o.split("/"),l=s.split("/");for(let c=0;ci+tI(o),0);case 10:case 11:return function(r){let i=0;return sl(r.fields,(o,s)=>{i+=o.length+tI(s)}),i}(n.mapValue);default:throw ne()}}function Qc(n,e){return{referenceValue:`projects/${n.projectId}/databases/${n.database}/documents/${e.path.canonicalString()}`}}function P1(n){return!!n&&"integerValue"in n}function $g(n){return!!n&&"arrayValue"in n}function J6(n){return!!n&&"nullValue"in n}function e9(n){return!!n&&"doubleValue"in n&&isNaN(Number(n.doubleValue))}function nI(n){return!!n&&"mapValue"in n}function rI(n){var e,t;return(null===(t=((null===(e=n?.mapValue)||void 0===e?void 0:e.fields)||{})[M1])||void 0===t?void 0:t.stringValue)===k1}function qg(n){if(n.geoPointValue)return{geoPointValue:Object.assign({},n.geoPointValue)};if(n.timestampValue&&"object"==typeof n.timestampValue)return{timestampValue:Object.assign({},n.timestampValue)};if(n.mapValue){const e={mapValue:{fields:{}}};return sl(n.mapValue.fields,(t,r)=>e.mapValue.fields[t]=qg(r)),e}if(n.arrayValue){const e={arrayValue:{values:[]}};for(let t=0;t<(n.arrayValue.values||[]).length;++t)e.arrayValue.values[t]=qg(n.arrayValue.values[t]);return e}return Object.assign({},n)}function t9(n){return(((n.mapValue||{}).fields||{}).__type__||{}).stringValue===Y6}const n9={mapValue:{fields:{[M1]:{stringValue:k1},[Ph]:{arrayValue:{}}}}};function yRe(n){return"nullValue"in n?eI:"booleanValue"in n?{booleanValue:!1}:"integerValue"in n||"doubleValue"in n?{doubleValue:NaN}:"timestampValue"in n?{timestampValue:{seconds:Number.MIN_SAFE_INTEGER}}:"stringValue"in n?{stringValue:""}:"bytesValue"in n?{bytesValue:""}:"referenceValue"in n?Qc(Kc.empty(),te.empty()):"geoPointValue"in n?{geoPointValue:{latitude:-90,longitude:-180}}:"arrayValue"in n?{arrayValue:{}}:"mapValue"in n?rI(n)?n9:{mapValue:{}}:ne()}function vRe(n){return"nullValue"in n?{booleanValue:!1}:"booleanValue"in n?{doubleValue:NaN}:"integerValue"in n||"doubleValue"in n?{timestampValue:{seconds:Number.MIN_SAFE_INTEGER}}:"timestampValue"in n?{stringValue:""}:"stringValue"in n?{bytesValue:""}:"bytesValue"in n?Qc(Kc.empty(),te.empty()):"referenceValue"in n?{geoPointValue:{latitude:-90,longitude:-180}}:"geoPointValue"in n?{arrayValue:{}}:"arrayValue"in n?n9:"mapValue"in n?rI(n)?{mapValue:{}}:al:ne()}function r9(n,e){const t=cl(n.value,e.value);return 0!==t?t:n.inclusive&&!e.inclusive?-1:!n.inclusive&&e.inclusive?1:0}function i9(n,e){const t=cl(n.value,e.value);return 0!==t?t:n.inclusive&&!e.inclusive?1:!n.inclusive&&e.inclusive?-1:0}class ar{constructor(e){this.value=e}static empty(){return new ar({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let r=0;r{if(!t.isImmediateParentOf(a)){const l=this.getFieldsMap(t);this.applyChanges(l,r,i),r={},i=[],t=a.popLast()}s?r[a.lastSegment()]=qg(s):i.push(a.lastSegment())});const o=this.getFieldsMap(t);this.applyChanges(o,r,i)}delete(e){const t=this.field(e.popLast());nI(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return Zo(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let r=0;re[i]=o);for(const i of r)delete e[i]}clone(){return new ar(qg(this.value))}}function o9(n){const e=[];return sl(n.fields,(t,r)=>{const i=new $t([t]);if(nI(r)){const o=o9(r.mapValue).fields;if(0===o.length)e.push(i);else for(const s of o)e.push(i.child(s))}else e.push(i)}),new ci(e)}class Lt{constructor(e,t,r,i,o,s,a){this.key=e,this.documentType=t,this.version=r,this.readTime=i,this.createTime=o,this.data=s,this.documentState=a}static newInvalidDocument(e){return new Lt(e,0,le.min(),le.min(),le.min(),ar.empty(),0)}static newFoundDocument(e,t,r,i){return new Lt(e,1,t,le.min(),r,i,0)}static newNoDocument(e,t){return new Lt(e,2,t,le.min(),le.min(),ar.empty(),0)}static newUnknownDocument(e,t){return new Lt(e,3,t,le.min(),le.min(),ar.empty(),2)}convertToFoundDocument(e,t){return!this.createTime.isEqual(le.min())||2!==this.documentType&&0!==this.documentType||(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=ar.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=ar.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=le.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return 1===this.documentState}get hasCommittedMutations(){return 2===this.documentState}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return 0!==this.documentType}isFoundDocument(){return 1===this.documentType}isNoDocument(){return 2===this.documentType}isUnknownDocument(){return 3===this.documentType}isEqual(e){return e instanceof Lt&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new Lt(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}class ul{constructor(e,t){this.position=e,this.inclusive=t}}function s9(n,e,t){let r=0;for(let i=0;i":return e>0;case">=":return e>=0;default:return ne()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class ht extends l9{constructor(e,t){super(),this.filters=e,this.op=t,this.ce=null}static create(e,t){return new ht(e,t)}matches(e){return Fh(this)?void 0===this.filters.find(t=>!t.matches(e)):void 0!==this.filters.find(t=>t.matches(e))}getFlattenedFilters(){return null!==this.ce||(this.ce=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.ce}getFilters(){return Object.assign([],this.filters)}}function Fh(n){return"and"===n.op}function O1(n){return"or"===n.op}function F1(n){return c9(n)&&Fh(n)}function c9(n){for(const e of n.filters)if(e instanceof ht)return!1;return!0}function L1(n){if(n instanceof Ge)return n.field.canonicalString()+n.op.toString()+Oh(n.value);if(F1(n))return n.filters.map(e=>L1(e)).join(",");{const e=n.filters.map(t=>L1(t)).join(",");return`${n.op}(${e})`}}function u9(n,e){return n instanceof Ge?(r=n,(i=e)instanceof Ge&&r.op===i.op&&r.field.isEqual(i.field)&&Zo(r.value,i.value)):n instanceof ht?function(r,i){return i instanceof ht&&r.op===i.op&&r.filters.length===i.filters.length&&r.filters.reduce((o,s,a)=>o&&u9(s,i.filters[a]),!0)}(n,e):void ne();var r,i}function d9(n,e){const t=n.filters.concat(e);return ht.create(t,n.op)}function h9(n){return n instanceof Ge?`${(t=n).field.canonicalString()} ${t.op} ${Oh(t.value)}`:n instanceof ht?function(t){return t.op.toString()+" {"+t.getFilters().map(h9).join(" ,")+"}"}(n):"Filter";var t}class wRe extends Ge{constructor(e,t,r){super(e,t,r),this.key=te.fromName(r.referenceValue)}matches(e){const t=te.comparator(e.key,this.key);return this.matchesComparison(t)}}class ERe extends Ge{constructor(e,t){super(e,"in",t),this.keys=f9(0,t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}}class IRe extends Ge{constructor(e,t){super(e,"not-in",t),this.keys=f9(0,t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}}function f9(n,e){var t;return((null===(t=e.arrayValue)||void 0===t?void 0:t.values)||[]).map(r=>te.fromName(r.referenceValue))}class TRe extends Ge{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return $g(t)&&Hg(t.arrayValue,this.value)}}class p9 extends Ge{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return null!==t&&Hg(this.value.arrayValue,t)}}class CRe extends Ge{constructor(e,t){super(e,"not-in",t)}matches(e){if(Hg(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return null!==t&&!Hg(this.value.arrayValue,t)}}class xRe extends Ge{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);return!(!$g(t)||!t.arrayValue.values)&&t.arrayValue.values.some(r=>Hg(this.value.arrayValue,r))}}class SRe{constructor(e,t=null,r=[],i=[],o=null,s=null,a=null){this.path=e,this.collectionGroup=t,this.orderBy=r,this.filters=i,this.limit=o,this.startAt=s,this.endAt=a,this.le=null}}function V1(n,e=null,t=[],r=[],i=null,o=null,s=null){return new SRe(n,e,t,r,i,o,s)}function Yc(n){const e=Z(n);if(null===e.le){let t=e.path.canonicalString();null!==e.collectionGroup&&(t+="|cg:"+e.collectionGroup),t+="|f:",t+=e.filters.map(r=>L1(r)).join(","),t+="|ob:",t+=e.orderBy.map(r=>{return(o=r).field.canonicalString()+o.dir;var o}).join(","),Og(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(r=>Oh(r)).join(",")),e.endAt&&(t+="|ub:",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(r=>Oh(r)).join(",")),e.le=t}return e.le}function Gg(n,e){if(n.limit!==e.limit||n.orderBy.length!==e.orderBy.length)return!1;for(let t=0;tt instanceof Ge&&t.field.isEqual(e))}function m9(n,e,t){let r=eI,i=!0;for(const o of oI(n,e)){let s=eI,a=!0;switch(o.op){case"<":case"<=":s=yRe(o.value);break;case"==":case"in":case">=":s=o.value;break;case">":s=o.value,a=!1;break;case"!=":case"not-in":s=eI}r9({value:r,inclusive:i},{value:s,inclusive:a})<0&&(r=s,i=a)}if(null!==t)for(let o=0;o=":case">":s=vRe(o.value),a=!1;break;case"==":case"in":case"<=":s=o.value;break;case"<":s=o.value,a=!1;break;case"!=":case"not-in":s=al}i9({value:r,inclusive:i},{value:s,inclusive:a})>0&&(r=s,i=a)}if(null!==t)for(let o=0;o0&&(r=s,i=t.inclusive);break}return{value:r,inclusive:i}}class Gs{constructor(e,t=null,r=[],i=[],o=null,s="F",a=null,l=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=r,this.filters=i,this.limit=o,this.limitType=s,this.startAt=a,this.endAt=l,this.he=null,this.Pe=null,this.Te=null}}function Lh(n){return new Gs(n)}function y9(n){return 0===n.filters.length&&null===n.limit&&null==n.startAt&&null==n.endAt&&(0===n.explicitOrderBy.length||1===n.explicitOrderBy.length&&n.explicitOrderBy[0].field.isKeyField())}function Vh(n){const e=Z(n);if(null===e.he){e.he=[];const t=new Set;for(const o of e.explicitOrderBy)e.he.push(o),t.add(o.field.canonicalString());const r=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(s){let a=new dt($t.comparator);return s.filters.forEach(l=>{l.getFlattenedFilters().forEach(c=>{c.isInequality()&&(a=a.add(c.field))})}),a})(e).forEach(o=>{t.has(o.canonicalString())||o.isKeyField()||e.he.push(new Wg(o,r))}),t.has($t.keyField().canonicalString())||e.he.push(new Wg($t.keyField(),r))}return e.he}function br(n){const e=Z(n);return e.Pe||(e.Pe=function b9(n,e){if("F"===n.limitType)return V1(n.path,n.collectionGroup,e,n.filters,n.limit,n.startAt,n.endAt);{e=e.map(i=>new Wg(i.field,"desc"===i.dir?"asc":"desc"));const t=n.endAt?new ul(n.endAt.position,n.endAt.inclusive):null,r=n.startAt?new ul(n.startAt.position,n.startAt.inclusive):null;return V1(n.path,n.collectionGroup,e,n.filters,n.limit,t,r)}}(e,Vh(n))),e.Pe}function sI(n,e,t){return new Gs(n.path,n.collectionGroup,n.explicitOrderBy.slice(),n.filters.slice(),e,t,n.startAt,n.endAt)}function Kg(n,e){return Gg(br(n),br(e))&&n.limitType===e.limitType}function w9(n){return`${Yc(br(n))}|lt:${n.limitType}`}function Bh(n){return`Query(target=${function(t){let r=t.path.canonicalString();return null!==t.collectionGroup&&(r+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(r+=`, filters: [${t.filters.map(i=>h9(i)).join(", ")}]`),Og(t.limit)||(r+=", limit: "+t.limit),t.orderBy.length>0&&(r+=`, orderBy: [${t.orderBy.map(i=>{return`${(s=i).field.canonicalString()} (${s.dir})`;var s}).join(", ")}]`),t.startAt&&(r+=", startAt: ",r+=t.startAt.inclusive?"b:":"a:",r+=t.startAt.position.map(i=>Oh(i)).join(",")),t.endAt&&(r+=", endAt: ",r+=t.endAt.inclusive?"a:":"b:",r+=t.endAt.position.map(i=>Oh(i)).join(",")),`Target(${r})`}(br(n))}; limitType=${n.limitType})`}function Qg(n,e){return e.isFoundDocument()&&function(r,i){const o=i.key.path;return null!==r.collectionGroup?i.key.hasCollectionId(r.collectionGroup)&&r.path.isPrefixOf(o):te.isDocumentKey(r.path)?r.path.isEqual(o):r.path.isImmediateParentOf(o)}(n,e)&&function(r,i){for(const o of Vh(r))if(!o.field.isKeyField()&&null===i.data.field(o.field))return!1;return!0}(n,e)&&function(r,i){for(const o of r.filters)if(!o.matches(i))return!1;return!0}(n,e)&&(i=e,!((r=n).startAt&&!function(s,a,l){const c=s9(s,a,l);return s.inclusive?c<=0:c<0}(r.startAt,Vh(r),i)||r.endAt&&!function(s,a,l){const c=s9(s,a,l);return s.inclusive?c>=0:c>0}(r.endAt,Vh(r),i)));var r,i}function I9(n){return(e,t)=>{let r=!1;for(const i of Vh(n)){const o=DRe(i,e,t);if(0!==o)return o;r=r||i.field.isKeyField()}return 0}}function DRe(n,e,t){const r=n.field.isKeyField()?te.comparator(e.key,t.key):function(o,s,a){const l=s.data.field(o),c=a.data.field(o);return null!==l&&null!==c?cl(l,c):ne()}(n.field,e,t);switch(n.dir){case"asc":return r;case"desc":return-1*r;default:return ne()}}class Ks{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){const t=this.mapKeyFn(e),r=this.inner[t];if(void 0!==r)for(const[i,o]of r)if(this.equalsFn(i,e))return o}has(e){return void 0!==this.get(e)}set(e,t){const r=this.mapKeyFn(e),i=this.inner[r];if(void 0===i)return this.inner[r]=[[e,t]],void this.innerSize++;for(let o=0;o{for(const[i,o]of r)e(i,o)})}isEmpty(){return H6(this.inner)}size(){return this.innerSize}}const ARe=new Rt(te.comparator);function ui(){return ARe}const T9=new Rt(te.comparator);function Yg(...n){let e=T9;for(const t of n)e=e.insert(t.key,t);return e}function C9(n){let e=T9;return n.forEach((t,r)=>e=e.insert(t,r.overlayedDocument)),e}function Jo(){return Xg()}function x9(){return Xg()}function Xg(){return new Ks(n=>n.toString(),(n,e)=>n.isEqual(e))}const RRe=new Rt(te.comparator),MRe=new dt(te.comparator);function Re(...n){let e=MRe;for(const t of n)e=e.add(t);return e}const kRe=new dt(Ee);function j1(n,e){if(n.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Fg(e)?"-0":e}}function S9(n){return{integerValue:""+n}}function D9(n,e){return function D6(n){return"number"==typeof n&&Number.isInteger(n)&&!Fg(n)&&n<=Number.MAX_SAFE_INTEGER&&n>=Number.MIN_SAFE_INTEGER}(e)?S9(e):j1(n,e)}class aI{constructor(){this._=void 0}}function NRe(n,e,t){return n instanceof Uh?function(i,o){const s={fields:{[G6]:{stringValue:W6},[Q6]:{timestampValue:{seconds:i.seconds,nanos:i.nanoseconds}}}};return o&&ZE(o)&&(o=JE(o)),o&&(s.fields[K6]=o),{mapValue:s}}(t,e):n instanceof Xc?R9(n,e):n instanceof Zc?M9(n,e):function(i,o){const s=A9(i,o),a=k9(s)+k9(i.Ie);return P1(s)&&P1(i.Ie)?S9(a):j1(i.serializer,a)}(n,e)}function PRe(n,e,t){return n instanceof Xc?R9(n,e):n instanceof Zc?M9(n,e):t}function A9(n,e){return n instanceof zh?P1(r=e)||(o=r)&&"doubleValue"in o?e:{integerValue:0}:null;var r,o}class Uh extends aI{}class Xc extends aI{constructor(e){super(),this.elements=e}}function R9(n,e){const t=N9(e);for(const r of n.elements)t.some(i=>Zo(i,r))||t.push(r);return{arrayValue:{values:t}}}class Zc extends aI{constructor(e){super(),this.elements=e}}function M9(n,e){let t=N9(e);for(const r of n.elements)t=t.filter(i=>!Zo(i,r));return{arrayValue:{values:t}}}class zh extends aI{constructor(e,t){super(),this.serializer=e,this.Ie=t}}function k9(n){return qt(n.integerValue||n.doubleValue)}function N9(n){return $g(n)&&n.arrayValue.values?n.arrayValue.values.slice():[]}class Zg{constructor(e,t){this.field=e,this.transform=t}}class FRe{constructor(e,t){this.version=e,this.transformResults=t}}class Wt{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new Wt}static exists(e){return new Wt(void 0,e)}static updateTime(e){return new Wt(e)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function lI(n,e){return void 0!==n.updateTime?e.isFoundDocument()&&e.version.isEqual(n.updateTime):void 0===n.exists||n.exists===e.isFoundDocument()}class cI{}function P9(n,e){if(!n.hasLocalMutations||e&&0===e.fields.length)return null;if(null===e)return n.isNoDocument()?new Hh(n.key,Wt.none()):new jh(n.key,n.data,Wt.none());{const t=n.data,r=ar.empty();let i=new dt($t.comparator);for(let o of e.fields)if(!i.has(o)){let s=t.field(o);null===s&&o.length>1&&(o=o.popLast(),s=t.field(o)),null===s?r.delete(o):r.set(o,s),i=i.add(o)}return new Qs(n.key,r,new ci(i.toArray()),Wt.none())}}function LRe(n,e,t){n instanceof jh?function(i,o,s){const a=i.value.clone(),l=L9(i.fieldTransforms,o,s.transformResults);a.setAll(l),o.convertToFoundDocument(s.version,a).setHasCommittedMutations()}(n,e,t):n instanceof Qs?function(i,o,s){if(!lI(i.precondition,o))return void o.convertToUnknownDocument(s.version);const a=L9(i.fieldTransforms,o,s.transformResults),l=o.data;l.setAll(F9(i)),l.setAll(a),o.convertToFoundDocument(s.version,l).setHasCommittedMutations()}(n,e,t):e.convertToNoDocument(t.version).setHasCommittedMutations()}function Jg(n,e,t,r){return n instanceof jh?function(o,s,a,l){if(!lI(o.precondition,s))return a;const c=o.value.clone(),u=V9(o.fieldTransforms,l,s);return c.setAll(u),s.convertToFoundDocument(s.version,c).setHasLocalMutations(),null}(n,e,t,r):n instanceof Qs?function(o,s,a,l){if(!lI(o.precondition,s))return a;const c=V9(o.fieldTransforms,l,s),u=s.data;return u.setAll(F9(o)),u.setAll(c),s.convertToFoundDocument(s.version,u).setHasLocalMutations(),null===a?null:a.unionWith(o.fieldMask.fields).unionWith(o.fieldTransforms.map(d=>d.field))}(n,e,t,r):(a=t,lI(n.precondition,s=e)?(s.convertToNoDocument(s.version).setHasLocalMutations(),null):a);var s,a}function VRe(n,e){let t=null;for(const r of n.fieldTransforms){const i=e.data.field(r.field),o=A9(r.transform,i||null);null!=o&&(null===t&&(t=ar.empty()),t.set(r.field,o))}return t||null}function O9(n,e){return n.type===e.type&&!!n.key.isEqual(e.key)&&!!n.precondition.isEqual(e.precondition)&&(i=e.fieldTransforms,!!(void 0===(r=n.fieldTransforms)&&void 0===i||r&&i&&Th(r,i,(o,s)=>function ORe(n,e){return n.field.isEqual(e.field)&&(i=e.transform,(r=n.transform)instanceof Xc&&i instanceof Xc||r instanceof Zc&&i instanceof Zc?Th(r.elements,i.elements,Zo):r instanceof zh&&i instanceof zh?Zo(r.Ie,i.Ie):r instanceof Uh&&i instanceof Uh);var r,i}(o,s))))&&(0===n.type?n.value.isEqual(e.value):1!==n.type||n.data.isEqual(e.data)&&n.fieldMask.isEqual(e.fieldMask));var r,i}class jh extends cI{constructor(e,t,r,i=[]){super(),this.key=e,this.value=t,this.precondition=r,this.fieldTransforms=i,this.type=0}getFieldMask(){return null}}class Qs extends cI{constructor(e,t,r,i,o=[]){super(),this.key=e,this.data=t,this.fieldMask=r,this.precondition=i,this.fieldTransforms=o,this.type=1}getFieldMask(){return this.fieldMask}}function F9(n){const e=new Map;return n.fieldMask.fields.forEach(t=>{if(!t.isEmpty()){const r=n.data.field(t);e.set(t,r)}}),e}function L9(n,e,t){const r=new Map;se(n.length===t.length);for(let i=0;i{const o=e.get(i.key),s=o.overlayedDocument;let a=this.applyToLocalView(s,o.mutatedFields);a=t.has(i.key)?null:a;const l=P9(s,a);null!==l&&r.set(i.key,l),s.isValidDocument()||s.convertToNoDocument(le.min())}),r}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),Re())}isEqual(e){return this.batchId===e.batchId&&Th(this.mutations,e.mutations,(t,r)=>O9(t,r))&&Th(this.baseMutations,e.baseMutations,(t,r)=>O9(t,r))}}class q1{constructor(e,t,r,i){this.batch=e,this.commitVersion=t,this.mutationResults=r,this.docVersions=i}static from(e,t,r){se(e.mutations.length===r.length);let i=function(){return RRe}();const o=e.mutations;for(let s=0;s=8)throw new e_(`Invalid padding: ${t}`);if(r<0)throw new e_(`Invalid hash count: ${r}`);if(e.length>0&&0===this.hashCount)throw new e_(`Invalid hash count: ${r}`);if(0===e.length&&0!==t)throw new e_(`Invalid padding when bitmap length is 0: ${t}`);this.Ee=8*e.length-t,this.de=tl.fromNumber(this.Ee)}Ae(e,t,r){let i=e.add(t.multiply(tl.fromNumber(r)));return 1===i.compare(URe)&&(i=new tl([i.getBits(0),i.getBits(1)],0)),i.modulo(this.de).toNumber()}Re(e){return!!(this.bitmap[Math.floor(e/8)]&1<s.insert(a)),s}insert(e){if(0===this.Ee)return;const t=H9(e),[r,i]=$9(t);for(let o=0;o0&&(this.be=!0,this.we=e)}Fe(){let e=Re(),t=Re(),r=Re();return this.ye.forEach((i,o)=>{switch(o){case 0:e=e.add(i);break;case 2:t=t.add(i);break;case 1:r=r.add(i);break;default:ne()}}),new n_(this.we,this.Se,e,t,r)}Me(){this.be=!1,this.ye=K9()}xe(e,t){this.be=!0,this.ye=this.ye.insert(e,t)}Oe(e){this.be=!0,this.ye=this.ye.remove(e)}Ne(){this.pe+=1}Be(){this.pe-=1,se(this.pe>=0)}Le(){this.be=!0,this.Se=!0}}class zRe{constructor(e){this.ke=e,this.qe=new Map,this.Qe=ui(),this.$e=hI(),this.Ke=hI(),this.Ue=new Rt(Ee)}We(e){for(const t of e.me)e.fe&&e.fe.isFoundDocument()?this.Ge(t,e.fe):this.ze(t,e.key,e.fe);for(const t of e.removedTargetIds)this.ze(t,e.key,e.fe)}je(e){this.forEachTarget(e,t=>{const r=this.He(t);switch(e.state){case 0:this.Je(t)&&r.Ce(e.resumeToken);break;case 1:r.Be(),r.De||r.Me(),r.Ce(e.resumeToken);break;case 2:r.Be(),r.De||this.removeTarget(t);break;case 3:this.Je(t)&&(r.Le(),r.Ce(e.resumeToken));break;case 4:this.Je(t)&&(this.Ye(t),r.Ce(e.resumeToken));break;default:ne()}})}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.qe.forEach((r,i)=>{this.Je(i)&&t(i)})}Ze(e){const t=e.targetId,r=e.ge.count,i=this.Xe(t);if(i){const o=i.target;if(iI(o))if(0===r){const s=new te(o.path);this.ze(t,s,Lt.newNoDocument(s,le.min()))}else se(1===r);else{const s=this.et(t);if(s!==r){const a=this.tt(e),l=a?this.nt(a,e,s):1;0!==l&&(this.Ye(t),this.Ue=this.Ue.insert(t,2===l?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch"))}}}}tt(e){const t=e.ge.unchangedNames;if(!t||!t.bits)return null;const{bits:{bitmap:r="",padding:i=0},hashCount:o=0}=t;let s,a;try{s=Ws(r).toUint8Array()}catch(l){if(l instanceof q6)return eo("Decoding the base64 bloom filter in existence filter failed ("+l.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw l}try{a=new G1(s,i,o)}catch(l){return eo(l instanceof e_?"BloomFilter error: ":"Applying bloom filter failed: ",l),null}return 0===a.Ee?null:a}nt(e,t,r){return t.ge.count===r-this.st(e,t.targetId)?0:2}st(e,t){const r=this.ke.getRemoteKeysForTarget(t);let i=0;return r.forEach(o=>{const s=this.ke.it(),a=`projects/${s.projectId}/databases/${s.database}/documents/${o.path.canonicalString()}`;e.mightContain(a)||(this.ze(t,o,null),i++)}),i}ot(e){const t=new Map;this.qe.forEach((o,s)=>{const a=this.Xe(s);if(a){if(o.current&&iI(a.target)){const l=new te(a.target.path);this._t(l).has(s)||this.ut(s,l)||this.ze(s,l,Lt.newNoDocument(l,e))}o.ve&&(t.set(s,o.Fe()),o.Me())}});let r=Re();this.Ke.forEach((o,s)=>{let a=!0;s.forEachWhile(l=>{const c=this.Xe(l);return!c||"TargetPurposeLimboResolution"===c.purpose||(a=!1,!1)}),a&&(r=r.add(o))}),this.Qe.forEach((o,s)=>s.setReadTime(e));const i=new t_(e,t,this.Ue,this.Qe,r);return this.Qe=ui(),this.$e=hI(),this.Ke=hI(),this.Ue=new Rt(Ee),i}Ge(e,t){if(!this.Je(e))return;const r=this.ut(e,t.key)?2:0;this.He(e).xe(t.key,r),this.Qe=this.Qe.insert(t.key,t),this.$e=this.$e.insert(t.key,this._t(t.key).add(e)),this.Ke=this.Ke.insert(t.key,this.ct(t.key).add(e))}ze(e,t,r){if(!this.Je(e))return;const i=this.He(e);this.ut(e,t)?i.xe(t,1):i.Oe(t),this.Ke=this.Ke.insert(t,this.ct(t).delete(e)),this.Ke=this.Ke.insert(t,this.ct(t).add(e)),r&&(this.Qe=this.Qe.insert(t,r))}removeTarget(e){this.qe.delete(e)}et(e){const t=this.He(e).Fe();return this.ke.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}Ne(e){this.He(e).Ne()}He(e){let t=this.qe.get(e);return t||(t=new G9,this.qe.set(e,t)),t}ct(e){let t=this.Ke.get(e);return t||(t=new dt(Ee),this.Ke=this.Ke.insert(e,t)),t}_t(e){let t=this.$e.get(e);return t||(t=new dt(Ee),this.$e=this.$e.insert(e,t)),t}Je(e){const t=null!==this.Xe(e);return t||z("WatchChangeAggregator","Detected inactive target",e),t}Xe(e){const t=this.qe.get(e);return t&&t.De?null:this.ke.lt(e)}Ye(e){this.qe.set(e,new G9),this.ke.getRemoteKeysForTarget(e).forEach(t=>{this.ze(e,t,null)})}ut(e,t){return this.ke.getRemoteKeysForTarget(e).has(t)}}function hI(){return new Rt(te.comparator)}function K9(){return new Rt(te.comparator)}const jRe={asc:"ASCENDING",desc:"DESCENDING"},HRe={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},$Re={and:"AND",or:"OR"};class qRe{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function K1(n,e){return n.useProto3Json||Og(e)?e:{value:e}}function $h(n,e){return n.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function Q9(n,e){return n.useProto3Json?e.toBase64():e.toUint8Array()}function WRe(n,e){return $h(n,e.toTimestamp())}function bn(n){return se(!!n),le.fromTimestamp(function(t){const r=qs(t);return new Yt(r.seconds,r.nanos)}(n))}function Q1(n,e){return Y1(n,e).canonicalString()}function Y1(n,e){const t=(i=n,new We(["projects",i.projectId,"databases",i.database])).child("documents");var i;return void 0===e?t:t.child(e)}function Y9(n){const e=We.fromString(n);return se(a7(e)),e}function r_(n,e){return Q1(n.databaseId,e.path)}function es(n,e){const t=Y9(e);if(t.get(1)!==n.databaseId.projectId)throw new j(F.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+t.get(1)+" vs "+n.databaseId.projectId);if(t.get(3)!==n.databaseId.database)throw new j(F.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+t.get(3)+" vs "+n.databaseId.database);return new te(J9(t))}function X9(n,e){return Q1(n.databaseId,e)}function Z9(n){const e=Y9(n);return 4===e.length?We.emptyPath():J9(e)}function X1(n){return new We(["projects",n.databaseId.projectId,"databases",n.databaseId.database]).canonicalString()}function J9(n){return se(n.length>4&&"documents"===n.get(4)),n.popFirst(5)}function e7(n,e,t){return{name:r_(n,e),fields:t.value.mapValue.fields}}function i_(n,e){let t;if(e instanceof jh)t={update:e7(n,e.key,e.value)};else if(e instanceof Hh)t={delete:r_(n,e.key)};else if(e instanceof Qs)t={update:e7(n,e.key,e.data),updateMask:eMe(e.fieldMask)};else{if(!(e instanceof H1))return ne();t={verify:r_(n,e.key)}}return e.fieldTransforms.length>0&&(t.updateTransforms=e.fieldTransforms.map(r=>function(o,s){const a=s.transform;if(a instanceof Uh)return{fieldPath:s.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(a instanceof Xc)return{fieldPath:s.field.canonicalString(),appendMissingElements:{values:a.elements}};if(a instanceof Zc)return{fieldPath:s.field.canonicalString(),removeAllFromArray:{values:a.elements}};if(a instanceof zh)return{fieldPath:s.field.canonicalString(),increment:a.Ie};throw ne()}(0,r))),e.precondition.isNone||(t.currentDocument=void 0!==(o=e.precondition).updateTime?{updateTime:WRe(n,o.updateTime)}:void 0!==o.exists?{exists:o.exists}:ne()),t;var o}function Z1(n,e){const t=e.currentDocument?void 0!==(o=e.currentDocument).updateTime?Wt.updateTime(bn(o.updateTime)):void 0!==o.exists?Wt.exists(o.exists):Wt.none():Wt.none(),r=e.updateTransforms?e.updateTransforms.map(i=>function(s,a){let l=null;"setToServerValue"in a?(se("REQUEST_TIME"===a.setToServerValue),l=new Uh):"appendMissingElements"in a?l=new Xc(a.appendMissingElements.values||[]):"removeAllFromArray"in a?l=new Zc(a.removeAllFromArray.values||[]):"increment"in a?l=new zh(s,a.increment):ne();const c=$t.fromServerFormat(a.fieldPath);return new Zg(c,l)}(n,i)):[];var o;if(e.update){const i=es(n,e.update.name),o=new ar({mapValue:{fields:e.update.fields}});if(e.updateMask){const s=new ci((e.updateMask.fieldPaths||[]).map(u=>$t.fromServerFormat(u)));return new Qs(i,o,s,t,r)}return new jh(i,o,t,r)}if(e.delete){const i=es(n,e.delete);return new Hh(i,t)}if(e.verify){const i=es(n,e.verify);return new H1(i,t)}return ne()}function n7(n,e){return{documents:[X9(n,e.path)]}}function fI(n,e){const t={structuredQuery:{}},r=e.path;let i;null!==e.collectionGroup?(i=r,t.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(i=r.popLast(),t.structuredQuery.from=[{collectionId:r.lastSegment()}]),t.parent=X9(n,i);const o=function(c){if(0!==c.length)return s7(ht.create(c,"and"))}(e.filters);o&&(t.structuredQuery.where=o);const s=function(c){if(0!==c.length)return c.map(u=>{return{field:dl((f=u).field),direction:XRe(f.dir)};var f})}(e.orderBy);s&&(t.structuredQuery.orderBy=s);const a=K1(n,e.limit);return null!==a&&(t.structuredQuery.limit=a),e.startAt&&(t.structuredQuery.startAt={before:(c=e.startAt).inclusive,values:c.position}),e.endAt&&(t.structuredQuery.endAt=function(c){return{before:!c.inclusive,values:c.position}}(e.endAt)),{ht:t,parent:i};var c}function i7(n){let e=Z9(n.parent);const t=n.structuredQuery,r=t.from?t.from.length:0;let i=null;if(r>0){se(1===r);const u=t.from[0];u.allDescendants?i=u.collectionId:e=e.child(u.collectionId)}let o=[];t.where&&(o=function(d){const f=o7(d);return f instanceof ht&&F1(f)?f.getFilters():[f]}(t.where));let s=[];t.orderBy&&(s=t.orderBy.map(f=>{return new Wg(qh((m=f).field),function(v){switch(v){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(m.direction));var m}));let a=null;t.limit&&(a=function(d){let f;return f="object"==typeof d?d.value:d,Og(f)?null:f}(t.limit));let l=null;var d;t.startAt&&(l=new ul((d=t.startAt).values||[],!!d.before));let c=null;return t.endAt&&(c=function(d){return new ul(d.values||[],!d.before)}(t.endAt)),function _9(n,e,t,r,i,o,s,a){return new Gs(n,e,t,r,i,o,s,a)}(e,i,s,o,a,"F",l,c)}function o7(n){return void 0!==n.unaryFilter?function(t){switch(t.unaryFilter.op){case"IS_NAN":const r=qh(t.unaryFilter.field);return Ge.create(r,"==",{doubleValue:NaN});case"IS_NULL":const i=qh(t.unaryFilter.field);return Ge.create(i,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const o=qh(t.unaryFilter.field);return Ge.create(o,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const s=qh(t.unaryFilter.field);return Ge.create(s,"!=",{nullValue:"NULL_VALUE"});default:return ne()}}(n):void 0!==n.fieldFilter?Ge.create(qh((t=n).fieldFilter.field),function(i){switch(i){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return ne()}}(t.fieldFilter.op),t.fieldFilter.value):void 0!==n.compositeFilter?function(t){return ht.create(t.compositeFilter.filters.map(r=>o7(r)),function(i){switch(i){case"AND":return"and";case"OR":return"or";default:return ne()}}(t.compositeFilter.op))}(n):ne();var t}function XRe(n){return jRe[n]}function ZRe(n){return HRe[n]}function JRe(n){return $Re[n]}function dl(n){return{fieldPath:n.canonicalString()}}function qh(n){return $t.fromServerFormat(n.fieldPath)}function s7(n){return n instanceof Ge?function(t){if("=="===t.op){if(e9(t.value))return{unaryFilter:{field:dl(t.field),op:"IS_NAN"}};if(J6(t.value))return{unaryFilter:{field:dl(t.field),op:"IS_NULL"}}}else if("!="===t.op){if(e9(t.value))return{unaryFilter:{field:dl(t.field),op:"IS_NOT_NAN"}};if(J6(t.value))return{unaryFilter:{field:dl(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:dl(t.field),op:ZRe(t.op),value:t.value}}}(n):n instanceof ht?function(t){const r=t.getFilters().map(i=>s7(i));return 1===r.length?r[0]:{compositeFilter:{op:JRe(t.op),filters:r}}}(n):ne()}function eMe(n){const e=[];return n.fields.forEach(t=>e.push(t.canonicalString())),{fieldPaths:e}}function a7(n){return n.length>=4&&"projects"===n.get(0)&&"databases"===n.get(2)}class Ys{constructor(e,t,r,i,o=le.min(),s=le.min(),a=ln.EMPTY_BYTE_STRING,l=null){this.target=e,this.targetId=t,this.purpose=r,this.sequenceNumber=i,this.snapshotVersion=o,this.lastLimboFreeSnapshotVersion=s,this.resumeToken=a,this.expectedCount=l}withSequenceNumber(e){return new Ys(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,t){return new Ys(this.target,this.targetId,this.purpose,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new Ys(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new Ys(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}class l7{constructor(e){this.Tt=e}}function c7(n,e){const t=e.key,r={prefixPath:t.getCollectionPath().popLast().toArray(),collectionGroup:t.collectionGroup,documentId:t.path.lastSegment(),readTime:pI(e.readTime),hasCommittedMutations:e.hasCommittedMutations};if(e.isFoundDocument())r.document={name:r_(o=n.Tt,(s=e).key),fields:s.data.value.mapValue.fields,updateTime:$h(o,s.version.toTimestamp()),createTime:$h(o,s.createTime.toTimestamp())};else if(e.isNoDocument())r.noDocument={path:t.path.toArray(),readTime:Jc(e.version)};else{if(!e.isUnknownDocument())return ne();r.unknownDocument={path:t.path.toArray(),version:Jc(e.version)}}var o,s;return r}function pI(n){const e=n.toTimestamp();return[e.seconds,e.nanoseconds]}function Jc(n){const e=n.toTimestamp();return{seconds:e.seconds,nanoseconds:e.nanoseconds}}function eu(n){const e=new Yt(n.seconds,n.nanoseconds);return le.fromTimestamp(e)}function tu(n,e){const t=(e.baseMutations||[]).map(o=>Z1(n.Tt,o));for(let o=0;oZ1(n.Tt,o)),i=Yt.fromMillis(e.localWriteTimeMs);return new $1(e.batchId,i,t,r)}function o_(n){const e=eu(n.readTime),t=void 0!==n.lastLimboFreeSnapshotVersion?eu(n.lastLimboFreeSnapshotVersion):le.min();let r;return r=void 0!==n.query.documents?(se(1===(o=n.query).documents.length),br(Lh(Z9(o.documents[0])))):function(o){return br(i7(o))}(n.query),new Ys(r,n.targetId,"TargetPurposeListen",n.lastListenSequenceNumber,e,t,ln.fromBase64String(n.resumeToken));var o}function u7(n,e){const t=Jc(e.snapshotVersion),r=Jc(e.lastLimboFreeSnapshotVersion);let i;i=iI(e.target)?n7(n.Tt,e.target):fI(n.Tt,e.target).ht;const o=e.resumeToken.toBase64();return{targetId:e.targetId,canonicalId:Yc(e.target),readTime:t,resumeToken:o,lastListenSequenceNumber:e.sequenceNumber,lastLimboFreeSnapshotVersion:r,query:i}}function J1(n){const e=i7({parent:n.parent,structuredQuery:n.structuredQuery});return"LAST"===n.limitType?sI(e,e.limit,"L"):e}function eN(n,e){return new W1(e.largestBatchId,Z1(n.Tt,e.overlayMutation))}function d7(n,e){const t=e.path.lastSegment();return[n,vr(e.path.popLast()),t]}function h7(n,e,t,r){return{indexId:n,uid:e,sequenceNumber:t,readTime:Jc(r.readTime),documentKey:vr(r.documentKey.path),largestBatchId:r.largestBatchId}}class nMe{getBundleMetadata(e,t){return f7(e).get(t).next(r=>{if(r)return{id:(o=r).bundleId,createTime:eu(o.createTime),version:o.version};var o})}saveBundleMetadata(e,t){return f7(e).put({bundleId:(i=t).id,createTime:Jc(bn(i.createTime)),version:i.version});var i}getNamedQuery(e,t){return p7(e).get(t).next(r=>{if(r)return{name:(o=r).name,query:J1(o.bundledQuery),readTime:eu(o.readTime)};var o})}saveNamedQuery(e,t){return p7(e).put({name:(i=t).name,readTime:Jc(bn(i.readTime)),bundledQuery:i.bundledQuery});var i}}function f7(n){return Un(n,WE)}function p7(n){return Un(n,GE)}class mI{constructor(e,t){this.serializer=e,this.userId=t}static It(e,t){return new mI(e,t.uid||"")}getOverlay(e,t){return s_(e).get(d7(this.userId,t)).next(r=>r?eN(this.serializer,r):null)}getOverlays(e,t){const r=Jo();return N.forEach(t,i=>this.getOverlay(e,i).next(o=>{null!==o&&r.set(i,o)})).next(()=>r)}saveOverlays(e,t,r){const i=[];return r.forEach((o,s)=>{const a=new W1(t,s);i.push(this.Et(e,a))}),N.waitFor(i)}removeOverlaysForBatchId(e,t,r){const i=new Set;t.forEach(s=>i.add(vr(s.getCollectionPath())));const o=[];return i.forEach(s=>{const a=IDBKeyRange.bound([this.userId,s,r],[this.userId,s,r+1],!1,!0);o.push(s_(e).J(S1,a))}),N.waitFor(o)}getOverlaysForCollection(e,t,r){const i=Jo(),o=vr(t),s=IDBKeyRange.bound([this.userId,o,r],[this.userId,o,Number.POSITIVE_INFINITY],!0);return s_(e).G(S1,s).next(a=>{for(const l of a){const c=eN(this.serializer,l);i.set(c.getKey(),c)}return i})}getOverlaysForCollectionGroup(e,t,r,i){const o=Jo();let s;const a=IDBKeyRange.bound([this.userId,t,r],[this.userId,t,Number.POSITIVE_INFINITY],!0);return s_(e).Z({index:L6,range:a},(l,c,u)=>{const d=eN(this.serializer,c);o.size()o)}Et(e,t){return s_(e).put(function(i,o,s){const[a,l,c]=d7(o,s.mutation.key);return{userId:o,collectionPath:l,documentId:c,collectionGroup:s.mutation.key.getCollectionGroup(),largestBatchId:s.largestBatchId,overlayMutation:i_(i.Tt,s.mutation)}}(this.serializer,this.userId,t))}}function s_(n){return Un(n,YE)}class rMe{dt(e){return Un(e,D1)}getSessionToken(e){return this.dt(e).get("sessionToken").next(t=>{const r=t?.value;return r?ln.fromUint8Array(r):ln.EMPTY_BYTE_STRING})}setSessionToken(e,t){return this.dt(e).put({name:"sessionToken",value:t.toUint8Array()})}}class nu{constructor(){}At(e,t){this.Rt(e,t),t.Vt()}Rt(e,t){if("nullValue"in e)this.ft(t,5);else if("booleanValue"in e)this.ft(t,10),t.gt(e.booleanValue?1:0);else if("integerValue"in e)this.ft(t,15),t.gt(qt(e.integerValue));else if("doubleValue"in e){const r=qt(e.doubleValue);isNaN(r)?this.ft(t,13):(this.ft(t,15),Fg(r)?t.gt(0):t.gt(r))}else if("timestampValue"in e){let r=e.timestampValue;this.ft(t,20),"string"==typeof r&&(r=qs(r)),t.yt(`${r.seconds||""}`),t.gt(r.nanos||0)}else if("stringValue"in e)this.wt(e.stringValue,t),this.St(t);else if("bytesValue"in e)this.ft(t,30),t.bt(Ws(e.bytesValue)),this.St(t);else if("referenceValue"in e)this.Dt(e.referenceValue,t);else if("geoPointValue"in e){const r=e.geoPointValue;this.ft(t,45),t.gt(r.latitude||0),t.gt(r.longitude||0)}else"mapValue"in e?t9(e)?this.ft(t,Number.MAX_SAFE_INTEGER):rI(e)?this.vt(e.mapValue,t):(this.Ct(e.mapValue,t),this.St(t)):"arrayValue"in e?(this.Ft(e.arrayValue,t),this.St(t)):ne()}wt(e,t){this.ft(t,25),this.Mt(e,t)}Mt(e,t){t.yt(e)}Ct(e,t){const r=e.fields||{};this.ft(t,55);for(const i of Object.keys(r))this.wt(i,t),this.Rt(r[i],t)}vt(e,t){var r,i;const o=e.fields||{};this.ft(t,53);const s=Ph,a=(null===(i=null===(r=o[s].arrayValue)||void 0===r?void 0:r.values)||void 0===i?void 0:i.length)||0;this.ft(t,15),t.gt(qt(a)),this.wt(s,t),this.Rt(o[s],t)}Ft(e,t){const r=e.values||[];this.ft(t,50);for(const i of r)this.Rt(i,t)}Dt(e,t){this.ft(t,37),te.fromName(e).path.forEach(r=>{this.ft(t,60),this.Mt(r,t)})}ft(e,t){e.gt(t)}St(e){e.gt(2)}}function iMe(n){if(0===n)return 8;let e=0;return n>>4||(e+=4,n<<=4),n>>6||(e+=2,n<<=2),n>>7||(e+=1),e}function m7(n){const e=64-function(r){let i=0;for(let o=0;o<8;++o){const s=iMe(255&r[o]);if(i+=s,8!==s)break}return i}(n);return Math.ceil(e/8)}nu.xt=new nu;class oMe{constructor(){this.buffer=new Uint8Array(1024),this.position=0}Ot(e){const t=e[Symbol.iterator]();let r=t.next();for(;!r.done;)this.Nt(r.value),r=t.next();this.Bt()}Lt(e){const t=e[Symbol.iterator]();let r=t.next();for(;!r.done;)this.kt(r.value),r=t.next();this.qt()}Qt(e){for(const t of e){const r=t.charCodeAt(0);if(r<128)this.Nt(r);else if(r<2048)this.Nt(960|r>>>6),this.Nt(128|63&r);else if(t<"\ud800"||"\udbff">>12),this.Nt(128|63&r>>>6),this.Nt(128|63&r);else{const i=t.codePointAt(0);this.Nt(240|i>>>18),this.Nt(128|63&i>>>12),this.Nt(128|63&i>>>6),this.Nt(128|63&i)}}this.Bt()}$t(e){for(const t of e){const r=t.charCodeAt(0);if(r<128)this.kt(r);else if(r<2048)this.kt(960|r>>>6),this.kt(128|63&r);else if(t<"\ud800"||"\udbff">>12),this.kt(128|63&r>>>6),this.kt(128|63&r);else{const i=t.codePointAt(0);this.kt(240|i>>>18),this.kt(128|63&i>>>12),this.kt(128|63&i>>>6),this.kt(128|63&i)}}this.qt()}Kt(e){const t=this.Ut(e),r=m7(t);this.Wt(1+r),this.buffer[this.position++]=255&r;for(let i=t.length-r;i$t.comparator(t.field,r.field)),this.collectionId=null!=e.collectionGroup?e.collectionGroup:e.path.lastSegment(),this.sn=e.orderBy,this._n=[];for(const t of e.filters){const r=t;r.isInequality()?this.rn=this.rn.add(r):this._n.push(r)}}get an(){return this.rn.size>1}un(e){if(se(e.collectionGroup===this.collectionId),this.an)return!1;const t=v1(e);if(void 0!==t&&!this.cn(t))return!1;const r=jc(e);let i=new Set,o=0,s=0;for(;o0){const a=this.rn.getIterator().getNext();if(!i.has(a.field.canonicalString())){const l=r[o];if(!this.ln(a,l)||!this.hn(this.sn[s++],l))return!1}++o}for(;o=this.sn.length||!this.hn(this.sn[s++],r[o]))return!1;return!0}Pn(){if(this.an)return null;let e=new dt($t.comparator);const t=[];for(const r of this._n)if(!r.field.isKeyField())if("array-contains"===r.op||"array-contains-any"===r.op)t.push(new Hc(r.field,2));else{if(e.has(r.field))continue;e=e.add(r.field),t.push(new Hc(r.field,0))}for(const r of this.sn)r.field.isKeyField()||e.has(r.field)||(e=e.add(r.field),t.push(new Hc(r.field,"asc"===r.dir?0:1)));return new xh(xh.UNKNOWN_ID,this.collectionId,t,Sh.empty())}cn(e){for(const t of this._n)if(this.ln(t,e))return!0;return!1}ln(e,t){return!(void 0===e||!e.field.isEqual(t.fieldPath))&&2===t.kind==("array-contains"===e.op||"array-contains-any"===e.op)}hn(e,t){return!!e.field.isEqual(t.fieldPath)&&(0===t.kind&&"asc"===e.dir||1===t.kind&&"desc"===e.dir)}}function y7(n){var e,t;if(se(n instanceof Ge||n instanceof ht),n instanceof Ge){if(n instanceof p9){const i=(null===(t=null===(e=n.value.arrayValue)||void 0===e?void 0:e.values)||void 0===t?void 0:t.map(o=>Ge.create(n.field,"==",o)))||[];return ht.create(i,"or")}return n}const r=n.filters.map(i=>y7(i));return ht.create(r,n.op)}function lMe(n){if(0===n.getFilters().length)return[];const e=rN(y7(n));return se(v7(e)),tN(e)||nN(e)?[e]:e.getFilters()}function tN(n){return n instanceof Ge}function nN(n){return n instanceof ht&&F1(n)}function v7(n){return tN(n)||nN(n)||function(t){if(t instanceof ht&&O1(t)){for(const r of t.getFilters())if(!tN(r)&&!nN(r))return!1;return!0}return!1}(n)}function rN(n){if(se(n instanceof Ge||n instanceof ht),n instanceof Ge)return n;if(1===n.filters.length)return rN(n.filters[0]);const e=n.filters.map(r=>rN(r));let t=ht.create(e,n.op);return t=gI(t),v7(t)?t:(se(t instanceof ht),se(Fh(t)),se(t.filters.length>1),t.filters.reduce((r,i)=>iN(r,i)))}function iN(n,e){let t;return se(n instanceof Ge||n instanceof ht),se(e instanceof Ge||e instanceof ht),t=n instanceof Ge?e instanceof Ge?ht.create([n,e],"and"):b7(n,e):e instanceof Ge?b7(e,n):function(i,o){if(se(i.filters.length>0&&o.filters.length>0),Fh(i)&&Fh(o))return d9(i,o.getFilters());const s=O1(i)?i:o,a=O1(i)?o:i,l=s.filters.map(c=>iN(c,a));return ht.create(l,"or")}(n,e),gI(t)}function b7(n,e){if(Fh(e))return d9(e,n.getFilters());{const t=e.filters.map(r=>iN(n,r));return ht.create(t,"or")}}function gI(n){if(se(n instanceof Ge||n instanceof ht),n instanceof Ge)return n;const e=n.getFilters();if(1===e.length)return gI(e[0]);if(c9(n))return n;const t=e.map(i=>gI(i)),r=[];return t.forEach(i=>{i instanceof Ge?r.push(i):i instanceof ht&&(i.op===n.op?r.push(...i.filters):r.push(i))}),1===r.length?r[0]:ht.create(r,n.op)}class cMe{constructor(){this.Tn=new oN}addToCollectionParentIndex(e,t){return this.Tn.add(t),N.resolve()}getCollectionParents(e,t){return N.resolve(this.Tn.getEntries(t))}addFieldIndex(e,t){return N.resolve()}deleteFieldIndex(e,t){return N.resolve()}deleteAllFieldIndexes(e){return N.resolve()}createTargetIndexes(e,t){return N.resolve()}getDocumentsMatchingTarget(e,t){return N.resolve(null)}getIndexType(e,t){return N.resolve(0)}getFieldIndexes(e,t){return N.resolve([])}getNextCollectionGroupToUpdate(e){return N.resolve(null)}getMinOffset(e,t){return N.resolve(Mi.min())}getMinOffsetFromCollectionGroup(e,t){return N.resolve(Mi.min())}updateCollectionGroup(e,t,r){return N.resolve()}updateIndexEntries(e,t){return N.resolve()}}class oN{constructor(){this.index={}}add(e){const t=e.lastSegment(),r=e.popLast(),i=this.index[t]||new dt(We.comparator),o=!i.has(r);return this.index[t]=i.add(r),o}has(e){const t=e.lastSegment(),r=e.popLast(),i=this.index[t];return i&&i.has(r)}getEntries(e){return(this.index[e]||new dt(We.comparator)).toArray()}}const w7="IndexedDbIndexManager",_I=new Uint8Array(0);class uMe{constructor(e,t){this.databaseId=t,this.In=new oN,this.En=new Ks(r=>Yc(r),(r,i)=>Gg(r,i)),this.uid=e.uid||""}addToCollectionParentIndex(e,t){if(!this.In.has(t)){const r=t.lastSegment(),i=t.popLast();e.addOnCommittedListener(()=>{this.In.add(t)});const o={collectionId:r,parent:vr(i)};return E7(e).put(o)}return N.resolve()}getCollectionParents(e,t){const r=[],i=IDBKeyRange.bound([t,""],[v6(t),""],!1,!0);return E7(e).G(i).next(o=>{for(const s of o){if(s.collectionId!==t)break;r.push(Xo(s.parent))}return r})}addFieldIndex(e,t){const r=l_(e),i={indexId:(a=t).indexId,collectionGroup:a.collectionGroup,fields:a.fields.map(l=>[l.fieldPath.canonicalString(),l.kind])};var a;delete i.indexId;const o=r.add(i);if(t.indexState){const s=Kh(e);return o.next(a=>{s.put(h7(a,this.uid,t.indexState.sequenceNumber,t.indexState.offset))})}return o.next()}deleteFieldIndex(e,t){const r=l_(e),i=Kh(e),o=Gh(e);return r.delete(t.indexId).next(()=>i.delete(IDBKeyRange.bound([t.indexId],[t.indexId+1],!1,!0))).next(()=>o.delete(IDBKeyRange.bound([t.indexId],[t.indexId+1],!1,!0)))}deleteAllFieldIndexes(e){const t=l_(e),r=Gh(e),i=Kh(e);return t.J().next(()=>r.J()).next(()=>i.J())}createTargetIndexes(e,t){return N.forEach(this.dn(t),r=>this.getIndexType(e,r).next(i=>{if(0===i||1===i){const o=new _7(r).Pn();if(null!=o)return this.addFieldIndex(e,o)}}))}getDocumentsMatchingTarget(e,t){const r=Gh(e);let i=!0;const o=new Map;return N.forEach(this.dn(t),s=>this.An(e,s).next(a=>{i&&(i=!!a),o.set(s,a)})).next(()=>{if(i){let s=Re();const a=[];return N.forEach(o,(l,c)=>{var R;z(w7,`Using index ${R=l,`id=${R.indexId}|cg=${R.collectionGroup}|f=${R.fields.map(V=>`${V.fieldPath}:${V.kind}`).join(",")}`} to execute ${Yc(t)}`);const u=function(R,V){const H=v1(V);if(void 0===H)return null;for(const Q of oI(R,H.fieldPath))switch(Q.op){case"array-contains-any":return Q.value.arrayValue.values||[];case"array-contains":return[Q.value]}return null}(c,l),d=function(R,V){const H=new Map;for(const Q of jc(V))for(const S of oI(R,Q.fieldPath))switch(S.op){case"==":case"in":H.set(Q.fieldPath.canonicalString(),S.value);break;case"not-in":case"!=":return H.set(Q.fieldPath.canonicalString(),S.value),Array.from(H.values())}return null}(c,l),f=function(R,V){const H=[];let Q=!0;for(const S of jc(V)){const I=0===S.kind?m9(R,S.fieldPath,R.startAt):g9(R,S.fieldPath,R.startAt);H.push(I.value),Q&&(Q=I.inclusive)}return new ul(H,Q)}(c,l),p=function(R,V){const H=[];let Q=!0;for(const S of jc(V)){const I=0===S.kind?g9(R,S.fieldPath,R.endAt):m9(R,S.fieldPath,R.endAt);H.push(I.value),Q&&(Q=I.inclusive)}return new ul(H,Q)}(c,l),m=this.Rn(l,c,f),_=this.Rn(l,c,p),v=this.Vn(l,c,d),E=this.mn(l.indexId,u,m,f.inclusive,_,p.inclusive,v);return N.forEach(E,C=>r.H(C,t.limit).next(R=>{R.forEach(V=>{const H=te.fromSegments(V.documentKey);s.has(H)||(s=s.add(H),a.push(H))})}))}).next(()=>a)}return N.resolve(null)})}dn(e){let t=this.En.get(e);return t||(t=0===e.filters.length?[e]:lMe(ht.create(e.filters,"and")).map(r=>V1(e.path,e.collectionGroup,e.orderBy,r.getFilters(),e.limit,e.startAt,e.endAt)),this.En.set(e,t),t)}mn(e,t,r,i,o,s,a){const l=(null!=t?t.length:1)*Math.max(r.length,o.length),c=l/(null!=t?t.length:1),u=[];for(let d=0;dthis.gn(e,f,v,!0));u.push(...this.createRange(p,m,_))}return u}gn(e,t,r,i){const o=new ru(e,te.empty(),t,r);return i?o:o.nn()}pn(e,t,r,i){const o=new ru(e,te.empty(),t,r);return i?o.nn():o}An(e,t){const r=new _7(t),i=null!=t.collectionGroup?t.collectionGroup:t.path.lastSegment();return this.getFieldIndexes(e,i).next(o=>{let s=null;for(const a of o)r.un(a)&&(!s||a.fields.length>s.fields.length)&&(s=a);return s})}getIndexType(e,t){let r=2;const i=this.dn(t);return N.forEach(i,o=>this.An(e,o).next(s=>{s?0!==r&&s.fields.lengthnull!==t.limit&&i.length>1&&2===r?1:r)}yn(e,t){const r=new a_;for(const i of jc(e)){const o=t.data.field(i.fieldPath);if(null==o)return null;const s=r.tn(i.kind);nu.xt.At(o,s)}return r.Yt()}fn(e){const t=new a_;return nu.xt.At(e,t.tn(0)),t.Yt()}wn(e,t){const r=new a_;return nu.xt.At(Qc(this.databaseId,t),r.tn(function(o){const s=jc(o);return 0===s.length?0:s[s.length-1].kind}(e))),r.Yt()}Vn(e,t,r){if(null===r)return[];let i=[];i.push(new a_);let o=0;for(const s of jc(e)){const a=r[o++];for(const l of i)if(this.Sn(t,s.fieldPath)&&$g(a))i=this.bn(i,s,a);else{const c=l.tn(s.kind);nu.xt.At(a,c)}}return this.Dn(i)}Rn(e,t,r){return this.Vn(e,t,r.position)}Dn(e){const t=[];for(let r=0;rr instanceof Ge&&r.field.isEqual(t)&&("in"===r.op||"not-in"===r.op))}getFieldIndexes(e,t){const r=l_(e),i=Kh(e);return(t?r.G(x1,IDBKeyRange.bound(t,t)):r.G()).next(o=>{const s=[];return N.forEach(o,a=>i.get([a.indexId,this.uid]).next(l=>{s.push(function(u,d){const f=d?new Sh(d.sequenceNumber,new Mi(eu(d.readTime),new te(Xo(d.documentKey)),d.largestBatchId)):Sh.empty(),p=u.fields.map(([m,_])=>new Hc($t.fromServerFormat(m),_));return new xh(u.indexId,u.collectionGroup,p,f)}(a,l))})).next(()=>s)})}getNextCollectionGroupToUpdate(e){return this.getFieldIndexes(e).next(t=>0===t.length?null:(t.sort((r,i)=>{const o=r.indexState.sequenceNumber-i.indexState.sequenceNumber;return 0!==o?o:Ee(r.collectionGroup,i.collectionGroup)}),t[0].collectionGroup))}updateCollectionGroup(e,t,r){const i=l_(e),o=Kh(e);return this.vn(e).next(s=>i.G(x1,IDBKeyRange.bound(t,t)).next(a=>N.forEach(a,l=>o.put(h7(l.indexId,this.uid,s,r)))))}updateIndexEntries(e,t){const r=new Map;return N.forEach(t,(i,o)=>{const s=r.get(i.collectionGroup);return(s?N.resolve(s):this.getFieldIndexes(e,i.collectionGroup)).next(a=>(r.set(i.collectionGroup,a),N.forEach(a,l=>this.Cn(e,i,l).next(c=>{const u=this.Fn(o,l);return c.isEqual(u)?N.resolve():this.Mn(e,o,l,c,u)}))))})}xn(e,t,r,i){return Gh(e).put({indexId:i.indexId,uid:this.uid,arrayValue:i.arrayValue,directionalValue:i.directionalValue,orderedDocumentKey:this.wn(r,t.key),documentKey:t.key.path.toArray()})}On(e,t,r,i){return Gh(e).delete([i.indexId,this.uid,i.arrayValue,i.directionalValue,this.wn(r,t.key),t.key.path.toArray()])}Cn(e,t,r){const i=Gh(e);let o=new dt(hl);return i.Z({index:F6,range:IDBKeyRange.only([r.indexId,this.uid,this.wn(r,t)])},(s,a)=>{o=o.add(new ru(r.indexId,t,a.arrayValue,a.directionalValue))}).next(()=>o)}Fn(e,t){let r=new dt(hl);const i=this.yn(t,e);if(null==i)return r;const o=v1(t);if(null!=o){const s=e.data.field(o.fieldPath);if($g(s))for(const a of s.arrayValue.values||[])r=r.add(new ru(t.indexId,e.key,this.fn(a),i))}else r=r.add(new ru(t.indexId,e.key,_I,i));return r}Mn(e,t,r,i,o){z(w7,"Updating index entries for document '%s'",t.key);const s=[];return function(l,c,u,d,f){const p=l.getIterator(),m=c.getIterator();let _=Nh(p),v=Nh(m);for(;_||v;){let E=!1,C=!1;if(_&&v){const R=u(_,v);R<0?C=!0:R>0&&(E=!0)}else null!=_?C=!0:E=!0;E?(d(v),v=Nh(m)):C?(f(_),_=Nh(p)):(_=Nh(p),v=Nh(m))}}(i,o,hl,a=>{s.push(this.xn(e,t,r,a))},a=>{s.push(this.On(e,t,r,a))}),N.waitFor(s)}vn(e){let t=1;return Kh(e).Z({index:O6,reverse:!0,range:IDBKeyRange.upperBound([this.uid,Number.MAX_SAFE_INTEGER])},(r,i,o)=>{o.done(),t=i.sequenceNumber+1}).next(()=>t)}createRange(e,t,r){r=r.sort((s,a)=>hl(s,a)).filter((s,a,l)=>!a||0!==hl(s,l[a-1]));const i=[];i.push(e);for(const s of r){const a=hl(s,e),l=hl(s,t);if(0===a)i[0]=e.nn();else if(a>0&&l<0)i.push(s),i.push(s.nn());else if(l>0)break}i.push(t);const o=[];for(let s=0;s0}getMinOffsetFromCollectionGroup(e,t){return this.getFieldIndexes(e,t).next(I7)}getMinOffset(e,t){return N.mapArray(this.dn(t),r=>this.An(e,r).next(i=>i||ne())).next(I7)}}function E7(n){return Un(n,Ug)}function Gh(n){return Un(n,QE)}function l_(n){return Un(n,C1)}function Kh(n){return Un(n,KE)}function I7(n){se(0!==n.length);let e=n[0].indexState.offset,t=e.largestBatchId;for(let r=1;r(a++,f.delete()));o.push(l.next(()=>{se(1===a)}));const c=[];for(const u of t.mutations){const d=k6(e,u.key.path,t.batchId);o.push(i.delete(d)),c.push(u.key)}return N.waitFor(o).next(()=>c)}function yI(n){if(!n)return 0;let e;if(n.document)e=n.document;else if(n.unknownDocument)e=n.unknownDocument;else{if(!n.noDocument)throw ne();e=n.noDocument}return JSON.stringify(e).length}wr.DEFAULT_COLLECTION_PERCENTILE=10,wr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,wr.DEFAULT=new wr(41943040,wr.DEFAULT_COLLECTION_PERCENTILE,wr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),wr.DISABLED=new wr(-1,0,0);class vI{constructor(e,t,r,i){this.userId=e,this.serializer=t,this.indexManager=r,this.referenceDelegate=i,this.Bn={}}static It(e,t,r,i){se(""!==e.uid);const o=e.isAuthenticated()?e.uid:"";return new vI(o,t,r,i)}checkEmpty(e){let t=!0;const r=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return fl(e).Z({index:Wc,range:r},(i,o,s)=>{t=!1,s.done()}).next(()=>t)}addMutationBatch(e,t,r,i){const o=Qh(e),s=fl(e);return s.add({}).next(a=>{se("number"==typeof a);const l=new $1(a,t,r,i),c=function(p,m,_){const v=_.baseMutations.map(C=>i_(p.Tt,C)),E=_.mutations.map(C=>i_(p.Tt,C));return{userId:m,batchId:_.batchId,localWriteTimeMs:_.localWriteTime.toMillis(),baseMutations:v,mutations:E}}(this.serializer,this.userId,l),u=[];let d=new dt((f,p)=>Ee(f.canonicalString(),p.canonicalString()));for(const f of i){const p=k6(this.userId,f.key.path,a);d=d.add(f.key.path.popLast()),u.push(s.put(c)),u.push(o.put(p,WAe))}return d.forEach(f=>{u.push(this.indexManager.addToCollectionParentIndex(e,f))}),e.addOnCommittedListener(()=>{this.Bn[a]=l.keys()}),N.waitFor(u).next(()=>l)})}lookupMutationBatch(e,t){return fl(e).get(t).next(r=>r?(se(r.userId===this.userId),tu(this.serializer,r)):null)}Ln(e,t){return this.Bn[t]?N.resolve(this.Bn[t]):this.lookupMutationBatch(e,t).next(r=>{if(r){const i=r.keys();return this.Bn[t]=i,i}return null})}getNextMutationBatchAfterBatchId(e,t){const r=t+1,i=IDBKeyRange.lowerBound([this.userId,r]);let o=null;return fl(e).Z({index:Wc,range:i},(s,a,l)=>{a.userId===this.userId&&(se(a.batchId>=r),o=tu(this.serializer,a)),l.done()}).next(()=>o)}getHighestUnacknowledgedBatchId(e){const t=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]);let r=-1;return fl(e).Z({index:Wc,range:t,reverse:!0},(i,o,s)=>{r=o.batchId,s.done()}).next(()=>r)}getAllMutationBatches(e){const t=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return fl(e).G(Wc,t).next(r=>r.map(i=>tu(this.serializer,i)))}getAllMutationBatchesAffectingDocumentKey(e,t){const r=jE(this.userId,t.path),i=IDBKeyRange.lowerBound(r),o=[];return Qh(e).Z({range:i},(s,a,l)=>{const[c,u,d]=s,f=Xo(u);if(c===this.userId&&t.path.isEqual(f))return fl(e).get(d).next(p=>{if(!p)throw ne();se(p.userId===this.userId),o.push(tu(this.serializer,p))});l.done()}).next(()=>o)}getAllMutationBatchesAffectingDocumentKeys(e,t){let r=new dt(Ee);const i=[];return t.forEach(o=>{const s=jE(this.userId,o.path),a=IDBKeyRange.lowerBound(s),l=Qh(e).Z({range:a},(c,u,d)=>{const[f,p,m]=c,_=Xo(p);f===this.userId&&o.path.isEqual(_)?r=r.add(m):d.done()});i.push(l)}),N.waitFor(i).next(()=>this.kn(e,r))}getAllMutationBatchesAffectingQuery(e,t){const r=t.path,i=r.length+1,o=jE(this.userId,r),s=IDBKeyRange.lowerBound(o);let a=new dt(Ee);return Qh(e).Z({range:s},(l,c,u)=>{const[d,f,p]=l,m=Xo(f);d===this.userId&&r.isPrefixOf(m)?m.length===i&&(a=a.add(p)):u.done()}).next(()=>this.kn(e,a))}kn(e,t){const r=[],i=[];return t.forEach(o=>{i.push(fl(e).get(o).next(s=>{if(null===s)throw ne();se(s.userId===this.userId),r.push(tu(this.serializer,s))}))}),N.waitFor(i).next(()=>r)}removeMutationBatch(e,t){return x7(e.ue,this.userId,t).next(r=>(e.addOnCommittedListener(()=>{this.qn(t.batchId)}),N.forEach(r,i=>this.referenceDelegate.markPotentiallyOrphaned(e,i))))}qn(e){delete this.Bn[e]}performConsistencyCheck(e){return this.checkEmpty(e).next(t=>{if(!t)return N.resolve();const r=IDBKeyRange.lowerBound(function(s){return[s]}(this.userId)),i=[];return Qh(e).Z({range:r},(o,s,a)=>{if(o[0]===this.userId){const l=Xo(o[1]);i.push(l)}else a.done()}).next(()=>{se(0===i.length)})})}containsKey(e,t){return S7(e,this.userId,t)}Qn(e){return D7(e).get(this.userId).next(t=>t||{userId:this.userId,lastAcknowledgedBatchId:-1,lastStreamToken:""})}}function S7(n,e,t){const r=jE(e,t.path),i=r[1],o=IDBKeyRange.lowerBound(r);let s=!1;return Qh(n).Z({range:o,Y:!0},(a,l,c)=>{const[u,d,f]=a;u===e&&d===i&&(s=!0),c.done()}).next(()=>s)}function fl(n){return Un(n,wo)}function Qh(n){return Un(n,Ah)}function D7(n){return Un(n,Vg)}class iu{constructor(e){this.$n=e}next(){return this.$n+=2,this.$n}static Kn(){return new iu(0)}static Un(){return new iu(-1)}}class dMe{constructor(e,t){this.referenceDelegate=e,this.serializer=t}allocateTargetId(e){return this.Wn(e).next(t=>{const r=new iu(t.highestTargetId);return t.highestTargetId=r.next(),this.Gn(e,t).next(()=>t.highestTargetId)})}getLastRemoteSnapshotVersion(e){return this.Wn(e).next(t=>le.fromTimestamp(new Yt(t.lastRemoteSnapshotVersion.seconds,t.lastRemoteSnapshotVersion.nanoseconds)))}getHighestSequenceNumber(e){return this.Wn(e).next(t=>t.highestListenSequenceNumber)}setTargetsMetadata(e,t,r){return this.Wn(e).next(i=>(i.highestListenSequenceNumber=t,r&&(i.lastRemoteSnapshotVersion=r.toTimestamp()),t>i.highestListenSequenceNumber&&(i.highestListenSequenceNumber=t),this.Gn(e,i)))}addTargetData(e,t){return this.zn(e,t).next(()=>this.Wn(e).next(r=>(r.targetCount+=1,this.jn(t,r),this.Gn(e,r))))}updateTargetData(e,t){return this.zn(e,t)}removeTargetData(e,t){return this.removeMatchingKeysForTargetId(e,t.targetId).next(()=>Yh(e).delete(t.targetId)).next(()=>this.Wn(e)).next(r=>(se(r.targetCount>0),r.targetCount-=1,this.Gn(e,r)))}removeTargets(e,t,r){let i=0;const o=[];return Yh(e).Z((s,a)=>{const l=o_(a);l.sequenceNumber<=t&&null===r.get(l.targetId)&&(i++,o.push(this.removeTargetData(e,l)))}).next(()=>N.waitFor(o)).next(()=>i)}forEachTarget(e,t){return Yh(e).Z((r,i)=>{const o=o_(i);t(o)})}Wn(e){return A7(e).get(qE).next(t=>(se(null!==t),t))}Gn(e,t){return A7(e).put(qE,t)}zn(e,t){return Yh(e).put(u7(this.serializer,t))}jn(e,t){let r=!1;return e.targetId>t.highestTargetId&&(t.highestTargetId=e.targetId,r=!0),e.sequenceNumber>t.highestListenSequenceNumber&&(t.highestListenSequenceNumber=e.sequenceNumber,r=!0),r}getTargetCount(e){return this.Wn(e).next(t=>t.targetCount)}getTargetData(e,t){const r=Yc(t),i=IDBKeyRange.bound([r,Number.NEGATIVE_INFINITY],[r,Number.POSITIVE_INFINITY]);let o=null;return Yh(e).Z({range:i,index:P6},(s,a,l)=>{const c=o_(a);Gg(t,c.target)&&(o=c,l.done())}).next(()=>o)}addMatchingKeys(e,t,r){const i=[],o=pl(e);return t.forEach(s=>{const a=vr(s.path);i.push(o.put({targetId:r,path:a})),i.push(this.referenceDelegate.addReference(e,r,s))}),N.waitFor(i)}removeMatchingKeys(e,t,r){const i=pl(e);return N.forEach(t,o=>{const s=vr(o.path);return N.waitFor([i.delete([r,s]),this.referenceDelegate.removeReference(e,r,o)])})}removeMatchingKeysForTargetId(e,t){const r=pl(e),i=IDBKeyRange.bound([t],[t+1],!1,!0);return r.delete(i)}getMatchingKeysForTargetId(e,t){const r=IDBKeyRange.bound([t],[t+1],!1,!0),i=pl(e);let o=Re();return i.Z({range:r,Y:!0},(s,a,l)=>{const c=Xo(s[1]),u=new te(c);o=o.add(u)}).next(()=>o)}containsKey(e,t){const r=vr(t.path),i=IDBKeyRange.bound([r],[v6(r)],!1,!0);let o=0;return pl(e).Z({index:T1,Y:!0,range:i},([s,a],l,c)=>{0!==s&&(o++,c.done())}).next(()=>o>0)}lt(e,t){return Yh(e).get(t).next(r=>r?o_(r):null)}}function Yh(n){return Un(n,Rh)}function A7(n){return Un(n,Gc)}function pl(n){return Un(n,Mh)}const R7="LruGarbageCollector";function k7([n,e],[t,r]){const i=Ee(n,t);return 0===i?Ee(e,r):i}class hMe{constructor(e){this.Hn=e,this.buffer=new dt(k7),this.Jn=0}Yn(){return++this.Jn}Zn(e){const t=[e,this.Yn()];if(this.buffer.sizeMath.floor(t/100*r))}nthSequenceNumber(e,t){if(0===t)return N.resolve(Ni.ae);const r=new hMe(t);return this.tr.forEachTarget(e,i=>r.Zn(i.sequenceNumber)).next(()=>this.tr.rr(e,i=>r.Zn(i))).next(()=>r.maxValue)}removeTargets(e,t,r){return this.tr.removeTargets(e,t,r)}removeOrphanedDocuments(e,t){return this.tr.removeOrphanedDocuments(e,t)}collect(e,t){return-1===this.params.cacheSizeCollectionThreshold?(z("LruGarbageCollector","Garbage collection skipped; disabled"),N.resolve(T7)):this.getCacheSize(e).next(r=>r(d>this.params.maximumSequenceNumbersToCollect?(z("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${d}`),i=this.params.maximumSequenceNumbersToCollect):i=d,s=Date.now(),this.nthSequenceNumber(e,i))).next(d=>(r=d,a=Date.now(),this.removeTargets(e,r,t))).next(d=>(o=d,l=Date.now(),this.removeOrphanedDocuments(e,r))).next(d=>(c=Date.now(),Ih()<=qe.DEBUG&&z("LruGarbageCollector",`LRU Garbage Collection\n\tCounted targets in ${s-u}ms\n\tDetermined least recently used ${i} in `+(a-s)+`ms\n\tRemoved ${o} targets in `+(l-a)+`ms\n\tRemoved ${d} documents in `+(c-l)+`ms\nTotal Duration: ${c-u}ms`),N.resolve({didRun:!0,sequenceNumbersCollected:i,targetsRemoved:o,documentsRemoved:d})))}}function P7(n,e){return new fMe(n,e)}class pMe{constructor(e,t){this.db=e,this.garbageCollector=P7(this,t)}nr(e){const t=this.sr(e);return this.db.getTargetCache().getTargetCount(e).next(r=>t.next(i=>r+i))}sr(e){let t=0;return this.rr(e,r=>{t++}).next(()=>t)}forEachTarget(e,t){return this.db.getTargetCache().forEachTarget(e,t)}rr(e,t){return this._r(e,(r,i)=>t(i))}addReference(e,t,r){return bI(e,r)}removeReference(e,t,r){return bI(e,r)}removeTargets(e,t,r){return this.db.getTargetCache().removeTargets(e,t,r)}markPotentiallyOrphaned(e,t){return bI(e,t)}ar(e,t){return function(i,o){let s=!1;return D7(i).X(a=>S7(i,a,o).next(l=>(l&&(s=!0),N.resolve(!l)))).next(()=>s)}(e,t)}removeOrphanedDocuments(e,t){const r=this.db.getRemoteDocumentCache().newChangeBuffer(),i=[];let o=0;return this._r(e,(s,a)=>{if(a<=t){const l=this.ar(e,s).next(c=>{if(!c)return o++,r.getEntry(e,s).next(()=>(r.removeEntry(s,le.min()),pl(e).delete([0,vr(s.path)])))});i.push(l)}}).next(()=>N.waitFor(i)).next(()=>r.apply(e)).next(()=>o)}removeTarget(e,t){const r=t.withSequenceNumber(e.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(e,r)}updateLimboDocument(e,t){return bI(e,t)}_r(e,t){const r=pl(e);let i,o=Ni.ae;return r.Z({index:T1},([s,a],{path:l,sequenceNumber:c})=>{0===s?(o!==Ni.ae&&t(new te(Xo(i)),o),o=c,i=l):o=Ni.ae}).next(()=>{o!==Ni.ae&&t(new te(Xo(i)),o)})}getCacheSize(e){return this.db.getRemoteDocumentCache().getSize(e)}}function bI(n,e){return pl(n).put((i=n.currentSequenceNumber,{targetId:0,path:vr(e.path),sequenceNumber:i}));var i}class O7{constructor(){this.changes=new Ks(e=>e.toString(),(e,t)=>e.isEqual(t)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,Lt.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();const r=this.changes.get(t);return void 0!==r?N.resolve(r):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}class mMe{constructor(e){this.serializer=e}setIndexManager(e){this.indexManager=e}addEntry(e,t,r){return ou(e).put(r)}removeEntry(e,t,r){return ou(e).delete(function(o,s){const a=o.path.toArray();return[a.slice(0,a.length-2),a[a.length-2],pI(s),a[a.length-1]]}(t,r))}updateMetadata(e,t){return this.getMetadata(e).next(r=>(r.byteSize+=t,this.ur(e,r)))}getEntry(e,t){let r=Lt.newInvalidDocument(t);return ou(e).Z({index:$E,range:IDBKeyRange.only(c_(t))},(i,o)=>{r=this.cr(t,o)}).next(()=>r)}lr(e,t){let r={size:0,document:Lt.newInvalidDocument(t)};return ou(e).Z({index:$E,range:IDBKeyRange.only(c_(t))},(i,o)=>{r={document:this.cr(t,o),size:yI(o)}}).next(()=>r)}getEntries(e,t){let r=ui();return this.hr(e,t,(i,o)=>{const s=this.cr(i,o);r=r.insert(i,s)}).next(()=>r)}Pr(e,t){let r=ui(),i=new Rt(te.comparator);return this.hr(e,t,(o,s)=>{const a=this.cr(o,s);r=r.insert(o,a),i=i.insert(o,yI(s))}).next(()=>({documents:r,Tr:i}))}hr(e,t,r){if(t.isEmpty())return N.resolve();let i=new dt(B7);t.forEach(l=>i=i.add(l));const o=IDBKeyRange.bound(c_(i.first()),c_(i.last())),s=i.getIterator();let a=s.getNext();return ou(e).Z({index:$E,range:o},(l,c,u)=>{const d=te.fromSegments([...c.prefixPath,c.collectionGroup,c.documentId]);for(;a&&B7(a,d)<0;)r(a,null),a=s.getNext();a&&a.isEqual(d)&&(r(a,c),a=s.hasNext()?s.getNext():null),a?u.W(c_(a)):u.done()}).next(()=>{for(;a;)r(a,null),a=s.hasNext()?s.getNext():null})}getDocumentsMatchingQuery(e,t,r,i,o){const s=t.path,a=[s.popLast().toArray(),s.lastSegment(),pI(r.readTime),r.documentKey.path.isEmpty()?"":r.documentKey.path.lastSegment()],l=[s.popLast().toArray(),s.lastSegment(),[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],""];return ou(e).G(IDBKeyRange.bound(a,l,!0)).next(c=>{o?.incrementDocumentReadCount(c.length);let u=ui();for(const d of c){const f=this.cr(te.fromSegments(d.prefixPath.concat(d.collectionGroup,d.documentId)),d);f.isFoundDocument()&&(Qg(t,f)||i.has(f.key))&&(u=u.insert(f.key,f))}return u})}getAllFromCollectionGroup(e,t,r,i){let o=ui();const s=V7(t,r),a=V7(t,Mi.max());return ou(e).Z({index:N6,range:IDBKeyRange.bound(s,a,!0)},(l,c,u)=>{const d=this.cr(te.fromSegments(c.prefixPath.concat(c.collectionGroup,c.documentId)),c);o=o.insert(d.key,d),o.size===i&&u.done()}).next(()=>o)}newChangeBuffer(e){return new gMe(this,!!e&&e.trackRemovals)}getSize(e){return this.getMetadata(e).next(t=>t.byteSize)}getMetadata(e){return L7(e).get(I1).next(t=>(se(!!t),t))}ur(e,t){return L7(e).put(I1,t)}cr(e,t){if(t){const r=function tMe(n,e){let t;if(e.document)t=function t7(n,e,t){const r=es(n,e.name),i=bn(e.updateTime),o=e.createTime?bn(e.createTime):le.min(),s=new ar({mapValue:{fields:e.fields}}),a=Lt.newFoundDocument(r,i,o,s);return t&&a.setHasCommittedMutations(),t?a.setHasCommittedMutations():a}(n.Tt,e.document,!!e.hasCommittedMutations);else if(e.noDocument){const r=te.fromSegments(e.noDocument.path),i=eu(e.noDocument.readTime);t=Lt.newNoDocument(r,i),e.hasCommittedMutations&&t.setHasCommittedMutations()}else{if(!e.unknownDocument)return ne();{const r=te.fromSegments(e.unknownDocument.path),i=eu(e.unknownDocument.version);t=Lt.newUnknownDocument(r,i)}}return e.readTime&&t.setReadTime(function(i){const o=new Yt(i[0],i[1]);return le.fromTimestamp(o)}(e.readTime)),t}(this.serializer,t);if(!r.isNoDocument()||!r.version.isEqual(le.min()))return r}return Lt.newInvalidDocument(e)}}function F7(n){return new mMe(n)}class gMe extends O7{constructor(e,t){super(),this.Ir=e,this.trackRemovals=t,this.Er=new Ks(r=>r.toString(),(r,i)=>r.isEqual(i))}applyChanges(e){const t=[];let r=0,i=new dt((o,s)=>Ee(o.canonicalString(),s.canonicalString()));return this.changes.forEach((o,s)=>{const a=this.Er.get(o);if(t.push(this.Ir.removeEntry(e,o,a.readTime)),s.isValidDocument()){const l=c7(this.Ir.serializer,s);i=i.add(o.path.popLast());const c=yI(l);r+=c-a.size,t.push(this.Ir.addEntry(e,o,l))}else if(r-=a.size,this.trackRemovals){const l=c7(this.Ir.serializer,s.convertToNoDocument(le.min()));t.push(this.Ir.addEntry(e,o,l))}}),i.forEach(o=>{t.push(this.Ir.indexManager.addToCollectionParentIndex(e,o))}),t.push(this.Ir.updateMetadata(e,r)),N.waitFor(t)}getFromCache(e,t){return this.Ir.lr(e,t).next(r=>(this.Er.set(t,{size:r.size,readTime:r.document.readTime}),r.document))}getAllFromCache(e,t){return this.Ir.Pr(e,t).next(({documents:r,Tr:i})=>(i.forEach((o,s)=>{this.Er.set(o,{size:s,readTime:r.get(o).readTime})}),r))}}function L7(n){return Un(n,Bg)}function ou(n){return Un(n,HE)}function c_(n){const e=n.path.toArray();return[e.slice(0,e.length-2),e[e.length-2],e[e.length-1]]}function V7(n,e){const t=e.documentKey.path.toArray();return[n,pI(e.readTime),t.slice(0,t.length-2),t.length>0?t[t.length-1]:""]}function B7(n,e){const t=n.path.toArray(),r=e.path.toArray();let i=0;for(let o=0;o(r=i,this.remoteDocumentCache.getEntry(e,t))).next(i=>(null!==r&&Jg(r.mutation,i,ci.empty(),Yt.now()),i))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(r=>this.getLocalViewOfDocuments(e,r,Re()).next(()=>r))}getLocalViewOfDocuments(e,t,r=Re()){const i=Jo();return this.populateOverlays(e,i,t).next(()=>this.computeViews(e,t,i,r).next(o=>{let s=Yg();return o.forEach((a,l)=>{s=s.insert(a,l.overlayedDocument)}),s}))}getOverlayedDocuments(e,t){const r=Jo();return this.populateOverlays(e,r,t).next(()=>this.computeViews(e,t,r,Re()))}populateOverlays(e,t,r){const i=[];return r.forEach(o=>{t.has(o)||i.push(o)}),this.documentOverlayCache.getOverlays(e,i).next(o=>{o.forEach((s,a)=>{t.set(s,a)})})}computeViews(e,t,r,i){let o=ui();const s=Xg(),a=Xg();return t.forEach((l,c)=>{const u=r.get(c.key);i.has(c.key)&&(void 0===u||u.mutation instanceof Qs)?o=o.insert(c.key,c):void 0!==u?(s.set(c.key,u.mutation.getFieldMask()),Jg(u.mutation,c,u.mutation.getFieldMask(),Yt.now())):s.set(c.key,ci.empty())}),this.recalculateAndSaveOverlays(e,o).next(l=>(l.forEach((c,u)=>s.set(c,u)),t.forEach((c,u)=>{var d;return a.set(c,new _Me(u,null!==(d=s.get(c))&&void 0!==d?d:null))}),a))}recalculateAndSaveOverlays(e,t){const r=Xg();let i=new Rt((s,a)=>s-a),o=Re();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(s=>{for(const a of s)a.keys().forEach(l=>{const c=t.get(l);if(null===c)return;let u=r.get(l)||ci.empty();u=a.applyToLocalView(c,u),r.set(l,u);const d=(i.get(a.batchId)||Re()).add(l);i=i.insert(a.batchId,d)})}).next(()=>{const s=[],a=i.getReverseIterator();for(;a.hasNext();){const l=a.getNext(),c=l.key,u=l.value,d=x9();u.forEach(f=>{if(!o.has(f)){const p=P9(t.get(f),r.get(f));null!==p&&d.set(f,p),o=o.add(f)}}),s.push(this.documentOverlayCache.saveOverlays(e,c,d))}return N.waitFor(s)}).next(()=>r)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(r=>this.recalculateAndSaveOverlays(e,r))}getDocumentsMatchingQuery(e,t,r,i){return te.isDocumentKey((s=t).path)&&null===s.collectionGroup&&0===s.filters.length?this.getDocumentsMatchingDocumentQuery(e,t.path):function B1(n){return null!==n.collectionGroup}(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,r,i):this.getDocumentsMatchingCollectionQuery(e,t,r,i);var s}getNextDocuments(e,t,r,i){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,r,i).next(o=>{const s=i-o.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,r.largestBatchId,i-o.size):N.resolve(Jo());let a=-1,l=o;return s.next(c=>N.forEach(c,(u,d)=>(a{l=l.insert(u,f)}))).next(()=>this.populateOverlays(e,c,o)).next(()=>this.computeViews(e,l,c,Re())).next(u=>({batchId:a,changes:C9(u)})))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new te(t)).next(r=>{let i=Yg();return r.isFoundDocument()&&(i=i.insert(r.key,r)),i})}getDocumentsMatchingCollectionGroupQuery(e,t,r,i){const o=t.collectionGroup;let s=Yg();return this.indexManager.getCollectionParents(e,o).next(a=>N.forEach(a,l=>{const c=(d=t,f=l.child(o),new Gs(f,null,d.explicitOrderBy.slice(),d.filters.slice(),d.limit,d.limitType,d.startAt,d.endAt));var d,f;return this.getDocumentsMatchingCollectionQuery(e,c,r,i).next(u=>{u.forEach((d,f)=>{s=s.insert(d,f)})})}).next(()=>s))}getDocumentsMatchingCollectionQuery(e,t,r,i){let o;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,r.largestBatchId).next(s=>(o=s,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,r,o,i))).next(s=>{o.forEach((l,c)=>{const u=c.getKey();null===s.get(u)&&(s=s.insert(u,Lt.newInvalidDocument(u)))});let a=Yg();return s.forEach((l,c)=>{const u=o.get(l);void 0!==u&&Jg(u.mutation,c,ci.empty(),Yt.now()),Qg(t,c)&&(a=a.insert(l,c))}),a})}}class yMe{constructor(e){this.serializer=e,this.dr=new Map,this.Ar=new Map}getBundleMetadata(e,t){return N.resolve(this.dr.get(t))}saveBundleMetadata(e,t){return this.dr.set(t.id,{id:(i=t).id,version:i.version,createTime:bn(i.createTime)}),N.resolve();var i}getNamedQuery(e,t){return N.resolve(this.Ar.get(t))}saveNamedQuery(e,t){return this.Ar.set(t.name,{name:(i=t).name,query:J1(i.bundledQuery),readTime:bn(i.readTime)}),N.resolve();var i}}class vMe{constructor(){this.overlays=new Rt(te.comparator),this.Rr=new Map}getOverlay(e,t){return N.resolve(this.overlays.get(t))}getOverlays(e,t){const r=Jo();return N.forEach(t,i=>this.getOverlay(e,i).next(o=>{null!==o&&r.set(i,o)})).next(()=>r)}saveOverlays(e,t,r){return r.forEach((i,o)=>{this.Et(e,t,o)}),N.resolve()}removeOverlaysForBatchId(e,t,r){const i=this.Rr.get(r);return void 0!==i&&(i.forEach(o=>this.overlays=this.overlays.remove(o)),this.Rr.delete(r)),N.resolve()}getOverlaysForCollection(e,t,r){const i=Jo(),o=t.length+1,s=new te(t.child("")),a=this.overlays.getIteratorFrom(s);for(;a.hasNext();){const l=a.getNext().value,c=l.getKey();if(!t.isPrefixOf(c.path))break;c.path.length===o&&l.largestBatchId>r&&i.set(l.getKey(),l)}return N.resolve(i)}getOverlaysForCollectionGroup(e,t,r,i){let o=new Rt((c,u)=>c-u);const s=this.overlays.getIterator();for(;s.hasNext();){const c=s.getNext().value;if(c.getKey().getCollectionGroup()===t&&c.largestBatchId>r){let u=o.get(c.largestBatchId);null===u&&(u=Jo(),o=o.insert(c.largestBatchId,u)),u.set(c.getKey(),c)}}const a=Jo(),l=o.getIterator();for(;l.hasNext()&&(l.getNext().value.forEach((c,u)=>a.set(c,u)),!(a.size()>=i)););return N.resolve(a)}Et(e,t,r){const i=this.overlays.get(r.key);if(null!==i){const s=this.Rr.get(i.largestBatchId).delete(r.key);this.Rr.set(i.largestBatchId,s)}this.overlays=this.overlays.insert(r.key,new W1(t,r));let o=this.Rr.get(t);void 0===o&&(o=Re(),this.Rr.set(t,o)),this.Rr.set(t,o.add(r.key))}}class bMe{constructor(){this.sessionToken=ln.EMPTY_BYTE_STRING}getSessionToken(e){return N.resolve(this.sessionToken)}setSessionToken(e,t){return this.sessionToken=t,N.resolve()}}class sN{constructor(){this.Vr=new dt(Xn.mr),this.gr=new dt(Xn.pr)}isEmpty(){return this.Vr.isEmpty()}addReference(e,t){const r=new Xn(e,t);this.Vr=this.Vr.add(r),this.gr=this.gr.add(r)}yr(e,t){e.forEach(r=>this.addReference(r,t))}removeReference(e,t){this.wr(new Xn(e,t))}Sr(e,t){e.forEach(r=>this.removeReference(r,t))}br(e){const t=new te(new We([])),r=new Xn(t,e),i=new Xn(t,e+1),o=[];return this.gr.forEachInRange([r,i],s=>{this.wr(s),o.push(s.key)}),o}Dr(){this.Vr.forEach(e=>this.wr(e))}wr(e){this.Vr=this.Vr.delete(e),this.gr=this.gr.delete(e)}vr(e){const t=new te(new We([])),r=new Xn(t,e),i=new Xn(t,e+1);let o=Re();return this.gr.forEachInRange([r,i],s=>{o=o.add(s.key)}),o}containsKey(e){const t=new Xn(e,0),r=this.Vr.firstAfterOrEqual(t);return null!==r&&e.isEqual(r.key)}}class Xn{constructor(e,t){this.key=e,this.Cr=t}static mr(e,t){return te.comparator(e.key,t.key)||Ee(e.Cr,t.Cr)}static pr(e,t){return Ee(e.Cr,t.Cr)||te.comparator(e.key,t.key)}}class wMe{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.Fr=1,this.Mr=new dt(Xn.mr)}checkEmpty(e){return N.resolve(0===this.mutationQueue.length)}addMutationBatch(e,t,r,i){const o=this.Fr;this.Fr++;const s=new $1(o,t,r,i);this.mutationQueue.push(s);for(const a of i)this.Mr=this.Mr.add(new Xn(a.key,o)),this.indexManager.addToCollectionParentIndex(e,a.key.path.popLast());return N.resolve(s)}lookupMutationBatch(e,t){return N.resolve(this.Or(t))}getNextMutationBatchAfterBatchId(e,t){const i=this.Nr(t+1),o=i<0?0:i;return N.resolve(this.mutationQueue.length>o?this.mutationQueue[o]:null)}getHighestUnacknowledgedBatchId(){return N.resolve(0===this.mutationQueue.length?-1:this.Fr-1)}getAllMutationBatches(e){return N.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){const r=new Xn(t,0),i=new Xn(t,Number.POSITIVE_INFINITY),o=[];return this.Mr.forEachInRange([r,i],s=>{const a=this.Or(s.Cr);o.push(a)}),N.resolve(o)}getAllMutationBatchesAffectingDocumentKeys(e,t){let r=new dt(Ee);return t.forEach(i=>{const o=new Xn(i,0),s=new Xn(i,Number.POSITIVE_INFINITY);this.Mr.forEachInRange([o,s],a=>{r=r.add(a.Cr)})}),N.resolve(this.Br(r))}getAllMutationBatchesAffectingQuery(e,t){const r=t.path,i=r.length+1;let o=r;te.isDocumentKey(o)||(o=o.child(""));const s=new Xn(new te(o),0);let a=new dt(Ee);return this.Mr.forEachWhile(l=>{const c=l.key.path;return!!r.isPrefixOf(c)&&(c.length===i&&(a=a.add(l.Cr)),!0)},s),N.resolve(this.Br(a))}Br(e){const t=[];return e.forEach(r=>{const i=this.Or(r);null!==i&&t.push(i)}),t}removeMutationBatch(e,t){se(0===this.Lr(t.batchId,"removed")),this.mutationQueue.shift();let r=this.Mr;return N.forEach(t.mutations,i=>{const o=new Xn(i.key,t.batchId);return r=r.delete(o),this.referenceDelegate.markPotentiallyOrphaned(e,i.key)}).next(()=>{this.Mr=r})}qn(e){}containsKey(e,t){const r=new Xn(t,0),i=this.Mr.firstAfterOrEqual(r);return N.resolve(t.isEqual(i&&i.key))}performConsistencyCheck(e){return N.resolve()}Lr(e,t){return this.Nr(e)}Nr(e){return 0===this.mutationQueue.length?0:e-this.mutationQueue[0].batchId}Or(e){const t=this.Nr(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}}class EMe{constructor(e){this.kr=e,this.docs=new Rt(te.comparator),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){const r=t.key,i=this.docs.get(r),o=i?i.size:0,s=this.kr(t);return this.docs=this.docs.insert(r,{document:t.mutableCopy(),size:s}),this.size+=s-o,this.indexManager.addToCollectionParentIndex(e,r.path.popLast())}removeEntry(e){const t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){const r=this.docs.get(t);return N.resolve(r?r.document.mutableCopy():Lt.newInvalidDocument(t))}getEntries(e,t){let r=ui();return t.forEach(i=>{const o=this.docs.get(i);r=r.insert(i,o?o.document.mutableCopy():Lt.newInvalidDocument(i))}),N.resolve(r)}getDocumentsMatchingQuery(e,t,r,i){let o=ui();const s=t.path,a=new te(s.child("__id-9223372036854775808__")),l=this.docs.getIteratorFrom(a);for(;l.hasNext();){const{key:c,value:{document:u}}=l.getNext();if(!s.isPrefixOf(c.path))break;c.path.length>s.length+1||b1(I6(u),r)<=0||(i.has(u.key)||Qg(t,u))&&(o=o.insert(u.key,u.mutableCopy()))}return N.resolve(o)}getAllFromCollectionGroup(e,t,r,i){ne()}qr(e,t){return N.forEach(this.docs,r=>t(r))}newChangeBuffer(e){return new IMe(this)}getSize(e){return N.resolve(this.size)}}class IMe extends O7{constructor(e){super(),this.Ir=e}applyChanges(e){const t=[];return this.changes.forEach((r,i)=>{i.isValidDocument()?t.push(this.Ir.addEntry(e,i)):this.Ir.removeEntry(r)}),N.waitFor(t)}getFromCache(e,t){return this.Ir.getEntry(e,t)}getAllFromCache(e,t){return this.Ir.getEntries(e,t)}}class TMe{constructor(e){this.persistence=e,this.Qr=new Ks(t=>Yc(t),Gg),this.lastRemoteSnapshotVersion=le.min(),this.highestTargetId=0,this.$r=0,this.Kr=new sN,this.targetCount=0,this.Ur=iu.Kn()}forEachTarget(e,t){return this.Qr.forEach((r,i)=>t(i)),N.resolve()}getLastRemoteSnapshotVersion(e){return N.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return N.resolve(this.$r)}allocateTargetId(e){return this.highestTargetId=this.Ur.next(),N.resolve(this.highestTargetId)}setTargetsMetadata(e,t,r){return r&&(this.lastRemoteSnapshotVersion=r),t>this.$r&&(this.$r=t),N.resolve()}zn(e){this.Qr.set(e.target,e);const t=e.targetId;t>this.highestTargetId&&(this.Ur=new iu(t),this.highestTargetId=t),e.sequenceNumber>this.$r&&(this.$r=e.sequenceNumber)}addTargetData(e,t){return this.zn(t),this.targetCount+=1,N.resolve()}updateTargetData(e,t){return this.zn(t),N.resolve()}removeTargetData(e,t){return this.Qr.delete(t.target),this.Kr.br(t.targetId),this.targetCount-=1,N.resolve()}removeTargets(e,t,r){let i=0;const o=[];return this.Qr.forEach((s,a)=>{a.sequenceNumber<=t&&null===r.get(a.targetId)&&(this.Qr.delete(s),o.push(this.removeMatchingKeysForTargetId(e,a.targetId)),i++)}),N.waitFor(o).next(()=>i)}getTargetCount(e){return N.resolve(this.targetCount)}getTargetData(e,t){const r=this.Qr.get(t)||null;return N.resolve(r)}addMatchingKeys(e,t,r){return this.Kr.yr(t,r),N.resolve()}removeMatchingKeys(e,t,r){this.Kr.Sr(t,r);const i=this.persistence.referenceDelegate,o=[];return i&&t.forEach(s=>{o.push(i.markPotentiallyOrphaned(e,s))}),N.waitFor(o)}removeMatchingKeysForTargetId(e,t){return this.Kr.br(t),N.resolve()}getMatchingKeysForTargetId(e,t){const r=this.Kr.vr(t);return N.resolve(r)}containsKey(e,t){return N.resolve(this.Kr.containsKey(t))}}class aN{constructor(e,t){this.Wr={},this.overlays={},this.Gr=new Ni(0),this.zr=!1,this.zr=!0,this.jr=new bMe,this.referenceDelegate=e(this),this.Hr=new TMe(this),this.indexManager=new cMe,this.remoteDocumentCache=new EMe(r=>this.referenceDelegate.Jr(r)),this.serializer=new l7(t),this.Yr=new yMe(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.zr=!1,Promise.resolve()}get started(){return this.zr}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new vMe,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let r=this.Wr[e.toKey()];return r||(r=new wMe(t,this.referenceDelegate),this.Wr[e.toKey()]=r),r}getGlobalsCache(){return this.jr}getTargetCache(){return this.Hr}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Yr}runTransaction(e,t,r){z("MemoryPersistence","Starting transaction:",e);const i=new CMe(this.Gr.next());return this.referenceDelegate.Zr(),r(i).next(o=>this.referenceDelegate.Xr(i).next(()=>o)).toPromise().then(o=>(i.raiseOnCommittedEvent(),o))}ei(e,t){return N.or(Object.values(this.Wr).map(r=>()=>r.containsKey(e,t)))}}class CMe extends C6{constructor(e){super(),this.currentSequenceNumber=e}}class wI{constructor(e){this.persistence=e,this.ti=new sN,this.ni=null}static ri(e){return new wI(e)}get ii(){if(this.ni)return this.ni;throw ne()}addReference(e,t,r){return this.ti.addReference(r,t),this.ii.delete(r.toString()),N.resolve()}removeReference(e,t,r){return this.ti.removeReference(r,t),this.ii.add(r.toString()),N.resolve()}markPotentiallyOrphaned(e,t){return this.ii.add(t.toString()),N.resolve()}removeTarget(e,t){this.ti.br(t.targetId).forEach(i=>this.ii.add(i.toString()));const r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,t.targetId).next(i=>{i.forEach(o=>this.ii.add(o.toString()))}).next(()=>r.removeTargetData(e,t))}Zr(){this.ni=new Set}Xr(e){const t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return N.forEach(this.ii,r=>{const i=te.fromPath(r);return this.si(e,i).next(o=>{o||t.removeEntry(i,le.min())})}).next(()=>(this.ni=null,t.apply(e)))}updateLimboDocument(e,t){return this.si(e,t).next(r=>{r?this.ii.delete(t.toString()):this.ii.add(t.toString())})}Jr(e){return 0}si(e,t){return N.or([()=>N.resolve(this.ti.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.ei(e,t)])}}class EI{constructor(e,t){this.persistence=e,this.oi=new Ks(r=>vr(r.path),(r,i)=>r.isEqual(i)),this.garbageCollector=P7(this,t)}static ri(e,t){return new EI(e,t)}Zr(){}Xr(e){return N.resolve()}forEachTarget(e,t){return this.persistence.getTargetCache().forEachTarget(e,t)}nr(e){const t=this.sr(e);return this.persistence.getTargetCache().getTargetCount(e).next(r=>t.next(i=>r+i))}sr(e){let t=0;return this.rr(e,r=>{t++}).next(()=>t)}rr(e,t){return N.forEach(this.oi,(r,i)=>this.ar(e,r,i).next(o=>o?N.resolve():t(i)))}removeTargets(e,t,r){return this.persistence.getTargetCache().removeTargets(e,t,r)}removeOrphanedDocuments(e,t){let r=0;const i=this.persistence.getRemoteDocumentCache(),o=i.newChangeBuffer();return i.qr(e,s=>this.ar(e,s,t).next(a=>{a||(r++,o.removeEntry(s,le.min()))})).next(()=>o.apply(e)).next(()=>r)}markPotentiallyOrphaned(e,t){return this.oi.set(t,e.currentSequenceNumber),N.resolve()}removeTarget(e,t){const r=t.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,r)}addReference(e,t,r){return this.oi.set(r,e.currentSequenceNumber),N.resolve()}removeReference(e,t,r){return this.oi.set(r,e.currentSequenceNumber),N.resolve()}updateLimboDocument(e,t){return this.oi.set(t,e.currentSequenceNumber),N.resolve()}Jr(e){let t=e.key.toString().length;return e.isFoundDocument()&&(t+=tI(e.data.value)),t}ar(e,t,r){return N.or([()=>this.persistence.ei(e,t),()=>this.persistence.getTargetCache().containsKey(e,t),()=>{const i=this.oi.get(t);return N.resolve(void 0!==i&&i>r)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}class xMe{constructor(e){this.serializer=e}B(e,t,r,i){const o=new UE("createOrUpgrade",t);var l;r<1&&i>=1&&(e.createObjectStore(Lg),(l=e).createObjectStore(Vg,{keyPath:"userId"}),l.createObjectStore(wo,{keyPath:R6,autoIncrement:!0}).createIndex(Wc,M6,{unique:!0}),l.createObjectStore(Ah),z7(e),function(l){l.createObjectStore(qc)}(e));let s=N.resolve();return r<3&&i>=3&&(0!==r&&(function(l){l.deleteObjectStore(Mh),l.deleteObjectStore(Rh),l.deleteObjectStore(Gc)}(e),z7(e)),s=s.next(()=>function(l){const c=l.store(Gc),u={highestTargetId:0,highestListenSequenceNumber:0,lastRemoteSnapshotVersion:le.min().toTimestamp(),targetCount:0};return c.put(qE,u)}(o))),r<4&&i>=4&&(0!==r&&(s=s.next(()=>function(l,c){return c.store(wo).G().next(d=>{l.deleteObjectStore(wo),l.createObjectStore(wo,{keyPath:R6,autoIncrement:!0}).createIndex(Wc,M6,{unique:!0});const f=c.store(wo),p=d.map(m=>f.put(m));return N.waitFor(p)})}(e,o))),s=s.next(()=>{!function(l){l.createObjectStore(kh,{keyPath:"clientId"})}(e)})),r<5&&i>=5&&(s=s.next(()=>this._i(o))),r<6&&i>=6&&(s=s.next(()=>(function(l){l.createObjectStore(Bg)}(e),this.ai(o)))),r<7&&i>=7&&(s=s.next(()=>this.ui(o))),r<8&&i>=8&&(s=s.next(()=>this.ci(e,o))),r<9&&i>=9&&(s=s.next(()=>{!function(l){l.objectStoreNames.contains("remoteDocumentChanges")&&l.deleteObjectStore("remoteDocumentChanges")}(e)})),r<10&&i>=10&&(s=s.next(()=>this.li(o))),r<11&&i>=11&&(s=s.next(()=>{(function(l){l.createObjectStore(WE,{keyPath:"bundleId"})})(e),function(l){l.createObjectStore(GE,{keyPath:"name"})}(e)})),r<12&&i>=12&&(s=s.next(()=>{!function(l){const c=l.createObjectStore(YE,{keyPath:cRe});c.createIndex(S1,uRe,{unique:!1}),c.createIndex(L6,dRe,{unique:!1})}(e)})),r<13&&i>=13&&(s=s.next(()=>function(l){const c=l.createObjectStore(HE,{keyPath:GAe});c.createIndex($E,KAe),c.createIndex(N6,QAe)}(e)).next(()=>this.hi(e,o)).next(()=>e.deleteObjectStore(qc))),r<14&&i>=14&&(s=s.next(()=>this.Pi(e,o))),r<15&&i>=15&&(s=s.next(()=>function(l){l.createObjectStore(C1,{keyPath:"indexId",autoIncrement:!0}).createIndex(x1,"collectionGroup",{unique:!1}),l.createObjectStore(KE,{keyPath:oRe}).createIndex(O6,sRe,{unique:!1}),l.createObjectStore(QE,{keyPath:aRe}).createIndex(F6,lRe,{unique:!1})}(e))),r<16&&i>=16&&(s=s.next(()=>{t.objectStore(KE).clear()}).next(()=>{t.objectStore(QE).clear()})),r<17&&i>=17&&(s=s.next(()=>{!function(l){l.createObjectStore(D1,{keyPath:"name"})}(e)})),s}ai(e){let t=0;return e.store(qc).Z((r,i)=>{t+=yI(i)}).next(()=>{const r={byteSize:t};return e.store(Bg).put(I1,r)})}_i(e){const t=e.store(Vg),r=e.store(wo);return t.G().next(i=>N.forEach(i,o=>{const s=IDBKeyRange.bound([o.userId,-1],[o.userId,o.lastAcknowledgedBatchId]);return r.G(Wc,s).next(a=>N.forEach(a,l=>{se(l.userId===o.userId);const c=tu(this.serializer,l);return x7(e,o.userId,c).next(()=>{})}))}))}ui(e){const t=e.store(Mh),r=e.store(qc);return e.store(Gc).get(qE).next(i=>{const o=[];return r.Z((s,a)=>{const l=new We(s),c=[0,vr(l)];o.push(t.get(c).next(u=>u?N.resolve():t.put({targetId:0,path:vr(l),sequenceNumber:i.highestListenSequenceNumber})))}).next(()=>N.waitFor(o))})}ci(e,t){e.createObjectStore(Ug,{keyPath:JAe});const r=t.store(Ug),i=new oN,o=s=>{if(i.add(s)){const a=s.lastSegment(),l=s.popLast();return r.put({collectionId:a,parent:vr(l)})}};return t.store(qc).Z({Y:!0},(s,a)=>{const l=new We(s);return o(l.popLast())}).next(()=>t.store(Ah).Z({Y:!0},([s,a,l],c)=>{const u=Xo(a);return o(u.popLast())}))}li(e){const t=e.store(Rh);return t.Z((r,i)=>{const o=o_(i),s=u7(this.serializer,o);return t.put(s)})}hi(e,t){const r=t.store(qc),i=[];return r.Z((o,s)=>{const a=t.store(HE),l=(d=s,d.document?new te(We.fromString(d.document.name).popFirst(5)):d.noDocument?te.fromSegments(d.noDocument.path):d.unknownDocument?te.fromSegments(d.unknownDocument.path):ne()).path.toArray(),c={prefixPath:l.slice(0,l.length-2),collectionGroup:l[l.length-2],documentId:l[l.length-1],readTime:s.readTime||[0,0],unknownDocument:s.unknownDocument,noDocument:s.noDocument,document:s.document,hasCommittedMutations:!!s.hasCommittedMutations};var d;i.push(a.put(c))}).next(()=>N.waitFor(i))}Pi(e,t){const r=t.store(wo),i=F7(this.serializer),o=new aN(wI.ri,this.serializer.Tt);return r.G().next(s=>{const a=new Map;return s.forEach(l=>{var c;let u=null!==(c=a.get(l.userId))&&void 0!==c?c:Re();tu(this.serializer,l).keys().forEach(d=>u=u.add(d)),a.set(l.userId,u)}),N.forEach(a,(l,c)=>{const u=new Qn(c),d=mI.It(this.serializer,u),f=o.getIndexManager(u),p=vI.It(u,this.serializer,f,o.referenceDelegate);return new U7(i,p,d,f).recalculateAndSaveOverlaysForDocumentKeys(new R1(t,Ni.ae),l).next()})})}}function z7(n){n.createObjectStore(Mh,{keyPath:XAe}).createIndex(T1,ZAe,{unique:!0}),n.createObjectStore(Rh,{keyPath:"targetId"}).createIndex(P6,YAe,{unique:!0}),n.createObjectStore(Gc)}const ml="IndexedDbPersistence",lN=18e5,uN="Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.";class dN{constructor(e,t,r,i,o,s,a,l,c,u,d=17){if(this.allowTabSynchronization=e,this.persistenceKey=t,this.clientId=r,this.Ti=o,this.window=s,this.document=a,this.Ii=c,this.Ei=u,this.di=d,this.Gr=null,this.zr=!1,this.isPrimary=!1,this.networkEnabled=!0,this.Ai=null,this.inForeground=!1,this.Ri=null,this.Vi=null,this.mi=Number.NEGATIVE_INFINITY,this.fi=f=>Promise.resolve(),!dN.D())throw new j(F.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new pMe(this,i),this.gi=t+"main",this.serializer=new l7(l),this.pi=new Yo(this.gi,this.di,new xMe(this.serializer)),this.jr=new rMe,this.Hr=new dMe(this.referenceDelegate,this.serializer),this.remoteDocumentCache=F7(this.serializer),this.Yr=new nMe,this.window&&this.window.localStorage?this.yi=this.window.localStorage:(this.yi=null,!1===u&&vn(ml,"LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}start(){return this.wi().then(()=>{if(!this.isPrimary&&!this.allowTabSynchronization)throw new j(F.FAILED_PRECONDITION,uN);return this.Si(),this.bi(),this.Di(),this.runTransaction("getHighestListenSequenceNumber","readonly",e=>this.Hr.getHighestSequenceNumber(e))}).then(e=>{this.Gr=new Ni(e,this.Ii)}).then(()=>{this.zr=!0}).catch(e=>(this.pi&&this.pi.close(),Promise.reject(e)))}Ci(e){var t=this;return this.fi=function(){var r=T(function*(i){if(t.started)return e(i)});return function(i){return r.apply(this,arguments)}}(),e(this.isPrimary)}setDatabaseDeletedListener(e){this.pi.k(function(){var t=T(function*(r){null===r.newVersion&&(yield e())});return function(r){return t.apply(this,arguments)}}())}setNetworkEnabled(e){var t=this;this.networkEnabled!==e&&(this.networkEnabled=e,this.Ti.enqueueAndForget(T(function*(){t.started&&(yield t.wi())})))}wi(){return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",e=>II(e).put({clientId:this.clientId,updateTimeMs:Date.now(),networkEnabled:this.networkEnabled,inForeground:this.inForeground}).next(()=>{if(this.isPrimary)return this.Fi(e).next(t=>{t||(this.isPrimary=!1,this.Ti.enqueueRetryable(()=>this.fi(!1)))})}).next(()=>this.Mi(e)).next(t=>this.isPrimary&&!t?this.xi(e).next(()=>!1):!!t&&this.Oi(e).next(()=>!0))).catch(e=>{if(il(e))return z(ml,"Failed to extend owner lease: ",e),this.isPrimary;if(!this.allowTabSynchronization)throw e;return z(ml,"Releasing owner lease after error during lease refresh",e),!1}).then(e=>{this.isPrimary!==e&&this.Ti.enqueueRetryable(()=>this.fi(e)),this.isPrimary=e})}Fi(e){return u_(e).get(Dh).next(t=>N.resolve(this.Ni(t)))}Bi(e){return II(e).delete(this.clientId)}Li(){var e=this;return T(function*(){if(e.isPrimary&&!e.ki(e.mi,lN)){e.mi=Date.now();const t=yield e.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",r=>{const i=Un(r,kh);return i.G().next(o=>{const s=e.qi(o,lN),a=o.filter(l=>-1===s.indexOf(l));return N.forEach(a,l=>i.delete(l.clientId)).next(()=>a)})}).catch(()=>[]);if(e.yi)for(const r of t)e.yi.removeItem(e.Qi(r.clientId))}})()}Di(){this.Vi=this.Ti.enqueueAfterDelay("client_metadata_refresh",4e3,()=>this.wi().then(()=>this.Li()).then(()=>this.Di()))}Ni(e){return!!e&&e.ownerId===this.clientId}Mi(e){return this.Ei?N.resolve(!0):u_(e).get(Dh).next(t=>{if(null!==t&&this.ki(t.leaseTimestampMs,5e3)&&!this.$i(t.ownerId)){if(this.Ni(t)&&this.networkEnabled)return!0;if(!this.Ni(t)){if(!t.allowTabSynchronization)throw new j(F.FAILED_PRECONDITION,uN);return!1}}return!(!this.networkEnabled||!this.inForeground)||II(e).G().next(r=>void 0===this.qi(r,5e3).find(i=>!(this.clientId===i.clientId||!(!this.networkEnabled&&i.networkEnabled||!this.inForeground&&i.inForeground&&this.networkEnabled===i.networkEnabled))))}).next(t=>(this.isPrimary!==t&&z(ml,`Client ${t?"is":"is not"} eligible for a primary lease.`),t))}shutdown(){var e=this;return T(function*(){e.zr=!1,e.Ki(),e.Vi&&(e.Vi.cancel(),e.Vi=null),e.Ui(),e.Wi(),yield e.pi.runTransaction("shutdown","readwrite",[Lg,kh],t=>{const r=new R1(t,Ni.ae);return e.xi(r).next(()=>e.Bi(r))}),e.pi.close(),e.Gi()})()}qi(e,t){return e.filter(r=>this.ki(r.updateTimeMs,t)&&!this.$i(r.clientId))}zi(){return this.runTransaction("getActiveClients","readonly",e=>II(e).G().next(t=>this.qi(t,lN).map(r=>r.clientId)))}get started(){return this.zr}getGlobalsCache(){return this.jr}getMutationQueue(e,t){return vI.It(e,this.serializer,t,this.referenceDelegate)}getTargetCache(){return this.Hr}getRemoteDocumentCache(){return this.remoteDocumentCache}getIndexManager(e){return new uMe(e,this.serializer.Tt.databaseId)}getDocumentOverlayCache(e){return mI.It(this.serializer,e)}getBundleCache(){return this.Yr}runTransaction(e,t,r){z(ml,"Starting transaction:",e);const i="readonly"===t?"readonly":"readwrite",o=17===(l=this.di)?mRe:16===l?pRe:15===l?A1:14===l?U6:13===l?B6:12===l?fRe:11===l?V6:void ne();var l;let s;return this.pi.runTransaction(e,i,o,a=>(s=new R1(a,this.Gr?this.Gr.next():Ni.ae),"readwrite-primary"===t?this.Fi(s).next(l=>!!l||this.Mi(s)).next(l=>{if(!l)throw vn(`Failed to obtain primary lease for action '${e}'.`),this.isPrimary=!1,this.Ti.enqueueRetryable(()=>this.fi(!1)),new j(F.FAILED_PRECONDITION,T6);return r(s)}).next(l=>this.Oi(s).next(()=>l)):this.ji(s).next(()=>r(s)))).then(a=>(s.raiseOnCommittedEvent(),a))}ji(e){return u_(e).get(Dh).next(t=>{if(null!==t&&this.ki(t.leaseTimestampMs,5e3)&&!this.$i(t.ownerId)&&!this.Ni(t)&&!(this.Ei||this.allowTabSynchronization&&t.allowTabSynchronization))throw new j(F.FAILED_PRECONDITION,uN)})}Oi(e){const t={ownerId:this.clientId,allowTabSynchronization:this.allowTabSynchronization,leaseTimestampMs:Date.now()};return u_(e).put(Dh,t)}static D(){return Yo.D()}xi(e){const t=u_(e);return t.get(Dh).next(r=>this.Ni(r)?(z(ml,"Releasing primary lease."),t.delete(Dh)):N.resolve())}ki(e,t){const r=Date.now();return!(er&&(vn(`Detected an update time that is in the future: ${e} > ${r}`),1))}Si(){null!==this.document&&"function"==typeof this.document.addEventListener&&(this.Ri=()=>{this.Ti.enqueueAndForget(()=>(this.inForeground="visible"===this.document.visibilityState,this.wi()))},this.document.addEventListener("visibilitychange",this.Ri),this.inForeground="visible"===this.document.visibilityState)}Ui(){this.Ri&&(this.document.removeEventListener("visibilitychange",this.Ri),this.Ri=null)}bi(){var e;"function"==typeof(null===(e=this.window)||void 0===e?void 0:e.addEventListener)&&(this.Ai=()=>{this.Ki();const t=/(?:Version|Mobile)\/1[456]/;JW()&&(navigator.appVersion.match(t)||navigator.userAgent.match(t))&&this.Ti.enterRestrictedMode(!0),this.Ti.enqueueAndForget(()=>this.shutdown())},this.window.addEventListener("pagehide",this.Ai))}Wi(){this.Ai&&(this.window.removeEventListener("pagehide",this.Ai),this.Ai=null)}$i(e){var t;try{const r=null!==(null===(t=this.yi)||void 0===t?void 0:t.getItem(this.Qi(e)));return z(ml,`Client '${e}' ${r?"is":"is not"} zombied in LocalStorage`),r}catch(r){return vn(ml,"Failed to get zombied client id.",r),!1}}Ki(){if(this.yi)try{this.yi.setItem(this.Qi(this.clientId),String(Date.now()))}catch(e){vn("Failed to set zombie client id.",e)}}Gi(){if(this.yi)try{this.yi.removeItem(this.Qi(this.clientId))}catch{}}Qi(e){return`firestore_zombie_${this.persistenceKey}_${e}`}}function u_(n){return Un(n,Lg)}function II(n){return Un(n,kh)}class fN{constructor(e,t,r,i){this.targetId=e,this.fromCache=t,this.Hi=r,this.Ji=i}static Yi(e,t){let r=Re(),i=Re();for(const o of t.docChanges)switch(o.type){case 0:r=r.add(o.doc.key);break;case 1:i=i.add(o.doc.key)}return new fN(e,t.fromCache,r,i)}}class SMe{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}class H7{constructor(){this.Zi=!1,this.Xi=!1,this.es=100,this.ts=JW()?8:x6(_n())>0?6:4}initialize(e,t){this.ns=e,this.indexManager=t,this.Zi=!0}getDocumentsMatchingQuery(e,t,r,i){const o={result:null};return this.rs(e,t).next(s=>{o.result=s}).next(()=>{if(!o.result)return this.ss(e,t,i,r).next(s=>{o.result=s})}).next(()=>{if(o.result)return;const s=new SMe;return this._s(e,t,s).next(a=>{if(o.result=a,this.Xi)return this.us(e,t,s,a.size)})}).next(()=>o.result)}us(e,t,r,i){return r.documentReadCountthis.ts*i?(Ih()<=qe.DEBUG&&z("QueryEngine","The SDK decides to create cache indexes for query:",Bh(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,br(t))):N.resolve())}rs(e,t){if(y9(t))return N.resolve(null);let r=br(t);return this.indexManager.getIndexType(e,r).next(i=>0===i?null:(null!==t.limit&&1===i&&(t=sI(t,null,"F"),r=br(t)),this.indexManager.getDocumentsMatchingTarget(e,r).next(o=>{const s=Re(...o);return this.ns.getDocuments(e,s).next(a=>this.indexManager.getMinOffset(e,r).next(l=>{const c=this.cs(t,a);return this.ls(t,c,s,l.readTime)?this.rs(e,sI(t,null,"F")):this.hs(e,c,t,l)}))})))}ss(e,t,r,i){return y9(t)||i.isEqual(le.min())?N.resolve(null):this.ns.getDocuments(e,r).next(o=>{const s=this.cs(t,o);return this.ls(t,s,r,i)?N.resolve(null):(Ih()<=qe.DEBUG&&z("QueryEngine","Re-using previous result from %s to execute query: %s",i.toString(),Bh(t)),this.hs(e,s,t,function E6(n,e){const t=n.toTimestamp().seconds,r=n.toTimestamp().nanoseconds+1,i=le.fromTimestamp(1e9===r?new Yt(t+1,0):new Yt(t,r));return new Mi(i,te.empty(),e)}(i,-1)).next(a=>a))})}cs(e,t){let r=new dt(I9(e));return t.forEach((i,o)=>{Qg(e,o)&&(r=r.add(o))}),r}ls(e,t,r,i){if(null===e.limit)return!1;if(r.size!==t.size)return!0;const o="F"===e.limitType?t.last():t.first();return!!o&&(o.hasPendingWrites||o.version.compareTo(i)>0)}_s(e,t,r){return Ih()<=qe.DEBUG&&z("QueryEngine","Using full collection scan to execute query:",Bh(t)),this.ns.getDocumentsMatchingQuery(e,t,Mi.min(),r)}hs(e,t,r,i){return this.ns.getDocumentsMatchingQuery(e,r,i).next(o=>(t.forEach(s=>{o=o.insert(s.key,s)}),o))}}const pN="LocalStore";class AMe{constructor(e,t,r,i){this.persistence=e,this.Ps=t,this.serializer=i,this.Ts=new Rt(Ee),this.Is=new Ks(o=>Yc(o),Gg),this.Es=new Map,this.ds=e.getRemoteDocumentCache(),this.Hr=e.getTargetCache(),this.Yr=e.getBundleCache(),this.As(r)}As(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new U7(this.ds,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.ds.setIndexManager(this.indexManager),this.Ps.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.Ts))}}function $7(n,e,t,r){return new AMe(n,e,t,r)}function q7(n,e){return mN.apply(this,arguments)}function mN(){return(mN=T(function*(n,e){const t=Z(n);return yield t.persistence.runTransaction("Handle user change","readonly",r=>{let i;return t.mutationQueue.getAllMutationBatches(r).next(o=>(i=o,t.As(e),t.mutationQueue.getAllMutationBatches(r))).next(o=>{const s=[],a=[];let l=Re();for(const c of i){s.push(c.batchId);for(const u of c.mutations)l=l.add(u.key)}for(const c of o){a.push(c.batchId);for(const u of c.mutations)l=l.add(u.key)}return t.localDocuments.getDocuments(r,l).next(c=>({Rs:c,removedBatchIds:s,addedBatchIds:a}))})})})).apply(this,arguments)}function W7(n){const e=Z(n);return e.persistence.runTransaction("Get last remote snapshot version","readonly",t=>e.Hr.getLastRemoteSnapshotVersion(t))}function kMe(n,e){const t=Z(n);return t.persistence.runTransaction("Get next mutation batch","readonly",r=>(void 0===e&&(e=-1),t.mutationQueue.getNextMutationBatchAfterBatchId(r,e)))}function Zh(n,e,t){return gN.apply(this,arguments)}function gN(){return(gN=T(function*(n,e,t){const r=Z(n),i=r.Ts.get(e),o=t?"readwrite":"readwrite-primary";try{t||(yield r.persistence.runTransaction("Release target",o,s=>r.persistence.referenceDelegate.removeTarget(s,i)))}catch(s){if(!il(s))throw s;z(pN,`Failed to update sequence numbers for target ${e}: ${s}`)}r.Ts=r.Ts.remove(e),r.Is.delete(i.target)})).apply(this,arguments)}function TI(n,e,t){const r=Z(n);let i=le.min(),o=Re();return r.persistence.runTransaction("Execute query","readwrite",s=>function(l,c,u){const d=Z(l),f=d.Is.get(u);return void 0!==f?N.resolve(d.Ts.get(f)):d.Hr.getTargetData(c,u)}(r,s,br(e)).next(a=>{if(a)return i=a.lastLimboFreeSnapshotVersion,r.Hr.getMatchingKeysForTargetId(s,a.targetId).next(l=>{o=l})}).next(()=>r.Ps.getDocumentsMatchingQuery(s,e,t?i:le.min(),t?o:Re())).next(a=>(function Y7(n,e,t){let r=n.Es.get(e)||le.min();t.forEach((i,o)=>{o.readTime.compareTo(r)>0&&(r=o.readTime)}),n.Es.set(e,r)}(r,function E9(n){return n.collectionGroup||(n.path.length%2==1?n.path.lastSegment():n.path.get(n.path.length-2))}(e),a),{documents:a,gs:o})))}class wN{constructor(){this.activeTargetIds=function z1(){return kRe}()}Ds(e){this.activeTargetIds=this.activeTargetIds.add(e)}vs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}bs(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class nK{constructor(){this.ho=new wN,this.Po={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,r){}addLocalQueryTarget(e,t=!0){return t&&this.ho.Ds(e),this.Po[e]||"not-current"}updateQueryState(e,t,r){this.Po[e]=t}removeLocalQueryTarget(e){this.ho.vs(e)}isLocalQueryTarget(e){return this.ho.activeTargetIds.has(e)}clearQueryState(e){delete this.Po[e]}getAllActiveQueryTargets(){return this.ho.activeTargetIds}isActiveQueryTarget(e){return this.ho.activeTargetIds.has(e)}start(){return this.ho=new wN,Promise.resolve()}handleUserChange(e,t,r){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}class OMe{To(e){}shutdown(){}}const rK="ConnectivityMonitor";class iK{constructor(){this.Io=()=>this.Eo(),this.Ao=()=>this.Ro(),this.Vo=[],this.mo()}To(e){this.Vo.push(e)}shutdown(){window.removeEventListener("online",this.Io),window.removeEventListener("offline",this.Ao)}mo(){window.addEventListener("online",this.Io),window.addEventListener("offline",this.Ao)}Eo(){z(rK,"Network connectivity changed: AVAILABLE");for(const e of this.Vo)e(0)}Ro(){z(rK,"Network connectivity changed: UNAVAILABLE");for(const e of this.Vo)e(1)}static D(){return typeof window<"u"&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}}let SI=null;function IN(){return null===SI?SI=268435456+Math.round(2147483648*Math.random()):SI++,"0x"+SI.toString(16)}const TN="RestConnection",FMe={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};class LMe{get fo(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const t=e.ssl?"https":"http",r=encodeURIComponent(this.databaseId.projectId),i=encodeURIComponent(this.databaseId.database);this.po=t+"://"+e.host,this.yo=`projects/${r}/databases/${i}`,this.wo=this.databaseId.database===jg?`project_id=${r}`:`project_id=${r}&database_id=${i}`}So(e,t,r,i,o){const s=IN(),a=this.bo(e,t.toUriEncodedString());z(TN,`Sending RPC '${e}' ${s}:`,a,r);const l={"google-cloud-resource-prefix":this.yo,"x-goog-request-params":this.wo};return this.Do(l,i,o),this.vo(e,a,l,r).then(c=>(z(TN,`Received RPC '${e}' ${s}: `,c),c),c=>{throw eo(TN,`RPC '${e}' ${s} failed with error: `,c,"url: ",a,"request:",r),c})}Co(e,t,r,i,o,s){return this.So(e,t,r,i,o)}Do(e,t,r){e["X-Goog-Api-Client"]="gl-js/ fire/"+Eh,e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach((i,o)=>e[o]=i),r&&r.headers.forEach((i,o)=>e[o]=i)}bo(e,t){return`${this.po}/v1/${t}:${FMe[e]}`}terminate(){}}class VMe{constructor(e){this.Fo=e.Fo,this.Mo=e.Mo}xo(e){this.Oo=e}No(e){this.Bo=e}Lo(e){this.ko=e}onMessage(e){this.qo=e}close(){this.Mo()}send(e){this.Fo(e)}Qo(){this.Oo()}$o(){this.Bo()}Ko(e){this.ko(e)}Uo(e){this.qo(e)}}const Er="WebChannelConnection";class BMe extends LMe{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}vo(e,t,r,i){const o=IN();return new Promise((s,a)=>{const l=new u6;l.setWithCredentials(!0),l.listenOnce(d6.COMPLETE,()=>{try{switch(l.getLastErrorCode()){case BE.NO_ERROR:const u=l.getResponseJson();z(Er,`XHR for RPC '${e}' ${o} received:`,JSON.stringify(u)),s(u);break;case BE.TIMEOUT:z(Er,`RPC '${e}' ${o} timed out`),a(new j(F.DEADLINE_EXCEEDED,"Request time out"));break;case BE.HTTP_ERROR:const d=l.getStatus();if(z(Er,`RPC '${e}' ${o} failed with status:`,d,"response text:",l.getResponseText()),d>0){let f=l.getResponseJson();Array.isArray(f)&&(f=f[0]);const p=f?.error;if(p&&p.status&&p.message){const m=function(v){const E=v.toLowerCase().replace(/_/g,"-");return Object.values(F).indexOf(E)>=0?E:F.UNKNOWN}(p.status);a(new j(m,p.message))}else a(new j(F.UNKNOWN,"Server responded with status "+l.getStatus()))}else a(new j(F.UNAVAILABLE,"Connection failed."));break;default:ne()}}finally{z(Er,`RPC '${e}' ${o} completed.`)}});const c=JSON.stringify(i);z(Er,`RPC '${e}' ${o} sending request:`,i),l.send(t,"POST",c,r,15)})}Wo(e,t,r){const i=IN(),o=[this.po,"/","google.firestore.v1.Firestore","/",e,"/channel"],s=p6(),a=f6(),l={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},c=this.longPollingOptions.timeoutSeconds;void 0!==c&&(l.longPollingTimeout=Math.round(1e3*c)),this.useFetchStreams&&(l.useFetchStreams=!0),this.Do(l.initMessageHeaders,t,r),l.encodeInitMessageHeaders=!0;const u=o.join("");z(Er,`Creating RPC '${e}' stream ${i}: ${u}`,l);const d=s.createWebChannel(u,l);let f=!1,p=!1;const m=new VMe({Fo:v=>{p?z(Er,`Not sending because RPC '${e}' stream ${i} is closed:`,v):(f||(z(Er,`Opening RPC '${e}' stream ${i} transport.`),d.open(),f=!0),z(Er,`RPC '${e}' stream ${i} sending:`,v),d.send(v))},Mo:()=>d.close()}),_=(v,E,C)=>{v.listen(E,R=>{try{C(R)}catch(V){setTimeout(()=>{throw V},0)}})};return _(d,kg.EventType.OPEN,()=>{p||(z(Er,`RPC '${e}' stream ${i} transport opened.`),m.Qo())}),_(d,kg.EventType.CLOSE,()=>{p||(p=!0,z(Er,`RPC '${e}' stream ${i} transport closed`),m.Ko())}),_(d,kg.EventType.ERROR,v=>{p||(p=!0,eo(Er,`RPC '${e}' stream ${i} transport errored:`,v),m.Ko(new j(F.UNAVAILABLE,"The operation could not be completed")))}),_(d,kg.EventType.MESSAGE,v=>{var E;if(!p){const C=v.data[0];se(!!C);const R=C,V=R?.error||(null===(E=R[0])||void 0===E?void 0:E.error);if(V){z(Er,`RPC '${e}' stream ${i} received error:`,V);const H=V.status;let Q=function(x){const A=Dn[x];if(void 0!==A)return z9(A)}(H),S=V.message;void 0===Q&&(Q=F.INTERNAL,S="Unknown error status: "+H+" with message "+V.message),p=!0,m.Ko(new j(Q,S)),d.close()}else z(Er,`RPC '${e}' stream ${i} received:`,C),m.Uo(C)}}),_(a,h6.STAT_EVENT,v=>{v.stat===m1.PROXY?z(Er,`RPC '${e}' stream ${i} detected buffering proxy`):v.stat===m1.NOPROXY&&z(Er,`RPC '${e}' stream ${i} detected no buffering proxy`)}),setTimeout(()=>{m.$o()},0),m}}function DI(){return typeof document<"u"?document:null}function h_(n){return new qRe(n,!0)}class CN{constructor(e,t,r=1e3,i=1.5,o=6e4){this.Ti=e,this.timerId=t,this.Go=r,this.zo=i,this.jo=o,this.Ho=0,this.Jo=null,this.Yo=Date.now(),this.reset()}reset(){this.Ho=0}Zo(){this.Ho=this.jo}Xo(e){this.cancel();const t=Math.floor(this.Ho+this.e_()),r=Math.max(0,Date.now()-this.Yo),i=Math.max(0,t-r);i>0&&z("ExponentialBackoff",`Backing off for ${i} ms (base delay: ${this.Ho} ms, delay with jitter: ${t} ms, last attempt: ${r} ms ago)`),this.Jo=this.Ti.enqueueAfterDelay(this.timerId,i,()=>(this.Yo=Date.now(),e())),this.Ho*=this.zo,this.Hothis.jo&&(this.Ho=this.jo)}t_(){null!==this.Jo&&(this.Jo.skipDelay(),this.Jo=null)}cancel(){null!==this.Jo&&(this.Jo.cancel(),this.Jo=null)}e_(){return(Math.random()-.5)*this.Ho}}const sK="PersistentStream";class aK{constructor(e,t,r,i,o,s,a,l){this.Ti=e,this.n_=r,this.r_=i,this.connection=o,this.authCredentialsProvider=s,this.appCheckCredentialsProvider=a,this.listener=l,this.state=0,this.i_=0,this.s_=null,this.o_=null,this.stream=null,this.__=0,this.a_=new CN(e,t)}u_(){return 1===this.state||5===this.state||this.c_()}c_(){return 2===this.state||3===this.state}start(){this.__=0,4!==this.state?this.auth():this.l_()}stop(){var e=this;return T(function*(){e.u_()&&(yield e.close(0))})()}h_(){this.state=0,this.a_.reset()}P_(){this.c_()&&null===this.s_&&(this.s_=this.Ti.enqueueAfterDelay(this.n_,6e4,()=>this.T_()))}I_(e){this.E_(),this.stream.send(e)}T_(){var e=this;return T(function*(){if(e.c_())return e.close(0)})()}E_(){this.s_&&(this.s_.cancel(),this.s_=null)}d_(){this.o_&&(this.o_.cancel(),this.o_=null)}close(e,t){var r=this;return T(function*(){r.E_(),r.d_(),r.a_.cancel(),r.i_++,4!==e?r.a_.reset():t&&t.code===F.RESOURCE_EXHAUSTED?(vn(t.toString()),vn("Using maximum backoff delay to prevent overloading the backend."),r.a_.Zo()):t&&t.code===F.UNAUTHENTICATED&&3!==r.state&&(r.authCredentialsProvider.invalidateToken(),r.appCheckCredentialsProvider.invalidateToken()),null!==r.stream&&(r.A_(),r.stream.close(),r.stream=null),r.state=e,yield r.listener.Lo(t)})()}A_(){}auth(){this.state=1;const e=this.R_(this.i_),t=this.i_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([r,i])=>{this.i_===t&&this.V_(r,i)},r=>{e(()=>{const i=new j(F.UNKNOWN,"Fetching auth token failed: "+r.message);return this.m_(i)})})}V_(e,t){const r=this.R_(this.i_);this.stream=this.f_(e,t),this.stream.xo(()=>{r(()=>this.listener.xo())}),this.stream.No(()=>{r(()=>(this.state=2,this.o_=this.Ti.enqueueAfterDelay(this.r_,1e4,()=>(this.c_()&&(this.state=3),Promise.resolve())),this.listener.No()))}),this.stream.Lo(i=>{r(()=>this.m_(i))}),this.stream.onMessage(i=>{r(()=>1==++this.__?this.g_(i):this.onNext(i))})}l_(){var e=this;this.state=5,this.a_.Xo(T(function*(){e.state=0,e.start()}))}m_(e){return z(sK,`close with error: ${e}`),this.stream=null,this.close(4,e)}R_(e){return t=>{this.Ti.enqueueAndForget(()=>this.i_===e?t():(z(sK,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class UMe extends aK{constructor(e,t,r,i,o,s){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,r,i,s),this.serializer=o}f_(e,t){return this.connection.Wo("Listen",e,t)}g_(e){return this.onNext(e)}onNext(e){this.a_.reset();const t=function KRe(n,e){let t;if("targetChange"in e){const r="NO_CHANGE"===(c=e.targetChange.targetChangeType||"NO_CHANGE")?0:"ADD"===c?1:"REMOVE"===c?2:"CURRENT"===c?3:"RESET"===c?4:ne(),i=e.targetChange.targetIds||[],o=function(c,u){return c.useProto3Json?(se(void 0===u||"string"==typeof u),ln.fromBase64String(u||"")):(se(void 0===u||u instanceof Buffer||u instanceof Uint8Array),ln.fromUint8Array(u||new Uint8Array))}(n,e.targetChange.resumeToken),s=e.targetChange.cause,a=s&&function(c){const u=void 0===c.code?F.UNKNOWN:z9(c.code);return new j(u,c.message||"")}(s);t=new W9(r,i,o,a||null)}else if("documentChange"in e){const r=e.documentChange,i=es(n,r.document.name),o=bn(r.document.updateTime),s=r.document.createTime?bn(r.document.createTime):le.min(),a=new ar({mapValue:{fields:r.document.fields}}),l=Lt.newFoundDocument(i,o,s,a);t=new dI(r.targetIds||[],r.removedTargetIds||[],l.key,l)}else if("documentDelete"in e){const r=e.documentDelete,i=es(n,r.document),o=r.readTime?bn(r.readTime):le.min(),s=Lt.newNoDocument(i,o);t=new dI([],r.removedTargetIds||[],s.key,s)}else if("documentRemove"in e){const r=e.documentRemove,i=es(n,r.document);t=new dI([],r.removedTargetIds||[],i,null)}else{if(!("filter"in e))return ne();{const r=e.filter,{count:i=0,unchangedNames:o}=r,s=new BRe(i,o);t=new q9(r.targetId,s)}}var c;return t}(this.serializer,e),r=function(o){if(!("targetChange"in o))return le.min();const s=o.targetChange;return s.targetIds&&s.targetIds.length?le.min():s.readTime?bn(s.readTime):le.min()}(e);return this.listener.p_(t,r)}y_(e){const t={};t.database=X1(this.serializer),t.addTarget=function(o,s){let a;const l=s.target;if(a=iI(l)?{documents:n7(o,l)}:{query:fI(o,l).ht},a.targetId=s.targetId,s.resumeToken.approximateByteSize()>0){a.resumeToken=Q9(o,s.resumeToken);const c=K1(o,s.expectedCount);null!==c&&(a.expectedCount=c)}else if(s.snapshotVersion.compareTo(le.min())>0){a.readTime=$h(o,s.snapshotVersion.toTimestamp());const c=K1(o,s.expectedCount);null!==c&&(a.expectedCount=c)}return a}(this.serializer,e);const r=function YRe(n,e){const t=function(i){switch(i){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return ne()}}(e.purpose);return null==t?null:{"goog-listen-tags":t}}(0,e);r&&(t.labels=r),this.I_(t)}w_(e){const t={};t.database=X1(this.serializer),t.removeTarget=e,this.I_(t)}}class zMe extends aK{constructor(e,t,r,i,o,s){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,r,i,s),this.serializer=o}get S_(){return this.__>0}start(){this.lastStreamToken=void 0,super.start()}A_(){this.S_&&this.b_([])}f_(e,t){return this.connection.Wo("Write",e,t)}g_(e){return se(!!e.streamToken),this.lastStreamToken=e.streamToken,se(!e.writeResults||0===e.writeResults.length),this.listener.D_()}onNext(e){se(!!e.streamToken),this.lastStreamToken=e.streamToken,this.a_.reset();const t=function QRe(n,e){return n&&n.length>0?(se(void 0!==e),n.map(t=>function(i,o){let s=bn(i.updateTime?i.updateTime:o);return s.isEqual(le.min())&&(s=bn(o)),new FRe(s,i.transformResults||[])}(t,e))):[]}(e.writeResults,e.commitTime),r=bn(e.commitTime);return this.listener.v_(r,t)}C_(){const e={};e.database=X1(this.serializer),this.I_(e)}b_(e){const t={streamToken:this.lastStreamToken,writes:e.map(r=>i_(this.serializer,r))};this.I_(t)}}class jMe{}class HMe extends jMe{constructor(e,t,r,i){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=r,this.serializer=i,this.F_=!1}M_(){if(this.F_)throw new j(F.FAILED_PRECONDITION,"The client has already been terminated.")}So(e,t,r,i){return this.M_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([o,s])=>this.connection.So(e,Y1(t,r),i,o,s)).catch(o=>{throw"FirebaseError"===o.name?(o.code===F.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),o):new j(F.UNKNOWN,o.toString())})}Co(e,t,r,i,o){return this.M_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([s,a])=>this.connection.Co(e,Y1(t,r),i,s,a,o)).catch(s=>{throw"FirebaseError"===s.name?(s.code===F.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),s):new j(F.UNKNOWN,s.toString())})}terminate(){this.F_=!0,this.connection.terminate()}}class $Me{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.x_=0,this.O_=null,this.N_=!0}B_(){0===this.x_&&(this.L_("Unknown"),this.O_=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.O_=null,this.k_("Backend didn't respond within 10 seconds."),this.L_("Offline"),Promise.resolve())))}q_(e){"Online"===this.state?this.L_("Unknown"):(this.x_++,this.x_>=1&&(this.Q_(),this.k_(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.L_("Offline")))}set(e){this.Q_(),this.x_=0,"Online"===e&&(this.N_=!1),this.L_(e)}L_(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}k_(e){const t=`Could not reach Cloud Firestore backend. ${e}\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.N_?(vn(t),this.N_=!1):z("OnlineStateTracker",t)}Q_(){null!==this.O_&&(this.O_.cancel(),this.O_=null)}}const su="RemoteStore";class qMe{constructor(e,t,r,i,o){var s=this;this.localStore=e,this.datastore=t,this.asyncQueue=r,this.remoteSyncer={},this.K_=[],this.U_=new Map,this.W_=new Set,this.G_=[],this.z_=o,this.z_.To(a=>{r.enqueueAndForget(T(function*(){var l;gl(s)&&(z(su,"Restarting streams for network reachability change."),yield(l=T(function*(u){const d=Z(u);d.W_.add(4),yield Jh(d),d.j_.set("Unknown"),d.W_.delete(4),yield f_(d)}),function c(u){return l.apply(this,arguments)})(s))}))}),this.j_=new $Me(r,i)}}function f_(n){return xN.apply(this,arguments)}function xN(){return(xN=T(function*(n){if(gl(n))for(const e of n.G_)yield e(!0)})).apply(this,arguments)}function Jh(n){return SN.apply(this,arguments)}function SN(){return(SN=T(function*(n){for(const e of n.G_)yield e(!1)})).apply(this,arguments)}function AI(n,e){const t=Z(n);t.U_.has(e.targetId)||(t.U_.set(e.targetId,e),RN(t)?AN(t):nf(t).c_()&&DN(t,e))}function ef(n,e){const t=Z(n),r=nf(t);t.U_.delete(e),r.c_()&&lK(t,e),0===t.U_.size&&(r.c_()?r.P_():gl(t)&&t.j_.set("Unknown"))}function DN(n,e){if(n.H_.Ne(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(le.min())>0){const t=n.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(t)}nf(n).y_(e)}function lK(n,e){n.H_.Ne(e),nf(n).w_(e)}function AN(n){n.H_=new zRe({getRemoteKeysForTarget:e=>n.remoteSyncer.getRemoteKeysForTarget(e),lt:e=>n.U_.get(e)||null,it:()=>n.datastore.serializer.databaseId}),nf(n).start(),n.j_.B_()}function RN(n){return gl(n)&&!nf(n).u_()&&n.U_.size>0}function gl(n){return 0===Z(n).W_.size}function cK(n){n.H_=void 0}function WMe(n){return MN.apply(this,arguments)}function MN(){return(MN=T(function*(n){n.j_.set("Online")})).apply(this,arguments)}function GMe(n){return kN.apply(this,arguments)}function kN(){return(kN=T(function*(n){n.U_.forEach((e,t)=>{DN(n,e)})})).apply(this,arguments)}function KMe(n,e){return NN.apply(this,arguments)}function NN(){return(NN=T(function*(n,e){cK(n),RN(n)?(n.j_.q_(e),AN(n)):n.j_.set("Unknown")})).apply(this,arguments)}function QMe(n,e,t){return PN.apply(this,arguments)}function PN(){return PN=T(function*(n,e,t){if(n.j_.set("Online"),e instanceof W9&&2===e.state&&e.cause)try{yield(r=T(function*(o,s){const a=s.cause;for(const l of s.targetIds)o.U_.has(l)&&(yield o.remoteSyncer.rejectListen(l,a),o.U_.delete(l),o.H_.removeTarget(l))}),function i(o,s){return r.apply(this,arguments)})(n,e)}catch(r){z(su,"Failed to remove targets %s: %s ",e.targetIds.join(","),r),yield RI(n,r)}else if(e instanceof dI?n.H_.We(e):e instanceof q9?n.H_.Ze(e):n.H_.je(e),!t.isEqual(le.min()))try{const r=yield W7(n.localStore);t.compareTo(r)>=0&&(yield function(o,s){const a=o.H_.ot(s);return a.targetChanges.forEach((l,c)=>{if(l.resumeToken.approximateByteSize()>0){const u=o.U_.get(c);u&&o.U_.set(c,u.withResumeToken(l.resumeToken,s))}}),a.targetMismatches.forEach((l,c)=>{const u=o.U_.get(l);if(!u)return;o.U_.set(l,u.withResumeToken(ln.EMPTY_BYTE_STRING,u.snapshotVersion)),lK(o,l);const d=new Ys(u.target,l,c,u.sequenceNumber);DN(o,d)}),o.remoteSyncer.applyRemoteEvent(a)}(n,t))}catch(r){z(su,"Failed to raise snapshot:",r),yield RI(n,r)}var r}),PN.apply(this,arguments)}function RI(n,e,t){return ON.apply(this,arguments)}function ON(){return(ON=T(function*(n,e,t){if(!il(e))throw e;n.W_.add(1),yield Jh(n),n.j_.set("Offline"),t||(t=()=>W7(n.localStore)),n.asyncQueue.enqueueRetryable(T(function*(){z(su,"Retrying IndexedDB access"),yield t(),n.W_.delete(1),yield f_(n)}))})).apply(this,arguments)}function uK(n,e){return e().catch(t=>RI(n,t,e))}function tf(n){return FN.apply(this,arguments)}function FN(){return(FN=T(function*(n){const e=Z(n),t=_l(e);let r=e.K_.length>0?e.K_[e.K_.length-1].batchId:-1;for(;YMe(e);)try{const i=yield kMe(e.localStore,r);if(null===i){0===e.K_.length&&t.P_();break}r=i.batchId,XMe(e,i)}catch(i){yield RI(e,i)}dK(e)&&hK(e)})).apply(this,arguments)}function YMe(n){return gl(n)&&n.K_.length<10}function XMe(n,e){n.K_.push(e);const t=_l(n);t.c_()&&t.S_&&t.b_(e.mutations)}function dK(n){return gl(n)&&!_l(n).u_()&&n.K_.length>0}function hK(n){_l(n).start()}function ZMe(n){return LN.apply(this,arguments)}function LN(){return(LN=T(function*(n){_l(n).C_()})).apply(this,arguments)}function JMe(n){return VN.apply(this,arguments)}function VN(){return(VN=T(function*(n){const e=_l(n);for(const t of n.K_)e.b_(t.mutations)})).apply(this,arguments)}function eke(n,e,t){return BN.apply(this,arguments)}function BN(){return(BN=T(function*(n,e,t){const r=n.K_.shift(),i=q1.from(r,e,t);yield uK(n,()=>n.remoteSyncer.applySuccessfulWrite(i)),yield tf(n)})).apply(this,arguments)}function tke(n,e){return UN.apply(this,arguments)}function UN(){return UN=T(function*(n,e){var t;e&&_l(n).S_&&(yield(t=T(function*(i,o){if(function U9(n){switch(n){case F.OK:return ne();case F.CANCELLED:case F.UNKNOWN:case F.DEADLINE_EXCEEDED:case F.RESOURCE_EXHAUSTED:case F.INTERNAL:case F.UNAVAILABLE:case F.UNAUTHENTICATED:return!1;case F.INVALID_ARGUMENT:case F.NOT_FOUND:case F.ALREADY_EXISTS:case F.PERMISSION_DENIED:case F.FAILED_PRECONDITION:case F.ABORTED:case F.OUT_OF_RANGE:case F.UNIMPLEMENTED:case F.DATA_LOSS:return!0;default:return ne()}}(a=o.code)&&a!==F.ABORTED){const s=i.K_.shift();_l(i).h_(),yield uK(i,()=>i.remoteSyncer.rejectFailedWrite(s.batchId,o)),yield tf(i)}var a}),function r(i,o){return t.apply(this,arguments)})(n,e)),dK(n)&&hK(n)}),UN.apply(this,arguments)}function fK(n,e){return zN.apply(this,arguments)}function zN(){return(zN=T(function*(n,e){const t=Z(n);t.asyncQueue.verifyOperationInProgress(),z(su,"RemoteStore received new credentials");const r=gl(t);t.W_.add(3),yield Jh(t),r&&t.j_.set("Unknown"),yield t.remoteSyncer.handleCredentialChange(e),t.W_.delete(3),yield f_(t)})).apply(this,arguments)}function HN(){return(HN=T(function*(n,e){const t=Z(n);e?(t.W_.delete(2),yield f_(t)):e||(t.W_.add(2),yield Jh(t),t.j_.set("Unknown"))})).apply(this,arguments)}function nf(n){return n.J_||(n.J_=function(t,r,i){const o=Z(t);return o.M_(),new UMe(r,o.connection,o.authCredentials,o.appCheckCredentials,o.serializer,i)}(n.datastore,n.asyncQueue,{xo:WMe.bind(null,n),No:GMe.bind(null,n),Lo:KMe.bind(null,n),p_:QMe.bind(null,n)}),n.G_.push(function(){var e=T(function*(t){t?(n.J_.h_(),RN(n)?AN(n):n.j_.set("Unknown")):(yield n.J_.stop(),cK(n))});return function(t){return e.apply(this,arguments)}}())),n.J_}function _l(n){return n.Y_||(n.Y_=function(t,r,i){const o=Z(t);return o.M_(),new zMe(r,o.connection,o.authCredentials,o.appCheckCredentials,o.serializer,i)}(n.datastore,n.asyncQueue,{xo:()=>Promise.resolve(),No:ZMe.bind(null,n),Lo:tke.bind(null,n),D_:JMe.bind(null,n),v_:eke.bind(null,n)}),n.G_.push(function(){var e=T(function*(t){t?(n.Y_.h_(),yield tf(n)):(yield n.Y_.stop(),n.K_.length>0&&(z(su,`Stopping write stream with ${n.K_.length} pending writes`),n.K_=[]))});return function(t){return e.apply(this,arguments)}}())),n.Y_}class $N{constructor(e,t,r,i,o){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=r,this.op=i,this.removalCallback=o,this.deferred=new Yn,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(s=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,t,r,i,o){const s=Date.now()+r,a=new $N(e,t,s,i,o);return a.start(r),a}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new j(F.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function rf(n,e){if(vn("AsyncQueue",`${e}: ${n}`),il(n))return new j(F.UNAVAILABLE,`${e}: ${n}`);throw n}class sf{static emptySet(e){return new sf(e.comparator)}constructor(e){this.comparator=e?(t,r)=>e(t,r)||te.comparator(t.key,r.key):(t,r)=>te.comparator(t.key,r.key),this.keyedMap=Yg(),this.sortedSet=new Rt(this.comparator)}has(e){return null!=this.keyedMap.get(e)}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((t,r)=>(e(t),!1))}add(e){const t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){const t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof sf)||this.size!==e.size)return!1;const t=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();for(;t.hasNext();){const i=t.getNext().key,o=r.getNext().key;if(!i.isEqual(o))return!1}return!0}toString(){const e=[];return this.forEach(t=>{e.push(t.toString())}),0===e.length?"DocumentSet ()":"DocumentSet (\n "+e.join(" \n")+"\n)"}copy(e,t){const r=new sf;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=t,r}}class pK{constructor(){this.Z_=new Rt(te.comparator)}track(e){const t=e.doc.key,r=this.Z_.get(t);r?0!==e.type&&3===r.type?this.Z_=this.Z_.insert(t,e):3===e.type&&1!==r.type?this.Z_=this.Z_.insert(t,{type:r.type,doc:e.doc}):2===e.type&&2===r.type?this.Z_=this.Z_.insert(t,{type:2,doc:e.doc}):2===e.type&&0===r.type?this.Z_=this.Z_.insert(t,{type:0,doc:e.doc}):1===e.type&&0===r.type?this.Z_=this.Z_.remove(t):1===e.type&&2===r.type?this.Z_=this.Z_.insert(t,{type:1,doc:r.doc}):0===e.type&&1===r.type?this.Z_=this.Z_.insert(t,{type:2,doc:e.doc}):ne():this.Z_=this.Z_.insert(t,e)}X_(){const e=[];return this.Z_.inorderTraversal((t,r)=>{e.push(r)}),e}}class af{constructor(e,t,r,i,o,s,a,l,c){this.query=e,this.docs=t,this.oldDocs=r,this.docChanges=i,this.mutatedKeys=o,this.fromCache=s,this.syncStateChanged=a,this.excludesMetadataChanges=l,this.hasCachedResults=c}static fromInitialDocuments(e,t,r,i,o){const s=[];return t.forEach(a=>{s.push({type:0,doc:a})}),new af(e,t,sf.emptySet(t),s,r,i,!0,!1,o)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&Kg(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const t=this.docChanges,r=e.docChanges;if(t.length!==r.length)return!1;for(let i=0;ie.ra())}}class rke{constructor(){this.queries=mK(),this.onlineState="Unknown",this.ia=new Set}terminate(){!function(t,r){const i=Z(t),o=i.queries;i.queries=mK(),o.forEach((s,a)=>{for(const l of a.ta)l.onError(r)})}(this,new j(F.ABORTED,"Firestore shutting down"))}}function mK(){return new Ks(n=>w9(n),Kg)}function qN(n,e){return WN.apply(this,arguments)}function WN(){return(WN=T(function*(n,e){const t=Z(n);let r=3;const i=e.query;let o=t.queries.get(i);o?!o.na()&&e.ra()&&(r=2):(o=new nke,r=e.ra()?0:1);try{switch(r){case 0:o.ea=yield t.onListen(i,!0);break;case 1:o.ea=yield t.onListen(i,!1);break;case 2:yield t.onFirstRemoteStoreListen(i)}}catch(s){const a=rf(s,`Initialization of query '${Bh(e.query)}' failed`);return void e.onError(a)}t.queries.set(i,o),o.ta.push(e),e.sa(t.onlineState),o.ea&&e.oa(o.ea)&&QN(t)})).apply(this,arguments)}function GN(n,e){return KN.apply(this,arguments)}function KN(){return(KN=T(function*(n,e){const t=Z(n),r=e.query;let i=3;const o=t.queries.get(r);if(o){const s=o.ta.indexOf(e);s>=0&&(o.ta.splice(s,1),0===o.ta.length?i=e.ra()?0:1:!o.na()&&e.ra()&&(i=2))}switch(i){case 0:return t.queries.delete(r),t.onUnlisten(r,!0);case 1:return t.queries.delete(r),t.onUnlisten(r,!1);case 2:return t.onLastRemoteStoreUnlisten(r);default:return}})).apply(this,arguments)}function ike(n,e){const t=Z(n);let r=!1;for(const i of e){const s=t.queries.get(i.query);if(s){for(const a of s.ta)a.oa(i)&&(r=!0);s.ea=i}}r&&QN(t)}function oke(n,e,t){const r=Z(n),i=r.queries.get(e);if(i)for(const o of i.ta)o.onError(t);r.queries.delete(e)}function QN(n){n.ia.forEach(e=>{e.next()})}var YN,gK;(gK=YN||(YN={}))._a="default",gK.Cache="cache";class XN{constructor(e,t,r){this.query=e,this.aa=t,this.ua=!1,this.ca=null,this.onlineState="Unknown",this.options=r||{}}oa(e){if(!this.options.includeMetadataChanges){const r=[];for(const i of e.docChanges)3!==i.type&&r.push(i);e=new af(e.query,e.docs,e.oldDocs,r,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.ua?this.la(e)&&(this.aa.next(e),t=!0):this.ha(e,this.onlineState)&&(this.Pa(e),t=!0),this.ca=e,t}onError(e){this.aa.error(e)}sa(e){this.onlineState=e;let t=!1;return this.ca&&!this.ua&&this.ha(this.ca,e)&&(this.Pa(this.ca),t=!0),t}ha(e,t){return!e.fromCache||!this.ra()||(!this.options.Ta||!("Offline"!==t))&&(!e.docs.isEmpty()||e.hasCachedResults||"Offline"===t)}la(e){return e.docChanges.length>0||!!(e.syncStateChanged||this.ca&&this.ca.hasPendingWrites!==e.hasPendingWrites)&&!0===this.options.includeMetadataChanges}Pa(e){e=af.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.ua=!0,this.aa.next(e)}ra(){return this.options.source!==YN.Cache}}class vK{constructor(e){this.key=e}}class bK{constructor(e){this.key=e}}class wK{constructor(e,t){this.query=e,this.fa=t,this.ga=null,this.hasCachedResults=!1,this.current=!1,this.pa=Re(),this.mutatedKeys=Re(),this.ya=I9(e),this.wa=new sf(this.ya)}get Sa(){return this.fa}ba(e,t){const r=t?t.Da:new pK,i=t?t.wa:this.wa;let o=t?t.mutatedKeys:this.mutatedKeys,s=i,a=!1;const l="F"===this.query.limitType&&i.size===this.query.limit?i.last():null,c="L"===this.query.limitType&&i.size===this.query.limit?i.first():null;if(e.inorderTraversal((u,d)=>{const f=i.get(u),p=Qg(this.query,d)?d:null,m=!!f&&this.mutatedKeys.has(f.key),_=!!p&&(p.hasLocalMutations||this.mutatedKeys.has(p.key)&&p.hasCommittedMutations);let v=!1;f&&p?f.data.isEqual(p.data)?m!==_&&(r.track({type:3,doc:p}),v=!0):this.va(f,p)||(r.track({type:2,doc:p}),v=!0,(l&&this.ya(p,l)>0||c&&this.ya(p,c)<0)&&(a=!0)):!f&&p?(r.track({type:0,doc:p}),v=!0):f&&!p&&(r.track({type:1,doc:f}),v=!0,(l||c)&&(a=!0)),v&&(p?(s=s.add(p),o=_?o.add(u):o.delete(u)):(s=s.delete(u),o=o.delete(u)))}),null!==this.query.limit)for(;s.size>this.query.limit;){const u="F"===this.query.limitType?s.last():s.first();s=s.delete(u.key),o=o.delete(u.key),r.track({type:1,doc:u})}return{wa:s,Da:r,ls:a,mutatedKeys:o}}va(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,r,i){const o=this.wa;this.wa=e.wa,this.mutatedKeys=e.mutatedKeys;const s=e.Da.X_();s.sort((u,d)=>function(p,m){const _=v=>{switch(v){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return ne()}};return _(p)-_(m)}(u.type,d.type)||this.ya(u.doc,d.doc)),this.Ca(r),i=null!=i&&i;const a=t&&!i?this.Fa():[],l=0===this.pa.size&&this.current&&!i?1:0,c=l!==this.ga;return this.ga=l,0!==s.length||c?{snapshot:new af(this.query,e.wa,o,s,e.mutatedKeys,0===l,c,!1,!!r&&r.resumeToken.approximateByteSize()>0),Ma:a}:{Ma:a}}sa(e){return this.current&&"Offline"===e?(this.current=!1,this.applyChanges({wa:this.wa,Da:new pK,mutatedKeys:this.mutatedKeys,ls:!1},!1)):{Ma:[]}}xa(e){return!this.fa.has(e)&&!!this.wa.has(e)&&!this.wa.get(e).hasLocalMutations}Ca(e){e&&(e.addedDocuments.forEach(t=>this.fa=this.fa.add(t)),e.modifiedDocuments.forEach(t=>{}),e.removedDocuments.forEach(t=>this.fa=this.fa.delete(t)),this.current=e.current)}Fa(){if(!this.current)return[];const e=this.pa;this.pa=Re(),this.wa.forEach(r=>{this.xa(r.key)&&(this.pa=this.pa.add(r.key))});const t=[];return e.forEach(r=>{this.pa.has(r)||t.push(new bK(r))}),this.pa.forEach(r=>{e.has(r)||t.push(new vK(r))}),t}Oa(e){this.fa=e.gs,this.pa=Re();const t=this.ba(e.documents);return this.applyChanges(t,!0)}Na(){return af.fromInitialDocuments(this.query,this.wa,this.mutatedKeys,0===this.ga,this.hasCachedResults)}}const yl="SyncEngine";class lke{constructor(e,t,r){this.query=e,this.targetId=t,this.view=r}}class cke{constructor(e){this.key=e,this.Ba=!1}}class uke{constructor(e,t,r,i,o,s){this.localStore=e,this.remoteStore=t,this.eventManager=r,this.sharedClientState=i,this.currentUser=o,this.maxConcurrentLimboResolutions=s,this.La={},this.ka=new Ks(a=>w9(a),Kg),this.qa=new Map,this.Qa=new Set,this.$a=new Rt(te.comparator),this.Ka=new Map,this.Ua=new sN,this.Wa={},this.Ga=new Map,this.za=iu.Un(),this.onlineState="Unknown",this.ja=void 0}get isPrimaryClient(){return!0===this.ja}}function dke(n,e){return ZN.apply(this,arguments)}function ZN(){return(ZN=T(function*(n,e,t=!0){const r=MI(n);let i;const o=r.ka.get(e);return o?(r.sharedClientState.addLocalQueryTarget(o.targetId),i=o.view.Na()):i=yield EK(r,e,t,!0),i})).apply(this,arguments)}function hke(n,e){return JN.apply(this,arguments)}function JN(){return(JN=T(function*(n,e){const t=MI(n);yield EK(t,e,!0,!1)})).apply(this,arguments)}function EK(n,e,t,r){return eP.apply(this,arguments)}function eP(){return(eP=T(function*(n,e,t,r){const i=yield function Xh(n,e){const t=Z(n);return t.persistence.runTransaction("Allocate target","readwrite",r=>{let i;return t.Hr.getTargetData(r,e).next(o=>o?(i=o,N.resolve(i)):t.Hr.allocateTargetId(r).next(s=>(i=new Ys(e,s,"TargetPurposeListen",r.currentSequenceNumber),t.Hr.addTargetData(r,i).next(()=>i))))}).then(r=>{const i=t.Ts.get(r.targetId);return(null===i||r.snapshotVersion.compareTo(i.snapshotVersion)>0)&&(t.Ts=t.Ts.insert(r.targetId,r),t.Is.set(e,r.targetId)),r})}(n.localStore,br(e)),o=i.targetId,s=n.sharedClientState.addLocalQueryTarget(o,t);let a;return r&&(a=yield function tP(n,e,t,r,i){return nP.apply(this,arguments)}(n,e,o,"current"===s,i.resumeToken)),n.isPrimaryClient&&t&&AI(n.remoteStore,i),a})).apply(this,arguments)}function nP(){return nP=T(function*(n,e,t,r,i){n.Ha=(d,f,p)=>{return(m=T(function*(v,E,C,R){let V=E.view.ba(C);V.ls&&(V=yield TI(v.localStore,E.query,!1).then(({documents:I})=>E.view.ba(I,V)));const H=R&&R.targetChanges.get(E.targetId),Q=R&&null!=R.targetMismatches.get(E.targetId),S=E.view.applyChanges(V,v.isPrimaryClient,H,Q);return fP(v,E.targetId,S.Ma),S.snapshot}),function _(v,E,C,R){return m.apply(this,arguments)})(n,d,f,p);var m};const o=yield TI(n.localStore,e,!0),s=new wK(e,o.gs),a=s.ba(o.documents),l=n_.createSynthesizedTargetChangeForCurrentChange(t,r&&"Offline"!==n.onlineState,i),c=s.applyChanges(a,n.isPrimaryClient,l);fP(n,t,c.Ma);const u=new lke(e,t,s);return n.ka.set(e,u),n.qa.has(t)?n.qa.get(t).push(e):n.qa.set(t,[e]),c.snapshot}),nP.apply(this,arguments)}function fke(n,e,t){return rP.apply(this,arguments)}function rP(){return(rP=T(function*(n,e,t){const r=Z(n),i=r.ka.get(e),o=r.qa.get(i.targetId);if(o.length>1)return r.qa.set(i.targetId,o.filter(s=>!Kg(s,e))),void r.ka.delete(e);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(i.targetId),r.sharedClientState.isActiveQueryTarget(i.targetId)||(yield Zh(r.localStore,i.targetId,!1).then(()=>{r.sharedClientState.clearQueryState(i.targetId),t&&ef(r.remoteStore,i.targetId),lf(r,i.targetId)}).catch(rl))):(lf(r,i.targetId),yield Zh(r.localStore,i.targetId,!0))})).apply(this,arguments)}function pke(n,e){return iP.apply(this,arguments)}function iP(){return(iP=T(function*(n,e){const t=Z(n),r=t.ka.get(e),i=t.qa.get(r.targetId);t.isPrimaryClient&&1===i.length&&(t.sharedClientState.removeLocalQueryTarget(r.targetId),ef(t.remoteStore,r.targetId))})).apply(this,arguments)}function oP(){return(oP=T(function*(n,e,t){const r=TP(n);try{const i=yield function(s,a){const l=Z(s),c=Yt.now(),u=a.reduce((p,m)=>p.add(m.key),Re());let d,f;return l.persistence.runTransaction("Locally write mutations","readwrite",p=>{let m=ui(),_=Re();return l.ds.getEntries(p,u).next(v=>{m=v,m.forEach((E,C)=>{C.isValidDocument()||(_=_.add(E))})}).next(()=>l.localDocuments.getOverlayedDocuments(p,m)).next(v=>{d=v;const E=[];for(const C of a){const R=VRe(C,d.get(C.key).overlayedDocument);null!=R&&E.push(new Qs(C.key,R,o9(R.value.mapValue),Wt.exists(!0)))}return l.mutationQueue.addMutationBatch(p,c,E,a)}).next(v=>{f=v;const E=v.applyToLocalDocumentSet(d,_);return l.documentOverlayCache.saveOverlays(p,v.batchId,E)})}).then(()=>({batchId:f.batchId,changes:C9(d)}))}(r.localStore,e);r.sharedClientState.addPendingMutation(i.batchId),function(s,a,l){let c=s.Wa[s.currentUser.toKey()];c||(c=new Rt(Ee)),c=c.insert(a,l),s.Wa[s.currentUser.toKey()]=c}(r,i.batchId,t),yield Xs(r,i.changes),yield tf(r.remoteStore)}catch(i){const o=rf(i,"Failed to persist write");t.reject(o)}})).apply(this,arguments)}function IK(n,e){return sP.apply(this,arguments)}function sP(){return(sP=T(function*(n,e){const t=Z(n);try{const r=yield function MMe(n,e){const t=Z(n),r=e.snapshotVersion;let i=t.Ts;return t.persistence.runTransaction("Apply remote event","readwrite-primary",o=>{const s=t.ds.newChangeBuffer({trackRemovals:!0});i=t.Ts;const a=[];e.targetChanges.forEach((u,d)=>{const f=i.get(d);if(!f)return;a.push(t.Hr.removeMatchingKeys(o,u.removedDocuments,d).next(()=>t.Hr.addMatchingKeys(o,u.addedDocuments,d)));let p=f.withSequenceNumber(o.currentSequenceNumber);var _,v,E;null!==e.targetMismatches.get(d)?p=p.withResumeToken(ln.EMPTY_BYTE_STRING,le.min()).withLastLimboFreeSnapshotVersion(le.min()):u.resumeToken.approximateByteSize()>0&&(p=p.withResumeToken(u.resumeToken,r)),i=i.insert(d,p),v=p,E=u,(0===(_=f).resumeToken.approximateByteSize()||v.snapshotVersion.toMicroseconds()-_.snapshotVersion.toMicroseconds()>=3e8||E.addedDocuments.size+E.modifiedDocuments.size+E.removedDocuments.size>0)&&a.push(t.Hr.updateTargetData(o,p))});let l=ui(),c=Re();if(e.documentUpdates.forEach(u=>{e.resolvedLimboDocuments.has(u)&&a.push(t.persistence.referenceDelegate.updateLimboDocument(o,u))}),a.push(function G7(n,e,t){let r=Re(),i=Re();return t.forEach(o=>r=r.add(o)),e.getEntries(n,r).next(o=>{let s=ui();return t.forEach((a,l)=>{const c=o.get(a);l.isFoundDocument()!==c.isFoundDocument()&&(i=i.add(a)),l.isNoDocument()&&l.version.isEqual(le.min())?(e.removeEntry(a,l.readTime),s=s.insert(a,l)):!c.isValidDocument()||l.version.compareTo(c.version)>0||0===l.version.compareTo(c.version)&&c.hasPendingWrites?(e.addEntry(l),s=s.insert(a,l)):z(pN,"Ignoring outdated watch update for ",a,". Current version:",c.version," Watch version:",l.version)}),{Vs:s,fs:i}})}(o,s,e.documentUpdates).next(u=>{l=u.Vs,c=u.fs})),!r.isEqual(le.min())){const u=t.Hr.getLastRemoteSnapshotVersion(o).next(d=>t.Hr.setTargetsMetadata(o,o.currentSequenceNumber,r));a.push(u)}return N.waitFor(a).next(()=>s.apply(o)).next(()=>t.localDocuments.getLocalViewOfDocuments(o,l,c)).next(()=>l)}).then(o=>(t.Ts=i,o))}(t.localStore,e);e.targetChanges.forEach((i,o)=>{const s=t.Ka.get(o);s&&(se(i.addedDocuments.size+i.modifiedDocuments.size+i.removedDocuments.size<=1),i.addedDocuments.size>0?s.Ba=!0:i.modifiedDocuments.size>0?se(s.Ba):i.removedDocuments.size>0&&(se(s.Ba),s.Ba=!1))}),yield Xs(t,r,e)}catch(r){yield rl(r)}})).apply(this,arguments)}function TK(n,e,t){const r=Z(n);if(r.isPrimaryClient&&0===t||!r.isPrimaryClient&&1===t){const i=[];r.ka.forEach((o,s)=>{const a=s.view.sa(e);a.snapshot&&i.push(a.snapshot)}),function(s,a){const l=Z(s);l.onlineState=a;let c=!1;l.queries.forEach((u,d)=>{for(const f of d.ta)f.sa(a)&&(c=!0)}),c&&QN(l)}(r.eventManager,e),i.length&&r.La.p_(i),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}function gke(n,e,t){return aP.apply(this,arguments)}function aP(){return(aP=T(function*(n,e,t){const r=Z(n);r.sharedClientState.updateQueryState(e,"rejected",t);const i=r.Ka.get(e),o=i&&i.key;if(o){let s=new Rt(te.comparator);s=s.insert(o,Lt.newNoDocument(o,le.min()));const a=Re().add(o),l=new t_(le.min(),new Map,new Rt(Ee),s,a);yield IK(r,l),r.$a=r.$a.remove(o),r.Ka.delete(e),pP(r)}else yield Zh(r.localStore,e,!1).then(()=>lf(r,e,t)).catch(rl)})).apply(this,arguments)}function _ke(n,e){return lP.apply(this,arguments)}function lP(){return(lP=T(function*(n,e){const t=Z(n),r=e.batch.batchId;try{const i=yield function RMe(n,e){const t=Z(n);return t.persistence.runTransaction("Acknowledge batch","readwrite-primary",r=>{const i=e.batch.keys(),o=t.ds.newChangeBuffer({trackRemovals:!0});return function(a,l,c,u){const d=c.batch,f=d.keys();let p=N.resolve();return f.forEach(m=>{p=p.next(()=>u.getEntry(l,m)).next(_=>{const v=c.docVersions.get(m);se(null!==v),_.version.compareTo(v)<0&&(d.applyToRemoteDocument(_,c),_.isValidDocument()&&(_.setReadTime(c.commitVersion),u.addEntry(_)))})}),p.next(()=>a.mutationQueue.removeMutationBatch(l,d))}(t,r,e,o).next(()=>o.apply(r)).next(()=>t.mutationQueue.performConsistencyCheck(r)).next(()=>t.documentOverlayCache.removeOverlaysForBatchId(r,i,e.batch.batchId)).next(()=>t.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(r,function(a){let l=Re();for(let c=0;c0&&(l=l.add(a.batch.mutations[c].key));return l}(e))).next(()=>t.localDocuments.getDocuments(r,i))})}(t.localStore,e);hP(t,r,null),dP(t,r),t.sharedClientState.updateMutationState(r,"acknowledged"),yield Xs(t,i)}catch(i){yield rl(i)}})).apply(this,arguments)}function yke(n,e,t){return cP.apply(this,arguments)}function cP(){return(cP=T(function*(n,e,t){const r=Z(n);try{const i=yield function(s,a){const l=Z(s);return l.persistence.runTransaction("Reject batch","readwrite-primary",c=>{let u;return l.mutationQueue.lookupMutationBatch(c,a).next(d=>(se(null!==d),u=d.keys(),l.mutationQueue.removeMutationBatch(c,d))).next(()=>l.mutationQueue.performConsistencyCheck(c)).next(()=>l.documentOverlayCache.removeOverlaysForBatchId(c,u,a)).next(()=>l.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(c,u)).next(()=>l.localDocuments.getDocuments(c,u))})}(r.localStore,e);hP(r,e,t),dP(r,e),r.sharedClientState.updateMutationState(e,"rejected",t),yield Xs(r,i)}catch(i){yield rl(i)}})).apply(this,arguments)}function dP(n,e){(n.Ga.get(e)||[]).forEach(t=>{t.resolve()}),n.Ga.delete(e)}function hP(n,e,t){const r=Z(n);let i=r.Wa[r.currentUser.toKey()];if(i){const o=i.get(e);o&&(t?o.reject(t):o.resolve(),i=i.remove(e)),r.Wa[r.currentUser.toKey()]=i}}function lf(n,e,t=null){n.sharedClientState.removeLocalQueryTarget(e);for(const r of n.qa.get(e))n.ka.delete(r),t&&n.La.Ja(r,t);n.qa.delete(e),n.isPrimaryClient&&n.Ua.br(e).forEach(r=>{n.Ua.containsKey(r)||CK(n,r)})}function CK(n,e){n.Qa.delete(e.path.canonicalString());const t=n.$a.get(e);null!==t&&(ef(n.remoteStore,t),n.$a=n.$a.remove(e),n.Ka.delete(t),pP(n))}function fP(n,e,t){for(const r of t)r instanceof vK?(n.Ua.addReference(r.key,e),bke(n,r)):r instanceof bK?(z(yl,"Document no longer in limbo: "+r.key),n.Ua.removeReference(r.key,e),n.Ua.containsKey(r.key)||CK(n,r.key)):ne()}function bke(n,e){const t=e.key,r=t.path.canonicalString();n.$a.get(t)||n.Qa.has(r)||(z(yl,"New document in limbo: "+t),n.Qa.add(r),pP(n))}function pP(n){for(;n.Qa.size>0&&n.$a.size{s.push(r.Ha(l,e,t).then(c=>{var u;if((c||t)&&r.isPrimaryClient){const d=c?!c.fromCache:null===(u=t?.targetChanges.get(l.targetId))||void 0===u?void 0:u.current;r.sharedClientState.updateQueryState(l.targetId,d?"current":"not-current")}if(c){i.push(c);const d=fN.Yi(l.targetId,c);o.push(d)}}))}),yield Promise.all(s),r.La.p_(i),yield(a=T(function*(c,u){const d=Z(c);try{yield d.persistence.runTransaction("notifyLocalViewChanges","readwrite",f=>N.forEach(u,p=>N.forEach(p.Hi,m=>d.persistence.referenceDelegate.addReference(f,p.targetId,m)).next(()=>N.forEach(p.Ji,m=>d.persistence.referenceDelegate.removeReference(f,p.targetId,m)))))}catch(f){if(!il(f))throw f;z(pN,"Failed to update sequence numbers: "+f)}for(const f of u){const p=f.targetId;if(!f.fromCache){const m=d.Ts.get(p),v=m.withLastLimboFreeSnapshotVersion(m.snapshotVersion);d.Ts=d.Ts.insert(p,v)}}}),function l(c,u){return a.apply(this,arguments)})(r.localStore,o))}),mP.apply(this,arguments)}function wke(n,e){return gP.apply(this,arguments)}function gP(){return(gP=T(function*(n,e){const t=Z(n);if(!t.currentUser.isEqual(e)){z(yl,"User change. New user:",e.toKey());const r=yield q7(t.localStore,e);t.currentUser=e,(o=t).Ga.forEach(a=>{a.forEach(l=>{l.reject(new j(F.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))})}),o.Ga.clear(),t.sharedClientState.handleUserChange(e,r.removedBatchIds,r.addedBatchIds),yield Xs(t,r.Rs)}var o})).apply(this,arguments)}function Eke(n,e){const t=Z(n),r=t.Ka.get(e);if(r&&r.Ba)return Re().add(r.key);{let i=Re();const o=t.qa.get(e);if(!o)return i;for(const s of o){const a=t.ka.get(s);i=i.unionWith(a.view.Sa)}return i}}function MI(n){const e=Z(n);return e.remoteStore.remoteSyncer.applyRemoteEvent=IK.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=Eke.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=gke.bind(null,e),e.La.p_=ike.bind(null,e.eventManager),e.La.Ja=oke.bind(null,e.eventManager),e}function TP(n){const e=Z(n);return e.remoteStore.remoteSyncer.applySuccessfulWrite=_ke.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=yke.bind(null,e),e}let kI=(()=>{class n{constructor(){this.kind="memory",this.synchronizeTabs=!1}initialize(t){var r=this;return T(function*(){r.serializer=h_(t.databaseInfo.databaseId),r.sharedClientState=r.Za(t),r.persistence=r.Xa(t),yield r.persistence.start(),r.localStore=r.eu(t),r.gcScheduler=r.tu(t,r.localStore),r.indexBackfillerScheduler=r.nu(t,r.localStore)})()}tu(t,r){return null}nu(t,r){return null}eu(t){return $7(this.persistence,new H7,t.initialUser,this.serializer)}Xa(t){return new aN(wI.ri,this.serializer)}Za(t){return new nK}terminate(){var t=this;return T(function*(){var r,i;null===(r=t.gcScheduler)||void 0===r||r.stop(),null===(i=t.indexBackfillerScheduler)||void 0===i||i.stop(),t.sharedClientState.shutdown(),yield t.persistence.shutdown()})()}}return n.provider={build:()=>new n},n})();class CP extends kI{constructor(e){super(),this.cacheSizeBytes=e}tu(e,t){return se(this.persistence.referenceDelegate instanceof EI),new N7(this.persistence.referenceDelegate.garbageCollector,e.asyncQueue,t)}Xa(e){const t=void 0!==this.cacheSizeBytes?wr.withCacheSize(this.cacheSizeBytes):wr.DEFAULT;return new aN(r=>EI.ri(r,t),this.serializer)}}class xP extends kI{constructor(e,t,r){super(),this.ru=e,this.cacheSizeBytes=t,this.forceOwnership=r,this.kind="persistent",this.synchronizeTabs=!1}initialize(e){var t=()=>super.initialize,r=this;return T(function*(){yield t().call(r,e),yield r.ru.initialize(r,e),yield TP(r.ru.syncEngine),yield tf(r.ru.remoteStore),yield r.persistence.Ci(()=>(r.gcScheduler&&!r.gcScheduler.started&&r.gcScheduler.start(),r.indexBackfillerScheduler&&!r.indexBackfillerScheduler.started&&r.indexBackfillerScheduler.start(),Promise.resolve()))})()}eu(e){return $7(this.persistence,new H7,e.initialUser,this.serializer)}tu(e,t){return new N7(this.persistence.referenceDelegate.garbageCollector,e.asyncQueue,t)}nu(e,t){const r=new HAe(t,this.persistence);return new jAe(e.asyncQueue,r)}Xa(e){const t=function hN(n,e){let t=n.projectId;return n.isDefaultDatabase||(t+="."+n.database),"firestore/"+e+"/"+t+"/"}(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey),r=void 0!==this.cacheSizeBytes?wr.withCacheSize(this.cacheSizeBytes):wr.DEFAULT;return new dN(this.synchronizeTabs,t,e.clientId,r,e.asyncQueue,function oK(){return typeof window<"u"?window:null}(),DI(),this.serializer,this.sharedClientState,!!this.forceOwnership)}Za(e){return new nK}}let cf=(()=>{class n{initialize(t,r){var i=this;return T(function*(){i.localStore||(i.localStore=t.localStore,i.sharedClientState=t.sharedClientState,i.datastore=i.createDatastore(r),i.remoteStore=i.createRemoteStore(r),i.eventManager=i.createEventManager(r),i.syncEngine=i.createSyncEngine(r,!t.synchronizeTabs),i.sharedClientState.onlineStateHandler=o=>TK(i.syncEngine,o,1),i.remoteStore.remoteSyncer.handleCredentialChange=wke.bind(null,i.syncEngine),yield function jN(n,e){return HN.apply(this,arguments)}(i.remoteStore,i.syncEngine.isPrimaryClient))})()}createEventManager(t){return new rke}createDatastore(t){const r=h_(t.databaseInfo.databaseId),i=new BMe(t.databaseInfo);return new HMe(t.authCredentials,t.appCheckCredentials,i,r)}createRemoteStore(t){return i=this.localStore,o=this.datastore,s=t.asyncQueue,a=r=>TK(this.syncEngine,r,0),l=iK.D()?new iK:new OMe,new qMe(i,o,s,a,l);var i,o,s,a,l}createSyncEngine(t,r){return function(o,s,a,l,c,u,d){const f=new uke(o,s,a,l,c,u);return d&&(f.ja=!0),f}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,t.initialUser,t.maxConcurrentLimboResolutions,r)}terminate(){var t=this;return T(function*(){var r,i,o;yield(o=T(function*(a){const l=Z(a);z(su,"RemoteStore shutting down."),l.W_.add(5),yield Jh(l),l.z_.shutdown(),l.j_.set("Unknown")}),function s(a){return o.apply(this,arguments)})(t.remoteStore),null===(r=t.datastore)||void 0===r||r.terminate(),null===(i=t.eventManager)||void 0===i||i.terminate()})()}}return n.provider={build:()=>new n},n})();class NI{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.iu(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.iu(this.observer.error,e):vn("Uncaught Error in snapshot listener:",e.toString()))}su(){this.muted=!0}iu(e,t){setTimeout(()=>{this.muted||e(t)},0)}}const vl="FirestoreClient";class Pke{constructor(e,t,r,i,o){var s=this;this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=r,this.databaseInfo=i,this.user=Qn.UNAUTHENTICATED,this.clientId=y6.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=o,this.authCredentials.start(r,function(){var a=T(function*(l){z(vl,"Received user=",l.uid),yield s.authCredentialListener(l),s.user=l});return function(l){return a.apply(this,arguments)}}()),this.appCheckCredentials.start(r,a=>(z(vl,"Received new app check token=",a),this.appCheckCredentialListener(a,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){var e=this;this.asyncQueue.enterRestrictedMode();const t=new Yn;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(T(function*(){try{e._onlineComponents&&(yield e._onlineComponents.terminate()),e._offlineComponents&&(yield e._offlineComponents.terminate()),e.authCredentials.shutdown(),e.appCheckCredentials.shutdown(),t.resolve()}catch(r){const i=rf(r,"Failed to shutdown persistence");t.reject(i)}})),t.promise}}function SP(n,e){return DP.apply(this,arguments)}function DP(){return DP=T(function*(n,e){n.asyncQueue.verifyOperationInProgress(),z(vl,"Initializing OfflineComponentProvider");const t=n.configuration;yield e.initialize(t);let r=t.initialUser;n.setCredentialChangeListener(function(){var i=T(function*(o){r.isEqual(o)||(yield q7(e.localStore,o),r=o)});return function(o){return i.apply(this,arguments)}}()),e.persistence.setDatabaseDeletedListener(()=>n.terminate()),n._offlineComponents=e}),DP.apply(this,arguments)}function RK(n,e){return AP.apply(this,arguments)}function AP(){return(AP=T(function*(n,e){n.asyncQueue.verifyOperationInProgress();const t=yield function RP(n){return MP.apply(this,arguments)}(n);z(vl,"Initializing OnlineComponentProvider"),yield e.initialize(t,n.configuration),n.setCredentialChangeListener(r=>fK(e.remoteStore,r)),n.setAppCheckTokenChangeListener((r,i)=>fK(e.remoteStore,i)),n._onlineComponents=e})).apply(this,arguments)}function MP(){return(MP=T(function*(n){if(!n._offlineComponents)if(n._uninitializedComponentsProvider){z(vl,"Using user provided OfflineComponentProvider");try{yield SP(n,n._uninitializedComponentsProvider._offline)}catch(e){if(!("FirebaseError"===(i=e).name?i.code===F.FAILED_PRECONDITION||i.code===F.UNIMPLEMENTED:!(typeof DOMException<"u"&&i instanceof DOMException)||22===i.code||20===i.code||11===i.code))throw e;eo("Error using user provided cache. Falling back to memory cache: "+e),yield SP(n,new kI)}}else z(vl,"Using default OfflineComponentProvider"),yield SP(n,new CP(void 0));var i;return n._offlineComponents})).apply(this,arguments)}function PI(n){return kP.apply(this,arguments)}function kP(){return(kP=T(function*(n){return n._onlineComponents||(n._uninitializedComponentsProvider?(z(vl,"Using user provided OnlineComponentProvider"),yield RK(n,n._uninitializedComponentsProvider._online)):(z(vl,"Using default OnlineComponentProvider"),yield RK(n,new cf))),n._onlineComponents})).apply(this,arguments)}function df(n){return PP.apply(this,arguments)}function PP(){return(PP=T(function*(n){const e=yield PI(n),t=e.eventManager;return t.onListen=dke.bind(null,e.syncEngine),t.onUnlisten=fke.bind(null,e.syncEngine),t.onFirstRemoteStoreListen=hke.bind(null,e.syncEngine),t.onLastRemoteStoreUnlisten=pke.bind(null,e.syncEngine),t})).apply(this,arguments)}function FK(n){const e={};return void 0!==n.timeoutSeconds&&(e.timeoutSeconds=n.timeoutSeconds),e}const LK=new Map;function OP(n,e,t){if(!t)throw new j(F.INVALID_ARGUMENT,`Function ${n}() cannot be called with an empty ${e}.`)}function VK(n){if(!te.isDocumentKey(n))throw new j(F.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${n} has ${n.length}.`)}function BK(n){if(te.isDocumentKey(n))throw new j(F.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${n} has ${n.length}.`)}function OI(n){if(void 0===n)return"undefined";if(null===n)return"null";if("string"==typeof n)return n.length>20&&(n=`${n.substring(0,20)}...`),JSON.stringify(n);if("number"==typeof n||"boolean"==typeof n)return""+n;if("object"==typeof n){if(n instanceof Array)return"an array";{const e=(r=n).constructor?r.constructor.name:null;return e?`a custom ${e} object`:"an object"}}var r;return"function"==typeof n?"a function":ne()}function Be(n,e){if("_delegate"in n&&(n=n._delegate),!(n instanceof e)){if(e.name===n.constructor.name)throw new j(F.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const t=OI(n);throw new j(F.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${t}`)}}return n}const zK="firestore.googleapis.com";class HK{constructor(e){var t,r;if(void 0===e.host){if(void 0!==e.ssl)throw new j(F.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=zK,this.ssl=!0}else this.host=e.host,this.ssl=null===(t=e.ssl)||void 0===t||t;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,void 0===e.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==e.cacheSizeBytes&&e.cacheSizeBytes<1048576)throw new j(F.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}(function Wke(n,e,t,r){if(!0===e&&!0===r)throw new j(F.INVALID_ARGUMENT,`${n} and ${t} cannot be used together.`)})("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!(this.experimentalForceLongPolling||void 0!==e.experimentalAutoDetectLongPolling&&!e.experimentalAutoDetectLongPolling),this.experimentalLongPollingOptions=FK(null!==(r=e.experimentalLongPollingOptions)&&void 0!==r?r:{}),function(o){if(void 0!==o.timeoutSeconds){if(isNaN(o.timeoutSeconds))throw new j(F.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (must not be NaN)`);if(o.timeoutSeconds<5)throw new j(F.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (minimum allowed value is 5)`);if(o.timeoutSeconds>30)throw new j(F.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&this.experimentalLongPollingOptions.timeoutSeconds===e.experimentalLongPollingOptions.timeoutSeconds&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class p_{constructor(e,t,r,i){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=r,this._app=i,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new HK({}),this._settingsFrozen=!1,this._terminateTask="notTerminated"}get app(){if(!this._app)throw new j(F.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return"notTerminated"!==this._terminateTask}_setSettings(e){if(this._settingsFrozen)throw new j(F.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new HK(e),void 0!==e.credentials&&(this._authCredentials=function(r){if(!r)return new RAe;switch(r.type){case"firstParty":return new PAe(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new j(F.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return"notTerminated"===this._terminateTask&&(this._terminateTask=this._terminate()),this._terminateTask}_restart(){var e=this;return T(function*(){"notTerminated"===e._terminateTask?yield e._terminate():e._terminateTask="notTerminated"})()}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(t){const r=LK.get(t);r&&(z("ComponentProvider","Removing Datastore"),LK.delete(t),r.terminate())}(this),Promise.resolve()}}class lr{constructor(e,t,r){this.converter=t,this._query=r,this.type="query",this.firestore=e}withConverter(e){return new lr(this.firestore,e,this._query)}}class wn{constructor(e,t,r){this.converter=t,this._key=r,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new ns(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new wn(this.firestore,e,this._key)}}class ns extends lr{constructor(e,t,r){super(e,t,Lh(r)),this._path=r,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new wn(this.firestore,null,new te(e))}withConverter(e){return new ns(this.firestore,e,this._path)}}function Kke(n,e,...t){if(n=sn(n),OP("collection","path",e),n instanceof p_){const r=We.fromString(e,...t);return BK(r),new ns(n,null,r)}{if(!(n instanceof wn||n instanceof ns))throw new j(F.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=n._path.child(We.fromString(e,...t));return BK(r),new ns(n.firestore,null,r)}}function $K(n,e,...t){if(n=sn(n),1===arguments.length&&(e=y6.newId()),OP("doc","path",e),n instanceof p_){const r=We.fromString(e,...t);return VK(r),new wn(n,null,new te(r))}{if(!(n instanceof wn||n instanceof ns))throw new j(F.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=n._path.child(We.fromString(e,...t));return VK(r),new wn(n.firestore,n instanceof ns?n.converter:null,new te(r))}}const WK="AsyncQueue";class GK{constructor(e=Promise.resolve()){this.Vu=[],this.mu=!1,this.fu=[],this.gu=null,this.pu=!1,this.yu=!1,this.wu=[],this.a_=new CN(this,"async_queue_retry"),this.Su=()=>{const r=DI();r&&z(WK,"Visibility state changed to "+r.visibilityState),this.a_.t_()},this.bu=e;const t=DI();t&&"function"==typeof t.addEventListener&&t.addEventListener("visibilitychange",this.Su)}get isShuttingDown(){return this.mu}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.Du(),this.vu(e)}enterRestrictedMode(e){if(!this.mu){this.mu=!0,this.yu=e||!1;const t=DI();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this.Su)}}enqueue(e){if(this.Du(),this.mu)return new Promise(()=>{});const t=new Yn;return this.vu(()=>this.mu&&this.yu?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Vu.push(e),this.Cu()))}Cu(){var e=this;return T(function*(){if(0!==e.Vu.length){try{yield e.Vu[0](),e.Vu.shift(),e.a_.reset()}catch(t){if(!il(t))throw t;z(WK,"Operation failed with retryable error: "+t)}e.Vu.length>0&&e.a_.Xo(()=>e.Cu())}})()}vu(e){const t=this.bu.then(()=>(this.pu=!0,e().catch(r=>{throw this.gu=r,this.pu=!1,vn("INTERNAL UNHANDLED ERROR: ",function(s){let a=s.message||"";return s.stack&&(a=s.stack.includes(s.message)?s.stack:s.message+"\n"+s.stack),a}(r)),r}).then(r=>(this.pu=!1,r))));return this.bu=t,t}enqueueAfterDelay(e,t,r){this.Du(),this.wu.indexOf(e)>-1&&(t=0);const i=$N.createAndSchedule(this,e,t,r,o=>this.Fu(o));return this.fu.push(i),i}Du(){this.gu&&ne()}verifyOperationInProgress(){}Mu(){var e=this;return T(function*(){let t;do{t=e.bu,yield t}while(t!==e.bu)})()}xu(e){for(const t of this.fu)if(t.timerId===e)return!0;return!1}Ou(e){return this.Mu().then(()=>{this.fu.sort((t,r)=>t.targetTimeMs-r.targetTimeMs);for(const t of this.fu)if(t.skipDelay(),"all"!==e&&t.timerId===e)break;return this.Mu()})}Nu(e){this.wu.push(e)}Fu(e){const t=this.fu.indexOf(e);this.fu.splice(t,1)}}function FP(n){return function(t){if("object"!=typeof t||null===t)return!1;const i=t;for(const o of["next","error","complete"])if(o in i&&"function"==typeof i[o])return!0;return!1}(n)}class Ct extends p_{constructor(e,t,r,i){super(e,t,r,i),this.type="firestore",this._queue=new GK,this._persistenceKey=i?.name||"[DEFAULT]"}_terminate(){var e=this;return T(function*(){if(e._firestoreClient){const t=e._firestoreClient.terminate();e._queue=new GK(t),e._firestoreClient=void 0,yield t}})()}}function Yke(n,e){const t="object"==typeof n?n:cE(),r="string"==typeof n?n:e||jg,i=cg(t,"firestore").getImmediate({identifier:r});if(!i._initialized){const o=QW("firestore");o&&function Gke(n,e,t,r={}){var i;const o=(n=Be(n,p_))._getSettings(),s=`${e}:${t}`;if(o.host!==zK&&o.host!==s&&eo("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),n._setSettings(Object.assign(Object.assign({},o),{host:s,ssl:!1})),r.mockUserToken){let a,l;if("string"==typeof r.mockUserToken)a=r.mockUserToken,l=Qn.MOCK_USER;else{a=ZW(r.mockUserToken,null===(i=n._app)||void 0===i?void 0:i.options.projectId);const c=r.mockUserToken.sub||r.mockUserToken.user_id;if(!c)throw new j(F.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");l=new Qn(c)}n._authCredentials=new MAe(new _6(a,l))}}(i,...o)}return i}function Xt(n){if(n._terminated)throw new j(F.FAILED_PRECONDITION,"The client has already been terminated.");return n._firestoreClient||KK(n),n._firestoreClient}function KK(n){var e,t,r;const i=n._freezeSettings(),o=(l=(null===(e=n._app)||void 0===e?void 0:e.options.appId)||"",new _Re(n._databaseId,l,n._persistenceKey,(u=i).host,u.ssl,u.experimentalForceLongPolling,u.experimentalAutoDetectLongPolling,FK(u.experimentalLongPollingOptions),u.useFetchStreams));var l,u;n._componentsProvider||!(null===(t=i.localCache)||void 0===t)&&t._offlineComponentProvider&&!(null===(r=i.localCache)||void 0===r)&&r._onlineComponentProvider&&(n._componentsProvider={_offline:i.localCache._offlineComponentProvider,_online:i.localCache._onlineComponentProvider}),n._firestoreClient=new Pke(n._authCredentials,n._appCheckCredentials,n._queue,o,n._componentsProvider&&function(a){const l=a?._online.build();return{_offline:a?._offline.build(l),_online:l}}(n._componentsProvider))}function Xke(n,e){eo("enableIndexedDbPersistence() will be deprecated in the future, you can use `FirestoreSettings.cache` instead.");const t=n._freezeSettings();return function QK(n,e,t){if((n=Be(n,Ct))._firestoreClient||n._terminated)throw new j(F.FAILED_PRECONDITION,"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.");if(n._componentsProvider||n._getSettings().localCache)throw new j(F.FAILED_PRECONDITION,"SDK cache is already specified.");n._componentsProvider={_online:e,_offline:t},KK(n)}(n,cf.provider,{build:r=>new xP(r,t.cacheSizeBytes,e?.forceOwnership)}),Promise.resolve()}class au{constructor(e){this._byteString=e}static fromBase64String(e){try{return new au(ln.fromBase64String(e))}catch(t){throw new j(F.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+t)}}static fromUint8Array(e){return new au(ln.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}}class lu{constructor(...e){for(let t=0;t90)throw new j(F.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new j(F.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(e){return Ee(this._lat,e._lat)||Ee(this._long,e._long)}}class FI{constructor(e){this._values=(e||[]).map(t=>t)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(r,i){if(r.length!==i.length)return!1;for(let o=0;oe.isPrefixOf(t))||void 0!==this.fieldTransforms.find(t=>e.isPrefixOf(t.field))}Bu(){if(this.path)for(let e=0;el.covers(d.field))}else l=null,c=s.fieldTransforms;return new e1e(new ar(a),l,c)}class g_ extends cu{_toFieldTransform(e){if(2!==e.Lu)throw e.Wu(1===e.Lu?`${this._methodName}() can only appear at the top level of your update data`:`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof g_}}class BP extends cu{_toFieldTransform(e){return new Zg(e.path,new Uh)}isEqual(e){return e instanceof BP}}function du(n,e){if(tQ(n=sn(n)))return qP("Unsupported field value:",e,n),eQ(n,e);if(n instanceof cu)return function(r,i){if(!XK(i.Lu))throw i.Wu(`${r._methodName}() can only be used with update() and set()`);if(!i.path)throw i.Wu(`${r._methodName}() is not currently supported inside arrays`);const o=r._toFieldTransform(i);o&&i.fieldTransforms.push(o)}(n,e),null;if(void 0===n&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),n instanceof Array){if(e.settings.Qu&&4!==e.Lu)throw e.Wu("Nested arrays are not supported");return function(r,i){const o=[];let s=0;for(const a of r){let l=du(a,i.Uu(s));null==l&&(l={nullValue:"NULL_VALUE"}),o.push(l),s++}return{arrayValue:{values:o}}}(n,e)}return function(r,i){if(null===(r=sn(r)))return{nullValue:"NULL_VALUE"};if("number"==typeof r)return D9(i.serializer,r);if("boolean"==typeof r)return{booleanValue:r};if("string"==typeof r)return{stringValue:r};if(r instanceof Date){const o=Yt.fromDate(r);return{timestampValue:$h(i.serializer,o)}}if(r instanceof Yt){const o=new Yt(r.seconds,1e3*Math.floor(r.nanoseconds/1e3));return{timestampValue:$h(i.serializer,o)}}if(r instanceof VP)return{geoPointValue:{latitude:r.latitude,longitude:r.longitude}};if(r instanceof au)return{bytesValue:Q9(i.serializer,r._byteString)};if(r instanceof wn){const o=i.databaseId,s=r.firestore._databaseId;if(!s.isEqual(o))throw i.Wu(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${o.projectId}/${o.database}`);return{referenceValue:Q1(r.firestore._databaseId||i.databaseId,r._key.path)}}if(r instanceof FI)return s=r,a=i,{mapValue:{fields:{[M1]:{stringValue:k1},[Ph]:{arrayValue:{values:s.toArray().map(c=>{if("number"!=typeof c)throw a.Wu("VectorValues must only contain numeric values.");return j1(a.serializer,c)})}}}}};var s,a;throw i.Wu(`Unsupported field value: ${OI(r)}`)}(n,e)}function eQ(n,e){const t={};return H6(n)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):sl(n,(r,i)=>{const o=du(i,e.qu(r));null!=o&&(t[r]=o)}),{mapValue:{fields:t}}}function tQ(n){return!("object"!=typeof n||null===n||n instanceof Array||n instanceof Date||n instanceof Yt||n instanceof VP||n instanceof au||n instanceof wn||n instanceof cu||n instanceof FI)}function qP(n,e,t){if(!tQ(t)||"object"!=typeof(i=t)||null===i||Object.getPrototypeOf(i)!==Object.prototype&&null!==Object.getPrototypeOf(i)){const r=OI(t);throw e.Wu("an object"===r?n+" a custom object":n+" "+r)}var i}function __(n,e,t){if((e=sn(e))instanceof lu)return e._internalPath;if("string"==typeof e)return BI(n,e);throw UI("Field path arguments must be of type string or ",n,!1,void 0,t)}const n1e=new RegExp("[~\\*/\\[\\]]");function BI(n,e,t){if(e.search(n1e)>=0)throw UI(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,n,!1,void 0,t);try{return new lu(...e.split("."))._internalPath}catch{throw UI(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,n,!1,void 0,t)}}function UI(n,e,t,r,i){const o=r&&!r.isEmpty(),s=void 0!==i;let a=`Function ${e}() called with invalid data`;t&&(a+=" (via `toFirestore()`)"),a+=". ";let l="";return(o||s)&&(l+=" (found",o&&(l+=` in field ${r}`),s&&(l+=` in document ${i}`),l+=")"),new j(F.INVALID_ARGUMENT,a+n+l)}function nQ(n,e){return n.some(t=>t.isEqual(e))}class y_{constructor(e,t,r,i,o){this._firestore=e,this._userDataWriter=t,this._key=r,this._document=i,this._converter=o}get id(){return this._key.path.lastSegment()}get ref(){return new wn(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){const e=new r1e(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const t=this._document.data.field(zI("DocumentSnapshot.get",e));if(null!==t)return this._userDataWriter.convertValue(t)}}}class r1e extends y_{data(){return super.data()}}function zI(n,e){return"string"==typeof e?BI(n,e):e instanceof lu?e._internalPath:e._delegate._internalPath}class cQ{convertValue(e,t="none"){switch(ll(e)){case 0:return null;case 1:return e.booleanValue;case 2:return qt(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(Ws(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 11:return this.convertObject(e.mapValue,t);case 10:return this.convertVectorValue(e.mapValue);default:throw ne()}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t="none"){const r={};return sl(e,(i,o)=>{r[i]=this.convertValue(o,t)}),r}convertVectorValue(e){var t,r,i;const o=null===(i=null===(r=null===(t=e.fields)||void 0===t?void 0:t[Ph].arrayValue)||void 0===r?void 0:r.values)||void 0===i?void 0:i.map(s=>qt(s.doubleValue));return new FI(o)}convertGeoPoint(e){return new VP(qt(e.latitude),qt(e.longitude))}convertArray(e,t){return(e.values||[]).map(r=>this.convertValue(r,t))}convertServerTimestamp(e,t){switch(t){case"previous":const r=JE(e);return null==r?null:this.convertValue(r,t);case"estimate":return this.convertTimestamp(zg(e));default:return null}}convertTimestamp(e){const t=qs(e);return new Yt(t.seconds,t.nanos)}convertDocumentKey(e,t){const r=We.fromString(e);se(a7(r));const i=new Kc(r.get(1),r.get(3)),o=new te(r.popFirst(5));return i.isEqual(t)||vn(`Document ${o} contains a document reference within a different database (${i.projectId}/${i.database}) which is not supported. It will be treated as a reference in the current database (${t.projectId}/${t.database}) instead.`),o}}function qI(n,e,t){let r;return r=n?t&&(t.merge||t.mergeFields)?n.toFirestore(e,t):n.toFirestore(e):e,r}class hu{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class ff extends y_{constructor(e,t,r,i,o,s){super(e,t,r,i,s),this._firestore=e,this._firestoreImpl=e,this.metadata=o}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const t=new WI(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){const r=this._document.data.field(zI("DocumentSnapshot.get",e));if(null!==r)return this._userDataWriter.convertValue(r,t.serverTimestamps)}}}class WI extends ff{data(e={}){return super.data(e)}}class pf{constructor(e,t,r,i){this._firestore=e,this._userDataWriter=t,this._snapshot=i,this.metadata=new hu(i.hasPendingWrites,i.fromCache),this.query=r}get docs(){const e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(e,t){this._snapshot.docs.forEach(r=>{e.call(t,new WI(this._firestore,this._userDataWriter,r.key,r,new hu(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new j(F.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(i,o){if(i._snapshot.oldDocs.isEmpty()){let s=0;return i._snapshot.docChanges.map(a=>({type:"added",doc:new WI(i._firestore,i._userDataWriter,a.doc.key,a.doc,new hu(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter),oldIndex:-1,newIndex:s++}))}{let s=i._snapshot.oldDocs;return i._snapshot.docChanges.filter(a=>o||3!==a.type).map(a=>{const l=new WI(i._firestore,i._userDataWriter,a.doc.key,a.doc,new hu(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter);let c=-1,u=-1;return 0!==a.type&&(c=s.indexOf(a.doc.key),s=s.delete(a.doc.key)),1!==a.type&&(s=s.add(a.doc),u=s.indexOf(a.doc.key)),{type:s1e(a.type),doc:l,oldIndex:c,newIndex:u}})}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}}function s1e(n){switch(n){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return ne()}}function a1e(n){n=Be(n,wn);const e=Be(n.firestore,Ct);return function PK(n,e,t={}){const r=new Yn;return n.asyncQueue.enqueueAndForget(T(function*(){return function(o,s,a,l,c){const u=new NI({next:f=>{u.su(),s.enqueueAndForget(()=>GN(o,d));const p=f.docs.has(a);!p&&f.fromCache?c.reject(new j(F.UNAVAILABLE,"Failed to get document because the client is offline.")):p&&f.fromCache&&l&&"server"===l.source?c.reject(new j(F.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):c.resolve(f)},error:f=>c.reject(f)}),d=new XN(Lh(a.path),u,{includeMetadataChanges:!0,Ta:!0});return qN(o,d)}(yield df(n),n.asyncQueue,e,t,r)})),r.promise}(Xt(e),n._key).then(t=>KP(e,n,t))}class bl extends cQ{constructor(e){super(),this.firestore=e}convertBytes(e){return new au(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);return new wn(this.firestore,null,t)}}function l1e(n,e,t){n=Be(n,wn);const r=Be(n.firestore,Ct),i=qI(n.converter,e,t);return w_(r,[VI(uu(r),"setDoc",n._key,i,null!==n.converter,t).toMutation(n._key,Wt.none())])}function c1e(n,e,t,...r){n=Be(n,wn);const i=Be(n.firestore,Ct),o=uu(i);let s;return s="string"==typeof(e=sn(e))||e instanceof lu?function $P(n,e,t,r,i,o){const s=n.ju(1,e,t),a=[__(e,r,t)],l=[i];if(o.length%2!=0)throw new j(F.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let f=0;f=0;--f)if(!nQ(c,a[f])){const p=a[f];let m=l[f];m=sn(m);const _=s.Ku(p);if(m instanceof g_)c.push(p);else{const v=du(m,_);null!=v&&(c.push(p),u.set(p,v))}}const d=new ci(c);return new YK(u,d,s.fieldTransforms)}(o,"updateDoc",n._key,e,t,r):function HP(n,e,t,r){const i=n.ju(1,e,t);qP("Data must be an object, but it was:",i,r);const o=[],s=ar.empty();sl(r,(l,c)=>{const u=BI(e,l,t);c=sn(c);const d=i.Ku(u);if(c instanceof g_)o.push(u);else{const f=du(c,d);null!=f&&(o.push(u),s.set(u,f))}});const a=new ci(o);return new YK(s,a,i.fieldTransforms)}(o,"updateDoc",n._key,e),w_(i,[s.toMutation(n._key,Wt.exists(!0))])}function u1e(n,e){const t=Be(n.firestore,Ct),r=$K(n),i=qI(n.converter,e);return w_(t,[VI(uu(n.firestore),"addDoc",r._key,i,null!==n.converter,{}).toMutation(r._key,Wt.exists(!1))]).then(()=>r)}function w_(n,e){return function(r,i){const o=new Yn;return r.asyncQueue.enqueueAndForget(T(function*(){return function mke(n,e,t){return oP.apply(this,arguments)}(yield function NP(n){return PI(n).then(e=>e.syncEngine)}(r),i,o)})),o.promise}(Xt(n),e)}function KP(n,e,t){const r=t.docs.get(e._key),i=new bl(n);return new ff(n,i,e._key,r,new hu(t.hasPendingWrites,t.fromCache),e.converter)}function E_(){return new BP("serverTimestamp")}!function(e,t=!0){Eh=Lc,Fs(new Go("firestore",(r,{instanceIdentifier:i,options:o})=>{const s=r.getProvider("app").getImmediate(),a=new Ct(new kAe(r.getProvider("auth-internal")),new OAe(s,r.getProvider("app-check-internal")),function(c,u){if(!Object.prototype.hasOwnProperty.apply(c.options,["projectId"]))throw new j(F.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Kc(c.options.projectId,u)}(s,i),s);return o=Object.assign({useFetchStreams:t},o),a._setSettings(o),a},"PUBLIC").setMultipleInstances(!0)),Gn(m6,"4.7.8",e),Gn(m6,"4.7.8","esm2017")}();var KI=function(){return KI=Object.assign||function(e){for(var t,r=1,i=arguments.length;r{e[s]&&e[s](KP(c,n,d))},error:e[s+1],complete:e[s+2]};else{const d=Be(n,lr);c=Be(d.firestore,Ct),u=d._query;const f=new bl(c);l={next:p=>{e[s]&&e[s](new pf(c,f,d,p))},error:e[s+1],complete:e[s+2]},function rQ(n){if("L"===n.limitType&&0===n.explicitOrderBy.length)throw new j(F.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}(n._query)}return function(f,p,m,_){const v=new NI(_),E=new XN(p,v,m);return f.asyncQueue.enqueueAndForget(T(function*(){return qN(yield df(f),E)})),()=>{v.su(),f.asyncQueue.enqueueAndForget(T(function*(){return GN(yield df(f),E)}))}}(Xt(c),u,a,l)}(n,e,{next:t.next.bind(t),error:t.error.bind(t),complete:t.complete.bind(t)});return{unsubscribe:r}})}function S1e(n,e){return void 0===e&&(e={}),function x1e(n){return XP(n,{includeMetadataChanges:!0})}(n).pipe(Te(function(t){return function fQ(n,e){var t;void 0===e&&(e={});var r=n.data(e);return n.exists()&&"object"==typeof r&&null!==r&&e.idField?KI(KI({},r),((t={})[e.idField]=n.id,t)):r}(t,e)}))}class I_{constructor(e){return e}}const _Q="firestore",eO=new B("angularfire2.firestore-instances");function F1e(n){return(e,t)=>{const r=e.runOutsideAngular(()=>n(t));return new I_(r)}}const L1e={provide:class P1e{constructor(){return dE(_Q)}},deps:[[new fn,eO]]},V1e={provide:I_,useFactory:function O1e(n,e){const t=uE(_Q,n,e);return t&&new I_(t)},deps:[[new fn,eO],Bc]},U1e=ir(S1e,!0),z1e=ir(u1e,!0,2),j1e=ir(Kke,!0,2),tO=ir($K,!0,2),H1e=ir(Xke,!0),$1e=ir(a1e,!0),q1e=ir(Yke,!0),W1e=ir(l1e,!0,2),G1e=ir(c1e,!0,2);class nO{_attachedHost;attach(e){return this._attachedHost=e,e.attach(this)}detach(){let e=this._attachedHost;null!=e&&(this._attachedHost=null,e.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(e){this._attachedHost=e}}class QI extends nO{component;viewContainerRef;injector;componentFactoryResolver;projectableNodes;constructor(e,t,r,i,o){super(),this.component=e,this.viewContainerRef=t,this.injector=r,this.projectableNodes=o}}class yQ extends nO{templateRef;viewContainerRef;context;injector;constructor(e,t,r,i){super(),this.templateRef=e,this.viewContainerRef=t,this.context=r,this.injector=i}get origin(){return this.templateRef.elementRef}attach(e,t=this.context){return this.context=t,super.attach(e)}detach(){return this.context=void 0,super.detach()}}class K1e extends nO{element;constructor(e){super(),this.element=e instanceof je?e.nativeElement:e}}class rO{_attachedPortal;_disposeFn;_isDisposed=!1;hasAttached(){return!!this._attachedPortal}attach(e){return e instanceof QI?(this._attachedPortal=e,this.attachComponentPortal(e)):e instanceof yQ?(this._attachedPortal=e,this.attachTemplatePortal(e)):this.attachDomPortal&&e instanceof K1e?(this._attachedPortal=e,this.attachDomPortal(e)):void 0}attachDomPortal=null;detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(e){this._disposeFn=e}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class Q1e extends rO{outletElement;_appRef;_defaultInjector;_document;constructor(e,t,r,i,o){super(),this.outletElement=e,this._appRef=r,this._defaultInjector=i,this._document=o}attachComponentPortal(e){let t;if(e.viewContainerRef){const r=e.injector||e.viewContainerRef.injector,i=r.get(Ss,null,{optional:!0})||void 0;t=e.viewContainerRef.createComponent(e.component,{index:e.viewContainerRef.length,injector:r,ngModuleRef:i,projectableNodes:e.projectableNodes||void 0}),this.setDisposeFn(()=>t.destroy())}else t=vD(e.component,{elementInjector:e.injector||this._defaultInjector||ze.NULL,environmentInjector:this._appRef.injector,projectableNodes:e.projectableNodes||void 0}),this._appRef.attachView(t.hostView),this.setDisposeFn(()=>{this._appRef.viewCount>0&&this._appRef.detachView(t.hostView),t.destroy()});return this.outletElement.appendChild(this._getComponentRootNode(t)),this._attachedPortal=e,t}attachTemplatePortal(e){let t=e.viewContainerRef,r=t.createEmbeddedView(e.templateRef,e.context,{injector:e.injector});return r.rootNodes.forEach(i=>this.outletElement.appendChild(i)),r.detectChanges(),this.setDisposeFn(()=>{let i=t.indexOf(r);-1!==i&&t.remove(i)}),this._attachedPortal=e,r}attachDomPortal=e=>{const t=e.element,r=this._document.createComment("dom-portal");t.parentNode.insertBefore(r,t),this.outletElement.appendChild(t),this._attachedPortal=e,super.setDisposeFn(()=>{r.parentNode&&r.parentNode.replaceChild(t,r)})};dispose(){super.dispose(),this.outletElement.remove()}_getComponentRootNode(e){return e.hostView.rootNodes[0]}}let vQ=(()=>{class n extends rO{_moduleRef=b(Ss,{optional:!0});_document=b(Xe);_viewContainerRef=b(Ci);_isInitialized=!1;_attachedRef;constructor(){super()}get portal(){return this._attachedPortal}set portal(t){this.hasAttached()&&!t&&!this._isInitialized||(this.hasAttached()&&super.detach(),t&&super.attach(t),this._attachedPortal=t||null)}attached=new nt;get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedRef=this._attachedPortal=null}attachComponentPortal(t){t.setAttachedHost(this);const r=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,i=r.createComponent(t.component,{index:r.length,injector:t.injector||r.injector,projectableNodes:t.projectableNodes||void 0,ngModuleRef:this._moduleRef||void 0});return r!==this._viewContainerRef&&this._getRootNode().appendChild(i.hostView.rootNodes[0]),super.setDisposeFn(()=>i.destroy()),this._attachedPortal=t,this._attachedRef=i,this.attached.emit(i),i}attachTemplatePortal(t){t.setAttachedHost(this);const r=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context,{injector:t.injector});return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=r,this.attached.emit(r),r}attachDomPortal=t=>{const r=t.element,i=this._document.createComment("dom-portal");t.setAttachedHost(this),r.parentNode.insertBefore(i,r),this._getRootNode().appendChild(r),this._attachedPortal=t,super.setDisposeFn(()=>{i.parentNode&&i.parentNode.replaceChild(r,i)})};_getRootNode(){const t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:[0,"cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[ke]})}return n})(),Y1e=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({})}return n})();const T_={schedule(n){let e=requestAnimationFrame,t=cancelAnimationFrame;const{delegate:r}=T_;r&&(e=r.requestAnimationFrame,t=r.cancelAnimationFrame);const i=e(o=>{t=void 0,n(o)});return new Kt(()=>t?.(i))},requestAnimationFrame(...n){const{delegate:e}=T_;return(e?.requestAnimationFrame||requestAnimationFrame)(...n)},cancelAnimationFrame(...n){const{delegate:e}=T_;return(e?.cancelAnimationFrame||cancelAnimationFrame)(...n)},delegate:void 0};new class Z1e extends Uw{flush(e){let t;this._active=!0,e?t=e.id:(t=this._scheduled,this._scheduled=void 0);const{actions:r}=this;let i;e=e||r.shift();do{if(i=e.execute(e.state,e.delay))break}while((e=r[0])&&e.id===t&&r.shift());if(this._active=!1,i){for(;(e=r[0])&&e.id===t&&r.shift();)e.unsubscribe();throw i}}}(class X1e extends Bw{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}requestAsyncId(e,t,r=0){return null!==r&&r>0?super.requestAsyncId(e,t,r):(e.actions.push(this),e._scheduled||(e._scheduled=T_.requestAnimationFrame(()=>e.flush(void 0))))}recycleAsyncId(e,t,r=0){var i;if(null!=r?r>0:this.delay>0)return super.recycleAsyncId(e,t,r);const{actions:o}=e;null!=t&&t===e._scheduled&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==t&&(T_.cancelAnimationFrame(t),e._scheduled=void 0)}});let iO,eNe=1;const YI={};function bQ(n){return n in YI&&(delete YI[n],!0)}const tNe={setImmediate(n){const e=eNe++;return YI[e]=!0,iO||(iO=Promise.resolve()),iO.then(()=>bQ(e)&&n()),e},clearImmediate(n){bQ(n)}},{setImmediate:nNe,clearImmediate:rNe}=tNe,XI={setImmediate(...n){const{delegate:e}=XI;return(e?.setImmediate||nNe)(...n)},clearImmediate(n){const{delegate:e}=XI;return(e?.clearImmediate||rNe)(n)},delegate:void 0};new class oNe extends Uw{flush(e){this._active=!0;const t=this._scheduled;this._scheduled=void 0;const{actions:r}=this;let i;e=e||r.shift();do{if(i=e.execute(e.state,e.delay))break}while((e=r[0])&&e.id===t&&r.shift());if(this._active=!1,i){for(;(e=r[0])&&e.id===t&&r.shift();)e.unsubscribe();throw i}}}(class iNe extends Bw{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}requestAsyncId(e,t,r=0){return null!==r&&r>0?super.requestAsyncId(e,t,r):(e.actions.push(this),e._scheduled||(e._scheduled=XI.setImmediate(e.flush.bind(e,void 0))))}recycleAsyncId(e,t,r=0){var i;if(null!=r?r>0:this.delay>0)return super.recycleAsyncId(e,t,r);const{actions:o}=e;null!=t&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==t&&(XI.clearImmediate(t),e._scheduled===t&&(e._scheduled=void 0))}});function wQ(n,e=zw){return function aNe(n){return Jt((e,t)=>{let r=!1,i=null,o=null,s=!1;const a=()=>{if(o?.unsubscribe(),o=null,r){r=!1;const c=i;i=null,t.next(c)}s&&t.complete()},l=()=>{o=null,s&&t.complete()};e.subscribe(zt(t,c=>{r=!0,i=c,o||oi(n(c)).subscribe(o=zt(t,a,l))},()=>{s=!0,(!r||!o||o.closed)&&t.complete()}))})}(()=>function cNe(n=0,e,t=IEe){let r=-1;return null!=e&&(x4(e)?t=e:r=e),new vt(i=>{let o=function lNe(n){return n instanceof Date&&!isNaN(n)}(n)?+n-t.now():n;o<0&&(o=0);let s=0;return t.schedule(function(){i.closed||(i.next(s++),0<=r?this.schedule(void 0,r):i.complete())},o)})}(n,e))}let EQ=(()=>{class n{_ngZone=b(ue);_platform=b(rr);_renderer=b(Aa).createRenderer(null,null);_cleanupGlobalListener;constructor(){}_scrolled=new fe;_scrolledCount=0;scrollContainers=new Map;register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){const r=this.scrollContainers.get(t);r&&(r.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=20){return this._platform.isBrowser?new vt(r=>{this._cleanupGlobalListener||(this._cleanupGlobalListener=this._ngZone.runOutsideAngular(()=>this._renderer.listen("document","scroll",()=>this._scrolled.next())));const i=t>0?this._scrolled.pipe(wQ(t)).subscribe(r):this._scrolled.subscribe(r);return this._scrolledCount++,()=>{i.unsubscribe(),this._scrolledCount--,this._scrolledCount||(this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0)}}):de()}ngOnDestroy(){this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0,this.scrollContainers.forEach((t,r)=>this.deregister(r)),this._scrolled.complete()}ancestorScrolled(t,r){const i=this.getAncestorScrollContainers(t);return this.scrolled(r).pipe(si(o=>!o||i.indexOf(o)>-1))}getAncestorScrollContainers(t){const r=[];return this.scrollContainers.forEach((i,o)=>{this._scrollableContainsElement(o,t)&&r.push(o)}),r}_scrollableContainsElement(t,r){let i=Ya(r),o=t.getElementRef().nativeElement;do{if(i==o)return!0}while(i=i.parentElement);return!1}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),IQ=(()=>{class n{_platform=b(rr);_listeners;_viewportSize;_change=new fe;_document=b(Xe,{optional:!0});constructor(){const t=b(ue),r=b(Aa).createRenderer(null,null);t.runOutsideAngular(()=>{if(this._platform.isBrowser){const i=o=>this._change.next(o);this._listeners=[r.listen("window","resize",i),r.listen("window","orientationchange",i)]}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){this._listeners?.forEach(t=>t()),this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();const t={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),t}getViewportRect(){const t=this.getViewportScrollPosition(),{width:r,height:i}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+i,right:t.left+r,height:i,width:r}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const t=this._document,r=this._getWindow(),i=t.documentElement,o=i.getBoundingClientRect();return{top:-o.top||t.body.scrollTop||r.scrollY||i.scrollTop||0,left:-o.left||t.body.scrollLeft||r.scrollX||i.scrollLeft||0}}change(t=20){return t>0?this._change.pipe(wQ(t)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){const t=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:t.innerWidth,height:t.innerHeight}:{width:0,height:0}}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),oO=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({})}return n})(),TQ=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[Km,oO,Km,oO]})}return n})();const CQ=tEe();class hNe{_viewportRuler;_previousHTMLStyles={top:"",left:""};_previousScrollPosition;_isEnabled=!1;_document;constructor(e,t){this._viewportRuler=e,this._document=t}attach(){}enable(){if(this._canBeEnabled()){const e=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=e.style.left||"",this._previousHTMLStyles.top=e.style.top||"",e.style.left=xn(-this._previousScrollPosition.left),e.style.top=xn(-this._previousScrollPosition.top),e.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const e=this._document.documentElement,r=e.style,i=this._document.body.style,o=r.scrollBehavior||"",s=i.scrollBehavior||"";this._isEnabled=!1,r.left=this._previousHTMLStyles.left,r.top=this._previousHTMLStyles.top,e.classList.remove("cdk-global-scrollblock"),CQ&&(r.scrollBehavior=i.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),CQ&&(r.scrollBehavior=o,i.scrollBehavior=s)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const t=this._document.body,r=this._viewportRuler.getViewportSize();return t.scrollHeight>r.height||t.scrollWidth>r.width}}class fNe{_scrollDispatcher;_ngZone;_viewportRuler;_config;_scrollSubscription=null;_overlayRef;_initialScrollPosition;constructor(e,t,r,i){this._scrollDispatcher=e,this._ngZone=t,this._viewportRuler=r,this._config=i}attach(e){this._overlayRef=e}enable(){if(this._scrollSubscription)return;const e=this._scrollDispatcher.scrolled(0).pipe(si(t=>!t||!this._overlayRef.overlayElement.contains(t.getElementRef().nativeElement)));this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=e.subscribe(()=>{const t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=e.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}_detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}class xQ{enable(){}disable(){}attach(){}}function sO(n,e){return e.some(t=>n.bottomt.bottom||n.rightt.right)}function SQ(n,e){return e.some(t=>n.topt.bottom||n.leftt.right)}class pNe{_scrollDispatcher;_viewportRuler;_ngZone;_config;_scrollSubscription=null;_overlayRef;constructor(e,t,r,i){this._scrollDispatcher=e,this._viewportRuler=t,this._ngZone=r,this._config=i}attach(e){this._overlayRef=e}enable(){this._scrollSubscription||(this._scrollSubscription=this._scrollDispatcher.scrolled(this._config?this._config.scrollThrottle:0).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){const t=this._overlayRef.overlayElement.getBoundingClientRect(),{width:r,height:i}=this._viewportRuler.getViewportSize();sO(t,[{width:r,height:i,bottom:i,right:r,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}}))}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}let mNe=(()=>{class n{_scrollDispatcher=b(EQ);_viewportRuler=b(IQ);_ngZone=b(ue);_document=b(Xe);constructor(){}noop=()=>new xQ;close=t=>new fNe(this._scrollDispatcher,this._ngZone,this._viewportRuler,t);block=()=>new hNe(this._viewportRuler,this._document);reposition=t=>new pNe(this._scrollDispatcher,this._viewportRuler,this._ngZone,t);static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();class DQ{positionStrategy;scrollStrategy=new xQ;panelClass="";hasBackdrop=!1;backdropClass="cdk-overlay-dark-backdrop";width;height;minWidth;minHeight;maxWidth;maxHeight;direction;disposeOnNavigation=!1;constructor(e){if(e){const t=Object.keys(e);for(const r of t)void 0!==e[r]&&(this[r]=e[r])}}}class gNe{connectionPair;scrollableViewProperties;constructor(e,t){this.connectionPair=e,this.scrollableViewProperties=t}}let AQ=(()=>{class n{_attachedOverlays=[];_document=b(Xe);_isAttached;constructor(){}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){const r=this._attachedOverlays.indexOf(t);r>-1&&this._attachedOverlays.splice(r,1),0===this._attachedOverlays.length&&this.detach()}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),_Ne=(()=>{class n extends AQ{_ngZone=b(ue);_renderer=b(Aa).createRenderer(null,null);_cleanupKeydown;add(t){super.add(t),this._isAttached||(this._ngZone.runOutsideAngular(()=>{this._cleanupKeydown=this._renderer.listen("body","keydown",this._keydownListener)}),this._isAttached=!0)}detach(){this._isAttached&&(this._cleanupKeydown?.(),this._isAttached=!1)}_keydownListener=t=>{const r=this._attachedOverlays;for(let i=r.length-1;i>-1;i--)if(r[i]._keydownEvents.observers.length>0){this._ngZone.run(()=>r[i]._keydownEvents.next(t));break}};static \u0275fac=(()=>{let t;return function(i){return(t||(t=bt(n)))(i||n)}})();static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),yNe=(()=>{class n extends AQ{_platform=b(rr);_ngZone=b(ue,{optional:!0});_cursorOriginalValue;_cursorStyleIsSet=!1;_pointerDownEventTarget;add(t){if(super.add(t),!this._isAttached){const r=this._document.body;this._ngZone?this._ngZone.runOutsideAngular(()=>this._addEventListeners(r)):this._addEventListeners(r),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=r.style.cursor,r.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){if(this._isAttached){const t=this._document.body;t.removeEventListener("pointerdown",this._pointerDownListener,!0),t.removeEventListener("click",this._clickListener,!0),t.removeEventListener("auxclick",this._clickListener,!0),t.removeEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&this._cursorStyleIsSet&&(t.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1}}_addEventListeners(t){t.addEventListener("pointerdown",this._pointerDownListener,!0),t.addEventListener("click",this._clickListener,!0),t.addEventListener("auxclick",this._clickListener,!0),t.addEventListener("contextmenu",this._clickListener,!0)}_pointerDownListener=t=>{this._pointerDownEventTarget=ks(t)};_clickListener=t=>{const r=ks(t),i="click"===t.type&&this._pointerDownEventTarget?this._pointerDownEventTarget:r;this._pointerDownEventTarget=null;const o=this._attachedOverlays.slice();for(let s=o.length-1;s>-1;s--){const a=o[s];if(a._outsidePointerEvents.observers.length<1||!a.hasAttached())continue;if(RQ(a.overlayElement,r)||RQ(a.overlayElement,i))break;const l=a._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>l.next(t)):l.next(t)}};static \u0275fac=(()=>{let t;return function(i){return(t||(t=bt(n)))(i||n)}})();static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function RQ(n,e){const t=typeof ShadowRoot<"u"&&ShadowRoot;let r=e;for(;r;){if(r===n)return!0;r=t&&r instanceof ShadowRoot?r.host:r.parentNode}return!1}let MQ=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["ng-component"]],hostAttrs:["cdk-overlay-style-loader",""],decls:0,vars:0,template:function(r,i){},styles:[".cdk-overlay-container,.cdk-global-overlay-wrapper{pointer-events:none;top:0;left:0;height:100%;width:100%}.cdk-overlay-container{position:fixed}@layer cdk-overlay{.cdk-overlay-container{z-index:1000}}.cdk-overlay-container:empty{display:none}.cdk-global-overlay-wrapper{display:flex;position:absolute}@layer cdk-overlay{.cdk-global-overlay-wrapper{z-index:1000}}.cdk-overlay-pane{position:absolute;pointer-events:auto;box-sizing:border-box;display:flex;max-width:100%;max-height:100%}@layer cdk-overlay{.cdk-overlay-pane{z-index:1000}}.cdk-overlay-backdrop{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:auto;-webkit-tap-highlight-color:rgba(0,0,0,0);opacity:0}@layer cdk-overlay{.cdk-overlay-backdrop{z-index:1000;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}}.cdk-overlay-backdrop-showing{opacity:1}@media(forced-colors: active){.cdk-overlay-backdrop-showing{opacity:.6}}@layer cdk-overlay{.cdk-overlay-dark-backdrop{background:rgba(0,0,0,.32)}}.cdk-overlay-transparent-backdrop{transition:visibility 1ms linear,opacity 1ms linear;visibility:hidden;opacity:1}.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing,.cdk-high-contrast-active .cdk-overlay-transparent-backdrop{opacity:0;visibility:visible}.cdk-overlay-backdrop-noop-animation{transition:none}.cdk-overlay-connected-position-bounding-box{position:absolute;display:flex;flex-direction:column;min-width:1px;min-height:1px}@layer cdk-overlay{.cdk-overlay-connected-position-bounding-box{z-index:1000}}.cdk-global-scrollblock{position:fixed;width:100%;overflow-y:scroll}"],encapsulation:2,changeDetection:0})}return n})(),kQ=(()=>{class n{_platform=b(rr);_containerElement;_document=b(Xe);_styleLoader=b(Ka);constructor(){}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._loadStyles(),this._containerElement||this._createContainer(),this._containerElement}_createContainer(){const t="cdk-overlay-container";if(this._platform.isBrowser||z5()){const i=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let o=0;o{const e=this.element;clearTimeout(this._fallbackTimeout),this._cleanupTransitionEnd?.(),this._cleanupTransitionEnd=this._renderer.listen(e,"transitionend",this.dispose),this._fallbackTimeout=setTimeout(this.dispose,500),e.style.pointerEvents="none",e.classList.remove("cdk-overlay-backdrop-showing")})}dispose=()=>{clearTimeout(this._fallbackTimeout),this._cleanupClick?.(),this._cleanupTransitionEnd?.(),this._cleanupClick=this._cleanupTransitionEnd=this._fallbackTimeout=void 0,this.element.remove()}}class bNe{_portalOutlet;_host;_pane;_config;_ngZone;_keyboardDispatcher;_document;_location;_outsideClickDispatcher;_animationsDisabled;_injector;_renderer;_backdropClick=new fe;_attachments=new fe;_detachments=new fe;_positionStrategy;_scrollStrategy;_locationChanges=Kt.EMPTY;_backdropRef=null;_previousHostParent;_keydownEvents=new fe;_outsidePointerEvents=new fe;_renders=new fe;_afterRenderRef;_afterNextRenderRef;constructor(e,t,r,i,o,s,a,l,c,u=!1,d,f){this._portalOutlet=e,this._host=t,this._pane=r,this._config=i,this._ngZone=o,this._keyboardDispatcher=s,this._document=a,this._location=l,this._outsideClickDispatcher=c,this._animationsDisabled=u,this._injector=d,this._renderer=f,i.scrollStrategy&&(this._scrollStrategy=i.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=i.positionStrategy,this._afterRenderRef=Wn(()=>ex(()=>{this._renders.next()},{injector:this._injector}))}get overlayElement(){return this._pane}get backdropElement(){return this._backdropRef?.element||null}get hostElement(){return this._host}attach(e){!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host);const t=this._portalOutlet.attach(e);return this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._afterNextRenderRef?.destroy(),this._afterNextRenderRef=Cs(()=>{this.hasAttached()&&this.updatePosition()},{injector:this._injector}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),"function"==typeof t?.onDestroy&&t.onDestroy(()=>{this.hasAttached()&&this._ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>this.detach()))}),t}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const e=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenEmpty(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),e}dispose(){const e=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this._backdropRef?.dispose(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host?.remove(),this._afterNextRenderRef?.destroy(),this._previousHostParent=this._pane=this._host=this._backdropRef=null,e&&this._detachments.next(),this._detachments.complete(),this._afterRenderRef.destroy(),this._renders.complete()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(e){e!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=e,this.hasAttached()&&(e.attach(this),this.updatePosition()))}updateSize(e){this._config={...this._config,...e},this._updateElementSize()}setDirection(e){this._config={...this._config,direction:e},this._updateElementDirection()}addPanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!0)}removePanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!1)}getDirection(){const e=this._config.direction;return e?"string"==typeof e?e:e.value:"ltr"}updateScrollStrategy(e){e!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=e,this.hasAttached()&&(e.attach(this),e.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const e=this._pane.style;e.width=xn(this._config.width),e.height=xn(this._config.height),e.minWidth=xn(this._config.minWidth),e.minHeight=xn(this._config.minHeight),e.maxWidth=xn(this._config.maxWidth),e.maxHeight=xn(this._config.maxHeight)}_togglePointerEvents(e){this._pane.style.pointerEvents=e?"":"none"}_attachBackdrop(){const e="cdk-overlay-backdrop-showing";this._backdropRef?.dispose(),this._backdropRef=new vNe(this._document,this._renderer,this._ngZone,t=>{this._backdropClick.next(t)}),this._animationsDisabled&&this._backdropRef.element.classList.add("cdk-overlay-backdrop-noop-animation"),this._config.backdropClass&&this._toggleClasses(this._backdropRef.element,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropRef.element,this._host),!this._animationsDisabled&&typeof requestAnimationFrame<"u"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>this._backdropRef?.element.classList.add(e))}):this._backdropRef.element.classList.add(e)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){this._animationsDisabled?(this._backdropRef?.dispose(),this._backdropRef=null):this._backdropRef?.detach()}_toggleClasses(e,t,r){const i=jw(t||[]).filter(o=>!!o);i.length&&(r?e.classList.add(...i):e.classList.remove(...i))}_detachContentWhenEmpty(){this._ngZone.runOutsideAngular(()=>{const e=this._renders.pipe(At(Ym(this._attachments,this._detachments))).subscribe(()=>{(!this._pane||!this._host||0===this._pane.children.length)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._host.remove()),e.unsubscribe())})})}_disposeScrollStrategy(){const e=this._scrollStrategy;e?.disable(),e?.detach?.()}}const NQ="cdk-overlay-connected-position-bounding-box",wNe=/([A-Za-z%]+)$/;class ENe{_viewportRuler;_document;_platform;_overlayContainer;_overlayRef;_isInitialRender;_lastBoundingBoxSize={width:0,height:0};_isPushed=!1;_canPush=!0;_growAfterOpen=!1;_hasFlexibleDimensions=!0;_positionLocked=!1;_originRect;_overlayRect;_viewportRect;_containerRect;_viewportMargin=0;_scrollables=[];_preferredPositions=[];_origin;_pane;_isDisposed;_boundingBox;_lastPosition;_lastScrollVisibility;_positionChanges=new fe;_resizeSubscription=Kt.EMPTY;_offsetX=0;_offsetY=0;_transformOriginSelector;_appliedPanelClasses=[];_previousPushAmount;positionChanges=this._positionChanges;get positions(){return this._preferredPositions}constructor(e,t,r,i,o){this._viewportRuler=t,this._document=r,this._platform=i,this._overlayContainer=o,this.setOrigin(e)}attach(e){this._validatePositions(),e.hostElement.classList.add(NQ),this._overlayRef=e,this._boundingBox=e.hostElement,this._pane=e.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition)return void this.reapplyLastPosition();this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();const e=this._originRect,t=this._overlayRect,r=this._viewportRect,i=this._containerRect,o=[];let s;for(let a of this._preferredPositions){let l=this._getOriginPoint(e,i,a),c=this._getOverlayPoint(l,t,a),u=this._getOverlayFit(c,t,r,a);if(u.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(a,l);this._canFitWithFlexibleDimensions(u,c,r)?o.push({position:a,origin:l,overlayRect:t,boundingBoxRect:this._calculateBoundingBoxRect(l,a)}):(!s||s.overlayFit.visibleAreal&&(l=u,a=c)}return this._isPushed=!1,void this._applyPosition(a.position,a.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(s.position,s.originPoint);this._applyPosition(s.position,s.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&fu(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(NQ),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(this._isDisposed||!this._platform.isBrowser)return;const e=this._lastPosition;if(e){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();const t=this._getOriginPoint(this._originRect,this._containerRect,e);this._applyPosition(e,t)}else this.apply()}withScrollableContainers(e){return this._scrollables=e,this}withPositions(e){return this._preferredPositions=e,-1===e.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(e){return this._viewportMargin=e,this}withFlexibleDimensions(e=!0){return this._hasFlexibleDimensions=e,this}withGrowAfterOpen(e=!0){return this._growAfterOpen=e,this}withPush(e=!0){return this._canPush=e,this}withLockedPosition(e=!0){return this._positionLocked=e,this}setOrigin(e){return this._origin=e,this}withDefaultOffsetX(e){return this._offsetX=e,this}withDefaultOffsetY(e){return this._offsetY=e,this}withTransformOriginOn(e){return this._transformOriginSelector=e,this}_getOriginPoint(e,t,r){let i,o;if("center"==r.originX)i=e.left+e.width/2;else{const s=this._isRtl()?e.right:e.left,a=this._isRtl()?e.left:e.right;i="start"==r.originX?s:a}return t.left<0&&(i-=t.left),o="center"==r.originY?e.top+e.height/2:"top"==r.originY?e.top:e.bottom,t.top<0&&(o-=t.top),{x:i,y:o}}_getOverlayPoint(e,t,r){let i,o;return i="center"==r.overlayX?-t.width/2:"start"===r.overlayX?this._isRtl()?-t.width:0:this._isRtl()?0:-t.width,o="center"==r.overlayY?-t.height/2:"top"==r.overlayY?0:-t.height,{x:e.x+i,y:e.y+o}}_getOverlayFit(e,t,r,i){const o=OQ(t);let{x:s,y:a}=e,l=this._getOffset(i,"x"),c=this._getOffset(i,"y");l&&(s+=l),c&&(a+=c);let f=0-a,p=a+o.height-r.height,m=this._subtractOverflows(o.width,0-s,s+o.width-r.width),_=this._subtractOverflows(o.height,f,p),v=m*_;return{visibleArea:v,isCompletelyWithinViewport:o.width*o.height===v,fitsInViewportVertically:_===o.height,fitsInViewportHorizontally:m==o.width}}_canFitWithFlexibleDimensions(e,t,r){if(this._hasFlexibleDimensions){const i=r.bottom-t.y,o=r.right-t.x,s=PQ(this._overlayRef.getConfig().minHeight),a=PQ(this._overlayRef.getConfig().minWidth);return(e.fitsInViewportVertically||null!=s&&s<=i)&&(e.fitsInViewportHorizontally||null!=a&&a<=o)}return!1}_pushOverlayOnScreen(e,t,r){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};const i=OQ(t),o=this._viewportRect,s=Math.max(e.x+i.width-o.width,0),a=Math.max(e.y+i.height-o.height,0),l=Math.max(o.top-r.top-e.y,0),c=Math.max(o.left-r.left-e.x,0);let u=0,d=0;return u=i.width<=o.width?c||-s:e.xm&&!this._isInitialRender&&!this._growAfterOpen&&(s=e.y-m/2)}if("end"===t.overlayX&&!i||"start"===t.overlayX&&i)f=r.width-e.x+2*this._viewportMargin,u=e.x-this._viewportMargin;else if("start"===t.overlayX&&!i||"end"===t.overlayX&&i)d=e.x,u=r.right-e.x;else{const p=Math.min(r.right-e.x+r.left,e.x),m=this._lastBoundingBoxSize.width;u=2*p,d=e.x-p,u>m&&!this._isInitialRender&&!this._growAfterOpen&&(d=e.x-m/2)}return{top:s,left:d,bottom:a,right:f,width:u,height:o}}_setBoundingBoxStyles(e,t){const r=this._calculateBoundingBoxRect(e,t);!this._isInitialRender&&!this._growAfterOpen&&(r.height=Math.min(r.height,this._lastBoundingBoxSize.height),r.width=Math.min(r.width,this._lastBoundingBoxSize.width));const i={};if(this._hasExactPosition())i.top=i.left="0",i.bottom=i.right=i.maxHeight=i.maxWidth="",i.width=i.height="100%";else{const o=this._overlayRef.getConfig().maxHeight,s=this._overlayRef.getConfig().maxWidth;i.height=xn(r.height),i.top=xn(r.top),i.bottom=xn(r.bottom),i.width=xn(r.width),i.left=xn(r.left),i.right=xn(r.right),i.alignItems="center"===t.overlayX?"center":"end"===t.overlayX?"flex-end":"flex-start",i.justifyContent="center"===t.overlayY?"center":"bottom"===t.overlayY?"flex-end":"flex-start",o&&(i.maxHeight=xn(o)),s&&(i.maxWidth=xn(s))}this._lastBoundingBoxSize=r,fu(this._boundingBox.style,i)}_resetBoundingBoxStyles(){fu(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){fu(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(e,t){const r={},i=this._hasExactPosition(),o=this._hasFlexibleDimensions,s=this._overlayRef.getConfig();if(i){const u=this._viewportRuler.getViewportScrollPosition();fu(r,this._getExactOverlayY(t,e,u)),fu(r,this._getExactOverlayX(t,e,u))}else r.position="static";let a="",l=this._getOffset(t,"x"),c=this._getOffset(t,"y");l&&(a+=`translateX(${l}px) `),c&&(a+=`translateY(${c}px)`),r.transform=a.trim(),s.maxHeight&&(i?r.maxHeight=xn(s.maxHeight):o&&(r.maxHeight="")),s.maxWidth&&(i?r.maxWidth=xn(s.maxWidth):o&&(r.maxWidth="")),fu(this._pane.style,r)}_getExactOverlayY(e,t,r){let i={top:"",bottom:""},o=this._getOverlayPoint(t,this._overlayRect,e);return this._isPushed&&(o=this._pushOverlayOnScreen(o,this._overlayRect,r)),"bottom"===e.overlayY?i.bottom=this._document.documentElement.clientHeight-(o.y+this._overlayRect.height)+"px":i.top=xn(o.y),i}_getExactOverlayX(e,t,r){let s,i={left:"",right:""},o=this._getOverlayPoint(t,this._overlayRect,e);return this._isPushed&&(o=this._pushOverlayOnScreen(o,this._overlayRect,r)),s=this._isRtl()?"end"===e.overlayX?"left":"right":"end"===e.overlayX?"right":"left","right"===s?i.right=this._document.documentElement.clientWidth-(o.x+this._overlayRect.width)+"px":i.left=xn(o.x),i}_getScrollVisibility(){const e=this._getOriginRect(),t=this._pane.getBoundingClientRect(),r=this._scrollables.map(i=>i.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:SQ(e,r),isOriginOutsideView:sO(e,r),isOverlayClipped:SQ(t,r),isOverlayOutsideView:sO(t,r)}}_subtractOverflows(e,...t){return t.reduce((r,i)=>r-Math.max(i,0),e)}_getNarrowedViewportRect(){const e=this._document.documentElement.clientWidth,t=this._document.documentElement.clientHeight,r=this._viewportRuler.getViewportScrollPosition();return{top:r.top+this._viewportMargin,left:r.left+this._viewportMargin,right:r.left+e-this._viewportMargin,bottom:r.top+t-this._viewportMargin,width:e-2*this._viewportMargin,height:t-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(e,t){return"x"===t?null==e.offsetX?this._offsetX:e.offsetX:null==e.offsetY?this._offsetY:e.offsetY}_validatePositions(){}_addPanelClasses(e){this._pane&&jw(e).forEach(t=>{""!==t&&-1===this._appliedPanelClasses.indexOf(t)&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(e=>{this._pane.classList.remove(e)}),this._appliedPanelClasses=[])}_getOriginRect(){const e=this._origin;if(e instanceof je)return e.nativeElement.getBoundingClientRect();if(e instanceof Element)return e.getBoundingClientRect();const t=e.width||0,r=e.height||0;return{top:e.y,bottom:e.y+r,left:e.x,right:e.x+t,height:r,width:t}}}function fu(n,e){for(let t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function PQ(n){if("number"!=typeof n&&null!=n){const[e,t]=n.split(wNe);return t&&"px"!==t?null:parseFloat(e)}return n||null}function OQ(n){return{top:Math.floor(n.top),right:Math.floor(n.right),bottom:Math.floor(n.bottom),left:Math.floor(n.left),width:Math.floor(n.width),height:Math.floor(n.height)}}const FQ="cdk-global-overlay-wrapper";class TNe{_overlayRef;_cssPosition="static";_topOffset="";_bottomOffset="";_alignItems="";_xPosition="";_xOffset="";_width="";_height="";_isDisposed=!1;attach(e){const t=e.getConfig();this._overlayRef=e,this._width&&!t.width&&e.updateSize({width:this._width}),this._height&&!t.height&&e.updateSize({height:this._height}),e.hostElement.classList.add(FQ),this._isDisposed=!1}top(e=""){return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}left(e=""){return this._xOffset=e,this._xPosition="left",this}bottom(e=""){return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}right(e=""){return this._xOffset=e,this._xPosition="right",this}start(e=""){return this._xOffset=e,this._xPosition="start",this}end(e=""){return this._xOffset=e,this._xPosition="end",this}width(e=""){return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}height(e=""){return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}centerHorizontally(e=""){return this.left(e),this._xPosition="center",this}centerVertically(e=""){return this.top(e),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,r=this._overlayRef.getConfig(),{width:i,height:o,maxWidth:s,maxHeight:a}=r,l=!("100%"!==i&&"100vw"!==i||s&&"100%"!==s&&"100vw"!==s),c=!("100%"!==o&&"100vh"!==o||a&&"100%"!==a&&"100vh"!==a),u=this._xPosition,d=this._xOffset,f="rtl"===this._overlayRef.getConfig().direction;let p="",m="",_="";l?_="flex-start":"center"===u?(_="center",f?m=d:p=d):f?"left"===u||"end"===u?(_="flex-end",p=d):("right"===u||"start"===u)&&(_="flex-start",m=d):"left"===u||"start"===u?(_="flex-start",p=d):("right"===u||"end"===u)&&(_="flex-end",m=d),e.position=this._cssPosition,e.marginLeft=l?"0":p,e.marginTop=c?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=l?"0":m,t.justifyContent=_,t.alignItems=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,r=t.style;t.classList.remove(FQ),r.justifyContent=r.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}}let CNe=(()=>{class n{_viewportRuler=b(IQ);_document=b(Xe);_platform=b(rr);_overlayContainer=b(kQ);constructor(){}global(){return new TNe}flexibleConnectedTo(t){return new ENe(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),pu=(()=>{class n{scrollStrategies=b(mNe);_overlayContainer=b(kQ);_positionBuilder=b(CNe);_keyboardDispatcher=b(_Ne);_injector=b(ze);_ngZone=b(ue);_document=b(Xe);_directionality=b(Gw);_location=b(qd);_outsideClickDispatcher=b(yNe);_animationsModuleType=b(Ts,{optional:!0});_idGenerator=b(Xa);_renderer=b(Aa).createRenderer(null,null);_appRef;_styleLoader=b(Ka);constructor(){}create(t){this._styleLoader.load(MQ);const r=this._createHostElement(),i=this._createPaneElement(r),o=this._createPortalOutlet(i),s=new DQ(t);return s.direction=s.direction||this._directionality.value,new bNe(o,r,i,s,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher,"NoopAnimations"===this._animationsModuleType,this._injector.get(mr),this._renderer)}position(){return this._positionBuilder}_createPaneElement(t){const r=this._document.createElement("div");return r.id=this._idGenerator.getId("cdk-overlay-"),r.classList.add("cdk-overlay-pane"),t.appendChild(r),r}_createHostElement(){const t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(tr)),new Q1e(t,null,this._appRef,this._injector,this._document)}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const DNe={provide:new B("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{const n=b(pu);return()=>n.scrollStrategies.reposition()}}),deps:[pu],useFactory:function SNe(n){return()=>n.scrollStrategies.reposition()}};let ANe=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({providers:[pu,DNe],imports:[Km,Y1e,TQ,TQ]})}return n})();function RNe(n,e){if(1&n){const t=La();W(0,"div",1)(1,"button",2),Ve("click",function(){return vi(t),bi(Ln().action())}),Oe(2),K()()}if(2&n){const t=Ln();re(2),Va(" ",t.data.action," ")}}const MNe=["label"];function kNe(n,e){}const NNe=Math.pow(2,31)-1;class aO{_overlayRef;instance;containerInstance;_afterDismissed=new fe;_afterOpened=new fe;_onAction=new fe;_durationTimeoutId;_dismissedByAction=!1;constructor(e,t){this._overlayRef=t,this.containerInstance=e,e._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete(),this.dismiss()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(e){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(e,NNe))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}}const LQ=new B("MatSnackBarData");class ZI{politeness="assertive";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"}let VQ=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return n})(),BQ=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return n})(),UQ=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return n})(),PNe=(()=>{class n{snackBarRef=b(aO);data=b(LQ);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["mat-button","","matSnackBarAction","",3,"click"]],template:function(r,i){1&r&&(W(0,"div",0),Oe(1),K(),et(2,RNe,3,1,"div",1)),2&r&&(re(),Va(" ",i.data.message,"\n"),re(),Pt(i.hasAction?2:-1))},dependencies:[dh,VQ,BQ,UQ],styles:[".mat-mdc-simple-snack-bar{display:flex}"],encapsulation:2,changeDetection:0})}return n})();const ONe={snackBarState:aR("state",[Zm("void, hidden",Ps({transform:"scale(0.8)",opacity:0})),Zm("visible",Ps({transform:"scale(1)",opacity:1})),Jm("* => visible",Xm("150ms cubic-bezier(0, 0, 0.2, 1)")),Jm("* => void, * => hidden",Xm("75ms cubic-bezier(0.4, 0.0, 1, 1)",Ps({opacity:0})))])};let zQ=(()=>{class n extends rO{_ngZone=b(ue);_elementRef=b(je);_changeDetectorRef=b(Uo);_platform=b(rr);snackBarConfig=b(ZI);_document=b(Xe);_trackedModals=new Set;_announceDelay=150;_announceTimeoutId;_destroyed=!1;_portalOutlet;_onAnnounce=new fe;_onExit=new fe;_onEnter=new fe;_animationState="void";_live;_label;_role;_liveElementId=b(Xa).getId("mat-snack-bar-container-live-");constructor(){super();const t=this.snackBarConfig;this._live="assertive"!==t.politeness||t.announcementMessage?"off"===t.politeness?"off":"polite":"assertive",this._platform.FIREFOX&&("polite"===this._live&&(this._role="status"),"assertive"===this._live&&(this._role="alert"))}attachComponentPortal(t){this._assertNotAttached();const r=this._portalOutlet.attachComponentPortal(t);return this._afterPortalAttached(),r}attachTemplatePortal(t){this._assertNotAttached();const r=this._portalOutlet.attachTemplatePortal(t);return this._afterPortalAttached(),r}attachDomPortal=t=>{this._assertNotAttached();const r=this._portalOutlet.attachDomPortal(t);return this._afterPortalAttached(),r};onAnimationEnd(t){const{fromState:r,toState:i}=t;if(("void"===i&&"void"!==r||"hidden"===i)&&this._completeExit(),"visible"===i){const o=this._onEnter;this._ngZone.run(()=>{o.next(),o.complete()})}}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.markForCheck(),this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce())}exit(){return this._ngZone.run(()=>{this._animationState="hidden",this._changeDetectorRef.markForCheck(),this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId)}),this._onExit}ngOnDestroy(){this._destroyed=!0,this._clearFromModals(),this._completeExit()}_completeExit(){queueMicrotask(()=>{this._onExit.next(),this._onExit.complete()})}_afterPortalAttached(){const t=this._elementRef.nativeElement,r=this.snackBarConfig.panelClass;r&&(Array.isArray(r)?r.forEach(s=>t.classList.add(s)):t.classList.add(r)),this._exposeToModals();const i=this._label.nativeElement,o="mdc-snackbar__label";i.classList.toggle(o,!i.querySelector(`.${o}`))}_exposeToModals(){const t=this._liveElementId,r=this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');for(let i=0;i{const r=t.getAttribute("aria-owns");if(r){const i=r.replace(this._liveElementId,"").trim();i.length>0?t.setAttribute("aria-owns",i):t.removeAttribute("aria-owns")}}),this._trackedModals.clear()}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{const t=this._elementRef.nativeElement.querySelector("[aria-hidden]"),r=this._elementRef.nativeElement.querySelector("[aria-live]");if(t&&r){let i=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&(i=document.activeElement),t.removeAttribute("aria-hidden"),r.appendChild(t),i?.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-snack-bar-container"]],viewQuery:function(r,i){if(1&r&&(qn(vQ,7),qn(MNe,7)),2&r){let o;Qe(o=Ye())&&(i._portalOutlet=o.first),Qe(o=Ye())&&(i._label=o.first)}},hostAttrs:[1,"mdc-snackbar","mat-mdc-snack-bar-container"],hostVars:1,hostBindings:function(r,i){1&r&&GS("@state.done",function(s){return i.onAnimationEnd(s)}),2&r&&$S("@state",i._animationState)},features:[ke],decls:6,vars:3,consts:[["label",""],[1,"mdc-snackbar__surface","mat-mdc-snackbar-surface"],[1,"mat-mdc-snack-bar-label"],["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(r,i){1&r&&(W(0,"div",1)(1,"div",2,0)(3,"div",3),et(4,kNe,0,0,"ng-template",4),K(),Pe(5,"div"),K()()),2&r&&(re(5),Ke("aria-live",i._live)("role",i._role)("id",i._liveElementId))},dependencies:[vQ],styles:[".mat-mdc-snack-bar-container{display:flex;align-items:center;justify-content:center;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0);margin:8px}.mat-mdc-snack-bar-handset .mat-mdc-snack-bar-container{width:100vw}.mat-mdc-snackbar-surface{box-shadow:0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);display:flex;align-items:center;justify-content:flex-start;box-sizing:border-box;padding-left:0;padding-right:8px}[dir=rtl] .mat-mdc-snackbar-surface{padding-right:0;padding-left:8px}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{min-width:344px;max-width:672px}.mat-mdc-snack-bar-handset .mat-mdc-snackbar-surface{width:100%;min-width:0}@media(forced-colors: active){.mat-mdc-snackbar-surface{outline:solid 1px}}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{color:var(--mdc-snackbar-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mdc-snackbar-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mdc-snackbar-container-color, var(--mat-sys-inverse-surface))}.mdc-snackbar__label{width:100%;flex-grow:1;box-sizing:border-box;margin:0;padding:14px 8px 14px 16px}[dir=rtl] .mdc-snackbar__label{padding-left:8px;padding-right:16px}.mat-mdc-snack-bar-container .mdc-snackbar__label{font-family:var(--mdc-snackbar-supporting-text-font, var(--mat-sys-body-medium-font));font-size:var(--mdc-snackbar-supporting-text-size, var(--mat-sys-body-medium-size));font-weight:var(--mdc-snackbar-supporting-text-weight, var(--mat-sys-body-medium-weight));line-height:var(--mdc-snackbar-supporting-text-line-height, var(--mat-sys-body-medium-line-height))}.mat-mdc-snack-bar-actions{display:flex;flex-shrink:0;align-items:center;box-sizing:border-box}.mat-mdc-snack-bar-handset,.mat-mdc-snack-bar-container,.mat-mdc-snack-bar-label{flex:1 1 auto}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled).mat-unthemed{color:var(--mat-snack-bar-button-color, var(--mat-sys-inverse-primary))}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled){--mat-text-button-state-layer-color:currentColor;--mat-text-button-ripple-color:currentColor}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled) .mat-ripple-element{opacity:.1}"],encapsulation:2,data:{animation:[ONe.snackBarState]}})}return n})();const LNe=new B("mat-snack-bar-default-options",{providedIn:"root",factory:function FNe(){return new ZI}});let VNe=(()=>{class n{_overlay=b(pu);_live=b(eIe);_injector=b(ze);_breakpointObserver=b(Z5);_parentSnackBar=b(n,{optional:!0,skipSelf:!0});_defaultConfig=b(LNe);_snackBarRefAtThisLevel=null;simpleSnackBarComponent=PNe;snackBarContainerComponent=zQ;handsetCssClass="mat-mdc-snack-bar-handset";get _openedSnackBarRef(){const t=this._parentSnackBar;return t?t._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(t){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=t:this._snackBarRefAtThisLevel=t}constructor(){}openFromComponent(t,r){return this._attach(t,r)}openFromTemplate(t,r){return this._attach(t,r)}open(t,r="",i){const o={...this._defaultConfig,...i};return o.data={message:t,action:r},o.announcementMessage===t&&(o.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,o)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(t,r){const o=ze.create({parent:r&&r.viewContainerRef&&r.viewContainerRef.injector||this._injector,providers:[{provide:ZI,useValue:r}]}),s=new QI(this.snackBarContainerComponent,r.viewContainerRef,o),a=t.attach(s);return a.instance.snackBarConfig=r,a.instance}_attach(t,r){const i={...new ZI,...this._defaultConfig,...r},o=this._createOverlay(i),s=this._attachSnackBarContainer(o,i),a=new aO(s,o);if(t instanceof Oo){const l=new yQ(t,null,{$implicit:i.data,snackBarRef:a});a.instance=s.attachTemplatePortal(l)}else{const l=this._createInjector(i,a),c=new QI(t,void 0,l),u=s.attachComponentPortal(c);a.instance=u.instance}return this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait)").pipe(At(o.detachments())).subscribe(l=>{o.overlayElement.classList.toggle(this.handsetCssClass,l.matches)}),i.announcementMessage&&s._onAnnounce.subscribe(()=>{this._live.announce(i.announcementMessage,i.politeness)}),this._animateSnackBar(a,i),this._openedSnackBarRef=a,this._openedSnackBarRef}_animateSnackBar(t,r){t.afterDismissed().subscribe(()=>{this._openedSnackBarRef==t&&(this._openedSnackBarRef=null),r.announcementMessage&&this._live.clear()}),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{t.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):t.containerInstance.enter(),r.duration&&r.duration>0&&t.afterOpened().subscribe(()=>t._dismissAfter(r.duration))}_createOverlay(t){const r=new DQ;r.direction=t.direction;let i=this._overlay.position().global();const o="rtl"===t.direction,s="left"===t.horizontalPosition||"start"===t.horizontalPosition&&!o||"end"===t.horizontalPosition&&o,a=!s&&"center"!==t.horizontalPosition;return s?i.left("0"):a?i.right("0"):i.centerHorizontally(),"top"===t.verticalPosition?i.top("0"):i.bottom("0"),r.positionStrategy=i,this._overlay.create(r)}_createInjector(t,r){return ze.create({parent:t&&t.viewContainerRef&&t.viewContainerRef.injector||this._injector,providers:[{provide:aO,useValue:r},{provide:LQ,useValue:t.data}]})}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),BNe=(()=>{class n{snackBar=b(VNe);showError(t){let r="An error occurred";t?.message&&(r=t.message.includes("auth/invalid-email")?"Invalid email address":t.message.includes("auth/user-not-found")?"User not found":t.message.includes("auth/wrong-password")?"Invalid password":t.message.includes("auth/email-already-in-use")?"Email is already registered":t.message.includes("auth/popup-closed-by-user")?"Sign in was cancelled":t.message.includes("auth/cancelled-popup-request")?"Only one popup can be open at a time":t.message.includes("auth/popup-blocked")?"Sign in popup was blocked by the browser":t.message),this.snackBar.open(r,"Close",{duration:5e3,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["error-snackbar"]})}showSuccess(t){this.snackBar.open(t,"Close",{duration:3e3,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["success-snackbar"]})}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),mf=(()=>{class n{auth=b(LE);firestore=b(I_);router=b(bo);ngZone=b(ue);errorService=b(BNe);app=b(tr);constructor(){H1e(this.firestore).catch(t=>{"failed-precondition"==t.code?console.warn("Multiple tabs open, persistence can only be enabled in one tab at a time."):"unimplemented"==t.code&&console.warn("The current browser doesn't support persistence.")})}currentUser$=IAe(this.auth);currentUser=kR(this.currentUser$);profile$=this.currentUser$.pipe(_o(t=>t?this.getUserProfile$(t.uid):de(null)));profile=kR(this.profile$);getUserProfile$(t){const r=tO(this.firestore,`users/${t}`);return U1e(r)}googleSignIn(){var t=this;return T(function*(){try{const r=new MSe;r.setCustomParameters({prompt:"select_account"});const i=yield SAe(t.auth,r,Z8);yield t.createUserProfile(i.user),t.ngZone.run(()=>{t.router.navigate(["/"]),t.errorService.showSuccess("Successfully signed in!")}),t.app.tick()}catch(r){throw t.ngZone.run(()=>t.errorService.showError(r)),r}})()}emailSignIn(t,r){var i=this;return T(function*(){try{yield xAe(i.auth,t,r),i.ngZone.run(()=>{i.router.navigate(["/"]),i.errorService.showSuccess("Successfully signed in!")}),i.app.tick()}catch(o){throw i.ngZone.run(()=>i.errorService.showError(o)),o}})()}emailSignUp(t,r,i){var o=this;return T(function*(){try{const s=yield TAe(o.auth,t,r);yield o.createUserProfile({...s.user,displayName:i}),o.ngZone.run(()=>{o.router.navigate(["/"]),o.errorService.showSuccess("Account created successfully!")}),o.app.tick()}catch(s){throw o.ngZone.run(()=>o.errorService.showError(s)),s}})()}signOut(){var t=this;return T(function*(){try{yield DAe(t.auth),t.ngZone.run(()=>{t.router.navigate(["/auth/login"]),t.errorService.showSuccess("Successfully signed out!")}),t.app.tick()}catch(r){throw t.ngZone.run(()=>t.errorService.showError(r)),r}})()}createUserProfile(t){var r=this;return T(function*(){const i=tO(r.firestore,`users/${t.uid}`);if(!(yield $1e(i)).exists()){const s={uid:t.uid,email:t.email,displayName:t.displayName||"Anonymous",photoURL:t.photoURL,role:"user"};yield W1e(i,s)}})()}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function UNe(n,e){1&n&&(W(0,"mat-error"),Oe(1," Email is required "),K())}function zNe(n,e){1&n&&(W(0,"mat-error"),Oe(1," Please enter a valid email "),K())}function jNe(n,e){1&n&&(W(0,"mat-error"),Oe(1," Password is required "),K())}function HNe(n,e){1&n&&(W(0,"mat-error"),Oe(1," Password must be at least 6 characters "),K())}function $Ne(n,e){1&n&&Pe(0,"mat-progress-spinner",18),2&n&&De("diameter",24)("strokeWidth",2)}let qNe=(()=>{class n{authService=b(mf);loginForm=b(Nw).nonNullable.group({email:["",[Ri.required,Ri.email]],password:["",[Ri.required,Ri.minLength(6)]]});loading=ti(!1);onSubmit(){var t=this;return T(function*(){if(t.loginForm.valid)try{t.loading.set(!0);const{email:r,password:i}=t.loginForm.getRawValue();yield t.authService.emailSignIn(r,i)}catch(r){console.error("Login error:",r)}finally{t.loading.set(!1)}})()}onGoogleLogin(){var t=this;return T(function*(){try{t.loading.set(!0),yield t.authService.googleSignIn()}catch(r){console.error("Google login error:",r)}finally{t.loading.set(!1)}})()}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["app-login"]],decls:35,vars:14,consts:[[1,"flex","justify-center","items-center","min-h-[80vh]"],[1,"max-w-md","w-full","m-4"],[1,"flex","flex-col","gap-4","mt-4",3,"ngSubmit","formGroup"],["matInput","","formControlName","email","type","email",3,"readonly"],[4,"ngIf"],["matInput","","formControlName","password","type","password",3,"readonly"],["mat-raised-button","","color","primary","type","submit",1,"w-full","relative","h-[36px]",3,"disabled"],["class","absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2","mode","indeterminate",3,"diameter","strokeWidth",4,"ngIf"],[1,"my-4"],["mat-stroked-button","",1,"w-full","google-btn",3,"click","disabled"],[1,"flex","items-center","justify-center","gap-2"],["xmlns","http://www.w3.org/2000/svg","width","18","height","18","viewBox","0 0 48 48",1,"google-icon"],["fill","#EA4335","d","M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"],["fill","#4285F4","d","M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"],["fill","#FBBC05","d","M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"],["fill","#34A853","d","M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"],[1,"mt-4","text-center"],["mat-button","","routerLink","/auth/signup",3,"disabled"],["mode","indeterminate",1,"absolute","top-1/2","left-1/2","transform","-translate-x-1/2","-translate-y-1/2",3,"diameter","strokeWidth"]],template:function(r,i){if(1&r&&(W(0,"div",0)(1,"mat-card",1)(2,"mat-card-header")(3,"mat-card-title"),Oe(4,"Login"),K()(),W(5,"mat-card-content")(6,"form",2),Ve("ngSubmit",function(){return i.onSubmit()}),W(7,"mat-form-field")(8,"mat-label"),Oe(9,"Email"),K(),Pe(10,"input",3),et(11,UNe,2,0,"mat-error",4)(12,zNe,2,0,"mat-error",4),K(),W(13,"mat-form-field")(14,"mat-label"),Oe(15,"Password"),K(),Pe(16,"input",5),et(17,jNe,2,0,"mat-error",4)(18,HNe,2,0,"mat-error",4),K(),W(19,"button",6)(20,"span"),Oe(21,"Login"),K(),et(22,$Ne,1,2,"mat-progress-spinner",7),K()(),Pe(23,"mat-divider",8),W(24,"button",9),Ve("click",function(){return i.onGoogleLogin()}),W(25,"div",10),tp(),W(26,"svg",11),Pe(27,"path",12)(28,"path",13)(29,"path",14)(30,"path",15),K(),Oe(31),K()(),_0(),W(32,"div",16)(33,"a",17),Oe(34," Need an account? Sign up "),K()()()()()),2&r){let o,s,a,l;re(6),De("formGroup",i.loginForm),re(4),De("readonly",i.loading()),re(),De("ngIf",null==(o=i.loginForm.get("email"))?null:o.hasError("required")),re(),De("ngIf",null==(s=i.loginForm.get("email"))?null:s.hasError("email")),re(4),De("readonly",i.loading()),re(),De("ngIf",null==(a=i.loginForm.get("password"))?null:a.hasError("required")),re(),De("ngIf",null==(l=i.loginForm.get("password"))?null:l.hasError("minlength")),re(),De("disabled",!i.loginForm.valid||i.loading()),re(),at("opacity-0",i.loading()),re(2),De("ngIf",i.loading()),re(2),De("disabled",i.loading()),re(7),Va(" ",i.loading()?"Logging in...":"Login with Google"," "),re(2),De("disabled",i.loading())}},dependencies:[za,Bb,Pw,kw,nh,bw,ww,Ga,$m,oR,Xw,Jw,eE,Zw,ng,dR,tg,SW,fR,hR,hh,zW,dh,HW,jW,qW,OTe,th],styles:[".google-btn[_ngcontent-%COMP%]{height:40px!important;font-weight:500!important;letter-spacing:.25px;border:1px solid #dadce0!important;background-color:#fff!important;color:#3c4043!important;transition:all .2s ease}.google-btn[_ngcontent-%COMP%]:hover:not([disabled]){background-color:#f8f9fa!important;box-shadow:0 1px 2px #3c40434d,0 1px 3px 1px #3c404326!important}.google-btn[_ngcontent-%COMP%] .google-icon[_ngcontent-%COMP%]{margin-right:8px;vertical-align:middle}[_nghost-%COMP%]{display:block}.my-4[_ngcontent-%COMP%]{margin-top:1rem;margin-bottom:1rem}.mt-4[_ngcontent-%COMP%]{margin-top:1rem}.w-full[_ngcontent-%COMP%]{width:100%}"]})}return n})(),WNe=(()=>{class n{fb;authService;router;signupForm=b(Nw).nonNullable.group({displayName:["",Ri.required],email:["",[Ri.required,Ri.email]],password:["",[Ri.required,Ri.minLength(6)]]});constructor(t,r,i){this.fb=t,this.authService=r,this.router=i}onSubmit(){var t=this;return T(function*(){if(t.signupForm.valid)try{const{email:r,password:i,displayName:o}=t.signupForm.getRawValue();yield t.authService.emailSignUp(r,i,o)}catch(r){console.error("Signup error:",r)}})()}onGoogleSignup(){var t=this;return T(function*(){try{yield t.authService.googleSignIn()}catch(r){console.error("Google signup error:",r)}})()}static \u0275fac=function(r){return new(r||n)($(Nw),$(mf),$(bo))};static \u0275cmp=He({type:n,selectors:[["app-signup"]],decls:27,vars:2,consts:[[1,"flex","justify-center","items-center","min-h-[80vh]"],[1,"max-w-md","w-full","m-4"],[1,"flex","flex-col","gap-4","mt-4",3,"ngSubmit","formGroup"],["matInput","","formControlName","displayName"],["matInput","","formControlName","email","type","email"],["matInput","","formControlName","password","type","password"],["mat-raised-button","","color","primary","type","submit",3,"disabled"],[1,"my-4"],["mat-stroked-button","","color","accent",1,"w-full",3,"click"],[1,"mt-4","text-center"],["mat-button","","routerLink","/auth/login"]],template:function(r,i){1&r&&(W(0,"div",0)(1,"mat-card",1)(2,"mat-card-header")(3,"mat-card-title"),Oe(4,"Sign Up"),K()(),W(5,"mat-card-content")(6,"form",2),Ve("ngSubmit",function(){return i.onSubmit()}),W(7,"mat-form-field")(8,"mat-label"),Oe(9,"Display Name"),K(),Pe(10,"input",3),K(),W(11,"mat-form-field")(12,"mat-label"),Oe(13,"Email"),K(),Pe(14,"input",4),K(),W(15,"mat-form-field")(16,"mat-label"),Oe(17,"Password"),K(),Pe(18,"input",5),K(),W(19,"button",6),Oe(20," Sign Up "),K()(),Pe(21,"mat-divider",7),W(22,"button",8),Ve("click",function(){return i.onGoogleSignup()}),Oe(23," Sign up with Google "),K(),W(24,"div",9)(25,"a",10),Oe(26,"Already have an account? Login"),K()()()()()),2&r&&(re(6),De("formGroup",i.signupForm),re(13),De("disabled",!i.signupForm.valid))},dependencies:[za,Pw,kw,nh,bw,ww,Ga,$m,oR,Xw,Jw,eE,Zw,ng,dR,tg,fR,hR,hh,zW,dh,HW,jW,th],encapsulation:2})}return n})();class lO{}class Zs{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(e){e?"string"==typeof e?this.lazyInit=()=>{this.headers=new Map,e.split("\n").forEach(t=>{const r=t.indexOf(":");if(r>0){const i=t.slice(0,r),o=t.slice(r+1).trim();this.addHeaderEntry(i,o)}})}:typeof Headers<"u"&&e instanceof Headers?(this.headers=new Map,e.forEach((t,r)=>{this.addHeaderEntry(r,t)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(e).forEach(([t,r])=>{this.setHeaderEntries(t,r)})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof Zs?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new Zs;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof Zs?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let r=e.value;if("string"==typeof r&&(r=[r]),0===r.length)return;this.maybeSetNormalizedName(e.name,t);const i=("a"===e.op?this.headers.get(t):void 0)||[];i.push(...r),this.headers.set(t,i);break;case"d":const o=e.value;if(o){let s=this.headers.get(t);if(!s)return;s=s.filter(a=>-1===o.indexOf(a)),0===s.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,s)}else this.headers.delete(t),this.normalizedNames.delete(t)}}addHeaderEntry(e,t){const r=e.toLowerCase();this.maybeSetNormalizedName(e,r),this.headers.has(r)?this.headers.get(r).push(t):this.headers.set(r,[t])}setHeaderEntries(e,t){const r=(Array.isArray(t)?t:[t]).map(o=>o.toString()),i=e.toLowerCase();this.headers.set(i,r),this.maybeSetNormalizedName(e,i)}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class GNe{encodeKey(e){return jQ(e)}encodeValue(e){return jQ(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const QNe=/%(\d[a-f0-9])/gi,YNe={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function jQ(n){return encodeURIComponent(n).replace(QNe,(e,t)=>YNe[t]??e)}function JI(n){return`${n}`}class El{map;encoder;updates=null;cloneFrom=null;constructor(e={}){if(this.encoder=e.encoder||new GNe,e.fromString){if(e.fromObject)throw new O(2805,!1);this.map=function KNe(n,e){const t=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(i=>{const o=i.indexOf("="),[s,a]=-1==o?[e.decodeKey(i),""]:[e.decodeKey(i.slice(0,o)),e.decodeValue(i.slice(o+1))],l=t.get(s)||[];l.push(a),t.set(s,l)}),t}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const r=e.fromObject[t],i=Array.isArray(r)?r.map(JI):[JI(r)];this.map.set(t,i)})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach(r=>{const i=e[r];Array.isArray(i)?i.forEach(o=>{t.push({param:r,value:o,op:"a"})}):t.push({param:r,value:i,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(r=>t+"="+this.encoder.encodeValue(r)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new El({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(JI(e.value)),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let r=this.map.get(e.param)||[];const i=r.indexOf(JI(e.value));-1!==i&&r.splice(i,1),r.length>0?this.map.set(e.param,r):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}class XNe{map=new Map;set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}has(e){return this.map.has(e)}keys(){return this.map.keys()}}function HQ(n){return typeof ArrayBuffer<"u"&&n instanceof ArrayBuffer}function $Q(n){return typeof Blob<"u"&&n instanceof Blob}function qQ(n){return typeof FormData<"u"&&n instanceof FormData}class C_{url;body=null;headers;context;reportProgress=!1;withCredentials=!1;responseType="json";method;params;urlWithParams;transferCache;constructor(e,t,r,i){let o;if(this.url=t,this.method=e.toUpperCase(),function ZNe(n){switch(n){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||i?(this.body=void 0!==r?r:null,o=i):o=r,o&&(this.reportProgress=!!o.reportProgress,this.withCredentials=!!o.withCredentials,o.responseType&&(this.responseType=o.responseType),o.headers&&(this.headers=o.headers),o.context&&(this.context=o.context),o.params&&(this.params=o.params),this.transferCache=o.transferCache),this.headers??=new Zs,this.context??=new XNe,this.params){const s=this.params.toString();if(0===s.length)this.urlWithParams=t;else{const a=t.indexOf("?");this.urlWithParams=t+(-1===a?"?":af.set(p,e.setHeaders[p]),c)),e.setParams&&(u=Object.keys(e.setParams).reduce((f,p)=>f.set(p,e.setParams[p]),u)),new C_(t,r,s,{params:u,headers:c,context:d,reportProgress:l,responseType:i,withCredentials:a,transferCache:o})}}var uO=function(n){return n[n.Sent=0]="Sent",n[n.UploadProgress=1]="UploadProgress",n[n.ResponseHeader=2]="ResponseHeader",n[n.DownloadProgress=3]="DownloadProgress",n[n.Response=4]="Response",n[n.User=5]="User",n}(uO||{});class dO{headers;status;statusText;url;ok;type;constructor(e,t=200,r="OK"){this.headers=e.headers||new Zs,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||r,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class x_ extends dO{body;constructor(e={}){super(e),this.body=void 0!==e.body?e.body:null}type=uO.Response;clone(e={}){return new x_({body:void 0!==e.body?e.body:this.body,headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}function hO(n,e){return{body:e,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials,transferCache:n.transferCache}}let fO=(()=>{class n{handler;constructor(t){this.handler=t}request(t,r,i={}){let o;if(t instanceof C_)o=t;else{let l,c;l=i.headers instanceof Zs?i.headers:new Zs(i.headers),i.params&&(c=i.params instanceof El?i.params:new El({fromObject:i.params})),o=new C_(t,r,void 0!==i.body?i.body:null,{headers:l,context:i.context,params:c,reportProgress:i.reportProgress,responseType:i.responseType||"json",withCredentials:i.withCredentials,transferCache:i.transferCache})}const s=de(o).pipe(Em(l=>this.handler.handle(l)));if(t instanceof C_||"events"===i.observe)return s;const a=s.pipe(si(l=>l instanceof x_));switch(i.observe||"body"){case"body":switch(o.responseType){case"arraybuffer":return a.pipe(Te(l=>{if(null!==l.body&&!(l.body instanceof ArrayBuffer))throw new O(2806,!1);return l.body}));case"blob":return a.pipe(Te(l=>{if(null!==l.body&&!(l.body instanceof Blob))throw new O(2807,!1);return l.body}));case"text":return a.pipe(Te(l=>{if(null!==l.body&&"string"!=typeof l.body)throw new O(2808,!1);return l.body}));default:return a.pipe(Te(l=>l.body))}case"response":return a;default:throw new O(2809,!1)}}delete(t,r={}){return this.request("DELETE",t,r)}get(t,r={}){return this.request("GET",t,r)}head(t,r={}){return this.request("HEAD",t,r)}jsonp(t,r){return this.request("JSONP",t,{params:(new El).append(r,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,r={}){return this.request("OPTIONS",t,r)}patch(t,r,i={}){return this.request("PATCH",t,hO(i,r))}post(t,r,i={}){return this.request("POST",t,hO(i,r))}put(t,r,i={}){return this.request("PUT",t,hO(i,r))}static \u0275fac=function(r){return new(r||n)(me(lO))};static \u0275prov=G({token:n,factory:n.\u0275fac})}return n})();const MPe=["*"];let tT;function S_(n){return function kPe(){if(void 0===tT&&(tT=null,typeof window<"u")){const n=window;void 0!==n.trustedTypes&&(tT=n.trustedTypes.createPolicy("angular#components",{createHTML:e=>e}))}return tT}()?.createHTML(n)||n}function rY(n){return Error(`Unable to find icon with the name "${n}"`)}function iY(n){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${n}".`)}function oY(n){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${n}".`)}class gu{url;svgText;options;svgElement;constructor(e,t,r){this.url=e,this.svgText=t,this.options=r}}let nT=(()=>{class n{_httpClient;_sanitizer;_errorHandler;_document;_svgIconConfigs=new Map;_iconSetConfigs=new Map;_cachedIconsByUrl=new Map;_inProgressUrlFetches=new Map;_fontCssClassesByAlias=new Map;_resolvers=[];_defaultFontSetClass=["material-icons","mat-ligature-font"];constructor(t,r,i,o){this._httpClient=t,this._sanitizer=r,this._errorHandler=o,this._document=i}addSvgIcon(t,r,i){return this.addSvgIconInNamespace("",t,r,i)}addSvgIconLiteral(t,r,i){return this.addSvgIconLiteralInNamespace("",t,r,i)}addSvgIconInNamespace(t,r,i,o){return this._addSvgIconConfig(t,r,new gu(i,null,o))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,r,i,o){const s=this._sanitizer.sanitize(er.HTML,i);if(!s)throw oY(i);const a=S_(s);return this._addSvgIconConfig(t,r,new gu("",a,o))}addSvgIconSet(t,r){return this.addSvgIconSetInNamespace("",t,r)}addSvgIconSetLiteral(t,r){return this.addSvgIconSetLiteralInNamespace("",t,r)}addSvgIconSetInNamespace(t,r,i){return this._addSvgIconSetConfig(t,new gu(r,null,i))}addSvgIconSetLiteralInNamespace(t,r,i){const o=this._sanitizer.sanitize(er.HTML,r);if(!o)throw oY(r);const s=S_(o);return this._addSvgIconSetConfig(t,new gu("",s,i))}registerFontClassAlias(t,r=t){return this._fontCssClassesByAlias.set(t,r),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(...t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){const r=this._sanitizer.sanitize(er.RESOURCE_URL,t);if(!r)throw iY(t);const i=this._cachedIconsByUrl.get(r);return i?de(rT(i)):this._loadSvgIconFromConfig(new gu(t,null)).pipe(Bn(o=>this._cachedIconsByUrl.set(r,o)),Te(o=>rT(o)))}getNamedSvgIcon(t,r=""){const i=sY(r,t);let o=this._svgIconConfigs.get(i);if(o)return this._getSvgFromConfig(o);if(o=this._getIconConfigFromResolvers(r,t),o)return this._svgIconConfigs.set(i,o),this._getSvgFromConfig(o);const s=this._iconSetConfigs.get(r);return s?this._getSvgFromIconSetConfigs(t,s):wm(rY(i))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?de(rT(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(Te(r=>rT(r)))}_getSvgFromIconSetConfigs(t,r){const i=this._extractIconWithNameFromAnySet(t,r);return i?de(i):Oq(r.filter(s=>!s.svgText).map(s=>this._loadSvgIconSetFromConfig(s).pipe(Tc(a=>{const c=`Loading icon set URL: ${this._sanitizer.sanitize(er.RESOURCE_URL,s.url)} failed: ${a.message}`;return this._errorHandler.handleError(new Error(c)),de(null)})))).pipe(Te(()=>{const s=this._extractIconWithNameFromAnySet(t,r);if(!s)throw rY(t);return s}))}_extractIconWithNameFromAnySet(t,r){for(let i=r.length-1;i>=0;i--){const o=r[i];if(o.svgText&&o.svgText.toString().indexOf(t)>-1){const s=this._svgElementFromConfig(o),a=this._extractSvgIconFromSet(s,t,o.options);if(a)return a}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe(Bn(r=>t.svgText=r),Te(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?de(null):this._fetchIcon(t).pipe(Bn(r=>t.svgText=r))}_extractSvgIconFromSet(t,r,i){const o=t.querySelector(`[id="${r}"]`);if(!o)return null;const s=o.cloneNode(!0);if(s.removeAttribute("id"),"svg"===s.nodeName.toLowerCase())return this._setSvgAttributes(s,i);if("symbol"===s.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(s),i);const a=this._svgElementFromString(S_(""));return a.appendChild(s),this._setSvgAttributes(a,i)}_svgElementFromString(t){const r=this._document.createElement("DIV");r.innerHTML=t;const i=r.querySelector("svg");if(!i)throw Error(" tag not found");return i}_toSvgElement(t){const r=this._svgElementFromString(S_("")),i=t.attributes;for(let o=0;oS_(c)),Jb(()=>this._inProgressUrlFetches.delete(s)),TW());return this._inProgressUrlFetches.set(s,l),l}_addSvgIconConfig(t,r,i){return this._svgIconConfigs.set(sY(t,r),i),this}_addSvgIconSetConfig(t,r){const i=this._iconSetConfigs.get(t);return i?i.push(r):this._iconSetConfigs.set(t,[r]),this}_svgElementFromConfig(t){if(!t.svgElement){const r=this._svgElementFromString(t.svgText);this._setSvgAttributes(r,t.options),t.svgElement=r}return t.svgElement}_getIconConfigFromResolvers(t,r){for(let i=0;ie?e.pathname+e.search:""}}}),aY=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],BPe=aY.map(n=>`[${n}]`).join(", "),UPe=/^url\(['"]?#(.*?)['"]?\)$/;let _O=(()=>{class n{_elementRef=b(je);_iconRegistry=b(nT);_location=b(LPe);_errorHandler=b(wi);_defaultColor;get color(){return this._color||this._defaultColor}set color(t){this._color=t}_color;inline=!1;get svgIcon(){return this._svgIcon}set svgIcon(t){t!==this._svgIcon&&(t?this._updateSvgIcon(t):this._svgIcon&&this._clearSvgElement(),this._svgIcon=t)}_svgIcon;get fontSet(){return this._fontSet}set fontSet(t){const r=this._cleanupFontValue(t);r!==this._fontSet&&(this._fontSet=r,this._updateFontIconClasses())}_fontSet;get fontIcon(){return this._fontIcon}set fontIcon(t){const r=this._cleanupFontValue(t);r!==this._fontIcon&&(this._fontIcon=r,this._updateFontIconClasses())}_fontIcon;_previousFontSetClass=[];_previousFontIconClass;_svgName;_svgNamespace;_previousPath;_elementsWithExternalReferences;_currentIconFetch=Kt.EMPTY;constructor(){const t=b(new T2("aria-hidden"),{optional:!0}),r=b(FPe,{optional:!0});r&&(r.color&&(this.color=this._defaultColor=r.color),r.fontSet&&(this.fontSet=r.fontSet)),t||this._elementRef.nativeElement.setAttribute("aria-hidden","true")}_splitIconName(t){if(!t)return["",""];const r=t.split(":");switch(r.length){case 1:return["",r[0]];case 2:return r;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const t=this._elementsWithExternalReferences;if(t&&t.size){const r=this._location.getPathname();r!==this._previousPath&&(this._previousPath=r,this._prependPathToReferences(r))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();const r=this._location.getPathname();this._previousPath=r,this._cacheChildrenWithExternalReferences(t),this._prependPathToReferences(r),this._elementRef.nativeElement.appendChild(t)}_clearSvgElement(){const t=this._elementRef.nativeElement;let r=t.childNodes.length;for(this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear();r--;){const i=t.childNodes[r];(1!==i.nodeType||"svg"===i.nodeName.toLowerCase())&&i.remove()}}_updateFontIconClasses(){if(!this._usingFontIcon())return;const t=this._elementRef.nativeElement,r=(this.fontSet?this._iconRegistry.classNameForFontAlias(this.fontSet).split(/ +/):this._iconRegistry.getDefaultFontSetClass()).filter(i=>i.length>0);this._previousFontSetClass.forEach(i=>t.classList.remove(i)),r.forEach(i=>t.classList.add(i)),this._previousFontSetClass=r,this.fontIcon!==this._previousFontIconClass&&!r.includes("mat-ligature-font")&&(this._previousFontIconClass&&t.classList.remove(this._previousFontIconClass),this.fontIcon&&t.classList.add(this.fontIcon),this._previousFontIconClass=this.fontIcon)}_cleanupFontValue(t){return"string"==typeof t?t.trim().split(" ")[0]:t}_prependPathToReferences(t){const r=this._elementsWithExternalReferences;r&&r.forEach((i,o)=>{i.forEach(s=>{o.setAttribute(s.name,`url('${t}#${s.value}')`)})})}_cacheChildrenWithExternalReferences(t){const r=t.querySelectorAll(BPe),i=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let o=0;o{const a=r[o],l=a.getAttribute(s),c=l?l.match(UPe):null;if(c){let u=i.get(a);u||(u=[],i.set(a,u)),u.push({name:s,value:c[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){const[r,i]=this._splitIconName(t);r&&(this._svgNamespace=r),i&&(this._svgName=i),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(i,r).pipe(zo(1)).subscribe(o=>this._setSvgElement(o),o=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${r}:${i}! ${o.message}`))})}}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:10,hostBindings:function(r,i){2&r&&(Ke("data-mat-icon-type",i._usingFontIcon()?"font":"svg")("data-mat-icon-name",i._svgName||i.fontIcon)("data-mat-icon-namespace",i._svgNamespace||i.fontSet)("fontIcon",i._usingFontIcon()?i.fontIcon:null),Fa(i.color?"mat-"+i.color:""),at("mat-icon-inline",i.inline)("mat-icon-no-color","primary"!==i.color&&"accent"!==i.color&&"warn"!==i.color))},inputs:{color:"color",inline:[2,"inline","inline",_t],svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],ngContentSelectors:MPe,decls:1,vars:0,template:function(r,i){1&r&&(Hn(),Ae(0))},styles:["mat-icon,mat-icon.mat-primary,mat-icon.mat-accent,mat-icon.mat-warn{color:var(--mat-icon-color, inherit)}.mat-icon{-webkit-user-select:none;user-select:none;background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px;overflow:hidden}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}.mat-icon.mat-ligature-font[fontIcon]::before{content:attr(fontIcon)}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1, 1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}"],encapsulation:2,changeDetection:0})}return n})(),yO=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[gn,gn]})}return n})(),zPe=(()=>{class n{authService=b(mf);static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["app-home"]],decls:8,vars:0,consts:[[1,"p-4"],[1,"flex","justify-between","items-center","mb-6"],[1,"text-2xl"],["mat-raised-button","","color","primary","routerLink","/blog/create",1,"create-post-btn"]],template:function(r,i){1&r&&(W(0,"div",0)(1,"div",1)(2,"h1",2),Oe(3,"Welcome to the Blog"),K(),W(4,"button",3)(5,"mat-icon"),Oe(6,"add"),K(),Oe(7," Create Post "),K()()())},dependencies:[za,hh,dh,yO,_O,th],styles:[".create-post-btn[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}"]})}return n})();const lY=(n,e)=>{const t=b(bo);return b(mf).currentUser$.pipe(Te(i=>!!i||(t.navigate(["/auth/login"]),!1)))},cY=["*",[["mat-chip-avatar"],["","matChipAvatar",""]],[["mat-chip-trailing-icon"],["","matChipRemove",""],["","matChipTrailingIcon",""]]],uY=["*","mat-chip-avatar, [matChipAvatar]","mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]"];function jPe(n,e){1&n&&(W(0,"span",3),Ae(1,1),K())}function HPe(n,e){1&n&&(W(0,"span",6),Ae(1,2),K())}const WPe=[[["mat-chip-avatar"],["","matChipAvatar",""]],[["","matChipEditInput",""]],"*",[["mat-chip-trailing-icon"],["","matChipRemove",""],["","matChipTrailingIcon",""]]],GPe=["mat-chip-avatar, [matChipAvatar]","[matChipEditInput]","*","mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]"];function KPe(n,e){1&n&&Pe(0,"span",0)}function QPe(n,e){1&n&&(W(0,"span",2),Ae(1),K())}function YPe(n,e){1&n&&Ae(0,1)}function XPe(n,e){1&n&&Pe(0,"span",7)}function ZPe(n,e){1&n&&et(0,YPe,1,0)(1,XPe,1,0,"span",7),2&n&&Pt(Ln().contentEditInput?0:1)}function JPe(n,e){1&n&&Ae(0,2)}function eOe(n,e){1&n&&(W(0,"span",5),Ae(1,3),K())}const vO=["*"],iT=new B("mat-chips-default-options",{providedIn:"root",factory:()=>({separatorKeyCodes:[13]})}),bO=new B("MatChipAvatar"),wO=new B("MatChipTrailingIcon"),EO=new B("MatChipRemove"),oT=new B("MatChip");let gf=(()=>{class n{_elementRef=b(je);_parentChip=b(oT);isInteractive=!0;_isPrimary=!0;get disabled(){return this._disabled||this._parentChip?.disabled||!1}set disabled(t){this._disabled=t}_disabled=!1;tabIndex=-1;_allowFocusWhenDisabled=!1;_getDisabledAttribute(){return this.disabled&&!this._allowFocusWhenDisabled?"":null}_getTabindex(){return this.disabled&&!this._allowFocusWhenDisabled||!this.isInteractive?null:this.tabIndex.toString()}constructor(){b(Ka).load(nR),"BUTTON"===this._elementRef.nativeElement.nodeName&&this._elementRef.nativeElement.setAttribute("type","button")}focus(){this._elementRef.nativeElement.focus()}_handleClick(t){!this.disabled&&this.isInteractive&&this._isPrimary&&(t.preventDefault(),this._parentChip._handlePrimaryActionInteraction())}_handleKeydown(t){(13===t.keyCode||32===t.keyCode)&&!this.disabled&&this.isInteractive&&this._isPrimary&&!this._parentChip._isEditing&&(t.preventDefault(),this._parentChip._handlePrimaryActionInteraction())}static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["","matChipAction",""]],hostAttrs:[1,"mdc-evolution-chip__action","mat-mdc-chip-action"],hostVars:9,hostBindings:function(r,i){1&r&&Ve("click",function(s){return i._handleClick(s)})("keydown",function(s){return i._handleKeydown(s)}),2&r&&(Ke("tabindex",i._getTabindex())("disabled",i._getDisabledAttribute())("aria-disabled",i.disabled),at("mdc-evolution-chip__action--primary",i._isPrimary)("mdc-evolution-chip__action--presentational",!i.isInteractive)("mdc-evolution-chip__action--trailing",!i._isPrimary))},inputs:{isInteractive:"isInteractive",disabled:[2,"disabled","disabled",_t],tabIndex:[2,"tabIndex","tabIndex",t=>null==t?-1:$d(t)],_allowFocusWhenDisabled:"_allowFocusWhenDisabled"}})}return n})(),fY=(()=>{class n extends gf{_isPrimary=!1;_handleClick(t){this.disabled||(t.stopPropagation(),t.preventDefault(),this._parentChip.remove())}_handleKeydown(t){(13===t.keyCode||32===t.keyCode)&&!this.disabled&&(t.stopPropagation(),t.preventDefault(),this._parentChip.remove())}static \u0275fac=(()=>{let t;return function(i){return(t||(t=bt(n)))(i||n)}})();static \u0275dir=ee({type:n,selectors:[["","matChipRemove",""]],hostAttrs:["role","button",1,"mat-mdc-chip-remove","mat-mdc-chip-trailing-icon","mat-focus-indicator","mdc-evolution-chip__icon","mdc-evolution-chip__icon--trailing"],hostVars:1,hostBindings:function(r,i){2&r&&Ke("aria-hidden",null)},features:[$e([{provide:EO,useExisting:n}]),ke]})}return n})(),_f=(()=>{class n{_changeDetectorRef=b(Uo);_elementRef=b(je);_ngZone=b(ue);_focusMonitor=b(ZA);_globalRippleOptions=b(yW,{optional:!0});_document=b(Xe);_onFocus=new fe;_onBlur=new fe;_isBasicChip;role=null;_hasFocusInternal=!1;_pendingFocus;_actionChanges;_animationsDisabled;_allLeadingIcons;_allTrailingIcons;_allRemoveIcons;_hasFocus(){return this._hasFocusInternal}id=b(Xa).getId("mat-mdc-chip-");ariaLabel=null;ariaDescription=null;_ariaDescriptionId=`${this.id}-aria-description`;_chipListDisabled=!1;_textElement;get value(){return void 0!==this._value?this._value:this._textElement.textContent.trim()}set value(t){this._value=t}_value;color;removable=!0;highlighted=!1;disableRipple=!1;get disabled(){return this._disabled||this._chipListDisabled}set disabled(t){this._disabled=t}_disabled=!1;removed=new nt;destroyed=new nt;basicChipAttrName="mat-basic-chip";leadingIcon;trailingIcon;removeIcon;primaryAction;_rippleLoader=b(IW);_injector=b(ze);constructor(){const t=b(Ka);t.load(nR),t.load(j5);const r=b(Ts,{optional:!0});this._animationsDisabled="NoopAnimations"===r,this._monitorFocus(),this._rippleLoader?.configureRipple(this._elementRef.nativeElement,{className:"mat-mdc-chip-ripple",disabled:this._isRippleDisabled()})}ngOnInit(){const t=this._elementRef.nativeElement;this._isBasicChip=t.hasAttribute(this.basicChipAttrName)||t.tagName.toLowerCase()===this.basicChipAttrName}ngAfterViewInit(){this._textElement=this._elementRef.nativeElement.querySelector(".mat-mdc-chip-action-label"),this._pendingFocus&&(this._pendingFocus=!1,this.focus())}ngAfterContentInit(){this._actionChanges=Ym(this._allLeadingIcons.changes,this._allTrailingIcons.changes,this._allRemoveIcons.changes).subscribe(()=>this._changeDetectorRef.markForCheck())}ngDoCheck(){this._rippleLoader.setDisabled(this._elementRef.nativeElement,this._isRippleDisabled())}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._rippleLoader?.destroyRipple(this._elementRef.nativeElement),this._actionChanges?.unsubscribe(),this.destroyed.emit({chip:this}),this.destroyed.complete()}remove(){this.removable&&this.removed.emit({chip:this})}_isRippleDisabled(){return this.disabled||this.disableRipple||this._animationsDisabled||this._isBasicChip||!!this._globalRippleOptions?.disabled}_hasTrailingIcon(){return!(!this.trailingIcon&&!this.removeIcon)}_handleKeydown(t){(8===t.keyCode&&!t.repeat||46===t.keyCode)&&(t.preventDefault(),this.remove())}focus(){this.disabled||(this.primaryAction?this.primaryAction.focus():this._pendingFocus=!0)}_getSourceAction(t){return this._getActions().find(r=>{const i=r._elementRef.nativeElement;return i===t||i.contains(t)})}_getActions(){const t=[];return this.primaryAction&&t.push(this.primaryAction),this.removeIcon&&t.push(this.removeIcon),this.trailingIcon&&t.push(this.trailingIcon),t}_handlePrimaryActionInteraction(){}_monitorFocus(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{const r=null!==t;r!==this._hasFocusInternal&&(this._hasFocusInternal=r,r?this._onFocus.next({chip:this}):(this._changeDetectorRef.markForCheck(),setTimeout(()=>this._ngZone.run(()=>this._onBlur.next({chip:this})))))})}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-basic-chip"],["","mat-basic-chip",""],["mat-chip"],["","mat-chip",""]],contentQueries:function(r,i,o){if(1&r&&($n(o,bO,5),$n(o,wO,5),$n(o,EO,5),$n(o,bO,5),$n(o,wO,5),$n(o,EO,5)),2&r){let s;Qe(s=Ye())&&(i.leadingIcon=s.first),Qe(s=Ye())&&(i.trailingIcon=s.first),Qe(s=Ye())&&(i.removeIcon=s.first),Qe(s=Ye())&&(i._allLeadingIcons=s),Qe(s=Ye())&&(i._allTrailingIcons=s),Qe(s=Ye())&&(i._allRemoveIcons=s)}},viewQuery:function(r,i){if(1&r&&qn(gf,5),2&r){let o;Qe(o=Ye())&&(i.primaryAction=o.first)}},hostAttrs:[1,"mat-mdc-chip"],hostVars:31,hostBindings:function(r,i){1&r&&Ve("keydown",function(s){return i._handleKeydown(s)}),2&r&&(Bo("id",i.id),Ke("role",i.role)("aria-label",i.ariaLabel),Fa("mat-"+(i.color||"primary")),at("mdc-evolution-chip",!i._isBasicChip)("mdc-evolution-chip--disabled",i.disabled)("mdc-evolution-chip--with-trailing-action",i._hasTrailingIcon())("mdc-evolution-chip--with-primary-graphic",i.leadingIcon)("mdc-evolution-chip--with-primary-icon",i.leadingIcon)("mdc-evolution-chip--with-avatar",i.leadingIcon)("mat-mdc-chip-with-avatar",i.leadingIcon)("mat-mdc-chip-highlighted",i.highlighted)("mat-mdc-chip-disabled",i.disabled)("mat-mdc-basic-chip",i._isBasicChip)("mat-mdc-standard-chip",!i._isBasicChip)("mat-mdc-chip-with-trailing-icon",i._hasTrailingIcon())("_mat-animation-noopable",i._animationsDisabled))},inputs:{role:"role",id:"id",ariaLabel:[0,"aria-label","ariaLabel"],ariaDescription:[0,"aria-description","ariaDescription"],value:"value",color:"color",removable:[2,"removable","removable",_t],highlighted:[2,"highlighted","highlighted",_t],disableRipple:[2,"disableRipple","disableRipple",_t],disabled:[2,"disabled","disabled",_t]},outputs:{removed:"removed",destroyed:"destroyed"},exportAs:["matChip"],features:[$e([{provide:oT,useExisting:n}])],ngContentSelectors:uY,decls:8,vars:3,consts:[[1,"mat-mdc-chip-focus-overlay"],[1,"mdc-evolution-chip__cell","mdc-evolution-chip__cell--primary"],["matChipAction","",3,"isInteractive"],[1,"mdc-evolution-chip__graphic","mat-mdc-chip-graphic"],[1,"mdc-evolution-chip__text-label","mat-mdc-chip-action-label"],[1,"mat-mdc-chip-primary-focus-indicator","mat-focus-indicator"],[1,"mdc-evolution-chip__cell","mdc-evolution-chip__cell--trailing"]],template:function(r,i){1&r&&(Hn(cY),Pe(0,"span",0),W(1,"span",1)(2,"span",2),et(3,jPe,2,0,"span",3),W(4,"span",4),Ae(5),Pe(6,"span",5),K()()(),et(7,HPe,2,0,"span",6)),2&r&&(re(2),De("isInteractive",!1),re(),Pt(i.leadingIcon?3:-1),re(4),Pt(i._hasTrailingIcon()?7:-1))},dependencies:[gf],styles:['.mdc-evolution-chip,.mdc-evolution-chip__cell,.mdc-evolution-chip__action{display:inline-flex;align-items:center}.mdc-evolution-chip{position:relative;max-width:100%}.mdc-evolution-chip__cell,.mdc-evolution-chip__action{height:100%}.mdc-evolution-chip__cell--primary{flex-basis:100%;overflow-x:hidden}.mdc-evolution-chip__cell--trailing{flex:1 0 auto}.mdc-evolution-chip__action{align-items:center;background:none;border:none;box-sizing:content-box;cursor:pointer;display:inline-flex;justify-content:center;outline:none;padding:0;text-decoration:none;color:inherit}.mdc-evolution-chip__action--presentational{cursor:auto}.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{pointer-events:none}.mdc-evolution-chip__action--primary{font:inherit;letter-spacing:inherit;white-space:inherit;overflow-x:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary::before{border-width:var(--mdc-chip-outline-width, 1px);border-radius:var(--mdc-chip-container-shape-radius, 8px);box-sizing:border-box;content:"";height:100%;left:0;position:absolute;pointer-events:none;top:0;width:100%;z-index:1;border-style:solid}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--primary::before{border-color:var(--mdc-chip-outline-color, var(--mat-sys-outline))}.mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational):not(.mdc-ripple-upgraded):focus::before{border-color:var(--mdc-chip-focus-outline-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--primary::before{border-color:var(--mdc-chip-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__action--primary::before{border-width:var(--mdc-chip-flat-selected-outline-width, 0)}.mat-mdc-basic-chip .mdc-evolution-chip__action--primary{font:inherit}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip__action--trailing{position:relative;overflow:visible}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--trailing{color:var(--mdc-chip-with-trailing-icon-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--trailing{color:var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mdc-evolution-chip__text-label{-webkit-user-select:none;user-select:none;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__text-label{font-family:var(--mdc-chip-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mdc-chip-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mdc-chip-label-text-size, var(--mat-sys-label-large-size));font-weight:var(--mdc-chip-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mdc-chip-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mdc-chip-label-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mdc-chip-selected-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label,.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label{color:var(--mdc-chip-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-evolution-chip__graphic{align-items:center;display:inline-flex;justify-content:center;overflow:hidden;pointer-events:none;position:relative;flex:1 0 auto}.mat-mdc-standard-chip .mdc-evolution-chip__graphic{width:var(--mdc-chip-with-avatar-avatar-size, 24px);height:var(--mdc-chip-with-avatar-avatar-size, 24px);font-size:var(--mdc-chip-with-avatar-avatar-size, 24px)}.mdc-evolution-chip--selecting .mdc-evolution-chip__graphic{transition:width 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selectable:not(.mdc-evolution-chip--selected):not(.mdc-evolution-chip--with-primary-icon) .mdc-evolution-chip__graphic{width:0}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mdc-evolution-chip__checkmark{position:absolute;opacity:0;top:50%;left:50%;height:20px;width:20px}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__checkmark{color:var(--mdc-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__checkmark{color:var(--mdc-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark{transition:transform 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1);transform:translate(-75%, -50%)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{transform:translate(-50%, -50%);opacity:1}.mdc-evolution-chip__checkmark-svg{display:block}.mdc-evolution-chip__checkmark-path{stroke-width:2px;stroke-dasharray:29.7833385;stroke-dashoffset:29.7833385;stroke:currentColor}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark-path{transition:stroke-dashoffset 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark-path{stroke-dashoffset:0}@media(forced-colors: active){.mdc-evolution-chip__checkmark-path{stroke:CanvasText !important}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--trailing{height:18px;width:18px;font-size:18px}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove{opacity:calc(var(--mat-chip-trailing-action-opacity, 1)*var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove:focus{opacity:calc(var(--mat-chip-trailing-action-focus-opacity, 1)*var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mat-mdc-standard-chip{border-radius:var(--mdc-chip-container-shape-radius, 8px);height:var(--mdc-chip-container-height, 32px)}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled){background-color:var(--mdc-chip-elevated-container-color, transparent)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{background-color:var(--mdc-chip-elevated-disabled-container-color)}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled){background-color:var(--mdc-chip-elevated-selected-container-color, var(--mat-sys-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled{background-color:var(--mdc-chip-flat-disabled-selected-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}@media(forced-colors: active){.mat-mdc-standard-chip{outline:solid 1px}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--primary{border-radius:var(--mdc-chip-with-avatar-avatar-shape-radius, 24px);width:var(--mdc-chip-with-icon-icon-size, 18px);height:var(--mdc-chip-with-icon-icon-size, 18px);font-size:var(--mdc-chip-with-icon-icon-size, 18px)}.mdc-evolution-chip--selected .mdc-evolution-chip__icon--primary{opacity:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__icon--primary{color:var(--mdc-chip-with-icon-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--primary{color:var(--mdc-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-highlighted{--mdc-chip-with-icon-icon-color:var(--mdc-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container));--mdc-chip-elevated-container-color:var(--mdc-chip-elevated-selected-container-color, var(--mat-sys-secondary-container));--mdc-chip-label-text-color:var(--mdc-chip-selected-label-text-color, var(--mat-sys-on-secondary-container));--mdc-chip-outline-width:var(--mdc-chip-flat-selected-outline-width, 0)}.mat-mdc-chip-focus-overlay{background:var(--mdc-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-selected .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-chip:hover .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-hover-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mdc-chip-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-focus-overlay .mat-mdc-chip-selected:hover,.mat-mdc-chip-highlighted:hover .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-hover-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mdc-chip-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mdc-chip-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected.cdk-focused .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mdc-chip-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-evolution-chip--disabled:not(.mdc-evolution-chip--selected) .mat-mdc-chip-avatar{opacity:var(--mdc-chip-with-avatar-disabled-avatar-opacity, 0.38)}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{opacity:var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38)}.mdc-evolution-chip--disabled.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{opacity:var(--mdc-chip-with-icon-disabled-icon-opacity, 0.38)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{opacity:var(--mat-chip-disabled-container-opacity, 1)}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-trailing-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-remove{opacity:var(--mat-chip-trailing-action-opacity, 1)}.mat-mdc-chip-remove:focus{opacity:var(--mat-chip-trailing-action-focus-opacity, 1)}.mat-mdc-chip-remove::after{background-color:var(--mat-chip-trailing-action-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-remove:hover::after{opacity:var(--mat-chip-trailing-action-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-remove:focus::after{opacity:var(--mat-chip-trailing-action-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected .mat-mdc-chip-remove::after,.mat-mdc-chip-highlighted .mat-mdc-chip-remove::after{background-color:var(--mat-chip-selected-trailing-action-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-standard-chip .mdc-evolution-chip__cell--primary,.mat-mdc-standard-chip .mdc-evolution-chip__action--primary,.mat-mdc-standard-chip .mat-mdc-chip-action-label{overflow:visible}.mat-mdc-standard-chip .mat-mdc-chip-graphic,.mat-mdc-standard-chip .mat-mdc-chip-trailing-icon{box-sizing:content-box}.mat-mdc-standard-chip._mat-animation-noopable,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__graphic,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark-path{transition-duration:1ms;animation-duration:1ms}.mat-mdc-chip-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;opacity:0;border-radius:inherit;transition:opacity 150ms linear}._mat-animation-noopable .mat-mdc-chip-focus-overlay{transition:none}.mat-mdc-basic-chip .mat-mdc-chip-focus-overlay{display:none}.mat-mdc-chip .mat-ripple.mat-mdc-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-chip-avatar{text-align:center;line-height:1;color:var(--mdc-chip-with-icon-icon-color, currentColor)}.mat-mdc-chip{position:relative;z-index:0}.mat-mdc-chip-action-label{text-align:left;z-index:1}[dir=rtl] .mat-mdc-chip-action-label{text-align:right}.mat-mdc-chip.mdc-evolution-chip--with-trailing-action .mat-mdc-chip-action-label{position:relative}.mat-mdc-chip-action-label .mat-mdc-chip-primary-focus-indicator{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none}.mat-mdc-chip-action-label .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-chip-remove::before{margin:calc(var(--mat-focus-indicator-border-width, 3px)*-1);left:8px;right:8px}.mat-mdc-chip-remove::after{content:"";display:block;opacity:0;position:absolute;top:-3px;bottom:-3px;left:5px;right:5px;border-radius:50%;box-sizing:border-box;padding:12px;margin:-12px;background-clip:content-box}.mat-mdc-chip-remove .mat-icon{width:18px;height:18px;font-size:18px;box-sizing:content-box}.mat-chip-edit-input{cursor:text;display:inline-block;color:inherit;outline:0}@media(forced-colors: active){.mat-mdc-chip-selected:not(.mat-mdc-chip-multiple){outline-width:3px}}.mat-mdc-chip-action:focus .mat-focus-indicator::before{content:""}'],encapsulation:2,changeDetection:0})}return n})(),sT=(()=>{class n{_elementRef=b(je);_document=b(Xe);constructor(){}initialize(t){this.getNativeElement().focus(),this.setValue(t)}getNativeElement(){return this._elementRef.nativeElement}setValue(t){this.getNativeElement().textContent=t,this._moveCursorToEndOfInput()}getValue(){return this.getNativeElement().textContent||""}_moveCursorToEndOfInput(){const t=this._document.createRange();t.selectNodeContents(this.getNativeElement()),t.collapse(!1);const r=window.getSelection();r.removeAllRanges(),r.addRange(t)}static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["span","matChipEditInput",""]],hostAttrs:["role","textbox","tabindex","-1","contenteditable","true",1,"mat-chip-edit-input"]})}return n})(),IO=(()=>{class n extends _f{basicChipAttrName="mat-basic-chip-row";_editStartPending=!1;editable=!1;edited=new nt;defaultEditInput;contentEditInput;_isEditing=!1;constructor(){super(),this.role="row",this._onBlur.pipe(At(this.destroyed)).subscribe(()=>{this._isEditing&&!this._editStartPending&&this._onEditFinish()})}_hasTrailingIcon(){return!this._isEditing&&super._hasTrailingIcon()}_handleFocus(){!this._isEditing&&!this.disabled&&this.focus()}_handleKeydown(t){13!==t.keyCode||this.disabled?this._isEditing?t.stopPropagation():super._handleKeydown(t):this._isEditing?(t.preventDefault(),this._onEditFinish()):this.editable&&this._startEditing(t)}_handleDoubleclick(t){!this.disabled&&this.editable&&this._startEditing(t)}_startEditing(t){if(!this.primaryAction||this.removeIcon&&this._getSourceAction(t.target)===this.removeIcon)return;const r=this.value;this._isEditing=this._editStartPending=!0,Cs(()=>{this._getEditInput().initialize(r),this._editStartPending=!1},{injector:this._injector})}_onEditFinish(){this._isEditing=this._editStartPending=!1,this.edited.emit({chip:this,value:this._getEditInput().getValue()}),(this._document.activeElement===this._getEditInput().getNativeElement()||this._document.activeElement===this._document.body)&&this.primaryAction.focus()}_isRippleDisabled(){return super._isRippleDisabled()||this._isEditing}_getEditInput(){return this.contentEditInput||this.defaultEditInput}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-chip-row"],["","mat-chip-row",""],["mat-basic-chip-row"],["","mat-basic-chip-row",""]],contentQueries:function(r,i,o){if(1&r&&$n(o,sT,5),2&r){let s;Qe(s=Ye())&&(i.contentEditInput=s.first)}},viewQuery:function(r,i){if(1&r&&qn(sT,5),2&r){let o;Qe(o=Ye())&&(i.defaultEditInput=o.first)}},hostAttrs:[1,"mat-mdc-chip","mat-mdc-chip-row","mdc-evolution-chip"],hostVars:27,hostBindings:function(r,i){1&r&&Ve("focus",function(s){return i._handleFocus(s)})("dblclick",function(s){return i._handleDoubleclick(s)}),2&r&&(Bo("id",i.id),Ke("tabindex",i.disabled?null:-1)("aria-label",null)("aria-description",null)("role",i.role),at("mat-mdc-chip-with-avatar",i.leadingIcon)("mat-mdc-chip-disabled",i.disabled)("mat-mdc-chip-editing",i._isEditing)("mat-mdc-chip-editable",i.editable)("mdc-evolution-chip--disabled",i.disabled)("mdc-evolution-chip--with-trailing-action",i._hasTrailingIcon())("mdc-evolution-chip--with-primary-graphic",i.leadingIcon)("mdc-evolution-chip--with-primary-icon",i.leadingIcon)("mdc-evolution-chip--with-avatar",i.leadingIcon)("mat-mdc-chip-highlighted",i.highlighted)("mat-mdc-chip-with-trailing-icon",i._hasTrailingIcon()))},inputs:{editable:"editable"},outputs:{edited:"edited"},features:[$e([{provide:_f,useExisting:n},{provide:oT,useExisting:n}]),ke],ngContentSelectors:GPe,decls:10,vars:9,consts:[[1,"mat-mdc-chip-focus-overlay"],["role","gridcell","matChipAction","",1,"mdc-evolution-chip__cell","mdc-evolution-chip__cell--primary",3,"disabled"],[1,"mdc-evolution-chip__graphic","mat-mdc-chip-graphic"],[1,"mdc-evolution-chip__text-label","mat-mdc-chip-action-label"],["aria-hidden","true",1,"mat-mdc-chip-primary-focus-indicator","mat-focus-indicator"],["role","gridcell",1,"mdc-evolution-chip__cell","mdc-evolution-chip__cell--trailing"],[1,"cdk-visually-hidden",3,"id"],["matChipEditInput",""]],template:function(r,i){1&r&&(Hn(WPe),et(0,KPe,1,0,"span",0),W(1,"span",1),et(2,QPe,2,0,"span",2),W(3,"span",3),et(4,ZPe,2,1)(5,JPe,1,0),Pe(6,"span",4),K()(),et(7,eOe,2,0,"span",5),W(8,"span",6),Oe(9),K()),2&r&&(Pt(i._isEditing?-1:0),re(),De("disabled",i.disabled),Ke("aria-label",i.ariaLabel)("aria-describedby",i._ariaDescriptionId),re(),Pt(i.leadingIcon?2:-1),re(2),Pt(i._isEditing?4:5),re(3),Pt(i._hasTrailingIcon()?7:-1),re(),De("id",i._ariaDescriptionId),re(),zd(i.ariaDescription))},dependencies:[gf,sT],styles:['.mdc-evolution-chip,.mdc-evolution-chip__cell,.mdc-evolution-chip__action{display:inline-flex;align-items:center}.mdc-evolution-chip{position:relative;max-width:100%}.mdc-evolution-chip__cell,.mdc-evolution-chip__action{height:100%}.mdc-evolution-chip__cell--primary{flex-basis:100%;overflow-x:hidden}.mdc-evolution-chip__cell--trailing{flex:1 0 auto}.mdc-evolution-chip__action{align-items:center;background:none;border:none;box-sizing:content-box;cursor:pointer;display:inline-flex;justify-content:center;outline:none;padding:0;text-decoration:none;color:inherit}.mdc-evolution-chip__action--presentational{cursor:auto}.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{pointer-events:none}.mdc-evolution-chip__action--primary{font:inherit;letter-spacing:inherit;white-space:inherit;overflow-x:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary::before{border-width:var(--mdc-chip-outline-width, 1px);border-radius:var(--mdc-chip-container-shape-radius, 8px);box-sizing:border-box;content:"";height:100%;left:0;position:absolute;pointer-events:none;top:0;width:100%;z-index:1;border-style:solid}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--primary::before{border-color:var(--mdc-chip-outline-color, var(--mat-sys-outline))}.mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational):not(.mdc-ripple-upgraded):focus::before{border-color:var(--mdc-chip-focus-outline-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--primary::before{border-color:var(--mdc-chip-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__action--primary::before{border-width:var(--mdc-chip-flat-selected-outline-width, 0)}.mat-mdc-basic-chip .mdc-evolution-chip__action--primary{font:inherit}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip__action--trailing{position:relative;overflow:visible}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--trailing{color:var(--mdc-chip-with-trailing-icon-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--trailing{color:var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mdc-evolution-chip__text-label{-webkit-user-select:none;user-select:none;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__text-label{font-family:var(--mdc-chip-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mdc-chip-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mdc-chip-label-text-size, var(--mat-sys-label-large-size));font-weight:var(--mdc-chip-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mdc-chip-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mdc-chip-label-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mdc-chip-selected-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label,.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label{color:var(--mdc-chip-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-evolution-chip__graphic{align-items:center;display:inline-flex;justify-content:center;overflow:hidden;pointer-events:none;position:relative;flex:1 0 auto}.mat-mdc-standard-chip .mdc-evolution-chip__graphic{width:var(--mdc-chip-with-avatar-avatar-size, 24px);height:var(--mdc-chip-with-avatar-avatar-size, 24px);font-size:var(--mdc-chip-with-avatar-avatar-size, 24px)}.mdc-evolution-chip--selecting .mdc-evolution-chip__graphic{transition:width 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selectable:not(.mdc-evolution-chip--selected):not(.mdc-evolution-chip--with-primary-icon) .mdc-evolution-chip__graphic{width:0}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mdc-evolution-chip__checkmark{position:absolute;opacity:0;top:50%;left:50%;height:20px;width:20px}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__checkmark{color:var(--mdc-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__checkmark{color:var(--mdc-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark{transition:transform 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1);transform:translate(-75%, -50%)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{transform:translate(-50%, -50%);opacity:1}.mdc-evolution-chip__checkmark-svg{display:block}.mdc-evolution-chip__checkmark-path{stroke-width:2px;stroke-dasharray:29.7833385;stroke-dashoffset:29.7833385;stroke:currentColor}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark-path{transition:stroke-dashoffset 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark-path{stroke-dashoffset:0}@media(forced-colors: active){.mdc-evolution-chip__checkmark-path{stroke:CanvasText !important}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--trailing{height:18px;width:18px;font-size:18px}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove{opacity:calc(var(--mat-chip-trailing-action-opacity, 1)*var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove:focus{opacity:calc(var(--mat-chip-trailing-action-focus-opacity, 1)*var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mat-mdc-standard-chip{border-radius:var(--mdc-chip-container-shape-radius, 8px);height:var(--mdc-chip-container-height, 32px)}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled){background-color:var(--mdc-chip-elevated-container-color, transparent)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{background-color:var(--mdc-chip-elevated-disabled-container-color)}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled){background-color:var(--mdc-chip-elevated-selected-container-color, var(--mat-sys-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled{background-color:var(--mdc-chip-flat-disabled-selected-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}@media(forced-colors: active){.mat-mdc-standard-chip{outline:solid 1px}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--primary{border-radius:var(--mdc-chip-with-avatar-avatar-shape-radius, 24px);width:var(--mdc-chip-with-icon-icon-size, 18px);height:var(--mdc-chip-with-icon-icon-size, 18px);font-size:var(--mdc-chip-with-icon-icon-size, 18px)}.mdc-evolution-chip--selected .mdc-evolution-chip__icon--primary{opacity:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__icon--primary{color:var(--mdc-chip-with-icon-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--primary{color:var(--mdc-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-highlighted{--mdc-chip-with-icon-icon-color:var(--mdc-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container));--mdc-chip-elevated-container-color:var(--mdc-chip-elevated-selected-container-color, var(--mat-sys-secondary-container));--mdc-chip-label-text-color:var(--mdc-chip-selected-label-text-color, var(--mat-sys-on-secondary-container));--mdc-chip-outline-width:var(--mdc-chip-flat-selected-outline-width, 0)}.mat-mdc-chip-focus-overlay{background:var(--mdc-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-selected .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-chip:hover .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-hover-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mdc-chip-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-focus-overlay .mat-mdc-chip-selected:hover,.mat-mdc-chip-highlighted:hover .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-hover-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mdc-chip-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mdc-chip-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected.cdk-focused .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mdc-chip-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-evolution-chip--disabled:not(.mdc-evolution-chip--selected) .mat-mdc-chip-avatar{opacity:var(--mdc-chip-with-avatar-disabled-avatar-opacity, 0.38)}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{opacity:var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38)}.mdc-evolution-chip--disabled.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{opacity:var(--mdc-chip-with-icon-disabled-icon-opacity, 0.38)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{opacity:var(--mat-chip-disabled-container-opacity, 1)}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-trailing-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-remove{opacity:var(--mat-chip-trailing-action-opacity, 1)}.mat-mdc-chip-remove:focus{opacity:var(--mat-chip-trailing-action-focus-opacity, 1)}.mat-mdc-chip-remove::after{background-color:var(--mat-chip-trailing-action-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-remove:hover::after{opacity:var(--mat-chip-trailing-action-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-remove:focus::after{opacity:var(--mat-chip-trailing-action-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected .mat-mdc-chip-remove::after,.mat-mdc-chip-highlighted .mat-mdc-chip-remove::after{background-color:var(--mat-chip-selected-trailing-action-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-standard-chip .mdc-evolution-chip__cell--primary,.mat-mdc-standard-chip .mdc-evolution-chip__action--primary,.mat-mdc-standard-chip .mat-mdc-chip-action-label{overflow:visible}.mat-mdc-standard-chip .mat-mdc-chip-graphic,.mat-mdc-standard-chip .mat-mdc-chip-trailing-icon{box-sizing:content-box}.mat-mdc-standard-chip._mat-animation-noopable,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__graphic,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark-path{transition-duration:1ms;animation-duration:1ms}.mat-mdc-chip-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;opacity:0;border-radius:inherit;transition:opacity 150ms linear}._mat-animation-noopable .mat-mdc-chip-focus-overlay{transition:none}.mat-mdc-basic-chip .mat-mdc-chip-focus-overlay{display:none}.mat-mdc-chip .mat-ripple.mat-mdc-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-chip-avatar{text-align:center;line-height:1;color:var(--mdc-chip-with-icon-icon-color, currentColor)}.mat-mdc-chip{position:relative;z-index:0}.mat-mdc-chip-action-label{text-align:left;z-index:1}[dir=rtl] .mat-mdc-chip-action-label{text-align:right}.mat-mdc-chip.mdc-evolution-chip--with-trailing-action .mat-mdc-chip-action-label{position:relative}.mat-mdc-chip-action-label .mat-mdc-chip-primary-focus-indicator{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none}.mat-mdc-chip-action-label .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-chip-remove::before{margin:calc(var(--mat-focus-indicator-border-width, 3px)*-1);left:8px;right:8px}.mat-mdc-chip-remove::after{content:"";display:block;opacity:0;position:absolute;top:-3px;bottom:-3px;left:5px;right:5px;border-radius:50%;box-sizing:border-box;padding:12px;margin:-12px;background-clip:content-box}.mat-mdc-chip-remove .mat-icon{width:18px;height:18px;font-size:18px;box-sizing:content-box}.mat-chip-edit-input{cursor:text;display:inline-block;color:inherit;outline:0}@media(forced-colors: active){.mat-mdc-chip-selected:not(.mat-mdc-chip-multiple){outline-width:3px}}.mat-mdc-chip-action:focus .mat-focus-indicator::before{content:""}'],encapsulation:2,changeDetection:0})}return n})(),TO=(()=>{class n{_elementRef=b(je);_changeDetectorRef=b(Uo);_dir=b(Gw,{optional:!0});_lastDestroyedFocusedChipIndex=null;_keyManager;_destroyed=new fe;_defaultRole="presentation";get chipFocusChanges(){return this._getChipStream(t=>t._onFocus)}get chipDestroyedChanges(){return this._getChipStream(t=>t.destroyed)}get chipRemovedChanges(){return this._getChipStream(t=>t.removed)}get disabled(){return this._disabled}set disabled(t){this._disabled=t,this._syncChipsState()}_disabled=!1;get empty(){return!this._chips||0===this._chips.length}get role(){return this._explicitRole?this._explicitRole:this.empty?null:this._defaultRole}tabIndex=0;set role(t){this._explicitRole=t}_explicitRole=null;get focused(){return this._hasFocusedChip()}_chips;_chipActions=new dp;constructor(){}ngAfterViewInit(){this._setUpFocusManagement(),this._trackChipSetChanges(),this._trackDestroyedFocusedChip()}ngOnDestroy(){this._keyManager?.destroy(),this._chipActions.destroy(),this._destroyed.next(),this._destroyed.complete()}_hasFocusedChip(){return this._chips&&this._chips.some(t=>t._hasFocus())}_syncChipsState(){this._chips?.forEach(t=>{t._chipListDisabled=this._disabled,t._changeDetectorRef.markForCheck()})}focus(){}_handleKeydown(t){this._originatesFromChip(t)&&this._keyManager.onKeydown(t)}_isValidIndex(t){return t>=0&&tthis._elementRef.nativeElement.tabIndex=t))}_getChipStream(t){return this._chips.changes.pipe(Ec(null),_o(()=>Ym(...this._chips.map(t))))}_originatesFromChip(t){let r=t.target;for(;r&&r!==this._elementRef.nativeElement;){if(r.classList.contains("mat-mdc-chip"))return!0;r=r.parentElement}return!1}_setUpFocusManagement(){this._chips.changes.pipe(Ec(this._chips)).subscribe(t=>{const r=[];t.forEach(i=>i._getActions().forEach(o=>r.push(o))),this._chipActions.reset(r),this._chipActions.notifyOnChanges()}),this._keyManager=new LEe(this._chipActions).withVerticalOrientation().withHorizontalOrientation(this._dir?this._dir.value:"ltr").withHomeAndEnd().skipPredicate(t=>this._skipPredicate(t)),this.chipFocusChanges.pipe(At(this._destroyed)).subscribe(({chip:t})=>{const r=t._getSourceAction(document.activeElement);r&&this._keyManager.updateActiveItem(r)}),this._dir?.change.pipe(At(this._destroyed)).subscribe(t=>this._keyManager.withHorizontalOrientation(t))}_skipPredicate(t){return!t.isInteractive||t.disabled}_trackChipSetChanges(){this._chips.changes.pipe(Ec(null),At(this._destroyed)).subscribe(()=>{this.disabled&&Promise.resolve().then(()=>this._syncChipsState()),this._redirectDestroyedChipFocus()})}_trackDestroyedFocusedChip(){this.chipDestroyedChanges.pipe(At(this._destroyed)).subscribe(t=>{const i=this._chips.toArray().indexOf(t.chip);this._isValidIndex(i)&&t.chip._hasFocus()&&(this._lastDestroyedFocusedChipIndex=i)})}_redirectDestroyedChipFocus(){if(null!=this._lastDestroyedFocusedChipIndex){if(this._chips.length){const t=Math.min(this._lastDestroyedFocusedChipIndex,this._chips.length-1),r=this._chips.toArray()[t];r.disabled?1===this._chips.length?this.focus():this._keyManager.setPreviousItemActive():r.focus()}else this.focus();this._lastDestroyedFocusedChipIndex=null}}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-chip-set"]],contentQueries:function(r,i,o){if(1&r&&$n(o,_f,5),2&r){let s;Qe(s=Ye())&&(i._chips=s)}},hostAttrs:[1,"mat-mdc-chip-set","mdc-evolution-chip-set"],hostVars:1,hostBindings:function(r,i){1&r&&Ve("keydown",function(s){return i._handleKeydown(s)}),2&r&&Ke("role",i.role)},inputs:{disabled:[2,"disabled","disabled",_t],role:"role",tabIndex:[2,"tabIndex","tabIndex",t=>null==t?0:$d(t)]},ngContentSelectors:vO,decls:2,vars:0,consts:[["role","presentation",1,"mdc-evolution-chip-set__chips"]],template:function(r,i){1&r&&(Hn(),W(0,"div",0),Ae(1),K())},styles:[".mat-mdc-chip-set{display:flex}.mat-mdc-chip-set:focus{outline:none}.mat-mdc-chip-set .mdc-evolution-chip-set__chips{min-width:100%;margin-left:-8px;margin-right:0}.mat-mdc-chip-set .mdc-evolution-chip{margin:4px 0 4px 8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip-set__chips{margin-left:0;margin-right:-8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip{margin-left:0;margin-right:8px}.mdc-evolution-chip-set__chips{display:flex;flex-flow:wrap;min-width:0}.mat-mdc-chip-set-stacked{flex-direction:column;align-items:flex-start}.mat-mdc-chip-set-stacked .mat-mdc-chip{width:100%}.mat-mdc-chip-set-stacked .mdc-evolution-chip__graphic{flex-grow:0}.mat-mdc-chip-set-stacked .mdc-evolution-chip__action--primary{flex-basis:100%;justify-content:start}input.mat-mdc-chip-input{flex:1 0 150px;margin-left:8px}[dir=rtl] input.mat-mdc-chip-input{margin-left:0;margin-right:8px}"],encapsulation:2,changeDetection:0})}return n})();class oOe{source;value;constructor(e,t){this.source=e,this.value=t}}let gY=(()=>{class n extends TO{ngControl=b(qo,{optional:!0,self:!0});controlType="mat-chip-grid";_chipInput;_defaultRole="grid";_errorStateTracker;_ariaDescribedbyIds=[];_onTouched=()=>{};_onChange=()=>{};get disabled(){return this.ngControl?!!this.ngControl.disabled:this._disabled}set disabled(t){this._disabled=t,this._syncChipsState(),this.stateChanges.next()}get id(){return this._chipInput.id}get empty(){return(!this._chipInput||this._chipInput.empty)&&(!this._chips||0===this._chips.length)}get placeholder(){return this._chipInput?this._chipInput.placeholder:this._placeholder}set placeholder(t){this._placeholder=t,this.stateChanges.next()}_placeholder;get focused(){return this._chipInput.focused||this._hasFocusedChip()}get required(){return this._required??this.ngControl?.control?.hasValidator(Ri.required)??!1}set required(t){this._required=t,this.stateChanges.next()}_required;get shouldLabelFloat(){return!this.empty||this.focused}get value(){return this._value}set value(t){this._value=t}_value=[];get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(t){this._errorStateTracker.matcher=t}get chipBlurChanges(){return this._getChipStream(t=>t._onBlur)}change=new nt;valueChange=new nt;_chips=void 0;stateChanges=new fe;get errorState(){return this._errorStateTracker.errorState}set errorState(t){this._errorStateTracker.errorState=t}constructor(){super();const t=b(jm,{optional:!0}),r=b(Ga,{optional:!0}),i=b(tR);this.ngControl&&(this.ngControl.valueAccessor=this),this._errorStateTracker=new fW(i,this.ngControl,r,t,this.stateChanges)}ngAfterContentInit(){this.chipBlurChanges.pipe(At(this._destroyed)).subscribe(()=>{this._blur(),this.stateChanges.next()}),Ym(this.chipFocusChanges,this._chips.changes).pipe(At(this._destroyed)).subscribe(()=>this.stateChanges.next())}ngAfterViewInit(){super.ngAfterViewInit()}ngDoCheck(){this.ngControl&&this.updateErrorState()}ngOnDestroy(){super.ngOnDestroy(),this.stateChanges.complete()}registerInput(t){this._chipInput=t,this._chipInput.setDescribedByIds(this._ariaDescribedbyIds)}onContainerClick(t){!this.disabled&&!this._originatesFromChip(t)&&this.focus()}focus(){if(!this.disabled&&!this._chipInput.focused){if(!this._chips.length||this._chips.first.disabled)Promise.resolve().then(()=>this._chipInput.focus());else{const t=this._keyManager.activeItem;t?t.focus():this._keyManager.setFirstItemActive()}this.stateChanges.next()}}setDescribedByIds(t){this._ariaDescribedbyIds=t,this._chipInput?.setDescribedByIds(t)}writeValue(t){this._value=t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this.stateChanges.next()}updateErrorState(){this._errorStateTracker.updateErrorState()}_blur(){this.disabled||setTimeout(()=>{this.focused||(this._propagateChanges(),this._markAsTouched())})}_allowFocusEscape(){this._chipInput.focused||super._allowFocusEscape()}_handleKeydown(t){const r=t.keyCode,i=this._keyManager.activeItem;if(9===r)this._chipInput.focused&&Lw(t,"shiftKey")&&this._chips.length&&!this._chips.last.disabled?(t.preventDefault(),i?this._keyManager.setActiveItem(i):this._focusLastChip()):super._allowFocusEscape();else if(!this._chipInput.focused)if(38!==r&&40!==r||!i)super._handleKeydown(t);else{const o=this._chipActions.filter(l=>l._isPrimary===i._isPrimary&&!this._skipPredicate(l)),s=o.indexOf(i),a=38===t.keyCode?-1:1;t.preventDefault(),s>-1&&this._isValidIndex(s+a)&&this._keyManager.setActiveItem(o[s+a])}this.stateChanges.next()}_focusLastChip(){this._chips.length&&this._chips.last.focus()}_propagateChanges(){const t=this._chips.length?this._chips.toArray().map(r=>r.value):[];this._value=t,this.change.emit(new oOe(this,t)),this.valueChange.emit(t),this._onChange(t),this._changeDetectorRef.markForCheck()}_markAsTouched(){this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next()}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-chip-grid"]],contentQueries:function(r,i,o){if(1&r&&$n(o,IO,5),2&r){let s;Qe(s=Ye())&&(i._chips=s)}},hostAttrs:[1,"mat-mdc-chip-set","mat-mdc-chip-grid","mdc-evolution-chip-set"],hostVars:10,hostBindings:function(r,i){1&r&&Ve("focus",function(){return i.focus()})("blur",function(){return i._blur()}),2&r&&(Ke("role",i.role)("tabindex",i.disabled||i._chips&&0===i._chips.length?-1:i.tabIndex)("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState),at("mat-mdc-chip-list-disabled",i.disabled)("mat-mdc-chip-list-invalid",i.errorState)("mat-mdc-chip-list-required",i.required))},inputs:{disabled:[2,"disabled","disabled",_t],placeholder:"placeholder",required:[2,"required","required",_t],value:"value",errorStateMatcher:"errorStateMatcher"},outputs:{change:"change",valueChange:"valueChange"},features:[$e([{provide:cR,useExisting:n}]),ke],ngContentSelectors:vO,decls:2,vars:0,consts:[["role","presentation",1,"mdc-evolution-chip-set__chips"]],template:function(r,i){1&r&&(Hn(),W(0,"div",0),Ae(1),K())},styles:[".mat-mdc-chip-set{display:flex}.mat-mdc-chip-set:focus{outline:none}.mat-mdc-chip-set .mdc-evolution-chip-set__chips{min-width:100%;margin-left:-8px;margin-right:0}.mat-mdc-chip-set .mdc-evolution-chip{margin:4px 0 4px 8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip-set__chips{margin-left:0;margin-right:-8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip{margin-left:0;margin-right:8px}.mdc-evolution-chip-set__chips{display:flex;flex-flow:wrap;min-width:0}.mat-mdc-chip-set-stacked{flex-direction:column;align-items:flex-start}.mat-mdc-chip-set-stacked .mat-mdc-chip{width:100%}.mat-mdc-chip-set-stacked .mdc-evolution-chip__graphic{flex-grow:0}.mat-mdc-chip-set-stacked .mdc-evolution-chip__action--primary{flex-basis:100%;justify-content:start}input.mat-mdc-chip-input{flex:1 0 150px;margin-left:8px}[dir=rtl] input.mat-mdc-chip-input{margin-left:0;margin-right:8px}"],encapsulation:2,changeDetection:0})}return n})(),_Y=(()=>{class n{_elementRef=b(je);focused=!1;get chipGrid(){return this._chipGrid}set chipGrid(t){t&&(this._chipGrid=t,this._chipGrid.registerInput(this))}_chipGrid;addOnBlur=!1;separatorKeyCodes;chipEnd=new nt;placeholder="";id=b(Xa).getId("mat-mdc-chip-list-input-");get disabled(){return this._disabled||this._chipGrid&&this._chipGrid.disabled}set disabled(t){this._disabled=t}_disabled=!1;get empty(){return!this.inputElement.value}inputElement;constructor(){const t=b(iT),r=b(uR,{optional:!0});this.inputElement=this._elementRef.nativeElement,this.separatorKeyCodes=t.separatorKeyCodes,r&&this.inputElement.classList.add("mat-mdc-form-field-input-control")}ngOnChanges(){this._chipGrid.stateChanges.next()}ngOnDestroy(){this.chipEnd.complete()}_keydown(t){this.empty&&8===t.keyCode?(t.repeat||this._chipGrid._focusLastChip(),t.preventDefault()):this._emitChipEnd(t)}_blur(){this.addOnBlur&&this._emitChipEnd(),this.focused=!1,this._chipGrid.focused||this._chipGrid._blur(),this._chipGrid.stateChanges.next()}_focus(){this.focused=!0,this._chipGrid.stateChanges.next()}_emitChipEnd(t){(!t||this._isSeparatorKey(t)&&!t.repeat)&&(this.chipEnd.emit({input:this.inputElement,value:this.inputElement.value,chipInput:this}),t?.preventDefault())}_onInput(){this._chipGrid.stateChanges.next()}focus(){this.inputElement.focus()}clear(){this.inputElement.value=""}setDescribedByIds(t){const r=this._elementRef.nativeElement;t.length?r.setAttribute("aria-describedby",t.join(" ")):r.removeAttribute("aria-describedby")}_isSeparatorKey(t){return!Lw(t)&&new Set(this.separatorKeyCodes).has(t.keyCode)}static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["input","matChipInputFor",""]],hostAttrs:[1,"mat-mdc-chip-input","mat-mdc-input-element","mdc-text-field__input","mat-input-element"],hostVars:6,hostBindings:function(r,i){1&r&&Ve("keydown",function(s){return i._keydown(s)})("blur",function(){return i._blur()})("focus",function(){return i._focus()})("input",function(){return i._onInput()}),2&r&&(Bo("id",i.id),Ke("disabled",i.disabled||null)("placeholder",i.placeholder||null)("aria-invalid",i._chipGrid&&i._chipGrid.ngControl?i._chipGrid.ngControl.invalid:null)("aria-required",i._chipGrid&&i._chipGrid.required||null)("required",i._chipGrid&&i._chipGrid.required||null))},inputs:{chipGrid:[0,"matChipInputFor","chipGrid"],addOnBlur:[2,"matChipInputAddOnBlur","addOnBlur",_t],separatorKeyCodes:[0,"matChipInputSeparatorKeyCodes","separatorKeyCodes"],placeholder:"placeholder",id:"id",disabled:[2,"disabled","disabled",_t]},outputs:{chipEnd:"matChipInputTokenEnd"},exportAs:["matChipInput","matChipInputFor"],features:[ei]})}return n})(),sOe=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({providers:[tR,{provide:iT,useValue:{separatorKeyCodes:[13]}}],imports:[gn,vW,gn]})}return n})();const CO=n=>{const e=(n=>{const e={};return Object.keys(n).forEach(t=>{n[t]&&(e[t]=n[t])}),e})(n);return Object.entries(e).map(([t,r])=>`${(n=>n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`))(t)}:${r}`).join(";")};class yY extends Error{constructor(e){super(e),this.name=this.constructor.name}}function Ir(n){this.content=n}Ir.prototype={constructor:Ir,find:function(n){for(var e=0;e>1}},Ir.from=function(n){if(n instanceof Ir)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Ir(e)};const vY=Ir;function bY(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i!=o){if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)t++;return t}if(i.content.size||o.content.size){let s=bY(i.content,o.content,t+1);if(null!=s)return s}t+=i.nodeSize}else t+=i.nodeSize}}function wY(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(0==i||0==o)return i==o?null:{a:t,b:r};let s=n.child(--i),a=e.child(--o),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:t,b:r};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;ce&&!1!==r(l,i+a,o||null,s)&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,t-u),r,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",s=!0;return this.nodesBetween(e,t,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,t-l):a.isLeaf?i?"function"==typeof i?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);oe)for(let o=0,s=0;se&&((st)&&(a=a.isText?a.cut(Math.max(0,e-s),Math.min(a.text.length,t-s)):a.cut(Math.max(0,e-s-1),Math.min(a.content.size,t-s-1))),r.push(a),i+=a.nodeSize),s=l}return new Y(r,i)}cutByIndex(e,t){return e==t?Y.empty:0==e&&t==this.content.length?this:new Y(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new Y(i,o)}addToStart(e){return new Y([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Y(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let s=i+this.child(r).nodeSize;if(s>=e)return s==e||t>0?aT(r+1,s):aT(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return Y.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new Y(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Y.empty;let t,r=0;for(let i=0;i{class n{constructor(t,r){this.type=t,this.attrs=r}addToSet(t){let r,i=!1;for(let o=0;othis.type.rank&&(r||(r=t.slice(0,o)),r.push(this),i=!0),r&&r.push(s)}}return r||(r=t.slice()),i||r.push(this),r}removeFromSet(t){for(let r=0;ri.type.rank-o.type.rank),r}}return n.none=[],n})();class cT extends Error{}class ie{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=IY(this.content,e+this.openStart,t);return r&&new ie(r,this.openStart,this.openEnd)}removeBetween(e,t){return new ie(EY(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return ie.empty;let r=t.openStart||0,i=t.openEnd||0;if("number"!=typeof r||"number"!=typeof i)throw new RangeError("Invalid input for Slice.fromJSON");return new ie(Y.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new ie(e,r,i)}}function EY(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:s,offset:a}=n.findIndex(t);if(i==e||o.isText){if(a!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(EY(o.content,e-i-1,t-i-1)))}function IY(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),s=n.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,t)?null:n.cut(0,e).append(t).append(n.cut(e));let a=IY(s.content,e-o-1,t);return a&&n.replaceChild(i,s.copy(a))}function dOe(n,e,t){if(t.openStart>n.depth)throw new cT("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new cT("Inconsistent open depths");return TY(n,e,t,0)}function TY(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r=0;o--)i=e.node(o).copy(Y.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}(t,n);return yu(o,xY(n,s,a,e,r))}{let s=n.parent,a=s.content;return yu(s,a.cut(0,n.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}}return yu(o,uT(n,e,r))}function CY(n,e){if(!e.type.compatibleContent(n.type))throw new cT("Cannot join "+e.type.name+" onto "+n.type.name)}function SO(n,e,t){let r=n.node(t);return CY(r,e.node(t)),r}function _u(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function D_(n,e,t,r){let i=(e||n).node(t),o=0,s=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(_u(n.nodeAfter,r),o++));for(let a=o;ai&&SO(n,e,i+1),s=r.depth>i&&SO(t,r,i+1),a=[];return D_(null,n,i,a),o&&s&&e.index(i)==t.index(i)?(CY(o,s),_u(yu(o,xY(n,e,t,r,i+1)),a)):(o&&_u(yu(o,uT(n,e,i+1)),a),D_(e,t,i,a),s&&_u(yu(s,uT(t,r,i+1)),a)),D_(r,null,i,a),new Y(a)}function uT(n,e,t){let r=[];return D_(null,n,t,r),n.depth>t&&_u(yu(SO(n,e,t+1),uT(n,e,t+1)),r),D_(e,null,t,r),new Y(r)}ie.empty=new ie(Y.empty,0,0);class A_{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[3*t],i=0==t?0:this.path[3*t-1]+1;for(let o=0;o0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new dT(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),c=o-l;if(r.push(s,a,i+l),!c||(s=s.child(a),s.isText))break;o=c-1,i+=l+1}return new A_(t,r,o)}static resolveCached(e,t){let r=SY.get(e);if(r)for(let o=0;oe&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),DY(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=Y.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=i;lt.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=Y.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,i,r);return o.type.checkAttrs(o.attrs),o}}rs.prototype.text=void 0;class hT extends rs{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):DY(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new hT(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new hT(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function DY(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class vu{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new gOe(e,t);if(null==r.next)return vu.empty;let i=AY(r);r.next&&r.err("Unexpected trailing text");let o=function IOe(n){let e=Object.create(null);return function t(r){let i=[];r.forEach(s=>{n[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u{c||i.push([a,c=[]]),-1==c.indexOf(u)&&c.push(u)})})});let o=e[r.join(",")]=new vu(r.indexOf(n.length-1)>-1);for(let s=0;sl.concat(o(c,a)),[]);if("seq"!=s.type){if("star"==s.type){let l=t();return r(a,l),i(o(s.expr,l),l),[r(l)]}if("plus"==s.type){let l=t();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}if("opt"==s.type)return[r(a)].concat(o(s.expr,a));if("range"==s.type){let l=a;for(let c=0;cl.to=a)}}(i));return function TOe(n,e){for(let t=0,r=[n];tc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join("\n")}}vu.empty=new vu(!0);class gOe{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function AY(n){let e=[];do{e.push(_Oe(n))}while(n.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function _Oe(n){let e=[];do{e.push(yOe(n))}while(n.next&&")"!=n.next&&"|"!=n.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function yOe(n){let e=function wOe(n){if(n.eat("(")){let e=AY(n);return n.eat(")")||n.err("Missing closing paren"),e}if(!/\W/.test(n.next)){let e=function bOe(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let s=t[o];s.isInGroup(e)&&i.push(s)}return 0==i.length&&n.err("No node type or group '"+e+"' found"),i}(n,n.next).map(t=>(null==n.inline?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}n.err("Unexpected token '"+n.next+"'")}(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else{if(!n.eat("{"))break;e=vOe(n,e)}return e}function RY(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function vOe(n,e){let t=RY(n),r=t;return n.eat(",")&&(r="}"!=n.next?RY(n):-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function MY(n,e){return e-n}function kY(n,e){let t=[];return function r(i){let o=n[i];if(1==o.length&&!o[0].term)return r(o[0].to);t.push(i);for(let s=0;s-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:PY(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new rs(this,this.computeAttrs(e),Y.from(t),Mt.setFrom(r))}createChecked(e=null,t,r){return t=Y.from(t),this.checkContent(t),new rs(this,this.computeAttrs(e),t,Mt.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),(t=Y.from(t)).size){let s=this.contentMatch.fillBefore(t);if(!s)return null;t=s.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(Y.empty,!0);return o?new rs(this,e,t.append(o),Mt.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;tr[o]=new fT(o,t,s));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}}class xOe{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate="string"==typeof r.validate?function COe(n,e,t){let r=t.split("|");return i=>{let o=null===i?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${o}`)}}(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class pT{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=FY(e,i.attrs),this.excluded=null;let o=NY(this.attrs);this.instance=o?new Mt(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Mt(this,PY(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new pT(o,i++,t,s)),r}removeFromSet(e){for(var t=0;t-1}}function LY(n,e){let t=[];for(let r=0;r-1)&&t.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}class bu{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(i=>{if(function DOe(n){return null!=n.tag}(i))this.tags.push(i);else if(function AOe(n){return null!=n.style}(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,t={}){let r=new zY(this,t,!1);return r.addAll(e,Mt.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new zY(this,t,!0);return r.addAll(e,Mt.none,t.from,t.to),ie.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(61!=a.charCodeAt(e.length)||a.slice(e.length+1)!=t))){if(s.getAttrs){let l=s.getAttrs(t);if(!1===l)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let t=[];function r(i){let o=null==i.priority?50:i.priority,s=0;for(;s{r(s=jY(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=jY(s)),s.node||s.ignore||s.mark||(s.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new bu(e,bu.schemaRules(e)))}}const VY={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},ROe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},BY={ol:!0,ul:!0};function UY(n,e,t){return null!=e?(e?1:0)|("full"===e?2:0):n&&"pre"==n.whitespace?3:-5&t}class mT{constructor(e,t,r,i,o,s){this.type=e,this.attrs=t,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=Mt.none,this.match=o||(4&s?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(Y.from(e));if(!t){let i,r=this.type.contentMatch;return(i=r.findWrapping(e.type))?(this.match=r,i):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let i,r=this.content[this.content.length-1];if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let t=Y.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(Y.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!VY.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class zY{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o,i=t.topNode,s=UY(null,t.preserveWhitespace,0)|(r?4:0);o=i?new mT(i.type,i.attrs,Mt.none,!0,t.topMatch||i.type.contentMatch,s):new mT(r?null:e.schema.topNodeType,null,Mt.none,!0,null,s),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,i=this.top,o=2&i.options?"full":this.localPreserveWS||(1&i.options)>0;if("full"===o||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)r="full"!==o?r.replace(/\r?\n|\r/g," "):r.replace(/\r\n?/g,"\n");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=i.content[i.content.length-1],a=e.previousSibling;(!s||a&&"BR"==a.nodeName||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),t),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let i=this.localPreserveWS,o=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a,s=e.nodeName.toLowerCase();BY.hasOwnProperty(s)&&this.parser.normalizeLists&&function MOe(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=1==e.nodeType?e.nodeName.toLowerCase():null;r&&BY.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):"li"==r?t=e:r&&(t=null)}}(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:ROe.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,t);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,u=this.needsBlock;if(VY.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=l&&l.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),c&&this.sync(o),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,l,c,!1===l.consuming?a:void 0)}this.localPreserveWS=i}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"==e.nodeName&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let i=0;i!l.clearMark(c)):t.concat(this.parser.schema.marks[l.mark].create(l.attrs)),!1!==l.consuming)break;a=l}}return t}addElementByRule(e,t,r,i){let o,s;if(t.node)if(s=this.parser.schema.nodes[t.node],s.isLeaf)this.insertNode(s.create(t.attrs),r)||this.leafFallback(e,r);else{let l=this.enter(s,t.attrs||null,r,t.preserveWhitespace);l&&(o=!0,r=l)}else r=r.concat(this.parser.schema.marks[t.mark].create(t.attrs));let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r));else{let l=e;"string"==typeof t.contentElement?l=e.querySelector(t.contentElement):"function"==typeof t.contentElement?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}o&&this.sync(a)&&this.open--}addAll(e,t,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,a=null==i?null:e.childNodes[i];s!=a;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,t);this.findAtPoint(e,o)}findPlace(e,t){let r,i;for(let o=this.open;o>=0;o--){let s=this.nodes[o],a=s.findWrapping(e);if(a&&(!r||r.length>a.length)&&(r=a,i=s,!a.length)||s.solid)break}if(!r)return null;this.sync(i);for(let o=0;o!(s.type?s.type.allowsMarkType(c.type):HY(c.type,e))||(l=c.addToSet(l),!1)),this.nodes.push(new mT(e,t,l,i,null,a)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!(!this.isOpen&&!this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=1)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),o=(i?0:1)-(r?r.depth+1:0),s=(a,l)=>{for(;a>=0;a--){let c=t[a];if(""==c){if(a==t.length-1||0==a)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}{let u=l>0||0==l&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return s(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function kOe(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function jY(n){let e={};for(let t in n)e[t]=n[t];return e}function HY(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],s=a=>{o.push(a);for(let l=0;l{if(o.length||s.marks.length){let a=0,l=0;for(;a=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&gT(AO(r),i(e,t),null,e.attrs)}static renderSpec(e,t,r=null,i){return gT(e,t,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new wu(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=$Y(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return $Y(e.marks)}}function $Y(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function AO(n){return n.document||window.document}const qY=new WeakMap;function gT(n,e,t,r){if("string"==typeof e)return{dom:n.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let o,i=e[0];if("string"!=typeof i)throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=function NOe(n){let e=qY.get(n);return void 0===e&&qY.set(n,e=function POe(n){let e=null;return function t(r){if(r&&"object"==typeof r)if(Array.isArray(r))if("string"==typeof r[0])e||(e=[]),e.push(r);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(t=i.slice(0,s),i=i.slice(s+1));let a,l=t?n.createElementNS(t,i):n.createElement(i),c=e[1],u=1;if(c&&"object"==typeof c&&null==c.nodeType&&!Array.isArray(c)){u=2;for(let d in c)if(null!=c[d]){let f=d.indexOf(" ");f>0?l.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):l.setAttribute(d,c[d])}}for(let d=u;du)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}{let{dom:p,contentDOM:m}=gT(n,f,t,r);if(l.appendChild(p),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:l,contentDOM:a}}const GY=Math.pow(2,16);function OOe(n,e){return n+e*GY}function KY(n){return 65535&n}class RO{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class Pi{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Pi.empty)return Pi.empty}recover(e){let t=0,r=KY(e);if(!this.inverted)for(let i=0;ie)break;let c=this.ranges[a+o],u=this.ranges[a+s],d=l+c;if(e<=d){let p=l+i+((c?e==l?-1:e==d?1:t:t)<0?0:u);if(r)return p;let m=e==(t<0?l:d)?null:OOe(a/3,e-l),_=e==l?2:e==d?1:4;return(t<0?e!=l:e!=d)&&(_|=8),new RO(p,_,m)}i+=u-c}return r?e+i:new RO(e+i,0,null)}touches(e,t){let r=0,i=KY(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;ae)break;let c=this.ranges[a+o];if(e<=l+c&&a==3*i)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=i&&i>t?r-i-1:void 0)}}invert(){let e=new yf;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;ro&&ls.isAtom&&a.type.allowsMarkType(this.mark.type)?s.mark(this.mark.addToSet(s.marks)):s,i),t.openStart,t.openEnd);return An.fromReplace(e,this.from,this.to,o)}invert(){return new is(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Tl(t.pos,r.pos,this.mark)}merge(e){return e instanceof Tl&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Tl(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Tl(t.from,t.to,e.markFromJSON(t.mark))}}Tr.jsonID("addMark",Tl);class is extends Tr{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new ie(kO(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return An.fromReplace(e,this.from,this.to,r)}invert(){return new Tl(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new is(t.pos,r.pos,this.mark)}merge(e){return e instanceof is&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new is(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new is(t.from,t.to,e.markFromJSON(t.mark))}}Tr.jsonID("removeMark",is);class Cl extends Tr{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return An.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return An.fromReplace(e,this.pos,this.pos+1,new ie(Y.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;ir.pos?null:new cr(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new cr(t.from,t.to,t.gapFrom,t.gapTo,ie.fromJSON(e,t.slice),t.insert,!!t.structure)}}function NO(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function PO(n,e,t,r=t.contentMatch,i=!0){let o=n.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l=0;l--)n.step(s[l])}function BOe(n,e,t){return(0==e||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function k_(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),o=n.$from.index(r),s=n.$to.indexAfter(r);if(r{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let l=n.mapping.slice(r).map(t+1+o+s.index);n.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function eX(n,e,t,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=n.mapping.slice(r).map(t+1+o);n.replaceWith(s,s+1,e.type.schema.text("\n"))}})}function bf(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=t-2;c>o;c--,u--){let d=i.node(c),f=i.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),m=r&&r[u+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let _=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!_.type.validContent(p))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function yT(n,e){let t=n.resolve(e),r=t.index();return function tX(n,e){return!(!n||!e||n.isLeaf||!function KOe(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:r}=n.type.schema;for(let i=0;i0;i--)this.placed=Y.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&1==o.childCount;)o=o.firstChild.content,s--,a--;let l=new ie(o,s,a);return e>-1?new cr(r.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||r.pos!=this.$to.pos?new Cr(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}t=o.content}for(let t=1;t<=2;t++)for(let r=1==t?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=LO(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let u,{type:l,match:c}=this.frontier[a],d=null;if(1==t&&(s?c.matchType(s.type)||(d=c.fillBefore(Y.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:d};if(2==t&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=LO(e,t);return!(!i.childCount||i.firstChild.isLeaf||(this.unplaced=new ie(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),0))}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=LO(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new ie(N_(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new ie(N_(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let _=0;_1||0==l||_.content.size)&&(d=v,u.push(rX(_.mark(f.allowedMarks(_.marks)),1==c?l:0,c==a.childCount?p:-1)))}let m=c==a.childCount;m||(p=-1),this.placed=P_(this.placed,t,Y.from(u)),this.frontier[t].match=d,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let _=0,v=a;_1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],o=t=0;a--){let{match:l,type:c}=this.frontier[a],u=VO(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:t,fit:s,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=P_(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=P_(this.placed,this.depth,Y.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(Y.empty,!0);t.childCount&&(this.placed=P_(this.placed,this.frontier.length,t))}}function N_(n,e,t){return 0==e?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(N_(n.firstChild.content,e-1,t)))}function P_(n,e,t){return 0==e?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(P_(n.lastChild.content,e-1,t)))}function LO(n,e){for(let t=0;t1&&(r=r.replaceChild(0,rX(r.firstChild,e-1,1==r.childCount?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(Y.empty,!0)))),n.copy(r)}function VO(n,e,t,r,i){let o=n.node(e),s=i?n.indexAfter(e):n.index(e);if(s==o.childCount&&!t.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function JOe(n,e,t){for(let r=t;rr){let o=i.contentMatchAt(0),s=o.fillBefore(n).append(n);n=s.append(o.matchFragment(s).fillBefore(Y.empty,!0))}return n}function oX(n,e){let t=[];for(let i=Math.min(n.depth,e.depth);i>=0;i--){let o=n.start(i);if(oe.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&t.push(i)}return t}class wf extends Tr{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return An.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return An.fromReplace(e,this.pos,this.pos+1,new ie(Y.from(i),0,t.isLeaf?0:1))}getMap(){return Pi.empty}invert(e){return new wf(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new wf(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new wf(t.pos,t.attr,t.value)}}Tr.jsonID("attr",wf);class O_ extends Tr{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return An.ok(r)}getMap(){return Pi.empty}invert(e){return new O_(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new O_(t.attr,t.value)}}Tr.jsonID("docAttr",O_);let Ef=class extends Error{};Ef=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},(Ef.prototype=Object.create(Error.prototype)).constructor=Ef,Ef.prototype.name="TransformError";class iFe{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new yf}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Ef(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=ie.empty){let i=FO(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new ie(Y.from(r),0,0))}delete(e,t){return this.replace(e,t,ie.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return function tFe(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),o=n.doc.resolve(t);if(nX(i,o,r))return n.step(new Cr(e,t,r));let s=oX(i,n.doc.resolve(t));0==s[s.length-1]&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let f=i.depth,p=i.pos-1;f>0;f--,p--){let m=i.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(f)>-1?a=f:i.before(f)==p&&s.splice(1,0,-f)}let l=s.indexOf(a),c=[],u=r.openStart;for(let f=r.content,p=0;;p++){let m=f.firstChild;if(c.push(m),p==r.openStart)break;f=m.content}for(let f=u-1;f>=0;f--){let p=c[f],m=eFe(p.type);if(m&&!p.sameMarkup(i.node(Math.abs(a)-1)))u=f;else if(m||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+u+1)%(r.openStart+1),m=c[p];if(m)for(let _=0;_=0&&(n.replace(e,t,r),!(n.steps.length>d));f--){let p=s[f];p<0||(e=i.before(p),t=o.after(p))}}(this,e,t,r),this}replaceRangeWith(e,t,r){return function nFe(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=function YOe(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(0==r.parentOffset)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,t))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,t))return r.after(i+1);if(o0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return n.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&t>r.end(s)&&i.end(s)-t!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return n.delete(r.before(s),t);n.delete(e,t)}(this,e,t),this}lift(e,t){return function UOe(n,e,t){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),a=i.after(o+1),l=s,c=a,u=Y.empty,d=0;for(let m=o,_=!1;m>t;m--)_||r.index(m)>0?(_=!0,u=Y.from(r.node(m).copy(u)),d++):l--;let f=Y.empty,p=0;for(let m=o,_=!1;m>t;m--)_||i.after(m+1)=0;s--){if(r.size){let a=t[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Y.from(t[s].type.create(t[s].attrs,r))}let i=e.start,o=e.end;n.step(new cr(i,o,i,o,new ie(r,0,0),t.length,!0))}(this,e,t),this}setBlockType(e,t=e,r,i=null){return function $Oe(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(s,a)=>{let l="function"==typeof i?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,l)&&function qOe(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}(n.doc,n.mapping.slice(o).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let p="pre"==r.whitespace,m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!m?c=!1:!p&&m&&(c=!0)}!1===c&&eX(n,s,a,o),PO(n,n.mapping.slice(o).map(a,1),r,void 0,null===c);let u=n.mapping.slice(o),d=u.map(a,1),f=u.map(a+s.nodeSize,1);return n.step(new cr(d,f,d+1,f-1,new ie(Y.from(r.create(l,null,s.marks)),0,0),1,!0)),!0===c&&JY(n,s,a,o),!1}})}(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return function WOe(n,e,t,r,i){let o=n.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);let s=t.create(r,null,i||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,s);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new cr(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new ie(Y.from(s),0,0),1,!0))}(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new wf(e,t,r)),this}setDocAttribute(e,t){return this.step(new O_(e,t)),this}addNodeMark(e,t){return this.step(new Cl(e,t)),this}removeNodeMark(e,t){if(!(t instanceof Mt)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(!(t=t.isInSet(r.marks)))return this}return this.step(new vf(e,t)),this}split(e,t=1,r){return function GOe(n,e,t=1,r){let i=n.doc.resolve(e),o=Y.empty,s=Y.empty;for(let a=i.depth,l=i.depth-t,c=t-1;a>l;a--,c--){o=Y.from(i.node(a).copy(o));let u=r&&r[c];s=Y.from(u?u.type.create(u.attrs,s):i.node(a).copy(s))}n.step(new Cr(e,e,new ie(o.append(s),t,t),!0))}(this,e,t,r),this}addMark(e,t,r){return function LOe(n,e,t,r){let s,a,i=[],o=[];n.doc.nodesBetween(e,t,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),p=Math.min(c+l.nodeSize,t),m=r.addToSet(d);for(let _=0;_n.step(l)),o.forEach(l=>n.step(l))}(this,e,t,r),this}removeMark(e,t,r){return function VOe(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof pT){let u,c=s.marks;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,t);for(let u=0;un.step(new is(s.from,s.to,s.style)))}(this,e,t,r),this}clearIncompatible(e,t,r){return PO(this,e,t,r),this}}const BO=Object.create(null);class rt{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new UO(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;o--){let s=t<0?If(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):If(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(s)return s}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Oi(e.node(0))}static atStart(e){return If(e,e,0,0,1)||new Oi(e)}static atEnd(e){return If(e,e,e.content.size,e.childCount,-1)||new Oi(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=BO[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in BO)throw new RangeError("Duplicate use of selection JSON ID "+e);return BO[e]=t,t.prototype.jsonID=e,t}getBookmark(){return lt.between(this.$anchor,this.$head).getBookmark()}}rt.prototype.visible=!0;class UO{constructor(e,t){this.$from=e,this.$to=t}}let sX=!1;function aX(n){!sX&&!n.parent.inlineContent&&(sX=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class lt extends rt{constructor(e,t=e){aX(e),aX(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return rt.near(r);let i=e.resolve(t.map(this.anchor));return new lt(i.parent.inlineContent?i:r,r)}replace(e,t=ie.empty){if(super.replace(e,t),t==ie.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof lt&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new vT(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new lt(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let o=rt.findFrom(t,r,!0)||rt.findFrom(t,-r,!0);if(!o)return rt.near(t,r);t=o.$head}return e.parent.inlineContent||(0==i||(e=(rt.findFrom(e,-r,!0)||rt.findFrom(e,r,!0)).$anchor).posnew Oi(n)};function If(n,e,t,r,i,o=!1){if(e.inlineContent)return lt.create(n,t);for(let s=r-(i>0?0:1);i>0?s=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&Ie.isSelectable(a))return Ie.create(n,t-(i<0?a.nodeSize:0))}else{let l=If(n,a,t+i,i<0?a.childCount:0,i,o);if(l)return l}t+=a.nodeSize*i}return null}function lX(n,e,t){let r=n.steps.length-1;if(r{null==s&&(s=u)}),n.setSelection(rt.near(n.doc.resolve(s),t)))}class sFe extends iFe{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return Mt.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Mt.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let i=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(null==r&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(t);o=r==t?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,i.text(e,o)),this.selection.empty||this.setSelection(rt.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function dX(n,e){return e&&n?n.bind(e):n}class F_{constructor(e,t,r){this.name=e,this.init=dX(t.init,r),this.apply=dX(t.apply,r)}}const aFe=[new F_("doc",{init:n=>n.doc||n.schema.topNodeType.createAndFill(),apply:n=>n.doc}),new F_("selection",{init:(n,e)=>n.selection||rt.atStart(e.doc),apply:n=>n.selection}),new F_("storedMarks",{init:n=>n.storedMarks||null,apply:(n,e,t,r)=>r.selection.$cursor?n.storedMarks:null}),new F_("scrollToSelection",{init:()=>0,apply:(n,e)=>n.scrolledIntoView?e+1:e})];class jO{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=aFe.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new F_(r.key,r.spec.state,r))})}}class Tf{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;rr.toJSON())),e&&"object"==typeof e)for(let r in e){if("doc"==r||"selection"==r)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(t[r]=o.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new jO(e.schema,e.plugins),o=new Tf(i);return i.fields.forEach(s=>{if("doc"==s.name)o.doc=rs.fromJSON(e.schema,t.doc);else if("selection"==s.name)o.selection=rt.fromJSON(o.doc,t.selection);else if("storedMarks"==s.name)t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(t,a))return void(o[s.name]=c.fromJSON.call(l,e,t[a],o))}o[s.name]=s.init(e,o)}}),o}}function hX(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):"handleDOMEvents"==r&&(i=hX(i,e,{})),t[r]=i}return t}class ss{constructor(e){this.spec=e,this.props={},e.props&&hX(e.props,this,this.props),this.key=e.key?e.key.key:fX("plugin")}getState(e){return e[this.key]}}const HO=Object.create(null);function fX(n){return n in HO?n+"$"+ ++HO[n]:(HO[n]=0,n+"$")}class Js{constructor(e="key"){this.key=fX(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ur=function(n){for(var e=0;;e++)if(!(n=n.previousSibling))return e},L_=function(n){let e=n.assignedSlot||n.parentNode;return e&&11==e.nodeType?e.host:e};let $O=null;const ea=function(n,e,t){let r=$O||($O=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},Eu=function(n,e,t,r){return t&&(pX(n,e,t,r,-1)||pX(n,e,t,r,1))},cFe=/^(img|br|input|textarea|hr)$/i;function pX(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:to(n))){let o=n.parentNode;if(!o||1!=o.nodeType||V_(n)||cFe.test(n.nodeName)||"false"==n.contentEditable)return!1;e=ur(n)+(i<0?0:1),n=o}else{if(1!=n.nodeType)return!1;if("false"==(n=n.childNodes[e+(i<0?-1:0)]).contentEditable)return!1;e=i<0?to(n):0}}}function to(n){return 3==n.nodeType?n.nodeValue.length:n.childNodes.length}function V_(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const wT=function(n){return n.focusNode&&Eu(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Iu(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const as=typeof navigator<"u"?navigator:null,mX=typeof document<"u"?document:null,xl=as&&as.userAgent||"",qO=/Edge\/(\d+)/.exec(xl),gX=/MSIE \d/.exec(xl),WO=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(xl),di=!!(gX||WO||qO),Sl=gX?document.documentMode:WO?+WO[1]:qO?+qO[1]:0,Eo=!di&&/gecko\/(\d+)/i.test(xl);Eo&&/Firefox\/(\d+)/.exec(xl);const GO=!di&&/Chrome\/(\d+)/.exec(xl),xr=!!GO,_X=GO?+GO[1]:0,Hr=!di&&!!as&&/Apple Computer/.test(as.vendor),Cf=Hr&&(/Mobile\/\w+/.test(xl)||!!as&&as.maxTouchPoints>2),no=Cf||!!as&&/Mac/.test(as.platform),mFe=!!as&&/Win/.test(as.platform),ta=/Android \d/.test(xl),B_=!!mX&&"webkitFontSmoothing"in mX.documentElement.style,gFe=B_?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function _Fe(n){let e=n.defaultView&&n.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function na(n,e){return"number"==typeof n?n:n[e]}function yFe(n){let e=n.getBoundingClientRect();return{left:e.left,right:e.left+n.clientWidth*(e.width/n.offsetWidth||1),top:e.top,bottom:e.top+n.clientHeight*(e.height/n.offsetHeight||1)}}function yX(n,e,t){let r=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,o=n.dom.ownerDocument;for(let s=t||n.dom;s;s=L_(s)){if(1!=s.nodeType)continue;let a=s,l=a==o.body,c=l?_Fe(o):yFe(a),u=0,d=0;if(e.topc.bottom-na(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+na(i,"top")-c.top:e.bottom-c.bottom+na(i,"bottom")),e.leftc.right-na(r,"right")&&(u=e.right-c.right+na(i,"right")),u||d)if(l)o.defaultView.scrollBy(u,d);else{let f=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let m=a.scrollLeft-f,_=a.scrollTop-p;e={left:e.left-m,top:e.top-_,right:e.right-m,bottom:e.bottom-_}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function vX(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=L_(r));return e}function bX(n,e){for(let t=0;t=a){s=Math.max(m.bottom,s),a=Math.min(m.top,a);let _=m.left>e.left?m.left-e.left:m.right=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!l&&m.left<=e.left&&m.right>=e.left&&(l=u,c={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!t&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(o=d+1)}}return!t&&l&&(t=l,i=c,r=0),t&&3==t.nodeType?function EFe(n,e){let t=n.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:n,offset:0}}(t,i):!t||r&&1==t.nodeType?{node:n,offset:o}:wX(t,i)}function KO(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function EX(n,e,t){let r=n.childNodes.length;if(r&&t.tope.top&&i++}let c;B_&&i&&1==r.nodeType&&1==(c=r.childNodes[i-1]).nodeType&&"false"==c.contentEditable&&c.getBoundingClientRect().top>=e.top&&i--,r==n.dom&&i==r.childNodes.length-1&&1==r.lastChild.nodeType&&e.top>r.lastChild.getBoundingClientRect().bottom?a=n.state.doc.content.size:(0==i||1!=r.nodeType||"BR"!=r.childNodes[i-1].nodeName)&&(a=function CFe(n,e,t,r){let i=-1;for(let o=e,s=!1;o!=n.dom;){let l,a=n.docView.nearestDesc(o,!0);if(!a)return null;if(1==a.dom.nodeType&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&(!s&&l.left>r.left||l.top>r.top?i=a.posBefore:(!s&&l.right-1?i:n.docView.posFromDOM(e,t,-1)}(n,r,i,e))}null==a&&(a=function TFe(n,e,t){let{node:r,offset:i}=wX(e,t),o=-1;if(1==r.nodeType&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&t.left>(s.left+s.right)/2?1:-1}return n.docView.posFromDOM(r,i,o)}(n,s,e));let l=n.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function IX(n){return n.top=0&&i==r.nodeValue.length?(l--,u=1):t<0?l--:c++,U_(Dl(ea(r,l,c),u),u<0)}{let l=Dl(ea(r,i,i),t);if(Eo&&i&&/\s/.test(r.nodeValue[i-1])&&i=0)}if(null==o&&i&&(t<0||i==to(r))){let l=r.childNodes[i-1],c=3==l.nodeType?ea(l,to(l)-(s?0:1)):1!=l.nodeType||"BR"==l.nodeName&&l.nextSibling?null:l;if(c)return U_(Dl(c,1),!1)}if(null==o&&i=0)}function U_(n,e){if(0==n.width)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function QO(n,e){if(0==n.height)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function CX(n,e,t){let r=n.state,i=n.root.activeElement;r!=e&&n.updateState(e),i!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),i!=n.dom&&i&&i.focus()}}const AFe=/[\u0590-\u08ac]/;let xX=null,SX=null,DX=!1;class z_{constructor(e,t,r,i){this.parent=e,this.children=t,this.dom=r,this.contentDOM=i,this.dirty=0,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tur(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(null==i&&t==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,i=e;i;i=i.parentNode){let s,o=this.getDesc(i);if(o&&(!t||o.node)){if(!r||!(s=o.nodeDOM)||(1==s.nodeType?s.contains(1==e.nodeType?e:e.parentNode):s==e))return o;r=!1}}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;te||s instanceof kX){i=e-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof RX&&o.side>=0;r--);if(t<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,o&&o.dom.parentNode!=this.contentDOM;r--,s=!1);return o&&t&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,t):{node:this.contentDOM,offset:o?ur(o.dom)+1:0}}{let o,s=!0;for(;o=r=u&&t<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,t,u);e=s;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=ur(f.dom)+1;break}e-=f.size}-1==i&&(i=0)}if(i>-1&&(c>t||a==this.children.length-1)){t=c;for(let u=a+1;um&&st){let m=a;a=l,l=m}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,i=0;i=r:er){let a=r+o.border,l=s-o.border;if(e>=a&&t<=l)return this.dirty=e==r||t==s?2:1,void(e!=a||t!=l||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-a,t-a):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}r=s}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=1==e?2:1;t.dirtyo?o.parent?o.parent.posBeforeChild(o):void 0:i)),!t.type.spec.raw){if(1!=s.nodeType){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class kFe extends z_{constructor(e,t,r,i){super(e,[],t,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class Cu extends z_{constructor(e,t,r,i,o){super(e,[],r,i),this.mark=t,this.spec=o}static create(e,t,r,i){let o=i.nodeViews[t.type.name],s=o&&o(t,i,r);return(!s||!s.dom)&&(s=wu.renderSpec(document,t.type.spec.toDOM(t,r),null,t.attrs)),new Cu(e,t,s.dom,s.contentDOM||s.dom,s)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=XO(o,0,e,r));for(let a=0;al?l.parent?l.parent.posBeforeChild(l):void 0:s,r,i),u=c&&c.dom,d=c&&c.contentDOM;if(t.isText)if(u){if(3!=u.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else u=document.createTextNode(t.text);else u||({dom:u,contentDOM:d}=wu.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!d&&!t.isText&&"BR"!=u.nodeName&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let f=u;return u=OX(u,r,t),c?l=new NFe(e,t,r,i,u,d||null,f,c,o,s+1):t.isText?new ET(e,t,r,i,u,f,o):new Al(e,t,r,i,u,d||null,f,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Y.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,r){return 0==this.dirty&&e.eq(this.node)&&IT(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,i=t,o=e.composing?this.localCompositionInfo(e,t):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new OFe(this,s&&s.node,e);(function VFe(n,e,t,r){let i=e.locals(n),o=0;if(0==i.length){for(let c=0;co;)a.push(i[s++]);let m=o+f.nodeSize;if(f.isText){let v=m;s!v.inline):a.slice(),e.forChild(o,f),p),o=m}})(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?Mt.none:this.node.child(u).marks,r,e),l.placeWidget(c,e,i)},(c,u,d,f)=>{let p;l.syncToMarks(c.marks,r,e),l.findNodeMatch(c,u,d,f)||a&&e.state.selection.from>i&&e.state.selection.to-1&&l.updateNodeAt(c,u,d,p,e)||l.updateNextNode(c,u,d,e,f,i)||l.addNode(c,u,d,e,i),i+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(s&&this.protectLocalComposition(e,s),NX(this.contentDOM,this.children,e),Cf&&function BFe(n){if("UL"==n.nodeName||"OL"==n.nodeName){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n),n.style.cssText=e}}(this.dom))}localCompositionInfo(e,t){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof lt)||rt+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,a=function UFe(n,e,t,r){for(let i=0,o=0;i=t){if(o>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a=0&&c+e.length+a>=t)return a+c;if(t==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}(this.node.content,s,r-t,i-t);return a<0?null:{node:o,pos:a,text:s}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:i}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new kFe(this,o,t,i);e.input.compositionNodes.push(s),this.children=XO(this.children,r,r+i.length,e,s)}update(e,t,r,i){return!(3==this.dirty||!e.sameMarkup(this.node)||(this.updateInner(e,t,r,i),0))}updateInner(e,t,r,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(IT(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,r=this.dom;this.dom=PX(this.dom,this.nodeDOM,YO(this.outerDeco,this.node,t),YO(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function MX(n,e,t,r,i){OX(r,e,n);let o=new Al(void 0,n,e,t,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class ET extends Al{constructor(e,t,r,i,o,s,a){super(e,t,r,i,o,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,i){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node)||(this.updateOuterDeco(t),(0!=this.dirty||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=0,0))}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,r){let i=this.node.cut(e,t),o=document.createTextNode(i.text);return new ET(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(0==e||t==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class kX extends z_{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class NFe extends Al{constructor(e,t,r,i,o,s,a,l,c,u){super(e,t,r,i,o,s,a,c,u),this.spec=l}update(e,t,r,i){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,t,r);return o&&this.updateInner(e,t,r,i),o}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,i){this.spec.setSelection?this.spec.setSelection(e,t,r.root):super.setSelection(e,t,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function NX(n,e,t){let r=n.firstChild,i=!1;for(let o=0;o0;){let a;for(;;)if(r){let c=t.children[r-1];if(!(c instanceof Cu)){a=c,r--;break}t=c,r=c.children.length}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let l=a.node;if(l){if(l!=n.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let r=e;r>1,s=Math.min(o,e.length);for(;i-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=Cu.create(this.top,e[o],t,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,r,i){let s,o=-1;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,t,r))o=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a=t||u<=e?o.push(l):(ct&&o.push(l.slice(t-c,l.size,r)))}return o}function ZO(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),o=i&&0==i.size,s=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(s<0)return null;let l,c,a=r.resolve(s);if(wT(t)){for(l=s;i&&!i.node;)i=i.parent;let d=i.node;if(i&&d.isAtom&&Ie.isSelectable(d)&&i.parent&&(!d.isInline||!function hFe(n,e,t){for(let r=0==e,i=e==to(n);r||i;){if(n==t)return!0;let o=ur(n);if(!(n=n.parentNode))return!1;r=r&&0==o,i=i&&o==to(n)}}(t.focusNode,t.focusOffset,i.dom))){let f=i.posBefore;c=new Ie(s==f?a:r.resolve(f))}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let d=s,f=s;for(let p=0;p{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!LX(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const VX=Hr||xr&&_X<63;function BX(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),i=ri(n,e,t))||lt.between(e,t,r)}function HX(n){return!(n.editable&&!n.hasFocus())&&$X(n)}function $X(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function tF(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),o=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return o&&rt.findFrom(o,e)}function Rl(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function qX(n,e,t){let r=n.state.selection;if(!(r instanceof lt)){if(r instanceof Ie&&r.node.isInline)return Rl(n,new lt(e>0?r.$to:r.$from));{let i=tF(n.state,e);return!!i&&Rl(n,i)}}if(t.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=n.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return Rl(n,new lt(r.$anchor,s))}if(!r.empty)return!1;if(n.endOfTextblock(e>0?"forward":"backward")){let i=tF(n.state,e);return!!(i&&i instanceof Ie)&&Rl(n,i)}if(!(no&&t.indexOf("m")>-1)){let s,i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let a=e<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(s=n.docView.descAt(a))&&!s.contentDOM)&&(Ie.isSelectable(o)?Rl(n,new Ie(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):!!B_&&Rl(n,new lt(n.state.doc.resolve(e<0?a:a+o.nodeSize))))}}function TT(n){return 3==n.nodeType?n.nodeValue.length:n.childNodes.length}function H_(n,e){let t=n.pmViewDesc;return t&&0==t.size&&(e<0||n.nextSibling||"BR"!=n.nodeName)}function Sf(n,e){return e<0?function $Fe(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,s=!1;for(Eo&&1==t.nodeType&&r0){if(1!=t.nodeType)break;{let a=t.childNodes[r-1];if(H_(a,-1))i=t,o=--r;else{if(3!=a.nodeType)break;t=a,r=t.nodeValue.length}}}else{if(WX(t))break;{let a=t.previousSibling;for(;a&&H_(a,-1);)i=t.parentNode,o=ur(a),a=a.previousSibling;if(a)t=a,r=TT(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}s?nF(n,t,r):i&&nF(n,i,o)}(n):function qFe(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let o,s,i=TT(t);for(;;)if(r{n.state==i&&ra(n)},50)}function GX(n,e){let t=n.state.doc.resolve(e);if(!xr&&!mFe&&t.parent.inlineContent){let i=n.coordsAtPos(e);if(e>t.start()){let o=n.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(n.dom).direction?"rtl":"ltr"}function KX(n,e,t){let r=n.state.selection;if(r instanceof lt&&!r.empty||t.indexOf("s")>-1||no&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let s=tF(n.state,e);if(s&&s instanceof Ie)return Rl(n,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=r instanceof Oi?rt.near(s,e):rt.findFrom(s,e);return!!a&&Rl(n,a)}return!1}function QX(n,e){if(!(n.state.selection instanceof lt))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(o&&!o.isText){let s=n.state.tr;return e<0?s.delete(t.pos-o.nodeSize,t.pos):s.delete(t.pos,t.pos+o.nodeSize),n.dispatch(s),!0}return!1}function YX(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function rF(n,e){n.someProp("transformCopied",p=>{e=p(e,n)});let t=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let p=r.firstChild;t.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=n.someProp("clipboardSerializer")||wu.fromSchema(n.state.schema),a=iZ(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let u,c=l.firstChild,d=0;for(;c&&1==c.nodeType&&(u=nZ[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let m=a.createElement(u[p]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),d++}c=l.firstChild}return c&&1==c.nodeType&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(t)}`),{dom:l,text:n.someProp("clipboardTextSerializer",p=>p(e,n))||e.content.textBetween(0,e.content.size,"\n\n"),slice:e}}function XX(n,e,t,r,i){let s,a,o=i.parent.type.spec.code;if(!t&&!e)return null;let l=e&&(r||o||!t);if(l){if(n.someProp("transformPastedText",f=>{e=f(e,o||r,n)}),o)return e?new ie(Y.from(n.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):ie.empty;let d=n.someProp("clipboardTextParser",f=>f(e,i,r,n));if(d)a=d;else{let f=i.marks(),{schema:p}=n.state,m=wu.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(_=>{let v=s.appendChild(document.createElement("p"));_&&v.appendChild(m.serializeNode(p.text(_,f)))})}}else n.someProp("transformPastedHTML",d=>{t=d(t,n)}),s=function eLe(n){let e=/^(\s*]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let i,t=iZ().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n);if((i=r&&nZ[r[1].toLowerCase()])&&(n=i.map(o=>"<"+o+">").join("")+n+i.map(o=>"").reverse().join("")),t.innerHTML=function JFe(n){let e=window.trustedTypes;return e?(oF||(oF=e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),oF.createHTML(n)):n}(n),i)for(let o=0;o0;d--){let f=s.firstChild;for(;f&&1!=f.nodeType;)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(n.someProp("clipboardParser")||n.someProp("domParser")||bu.fromSchema(n.state.schema)).parseSlice(s,{preserveWhitespace:!(!l&&!u),context:i,ruleFromNode:f=>"BR"!=f.nodeName||f.nextSibling||!f.parentNode||XFe.test(f.parentNode.nodeName)?null:{ignore:!0}})),u)a=function nLe(n,e){if(!n.size)return n;let r,t=n.content.firstChild.type.schema;try{r=JSON.parse(e)}catch{return n}let{content:i,openStart:o,openEnd:s}=n;for(let a=r.length-2;a>=0;a-=2){let l=t.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=Y.from(l.create(r[a+1],i)),o++,s++}return new ie(i,o,s)}(tZ(a,+u[1],+u[2]),u[4]);else if(a=ie.maxOpen(function ZFe(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let o,i=e.node(t).contentMatchAt(e.index(t)),s=[];if(n.forEach(a=>{if(!s)return;let c,l=i.findWrapping(a.type);if(!l)return s=null;if(c=s.length&&o.length&&JX(l,o,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=eZ(s[s.length-1],o.length));let u=ZX(a,l);s.push(u),i=i.matchType(u.type),o=l}}),s)return Y.from(s)}return n}(a.content,i),!0),a.openStart||a.openEnd){let d=0,f=0;for(let p=a.content.firstChild;d{a=d(a,n)}),a}const XFe=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function ZX(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,Y.from(n));return n}function JX(n,e,t,r,i){if(i1&&(o=0),i=t&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(Y.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,s.copy(a))}function tZ(n,e,t){return e{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>aF(n,r))})}function aF(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return!!r&&(r(n,e)||e.defaultPrevented)})}function aLe(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||11==t.nodeType||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function CT(n){return{left:n.clientX,top:n.clientY}}function lF(n,e,t,r,i){if(-1==r)return!1;let o=n.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(n.someProp(e,a=>s>o.depth?a(n,t,o.nodeAfter,o.before(s),i,!0):a(n,t,o.node(s),o.before(s),i,!1)))return!0;return!1}function Df(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);"pointer"==t&&r.setMeta("pointer",!0),n.dispatch(r)}function fLe(n,e,t,r){return lF(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function pLe(n,e,t,r){return lF(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||function mLe(n,e,t){if(0!=t.button)return!1;let r=n.state.doc;if(-1==e)return!!r.inlineContent&&(Df(n,lt.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)Df(n,lt.create(r,a+1,a+1+s.content.size),"pointer");else{if(!Ie.isSelectable(s))continue;Df(n,Ie.create(r,a),"pointer")}return!0}}(n,t,r)}function cF(n){return xT(n)}qr.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=16==t.keyCode||t.shiftKey,!sZ(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!ta||!xr||13!=t.keyCode))if(229!=t.keyCode&&n.domObserver.forceFlush(),!Cf||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)n.someProp("handleKeyDown",r=>r(n,t))||function YFe(n,e){let t=e.keyCode,r=function QFe(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}(e);if(8==t||no&&72==t&&"c"==r)return QX(n,-1)||Sf(n,-1);if(46==t&&!e.shiftKey||no&&68==t&&"c"==r)return QX(n,1)||Sf(n,1);if(13==t||27==t)return!0;if(37==t||no&&66==t&&"c"==r){let i=37==t?"ltr"==GX(n,n.state.selection.from)?-1:1:-1;return qX(n,i,r)||Sf(n,i)}if(39==t||no&&70==t&&"c"==r){let i=39==t?"ltr"==GX(n,n.state.selection.from)?1:-1:1;return qX(n,i,r)||Sf(n,i)}return 38==t||no&&80==t&&"c"==r?KX(n,-1,r)||Sf(n,-1):40==t||no&&78==t&&"c"==r?function KFe(n){if(!Hr||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&1==e.nodeType&&0==t&&e.firstChild&&"false"==e.firstChild.contentEditable){let r=e.firstChild;YX(n,r,"true"),setTimeout(()=>YX(n,r,"false"),20)}return!1}(n)||KX(n,1,r)||Sf(n,1):r==(no?"m":"c")&&(66==t||73==t||89==t||90==t)}(n,t)?t.preventDefault():Ml(n,"key");else{let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,Iu(13,"Enter"))),n.input.lastIOSEnter=0)},200)}},qr.keyup=(n,e)=>{16==e.keyCode&&(n.input.shiftKey=!1)},qr.keypress=(n,e)=>{let t=e;if(sZ(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||no&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t)))return void t.preventDefault();let r=n.state.selection;if(!(r instanceof lt&&r.$from.sameParent(r.$to))){let i=String.fromCharCode(t.charCode);!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i))&&n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};const oZ=no?"metaKey":"ctrlKey";$r.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=cF(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&function cLe(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}(t,n.input.lastClick)&&!t[oZ]&&("singleClick"==n.input.lastClick.type?o="doubleClick":"doubleClick"==n.input.lastClick.type&&(o="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:o};let s=n.posAtCoords(CT(t));s&&("singleClick"==o?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new gLe(n,s,t,!!r)):("doubleClick"==o?fLe:pLe)(n,s.pos,s.inside,t)?t.preventDefault():Ml(n,"pointer"))};class gLe{constructor(e,t,r,i){let o,s;if(this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[oZ],this.allowDefault=r.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),s=t.inside;else{let u=e.state.doc.resolve(t.pos);o=u.parent,s=u.depth?u.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&1==l.dom.nodeType?l.dom:null;let{selection:c}=e.state;(0==r.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||c instanceof Ie&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Eo||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ml(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>ra(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(CT(e))),this.updateAllowDefault(e),this.allowDefault||!t?Ml(this.view,"pointer"):function hLe(n,e,t,r,i){return lF(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?function dLe(n,e){if(-1==e)return!1;let r,i,t=n.state.selection;t instanceof Ie&&(r=t.node);let o=n.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(Ie.isSelectable(a)){i=r&&t.$from.depth>0&&s>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?o.before(t.$from.depth):o.before(s);break}}return null!=i&&(Df(n,Ie.create(n.state.doc,i),"pointer"),!0)}(n,t):function uLe(n,e){if(-1==e)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return!!(r&&r.isAtom&&Ie.isSelectable(r))&&(Df(n,new Ie(t),"pointer"),!0)}(n,t))}(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Hr&&this.mightDrag&&!this.mightDrag.node.isAtom||xr&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Df(this.view,rt.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Ml(this.view,"pointer")}move(e){this.updateAllowDefault(e),Ml(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function sZ(n,e){return!!n.composing||!!(Hr&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500)&&(n.input.compositionEndedAt=-2e8,!0)}$r.touchstart=n=>{n.input.lastTouch=Date.now(),cF(n),Ml(n,"pointer")},$r.touchmove=n=>{n.input.lastTouch=Date.now(),Ml(n,"pointer")},$r.contextmenu=n=>cF(n);const _Le=ta?5e3:-1;function aZ(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>xT(n),e))}function lZ(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=function vLe(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function xT(n,e=!1){if(!(ta&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),lZ(n),e||n.docView&&n.docView.dirty){let t=ZO(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):!n.markCursor&&!e||n.state.selection.empty?n.updateState(n.state):n.dispatch(n.state.tr.deleteSelection()),!0}return!1}}qr.compositionstart=qr.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof lt&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>!1===r.type.spec.inclusive)))n.markCursor=n.state.storedMarks||t.marks(),xT(n,!0),n.markCursor=null;else if(xT(n,!e.selection.empty),Eo&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&1==i.nodeType&&0!=o;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(3==s.nodeType){let a=n.domSelection();a&&a.collapse(s,s.nodeValue.length);break}i=s,o=-1}}n.input.composing=!0}aZ(n,_Le)},qr.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,aZ(n,20))};const $_=di&&Sl<15||Cf&&gFe<604;function q_(n,e,t,r,i){let o=XX(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",l=>l(n,i,o||ie.empty)))return!0;if(!o)return!1;let s=function wLe(n){return 0==n.openStart&&0==n.openEnd&&1==n.content.childCount?n.content.firstChild:null}(o),a=s?n.state.tr.replaceSelectionWith(s,r):n.state.tr.replaceSelection(o);return n.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function cZ(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}$r.copy=qr.cut=(n,e)=>{let t=e,r=n.state.selection,i="cut"==t.type;if(r.empty)return;let o=$_?null:t.clipboardData,s=r.content(),{dom:a,text:l}=rF(n,s);o?(t.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function bLe(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}(n,a),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},qr.paste=(n,e)=>{let t=e;if(n.composing&&!ta)return;let r=$_?null:t.clipboardData,i=n.input.shiftKey&&45!=n.input.lastKeyCode;r&&q_(n,cZ(r),r.getData("text/html"),i,t)?t.preventDefault():function ELe(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=n.input.shiftKey&&45!=n.input.lastKeyCode;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?q_(n,r.value,null,i,e):q_(n,r.textContent,r.innerHTML,i,e)},50)}(n,t)};class uZ{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const dZ=no?"altKey":"ctrlKey";$r.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let s,i=n.state.selection,o=i.empty?null:n.posAtCoords(CT(t));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof Ie?i.to-1:i.to)))if(r&&r.mightDrag)s=Ie.create(n.state.doc,r.mightDrag.pos);else if(t.target&&1==t.target.nodeType){let d=n.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=n.docView&&(s=Ie.create(n.state.doc,d.posBefore))}let a=(s||n.state.selection).content(),{dom:l,text:c,slice:u}=rF(n,a);(!t.dataTransfer.files.length||!xr||_X>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData($_?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",$_||t.dataTransfer.setData("text/plain",c),n.dragging=new uZ(u,!t[dZ],s)},$r.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},qr.dragover=qr.dragenter=(n,e)=>e.preventDefault(),qr.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(CT(t));if(!i)return;let o=n.state.doc.resolve(i.pos),s=r&&r.slice;s?n.someProp("transformPasted",m=>{s=m(s,n)}):s=XX(n,cZ(t.dataTransfer),$_?null:t.dataTransfer.getData("text/html"),!1,o);let a=!(!r||t[dZ]);if(n.someProp("handleDrop",m=>m(n,t,s||ie.empty,a)))return void t.preventDefault();if(!s)return;t.preventDefault();let l=s?function XOe(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let i=t.content;for(let o=0;o=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),c=r.node(s),u=!1;if(1==o)u=c.canReplace(l,l,i);else{let d=c.contentMatchAt(l).findWrapping(i.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return 0==a?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}(n.state.doc,o.pos,s):o.pos;null==l&&(l=o.pos);let c=n.state.tr;if(a){let{node:m}=r;m?m.replace(c):c.deleteSelection()}let u=c.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&Ie.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Ie(p));else{let m=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((_,v,E,C)=>m=C),c.setSelection(eF(n,p,c.doc.resolve(m)))}n.focus(),n.dispatch(c.setMeta("uiEvent","drop"))},$r.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&ra(n)},20))},$r.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)},$r.beforeinput=(n,e)=>{if(xr&&ta&&"deleteContentBackward"==e.inputType){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",o=>o(n,Iu(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in qr)$r[n]=qr[n];function W_(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class ST{constructor(e,t){this.toDOM=e,this.spec=t||Su,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:s}=e.mapResult(t.from+i,this.side<0?-1:1);return s?null:new io(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof ST&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&W_(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class kl{constructor(e,t){this.attrs=e,this.spec=t||Su}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new io(o,s,this)}valid(e,t){return t.from=e&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;se){let a=this.children[s]+1;this.children[s+2].findInner(e-a,t-a,r,i+a,o)}}map(e,t,r){return this==Sr||0==e.maps.length?this:this.mapInner(e,t,0,0,r||Su)}mapInner(e,t,r,i,o){let s;for(let a=0;a{let v=_-m-(p-f);for(let E=0;EC+u-d)continue;let R=a[E]+u-d;p>=R?a[E+1]=f<=R?-2:-1:f>=u&&v&&(a[E]+=v,a[E+1]+=v)}d+=v}),u=t.maps[c].map(u,-1)}let l=!1;for(let c=0;c=r.content.size){l=!0;continue}let p=t.map(n[c+1]+o,-1)-i,{index:m,offset:_}=r.content.findIndex(d),v=r.maybeChild(m);if(v&&_==d&&_+v.nodeSize==p){let E=a[c+2].mapInner(t,v,u+1,n[c]+o+1,s);E!=Sr?(a[c]=d,a[c+1]=p,a[c+2]=E):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=function TLe(n,e,t,r,i,o,s){function a(l,c){for(let u=0;u{let u,c=l+r;if(u=fZ(t,a,c)){for(i||(i=this.children.slice());oa&&d.to=e){this.children[a]==e&&(r=this.children[a+2]);break}let o=e+1,s=o+t.content.size;for(let a=0;ao&&l.type instanceof kl){let c=Math.max(o,l.from)-o,u=Math.min(s,l.to)-o;ci.map(e,t,Su));return Nl.from(r)}forChild(e,t){if(t.isLeaf)return Rn.empty;let r=[];for(let i=0;it instanceof Rn)?e:e.reduce((t,r)=>t.concat(r instanceof Rn?r:r.members),[]))}}forEachSet(e){for(let t=0;tt&&s.to{let c=fZ(n,a,l+t);if(c){o=!0;let u=DT(c,a,t+l+1,r);u!=Sr&&i.push(l,l+a.nodeSize,u)}});let s=hZ(o?pZ(n):n,-t).sort(Du);for(let a=0;a0;)e++;n.splice(e,0,t)}function hF(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=Sr&&e.push(r)}),n.cursorWrapper&&e.push(Rn.create(n.state.doc,[n.cursorWrapper.deco])),Nl.from(e)}const CLe={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},xLe=di&&Sl<=11;class SLe{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class DLe{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new SLe,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i"childList"==i.type&&i.removedNodes.length||"characterData"==i.type&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),xLe&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,CLe)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;tthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(HX(this.view)){if(this.suppressingSelectionUpdates)return ra(this.view);if(di&&Sl<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Eu(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let r,t=new Set;for(let o=e.focusNode;o;o=L_(o))t.add(o);for(let o=e.anchorNode;o;o=L_(o))if(t.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);return i&&i.ignoreMutation({type:"selection",target:3==r.nodeType?r.parentNode:r})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&HX(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(e.editable)for(let u=0;u"BR"==d.nodeName);if(2==u.length){let[d,f]=u;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of u){let p=f.parentNode;p&&"LI"==p.nodeName&&(!d||MLe(e,d)!=p)&&f.remove()}}}let c=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(o>-1&&(e.docView.markDirty(o,s),function ALe(n){if(!gZ.has(n)&&(gZ.set(n,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace))){if(n.requiresGeckoHackNode=Eo,_Z)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),_Z=!0}}(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||ra(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(r==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if("childList"==e.type){for(let u=0;ue.content.size?null:eF(n,e.resolve(t.anchor),e.resolve(t.head))}function fF(n,e,t){let r=n.depth,i=e?n.end():n.pos;for(;r>0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,i++,e=!1;if(t){let o=n.node(r).maybeChild(n.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function bZ(n){if(2!=n.length)return!1;let e=n.charCodeAt(0),t=n.charCodeAt(1);return e>=56320&&e<=57343&&t>=55296&&t<=56319}class BLe{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new iLe,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(CZ),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=IZ(this),EZ(this),this.nodeViews=TZ(this),this.docView=MX(this.state.doc,wZ(this),hF(this),this.dom,this),this.domObserver=new DLe(this,(r,i,o,s)=>function OLe(n,e,t,r,i){let o=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let x=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,A=ZO(n,x);if(A&&!n.state.selection.eq(A)){if(xr&&ta&&13===n.input.lastKeyCode&&Date.now()-100P(n,Iu(13,"Enter"))))return;let M=n.state.tr.setSelection(A);"pointer"==x?M.setMeta("pointer",!0):"key"==x&&M.scrollIntoView(),o&&M.setMeta("composition",o),n.dispatch(M)}return}let s=n.state.doc.resolve(e),a=s.sharedDepth(t);e=s.before(a+1),t=n.state.doc.resolve(t).after(a+1);let f,p,l=n.state.selection,c=function kLe(n,e,t){let c,{node:r,fromOffset:i,toOffset:o,from:s,to:a}=n.docView.parseRange(e,t),l=n.domSelectionRange(),u=l.anchorNode;if(u&&n.dom.contains(1==u.nodeType?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],wT(l)||c.push({node:l.focusNode,offset:l.focusOffset})),xr&&8===n.input.lastKeyCode)for(let v=o;v>i;v--){let E=r.childNodes[v-1],C=E.pmViewDesc;if("BR"==E.nodeName&&!C){o=v;break}if(!C||C.size)break}let d=n.state.doc,f=n.someProp("domParser")||bu.fromSchema(n.state.schema),p=d.resolve(s),m=null,_=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:"pre"!=p.parent.type.whitespace||"full",findPositions:c,ruleFromNode:NLe,context:p});if(c&&null!=c[0].pos){let v=c[0].pos,E=c[1]&&c[1].pos;null==E&&(E=v),m={anchor:v+s,head:E+s}}return{doc:_,sel:m,from:s,to:a}}(n,e,t),u=n.state.doc,d=u.slice(c.from,c.to);8===n.input.lastKeyCode&&Date.now()-100=s?o-r:0;o-=l,o&&o=a?o-r:0;o-=l,o&&oDate.now()-225||ta)&&i.some(x=>1==x.nodeType&&!PLe.test(x.nodeName))&&(!m||m.endA>=m.endB)&&n.someProp("handleKeyDown",x=>x(n,Iu(13,"Enter"))))return void(n.input.lastIOSEnter=0);if(!m){if(!(r&&l instanceof lt&&!l.empty&&l.$head.sameParent(l.$anchor))||n.composing||c.sel&&c.sel.anchor!=c.sel.head){if(c.sel){let x=vZ(n,n.state.doc,c.sel);if(x&&!x.eq(n.state.selection)){let A=n.state.tr.setSelection(x);o&&A.setMeta("composition",o),n.dispatch(A)}}return}m={start:l.from,endA:l.to,endB:l.to}}n.state.selection.fromn.state.selection.from&&m.start<=n.state.selection.from+2&&n.state.selection.from>=c.from?m.start=n.state.selection.from:m.endA=n.state.selection.to-2&&n.state.selection.to<=c.to&&(m.endB+=n.state.selection.to-m.endA,m.endA=n.state.selection.to)),di&&Sl<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>c.from&&" \xa0"==c.doc.textBetween(m.start-c.from-1,m.start-c.from+1)&&(m.start--,m.endA--,m.endB--);let R,_=c.doc.resolveNoCache(m.start-c.from),v=c.doc.resolveNoCache(m.endB-c.from),E=u.resolve(m.start),C=_.sameParent(v)&&_.parent.inlineContent&&E.end()>=m.endA;if((Cf&&n.input.lastIOSEnter>Date.now()-225&&(!C||i.some(x=>"DIV"==x.nodeName||"P"==x.nodeName))||!C&&_.posx(n,Iu(13,"Enter"))))return void(n.input.lastIOSEnter=0);if(n.state.selection.anchor>m.start&&function LLe(n,e,t,r,i){if(t-e<=i.pos-r.pos||fF(r,!0,!1)t||fF(s,!0,!1)x(n,Iu(8,"Backspace"))))return void(ta&&xr&&n.domObserver.suppressSelectionUpdates());xr&&m.endB==m.start&&(n.input.lastChromeDelete=Date.now()),ta&&!C&&_.start()!=v.start()&&0==v.parentOffset&&_.depth==v.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==m.endA&&(m.endB-=2,v=c.doc.resolveNoCache(m.endB-c.from),setTimeout(()=>{n.someProp("handleKeyDown",function(x){return x(n,Iu(13,"Enter"))})},20));let Q,S,I,V=m.start,H=m.endA;if(C)if(_.pos==v.pos)di&&Sl<=11&&0==_.parentOffset&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>ra(n),20)),Q=n.state.tr.delete(V,H),S=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(I=function FLe(n,e){let s,a,l,t=n.firstChild.marks,r=e.firstChild.marks,i=t,o=r;for(let u=0;uu.mark(a.addToSet(u.marks));else{if(0!=i.length||1!=o.length)return null;a=o[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks))}let c=[];for(let u=0;uA(n,V,H,x)))return;Q=n.state.tr.insertText(x,V,H)}if(Q||(Q=n.state.tr.replace(V,H,c.doc.slice(m.start-c.from,m.endB-c.from))),c.sel){let x=vZ(n,Q.doc,c.sel);x&&!(xr&&n.composing&&x.empty&&(m.start!=m.endB||n.input.lastChromeDelete{aLe(n,r)&&!aF(n,r)&&(n.editable||!(r.type in qr))&&t(n,r)},rLe[e]?{passive:!0}:void 0)}Hr&&n.dom.addEventListener("input",()=>null),sF(n)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&sF(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(CZ),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(lZ(this),s=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let p=TZ(this);(function zLe(n,e){let t=0,r=0;for(let i in n){if(n[i]!=e[i])return!0;t++}for(let i in e)r++;return t!=r})(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&sF(this),this.editable=IZ(this),EZ(this);let l=hF(this),c=wZ(this),u=i.plugins==e.plugins||i.doc.eq(e.doc)?e.scrollToSelection>i.scrollToSelection?"to selection":"preserve":"reset",d=o||!this.docView.matchesNode(e.doc,c,l);(d||!e.selection.eq(i.selection))&&(s=!0);let f="preserve"==u&&s&&null==this.dom.style.overflowAnchor&&function vFe(n){let r,i,e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top);for(let o=(e.left+e.right)/2,s=t+1;s=t-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:vX(n.dom)}}(this);if(s){this.domObserver.stop();let p=d&&(di||xr)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&function ULe(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}(i.selection,e.selection);if(d){let m=xr?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function yLe(n){let e=n.domSelectionRange();if(!e.focusNode)return null;let t=function uFe(n,e){for(;;){if(3==n.nodeType&&e)return n;if(1==n.nodeType&&e>0){if("false"==n.contentEditable)return null;e=to(n=n.childNodes[e-1])}else{if(!n.parentNode||V_(n))return null;e=ur(n),n=n.parentNode}}}(e.focusNode,e.focusOffset),r=function dFe(n,e){for(;;){if(3==n.nodeType&&et(this)))if(this.state.selection instanceof Ie){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&yX(this,t.getBoundingClientRect(),e)}else yX(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new uZ(e.slice,e.move,i<0?void 0:Ie.create(this.state.doc,i))}someProp(e,t){let i,r=this._props&&this._props[e];if(null!=r&&(i=t?t(r):r))return i;for(let s=0;st.ownerDocument.getSelection()),this._root=t;return e||document}updateRoot(){this._root=null}posAtCoords(e){return xFe(this,e)}coordsAtPos(e,t=1){return TX(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let i=this.docView.posFromDOM(e,t,r);if(null==i)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return function MFe(n,e,t){return xX==e&&SX==t?DX:(xX=e,SX=t,DX="up"==t||"down"==t?function DFe(n,e,t){let r=e.selection,i="up"==t?r.$from:r.$to;return CX(n,e,()=>{let{node:o}=n.docView.domFromPos(i.pos,"up"==t?-1:1);for(;;){let a=n.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=TX(n,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(1==a.nodeType)l=a.getClientRects();else{if(3!=a.nodeType)continue;l=ea(a,0,a.nodeValue.length).getClientRects()}for(let c=0;cu.top+1&&("up"==t?s.top-u.top>2*(u.bottom-s.top):u.bottom-s.bottom>2*(s.bottom-u.top)))return!1}}return!0})}(n,e,t):function RFe(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=n.domSelection();return a?AFe.test(r.parent.textContent)&&a.modify?CX(n,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=n.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",t,"character");let p=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:m,focusOffset:_}=n.domSelectionRange(),v=m&&!p.contains(1==m.nodeType?m:m.parentNode)||l==m&&c==_;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return null!=f&&(a.caretBidiLevel=f),v}):"left"==t||"backward"==t?o:s:r.pos==r.start()||r.pos==r.end()}(n,e,t))}(this,t||this.state,e)}pasteHTML(e,t){return q_(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return q_(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return rF(this,e)}destroy(){this.docView&&(function sLe(n){n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],hF(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,$O=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function lLe(n,e){!aF(n,e)&&$r[e.type]&&(n.editable||!(e.type in qr))&&$r[e.type](n,e)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?Hr&&11===this.root.nodeType&&function fFe(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}(this.dom.ownerDocument)==this.dom&&function RLe(n,e){if(e.getComposedRanges){let i=e.getComposedRanges(n.root)[0];if(i)return yZ(n,i)}let t;function r(i){i.preventDefault(),i.stopImmediatePropagation(),t=i.getTargetRanges()[0]}return n.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),n.dom.removeEventListener("beforeinput",r,!0),t?yZ(n,t):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function wZ(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if("function"==typeof t&&(t=t(n.state)),t)for(let r in t)"class"==r?e.class+=" "+t[r]:"style"==r?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&"contenteditable"!=r&&"nodeName"!=r&&(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[io.node(0,n.state.doc.content.size,e)]}function EZ(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:io.widget(n.state.selection.from,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function IZ(n){return!n.someProp("editable",e=>!1===e(n.state))}function TZ(n){let e=Object.create(null);function t(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function CZ(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}const jLe=["ol",0],HLe=["ul",0],$Le=["li",0],xZ={attrs:{order:{default:1,validate:"number"}},parseDOM:[{tag:"ol",getAttrs:n=>({order:n.hasAttribute("start")?+n.getAttribute("start"):1})}],toDOM:n=>1==n.attrs.order?jLe:["ol",{start:n.attrs.order},0]},SZ={parseDOM:[{tag:"ul"}],toDOM:()=>HLe},DZ={parseDOM:[{tag:"li"}],toDOM:()=>$Le,defining:!0};function AZ(n,e){return function(t,r){let{$from:i,$to:o,node:s}=t.selection;if(s&&s.isBlock||i.depth<2||!i.sameParent(o))return!1;let a=i.node(-1);if(a.type!=n)return!1;if(0==i.parent.content.size&&i.node(-1).childCount==i.indexAfter(-1)){if(3==i.depth||i.node(-3).type!=n||i.index(-2)!=i.node(-2).childCount-1)return!1;if(r){let d=Y.empty,f=i.index(-1)?1:i.index(-2)?2:3;for(let E=i.depth-f;E>=i.depth-3;E--)d=Y.from(i.node(E).copy(d));let p=i.indexAfter(-1){if(v>-1)return!1;E.isTextblock&&0==E.content.size&&(v=C+1)}),v>-1&&_.setSelection(rt.near(_.doc.resolve(v))),r(_.scrollIntoView())}return!0}let l=o.pos==i.end()?a.contentMatchAt(0).defaultType:null,c=t.tr.delete(i.pos,o.pos),u=l?[e?{type:n,attrs:e}:null,{type:l}]:void 0;return!!bf(c.doc,i.pos,2,u)&&(r&&r(c.split(i.pos,2,u).scrollIntoView()),!0)}}function RZ(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type==n);return!!o&&(!t||(r.node(o.depth-1).type==n?function KLe(n,e,t,r){let i=n.tr,o=r.end,s=r.$to.end(r.depth);o_;m--)p-=i.child(m).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(t.start),s=o.nodeAfter;if(r.mapping.map(t.end)!=t.start+o.nodeAfter.nodeSize)return!1;let a=0==t.startIndex,l=t.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?Y.empty:Y.from(i))))return!1;let d=o.pos,f=d+s.nodeSize;return r.step(new cr(d-(a?1:0),f+(l?1:0),d+1,f-1,new ie((a?Y.empty:Y.from(i.copy(Y.empty))).append(l?Y.empty:Y.from(i.copy(Y.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}(e,t,o)))}}function MZ(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==n);if(!o)return!1;let s=o.startIndex;if(0==s)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=n)return!1;if(t){let c=l.lastChild&&l.lastChild.type==a.type,u=Y.from(c?n.create():null),d=new ie(Y.from(n.create(null,Y.from(a.type.create(null,u)))),c?3:1,0),f=o.start,p=o.end;t(e.tr.step(new cr(f-(c?3:1),p,f,p,d,1,!0)).scrollIntoView())}return!0}}const YLe={link:{attrs:{href:{},title:{default:null},target:{default:"_blank"}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:n=>({href:n.getAttribute("href"),title:n.getAttribute("title"),target:n.getAttribute("target")})}],toDOM(n){const{href:e,title:t,target:r}=n.attrs;return["a",{href:e,title:t,target:r},0]}},em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:n=>"normal"!==n.style.fontWeight&&null},{style:"font-weight",getAttrs:n=>/^(?:bold(?:er)?|[5-9]\d{2,})$/.test(n)&&null}],toDOM:()=>["strong",0]},code:{parseDOM:[{tag:"code"}],toDOM:()=>["code",0]},u:{parseDOM:[{tag:"u"},{style:"text-decoration=underline",consuming:!1}],toDOM:()=>["u",0]},s:{parseDOM:[{tag:"s"},{tag:"strike"},{style:"text-decoration=line-through"}],toDOM:()=>["s",0]},text_color:{attrs:{color:{default:null}},parseDOM:[{style:"color",getAttrs:n=>({color:n})}],toDOM(n){const{color:e}=n.attrs;return["span",{style:`color:${e};`},0]}},text_background_color:{attrs:{backgroundColor:{default:null}},parseDOM:[{style:"background-color",getAttrs:n=>({backgroundColor:n})}],toDOM(n){const{backgroundColor:e}=n.attrs;return["span",{style:`background-color:${e};`},0]}},sup:{attrs:{},parseDOM:[{tag:"sup"},{style:"vertical-align=super"}],toDOM:()=>["sup",0]},sub:{attrs:{},parseDOM:[{tag:"sub"},{style:"vertical-align=sub"}],toDOM:()=>["sub",0]}},cVe={doc:{content:"block+"},text:{group:"inline"},paragraph:{content:"inline*",group:"block",attrs:{align:{default:null},indent:{default:null}},parseDOM:[{tag:"p",getAttrs(n){const{textAlign:e}=n.style,t=n.getAttribute("align")||e||null,r=n.getAttribute("data-indent")||null;return{align:t,indent:parseInt(r,10)||null}}}],toDOM(n){const{align:e,indent:t}=n.attrs;return["p",{style:CO({textAlign:"left"!==e?e:null,marginLeft:null!==t?40*t+"px":null})||null,"data-indent":t??null},0]}},blockquote:{content:"block+",group:"block",defining:!0,attrs:{indent:{default:null}},parseDOM:[{tag:"blockquote",getAttrs(n){const e=n.getAttribute("data-indent")||null;return{indent:parseInt(e,10)||null}}}],toDOM(n){const{indent:e}=n.attrs;return["blockquote",{style:CO({marginLeft:null!==e?40*e+"px":null})||null,"data-indent":e??null},0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]},heading:{attrs:{level:{default:1},align:{default:null},indent:{default:null}},content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"h1",getAttrs(n){const{textAlign:e}=n.style,t=n.getAttribute("align")||e||null,r=n.getAttribute("data-indent")||null;return{level:1,align:t,indent:parseInt(r,10)||null}}},{tag:"h2",getAttrs(n){const{textAlign:e}=n.style,t=n.getAttribute("align")||e||null,r=n.getAttribute("data-indent")||null;return{level:2,align:t,indent:parseInt(r,10)||null}}},{tag:"h3",getAttrs(n){const{textAlign:e}=n.style,t=n.getAttribute("align")||e||null,r=n.getAttribute("data-indent")||null;return{level:3,align:t,indent:parseInt(r,10)||null}}},{tag:"h4",getAttrs(n){const{textAlign:e}=n.style,t=n.getAttribute("align")||e||null,r=n.getAttribute("data-indent")||null;return{level:4,align:t,indent:parseInt(r,10)||null}}},{tag:"h5",getAttrs(n){const{textAlign:e}=n.style,t=n.getAttribute("align")||e||null,r=n.getAttribute("data-indent")||null;return{level:5,align:t,indent:parseInt(r,10)||null}}},{tag:"h6",getAttrs(n){const{textAlign:e}=n.style,t=n.getAttribute("align")||e||null,r=n.getAttribute("data-indent")||null;return{level:6,align:t,indent:parseInt(r,10)||null}}}],toDOM(n){const{level:e,align:t,indent:r}=n.attrs;return[`h${e}`,{style:CO({textAlign:"left"!==t?t:null,marginLeft:null!==r?40*r+"px":null})||null,"data-indent":r??null},0]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:()=>["br"]},code_block:{content:"text*",marks:"",group:"block",code:!0,defining:!0,parseDOM:[{tag:"pre",preserveWhitespace:"full"}],toDOM:()=>["pre",["code",0]]},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null},width:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs:n=>({src:n.getAttribute("src"),title:n.getAttribute("title"),alt:n.getAttribute("alt"),width:n.getAttribute("width")})}],toDOM(n){const{src:e,alt:t,title:r,width:i}=n.attrs;return["img",{src:e,alt:t,title:r,width:i}]}},list_item:{...DZ,content:"paragraph block*"},ordered_list:{...xZ,content:"list_item+",group:"block"},bullet_list:{...SZ,content:"list_item+",group:"block"}},AT=new class SOe{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=vY.from(e.nodes),t.marks=vY.from(e.marks||{}),this.nodes=fT.compile(this.spec.nodes,this),this.marks=pT.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=vu.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet="_"==a?null:a?LY(this,a.split(" ")):""!=a&&o.inlineContent?null:[]}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=null==s?[o]:""==s?[]:LY(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof fT))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new hT(r,r.defaultAttrs,e,Mt.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return rs.fromJSON(this,e)}markFromJSON(e){return Mt.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}({marks:YLe,nodes:cVe}),kZ=(n,e)=>!n.selection.empty&&(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function Rf(n,e,t=!1){for(let r=n;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&1!=r.childCount)return!1}return!1}function mF(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function gF(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1{let{$head:t,$anchor:r}=n.selection;return!(!t.parent.type.spec.code||!t.sameParent(r)||(e&&e(n.tr.insertText("\n").scrollIntoView()),0))};function _F(n){for(let e=0;e{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),o=t.indexAfter(-1),s=_F(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=t.after(),l=n.tr.replaceWith(a,a,s.createAndFill());l.setSelection(rt.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},VZ=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof Oi||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=_F(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let o=t.before();if(bf(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&k_(r);return null!=i&&(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},yF=function mVe(n){return(e,t)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof Ie&&e.selection.node.isBlock)return!(!r.parentOffset||!bf(e.doc,r.pos)||(t&&t(e.tr.split(r.pos).scrollIntoView()),0));if(!r.depth)return!1;let s,a,o=[],l=!1,c=!1;for(let p=r.depth;;p--){if(r.node(p).isBlock){l=r.end(p)==r.pos+(r.depth-p),c=r.start(p)==r.pos-(r.depth-p),a=_F(r.node(p-1).contentMatchAt(r.indexAfter(p-1)));let _=n&&n(i.parent,l,r);o.unshift(_||(l&&a?{type:a}:null)),s=p;break}if(1==p)return!1;o.unshift(null)}let u=e.tr;(e.selection instanceof lt||e.selection instanceof Oi)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=bf(u.doc,d,o.length,o);if(f||(o[0]=a?{type:a}:null,f=bf(u.doc,d,o.length,o)),u.split(d,o.length,o),!l&&c&&r.node(s).type!=a){let p=u.mapping.map(r.before(s)),m=u.doc.resolve(p);a&&r.node(s-1).canReplaceWith(m.index(),m.index()+1,a)&&u.setNodeMarkup(u.mapping.map(r.before(s)),a)}return t&&t(u.scrollIntoView()),!0}}();function UZ(n,e,t,r){let s,a,i=e.nodeBefore,o=e.nodeAfter,l=i.type.spec.isolating||o.type.spec.isolating;if(!l&&function _Ve(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!(!(r&&i&&r.type.compatibleContent(i.type))||(!r.content.size&&e.parent.canReplace(o-1,o)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),0):!e.parent.canReplace(o,o+1)||!i.isTextblock&&!yT(n.doc,e.pos)||(t&&t(n.tr.join(e.pos).scrollIntoView()),0)))}(n,e,t))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(a=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(t){let p=e.pos+o.nodeSize,m=Y.empty;for(let E=s.length-1;E>=0;E--)m=Y.from(s[E].create(null,m));m=Y.from(i.copy(m));let _=n.tr.step(new cr(e.pos-1,p,e.pos,p,new ie(m,1,0),s.length,!0)),v=_.doc.resolve(p+2*s.length);v.nodeAfter&&v.nodeAfter.type==i.type&&yT(_.doc,v.pos)&&_.join(v.pos),t(_.scrollIntoView())}return!0}let u=o.type.spec.isolating||r>0&&l?null:rt.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),f=d&&k_(d);if(null!=f&&f>=e.depth)return t&&t(n.tr.lift(d,f).scrollIntoView()),!0;if(c&&Rf(o,"start",!0)&&Rf(i,"end")){let p=i,m=[];for(;m.push(p),!p.isTextblock;)p=p.lastChild;let _=o,v=1;for(;!_.isTextblock;_=_.firstChild)v++;if(p.canReplace(p.childCount,p.childCount,_.content)){if(t){let E=Y.empty;for(let R=m.length-1;R>=0;R--)E=Y.from(m[R].copy(E));t(n.tr.step(new cr(e.pos-m.length,e.pos+o.nodeSize,e.pos+v,e.pos+o.nodeSize-v,new ie(E,m.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function zZ(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(t&&t(e.tr.setSelection(lt.create(e.doc,n<0?i.start(o):i.end(o)))),!0)}}const yVe=zZ(-1),vVe=zZ(1);function vF(n,e=null){return function(t,r){let i=!1;for(let o=0;o{if(i)return!1;if(l.isTextblock&&!l.hasMarkup(n,e))if(l.type==n)i=!0;else{let u=t.doc.resolve(c),d=u.index();i=u.parent.canReplaceWith(d,d+1,n)}})}if(!i)return!1;if(r){let o=t.tr;for(let s=0;s{if(a||!r&&l.isAtom&&l.isInline&&c>=o.pos&&c+l.nodeSize<=s.pos)return!1;a=l.inlineContent&&l.type.allowsMarkType(t)}),a)return!0}return!1}(s.doc,u,n,i))return!1;if(a)if(c)n.isInSet(s.storedMarks||c.marks())?a(s.tr.removeStoredMark(n)):a(s.tr.addStoredMark(n.create(e)));else{let d,f=s.tr;i||(u=function EVe(n){let e=[];for(let t=0;t{if(o.isAtom&&o.content.size&&o.isInline&&s>=r.pos&&s+o.nodeSize<=i.pos)return s+1>r.pos&&e.push(new UO(r,r.doc.resolve(s+1))),r=r.doc.resolve(s+1+o.content.size),!1}),r.poss.doc.rangeHasMark(p.$from.pos,p.$to.pos,n)):!u.every(p=>{let m=!1;return f.doc.nodesBetween(p.$from.pos,p.$to.pos,(_,v,E)=>{if(m)return!1;m=!n.isInSet(_.marks)&&!!E&&E.type.allowsMarkType(n)&&!(_.isText&&/^\s*$/.test(_.textBetween(Math.max(0,p.$from.pos-v),Math.min(_.nodeSize,p.$to.pos-v))))}),!m});for(let p=0;p{let r=function NZ(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}(n,t);if(!r)return!1;let i=mF(r);if(!i){let s=r.blockRange(),a=s&&k_(s);return null!=a&&(e&&e(n.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(UZ(n,i,e,-1))return!0;if(0==r.parent.content.size&&(Rf(o,"end")||Ie.isSelectable(o)))for(let s=r.depth;;s--){let a=FO(n.doc,r.before(s),r.after(s),ie.empty);if(a&&a.slice.size1)break}return!(!o.isAtom||i.depth!=r.depth-1||(e&&e(n.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),0))},(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;o=mF(r)}let s=o&&o.nodeBefore;return!(!s||!Ie.isSelectable(s)||(e&&e(n.tr.setSelection(Ie.create(n.doc,o.pos-s.nodeSize)).scrollIntoView()),0))}),jZ=G_(kZ,(n,e,t)=>{let r=function OZ(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset(e&&e(n.tr.setSelection(new Oi(n.doc))),!0)},HZ={"Ctrl-h":ia.Backspace,"Alt-Backspace":ia["Mod-Backspace"],"Ctrl-d":ia.Delete,"Ctrl-Alt-Backspace":ia["Mod-Delete"],"Alt-Delete":ia["Mod-Delete"],"Alt-d":ia["Mod-Delete"],"Ctrl-a":yVe,"Ctrl-e":vVe};for(let n in ia)HZ[n]=ia[n];const TVe=(typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&"darwin"==os.platform())?HZ:ia;class oa{constructor(e,t,r={}){this.match=e,this.match=e,this.handler="string"==typeof t?function CVe(n){return function(e,t,r,i){let o=n;if(t[1]){let s=t[0].lastIndexOf(t[1]);o+=t[0].slice(s+t[1].length);let a=(r+=s)-i;a>0&&(o=t[0].slice(s-a,s)+o,r=i)}return e.tr.insertText(o,r,i)}}(t):t,this.undoable=!1!==r.undoable,this.inCode=r.inCode||!1}}function $Z(n,e,t,r,i,o){if(n.composing)return!1;let s=n.state,a=s.doc.resolve(e),l=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"\ufffc")+r;for(let c=0;c{let l=t instanceof Function?t(o):t,c=i.tr.delete(s,a),d=c.doc.resolve(s).blockRange(),f=d&&OO(d,e,l);if(!f)return null;c.wrap(d,f);let p=c.doc.resolve(s-1).nodeBefore;return p&&p.type==e&&yT(c.doc,s-1)&&(!r||r(o,p))&&c.join(s-1),c})}function qZ(n,e,t=null){return new oa(n,(r,i,o,s)=>{let a=r.doc.resolve(o),l=t instanceof Function?t(i):t;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),e)?r.tr.delete(o,s).setBlockType(o,o,e,l):null})}const EF=(n,e)=>{const{from:t,$from:r,to:i,empty:o}=n.selection;return o?!!e.isInSet(n.storedMarks||r.marks()):n.doc.rangeHasMark(t,i,e)},WZ=(n,e,t={})=>{const{selection:r}=n,{$from:i,to:o}=r,s=((n,e)=>{for(let t=e.depth;t>0;t-=1)if(e.node(t).type===n)return e.node(t).type;return null})(e,i);return Object.entries(t).length&&s?o<=i.end()&&i.parent.hasMarkup(e,t):!!s},GZ=n=>{const e=[],{selection:{from:t,to:r}}=n;return n.doc.nodesBetween(t,r,i=>{e.push(i)}),e},KZ=(n,e,t)=>{for(const r of e){const{$from:i,$to:o}=r;let s=0===i.depth&&n.type.allowsMarkType(t);if(n.nodesBetween(i.pos,o.pos,a=>!s&&(s=a.inlineContent&&a.type.allowsMarkType(t),!0)),s)return!0}return!1},QZ=(n,e,t)=>new oa(n,(r,i,o,s)=>{const{tr:a}=r,l=o;let c=s;const[u,,d]=i,f=u.search(/\S/);if(d){const p=o+u.indexOf(d),m=p+d.length;mo&&a.delete(o+f,p),c=o+d.length+f}return a.addMark(l,c,e.create(t)),a.removeStoredMark(e),a}),YZ=(n,e={})=>(t,r)=>{const{tr:i,selection:o}=t,{empty:s,ranges:a,$from:l,$to:c}=o;if(s&&o instanceof lt){const{$cursor:u}=o;if(!u||!KZ(t.doc,a,n)||(i.addStoredMark(n.create(e)),!i.storedMarksSet))return!1;r?.(i)}else{if(i.addMark(l.pos,c.pos,n.create(e)),!i.docChanged)return!1;r?.(i.scrollIntoView())}return!0};var dr=function(){};dr.prototype.append=function(e){return e.length?(e=dr.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},dr.prototype.prepend=function(e){return e.length?dr.from(e).append(this):this},dr.prototype.appendInner=function(e){return new UVe(this,e)},dr.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?dr.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},dr.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},dr.prototype.forEach=function(e,t,r){void 0===t&&(t=0),void 0===r&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)},dr.prototype.map=function(e,t,r){void 0===t&&(t=0),void 0===r&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},t,r),i},dr.from=function(e){return e instanceof dr?e:e&&e.length?new XZ(e):dr.empty};var XZ=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),(e.prototype=Object.create(n&&n.prototype)).constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return 0==i&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,a){for(var l=o;l=s;l--)if(!1===i(this.values[l],a+l))return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=200)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=200)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(dr);dr.empty=new XZ([]);var UVe=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),(e.prototype=Object.create(n&&n.prototype)).constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return ra&&!1===this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a))return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var a=this.left.length;if(i>a&&!1===this.right.forEachInvertedInner(r,i-a,Math.max(o,a)-a,s+a)||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(dr);const ZZ=dr;class Io{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let i,o,r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a,l,s=e.tr,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step)return i||(i=this.remapping(r,f+1),o=i.maps.length),o--,void u.push(d);if(i){u.push(new cs(d.map));let m,p=d.step.map(i.slice(o));p&&s.maybeStep(p).doc&&(m=s.mapping.maps[s.mapping.maps.length-1],c.push(new cs(m,void 0,void 0,c.length+u.length))),o--,m&&i.appendMap(m,o)}else s.maybeStep(d.step);return d.selection?(a=i?d.selection.map(i.slice(o)):d.selection,l=new Io(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1):void 0},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,t,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let u=0;uHVe&&(a=function jVe(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&0==e--)return t=i,!1}),n.slice(t)}(a,c),s-=c),new Io(a.append(o),s)}remapping(e,t){let r=new yf;return this.items.forEach((i,o)=>{r.appendMap(i.map,null!=i.mirrorOffset&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0)},e,t),r}addMaps(e){return 0==this.eventCount?this:new Io(this.items.append(e.map(t=>new cs(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},i);let l=t;this.items.forEach(f=>{let p=o.getMirror(--l);if(null==p)return;s=Math.min(s,p);let m=o.maps[p];if(f.step){let _=e.steps[p].invert(e.docs[p]),v=f.selection&&f.selection.map(o.slice(l+1,p));v&&a++,r.push(new cs(m,_,v))}else r.push(new cs(m))},i);let c=[];for(let f=t;f500&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(t.slice(r)),c=l&&l.getMap();if(r--,c&&t.appendMap(c,r),l){let u=s.selection&&s.selection.map(t.slice(r));u&&o++;let f,d=new cs(c.invert(),l,u),p=i.length-1;(f=i.length&&i[p].merge(d))?i[p]=f:i.push(d)}}else s.map&&r--},this.items.length,0),new Io(ZZ.from(i.reverse()),o)}}Io.empty=new Io(ZZ.empty,0);class cs{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new cs(t.getMap().invert(),t,this.selection)}}}class Pl{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const HVe=20;function JZ(n){let e=[];for(let t=n.length-1;t>=0&&0==e.length;t--)n[t].forEach((r,i,o,s)=>e.push(o,s));return e}function IF(n,e){if(!n)return null;let t=[];for(let r=0;r{let i=sa.getState(t);if(!i||0==(n?i.undone:i.done).eventCount)return!1;if(r){let o=function WVe(n,e,t){let r=MT(e),i=sa.get(e).spec.config,o=(t?n.undone:n.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(t?n.done:n.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),l=new Pl(t?a:o.remaining,t?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(sa,{redo:t,historyState:l})}(i,t,n);o&&r(e?o.scrollIntoView():o)}return!0}}const CF=kT(!1,!0),NT=kT(!0,!0);kT(!1,!1),kT(!0,!1);for(var Ol={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},PT={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},KVe=typeof navigator<"u"&&/Mac/.test(navigator.platform),QVe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),hr=0;hr<10;hr++)Ol[48+hr]=Ol[96+hr]=String(hr);for(hr=1;hr<=24;hr++)Ol[hr+111]="F"+hr;for(hr=65;hr<=90;hr++)Ol[hr]=String.fromCharCode(hr+32),PT[hr]=String.fromCharCode(hr);for(var xF in Ol)PT.hasOwnProperty(xF)||(PT[xF]=Ol[xF]);const XVe=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function ZVe(n){let r,i,o,s,e=n.split(/-(?!$)/),t=e[e.length-1];"Space"==t&&(t=" ");for(let a=0;a127)&&(o=Ol[r.keyCode])&&o!=i){let a=e[SF(o,r)];if(a&&a(t.state,t.dispatch,t))return!0}}return!1}}const t2e=["imgEl"],n2e=n=>({"NgxEditor__Resizer--Active":n});function r2e(n,e){if(1&n){const t=La();W(0,"span",4)(1,"span",5),Ve("mousedown",function(i){return vi(t),bi(Ln().startResizing(i,"left"))}),K(),W(2,"span",6),Ve("mousedown",function(i){return vi(t),bi(Ln().startResizing(i,"right"))}),K(),W(3,"span",7),Ve("mousedown",function(i){return vi(t),bi(Ln().startResizing(i,"left"))}),K(),W(4,"span",8),Ve("mousedown",function(i){return vi(t),bi(Ln().startResizing(i,"right"))}),K()()}}const i2e=["ngxEditor"],o2e=["*"],R2e=(n=!0)=>new ss({key:new Js("editable"),state:{init:()=>n,apply:(e,t)=>e.getMeta("UPDATE_EDITABLE")??t},props:{editable(e){return this.getState(e)},attributes(e){return this.getState(e)?null:{class:"NgxEditor__Content--Disabled"}}}}),k2e=n=>new ss({key:new Js("placeholder"),state:{init:()=>n??"",apply:(e,t)=>e.getMeta("UPDATE_PLACEHOLDER")??t},props:{decorations(e){const{doc:t}=e,{textContent:r,childCount:i}=t,o=this.getState(e);if(!o||i>1)return Rn.empty;const s=[];return t.descendants((l,c)=>{if(l.type.isBlock&&0===l.childCount&&0===r.length){const f=io.node(c,c+l.nodeSize,{class:"NgxEditor__Placeholder","data-placeholder":o,"data-align":l.attrs.align??null});s.push(f)}return!1}),Rn.create(t,s)}}});let F2e=(()=>{class n{src;alt="";title="";outerWidth="";selected=!1;view;imageResize=new nt;imgEl;startResizing(t,r){t.preventDefault(),this.resizeImage(t,r)}resizeImage(t,r){const i=t.pageX,o=this.imgEl.nativeElement.clientWidth,s="left"===r,{width:a}=window.getComputedStyle(this.view.dom),l=parseInt(a,10),c=d=>{const p=d.pageX-i,m=s?o-p:o+p;m>l||m<20||(this.outerWidth=`${m}px`)},u=d=>{d.preventDefault(),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u),this.imageResize.emit()};document.addEventListener("mousemove",c),document.addEventListener("mouseup",u)}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["ngx-image-view"]],viewQuery:function(r,i){if(1&r&&qn(t2e,7),2&r){let o;Qe(o=Ye())&&(i.imgEl=o.first)}},inputs:{src:"src",alt:"alt",title:"title",outerWidth:"outerWidth",selected:"selected",view:"view"},outputs:{imageResize:"imageResize"},standalone:!1,decls:4,vars:9,consts:[["imgEl",""],[1,"NgxEditor__ImageWrapper",3,"ngClass"],["class","NgxEditor__ResizeHandle",4,"ngIf"],[3,"src","alt","title"],[1,"NgxEditor__ResizeHandle"],[1,"NgxEditor__ResizeHandle--TL",3,"mousedown"],[1,"NgxEditor__ResizeHandle--TR",3,"mousedown"],[1,"NgxEditor__ResizeHandle--BL",3,"mousedown"],[1,"NgxEditor__ResizeHandle--BR",3,"mousedown"]],template:function(r,i){1&r&&(W(0,"span",1),et(1,r2e,5,0,"span",2),Pe(2,"img",3,0),K()),2&r&&(Bd("width",i.outerWidth),De("ngClass",t$(7,n2e,i.selected)),re(),De("ngIf",i.selected),re(),De("src",i.src,vx)("alt",i.alt)("title",i.title))},dependencies:[RD,Bb],styles:["*[_ngcontent-%COMP%], *[_ngcontent-%COMP%]:before, *[_ngcontent-%COMP%]:after{box-sizing:border-box}img[_ngcontent-%COMP%]{width:100%;height:100%}.NgxEditor__ImageWrapper[_ngcontent-%COMP%]{position:relative;display:inline-block;line-height:0;padding:2px}.NgxEditor__ImageWrapper.NgxEditor__Resizer--Active[_ngcontent-%COMP%]{padding:1px;border:1px solid #1a73e8}.NgxEditor__ImageWrapper[_ngcontent-%COMP%] .NgxEditor__ResizeHandle[_ngcontent-%COMP%]{position:absolute;height:100%;width:100%}.NgxEditor__ImageWrapper[_ngcontent-%COMP%] .NgxEditor__ResizeHandle[_ngcontent-%COMP%] .NgxEditor__ResizeHandle--TL[_ngcontent-%COMP%], .NgxEditor__ImageWrapper[_ngcontent-%COMP%] .NgxEditor__ResizeHandle[_ngcontent-%COMP%] .NgxEditor__ResizeHandle--BL[_ngcontent-%COMP%], .NgxEditor__ImageWrapper[_ngcontent-%COMP%] .NgxEditor__ResizeHandle[_ngcontent-%COMP%] .NgxEditor__ResizeHandle--TR[_ngcontent-%COMP%], .NgxEditor__ImageWrapper[_ngcontent-%COMP%] .NgxEditor__ResizeHandle[_ngcontent-%COMP%] .NgxEditor__ResizeHandle--BR[_ngcontent-%COMP%]{position:absolute;width:7px;height:7px;background-color:#1a73e8;border:1px solid white}.NgxEditor__ImageWrapper[_ngcontent-%COMP%] .NgxEditor__ResizeHandle[_ngcontent-%COMP%] .NgxEditor__ResizeHandle--BR[_ngcontent-%COMP%]{bottom:-5px;right:-5px;cursor:se-resize}.NgxEditor__ImageWrapper[_ngcontent-%COMP%] .NgxEditor__ResizeHandle[_ngcontent-%COMP%] .NgxEditor__ResizeHandle--TR[_ngcontent-%COMP%]{top:-5px;right:-5px;cursor:ne-resize}.NgxEditor__ImageWrapper[_ngcontent-%COMP%] .NgxEditor__ResizeHandle[_ngcontent-%COMP%] .NgxEditor__ResizeHandle--TL[_ngcontent-%COMP%]{top:-5px;left:-5px;cursor:nw-resize}.NgxEditor__ImageWrapper[_ngcontent-%COMP%] .NgxEditor__ResizeHandle[_ngcontent-%COMP%] .NgxEditor__ResizeHandle--BL[_ngcontent-%COMP%]{bottom:-5px;left:-5px;cursor:sw-resize}"]})}return n})();class L2e{dom;view;getPos;applicationRef;imageComponentRef;resizeSubscription;node;updating=!1;constructor(e,t,r,i){this.applicationRef=i.get(tr),this.imageComponentRef=vD(F2e,{environmentInjector:this.applicationRef.injector}),this.applicationRef.attachView(this.imageComponentRef.hostView),this.setNodeAttributes(e.attrs),this.imageComponentRef.instance.view=t,this.dom=this.imageComponentRef.location.nativeElement,this.view=t,this.node=e,this.getPos=r,this.resizeSubscription=this.imageComponentRef.instance.imageResize.subscribe(()=>{this.handleResize()})}computeChanges(e,t){return JSON.stringify(e)===JSON.stringify(t)}setNodeAttributes(e){this.imageComponentRef.instance.src=e.src,this.imageComponentRef.instance.alt=e.alt,this.imageComponentRef.instance.title=e.title,this.imageComponentRef.instance.outerWidth=e.width}handleResize=()=>{if(this.updating)return;const{state:e,dispatch:t}=this.view,{tr:r}=e,i=r.setNodeMarkup(this.getPos(),void 0,{...this.node.attrs,width:this.imageComponentRef.instance.outerWidth}),o=i.doc.resolve(this.getPos()),s=new Ie(o);i.setSelection(s),t(i)};update(e){return e.type===this.node.type&&(this.node=e,this.computeChanges(this.node.attrs,e.attrs)&&(this.updating=!0,this.setNodeAttributes(e.attrs),this.updating=!1),!0)}ignoreMutation(){return!0}selectNode(){this.imageComponentRef.instance.selected=!0}deselectNode(){this.imageComponentRef.instance.selected=!1}destroy(){this.resizeSubscription.unsubscribe(),this.applicationRef.detachView(this.imageComponentRef.hostView)}}const B2e=/(?:https?:\/\/)?[\w-]+(?:\.[\w-]+)+\.?(?:\d+)?(?:\/\S*)?$/,nJ=n=>{const e=[];return n.forEach(t=>{if(t.isText){const r=t.text;let i=0;const o=B2e.exec(r);if(o){const s=o.index,a=s+o[0].length,{link:l}=t.type.schema.marks;s>0&&e.push(t.cut(i,s));const c=r.slice(s,a);e.push(t.cut(s,a).mark(l.create({href:c}).addToSet(t.marks))),i=a}i"string"==typeof n,iJ=n=>window.trustedTypes?.isHTML(n)??!1,oJ=n=>rJ(n)||iJ(n),sJ={type:"doc",content:[{type:"paragraph"}]},K_=(n,e,t)=>{if(!n)return e.nodeFromJSON(sJ);if(!oJ(n))return e.nodeFromJSON(n);const r=((n,e,t)=>{const r=e??AT,i=document.createElement("div");return i.innerHTML=n,bu.fromSchema(r).parse(i,t).toJSON()})(n,e,t);return e.nodeFromJSON(r)};let $2e=(()=>{class n{renderer;injector;elementRef;constructor(t,r,i){this.renderer=t,this.injector=r,this.elementRef=i}ngxEditor;editor;outputFormat;placeholder="Type Here...";focusOut=new nt;focusIn=new nt;unsubscribe=new fe;onChange=()=>{};onTouched=()=>{};writeValue(t){!this.outputFormat&&oJ(t)&&(this.outputFormat="html"),this.editor.setContent(t??sJ)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.setMeta("UPDATE_EDITABLE",!t),this.renderer.setProperty(this.elementRef.nativeElement,"disabled",t)}handleChange(t){if("html"!==this.outputFormat)this.onChange(t);else{const r=(n=>{const t=this.editor.schema??AT,r=t.nodeFromJSON(n),i=wu.fromSchema(t).serializeFragment(r.content),o=document.createElement("div");return o.appendChild(i),o.innerHTML})(t);this.onChange(r)}}setMeta(t,r){const{dispatch:i,state:{tr:o}}=this.editor.view;i(o.setMeta(t,r))}setPlaceholder(t){this.setMeta("UPDATE_PLACEHOLDER",t)}registerPlugins(){this.editor.registerPlugin(R2e()),this.editor.registerPlugin(k2e(this.placeholder)),this.editor.registerPlugin(((n={})=>new ss({key:new Js("attributes"),props:{attributes:n}}))({class:"NgxEditor__Content"})),this.editor.registerPlugin((n=>new ss({key:new Js("focus"),props:{handleDOMEvents:{focus:()=>(n(),!1)}}}))(()=>{this.focusIn.emit()})),this.editor.registerPlugin((n=>new ss({key:new Js("blur"),props:{handleDOMEvents:{blur:()=>(n(),!1)}}}))(()=>{this.focusOut.emit(),this.onTouched()})),this.editor.features.resizeImage&&this.editor.registerPlugin((n=>new ss({key:new Js("image-resize"),props:{nodeViews:{image:(e,t,r)=>new L2e(e,t,r,n)}}}))(this.injector)),this.editor.features.linkOnPaste&&this.editor.registerPlugin(new ss({key:new Js("linkify"),props:{transformPasted:n=>new ie(nJ(n.content),n.openStart,n.openEnd)}}))}ngOnInit(){if(!this.editor)throw new yY("Required editor instance for initializing editor component");this.registerPlugins(),this.renderer.appendChild(this.ngxEditor.nativeElement,this.editor.view.dom),this.editor.valueChanges.pipe(At(this.unsubscribe)).subscribe(t=>{this.handleChange(t)})}ngOnChanges(t){t.placeholder&&!t.placeholder.isFirstChange()&&this.setPlaceholder(t.placeholder.currentValue)}ngOnDestroy(){this.unsubscribe.next(),this.unsubscribe.complete()}static \u0275fac=function(r){return new(r||n)($(Ti),$(ze),$(je))};static \u0275cmp=He({type:n,selectors:[["ngx-editor"]],viewQuery:function(r,i){if(1&r&&qn(i2e,7),2&r){let o;Qe(o=Ye())&&(i.ngxEditor=o.first)}},inputs:{editor:"editor",outputFormat:"outputFormat",placeholder:"placeholder"},outputs:{focusOut:"focusOut",focusIn:"focusIn"},standalone:!1,features:[$e([{provide:Yi,useExisting:ft(()=>n),multi:!0}]),ei],ngContentSelectors:o2e,decls:3,vars:0,consts:[["ngxEditor",""],[1,"NgxEditor"]],template:function(r,i){1&r&&(Hn(),W(0,"div",1,0),Ae(2),K())},styles:[':root{--ngx-editor-border-radius: 4px;--ngx-editor-background-color: #fff;--ngx-editor-text-color: #000;--ngx-editor-placeholder-color: #6c757d;--ngx-editor-border-color: rgba(0, 0, 0, .2);--ngx-editor-wrapper-border-color: rgba(0, 0, 0, .2);--ngx-editor-menubar-bg-color: #fff;--ngx-editor-menubar-padding: 3px;--ngx-editor-menubar-height: 30px;--ngx-editor-blockquote-color: #ddd;--ngx-editor-blockquote-border-width: 3px;--ngx-editor-icon-size: 30px;--ngx-editor-popup-bg-color: #fff;--ngx-editor-popup-border-radius: 4px;--ngx-editor-popup-shadow: rgba(60, 64, 67, .15) 0px 2px 6px 2px;--ngx-editor-menu-item-border-radius: 2px;--ngx-editor-menu-item-active-color: #1a73e8;--ngx-editor-menu-item-hover-bg-color: #f1f1f1;--ngx-editor-menu-item-active-bg-color: #e8f0fe;--ngx-editor-seperator-color: #ccc;--ngx-editor-bubble-bg-color: #000;--ngx-editor-bubble-text-color: #fff;--ngx-editor-bubble-item-hover-color: #636262;--ngx-editor-bubble-seperator-color: #fff;--ngx-editor-focus-ring-color: #5e9ed6;--ngx-editor-error-color: red;--ngx-editor-click-pointer: default}.NgxEditor{background:var(--ngx-editor-background-color);color:var(--ngx-editor-text-color);background-clip:padding-box;border-radius:var(--ngx-editor-border-radius);border:1px solid var(--ngx-editor-border-color);position:relative}.NgxEditor--Disabled{opacity:.5!important;pointer-events:none!important}.NgxEditor__Placeholder:before{color:var(--ngx-editor-placeholder-color);opacity:1;-webkit-user-select:none;user-select:none;position:absolute;cursor:text;content:attr(data-placeholder)}.NgxEditor__Placeholder[data-align=right]:before{position:relative}.NgxEditor__Content{padding:8px;white-space:pre-wrap;outline:none;font-variant-ligatures:none;font-feature-settings:"liga" 0}.NgxEditor__Content p{margin:0 0 10px}.NgxEditor__Content blockquote{padding-left:16px;border-left:var(--ngx-editor-blockquote-border-width) solid var(--ngx-editor-blockquote-color);margin-left:0;margin-right:0}.NgxEditor__Content--Disabled{-webkit-user-select:none;user-select:none;pointer-events:none}.NgxEditor__Wrapper{border:1px solid var(--ngx-editor-wrapper-border-color);border-radius:var(--ngx-editor-border-radius)}.NgxEditor__Wrapper .NgxEditor__MenuBar{border-top-left-radius:var(--ngx-editor-border-radius);border-top-right-radius:var(--ngx-editor-border-radius);border-bottom:1px solid var(--ngx-editor-border-color)}.NgxEditor__Wrapper .NgxEditor{border-top-left-radius:0;border-top-right-radius:0;border:none}.NgxEditor__MenuBar{display:flex;flex-wrap:wrap;padding:var(--ngx-editor-menubar-padding);background-color:var(--ngx-editor-menubar-bg-color);gap:.25rem .1rem}.NgxEditor__MenuBar button:not(:disabled),.NgxEditor__MenuBar [role=button]:not(:disabled){cursor:var(--ngx-editor-click-pointer, default)}.NgxEditor__MenuItem{display:flex;align-items:center;justify-content:center;position:relative;flex-shrink:0}.NgxEditor__MenuItem.NgxEditor__MenuItem--IconContainer{display:flex;align-items:center;justify-content:center}.NgxEditor__MenuItem .NgxEditor__MenuItem--Icon{all:unset;appearance:none;height:var(--ngx-editor-icon-size);width:var(--ngx-editor-icon-size);transition:.2s ease-in-out;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--ngx-editor-menu-item-border-radius)}.NgxEditor__MenuItem .NgxEditor__MenuItem--Icon+.NgxEditor__MenuItem--Icon{margin-left:2px}.NgxEditor__MenuItem .NgxEditor__MenuItem--Icon:focus-visible{outline:1px solid var(--ngx-editor-focus-ring-color)}.NgxEditor__MenuItem .NgxEditor__MenuItem--Icon:hover{background-color:var(--ngx-editor-menu-item-hover-bg-color)}.NgxEditor__MenuItem.NgxEditor__MenuItem--Text{padding:0 5px}.NgxEditor__MenuItem.NgxEditor__MenuItem--Active,.NgxEditor__MenuItem .NgxEditor__MenuItem--Active{background-color:var(--ngx-editor-menu-item-active-bg-color);color:var(--ngx-editor-menu-item-active-color)}.NgxEditor__Dropdown{min-width:64px;position:relative;display:flex;align-items:center;flex-shrink:0}.NgxEditor__Dropdown:hover{background-color:var(--ngx-editor-menu-item-hover-bg-color)}.NgxEditor__Dropdown .NgxEditor__Dropdown--Text{all:unset;appearance:none;display:flex;align-items:center;justify-content:center;padding:0 5px;height:100%;width:100%}.NgxEditor__Dropdown .NgxEditor__Dropdown--Text:focus-visible{outline:1px solid var(--ngx-editor-focus-ring-color)}.NgxEditor__Dropdown .NgxEditor__Dropdown--Text:after{display:inline-block;content:"";margin-left:24px;vertical-align:4px;border-top:4px solid;border-right:4px solid transparent;border-bottom:0;border-left:4px solid transparent}.NgxEditor__Dropdown .NgxEditor__Dropdown--DropdownMenu{position:absolute;left:0;box-shadow:var(--ngx-editor-popup-shadow);border-radius:var(--ngx-editor-popup-border-radius);background-color:var(--ngx-editor-popup-bg-color);z-index:10;width:100%;top:calc(var(--ngx-editor-menubar-height) + 2px);display:flex;flex-direction:column}.NgxEditor__Dropdown .NgxEditor__Dropdown--Item{all:unset;appearance:none;padding:8px;white-space:nowrap;color:inherit}.NgxEditor__Dropdown .NgxEditor__Dropdown--Item:focus-visible{outline:1px solid var(--ngx-editor-focus-ring-color)}.NgxEditor__Dropdown .NgxEditor__Dropdown--Item:hover{background-color:var(--ngx-editor-menu-item-hover-bg-color)}.NgxEditor__Dropdown .NgxEditor__Dropdown--Selected,.NgxEditor__Dropdown .NgxEditor__Dropdown--Open{color:var(--ngx-editor-menu-item-active-color);background-color:var(--ngx-editor-menu-item-active-bg-color)}.NgxEditor__Dropdown .NgxEditor__Dropdown--Active{background-color:var(--ngx-editor-menu-item-active-bg-color)}.NgxEditor__Dropdown .NgxEditor__Dropdown--Active:hover{background-color:var(--ngx-editor-menu-item-hover-bg-color)}.NgxEditor__MenuBar--Reverse .NgxEditor__Dropdown--DropdownMenu{top:unset;bottom:calc(var(--ngx-editor-menubar-height) + 2px)}.NgxEditor__MenuBar--Reverse .NgxEditor__Dropdown--Text:after{transform:rotate(180deg)}.NgxEditor__MenuBar--Reverse .NgxEditor__Popup{top:unset;bottom:calc(var(--ngx-editor-menubar-height) + 2px)}.NgxEditor__Popup{position:absolute;top:calc(var(--ngx-editor-menubar-height) + 2px);box-shadow:var(--ngx-editor-popup-shadow);border-radius:var(--ngx-editor-popup-border-radius);background-color:var(--ngx-editor-popup-bg-color);z-index:10;min-width:192px;padding:8px}.NgxEditor__Popup .NgxEditor__Popup--FormGroup{margin-bottom:8px}.NgxEditor__Popup .NgxEditor__Popup--FormGroup label{margin-bottom:3px}.NgxEditor__Popup .NgxEditor__Popup--FormGroup input[type=text],.NgxEditor__Popup .NgxEditor__Popup--FormGroup input[type=url]{padding:2px 4px}.NgxEditor__Popup .NgxEditor__Popup--Col{display:flex;flex-direction:column;position:relative}.NgxEditor__Popup .NgxEditor__Popup--Label{font-size:85%}.NgxEditor__Seperator{border-left:1px solid var(--ngx-editor-seperator-color);margin:0 5px}.NgxEditor__HelpText{font-size:80%}.NgxEditor__HelpText.NgxEditor__HelpText--Error{color:var(--ngx-editor-error-color)}\n'],encapsulation:2})}return n})();class Fl{name;constructor(e){this.name=e}apply(){return(e,t)=>{const{schema:r}=e,i=r.marks[this.name];return!!i&&YZ(i)(e,t)}}toggle(){return(e,t)=>{const{schema:r}=e,i=r.marks[this.name];return!!i&&Mf(i)(e,t)}}isActive(e){const{schema:t}=e,r=t.marks[this.name];return!!r&&EF(e,r)}canExecute(e){return this.toggle()(e)}}class FT{isBulletList=!1;constructor(e=!1){this.isBulletList=e}getType(e){return this.isBulletList?e.nodes.bullet_list:e.nodes.ordered_list}toggle(){return(e,t)=>{const{schema:r}=e,i=this.getType(r);return!!i&&(this.isActive(e)?RZ(r.nodes.list_item)(e,t):function qLe(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,s=i.blockRange(o);if(!s)return!1;let a=r?t.tr:null;return!!function WLe(n,e,t,r=null){let i=!1,o=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&0==e.startIndex){if(0==e.$from.index(e.depth-1))return!1;let l=s.resolve(e.start-2);o=new dT(l,l,e.depth),e.endIndex=0;u--)o=Y.from(t[u].type.create(t[u].attrs,o));n.step(new cr(e.start-(r?2:0),e.end,e.start,e.end,new ie(o,0,0),t.length,!0));let s=0;for(let u=0;u{const{schema:r}=e,i=r.nodes.heading;return!!i&&vF(i)(e,t)}}toggle(){return(e,t)=>{const{schema:r,selection:i,doc:o}=e,s=r.nodes.heading;if(!s)return!1;const a=i.$from.before(1),c=o.nodeAt(a)?.attrs??{};return this.isActive(e)?vF(r.nodes.paragraph,c)(e,t):vF(s,{...c,level:this.level})(e,t)}}isActive(e){const{schema:t}=e,r=GZ(e),i=t.nodes.heading;if(!i)return!1;const o=[i,t.nodes.text,t.nodes.blockquote];return!!r.filter(l=>o.includes(l.type)).find(l=>l.attrs.level===this.level)}canExecute(e){return this.toggle()(e)}}class Q_{align;constructor(e){this.align=e}toggle(){return(e,t)=>{const{doc:r,selection:i,tr:o,schema:s}=e,{from:a,to:l}=i;let c=!1;return r.nodesBetween(a,l,(u,d)=>{const f=u.type;return[s.nodes.paragraph,s.nodes.heading].includes(f)&&(c=!0,o.setNodeMarkup(d,f,{...u.attrs,align:u.attrs.align===this.align?null:this.align})),!0}),!!c&&(o.docChanged&&t?.(o),!0)}}isActive(e){return!!GZ(e).find(i=>i.attrs.align===this.align)}canExecute(e){return this.toggle()(e)}}const G2e={strict:!0};let DF=class{update(e){return(t,r)=>{const{schema:i,selection:o}=t,s=i.marks.link;return!(!s||o.empty)&&Mf(s,e)(t,r)}}insert(e,t){return(r,i)=>{const{schema:o,tr:s}=r;if(!o.marks.link)return!1;const c=o.text(e,[o.marks.link.create({href:t.href,title:t.title??e,target:t.target??"_blank"})]);return s.replaceSelectionWith(c,!1).scrollIntoView(),!!s.docChanged&&(i?.(s),!0)}}isActive(e,t=G2e){if(t.strict)return!0;const{schema:r}=e,i=r.marks.link;return!!i&&EF(e,i)}remove(e,t){return((n,e)=>{const{doc:t,selection:r,tr:i,schema:o}=n,{$head:{pos:s},from:a,to:l}=r,c=o.marks.link;if(a===l){const u=t.resolve(s),d=s-u.textOffset,f=d+u.parent.child(u.index()).nodeSize;i.removeMark(d,f,c)}else i.removeMark(a,l,c);return!!i.docChanged&&(e?.(i),!0)})(e,t)}canExecute(e){const t={href:""};return this.insert("Exec",t)(e)||this.update(t)(e)}},aJ=class{insert(e,t){return(r,i)=>{const{schema:o,tr:s,selection:a}=r,l=o.nodes.image;if(!l)return!1;const c={width:null,src:e,...t};!c.width&&a instanceof Ie&&a.node.type===l&&(c.width=a.node.attrs.width),s.replaceSelectionWith(l.createAndFill(c));const u=s.doc.resolve(s.selection.anchor-s.selection.$anchor.nodeBefore.nodeSize);return s.setSelection(new Ie(u)).scrollIntoView(),!!s.docChanged&&(i?.(s),!0)}}isActive(e){const{selection:t}=e;return t instanceof Ie&&"image"===t.node.type.name}},kf=class{name;attrName;constructor(e,t="color"){this.name=e,this.attrName=t}apply(e){return(t,r)=>{const{schema:i,selection:o,doc:s}=t,a=i.marks[this.name];if(!a)return!1;const{from:l,to:c,empty:u}=o;if(!u&&l+1===c){const d=s.nodeAt(l);if(d?.isAtom&&!d.isText&&d.isLeaf)return!1}return YZ(a,e)(t,r)}}isActive(e){const{schema:t}=e,r=t.marks[this.name];return!!r&&EF(e,r)}getActiveColors(e){if(!this.isActive(e))return[];const{schema:t}=e;return(n=>{let e=[];const{selection:t,storedMarks:r}=n,{from:i,to:o,empty:s,$from:a}=t;return s?e=r||a.marks():n.doc.nodesBetween(i,o,l=>{e=[...e,...l.marks]}),e})(e).filter(o=>o.type===t.marks[this.name]).map(o=>o.attrs[this.attrName]).filter(Boolean)}remove(){return(e,t)=>{const{schema:r}=e,i=r.marks[this.name];return!!i&&(n=i,(e,t)=>{const{tr:r,selection:i,storedMarks:o,doc:s}=e,{empty:a,ranges:l}=i;if(a&&i instanceof lt){const{$cursor:c}=i;if(!c||!KZ(e.doc,l,n))return!1;if(n.isInSet(o||c.marks()))return r.removeStoredMark(n),t?.(r),!0}else{for(const c of l){const{$from:u,$to:d}=c;s.rangeHasMark(u.pos,d.pos,n)&&r.removeMark(u.pos,d.pos,n)}if(!r.docChanged)return!1;t?.(r.scrollIntoView())}return!1})(e,t);var n}}canExecute(e){return this.apply("text_color"===this.name?{color:""}:{backgroundColor:""})(e)}};const K2e=["link"],Y2e=["paragraph","heading","blockquote"];class LT{method="increase";constructor(e){this.method=e}insert(){return(e,t)=>{const{tr:r,doc:i}=e,{from:o,to:s}=r.selection;let a=!1;return i.nodesBetween(o,s,(l,c)=>Y2e.includes(l.type.name)?(a=((n,e,t)=>{const r=n.doc.nodeAt(e);if(!r)return!1;const i=r.attrs.indent??0,o=(n=>Math.min(Math.max(n,0),10))(i+("increase"===t?1:-1));if(o===i||o<0||o>10)return!1;const s={...r.attrs,indent:o};return n.setNodeMarkup(e,r.type,s),!0})(r,c,this.method),!1):!l.type.name.includes("list")),!!a&&(r.docChanged&&t?.(r),!0)}}canExecute(e){return this.insert()(e)}}class uJ{mode="undo";constructor(e){this.mode=e}insert(){return(e,t)=>"undo"===this.mode?CF(e,t):NT(e,t)}canExecute(e){return this.insert()(e)}}new Fl("strong"),new Fl("em"),new Fl("code"),new Fl("u"),new Fl("s"),new class q2e{toggle(){return(e,t)=>{const{schema:r}=e,i=r.nodes.blockquote;return!!i&&(this.isActive(e)?((n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&k_(i);return null!=o&&(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)})(e,t):function bVe(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,s=i.blockRange(o),a=s&&OO(s,n,e);return!!a&&(r&&r(t.tr.wrap(s,a).scrollIntoView()),!0)}}(i)(e,t))}}isActive(e){const{schema:t}=e,r=t.nodes.blockquote;return!!r&&WZ(e,r)}canExecute(e){return this.toggle()(e)}},new class W2e{insert(){return(e,t)=>{const{schema:r,tr:i}=e,o=r.nodes.horizontal_rule;return!!o&&(t(i.replaceSelectionWith(o.create()).scrollIntoView()),!0)}}canExecute(e){return((n,e)=>{const{$from:t}=n.selection;for(let r=t.depth;r>=0;r-=1){const i=t.index(r);if(t.node(r).canReplaceWith(i,i,e))return!0}return!1})(e,e.schema.nodes.horizontal_rule)}},new class Q2e{insert(){return(e,t)=>{const{tr:r}=e,{ranges:i,empty:o}=r.selection;return o||(Object.entries(e.schema.marks).forEach(([s,a])=>{K2e.includes(s)||i.forEach(l=>{r.removeMark(l.$from.pos,l.$to.pos,a)})}),t(r)),!0}}canExecute(){return!0}},new FT(!0),new FT(!1),new Au(1),new Au(2),new Au(3),new Au(4),new Au(5),new Au(6),new Q_("left"),new Q_("center"),new Q_("right"),new Q_("justify"),new DF,new aJ,new kf("text_color","color"),new kf("text_background_color","backgroundColor"),new LT("increase"),new LT("decrease"),new Fl("sup"),new Fl("sub"),new uJ("undo"),new uJ("redo");const AF={bold:"Bold",italic:"Italic",code:"Code",underline:"Underline",strike:"Strike",blockquote:"Blockquote",bullet_list:"Bullet List",ordered_list:"Ordered List",heading:"Heading",h1:"Header 1",h2:"Header 2",h3:"Header 3",h4:"Header 4",h5:"Header 5",h6:"Header 6",align_left:"Left Align",align_center:"Center Align",align_right:"Right Align",align_justify:"Justify",text_color:"Text Color",background_color:"Background Color",horizontal_rule:"Horizontal rule",format_clear:"Clear Formatting",insertLink:"Insert Link",removeLink:"Remove Link",insertImage:"Insert Image",indent:"Increase Indent",outdent:"Decrease Indent",superscript:"Superscript",subscript:"Subscript",undo:"Undo",redo:"Redo",url:"URL",text:"Text",openInNewTab:"Open in new tab",insert:"Insert",altText:"Alt Text",title:"Title",remove:"Remove",enterValidUrl:"Please enter a valid URL"};class TBe{locals=AF;constructor(e={}){this.locals={...AF,...e}}get=e=>{const t=this.locals[e];return t?qb(t)?t:de(t):de("")}}const dJ={bold:'\n \n',italic:'\n \n',code:'\n\n',underline:'\n\n',strike:'\n\n',ordered_list:'\n\n',bullet_list:'\n\n',blockquote:'\n\n',link:'\n\n',unlink:'\n\n',image:'\n\n',align_left:'\n\n',align_center:'\n\n',align_right:'\n\n',align_justify:'\n\n',text_color:'\n\n',color_fill:'\n\n',horizontal_rule:'\n \n \n \n \n',format_clear:'\n\n',indent:'',outdent:'',superscript:'',subscript:'',undo:'',redo:'',path:""};class JBe{static get(e,t="currentColor"){const r=dJ[e];return r&&(r.includes("\n ${r}\n \n `:r}}let RF=(()=>{class n{locals={};icons={};static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),eUe=(()=>{class n{config;constructor(t){this.config=t}get locals(){return new TBe(this.config.locals)}getIcon(t){return this.config.icons[t]?this.config.icons[t]:JBe.get(t)}static \u0275fac=function(r){return new(r||n)(me(RF,8))};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const hJ=n=>({locals:n.locals??{},icons:n.icons??{}});let tUe=(()=>{class n{sanitizer;constructor(t){this.sanitizer=t}transform(t){return iJ(t)?t:this.sanitizer.bypassSecurityTrustHtml(t)}static \u0275fac=function(r){return new(r||n)($($b,16))};static \u0275pipe=Fr({name:"sanitizeHtml",type:n,pure:!0,standalone:!1})}return n})(),nUe=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({providers:[tUe],imports:[za,Pw]})}return n})();const VT=new B("NgxEditorConfig"),fJ={locals:AF,icons:dJ};let rUe=(()=>{class n{static forRoot(t=fJ){return{ngModule:n,providers:[{provide:VT,useValue:t},{provide:RF,useFactory:hJ,deps:[VT]}]}}static forChild(t=fJ){return{ngModule:n,providers:[{provide:VT,useValue:t},{provide:RF,useFactory:hJ,deps:[VT]},eUe]}}static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[za,nUe]})}return n})();const hi=(n,e=!1)=>(t,r)=>{const i=new Fl(n);return e?i.toggle()(t,r):i.apply()(t,r)};class sUe{view;state;tr;constructor(e){if(!e)throw new yY("Required view to initialize commands.");this.view=e,this.state=e.state,this.tr=this.view.state.tr}applyTrx=e=>{this.state=this.state.apply(e??this.tr),this.tr=this.state.tr,this.tr.setMeta("APPLIED_TRX",!0)};dispatch=e=>{this.applyTrx(e)};exec(){if(!this.tr.getMeta("APPLIED_TRX"))return!1;const e=!this.view.state.doc.eq(this.state.doc);this.view.updateState(this.state);const t=this.tr.setMeta("FORCE_EMIT",e);return this.view.dispatch(t),!0}focus(e="end"){const t="start"===e?rt.atStart(this.state.doc):rt.atEnd(this.state.doc);return this.tr.setSelection(t),this.applyTrx(),this.view.focus(),this}scrollIntoView(){return this.tr.scrollIntoView(),this.applyTrx(),this}insertText(e){return this.tr.insertText(e),this.applyTrx(),this}insertNewLine(){return G_(FZ,VZ,BZ,yF)(this.state,this.dispatch),this}applyMark(e){return hi(e,!1)(this.state,this.dispatch),this}toggleMark(e){return hi(e,!0)(this.state,this.dispatch),this}bold(){return hi("strong")(this.state,this.dispatch),this}toggleBold(){return hi("strong",!0)(this.state,this.dispatch),this}italics(){return hi("em")(this.state,this.dispatch),this}toggleItalics(){return hi("em",!0)(this.state,this.dispatch),this}underline(){return hi("u")(this.state,this.dispatch),this}toggleUnderline(){return hi("u",!0)(this.state,this.dispatch),this}strike(){return hi("s")(this.state,this.dispatch),this}toggleStrike(){return hi("s",!0)(this.state,this.dispatch),this}code(){return hi("code")(this.state,this.dispatch),this}toggleCode(){return hi("code",!0)(this.state,this.dispatch),this}superscript(){return hi("sup")(this.state,this.dispatch),this}subscript(){return hi("sub")(this.state,this.dispatch),this}toggleOrderedList(){return new FT(!1).toggle()(this.state,this.dispatch),this}toggleBulletList(){return new FT(!0).toggle()(this.state,this.dispatch),this}toggleHeading(e){return new Au(e).toggle()(this.state,this.dispatch),this}insertLink(e,t){return(new DF).insert(e,t)(this.state,this.dispatch),this}updateLink(e){return(new DF).update(e)(this.state,this.dispatch),this}insertImage(e,t={}){return(new aJ).insert(e,t)(this.state,this.dispatch),this}textColor(e){return new kf("text_color").apply({color:e})(this.state,this.dispatch),this}backgroundColor(e){return new kf("text_background_color").apply({backgroundColor:e})(this.state,this.dispatch),this}removeTextColor(){return new kf("text_color").remove()(this.state,this.dispatch),this}removeBackgroundColor(){return new kf("text_background_color").remove()(this.state,this.dispatch),this}align(e){return new Q_(e).toggle()(this.state,this.dispatch),this}insertHTML(e){const{selection:t,schema:r,tr:i}=this.state,{from:o,to:s}=t,a=document.createElement("div");a.innerHTML=rJ(e)?e.trim():e;const l=bu.fromSchema(r).parseSlice(a),c=i.replaceRange(o,s,l);return this.applyTrx(c),this}indent(){return new LT("increase").insert()(this.state,this.dispatch),this}outdent(){return new LT("decrease").insert()(this.state,this.dispatch),this}}const aUe=typeof navigator<"u"&&/Mac/.test(navigator.platform),mUe=n=>{const e=PVe.concat(AVe,DVe);return e.push((n=>QZ(/(?:^|\s)(?:(\*\*|__)(?:([^*_]+))(\*\*|__))$/,n))(n.marks.strong)),e.push((n=>QZ(/(?:^|\s)(?:(\*|_)(?:([^*_]+))(\*|_))$/,n))(n.marks.em)),e.push((n=>wF(/^\s*>\s$/,n))(n.nodes.blockquote)),e.push((n=>wF(/^(?:\d+)\.\s$/,n,e=>({order:Number(e[1])}),(e,t)=>t.childCount+t.attrs.order===Number(e[1])))(n.nodes.ordered_list)),e.push((n=>wF(/^\s*(?:[-+*])\s$/,n))(n.nodes.bullet_list)),e.push((n=>qZ(/^```$/,n))(n.nodes.code_block)),e.push((n=>qZ(new RegExp("^(#{1,6})\\s$"),n,t=>({level:t[1].length})))(n.nodes.heading)),function SVe({rules:n}){let e=new ss({state:{init:()=>null,apply(t,r){return t.getMeta(this)||(t.selectionSet||t.docChanged?null:r)}},props:{handleTextInput:(t,r,i,o)=>$Z(t,r,i,o,n,e),handleDOMEvents:{compositionend:t=>{setTimeout(()=>{let{$cursor:r}=t.state.selection;r&&$Z(t,r.pos,r.pos,"",n,e)})}}},isInputRules:!0});return e}({rules:e})},_Ue=(n,e)=>{const t=[];return e.keyboardShortcuts&&t.push(...((n,e)=>{const t={};t["Mod-z"]=CF,aUe?t["Shift-Mod-z"]=NT:t["Mod-y"]=NT;const r=[OT({"Mod-b":Mf(n.marks.strong),"Mod-i":Mf(n.marks.em),"Mod-u":Mf(n.marks.u),"Mod-`":Mf(n.marks.code)}),OT({Enter:AZ(n.nodes.list_item),"Shift-Enter":G_(LZ,(i,o)=>{const{tr:s}=i;return o(s.replaceSelectionWith(n.nodes.hard_break.create()).scrollIntoView()),!0}),"Mod-[":RZ(n.nodes.list_item),"Mod-]":MZ(n.nodes.list_item),Tab:MZ(n.nodes.list_item)}),OT(TVe)];return e.history&&r.push(OT(t)),r})(n,{history:e.history})),e.history&&t.push(function GVe(n={}){return new ss({key:sa,state:{init:()=>new Pl(Io.empty,Io.empty,null,0,-1),apply:(e,t,r)=>function $Ve(n,e,t,r){let o,i=t.getMeta(sa);if(i)return i.historyState;t.getMeta(tJ)&&(n=new Pl(n.done,n.undone,null,0,-1));let s=t.getMeta("appendedTransaction");if(0==t.steps.length)return n;if(s&&s.getMeta(sa))return s.getMeta(sa).redo?new Pl(n.done.addTransform(t,void 0,r,MT(e)),n.undone,JZ(t.mapping.maps),n.prevTime,n.prevComposition):new Pl(n.done,n.undone.addTransform(t,void 0,r,MT(e)),null,n.prevTime,n.prevComposition);if(!1===t.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=t.getMeta("rebased"))?new Pl(n.done.rebased(t,o),n.undone.rebased(t,o),IF(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new Pl(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),IF(n.prevRanges,t.mapping),n.prevTime,n.prevComposition);{let a=t.getMeta("composition"),l=0==n.prevTime||!s&&n.prevComposition!=a&&(n.prevTime<(t.time||0)-r.newGroupDelay||!function qVe(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=e[o]&&(t=!0)}),t}(t,n.prevRanges)),c=s?IF(n.prevRanges,t.mapping):JZ(t.mapping.maps);return new Pl(n.done.addTransform(t,l?e.selection.getBookmark():void 0,r,MT(e)),Io.empty,c,t.time,a??n.prevComposition)}}(t,r,e,n)},config:n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i="historyUndo"==r?CF:"historyRedo"==r?NT:null;return!!i&&(t.preventDefault(),i(e.state,e.dispatch))}}}})}()),e.inputRules&&t.push(mUe(n)),t},mJ={linkOnPaste:!0,resizeImage:!0},gJ={content:null,history:!0,keyboardShortcuts:!0,inputRules:!0,schema:AT,plugins:[],nodeViews:{},attributes:{},features:mJ,handleScrollToSelection:null,linkValidationPattern:"(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/??([^#\n\r]*)?#?([^\n\r]*)|(mailto:.*[@].*)"};class yUe{options;view;constructor(e=gJ){this.options={...gJ,...e},this.createEditor()}valueChangesSubject=new fe;updateSubject=new fe;get valueChanges(){return this.valueChangesSubject.asObservable()}get update(){return this.updateSubject.asObservable()}get schema(){return this.options.schema||AT}get linkValidationPattern(){return this.options.linkValidationPattern}get commands(){return new sUe(this.view)}get features(){return{...mJ,...this.options.features}}handleTransactions(e){const t=this.view.state.apply(e);if(this.view.updateState(t),this.updateSubject.next(this.view),!e.docChanged&&!e.getMeta("FORCE_EMIT"))return;const r=t.doc.toJSON();this.valueChangesSubject.next(r)}createEditor(){const{options:e,schema:t}=this,{content:r=null,nodeViews:i}=e,{history:o=!0,keyboardShortcuts:s=!0,inputRules:a=!0}=e,l=K_(r,t,e.parseOptions),c=e.plugins??[],u=e.attributes??{},d=_Ue(t,{history:o,keyboardShortcuts:s,inputRules:a});this.view=new BLe(null,{state:Tf.create({doc:l,schema:t,plugins:[...d,...c]}),nodeViews:i,dispatchTransaction:this.handleTransactions.bind(this),attributes:u,handleScrollToSelection:e.handleScrollToSelection})}setContent(e){if(typeof(n=e)>"u"||null===n)return;var n;const{state:t}=this.view,{tr:r,doc:i}=t,o=K_(e,this.schema,this.options.parseOptions);r.replaceWith(0,t.doc.content.size,o),!i.eq(r.doc)&&r.docChanged&&this.view.dispatch(r)}registerPlugin(e){const{state:t}=this.view,r=[...t.plugins,e],i=t.reconfigure({plugins:r});this.view.updateState(i)}destroy(){this.view.destroy()}}let vUe=(()=>{class n{firestore=b(I_);authService=b(mf);createPost(t){var r=this;return T(function*(){const i=r.authService.currentUser();if(!i)throw new Error("Must be logged in to create a post");const o=j1e(r.firestore,"posts"),s={...t,authorId:i.uid,authorName:i.displayName||"Anonymous",createdAt:E_(),updatedAt:E_(),publishedAt:"published"===t.status?E_():null};return(yield z1e(o,s)).id})()}updatePost(t,r){var i=this;return T(function*(){const o=tO(i.firestore,"posts",t);yield G1e(o,{...r,updatedAt:E_(),publishedAt:"published"===r.status?E_():null})})()}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function bUe(n,e){1&n&&(W(0,"mat-error"),Oe(1," Title is required "),K())}function wUe(n,e){1&n&&(W(0,"mat-error"),Oe(1," Content is required "),K())}function EUe(n,e){if(1&n){const t=La();W(0,"mat-chip-row",14),Ve("removed",function(){const i=vi(t).$implicit;return bi(Ln().removeTag(i))}),Oe(1),W(2,"button",15)(3,"mat-icon"),Oe(4,"cancel"),K()()()}if(2&n){const t=e.$implicit;re(),Va(" ",t," ")}}const IUe=[{path:"auth",children:[{path:"login",component:qNe},{path:"signup",component:WNe},{path:"",redirectTo:"login",pathMatch:"full"}]},{path:"blog",canActivate:[lY],children:[{path:"create",component:(()=>{class n{fb=b(Nw);blogService=b(vUe);editor;separatorKeysCodes=[13,188];tags=ti([]);saving=ti(!1);postForm=this.fb.group({title:["",Ri.required],content:["",Ri.required],tags:[[]]});ngOnInit(){this.editor=new yUe}ngOnDestroy(){this.editor.destroy()}addTag(t){const r=(t.value||"").trim();r&&this.tags.update(i=>[...i,r]),t.chipInput.clear()}removeTag(t){this.tags.update(r=>r.filter(i=>i!==t))}saveDraft(){var t=this;return T(function*(){if(t.postForm.valid)try{t.saving.set(!0);const r=t.postForm.getRawValue();yield t.blogService.createPost({title:r.title||"",content:r.content||"",tags:t.tags(),status:"draft"})}finally{t.saving.set(!1)}})()}onSubmit(){var t=this;return T(function*(){if(t.postForm.valid)try{t.saving.set(!0);const r=t.postForm.getRawValue();yield t.blogService.createPost({title:r.title||"",content:r.content||"",tags:t.tags(),status:"published"})}finally{t.saving.set(!1)}})()}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["app-create-post"]],decls:30,vars:9,consts:[["chipGrid",""],[1,"container","p-4"],[1,"max-w-4xl","mx-auto"],[1,"p-4"],[1,"flex","flex-col","gap-4",3,"ngSubmit","formGroup"],["appearance","outline"],["matInput","","formControlName","title","placeholder","Enter post title"],[4,"ngIf"],["formControlName","content",3,"editor","placeholder"],["aria-label","Tag selection"],["placeholder","Add tags...",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],[1,"flex","gap-4","justify-end"],["mat-stroked-button","","type","button",3,"click","disabled"],["mat-raised-button","","color","primary","type","submit",3,"disabled"],[3,"removed"],["matChipRemove",""]],template:function(r,i){if(1&r){const o=La();W(0,"div",1)(1,"mat-card",2)(2,"mat-card-header")(3,"mat-card-title"),Oe(4,"Create New Post"),K()(),W(5,"mat-card-content",3)(6,"form",4),Ve("ngSubmit",function(){return vi(o),bi(i.onSubmit())}),W(7,"mat-form-field",5)(8,"mat-label"),Oe(9,"Title"),K(),Pe(10,"input",6),et(11,bUe,2,0,"mat-error",7),K(),W(12,"mat-form-field",5)(13,"mat-label"),Oe(14,"Content"),K(),Pe(15,"ngx-editor",8),et(16,wUe,2,0,"mat-error",7),K(),W(17,"mat-form-field",5)(18,"mat-label"),Oe(19,"Tags"),K(),W(20,"mat-chip-grid",9,0),function Wj(n,e,t,r,i,o,s,a,l,c,u,d,f){On("NgControlFlow");const p=L(),m=ve(),_=void 0!==l,v=L(),E=a?s.bind(v[15][8]):s,C=new Ede(_,E);v[25+n]=C,qp(p,m,n+1,e,t,r,i,$i(m.consts,o)),_&&qp(p,m,n+2,l,c,u,d,$i(m.consts,f))}(22,EUe,5,1,"mat-chip-row",null,qj),K(),W(24,"input",10),Ve("matChipInputTokenEnd",function(a){return vi(o),bi(i.addTag(a))}),K()(),W(25,"div",11)(26,"button",12),Ve("click",function(){return vi(o),bi(i.saveDraft())}),Oe(27," Save as Draft "),K(),W(28,"button",13),Oe(29," Publish Post "),K()()()()()()}if(2&r){let o,s;const a=rm(21);re(6),De("formGroup",i.postForm),re(5),De("ngIf",null==(o=i.postForm.get("title"))?null:o.hasError("required")),re(4),De("editor",i.editor)("placeholder","Write your post content here..."),re(),De("ngIf",null==(s=i.postForm.get("content"))?null:s.hasError("required")),re(6),function Gj(n){const e=Se(null),t=Jn();try{const r=L(),i=r[1],o=r[t],s=t+1,a=sb(r,s);if(void 0===o.liveCollection){const c=zS(i,s);o.liveCollection=new Ide(a,r,c)}else o.liveCollection.reset();const l=o.liveCollection;if(function vde(n,e,t){let r,i,o=0,s=n.length-1;if(Array.isArray(e)){let l=e.length-1;for(;o<=s&&o<=l;){const c=n.at(o),u=e[o],d=BS(o,c,o,u,t);if(0!==d){d<0&&n.updateValue(o,u),o++;continue}const f=n.at(s),p=e[l],m=BS(s,f,l,p,t);if(0!==m){m<0&&n.updateValue(s,p),s--,l--;continue}const _=t(o,c),v=t(s,f),E=t(o,u);if(Object.is(E,v)){const C=t(l,p);Object.is(C,_)?(n.swap(o,s),n.updateValue(s,p),l--,s--):n.move(s,o),n.updateValue(o,u),o++}else if(r??=new $j,i??=Hj(n,o,s,t),US(n,r,o,E))n.updateValue(o,u),o++,s++;else if(i.has(E))r.set(_,n.detach(o)),s--;else{const C=n.create(o,e[o]);n.attach(o,C),o++,s++}}for(;o<=l;)jj(n,r,t,o,e[o]),o++}else if(null!=e){const l=e[Symbol.iterator]();let c=l.next();for(;!c.done&&o<=s;){const u=n.at(o),d=c.value,f=BS(o,u,o,d,t);if(0!==f)f<0&&n.updateValue(o,d),o++,c=l.next();else{r??=new $j,i??=Hj(n,o,s,t);const p=t(o,d);if(US(n,r,o,p))n.updateValue(o,d),o++,s++,c=l.next();else if(i.has(p)){const m=t(o,u);r.set(m,n.detach(o)),s--}else n.attach(o,n.create(o,d)),o++,s++,c=l.next()}}for(;!c.done;)jj(n,r,t,n.length,c.value),c=l.next()}for(;o<=s;)n.destroy(n.detach(s--));r?.forEach(l=>{n.destroy(l)})}(l,n,o.trackByFn),l.updateIndexes(),o.hasEmptyBlock){const c=qi(),u=0===l.length;if(rn(r,c,u)){const d=t+2,f=sb(r,d);if(u){const p=zS(i,d),m=null;Ed(f,vd(r,p,void 0,{dehydratedView:m}),0,hc(p,m))}else Hx(f,0)}}}finally{Se(e)}}(i.tags()),re(2),De("matChipInputFor",a)("matChipInputSeparatorKeyCodes",i.separatorKeysCodes),re(2),De("disabled",i.saving()),re(2),De("disabled",!i.postForm.valid||i.saving())}},dependencies:[za,Bb,Pw,kw,nh,bw,ww,Ga,$m,oR,Xw,Jw,eE,Zw,ng,dR,tg,SW,fR,hR,hh,dh,sOe,gY,_Y,fY,IO,yO,_O,qW,rUe,$2e],styles:["[_nghost-%COMP%]{display:block}.container[_ngcontent-%COMP%]{margin:0 auto;max-width:1200px}ngx-editor[_ngcontent-%COMP%]{height:400px;border:1px solid var(--border-color);border-radius:4px}"]})}return n})()},{path:"",redirectTo:"list",pathMatch:"full"}]},{path:"",component:zPe,canActivate:[lY]}];function _J(n){return new O(3e3,!1)}function Ll(n){switch(n.length){case 0:return new eg;case 1:return n[0];default:return new CW(n)}}function yJ(n,e,t=new Map,r=new Map){const i=[],o=[];let s=-1,a=null;if(e.forEach(l=>{const c=l.get("offset"),u=c==s,d=u&&a||new Map;l.forEach((f,p)=>{let m=p,_=f;if("offset"!==p)switch(m=n.normalizePropertyName(m,i),_){case"!":_=t.get(p);break;case Ns:_=r.get(p);break;default:_=n.normalizeStyleValue(p,m,_,i)}d.set(m,_)}),u||o.push(d),a=d,s=c}),i.length)throw function WUe(){return new O(3502,!1)}();return o}function MF(n,e,t,r){switch(e){case"start":n.onStart(()=>r(t&&kF(t,"start",n)));break;case"done":n.onDone(()=>r(t&&kF(t,"done",n)));break;case"destroy":n.onDestroy(()=>r(t&&kF(t,"destroy",n)))}}function kF(n,e,t){const o=NF(n.element,n.triggerName,n.fromState,n.toState,e||n.phaseName,t.totalTime??n.totalTime,!!t.disabled),s=n._data;return null!=s&&(o._data=s),o}function NF(n,e,t,r,i="",o=0,s){return{element:n,triggerName:e,fromState:t,toState:r,phaseName:i,totalTime:o,disabled:!!s}}function Fi(n,e,t){let r=n.get(e);return r||n.set(e,r=t),r}function vJ(n){const e=n.indexOf(":");return[n.substring(1,e),n.slice(e+1)]}const ize=typeof document>"u"?null:document.documentElement;function PF(n){const e=n.parentNode||n.host||null;return e===ize?null:e}let Ru=null,bJ=!1;function wJ(n,e){for(;e;){if(e===n)return!0;e=PF(e)}return!1}function EJ(n,e,t){if(t)return Array.from(n.querySelectorAll(e));const r=n.querySelector(e);return r?[r]:[]}let OF=(()=>{class n{validateStyleProperty(t){return function sze(n){Ru||(Ru=function aze(){return typeof document<"u"?document.body:null}()||{},bJ=!!Ru.style&&"WebkitAppearance"in Ru.style);let e=!0;return Ru.style&&!function oze(n){return"ebkit"==n.substring(1,6)}(n)&&(e=n in Ru.style,!e&&bJ&&(e="Webkit"+n.charAt(0).toUpperCase()+n.slice(1)in Ru.style)),e}(t)}containsElement(t,r){return wJ(t,r)}getParentElement(t){return PF(t)}query(t,r,i){return EJ(t,r,i)}computeStyle(t,r,i){return i||""}animate(t,r,i,o,s,a=[],l){return new eg(i,o)}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac})}return n})();class FF{static NOOP=new OF}class LF{}const VF="ng-enter",BT="ng-leave",UT="ng-trigger",zT=".ng-trigger",TJ="ng-animating",BF=".ng-animating";function aa(n){if("number"==typeof n)return n;const e=n.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:UF(parseFloat(e[1]),e[2])}function UF(n,e){return"s"===e?1e3*n:n}function jT(n,e,t){return n.hasOwnProperty("duration")?n:function dze(n,e,t){let i,o=0,s="";if("string"==typeof n){const a=n.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===a)return e.push(_J()),{duration:0,delay:0,easing:""};i=UF(parseFloat(a[1]),a[2]);const l=a[3];null!=l&&(o=UF(parseFloat(l),a[4]));const c=a[5];c&&(s=c)}else i=n;if(!t){let a=!1,l=e.length;i<0&&(e.push(function TUe(){return new O(3100,!1)}()),a=!0),o<0&&(e.push(function CUe(){return new O(3101,!1)}()),a=!0),a&&e.splice(l,0,_J())}return{duration:i,delay:o,easing:s}}(n,e,t)}function us(n,e,t){e.forEach((r,i)=>{const o=jF(i);t&&!t.has(i)&&t.set(i,n.style[o]),n.style[o]=r})}function Mu(n,e){e.forEach((t,r)=>{const i=jF(r);n.style[i]=""})}function Y_(n){return Array.isArray(n)?1==n.length?n[0]:function MIe(n,e=null){return{type:we.Sequence,steps:n,options:e}}(n):n}const zF=new RegExp("{{\\s*(.+?)\\s*}}","g");function xJ(n){let e=[];if("string"==typeof n){let t;for(;t=zF.exec(n);)e.push(t[1]);zF.lastIndex=0}return e}function X_(n,e,t){const r=`${n}`,i=r.replace(zF,(o,s)=>{let a=e[s];return null==a&&(t.push(function SUe(){return new O(3003,!1)}()),a=""),a.toString()});return i==r?n:i}const pze=/-+([a-z0-9])/g;function jF(n){return n.replace(pze,(...e)=>e[1].toUpperCase())}function Li(n,e,t){switch(e.type){case we.Trigger:return n.visitTrigger(e,t);case we.State:return n.visitState(e,t);case we.Transition:return n.visitTransition(e,t);case we.Sequence:return n.visitSequence(e,t);case we.Group:return n.visitGroup(e,t);case we.Animate:return n.visitAnimate(e,t);case we.Keyframes:return n.visitKeyframes(e,t);case we.Style:return n.visitStyle(e,t);case we.Reference:return n.visitReference(e,t);case we.AnimateChild:return n.visitAnimateChild(e,t);case we.AnimateRef:return n.visitAnimateRef(e,t);case we.Query:return n.visitQuery(e,t);case we.Stagger:return n.visitStagger(e,t);default:throw function DUe(){return new O(3004,!1)}()}}function HF(n,e){return window.getComputedStyle(n)[e]}const _ze=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 SJ extends LF{normalizePropertyName(e,t){return jF(e)}normalizeStyleValue(e,t,r,i){let o="";const s=r.toString().trim();if(_ze.has(t)&&0!==r&&"0"!==r)if("number"==typeof r)o="px";else{const a=r.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&0==a[1].length&&i.push(function AUe(){return new O(3005,!1)}())}return s+o}}const qT=new Set(["true","1"]),WT=new Set(["false","0"]);function DJ(n,e){const t=qT.has(n)||WT.has(n),r=qT.has(e)||WT.has(e);return(i,o)=>{let s="*"==n||n==i,a="*"==e||e==o;return!s&&t&&"boolean"==typeof i&&(s=i?qT.has(n):WT.has(n)),!a&&r&&"boolean"==typeof o&&(a=o?qT.has(e):WT.has(e)),s&&a}}const wze=new RegExp("s*:selfs*,?","g");function $F(n,e,t,r){return new Eze(n).build(e,t,r)}class Eze{_driver;constructor(e){this._driver=e}build(e,t,r){const i=new Cze(t);return this._resetContextStyleTimingState(i),Li(this,Y_(e),i)}_resetContextStyleTimingState(e){e.currentQuerySelector="",e.collectedStyles=new Map,e.collectedStyles.set("",new Map),e.currentTime=0}visitTrigger(e,t){let r=t.queryCount=0,i=t.depCount=0;const o=[],s=[];return"@"==e.name.charAt(0)&&t.errors.push(function RUe(){return new O(3006,!1)}()),e.definitions.forEach(a=>{if(this._resetContextStyleTimingState(t),a.type==we.State){const l=a,c=l.name;c.toString().split(/\s*,\s*/).forEach(u=>{l.name=u,o.push(this.visitState(l,t))}),l.name=c}else if(a.type==we.Transition){const l=this.visitTransition(a,t);r+=l.queryCount,i+=l.depCount,s.push(l)}else t.errors.push(function MUe(){return new O(3007,!1)}())}),{type:we.Trigger,name:e.name,states:o,transitions:s,queryCount:r,depCount:i,options:null}}visitState(e,t){const r=this.visitStyle(e.styles,t),i=e.options&&e.options.params||null;if(r.containsDynamicStyles){const o=new Set,s=i||{};r.styles.forEach(a=>{a instanceof Map&&a.forEach(l=>{xJ(l).forEach(c=>{s.hasOwnProperty(c)||o.add(c)})})}),o.size&&t.errors.push(function kUe(){return new O(3008,!1)}(0,o.values()))}return{type:we.State,name:e.name,style:r,options:i?{params:i}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;const r=Li(this,Y_(e.animation),t),i=function yze(n,e){const t=[];return"string"==typeof n?n.split(/\s*,\s*/).forEach(r=>function vze(n,e,t){if(":"==n[0]){const l=function bze(n,e){switch(n){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,r)=>parseFloat(r)>parseFloat(t);case":decrement":return(t,r)=>parseFloat(r) *"}}(n,t);if("function"==typeof l)return void e.push(l);n=l}const r=n.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==r||r.length<4)return t.push(function zUe(){return new O(3015,!1)}()),e;const i=r[1],o=r[2],s=r[3];e.push(DJ(i,s)),"<"==o[0]&&("*"!=i||"*"!=s)&&e.push(DJ(s,i))}(r,t,e)):t.push(n),t}(e.expr,t.errors);return{type:we.Transition,matchers:i,animation:r,queryCount:t.queryCount,depCount:t.depCount,options:ku(e.options)}}visitSequence(e,t){return{type:we.Sequence,steps:e.steps.map(r=>Li(this,r,t)),options:ku(e.options)}}visitGroup(e,t){const r=t.currentTime;let i=0;const o=e.steps.map(s=>{t.currentTime=r;const a=Li(this,s,t);return i=Math.max(i,t.currentTime),a});return t.currentTime=i,{type:we.Group,steps:o,options:ku(e.options)}}visitAnimate(e,t){const r=function Sze(n,e){if(n.hasOwnProperty("duration"))return n;if("number"==typeof n)return qF(jT(n,e).duration,0,"");const t=n;if(t.split(/\s+/).some(o=>"{"==o.charAt(0)&&"{"==o.charAt(1))){const o=qF(0,0,"");return o.dynamic=!0,o.strValue=t,o}const i=jT(t,e);return qF(i.duration,i.delay,i.easing)}(e.timings,t.errors);t.currentAnimateTimings=r;let i,o=e.styles?e.styles:Ps({});if(o.type==we.Keyframes)i=this.visitKeyframes(o,t);else{let s=e.styles,a=!1;if(!s){a=!0;const c={};r.easing&&(c.easing=r.easing),s=Ps(c)}t.currentTime+=r.duration+r.delay;const l=this.visitStyle(s,t);l.isEmptyStep=a,i=l}return t.currentAnimateTimings=null,{type:we.Animate,timings:r,style:i,options:null}}visitStyle(e,t){const r=this._makeStyleAst(e,t);return this._validateStyleAst(r,t),r}_makeStyleAst(e,t){const r=[],i=Array.isArray(e.styles)?e.styles:[e.styles];for(let a of i)"string"==typeof a?a===Ns?r.push(a):t.errors.push(new O(3002,!1)):r.push(new Map(Object.entries(a)));let o=!1,s=null;return r.forEach(a=>{if(a instanceof Map&&(a.has("easing")&&(s=a.get("easing"),a.delete("easing")),!o))for(let l of a.values())if(l.toString().indexOf("{{")>=0){o=!0;break}}),{type:we.Style,styles:r,easing:s,offset:e.offset,containsDynamicStyles:o,options:null}}_validateStyleAst(e,t){const r=t.currentAnimateTimings;let i=t.currentTime,o=t.currentTime;r&&o>0&&(o-=r.duration+r.delay),e.styles.forEach(s=>{"string"!=typeof s&&s.forEach((a,l)=>{const c=t.collectedStyles.get(t.currentQuerySelector),u=c.get(l);let d=!0;u&&(o!=i&&o>=u.startTime&&i<=u.endTime&&(t.errors.push(function PUe(){return new O(3010,!1)}()),d=!1),o=u.startTime),d&&c.set(l,{startTime:o,endTime:i}),t.options&&function fze(n,e,t){const r=e.params||{},i=xJ(n);i.length&&i.forEach(o=>{r.hasOwnProperty(o)||t.push(function xUe(){return new O(3001,!1)}())})}(a,t.options,t.errors)})})}visitKeyframes(e,t){const r={type:we.Keyframes,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push(function OUe(){return new O(3011,!1)}()),r;let o=0;const s=[];let a=!1,l=!1,c=0;const u=e.steps.map(E=>{const C=this._makeStyleAst(E,t);let R=null!=C.offset?C.offset:function xze(n){if("string"==typeof n)return null;let e=null;if(Array.isArray(n))n.forEach(t=>{if(t instanceof Map&&t.has("offset")){const r=t;e=parseFloat(r.get("offset")),r.delete("offset")}});else if(n instanceof Map&&n.has("offset")){const t=n;e=parseFloat(t.get("offset")),t.delete("offset")}return e}(C.styles),V=0;return null!=R&&(o++,V=C.offset=R),l=l||V<0||V>1,a=a||V0&&o{const R=f>0?C==p?1:f*C:s[C],V=R*v;t.currentTime=m+_.delay+V,_.duration=V,this._validateStyleAst(E,t),E.offset=R,r.styles.push(E)}),r}visitReference(e,t){return{type:we.Reference,animation:Li(this,Y_(e.animation),t),options:ku(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:we.AnimateChild,options:ku(e.options)}}visitAnimateRef(e,t){return{type:we.AnimateRef,animation:this.visitReference(e.animation,t),options:ku(e.options)}}visitQuery(e,t){const r=t.currentQuerySelector,i=e.options||{};t.queryCount++,t.currentQuery=e;const[o,s]=function Ize(n){const e=!!n.split(/\s*,\s*/).find(t=>":self"==t);return e&&(n=n.replace(wze,"")),n=n.replace(/@\*/g,zT).replace(/@\w+/g,t=>zT+"-"+t.slice(1)).replace(/:animating/g,BF),[n,e]}(e.selector);t.currentQuerySelector=r.length?r+" "+o:o,Fi(t.collectedStyles,t.currentQuerySelector,new Map);const a=Li(this,Y_(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=r,{type:we.Query,selector:o,limit:i.limit||0,optional:!!i.optional,includeSelf:s,animation:a,originalSelector:e.selector,options:ku(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push(function BUe(){return new O(3013,!1)}());const r="full"===e.timings?{duration:0,delay:0,easing:"full"}:jT(e.timings,t.errors,!0);return{type:we.Stagger,animation:Li(this,Y_(e.animation),t),timings:r,options:null}}}class Cze{errors;queryCount=0;depCount=0;currentTransition=null;currentQuery=null;currentQuerySelector=null;currentAnimateTimings=null;currentTime=0;collectedStyles=new Map;options=null;unsupportedCSSPropertiesFound=new Set;constructor(e){this.errors=e}}function ku(n){return n?(n={...n}).params&&(n.params=function Tze(n){return n?{...n}:null}(n.params)):n={},n}function qF(n,e,t){return{duration:n,delay:e,easing:t}}function WF(n,e,t,r,i,o,s=null,a=!1){return{type:1,element:n,keyframes:e,preStyleProps:t,postStyleProps:r,duration:i,delay:o,totalTime:i+o,easing:s,subTimeline:a}}class GT{_map=new Map;get(e){return this._map.get(e)||[]}append(e,t){let r=this._map.get(e);r||this._map.set(e,r=[]),r.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}}const Rze=new RegExp(":enter","g"),kze=new RegExp(":leave","g");function GF(n,e,t,r,i,o=new Map,s=new Map,a,l,c=[]){return(new Nze).buildKeyframes(n,e,t,r,i,o,s,a,l,c)}class Nze{buildKeyframes(e,t,r,i,o,s,a,l,c,u=[]){c=c||new GT;const d=new KF(e,t,c,i,o,u,[]);d.options=l;const f=l.delay?aa(l.delay):0;d.currentTimeline.delayNextStep(f),d.currentTimeline.setStyles([s],null,d.errors,l),Li(this,r,d);const p=d.timelines.filter(m=>m.containsAnimation());if(p.length&&a.size){let m;for(let _=p.length-1;_>=0;_--){const v=p[_];if(v.element===t){m=v;break}}m&&!m.allowOnlyTimelineStyles()&&m.setStyles([a],null,d.errors,l)}return p.length?p.map(m=>m.buildKeyframes()):[WF(t,[],[],[],0,f,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){const r=t.subInstructions.get(t.element);if(r){const i=t.createSubContext(e.options),o=t.currentTimeline.currentTime,s=this._visitSubInstructions(r,i,i.options);o!=s&&t.transformIntoNewTimeline(s)}t.previousNode=e}visitAnimateRef(e,t){const r=t.createSubContext(e.options);r.transformIntoNewTimeline(),this._applyAnimationRefDelays([e.options,e.animation.options],t,r),this.visitReference(e.animation,r),t.transformIntoNewTimeline(r.currentTimeline.currentTime),t.previousNode=e}_applyAnimationRefDelays(e,t,r){for(const i of e){const o=i?.delay;if(o){const s="number"==typeof o?o:aa(X_(o,i?.params??{},t.errors));r.delayNextStep(s)}}}_visitSubInstructions(e,t,r){let o=t.currentTimeline.currentTime;const s=null!=r.duration?aa(r.duration):null,a=null!=r.delay?aa(r.delay):null;return 0!==s&&e.forEach(l=>{const c=t.appendInstructionToTimeline(l,s,a);o=Math.max(o,c.duration+c.delay)}),o}visitReference(e,t){t.updateOptions(e.options,!0),Li(this,e.animation,t),t.previousNode=e}visitSequence(e,t){const r=t.subContextCount;let i=t;const o=e.options;if(o&&(o.params||o.delay)&&(i=t.createSubContext(o),i.transformIntoNewTimeline(),null!=o.delay)){i.previousNode.type==we.Style&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=KT);const s=aa(o.delay);i.delayNextStep(s)}e.steps.length&&(e.steps.forEach(s=>Li(this,s,i)),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>r&&i.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){const r=[];let i=t.currentTimeline.currentTime;const o=e.options&&e.options.delay?aa(e.options.delay):0;e.steps.forEach(s=>{const a=t.createSubContext(e.options);o&&a.delayNextStep(o),Li(this,s,a),i=Math.max(i,a.currentTimeline.currentTime),r.push(a.currentTimeline)}),r.forEach(s=>t.currentTimeline.mergeTimelineCollectedStyles(s)),t.transformIntoNewTimeline(i),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){const r=e.strValue;return jT(t.params?X_(r,t.params,t.errors):r,t.errors)}return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){const r=t.currentAnimateTimings=this._visitTiming(e.timings,t),i=t.currentTimeline;r.delay&&(t.incrementTime(r.delay),i.snapshotCurrentStyles());const o=e.style;o.type==we.Keyframes?this.visitKeyframes(o,t):(t.incrementTime(r.duration),this.visitStyle(o,t),i.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){const r=t.currentTimeline,i=t.currentAnimateTimings;!i&&r.hasCurrentStyleProperties()&&r.forwardFrame();const o=i&&i.easing||e.easing;e.isEmptyStep?r.applyEmptyStep(o):r.setStyles(e.styles,o,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){const r=t.currentAnimateTimings,i=t.currentTimeline.duration,o=r.duration,a=t.createSubContext().currentTimeline;a.easing=r.easing,e.styles.forEach(l=>{a.forwardTime((l.offset||0)*o),a.setStyles(l.styles,l.easing,t.errors,t.options),a.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(a),t.transformIntoNewTimeline(i+o),t.previousNode=e}visitQuery(e,t){const r=t.currentTimeline.currentTime,i=e.options||{},o=i.delay?aa(i.delay):0;o&&(t.previousNode.type===we.Style||0==r&&t.currentTimeline.hasCurrentStyleProperties())&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=KT);let s=r;const a=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!i.optional,t.errors);t.currentQueryTotal=a.length;let l=null;a.forEach((c,u)=>{t.currentQueryIndex=u;const d=t.createSubContext(e.options,c);o&&d.delayNextStep(o),c===t.element&&(l=d.currentTimeline),Li(this,e.animation,d),d.currentTimeline.applyStylesToKeyframe(),s=Math.max(s,d.currentTimeline.currentTime)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(s),l&&(t.currentTimeline.mergeTimelineCollectedStyles(l),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){const r=t.parentContext,i=t.currentTimeline,o=e.timings,s=Math.abs(o.duration),a=s*(t.currentQueryTotal-1);let l=s*t.currentQueryIndex;switch(o.duration<0?"reverse":o.easing){case"reverse":l=a-l;break;case"full":l=r.currentStaggerTime}const u=t.currentTimeline;l&&u.delayNextStep(l);const d=u.currentTime;Li(this,e.animation,t),t.previousNode=e,r.currentStaggerTime=i.currentTime-d+(i.startTime-r.currentTimeline.startTime)}}const KT={};class KF{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=KT;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(e,t,r,i,o,s,a,l){this._driver=e,this.element=t,this.subInstructions=r,this._enterClassName=i,this._leaveClassName=o,this.errors=s,this.timelines=a,this.currentTimeline=l||new QT(this._driver,t,0),a.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;const r=e;let i=this.options;null!=r.duration&&(i.duration=aa(r.duration)),null!=r.delay&&(i.delay=aa(r.delay));const o=r.params;if(o){let s=i.params;s||(s=this.options.params={}),Object.keys(o).forEach(a=>{(!t||!s.hasOwnProperty(a))&&(s[a]=X_(o[a],s,this.errors))})}}_copyOptions(){const e={};if(this.options){const t=this.options.params;if(t){const r=e.params={};Object.keys(t).forEach(i=>{r[i]=t[i]})}}return e}createSubContext(e=null,t,r){const i=t||this.element,o=new KF(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,r||0));return o.previousNode=this.previousNode,o.currentAnimateTimings=this.currentAnimateTimings,o.options=this._copyOptions(),o.updateOptions(e),o.currentQueryIndex=this.currentQueryIndex,o.currentQueryTotal=this.currentQueryTotal,o.parentContext=this,this.subContextCount++,o}transformIntoNewTimeline(e){return this.previousNode=KT,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,r){const i={duration:t??e.duration,delay:this.currentTimeline.currentTime+(r??0)+e.delay,easing:""},o=new Pze(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,i,e.stretchStartingKeyframe);return this.timelines.push(o),i}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,r,i,o,s){let a=[];if(i&&a.push(this.element),e.length>0){e=(e=e.replace(Rze,"."+this._enterClassName)).replace(kze,"."+this._leaveClassName);let c=this._driver.query(this.element,e,1!=r);0!==r&&(c=r<0?c.slice(c.length+r,c.length):c.slice(0,r)),a.push(...c)}return!o&&0==a.length&&s.push(function UUe(){return new O(3014,!1)}()),a}}class QT{_driver;element;startTime;_elementTimelineStylesLookup;duration=0;easing=null;_previousKeyframe=new Map;_currentKeyframe=new Map;_keyframes=new Map;_styleSummary=new Map;_localTimelineStyles=new Map;_globalTimelineStyles;_pendingStyles=new Map;_backFill=new Map;_currentEmptyStepKeyframe=null;constructor(e,t,r,i){this._driver=e,this.element=t,this.startTime=r,this._elementTimelineStylesLookup=i,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,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(e){const t=1===this._keyframes.size&&this._pendingStyles.size;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new QT(this._driver,e,t||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(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles.set(e,t),this._globalTimelineStyles.set(e,t),this._styleSummary.set(e,{time:this.currentTime,value:t})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&this._previousKeyframe.set("easing",e);for(let[t,r]of this._globalTimelineStyles)this._backFill.set(t,r||Ns),this._currentKeyframe.set(t,Ns);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,r,i){t&&this._previousKeyframe.set("easing",t);const o=i&&i.params||{},s=function Oze(n,e){const t=new Map;let r;return n.forEach(i=>{if("*"===i){r??=e.keys();for(let o of r)t.set(o,Ns)}else for(let[o,s]of i)t.set(o,s)}),t}(e,this._globalTimelineStyles);for(let[a,l]of s){const c=X_(l,o,r);this._pendingStyles.set(a,c),this._localTimelineStyles.has(a)||this._backFill.set(a,this._globalTimelineStyles.get(a)??Ns),this._updateStyle(a,c)}}applyStylesToKeyframe(){0!=this._pendingStyles.size&&(this._pendingStyles.forEach((e,t)=>{this._currentKeyframe.set(t,e)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((e,t)=>{this._currentKeyframe.has(t)||this._currentKeyframe.set(t,e)}))}snapshotCurrentStyles(){for(let[e,t]of this._localTimelineStyles)this._pendingStyles.set(e,t),this._updateStyle(e,t)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){e._styleSummary.forEach((t,r)=>{const i=this._styleSummary.get(r);(!i||t.time>i.time)&&this._updateStyle(r,t.value)})}buildKeyframes(){this.applyStylesToKeyframe();const e=new Set,t=new Set,r=1===this._keyframes.size&&0===this.duration;let i=[];this._keyframes.forEach((a,l)=>{const c=new Map([...this._backFill,...a]);c.forEach((u,d)=>{"!"===u?e.add(d):u===Ns&&t.add(d)}),r||c.set("offset",l/this.duration),i.push(c)});const o=[...e.values()],s=[...t.values()];if(r){const a=i[0],l=new Map(a);a.set("offset",0),l.set("offset",1),i=[a,l]}return WF(this.element,i,o,s,this.duration,this.startTime,this.easing,!1)}}class Pze extends QT{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(e,t,r,i,o,s,a=!1){super(e,t,s.delay),this.keyframes=r,this.preStyleProps=i,this.postStyleProps=o,this._stretchStartingKeyframe=a,this.timings={duration:s.duration,delay:s.delay,easing:s.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:r,easing:i}=this.timings;if(this._stretchStartingKeyframe&&t){const o=[],s=r+t,a=t/s,l=new Map(e[0]);l.set("offset",0),o.push(l);const c=new Map(e[0]);c.set("offset",MJ(a)),o.push(c);const u=e.length-1;for(let d=1;d<=u;d++){let f=new Map(e[d]);const p=f.get("offset");f.set("offset",MJ((t+p*r)/s)),o.push(f)}r=s,t=0,i="",e=o}return WF(this.element,e,this.preStyleProps,this.postStyleProps,r,t,i,!0)}}function MJ(n,e=3){const t=Math.pow(10,e-1);return Math.round(n*t)/t}function kJ(n,e,t,r,i,o,s,a,l,c,u,d,f){return{type:0,element:n,triggerName:e,isRemovalTransition:i,fromState:t,fromStyles:o,toState:r,toStyles:s,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:u,totalTime:d,errors:f}}const QF={};class NJ{_triggerName;ast;_stateStyles;constructor(e,t,r){this._triggerName=e,this.ast=t,this._stateStyles=r}match(e,t,r,i){return function Fze(n,e,t,r,i){return n.some(o=>o(e,t,r,i))}(this.ast.matchers,e,t,r,i)}buildStyles(e,t,r){let i=this._stateStyles.get("*");return void 0!==e&&(i=this._stateStyles.get(e?.toString())||i),i?i.buildStyles(t,r):new Map}build(e,t,r,i,o,s,a,l,c,u){const d=[],f=this.ast.options&&this.ast.options.params||QF,m=this.buildStyles(r,a&&a.params||QF,d),_=l&&l.params||QF,v=this.buildStyles(i,_,d),E=new Set,C=new Map,R=new Map,V="void"===i,H={params:PJ(_,f),delay:this.ast.options?.delay},Q=u?[]:GF(e,t,this.ast.animation,o,s,m,v,H,c,d);let S=0;return Q.forEach(I=>{S=Math.max(I.duration+I.delay,S)}),d.length?kJ(t,this._triggerName,r,i,V,m,v,[],[],C,R,S,d):(Q.forEach(I=>{const x=I.element,A=Fi(C,x,new Set);I.preStyleProps.forEach(P=>A.add(P));const M=Fi(R,x,new Set);I.postStyleProps.forEach(P=>M.add(P)),x!==t&&E.add(x)}),kJ(t,this._triggerName,r,i,V,m,v,Q,[...E.values()],C,R,S))}}function PJ(n,e){const t={...e};return Object.entries(n).forEach(([r,i])=>{null!=i&&(t[r]=i)}),t}class Lze{styles;defaultParams;normalizer;constructor(e,t,r){this.styles=e,this.defaultParams=t,this.normalizer=r}buildStyles(e,t){const r=new Map,i=PJ(e,this.defaultParams);return this.styles.styles.forEach(o=>{"string"!=typeof o&&o.forEach((s,a)=>{s&&(s=X_(s,i,t));const l=this.normalizer.normalizePropertyName(a,t);s=this.normalizer.normalizeStyleValue(a,l,s,t),r.set(a,s)})}),r}}class Bze{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(e,t,r){this.name=e,this.ast=t,this._normalizer=r,t.states.forEach(i=>{this.states.set(i.name,new Lze(i.style,i.options&&i.options.params||{},r))}),OJ(this.states,"true","1"),OJ(this.states,"false","0"),t.transitions.forEach(i=>{this.transitionFactories.push(new NJ(e,i,this.states))}),this.fallbackTransition=function Uze(n,e){return new NJ(n,{type:we.Transition,animation:{type:we.Sequence,steps:[],options:null},matchers:[(s,a)=>!0],options:null,queryCount:0,depCount:0},e)}(e,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,r,i){return this.transitionFactories.find(s=>s.match(e,t,r,i))||null}matchStyles(e,t,r){return this.fallbackTransition.buildStyles(e,t,r)}}function OJ(n,e,t){n.has(e)?n.has(t)||n.set(t,n.get(e)):n.has(t)&&n.set(e,n.get(t))}const zze=new GT;class jze{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(e,t,r){this.bodyNode=e,this._driver=t,this._normalizer=r}register(e,t){const r=[],o=$F(this._driver,t,r,[]);if(r.length)throw function GUe(){return new O(3503,!1)}();this._animations.set(e,o)}_buildPlayer(e,t,r){const i=e.element,o=yJ(this._normalizer,e.keyframes,t,r);return this._driver.animate(i,o,e.duration,e.delay,e.easing,[],!0)}create(e,t,r={}){const i=[],o=this._animations.get(e);let s;const a=new Map;if(o?(s=GF(this._driver,t,o,VF,BT,new Map,new Map,r,zze,i),s.forEach(u=>{const d=Fi(a,u.element,new Map);u.postStyleProps.forEach(f=>d.set(f,null))})):(i.push(function KUe(){return new O(3300,!1)}()),s=[]),i.length)throw function QUe(){return new O(3504,!1)}();a.forEach((u,d)=>{u.forEach((f,p)=>{u.set(p,this._driver.computeStyle(d,p,Ns))})});const c=Ll(s.map(u=>{const d=a.get(u.element);return this._buildPlayer(u,new Map,d)}));return this._playersById.set(e,c),c.onDestroy(()=>this.destroy(e)),this.players.push(c),c}destroy(e){const t=this._getPlayer(e);t.destroy(),this._playersById.delete(e);const r=this.players.indexOf(t);r>=0&&this.players.splice(r,1)}_getPlayer(e){const t=this._playersById.get(e);if(!t)throw function YUe(){return new O(3301,!1)}();return t}listen(e,t,r,i){const o=NF(t,"","","");return MF(this._getPlayer(e),r,o,i),()=>{}}command(e,t,r,i){if("register"==r)return void this.register(e,i[0]);if("create"==r)return void this.create(e,t,i[0]||{});const o=this._getPlayer(e);switch(r){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(i[0]));break;case"destroy":this.destroy(e)}}}const FJ="ng-animate-queued",YF="ng-animate-disabled",Gze=[],LJ={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Kze={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},To="__ng_removed";class XF{namespaceId;value;options;get params(){return this.options.params}constructor(e,t=""){this.namespaceId=t;const r=e&&e.hasOwnProperty("value");if(this.value=function Zze(n){return n??null}(r?e.value:e),r){const{value:o,...s}=e;this.options=s}else this.options={};this.options.params||(this.options.params={})}absorbOptions(e){const t=e.params;if(t){const r=this.options.params;Object.keys(t).forEach(i=>{null==r[i]&&(r[i]=t[i])})}}}const Z_="void",ZF=new XF(Z_);class Qze{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(e,t,r){this.id=e,this.hostElement=t,this._engine=r,this._hostClassName="ng-tns-"+e,oo(t,this._hostClassName)}listen(e,t,r,i){if(!this._triggers.has(t))throw function XUe(){return new O(3302,!1)}();if(null==r||0==r.length)throw function ZUe(){return new O(3303,!1)}();if(!function Jze(n){return"start"==n||"done"==n}(r))throw function JUe(){return new O(3400,!1)}();const o=Fi(this._elementListeners,e,[]),s={name:t,phase:r,callback:i};o.push(s);const a=Fi(this._engine.statesByElement,e,new Map);return a.has(t)||(oo(e,UT),oo(e,UT+"-"+t),a.set(t,ZF)),()=>{this._engine.afterFlush(()=>{const l=o.indexOf(s);l>=0&&o.splice(l,1),this._triggers.has(t)||a.delete(t)})}}register(e,t){return!this._triggers.has(e)&&(this._triggers.set(e,t),!0)}_getTrigger(e){const t=this._triggers.get(e);if(!t)throw function eze(){return new O(3401,!1)}();return t}trigger(e,t,r,i=!0){const o=this._getTrigger(t),s=new JF(this.id,t,e);let a=this._engine.statesByElement.get(e);a||(oo(e,UT),oo(e,UT+"-"+t),this._engine.statesByElement.set(e,a=new Map));let l=a.get(t);const c=new XF(r,this.id);if(!(r&&r.hasOwnProperty("value"))&&l&&c.absorbOptions(l.options),a.set(t,c),l||(l=ZF),c.value!==Z_&&l.value===c.value){if(!function nje(n,e){const t=Object.keys(n),r=Object.keys(e);if(t.length!=r.length)return!1;for(let i=0;i{Mu(e,v),us(e,E)})}return}const f=Fi(this._engine.playersByElement,e,[]);f.forEach(_=>{_.namespaceId==this.id&&_.triggerName==t&&_.queued&&_.destroy()});let p=o.matchTransition(l.value,c.value,e,c.params),m=!1;if(!p){if(!i)return;p=o.fallbackTransition,m=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:p,fromState:l,toState:c,player:s,isFallbackTransition:m}),m||(oo(e,FJ),s.onStart(()=>{Nf(e,FJ)})),s.onDone(()=>{let _=this.players.indexOf(s);_>=0&&this.players.splice(_,1);const v=this._engine.playersByElement.get(e);if(v){let E=v.indexOf(s);E>=0&&v.splice(E,1)}}),this.players.push(s),f.push(s),s}deregister(e){this._triggers.delete(e),this._engine.statesByElement.forEach(t=>t.delete(e)),this._elementListeners.forEach((t,r)=>{this._elementListeners.set(r,t.filter(i=>i.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);const t=this._engine.playersByElement.get(e);t&&(t.forEach(r=>r.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){const r=this._engine.driver.query(e,zT,!0);r.forEach(i=>{if(i[To])return;const o=this._engine.fetchNamespacesByElement(i);o.size?o.forEach(s=>s.triggerLeaveAnimation(i,t,!1,!0)):this.clearElementCache(i)}),this._engine.afterFlushAnimationsDone(()=>r.forEach(i=>this.clearElementCache(i)))}triggerLeaveAnimation(e,t,r,i){const o=this._engine.statesByElement.get(e),s=new Map;if(o){const a=[];if(o.forEach((l,c)=>{if(s.set(c,l.value),this._triggers.has(c)){const u=this.trigger(e,c,Z_,i);u&&a.push(u)}}),a.length)return this._engine.markElementAsRemoved(this.id,e,!0,t,s),r&&Ll(a).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){const t=this._elementListeners.get(e),r=this._engine.statesByElement.get(e);if(t&&r){const i=new Set;t.forEach(o=>{const s=o.name;if(i.has(s))return;i.add(s);const l=this._triggers.get(s).fallbackTransition,c=r.get(s)||ZF,u=new XF(Z_),d=new JF(this.id,s,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:s,transition:l,fromState:c,toState:u,player:d,isFallbackTransition:!0})})}}removeNode(e,t){const r=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let i=!1;if(r.totalAnimations){const o=r.players.length?r.playersByQueriedElement.get(e):[];if(o&&o.length)i=!0;else{let s=e;for(;s=s.parentNode;)if(r.statesByElement.get(s)){i=!0;break}}}if(this.prepareLeaveAnimationListeners(e),i)r.markElementAsRemoved(this.id,e,!1,t);else{const o=e[To];(!o||o===LJ)&&(r.afterFlush(()=>this.clearElementCache(e)),r.destroyInnerAnimations(e),r._onRemovalComplete(e,t))}}insertNode(e,t){oo(e,this._hostClassName)}drainQueuedTransitions(e){const t=[];return this._queue.forEach(r=>{const i=r.player;if(i.destroyed)return;const o=r.element,s=this._elementListeners.get(o);s&&s.forEach(a=>{if(a.name==r.triggerName){const l=NF(o,r.triggerName,r.fromState.value,r.toState.value);l._data=e,MF(r.player,a.phase,l,a.callback)}}),i.markedForDestroy?this._engine.afterFlush(()=>{i.destroy()}):t.push(r)}),this._queue=[],t.sort((r,i)=>{const o=r.transition.ast.depCount,s=i.transition.ast.depCount;return 0==o||0==s?o-s:this._engine.driver.containsElement(r.element,i.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}}class Yze{bodyNode;driver;_normalizer;players=[];newHostElements=new Map;playersByElement=new Map;playersByQueriedElement=new Map;statesByElement=new Map;disabledNodes=new Set;totalAnimations=0;totalQueuedPlayers=0;_namespaceLookup={};_namespaceList=[];_flushFns=[];_whenQuietFns=[];namespacesByHostElement=new Map;collectedEnterElements=[];collectedLeaveElements=[];onRemovalComplete=(e,t)=>{};_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}constructor(e,t,r){this.bodyNode=e,this.driver=t,this._normalizer=r}get queuedPlayers(){const e=[];return this._namespaceList.forEach(t=>{t.players.forEach(r=>{r.queued&&e.push(r)})}),e}createNamespace(e,t){const r=new Qze(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(r,t):(this.newHostElements.set(t,r),this.collectEnterElement(t)),this._namespaceLookup[e]=r}_balanceNamespaceList(e,t){const r=this._namespaceList,i=this.namespacesByHostElement;if(r.length-1>=0){let s=!1,a=this.driver.getParentElement(t);for(;a;){const l=i.get(a);if(l){const c=r.indexOf(l);r.splice(c+1,0,e),s=!0;break}a=this.driver.getParentElement(a)}s||r.unshift(e)}else r.push(e);return i.set(t,e),e}register(e,t){let r=this._namespaceLookup[e];return r||(r=this.createNamespace(e,t)),r}registerTrigger(e,t,r){let i=this._namespaceLookup[e];i&&i.register(t,r)&&this.totalAnimations++}destroy(e,t){e&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{const r=this._fetchNamespace(e);this.namespacesByHostElement.delete(r.hostElement);const i=this._namespaceList.indexOf(r);i>=0&&this._namespaceList.splice(i,1),r.destroy(t),delete this._namespaceLookup[e]}))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){const t=new Set,r=this.statesByElement.get(e);if(r)for(let i of r.values())if(i.namespaceId){const o=this._fetchNamespace(i.namespaceId);o&&t.add(o)}return t}trigger(e,t,r,i){if(YT(t)){const o=this._fetchNamespace(e);if(o)return o.trigger(t,r,i),!0}return!1}insertNode(e,t,r,i){if(!YT(t))return;const o=t[To];if(o&&o.setForRemoval){o.setForRemoval=!1,o.setForMove=!0;const s=this.collectedLeaveElements.indexOf(t);s>=0&&this.collectedLeaveElements.splice(s,1)}if(e){const s=this._fetchNamespace(e);s&&s.insertNode(t,r)}i&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),oo(e,YF)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),Nf(e,YF))}removeNode(e,t,r){if(YT(t)){const i=e?this._fetchNamespace(e):null;i?i.removeNode(t,r):this.markElementAsRemoved(e,t,!1,r);const o=this.namespacesByHostElement.get(t);o&&o.id!==e&&o.removeNode(t,r)}else this._onRemovalComplete(t,r)}markElementAsRemoved(e,t,r,i,o){this.collectedLeaveElements.push(t),t[To]={namespaceId:e,setForRemoval:i,hasAnimation:r,removedBeforeQueried:!1,previousTriggersValues:o}}listen(e,t,r,i,o){return YT(t)?this._fetchNamespace(e).listen(t,r,i,o):()=>{}}_buildInstruction(e,t,r,i,o){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,r,i,e.fromState.options,e.toState.options,t,o)}destroyInnerAnimations(e){let t=this.driver.query(e,zT,!0);t.forEach(r=>this.destroyActiveAnimationsForElement(r)),0!=this.playersByQueriedElement.size&&(t=this.driver.query(e,BF,!0),t.forEach(r=>this.finishActiveQueriedAnimationOnElement(r)))}destroyActiveAnimationsForElement(e){const t=this.playersByElement.get(e);t&&t.forEach(r=>{r.queued?r.markedForDestroy=!0:r.destroy()})}finishActiveQueriedAnimationOnElement(e){const t=this.playersByQueriedElement.get(e);t&&t.forEach(r=>r.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return Ll(this.players).onDone(()=>e());e()})}processLeaveNode(e){const t=e[To];if(t&&t.setForRemoval){if(e[To]=LJ,t.namespaceId){this.destroyInnerAnimations(e);const r=this._fetchNamespace(t.namespaceId);r&&r.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}e.classList?.contains(YF)&&this.markElementAsDisabled(e,!1),this.driver.query(e,".ng-animate-disabled",!0).forEach(r=>{this.markElementAsDisabled(r,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((r,i)=>this._balanceNamespaceList(r,i)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let r=0;rr()),this._flushFns=[],this._whenQuietFns.length){const r=this._whenQuietFns;this._whenQuietFns=[],t.length?Ll(t).onDone(()=>{r.forEach(i=>i())}):r.forEach(i=>i())}}reportError(e){throw function tze(){return new O(3402,!1)}()}_flushAnimations(e,t){const r=new GT,i=[],o=new Map,s=[],a=new Map,l=new Map,c=new Map,u=new Set;this.disabledNodes.forEach(ae=>{u.add(ae);const ce=this.driver.query(ae,".ng-animate-queued",!0);for(let he=0;he{const he=VF+_++;m.set(ce,he),ae.forEach(Ue=>oo(Ue,he))});const v=[],E=new Set,C=new Set;for(let ae=0;aeE.add(Ue)):C.add(ce))}const R=new Map,V=UJ(f,Array.from(E));V.forEach((ae,ce)=>{const he=BT+_++;R.set(ce,he),ae.forEach(Ue=>oo(Ue,he))}),e.push(()=>{p.forEach((ae,ce)=>{const he=m.get(ce);ae.forEach(Ue=>Nf(Ue,he))}),V.forEach((ae,ce)=>{const he=R.get(ce);ae.forEach(Ue=>Nf(Ue,he))}),v.forEach(ae=>{this.processLeaveNode(ae)})});const H=[],Q=[];for(let ae=this._namespaceList.length-1;ae>=0;ae--)this._namespaceList[ae].drainQueuedTransitions(t).forEach(he=>{const Ue=he.player,En=he.element;if(H.push(Ue),this.collectedEnterElements.length){const un=En[To];if(un&&un.setForMove){if(un.previousTriggersValues&&un.previousTriggersValues.has(he.triggerName)){const ua=un.previousTriggersValues.get(he.triggerName),pi=this.statesByElement.get(he.element);if(pi&&pi.has(he.triggerName)){const da=pi.get(he.triggerName);da.value=ua,pi.set(he.triggerName,da)}}return void Ue.destroy()}}const ao=!d||!this.driver.containsElement(d,En),cn=R.get(En),Vt=m.get(En),Bt=this._buildInstruction(he,r,Vt,cn,ao);if(Bt.errors&&Bt.errors.length)return void Q.push(Bt);if(ao)return Ue.onStart(()=>Mu(En,Bt.fromStyles)),Ue.onDestroy(()=>us(En,Bt.toStyles)),void i.push(Ue);if(he.isFallbackTransition)return Ue.onStart(()=>Mu(En,Bt.fromStyles)),Ue.onDestroy(()=>us(En,Bt.toStyles)),void i.push(Ue);const Bl=[];Bt.timelines.forEach(un=>{un.stretchStartingKeyframe=!0,this.disabledNodes.has(un.element)||Bl.push(un)}),Bt.timelines=Bl,r.append(En,Bt.timelines),s.push({instruction:Bt,player:Ue,element:En}),Bt.queriedElements.forEach(un=>Fi(a,un,[]).push(Ue)),Bt.preStyleProps.forEach((un,ua)=>{if(un.size){let pi=l.get(ua);pi||l.set(ua,pi=new Set),un.forEach((da,Ul)=>pi.add(Ul))}}),Bt.postStyleProps.forEach((un,ua)=>{let pi=c.get(ua);pi||c.set(ua,pi=new Set),un.forEach((da,Ul)=>pi.add(Ul))})});if(Q.length){const ae=[];Q.forEach(ce=>{ae.push(function nze(){return new O(3505,!1)}())}),H.forEach(ce=>ce.destroy()),this.reportError(ae)}const S=new Map,I=new Map;s.forEach(ae=>{const ce=ae.element;r.has(ce)&&(I.set(ce,ce),this._beforeAnimationBuild(ae.player.namespaceId,ae.instruction,S))}),i.forEach(ae=>{const ce=ae.element;this._getPreviousPlayers(ce,!1,ae.namespaceId,ae.triggerName,null).forEach(Ue=>{Fi(S,ce,[]).push(Ue),Ue.destroy()})});const x=v.filter(ae=>jJ(ae,l,c)),A=new Map;BJ(A,this.driver,C,c,Ns).forEach(ae=>{jJ(ae,l,c)&&x.push(ae)});const P=new Map;p.forEach((ae,ce)=>{BJ(P,this.driver,new Set(ae),l,"!")}),x.forEach(ae=>{const ce=A.get(ae),he=P.get(ae);A.set(ae,new Map([...ce?.entries()??[],...he?.entries()??[]]))});const D=[],so=[],Vl={};s.forEach(ae=>{const{element:ce,player:he,instruction:Ue}=ae;if(r.has(ce)){if(u.has(ce))return he.onDestroy(()=>us(ce,Ue.toStyles)),he.disabled=!0,he.overrideTotalTime(Ue.totalTime),void i.push(he);let En=Vl;if(I.size>1){let cn=ce;const Vt=[];for(;cn=cn.parentNode;){const Bt=I.get(cn);if(Bt){En=Bt;break}Vt.push(cn)}Vt.forEach(Bt=>I.set(Bt,En))}const ao=this._buildAnimation(he.namespaceId,Ue,S,o,P,A);if(he.setRealPlayer(ao),En===Vl)D.push(he);else{const cn=this.playersByElement.get(En);cn&&cn.length&&(he.parentPlayer=Ll(cn)),i.push(he)}}else Mu(ce,Ue.fromStyles),he.onDestroy(()=>us(ce,Ue.toStyles)),so.push(he),u.has(ce)&&i.push(he)}),so.forEach(ae=>{const ce=o.get(ae.element);if(ce&&ce.length){const he=Ll(ce);ae.setRealPlayer(he)}}),i.forEach(ae=>{ae.parentPlayer?ae.syncPlayerEvents(ae.parentPlayer):ae.destroy()});for(let ae=0;ae!ao.destroyed);En.length?eje(this,ce,En):this.processLeaveNode(ce)}return v.length=0,D.forEach(ae=>{this.players.push(ae),ae.onDone(()=>{ae.destroy();const ce=this.players.indexOf(ae);this.players.splice(ce,1)}),ae.play()}),D}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,r,i,o){let s=[];if(t){const a=this.playersByQueriedElement.get(e);a&&(s=a)}else{const a=this.playersByElement.get(e);if(a){const l=!o||o==Z_;a.forEach(c=>{c.queued||!l&&c.triggerName!=i||s.push(c)})}}return(r||i)&&(s=s.filter(a=>!(r&&r!=a.namespaceId||i&&i!=a.triggerName))),s}_beforeAnimationBuild(e,t,r){const o=t.element,s=t.isRemovalTransition?void 0:e,a=t.isRemovalTransition?void 0:t.triggerName;for(const l of t.timelines){const c=l.element,u=c!==o,d=Fi(r,c,[]);this._getPreviousPlayers(c,u,s,a,t.toState).forEach(p=>{const m=p.getRealPlayer();m.beforeDestroy&&m.beforeDestroy(),p.destroy(),d.push(p)})}Mu(o,t.fromStyles)}_buildAnimation(e,t,r,i,o,s){const a=t.triggerName,l=t.element,c=[],u=new Set,d=new Set,f=t.timelines.map(m=>{const _=m.element;u.add(_);const v=_[To];if(v&&v.removedBeforeQueried)return new eg(m.duration,m.delay);const E=_!==l,C=function tje(n){const e=[];return zJ(n,e),e}((r.get(_)||Gze).map(S=>S.getRealPlayer())).filter(S=>!!S.element&&S.element===_),R=o.get(_),V=s.get(_),H=yJ(this._normalizer,m.keyframes,R,V),Q=this._buildPlayer(m,H,C);if(m.subTimeline&&i&&d.add(_),E){const S=new JF(e,a,_);S.setRealPlayer(Q),c.push(S)}return Q});c.forEach(m=>{Fi(this.playersByQueriedElement,m.element,[]).push(m),m.onDone(()=>function Xze(n,e,t){let r=n.get(e);if(r){if(r.length){const i=r.indexOf(t);r.splice(i,1)}0==r.length&&n.delete(e)}return r}(this.playersByQueriedElement,m.element,m))}),u.forEach(m=>oo(m,TJ));const p=Ll(f);return p.onDestroy(()=>{u.forEach(m=>Nf(m,TJ)),us(l,t.toStyles)}),d.forEach(m=>{Fi(i,m,[]).push(p)}),p}_buildPlayer(e,t,r){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,r):new eg(e.duration,e.delay)}}class JF{namespaceId;triggerName;element;_player=new eg;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(e,t,r){this.namespaceId=e,this.triggerName=t,this.element=r}setRealPlayer(e){this._containsRealPlayer||(this._player=e,this._queuedCallbacks.forEach((t,r)=>{t.forEach(i=>MF(e,r,void 0,i))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){const t=this._player;t.triggerCallback&&e.onStart(()=>t.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,t){Fi(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}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(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){const t=this._player;t.triggerCallback&&t.triggerCallback(e)}}function YT(n){return n&&1===n.nodeType}function VJ(n,e){const t=n.style.display;return n.style.display=e??"none",t}function BJ(n,e,t,r,i){const o=[];t.forEach(l=>o.push(VJ(l)));const s=[];r.forEach((l,c)=>{const u=new Map;l.forEach(d=>{const f=e.computeStyle(c,d,i);u.set(d,f),(!f||0==f.length)&&(c[To]=Kze,s.push(c))}),n.set(c,u)});let a=0;return t.forEach(l=>VJ(l,o[a++])),s}function UJ(n,e){const t=new Map;if(n.forEach(a=>t.set(a,[])),0==e.length)return t;const i=new Set(e),o=new Map;function s(a){if(!a)return 1;let l=o.get(a);if(l)return l;const c=a.parentNode;return l=t.has(c)?c:i.has(c)?1:s(c),o.set(a,l),l}return e.forEach(a=>{const l=s(a);1!==l&&t.get(l).push(a)}),t}function oo(n,e){n.classList?.add(e)}function Nf(n,e){n.classList?.remove(e)}function eje(n,e,t){Ll(t).onDone(()=>n.processLeaveNode(e))}function zJ(n,e){for(let t=0;ti.add(o)):e.set(n,r),t.delete(n),!0}class J_{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(e,t)=>{};constructor(e,t,r){this._driver=t,this._normalizer=r,this._transitionEngine=new Yze(e.body,t,r),this._timelineEngine=new jze(e.body,t,r),this._transitionEngine.onRemovalComplete=(i,o)=>this.onRemovalComplete(i,o)}registerTrigger(e,t,r,i,o){const s=e+"-"+i;let a=this._triggerCache[s];if(!a){const l=[],u=$F(this._driver,o,l,[]);if(l.length)throw function qUe(){return new O(3404,!1)}();a=function Vze(n,e,t){return new Bze(n,e,t)}(i,u,this._normalizer),this._triggerCache[s]=a}this._transitionEngine.registerTrigger(t,i,a)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,r,i){this._transitionEngine.insertNode(e,t,r,i)}onRemove(e,t,r){this._transitionEngine.removeNode(e,t,r)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,r,i){if("@"==r.charAt(0)){const[o,s]=vJ(r);this._timelineEngine.command(o,t,s,i)}else this._transitionEngine.trigger(e,t,r,i)}listen(e,t,r,i,o){if("@"==r.charAt(0)){const[s,a]=vJ(r);return this._timelineEngine.listen(s,t,a,o)}return this._transitionEngine.listen(e,t,r,i,o)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(e){this._transitionEngine.afterFlushAnimationsDone(e)}}let ije=(()=>{class n{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(t,r,i){this._element=t,this._startStyles=r,this._endStyles=i;let o=n.initialStylesByElement.get(t);o||n.initialStylesByElement.set(t,o=new Map),this._initialStyles=o}start(){this._state<1&&(this._startStyles&&us(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(us(this._element,this._initialStyles),this._endStyles&&(us(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(n.initialStylesByElement.delete(this._element),this._startStyles&&(Mu(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Mu(this._element,this._endStyles),this._endStyles=null),us(this._element,this._initialStyles),this._state=3)}}return n})();function eL(n){let e=null;return n.forEach((t,r)=>{(function oje(n){return"display"===n||"position"===n})(r)&&(e=e||new Map,e.set(r,t))}),e}class HJ{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(e,t,r,i){this.element=e,this.keyframes=t,this.options=r,this._specialStyles=i,this._duration=r.duration,this._delay=r.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:new Map;const t=()=>this._onFinish();this.domPlayer.addEventListener("finish",t),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",t)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(e){const t=[];return e.forEach(r=>{t.push(Object.fromEntries(r))}),t}_triggerWebAnimation(e,t,r){return e.animate(this._convertKeyframesToObject(t),r)}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),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(e=>e()),this._onDestroyFns=[])}setPosition(e){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const e=new Map;this.hasStarted()&&this._finalKeyframe.forEach((r,i)=>{"offset"!==i&&e.set(i,this._finished?r:HF(this.element,i))}),this.currentSnapshot=e}triggerCallback(e){const t="start"===e?this._onStartFns:this._onDoneFns;t.forEach(r=>r()),t.length=0}}class $J{validateStyleProperty(e){return!0}validateAnimatableStyleProperty(e){return!0}containsElement(e,t){return wJ(e,t)}getParentElement(e){return PF(e)}query(e,t,r){return EJ(e,t,r)}computeStyle(e,t,r){return HF(e,t)}animate(e,t,r,i,o,s=[]){const l={duration:r,delay:i,fill:0==i?"both":"forwards"};o&&(l.easing=o);const c=new Map,u=s.filter(p=>p instanceof HJ);(function mze(n,e){return 0===n||0===e})(r,i)&&u.forEach(p=>{p.currentSnapshot.forEach((m,_)=>c.set(_,m))});let d=function hze(n){return n.length?n[0]instanceof Map?n:n.map(e=>new Map(Object.entries(e))):[]}(t).map(p=>new Map(p));d=function gze(n,e,t){if(t.size&&e.length){let r=e[0],i=[];if(t.forEach((o,s)=>{r.has(s)||i.push(s),r.set(s,o)}),i.length)for(let o=1;os.set(a,HF(n,a)))}}return e}(e,d,c);const f=function rje(n,e){let t=null,r=null;return Array.isArray(e)&&e.length?(t=eL(e[0]),e.length>1&&(r=eL(e[e.length-1]))):e instanceof Map&&(t=eL(e)),t||r?new ije(n,t,r):null}(e,d);return new HJ(e,d,l,f)}}const qJ="@.disabled";class WJ{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(e,t,r,i){this.namespaceId=e,this.delegate=t,this.engine=r,this._onDestroy=i}get data(){return this.delegate.data}destroyNode(e){this.delegate.destroyNode?.(e)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,r,i=!0){this.delegate.insertBefore(e,t,r),this.engine.onInsert(this.namespaceId,t,e,i)}removeChild(e,t,r){this.parentNode(t)&&this.engine.onRemove(this.namespaceId,t,this.delegate)}selectRootElement(e,t){return this.delegate.selectRootElement(e,t)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,t,r,i){this.delegate.setAttribute(e,t,r,i)}removeAttribute(e,t,r){this.delegate.removeAttribute(e,t,r)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,r,i){this.delegate.setStyle(e,t,r,i)}removeStyle(e,t,r){this.delegate.removeStyle(e,t,r)}setProperty(e,t,r){"@"==t.charAt(0)&&t==qJ?this.disableAnimations(e,!!r):this.delegate.setProperty(e,t,r)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,r,i){return this.delegate.listen(e,t,r,i)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}}class sje extends WJ{factory;constructor(e,t,r,i,o){super(t,r,i,o),this.factory=e,this.namespaceId=t}setProperty(e,t,r){"@"==t.charAt(0)?"."==t.charAt(1)&&t==qJ?this.disableAnimations(e,r=void 0===r||!!r):this.engine.process(this.namespaceId,e,t.slice(1),r):this.delegate.setProperty(e,t,r)}listen(e,t,r,i){if("@"==t.charAt(0)){const o=function aje(n){switch(n){case"body":return document.body;case"document":return document;case"window":return window;default:return n}}(e);let s=t.slice(1),a="";return"@"!=s.charAt(0)&&([s,a]=function lje(n){const e=n.indexOf(".");return[n.substring(0,e),n.slice(e+1)]}(s)),this.engine.listen(this.namespaceId,o,s,a,l=>{this.factory.scheduleListenerCallback(l._data||-1,r,l)})}return this.delegate.listen(e,t,r,i)}}class cje{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(e,t,r){this.delegate=e,this.engine=t,this._zone=r,t.onRemovalComplete=(i,o)=>{o?.removeChild(null,i)}}createRenderer(e,t){const i=this.delegate.createRenderer(e,t);if(!e||!t?.data?.animation){const c=this._rendererCache;let u=c.get(i);return u||(u=new WJ("",i,this.engine,()=>c.delete(i)),c.set(i,u)),u}const o=t.id,s=t.id+"-"+this._currentId;this._currentId++,this.engine.register(s,e);const a=c=>{Array.isArray(c)?c.forEach(a):this.engine.registerTrigger(o,s,e,c.name,c)};return t.data.animation.forEach(a),new sje(this,s,i,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(e,t,r){if(e>=0&&et(r));const i=this._animationCallbacksBuffer;0==i.length&&queueMicrotask(()=>{this._zone.run(()=>{i.forEach(o=>{const[s,a]=o;s(a)}),this._animationCallbacksBuffer=[]})}),i.push([t,r])}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()}componentReplaced(e){this.engine.flush(),this.delegate.componentReplaced?.(e)}}const fje=[{provide:FF,useFactory:()=>new $J},{provide:Ts,useValue:"BrowserAnimations"},...[{provide:LF,useFactory:function dje(){return new SJ}},{provide:J_,useClass:(()=>{class n extends J_{constructor(t,r,i){super(t,r,i)}ngOnDestroy(){this.flush()}static \u0275fac=function(r){return new(r||n)(me(Xe),me(FF),me(LF))};static \u0275prov=G({token:n,factory:n.\u0275fac})}return n})()},{provide:Aa,useFactory:function hje(n,e,t){return new cje(n,e,t)},deps:[$D,J_,ue]}]],KJ="firebasestorage.googleapis.com";class Zt extends Wo{constructor(e,t,r=0){super(tL(e),`Firebase Storage: ${t} (${tL(e)})`),this.status_=r,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,Zt.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return tL(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.message=this.customData.serverResponse?`${this._baseMessage}\n${this.customData.serverResponse}`:this._baseMessage}}var Gt=function(n){return n.UNKNOWN="unknown",n.OBJECT_NOT_FOUND="object-not-found",n.BUCKET_NOT_FOUND="bucket-not-found",n.PROJECT_NOT_FOUND="project-not-found",n.QUOTA_EXCEEDED="quota-exceeded",n.UNAUTHENTICATED="unauthenticated",n.UNAUTHORIZED="unauthorized",n.UNAUTHORIZED_APP="unauthorized-app",n.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",n.INVALID_CHECKSUM="invalid-checksum",n.CANCELED="canceled",n.INVALID_EVENT_NAME="invalid-event-name",n.INVALID_URL="invalid-url",n.INVALID_DEFAULT_BUCKET="invalid-default-bucket",n.NO_DEFAULT_BUCKET="no-default-bucket",n.CANNOT_SLICE_BLOB="cannot-slice-blob",n.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",n.NO_DOWNLOAD_URL="no-download-url",n.INVALID_ARGUMENT="invalid-argument",n.INVALID_ARGUMENT_COUNT="invalid-argument-count",n.APP_DELETED="app-deleted",n.INVALID_ROOT_OPERATION="invalid-root-operation",n.INVALID_FORMAT="invalid-format",n.INTERNAL_ERROR="internal-error",n.UNSUPPORTED_ENVIRONMENT="unsupported-environment",n}(Gt||{});function tL(n){return"storage/"+n}function rL(n){return new Zt(Gt.INVALID_ARGUMENT,n)}function JJ(){return new Zt(Gt.APP_DELETED,"The Firebase app was deleted.")}class Wr{constructor(e,t){this.bucket=e,this.path_=t}get path(){return this.path_}get isRoot(){return 0===this.path.length}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,t){let r;try{r=Wr.makeFromUrl(e,t)}catch{return new Wr(e,"")}if(""===r.path)return r;throw function Cje(n){return new Zt(Gt.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+n+"'.")}(e)}static makeFromUrl(e,t){let r=null;const i="([A-Za-z0-9.\\-_]+)",a=new RegExp("^gs://"+i+"(/(.*))?$","i");function c(V){V.path_=decodeURIComponent(V.path)}const d=t.replace(/[.]/g,"\\."),R=[{regex:a,indices:{bucket:1,path:3},postModify:function o(V){"/"===V.path.charAt(V.path.length-1)&&(V.path_=V.path_.slice(0,-1))}},{regex:new RegExp(`^https?://${d}/v[A-Za-z0-9_]+/b/${i}/o(/([^?#]*).*)?$`,"i"),indices:{bucket:1,path:3},postModify:c},{regex:new RegExp(`^https?://${t===KJ?"(?:storage.googleapis.com|storage.cloud.google.com)":t}/${i}/([^?#]*)`,"i"),indices:{bucket:1,path:2},postModify:c}];for(let V=0;Vt)throw rL(`Invalid value for '${n}'. Expected ${t} or less.`)}var Pf=function(n){return n[n.NO_ERROR=0]="NO_ERROR",n[n.NETWORK_ERROR=1]="NETWORK_ERROR",n[n.ABORT=2]="ABORT",n}(Pf||{});class Lje{constructor(e,t,r,i,o,s,a,l,c,u,d,f=!0){this.url_=e,this.method_=t,this.headers_=r,this.body_=i,this.successCodes_=o,this.additionalRetryCodes_=s,this.callback_=a,this.errorCallback_=l,this.timeout_=c,this.progressCallback_=u,this.connectionFactory_=d,this.retry=f,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((p,m)=>{this.resolve_=p,this.reject_=m,this.start_()})}start_(){const t=(r,i)=>{const o=this.resolve_,s=this.reject_,a=i.connection;if(i.wasSuccessCode)try{const l=this.callback_(a,a.getResponse());!function Pje(n){return void 0!==n}(l)?o():o(l)}catch(l){s(l)}else if(null!==a){const l=function nL(){return new Zt(Gt.UNKNOWN,"An unknown error occurred, please check the error payload for server response.")}();l.serverResponse=a.getErrorText(),s(this.errorCallback_?this.errorCallback_(a,l):l)}else s(i.canceled?this.appDelete_?JJ():function XJ(){return new Zt(Gt.CANCELED,"User canceled the upload/download.")}():function YJ(){return new Zt(Gt.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}())};this.canceled_?t(0,new JT(!1,null,!0)):this.backoffId_=function kje(n,e,t){let r=1,i=null,o=null,s=!1,a=0;function l(){return 2===a}let c=!1;function u(...v){c||(c=!0,e.apply(null,v))}function d(v){i=setTimeout(()=>{i=null,n(p,l())},v)}function f(){o&&clearTimeout(o)}function p(v,...E){if(c)return void f();if(v)return f(),void u.call(null,v,...E);if(l()||s)return f(),void u.call(null,v,...E);let R;r<64&&(r*=2),1===a?(a=2,R=0):R=1e3*(r+Math.random()),d(R)}let m=!1;function _(v){m||(m=!0,f(),!c&&(null!==i?(v||(a=2),clearTimeout(i),d(0)):v||(a=1)))}return d(0),o=setTimeout(()=>{s=!0,_(!0)},t),_}((r,i)=>{if(i)return void r(!1,new JT(!1,null,!0));const o=this.connectionFactory_();this.pendingConnection_=o;const s=a=>{null!==this.progressCallback_&&this.progressCallback_(a.loaded,a.lengthComputable?a.total:-1)};null!==this.progressCallback_&&o.addUploadProgressListener(s),o.send(this.url_,this.method_,this.body_,this.headers_).then(()=>{null!==this.progressCallback_&&o.removeUploadProgressListener(s),this.pendingConnection_=null;const a=o.getErrorCode()===Pf.NO_ERROR,l=o.getStatus();if(!a||function nee(n,e){const t=n>=500&&n<600,i=-1!==[408,429].indexOf(n),o=-1!==e.indexOf(n);return t||i||o}(l,this.additionalRetryCodes_)&&this.retry){const u=o.getErrorCode()===Pf.ABORT;return void r(!1,new JT(!1,null,u))}const c=-1!==this.successCodes_.indexOf(l);r(!0,new JT(c,o))})},t,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,null!==this.backoffId_&&function Nje(n){n(!1)}(this.backoffId_),null!==this.pendingConnection_&&this.pendingConnection_.abort()}}class JT{constructor(e,t,r){this.wasSuccessCode=e,this.connection=t,this.canceled=!!r}}class Nu{constructor(e,t){this._service=e,this._location=t instanceof Wr?t:Wr.makeFromUrl(t,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,t){return new Nu(e,t)}get root(){const e=new Wr(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return function aee(n){const e=n.lastIndexOf("/",n.length-2);return-1===e?n:n.slice(e+1)}(this._location.path)}get storage(){return this._service}get parent(){const e=function Xje(n){if(0===n.length)return null;const e=n.lastIndexOf("/");return-1===e?"":n.slice(0,e)}(this._location.path);if(null===e)return null;const t=new Wr(this._location.bucket,e);return new Nu(this._service,t)}_throwIfRoot(e){if(""===this._location.path)throw function Rje(n){return new Zt(Gt.INVALID_ROOT_OPERATION,"The operation '"+n+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}(e)}}function Eee(n,e){const t=e?.storageBucket;return null==t?null:Wr.makeFromBucketSpec(t,n)}class hL{constructor(e,t,r,i,o){this.app=e,this._authProvider=t,this._appCheckProvider=r,this._url=i,this._firebaseVersion=o,this._bucket=null,this._host=KJ,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,this._bucket=null!=i?Wr.makeFromBucketSpec(i,this._host):Eee(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,this._bucket=null!=this._url?Wr.makeFromBucketSpec(this._url,e):Eee(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){oL("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){oL("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}_getAuthToken(){var e=this;return T(function*(){if(e._overrideAuthToken)return e._overrideAuthToken;const t=e._authProvider.getImmediate({optional:!0});if(t){const r=yield t.getToken();if(null!==r)return r.accessToken}return null})()}_getAppCheckToken(){var e=this;return T(function*(){if(ai(e.app)&&e.app.settings.appCheckToken)return e.app.settings.appCheckToken;const t=e._appCheckProvider.getImmediate({optional:!0});return t?(yield t.getToken()).token:null})()}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new Nu(this,e)}_makeRequest(e,t,r,i,o=!0){if(this._deleted)return new Mje(JJ());{const s=function jje(n,e,t,r,i,o,s=!0){const a=function tee(n){const e=encodeURIComponent;let t="?";for(const r in n)n.hasOwnProperty(r)&&(t=t+(e(r)+"=")+e(n[r])+"&");return t=t.slice(0,-1),t}(n.urlParams),l=n.url+a,c=Object.assign({},n.headers);return function Uje(n,e){e&&(n["X-Firebase-GMPID"]=e)}(c,e),function Vje(n,e){null!==e&&e.length>0&&(n.Authorization="Firebase "+e)}(c,t),function Bje(n,e){n["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}(c,o),function zje(n,e){null!==e&&(n["X-Firebase-AppCheck"]=e)}(c,r),new Lje(l,n.method,c,n.body,n.successCodes,n.additionalRetryCodes,n.handler,n.errorHandler,n.timeout,n.progressCallback,i,s)}(e,this._appId,r,i,t,this._firebaseVersion,o);return this._requests.add(s),s.getPromise().then(()=>this._requests.delete(s),()=>this._requests.delete(s)),s}}makeRequestWithTokens(e,t){var r=this;return T(function*(){const[i,o]=yield Promise.all([r._getAuthToken(),r._getAppCheckToken()]);return r._makeRequest(e,t,i,o).getPromise()})()}}const Iee="@firebase/storage";function FHe(n=cE(),e){const r=cg(n=sn(n),"storage").getImmediate({identifier:e}),i=QW("storage");return i&&function LHe(n,e,t,r={}){!function OHe(n,e,t,r={}){n.host=`${e}:${t}`,n._protocol="http";const{mockUserToken:i}=r;i&&(n._overrideAuthToken="string"==typeof i?i:ZW(i,n.app.options.projectId))}(n,e,t,r)}(r,...i),r}function VHe(n,{instanceIdentifier:e}){const t=n.getProvider("app").getImmediate(),r=n.getProvider("auth-internal"),i=n.getProvider("app-check-internal");return new hL(t,r,i,e,Lc)}!function BHe(){Fs(new Go("storage",VHe,"PUBLIC").setMultipleInstances(!0)),Gn(Iee,"0.13.6",""),Gn(Iee,"0.13.6","esm2017")}();class fL{constructor(e){return e}}const pL=new B("angularfire2.storage-instances");function jHe(n){return(e,t)=>{const r=e.runOutsideAngular(()=>n(t));return new fL(r)}}const HHe={provide:class UHe{constructor(){return dE("storage")}},deps:[[new fn,pL]]},$He={provide:fL,useFactory:function zHe(n,e){const t=uE("storage",n,e);return t&&new fL(t)},deps:[[new fn,pL],Bc]},WHe=ir(FHe,!0),GHe={production:!1,firebase:{apiKey:"AIzaSyBETSM_xLRYrcFjoeslZt9YfRq2aR0E7I0",authDomain:"beaubuckman-e8c64.firebaseapp.com",projectId:"beaubuckman-e8c64",storageBucket:"beaubuckman-e",messagingSenderId:"780030349868",appId:"1:780030349868:web:943115deb9886538777789",measurementId:"MISSING_ENV_VAR".FIREBASE_MEASUREMENT_ID||"YOUR_MEASUREMENT_ID"}},KHe={providers:[function Jbe(n,...e){return Ui([{provide:gw,multi:!0,useValue:n},[],{provide:Xd,useFactory:Rq,deps:[bo]},{provide:Kp,multi:!0,useFactory:Mq},e.map(t=>t.\u0275providers)])}(IUe),function mje(){return On("NgEagerAnimations"),[...fje]}(),function O0e(n,...e){return Ui([k0e,N0e,{provide:PR,useFactory:P0e(n),multi:!0,deps:[ue,ze,hg,...e]}])}(()=>F0e(GHe.firebase)),function EAe(n,...e){return Gn("angularfire",dg.full,"auth"),Ui([wAe,bAe,{provide:p1,useFactory:vAe(n),multi:!0,deps:[ue,ze,hg,hE,[new fn,bE],...e]}])}(()=>CAe()),function B1e(n,...e){return Gn("angularfire",dg.full,"fst"),Ui([V1e,L1e,{provide:eO,useFactory:F1e(n),multi:!0,deps:[ue,ze,hg,hE,[new fn,f1],[new fn,bE],...e]}])}(()=>q1e()),function qHe(n,...e){return Gn("angularfire",dg.full,"gcs"),Ui([$He,HHe,{provide:pL,useFactory:jHe(n),multi:!0,deps:[ue,ze,hg,hE,[new fn,f1],[new fn,bE],...e]}])}(()=>WHe())]},QHe=["*",[["mat-toolbar-row"]]],YHe=["*","mat-toolbar-row"];let XHe=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["mat-toolbar-row"]],hostAttrs:[1,"mat-toolbar-row"],exportAs:["matToolbarRow"]})}return n})(),ZHe=(()=>{class n{_elementRef=b(je);_platform=b(rr);_document=b(Xe);color;_toolbarRows;constructor(){}ngAfterViewInit(){this._platform.isBrowser&&(this._checkToolbarMixedModes(),this._toolbarRows.changes.subscribe(()=>this._checkToolbarMixedModes()))}_checkToolbarMixedModes(){}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-toolbar"]],contentQueries:function(r,i,o){if(1&r&&$n(o,XHe,5),2&r){let s;Qe(s=Ye())&&(i._toolbarRows=s)}},hostAttrs:[1,"mat-toolbar"],hostVars:6,hostBindings:function(r,i){2&r&&(Fa(i.color?"mat-"+i.color:""),at("mat-toolbar-multiple-rows",i._toolbarRows.length>0)("mat-toolbar-single-row",0===i._toolbarRows.length))},inputs:{color:"color"},exportAs:["matToolbar"],ngContentSelectors:YHe,decls:2,vars:0,template:function(r,i){1&r&&(Hn(QHe),Ae(0),Ae(1,1))},styles:[".mat-toolbar{background:var(--mat-toolbar-container-background-color, var(--mat-sys-surface));color:var(--mat-toolbar-container-text-color, var(--mat-sys-on-surface))}.mat-toolbar,.mat-toolbar h1,.mat-toolbar h2,.mat-toolbar h3,.mat-toolbar h4,.mat-toolbar h5,.mat-toolbar h6{font-family:var(--mat-toolbar-title-text-font, var(--mat-sys-title-large-font));font-size:var(--mat-toolbar-title-text-size, var(--mat-sys-title-large-size));line-height:var(--mat-toolbar-title-text-line-height, var(--mat-sys-title-large-line-height));font-weight:var(--mat-toolbar-title-text-weight, var(--mat-sys-title-large-weight));letter-spacing:var(--mat-toolbar-title-text-tracking, var(--mat-sys-title-large-tracking));margin:0}@media(forced-colors: active){.mat-toolbar{outline:solid 1px}}.mat-toolbar .mat-form-field-underline,.mat-toolbar .mat-form-field-ripple,.mat-toolbar .mat-focused .mat-form-field-ripple{background-color:currentColor}.mat-toolbar .mat-form-field-label,.mat-toolbar .mat-focused .mat-form-field-label,.mat-toolbar .mat-select-value,.mat-toolbar .mat-select-arrow,.mat-toolbar .mat-form-field.mat-focused .mat-select-arrow{color:inherit}.mat-toolbar .mat-input-element{caret-color:currentColor}.mat-toolbar .mat-mdc-button-base.mat-mdc-button-base.mat-unthemed{--mdc-text-button-label-text-color:var(--mat-toolbar-container-text-color, var(--mat-sys-on-surface));--mdc-outlined-button-label-text-color:var(--mat-toolbar-container-text-color, var(--mat-sys-on-surface))}.mat-toolbar-row,.mat-toolbar-single-row{display:flex;box-sizing:border-box;padding:0 16px;width:100%;flex-direction:row;align-items:center;white-space:nowrap;height:var(--mat-toolbar-standard-height, 64px)}@media(max-width: 599px){.mat-toolbar-row,.mat-toolbar-single-row{height:var(--mat-toolbar-mobile-height, 56px)}}.mat-toolbar-multiple-rows{display:flex;box-sizing:border-box;flex-direction:column;width:100%;min-height:var(--mat-toolbar-standard-height, 64px)}@media(max-width: 599px){.mat-toolbar-multiple-rows{min-height:var(--mat-toolbar-mobile-height, 56px)}}"],encapsulation:2,changeDetection:0})}return n})(),JHe=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[gn,gn]})}return n})();const e$e=["tooltip"],Dee=new B("mat-tooltip-scroll-strategy",{providedIn:"root",factory:()=>{const n=b(pu);return()=>n.scrollStrategies.reposition({scrollThrottle:20})}}),n$e={provide:Dee,deps:[pu],useFactory:function t$e(n){return()=>n.scrollStrategies.reposition({scrollThrottle:20})}},i$e=new B("mat-tooltip-default-options",{providedIn:"root",factory:function r$e(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}}),Aee="tooltip-panel",Ree=ah({passive:!0});let c$e=(()=>{class n{_elementRef=b(je);_ngZone=b(ue);_platform=b(rr);_ariaDescriber=b(PEe);_focusMonitor=b(ZA);_dir=b(Gw);_injector=b(ze);_viewContainerRef=b(Ci);_defaultOptions=b(i$e,{optional:!0});_overlayRef;_tooltipInstance;_portal;_position="below";_positionAtOrigin=!1;_disabled=!1;_tooltipClass;_viewInitialized=!1;_pointerExitEventsInitialized=!1;_tooltipComponent=u$e;_viewportMargin=8;_currentPosition;_cssClassPrefix="mat-mdc";_ariaDescriptionPending;_dirSubscribed=!1;get position(){return this._position}set position(t){t!==this._position&&(this._position=t,this._overlayRef&&(this._updatePosition(this._overlayRef),this._tooltipInstance?.show(0),this._overlayRef.updatePosition()))}get positionAtOrigin(){return this._positionAtOrigin}set positionAtOrigin(t){this._positionAtOrigin=Qa(t),this._detach(),this._overlayRef=null}get disabled(){return this._disabled}set disabled(t){const r=Qa(t);this._disabled!==r&&(this._disabled=r,r?this.hide(0):this._setupPointerEnterEventsIfNeeded(),this._syncAriaDescription(this.message))}get showDelay(){return this._showDelay}set showDelay(t){this._showDelay=Y5(t)}_showDelay;get hideDelay(){return this._hideDelay}set hideDelay(t){this._hideDelay=Y5(t),this._tooltipInstance&&(this._tooltipInstance._mouseLeaveHideDelay=this._hideDelay)}_hideDelay;touchGestures="auto";get message(){return this._message}set message(t){const r=this._message;this._message=null!=t?String(t).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage()),this._syncAriaDescription(r)}_message="";get tooltipClass(){return this._tooltipClass}set tooltipClass(t){this._tooltipClass=t,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass)}_passiveListeners=[];_touchstartTimeout=null;_destroyed=new fe;_isDestroyed=!1;constructor(){const t=this._defaultOptions;t&&(this._showDelay=t.showDelay,this._hideDelay=t.hideDelay,t.position&&(this.position=t.position),t.positionAtOrigin&&(this.positionAtOrigin=t.positionAtOrigin),t.touchGestures&&(this.touchGestures=t.touchGestures),t.tooltipClass&&(this.tooltipClass=t.tooltipClass)),this._viewportMargin=8}ngAfterViewInit(){this._viewInitialized=!0,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(At(this._destroyed)).subscribe(t=>{t?"keyboard"===t&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0))})}ngOnDestroy(){const t=this._elementRef.nativeElement;this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),this._passiveListeners.forEach(([r,i])=>{t.removeEventListener(r,i,Ree)}),this._passiveListeners.length=0,this._destroyed.next(),this._destroyed.complete(),this._isDestroyed=!0,this._ariaDescriber.removeDescription(t,this.message,"tooltip"),this._focusMonitor.stopMonitoring(t)}show(t=this.showDelay,r){if(this.disabled||!this.message||this._isTooltipVisible())return void this._tooltipInstance?._cancelPendingAnimations();const i=this._createOverlay(r);this._detach(),this._portal=this._portal||new QI(this._tooltipComponent,this._viewContainerRef);const o=this._tooltipInstance=i.attach(this._portal).instance;o._triggerElement=this._elementRef.nativeElement,o._mouseLeaveHideDelay=this._hideDelay,o.afterHidden().pipe(At(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),o.show(t)}hide(t=this.hideDelay){const r=this._tooltipInstance;r&&(r.isVisible()?r.hide(t):(r._cancelPendingAnimations(),this._detach()))}toggle(t){this._isTooltipVisible()?this.hide():this.show(void 0,t)}_isTooltipVisible(){return!!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(t){if(this._overlayRef){const s=this._overlayRef.getConfig().positionStrategy;if((!this.positionAtOrigin||!t)&&s._origin instanceof je)return this._overlayRef;this._detach()}const r=this._injector.get(EQ).getAncestorScrollContainers(this._elementRef),i=this._injector.get(pu),o=i.position().flexibleConnectedTo(this.positionAtOrigin&&t||this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(r);return o.positionChanges.pipe(At(this._destroyed)).subscribe(s=>{this._updateCurrentPositionClass(s.connectionPair),this._tooltipInstance&&s.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0))}),this._overlayRef=i.create({direction:this._dir,positionStrategy:o,panelClass:`${this._cssClassPrefix}-${Aee}`,scrollStrategy:this._injector.get(Dee)()}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(At(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(At(this._destroyed)).subscribe(()=>this._tooltipInstance?._handleBodyInteraction()),this._overlayRef.keydownEvents().pipe(At(this._destroyed)).subscribe(s=>{this._isTooltipVisible()&&27===s.keyCode&&!Lw(s)&&(s.preventDefault(),s.stopPropagation(),this._ngZone.run(()=>this.hide(0)))}),this._defaultOptions?.disableTooltipInteractivity&&this._overlayRef.addPanelClass(`${this._cssClassPrefix}-tooltip-panel-non-interactive`),this._dirSubscribed||(this._dirSubscribed=!0,this._dir.change.pipe(At(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef)})),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}_updatePosition(t){const r=t.getConfig().positionStrategy,i=this._getOrigin(),o=this._getOverlayPosition();r.withPositions([this._addOffset({...i.main,...o.main}),this._addOffset({...i.fallback,...o.fallback})])}_addOffset(t){const i=!this._dir||"ltr"==this._dir.value;return"top"===t.originY?t.offsetY=-8:"bottom"===t.originY?t.offsetY=8:"start"===t.originX?t.offsetX=i?-8:8:"end"===t.originX&&(t.offsetX=i?8:-8),t}_getOrigin(){const t=!this._dir||"ltr"==this._dir.value,r=this.position;let i;"above"==r||"below"==r?i={originX:"center",originY:"above"==r?"top":"bottom"}:"before"==r||"left"==r&&t||"right"==r&&!t?i={originX:"start",originY:"center"}:("after"==r||"right"==r&&t||"left"==r&&!t)&&(i={originX:"end",originY:"center"});const{x:o,y:s}=this._invertPosition(i.originX,i.originY);return{main:i,fallback:{originX:o,originY:s}}}_getOverlayPosition(){const t=!this._dir||"ltr"==this._dir.value,r=this.position;let i;"above"==r?i={overlayX:"center",overlayY:"bottom"}:"below"==r?i={overlayX:"center",overlayY:"top"}:"before"==r||"left"==r&&t||"right"==r&&!t?i={overlayX:"end",overlayY:"center"}:("after"==r||"right"==r&&t||"left"==r&&!t)&&(i={overlayX:"start",overlayY:"center"});const{x:o,y:s}=this._invertPosition(i.overlayX,i.overlayY);return{main:i,fallback:{overlayX:o,overlayY:s}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),Cs(()=>{this._tooltipInstance&&this._overlayRef.updatePosition()},{injector:this._injector}))}_setTooltipClass(t){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=t,this._tooltipInstance._markForCheck())}_invertPosition(t,r){return"above"===this.position||"below"===this.position?"top"===r?r="bottom":"bottom"===r&&(r="top"):"end"===t?t="start":"start"===t&&(t="end"),{x:t,y:r}}_updateCurrentPositionClass(t){const{overlayY:r,originX:i,originY:o}=t;let s;if(s="center"===r?this._dir&&"rtl"===this._dir.value?"end"===i?"left":"right":"start"===i?"left":"right":"bottom"===r&&"top"===o?"above":"below",s!==this._currentPosition){const a=this._overlayRef;if(a){const l=`${this._cssClassPrefix}-${Aee}-`;a.removePanelClass(l+this._currentPosition),a.addPanelClass(l+s)}this._currentPosition=s}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._passiveListeners.length||(this._platformSupportsMouseEvents()?this._passiveListeners.push(["mouseenter",t=>{let r;this._setupPointerExitEventsIfNeeded(),void 0!==t.x&&void 0!==t.y&&(r=t),this.show(void 0,r)}]):"off"!==this.touchGestures&&(this._disableNativeGesturesIfNecessary(),this._passiveListeners.push(["touchstart",t=>{const r=t.targetTouches?.[0],i=r?{x:r.clientX,y:r.clientY}:void 0;this._setupPointerExitEventsIfNeeded(),this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this._touchstartTimeout=setTimeout(()=>{this._touchstartTimeout=null,this.show(void 0,i)},this._defaultOptions?.touchLongPressShowDelay??500)}])),this._addListeners(this._passiveListeners))}_setupPointerExitEventsIfNeeded(){if(this._pointerExitEventsInitialized)return;this._pointerExitEventsInitialized=!0;const t=[];if(this._platformSupportsMouseEvents())t.push(["mouseleave",r=>{const i=r.relatedTarget;(!i||!this._overlayRef?.overlayElement.contains(i))&&this.hide()}],["wheel",r=>this._wheelListener(r)]);else if("off"!==this.touchGestures){this._disableNativeGesturesIfNecessary();const r=()=>{this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions?.touchendHideDelay)};t.push(["touchend",r],["touchcancel",r])}this._addListeners(t),this._passiveListeners.push(...t)}_addListeners(t){t.forEach(([r,i])=>{this._elementRef.nativeElement.addEventListener(r,i,Ree)})}_platformSupportsMouseEvents(){return!this._platform.IOS&&!this._platform.ANDROID}_wheelListener(t){if(this._isTooltipVisible()){const r=this._injector.get(Xe).elementFromPoint(t.clientX,t.clientY),i=this._elementRef.nativeElement;r!==i&&!i.contains(r)&&this.hide()}}_disableNativeGesturesIfNecessary(){const t=this.touchGestures;if("off"!==t){const r=this._elementRef.nativeElement,i=r.style;("on"===t||"INPUT"!==r.nodeName&&"TEXTAREA"!==r.nodeName)&&(i.userSelect=i.msUserSelect=i.webkitUserSelect=i.MozUserSelect="none"),("on"===t||!r.draggable)&&(i.webkitUserDrag="none"),i.touchAction="none",i.webkitTapHighlightColor="transparent"}}_syncAriaDescription(t){this._ariaDescriptionPending||(this._ariaDescriptionPending=!0,this._ariaDescriber.removeDescription(this._elementRef.nativeElement,t,"tooltip"),this._isDestroyed||Cs({write:()=>{this._ariaDescriptionPending=!1,this.message&&!this.disabled&&this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip")}},{injector:this._injector}))}static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-mdc-tooltip-trigger"],hostVars:2,hostBindings:function(r,i){2&r&&at("mat-mdc-tooltip-disabled",i.disabled)},inputs:{position:[0,"matTooltipPosition","position"],positionAtOrigin:[0,"matTooltipPositionAtOrigin","positionAtOrigin"],disabled:[0,"matTooltipDisabled","disabled"],showDelay:[0,"matTooltipShowDelay","showDelay"],hideDelay:[0,"matTooltipHideDelay","hideDelay"],touchGestures:[0,"matTooltipTouchGestures","touchGestures"],message:[0,"matTooltip","message"],tooltipClass:[0,"matTooltipClass","tooltipClass"]},exportAs:["matTooltip"]})}return n})(),u$e=(()=>{class n{_changeDetectorRef=b(Uo);_elementRef=b(je);_isMultiline=!1;message;tooltipClass;_showTimeoutId;_hideTimeoutId;_triggerElement;_mouseLeaveHideDelay;_animationsDisabled;_tooltip;_closeOnInteraction=!1;_isVisible=!1;_onHide=new fe;_showAnimation="mat-mdc-tooltip-show";_hideAnimation="mat-mdc-tooltip-hide";constructor(){const t=b(Ts,{optional:!0});this._animationsDisabled="NoopAnimations"===t}show(t){null!=this._hideTimeoutId&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=setTimeout(()=>{this._toggleVisibility(!0),this._showTimeoutId=void 0},t)}hide(t){null!=this._showTimeoutId&&clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._toggleVisibility(!1),this._hideTimeoutId=void 0},t)}afterHidden(){return this._onHide}isVisible(){return this._isVisible}ngOnDestroy(){this._cancelPendingAnimations(),this._onHide.complete(),this._triggerElement=null}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0)}_markForCheck(){this._changeDetectorRef.markForCheck()}_handleMouseLeave({relatedTarget:t}){(!t||!this._triggerElement.contains(t))&&(this.isVisible()?this.hide(this._mouseLeaveHideDelay):this._finalizeAnimation(!1))}_onShow(){this._isMultiline=this._isTooltipMultiline(),this._markForCheck()}_isTooltipMultiline(){const t=this._elementRef.nativeElement.getBoundingClientRect();return t.height>24&&t.width>=200}_handleAnimationEnd({animationName:t}){(t===this._showAnimation||t===this._hideAnimation)&&this._finalizeAnimation(t===this._showAnimation)}_cancelPendingAnimations(){null!=this._showTimeoutId&&clearTimeout(this._showTimeoutId),null!=this._hideTimeoutId&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=this._hideTimeoutId=void 0}_finalizeAnimation(t){t?this._closeOnInteraction=!0:this.isVisible()||this._onHide.next()}_toggleVisibility(t){const r=this._tooltip.nativeElement,i=this._showAnimation,o=this._hideAnimation;if(r.classList.remove(t?o:i),r.classList.add(t?i:o),this._isVisible!==t&&(this._isVisible=t,this._changeDetectorRef.markForCheck()),t&&!this._animationsDisabled&&"function"==typeof getComputedStyle){const s=getComputedStyle(r);("0s"===s.getPropertyValue("animation-duration")||"none"===s.getPropertyValue("animation-name"))&&(this._animationsDisabled=!0)}t&&this._onShow(),this._animationsDisabled&&(r.classList.add("_mat-animation-noopable"),this._finalizeAnimation(t))}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-tooltip-component"]],viewQuery:function(r,i){if(1&r&&qn(e$e,7),2&r){let o;Qe(o=Ye())&&(i._tooltip=o.first)}},hostAttrs:["aria-hidden","true"],hostBindings:function(r,i){1&r&&Ve("mouseleave",function(s){return i._handleMouseLeave(s)})},decls:4,vars:4,consts:[["tooltip",""],[1,"mdc-tooltip","mat-mdc-tooltip",3,"animationend","ngClass"],[1,"mat-mdc-tooltip-surface","mdc-tooltip__surface"]],template:function(r,i){if(1&r){const o=La();W(0,"div",1,0),Ve("animationend",function(a){return vi(o),bi(i._handleAnimationEnd(a))}),W(2,"div",2),Oe(3),K()()}2&r&&(at("mdc-tooltip--multiline",i._isMultiline),De("ngClass",i.tooltipClass),re(3),zd(i.message))},dependencies:[RD],styles:['.mat-mdc-tooltip{position:relative;transform:scale(0);display:inline-flex}.mat-mdc-tooltip::before{content:"";top:0;right:0;bottom:0;left:0;z-index:-1;position:absolute}.mat-mdc-tooltip-panel-below .mat-mdc-tooltip::before{top:-8px}.mat-mdc-tooltip-panel-above .mat-mdc-tooltip::before{bottom:-8px}.mat-mdc-tooltip-panel-right .mat-mdc-tooltip::before{left:-8px}.mat-mdc-tooltip-panel-left .mat-mdc-tooltip::before{right:-8px}.mat-mdc-tooltip._mat-animation-noopable{animation:none;transform:scale(1)}.mat-mdc-tooltip-surface{word-break:normal;overflow-wrap:anywhere;padding:4px 8px;min-width:40px;max-width:200px;min-height:24px;max-height:40vh;box-sizing:border-box;overflow:hidden;text-align:center;will-change:transform,opacity;background-color:var(--mdc-plain-tooltip-container-color, var(--mat-sys-inverse-surface));color:var(--mdc-plain-tooltip-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mdc-plain-tooltip-container-shape, var(--mat-sys-corner-extra-small));font-family:var(--mdc-plain-tooltip-supporting-text-font, var(--mat-sys-body-small-font));font-size:var(--mdc-plain-tooltip-supporting-text-size, var(--mat-sys-body-small-size));font-weight:var(--mdc-plain-tooltip-supporting-text-weight, var(--mat-sys-body-small-weight));line-height:var(--mdc-plain-tooltip-supporting-text-line-height, var(--mat-sys-body-small-line-height));letter-spacing:var(--mdc-plain-tooltip-supporting-text-tracking, var(--mat-sys-body-small-tracking))}.mat-mdc-tooltip-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:left}[dir=rtl] .mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:right}.mat-mdc-tooltip-panel{line-height:normal}.mat-mdc-tooltip-panel.mat-mdc-tooltip-panel-non-interactive{pointer-events:none}@keyframes mat-mdc-tooltip-show{0%{opacity:0;transform:scale(0.8)}100%{opacity:1;transform:scale(1)}}@keyframes mat-mdc-tooltip-hide{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(0.8)}}.mat-mdc-tooltip-show{animation:mat-mdc-tooltip-show 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-mdc-tooltip-hide{animation:mat-mdc-tooltip-hide 75ms cubic-bezier(0.4, 0, 1, 1) forwards}'],encapsulation:2,changeDetection:0})}return n})(),d$e=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({providers:[n$e],imports:[nIe,ANe,gn,gn,oO]})}return n})(),h$e=(()=>{class n{document=b(Xe);THEME_KEY="preferred-theme";currentTheme=ti(this.getInitialTheme());constructor(){pm(()=>{this.document.body.classList.remove("light-theme","dark-theme"),this.document.body.classList.add(this.currentTheme()),localStorage.setItem(this.THEME_KEY,this.currentTheme())}),this.watchSystemTheme()}toggleTheme(){this.currentTheme.set("light-theme"===this.currentTheme()?"dark-theme":"light-theme")}getInitialTheme(){return localStorage.getItem(this.THEME_KEY)||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark-theme":"light-theme")}watchSystemTheme(){window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{localStorage.getItem(this.THEME_KEY)||this.currentTheme.set(t.matches?"dark-theme":"light-theme")})}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),f$e=(()=>{class n{themeService=b(h$e);static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["app-theme-toggle"]],decls:3,vars:2,consts:[["mat-icon-button","",1,"theme-toggle",3,"click","matTooltip"],[1,"theme-icon"]],template:function(r,i){1&r&&(W(0,"button",0),Ve("click",function(){return i.themeService.toggleTheme()}),W(1,"mat-icon",1),Oe(2),K()()),2&r&&(De("matTooltip","dark-theme"===i.themeService.currentTheme()?"Switch to light mode":"Switch to dark mode"),re(2),Va(" ","dark-theme"===i.themeService.currentTheme()?"light_mode":"dark_mode"," "))},dependencies:[za,yO,_O,hh,ATe,d$e,c$e],styles:[".theme-toggle[_ngcontent-%COMP%]{transition:transform .3s ease}.theme-toggle[_ngcontent-%COMP%]:hover{transform:rotate(15deg)}.theme-icon[_ngcontent-%COMP%]{transition:all .3s ease}"]})}return n})();function p$e(n,e){if(1&n){const t=La();W(0,"button",6),Ve("click",function(){return vi(t),bi(Ln().authService.signOut())}),Oe(1," Sign Out "),K()}}(function F_e(n,e){return xpe({rootComponent:n,...l4(e)})})((()=>{class n{authService=b(mf);static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["app-root"]],decls:9,vars:1,consts:[[1,"app-container"],["color","primary",1,"app-toolbar"],[1,"app-title"],[1,"toolbar-spacer"],["mat-flat-button","","color","primary"],[1,"app-content"],["mat-flat-button","","color","primary",3,"click"]],template:function(r,i){1&r&&(W(0,"div",0)(1,"mat-toolbar",1)(2,"span",2),Oe(3,"Blog App"),K(),Pe(4,"div",3)(5,"app-theme-toggle"),et(6,p$e,2,0,"button",4),K(),W(7,"main",5),Pe(8,"router-outlet"),K()()),2&r&&(re(6),Pt(i.authService.currentUser()?6:-1))},dependencies:[za,gA,JHe,ZHe,hh,dh,f$e],styles:[".app-container[_ngcontent-%COMP%]{min-height:100vh;display:flex;flex-direction:column}.app-toolbar[_ngcontent-%COMP%]{position:fixed;top:0;left:0;right:0;z-index:1000;transition:background-color .3s ease}.toolbar-spacer[_ngcontent-%COMP%]{flex:1 1 auto}.app-title[_ngcontent-%COMP%]{font-size:1.5rem;font-weight:300;letter-spacing:.5px}.app-content[_ngcontent-%COMP%]{margin-top:64px;flex:1;padding:20px;max-width:1200px;width:100%;margin-left:auto;margin-right:auto;box-sizing:border-box}"]})}return n})(),KHe).catch(n=>console.error(n))}},zf=>{zf(zf.s=791)}]); \ No newline at end of file +"use strict";(self.webpackChunkblog_app=self.webpackChunkblog_app||[]).push([[792],{791:()=>{function zf(n,e,t,r,i,o,s){try{var a=n[o](s),l=a.value}catch(c){return void t(c)}a.done?e(l):Promise.resolve(l).then(r,i)}function T(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(l){zf(o,r,i,s,a,"next",l)}function a(l){zf(o,r,i,s,a,"throw",l)}s(void 0)})}}function yy(n,e){return Object.is(n,e)}let hn=null,jf=!1,yC=1;const In=Symbol("SIGNAL");function Se(n){const e=hn;return hn=n,e}const $l={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,kind:"unknown",producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function Vu(n){if(jf)throw new Error("");if(null===hn)return;hn.consumerOnSignalRead(n);const e=hn.nextProducerIndex++;wy(hn),en.nextProducerIndex;)n.producerNode.pop(),n.producerLastReadVersion.pop(),n.producerIndexOfThis.pop()}}function $f(n){wy(n);for(let e=0;e0}function wy(n){n.producerNode??=[],n.producerIndexOfThis??=[],n.producerLastReadVersion??=[]}function $L(n){n.liveConsumerNode??=[],n.liveConsumerIndexOfThis??=[]}function qL(n){return void 0!==n.producerNode}function WL(n){const e=Object.create(Nte);e.computation=n;const t=()=>{if(Hf(e),Vu(e),e.value===pa)throw e.error;return e.value};return t[In]=e,t}const Wl=Symbol("UNSET"),Uu=Symbol("COMPUTING"),pa=Symbol("ERRORED"),Nte={...$l,value:Wl,dirty:!0,error:null,equal:yy,kind:"computed",producerMustRecompute:n=>n.value===Wl||n.value===Uu,producerRecomputeValue(n){if(n.value===Uu)throw new Error("Detected cycle in computations.");const e=n.value;n.value=Uu;const t=ql(n);let r,i=!1;try{r=n.computation(),Se(null),i=e!==Wl&&e!==pa&&r!==pa&&n.equal(e,r)}catch(o){r=pa,n.error=o}finally{Bu(n,t)}i?n.value=e:(n.value=r,n.version++)}};let GL=function Pte(){throw new Error};function KL(){GL()}function Iy(n,e){zL()||KL(),n.equal(n.value,e)||(n.value=e,function Lte(n){n.version++,function kte(){yC++}(),UL(n)}(n))}const bC={...$l,equal:yy,value:void 0,kind:"signal"};const wC=()=>{};function kt(n){return"function"==typeof n}function EC(n){const t=n(r=>{Error.call(r),r.stack=(new Error).stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}const IC=EC(n=>function(t){n(this),this.message=t?`${t.length} errors occurred during unsubscription:\n${t.map((r,i)=>`${i+1}) ${r.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=t});function Ty(n,e){if(n){const t=n.indexOf(e);0<=t&&n.splice(t,1)}}class Kt{constructor(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let e;if(!this.closed){this.closed=!0;const{_parentage:t}=this;if(t)if(this._parentage=null,Array.isArray(t))for(const o of t)o.remove(this);else t.remove(this);const{initialTeardown:r}=this;if(kt(r))try{r()}catch(o){e=o instanceof IC?o.errors:[o]}const{_finalizers:i}=this;if(i){this._finalizers=null;for(const o of i)try{JL(o)}catch(s){e=e??[],s instanceof IC?e=[...e,...s.errors]:e.push(s)}}if(e)throw new IC(e)}}add(e){var t;if(e&&e!==this)if(this.closed)JL(e);else{if(e instanceof Kt){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(t=this._finalizers)&&void 0!==t?t:[]).push(e)}}_hasParent(e){const{_parentage:t}=this;return t===e||Array.isArray(t)&&t.includes(e)}_addParent(e){const{_parentage:t}=this;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e}_removeParent(e){const{_parentage:t}=this;t===e?this._parentage=null:Array.isArray(t)&&Ty(t,e)}remove(e){const{_finalizers:t}=this;t&&Ty(t,e),e instanceof Kt&&e._removeParent(this)}}Kt.EMPTY=(()=>{const n=new Kt;return n.closed=!0,n})();const XL=Kt.EMPTY;function ZL(n){return n instanceof Kt||n&&"closed"in n&&kt(n.remove)&&kt(n.add)&&kt(n.unsubscribe)}function JL(n){kt(n)?n():n.unsubscribe()}const Gl={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Cy={setTimeout(n,e,...t){const{delegate:r}=Cy;return r?.setTimeout?r.setTimeout(n,e,...t):setTimeout(n,e,...t)},clearTimeout(n){const{delegate:e}=Cy;return(e?.clearTimeout||clearTimeout)(n)},delegate:void 0};function eV(n){Cy.setTimeout(()=>{const{onUnhandledError:e}=Gl;if(!e)throw n;e(n)})}function TC(){}const Hte=CC("C",void 0,void 0);function CC(n,e,t){return{kind:n,value:e,error:t}}let Kl=null;function xy(n){if(Gl.useDeprecatedSynchronousErrorHandling){const e=!Kl;if(e&&(Kl={errorThrown:!1,error:null}),n(),e){const{errorThrown:t,error:r}=Kl;if(Kl=null,t)throw r}}else n()}class xC extends Kt{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,ZL(e)&&e.add(this)):this.destination=Yte}static create(e,t,r){return new Gf(e,t,r)}next(e){this.isStopped?DC(function qte(n){return CC("N",n,void 0)}(e),this):this._next(e)}error(e){this.isStopped?DC(function $te(n){return CC("E",void 0,n)}(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?DC(Hte,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(e){this.destination.next(e)}_error(e){try{this.destination.error(e)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const Gte=Function.prototype.bind;function SC(n,e){return Gte.call(n,e)}class Kte{constructor(e){this.partialObserver=e}next(e){const{partialObserver:t}=this;if(t.next)try{t.next(e)}catch(r){Sy(r)}}error(e){const{partialObserver:t}=this;if(t.error)try{t.error(e)}catch(r){Sy(r)}else Sy(e)}complete(){const{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(t){Sy(t)}}}class Gf extends xC{constructor(e,t,r){let i;if(super(),kt(e)||!e)i={next:e??void 0,error:t??void 0,complete:r??void 0};else{let o;this&&Gl.useDeprecatedNextContext?(o=Object.create(e),o.unsubscribe=()=>this.unsubscribe(),i={next:e.next&&SC(e.next,o),error:e.error&&SC(e.error,o),complete:e.complete&&SC(e.complete,o)}):i=e}this.destination=new Kte(i)}}function Sy(n){Gl.useDeprecatedSynchronousErrorHandling?function Wte(n){Gl.useDeprecatedSynchronousErrorHandling&&Kl&&(Kl.errorThrown=!0,Kl.error=n)}(n):eV(n)}function DC(n,e){const{onStoppedNotification:t}=Gl;t&&Cy.setTimeout(()=>t(n,e))}const Yte={closed:!0,next:TC,error:function Qte(n){throw n},complete:TC},AC="function"==typeof Symbol&&Symbol.observable||"@@observable";function ma(n){return n}function tV(n){return 0===n.length?ma:1===n.length?n[0]:function(t){return n.reduce((r,i)=>i(r),t)}}let vt=(()=>{class n{constructor(t){t&&(this._subscribe=t)}lift(t){const r=new n;return r.source=this,r.operator=t,r}subscribe(t,r,i){const o=function Jte(n){return n&&n instanceof xC||function Zte(n){return n&&kt(n.next)&&kt(n.error)&&kt(n.complete)}(n)&&ZL(n)}(t)?t:new Gf(t,r,i);return xy(()=>{const{operator:s,source:a}=this;o.add(s?s.call(o,a):a?this._subscribe(o):this._trySubscribe(o))}),o}_trySubscribe(t){try{return this._subscribe(t)}catch(r){t.error(r)}}forEach(t,r){return new(r=nV(r))((i,o)=>{const s=new Gf({next:a=>{try{t(a)}catch(l){o(l),s.unsubscribe()}},error:o,complete:i});this.subscribe(s)})}_subscribe(t){var r;return null===(r=this.source)||void 0===r?void 0:r.subscribe(t)}[AC](){return this}pipe(...t){return tV(t)(this)}toPromise(t){return new(t=nV(t))((r,i)=>{let o;this.subscribe(s=>o=s,s=>i(s),()=>r(o))})}}return n.create=e=>new n(e),n})();function nV(n){var e;return null!==(e=n??Gl.Promise)&&void 0!==e?e:Promise}const ene=EC(n=>function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});let fe=(()=>{class n extends vt{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(t){const r=new rV(this,this);return r.operator=t,r}_throwIfClosed(){if(this.closed)throw new ene}next(t){xy(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const r of this.currentObservers)r.next(t)}})}error(t){xy(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=t;const{observers:r}=this;for(;r.length;)r.shift().error(t)}})}complete(){xy(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:t}=this;for(;t.length;)t.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0}_trySubscribe(t){return this._throwIfClosed(),super._trySubscribe(t)}_subscribe(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)}_innerSubscribe(t){const{hasError:r,isStopped:i,observers:o}=this;return r||i?XL:(this.currentObservers=null,o.push(t),new Kt(()=>{this.currentObservers=null,Ty(o,t)}))}_checkFinalizedStatuses(t){const{hasError:r,thrownError:i,isStopped:o}=this;r?t.error(i):o&&t.complete()}asObservable(){const t=new vt;return t.source=this,t}}return n.create=(e,t)=>new rV(e,t),n})();class rV extends fe{constructor(e,t){super(),this.destination=e,this.source=t}next(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,e)}error(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,e)}complete(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)}_subscribe(e){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==r?r:XL}}class mi extends fe{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return!t.closed&&e.next(this._value),t}getValue(){const{hasError:e,thrownError:t,_value:r}=this;if(e)throw t;return this._throwIfClosed(),r}next(e){super.next(this._value=e)}}function iV(n){return kt(n?.lift)}function Jt(n){return e=>{if(iV(e))return e.lift(function(t){try{return n(t,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function zt(n,e,t,r,i){return new tne(n,e,t,r,i)}class tne extends xC{constructor(e,t,r,i,o,s){super(e),this.onFinalize=o,this.shouldUnsubscribe=s,this._next=t?function(a){try{t(a)}catch(l){e.error(l)}}:super._next,this._error=i?function(a){try{i(a)}catch(l){e.error(l)}finally{this.unsubscribe()}}:super._error,this._complete=r?function(){try{r()}catch(a){e.error(a)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:t}=this;super.unsubscribe(),!t&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}}}function Te(n,e){return Jt((t,r)=>{let i=0;t.subscribe(zt(r,o=>{r.next(n.call(e,o,i++))}))})}const oV="https://g.co/ng/security#xss";class O extends Error{code;constructor(e,t){super(function Ql(n,e){return`NG0${Math.abs(n)}${e?": "+e:""}`}(e,t)),this.code=e}}const Dy=Symbol("InputSignalNode#UNSET"),sV={...bC,transformFn:void 0,applyValueToInputSignal(n,e){Iy(n,e)}};function aV(n,e){const t=Object.create(sV);function r(){if(Vu(t),t.value===Dy)throw new O(-950,!1);return t.value}return t.value=n,t.transformFn=e?.transform,r[In]=t,r}function fs(n){return{toString:n}.toString()}const ju="__parameters__";function $u(n,e,t){return fs(()=>{const r=function RC(n){return function(...t){if(n){const r=n(...t);for(const i in r)this[i]=r[i]}}}(e);function i(...o){if(this instanceof i)return r.apply(this,o),this;const s=new i(...o);return a.annotation=s,a;function a(l,c,u){const d=l.hasOwnProperty(ju)?l[ju]:Object.defineProperty(l,ju,{value:[]})[ju];for(;d.length<=u;)d.push(null);return(d[u]=d[u]||[]).push(s),l}}return t&&(i.prototype=Object.create(t.prototype)),i.prototype.ngMetadataName=n,i.annotationCls=i,i})}const Nt=globalThis;function ct(n){for(let e in n)if(n[e]===ct)return e;throw Error("Could not find renamed property on target object.")}function nne(n,e){for(const t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function Mn(n){if("string"==typeof n)return n;if(Array.isArray(n))return`[${n.map(Mn).join(", ")}]`;if(null==n)return""+n;const e=n.overriddenName||n.name;if(e)return`${e}`;const t=n.toString();if(null==t)return""+t;const r=t.indexOf("\n");return r>=0?t.slice(0,r):t}function MC(n,e){return n?e?`${n} ${e}`:n:e||""}const rne=ct({__forward_ref__:ct});function ft(n){return n.__forward_ref__=ft,n.toString=function(){return Mn(this())},n}function ye(n){return Ay(n)?n():n}function Ay(n){return"function"==typeof n&&n.hasOwnProperty(rne)&&n.__forward_ref__===ft}function G(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function pt(n){return{providers:n.providers||[],imports:n.imports||[]}}function Ry(n){return cV(n,ky)||cV(n,uV)}function cV(n,e){return n.hasOwnProperty(e)?n[e]:null}function My(n){return n&&(n.hasOwnProperty(kC)||n.hasOwnProperty(cne))?n[kC]:null}const ky=ct({\u0275prov:ct}),kC=ct({\u0275inj:ct}),uV=ct({ngInjectableDef:ct}),cne=ct({ngInjectorDef:ct});class B{_desc;ngMetadataName="InjectionToken";\u0275prov;constructor(e,t){this._desc=e,this.\u0275prov=void 0,"number"==typeof t?this.__NG_ELEMENT_ID__=t:void 0!==t&&(this.\u0275prov=G({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}function OC(n){return n&&!!n.\u0275providers}const qu=ct({\u0275cmp:ct}),FC=ct({\u0275dir:ct}),LC=ct({\u0275pipe:ct}),hV=ct({\u0275mod:ct}),ps=ct({\u0275fac:ct}),Kf=ct({__NG_ELEMENT_ID__:ct}),fV=ct({__NG_ENV_ID__:ct});function Ce(n){return"string"==typeof n?n:null==n?"":String(n)}function VC(n,e){throw new O(-201,!1)}var Le=function(n){return n[n.Default=0]="Default",n[n.Host=1]="Host",n[n.Self=2]="Self",n[n.SkipSelf=4]="SkipSelf",n[n.Optional=8]="Optional",n}(Le||{});let BC;function pV(){return BC}function Xr(n){const e=BC;return BC=n,e}function mV(n,e,t){const r=Ry(n);return r&&"root"==r.providedIn?void 0===r.value?r.value=r.factory():r.value:t&Le.Optional?null:void 0!==e?e:void VC()}const Qf={},UC="__NG_DI_FLAG__",Oy="ngTempTokenPath",mne=/\n/gm,gV="__source";let Wu;function _a(n){const e=Wu;return Wu=n,e}function yne(n,e=Le.Default){if(void 0===Wu)throw new O(-203,!1);return null===Wu?mV(n,void 0,e):Wu.get(n,e&Le.Optional?null:void 0,e)}function me(n,e=Le.Default){return(pV()||yne)(ye(n),e)}function b(n,e=Le.Default){return me(n,Fy(e))}function Fy(n){return typeof n>"u"||"number"==typeof n?n:(n.optional&&8)|(n.host&&1)|(n.self&&2)|(n.skipSelf&&4)}function zC(n){const e=[];for(let t=0;tArray.isArray(t)?Gu(t,e):e(t))}function yV(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function Vy(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function _i(n,e,t){let r=Ku(n,e);return r>=0?n[1|r]=t:(r=~r,function vV(n,e,t,r){let i=n.length;if(i==e)n.push(t,r);else if(1===i)n.push(r,n[0]),n[0]=t;else{for(i--,n.push(n[i-1],n[i]);i>e;)n[i]=n[i-2],i--;n[e]=t,n[e+1]=r}}(n,r,e,t)),r}function HC(n,e){const t=Ku(n,e);if(t>=0)return n[1|t]}function Ku(n,e){return function bV(n,e,t){let r=0,i=n.length>>t;for(;i!==r;){const o=r+(i-r>>1),s=n[o<e?i=o:r=o+1}return~(i<{t.push(s)};return Gu(e,s=>{const a=s;zy(a,o,[],r)&&(i||=[],i.push(a))}),void 0!==i&&EV(i,o),t}function EV(n,e){for(let t=0;t{e(o,r)})}}function zy(n,e,t,r){if(!(n=ye(n)))return!1;let i=null,o=My(n);const s=!o&&Me(n);if(o||s){if(s&&!s.standalone)return!1;i=n}else{const l=n.ngModule;if(o=My(l),!o)return!1;i=l}const a=r.has(i);if(s){if(a)return!1;if(r.add(i),s.dependencies){const l="function"==typeof s.dependencies?s.dependencies():s.dependencies;for(const c of l)zy(c,e,t,r)}}else{if(!o)return!1;{if(null!=o.imports&&!a){let c;r.add(i);try{Gu(o.imports,u=>{zy(u,e,t,r)&&(c||=[],c.push(u))})}finally{}void 0!==c&&EV(c,e)}if(!a){const c=Yl(i)||(()=>new i);e({provide:i,useFactory:c,deps:it},i),e({provide:$C,useValue:i,multi:!0},i),e({provide:Bi,useValue:()=>me(i),multi:!0},i)}const l=o.providers;if(null!=l&&!a){const c=n;WC(l,u=>{e(u,c)})}}}return i!==n&&void 0!==n.providers}function WC(n,e){for(let t of n)OC(t)&&(t=t.\u0275providers),Array.isArray(t)?WC(t,e):e(t)}const Sne=ct({provide:String,useValue:ct});function GC(n){return null!==n&&"object"==typeof n&&Sne in n}function Xl(n){return"function"==typeof n}const KC=new B(""),jy={},Ane={};let QC;function Hy(){return void 0===QC&&(QC=new Uy),QC}class mr{}class Zl extends mr{parent;source;scopes;records=new Map;_ngOnDestroyHooks=new Set;_onDestroyHooks=[];get destroyed(){return this._destroyed}_destroyed=!1;injectorDefTypes;constructor(e,t,r,i){super(),this.parent=t,this.source=r,this.scopes=i,XC(e,s=>this.processProvider(s)),this.records.set(wV,Qu(void 0,this)),i.has("environment")&&this.records.set(mr,Qu(void 0,this));const o=this.records.get(KC);null!=o&&"string"==typeof o.value&&this.scopes.add(o.value),this.injectorDefTypes=new Set(this.get($C,it,Le.Self))}destroy(){Xf(this),this._destroyed=!0;const e=Se(null);try{for(const r of this._ngOnDestroyHooks)r.ngOnDestroy();const t=this._onDestroyHooks;this._onDestroyHooks=[];for(const r of t)r()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),Se(e)}}onDestroy(e){return Xf(this),this._onDestroyHooks.push(e),()=>this.removeOnDestroy(e)}runInContext(e){Xf(this);const t=_a(this),r=Xr(void 0);try{return e()}finally{_a(t),Xr(r)}}get(e,t=Qf,r=Le.Default){if(Xf(this),e.hasOwnProperty(fV))return e[fV](this);r=Fy(r);const o=_a(this),s=Xr(void 0);try{if(!(r&Le.SkipSelf)){let l=this.records.get(e);if(void 0===l){const c=function Pne(n){return"function"==typeof n||"object"==typeof n&&n instanceof B}(e)&&Ry(e);l=c&&this.injectableDefInScope(c)?Qu(YC(e),jy):null,this.records.set(e,l)}if(null!=l)return this.hydrate(e,l)}return(r&Le.Self?Hy():this.parent).get(e,t=r&Le.Optional&&t===Qf?null:t)}catch(a){if("NullInjectorError"===a.name){if((a[Oy]=a[Oy]||[]).unshift(Mn(e)),o)throw a;return function bne(n,e,t,r){const i=n[Oy];throw e[gV]&&i.unshift(e[gV]),n.message=function wne(n,e,t,r=null){n=n&&"\n"===n.charAt(0)&&"\u0275"==n.charAt(1)?n.slice(2):n;let i=Mn(e);if(Array.isArray(e))i=e.map(Mn).join(" -> ");else if("object"==typeof e){let o=[];for(let s in e)if(e.hasOwnProperty(s)){let a=e[s];o.push(s+":"+("string"==typeof a?JSON.stringify(a):Mn(a)))}i=`{${o.join(", ")}}`}return`${t}${r?"("+r+")":""}[${i}]: ${n.replace(mne,"\n ")}`}("\n"+n.message,i,t,r),n.ngTokenPath=i,n[Oy]=null,n}(a,e,"R3InjectorError",this.source)}throw a}finally{Xr(s),_a(o)}}resolveInjectorInitializers(){const e=Se(null),t=_a(this),r=Xr(void 0);try{const o=this.get(Bi,it,Le.Self);for(const s of o)s()}finally{_a(t),Xr(r),Se(e)}}toString(){const e=[],t=this.records;for(const r of t.keys())e.push(Mn(r));return`R3Injector[${e.join(", ")}]`}processProvider(e){let t=Xl(e=ye(e))?e:ye(e&&e.provide);const r=function Mne(n){return GC(n)?Qu(void 0,n.useValue):Qu(CV(n),jy)}(e);if(!Xl(e)&&!0===e.multi){let i=this.records.get(t);i||(i=Qu(void 0,jy,!0),i.factory=()=>zC(i.multi),this.records.set(t,i)),t=e,i.multi.push(e)}this.records.set(t,r)}hydrate(e,t){const r=Se(null);try{return t.value===jy&&(t.value=Ane,t.value=t.factory()),"object"==typeof t.value&&t.value&&function Nne(n){return null!==n&&"object"==typeof n&&"function"==typeof n.ngOnDestroy}(t.value)&&this._ngOnDestroyHooks.add(t.value),t.value}finally{Se(r)}}injectableDefInScope(e){if(!e.providedIn)return!1;const t=ye(e.providedIn);return"string"==typeof t?"any"===t||this.scopes.has(t):this.injectorDefTypes.has(t)}removeOnDestroy(e){const t=this._onDestroyHooks.indexOf(e);-1!==t&&this._onDestroyHooks.splice(t,1)}}function YC(n){const e=Ry(n),t=null!==e?e.factory:Yl(n);if(null!==t)return t;if(n instanceof B)throw new O(204,!1);if(n instanceof Function)return function Rne(n){if(n.length>0)throw new O(204,!1);const t=function lne(n){return n&&(n[ky]||n[uV])||null}(n);return null!==t?()=>t.factory(n):()=>new n}(n);throw new O(204,!1)}function CV(n,e,t){let r;if(Xl(n)){const i=ye(n);return Yl(i)||YC(i)}if(GC(n))r=()=>ye(n.useValue);else if(function TV(n){return!(!n||!n.useFactory)}(n))r=()=>n.useFactory(...zC(n.deps||[]));else if(function IV(n){return!(!n||!n.useExisting)}(n))r=()=>me(ye(n.useExisting));else{const i=ye(n&&(n.useClass||n.provide));if(!function kne(n){return!!n.deps}(n))return Yl(i)||YC(i);r=()=>new i(...zC(n.deps))}return r}function Xf(n){if(n.destroyed)throw new O(205,!1)}function Qu(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function XC(n,e){for(const t of n)Array.isArray(t)?XC(t,e):t&&OC(t)?XC(t.\u0275providers,e):e(t)}function yi(n,e){n instanceof Zl&&Xf(n);const r=_a(n),i=Xr(void 0);try{return e()}finally{_a(r),Xr(i)}}function xV(){return void 0!==pV()||null!=function _ne(){return Wu}()}function va(n){if(!xV())throw new O(-203,!1)}function Qt(n){return Array.isArray(n)&&"object"==typeof n[1]}function Pn(n){return Array.isArray(n)&&!0===n[1]}function e0(n){return!!(4&n.flags)}function zi(n){return n.componentOffset>-1}function Ky(n){return!(1&~n.flags)}function ji(n){return!!n.template}function _s(n){return!!(512&n[2])}function wa(n){return!(256&~n[2])}class Wne{previousValue;currentValue;firstChange;constructor(e,t,r){this.previousValue=e,this.currentValue=t,this.firstChange=r}isFirstChange(){return this.firstChange}}function PV(n,e,t,r){null!==e?e.applyValueToInputSignal(e,r):n[t]=r}const ei=(()=>{const n=()=>OV;return n.ngInherit=!0,n})();function OV(n){return n.type.prototype.ngOnChanges&&(n.setInput=Kne),Gne}function Gne(){const n=LV(this),e=n?.current;if(e){const t=n.previous;if(t===lo)n.previous=e;else for(let r in e)t[r]=e[r];n.current=null,this.ngOnChanges(e)}}function Kne(n,e,t,r,i){const o=this.declaredInputs[r],s=LV(n)||function Qne(n,e){return n[FV]=e}(n,{previous:lo,current:null}),a=s.current||(s.current={}),l=s.previous,c=l[o];a[o]=new Wne(c&&c.currentValue,t,l===lo),PV(n,e,i,t)}const FV="__ngSimpleChanges__";function LV(n){return n[FV]||null}function Je(n){for(;Array.isArray(n);)n=n[0];return n}function nd(n,e){return Je(e[n])}function _r(n,e){return Je(e[n.index])}function nc(n,e){return n.data[e]}function kr(n,e){const t=e[n];return Qt(t)?t:t[0]}function r0(n){return!(128&~n[2])}function $i(n,e){return null==e?null:n[e]}function UV(n){n[17]=0}function o0(n){1024&n[2]||(n[2]|=1024,r0(n)&&Jf(n))}function Yy(n){return!!(9216&n[2]||n[24]?.dirty)}function s0(n){n[10].changeDetectionScheduler?.notify(9),64&n[2]&&(n[2]|=1024),Yy(n)&&Jf(n)}function Jf(n){n[10].changeDetectionScheduler?.notify(0);let e=ys(n);for(;null!==e&&!(8192&e[2])&&(e[2]|=8192,r0(e));)e=ys(e)}function Xy(n,e){if(wa(n))throw new O(911,!1);null===n[21]&&(n[21]=[]),n[21].push(e)}function ys(n){const e=n[3];return Pn(e)?e[3]:e}function jV(n){return n[7]??=[]}function HV(n){return n.cleanup??=[]}const be={lFrame:ZV(null),bindingsEnabled:!0,skipHydrationRootTNode:null};let c0=!1;function Jy(){return be.bindingsEnabled}function ic(){return null!==be.skipHydrationRootTNode}function L(){return be.lFrame.lView}function ve(){return be.lFrame.tView}function vi(n){return be.lFrame.contextLView=n,n[8]}function bi(n){return be.lFrame.contextLView=null,n}function Fe(){let n=$V();for(;null!==n&&64===n.type;)n=n.parent;return n}function $V(){return be.lFrame.currentTNode}function co(n,e){const t=be.lFrame;t.currentTNode=n,t.isParent=e}function u0(){return be.lFrame.isParent}function d0(){be.lFrame.isParent=!1}function GV(){return c0}function ev(n){const e=c0;return c0=n,e}function qi(){return be.lFrame.bindingIndex++}function bs(n){const e=be.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function ure(n,e){const t=be.lFrame;t.bindingIndex=t.bindingRootIndex=n,h0(e)}function h0(n){be.lFrame.currentDirectiveIndex=n}function f0(n){const e=be.lFrame.currentDirectiveIndex;return-1===e?null:n[e]}function p0(){return be.lFrame.currentQueryIndex}function tv(n){be.lFrame.currentQueryIndex=n}function hre(n){const e=n[1];return 2===e.type?e.declTNode:1===e.type?n[5]:null}function YV(n,e,t){if(t&Le.SkipSelf){let i=e,o=n;for(;!(i=i.parent,null!==i||t&Le.Host||(i=hre(o),null===i||(o=o[14],10&i.type))););if(null===i)return!1;e=i,n=o}const r=be.lFrame=XV();return r.currentTNode=e,r.lView=n,!0}function m0(n){const e=XV(),t=n[1];be.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function XV(){const n=be.lFrame,e=null===n?null:n.child;return null===e?ZV(n):e}function ZV(n){const e={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:n,child:null,inI18n:!1};return null!==n&&(n.child=e),e}function JV(){const n=be.lFrame;return be.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}const e2=JV;function g0(){const n=JV();n.isParent=!0,n.tView=null,n.selectedIndex=-1,n.contextLView=null,n.elementDepthCount=0,n.currentDirectiveIndex=-1,n.currentNamespace=null,n.bindingRootIndex=-1,n.bindingIndex=-1,n.currentQueryIndex=0}function Jn(){return be.lFrame.selectedIndex}function oc(n){be.lFrame.selectedIndex=n}function gt(){const n=be.lFrame;return nc(n.tView,n.selectedIndex)}function tp(){be.lFrame.currentNamespace="svg"}function _0(){!function mre(){be.lFrame.currentNamespace=null}()}let n2=!0;function np(){return n2}function Ro(n){n2=n}function y0(n,e){for(let t=e.directiveStart,r=e.directiveEnd;t=r)break}else e[l]<0&&(n[17]+=65536),(a>14>16&&(3&n[2])===e&&(n[2]+=16384,i2(a,o)):i2(a,o)}class rp{factory;injectImpl;resolving=!1;canSeeViewProviders;multi;componentProviders;index;providerFactory;constructor(e,t,r){this.factory=e,this.canSeeViewProviders=t,this.injectImpl=r}}function o2(n){return 3===n||4===n||6===n}function s2(n){return 64===n.charCodeAt(0)}function id(n,e){if(null!==e&&0!==e.length)if(null===n||0===n.length)n=e.slice();else{let t=-1;for(let r=0;re){s=o-1;break}}}for(;o>16}(n),r=e;for(;t>0;)r=r[14],t--;return r}let T0=!0;function iv(n){const e=T0;return T0=n,e}let Cre=0;const Mo={};function ov(n,e){const t=u2(n,e);if(-1!==t)return t;const r=e[1];r.firstCreatePass&&(n.injectorIndex=e.length,C0(r.data,n),C0(e,null),C0(r.blueprint,null));const i=sv(n,e),o=n.injectorIndex;if(I0(i)){const s=ip(i),a=op(i,e),l=a[1].data;for(let c=0;c<8;c++)e[o+c]=a[s+c]|l[s+c]}return e[o+8]=i,o}function C0(n,e){n.push(0,0,0,0,0,0,0,0,e)}function u2(n,e){return-1===n.injectorIndex||n.parent&&n.parent.injectorIndex===n.injectorIndex||null===e[n.injectorIndex+8]?-1:n.injectorIndex}function sv(n,e){if(n.parent&&-1!==n.parent.injectorIndex)return n.parent.injectorIndex;let t=0,r=null,i=e;for(;null!==i;){if(r=_2(i),null===r)return-1;if(t++,i=i[14],-1!==r.injectorIndex)return r.injectorIndex|t<<16}return-1}function x0(n,e,t){!function xre(n,e,t){let r;"string"==typeof t?r=t.charCodeAt(0)||0:t.hasOwnProperty(Kf)&&(r=t[Kf]),null==r&&(r=t[Kf]=Cre++);const i=255&r;e.data[n+(i>>5)]|=1<=0?255&e:Rre:e}(t);if("function"==typeof o){if(!YV(e,n,r))return r&Le.Host?d2(i,0,r):h2(e,t,r,i);try{let s;if(s=o(r),null!=s||r&Le.Optional)return s;VC()}finally{e2()}}else if("number"==typeof o){let s=null,a=u2(n,e),l=-1,c=r&Le.Host?e[15][5]:null;for((-1===a||r&Le.SkipSelf)&&(l=-1===a?sv(n,e):e[a+8],-1!==l&&g2(r,!1)?(s=e[1],a=ip(l),e=op(l,e)):a=-1);-1!==a;){const u=e[1];if(m2(o,a,u.data)){const d=Dre(a,e,t,s,r,c);if(d!==Mo)return d}l=e[a+8],-1!==l&&g2(r,e[1].data[a+8]===c)&&m2(o,a,e)?(s=u,a=ip(l),e=op(l,e)):a=-1}}return i}function Dre(n,e,t,r,i,o){const s=e[1],a=s.data[n+8],u=av(a,s,t,null==r?zi(a)&&T0:r!=s&&!!(3&a.type),i&Le.Host&&o===a);return null!==u?sp(e,s,u,a):Mo}function av(n,e,t,r,i){const o=n.providerIndexes,s=e.data,a=1048575&o,l=n.directiveStart,u=o>>20,f=i?a+u:n.directiveEnd;for(let p=r?a:a+u;p=l&&m.type===t)return p}if(i){const p=s[l];if(p&&ji(p)&&p.type===t)return l}return null}function sp(n,e,t,r){let i=n[t];const o=e.data;if(function yre(n){return n instanceof rp}(i)){const s=i;s.resolving&&function hne(n,e){throw e&&e.join(" > "),new O(-200,n)}(function st(n){return"function"==typeof n?n.name||n.toString():"object"==typeof n&&null!=n&&"function"==typeof n.type?n.type.name||n.type.toString():Ce(n)}(o[t]));const a=iv(s.canSeeViewProviders);s.resolving=!0;const c=s.injectImpl?Xr(s.injectImpl):null;YV(n,r,Le.Default);try{i=n[t]=s.factory(void 0,o,n,r),e.firstCreatePass&&t>=r.directiveStart&&function gre(n,e,t){const{ngOnChanges:r,ngOnInit:i,ngDoCheck:o}=e.type.prototype;if(r){const s=OV(e);(t.preOrderHooks??=[]).push(n,s),(t.preOrderCheckHooks??=[]).push(n,s)}i&&(t.preOrderHooks??=[]).push(0-n,i),o&&((t.preOrderHooks??=[]).push(n,o),(t.preOrderCheckHooks??=[]).push(n,o))}(t,o[t],e)}finally{null!==c&&Xr(c),iv(a),s.resolving=!1,e2()}}return i}function m2(n,e,t){return!!(t[e+(n>>5)]&1<{const e=n.prototype.constructor,t=e[ps]||S0(e),r=Object.prototype;let i=Object.getPrototypeOf(n.prototype).constructor;for(;i&&i!==r;){const o=i[ps]||S0(i);if(o&&o!==t)return o;i=Object.getPrototypeOf(i)}return o=>new o})}function S0(n){return Ay(n)?()=>{const e=S0(ye(n));return e&&e()}:Yl(n)}function _2(n){const e=n[1],t=e.type;return 2===t?e.declTNode:1===t?n[5]:null}function ap(n){return function Sre(n,e){if("class"===e)return n.classes;if("style"===e)return n.styles;const t=n.attrs;if(t){const r=t.length;let i=0;for(;ime(wV)});static __NG_ELEMENT_ID__=-1}class T2{attributeName;constructor(e){this.attributeName=e}__NG_ELEMENT_ID__=()=>ap(this.attributeName);toString(){return`HostAttributeToken ${this.attributeName}`}}new B("").__NG_ELEMENT_ID__=n=>{const e=Fe();if(null===e)throw new O(204,!1);if(2&e.type)return e.value;if(n&Le.Optional)return null;throw new O(204,!1)};const C2=!1;let uo=(()=>class n{static __NG_ELEMENT_ID__=Ure;static __NG_ENV_ID__=t=>t})();class x2 extends uo{_lView;constructor(e){super(),this._lView=e}onDestroy(e){return Xy(this._lView,e),()=>function a0(n,e){if(null===n[21])return;const t=n[21].indexOf(e);-1!==t&&n[21].splice(t,1)}(this._lView,e)}}function Ure(){return new x2(L())}class ws{}const lp=new B("",{providedIn:"root",factory:()=>!1}),S2=new B(""),A0=new B("");let Es=(()=>{class n{taskId=0;pendingTasks=new Set;get _hasPendingTasks(){return this.hasPendingTasks.value}hasPendingTasks=new mi(!1);add(){this._hasPendingTasks||this.hasPendingTasks.next(!0);const t=this.taskId++;return this.pendingTasks.add(t),t}has(t){return this.pendingTasks.has(t)}remove(t){this.pendingTasks.delete(t),0===this.pendingTasks.size&&this._hasPendingTasks&&this.hasPendingTasks.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this._hasPendingTasks&&this.hasPendingTasks.next(!1)}static \u0275prov=G({token:n,providedIn:"root",factory:()=>new n})}return n})(),R0=(()=>{class n{internalPendingTasks=b(Es);scheduler=b(ws);add(){const t=this.internalPendingTasks.add();return()=>{this.internalPendingTasks.has(t)&&(this.scheduler.notify(12),this.internalPendingTasks.remove(t))}}run(t){var r=this;return T(function*(){const i=r.add();try{return yield t()}finally{i()}})()}static \u0275prov=G({token:n,providedIn:"root",factory:()=>new n})}return n})();const nt=class zre extends fe{__isAsync;destroyRef=void 0;pendingTasks=void 0;constructor(e=!1){super(),this.__isAsync=e,xV()&&(this.destroyRef=b(uo,{optional:!0})??void 0,this.pendingTasks=b(Es,{optional:!0})??void 0)}emit(e){const t=Se(null);try{super.next(e)}finally{Se(t)}}subscribe(e,t,r){let i=e,o=t||(()=>null),s=r;if(e&&"object"==typeof e){const l=e;i=l.next?.bind(l),o=l.error?.bind(l),s=l.complete?.bind(l)}this.__isAsync&&(o=this.wrapInTimeout(o),i&&(i=this.wrapInTimeout(i)),s&&(s=this.wrapInTimeout(s)));const a=super.subscribe({next:i,error:o,complete:s});return e instanceof Kt&&e.add(a),a}wrapInTimeout(e){return t=>{const r=this.pendingTasks?.add();setTimeout(()=>{e(t),void 0!==r&&this.pendingTasks?.remove(r)})}}};function cp(...n){}function D2(n){let e,t;function r(){n=cp;try{void 0!==t&&"function"==typeof cancelAnimationFrame&&cancelAnimationFrame(t),void 0!==e&&clearTimeout(e)}catch{}}return e=setTimeout(()=>{n(),r()}),"function"==typeof requestAnimationFrame&&(t=requestAnimationFrame(()=>{n(),r()})),()=>r()}function A2(n){return queueMicrotask(()=>n()),()=>{n=cp}}const M0="isAngularZone",cv=M0+"_ID";let jre=0;class ue{hasPendingMacrotasks=!1;hasPendingMicrotasks=!1;isStable=!0;onUnstable=new nt(!1);onMicrotaskEmpty=new nt(!1);onStable=new nt(!1);onError=new nt(!1);constructor(e){const{enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:r=!1,shouldCoalesceRunChangeDetection:i=!1,scheduleInRootZone:o=C2}=e;if(typeof Zone>"u")throw new O(908,!1);Zone.assertZonePatched();const s=this;s._nesting=0,s._outer=s._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(s._inner=s._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(s._inner=s._inner.fork(Zone.longStackTraceZoneSpec)),s.shouldCoalesceEventChangeDetection=!i&&r,s.shouldCoalesceRunChangeDetection=i,s.callbackScheduled=!1,s.scheduleInRootZone=o,function qre(n){const e=()=>{!function $re(n){function e(){D2(()=>{n.callbackScheduled=!1,N0(n),n.isCheckStableRunning=!0,k0(n),n.isCheckStableRunning=!1})}n.isCheckStableRunning||n.callbackScheduled||(n.callbackScheduled=!0,n.scheduleInRootZone?Zone.root.run(()=>{e()}):n._outer.run(()=>{e()}),N0(n))}(n)},t=jre++;n._inner=n._inner.fork({name:"angular",properties:{[M0]:!0,[cv]:t,[cv+t]:!0},onInvokeTask:(r,i,o,s,a,l)=>{if(function Wre(n){return k2(n,"__ignore_ng_zone__")}(l))return r.invokeTask(o,s,a,l);try{return R2(n),r.invokeTask(o,s,a,l)}finally{(n.shouldCoalesceEventChangeDetection&&"eventTask"===s.type||n.shouldCoalesceRunChangeDetection)&&e(),M2(n)}},onInvoke:(r,i,o,s,a,l,c)=>{try{return R2(n),r.invoke(o,s,a,l,c)}finally{n.shouldCoalesceRunChangeDetection&&!n.callbackScheduled&&!function Gre(n){return k2(n,"__scheduler_tick__")}(l)&&e(),M2(n)}},onHasTask:(r,i,o,s)=>{r.hasTask(o,s),i===o&&("microTask"==s.change?(n._hasPendingMicrotasks=s.microTask,N0(n),k0(n)):"macroTask"==s.change&&(n.hasPendingMacrotasks=s.macroTask))},onHandleError:(r,i,o,s)=>(r.handleError(o,s),n.runOutsideAngular(()=>n.onError.emit(s)),!1)})}(s)}static isInAngularZone(){return typeof Zone<"u"&&!0===Zone.current.get(M0)}static assertInAngularZone(){if(!ue.isInAngularZone())throw new O(909,!1)}static assertNotInAngularZone(){if(ue.isInAngularZone())throw new O(909,!1)}run(e,t,r){return this._inner.run(e,t,r)}runTask(e,t,r,i){const o=this._inner,s=o.scheduleEventTask("NgZoneEvent: "+i,e,Hre,cp,cp);try{return o.runTask(s,t,r)}finally{o.cancelTask(s)}}runGuarded(e,t,r){return this._inner.runGuarded(e,t,r)}runOutsideAngular(e){return this._outer.run(e)}}const Hre={};function k0(n){if(0==n._nesting&&!n.hasPendingMicrotasks&&!n.isStable)try{n._nesting++,n.onMicrotaskEmpty.emit(null)}finally{if(n._nesting--,!n.hasPendingMicrotasks)try{n.runOutsideAngular(()=>n.onStable.emit(null))}finally{n.isStable=!0}}}function N0(n){n.hasPendingMicrotasks=!!(n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&!0===n.callbackScheduled)}function R2(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function M2(n){n._nesting--,k0(n)}class P0{hasPendingMicrotasks=!1;hasPendingMacrotasks=!1;isStable=!0;onUnstable=new nt;onMicrotaskEmpty=new nt;onStable=new nt;onError=new nt;run(e,t,r){return e.apply(t,r)}runGuarded(e,t,r){return e.apply(t,r)}runOutsideAngular(e){return e()}runTask(e,t,r,i){return e.apply(t,r)}}function k2(n,e){return!(!Array.isArray(n)||1!==n.length)&&!0===n[0]?.data?.[e]}class wi{_console=console;handleError(e){this._console.error("ERROR",e)}}const Qre=new B("",{providedIn:"root",factory:()=>{const n=b(ue),e=b(wi);return t=>n.runOutsideAngular(()=>e.handleError(t))}});function P2(n,e){return aV(n,e)}const Xre=(P2.required=function Yre(n){return aV(Dy,n)},P2);function Zre(){return od(Fe(),L())}function od(n,e){return new je(_r(n,e))}let je=(()=>class n{nativeElement;constructor(t){this.nativeElement=t}static __NG_ELEMENT_ID__=Zre})();function O2(n){return n instanceof je?n.nativeElement:n}const F2=new Set;function On(n){F2.has(n)||(F2.add(n),performance?.mark?.("mark_feature_usage",{detail:{feature:n}}))}function up(n){return"function"==typeof n&&void 0!==n[In]}function ti(n,e){On("NgSignals");const t=function Fte(n){const e=Object.create(bC);e.value=n;const t=()=>(Vu(e),e.value);return t[In]=e,t}(n),r=t[In];return e?.equal&&(r.equal=e.equal),t.set=i=>Iy(r,i),t.update=i=>function QL(n,e){zL()||KL(),Iy(n,e(n.value))}(r,i),t.asReadonly=uv.bind(t),t}function uv(){const n=this[In];if(void 0===n.readonlyFn){const e=()=>this();e[In]=n,n.readonlyFn=e}return n.readonlyFn}function Jre(){return this._results[Symbol.iterator]()}class dp{_emitDistinctChangesOnly;dirty=!0;_onDirty=void 0;_results=[];_changesDetected=!1;_changes=void 0;length=0;first=void 0;last=void 0;get changes(){return this._changes??=new fe}constructor(e=!1){this._emitDistinctChangesOnly=e}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){this.dirty=!1;const r=function Zr(n){return n.flat(Number.POSITIVE_INFINITY)}(e);(this._changesDetected=!function Cne(n,e,t){if(n.length!==e.length)return!1;for(let r=0;rwie}),wie="ng",U0=new B(""),Ia=new B("",{providedIn:"platform",factory:()=>"unknown"}),Ts=new B(""),z0=new B("",{providedIn:"root",factory:()=>function ko(){if(void 0!==B0)return B0;if(typeof document<"u")return document;throw new O(210,!1)}().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null}),oB=new B("",{providedIn:"root",factory:()=>!1});var Z0=function(n){return n[n.CHANGE_DETECTION=0]="CHANGE_DETECTION",n[n.AFTER_NEXT_RENDER=1]="AFTER_NEXT_RENDER",n}(Z0||{});const ld=new B("");var cd=function(n){return n[n.EarlyRead=0]="EarlyRead",n[n.Write=1]="Write",n[n.MixedReadWrite=2]="MixedReadWrite",n[n.Read=3]="Read",n}(cd||{});let J0=(()=>{class n{impl=null;execute(){this.impl?.execute()}static \u0275prov=G({token:n,providedIn:"root",factory:()=>new n})}return n})();const cB=[cd.EarlyRead,cd.Write,cd.MixedReadWrite,cd.Read];let uB=(()=>{class n{ngZone=b(ue);scheduler=b(ws);errorHandler=b(wi,{optional:!0});sequences=new Set;deferredRegistrations=new Set;executing=!1;constructor(){b(ld,{optional:!0})}execute(){this.executing=!0;for(const t of cB)for(const r of this.sequences)if(!r.erroredOrDestroyed&&r.hooks[t])try{r.pipelinedValue=this.ngZone.runOutsideAngular(()=>this.maybeTrace(()=>r.hooks[t](r.pipelinedValue),r.snapshot))}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(8),this.deferredRegistrations.clear()}register(t){this.executing?this.deferredRegistrations.add(t):(this.sequences.add(t),this.scheduler.notify(7))}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))}maybeTrace(t,r){return r?r.run(Z0.AFTER_NEXT_RENDER,t):t()}static \u0275prov=G({token:n,providedIn:"root",factory:()=>new n})}return n})();class dB{impl;hooks;once;snapshot;erroredOrDestroyed=!1;pipelinedValue=void 0;unregisterOnDestroy;constructor(e,t,r,i,o=null){this.impl=e,this.hooks=t,this.once=r,this.snapshot=o,this.unregisterOnDestroy=i?.onDestroy(()=>this.destroy())}afterRun(){this.erroredOrDestroyed=!1,this.pipelinedValue=void 0,this.snapshot?.dispose(),this.snapshot=null}destroy(){this.impl.unregister(this),this.unregisterOnDestroy?.()}}function ex(n,e){!e?.injector&&va();const t=e?.injector??b(ze);return On("NgAfterRender"),hB(n,t,e,!1)}function Cs(n,e){!e?.injector&&va();const t=e?.injector??b(ze);return On("NgAfterNextRender"),hB(n,t,e,!0)}function hB(n,e,t,r){const i=e.get(J0);i.impl??=e.get(uB);const o=e.get(ld,null,{optional:!0}),s=t?.phase??cd.MixedReadWrite,a=!0!==t?.manualCleanup?e.get(uo):null,l=new dB(i.impl,function xie(n,e){if(n instanceof Function){const t=[void 0,void 0,void 0,void 0];return t[e]=n,t}return[n.earlyRead,n.write,n.mixedReadWrite,n.read]}(n,s),r,a,o?.snapshot(null));return i.impl.register(l),l}function OB(n,e){const t=n.contentQueries;if(null!==t){const r=Se(null);try{for(let i=0;in,createScript:n=>n,createScriptURL:n=>n})}catch{}return Sv}()?.createHTML(n)||n}function VB(n){return function mx(){if(void 0===Dv&&(Dv=null,Nt.trustedTypes))try{Dv=Nt.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch{}return Dv}()?.createScriptURL(n)||n}class uc{changingThisBreaksApplicationSecurity;constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${oV})`}}class loe extends uc{getTypeName(){return"HTML"}}class coe extends uc{getTypeName(){return"Style"}}class uoe extends uc{getTypeName(){return"Script"}}class doe extends uc{getTypeName(){return"URL"}}class hoe extends uc{getTypeName(){return"ResourceURL"}}function Ei(n){return n instanceof uc?n.changingThisBreaksApplicationSecurity:n}function No(n,e){const t=function foe(n){return n instanceof uc&&n.getTypeName()||null}(n);if(null!=t&&t!==e){if("ResourceURL"===t&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${t} (see ${oV})`)}return t===e}class voe{inertDocumentHelper;constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e=""+e;try{const t=(new window.DOMParser).parseFromString(_d(e),"text/html").body;return null===t?this.inertDocumentHelper.getInertBodyElement(e):(t.firstChild?.remove(),t)}catch{return null}}}class boe{defaultDoc;inertDocument;constructor(e){this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert")}getInertBodyElement(e){const t=this.inertDocument.createElement("template");return t.innerHTML=_d(e),t}}const Eoe=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function Av(n){return(n=String(n)).match(Eoe)?n:"unsafe:"+n}function xs(n){const e={};for(const t of n.split(","))e[t]=!0;return e}function Cp(...n){const e={};for(const t of n)for(const r in t)t.hasOwnProperty(r)&&(e[r]=!0);return e}const UB=xs("area,br,col,hr,img,wbr"),zB=xs("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),jB=xs("rp,rt"),gx=Cp(UB,Cp(zB,xs("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")),Cp(jB,xs("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")),Cp(jB,zB)),_x=xs("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),HB=Cp(_x,xs("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"),xs("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")),Ioe=xs("script,style,template");class Toe{sanitizedSomething=!1;buf=[];sanitizeChildren(e){let t=e.firstChild,r=!0,i=[];for(;t;)if(t.nodeType===Node.ELEMENT_NODE?r=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,r&&t.firstChild)i.push(t),t=Soe(t);else for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let o=xoe(t);if(o){t=o;break}t=i.pop()}return this.buf.join("")}startElement(e){const t=$B(e).toLowerCase();if(!gx.hasOwnProperty(t))return this.sanitizedSomething=!0,!Ioe.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);const r=e.attributes;for(let i=0;i"),!0}endElement(e){const t=$B(e).toLowerCase();gx.hasOwnProperty(t)&&!UB.hasOwnProperty(t)&&(this.buf.push(""))}chars(e){this.buf.push(WB(e))}}function xoe(n){const e=n.nextSibling;if(e&&n!==e.previousSibling)throw qB(e);return e}function Soe(n){const e=n.firstChild;if(e&&function Coe(n,e){return(n.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)!==Node.DOCUMENT_POSITION_CONTAINED_BY}(n,e))throw qB(e);return e}function $B(n){const e=n.nodeName;return"string"==typeof e?e:"FORM"}function qB(n){return new Error(`Failed to sanitize html because the element is clobbered: ${n.outerHTML}`)}const Doe=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Aoe=/([^\#-~ |!])/g;function WB(n){return n.replace(/&/g,"&").replace(Doe,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(Aoe,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}let Rv;function GB(n,e){let t=null;try{Rv=Rv||function BB(n){const e=new boe(n);return function woe(){try{return!!(new window.DOMParser).parseFromString(_d(""),"text/html")}catch{return!1}}()?new voe(e):e}(n);let r=e?String(e):"";t=Rv.getInertBodyElement(r);let i=5,o=r;do{if(0===i)throw new Error("Failed to sanitize html because the input is unstable");i--,r=o,o=t.innerHTML,t=Rv.getInertBodyElement(r)}while(r!==o);return _d((new Toe).sanitizeChildren(yx(t)||t))}finally{if(t){const r=yx(t)||t;for(;r.firstChild;)r.firstChild.remove()}}}function yx(n){return"content"in n&&function Roe(n){return n.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===n.nodeName}(n)?n.content:null}var er=function(n){return n[n.NONE=0]="NONE",n[n.HTML=1]="HTML",n[n.STYLE=2]="STYLE",n[n.SCRIPT=3]="SCRIPT",n[n.URL=4]="URL",n[n.RESOURCE_URL=5]="RESOURCE_URL",n}(er||{});function vx(n){const e=xp();return e?e.sanitize(er.URL,n)||"":No(n,"URL")?Ei(n):Av(Ce(n))}function KB(n){const e=xp();if(e)return VB(e.sanitize(er.RESOURCE_URL,n)||"");if(No(n,"ResourceURL"))return VB(Ei(n));throw new O(904,!1)}function xp(){const n=L();return n&&n[10].sanitizer}const Loe=/^>|^->||--!>|)/g;function Ii(n){return n instanceof Function?n():n}function Yoe(n,e,t){let r=n.length;for(;;){const i=n.indexOf(e,t);if(-1===i)return i;if(0===i||n.charCodeAt(i-1)<=32){const o=e.length;if(i+o===r||n.charCodeAt(i+o)<=32)return i}t=i+1}}const iU="ng-template";function Xoe(n,e,t,r){let i=0;if(r){for(;i-1){let o;for(;++io?"":i[u+1].toLowerCase(),2&r&&c!==d){if(ho(r))return!1;s=!0}}}}else{if(!s&&!ho(r)&&!ho(l))return!1;if(s&&ho(l))continue;s=!1,r=l|1&r}}return ho(r)||s}function ho(n){return!(1&n)}function ese(n,e,t,r){if(null===e)return-1;let i=0;if(r||!t){let o=!1;for(;i-1)for(t++;t0?'="'+a+'"':"")+"]"}else 8&r?i+="."+s:4&r&&(i+=" "+s);else""!==i&&!ho(s)&&(e+=sU(o,i),i=""),r=s,o=o||!ho(r);t++}return""!==i&&(e+=sU(o,i)),e}const xe={};function Tx(n,e){return n.createComment(function YB(n){return n.replace(Loe,e=>e.replace(Voe,"\u200b$1\u200b"))}(e))}function Nv(n,e,t){return n.createElement(e,t)}function dc(n,e,t,r,i){n.insertBefore(e,t,r,i)}function lU(n,e,t){n.appendChild(e,t)}function cU(n,e,t,r,i){null!==r?dc(n,e,t,r,i):lU(n,e,t)}function dU(n,e,t){const{mergedAttrs:r,classes:i,styles:o}=t;null!==r&&function Ere(n,e,t){let r=0;for(;r25&&fU(n,e,25,!1),t(r,i)}finally{oc(o)}}function Dx(n,e,t){Jy()&&(Or(_r(t,e),e),gU(n,e,t))}function gU(n,e,t){(function vse(n,e,t){const r=t.directiveStart,i=t.directiveEnd;zi(t)&&function dse(n,e,t){const r=_r(e,n),i=function hU(n){const e=n.tView;return null===e||e.incompleteFirstPass?n.tView=Cx(1,null,n.template,n.decls,n.vars,n.directiveDefs,n.pipeDefs,n.viewQuery,n.schemas,n.consts,n.id):e}(t),o=n[10].rendererFactory,s=Sx(n,Pv(n,i,null,xx(t),r,e,null,o.createRenderer(r,t),null,null,null));n[e.index]=s}(e,t,n.data[r+t.componentOffset]),n.firstCreatePass||ov(t,e);const o=t.initialInputs;for(let s=r;snull;function ri(n,e,t,r,i,o,s,a){let c,l=e.inputs;if(!a&&null!=l&&(c=l[r]))kx(n,t,c,0,i),zi(e)&&function _se(n,e){const t=kr(e,n);16&t[2]||(t[2]|=64)}(t,e.index);else if(3&e.type){const u=_r(e,t);r=function gse(n){return"class"===n?"className":"for"===n?"htmlFor":"formaction"===n?"formAction":"innerHtml"===n?"innerHTML":"readonly"===n?"readOnly":"tabindex"===n?"tabIndex":n}(r),i=null!=s?s(i,e.value||"",r):i,o.setProperty(u,r,i)}}function wse(n,e){null!==n.hostBindings&&n.hostBindings(1,e)}function Rx(n,e){const t=n.directiveRegistry;let r=null;if(t)for(let i=0;i=0?r[a]():r[-a].unsubscribe(),s+=2}else t[s].call(r[t[s+1]]);null!==r&&(e[7]=null);const i=e[21];if(null!==i){e[21]=null;for(let s=0;s{Jf(n.lView)},consumerOnSignalRead(){this.lView[24]=this}},Bse={...$l,consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:n=>{let e=ys(n.lView);for(;e&&!AU(e[1]);)e=ys(e);e&&o0(e)},consumerOnSignalRead(){this.lView[24]=this}};function AU(n){return 2!==n.type}function RU(n){if(null===n[23])return;let e=!0;for(;e;){let t=!1;for(const r of n[23])r.dirty&&(t=!0,null===r.zone||Zone.current===r.zone?r.run():r.zone.run(()=>r.run()));e=t&&!!(8192&n[2])}}function Uv(n,e=!0,t=0){const i=n[10].rendererFactory;i.begin?.();try{!function zse(n,e){const t=GV();try{ev(!0),jx(n,e);let r=0;for(;Yy(n);){if(100===r)throw new O(103,!1);r++,jx(n,1)}}finally{ev(t)}}(n,t)}catch(s){throw e&&Fv(n,s),s}finally{i.end?.()}}function kU(n,e,t,r){if(wa(e))return;const i=e[2];m0(e);let a=!0,l=null,c=null;AU(n)?(c=function Pse(n){return n[24]??function Ose(n){const e=DU.pop()??Object.create(Lse);return e.lView=n,e}(n)}(e),l=ql(c)):null===function vC(){return hn}()?(a=!1,c=function Vse(n){const e=n[24]??Object.create(Bse);return e.lView=n,e}(e),l=ql(c)):e[24]&&(qf(e[24]),e[24]=null);try{UV(e),function KV(n){return be.lFrame.bindingIndex=n}(n.bindingStartIndex),null!==t&&mU(n,e,t,2,r);const u=!(3&~i);if(u){const p=n.preOrderCheckHooks;null!==p&&nv(e,p,null)}else{const p=n.preOrderHooks;null!==p&&rv(e,p,0,null),v0(e,0)}if(function jse(n){for(let e=W2(n);null!==e;e=G2(e)){if(!(2&e[2]))continue;const t=e[9];for(let r=0;r0&&(t[i-1][4]=e),r0&&(n[t-1][4]=r[4]);const o=Vy(n,10+e);!function vU(n,e){bU(n,e),e[0]=null,e[5]=null}(r[1],r);const s=o[18];null!==s&&s.detachView(o[1]),r[3]=null,r[4]=null,r[2]&=-129}return r}function VU(n,e){const t=n[9],r=e[3];(Qt(r)||e[15]!==r[3][15])&&(n[2]|=2),null===t?n[9]=[e]:t.push(e)}class kp{_lView;_cdRefInjectingView;notifyErrorHandler;_appRef=null;_attachedToViewContainer=!1;get rootNodes(){const e=this._lView,t=e[1];return wd(t,e,t.firstChild,[])}constructor(e,t,r=!0){this._lView=e,this._cdRefInjectingView=t,this.notifyErrorHandler=r}get context(){return this._lView[8]}get dirty(){return!!(9280&this._lView[2])||!!this._lView[24]?.dirty}set context(e){this._lView[8]=e}get destroyed(){return wa(this._lView)}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._attachedToViewContainer){const e=this._lView[3];if(Pn(e)){const t=e[8],r=t?t.indexOf(this):-1;r>-1&&(Mp(e,r),Vy(t,r))}this._attachedToViewContainer=!1}Ap(this._lView[1],this._lView)}onDestroy(e){Xy(this._lView,e)}markForCheck(){Rp(this._cdRefInjectingView||this._lView,4)}markForRefresh(){o0(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){s0(this._lView),this._lView[2]|=128}detectChanges(){this._lView[2]|=1024,Uv(this._lView,this.notifyErrorHandler)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new O(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;const e=_s(this._lView),t=this._lView[16];null!==t&&!e&&Ox(t,this._lView),bU(this._lView[1],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new O(902,!1);this._appRef=e;const t=_s(this._lView),r=this._lView[16];null!==r&&!t&&VU(r,this._lView),s0(this._lView)}}let Oo=(()=>class n{static __NG_ELEMENT_ID__=Kse})();const Wse=Oo,Gse=class extends Wse{_declarationLView;_declarationTContainer;elementRef;constructor(e,t,r){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=r}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(e,t){return this.createEmbeddedViewImpl(e,t)}createEmbeddedViewImpl(e,t,r){const i=vd(this._declarationLView,this._declarationTContainer,e,{embeddedViewInjector:t,dehydratedView:r});return new kp(i)}};function Kse(){return zv(Fe(),L())}function zv(n,e){return 4&n.type?new Gse(e,n,od(n,e)):null}function Id(n,e,t,r,i){let o=n.data[e];if(null===o)o=function Gx(n,e,t,r,i){const o=$V(),s=u0(),l=n.data[e]=function iae(n,e,t,r,i,o){let s=e?e.injectorIndex:-1,a=0;return ic()&&(a|=128),{type:t,index:r,insertBeforeIndex:null,injectorIndex:s,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,propertyBindings:null,flags:a,providerIndexes:0,value:i,attrs:o,mergedAttrs:null,localNames:null,initialInputs:void 0,inputs:null,outputs:null,tView:null,next:null,prev:null,projectionNext:null,child:null,parent:e,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}(0,s?o:o&&o.parent,t,e,r,i);return function rae(n,e,t,r){null===n.firstChild&&(n.firstChild=e),null!==t&&(r?null==t.child&&null!==e.parent&&(t.child=e):null===t.next&&(t.next=e,e.prev=t))}(n,l,o,s),l}(n,e,t,r,i),function cre(){return be.lFrame.inI18n}()&&(o.flags|=32);else if(64&o.type){o.type=t,o.value=r,o.attrs=i;const s=function ep(){const n=be.lFrame,e=n.currentTNode;return n.isParent?e:e.parent}();o.injectorIndex=null===s?-1:s.injectorIndex}return co(o,!0),o}class $ae{}class sz{}class qae{resolveComponentFactory(e){throw Error(`No component factory found for ${Mn(e)}.`)}}class Gv{static NULL=new qae}class Aa{}let Ti=(()=>class n{destroyNode=null;static __NG_ELEMENT_ID__=()=>function Wae(){const n=L(),t=kr(Fe().index,n);return(Qt(t)?t:n)[11]}()})(),Gae=(()=>{class n{static \u0275prov=G({token:n,providedIn:"root",factory:()=>null})}return n})();function iS(n,e,t){let r=t?n.styles:null,i=t?n.classes:null,o=0;if(null!==e)for(let s=0;s0;){const t=n[--e];if("number"==typeof t&&t<0)return t}return 0})(s)!=a&&s.push(a),s.push(t,r,o)}}(n,e,r,Dp(n,t,i.hostVars,xe),i)}function sle(n,e,t){if(t){if(e.exportAs)for(let r=0;r{const[t,r,i]=n[e],o={propName:t,templateName:e,isSignal:!!(r&Ov.SignalBased)};return i&&(o.transform=i),o})}(this.componentDef.inputs)}get outputs(){return function cle(n){return Object.keys(n).map(e=>({propName:n[e],templateName:e}))}(this.componentDef.outputs)}constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=function sse(n){return n.map(ose).join(",")}(e.selectors),this.ngContentSelectors=e.ngContentSelectors??[],this.isBoundToModule=!!t}create(e,t,r,i){const o=Se(null);try{const s=this.componentDef,a=r?["ng-version","19.1.7"]:function ase(n){const e=[],t=[];let r=1,i=2;for(;r[this.componentDef],!0,0);f&&(dU(d,f,_),Or(f,p)),gU(l,p,_),fx(l,_,p),hz(l,_),void 0!==t&&function ple(n,e,t){const r=n.projection=[];for(let i=0;iclass n{static __NG_ELEMENT_ID__=mle})();function mle(){return gz(Fe(),L())}const gle=Ci,pz=class extends gle{_lContainer;_hostTNode;_hostLView;constructor(e,t,r){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=r}get element(){return od(this._hostTNode,this._hostLView)}get injector(){return new nn(this._hostTNode,this._hostLView)}get parentInjector(){const e=sv(this._hostTNode,this._hostLView);if(I0(e)){const t=op(e,this._hostLView),r=ip(e);return new nn(t[1].data[r+8],t)}return new nn(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){const t=mz(this._lContainer);return null!==t&&t[e]||null}get length(){return this._lContainer.length-10}createEmbeddedView(e,t,r){let i,o;"number"==typeof r?i=r:null!=r&&(i=r.index,o=r.injector);const a=e.createEmbeddedViewImpl(t||{},o,null);return this.insertImpl(a,i,hc(this._hostTNode,null)),a}createComponent(e,t,r,i,o){const s=e&&!function Zf(n){return"function"==typeof n}(e);let a;if(s)a=t;else{const m=t||{};a=m.index,r=m.injector,i=m.projectableNodes,o=m.environmentInjector||m.ngModuleRef}const l=s?e:new jp(Me(e)),c=r||this.parentInjector;if(!o&&null==l.ngModule){const _=(s?c:this.parentInjector).get(mr,null);_&&(o=_)}Me(l.componentType??{});const p=l.create(c,i,null,o);return this.insertImpl(p.hostView,a,hc(this._hostTNode,null)),p}insert(e,t){return this.insertImpl(e,t,!0)}insertImpl(e,t,r){const i=e._lView;if(function Jne(n){return Pn(n[3])}(i)){const a=this.indexOf(e);if(-1!==a)this.detach(a);else{const l=i[3],c=new pz(l,l[5],l[3]);c.detach(c.indexOf(e))}}const o=this._adjustIndex(t),s=this._lContainer;return Ed(s,i,o,r),e.attachToViewContainerRef(),yV(sS(s),o,e),e}move(e,t){return this.insert(e,t)}indexOf(e){const t=mz(this._lContainer);return null!==t?t.indexOf(e):-1}remove(e){const t=this._adjustIndex(e,-1),r=Mp(this._lContainer,t);r&&(Vy(sS(this._lContainer),t),Ap(r[1],r))}detach(e){const t=this._adjustIndex(e,-1),r=Mp(this._lContainer,t);return r&&null!=Vy(sS(this._lContainer),t)?new kp(r):null}_adjustIndex(e,t=0){return e??this.length+t}};function mz(n){return n[8]}function sS(n){return n[8]||(n[8]=[])}function gz(n,e){let t;const r=e[n.index];return Pn(r)?t=r:(t=FU(r,e,null,n),e[n.index]=t,Sx(e,t)),_z(t,e,n,r),new pz(t,n,e)}let _z=function vz(n,e,t,r){if(n[7])return;let i;i=8&t.type?Je(r):function _le(n,e){const t=n[11],r=t.createComment(""),i=_r(e,n),o=t.parentNode(i);return dc(t,o,r,t.nextSibling(i),!1),r}(e,t),n[7]=i};class lS{queryList;matches=null;constructor(e){this.queryList=e}clone(){return new lS(this.queryList)}setDirty(){this.queryList.setDirty()}}class cS{queries;constructor(e=[]){this.queries=e}createEmbeddedView(e){const t=e.queries;if(null!==t){const r=null!==e.contentQueries?e.contentQueries[0]:t.length,i=[];for(let o=0;oe.trim())}(e):e}}class uS{queries;constructor(e=[]){this.queries=e}elementStart(e,t){for(let r=0;r0)r.push(s[a/2]);else{const c=o[a+1],u=e[-l];for(let d=10;d{r._dirtyCounter();const o=function Sle(n,e){const t=n._lView,r=n._queryIndex;if(void 0===t||void 0===r||4&t[2])return e?void 0:it;const i=fS(t,r),o=xz(t,r);return i.reset(o,O2),e?i.first:i._changesDetected||void 0===n._flatValue?n._flatValue=i.toArray():n._flatValue}(r,n);if(e&&void 0===o)throw new O(-951,!1);return o});return r=i[In],r._dirtyCounter=ti(0),r._flatValue=void 0,i}function Mz(n,e){return function Sz(n){return mS(!0,!1)}()}const Ale=(Mz.required=function Dle(n,e){return function Dz(n){return mS(!0,!0)}()},Mz);class Ss{}class Vz{}class gS extends Ss{ngModuleType;_parent;_bootstrapComponents=[];_r3Injector;instance;destroyCbs=[];componentFactoryResolver=new fz(this);constructor(e,t,r,i=!0){super(),this.ngModuleType=e,this._parent=t;const o=pr(e);this._bootstrapComponents=Ii(o.bootstrap),this._r3Injector=I2(e,t,[{provide:Ss,useValue:this},{provide:Gv,useValue:this.componentFactoryResolver},...r],Mn(e),new Set(["environment"])),i&&this.resolveInjectorInitializers()}resolveInjectorInitializers(){this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(this.ngModuleType)}get injector(){return this._r3Injector}destroy(){const e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}}class _S extends Vz{moduleType;constructor(e){super(),this.moduleType=e}create(e){return new gS(this.moduleType,e,[])}}class Bz extends Ss{injector;componentFactoryResolver=new fz(this);instance=null;constructor(e){super();const t=new Zl([...e.providers,{provide:Ss,useValue:this},{provide:Gv,useValue:this.componentFactoryResolver}],e.parent||Hy(),e.debugName,new Set(["environment"]));this.injector=t,e.runEnvironmentInitializers&&t.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(e){this.injector.onDestroy(e)}}function yS(n,e,t=null){return new Bz({providers:n,parent:e,debugName:t,runEnvironmentInitializers:!0}).injector}let Ule=(()=>{class n{_injector;cachedInjectors=new Map;constructor(t){this._injector=t}getOrCreateStandaloneInjector(t){if(!t.standalone)return null;if(!this.cachedInjectors.has(t)){const r=qC(0,t.type),i=r.length>0?yS([r],this._injector,`Standalone[${t.type.name}]`):null;this.cachedInjectors.set(t,i)}return this.cachedInjectors.get(t)}ngOnDestroy(){try{for(const t of this.cachedInjectors.values())null!==t&&t.destroy()}finally{this.cachedInjectors.clear()}}static \u0275prov=G({token:n,providedIn:"environment",factory:()=>new n(me(mr))})}return n})();function He(n){return fs(()=>{const e=Uz(n),t={...e,decls:n.decls,vars:n.vars,template:n.template,consts:n.consts||null,ngContentSelectors:n.ngContentSelectors,onPush:n.changeDetection===dv.OnPush,directiveDefs:null,pipeDefs:null,dependencies:e.standalone&&n.dependencies||null,getStandaloneInjector:e.standalone?i=>i.get(Ule).getOrCreateStandaloneInjector(t):null,getExternalStyles:null,signals:n.signals??!1,data:n.data||{},encapsulation:n.encapsulation||Wi.Emulated,styles:n.styles||it,_:null,schemas:n.schemas||null,tView:null,id:""};e.standalone&&On("NgStandalone"),zz(t);const r=n.dependencies;return t.directiveDefs=Yv(r,!1),t.pipeDefs=Yv(r,!0),t.id=function Wle(n){let e=0;const r=[n.selectors,n.ngContentSelectors,n.hostVars,n.hostAttrs,"function"==typeof n.consts?"":n.consts,n.vars,n.decls,n.encapsulation,n.standalone,n.signals,n.exportAs,JSON.stringify(n.inputs),JSON.stringify(n.outputs),Object.getOwnPropertyNames(n.type.prototype),!!n.contentQueries,!!n.viewQuery];for(const o of r.join("|"))e=Math.imul(31,e)+o.charCodeAt(0)|0;return e+=2147483648,"c"+e}(t),t})}function zle(n){return Me(n)||kn(n)}function jle(n){return null!==n}function Et(n){return fs(()=>({type:n.type,bootstrap:n.bootstrap||it,declarations:n.declarations||it,imports:n.imports||it,exports:n.exports||it,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null}))}function Hle(n,e){if(null==n)return lo;const t={};for(const r in n)if(n.hasOwnProperty(r)){const i=n[r];let o,s,a,l;Array.isArray(i)?(a=i[0],o=i[1],s=i[2]??o,l=i[3]||null):(o=i,s=i,a=Ov.None,l=null),t[o]=[r,a,l],e[o]=s}return t}function $le(n){if(null==n)return lo;const e={};for(const t in n)n.hasOwnProperty(t)&&(e[n[t]]=t);return e}function ee(n){return fs(()=>{const e=Uz(n);return zz(e),e})}function Fr(n){return{type:n.type,name:n.name,factory:null,pure:!1!==n.pure,standalone:n.standalone??!0,onDestroy:n.type.prototype.ngOnDestroy||null}}function Uz(n){const e={};return{type:n.type,providersResolver:null,factory:null,hostBindings:n.hostBindings||null,hostVars:n.hostVars||0,hostAttrs:n.hostAttrs||null,contentQueries:n.contentQueries||null,declaredInputs:e,inputConfig:n.inputs||lo,exportAs:n.exportAs||null,standalone:n.standalone??!0,signals:!0===n.signals,selectors:n.selectors||it,viewQuery:n.viewQuery||null,features:n.features||null,setInput:null,findHostDirectiveDefs:null,hostDirectives:null,inputs:Hle(n.inputs,e),outputs:$le(n.outputs),debugInfo:null}}function zz(n){n.features?.forEach(e=>e(n))}function Yv(n,e){if(!n)return null;const t=e?Zn:zle;return()=>("function"==typeof n?n():n).map(r=>t(r)).filter(jle)}function ke(n){let e=function jz(n){return Object.getPrototypeOf(n.prototype).constructor}(n.type),t=!0;const r=[n];for(;e;){let i;if(ji(n))i=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new O(903,!1);i=e.\u0275dir}if(i){if(t){r.push(i);const s=n;s.inputs=vS(n.inputs),s.declaredInputs=vS(n.declaredInputs),s.outputs=vS(n.outputs);const a=i.hostBindings;a&&Xle(n,a);const l=i.viewQuery,c=i.contentQueries;if(l&&Qle(n,l),c&&Yle(n,c),Gle(n,i),nne(n.outputs,i.outputs),ji(i)&&i.data.animation){const u=n.data;u.animation=(u.animation||[]).concat(i.data.animation)}}const o=i.features;if(o)for(let s=0;s=0;r--){const i=n[r];i.hostVars=e+=i.hostVars,i.hostAttrs=id(i.hostAttrs,t=id(t,i.hostAttrs))}}(r)}function Gle(n,e){for(const t in e.inputs){if(!e.inputs.hasOwnProperty(t)||n.inputs.hasOwnProperty(t))continue;const r=e.inputs[t];void 0!==r&&(n.inputs[t]=r,n.declaredInputs[t]=e.declaredInputs[t])}}function vS(n){return n===lo?{}:n===it?[]:n}function Qle(n,e){const t=n.viewQuery;n.viewQuery=t?(r,i)=>{e(r,i),t(r,i)}:e}function Yle(n,e){const t=n.contentQueries;n.contentQueries=t?(r,i,o)=>{e(r,i,o),t(r,i,o)}:e}function Xle(n,e){const t=n.hostBindings;n.hostBindings=t?(r,i)=>{e(r,i),t(r,i)}:e}function rn(n,e,t){return!Object.is(n[e],t)&&(n[e]=t,!0)}function qp(n,e,t,r,i,o,s,a,l,c){const u=t+25,d=e.firstCreatePass?function sce(n,e,t,r,i,o,s,a,l){const c=e.consts,u=Id(e,n,4,s||null,a||null);Jy()&&oS(e,t,u,$i(c,l),Rx),u.mergedAttrs=id(u.mergedAttrs,u.attrs),y0(e,u);const d=u.tView=Cx(2,u,r,i,o,e.directiveRegistry,e.pipeRegistry,null,e.schemas,c,null);return null!==e.queries&&(e.queries.template(e,u),d.queries=e.queries.embeddedTView(u)),u}(u,e,n,r,i,o,s,a,l):e.data[u];co(d,!1);const f=Gz(e,n,d,t);np()&&Vv(e,n,f,d),Or(f,n);const p=FU(f,n,f,d);return n[u]=p,Sx(n,p),Ky(d)&&Dx(e,n,d),null!=l&&Ax(n,d,c),d}function et(n,e,t,r,i,o,s,a){const l=L(),c=ve();return qp(l,c,n,e,t,r,i,$i(c.consts,o),s,a),et}let Gz=function Kz(n,e,t,r){return Ro(!0),e[11].createComment("")};let tj=(()=>{class n{log(t){console.log(t)}warn(t){console.warn(t)}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"platform"})}return n})();const lj=new B("");function Gp(n){return!!n&&"function"==typeof n.then}function cj(n){return!!n&&"function"==typeof n.subscribe}const uj=new B("");let dj=(()=>{class n{resolve;reject;initialized=!1;done=!1;donePromise=new Promise((t,r)=>{this.resolve=t,this.reject=r});appInits=b(uj,{optional:!0})??[];injector=b(ze);constructor(){}runInitializers(){if(this.initialized)return;const t=[];for(const i of this.appInits){const o=yi(this.injector,i);if(Gp(o))t.push(o);else if(cj(o)){const s=new Promise((a,l)=>{o.subscribe({complete:a,error:l})});t.push(s)}}const r=()=>{this.done=!0,this.resolve()};Promise.all(t).then(()=>{r()}).catch(i=>{this.reject(i)}),0===t.length&&r(),this.initialized=!0}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),RS=(()=>{class n{static \u0275prov=G({token:n,providedIn:"root",factory:()=>new hj})}return n})();class hj{queuedEffectCount=0;queues=new Map;schedule(e){this.enqueue(e)}remove(e){const r=this.queues.get(e.zone);r.has(e)&&(r.delete(e),this.queuedEffectCount--)}enqueue(e){const t=e.zone;this.queues.has(t)||this.queues.set(t,new Set);const r=this.queues.get(t);r.has(e)||(this.queuedEffectCount++,r.add(e))}flush(){for(;this.queuedEffectCount>0;)for(const[e,t]of this.queues)null===e?this.flushQueue(t):e.run(()=>this.flushQueue(t))}flushQueue(e){for(const t of e)e.delete(t),this.queuedEffectCount--,t.run()}}const Kp=new B("");let tr=(()=>{class n{_runningTick=!1;_destroyed=!1;_destroyListeners=[];_views=[];internalErrorHandler=b(Qre);afterRenderManager=b(J0);zonelessEnabled=b(lp);rootEffectScheduler=b(RS);dirtyFlags=0;deferredDirtyFlags=0;tracingSnapshot=null;externalTestViews=new Set;afterTick=new fe;get allViews(){return[...this.externalTestViews.keys(),...this._views]}get destroyed(){return this._destroyed}componentTypes=[];components=[];isStable=b(Es).hasPendingTasks.pipe(Te(t=>!t));constructor(){b(ld,{optional:!0})}whenStable(){let t;return new Promise(r=>{t=this.isStable.subscribe({next:i=>{i&&r()}})}).finally(()=>{t.unsubscribe()})}_injector=b(mr);_rendererFactory=null;get injector(){return this._injector}bootstrap(t,r){const i=t instanceof sz;if(!this._injector.get(dj).done)throw!i&&function ya(n){const e=Me(n)||kn(n)||Zn(n);return null!==e&&e.standalone}(t),new O(405,!1);let s;s=i?t:this._injector.get(Gv).resolveComponentFactory(t),this.componentTypes.push(s.componentType);const a=function sue(n){return n.isBoundToModule}(s)?void 0:this._injector.get(Ss),c=s.create(ze.NULL,[],r||s.selector,a),u=c.location.nativeElement,d=c.injector.get(lj,null);return d?.registerApplication(u),c.onDestroy(()=>{this.detachView(c.hostView),rb(this.components,c),d?.unregisterApplication(u)}),this._loadComponent(c),c}tick(){this.zonelessEnabled||(this.dirtyFlags|=1),this._tick()}_tick=()=>{if(null!==this.tracingSnapshot){const r=this.tracingSnapshot;return this.tracingSnapshot=null,r.run(Z0.CHANGE_DETECTION,this._tick),void r.dispose()}if(this._runningTick)throw new O(101,!1);const t=Se(null);try{this._runningTick=!0,this.synchronize()}catch(r){this.internalErrorHandler(r)}finally{this._runningTick=!1,Se(t),this.afterTick.next()}};synchronize(){null===this._rendererFactory&&!this._injector.destroyed&&(this._rendererFactory=this._injector.get(Aa,null,{optional:!0})),this.dirtyFlags|=this.deferredDirtyFlags,this.deferredDirtyFlags=0;let t=0;for(;0!==this.dirtyFlags&&t++<10;)this.synchronizeOnce()}synchronizeOnce(){if(this.dirtyFlags|=this.deferredDirtyFlags,this.deferredDirtyFlags=0,16&this.dirtyFlags&&(this.dirtyFlags&=-17,this.rootEffectScheduler.flush()),7&this.dirtyFlags){const t=!!(1&this.dirtyFlags);this.dirtyFlags&=-8,this.dirtyFlags|=8;for(let{_lView:r,notifyErrorHandler:i}of this.allViews)lue(r,i,t,this.zonelessEnabled);if(this.dirtyFlags&=-5,this.syncDirtyFlagsWithViews(),23&this.dirtyFlags)return}else this._rendererFactory?.begin?.(),this._rendererFactory?.end?.();8&this.dirtyFlags&&(this.dirtyFlags&=-9,this.afterRenderManager.execute()),this.syncDirtyFlagsWithViews()}syncDirtyFlagsWithViews(){this.allViews.some(({_lView:t})=>Yy(t))?this.dirtyFlags|=2:this.dirtyFlags&=-8}attachView(t){const r=t;this._views.push(r),r.attachToAppRef(this)}detachView(t){const r=t;rb(this._views,r),r.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(Kp,[]).forEach(i=>i(t))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(t=>t()),this._views.slice().forEach(t=>t.destroy())}finally{this._destroyed=!0,this._views=[],this._destroyListeners=[]}}onDestroy(t){return this._destroyListeners.push(t),()=>rb(this._destroyListeners,t)}destroy(){if(this._destroyed)throw new O(406,!1);const t=this._injector;t.destroy&&!t.destroyed&&t.destroy()}get viewCount(){return this._views.length}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function rb(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}function lue(n,e,t,r){(t||Yy(n))&&Uv(n,e,t&&!r?0:1)}function Ke(n,e,t,r){const i=L();return rn(i,qi(),e)&&(ve(),Po(gt(),i,n,e,t,r)),Ke}function ib(n,e){return n<<17|e<<2}function Oa(n){return n>>17&32767}function PS(n){return 2|n}function _c(n){return(131068&n)>>2}function OS(n,e){return-131069&n|e<<2}function FS(n){return 1|n}function Aj(n,e,t,r){const i=n[t+1],o=null===e;let s=r?Oa(i):_c(i),a=!1;for(;0!==s&&(!1===a||o);){const c=n[s+1];Wue(n[s],e)&&(a=!0,n[s+1]=r?FS(c):PS(c)),s=r?Oa(c):_c(c)}a&&(n[t+1]=r?PS(i):FS(i))}function Wue(n,e){return null===n||null==e||(Array.isArray(n)?n[1]:n)===e||!(!Array.isArray(n)||"string"!=typeof e)&&Ku(n,e)>=0}const Fn={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function Rj(n){return n.substring(Fn.key,Fn.keyEnd)}function Mj(n,e){const t=Fn.textEnd;return t===e?-1:(e=Fn.keyEnd=function Yue(n,e,t){for(;e32;)e++;return e}(n,Fn.key=e,t),Vd(n,e,t))}function Vd(n,e,t){for(;e=0;t=Mj(e,t))_i(n,Rj(e),!0)}function fo(n,e,t,r){const i=L(),o=ve(),s=bs(2);o.firstUpdatePass&&Lj(o,n,s,r),e!==xe&&rn(i,s,e)&&Bj(o,o.data[Jn()],i,i[11],n,i[s+1]=function ade(n,e){return null==n||""===n||("string"==typeof e?n+=e:"object"==typeof n&&(n=Mn(Ei(n)))),n}(e,t),r,s)}function Fj(n,e){return e>=n.expandoStartIndex}function Lj(n,e,t,r){const i=n.data;if(null===i[t+1]){const o=i[Jn()],s=Fj(n,t);zj(o,r)&&null===e&&!s&&(e=!1),e=function ede(n,e,t,r){const i=f0(n);let o=r?e.residualClasses:e.residualStyles;if(null===i)0===(r?e.classBindings:e.styleBindings)&&(t=Yp(t=VS(null,n,e,t,r),e.attrs,r),o=null);else{const s=e.directiveStylingLast;if(-1===s||n[s]!==i)if(t=VS(i,n,e,t,r),null===o){let l=function tde(n,e,t){const r=t?e.classBindings:e.styleBindings;if(0!==_c(r))return n[Oa(r)]}(n,e,r);void 0!==l&&Array.isArray(l)&&(l=VS(null,n,e,l[1],r),l=Yp(l,e.attrs,r),function nde(n,e,t,r){n[Oa(t?e.classBindings:e.styleBindings)]=r}(n,e,r,l))}else o=function rde(n,e,t){let r;const i=e.directiveEnd;for(let o=1+e.directiveStylingLast;o0)&&(c=!0)):u=t,i)if(0!==l){const f=Oa(n[a+1]);n[r+1]=ib(f,a),0!==f&&(n[f+1]=OS(n[f+1],r)),n[a+1]=function jue(n,e){return 131071&n|e<<17}(n[a+1],r)}else n[r+1]=ib(a,0),0!==a&&(n[a+1]=OS(n[a+1],r)),a=r;else n[r+1]=ib(l,0),0===a?a=r:n[l+1]=OS(n[l+1],r),l=r;c&&(n[r+1]=PS(n[r+1])),Aj(n,u,r,!0),Aj(n,u,r,!1),function que(n,e,t,r,i){const o=i?n.residualClasses:n.residualStyles;null!=o&&"string"==typeof e&&Ku(o,e)>=0&&(t[r+1]=FS(t[r+1]))}(e,u,n,r,o),s=ib(a,l),o?e.classBindings=s:e.styleBindings=s}(i,o,e,t,s,r)}}function VS(n,e,t,r,i){let o=null;const s=t.directiveEnd;let a=t.directiveStylingLast;for(-1===a?a=t.directiveStart:a++;a0;){const l=n[i],c=Array.isArray(l),u=c?l[1]:l,d=null===u;let f=t[i+1];f===xe&&(f=d?it:void 0);let p=d?HC(f,r):u===r?f:void 0;if(c&&!ob(p)&&(p=HC(l,r)),ob(p)&&(a=p,s))return a;const m=n[i+1];i=s?Oa(m):_c(m)}if(null!==e){let l=o?e.residualClasses:e.residualStyles;null!=l&&(a=HC(l,r))}return a}function ob(n){return void 0!==n}function zj(n,e){return!!(n.flags&(e?8:16))}class yde{destroy(e){}updateValue(e,t){}swap(e,t){const r=Math.min(e,t),i=Math.max(e,t),o=this.detach(i);if(i-r>1){const s=this.detach(r);this.attach(r,o),this.attach(i,s)}else this.attach(r,o)}move(e,t){this.attach(t,this.detach(e))}}function BS(n,e,t,r,i){return n===t&&Object.is(e,r)?1:Object.is(i(n,e),i(t,r))?-1:0}function US(n,e,t,r){return!(void 0===e||!e.has(r)||(n.attach(t,e.get(r)),e.delete(r),0))}function jj(n,e,t,r,i){if(US(n,e,r,t(r,i)))n.updateValue(r,i);else{const o=n.create(r,i);n.attach(r,o)}}function Hj(n,e,t,r){const i=new Set;for(let o=e;o<=t;o++)i.add(r(o,n.at(o)));return i}class $j{kvMap=new Map;_vMap=void 0;has(e){return this.kvMap.has(e)}delete(e){if(!this.has(e))return!1;const t=this.kvMap.get(e);return void 0!==this._vMap&&this._vMap.has(t)?(this.kvMap.set(e,this._vMap.get(t)),this._vMap.delete(t)):this.kvMap.delete(e),!0}get(e){return this.kvMap.get(e)}set(e,t){if(this.kvMap.has(e)){let r=this.kvMap.get(e);void 0===this._vMap&&(this._vMap=new Map);const i=this._vMap;for(;i.has(r);)r=i.get(r);i.set(r,t)}else this.kvMap.set(e,t)}forEach(e){for(let[t,r]of this.kvMap)if(e(r,t),void 0!==this._vMap){const i=this._vMap;for(;i.has(r);)r=i.get(r),e(r,t)}}}function Pt(n,e){On("NgControlFlow");const t=L(),r=qi(),i=t[r]!==xe?t[r]:-1,o=-1!==i?sb(t,25+i):void 0;if(rn(t,r,n)){const a=Se(null);try{if(void 0!==o&&Hx(o,0),-1!==n){const l=25+n,c=sb(t,l),u=zS(t[1],l),d=null;Ed(c,vd(t,u,e,{dehydratedView:d}),0,hc(u,d))}}finally{Se(a)}}else if(void 0!==o){const a=LU(o,0);void 0!==a&&(a[8]=e)}}class bde{lContainer;$implicit;$index;constructor(e,t,r){this.lContainer=e,this.$implicit=t,this.$index=r}get $count(){return this.lContainer.length-10}}function qj(n,e){return e}class Ede{hasEmptyBlock;trackByFn;liveCollection;constructor(e,t,r){this.hasEmptyBlock=e,this.trackByFn=t,this.liveCollection=r}}class Ide extends yde{lContainer;hostLView;templateTNode;operationsCounter=void 0;needsIndexUpdate=!1;constructor(e,t,r){super(),this.lContainer=e,this.hostLView=t,this.templateTNode=r}get length(){return this.lContainer.length-10}at(e){return this.getLView(e)[8].$implicit}attach(e,t){const r=t[6];this.needsIndexUpdate||=e!==this.length,Ed(this.lContainer,t,e,hc(this.templateTNode,r))}detach(e){return this.needsIndexUpdate||=e!==this.length-1,function Tde(n,e){return Mp(n,e)}(this.lContainer,e)}create(e,t){const i=vd(this.hostLView,this.templateTNode,new bde(this.lContainer,t,e),{dehydratedView:null});return this.operationsCounter?.recordCreate(),i}destroy(e){Ap(e[1],e),this.operationsCounter?.recordDestroy()}updateValue(e,t){this.getLView(e)[8].$implicit=t}reset(){this.needsIndexUpdate=!1,this.operationsCounter?.reset()}updateIndexes(){if(this.needsIndexUpdate)for(let e=0;e(Ro(!0),Nv(r,i,function t2(){return be.lFrame.currentNamespace}()));function jS(n,e,t){const r=L(),i=ve(),o=n+25,s=i.firstCreatePass?function Dde(n,e,t,r,i){const o=e.consts,s=$i(o,r),a=Id(e,n,8,"ng-container",s);null!==s&&iS(a,s,!0);const l=$i(o,i);return Jy()&&oS(e,t,a,l,Rx),a.mergedAttrs=id(a.mergedAttrs,a.attrs),null!==e.queries&&e.queries.elementStart(e,a),a}(o,i,r,e,t):i.data[o];co(s,!0);const a=Qj(i,r,s,n);return r[o]=a,np()&&Vv(i,r,a,s),Or(a,r),Ky(s)&&(Dx(i,r,s),fx(i,s,r)),null!=t&&Ax(r,s),jS}function HS(){let n=Fe();const e=ve();return u0()?d0():(n=n.parent,co(n,!1)),e.firstCreatePass&&(y0(e,n),e0(n)&&e.queries.elementEnd(n)),HS}function Xp(n,e,t){return jS(n,e,t),HS(),Xp}let Qj=(n,e,t,r)=>(Ro(!0),Tx(e[11],""));function La(){return L()}function Bo(n,e,t){const r=L();return rn(r,qi(),e)&&ri(ve(),gt(),r,n,e,r[11],t,!0),Bo}function $S(n,e,t){const r=L();if(rn(r,qi(),e)){const o=ve(),s=gt();ri(o,s,r,n,e,yU(f0(o.data),s,r),t,!0)}return $S}const ab="en-US";let Zj=ab;function Ve(n,e,t,r){const i=L(),o=ve(),s=Fe();return KS(o,i,i[11],s,n,e,r),Ve}function GS(n,e){const t=Fe(),r=L(),i=ve();return KS(i,r,yU(f0(i.data),t,r),t,n,e),GS}function KS(n,e,t,r,i,o,s){const a=Ky(r),c=n.firstCreatePass&&HV(n),u=e[8],d=jV(e);let f=!0;if(3&r.type||s){const _=_r(r,e),v=s?s(_):_,E=d.length,C=s?V=>s(Je(V[r.index])):r.index;let R=null;if(!s&&a&&(R=function whe(n,e,t,r){const i=n.cleanup;if(null!=i)for(let o=0;ol?a[l]:null}"string"==typeof s&&(o+=2)}return null}(n,e,i,r.index)),null!==R)(R.__ngLastListenerFn__||R).__ngNextListenerFn__=o,R.__ngLastListenerFn__=o,f=!1;else{o=vH(r,e,u,o);const V=t.listen(v,i,o);d.push(o,V),c&&c.push(i,C,E,E+1)}}else o=vH(r,e,u,o);const p=r.outputs;let m;if(f&&null!==p&&(m=p[i])){const _=m.length;if(_)for(let v=0;v<_;v+=2){const H=e[m[v]][m[v+1]].subscribe(o),Q=d.length;d.push(o,H),c&&c.push(i,r.index,Q,-(Q+1))}}}function yH(n,e,t,r){const i=Se(null);try{return!1!==t(r)}catch(o){return Fv(n,o),!1}finally{Se(i)}}function vH(n,e,t,r){return function i(o){if(o===Function)return r;Rp(zi(n)?kr(n.index,e):e,5);let a=yH(e,0,r,o),l=i.__ngNextListenerFn__;for(;l;)a=yH(e,0,l,o)&&a,l=l.__ngNextListenerFn__;return a}}function Ln(n=1){return function fre(n){return(be.lFrame.contextLView=function zV(n,e){for(;n>0;)e=e[14],n--;return e}(n,be.lFrame.contextLView))[8]}(n)}function Ehe(n,e){let t=null;const r=function tse(n){const e=n.attrs;if(null!=e){const t=e.indexOf(5);if(!(1&t))return e[t+1]}return null}(n);for(let i=0;it._dirtyCounter.update(r=>r+1))}(e,Tz(n,t,r,i))}function rm(n){return function rc(n,e){return n[e]}(function qV(){return be.lFrame.contextLView}(),25+n)}function Oe(n,e=""){const t=L(),r=ve(),i=n+25,o=r.firstCreatePass?Id(r,i,1,e,null):r.data[i],s=UH(r,t,o,e,n);t[i]=s,np()&&Vv(r,t,s,o),co(o,!1)}let UH=(n,e,t,r,i)=>(Ro(!0),function Ix(n,e){return n.createText(e)}(e[11],r));function zd(n){return Va("",n,""),zd}function Va(n,e,t){const r=L(),i=function Rd(n,e,t,r){return rn(n,qi(),t)?e+Ce(t)+r:xe}(r,n,e,t);return i!==xe&&function Ds(n,e,t){const r=nd(e,n);!function aU(n,e,t){n.setValue(e,t)}(n[11],r,t)}(r,Jn(),i),Va}function XS(n,e,t,r,i){if(n=ye(n),Array.isArray(n))for(let o=0;o>20;if(Xl(n)||!n.multi){const p=new rp(c,i,$),m=JS(l,e,i?u:u+f,d);-1===m?(x0(ov(a,s),o,l),ZS(o,n,e.length),e.push(l),a.directiveStart++,a.directiveEnd++,i&&(a.providerIndexes+=1048576),t.push(p),s.push(p)):(t[m]=p,s[m]=p)}else{const p=JS(l,e,u+f,d),m=JS(l,e,u,u+f),v=m>=0&&t[m];if(i&&!v||!i&&!(p>=0&&t[p])){x0(ov(a,s),o,l);const E=function Hhe(n,e,t,r,i){const o=new rp(n,t,$);return o.multi=[],o.index=e,o.componentProviders=0,JH(o,i,r&&!t),o}(i?jhe:zhe,t.length,i,r,c);!i&&v&&(t[m].providerFactory=E),ZS(o,n,e.length,0),e.push(l),a.directiveStart++,a.directiveEnd++,i&&(a.providerIndexes+=1048576),t.push(E),s.push(E)}else ZS(o,n,p>-1?p:m,JH(t[i?m:p],c,!i&&r));!i&&r&&v&&t[m].componentProviders++}}}function ZS(n,e,t,r){const i=Xl(e),o=function Dne(n){return!!n.useClass}(e);if(i||o){const l=(o?ye(e.useClass):e).prototype.ngOnDestroy;if(l){const c=n.destroyHooks||(n.destroyHooks=[]);if(!i&&e.multi){const u=c.indexOf(t);-1===u?c.push(t,[r,l]):c[u+1].push(r,l)}else c.push(t,l)}}}function JH(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function JS(n,e,t,r){for(let i=t;i{t.providersResolver=(r,i)=>function Uhe(n,e,t){const r=ve();if(r.firstCreatePass){const i=ji(n);XS(t,r.data,r.blueprint,i,!0),XS(e,r.data,r.blueprint,i,!1)}}(r,i?i(n):n,e)}}function t$(n,e,t,r){return function n$(n,e,t,r,i,o){const s=e+t;return rn(n,s,i)?function Fo(n,e,t){return n[e]=t}(n,s+1,o?r.call(o,i):r(i)):function im(n,e){const t=n[e];return t===xe?void 0:t}(n,s+1)}(L(),function Nr(){const n=be.lFrame;let e=n.bindingRootIndex;return-1===e&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}(),n,e,t,r)}function tD(n,e){return zv(n,e)}class vc{full;major;minor;patch;constructor(e){this.full=e;const t=e.split(".");this.major=t[0],this.minor=t[1],this.patch=t.slice(2).join(".")}}const Ffe=new vc("19.1.7");class Lfe{ngModuleFactory;componentFactories;constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}}let Vfe=(()=>{class n{compileModuleSync(t){return new _S(t)}compileModuleAsync(t){return Promise.resolve(this.compileModuleSync(t))}compileModuleAndAllComponentsSync(t){const r=this.compileModuleSync(t),o=Ii(pr(t).declarations).reduce((s,a)=>{const l=Me(a);return l&&s.push(new jp(l)),s},[]);return new Lfe(r,o)}compileModuleAndAllComponentsAsync(t){return Promise.resolve(this.compileModuleAndAllComponentsSync(t))}clearCache(){}clearCacheFor(t){}getModuleId(t){}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),zfe=(()=>{class n{zone=b(ue);changeDetectionScheduler=b(ws);applicationRef=b(tr);_onMicrotaskEmptySubscription;initialize(){this._onMicrotaskEmptySubscription||(this._onMicrotaskEmptySubscription=this.zone.onMicrotaskEmpty.subscribe({next:()=>{this.changeDetectionScheduler.runningTick||this.zone.run(()=>{this.applicationRef.tick()})}}))}ngOnDestroy(){this._onMicrotaskEmptySubscription?.unsubscribe()}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function sD({ngZoneFactory:n,ignoreChangesOutsideZone:e,scheduleInRootZone:t}){return n??=()=>new ue({...aD(),scheduleInRootZone:t}),[{provide:ue,useFactory:n},{provide:Bi,multi:!0,useFactory:()=>{const r=b(zfe,{optional:!0});return()=>r.initialize()}},{provide:Bi,multi:!0,useFactory:()=>{const r=b(Hfe);return()=>{r.initialize()}}},!0===e?{provide:S2,useValue:!0}:[],{provide:A0,useValue:t??C2}]}function aD(n){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:n?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:n?.runCoalescing??!1}}let Hfe=(()=>{class n{subscription=new Kt;initialized=!1;zone=b(ue);pendingTasks=b(Es);initialize(){if(this.initialized)return;this.initialized=!0;let t=null;!this.zone.isStable&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(t=this.pendingTasks.add()),this.zone.runOutsideAngular(()=>{this.subscription.add(this.zone.onStable.subscribe(()=>{ue.assertNotInAngularZone(),queueMicrotask(()=>{null!==t&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(this.pendingTasks.remove(t),t=null)})}))}),this.subscription.add(this.zone.onUnstable.subscribe(()=>{ue.assertInAngularZone(),t??=this.pendingTasks.add()}))}ngOnDestroy(){this.subscription.unsubscribe()}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),am=(()=>{class n{appRef=b(tr);taskService=b(Es);ngZone=b(ue);zonelessEnabled=b(lp);tracing=b(ld,{optional:!0});disableScheduling=b(S2,{optional:!0})??!1;zoneIsDefined=typeof Zone<"u"&&!!Zone.root.run;schedulerTickApplyArgs=[{data:{__scheduler_tick__:!0}}];subscriptions=new Kt;angularZoneId=this.zoneIsDefined?this.ngZone._inner?.get(cv):null;scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(b(A0,{optional:!0})??!1);cancelScheduledCallback=null;useMicrotaskScheduler=!1;runningTick=!1;pendingRenderTaskId=null;constructor(){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 P0||!this.zoneIsDefined)}notify(t){if(!this.zonelessEnabled&&5===t)return;let r=!1;switch(t){case 0:this.appRef.dirtyFlags|=2;break;case 3:case 2:case 4:case 5:case 1:this.appRef.dirtyFlags|=4;break;case 8:this.appRef.deferredDirtyFlags|=8;break;case 6:case 14:this.appRef.dirtyFlags|=2,r=!0;break;case 13:this.appRef.dirtyFlags|=16,r=!0;break;case 12:r=!0;break;default:this.appRef.dirtyFlags|=8}if(this.appRef.tracingSnapshot=this.tracing?.snapshot(this.appRef.tracingSnapshot)??null,!this.shouldScheduleTick(r))return;const i=this.useMicrotaskScheduler?A2:D2;this.pendingRenderTaskId=this.taskService.add(),this.cancelScheduledCallback=this.scheduleInRootZone?Zone.root.run(()=>i(()=>this.tick())):this.ngZone.runOutsideAngular(()=>i(()=>this.tick()))}shouldScheduleTick(t){return!(this.disableScheduling&&!t||this.appRef.destroyed||null!==this.pendingRenderTaskId||this.runningTick||this.appRef._runningTick||!this.zonelessEnabled&&this.zoneIsDefined&&Zone.current.get(cv+this.angularZoneId))}tick(){if(this.runningTick||this.appRef.destroyed)return;if(0===this.appRef.dirtyFlags)return void this.cleanup();!this.zonelessEnabled&&7&this.appRef.dirtyFlags&&(this.appRef.dirtyFlags|=1);const t=this.taskService.add();try{this.ngZone.run(()=>{this.runningTick=!0,this.appRef._tick()},void 0,this.schedulerTickApplyArgs)}catch(r){throw this.taskService.remove(t),r}finally{this.cleanup()}this.useMicrotaskScheduler=!0,A2(()=>{this.useMicrotaskScheduler=!1,this.taskService.remove(t)})}ngOnDestroy(){this.subscriptions.unsubscribe(),this.cleanup()}cleanup(){if(this.runningTick=!1,this.cancelScheduledCallback?.(),this.cancelScheduledCallback=null,null!==this.pendingRenderTaskId){const t=this.pendingRenderTaskId;this.pendingRenderTaskId=null,this.taskService.remove(t)}}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const As=new B("",{providedIn:"root",factory:()=>b(As,Le.Optional|Le.SkipSelf)||function $fe(){return typeof $localize<"u"&&$localize.locale||ab}()}),pb=new B(""),Yfe=new B("");function lm(n){return!n.moduleRef}let Ba=null;function k$(){return!1}let Uo=(()=>class n{static __NG_ELEMENT_ID__=npe})();function npe(n){return function rpe(n,e,t){if(zi(n)&&!t){const r=kr(n.index,e);return new kp(r,r)}return 175&n.type?new kp(e[15],e):null}(Fe(),L(),!(16&~n))}function xpe(n){try{const{rootComponent:e,appProviders:t,platformProviders:r}=n,i=function tpe(n=[]){if(Ba)return Ba;const e=function R$(n=[],e){return ze.create({name:e,providers:[{provide:KC,useValue:"platform"},{provide:pb,useValue:new Set([()=>Ba=null])},...n]})}(n);return Ba=e,function fj(){!function Ote(n){GL=n}(()=>{throw new O(600,!1)})}(),function M$(n){const e=n.get(U0,null);yi(n,()=>{e?.forEach(t=>t())})}(e),e}(r),o=[sD({}),{provide:ws,useExisting:am},...t||[]];return function S$(n){const e=lm(n)?n.r3Injector:n.moduleRef.injector,t=e.get(ue);return t.run(()=>{lm(n)?n.r3Injector.resolveInjectorInitializers():n.moduleRef.resolveInjectorInitializers();const r=e.get(wi,null);let i;if(t.runOutsideAngular(()=>{i=t.onError.subscribe({next:o=>{r.handleError(o)}})}),lm(n)){const o=()=>e.destroy(),s=n.platformInjector.get(pb);s.add(o),e.onDestroy(()=>{i.unsubscribe(),s.delete(o)})}else{const o=()=>n.moduleRef.destroy(),s=n.platformInjector.get(pb);s.add(o),n.moduleRef.onDestroy(()=>{rb(n.allPlatformModules,n.moduleRef),i.unsubscribe(),s.delete(o)})}return function Zfe(n,e,t){try{const r=t();return Gp(r)?r.catch(i=>{throw e.runOutsideAngular(()=>n.handleError(i)),i}):r}catch(r){throw e.runOutsideAngular(()=>n.handleError(r)),r}}(r,t,()=>{const o=e.get(dj);return o.runInitializers(),o.donePromise.then(()=>{if(function Lde(n){"string"==typeof n&&(Zj=n.toLowerCase().replace(/_/g,"-"))}(e.get(As,ab)||ab),!e.get(Yfe,!0))return lm(n)?e.get(tr):(n.allPlatformModules.push(n.moduleRef),n.moduleRef);if(lm(n)){const l=e.get(tr);return void 0!==n.rootComponent&&l.bootstrap(n.rootComponent),l}return function Xfe(n,e){const t=n.injector.get(tr);if(n._bootstrapComponents.length>0)n._bootstrapComponents.forEach(r=>t.bootstrap(r));else{if(!n.instance.ngDoBootstrap)throw new O(-403,!1);n.instance.ngDoBootstrap(t)}e.push(n)}(n.moduleRef,n.allPlatformModules),n.moduleRef})})})}({r3Injector:new Bz({providers:o,parent:i,debugName:"",runEnvironmentInitializers:!1}).injector,platformInjector:i,rootComponent:e})}catch(e){return Promise.reject(e)}}function _t(n){return"boolean"==typeof n?n:null!=n&&"false"!==n}function $d(n,e=NaN){return isNaN(parseFloat(n))||isNaN(Number(n))?e:Number(n)}function xi(n,e){On("NgSignals");const t=WL(n);return e?.equal&&(t[In].equal=e.equal),t}function Wn(n){const e=Se(null);try{return n()}finally{Se(e)}}let _3=(()=>class n{view;node;constructor(t,r){this.view=t,this.node=r}static __NG_ELEMENT_ID__=Jpe})();function Jpe(){return new _3(L(),Fe())}class ome{[In];constructor(e){this[In]=e}destroy(){this[In].destroy()}}function pm(n,e){On("NgSignals"),!e?.injector&&va();const t=e?.injector??b(ze);let i,r=!0!==e?.manualCleanup?t.get(uo):null;const o=t.get(_3,null,{optional:!0}),s=t.get(ws);return null===o||e?.forceRoot?i=function cme(n,e,t){const r=Object.create(sme);return r.fn=n,r.scheduler=e,r.notifier=t,r.zone=typeof Zone<"u"?Zone.current:null,r.scheduler.schedule(r),r.notifier.notify(13),r}(n,t.get(RS),s):(i=function lme(n,e,t){const r=Object.create(ame);return r.view=n,r.zone=typeof Zone<"u"?Zone.current:null,r.notifier=e,r.fn=t,n[23]??=new Set,n[23].add(r),r.consumerMarkedDirty(r),r}(o.view,s,n),r instanceof x2&&r._lView===o.view&&(r=null)),i.injector=t,null!==r&&(i.onDestroyFn=r.onDestroy(()=>i.destroy())),new ome(i)}const y3={...$l,consumerIsAlwaysLive:!0,consumerAllowSignalWrites:!0,dirty:!0,hasRun:!1,cleanupFns:void 0,zone:null,kind:"effect",onDestroyFn:cp,run(){if(this.dirty=!1,this.hasRun&&!$f(this))return;this.hasRun=!0;const n=r=>(this.cleanupFns??=[]).push(r),e=ql(this),t=ev(!1);try{this.maybeCleanup(),this.fn(n)}finally{ev(t),Bu(this,e)}},maybeCleanup(){if(this.cleanupFns?.length)try{for(;this.cleanupFns.length;)this.cleanupFns.pop()()}finally{this.cleanupFns=[]}}},sme={...y3,consumerMarkedDirty(){this.scheduler.schedule(this),this.notifier.notify(13)},destroy(){qf(this),this.onDestroyFn(),this.maybeCleanup(),this.scheduler.remove(this)}},ame={...y3,consumerMarkedDirty(){this.view[2]|=8192,Jf(this.view),this.notifier.notify(14)},destroy(){qf(this),this.onDestroyFn(),this.maybeCleanup(),this.view[23]?.delete(this)}};function vD(n,e){const t=Me(n),r=e.elementInjector||Hy();return new jp(t).create(r,e.projectableNodes,e.hostElement,e.environmentInjector)}let b3=null;function Ua(){return b3}class yme{}const Xe=new B("");let w3=(()=>{class n{historyGo(t){throw new Error("")}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:()=>b(vme),providedIn:"platform"})}return n})(),vme=(()=>{class n extends w3{_location;_history;_doc=b(Xe);constructor(){super(),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return Ua().getBaseHref(this._doc)}onPopState(t){const r=Ua().getGlobalEventTarget(this._doc,"window");return r.addEventListener("popstate",t,!1),()=>r.removeEventListener("popstate",t)}onHashChange(t){const r=Ua().getGlobalEventTarget(this._doc,"window");return r.addEventListener("hashchange",t,!1),()=>r.removeEventListener("hashchange",t)}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(t){this._location.pathname=t}pushState(t,r,i){this._history.pushState(t,r,i)}replaceState(t,r,i){this._history.replaceState(t,r,i)}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:()=>new n,providedIn:"platform"})}return n})();function E3(n,e){return n?e?n.endsWith("/")?e.startsWith("/")?n+e.slice(1):n+e:e.startsWith("/")?n+e:`${n}/${e}`:n:e}function I3(n){const e=n.search(/#|\?|$/);return"/"===n[e-1]?n.slice(0,e-1)+n.slice(e):n}function wc(n){return n&&"?"!==n[0]?`?${n}`:n}let Sb=(()=>{class n{historyGo(t){throw new Error("")}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:()=>b(wme),providedIn:"root"})}return n})();const bme=new B("");let wme=(()=>{class n extends Sb{_platformLocation;_baseHref;_removeListenerFns=[];constructor(t,r){super(),this._platformLocation=t,this._baseHref=r??this._platformLocation.getBaseHrefFromDOM()??b(Xe).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return E3(this._baseHref,t)}path(t=!1){const r=this._platformLocation.pathname+wc(this._platformLocation.search),i=this._platformLocation.hash;return i&&t?`${r}${i}`:r}pushState(t,r,i,o){const s=this.prepareExternalUrl(i+wc(o));this._platformLocation.pushState(t,r,s)}replaceState(t,r,i,o){const s=this.prepareExternalUrl(i+wc(o));this._platformLocation.replaceState(t,r,s)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(t=0){this._platformLocation.historyGo?.(t)}static \u0275fac=function(r){return new(r||n)(me(w3),me(bme,8))};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),qd=(()=>{class n{_subject=new fe;_basePath;_locationStrategy;_urlChangeListeners=[];_urlChangeSubscription=null;constructor(t){this._locationStrategy=t;const r=this._locationStrategy.getBaseHref();this._basePath=function Tme(n){if(new RegExp("^(https?:)?//").test(n)){const[,t]=n.split(/\/\/[^\/]+/);return t}return n}(I3(T3(r))),this._locationStrategy.onPopState(i=>{this._subject.next({url:this.path(!0),pop:!0,state:i.state,type:i.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(t=!1){return this.normalize(this._locationStrategy.path(t))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(t,r=""){return this.path()==this.normalize(t+wc(r))}normalize(t){return n.stripTrailingSlash(function Ime(n,e){if(!n||!e.startsWith(n))return e;const t=e.substring(n.length);return""===t||["/",";","?","#"].includes(t[0])?t:e}(this._basePath,T3(t)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._locationStrategy.prepareExternalUrl(t)}go(t,r="",i=null){this._locationStrategy.pushState(i,"",t,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+wc(r)),i)}replaceState(t,r="",i=null){this._locationStrategy.replaceState(i,"",t,r),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+wc(r)),i)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(t=0){this._locationStrategy.historyGo?.(t)}onUrlChange(t){return this._urlChangeListeners.push(t),this._urlChangeSubscription??=this.subscribe(r=>{this._notifyUrlChangeListeners(r.url,r.state)}),()=>{const r=this._urlChangeListeners.indexOf(t);this._urlChangeListeners.splice(r,1),0===this._urlChangeListeners.length&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(t="",r){this._urlChangeListeners.forEach(i=>i(t,r))}subscribe(t,r,i){return this._subject.subscribe({next:t,error:r??void 0,complete:i??void 0})}static normalizeQueryParams=wc;static joinWithSlash=E3;static stripTrailingSlash=I3;static \u0275fac=function(r){return new(r||n)(me(Sb))};static \u0275prov=G({token:n,factory:()=>function Eme(){return new qd(me(Sb))}(),providedIn:"root"})}return n})();function T3(n){return n.replace(/\/index.html$/,"")}const AD=/\s+/,N3=[];let RD=(()=>{class n{_ngEl;_renderer;initialClasses=N3;rawClass;stateMap=new Map;constructor(t,r){this._ngEl=t,this._renderer=r}set klass(t){this.initialClasses=null!=t?t.trim().split(AD):N3}set ngClass(t){this.rawClass="string"==typeof t?t.trim().split(AD):t}ngDoCheck(){for(const r of this.initialClasses)this._updateState(r,!0);const t=this.rawClass;if(Array.isArray(t)||t instanceof Set)for(const r of t)this._updateState(r,!0);else if(null!=t)for(const r of Object.keys(t))this._updateState(r,!!t[r]);this._applyStateDiff()}_updateState(t,r){const i=this.stateMap.get(t);void 0!==i?(i.enabled!==r&&(i.changed=!0,i.enabled=r),i.touched=!0):this.stateMap.set(t,{enabled:r,changed:!0,touched:!0})}_applyStateDiff(){for(const t of this.stateMap){const r=t[0],i=t[1];i.changed?(this._toggleClass(r,i.enabled),i.changed=!1):i.touched||(i.enabled&&this._toggleClass(r,!1),this.stateMap.delete(r)),i.touched=!1}}_toggleClass(t,r){(t=t.trim()).length>0&&t.split(AD).forEach(i=>{r?this._renderer.addClass(this._ngEl.nativeElement,i):this._renderer.removeClass(this._ngEl.nativeElement,i)})}static \u0275fac=function(r){return new(r||n)($(je),$(Ti))};static \u0275dir=ee({type:n,selectors:[["","ngClass",""]],inputs:{klass:[0,"class","klass"],ngClass:"ngClass"}})}return n})(),Bb=(()=>{class n{_viewContainer;_context=new hge;_thenTemplateRef=null;_elseTemplateRef=null;_thenViewRef=null;_elseViewRef=null;constructor(t,r){this._viewContainer=t,this._thenTemplateRef=r}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){F3("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){F3("ngIfElse",t),this._elseTemplateRef=t,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 ngIfUseIfTypeGuard;static ngTemplateGuard_ngIf;static ngTemplateContextGuard(t,r){return!0}static \u0275fac=function(r){return new(r||n)($(Ci),$(Oo))};static \u0275dir=ee({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}})}return n})();class hge{$implicit=null;ngIf=null}function F3(n,e){if(e&&!e.createEmbeddedView)throw new Error(`${n} must be a TemplateRef, but received '${Mn(e)}'.`)}let ND=(()=>{class n{_viewContainerRef;_viewRef=null;ngTemplateOutletContext=null;ngTemplateOutlet=null;ngTemplateOutletInjector=null;constructor(t){this._viewContainerRef=t}ngOnChanges(t){if(this._shouldRecreateView(t)){const r=this._viewContainerRef;if(this._viewRef&&r.remove(r.indexOf(this._viewRef)),!this.ngTemplateOutlet)return void(this._viewRef=null);const i=this._createContextForwardProxy();this._viewRef=r.createEmbeddedView(this.ngTemplateOutlet,i,{injector:this.ngTemplateOutletInjector??void 0})}}_shouldRecreateView(t){return!!t.ngTemplateOutlet||!!t.ngTemplateOutletInjector}_createContextForwardProxy(){return new Proxy({},{set:(t,r,i)=>!!this.ngTemplateOutletContext&&Reflect.set(this.ngTemplateOutletContext,r,i),get:(t,r,i)=>{if(this.ngTemplateOutletContext)return Reflect.get(this.ngTemplateOutletContext,r,i)}})}static \u0275fac=function(r){return new(r||n)($(Ci))};static \u0275dir=ee({type:n,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet",ngTemplateOutletInjector:"ngTemplateOutletInjector"},features:[ei]})}return n})(),za=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({})}return n})();const B3="browser";function U3(n){return"server"===n}class g_e extends yme{supportsDOMEvents=!0}class BD extends g_e{static makeCurrent(){!function _me(n){b3??=n}(new BD)}onAndCancel(e,t,r,i){return e.addEventListener(t,r,i),()=>{e.removeEventListener(t,r,i)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){e.remove()}createElement(e,t){return(t=t||this.getDefaultDocument()).createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return"window"===t?window:"document"===t?e:"body"===t?e.body:null}getBaseHref(e){const t=function __e(){return ym=ym||document.querySelector("base"),ym?ym.getAttribute("href"):null}();return null==t?null:function y_e(n){return new URL(n,document.baseURI).pathname}(t)}resetBaseElement(){ym=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return function lge(n,e){e=encodeURIComponent(e);for(const t of n.split(";")){const r=t.indexOf("="),[i,o]=-1==r?[t,""]:[t.slice(0,r),t.slice(r+1)];if(i.trim()===e)return decodeURIComponent(o)}return null}(document.cookie,e)}}let ym=null,b_e=(()=>{class n{build(){return new XMLHttpRequest}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac})}return n})();const UD=new B("");let X3=(()=>{class n{_zone;_plugins;_eventNameToPlugin=new Map;constructor(t,r){this._zone=r,t.forEach(i=>{i.manager=this}),this._plugins=t.slice().reverse()}addEventListener(t,r,i,o){return this._findPluginFor(r).addEventListener(t,r,i,o)}getZone(){return this._zone}_findPluginFor(t){let r=this._eventNameToPlugin.get(t);if(r)return r;if(r=this._plugins.find(o=>o.supports(t)),!r)throw new O(5101,!1);return this._eventNameToPlugin.set(t,r),r}static \u0275fac=function(r){return new(r||n)(me(UD),me(ue))};static \u0275prov=G({token:n,factory:n.\u0275fac})}return n})();class Z3{_doc;constructor(e){this._doc=e}manager}const Hb="ng-app-id";function J3(n){for(const e of n)e.remove()}function e4(n,e){const t=e.createElement("style");return t.textContent=n,t}function zD(n,e){const t=e.createElement("link");return t.setAttribute("rel","stylesheet"),t.setAttribute("href",n),t}let t4=(()=>{class n{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;isServer;constructor(t,r,i,o={}){this.doc=t,this.appId=r,this.nonce=i,this.isServer=U3(o),function w_e(n,e,t,r){const i=n.head?.querySelectorAll(`style[${Hb}="${e}"],link[${Hb}="${e}"]`);if(i)for(const o of i)o.removeAttribute(Hb),o instanceof HTMLLinkElement?r.set(o.href.slice(o.href.lastIndexOf("/")+1),{usage:0,elements:[o]}):o.textContent&&t.set(o.textContent,{usage:0,elements:[o]})}(t,r,this.inline,this.external),this.hosts.add(t.head)}addStyles(t,r){for(const i of t)this.addUsage(i,this.inline,e4);r?.forEach(i=>this.addUsage(i,this.external,zD))}removeStyles(t,r){for(const i of t)this.removeUsage(i,this.inline);r?.forEach(i=>this.removeUsage(i,this.external))}addUsage(t,r,i){const o=r.get(t);o?o.usage++:r.set(t,{usage:1,elements:[...this.hosts].map(s=>this.addElement(s,i(t,this.doc)))})}removeUsage(t,r){const i=r.get(t);i&&(i.usage--,i.usage<=0&&(J3(i.elements),r.delete(t)))}ngOnDestroy(){for(const[,{elements:t}]of[...this.inline,...this.external])J3(t);this.hosts.clear()}addHost(t){this.hosts.add(t);for(const[r,{elements:i}]of this.inline)i.push(this.addElement(t,e4(r,this.doc)));for(const[r,{elements:i}]of this.external)i.push(this.addElement(t,zD(r,this.doc)))}removeHost(t){this.hosts.delete(t)}addElement(t,r){return this.nonce&&r.setAttribute("nonce",this.nonce),this.isServer&&r.setAttribute(Hb,this.appId),t.appendChild(r)}static \u0275fac=function(r){return new(r||n)(me(Xe),me(Is),me(z0,8),me(Ia))};static \u0275prov=G({token:n,factory:n.\u0275fac})}return n})();const jD={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"},HD=/%COMP%/g,S_e=new B("",{providedIn:"root",factory:()=>!0});function r4(n,e){return e.map(t=>t.replace(HD,n))}let $D=(()=>{class n{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;platformId;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;platformIsServer;constructor(t,r,i,o,s,a,l,c=null,u=null){this.eventManager=t,this.sharedStylesHost=r,this.appId=i,this.removeStylesOnCompDestroy=o,this.doc=s,this.platformId=a,this.ngZone=l,this.nonce=c,this.tracingService=u,this.platformIsServer=U3(a),this.defaultRenderer=new qD(t,s,l,this.platformIsServer,this.tracingService)}createRenderer(t,r){if(!t||!r)return this.defaultRenderer;this.platformIsServer&&r.encapsulation===Wi.ShadowDom&&(r={...r,encapsulation:Wi.Emulated});const i=this.getOrCreateRenderer(t,r);return i instanceof s4?i.applyToHost(t):i instanceof WD&&i.applyStyles(),i}getOrCreateRenderer(t,r){const i=this.rendererByCompId;let o=i.get(r.id);if(!o){const s=this.doc,a=this.ngZone,l=this.eventManager,c=this.sharedStylesHost,u=this.removeStylesOnCompDestroy,d=this.platformIsServer,f=this.tracingService;switch(r.encapsulation){case Wi.Emulated:o=new s4(l,c,r,this.appId,u,s,a,d,f);break;case Wi.ShadowDom:return new M_e(l,c,t,r,s,a,this.nonce,d,f);default:o=new WD(l,c,r,u,s,a,d,f)}i.set(r.id,o)}return o}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(t){this.rendererByCompId.delete(t)}static \u0275fac=function(r){return new(r||n)(me(X3),me(t4),me(Is),me(S_e),me(Xe),me(Ia),me(ue),me(z0),me(ld,8))};static \u0275prov=G({token:n,factory:n.\u0275fac})}return n})();class qD{eventManager;doc;ngZone;platformIsServer;tracingService;data=Object.create(null);throwOnSyntheticProps=!0;constructor(e,t,r,i,o){this.eventManager=e,this.doc=t,this.ngZone=r,this.platformIsServer=i,this.tracingService=o}destroy(){}destroyNode=null;createElement(e,t){return t?this.doc.createElementNS(jD[t]||t,e):this.doc.createElement(e)}createComment(e){return this.doc.createComment(e)}createText(e){return this.doc.createTextNode(e)}appendChild(e,t){(o4(e)?e.content:e).appendChild(t)}insertBefore(e,t,r){e&&(o4(e)?e.content:e).insertBefore(t,r)}removeChild(e,t){t.remove()}selectRootElement(e,t){let r="string"==typeof e?this.doc.querySelector(e):e;if(!r)throw new O(-5104,!1);return t||(r.textContent=""),r}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,r,i){if(i){t=i+":"+t;const o=jD[i];o?e.setAttributeNS(o,t,r):e.setAttribute(t,r)}else e.setAttribute(t,r)}removeAttribute(e,t,r){if(r){const i=jD[r];i?e.removeAttributeNS(i,t):e.removeAttribute(`${r}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,r,i){i&(Sa.DashCase|Sa.Important)?e.style.setProperty(t,r,i&Sa.Important?"important":""):e.style[t]=r}removeStyle(e,t,r){r&Sa.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,r){null!=e&&(e[t]=r)}setValue(e,t){e.nodeValue=t}listen(e,t,r,i){if("string"==typeof e&&!(e=Ua().getGlobalEventTarget(this.doc,e)))throw new Error(`Unsupported event target ${e} for event ${t}`);let o=this.decoratePreventDefault(r);return null!==this.tracingService&&this.tracingService.wrapEventListener&&(o=this.tracingService.wrapEventListener(e,t,o)),this.eventManager.addEventListener(e,t,o,i)}decoratePreventDefault(e){return t=>{if("__ngUnwrap__"===t)return e;!1===(this.platformIsServer?this.ngZone.runGuarded(()=>e(t)):e(t))&&t.preventDefault()}}}function o4(n){return"TEMPLATE"===n.tagName&&void 0!==n.content}class M_e extends qD{sharedStylesHost;hostEl;shadowRoot;constructor(e,t,r,i,o,s,a,l,c){super(e,o,s,l,c),this.sharedStylesHost=t,this.hostEl=r,this.shadowRoot=r.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);let u=i.styles;u=r4(i.id,u);for(const f of u){const p=document.createElement("style");a&&p.setAttribute("nonce",a),p.textContent=f,this.shadowRoot.appendChild(p)}const d=i.getExternalStyles?.();if(d)for(const f of d){const p=zD(f,o);a&&p.setAttribute("nonce",a),this.shadowRoot.appendChild(p)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}appendChild(e,t){return super.appendChild(this.nodeOrShadowRoot(e),t)}insertBefore(e,t,r){return super.insertBefore(this.nodeOrShadowRoot(e),t,r)}removeChild(e,t){return super.removeChild(null,t)}parentNode(e){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(e)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}}class WD extends qD{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(e,t,r,i,o,s,a,l,c){super(e,o,s,a,l),this.sharedStylesHost=t,this.removeStylesOnCompDestroy=i;let u=r.styles;this.styles=c?r4(c,u):u,this.styleUrls=r.getExternalStyles?.(c)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}}class s4 extends WD{contentAttr;hostAttr;constructor(e,t,r,i,o,s,a,l,c){const u=i+"-"+r.id;super(e,t,r,o,s,a,l,c,u),this.contentAttr=function D_e(n){return"_ngcontent-%COMP%".replace(HD,n)}(u),this.hostAttr=function A_e(n){return"_nghost-%COMP%".replace(HD,n)}(u)}applyToHost(e){this.applyStyles(),this.setAttribute(e,this.hostAttr,"")}createElement(e,t){const r=super.createElement(e,t);return super.setAttribute(r,this.contentAttr,""),r}}const a4=["alt","control","meta","shift"],N_e={"\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"},P_e={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey};function l4(n){return{appProviders:[...j_e,...n?.providers??[]],platformProviders:U_e}}const U_e=[{provide:Ia,useValue:B3},{provide:U0,useValue:function L_e(){BD.makeCurrent()},multi:!0},{provide:Xe,useFactory:function B_e(){return function bie(n){B0=n}(document),document},deps:[]}],j_e=[{provide:KC,useValue:"root"},{provide:wi,useFactory:function V_e(){return new wi},deps:[]},{provide:UD,useClass:(()=>{class n extends Z3{constructor(t){super(t)}supports(t){return!0}addEventListener(t,r,i,o){return t.addEventListener(r,i,o),()=>this.removeEventListener(t,r,i,o)}removeEventListener(t,r,i,o){return t.removeEventListener(r,i,o)}static \u0275fac=function(r){return new(r||n)(me(Xe))};static \u0275prov=G({token:n,factory:n.\u0275fac})}return n})(),multi:!0,deps:[Xe]},{provide:UD,useClass:(()=>{class n extends Z3{constructor(t){super(t)}supports(t){return null!=n.parseEventName(t)}addEventListener(t,r,i,o){const s=n.parseEventName(r),a=n.eventCallback(s.fullKey,i,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Ua().onAndCancel(t,s.domEventName,a,o))}static parseEventName(t){const r=t.toLowerCase().split("."),i=r.shift();if(0===r.length||"keydown"!==i&&"keyup"!==i)return null;const o=n._normalizeKey(r.pop());let s="",a=r.indexOf("code");if(a>-1&&(r.splice(a,1),s="code."),a4.forEach(c=>{const u=r.indexOf(c);u>-1&&(r.splice(u,1),s+=c+".")}),s+=o,0!=r.length||0===o.length)return null;const l={};return l.domEventName=i,l.fullKey=s,l}static matchEventFullKeyCode(t,r){let i=N_e[t.key]||t.key,o="";return r.indexOf("code.")>-1&&(i=t.code,o="code."),!(null==i||!i)&&(i=i.toLowerCase()," "===i?i="space":"."===i&&(i="dot"),a4.forEach(s=>{s!==i&&(0,P_e[s])(t)&&(o+=s+".")}),o+=i,o===r)}static eventCallback(t,r,i){return o=>{n.matchEventFullKeyCode(o,t)&&i.runGuarded(()=>r(o))}}static _normalizeKey(t){return"esc"===t?"escape":t}static \u0275fac=function(r){return new(r||n)(me(Xe))};static \u0275prov=G({token:n,factory:n.\u0275fac})}return n})(),multi:!0,deps:[Xe]},$D,t4,X3,{provide:Aa,useExisting:$D},{provide:class jge{},useClass:b_e,deps:[]},[]];let H_e=(()=>{class n{_doc;constructor(t){this._doc=t}getTitle(){return this._doc.title}setTitle(t){this._doc.title=t||""}static \u0275fac=function(r){return new(r||n)(me(Xe))};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),$b=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:function(r){let i=null;return i=r?new(r||n):me(G_e),i},providedIn:"root"})}return n})(),G_e=(()=>{class n extends $b{_doc;constructor(t){super(),this._doc=t}sanitize(t,r){if(null==r)return null;switch(t){case er.NONE:return r;case er.HTML:return No(r,"HTML")?Ei(r):GB(this._doc,String(r)).toString();case er.STYLE:return No(r,"Style")?Ei(r):r;case er.SCRIPT:if(No(r,"Script"))return Ei(r);throw new O(5200,!1);case er.URL:return No(r,"URL")?Ei(r):Av(String(r));case er.RESOURCE_URL:if(No(r,"ResourceURL"))return Ei(r);throw new O(5201,!1);default:throw new O(5202,!1)}}bypassSecurityTrustHtml(t){return function poe(n){return new loe(n)}(t)}bypassSecurityTrustStyle(t){return function moe(n){return new coe(n)}(t)}bypassSecurityTrustScript(t){return function goe(n){return new uoe(n)}(t)}bypassSecurityTrustUrl(t){return function _oe(n){return new doe(n)}(t)}bypassSecurityTrustResourceUrl(t){return function yoe(n){return new hoe(n)}(t)}static \u0275fac=function(r){return new(r||n)(me(Xe))};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function qb(n){return!!n&&(n instanceof vt||kt(n.lift)&&kt(n.subscribe))}function Wb(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(n);i=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(n),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(o){t[o]=n[o]&&function(s){return new Promise(function(a,l){!function i(o,s,a,l){Promise.resolve(l).then(function(c){o({value:c,done:a})},s)}(a,l,(s=n[o](s)).done,s.value)})}}}"function"==typeof SuppressedError&&SuppressedError;const m4=n=>n&&"number"==typeof n.length&&"function"!=typeof n;function g4(n){return kt(n?.then)}function _4(n){return kt(n[AC])}function y4(n){return Symbol.asyncIterator&&kt(n?.[Symbol.asyncIterator])}function v4(n){return new TypeError(`You provided ${null!==n&&"object"==typeof n?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}const b4=function vye(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}();function w4(n){return kt(n?.[b4])}function E4(n){return function f4(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,r=t.apply(n,e||[]),o=[];return i=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",function s(p){return function(m){return Promise.resolve(m).then(p,d)}}),i[Symbol.asyncIterator]=function(){return this},i;function a(p,m){r[p]&&(i[p]=function(_){return new Promise(function(v,E){o.push([p,_,v,E])>1||l(p,_)})},m&&(i[p]=m(i[p])))}function l(p,m){try{!function c(p){p.value instanceof Ha?Promise.resolve(p.value.v).then(u,d):f(o[0][2],p)}(r[p](m))}catch(_){f(o[0][3],_)}}function u(p){l("next",p)}function d(p){l("throw",p)}function f(p,m){p(m),o.shift(),o.length&&l(o[0][0],o[0][1])}}(this,arguments,function*(){const t=n.getReader();try{for(;;){const{value:r,done:i}=yield Ha(t.read());if(i)return yield Ha(void 0);yield yield Ha(r)}}finally{t.releaseLock()}})}function I4(n){return kt(n?.getReader)}function oi(n){if(n instanceof vt)return n;if(null!=n){if(_4(n))return function bye(n){return new vt(e=>{const t=n[AC]();if(kt(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(n);if(m4(n))return function wye(n){return new vt(e=>{for(let t=0;t{n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,eV)})}(n);if(y4(n))return T4(n);if(w4(n))return function Iye(n){return new vt(e=>{for(const t of n)if(e.next(t),e.closed)return;e.complete()})}(n);if(I4(n))return function Tye(n){return T4(E4(n))}(n)}throw v4(n)}function T4(n){return new vt(e=>{(function Cye(n,e){var t,r,i,o;return function d4(n,e,t,r){return new(t||(t=Promise))(function(o,s){function a(u){try{c(r.next(u))}catch(d){s(d)}}function l(u){try{c(r.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):function i(o){return o instanceof t?o:new t(function(s){s(o)})}(u.value).then(a,l)}c((r=r.apply(n,e||[])).next())})}(this,void 0,void 0,function*(){try{for(t=p4(n);!(r=yield t.next()).done;)if(e.next(r.value),e.closed)return}catch(s){i={error:s}}finally{try{r&&!r.done&&(o=t.return)&&(yield o.call(t))}finally{if(i)throw i.error}}e.complete()})})(n,e).catch(t=>e.error(t))})}function Ms(n,e,t,r=0,i=!1){const o=e.schedule(function(){t(),i?n.add(this.schedule(null,r)):this.unsubscribe()},r);if(n.add(o),!i)return o}function Gb(n,e=0){return Jt((t,r)=>{t.subscribe(zt(r,i=>Ms(r,n,()=>r.next(i),e),()=>Ms(r,n,()=>r.complete(),e),i=>Ms(r,n,()=>r.error(i),e)))})}function Kb(n,e=0){return Jt((t,r)=>{r.add(n.schedule(()=>t.subscribe(r),e))})}function C4(n,e){if(!n)throw new Error("Iterable cannot be null");return new vt(t=>{Ms(t,e,()=>{const r=n[Symbol.asyncIterator]();Ms(t,e,()=>{r.next().then(i=>{i.done?t.complete():t.next(i.value)})},0,!0)})})}function nr(n,e){return e?function Mye(n,e){if(null!=n){if(_4(n))return function xye(n,e){return oi(n).pipe(Kb(e),Gb(e))}(n,e);if(m4(n))return function Dye(n,e){return new vt(t=>{let r=0;return e.schedule(function(){r===n.length?t.complete():(t.next(n[r++]),t.closed||this.schedule())})})}(n,e);if(g4(n))return function Sye(n,e){return oi(n).pipe(Kb(e),Gb(e))}(n,e);if(y4(n))return C4(n,e);if(w4(n))return function Aye(n,e){return new vt(t=>{let r;return Ms(t,e,()=>{r=n[b4](),Ms(t,e,()=>{let i,o;try{({value:i,done:o}=r.next())}catch(s){return void t.error(s)}o?t.complete():t.next(i)},0,!0)}),()=>kt(r?.return)&&r.return()})}(n,e);if(I4(n))return function Rye(n,e){return C4(E4(n),e)}(n,e)}throw v4(n)}(n,e):oi(n)}function x4(n){return n&&kt(n.schedule)}function ZD(n){return n[n.length-1]}function S4(n){return kt(ZD(n))?n.pop():void 0}function bm(n){return x4(ZD(n))?n.pop():void 0}function de(...n){return nr(n,bm(n))}const Qb=EC(n=>function(){n(this),this.name="EmptyError",this.message="no elements in sequence"}),{isArray:Nye}=Array,{getPrototypeOf:Pye,prototype:Oye,keys:Fye}=Object;function D4(n){if(1===n.length){const e=n[0];if(Nye(e))return{args:e,keys:null};if(function Lye(n){return n&&"object"==typeof n&&Pye(n)===Oye}(e)){const t=Fye(e);return{args:t.map(r=>e[r]),keys:t}}}return{args:n,keys:null}}const{isArray:Vye}=Array;function A4(n){return Te(e=>function Bye(n,e){return Vye(e)?n(...e):n(e)}(n,e))}function R4(n,e){return n.reduce((t,r,i)=>(t[r]=e[i],t),{})}function JD(...n){const e=bm(n),t=S4(n),{args:r,keys:i}=D4(n);if(0===r.length)return nr([],e);const o=new vt(function Uye(n,e,t=ma){return r=>{M4(e,()=>{const{length:i}=n,o=new Array(i);let s=i,a=i;for(let l=0;l{const c=nr(n[l],e);let u=!1;c.subscribe(zt(r,d=>{o[l]=d,u||(u=!0,a--),a||r.next(t(o.slice()))},()=>{--s||r.complete()}))},r)},r)}}(r,e,i?s=>R4(i,s):ma));return t?o.pipe(A4(t)):o}function M4(n,e,t){n?Ms(t,n,e):e()}function Ur(n,e,t=1/0){return kt(e)?Ur((r,i)=>Te((o,s)=>e(r,o,i,s))(oi(n(r,i))),t):("number"==typeof e&&(t=e),Jt((r,i)=>function zye(n,e,t,r,i,o,s,a){const l=[];let c=0,u=0,d=!1;const f=()=>{d&&!l.length&&!c&&e.complete()},p=_=>c{o&&e.next(_),c++;let v=!1;oi(t(_,u++)).subscribe(zt(e,E=>{i?.(E),o?p(E):e.next(E)},()=>{v=!0},void 0,()=>{if(v)try{for(c--;l.length&&cm(E)):m(E)}f()}catch(E){e.error(E)}}))};return n.subscribe(zt(e,p,()=>{d=!0,f()})),()=>{a?.()}}(r,i,n,t)))}function Yb(n=1/0){return Ur(ma,n)}function Xb(...n){return function jye(){return Yb(1)}()(nr(n,bm(n)))}function k4(n){return new vt(e=>{oi(n()).subscribe(e)})}function wm(n,e){const t=kt(n)?n:()=>n,r=i=>i.error(t());return new vt(e?i=>e.schedule(r,0,i):r)}const Di=new vt(n=>n.complete());function eA(){return Jt((n,e)=>{let t=null;n._refCount++;const r=zt(e,void 0,void 0,void 0,()=>{if(!n||n._refCount<=0||0<--n._refCount)return void(t=null);const i=n._connection,o=t;t=null,i&&(!o||i===o)&&i.unsubscribe(),e.unsubscribe()});n.subscribe(r),r.closed||(t=n.connect())})}class N4 extends vt{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._subject=null,this._refCount=0,this._connection=null,iV(e)&&(this.lift=e.lift)}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){const e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;const{_connection:e}=this;this._subject=this._connection=null,e?.unsubscribe()}connect(){let e=this._connection;if(!e){e=this._connection=new Kt;const t=this.getSubject();e.add(this.source.subscribe(zt(t,void 0,()=>{this._teardown(),t.complete()},r=>{this._teardown(),t.error(r)},()=>this._teardown()))),e.closed&&(this._connection=null,e=Kt.EMPTY)}return e}refCount(){return eA()(this)}}function _o(n,e){return Jt((t,r)=>{let i=null,o=0,s=!1;const a=()=>s&&!i&&r.complete();t.subscribe(zt(r,l=>{i?.unsubscribe();let c=0;const u=o++;oi(n(l,u)).subscribe(i=zt(r,d=>r.next(e?e(l,d,u,c++):d),()=>{i=null,a()}))},()=>{s=!0,a()}))})}function zo(n){return n<=0?()=>Di:Jt((e,t)=>{let r=0;e.subscribe(zt(t,i=>{++r<=n&&(t.next(i),n<=r&&t.complete())}))})}function Ec(...n){const e=bm(n);return Jt((t,r)=>{(e?Xb(n,t,e):Xb(n,t)).subscribe(r)})}function si(n,e){return Jt((t,r)=>{let i=0;t.subscribe(zt(r,o=>n.call(e,o,i++)&&r.next(o)))})}function Zb(n){return Jt((e,t)=>{let r=!1;e.subscribe(zt(t,i=>{r=!0,t.next(i)},()=>{r||t.next(n),t.complete()}))})}function P4(n=$ye){return Jt((e,t)=>{let r=!1;e.subscribe(zt(t,i=>{r=!0,t.next(i)},()=>r?t.complete():t.error(n())))})}function $ye(){return new Qb}function Ic(n,e){const t=arguments.length>=2;return r=>r.pipe(n?si((i,o)=>n(i,o,r)):ma,zo(1),t?Zb(e):P4(()=>new Qb))}function Em(n,e){return kt(e)?Ur(n,e,1):Ur(n,1)}function Bn(n,e,t){const r=kt(n)||e||t?{next:n,error:e,complete:t}:n;return r?Jt((i,o)=>{var s;null===(s=r.subscribe)||void 0===s||s.call(r);let a=!0;i.subscribe(zt(o,l=>{var c;null===(c=r.next)||void 0===c||c.call(r,l),o.next(l)},()=>{var l;a=!1,null===(l=r.complete)||void 0===l||l.call(r),o.complete()},l=>{var c;a=!1,null===(c=r.error)||void 0===c||c.call(r,l),o.error(l)},()=>{var l,c;a&&(null===(l=r.unsubscribe)||void 0===l||l.call(r)),null===(c=r.finalize)||void 0===c||c.call(r)}))}):ma}function Tc(n){return Jt((e,t)=>{let o,r=null,i=!1;r=e.subscribe(zt(t,void 0,void 0,s=>{o=oi(n(s,Tc(n)(e))),r?(r.unsubscribe(),r=null,o.subscribe(t)):i=!0})),i&&(r.unsubscribe(),r=null,o.subscribe(t))})}function tA(n){return n<=0?()=>Di:Jt((e,t)=>{let r=[];e.subscribe(zt(t,i=>{r.push(i),n{for(const i of r)t.next(i);t.complete()},void 0,()=>{r=null}))})}function Jb(n){return Jt((e,t)=>{try{e.subscribe(t)}finally{t.add(n)}})}function At(n){return Jt((e,t)=>{oi(n).subscribe(zt(t,()=>t.complete(),TC)),!t.closed&&e.subscribe(t)})}const Ne="primary",Im=Symbol("RouteTitle");class Kye{params;constructor(e){this.params=e||{}}has(e){return Object.prototype.hasOwnProperty.call(this.params,e)}get(e){if(this.has(e)){const t=this.params[e];return Array.isArray(t)?t[0]:t}return null}getAll(e){if(this.has(e)){const t=this.params[e];return Array.isArray(t)?t:[t]}return[]}get keys(){return Object.keys(this.params)}}function Kd(n){return new Kye(n)}function Qye(n,e,t){const r=t.path.split("/");if(r.length>n.length||"full"===t.pathMatch&&(e.hasChildren()||r.lengthr[o]===i)}return n===e}function F4(n){return n.length>0?n[n.length-1]:null}function $a(n){return qb(n)?n:Gp(n)?nr(Promise.resolve(n)):de(n)}const Xye={exact:function B4(n,e,t){if(!xc(n.segments,e.segments)||!ew(n.segments,e.segments,t)||n.numberOfChildren!==e.numberOfChildren)return!1;for(const r in e.children)if(!n.children[r]||!B4(n.children[r],e.children[r],t))return!1;return!0},subset:U4},L4={exact:function Zye(n,e){return jo(n,e)},subset:function Jye(n,e){return Object.keys(e).length<=Object.keys(n).length&&Object.keys(e).every(t=>O4(n[t],e[t]))},ignored:()=>!0};function V4(n,e,t){return Xye[t.paths](n.root,e.root,t.matrixParams)&&L4[t.queryParams](n.queryParams,e.queryParams)&&!("exact"===t.fragment&&n.fragment!==e.fragment)}function U4(n,e,t){return z4(n,e,e.segments,t)}function z4(n,e,t,r){if(n.segments.length>t.length){const i=n.segments.slice(0,t.length);return!(!xc(i,t)||e.hasChildren()||!ew(i,t,r))}if(n.segments.length===t.length){if(!xc(n.segments,t)||!ew(n.segments,t,r))return!1;for(const i in e.children)if(!n.children[i]||!U4(n.children[i],e.children[i],r))return!1;return!0}{const i=t.slice(0,n.segments.length),o=t.slice(n.segments.length);return!!(xc(n.segments,i)&&ew(n.segments,i,r)&&n.children[Ne])&&z4(n.children[Ne],e,o,r)}}function ew(n,e,t){return e.every((r,i)=>L4[t](n[i].parameters,r.parameters))}class Cc{root;queryParams;fragment;_queryParamMap;constructor(e=new yt([],{}),t={},r=null){this.root=e,this.queryParams=t,this.fragment=r}get queryParamMap(){return this._queryParamMap??=Kd(this.queryParams),this._queryParamMap}toString(){return nve.serialize(this)}}class yt{segments;children;parent=null;constructor(e,t){this.segments=e,this.children=t,Object.values(t).forEach(r=>r.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return nw(this)}}class Tm{path;parameters;_parameterMap;constructor(e,t){this.path=e,this.parameters=t}get parameterMap(){return this._parameterMap??=Kd(this.parameters),this._parameterMap}toString(){return $4(this)}}function xc(n,e){return n.length===e.length&&n.every((t,r)=>t.path===e[r].path)}let Qd=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:()=>new tw,providedIn:"root"})}return n})();class tw{parse(e){const t=new fve(e);return new Cc(t.parseRootSegment(),t.parseQueryParams(),t.parseFragment())}serialize(e){const t=`/${Cm(e.root,!0)}`,r=function ove(n){const e=Object.entries(n).map(([t,r])=>Array.isArray(r)?r.map(i=>`${rw(t)}=${rw(i)}`).join("&"):`${rw(t)}=${rw(r)}`).filter(t=>t);return e.length?`?${e.join("&")}`:""}(e.queryParams);return`${t}${r}${"string"==typeof e.fragment?`#${function rve(n){return encodeURI(n)}(e.fragment)}`:""}`}}const nve=new tw;function nw(n){return n.segments.map(e=>$4(e)).join("/")}function Cm(n,e){if(!n.hasChildren())return nw(n);if(e){const t=n.children[Ne]?Cm(n.children[Ne],!1):"",r=[];return Object.entries(n.children).forEach(([i,o])=>{i!==Ne&&r.push(`${i}:${Cm(o,!1)}`)}),r.length>0?`${t}(${r.join("//")})`:t}{const t=function tve(n,e){let t=[];return Object.entries(n.children).forEach(([r,i])=>{r===Ne&&(t=t.concat(e(i,r)))}),Object.entries(n.children).forEach(([r,i])=>{r!==Ne&&(t=t.concat(e(i,r)))}),t}(n,(r,i)=>i===Ne?[Cm(n.children[Ne],!1)]:[`${i}:${Cm(r,!1)}`]);return 1===Object.keys(n.children).length&&null!=n.children[Ne]?`${nw(n)}/${t[0]}`:`${nw(n)}/(${t.join("//")})`}}function j4(n){return encodeURIComponent(n).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function rw(n){return j4(n).replace(/%3B/gi,";")}function rA(n){return j4(n).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function iw(n){return decodeURIComponent(n)}function H4(n){return iw(n.replace(/\+/g,"%20"))}function $4(n){return`${rA(n.path)}${function ive(n){return Object.entries(n).map(([e,t])=>`;${rA(e)}=${rA(t)}`).join("")}(n.parameters)}`}const sve=/^[^\/()?;#]+/;function iA(n){const e=n.match(sve);return e?e[0]:""}const ave=/^[^\/()?;=#]+/,cve=/^[^=?&#]+/,dve=/^[^&#]+/;class fve{url;remaining;constructor(e){this.url=e,this.remaining=e}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new yt([],{}):new yt([],this.parseChildren())}parseQueryParams(){const e={};if(this.consumeOptional("?"))do{this.parseQueryParam(e)}while(this.consumeOptional("&"));return e}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const e=[];for(this.peekStartsWith("(")||e.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),e.push(this.parseSegment());let t={};this.peekStartsWith("/(")&&(this.capture("/"),t=this.parseParens(!0));let r={};return this.peekStartsWith("(")&&(r=this.parseParens(!1)),(e.length>0||Object.keys(t).length>0)&&(r[Ne]=new yt(e,t)),r}parseSegment(){const e=iA(this.remaining);if(""===e&&this.peekStartsWith(";"))throw new O(4009,!1);return this.capture(e),new Tm(iw(e),this.parseMatrixParams())}parseMatrixParams(){const e={};for(;this.consumeOptional(";");)this.parseParam(e);return e}parseParam(e){const t=function lve(n){const e=n.match(ave);return e?e[0]:""}(this.remaining);if(!t)return;this.capture(t);let r="";if(this.consumeOptional("=")){const i=iA(this.remaining);i&&(r=i,this.capture(r))}e[iw(t)]=iw(r)}parseQueryParam(e){const t=function uve(n){const e=n.match(cve);return e?e[0]:""}(this.remaining);if(!t)return;this.capture(t);let r="";if(this.consumeOptional("=")){const s=function hve(n){const e=n.match(dve);return e?e[0]:""}(this.remaining);s&&(r=s,this.capture(r))}const i=H4(t),o=H4(r);if(e.hasOwnProperty(i)){let s=e[i];Array.isArray(s)||(s=[s],e[i]=s),s.push(o)}else e[i]=o}parseParens(e){const t={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const r=iA(this.remaining),i=this.remaining[r.length];if("/"!==i&&")"!==i&&";"!==i)throw new O(4010,!1);let o;r.indexOf(":")>-1?(o=r.slice(0,r.indexOf(":")),this.capture(o),this.capture(":")):e&&(o=Ne);const s=this.parseChildren();t[o]=1===Object.keys(s).length?s[Ne]:new yt([],s),this.consumeOptional("//")}return t}peekStartsWith(e){return this.remaining.startsWith(e)}consumeOptional(e){return!!this.peekStartsWith(e)&&(this.remaining=this.remaining.substring(e.length),!0)}capture(e){if(!this.consumeOptional(e))throw new O(4011,!1)}}function q4(n){return n.segments.length>0?new yt([],{[Ne]:n}):n}function W4(n){const e={};for(const[r,i]of Object.entries(n.children)){const o=W4(i);if(r===Ne&&0===o.segments.length&&o.hasChildren())for(const[s,a]of Object.entries(o.children))e[s]=a;else(o.segments.length>0||o.hasChildren())&&(e[r]=o)}return function pve(n){if(1===n.numberOfChildren&&n.children[Ne]){const e=n.children[Ne];return new yt(n.segments.concat(e.segments),e.children)}return n}(new yt(n.segments,e))}function Sc(n){return n instanceof Cc}function G4(n){let e;const i=q4(function t(o){const s={};for(const l of o.children){const c=t(l);s[l.outlet]=c}const a=new yt(o.url,s);return o===n&&(e=a),a}(n.root));return e??i}function K4(n,e,t,r){let i=n;for(;i.parent;)i=i.parent;if(0===e.length)return oA(i,i,i,t,r);const o=function gve(n){if("string"==typeof n[0]&&1===n.length&&"/"===n[0])return new Y4(!0,0,n);let e=0,t=!1;const r=n.reduce((i,o,s)=>{if("object"==typeof o&&null!=o){if(o.outlets){const a={};return Object.entries(o.outlets).forEach(([l,c])=>{a[l]="string"==typeof c?c.split("/"):c}),[...i,{outlets:a}]}if(o.segmentPath)return[...i,o.segmentPath]}return"string"!=typeof o?[...i,o]:0===s?(o.split("/").forEach((a,l)=>{0==l&&"."===a||(0==l&&""===a?t=!0:".."===a?e++:""!=a&&i.push(a))}),i):[...i,o]},[]);return new Y4(t,e,r)}(e);if(o.toRoot())return oA(i,i,new yt([],{}),t,r);const s=function _ve(n,e,t){if(n.isAbsolute)return new sw(e,!0,0);if(!t)return new sw(e,!1,NaN);if(null===t.parent)return new sw(t,!0,0);const r=ow(n.commands[0])?0:1;return function yve(n,e,t){let r=n,i=e,o=t;for(;o>i;){if(o-=i,r=r.parent,!r)throw new O(4005,!1);i=r.segments.length}return new sw(r,!1,i-o)}(t,t.segments.length-1+r,n.numberOfDoubleDots)}(o,i,n),a=s.processChildren?Sm(s.segmentGroup,s.index,o.commands):X4(s.segmentGroup,s.index,o.commands);return oA(i,s.segmentGroup,a,t,r)}function ow(n){return"object"==typeof n&&null!=n&&!n.outlets&&!n.segmentPath}function xm(n){return"object"==typeof n&&null!=n&&n.outlets}function oA(n,e,t,r,i){let s,o={};r&&Object.entries(r).forEach(([l,c])=>{o[l]=Array.isArray(c)?c.map(u=>`${u}`):`${c}`}),s=n===e?t:Q4(n,e,t);const a=q4(W4(s));return new Cc(a,o,i)}function Q4(n,e,t){const r={};return Object.entries(n.children).forEach(([i,o])=>{r[i]=o===e?t:Q4(o,e,t)}),new yt(n.segments,r)}class Y4{isAbsolute;numberOfDoubleDots;commands;constructor(e,t,r){if(this.isAbsolute=e,this.numberOfDoubleDots=t,this.commands=r,e&&r.length>0&&ow(r[0]))throw new O(4003,!1);const i=r.find(xm);if(i&&i!==F4(r))throw new O(4004,!1)}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class sw{segmentGroup;processChildren;index;constructor(e,t,r){this.segmentGroup=e,this.processChildren=t,this.index=r}}function X4(n,e,t){if(n??=new yt([],{}),0===n.segments.length&&n.hasChildren())return Sm(n,e,t);const r=function bve(n,e,t){let r=0,i=e;const o={match:!1,pathIndex:0,commandIndex:0};for(;i=t.length)return o;const s=n.segments[i],a=t[r];if(xm(a))break;const l=`${a}`,c=r0&&void 0===l)break;if(l&&c&&"object"==typeof c&&void 0===c.outlets){if(!J4(l,c,s))return o;r+=2}else{if(!J4(l,{},s))return o;r++}i++}return{match:!0,pathIndex:i,commandIndex:r}}(n,e,t),i=t.slice(r.commandIndex);if(r.match&&r.pathIndexo!==Ne)&&n.children[Ne]&&1===n.numberOfChildren&&0===n.children[Ne].segments.length){const o=Sm(n.children[Ne],e,t);return new yt(n.segments,o.children)}return Object.entries(r).forEach(([o,s])=>{"string"==typeof s&&(s=[s]),null!==s&&(i[o]=X4(n.children[o],e,s))}),Object.entries(n.children).forEach(([o,s])=>{void 0===r[o]&&(i[o]=s)}),new yt(n.segments,i)}}function sA(n,e,t){const r=n.segments.slice(0,e);let i=0;for(;i{"string"==typeof r&&(r=[r]),null!==r&&(e[t]=sA(new yt([],{}),0,r))}),e}function Z4(n){const e={};return Object.entries(n).forEach(([t,r])=>e[t]=`${r}`),e}function J4(n,e,t){return n==t.path&&jo(e,t.parameters)}const Dm="imperative";var Ze=function(n){return n[n.NavigationStart=0]="NavigationStart",n[n.NavigationEnd=1]="NavigationEnd",n[n.NavigationCancel=2]="NavigationCancel",n[n.NavigationError=3]="NavigationError",n[n.RoutesRecognized=4]="RoutesRecognized",n[n.ResolveStart=5]="ResolveStart",n[n.ResolveEnd=6]="ResolveEnd",n[n.GuardsCheckStart=7]="GuardsCheckStart",n[n.GuardsCheckEnd=8]="GuardsCheckEnd",n[n.RouteConfigLoadStart=9]="RouteConfigLoadStart",n[n.RouteConfigLoadEnd=10]="RouteConfigLoadEnd",n[n.ChildActivationStart=11]="ChildActivationStart",n[n.ChildActivationEnd=12]="ChildActivationEnd",n[n.ActivationStart=13]="ActivationStart",n[n.ActivationEnd=14]="ActivationEnd",n[n.Scroll=15]="Scroll",n[n.NavigationSkipped=16]="NavigationSkipped",n}(Ze||{});class Ho{id;url;constructor(e,t){this.id=e,this.url=t}}class aA extends Ho{type=Ze.NavigationStart;navigationTrigger;restoredState;constructor(e,t,r="imperative",i=null){super(e,t),this.navigationTrigger=r,this.restoredState=i}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class Dc extends Ho{urlAfterRedirects;type=Ze.NavigationEnd;constructor(e,t,r){super(e,t),this.urlAfterRedirects=r}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}var Ai=function(n){return n[n.Redirect=0]="Redirect",n[n.SupersededByNewNavigation=1]="SupersededByNewNavigation",n[n.NoDataFromResolver=2]="NoDataFromResolver",n[n.GuardRejected=3]="GuardRejected",n}(Ai||{}),lA=function(n){return n[n.IgnoredSameUrlNavigation=0]="IgnoredSameUrlNavigation",n[n.IgnoredByUrlHandlingStrategy=1]="IgnoredByUrlHandlingStrategy",n}(lA||{});class Ac extends Ho{reason;code;type=Ze.NavigationCancel;constructor(e,t,r,i){super(e,t),this.reason=r,this.code=i}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class Am extends Ho{reason;code;type=Ze.NavigationSkipped;constructor(e,t,r,i){super(e,t),this.reason=r,this.code=i}}class cA extends Ho{error;target;type=Ze.NavigationError;constructor(e,t,r,i){super(e,t),this.error=r,this.target=i}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class eq extends Ho{urlAfterRedirects;state;type=Ze.RoutesRecognized;constructor(e,t,r,i){super(e,t),this.urlAfterRedirects=r,this.state=i}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Eve extends Ho{urlAfterRedirects;state;type=Ze.GuardsCheckStart;constructor(e,t,r,i){super(e,t),this.urlAfterRedirects=r,this.state=i}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Ive extends Ho{urlAfterRedirects;state;shouldActivate;type=Ze.GuardsCheckEnd;constructor(e,t,r,i,o){super(e,t),this.urlAfterRedirects=r,this.state=i,this.shouldActivate=o}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class Tve extends Ho{urlAfterRedirects;state;type=Ze.ResolveStart;constructor(e,t,r,i){super(e,t),this.urlAfterRedirects=r,this.state=i}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Cve extends Ho{urlAfterRedirects;state;type=Ze.ResolveEnd;constructor(e,t,r,i){super(e,t),this.urlAfterRedirects=r,this.state=i}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class xve{route;type=Ze.RouteConfigLoadStart;constructor(e){this.route=e}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class Sve{route;type=Ze.RouteConfigLoadEnd;constructor(e){this.route=e}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class Dve{snapshot;type=Ze.ChildActivationStart;constructor(e){this.snapshot=e}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Ave{snapshot;type=Ze.ChildActivationEnd;constructor(e){this.snapshot=e}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Rve{snapshot;type=Ze.ActivationStart;constructor(e){this.snapshot=e}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Mve{snapshot;type=Ze.ActivationEnd;constructor(e){this.snapshot=e}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class uA{}class aw{url;navigationBehaviorOptions;constructor(e,t){this.url=e,this.navigationBehaviorOptions=t}}function yo(n){return n.outlet||Ne}function Rm(n){if(!n)return null;if(n.routeConfig?._injector)return n.routeConfig._injector;for(let e=n.parent;e;e=e.parent){const t=e.routeConfig;if(t?._loadedInjector)return t._loadedInjector;if(t?._injector)return t._injector}return null}class Lve{rootInjector;outlet=null;route=null;children;attachRef=null;get injector(){return Rm(this.route?.snapshot)??this.rootInjector}constructor(e){this.rootInjector=e,this.children=new Mm(this.rootInjector)}}let Mm=(()=>{class n{rootInjector;contexts=new Map;constructor(t){this.rootInjector=t}onChildOutletCreated(t,r){const i=this.getOrCreateContext(t);i.outlet=r,this.contexts.set(t,i)}onChildOutletDestroyed(t){const r=this.getContext(t);r&&(r.outlet=null,r.attachRef=null)}onOutletDeactivated(){const t=this.contexts;return this.contexts=new Map,t}onOutletReAttached(t){this.contexts=t}getOrCreateContext(t){let r=this.getContext(t);return r||(r=new Lve(this.rootInjector),this.contexts.set(t,r)),r}getContext(t){return this.contexts.get(t)||null}static \u0275fac=function(r){return new(r||n)(me(mr))};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();class tq{_root;constructor(e){this._root=e}get root(){return this._root.value}parent(e){const t=this.pathFromRoot(e);return t.length>1?t[t.length-2]:null}children(e){const t=dA(e,this._root);return t?t.children.map(r=>r.value):[]}firstChild(e){const t=dA(e,this._root);return t&&t.children.length>0?t.children[0].value:null}siblings(e){const t=hA(e,this._root);return t.length<2?[]:t[t.length-2].children.map(i=>i.value).filter(i=>i!==e)}pathFromRoot(e){return hA(e,this._root).map(t=>t.value)}}function dA(n,e){if(n===e.value)return e;for(const t of e.children){const r=dA(n,t);if(r)return r}return null}function hA(n,e){if(n===e.value)return[e];for(const t of e.children){const r=hA(n,t);if(r.length)return r.unshift(e),r}return[]}class vo{value;children;constructor(e,t){this.value=e,this.children=t}toString(){return`TreeNode(${this.value})`}}function Yd(n){const e={};return n&&n.children.forEach(t=>e[t.value.outlet]=t),e}class nq extends tq{snapshot;constructor(e,t){super(e),this.snapshot=t,fA(this,e)}toString(){return this.snapshot.toString()}}function rq(n){const e=function Vve(n){const o=new cw([],{},{},"",{},Ne,n,null,{});return new iq("",new vo(o,[]))}(n),t=new mi([new Tm("",{})]),r=new mi({}),i=new mi({}),o=new mi({}),s=new mi(""),a=new Xd(t,r,o,s,i,Ne,n,e.root);return a.snapshot=e.root,new nq(new vo(a,[]),e)}class Xd{urlSubject;paramsSubject;queryParamsSubject;fragmentSubject;dataSubject;outlet;component;snapshot;_futureSnapshot;_routerState;_paramMap;_queryParamMap;title;url;params;queryParams;fragment;data;constructor(e,t,r,i,o,s,a,l){this.urlSubject=e,this.paramsSubject=t,this.queryParamsSubject=r,this.fragmentSubject=i,this.dataSubject=o,this.outlet=s,this.component=a,this._futureSnapshot=l,this.title=this.dataSubject?.pipe(Te(c=>c[Im]))??de(void 0),this.url=e,this.params=t,this.queryParams=r,this.fragment=i,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(Te(e=>Kd(e))),this._paramMap}get queryParamMap(){return this._queryParamMap??=this.queryParams.pipe(Te(e=>Kd(e))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function lw(n,e,t="emptyOnly"){let r;const{routeConfig:i}=n;return r=null===e||"always"!==t&&""!==i?.path&&(e.component||e.routeConfig?.loadComponent)?{params:{...n.params},data:{...n.data},resolve:{...n.data,...n._resolvedData??{}}}:{params:{...e.params,...n.params},data:{...e.data,...n.data},resolve:{...n.data,...e.data,...i?.data,...n._resolvedData}},i&&sq(i)&&(r.resolve[Im]=i.title),r}class cw{url;params;queryParams;fragment;data;outlet;component;routeConfig;_resolve;_resolvedData;_routerState;_paramMap;_queryParamMap;get title(){return this.data?.[Im]}constructor(e,t,r,i,o,s,a,l,c){this.url=e,this.params=t,this.queryParams=r,this.fragment=i,this.data=o,this.outlet=s,this.component=a,this.routeConfig=l,this._resolve=c}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??=Kd(this.params),this._paramMap}get queryParamMap(){return this._queryParamMap??=Kd(this.queryParams),this._queryParamMap}toString(){return`Route(url:'${this.url.map(r=>r.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class iq extends tq{url;constructor(e,t){super(t),this.url=e,fA(this,t)}toString(){return oq(this._root)}}function fA(n,e){e.value._routerState=n,e.children.forEach(t=>fA(n,t))}function oq(n){const e=n.children.length>0?` { ${n.children.map(oq).join(", ")} } `:"";return`${n.value}${e}`}function pA(n){if(n.snapshot){const e=n.snapshot,t=n._futureSnapshot;n.snapshot=t,jo(e.queryParams,t.queryParams)||n.queryParamsSubject.next(t.queryParams),e.fragment!==t.fragment&&n.fragmentSubject.next(t.fragment),jo(e.params,t.params)||n.paramsSubject.next(t.params),function Yye(n,e){if(n.length!==e.length)return!1;for(let t=0;tjo(t.parameters,e[r].parameters))}(n.url,e.url);return t&&!(!n.parent!=!e.parent)&&(!n.parent||mA(n.parent,e.parent))}function sq(n){return"string"==typeof n.title||null===n.title}const Bve=new B("");let gA=(()=>{class n{activated=null;get activatedComponentRef(){return this.activated}_activatedRoute=null;name=Ne;activateEvents=new nt;deactivateEvents=new nt;attachEvents=new nt;detachEvents=new nt;routerOutletData=Xre(void 0);parentContexts=b(Mm);location=b(Ci);changeDetector=b(Uo);inputBinder=b(uw,{optional:!0});supportsBindingToComponentInputs=!0;ngOnChanges(t){if(t.name){const{firstChange:r,previousValue:i}=t.name;if(r)return;this.isTrackedInParentContexts(i)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(i)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(t){return this.parentContexts.getContext(t)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;const t=this.parentContexts.getContext(this.name);t?.route&&(t.attachRef?this.attach(t.attachRef,t.route):this.activateWith(t.route,t.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new O(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new O(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new O(4012,!1);this.location.detach();const t=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(t.instance),t}attach(t,r){this.activated=t,this._activatedRoute=r,this.location.insert(t.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(t.instance)}deactivate(){if(this.activated){const t=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(t)}}activateWith(t,r){if(this.isActivated)throw new O(4013,!1);this._activatedRoute=t;const i=this.location,s=t.snapshot.component,a=this.parentContexts.getOrCreateContext(this.name).children,l=new _A(t,a,i.injector,this.routerOutletData);this.activated=i.createComponent(s,{index:i.length,injector:l,environmentInjector:r}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["router-outlet"]],inputs:{name:"name",routerOutletData:[1,"routerOutletData"]},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],features:[ei]})}return n})();class _A{route;childContexts;parent;outletData;__ngOutletInjector(e){return new _A(this.route,this.childContexts,e,this.outletData)}constructor(e,t,r,i){this.route=e,this.childContexts=t,this.parent=r,this.outletData=i}get(e,t){return e===Xd?this.route:e===Mm?this.childContexts:e===Bve?this.outletData:this.parent.get(e,t)}}const uw=new B("");function km(n,e,t){if(t&&n.shouldReuseRoute(e.value,t.value.snapshot)){const r=t.value;r._futureSnapshot=e.value;const i=function zve(n,e,t){return e.children.map(r=>{for(const i of t.children)if(n.shouldReuseRoute(r.value,i.value.snapshot))return km(n,r,i);return km(n,r)})}(n,e,t);return new vo(r,i)}{if(n.shouldAttach(e.value)){const o=n.retrieve(e.value);if(null!==o){const s=o.route;return s.value._futureSnapshot=e.value,s.children=e.children.map(a=>km(n,a)),s}}const r=function jve(n){return new Xd(new mi(n.url),new mi(n.params),new mi(n.queryParams),new mi(n.fragment),new mi(n.data),n.outlet,n.component,n)}(e.value),i=e.children.map(o=>km(n,o));return new vo(r,i)}}class yA{redirectTo;navigationBehaviorOptions;constructor(e,t){this.redirectTo=e,this.navigationBehaviorOptions=t}}const lq="ngNavigationCancelingError";function dw(n,e){const{redirectTo:t,navigationBehaviorOptions:r}=Sc(e)?{redirectTo:e,navigationBehaviorOptions:void 0}:e,i=cq(!1,Ai.Redirect);return i.url=t,i.navigationBehaviorOptions=r,i}function cq(n,e){const t=new Error(`NavigationCancelingError: ${n||""}`);return t[lq]=!0,t.cancellationCode=e,t}function uq(n){return!!n&&n[lq]}class qve{routeReuseStrategy;futureState;currState;forwardEvent;inputBindingEnabled;constructor(e,t,r,i,o){this.routeReuseStrategy=e,this.futureState=t,this.currState=r,this.forwardEvent=i,this.inputBindingEnabled=o}activate(e){const t=this.futureState._root,r=this.currState?this.currState._root:null;this.deactivateChildRoutes(t,r,e),pA(this.futureState.root),this.activateChildRoutes(t,r,e)}deactivateChildRoutes(e,t,r){const i=Yd(t);e.children.forEach(o=>{const s=o.value.outlet;this.deactivateRoutes(o,i[s],r),delete i[s]}),Object.values(i).forEach(o=>{this.deactivateRouteAndItsChildren(o,r)})}deactivateRoutes(e,t,r){const i=e.value,o=t?t.value:null;if(i===o)if(i.component){const s=r.getContext(i.outlet);s&&this.deactivateChildRoutes(e,t,s.children)}else this.deactivateChildRoutes(e,t,r);else o&&this.deactivateRouteAndItsChildren(t,r)}deactivateRouteAndItsChildren(e,t){e.value.component&&this.routeReuseStrategy.shouldDetach(e.value.snapshot)?this.detachAndStoreRouteSubtree(e,t):this.deactivateRouteAndOutlet(e,t)}detachAndStoreRouteSubtree(e,t){const r=t.getContext(e.value.outlet),i=r&&e.value.component?r.children:t,o=Yd(e);for(const s of Object.values(o))this.deactivateRouteAndItsChildren(s,i);if(r&&r.outlet){const s=r.outlet.detach(),a=r.children.onOutletDeactivated();this.routeReuseStrategy.store(e.value.snapshot,{componentRef:s,route:e,contexts:a})}}deactivateRouteAndOutlet(e,t){const r=t.getContext(e.value.outlet),i=r&&e.value.component?r.children:t,o=Yd(e);for(const s of Object.values(o))this.deactivateRouteAndItsChildren(s,i);r&&(r.outlet&&(r.outlet.deactivate(),r.children.onOutletDeactivated()),r.attachRef=null,r.route=null)}activateChildRoutes(e,t,r){const i=Yd(t);e.children.forEach(o=>{this.activateRoutes(o,i[o.value.outlet],r),this.forwardEvent(new Mve(o.value.snapshot))}),e.children.length&&this.forwardEvent(new Ave(e.value.snapshot))}activateRoutes(e,t,r){const i=e.value,o=t?t.value:null;if(pA(i),i===o)if(i.component){const s=r.getOrCreateContext(i.outlet);this.activateChildRoutes(e,t,s.children)}else this.activateChildRoutes(e,t,r);else if(i.component){const s=r.getOrCreateContext(i.outlet);if(this.routeReuseStrategy.shouldAttach(i.snapshot)){const a=this.routeReuseStrategy.retrieve(i.snapshot);this.routeReuseStrategy.store(i.snapshot,null),s.children.onOutletReAttached(a.contexts),s.attachRef=a.componentRef,s.route=a.route.value,s.outlet&&s.outlet.attach(a.componentRef,a.route.value),pA(a.route.value),this.activateChildRoutes(e,null,s.children)}else s.attachRef=null,s.route=i,s.outlet&&s.outlet.activateWith(i,s.injector),this.activateChildRoutes(e,null,s.children)}else this.activateChildRoutes(e,null,r)}}class dq{path;route;constructor(e){this.path=e,this.route=this.path[this.path.length-1]}}class hw{component;route;constructor(e,t){this.component=e,this.route=t}}function Wve(n,e,t){const r=n._root;return Nm(r,e?e._root:null,t,[r.value])}function Zd(n,e){const t=Symbol(),r=e.get(n,t);return r===t?"function"!=typeof n||function ane(n){return null!==Ry(n)}(n)?e.get(n):n:r}function Nm(n,e,t,r,i={canDeactivateChecks:[],canActivateChecks:[]}){const o=Yd(e);return n.children.forEach(s=>{(function Kve(n,e,t,r,i={canDeactivateChecks:[],canActivateChecks:[]}){const o=n.value,s=e?e.value:null,a=t?t.getContext(n.value.outlet):null;if(s&&o.routeConfig===s.routeConfig){const l=function Qve(n,e,t){if("function"==typeof t)return t(n,e);switch(t){case"pathParamsChange":return!xc(n.url,e.url);case"pathParamsOrQueryParamsChange":return!xc(n.url,e.url)||!jo(n.queryParams,e.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!mA(n,e)||!jo(n.queryParams,e.queryParams);default:return!mA(n,e)}}(s,o,o.routeConfig.runGuardsAndResolvers);l?i.canActivateChecks.push(new dq(r)):(o.data=s.data,o._resolvedData=s._resolvedData),Nm(n,e,o.component?a?a.children:null:t,r,i),l&&a&&a.outlet&&a.outlet.isActivated&&i.canDeactivateChecks.push(new hw(a.outlet.component,s))}else s&&Pm(e,a,i),i.canActivateChecks.push(new dq(r)),Nm(n,null,o.component?a?a.children:null:t,r,i)})(s,o[s.value.outlet],t,r.concat([s.value]),i),delete o[s.value.outlet]}),Object.entries(o).forEach(([s,a])=>Pm(a,t.getContext(s),i)),i}function Pm(n,e,t){const r=Yd(n),i=n.value;Object.entries(r).forEach(([o,s])=>{Pm(s,i.component?e?e.children.getContext(o):null:e,t)}),t.canDeactivateChecks.push(new hw(i.component&&e&&e.outlet&&e.outlet.isActivated?e.outlet.component:null,i))}function Om(n){return"function"==typeof n}function hq(n){return n instanceof Qb||"EmptyError"===n?.name}const fw=Symbol("INITIAL_VALUE");function Jd(){return _o(n=>JD(n.map(e=>e.pipe(zo(1),Ec(fw)))).pipe(Te(e=>{for(const t of e)if(!0!==t){if(t===fw)return fw;if(!1===t||nbe(t))return t}return!0}),si(e=>e!==fw),zo(1)))}function nbe(n){return Sc(n)||n instanceof yA}function fq(n){return function Xte(...n){return tV(n)}(Bn(e=>{if("boolean"!=typeof e)throw dw(0,e)}),Te(e=>!0===e))}class vA{segmentGroup;constructor(e){this.segmentGroup=e||null}}class pw extends Error{urlTree;constructor(e){super(),this.urlTree=e}}function eh(n){return wm(new vA(n))}class mbe{urlSerializer;urlTree;constructor(e,t){this.urlSerializer=e,this.urlTree=t}lineralizeSegments(e,t){let r=[],i=t.root;for(;;){if(r=r.concat(i.segments),0===i.numberOfChildren)return de(r);if(i.numberOfChildren>1||!i.children[Ne])return wm(new O(4e3,!1));i=i.children[Ne]}}applyRedirectCommands(e,t,r,i,o){if("string"!=typeof t){const a=t,{queryParams:l,fragment:c,routeConfig:u,url:d,outlet:f,params:p,data:m,title:_}=i,v=yi(o,()=>a({params:p,data:m,queryParams:l,fragment:c,routeConfig:u,url:d,outlet:f,title:_}));if(v instanceof Cc)throw new pw(v);t=v}const s=this.applyRedirectCreateUrlTree(t,this.urlSerializer.parse(t),e,r);if("/"===t[0])throw new pw(s);return s}applyRedirectCreateUrlTree(e,t,r,i){const o=this.createSegmentGroup(e,t.root,r,i);return new Cc(o,this.createQueryParams(t.queryParams,this.urlTree.queryParams),t.fragment)}createQueryParams(e,t){const r={};return Object.entries(e).forEach(([i,o])=>{if("string"==typeof o&&":"===o[0]){const a=o.substring(1);r[i]=t[a]}else r[i]=o}),r}createSegmentGroup(e,t,r,i){const o=this.createSegments(e,t.segments,r,i);let s={};return Object.entries(t.children).forEach(([a,l])=>{s[a]=this.createSegmentGroup(e,l,r,i)}),new yt(o,s)}createSegments(e,t,r,i){return t.map(o=>":"===o.path[0]?this.findPosParam(e,o,i):this.findOrReturn(o,r))}findPosParam(e,t,r){const i=r[t.path.substring(1)];if(!i)throw new O(4001,!1);return i}findOrReturn(e,t){let r=0;for(const i of t){if(i.path===e.path)return t.splice(r),i;r++}return e}}const bA={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function gbe(n,e,t,r,i){const o=pq(n,e,t);return o.matched?(r=function kve(n,e){return n.providers&&!n._injector&&(n._injector=yS(n.providers,e,`Route: ${n.path}`)),n._injector??e}(e,r),function hbe(n,e,t,r){const i=e.canMatch;return i&&0!==i.length?de(i.map(s=>{const a=Zd(s,n);return $a(function tbe(n){return n&&Om(n.canMatch)}(a)?a.canMatch(e,t):yi(n,()=>a(e,t)))})).pipe(Jd(),fq()):de(!0)}(r,e,t).pipe(Te(s=>!0===s?o:{...bA}))):de(o)}function pq(n,e,t){if("**"===e.path)return function _be(n){return{matched:!0,parameters:n.length>0?F4(n).parameters:{},consumedSegments:n,remainingSegments:[],positionalParamSegments:{}}}(t);if(""===e.path)return"full"===e.pathMatch&&(n.hasChildren()||t.length>0)?{...bA}:{matched:!0,consumedSegments:[],remainingSegments:t,parameters:{},positionalParamSegments:{}};const i=(e.matcher||Qye)(t,n,e);if(!i)return{...bA};const o={};Object.entries(i.posParams??{}).forEach(([a,l])=>{o[a]=l.path});const s=i.consumed.length>0?{...o,...i.consumed[i.consumed.length-1].parameters}:o;return{matched:!0,consumedSegments:i.consumed,remainingSegments:t.slice(i.consumed.length),parameters:s,positionalParamSegments:i.posParams??{}}}function mq(n,e,t,r){return t.length>0&&function bbe(n,e,t){return t.some(r=>mw(n,e,r)&&yo(r)!==Ne)}(n,t,r)?{segmentGroup:new yt(e,vbe(r,new yt(t,n.children))),slicedSegments:[]}:0===t.length&&function wbe(n,e,t){return t.some(r=>mw(n,e,r))}(n,t,r)?{segmentGroup:new yt(n.segments,ybe(n,t,r,n.children)),slicedSegments:t}:{segmentGroup:new yt(n.segments,n.children),slicedSegments:t}}function ybe(n,e,t,r){const i={};for(const o of t)if(mw(n,e,o)&&!r[yo(o)]){const s=new yt([],{});i[yo(o)]=s}return{...r,...i}}function vbe(n,e){const t={};t[Ne]=e;for(const r of n)if(""===r.path&&yo(r)!==Ne){const i=new yt([],{});t[yo(r)]=i}return t}function mw(n,e,t){return(!(n.hasChildren()||e.length>0)||"full"!==t.pathMatch)&&""===t.path}class Ibe{}class xbe{injector;configLoader;rootComponentType;config;urlTree;paramsInheritanceStrategy;urlSerializer;applyRedirects;absoluteRedirectCount=0;allowRedirects=!0;constructor(e,t,r,i,o,s,a){this.injector=e,this.configLoader=t,this.rootComponentType=r,this.config=i,this.urlTree=o,this.paramsInheritanceStrategy=s,this.urlSerializer=a,this.applyRedirects=new mbe(this.urlSerializer,this.urlTree)}noMatchError(e){return new O(4002,`'${e.segmentGroup}'`)}recognize(){const e=mq(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(e).pipe(Te(({children:t,rootSnapshot:r})=>{const i=new vo(r,t),o=new iq("",i),s=function mve(n,e,t=null,r=null){return K4(G4(n),e,t,r)}(r,[],this.urlTree.queryParams,this.urlTree.fragment);return s.queryParams=this.urlTree.queryParams,o.url=this.urlSerializer.serialize(s),{state:o,tree:s}}))}match(e){const t=new cw([],Object.freeze({}),Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,Object.freeze({}),Ne,this.rootComponentType,null,{});return this.processSegmentGroup(this.injector,this.config,e,Ne,t).pipe(Te(r=>({children:r,rootSnapshot:t})),Tc(r=>{if(r instanceof pw)return this.urlTree=r.urlTree,this.match(r.urlTree.root);throw r instanceof vA?this.noMatchError(r):r}))}processSegmentGroup(e,t,r,i,o){return 0===r.segments.length&&r.hasChildren()?this.processChildren(e,t,r,o):this.processSegment(e,t,r,r.segments,i,!0,o).pipe(Te(s=>s instanceof vo?[s]:[]))}processChildren(e,t,r,i){const o=[];for(const s of Object.keys(r.children))"primary"===s?o.unshift(s):o.push(s);return nr(o).pipe(Em(s=>{const a=r.children[s],l=function Fve(n,e){const t=n.filter(r=>yo(r)===e);return t.push(...n.filter(r=>yo(r)!==e)),t}(t,s);return this.processSegmentGroup(e,l,a,s,i)}),function Wye(n,e){return Jt(function qye(n,e,t,r,i){return(o,s)=>{let a=t,l=e,c=0;o.subscribe(zt(s,u=>{const d=c++;l=a?n(l,u,d):(a=!0,u),r&&s.next(l)},i&&(()=>{a&&s.next(l),s.complete()})))}}(n,e,arguments.length>=2,!0))}((s,a)=>(s.push(...a),s)),Zb(null),function Gye(n,e){const t=arguments.length>=2;return r=>r.pipe(n?si((i,o)=>n(i,o,r)):ma,tA(1),t?Zb(e):P4(()=>new Qb))}(),Ur(s=>{if(null===s)return eh(r);const a=gq(s);return function Sbe(n){n.sort((e,t)=>e.value.outlet===Ne?-1:t.value.outlet===Ne?1:e.value.outlet.localeCompare(t.value.outlet))}(a),de(a)}))}processSegment(e,t,r,i,o,s,a){return nr(t).pipe(Em(l=>this.processSegmentAgainstRoute(l._injector??e,t,l,r,i,o,s,a).pipe(Tc(c=>{if(c instanceof vA)return de(null);throw c}))),Ic(l=>!!l),Tc(l=>{if(hq(l))return function Ebe(n,e,t){return 0===e.length&&!n.children[t]}(r,i,o)?de(new Ibe):eh(r);throw l}))}processSegmentAgainstRoute(e,t,r,i,o,s,a,l){return yo(r)===s||s!==Ne&&mw(i,o,r)?void 0===r.redirectTo?this.matchSegmentAgainstRoute(e,i,r,o,s,l):this.allowRedirects&&a?this.expandSegmentAgainstRouteUsingRedirect(e,i,t,r,o,s,l):eh(i):eh(i)}expandSegmentAgainstRouteUsingRedirect(e,t,r,i,o,s,a){const{matched:l,parameters:c,consumedSegments:u,positionalParamSegments:d,remainingSegments:f}=pq(t,i,o);if(!l)return eh(t);"string"==typeof i.redirectTo&&"/"===i.redirectTo[0]&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>31&&(this.allowRedirects=!1));const p=new cw(o,c,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,_q(i),yo(i),i.component??i._loadedComponent??null,i,yq(i)),m=lw(p,a,this.paramsInheritanceStrategy);p.params=Object.freeze(m.params),p.data=Object.freeze(m.data);const _=this.applyRedirects.applyRedirectCommands(u,i.redirectTo,d,p,e);return this.applyRedirects.lineralizeSegments(i,_).pipe(Ur(v=>this.processSegment(e,r,t,v.concat(f),s,!1,a)))}matchSegmentAgainstRoute(e,t,r,i,o,s){const a=gbe(t,r,i,e);return"**"===r.path&&(t.children={}),a.pipe(_o(l=>l.matched?this.getChildConfig(e=r._injector??e,r,i).pipe(_o(({routes:c})=>{const u=r._loadedInjector??e,{parameters:d,consumedSegments:f,remainingSegments:p}=l,m=new cw(f,d,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,_q(r),yo(r),r.component??r._loadedComponent??null,r,yq(r)),_=lw(m,s,this.paramsInheritanceStrategy);m.params=Object.freeze(_.params),m.data=Object.freeze(_.data);const{segmentGroup:v,slicedSegments:E}=mq(t,f,p,c);if(0===E.length&&v.hasChildren())return this.processChildren(u,c,v,m).pipe(Te(R=>new vo(m,R)));if(0===c.length&&0===E.length)return de(new vo(m,[]));const C=yo(r)===o;return this.processSegment(u,c,v,E,C?Ne:o,!0,m).pipe(Te(R=>new vo(m,R instanceof vo?[R]:[])))})):eh(t)))}getChildConfig(e,t,r){return t.children?de({routes:t.children,injector:e}):t.loadChildren?void 0!==t._loadedRoutes?de({routes:t._loadedRoutes,injector:t._loadedInjector}):function dbe(n,e,t,r){const i=e.canLoad;return void 0===i||0===i.length?de(!0):de(i.map(s=>{const a=Zd(s,n);return $a(function Xve(n){return n&&Om(n.canLoad)}(a)?a.canLoad(e,t):yi(n,()=>a(e,t)))})).pipe(Jd(),fq())}(e,t,r).pipe(Ur(i=>i?this.configLoader.loadChildren(e,t).pipe(Bn(o=>{t._loadedRoutes=o.routes,t._loadedInjector=o.injector})):function pbe(){return wm(cq(!1,Ai.GuardRejected))}())):de({routes:[],injector:e})}}function Dbe(n){const e=n.value.routeConfig;return e&&""===e.path}function gq(n){const e=[],t=new Set;for(const r of n){if(!Dbe(r)){e.push(r);continue}const i=e.find(o=>r.value.routeConfig===o.value.routeConfig);void 0!==i?(i.children.push(...r.children),t.add(i)):e.push(r)}for(const r of t){const i=gq(r.children);e.push(new vo(r.value,i))}return e.filter(r=>!t.has(r))}function _q(n){return n.data||{}}function yq(n){return n.resolve||{}}function vq(n){const e=n.children.map(t=>vq(t)).flat();return[n,...e]}function wA(n){return _o(e=>{const t=n(e);return t?nr(t).pipe(Te(()=>e)):de(e)})}let bq=(()=>{class n{buildTitle(t){let r,i=t.root;for(;void 0!==i;)r=this.getResolvedTitleForRoute(i)??r,i=i.children.find(o=>o.outlet===Ne);return r}getResolvedTitleForRoute(t){return t.data[Im]}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:()=>b(Pbe),providedIn:"root"})}return n})(),Pbe=(()=>{class n extends bq{title;constructor(t){super(),this.title=t}updateTitle(t){const r=this.buildTitle(t);void 0!==r&&this.title.setTitle(r)}static \u0275fac=function(r){return new(r||n)(me(H_e))};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const Fm=new B("",{providedIn:"root",factory:()=>({})});let wq=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["ng-component"]],exportAs:["emptyRouterOutlet"],decls:1,vars:0,template:function(r,i){1&r&&Pe(0,"router-outlet")},dependencies:[gA],encapsulation:2})}return n})();function EA(n){const e=n.children&&n.children.map(EA),t=e?{...n,children:e}:{...n};return!t.component&&!t.loadComponent&&(e||t.loadChildren)&&t.outlet&&t.outlet!==Ne&&(t.component=wq),t}const gw=new B("");let Eq=(()=>{class n{componentLoaders=new WeakMap;childrenLoaders=new WeakMap;onLoadStartListener;onLoadEndListener;compiler=b(Vfe);loadComponent(t){if(this.componentLoaders.get(t))return this.componentLoaders.get(t);if(t._loadedComponent)return de(t._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(t);const r=$a(t.loadComponent()).pipe(Te(Iq),Bn(o=>{this.onLoadEndListener&&this.onLoadEndListener(t),t._loadedComponent=o}),Jb(()=>{this.componentLoaders.delete(t)})),i=new N4(r,()=>new fe).pipe(eA());return this.componentLoaders.set(t,i),i}loadChildren(t,r){if(this.childrenLoaders.get(r))return this.childrenLoaders.get(r);if(r._loadedRoutes)return de({routes:r._loadedRoutes,injector:r._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(r);const o=function Obe(n,e,t,r){return $a(n.loadChildren()).pipe(Te(Iq),Ur(i=>i instanceof Vz||Array.isArray(i)?de(i):nr(e.compileModuleAsync(i))),Te(i=>{r&&r(n);let o,s,a=!1;return Array.isArray(i)?(s=i,!0):(o=i.create(t).injector,s=o.get(gw,[],{optional:!0,self:!0}).flat()),{routes:s.map(EA),injector:o}}))}(r,this.compiler,t,this.onLoadEndListener).pipe(Jb(()=>{this.childrenLoaders.delete(r)})),s=new N4(o,()=>new fe).pipe(eA());return this.childrenLoaders.set(r,s),s}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function Iq(n){return function Fbe(n){return n&&"object"==typeof n&&"default"in n}(n)?n.default:n}let IA=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:()=>b(Lbe),providedIn:"root"})}return n})(),Lbe=(()=>{class n{shouldProcessUrl(t){return!0}extract(t){return t}merge(t,r){return t}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const Tq=new B(""),xq=new B("");let _w=(()=>{class n{currentNavigation=null;currentTransition=null;lastSuccessfulNavigation=null;events=new fe;transitionAbortSubject=new fe;configLoader=b(Eq);environmentInjector=b(mr);destroyRef=b(uo);urlSerializer=b(Qd);rootContexts=b(Mm);location=b(qd);inputBindingEnabled=null!==b(uw,{optional:!0});titleStrategy=b(bq);options=b(Fm,{optional:!0})||{};paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly";urlHandlingStrategy=b(IA);createViewTransition=b(Tq,{optional:!0});navigationErrorHandler=b(xq,{optional:!0});navigationId=0;get hasRequestedNavigation(){return 0!==this.navigationId}transitions;afterPreactivation=()=>de(void 0);rootComponentType=null;destroyed=!1;constructor(){this.configLoader.onLoadEndListener=i=>this.events.next(new Sve(i)),this.configLoader.onLoadStartListener=i=>this.events.next(new xve(i)),this.destroyRef.onDestroy(()=>{this.destroyed=!0})}complete(){this.transitions?.complete()}handleNavigationRequest(t){const r=++this.navigationId;this.transitions?.next({...this.transitions.value,...t,id:r})}setupNavigations(t,r,i){return this.transitions=new mi({id:0,currentUrlTree:r,currentRawUrl:r,extractedUrl:this.urlHandlingStrategy.extract(r),urlAfterRedirects:this.urlHandlingStrategy.extract(r),rawUrl:r,extras:{},resolve:()=>{},reject:()=>{},promise:Promise.resolve(!0),source:Dm,restoredState:null,currentSnapshot:i.snapshot,targetSnapshot:null,currentRouterState:i,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.transitions.pipe(si(o=>0!==o.id),Te(o=>({...o,extractedUrl:this.urlHandlingStrategy.extract(o.rawUrl)})),_o(o=>{let s=!1,a=!1;return de(o).pipe(_o(l=>{if(this.navigationId>o.id)return this.cancelNavigationTransition(o,"",Ai.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 c=!t.navigated||this.isUpdatingInternalState()||this.isUpdatedBrowserUrl();if(!c&&"reload"!==(l.extras.onSameUrlNavigation??t.onSameUrlNavigation)){const d="";return this.events.next(new Am(l.id,this.urlSerializer.serialize(l.rawUrl),d,lA.IgnoredSameUrlNavigation)),l.resolve(!1),Di}if(this.urlHandlingStrategy.shouldProcessUrl(l.rawUrl))return de(l).pipe(_o(d=>{const f=this.transitions?.getValue();return this.events.next(new aA(d.id,this.urlSerializer.serialize(d.extractedUrl),d.source,d.restoredState)),f!==this.transitions?.getValue()?Di:Promise.resolve(d)}),function Abe(n,e,t,r,i,o){return Ur(s=>function Tbe(n,e,t,r,i,o,s="emptyOnly"){return new xbe(n,e,t,r,i,s,o).recognize()}(n,e,t,r,s.extractedUrl,i,o).pipe(Te(({state:a,tree:l})=>({...s,targetSnapshot:a,urlAfterRedirects:l}))))}(this.environmentInjector,this.configLoader,this.rootComponentType,t.config,this.urlSerializer,this.paramsInheritanceStrategy),Bn(d=>{o.targetSnapshot=d.targetSnapshot,o.urlAfterRedirects=d.urlAfterRedirects,this.currentNavigation={...this.currentNavigation,finalUrl:d.urlAfterRedirects};const f=new eq(d.id,this.urlSerializer.serialize(d.extractedUrl),this.urlSerializer.serialize(d.urlAfterRedirects),d.targetSnapshot);this.events.next(f)}));if(c&&this.urlHandlingStrategy.shouldProcessUrl(l.currentRawUrl)){const{id:d,extractedUrl:f,source:p,restoredState:m,extras:_}=l,v=new aA(d,this.urlSerializer.serialize(f),p,m);this.events.next(v);const E=rq(this.rootComponentType).snapshot;return this.currentTransition=o={...l,targetSnapshot:E,urlAfterRedirects:f,extras:{..._,skipLocationChange:!1,replaceUrl:!1}},this.currentNavigation.finalUrl=f,de(o)}{const d="";return this.events.next(new Am(l.id,this.urlSerializer.serialize(l.extractedUrl),d,lA.IgnoredByUrlHandlingStrategy)),l.resolve(!1),Di}}),Bn(l=>{const c=new Eve(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects),l.targetSnapshot);this.events.next(c)}),Te(l=>(this.currentTransition=o={...l,guards:Wve(l.targetSnapshot,l.currentSnapshot,this.rootContexts)},o)),function rbe(n,e){return Ur(t=>{const{targetSnapshot:r,currentSnapshot:i,guards:{canActivateChecks:o,canDeactivateChecks:s}}=t;return 0===s.length&&0===o.length?de({...t,guardsResult:!0}):function ibe(n,e,t,r){return nr(n).pipe(Ur(i=>function ube(n,e,t,r,i){const o=e&&e.routeConfig?e.routeConfig.canDeactivate:null;return o&&0!==o.length?de(o.map(a=>{const l=Rm(e)??i,c=Zd(a,l);return $a(function ebe(n){return n&&Om(n.canDeactivate)}(c)?c.canDeactivate(n,e,t,r):yi(l,()=>c(n,e,t,r))).pipe(Ic())})).pipe(Jd()):de(!0)}(i.component,i.route,t,e,r)),Ic(i=>!0!==i,!0))}(s,r,i,n).pipe(Ur(a=>a&&function Yve(n){return"boolean"==typeof n}(a)?function obe(n,e,t,r){return nr(e).pipe(Em(i=>Xb(function abe(n,e){return null!==n&&e&&e(new Dve(n)),de(!0)}(i.route.parent,r),function sbe(n,e){return null!==n&&e&&e(new Rve(n)),de(!0)}(i.route,r),function cbe(n,e,t){const r=e[e.length-1],o=e.slice(0,e.length-1).reverse().map(s=>function Gve(n){const e=n.routeConfig?n.routeConfig.canActivateChild:null;return e&&0!==e.length?{node:n,guards:e}:null}(s)).filter(s=>null!==s).map(s=>k4(()=>de(s.guards.map(l=>{const c=Rm(s.node)??t,u=Zd(l,c);return $a(function Jve(n){return n&&Om(n.canActivateChild)}(u)?u.canActivateChild(r,n):yi(c,()=>u(r,n))).pipe(Ic())})).pipe(Jd())));return de(o).pipe(Jd())}(n,i.path,t),function lbe(n,e,t){const r=e.routeConfig?e.routeConfig.canActivate:null;if(!r||0===r.length)return de(!0);const i=r.map(o=>k4(()=>{const s=Rm(e)??t,a=Zd(o,s);return $a(function Zve(n){return n&&Om(n.canActivate)}(a)?a.canActivate(e,n):yi(s,()=>a(e,n))).pipe(Ic())}));return de(i).pipe(Jd())}(n,i.route,t))),Ic(i=>!0!==i,!0))}(r,o,n,e):de(a)),Te(a=>({...t,guardsResult:a})))})}(this.environmentInjector,l=>this.events.next(l)),Bn(l=>{if(o.guardsResult=l.guardsResult,l.guardsResult&&"boolean"!=typeof l.guardsResult)throw dw(0,l.guardsResult);const c=new Ive(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects),l.targetSnapshot,!!l.guardsResult);this.events.next(c)}),si(l=>!!l.guardsResult||(this.cancelNavigationTransition(l,"",Ai.GuardRejected),!1)),wA(l=>{if(l.guards.canActivateChecks.length)return de(l).pipe(Bn(c=>{const u=new Tve(c.id,this.urlSerializer.serialize(c.extractedUrl),this.urlSerializer.serialize(c.urlAfterRedirects),c.targetSnapshot);this.events.next(u)}),_o(c=>{let u=!1;return de(c).pipe(function Rbe(n,e){return Ur(t=>{const{targetSnapshot:r,guards:{canActivateChecks:i}}=t;if(!i.length)return de(t);const o=new Set(i.map(l=>l.route)),s=new Set;for(const l of o)if(!s.has(l))for(const c of vq(l))s.add(c);let a=0;return nr(s).pipe(Em(l=>o.has(l)?function Mbe(n,e,t,r){const i=n.routeConfig,o=n._resolve;return void 0!==i?.title&&!sq(i)&&(o[Im]=i.title),function kbe(n,e,t,r){const i=nA(n);if(0===i.length)return de({});const o={};return nr(i).pipe(Ur(s=>function Nbe(n,e,t,r){const i=Rm(e)??r,o=Zd(n,i);return $a(o.resolve?o.resolve(e,t):yi(i,()=>o(e,t)))}(n[s],e,t,r).pipe(Ic(),Bn(a=>{if(a instanceof yA)throw dw(new tw,a);o[s]=a}))),tA(1),Te(()=>o),Tc(s=>hq(s)?Di:wm(s)))}(o,n,e,r).pipe(Te(s=>(n._resolvedData=s,n.data=lw(n,n.parent,t).resolve,null)))}(l,r,n,e):(l.data=lw(l,l.parent,n).resolve,de(void 0))),Bn(()=>a++),tA(1),Ur(l=>a===s.size?de(t):Di))})}(this.paramsInheritanceStrategy,this.environmentInjector),Bn({next:()=>u=!0,complete:()=>{u||this.cancelNavigationTransition(c,"",Ai.NoDataFromResolver)}}))}),Bn(c=>{const u=new Cve(c.id,this.urlSerializer.serialize(c.extractedUrl),this.urlSerializer.serialize(c.urlAfterRedirects),c.targetSnapshot);this.events.next(u)}))}),wA(l=>{const c=u=>{const d=[];u.routeConfig?.loadComponent&&!u.routeConfig._loadedComponent&&d.push(this.configLoader.loadComponent(u.routeConfig).pipe(Bn(f=>{u.component=f}),Te(()=>{})));for(const f of u.children)d.push(...c(f));return d};return JD(c(l.targetSnapshot.root)).pipe(Zb(null),zo(1))}),wA(()=>this.afterPreactivation()),_o(()=>{const{currentSnapshot:l,targetSnapshot:c}=o,u=this.createViewTransition?.(this.environmentInjector,l.root,c.root);return u?nr(u).pipe(Te(()=>o)):de(o)}),Te(l=>{const c=function Uve(n,e,t){const r=km(n,e._root,t?t._root:void 0);return new nq(r,e)}(t.routeReuseStrategy,l.targetSnapshot,l.currentRouterState);return this.currentTransition=o={...l,targetRouterState:c},this.currentNavigation.targetRouterState=c,o}),Bn(()=>{this.events.next(new uA)}),((n,e,t,r)=>Te(i=>(new qve(e,i.targetRouterState,i.currentRouterState,t,r).activate(n),i)))(this.rootContexts,t.routeReuseStrategy,l=>this.events.next(l),this.inputBindingEnabled),zo(1),Bn({next:l=>{s=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new Dc(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects))),this.titleStrategy?.updateTitle(l.targetRouterState.snapshot),l.resolve(!0)},complete:()=>{s=!0}}),At(this.transitionAbortSubject.pipe(Bn(l=>{throw l}))),Jb(()=>{!s&&!a&&this.cancelNavigationTransition(o,"",Ai.SupersededByNewNavigation),this.currentTransition?.id===o.id&&(this.currentNavigation=null,this.currentTransition=null)}),Tc(l=>{if(this.destroyed)return o.resolve(!1),Di;if(a=!0,uq(l))this.events.next(new Ac(o.id,this.urlSerializer.serialize(o.extractedUrl),l.message,l.cancellationCode)),function Hve(n){return uq(n)&&Sc(n.url)}(l)?this.events.next(new aw(l.url,l.navigationBehaviorOptions)):o.resolve(!1);else{const c=new cA(o.id,this.urlSerializer.serialize(o.extractedUrl),l,o.targetSnapshot??void 0);try{const u=yi(this.environmentInjector,()=>this.navigationErrorHandler?.(c));if(!(u instanceof yA))throw this.events.next(c),l;{const{message:d,cancellationCode:f}=dw(0,u);this.events.next(new Ac(o.id,this.urlSerializer.serialize(o.extractedUrl),d,f)),this.events.next(new aw(u.redirectTo,u.navigationBehaviorOptions))}}catch(u){this.options.resolveNavigationPromiseOnError?o.resolve(!1):o.reject(u)}}return Di}))}))}cancelNavigationTransition(t,r,i){const o=new Ac(t.id,this.urlSerializer.serialize(t.extractedUrl),r,i);this.events.next(o),t.resolve(!1)}isUpdatingInternalState(){return this.currentTransition?.extractedUrl.toString()!==this.currentTransition?.currentUrlTree.toString()}isUpdatedBrowserUrl(){const t=this.urlHandlingStrategy.extract(this.urlSerializer.parse(this.location.path(!0))),r=this.currentNavigation?.targetBrowserUrl??this.currentNavigation?.extractedUrl;return t.toString()!==r?.toString()&&!this.currentNavigation?.extras.skipLocationChange}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function Ube(n){return n!==Dm}let zbe=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:()=>b(Hbe),providedIn:"root"})}return n})();class jbe{shouldDetach(e){return!1}store(e,t){}shouldAttach(e){return!1}retrieve(e){return null}shouldReuseRoute(e,t){return e.routeConfig===t.routeConfig}}let Hbe=(()=>{class n extends jbe{static \u0275fac=(()=>{let t;return function(i){return(t||(t=bt(n)))(i||n)}})();static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Sq=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:()=>b($be),providedIn:"root"})}return n})(),$be=(()=>{class n extends Sq{location=b(qd);urlSerializer=b(Qd);options=b(Fm,{optional:!0})||{};canceledNavigationResolution=this.options.canceledNavigationResolution||"replace";urlHandlingStrategy=b(IA);urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred";currentUrlTree=new Cc;getCurrentUrlTree(){return this.currentUrlTree}rawUrlTree=this.currentUrlTree;getRawUrlTree(){return this.rawUrlTree}currentPageId=0;lastSuccessfulId=-1;restoredState(){return this.location.getState()}get browserPageId(){return"computed"!==this.canceledNavigationResolution?this.currentPageId:this.restoredState()?.\u0275routerPageId??this.currentPageId}routerState=rq(null);getRouterState(){return this.routerState}stateMemento=this.createStateMemento();createStateMemento(){return{rawUrlTree:this.rawUrlTree,currentUrlTree:this.currentUrlTree,routerState:this.routerState}}registerNonRouterCurrentEntryChangeListener(t){return this.location.subscribe(r=>{"popstate"===r.type&&t(r.url,r.state)})}handleRouterEvent(t,r){if(t instanceof aA)this.stateMemento=this.createStateMemento();else if(t instanceof Am)this.rawUrlTree=r.initialUrl;else if(t instanceof eq){if("eager"===this.urlUpdateStrategy&&!r.extras.skipLocationChange){const i=this.urlHandlingStrategy.merge(r.finalUrl,r.initialUrl);this.setBrowserUrl(r.targetBrowserUrl??i,r)}}else t instanceof uA?(this.currentUrlTree=r.finalUrl,this.rawUrlTree=this.urlHandlingStrategy.merge(r.finalUrl,r.initialUrl),this.routerState=r.targetRouterState,"deferred"===this.urlUpdateStrategy&&!r.extras.skipLocationChange&&this.setBrowserUrl(r.targetBrowserUrl??this.rawUrlTree,r)):t instanceof Ac&&(t.code===Ai.GuardRejected||t.code===Ai.NoDataFromResolver)?this.restoreHistory(r):t instanceof cA?this.restoreHistory(r,!0):t instanceof Dc&&(this.lastSuccessfulId=t.id,this.currentPageId=this.browserPageId)}setBrowserUrl(t,r){const i=t instanceof Cc?this.urlSerializer.serialize(t):t;if(this.location.isCurrentPathEqualTo(i)||r.extras.replaceUrl){const s={...r.extras.state,...this.generateNgRouterState(r.id,this.browserPageId)};this.location.replaceState(i,"",s)}else{const o={...r.extras.state,...this.generateNgRouterState(r.id,this.browserPageId+1)};this.location.go(i,"",o)}}restoreHistory(t,r=!1){if("computed"===this.canceledNavigationResolution){const o=this.currentPageId-this.browserPageId;0!==o?this.location.historyGo(o):this.currentUrlTree===t.finalUrl&&0===o&&(this.resetState(t),this.resetUrlToCurrentUrlTree())}else"replace"===this.canceledNavigationResolution&&(r&&this.resetState(t),this.resetUrlToCurrentUrlTree())}resetState(t){this.routerState=this.stateMemento.routerState,this.currentUrlTree=this.stateMemento.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,t.finalUrl??this.rawUrlTree)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(t,r){return"computed"===this.canceledNavigationResolution?{navigationId:t,\u0275routerPageId:r}:{navigationId:t}}static \u0275fac=(()=>{let t;return function(i){return(t||(t=bt(n)))(i||n)}})();static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const qbe={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},Wbe={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};let bo=(()=>{class n{get currentUrlTree(){return this.stateManager.getCurrentUrlTree()}get rawUrlTree(){return this.stateManager.getRawUrlTree()}disposed=!1;nonRouterCurrentEntryChangeSubscription;console=b(tj);stateManager=b(Sq);options=b(Fm,{optional:!0})||{};pendingTasks=b(Es);urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred";navigationTransitions=b(_w);urlSerializer=b(Qd);location=b(qd);urlHandlingStrategy=b(IA);_events=new fe;get events(){return this._events}get routerState(){return this.stateManager.getRouterState()}navigated=!1;routeReuseStrategy=b(zbe);onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore";config=b(gw,{optional:!0})?.flat()??[];componentInputBindingEnabled=!!b(uw,{optional:!0});constructor(){this.resetConfig(this.config),this.navigationTransitions.setupNavigations(this,this.currentUrlTree,this.routerState).subscribe({error:t=>{this.console.warn(t)}}),this.subscribeToNavigationEvents()}eventsSubscription=new Kt;subscribeToNavigationEvents(){const t=this.navigationTransitions.events.subscribe(r=>{try{const i=this.navigationTransitions.currentTransition,o=this.navigationTransitions.currentNavigation;if(null!==i&&null!==o)if(this.stateManager.handleRouterEvent(r,o),r instanceof Ac&&r.code!==Ai.Redirect&&r.code!==Ai.SupersededByNewNavigation)this.navigated=!0;else if(r instanceof Dc)this.navigated=!0;else if(r instanceof aw){const s=r.navigationBehaviorOptions,a=this.urlHandlingStrategy.merge(r.url,i.currentRawUrl),l={browserUrl:i.extras.browserUrl,info:i.extras.info,skipLocationChange:i.extras.skipLocationChange,replaceUrl:i.extras.replaceUrl||"eager"===this.urlUpdateStrategy||Ube(i.source),...s};this.scheduleNavigation(a,Dm,null,l,{resolve:i.resolve,reject:i.reject,promise:i.promise})}(function Kbe(n){return!(n instanceof uA||n instanceof aw)})(r)&&this._events.next(r)}catch(i){this.navigationTransitions.transitionAbortSubject.next(i)}});this.eventsSubscription.add(t)}resetRootComponentType(t){this.routerState.root.component=t,this.navigationTransitions.rootComponentType=t}initialNavigation(){this.setUpLocationChangeListener(),this.navigationTransitions.hasRequestedNavigation||this.navigateToSyncWithBrowser(this.location.path(!0),Dm,this.stateManager.restoredState())}setUpLocationChangeListener(){this.nonRouterCurrentEntryChangeSubscription??=this.stateManager.registerNonRouterCurrentEntryChangeListener((t,r)=>{setTimeout(()=>{this.navigateToSyncWithBrowser(t,"popstate",r)},0)})}navigateToSyncWithBrowser(t,r,i){const o={replaceUrl:!0},s=i?.navigationId?i:null;if(i){const l={...i};delete l.navigationId,delete l.\u0275routerPageId,0!==Object.keys(l).length&&(o.state=l)}const a=this.parseUrl(t);this.scheduleNavigation(a,r,s,o)}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.navigationTransitions.currentNavigation}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(t){this.config=t.map(EA),this.navigated=!1}ngOnDestroy(){this.dispose()}dispose(){this._events.unsubscribe(),this.navigationTransitions.complete(),this.nonRouterCurrentEntryChangeSubscription&&(this.nonRouterCurrentEntryChangeSubscription.unsubscribe(),this.nonRouterCurrentEntryChangeSubscription=void 0),this.disposed=!0,this.eventsSubscription.unsubscribe()}createUrlTree(t,r={}){const{relativeTo:i,queryParams:o,fragment:s,queryParamsHandling:a,preserveFragment:l}=r,c=l?this.currentUrlTree.fragment:s;let d,u=null;switch(a??this.options.defaultQueryParamsHandling){case"merge":u={...this.currentUrlTree.queryParams,...o};break;case"preserve":u=this.currentUrlTree.queryParams;break;default:u=o||null}null!==u&&(u=this.removeEmptyProps(u));try{d=G4(i?i.snapshot:this.routerState.snapshot.root)}catch{("string"!=typeof t[0]||"/"!==t[0][0])&&(t=[]),d=this.currentUrlTree.root}return K4(d,t,u,c??null)}navigateByUrl(t,r={skipLocationChange:!1}){const i=Sc(t)?t:this.parseUrl(t),o=this.urlHandlingStrategy.merge(i,this.rawUrlTree);return this.scheduleNavigation(o,Dm,null,r)}navigate(t,r={skipLocationChange:!1}){return function Gbe(n){for(let e=0;e(null!=o&&(r[i]=o),r),{})}scheduleNavigation(t,r,i,o,s){if(this.disposed)return Promise.resolve(!1);let a,l,c;s?(a=s.resolve,l=s.reject,c=s.promise):c=new Promise((d,f)=>{a=d,l=f});const u=this.pendingTasks.add();return function Dq(n,e){n.events.pipe(si(t=>t instanceof Dc||t instanceof Ac||t instanceof cA||t instanceof Am),Te(t=>t instanceof Dc||t instanceof Am?0:t instanceof Ac&&(t.code===Ai.Redirect||t.code===Ai.SupersededByNewNavigation)?2:1),si(t=>2!==t),zo(1)).subscribe(()=>{e()})}(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(u))}),this.navigationTransitions.handleNavigationRequest({source:r,restoredState:i,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,rawUrl:t,extras:o,resolve:a,reject:l,promise:c,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),c.catch(d=>Promise.reject(d))}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),th=(()=>{class n{router;route;tabIndexAttribute;renderer;el;locationStrategy;href=null;target;queryParams;fragment;queryParamsHandling;state;info;relativeTo;isAnchorElement;subscription;onChanges=new fe;constructor(t,r,i,o,s,a){this.router=t,this.route=r,this.tabIndexAttribute=i,this.renderer=o,this.el=s,this.locationStrategy=a;const l=s.nativeElement.tagName?.toLowerCase();this.isAnchorElement="a"===l||"area"===l,this.isAnchorElement?this.subscription=t.events.subscribe(c=>{c instanceof Dc&&this.updateHref()}):this.setTabIndexIfNotOnNativeEl("0")}preserveFragment=!1;skipLocationChange=!1;replaceUrl=!1;setTabIndexIfNotOnNativeEl(t){null!=this.tabIndexAttribute||this.isAnchorElement||this.applyAttributeValue("tabindex",t)}ngOnChanges(t){this.isAnchorElement&&this.updateHref(),this.onChanges.next(this)}routerLinkInput=null;set routerLink(t){null==t?(this.routerLinkInput=null,this.setTabIndexIfNotOnNativeEl(null)):(this.routerLinkInput=Sc(t)||Array.isArray(t)?t:[t],this.setTabIndexIfNotOnNativeEl("0"))}onClick(t,r,i,o,s){const a=this.urlTree;return!!(null===a||this.isAnchorElement&&(0!==t||r||i||o||s||"string"==typeof this.target&&"_self"!=this.target))||(this.router.navigateByUrl(a,{skipLocationChange:this.skipLocationChange,replaceUrl:this.replaceUrl,state:this.state,info:this.info}),!this.isAnchorElement)}ngOnDestroy(){this.subscription?.unsubscribe()}updateHref(){const t=this.urlTree;this.href=null!==t&&this.locationStrategy?this.locationStrategy?.prepareExternalUrl(this.router.serializeUrl(t)):null;const r=null===this.href?null:function QB(n,e,t){return function Foe(n,e){return"src"===e&&("embed"===n||"frame"===n||"iframe"===n||"media"===n||"script"===n)||"href"===e&&("base"===n||"link"===n)?KB:vx}(e,t)(n)}(this.href,this.el.nativeElement.tagName.toLowerCase(),"href");this.applyAttributeValue("href",r)}applyAttributeValue(t,r){const i=this.renderer,o=this.el.nativeElement;null!==r?i.setAttribute(o,t,r):i.removeAttribute(o,t)}get urlTree(){return null===this.routerLinkInput?null:Sc(this.routerLinkInput)?this.routerLinkInput:this.router.createUrlTree(this.routerLinkInput,{relativeTo:void 0!==this.relativeTo?this.relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:this.preserveFragment})}static \u0275fac=function(r){return new(r||n)($(bo),$(Xd),ap("tabindex"),$(Ti),$(je),$(Sb))};static \u0275dir=ee({type:n,selectors:[["","routerLink",""]],hostVars:1,hostBindings:function(r,i){1&r&&Ve("click",function(s){return i.onClick(s.button,s.ctrlKey,s.shiftKey,s.altKey,s.metaKey)}),2&r&&Ke("target",i.target)},inputs:{target:"target",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",state:"state",info:"info",relativeTo:"relativeTo",preserveFragment:[2,"preserveFragment","preserveFragment",_t],skipLocationChange:[2,"skipLocationChange","skipLocationChange",_t],replaceUrl:[2,"replaceUrl","replaceUrl",_t],routerLink:"routerLink"},features:[ei]})}return n})();const TA=new B("");function Rq(n){return n.routerState.root}function Mq(){const n=b(ze);return e=>{const t=n.get(tr);if(e!==t.components[0])return;const r=n.get(bo),i=n.get(kq);1===n.get(CA)&&r.initialNavigation(),n.get(Nq,null,Le.Optional)?.setUpPreloading(),n.get(TA,null,Le.Optional)?.init(),r.resetRootComponentType(t.componentTypes[0]),i.closed||(i.next(),i.complete(),i.unsubscribe())}}const kq=new B("",{factory:()=>new fe}),CA=new B("",{providedIn:"root",factory:()=>1}),Nq=new B("");function Oq(...n){const e=S4(n),{args:t,keys:r}=D4(n),i=new vt(o=>{const{length:s}=t;if(!s)return void o.complete();const a=new Array(s);let l=s,c=s;for(let u=0;u{d||(d=!0,c--),a[u]=f},()=>l--,void 0,()=>{(!l||!d)&&(c||o.next(r?R4(r,a):a),o.complete())}))}});return e?i.pipe(A4(e)):i}let Fq=(()=>{class n{_renderer;_elementRef;onChange=t=>{};onTouched=()=>{};constructor(t,r){this._renderer=t,this._elementRef=r}setProperty(t,r){this._renderer.setProperty(this._elementRef.nativeElement,t,r)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}static \u0275fac=function(r){return new(r||n)($(Ti),$(je))};static \u0275dir=ee({type:n})}return n})(),Rc=(()=>{class n extends Fq{static \u0275fac=(()=>{let t;return function(i){return(t||(t=bt(n)))(i||n)}})();static \u0275dir=ee({type:n,features:[ke]})}return n})();const Yi=new B(""),owe={provide:Yi,useExisting:ft(()=>nh),multi:!0},awe=new B("");let nh=(()=>{class n extends Fq{_compositionMode;_composing=!1;constructor(t,r,i){super(t,r),this._compositionMode=i,null==this._compositionMode&&(this._compositionMode=!function swe(){const n=Ua()?Ua().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}())}writeValue(t){this.setProperty("value",t??"")}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}static \u0275fac=function(r){return new(r||n)($(Ti),$(je),$(awe,8))};static \u0275dir=ee({type:n,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(r,i){1&r&&Ve("input",function(s){return i._handleInput(s.target.value)})("blur",function(){return i.onTouched()})("compositionstart",function(){return i._compositionStart()})("compositionend",function(s){return i._compositionEnd(s.target.value)})},standalone:!1,features:[$e([owe]),ke]})}return n})();function qa(n){return null==n||("string"==typeof n||Array.isArray(n))&&0===n.length}function Vq(n){return null!=n&&"number"==typeof n.length}const yr=new B(""),Wa=new B(""),lwe=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;class Ri{static min(e){return function Bq(n){return e=>{if(qa(e.value)||qa(n))return null;const t=parseFloat(e.value);return!isNaN(t)&&t{if(qa(e.value)||qa(n))return null;const t=parseFloat(e.value);return!isNaN(t)&&t>n?{max:{max:n,actual:e.value}}:null}}(e)}static required(e){return function zq(n){return qa(n.value)?{required:!0}:null}(e)}static requiredTrue(e){return function jq(n){return!0===n.value?null:{required:!0}}(e)}static email(e){return function Hq(n){return qa(n.value)||lwe.test(n.value)?null:{email:!0}}(e)}static minLength(e){return function $q(n){return e=>qa(e.value)||!Vq(e.value)?null:e.value.lengthVq(e.value)&&e.value.length>n?{maxlength:{requiredLength:n,actualLength:e.value.length}}:null}(e)}static pattern(e){return function Wq(n){if(!n)return yw;let e,t;return"string"==typeof n?(t="","^"!==n.charAt(0)&&(t+="^"),t+=n,"$"!==n.charAt(n.length-1)&&(t+="$"),e=new RegExp(t)):(t=n.toString(),e=n),r=>{if(qa(r.value))return null;const i=r.value;return e.test(i)?null:{pattern:{requiredPattern:t,actualValue:i}}}}(e)}static nullValidator(e){return null}static compose(e){return Zq(e)}static composeAsync(e){return Jq(e)}}function yw(n){return null}function Gq(n){return null!=n}function Kq(n){return Gp(n)?nr(n):n}function Qq(n){let e={};return n.forEach(t=>{e=null!=t?{...e,...t}:e}),0===Object.keys(e).length?null:e}function Yq(n,e){return e.map(t=>t(n))}function Xq(n){return n.map(e=>function cwe(n){return!n.validate}(e)?e:t=>e.validate(t))}function Zq(n){if(!n)return null;const e=n.filter(Gq);return 0==e.length?null:function(t){return Qq(Yq(t,e))}}function xA(n){return null!=n?Zq(Xq(n)):null}function Jq(n){if(!n)return null;const e=n.filter(Gq);return 0==e.length?null:function(t){return Oq(Yq(t,e).map(Kq)).pipe(Te(Qq))}}function SA(n){return null!=n?Jq(Xq(n)):null}function e5(n,e){return null===n?[e]:Array.isArray(n)?[...n,e]:[n,e]}function t5(n){return n._rawValidators}function n5(n){return n._rawAsyncValidators}function DA(n){return n?Array.isArray(n)?n:[n]:[]}function vw(n,e){return Array.isArray(n)?n.includes(e):n===e}function r5(n,e){const t=DA(e);return DA(n).forEach(i=>{vw(t,i)||t.push(i)}),t}function i5(n,e){return DA(e).filter(t=>!vw(n,t))}class o5{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}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(e){this._rawValidators=e||[],this._composedValidatorFn=xA(this._rawValidators)}_setAsyncValidators(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=SA(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(e){this._onDestroyCallbacks.push(e)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(e=>e()),this._onDestroyCallbacks=[]}reset(e=void 0){this.control&&this.control.reset(e)}hasError(e,t){return!!this.control&&this.control.hasError(e,t)}getError(e,t){return this.control?this.control.getError(e,t):null}}class zr extends o5{name;get formDirective(){return null}get path(){return null}}class qo extends o5{_parent=null;name=null;valueAccessor=null}class s5{_cd;constructor(e){this._cd=e}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 bw=(()=>{class n extends s5{constructor(t){super(t)}static \u0275fac=function(r){return new(r||n)($(qo,2))};static \u0275dir=ee({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(r,i){2&r&&at("ng-untouched",i.isUntouched)("ng-touched",i.isTouched)("ng-pristine",i.isPristine)("ng-dirty",i.isDirty)("ng-valid",i.isValid)("ng-invalid",i.isInvalid)("ng-pending",i.isPending)},standalone:!1,features:[ke]})}return n})(),ww=(()=>{class n extends s5{constructor(t){super(t)}static \u0275fac=function(r){return new(r||n)($(zr,10))};static \u0275dir=ee({type:n,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(r,i){2&r&&at("ng-untouched",i.isUntouched)("ng-touched",i.isTouched)("ng-pristine",i.isPristine)("ng-dirty",i.isDirty)("ng-valid",i.isValid)("ng-invalid",i.isInvalid)("ng-pending",i.isPending)("ng-submitted",i.isSubmitted)},standalone:!1,features:[ke]})}return n})();const Lm="VALID",Iw="INVALID",rh="PENDING",Vm="DISABLED";class ih{}class l5 extends ih{value;source;constructor(e,t){super(),this.value=e,this.source=t}}class MA extends ih{pristine;source;constructor(e,t){super(),this.pristine=e,this.source=t}}class kA extends ih{touched;source;constructor(e,t){super(),this.touched=e,this.source=t}}class Tw extends ih{status;source;constructor(e,t){super(),this.status=e,this.source=t}}class pwe extends ih{source;constructor(e){super(),this.source=e}}class mwe extends ih{source;constructor(e){super(),this.source=e}}function NA(n){return(Cw(n)?n.validators:n)||null}function PA(n,e){return(Cw(e)?e.asyncValidators:n)||null}function Cw(n){return null!=n&&!Array.isArray(n)&&"object"==typeof n}function c5(n,e,t){const r=n.controls;if(!(e?Object.keys(r):r).length)throw new O(1e3,"");if(!r[t])throw new O(1001,"")}function u5(n,e,t){n._forEachChild((r,i)=>{if(void 0===t[i])throw new O(1002,"")})}class xw{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(e,t){this._assignValidators(e),this._assignAsyncValidators(t)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get status(){return Wn(this.statusReactive)}set status(e){Wn(()=>this.statusReactive.set(e))}_status=xi(()=>this.statusReactive());statusReactive=ti(void 0);get valid(){return this.status===Lm}get invalid(){return this.status===Iw}get pending(){return this.status==rh}get disabled(){return this.status===Vm}get enabled(){return this.status!==Vm}errors;get pristine(){return Wn(this.pristineReactive)}set pristine(e){Wn(()=>this.pristineReactive.set(e))}_pristine=xi(()=>this.pristineReactive());pristineReactive=ti(!0);get dirty(){return!this.pristine}get touched(){return Wn(this.touchedReactive)}set touched(e){Wn(()=>this.touchedReactive.set(e))}_touched=xi(()=>this.touchedReactive());touchedReactive=ti(!1);get untouched(){return!this.touched}_events=new fe;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._assignValidators(e)}setAsyncValidators(e){this._assignAsyncValidators(e)}addValidators(e){this.setValidators(r5(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(r5(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(i5(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(i5(e,this._rawAsyncValidators))}hasValidator(e){return vw(this._rawValidators,e)}hasAsyncValidator(e){return vw(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){const t=!1===this.touched;this.touched=!0;const r=e.sourceControl??this;this._parent&&!e.onlySelf&&this._parent.markAsTouched({...e,sourceControl:r}),t&&!1!==e.emitEvent&&this._events.next(new kA(!0,r))}markAllAsTouched(e={}){this.markAsTouched({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:this}),this._forEachChild(t=>t.markAllAsTouched(e))}markAsUntouched(e={}){const t=!0===this.touched;this.touched=!1,this._pendingTouched=!1;const r=e.sourceControl??this;this._forEachChild(i=>{i.markAsUntouched({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:r})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e,r),t&&!1!==e.emitEvent&&this._events.next(new kA(!1,r))}markAsDirty(e={}){const t=!0===this.pristine;this.pristine=!1;const r=e.sourceControl??this;this._parent&&!e.onlySelf&&this._parent.markAsDirty({...e,sourceControl:r}),t&&!1!==e.emitEvent&&this._events.next(new MA(!1,r))}markAsPristine(e={}){const t=!1===this.pristine;this.pristine=!0,this._pendingDirty=!1;const r=e.sourceControl??this;this._forEachChild(i=>{i.markAsPristine({onlySelf:!0,emitEvent:e.emitEvent})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e,r),t&&!1!==e.emitEvent&&this._events.next(new MA(!0,r))}markAsPending(e={}){this.status=rh;const t=e.sourceControl??this;!1!==e.emitEvent&&(this._events.next(new Tw(this.status,t)),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.markAsPending({...e,sourceControl:t})}disable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=Vm,this.errors=null,this._forEachChild(i=>{i.disable({...e,onlySelf:!0})}),this._updateValue();const r=e.sourceControl??this;!1!==e.emitEvent&&(this._events.next(new l5(this.value,r)),this._events.next(new Tw(this.status,r)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors({...e,skipPristineCheck:t},this),this._onDisabledChange.forEach(i=>i(!0))}enable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status=Lm,this._forEachChild(r=>{r.enable({...e,onlySelf:!0})}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors({...e,skipPristineCheck:t},this),this._onDisabledChange.forEach(r=>r(!1))}_updateAncestors(e,t){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine({},t),this._parent._updateTouched({},t))}setParent(e){this._parent=e}getRawValue(){return this.value}updateValueAndValidity(e={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){const r=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===Lm||this.status===rh)&&this._runAsyncValidator(r,e.emitEvent)}const t=e.sourceControl??this;!1!==e.emitEvent&&(this._events.next(new l5(this.value,t)),this._events.next(new Tw(this.status,t)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity({...e,sourceControl:t})}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?Vm:Lm}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e,t){if(this.asyncValidator){this.status=rh,this._hasOwnPendingAsyncValidator={emitEvent:!1!==t};const r=Kq(this.asyncValidator(this));this._asyncValidationSubscription=r.subscribe(i=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(i,{emitEvent:t,shouldHaveEmitted:e})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();const e=this._hasOwnPendingAsyncValidator?.emitEvent??!1;return this._hasOwnPendingAsyncValidator=null,e}return!1}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(!1!==t.emitEvent,this,t.shouldHaveEmitted)}get(e){let t=e;return null==t||(Array.isArray(t)||(t=t.split(".")),0===t.length)?null:t.reduce((r,i)=>r&&r._find(i),this)}getError(e,t){const r=t?this.get(t):this;return r&&r.errors?r.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e,t,r){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),(e||r)&&this._events.next(new Tw(this.status,t)),this._parent&&this._parent._updateControlsErrors(e,t,r)}_initObservables(){this.valueChanges=new nt,this.statusChanges=new nt}_calculateStatus(){return this._allControlsDisabled()?Vm:this.errors?Iw:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(rh)?rh:this._anyControlsHaveStatus(Iw)?Iw:Lm}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e,t){const r=!this._anyControlsDirty(),i=this.pristine!==r;this.pristine=r,this._parent&&!e.onlySelf&&this._parent._updatePristine(e,t),i&&this._events.next(new MA(this.pristine,t))}_updateTouched(e={},t){this.touched=this._anyControlsTouched(),this._events.next(new kA(this.touched,t)),this._parent&&!e.onlySelf&&this._parent._updateTouched(e,t)}_onDisabledChange=[];_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){Cw(e)&&null!=e.updateOn&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){return!e&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}_find(e){return null}_assignValidators(e){this._rawValidators=Array.isArray(e)?e.slice():e,this._composedValidatorFn=function gwe(n){return Array.isArray(n)?xA(n):n||null}(this._rawValidators)}_assignAsyncValidators(e){this._rawAsyncValidators=Array.isArray(e)?e.slice():e,this._composedAsyncValidatorFn=function _we(n){return Array.isArray(n)?SA(n):n||null}(this._rawAsyncValidators)}}class Bm extends xw{constructor(e,t,r){super(NA(t),PA(r,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t,r={}){this.registerControl(e,t),this.updateValueAndValidity({emitEvent:r.emitEvent}),this._onCollectionChange()}removeControl(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}setControl(e,t,r={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity({emitEvent:r.emitEvent}),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){u5(this,0,e),Object.keys(e).forEach(r=>{c5(this,!0,r),this.controls[r].setValue(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(Object.keys(e).forEach(r=>{const i=this.controls[r];i&&i.patchValue(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e={},t={}){this._forEachChild((r,i)=>{r.reset(e?e[i]:null,{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t,this),this._updateTouched(t,this),this.updateValueAndValidity(t)}getRawValue(){return this._reduceChildren({},(e,t,r)=>(e[r]=t.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(t,r)=>!!r._syncPendingControls()||t);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_forEachChild(e){Object.keys(this.controls).forEach(t=>{const r=this.controls[t];r&&e(r,t)})}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(const[t,r]of Object.entries(this.controls))if(this.contains(t)&&e(r))return!0;return!1}_reduceValue(){return this._reduceChildren({},(t,r,i)=>((r.enabled||this.disabled)&&(t[i]=r.value),t))}_reduceChildren(e,t){let r=e;return this._forEachChild((i,o)=>{r=t(r,i,o)}),r}_allControlsDisabled(){for(const e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(e){return this.controls.hasOwnProperty(e)?this.controls[e]:null}}class d5 extends Bm{}const oh=new B("",{providedIn:"root",factory:()=>Sw}),Sw="always";function Um(n,e,t=Sw){OA(n,e),e.valueAccessor.writeValue(n.value),(n.disabled||"always"===t)&&e.valueAccessor.setDisabledState?.(n.disabled),function vwe(n,e){e.valueAccessor.registerOnChange(t=>{n._pendingValue=t,n._pendingChange=!0,n._pendingDirty=!0,"change"===n.updateOn&&h5(n,e)})}(n,e),function wwe(n,e){const t=(r,i)=>{e.valueAccessor.writeValue(r),i&&e.viewToModelUpdate(r)};n.registerOnChange(t),e._registerOnDestroy(()=>{n._unregisterOnChange(t)})}(n,e),function bwe(n,e){e.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,"blur"===n.updateOn&&n._pendingChange&&h5(n,e),"submit"!==n.updateOn&&n.markAsTouched()})}(n,e),function ywe(n,e){if(e.valueAccessor.setDisabledState){const t=r=>{e.valueAccessor.setDisabledState(r)};n.registerOnDisabledChange(t),e._registerOnDestroy(()=>{n._unregisterOnDisabledChange(t)})}}(n,e)}function Aw(n,e,t=!0){const r=()=>{};e.valueAccessor&&(e.valueAccessor.registerOnChange(r),e.valueAccessor.registerOnTouched(r)),Mw(n,e),n&&(e._invokeOnDestroyCallbacks(),n._registerOnCollectionChange(()=>{}))}function Rw(n,e){n.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function OA(n,e){const t=t5(n);null!==e.validator?n.setValidators(e5(t,e.validator)):"function"==typeof t&&n.setValidators([t]);const r=n5(n);null!==e.asyncValidator?n.setAsyncValidators(e5(r,e.asyncValidator)):"function"==typeof r&&n.setAsyncValidators([r]);const i=()=>n.updateValueAndValidity();Rw(e._rawValidators,i),Rw(e._rawAsyncValidators,i)}function Mw(n,e){let t=!1;if(null!==n){if(null!==e.validator){const i=t5(n);if(Array.isArray(i)&&i.length>0){const o=i.filter(s=>s!==e.validator);o.length!==i.length&&(t=!0,n.setValidators(o))}}if(null!==e.asyncValidator){const i=n5(n);if(Array.isArray(i)&&i.length>0){const o=i.filter(s=>s!==e.asyncValidator);o.length!==i.length&&(t=!0,n.setAsyncValidators(o))}}}const r=()=>{};return Rw(e._rawValidators,r),Rw(e._rawAsyncValidators,r),t}function h5(n,e){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function f5(n,e){OA(n,e)}function p5(n,e){n._syncPendingControls(),e.forEach(t=>{const r=t.control;"submit"===r.updateOn&&r._pendingChange&&(t.viewToModelUpdate(r._pendingValue),r._pendingChange=!1)})}const xwe={provide:zr,useExisting:ft(()=>jm)},zm=Promise.resolve();let jm=(()=>{class n extends zr{callSetDisabledState;get submitted(){return Wn(this.submittedReactive)}_submitted=xi(()=>this.submittedReactive());submittedReactive=ti(!1);_directives=new Set;form;ngSubmit=new nt;options;constructor(t,r,i){super(),this.callSetDisabledState=i,this.form=new Bm({},xA(t),SA(r))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){zm.then(()=>{const r=this._findContainer(t.path);t.control=r.registerControl(t.name,t.control),Um(t.control,t,this.callSetDisabledState),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){zm.then(()=>{const r=this._findContainer(t.path);r&&r.removeControl(t.name),this._directives.delete(t)})}addFormGroup(t){zm.then(()=>{const r=this._findContainer(t.path),i=new Bm({});f5(i,t),r.registerControl(t.name,i),i.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){zm.then(()=>{const r=this._findContainer(t.path);r&&r.removeControl(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,r){zm.then(()=>{this.form.get(t.path).setValue(r)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submittedReactive.set(!0),p5(this.form,this._directives),this.ngSubmit.emit(t),"dialog"===t?.target?.method}onReset(){this.resetForm()}resetForm(t=void 0){this.form.reset(t),this.submittedReactive.set(!1)}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)}_findContainer(t){return t.pop(),t.length?this.form.get(t):this.form}static \u0275fac=function(r){return new(r||n)($(yr,10),$(Wa,10),$(oh,8))};static \u0275dir=ee({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(r,i){1&r&&Ve("submit",function(s){return i.onSubmit(s)})("reset",function(){return i.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[$e([xwe]),ke]})}return n})();function m5(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}function g5(n){return"object"==typeof n&&null!==n&&2===Object.keys(n).length&&"value"in n&&"disabled"in n}const Hm=class extends xw{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(e=null,t,r){super(NA(t),PA(r,t)),this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),Cw(t)&&(t.nonNullable||t.initialValueIsDefault)&&(this.defaultValue=g5(e)?e.value:e)}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&!1!==t.emitModelToViewChange&&this._onChange.forEach(r=>r(this.value,!1!==t.emitViewToModelChange)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=this.defaultValue,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){m5(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){m5(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(e){g5(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}};Promise.resolve();let kw=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""],standalone:!1})}return n})();const BA=new B(""),Owe={provide:zr,useExisting:ft(()=>Ga)};let Ga=(()=>{class n extends zr{callSetDisabledState;get submitted(){return Wn(this._submittedReactive)}set submitted(t){this._submittedReactive.set(t)}_submitted=xi(()=>this._submittedReactive());_submittedReactive=ti(!1);_oldForm;_onCollectionChange=()=>this._updateDomValue();directives=[];form=null;ngSubmit=new nt;constructor(t,r,i){super(),this.callSetDisabledState=i,this._setValidators(t),this._setAsyncValidators(r)}ngOnChanges(t){t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(Mw(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(t){const r=this.form.get(t.path);return Um(r,t,this.callSetDisabledState),r.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),r}getControl(t){return this.form.get(t.path)}removeControl(t){Aw(t.control||null,t,!1),function Cwe(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}(this.directives,t)}addFormGroup(t){this._setUpFormContainer(t)}removeFormGroup(t){this._cleanUpFormContainer(t)}getFormGroup(t){return this.form.get(t.path)}addFormArray(t){this._setUpFormContainer(t)}removeFormArray(t){this._cleanUpFormContainer(t)}getFormArray(t){return this.form.get(t.path)}updateModel(t,r){this.form.get(t.path).setValue(r)}onSubmit(t){return this._submittedReactive.set(!0),p5(this.form,this.directives),this.ngSubmit.emit(t),this.form._events.next(new pwe(this.control)),"dialog"===t?.target?.method}onReset(){this.resetForm()}resetForm(t=void 0){this.form.reset(t),this._submittedReactive.set(!1),this.form._events.next(new mwe(this.form))}_updateDomValue(){this.directives.forEach(t=>{const r=t.control,i=this.form.get(t.path);r!==i&&(Aw(r||null,t),(n=>n instanceof Hm)(i)&&(Um(i,t,this.callSetDisabledState),t.control=i))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(t){const r=this.form.get(t.path);f5(r,t),r.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(t){if(this.form){const r=this.form.get(t.path);r&&function Ewe(n,e){return Mw(n,e)}(r,t)&&r.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){OA(this.form,this),this._oldForm&&Mw(this._oldForm,this)}static \u0275fac=function(r){return new(r||n)($(yr,10),$(Wa,10),$(oh,8))};static \u0275dir=ee({type:n,selectors:[["","formGroup",""]],hostBindings:function(r,i){1&r&&Ve("submit",function(s){return i.onSubmit(s)})("reset",function(){return i.onReset()})},inputs:{form:[0,"formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[$e([Owe]),ke,ei]})}return n})();const Vwe={provide:qo,useExisting:ft(()=>$m)};let $m=(()=>{class n extends qo{_ngModelWarningConfig;_added=!1;viewModel;control;name=null;set isDisabled(t){}model;update=new nt;static _ngModelWarningSentOnce=!1;_ngModelWarningSent=!1;constructor(t,r,i,o,s){super(),this._ngModelWarningConfig=s,this._parent=t,this._setValidators(r),this._setAsyncValidators(i),this.valueAccessor=function VA(n,e){if(!e)return null;let t,r,i;return Array.isArray(e),e.forEach(o=>{o.constructor===nh?t=o:function Twe(n){return Object.getPrototypeOf(n.constructor)===Rc}(o)?r=o:i=o}),i||r||t||null}(0,o)}ngOnChanges(t){this._added||this._setUpControl(),function LA(n,e){if(!n.hasOwnProperty("model"))return!1;const t=n.model;return!!t.isFirstChange()||!Object.is(e,t.currentValue)}(t,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}get path(){return function Dw(n,e){return[...e.path,n]}(null==this.name?this.name:this.name.toString(),this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}_checkParentType(){}_setUpControl(){this.control=this.formDirective.addControl(this),this._added=!0}static \u0275fac=function(r){return new(r||n)($(zr,13),$(yr,10),$(Wa,10),$(Yi,10),$(BA,8))};static \u0275dir=ee({type:n,selectors:[["","formControlName",""]],inputs:{name:[0,"formControlName","name"],isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"]},outputs:{update:"ngModelChange"},standalone:!1,features:[$e([Vwe]),ke,ei]})}return n})(),Jwe=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({})}return n})();class L5 extends xw{constructor(e,t,r){super(NA(t),PA(r,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;at(e){return this.controls[this._adjustIndex(e)]}push(e,t={}){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}insert(e,t,r={}){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity({emitEvent:r.emitEvent})}removeAt(e,t={}){let r=this._adjustIndex(e);r<0&&(r=0),this.controls[r]&&this.controls[r]._registerOnCollectionChange(()=>{}),this.controls.splice(r,1),this.updateValueAndValidity({emitEvent:t.emitEvent})}setControl(e,t,r={}){let i=this._adjustIndex(e);i<0&&(i=0),this.controls[i]&&this.controls[i]._registerOnCollectionChange(()=>{}),this.controls.splice(i,1),t&&(this.controls.splice(i,0,t),this._registerControl(t)),this.updateValueAndValidity({emitEvent:r.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(e,t={}){u5(this,0,e),e.forEach((r,i)=>{c5(this,!1,i),this.at(i).setValue(r,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){null!=e&&(e.forEach((r,i)=>{this.at(i)&&this.at(i).patchValue(r,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e=[],t={}){this._forEachChild((r,i)=>{r.reset(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t,this),this._updateTouched(t,this),this.updateValueAndValidity(t)}getRawValue(){return this.controls.map(e=>e.getRawValue())}clear(e={}){this.controls.length<1||(this._forEachChild(t=>t._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:e.emitEvent}))}_adjustIndex(e){return e<0?e+this.length:e}_syncPendingControls(){let e=this.controls.reduce((t,r)=>!!r._syncPendingControls()||t,!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_forEachChild(e){this.controls.forEach((t,r)=>{e(t,r)})}_updateValue(){this.value=this.controls.filter(e=>e.enabled||this.disabled).map(e=>e.value)}_anyControls(e){return this.controls.some(t=>t.enabled&&e(t))}_setUpControls(){this._forEachChild(e=>this._registerControl(e))}_allControlsDisabled(){for(const e of this.controls)if(e.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)}_find(e){return this.at(e)??null}}function V5(n){return!!n&&(void 0!==n.asyncValidators||void 0!==n.validators||void 0!==n.updateOn)}let qA,Nw=(()=>{class n{useNonNullable=!1;get nonNullable(){const t=new n;return t.useNonNullable=!0,t}group(t,r=null){const i=this._reduceControls(t);let o={};return V5(r)?o=r:null!==r&&(o.validators=r.validator,o.asyncValidators=r.asyncValidator),new Bm(i,o)}record(t,r=null){const i=this._reduceControls(t);return new d5(i,r)}control(t,r,i){let o={};return this.useNonNullable?(V5(r)?o=r:(o.validators=r,o.asyncValidators=i),new Hm(t,{...o,nonNullable:!0})):new Hm(t,r,i)}array(t,r,i){const o=t.map(s=>this._createControl(s));return new L5(o,r,i)}_reduceControls(t){const r={};return Object.keys(t).forEach(i=>{r[i]=this._createControl(t[i])}),r}_createControl(t){return t instanceof Hm||t instanceof xw?t:Array.isArray(t)?this.control(t[0],t.length>1?t[1]:null,t.length>2?t[2]:null):this.control(t)}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Pw=(()=>{class n{static withConfig(t){return{ngModule:n,providers:[{provide:BA,useValue:t.warnOnNgModelWithFormControl??"always"},{provide:oh,useValue:t.callSetDisabledState??Sw}]}}static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[Jwe]})}return n})();try{qA=typeof Intl<"u"&&Intl.v8BreakIterator}catch{qA=!1}let sh,rr=(()=>{class n{_platformId=b(Ia);isBrowser=this._platformId?function Uge(n){return n===B3}(this._platformId):"object"==typeof document&&!!document;EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent);TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent);BLINK=this.isBrowser&&!(!window.chrome&&!qA)&&typeof CSS<"u"&&!this.EDGE&&!this.TRIDENT;WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT;IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window);FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent);ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT;SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT;constructor(){}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const B5=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function U5(){if(sh)return sh;if("object"!=typeof document||!document)return sh=new Set(B5),sh;let n=document.createElement("input");return sh=new Set(B5.filter(e=>(n.setAttribute("type",e),n.type===e))),sh}let qm,kc,WA;function ah(n){return function eEe(){if(null==qm&&typeof window<"u")try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>qm=!0}))}finally{qm=qm||!1}return qm}()?n:!!n.capture}function tEe(){if(null==kc){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return kc=!1,kc;if("scrollBehavior"in document.documentElement.style)kc=!0;else{const n=Element.prototype.scrollTo;kc=!!n&&!/\{\s*\[native code\]\s*\}/.test(n.toString())}}return kc}function ks(n){return n.composedPath?n.composedPath()[0]:n.target}function z5(){return typeof __karma__<"u"&&!!__karma__||typeof jasmine<"u"&&!!jasmine||typeof jest<"u"&&!!jest||typeof Mocha<"u"&&!!Mocha}const Fw=new WeakMap;let Ka=(()=>{class n{_appRef;_injector=b(ze);_environmentInjector=b(mr);load(t){const r=this._appRef=this._appRef||this._injector.get(tr);let i=Fw.get(r);i||(i={loaders:new Set,refs:[]},Fw.set(r,i),r.onDestroy(()=>{Fw.get(r)?.refs.forEach(o=>o.destroy()),Fw.delete(r)})),i.loaders.has(t)||(i.loaders.add(t),i.refs.push(vD(t,{environmentInjector:this._environmentInjector})))}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),j5=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["ng-component"]],exportAs:["cdkVisuallyHidden"],decls:0,vars:0,template:function(r,i){},styles:[".cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none;left:0}[dir=rtl] .cdk-visually-hidden{left:auto;right:0}"],encapsulation:2,changeDetection:0})}return n})();function Lw(n,...e){return e.length?e.some(t=>n[t]):n.altKey||n.shiftKey||n.ctrlKey||n.metaKey}class EEe extends Kt{constructor(e,t){super()}schedule(e,t=0){return this}}const Vw={setInterval(n,e,...t){const{delegate:r}=Vw;return r?.setInterval?r.setInterval(n,e,...t):setInterval(n,e,...t)},clearInterval(n){const{delegate:e}=Vw;return(e?.clearInterval||clearInterval)(n)},delegate:void 0};class Bw extends EEe{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){var r;if(this.closed)return this;this.state=e;const i=this.id,o=this.scheduler;return null!=i&&(this.id=this.recycleAsyncId(o,i,t)),this.pending=!0,this.delay=t,this.id=null!==(r=this.id)&&void 0!==r?r:this.requestAsyncId(o,this.id,t),this}requestAsyncId(e,t,r=0){return Vw.setInterval(e.flush.bind(e,this),r)}recycleAsyncId(e,t,r=0){if(null!=r&&this.delay===r&&!1===this.pending)return t;null!=t&&Vw.clearInterval(t)}execute(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let i,r=!1;try{this.work(e)}catch(o){r=!0,i=o||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),i}unsubscribe(){if(!this.closed){const{id:e,scheduler:t}=this,{actions:r}=t;this.work=this.state=this.scheduler=null,this.pending=!1,Ty(r,this),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null,super.unsubscribe()}}}const QA={now:()=>(QA.delegate||Date).now(),delegate:void 0};class Gm{constructor(e,t=Gm.now){this.schedulerActionCtor=e,this.now=t}schedule(e,t=0,r){return new this.schedulerActionCtor(this,e).schedule(r,t)}}Gm.now=QA.now;class Uw extends Gm{constructor(e,t=Gm.now){super(e,t),this.actions=[],this._active=!1}flush(e){const{actions:t}=this;if(this._active)return void t.push(e);let r;this._active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}}const zw=new Uw(Bw),IEe=zw;function W5(n,e=zw){return Jt((t,r)=>{let i=null,o=null,s=null;const a=()=>{if(i){i.unsubscribe(),i=null;const c=o;o=null,r.next(c)}};function l(){const c=s+n,u=e.now();if(u{o=c,s=e.now(),i||(i=e.schedule(l,n),r.add(i))},()=>{a(),r.complete()},void 0,()=>{o=i=null}))})}function G5(n){return si((e,t)=>n<=t)}function CEe(n,e){return n===e}let xEe=(()=>{class n{create(t){return typeof MutationObserver>"u"?null:new MutationObserver(t)}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Q5=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({providers:[xEe]})}return n})();function Qa(n){return null!=n&&"false"!=`${n}`}function Y5(n,e=0){return function SEe(n){return!isNaN(parseFloat(n))&&!isNaN(Number(n))}(n)?Number(n):2===arguments.length?e:0}function jw(n){return Array.isArray(n)?n:[n]}function xn(n){return null==n?"":"string"==typeof n?n:`${n}px`}function Ya(n){return n instanceof je?n.nativeElement:n}const X5=new Set;let Nc,DEe=(()=>{class n{_platform=b(rr);_nonce=b(z0,{optional:!0});_matchMedia;constructor(){this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):REe}matchMedia(t){return(this._platform.WEBKIT||this._platform.BLINK)&&function AEe(n,e){if(!X5.has(n))try{Nc||(Nc=document.createElement("style"),e&&Nc.setAttribute("nonce",e),Nc.setAttribute("type","text/css"),document.head.appendChild(Nc)),Nc.sheet&&(Nc.sheet.insertRule(`@media ${n} {body{ }}`,0),X5.add(n))}catch(t){console.error(t)}}(t,this._nonce),this._matchMedia(t)}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function REe(n){return{matches:"all"===n||""===n,media:n,addListener:()=>{},removeListener:()=>{}}}let Z5=(()=>{class n{_mediaMatcher=b(DEe);_zone=b(ue);_queries=new Map;_destroySubject=new fe;constructor(){}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(t){return J5(jw(t)).some(i=>this._registerQuery(i).mql.matches)}observe(t){let o=JD(J5(jw(t)).map(s=>this._registerQuery(s).observable));return o=Xb(o.pipe(zo(1)),o.pipe(G5(1),W5(0))),o.pipe(Te(s=>{const a={matches:!1,breakpoints:{}};return s.forEach(({matches:l,query:c})=>{a.matches=a.matches||l,a.breakpoints[c]=l}),a}))}_registerQuery(t){if(this._queries.has(t))return this._queries.get(t);const r=this._mediaMatcher.matchMedia(t),o={observable:new vt(s=>{const a=l=>this._zone.run(()=>s.next(l));return r.addListener(a),()=>{r.removeListener(a)}}).pipe(Ec(r),Te(({matches:s})=>({query:t,matches:s})),At(this._destroySubject)),mql:r};return this._queries.set(t,o),o}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function J5(n){return n.map(e=>e.split(",")).reduce((e,t)=>e.concat(t)).map(e=>e.trim())}function Hw(n,e){return n.getAttribute(e)?.match(/\S+/g)??[]}const tW="cdk-describedby-message",$w="cdk-describedby-host";let YA=0,PEe=(()=>{class n{_platform=b(rr);_document=b(Xe);_messageRegistry=new Map;_messagesContainer=null;_id=""+YA++;constructor(){b(Ka).load(j5),this._id=b(Is)+"-"+YA++}describe(t,r,i){if(!this._canBeDescribed(t,r))return;const o=XA(r,i);"string"!=typeof r?(nW(r,this._id),this._messageRegistry.set(o,{messageElement:r,referenceCount:0})):this._messageRegistry.has(o)||this._createMessageElement(r,i),this._isElementDescribedByMessage(t,o)||this._addMessageReference(t,o)}removeDescription(t,r,i){if(!r||!this._isElementNode(t))return;const o=XA(r,i);if(this._isElementDescribedByMessage(t,o)&&this._removeMessageReference(t,o),"string"==typeof r){const s=this._messageRegistry.get(o);s&&0===s.referenceCount&&this._deleteMessageElement(o)}0===this._messagesContainer?.childNodes.length&&(this._messagesContainer.remove(),this._messagesContainer=null)}ngOnDestroy(){const t=this._document.querySelectorAll(`[${$w}="${this._id}"]`);for(let r=0;r0!=i.indexOf(tW));t.setAttribute("aria-describedby",r.join(" "))}_addMessageReference(t,r){const i=this._messageRegistry.get(r);(function kEe(n,e,t){const r=Hw(n,e);t=t.trim(),!r.some(i=>i.trim()===t)&&(r.push(t),n.setAttribute(e,r.join(" ")))})(t,"aria-describedby",i.messageElement.id),t.setAttribute($w,this._id),i.referenceCount++}_removeMessageReference(t,r){const i=this._messageRegistry.get(r);i.referenceCount--,function NEe(n,e,t){const r=Hw(n,e);t=t.trim();const i=r.filter(o=>o!==t);i.length?n.setAttribute(e,i.join(" ")):n.removeAttribute(e)}(t,"aria-describedby",i.messageElement.id),t.removeAttribute($w)}_isElementDescribedByMessage(t,r){const i=Hw(t,"aria-describedby"),o=this._messageRegistry.get(r),s=o&&o.messageElement.id;return!!s&&-1!=i.indexOf(s)}_canBeDescribed(t,r){if(!this._isElementNode(t))return!1;if(r&&"object"==typeof r)return!0;const i=null==r?"":`${r}`.trim(),o=t.getAttribute("aria-label");return!(!i||o&&o.trim()===i)}_isElementNode(t){return t.nodeType===this._document.ELEMENT_NODE}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function XA(n,e){return"string"==typeof n?`${e||""}/${n}`:n}function nW(n,e){n.id||(n.id=`${tW}-${e}-${YA++}`)}class rW{_letterKeyStream=new fe;_items=[];_selectedItemIndex=-1;_pressedLetters=[];_skipPredicateFn;_selectedItem=new fe;selectedItem=this._selectedItem;constructor(e,t){const r="number"==typeof t?.debounceInterval?t.debounceInterval:200;t?.skipPredicate&&(this._skipPredicateFn=t.skipPredicate),this.setItems(e),this._setupKeyHandler(r)}destroy(){this._pressedLetters=[],this._letterKeyStream.complete(),this._selectedItem.complete()}setCurrentSelectedItemIndex(e){this._selectedItemIndex=e}setItems(e){this._items=e}handleKey(e){const t=e.keyCode;e.key&&1===e.key.length?this._letterKeyStream.next(e.key.toLocaleUpperCase()):(t>=65&&t<=90||t>=48&&t<=57)&&this._letterKeyStream.next(String.fromCharCode(t))}isTyping(){return this._pressedLetters.length>0}reset(){this._pressedLetters=[]}_setupKeyHandler(e){this._letterKeyStream.pipe(Bn(t=>this._pressedLetters.push(t)),W5(e),si(()=>this._pressedLetters.length>0),Te(()=>this._pressedLetters.join("").toLocaleUpperCase())).subscribe(t=>{for(let r=1;re.disabled;constructor(e,t){this._items=e,e instanceof dp?this._itemChangesSubscription=e.changes.subscribe(r=>this._itemsChanged(r.toArray())):up(e)&&(this._effectRef=pm(()=>this._itemsChanged(e()),{injector:t}))}tabOut=new fe;change=new fe;skipPredicate(e){return this._skipPredicateFn=e,this}withWrap(e=!0){return this._wrap=e,this}withVerticalOrientation(e=!0){return this._vertical=e,this}withHorizontalOrientation(e){return this._horizontal=e,this}withAllowedModifierKeys(e){return this._allowedModifierKeys=e,this}withTypeAhead(e=200){this._typeaheadSubscription.unsubscribe();const t=this._getItemsArray();return this._typeahead=new rW(t,{debounceInterval:"number"==typeof e?e:void 0,skipPredicate:r=>this._skipPredicateFn(r)}),this._typeaheadSubscription=this._typeahead.selectedItem.subscribe(r=>{this.setActiveItem(r)}),this}cancelTypeahead(){return this._typeahead?.reset(),this}withHomeAndEnd(e=!0){return this._homeAndEnd=e,this}withPageUpDown(e=!0,t=10){return this._pageUpAndDown={enabled:e,delta:t},this}setActiveItem(e){const t=this._activeItem();this.updateActiveItem(e),this._activeItem()!==t&&this.change.next(this._activeItemIndex)}onKeydown(e){const t=e.keyCode,i=["altKey","ctrlKey","metaKey","shiftKey"].every(o=>!e[o]||this._allowedModifierKeys.indexOf(o)>-1);switch(t){case 9:return void this.tabOut.next();case 40:if(this._vertical&&i){this.setNextItemActive();break}return;case 38:if(this._vertical&&i){this.setPreviousItemActive();break}return;case 39:if(this._horizontal&&i){"rtl"===this._horizontal?this.setPreviousItemActive():this.setNextItemActive();break}return;case 37:if(this._horizontal&&i){"rtl"===this._horizontal?this.setNextItemActive():this.setPreviousItemActive();break}return;case 36:if(this._homeAndEnd&&i){this.setFirstItemActive();break}return;case 35:if(this._homeAndEnd&&i){this.setLastItemActive();break}return;case 33:if(this._pageUpAndDown.enabled&&i){const o=this._activeItemIndex-this._pageUpAndDown.delta;this._setActiveItemByIndex(o>0?o:0,1);break}return;case 34:if(this._pageUpAndDown.enabled&&i){const o=this._activeItemIndex+this._pageUpAndDown.delta,s=this._getItemsArray().length;this._setActiveItemByIndex(o-1&&r!==this._activeItemIndex&&(this._activeItemIndex=r,this._typeahead?.setCurrentSelectedItemIndex(r))}}}class LEe extends FEe{_origin="program";setFocusOrigin(e){return this._origin=e,this}setActiveItem(e){super.setActiveItem(e),this.activeItem&&this.activeItem.focus(this._origin)}}function aW(n){return 0===n.buttons||0===n.detail}function lW(n){const e=n.touches&&n.touches[0]||n.changedTouches&&n.changedTouches[0];return!(!e||-1!==e.identifier||null!=e.radiusX&&1!==e.radiusX||null!=e.radiusY&&1!==e.radiusY)}const GEe=new B("cdk-input-modality-detector-options"),KEe={ignoreKeys:[18,17,224,91,16]},ch=ah({passive:!0,capture:!0});let QEe=(()=>{class n{_platform=b(rr);modalityDetected;modalityChanged;get mostRecentModality(){return this._modality.value}_mostRecentTarget=null;_modality=new mi(null);_options;_lastTouchMs=0;_onKeydown=t=>{this._options?.ignoreKeys?.some(r=>r===t.keyCode)||(this._modality.next("keyboard"),this._mostRecentTarget=ks(t))};_onMousedown=t=>{Date.now()-this._lastTouchMs<650||(this._modality.next(aW(t)?"keyboard":"mouse"),this._mostRecentTarget=ks(t))};_onTouchstart=t=>{lW(t)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=ks(t))};constructor(){const t=b(ue),r=b(Xe),i=b(GEe,{optional:!0});this._options={...KEe,...i},this.modalityDetected=this._modality.pipe(G5(1)),this.modalityChanged=this.modalityDetected.pipe(function TEe(n,e=ma){return n=n??CEe,Jt((t,r)=>{let i,o=!0;t.subscribe(zt(r,s=>{const a=e(s);(o||!n(i,a))&&(o=!1,i=a,r.next(s))}))})}()),this._platform.isBrowser&&t.runOutsideAngular(()=>{r.addEventListener("keydown",this._onKeydown,ch),r.addEventListener("mousedown",this._onMousedown,ch),r.addEventListener("touchstart",this._onTouchstart,ch)})}ngOnDestroy(){this._modality.complete(),this._platform.isBrowser&&(document.removeEventListener("keydown",this._onKeydown,ch),document.removeEventListener("mousedown",this._onMousedown,ch),document.removeEventListener("touchstart",this._onTouchstart,ch))}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const YEe=new B("liveAnnouncerElement",{providedIn:"root",factory:function XEe(){return null}}),ZEe=new B("LIVE_ANNOUNCER_DEFAULT_OPTIONS");let JEe=0,eIe=(()=>{class n{_ngZone=b(ue);_defaultOptions=b(ZEe,{optional:!0});_liveElement;_document=b(Xe);_previousTimeout;_currentPromise;_currentResolve;constructor(){const t=b(YEe,{optional:!0});this._liveElement=t||this._createLiveElement()}announce(t,...r){const i=this._defaultOptions;let o,s;return 1===r.length&&"number"==typeof r[0]?s=r[0]:[o,s]=r,this.clear(),clearTimeout(this._previousTimeout),o||(o=i&&i.politeness?i.politeness:"polite"),null==s&&i&&(s=i.duration),this._liveElement.setAttribute("aria-live",o),this._liveElement.id&&this._exposeAnnouncerToModals(this._liveElement.id),this._ngZone.runOutsideAngular(()=>(this._currentPromise||(this._currentPromise=new Promise(a=>this._currentResolve=a)),clearTimeout(this._previousTimeout),this._previousTimeout=setTimeout(()=>{this._liveElement.textContent=t,"number"==typeof s&&(this._previousTimeout=setTimeout(()=>this.clear(),s)),this._currentResolve?.(),this._currentPromise=this._currentResolve=void 0},100),this._currentPromise))}clear(){this._liveElement&&(this._liveElement.textContent="")}ngOnDestroy(){clearTimeout(this._previousTimeout),this._liveElement?.remove(),this._liveElement=null,this._currentResolve?.(),this._currentPromise=this._currentResolve=void 0}_createLiveElement(){const t="cdk-live-announcer-element",r=this._document.getElementsByClassName(t),i=this._document.createElement("div");for(let o=0;o .cdk-overlay-container [aria-modal="true"]');for(let i=0;i{class n{_ngZone=b(ue);_platform=b(rr);_inputModalityDetector=b(QEe);_origin=null;_lastFocusOrigin;_windowFocused=!1;_windowFocusTimeoutId;_originTimeoutId;_originFromTouchInteraction=!1;_elementInfo=new Map;_monitoredElementCount=0;_rootNodeFocusListenerCount=new Map;_detectionMode;_windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=setTimeout(()=>this._windowFocused=!1)};_document=b(Xe,{optional:!0});_stopInputModalityDetector=new fe;constructor(){const t=b(tIe,{optional:!0});this._detectionMode=t?.detectionMode||qw.IMMEDIATE}_rootNodeFocusAndBlurListener=t=>{for(let i=ks(t);i;i=i.parentElement)"focus"===t.type?this._onFocus(t,i):this._onBlur(t,i)};monitor(t,r=!1){const i=Ya(t);if(!this._platform.isBrowser||1!==i.nodeType)return de();const o=function rEe(n){if(function nEe(){if(null==WA){const n=typeof document<"u"?document.head:null;WA=!(!n||!n.createShadowRoot&&!n.attachShadow)}return WA}()){const e=n.getRootNode?n.getRootNode():null;if(typeof ShadowRoot<"u"&&ShadowRoot&&e instanceof ShadowRoot)return e}return null}(i)||this._getDocument(),s=this._elementInfo.get(i);if(s)return r&&(s.checkChildren=!0),s.subject;const a={checkChildren:r,subject:new fe,rootNode:o};return this._elementInfo.set(i,a),this._registerGlobalListeners(a),a.subject}stopMonitoring(t){const r=Ya(t),i=this._elementInfo.get(r);i&&(i.subject.complete(),this._setClasses(r),this._elementInfo.delete(r),this._removeGlobalListeners(i))}focusVia(t,r,i){const o=Ya(t);o===this._getDocument().activeElement?this._getClosestElementsInfo(o).forEach(([a,l])=>this._originChanged(a,r,l)):(this._setOrigin(r),"function"==typeof o.focus&&o.focus(i))}ngOnDestroy(){this._elementInfo.forEach((t,r)=>this.stopMonitoring(r))}_getDocument(){return this._document||document}_getWindow(){return this._getDocument().defaultView||window}_getFocusOrigin(t){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(t)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:t&&this._isLastInteractionFromInputLabel(t)?"mouse":"program"}_shouldBeAttributedToTouch(t){return this._detectionMode===qw.EVENTUAL||!!t?.contains(this._inputModalityDetector._mostRecentTarget)}_setClasses(t,r){t.classList.toggle("cdk-focused",!!r),t.classList.toggle("cdk-touch-focused","touch"===r),t.classList.toggle("cdk-keyboard-focused","keyboard"===r),t.classList.toggle("cdk-mouse-focused","mouse"===r),t.classList.toggle("cdk-program-focused","program"===r)}_setOrigin(t,r=!1){this._ngZone.runOutsideAngular(()=>{this._origin=t,this._originFromTouchInteraction="touch"===t&&r,this._detectionMode===qw.IMMEDIATE&&(clearTimeout(this._originTimeoutId),this._originTimeoutId=setTimeout(()=>this._origin=null,this._originFromTouchInteraction?650:1))})}_onFocus(t,r){const i=this._elementInfo.get(r),o=ks(t);!i||!i.checkChildren&&r!==o||this._originChanged(r,this._getFocusOrigin(o),i)}_onBlur(t,r){const i=this._elementInfo.get(r);!i||i.checkChildren&&t.relatedTarget instanceof Node&&r.contains(t.relatedTarget)||(this._setClasses(r),this._emitOrigin(i,null))}_emitOrigin(t,r){t.subject.observers.length&&this._ngZone.run(()=>t.subject.next(r))}_registerGlobalListeners(t){if(!this._platform.isBrowser)return;const r=t.rootNode,i=this._rootNodeFocusListenerCount.get(r)||0;i||this._ngZone.runOutsideAngular(()=>{r.addEventListener("focus",this._rootNodeFocusAndBlurListener,Ww),r.addEventListener("blur",this._rootNodeFocusAndBlurListener,Ww)}),this._rootNodeFocusListenerCount.set(r,i+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(At(this._stopInputModalityDetector)).subscribe(o=>{this._setOrigin(o,!0)}))}_removeGlobalListeners(t){const r=t.rootNode;if(this._rootNodeFocusListenerCount.has(r)){const i=this._rootNodeFocusListenerCount.get(r);i>1?this._rootNodeFocusListenerCount.set(r,i-1):(r.removeEventListener("focus",this._rootNodeFocusAndBlurListener,Ww),r.removeEventListener("blur",this._rootNodeFocusAndBlurListener,Ww),this._rootNodeFocusListenerCount.delete(r))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(t,r,i){this._setClasses(t,r),this._emitOrigin(i,r),this._lastFocusOrigin=r}_getClosestElementsInfo(t){const r=[];return this._elementInfo.forEach((i,o)=>{(o===t||i.checkChildren&&o.contains(t))&&r.push([o,i])}),r}_isLastInteractionFromInputLabel(t){const{_mostRecentTarget:r,mostRecentModality:i}=this._inputModalityDetector;if("mouse"!==i||!r||r===t||"INPUT"!==t.nodeName&&"TEXTAREA"!==t.nodeName||t.disabled)return!1;const o=t.labels;if(o)for(let s=0;s{class n{_platform=b(rr);_hasCheckedHighContrastMode;_document=b(Xe);_breakpointSubscription;constructor(){this._breakpointSubscription=b(Z5).observe("(forced-colors: active)").subscribe(()=>{this._hasCheckedHighContrastMode&&(this._hasCheckedHighContrastMode=!1,this._applyBodyHighContrastModeCssClasses())})}getHighContrastMode(){if(!this._platform.isBrowser)return Pc.NONE;const t=this._document.createElement("div");t.style.backgroundColor="rgb(1,2,3)",t.style.position="absolute",this._document.body.appendChild(t);const r=this._document.defaultView||window,i=r&&r.getComputedStyle?r.getComputedStyle(t):null,o=(i&&i.backgroundColor||"").replace(/ /g,"");switch(t.remove(),o){case"rgb(0,0,0)":case"rgb(45,50,54)":case"rgb(32,32,32)":return Pc.WHITE_ON_BLACK;case"rgb(255,255,255)":case"rgb(255,250,239)":return Pc.BLACK_ON_WHITE}return Pc.NONE}ngOnDestroy(){this._breakpointSubscription.unsubscribe()}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){const t=this._document.body.classList;t.remove(JA,uW,dW),this._hasCheckedHighContrastMode=!0;const r=this.getHighContrastMode();r===Pc.BLACK_ON_WHITE?t.add(JA,uW):r===Pc.WHITE_ON_BLACK&&t.add(JA,dW)}}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),nIe=(()=>{class n{constructor(){b(hW)._applyBodyHighContrastModeCssClasses()}static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[Q5]})}return n})();const eR={};let Xa=(()=>{class n{_appId=b(Is);getId(t){return"ng"!==this._appId&&(t+=this._appId),eR.hasOwnProperty(t)||(eR[t]=0),`${t}${eR[t]++}`}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const rIe=new B("cdk-dir-doc",{providedIn:"root",factory:function iIe(){return b(Xe)}}),oIe=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;let Gw=(()=>{class n{value="ltr";change=new nt;constructor(){const t=b(rIe,{optional:!0});t&&(this.value=function sIe(n){const e=n?.toLowerCase()||"";return"auto"===e&&typeof navigator<"u"&&navigator?.language?oIe.test(navigator.language)?"rtl":"ltr":"rtl"===e?"rtl":"ltr"}((t.body?t.body.dir:null)||(t.documentElement?t.documentElement.dir:null)||"ltr"))}ngOnDestroy(){this.change.complete()}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Km=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({})}return n})(),gn=(()=>{class n{constructor(){b(hW)._applyBodyHighContrastModeCssClasses()}static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[Km,Km]})}return n})();class fW{_defaultMatcher;ngControl;_parentFormGroup;_parentForm;_stateChanges;errorState=!1;matcher;constructor(e,t,r,i,o){this._defaultMatcher=e,this.ngControl=t,this._parentFormGroup=r,this._parentForm=i,this._stateChanges=o}updateErrorState(){const e=this.errorState,t=this._parentFormGroup||this._parentForm,r=this.matcher||this._defaultMatcher,i=this.ngControl?this.ngControl.control:null,o=r?.isErrorState(i,t)??!1;o!==e&&(this.errorState=o,this._stateChanges.next())}}let tR=(()=>{class n{isErrorState(t,r){return!!(t&&t.invalid&&(t.touched||r&&r.submitted))}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),nR=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["structural-styles"]],decls:0,vars:0,template:function(r,i){},styles:['.mat-focus-indicator{position:relative}.mat-focus-indicator::before{top:0;left:0;right:0;bottom:0;position:absolute;box-sizing:border-box;pointer-events:none;display:var(--mat-focus-indicator-display, none);border-width:var(--mat-focus-indicator-border-width, 3px);border-style:var(--mat-focus-indicator-border-style, solid);border-color:var(--mat-focus-indicator-border-color, transparent);border-radius:var(--mat-focus-indicator-border-radius, 4px)}.mat-focus-indicator:focus::before{content:""}@media(forced-colors: active){html{--mat-focus-indicator-display: block}}'],encapsulation:2,changeDetection:0})}return n})();var Xi=function(n){return n[n.FADING_IN=0]="FADING_IN",n[n.VISIBLE=1]="VISIBLE",n[n.FADING_OUT=2]="FADING_OUT",n[n.HIDDEN=3]="HIDDEN",n}(Xi||{});class hIe{_renderer;element;config;_animationForciblyDisabledThroughCss;state=Xi.HIDDEN;constructor(e,t,r,i=!1){this._renderer=e,this.element=t,this.config=r,this._animationForciblyDisabledThroughCss=i}fadeOut(){this._renderer.fadeOutRipple(this)}}const pW=ah({passive:!0,capture:!0});class fIe{_events=new Map;addHandler(e,t,r,i){const o=this._events.get(t);if(o){const s=o.get(r);s?s.add(i):o.set(r,new Set([i]))}else this._events.set(t,new Map([[r,new Set([i])]])),e.runOutsideAngular(()=>{document.addEventListener(t,this._delegateEventHandler,pW)})}removeHandler(e,t,r){const i=this._events.get(e);if(!i)return;const o=i.get(t);o&&(o.delete(r),0===o.size&&i.delete(t),0===i.size&&(this._events.delete(e),document.removeEventListener(e,this._delegateEventHandler,pW)))}_delegateEventHandler=e=>{const t=ks(e);t&&this._events.get(e.type)?.forEach((r,i)=>{(i===t||i.contains(t))&&r.forEach(o=>o.handleEvent(e))})}}const Kw={enterDuration:225,exitDuration:150},mW=ah({passive:!0,capture:!0}),gW=["mousedown","touchstart"],_W=["mouseup","mouseleave","touchend","touchcancel"];let mIe=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["ng-component"]],hostAttrs:["mat-ripple-style-loader",""],decls:0,vars:0,template:function(r,i){},styles:[".mat-ripple{overflow:hidden;position:relative}.mat-ripple:not(:empty){transform:translateZ(0)}.mat-ripple.mat-ripple-unbounded{overflow:visible}.mat-ripple-element{position:absolute;border-radius:50%;pointer-events:none;transition:opacity,transform 0ms cubic-bezier(0, 0, 0.2, 1);transform:scale3d(0, 0, 0);background-color:var(--mat-ripple-color, color-mix(in srgb, var(--mat-sys-on-surface) 10%, transparent))}@media(forced-colors: active){.mat-ripple-element{display:none}}.cdk-drag-preview .mat-ripple-element,.cdk-drag-placeholder .mat-ripple-element{display:none}"],encapsulation:2,changeDetection:0})}return n})();class Qw{_target;_ngZone;_platform;_containerElement;_triggerElement;_isPointerDown=!1;_activeRipples=new Map;_mostRecentTransientRipple;_lastTouchStartEvent;_pointerUpEventsRegistered=!1;_containerRect;static _eventManager=new fIe;constructor(e,t,r,i,o){this._target=e,this._ngZone=t,this._platform=i,i.isBrowser&&(this._containerElement=Ya(r)),o&&o.get(Ka).load(mIe)}fadeInRipple(e,t,r={}){const i=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),o={...Kw,...r.animation};r.centered&&(e=i.left+i.width/2,t=i.top+i.height/2);const s=r.radius||function gIe(n,e,t){const r=Math.max(Math.abs(n-t.left),Math.abs(n-t.right)),i=Math.max(Math.abs(e-t.top),Math.abs(e-t.bottom));return Math.sqrt(r*r+i*i)}(e,t,i),a=e-i.left,l=t-i.top,c=o.enterDuration,u=document.createElement("div");u.classList.add("mat-ripple-element"),u.style.left=a-s+"px",u.style.top=l-s+"px",u.style.height=2*s+"px",u.style.width=2*s+"px",null!=r.color&&(u.style.backgroundColor=r.color),u.style.transitionDuration=`${c}ms`,this._containerElement.appendChild(u);const d=window.getComputedStyle(u),p=d.transitionDuration,m="none"===d.transitionProperty||"0s"===p||"0s, 0s"===p||0===i.width&&0===i.height,_=new hIe(this,u,r,m);u.style.transform="scale3d(1, 1, 1)",_.state=Xi.FADING_IN,r.persistent||(this._mostRecentTransientRipple=_);let v=null;return!m&&(c||o.exitDuration)&&this._ngZone.runOutsideAngular(()=>{const E=()=>{v&&(v.fallbackTimer=null),clearTimeout(R),this._finishRippleTransition(_)},C=()=>this._destroyRipple(_),R=setTimeout(C,c+100);u.addEventListener("transitionend",E),u.addEventListener("transitioncancel",C),v={onTransitionEnd:E,onTransitionCancel:C,fallbackTimer:R}}),this._activeRipples.set(_,v),(m||!c)&&this._finishRippleTransition(_),_}fadeOutRipple(e){if(e.state===Xi.FADING_OUT||e.state===Xi.HIDDEN)return;const t=e.element,r={...Kw,...e.config.animation};t.style.transitionDuration=`${r.exitDuration}ms`,t.style.opacity="0",e.state=Xi.FADING_OUT,(e._animationForciblyDisabledThroughCss||!r.exitDuration)&&this._finishRippleTransition(e)}fadeOutAll(){this._getActiveRipples().forEach(e=>e.fadeOut())}fadeOutAllNonPersistent(){this._getActiveRipples().forEach(e=>{e.config.persistent||e.fadeOut()})}setupTriggerEvents(e){const t=Ya(e);!this._platform.isBrowser||!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,gW.forEach(r=>{Qw._eventManager.addHandler(this._ngZone,r,t,this)}))}handleEvent(e){"mousedown"===e.type?this._onMousedown(e):"touchstart"===e.type?this._onTouchStart(e):this._onPointerUp(),this._pointerUpEventsRegistered||(this._ngZone.runOutsideAngular(()=>{_W.forEach(t=>{this._triggerElement.addEventListener(t,this,mW)})}),this._pointerUpEventsRegistered=!0)}_finishRippleTransition(e){e.state===Xi.FADING_IN?this._startFadeOutTransition(e):e.state===Xi.FADING_OUT&&this._destroyRipple(e)}_startFadeOutTransition(e){const t=e===this._mostRecentTransientRipple,{persistent:r}=e.config;e.state=Xi.VISIBLE,!r&&(!t||!this._isPointerDown)&&e.fadeOut()}_destroyRipple(e){const t=this._activeRipples.get(e)??null;this._activeRipples.delete(e),this._activeRipples.size||(this._containerRect=null),e===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),e.state=Xi.HIDDEN,null!==t&&(e.element.removeEventListener("transitionend",t.onTransitionEnd),e.element.removeEventListener("transitioncancel",t.onTransitionCancel),null!==t.fallbackTimer&&clearTimeout(t.fallbackTimer)),e.element.remove()}_onMousedown(e){const t=aW(e),r=this._lastTouchStartEvent&&Date.now(){!e.config.persistent&&(e.state===Xi.VISIBLE||e.config.terminateOnPointerUp&&e.state===Xi.FADING_IN)&&e.fadeOut()}))}_getActiveRipples(){return Array.from(this._activeRipples.keys())}_removeTriggerEvents(){const e=this._triggerElement;e&&(gW.forEach(t=>Qw._eventManager.removeHandler(t,e,this)),this._pointerUpEventsRegistered&&(_W.forEach(t=>e.removeEventListener(t,this,mW)),this._pointerUpEventsRegistered=!1))}}const yW=new B("mat-ripple-global-options");let vW=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[gn,gn]})}return n})();const bW={capture:!0},wW=["focus","mousedown","mouseenter","touchstart"],rR="mat-ripple-loader-uninitialized",iR="mat-ripple-loader-class-name",EW="mat-ripple-loader-centered",Yw="mat-ripple-loader-disabled";let IW=(()=>{class n{_document=b(Xe,{optional:!0});_animationMode=b(Ts,{optional:!0});_globalRippleOptions=b(yW,{optional:!0});_platform=b(rr);_ngZone=b(ue);_injector=b(ze);_hosts=new Map;constructor(){this._ngZone.runOutsideAngular(()=>{for(const t of wW)this._document?.addEventListener(t,this._onInteraction,bW)})}ngOnDestroy(){const t=this._hosts.keys();for(const r of t)this.destroyRipple(r);for(const r of wW)this._document?.removeEventListener(r,this._onInteraction,bW)}configureRipple(t,r){t.setAttribute(rR,this._globalRippleOptions?.namespace??""),(r.className||!t.hasAttribute(iR))&&t.setAttribute(iR,r.className||""),r.centered&&t.setAttribute(EW,""),r.disabled&&t.setAttribute(Yw,"")}setDisabled(t,r){const i=this._hosts.get(t);i?(i.target.rippleDisabled=r,!r&&!i.hasSetUpEvents&&(i.hasSetUpEvents=!0,i.renderer.setupTriggerEvents(t))):r?t.setAttribute(Yw,""):t.removeAttribute(Yw)}_onInteraction=t=>{const r=ks(t);if(r instanceof HTMLElement){const i=r.closest(`[${rR}="${this._globalRippleOptions?.namespace??""}"]`);i&&this._createRipple(i)}};_createRipple(t){if(!this._document||this._hosts.has(t))return;t.querySelector(".mat-ripple")?.remove();const r=this._document.createElement("span");r.classList.add("mat-ripple",t.getAttribute(iR)),t.append(r);const i="NoopAnimations"===this._animationMode,o=this._globalRippleOptions,s=i?0:o?.animation?.enterDuration??Kw.enterDuration,a=i?0:o?.animation?.exitDuration??Kw.exitDuration,l={rippleDisabled:i||o?.disabled||t.hasAttribute(Yw),rippleConfig:{centered:t.hasAttribute(EW),terminateOnPointerUp:o?.terminateOnPointerUp,animation:{enterDuration:s,exitDuration:a}}},c=new Qw(l,this._ngZone,r,this._platform,this._injector),u=!l.rippleDisabled;u&&c.setupTriggerEvents(t),this._hosts.set(t,{target:l,renderer:c,hasSetUpEvents:u}),t.removeAttribute(rR)}destroyRipple(t){const r=this._hosts.get(t);r&&(r.renderer._removeTriggerEvents(),this._hosts.delete(t))}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const _Ie=["*"],bIe=[[["","mat-card-avatar",""],["","matCardAvatar",""]],[["mat-card-title"],["mat-card-subtitle"],["","mat-card-title",""],["","mat-card-subtitle",""],["","matCardTitle",""],["","matCardSubtitle",""]],"*"],wIe=["[mat-card-avatar], [matCardAvatar]","mat-card-title, mat-card-subtitle,\n [mat-card-title], [mat-card-subtitle],\n [matCardTitle], [matCardSubtitle]","*"],EIe=new B("MAT_CARD_CONFIG");let Xw=(()=>{class n{appearance;constructor(){const t=b(EIe,{optional:!0});this.appearance=t?.appearance||"raised"}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-card"]],hostAttrs:[1,"mat-mdc-card","mdc-card"],hostVars:4,hostBindings:function(r,i){2&r&&at("mat-mdc-card-outlined","outlined"===i.appearance)("mdc-card--outlined","outlined"===i.appearance)},inputs:{appearance:"appearance"},exportAs:["matCard"],ngContentSelectors:_Ie,decls:1,vars:0,template:function(r,i){1&r&&(Hn(),Ae(0))},styles:['.mat-mdc-card{display:flex;flex-direction:column;box-sizing:border-box;position:relative;border-style:solid;border-width:0;background-color:var(--mdc-elevated-card-container-color, var(--mat-sys-surface-container-low));border-color:var(--mdc-elevated-card-container-color, var(--mat-sys-surface-container-low));border-radius:var(--mdc-elevated-card-container-shape, var(--mat-sys-corner-medium));box-shadow:var(--mdc-elevated-card-container-elevation, var(--mat-sys-level1))}.mat-mdc-card::after{position:absolute;top:0;left:0;width:100%;height:100%;border:solid 1px rgba(0,0,0,0);content:"";display:block;pointer-events:none;box-sizing:border-box;border-radius:var(--mdc-elevated-card-container-shape, var(--mat-sys-corner-medium))}.mat-mdc-card-outlined{background-color:var(--mdc-outlined-card-container-color, var(--mat-sys-surface));border-radius:var(--mdc-outlined-card-container-shape, var(--mat-sys-corner-medium));border-width:var(--mdc-outlined-card-outline-width, 1px);border-color:var(--mdc-outlined-card-outline-color, var(--mat-sys-outline-variant));box-shadow:var(--mdc-outlined-card-container-elevation, var(--mat-sys-level0))}.mat-mdc-card-outlined::after{border:none}.mdc-card__media{position:relative;box-sizing:border-box;background-repeat:no-repeat;background-position:center;background-size:cover}.mdc-card__media::before{display:block;content:""}.mdc-card__media:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.mdc-card__media:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.mat-mdc-card-actions{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;min-height:52px;padding:8px}.mat-mdc-card-title{font-family:var(--mat-card-title-text-font, var(--mat-sys-title-large-font));line-height:var(--mat-card-title-text-line-height, var(--mat-sys-title-large-line-height));font-size:var(--mat-card-title-text-size, var(--mat-sys-title-large-size));letter-spacing:var(--mat-card-title-text-tracking, var(--mat-sys-title-large-tracking));font-weight:var(--mat-card-title-text-weight, var(--mat-sys-title-large-weight))}.mat-mdc-card-subtitle{color:var(--mat-card-subtitle-text-color, var(--mat-sys-on-surface));font-family:var(--mat-card-subtitle-text-font, var(--mat-sys-title-medium-font));line-height:var(--mat-card-subtitle-text-line-height, var(--mat-sys-title-medium-line-height));font-size:var(--mat-card-subtitle-text-size, var(--mat-sys-title-medium-size));letter-spacing:var(--mat-card-subtitle-text-tracking, var(--mat-sys-title-medium-tracking));font-weight:var(--mat-card-subtitle-text-weight, var(--mat-sys-title-medium-weight))}.mat-mdc-card-title,.mat-mdc-card-subtitle{display:block;margin:0}.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-title,.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-subtitle{padding:16px 16px 0}.mat-mdc-card-header{display:flex;padding:16px 16px 0}.mat-mdc-card-content{display:block;padding:0 16px}.mat-mdc-card-content:first-child{padding-top:16px}.mat-mdc-card-content:last-child{padding-bottom:16px}.mat-mdc-card-title-group{display:flex;justify-content:space-between;width:100%}.mat-mdc-card-avatar{height:40px;width:40px;border-radius:50%;flex-shrink:0;margin-bottom:16px;object-fit:cover}.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-subtitle,.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-title{line-height:normal}.mat-mdc-card-sm-image{width:80px;height:80px}.mat-mdc-card-md-image{width:112px;height:112px}.mat-mdc-card-lg-image{width:152px;height:152px}.mat-mdc-card-xl-image{width:240px;height:240px}.mat-mdc-card-subtitle~.mat-mdc-card-title,.mat-mdc-card-title~.mat-mdc-card-subtitle,.mat-mdc-card-header .mat-mdc-card-header-text .mat-mdc-card-title,.mat-mdc-card-header .mat-mdc-card-header-text .mat-mdc-card-subtitle,.mat-mdc-card-title-group .mat-mdc-card-title,.mat-mdc-card-title-group .mat-mdc-card-subtitle{padding-top:0}.mat-mdc-card-content>:last-child:not(.mat-mdc-card-footer){margin-bottom:0}.mat-mdc-card-actions-align-end{justify-content:flex-end}'],encapsulation:2,changeDetection:0})}return n})(),Zw=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["mat-card-title"],["","mat-card-title",""],["","matCardTitle",""]],hostAttrs:[1,"mat-mdc-card-title"]})}return n})(),Jw=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["mat-card-content"]],hostAttrs:[1,"mat-mdc-card-content"]})}return n})(),eE=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-card-header"]],hostAttrs:[1,"mat-mdc-card-header"],ngContentSelectors:wIe,decls:4,vars:0,consts:[[1,"mat-mdc-card-header-text"]],template:function(r,i){1&r&&(Hn(bIe),Ae(0),W(1,"div",0),Ae(2,1),K(),Ae(3,2))},encapsulation:2,changeDetection:0})}return n})(),oR=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[gn,gn]})}return n})();function Ym(...n){const e=bm(n),t=function kye(n,e){return"number"==typeof ZD(n)?n.pop():e}(n,1/0),r=n;return r.length?1===r.length?oi(r[0]):Yb(t)(nr(r,e)):Di}class SIe extends fe{constructor(e=1/0,t=1/0,r=QA){super(),this._bufferSize=e,this._windowTime=t,this._timestampProvider=r,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=t===1/0,this._bufferSize=Math.max(1,e),this._windowTime=Math.max(1,t)}next(e){const{isStopped:t,_buffer:r,_infiniteTimeWindow:i,_timestampProvider:o,_windowTime:s}=this;t||(r.push(e),!i&&r.push(o.now()+s)),this._trimBuffer(),super.next(e)}_subscribe(e){this._throwIfClosed(),this._trimBuffer();const t=this._innerSubscribe(e),{_infiniteTimeWindow:r,_buffer:i}=this,o=i.slice();for(let s=0;snew fe,resetOnError:t=!0,resetOnComplete:r=!0,resetOnRefCountZero:i=!0}=n;return o=>{let s,a,l,c=0,u=!1,d=!1;const f=()=>{a?.unsubscribe(),a=void 0},p=()=>{f(),s=l=void 0,u=d=!1},m=()=>{const _=s;p(),_?.unsubscribe()};return Jt((_,v)=>{c++,!d&&!u&&f();const E=l=l??e();v.add(()=>{c--,0===c&&!d&&!u&&(a=sR(m,i))}),E.subscribe(v),!s&&c>0&&(s=new Gf({next:C=>E.next(C),error:C=>{d=!0,f(),a=sR(p,t,C),E.error(C)},complete:()=>{u=!0,f(),a=sR(p,r),E.complete()}}),oi(_).subscribe(s))})(o)}}function sR(n,e,...t){if(!0===e)return void n();if(!1===e)return;const r=new Gf({next:()=>{r.unsubscribe(),n()}});return oi(e(...t)).subscribe(r)}class AIe{_box;_destroyed=new fe;_resizeSubject=new fe;_resizeObserver;_elementObservables=new Map;constructor(e){this._box=e,typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(t=>this._resizeSubject.next(t)))}observe(e){return this._elementObservables.has(e)||this._elementObservables.set(e,new vt(t=>{const r=this._resizeSubject.subscribe(t);return this._resizeObserver?.observe(e,{box:this._box}),()=>{this._resizeObserver?.unobserve(e),r.unsubscribe(),this._elementObservables.delete(e)}}).pipe(si(t=>t.some(r=>r.target===e)),function DIe(n,e,t){let r,i=!1;return n&&"object"==typeof n?({bufferSize:r=1/0,windowTime:e=1/0,refCount:i=!1,scheduler:t}=n):r=n??1/0,TW({connector:()=>new SIe(r,e,t),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}({bufferSize:1,refCount:!0}),At(this._destroyed))),this._elementObservables.get(e)}destroy(){this._destroyed.next(),this._destroyed.complete(),this._resizeSubject.complete(),this._elementObservables.clear()}}let RIe=(()=>{class n{_cleanupErrorListener;_observers=new Map;_ngZone=b(ue);constructor(){}ngOnDestroy(){for(const[,t]of this._observers)t.destroy();this._observers.clear(),this._cleanupErrorListener?.()}observe(t,r){const i=r?.box||"content-box";return this._observers.has(i)||this._observers.set(i,new AIe(i)),this._observers.get(i).observe(t)}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var we=function(n){return n[n.State=0]="State",n[n.Transition=1]="Transition",n[n.Sequence=2]="Sequence",n[n.Group=3]="Group",n[n.Animate=4]="Animate",n[n.Keyframes=5]="Keyframes",n[n.Style=6]="Style",n[n.Trigger=7]="Trigger",n[n.Reference=8]="Reference",n[n.AnimateChild=9]="AnimateChild",n[n.AnimateRef=10]="AnimateRef",n[n.Query=11]="Query",n[n.Stagger=12]="Stagger",n}(we||{});const Ns="*";function aR(n,e){return{type:we.Trigger,name:n,definitions:e,options:{}}}function Xm(n,e=null){return{type:we.Animate,styles:e,timings:n}}function Ps(n){return{type:we.Style,styles:n,offset:null}}function Zm(n,e,t){return{type:we.State,name:n,styles:e,options:t}}function Jm(n,e,t=null){return{type:we.Transition,expr:n,animation:e,options:t}}class eg{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(e=0,t=0){this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(r=>r()),t.length=0}}class CW{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(e){this.players=e;let t=0,r=0,i=0;const o=this.players.length;0==o?queueMicrotask(()=>this._onFinish()):this.players.forEach(s=>{s.onDone(()=>{++t==o&&this._onFinish()}),s.onDestroy(()=>{++r==o&&this._onDestroy()}),s.onStart(()=>{++i==o&&this._onStart()})}),this.totalTime=this.players.reduce((s,a)=>Math.max(s,a.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this.players.forEach(e=>e.init())}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(e=>e()),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(e=>e.play())}pause(){this.players.forEach(e=>e.pause())}restart(){this.players.forEach(e=>e.restart())}finish(){this._onFinish(),this.players.forEach(e=>e.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(e=>e.destroy()),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this.players.forEach(e=>e.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){const t=e*this.totalTime;this.players.forEach(r=>{const i=r.totalTime?Math.min(1,t/r.totalTime):1;r.setPosition(i)})}getPosition(){const e=this.players.reduce((t,r)=>null===t||r.totalTime>t.totalTime?r:t,null);return null!=e?e.getPosition():0}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){const t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(r=>r()),t.length=0}}const FIe=["notch"],LIe=["matFormFieldNotchedOutline",""],VIe=["*"],BIe=["textField"],UIe=["iconPrefixContainer"],zIe=["textPrefixContainer"],jIe=["iconSuffixContainer"],HIe=["textSuffixContainer"],$Ie=["*",[["mat-label"]],[["","matPrefix",""],["","matIconPrefix",""]],[["","matTextPrefix",""]],[["","matTextSuffix",""]],[["","matSuffix",""],["","matIconSuffix",""]],[["mat-error"],["","matError",""]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],qIe=["*","mat-label","[matPrefix], [matIconPrefix]","[matTextPrefix]","[matTextSuffix]","[matSuffix], [matIconSuffix]","mat-error, [matError]","mat-hint:not([align='end'])","mat-hint[align='end']"];function WIe(n,e){1&n&&Pe(0,"span",21)}function GIe(n,e){if(1&n&&(W(0,"label",20),Ae(1,1),et(2,WIe,1,0,"span",21),K()),2&n){const t=Ln(2);De("floating",t._shouldLabelFloat())("monitorResize",t._hasOutline())("id",t._labelId),Ke("for",t._control.disableAutomaticLabeling?null:t._control.id),re(2),Pt(!t.hideRequiredMarker&&t._control.required?2:-1)}}function KIe(n,e){1&n&&et(0,GIe,3,5,"label",20),2&n&&Pt(Ln()._hasFloatingLabel()?0:-1)}function QIe(n,e){1&n&&Pe(0,"div",7)}function YIe(n,e){}function XIe(n,e){1&n&&et(0,YIe,0,0,"ng-template",13),2&n&&(Ln(2),De("ngTemplateOutlet",rm(1)))}function ZIe(n,e){if(1&n&&(W(0,"div",9),et(1,XIe,1,1,null,13),K()),2&n){const t=Ln();De("matFormFieldNotchedOutlineOpen",t._shouldLabelFloat()),re(),Pt(t._forceDisplayInfixLabel()?-1:1)}}function JIe(n,e){1&n&&(W(0,"div",10,2),Ae(2,2),K())}function eTe(n,e){1&n&&(W(0,"div",11,3),Ae(2,3),K())}function tTe(n,e){}function nTe(n,e){1&n&&et(0,tTe,0,0,"ng-template",13),2&n&&(Ln(),De("ngTemplateOutlet",rm(1)))}function rTe(n,e){1&n&&(W(0,"div",14,4),Ae(2,4),K())}function iTe(n,e){1&n&&(W(0,"div",15,5),Ae(2,5),K())}function oTe(n,e){1&n&&Pe(0,"div",16)}function sTe(n,e){1&n&&(W(0,"div",18),Ae(1,6),K()),2&n&&De("@transitionMessages",Ln()._subscriptAnimationState)}function aTe(n,e){if(1&n&&(W(0,"mat-hint",22),Oe(1),K()),2&n){const t=Ln(2);De("id",t._hintLabelId),re(),zd(t.hintLabel)}}function lTe(n,e){if(1&n&&(W(0,"div",19),et(1,aTe,2,2,"mat-hint",22),Ae(2,7),Pe(3,"div",23),Ae(4,8),K()),2&n){const t=Ln();De("@transitionMessages",t._subscriptAnimationState),re(),Pt(t.hintLabel?1:-1)}}let tg=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["mat-label"]]})}return n})();const xW=new B("MatError");let SW=(()=>{class n{id=b(Xa).getId("mat-mdc-error-");constructor(){b(new T2("aria-live"),{optional:!0})||b(je).nativeElement.setAttribute("aria-live","polite")}static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["mat-error"],["","matError",""]],hostAttrs:["aria-atomic","true",1,"mat-mdc-form-field-error","mat-mdc-form-field-bottom-align"],hostVars:1,hostBindings:function(r,i){2&r&&Bo("id",i.id)},inputs:{id:"id"},features:[$e([{provide:xW,useExisting:n}])]})}return n})(),DW=(()=>{class n{align="start";id=b(Xa).getId("mat-mdc-hint-");static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["mat-hint"]],hostAttrs:[1,"mat-mdc-form-field-hint","mat-mdc-form-field-bottom-align"],hostVars:4,hostBindings:function(r,i){2&r&&(Bo("id",i.id),Ke("align",null),at("mat-mdc-form-field-hint-end","end"===i.align))},inputs:{align:"align",id:"id"}})}return n})();const cTe=new B("MatPrefix"),uTe=new B("MatSuffix"),AW=new B("FloatingLabelParent");let RW=(()=>{class n{_elementRef=b(je);get floating(){return this._floating}set floating(t){this._floating=t,this.monitorResize&&this._handleResize()}_floating=!1;get monitorResize(){return this._monitorResize}set monitorResize(t){this._monitorResize=t,this._monitorResize?this._subscribeToResize():this._resizeSubscription.unsubscribe()}_monitorResize=!1;_resizeObserver=b(RIe);_ngZone=b(ue);_parent=b(AW);_resizeSubscription=new Kt;constructor(){}ngOnDestroy(){this._resizeSubscription.unsubscribe()}getWidth(){return function dTe(n){if(null!==n.offsetParent)return n.scrollWidth;const t=n.cloneNode(!0);t.style.setProperty("position","absolute"),t.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(t);const r=t.scrollWidth;return t.remove(),r}(this._elementRef.nativeElement)}get element(){return this._elementRef.nativeElement}_handleResize(){setTimeout(()=>this._parent._handleLabelResized())}_subscribeToResize(){this._resizeSubscription.unsubscribe(),this._ngZone.runOutsideAngular(()=>{this._resizeSubscription=this._resizeObserver.observe(this._elementRef.nativeElement,{box:"border-box"}).subscribe(()=>this._handleResize())})}static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["label","matFormFieldFloatingLabel",""]],hostAttrs:[1,"mdc-floating-label","mat-mdc-floating-label"],hostVars:2,hostBindings:function(r,i){2&r&&at("mdc-floating-label--float-above",i.floating)},inputs:{floating:"floating",monitorResize:"monitorResize"}})}return n})();const MW="mdc-line-ripple--active",tE="mdc-line-ripple--deactivating";let kW=(()=>{class n{_elementRef=b(je);_cleanupTransitionEnd;constructor(){const t=b(ue),r=b(Ti);t.runOutsideAngular(()=>{this._cleanupTransitionEnd=r.listen(this._elementRef.nativeElement,"transitionend",this._handleTransitionEnd)})}activate(){const t=this._elementRef.nativeElement.classList;t.remove(tE),t.add(MW)}deactivate(){this._elementRef.nativeElement.classList.add(tE)}_handleTransitionEnd=t=>{const r=this._elementRef.nativeElement.classList,i=r.contains(tE);"opacity"===t.propertyName&&i&&r.remove(MW,tE)};ngOnDestroy(){this._cleanupTransitionEnd()}static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["div","matFormFieldLineRipple",""]],hostAttrs:[1,"mdc-line-ripple"]})}return n})(),NW=(()=>{class n{_elementRef=b(je);_ngZone=b(ue);open=!1;_notch;constructor(){}ngAfterViewInit(){const t=this._elementRef.nativeElement.querySelector(".mdc-floating-label");t?(this._elementRef.nativeElement.classList.add("mdc-notched-outline--upgraded"),"function"==typeof requestAnimationFrame&&(t.style.transitionDuration="0s",this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>t.style.transitionDuration="")}))):this._elementRef.nativeElement.classList.add("mdc-notched-outline--no-label")}_setNotchWidth(t){this._notch.nativeElement.style.width=this.open&&t?`calc(${t}px * var(--mat-mdc-form-field-floating-label-scale, 0.75) + 9px)`:""}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["div","matFormFieldNotchedOutline",""]],viewQuery:function(r,i){if(1&r&&qn(FIe,5),2&r){let o;Qe(o=Ye())&&(i._notch=o.first)}},hostAttrs:[1,"mdc-notched-outline"],hostVars:2,hostBindings:function(r,i){2&r&&at("mdc-notched-outline--notched",i.open)},inputs:{open:[0,"matFormFieldNotchedOutlineOpen","open"]},attrs:LIe,ngContentSelectors:VIe,decls:5,vars:0,consts:[["notch",""],[1,"mat-mdc-notch-piece","mdc-notched-outline__leading"],[1,"mat-mdc-notch-piece","mdc-notched-outline__notch"],[1,"mat-mdc-notch-piece","mdc-notched-outline__trailing"]],template:function(r,i){1&r&&(Hn(),Pe(0,"div",1),W(1,"div",2,0),Ae(3),K(),Pe(4,"div",3))},encapsulation:2,changeDetection:0})}return n})();const hTe={transitionMessages:aR("transitionMessages",[Zm("enter",Ps({opacity:1,transform:"translateY(0%)"})),Jm("void => enter",[Ps({opacity:0,transform:"translateY(-5px)"}),Xm("300ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])};let cR=(()=>{class n{value;stateChanges;id;placeholder;ngControl;focused;empty;shouldLabelFloat;required;disabled;errorState;controlType;autofilled;userAriaDescribedBy;disableAutomaticLabeling;static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n})}return n})();const uR=new B("MatFormField"),fTe=new B("MAT_FORM_FIELD_DEFAULT_OPTIONS");let dR=(()=>{class n{_elementRef=b(je);_changeDetectorRef=b(Uo);_dir=b(Gw);_platform=b(rr);_idGenerator=b(Xa);_defaults=b(fTe,{optional:!0});_animationMode=b(Ts,{optional:!0});_textField;_iconPrefixContainer;_textPrefixContainer;_iconSuffixContainer;_textSuffixContainer;_floatingLabel;_notchedOutline;_lineRipple;_formFieldControl;_prefixChildren;_suffixChildren;_errorChildren;_hintChildren;_labelChild=Ale(tg);get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(t){this._hideRequiredMarker=Qa(t)}_hideRequiredMarker=!1;color="primary";get floatLabel(){return this._floatLabel||this._defaults?.floatLabel||"auto"}set floatLabel(t){t!==this._floatLabel&&(this._floatLabel=t,this._changeDetectorRef.markForCheck())}_floatLabel;get appearance(){return this._appearance}set appearance(t){const r=this._appearance;this._appearance=t||this._defaults?.appearance||"fill","outline"===this._appearance&&this._appearance!==r&&(this._needsOutlineLabelOffsetUpdate=!0)}_appearance="fill";get subscriptSizing(){return this._subscriptSizing||this._defaults?.subscriptSizing||"fixed"}set subscriptSizing(t){this._subscriptSizing=t||this._defaults?.subscriptSizing||"fixed"}_subscriptSizing=null;get hintLabel(){return this._hintLabel}set hintLabel(t){this._hintLabel=t,this._processHints()}_hintLabel="";_hasIconPrefix=!1;_hasTextPrefix=!1;_hasIconSuffix=!1;_hasTextSuffix=!1;_labelId=this._idGenerator.getId("mat-mdc-form-field-label-");_hintLabelId=this._idGenerator.getId("mat-mdc-hint-");_subscriptAnimationState="";get _control(){return this._explicitFormFieldControl||this._formFieldControl}set _control(t){this._explicitFormFieldControl=t}_destroyed=new fe;_isFocused=null;_explicitFormFieldControl;_needsOutlineLabelOffsetUpdate=!1;_previousControl=null;_stateChanges;_valueChanges;_describedByChanges;_injector=b(ze);constructor(){const t=this._defaults;t&&(t.appearance&&(this.appearance=t.appearance),this._hideRequiredMarker=!!t?.hideRequiredMarker,t.color&&(this.color=t.color))}ngAfterViewInit(){this._updateFocusState(),this._subscriptAnimationState="enter",this._changeDetectorRef.detectChanges()}ngAfterContentInit(){this._assertFormFieldControl(),this._initializeSubscript(),this._initializePrefixAndSuffix(),this._initializeOutlineLabelOffsetSubscriptions()}ngAfterContentChecked(){this._assertFormFieldControl(),this._control!==this._previousControl&&(this._initializeControl(this._previousControl),this._previousControl=this._control)}ngOnDestroy(){this._stateChanges?.unsubscribe(),this._valueChanges?.unsubscribe(),this._describedByChanges?.unsubscribe(),this._destroyed.next(),this._destroyed.complete()}getLabelId=xi(()=>this._hasFloatingLabel()?this._labelId:null);getConnectedOverlayOrigin(){return this._textField||this._elementRef}_animateAndLockLabel(){this._hasFloatingLabel()&&(this.floatLabel="always")}_initializeControl(t){const r=this._control,i="mat-mdc-form-field-type-";t&&this._elementRef.nativeElement.classList.remove(i+t.controlType),r.controlType&&this._elementRef.nativeElement.classList.add(i+r.controlType),this._stateChanges?.unsubscribe(),this._stateChanges=r.stateChanges.subscribe(()=>{this._updateFocusState(),this._changeDetectorRef.markForCheck()}),this._describedByChanges?.unsubscribe(),this._describedByChanges=r.stateChanges.pipe(Ec([void 0,void 0]),Te(()=>[r.errorState,r.userAriaDescribedBy]),function xIe(){return Jt((n,e)=>{let t,r=!1;n.subscribe(zt(e,i=>{const o=t;t=i,r&&e.next([o,i]),r=!0}))})}(),si(([[o,s],[a,l]])=>o!==a||s!==l)).subscribe(()=>this._syncDescribedByIds()),this._valueChanges?.unsubscribe(),r.ngControl&&r.ngControl.valueChanges&&(this._valueChanges=r.ngControl.valueChanges.pipe(At(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()))}_checkPrefixAndSuffixTypes(){this._hasIconPrefix=!!this._prefixChildren.find(t=>!t._isText),this._hasTextPrefix=!!this._prefixChildren.find(t=>t._isText),this._hasIconSuffix=!!this._suffixChildren.find(t=>!t._isText),this._hasTextSuffix=!!this._suffixChildren.find(t=>t._isText)}_initializePrefixAndSuffix(){this._checkPrefixAndSuffixTypes(),Ym(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._checkPrefixAndSuffixTypes(),this._changeDetectorRef.markForCheck()})}_initializeSubscript(){this._hintChildren.changes.subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._validateHints(),this._syncDescribedByIds()}_assertFormFieldControl(){}_updateFocusState(){this._control.focused&&!this._isFocused?(this._isFocused=!0,this._lineRipple?.activate()):!this._control.focused&&(this._isFocused||null===this._isFocused)&&(this._isFocused=!1,this._lineRipple?.deactivate()),this._textField?.nativeElement.classList.toggle("mdc-text-field--focused",this._control.focused)}_initializeOutlineLabelOffsetSubscriptions(){this._prefixChildren.changes.subscribe(()=>this._needsOutlineLabelOffsetUpdate=!0),ex(()=>{this._needsOutlineLabelOffsetUpdate&&(this._needsOutlineLabelOffsetUpdate=!1,this._updateOutlineLabelOffset())},{injector:this._injector}),this._dir.change.pipe(At(this._destroyed)).subscribe(()=>this._needsOutlineLabelOffsetUpdate=!0)}_shouldAlwaysFloat(){return"always"===this.floatLabel}_hasOutline(){return"outline"===this.appearance}_forceDisplayInfixLabel(){return!this._platform.isBrowser&&this._prefixChildren.length&&!this._shouldLabelFloat()}_hasFloatingLabel=xi(()=>!!this._labelChild());_shouldLabelFloat(){return!!this._hasFloatingLabel()&&(this._control.shouldLabelFloat||this._shouldAlwaysFloat())}_shouldForward(t){const r=this._control?this._control.ngControl:null;return r&&r[t]}_getDisplayedMessages(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}_handleLabelResized(){this._refreshOutlineNotchWidth()}_refreshOutlineNotchWidth(){this._hasOutline()&&this._floatingLabel&&this._shouldLabelFloat()?this._notchedOutline?._setNotchWidth(this._floatingLabel.getWidth()):this._notchedOutline?._setNotchWidth(0)}_processHints(){this._validateHints(),this._syncDescribedByIds()}_validateHints(){}_syncDescribedByIds(){if(this._control){let t=[];if(this._control.userAriaDescribedBy&&"string"==typeof this._control.userAriaDescribedBy&&t.push(...this._control.userAriaDescribedBy.split(" ")),"hint"===this._getDisplayedMessages()){const r=this._hintChildren?this._hintChildren.find(o=>"start"===o.align):null,i=this._hintChildren?this._hintChildren.find(o=>"end"===o.align):null;r?t.push(r.id):this._hintLabel&&t.push(this._hintLabelId),i&&t.push(i.id)}else this._errorChildren&&t.push(...this._errorChildren.map(r=>r.id));this._control.setDescribedByIds(t)}}_updateOutlineLabelOffset(){if(!this._hasOutline()||!this._floatingLabel)return;const t=this._floatingLabel.element;if(!this._iconPrefixContainer&&!this._textPrefixContainer)return void(t.style.transform="");if(!this._isAttachedToDom())return void(this._needsOutlineLabelOffsetUpdate=!0);const r=this._iconPrefixContainer?.nativeElement,i=this._textPrefixContainer?.nativeElement,o=this._iconSuffixContainer?.nativeElement,s=this._textSuffixContainer?.nativeElement,a=r?.getBoundingClientRect().width??0,l=i?.getBoundingClientRect().width??0,c=o?.getBoundingClientRect().width??0,u=s?.getBoundingClientRect().width??0;t.style.transform=`var(\n --mat-mdc-form-field-label-transform,\n translateY(-50%) translateX(calc(${"rtl"===this._dir.value?"-1":"1"} * (${a+l}px + var(--mat-mdc-form-field-label-offset-x, 0px))))\n )`,this._elementRef.nativeElement.style.setProperty("--mat-form-field-notch-max-width",`calc(100% - ${a+l+c+u}px)`)}_isAttachedToDom(){const t=this._elementRef.nativeElement;if(t.getRootNode){const r=t.getRootNode();return r&&r!==t}return document.documentElement.contains(t)}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-form-field"]],contentQueries:function(r,i,o){if(1&r&&(AH(o,i._labelChild,tg,5),$n(o,cR,5),$n(o,cTe,5),$n(o,uTe,5),$n(o,xW,5),$n(o,DW,5)),2&r){let s;(function RH(n=1){tv(p0()+n)})(),Qe(s=Ye())&&(i._formFieldControl=s.first),Qe(s=Ye())&&(i._prefixChildren=s),Qe(s=Ye())&&(i._suffixChildren=s),Qe(s=Ye())&&(i._errorChildren=s),Qe(s=Ye())&&(i._hintChildren=s)}},viewQuery:function(r,i){if(1&r&&(qn(BIe,5),qn(UIe,5),qn(zIe,5),qn(jIe,5),qn(HIe,5),qn(RW,5),qn(NW,5),qn(kW,5)),2&r){let o;Qe(o=Ye())&&(i._textField=o.first),Qe(o=Ye())&&(i._iconPrefixContainer=o.first),Qe(o=Ye())&&(i._textPrefixContainer=o.first),Qe(o=Ye())&&(i._iconSuffixContainer=o.first),Qe(o=Ye())&&(i._textSuffixContainer=o.first),Qe(o=Ye())&&(i._floatingLabel=o.first),Qe(o=Ye())&&(i._notchedOutline=o.first),Qe(o=Ye())&&(i._lineRipple=o.first)}},hostAttrs:[1,"mat-mdc-form-field"],hostVars:42,hostBindings:function(r,i){2&r&&at("mat-mdc-form-field-label-always-float",i._shouldAlwaysFloat())("mat-mdc-form-field-has-icon-prefix",i._hasIconPrefix)("mat-mdc-form-field-has-icon-suffix",i._hasIconSuffix)("mat-form-field-invalid",i._control.errorState)("mat-form-field-disabled",i._control.disabled)("mat-form-field-autofilled",i._control.autofilled)("mat-form-field-no-animations","NoopAnimations"===i._animationMode)("mat-form-field-appearance-fill","fill"==i.appearance)("mat-form-field-appearance-outline","outline"==i.appearance)("mat-form-field-hide-placeholder",i._hasFloatingLabel()&&!i._shouldLabelFloat())("mat-focused",i._control.focused)("mat-primary","accent"!==i.color&&"warn"!==i.color)("mat-accent","accent"===i.color)("mat-warn","warn"===i.color)("ng-untouched",i._shouldForward("untouched"))("ng-touched",i._shouldForward("touched"))("ng-pristine",i._shouldForward("pristine"))("ng-dirty",i._shouldForward("dirty"))("ng-valid",i._shouldForward("valid"))("ng-invalid",i._shouldForward("invalid"))("ng-pending",i._shouldForward("pending"))},inputs:{hideRequiredMarker:"hideRequiredMarker",color:"color",floatLabel:"floatLabel",appearance:"appearance",subscriptSizing:"subscriptSizing",hintLabel:"hintLabel"},exportAs:["matFormField"],features:[$e([{provide:uR,useExisting:n},{provide:AW,useExisting:n}])],ngContentSelectors:qIe,decls:18,vars:21,consts:[["labelTemplate",""],["textField",""],["iconPrefixContainer",""],["textPrefixContainer",""],["textSuffixContainer",""],["iconSuffixContainer",""],[1,"mat-mdc-text-field-wrapper","mdc-text-field",3,"click"],[1,"mat-mdc-form-field-focus-overlay"],[1,"mat-mdc-form-field-flex"],["matFormFieldNotchedOutline","",3,"matFormFieldNotchedOutlineOpen"],[1,"mat-mdc-form-field-icon-prefix"],[1,"mat-mdc-form-field-text-prefix"],[1,"mat-mdc-form-field-infix"],[3,"ngTemplateOutlet"],[1,"mat-mdc-form-field-text-suffix"],[1,"mat-mdc-form-field-icon-suffix"],["matFormFieldLineRipple",""],[1,"mat-mdc-form-field-subscript-wrapper","mat-mdc-form-field-bottom-align"],[1,"mat-mdc-form-field-error-wrapper"],[1,"mat-mdc-form-field-hint-wrapper"],["matFormFieldFloatingLabel","",3,"floating","monitorResize","id"],["aria-hidden","true",1,"mat-mdc-form-field-required-marker","mdc-floating-label--required"],[3,"id"],[1,"mat-mdc-form-field-hint-spacer"]],template:function(r,i){if(1&r){const o=La();Hn($Ie),et(0,KIe,1,1,"ng-template",null,0,tD),W(2,"div",6,1),Ve("click",function(a){return vi(o),bi(i._control.onContainerClick(a))}),et(4,QIe,1,0,"div",7),W(5,"div",8),et(6,ZIe,2,2,"div",9)(7,JIe,3,0,"div",10)(8,eTe,3,0,"div",11),W(9,"div",12),et(10,nTe,1,1,null,13),Ae(11),K(),et(12,rTe,3,0,"div",14)(13,iTe,3,0,"div",15),K(),et(14,oTe,1,0,"div",16),K(),W(15,"div",17),et(16,sTe,2,1,"div",18)(17,lTe,5,2,"div",19),K()}if(2&r){let o;re(2),at("mdc-text-field--filled",!i._hasOutline())("mdc-text-field--outlined",i._hasOutline())("mdc-text-field--no-label",!i._hasFloatingLabel())("mdc-text-field--disabled",i._control.disabled)("mdc-text-field--invalid",i._control.errorState),re(2),Pt(i._hasOutline()||i._control.disabled?-1:4),re(2),Pt(i._hasOutline()?6:-1),re(),Pt(i._hasIconPrefix?7:-1),re(),Pt(i._hasTextPrefix?8:-1),re(2),Pt(!i._hasOutline()||i._forceDisplayInfixLabel()?10:-1),re(2),Pt(i._hasTextSuffix?12:-1),re(),Pt(i._hasIconSuffix?13:-1),re(),Pt(i._hasOutline()?-1:14),re(),at("mat-mdc-form-field-subscript-dynamic-size","dynamic"===i.subscriptSizing),re(),Pt("error"===(o=i._getDisplayedMessages())?16:"hint"===o?17:-1)}},dependencies:[RW,NW,ND,kW,DW],styles:['.mdc-text-field{display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity,transform,color;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.mdc-text-field__input{width:100%;min-width:0;border:none;border-radius:0;background:none;padding:0;-moz-appearance:none;-webkit-appearance:none;height:28px}.mdc-text-field__input::-webkit-calendar-picker-indicator{display:none}.mdc-text-field__input::-ms-clear{display:none}.mdc-text-field__input:focus{outline:none}.mdc-text-field__input:invalid{box-shadow:none}.mdc-text-field__input::placeholder{opacity:0}.mdc-text-field__input::-moz-placeholder{opacity:0}.mdc-text-field__input::-webkit-input-placeholder{opacity:0}.mdc-text-field__input:-ms-input-placeholder{opacity:0}.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mdc-text-field--focused .mdc-text-field__input::placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{opacity:1}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-moz-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-webkit-input-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive:-ms-input-placeholder{opacity:0}.mdc-text-field--outlined .mdc-text-field__input,.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__input{height:100%}.mdc-text-field--outlined .mdc-text-field__input{display:flex;border:none !important;background-color:rgba(0,0,0,0)}.mdc-text-field--disabled .mdc-text-field__input{pointer-events:auto}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mdc-filled-text-field-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mdc-filled-text-field-caret-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mdc-filled-text-field-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mdc-filled-text-field-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mdc-filled-text-field-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mdc-filled-text-field-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mdc-filled-text-field-error-caret-color)}.mdc-text-field--filled.mdc-text-field--disabled .mdc-text-field__input{color:var(--mdc-filled-text-field-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mdc-outlined-text-field-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mdc-outlined-text-field-caret-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mdc-outlined-text-field-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mdc-outlined-text-field-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mdc-outlined-text-field-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mdc-outlined-text-field-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mdc-outlined-text-field-error-caret-color)}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-text-field__input{color:var(--mdc-outlined-text-field-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-text-field--disabled .mdc-text-field__input{background-color:Window}}.mdc-text-field--filled{height:56px;border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:var(--mdc-filled-text-field-container-shape, var(--mat-sys-corner-extra-small));border-top-right-radius:var(--mdc-filled-text-field-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:var(--mdc-filled-text-field-container-color, var(--mat-sys-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled{background-color:var(--mdc-filled-text-field-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 4%, transparent))}.mdc-text-field--outlined{height:56px;overflow:visible;padding-right:max(16px,var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small)));padding-left:max(16px,var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small)) + 4px)}[dir=rtl] .mdc-text-field--outlined{padding-right:max(16px,var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small)) + 4px);padding-left:max(16px,var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small)))}.mdc-floating-label{position:absolute;left:0;transform-origin:left top;line-height:1.15rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform}[dir=rtl] .mdc-floating-label{right:0;left:auto;transform-origin:right top;text-align:right}.mdc-text-field .mdc-floating-label{top:50%;transform:translateY(-50%);pointer-events:none}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-text-field--outlined .mdc-floating-label{left:4px;right:auto}[dir=rtl] .mdc-text-field--outlined .mdc-floating-label{left:auto;right:4px}.mdc-text-field--filled .mdc-floating-label{left:16px;right:auto}[dir=rtl] .mdc-text-field--filled .mdc-floating-label{left:auto;right:16px}.mdc-text-field--disabled .mdc-floating-label{cursor:default}@media(forced-colors: active){.mdc-text-field--disabled .mdc-floating-label{z-index:1}}.mdc-text-field--filled.mdc-text-field--no-label .mdc-floating-label{display:none}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mdc-filled-text-field-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mdc-filled-text-field-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mdc-filled-text-field-hover-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-floating-label{color:var(--mdc-filled-text-field-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mdc-filled-text-field-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mdc-filled-text-field-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mdc-filled-text-field-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--filled .mdc-floating-label{font-family:var(--mdc-filled-text-field-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mdc-filled-text-field-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mdc-filled-text-field-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mdc-filled-text-field-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mdc-outlined-text-field-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mdc-outlined-text-field-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mdc-outlined-text-field-hover-label-text-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-floating-label{color:var(--mdc-outlined-text-field-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mdc-outlined-text-field-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mdc-outlined-text-field-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mdc-outlined-text-field-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined .mdc-floating-label{font-family:var(--mdc-outlined-text-field-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mdc-outlined-text-field-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mdc-outlined-text-field-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mdc-outlined-text-field-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-floating-label--float-above{cursor:auto;transform:translateY(-106%) scale(0.75)}.mdc-text-field--filled .mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-37.25px) scale(1);font-size:.75rem}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:133.3333333333%}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) scale(0.75)}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:1px;margin-right:0;content:"*"}[dir=rtl] .mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:0;margin-right:1px}.mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline{text-align:right}.mdc-text-field--outlined .mdc-notched-outline{z-index:1}.mat-mdc-notch-piece{box-sizing:border-box;height:100%;pointer-events:none;border-top:1px solid;border-bottom:1px solid}.mdc-text-field--focused .mat-mdc-notch-piece{border-width:2px}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mat-mdc-notch-piece{border-color:var(--mdc-outlined-text-field-outline-color, var(--mat-sys-outline));border-width:var(--mdc-outlined-text-field-outline-width, 1px)}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mat-mdc-notch-piece{border-color:var(--mdc-outlined-text-field-hover-outline-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mdc-outlined-text-field-focus-outline-color, var(--mat-sys-primary))}.mdc-text-field--outlined.mdc-text-field--disabled .mat-mdc-notch-piece{border-color:var(--mdc-outlined-text-field-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mat-mdc-notch-piece{border-color:var(--mdc-outlined-text-field-error-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-notched-outline .mat-mdc-notch-piece{border-color:var(--mdc-outlined-text-field-error-hover-outline-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mdc-outlined-text-field-error-focus-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline .mat-mdc-notch-piece{border-width:var(--mdc-outlined-text-field-focus-outline-width, 2px)}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{width:max(12px,var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small)))}[dir=rtl] .mdc-notched-outline__leading{border-left:none;border-right:1px solid;border-bottom-left-radius:0;border-top-left-radius:0;border-top-right-radius:var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__trailing{flex-grow:1;border-left:none;border-right:1px solid;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small))}[dir=rtl] .mdc-notched-outline__trailing{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__notch{flex:0 0 auto;width:auto}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__notch{max-width:min(var(--mat-form-field-notch-max-width, 100%),100% - max(12px,var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small)))*2)}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:1px}.mdc-text-field--focused.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:2px}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none;--mat-form-field-notch-max-width: 100%}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{display:none}.mdc-line-ripple::before,.mdc-line-ripple::after{position:absolute;bottom:0;left:0;width:100%;border-bottom-style:solid;content:""}.mdc-line-ripple::before{z-index:1;border-bottom-width:var(--mdc-filled-text-field-active-indicator-height, 1px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-active-indicator-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-hover-active-indicator-color, var(--mat-sys-on-surface))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-disabled-active-indicator-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-error-active-indicator-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-error-hover-active-indicator-color, var(--mat-sys-on-error-container))}.mdc-line-ripple::after{transform:scaleX(0);opacity:0;z-index:2}.mdc-text-field--filled .mdc-line-ripple::after{border-bottom-width:var(--mdc-filled-text-field-focus-active-indicator-height, 2px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mdc-filled-text-field-focus-active-indicator-color, var(--mat-sys-primary))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mdc-filled-text-field-error-focus-active-indicator-color, var(--mat-sys-error))}.mdc-line-ripple--active::after{transform:scaleX(1);opacity:1}.mdc-line-ripple--deactivating::after{opacity:0}.mdc-text-field--disabled{pointer-events:none}.mat-mdc-form-field-textarea-control{vertical-align:middle;resize:vertical;box-sizing:border-box;height:auto;margin:0;padding:0;border:none;overflow:auto}.mat-mdc-form-field-input-control.mat-mdc-form-field-input-control{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font:inherit;letter-spacing:inherit;text-decoration:inherit;text-transform:inherit;border:none}.mat-mdc-form-field .mat-mdc-floating-label.mdc-floating-label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;line-height:normal;pointer-events:all;will-change:auto}.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-floating-label.mdc-floating-label{cursor:inherit}.mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input,.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control{height:auto}.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control.mdc-text-field__input[type=color]{height:23px}.mat-mdc-text-field-wrapper{height:auto;flex:auto;will-change:auto}.mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-left:0;--mat-mdc-form-field-label-offset-x: -16px}.mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-right:0}[dir=rtl] .mat-mdc-text-field-wrapper{padding-left:16px;padding-right:16px}[dir=rtl] .mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-left:0}[dir=rtl] .mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-right:0}.mat-form-field-disabled .mdc-text-field__input::placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-label-always-float .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms;opacity:1}.mat-mdc-text-field-wrapper .mat-mdc-form-field-infix .mat-mdc-floating-label{left:auto;right:auto}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-text-field__input{display:inline-block}.mat-mdc-form-field .mat-mdc-text-field-wrapper.mdc-text-field .mdc-notched-outline__notch{padding-top:0}.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:1px solid rgba(0,0,0,0)}[dir=rtl] .mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:none;border-right:1px solid rgba(0,0,0,0)}.mat-mdc-form-field-infix{min-height:var(--mat-form-field-container-height, 56px);padding-top:var(--mat-form-field-filled-with-label-container-padding-top, 24px);padding-bottom:var(--mat-form-field-filled-with-label-container-padding-bottom, 8px)}.mdc-text-field--outlined .mat-mdc-form-field-infix,.mdc-text-field--no-label .mat-mdc-form-field-infix{padding-top:var(--mat-form-field-container-vertical-padding, 16px);padding-bottom:var(--mat-form-field-container-vertical-padding, 16px)}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:calc(var(--mat-form-field-container-height, 56px)/2)}.mdc-text-field--filled .mat-mdc-floating-label{display:var(--mat-form-field-filled-label-display, block)}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{--mat-mdc-form-field-label-transform: translateY(calc(calc(6.75px + var(--mat-form-field-container-height, 56px) / 2) * -1)) scale(var(--mat-mdc-form-field-floating-label-scale, 0.75));transform:var(--mat-mdc-form-field-label-transform)}.mat-mdc-form-field-subscript-wrapper{box-sizing:border-box;width:100%;position:relative}.mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-error-wrapper{position:absolute;top:0;left:0;right:0;padding:0 16px}.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-error-wrapper{position:static}.mat-mdc-form-field-bottom-align::before{content:"";display:inline-block;height:16px}.mat-mdc-form-field-bottom-align.mat-mdc-form-field-subscript-dynamic-size::before{content:unset}.mat-mdc-form-field-hint-end{order:1}.mat-mdc-form-field-hint-wrapper{display:flex}.mat-mdc-form-field-hint-spacer{flex:1 0 1em}.mat-mdc-form-field-error{display:block;color:var(--mat-form-field-error-text-color, var(--mat-sys-error))}.mat-mdc-form-field-subscript-wrapper,.mat-mdc-form-field-bottom-align::before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-subscript-text-font, var(--mat-sys-body-small-font));line-height:var(--mat-form-field-subscript-text-line-height, var(--mat-sys-body-small-line-height));font-size:var(--mat-form-field-subscript-text-size, var(--mat-sys-body-small-size));letter-spacing:var(--mat-form-field-subscript-text-tracking, var(--mat-sys-body-small-tracking));font-weight:var(--mat-form-field-subscript-text-weight, var(--mat-sys-body-small-weight))}.mat-mdc-form-field-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;opacity:0;pointer-events:none;background-color:var(--mat-form-field-state-layer-color, var(--mat-sys-on-surface))}.mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-form-field.mat-focused .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-focus-state-layer-opacity, 0)}select.mat-mdc-form-field-input-control{-moz-appearance:none;-webkit-appearance:none;background-color:rgba(0,0,0,0);display:inline-flex;box-sizing:border-box}select.mat-mdc-form-field-input-control:not(:disabled){cursor:pointer}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option{color:var(--mat-form-field-select-option-text-color, var(--mat-sys-neutral10))}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option:disabled{color:var(--mat-form-field-select-disabled-option-text-color, color-mix(in srgb, var(--mat-sys-neutral10) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{content:"";width:0;height:0;border-left:5px solid rgba(0,0,0,0);border-right:5px solid rgba(0,0,0,0);border-top:5px solid;position:absolute;right:0;top:50%;margin-top:-2.5px;pointer-events:none;color:var(--mat-form-field-enabled-select-arrow-color, var(--mat-sys-on-surface-variant))}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{right:auto;left:0}.mat-mdc-form-field-type-mat-native-select.mat-focused .mat-mdc-form-field-infix::after{color:var(--mat-form-field-focus-select-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field-type-mat-native-select.mat-form-field-disabled .mat-mdc-form-field-infix::after{color:var(--mat-form-field-disabled-select-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:15px}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:0;padding-left:15px}@media(forced-colors: active){.mat-form-field-appearance-fill .mat-mdc-text-field-wrapper{outline:solid 1px}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-text-field-wrapper{outline-color:GrayText}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-focused .mat-mdc-text-field-wrapper{outline:dashed 3px}}@media(forced-colors: active){.mat-mdc-form-field.mat-focused .mdc-notched-outline{border:dashed 3px}}.mat-mdc-form-field-input-control[type=date],.mat-mdc-form-field-input-control[type=datetime],.mat-mdc-form-field-input-control[type=datetime-local],.mat-mdc-form-field-input-control[type=month],.mat-mdc-form-field-input-control[type=week],.mat-mdc-form-field-input-control[type=time]{line-height:1}.mat-mdc-form-field-input-control::-webkit-datetime-edit{line-height:1;padding:0;margin-bottom:-2px}.mat-mdc-form-field{--mat-mdc-form-field-floating-label-scale: 0.75;display:inline-flex;flex-direction:column;min-width:0;text-align:left;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-container-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-form-field-container-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-form-field-container-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-form-field-container-text-tracking, var(--mat-sys-body-large-tracking));font-weight:var(--mat-form-field-container-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-floating-label--float-above{font-size:calc(var(--mat-form-field-outlined-label-text-populated-size)*var(--mat-mdc-form-field-floating-label-scale))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:var(--mat-form-field-outlined-label-text-populated-size)}[dir=rtl] .mat-mdc-form-field{text-align:right}.mat-mdc-form-field-flex{display:inline-flex;align-items:baseline;box-sizing:border-box;width:100%}.mat-mdc-text-field-wrapper{width:100%;z-index:0}.mat-mdc-form-field-icon-prefix,.mat-mdc-form-field-icon-suffix{align-self:center;line-height:0;pointer-events:auto;position:relative;z-index:1}.mat-mdc-form-field-icon-prefix>.mat-icon,.mat-mdc-form-field-icon-suffix>.mat-icon{padding:0 12px;box-sizing:content-box}.mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-leading-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-disabled-leading-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-disabled-trailing-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-invalid .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-trailing-icon-color, var(--mat-sys-error))}.mat-form-field-invalid:not(.mat-focused):not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-hover-trailing-icon-color, var(--mat-sys-on-error-container))}.mat-form-field-invalid.mat-focused .mat-mdc-text-field-wrapper .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-focus-trailing-icon-color, var(--mat-sys-error))}.mat-mdc-form-field-icon-prefix,[dir=rtl] .mat-mdc-form-field-icon-suffix{padding:0 4px 0 0}.mat-mdc-form-field-icon-suffix,[dir=rtl] .mat-mdc-form-field-icon-prefix{padding:0 0 0 4px}.mat-mdc-form-field-subscript-wrapper .mat-icon,.mat-mdc-form-field label .mat-icon{width:1em;height:1em;font-size:inherit}.mat-mdc-form-field-infix{flex:auto;min-width:0;width:180px;position:relative;box-sizing:border-box}.mat-mdc-form-field-infix:has(textarea[cols]){width:auto}.mat-mdc-form-field .mdc-notched-outline__notch{margin-left:-1px;-webkit-clip-path:inset(-9em -999em -9em 1px);clip-path:inset(-9em -999em -9em 1px)}[dir=rtl] .mat-mdc-form-field .mdc-notched-outline__notch{margin-left:0;margin-right:-1px;-webkit-clip-path:inset(-9em 1px -9em -999em);clip-path:inset(-9em 1px -9em -999em)}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-floating-label{transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input{transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input::placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input::-moz-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input::-webkit-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field__input:-ms-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field:not(.mat-form-field-no-animations).mdc-text-field--no-label .mdc-text-field__input::placeholder,.mat-mdc-form-field:not(.mat-form-field-no-animations).mdc-text-field--focused .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field:not(.mat-form-field-no-animations).mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mat-mdc-form-field:not(.mat-form-field-no-animations).mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field:not(.mat-form-field-no-animations).mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mat-mdc-form-field:not(.mat-form-field-no-animations).mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field:not(.mat-form-field-no-animations).mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mat-mdc-form-field:not(.mat-form-field-no-animations).mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-text-field--filled:not(.mdc-ripple-upgraded):focus .mdc-text-field__ripple::before{transition-duration:75ms}.mat-mdc-form-field:not(.mat-form-field-no-animations) .mdc-line-ripple::after{transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-notched-outline .mdc-floating-label{max-width:calc(100% + 1px)}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(133.3333333333% + 1px)}'],encapsulation:2,data:{animation:[hTe.transitionMessages]},changeDetection:0})}return n})(),ng=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[gn,Q5,gn]})}return n})(),gTe=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["ng-component"]],hostAttrs:["cdk-text-field-style-loader",""],decls:0,vars:0,template:function(r,i){},styles:["textarea.cdk-textarea-autosize{resize:none}textarea.cdk-textarea-autosize-measuring{padding:2px 0 !important;box-sizing:content-box !important;height:auto !important;overflow:hidden !important}textarea.cdk-textarea-autosize-measuring-firefox{padding:2px 0 !important;box-sizing:content-box !important;height:0 !important}@keyframes cdk-text-field-autofill-start{/*!*/}@keyframes cdk-text-field-autofill-end{/*!*/}.cdk-text-field-autofill-monitored:-webkit-autofill{animation:cdk-text-field-autofill-start 0s 1ms}.cdk-text-field-autofill-monitored:not(:-webkit-autofill){animation:cdk-text-field-autofill-end 0s 1ms}"],encapsulation:2,changeDetection:0})}return n})();const FW=ah({passive:!0});let _Te=(()=>{class n{_platform=b(rr);_ngZone=b(ue);_styleLoader=b(Ka);_monitoredElements=new Map;constructor(){}monitor(t){if(!this._platform.isBrowser)return Di;this._styleLoader.load(gTe);const r=Ya(t),i=this._monitoredElements.get(r);if(i)return i.subject;const o=new fe,s="cdk-text-field-autofilled",a=l=>{"cdk-text-field-autofill-start"!==l.animationName||r.classList.contains(s)?"cdk-text-field-autofill-end"===l.animationName&&r.classList.contains(s)&&(r.classList.remove(s),this._ngZone.run(()=>o.next({target:l.target,isAutofilled:!1}))):(r.classList.add(s),this._ngZone.run(()=>o.next({target:l.target,isAutofilled:!0})))};return this._ngZone.runOutsideAngular(()=>{r.addEventListener("animationstart",a,FW),r.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(r,{subject:o,unlisten:()=>{r.removeEventListener("animationstart",a,FW)}}),o}stopMonitoring(t){const r=Ya(t),i=this._monitoredElements.get(r);i&&(i.unlisten(),i.subject.complete(),r.classList.remove("cdk-text-field-autofill-monitored"),r.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(r))}ngOnDestroy(){this._monitoredElements.forEach((t,r)=>this.stopMonitoring(r))}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),yTe=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({})}return n})();const vTe=new B("MAT_INPUT_VALUE_ACCESSOR"),bTe=["button","checkbox","file","hidden","image","radio","range","reset","submit"],wTe=new B("MAT_INPUT_CONFIG");let hR=(()=>{class n{_elementRef=b(je);_platform=b(rr);ngControl=b(qo,{optional:!0,self:!0});_autofillMonitor=b(_Te);_ngZone=b(ue);_formField=b(uR,{optional:!0});_renderer=b(Ti);_uid=b(Xa).getId("mat-input-");_previousNativeValue;_inputValueAccessor;_signalBasedValueAccessor;_previousPlaceholder;_errorStateTracker;_config=b(wTe,{optional:!0});_cleanupIosKeyup;_cleanupWebkitWheel;_formFieldDescribedBy;_isServer;_isNativeSelect;_isTextarea;_isInFormField;focused=!1;stateChanges=new fe;controlType="mat-input";autofilled=!1;get disabled(){return this._disabled}set disabled(t){this._disabled=Qa(t),this.focused&&(this.focused=!1,this.stateChanges.next())}_disabled=!1;get id(){return this._id}set id(t){this._id=t||this._uid}_id;placeholder;name;get required(){return this._required??this.ngControl?.control?.hasValidator(Ri.required)??!1}set required(t){this._required=Qa(t)}_required;get type(){return this._type}set type(t){const r=this._type;this._type=t||"text",this._validateType(),!this._isTextarea&&U5().has(this._type)&&(this._elementRef.nativeElement.type=this._type),this._type!==r&&this._ensureWheelDefaultBehavior()}_type="text";get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(t){this._errorStateTracker.matcher=t}userAriaDescribedBy;get value(){return this._signalBasedValueAccessor?this._signalBasedValueAccessor.value():this._inputValueAccessor.value}set value(t){t!==this.value&&(this._signalBasedValueAccessor?this._signalBasedValueAccessor.value.set(t):this._inputValueAccessor.value=t,this.stateChanges.next())}get readonly(){return this._readonly}set readonly(t){this._readonly=Qa(t)}_readonly=!1;disabledInteractive;get errorState(){return this._errorStateTracker.errorState}set errorState(t){this._errorStateTracker.errorState=t}_neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(t=>U5().has(t));constructor(){const t=b(jm,{optional:!0}),r=b(Ga,{optional:!0}),i=b(tR),o=b(vTe,{optional:!0,self:!0}),s=this._elementRef.nativeElement,a=s.nodeName.toLowerCase();o?up(o.value)?this._signalBasedValueAccessor=o:this._inputValueAccessor=o:this._inputValueAccessor=s,this._previousNativeValue=this.value,this.id=this.id,this._platform.IOS&&this._ngZone.runOutsideAngular(()=>{this._cleanupIosKeyup=this._renderer.listen(s,"keyup",this._iOSKeyupListener)}),this._errorStateTracker=new fW(i,this.ngControl,r,t,this.stateChanges),this._isServer=!this._platform.isBrowser,this._isNativeSelect="select"===a,this._isTextarea="textarea"===a,this._isInFormField=!!this._formField,this.disabledInteractive=this._config?.disabledInteractive||!1,this._isNativeSelect&&(this.controlType=s.multiple?"mat-native-select-multiple":"mat-native-select"),this._signalBasedValueAccessor&&pm(()=>{this._signalBasedValueAccessor.value(),this.stateChanges.next()})}ngAfterViewInit(){this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(t=>{this.autofilled=t.isAutofilled,this.stateChanges.next()})}ngOnChanges(){this.stateChanges.next()}ngOnDestroy(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement),this._cleanupIosKeyup?.(),this._cleanupWebkitWheel?.()}ngDoCheck(){this.ngControl&&(this.updateErrorState(),null!==this.ngControl.disabled&&this.ngControl.disabled!==this.disabled&&(this.disabled=this.ngControl.disabled,this.stateChanges.next())),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}focus(t){this._elementRef.nativeElement.focus(t)}updateErrorState(){this._errorStateTracker.updateErrorState()}_focusChanged(t){if(t!==this.focused){if(!this._isNativeSelect&&t&&this.disabled&&this.disabledInteractive){const r=this._elementRef.nativeElement;"number"===r.type?(r.type="text",r.setSelectionRange(0,0),r.type="number"):r.setSelectionRange(0,0)}this.focused=t,this.stateChanges.next()}}_onInput(){}_dirtyCheckNativeValue(){const t=this._elementRef.nativeElement.value;this._previousNativeValue!==t&&(this._previousNativeValue=t,this.stateChanges.next())}_dirtyCheckPlaceholder(){const t=this._getPlaceholder();if(t!==this._previousPlaceholder){const r=this._elementRef.nativeElement;this._previousPlaceholder=t,t?r.setAttribute("placeholder",t):r.removeAttribute("placeholder")}}_getPlaceholder(){return this.placeholder||null}_validateType(){bTe.indexOf(this._type)}_isNeverEmpty(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}_isBadInput(){let t=this._elementRef.nativeElement.validity;return t&&t.badInput}get empty(){return!(this._isNeverEmpty()||this._elementRef.nativeElement.value||this._isBadInput()||this.autofilled)}get shouldLabelFloat(){if(this._isNativeSelect){const t=this._elementRef.nativeElement,r=t.options[0];return this.focused||t.multiple||!this.empty||!!(t.selectedIndex>-1&&r&&r.label)}return this.focused&&!this.disabled||!this.empty}setDescribedByIds(t){const r=this._elementRef.nativeElement,i=r.getAttribute("aria-describedby");let o;if(i){const s=this._formFieldDescribedBy||t;o=t.concat(i.split(" ").filter(a=>a&&!s.includes(a)))}else o=t;this._formFieldDescribedBy=t,o.length?r.setAttribute("aria-describedby",o.join(" ")):r.removeAttribute("aria-describedby")}onContainerClick(){this.focused||this.focus()}_isInlineSelect(){const t=this._elementRef.nativeElement;return this._isNativeSelect&&(t.multiple||t.size>1)}_iOSKeyupListener=t=>{const r=t.target;!r.value&&0===r.selectionStart&&0===r.selectionEnd&&(r.setSelectionRange(1,1),r.setSelectionRange(0,0))};_webkitBlinkWheelListener=()=>{};_ensureWheelDefaultBehavior(){this._cleanupWebkitWheel?.(),"number"===this._type&&(this._platform.BLINK||this._platform.WEBKIT)&&(this._cleanupWebkitWheel=this._renderer.listen(this._elementRef.nativeElement,"wheel",this._webkitBlinkWheelListener))}_getReadonlyAttribute(){return this._isNativeSelect?null:this.readonly||this.disabled&&this.disabledInteractive?"true":null}static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-mdc-input-element"],hostVars:21,hostBindings:function(r,i){1&r&&Ve("focus",function(){return i._focusChanged(!0)})("blur",function(){return i._focusChanged(!1)})("input",function(){return i._onInput()}),2&r&&(Bo("id",i.id)("disabled",i.disabled&&!i.disabledInteractive)("required",i.required),Ke("name",i.name||null)("readonly",i._getReadonlyAttribute())("aria-disabled",i.disabled&&i.disabledInteractive?"true":null)("aria-invalid",i.empty&&i.required?null:i.errorState)("aria-required",i.required)("id",i.id),at("mat-input-server",i._isServer)("mat-mdc-form-field-textarea-control",i._isInFormField&&i._isTextarea)("mat-mdc-form-field-input-control",i._isInFormField)("mat-mdc-input-disabled-interactive",i.disabledInteractive)("mdc-text-field__input",i._isInFormField)("mat-mdc-native-select-inline",i._isInlineSelect()))},inputs:{disabled:"disabled",id:"id",placeholder:"placeholder",name:"name",required:"required",type:"type",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],value:"value",readonly:"readonly",disabledInteractive:[2,"disabledInteractive","disabledInteractive",_t]},exportAs:["matInput"],features:[$e([{provide:cR,useExisting:n}]),ei]})}return n})(),fR=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[gn,ng,ng,yTe,gn]})}return n})();const LW=["mat-button",""],VW=[[["",8,"material-icons",3,"iconPositionEnd",""],["mat-icon",3,"iconPositionEnd",""],["","matButtonIcon","",3,"iconPositionEnd",""]],"*",[["","iconPositionEnd","",8,"material-icons"],["mat-icon","iconPositionEnd",""],["","matButtonIcon","","iconPositionEnd",""]]],BW=[".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])","*",".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]"],UW="@media(forced-colors: active){.mat-mdc-button:not(.mdc-button--outlined),.mat-mdc-unelevated-button:not(.mdc-button--outlined),.mat-mdc-raised-button:not(.mdc-button--outlined),.mat-mdc-outlined-button:not(.mdc-button--outlined),.mat-mdc-icon-button.mat-mdc-icon-button{outline:solid 1px}}",ITe=["mat-icon-button",""],TTe=["*"],CTe=new B("MAT_BUTTON_CONFIG"),xTe=[{attribute:"mat-button",mdcClasses:["mdc-button","mat-mdc-button"]},{attribute:"mat-flat-button",mdcClasses:["mdc-button","mdc-button--unelevated","mat-mdc-unelevated-button"]},{attribute:"mat-raised-button",mdcClasses:["mdc-button","mdc-button--raised","mat-mdc-raised-button"]},{attribute:"mat-stroked-button",mdcClasses:["mdc-button","mdc-button--outlined","mat-mdc-outlined-button"]},{attribute:"mat-fab",mdcClasses:["mdc-fab","mat-mdc-fab-base","mat-mdc-fab"]},{attribute:"mat-mini-fab",mdcClasses:["mdc-fab","mat-mdc-fab-base","mdc-fab--mini","mat-mdc-mini-fab"]},{attribute:"mat-icon-button",mdcClasses:["mdc-icon-button","mat-mdc-icon-button"]}];let pR=(()=>{class n{_elementRef=b(je);_ngZone=b(ue);_animationMode=b(Ts,{optional:!0});_focusMonitor=b(ZA);_rippleLoader=b(IW);_isFab=!1;color;get disableRipple(){return this._disableRipple}set disableRipple(t){this._disableRipple=t,this._updateRippleDisabled()}_disableRipple=!1;get disabled(){return this._disabled}set disabled(t){this._disabled=t,this._updateRippleDisabled()}_disabled=!1;ariaDisabled;disabledInteractive;constructor(){b(Ka).load(nR);const t=b(CTe,{optional:!0}),r=this._elementRef.nativeElement,i=r.classList;this.disabledInteractive=t?.disabledInteractive??!1,this.color=t?.color??null,this._rippleLoader?.configureRipple(r,{className:"mat-mdc-button-ripple"});for(const{attribute:o,mdcClasses:s}of xTe)r.hasAttribute(o)&&i.add(...s)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._rippleLoader?.destroyRipple(this._elementRef.nativeElement)}focus(t="program",r){t?this._focusMonitor.focusVia(this._elementRef.nativeElement,t,r):this._elementRef.nativeElement.focus(r)}_getAriaDisabled(){return null!=this.ariaDisabled?this.ariaDisabled:!(!this.disabled||!this.disabledInteractive)||null}_getDisabledAttribute(){return!(this.disabledInteractive||!this.disabled)||null}_updateRippleDisabled(){this._rippleLoader?.setDisabled(this._elementRef.nativeElement,this.disableRipple||this.disabled)}static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,inputs:{color:"color",disableRipple:[2,"disableRipple","disableRipple",_t],disabled:[2,"disabled","disabled",_t],ariaDisabled:[2,"aria-disabled","ariaDisabled",_t],disabledInteractive:[2,"disabledInteractive","disabledInteractive",_t]}})}return n})(),STe=(()=>{class n extends pR{_renderer=b(Ti);_cleanupClick;tabIndex;ngOnInit(){this._ngZone.runOutsideAngular(()=>{this._cleanupClick=this._renderer.listen(this._elementRef.nativeElement,"click",this._haltDisabledEvents)})}ngOnDestroy(){super.ngOnDestroy(),this._cleanupClick?.()}_haltDisabledEvents=t=>{this.disabled&&(t.preventDefault(),t.stopImmediatePropagation())};_getAriaDisabled(){return null!=this.ariaDisabled?this.ariaDisabled:this.disabled||null}static \u0275fac=(()=>{let t;return function(i){return(t||(t=bt(n)))(i||n)}})();static \u0275dir=ee({type:n,inputs:{tabIndex:[2,"tabIndex","tabIndex",t=>null==t?void 0:$d(t)]},features:[ke]})}return n})(),dh=(()=>{class n extends pR{static \u0275fac=(()=>{let t;return function(i){return(t||(t=bt(n)))(i||n)}})();static \u0275cmp=He({type:n,selectors:[["button","mat-button",""],["button","mat-raised-button",""],["button","mat-flat-button",""],["button","mat-stroked-button",""]],hostVars:14,hostBindings:function(r,i){2&r&&(Ke("disabled",i._getDisabledAttribute())("aria-disabled",i._getAriaDisabled()),Fa(i.color?"mat-"+i.color:""),at("mat-mdc-button-disabled",i.disabled)("mat-mdc-button-disabled-interactive",i.disabledInteractive)("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-unthemed",!i.color)("mat-mdc-button-base",!0))},exportAs:["matButton"],features:[ke],attrs:LW,ngContentSelectors:BW,decls:7,vars:4,consts:[[1,"mat-mdc-button-persistent-ripple"],[1,"mdc-button__label"],[1,"mat-focus-indicator"],[1,"mat-mdc-button-touch-target"]],template:function(r,i){1&r&&(Hn(VW),Pe(0,"span",0),Ae(1),W(2,"span",1),Ae(3,1),K(),Ae(4,2),Pe(5,"span",2)(6,"span",3)),2&r&&at("mdc-button__ripple",!i._isFab)("mdc-fab__ripple",i._isFab)},styles:['.mat-mdc-button-base{text-decoration:none}.mdc-button{-webkit-user-select:none;user-select:none;position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:64px;border:none;outline:none;line-height:inherit;-webkit-appearance:none;overflow:visible;vertical-align:middle;background:rgba(0,0,0,0);padding:0 8px}.mdc-button::-moz-focus-inner{padding:0;border:0}.mdc-button:active{outline:none}.mdc-button:hover{cursor:pointer}.mdc-button:disabled{cursor:default;pointer-events:none}.mdc-button[hidden]{display:none}.mdc-button .mdc-button__label{position:relative}.mat-mdc-button{padding:0 var(--mat-text-button-horizontal-padding, 12px);height:var(--mdc-text-button-container-height, 40px);font-family:var(--mdc-text-button-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-text-button-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mdc-text-button-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mdc-text-button-label-text-transform);font-weight:var(--mdc-text-button-label-text-weight, var(--mat-sys-label-large-weight))}.mat-mdc-button,.mat-mdc-button .mdc-button__ripple{border-radius:var(--mdc-text-button-container-shape, var(--mat-sys-corner-full))}.mat-mdc-button:not(:disabled){color:var(--mdc-text-button-label-text-color, var(--mat-sys-primary))}.mat-mdc-button[disabled],.mat-mdc-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-text-button-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-button:has(.material-icons,mat-icon,[matButtonIcon]){padding:0 var(--mat-text-button-with-icon-horizontal-padding, 16px)}.mat-mdc-button>.mat-icon{margin-right:var(--mat-text-button-icon-spacing, 8px);margin-left:var(--mat-text-button-icon-offset, -4px)}[dir=rtl] .mat-mdc-button>.mat-icon{margin-right:var(--mat-text-button-icon-offset, -4px);margin-left:var(--mat-text-button-icon-spacing, 8px)}.mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-text-button-icon-offset, -4px);margin-left:var(--mat-text-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-text-button-icon-spacing, 8px);margin-left:var(--mat-text-button-icon-offset, -4px)}.mat-mdc-button .mat-ripple-element{background-color:var(--mat-text-button-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-text-button-state-layer-color, var(--mat-sys-primary))}.mat-mdc-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-text-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-text-button-touch-target-display, block)}.mat-mdc-unelevated-button{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mdc-filled-button-container-height, 40px);font-family:var(--mdc-filled-button-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-filled-button-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mdc-filled-button-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mdc-filled-button-label-text-transform);font-weight:var(--mdc-filled-button-label-text-weight, var(--mat-sys-label-large-weight));padding:0 var(--mat-filled-button-horizontal-padding, 24px)}.mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-filled-button-icon-spacing, 8px);margin-left:var(--mat-filled-button-icon-offset, -8px)}[dir=rtl] .mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-filled-button-icon-offset, -8px);margin-left:var(--mat-filled-button-icon-spacing, 8px)}.mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-filled-button-icon-offset, -8px);margin-left:var(--mat-filled-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-filled-button-icon-spacing, 8px);margin-left:var(--mat-filled-button-icon-offset, -8px)}.mat-mdc-unelevated-button .mat-ripple-element{background-color:var(--mat-filled-button-ripple-color, color-mix(in srgb, var(--mat-sys-on-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-filled-button-state-layer-color, var(--mat-sys-on-primary))}.mat-mdc-unelevated-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-filled-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-unelevated-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-unelevated-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-unelevated-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-unelevated-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-filled-button-touch-target-display, block)}.mat-mdc-unelevated-button:not(:disabled){color:var(--mdc-filled-button-label-text-color, var(--mat-sys-on-primary));background-color:var(--mdc-filled-button-container-color, var(--mat-sys-primary))}.mat-mdc-unelevated-button,.mat-mdc-unelevated-button .mdc-button__ripple{border-radius:var(--mdc-filled-button-container-shape, var(--mat-sys-corner-full))}.mat-mdc-unelevated-button[disabled],.mat-mdc-unelevated-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-filled-button-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mdc-filled-button-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-raised-button{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);box-shadow:var(--mdc-protected-button-container-elevation-shadow, var(--mat-sys-level1));height:var(--mdc-protected-button-container-height, 40px);font-family:var(--mdc-protected-button-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-protected-button-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mdc-protected-button-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mdc-protected-button-label-text-transform);font-weight:var(--mdc-protected-button-label-text-weight, var(--mat-sys-label-large-weight));padding:0 var(--mat-protected-button-horizontal-padding, 24px)}.mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-protected-button-icon-spacing, 8px);margin-left:var(--mat-protected-button-icon-offset, -8px)}[dir=rtl] .mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-protected-button-icon-offset, -8px);margin-left:var(--mat-protected-button-icon-spacing, 8px)}.mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-protected-button-icon-offset, -8px);margin-left:var(--mat-protected-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-protected-button-icon-spacing, 8px);margin-left:var(--mat-protected-button-icon-offset, -8px)}.mat-mdc-raised-button .mat-ripple-element{background-color:var(--mat-protected-button-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-protected-button-state-layer-color, var(--mat-sys-primary))}.mat-mdc-raised-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-protected-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-raised-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-raised-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-raised-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-raised-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-protected-button-touch-target-display, block)}.mat-mdc-raised-button:not(:disabled){color:var(--mdc-protected-button-label-text-color, var(--mat-sys-primary));background-color:var(--mdc-protected-button-container-color, var(--mat-sys-surface))}.mat-mdc-raised-button,.mat-mdc-raised-button .mdc-button__ripple{border-radius:var(--mdc-protected-button-container-shape, var(--mat-sys-corner-full))}.mat-mdc-raised-button:hover{box-shadow:var(--mdc-protected-button-hover-container-elevation-shadow, var(--mat-sys-level2))}.mat-mdc-raised-button:focus{box-shadow:var(--mdc-protected-button-focus-container-elevation-shadow, var(--mat-sys-level1))}.mat-mdc-raised-button:active,.mat-mdc-raised-button:focus:active{box-shadow:var(--mdc-protected-button-pressed-container-elevation-shadow, var(--mat-sys-level1))}.mat-mdc-raised-button[disabled],.mat-mdc-raised-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-protected-button-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mdc-protected-button-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-raised-button[disabled].mat-mdc-button-disabled,.mat-mdc-raised-button.mat-mdc-button-disabled.mat-mdc-button-disabled{box-shadow:var(--mdc-protected-button-disabled-container-elevation-shadow, var(--mat-sys-level0))}.mat-mdc-raised-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-outlined-button{border-style:solid;transition:border 280ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mdc-outlined-button-container-height, 40px);font-family:var(--mdc-outlined-button-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-outlined-button-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mdc-outlined-button-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mdc-outlined-button-label-text-transform);font-weight:var(--mdc-outlined-button-label-text-weight, var(--mat-sys-label-large-weight));border-radius:var(--mdc-outlined-button-container-shape, var(--mat-sys-corner-full));border-width:var(--mdc-outlined-button-outline-width, 1px);padding:0 var(--mat-outlined-button-horizontal-padding, 24px)}.mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-outlined-button-icon-spacing, 8px);margin-left:var(--mat-outlined-button-icon-offset, -8px)}[dir=rtl] .mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-outlined-button-icon-offset, -8px);margin-left:var(--mat-outlined-button-icon-spacing, 8px)}.mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-outlined-button-icon-offset, -8px);margin-left:var(--mat-outlined-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-outlined-button-icon-spacing, 8px);margin-left:var(--mat-outlined-button-icon-offset, -8px)}.mat-mdc-outlined-button .mat-ripple-element{background-color:var(--mat-outlined-button-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-outlined-button-state-layer-color, var(--mat-sys-primary))}.mat-mdc-outlined-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-outlined-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-outlined-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-outlined-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-outlined-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-outlined-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-outlined-button-touch-target-display, block)}.mat-mdc-outlined-button:not(:disabled){color:var(--mdc-outlined-button-label-text-color, var(--mat-sys-primary));border-color:var(--mdc-outlined-button-outline-color, var(--mat-sys-outline))}.mat-mdc-outlined-button[disabled],.mat-mdc-outlined-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-outlined-button-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:var(--mdc-outlined-button-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-outlined-button .mdc-button__ripple{border-width:var(--mdc-outlined-button-outline-width, 1px);border-style:solid;border-color:rgba(0,0,0,0)}.mat-mdc-button,.mat-mdc-unelevated-button,.mat-mdc-raised-button,.mat-mdc-outlined-button{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-button .mdc-button__label,.mat-mdc-button .mat-icon,.mat-mdc-unelevated-button .mdc-button__label,.mat-mdc-unelevated-button .mat-icon,.mat-mdc-raised-button .mdc-button__label,.mat-mdc-raised-button .mat-icon,.mat-mdc-outlined-button .mdc-button__label,.mat-mdc-outlined-button .mat-icon{z-index:1;position:relative}.mat-mdc-button .mat-focus-indicator,.mat-mdc-unelevated-button .mat-focus-indicator,.mat-mdc-raised-button .mat-focus-indicator,.mat-mdc-outlined-button .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-button:focus>.mat-focus-indicator::before,.mat-mdc-unelevated-button:focus>.mat-focus-indicator::before,.mat-mdc-raised-button:focus>.mat-focus-indicator::before,.mat-mdc-outlined-button:focus>.mat-focus-indicator::before{content:""}.mat-mdc-button._mat-animation-noopable,.mat-mdc-unelevated-button._mat-animation-noopable,.mat-mdc-raised-button._mat-animation-noopable,.mat-mdc-outlined-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-button>.mat-icon,.mat-mdc-unelevated-button>.mat-icon,.mat-mdc-raised-button>.mat-icon,.mat-mdc-outlined-button>.mat-icon{display:inline-block;position:relative;vertical-align:top;font-size:1.125rem;height:1.125rem;width:1.125rem}.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mdc-button__ripple{top:-1px;left:-1px;bottom:-1px;right:-1px}.mat-mdc-unelevated-button .mat-focus-indicator::before,.mat-mdc-raised-button .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-outlined-button .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 3px)*-1)}',"@media(forced-colors: active){.mat-mdc-button:not(.mdc-button--outlined),.mat-mdc-unelevated-button:not(.mdc-button--outlined),.mat-mdc-raised-button:not(.mdc-button--outlined),.mat-mdc-outlined-button:not(.mdc-button--outlined),.mat-mdc-icon-button.mat-mdc-icon-button{outline:solid 1px}}"],encapsulation:2,changeDetection:0})}return n})(),zW=(()=>{class n extends STe{static \u0275fac=(()=>{let t;return function(i){return(t||(t=bt(n)))(i||n)}})();static \u0275cmp=He({type:n,selectors:[["a","mat-button",""],["a","mat-raised-button",""],["a","mat-flat-button",""],["a","mat-stroked-button",""]],hostVars:15,hostBindings:function(r,i){2&r&&(Ke("disabled",i._getDisabledAttribute())("tabindex",i.disabled&&!i.disabledInteractive?-1:i.tabIndex)("aria-disabled",i._getAriaDisabled()),Fa(i.color?"mat-"+i.color:""),at("mat-mdc-button-disabled",i.disabled)("mat-mdc-button-disabled-interactive",i.disabledInteractive)("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-unthemed",!i.color)("mat-mdc-button-base",!0))},exportAs:["matButton","matAnchor"],features:[ke],attrs:LW,ngContentSelectors:BW,decls:7,vars:4,consts:[[1,"mat-mdc-button-persistent-ripple"],[1,"mdc-button__label"],[1,"mat-focus-indicator"],[1,"mat-mdc-button-touch-target"]],template:function(r,i){1&r&&(Hn(VW),Pe(0,"span",0),Ae(1),W(2,"span",1),Ae(3,1),K(),Ae(4,2),Pe(5,"span",2)(6,"span",3)),2&r&&at("mdc-button__ripple",!i._isFab)("mdc-fab__ripple",i._isFab)},styles:['.mat-mdc-button-base{text-decoration:none}.mdc-button{-webkit-user-select:none;user-select:none;position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:64px;border:none;outline:none;line-height:inherit;-webkit-appearance:none;overflow:visible;vertical-align:middle;background:rgba(0,0,0,0);padding:0 8px}.mdc-button::-moz-focus-inner{padding:0;border:0}.mdc-button:active{outline:none}.mdc-button:hover{cursor:pointer}.mdc-button:disabled{cursor:default;pointer-events:none}.mdc-button[hidden]{display:none}.mdc-button .mdc-button__label{position:relative}.mat-mdc-button{padding:0 var(--mat-text-button-horizontal-padding, 12px);height:var(--mdc-text-button-container-height, 40px);font-family:var(--mdc-text-button-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-text-button-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mdc-text-button-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mdc-text-button-label-text-transform);font-weight:var(--mdc-text-button-label-text-weight, var(--mat-sys-label-large-weight))}.mat-mdc-button,.mat-mdc-button .mdc-button__ripple{border-radius:var(--mdc-text-button-container-shape, var(--mat-sys-corner-full))}.mat-mdc-button:not(:disabled){color:var(--mdc-text-button-label-text-color, var(--mat-sys-primary))}.mat-mdc-button[disabled],.mat-mdc-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-text-button-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-button:has(.material-icons,mat-icon,[matButtonIcon]){padding:0 var(--mat-text-button-with-icon-horizontal-padding, 16px)}.mat-mdc-button>.mat-icon{margin-right:var(--mat-text-button-icon-spacing, 8px);margin-left:var(--mat-text-button-icon-offset, -4px)}[dir=rtl] .mat-mdc-button>.mat-icon{margin-right:var(--mat-text-button-icon-offset, -4px);margin-left:var(--mat-text-button-icon-spacing, 8px)}.mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-text-button-icon-offset, -4px);margin-left:var(--mat-text-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-text-button-icon-spacing, 8px);margin-left:var(--mat-text-button-icon-offset, -4px)}.mat-mdc-button .mat-ripple-element{background-color:var(--mat-text-button-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-text-button-state-layer-color, var(--mat-sys-primary))}.mat-mdc-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-text-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-text-button-touch-target-display, block)}.mat-mdc-unelevated-button{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mdc-filled-button-container-height, 40px);font-family:var(--mdc-filled-button-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-filled-button-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mdc-filled-button-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mdc-filled-button-label-text-transform);font-weight:var(--mdc-filled-button-label-text-weight, var(--mat-sys-label-large-weight));padding:0 var(--mat-filled-button-horizontal-padding, 24px)}.mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-filled-button-icon-spacing, 8px);margin-left:var(--mat-filled-button-icon-offset, -8px)}[dir=rtl] .mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-filled-button-icon-offset, -8px);margin-left:var(--mat-filled-button-icon-spacing, 8px)}.mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-filled-button-icon-offset, -8px);margin-left:var(--mat-filled-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-filled-button-icon-spacing, 8px);margin-left:var(--mat-filled-button-icon-offset, -8px)}.mat-mdc-unelevated-button .mat-ripple-element{background-color:var(--mat-filled-button-ripple-color, color-mix(in srgb, var(--mat-sys-on-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-filled-button-state-layer-color, var(--mat-sys-on-primary))}.mat-mdc-unelevated-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-filled-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-unelevated-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-unelevated-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-unelevated-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-unelevated-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-filled-button-touch-target-display, block)}.mat-mdc-unelevated-button:not(:disabled){color:var(--mdc-filled-button-label-text-color, var(--mat-sys-on-primary));background-color:var(--mdc-filled-button-container-color, var(--mat-sys-primary))}.mat-mdc-unelevated-button,.mat-mdc-unelevated-button .mdc-button__ripple{border-radius:var(--mdc-filled-button-container-shape, var(--mat-sys-corner-full))}.mat-mdc-unelevated-button[disabled],.mat-mdc-unelevated-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-filled-button-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mdc-filled-button-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-raised-button{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);box-shadow:var(--mdc-protected-button-container-elevation-shadow, var(--mat-sys-level1));height:var(--mdc-protected-button-container-height, 40px);font-family:var(--mdc-protected-button-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-protected-button-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mdc-protected-button-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mdc-protected-button-label-text-transform);font-weight:var(--mdc-protected-button-label-text-weight, var(--mat-sys-label-large-weight));padding:0 var(--mat-protected-button-horizontal-padding, 24px)}.mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-protected-button-icon-spacing, 8px);margin-left:var(--mat-protected-button-icon-offset, -8px)}[dir=rtl] .mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-protected-button-icon-offset, -8px);margin-left:var(--mat-protected-button-icon-spacing, 8px)}.mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-protected-button-icon-offset, -8px);margin-left:var(--mat-protected-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-protected-button-icon-spacing, 8px);margin-left:var(--mat-protected-button-icon-offset, -8px)}.mat-mdc-raised-button .mat-ripple-element{background-color:var(--mat-protected-button-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-protected-button-state-layer-color, var(--mat-sys-primary))}.mat-mdc-raised-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-protected-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-raised-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-raised-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-raised-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-raised-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-protected-button-touch-target-display, block)}.mat-mdc-raised-button:not(:disabled){color:var(--mdc-protected-button-label-text-color, var(--mat-sys-primary));background-color:var(--mdc-protected-button-container-color, var(--mat-sys-surface))}.mat-mdc-raised-button,.mat-mdc-raised-button .mdc-button__ripple{border-radius:var(--mdc-protected-button-container-shape, var(--mat-sys-corner-full))}.mat-mdc-raised-button:hover{box-shadow:var(--mdc-protected-button-hover-container-elevation-shadow, var(--mat-sys-level2))}.mat-mdc-raised-button:focus{box-shadow:var(--mdc-protected-button-focus-container-elevation-shadow, var(--mat-sys-level1))}.mat-mdc-raised-button:active,.mat-mdc-raised-button:focus:active{box-shadow:var(--mdc-protected-button-pressed-container-elevation-shadow, var(--mat-sys-level1))}.mat-mdc-raised-button[disabled],.mat-mdc-raised-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-protected-button-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mdc-protected-button-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-raised-button[disabled].mat-mdc-button-disabled,.mat-mdc-raised-button.mat-mdc-button-disabled.mat-mdc-button-disabled{box-shadow:var(--mdc-protected-button-disabled-container-elevation-shadow, var(--mat-sys-level0))}.mat-mdc-raised-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-outlined-button{border-style:solid;transition:border 280ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mdc-outlined-button-container-height, 40px);font-family:var(--mdc-outlined-button-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-outlined-button-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mdc-outlined-button-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mdc-outlined-button-label-text-transform);font-weight:var(--mdc-outlined-button-label-text-weight, var(--mat-sys-label-large-weight));border-radius:var(--mdc-outlined-button-container-shape, var(--mat-sys-corner-full));border-width:var(--mdc-outlined-button-outline-width, 1px);padding:0 var(--mat-outlined-button-horizontal-padding, 24px)}.mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-outlined-button-icon-spacing, 8px);margin-left:var(--mat-outlined-button-icon-offset, -8px)}[dir=rtl] .mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-outlined-button-icon-offset, -8px);margin-left:var(--mat-outlined-button-icon-spacing, 8px)}.mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-outlined-button-icon-offset, -8px);margin-left:var(--mat-outlined-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-outlined-button-icon-spacing, 8px);margin-left:var(--mat-outlined-button-icon-offset, -8px)}.mat-mdc-outlined-button .mat-ripple-element{background-color:var(--mat-outlined-button-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-outlined-button-state-layer-color, var(--mat-sys-primary))}.mat-mdc-outlined-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-outlined-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-outlined-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-outlined-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-outlined-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-outlined-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-outlined-button-touch-target-display, block)}.mat-mdc-outlined-button:not(:disabled){color:var(--mdc-outlined-button-label-text-color, var(--mat-sys-primary));border-color:var(--mdc-outlined-button-outline-color, var(--mat-sys-outline))}.mat-mdc-outlined-button[disabled],.mat-mdc-outlined-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-outlined-button-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:var(--mdc-outlined-button-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-outlined-button .mdc-button__ripple{border-width:var(--mdc-outlined-button-outline-width, 1px);border-style:solid;border-color:rgba(0,0,0,0)}.mat-mdc-button,.mat-mdc-unelevated-button,.mat-mdc-raised-button,.mat-mdc-outlined-button{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-button .mdc-button__label,.mat-mdc-button .mat-icon,.mat-mdc-unelevated-button .mdc-button__label,.mat-mdc-unelevated-button .mat-icon,.mat-mdc-raised-button .mdc-button__label,.mat-mdc-raised-button .mat-icon,.mat-mdc-outlined-button .mdc-button__label,.mat-mdc-outlined-button .mat-icon{z-index:1;position:relative}.mat-mdc-button .mat-focus-indicator,.mat-mdc-unelevated-button .mat-focus-indicator,.mat-mdc-raised-button .mat-focus-indicator,.mat-mdc-outlined-button .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-button:focus>.mat-focus-indicator::before,.mat-mdc-unelevated-button:focus>.mat-focus-indicator::before,.mat-mdc-raised-button:focus>.mat-focus-indicator::before,.mat-mdc-outlined-button:focus>.mat-focus-indicator::before{content:""}.mat-mdc-button._mat-animation-noopable,.mat-mdc-unelevated-button._mat-animation-noopable,.mat-mdc-raised-button._mat-animation-noopable,.mat-mdc-outlined-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-button>.mat-icon,.mat-mdc-unelevated-button>.mat-icon,.mat-mdc-raised-button>.mat-icon,.mat-mdc-outlined-button>.mat-icon{display:inline-block;position:relative;vertical-align:top;font-size:1.125rem;height:1.125rem;width:1.125rem}.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mdc-button__ripple{top:-1px;left:-1px;bottom:-1px;right:-1px}.mat-mdc-unelevated-button .mat-focus-indicator::before,.mat-mdc-raised-button .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-outlined-button .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 3px)*-1)}',UW],encapsulation:2,changeDetection:0})}return n})(),ATe=(()=>{class n extends pR{constructor(){super(),this._rippleLoader.configureRipple(this._elementRef.nativeElement,{centered:!0})}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["button","mat-icon-button",""]],hostVars:14,hostBindings:function(r,i){2&r&&(Ke("disabled",i._getDisabledAttribute())("aria-disabled",i._getAriaDisabled()),Fa(i.color?"mat-"+i.color:""),at("mat-mdc-button-disabled",i.disabled)("mat-mdc-button-disabled-interactive",i.disabledInteractive)("_mat-animation-noopable","NoopAnimations"===i._animationMode)("mat-unthemed",!i.color)("mat-mdc-button-base",!0))},exportAs:["matButton"],features:[ke],attrs:ITe,ngContentSelectors:TTe,decls:4,vars:0,consts:[[1,"mat-mdc-button-persistent-ripple","mdc-icon-button__ripple"],[1,"mat-focus-indicator"],[1,"mat-mdc-button-touch-target"]],template:function(r,i){1&r&&(Hn(),Pe(0,"span",0),Ae(1),Pe(2,"span",1)(3,"span",2))},styles:['.mat-mdc-icon-button{-webkit-user-select:none;user-select:none;display:inline-block;position:relative;box-sizing:border-box;border:none;outline:none;background-color:rgba(0,0,0,0);fill:currentColor;color:inherit;text-decoration:none;cursor:pointer;z-index:0;overflow:visible;border-radius:50%;flex-shrink:0;text-align:center;width:var(--mdc-icon-button-state-layer-size, 40px);height:var(--mdc-icon-button-state-layer-size, 40px);padding:calc(calc(var(--mdc-icon-button-state-layer-size, 40px) - var(--mdc-icon-button-icon-size, 24px)) / 2);font-size:var(--mdc-icon-button-icon-size, 24px);color:var(--mdc-icon-button-icon-color, var(--mat-sys-on-surface-variant));-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-icon-button .mat-mdc-button-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-icon-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-icon-button .mdc-button__label,.mat-mdc-icon-button .mat-icon{z-index:1;position:relative}.mat-mdc-icon-button .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-icon-button:focus>.mat-focus-indicator::before{content:""}.mat-mdc-icon-button .mat-ripple-element{background-color:var(--mat-icon-button-ripple-color, color-mix(in srgb, var(--mat-sys-on-surface-variant) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-icon-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-icon-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-icon-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-icon-button-touch-target-display, block)}.mat-mdc-icon-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-icon-button[disabled],.mat-mdc-icon-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-icon-button-disabled-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-icon-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-icon-button img,.mat-mdc-icon-button svg{width:var(--mdc-icon-button-icon-size, 24px);height:var(--mdc-icon-button-icon-size, 24px);vertical-align:baseline}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple{border-radius:50%}.mat-mdc-icon-button[hidden]{display:none}.mat-mdc-icon-button.mat-unthemed:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-primary:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-accent:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-warn:not(.mdc-ripple-upgraded):focus::before{background:rgba(0,0,0,0);opacity:1}',UW],encapsulation:2,changeDetection:0})}return n})(),hh=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[gn,vW,gn]})}return n})(),jW=(()=>{class n{get vertical(){return this._vertical}set vertical(t){this._vertical=Qa(t)}_vertical=!1;get inset(){return this._inset}set inset(t){this._inset=Qa(t)}_inset=!1;static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-divider"]],hostAttrs:["role","separator",1,"mat-divider"],hostVars:7,hostBindings:function(r,i){2&r&&(Ke("aria-orientation",i.vertical?"vertical":"horizontal"),at("mat-divider-vertical",i.vertical)("mat-divider-horizontal",!i.vertical)("mat-divider-inset",i.inset))},inputs:{vertical:"vertical",inset:"inset"},decls:0,vars:0,template:function(r,i){},styles:[".mat-divider{display:block;margin:0;border-top-style:solid;border-top-color:var(--mat-divider-color, var(--mat-sys-outline));border-top-width:var(--mat-divider-width, 1px)}.mat-divider.mat-divider-vertical{border-top:0;border-right-style:solid;border-right-color:var(--mat-divider-color, var(--mat-sys-outline));border-right-width:var(--mat-divider-width, 1px)}.mat-divider.mat-divider-inset{margin-left:80px}[dir=rtl] .mat-divider.mat-divider-inset{margin-left:auto;margin-right:80px}"],encapsulation:2,changeDetection:0})}return n})(),HW=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[gn,gn]})}return n})();const RTe=["determinateSpinner"];function MTe(n,e){if(1&n&&(tp(),W(0,"svg",11),Pe(1,"circle",12),K()),2&n){const t=Ln();Ke("viewBox",t._viewBox()),re(),Bd("stroke-dasharray",t._strokeCircumference(),"px")("stroke-dashoffset",t._strokeCircumference()/2,"px")("stroke-width",t._circleStrokeWidth(),"%"),Ke("r",t._circleRadius())}}const kTe=new B("mat-progress-spinner-default-options",{providedIn:"root",factory:function NTe(){return{diameter:$W}}}),$W=100;let OTe=(()=>{class n{_elementRef=b(je);_noopAnimations;get color(){return this._color||this._defaultColor}set color(t){this._color=t}_color;_defaultColor="primary";_determinateCircle;constructor(){const t=b(Ts,{optional:!0}),r=b(kTe);this._noopAnimations="NoopAnimations"===t&&!!r&&!r._forceAnimations,this.mode="mat-spinner"===this._elementRef.nativeElement.nodeName.toLowerCase()?"indeterminate":"determinate",r&&(r.color&&(this.color=this._defaultColor=r.color),r.diameter&&(this.diameter=r.diameter),r.strokeWidth&&(this.strokeWidth=r.strokeWidth))}mode;get value(){return"determinate"===this.mode?this._value:0}set value(t){this._value=Math.max(0,Math.min(100,t||0))}_value=0;get diameter(){return this._diameter}set diameter(t){this._diameter=t||0}_diameter=$W;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(t){this._strokeWidth=t||0}_strokeWidth;_circleRadius(){return(this.diameter-10)/2}_viewBox(){const t=2*this._circleRadius()+this.strokeWidth;return`0 0 ${t} ${t}`}_strokeCircumference(){return 2*Math.PI*this._circleRadius()}_strokeDashOffset(){return"determinate"===this.mode?this._strokeCircumference()*(100-this._value)/100:null}_circleStrokeWidth(){return this.strokeWidth/this.diameter*100}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(r,i){if(1&r&&qn(RTe,5),2&r){let o;Qe(o=Ye())&&(i._determinateCircle=o.first)}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(r,i){2&r&&(Ke("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow","determinate"===i.mode?i.value:null)("mode",i.mode),Fa("mat-"+i.color),Bd("width",i.diameter,"px")("height",i.diameter,"px")("--mdc-circular-progress-size",i.diameter+"px")("--mdc-circular-progress-active-indicator-width",i.diameter+"px"),at("_mat-animation-noopable",i._noopAnimations)("mdc-circular-progress--indeterminate","indeterminate"===i.mode))},inputs:{color:"color",mode:"mode",value:[2,"value","value",$d],diameter:[2,"diameter","diameter",$d],strokeWidth:[2,"strokeWidth","strokeWidth",$d]},exportAs:["matProgressSpinner"],decls:14,vars:11,consts:[["circle",""],["determinateSpinner",""],["aria-hidden","true",1,"mdc-circular-progress__determinate-container"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__determinate-circle-graphic"],["cx","50%","cy","50%",1,"mdc-circular-progress__determinate-circle"],["aria-hidden","true",1,"mdc-circular-progress__indeterminate-container"],[1,"mdc-circular-progress__spinner-layer"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-left"],[3,"ngTemplateOutlet"],[1,"mdc-circular-progress__gap-patch"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-right"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__indeterminate-circle-graphic"],["cx","50%","cy","50%"]],template:function(r,i){if(1&r&&(et(0,MTe,2,8,"ng-template",null,0,tD),W(2,"div",2,1),tp(),W(4,"svg",3),Pe(5,"circle",4),K()(),_0(),W(6,"div",5)(7,"div",6)(8,"div",7),Xp(9,8),K(),W(10,"div",9),Xp(11,8),K(),W(12,"div",10),Xp(13,8),K()()()),2&r){const o=rm(1);re(4),Ke("viewBox",i._viewBox()),re(),Bd("stroke-dasharray",i._strokeCircumference(),"px")("stroke-dashoffset",i._strokeDashOffset(),"px")("stroke-width",i._circleStrokeWidth(),"%"),Ke("r",i._circleRadius()),re(4),De("ngTemplateOutlet",o),re(2),De("ngTemplateOutlet",o),re(2),De("ngTemplateOutlet",o)}},dependencies:[ND],styles:[".mat-mdc-progress-spinner{display:block;overflow:hidden;line-height:0;position:relative;direction:ltr;transition:opacity 250ms cubic-bezier(0.4, 0, 0.6, 1)}.mat-mdc-progress-spinner circle{stroke-width:var(--mdc-circular-progress-active-indicator-width, 4px)}.mat-mdc-progress-spinner._mat-animation-noopable,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__determinate-circle{transition:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__spinner-layer,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container{animation:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container circle{stroke-dasharray:0 !important}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle{stroke:currentColor;stroke:CanvasText}}.mdc-circular-progress__determinate-container,.mdc-circular-progress__indeterminate-circle-graphic,.mdc-circular-progress__indeterminate-container,.mdc-circular-progress__spinner-layer{position:absolute;width:100%;height:100%}.mdc-circular-progress__determinate-container{transform:rotate(-90deg)}.mdc-circular-progress--indeterminate .mdc-circular-progress__determinate-container{opacity:0}.mdc-circular-progress__indeterminate-container{font-size:0;letter-spacing:0;white-space:nowrap;opacity:0}.mdc-circular-progress--indeterminate .mdc-circular-progress__indeterminate-container{opacity:1;animation:mdc-circular-progress-container-rotate 1568.2352941176ms linear infinite}.mdc-circular-progress__determinate-circle-graphic,.mdc-circular-progress__indeterminate-circle-graphic{fill:rgba(0,0,0,0)}.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:var(--mdc-circular-progress-active-indicator-color, var(--mat-sys-primary))}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:CanvasText}}.mdc-circular-progress__determinate-circle{transition:stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1)}.mdc-circular-progress__gap-patch{position:absolute;top:0;left:47.5%;box-sizing:border-box;width:5%;height:100%;overflow:hidden}.mdc-circular-progress__gap-patch .mdc-circular-progress__indeterminate-circle-graphic{left:-900%;width:2000%;transform:rotate(180deg)}.mdc-circular-progress__circle-clipper .mdc-circular-progress__indeterminate-circle-graphic{width:200%}.mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{left:-100%}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-left .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-left-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-right-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress__circle-clipper{display:inline-flex;position:relative;width:50%;height:100%;overflow:hidden}.mdc-circular-progress--indeterminate .mdc-circular-progress__spinner-layer{animation:mdc-circular-progress-spinner-layer-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}@keyframes mdc-circular-progress-container-rotate{to{transform:rotate(360deg)}}@keyframes mdc-circular-progress-spinner-layer-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes mdc-circular-progress-left-spin{from{transform:rotate(265deg)}50%{transform:rotate(130deg)}to{transform:rotate(265deg)}}@keyframes mdc-circular-progress-right-spin{from{transform:rotate(-265deg)}50%{transform:rotate(-130deg)}to{transform:rotate(-265deg)}}"],encapsulation:2,changeDetection:0})}return n})(),qW=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[gn]})}return n})();const WW=function(n){const e=[];let t=0;for(let r=0;r>6|192,e[t++]=63&i|128):55296==(64512&i)&&r+1>18|240,e[t++]=i>>12&63|128,e[t++]=i>>6&63|128,e[t++]=63&i|128):(e[t++]=i>>12|224,e[t++]=i>>6&63|128,e[t++]=63&i|128)}return e},gR={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();const t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i>6,p=63&c;l||(p=64,s||(f=64)),r.push(t[o>>2],t[(3&o)<<4|a>>4],t[f],t[p])}return r.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(WW(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):function(n){const e=[];let t=0,r=0;for(;t191&&i<224){const o=n[t++];e[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){const l=((7&i)<<18|(63&n[t++])<<12|(63&n[t++])<<6|63&n[t++])-65536;e[r++]=String.fromCharCode(55296+(l>>10)),e[r++]=String.fromCharCode(56320+(1023&l))}else{const o=n[t++],s=n[t++];e[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&s)}}return e.join("")}(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();const t=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i>4),64!==c&&(r.push(a<<4&240|c>>2),64!==d&&r.push(c<<6&192|d))}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}};class BTe extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const nE=function(n){return function(n){const e=WW(n);return gR.encodeByteArray(e,!0)}(n).replace(/\./g,"")},rg=function(n){try{return gR.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null},rE=()=>{try{return function jTe(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}().__FIREBASE_DEFAULTS__||(()=>{if(typeof process>"u")return;const n="MISSING_ENV_VAR".__FIREBASE_DEFAULTS__;return n?JSON.parse(n):void 0})()||(()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=n&&rg(n[1]);return e&&JSON.parse(e)})()}catch(n){return void console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`)}},KW=n=>{var e,t;return null===(t=null===(e=rE())||void 0===e?void 0:e.emulatorHosts)||void 0===t?void 0:t[n]},QW=n=>{const e=KW(n);if(!e)return;const t=e.lastIndexOf(":");if(t<=0||t+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const r=parseInt(e.substring(t+1),10);return"["===e[0]?[e.substring(1,t-1),r]:[e.substring(0,t),r]},YW=()=>{var n;return null===(n=rE())||void 0===n?void 0:n.config},XW=n=>{var e;return null===(e=rE())||void 0===e?void 0:e[`_${n}`]};class iE{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,r)=>{t?this.reject(t):this.resolve(r),"function"==typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,r))}}}function ZW(n,e){if(n.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const r=e||"demo-project",i=n.iat||0,o=n.sub||n.user_id;if(!o)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const s=Object.assign({iss:`https://securetoken.google.com/${r}`,aud:r,iat:i,exp:i+3600,auth_time:i,sub:o,user_id:o,firebase:{sign_in_provider:"custom",identities:{}}},n);return[nE(JSON.stringify({alg:"none",type:"JWT"})),nE(JSON.stringify(s)),""].join(".")}function _n(){return typeof navigator<"u"&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function JW(){return!function GTe(){var n;const e=null===(n=rE())||void 0===n?void 0:n.forceEnvironment;if("node"===e)return!0;if("browser"===e)return!1;try{return"[object process]"===Object.prototype.toString.call(global.process)}catch{return!1}}()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function _R(){try{return"object"==typeof indexedDB}catch{return!1}}class Wo extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name="FirebaseError",Object.setPrototypeOf(this,Wo.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,fh.prototype.create)}}class fh{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){const r=t[0]||{},i=`${this.service}/${e}`,o=this.errors[e],s=o?function tCe(n,e){return n.replace(nCe,(t,r)=>{const i=e[r];return null!=i?String(i):`<${r}?>`})}(o,r):"Error";return new Wo(i,`${this.serviceName}: ${s} (${i}).`,r)}}const nCe=/\{\$([^}]+)}/g;function ph(n,e){if(n===e)return!0;const t=Object.keys(n),r=Object.keys(e);for(const i of t){if(!r.includes(i))return!1;const o=n[i],s=e[i];if(tG(o)&&tG(s)){if(!ph(o,s))return!1}else if(o!==s)return!1}for(const i of r)if(!t.includes(i))return!1;return!0}function tG(n){return null!==n&&"object"==typeof n}function ig(n){const e=[];for(const[t,r]of Object.entries(n))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function og(n){const e={};return n.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[i,o]=r.split("=");e[decodeURIComponent(i)]=decodeURIComponent(o)}}),e}function sg(n){const e=n.indexOf("?");if(!e)return"";const t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}class oCe{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,r){let i;if(void 0===e&&void 0===t&&void 0===r)throw new Error("Missing Observer.");i=function sCe(n,e){if("object"!=typeof n||null===n)return!1;for(const t of e)if(t in n&&"function"==typeof n[t])return!0;return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:r},void 0===i.next&&(i.next=yR),void 0===i.error&&(i.error=yR),void 0===i.complete&&(i.complete=yR);const o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),o}unsubscribeOne(e){void 0===this.observers||void 0===this.observers[e]||(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function yR(){}function sn(n){return n&&n._delegate?n._delegate:n}class Go{constructor(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}const Oc="[DEFAULT]";class hCe{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const r=new iE;if(this.instancesDeferred.set(t,r),this.isInitialized(t)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:t});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const r=this.normalizeInstanceIdentifier(e?.identifier),i=null!==(t=e?.optional)&&void 0!==t&&t;if(!this.isInitialized(r)&&!this.shouldAutoInitialize()){if(i)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:r})}catch(o){if(i)return null;throw o}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,this.shouldAutoInitialize()){if(function pCe(n){return"EAGER"===n.instantiationMode}(e))try{this.getOrInitializeService({instanceIdentifier:Oc})}catch{}for(const[t,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(t);try{const o=this.getOrInitializeService({instanceIdentifier:i});r.resolve(o)}catch{}}}}clearInstance(e=Oc){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}delete(){var e=this;return T(function*(){const t=Array.from(e.instances.values());yield Promise.all([...t.filter(r=>"INTERNAL"in r).map(r=>r.INTERNAL.delete()),...t.filter(r=>"_delete"in r).map(r=>r._delete())])})()}isComponentSet(){return null!=this.component}isInitialized(e=Oc){return this.instances.has(e)}getOptions(e=Oc){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:r,options:t});for(const[o,s]of this.instancesDeferred.entries())r===this.normalizeInstanceIdentifier(o)&&s.resolve(i);return i}onInit(e,t){var r;const i=this.normalizeInstanceIdentifier(t),o=null!==(r=this.onInitCallbacks.get(i))&&void 0!==r?r:new Set;o.add(e),this.onInitCallbacks.set(i,o);const s=this.instances.get(i);return s&&e(s,i),()=>{o.delete(e)}}invokeOnInitCallbacks(e,t){const r=this.onInitCallbacks.get(t);if(r)for(const i of r)try{i(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:(n=e,n===Oc?void 0:n),options:t}),this.instances.set(e,r),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}var n;return r||null}normalizeInstanceIdentifier(e=Oc){return this.component?this.component.multipleInstances?e:Oc:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class mCe{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new hCe(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}const bR=[];var qe=function(n){return n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT",n}(qe||{});const nG={debug:qe.DEBUG,verbose:qe.VERBOSE,info:qe.INFO,warn:qe.WARN,error:qe.ERROR,silent:qe.SILENT},gCe=qe.INFO,_Ce={[qe.DEBUG]:"log",[qe.VERBOSE]:"log",[qe.INFO]:"info",[qe.WARN]:"warn",[qe.ERROR]:"error"},yCe=(n,e,...t)=>{if(e(n[e]=t,!0),has:(n,e)=>n instanceof IDBTransaction&&("done"===e||"store"===e)||e in n};function xCe(n){return"function"==typeof n?function CCe(n){return n!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?function wCe(){return iG||(iG=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}().includes(n)?function(...e){return n.apply(CR(this),e),Za(oG.get(this))}:function(...e){return Za(n.apply(CR(this),e))}:function(e,...t){const r=n.call(CR(this),e,...t);return sG.set(r,e.sort?e.sort():[e]),Za(r)}}(n):(n instanceof IDBTransaction&&function ICe(n){if(wR.has(n))return;const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("complete",o),n.removeEventListener("error",s),n.removeEventListener("abort",s)},o=()=>{t(),i()},s=()=>{r(n.error||new DOMException("AbortError","AbortError")),i()};n.addEventListener("complete",o),n.addEventListener("error",s),n.addEventListener("abort",s)});wR.set(n,e)}(n),((n,e)=>e.some(t=>n instanceof t))(n,function bCe(){return rG||(rG=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}())?new Proxy(n,TR):n)}function Za(n){if(n instanceof IDBRequest)return function ECe(n){const e=new Promise((t,r)=>{const i=()=>{n.removeEventListener("success",o),n.removeEventListener("error",s)},o=()=>{t(Za(n.result)),i()},s=()=>{r(n.error),i()};n.addEventListener("success",o),n.addEventListener("error",s)});return e.then(t=>{t instanceof IDBCursor&&oG.set(t,n)}).catch(()=>{}),IR.set(e,n),e}(n);if(ER.has(n))return ER.get(n);const e=xCe(n);return e!==n&&(ER.set(n,e),IR.set(e,n)),e}const CR=n=>IR.get(n),DCe=["get","getKey","getAll","getAllKeys","count"],ACe=["put","add","delete","clear"],xR=new Map;function aG(n,e){if(!(n instanceof IDBDatabase)||e in n||"string"!=typeof e)return;if(xR.get(e))return xR.get(e);const t=e.replace(/FromIndex$/,""),r=e!==t,i=ACe.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!i&&!DCe.includes(t))return;const o=function(){var s=T(function*(a,...l){const c=this.transaction(a,i?"readwrite":"readonly");let u=c.store;return r&&(u=u.index(l.shift())),(yield Promise.all([u[t](...l),i&&c.done]))[0]});return function(l){return s.apply(this,arguments)}}();return xR.set(e,o),o}!function TCe(n){TR=n(TR)}(n=>({...n,get:(e,t,r)=>aG(e,t)||n.get(e,t,r),has:(e,t)=>!!aG(e,t)||n.has(e,t)}));class RCe{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(function MCe(n){const e=n.getComponent();return"VERSION"===e?.type}(t)){const r=t.getImmediate();return`${r.library}/${r.version}`}return null}).filter(t=>t).join(" ")}}const aE="@firebase/app",Os=new sE("@firebase/app"),kCe="@firebase/app-compat",NCe="@firebase/analytics-compat",PCe="@firebase/analytics",OCe="@firebase/app-check-compat",FCe="@firebase/app-check",LCe="@firebase/auth",VCe="@firebase/auth-compat",BCe="@firebase/database",UCe="@firebase/data-connect",zCe="@firebase/database-compat",jCe="@firebase/functions",HCe="@firebase/functions-compat",$Ce="@firebase/installations",qCe="@firebase/installations-compat",WCe="@firebase/messaging",GCe="@firebase/messaging-compat",KCe="@firebase/performance",QCe="@firebase/performance-compat",YCe="@firebase/remote-config",XCe="@firebase/remote-config-compat",ZCe="@firebase/storage",JCe="@firebase/storage-compat",e0e="@firebase/firestore",t0e="@firebase/vertexai",n0e="@firebase/firestore-compat",r0e="firebase",lE="[DEFAULT]",o0e={[aE]:"fire-core",[kCe]:"fire-core-compat",[PCe]:"fire-analytics",[NCe]:"fire-analytics-compat",[FCe]:"fire-app-check",[OCe]:"fire-app-check-compat",[LCe]:"fire-auth",[VCe]:"fire-auth-compat",[BCe]:"fire-rtdb",[UCe]:"fire-data-connect",[zCe]:"fire-rtdb-compat",[jCe]:"fire-fn",[HCe]:"fire-fn-compat",[$Ce]:"fire-iid",[qCe]:"fire-iid-compat",[WCe]:"fire-fcm",[GCe]:"fire-fcm-compat",[KCe]:"fire-perf",[QCe]:"fire-perf-compat",[YCe]:"fire-rc",[XCe]:"fire-rc-compat",[ZCe]:"fire-gcs",[JCe]:"fire-gcs-compat",[e0e]:"fire-fst",[n0e]:"fire-fst-compat",[t0e]:"fire-vertex","fire-js":"fire-js",[r0e]:"fire-js-all"},Fc=new Map,ag=new Map,lg=new Map;function lG(n,e){try{n.container.addComponent(e)}catch(t){Os.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function Fs(n){const e=n.name;if(lg.has(e))return Os.debug(`There were multiple attempts to register component ${e}.`),!1;lg.set(e,n);for(const t of Fc.values())lG(t,n);for(const t of ag.values())lG(t,n);return!0}function cg(n,e){const t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}function ai(n){return null!=n&&void 0!==n.settings}const Zi=new fh("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."});class cG{constructor(e,t,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new Go("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw Zi.create("app-deleted",{appName:this._name})}}const Lc="11.3.1";function dG(n,e={}){let t=n;"object"!=typeof e&&(e={name:e});const r=Object.assign({name:lE,automaticDataCollectionEnabled:!1},e),i=r.name;if("string"!=typeof i||!i)throw Zi.create("bad-app-name",{appName:String(i)});if(t||(t=YW()),!t)throw Zi.create("no-options");const o=Fc.get(i);if(o){if(ph(t,o.options)&&ph(r,o.config))return o;throw Zi.create("duplicate-app",{appName:i})}const s=new mCe(i);for(const l of lg.values())s.addComponent(l);const a=new cG(t,r,s);return Fc.set(i,a),a}function cE(n=lE){const e=Fc.get(n);if(!e&&n===lE&&YW())return dG();if(!e)throw Zi.create("no-app",{appName:n});return e}function hG(){return Array.from(Fc.values())}function Gn(n,e,t){var r;let i=null!==(r=o0e[n])&&void 0!==r?r:n;t&&(i+=`-${t}`);const o=i.match(/\s|\//),s=e.match(/\s|\//);if(o||s){const a=[`Unable to register library "${i}" with version "${e}":`];return o&&a.push(`library name "${i}" contains illegal characters (whitespace or "/")`),o&&s&&a.push("and"),s&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),void Os.warn(a.join(" "))}Fs(new Go(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}const ug="firebase-heartbeat-store";let AR=null;function fG(){return AR||(AR=function SCe(n,e,{blocked:t,upgrade:r,blocking:i,terminated:o}={}){const s=indexedDB.open(n,e),a=Za(s);return r&&s.addEventListener("upgradeneeded",l=>{r(Za(s.result),l.oldVersion,l.newVersion,Za(s.transaction),l)}),t&&s.addEventListener("blocked",l=>t(l.oldVersion,l.newVersion,l)),a.then(l=>{o&&l.addEventListener("close",()=>o()),i&&l.addEventListener("versionchange",c=>i(c.oldVersion,c.newVersion,c))}).catch(()=>{}),a}("firebase-heartbeat-database",1,{upgrade:(n,e)=>{if(0===e)try{n.createObjectStore(ug)}catch(t){console.warn(t)}}}).catch(n=>{throw Zi.create("idb-open",{originalErrorMessage:n.message})})),AR}function RR(){return(RR=T(function*(n){try{const t=(yield fG()).transaction(ug),r=yield t.objectStore(ug).get(mG(n));return yield t.done,r}catch(e){if(e instanceof Wo)Os.warn(e.message);else{const t=Zi.create("idb-get",{originalErrorMessage:e?.message});Os.warn(t.message)}}})).apply(this,arguments)}function pG(n,e){return MR.apply(this,arguments)}function MR(){return(MR=T(function*(n,e){try{const r=(yield fG()).transaction(ug,"readwrite");yield r.objectStore(ug).put(e,mG(n)),yield r.done}catch(t){if(t instanceof Wo)Os.warn(t.message);else{const r=Zi.create("idb-set",{originalErrorMessage:t?.message});Os.warn(r.message)}}})).apply(this,arguments)}function mG(n){return`${n.name}!${n.options.appId}`}class m0e{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new _0e(t),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}triggerHeartbeat(){var e=this;return T(function*(){var t,r;try{const o=e.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=gG();if(null==(null===(t=e._heartbeatsCache)||void 0===t?void 0:t.heartbeats)&&(e._heartbeatsCache=yield e._heartbeatsCachePromise,null==(null===(r=e._heartbeatsCache)||void 0===r?void 0:r.heartbeats))||e._heartbeatsCache.lastSentHeartbeatDate===s||e._heartbeatsCache.heartbeats.some(a=>a.date===s))return;if(e._heartbeatsCache.heartbeats.push({date:s,agent:o}),e._heartbeatsCache.heartbeats.length>30){const a=function y0e(n){if(0===n.length)return-1;let e=0,t=n[0].date;for(let r=1;rs.agent===i.agent);if(o){if(o.dates.push(i.date),_G(t)>e){o.dates.pop();break}}else if(t.push({agent:i.agent,dates:[i.date]}),_G(t)>e){t.pop();break}r=r.slice(1)}return{heartbeatsToSend:t,unsentEntries:r}}(e._heartbeatsCache.heartbeats),s=nE(JSON.stringify({version:2,heartbeats:i}));return e._heartbeatsCache.lastSentHeartbeatDate=r,o.length>0?(e._heartbeatsCache.heartbeats=o,yield e._storage.overwrite(e._heartbeatsCache)):(e._heartbeatsCache.heartbeats=[],e._storage.overwrite(e._heartbeatsCache)),s}catch(r){return Os.warn(r),""}})()}}function gG(){return(new Date).toISOString().substring(0,10)}class _0e{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}runIndexedDBEnvironmentCheck(){return T(function*(){return!!_R()&&function JTe(){return new Promise((n,e)=>{try{let t=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),t||self.indexedDB.deleteDatabase(r),n(!0)},i.onupgradeneeded=()=>{t=!1},i.onerror=()=>{var o;e((null===(o=i.error)||void 0===o?void 0:o.message)||"")}}catch(t){e(t)}})}().then(()=>!0).catch(()=>!1)})()}read(){var e=this;return T(function*(){if(yield e._canUseIndexedDBPromise){const r=yield function h0e(n){return RR.apply(this,arguments)}(e.app);return r?.heartbeats?r:{heartbeats:[]}}return{heartbeats:[]}})()}overwrite(e){var t=this;return T(function*(){var r;if(yield t._canUseIndexedDBPromise){const o=yield t.read();return pG(t.app,{lastSentHeartbeatDate:null!==(r=e.lastSentHeartbeatDate)&&void 0!==r?r:o.lastSentHeartbeatDate,heartbeats:e.heartbeats})}})()}add(e){var t=this;return T(function*(){var r;if(yield t._canUseIndexedDBPromise){const o=yield t.read();return pG(t.app,{lastSentHeartbeatDate:null!==(r=e.lastSentHeartbeatDate)&&void 0!==r?r:o.lastSentHeartbeatDate,heartbeats:[...o.heartbeats,...e.heartbeats]})}})()}}function _G(n){return nE(JSON.stringify({version:2,heartbeats:n})).length}function kR(n,e){const t=!e?.manualCleanup;t&&!e?.injector&&va();const r=t?e?.injector?.get(uo)??b(uo):null,i=function I0e(n=Object.is){return(e,t)=>1===e.kind&&1===t.kind&&n(e.value,t.value)}(e?.equal);let o;o=ti(e?.requireSync?{kind:0}:{kind:1,value:e?.initialValue},{equal:i});const s=n.subscribe({next:a=>o.set({kind:1,value:a}),error:a=>{if(e?.rejectErrors)throw a;o.set({kind:2,error:a})}});if(e?.requireSync&&0===o().kind)throw new O(601,!1);return r?.onDestroy(s.unsubscribe.bind(s)),xi(()=>{const a=o();switch(a.kind){case 1:return a.value;case 2:throw a.error;case 0:throw new O(601,!1)}},{equal:e?.equal})}!function v0e(n){Fs(new Go("platform-logger",e=>new RCe(e),"PRIVATE")),Fs(new Go("heartbeat",e=>new m0e(e),"PRIVATE")),Gn(aE,"0.11.1",n),Gn(aE,"0.11.1","esm2017"),Gn("fire-js","")}(""),Gn("firebase","11.3.1","app");const S0e=new class x0e extends Uw{}(class C0e extends Bw{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,r=0){return null!=r&&r>0||null==r&&this.delay>0?super.requestAsyncId(e,t,r):(e.flush(this),0)}}),dg=new vc("ANGULARFIRE2_VERSION");function uE(n,e,t){if(e){if(1===e.length)return e[0];const o=e.filter(s=>s.app===t);if(1===o.length)return o[0]}return t.container.getProvider(n).getImmediate({optional:!0})}const dE=(n,e)=>{const t=e?[e]:hG(),r=[];return t.forEach(i=>{i.container.getProvider(n).instances.forEach(s=>{r.includes(s)||r.push(s)})}),r};var mh=function(n){return n[n.SILENT=0]="SILENT",n[n.WARN=1]="WARN",n[n.VERBOSE=2]="VERBOSE",n}(mh||{}),NR=k$()&&typeof Zone<"u"?mh.WARN:mh.SILENT;class wG{zone;delegate;constructor(e,t=S0e){this.zone=e,this.delegate=t}now(){return this.delegate.now()}schedule(e,t,r){const i=this.zone;return this.delegate.schedule(function(s){i?i.runGuarded(()=>{e.apply(this,[s])}):e.apply(this,[s])},t,r)}}let hg=(()=>{class n{outsideAngular;insideAngular;constructor(){const t=b(ue);this.outsideAngular=t.runOutsideAngular(()=>new wG(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=t.run(()=>new wG(typeof Zone>"u"?void 0:Zone.current,zw))}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var EG=!1;function Vc(n){const e=b(ue,{optional:!0});return e?e.run(()=>n()):n()}const R0e=(n,e,t)=>(...r)=>(e&&setTimeout(e,0),yi(t,()=>Vc(()=>n.apply(void 0,r)))),ir=(n,e,t)=>(t||=e?mh.WARN:mh.VERBOSE,function(){let r;const i=arguments;let o,s,a;try{o=b(hg),s=b(R0),a=b(mr)}catch{return function D0e(n,e){!EG&&(NR>mh.SILENT||!1)&&(EG=!0,console.warn("Calling Firebase APIs outside of an Injection context may destabilize your application leading to subtle change-detection and hydration bugs. Find more at https://github.com/angular/angularfire/blob/main/docs/zones.md")),NR>=e&&console.warn(`Firebase API called outside injection context: ${n.name}`)}(n,t),n.apply(this,i)}for(let c=0;cs.add())),i[c]=R0e(i[c],r,a));const l=function A0e(n){const e=b(ue,{optional:!0});return e?e.runOutsideAngular(()=>n()):n()}(()=>n.apply(this,i));return e?l instanceof vt?l.pipe(Kb(o.outsideAngular),Gb(o.insideAngular),function bG(n){void 0===n&&(va(),n=b(ze));const e=n.get(R0);return t=>new vt(r=>{const i=e.add();let o=!1;function s(){o||(i(),o=!0)}const a=t.subscribe({next:l=>{r.next(l),s()},complete:()=>{r.complete(),s()},error:l=>{r.error(l),s()}});return a.add(()=>{r.unsubscribe(),s()}),a})}(a)):l instanceof Promise?Vc(()=>new Promise((c,u)=>{s.run(()=>l).then(d=>yi(a,()=>Vc(()=>c(d))),d=>yi(a,()=>Vc(()=>u(d))))})):"function"==typeof l&&r?function(){return setTimeout(r,0),l.apply(this,arguments)}:Vc(()=>l):l instanceof vt?l.pipe(Kb(o.outsideAngular),Gb(o.insideAngular)):Vc(()=>l)});class Bc{constructor(e){return e}}class hE{constructor(){return hG()}}const PR=new B("angularfire2._apps"),k0e={provide:Bc,useFactory:function M0e(n){return n&&1===n.length?n[0]:new Bc(cE())},deps:[[new fn,PR]]},N0e={provide:hE,deps:[[new fn,PR]]};function P0e(n){return(e,t)=>{const r=t.get(Ia);Gn("angularfire",dg.full,"core"),Gn("angularfire",dg.full,"app"),Gn("angular",Ffe.full,r.toString());const i=e.runOutsideAngular(()=>n(t));return new Bc(i)}}const F0e=ir(dG,!0),OR=new Map,IG={activated:!1,tokenObservers:[]},L0e={initialized:!1,enabled:!1};function an(n){return OR.get(n)||Object.assign({},IG)}function fE(){return L0e}class H0e{constructor(e,t,r,i,o){if(this.operation=e,this.retryPolicy=t,this.getWaitDuration=r,this.lowerBound=i,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=i,i>o)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(e){var t=this;return T(function*(){t.stop();try{t.pending=new iE,t.pending.promise.catch(r=>{}),yield function $0e(n){return new Promise(e=>{setTimeout(e,n)})}(t.getNextRun(e)),t.pending.resolve(),yield t.pending.promise,t.pending=new iE,t.pending.promise.catch(r=>{}),yield t.operation(),t.pending.resolve(),yield t.pending.promise,t.process(!0).catch(()=>{})}catch(r){t.retryPolicy(r)?t.process(!1).catch(()=>{}):t.stop()}})()}getNextRun(e){if(e)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{const t=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),t}}}const or=new fh("appCheck","AppCheck",{"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.",throttled:"Requests throttled due to {$httpStatus} error. Attempts allowed again after {$time}"});function LR(n){if(!an(n).activated)throw or.create("use-before-activation",{appName:n.name})}function gE(n,e){return BR.apply(this,arguments)}function BR(){return(BR=T(function*({url:n,body:e},t){const r={"Content-Type":"application/json"},i=t.getImmediate({optional:!0});if(i){const d=yield i.getHeartbeatsHeader();d&&(r["X-Firebase-Client"]=d)}const o={method:"POST",body:JSON.stringify(e),headers:r};let s,a;try{s=yield fetch(n,o)}catch(d){throw or.create("fetch-network-error",{originalErrorMessage:d?.message})}if(200!==s.status)throw or.create("fetch-status-error",{httpStatus:s.status});try{a=yield s.json()}catch(d){throw or.create("fetch-parse-error",{originalErrorMessage:d?.message})}const l=a.ttl.match(/^([\d.]+)(s)$/);if(!l||!l[2]||isNaN(Number(l[1])))throw or.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${a.ttl}`});const c=1e3*Number(l[1]),u=Date.now();return{token:a.token,expireTimeMillis:u+c,issuedAtTimeMillis:u}})).apply(this,arguments)}function CG(n,e){const{projectId:t,appId:r,apiKey:i}=n.options;return{url:`https://content-firebaseappcheck.googleapis.com/v1/projects/${t}/apps/${r}:exchangeDebugToken?key=${i}`,body:{debug_token:e}}}const fg="firebase-app-check-store";let _E=null;function UR(){return(UR=T(function*(n,e){const r=(yield function SG(){return _E||(_E=new Promise((n,e)=>{try{const t=indexedDB.open("firebase-app-check-database",1);t.onsuccess=r=>{n(r.target.result)},t.onerror=r=>{var i;e(or.create("storage-open",{originalErrorMessage:null===(i=r.target.error)||void 0===i?void 0:i.message}))},t.onupgradeneeded=r=>{0===r.oldVersion&&r.target.result.createObjectStore(fg,{keyPath:"compositeKey"})}}catch(t){e(or.create("storage-open",{originalErrorMessage:t?.message}))}}),_E)}()).transaction(fg,"readwrite"),o=r.objectStore(fg).put({compositeKey:n,value:e});return new Promise((s,a)=>{o.onsuccess=l=>{s()},r.onerror=l=>{var c;a(or.create("storage-set",{originalErrorMessage:null===(c=l.target.error)||void 0===c?void 0:c.message}))}})})).apply(this,arguments)}const pg=new sE("@firebase/app-check");function HR(n,e){return _R()?function X0e(n,e){return function DG(n,e){return UR.apply(this,arguments)}(function RG(n){return`${n.options.appId}-${n.name}`}(n),e)}(n,e).catch(t=>{pg.warn(`Failed to write token to IndexedDB. Error: ${t}`)}):Promise.resolve()}function qR(){return fE().enabled}function WR(){return GR.apply(this,arguments)}function GR(){return(GR=T(function*(){const n=fE();if(n.enabled&&n.token)return n.token.promise;throw Error("\n Can't get debug token in production mode.\n ")})).apply(this,arguments)}const rxe={error:"UNKNOWN_ERROR"};function ixe(n){return gR.encodeString(JSON.stringify(n),!1)}function yE(n){return KR.apply(this,arguments)}function KR(){return(KR=T(function*(n,e=!1){const t=n.app;LR(t);const r=an(t);let o,i=r.token;if(i&&!gh(i)&&(r.token=void 0,i=void 0),!i){const l=yield r.cachedTokenPromise;l&&(gh(l)?i=l:yield HR(t,void 0))}if(!e&&i&&gh(i))return{token:i.token};let a,s=!1;if(qR()){r.exchangeTokenPromise||(r.exchangeTokenPromise=gE(CG(t,yield WR()),n.heartbeatServiceProvider).finally(()=>{r.exchangeTokenPromise=void 0}),s=!0);const l=yield r.exchangeTokenPromise;return yield HR(t,l),r.token=l,{token:l.token}}try{r.exchangeTokenPromise||(r.exchangeTokenPromise=r.provider.getToken().finally(()=>{r.exchangeTokenPromise=void 0}),s=!0),i=yield an(t).exchangeTokenPromise}catch(l){"appCheck/throttled"===l.code?pg.warn(l.message):pg.error(l),o=l}return i?o?a=gh(i)?{token:i.token,internalError:o}:PG(o):(a={token:i.token},r.token=i,yield HR(t,i)):a=PG(o),s&&function NG(n,e){const t=an(n).tokenObservers;for(const r of t)try{"EXTERNAL"===r.type&&null!=e.error?r.error(e.error):r.next(e)}catch{}}(t,a),a})).apply(this,arguments)}function QR(){return(QR=T(function*(n){const e=n.app;LR(e);const{provider:t}=an(e);if(qR()){const r=yield WR(),{token:i}=yield gE(CG(e,r),n.heartbeatServiceProvider);return{token:i}}{const{token:r}=yield t.getToken();return{token:r}}})).apply(this,arguments)}function XR(n,e){const t=an(n),r=t.tokenObservers.filter(i=>i.next!==e);0===r.length&&t.tokenRefresher&&t.tokenRefresher.isRunning()&&t.tokenRefresher.stop(),t.tokenObservers=r}function kG(n){const{app:e}=n,t=an(e);let r=t.tokenRefresher;r||(r=function oxe(n){const{app:e}=n;return new H0e(T(function*(){let r;if(r=an(e).token?yield yE(n,!0):yield yE(n),r.error)throw r.error;if(r.internalError)throw r.internalError}),()=>!0,()=>{const t=an(e);if(t.token){let r=t.token.issuedAtTimeMillis+.5*(t.token.expireTimeMillis-t.token.issuedAtTimeMillis)+3e5;return r=Math.min(r,t.token.expireTimeMillis-3e5),Math.max(0,r-Date.now())}return 0},3e4,96e4)}(n),t.tokenRefresher=r),!r.isRunning()&&t.isTokenAutoRefreshEnabled&&r.start()}function gh(n){return n.expireTimeMillis-Date.now()>0}function PG(n){return{token:ixe(rxe),error:n}}class sxe{constructor(e,t){this.app=e,this.heartbeatServiceProvider=t}_delete(){const{tokenObservers:e}=an(this.app);for(const t of e)XR(this.app,t.next);return Promise.resolve()}}const jG="app-check-internal";!function bxe(){Fs(new Go("app-check",n=>function axe(n,e){return new sxe(n,e)}(n.getProvider("app").getImmediate(),n.getProvider("heartbeat")),"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((n,e,t)=>{n.getProvider(jG).initialize()})),Fs(new Go(jG,n=>function lxe(n){return{getToken:e=>yE(n,e),getLimitedUseToken:()=>function MG(n){return QR.apply(this,arguments)}(n),addTokenListener:e=>function YR(n,e,t,r){const{app:i}=n,o=an(i);if(o.tokenObservers=[...o.tokenObservers,{next:t,error:r,type:e}],o.token&&gh(o.token)){const a=o.token;Promise.resolve().then(()=>{t({token:a.token}),kG(n)}).catch(()=>{})}o.cachedTokenPromise.then(()=>kG(n))}(n,"INTERNAL",e),removeTokenListener:e=>XR(n.app,e)}}(n.getProvider("app-check").getImmediate()),"PUBLIC").setInstantiationMode("EXPLICIT")),Gn("@firebase/app-check","0.8.11")}();class bE{constructor(){return dE("app-check")}}typeof window<"u"&&window;const xxe=function $G(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}},qG=new fh("auth","Firebase",{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}),wE=new sE("@firebase/auth");function EE(n,...e){wE.logLevel<=qe.ERROR&&wE.error(`Auth (${Lc}): ${n}`,...e)}function li(n,...e){throw rM(n,...e)}function jr(n,...e){return rM(n,...e)}function nM(n,e,t){const r=Object.assign(Object.assign({},xxe()),{[e]:t});return new fh("auth","Firebase",r).create(e,{appName:n.name})}function Kn(n){return nM(n,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function rM(n,...e){if("string"!=typeof n){const t=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=n.name),n._errorFactory.create(t,...r)}return qG.create(n,...e)}function X(n,e,...t){if(!n)throw rM(e,...t)}function Ko(n){const e="INTERNAL ASSERTION FAILED: "+n;throw EE(e),new Error(e)}function Ls(n,e){n||Ko(e)}function mg(){var n;return typeof self<"u"&&(null===(n=self.location)||void 0===n?void 0:n.href)||""}function WG(){var n;return typeof self<"u"&&(null===(n=self.location)||void 0===n?void 0:n.protocol)||null}function Dxe(){return!(typeof navigator<"u"&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&(function iM(){return"http:"===WG()||"https:"===WG()}()||function YTe(){const n="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof n&&void 0!==n.id}()||"connection"in navigator))||navigator.onLine}class gg{constructor(e,t){this.shortDelay=e,this.longDelay=t,Ls(t>e,"Short delay should be less than long delay!"),this.isMobile=function WTe(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(_n())}()||function XTe(){return"object"==typeof navigator&&"ReactNative"===navigator.product}()}get(){return Dxe()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}function oM(n,e){Ls(n.emulator,"Emulator should always be set here");const{url:t}=n.emulator;return e?`${t}${e.startsWith("/")?e.slice(1):e}`:t}class GG{static initialize(e,t,r){this.fetchImpl=e,t&&(this.headersImpl=t),r&&(this.responseImpl=r)}static fetch(){return this.fetchImpl?this.fetchImpl:typeof self<"u"&&"fetch"in self?self.fetch:typeof globalThis<"u"&&globalThis.fetch?globalThis.fetch:typeof fetch<"u"?fetch:void Ko("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:typeof self<"u"&&"Headers"in self?self.Headers:typeof globalThis<"u"&&globalThis.Headers?globalThis.Headers:typeof Headers<"u"?Headers:void Ko("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:typeof self<"u"&&"Response"in self?self.Response:typeof globalThis<"u"&&globalThis.Response?globalThis.Response:typeof Response<"u"?Response:void Ko("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}const Rxe={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"},Mxe=new gg(3e4,6e4);function Ot(n,e){return n.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:n.tenantId}):e}function Ft(n,e,t,r){return sM.apply(this,arguments)}function sM(){return(sM=T(function*(n,e,t,r,i={}){return KG(n,i,T(function*(){let o={},s={};r&&("GET"===e?s=r:o={body:JSON.stringify(r)});const a=ig(Object.assign({key:n.config.apiKey},s)).slice(1),l=yield n._getAdditionalHeaders();l["Content-Type"]="application/json",n.languageCode&&(l["X-Firebase-Locale"]=n.languageCode);const c=Object.assign({method:e,headers:l},o);return function QTe(){return typeof navigator<"u"&&"Cloudflare-Workers"===navigator.userAgent}()||(c.referrerPolicy="no-referrer"),GG.fetch()(QG(n,n.config.apiHost,t,a),c)}))})).apply(this,arguments)}function KG(n,e,t){return aM.apply(this,arguments)}function aM(){return(aM=T(function*(n,e,t){n._canInitEmulator=!1;const r=Object.assign(Object.assign({},Rxe),e);try{const i=new Nxe(n),o=yield Promise.race([t(),i.promise]);i.clearNetworkTimeout();const s=yield o.json();if("needConfirmation"in s)throw _g(n,"account-exists-with-different-credential",s);if(o.ok&&!("errorMessage"in s))return s;{const a=o.ok?s.errorMessage:s.error.message,[l,c]=a.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===l)throw _g(n,"credential-already-in-use",s);if("EMAIL_EXISTS"===l)throw _g(n,"email-already-in-use",s);if("USER_DISABLED"===l)throw _g(n,"user-disabled",s);const u=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(c)throw nM(n,u,c);li(n,u)}}catch(i){if(i instanceof Wo)throw i;li(n,"network-request-failed",{message:String(i)})}})).apply(this,arguments)}function Vs(n,e,t,r){return lM.apply(this,arguments)}function lM(){return(lM=T(function*(n,e,t,r,i={}){const o=yield Ft(n,e,t,r,i);return"mfaPendingCredential"in o&&li(n,"multi-factor-auth-required",{_serverResponse:o}),o})).apply(this,arguments)}function QG(n,e,t,r){const i=`${e}${t}?${r}`;return n.config.emulator?oM(n.config,i):`${n.config.apiScheme}://${i}`}function kxe(n){switch(n){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class Nxe{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(jr(this.auth,"network-request-failed")),Mxe.get())})}}function _g(n,e,t){const r={appName:n.name};t.email&&(r.email=t.email),t.phoneNumber&&(r.phoneNumber=t.phoneNumber);const i=jr(n,e,r);return i.customData._tokenResponse=t,i}function XG(n){return void 0!==n&&void 0!==n.enterprise}class ZG{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],void 0===e.recaptchaKey)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||0===this.recaptchaEnforcementState.length)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return kxe(t.enforcementState);return null}isProviderEnabled(e){return"ENFORCE"===this.getProviderEnforcementState(e)||"AUDIT"===this.getProviderEnforcementState(e)}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PROVIDER")}}function uM(){return(uM=T(function*(n,e){return Ft(n,"GET","/v2/recaptchaConfig",Ot(n,e))})).apply(this,arguments)}function dM(){return(dM=T(function*(n,e){return Ft(n,"POST","/v1/accounts:delete",e)})).apply(this,arguments)}function e8(n,e){return fM.apply(this,arguments)}function fM(){return(fM=T(function*(n,e){return Ft(n,"POST","/v1/accounts:lookup",e)})).apply(this,arguments)}function yg(n){if(n)try{const e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}function pM(){return(pM=T(function*(n,e=!1){const t=sn(n),r=yield t.getIdToken(e),i=IE(r);X(i&&i.exp&&i.auth_time&&i.iat,t.auth,"internal-error");const o="object"==typeof i.firebase?i.firebase:void 0,s=o?.sign_in_provider;return{claims:i,token:r,authTime:yg(mM(i.auth_time)),issuedAtTime:yg(mM(i.iat)),expirationTime:yg(mM(i.exp)),signInProvider:s||null,signInSecondFactor:o?.sign_in_second_factor||null}})).apply(this,arguments)}function mM(n){return 1e3*Number(n)}function IE(n){const[e,t,r]=n.split(".");if(void 0===e||void 0===t||void 0===r)return EE("JWT malformed, contained fewer than 3 sections"),null;try{const i=rg(t);return i?JSON.parse(i):(EE("Failed to decode base64 JWT payload"),null)}catch(i){return EE("Caught error parsing JWT payload as JSON",i?.toString()),null}}function t8(n){const e=IE(n);return X(e,"internal-error"),X(typeof e.exp<"u","internal-error"),X(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}function Bs(n,e){return gM.apply(this,arguments)}function gM(){return(gM=T(function*(n,e,t=!1){if(t)return e;try{return yield e}catch(r){throw r instanceof Wo&&function Vxe({code:n}){return"auth/user-disabled"===n||"auth/user-token-expired"===n}(r)&&n.auth.currentUser===n&&(yield n.auth.signOut()),r}})).apply(this,arguments)}class Bxe{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(e){var t;if(e){const r=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),r}{this.errorBackoff=3e4;const i=(null!==(t=this.user.stsTokenManager.expirationTime)&&void 0!==t?t:0)-Date.now()-3e5;return Math.max(0,i)}}schedule(e=!1){var t=this;if(!this.isRunning)return;const r=this.getInterval(e);this.timerId=setTimeout(T(function*(){yield t.iteration()}),r)}iteration(){var e=this;return T(function*(){try{yield e.user.getIdToken(!0)}catch(t){return void("auth/network-request-failed"===t?.code&&e.schedule(!0))}e.schedule()})()}}class _M{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=yg(this.lastLoginAt),this.creationTime=yg(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}function vg(n){return yM.apply(this,arguments)}function yM(){return(yM=T(function*(n){var e;const t=n.auth,r=yield n.getIdToken(),i=yield Bs(n,e8(t,{idToken:r}));X(i?.users.length,t,"internal-error");const o=i.users[0];n._notifyReloadListener(o);const s=null!==(e=o.providerUserInfo)&&void 0!==e&&e.length?n8(o.providerUserInfo):[],a=function zxe(n,e){return[...n.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}(n.providerData,s),u=!!n.isAnonymous&&!(n.email&&o.passwordHash||a?.length),d={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:a,metadata:new _M(o.createdAt,o.lastLoginAt),isAnonymous:u};Object.assign(n,d)})).apply(this,arguments)}function vM(){return(vM=T(function*(n){const e=sn(n);yield vg(e),yield e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)})).apply(this,arguments)}function n8(n){return n.map(e=>{var{providerId:t}=e,r=Wb(e,["providerId"]);return{providerId:t,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}function bM(){return(bM=T(function*(n,e){const t=yield KG(n,{},T(function*(){const r=ig({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:o}=n.config,s=QG(n,i,"/v1/token",`key=${o}`),a=yield n._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",GG.fetch()(s,{method:"POST",headers:a,body:r})}));return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}})).apply(this,arguments)}function wM(){return(wM=T(function*(n,e){return Ft(n,"POST","/v2/accounts:revokeToken",Ot(n,e))})).apply(this,arguments)}class yh{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){X(e.idToken,"internal-error"),X(typeof e.idToken<"u","internal-error"),X(typeof e.refreshToken<"u","internal-error");const t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):t8(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){X(0!==e.length,"internal-error");const t=t8(e);this.updateTokensAndExpiration(e,null,t)}getToken(e,t=!1){var r=this;return T(function*(){return t||!r.accessToken||r.isExpired?(X(r.refreshToken,e,"user-token-expired"),r.refreshToken?(yield r.refresh(e,r.refreshToken),r.accessToken):null):r.accessToken})()}clearRefreshToken(){this.refreshToken=null}refresh(e,t){var r=this;return T(function*(){const{accessToken:i,refreshToken:o,expiresIn:s}=yield function jxe(n,e){return bM.apply(this,arguments)}(e,t);r.updateTokensAndExpiration(i,o,Number(s))})()}updateTokensAndExpiration(e,t,r){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*r}static fromJSON(e,t){const{refreshToken:r,accessToken:i,expirationTime:o}=t,s=new yh;return r&&(X("string"==typeof r,"internal-error",{appName:e}),s.refreshToken=r),i&&(X("string"==typeof i,"internal-error",{appName:e}),s.accessToken=i),o&&(X("number"==typeof o,"internal-error",{appName:e}),s.expirationTime=o),s}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new yh,this.toJSON())}_performRefresh(){return Ko("not implemented")}}function Ja(n,e){X("string"==typeof n||typeof n>"u","internal-error",{appName:e})}class Us{constructor(e){var{uid:t,auth:r,stsTokenManager:i}=e,o=Wb(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new Bxe(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=o.displayName||null,this.email=o.email||null,this.emailVerified=o.emailVerified||!1,this.phoneNumber=o.phoneNumber||null,this.photoURL=o.photoURL||null,this.isAnonymous=o.isAnonymous||!1,this.tenantId=o.tenantId||null,this.providerData=o.providerData?[...o.providerData]:[],this.metadata=new _M(o.createdAt||void 0,o.lastLoginAt||void 0)}getIdToken(e){var t=this;return T(function*(){const r=yield Bs(t,t.stsTokenManager.getToken(t.auth,e));return X(r,t.auth,"internal-error"),t.accessToken!==r&&(t.accessToken=r,yield t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)),r})()}getIdTokenResult(e){return function Lxe(n){return pM.apply(this,arguments)}(this,e)}reload(){return function Uxe(n){return vM.apply(this,arguments)}(this)}_assign(e){this!==e&&(X(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>Object.assign({},t)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new Us(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){X(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}_updateTokensIfNecessary(e,t=!1){var r=this;return T(function*(){let i=!1;e.idToken&&e.idToken!==r.stsTokenManager.accessToken&&(r.stsTokenManager.updateFromServerResponse(e),i=!0),t&&(yield vg(r)),yield r.auth._persistUserIfCurrent(r),i&&r.auth._notifyListenersIfCurrent(r)})()}delete(){var e=this;return T(function*(){if(ai(e.auth.app))return Promise.reject(Kn(e.auth));const t=yield e.getIdToken();return yield Bs(e,function Oxe(n,e){return dM.apply(this,arguments)}(e.auth,{idToken:t})),e.stsTokenManager.clearRefreshToken(),e.auth.signOut()})()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var r,i,o,s,a,l,c,u;const d=null!==(r=t.displayName)&&void 0!==r?r:void 0,f=null!==(i=t.email)&&void 0!==i?i:void 0,p=null!==(o=t.phoneNumber)&&void 0!==o?o:void 0,m=null!==(s=t.photoURL)&&void 0!==s?s:void 0,_=null!==(a=t.tenantId)&&void 0!==a?a:void 0,v=null!==(l=t._redirectEventId)&&void 0!==l?l:void 0,E=null!==(c=t.createdAt)&&void 0!==c?c:void 0,C=null!==(u=t.lastLoginAt)&&void 0!==u?u:void 0,{uid:R,emailVerified:V,isAnonymous:H,providerData:Q,stsTokenManager:S}=t;X(R&&S,e,"internal-error");const I=yh.fromJSON(this.name,S);X("string"==typeof R,e,"internal-error"),Ja(d,e.name),Ja(f,e.name),X("boolean"==typeof V,e,"internal-error"),X("boolean"==typeof H,e,"internal-error"),Ja(p,e.name),Ja(m,e.name),Ja(_,e.name),Ja(v,e.name),Ja(E,e.name),Ja(C,e.name);const x=new Us({uid:R,auth:e,email:f,emailVerified:V,displayName:d,isAnonymous:H,photoURL:m,phoneNumber:p,tenantId:_,stsTokenManager:I,createdAt:E,lastLoginAt:C});return Q&&Array.isArray(Q)&&(x.providerData=Q.map(A=>Object.assign({},A))),v&&(x._redirectEventId=v),x}static _fromIdTokenResponse(e,t,r=!1){return T(function*(){const i=new yh;i.updateFromServerResponse(t);const o=new Us({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:r});return yield vg(o),o})()}static _fromGetAccountInfoResponse(e,t,r){return T(function*(){const i=t.users[0];X(void 0!==i.localId,"internal-error");const o=void 0!==i.providerUserInfo?n8(i.providerUserInfo):[],s=!(i.email&&i.passwordHash||o?.length),a=new yh;a.updateFromIdToken(r);const l=new Us({uid:i.localId,auth:e,stsTokenManager:a,isAnonymous:s}),c={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:o,metadata:new _M(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash||o?.length)};return Object.assign(l,c),l})()}}const r8=new Map;function zs(n){Ls(n instanceof Function,"Expected a class definition");let e=r8.get(n);return e?(Ls(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,r8.set(n,e),e)}const i8=(()=>{class n{constructor(){this.type="NONE",this.storage={}}_isAvailable(){return T(function*(){return!0})()}_set(t,r){var i=this;return T(function*(){i.storage[t]=r})()}_get(t){var r=this;return T(function*(){const i=r.storage[t];return void 0===i?null:i})()}_remove(t){var r=this;return T(function*(){delete r.storage[t]})()}_addListener(t,r){}_removeListener(t,r){}}return n.type="NONE",n})();function TE(n,e,t){return`firebase:${n}:${e}:${t}`}class vh{constructor(e,t,r){this.persistence=e,this.auth=t,this.userKey=r;const{config:i,name:o}=this.auth;this.fullUserKey=TE(this.userKey,i.apiKey,o),this.fullPersistenceKey=TE("persistence",i.apiKey,o),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}getCurrentUser(){var e=this;return T(function*(){const t=yield e.persistence._get(e.fullUserKey);return t?Us._fromJSON(e.auth,t):null})()}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}setPersistence(e){var t=this;return T(function*(){if(t.persistence===e)return;const r=yield t.getCurrentUser();return yield t.removeCurrentUser(),t.persistence=e,r?t.setCurrentUser(r):void 0})()}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static create(e,t,r="authUser"){return T(function*(){if(!t.length)return new vh(zs(i8),e,r);const i=(yield Promise.all(t.map(function(){var c=T(function*(u){if(yield u._isAvailable())return u});return function(u){return c.apply(this,arguments)}}()))).filter(c=>c);let o=i[0]||zs(i8);const s=TE(r,e.config.apiKey,e.name);let a=null;for(const c of t)try{const u=yield c._get(s);if(u){const d=Us._fromJSON(e,u);c!==o&&(a=d),o=c;break}}catch{}const l=i.filter(c=>c._shouldAllowMigration);return o._shouldAllowMigration&&l.length?(o=l[0],a&&(yield o._set(s,a.toJSON())),yield Promise.all(t.map(function(){var c=T(function*(u){if(u!==o)try{yield u._remove(s)}catch{}});return function(u){return c.apply(this,arguments)}}())),new vh(o,e,r)):new vh(o,e,r)})()}}function o8(n){const e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(c8(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(s8(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(d8(e))return"Blackberry";if(h8(e))return"Webos";if(a8(e))return"Safari";if((e.includes("chrome/")||l8(e))&&!e.includes("edge/"))return"Chrome";if(u8(e))return"Android";{const r=n.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/);if(2===r?.length)return r[1]}return"Other"}function s8(n=_n()){return/firefox\//i.test(n)}function a8(n=_n()){const e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function l8(n=_n()){return/crios\//i.test(n)}function c8(n=_n()){return/iemobile/i.test(n)}function u8(n=_n()){return/android/i.test(n)}function d8(n=_n()){return/blackberry/i.test(n)}function h8(n=_n()){return/webos/i.test(n)}function EM(n=_n()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function f8(n=_n()){return EM(n)||u8(n)||h8(n)||d8(n)||/windows phone/i.test(n)||c8(n)}function p8(n,e=[]){let t;switch(n){case"Browser":t=o8(_n());break;case"Worker":t=`${o8(_n())}-${n}`;break;default:t=n}const r=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${Lc}/${r}`}class Wxe{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const r=o=>new Promise((s,a)=>{try{s(e(o))}catch(l){a(l)}});r.onAbort=t,this.queue.push(r);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}runMiddleware(e){var t=this;return T(function*(){if(t.auth.currentUser===e)return;const r=[];try{for(const i of t.queue)yield i(e),i.onAbort&&r.push(i.onAbort)}catch(i){r.reverse();for(const o of r)try{o()}catch{}throw t.auth._errorFactory.create("login-blocked",{originalMessage:i?.message})}})()}}function IM(){return(IM=T(function*(n,e={}){return Ft(n,"GET","/v2/passwordPolicy",Ot(n,e))})).apply(this,arguments)}class Qxe{constructor(e){var t,r,i,o;const s=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=null!==(t=s.minPasswordLength)&&void 0!==t?t:6,s.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=s.maxPasswordLength),void 0!==s.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=s.containsLowercaseCharacter),void 0!==s.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=s.containsUppercaseCharacter),void 0!==s.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=s.containsNumericCharacter),void 0!==s.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=s.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=null!==(i=null===(r=e.allowedNonAlphanumericCharacters)||void 0===r?void 0:r.join(""))&&void 0!==i?i:"",this.forceUpgradeOnSignin=null!==(o=e.forceUpgradeOnSignin)&&void 0!==o&&o,this.schemaVersion=e.schemaVersion}validatePassword(e){var t,r,i,o,s,a;const l={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,l),this.validatePasswordCharacterOptions(e,l),l.isValid&&(l.isValid=null===(t=l.meetsMinPasswordLength)||void 0===t||t),l.isValid&&(l.isValid=null===(r=l.meetsMaxPasswordLength)||void 0===r||r),l.isValid&&(l.isValid=null===(i=l.containsLowercaseLetter)||void 0===i||i),l.isValid&&(l.isValid=null===(o=l.containsUppercaseLetter)||void 0===o||o),l.isValid&&(l.isValid=null===(s=l.containsNumericCharacter)||void 0===s||s),l.isValid&&(l.isValid=null===(a=l.containsNonAlphanumericCharacter)||void 0===a||a),l}validatePasswordLengthOptions(e,t){const r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(t.meetsMinPasswordLength=e.length>=r),i&&(t.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,t){let r;this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);for(let i=0;i="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,t,r,i,o){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=o))}}class Yxe{constructor(e,t,r,i){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new m8(this),this.idTokenSubscription=new m8(this),this.beforeStateQueue=new Wxe(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=qG,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion}_initializeWithPersistence(e,t){var r=this;return t&&(this._popupRedirectResolver=zs(t)),this._initializationPromise=this.queue(T(function*(){var i,o;if(!r._deleted&&(r.persistenceManager=yield vh.create(r,e),!r._deleted)){if(null!==(i=r._popupRedirectResolver)&&void 0!==i&&i._shouldInitProactively)try{yield r._popupRedirectResolver._initialize(r)}catch{}yield r.initializeCurrentUser(t),r.lastNotifiedUid=(null===(o=r.currentUser)||void 0===o?void 0:o.uid)||null,!r._deleted&&(r._isInitialized=!0)}})),this._initializationPromise}_onStorageEvent(){var e=this;return T(function*(){if(e._deleted)return;const t=yield e.assertedPersistence.getCurrentUser();if(e.currentUser||t){if(e.currentUser&&t&&e.currentUser.uid===t.uid)return e._currentUser._assign(t),void(yield e.currentUser.getIdToken());yield e._updateCurrentUser(t,!0)}})()}initializeCurrentUserFromIdToken(e){var t=this;return T(function*(){try{const r=yield e8(t,{idToken:e}),i=yield Us._fromGetAccountInfoResponse(t,r,e);yield t.directlySetCurrentUser(i)}catch(r){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",r),yield t.directlySetCurrentUser(null)}})()}initializeCurrentUser(e){var t=this;return T(function*(){var r;if(ai(t.app)){const a=t.app.settings.authIdToken;return a?new Promise(l=>{setTimeout(()=>t.initializeCurrentUserFromIdToken(a).then(l,l))}):t.directlySetCurrentUser(null)}const i=yield t.assertedPersistence.getCurrentUser();let o=i,s=!1;if(e&&t.config.authDomain){yield t.getOrInitRedirectPersistenceManager();const a=null===(r=t.redirectUser)||void 0===r?void 0:r._redirectEventId,l=o?._redirectEventId,c=yield t.tryRedirectSignIn(e);(!a||a===l)&&c?.user&&(o=c.user,s=!0)}if(!o)return t.directlySetCurrentUser(null);if(!o._redirectEventId){if(s)try{yield t.beforeStateQueue.runMiddleware(o)}catch(a){o=i,t._popupRedirectResolver._overrideRedirectResult(t,()=>Promise.reject(a))}return o?t.reloadAndSetCurrentUserOrClear(o):t.directlySetCurrentUser(null)}return X(t._popupRedirectResolver,t,"argument-error"),yield t.getOrInitRedirectPersistenceManager(),t.redirectUser&&t.redirectUser._redirectEventId===o._redirectEventId?t.directlySetCurrentUser(o):t.reloadAndSetCurrentUserOrClear(o)})()}tryRedirectSignIn(e){var t=this;return T(function*(){let r=null;try{r=yield t._popupRedirectResolver._completeRedirectFn(t,e,!0)}catch{yield t._setRedirectUser(null)}return r})()}reloadAndSetCurrentUserOrClear(e){var t=this;return T(function*(){try{yield vg(e)}catch(r){if("auth/network-request-failed"!==r?.code)return t.directlySetCurrentUser(null)}return t.directlySetCurrentUser(e)})()}useDeviceLanguage(){this.languageCode=function Axe(){if(typeof navigator>"u")return null;const n=navigator;return n.languages&&n.languages[0]||n.language||null}()}_delete(){var e=this;return T(function*(){e._deleted=!0})()}updateCurrentUser(e){var t=this;return T(function*(){if(ai(t.app))return Promise.reject(Kn(t));const r=e?sn(e):null;return r&&X(r.auth.config.apiKey===t.config.apiKey,t,"invalid-user-token"),t._updateCurrentUser(r&&r._clone(t))})()}_updateCurrentUser(e,t=!1){var r=this;return T(function*(){if(!r._deleted)return e&&X(r.tenantId===e.tenantId,r,"tenant-id-mismatch"),t||(yield r.beforeStateQueue.runMiddleware(e)),r.queue(T(function*(){yield r.directlySetCurrentUser(e),r.notifyAuthListeners()}))})()}signOut(){var e=this;return T(function*(){return ai(e.app)?Promise.reject(Kn(e)):(yield e.beforeStateQueue.runMiddleware(null),(e.redirectPersistenceManager||e._popupRedirectResolver)&&(yield e._setRedirectUser(null)),e._updateCurrentUser(null,!0))})()}setPersistence(e){var t=this;return ai(this.app)?Promise.reject(Kn(this)):this.queue(T(function*(){yield t.assertedPersistence.setPersistence(zs(e))}))}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}validatePassword(e){var t=this;return T(function*(){t._getPasswordPolicyInternal()||(yield t._updatePasswordPolicy());const r=t._getPasswordPolicyInternal();return r.schemaVersion!==t.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(t._errorFactory.create("unsupported-password-policy-schema-version",{})):r.validatePassword(e)})()}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}_updatePasswordPolicy(){var e=this;return T(function*(){const t=yield function Gxe(n){return IM.apply(this,arguments)}(e),r=new Qxe(t);null===e.tenantId?e._projectPasswordPolicy=r:e._tenantPasswordPolicies[e.tenantId]=r})()}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new fh("auth","Firebase",e())}onAuthStateChanged(e,t,r){return this.registerStateListener(this.authStateSubscription,e,t,r)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,r){return this.registerStateListener(this.idTokenSubscription,e,t,r)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},t)}})}revokeAccessToken(e){var t=this;return T(function*(){if(t.currentUser){const r=yield t.currentUser.getIdToken(),i={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:r};null!=t.tenantId&&(i.tenantId=t.tenantId),yield function Hxe(n,e){return wM.apply(this,arguments)}(t,i)}})()}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(e=this._currentUser)||void 0===e?void 0:e.toJSON()}}_setRedirectUser(e,t){var r=this;return T(function*(){const i=yield r.getOrInitRedirectPersistenceManager(t);return null===e?i.removeCurrentUser():i.setCurrentUser(e)})()}getOrInitRedirectPersistenceManager(e){var t=this;return T(function*(){if(!t.redirectPersistenceManager){const r=e&&zs(e)||t._popupRedirectResolver;X(r,t,"argument-error"),t.redirectPersistenceManager=yield vh.create(t,[zs(r._redirectPersistence)],"redirectUser"),t.redirectUser=yield t.redirectPersistenceManager.getCurrentUser()}return t.redirectPersistenceManager})()}_redirectUserForId(e){var t=this;return T(function*(){var r,i;return t._isInitialized&&(yield t.queue(T(function*(){}))),(null===(r=t._currentUser)||void 0===r?void 0:r._redirectEventId)===e?t._currentUser:(null===(i=t.redirectUser)||void 0===i?void 0:i._redirectEventId)===e?t.redirectUser:null})()}_persistUserIfCurrent(e){var t=this;return T(function*(){if(e===t.currentUser)return t.queue(T(function*(){return t.directlySetCurrentUser(e)}))})()}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=null!==(t=null===(e=this.currentUser)||void 0===e?void 0:e.uid)&&void 0!==t?t:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,r,i){if(this._deleted)return()=>{};const o="function"==typeof t?t:t.next.bind(t);let s=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(X(a,this,"internal-error"),a.then(()=>{s||o(this.currentUser)}),"function"==typeof t){const l=e.addObserver(t,r,i);return()=>{s=!0,l()}}{const l=e.addObserver(t);return()=>{s=!0,l()}}}directlySetCurrentUser(e){var t=this;return T(function*(){t.currentUser&&t.currentUser!==e&&t._currentUser._stopProactiveRefresh(),e&&t.isProactiveRefreshEnabled&&e._startProactiveRefresh(),t.currentUser=e,e?yield t.assertedPersistence.setCurrentUser(e):yield t.assertedPersistence.removeCurrentUser()})()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return X(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=p8(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}_getAdditionalHeaders(){var e=this;return T(function*(){var t;const r={"X-Client-Version":e.clientVersion};e.app.options.appId&&(r["X-Firebase-gmpid"]=e.app.options.appId);const i=yield null===(t=e.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===t?void 0:t.getHeartbeatsHeader();i&&(r["X-Firebase-Client"]=i);const o=yield e._getAppCheckToken();return o&&(r["X-Firebase-AppCheck"]=o),r})()}_getAppCheckToken(){var e=this;return T(function*(){var t;if(ai(e.app)&&e.app.settings.appCheckToken)return e.app.settings.appCheckToken;const r=yield null===(t=e.appCheckServiceProvider.getImmediate({optional:!0}))||void 0===t?void 0:t.getToken();return r?.error&&function Sxe(n,...e){wE.logLevel<=qe.WARN&&wE.warn(`Auth (${Lc}): ${n}`,...e)}(`Error while retrieving App Check token: ${r.error}`),r?.token})()}}function yn(n){return sn(n)}class m8{constructor(e){this.auth=e,this.observer=null,this.addObserver=function iCe(n,e){const t=new oCe(n,e);return t.subscribe.bind(t)}(t=>this.observer=t)}get next(){return X(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}let bg={loadJS:()=>T(function*(){throw new Error("Unable to load external scripts")})(),recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function TM(n){return bg.loadJS(n)}function g8(n){return`__${n}${Math.floor(1e6*Math.random())}`}class iSe{constructor(){this.enterprise=new oSe}ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}class oSe{ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}const wg="NO_RECAPTCHA";class _8{constructor(e){this.type="recaptcha-enterprise",this.auth=yn(e)}verify(e="verify",t=!1){var r=this;return T(function*(){function o(){return o=T(function*(a){if(!t){if(null==a.tenantId&&null!=a._agentRecaptchaConfig)return a._agentRecaptchaConfig.siteKey;if(null!=a.tenantId&&void 0!==a._tenantRecaptchaConfigs[a.tenantId])return a._tenantRecaptchaConfigs[a.tenantId].siteKey}return new Promise(function(){var l=T(function*(c,u){(function JG(n,e){return uM.apply(this,arguments)})(a,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(d=>{if(void 0!==d.recaptchaKey){const f=new ZG(d);return null==a.tenantId?a._agentRecaptchaConfig=f:a._tenantRecaptchaConfigs[a.tenantId]=f,c(f.siteKey)}u(new Error("recaptcha Enterprise site key undefined"))}).catch(d=>{u(d)})});return function(c,u){return l.apply(this,arguments)}}())}),o.apply(this,arguments)}function s(a,l,c){const u=window.grecaptcha;XG(u)?u.enterprise.ready(()=>{u.enterprise.execute(a,{action:e}).then(d=>{l(d)}).catch(()=>{l(wg)})}):c(Error("No reCAPTCHA enterprise script loaded."))}return r.auth.settings.appVerificationDisabledForTesting?(new iSe).execute("siteKey",{action:"verify"}):new Promise((a,l)=>{(function i(a){return o.apply(this,arguments)})(r.auth).then(c=>{if(!t&&XG(window.grecaptcha))s(c,a,l);else{if(typeof window>"u")return void l(new Error("RecaptchaVerifier is only supported in browser"));let u=function Jxe(){return bg.recaptchaEnterpriseScript}();0!==u.length&&(u+=c),TM(u).then(()=>{s(c,a,l)}).catch(d=>{l(d)})}}).catch(c=>{l(c)})})})()}}function Eg(n,e,t){return CM.apply(this,arguments)}function CM(){return(CM=T(function*(n,e,t,r=!1,i=!1){const o=new _8(n);let s;if(i)s=wg;else try{s=yield o.verify(t)}catch{s=yield o.verify(t,!0)}const a=Object.assign({},e);return"mfaSmsEnrollment"===t||"mfaSmsSignIn"===t?("phoneEnrollmentInfo"in a?Object.assign(a,{phoneEnrollmentInfo:{phoneNumber:a.phoneEnrollmentInfo.phoneNumber,recaptchaToken:a.phoneEnrollmentInfo.recaptchaToken,captchaResponse:s,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}}):"phoneSignInInfo"in a&&Object.assign(a,{phoneSignInInfo:{recaptchaToken:a.phoneSignInInfo.recaptchaToken,captchaResponse:s,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}}),a):(Object.assign(a,r?{captchaResp:s}:{captchaResponse:s}),Object.assign(a,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(a,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),a)})).apply(this,arguments)}function el(n,e,t,r,i){return xM.apply(this,arguments)}function xM(){return xM=T(function*(n,e,t,r,i){var o,s;if("EMAIL_PASSWORD_PROVIDER"===i){if(null!==(o=n._getRecaptchaConfig())&&void 0!==o&&o.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const a=yield Eg(n,e,t,"getOobCode"===t);return r(n,a)}return r(n,e).catch(function(){var a=T(function*(l){if("auth/missing-recaptcha-token"===l.code){console.log(`${t} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const c=yield Eg(n,e,t,"getOobCode"===t);return r(n,c)}return Promise.reject(l)});return function(l){return a.apply(this,arguments)}}())}if("PHONE_PROVIDER"===i){if(null!==(s=n._getRecaptchaConfig())&&void 0!==s&&s.isProviderEnabled("PHONE_PROVIDER")){const a=yield Eg(n,e,t);return r(n,a).catch(function(){var l=T(function*(c){var u;if("AUDIT"===(null===(u=n._getRecaptchaConfig())||void 0===u?void 0:u.getProviderEnforcementState("PHONE_PROVIDER"))&&("auth/missing-recaptcha-token"===c.code||"auth/invalid-app-credential"===c.code)){console.log(`Failed to verify with reCAPTCHA Enterprise. Automatically triggering the reCAPTCHA v2 flow to complete the ${t} flow.`);const d=yield Eg(n,e,t,!1,!0);return r(n,d)}return Promise.reject(c)});return function(c){return l.apply(this,arguments)}}())}{const a=yield Eg(n,e,t,!1,!0);return r(n,a)}}return Promise.reject(i+" provider is not supported.")}),xM.apply(this,arguments)}function v8(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function b8(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}class Ig{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return Ko("not implemented")}_getIdTokenResponse(e){return Ko("not implemented")}_linkToIdToken(e,t){return Ko("not implemented")}_getReauthenticationResolver(e){return Ko("not implemented")}}function mSe(n,e){return RM.apply(this,arguments)}function RM(){return(RM=T(function*(n,e){return Ft(n,"POST","/v1/accounts:signUp",e)})).apply(this,arguments)}function _Se(n,e){return kM.apply(this,arguments)}function kM(){return(kM=T(function*(n,e){return Vs(n,"POST","/v1/accounts:signInWithPassword",Ot(n,e))})).apply(this,arguments)}function VM(){return(VM=T(function*(n,e){return Vs(n,"POST","/v1/accounts:signInWithEmailLink",Ot(n,e))})).apply(this,arguments)}function BM(){return(BM=T(function*(n,e){return Vs(n,"POST","/v1/accounts:signInWithEmailLink",Ot(n,e))})).apply(this,arguments)}class Tg extends Ig{constructor(e,t,r,i=null){super("password",r),this._email=e,this._password=t,this._tenantId=i}static _fromEmailAndPassword(e,t){return new Tg(e,t,"password")}static _fromEmailAndCode(e,t,r=null){return new Tg(e,t,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e;if(t?.email&&t?.password){if("password"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}_getIdTokenResponse(e){var t=this;return T(function*(){switch(t.signInMethod){case"password":return el(e,{returnSecureToken:!0,email:t._email,password:t._password,clientType:"CLIENT_TYPE_WEB"},"signInWithPassword",_Se,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return function ESe(n,e){return VM.apply(this,arguments)}(e,{email:t._email,oobCode:t._password});default:li(e,"internal-error")}})()}_linkToIdToken(e,t){var r=this;return T(function*(){switch(r.signInMethod){case"password":return el(e,{idToken:t,returnSecureToken:!0,email:r._email,password:r._password,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",mSe,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return function ISe(n,e){return BM.apply(this,arguments)}(e,{idToken:t,email:r._email,oobCode:r._password});default:li(e,"internal-error")}})()}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}function js(n,e){return UM.apply(this,arguments)}function UM(){return(UM=T(function*(n,e){return Vs(n,"POST","/v1/accounts:signInWithIdp",Ot(n,e))})).apply(this,arguments)}class bh extends Ig{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new bh(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):li("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e,{providerId:r,signInMethod:i}=t,o=Wb(t,["providerId","signInMethod"]);if(!r||!i)return null;const s=new bh(r,i);return s.idToken=o.idToken||void 0,s.accessToken=o.accessToken||void 0,s.secret=o.secret,s.nonce=o.nonce,s.pendingToken=o.pendingToken||null,s}_getIdTokenResponse(e){return js(e,this.buildRequest())}_linkToIdToken(e,t){const r=this.buildRequest();return r.idToken=t,js(e,r)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,js(e,t)}buildRequest(){const e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=ig(t)}return e}}class xg{constructor(e){var t,r,i,o,s,a;const l=og(sg(e)),c=null!==(t=l.apiKey)&&void 0!==t?t:null,u=null!==(r=l.oobCode)&&void 0!==r?r:null,d=function ASe(n){switch(n){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}(null!==(i=l.mode)&&void 0!==i?i:null);X(c&&u&&d,"argument-error"),this.apiKey=c,this.operation=d,this.code=u,this.continueUrl=null!==(o=l.continueUrl)&&void 0!==o?o:null,this.languageCode=null!==(s=l.languageCode)&&void 0!==s?s:null,this.tenantId=null!==(a=l.tenantId)&&void 0!==a?a:null}static parseLink(e){const t=function RSe(n){const e=og(sg(n)).link,t=e?og(sg(e)).deep_link_id:null,r=og(sg(n)).deep_link_id;return(r?og(sg(r)).link:null)||r||t||e||n}(e);try{return new xg(t)}catch{return null}}}let I8=(()=>{class n{constructor(){this.providerId=n.PROVIDER_ID}static credential(t,r){return Tg._fromEmailAndPassword(t,r)}static credentialWithLink(t,r){const i=xg.parseLink(r);return X(i,"argument-error"),Tg._fromEmailAndCode(t,i.code,i.tenantId)}}return n.PROVIDER_ID="password",n.EMAIL_PASSWORD_SIGN_IN_METHOD="password",n.EMAIL_LINK_SIGN_IN_METHOD="emailLink",n})();class Hs{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}class T8 extends Hs{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}let MSe=(()=>{class n extends T8{constructor(){super("google.com"),this.addScope("profile")}static credential(t,r){return bh._fromParams({providerId:n.PROVIDER_ID,signInMethod:n.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:r})}static credentialFromResult(t){return n.credentialFromTaggedObject(t)}static credentialFromError(t){return n.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:r,oauthAccessToken:i}=t;if(!r&&!i)return null;try{return n.credential(r,i)}catch{return null}}}return n.GOOGLE_SIGN_IN_METHOD="google.com",n.PROVIDER_ID="google.com",n})();function C8(n,e){return WM.apply(this,arguments)}function WM(){return(WM=T(function*(n,e){return Vs(n,"POST","/v1/accounts:signUp",Ot(n,e))})).apply(this,arguments)}class Ji{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static _fromIdTokenResponse(e,t,r,i=!1){return T(function*(){const o=yield Us._fromIdTokenResponse(e,r,i),s=x8(r);return new Ji({user:o,providerId:s,_tokenResponse:r,operationType:t})})()}static _forOperation(e,t,r){return T(function*(){yield e._updateTokensIfNecessary(r,!0);const i=x8(r);return new Ji({user:e,providerId:i,_tokenResponse:r,operationType:t})})()}}function x8(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}class DE extends Wo{constructor(e,t,r,i){var o;super(t.code,t.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,DE.prototype),this.customData={appName:e.name,tenantId:null!==(o=e.tenantId)&&void 0!==o?o:void 0,_serverResponse:t.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,t,r,i){return new DE(e,t,r,i)}}function S8(n,e,t,r){return("reauthenticate"===e?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(o=>{throw"auth/multi-factor-auth-required"===o.code?DE._fromErrorAndOperation(n,o,e,r):o})}function YM(){return(YM=T(function*(n,e,t=!1){const r=yield Bs(n,e._linkToIdToken(n.auth,yield n.getIdToken()),t);return Ji._forOperation(n,"link",r)})).apply(this,arguments)}function ZM(){return(ZM=T(function*(n,e,t=!1){const{auth:r}=n;if(ai(r.app))return Promise.reject(Kn(r));const i="reauthenticate";try{const o=yield Bs(n,S8(r,i,e,n),t);X(o.idToken,r,"internal-error");const s=IE(o.idToken);X(s,r,"internal-error");const{sub:a}=s;return X(n.uid===a,r,"user-mismatch"),Ji._forOperation(n,i,o)}catch(o){throw"auth/user-not-found"===o?.code&&li(r,"user-mismatch"),o}})).apply(this,arguments)}function R8(n,e){return JM.apply(this,arguments)}function JM(){return(JM=T(function*(n,e,t=!1){if(ai(n.app))return Promise.reject(Kn(n));const r="signIn",i=yield S8(n,r,e),o=yield Ji._fromIdTokenResponse(n,r,i);return t||(yield n._updateCurrentUser(o.user)),o})).apply(this,arguments)}function tk(){return(tk=T(function*(n,e){return R8(yn(n),e)})).apply(this,arguments)}function lk(n){return ck.apply(this,arguments)}function ck(){return(ck=T(function*(n){const e=yn(n);e._getPasswordPolicyInternal()&&(yield e._updatePasswordPolicy())})).apply(this,arguments)}function VSe(n,e,t){return mk.apply(this,arguments)}function mk(){return(mk=T(function*(n,e,t){if(ai(n.app))return Promise.reject(Kn(n));const r=yn(n),s=yield el(r,{returnSecureToken:!0,email:e,password:t,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",C8,"EMAIL_PASSWORD_PROVIDER").catch(l=>{throw"auth/password-does-not-meet-requirements"===l.code&&lk(n),l}),a=yield Ji._fromIdTokenResponse(r,"signIn",s);return yield r._updateCurrentUser(a.user),a})).apply(this,arguments)}function BSe(n,e,t){return ai(n.app)?Promise.reject(Kn(n)):function ek(n,e){return tk.apply(this,arguments)}(sn(n),I8.credential(e,t)).catch(function(){var r=T(function*(i){throw"auth/password-does-not-meet-requirements"===i.code&&lk(n),i});return function(i){return r.apply(this,arguments)}}())}function N8(n,e,t,r){return sn(n).onIdTokenChanged(e,t,r)}function KSe(n){return sn(n).signOut()}const ME="__sak";class O8{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(ME,"1"),this.storage.removeItem(ME),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}const eDe=(()=>{class n extends O8{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,r)=>this.onStorageEvent(t,r),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=f8(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const r of Object.keys(this.listeners)){const i=this.storage.getItem(r),o=this.localCache[r];i!==o&&t(r,o,i)}}onStorageEvent(t,r=!1){if(!t.key)return void this.forAllChangedKeys((a,l,c)=>{this.notifyListeners(a,c)});const i=t.key;r?this.detachListener():this.stopPolling();const o=()=>{const a=this.storage.getItem(i);!r&&this.localCache[i]===a||this.notifyListeners(i,a)},s=this.storage.getItem(i);!function qxe(){return function ZTe(){const n=_n();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}()&&10===document.documentMode}()||s===t.newValue||t.newValue===t.oldValue?o():setTimeout(o,10)}notifyListeners(t,r){this.localCache[t]=r;const i=this.listeners[t];if(i)for(const o of Array.from(i))o(r&&JSON.parse(r))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((t,r,i)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:r,newValue:i}),!0)})},1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,r){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(r)}_removeListener(t,r){this.listeners[t]&&(this.listeners[t].delete(r),0===this.listeners[t].size&&delete this.listeners[t]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}_set(t,r){var i=()=>super._set,o=this;return T(function*(){yield i().call(o,t,r),o.localCache[t]=JSON.stringify(r)})()}_get(t){var r=()=>super._get,i=this;return T(function*(){const o=yield r().call(i,t);return i.localCache[t]=JSON.stringify(o),o})()}_remove(t){var r=()=>super._remove,i=this;return T(function*(){yield r().call(i,t),delete i.localCache[t]})()}}return n.type="LOCAL",n})(),F8=(()=>{class n extends O8{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,r){}_removeListener(t,r){}}return n.type="SESSION",n})();let nDe=(()=>{class n{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){const r=this.receivers.find(o=>o.isListeningto(t));if(r)return r;const i=new n(t);return this.receivers.push(i),i}isListeningto(t){return this.eventTarget===t}handleEvent(t){var r=this;return T(function*(){const i=t,{eventId:o,eventType:s,data:a}=i.data,l=r.handlersMap[s];if(!l?.size)return;i.ports[0].postMessage({status:"ack",eventId:o,eventType:s});const c=Array.from(l).map(function(){var d=T(function*(f){return f(i.origin,a)});return function(f){return d.apply(this,arguments)}}()),u=yield function tDe(n){return Promise.all(n.map(function(){var e=T(function*(t){try{return{fulfilled:!0,value:yield t}}catch(r){return{fulfilled:!1,reason:r}}});return function(t){return e.apply(this,arguments)}}()))}(c);i.ports[0].postMessage({status:"done",eventId:o,eventType:s,response:u})})()}_subscribe(t,r){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(r)}_unsubscribe(t,r){this.handlersMap[t]&&r&&this.handlersMap[t].delete(r),(!r||0===this.handlersMap[t].size)&&delete this.handlersMap[t],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}return n.receivers=[],n})();function kE(n="",e=10){let t="";for(let r=0;r{const u=kE("",20);o.port1.start();const d=setTimeout(()=>{c(new Error("unsupported_event"))},r);a={messageChannel:o,onMessage(f){const p=f;if(p.data.eventId===u)switch(p.data.status){case"ack":clearTimeout(d),s=setTimeout(()=>{c(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),l(p.data.response);break;default:clearTimeout(d),clearTimeout(s),c(new Error("invalid_response"))}}},i.handlers.add(a),o.port1.addEventListener("message",a.onMessage),i.target.postMessage({eventType:e,eventId:u,data:t},[o.port2])}).finally(()=>{a&&i.removeMessageHandler(a)})})()}}function Sn(){return window}function Rk(){return typeof Sn().WorkerGlobalScope<"u"&&"function"==typeof Sn().importScripts}function Mk(){return(Mk=T(function*(){if(!navigator?.serviceWorker)return null;try{return(yield navigator.serviceWorker.ready).active}catch{return null}})).apply(this,arguments)}const L8="firebaseLocalStorageDb",NE="firebaseLocalStorage",V8="fbase_key";class Ag{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function PE(n,e){return n.transaction([NE],e?"readwrite":"readonly").objectStore(NE)}function kk(){const n=indexedDB.open(L8,1);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const r=n.result;try{r.createObjectStore(NE,{keyPath:V8})}catch(i){t(i)}}),n.addEventListener("success",T(function*(){const r=n.result;r.objectStoreNames.contains(NE)?e(r):(r.close(),yield function cDe(){const n=indexedDB.deleteDatabase(L8);return new Ag(n).toPromise()}(),e(yield kk()))}))})}function B8(n,e,t){return Nk.apply(this,arguments)}function Nk(){return(Nk=T(function*(n,e,t){const r=PE(n,!0).put({[V8]:e,value:t});return new Ag(r).toPromise()})).apply(this,arguments)}function Pk(){return(Pk=T(function*(n,e){const t=PE(n,!1).get(e),r=yield new Ag(t).toPromise();return void 0===r?null:r.value})).apply(this,arguments)}function U8(n,e){const t=PE(n,!0).delete(e);return new Ag(t).toPromise()}const fDe=(()=>{class n{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}_openDb(){var t=this;return T(function*(){return t.db||(t.db=yield kk()),t.db})()}_withRetries(t){var r=this;return T(function*(){let i=0;for(;;)try{const o=yield r._openDb();return yield t(o)}catch(o){if(i++>3)throw o;r.db&&(r.db.close(),r.db=void 0)}})()}initializeServiceWorkerMessaging(){var t=this;return T(function*(){return Rk()?t.initializeReceiver():t.initializeSender()})()}initializeReceiver(){var t=this;return T(function*(){t.receiver=nDe._getInstance(function aDe(){return Rk()?self:null}()),t.receiver._subscribe("keyChanged",function(){var r=T(function*(i,o){return{keyProcessed:(yield t._poll()).includes(o.key)}});return function(i,o){return r.apply(this,arguments)}}()),t.receiver._subscribe("ping",function(){var r=T(function*(i,o){return["keyChanged"]});return function(i,o){return r.apply(this,arguments)}}())})()}initializeSender(){var t=this;return T(function*(){var r,i;if(t.activeServiceWorker=yield function oDe(){return Mk.apply(this,arguments)}(),!t.activeServiceWorker)return;t.sender=new rDe(t.activeServiceWorker);const o=yield t.sender._send("ping",{},800);o&&null!==(r=o[0])&&void 0!==r&&r.fulfilled&&null!==(i=o[0])&&void 0!==i&&i.value.includes("keyChanged")&&(t.serviceWorkerReceiverAvailable=!0)})()}notifyServiceWorker(t){var r=this;return T(function*(){if(r.sender&&r.activeServiceWorker&&function sDe(){var n;return(null===(n=navigator?.serviceWorker)||void 0===n?void 0:n.controller)||null}()===r.activeServiceWorker)try{yield r.sender._send("keyChanged",{key:t},r.serviceWorkerReceiverAvailable?800:50)}catch{}})()}_isAvailable(){return T(function*(){try{if(!indexedDB)return!1;const t=yield kk();return yield B8(t,ME,"1"),yield U8(t,ME),!0}catch{}return!1})()}_withPendingWrite(t){var r=this;return T(function*(){r.pendingWrites++;try{yield t()}finally{r.pendingWrites--}})()}_set(t,r){var i=this;return T(function*(){return i._withPendingWrite(T(function*(){return yield i._withRetries(o=>B8(o,t,r)),i.localCache[t]=r,i.notifyServiceWorker(t)}))})()}_get(t){var r=this;return T(function*(){const i=yield r._withRetries(o=>function uDe(n,e){return Pk.apply(this,arguments)}(o,t));return r.localCache[t]=i,i})()}_remove(t){var r=this;return T(function*(){return r._withPendingWrite(T(function*(){return yield r._withRetries(i=>U8(i,t)),delete r.localCache[t],r.notifyServiceWorker(t)}))})()}_poll(){var t=this;return T(function*(){const r=yield t._withRetries(s=>{const a=PE(s,!1).getAll();return new Ag(a).toPromise()});if(!r)return[];if(0!==t.pendingWrites)return[];const i=[],o=new Set;if(0!==r.length)for(const{fbase_key:s,value:a}of r)o.add(s),JSON.stringify(t.localCache[s])!==JSON.stringify(a)&&(t.notifyListeners(s,a),i.push(s));for(const s of Object.keys(t.localCache))t.localCache[s]&&!o.has(s)&&(t.notifyListeners(s,null),i.push(s));return i})()}notifyListeners(t,r){this.localCache[t]=r;const i=this.listeners[t];if(i)for(const o of Array.from(i))o(r)}startPolling(){var t=this;this.stopPolling(),this.pollTimer=setInterval(T(function*(){return t._poll()}),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,r){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(r)}_removeListener(t,r){this.listeners[t]&&(this.listeners[t].delete(r),0===this.listeners[t].size&&delete this.listeners[t]),0===Object.keys(this.listeners).length&&this.stopPolling()}}return n.type="LOCAL",n})();function zc(n,e){return e?zs(e):(X(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}g8("rcb"),new gg(3e4,6e4);class qk extends Ig{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return js(e,this._buildIdpRequest())}_linkToIdToken(e,t){return js(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return js(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function EDe(n){return R8(n.auth,new qk(n),n.bypassAuthState)}function IDe(n){const{auth:e,user:t}=n;return X(t,e,"internal-error"),function A8(n,e){return ZM.apply(this,arguments)}(t,new qk(n),n.bypassAuthState)}function TDe(n){return Wk.apply(this,arguments)}function Wk(){return(Wk=T(function*(n){const{auth:e,user:t}=n;return X(t,e,"internal-error"),function QM(n,e){return YM.apply(this,arguments)}(t,new qk(n),n.bypassAuthState)})).apply(this,arguments)}class j8{constructor(e,t,r,i,o=!1){this.auth=e,this.resolver=r,this.user=i,this.bypassAuthState=o,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){var e=this;return new Promise(function(){var t=T(function*(r,i){e.pendingPromise={resolve:r,reject:i};try{e.eventManager=yield e.resolver._initialize(e.auth),yield e.onExecution(),e.eventManager.registerConsumer(e)}catch(o){e.reject(o)}});return function(r,i){return t.apply(this,arguments)}}())}onAuthEvent(e){var t=this;return T(function*(){const{urlResponse:r,sessionId:i,postBody:o,tenantId:s,error:a,type:l}=e;if(a)return void t.reject(a);const c={auth:t.auth,requestUri:r,sessionId:i,tenantId:s||void 0,postBody:o||void 0,user:t.user,bypassAuthState:t.bypassAuthState};try{t.resolve(yield t.getIdpTask(l)(c))}catch(u){t.reject(u)}})()}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return EDe;case"linkViaPopup":case"linkViaRedirect":return TDe;case"reauthViaPopup":case"reauthViaRedirect":return IDe;default:li(this.auth,"internal-error")}}resolve(e){Ls(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){Ls(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}const CDe=new gg(2e3,1e4);function xDe(n,e,t){return Gk.apply(this,arguments)}function Gk(){return(Gk=T(function*(n,e,t){if(ai(n.app))return Promise.reject(jr(n,"operation-not-supported-in-this-environment"));const r=yn(n);!function _h(n,e,t){if(!(e instanceof t))throw t.name!==e.constructor.name&&li(n,"argument-error"),nM(n,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}(n,e,Hs);const i=zc(r,t);return new Yk(r,"signInViaPopup",e,i).executeNotNull()})).apply(this,arguments)}let Yk=(()=>{class n extends j8{constructor(t,r,i,o,s){super(t,r,o,s),this.provider=i,this.authWindow=null,this.pollId=null,n.currentPopupAction&&n.currentPopupAction.cancel(),n.currentPopupAction=this}executeNotNull(){var t=this;return T(function*(){const r=yield t.execute();return X(r,t.auth,"internal-error"),r})()}onExecution(){var t=this;return T(function*(){Ls(1===t.filter.length,"Popup operations only handle one event");const r=kE();t.authWindow=yield t.resolver._openPopup(t.auth,t.provider,t.filter[0],r),t.authWindow.associatedEvent=r,t.resolver._originValidation(t.auth).catch(i=>{t.reject(i)}),t.resolver._isIframeWebStorageSupported(t.auth,i=>{i||t.reject(jr(t.auth,"web-storage-unsupported"))}),t.pollUserCancellation()})()}get eventId(){var t;return(null===(t=this.authWindow)||void 0===t?void 0:t.associatedEvent)||null}cancel(){this.reject(jr(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,n.currentPopupAction=null}pollUserCancellation(){const t=()=>{var r,i;this.pollId=null!==(i=null===(r=this.authWindow)||void 0===r?void 0:r.window)&&void 0!==i&&i.closed?window.setTimeout(()=>{this.pollId=null,this.reject(jr(this.auth,"popup-closed-by-user"))},8e3):window.setTimeout(t,CDe.get())};t()}}return n.currentPopupAction=null,n})();const Mg=new Map;class DDe extends j8{constructor(e,t,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r),this.eventId=null}execute(){var e=()=>super.execute,t=this;return T(function*(){let r=Mg.get(t.auth._key());if(!r){try{const o=(yield function ADe(n,e){return Xk.apply(this,arguments)}(t.resolver,t.auth))?yield e().call(t):null;r=()=>Promise.resolve(o)}catch(i){r=()=>Promise.reject(i)}Mg.set(t.auth._key(),r)}return t.bypassAuthState||Mg.set(t.auth._key(),()=>Promise.resolve(null)),r()})()}onAuthEvent(e){var t=()=>super.onAuthEvent,r=this;return T(function*(){if("signInViaRedirect"===e.type)return t().call(r,e);if("unknown"!==e.type){if(e.eventId){const i=yield r.auth._redirectUserForId(e.eventId);if(i)return r.user=i,t().call(r,e);r.resolve(null)}}else r.resolve(null)})()}onExecution(){return T(function*(){})()}cleanUp(){}}function Xk(){return(Xk=T(function*(n,e){const t=function $8(n){return TE("pendingRedirect",n.config.apiKey,n.name)}(e),r=function H8(n){return zs(n._redirectPersistence)}(n);if(!(yield r._isAvailable()))return!1;const i="true"===(yield r._get(t));return yield r._remove(t),i})).apply(this,arguments)}function RDe(n,e){Mg.set(n._key(),e)}function q8(n,e){return o1.apply(this,arguments)}function o1(){return(o1=T(function*(n,e,t=!1){if(ai(n.app))return Promise.reject(Kn(n));const r=yn(n),i=zc(r,e),s=yield new DDe(r,i,t).execute();return s&&!t&&(delete s.user._redirectEventId,yield r._persistUserIfCurrent(s.user),yield r._setRedirectUser(null,e)),s})).apply(this,arguments)}class ODe{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(t=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!function FDe(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return K8(n);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var r;if(e.error&&!K8(e)){const i=(null===(r=e.error.code)||void 0===r?void 0:r.split("auth/")[1])||"internal-error";t.onError(jr(this.auth,i))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const r=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(G8(e))}saveEventToCache(e){this.cachedEventUids.add(G8(e)),this.lastProcessedEventTime=Date.now()}}function G8(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function K8({type:n,error:e}){return"unknown"===n&&"auth/no-auth-event"===e?.code}function a1(){return(a1=T(function*(n,e={}){return Ft(n,"GET","/v1/projects",e)})).apply(this,arguments)}const VDe=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,BDe=/^https?/;function l1(){return l1=T(function*(n){if(n.config.emulator)return;const{authorizedDomains:e}=yield function LDe(n){return a1.apply(this,arguments)}(n);for(const t of e)try{if(zDe(t))return}catch{}li(n,"unauthorized-domain")}),l1.apply(this,arguments)}function zDe(n){const e=mg(),{protocol:t,hostname:r}=new URL(e);if(n.startsWith("chrome-extension://")){const s=new URL(n);return""===s.hostname&&""===r?"chrome-extension:"===t&&n.replace("chrome-extension://","")===e.replace("chrome-extension://",""):"chrome-extension:"===t&&s.hostname===r}if(!BDe.test(t))return!1;if(VDe.test(n))return r===n;const i=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}const jDe=new gg(3e4,6e4);function Q8(){const n=Sn().___jsl;if(n?.H)for(const e of Object.keys(n.H))if(n.H[e].r=n.H[e].r||[],n.H[e].L=n.H[e].L||[],n.H[e].r=[...n.H[e].L],n.CP)for(let t=0;t{var r,i,o;function s(){Q8(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{Q8(),t(jr(n,"network-request-failed"))},timeout:jDe.get()})}if(null!==(i=null===(r=Sn().gapi)||void 0===r?void 0:r.iframes)&&void 0!==i&&i.Iframe)e(gapi.iframes.getContext());else{if(null===(o=Sn().gapi)||void 0===o||!o.load){const a=g8("iframefcb");return Sn()[a]=()=>{gapi.load?s():t(jr(n,"network-request-failed"))},TM(`${function eSe(){return bg.gapiScript}()}?onload=${a}`).catch(l=>t(l))}s()}}).catch(e=>{throw OE=null,e})}(n),OE}(n),t=Sn().gapi;return X(t,n,"internal-error"),e.open({where:document.body,url:YDe(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:KDe,dontclear:!0},r=>new Promise(function(){var i=T(function*(o,s){yield r.restyle({setHideOnLeave:!1});const a=jr(n,"network-request-failed"),l=Sn().setTimeout(()=>{s(a)},qDe.get());function c(){Sn().clearTimeout(l),o(r)}r.ping(c).then(c,()=>{s(a)})});return function(o,s){return i.apply(this,arguments)}}()))}),c1.apply(this,arguments)}const ZDe={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class Y8{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}const aAe=encodeURIComponent("fac");function X8(n,e,t,r,i,o){return u1.apply(this,arguments)}function u1(){return(u1=T(function*(n,e,t,r,i,o){X(n.config.authDomain,n,"auth-domain-config-required"),X(n.config.apiKey,n,"invalid-api-key");const s={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:r,v:Lc,eventId:i};if(e instanceof Hs){e.setDefaultLanguage(n.languageCode),s.providerId=e.providerId||"",function rCe(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}(e.getCustomParameters())||(s.customParameters=JSON.stringify(e.getCustomParameters()));for(const[u,d]of Object.entries(o||{}))s[u]=d}if(e instanceof T8){const u=e.getScopes().filter(d=>""!==d);u.length>0&&(s.scopes=u.join(","))}n.tenantId&&(s.tid=n.tenantId);const a=s;for(const u of Object.keys(a))void 0===a[u]&&delete a[u];const l=yield n._getAppCheckToken(),c=l?`#${aAe}=${encodeURIComponent(l)}`:"";return`${function lAe({config:n}){return n.emulator?oM(n,"emulator/auth/handler"):`https://${n.authDomain}/__/auth/handler`}(n)}?${ig(a).slice(1)}${c}`})).apply(this,arguments)}const d1="webStorageSupport",Z8=class cAe{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=F8,this._completeRedirectFn=q8,this._overrideRedirectResult=RDe}_openPopup(e,t,r,i){var o=this;return T(function*(){var s;Ls(null===(s=o.eventManagers[e._key()])||void 0===s?void 0:s.manager,"_initialize() not called before _openPopup()");const a=yield X8(e,t,r,mg(),i);return function rAe(n,e,t,r=500,i=600){const o=Math.max((window.screen.availHeight-i)/2,0).toString(),s=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const l=Object.assign(Object.assign({},ZDe),{width:r.toString(),height:i.toString(),top:o,left:s}),c=_n().toLowerCase();t&&(a=l8(c)?"_blank":t),s8(c)&&(e=e||"http://localhost",l.scrollbars="yes");const u=Object.entries(l).reduce((f,[p,m])=>`${f}${p}=${m},`,"");if(function $xe(n=_n()){var e;return EM(n)&&!(null===(e=window.navigator)||void 0===e||!e.standalone)}(c)&&"_self"!==a)return function iAe(n,e){const t=document.createElement("a");t.href=n,t.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(r)}(e||"",a),new Y8(null);const d=window.open(e||"",a,u);X(d,n,"popup-blocked");try{d.focus()}catch{}return new Y8(d)}(e,a,kE())})()}_openRedirect(e,t,r,i){var o=this;return T(function*(){return yield o._originValidation(e),function iDe(n){Sn().location.href=n}(yield X8(e,t,r,mg(),i)),new Promise(()=>{})})()}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:i,promise:o}=this.eventManagers[t];return i?Promise.resolve(i):(Ls(o,"If manager is not set, promise should be"),o)}const r=this.initAndGetManager(e);return this.eventManagers[t]={promise:r},r.catch(()=>{delete this.eventManagers[t]}),r}initAndGetManager(e){var t=this;return T(function*(){const r=yield function XDe(n){return c1.apply(this,arguments)}(e),i=new ODe(e);return r.register("authEvent",o=>(X(o?.authEvent,e,"invalid-auth-event"),{status:i.onEvent(o.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),t.eventManagers[e._key()]={manager:i},t.iframes[e._key()]=r,i})()}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(d1,{type:d1},i=>{var o;const s=null===(o=i?.[0])||void 0===o?void 0:o[d1];void 0!==s&&t(!!s),li(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=function UDe(n){return l1.apply(this,arguments)}(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return f8()||a8()||EM()}};var n6="@firebase/auth";class uAe{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),(null===(e=this.auth.currentUser)||void 0===e?void 0:e.uid)||null}getToken(e){var t=this;return T(function*(){return t.assertAuthConfigured(),yield t.auth._initializationPromise,t.auth.currentUser?{accessToken:yield t.auth.currentUser.getIdToken(e)}:null})()}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(r=>{e(r?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){X(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}const pAe=XW("authIdTokenMaxAge")||300;let i6=null;const mAe=n=>function(){var e=T(function*(t){const r=t&&(yield t.getIdTokenResult()),i=r&&((new Date).getTime()-Date.parse(r.issuedAtTime))/1e3;if(i&&i>pAe)return;const o=r?.token;i6!==o&&(i6=o,yield fetch(n,{method:o?"POST":"DELETE",headers:o?{Authorization:`Bearer ${o}`}:{}}))});return function(t){return e.apply(this,arguments)}}();function gAe(n=cE()){const e=cg(n,"auth");if(e.isInitialized())return e.getImmediate();const t=function cSe(n,e){const t=cg(n,"auth");if(t.isInitialized()){const i=t.getImmediate();if(ph(t.getOptions(),e??{}))return i;li(i,"already-initialized")}return t.initialize({options:e})}(n,{popupRedirectResolver:Z8,persistence:[fDe,eDe,F8]}),r=XW("authTokenSyncURL");if(r&&"boolean"==typeof isSecureContext&&isSecureContext){const o=new URL(r,location.origin);if(location.origin===o.origin){const s=mAe(o.toString());(function GSe(n,e,t){sn(n).beforeAuthStateChanged(e,t)})(t,s,()=>s(t.currentUser)),N8(t,a=>s(a))}}const i=KW("auth");return i&&function dSe(n,e,t){const r=yn(n);X(r._canInitEmulator,r,"emulator-config-failed"),X(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!!t?.disableWarnings,o=v8(e),{host:s,port:a}=function hSe(n){const e=v8(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};const r=t[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const o=i[1];return{host:o,port:b8(r.substr(o.length+1))}}{const[o,s]=r.split(":");return{host:o,port:b8(s)}}}(e);r.config.emulator={url:`${o}//${s}${null===a?"":`:${a}`}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:s,port:a,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||function fSe(){function n(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&"function"==typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",n):n())}()}(t,`http://${i}`),t}function o6(n){return new vt(function(e){return{unsubscribe:N8(n,e.next.bind(e),e.error.bind(e),e.complete.bind(e))}})}(function Xxe(n){bg=n})({loadJS:n=>new Promise((e,t)=>{const r=document.createElement("script");r.setAttribute("src",n),r.onload=e,r.onerror=i=>{const o=jr("internal-error");o.customData=i,t(o)},r.type="text/javascript",r.charset="UTF-8",function _Ae(){var n,e;return null!==(e=null===(n=document.getElementsByTagName("head"))||void 0===n?void 0:n[0])&&void 0!==e?e:document}().appendChild(r)}),gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="}),function hAe(n){Fs(new Go("auth",(e,{options:t})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),o=e.getProvider("app-check-internal"),{apiKey:s,authDomain:a}=r.options;X(s&&!s.includes(":"),"invalid-api-key",{appName:r.name});const l={apiKey:s,authDomain:a,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:p8(n)},c=new Yxe(r,i,o,l);return function uSe(n,e){const t=e?.persistence||[],r=(Array.isArray(t)?t:[t]).map(zs);e?.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(r,e?.popupRedirectResolver)}(c,t),c},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider("auth-internal").initialize()})),Fs(new Go("auth-internal",e=>{const t=yn(e.getProvider("auth").getImmediate());return new uAe(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),Gn(n6,"1.9.0",function dAe(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}(n)),Gn(n6,"1.9.0","esm2017")}("Browser");class LE{constructor(e){return e}}class f1{constructor(){return dE("auth")}}const p1=new B("angularfire2.auth-instances");function vAe(n){return(e,t)=>{const r=e.runOutsideAngular(()=>n(t));return new LE(r)}}const bAe={provide:f1,deps:[[new fn,p1]]},wAe={provide:LE,useFactory:function yAe(n,e){const t=uE("auth",n,e);return t&&new LE(t)},deps:[[new fn,p1],Bc]},IAe=ir(o6,!0),TAe=ir(VSe,!0,2),CAe=ir(gAe,!0),xAe=ir(BSe,!0,2),SAe=ir(xDe,!0,2),DAe=ir(KSe,!0,2);var tl,c6,a6=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},l6={};(function(){var n;function r(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.B=Array(this.blockSize),this.o=this.h=0,this.s()}function i(S,I,x){x||(x=0);var A=Array(16);if("string"==typeof I)for(var M=0;16>M;++M)A[M]=I.charCodeAt(x++)|I.charCodeAt(x++)<<8|I.charCodeAt(x++)<<16|I.charCodeAt(x++)<<24;else for(M=0;16>M;++M)A[M]=I[x++]|I[x++]<<8|I[x++]<<16|I[x++]<<24;var P=S.g[3],D=(I=S.g[0])+(P^(x=S.g[1])&((M=S.g[2])^P))+A[0]+3614090360&4294967295;D=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=(x=(M=(P=(I=x+(D<<7&4294967295|D>>>25))+((D=P+(M^I&(x^M))+A[1]+3905402710&4294967295)<<12&4294967295|D>>>20))+((D=M+(x^P&(I^x))+A[2]+606105819&4294967295)<<17&4294967295|D>>>15))+((D=x+(I^M&(P^I))+A[3]+3250441966&4294967295)<<22&4294967295|D>>>10))+((D=I+(P^x&(M^P))+A[4]+4118548399&4294967295)<<7&4294967295|D>>>25))+((D=P+(M^I&(x^M))+A[5]+1200080426&4294967295)<<12&4294967295|D>>>20))+((D=M+(x^P&(I^x))+A[6]+2821735955&4294967295)<<17&4294967295|D>>>15))+((D=x+(I^M&(P^I))+A[7]+4249261313&4294967295)<<22&4294967295|D>>>10))+((D=I+(P^x&(M^P))+A[8]+1770035416&4294967295)<<7&4294967295|D>>>25))+((D=P+(M^I&(x^M))+A[9]+2336552879&4294967295)<<12&4294967295|D>>>20))+((D=M+(x^P&(I^x))+A[10]+4294925233&4294967295)<<17&4294967295|D>>>15))+((D=x+(I^M&(P^I))+A[11]+2304563134&4294967295)<<22&4294967295|D>>>10))+((D=I+(P^x&(M^P))+A[12]+1804603682&4294967295)<<7&4294967295|D>>>25))+((D=P+(M^I&(x^M))+A[13]+4254626195&4294967295)<<12&4294967295|D>>>20))+((D=M+(x^P&(I^x))+A[14]+2792965006&4294967295)<<17&4294967295|D>>>15))+((D=x+(I^M&(P^I))+A[15]+1236535329&4294967295)<<22&4294967295|D>>>10))+((D=I+(M^P&(x^M))+A[1]+4129170786&4294967295)<<5&4294967295|D>>>27))+((D=P+(x^M&(I^x))+A[6]+3225465664&4294967295)<<9&4294967295|D>>>23))+((D=M+(I^x&(P^I))+A[11]+643717713&4294967295)<<14&4294967295|D>>>18))+((D=x+(P^I&(M^P))+A[0]+3921069994&4294967295)<<20&4294967295|D>>>12))+((D=I+(M^P&(x^M))+A[5]+3593408605&4294967295)<<5&4294967295|D>>>27))+((D=P+(x^M&(I^x))+A[10]+38016083&4294967295)<<9&4294967295|D>>>23))+((D=M+(I^x&(P^I))+A[15]+3634488961&4294967295)<<14&4294967295|D>>>18))+((D=x+(P^I&(M^P))+A[4]+3889429448&4294967295)<<20&4294967295|D>>>12))+((D=I+(M^P&(x^M))+A[9]+568446438&4294967295)<<5&4294967295|D>>>27))+((D=P+(x^M&(I^x))+A[14]+3275163606&4294967295)<<9&4294967295|D>>>23))+((D=M+(I^x&(P^I))+A[3]+4107603335&4294967295)<<14&4294967295|D>>>18))+((D=x+(P^I&(M^P))+A[8]+1163531501&4294967295)<<20&4294967295|D>>>12))+((D=I+(M^P&(x^M))+A[13]+2850285829&4294967295)<<5&4294967295|D>>>27))+((D=P+(x^M&(I^x))+A[2]+4243563512&4294967295)<<9&4294967295|D>>>23))+((D=M+(I^x&(P^I))+A[7]+1735328473&4294967295)<<14&4294967295|D>>>18))+((D=x+(P^I&(M^P))+A[12]+2368359562&4294967295)<<20&4294967295|D>>>12))+((D=I+(x^M^P)+A[5]+4294588738&4294967295)<<4&4294967295|D>>>28))+((D=P+(I^x^M)+A[8]+2272392833&4294967295)<<11&4294967295|D>>>21))+((D=M+(P^I^x)+A[11]+1839030562&4294967295)<<16&4294967295|D>>>16))+((D=x+(M^P^I)+A[14]+4259657740&4294967295)<<23&4294967295|D>>>9))+((D=I+(x^M^P)+A[1]+2763975236&4294967295)<<4&4294967295|D>>>28))+((D=P+(I^x^M)+A[4]+1272893353&4294967295)<<11&4294967295|D>>>21))+((D=M+(P^I^x)+A[7]+4139469664&4294967295)<<16&4294967295|D>>>16))+((D=x+(M^P^I)+A[10]+3200236656&4294967295)<<23&4294967295|D>>>9))+((D=I+(x^M^P)+A[13]+681279174&4294967295)<<4&4294967295|D>>>28))+((D=P+(I^x^M)+A[0]+3936430074&4294967295)<<11&4294967295|D>>>21))+((D=M+(P^I^x)+A[3]+3572445317&4294967295)<<16&4294967295|D>>>16))+((D=x+(M^P^I)+A[6]+76029189&4294967295)<<23&4294967295|D>>>9))+((D=I+(x^M^P)+A[9]+3654602809&4294967295)<<4&4294967295|D>>>28))+((D=P+(I^x^M)+A[12]+3873151461&4294967295)<<11&4294967295|D>>>21))+((D=M+(P^I^x)+A[15]+530742520&4294967295)<<16&4294967295|D>>>16))+((D=x+(M^P^I)+A[2]+3299628645&4294967295)<<23&4294967295|D>>>9))+((D=I+(M^(x|~P))+A[0]+4096336452&4294967295)<<6&4294967295|D>>>26))+((D=P+(x^(I|~M))+A[7]+1126891415&4294967295)<<10&4294967295|D>>>22))+((D=M+(I^(P|~x))+A[14]+2878612391&4294967295)<<15&4294967295|D>>>17))+((D=x+(P^(M|~I))+A[5]+4237533241&4294967295)<<21&4294967295|D>>>11))+((D=I+(M^(x|~P))+A[12]+1700485571&4294967295)<<6&4294967295|D>>>26))+((D=P+(x^(I|~M))+A[3]+2399980690&4294967295)<<10&4294967295|D>>>22))+((D=M+(I^(P|~x))+A[10]+4293915773&4294967295)<<15&4294967295|D>>>17))+((D=x+(P^(M|~I))+A[1]+2240044497&4294967295)<<21&4294967295|D>>>11))+((D=I+(M^(x|~P))+A[8]+1873313359&4294967295)<<6&4294967295|D>>>26))+((D=P+(x^(I|~M))+A[15]+4264355552&4294967295)<<10&4294967295|D>>>22))+((D=M+(I^(P|~x))+A[6]+2734768916&4294967295)<<15&4294967295|D>>>17))+((D=x+(P^(M|~I))+A[13]+1309151649&4294967295)<<21&4294967295|D>>>11))+((P=(I=x+((D=I+(M^(x|~P))+A[4]+4149444226&4294967295)<<6&4294967295|D>>>26))+((D=P+(x^(I|~M))+A[11]+3174756917&4294967295)<<10&4294967295|D>>>22))^((M=P+((D=M+(I^(P|~x))+A[2]+718787259&4294967295)<<15&4294967295|D>>>17))|~I))+A[9]+3951481745&4294967295,S.g[0]=S.g[0]+I&4294967295,S.g[1]=S.g[1]+(M+(D<<21&4294967295|D>>>11))&4294967295,S.g[2]=S.g[2]+M&4294967295,S.g[3]=S.g[3]+P&4294967295}function s(S,I){this.h=I;for(var x=[],A=!0,M=S.length-1;0<=M;M--){var P=0|S[M];A&&P==I||(x[M]=P,A=!1)}this.g=x}(function e(S,I){function x(){}x.prototype=I.prototype,S.D=I.prototype,S.prototype=new x,S.prototype.constructor=S,S.C=function(A,M,P){for(var D=Array(arguments.length-2),so=2;sothis.h?this.blockSize:2*this.blockSize)-this.h);S[0]=128;for(var I=1;II;++I)for(var A=0;32>A;A+=8)S[x++]=this.g[I]>>>A&255;return S};var a={};function l(S){return-128<=S&&128>S?function o(S,I){var x=a;return Object.prototype.hasOwnProperty.call(x,S)?x[S]:x[S]=I(S)}(S,function(I){return new s([0|I],0>I?-1:0)}):new s([0|S],0>S?-1:0)}function c(S){if(isNaN(S)||!isFinite(S))return d;if(0>S)return v(c(-S));for(var I=[],x=1,A=0;S>=x;A++)I[A]=S/x|0,x*=4294967296;return new s(I,0)}var d=l(0),f=l(1),p=l(16777216);function m(S){if(0!=S.h)return!1;for(var I=0;I>>16,S[I]&=65535,I++}function R(S,I){this.g=S,this.h=I}function V(S,I){if(m(I))throw Error("division by zero");if(m(S))return new R(d,d);if(_(S))return I=V(v(S),I),new R(v(I.g),v(I.h));if(_(I))return I=V(S,v(I)),new R(v(I.g),I.h);if(30=A.l(S);)x=H(x),A=H(A);var M=Q(x,1),P=Q(A,1);for(A=Q(A,2),x=Q(x,2);!m(A);){var D=P.add(A);0>=D.l(S)&&(M=M.add(x),P=D),A=Q(A,1),x=Q(x,1)}return I=E(S,M.j(I)),new R(M,I)}for(M=d;0<=S.l(I);){for(x=Math.max(1,Math.floor(S.m()/I.m())),A=48>=(A=Math.ceil(Math.log(x)/Math.LN2))?1:Math.pow(2,A-48),D=(P=c(x)).j(I);_(D)||0>>31;return new s(x,S.h)}function Q(S,I){var x=I>>5;I%=32;for(var A=S.g.length-x,M=[],P=0;P>>I|S.i(P+x+1)<<32-I:S.i(P+x);return new s(M,S.h)}(n=s.prototype).m=function(){if(_(this))return-v(this).m();for(var S=0,I=1,x=0;x(S=S||10)||36>>0).toString(S);if(m(x=M))return P+A;for(;6>P.length;)P="0"+P;A=P+A}},n.i=function(S){return 0>S?0:S>>16)+(this.i(M)>>>16)+(S.i(M)>>>16);A=D>>>16,x[M]=(D&=65535)<<16|(P&=65535)}return new s(x,-2147483648&x[x.length-1]?-1:0)},n.j=function(S){if(m(this)||m(S))return d;if(_(this))return _(S)?v(this).j(v(S)):v(v(this).j(S));if(_(S))return v(this.j(v(S)));if(0>this.l(p)&&0>S.l(p))return c(this.m()*S.m());for(var I=this.g.length+S.g.length,x=[],A=0;A<2*I;A++)x[A]=0;for(A=0;A>>16,D=65535&this.i(A),so=S.i(M)>>>16,Vl=65535&S.i(M);x[2*A+2*M]+=D*Vl,C(x,2*A+2*M),x[2*A+2*M+1]+=P*Vl,C(x,2*A+2*M+1),x[2*A+2*M+1]+=D*so,C(x,2*A+2*M+1),x[2*A+2*M+2]+=P*so,C(x,2*A+2*M+2)}for(A=0;A(I=I||10)||36P?(P=c(Math.pow(I,P)),A=A.j(P).add(c(D))):A=(A=A.j(x)).add(c(D))}return A},tl=l6.Integer=s}).apply(typeof a6<"u"?a6:typeof self<"u"?self:typeof window<"u"?window:{});var u6,kg,d6,BE,m1,h6,f6,p6,VE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},$s={};(function(){var n,e="function"==typeof Object.defineProperties?Object.defineProperty:function(h,g,y){return h==Array.prototype||h==Object.prototype||(h[g]=y.value),h},r=function t(h){h=["object"==typeof globalThis&&globalThis,h,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof VE&&VE];for(var g=0;g{throw h},0)}function D(){var h=Ue;let g=null;return h.g&&(g=h.g,h.g=h.g.next,h.g||(h.h=null),g.next=null),g}var Vl=new class E{constructor(g,y){this.i=g,this.j=y,this.h=0,this.g=null}get(){let g;return 0new ae,h=>h.reset());class ae{constructor(){this.next=this.g=this.h=null}set(g,y){this.h=g,this.g=y,this.next=null}reset(){this.next=this.g=this.h=null}}let ce,he=!1,Ue=new class so{constructor(){this.h=this.g=null}add(g,y){const w=Vl.get();w.set(g,y),this.h?this.h.next=w:this.g=w,this.h=w}},En=()=>{const h=a.Promise.resolve(void 0);ce=()=>{h.then(ao)}};var ao=()=>{for(var h;h=D();){try{h.h.call(h.g)}catch(y){P(y)}var g=Vl;g.j(h),100>g.h&&(g.h++,h.next=g.g,g.g=h)}he=!1};function cn(){this.s=this.s,this.C=this.C}function Vt(h,g){this.type=h,this.g=this.target=g,this.defaultPrevented=!1}cn.prototype.s=!1,cn.prototype.ma=function(){this.s||(this.s=!0,this.N())},cn.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()},Vt.prototype.h=function(){this.defaultPrevented=!0};var Bt=function(){if(!a.addEventListener||!Object.defineProperty)return!1;var h=!1,g=Object.defineProperty({},"passive",{get:function(){h=!0}});try{const y=()=>{};a.addEventListener("test",y,g),a.removeEventListener("test",y,g)}catch{}return h}();function Bl(h,g){if(Vt.call(this,h?h.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,h){var y=this.type=h.type,w=h.changedTouches&&h.changedTouches.length?h.changedTouches[0]:null;if(this.target=h.target||h.srcElement,this.g=g,g=h.relatedTarget){if(H){e:{try{V(g.nodeName);var k=!0;break e}catch{}k=!1}k||(g=null)}}else"mouseover"==y?g=h.fromElement:"mouseout"==y&&(g=h.toElement);this.relatedTarget=g,w?(this.clientX=void 0!==w.clientX?w.clientX:w.pageX,this.clientY=void 0!==w.clientY?w.clientY:w.pageY,this.screenX=w.screenX||0,this.screenY=w.screenY||0):(this.clientX=void 0!==h.clientX?h.clientX:h.pageX,this.clientY=void 0!==h.clientY?h.clientY:h.pageY,this.screenX=h.screenX||0,this.screenY=h.screenY||0),this.button=h.button,this.key=h.key||"",this.ctrlKey=h.ctrlKey,this.altKey=h.altKey,this.shiftKey=h.shiftKey,this.metaKey=h.metaKey,this.pointerId=h.pointerId||0,this.pointerType="string"==typeof h.pointerType?h.pointerType:mL[h.pointerType]||"",this.state=h.state,this.i=h,h.defaultPrevented&&Bl.aa.h.call(this)}}m(Bl,Vt);var mL={2:"touch",3:"pen",4:"mouse"};Bl.prototype.h=function(){Bl.aa.h.call(this);var h=this.i;h.preventDefault?h.preventDefault():h.returnValue=!1};var un="closure_listenable_"+(1e6*Math.random()|0),ua=0;function pi(h,g,y,w,k){this.listener=h,this.proxy=null,this.src=g,this.type=y,this.capture=!!w,this.ha=k,this.key=++ua,this.da=this.fa=!1}function da(h){h.da=!0,h.listener=null,h.proxy=null,h.src=null,h.ha=null}function Ul(h){this.src=h,this.g={},this.h=0}function gL(h,g){var y=g.type;if(y in h.g){var U,w=h.g[y],k=Array.prototype.indexOf.call(w,g,void 0);(U=0<=k)&&Array.prototype.splice.call(w,k,1),U&&(da(g),0==h.g[y].length&&(delete h.g[y],h.h--))}}function _L(h,g,y,w){for(var k=0;k>>0);function IL(h){return"function"==typeof h?h:(h[EL]||(h[EL]=function(g){return h.handleEvent(g)}),h[EL])}function Dr(){cn.call(this),this.i=new Ul(this),this.M=this,this.F=null}function Kr(h,g){var y,w=h.F;if(w)for(y=[];w;w=w.F)y.push(w);if(h=h.M,w=g.type||g,"string"==typeof g)g=new Vt(g,h);else if(g instanceof Vt)g.target=g.target||h;else{var k=g;A(g=new Vt(w,h),k)}if(k=!0,y)for(var U=y.length-1;0<=U;U--){var J=g.g=y[U];k=rC(J,w,!0,g)&&k}if(k=rC(J=g.g=h,w,!0,g)&&k,k=rC(J,w,!1,g)&&k,y)for(U=0;U{h.g=null,h.i&&(h.i=!1,Lee(h))},h.l);const g=h.h;h.h=null,h.m.apply(null,g)}m(Dr,cn),Dr.prototype[un]=!0,Dr.prototype.removeEventListener=function(h,g,y,w){Pee(this,h,g,y,w)},Dr.prototype.N=function(){if(Dr.aa.N.call(this),this.i){var g,h=this.i;for(g in h.g){for(var y=h.g[g],w=0;ww.length)){var k=w[1];if(Array.isArray(k)&&!(1>k.length)){var U=k[0];if("noop"!=U&&"stop"!=U&&"close"!=U)for(var J=1;Jg.length?AL:(g=g.slice(w,w+y),h.C=w+y,g))}function aC(h){h.S=Date.now()+h.I,Xee(h,h.I)}function Xee(h,g){if(null!=h.B)throw Error("WatchDog timer not null");h.B=ay(f(h.ba,h),g)}function ML(h){h.B&&(a.clearTimeout(h.B),h.B=null)}function cy(h){0==h.j.G||h.J||Ite(h.j,h)}function Ou(h){ML(h);var g=h.M;g&&"function"==typeof g.ma&&g.ma(),h.M=null,Bee(h.U),h.g&&(g=h.g,h.g=null,g.abort(),g.ma())}function kL(h,g){try{var y=h.j;if(0!=y.G&&(y.g==h||NL(y.h,h)))if(!h.K&&NL(y.h,h)&&3==y.G){try{var w=y.Da.g.parse(g)}catch{w=null}if(Array.isArray(w)&&3==w.length){var k=w;if(0==k[0]){e:if(!y.u){if(y.g){if(!(y.g.F+3e3k[2]&&y.F&&0==y.v&&!y.C&&(y.C=ay(f(y.Za,y),6e3));if(1>=ete(y.h)&&y.ca){try{y.ca()}catch{}y.ca=void 0}}else Lu(y,11)}else if((h.K||y.g==h)&&mC(y),!C(g))for(k=y.Da.g.parse(g),g=0;gRr)&&(3!=Rr||this.g&&(this.h.h||this.g.oa()||gte(this.g)))){this.J||4!=Rr||7==g||sy(),ML(this);var y=this.g.Z();this.X=y;t:if(Yee(this)){var w=gte(this.g);h="";var k=w.length,U=4==fa(this.g);if(!this.h.i){if(typeof TextDecoder>"u"){Ou(this),cy(this);var J="";break t}this.h.i=new a.TextDecoder}for(g=0;g=h.j}function ete(h){return h.h?1:h.g?h.g.size:0}function NL(h,g){return h.h?h.h==g:!!h.g&&h.g.has(g)}function PL(h,g){h.g?h.g.add(g):h.h=g}function tte(h,g){h.h&&h.h==g?h.h=null:h.g&&h.g.has(g)&&h.g.delete(g)}function nte(h){if(null!=h.h)return h.i.concat(h.h.D);if(null!=h.g&&0!==h.g.size){let g=h.i;for(const y of h.g.values())g=g.concat(y.D);return g}return _(h.i)}function rte(h,g){if(h.forEach&&"function"==typeof h.forEach)h.forEach(g,void 0);else if(l(h)||"string"==typeof h)Array.prototype.forEach.call(h,g,void 0);else for(var y=function S$e(h){if(h.na&&"function"==typeof h.na)return h.na();if(!h.V||"function"!=typeof h.V){if(typeof Map<"u"&&h instanceof Map)return Array.from(h.keys());if(!(typeof Set<"u"&&h instanceof Set)){if(l(h)||"string"==typeof h){var g=[];h=h.length;for(var y=0;yg)throw Error("Bad port number "+g);h.s=g}else h.s=null}function ote(h,g,y){g instanceof hy?(h.i=g,function P$e(h,g){g&&!h.j&&(jl(h),h.i=null,h.g.forEach(function(y,w){var k=w.toLowerCase();w!=k&&(ate(this,w),cte(this,k,y))},h)),h.j=g}(h.i,h.h)):(y||(g=dy(g,k$e)),h.i=new hy(g,h.h))}function Ut(h,g,y){h.i.set(g,y)}function uC(h){return Ut(h,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),h}function uy(h,g){return h?g?decodeURI(h.replace(/%25/g,"%2525")):decodeURIComponent(h):""}function dy(h,g,y){return"string"==typeof h?(h=encodeURI(h).replace(g,A$e),y&&(h=h.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),h):null}function A$e(h){return"%"+((h=h.charCodeAt(0))>>4&15).toString(16)+(15&h).toString(16)}Fu.prototype.toString=function(){var h=[],g=this.j;g&&h.push(dy(g,ste,!0),":");var y=this.g;return(y||"file"==g)&&(h.push("//"),(g=this.o)&&h.push(dy(g,ste,!0),"@"),h.push(encodeURIComponent(String(y)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(y=this.s)&&h.push(":",String(y))),(y=this.l)&&(this.g&&"/"!=y.charAt(0)&&h.push("/"),h.push(dy(y,"/"==y.charAt(0)?M$e:R$e,!0))),(y=this.i.toString())&&h.push("?",y),(y=this.m)&&h.push("#",dy(y,N$e)),h.join("")};var ste=/[#\/\?@]/g,R$e=/[#\?:]/g,M$e=/[#\?]/g,k$e=/[#\?@]/g,N$e=/#/g;function hy(h,g){this.h=this.g=null,this.i=h||null,this.j=!!g}function jl(h){h.g||(h.g=new Map,h.h=0,h.i&&function D$e(h,g){if(h){h=h.split("&");for(var y=0;y{}),1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,py(this)),this.readyState=0},n.Sa=function(h){if(this.g&&(this.l=h,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=h.headers,this.readyState=2,my(this)),this.g&&(this.readyState=3,my(this),this.g)))if("arraybuffer"===this.responseType)h.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof a.ReadableStream<"u"&&"body"in h){if(this.j=h.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.v=new TextDecoder;ute(this)}else h.text().then(this.Ra.bind(this),this.ga.bind(this))},n.Pa=function(h){if(this.g){if(this.o&&h.value)this.response.push(h.value);else if(!this.o){var g=h.value?h.value:new Uint8Array(0);(g=this.v.decode(g,{stream:!h.done}))&&(this.response=this.responseText+=g)}h.done?py(this):my(this),3==this.readyState&&ute(this)}},n.Ra=function(h){this.g&&(this.response=this.responseText=h,py(this))},n.Qa=function(h){this.g&&(this.response=h,py(this))},n.ga=function(){this.g&&py(this)},n.setRequestHeader=function(h,g){this.u.append(h,g)},n.getResponseHeader=function(h){return this.h&&this.h.get(h.toLowerCase())||""},n.getAllResponseHeaders=function(){if(!this.h)return"";const h=[],g=this.h.entries();for(var y=g.next();!y.done;)h.push((y=y.value)[0]+": "+y[1]),y=g.next();return h.join("\r\n")},Object.defineProperty(dC.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(h){this.m=h?"include":"same-origin"}}),m(dn,Dr);var B$e=/^https?$/i,U$e=["POST","PUT"];function hte(h,g){h.h=!1,h.g&&(h.j=!0,h.g.abort(),h.j=!1),h.l=g,h.m=5,fte(h),hC(h)}function fte(h){h.A||(h.A=!0,Kr(h,"complete"),Kr(h,"error"))}function pte(h){if(h.h&&typeof s<"u"&&(!h.v[1]||4!=fa(h)||2!=h.Z()))if(h.u&&4==fa(h))Fee(h.Ea,0,h);else if(Kr(h,"readystatechange"),4==fa(h)){h.h=!1;try{const J=h.Z();e:switch(J){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var g=!0;break e;default:g=!1}var y;if(!(y=g)){var w;if(w=0===J){var k=String(h.D).match(ite)[1]||null;!k&&a.self&&a.self.location&&(k=a.self.location.protocol.slice(0,-1)),w=!B$e.test(k?k.toLowerCase():"")}y=w}if(y)Kr(h,"complete"),Kr(h,"success");else{h.m=6;try{var U=2{}:null;h.g=null,h.v=null,g||Kr(h,"ready");try{y.onreadystatechange=w}catch{}}}function mte(h){h.I&&(a.clearTimeout(h.I),h.I=null)}function fa(h){return h.g?h.g.readyState:0}function gte(h){try{if(!h.g)return null;if("response"in h.g)return h.g.response;switch(h.H){case"":case"text":return h.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in h.g)return h.g.mozResponseArrayBuffer}return null}catch{return null}}function gy(h,g,y){return y&&y.internalChannelParams&&y.internalChannelParams[h]||g}function _te(h){this.Aa=0,this.i=[],this.j=new ly,this.ia=this.qa=this.I=this.W=this.g=this.ya=this.D=this.H=this.m=this.S=this.o=null,this.Ya=this.U=0,this.Va=gy("failFast",!1,h),this.F=this.C=this.u=this.s=this.l=null,this.X=!0,this.za=this.T=-1,this.Y=this.v=this.B=0,this.Ta=gy("baseRetryDelayMs",5e3,h),this.cb=gy("retryDelaySeedMs",1e4,h),this.Wa=gy("forwardChannelMaxRetries",2,h),this.wa=gy("forwardChannelRequestTimeoutMs",2e4,h),this.pa=h&&h.xmlHttpFactory||void 0,this.Xa=h&&h.Tb||void 0,this.Ca=h&&h.useFetchStreams||!1,this.L=void 0,this.J=h&&h.supportsCrossDomainXhr||!1,this.K="",this.h=new Zee(h&&h.concurrentRequestLimit),this.Da=new L$e,this.P=h&&h.fastHandshake||!1,this.O=h&&h.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.Ua=h&&h.Rb||!1,h&&h.xa&&this.j.xa(),h&&h.forceLongPolling&&(this.X=!1),this.ba=!this.P&&this.X&&h&&h.detectBufferingProxy||!1,this.ja=void 0,h&&h.longPollingTimeout&&0ot)U=Math.max(0,k[fr].g-100),xt=!1;else try{V$e(Ar,J,"req"+ot+"_")}catch{w&&w(Ar)}}if(xt){w=J.join("&");break e}}}return h=h.i.splice(0,y),g.D=h,w}function wte(h){if(!h.g&&!h.u){h.Y=1;var g=h.Fa;ce||En(),he||(ce(),he=!0),Ue.add(g,h),h.v=0}}function LL(h){return!(h.g||h.u||3<=h.v||(h.Y++,h.u=ay(f(h.Fa,h),Tte(h,h.v)),h.v++,0))}function VL(h){null!=h.A&&(a.clearTimeout(h.A),h.A=null)}function Ete(h){h.g=new zl(h,h.j,"rpc",h.Y),null===h.m&&(h.g.H=h.o),h.g.O=0;var g=ha(h.qa);Ut(g,"RID","rpc"),Ut(g,"SID",h.K),Ut(g,"AID",h.T),Ut(g,"CI",h.F?"0":"1"),!h.F&&h.ja&&Ut(g,"TO",h.ja),Ut(g,"TYPE","xmlhttp"),_y(h,g),h.m&&h.o&&OL(g,h.m,h.o),h.L&&(h.g.I=h.L);var y=h.g;h=h.ia,y.L=1,y.v=uC(ha(g)),y.m=null,y.P=!0,Qee(y,h)}function mC(h){null!=h.C&&(a.clearTimeout(h.C),h.C=null)}function Ite(h,g){var y=null;if(h.g==g){mC(h),VL(h),h.g=null;var w=2}else{if(!NL(h.h,g))return;y=g.D,tte(h.h,g),w=1}if(0!=h.G)if(g.o)if(1==w){y=g.m?g.m.length:0,g=Date.now()-g.F;var k=h.B;Kr(w=iC(),new qee(w,y)),pC(h)}else wte(h);else if(3==(k=g.s)||0==k&&0=h.h.j-(h.s?1:0)||(h.s?(h.i=g.D.concat(h.i),0):1==h.G||2==h.G||h.B>=(h.Va?0:h.Wa)||(h.s=ay(f(h.Ga,h,g),Tte(h,h.B)),h.B++,0)))}(h,g)||2==w&&LL(h)))switch(y&&0{w.abort(),Hl(0,0,!1,g)},1e4);fetch(h,{signal:w.signal}).then(U=>{clearTimeout(k),Hl(0,0,!!U.ok,g)}).catch(()=>{clearTimeout(k),Hl(0,0,!1,g)})}(w.toString(),y)}else Qr(2);h.G=0,h.l&&h.l.sa(g),Cte(h),yte(h)}function Cte(h){if(h.G=0,h.ka=[],h.l){const g=nte(h.h);(0!=g.length||0!=h.i.length)&&(v(h.ka,g),v(h.ka,h.i),h.h.i.length=0,_(h.i),h.i.length=0),h.l.ra()}}function xte(h,g,y){var w=y instanceof Fu?ha(y):new Fu(y);if(""!=w.g)g&&(w.g=g+"."+w.g),cC(w,w.s);else{var k=a.location;w=k.protocol,g=g?g+"."+k.hostname:k.hostname,k=+k.port;var U=new Fu(null);w&&lC(U,w),g&&(U.g=g),k&&cC(U,k),y&&(U.l=y),w=U}return g=h.ya,(y=h.D)&&g&&Ut(w,y,g),Ut(w,"VER",h.la),_y(h,w),w}function Ste(h,g,y){if(g&&!h.J)throw Error("Can't create secondary domain capable XhrIo object.");return(g=new dn(h.Ca&&!h.pa?new fy({eb:y}):h.pa)).Ha(h.J),g}function Dte(){}function gC(){}function Vi(h,g){Dr.call(this),this.g=new _te(g),this.l=h,this.h=g&&g.messageUrlParams||null,h=g&&g.messageHeaders||null,g&&g.clientProtocolHeaderRequired&&(h?h["X-Client-Protocol"]="webchannel":h={"X-Client-Protocol":"webchannel"}),this.g.o=h,h=g&&g.initMessageHeaders||null,g&&g.messageContentType&&(h?h["X-WebChannel-Content-Type"]=g.messageContentType:h={"X-WebChannel-Content-Type":g.messageContentType}),g&&g.va&&(h?h["X-WebChannel-Client-Profile"]=g.va:h={"X-WebChannel-Client-Profile":g.va}),this.g.S=h,(h=g&&g.Sb)&&!C(h)&&(this.g.m=h),this.v=g&&g.supportsCrossDomainXhr||!1,this.u=g&&g.sendRawJson||!1,(g=g&&g.httpSessionIdParam)&&!C(g)&&(this.g.D=g,null!==(h=this.h)&&g in h&&g in(h=this.h)&&delete h[g]),this.j=new Bf(this)}function Ate(h){xL.call(this),h.__headers__&&(this.headers=h.__headers__,this.statusCode=h.__status__,delete h.__headers__,delete h.__status__);var g=h.__sm__;if(g){e:{for(const y in g){h=y;break e}h=void 0}(this.i=h)&&(h=this.i,g=null!==g&&h in g?g[h]:void 0),this.data=g}else this.data=h}function Rte(){SL.call(this),this.status=1}function Bf(h){this.g=h}(n=dn.prototype).Ha=function(h){this.J=h},n.ea=function(h,g,y,w){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+h);g=g?g.toUpperCase():"GET",this.D=h,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():DL.g(),this.v=function Uee(h){return h.h||(h.h=h.i())}(this.o?this.o:DL),this.g.onreadystatechange=f(this.Ea,this);try{this.B=!0,this.g.open(g,String(h),!0),this.B=!1}catch(U){return void hte(this,U)}if(h=y||"",y=new Map(this.headers),w)if(Object.getPrototypeOf(w)===Object.prototype)for(var k in w)y.set(k,w[k]);else{if("function"!=typeof w.keys||"function"!=typeof w.get)throw Error("Unknown input type for opt_headers: "+String(w));for(const U of w.keys())y.set(U,w.get(U))}w=Array.from(y.keys()).find(U=>"content-type"==U.toLowerCase()),k=a.FormData&&h instanceof a.FormData,!(0<=Array.prototype.indexOf.call(U$e,g,void 0))||w||k||y.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[U,J]of y)this.g.setRequestHeader(U,J);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{mte(this),this.u=!0,this.g.send(h),this.u=!1}catch(U){hte(this,U)}},n.abort=function(h){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=h||7,Kr(this,"complete"),Kr(this,"abort"),hC(this))},n.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),hC(this,!0)),dn.aa.N.call(this)},n.Ea=function(){this.s||(this.B||this.u||this.j?pte(this):this.bb())},n.bb=function(){pte(this)},n.isActive=function(){return!!this.g},n.Z=function(){try{return 2=this.R)){var h=2*this.R;this.j.info("BP detection timer enabled: "+h),this.A=ay(f(this.ab,this),h)}},n.ab=function(){this.A&&(this.A=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.M=!0,Qr(10),fC(this),Ete(this))},n.Za=function(){null!=this.C&&(this.C=null,fC(this),LL(this),Qr(19))},n.fb=function(h){h?(this.j.info("Successfully pinged google.com"),Qr(2)):(this.j.info("Failed to ping google.com"),Qr(1))},n.isActive=function(){return!!this.l&&this.l.isActive(this)},(n=Dte.prototype).ua=function(){},n.ta=function(){},n.sa=function(){},n.ra=function(){},n.isActive=function(){return!0},n.Na=function(){},gC.prototype.g=function(h,g){return new Vi(h,g)},m(Vi,Dr),Vi.prototype.m=function(){this.g.l=this.j,this.v&&(this.g.J=!0),this.g.connect(this.l,this.h||void 0)},Vi.prototype.close=function(){FL(this.g)},Vi.prototype.o=function(h){var g=this.g;if("string"==typeof h){var y={};y.__data__=h,h=y}else this.u&&((y={}).__data__=TL(h),h=y);g.i.push(new C$e(g.Ya++,h)),3==g.G&&pC(g)},Vi.prototype.N=function(){this.g.l=null,delete this.j,FL(this.g),delete this.g,Vi.aa.N.call(this)},m(Ate,xL),m(Rte,SL),m(Bf,Dte),Bf.prototype.ua=function(){Kr(this.g,"a")},Bf.prototype.ta=function(h){Kr(this.g,new Ate(h))},Bf.prototype.sa=function(h){Kr(this.g,new Rte)},Bf.prototype.ra=function(){Kr(this.g,"b")},gC.prototype.createWebChannel=gC.prototype.g,Vi.prototype.send=Vi.prototype.o,Vi.prototype.open=Vi.prototype.m,Vi.prototype.close=Vi.prototype.close,p6=$s.createWebChannelTransport=function(){return new gC},f6=$s.getStatEventTarget=function(){return iC()},h6=$s.Event=Pu,m1=$s.Stat={mb:0,pb:1,qb:2,Jb:3,Ob:4,Lb:5,Mb:6,Kb:7,Ib:8,Nb:9,PROXY:10,NOPROXY:11,Gb:12,Cb:13,Db:14,Bb:15,Eb:16,Fb:17,ib:18,hb:19,jb:20},oC.NO_ERROR=0,oC.TIMEOUT=8,oC.HTTP_ERROR=6,BE=$s.ErrorCode=oC,Wee.COMPLETE="complete",d6=$s.EventType=Wee,zee.EventType=oy,oy.OPEN="a",oy.CLOSE="b",oy.ERROR="c",oy.MESSAGE="d",Dr.prototype.listen=Dr.prototype.K,kg=$s.WebChannel=zee,$s.FetchXmlHttpFactory=fy,dn.prototype.listenOnce=dn.prototype.L,dn.prototype.getLastError=dn.prototype.Ka,dn.prototype.getLastErrorCode=dn.prototype.Ba,dn.prototype.getStatus=dn.prototype.Z,dn.prototype.getResponseJson=dn.prototype.Oa,dn.prototype.getResponseText=dn.prototype.oa,dn.prototype.send=dn.prototype.ea,dn.prototype.setWithCredentials=dn.prototype.Ha,u6=$s.XhrIo=dn}).apply(typeof VE<"u"?VE:typeof self<"u"?self:typeof window<"u"?window:{});const m6="@firebase/firestore";class Qn{constructor(e){this.uid=e}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}Qn.UNAUTHENTICATED=new Qn(null),Qn.GOOGLE_CREDENTIALS=new Qn("google-credentials-uid"),Qn.FIRST_PARTY=new Qn("first-party-uid"),Qn.MOCK_USER=new Qn("mock-user");let Eh="11.3.1";const nl=new sE("@firebase/firestore");function Ih(){return nl.logLevel}function z(n,...e){if(nl.logLevel<=qe.DEBUG){const t=e.map(g1);nl.debug(`Firestore (${Eh}): ${n}`,...t)}}function vn(n,...e){if(nl.logLevel<=qe.ERROR){const t=e.map(g1);nl.error(`Firestore (${Eh}): ${n}`,...t)}}function eo(n,...e){if(nl.logLevel<=qe.WARN){const t=e.map(g1);nl.warn(`Firestore (${Eh}): ${n}`,...t)}}function g1(n){if("string"==typeof n)return n;try{return JSON.stringify(n)}catch{return n}}function ne(n="Unexpected state"){const e=`FIRESTORE (${Eh}) INTERNAL ASSERTION FAILED: `+n;throw vn(e),new Error(e)}function se(n,e){n||ne()}function Z(n,e){return n}const F={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class j extends Wo{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}class Yn{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}class _6{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class RAe{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable(()=>t(Qn.UNAUTHENTICATED))}shutdown(){}}class MAe{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable(()=>t(this.token.user))}shutdown(){this.changeListener=null}}class kAe{constructor(e){this.t=e,this.currentUser=Qn.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){var r=this;se(void 0===this.o);let i=this.i;const o=c=>this.i!==i?(i=this.i,t(c)):Promise.resolve();let s=new Yn;this.o=()=>{this.i++,this.currentUser=this.u(),s.resolve(),s=new Yn,e.enqueueRetryable(()=>o(this.currentUser))};const a=()=>{const c=s;e.enqueueRetryable(T(function*(){yield c.promise,yield o(r.currentUser)}))},l=c=>{z("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=c,this.o&&(this.auth.addAuthTokenListener(this.o),a())};this.t.onInit(c=>l(c)),setTimeout(()=>{if(!this.auth){const c=this.t.getImmediate({optional:!0});c?l(c):(z("FirebaseAuthCredentialsProvider","Auth not yet detected"),s.resolve(),s=new Yn)}},0),a()}getToken(){const e=this.i,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then(r=>this.i!==e?(z("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):r?(se("string"==typeof r.accessToken),new _6(r.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){const e=this.auth&&this.auth.getUid();return se(null===e||"string"==typeof e),new Qn(e)}}class NAe{constructor(e,t,r){this.l=e,this.h=t,this.P=r,this.type="FirstParty",this.user=Qn.FIRST_PARTY,this.T=new Map}I(){return this.P?this.P():null}get headers(){this.T.set("X-Goog-AuthUser",this.l);const e=this.I();return e&&this.T.set("Authorization",e),this.h&&this.T.set("X-Goog-Iam-Authorization-Token",this.h),this.T}}class PAe{constructor(e,t,r){this.l=e,this.h=t,this.P=r}getToken(){return Promise.resolve(new NAe(this.l,this.h,this.P))}start(e,t){e.enqueueRetryable(()=>t(Qn.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class _1{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class OAe{constructor(e,t){this.A=t,this.forceRefresh=!1,this.appCheck=null,this.R=null,this.V=null,ai(e)&&e.settings.appCheckToken&&(this.V=e.settings.appCheckToken)}start(e,t){se(void 0===this.o);const r=o=>{null!=o.error&&z("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${o.error.message}`);const s=o.token!==this.R;return this.R=o.token,z("FirebaseAppCheckTokenProvider",`Received ${s?"new":"existing"} token.`),s?t(o.token):Promise.resolve()};this.o=o=>{e.enqueueRetryable(()=>r(o))};const i=o=>{z("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=o,this.o&&this.appCheck.addTokenListener(this.o)};this.A.onInit(o=>i(o)),setTimeout(()=>{if(!this.appCheck){const o=this.A.getImmediate({optional:!0});o?i(o):z("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.V)return Promise.resolve(new _1(this.V));const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(t=>t?(se("string"==typeof t.token),this.R=t.token,new _1(t.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}function FAe(n){const e=typeof self<"u"&&(self.crypto||self.msCrypto),t=new Uint8Array(n);if(e&&"function"==typeof e.getRandomValues)e.getRandomValues(t);else for(let r=0;re?1:0}function Th(n,e,t){return n.length===e.length&&n.every((r,i)=>t(r,e[i]))}function v6(n){return n+"\0"}const b6=-62135596800;class Yt{static now(){return Yt.fromMillis(Date.now())}static fromDate(e){return Yt.fromMillis(e.getTime())}static fromMillis(e){const t=Math.floor(e/1e3),r=Math.floor(1e6*(e-1e3*t));return new Yt(t,r)}constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new j(F.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new j(F.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e=253402300800)throw new j(F.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(e){return this.seconds===e.seconds?Ee(this.nanoseconds,e.nanoseconds):Ee(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){return String(this.seconds-b6).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}class le{static fromTimestamp(e){return new le(e)}static min(){return new le(new Yt(0,0))}static max(){return new le(new Yt(253402300799,999999999))}constructor(e){this.timestamp=e}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}const y1="__name__";class Qo{constructor(e,t,r){void 0===t?t=0:t>e.length&&ne(),void 0===r?r=e.length-t:r>e.length-t&&ne(),this.segments=e,this.offset=t,this.len=r}get length(){return this.len}isEqual(e){return 0===Qo.comparator(this,e)}child(e){const t=this.segments.slice(this.offset,this.limit());return e instanceof Qo?e.forEach(r=>{t.push(r)}):t.push(e),this.construct(t)}limit(){return this.offset+this.length}popFirst(e){return this.construct(this.segments,this.offset+(e=void 0===e?1:e),this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return 0===this.length}isPrefixOf(e){if(e.lengtht?1:0}static isNumericId(e){return e.startsWith("__id")&&e.endsWith("__")}static extractNumericId(e){return tl.fromString(e.substring(4,e.length-2))}}class We extends Qo{construct(e,t,r){return new We(e,t,r)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){const t=[];for(const r of e){if(r.indexOf("//")>=0)throw new j(F.INVALID_ARGUMENT,`Invalid segment (${r}). Paths must not contain // in them.`);t.push(...r.split("/").filter(i=>i.length>0))}return new We(t)}static emptyPath(){return new We([])}}const LAe=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class $t extends Qo{construct(e,t,r){return new $t(e,t,r)}static isValidIdentifier(e){return LAe.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),$t.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&this.get(0)===y1}static keyField(){return new $t([y1])}static fromServerFormat(e){const t=[];let r="",i=0;const o=()=>{if(0===r.length)throw new j(F.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);t.push(r),r=""};let s=!1;for(;i=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return null!==e&&0===We.comparator(this.path,e.path)}toString(){return this.path.toString()}static comparator(e,t){return We.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new te(new We(e.slice()))}}class xh{constructor(e,t,r,i){this.indexId=e,this.collectionGroup=t,this.fields=r,this.indexState=i}}function v1(n){return n.fields.find(e=>2===e.kind)}function jc(n){return n.fields.filter(e=>2!==e.kind)}xh.UNKNOWN_ID=-1;class Hc{constructor(e,t){this.fieldPath=e,this.kind=t}}class Sh{constructor(e,t){this.sequenceNumber=e,this.offset=t}static empty(){return new Sh(0,Mi.min())}}function I6(n){return new Mi(n.readTime,n.key,-1)}class Mi{constructor(e,t,r){this.readTime=e,this.documentKey=t,this.largestBatchId=r}static min(){return new Mi(le.min(),te.empty(),-1)}static max(){return new Mi(le.max(),te.empty(),-1)}}function b1(n,e){let t=n.readTime.compareTo(e.readTime);return 0!==t?t:(t=te.comparator(n.documentKey,e.documentKey),0!==t?t:Ee(n.largestBatchId,e.largestBatchId))}const T6="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class C6{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}function rl(n){return w1.apply(this,arguments)}function w1(){return(w1=T(function*(n){if(n.code!==F.FAILED_PRECONDITION||n.message!==T6)throw n;z("LocalStore","Unexpectedly lost primary lease")})).apply(this,arguments)}class N{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(t=>{this.isDone=!0,this.result=t,this.nextCallback&&this.nextCallback(t)},t=>{this.isDone=!0,this.error=t,this.catchCallback&&this.catchCallback(t)})}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&ne(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new N((r,i)=>{this.nextCallback=o=>{this.wrapSuccess(e,o).next(r,i)},this.catchCallback=o=>{this.wrapFailure(t,o).next(r,i)}})}toPromise(){return new Promise((e,t)=>{this.next(e,t)})}wrapUserFunction(e){try{const t=e();return t instanceof N?t:N.resolve(t)}catch(t){return N.reject(t)}}wrapSuccess(e,t){return e?this.wrapUserFunction(()=>e(t)):N.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction(()=>e(t)):N.reject(t)}static resolve(e){return new N((t,r)=>{t(e)})}static reject(e){return new N((t,r)=>{r(e)})}static waitFor(e){return new N((t,r)=>{let i=0,o=0,s=!1;e.forEach(a=>{++i,a.next(()=>{++o,s&&o===i&&t()},l=>r(l))}),s=!0,o===i&&t()})}static or(e){let t=N.resolve(!1);for(const r of e)t=t.next(i=>i?N.resolve(i):r());return t}static forEach(e,t){const r=[];return e.forEach((i,o)=>{r.push(t.call(this,i,o))}),this.waitFor(r)}static mapArray(e,t){return new N((r,i)=>{const o=e.length,s=new Array(o);let a=0;for(let l=0;l{s[c]=u,++a,a===o&&r(s)},u=>i(u))}})}static doWhile(e,t){return new N((r,i)=>{const o=()=>{!0===e()?t().next(()=>{o()},i):r()};o()})}}const ki="SimpleDb";class UE{static open(e,t,r,i){try{return new UE(t,e.transaction(i,r))}catch(o){throw new Ng(t,o)}}constructor(e,t){this.action=e,this.transaction=t,this.aborted=!1,this.m=new Yn,this.transaction.oncomplete=()=>{this.m.resolve()},this.transaction.onabort=()=>{t.error?this.m.reject(new Ng(e,t.error)):this.m.resolve()},this.transaction.onerror=r=>{const i=E1(r.target.error);this.m.reject(new Ng(e,i))}}get p(){return this.m.promise}abort(e){e&&this.m.reject(e),this.aborted||(z(ki,"Aborting transaction:",e?e.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())}S(){const e=this.transaction;this.aborted||"function"!=typeof e.commit||e.commit()}store(e){const t=this.transaction.objectStore(e);return new zAe(t)}}class Yo{static delete(e){return z(ki,"Removing database:",e),$c(window.indexedDB.deleteDatabase(e)).toPromise()}static D(){if(!_R())return!1;if(Yo.v())return!0;const e=_n(),t=Yo.C(e),r=00||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||r||o)}static v(){var e;return typeof process<"u"&&"YES"===(null===(e=process.__PRIVATE_env)||void 0===e?void 0:e.F)}static M(e,t){return e.store(t)}static C(e){const t=e.match(/i(?:phone|pad|pod) os ([\d_]+)/i),r=t?t[1].split("_").slice(0,2).join("."):"-1";return Number(r)}constructor(e,t,r){this.name=e,this.version=t,this.O=r,12.2===Yo.C(_n())&&vn("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}N(e){var t=this;return T(function*(){return t.db||(z(ki,"Opening database:",t.name),t.db=yield new Promise((r,i)=>{const o=indexedDB.open(t.name,t.version);o.onsuccess=s=>{r(s.target.result)},o.onblocked=()=>{i(new Ng(e,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},o.onerror=s=>{const a=s.target.error;i("VersionError"===a.name?new j(F.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh."):"InvalidStateError"===a.name?new j(F.FAILED_PRECONDITION,"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: "+a):new Ng(e,a))},o.onupgradeneeded=s=>{z(ki,'Database "'+t.name+'" requires upgrade from version:',s.oldVersion),t.O.B(s.target.result,o.transaction,s.oldVersion,t.version).next(()=>{z(ki,"Database upgrade to version "+t.version+" complete")})}})),t.L&&(t.db.onversionchange=r=>t.L(r)),t.db})()}k(e){this.L=e,this.db&&(this.db.onversionchange=t=>e(t))}runTransaction(e,t,r,i){var o=this;return T(function*(){const s="readonly"===t;let a=0;for(;;){++a;try{o.db=yield o.N(e);const l=UE.open(o.db,e,s?"readonly":"readwrite",r),c=i(l).next(u=>(l.S(),u)).catch(u=>(l.abort(u),N.reject(u))).toPromise();return c.catch(()=>{}),yield l.p,c}catch(l){const c=l,u="FirebaseError"!==c.name&&a<3;if(z(ki,"Transaction failed with error:",c.message,"Retrying:",u),o.close(),!u)return Promise.reject(c)}}})()}close(){this.db&&this.db.close(),this.db=void 0}}function x6(n){const e=n.match(/Android ([\d.]+)/i),t=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(t)}class UAe{constructor(e){this.q=e,this.$=!1,this.K=null}get isDone(){return this.$}get U(){return this.K}set cursor(e){this.q=e}done(){this.$=!0}W(e){this.K=e}delete(){return $c(this.q.delete())}}class Ng extends j{constructor(e,t){super(F.UNAVAILABLE,`IndexedDB transaction '${e}' failed: ${t}`),this.name="IndexedDbTransactionError"}}function il(n){return"IndexedDbTransactionError"===n.name}class zAe{constructor(e){this.store=e}put(e,t){let r;return void 0!==t?(z(ki,"PUT",this.store.name,e,t),r=this.store.put(t,e)):(z(ki,"PUT",this.store.name,"",e),r=this.store.put(e)),$c(r)}add(e){return z(ki,"ADD",this.store.name,e,e),$c(this.store.add(e))}get(e){return $c(this.store.get(e)).next(t=>(void 0===t&&(t=null),z(ki,"GET",this.store.name,e,t),t))}delete(e){return z(ki,"DELETE",this.store.name,e),$c(this.store.delete(e))}count(){return z(ki,"COUNT",this.store.name),$c(this.store.count())}G(e,t){const r=this.options(e,t),i=r.index?this.store.index(r.index):this.store;if("function"==typeof i.getAll){const o=i.getAll(r.range);return new N((s,a)=>{o.onerror=l=>{a(l.target.error)},o.onsuccess=l=>{s(l.target.result)}})}{const o=this.cursor(r),s=[];return this.j(o,(a,l)=>{s.push(l)}).next(()=>s)}}H(e,t){const r=this.store.getAll(e,null===t?void 0:t);return new N((i,o)=>{r.onerror=s=>{o(s.target.error)},r.onsuccess=s=>{i(s.target.result)}})}J(e,t){z(ki,"DELETE ALL",this.store.name);const r=this.options(e,t);r.Y=!1;const i=this.cursor(r);return this.j(i,(o,s,a)=>a.delete())}Z(e,t){let r;t?r=e:(r={},t=e);const i=this.cursor(r);return this.j(i,t)}X(e){const t=this.cursor({});return new N((r,i)=>{t.onerror=o=>{const s=E1(o.target.error);i(s)},t.onsuccess=o=>{const s=o.target.result;s?e(s.primaryKey,s.value).next(a=>{a?s.continue():r()}):r()}})}j(e,t){const r=[];return new N((i,o)=>{e.onerror=s=>{o(s.target.error)},e.onsuccess=s=>{const a=s.target.result;if(!a)return void i();const l=new UAe(a),c=t(a.primaryKey,a.value,l);if(c instanceof N){const u=c.catch(d=>(l.done(),N.reject(d)));r.push(u)}l.isDone?i():null===l.U?a.continue():a.continue(l.U)}}).next(()=>N.waitFor(r))}options(e,t){let r;return void 0!==e&&("string"==typeof e?r=e:t=e),{index:r,range:t}}cursor(e){let t="next";if(e.reverse&&(t="prev"),e.index){const r=this.store.index(e.index);return e.Y?r.openKeyCursor(e.range,t):r.openCursor(e.range,t)}return this.store.openCursor(e.range,t)}}function $c(n){return new N((e,t)=>{n.onsuccess=r=>{e(r.target.result)},n.onerror=r=>{const i=E1(r.target.error);t(i)}})}let S6=!1;function E1(n){const e=Yo.C(_n());if(e>=12.2&&e<13){const t="An internal error was encountered in the Indexed Database server";if(n.message.indexOf(t)>=0){const r=new j("internal",`IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${t}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);return S6||(S6=!0,setTimeout(()=>{throw r},0)),r}}return n}const Pg="IndexBackfiller";class jAe{constructor(e,t){this.asyncQueue=e,this.ee=t,this.task=null}start(){this.te(15e3)}stop(){this.task&&(this.task.cancel(),this.task=null)}get started(){return null!==this.task}te(e){var t=this;z(Pg,`Scheduled in ${e}ms`),this.task=this.asyncQueue.enqueueAfterDelay("index_backfill",e,T(function*(){t.task=null;try{const r=yield t.ee.ne();z(Pg,`Documents written: ${r}`)}catch(r){il(r)?z(Pg,"Ignoring IndexedDB error during index backfill: ",r):yield rl(r)}yield t.te(6e4)}))}}class HAe{constructor(e,t){this.localStore=e,this.persistence=t}ne(e=50){var t=this;return T(function*(){return t.persistence.runTransaction("Backfill Indexes","readwrite-primary",r=>t.re(r,e))})()}re(e,t){const r=new Set;let i=t,o=!0;return N.doWhile(()=>!0===o&&i>0,()=>this.localStore.indexManager.getNextCollectionGroupToUpdate(e).next(s=>{if(null!==s&&!r.has(s))return z(Pg,`Processing collection: ${s}`),this.ie(e,s,i).next(a=>{i-=a,r.add(s)});o=!1})).next(()=>t-i)}ie(e,t,r){return this.localStore.indexManager.getMinOffsetFromCollectionGroup(e,t).next(i=>this.localStore.localDocuments.getNextDocuments(e,t,i,r).next(o=>{const s=o.changes;return this.localStore.indexManager.updateIndexEntries(e,s).next(()=>this.se(i,o)).next(a=>(z(Pg,`Updating offset: ${a}`),this.localStore.indexManager.updateCollectionGroup(e,t,a))).next(()=>s.size)}))}se(e,t){let r=e;return t.changes.forEach((i,o)=>{const s=I6(o);b1(s,r)>0&&(r=s)}),new Mi(r.readTime,r.documentKey,Math.max(t.batchId,e.largestBatchId))}}let Ni=(()=>{class n{constructor(t,r){this.previousValue=t,r&&(r.sequenceNumberHandler=i=>this.oe(i),this._e=i=>r.writeSequenceNumber(i))}oe(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue}next(){const t=++this.previousValue;return this._e&&this._e(t),t}}return n.ae=-1,n})();function Og(n){return null==n}function Fg(n){return 0===n&&1/n==-1/0}function vr(n){let e="";for(let t=0;t0&&(e=A6(e)),e=$Ae(n.get(t),e);return A6(e)}function $Ae(n,e){let t=e;const r=n.length;for(let i=0;i=2),2===e)return se("\x01"===n.charAt(0)&&"\x01"===n.charAt(1)),We.emptyPath();const t=e-2,r=[];let i="";for(let o=0;ot)&&ne(),n.charAt(s+1)){case"\x01":const a=n.substring(o,s);let l;0===i.length?l=a:(i+=a,l=i,i=""),r.push(l);break;case"\x10":i+=n.substring(o,s),i+="\0";break;case"\x11":i+=n.substring(o,s+1);break;default:ne()}o=s+2}return new We(r)}const qc="remoteDocuments",Lg="owner",Dh="owner",Vg="mutationQueues",wo="mutations",R6="batchId",Wc="userMutationsIndex",M6=["userId","batchId"];function jE(n,e){return[n,vr(e)]}function k6(n,e,t){return[n,vr(e),t]}const WAe={},Ah="documentMutations",HE="remoteDocumentsV14",GAe=["prefixPath","collectionGroup","readTime","documentId"],$E="documentKeyIndex",KAe=["prefixPath","collectionGroup","documentId"],N6="collectionGroupIndex",QAe=["collectionGroup","readTime","prefixPath","documentId"],Bg="remoteDocumentGlobal",I1="remoteDocumentGlobalKey",Rh="targets",P6="queryTargetsIndex",YAe=["canonicalId","targetId"],Mh="targetDocuments",XAe=["targetId","path"],T1="documentTargetsIndex",ZAe=["path","targetId"],qE="targetGlobalKey",Gc="targetGlobal",Ug="collectionParents",JAe=["collectionId","parent"],kh="clientMetadata",WE="bundles",GE="namedQueries",C1="indexConfiguration",x1="collectionGroupIndex",KE="indexState",oRe=["indexId","uid"],O6="sequenceNumberIndex",sRe=["uid","sequenceNumber"],QE="indexEntries",aRe=["indexId","uid","arrayValue","directionalValue","orderedDocumentKey","documentKey"],F6="documentKeyIndex",lRe=["indexId","uid","orderedDocumentKey"],YE="documentOverlays",cRe=["userId","collectionPath","documentId"],S1="collectionPathOverlayIndex",uRe=["userId","collectionPath","largestBatchId"],L6="collectionGroupOverlayIndex",dRe=["userId","collectionGroup","largestBatchId"],D1="globals",V6=[Vg,wo,Ah,qc,Rh,Lg,Gc,Mh,kh,Bg,Ug,WE,GE],fRe=[...V6,YE],B6=[Vg,wo,Ah,HE,Rh,Lg,Gc,Mh,kh,Bg,Ug,WE,GE,YE],U6=B6,A1=[...U6,C1,KE,QE],pRe=A1,mRe=[...A1,D1];class R1 extends C6{constructor(e,t){super(),this.ue=e,this.currentSequenceNumber=t}}function Un(n,e){const t=Z(n);return Yo.M(t.ue,e)}function z6(n){let e=0;for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&e++;return e}function sl(n,e){for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&e(t,n[t])}function H6(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}class Rt{constructor(e,t){this.comparator=e,this.root=t||sr.EMPTY}insert(e,t){return new Rt(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,sr.BLACK,null,null))}remove(e){return new Rt(this.comparator,this.root.remove(e,this.comparator).copy(null,null,sr.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){const r=this.comparator(e,t.key);if(0===r)return t.value;r<0?t=t.left:r>0&&(t=t.right)}return null}indexOf(e){let t=0,r=this.root;for(;!r.isEmpty();){const i=this.comparator(e,r.key);if(0===i)return t+r.left.size;i<0?r=r.left:(t+=r.left.size+1,r=r.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((t,r)=>(e(t,r),!1))}toString(){const e=[];return this.inorderTraversal((t,r)=>(e.push(`${t}:${r}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new XE(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new XE(this.root,e,this.comparator,!1)}getReverseIterator(){return new XE(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new XE(this.root,e,this.comparator,!0)}}class XE{constructor(e,t,r,i){this.isReverse=i,this.nodeStack=[];let o=1;for(;!e.isEmpty();)if(o=t?r(e.key,t):1,t&&i&&(o*=-1),o<0)e=this.isReverse?e.left:e.right;else{if(0===o){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class sr{constructor(e,t,r,i,o){this.key=e,this.value=t,this.color=r??sr.RED,this.left=i??sr.EMPTY,this.right=o??sr.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,r,i,o){return new sr(e??this.key,t??this.value,r??this.color,i??this.left,o??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,r){let i=this;const o=r(e,i.key);return i=o<0?i.copy(null,null,null,i.left.insert(e,t,r),null):0===o?i.copy(null,t,null,null,null):i.copy(null,null,null,null,i.right.insert(e,t,r)),i.fixUp()}removeMin(){if(this.left.isEmpty())return sr.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,t){let r,i=this;if(t(e,i.key)<0)i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(e,t),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),0===t(e,i.key)){if(i.right.isEmpty())return sr.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(e,t))}return i.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,sr.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,sr.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed()||this.right.isRed())throw ne();const e=this.left.check();if(e!==this.right.check())throw ne();return e+(this.isRed()?0:1)}}sr.EMPTY=null,sr.RED=!0,sr.BLACK=!1,sr.EMPTY=new class{constructor(){this.size=0}get key(){throw ne()}get value(){throw ne()}get color(){throw ne()}get left(){throw ne()}get right(){throw ne()}copy(e,t,r,i,o){return this}insert(e,t,r){return new sr(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};class dt{constructor(e){this.comparator=e,this.data=new Rt(this.comparator)}has(e){return null!==this.data.get(e)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((t,r)=>(e(t),!1))}forEachInRange(e,t){const r=this.data.getIteratorFrom(e[0]);for(;r.hasNext();){const i=r.getNext();if(this.comparator(i.key,e[1])>=0)return;t(i.key)}}forEachWhile(e,t){let r;for(r=void 0!==t?this.data.getIteratorFrom(t):this.data.getIterator();r.hasNext();)if(!e(r.getNext().key))return}firstAfterOrEqual(e){const t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new $6(this.data.getIterator())}getIteratorFrom(e){return new $6(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let t=this;return t.size{t=t.add(r)}),t}isEqual(e){if(!(e instanceof dt)||this.size!==e.size)return!1;const t=this.data.getIterator(),r=e.data.getIterator();for(;t.hasNext();){const i=t.getNext().key,o=r.getNext().key;if(0!==this.comparator(i,o))return!1}return!0}toArray(){const e=[];return this.forEach(t=>{e.push(t)}),e}toString(){const e=[];return this.forEach(t=>e.push(t)),"SortedSet("+e.toString()+")"}copy(e){const t=new dt(this.comparator);return t.data=e,t}}class $6{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}function Nh(n){return n.hasNext()?n.getNext():void 0}class ci{constructor(e){this.fields=e,e.sort($t.comparator)}static empty(){return new ci([])}unionWith(e){let t=new dt($t.comparator);for(const r of this.fields)t=t.add(r);for(const r of e)t=t.add(r);return new ci(t.toArray())}covers(e){for(const t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return Th(this.fields,e.fields,(t,r)=>t.isEqual(r))}}class q6 extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}class ln{constructor(e){this.binaryString=e}static fromBase64String(e){const t=function(i){try{return atob(i)}catch(o){throw typeof DOMException<"u"&&o instanceof DOMException?new q6("Invalid base64 string: "+o):o}}(e);return new ln(t)}static fromUint8Array(e){const t=function(i){let o="";for(let s=0;seZo(t,e))}function cl(n,e){if(n===e)return 0;const t=ll(n),r=ll(e);if(t!==r)return Ee(t,r);switch(t){case 0:case 9007199254740991:return 0;case 1:return Ee(n.booleanValue,e.booleanValue);case 2:return function(o,s){const a=qt(o.integerValue||o.doubleValue),l=qt(s.integerValue||s.doubleValue);return al?1:a===l?0:isNaN(a)?isNaN(l)?0:-1:1}(n,e);case 3:return X6(n.timestampValue,e.timestampValue);case 4:return X6(zg(n),zg(e));case 5:return Ee(n.stringValue,e.stringValue);case 6:return function(o,s){const a=Ws(o),l=Ws(s);return a.compareTo(l)}(n.bytesValue,e.bytesValue);case 7:return function(o,s){const a=o.split("/"),l=s.split("/");for(let c=0;ci+tI(o),0);case 10:case 11:return function(r){let i=0;return sl(r.fields,(o,s)=>{i+=o.length+tI(s)}),i}(n.mapValue);default:throw ne()}}function Qc(n,e){return{referenceValue:`projects/${n.projectId}/databases/${n.database}/documents/${e.path.canonicalString()}`}}function P1(n){return!!n&&"integerValue"in n}function $g(n){return!!n&&"arrayValue"in n}function J6(n){return!!n&&"nullValue"in n}function e9(n){return!!n&&"doubleValue"in n&&isNaN(Number(n.doubleValue))}function nI(n){return!!n&&"mapValue"in n}function rI(n){var e,t;return(null===(t=((null===(e=n?.mapValue)||void 0===e?void 0:e.fields)||{})[M1])||void 0===t?void 0:t.stringValue)===k1}function qg(n){if(n.geoPointValue)return{geoPointValue:Object.assign({},n.geoPointValue)};if(n.timestampValue&&"object"==typeof n.timestampValue)return{timestampValue:Object.assign({},n.timestampValue)};if(n.mapValue){const e={mapValue:{fields:{}}};return sl(n.mapValue.fields,(t,r)=>e.mapValue.fields[t]=qg(r)),e}if(n.arrayValue){const e={arrayValue:{values:[]}};for(let t=0;t<(n.arrayValue.values||[]).length;++t)e.arrayValue.values[t]=qg(n.arrayValue.values[t]);return e}return Object.assign({},n)}function t9(n){return(((n.mapValue||{}).fields||{}).__type__||{}).stringValue===Y6}const n9={mapValue:{fields:{[M1]:{stringValue:k1},[Ph]:{arrayValue:{}}}}};function yRe(n){return"nullValue"in n?eI:"booleanValue"in n?{booleanValue:!1}:"integerValue"in n||"doubleValue"in n?{doubleValue:NaN}:"timestampValue"in n?{timestampValue:{seconds:Number.MIN_SAFE_INTEGER}}:"stringValue"in n?{stringValue:""}:"bytesValue"in n?{bytesValue:""}:"referenceValue"in n?Qc(Kc.empty(),te.empty()):"geoPointValue"in n?{geoPointValue:{latitude:-90,longitude:-180}}:"arrayValue"in n?{arrayValue:{}}:"mapValue"in n?rI(n)?n9:{mapValue:{}}:ne()}function vRe(n){return"nullValue"in n?{booleanValue:!1}:"booleanValue"in n?{doubleValue:NaN}:"integerValue"in n||"doubleValue"in n?{timestampValue:{seconds:Number.MIN_SAFE_INTEGER}}:"timestampValue"in n?{stringValue:""}:"stringValue"in n?{bytesValue:""}:"bytesValue"in n?Qc(Kc.empty(),te.empty()):"referenceValue"in n?{geoPointValue:{latitude:-90,longitude:-180}}:"geoPointValue"in n?{arrayValue:{}}:"arrayValue"in n?n9:"mapValue"in n?rI(n)?{mapValue:{}}:al:ne()}function r9(n,e){const t=cl(n.value,e.value);return 0!==t?t:n.inclusive&&!e.inclusive?-1:!n.inclusive&&e.inclusive?1:0}function i9(n,e){const t=cl(n.value,e.value);return 0!==t?t:n.inclusive&&!e.inclusive?1:!n.inclusive&&e.inclusive?-1:0}class ar{constructor(e){this.value=e}static empty(){return new ar({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let r=0;r{if(!t.isImmediateParentOf(a)){const l=this.getFieldsMap(t);this.applyChanges(l,r,i),r={},i=[],t=a.popLast()}s?r[a.lastSegment()]=qg(s):i.push(a.lastSegment())});const o=this.getFieldsMap(t);this.applyChanges(o,r,i)}delete(e){const t=this.field(e.popLast());nI(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return Zo(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let r=0;re[i]=o);for(const i of r)delete e[i]}clone(){return new ar(qg(this.value))}}function o9(n){const e=[];return sl(n.fields,(t,r)=>{const i=new $t([t]);if(nI(r)){const o=o9(r.mapValue).fields;if(0===o.length)e.push(i);else for(const s of o)e.push(i.child(s))}else e.push(i)}),new ci(e)}class Lt{constructor(e,t,r,i,o,s,a){this.key=e,this.documentType=t,this.version=r,this.readTime=i,this.createTime=o,this.data=s,this.documentState=a}static newInvalidDocument(e){return new Lt(e,0,le.min(),le.min(),le.min(),ar.empty(),0)}static newFoundDocument(e,t,r,i){return new Lt(e,1,t,le.min(),r,i,0)}static newNoDocument(e,t){return new Lt(e,2,t,le.min(),le.min(),ar.empty(),0)}static newUnknownDocument(e,t){return new Lt(e,3,t,le.min(),le.min(),ar.empty(),2)}convertToFoundDocument(e,t){return!this.createTime.isEqual(le.min())||2!==this.documentType&&0!==this.documentType||(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=ar.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=ar.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=le.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return 1===this.documentState}get hasCommittedMutations(){return 2===this.documentState}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return 0!==this.documentType}isFoundDocument(){return 1===this.documentType}isNoDocument(){return 2===this.documentType}isUnknownDocument(){return 3===this.documentType}isEqual(e){return e instanceof Lt&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new Lt(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}class ul{constructor(e,t){this.position=e,this.inclusive=t}}function s9(n,e,t){let r=0;for(let i=0;i":return e>0;case">=":return e>=0;default:return ne()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class ht extends l9{constructor(e,t){super(),this.filters=e,this.op=t,this.ce=null}static create(e,t){return new ht(e,t)}matches(e){return Fh(this)?void 0===this.filters.find(t=>!t.matches(e)):void 0!==this.filters.find(t=>t.matches(e))}getFlattenedFilters(){return null!==this.ce||(this.ce=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.ce}getFilters(){return Object.assign([],this.filters)}}function Fh(n){return"and"===n.op}function O1(n){return"or"===n.op}function F1(n){return c9(n)&&Fh(n)}function c9(n){for(const e of n.filters)if(e instanceof ht)return!1;return!0}function L1(n){if(n instanceof Ge)return n.field.canonicalString()+n.op.toString()+Oh(n.value);if(F1(n))return n.filters.map(e=>L1(e)).join(",");{const e=n.filters.map(t=>L1(t)).join(",");return`${n.op}(${e})`}}function u9(n,e){return n instanceof Ge?(r=n,(i=e)instanceof Ge&&r.op===i.op&&r.field.isEqual(i.field)&&Zo(r.value,i.value)):n instanceof ht?function(r,i){return i instanceof ht&&r.op===i.op&&r.filters.length===i.filters.length&&r.filters.reduce((o,s,a)=>o&&u9(s,i.filters[a]),!0)}(n,e):void ne();var r,i}function d9(n,e){const t=n.filters.concat(e);return ht.create(t,n.op)}function h9(n){return n instanceof Ge?`${(t=n).field.canonicalString()} ${t.op} ${Oh(t.value)}`:n instanceof ht?function(t){return t.op.toString()+" {"+t.getFilters().map(h9).join(" ,")+"}"}(n):"Filter";var t}class wRe extends Ge{constructor(e,t,r){super(e,t,r),this.key=te.fromName(r.referenceValue)}matches(e){const t=te.comparator(e.key,this.key);return this.matchesComparison(t)}}class ERe extends Ge{constructor(e,t){super(e,"in",t),this.keys=f9(0,t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}}class IRe extends Ge{constructor(e,t){super(e,"not-in",t),this.keys=f9(0,t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}}function f9(n,e){var t;return((null===(t=e.arrayValue)||void 0===t?void 0:t.values)||[]).map(r=>te.fromName(r.referenceValue))}class TRe extends Ge{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return $g(t)&&Hg(t.arrayValue,this.value)}}class p9 extends Ge{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return null!==t&&Hg(this.value.arrayValue,t)}}class CRe extends Ge{constructor(e,t){super(e,"not-in",t)}matches(e){if(Hg(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return null!==t&&!Hg(this.value.arrayValue,t)}}class xRe extends Ge{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);return!(!$g(t)||!t.arrayValue.values)&&t.arrayValue.values.some(r=>Hg(this.value.arrayValue,r))}}class SRe{constructor(e,t=null,r=[],i=[],o=null,s=null,a=null){this.path=e,this.collectionGroup=t,this.orderBy=r,this.filters=i,this.limit=o,this.startAt=s,this.endAt=a,this.le=null}}function V1(n,e=null,t=[],r=[],i=null,o=null,s=null){return new SRe(n,e,t,r,i,o,s)}function Yc(n){const e=Z(n);if(null===e.le){let t=e.path.canonicalString();null!==e.collectionGroup&&(t+="|cg:"+e.collectionGroup),t+="|f:",t+=e.filters.map(r=>L1(r)).join(","),t+="|ob:",t+=e.orderBy.map(r=>{return(o=r).field.canonicalString()+o.dir;var o}).join(","),Og(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(r=>Oh(r)).join(",")),e.endAt&&(t+="|ub:",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(r=>Oh(r)).join(",")),e.le=t}return e.le}function Gg(n,e){if(n.limit!==e.limit||n.orderBy.length!==e.orderBy.length)return!1;for(let t=0;tt instanceof Ge&&t.field.isEqual(e))}function m9(n,e,t){let r=eI,i=!0;for(const o of oI(n,e)){let s=eI,a=!0;switch(o.op){case"<":case"<=":s=yRe(o.value);break;case"==":case"in":case">=":s=o.value;break;case">":s=o.value,a=!1;break;case"!=":case"not-in":s=eI}r9({value:r,inclusive:i},{value:s,inclusive:a})<0&&(r=s,i=a)}if(null!==t)for(let o=0;o=":case">":s=vRe(o.value),a=!1;break;case"==":case"in":case"<=":s=o.value;break;case"<":s=o.value,a=!1;break;case"!=":case"not-in":s=al}i9({value:r,inclusive:i},{value:s,inclusive:a})>0&&(r=s,i=a)}if(null!==t)for(let o=0;o0&&(r=s,i=t.inclusive);break}return{value:r,inclusive:i}}class Gs{constructor(e,t=null,r=[],i=[],o=null,s="F",a=null,l=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=r,this.filters=i,this.limit=o,this.limitType=s,this.startAt=a,this.endAt=l,this.he=null,this.Pe=null,this.Te=null}}function Lh(n){return new Gs(n)}function y9(n){return 0===n.filters.length&&null===n.limit&&null==n.startAt&&null==n.endAt&&(0===n.explicitOrderBy.length||1===n.explicitOrderBy.length&&n.explicitOrderBy[0].field.isKeyField())}function Vh(n){const e=Z(n);if(null===e.he){e.he=[];const t=new Set;for(const o of e.explicitOrderBy)e.he.push(o),t.add(o.field.canonicalString());const r=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(s){let a=new dt($t.comparator);return s.filters.forEach(l=>{l.getFlattenedFilters().forEach(c=>{c.isInequality()&&(a=a.add(c.field))})}),a})(e).forEach(o=>{t.has(o.canonicalString())||o.isKeyField()||e.he.push(new Wg(o,r))}),t.has($t.keyField().canonicalString())||e.he.push(new Wg($t.keyField(),r))}return e.he}function br(n){const e=Z(n);return e.Pe||(e.Pe=function b9(n,e){if("F"===n.limitType)return V1(n.path,n.collectionGroup,e,n.filters,n.limit,n.startAt,n.endAt);{e=e.map(i=>new Wg(i.field,"desc"===i.dir?"asc":"desc"));const t=n.endAt?new ul(n.endAt.position,n.endAt.inclusive):null,r=n.startAt?new ul(n.startAt.position,n.startAt.inclusive):null;return V1(n.path,n.collectionGroup,e,n.filters,n.limit,t,r)}}(e,Vh(n))),e.Pe}function sI(n,e,t){return new Gs(n.path,n.collectionGroup,n.explicitOrderBy.slice(),n.filters.slice(),e,t,n.startAt,n.endAt)}function Kg(n,e){return Gg(br(n),br(e))&&n.limitType===e.limitType}function w9(n){return`${Yc(br(n))}|lt:${n.limitType}`}function Bh(n){return`Query(target=${function(t){let r=t.path.canonicalString();return null!==t.collectionGroup&&(r+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(r+=`, filters: [${t.filters.map(i=>h9(i)).join(", ")}]`),Og(t.limit)||(r+=", limit: "+t.limit),t.orderBy.length>0&&(r+=`, orderBy: [${t.orderBy.map(i=>{return`${(s=i).field.canonicalString()} (${s.dir})`;var s}).join(", ")}]`),t.startAt&&(r+=", startAt: ",r+=t.startAt.inclusive?"b:":"a:",r+=t.startAt.position.map(i=>Oh(i)).join(",")),t.endAt&&(r+=", endAt: ",r+=t.endAt.inclusive?"a:":"b:",r+=t.endAt.position.map(i=>Oh(i)).join(",")),`Target(${r})`}(br(n))}; limitType=${n.limitType})`}function Qg(n,e){return e.isFoundDocument()&&function(r,i){const o=i.key.path;return null!==r.collectionGroup?i.key.hasCollectionId(r.collectionGroup)&&r.path.isPrefixOf(o):te.isDocumentKey(r.path)?r.path.isEqual(o):r.path.isImmediateParentOf(o)}(n,e)&&function(r,i){for(const o of Vh(r))if(!o.field.isKeyField()&&null===i.data.field(o.field))return!1;return!0}(n,e)&&function(r,i){for(const o of r.filters)if(!o.matches(i))return!1;return!0}(n,e)&&(i=e,!((r=n).startAt&&!function(s,a,l){const c=s9(s,a,l);return s.inclusive?c<=0:c<0}(r.startAt,Vh(r),i)||r.endAt&&!function(s,a,l){const c=s9(s,a,l);return s.inclusive?c>=0:c>0}(r.endAt,Vh(r),i)));var r,i}function I9(n){return(e,t)=>{let r=!1;for(const i of Vh(n)){const o=DRe(i,e,t);if(0!==o)return o;r=r||i.field.isKeyField()}return 0}}function DRe(n,e,t){const r=n.field.isKeyField()?te.comparator(e.key,t.key):function(o,s,a){const l=s.data.field(o),c=a.data.field(o);return null!==l&&null!==c?cl(l,c):ne()}(n.field,e,t);switch(n.dir){case"asc":return r;case"desc":return-1*r;default:return ne()}}class Ks{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){const t=this.mapKeyFn(e),r=this.inner[t];if(void 0!==r)for(const[i,o]of r)if(this.equalsFn(i,e))return o}has(e){return void 0!==this.get(e)}set(e,t){const r=this.mapKeyFn(e),i=this.inner[r];if(void 0===i)return this.inner[r]=[[e,t]],void this.innerSize++;for(let o=0;o{for(const[i,o]of r)e(i,o)})}isEmpty(){return H6(this.inner)}size(){return this.innerSize}}const ARe=new Rt(te.comparator);function ui(){return ARe}const T9=new Rt(te.comparator);function Yg(...n){let e=T9;for(const t of n)e=e.insert(t.key,t);return e}function C9(n){let e=T9;return n.forEach((t,r)=>e=e.insert(t,r.overlayedDocument)),e}function Jo(){return Xg()}function x9(){return Xg()}function Xg(){return new Ks(n=>n.toString(),(n,e)=>n.isEqual(e))}const RRe=new Rt(te.comparator),MRe=new dt(te.comparator);function Re(...n){let e=MRe;for(const t of n)e=e.add(t);return e}const kRe=new dt(Ee);function j1(n,e){if(n.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Fg(e)?"-0":e}}function S9(n){return{integerValue:""+n}}function D9(n,e){return function D6(n){return"number"==typeof n&&Number.isInteger(n)&&!Fg(n)&&n<=Number.MAX_SAFE_INTEGER&&n>=Number.MIN_SAFE_INTEGER}(e)?S9(e):j1(n,e)}class aI{constructor(){this._=void 0}}function NRe(n,e,t){return n instanceof Uh?function(i,o){const s={fields:{[G6]:{stringValue:W6},[Q6]:{timestampValue:{seconds:i.seconds,nanos:i.nanoseconds}}}};return o&&ZE(o)&&(o=JE(o)),o&&(s.fields[K6]=o),{mapValue:s}}(t,e):n instanceof Xc?R9(n,e):n instanceof Zc?M9(n,e):function(i,o){const s=A9(i,o),a=k9(s)+k9(i.Ie);return P1(s)&&P1(i.Ie)?S9(a):j1(i.serializer,a)}(n,e)}function PRe(n,e,t){return n instanceof Xc?R9(n,e):n instanceof Zc?M9(n,e):t}function A9(n,e){return n instanceof zh?P1(r=e)||(o=r)&&"doubleValue"in o?e:{integerValue:0}:null;var r,o}class Uh extends aI{}class Xc extends aI{constructor(e){super(),this.elements=e}}function R9(n,e){const t=N9(e);for(const r of n.elements)t.some(i=>Zo(i,r))||t.push(r);return{arrayValue:{values:t}}}class Zc extends aI{constructor(e){super(),this.elements=e}}function M9(n,e){let t=N9(e);for(const r of n.elements)t=t.filter(i=>!Zo(i,r));return{arrayValue:{values:t}}}class zh extends aI{constructor(e,t){super(),this.serializer=e,this.Ie=t}}function k9(n){return qt(n.integerValue||n.doubleValue)}function N9(n){return $g(n)&&n.arrayValue.values?n.arrayValue.values.slice():[]}class Zg{constructor(e,t){this.field=e,this.transform=t}}class FRe{constructor(e,t){this.version=e,this.transformResults=t}}class Wt{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new Wt}static exists(e){return new Wt(void 0,e)}static updateTime(e){return new Wt(e)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function lI(n,e){return void 0!==n.updateTime?e.isFoundDocument()&&e.version.isEqual(n.updateTime):void 0===n.exists||n.exists===e.isFoundDocument()}class cI{}function P9(n,e){if(!n.hasLocalMutations||e&&0===e.fields.length)return null;if(null===e)return n.isNoDocument()?new Hh(n.key,Wt.none()):new jh(n.key,n.data,Wt.none());{const t=n.data,r=ar.empty();let i=new dt($t.comparator);for(let o of e.fields)if(!i.has(o)){let s=t.field(o);null===s&&o.length>1&&(o=o.popLast(),s=t.field(o)),null===s?r.delete(o):r.set(o,s),i=i.add(o)}return new Qs(n.key,r,new ci(i.toArray()),Wt.none())}}function LRe(n,e,t){n instanceof jh?function(i,o,s){const a=i.value.clone(),l=L9(i.fieldTransforms,o,s.transformResults);a.setAll(l),o.convertToFoundDocument(s.version,a).setHasCommittedMutations()}(n,e,t):n instanceof Qs?function(i,o,s){if(!lI(i.precondition,o))return void o.convertToUnknownDocument(s.version);const a=L9(i.fieldTransforms,o,s.transformResults),l=o.data;l.setAll(F9(i)),l.setAll(a),o.convertToFoundDocument(s.version,l).setHasCommittedMutations()}(n,e,t):e.convertToNoDocument(t.version).setHasCommittedMutations()}function Jg(n,e,t,r){return n instanceof jh?function(o,s,a,l){if(!lI(o.precondition,s))return a;const c=o.value.clone(),u=V9(o.fieldTransforms,l,s);return c.setAll(u),s.convertToFoundDocument(s.version,c).setHasLocalMutations(),null}(n,e,t,r):n instanceof Qs?function(o,s,a,l){if(!lI(o.precondition,s))return a;const c=V9(o.fieldTransforms,l,s),u=s.data;return u.setAll(F9(o)),u.setAll(c),s.convertToFoundDocument(s.version,u).setHasLocalMutations(),null===a?null:a.unionWith(o.fieldMask.fields).unionWith(o.fieldTransforms.map(d=>d.field))}(n,e,t,r):(a=t,lI(n.precondition,s=e)?(s.convertToNoDocument(s.version).setHasLocalMutations(),null):a);var s,a}function VRe(n,e){let t=null;for(const r of n.fieldTransforms){const i=e.data.field(r.field),o=A9(r.transform,i||null);null!=o&&(null===t&&(t=ar.empty()),t.set(r.field,o))}return t||null}function O9(n,e){return n.type===e.type&&!!n.key.isEqual(e.key)&&!!n.precondition.isEqual(e.precondition)&&(i=e.fieldTransforms,!!(void 0===(r=n.fieldTransforms)&&void 0===i||r&&i&&Th(r,i,(o,s)=>function ORe(n,e){return n.field.isEqual(e.field)&&(i=e.transform,(r=n.transform)instanceof Xc&&i instanceof Xc||r instanceof Zc&&i instanceof Zc?Th(r.elements,i.elements,Zo):r instanceof zh&&i instanceof zh?Zo(r.Ie,i.Ie):r instanceof Uh&&i instanceof Uh);var r,i}(o,s))))&&(0===n.type?n.value.isEqual(e.value):1!==n.type||n.data.isEqual(e.data)&&n.fieldMask.isEqual(e.fieldMask));var r,i}class jh extends cI{constructor(e,t,r,i=[]){super(),this.key=e,this.value=t,this.precondition=r,this.fieldTransforms=i,this.type=0}getFieldMask(){return null}}class Qs extends cI{constructor(e,t,r,i,o=[]){super(),this.key=e,this.data=t,this.fieldMask=r,this.precondition=i,this.fieldTransforms=o,this.type=1}getFieldMask(){return this.fieldMask}}function F9(n){const e=new Map;return n.fieldMask.fields.forEach(t=>{if(!t.isEmpty()){const r=n.data.field(t);e.set(t,r)}}),e}function L9(n,e,t){const r=new Map;se(n.length===t.length);for(let i=0;i{const o=e.get(i.key),s=o.overlayedDocument;let a=this.applyToLocalView(s,o.mutatedFields);a=t.has(i.key)?null:a;const l=P9(s,a);null!==l&&r.set(i.key,l),s.isValidDocument()||s.convertToNoDocument(le.min())}),r}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),Re())}isEqual(e){return this.batchId===e.batchId&&Th(this.mutations,e.mutations,(t,r)=>O9(t,r))&&Th(this.baseMutations,e.baseMutations,(t,r)=>O9(t,r))}}class q1{constructor(e,t,r,i){this.batch=e,this.commitVersion=t,this.mutationResults=r,this.docVersions=i}static from(e,t,r){se(e.mutations.length===r.length);let i=function(){return RRe}();const o=e.mutations;for(let s=0;s=8)throw new e_(`Invalid padding: ${t}`);if(r<0)throw new e_(`Invalid hash count: ${r}`);if(e.length>0&&0===this.hashCount)throw new e_(`Invalid hash count: ${r}`);if(0===e.length&&0!==t)throw new e_(`Invalid padding when bitmap length is 0: ${t}`);this.Ee=8*e.length-t,this.de=tl.fromNumber(this.Ee)}Ae(e,t,r){let i=e.add(t.multiply(tl.fromNumber(r)));return 1===i.compare(URe)&&(i=new tl([i.getBits(0),i.getBits(1)],0)),i.modulo(this.de).toNumber()}Re(e){return!!(this.bitmap[Math.floor(e/8)]&1<s.insert(a)),s}insert(e){if(0===this.Ee)return;const t=H9(e),[r,i]=$9(t);for(let o=0;o0&&(this.be=!0,this.we=e)}Fe(){let e=Re(),t=Re(),r=Re();return this.ye.forEach((i,o)=>{switch(o){case 0:e=e.add(i);break;case 2:t=t.add(i);break;case 1:r=r.add(i);break;default:ne()}}),new n_(this.we,this.Se,e,t,r)}Me(){this.be=!1,this.ye=K9()}xe(e,t){this.be=!0,this.ye=this.ye.insert(e,t)}Oe(e){this.be=!0,this.ye=this.ye.remove(e)}Ne(){this.pe+=1}Be(){this.pe-=1,se(this.pe>=0)}Le(){this.be=!0,this.Se=!0}}class zRe{constructor(e){this.ke=e,this.qe=new Map,this.Qe=ui(),this.$e=hI(),this.Ke=hI(),this.Ue=new Rt(Ee)}We(e){for(const t of e.me)e.fe&&e.fe.isFoundDocument()?this.Ge(t,e.fe):this.ze(t,e.key,e.fe);for(const t of e.removedTargetIds)this.ze(t,e.key,e.fe)}je(e){this.forEachTarget(e,t=>{const r=this.He(t);switch(e.state){case 0:this.Je(t)&&r.Ce(e.resumeToken);break;case 1:r.Be(),r.De||r.Me(),r.Ce(e.resumeToken);break;case 2:r.Be(),r.De||this.removeTarget(t);break;case 3:this.Je(t)&&(r.Le(),r.Ce(e.resumeToken));break;case 4:this.Je(t)&&(this.Ye(t),r.Ce(e.resumeToken));break;default:ne()}})}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.qe.forEach((r,i)=>{this.Je(i)&&t(i)})}Ze(e){const t=e.targetId,r=e.ge.count,i=this.Xe(t);if(i){const o=i.target;if(iI(o))if(0===r){const s=new te(o.path);this.ze(t,s,Lt.newNoDocument(s,le.min()))}else se(1===r);else{const s=this.et(t);if(s!==r){const a=this.tt(e),l=a?this.nt(a,e,s):1;0!==l&&(this.Ye(t),this.Ue=this.Ue.insert(t,2===l?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch"))}}}}tt(e){const t=e.ge.unchangedNames;if(!t||!t.bits)return null;const{bits:{bitmap:r="",padding:i=0},hashCount:o=0}=t;let s,a;try{s=Ws(r).toUint8Array()}catch(l){if(l instanceof q6)return eo("Decoding the base64 bloom filter in existence filter failed ("+l.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw l}try{a=new G1(s,i,o)}catch(l){return eo(l instanceof e_?"BloomFilter error: ":"Applying bloom filter failed: ",l),null}return 0===a.Ee?null:a}nt(e,t,r){return t.ge.count===r-this.st(e,t.targetId)?0:2}st(e,t){const r=this.ke.getRemoteKeysForTarget(t);let i=0;return r.forEach(o=>{const s=this.ke.it(),a=`projects/${s.projectId}/databases/${s.database}/documents/${o.path.canonicalString()}`;e.mightContain(a)||(this.ze(t,o,null),i++)}),i}ot(e){const t=new Map;this.qe.forEach((o,s)=>{const a=this.Xe(s);if(a){if(o.current&&iI(a.target)){const l=new te(a.target.path);this._t(l).has(s)||this.ut(s,l)||this.ze(s,l,Lt.newNoDocument(l,e))}o.ve&&(t.set(s,o.Fe()),o.Me())}});let r=Re();this.Ke.forEach((o,s)=>{let a=!0;s.forEachWhile(l=>{const c=this.Xe(l);return!c||"TargetPurposeLimboResolution"===c.purpose||(a=!1,!1)}),a&&(r=r.add(o))}),this.Qe.forEach((o,s)=>s.setReadTime(e));const i=new t_(e,t,this.Ue,this.Qe,r);return this.Qe=ui(),this.$e=hI(),this.Ke=hI(),this.Ue=new Rt(Ee),i}Ge(e,t){if(!this.Je(e))return;const r=this.ut(e,t.key)?2:0;this.He(e).xe(t.key,r),this.Qe=this.Qe.insert(t.key,t),this.$e=this.$e.insert(t.key,this._t(t.key).add(e)),this.Ke=this.Ke.insert(t.key,this.ct(t.key).add(e))}ze(e,t,r){if(!this.Je(e))return;const i=this.He(e);this.ut(e,t)?i.xe(t,1):i.Oe(t),this.Ke=this.Ke.insert(t,this.ct(t).delete(e)),this.Ke=this.Ke.insert(t,this.ct(t).add(e)),r&&(this.Qe=this.Qe.insert(t,r))}removeTarget(e){this.qe.delete(e)}et(e){const t=this.He(e).Fe();return this.ke.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}Ne(e){this.He(e).Ne()}He(e){let t=this.qe.get(e);return t||(t=new G9,this.qe.set(e,t)),t}ct(e){let t=this.Ke.get(e);return t||(t=new dt(Ee),this.Ke=this.Ke.insert(e,t)),t}_t(e){let t=this.$e.get(e);return t||(t=new dt(Ee),this.$e=this.$e.insert(e,t)),t}Je(e){const t=null!==this.Xe(e);return t||z("WatchChangeAggregator","Detected inactive target",e),t}Xe(e){const t=this.qe.get(e);return t&&t.De?null:this.ke.lt(e)}Ye(e){this.qe.set(e,new G9),this.ke.getRemoteKeysForTarget(e).forEach(t=>{this.ze(e,t,null)})}ut(e,t){return this.ke.getRemoteKeysForTarget(e).has(t)}}function hI(){return new Rt(te.comparator)}function K9(){return new Rt(te.comparator)}const jRe={asc:"ASCENDING",desc:"DESCENDING"},HRe={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},$Re={and:"AND",or:"OR"};class qRe{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function K1(n,e){return n.useProto3Json||Og(e)?e:{value:e}}function $h(n,e){return n.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function Q9(n,e){return n.useProto3Json?e.toBase64():e.toUint8Array()}function WRe(n,e){return $h(n,e.toTimestamp())}function bn(n){return se(!!n),le.fromTimestamp(function(t){const r=qs(t);return new Yt(r.seconds,r.nanos)}(n))}function Q1(n,e){return Y1(n,e).canonicalString()}function Y1(n,e){const t=(i=n,new We(["projects",i.projectId,"databases",i.database])).child("documents");var i;return void 0===e?t:t.child(e)}function Y9(n){const e=We.fromString(n);return se(a7(e)),e}function r_(n,e){return Q1(n.databaseId,e.path)}function es(n,e){const t=Y9(e);if(t.get(1)!==n.databaseId.projectId)throw new j(F.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+t.get(1)+" vs "+n.databaseId.projectId);if(t.get(3)!==n.databaseId.database)throw new j(F.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+t.get(3)+" vs "+n.databaseId.database);return new te(J9(t))}function X9(n,e){return Q1(n.databaseId,e)}function Z9(n){const e=Y9(n);return 4===e.length?We.emptyPath():J9(e)}function X1(n){return new We(["projects",n.databaseId.projectId,"databases",n.databaseId.database]).canonicalString()}function J9(n){return se(n.length>4&&"documents"===n.get(4)),n.popFirst(5)}function e7(n,e,t){return{name:r_(n,e),fields:t.value.mapValue.fields}}function i_(n,e){let t;if(e instanceof jh)t={update:e7(n,e.key,e.value)};else if(e instanceof Hh)t={delete:r_(n,e.key)};else if(e instanceof Qs)t={update:e7(n,e.key,e.data),updateMask:eMe(e.fieldMask)};else{if(!(e instanceof H1))return ne();t={verify:r_(n,e.key)}}return e.fieldTransforms.length>0&&(t.updateTransforms=e.fieldTransforms.map(r=>function(o,s){const a=s.transform;if(a instanceof Uh)return{fieldPath:s.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(a instanceof Xc)return{fieldPath:s.field.canonicalString(),appendMissingElements:{values:a.elements}};if(a instanceof Zc)return{fieldPath:s.field.canonicalString(),removeAllFromArray:{values:a.elements}};if(a instanceof zh)return{fieldPath:s.field.canonicalString(),increment:a.Ie};throw ne()}(0,r))),e.precondition.isNone||(t.currentDocument=void 0!==(o=e.precondition).updateTime?{updateTime:WRe(n,o.updateTime)}:void 0!==o.exists?{exists:o.exists}:ne()),t;var o}function Z1(n,e){const t=e.currentDocument?void 0!==(o=e.currentDocument).updateTime?Wt.updateTime(bn(o.updateTime)):void 0!==o.exists?Wt.exists(o.exists):Wt.none():Wt.none(),r=e.updateTransforms?e.updateTransforms.map(i=>function(s,a){let l=null;"setToServerValue"in a?(se("REQUEST_TIME"===a.setToServerValue),l=new Uh):"appendMissingElements"in a?l=new Xc(a.appendMissingElements.values||[]):"removeAllFromArray"in a?l=new Zc(a.removeAllFromArray.values||[]):"increment"in a?l=new zh(s,a.increment):ne();const c=$t.fromServerFormat(a.fieldPath);return new Zg(c,l)}(n,i)):[];var o;if(e.update){const i=es(n,e.update.name),o=new ar({mapValue:{fields:e.update.fields}});if(e.updateMask){const s=new ci((e.updateMask.fieldPaths||[]).map(u=>$t.fromServerFormat(u)));return new Qs(i,o,s,t,r)}return new jh(i,o,t,r)}if(e.delete){const i=es(n,e.delete);return new Hh(i,t)}if(e.verify){const i=es(n,e.verify);return new H1(i,t)}return ne()}function n7(n,e){return{documents:[X9(n,e.path)]}}function fI(n,e){const t={structuredQuery:{}},r=e.path;let i;null!==e.collectionGroup?(i=r,t.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(i=r.popLast(),t.structuredQuery.from=[{collectionId:r.lastSegment()}]),t.parent=X9(n,i);const o=function(c){if(0!==c.length)return s7(ht.create(c,"and"))}(e.filters);o&&(t.structuredQuery.where=o);const s=function(c){if(0!==c.length)return c.map(u=>{return{field:dl((f=u).field),direction:XRe(f.dir)};var f})}(e.orderBy);s&&(t.structuredQuery.orderBy=s);const a=K1(n,e.limit);return null!==a&&(t.structuredQuery.limit=a),e.startAt&&(t.structuredQuery.startAt={before:(c=e.startAt).inclusive,values:c.position}),e.endAt&&(t.structuredQuery.endAt=function(c){return{before:!c.inclusive,values:c.position}}(e.endAt)),{ht:t,parent:i};var c}function i7(n){let e=Z9(n.parent);const t=n.structuredQuery,r=t.from?t.from.length:0;let i=null;if(r>0){se(1===r);const u=t.from[0];u.allDescendants?i=u.collectionId:e=e.child(u.collectionId)}let o=[];t.where&&(o=function(d){const f=o7(d);return f instanceof ht&&F1(f)?f.getFilters():[f]}(t.where));let s=[];t.orderBy&&(s=t.orderBy.map(f=>{return new Wg(qh((m=f).field),function(v){switch(v){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(m.direction));var m}));let a=null;t.limit&&(a=function(d){let f;return f="object"==typeof d?d.value:d,Og(f)?null:f}(t.limit));let l=null;var d;t.startAt&&(l=new ul((d=t.startAt).values||[],!!d.before));let c=null;return t.endAt&&(c=function(d){return new ul(d.values||[],!d.before)}(t.endAt)),function _9(n,e,t,r,i,o,s,a){return new Gs(n,e,t,r,i,o,s,a)}(e,i,s,o,a,"F",l,c)}function o7(n){return void 0!==n.unaryFilter?function(t){switch(t.unaryFilter.op){case"IS_NAN":const r=qh(t.unaryFilter.field);return Ge.create(r,"==",{doubleValue:NaN});case"IS_NULL":const i=qh(t.unaryFilter.field);return Ge.create(i,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const o=qh(t.unaryFilter.field);return Ge.create(o,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const s=qh(t.unaryFilter.field);return Ge.create(s,"!=",{nullValue:"NULL_VALUE"});default:return ne()}}(n):void 0!==n.fieldFilter?Ge.create(qh((t=n).fieldFilter.field),function(i){switch(i){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return ne()}}(t.fieldFilter.op),t.fieldFilter.value):void 0!==n.compositeFilter?function(t){return ht.create(t.compositeFilter.filters.map(r=>o7(r)),function(i){switch(i){case"AND":return"and";case"OR":return"or";default:return ne()}}(t.compositeFilter.op))}(n):ne();var t}function XRe(n){return jRe[n]}function ZRe(n){return HRe[n]}function JRe(n){return $Re[n]}function dl(n){return{fieldPath:n.canonicalString()}}function qh(n){return $t.fromServerFormat(n.fieldPath)}function s7(n){return n instanceof Ge?function(t){if("=="===t.op){if(e9(t.value))return{unaryFilter:{field:dl(t.field),op:"IS_NAN"}};if(J6(t.value))return{unaryFilter:{field:dl(t.field),op:"IS_NULL"}}}else if("!="===t.op){if(e9(t.value))return{unaryFilter:{field:dl(t.field),op:"IS_NOT_NAN"}};if(J6(t.value))return{unaryFilter:{field:dl(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:dl(t.field),op:ZRe(t.op),value:t.value}}}(n):n instanceof ht?function(t){const r=t.getFilters().map(i=>s7(i));return 1===r.length?r[0]:{compositeFilter:{op:JRe(t.op),filters:r}}}(n):ne()}function eMe(n){const e=[];return n.fields.forEach(t=>e.push(t.canonicalString())),{fieldPaths:e}}function a7(n){return n.length>=4&&"projects"===n.get(0)&&"databases"===n.get(2)}class Ys{constructor(e,t,r,i,o=le.min(),s=le.min(),a=ln.EMPTY_BYTE_STRING,l=null){this.target=e,this.targetId=t,this.purpose=r,this.sequenceNumber=i,this.snapshotVersion=o,this.lastLimboFreeSnapshotVersion=s,this.resumeToken=a,this.expectedCount=l}withSequenceNumber(e){return new Ys(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,t){return new Ys(this.target,this.targetId,this.purpose,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new Ys(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new Ys(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}class l7{constructor(e){this.Tt=e}}function c7(n,e){const t=e.key,r={prefixPath:t.getCollectionPath().popLast().toArray(),collectionGroup:t.collectionGroup,documentId:t.path.lastSegment(),readTime:pI(e.readTime),hasCommittedMutations:e.hasCommittedMutations};if(e.isFoundDocument())r.document={name:r_(o=n.Tt,(s=e).key),fields:s.data.value.mapValue.fields,updateTime:$h(o,s.version.toTimestamp()),createTime:$h(o,s.createTime.toTimestamp())};else if(e.isNoDocument())r.noDocument={path:t.path.toArray(),readTime:Jc(e.version)};else{if(!e.isUnknownDocument())return ne();r.unknownDocument={path:t.path.toArray(),version:Jc(e.version)}}var o,s;return r}function pI(n){const e=n.toTimestamp();return[e.seconds,e.nanoseconds]}function Jc(n){const e=n.toTimestamp();return{seconds:e.seconds,nanoseconds:e.nanoseconds}}function eu(n){const e=new Yt(n.seconds,n.nanoseconds);return le.fromTimestamp(e)}function tu(n,e){const t=(e.baseMutations||[]).map(o=>Z1(n.Tt,o));for(let o=0;oZ1(n.Tt,o)),i=Yt.fromMillis(e.localWriteTimeMs);return new $1(e.batchId,i,t,r)}function o_(n){const e=eu(n.readTime),t=void 0!==n.lastLimboFreeSnapshotVersion?eu(n.lastLimboFreeSnapshotVersion):le.min();let r;return r=void 0!==n.query.documents?(se(1===(o=n.query).documents.length),br(Lh(Z9(o.documents[0])))):function(o){return br(i7(o))}(n.query),new Ys(r,n.targetId,"TargetPurposeListen",n.lastListenSequenceNumber,e,t,ln.fromBase64String(n.resumeToken));var o}function u7(n,e){const t=Jc(e.snapshotVersion),r=Jc(e.lastLimboFreeSnapshotVersion);let i;i=iI(e.target)?n7(n.Tt,e.target):fI(n.Tt,e.target).ht;const o=e.resumeToken.toBase64();return{targetId:e.targetId,canonicalId:Yc(e.target),readTime:t,resumeToken:o,lastListenSequenceNumber:e.sequenceNumber,lastLimboFreeSnapshotVersion:r,query:i}}function J1(n){const e=i7({parent:n.parent,structuredQuery:n.structuredQuery});return"LAST"===n.limitType?sI(e,e.limit,"L"):e}function eN(n,e){return new W1(e.largestBatchId,Z1(n.Tt,e.overlayMutation))}function d7(n,e){const t=e.path.lastSegment();return[n,vr(e.path.popLast()),t]}function h7(n,e,t,r){return{indexId:n,uid:e,sequenceNumber:t,readTime:Jc(r.readTime),documentKey:vr(r.documentKey.path),largestBatchId:r.largestBatchId}}class nMe{getBundleMetadata(e,t){return f7(e).get(t).next(r=>{if(r)return{id:(o=r).bundleId,createTime:eu(o.createTime),version:o.version};var o})}saveBundleMetadata(e,t){return f7(e).put({bundleId:(i=t).id,createTime:Jc(bn(i.createTime)),version:i.version});var i}getNamedQuery(e,t){return p7(e).get(t).next(r=>{if(r)return{name:(o=r).name,query:J1(o.bundledQuery),readTime:eu(o.readTime)};var o})}saveNamedQuery(e,t){return p7(e).put({name:(i=t).name,readTime:Jc(bn(i.readTime)),bundledQuery:i.bundledQuery});var i}}function f7(n){return Un(n,WE)}function p7(n){return Un(n,GE)}class mI{constructor(e,t){this.serializer=e,this.userId=t}static It(e,t){return new mI(e,t.uid||"")}getOverlay(e,t){return s_(e).get(d7(this.userId,t)).next(r=>r?eN(this.serializer,r):null)}getOverlays(e,t){const r=Jo();return N.forEach(t,i=>this.getOverlay(e,i).next(o=>{null!==o&&r.set(i,o)})).next(()=>r)}saveOverlays(e,t,r){const i=[];return r.forEach((o,s)=>{const a=new W1(t,s);i.push(this.Et(e,a))}),N.waitFor(i)}removeOverlaysForBatchId(e,t,r){const i=new Set;t.forEach(s=>i.add(vr(s.getCollectionPath())));const o=[];return i.forEach(s=>{const a=IDBKeyRange.bound([this.userId,s,r],[this.userId,s,r+1],!1,!0);o.push(s_(e).J(S1,a))}),N.waitFor(o)}getOverlaysForCollection(e,t,r){const i=Jo(),o=vr(t),s=IDBKeyRange.bound([this.userId,o,r],[this.userId,o,Number.POSITIVE_INFINITY],!0);return s_(e).G(S1,s).next(a=>{for(const l of a){const c=eN(this.serializer,l);i.set(c.getKey(),c)}return i})}getOverlaysForCollectionGroup(e,t,r,i){const o=Jo();let s;const a=IDBKeyRange.bound([this.userId,t,r],[this.userId,t,Number.POSITIVE_INFINITY],!0);return s_(e).Z({index:L6,range:a},(l,c,u)=>{const d=eN(this.serializer,c);o.size()o)}Et(e,t){return s_(e).put(function(i,o,s){const[a,l,c]=d7(o,s.mutation.key);return{userId:o,collectionPath:l,documentId:c,collectionGroup:s.mutation.key.getCollectionGroup(),largestBatchId:s.largestBatchId,overlayMutation:i_(i.Tt,s.mutation)}}(this.serializer,this.userId,t))}}function s_(n){return Un(n,YE)}class rMe{dt(e){return Un(e,D1)}getSessionToken(e){return this.dt(e).get("sessionToken").next(t=>{const r=t?.value;return r?ln.fromUint8Array(r):ln.EMPTY_BYTE_STRING})}setSessionToken(e,t){return this.dt(e).put({name:"sessionToken",value:t.toUint8Array()})}}class nu{constructor(){}At(e,t){this.Rt(e,t),t.Vt()}Rt(e,t){if("nullValue"in e)this.ft(t,5);else if("booleanValue"in e)this.ft(t,10),t.gt(e.booleanValue?1:0);else if("integerValue"in e)this.ft(t,15),t.gt(qt(e.integerValue));else if("doubleValue"in e){const r=qt(e.doubleValue);isNaN(r)?this.ft(t,13):(this.ft(t,15),Fg(r)?t.gt(0):t.gt(r))}else if("timestampValue"in e){let r=e.timestampValue;this.ft(t,20),"string"==typeof r&&(r=qs(r)),t.yt(`${r.seconds||""}`),t.gt(r.nanos||0)}else if("stringValue"in e)this.wt(e.stringValue,t),this.St(t);else if("bytesValue"in e)this.ft(t,30),t.bt(Ws(e.bytesValue)),this.St(t);else if("referenceValue"in e)this.Dt(e.referenceValue,t);else if("geoPointValue"in e){const r=e.geoPointValue;this.ft(t,45),t.gt(r.latitude||0),t.gt(r.longitude||0)}else"mapValue"in e?t9(e)?this.ft(t,Number.MAX_SAFE_INTEGER):rI(e)?this.vt(e.mapValue,t):(this.Ct(e.mapValue,t),this.St(t)):"arrayValue"in e?(this.Ft(e.arrayValue,t),this.St(t)):ne()}wt(e,t){this.ft(t,25),this.Mt(e,t)}Mt(e,t){t.yt(e)}Ct(e,t){const r=e.fields||{};this.ft(t,55);for(const i of Object.keys(r))this.wt(i,t),this.Rt(r[i],t)}vt(e,t){var r,i;const o=e.fields||{};this.ft(t,53);const s=Ph,a=(null===(i=null===(r=o[s].arrayValue)||void 0===r?void 0:r.values)||void 0===i?void 0:i.length)||0;this.ft(t,15),t.gt(qt(a)),this.wt(s,t),this.Rt(o[s],t)}Ft(e,t){const r=e.values||[];this.ft(t,50);for(const i of r)this.Rt(i,t)}Dt(e,t){this.ft(t,37),te.fromName(e).path.forEach(r=>{this.ft(t,60),this.Mt(r,t)})}ft(e,t){e.gt(t)}St(e){e.gt(2)}}function iMe(n){if(0===n)return 8;let e=0;return n>>4||(e+=4,n<<=4),n>>6||(e+=2,n<<=2),n>>7||(e+=1),e}function m7(n){const e=64-function(r){let i=0;for(let o=0;o<8;++o){const s=iMe(255&r[o]);if(i+=s,8!==s)break}return i}(n);return Math.ceil(e/8)}nu.xt=new nu;class oMe{constructor(){this.buffer=new Uint8Array(1024),this.position=0}Ot(e){const t=e[Symbol.iterator]();let r=t.next();for(;!r.done;)this.Nt(r.value),r=t.next();this.Bt()}Lt(e){const t=e[Symbol.iterator]();let r=t.next();for(;!r.done;)this.kt(r.value),r=t.next();this.qt()}Qt(e){for(const t of e){const r=t.charCodeAt(0);if(r<128)this.Nt(r);else if(r<2048)this.Nt(960|r>>>6),this.Nt(128|63&r);else if(t<"\ud800"||"\udbff">>12),this.Nt(128|63&r>>>6),this.Nt(128|63&r);else{const i=t.codePointAt(0);this.Nt(240|i>>>18),this.Nt(128|63&i>>>12),this.Nt(128|63&i>>>6),this.Nt(128|63&i)}}this.Bt()}$t(e){for(const t of e){const r=t.charCodeAt(0);if(r<128)this.kt(r);else if(r<2048)this.kt(960|r>>>6),this.kt(128|63&r);else if(t<"\ud800"||"\udbff">>12),this.kt(128|63&r>>>6),this.kt(128|63&r);else{const i=t.codePointAt(0);this.kt(240|i>>>18),this.kt(128|63&i>>>12),this.kt(128|63&i>>>6),this.kt(128|63&i)}}this.qt()}Kt(e){const t=this.Ut(e),r=m7(t);this.Wt(1+r),this.buffer[this.position++]=255&r;for(let i=t.length-r;i$t.comparator(t.field,r.field)),this.collectionId=null!=e.collectionGroup?e.collectionGroup:e.path.lastSegment(),this.sn=e.orderBy,this._n=[];for(const t of e.filters){const r=t;r.isInequality()?this.rn=this.rn.add(r):this._n.push(r)}}get an(){return this.rn.size>1}un(e){if(se(e.collectionGroup===this.collectionId),this.an)return!1;const t=v1(e);if(void 0!==t&&!this.cn(t))return!1;const r=jc(e);let i=new Set,o=0,s=0;for(;o0){const a=this.rn.getIterator().getNext();if(!i.has(a.field.canonicalString())){const l=r[o];if(!this.ln(a,l)||!this.hn(this.sn[s++],l))return!1}++o}for(;o=this.sn.length||!this.hn(this.sn[s++],r[o]))return!1;return!0}Pn(){if(this.an)return null;let e=new dt($t.comparator);const t=[];for(const r of this._n)if(!r.field.isKeyField())if("array-contains"===r.op||"array-contains-any"===r.op)t.push(new Hc(r.field,2));else{if(e.has(r.field))continue;e=e.add(r.field),t.push(new Hc(r.field,0))}for(const r of this.sn)r.field.isKeyField()||e.has(r.field)||(e=e.add(r.field),t.push(new Hc(r.field,"asc"===r.dir?0:1)));return new xh(xh.UNKNOWN_ID,this.collectionId,t,Sh.empty())}cn(e){for(const t of this._n)if(this.ln(t,e))return!0;return!1}ln(e,t){return!(void 0===e||!e.field.isEqual(t.fieldPath))&&2===t.kind==("array-contains"===e.op||"array-contains-any"===e.op)}hn(e,t){return!!e.field.isEqual(t.fieldPath)&&(0===t.kind&&"asc"===e.dir||1===t.kind&&"desc"===e.dir)}}function y7(n){var e,t;if(se(n instanceof Ge||n instanceof ht),n instanceof Ge){if(n instanceof p9){const i=(null===(t=null===(e=n.value.arrayValue)||void 0===e?void 0:e.values)||void 0===t?void 0:t.map(o=>Ge.create(n.field,"==",o)))||[];return ht.create(i,"or")}return n}const r=n.filters.map(i=>y7(i));return ht.create(r,n.op)}function lMe(n){if(0===n.getFilters().length)return[];const e=rN(y7(n));return se(v7(e)),tN(e)||nN(e)?[e]:e.getFilters()}function tN(n){return n instanceof Ge}function nN(n){return n instanceof ht&&F1(n)}function v7(n){return tN(n)||nN(n)||function(t){if(t instanceof ht&&O1(t)){for(const r of t.getFilters())if(!tN(r)&&!nN(r))return!1;return!0}return!1}(n)}function rN(n){if(se(n instanceof Ge||n instanceof ht),n instanceof Ge)return n;if(1===n.filters.length)return rN(n.filters[0]);const e=n.filters.map(r=>rN(r));let t=ht.create(e,n.op);return t=gI(t),v7(t)?t:(se(t instanceof ht),se(Fh(t)),se(t.filters.length>1),t.filters.reduce((r,i)=>iN(r,i)))}function iN(n,e){let t;return se(n instanceof Ge||n instanceof ht),se(e instanceof Ge||e instanceof ht),t=n instanceof Ge?e instanceof Ge?ht.create([n,e],"and"):b7(n,e):e instanceof Ge?b7(e,n):function(i,o){if(se(i.filters.length>0&&o.filters.length>0),Fh(i)&&Fh(o))return d9(i,o.getFilters());const s=O1(i)?i:o,a=O1(i)?o:i,l=s.filters.map(c=>iN(c,a));return ht.create(l,"or")}(n,e),gI(t)}function b7(n,e){if(Fh(e))return d9(e,n.getFilters());{const t=e.filters.map(r=>iN(n,r));return ht.create(t,"or")}}function gI(n){if(se(n instanceof Ge||n instanceof ht),n instanceof Ge)return n;const e=n.getFilters();if(1===e.length)return gI(e[0]);if(c9(n))return n;const t=e.map(i=>gI(i)),r=[];return t.forEach(i=>{i instanceof Ge?r.push(i):i instanceof ht&&(i.op===n.op?r.push(...i.filters):r.push(i))}),1===r.length?r[0]:ht.create(r,n.op)}class cMe{constructor(){this.Tn=new oN}addToCollectionParentIndex(e,t){return this.Tn.add(t),N.resolve()}getCollectionParents(e,t){return N.resolve(this.Tn.getEntries(t))}addFieldIndex(e,t){return N.resolve()}deleteFieldIndex(e,t){return N.resolve()}deleteAllFieldIndexes(e){return N.resolve()}createTargetIndexes(e,t){return N.resolve()}getDocumentsMatchingTarget(e,t){return N.resolve(null)}getIndexType(e,t){return N.resolve(0)}getFieldIndexes(e,t){return N.resolve([])}getNextCollectionGroupToUpdate(e){return N.resolve(null)}getMinOffset(e,t){return N.resolve(Mi.min())}getMinOffsetFromCollectionGroup(e,t){return N.resolve(Mi.min())}updateCollectionGroup(e,t,r){return N.resolve()}updateIndexEntries(e,t){return N.resolve()}}class oN{constructor(){this.index={}}add(e){const t=e.lastSegment(),r=e.popLast(),i=this.index[t]||new dt(We.comparator),o=!i.has(r);return this.index[t]=i.add(r),o}has(e){const t=e.lastSegment(),r=e.popLast(),i=this.index[t];return i&&i.has(r)}getEntries(e){return(this.index[e]||new dt(We.comparator)).toArray()}}const w7="IndexedDbIndexManager",_I=new Uint8Array(0);class uMe{constructor(e,t){this.databaseId=t,this.In=new oN,this.En=new Ks(r=>Yc(r),(r,i)=>Gg(r,i)),this.uid=e.uid||""}addToCollectionParentIndex(e,t){if(!this.In.has(t)){const r=t.lastSegment(),i=t.popLast();e.addOnCommittedListener(()=>{this.In.add(t)});const o={collectionId:r,parent:vr(i)};return E7(e).put(o)}return N.resolve()}getCollectionParents(e,t){const r=[],i=IDBKeyRange.bound([t,""],[v6(t),""],!1,!0);return E7(e).G(i).next(o=>{for(const s of o){if(s.collectionId!==t)break;r.push(Xo(s.parent))}return r})}addFieldIndex(e,t){const r=l_(e),i={indexId:(a=t).indexId,collectionGroup:a.collectionGroup,fields:a.fields.map(l=>[l.fieldPath.canonicalString(),l.kind])};var a;delete i.indexId;const o=r.add(i);if(t.indexState){const s=Kh(e);return o.next(a=>{s.put(h7(a,this.uid,t.indexState.sequenceNumber,t.indexState.offset))})}return o.next()}deleteFieldIndex(e,t){const r=l_(e),i=Kh(e),o=Gh(e);return r.delete(t.indexId).next(()=>i.delete(IDBKeyRange.bound([t.indexId],[t.indexId+1],!1,!0))).next(()=>o.delete(IDBKeyRange.bound([t.indexId],[t.indexId+1],!1,!0)))}deleteAllFieldIndexes(e){const t=l_(e),r=Gh(e),i=Kh(e);return t.J().next(()=>r.J()).next(()=>i.J())}createTargetIndexes(e,t){return N.forEach(this.dn(t),r=>this.getIndexType(e,r).next(i=>{if(0===i||1===i){const o=new _7(r).Pn();if(null!=o)return this.addFieldIndex(e,o)}}))}getDocumentsMatchingTarget(e,t){const r=Gh(e);let i=!0;const o=new Map;return N.forEach(this.dn(t),s=>this.An(e,s).next(a=>{i&&(i=!!a),o.set(s,a)})).next(()=>{if(i){let s=Re();const a=[];return N.forEach(o,(l,c)=>{var R;z(w7,`Using index ${R=l,`id=${R.indexId}|cg=${R.collectionGroup}|f=${R.fields.map(V=>`${V.fieldPath}:${V.kind}`).join(",")}`} to execute ${Yc(t)}`);const u=function(R,V){const H=v1(V);if(void 0===H)return null;for(const Q of oI(R,H.fieldPath))switch(Q.op){case"array-contains-any":return Q.value.arrayValue.values||[];case"array-contains":return[Q.value]}return null}(c,l),d=function(R,V){const H=new Map;for(const Q of jc(V))for(const S of oI(R,Q.fieldPath))switch(S.op){case"==":case"in":H.set(Q.fieldPath.canonicalString(),S.value);break;case"not-in":case"!=":return H.set(Q.fieldPath.canonicalString(),S.value),Array.from(H.values())}return null}(c,l),f=function(R,V){const H=[];let Q=!0;for(const S of jc(V)){const I=0===S.kind?m9(R,S.fieldPath,R.startAt):g9(R,S.fieldPath,R.startAt);H.push(I.value),Q&&(Q=I.inclusive)}return new ul(H,Q)}(c,l),p=function(R,V){const H=[];let Q=!0;for(const S of jc(V)){const I=0===S.kind?g9(R,S.fieldPath,R.endAt):m9(R,S.fieldPath,R.endAt);H.push(I.value),Q&&(Q=I.inclusive)}return new ul(H,Q)}(c,l),m=this.Rn(l,c,f),_=this.Rn(l,c,p),v=this.Vn(l,c,d),E=this.mn(l.indexId,u,m,f.inclusive,_,p.inclusive,v);return N.forEach(E,C=>r.H(C,t.limit).next(R=>{R.forEach(V=>{const H=te.fromSegments(V.documentKey);s.has(H)||(s=s.add(H),a.push(H))})}))}).next(()=>a)}return N.resolve(null)})}dn(e){let t=this.En.get(e);return t||(t=0===e.filters.length?[e]:lMe(ht.create(e.filters,"and")).map(r=>V1(e.path,e.collectionGroup,e.orderBy,r.getFilters(),e.limit,e.startAt,e.endAt)),this.En.set(e,t),t)}mn(e,t,r,i,o,s,a){const l=(null!=t?t.length:1)*Math.max(r.length,o.length),c=l/(null!=t?t.length:1),u=[];for(let d=0;dthis.gn(e,f,v,!0));u.push(...this.createRange(p,m,_))}return u}gn(e,t,r,i){const o=new ru(e,te.empty(),t,r);return i?o:o.nn()}pn(e,t,r,i){const o=new ru(e,te.empty(),t,r);return i?o.nn():o}An(e,t){const r=new _7(t),i=null!=t.collectionGroup?t.collectionGroup:t.path.lastSegment();return this.getFieldIndexes(e,i).next(o=>{let s=null;for(const a of o)r.un(a)&&(!s||a.fields.length>s.fields.length)&&(s=a);return s})}getIndexType(e,t){let r=2;const i=this.dn(t);return N.forEach(i,o=>this.An(e,o).next(s=>{s?0!==r&&s.fields.lengthnull!==t.limit&&i.length>1&&2===r?1:r)}yn(e,t){const r=new a_;for(const i of jc(e)){const o=t.data.field(i.fieldPath);if(null==o)return null;const s=r.tn(i.kind);nu.xt.At(o,s)}return r.Yt()}fn(e){const t=new a_;return nu.xt.At(e,t.tn(0)),t.Yt()}wn(e,t){const r=new a_;return nu.xt.At(Qc(this.databaseId,t),r.tn(function(o){const s=jc(o);return 0===s.length?0:s[s.length-1].kind}(e))),r.Yt()}Vn(e,t,r){if(null===r)return[];let i=[];i.push(new a_);let o=0;for(const s of jc(e)){const a=r[o++];for(const l of i)if(this.Sn(t,s.fieldPath)&&$g(a))i=this.bn(i,s,a);else{const c=l.tn(s.kind);nu.xt.At(a,c)}}return this.Dn(i)}Rn(e,t,r){return this.Vn(e,t,r.position)}Dn(e){const t=[];for(let r=0;rr instanceof Ge&&r.field.isEqual(t)&&("in"===r.op||"not-in"===r.op))}getFieldIndexes(e,t){const r=l_(e),i=Kh(e);return(t?r.G(x1,IDBKeyRange.bound(t,t)):r.G()).next(o=>{const s=[];return N.forEach(o,a=>i.get([a.indexId,this.uid]).next(l=>{s.push(function(u,d){const f=d?new Sh(d.sequenceNumber,new Mi(eu(d.readTime),new te(Xo(d.documentKey)),d.largestBatchId)):Sh.empty(),p=u.fields.map(([m,_])=>new Hc($t.fromServerFormat(m),_));return new xh(u.indexId,u.collectionGroup,p,f)}(a,l))})).next(()=>s)})}getNextCollectionGroupToUpdate(e){return this.getFieldIndexes(e).next(t=>0===t.length?null:(t.sort((r,i)=>{const o=r.indexState.sequenceNumber-i.indexState.sequenceNumber;return 0!==o?o:Ee(r.collectionGroup,i.collectionGroup)}),t[0].collectionGroup))}updateCollectionGroup(e,t,r){const i=l_(e),o=Kh(e);return this.vn(e).next(s=>i.G(x1,IDBKeyRange.bound(t,t)).next(a=>N.forEach(a,l=>o.put(h7(l.indexId,this.uid,s,r)))))}updateIndexEntries(e,t){const r=new Map;return N.forEach(t,(i,o)=>{const s=r.get(i.collectionGroup);return(s?N.resolve(s):this.getFieldIndexes(e,i.collectionGroup)).next(a=>(r.set(i.collectionGroup,a),N.forEach(a,l=>this.Cn(e,i,l).next(c=>{const u=this.Fn(o,l);return c.isEqual(u)?N.resolve():this.Mn(e,o,l,c,u)}))))})}xn(e,t,r,i){return Gh(e).put({indexId:i.indexId,uid:this.uid,arrayValue:i.arrayValue,directionalValue:i.directionalValue,orderedDocumentKey:this.wn(r,t.key),documentKey:t.key.path.toArray()})}On(e,t,r,i){return Gh(e).delete([i.indexId,this.uid,i.arrayValue,i.directionalValue,this.wn(r,t.key),t.key.path.toArray()])}Cn(e,t,r){const i=Gh(e);let o=new dt(hl);return i.Z({index:F6,range:IDBKeyRange.only([r.indexId,this.uid,this.wn(r,t)])},(s,a)=>{o=o.add(new ru(r.indexId,t,a.arrayValue,a.directionalValue))}).next(()=>o)}Fn(e,t){let r=new dt(hl);const i=this.yn(t,e);if(null==i)return r;const o=v1(t);if(null!=o){const s=e.data.field(o.fieldPath);if($g(s))for(const a of s.arrayValue.values||[])r=r.add(new ru(t.indexId,e.key,this.fn(a),i))}else r=r.add(new ru(t.indexId,e.key,_I,i));return r}Mn(e,t,r,i,o){z(w7,"Updating index entries for document '%s'",t.key);const s=[];return function(l,c,u,d,f){const p=l.getIterator(),m=c.getIterator();let _=Nh(p),v=Nh(m);for(;_||v;){let E=!1,C=!1;if(_&&v){const R=u(_,v);R<0?C=!0:R>0&&(E=!0)}else null!=_?C=!0:E=!0;E?(d(v),v=Nh(m)):C?(f(_),_=Nh(p)):(_=Nh(p),v=Nh(m))}}(i,o,hl,a=>{s.push(this.xn(e,t,r,a))},a=>{s.push(this.On(e,t,r,a))}),N.waitFor(s)}vn(e){let t=1;return Kh(e).Z({index:O6,reverse:!0,range:IDBKeyRange.upperBound([this.uid,Number.MAX_SAFE_INTEGER])},(r,i,o)=>{o.done(),t=i.sequenceNumber+1}).next(()=>t)}createRange(e,t,r){r=r.sort((s,a)=>hl(s,a)).filter((s,a,l)=>!a||0!==hl(s,l[a-1]));const i=[];i.push(e);for(const s of r){const a=hl(s,e),l=hl(s,t);if(0===a)i[0]=e.nn();else if(a>0&&l<0)i.push(s),i.push(s.nn());else if(l>0)break}i.push(t);const o=[];for(let s=0;s0}getMinOffsetFromCollectionGroup(e,t){return this.getFieldIndexes(e,t).next(I7)}getMinOffset(e,t){return N.mapArray(this.dn(t),r=>this.An(e,r).next(i=>i||ne())).next(I7)}}function E7(n){return Un(n,Ug)}function Gh(n){return Un(n,QE)}function l_(n){return Un(n,C1)}function Kh(n){return Un(n,KE)}function I7(n){se(0!==n.length);let e=n[0].indexState.offset,t=e.largestBatchId;for(let r=1;r(a++,f.delete()));o.push(l.next(()=>{se(1===a)}));const c=[];for(const u of t.mutations){const d=k6(e,u.key.path,t.batchId);o.push(i.delete(d)),c.push(u.key)}return N.waitFor(o).next(()=>c)}function yI(n){if(!n)return 0;let e;if(n.document)e=n.document;else if(n.unknownDocument)e=n.unknownDocument;else{if(!n.noDocument)throw ne();e=n.noDocument}return JSON.stringify(e).length}wr.DEFAULT_COLLECTION_PERCENTILE=10,wr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,wr.DEFAULT=new wr(41943040,wr.DEFAULT_COLLECTION_PERCENTILE,wr.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),wr.DISABLED=new wr(-1,0,0);class vI{constructor(e,t,r,i){this.userId=e,this.serializer=t,this.indexManager=r,this.referenceDelegate=i,this.Bn={}}static It(e,t,r,i){se(""!==e.uid);const o=e.isAuthenticated()?e.uid:"";return new vI(o,t,r,i)}checkEmpty(e){let t=!0;const r=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return fl(e).Z({index:Wc,range:r},(i,o,s)=>{t=!1,s.done()}).next(()=>t)}addMutationBatch(e,t,r,i){const o=Qh(e),s=fl(e);return s.add({}).next(a=>{se("number"==typeof a);const l=new $1(a,t,r,i),c=function(p,m,_){const v=_.baseMutations.map(C=>i_(p.Tt,C)),E=_.mutations.map(C=>i_(p.Tt,C));return{userId:m,batchId:_.batchId,localWriteTimeMs:_.localWriteTime.toMillis(),baseMutations:v,mutations:E}}(this.serializer,this.userId,l),u=[];let d=new dt((f,p)=>Ee(f.canonicalString(),p.canonicalString()));for(const f of i){const p=k6(this.userId,f.key.path,a);d=d.add(f.key.path.popLast()),u.push(s.put(c)),u.push(o.put(p,WAe))}return d.forEach(f=>{u.push(this.indexManager.addToCollectionParentIndex(e,f))}),e.addOnCommittedListener(()=>{this.Bn[a]=l.keys()}),N.waitFor(u).next(()=>l)})}lookupMutationBatch(e,t){return fl(e).get(t).next(r=>r?(se(r.userId===this.userId),tu(this.serializer,r)):null)}Ln(e,t){return this.Bn[t]?N.resolve(this.Bn[t]):this.lookupMutationBatch(e,t).next(r=>{if(r){const i=r.keys();return this.Bn[t]=i,i}return null})}getNextMutationBatchAfterBatchId(e,t){const r=t+1,i=IDBKeyRange.lowerBound([this.userId,r]);let o=null;return fl(e).Z({index:Wc,range:i},(s,a,l)=>{a.userId===this.userId&&(se(a.batchId>=r),o=tu(this.serializer,a)),l.done()}).next(()=>o)}getHighestUnacknowledgedBatchId(e){const t=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]);let r=-1;return fl(e).Z({index:Wc,range:t,reverse:!0},(i,o,s)=>{r=o.batchId,s.done()}).next(()=>r)}getAllMutationBatches(e){const t=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return fl(e).G(Wc,t).next(r=>r.map(i=>tu(this.serializer,i)))}getAllMutationBatchesAffectingDocumentKey(e,t){const r=jE(this.userId,t.path),i=IDBKeyRange.lowerBound(r),o=[];return Qh(e).Z({range:i},(s,a,l)=>{const[c,u,d]=s,f=Xo(u);if(c===this.userId&&t.path.isEqual(f))return fl(e).get(d).next(p=>{if(!p)throw ne();se(p.userId===this.userId),o.push(tu(this.serializer,p))});l.done()}).next(()=>o)}getAllMutationBatchesAffectingDocumentKeys(e,t){let r=new dt(Ee);const i=[];return t.forEach(o=>{const s=jE(this.userId,o.path),a=IDBKeyRange.lowerBound(s),l=Qh(e).Z({range:a},(c,u,d)=>{const[f,p,m]=c,_=Xo(p);f===this.userId&&o.path.isEqual(_)?r=r.add(m):d.done()});i.push(l)}),N.waitFor(i).next(()=>this.kn(e,r))}getAllMutationBatchesAffectingQuery(e,t){const r=t.path,i=r.length+1,o=jE(this.userId,r),s=IDBKeyRange.lowerBound(o);let a=new dt(Ee);return Qh(e).Z({range:s},(l,c,u)=>{const[d,f,p]=l,m=Xo(f);d===this.userId&&r.isPrefixOf(m)?m.length===i&&(a=a.add(p)):u.done()}).next(()=>this.kn(e,a))}kn(e,t){const r=[],i=[];return t.forEach(o=>{i.push(fl(e).get(o).next(s=>{if(null===s)throw ne();se(s.userId===this.userId),r.push(tu(this.serializer,s))}))}),N.waitFor(i).next(()=>r)}removeMutationBatch(e,t){return x7(e.ue,this.userId,t).next(r=>(e.addOnCommittedListener(()=>{this.qn(t.batchId)}),N.forEach(r,i=>this.referenceDelegate.markPotentiallyOrphaned(e,i))))}qn(e){delete this.Bn[e]}performConsistencyCheck(e){return this.checkEmpty(e).next(t=>{if(!t)return N.resolve();const r=IDBKeyRange.lowerBound(function(s){return[s]}(this.userId)),i=[];return Qh(e).Z({range:r},(o,s,a)=>{if(o[0]===this.userId){const l=Xo(o[1]);i.push(l)}else a.done()}).next(()=>{se(0===i.length)})})}containsKey(e,t){return S7(e,this.userId,t)}Qn(e){return D7(e).get(this.userId).next(t=>t||{userId:this.userId,lastAcknowledgedBatchId:-1,lastStreamToken:""})}}function S7(n,e,t){const r=jE(e,t.path),i=r[1],o=IDBKeyRange.lowerBound(r);let s=!1;return Qh(n).Z({range:o,Y:!0},(a,l,c)=>{const[u,d,f]=a;u===e&&d===i&&(s=!0),c.done()}).next(()=>s)}function fl(n){return Un(n,wo)}function Qh(n){return Un(n,Ah)}function D7(n){return Un(n,Vg)}class iu{constructor(e){this.$n=e}next(){return this.$n+=2,this.$n}static Kn(){return new iu(0)}static Un(){return new iu(-1)}}class dMe{constructor(e,t){this.referenceDelegate=e,this.serializer=t}allocateTargetId(e){return this.Wn(e).next(t=>{const r=new iu(t.highestTargetId);return t.highestTargetId=r.next(),this.Gn(e,t).next(()=>t.highestTargetId)})}getLastRemoteSnapshotVersion(e){return this.Wn(e).next(t=>le.fromTimestamp(new Yt(t.lastRemoteSnapshotVersion.seconds,t.lastRemoteSnapshotVersion.nanoseconds)))}getHighestSequenceNumber(e){return this.Wn(e).next(t=>t.highestListenSequenceNumber)}setTargetsMetadata(e,t,r){return this.Wn(e).next(i=>(i.highestListenSequenceNumber=t,r&&(i.lastRemoteSnapshotVersion=r.toTimestamp()),t>i.highestListenSequenceNumber&&(i.highestListenSequenceNumber=t),this.Gn(e,i)))}addTargetData(e,t){return this.zn(e,t).next(()=>this.Wn(e).next(r=>(r.targetCount+=1,this.jn(t,r),this.Gn(e,r))))}updateTargetData(e,t){return this.zn(e,t)}removeTargetData(e,t){return this.removeMatchingKeysForTargetId(e,t.targetId).next(()=>Yh(e).delete(t.targetId)).next(()=>this.Wn(e)).next(r=>(se(r.targetCount>0),r.targetCount-=1,this.Gn(e,r)))}removeTargets(e,t,r){let i=0;const o=[];return Yh(e).Z((s,a)=>{const l=o_(a);l.sequenceNumber<=t&&null===r.get(l.targetId)&&(i++,o.push(this.removeTargetData(e,l)))}).next(()=>N.waitFor(o)).next(()=>i)}forEachTarget(e,t){return Yh(e).Z((r,i)=>{const o=o_(i);t(o)})}Wn(e){return A7(e).get(qE).next(t=>(se(null!==t),t))}Gn(e,t){return A7(e).put(qE,t)}zn(e,t){return Yh(e).put(u7(this.serializer,t))}jn(e,t){let r=!1;return e.targetId>t.highestTargetId&&(t.highestTargetId=e.targetId,r=!0),e.sequenceNumber>t.highestListenSequenceNumber&&(t.highestListenSequenceNumber=e.sequenceNumber,r=!0),r}getTargetCount(e){return this.Wn(e).next(t=>t.targetCount)}getTargetData(e,t){const r=Yc(t),i=IDBKeyRange.bound([r,Number.NEGATIVE_INFINITY],[r,Number.POSITIVE_INFINITY]);let o=null;return Yh(e).Z({range:i,index:P6},(s,a,l)=>{const c=o_(a);Gg(t,c.target)&&(o=c,l.done())}).next(()=>o)}addMatchingKeys(e,t,r){const i=[],o=pl(e);return t.forEach(s=>{const a=vr(s.path);i.push(o.put({targetId:r,path:a})),i.push(this.referenceDelegate.addReference(e,r,s))}),N.waitFor(i)}removeMatchingKeys(e,t,r){const i=pl(e);return N.forEach(t,o=>{const s=vr(o.path);return N.waitFor([i.delete([r,s]),this.referenceDelegate.removeReference(e,r,o)])})}removeMatchingKeysForTargetId(e,t){const r=pl(e),i=IDBKeyRange.bound([t],[t+1],!1,!0);return r.delete(i)}getMatchingKeysForTargetId(e,t){const r=IDBKeyRange.bound([t],[t+1],!1,!0),i=pl(e);let o=Re();return i.Z({range:r,Y:!0},(s,a,l)=>{const c=Xo(s[1]),u=new te(c);o=o.add(u)}).next(()=>o)}containsKey(e,t){const r=vr(t.path),i=IDBKeyRange.bound([r],[v6(r)],!1,!0);let o=0;return pl(e).Z({index:T1,Y:!0,range:i},([s,a],l,c)=>{0!==s&&(o++,c.done())}).next(()=>o>0)}lt(e,t){return Yh(e).get(t).next(r=>r?o_(r):null)}}function Yh(n){return Un(n,Rh)}function A7(n){return Un(n,Gc)}function pl(n){return Un(n,Mh)}const R7="LruGarbageCollector";function k7([n,e],[t,r]){const i=Ee(n,t);return 0===i?Ee(e,r):i}class hMe{constructor(e){this.Hn=e,this.buffer=new dt(k7),this.Jn=0}Yn(){return++this.Jn}Zn(e){const t=[e,this.Yn()];if(this.buffer.sizeMath.floor(t/100*r))}nthSequenceNumber(e,t){if(0===t)return N.resolve(Ni.ae);const r=new hMe(t);return this.tr.forEachTarget(e,i=>r.Zn(i.sequenceNumber)).next(()=>this.tr.rr(e,i=>r.Zn(i))).next(()=>r.maxValue)}removeTargets(e,t,r){return this.tr.removeTargets(e,t,r)}removeOrphanedDocuments(e,t){return this.tr.removeOrphanedDocuments(e,t)}collect(e,t){return-1===this.params.cacheSizeCollectionThreshold?(z("LruGarbageCollector","Garbage collection skipped; disabled"),N.resolve(T7)):this.getCacheSize(e).next(r=>r(d>this.params.maximumSequenceNumbersToCollect?(z("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${d}`),i=this.params.maximumSequenceNumbersToCollect):i=d,s=Date.now(),this.nthSequenceNumber(e,i))).next(d=>(r=d,a=Date.now(),this.removeTargets(e,r,t))).next(d=>(o=d,l=Date.now(),this.removeOrphanedDocuments(e,r))).next(d=>(c=Date.now(),Ih()<=qe.DEBUG&&z("LruGarbageCollector",`LRU Garbage Collection\n\tCounted targets in ${s-u}ms\n\tDetermined least recently used ${i} in `+(a-s)+`ms\n\tRemoved ${o} targets in `+(l-a)+`ms\n\tRemoved ${d} documents in `+(c-l)+`ms\nTotal Duration: ${c-u}ms`),N.resolve({didRun:!0,sequenceNumbersCollected:i,targetsRemoved:o,documentsRemoved:d})))}}function P7(n,e){return new fMe(n,e)}class pMe{constructor(e,t){this.db=e,this.garbageCollector=P7(this,t)}nr(e){const t=this.sr(e);return this.db.getTargetCache().getTargetCount(e).next(r=>t.next(i=>r+i))}sr(e){let t=0;return this.rr(e,r=>{t++}).next(()=>t)}forEachTarget(e,t){return this.db.getTargetCache().forEachTarget(e,t)}rr(e,t){return this._r(e,(r,i)=>t(i))}addReference(e,t,r){return bI(e,r)}removeReference(e,t,r){return bI(e,r)}removeTargets(e,t,r){return this.db.getTargetCache().removeTargets(e,t,r)}markPotentiallyOrphaned(e,t){return bI(e,t)}ar(e,t){return function(i,o){let s=!1;return D7(i).X(a=>S7(i,a,o).next(l=>(l&&(s=!0),N.resolve(!l)))).next(()=>s)}(e,t)}removeOrphanedDocuments(e,t){const r=this.db.getRemoteDocumentCache().newChangeBuffer(),i=[];let o=0;return this._r(e,(s,a)=>{if(a<=t){const l=this.ar(e,s).next(c=>{if(!c)return o++,r.getEntry(e,s).next(()=>(r.removeEntry(s,le.min()),pl(e).delete([0,vr(s.path)])))});i.push(l)}}).next(()=>N.waitFor(i)).next(()=>r.apply(e)).next(()=>o)}removeTarget(e,t){const r=t.withSequenceNumber(e.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(e,r)}updateLimboDocument(e,t){return bI(e,t)}_r(e,t){const r=pl(e);let i,o=Ni.ae;return r.Z({index:T1},([s,a],{path:l,sequenceNumber:c})=>{0===s?(o!==Ni.ae&&t(new te(Xo(i)),o),o=c,i=l):o=Ni.ae}).next(()=>{o!==Ni.ae&&t(new te(Xo(i)),o)})}getCacheSize(e){return this.db.getRemoteDocumentCache().getSize(e)}}function bI(n,e){return pl(n).put((i=n.currentSequenceNumber,{targetId:0,path:vr(e.path),sequenceNumber:i}));var i}class O7{constructor(){this.changes=new Ks(e=>e.toString(),(e,t)=>e.isEqual(t)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,Lt.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();const r=this.changes.get(t);return void 0!==r?N.resolve(r):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}class mMe{constructor(e){this.serializer=e}setIndexManager(e){this.indexManager=e}addEntry(e,t,r){return ou(e).put(r)}removeEntry(e,t,r){return ou(e).delete(function(o,s){const a=o.path.toArray();return[a.slice(0,a.length-2),a[a.length-2],pI(s),a[a.length-1]]}(t,r))}updateMetadata(e,t){return this.getMetadata(e).next(r=>(r.byteSize+=t,this.ur(e,r)))}getEntry(e,t){let r=Lt.newInvalidDocument(t);return ou(e).Z({index:$E,range:IDBKeyRange.only(c_(t))},(i,o)=>{r=this.cr(t,o)}).next(()=>r)}lr(e,t){let r={size:0,document:Lt.newInvalidDocument(t)};return ou(e).Z({index:$E,range:IDBKeyRange.only(c_(t))},(i,o)=>{r={document:this.cr(t,o),size:yI(o)}}).next(()=>r)}getEntries(e,t){let r=ui();return this.hr(e,t,(i,o)=>{const s=this.cr(i,o);r=r.insert(i,s)}).next(()=>r)}Pr(e,t){let r=ui(),i=new Rt(te.comparator);return this.hr(e,t,(o,s)=>{const a=this.cr(o,s);r=r.insert(o,a),i=i.insert(o,yI(s))}).next(()=>({documents:r,Tr:i}))}hr(e,t,r){if(t.isEmpty())return N.resolve();let i=new dt(B7);t.forEach(l=>i=i.add(l));const o=IDBKeyRange.bound(c_(i.first()),c_(i.last())),s=i.getIterator();let a=s.getNext();return ou(e).Z({index:$E,range:o},(l,c,u)=>{const d=te.fromSegments([...c.prefixPath,c.collectionGroup,c.documentId]);for(;a&&B7(a,d)<0;)r(a,null),a=s.getNext();a&&a.isEqual(d)&&(r(a,c),a=s.hasNext()?s.getNext():null),a?u.W(c_(a)):u.done()}).next(()=>{for(;a;)r(a,null),a=s.hasNext()?s.getNext():null})}getDocumentsMatchingQuery(e,t,r,i,o){const s=t.path,a=[s.popLast().toArray(),s.lastSegment(),pI(r.readTime),r.documentKey.path.isEmpty()?"":r.documentKey.path.lastSegment()],l=[s.popLast().toArray(),s.lastSegment(),[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],""];return ou(e).G(IDBKeyRange.bound(a,l,!0)).next(c=>{o?.incrementDocumentReadCount(c.length);let u=ui();for(const d of c){const f=this.cr(te.fromSegments(d.prefixPath.concat(d.collectionGroup,d.documentId)),d);f.isFoundDocument()&&(Qg(t,f)||i.has(f.key))&&(u=u.insert(f.key,f))}return u})}getAllFromCollectionGroup(e,t,r,i){let o=ui();const s=V7(t,r),a=V7(t,Mi.max());return ou(e).Z({index:N6,range:IDBKeyRange.bound(s,a,!0)},(l,c,u)=>{const d=this.cr(te.fromSegments(c.prefixPath.concat(c.collectionGroup,c.documentId)),c);o=o.insert(d.key,d),o.size===i&&u.done()}).next(()=>o)}newChangeBuffer(e){return new gMe(this,!!e&&e.trackRemovals)}getSize(e){return this.getMetadata(e).next(t=>t.byteSize)}getMetadata(e){return L7(e).get(I1).next(t=>(se(!!t),t))}ur(e,t){return L7(e).put(I1,t)}cr(e,t){if(t){const r=function tMe(n,e){let t;if(e.document)t=function t7(n,e,t){const r=es(n,e.name),i=bn(e.updateTime),o=e.createTime?bn(e.createTime):le.min(),s=new ar({mapValue:{fields:e.fields}}),a=Lt.newFoundDocument(r,i,o,s);return t&&a.setHasCommittedMutations(),t?a.setHasCommittedMutations():a}(n.Tt,e.document,!!e.hasCommittedMutations);else if(e.noDocument){const r=te.fromSegments(e.noDocument.path),i=eu(e.noDocument.readTime);t=Lt.newNoDocument(r,i),e.hasCommittedMutations&&t.setHasCommittedMutations()}else{if(!e.unknownDocument)return ne();{const r=te.fromSegments(e.unknownDocument.path),i=eu(e.unknownDocument.version);t=Lt.newUnknownDocument(r,i)}}return e.readTime&&t.setReadTime(function(i){const o=new Yt(i[0],i[1]);return le.fromTimestamp(o)}(e.readTime)),t}(this.serializer,t);if(!r.isNoDocument()||!r.version.isEqual(le.min()))return r}return Lt.newInvalidDocument(e)}}function F7(n){return new mMe(n)}class gMe extends O7{constructor(e,t){super(),this.Ir=e,this.trackRemovals=t,this.Er=new Ks(r=>r.toString(),(r,i)=>r.isEqual(i))}applyChanges(e){const t=[];let r=0,i=new dt((o,s)=>Ee(o.canonicalString(),s.canonicalString()));return this.changes.forEach((o,s)=>{const a=this.Er.get(o);if(t.push(this.Ir.removeEntry(e,o,a.readTime)),s.isValidDocument()){const l=c7(this.Ir.serializer,s);i=i.add(o.path.popLast());const c=yI(l);r+=c-a.size,t.push(this.Ir.addEntry(e,o,l))}else if(r-=a.size,this.trackRemovals){const l=c7(this.Ir.serializer,s.convertToNoDocument(le.min()));t.push(this.Ir.addEntry(e,o,l))}}),i.forEach(o=>{t.push(this.Ir.indexManager.addToCollectionParentIndex(e,o))}),t.push(this.Ir.updateMetadata(e,r)),N.waitFor(t)}getFromCache(e,t){return this.Ir.lr(e,t).next(r=>(this.Er.set(t,{size:r.size,readTime:r.document.readTime}),r.document))}getAllFromCache(e,t){return this.Ir.Pr(e,t).next(({documents:r,Tr:i})=>(i.forEach((o,s)=>{this.Er.set(o,{size:s,readTime:r.get(o).readTime})}),r))}}function L7(n){return Un(n,Bg)}function ou(n){return Un(n,HE)}function c_(n){const e=n.path.toArray();return[e.slice(0,e.length-2),e[e.length-2],e[e.length-1]]}function V7(n,e){const t=e.documentKey.path.toArray();return[n,pI(e.readTime),t.slice(0,t.length-2),t.length>0?t[t.length-1]:""]}function B7(n,e){const t=n.path.toArray(),r=e.path.toArray();let i=0;for(let o=0;o(r=i,this.remoteDocumentCache.getEntry(e,t))).next(i=>(null!==r&&Jg(r.mutation,i,ci.empty(),Yt.now()),i))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(r=>this.getLocalViewOfDocuments(e,r,Re()).next(()=>r))}getLocalViewOfDocuments(e,t,r=Re()){const i=Jo();return this.populateOverlays(e,i,t).next(()=>this.computeViews(e,t,i,r).next(o=>{let s=Yg();return o.forEach((a,l)=>{s=s.insert(a,l.overlayedDocument)}),s}))}getOverlayedDocuments(e,t){const r=Jo();return this.populateOverlays(e,r,t).next(()=>this.computeViews(e,t,r,Re()))}populateOverlays(e,t,r){const i=[];return r.forEach(o=>{t.has(o)||i.push(o)}),this.documentOverlayCache.getOverlays(e,i).next(o=>{o.forEach((s,a)=>{t.set(s,a)})})}computeViews(e,t,r,i){let o=ui();const s=Xg(),a=Xg();return t.forEach((l,c)=>{const u=r.get(c.key);i.has(c.key)&&(void 0===u||u.mutation instanceof Qs)?o=o.insert(c.key,c):void 0!==u?(s.set(c.key,u.mutation.getFieldMask()),Jg(u.mutation,c,u.mutation.getFieldMask(),Yt.now())):s.set(c.key,ci.empty())}),this.recalculateAndSaveOverlays(e,o).next(l=>(l.forEach((c,u)=>s.set(c,u)),t.forEach((c,u)=>{var d;return a.set(c,new _Me(u,null!==(d=s.get(c))&&void 0!==d?d:null))}),a))}recalculateAndSaveOverlays(e,t){const r=Xg();let i=new Rt((s,a)=>s-a),o=Re();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(s=>{for(const a of s)a.keys().forEach(l=>{const c=t.get(l);if(null===c)return;let u=r.get(l)||ci.empty();u=a.applyToLocalView(c,u),r.set(l,u);const d=(i.get(a.batchId)||Re()).add(l);i=i.insert(a.batchId,d)})}).next(()=>{const s=[],a=i.getReverseIterator();for(;a.hasNext();){const l=a.getNext(),c=l.key,u=l.value,d=x9();u.forEach(f=>{if(!o.has(f)){const p=P9(t.get(f),r.get(f));null!==p&&d.set(f,p),o=o.add(f)}}),s.push(this.documentOverlayCache.saveOverlays(e,c,d))}return N.waitFor(s)}).next(()=>r)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(r=>this.recalculateAndSaveOverlays(e,r))}getDocumentsMatchingQuery(e,t,r,i){return te.isDocumentKey((s=t).path)&&null===s.collectionGroup&&0===s.filters.length?this.getDocumentsMatchingDocumentQuery(e,t.path):function B1(n){return null!==n.collectionGroup}(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,r,i):this.getDocumentsMatchingCollectionQuery(e,t,r,i);var s}getNextDocuments(e,t,r,i){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,r,i).next(o=>{const s=i-o.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,r.largestBatchId,i-o.size):N.resolve(Jo());let a=-1,l=o;return s.next(c=>N.forEach(c,(u,d)=>(a{l=l.insert(u,f)}))).next(()=>this.populateOverlays(e,c,o)).next(()=>this.computeViews(e,l,c,Re())).next(u=>({batchId:a,changes:C9(u)})))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new te(t)).next(r=>{let i=Yg();return r.isFoundDocument()&&(i=i.insert(r.key,r)),i})}getDocumentsMatchingCollectionGroupQuery(e,t,r,i){const o=t.collectionGroup;let s=Yg();return this.indexManager.getCollectionParents(e,o).next(a=>N.forEach(a,l=>{const c=(d=t,f=l.child(o),new Gs(f,null,d.explicitOrderBy.slice(),d.filters.slice(),d.limit,d.limitType,d.startAt,d.endAt));var d,f;return this.getDocumentsMatchingCollectionQuery(e,c,r,i).next(u=>{u.forEach((d,f)=>{s=s.insert(d,f)})})}).next(()=>s))}getDocumentsMatchingCollectionQuery(e,t,r,i){let o;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,r.largestBatchId).next(s=>(o=s,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,r,o,i))).next(s=>{o.forEach((l,c)=>{const u=c.getKey();null===s.get(u)&&(s=s.insert(u,Lt.newInvalidDocument(u)))});let a=Yg();return s.forEach((l,c)=>{const u=o.get(l);void 0!==u&&Jg(u.mutation,c,ci.empty(),Yt.now()),Qg(t,c)&&(a=a.insert(l,c))}),a})}}class yMe{constructor(e){this.serializer=e,this.dr=new Map,this.Ar=new Map}getBundleMetadata(e,t){return N.resolve(this.dr.get(t))}saveBundleMetadata(e,t){return this.dr.set(t.id,{id:(i=t).id,version:i.version,createTime:bn(i.createTime)}),N.resolve();var i}getNamedQuery(e,t){return N.resolve(this.Ar.get(t))}saveNamedQuery(e,t){return this.Ar.set(t.name,{name:(i=t).name,query:J1(i.bundledQuery),readTime:bn(i.readTime)}),N.resolve();var i}}class vMe{constructor(){this.overlays=new Rt(te.comparator),this.Rr=new Map}getOverlay(e,t){return N.resolve(this.overlays.get(t))}getOverlays(e,t){const r=Jo();return N.forEach(t,i=>this.getOverlay(e,i).next(o=>{null!==o&&r.set(i,o)})).next(()=>r)}saveOverlays(e,t,r){return r.forEach((i,o)=>{this.Et(e,t,o)}),N.resolve()}removeOverlaysForBatchId(e,t,r){const i=this.Rr.get(r);return void 0!==i&&(i.forEach(o=>this.overlays=this.overlays.remove(o)),this.Rr.delete(r)),N.resolve()}getOverlaysForCollection(e,t,r){const i=Jo(),o=t.length+1,s=new te(t.child("")),a=this.overlays.getIteratorFrom(s);for(;a.hasNext();){const l=a.getNext().value,c=l.getKey();if(!t.isPrefixOf(c.path))break;c.path.length===o&&l.largestBatchId>r&&i.set(l.getKey(),l)}return N.resolve(i)}getOverlaysForCollectionGroup(e,t,r,i){let o=new Rt((c,u)=>c-u);const s=this.overlays.getIterator();for(;s.hasNext();){const c=s.getNext().value;if(c.getKey().getCollectionGroup()===t&&c.largestBatchId>r){let u=o.get(c.largestBatchId);null===u&&(u=Jo(),o=o.insert(c.largestBatchId,u)),u.set(c.getKey(),c)}}const a=Jo(),l=o.getIterator();for(;l.hasNext()&&(l.getNext().value.forEach((c,u)=>a.set(c,u)),!(a.size()>=i)););return N.resolve(a)}Et(e,t,r){const i=this.overlays.get(r.key);if(null!==i){const s=this.Rr.get(i.largestBatchId).delete(r.key);this.Rr.set(i.largestBatchId,s)}this.overlays=this.overlays.insert(r.key,new W1(t,r));let o=this.Rr.get(t);void 0===o&&(o=Re(),this.Rr.set(t,o)),this.Rr.set(t,o.add(r.key))}}class bMe{constructor(){this.sessionToken=ln.EMPTY_BYTE_STRING}getSessionToken(e){return N.resolve(this.sessionToken)}setSessionToken(e,t){return this.sessionToken=t,N.resolve()}}class sN{constructor(){this.Vr=new dt(Xn.mr),this.gr=new dt(Xn.pr)}isEmpty(){return this.Vr.isEmpty()}addReference(e,t){const r=new Xn(e,t);this.Vr=this.Vr.add(r),this.gr=this.gr.add(r)}yr(e,t){e.forEach(r=>this.addReference(r,t))}removeReference(e,t){this.wr(new Xn(e,t))}Sr(e,t){e.forEach(r=>this.removeReference(r,t))}br(e){const t=new te(new We([])),r=new Xn(t,e),i=new Xn(t,e+1),o=[];return this.gr.forEachInRange([r,i],s=>{this.wr(s),o.push(s.key)}),o}Dr(){this.Vr.forEach(e=>this.wr(e))}wr(e){this.Vr=this.Vr.delete(e),this.gr=this.gr.delete(e)}vr(e){const t=new te(new We([])),r=new Xn(t,e),i=new Xn(t,e+1);let o=Re();return this.gr.forEachInRange([r,i],s=>{o=o.add(s.key)}),o}containsKey(e){const t=new Xn(e,0),r=this.Vr.firstAfterOrEqual(t);return null!==r&&e.isEqual(r.key)}}class Xn{constructor(e,t){this.key=e,this.Cr=t}static mr(e,t){return te.comparator(e.key,t.key)||Ee(e.Cr,t.Cr)}static pr(e,t){return Ee(e.Cr,t.Cr)||te.comparator(e.key,t.key)}}class wMe{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.Fr=1,this.Mr=new dt(Xn.mr)}checkEmpty(e){return N.resolve(0===this.mutationQueue.length)}addMutationBatch(e,t,r,i){const o=this.Fr;this.Fr++;const s=new $1(o,t,r,i);this.mutationQueue.push(s);for(const a of i)this.Mr=this.Mr.add(new Xn(a.key,o)),this.indexManager.addToCollectionParentIndex(e,a.key.path.popLast());return N.resolve(s)}lookupMutationBatch(e,t){return N.resolve(this.Or(t))}getNextMutationBatchAfterBatchId(e,t){const i=this.Nr(t+1),o=i<0?0:i;return N.resolve(this.mutationQueue.length>o?this.mutationQueue[o]:null)}getHighestUnacknowledgedBatchId(){return N.resolve(0===this.mutationQueue.length?-1:this.Fr-1)}getAllMutationBatches(e){return N.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){const r=new Xn(t,0),i=new Xn(t,Number.POSITIVE_INFINITY),o=[];return this.Mr.forEachInRange([r,i],s=>{const a=this.Or(s.Cr);o.push(a)}),N.resolve(o)}getAllMutationBatchesAffectingDocumentKeys(e,t){let r=new dt(Ee);return t.forEach(i=>{const o=new Xn(i,0),s=new Xn(i,Number.POSITIVE_INFINITY);this.Mr.forEachInRange([o,s],a=>{r=r.add(a.Cr)})}),N.resolve(this.Br(r))}getAllMutationBatchesAffectingQuery(e,t){const r=t.path,i=r.length+1;let o=r;te.isDocumentKey(o)||(o=o.child(""));const s=new Xn(new te(o),0);let a=new dt(Ee);return this.Mr.forEachWhile(l=>{const c=l.key.path;return!!r.isPrefixOf(c)&&(c.length===i&&(a=a.add(l.Cr)),!0)},s),N.resolve(this.Br(a))}Br(e){const t=[];return e.forEach(r=>{const i=this.Or(r);null!==i&&t.push(i)}),t}removeMutationBatch(e,t){se(0===this.Lr(t.batchId,"removed")),this.mutationQueue.shift();let r=this.Mr;return N.forEach(t.mutations,i=>{const o=new Xn(i.key,t.batchId);return r=r.delete(o),this.referenceDelegate.markPotentiallyOrphaned(e,i.key)}).next(()=>{this.Mr=r})}qn(e){}containsKey(e,t){const r=new Xn(t,0),i=this.Mr.firstAfterOrEqual(r);return N.resolve(t.isEqual(i&&i.key))}performConsistencyCheck(e){return N.resolve()}Lr(e,t){return this.Nr(e)}Nr(e){return 0===this.mutationQueue.length?0:e-this.mutationQueue[0].batchId}Or(e){const t=this.Nr(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}}class EMe{constructor(e){this.kr=e,this.docs=new Rt(te.comparator),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){const r=t.key,i=this.docs.get(r),o=i?i.size:0,s=this.kr(t);return this.docs=this.docs.insert(r,{document:t.mutableCopy(),size:s}),this.size+=s-o,this.indexManager.addToCollectionParentIndex(e,r.path.popLast())}removeEntry(e){const t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){const r=this.docs.get(t);return N.resolve(r?r.document.mutableCopy():Lt.newInvalidDocument(t))}getEntries(e,t){let r=ui();return t.forEach(i=>{const o=this.docs.get(i);r=r.insert(i,o?o.document.mutableCopy():Lt.newInvalidDocument(i))}),N.resolve(r)}getDocumentsMatchingQuery(e,t,r,i){let o=ui();const s=t.path,a=new te(s.child("__id-9223372036854775808__")),l=this.docs.getIteratorFrom(a);for(;l.hasNext();){const{key:c,value:{document:u}}=l.getNext();if(!s.isPrefixOf(c.path))break;c.path.length>s.length+1||b1(I6(u),r)<=0||(i.has(u.key)||Qg(t,u))&&(o=o.insert(u.key,u.mutableCopy()))}return N.resolve(o)}getAllFromCollectionGroup(e,t,r,i){ne()}qr(e,t){return N.forEach(this.docs,r=>t(r))}newChangeBuffer(e){return new IMe(this)}getSize(e){return N.resolve(this.size)}}class IMe extends O7{constructor(e){super(),this.Ir=e}applyChanges(e){const t=[];return this.changes.forEach((r,i)=>{i.isValidDocument()?t.push(this.Ir.addEntry(e,i)):this.Ir.removeEntry(r)}),N.waitFor(t)}getFromCache(e,t){return this.Ir.getEntry(e,t)}getAllFromCache(e,t){return this.Ir.getEntries(e,t)}}class TMe{constructor(e){this.persistence=e,this.Qr=new Ks(t=>Yc(t),Gg),this.lastRemoteSnapshotVersion=le.min(),this.highestTargetId=0,this.$r=0,this.Kr=new sN,this.targetCount=0,this.Ur=iu.Kn()}forEachTarget(e,t){return this.Qr.forEach((r,i)=>t(i)),N.resolve()}getLastRemoteSnapshotVersion(e){return N.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return N.resolve(this.$r)}allocateTargetId(e){return this.highestTargetId=this.Ur.next(),N.resolve(this.highestTargetId)}setTargetsMetadata(e,t,r){return r&&(this.lastRemoteSnapshotVersion=r),t>this.$r&&(this.$r=t),N.resolve()}zn(e){this.Qr.set(e.target,e);const t=e.targetId;t>this.highestTargetId&&(this.Ur=new iu(t),this.highestTargetId=t),e.sequenceNumber>this.$r&&(this.$r=e.sequenceNumber)}addTargetData(e,t){return this.zn(t),this.targetCount+=1,N.resolve()}updateTargetData(e,t){return this.zn(t),N.resolve()}removeTargetData(e,t){return this.Qr.delete(t.target),this.Kr.br(t.targetId),this.targetCount-=1,N.resolve()}removeTargets(e,t,r){let i=0;const o=[];return this.Qr.forEach((s,a)=>{a.sequenceNumber<=t&&null===r.get(a.targetId)&&(this.Qr.delete(s),o.push(this.removeMatchingKeysForTargetId(e,a.targetId)),i++)}),N.waitFor(o).next(()=>i)}getTargetCount(e){return N.resolve(this.targetCount)}getTargetData(e,t){const r=this.Qr.get(t)||null;return N.resolve(r)}addMatchingKeys(e,t,r){return this.Kr.yr(t,r),N.resolve()}removeMatchingKeys(e,t,r){this.Kr.Sr(t,r);const i=this.persistence.referenceDelegate,o=[];return i&&t.forEach(s=>{o.push(i.markPotentiallyOrphaned(e,s))}),N.waitFor(o)}removeMatchingKeysForTargetId(e,t){return this.Kr.br(t),N.resolve()}getMatchingKeysForTargetId(e,t){const r=this.Kr.vr(t);return N.resolve(r)}containsKey(e,t){return N.resolve(this.Kr.containsKey(t))}}class aN{constructor(e,t){this.Wr={},this.overlays={},this.Gr=new Ni(0),this.zr=!1,this.zr=!0,this.jr=new bMe,this.referenceDelegate=e(this),this.Hr=new TMe(this),this.indexManager=new cMe,this.remoteDocumentCache=new EMe(r=>this.referenceDelegate.Jr(r)),this.serializer=new l7(t),this.Yr=new yMe(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.zr=!1,Promise.resolve()}get started(){return this.zr}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new vMe,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let r=this.Wr[e.toKey()];return r||(r=new wMe(t,this.referenceDelegate),this.Wr[e.toKey()]=r),r}getGlobalsCache(){return this.jr}getTargetCache(){return this.Hr}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Yr}runTransaction(e,t,r){z("MemoryPersistence","Starting transaction:",e);const i=new CMe(this.Gr.next());return this.referenceDelegate.Zr(),r(i).next(o=>this.referenceDelegate.Xr(i).next(()=>o)).toPromise().then(o=>(i.raiseOnCommittedEvent(),o))}ei(e,t){return N.or(Object.values(this.Wr).map(r=>()=>r.containsKey(e,t)))}}class CMe extends C6{constructor(e){super(),this.currentSequenceNumber=e}}class wI{constructor(e){this.persistence=e,this.ti=new sN,this.ni=null}static ri(e){return new wI(e)}get ii(){if(this.ni)return this.ni;throw ne()}addReference(e,t,r){return this.ti.addReference(r,t),this.ii.delete(r.toString()),N.resolve()}removeReference(e,t,r){return this.ti.removeReference(r,t),this.ii.add(r.toString()),N.resolve()}markPotentiallyOrphaned(e,t){return this.ii.add(t.toString()),N.resolve()}removeTarget(e,t){this.ti.br(t.targetId).forEach(i=>this.ii.add(i.toString()));const r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,t.targetId).next(i=>{i.forEach(o=>this.ii.add(o.toString()))}).next(()=>r.removeTargetData(e,t))}Zr(){this.ni=new Set}Xr(e){const t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return N.forEach(this.ii,r=>{const i=te.fromPath(r);return this.si(e,i).next(o=>{o||t.removeEntry(i,le.min())})}).next(()=>(this.ni=null,t.apply(e)))}updateLimboDocument(e,t){return this.si(e,t).next(r=>{r?this.ii.delete(t.toString()):this.ii.add(t.toString())})}Jr(e){return 0}si(e,t){return N.or([()=>N.resolve(this.ti.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.ei(e,t)])}}class EI{constructor(e,t){this.persistence=e,this.oi=new Ks(r=>vr(r.path),(r,i)=>r.isEqual(i)),this.garbageCollector=P7(this,t)}static ri(e,t){return new EI(e,t)}Zr(){}Xr(e){return N.resolve()}forEachTarget(e,t){return this.persistence.getTargetCache().forEachTarget(e,t)}nr(e){const t=this.sr(e);return this.persistence.getTargetCache().getTargetCount(e).next(r=>t.next(i=>r+i))}sr(e){let t=0;return this.rr(e,r=>{t++}).next(()=>t)}rr(e,t){return N.forEach(this.oi,(r,i)=>this.ar(e,r,i).next(o=>o?N.resolve():t(i)))}removeTargets(e,t,r){return this.persistence.getTargetCache().removeTargets(e,t,r)}removeOrphanedDocuments(e,t){let r=0;const i=this.persistence.getRemoteDocumentCache(),o=i.newChangeBuffer();return i.qr(e,s=>this.ar(e,s,t).next(a=>{a||(r++,o.removeEntry(s,le.min()))})).next(()=>o.apply(e)).next(()=>r)}markPotentiallyOrphaned(e,t){return this.oi.set(t,e.currentSequenceNumber),N.resolve()}removeTarget(e,t){const r=t.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,r)}addReference(e,t,r){return this.oi.set(r,e.currentSequenceNumber),N.resolve()}removeReference(e,t,r){return this.oi.set(r,e.currentSequenceNumber),N.resolve()}updateLimboDocument(e,t){return this.oi.set(t,e.currentSequenceNumber),N.resolve()}Jr(e){let t=e.key.toString().length;return e.isFoundDocument()&&(t+=tI(e.data.value)),t}ar(e,t,r){return N.or([()=>this.persistence.ei(e,t),()=>this.persistence.getTargetCache().containsKey(e,t),()=>{const i=this.oi.get(t);return N.resolve(void 0!==i&&i>r)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}class xMe{constructor(e){this.serializer=e}B(e,t,r,i){const o=new UE("createOrUpgrade",t);var l;r<1&&i>=1&&(e.createObjectStore(Lg),(l=e).createObjectStore(Vg,{keyPath:"userId"}),l.createObjectStore(wo,{keyPath:R6,autoIncrement:!0}).createIndex(Wc,M6,{unique:!0}),l.createObjectStore(Ah),z7(e),function(l){l.createObjectStore(qc)}(e));let s=N.resolve();return r<3&&i>=3&&(0!==r&&(function(l){l.deleteObjectStore(Mh),l.deleteObjectStore(Rh),l.deleteObjectStore(Gc)}(e),z7(e)),s=s.next(()=>function(l){const c=l.store(Gc),u={highestTargetId:0,highestListenSequenceNumber:0,lastRemoteSnapshotVersion:le.min().toTimestamp(),targetCount:0};return c.put(qE,u)}(o))),r<4&&i>=4&&(0!==r&&(s=s.next(()=>function(l,c){return c.store(wo).G().next(d=>{l.deleteObjectStore(wo),l.createObjectStore(wo,{keyPath:R6,autoIncrement:!0}).createIndex(Wc,M6,{unique:!0});const f=c.store(wo),p=d.map(m=>f.put(m));return N.waitFor(p)})}(e,o))),s=s.next(()=>{!function(l){l.createObjectStore(kh,{keyPath:"clientId"})}(e)})),r<5&&i>=5&&(s=s.next(()=>this._i(o))),r<6&&i>=6&&(s=s.next(()=>(function(l){l.createObjectStore(Bg)}(e),this.ai(o)))),r<7&&i>=7&&(s=s.next(()=>this.ui(o))),r<8&&i>=8&&(s=s.next(()=>this.ci(e,o))),r<9&&i>=9&&(s=s.next(()=>{!function(l){l.objectStoreNames.contains("remoteDocumentChanges")&&l.deleteObjectStore("remoteDocumentChanges")}(e)})),r<10&&i>=10&&(s=s.next(()=>this.li(o))),r<11&&i>=11&&(s=s.next(()=>{(function(l){l.createObjectStore(WE,{keyPath:"bundleId"})})(e),function(l){l.createObjectStore(GE,{keyPath:"name"})}(e)})),r<12&&i>=12&&(s=s.next(()=>{!function(l){const c=l.createObjectStore(YE,{keyPath:cRe});c.createIndex(S1,uRe,{unique:!1}),c.createIndex(L6,dRe,{unique:!1})}(e)})),r<13&&i>=13&&(s=s.next(()=>function(l){const c=l.createObjectStore(HE,{keyPath:GAe});c.createIndex($E,KAe),c.createIndex(N6,QAe)}(e)).next(()=>this.hi(e,o)).next(()=>e.deleteObjectStore(qc))),r<14&&i>=14&&(s=s.next(()=>this.Pi(e,o))),r<15&&i>=15&&(s=s.next(()=>function(l){l.createObjectStore(C1,{keyPath:"indexId",autoIncrement:!0}).createIndex(x1,"collectionGroup",{unique:!1}),l.createObjectStore(KE,{keyPath:oRe}).createIndex(O6,sRe,{unique:!1}),l.createObjectStore(QE,{keyPath:aRe}).createIndex(F6,lRe,{unique:!1})}(e))),r<16&&i>=16&&(s=s.next(()=>{t.objectStore(KE).clear()}).next(()=>{t.objectStore(QE).clear()})),r<17&&i>=17&&(s=s.next(()=>{!function(l){l.createObjectStore(D1,{keyPath:"name"})}(e)})),s}ai(e){let t=0;return e.store(qc).Z((r,i)=>{t+=yI(i)}).next(()=>{const r={byteSize:t};return e.store(Bg).put(I1,r)})}_i(e){const t=e.store(Vg),r=e.store(wo);return t.G().next(i=>N.forEach(i,o=>{const s=IDBKeyRange.bound([o.userId,-1],[o.userId,o.lastAcknowledgedBatchId]);return r.G(Wc,s).next(a=>N.forEach(a,l=>{se(l.userId===o.userId);const c=tu(this.serializer,l);return x7(e,o.userId,c).next(()=>{})}))}))}ui(e){const t=e.store(Mh),r=e.store(qc);return e.store(Gc).get(qE).next(i=>{const o=[];return r.Z((s,a)=>{const l=new We(s),c=[0,vr(l)];o.push(t.get(c).next(u=>u?N.resolve():t.put({targetId:0,path:vr(l),sequenceNumber:i.highestListenSequenceNumber})))}).next(()=>N.waitFor(o))})}ci(e,t){e.createObjectStore(Ug,{keyPath:JAe});const r=t.store(Ug),i=new oN,o=s=>{if(i.add(s)){const a=s.lastSegment(),l=s.popLast();return r.put({collectionId:a,parent:vr(l)})}};return t.store(qc).Z({Y:!0},(s,a)=>{const l=new We(s);return o(l.popLast())}).next(()=>t.store(Ah).Z({Y:!0},([s,a,l],c)=>{const u=Xo(a);return o(u.popLast())}))}li(e){const t=e.store(Rh);return t.Z((r,i)=>{const o=o_(i),s=u7(this.serializer,o);return t.put(s)})}hi(e,t){const r=t.store(qc),i=[];return r.Z((o,s)=>{const a=t.store(HE),l=(d=s,d.document?new te(We.fromString(d.document.name).popFirst(5)):d.noDocument?te.fromSegments(d.noDocument.path):d.unknownDocument?te.fromSegments(d.unknownDocument.path):ne()).path.toArray(),c={prefixPath:l.slice(0,l.length-2),collectionGroup:l[l.length-2],documentId:l[l.length-1],readTime:s.readTime||[0,0],unknownDocument:s.unknownDocument,noDocument:s.noDocument,document:s.document,hasCommittedMutations:!!s.hasCommittedMutations};var d;i.push(a.put(c))}).next(()=>N.waitFor(i))}Pi(e,t){const r=t.store(wo),i=F7(this.serializer),o=new aN(wI.ri,this.serializer.Tt);return r.G().next(s=>{const a=new Map;return s.forEach(l=>{var c;let u=null!==(c=a.get(l.userId))&&void 0!==c?c:Re();tu(this.serializer,l).keys().forEach(d=>u=u.add(d)),a.set(l.userId,u)}),N.forEach(a,(l,c)=>{const u=new Qn(c),d=mI.It(this.serializer,u),f=o.getIndexManager(u),p=vI.It(u,this.serializer,f,o.referenceDelegate);return new U7(i,p,d,f).recalculateAndSaveOverlaysForDocumentKeys(new R1(t,Ni.ae),l).next()})})}}function z7(n){n.createObjectStore(Mh,{keyPath:XAe}).createIndex(T1,ZAe,{unique:!0}),n.createObjectStore(Rh,{keyPath:"targetId"}).createIndex(P6,YAe,{unique:!0}),n.createObjectStore(Gc)}const ml="IndexedDbPersistence",lN=18e5,uN="Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.";class dN{constructor(e,t,r,i,o,s,a,l,c,u,d=17){if(this.allowTabSynchronization=e,this.persistenceKey=t,this.clientId=r,this.Ti=o,this.window=s,this.document=a,this.Ii=c,this.Ei=u,this.di=d,this.Gr=null,this.zr=!1,this.isPrimary=!1,this.networkEnabled=!0,this.Ai=null,this.inForeground=!1,this.Ri=null,this.Vi=null,this.mi=Number.NEGATIVE_INFINITY,this.fi=f=>Promise.resolve(),!dN.D())throw new j(F.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new pMe(this,i),this.gi=t+"main",this.serializer=new l7(l),this.pi=new Yo(this.gi,this.di,new xMe(this.serializer)),this.jr=new rMe,this.Hr=new dMe(this.referenceDelegate,this.serializer),this.remoteDocumentCache=F7(this.serializer),this.Yr=new nMe,this.window&&this.window.localStorage?this.yi=this.window.localStorage:(this.yi=null,!1===u&&vn(ml,"LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}start(){return this.wi().then(()=>{if(!this.isPrimary&&!this.allowTabSynchronization)throw new j(F.FAILED_PRECONDITION,uN);return this.Si(),this.bi(),this.Di(),this.runTransaction("getHighestListenSequenceNumber","readonly",e=>this.Hr.getHighestSequenceNumber(e))}).then(e=>{this.Gr=new Ni(e,this.Ii)}).then(()=>{this.zr=!0}).catch(e=>(this.pi&&this.pi.close(),Promise.reject(e)))}Ci(e){var t=this;return this.fi=function(){var r=T(function*(i){if(t.started)return e(i)});return function(i){return r.apply(this,arguments)}}(),e(this.isPrimary)}setDatabaseDeletedListener(e){this.pi.k(function(){var t=T(function*(r){null===r.newVersion&&(yield e())});return function(r){return t.apply(this,arguments)}}())}setNetworkEnabled(e){var t=this;this.networkEnabled!==e&&(this.networkEnabled=e,this.Ti.enqueueAndForget(T(function*(){t.started&&(yield t.wi())})))}wi(){return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",e=>II(e).put({clientId:this.clientId,updateTimeMs:Date.now(),networkEnabled:this.networkEnabled,inForeground:this.inForeground}).next(()=>{if(this.isPrimary)return this.Fi(e).next(t=>{t||(this.isPrimary=!1,this.Ti.enqueueRetryable(()=>this.fi(!1)))})}).next(()=>this.Mi(e)).next(t=>this.isPrimary&&!t?this.xi(e).next(()=>!1):!!t&&this.Oi(e).next(()=>!0))).catch(e=>{if(il(e))return z(ml,"Failed to extend owner lease: ",e),this.isPrimary;if(!this.allowTabSynchronization)throw e;return z(ml,"Releasing owner lease after error during lease refresh",e),!1}).then(e=>{this.isPrimary!==e&&this.Ti.enqueueRetryable(()=>this.fi(e)),this.isPrimary=e})}Fi(e){return u_(e).get(Dh).next(t=>N.resolve(this.Ni(t)))}Bi(e){return II(e).delete(this.clientId)}Li(){var e=this;return T(function*(){if(e.isPrimary&&!e.ki(e.mi,lN)){e.mi=Date.now();const t=yield e.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",r=>{const i=Un(r,kh);return i.G().next(o=>{const s=e.qi(o,lN),a=o.filter(l=>-1===s.indexOf(l));return N.forEach(a,l=>i.delete(l.clientId)).next(()=>a)})}).catch(()=>[]);if(e.yi)for(const r of t)e.yi.removeItem(e.Qi(r.clientId))}})()}Di(){this.Vi=this.Ti.enqueueAfterDelay("client_metadata_refresh",4e3,()=>this.wi().then(()=>this.Li()).then(()=>this.Di()))}Ni(e){return!!e&&e.ownerId===this.clientId}Mi(e){return this.Ei?N.resolve(!0):u_(e).get(Dh).next(t=>{if(null!==t&&this.ki(t.leaseTimestampMs,5e3)&&!this.$i(t.ownerId)){if(this.Ni(t)&&this.networkEnabled)return!0;if(!this.Ni(t)){if(!t.allowTabSynchronization)throw new j(F.FAILED_PRECONDITION,uN);return!1}}return!(!this.networkEnabled||!this.inForeground)||II(e).G().next(r=>void 0===this.qi(r,5e3).find(i=>!(this.clientId===i.clientId||!(!this.networkEnabled&&i.networkEnabled||!this.inForeground&&i.inForeground&&this.networkEnabled===i.networkEnabled))))}).next(t=>(this.isPrimary!==t&&z(ml,`Client ${t?"is":"is not"} eligible for a primary lease.`),t))}shutdown(){var e=this;return T(function*(){e.zr=!1,e.Ki(),e.Vi&&(e.Vi.cancel(),e.Vi=null),e.Ui(),e.Wi(),yield e.pi.runTransaction("shutdown","readwrite",[Lg,kh],t=>{const r=new R1(t,Ni.ae);return e.xi(r).next(()=>e.Bi(r))}),e.pi.close(),e.Gi()})()}qi(e,t){return e.filter(r=>this.ki(r.updateTimeMs,t)&&!this.$i(r.clientId))}zi(){return this.runTransaction("getActiveClients","readonly",e=>II(e).G().next(t=>this.qi(t,lN).map(r=>r.clientId)))}get started(){return this.zr}getGlobalsCache(){return this.jr}getMutationQueue(e,t){return vI.It(e,this.serializer,t,this.referenceDelegate)}getTargetCache(){return this.Hr}getRemoteDocumentCache(){return this.remoteDocumentCache}getIndexManager(e){return new uMe(e,this.serializer.Tt.databaseId)}getDocumentOverlayCache(e){return mI.It(this.serializer,e)}getBundleCache(){return this.Yr}runTransaction(e,t,r){z(ml,"Starting transaction:",e);const i="readonly"===t?"readonly":"readwrite",o=17===(l=this.di)?mRe:16===l?pRe:15===l?A1:14===l?U6:13===l?B6:12===l?fRe:11===l?V6:void ne();var l;let s;return this.pi.runTransaction(e,i,o,a=>(s=new R1(a,this.Gr?this.Gr.next():Ni.ae),"readwrite-primary"===t?this.Fi(s).next(l=>!!l||this.Mi(s)).next(l=>{if(!l)throw vn(`Failed to obtain primary lease for action '${e}'.`),this.isPrimary=!1,this.Ti.enqueueRetryable(()=>this.fi(!1)),new j(F.FAILED_PRECONDITION,T6);return r(s)}).next(l=>this.Oi(s).next(()=>l)):this.ji(s).next(()=>r(s)))).then(a=>(s.raiseOnCommittedEvent(),a))}ji(e){return u_(e).get(Dh).next(t=>{if(null!==t&&this.ki(t.leaseTimestampMs,5e3)&&!this.$i(t.ownerId)&&!this.Ni(t)&&!(this.Ei||this.allowTabSynchronization&&t.allowTabSynchronization))throw new j(F.FAILED_PRECONDITION,uN)})}Oi(e){const t={ownerId:this.clientId,allowTabSynchronization:this.allowTabSynchronization,leaseTimestampMs:Date.now()};return u_(e).put(Dh,t)}static D(){return Yo.D()}xi(e){const t=u_(e);return t.get(Dh).next(r=>this.Ni(r)?(z(ml,"Releasing primary lease."),t.delete(Dh)):N.resolve())}ki(e,t){const r=Date.now();return!(er&&(vn(`Detected an update time that is in the future: ${e} > ${r}`),1))}Si(){null!==this.document&&"function"==typeof this.document.addEventListener&&(this.Ri=()=>{this.Ti.enqueueAndForget(()=>(this.inForeground="visible"===this.document.visibilityState,this.wi()))},this.document.addEventListener("visibilitychange",this.Ri),this.inForeground="visible"===this.document.visibilityState)}Ui(){this.Ri&&(this.document.removeEventListener("visibilitychange",this.Ri),this.Ri=null)}bi(){var e;"function"==typeof(null===(e=this.window)||void 0===e?void 0:e.addEventListener)&&(this.Ai=()=>{this.Ki();const t=/(?:Version|Mobile)\/1[456]/;JW()&&(navigator.appVersion.match(t)||navigator.userAgent.match(t))&&this.Ti.enterRestrictedMode(!0),this.Ti.enqueueAndForget(()=>this.shutdown())},this.window.addEventListener("pagehide",this.Ai))}Wi(){this.Ai&&(this.window.removeEventListener("pagehide",this.Ai),this.Ai=null)}$i(e){var t;try{const r=null!==(null===(t=this.yi)||void 0===t?void 0:t.getItem(this.Qi(e)));return z(ml,`Client '${e}' ${r?"is":"is not"} zombied in LocalStorage`),r}catch(r){return vn(ml,"Failed to get zombied client id.",r),!1}}Ki(){if(this.yi)try{this.yi.setItem(this.Qi(this.clientId),String(Date.now()))}catch(e){vn("Failed to set zombie client id.",e)}}Gi(){if(this.yi)try{this.yi.removeItem(this.Qi(this.clientId))}catch{}}Qi(e){return`firestore_zombie_${this.persistenceKey}_${e}`}}function u_(n){return Un(n,Lg)}function II(n){return Un(n,kh)}class fN{constructor(e,t,r,i){this.targetId=e,this.fromCache=t,this.Hi=r,this.Ji=i}static Yi(e,t){let r=Re(),i=Re();for(const o of t.docChanges)switch(o.type){case 0:r=r.add(o.doc.key);break;case 1:i=i.add(o.doc.key)}return new fN(e,t.fromCache,r,i)}}class SMe{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}class H7{constructor(){this.Zi=!1,this.Xi=!1,this.es=100,this.ts=JW()?8:x6(_n())>0?6:4}initialize(e,t){this.ns=e,this.indexManager=t,this.Zi=!0}getDocumentsMatchingQuery(e,t,r,i){const o={result:null};return this.rs(e,t).next(s=>{o.result=s}).next(()=>{if(!o.result)return this.ss(e,t,i,r).next(s=>{o.result=s})}).next(()=>{if(o.result)return;const s=new SMe;return this._s(e,t,s).next(a=>{if(o.result=a,this.Xi)return this.us(e,t,s,a.size)})}).next(()=>o.result)}us(e,t,r,i){return r.documentReadCountthis.ts*i?(Ih()<=qe.DEBUG&&z("QueryEngine","The SDK decides to create cache indexes for query:",Bh(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,br(t))):N.resolve())}rs(e,t){if(y9(t))return N.resolve(null);let r=br(t);return this.indexManager.getIndexType(e,r).next(i=>0===i?null:(null!==t.limit&&1===i&&(t=sI(t,null,"F"),r=br(t)),this.indexManager.getDocumentsMatchingTarget(e,r).next(o=>{const s=Re(...o);return this.ns.getDocuments(e,s).next(a=>this.indexManager.getMinOffset(e,r).next(l=>{const c=this.cs(t,a);return this.ls(t,c,s,l.readTime)?this.rs(e,sI(t,null,"F")):this.hs(e,c,t,l)}))})))}ss(e,t,r,i){return y9(t)||i.isEqual(le.min())?N.resolve(null):this.ns.getDocuments(e,r).next(o=>{const s=this.cs(t,o);return this.ls(t,s,r,i)?N.resolve(null):(Ih()<=qe.DEBUG&&z("QueryEngine","Re-using previous result from %s to execute query: %s",i.toString(),Bh(t)),this.hs(e,s,t,function E6(n,e){const t=n.toTimestamp().seconds,r=n.toTimestamp().nanoseconds+1,i=le.fromTimestamp(1e9===r?new Yt(t+1,0):new Yt(t,r));return new Mi(i,te.empty(),e)}(i,-1)).next(a=>a))})}cs(e,t){let r=new dt(I9(e));return t.forEach((i,o)=>{Qg(e,o)&&(r=r.add(o))}),r}ls(e,t,r,i){if(null===e.limit)return!1;if(r.size!==t.size)return!0;const o="F"===e.limitType?t.last():t.first();return!!o&&(o.hasPendingWrites||o.version.compareTo(i)>0)}_s(e,t,r){return Ih()<=qe.DEBUG&&z("QueryEngine","Using full collection scan to execute query:",Bh(t)),this.ns.getDocumentsMatchingQuery(e,t,Mi.min(),r)}hs(e,t,r,i){return this.ns.getDocumentsMatchingQuery(e,r,i).next(o=>(t.forEach(s=>{o=o.insert(s.key,s)}),o))}}const pN="LocalStore";class AMe{constructor(e,t,r,i){this.persistence=e,this.Ps=t,this.serializer=i,this.Ts=new Rt(Ee),this.Is=new Ks(o=>Yc(o),Gg),this.Es=new Map,this.ds=e.getRemoteDocumentCache(),this.Hr=e.getTargetCache(),this.Yr=e.getBundleCache(),this.As(r)}As(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new U7(this.ds,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.ds.setIndexManager(this.indexManager),this.Ps.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.Ts))}}function $7(n,e,t,r){return new AMe(n,e,t,r)}function q7(n,e){return mN.apply(this,arguments)}function mN(){return(mN=T(function*(n,e){const t=Z(n);return yield t.persistence.runTransaction("Handle user change","readonly",r=>{let i;return t.mutationQueue.getAllMutationBatches(r).next(o=>(i=o,t.As(e),t.mutationQueue.getAllMutationBatches(r))).next(o=>{const s=[],a=[];let l=Re();for(const c of i){s.push(c.batchId);for(const u of c.mutations)l=l.add(u.key)}for(const c of o){a.push(c.batchId);for(const u of c.mutations)l=l.add(u.key)}return t.localDocuments.getDocuments(r,l).next(c=>({Rs:c,removedBatchIds:s,addedBatchIds:a}))})})})).apply(this,arguments)}function W7(n){const e=Z(n);return e.persistence.runTransaction("Get last remote snapshot version","readonly",t=>e.Hr.getLastRemoteSnapshotVersion(t))}function kMe(n,e){const t=Z(n);return t.persistence.runTransaction("Get next mutation batch","readonly",r=>(void 0===e&&(e=-1),t.mutationQueue.getNextMutationBatchAfterBatchId(r,e)))}function Zh(n,e,t){return gN.apply(this,arguments)}function gN(){return(gN=T(function*(n,e,t){const r=Z(n),i=r.Ts.get(e),o=t?"readwrite":"readwrite-primary";try{t||(yield r.persistence.runTransaction("Release target",o,s=>r.persistence.referenceDelegate.removeTarget(s,i)))}catch(s){if(!il(s))throw s;z(pN,`Failed to update sequence numbers for target ${e}: ${s}`)}r.Ts=r.Ts.remove(e),r.Is.delete(i.target)})).apply(this,arguments)}function TI(n,e,t){const r=Z(n);let i=le.min(),o=Re();return r.persistence.runTransaction("Execute query","readwrite",s=>function(l,c,u){const d=Z(l),f=d.Is.get(u);return void 0!==f?N.resolve(d.Ts.get(f)):d.Hr.getTargetData(c,u)}(r,s,br(e)).next(a=>{if(a)return i=a.lastLimboFreeSnapshotVersion,r.Hr.getMatchingKeysForTargetId(s,a.targetId).next(l=>{o=l})}).next(()=>r.Ps.getDocumentsMatchingQuery(s,e,t?i:le.min(),t?o:Re())).next(a=>(function Y7(n,e,t){let r=n.Es.get(e)||le.min();t.forEach((i,o)=>{o.readTime.compareTo(r)>0&&(r=o.readTime)}),n.Es.set(e,r)}(r,function E9(n){return n.collectionGroup||(n.path.length%2==1?n.path.lastSegment():n.path.get(n.path.length-2))}(e),a),{documents:a,gs:o})))}class wN{constructor(){this.activeTargetIds=function z1(){return kRe}()}Ds(e){this.activeTargetIds=this.activeTargetIds.add(e)}vs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}bs(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class nK{constructor(){this.ho=new wN,this.Po={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,r){}addLocalQueryTarget(e,t=!0){return t&&this.ho.Ds(e),this.Po[e]||"not-current"}updateQueryState(e,t,r){this.Po[e]=t}removeLocalQueryTarget(e){this.ho.vs(e)}isLocalQueryTarget(e){return this.ho.activeTargetIds.has(e)}clearQueryState(e){delete this.Po[e]}getAllActiveQueryTargets(){return this.ho.activeTargetIds}isActiveQueryTarget(e){return this.ho.activeTargetIds.has(e)}start(){return this.ho=new wN,Promise.resolve()}handleUserChange(e,t,r){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}class OMe{To(e){}shutdown(){}}const rK="ConnectivityMonitor";class iK{constructor(){this.Io=()=>this.Eo(),this.Ao=()=>this.Ro(),this.Vo=[],this.mo()}To(e){this.Vo.push(e)}shutdown(){window.removeEventListener("online",this.Io),window.removeEventListener("offline",this.Ao)}mo(){window.addEventListener("online",this.Io),window.addEventListener("offline",this.Ao)}Eo(){z(rK,"Network connectivity changed: AVAILABLE");for(const e of this.Vo)e(0)}Ro(){z(rK,"Network connectivity changed: UNAVAILABLE");for(const e of this.Vo)e(1)}static D(){return typeof window<"u"&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}}let SI=null;function IN(){return null===SI?SI=268435456+Math.round(2147483648*Math.random()):SI++,"0x"+SI.toString(16)}const TN="RestConnection",FMe={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};class LMe{get fo(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const t=e.ssl?"https":"http",r=encodeURIComponent(this.databaseId.projectId),i=encodeURIComponent(this.databaseId.database);this.po=t+"://"+e.host,this.yo=`projects/${r}/databases/${i}`,this.wo=this.databaseId.database===jg?`project_id=${r}`:`project_id=${r}&database_id=${i}`}So(e,t,r,i,o){const s=IN(),a=this.bo(e,t.toUriEncodedString());z(TN,`Sending RPC '${e}' ${s}:`,a,r);const l={"google-cloud-resource-prefix":this.yo,"x-goog-request-params":this.wo};return this.Do(l,i,o),this.vo(e,a,l,r).then(c=>(z(TN,`Received RPC '${e}' ${s}: `,c),c),c=>{throw eo(TN,`RPC '${e}' ${s} failed with error: `,c,"url: ",a,"request:",r),c})}Co(e,t,r,i,o,s){return this.So(e,t,r,i,o)}Do(e,t,r){e["X-Goog-Api-Client"]="gl-js/ fire/"+Eh,e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach((i,o)=>e[o]=i),r&&r.headers.forEach((i,o)=>e[o]=i)}bo(e,t){return`${this.po}/v1/${t}:${FMe[e]}`}terminate(){}}class VMe{constructor(e){this.Fo=e.Fo,this.Mo=e.Mo}xo(e){this.Oo=e}No(e){this.Bo=e}Lo(e){this.ko=e}onMessage(e){this.qo=e}close(){this.Mo()}send(e){this.Fo(e)}Qo(){this.Oo()}$o(){this.Bo()}Ko(e){this.ko(e)}Uo(e){this.qo(e)}}const Er="WebChannelConnection";class BMe extends LMe{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}vo(e,t,r,i){const o=IN();return new Promise((s,a)=>{const l=new u6;l.setWithCredentials(!0),l.listenOnce(d6.COMPLETE,()=>{try{switch(l.getLastErrorCode()){case BE.NO_ERROR:const u=l.getResponseJson();z(Er,`XHR for RPC '${e}' ${o} received:`,JSON.stringify(u)),s(u);break;case BE.TIMEOUT:z(Er,`RPC '${e}' ${o} timed out`),a(new j(F.DEADLINE_EXCEEDED,"Request time out"));break;case BE.HTTP_ERROR:const d=l.getStatus();if(z(Er,`RPC '${e}' ${o} failed with status:`,d,"response text:",l.getResponseText()),d>0){let f=l.getResponseJson();Array.isArray(f)&&(f=f[0]);const p=f?.error;if(p&&p.status&&p.message){const m=function(v){const E=v.toLowerCase().replace(/_/g,"-");return Object.values(F).indexOf(E)>=0?E:F.UNKNOWN}(p.status);a(new j(m,p.message))}else a(new j(F.UNKNOWN,"Server responded with status "+l.getStatus()))}else a(new j(F.UNAVAILABLE,"Connection failed."));break;default:ne()}}finally{z(Er,`RPC '${e}' ${o} completed.`)}});const c=JSON.stringify(i);z(Er,`RPC '${e}' ${o} sending request:`,i),l.send(t,"POST",c,r,15)})}Wo(e,t,r){const i=IN(),o=[this.po,"/","google.firestore.v1.Firestore","/",e,"/channel"],s=p6(),a=f6(),l={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},c=this.longPollingOptions.timeoutSeconds;void 0!==c&&(l.longPollingTimeout=Math.round(1e3*c)),this.useFetchStreams&&(l.useFetchStreams=!0),this.Do(l.initMessageHeaders,t,r),l.encodeInitMessageHeaders=!0;const u=o.join("");z(Er,`Creating RPC '${e}' stream ${i}: ${u}`,l);const d=s.createWebChannel(u,l);let f=!1,p=!1;const m=new VMe({Fo:v=>{p?z(Er,`Not sending because RPC '${e}' stream ${i} is closed:`,v):(f||(z(Er,`Opening RPC '${e}' stream ${i} transport.`),d.open(),f=!0),z(Er,`RPC '${e}' stream ${i} sending:`,v),d.send(v))},Mo:()=>d.close()}),_=(v,E,C)=>{v.listen(E,R=>{try{C(R)}catch(V){setTimeout(()=>{throw V},0)}})};return _(d,kg.EventType.OPEN,()=>{p||(z(Er,`RPC '${e}' stream ${i} transport opened.`),m.Qo())}),_(d,kg.EventType.CLOSE,()=>{p||(p=!0,z(Er,`RPC '${e}' stream ${i} transport closed`),m.Ko())}),_(d,kg.EventType.ERROR,v=>{p||(p=!0,eo(Er,`RPC '${e}' stream ${i} transport errored:`,v),m.Ko(new j(F.UNAVAILABLE,"The operation could not be completed")))}),_(d,kg.EventType.MESSAGE,v=>{var E;if(!p){const C=v.data[0];se(!!C);const R=C,V=R?.error||(null===(E=R[0])||void 0===E?void 0:E.error);if(V){z(Er,`RPC '${e}' stream ${i} received error:`,V);const H=V.status;let Q=function(x){const A=Dn[x];if(void 0!==A)return z9(A)}(H),S=V.message;void 0===Q&&(Q=F.INTERNAL,S="Unknown error status: "+H+" with message "+V.message),p=!0,m.Ko(new j(Q,S)),d.close()}else z(Er,`RPC '${e}' stream ${i} received:`,C),m.Uo(C)}}),_(a,h6.STAT_EVENT,v=>{v.stat===m1.PROXY?z(Er,`RPC '${e}' stream ${i} detected buffering proxy`):v.stat===m1.NOPROXY&&z(Er,`RPC '${e}' stream ${i} detected no buffering proxy`)}),setTimeout(()=>{m.$o()},0),m}}function DI(){return typeof document<"u"?document:null}function h_(n){return new qRe(n,!0)}class CN{constructor(e,t,r=1e3,i=1.5,o=6e4){this.Ti=e,this.timerId=t,this.Go=r,this.zo=i,this.jo=o,this.Ho=0,this.Jo=null,this.Yo=Date.now(),this.reset()}reset(){this.Ho=0}Zo(){this.Ho=this.jo}Xo(e){this.cancel();const t=Math.floor(this.Ho+this.e_()),r=Math.max(0,Date.now()-this.Yo),i=Math.max(0,t-r);i>0&&z("ExponentialBackoff",`Backing off for ${i} ms (base delay: ${this.Ho} ms, delay with jitter: ${t} ms, last attempt: ${r} ms ago)`),this.Jo=this.Ti.enqueueAfterDelay(this.timerId,i,()=>(this.Yo=Date.now(),e())),this.Ho*=this.zo,this.Hothis.jo&&(this.Ho=this.jo)}t_(){null!==this.Jo&&(this.Jo.skipDelay(),this.Jo=null)}cancel(){null!==this.Jo&&(this.Jo.cancel(),this.Jo=null)}e_(){return(Math.random()-.5)*this.Ho}}const sK="PersistentStream";class aK{constructor(e,t,r,i,o,s,a,l){this.Ti=e,this.n_=r,this.r_=i,this.connection=o,this.authCredentialsProvider=s,this.appCheckCredentialsProvider=a,this.listener=l,this.state=0,this.i_=0,this.s_=null,this.o_=null,this.stream=null,this.__=0,this.a_=new CN(e,t)}u_(){return 1===this.state||5===this.state||this.c_()}c_(){return 2===this.state||3===this.state}start(){this.__=0,4!==this.state?this.auth():this.l_()}stop(){var e=this;return T(function*(){e.u_()&&(yield e.close(0))})()}h_(){this.state=0,this.a_.reset()}P_(){this.c_()&&null===this.s_&&(this.s_=this.Ti.enqueueAfterDelay(this.n_,6e4,()=>this.T_()))}I_(e){this.E_(),this.stream.send(e)}T_(){var e=this;return T(function*(){if(e.c_())return e.close(0)})()}E_(){this.s_&&(this.s_.cancel(),this.s_=null)}d_(){this.o_&&(this.o_.cancel(),this.o_=null)}close(e,t){var r=this;return T(function*(){r.E_(),r.d_(),r.a_.cancel(),r.i_++,4!==e?r.a_.reset():t&&t.code===F.RESOURCE_EXHAUSTED?(vn(t.toString()),vn("Using maximum backoff delay to prevent overloading the backend."),r.a_.Zo()):t&&t.code===F.UNAUTHENTICATED&&3!==r.state&&(r.authCredentialsProvider.invalidateToken(),r.appCheckCredentialsProvider.invalidateToken()),null!==r.stream&&(r.A_(),r.stream.close(),r.stream=null),r.state=e,yield r.listener.Lo(t)})()}A_(){}auth(){this.state=1;const e=this.R_(this.i_),t=this.i_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([r,i])=>{this.i_===t&&this.V_(r,i)},r=>{e(()=>{const i=new j(F.UNKNOWN,"Fetching auth token failed: "+r.message);return this.m_(i)})})}V_(e,t){const r=this.R_(this.i_);this.stream=this.f_(e,t),this.stream.xo(()=>{r(()=>this.listener.xo())}),this.stream.No(()=>{r(()=>(this.state=2,this.o_=this.Ti.enqueueAfterDelay(this.r_,1e4,()=>(this.c_()&&(this.state=3),Promise.resolve())),this.listener.No()))}),this.stream.Lo(i=>{r(()=>this.m_(i))}),this.stream.onMessage(i=>{r(()=>1==++this.__?this.g_(i):this.onNext(i))})}l_(){var e=this;this.state=5,this.a_.Xo(T(function*(){e.state=0,e.start()}))}m_(e){return z(sK,`close with error: ${e}`),this.stream=null,this.close(4,e)}R_(e){return t=>{this.Ti.enqueueAndForget(()=>this.i_===e?t():(z(sK,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class UMe extends aK{constructor(e,t,r,i,o,s){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,r,i,s),this.serializer=o}f_(e,t){return this.connection.Wo("Listen",e,t)}g_(e){return this.onNext(e)}onNext(e){this.a_.reset();const t=function KRe(n,e){let t;if("targetChange"in e){const r="NO_CHANGE"===(c=e.targetChange.targetChangeType||"NO_CHANGE")?0:"ADD"===c?1:"REMOVE"===c?2:"CURRENT"===c?3:"RESET"===c?4:ne(),i=e.targetChange.targetIds||[],o=function(c,u){return c.useProto3Json?(se(void 0===u||"string"==typeof u),ln.fromBase64String(u||"")):(se(void 0===u||u instanceof Buffer||u instanceof Uint8Array),ln.fromUint8Array(u||new Uint8Array))}(n,e.targetChange.resumeToken),s=e.targetChange.cause,a=s&&function(c){const u=void 0===c.code?F.UNKNOWN:z9(c.code);return new j(u,c.message||"")}(s);t=new W9(r,i,o,a||null)}else if("documentChange"in e){const r=e.documentChange,i=es(n,r.document.name),o=bn(r.document.updateTime),s=r.document.createTime?bn(r.document.createTime):le.min(),a=new ar({mapValue:{fields:r.document.fields}}),l=Lt.newFoundDocument(i,o,s,a);t=new dI(r.targetIds||[],r.removedTargetIds||[],l.key,l)}else if("documentDelete"in e){const r=e.documentDelete,i=es(n,r.document),o=r.readTime?bn(r.readTime):le.min(),s=Lt.newNoDocument(i,o);t=new dI([],r.removedTargetIds||[],s.key,s)}else if("documentRemove"in e){const r=e.documentRemove,i=es(n,r.document);t=new dI([],r.removedTargetIds||[],i,null)}else{if(!("filter"in e))return ne();{const r=e.filter,{count:i=0,unchangedNames:o}=r,s=new BRe(i,o);t=new q9(r.targetId,s)}}var c;return t}(this.serializer,e),r=function(o){if(!("targetChange"in o))return le.min();const s=o.targetChange;return s.targetIds&&s.targetIds.length?le.min():s.readTime?bn(s.readTime):le.min()}(e);return this.listener.p_(t,r)}y_(e){const t={};t.database=X1(this.serializer),t.addTarget=function(o,s){let a;const l=s.target;if(a=iI(l)?{documents:n7(o,l)}:{query:fI(o,l).ht},a.targetId=s.targetId,s.resumeToken.approximateByteSize()>0){a.resumeToken=Q9(o,s.resumeToken);const c=K1(o,s.expectedCount);null!==c&&(a.expectedCount=c)}else if(s.snapshotVersion.compareTo(le.min())>0){a.readTime=$h(o,s.snapshotVersion.toTimestamp());const c=K1(o,s.expectedCount);null!==c&&(a.expectedCount=c)}return a}(this.serializer,e);const r=function YRe(n,e){const t=function(i){switch(i){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return ne()}}(e.purpose);return null==t?null:{"goog-listen-tags":t}}(0,e);r&&(t.labels=r),this.I_(t)}w_(e){const t={};t.database=X1(this.serializer),t.removeTarget=e,this.I_(t)}}class zMe extends aK{constructor(e,t,r,i,o,s){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,r,i,s),this.serializer=o}get S_(){return this.__>0}start(){this.lastStreamToken=void 0,super.start()}A_(){this.S_&&this.b_([])}f_(e,t){return this.connection.Wo("Write",e,t)}g_(e){return se(!!e.streamToken),this.lastStreamToken=e.streamToken,se(!e.writeResults||0===e.writeResults.length),this.listener.D_()}onNext(e){se(!!e.streamToken),this.lastStreamToken=e.streamToken,this.a_.reset();const t=function QRe(n,e){return n&&n.length>0?(se(void 0!==e),n.map(t=>function(i,o){let s=bn(i.updateTime?i.updateTime:o);return s.isEqual(le.min())&&(s=bn(o)),new FRe(s,i.transformResults||[])}(t,e))):[]}(e.writeResults,e.commitTime),r=bn(e.commitTime);return this.listener.v_(r,t)}C_(){const e={};e.database=X1(this.serializer),this.I_(e)}b_(e){const t={streamToken:this.lastStreamToken,writes:e.map(r=>i_(this.serializer,r))};this.I_(t)}}class jMe{}class HMe extends jMe{constructor(e,t,r,i){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=r,this.serializer=i,this.F_=!1}M_(){if(this.F_)throw new j(F.FAILED_PRECONDITION,"The client has already been terminated.")}So(e,t,r,i){return this.M_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([o,s])=>this.connection.So(e,Y1(t,r),i,o,s)).catch(o=>{throw"FirebaseError"===o.name?(o.code===F.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),o):new j(F.UNKNOWN,o.toString())})}Co(e,t,r,i,o){return this.M_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([s,a])=>this.connection.Co(e,Y1(t,r),i,s,a,o)).catch(s=>{throw"FirebaseError"===s.name?(s.code===F.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),s):new j(F.UNKNOWN,s.toString())})}terminate(){this.F_=!0,this.connection.terminate()}}class $Me{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.x_=0,this.O_=null,this.N_=!0}B_(){0===this.x_&&(this.L_("Unknown"),this.O_=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.O_=null,this.k_("Backend didn't respond within 10 seconds."),this.L_("Offline"),Promise.resolve())))}q_(e){"Online"===this.state?this.L_("Unknown"):(this.x_++,this.x_>=1&&(this.Q_(),this.k_(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.L_("Offline")))}set(e){this.Q_(),this.x_=0,"Online"===e&&(this.N_=!1),this.L_(e)}L_(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}k_(e){const t=`Could not reach Cloud Firestore backend. ${e}\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.N_?(vn(t),this.N_=!1):z("OnlineStateTracker",t)}Q_(){null!==this.O_&&(this.O_.cancel(),this.O_=null)}}const su="RemoteStore";class qMe{constructor(e,t,r,i,o){var s=this;this.localStore=e,this.datastore=t,this.asyncQueue=r,this.remoteSyncer={},this.K_=[],this.U_=new Map,this.W_=new Set,this.G_=[],this.z_=o,this.z_.To(a=>{r.enqueueAndForget(T(function*(){var l;gl(s)&&(z(su,"Restarting streams for network reachability change."),yield(l=T(function*(u){const d=Z(u);d.W_.add(4),yield Jh(d),d.j_.set("Unknown"),d.W_.delete(4),yield f_(d)}),function c(u){return l.apply(this,arguments)})(s))}))}),this.j_=new $Me(r,i)}}function f_(n){return xN.apply(this,arguments)}function xN(){return(xN=T(function*(n){if(gl(n))for(const e of n.G_)yield e(!0)})).apply(this,arguments)}function Jh(n){return SN.apply(this,arguments)}function SN(){return(SN=T(function*(n){for(const e of n.G_)yield e(!1)})).apply(this,arguments)}function AI(n,e){const t=Z(n);t.U_.has(e.targetId)||(t.U_.set(e.targetId,e),RN(t)?AN(t):nf(t).c_()&&DN(t,e))}function ef(n,e){const t=Z(n),r=nf(t);t.U_.delete(e),r.c_()&&lK(t,e),0===t.U_.size&&(r.c_()?r.P_():gl(t)&&t.j_.set("Unknown"))}function DN(n,e){if(n.H_.Ne(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(le.min())>0){const t=n.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(t)}nf(n).y_(e)}function lK(n,e){n.H_.Ne(e),nf(n).w_(e)}function AN(n){n.H_=new zRe({getRemoteKeysForTarget:e=>n.remoteSyncer.getRemoteKeysForTarget(e),lt:e=>n.U_.get(e)||null,it:()=>n.datastore.serializer.databaseId}),nf(n).start(),n.j_.B_()}function RN(n){return gl(n)&&!nf(n).u_()&&n.U_.size>0}function gl(n){return 0===Z(n).W_.size}function cK(n){n.H_=void 0}function WMe(n){return MN.apply(this,arguments)}function MN(){return(MN=T(function*(n){n.j_.set("Online")})).apply(this,arguments)}function GMe(n){return kN.apply(this,arguments)}function kN(){return(kN=T(function*(n){n.U_.forEach((e,t)=>{DN(n,e)})})).apply(this,arguments)}function KMe(n,e){return NN.apply(this,arguments)}function NN(){return(NN=T(function*(n,e){cK(n),RN(n)?(n.j_.q_(e),AN(n)):n.j_.set("Unknown")})).apply(this,arguments)}function QMe(n,e,t){return PN.apply(this,arguments)}function PN(){return PN=T(function*(n,e,t){if(n.j_.set("Online"),e instanceof W9&&2===e.state&&e.cause)try{yield(r=T(function*(o,s){const a=s.cause;for(const l of s.targetIds)o.U_.has(l)&&(yield o.remoteSyncer.rejectListen(l,a),o.U_.delete(l),o.H_.removeTarget(l))}),function i(o,s){return r.apply(this,arguments)})(n,e)}catch(r){z(su,"Failed to remove targets %s: %s ",e.targetIds.join(","),r),yield RI(n,r)}else if(e instanceof dI?n.H_.We(e):e instanceof q9?n.H_.Ze(e):n.H_.je(e),!t.isEqual(le.min()))try{const r=yield W7(n.localStore);t.compareTo(r)>=0&&(yield function(o,s){const a=o.H_.ot(s);return a.targetChanges.forEach((l,c)=>{if(l.resumeToken.approximateByteSize()>0){const u=o.U_.get(c);u&&o.U_.set(c,u.withResumeToken(l.resumeToken,s))}}),a.targetMismatches.forEach((l,c)=>{const u=o.U_.get(l);if(!u)return;o.U_.set(l,u.withResumeToken(ln.EMPTY_BYTE_STRING,u.snapshotVersion)),lK(o,l);const d=new Ys(u.target,l,c,u.sequenceNumber);DN(o,d)}),o.remoteSyncer.applyRemoteEvent(a)}(n,t))}catch(r){z(su,"Failed to raise snapshot:",r),yield RI(n,r)}var r}),PN.apply(this,arguments)}function RI(n,e,t){return ON.apply(this,arguments)}function ON(){return(ON=T(function*(n,e,t){if(!il(e))throw e;n.W_.add(1),yield Jh(n),n.j_.set("Offline"),t||(t=()=>W7(n.localStore)),n.asyncQueue.enqueueRetryable(T(function*(){z(su,"Retrying IndexedDB access"),yield t(),n.W_.delete(1),yield f_(n)}))})).apply(this,arguments)}function uK(n,e){return e().catch(t=>RI(n,t,e))}function tf(n){return FN.apply(this,arguments)}function FN(){return(FN=T(function*(n){const e=Z(n),t=_l(e);let r=e.K_.length>0?e.K_[e.K_.length-1].batchId:-1;for(;YMe(e);)try{const i=yield kMe(e.localStore,r);if(null===i){0===e.K_.length&&t.P_();break}r=i.batchId,XMe(e,i)}catch(i){yield RI(e,i)}dK(e)&&hK(e)})).apply(this,arguments)}function YMe(n){return gl(n)&&n.K_.length<10}function XMe(n,e){n.K_.push(e);const t=_l(n);t.c_()&&t.S_&&t.b_(e.mutations)}function dK(n){return gl(n)&&!_l(n).u_()&&n.K_.length>0}function hK(n){_l(n).start()}function ZMe(n){return LN.apply(this,arguments)}function LN(){return(LN=T(function*(n){_l(n).C_()})).apply(this,arguments)}function JMe(n){return VN.apply(this,arguments)}function VN(){return(VN=T(function*(n){const e=_l(n);for(const t of n.K_)e.b_(t.mutations)})).apply(this,arguments)}function eke(n,e,t){return BN.apply(this,arguments)}function BN(){return(BN=T(function*(n,e,t){const r=n.K_.shift(),i=q1.from(r,e,t);yield uK(n,()=>n.remoteSyncer.applySuccessfulWrite(i)),yield tf(n)})).apply(this,arguments)}function tke(n,e){return UN.apply(this,arguments)}function UN(){return UN=T(function*(n,e){var t;e&&_l(n).S_&&(yield(t=T(function*(i,o){if(function U9(n){switch(n){case F.OK:return ne();case F.CANCELLED:case F.UNKNOWN:case F.DEADLINE_EXCEEDED:case F.RESOURCE_EXHAUSTED:case F.INTERNAL:case F.UNAVAILABLE:case F.UNAUTHENTICATED:return!1;case F.INVALID_ARGUMENT:case F.NOT_FOUND:case F.ALREADY_EXISTS:case F.PERMISSION_DENIED:case F.FAILED_PRECONDITION:case F.ABORTED:case F.OUT_OF_RANGE:case F.UNIMPLEMENTED:case F.DATA_LOSS:return!0;default:return ne()}}(a=o.code)&&a!==F.ABORTED){const s=i.K_.shift();_l(i).h_(),yield uK(i,()=>i.remoteSyncer.rejectFailedWrite(s.batchId,o)),yield tf(i)}var a}),function r(i,o){return t.apply(this,arguments)})(n,e)),dK(n)&&hK(n)}),UN.apply(this,arguments)}function fK(n,e){return zN.apply(this,arguments)}function zN(){return(zN=T(function*(n,e){const t=Z(n);t.asyncQueue.verifyOperationInProgress(),z(su,"RemoteStore received new credentials");const r=gl(t);t.W_.add(3),yield Jh(t),r&&t.j_.set("Unknown"),yield t.remoteSyncer.handleCredentialChange(e),t.W_.delete(3),yield f_(t)})).apply(this,arguments)}function HN(){return(HN=T(function*(n,e){const t=Z(n);e?(t.W_.delete(2),yield f_(t)):e||(t.W_.add(2),yield Jh(t),t.j_.set("Unknown"))})).apply(this,arguments)}function nf(n){return n.J_||(n.J_=function(t,r,i){const o=Z(t);return o.M_(),new UMe(r,o.connection,o.authCredentials,o.appCheckCredentials,o.serializer,i)}(n.datastore,n.asyncQueue,{xo:WMe.bind(null,n),No:GMe.bind(null,n),Lo:KMe.bind(null,n),p_:QMe.bind(null,n)}),n.G_.push(function(){var e=T(function*(t){t?(n.J_.h_(),RN(n)?AN(n):n.j_.set("Unknown")):(yield n.J_.stop(),cK(n))});return function(t){return e.apply(this,arguments)}}())),n.J_}function _l(n){return n.Y_||(n.Y_=function(t,r,i){const o=Z(t);return o.M_(),new zMe(r,o.connection,o.authCredentials,o.appCheckCredentials,o.serializer,i)}(n.datastore,n.asyncQueue,{xo:()=>Promise.resolve(),No:ZMe.bind(null,n),Lo:tke.bind(null,n),D_:JMe.bind(null,n),v_:eke.bind(null,n)}),n.G_.push(function(){var e=T(function*(t){t?(n.Y_.h_(),yield tf(n)):(yield n.Y_.stop(),n.K_.length>0&&(z(su,`Stopping write stream with ${n.K_.length} pending writes`),n.K_=[]))});return function(t){return e.apply(this,arguments)}}())),n.Y_}class $N{constructor(e,t,r,i,o){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=r,this.op=i,this.removalCallback=o,this.deferred=new Yn,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(s=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,t,r,i,o){const s=Date.now()+r,a=new $N(e,t,s,i,o);return a.start(r),a}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new j(F.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function rf(n,e){if(vn("AsyncQueue",`${e}: ${n}`),il(n))return new j(F.UNAVAILABLE,`${e}: ${n}`);throw n}class sf{static emptySet(e){return new sf(e.comparator)}constructor(e){this.comparator=e?(t,r)=>e(t,r)||te.comparator(t.key,r.key):(t,r)=>te.comparator(t.key,r.key),this.keyedMap=Yg(),this.sortedSet=new Rt(this.comparator)}has(e){return null!=this.keyedMap.get(e)}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((t,r)=>(e(t),!1))}add(e){const t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){const t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof sf)||this.size!==e.size)return!1;const t=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();for(;t.hasNext();){const i=t.getNext().key,o=r.getNext().key;if(!i.isEqual(o))return!1}return!0}toString(){const e=[];return this.forEach(t=>{e.push(t.toString())}),0===e.length?"DocumentSet ()":"DocumentSet (\n "+e.join(" \n")+"\n)"}copy(e,t){const r=new sf;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=t,r}}class pK{constructor(){this.Z_=new Rt(te.comparator)}track(e){const t=e.doc.key,r=this.Z_.get(t);r?0!==e.type&&3===r.type?this.Z_=this.Z_.insert(t,e):3===e.type&&1!==r.type?this.Z_=this.Z_.insert(t,{type:r.type,doc:e.doc}):2===e.type&&2===r.type?this.Z_=this.Z_.insert(t,{type:2,doc:e.doc}):2===e.type&&0===r.type?this.Z_=this.Z_.insert(t,{type:0,doc:e.doc}):1===e.type&&0===r.type?this.Z_=this.Z_.remove(t):1===e.type&&2===r.type?this.Z_=this.Z_.insert(t,{type:1,doc:r.doc}):0===e.type&&1===r.type?this.Z_=this.Z_.insert(t,{type:2,doc:e.doc}):ne():this.Z_=this.Z_.insert(t,e)}X_(){const e=[];return this.Z_.inorderTraversal((t,r)=>{e.push(r)}),e}}class af{constructor(e,t,r,i,o,s,a,l,c){this.query=e,this.docs=t,this.oldDocs=r,this.docChanges=i,this.mutatedKeys=o,this.fromCache=s,this.syncStateChanged=a,this.excludesMetadataChanges=l,this.hasCachedResults=c}static fromInitialDocuments(e,t,r,i,o){const s=[];return t.forEach(a=>{s.push({type:0,doc:a})}),new af(e,t,sf.emptySet(t),s,r,i,!0,!1,o)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&Kg(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const t=this.docChanges,r=e.docChanges;if(t.length!==r.length)return!1;for(let i=0;ie.ra())}}class rke{constructor(){this.queries=mK(),this.onlineState="Unknown",this.ia=new Set}terminate(){!function(t,r){const i=Z(t),o=i.queries;i.queries=mK(),o.forEach((s,a)=>{for(const l of a.ta)l.onError(r)})}(this,new j(F.ABORTED,"Firestore shutting down"))}}function mK(){return new Ks(n=>w9(n),Kg)}function qN(n,e){return WN.apply(this,arguments)}function WN(){return(WN=T(function*(n,e){const t=Z(n);let r=3;const i=e.query;let o=t.queries.get(i);o?!o.na()&&e.ra()&&(r=2):(o=new nke,r=e.ra()?0:1);try{switch(r){case 0:o.ea=yield t.onListen(i,!0);break;case 1:o.ea=yield t.onListen(i,!1);break;case 2:yield t.onFirstRemoteStoreListen(i)}}catch(s){const a=rf(s,`Initialization of query '${Bh(e.query)}' failed`);return void e.onError(a)}t.queries.set(i,o),o.ta.push(e),e.sa(t.onlineState),o.ea&&e.oa(o.ea)&&QN(t)})).apply(this,arguments)}function GN(n,e){return KN.apply(this,arguments)}function KN(){return(KN=T(function*(n,e){const t=Z(n),r=e.query;let i=3;const o=t.queries.get(r);if(o){const s=o.ta.indexOf(e);s>=0&&(o.ta.splice(s,1),0===o.ta.length?i=e.ra()?0:1:!o.na()&&e.ra()&&(i=2))}switch(i){case 0:return t.queries.delete(r),t.onUnlisten(r,!0);case 1:return t.queries.delete(r),t.onUnlisten(r,!1);case 2:return t.onLastRemoteStoreUnlisten(r);default:return}})).apply(this,arguments)}function ike(n,e){const t=Z(n);let r=!1;for(const i of e){const s=t.queries.get(i.query);if(s){for(const a of s.ta)a.oa(i)&&(r=!0);s.ea=i}}r&&QN(t)}function oke(n,e,t){const r=Z(n),i=r.queries.get(e);if(i)for(const o of i.ta)o.onError(t);r.queries.delete(e)}function QN(n){n.ia.forEach(e=>{e.next()})}var YN,gK;(gK=YN||(YN={}))._a="default",gK.Cache="cache";class XN{constructor(e,t,r){this.query=e,this.aa=t,this.ua=!1,this.ca=null,this.onlineState="Unknown",this.options=r||{}}oa(e){if(!this.options.includeMetadataChanges){const r=[];for(const i of e.docChanges)3!==i.type&&r.push(i);e=new af(e.query,e.docs,e.oldDocs,r,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.ua?this.la(e)&&(this.aa.next(e),t=!0):this.ha(e,this.onlineState)&&(this.Pa(e),t=!0),this.ca=e,t}onError(e){this.aa.error(e)}sa(e){this.onlineState=e;let t=!1;return this.ca&&!this.ua&&this.ha(this.ca,e)&&(this.Pa(this.ca),t=!0),t}ha(e,t){return!e.fromCache||!this.ra()||(!this.options.Ta||!("Offline"!==t))&&(!e.docs.isEmpty()||e.hasCachedResults||"Offline"===t)}la(e){return e.docChanges.length>0||!!(e.syncStateChanged||this.ca&&this.ca.hasPendingWrites!==e.hasPendingWrites)&&!0===this.options.includeMetadataChanges}Pa(e){e=af.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.ua=!0,this.aa.next(e)}ra(){return this.options.source!==YN.Cache}}class vK{constructor(e){this.key=e}}class bK{constructor(e){this.key=e}}class wK{constructor(e,t){this.query=e,this.fa=t,this.ga=null,this.hasCachedResults=!1,this.current=!1,this.pa=Re(),this.mutatedKeys=Re(),this.ya=I9(e),this.wa=new sf(this.ya)}get Sa(){return this.fa}ba(e,t){const r=t?t.Da:new pK,i=t?t.wa:this.wa;let o=t?t.mutatedKeys:this.mutatedKeys,s=i,a=!1;const l="F"===this.query.limitType&&i.size===this.query.limit?i.last():null,c="L"===this.query.limitType&&i.size===this.query.limit?i.first():null;if(e.inorderTraversal((u,d)=>{const f=i.get(u),p=Qg(this.query,d)?d:null,m=!!f&&this.mutatedKeys.has(f.key),_=!!p&&(p.hasLocalMutations||this.mutatedKeys.has(p.key)&&p.hasCommittedMutations);let v=!1;f&&p?f.data.isEqual(p.data)?m!==_&&(r.track({type:3,doc:p}),v=!0):this.va(f,p)||(r.track({type:2,doc:p}),v=!0,(l&&this.ya(p,l)>0||c&&this.ya(p,c)<0)&&(a=!0)):!f&&p?(r.track({type:0,doc:p}),v=!0):f&&!p&&(r.track({type:1,doc:f}),v=!0,(l||c)&&(a=!0)),v&&(p?(s=s.add(p),o=_?o.add(u):o.delete(u)):(s=s.delete(u),o=o.delete(u)))}),null!==this.query.limit)for(;s.size>this.query.limit;){const u="F"===this.query.limitType?s.last():s.first();s=s.delete(u.key),o=o.delete(u.key),r.track({type:1,doc:u})}return{wa:s,Da:r,ls:a,mutatedKeys:o}}va(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,r,i){const o=this.wa;this.wa=e.wa,this.mutatedKeys=e.mutatedKeys;const s=e.Da.X_();s.sort((u,d)=>function(p,m){const _=v=>{switch(v){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return ne()}};return _(p)-_(m)}(u.type,d.type)||this.ya(u.doc,d.doc)),this.Ca(r),i=null!=i&&i;const a=t&&!i?this.Fa():[],l=0===this.pa.size&&this.current&&!i?1:0,c=l!==this.ga;return this.ga=l,0!==s.length||c?{snapshot:new af(this.query,e.wa,o,s,e.mutatedKeys,0===l,c,!1,!!r&&r.resumeToken.approximateByteSize()>0),Ma:a}:{Ma:a}}sa(e){return this.current&&"Offline"===e?(this.current=!1,this.applyChanges({wa:this.wa,Da:new pK,mutatedKeys:this.mutatedKeys,ls:!1},!1)):{Ma:[]}}xa(e){return!this.fa.has(e)&&!!this.wa.has(e)&&!this.wa.get(e).hasLocalMutations}Ca(e){e&&(e.addedDocuments.forEach(t=>this.fa=this.fa.add(t)),e.modifiedDocuments.forEach(t=>{}),e.removedDocuments.forEach(t=>this.fa=this.fa.delete(t)),this.current=e.current)}Fa(){if(!this.current)return[];const e=this.pa;this.pa=Re(),this.wa.forEach(r=>{this.xa(r.key)&&(this.pa=this.pa.add(r.key))});const t=[];return e.forEach(r=>{this.pa.has(r)||t.push(new bK(r))}),this.pa.forEach(r=>{e.has(r)||t.push(new vK(r))}),t}Oa(e){this.fa=e.gs,this.pa=Re();const t=this.ba(e.documents);return this.applyChanges(t,!0)}Na(){return af.fromInitialDocuments(this.query,this.wa,this.mutatedKeys,0===this.ga,this.hasCachedResults)}}const yl="SyncEngine";class lke{constructor(e,t,r){this.query=e,this.targetId=t,this.view=r}}class cke{constructor(e){this.key=e,this.Ba=!1}}class uke{constructor(e,t,r,i,o,s){this.localStore=e,this.remoteStore=t,this.eventManager=r,this.sharedClientState=i,this.currentUser=o,this.maxConcurrentLimboResolutions=s,this.La={},this.ka=new Ks(a=>w9(a),Kg),this.qa=new Map,this.Qa=new Set,this.$a=new Rt(te.comparator),this.Ka=new Map,this.Ua=new sN,this.Wa={},this.Ga=new Map,this.za=iu.Un(),this.onlineState="Unknown",this.ja=void 0}get isPrimaryClient(){return!0===this.ja}}function dke(n,e){return ZN.apply(this,arguments)}function ZN(){return(ZN=T(function*(n,e,t=!0){const r=MI(n);let i;const o=r.ka.get(e);return o?(r.sharedClientState.addLocalQueryTarget(o.targetId),i=o.view.Na()):i=yield EK(r,e,t,!0),i})).apply(this,arguments)}function hke(n,e){return JN.apply(this,arguments)}function JN(){return(JN=T(function*(n,e){const t=MI(n);yield EK(t,e,!0,!1)})).apply(this,arguments)}function EK(n,e,t,r){return eP.apply(this,arguments)}function eP(){return(eP=T(function*(n,e,t,r){const i=yield function Xh(n,e){const t=Z(n);return t.persistence.runTransaction("Allocate target","readwrite",r=>{let i;return t.Hr.getTargetData(r,e).next(o=>o?(i=o,N.resolve(i)):t.Hr.allocateTargetId(r).next(s=>(i=new Ys(e,s,"TargetPurposeListen",r.currentSequenceNumber),t.Hr.addTargetData(r,i).next(()=>i))))}).then(r=>{const i=t.Ts.get(r.targetId);return(null===i||r.snapshotVersion.compareTo(i.snapshotVersion)>0)&&(t.Ts=t.Ts.insert(r.targetId,r),t.Is.set(e,r.targetId)),r})}(n.localStore,br(e)),o=i.targetId,s=n.sharedClientState.addLocalQueryTarget(o,t);let a;return r&&(a=yield function tP(n,e,t,r,i){return nP.apply(this,arguments)}(n,e,o,"current"===s,i.resumeToken)),n.isPrimaryClient&&t&&AI(n.remoteStore,i),a})).apply(this,arguments)}function nP(){return nP=T(function*(n,e,t,r,i){n.Ha=(d,f,p)=>{return(m=T(function*(v,E,C,R){let V=E.view.ba(C);V.ls&&(V=yield TI(v.localStore,E.query,!1).then(({documents:I})=>E.view.ba(I,V)));const H=R&&R.targetChanges.get(E.targetId),Q=R&&null!=R.targetMismatches.get(E.targetId),S=E.view.applyChanges(V,v.isPrimaryClient,H,Q);return fP(v,E.targetId,S.Ma),S.snapshot}),function _(v,E,C,R){return m.apply(this,arguments)})(n,d,f,p);var m};const o=yield TI(n.localStore,e,!0),s=new wK(e,o.gs),a=s.ba(o.documents),l=n_.createSynthesizedTargetChangeForCurrentChange(t,r&&"Offline"!==n.onlineState,i),c=s.applyChanges(a,n.isPrimaryClient,l);fP(n,t,c.Ma);const u=new lke(e,t,s);return n.ka.set(e,u),n.qa.has(t)?n.qa.get(t).push(e):n.qa.set(t,[e]),c.snapshot}),nP.apply(this,arguments)}function fke(n,e,t){return rP.apply(this,arguments)}function rP(){return(rP=T(function*(n,e,t){const r=Z(n),i=r.ka.get(e),o=r.qa.get(i.targetId);if(o.length>1)return r.qa.set(i.targetId,o.filter(s=>!Kg(s,e))),void r.ka.delete(e);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(i.targetId),r.sharedClientState.isActiveQueryTarget(i.targetId)||(yield Zh(r.localStore,i.targetId,!1).then(()=>{r.sharedClientState.clearQueryState(i.targetId),t&&ef(r.remoteStore,i.targetId),lf(r,i.targetId)}).catch(rl))):(lf(r,i.targetId),yield Zh(r.localStore,i.targetId,!0))})).apply(this,arguments)}function pke(n,e){return iP.apply(this,arguments)}function iP(){return(iP=T(function*(n,e){const t=Z(n),r=t.ka.get(e),i=t.qa.get(r.targetId);t.isPrimaryClient&&1===i.length&&(t.sharedClientState.removeLocalQueryTarget(r.targetId),ef(t.remoteStore,r.targetId))})).apply(this,arguments)}function oP(){return(oP=T(function*(n,e,t){const r=TP(n);try{const i=yield function(s,a){const l=Z(s),c=Yt.now(),u=a.reduce((p,m)=>p.add(m.key),Re());let d,f;return l.persistence.runTransaction("Locally write mutations","readwrite",p=>{let m=ui(),_=Re();return l.ds.getEntries(p,u).next(v=>{m=v,m.forEach((E,C)=>{C.isValidDocument()||(_=_.add(E))})}).next(()=>l.localDocuments.getOverlayedDocuments(p,m)).next(v=>{d=v;const E=[];for(const C of a){const R=VRe(C,d.get(C.key).overlayedDocument);null!=R&&E.push(new Qs(C.key,R,o9(R.value.mapValue),Wt.exists(!0)))}return l.mutationQueue.addMutationBatch(p,c,E,a)}).next(v=>{f=v;const E=v.applyToLocalDocumentSet(d,_);return l.documentOverlayCache.saveOverlays(p,v.batchId,E)})}).then(()=>({batchId:f.batchId,changes:C9(d)}))}(r.localStore,e);r.sharedClientState.addPendingMutation(i.batchId),function(s,a,l){let c=s.Wa[s.currentUser.toKey()];c||(c=new Rt(Ee)),c=c.insert(a,l),s.Wa[s.currentUser.toKey()]=c}(r,i.batchId,t),yield Xs(r,i.changes),yield tf(r.remoteStore)}catch(i){const o=rf(i,"Failed to persist write");t.reject(o)}})).apply(this,arguments)}function IK(n,e){return sP.apply(this,arguments)}function sP(){return(sP=T(function*(n,e){const t=Z(n);try{const r=yield function MMe(n,e){const t=Z(n),r=e.snapshotVersion;let i=t.Ts;return t.persistence.runTransaction("Apply remote event","readwrite-primary",o=>{const s=t.ds.newChangeBuffer({trackRemovals:!0});i=t.Ts;const a=[];e.targetChanges.forEach((u,d)=>{const f=i.get(d);if(!f)return;a.push(t.Hr.removeMatchingKeys(o,u.removedDocuments,d).next(()=>t.Hr.addMatchingKeys(o,u.addedDocuments,d)));let p=f.withSequenceNumber(o.currentSequenceNumber);var _,v,E;null!==e.targetMismatches.get(d)?p=p.withResumeToken(ln.EMPTY_BYTE_STRING,le.min()).withLastLimboFreeSnapshotVersion(le.min()):u.resumeToken.approximateByteSize()>0&&(p=p.withResumeToken(u.resumeToken,r)),i=i.insert(d,p),v=p,E=u,(0===(_=f).resumeToken.approximateByteSize()||v.snapshotVersion.toMicroseconds()-_.snapshotVersion.toMicroseconds()>=3e8||E.addedDocuments.size+E.modifiedDocuments.size+E.removedDocuments.size>0)&&a.push(t.Hr.updateTargetData(o,p))});let l=ui(),c=Re();if(e.documentUpdates.forEach(u=>{e.resolvedLimboDocuments.has(u)&&a.push(t.persistence.referenceDelegate.updateLimboDocument(o,u))}),a.push(function G7(n,e,t){let r=Re(),i=Re();return t.forEach(o=>r=r.add(o)),e.getEntries(n,r).next(o=>{let s=ui();return t.forEach((a,l)=>{const c=o.get(a);l.isFoundDocument()!==c.isFoundDocument()&&(i=i.add(a)),l.isNoDocument()&&l.version.isEqual(le.min())?(e.removeEntry(a,l.readTime),s=s.insert(a,l)):!c.isValidDocument()||l.version.compareTo(c.version)>0||0===l.version.compareTo(c.version)&&c.hasPendingWrites?(e.addEntry(l),s=s.insert(a,l)):z(pN,"Ignoring outdated watch update for ",a,". Current version:",c.version," Watch version:",l.version)}),{Vs:s,fs:i}})}(o,s,e.documentUpdates).next(u=>{l=u.Vs,c=u.fs})),!r.isEqual(le.min())){const u=t.Hr.getLastRemoteSnapshotVersion(o).next(d=>t.Hr.setTargetsMetadata(o,o.currentSequenceNumber,r));a.push(u)}return N.waitFor(a).next(()=>s.apply(o)).next(()=>t.localDocuments.getLocalViewOfDocuments(o,l,c)).next(()=>l)}).then(o=>(t.Ts=i,o))}(t.localStore,e);e.targetChanges.forEach((i,o)=>{const s=t.Ka.get(o);s&&(se(i.addedDocuments.size+i.modifiedDocuments.size+i.removedDocuments.size<=1),i.addedDocuments.size>0?s.Ba=!0:i.modifiedDocuments.size>0?se(s.Ba):i.removedDocuments.size>0&&(se(s.Ba),s.Ba=!1))}),yield Xs(t,r,e)}catch(r){yield rl(r)}})).apply(this,arguments)}function TK(n,e,t){const r=Z(n);if(r.isPrimaryClient&&0===t||!r.isPrimaryClient&&1===t){const i=[];r.ka.forEach((o,s)=>{const a=s.view.sa(e);a.snapshot&&i.push(a.snapshot)}),function(s,a){const l=Z(s);l.onlineState=a;let c=!1;l.queries.forEach((u,d)=>{for(const f of d.ta)f.sa(a)&&(c=!0)}),c&&QN(l)}(r.eventManager,e),i.length&&r.La.p_(i),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}function gke(n,e,t){return aP.apply(this,arguments)}function aP(){return(aP=T(function*(n,e,t){const r=Z(n);r.sharedClientState.updateQueryState(e,"rejected",t);const i=r.Ka.get(e),o=i&&i.key;if(o){let s=new Rt(te.comparator);s=s.insert(o,Lt.newNoDocument(o,le.min()));const a=Re().add(o),l=new t_(le.min(),new Map,new Rt(Ee),s,a);yield IK(r,l),r.$a=r.$a.remove(o),r.Ka.delete(e),pP(r)}else yield Zh(r.localStore,e,!1).then(()=>lf(r,e,t)).catch(rl)})).apply(this,arguments)}function _ke(n,e){return lP.apply(this,arguments)}function lP(){return(lP=T(function*(n,e){const t=Z(n),r=e.batch.batchId;try{const i=yield function RMe(n,e){const t=Z(n);return t.persistence.runTransaction("Acknowledge batch","readwrite-primary",r=>{const i=e.batch.keys(),o=t.ds.newChangeBuffer({trackRemovals:!0});return function(a,l,c,u){const d=c.batch,f=d.keys();let p=N.resolve();return f.forEach(m=>{p=p.next(()=>u.getEntry(l,m)).next(_=>{const v=c.docVersions.get(m);se(null!==v),_.version.compareTo(v)<0&&(d.applyToRemoteDocument(_,c),_.isValidDocument()&&(_.setReadTime(c.commitVersion),u.addEntry(_)))})}),p.next(()=>a.mutationQueue.removeMutationBatch(l,d))}(t,r,e,o).next(()=>o.apply(r)).next(()=>t.mutationQueue.performConsistencyCheck(r)).next(()=>t.documentOverlayCache.removeOverlaysForBatchId(r,i,e.batch.batchId)).next(()=>t.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(r,function(a){let l=Re();for(let c=0;c0&&(l=l.add(a.batch.mutations[c].key));return l}(e))).next(()=>t.localDocuments.getDocuments(r,i))})}(t.localStore,e);hP(t,r,null),dP(t,r),t.sharedClientState.updateMutationState(r,"acknowledged"),yield Xs(t,i)}catch(i){yield rl(i)}})).apply(this,arguments)}function yke(n,e,t){return cP.apply(this,arguments)}function cP(){return(cP=T(function*(n,e,t){const r=Z(n);try{const i=yield function(s,a){const l=Z(s);return l.persistence.runTransaction("Reject batch","readwrite-primary",c=>{let u;return l.mutationQueue.lookupMutationBatch(c,a).next(d=>(se(null!==d),u=d.keys(),l.mutationQueue.removeMutationBatch(c,d))).next(()=>l.mutationQueue.performConsistencyCheck(c)).next(()=>l.documentOverlayCache.removeOverlaysForBatchId(c,u,a)).next(()=>l.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(c,u)).next(()=>l.localDocuments.getDocuments(c,u))})}(r.localStore,e);hP(r,e,t),dP(r,e),r.sharedClientState.updateMutationState(e,"rejected",t),yield Xs(r,i)}catch(i){yield rl(i)}})).apply(this,arguments)}function dP(n,e){(n.Ga.get(e)||[]).forEach(t=>{t.resolve()}),n.Ga.delete(e)}function hP(n,e,t){const r=Z(n);let i=r.Wa[r.currentUser.toKey()];if(i){const o=i.get(e);o&&(t?o.reject(t):o.resolve(),i=i.remove(e)),r.Wa[r.currentUser.toKey()]=i}}function lf(n,e,t=null){n.sharedClientState.removeLocalQueryTarget(e);for(const r of n.qa.get(e))n.ka.delete(r),t&&n.La.Ja(r,t);n.qa.delete(e),n.isPrimaryClient&&n.Ua.br(e).forEach(r=>{n.Ua.containsKey(r)||CK(n,r)})}function CK(n,e){n.Qa.delete(e.path.canonicalString());const t=n.$a.get(e);null!==t&&(ef(n.remoteStore,t),n.$a=n.$a.remove(e),n.Ka.delete(t),pP(n))}function fP(n,e,t){for(const r of t)r instanceof vK?(n.Ua.addReference(r.key,e),bke(n,r)):r instanceof bK?(z(yl,"Document no longer in limbo: "+r.key),n.Ua.removeReference(r.key,e),n.Ua.containsKey(r.key)||CK(n,r.key)):ne()}function bke(n,e){const t=e.key,r=t.path.canonicalString();n.$a.get(t)||n.Qa.has(r)||(z(yl,"New document in limbo: "+t),n.Qa.add(r),pP(n))}function pP(n){for(;n.Qa.size>0&&n.$a.size{s.push(r.Ha(l,e,t).then(c=>{var u;if((c||t)&&r.isPrimaryClient){const d=c?!c.fromCache:null===(u=t?.targetChanges.get(l.targetId))||void 0===u?void 0:u.current;r.sharedClientState.updateQueryState(l.targetId,d?"current":"not-current")}if(c){i.push(c);const d=fN.Yi(l.targetId,c);o.push(d)}}))}),yield Promise.all(s),r.La.p_(i),yield(a=T(function*(c,u){const d=Z(c);try{yield d.persistence.runTransaction("notifyLocalViewChanges","readwrite",f=>N.forEach(u,p=>N.forEach(p.Hi,m=>d.persistence.referenceDelegate.addReference(f,p.targetId,m)).next(()=>N.forEach(p.Ji,m=>d.persistence.referenceDelegate.removeReference(f,p.targetId,m)))))}catch(f){if(!il(f))throw f;z(pN,"Failed to update sequence numbers: "+f)}for(const f of u){const p=f.targetId;if(!f.fromCache){const m=d.Ts.get(p),v=m.withLastLimboFreeSnapshotVersion(m.snapshotVersion);d.Ts=d.Ts.insert(p,v)}}}),function l(c,u){return a.apply(this,arguments)})(r.localStore,o))}),mP.apply(this,arguments)}function wke(n,e){return gP.apply(this,arguments)}function gP(){return(gP=T(function*(n,e){const t=Z(n);if(!t.currentUser.isEqual(e)){z(yl,"User change. New user:",e.toKey());const r=yield q7(t.localStore,e);t.currentUser=e,(o=t).Ga.forEach(a=>{a.forEach(l=>{l.reject(new j(F.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))})}),o.Ga.clear(),t.sharedClientState.handleUserChange(e,r.removedBatchIds,r.addedBatchIds),yield Xs(t,r.Rs)}var o})).apply(this,arguments)}function Eke(n,e){const t=Z(n),r=t.Ka.get(e);if(r&&r.Ba)return Re().add(r.key);{let i=Re();const o=t.qa.get(e);if(!o)return i;for(const s of o){const a=t.ka.get(s);i=i.unionWith(a.view.Sa)}return i}}function MI(n){const e=Z(n);return e.remoteStore.remoteSyncer.applyRemoteEvent=IK.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=Eke.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=gke.bind(null,e),e.La.p_=ike.bind(null,e.eventManager),e.La.Ja=oke.bind(null,e.eventManager),e}function TP(n){const e=Z(n);return e.remoteStore.remoteSyncer.applySuccessfulWrite=_ke.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=yke.bind(null,e),e}let kI=(()=>{class n{constructor(){this.kind="memory",this.synchronizeTabs=!1}initialize(t){var r=this;return T(function*(){r.serializer=h_(t.databaseInfo.databaseId),r.sharedClientState=r.Za(t),r.persistence=r.Xa(t),yield r.persistence.start(),r.localStore=r.eu(t),r.gcScheduler=r.tu(t,r.localStore),r.indexBackfillerScheduler=r.nu(t,r.localStore)})()}tu(t,r){return null}nu(t,r){return null}eu(t){return $7(this.persistence,new H7,t.initialUser,this.serializer)}Xa(t){return new aN(wI.ri,this.serializer)}Za(t){return new nK}terminate(){var t=this;return T(function*(){var r,i;null===(r=t.gcScheduler)||void 0===r||r.stop(),null===(i=t.indexBackfillerScheduler)||void 0===i||i.stop(),t.sharedClientState.shutdown(),yield t.persistence.shutdown()})()}}return n.provider={build:()=>new n},n})();class CP extends kI{constructor(e){super(),this.cacheSizeBytes=e}tu(e,t){return se(this.persistence.referenceDelegate instanceof EI),new N7(this.persistence.referenceDelegate.garbageCollector,e.asyncQueue,t)}Xa(e){const t=void 0!==this.cacheSizeBytes?wr.withCacheSize(this.cacheSizeBytes):wr.DEFAULT;return new aN(r=>EI.ri(r,t),this.serializer)}}class xP extends kI{constructor(e,t,r){super(),this.ru=e,this.cacheSizeBytes=t,this.forceOwnership=r,this.kind="persistent",this.synchronizeTabs=!1}initialize(e){var t=()=>super.initialize,r=this;return T(function*(){yield t().call(r,e),yield r.ru.initialize(r,e),yield TP(r.ru.syncEngine),yield tf(r.ru.remoteStore),yield r.persistence.Ci(()=>(r.gcScheduler&&!r.gcScheduler.started&&r.gcScheduler.start(),r.indexBackfillerScheduler&&!r.indexBackfillerScheduler.started&&r.indexBackfillerScheduler.start(),Promise.resolve()))})()}eu(e){return $7(this.persistence,new H7,e.initialUser,this.serializer)}tu(e,t){return new N7(this.persistence.referenceDelegate.garbageCollector,e.asyncQueue,t)}nu(e,t){const r=new HAe(t,this.persistence);return new jAe(e.asyncQueue,r)}Xa(e){const t=function hN(n,e){let t=n.projectId;return n.isDefaultDatabase||(t+="."+n.database),"firestore/"+e+"/"+t+"/"}(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey),r=void 0!==this.cacheSizeBytes?wr.withCacheSize(this.cacheSizeBytes):wr.DEFAULT;return new dN(this.synchronizeTabs,t,e.clientId,r,e.asyncQueue,function oK(){return typeof window<"u"?window:null}(),DI(),this.serializer,this.sharedClientState,!!this.forceOwnership)}Za(e){return new nK}}let cf=(()=>{class n{initialize(t,r){var i=this;return T(function*(){i.localStore||(i.localStore=t.localStore,i.sharedClientState=t.sharedClientState,i.datastore=i.createDatastore(r),i.remoteStore=i.createRemoteStore(r),i.eventManager=i.createEventManager(r),i.syncEngine=i.createSyncEngine(r,!t.synchronizeTabs),i.sharedClientState.onlineStateHandler=o=>TK(i.syncEngine,o,1),i.remoteStore.remoteSyncer.handleCredentialChange=wke.bind(null,i.syncEngine),yield function jN(n,e){return HN.apply(this,arguments)}(i.remoteStore,i.syncEngine.isPrimaryClient))})()}createEventManager(t){return new rke}createDatastore(t){const r=h_(t.databaseInfo.databaseId),i=new BMe(t.databaseInfo);return new HMe(t.authCredentials,t.appCheckCredentials,i,r)}createRemoteStore(t){return i=this.localStore,o=this.datastore,s=t.asyncQueue,a=r=>TK(this.syncEngine,r,0),l=iK.D()?new iK:new OMe,new qMe(i,o,s,a,l);var i,o,s,a,l}createSyncEngine(t,r){return function(o,s,a,l,c,u,d){const f=new uke(o,s,a,l,c,u);return d&&(f.ja=!0),f}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,t.initialUser,t.maxConcurrentLimboResolutions,r)}terminate(){var t=this;return T(function*(){var r,i,o;yield(o=T(function*(a){const l=Z(a);z(su,"RemoteStore shutting down."),l.W_.add(5),yield Jh(l),l.z_.shutdown(),l.j_.set("Unknown")}),function s(a){return o.apply(this,arguments)})(t.remoteStore),null===(r=t.datastore)||void 0===r||r.terminate(),null===(i=t.eventManager)||void 0===i||i.terminate()})()}}return n.provider={build:()=>new n},n})();class NI{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.iu(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.iu(this.observer.error,e):vn("Uncaught Error in snapshot listener:",e.toString()))}su(){this.muted=!0}iu(e,t){setTimeout(()=>{this.muted||e(t)},0)}}const vl="FirestoreClient";class Pke{constructor(e,t,r,i,o){var s=this;this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=r,this.databaseInfo=i,this.user=Qn.UNAUTHENTICATED,this.clientId=y6.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=o,this.authCredentials.start(r,function(){var a=T(function*(l){z(vl,"Received user=",l.uid),yield s.authCredentialListener(l),s.user=l});return function(l){return a.apply(this,arguments)}}()),this.appCheckCredentials.start(r,a=>(z(vl,"Received new app check token=",a),this.appCheckCredentialListener(a,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){var e=this;this.asyncQueue.enterRestrictedMode();const t=new Yn;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(T(function*(){try{e._onlineComponents&&(yield e._onlineComponents.terminate()),e._offlineComponents&&(yield e._offlineComponents.terminate()),e.authCredentials.shutdown(),e.appCheckCredentials.shutdown(),t.resolve()}catch(r){const i=rf(r,"Failed to shutdown persistence");t.reject(i)}})),t.promise}}function SP(n,e){return DP.apply(this,arguments)}function DP(){return DP=T(function*(n,e){n.asyncQueue.verifyOperationInProgress(),z(vl,"Initializing OfflineComponentProvider");const t=n.configuration;yield e.initialize(t);let r=t.initialUser;n.setCredentialChangeListener(function(){var i=T(function*(o){r.isEqual(o)||(yield q7(e.localStore,o),r=o)});return function(o){return i.apply(this,arguments)}}()),e.persistence.setDatabaseDeletedListener(()=>n.terminate()),n._offlineComponents=e}),DP.apply(this,arguments)}function RK(n,e){return AP.apply(this,arguments)}function AP(){return(AP=T(function*(n,e){n.asyncQueue.verifyOperationInProgress();const t=yield function RP(n){return MP.apply(this,arguments)}(n);z(vl,"Initializing OnlineComponentProvider"),yield e.initialize(t,n.configuration),n.setCredentialChangeListener(r=>fK(e.remoteStore,r)),n.setAppCheckTokenChangeListener((r,i)=>fK(e.remoteStore,i)),n._onlineComponents=e})).apply(this,arguments)}function MP(){return(MP=T(function*(n){if(!n._offlineComponents)if(n._uninitializedComponentsProvider){z(vl,"Using user provided OfflineComponentProvider");try{yield SP(n,n._uninitializedComponentsProvider._offline)}catch(e){if(!("FirebaseError"===(i=e).name?i.code===F.FAILED_PRECONDITION||i.code===F.UNIMPLEMENTED:!(typeof DOMException<"u"&&i instanceof DOMException)||22===i.code||20===i.code||11===i.code))throw e;eo("Error using user provided cache. Falling back to memory cache: "+e),yield SP(n,new kI)}}else z(vl,"Using default OfflineComponentProvider"),yield SP(n,new CP(void 0));var i;return n._offlineComponents})).apply(this,arguments)}function PI(n){return kP.apply(this,arguments)}function kP(){return(kP=T(function*(n){return n._onlineComponents||(n._uninitializedComponentsProvider?(z(vl,"Using user provided OnlineComponentProvider"),yield RK(n,n._uninitializedComponentsProvider._online)):(z(vl,"Using default OnlineComponentProvider"),yield RK(n,new cf))),n._onlineComponents})).apply(this,arguments)}function df(n){return PP.apply(this,arguments)}function PP(){return(PP=T(function*(n){const e=yield PI(n),t=e.eventManager;return t.onListen=dke.bind(null,e.syncEngine),t.onUnlisten=fke.bind(null,e.syncEngine),t.onFirstRemoteStoreListen=hke.bind(null,e.syncEngine),t.onLastRemoteStoreUnlisten=pke.bind(null,e.syncEngine),t})).apply(this,arguments)}function FK(n){const e={};return void 0!==n.timeoutSeconds&&(e.timeoutSeconds=n.timeoutSeconds),e}const LK=new Map;function OP(n,e,t){if(!t)throw new j(F.INVALID_ARGUMENT,`Function ${n}() cannot be called with an empty ${e}.`)}function VK(n){if(!te.isDocumentKey(n))throw new j(F.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${n} has ${n.length}.`)}function BK(n){if(te.isDocumentKey(n))throw new j(F.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${n} has ${n.length}.`)}function OI(n){if(void 0===n)return"undefined";if(null===n)return"null";if("string"==typeof n)return n.length>20&&(n=`${n.substring(0,20)}...`),JSON.stringify(n);if("number"==typeof n||"boolean"==typeof n)return""+n;if("object"==typeof n){if(n instanceof Array)return"an array";{const e=(r=n).constructor?r.constructor.name:null;return e?`a custom ${e} object`:"an object"}}var r;return"function"==typeof n?"a function":ne()}function Be(n,e){if("_delegate"in n&&(n=n._delegate),!(n instanceof e)){if(e.name===n.constructor.name)throw new j(F.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const t=OI(n);throw new j(F.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${t}`)}}return n}const zK="firestore.googleapis.com";class HK{constructor(e){var t,r;if(void 0===e.host){if(void 0!==e.ssl)throw new j(F.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=zK,this.ssl=!0}else this.host=e.host,this.ssl=null===(t=e.ssl)||void 0===t||t;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,void 0===e.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==e.cacheSizeBytes&&e.cacheSizeBytes<1048576)throw new j(F.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}(function Wke(n,e,t,r){if(!0===e&&!0===r)throw new j(F.INVALID_ARGUMENT,`${n} and ${t} cannot be used together.`)})("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!(this.experimentalForceLongPolling||void 0!==e.experimentalAutoDetectLongPolling&&!e.experimentalAutoDetectLongPolling),this.experimentalLongPollingOptions=FK(null!==(r=e.experimentalLongPollingOptions)&&void 0!==r?r:{}),function(o){if(void 0!==o.timeoutSeconds){if(isNaN(o.timeoutSeconds))throw new j(F.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (must not be NaN)`);if(o.timeoutSeconds<5)throw new j(F.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (minimum allowed value is 5)`);if(o.timeoutSeconds>30)throw new j(F.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&this.experimentalLongPollingOptions.timeoutSeconds===e.experimentalLongPollingOptions.timeoutSeconds&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class p_{constructor(e,t,r,i){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=r,this._app=i,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new HK({}),this._settingsFrozen=!1,this._terminateTask="notTerminated"}get app(){if(!this._app)throw new j(F.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return"notTerminated"!==this._terminateTask}_setSettings(e){if(this._settingsFrozen)throw new j(F.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new HK(e),void 0!==e.credentials&&(this._authCredentials=function(r){if(!r)return new RAe;switch(r.type){case"firstParty":return new PAe(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new j(F.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return"notTerminated"===this._terminateTask&&(this._terminateTask=this._terminate()),this._terminateTask}_restart(){var e=this;return T(function*(){"notTerminated"===e._terminateTask?yield e._terminate():e._terminateTask="notTerminated"})()}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(t){const r=LK.get(t);r&&(z("ComponentProvider","Removing Datastore"),LK.delete(t),r.terminate())}(this),Promise.resolve()}}class lr{constructor(e,t,r){this.converter=t,this._query=r,this.type="query",this.firestore=e}withConverter(e){return new lr(this.firestore,e,this._query)}}class wn{constructor(e,t,r){this.converter=t,this._key=r,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new ns(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new wn(this.firestore,e,this._key)}}class ns extends lr{constructor(e,t,r){super(e,t,Lh(r)),this._path=r,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new wn(this.firestore,null,new te(e))}withConverter(e){return new ns(this.firestore,e,this._path)}}function Kke(n,e,...t){if(n=sn(n),OP("collection","path",e),n instanceof p_){const r=We.fromString(e,...t);return BK(r),new ns(n,null,r)}{if(!(n instanceof wn||n instanceof ns))throw new j(F.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=n._path.child(We.fromString(e,...t));return BK(r),new ns(n.firestore,null,r)}}function $K(n,e,...t){if(n=sn(n),1===arguments.length&&(e=y6.newId()),OP("doc","path",e),n instanceof p_){const r=We.fromString(e,...t);return VK(r),new wn(n,null,new te(r))}{if(!(n instanceof wn||n instanceof ns))throw new j(F.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=n._path.child(We.fromString(e,...t));return VK(r),new wn(n.firestore,n instanceof ns?n.converter:null,new te(r))}}const WK="AsyncQueue";class GK{constructor(e=Promise.resolve()){this.Vu=[],this.mu=!1,this.fu=[],this.gu=null,this.pu=!1,this.yu=!1,this.wu=[],this.a_=new CN(this,"async_queue_retry"),this.Su=()=>{const r=DI();r&&z(WK,"Visibility state changed to "+r.visibilityState),this.a_.t_()},this.bu=e;const t=DI();t&&"function"==typeof t.addEventListener&&t.addEventListener("visibilitychange",this.Su)}get isShuttingDown(){return this.mu}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.Du(),this.vu(e)}enterRestrictedMode(e){if(!this.mu){this.mu=!0,this.yu=e||!1;const t=DI();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this.Su)}}enqueue(e){if(this.Du(),this.mu)return new Promise(()=>{});const t=new Yn;return this.vu(()=>this.mu&&this.yu?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Vu.push(e),this.Cu()))}Cu(){var e=this;return T(function*(){if(0!==e.Vu.length){try{yield e.Vu[0](),e.Vu.shift(),e.a_.reset()}catch(t){if(!il(t))throw t;z(WK,"Operation failed with retryable error: "+t)}e.Vu.length>0&&e.a_.Xo(()=>e.Cu())}})()}vu(e){const t=this.bu.then(()=>(this.pu=!0,e().catch(r=>{throw this.gu=r,this.pu=!1,vn("INTERNAL UNHANDLED ERROR: ",function(s){let a=s.message||"";return s.stack&&(a=s.stack.includes(s.message)?s.stack:s.message+"\n"+s.stack),a}(r)),r}).then(r=>(this.pu=!1,r))));return this.bu=t,t}enqueueAfterDelay(e,t,r){this.Du(),this.wu.indexOf(e)>-1&&(t=0);const i=$N.createAndSchedule(this,e,t,r,o=>this.Fu(o));return this.fu.push(i),i}Du(){this.gu&&ne()}verifyOperationInProgress(){}Mu(){var e=this;return T(function*(){let t;do{t=e.bu,yield t}while(t!==e.bu)})()}xu(e){for(const t of this.fu)if(t.timerId===e)return!0;return!1}Ou(e){return this.Mu().then(()=>{this.fu.sort((t,r)=>t.targetTimeMs-r.targetTimeMs);for(const t of this.fu)if(t.skipDelay(),"all"!==e&&t.timerId===e)break;return this.Mu()})}Nu(e){this.wu.push(e)}Fu(e){const t=this.fu.indexOf(e);this.fu.splice(t,1)}}function FP(n){return function(t){if("object"!=typeof t||null===t)return!1;const i=t;for(const o of["next","error","complete"])if(o in i&&"function"==typeof i[o])return!0;return!1}(n)}class Ct extends p_{constructor(e,t,r,i){super(e,t,r,i),this.type="firestore",this._queue=new GK,this._persistenceKey=i?.name||"[DEFAULT]"}_terminate(){var e=this;return T(function*(){if(e._firestoreClient){const t=e._firestoreClient.terminate();e._queue=new GK(t),e._firestoreClient=void 0,yield t}})()}}function Yke(n,e){const t="object"==typeof n?n:cE(),r="string"==typeof n?n:e||jg,i=cg(t,"firestore").getImmediate({identifier:r});if(!i._initialized){const o=QW("firestore");o&&function Gke(n,e,t,r={}){var i;const o=(n=Be(n,p_))._getSettings(),s=`${e}:${t}`;if(o.host!==zK&&o.host!==s&&eo("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),n._setSettings(Object.assign(Object.assign({},o),{host:s,ssl:!1})),r.mockUserToken){let a,l;if("string"==typeof r.mockUserToken)a=r.mockUserToken,l=Qn.MOCK_USER;else{a=ZW(r.mockUserToken,null===(i=n._app)||void 0===i?void 0:i.options.projectId);const c=r.mockUserToken.sub||r.mockUserToken.user_id;if(!c)throw new j(F.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");l=new Qn(c)}n._authCredentials=new MAe(new _6(a,l))}}(i,...o)}return i}function Xt(n){if(n._terminated)throw new j(F.FAILED_PRECONDITION,"The client has already been terminated.");return n._firestoreClient||KK(n),n._firestoreClient}function KK(n){var e,t,r;const i=n._freezeSettings(),o=(l=(null===(e=n._app)||void 0===e?void 0:e.options.appId)||"",new _Re(n._databaseId,l,n._persistenceKey,(u=i).host,u.ssl,u.experimentalForceLongPolling,u.experimentalAutoDetectLongPolling,FK(u.experimentalLongPollingOptions),u.useFetchStreams));var l,u;n._componentsProvider||!(null===(t=i.localCache)||void 0===t)&&t._offlineComponentProvider&&!(null===(r=i.localCache)||void 0===r)&&r._onlineComponentProvider&&(n._componentsProvider={_offline:i.localCache._offlineComponentProvider,_online:i.localCache._onlineComponentProvider}),n._firestoreClient=new Pke(n._authCredentials,n._appCheckCredentials,n._queue,o,n._componentsProvider&&function(a){const l=a?._online.build();return{_offline:a?._offline.build(l),_online:l}}(n._componentsProvider))}function Xke(n,e){eo("enableIndexedDbPersistence() will be deprecated in the future, you can use `FirestoreSettings.cache` instead.");const t=n._freezeSettings();return function QK(n,e,t){if((n=Be(n,Ct))._firestoreClient||n._terminated)throw new j(F.FAILED_PRECONDITION,"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.");if(n._componentsProvider||n._getSettings().localCache)throw new j(F.FAILED_PRECONDITION,"SDK cache is already specified.");n._componentsProvider={_online:e,_offline:t},KK(n)}(n,cf.provider,{build:r=>new xP(r,t.cacheSizeBytes,e?.forceOwnership)}),Promise.resolve()}class au{constructor(e){this._byteString=e}static fromBase64String(e){try{return new au(ln.fromBase64String(e))}catch(t){throw new j(F.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+t)}}static fromUint8Array(e){return new au(ln.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}}class lu{constructor(...e){for(let t=0;t90)throw new j(F.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new j(F.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(e){return Ee(this._lat,e._lat)||Ee(this._long,e._long)}}class FI{constructor(e){this._values=(e||[]).map(t=>t)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(r,i){if(r.length!==i.length)return!1;for(let o=0;oe.isPrefixOf(t))||void 0!==this.fieldTransforms.find(t=>e.isPrefixOf(t.field))}Bu(){if(this.path)for(let e=0;el.covers(d.field))}else l=null,c=s.fieldTransforms;return new e1e(new ar(a),l,c)}class g_ extends cu{_toFieldTransform(e){if(2!==e.Lu)throw e.Wu(1===e.Lu?`${this._methodName}() can only appear at the top level of your update data`:`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof g_}}class BP extends cu{_toFieldTransform(e){return new Zg(e.path,new Uh)}isEqual(e){return e instanceof BP}}function du(n,e){if(tQ(n=sn(n)))return qP("Unsupported field value:",e,n),eQ(n,e);if(n instanceof cu)return function(r,i){if(!XK(i.Lu))throw i.Wu(`${r._methodName}() can only be used with update() and set()`);if(!i.path)throw i.Wu(`${r._methodName}() is not currently supported inside arrays`);const o=r._toFieldTransform(i);o&&i.fieldTransforms.push(o)}(n,e),null;if(void 0===n&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),n instanceof Array){if(e.settings.Qu&&4!==e.Lu)throw e.Wu("Nested arrays are not supported");return function(r,i){const o=[];let s=0;for(const a of r){let l=du(a,i.Uu(s));null==l&&(l={nullValue:"NULL_VALUE"}),o.push(l),s++}return{arrayValue:{values:o}}}(n,e)}return function(r,i){if(null===(r=sn(r)))return{nullValue:"NULL_VALUE"};if("number"==typeof r)return D9(i.serializer,r);if("boolean"==typeof r)return{booleanValue:r};if("string"==typeof r)return{stringValue:r};if(r instanceof Date){const o=Yt.fromDate(r);return{timestampValue:$h(i.serializer,o)}}if(r instanceof Yt){const o=new Yt(r.seconds,1e3*Math.floor(r.nanoseconds/1e3));return{timestampValue:$h(i.serializer,o)}}if(r instanceof VP)return{geoPointValue:{latitude:r.latitude,longitude:r.longitude}};if(r instanceof au)return{bytesValue:Q9(i.serializer,r._byteString)};if(r instanceof wn){const o=i.databaseId,s=r.firestore._databaseId;if(!s.isEqual(o))throw i.Wu(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${o.projectId}/${o.database}`);return{referenceValue:Q1(r.firestore._databaseId||i.databaseId,r._key.path)}}if(r instanceof FI)return s=r,a=i,{mapValue:{fields:{[M1]:{stringValue:k1},[Ph]:{arrayValue:{values:s.toArray().map(c=>{if("number"!=typeof c)throw a.Wu("VectorValues must only contain numeric values.");return j1(a.serializer,c)})}}}}};var s,a;throw i.Wu(`Unsupported field value: ${OI(r)}`)}(n,e)}function eQ(n,e){const t={};return H6(n)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):sl(n,(r,i)=>{const o=du(i,e.qu(r));null!=o&&(t[r]=o)}),{mapValue:{fields:t}}}function tQ(n){return!("object"!=typeof n||null===n||n instanceof Array||n instanceof Date||n instanceof Yt||n instanceof VP||n instanceof au||n instanceof wn||n instanceof cu||n instanceof FI)}function qP(n,e,t){if(!tQ(t)||"object"!=typeof(i=t)||null===i||Object.getPrototypeOf(i)!==Object.prototype&&null!==Object.getPrototypeOf(i)){const r=OI(t);throw e.Wu("an object"===r?n+" a custom object":n+" "+r)}var i}function __(n,e,t){if((e=sn(e))instanceof lu)return e._internalPath;if("string"==typeof e)return BI(n,e);throw UI("Field path arguments must be of type string or ",n,!1,void 0,t)}const n1e=new RegExp("[~\\*/\\[\\]]");function BI(n,e,t){if(e.search(n1e)>=0)throw UI(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,n,!1,void 0,t);try{return new lu(...e.split("."))._internalPath}catch{throw UI(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,n,!1,void 0,t)}}function UI(n,e,t,r,i){const o=r&&!r.isEmpty(),s=void 0!==i;let a=`Function ${e}() called with invalid data`;t&&(a+=" (via `toFirestore()`)"),a+=". ";let l="";return(o||s)&&(l+=" (found",o&&(l+=` in field ${r}`),s&&(l+=` in document ${i}`),l+=")"),new j(F.INVALID_ARGUMENT,a+n+l)}function nQ(n,e){return n.some(t=>t.isEqual(e))}class y_{constructor(e,t,r,i,o){this._firestore=e,this._userDataWriter=t,this._key=r,this._document=i,this._converter=o}get id(){return this._key.path.lastSegment()}get ref(){return new wn(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){const e=new r1e(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const t=this._document.data.field(zI("DocumentSnapshot.get",e));if(null!==t)return this._userDataWriter.convertValue(t)}}}class r1e extends y_{data(){return super.data()}}function zI(n,e){return"string"==typeof e?BI(n,e):e instanceof lu?e._internalPath:e._delegate._internalPath}class cQ{convertValue(e,t="none"){switch(ll(e)){case 0:return null;case 1:return e.booleanValue;case 2:return qt(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(Ws(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 11:return this.convertObject(e.mapValue,t);case 10:return this.convertVectorValue(e.mapValue);default:throw ne()}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t="none"){const r={};return sl(e,(i,o)=>{r[i]=this.convertValue(o,t)}),r}convertVectorValue(e){var t,r,i;const o=null===(i=null===(r=null===(t=e.fields)||void 0===t?void 0:t[Ph].arrayValue)||void 0===r?void 0:r.values)||void 0===i?void 0:i.map(s=>qt(s.doubleValue));return new FI(o)}convertGeoPoint(e){return new VP(qt(e.latitude),qt(e.longitude))}convertArray(e,t){return(e.values||[]).map(r=>this.convertValue(r,t))}convertServerTimestamp(e,t){switch(t){case"previous":const r=JE(e);return null==r?null:this.convertValue(r,t);case"estimate":return this.convertTimestamp(zg(e));default:return null}}convertTimestamp(e){const t=qs(e);return new Yt(t.seconds,t.nanos)}convertDocumentKey(e,t){const r=We.fromString(e);se(a7(r));const i=new Kc(r.get(1),r.get(3)),o=new te(r.popFirst(5));return i.isEqual(t)||vn(`Document ${o} contains a document reference within a different database (${i.projectId}/${i.database}) which is not supported. It will be treated as a reference in the current database (${t.projectId}/${t.database}) instead.`),o}}function qI(n,e,t){let r;return r=n?t&&(t.merge||t.mergeFields)?n.toFirestore(e,t):n.toFirestore(e):e,r}class hu{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class ff extends y_{constructor(e,t,r,i,o,s){super(e,t,r,i,s),this._firestore=e,this._firestoreImpl=e,this.metadata=o}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const t=new WI(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){const r=this._document.data.field(zI("DocumentSnapshot.get",e));if(null!==r)return this._userDataWriter.convertValue(r,t.serverTimestamps)}}}class WI extends ff{data(e={}){return super.data(e)}}class pf{constructor(e,t,r,i){this._firestore=e,this._userDataWriter=t,this._snapshot=i,this.metadata=new hu(i.hasPendingWrites,i.fromCache),this.query=r}get docs(){const e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(e,t){this._snapshot.docs.forEach(r=>{e.call(t,new WI(this._firestore,this._userDataWriter,r.key,r,new hu(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new j(F.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(i,o){if(i._snapshot.oldDocs.isEmpty()){let s=0;return i._snapshot.docChanges.map(a=>({type:"added",doc:new WI(i._firestore,i._userDataWriter,a.doc.key,a.doc,new hu(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter),oldIndex:-1,newIndex:s++}))}{let s=i._snapshot.oldDocs;return i._snapshot.docChanges.filter(a=>o||3!==a.type).map(a=>{const l=new WI(i._firestore,i._userDataWriter,a.doc.key,a.doc,new hu(i._snapshot.mutatedKeys.has(a.doc.key),i._snapshot.fromCache),i.query.converter);let c=-1,u=-1;return 0!==a.type&&(c=s.indexOf(a.doc.key),s=s.delete(a.doc.key)),1!==a.type&&(s=s.add(a.doc),u=s.indexOf(a.doc.key)),{type:s1e(a.type),doc:l,oldIndex:c,newIndex:u}})}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}}function s1e(n){switch(n){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return ne()}}function a1e(n){n=Be(n,wn);const e=Be(n.firestore,Ct);return function PK(n,e,t={}){const r=new Yn;return n.asyncQueue.enqueueAndForget(T(function*(){return function(o,s,a,l,c){const u=new NI({next:f=>{u.su(),s.enqueueAndForget(()=>GN(o,d));const p=f.docs.has(a);!p&&f.fromCache?c.reject(new j(F.UNAVAILABLE,"Failed to get document because the client is offline.")):p&&f.fromCache&&l&&"server"===l.source?c.reject(new j(F.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):c.resolve(f)},error:f=>c.reject(f)}),d=new XN(Lh(a.path),u,{includeMetadataChanges:!0,Ta:!0});return qN(o,d)}(yield df(n),n.asyncQueue,e,t,r)})),r.promise}(Xt(e),n._key).then(t=>KP(e,n,t))}class bl extends cQ{constructor(e){super(),this.firestore=e}convertBytes(e){return new au(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);return new wn(this.firestore,null,t)}}function l1e(n,e,t){n=Be(n,wn);const r=Be(n.firestore,Ct),i=qI(n.converter,e,t);return w_(r,[VI(uu(r),"setDoc",n._key,i,null!==n.converter,t).toMutation(n._key,Wt.none())])}function c1e(n,e,t,...r){n=Be(n,wn);const i=Be(n.firestore,Ct),o=uu(i);let s;return s="string"==typeof(e=sn(e))||e instanceof lu?function $P(n,e,t,r,i,o){const s=n.ju(1,e,t),a=[__(e,r,t)],l=[i];if(o.length%2!=0)throw new j(F.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let f=0;f=0;--f)if(!nQ(c,a[f])){const p=a[f];let m=l[f];m=sn(m);const _=s.Ku(p);if(m instanceof g_)c.push(p);else{const v=du(m,_);null!=v&&(c.push(p),u.set(p,v))}}const d=new ci(c);return new YK(u,d,s.fieldTransforms)}(o,"updateDoc",n._key,e,t,r):function HP(n,e,t,r){const i=n.ju(1,e,t);qP("Data must be an object, but it was:",i,r);const o=[],s=ar.empty();sl(r,(l,c)=>{const u=BI(e,l,t);c=sn(c);const d=i.Ku(u);if(c instanceof g_)o.push(u);else{const f=du(c,d);null!=f&&(o.push(u),s.set(u,f))}});const a=new ci(o);return new YK(s,a,i.fieldTransforms)}(o,"updateDoc",n._key,e),w_(i,[s.toMutation(n._key,Wt.exists(!0))])}function u1e(n,e){const t=Be(n.firestore,Ct),r=$K(n),i=qI(n.converter,e);return w_(t,[VI(uu(n.firestore),"addDoc",r._key,i,null!==n.converter,{}).toMutation(r._key,Wt.exists(!1))]).then(()=>r)}function w_(n,e){return function(r,i){const o=new Yn;return r.asyncQueue.enqueueAndForget(T(function*(){return function mke(n,e,t){return oP.apply(this,arguments)}(yield function NP(n){return PI(n).then(e=>e.syncEngine)}(r),i,o)})),o.promise}(Xt(n),e)}function KP(n,e,t){const r=t.docs.get(e._key),i=new bl(n);return new ff(n,i,e._key,r,new hu(t.hasPendingWrites,t.fromCache),e.converter)}function E_(){return new BP("serverTimestamp")}!function(e,t=!0){Eh=Lc,Fs(new Go("firestore",(r,{instanceIdentifier:i,options:o})=>{const s=r.getProvider("app").getImmediate(),a=new Ct(new kAe(r.getProvider("auth-internal")),new OAe(s,r.getProvider("app-check-internal")),function(c,u){if(!Object.prototype.hasOwnProperty.apply(c.options,["projectId"]))throw new j(F.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Kc(c.options.projectId,u)}(s,i),s);return o=Object.assign({useFetchStreams:t},o),a._setSettings(o),a},"PUBLIC").setMultipleInstances(!0)),Gn(m6,"4.7.8",e),Gn(m6,"4.7.8","esm2017")}();var KI=function(){return KI=Object.assign||function(e){for(var t,r=1,i=arguments.length;r{e[s]&&e[s](KP(c,n,d))},error:e[s+1],complete:e[s+2]};else{const d=Be(n,lr);c=Be(d.firestore,Ct),u=d._query;const f=new bl(c);l={next:p=>{e[s]&&e[s](new pf(c,f,d,p))},error:e[s+1],complete:e[s+2]},function rQ(n){if("L"===n.limitType&&0===n.explicitOrderBy.length)throw new j(F.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}(n._query)}return function(f,p,m,_){const v=new NI(_),E=new XN(p,v,m);return f.asyncQueue.enqueueAndForget(T(function*(){return qN(yield df(f),E)})),()=>{v.su(),f.asyncQueue.enqueueAndForget(T(function*(){return GN(yield df(f),E)}))}}(Xt(c),u,a,l)}(n,e,{next:t.next.bind(t),error:t.error.bind(t),complete:t.complete.bind(t)});return{unsubscribe:r}})}function S1e(n,e){return void 0===e&&(e={}),function x1e(n){return XP(n,{includeMetadataChanges:!0})}(n).pipe(Te(function(t){return function fQ(n,e){var t;void 0===e&&(e={});var r=n.data(e);return n.exists()&&"object"==typeof r&&null!==r&&e.idField?KI(KI({},r),((t={})[e.idField]=n.id,t)):r}(t,e)}))}class I_{constructor(e){return e}}const _Q="firestore",eO=new B("angularfire2.firestore-instances");function F1e(n){return(e,t)=>{const r=e.runOutsideAngular(()=>n(t));return new I_(r)}}const L1e={provide:class P1e{constructor(){return dE(_Q)}},deps:[[new fn,eO]]},V1e={provide:I_,useFactory:function O1e(n,e){const t=uE(_Q,n,e);return t&&new I_(t)},deps:[[new fn,eO],Bc]},U1e=ir(S1e,!0),z1e=ir(u1e,!0,2),j1e=ir(Kke,!0,2),tO=ir($K,!0,2),H1e=ir(Xke,!0),$1e=ir(a1e,!0),q1e=ir(Yke,!0),W1e=ir(l1e,!0,2),G1e=ir(c1e,!0,2);class nO{_attachedHost;attach(e){return this._attachedHost=e,e.attach(this)}detach(){let e=this._attachedHost;null!=e&&(this._attachedHost=null,e.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(e){this._attachedHost=e}}class QI extends nO{component;viewContainerRef;injector;componentFactoryResolver;projectableNodes;constructor(e,t,r,i,o){super(),this.component=e,this.viewContainerRef=t,this.injector=r,this.projectableNodes=o}}class yQ extends nO{templateRef;viewContainerRef;context;injector;constructor(e,t,r,i){super(),this.templateRef=e,this.viewContainerRef=t,this.context=r,this.injector=i}get origin(){return this.templateRef.elementRef}attach(e,t=this.context){return this.context=t,super.attach(e)}detach(){return this.context=void 0,super.detach()}}class K1e extends nO{element;constructor(e){super(),this.element=e instanceof je?e.nativeElement:e}}class rO{_attachedPortal;_disposeFn;_isDisposed=!1;hasAttached(){return!!this._attachedPortal}attach(e){return e instanceof QI?(this._attachedPortal=e,this.attachComponentPortal(e)):e instanceof yQ?(this._attachedPortal=e,this.attachTemplatePortal(e)):this.attachDomPortal&&e instanceof K1e?(this._attachedPortal=e,this.attachDomPortal(e)):void 0}attachDomPortal=null;detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(e){this._disposeFn=e}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class Q1e extends rO{outletElement;_appRef;_defaultInjector;_document;constructor(e,t,r,i,o){super(),this.outletElement=e,this._appRef=r,this._defaultInjector=i,this._document=o}attachComponentPortal(e){let t;if(e.viewContainerRef){const r=e.injector||e.viewContainerRef.injector,i=r.get(Ss,null,{optional:!0})||void 0;t=e.viewContainerRef.createComponent(e.component,{index:e.viewContainerRef.length,injector:r,ngModuleRef:i,projectableNodes:e.projectableNodes||void 0}),this.setDisposeFn(()=>t.destroy())}else t=vD(e.component,{elementInjector:e.injector||this._defaultInjector||ze.NULL,environmentInjector:this._appRef.injector,projectableNodes:e.projectableNodes||void 0}),this._appRef.attachView(t.hostView),this.setDisposeFn(()=>{this._appRef.viewCount>0&&this._appRef.detachView(t.hostView),t.destroy()});return this.outletElement.appendChild(this._getComponentRootNode(t)),this._attachedPortal=e,t}attachTemplatePortal(e){let t=e.viewContainerRef,r=t.createEmbeddedView(e.templateRef,e.context,{injector:e.injector});return r.rootNodes.forEach(i=>this.outletElement.appendChild(i)),r.detectChanges(),this.setDisposeFn(()=>{let i=t.indexOf(r);-1!==i&&t.remove(i)}),this._attachedPortal=e,r}attachDomPortal=e=>{const t=e.element,r=this._document.createComment("dom-portal");t.parentNode.insertBefore(r,t),this.outletElement.appendChild(t),this._attachedPortal=e,super.setDisposeFn(()=>{r.parentNode&&r.parentNode.replaceChild(t,r)})};dispose(){super.dispose(),this.outletElement.remove()}_getComponentRootNode(e){return e.hostView.rootNodes[0]}}let vQ=(()=>{class n extends rO{_moduleRef=b(Ss,{optional:!0});_document=b(Xe);_viewContainerRef=b(Ci);_isInitialized=!1;_attachedRef;constructor(){super()}get portal(){return this._attachedPortal}set portal(t){this.hasAttached()&&!t&&!this._isInitialized||(this.hasAttached()&&super.detach(),t&&super.attach(t),this._attachedPortal=t||null)}attached=new nt;get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedRef=this._attachedPortal=null}attachComponentPortal(t){t.setAttachedHost(this);const r=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,i=r.createComponent(t.component,{index:r.length,injector:t.injector||r.injector,projectableNodes:t.projectableNodes||void 0,ngModuleRef:this._moduleRef||void 0});return r!==this._viewContainerRef&&this._getRootNode().appendChild(i.hostView.rootNodes[0]),super.setDisposeFn(()=>i.destroy()),this._attachedPortal=t,this._attachedRef=i,this.attached.emit(i),i}attachTemplatePortal(t){t.setAttachedHost(this);const r=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context,{injector:t.injector});return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=t,this._attachedRef=r,this.attached.emit(r),r}attachDomPortal=t=>{const r=t.element,i=this._document.createComment("dom-portal");t.setAttachedHost(this),r.parentNode.insertBefore(i,r),this._getRootNode().appendChild(r),this._attachedPortal=t,super.setDisposeFn(()=>{i.parentNode&&i.parentNode.replaceChild(r,i)})};_getRootNode(){const t=this._viewContainerRef.element.nativeElement;return t.nodeType===t.ELEMENT_NODE?t:t.parentNode}static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:[0,"cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[ke]})}return n})(),Y1e=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({})}return n})();const T_={schedule(n){let e=requestAnimationFrame,t=cancelAnimationFrame;const{delegate:r}=T_;r&&(e=r.requestAnimationFrame,t=r.cancelAnimationFrame);const i=e(o=>{t=void 0,n(o)});return new Kt(()=>t?.(i))},requestAnimationFrame(...n){const{delegate:e}=T_;return(e?.requestAnimationFrame||requestAnimationFrame)(...n)},cancelAnimationFrame(...n){const{delegate:e}=T_;return(e?.cancelAnimationFrame||cancelAnimationFrame)(...n)},delegate:void 0};new class Z1e extends Uw{flush(e){let t;this._active=!0,e?t=e.id:(t=this._scheduled,this._scheduled=void 0);const{actions:r}=this;let i;e=e||r.shift();do{if(i=e.execute(e.state,e.delay))break}while((e=r[0])&&e.id===t&&r.shift());if(this._active=!1,i){for(;(e=r[0])&&e.id===t&&r.shift();)e.unsubscribe();throw i}}}(class X1e extends Bw{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}requestAsyncId(e,t,r=0){return null!==r&&r>0?super.requestAsyncId(e,t,r):(e.actions.push(this),e._scheduled||(e._scheduled=T_.requestAnimationFrame(()=>e.flush(void 0))))}recycleAsyncId(e,t,r=0){var i;if(null!=r?r>0:this.delay>0)return super.recycleAsyncId(e,t,r);const{actions:o}=e;null!=t&&t===e._scheduled&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==t&&(T_.cancelAnimationFrame(t),e._scheduled=void 0)}});let iO,eNe=1;const YI={};function bQ(n){return n in YI&&(delete YI[n],!0)}const tNe={setImmediate(n){const e=eNe++;return YI[e]=!0,iO||(iO=Promise.resolve()),iO.then(()=>bQ(e)&&n()),e},clearImmediate(n){bQ(n)}},{setImmediate:nNe,clearImmediate:rNe}=tNe,XI={setImmediate(...n){const{delegate:e}=XI;return(e?.setImmediate||nNe)(...n)},clearImmediate(n){const{delegate:e}=XI;return(e?.clearImmediate||rNe)(n)},delegate:void 0};new class oNe extends Uw{flush(e){this._active=!0;const t=this._scheduled;this._scheduled=void 0;const{actions:r}=this;let i;e=e||r.shift();do{if(i=e.execute(e.state,e.delay))break}while((e=r[0])&&e.id===t&&r.shift());if(this._active=!1,i){for(;(e=r[0])&&e.id===t&&r.shift();)e.unsubscribe();throw i}}}(class iNe extends Bw{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}requestAsyncId(e,t,r=0){return null!==r&&r>0?super.requestAsyncId(e,t,r):(e.actions.push(this),e._scheduled||(e._scheduled=XI.setImmediate(e.flush.bind(e,void 0))))}recycleAsyncId(e,t,r=0){var i;if(null!=r?r>0:this.delay>0)return super.recycleAsyncId(e,t,r);const{actions:o}=e;null!=t&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==t&&(XI.clearImmediate(t),e._scheduled===t&&(e._scheduled=void 0))}});function wQ(n,e=zw){return function aNe(n){return Jt((e,t)=>{let r=!1,i=null,o=null,s=!1;const a=()=>{if(o?.unsubscribe(),o=null,r){r=!1;const c=i;i=null,t.next(c)}s&&t.complete()},l=()=>{o=null,s&&t.complete()};e.subscribe(zt(t,c=>{r=!0,i=c,o||oi(n(c)).subscribe(o=zt(t,a,l))},()=>{s=!0,(!r||!o||o.closed)&&t.complete()}))})}(()=>function cNe(n=0,e,t=IEe){let r=-1;return null!=e&&(x4(e)?t=e:r=e),new vt(i=>{let o=function lNe(n){return n instanceof Date&&!isNaN(n)}(n)?+n-t.now():n;o<0&&(o=0);let s=0;return t.schedule(function(){i.closed||(i.next(s++),0<=r?this.schedule(void 0,r):i.complete())},o)})}(n,e))}let EQ=(()=>{class n{_ngZone=b(ue);_platform=b(rr);_renderer=b(Aa).createRenderer(null,null);_cleanupGlobalListener;constructor(){}_scrolled=new fe;_scrolledCount=0;scrollContainers=new Map;register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){const r=this.scrollContainers.get(t);r&&(r.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=20){return this._platform.isBrowser?new vt(r=>{this._cleanupGlobalListener||(this._cleanupGlobalListener=this._ngZone.runOutsideAngular(()=>this._renderer.listen("document","scroll",()=>this._scrolled.next())));const i=t>0?this._scrolled.pipe(wQ(t)).subscribe(r):this._scrolled.subscribe(r);return this._scrolledCount++,()=>{i.unsubscribe(),this._scrolledCount--,this._scrolledCount||(this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0)}}):de()}ngOnDestroy(){this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0,this.scrollContainers.forEach((t,r)=>this.deregister(r)),this._scrolled.complete()}ancestorScrolled(t,r){const i=this.getAncestorScrollContainers(t);return this.scrolled(r).pipe(si(o=>!o||i.indexOf(o)>-1))}getAncestorScrollContainers(t){const r=[];return this.scrollContainers.forEach((i,o)=>{this._scrollableContainsElement(o,t)&&r.push(o)}),r}_scrollableContainsElement(t,r){let i=Ya(r),o=t.getElementRef().nativeElement;do{if(i==o)return!0}while(i=i.parentElement);return!1}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),IQ=(()=>{class n{_platform=b(rr);_listeners;_viewportSize;_change=new fe;_document=b(Xe,{optional:!0});constructor(){const t=b(ue),r=b(Aa).createRenderer(null,null);t.runOutsideAngular(()=>{if(this._platform.isBrowser){const i=o=>this._change.next(o);this._listeners=[r.listen("window","resize",i),r.listen("window","orientationchange",i)]}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){this._listeners?.forEach(t=>t()),this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();const t={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),t}getViewportRect(){const t=this.getViewportScrollPosition(),{width:r,height:i}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+i,right:t.left+r,height:i,width:r}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const t=this._document,r=this._getWindow(),i=t.documentElement,o=i.getBoundingClientRect();return{top:-o.top||t.body.scrollTop||r.scrollY||i.scrollTop||0,left:-o.left||t.body.scrollLeft||r.scrollX||i.scrollLeft||0}}change(t=20){return t>0?this._change.pipe(wQ(t)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){const t=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:t.innerWidth,height:t.innerHeight}:{width:0,height:0}}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),oO=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({})}return n})(),TQ=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[Km,oO,Km,oO]})}return n})();const CQ=tEe();class hNe{_viewportRuler;_previousHTMLStyles={top:"",left:""};_previousScrollPosition;_isEnabled=!1;_document;constructor(e,t){this._viewportRuler=e,this._document=t}attach(){}enable(){if(this._canBeEnabled()){const e=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=e.style.left||"",this._previousHTMLStyles.top=e.style.top||"",e.style.left=xn(-this._previousScrollPosition.left),e.style.top=xn(-this._previousScrollPosition.top),e.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const e=this._document.documentElement,r=e.style,i=this._document.body.style,o=r.scrollBehavior||"",s=i.scrollBehavior||"";this._isEnabled=!1,r.left=this._previousHTMLStyles.left,r.top=this._previousHTMLStyles.top,e.classList.remove("cdk-global-scrollblock"),CQ&&(r.scrollBehavior=i.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),CQ&&(r.scrollBehavior=o,i.scrollBehavior=s)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const t=this._document.body,r=this._viewportRuler.getViewportSize();return t.scrollHeight>r.height||t.scrollWidth>r.width}}class fNe{_scrollDispatcher;_ngZone;_viewportRuler;_config;_scrollSubscription=null;_overlayRef;_initialScrollPosition;constructor(e,t,r,i){this._scrollDispatcher=e,this._ngZone=t,this._viewportRuler=r,this._config=i}attach(e){this._overlayRef=e}enable(){if(this._scrollSubscription)return;const e=this._scrollDispatcher.scrolled(0).pipe(si(t=>!t||!this._overlayRef.overlayElement.contains(t.getElementRef().nativeElement)));this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=e.subscribe(()=>{const t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=e.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}_detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}class xQ{enable(){}disable(){}attach(){}}function sO(n,e){return e.some(t=>n.bottomt.bottom||n.rightt.right)}function SQ(n,e){return e.some(t=>n.topt.bottom||n.leftt.right)}class pNe{_scrollDispatcher;_viewportRuler;_ngZone;_config;_scrollSubscription=null;_overlayRef;constructor(e,t,r,i){this._scrollDispatcher=e,this._viewportRuler=t,this._ngZone=r,this._config=i}attach(e){this._overlayRef=e}enable(){this._scrollSubscription||(this._scrollSubscription=this._scrollDispatcher.scrolled(this._config?this._config.scrollThrottle:0).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){const t=this._overlayRef.overlayElement.getBoundingClientRect(),{width:r,height:i}=this._viewportRuler.getViewportSize();sO(t,[{width:r,height:i,bottom:i,right:r,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}}))}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}let mNe=(()=>{class n{_scrollDispatcher=b(EQ);_viewportRuler=b(IQ);_ngZone=b(ue);_document=b(Xe);constructor(){}noop=()=>new xQ;close=t=>new fNe(this._scrollDispatcher,this._ngZone,this._viewportRuler,t);block=()=>new hNe(this._viewportRuler,this._document);reposition=t=>new pNe(this._scrollDispatcher,this._viewportRuler,this._ngZone,t);static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();class DQ{positionStrategy;scrollStrategy=new xQ;panelClass="";hasBackdrop=!1;backdropClass="cdk-overlay-dark-backdrop";width;height;minWidth;minHeight;maxWidth;maxHeight;direction;disposeOnNavigation=!1;constructor(e){if(e){const t=Object.keys(e);for(const r of t)void 0!==e[r]&&(this[r]=e[r])}}}class gNe{connectionPair;scrollableViewProperties;constructor(e,t){this.connectionPair=e,this.scrollableViewProperties=t}}let AQ=(()=>{class n{_attachedOverlays=[];_document=b(Xe);_isAttached;constructor(){}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){const r=this._attachedOverlays.indexOf(t);r>-1&&this._attachedOverlays.splice(r,1),0===this._attachedOverlays.length&&this.detach()}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),_Ne=(()=>{class n extends AQ{_ngZone=b(ue);_renderer=b(Aa).createRenderer(null,null);_cleanupKeydown;add(t){super.add(t),this._isAttached||(this._ngZone.runOutsideAngular(()=>{this._cleanupKeydown=this._renderer.listen("body","keydown",this._keydownListener)}),this._isAttached=!0)}detach(){this._isAttached&&(this._cleanupKeydown?.(),this._isAttached=!1)}_keydownListener=t=>{const r=this._attachedOverlays;for(let i=r.length-1;i>-1;i--)if(r[i]._keydownEvents.observers.length>0){this._ngZone.run(()=>r[i]._keydownEvents.next(t));break}};static \u0275fac=(()=>{let t;return function(i){return(t||(t=bt(n)))(i||n)}})();static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),yNe=(()=>{class n extends AQ{_platform=b(rr);_ngZone=b(ue,{optional:!0});_cursorOriginalValue;_cursorStyleIsSet=!1;_pointerDownEventTarget;add(t){if(super.add(t),!this._isAttached){const r=this._document.body;this._ngZone?this._ngZone.runOutsideAngular(()=>this._addEventListeners(r)):this._addEventListeners(r),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=r.style.cursor,r.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){if(this._isAttached){const t=this._document.body;t.removeEventListener("pointerdown",this._pointerDownListener,!0),t.removeEventListener("click",this._clickListener,!0),t.removeEventListener("auxclick",this._clickListener,!0),t.removeEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&this._cursorStyleIsSet&&(t.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1}}_addEventListeners(t){t.addEventListener("pointerdown",this._pointerDownListener,!0),t.addEventListener("click",this._clickListener,!0),t.addEventListener("auxclick",this._clickListener,!0),t.addEventListener("contextmenu",this._clickListener,!0)}_pointerDownListener=t=>{this._pointerDownEventTarget=ks(t)};_clickListener=t=>{const r=ks(t),i="click"===t.type&&this._pointerDownEventTarget?this._pointerDownEventTarget:r;this._pointerDownEventTarget=null;const o=this._attachedOverlays.slice();for(let s=o.length-1;s>-1;s--){const a=o[s];if(a._outsidePointerEvents.observers.length<1||!a.hasAttached())continue;if(RQ(a.overlayElement,r)||RQ(a.overlayElement,i))break;const l=a._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>l.next(t)):l.next(t)}};static \u0275fac=(()=>{let t;return function(i){return(t||(t=bt(n)))(i||n)}})();static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function RQ(n,e){const t=typeof ShadowRoot<"u"&&ShadowRoot;let r=e;for(;r;){if(r===n)return!0;r=t&&r instanceof ShadowRoot?r.host:r.parentNode}return!1}let MQ=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["ng-component"]],hostAttrs:["cdk-overlay-style-loader",""],decls:0,vars:0,template:function(r,i){},styles:[".cdk-overlay-container,.cdk-global-overlay-wrapper{pointer-events:none;top:0;left:0;height:100%;width:100%}.cdk-overlay-container{position:fixed}@layer cdk-overlay{.cdk-overlay-container{z-index:1000}}.cdk-overlay-container:empty{display:none}.cdk-global-overlay-wrapper{display:flex;position:absolute}@layer cdk-overlay{.cdk-global-overlay-wrapper{z-index:1000}}.cdk-overlay-pane{position:absolute;pointer-events:auto;box-sizing:border-box;display:flex;max-width:100%;max-height:100%}@layer cdk-overlay{.cdk-overlay-pane{z-index:1000}}.cdk-overlay-backdrop{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:auto;-webkit-tap-highlight-color:rgba(0,0,0,0);opacity:0}@layer cdk-overlay{.cdk-overlay-backdrop{z-index:1000;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}}.cdk-overlay-backdrop-showing{opacity:1}@media(forced-colors: active){.cdk-overlay-backdrop-showing{opacity:.6}}@layer cdk-overlay{.cdk-overlay-dark-backdrop{background:rgba(0,0,0,.32)}}.cdk-overlay-transparent-backdrop{transition:visibility 1ms linear,opacity 1ms linear;visibility:hidden;opacity:1}.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing,.cdk-high-contrast-active .cdk-overlay-transparent-backdrop{opacity:0;visibility:visible}.cdk-overlay-backdrop-noop-animation{transition:none}.cdk-overlay-connected-position-bounding-box{position:absolute;display:flex;flex-direction:column;min-width:1px;min-height:1px}@layer cdk-overlay{.cdk-overlay-connected-position-bounding-box{z-index:1000}}.cdk-global-scrollblock{position:fixed;width:100%;overflow-y:scroll}"],encapsulation:2,changeDetection:0})}return n})(),kQ=(()=>{class n{_platform=b(rr);_containerElement;_document=b(Xe);_styleLoader=b(Ka);constructor(){}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._loadStyles(),this._containerElement||this._createContainer(),this._containerElement}_createContainer(){const t="cdk-overlay-container";if(this._platform.isBrowser||z5()){const i=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let o=0;o{const e=this.element;clearTimeout(this._fallbackTimeout),this._cleanupTransitionEnd?.(),this._cleanupTransitionEnd=this._renderer.listen(e,"transitionend",this.dispose),this._fallbackTimeout=setTimeout(this.dispose,500),e.style.pointerEvents="none",e.classList.remove("cdk-overlay-backdrop-showing")})}dispose=()=>{clearTimeout(this._fallbackTimeout),this._cleanupClick?.(),this._cleanupTransitionEnd?.(),this._cleanupClick=this._cleanupTransitionEnd=this._fallbackTimeout=void 0,this.element.remove()}}class bNe{_portalOutlet;_host;_pane;_config;_ngZone;_keyboardDispatcher;_document;_location;_outsideClickDispatcher;_animationsDisabled;_injector;_renderer;_backdropClick=new fe;_attachments=new fe;_detachments=new fe;_positionStrategy;_scrollStrategy;_locationChanges=Kt.EMPTY;_backdropRef=null;_previousHostParent;_keydownEvents=new fe;_outsidePointerEvents=new fe;_renders=new fe;_afterRenderRef;_afterNextRenderRef;constructor(e,t,r,i,o,s,a,l,c,u=!1,d,f){this._portalOutlet=e,this._host=t,this._pane=r,this._config=i,this._ngZone=o,this._keyboardDispatcher=s,this._document=a,this._location=l,this._outsideClickDispatcher=c,this._animationsDisabled=u,this._injector=d,this._renderer=f,i.scrollStrategy&&(this._scrollStrategy=i.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=i.positionStrategy,this._afterRenderRef=Wn(()=>ex(()=>{this._renders.next()},{injector:this._injector}))}get overlayElement(){return this._pane}get backdropElement(){return this._backdropRef?.element||null}get hostElement(){return this._host}attach(e){!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host);const t=this._portalOutlet.attach(e);return this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._afterNextRenderRef?.destroy(),this._afterNextRenderRef=Cs(()=>{this.hasAttached()&&this.updatePosition()},{injector:this._injector}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),"function"==typeof t?.onDestroy&&t.onDestroy(()=>{this.hasAttached()&&this._ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>this.detach()))}),t}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const e=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenEmpty(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),e}dispose(){const e=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this._backdropRef?.dispose(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host?.remove(),this._afterNextRenderRef?.destroy(),this._previousHostParent=this._pane=this._host=this._backdropRef=null,e&&this._detachments.next(),this._detachments.complete(),this._afterRenderRef.destroy(),this._renders.complete()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(e){e!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=e,this.hasAttached()&&(e.attach(this),this.updatePosition()))}updateSize(e){this._config={...this._config,...e},this._updateElementSize()}setDirection(e){this._config={...this._config,direction:e},this._updateElementDirection()}addPanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!0)}removePanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!1)}getDirection(){const e=this._config.direction;return e?"string"==typeof e?e:e.value:"ltr"}updateScrollStrategy(e){e!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=e,this.hasAttached()&&(e.attach(this),e.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const e=this._pane.style;e.width=xn(this._config.width),e.height=xn(this._config.height),e.minWidth=xn(this._config.minWidth),e.minHeight=xn(this._config.minHeight),e.maxWidth=xn(this._config.maxWidth),e.maxHeight=xn(this._config.maxHeight)}_togglePointerEvents(e){this._pane.style.pointerEvents=e?"":"none"}_attachBackdrop(){const e="cdk-overlay-backdrop-showing";this._backdropRef?.dispose(),this._backdropRef=new vNe(this._document,this._renderer,this._ngZone,t=>{this._backdropClick.next(t)}),this._animationsDisabled&&this._backdropRef.element.classList.add("cdk-overlay-backdrop-noop-animation"),this._config.backdropClass&&this._toggleClasses(this._backdropRef.element,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropRef.element,this._host),!this._animationsDisabled&&typeof requestAnimationFrame<"u"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>this._backdropRef?.element.classList.add(e))}):this._backdropRef.element.classList.add(e)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){this._animationsDisabled?(this._backdropRef?.dispose(),this._backdropRef=null):this._backdropRef?.detach()}_toggleClasses(e,t,r){const i=jw(t||[]).filter(o=>!!o);i.length&&(r?e.classList.add(...i):e.classList.remove(...i))}_detachContentWhenEmpty(){this._ngZone.runOutsideAngular(()=>{const e=this._renders.pipe(At(Ym(this._attachments,this._detachments))).subscribe(()=>{(!this._pane||!this._host||0===this._pane.children.length)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._host.remove()),e.unsubscribe())})})}_disposeScrollStrategy(){const e=this._scrollStrategy;e?.disable(),e?.detach?.()}}const NQ="cdk-overlay-connected-position-bounding-box",wNe=/([A-Za-z%]+)$/;class ENe{_viewportRuler;_document;_platform;_overlayContainer;_overlayRef;_isInitialRender;_lastBoundingBoxSize={width:0,height:0};_isPushed=!1;_canPush=!0;_growAfterOpen=!1;_hasFlexibleDimensions=!0;_positionLocked=!1;_originRect;_overlayRect;_viewportRect;_containerRect;_viewportMargin=0;_scrollables=[];_preferredPositions=[];_origin;_pane;_isDisposed;_boundingBox;_lastPosition;_lastScrollVisibility;_positionChanges=new fe;_resizeSubscription=Kt.EMPTY;_offsetX=0;_offsetY=0;_transformOriginSelector;_appliedPanelClasses=[];_previousPushAmount;positionChanges=this._positionChanges;get positions(){return this._preferredPositions}constructor(e,t,r,i,o){this._viewportRuler=t,this._document=r,this._platform=i,this._overlayContainer=o,this.setOrigin(e)}attach(e){this._validatePositions(),e.hostElement.classList.add(NQ),this._overlayRef=e,this._boundingBox=e.hostElement,this._pane=e.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition)return void this.reapplyLastPosition();this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();const e=this._originRect,t=this._overlayRect,r=this._viewportRect,i=this._containerRect,o=[];let s;for(let a of this._preferredPositions){let l=this._getOriginPoint(e,i,a),c=this._getOverlayPoint(l,t,a),u=this._getOverlayFit(c,t,r,a);if(u.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(a,l);this._canFitWithFlexibleDimensions(u,c,r)?o.push({position:a,origin:l,overlayRect:t,boundingBoxRect:this._calculateBoundingBoxRect(l,a)}):(!s||s.overlayFit.visibleAreal&&(l=u,a=c)}return this._isPushed=!1,void this._applyPosition(a.position,a.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(s.position,s.originPoint);this._applyPosition(s.position,s.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&fu(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(NQ),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(this._isDisposed||!this._platform.isBrowser)return;const e=this._lastPosition;if(e){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();const t=this._getOriginPoint(this._originRect,this._containerRect,e);this._applyPosition(e,t)}else this.apply()}withScrollableContainers(e){return this._scrollables=e,this}withPositions(e){return this._preferredPositions=e,-1===e.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(e){return this._viewportMargin=e,this}withFlexibleDimensions(e=!0){return this._hasFlexibleDimensions=e,this}withGrowAfterOpen(e=!0){return this._growAfterOpen=e,this}withPush(e=!0){return this._canPush=e,this}withLockedPosition(e=!0){return this._positionLocked=e,this}setOrigin(e){return this._origin=e,this}withDefaultOffsetX(e){return this._offsetX=e,this}withDefaultOffsetY(e){return this._offsetY=e,this}withTransformOriginOn(e){return this._transformOriginSelector=e,this}_getOriginPoint(e,t,r){let i,o;if("center"==r.originX)i=e.left+e.width/2;else{const s=this._isRtl()?e.right:e.left,a=this._isRtl()?e.left:e.right;i="start"==r.originX?s:a}return t.left<0&&(i-=t.left),o="center"==r.originY?e.top+e.height/2:"top"==r.originY?e.top:e.bottom,t.top<0&&(o-=t.top),{x:i,y:o}}_getOverlayPoint(e,t,r){let i,o;return i="center"==r.overlayX?-t.width/2:"start"===r.overlayX?this._isRtl()?-t.width:0:this._isRtl()?0:-t.width,o="center"==r.overlayY?-t.height/2:"top"==r.overlayY?0:-t.height,{x:e.x+i,y:e.y+o}}_getOverlayFit(e,t,r,i){const o=OQ(t);let{x:s,y:a}=e,l=this._getOffset(i,"x"),c=this._getOffset(i,"y");l&&(s+=l),c&&(a+=c);let f=0-a,p=a+o.height-r.height,m=this._subtractOverflows(o.width,0-s,s+o.width-r.width),_=this._subtractOverflows(o.height,f,p),v=m*_;return{visibleArea:v,isCompletelyWithinViewport:o.width*o.height===v,fitsInViewportVertically:_===o.height,fitsInViewportHorizontally:m==o.width}}_canFitWithFlexibleDimensions(e,t,r){if(this._hasFlexibleDimensions){const i=r.bottom-t.y,o=r.right-t.x,s=PQ(this._overlayRef.getConfig().minHeight),a=PQ(this._overlayRef.getConfig().minWidth);return(e.fitsInViewportVertically||null!=s&&s<=i)&&(e.fitsInViewportHorizontally||null!=a&&a<=o)}return!1}_pushOverlayOnScreen(e,t,r){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};const i=OQ(t),o=this._viewportRect,s=Math.max(e.x+i.width-o.width,0),a=Math.max(e.y+i.height-o.height,0),l=Math.max(o.top-r.top-e.y,0),c=Math.max(o.left-r.left-e.x,0);let u=0,d=0;return u=i.width<=o.width?c||-s:e.xm&&!this._isInitialRender&&!this._growAfterOpen&&(s=e.y-m/2)}if("end"===t.overlayX&&!i||"start"===t.overlayX&&i)f=r.width-e.x+2*this._viewportMargin,u=e.x-this._viewportMargin;else if("start"===t.overlayX&&!i||"end"===t.overlayX&&i)d=e.x,u=r.right-e.x;else{const p=Math.min(r.right-e.x+r.left,e.x),m=this._lastBoundingBoxSize.width;u=2*p,d=e.x-p,u>m&&!this._isInitialRender&&!this._growAfterOpen&&(d=e.x-m/2)}return{top:s,left:d,bottom:a,right:f,width:u,height:o}}_setBoundingBoxStyles(e,t){const r=this._calculateBoundingBoxRect(e,t);!this._isInitialRender&&!this._growAfterOpen&&(r.height=Math.min(r.height,this._lastBoundingBoxSize.height),r.width=Math.min(r.width,this._lastBoundingBoxSize.width));const i={};if(this._hasExactPosition())i.top=i.left="0",i.bottom=i.right=i.maxHeight=i.maxWidth="",i.width=i.height="100%";else{const o=this._overlayRef.getConfig().maxHeight,s=this._overlayRef.getConfig().maxWidth;i.height=xn(r.height),i.top=xn(r.top),i.bottom=xn(r.bottom),i.width=xn(r.width),i.left=xn(r.left),i.right=xn(r.right),i.alignItems="center"===t.overlayX?"center":"end"===t.overlayX?"flex-end":"flex-start",i.justifyContent="center"===t.overlayY?"center":"bottom"===t.overlayY?"flex-end":"flex-start",o&&(i.maxHeight=xn(o)),s&&(i.maxWidth=xn(s))}this._lastBoundingBoxSize=r,fu(this._boundingBox.style,i)}_resetBoundingBoxStyles(){fu(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){fu(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(e,t){const r={},i=this._hasExactPosition(),o=this._hasFlexibleDimensions,s=this._overlayRef.getConfig();if(i){const u=this._viewportRuler.getViewportScrollPosition();fu(r,this._getExactOverlayY(t,e,u)),fu(r,this._getExactOverlayX(t,e,u))}else r.position="static";let a="",l=this._getOffset(t,"x"),c=this._getOffset(t,"y");l&&(a+=`translateX(${l}px) `),c&&(a+=`translateY(${c}px)`),r.transform=a.trim(),s.maxHeight&&(i?r.maxHeight=xn(s.maxHeight):o&&(r.maxHeight="")),s.maxWidth&&(i?r.maxWidth=xn(s.maxWidth):o&&(r.maxWidth="")),fu(this._pane.style,r)}_getExactOverlayY(e,t,r){let i={top:"",bottom:""},o=this._getOverlayPoint(t,this._overlayRect,e);return this._isPushed&&(o=this._pushOverlayOnScreen(o,this._overlayRect,r)),"bottom"===e.overlayY?i.bottom=this._document.documentElement.clientHeight-(o.y+this._overlayRect.height)+"px":i.top=xn(o.y),i}_getExactOverlayX(e,t,r){let s,i={left:"",right:""},o=this._getOverlayPoint(t,this._overlayRect,e);return this._isPushed&&(o=this._pushOverlayOnScreen(o,this._overlayRect,r)),s=this._isRtl()?"end"===e.overlayX?"left":"right":"end"===e.overlayX?"right":"left","right"===s?i.right=this._document.documentElement.clientWidth-(o.x+this._overlayRect.width)+"px":i.left=xn(o.x),i}_getScrollVisibility(){const e=this._getOriginRect(),t=this._pane.getBoundingClientRect(),r=this._scrollables.map(i=>i.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:SQ(e,r),isOriginOutsideView:sO(e,r),isOverlayClipped:SQ(t,r),isOverlayOutsideView:sO(t,r)}}_subtractOverflows(e,...t){return t.reduce((r,i)=>r-Math.max(i,0),e)}_getNarrowedViewportRect(){const e=this._document.documentElement.clientWidth,t=this._document.documentElement.clientHeight,r=this._viewportRuler.getViewportScrollPosition();return{top:r.top+this._viewportMargin,left:r.left+this._viewportMargin,right:r.left+e-this._viewportMargin,bottom:r.top+t-this._viewportMargin,width:e-2*this._viewportMargin,height:t-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(e,t){return"x"===t?null==e.offsetX?this._offsetX:e.offsetX:null==e.offsetY?this._offsetY:e.offsetY}_validatePositions(){}_addPanelClasses(e){this._pane&&jw(e).forEach(t=>{""!==t&&-1===this._appliedPanelClasses.indexOf(t)&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(e=>{this._pane.classList.remove(e)}),this._appliedPanelClasses=[])}_getOriginRect(){const e=this._origin;if(e instanceof je)return e.nativeElement.getBoundingClientRect();if(e instanceof Element)return e.getBoundingClientRect();const t=e.width||0,r=e.height||0;return{top:e.y,bottom:e.y+r,left:e.x,right:e.x+t,height:r,width:t}}}function fu(n,e){for(let t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function PQ(n){if("number"!=typeof n&&null!=n){const[e,t]=n.split(wNe);return t&&"px"!==t?null:parseFloat(e)}return n||null}function OQ(n){return{top:Math.floor(n.top),right:Math.floor(n.right),bottom:Math.floor(n.bottom),left:Math.floor(n.left),width:Math.floor(n.width),height:Math.floor(n.height)}}const FQ="cdk-global-overlay-wrapper";class TNe{_overlayRef;_cssPosition="static";_topOffset="";_bottomOffset="";_alignItems="";_xPosition="";_xOffset="";_width="";_height="";_isDisposed=!1;attach(e){const t=e.getConfig();this._overlayRef=e,this._width&&!t.width&&e.updateSize({width:this._width}),this._height&&!t.height&&e.updateSize({height:this._height}),e.hostElement.classList.add(FQ),this._isDisposed=!1}top(e=""){return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}left(e=""){return this._xOffset=e,this._xPosition="left",this}bottom(e=""){return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}right(e=""){return this._xOffset=e,this._xPosition="right",this}start(e=""){return this._xOffset=e,this._xPosition="start",this}end(e=""){return this._xOffset=e,this._xPosition="end",this}width(e=""){return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}height(e=""){return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}centerHorizontally(e=""){return this.left(e),this._xPosition="center",this}centerVertically(e=""){return this.top(e),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,r=this._overlayRef.getConfig(),{width:i,height:o,maxWidth:s,maxHeight:a}=r,l=!("100%"!==i&&"100vw"!==i||s&&"100%"!==s&&"100vw"!==s),c=!("100%"!==o&&"100vh"!==o||a&&"100%"!==a&&"100vh"!==a),u=this._xPosition,d=this._xOffset,f="rtl"===this._overlayRef.getConfig().direction;let p="",m="",_="";l?_="flex-start":"center"===u?(_="center",f?m=d:p=d):f?"left"===u||"end"===u?(_="flex-end",p=d):("right"===u||"start"===u)&&(_="flex-start",m=d):"left"===u||"start"===u?(_="flex-start",p=d):("right"===u||"end"===u)&&(_="flex-end",m=d),e.position=this._cssPosition,e.marginLeft=l?"0":p,e.marginTop=c?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=l?"0":m,t.justifyContent=_,t.alignItems=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,r=t.style;t.classList.remove(FQ),r.justifyContent=r.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}}let CNe=(()=>{class n{_viewportRuler=b(IQ);_document=b(Xe);_platform=b(rr);_overlayContainer=b(kQ);constructor(){}global(){return new TNe}flexibleConnectedTo(t){return new ENe(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),pu=(()=>{class n{scrollStrategies=b(mNe);_overlayContainer=b(kQ);_positionBuilder=b(CNe);_keyboardDispatcher=b(_Ne);_injector=b(ze);_ngZone=b(ue);_document=b(Xe);_directionality=b(Gw);_location=b(qd);_outsideClickDispatcher=b(yNe);_animationsModuleType=b(Ts,{optional:!0});_idGenerator=b(Xa);_renderer=b(Aa).createRenderer(null,null);_appRef;_styleLoader=b(Ka);constructor(){}create(t){this._styleLoader.load(MQ);const r=this._createHostElement(),i=this._createPaneElement(r),o=this._createPortalOutlet(i),s=new DQ(t);return s.direction=s.direction||this._directionality.value,new bNe(o,r,i,s,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher,"NoopAnimations"===this._animationsModuleType,this._injector.get(mr),this._renderer)}position(){return this._positionBuilder}_createPaneElement(t){const r=this._document.createElement("div");return r.id=this._idGenerator.getId("cdk-overlay-"),r.classList.add("cdk-overlay-pane"),t.appendChild(r),r}_createHostElement(){const t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(tr)),new Q1e(t,null,this._appRef,this._injector,this._document)}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const DNe={provide:new B("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{const n=b(pu);return()=>n.scrollStrategies.reposition()}}),deps:[pu],useFactory:function SNe(n){return()=>n.scrollStrategies.reposition()}};let ANe=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({providers:[pu,DNe],imports:[Km,Y1e,TQ,TQ]})}return n})();function RNe(n,e){if(1&n){const t=La();W(0,"div",1)(1,"button",2),Ve("click",function(){return vi(t),bi(Ln().action())}),Oe(2),K()()}if(2&n){const t=Ln();re(2),Va(" ",t.data.action," ")}}const MNe=["label"];function kNe(n,e){}const NNe=Math.pow(2,31)-1;class aO{_overlayRef;instance;containerInstance;_afterDismissed=new fe;_afterOpened=new fe;_onAction=new fe;_durationTimeoutId;_dismissedByAction=!1;constructor(e,t){this._overlayRef=t,this.containerInstance=e,e._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete(),this.dismiss()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(e){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(e,NNe))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}}const LQ=new B("MatSnackBarData");class ZI{politeness="assertive";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"}let VQ=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return n})(),BQ=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return n})(),UQ=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return n})(),PNe=(()=>{class n{snackBarRef=b(aO);data=b(LQ);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["mat-button","","matSnackBarAction","",3,"click"]],template:function(r,i){1&r&&(W(0,"div",0),Oe(1),K(),et(2,RNe,3,1,"div",1)),2&r&&(re(),Va(" ",i.data.message,"\n"),re(),Pt(i.hasAction?2:-1))},dependencies:[dh,VQ,BQ,UQ],styles:[".mat-mdc-simple-snack-bar{display:flex}"],encapsulation:2,changeDetection:0})}return n})();const ONe={snackBarState:aR("state",[Zm("void, hidden",Ps({transform:"scale(0.8)",opacity:0})),Zm("visible",Ps({transform:"scale(1)",opacity:1})),Jm("* => visible",Xm("150ms cubic-bezier(0, 0, 0.2, 1)")),Jm("* => void, * => hidden",Xm("75ms cubic-bezier(0.4, 0.0, 1, 1)",Ps({opacity:0})))])};let zQ=(()=>{class n extends rO{_ngZone=b(ue);_elementRef=b(je);_changeDetectorRef=b(Uo);_platform=b(rr);snackBarConfig=b(ZI);_document=b(Xe);_trackedModals=new Set;_announceDelay=150;_announceTimeoutId;_destroyed=!1;_portalOutlet;_onAnnounce=new fe;_onExit=new fe;_onEnter=new fe;_animationState="void";_live;_label;_role;_liveElementId=b(Xa).getId("mat-snack-bar-container-live-");constructor(){super();const t=this.snackBarConfig;this._live="assertive"!==t.politeness||t.announcementMessage?"off"===t.politeness?"off":"polite":"assertive",this._platform.FIREFOX&&("polite"===this._live&&(this._role="status"),"assertive"===this._live&&(this._role="alert"))}attachComponentPortal(t){this._assertNotAttached();const r=this._portalOutlet.attachComponentPortal(t);return this._afterPortalAttached(),r}attachTemplatePortal(t){this._assertNotAttached();const r=this._portalOutlet.attachTemplatePortal(t);return this._afterPortalAttached(),r}attachDomPortal=t=>{this._assertNotAttached();const r=this._portalOutlet.attachDomPortal(t);return this._afterPortalAttached(),r};onAnimationEnd(t){const{fromState:r,toState:i}=t;if(("void"===i&&"void"!==r||"hidden"===i)&&this._completeExit(),"visible"===i){const o=this._onEnter;this._ngZone.run(()=>{o.next(),o.complete()})}}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.markForCheck(),this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce())}exit(){return this._ngZone.run(()=>{this._animationState="hidden",this._changeDetectorRef.markForCheck(),this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId)}),this._onExit}ngOnDestroy(){this._destroyed=!0,this._clearFromModals(),this._completeExit()}_completeExit(){queueMicrotask(()=>{this._onExit.next(),this._onExit.complete()})}_afterPortalAttached(){const t=this._elementRef.nativeElement,r=this.snackBarConfig.panelClass;r&&(Array.isArray(r)?r.forEach(s=>t.classList.add(s)):t.classList.add(r)),this._exposeToModals();const i=this._label.nativeElement,o="mdc-snackbar__label";i.classList.toggle(o,!i.querySelector(`.${o}`))}_exposeToModals(){const t=this._liveElementId,r=this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');for(let i=0;i{const r=t.getAttribute("aria-owns");if(r){const i=r.replace(this._liveElementId,"").trim();i.length>0?t.setAttribute("aria-owns",i):t.removeAttribute("aria-owns")}}),this._trackedModals.clear()}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{const t=this._elementRef.nativeElement.querySelector("[aria-hidden]"),r=this._elementRef.nativeElement.querySelector("[aria-live]");if(t&&r){let i=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&t.contains(document.activeElement)&&(i=document.activeElement),t.removeAttribute("aria-hidden"),r.appendChild(t),i?.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-snack-bar-container"]],viewQuery:function(r,i){if(1&r&&(qn(vQ,7),qn(MNe,7)),2&r){let o;Qe(o=Ye())&&(i._portalOutlet=o.first),Qe(o=Ye())&&(i._label=o.first)}},hostAttrs:[1,"mdc-snackbar","mat-mdc-snack-bar-container"],hostVars:1,hostBindings:function(r,i){1&r&&GS("@state.done",function(s){return i.onAnimationEnd(s)}),2&r&&$S("@state",i._animationState)},features:[ke],decls:6,vars:3,consts:[["label",""],[1,"mdc-snackbar__surface","mat-mdc-snackbar-surface"],[1,"mat-mdc-snack-bar-label"],["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(r,i){1&r&&(W(0,"div",1)(1,"div",2,0)(3,"div",3),et(4,kNe,0,0,"ng-template",4),K(),Pe(5,"div"),K()()),2&r&&(re(5),Ke("aria-live",i._live)("role",i._role)("id",i._liveElementId))},dependencies:[vQ],styles:[".mat-mdc-snack-bar-container{display:flex;align-items:center;justify-content:center;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0);margin:8px}.mat-mdc-snack-bar-handset .mat-mdc-snack-bar-container{width:100vw}.mat-mdc-snackbar-surface{box-shadow:0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);display:flex;align-items:center;justify-content:flex-start;box-sizing:border-box;padding-left:0;padding-right:8px}[dir=rtl] .mat-mdc-snackbar-surface{padding-right:0;padding-left:8px}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{min-width:344px;max-width:672px}.mat-mdc-snack-bar-handset .mat-mdc-snackbar-surface{width:100%;min-width:0}@media(forced-colors: active){.mat-mdc-snackbar-surface{outline:solid 1px}}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{color:var(--mdc-snackbar-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mdc-snackbar-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mdc-snackbar-container-color, var(--mat-sys-inverse-surface))}.mdc-snackbar__label{width:100%;flex-grow:1;box-sizing:border-box;margin:0;padding:14px 8px 14px 16px}[dir=rtl] .mdc-snackbar__label{padding-left:8px;padding-right:16px}.mat-mdc-snack-bar-container .mdc-snackbar__label{font-family:var(--mdc-snackbar-supporting-text-font, var(--mat-sys-body-medium-font));font-size:var(--mdc-snackbar-supporting-text-size, var(--mat-sys-body-medium-size));font-weight:var(--mdc-snackbar-supporting-text-weight, var(--mat-sys-body-medium-weight));line-height:var(--mdc-snackbar-supporting-text-line-height, var(--mat-sys-body-medium-line-height))}.mat-mdc-snack-bar-actions{display:flex;flex-shrink:0;align-items:center;box-sizing:border-box}.mat-mdc-snack-bar-handset,.mat-mdc-snack-bar-container,.mat-mdc-snack-bar-label{flex:1 1 auto}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled).mat-unthemed{color:var(--mat-snack-bar-button-color, var(--mat-sys-inverse-primary))}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled){--mat-text-button-state-layer-color:currentColor;--mat-text-button-ripple-color:currentColor}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled) .mat-ripple-element{opacity:.1}"],encapsulation:2,data:{animation:[ONe.snackBarState]}})}return n})();const LNe=new B("mat-snack-bar-default-options",{providedIn:"root",factory:function FNe(){return new ZI}});let VNe=(()=>{class n{_overlay=b(pu);_live=b(eIe);_injector=b(ze);_breakpointObserver=b(Z5);_parentSnackBar=b(n,{optional:!0,skipSelf:!0});_defaultConfig=b(LNe);_snackBarRefAtThisLevel=null;simpleSnackBarComponent=PNe;snackBarContainerComponent=zQ;handsetCssClass="mat-mdc-snack-bar-handset";get _openedSnackBarRef(){const t=this._parentSnackBar;return t?t._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(t){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=t:this._snackBarRefAtThisLevel=t}constructor(){}openFromComponent(t,r){return this._attach(t,r)}openFromTemplate(t,r){return this._attach(t,r)}open(t,r="",i){const o={...this._defaultConfig,...i};return o.data={message:t,action:r},o.announcementMessage===t&&(o.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,o)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(t,r){const o=ze.create({parent:r&&r.viewContainerRef&&r.viewContainerRef.injector||this._injector,providers:[{provide:ZI,useValue:r}]}),s=new QI(this.snackBarContainerComponent,r.viewContainerRef,o),a=t.attach(s);return a.instance.snackBarConfig=r,a.instance}_attach(t,r){const i={...new ZI,...this._defaultConfig,...r},o=this._createOverlay(i),s=this._attachSnackBarContainer(o,i),a=new aO(s,o);if(t instanceof Oo){const l=new yQ(t,null,{$implicit:i.data,snackBarRef:a});a.instance=s.attachTemplatePortal(l)}else{const l=this._createInjector(i,a),c=new QI(t,void 0,l),u=s.attachComponentPortal(c);a.instance=u.instance}return this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait)").pipe(At(o.detachments())).subscribe(l=>{o.overlayElement.classList.toggle(this.handsetCssClass,l.matches)}),i.announcementMessage&&s._onAnnounce.subscribe(()=>{this._live.announce(i.announcementMessage,i.politeness)}),this._animateSnackBar(a,i),this._openedSnackBarRef=a,this._openedSnackBarRef}_animateSnackBar(t,r){t.afterDismissed().subscribe(()=>{this._openedSnackBarRef==t&&(this._openedSnackBarRef=null),r.announcementMessage&&this._live.clear()}),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{t.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):t.containerInstance.enter(),r.duration&&r.duration>0&&t.afterOpened().subscribe(()=>t._dismissAfter(r.duration))}_createOverlay(t){const r=new DQ;r.direction=t.direction;let i=this._overlay.position().global();const o="rtl"===t.direction,s="left"===t.horizontalPosition||"start"===t.horizontalPosition&&!o||"end"===t.horizontalPosition&&o,a=!s&&"center"!==t.horizontalPosition;return s?i.left("0"):a?i.right("0"):i.centerHorizontally(),"top"===t.verticalPosition?i.top("0"):i.bottom("0"),r.positionStrategy=i,this._overlay.create(r)}_createInjector(t,r){return ze.create({parent:t&&t.viewContainerRef&&t.viewContainerRef.injector||this._injector,providers:[{provide:aO,useValue:r},{provide:LQ,useValue:t.data}]})}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),BNe=(()=>{class n{snackBar=b(VNe);showError(t){let r="An error occurred";t?.message&&(r=t.message.includes("auth/invalid-email")?"Invalid email address":t.message.includes("auth/user-not-found")?"User not found":t.message.includes("auth/wrong-password")?"Invalid password":t.message.includes("auth/email-already-in-use")?"Email is already registered":t.message.includes("auth/popup-closed-by-user")?"Sign in was cancelled":t.message.includes("auth/cancelled-popup-request")?"Only one popup can be open at a time":t.message.includes("auth/popup-blocked")?"Sign in popup was blocked by the browser":t.message),this.snackBar.open(r,"Close",{duration:5e3,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["error-snackbar"]})}showSuccess(t){this.snackBar.open(t,"Close",{duration:3e3,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["success-snackbar"]})}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),mf=(()=>{class n{auth=b(LE);firestore=b(I_);router=b(bo);ngZone=b(ue);errorService=b(BNe);app=b(tr);constructor(){H1e(this.firestore).catch(t=>{"failed-precondition"==t.code?console.warn("Multiple tabs open, persistence can only be enabled in one tab at a time."):"unimplemented"==t.code&&console.warn("The current browser doesn't support persistence.")})}currentUser$=IAe(this.auth);currentUser=kR(this.currentUser$);profile$=this.currentUser$.pipe(_o(t=>t?this.getUserProfile$(t.uid):de(null)));profile=kR(this.profile$);getUserProfile$(t){const r=tO(this.firestore,`users/${t}`);return U1e(r)}googleSignIn(){var t=this;return T(function*(){try{const r=new MSe;r.setCustomParameters({prompt:"select_account"});const i=yield SAe(t.auth,r,Z8);yield t.createUserProfile(i.user),t.ngZone.run(()=>{t.router.navigate(["/"]),t.errorService.showSuccess("Successfully signed in!")}),t.app.tick()}catch(r){throw t.ngZone.run(()=>t.errorService.showError(r)),r}})()}emailSignIn(t,r){var i=this;return T(function*(){try{yield xAe(i.auth,t,r),i.ngZone.run(()=>{i.router.navigate(["/"]),i.errorService.showSuccess("Successfully signed in!")}),i.app.tick()}catch(o){throw i.ngZone.run(()=>i.errorService.showError(o)),o}})()}emailSignUp(t,r,i){var o=this;return T(function*(){try{const s=yield TAe(o.auth,t,r);yield o.createUserProfile({...s.user,displayName:i}),o.ngZone.run(()=>{o.router.navigate(["/"]),o.errorService.showSuccess("Account created successfully!")}),o.app.tick()}catch(s){throw o.ngZone.run(()=>o.errorService.showError(s)),s}})()}signOut(){var t=this;return T(function*(){try{yield DAe(t.auth),t.ngZone.run(()=>{t.router.navigate(["/auth/login"]),t.errorService.showSuccess("Successfully signed out!")}),t.app.tick()}catch(r){throw t.ngZone.run(()=>t.errorService.showError(r)),r}})()}createUserProfile(t){var r=this;return T(function*(){const i=tO(r.firestore,`users/${t.uid}`);if(!(yield $1e(i)).exists()){const s={uid:t.uid,email:t.email,displayName:t.displayName||"Anonymous",photoURL:t.photoURL,role:"user"};yield W1e(i,s)}})()}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function UNe(n,e){1&n&&(W(0,"mat-error"),Oe(1," Email is required "),K())}function zNe(n,e){1&n&&(W(0,"mat-error"),Oe(1," Please enter a valid email "),K())}function jNe(n,e){1&n&&(W(0,"mat-error"),Oe(1," Password is required "),K())}function HNe(n,e){1&n&&(W(0,"mat-error"),Oe(1," Password must be at least 6 characters "),K())}function $Ne(n,e){1&n&&Pe(0,"mat-progress-spinner",18),2&n&&De("diameter",24)("strokeWidth",2)}let qNe=(()=>{class n{authService=b(mf);loginForm=b(Nw).nonNullable.group({email:["",[Ri.required,Ri.email]],password:["",[Ri.required,Ri.minLength(6)]]});loading=ti(!1);onSubmit(){var t=this;return T(function*(){if(t.loginForm.valid)try{t.loading.set(!0);const{email:r,password:i}=t.loginForm.getRawValue();yield t.authService.emailSignIn(r,i)}catch(r){console.error("Login error:",r)}finally{t.loading.set(!1)}})()}onGoogleLogin(){var t=this;return T(function*(){try{t.loading.set(!0),yield t.authService.googleSignIn()}catch(r){console.error("Google login error:",r)}finally{t.loading.set(!1)}})()}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["app-login"]],decls:35,vars:14,consts:[[1,"flex","justify-center","items-center","min-h-[80vh]"],[1,"max-w-md","w-full","m-4"],[1,"flex","flex-col","gap-4","mt-4",3,"ngSubmit","formGroup"],["matInput","","formControlName","email","type","email",3,"readonly"],[4,"ngIf"],["matInput","","formControlName","password","type","password",3,"readonly"],["mat-raised-button","","color","primary","type","submit",1,"w-full","relative","h-[36px]",3,"disabled"],["class","absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2","mode","indeterminate",3,"diameter","strokeWidth",4,"ngIf"],[1,"my-4"],["mat-stroked-button","",1,"w-full","google-btn",3,"click","disabled"],[1,"flex","items-center","justify-center","gap-2"],["xmlns","http://www.w3.org/2000/svg","width","18","height","18","viewBox","0 0 48 48",1,"google-icon"],["fill","#EA4335","d","M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"],["fill","#4285F4","d","M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"],["fill","#FBBC05","d","M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"],["fill","#34A853","d","M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"],[1,"mt-4","text-center"],["mat-button","","routerLink","/auth/signup",3,"disabled"],["mode","indeterminate",1,"absolute","top-1/2","left-1/2","transform","-translate-x-1/2","-translate-y-1/2",3,"diameter","strokeWidth"]],template:function(r,i){if(1&r&&(W(0,"div",0)(1,"mat-card",1)(2,"mat-card-header")(3,"mat-card-title"),Oe(4,"Login"),K()(),W(5,"mat-card-content")(6,"form",2),Ve("ngSubmit",function(){return i.onSubmit()}),W(7,"mat-form-field")(8,"mat-label"),Oe(9,"Email"),K(),Pe(10,"input",3),et(11,UNe,2,0,"mat-error",4)(12,zNe,2,0,"mat-error",4),K(),W(13,"mat-form-field")(14,"mat-label"),Oe(15,"Password"),K(),Pe(16,"input",5),et(17,jNe,2,0,"mat-error",4)(18,HNe,2,0,"mat-error",4),K(),W(19,"button",6)(20,"span"),Oe(21,"Login"),K(),et(22,$Ne,1,2,"mat-progress-spinner",7),K()(),Pe(23,"mat-divider",8),W(24,"button",9),Ve("click",function(){return i.onGoogleLogin()}),W(25,"div",10),tp(),W(26,"svg",11),Pe(27,"path",12)(28,"path",13)(29,"path",14)(30,"path",15),K(),Oe(31),K()(),_0(),W(32,"div",16)(33,"a",17),Oe(34," Need an account? Sign up "),K()()()()()),2&r){let o,s,a,l;re(6),De("formGroup",i.loginForm),re(4),De("readonly",i.loading()),re(),De("ngIf",null==(o=i.loginForm.get("email"))?null:o.hasError("required")),re(),De("ngIf",null==(s=i.loginForm.get("email"))?null:s.hasError("email")),re(4),De("readonly",i.loading()),re(),De("ngIf",null==(a=i.loginForm.get("password"))?null:a.hasError("required")),re(),De("ngIf",null==(l=i.loginForm.get("password"))?null:l.hasError("minlength")),re(),De("disabled",!i.loginForm.valid||i.loading()),re(),at("opacity-0",i.loading()),re(2),De("ngIf",i.loading()),re(2),De("disabled",i.loading()),re(7),Va(" ",i.loading()?"Logging in...":"Login with Google"," "),re(2),De("disabled",i.loading())}},dependencies:[za,Bb,Pw,kw,nh,bw,ww,Ga,$m,oR,Xw,Jw,eE,Zw,ng,dR,tg,SW,fR,hR,hh,zW,dh,HW,jW,qW,OTe,th],styles:[".google-btn[_ngcontent-%COMP%]{height:40px!important;font-weight:500!important;letter-spacing:.25px;border:1px solid #dadce0!important;background-color:#fff!important;color:#3c4043!important;transition:all .2s ease}.google-btn[_ngcontent-%COMP%]:hover:not([disabled]){background-color:#f8f9fa!important;box-shadow:0 1px 2px #3c40434d,0 1px 3px 1px #3c404326!important}.google-btn[_ngcontent-%COMP%] .google-icon[_ngcontent-%COMP%]{margin-right:8px;vertical-align:middle}[_nghost-%COMP%]{display:block}.my-4[_ngcontent-%COMP%]{margin-top:1rem;margin-bottom:1rem}.mt-4[_ngcontent-%COMP%]{margin-top:1rem}.w-full[_ngcontent-%COMP%]{width:100%}"]})}return n})(),WNe=(()=>{class n{fb;authService;router;signupForm=b(Nw).nonNullable.group({displayName:["",Ri.required],email:["",[Ri.required,Ri.email]],password:["",[Ri.required,Ri.minLength(6)]]});constructor(t,r,i){this.fb=t,this.authService=r,this.router=i}onSubmit(){var t=this;return T(function*(){if(t.signupForm.valid)try{const{email:r,password:i,displayName:o}=t.signupForm.getRawValue();yield t.authService.emailSignUp(r,i,o)}catch(r){console.error("Signup error:",r)}})()}onGoogleSignup(){var t=this;return T(function*(){try{yield t.authService.googleSignIn()}catch(r){console.error("Google signup error:",r)}})()}static \u0275fac=function(r){return new(r||n)($(Nw),$(mf),$(bo))};static \u0275cmp=He({type:n,selectors:[["app-signup"]],decls:27,vars:2,consts:[[1,"flex","justify-center","items-center","min-h-[80vh]"],[1,"max-w-md","w-full","m-4"],[1,"flex","flex-col","gap-4","mt-4",3,"ngSubmit","formGroup"],["matInput","","formControlName","displayName"],["matInput","","formControlName","email","type","email"],["matInput","","formControlName","password","type","password"],["mat-raised-button","","color","primary","type","submit",3,"disabled"],[1,"my-4"],["mat-stroked-button","","color","accent",1,"w-full",3,"click"],[1,"mt-4","text-center"],["mat-button","","routerLink","/auth/login"]],template:function(r,i){1&r&&(W(0,"div",0)(1,"mat-card",1)(2,"mat-card-header")(3,"mat-card-title"),Oe(4,"Sign Up"),K()(),W(5,"mat-card-content")(6,"form",2),Ve("ngSubmit",function(){return i.onSubmit()}),W(7,"mat-form-field")(8,"mat-label"),Oe(9,"Display Name"),K(),Pe(10,"input",3),K(),W(11,"mat-form-field")(12,"mat-label"),Oe(13,"Email"),K(),Pe(14,"input",4),K(),W(15,"mat-form-field")(16,"mat-label"),Oe(17,"Password"),K(),Pe(18,"input",5),K(),W(19,"button",6),Oe(20," Sign Up "),K()(),Pe(21,"mat-divider",7),W(22,"button",8),Ve("click",function(){return i.onGoogleSignup()}),Oe(23," Sign up with Google "),K(),W(24,"div",9)(25,"a",10),Oe(26,"Already have an account? Login"),K()()()()()),2&r&&(re(6),De("formGroup",i.signupForm),re(13),De("disabled",!i.signupForm.valid))},dependencies:[za,Pw,kw,nh,bw,ww,Ga,$m,oR,Xw,Jw,eE,Zw,ng,dR,tg,fR,hR,hh,zW,dh,HW,jW,th],encapsulation:2})}return n})();class lO{}class Zs{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(e){e?"string"==typeof e?this.lazyInit=()=>{this.headers=new Map,e.split("\n").forEach(t=>{const r=t.indexOf(":");if(r>0){const i=t.slice(0,r),o=t.slice(r+1).trim();this.addHeaderEntry(i,o)}})}:typeof Headers<"u"&&e instanceof Headers?(this.headers=new Map,e.forEach((t,r)=>{this.addHeaderEntry(r,t)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(e).forEach(([t,r])=>{this.setHeaderEntries(t,r)})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof Zs?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new Zs;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof Zs?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let r=e.value;if("string"==typeof r&&(r=[r]),0===r.length)return;this.maybeSetNormalizedName(e.name,t);const i=("a"===e.op?this.headers.get(t):void 0)||[];i.push(...r),this.headers.set(t,i);break;case"d":const o=e.value;if(o){let s=this.headers.get(t);if(!s)return;s=s.filter(a=>-1===o.indexOf(a)),0===s.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,s)}else this.headers.delete(t),this.normalizedNames.delete(t)}}addHeaderEntry(e,t){const r=e.toLowerCase();this.maybeSetNormalizedName(e,r),this.headers.has(r)?this.headers.get(r).push(t):this.headers.set(r,[t])}setHeaderEntries(e,t){const r=(Array.isArray(t)?t:[t]).map(o=>o.toString()),i=e.toLowerCase();this.headers.set(i,r),this.maybeSetNormalizedName(e,i)}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class GNe{encodeKey(e){return jQ(e)}encodeValue(e){return jQ(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const QNe=/%(\d[a-f0-9])/gi,YNe={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function jQ(n){return encodeURIComponent(n).replace(QNe,(e,t)=>YNe[t]??e)}function JI(n){return`${n}`}class El{map;encoder;updates=null;cloneFrom=null;constructor(e={}){if(this.encoder=e.encoder||new GNe,e.fromString){if(e.fromObject)throw new O(2805,!1);this.map=function KNe(n,e){const t=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(i=>{const o=i.indexOf("="),[s,a]=-1==o?[e.decodeKey(i),""]:[e.decodeKey(i.slice(0,o)),e.decodeValue(i.slice(o+1))],l=t.get(s)||[];l.push(a),t.set(s,l)}),t}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const r=e.fromObject[t],i=Array.isArray(r)?r.map(JI):[JI(r)];this.map.set(t,i)})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach(r=>{const i=e[r];Array.isArray(i)?i.forEach(o=>{t.push({param:r,value:o,op:"a"})}):t.push({param:r,value:i,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(r=>t+"="+this.encoder.encodeValue(r)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new El({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(JI(e.value)),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let r=this.map.get(e.param)||[];const i=r.indexOf(JI(e.value));-1!==i&&r.splice(i,1),r.length>0?this.map.set(e.param,r):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}class XNe{map=new Map;set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}has(e){return this.map.has(e)}keys(){return this.map.keys()}}function HQ(n){return typeof ArrayBuffer<"u"&&n instanceof ArrayBuffer}function $Q(n){return typeof Blob<"u"&&n instanceof Blob}function qQ(n){return typeof FormData<"u"&&n instanceof FormData}class C_{url;body=null;headers;context;reportProgress=!1;withCredentials=!1;responseType="json";method;params;urlWithParams;transferCache;constructor(e,t,r,i){let o;if(this.url=t,this.method=e.toUpperCase(),function ZNe(n){switch(n){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||i?(this.body=void 0!==r?r:null,o=i):o=r,o&&(this.reportProgress=!!o.reportProgress,this.withCredentials=!!o.withCredentials,o.responseType&&(this.responseType=o.responseType),o.headers&&(this.headers=o.headers),o.context&&(this.context=o.context),o.params&&(this.params=o.params),this.transferCache=o.transferCache),this.headers??=new Zs,this.context??=new XNe,this.params){const s=this.params.toString();if(0===s.length)this.urlWithParams=t;else{const a=t.indexOf("?");this.urlWithParams=t+(-1===a?"?":af.set(p,e.setHeaders[p]),c)),e.setParams&&(u=Object.keys(e.setParams).reduce((f,p)=>f.set(p,e.setParams[p]),u)),new C_(t,r,s,{params:u,headers:c,context:d,reportProgress:l,responseType:i,withCredentials:a,transferCache:o})}}var uO=function(n){return n[n.Sent=0]="Sent",n[n.UploadProgress=1]="UploadProgress",n[n.ResponseHeader=2]="ResponseHeader",n[n.DownloadProgress=3]="DownloadProgress",n[n.Response=4]="Response",n[n.User=5]="User",n}(uO||{});class dO{headers;status;statusText;url;ok;type;constructor(e,t=200,r="OK"){this.headers=e.headers||new Zs,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||r,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class x_ extends dO{body;constructor(e={}){super(e),this.body=void 0!==e.body?e.body:null}type=uO.Response;clone(e={}){return new x_({body:void 0!==e.body?e.body:this.body,headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}function hO(n,e){return{body:e,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials,transferCache:n.transferCache}}let fO=(()=>{class n{handler;constructor(t){this.handler=t}request(t,r,i={}){let o;if(t instanceof C_)o=t;else{let l,c;l=i.headers instanceof Zs?i.headers:new Zs(i.headers),i.params&&(c=i.params instanceof El?i.params:new El({fromObject:i.params})),o=new C_(t,r,void 0!==i.body?i.body:null,{headers:l,context:i.context,params:c,reportProgress:i.reportProgress,responseType:i.responseType||"json",withCredentials:i.withCredentials,transferCache:i.transferCache})}const s=de(o).pipe(Em(l=>this.handler.handle(l)));if(t instanceof C_||"events"===i.observe)return s;const a=s.pipe(si(l=>l instanceof x_));switch(i.observe||"body"){case"body":switch(o.responseType){case"arraybuffer":return a.pipe(Te(l=>{if(null!==l.body&&!(l.body instanceof ArrayBuffer))throw new O(2806,!1);return l.body}));case"blob":return a.pipe(Te(l=>{if(null!==l.body&&!(l.body instanceof Blob))throw new O(2807,!1);return l.body}));case"text":return a.pipe(Te(l=>{if(null!==l.body&&"string"!=typeof l.body)throw new O(2808,!1);return l.body}));default:return a.pipe(Te(l=>l.body))}case"response":return a;default:throw new O(2809,!1)}}delete(t,r={}){return this.request("DELETE",t,r)}get(t,r={}){return this.request("GET",t,r)}head(t,r={}){return this.request("HEAD",t,r)}jsonp(t,r){return this.request("JSONP",t,{params:(new El).append(r,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,r={}){return this.request("OPTIONS",t,r)}patch(t,r,i={}){return this.request("PATCH",t,hO(i,r))}post(t,r,i={}){return this.request("POST",t,hO(i,r))}put(t,r,i={}){return this.request("PUT",t,hO(i,r))}static \u0275fac=function(r){return new(r||n)(me(lO))};static \u0275prov=G({token:n,factory:n.\u0275fac})}return n})();const MPe=["*"];let tT;function S_(n){return function kPe(){if(void 0===tT&&(tT=null,typeof window<"u")){const n=window;void 0!==n.trustedTypes&&(tT=n.trustedTypes.createPolicy("angular#components",{createHTML:e=>e}))}return tT}()?.createHTML(n)||n}function rY(n){return Error(`Unable to find icon with the name "${n}"`)}function iY(n){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${n}".`)}function oY(n){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${n}".`)}class gu{url;svgText;options;svgElement;constructor(e,t,r){this.url=e,this.svgText=t,this.options=r}}let nT=(()=>{class n{_httpClient;_sanitizer;_errorHandler;_document;_svgIconConfigs=new Map;_iconSetConfigs=new Map;_cachedIconsByUrl=new Map;_inProgressUrlFetches=new Map;_fontCssClassesByAlias=new Map;_resolvers=[];_defaultFontSetClass=["material-icons","mat-ligature-font"];constructor(t,r,i,o){this._httpClient=t,this._sanitizer=r,this._errorHandler=o,this._document=i}addSvgIcon(t,r,i){return this.addSvgIconInNamespace("",t,r,i)}addSvgIconLiteral(t,r,i){return this.addSvgIconLiteralInNamespace("",t,r,i)}addSvgIconInNamespace(t,r,i,o){return this._addSvgIconConfig(t,r,new gu(i,null,o))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,r,i,o){const s=this._sanitizer.sanitize(er.HTML,i);if(!s)throw oY(i);const a=S_(s);return this._addSvgIconConfig(t,r,new gu("",a,o))}addSvgIconSet(t,r){return this.addSvgIconSetInNamespace("",t,r)}addSvgIconSetLiteral(t,r){return this.addSvgIconSetLiteralInNamespace("",t,r)}addSvgIconSetInNamespace(t,r,i){return this._addSvgIconSetConfig(t,new gu(r,null,i))}addSvgIconSetLiteralInNamespace(t,r,i){const o=this._sanitizer.sanitize(er.HTML,r);if(!o)throw oY(r);const s=S_(o);return this._addSvgIconSetConfig(t,new gu("",s,i))}registerFontClassAlias(t,r=t){return this._fontCssClassesByAlias.set(t,r),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(...t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){const r=this._sanitizer.sanitize(er.RESOURCE_URL,t);if(!r)throw iY(t);const i=this._cachedIconsByUrl.get(r);return i?de(rT(i)):this._loadSvgIconFromConfig(new gu(t,null)).pipe(Bn(o=>this._cachedIconsByUrl.set(r,o)),Te(o=>rT(o)))}getNamedSvgIcon(t,r=""){const i=sY(r,t);let o=this._svgIconConfigs.get(i);if(o)return this._getSvgFromConfig(o);if(o=this._getIconConfigFromResolvers(r,t),o)return this._svgIconConfigs.set(i,o),this._getSvgFromConfig(o);const s=this._iconSetConfigs.get(r);return s?this._getSvgFromIconSetConfigs(t,s):wm(rY(i))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?de(rT(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(Te(r=>rT(r)))}_getSvgFromIconSetConfigs(t,r){const i=this._extractIconWithNameFromAnySet(t,r);return i?de(i):Oq(r.filter(s=>!s.svgText).map(s=>this._loadSvgIconSetFromConfig(s).pipe(Tc(a=>{const c=`Loading icon set URL: ${this._sanitizer.sanitize(er.RESOURCE_URL,s.url)} failed: ${a.message}`;return this._errorHandler.handleError(new Error(c)),de(null)})))).pipe(Te(()=>{const s=this._extractIconWithNameFromAnySet(t,r);if(!s)throw rY(t);return s}))}_extractIconWithNameFromAnySet(t,r){for(let i=r.length-1;i>=0;i--){const o=r[i];if(o.svgText&&o.svgText.toString().indexOf(t)>-1){const s=this._svgElementFromConfig(o),a=this._extractSvgIconFromSet(s,t,o.options);if(a)return a}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe(Bn(r=>t.svgText=r),Te(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?de(null):this._fetchIcon(t).pipe(Bn(r=>t.svgText=r))}_extractSvgIconFromSet(t,r,i){const o=t.querySelector(`[id="${r}"]`);if(!o)return null;const s=o.cloneNode(!0);if(s.removeAttribute("id"),"svg"===s.nodeName.toLowerCase())return this._setSvgAttributes(s,i);if("symbol"===s.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(s),i);const a=this._svgElementFromString(S_(""));return a.appendChild(s),this._setSvgAttributes(a,i)}_svgElementFromString(t){const r=this._document.createElement("DIV");r.innerHTML=t;const i=r.querySelector("svg");if(!i)throw Error(" tag not found");return i}_toSvgElement(t){const r=this._svgElementFromString(S_("")),i=t.attributes;for(let o=0;oS_(c)),Jb(()=>this._inProgressUrlFetches.delete(s)),TW());return this._inProgressUrlFetches.set(s,l),l}_addSvgIconConfig(t,r,i){return this._svgIconConfigs.set(sY(t,r),i),this}_addSvgIconSetConfig(t,r){const i=this._iconSetConfigs.get(t);return i?i.push(r):this._iconSetConfigs.set(t,[r]),this}_svgElementFromConfig(t){if(!t.svgElement){const r=this._svgElementFromString(t.svgText);this._setSvgAttributes(r,t.options),t.svgElement=r}return t.svgElement}_getIconConfigFromResolvers(t,r){for(let i=0;ie?e.pathname+e.search:""}}}),aY=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],BPe=aY.map(n=>`[${n}]`).join(", "),UPe=/^url\(['"]?#(.*?)['"]?\)$/;let _O=(()=>{class n{_elementRef=b(je);_iconRegistry=b(nT);_location=b(LPe);_errorHandler=b(wi);_defaultColor;get color(){return this._color||this._defaultColor}set color(t){this._color=t}_color;inline=!1;get svgIcon(){return this._svgIcon}set svgIcon(t){t!==this._svgIcon&&(t?this._updateSvgIcon(t):this._svgIcon&&this._clearSvgElement(),this._svgIcon=t)}_svgIcon;get fontSet(){return this._fontSet}set fontSet(t){const r=this._cleanupFontValue(t);r!==this._fontSet&&(this._fontSet=r,this._updateFontIconClasses())}_fontSet;get fontIcon(){return this._fontIcon}set fontIcon(t){const r=this._cleanupFontValue(t);r!==this._fontIcon&&(this._fontIcon=r,this._updateFontIconClasses())}_fontIcon;_previousFontSetClass=[];_previousFontIconClass;_svgName;_svgNamespace;_previousPath;_elementsWithExternalReferences;_currentIconFetch=Kt.EMPTY;constructor(){const t=b(new T2("aria-hidden"),{optional:!0}),r=b(FPe,{optional:!0});r&&(r.color&&(this.color=this._defaultColor=r.color),r.fontSet&&(this.fontSet=r.fontSet)),t||this._elementRef.nativeElement.setAttribute("aria-hidden","true")}_splitIconName(t){if(!t)return["",""];const r=t.split(":");switch(r.length){case 1:return["",r[0]];case 2:return r;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const t=this._elementsWithExternalReferences;if(t&&t.size){const r=this._location.getPathname();r!==this._previousPath&&(this._previousPath=r,this._prependPathToReferences(r))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();const r=this._location.getPathname();this._previousPath=r,this._cacheChildrenWithExternalReferences(t),this._prependPathToReferences(r),this._elementRef.nativeElement.appendChild(t)}_clearSvgElement(){const t=this._elementRef.nativeElement;let r=t.childNodes.length;for(this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear();r--;){const i=t.childNodes[r];(1!==i.nodeType||"svg"===i.nodeName.toLowerCase())&&i.remove()}}_updateFontIconClasses(){if(!this._usingFontIcon())return;const t=this._elementRef.nativeElement,r=(this.fontSet?this._iconRegistry.classNameForFontAlias(this.fontSet).split(/ +/):this._iconRegistry.getDefaultFontSetClass()).filter(i=>i.length>0);this._previousFontSetClass.forEach(i=>t.classList.remove(i)),r.forEach(i=>t.classList.add(i)),this._previousFontSetClass=r,this.fontIcon!==this._previousFontIconClass&&!r.includes("mat-ligature-font")&&(this._previousFontIconClass&&t.classList.remove(this._previousFontIconClass),this.fontIcon&&t.classList.add(this.fontIcon),this._previousFontIconClass=this.fontIcon)}_cleanupFontValue(t){return"string"==typeof t?t.trim().split(" ")[0]:t}_prependPathToReferences(t){const r=this._elementsWithExternalReferences;r&&r.forEach((i,o)=>{i.forEach(s=>{o.setAttribute(s.name,`url('${t}#${s.value}')`)})})}_cacheChildrenWithExternalReferences(t){const r=t.querySelectorAll(BPe),i=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let o=0;o{const a=r[o],l=a.getAttribute(s),c=l?l.match(UPe):null;if(c){let u=i.get(a);u||(u=[],i.set(a,u)),u.push({name:s,value:c[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){const[r,i]=this._splitIconName(t);r&&(this._svgNamespace=r),i&&(this._svgName=i),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(i,r).pipe(zo(1)).subscribe(o=>this._setSvgElement(o),o=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${r}:${i}! ${o.message}`))})}}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:10,hostBindings:function(r,i){2&r&&(Ke("data-mat-icon-type",i._usingFontIcon()?"font":"svg")("data-mat-icon-name",i._svgName||i.fontIcon)("data-mat-icon-namespace",i._svgNamespace||i.fontSet)("fontIcon",i._usingFontIcon()?i.fontIcon:null),Fa(i.color?"mat-"+i.color:""),at("mat-icon-inline",i.inline)("mat-icon-no-color","primary"!==i.color&&"accent"!==i.color&&"warn"!==i.color))},inputs:{color:"color",inline:[2,"inline","inline",_t],svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],ngContentSelectors:MPe,decls:1,vars:0,template:function(r,i){1&r&&(Hn(),Ae(0))},styles:["mat-icon,mat-icon.mat-primary,mat-icon.mat-accent,mat-icon.mat-warn{color:var(--mat-icon-color, inherit)}.mat-icon{-webkit-user-select:none;user-select:none;background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px;overflow:hidden}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}.mat-icon.mat-ligature-font[fontIcon]::before{content:attr(fontIcon)}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1, 1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}"],encapsulation:2,changeDetection:0})}return n})(),yO=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[gn,gn]})}return n})(),zPe=(()=>{class n{authService=b(mf);static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["app-home"]],decls:8,vars:0,consts:[[1,"p-4"],[1,"flex","justify-between","items-center","mb-6"],[1,"text-2xl"],["mat-raised-button","","color","primary","routerLink","/blog/create",1,"create-post-btn"]],template:function(r,i){1&r&&(W(0,"div",0)(1,"div",1)(2,"h1",2),Oe(3,"Welcome to the Blog"),K(),W(4,"button",3)(5,"mat-icon"),Oe(6,"add"),K(),Oe(7," Create Post "),K()()())},dependencies:[za,hh,dh,yO,_O,th],styles:[".create-post-btn[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}"]})}return n})();const lY=(n,e)=>{const t=b(bo);return b(mf).currentUser$.pipe(Te(i=>!!i||(t.navigate(["/auth/login"]),!1)))},cY=["*",[["mat-chip-avatar"],["","matChipAvatar",""]],[["mat-chip-trailing-icon"],["","matChipRemove",""],["","matChipTrailingIcon",""]]],uY=["*","mat-chip-avatar, [matChipAvatar]","mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]"];function jPe(n,e){1&n&&(W(0,"span",3),Ae(1,1),K())}function HPe(n,e){1&n&&(W(0,"span",6),Ae(1,2),K())}const WPe=[[["mat-chip-avatar"],["","matChipAvatar",""]],[["","matChipEditInput",""]],"*",[["mat-chip-trailing-icon"],["","matChipRemove",""],["","matChipTrailingIcon",""]]],GPe=["mat-chip-avatar, [matChipAvatar]","[matChipEditInput]","*","mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]"];function KPe(n,e){1&n&&Pe(0,"span",0)}function QPe(n,e){1&n&&(W(0,"span",2),Ae(1),K())}function YPe(n,e){1&n&&Ae(0,1)}function XPe(n,e){1&n&&Pe(0,"span",7)}function ZPe(n,e){1&n&&et(0,YPe,1,0)(1,XPe,1,0,"span",7),2&n&&Pt(Ln().contentEditInput?0:1)}function JPe(n,e){1&n&&Ae(0,2)}function eOe(n,e){1&n&&(W(0,"span",5),Ae(1,3),K())}const vO=["*"],iT=new B("mat-chips-default-options",{providedIn:"root",factory:()=>({separatorKeyCodes:[13]})}),bO=new B("MatChipAvatar"),wO=new B("MatChipTrailingIcon"),EO=new B("MatChipRemove"),oT=new B("MatChip");let gf=(()=>{class n{_elementRef=b(je);_parentChip=b(oT);isInteractive=!0;_isPrimary=!0;get disabled(){return this._disabled||this._parentChip?.disabled||!1}set disabled(t){this._disabled=t}_disabled=!1;tabIndex=-1;_allowFocusWhenDisabled=!1;_getDisabledAttribute(){return this.disabled&&!this._allowFocusWhenDisabled?"":null}_getTabindex(){return this.disabled&&!this._allowFocusWhenDisabled||!this.isInteractive?null:this.tabIndex.toString()}constructor(){b(Ka).load(nR),"BUTTON"===this._elementRef.nativeElement.nodeName&&this._elementRef.nativeElement.setAttribute("type","button")}focus(){this._elementRef.nativeElement.focus()}_handleClick(t){!this.disabled&&this.isInteractive&&this._isPrimary&&(t.preventDefault(),this._parentChip._handlePrimaryActionInteraction())}_handleKeydown(t){(13===t.keyCode||32===t.keyCode)&&!this.disabled&&this.isInteractive&&this._isPrimary&&!this._parentChip._isEditing&&(t.preventDefault(),this._parentChip._handlePrimaryActionInteraction())}static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["","matChipAction",""]],hostAttrs:[1,"mdc-evolution-chip__action","mat-mdc-chip-action"],hostVars:9,hostBindings:function(r,i){1&r&&Ve("click",function(s){return i._handleClick(s)})("keydown",function(s){return i._handleKeydown(s)}),2&r&&(Ke("tabindex",i._getTabindex())("disabled",i._getDisabledAttribute())("aria-disabled",i.disabled),at("mdc-evolution-chip__action--primary",i._isPrimary)("mdc-evolution-chip__action--presentational",!i.isInteractive)("mdc-evolution-chip__action--trailing",!i._isPrimary))},inputs:{isInteractive:"isInteractive",disabled:[2,"disabled","disabled",_t],tabIndex:[2,"tabIndex","tabIndex",t=>null==t?-1:$d(t)],_allowFocusWhenDisabled:"_allowFocusWhenDisabled"}})}return n})(),fY=(()=>{class n extends gf{_isPrimary=!1;_handleClick(t){this.disabled||(t.stopPropagation(),t.preventDefault(),this._parentChip.remove())}_handleKeydown(t){(13===t.keyCode||32===t.keyCode)&&!this.disabled&&(t.stopPropagation(),t.preventDefault(),this._parentChip.remove())}static \u0275fac=(()=>{let t;return function(i){return(t||(t=bt(n)))(i||n)}})();static \u0275dir=ee({type:n,selectors:[["","matChipRemove",""]],hostAttrs:["role","button",1,"mat-mdc-chip-remove","mat-mdc-chip-trailing-icon","mat-focus-indicator","mdc-evolution-chip__icon","mdc-evolution-chip__icon--trailing"],hostVars:1,hostBindings:function(r,i){2&r&&Ke("aria-hidden",null)},features:[$e([{provide:EO,useExisting:n}]),ke]})}return n})(),_f=(()=>{class n{_changeDetectorRef=b(Uo);_elementRef=b(je);_ngZone=b(ue);_focusMonitor=b(ZA);_globalRippleOptions=b(yW,{optional:!0});_document=b(Xe);_onFocus=new fe;_onBlur=new fe;_isBasicChip;role=null;_hasFocusInternal=!1;_pendingFocus;_actionChanges;_animationsDisabled;_allLeadingIcons;_allTrailingIcons;_allRemoveIcons;_hasFocus(){return this._hasFocusInternal}id=b(Xa).getId("mat-mdc-chip-");ariaLabel=null;ariaDescription=null;_ariaDescriptionId=`${this.id}-aria-description`;_chipListDisabled=!1;_textElement;get value(){return void 0!==this._value?this._value:this._textElement.textContent.trim()}set value(t){this._value=t}_value;color;removable=!0;highlighted=!1;disableRipple=!1;get disabled(){return this._disabled||this._chipListDisabled}set disabled(t){this._disabled=t}_disabled=!1;removed=new nt;destroyed=new nt;basicChipAttrName="mat-basic-chip";leadingIcon;trailingIcon;removeIcon;primaryAction;_rippleLoader=b(IW);_injector=b(ze);constructor(){const t=b(Ka);t.load(nR),t.load(j5);const r=b(Ts,{optional:!0});this._animationsDisabled="NoopAnimations"===r,this._monitorFocus(),this._rippleLoader?.configureRipple(this._elementRef.nativeElement,{className:"mat-mdc-chip-ripple",disabled:this._isRippleDisabled()})}ngOnInit(){const t=this._elementRef.nativeElement;this._isBasicChip=t.hasAttribute(this.basicChipAttrName)||t.tagName.toLowerCase()===this.basicChipAttrName}ngAfterViewInit(){this._textElement=this._elementRef.nativeElement.querySelector(".mat-mdc-chip-action-label"),this._pendingFocus&&(this._pendingFocus=!1,this.focus())}ngAfterContentInit(){this._actionChanges=Ym(this._allLeadingIcons.changes,this._allTrailingIcons.changes,this._allRemoveIcons.changes).subscribe(()=>this._changeDetectorRef.markForCheck())}ngDoCheck(){this._rippleLoader.setDisabled(this._elementRef.nativeElement,this._isRippleDisabled())}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._rippleLoader?.destroyRipple(this._elementRef.nativeElement),this._actionChanges?.unsubscribe(),this.destroyed.emit({chip:this}),this.destroyed.complete()}remove(){this.removable&&this.removed.emit({chip:this})}_isRippleDisabled(){return this.disabled||this.disableRipple||this._animationsDisabled||this._isBasicChip||!!this._globalRippleOptions?.disabled}_hasTrailingIcon(){return!(!this.trailingIcon&&!this.removeIcon)}_handleKeydown(t){(8===t.keyCode&&!t.repeat||46===t.keyCode)&&(t.preventDefault(),this.remove())}focus(){this.disabled||(this.primaryAction?this.primaryAction.focus():this._pendingFocus=!0)}_getSourceAction(t){return this._getActions().find(r=>{const i=r._elementRef.nativeElement;return i===t||i.contains(t)})}_getActions(){const t=[];return this.primaryAction&&t.push(this.primaryAction),this.removeIcon&&t.push(this.removeIcon),this.trailingIcon&&t.push(this.trailingIcon),t}_handlePrimaryActionInteraction(){}_monitorFocus(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{const r=null!==t;r!==this._hasFocusInternal&&(this._hasFocusInternal=r,r?this._onFocus.next({chip:this}):(this._changeDetectorRef.markForCheck(),setTimeout(()=>this._ngZone.run(()=>this._onBlur.next({chip:this})))))})}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-basic-chip"],["","mat-basic-chip",""],["mat-chip"],["","mat-chip",""]],contentQueries:function(r,i,o){if(1&r&&($n(o,bO,5),$n(o,wO,5),$n(o,EO,5),$n(o,bO,5),$n(o,wO,5),$n(o,EO,5)),2&r){let s;Qe(s=Ye())&&(i.leadingIcon=s.first),Qe(s=Ye())&&(i.trailingIcon=s.first),Qe(s=Ye())&&(i.removeIcon=s.first),Qe(s=Ye())&&(i._allLeadingIcons=s),Qe(s=Ye())&&(i._allTrailingIcons=s),Qe(s=Ye())&&(i._allRemoveIcons=s)}},viewQuery:function(r,i){if(1&r&&qn(gf,5),2&r){let o;Qe(o=Ye())&&(i.primaryAction=o.first)}},hostAttrs:[1,"mat-mdc-chip"],hostVars:31,hostBindings:function(r,i){1&r&&Ve("keydown",function(s){return i._handleKeydown(s)}),2&r&&(Bo("id",i.id),Ke("role",i.role)("aria-label",i.ariaLabel),Fa("mat-"+(i.color||"primary")),at("mdc-evolution-chip",!i._isBasicChip)("mdc-evolution-chip--disabled",i.disabled)("mdc-evolution-chip--with-trailing-action",i._hasTrailingIcon())("mdc-evolution-chip--with-primary-graphic",i.leadingIcon)("mdc-evolution-chip--with-primary-icon",i.leadingIcon)("mdc-evolution-chip--with-avatar",i.leadingIcon)("mat-mdc-chip-with-avatar",i.leadingIcon)("mat-mdc-chip-highlighted",i.highlighted)("mat-mdc-chip-disabled",i.disabled)("mat-mdc-basic-chip",i._isBasicChip)("mat-mdc-standard-chip",!i._isBasicChip)("mat-mdc-chip-with-trailing-icon",i._hasTrailingIcon())("_mat-animation-noopable",i._animationsDisabled))},inputs:{role:"role",id:"id",ariaLabel:[0,"aria-label","ariaLabel"],ariaDescription:[0,"aria-description","ariaDescription"],value:"value",color:"color",removable:[2,"removable","removable",_t],highlighted:[2,"highlighted","highlighted",_t],disableRipple:[2,"disableRipple","disableRipple",_t],disabled:[2,"disabled","disabled",_t]},outputs:{removed:"removed",destroyed:"destroyed"},exportAs:["matChip"],features:[$e([{provide:oT,useExisting:n}])],ngContentSelectors:uY,decls:8,vars:3,consts:[[1,"mat-mdc-chip-focus-overlay"],[1,"mdc-evolution-chip__cell","mdc-evolution-chip__cell--primary"],["matChipAction","",3,"isInteractive"],[1,"mdc-evolution-chip__graphic","mat-mdc-chip-graphic"],[1,"mdc-evolution-chip__text-label","mat-mdc-chip-action-label"],[1,"mat-mdc-chip-primary-focus-indicator","mat-focus-indicator"],[1,"mdc-evolution-chip__cell","mdc-evolution-chip__cell--trailing"]],template:function(r,i){1&r&&(Hn(cY),Pe(0,"span",0),W(1,"span",1)(2,"span",2),et(3,jPe,2,0,"span",3),W(4,"span",4),Ae(5),Pe(6,"span",5),K()()(),et(7,HPe,2,0,"span",6)),2&r&&(re(2),De("isInteractive",!1),re(),Pt(i.leadingIcon?3:-1),re(4),Pt(i._hasTrailingIcon()?7:-1))},dependencies:[gf],styles:['.mdc-evolution-chip,.mdc-evolution-chip__cell,.mdc-evolution-chip__action{display:inline-flex;align-items:center}.mdc-evolution-chip{position:relative;max-width:100%}.mdc-evolution-chip__cell,.mdc-evolution-chip__action{height:100%}.mdc-evolution-chip__cell--primary{flex-basis:100%;overflow-x:hidden}.mdc-evolution-chip__cell--trailing{flex:1 0 auto}.mdc-evolution-chip__action{align-items:center;background:none;border:none;box-sizing:content-box;cursor:pointer;display:inline-flex;justify-content:center;outline:none;padding:0;text-decoration:none;color:inherit}.mdc-evolution-chip__action--presentational{cursor:auto}.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{pointer-events:none}.mdc-evolution-chip__action--primary{font:inherit;letter-spacing:inherit;white-space:inherit;overflow-x:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary::before{border-width:var(--mdc-chip-outline-width, 1px);border-radius:var(--mdc-chip-container-shape-radius, 8px);box-sizing:border-box;content:"";height:100%;left:0;position:absolute;pointer-events:none;top:0;width:100%;z-index:1;border-style:solid}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--primary::before{border-color:var(--mdc-chip-outline-color, var(--mat-sys-outline))}.mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational):not(.mdc-ripple-upgraded):focus::before{border-color:var(--mdc-chip-focus-outline-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--primary::before{border-color:var(--mdc-chip-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__action--primary::before{border-width:var(--mdc-chip-flat-selected-outline-width, 0)}.mat-mdc-basic-chip .mdc-evolution-chip__action--primary{font:inherit}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip__action--trailing{position:relative;overflow:visible}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--trailing{color:var(--mdc-chip-with-trailing-icon-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--trailing{color:var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mdc-evolution-chip__text-label{-webkit-user-select:none;user-select:none;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__text-label{font-family:var(--mdc-chip-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mdc-chip-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mdc-chip-label-text-size, var(--mat-sys-label-large-size));font-weight:var(--mdc-chip-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mdc-chip-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mdc-chip-label-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mdc-chip-selected-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label,.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label{color:var(--mdc-chip-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-evolution-chip__graphic{align-items:center;display:inline-flex;justify-content:center;overflow:hidden;pointer-events:none;position:relative;flex:1 0 auto}.mat-mdc-standard-chip .mdc-evolution-chip__graphic{width:var(--mdc-chip-with-avatar-avatar-size, 24px);height:var(--mdc-chip-with-avatar-avatar-size, 24px);font-size:var(--mdc-chip-with-avatar-avatar-size, 24px)}.mdc-evolution-chip--selecting .mdc-evolution-chip__graphic{transition:width 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selectable:not(.mdc-evolution-chip--selected):not(.mdc-evolution-chip--with-primary-icon) .mdc-evolution-chip__graphic{width:0}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mdc-evolution-chip__checkmark{position:absolute;opacity:0;top:50%;left:50%;height:20px;width:20px}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__checkmark{color:var(--mdc-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__checkmark{color:var(--mdc-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark{transition:transform 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1);transform:translate(-75%, -50%)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{transform:translate(-50%, -50%);opacity:1}.mdc-evolution-chip__checkmark-svg{display:block}.mdc-evolution-chip__checkmark-path{stroke-width:2px;stroke-dasharray:29.7833385;stroke-dashoffset:29.7833385;stroke:currentColor}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark-path{transition:stroke-dashoffset 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark-path{stroke-dashoffset:0}@media(forced-colors: active){.mdc-evolution-chip__checkmark-path{stroke:CanvasText !important}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--trailing{height:18px;width:18px;font-size:18px}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove{opacity:calc(var(--mat-chip-trailing-action-opacity, 1)*var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove:focus{opacity:calc(var(--mat-chip-trailing-action-focus-opacity, 1)*var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mat-mdc-standard-chip{border-radius:var(--mdc-chip-container-shape-radius, 8px);height:var(--mdc-chip-container-height, 32px)}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled){background-color:var(--mdc-chip-elevated-container-color, transparent)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{background-color:var(--mdc-chip-elevated-disabled-container-color)}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled){background-color:var(--mdc-chip-elevated-selected-container-color, var(--mat-sys-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled{background-color:var(--mdc-chip-flat-disabled-selected-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}@media(forced-colors: active){.mat-mdc-standard-chip{outline:solid 1px}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--primary{border-radius:var(--mdc-chip-with-avatar-avatar-shape-radius, 24px);width:var(--mdc-chip-with-icon-icon-size, 18px);height:var(--mdc-chip-with-icon-icon-size, 18px);font-size:var(--mdc-chip-with-icon-icon-size, 18px)}.mdc-evolution-chip--selected .mdc-evolution-chip__icon--primary{opacity:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__icon--primary{color:var(--mdc-chip-with-icon-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--primary{color:var(--mdc-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-highlighted{--mdc-chip-with-icon-icon-color:var(--mdc-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container));--mdc-chip-elevated-container-color:var(--mdc-chip-elevated-selected-container-color, var(--mat-sys-secondary-container));--mdc-chip-label-text-color:var(--mdc-chip-selected-label-text-color, var(--mat-sys-on-secondary-container));--mdc-chip-outline-width:var(--mdc-chip-flat-selected-outline-width, 0)}.mat-mdc-chip-focus-overlay{background:var(--mdc-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-selected .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-chip:hover .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-hover-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mdc-chip-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-focus-overlay .mat-mdc-chip-selected:hover,.mat-mdc-chip-highlighted:hover .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-hover-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mdc-chip-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mdc-chip-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected.cdk-focused .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mdc-chip-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-evolution-chip--disabled:not(.mdc-evolution-chip--selected) .mat-mdc-chip-avatar{opacity:var(--mdc-chip-with-avatar-disabled-avatar-opacity, 0.38)}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{opacity:var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38)}.mdc-evolution-chip--disabled.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{opacity:var(--mdc-chip-with-icon-disabled-icon-opacity, 0.38)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{opacity:var(--mat-chip-disabled-container-opacity, 1)}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-trailing-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-remove{opacity:var(--mat-chip-trailing-action-opacity, 1)}.mat-mdc-chip-remove:focus{opacity:var(--mat-chip-trailing-action-focus-opacity, 1)}.mat-mdc-chip-remove::after{background-color:var(--mat-chip-trailing-action-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-remove:hover::after{opacity:var(--mat-chip-trailing-action-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-remove:focus::after{opacity:var(--mat-chip-trailing-action-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected .mat-mdc-chip-remove::after,.mat-mdc-chip-highlighted .mat-mdc-chip-remove::after{background-color:var(--mat-chip-selected-trailing-action-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-standard-chip .mdc-evolution-chip__cell--primary,.mat-mdc-standard-chip .mdc-evolution-chip__action--primary,.mat-mdc-standard-chip .mat-mdc-chip-action-label{overflow:visible}.mat-mdc-standard-chip .mat-mdc-chip-graphic,.mat-mdc-standard-chip .mat-mdc-chip-trailing-icon{box-sizing:content-box}.mat-mdc-standard-chip._mat-animation-noopable,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__graphic,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark-path{transition-duration:1ms;animation-duration:1ms}.mat-mdc-chip-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;opacity:0;border-radius:inherit;transition:opacity 150ms linear}._mat-animation-noopable .mat-mdc-chip-focus-overlay{transition:none}.mat-mdc-basic-chip .mat-mdc-chip-focus-overlay{display:none}.mat-mdc-chip .mat-ripple.mat-mdc-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-chip-avatar{text-align:center;line-height:1;color:var(--mdc-chip-with-icon-icon-color, currentColor)}.mat-mdc-chip{position:relative;z-index:0}.mat-mdc-chip-action-label{text-align:left;z-index:1}[dir=rtl] .mat-mdc-chip-action-label{text-align:right}.mat-mdc-chip.mdc-evolution-chip--with-trailing-action .mat-mdc-chip-action-label{position:relative}.mat-mdc-chip-action-label .mat-mdc-chip-primary-focus-indicator{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none}.mat-mdc-chip-action-label .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-chip-remove::before{margin:calc(var(--mat-focus-indicator-border-width, 3px)*-1);left:8px;right:8px}.mat-mdc-chip-remove::after{content:"";display:block;opacity:0;position:absolute;top:-3px;bottom:-3px;left:5px;right:5px;border-radius:50%;box-sizing:border-box;padding:12px;margin:-12px;background-clip:content-box}.mat-mdc-chip-remove .mat-icon{width:18px;height:18px;font-size:18px;box-sizing:content-box}.mat-chip-edit-input{cursor:text;display:inline-block;color:inherit;outline:0}@media(forced-colors: active){.mat-mdc-chip-selected:not(.mat-mdc-chip-multiple){outline-width:3px}}.mat-mdc-chip-action:focus .mat-focus-indicator::before{content:""}'],encapsulation:2,changeDetection:0})}return n})(),sT=(()=>{class n{_elementRef=b(je);_document=b(Xe);constructor(){}initialize(t){this.getNativeElement().focus(),this.setValue(t)}getNativeElement(){return this._elementRef.nativeElement}setValue(t){this.getNativeElement().textContent=t,this._moveCursorToEndOfInput()}getValue(){return this.getNativeElement().textContent||""}_moveCursorToEndOfInput(){const t=this._document.createRange();t.selectNodeContents(this.getNativeElement()),t.collapse(!1);const r=window.getSelection();r.removeAllRanges(),r.addRange(t)}static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["span","matChipEditInput",""]],hostAttrs:["role","textbox","tabindex","-1","contenteditable","true",1,"mat-chip-edit-input"]})}return n})(),IO=(()=>{class n extends _f{basicChipAttrName="mat-basic-chip-row";_editStartPending=!1;editable=!1;edited=new nt;defaultEditInput;contentEditInput;_isEditing=!1;constructor(){super(),this.role="row",this._onBlur.pipe(At(this.destroyed)).subscribe(()=>{this._isEditing&&!this._editStartPending&&this._onEditFinish()})}_hasTrailingIcon(){return!this._isEditing&&super._hasTrailingIcon()}_handleFocus(){!this._isEditing&&!this.disabled&&this.focus()}_handleKeydown(t){13!==t.keyCode||this.disabled?this._isEditing?t.stopPropagation():super._handleKeydown(t):this._isEditing?(t.preventDefault(),this._onEditFinish()):this.editable&&this._startEditing(t)}_handleDoubleclick(t){!this.disabled&&this.editable&&this._startEditing(t)}_startEditing(t){if(!this.primaryAction||this.removeIcon&&this._getSourceAction(t.target)===this.removeIcon)return;const r=this.value;this._isEditing=this._editStartPending=!0,Cs(()=>{this._getEditInput().initialize(r),this._editStartPending=!1},{injector:this._injector})}_onEditFinish(){this._isEditing=this._editStartPending=!1,this.edited.emit({chip:this,value:this._getEditInput().getValue()}),(this._document.activeElement===this._getEditInput().getNativeElement()||this._document.activeElement===this._document.body)&&this.primaryAction.focus()}_isRippleDisabled(){return super._isRippleDisabled()||this._isEditing}_getEditInput(){return this.contentEditInput||this.defaultEditInput}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-chip-row"],["","mat-chip-row",""],["mat-basic-chip-row"],["","mat-basic-chip-row",""]],contentQueries:function(r,i,o){if(1&r&&$n(o,sT,5),2&r){let s;Qe(s=Ye())&&(i.contentEditInput=s.first)}},viewQuery:function(r,i){if(1&r&&qn(sT,5),2&r){let o;Qe(o=Ye())&&(i.defaultEditInput=o.first)}},hostAttrs:[1,"mat-mdc-chip","mat-mdc-chip-row","mdc-evolution-chip"],hostVars:27,hostBindings:function(r,i){1&r&&Ve("focus",function(s){return i._handleFocus(s)})("dblclick",function(s){return i._handleDoubleclick(s)}),2&r&&(Bo("id",i.id),Ke("tabindex",i.disabled?null:-1)("aria-label",null)("aria-description",null)("role",i.role),at("mat-mdc-chip-with-avatar",i.leadingIcon)("mat-mdc-chip-disabled",i.disabled)("mat-mdc-chip-editing",i._isEditing)("mat-mdc-chip-editable",i.editable)("mdc-evolution-chip--disabled",i.disabled)("mdc-evolution-chip--with-trailing-action",i._hasTrailingIcon())("mdc-evolution-chip--with-primary-graphic",i.leadingIcon)("mdc-evolution-chip--with-primary-icon",i.leadingIcon)("mdc-evolution-chip--with-avatar",i.leadingIcon)("mat-mdc-chip-highlighted",i.highlighted)("mat-mdc-chip-with-trailing-icon",i._hasTrailingIcon()))},inputs:{editable:"editable"},outputs:{edited:"edited"},features:[$e([{provide:_f,useExisting:n},{provide:oT,useExisting:n}]),ke],ngContentSelectors:GPe,decls:10,vars:9,consts:[[1,"mat-mdc-chip-focus-overlay"],["role","gridcell","matChipAction","",1,"mdc-evolution-chip__cell","mdc-evolution-chip__cell--primary",3,"disabled"],[1,"mdc-evolution-chip__graphic","mat-mdc-chip-graphic"],[1,"mdc-evolution-chip__text-label","mat-mdc-chip-action-label"],["aria-hidden","true",1,"mat-mdc-chip-primary-focus-indicator","mat-focus-indicator"],["role","gridcell",1,"mdc-evolution-chip__cell","mdc-evolution-chip__cell--trailing"],[1,"cdk-visually-hidden",3,"id"],["matChipEditInput",""]],template:function(r,i){1&r&&(Hn(WPe),et(0,KPe,1,0,"span",0),W(1,"span",1),et(2,QPe,2,0,"span",2),W(3,"span",3),et(4,ZPe,2,1)(5,JPe,1,0),Pe(6,"span",4),K()(),et(7,eOe,2,0,"span",5),W(8,"span",6),Oe(9),K()),2&r&&(Pt(i._isEditing?-1:0),re(),De("disabled",i.disabled),Ke("aria-label",i.ariaLabel)("aria-describedby",i._ariaDescriptionId),re(),Pt(i.leadingIcon?2:-1),re(2),Pt(i._isEditing?4:5),re(3),Pt(i._hasTrailingIcon()?7:-1),re(),De("id",i._ariaDescriptionId),re(),zd(i.ariaDescription))},dependencies:[gf,sT],styles:['.mdc-evolution-chip,.mdc-evolution-chip__cell,.mdc-evolution-chip__action{display:inline-flex;align-items:center}.mdc-evolution-chip{position:relative;max-width:100%}.mdc-evolution-chip__cell,.mdc-evolution-chip__action{height:100%}.mdc-evolution-chip__cell--primary{flex-basis:100%;overflow-x:hidden}.mdc-evolution-chip__cell--trailing{flex:1 0 auto}.mdc-evolution-chip__action{align-items:center;background:none;border:none;box-sizing:content-box;cursor:pointer;display:inline-flex;justify-content:center;outline:none;padding:0;text-decoration:none;color:inherit}.mdc-evolution-chip__action--presentational{cursor:auto}.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{pointer-events:none}.mdc-evolution-chip__action--primary{font:inherit;letter-spacing:inherit;white-space:inherit;overflow-x:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary::before{border-width:var(--mdc-chip-outline-width, 1px);border-radius:var(--mdc-chip-container-shape-radius, 8px);box-sizing:border-box;content:"";height:100%;left:0;position:absolute;pointer-events:none;top:0;width:100%;z-index:1;border-style:solid}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--primary::before{border-color:var(--mdc-chip-outline-color, var(--mat-sys-outline))}.mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational):not(.mdc-ripple-upgraded):focus::before{border-color:var(--mdc-chip-focus-outline-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--primary::before{border-color:var(--mdc-chip-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__action--primary::before{border-width:var(--mdc-chip-flat-selected-outline-width, 0)}.mat-mdc-basic-chip .mdc-evolution-chip__action--primary{font:inherit}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip__action--trailing{position:relative;overflow:visible}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--trailing{color:var(--mdc-chip-with-trailing-icon-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--trailing{color:var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mdc-evolution-chip__text-label{-webkit-user-select:none;user-select:none;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__text-label{font-family:var(--mdc-chip-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mdc-chip-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mdc-chip-label-text-size, var(--mat-sys-label-large-size));font-weight:var(--mdc-chip-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mdc-chip-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mdc-chip-label-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mdc-chip-selected-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label,.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label{color:var(--mdc-chip-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-evolution-chip__graphic{align-items:center;display:inline-flex;justify-content:center;overflow:hidden;pointer-events:none;position:relative;flex:1 0 auto}.mat-mdc-standard-chip .mdc-evolution-chip__graphic{width:var(--mdc-chip-with-avatar-avatar-size, 24px);height:var(--mdc-chip-with-avatar-avatar-size, 24px);font-size:var(--mdc-chip-with-avatar-avatar-size, 24px)}.mdc-evolution-chip--selecting .mdc-evolution-chip__graphic{transition:width 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selectable:not(.mdc-evolution-chip--selected):not(.mdc-evolution-chip--with-primary-icon) .mdc-evolution-chip__graphic{width:0}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mdc-evolution-chip__checkmark{position:absolute;opacity:0;top:50%;left:50%;height:20px;width:20px}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__checkmark{color:var(--mdc-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__checkmark{color:var(--mdc-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark{transition:transform 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1);transform:translate(-75%, -50%)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{transform:translate(-50%, -50%);opacity:1}.mdc-evolution-chip__checkmark-svg{display:block}.mdc-evolution-chip__checkmark-path{stroke-width:2px;stroke-dasharray:29.7833385;stroke-dashoffset:29.7833385;stroke:currentColor}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark-path{transition:stroke-dashoffset 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark-path{stroke-dashoffset:0}@media(forced-colors: active){.mdc-evolution-chip__checkmark-path{stroke:CanvasText !important}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--trailing{height:18px;width:18px;font-size:18px}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove{opacity:calc(var(--mat-chip-trailing-action-opacity, 1)*var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove:focus{opacity:calc(var(--mat-chip-trailing-action-focus-opacity, 1)*var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mat-mdc-standard-chip{border-radius:var(--mdc-chip-container-shape-radius, 8px);height:var(--mdc-chip-container-height, 32px)}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled){background-color:var(--mdc-chip-elevated-container-color, transparent)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{background-color:var(--mdc-chip-elevated-disabled-container-color)}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled){background-color:var(--mdc-chip-elevated-selected-container-color, var(--mat-sys-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled{background-color:var(--mdc-chip-flat-disabled-selected-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}@media(forced-colors: active){.mat-mdc-standard-chip{outline:solid 1px}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--primary{border-radius:var(--mdc-chip-with-avatar-avatar-shape-radius, 24px);width:var(--mdc-chip-with-icon-icon-size, 18px);height:var(--mdc-chip-with-icon-icon-size, 18px);font-size:var(--mdc-chip-with-icon-icon-size, 18px)}.mdc-evolution-chip--selected .mdc-evolution-chip__icon--primary{opacity:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__icon--primary{color:var(--mdc-chip-with-icon-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--primary{color:var(--mdc-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-highlighted{--mdc-chip-with-icon-icon-color:var(--mdc-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container));--mdc-chip-elevated-container-color:var(--mdc-chip-elevated-selected-container-color, var(--mat-sys-secondary-container));--mdc-chip-label-text-color:var(--mdc-chip-selected-label-text-color, var(--mat-sys-on-secondary-container));--mdc-chip-outline-width:var(--mdc-chip-flat-selected-outline-width, 0)}.mat-mdc-chip-focus-overlay{background:var(--mdc-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-selected .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-chip:hover .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-hover-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mdc-chip-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-focus-overlay .mat-mdc-chip-selected:hover,.mat-mdc-chip-highlighted:hover .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-hover-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mdc-chip-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mdc-chip-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected.cdk-focused .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mdc-chip-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-evolution-chip--disabled:not(.mdc-evolution-chip--selected) .mat-mdc-chip-avatar{opacity:var(--mdc-chip-with-avatar-disabled-avatar-opacity, 0.38)}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{opacity:var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38)}.mdc-evolution-chip--disabled.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{opacity:var(--mdc-chip-with-icon-disabled-icon-opacity, 0.38)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{opacity:var(--mat-chip-disabled-container-opacity, 1)}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-trailing-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-remove{opacity:var(--mat-chip-trailing-action-opacity, 1)}.mat-mdc-chip-remove:focus{opacity:var(--mat-chip-trailing-action-focus-opacity, 1)}.mat-mdc-chip-remove::after{background-color:var(--mat-chip-trailing-action-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-remove:hover::after{opacity:var(--mat-chip-trailing-action-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-remove:focus::after{opacity:var(--mat-chip-trailing-action-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected .mat-mdc-chip-remove::after,.mat-mdc-chip-highlighted .mat-mdc-chip-remove::after{background-color:var(--mat-chip-selected-trailing-action-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-standard-chip .mdc-evolution-chip__cell--primary,.mat-mdc-standard-chip .mdc-evolution-chip__action--primary,.mat-mdc-standard-chip .mat-mdc-chip-action-label{overflow:visible}.mat-mdc-standard-chip .mat-mdc-chip-graphic,.mat-mdc-standard-chip .mat-mdc-chip-trailing-icon{box-sizing:content-box}.mat-mdc-standard-chip._mat-animation-noopable,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__graphic,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark-path{transition-duration:1ms;animation-duration:1ms}.mat-mdc-chip-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;opacity:0;border-radius:inherit;transition:opacity 150ms linear}._mat-animation-noopable .mat-mdc-chip-focus-overlay{transition:none}.mat-mdc-basic-chip .mat-mdc-chip-focus-overlay{display:none}.mat-mdc-chip .mat-ripple.mat-mdc-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-chip-avatar{text-align:center;line-height:1;color:var(--mdc-chip-with-icon-icon-color, currentColor)}.mat-mdc-chip{position:relative;z-index:0}.mat-mdc-chip-action-label{text-align:left;z-index:1}[dir=rtl] .mat-mdc-chip-action-label{text-align:right}.mat-mdc-chip.mdc-evolution-chip--with-trailing-action .mat-mdc-chip-action-label{position:relative}.mat-mdc-chip-action-label .mat-mdc-chip-primary-focus-indicator{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none}.mat-mdc-chip-action-label .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-chip-remove::before{margin:calc(var(--mat-focus-indicator-border-width, 3px)*-1);left:8px;right:8px}.mat-mdc-chip-remove::after{content:"";display:block;opacity:0;position:absolute;top:-3px;bottom:-3px;left:5px;right:5px;border-radius:50%;box-sizing:border-box;padding:12px;margin:-12px;background-clip:content-box}.mat-mdc-chip-remove .mat-icon{width:18px;height:18px;font-size:18px;box-sizing:content-box}.mat-chip-edit-input{cursor:text;display:inline-block;color:inherit;outline:0}@media(forced-colors: active){.mat-mdc-chip-selected:not(.mat-mdc-chip-multiple){outline-width:3px}}.mat-mdc-chip-action:focus .mat-focus-indicator::before{content:""}'],encapsulation:2,changeDetection:0})}return n})(),TO=(()=>{class n{_elementRef=b(je);_changeDetectorRef=b(Uo);_dir=b(Gw,{optional:!0});_lastDestroyedFocusedChipIndex=null;_keyManager;_destroyed=new fe;_defaultRole="presentation";get chipFocusChanges(){return this._getChipStream(t=>t._onFocus)}get chipDestroyedChanges(){return this._getChipStream(t=>t.destroyed)}get chipRemovedChanges(){return this._getChipStream(t=>t.removed)}get disabled(){return this._disabled}set disabled(t){this._disabled=t,this._syncChipsState()}_disabled=!1;get empty(){return!this._chips||0===this._chips.length}get role(){return this._explicitRole?this._explicitRole:this.empty?null:this._defaultRole}tabIndex=0;set role(t){this._explicitRole=t}_explicitRole=null;get focused(){return this._hasFocusedChip()}_chips;_chipActions=new dp;constructor(){}ngAfterViewInit(){this._setUpFocusManagement(),this._trackChipSetChanges(),this._trackDestroyedFocusedChip()}ngOnDestroy(){this._keyManager?.destroy(),this._chipActions.destroy(),this._destroyed.next(),this._destroyed.complete()}_hasFocusedChip(){return this._chips&&this._chips.some(t=>t._hasFocus())}_syncChipsState(){this._chips?.forEach(t=>{t._chipListDisabled=this._disabled,t._changeDetectorRef.markForCheck()})}focus(){}_handleKeydown(t){this._originatesFromChip(t)&&this._keyManager.onKeydown(t)}_isValidIndex(t){return t>=0&&tthis._elementRef.nativeElement.tabIndex=t))}_getChipStream(t){return this._chips.changes.pipe(Ec(null),_o(()=>Ym(...this._chips.map(t))))}_originatesFromChip(t){let r=t.target;for(;r&&r!==this._elementRef.nativeElement;){if(r.classList.contains("mat-mdc-chip"))return!0;r=r.parentElement}return!1}_setUpFocusManagement(){this._chips.changes.pipe(Ec(this._chips)).subscribe(t=>{const r=[];t.forEach(i=>i._getActions().forEach(o=>r.push(o))),this._chipActions.reset(r),this._chipActions.notifyOnChanges()}),this._keyManager=new LEe(this._chipActions).withVerticalOrientation().withHorizontalOrientation(this._dir?this._dir.value:"ltr").withHomeAndEnd().skipPredicate(t=>this._skipPredicate(t)),this.chipFocusChanges.pipe(At(this._destroyed)).subscribe(({chip:t})=>{const r=t._getSourceAction(document.activeElement);r&&this._keyManager.updateActiveItem(r)}),this._dir?.change.pipe(At(this._destroyed)).subscribe(t=>this._keyManager.withHorizontalOrientation(t))}_skipPredicate(t){return!t.isInteractive||t.disabled}_trackChipSetChanges(){this._chips.changes.pipe(Ec(null),At(this._destroyed)).subscribe(()=>{this.disabled&&Promise.resolve().then(()=>this._syncChipsState()),this._redirectDestroyedChipFocus()})}_trackDestroyedFocusedChip(){this.chipDestroyedChanges.pipe(At(this._destroyed)).subscribe(t=>{const i=this._chips.toArray().indexOf(t.chip);this._isValidIndex(i)&&t.chip._hasFocus()&&(this._lastDestroyedFocusedChipIndex=i)})}_redirectDestroyedChipFocus(){if(null!=this._lastDestroyedFocusedChipIndex){if(this._chips.length){const t=Math.min(this._lastDestroyedFocusedChipIndex,this._chips.length-1),r=this._chips.toArray()[t];r.disabled?1===this._chips.length?this.focus():this._keyManager.setPreviousItemActive():r.focus()}else this.focus();this._lastDestroyedFocusedChipIndex=null}}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-chip-set"]],contentQueries:function(r,i,o){if(1&r&&$n(o,_f,5),2&r){let s;Qe(s=Ye())&&(i._chips=s)}},hostAttrs:[1,"mat-mdc-chip-set","mdc-evolution-chip-set"],hostVars:1,hostBindings:function(r,i){1&r&&Ve("keydown",function(s){return i._handleKeydown(s)}),2&r&&Ke("role",i.role)},inputs:{disabled:[2,"disabled","disabled",_t],role:"role",tabIndex:[2,"tabIndex","tabIndex",t=>null==t?0:$d(t)]},ngContentSelectors:vO,decls:2,vars:0,consts:[["role","presentation",1,"mdc-evolution-chip-set__chips"]],template:function(r,i){1&r&&(Hn(),W(0,"div",0),Ae(1),K())},styles:[".mat-mdc-chip-set{display:flex}.mat-mdc-chip-set:focus{outline:none}.mat-mdc-chip-set .mdc-evolution-chip-set__chips{min-width:100%;margin-left:-8px;margin-right:0}.mat-mdc-chip-set .mdc-evolution-chip{margin:4px 0 4px 8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip-set__chips{margin-left:0;margin-right:-8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip{margin-left:0;margin-right:8px}.mdc-evolution-chip-set__chips{display:flex;flex-flow:wrap;min-width:0}.mat-mdc-chip-set-stacked{flex-direction:column;align-items:flex-start}.mat-mdc-chip-set-stacked .mat-mdc-chip{width:100%}.mat-mdc-chip-set-stacked .mdc-evolution-chip__graphic{flex-grow:0}.mat-mdc-chip-set-stacked .mdc-evolution-chip__action--primary{flex-basis:100%;justify-content:start}input.mat-mdc-chip-input{flex:1 0 150px;margin-left:8px}[dir=rtl] input.mat-mdc-chip-input{margin-left:0;margin-right:8px}"],encapsulation:2,changeDetection:0})}return n})();class oOe{source;value;constructor(e,t){this.source=e,this.value=t}}let gY=(()=>{class n extends TO{ngControl=b(qo,{optional:!0,self:!0});controlType="mat-chip-grid";_chipInput;_defaultRole="grid";_errorStateTracker;_ariaDescribedbyIds=[];_onTouched=()=>{};_onChange=()=>{};get disabled(){return this.ngControl?!!this.ngControl.disabled:this._disabled}set disabled(t){this._disabled=t,this._syncChipsState(),this.stateChanges.next()}get id(){return this._chipInput.id}get empty(){return(!this._chipInput||this._chipInput.empty)&&(!this._chips||0===this._chips.length)}get placeholder(){return this._chipInput?this._chipInput.placeholder:this._placeholder}set placeholder(t){this._placeholder=t,this.stateChanges.next()}_placeholder;get focused(){return this._chipInput.focused||this._hasFocusedChip()}get required(){return this._required??this.ngControl?.control?.hasValidator(Ri.required)??!1}set required(t){this._required=t,this.stateChanges.next()}_required;get shouldLabelFloat(){return!this.empty||this.focused}get value(){return this._value}set value(t){this._value=t}_value=[];get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(t){this._errorStateTracker.matcher=t}get chipBlurChanges(){return this._getChipStream(t=>t._onBlur)}change=new nt;valueChange=new nt;_chips=void 0;stateChanges=new fe;get errorState(){return this._errorStateTracker.errorState}set errorState(t){this._errorStateTracker.errorState=t}constructor(){super();const t=b(jm,{optional:!0}),r=b(Ga,{optional:!0}),i=b(tR);this.ngControl&&(this.ngControl.valueAccessor=this),this._errorStateTracker=new fW(i,this.ngControl,r,t,this.stateChanges)}ngAfterContentInit(){this.chipBlurChanges.pipe(At(this._destroyed)).subscribe(()=>{this._blur(),this.stateChanges.next()}),Ym(this.chipFocusChanges,this._chips.changes).pipe(At(this._destroyed)).subscribe(()=>this.stateChanges.next())}ngAfterViewInit(){super.ngAfterViewInit()}ngDoCheck(){this.ngControl&&this.updateErrorState()}ngOnDestroy(){super.ngOnDestroy(),this.stateChanges.complete()}registerInput(t){this._chipInput=t,this._chipInput.setDescribedByIds(this._ariaDescribedbyIds)}onContainerClick(t){!this.disabled&&!this._originatesFromChip(t)&&this.focus()}focus(){if(!this.disabled&&!this._chipInput.focused){if(!this._chips.length||this._chips.first.disabled)Promise.resolve().then(()=>this._chipInput.focus());else{const t=this._keyManager.activeItem;t?t.focus():this._keyManager.setFirstItemActive()}this.stateChanges.next()}}setDescribedByIds(t){this._ariaDescribedbyIds=t,this._chipInput?.setDescribedByIds(t)}writeValue(t){this._value=t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this.stateChanges.next()}updateErrorState(){this._errorStateTracker.updateErrorState()}_blur(){this.disabled||setTimeout(()=>{this.focused||(this._propagateChanges(),this._markAsTouched())})}_allowFocusEscape(){this._chipInput.focused||super._allowFocusEscape()}_handleKeydown(t){const r=t.keyCode,i=this._keyManager.activeItem;if(9===r)this._chipInput.focused&&Lw(t,"shiftKey")&&this._chips.length&&!this._chips.last.disabled?(t.preventDefault(),i?this._keyManager.setActiveItem(i):this._focusLastChip()):super._allowFocusEscape();else if(!this._chipInput.focused)if(38!==r&&40!==r||!i)super._handleKeydown(t);else{const o=this._chipActions.filter(l=>l._isPrimary===i._isPrimary&&!this._skipPredicate(l)),s=o.indexOf(i),a=38===t.keyCode?-1:1;t.preventDefault(),s>-1&&this._isValidIndex(s+a)&&this._keyManager.setActiveItem(o[s+a])}this.stateChanges.next()}_focusLastChip(){this._chips.length&&this._chips.last.focus()}_propagateChanges(){const t=this._chips.length?this._chips.toArray().map(r=>r.value):[];this._value=t,this.change.emit(new oOe(this,t)),this.valueChange.emit(t),this._onChange(t),this._changeDetectorRef.markForCheck()}_markAsTouched(){this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next()}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-chip-grid"]],contentQueries:function(r,i,o){if(1&r&&$n(o,IO,5),2&r){let s;Qe(s=Ye())&&(i._chips=s)}},hostAttrs:[1,"mat-mdc-chip-set","mat-mdc-chip-grid","mdc-evolution-chip-set"],hostVars:10,hostBindings:function(r,i){1&r&&Ve("focus",function(){return i.focus()})("blur",function(){return i._blur()}),2&r&&(Ke("role",i.role)("tabindex",i.disabled||i._chips&&0===i._chips.length?-1:i.tabIndex)("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState),at("mat-mdc-chip-list-disabled",i.disabled)("mat-mdc-chip-list-invalid",i.errorState)("mat-mdc-chip-list-required",i.required))},inputs:{disabled:[2,"disabled","disabled",_t],placeholder:"placeholder",required:[2,"required","required",_t],value:"value",errorStateMatcher:"errorStateMatcher"},outputs:{change:"change",valueChange:"valueChange"},features:[$e([{provide:cR,useExisting:n}]),ke],ngContentSelectors:vO,decls:2,vars:0,consts:[["role","presentation",1,"mdc-evolution-chip-set__chips"]],template:function(r,i){1&r&&(Hn(),W(0,"div",0),Ae(1),K())},styles:[".mat-mdc-chip-set{display:flex}.mat-mdc-chip-set:focus{outline:none}.mat-mdc-chip-set .mdc-evolution-chip-set__chips{min-width:100%;margin-left:-8px;margin-right:0}.mat-mdc-chip-set .mdc-evolution-chip{margin:4px 0 4px 8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip-set__chips{margin-left:0;margin-right:-8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip{margin-left:0;margin-right:8px}.mdc-evolution-chip-set__chips{display:flex;flex-flow:wrap;min-width:0}.mat-mdc-chip-set-stacked{flex-direction:column;align-items:flex-start}.mat-mdc-chip-set-stacked .mat-mdc-chip{width:100%}.mat-mdc-chip-set-stacked .mdc-evolution-chip__graphic{flex-grow:0}.mat-mdc-chip-set-stacked .mdc-evolution-chip__action--primary{flex-basis:100%;justify-content:start}input.mat-mdc-chip-input{flex:1 0 150px;margin-left:8px}[dir=rtl] input.mat-mdc-chip-input{margin-left:0;margin-right:8px}"],encapsulation:2,changeDetection:0})}return n})(),_Y=(()=>{class n{_elementRef=b(je);focused=!1;get chipGrid(){return this._chipGrid}set chipGrid(t){t&&(this._chipGrid=t,this._chipGrid.registerInput(this))}_chipGrid;addOnBlur=!1;separatorKeyCodes;chipEnd=new nt;placeholder="";id=b(Xa).getId("mat-mdc-chip-list-input-");get disabled(){return this._disabled||this._chipGrid&&this._chipGrid.disabled}set disabled(t){this._disabled=t}_disabled=!1;get empty(){return!this.inputElement.value}inputElement;constructor(){const t=b(iT),r=b(uR,{optional:!0});this.inputElement=this._elementRef.nativeElement,this.separatorKeyCodes=t.separatorKeyCodes,r&&this.inputElement.classList.add("mat-mdc-form-field-input-control")}ngOnChanges(){this._chipGrid.stateChanges.next()}ngOnDestroy(){this.chipEnd.complete()}_keydown(t){this.empty&&8===t.keyCode?(t.repeat||this._chipGrid._focusLastChip(),t.preventDefault()):this._emitChipEnd(t)}_blur(){this.addOnBlur&&this._emitChipEnd(),this.focused=!1,this._chipGrid.focused||this._chipGrid._blur(),this._chipGrid.stateChanges.next()}_focus(){this.focused=!0,this._chipGrid.stateChanges.next()}_emitChipEnd(t){(!t||this._isSeparatorKey(t)&&!t.repeat)&&(this.chipEnd.emit({input:this.inputElement,value:this.inputElement.value,chipInput:this}),t?.preventDefault())}_onInput(){this._chipGrid.stateChanges.next()}focus(){this.inputElement.focus()}clear(){this.inputElement.value=""}setDescribedByIds(t){const r=this._elementRef.nativeElement;t.length?r.setAttribute("aria-describedby",t.join(" ")):r.removeAttribute("aria-describedby")}_isSeparatorKey(t){return!Lw(t)&&new Set(this.separatorKeyCodes).has(t.keyCode)}static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["input","matChipInputFor",""]],hostAttrs:[1,"mat-mdc-chip-input","mat-mdc-input-element","mdc-text-field__input","mat-input-element"],hostVars:6,hostBindings:function(r,i){1&r&&Ve("keydown",function(s){return i._keydown(s)})("blur",function(){return i._blur()})("focus",function(){return i._focus()})("input",function(){return i._onInput()}),2&r&&(Bo("id",i.id),Ke("disabled",i.disabled||null)("placeholder",i.placeholder||null)("aria-invalid",i._chipGrid&&i._chipGrid.ngControl?i._chipGrid.ngControl.invalid:null)("aria-required",i._chipGrid&&i._chipGrid.required||null)("required",i._chipGrid&&i._chipGrid.required||null))},inputs:{chipGrid:[0,"matChipInputFor","chipGrid"],addOnBlur:[2,"matChipInputAddOnBlur","addOnBlur",_t],separatorKeyCodes:[0,"matChipInputSeparatorKeyCodes","separatorKeyCodes"],placeholder:"placeholder",id:"id",disabled:[2,"disabled","disabled",_t]},outputs:{chipEnd:"matChipInputTokenEnd"},exportAs:["matChipInput","matChipInputFor"],features:[ei]})}return n})(),sOe=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({providers:[tR,{provide:iT,useValue:{separatorKeyCodes:[13]}}],imports:[gn,vW,gn]})}return n})();const CO=n=>{const e=(n=>{const e={};return Object.keys(n).forEach(t=>{n[t]&&(e[t]=n[t])}),e})(n);return Object.entries(e).map(([t,r])=>`${(n=>n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`))(t)}:${r}`).join(";")};class yY extends Error{constructor(e){super(e),this.name=this.constructor.name}}function Ir(n){this.content=n}Ir.prototype={constructor:Ir,find:function(n){for(var e=0;e>1}},Ir.from=function(n){if(n instanceof Ir)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Ir(e)};const vY=Ir;function bY(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i!=o){if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)t++;return t}if(i.content.size||o.content.size){let s=bY(i.content,o.content,t+1);if(null!=s)return s}t+=i.nodeSize}else t+=i.nodeSize}}function wY(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(0==i||0==o)return i==o?null:{a:t,b:r};let s=n.child(--i),a=e.child(--o),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:t,b:r};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;ce&&!1!==r(l,i+a,o||null,s)&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,t-u),r,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",s=!0;return this.nodesBetween(e,t,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,t-l):a.isLeaf?i?"function"==typeof i?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);oe)for(let o=0,s=0;se&&((st)&&(a=a.isText?a.cut(Math.max(0,e-s),Math.min(a.text.length,t-s)):a.cut(Math.max(0,e-s-1),Math.min(a.content.size,t-s-1))),r.push(a),i+=a.nodeSize),s=l}return new Y(r,i)}cutByIndex(e,t){return e==t?Y.empty:0==e&&t==this.content.length?this:new Y(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new Y(i,o)}addToStart(e){return new Y([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Y(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let s=i+this.child(r).nodeSize;if(s>=e)return s==e||t>0?aT(r+1,s):aT(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return Y.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new Y(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Y.empty;let t,r=0;for(let i=0;i{class n{constructor(t,r){this.type=t,this.attrs=r}addToSet(t){let r,i=!1;for(let o=0;othis.type.rank&&(r||(r=t.slice(0,o)),r.push(this),i=!0),r&&r.push(s)}}return r||(r=t.slice()),i||r.push(this),r}removeFromSet(t){for(let r=0;ri.type.rank-o.type.rank),r}}return n.none=[],n})();class cT extends Error{}class ie{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=IY(this.content,e+this.openStart,t);return r&&new ie(r,this.openStart,this.openEnd)}removeBetween(e,t){return new ie(EY(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return ie.empty;let r=t.openStart||0,i=t.openEnd||0;if("number"!=typeof r||"number"!=typeof i)throw new RangeError("Invalid input for Slice.fromJSON");return new ie(Y.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new ie(e,r,i)}}function EY(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:s,offset:a}=n.findIndex(t);if(i==e||o.isText){if(a!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(EY(o.content,e-i-1,t-i-1)))}function IY(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),s=n.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,t)?null:n.cut(0,e).append(t).append(n.cut(e));let a=IY(s.content,e-o-1,t);return a&&n.replaceChild(i,s.copy(a))}function dOe(n,e,t){if(t.openStart>n.depth)throw new cT("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new cT("Inconsistent open depths");return TY(n,e,t,0)}function TY(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r=0;o--)i=e.node(o).copy(Y.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}(t,n);return yu(o,xY(n,s,a,e,r))}{let s=n.parent,a=s.content;return yu(s,a.cut(0,n.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}}return yu(o,uT(n,e,r))}function CY(n,e){if(!e.type.compatibleContent(n.type))throw new cT("Cannot join "+e.type.name+" onto "+n.type.name)}function SO(n,e,t){let r=n.node(t);return CY(r,e.node(t)),r}function _u(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function D_(n,e,t,r){let i=(e||n).node(t),o=0,s=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(_u(n.nodeAfter,r),o++));for(let a=o;ai&&SO(n,e,i+1),s=r.depth>i&&SO(t,r,i+1),a=[];return D_(null,n,i,a),o&&s&&e.index(i)==t.index(i)?(CY(o,s),_u(yu(o,xY(n,e,t,r,i+1)),a)):(o&&_u(yu(o,uT(n,e,i+1)),a),D_(e,t,i,a),s&&_u(yu(s,uT(t,r,i+1)),a)),D_(r,null,i,a),new Y(a)}function uT(n,e,t){let r=[];return D_(null,n,t,r),n.depth>t&&_u(yu(SO(n,e,t+1),uT(n,e,t+1)),r),D_(e,null,t,r),new Y(r)}ie.empty=new ie(Y.empty,0,0);class A_{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[3*t],i=0==t?0:this.path[3*t-1]+1;for(let o=0;o0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new dT(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),c=o-l;if(r.push(s,a,i+l),!c||(s=s.child(a),s.isText))break;o=c-1,i+=l+1}return new A_(t,r,o)}static resolveCached(e,t){let r=SY.get(e);if(r)for(let o=0;oe&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),DY(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=Y.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=i;lt.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=Y.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,i,r);return o.type.checkAttrs(o.attrs),o}}rs.prototype.text=void 0;class hT extends rs{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):DY(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new hT(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new hT(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function DY(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class vu{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new gOe(e,t);if(null==r.next)return vu.empty;let i=AY(r);r.next&&r.err("Unexpected trailing text");let o=function IOe(n){let e=Object.create(null);return function t(r){let i=[];r.forEach(s=>{n[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u{c||i.push([a,c=[]]),-1==c.indexOf(u)&&c.push(u)})})});let o=e[r.join(",")]=new vu(r.indexOf(n.length-1)>-1);for(let s=0;sl.concat(o(c,a)),[]);if("seq"!=s.type){if("star"==s.type){let l=t();return r(a,l),i(o(s.expr,l),l),[r(l)]}if("plus"==s.type){let l=t();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}if("opt"==s.type)return[r(a)].concat(o(s.expr,a));if("range"==s.type){let l=a;for(let c=0;cl.to=a)}}(i));return function TOe(n,e){for(let t=0,r=[n];tc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join("\n")}}vu.empty=new vu(!0);class gOe{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function AY(n){let e=[];do{e.push(_Oe(n))}while(n.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function _Oe(n){let e=[];do{e.push(yOe(n))}while(n.next&&")"!=n.next&&"|"!=n.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function yOe(n){let e=function wOe(n){if(n.eat("(")){let e=AY(n);return n.eat(")")||n.err("Missing closing paren"),e}if(!/\W/.test(n.next)){let e=function bOe(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let s=t[o];s.isInGroup(e)&&i.push(s)}return 0==i.length&&n.err("No node type or group '"+e+"' found"),i}(n,n.next).map(t=>(null==n.inline?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}n.err("Unexpected token '"+n.next+"'")}(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else{if(!n.eat("{"))break;e=vOe(n,e)}return e}function RY(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function vOe(n,e){let t=RY(n),r=t;return n.eat(",")&&(r="}"!=n.next?RY(n):-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function MY(n,e){return e-n}function kY(n,e){let t=[];return function r(i){let o=n[i];if(1==o.length&&!o[0].term)return r(o[0].to);t.push(i);for(let s=0;s-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:PY(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new rs(this,this.computeAttrs(e),Y.from(t),Mt.setFrom(r))}createChecked(e=null,t,r){return t=Y.from(t),this.checkContent(t),new rs(this,this.computeAttrs(e),t,Mt.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),(t=Y.from(t)).size){let s=this.contentMatch.fillBefore(t);if(!s)return null;t=s.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(Y.empty,!0);return o?new rs(this,e,t.append(o),Mt.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;tr[o]=new fT(o,t,s));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}}class xOe{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate="string"==typeof r.validate?function COe(n,e,t){let r=t.split("|");return i=>{let o=null===i?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${o}`)}}(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class pT{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=FY(e,i.attrs),this.excluded=null;let o=NY(this.attrs);this.instance=o?new Mt(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Mt(this,PY(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new pT(o,i++,t,s)),r}removeFromSet(e){for(var t=0;t-1}}function LY(n,e){let t=[];for(let r=0;r-1)&&t.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}class bu{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(i=>{if(function DOe(n){return null!=n.tag}(i))this.tags.push(i);else if(function AOe(n){return null!=n.style}(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,t={}){let r=new zY(this,t,!1);return r.addAll(e,Mt.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new zY(this,t,!0);return r.addAll(e,Mt.none,t.from,t.to),ie.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(61!=a.charCodeAt(e.length)||a.slice(e.length+1)!=t))){if(s.getAttrs){let l=s.getAttrs(t);if(!1===l)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let t=[];function r(i){let o=null==i.priority?50:i.priority,s=0;for(;s{r(s=jY(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=jY(s)),s.node||s.ignore||s.mark||(s.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new bu(e,bu.schemaRules(e)))}}const VY={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},ROe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},BY={ol:!0,ul:!0};function UY(n,e,t){return null!=e?(e?1:0)|("full"===e?2:0):n&&"pre"==n.whitespace?3:-5&t}class mT{constructor(e,t,r,i,o,s){this.type=e,this.attrs=t,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=Mt.none,this.match=o||(4&s?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(Y.from(e));if(!t){let i,r=this.type.contentMatch;return(i=r.findWrapping(e.type))?(this.match=r,i):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let i,r=this.content[this.content.length-1];if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let t=Y.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(Y.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!VY.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class zY{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o,i=t.topNode,s=UY(null,t.preserveWhitespace,0)|(r?4:0);o=i?new mT(i.type,i.attrs,Mt.none,!0,t.topMatch||i.type.contentMatch,s):new mT(r?null:e.schema.topNodeType,null,Mt.none,!0,null,s),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,i=this.top,o=2&i.options?"full":this.localPreserveWS||(1&i.options)>0;if("full"===o||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)r="full"!==o?r.replace(/\r?\n|\r/g," "):r.replace(/\r\n?/g,"\n");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=i.content[i.content.length-1],a=e.previousSibling;(!s||a&&"BR"==a.nodeName||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),t),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let i=this.localPreserveWS,o=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a,s=e.nodeName.toLowerCase();BY.hasOwnProperty(s)&&this.parser.normalizeLists&&function MOe(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=1==e.nodeType?e.nodeName.toLowerCase():null;r&&BY.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):"li"==r?t=e:r&&(t=null)}}(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:ROe.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,t);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,u=this.needsBlock;if(VY.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=l&&l.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),c&&this.sync(o),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,l,c,!1===l.consuming?a:void 0)}this.localPreserveWS=i}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"==e.nodeName&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let i=0;i!l.clearMark(c)):t.concat(this.parser.schema.marks[l.mark].create(l.attrs)),!1!==l.consuming)break;a=l}}return t}addElementByRule(e,t,r,i){let o,s;if(t.node)if(s=this.parser.schema.nodes[t.node],s.isLeaf)this.insertNode(s.create(t.attrs),r)||this.leafFallback(e,r);else{let l=this.enter(s,t.attrs||null,r,t.preserveWhitespace);l&&(o=!0,r=l)}else r=r.concat(this.parser.schema.marks[t.mark].create(t.attrs));let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r));else{let l=e;"string"==typeof t.contentElement?l=e.querySelector(t.contentElement):"function"==typeof t.contentElement?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}o&&this.sync(a)&&this.open--}addAll(e,t,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,a=null==i?null:e.childNodes[i];s!=a;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,t);this.findAtPoint(e,o)}findPlace(e,t){let r,i;for(let o=this.open;o>=0;o--){let s=this.nodes[o],a=s.findWrapping(e);if(a&&(!r||r.length>a.length)&&(r=a,i=s,!a.length)||s.solid)break}if(!r)return null;this.sync(i);for(let o=0;o!(s.type?s.type.allowsMarkType(c.type):HY(c.type,e))||(l=c.addToSet(l),!1)),this.nodes.push(new mT(e,t,l,i,null,a)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!(!this.isOpen&&!this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=1)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),o=(i?0:1)-(r?r.depth+1:0),s=(a,l)=>{for(;a>=0;a--){let c=t[a];if(""==c){if(a==t.length-1||0==a)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}{let u=l>0||0==l&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return s(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function kOe(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function jY(n){let e={};for(let t in n)e[t]=n[t];return e}function HY(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],s=a=>{o.push(a);for(let l=0;l{if(o.length||s.marks.length){let a=0,l=0;for(;a=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&gT(AO(r),i(e,t),null,e.attrs)}static renderSpec(e,t,r=null,i){return gT(e,t,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new wu(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=$Y(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return $Y(e.marks)}}function $Y(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function AO(n){return n.document||window.document}const qY=new WeakMap;function gT(n,e,t,r){if("string"==typeof e)return{dom:n.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let o,i=e[0];if("string"!=typeof i)throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=function NOe(n){let e=qY.get(n);return void 0===e&&qY.set(n,e=function POe(n){let e=null;return function t(r){if(r&&"object"==typeof r)if(Array.isArray(r))if("string"==typeof r[0])e||(e=[]),e.push(r);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(t=i.slice(0,s),i=i.slice(s+1));let a,l=t?n.createElementNS(t,i):n.createElement(i),c=e[1],u=1;if(c&&"object"==typeof c&&null==c.nodeType&&!Array.isArray(c)){u=2;for(let d in c)if(null!=c[d]){let f=d.indexOf(" ");f>0?l.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):l.setAttribute(d,c[d])}}for(let d=u;du)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}{let{dom:p,contentDOM:m}=gT(n,f,t,r);if(l.appendChild(p),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:l,contentDOM:a}}const GY=Math.pow(2,16);function OOe(n,e){return n+e*GY}function KY(n){return 65535&n}class RO{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class Pi{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Pi.empty)return Pi.empty}recover(e){let t=0,r=KY(e);if(!this.inverted)for(let i=0;ie)break;let c=this.ranges[a+o],u=this.ranges[a+s],d=l+c;if(e<=d){let p=l+i+((c?e==l?-1:e==d?1:t:t)<0?0:u);if(r)return p;let m=e==(t<0?l:d)?null:OOe(a/3,e-l),_=e==l?2:e==d?1:4;return(t<0?e!=l:e!=d)&&(_|=8),new RO(p,_,m)}i+=u-c}return r?e+i:new RO(e+i,0,null)}touches(e,t){let r=0,i=KY(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;ae)break;let c=this.ranges[a+o];if(e<=l+c&&a==3*i)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=i&&i>t?r-i-1:void 0)}}invert(){let e=new yf;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;ro&&ls.isAtom&&a.type.allowsMarkType(this.mark.type)?s.mark(this.mark.addToSet(s.marks)):s,i),t.openStart,t.openEnd);return An.fromReplace(e,this.from,this.to,o)}invert(){return new is(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Tl(t.pos,r.pos,this.mark)}merge(e){return e instanceof Tl&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Tl(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Tl(t.from,t.to,e.markFromJSON(t.mark))}}Tr.jsonID("addMark",Tl);class is extends Tr{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new ie(kO(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return An.fromReplace(e,this.from,this.to,r)}invert(){return new Tl(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new is(t.pos,r.pos,this.mark)}merge(e){return e instanceof is&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new is(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new is(t.from,t.to,e.markFromJSON(t.mark))}}Tr.jsonID("removeMark",is);class Cl extends Tr{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return An.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return An.fromReplace(e,this.pos,this.pos+1,new ie(Y.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;ir.pos?null:new cr(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new cr(t.from,t.to,t.gapFrom,t.gapTo,ie.fromJSON(e,t.slice),t.insert,!!t.structure)}}function NO(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function PO(n,e,t,r=t.contentMatch,i=!0){let o=n.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l=0;l--)n.step(s[l])}function BOe(n,e,t){return(0==e||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function k_(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),o=n.$from.index(r),s=n.$to.indexAfter(r);if(r{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let l=n.mapping.slice(r).map(t+1+o+s.index);n.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function eX(n,e,t,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=n.mapping.slice(r).map(t+1+o);n.replaceWith(s,s+1,e.type.schema.text("\n"))}})}function bf(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=t-2;c>o;c--,u--){let d=i.node(c),f=i.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),m=r&&r[u+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let _=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!_.type.validContent(p))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function yT(n,e){let t=n.resolve(e),r=t.index();return function tX(n,e){return!(!n||!e||n.isLeaf||!function KOe(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:r}=n.type.schema;for(let i=0;i0;i--)this.placed=Y.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&1==o.childCount;)o=o.firstChild.content,s--,a--;let l=new ie(o,s,a);return e>-1?new cr(r.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||r.pos!=this.$to.pos?new Cr(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}t=o.content}for(let t=1;t<=2;t++)for(let r=1==t?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=LO(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let u,{type:l,match:c}=this.frontier[a],d=null;if(1==t&&(s?c.matchType(s.type)||(d=c.fillBefore(Y.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:d};if(2==t&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=LO(e,t);return!(!i.childCount||i.firstChild.isLeaf||(this.unplaced=new ie(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),0))}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=LO(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new ie(N_(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new ie(N_(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let _=0;_1||0==l||_.content.size)&&(d=v,u.push(rX(_.mark(f.allowedMarks(_.marks)),1==c?l:0,c==a.childCount?p:-1)))}let m=c==a.childCount;m||(p=-1),this.placed=P_(this.placed,t,Y.from(u)),this.frontier[t].match=d,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let _=0,v=a;_1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],o=t=0;a--){let{match:l,type:c}=this.frontier[a],u=VO(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:t,fit:s,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=P_(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=P_(this.placed,this.depth,Y.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(Y.empty,!0);t.childCount&&(this.placed=P_(this.placed,this.frontier.length,t))}}function N_(n,e,t){return 0==e?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(N_(n.firstChild.content,e-1,t)))}function P_(n,e,t){return 0==e?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(P_(n.lastChild.content,e-1,t)))}function LO(n,e){for(let t=0;t1&&(r=r.replaceChild(0,rX(r.firstChild,e-1,1==r.childCount?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(Y.empty,!0)))),n.copy(r)}function VO(n,e,t,r,i){let o=n.node(e),s=i?n.indexAfter(e):n.index(e);if(s==o.childCount&&!t.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function JOe(n,e,t){for(let r=t;rr){let o=i.contentMatchAt(0),s=o.fillBefore(n).append(n);n=s.append(o.matchFragment(s).fillBefore(Y.empty,!0))}return n}function oX(n,e){let t=[];for(let i=Math.min(n.depth,e.depth);i>=0;i--){let o=n.start(i);if(oe.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&t.push(i)}return t}class wf extends Tr{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return An.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return An.fromReplace(e,this.pos,this.pos+1,new ie(Y.from(i),0,t.isLeaf?0:1))}getMap(){return Pi.empty}invert(e){return new wf(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new wf(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new wf(t.pos,t.attr,t.value)}}Tr.jsonID("attr",wf);class O_ extends Tr{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return An.ok(r)}getMap(){return Pi.empty}invert(e){return new O_(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new O_(t.attr,t.value)}}Tr.jsonID("docAttr",O_);let Ef=class extends Error{};Ef=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},(Ef.prototype=Object.create(Error.prototype)).constructor=Ef,Ef.prototype.name="TransformError";class iFe{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new yf}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Ef(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=ie.empty){let i=FO(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new ie(Y.from(r),0,0))}delete(e,t){return this.replace(e,t,ie.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return function tFe(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),o=n.doc.resolve(t);if(nX(i,o,r))return n.step(new Cr(e,t,r));let s=oX(i,n.doc.resolve(t));0==s[s.length-1]&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let f=i.depth,p=i.pos-1;f>0;f--,p--){let m=i.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(f)>-1?a=f:i.before(f)==p&&s.splice(1,0,-f)}let l=s.indexOf(a),c=[],u=r.openStart;for(let f=r.content,p=0;;p++){let m=f.firstChild;if(c.push(m),p==r.openStart)break;f=m.content}for(let f=u-1;f>=0;f--){let p=c[f],m=eFe(p.type);if(m&&!p.sameMarkup(i.node(Math.abs(a)-1)))u=f;else if(m||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+u+1)%(r.openStart+1),m=c[p];if(m)for(let _=0;_=0&&(n.replace(e,t,r),!(n.steps.length>d));f--){let p=s[f];p<0||(e=i.before(p),t=o.after(p))}}(this,e,t,r),this}replaceRangeWith(e,t,r){return function nFe(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=function YOe(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(0==r.parentOffset)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,t))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,t))return r.after(i+1);if(o0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return n.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&t>r.end(s)&&i.end(s)-t!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return n.delete(r.before(s),t);n.delete(e,t)}(this,e,t),this}lift(e,t){return function UOe(n,e,t){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),a=i.after(o+1),l=s,c=a,u=Y.empty,d=0;for(let m=o,_=!1;m>t;m--)_||r.index(m)>0?(_=!0,u=Y.from(r.node(m).copy(u)),d++):l--;let f=Y.empty,p=0;for(let m=o,_=!1;m>t;m--)_||i.after(m+1)=0;s--){if(r.size){let a=t[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Y.from(t[s].type.create(t[s].attrs,r))}let i=e.start,o=e.end;n.step(new cr(i,o,i,o,new ie(r,0,0),t.length,!0))}(this,e,t),this}setBlockType(e,t=e,r,i=null){return function $Oe(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(s,a)=>{let l="function"==typeof i?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,l)&&function qOe(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}(n.doc,n.mapping.slice(o).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let p="pre"==r.whitespace,m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!m?c=!1:!p&&m&&(c=!0)}!1===c&&eX(n,s,a,o),PO(n,n.mapping.slice(o).map(a,1),r,void 0,null===c);let u=n.mapping.slice(o),d=u.map(a,1),f=u.map(a+s.nodeSize,1);return n.step(new cr(d,f,d+1,f-1,new ie(Y.from(r.create(l,null,s.marks)),0,0),1,!0)),!0===c&&JY(n,s,a,o),!1}})}(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return function WOe(n,e,t,r,i){let o=n.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);let s=t.create(r,null,i||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,s);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new cr(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new ie(Y.from(s),0,0),1,!0))}(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new wf(e,t,r)),this}setDocAttribute(e,t){return this.step(new O_(e,t)),this}addNodeMark(e,t){return this.step(new Cl(e,t)),this}removeNodeMark(e,t){if(!(t instanceof Mt)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(!(t=t.isInSet(r.marks)))return this}return this.step(new vf(e,t)),this}split(e,t=1,r){return function GOe(n,e,t=1,r){let i=n.doc.resolve(e),o=Y.empty,s=Y.empty;for(let a=i.depth,l=i.depth-t,c=t-1;a>l;a--,c--){o=Y.from(i.node(a).copy(o));let u=r&&r[c];s=Y.from(u?u.type.create(u.attrs,s):i.node(a).copy(s))}n.step(new Cr(e,e,new ie(o.append(s),t,t),!0))}(this,e,t,r),this}addMark(e,t,r){return function LOe(n,e,t,r){let s,a,i=[],o=[];n.doc.nodesBetween(e,t,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),p=Math.min(c+l.nodeSize,t),m=r.addToSet(d);for(let _=0;_n.step(l)),o.forEach(l=>n.step(l))}(this,e,t,r),this}removeMark(e,t,r){return function VOe(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof pT){let u,c=s.marks;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,t);for(let u=0;un.step(new is(s.from,s.to,s.style)))}(this,e,t,r),this}clearIncompatible(e,t,r){return PO(this,e,t,r),this}}const BO=Object.create(null);class rt{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new UO(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;o--){let s=t<0?If(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):If(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(s)return s}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Oi(e.node(0))}static atStart(e){return If(e,e,0,0,1)||new Oi(e)}static atEnd(e){return If(e,e,e.content.size,e.childCount,-1)||new Oi(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=BO[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in BO)throw new RangeError("Duplicate use of selection JSON ID "+e);return BO[e]=t,t.prototype.jsonID=e,t}getBookmark(){return lt.between(this.$anchor,this.$head).getBookmark()}}rt.prototype.visible=!0;class UO{constructor(e,t){this.$from=e,this.$to=t}}let sX=!1;function aX(n){!sX&&!n.parent.inlineContent&&(sX=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class lt extends rt{constructor(e,t=e){aX(e),aX(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return rt.near(r);let i=e.resolve(t.map(this.anchor));return new lt(i.parent.inlineContent?i:r,r)}replace(e,t=ie.empty){if(super.replace(e,t),t==ie.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof lt&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new vT(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new lt(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let o=rt.findFrom(t,r,!0)||rt.findFrom(t,-r,!0);if(!o)return rt.near(t,r);t=o.$head}return e.parent.inlineContent||(0==i||(e=(rt.findFrom(e,-r,!0)||rt.findFrom(e,r,!0)).$anchor).posnew Oi(n)};function If(n,e,t,r,i,o=!1){if(e.inlineContent)return lt.create(n,t);for(let s=r-(i>0?0:1);i>0?s=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&Ie.isSelectable(a))return Ie.create(n,t-(i<0?a.nodeSize:0))}else{let l=If(n,a,t+i,i<0?a.childCount:0,i,o);if(l)return l}t+=a.nodeSize*i}return null}function lX(n,e,t){let r=n.steps.length-1;if(r{null==s&&(s=u)}),n.setSelection(rt.near(n.doc.resolve(s),t)))}class sFe extends iFe{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return Mt.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Mt.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let i=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(null==r&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(t);o=r==t?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,i.text(e,o)),this.selection.empty||this.setSelection(rt.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function dX(n,e){return e&&n?n.bind(e):n}class F_{constructor(e,t,r){this.name=e,this.init=dX(t.init,r),this.apply=dX(t.apply,r)}}const aFe=[new F_("doc",{init:n=>n.doc||n.schema.topNodeType.createAndFill(),apply:n=>n.doc}),new F_("selection",{init:(n,e)=>n.selection||rt.atStart(e.doc),apply:n=>n.selection}),new F_("storedMarks",{init:n=>n.storedMarks||null,apply:(n,e,t,r)=>r.selection.$cursor?n.storedMarks:null}),new F_("scrollToSelection",{init:()=>0,apply:(n,e)=>n.scrolledIntoView?e+1:e})];class jO{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=aFe.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new F_(r.key,r.spec.state,r))})}}class Tf{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;rr.toJSON())),e&&"object"==typeof e)for(let r in e){if("doc"==r||"selection"==r)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(t[r]=o.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new jO(e.schema,e.plugins),o=new Tf(i);return i.fields.forEach(s=>{if("doc"==s.name)o.doc=rs.fromJSON(e.schema,t.doc);else if("selection"==s.name)o.selection=rt.fromJSON(o.doc,t.selection);else if("storedMarks"==s.name)t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(t,a))return void(o[s.name]=c.fromJSON.call(l,e,t[a],o))}o[s.name]=s.init(e,o)}}),o}}function hX(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):"handleDOMEvents"==r&&(i=hX(i,e,{})),t[r]=i}return t}class ss{constructor(e){this.spec=e,this.props={},e.props&&hX(e.props,this,this.props),this.key=e.key?e.key.key:fX("plugin")}getState(e){return e[this.key]}}const HO=Object.create(null);function fX(n){return n in HO?n+"$"+ ++HO[n]:(HO[n]=0,n+"$")}class Js{constructor(e="key"){this.key=fX(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ur=function(n){for(var e=0;;e++)if(!(n=n.previousSibling))return e},L_=function(n){let e=n.assignedSlot||n.parentNode;return e&&11==e.nodeType?e.host:e};let $O=null;const ea=function(n,e,t){let r=$O||($O=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},Eu=function(n,e,t,r){return t&&(pX(n,e,t,r,-1)||pX(n,e,t,r,1))},cFe=/^(img|br|input|textarea|hr)$/i;function pX(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:to(n))){let o=n.parentNode;if(!o||1!=o.nodeType||V_(n)||cFe.test(n.nodeName)||"false"==n.contentEditable)return!1;e=ur(n)+(i<0?0:1),n=o}else{if(1!=n.nodeType)return!1;if("false"==(n=n.childNodes[e+(i<0?-1:0)]).contentEditable)return!1;e=i<0?to(n):0}}}function to(n){return 3==n.nodeType?n.nodeValue.length:n.childNodes.length}function V_(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const wT=function(n){return n.focusNode&&Eu(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Iu(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const as=typeof navigator<"u"?navigator:null,mX=typeof document<"u"?document:null,xl=as&&as.userAgent||"",qO=/Edge\/(\d+)/.exec(xl),gX=/MSIE \d/.exec(xl),WO=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(xl),di=!!(gX||WO||qO),Sl=gX?document.documentMode:WO?+WO[1]:qO?+qO[1]:0,Eo=!di&&/gecko\/(\d+)/i.test(xl);Eo&&/Firefox\/(\d+)/.exec(xl);const GO=!di&&/Chrome\/(\d+)/.exec(xl),xr=!!GO,_X=GO?+GO[1]:0,Hr=!di&&!!as&&/Apple Computer/.test(as.vendor),Cf=Hr&&(/Mobile\/\w+/.test(xl)||!!as&&as.maxTouchPoints>2),no=Cf||!!as&&/Mac/.test(as.platform),mFe=!!as&&/Win/.test(as.platform),ta=/Android \d/.test(xl),B_=!!mX&&"webkitFontSmoothing"in mX.documentElement.style,gFe=B_?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function _Fe(n){let e=n.defaultView&&n.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function na(n,e){return"number"==typeof n?n:n[e]}function yFe(n){let e=n.getBoundingClientRect();return{left:e.left,right:e.left+n.clientWidth*(e.width/n.offsetWidth||1),top:e.top,bottom:e.top+n.clientHeight*(e.height/n.offsetHeight||1)}}function yX(n,e,t){let r=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,o=n.dom.ownerDocument;for(let s=t||n.dom;s;s=L_(s)){if(1!=s.nodeType)continue;let a=s,l=a==o.body,c=l?_Fe(o):yFe(a),u=0,d=0;if(e.topc.bottom-na(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+na(i,"top")-c.top:e.bottom-c.bottom+na(i,"bottom")),e.leftc.right-na(r,"right")&&(u=e.right-c.right+na(i,"right")),u||d)if(l)o.defaultView.scrollBy(u,d);else{let f=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let m=a.scrollLeft-f,_=a.scrollTop-p;e={left:e.left-m,top:e.top-_,right:e.right-m,bottom:e.bottom-_}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function vX(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=L_(r));return e}function bX(n,e){for(let t=0;t=a){s=Math.max(m.bottom,s),a=Math.min(m.top,a);let _=m.left>e.left?m.left-e.left:m.right=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!l&&m.left<=e.left&&m.right>=e.left&&(l=u,c={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!t&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(o=d+1)}}return!t&&l&&(t=l,i=c,r=0),t&&3==t.nodeType?function EFe(n,e){let t=n.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:n,offset:0}}(t,i):!t||r&&1==t.nodeType?{node:n,offset:o}:wX(t,i)}function KO(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function EX(n,e,t){let r=n.childNodes.length;if(r&&t.tope.top&&i++}let c;B_&&i&&1==r.nodeType&&1==(c=r.childNodes[i-1]).nodeType&&"false"==c.contentEditable&&c.getBoundingClientRect().top>=e.top&&i--,r==n.dom&&i==r.childNodes.length-1&&1==r.lastChild.nodeType&&e.top>r.lastChild.getBoundingClientRect().bottom?a=n.state.doc.content.size:(0==i||1!=r.nodeType||"BR"!=r.childNodes[i-1].nodeName)&&(a=function CFe(n,e,t,r){let i=-1;for(let o=e,s=!1;o!=n.dom;){let l,a=n.docView.nearestDesc(o,!0);if(!a)return null;if(1==a.dom.nodeType&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&(!s&&l.left>r.left||l.top>r.top?i=a.posBefore:(!s&&l.right-1?i:n.docView.posFromDOM(e,t,-1)}(n,r,i,e))}null==a&&(a=function TFe(n,e,t){let{node:r,offset:i}=wX(e,t),o=-1;if(1==r.nodeType&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&t.left>(s.left+s.right)/2?1:-1}return n.docView.posFromDOM(r,i,o)}(n,s,e));let l=n.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function IX(n){return n.top=0&&i==r.nodeValue.length?(l--,u=1):t<0?l--:c++,U_(Dl(ea(r,l,c),u),u<0)}{let l=Dl(ea(r,i,i),t);if(Eo&&i&&/\s/.test(r.nodeValue[i-1])&&i=0)}if(null==o&&i&&(t<0||i==to(r))){let l=r.childNodes[i-1],c=3==l.nodeType?ea(l,to(l)-(s?0:1)):1!=l.nodeType||"BR"==l.nodeName&&l.nextSibling?null:l;if(c)return U_(Dl(c,1),!1)}if(null==o&&i=0)}function U_(n,e){if(0==n.width)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function QO(n,e){if(0==n.height)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function CX(n,e,t){let r=n.state,i=n.root.activeElement;r!=e&&n.updateState(e),i!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),i!=n.dom&&i&&i.focus()}}const AFe=/[\u0590-\u08ac]/;let xX=null,SX=null,DX=!1;class z_{constructor(e,t,r,i){this.parent=e,this.children=t,this.dom=r,this.contentDOM=i,this.dirty=0,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tur(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(null==i&&t==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,i=e;i;i=i.parentNode){let s,o=this.getDesc(i);if(o&&(!t||o.node)){if(!r||!(s=o.nodeDOM)||(1==s.nodeType?s.contains(1==e.nodeType?e:e.parentNode):s==e))return o;r=!1}}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;te||s instanceof kX){i=e-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof RX&&o.side>=0;r--);if(t<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,o&&o.dom.parentNode!=this.contentDOM;r--,s=!1);return o&&t&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,t):{node:this.contentDOM,offset:o?ur(o.dom)+1:0}}{let o,s=!0;for(;o=r=u&&t<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,t,u);e=s;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=ur(f.dom)+1;break}e-=f.size}-1==i&&(i=0)}if(i>-1&&(c>t||a==this.children.length-1)){t=c;for(let u=a+1;um&&st){let m=a;a=l,l=m}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,i=0;i=r:er){let a=r+o.border,l=s-o.border;if(e>=a&&t<=l)return this.dirty=e==r||t==s?2:1,void(e!=a||t!=l||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-a,t-a):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}r=s}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=1==e?2:1;t.dirtyo?o.parent?o.parent.posBeforeChild(o):void 0:i)),!t.type.spec.raw){if(1!=s.nodeType){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class kFe extends z_{constructor(e,t,r,i){super(e,[],t,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class Cu extends z_{constructor(e,t,r,i,o){super(e,[],r,i),this.mark=t,this.spec=o}static create(e,t,r,i){let o=i.nodeViews[t.type.name],s=o&&o(t,i,r);return(!s||!s.dom)&&(s=wu.renderSpec(document,t.type.spec.toDOM(t,r),null,t.attrs)),new Cu(e,t,s.dom,s.contentDOM||s.dom,s)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=XO(o,0,e,r));for(let a=0;al?l.parent?l.parent.posBeforeChild(l):void 0:s,r,i),u=c&&c.dom,d=c&&c.contentDOM;if(t.isText)if(u){if(3!=u.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else u=document.createTextNode(t.text);else u||({dom:u,contentDOM:d}=wu.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!d&&!t.isText&&"BR"!=u.nodeName&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let f=u;return u=OX(u,r,t),c?l=new NFe(e,t,r,i,u,d||null,f,c,o,s+1):t.isText?new ET(e,t,r,i,u,f,o):new Al(e,t,r,i,u,d||null,f,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Y.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,r){return 0==this.dirty&&e.eq(this.node)&&IT(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,i=t,o=e.composing?this.localCompositionInfo(e,t):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new OFe(this,s&&s.node,e);(function VFe(n,e,t,r){let i=e.locals(n),o=0;if(0==i.length){for(let c=0;co;)a.push(i[s++]);let m=o+f.nodeSize;if(f.isText){let v=m;s!v.inline):a.slice(),e.forChild(o,f),p),o=m}})(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?Mt.none:this.node.child(u).marks,r,e),l.placeWidget(c,e,i)},(c,u,d,f)=>{let p;l.syncToMarks(c.marks,r,e),l.findNodeMatch(c,u,d,f)||a&&e.state.selection.from>i&&e.state.selection.to-1&&l.updateNodeAt(c,u,d,p,e)||l.updateNextNode(c,u,d,e,f,i)||l.addNode(c,u,d,e,i),i+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(s&&this.protectLocalComposition(e,s),NX(this.contentDOM,this.children,e),Cf&&function BFe(n){if("UL"==n.nodeName||"OL"==n.nodeName){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n),n.style.cssText=e}}(this.dom))}localCompositionInfo(e,t){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof lt)||rt+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,a=function UFe(n,e,t,r){for(let i=0,o=0;i=t){if(o>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a=0&&c+e.length+a>=t)return a+c;if(t==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}(this.node.content,s,r-t,i-t);return a<0?null:{node:o,pos:a,text:s}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:i}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new kFe(this,o,t,i);e.input.compositionNodes.push(s),this.children=XO(this.children,r,r+i.length,e,s)}update(e,t,r,i){return!(3==this.dirty||!e.sameMarkup(this.node)||(this.updateInner(e,t,r,i),0))}updateInner(e,t,r,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(IT(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,r=this.dom;this.dom=PX(this.dom,this.nodeDOM,YO(this.outerDeco,this.node,t),YO(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function MX(n,e,t,r,i){OX(r,e,n);let o=new Al(void 0,n,e,t,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class ET extends Al{constructor(e,t,r,i,o,s,a){super(e,t,r,i,o,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,i){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node)||(this.updateOuterDeco(t),(0!=this.dirty||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=0,0))}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,r){let i=this.node.cut(e,t),o=document.createTextNode(i.text);return new ET(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(0==e||t==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class kX extends z_{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class NFe extends Al{constructor(e,t,r,i,o,s,a,l,c,u){super(e,t,r,i,o,s,a,c,u),this.spec=l}update(e,t,r,i){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,t,r);return o&&this.updateInner(e,t,r,i),o}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,i){this.spec.setSelection?this.spec.setSelection(e,t,r.root):super.setSelection(e,t,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function NX(n,e,t){let r=n.firstChild,i=!1;for(let o=0;o0;){let a;for(;;)if(r){let c=t.children[r-1];if(!(c instanceof Cu)){a=c,r--;break}t=c,r=c.children.length}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let l=a.node;if(l){if(l!=n.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let r=e;r>1,s=Math.min(o,e.length);for(;i-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=Cu.create(this.top,e[o],t,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,r,i){let s,o=-1;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,t,r))o=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a=t||u<=e?o.push(l):(ct&&o.push(l.slice(t-c,l.size,r)))}return o}function ZO(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),o=i&&0==i.size,s=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(s<0)return null;let l,c,a=r.resolve(s);if(wT(t)){for(l=s;i&&!i.node;)i=i.parent;let d=i.node;if(i&&d.isAtom&&Ie.isSelectable(d)&&i.parent&&(!d.isInline||!function hFe(n,e,t){for(let r=0==e,i=e==to(n);r||i;){if(n==t)return!0;let o=ur(n);if(!(n=n.parentNode))return!1;r=r&&0==o,i=i&&o==to(n)}}(t.focusNode,t.focusOffset,i.dom))){let f=i.posBefore;c=new Ie(s==f?a:r.resolve(f))}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let d=s,f=s;for(let p=0;p{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!LX(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const VX=Hr||xr&&_X<63;function BX(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),i=ri(n,e,t))||lt.between(e,t,r)}function HX(n){return!(n.editable&&!n.hasFocus())&&$X(n)}function $X(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function tF(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),o=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return o&&rt.findFrom(o,e)}function Rl(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function qX(n,e,t){let r=n.state.selection;if(!(r instanceof lt)){if(r instanceof Ie&&r.node.isInline)return Rl(n,new lt(e>0?r.$to:r.$from));{let i=tF(n.state,e);return!!i&&Rl(n,i)}}if(t.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=n.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return Rl(n,new lt(r.$anchor,s))}if(!r.empty)return!1;if(n.endOfTextblock(e>0?"forward":"backward")){let i=tF(n.state,e);return!!(i&&i instanceof Ie)&&Rl(n,i)}if(!(no&&t.indexOf("m")>-1)){let s,i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let a=e<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(s=n.docView.descAt(a))&&!s.contentDOM)&&(Ie.isSelectable(o)?Rl(n,new Ie(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):!!B_&&Rl(n,new lt(n.state.doc.resolve(e<0?a:a+o.nodeSize))))}}function TT(n){return 3==n.nodeType?n.nodeValue.length:n.childNodes.length}function H_(n,e){let t=n.pmViewDesc;return t&&0==t.size&&(e<0||n.nextSibling||"BR"!=n.nodeName)}function Sf(n,e){return e<0?function $Fe(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,s=!1;for(Eo&&1==t.nodeType&&r0){if(1!=t.nodeType)break;{let a=t.childNodes[r-1];if(H_(a,-1))i=t,o=--r;else{if(3!=a.nodeType)break;t=a,r=t.nodeValue.length}}}else{if(WX(t))break;{let a=t.previousSibling;for(;a&&H_(a,-1);)i=t.parentNode,o=ur(a),a=a.previousSibling;if(a)t=a,r=TT(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}s?nF(n,t,r):i&&nF(n,i,o)}(n):function qFe(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let o,s,i=TT(t);for(;;)if(r{n.state==i&&ra(n)},50)}function GX(n,e){let t=n.state.doc.resolve(e);if(!xr&&!mFe&&t.parent.inlineContent){let i=n.coordsAtPos(e);if(e>t.start()){let o=n.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(n.dom).direction?"rtl":"ltr"}function KX(n,e,t){let r=n.state.selection;if(r instanceof lt&&!r.empty||t.indexOf("s")>-1||no&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let s=tF(n.state,e);if(s&&s instanceof Ie)return Rl(n,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=r instanceof Oi?rt.near(s,e):rt.findFrom(s,e);return!!a&&Rl(n,a)}return!1}function QX(n,e){if(!(n.state.selection instanceof lt))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(o&&!o.isText){let s=n.state.tr;return e<0?s.delete(t.pos-o.nodeSize,t.pos):s.delete(t.pos,t.pos+o.nodeSize),n.dispatch(s),!0}return!1}function YX(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function rF(n,e){n.someProp("transformCopied",p=>{e=p(e,n)});let t=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let p=r.firstChild;t.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=n.someProp("clipboardSerializer")||wu.fromSchema(n.state.schema),a=iZ(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let u,c=l.firstChild,d=0;for(;c&&1==c.nodeType&&(u=nZ[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let m=a.createElement(u[p]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),d++}c=l.firstChild}return c&&1==c.nodeType&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(t)}`),{dom:l,text:n.someProp("clipboardTextSerializer",p=>p(e,n))||e.content.textBetween(0,e.content.size,"\n\n"),slice:e}}function XX(n,e,t,r,i){let s,a,o=i.parent.type.spec.code;if(!t&&!e)return null;let l=e&&(r||o||!t);if(l){if(n.someProp("transformPastedText",f=>{e=f(e,o||r,n)}),o)return e?new ie(Y.from(n.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):ie.empty;let d=n.someProp("clipboardTextParser",f=>f(e,i,r,n));if(d)a=d;else{let f=i.marks(),{schema:p}=n.state,m=wu.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(_=>{let v=s.appendChild(document.createElement("p"));_&&v.appendChild(m.serializeNode(p.text(_,f)))})}}else n.someProp("transformPastedHTML",d=>{t=d(t,n)}),s=function eLe(n){let e=/^(\s*]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let i,t=iZ().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n);if((i=r&&nZ[r[1].toLowerCase()])&&(n=i.map(o=>"<"+o+">").join("")+n+i.map(o=>"").reverse().join("")),t.innerHTML=function JFe(n){let e=window.trustedTypes;return e?(oF||(oF=e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),oF.createHTML(n)):n}(n),i)for(let o=0;o0;d--){let f=s.firstChild;for(;f&&1!=f.nodeType;)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(n.someProp("clipboardParser")||n.someProp("domParser")||bu.fromSchema(n.state.schema)).parseSlice(s,{preserveWhitespace:!(!l&&!u),context:i,ruleFromNode:f=>"BR"!=f.nodeName||f.nextSibling||!f.parentNode||XFe.test(f.parentNode.nodeName)?null:{ignore:!0}})),u)a=function nLe(n,e){if(!n.size)return n;let r,t=n.content.firstChild.type.schema;try{r=JSON.parse(e)}catch{return n}let{content:i,openStart:o,openEnd:s}=n;for(let a=r.length-2;a>=0;a-=2){let l=t.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=Y.from(l.create(r[a+1],i)),o++,s++}return new ie(i,o,s)}(tZ(a,+u[1],+u[2]),u[4]);else if(a=ie.maxOpen(function ZFe(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let o,i=e.node(t).contentMatchAt(e.index(t)),s=[];if(n.forEach(a=>{if(!s)return;let c,l=i.findWrapping(a.type);if(!l)return s=null;if(c=s.length&&o.length&&JX(l,o,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=eZ(s[s.length-1],o.length));let u=ZX(a,l);s.push(u),i=i.matchType(u.type),o=l}}),s)return Y.from(s)}return n}(a.content,i),!0),a.openStart||a.openEnd){let d=0,f=0;for(let p=a.content.firstChild;d{a=d(a,n)}),a}const XFe=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function ZX(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,Y.from(n));return n}function JX(n,e,t,r,i){if(i1&&(o=0),i=t&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(Y.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,s.copy(a))}function tZ(n,e,t){return e{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>aF(n,r))})}function aF(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return!!r&&(r(n,e)||e.defaultPrevented)})}function aLe(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||11==t.nodeType||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function CT(n){return{left:n.clientX,top:n.clientY}}function lF(n,e,t,r,i){if(-1==r)return!1;let o=n.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(n.someProp(e,a=>s>o.depth?a(n,t,o.nodeAfter,o.before(s),i,!0):a(n,t,o.node(s),o.before(s),i,!1)))return!0;return!1}function Df(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);"pointer"==t&&r.setMeta("pointer",!0),n.dispatch(r)}function fLe(n,e,t,r){return lF(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function pLe(n,e,t,r){return lF(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||function mLe(n,e,t){if(0!=t.button)return!1;let r=n.state.doc;if(-1==e)return!!r.inlineContent&&(Df(n,lt.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)Df(n,lt.create(r,a+1,a+1+s.content.size),"pointer");else{if(!Ie.isSelectable(s))continue;Df(n,Ie.create(r,a),"pointer")}return!0}}(n,t,r)}function cF(n){return xT(n)}qr.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=16==t.keyCode||t.shiftKey,!sZ(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!ta||!xr||13!=t.keyCode))if(229!=t.keyCode&&n.domObserver.forceFlush(),!Cf||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)n.someProp("handleKeyDown",r=>r(n,t))||function YFe(n,e){let t=e.keyCode,r=function QFe(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}(e);if(8==t||no&&72==t&&"c"==r)return QX(n,-1)||Sf(n,-1);if(46==t&&!e.shiftKey||no&&68==t&&"c"==r)return QX(n,1)||Sf(n,1);if(13==t||27==t)return!0;if(37==t||no&&66==t&&"c"==r){let i=37==t?"ltr"==GX(n,n.state.selection.from)?-1:1:-1;return qX(n,i,r)||Sf(n,i)}if(39==t||no&&70==t&&"c"==r){let i=39==t?"ltr"==GX(n,n.state.selection.from)?1:-1:1;return qX(n,i,r)||Sf(n,i)}return 38==t||no&&80==t&&"c"==r?KX(n,-1,r)||Sf(n,-1):40==t||no&&78==t&&"c"==r?function KFe(n){if(!Hr||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&1==e.nodeType&&0==t&&e.firstChild&&"false"==e.firstChild.contentEditable){let r=e.firstChild;YX(n,r,"true"),setTimeout(()=>YX(n,r,"false"),20)}return!1}(n)||KX(n,1,r)||Sf(n,1):r==(no?"m":"c")&&(66==t||73==t||89==t||90==t)}(n,t)?t.preventDefault():Ml(n,"key");else{let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,Iu(13,"Enter"))),n.input.lastIOSEnter=0)},200)}},qr.keyup=(n,e)=>{16==e.keyCode&&(n.input.shiftKey=!1)},qr.keypress=(n,e)=>{let t=e;if(sZ(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||no&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t)))return void t.preventDefault();let r=n.state.selection;if(!(r instanceof lt&&r.$from.sameParent(r.$to))){let i=String.fromCharCode(t.charCode);!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i))&&n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};const oZ=no?"metaKey":"ctrlKey";$r.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=cF(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&function cLe(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}(t,n.input.lastClick)&&!t[oZ]&&("singleClick"==n.input.lastClick.type?o="doubleClick":"doubleClick"==n.input.lastClick.type&&(o="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:o};let s=n.posAtCoords(CT(t));s&&("singleClick"==o?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new gLe(n,s,t,!!r)):("doubleClick"==o?fLe:pLe)(n,s.pos,s.inside,t)?t.preventDefault():Ml(n,"pointer"))};class gLe{constructor(e,t,r,i){let o,s;if(this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[oZ],this.allowDefault=r.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),s=t.inside;else{let u=e.state.doc.resolve(t.pos);o=u.parent,s=u.depth?u.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&1==l.dom.nodeType?l.dom:null;let{selection:c}=e.state;(0==r.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||c instanceof Ie&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Eo||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ml(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>ra(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(CT(e))),this.updateAllowDefault(e),this.allowDefault||!t?Ml(this.view,"pointer"):function hLe(n,e,t,r,i){return lF(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?function dLe(n,e){if(-1==e)return!1;let r,i,t=n.state.selection;t instanceof Ie&&(r=t.node);let o=n.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(Ie.isSelectable(a)){i=r&&t.$from.depth>0&&s>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?o.before(t.$from.depth):o.before(s);break}}return null!=i&&(Df(n,Ie.create(n.state.doc,i),"pointer"),!0)}(n,t):function uLe(n,e){if(-1==e)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return!!(r&&r.isAtom&&Ie.isSelectable(r))&&(Df(n,new Ie(t),"pointer"),!0)}(n,t))}(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Hr&&this.mightDrag&&!this.mightDrag.node.isAtom||xr&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Df(this.view,rt.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Ml(this.view,"pointer")}move(e){this.updateAllowDefault(e),Ml(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function sZ(n,e){return!!n.composing||!!(Hr&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500)&&(n.input.compositionEndedAt=-2e8,!0)}$r.touchstart=n=>{n.input.lastTouch=Date.now(),cF(n),Ml(n,"pointer")},$r.touchmove=n=>{n.input.lastTouch=Date.now(),Ml(n,"pointer")},$r.contextmenu=n=>cF(n);const _Le=ta?5e3:-1;function aZ(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>xT(n),e))}function lZ(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=function vLe(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function xT(n,e=!1){if(!(ta&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),lZ(n),e||n.docView&&n.docView.dirty){let t=ZO(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):!n.markCursor&&!e||n.state.selection.empty?n.updateState(n.state):n.dispatch(n.state.tr.deleteSelection()),!0}return!1}}qr.compositionstart=qr.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof lt&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>!1===r.type.spec.inclusive)))n.markCursor=n.state.storedMarks||t.marks(),xT(n,!0),n.markCursor=null;else if(xT(n,!e.selection.empty),Eo&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&1==i.nodeType&&0!=o;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(3==s.nodeType){let a=n.domSelection();a&&a.collapse(s,s.nodeValue.length);break}i=s,o=-1}}n.input.composing=!0}aZ(n,_Le)},qr.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,aZ(n,20))};const $_=di&&Sl<15||Cf&&gFe<604;function q_(n,e,t,r,i){let o=XX(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",l=>l(n,i,o||ie.empty)))return!0;if(!o)return!1;let s=function wLe(n){return 0==n.openStart&&0==n.openEnd&&1==n.content.childCount?n.content.firstChild:null}(o),a=s?n.state.tr.replaceSelectionWith(s,r):n.state.tr.replaceSelection(o);return n.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function cZ(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}$r.copy=qr.cut=(n,e)=>{let t=e,r=n.state.selection,i="cut"==t.type;if(r.empty)return;let o=$_?null:t.clipboardData,s=r.content(),{dom:a,text:l}=rF(n,s);o?(t.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function bLe(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}(n,a),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},qr.paste=(n,e)=>{let t=e;if(n.composing&&!ta)return;let r=$_?null:t.clipboardData,i=n.input.shiftKey&&45!=n.input.lastKeyCode;r&&q_(n,cZ(r),r.getData("text/html"),i,t)?t.preventDefault():function ELe(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=n.input.shiftKey&&45!=n.input.lastKeyCode;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?q_(n,r.value,null,i,e):q_(n,r.textContent,r.innerHTML,i,e)},50)}(n,t)};class uZ{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const dZ=no?"altKey":"ctrlKey";$r.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let s,i=n.state.selection,o=i.empty?null:n.posAtCoords(CT(t));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof Ie?i.to-1:i.to)))if(r&&r.mightDrag)s=Ie.create(n.state.doc,r.mightDrag.pos);else if(t.target&&1==t.target.nodeType){let d=n.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=n.docView&&(s=Ie.create(n.state.doc,d.posBefore))}let a=(s||n.state.selection).content(),{dom:l,text:c,slice:u}=rF(n,a);(!t.dataTransfer.files.length||!xr||_X>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData($_?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",$_||t.dataTransfer.setData("text/plain",c),n.dragging=new uZ(u,!t[dZ],s)},$r.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},qr.dragover=qr.dragenter=(n,e)=>e.preventDefault(),qr.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(CT(t));if(!i)return;let o=n.state.doc.resolve(i.pos),s=r&&r.slice;s?n.someProp("transformPasted",m=>{s=m(s,n)}):s=XX(n,cZ(t.dataTransfer),$_?null:t.dataTransfer.getData("text/html"),!1,o);let a=!(!r||t[dZ]);if(n.someProp("handleDrop",m=>m(n,t,s||ie.empty,a)))return void t.preventDefault();if(!s)return;t.preventDefault();let l=s?function XOe(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let i=t.content;for(let o=0;o=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),c=r.node(s),u=!1;if(1==o)u=c.canReplace(l,l,i);else{let d=c.contentMatchAt(l).findWrapping(i.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return 0==a?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}(n.state.doc,o.pos,s):o.pos;null==l&&(l=o.pos);let c=n.state.tr;if(a){let{node:m}=r;m?m.replace(c):c.deleteSelection()}let u=c.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&Ie.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Ie(p));else{let m=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((_,v,E,C)=>m=C),c.setSelection(eF(n,p,c.doc.resolve(m)))}n.focus(),n.dispatch(c.setMeta("uiEvent","drop"))},$r.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&ra(n)},20))},$r.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)},$r.beforeinput=(n,e)=>{if(xr&&ta&&"deleteContentBackward"==e.inputType){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",o=>o(n,Iu(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in qr)$r[n]=qr[n];function W_(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class ST{constructor(e,t){this.toDOM=e,this.spec=t||Su,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:s}=e.mapResult(t.from+i,this.side<0?-1:1);return s?null:new io(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof ST&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&W_(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class kl{constructor(e,t){this.attrs=e,this.spec=t||Su}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new io(o,s,this)}valid(e,t){return t.from=e&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;se){let a=this.children[s]+1;this.children[s+2].findInner(e-a,t-a,r,i+a,o)}}map(e,t,r){return this==Sr||0==e.maps.length?this:this.mapInner(e,t,0,0,r||Su)}mapInner(e,t,r,i,o){let s;for(let a=0;a{let v=_-m-(p-f);for(let E=0;EC+u-d)continue;let R=a[E]+u-d;p>=R?a[E+1]=f<=R?-2:-1:f>=u&&v&&(a[E]+=v,a[E+1]+=v)}d+=v}),u=t.maps[c].map(u,-1)}let l=!1;for(let c=0;c=r.content.size){l=!0;continue}let p=t.map(n[c+1]+o,-1)-i,{index:m,offset:_}=r.content.findIndex(d),v=r.maybeChild(m);if(v&&_==d&&_+v.nodeSize==p){let E=a[c+2].mapInner(t,v,u+1,n[c]+o+1,s);E!=Sr?(a[c]=d,a[c+1]=p,a[c+2]=E):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=function TLe(n,e,t,r,i,o,s){function a(l,c){for(let u=0;u{let u,c=l+r;if(u=fZ(t,a,c)){for(i||(i=this.children.slice());oa&&d.to=e){this.children[a]==e&&(r=this.children[a+2]);break}let o=e+1,s=o+t.content.size;for(let a=0;ao&&l.type instanceof kl){let c=Math.max(o,l.from)-o,u=Math.min(s,l.to)-o;ci.map(e,t,Su));return Nl.from(r)}forChild(e,t){if(t.isLeaf)return Rn.empty;let r=[];for(let i=0;it instanceof Rn)?e:e.reduce((t,r)=>t.concat(r instanceof Rn?r:r.members),[]))}}forEachSet(e){for(let t=0;tt&&s.to{let c=fZ(n,a,l+t);if(c){o=!0;let u=DT(c,a,t+l+1,r);u!=Sr&&i.push(l,l+a.nodeSize,u)}});let s=hZ(o?pZ(n):n,-t).sort(Du);for(let a=0;a0;)e++;n.splice(e,0,t)}function hF(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=Sr&&e.push(r)}),n.cursorWrapper&&e.push(Rn.create(n.state.doc,[n.cursorWrapper.deco])),Nl.from(e)}const CLe={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},xLe=di&&Sl<=11;class SLe{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class DLe{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new SLe,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i"childList"==i.type&&i.removedNodes.length||"characterData"==i.type&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),xLe&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,CLe)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;tthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(HX(this.view)){if(this.suppressingSelectionUpdates)return ra(this.view);if(di&&Sl<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Eu(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let r,t=new Set;for(let o=e.focusNode;o;o=L_(o))t.add(o);for(let o=e.anchorNode;o;o=L_(o))if(t.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);return i&&i.ignoreMutation({type:"selection",target:3==r.nodeType?r.parentNode:r})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&HX(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(e.editable)for(let u=0;u"BR"==d.nodeName);if(2==u.length){let[d,f]=u;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of u){let p=f.parentNode;p&&"LI"==p.nodeName&&(!d||MLe(e,d)!=p)&&f.remove()}}}let c=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(o>-1&&(e.docView.markDirty(o,s),function ALe(n){if(!gZ.has(n)&&(gZ.set(n,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace))){if(n.requiresGeckoHackNode=Eo,_Z)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),_Z=!0}}(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||ra(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(r==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if("childList"==e.type){for(let u=0;ue.content.size?null:eF(n,e.resolve(t.anchor),e.resolve(t.head))}function fF(n,e,t){let r=n.depth,i=e?n.end():n.pos;for(;r>0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,i++,e=!1;if(t){let o=n.node(r).maybeChild(n.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function bZ(n){if(2!=n.length)return!1;let e=n.charCodeAt(0),t=n.charCodeAt(1);return e>=56320&&e<=57343&&t>=55296&&t<=56319}class BLe{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new iLe,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(CZ),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=IZ(this),EZ(this),this.nodeViews=TZ(this),this.docView=MX(this.state.doc,wZ(this),hF(this),this.dom,this),this.domObserver=new DLe(this,(r,i,o,s)=>function OLe(n,e,t,r,i){let o=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let x=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,A=ZO(n,x);if(A&&!n.state.selection.eq(A)){if(xr&&ta&&13===n.input.lastKeyCode&&Date.now()-100P(n,Iu(13,"Enter"))))return;let M=n.state.tr.setSelection(A);"pointer"==x?M.setMeta("pointer",!0):"key"==x&&M.scrollIntoView(),o&&M.setMeta("composition",o),n.dispatch(M)}return}let s=n.state.doc.resolve(e),a=s.sharedDepth(t);e=s.before(a+1),t=n.state.doc.resolve(t).after(a+1);let f,p,l=n.state.selection,c=function kLe(n,e,t){let c,{node:r,fromOffset:i,toOffset:o,from:s,to:a}=n.docView.parseRange(e,t),l=n.domSelectionRange(),u=l.anchorNode;if(u&&n.dom.contains(1==u.nodeType?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],wT(l)||c.push({node:l.focusNode,offset:l.focusOffset})),xr&&8===n.input.lastKeyCode)for(let v=o;v>i;v--){let E=r.childNodes[v-1],C=E.pmViewDesc;if("BR"==E.nodeName&&!C){o=v;break}if(!C||C.size)break}let d=n.state.doc,f=n.someProp("domParser")||bu.fromSchema(n.state.schema),p=d.resolve(s),m=null,_=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:"pre"!=p.parent.type.whitespace||"full",findPositions:c,ruleFromNode:NLe,context:p});if(c&&null!=c[0].pos){let v=c[0].pos,E=c[1]&&c[1].pos;null==E&&(E=v),m={anchor:v+s,head:E+s}}return{doc:_,sel:m,from:s,to:a}}(n,e,t),u=n.state.doc,d=u.slice(c.from,c.to);8===n.input.lastKeyCode&&Date.now()-100=s?o-r:0;o-=l,o&&o=a?o-r:0;o-=l,o&&oDate.now()-225||ta)&&i.some(x=>1==x.nodeType&&!PLe.test(x.nodeName))&&(!m||m.endA>=m.endB)&&n.someProp("handleKeyDown",x=>x(n,Iu(13,"Enter"))))return void(n.input.lastIOSEnter=0);if(!m){if(!(r&&l instanceof lt&&!l.empty&&l.$head.sameParent(l.$anchor))||n.composing||c.sel&&c.sel.anchor!=c.sel.head){if(c.sel){let x=vZ(n,n.state.doc,c.sel);if(x&&!x.eq(n.state.selection)){let A=n.state.tr.setSelection(x);o&&A.setMeta("composition",o),n.dispatch(A)}}return}m={start:l.from,endA:l.to,endB:l.to}}n.state.selection.fromn.state.selection.from&&m.start<=n.state.selection.from+2&&n.state.selection.from>=c.from?m.start=n.state.selection.from:m.endA=n.state.selection.to-2&&n.state.selection.to<=c.to&&(m.endB+=n.state.selection.to-m.endA,m.endA=n.state.selection.to)),di&&Sl<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>c.from&&" \xa0"==c.doc.textBetween(m.start-c.from-1,m.start-c.from+1)&&(m.start--,m.endA--,m.endB--);let R,_=c.doc.resolveNoCache(m.start-c.from),v=c.doc.resolveNoCache(m.endB-c.from),E=u.resolve(m.start),C=_.sameParent(v)&&_.parent.inlineContent&&E.end()>=m.endA;if((Cf&&n.input.lastIOSEnter>Date.now()-225&&(!C||i.some(x=>"DIV"==x.nodeName||"P"==x.nodeName))||!C&&_.posx(n,Iu(13,"Enter"))))return void(n.input.lastIOSEnter=0);if(n.state.selection.anchor>m.start&&function LLe(n,e,t,r,i){if(t-e<=i.pos-r.pos||fF(r,!0,!1)t||fF(s,!0,!1)x(n,Iu(8,"Backspace"))))return void(ta&&xr&&n.domObserver.suppressSelectionUpdates());xr&&m.endB==m.start&&(n.input.lastChromeDelete=Date.now()),ta&&!C&&_.start()!=v.start()&&0==v.parentOffset&&_.depth==v.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==m.endA&&(m.endB-=2,v=c.doc.resolveNoCache(m.endB-c.from),setTimeout(()=>{n.someProp("handleKeyDown",function(x){return x(n,Iu(13,"Enter"))})},20));let Q,S,I,V=m.start,H=m.endA;if(C)if(_.pos==v.pos)di&&Sl<=11&&0==_.parentOffset&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>ra(n),20)),Q=n.state.tr.delete(V,H),S=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(I=function FLe(n,e){let s,a,l,t=n.firstChild.marks,r=e.firstChild.marks,i=t,o=r;for(let u=0;uu.mark(a.addToSet(u.marks));else{if(0!=i.length||1!=o.length)return null;a=o[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks))}let c=[];for(let u=0;uA(n,V,H,x)))return;Q=n.state.tr.insertText(x,V,H)}if(Q||(Q=n.state.tr.replace(V,H,c.doc.slice(m.start-c.from,m.endB-c.from))),c.sel){let x=vZ(n,Q.doc,c.sel);x&&!(xr&&n.composing&&x.empty&&(m.start!=m.endB||n.input.lastChromeDelete{aLe(n,r)&&!aF(n,r)&&(n.editable||!(r.type in qr))&&t(n,r)},rLe[e]?{passive:!0}:void 0)}Hr&&n.dom.addEventListener("input",()=>null),sF(n)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&sF(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(CZ),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(lZ(this),s=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let p=TZ(this);(function zLe(n,e){let t=0,r=0;for(let i in n){if(n[i]!=e[i])return!0;t++}for(let i in e)r++;return t!=r})(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&sF(this),this.editable=IZ(this),EZ(this);let l=hF(this),c=wZ(this),u=i.plugins==e.plugins||i.doc.eq(e.doc)?e.scrollToSelection>i.scrollToSelection?"to selection":"preserve":"reset",d=o||!this.docView.matchesNode(e.doc,c,l);(d||!e.selection.eq(i.selection))&&(s=!0);let f="preserve"==u&&s&&null==this.dom.style.overflowAnchor&&function vFe(n){let r,i,e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top);for(let o=(e.left+e.right)/2,s=t+1;s=t-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:vX(n.dom)}}(this);if(s){this.domObserver.stop();let p=d&&(di||xr)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&function ULe(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}(i.selection,e.selection);if(d){let m=xr?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function yLe(n){let e=n.domSelectionRange();if(!e.focusNode)return null;let t=function uFe(n,e){for(;;){if(3==n.nodeType&&e)return n;if(1==n.nodeType&&e>0){if("false"==n.contentEditable)return null;e=to(n=n.childNodes[e-1])}else{if(!n.parentNode||V_(n))return null;e=ur(n),n=n.parentNode}}}(e.focusNode,e.focusOffset),r=function dFe(n,e){for(;;){if(3==n.nodeType&&et(this)))if(this.state.selection instanceof Ie){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&yX(this,t.getBoundingClientRect(),e)}else yX(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new uZ(e.slice,e.move,i<0?void 0:Ie.create(this.state.doc,i))}someProp(e,t){let i,r=this._props&&this._props[e];if(null!=r&&(i=t?t(r):r))return i;for(let s=0;st.ownerDocument.getSelection()),this._root=t;return e||document}updateRoot(){this._root=null}posAtCoords(e){return xFe(this,e)}coordsAtPos(e,t=1){return TX(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let i=this.docView.posFromDOM(e,t,r);if(null==i)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return function MFe(n,e,t){return xX==e&&SX==t?DX:(xX=e,SX=t,DX="up"==t||"down"==t?function DFe(n,e,t){let r=e.selection,i="up"==t?r.$from:r.$to;return CX(n,e,()=>{let{node:o}=n.docView.domFromPos(i.pos,"up"==t?-1:1);for(;;){let a=n.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=TX(n,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(1==a.nodeType)l=a.getClientRects();else{if(3!=a.nodeType)continue;l=ea(a,0,a.nodeValue.length).getClientRects()}for(let c=0;cu.top+1&&("up"==t?s.top-u.top>2*(u.bottom-s.top):u.bottom-s.bottom>2*(s.bottom-u.top)))return!1}}return!0})}(n,e,t):function RFe(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=n.domSelection();return a?AFe.test(r.parent.textContent)&&a.modify?CX(n,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=n.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",t,"character");let p=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:m,focusOffset:_}=n.domSelectionRange(),v=m&&!p.contains(1==m.nodeType?m:m.parentNode)||l==m&&c==_;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return null!=f&&(a.caretBidiLevel=f),v}):"left"==t||"backward"==t?o:s:r.pos==r.start()||r.pos==r.end()}(n,e,t))}(this,t||this.state,e)}pasteHTML(e,t){return q_(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return q_(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return rF(this,e)}destroy(){this.docView&&(function sLe(n){n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],hF(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,$O=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function lLe(n,e){!aF(n,e)&&$r[e.type]&&(n.editable||!(e.type in qr))&&$r[e.type](n,e)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?Hr&&11===this.root.nodeType&&function fFe(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}(this.dom.ownerDocument)==this.dom&&function RLe(n,e){if(e.getComposedRanges){let i=e.getComposedRanges(n.root)[0];if(i)return yZ(n,i)}let t;function r(i){i.preventDefault(),i.stopImmediatePropagation(),t=i.getTargetRanges()[0]}return n.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),n.dom.removeEventListener("beforeinput",r,!0),t?yZ(n,t):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function wZ(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if("function"==typeof t&&(t=t(n.state)),t)for(let r in t)"class"==r?e.class+=" "+t[r]:"style"==r?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&"contenteditable"!=r&&"nodeName"!=r&&(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[io.node(0,n.state.doc.content.size,e)]}function EZ(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:io.widget(n.state.selection.from,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function IZ(n){return!n.someProp("editable",e=>!1===e(n.state))}function TZ(n){let e=Object.create(null);function t(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function CZ(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}const jLe=["ol",0],HLe=["ul",0],$Le=["li",0],xZ={attrs:{order:{default:1,validate:"number"}},parseDOM:[{tag:"ol",getAttrs:n=>({order:n.hasAttribute("start")?+n.getAttribute("start"):1})}],toDOM:n=>1==n.attrs.order?jLe:["ol",{start:n.attrs.order},0]},SZ={parseDOM:[{tag:"ul"}],toDOM:()=>HLe},DZ={parseDOM:[{tag:"li"}],toDOM:()=>$Le,defining:!0};function AZ(n,e){return function(t,r){let{$from:i,$to:o,node:s}=t.selection;if(s&&s.isBlock||i.depth<2||!i.sameParent(o))return!1;let a=i.node(-1);if(a.type!=n)return!1;if(0==i.parent.content.size&&i.node(-1).childCount==i.indexAfter(-1)){if(3==i.depth||i.node(-3).type!=n||i.index(-2)!=i.node(-2).childCount-1)return!1;if(r){let d=Y.empty,f=i.index(-1)?1:i.index(-2)?2:3;for(let E=i.depth-f;E>=i.depth-3;E--)d=Y.from(i.node(E).copy(d));let p=i.indexAfter(-1){if(v>-1)return!1;E.isTextblock&&0==E.content.size&&(v=C+1)}),v>-1&&_.setSelection(rt.near(_.doc.resolve(v))),r(_.scrollIntoView())}return!0}let l=o.pos==i.end()?a.contentMatchAt(0).defaultType:null,c=t.tr.delete(i.pos,o.pos),u=l?[e?{type:n,attrs:e}:null,{type:l}]:void 0;return!!bf(c.doc,i.pos,2,u)&&(r&&r(c.split(i.pos,2,u).scrollIntoView()),!0)}}function RZ(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type==n);return!!o&&(!t||(r.node(o.depth-1).type==n?function KLe(n,e,t,r){let i=n.tr,o=r.end,s=r.$to.end(r.depth);o_;m--)p-=i.child(m).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(t.start),s=o.nodeAfter;if(r.mapping.map(t.end)!=t.start+o.nodeAfter.nodeSize)return!1;let a=0==t.startIndex,l=t.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?Y.empty:Y.from(i))))return!1;let d=o.pos,f=d+s.nodeSize;return r.step(new cr(d-(a?1:0),f+(l?1:0),d+1,f-1,new ie((a?Y.empty:Y.from(i.copy(Y.empty))).append(l?Y.empty:Y.from(i.copy(Y.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}(e,t,o)))}}function MZ(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==n);if(!o)return!1;let s=o.startIndex;if(0==s)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=n)return!1;if(t){let c=l.lastChild&&l.lastChild.type==a.type,u=Y.from(c?n.create():null),d=new ie(Y.from(n.create(null,Y.from(a.type.create(null,u)))),c?3:1,0),f=o.start,p=o.end;t(e.tr.step(new cr(f-(c?3:1),p,f,p,d,1,!0)).scrollIntoView())}return!0}}const YLe={link:{attrs:{href:{},title:{default:null},target:{default:"_blank"}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:n=>({href:n.getAttribute("href"),title:n.getAttribute("title"),target:n.getAttribute("target")})}],toDOM(n){const{href:e,title:t,target:r}=n.attrs;return["a",{href:e,title:t,target:r},0]}},em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:n=>"normal"!==n.style.fontWeight&&null},{style:"font-weight",getAttrs:n=>/^(?:bold(?:er)?|[5-9]\d{2,})$/.test(n)&&null}],toDOM:()=>["strong",0]},code:{parseDOM:[{tag:"code"}],toDOM:()=>["code",0]},u:{parseDOM:[{tag:"u"},{style:"text-decoration=underline",consuming:!1}],toDOM:()=>["u",0]},s:{parseDOM:[{tag:"s"},{tag:"strike"},{style:"text-decoration=line-through"}],toDOM:()=>["s",0]},text_color:{attrs:{color:{default:null}},parseDOM:[{style:"color",getAttrs:n=>({color:n})}],toDOM(n){const{color:e}=n.attrs;return["span",{style:`color:${e};`},0]}},text_background_color:{attrs:{backgroundColor:{default:null}},parseDOM:[{style:"background-color",getAttrs:n=>({backgroundColor:n})}],toDOM(n){const{backgroundColor:e}=n.attrs;return["span",{style:`background-color:${e};`},0]}},sup:{attrs:{},parseDOM:[{tag:"sup"},{style:"vertical-align=super"}],toDOM:()=>["sup",0]},sub:{attrs:{},parseDOM:[{tag:"sub"},{style:"vertical-align=sub"}],toDOM:()=>["sub",0]}},cVe={doc:{content:"block+"},text:{group:"inline"},paragraph:{content:"inline*",group:"block",attrs:{align:{default:null},indent:{default:null}},parseDOM:[{tag:"p",getAttrs(n){const{textAlign:e}=n.style,t=n.getAttribute("align")||e||null,r=n.getAttribute("data-indent")||null;return{align:t,indent:parseInt(r,10)||null}}}],toDOM(n){const{align:e,indent:t}=n.attrs;return["p",{style:CO({textAlign:"left"!==e?e:null,marginLeft:null!==t?40*t+"px":null})||null,"data-indent":t??null},0]}},blockquote:{content:"block+",group:"block",defining:!0,attrs:{indent:{default:null}},parseDOM:[{tag:"blockquote",getAttrs(n){const e=n.getAttribute("data-indent")||null;return{indent:parseInt(e,10)||null}}}],toDOM(n){const{indent:e}=n.attrs;return["blockquote",{style:CO({marginLeft:null!==e?40*e+"px":null})||null,"data-indent":e??null},0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]},heading:{attrs:{level:{default:1},align:{default:null},indent:{default:null}},content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"h1",getAttrs(n){const{textAlign:e}=n.style,t=n.getAttribute("align")||e||null,r=n.getAttribute("data-indent")||null;return{level:1,align:t,indent:parseInt(r,10)||null}}},{tag:"h2",getAttrs(n){const{textAlign:e}=n.style,t=n.getAttribute("align")||e||null,r=n.getAttribute("data-indent")||null;return{level:2,align:t,indent:parseInt(r,10)||null}}},{tag:"h3",getAttrs(n){const{textAlign:e}=n.style,t=n.getAttribute("align")||e||null,r=n.getAttribute("data-indent")||null;return{level:3,align:t,indent:parseInt(r,10)||null}}},{tag:"h4",getAttrs(n){const{textAlign:e}=n.style,t=n.getAttribute("align")||e||null,r=n.getAttribute("data-indent")||null;return{level:4,align:t,indent:parseInt(r,10)||null}}},{tag:"h5",getAttrs(n){const{textAlign:e}=n.style,t=n.getAttribute("align")||e||null,r=n.getAttribute("data-indent")||null;return{level:5,align:t,indent:parseInt(r,10)||null}}},{tag:"h6",getAttrs(n){const{textAlign:e}=n.style,t=n.getAttribute("align")||e||null,r=n.getAttribute("data-indent")||null;return{level:6,align:t,indent:parseInt(r,10)||null}}}],toDOM(n){const{level:e,align:t,indent:r}=n.attrs;return[`h${e}`,{style:CO({textAlign:"left"!==t?t:null,marginLeft:null!==r?40*r+"px":null})||null,"data-indent":r??null},0]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:()=>["br"]},code_block:{content:"text*",marks:"",group:"block",code:!0,defining:!0,parseDOM:[{tag:"pre",preserveWhitespace:"full"}],toDOM:()=>["pre",["code",0]]},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null},width:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs:n=>({src:n.getAttribute("src"),title:n.getAttribute("title"),alt:n.getAttribute("alt"),width:n.getAttribute("width")})}],toDOM(n){const{src:e,alt:t,title:r,width:i}=n.attrs;return["img",{src:e,alt:t,title:r,width:i}]}},list_item:{...DZ,content:"paragraph block*"},ordered_list:{...xZ,content:"list_item+",group:"block"},bullet_list:{...SZ,content:"list_item+",group:"block"}},AT=new class SOe{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=vY.from(e.nodes),t.marks=vY.from(e.marks||{}),this.nodes=fT.compile(this.spec.nodes,this),this.marks=pT.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=vu.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet="_"==a?null:a?LY(this,a.split(" ")):""!=a&&o.inlineContent?null:[]}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=null==s?[o]:""==s?[]:LY(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof fT))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new hT(r,r.defaultAttrs,e,Mt.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return rs.fromJSON(this,e)}markFromJSON(e){return Mt.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}({marks:YLe,nodes:cVe}),kZ=(n,e)=>!n.selection.empty&&(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function Rf(n,e,t=!1){for(let r=n;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&1!=r.childCount)return!1}return!1}function mF(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function gF(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1{let{$head:t,$anchor:r}=n.selection;return!(!t.parent.type.spec.code||!t.sameParent(r)||(e&&e(n.tr.insertText("\n").scrollIntoView()),0))};function _F(n){for(let e=0;e{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),o=t.indexAfter(-1),s=_F(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=t.after(),l=n.tr.replaceWith(a,a,s.createAndFill());l.setSelection(rt.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},VZ=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof Oi||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=_F(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let o=t.before();if(bf(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&k_(r);return null!=i&&(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},yF=function mVe(n){return(e,t)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof Ie&&e.selection.node.isBlock)return!(!r.parentOffset||!bf(e.doc,r.pos)||(t&&t(e.tr.split(r.pos).scrollIntoView()),0));if(!r.depth)return!1;let s,a,o=[],l=!1,c=!1;for(let p=r.depth;;p--){if(r.node(p).isBlock){l=r.end(p)==r.pos+(r.depth-p),c=r.start(p)==r.pos-(r.depth-p),a=_F(r.node(p-1).contentMatchAt(r.indexAfter(p-1)));let _=n&&n(i.parent,l,r);o.unshift(_||(l&&a?{type:a}:null)),s=p;break}if(1==p)return!1;o.unshift(null)}let u=e.tr;(e.selection instanceof lt||e.selection instanceof Oi)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=bf(u.doc,d,o.length,o);if(f||(o[0]=a?{type:a}:null,f=bf(u.doc,d,o.length,o)),u.split(d,o.length,o),!l&&c&&r.node(s).type!=a){let p=u.mapping.map(r.before(s)),m=u.doc.resolve(p);a&&r.node(s-1).canReplaceWith(m.index(),m.index()+1,a)&&u.setNodeMarkup(u.mapping.map(r.before(s)),a)}return t&&t(u.scrollIntoView()),!0}}();function UZ(n,e,t,r){let s,a,i=e.nodeBefore,o=e.nodeAfter,l=i.type.spec.isolating||o.type.spec.isolating;if(!l&&function _Ve(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!(!(r&&i&&r.type.compatibleContent(i.type))||(!r.content.size&&e.parent.canReplace(o-1,o)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),0):!e.parent.canReplace(o,o+1)||!i.isTextblock&&!yT(n.doc,e.pos)||(t&&t(n.tr.join(e.pos).scrollIntoView()),0)))}(n,e,t))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(a=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(t){let p=e.pos+o.nodeSize,m=Y.empty;for(let E=s.length-1;E>=0;E--)m=Y.from(s[E].create(null,m));m=Y.from(i.copy(m));let _=n.tr.step(new cr(e.pos-1,p,e.pos,p,new ie(m,1,0),s.length,!0)),v=_.doc.resolve(p+2*s.length);v.nodeAfter&&v.nodeAfter.type==i.type&&yT(_.doc,v.pos)&&_.join(v.pos),t(_.scrollIntoView())}return!0}let u=o.type.spec.isolating||r>0&&l?null:rt.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),f=d&&k_(d);if(null!=f&&f>=e.depth)return t&&t(n.tr.lift(d,f).scrollIntoView()),!0;if(c&&Rf(o,"start",!0)&&Rf(i,"end")){let p=i,m=[];for(;m.push(p),!p.isTextblock;)p=p.lastChild;let _=o,v=1;for(;!_.isTextblock;_=_.firstChild)v++;if(p.canReplace(p.childCount,p.childCount,_.content)){if(t){let E=Y.empty;for(let R=m.length-1;R>=0;R--)E=Y.from(m[R].copy(E));t(n.tr.step(new cr(e.pos-m.length,e.pos+o.nodeSize,e.pos+v,e.pos+o.nodeSize-v,new ie(E,m.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function zZ(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(t&&t(e.tr.setSelection(lt.create(e.doc,n<0?i.start(o):i.end(o)))),!0)}}const yVe=zZ(-1),vVe=zZ(1);function vF(n,e=null){return function(t,r){let i=!1;for(let o=0;o{if(i)return!1;if(l.isTextblock&&!l.hasMarkup(n,e))if(l.type==n)i=!0;else{let u=t.doc.resolve(c),d=u.index();i=u.parent.canReplaceWith(d,d+1,n)}})}if(!i)return!1;if(r){let o=t.tr;for(let s=0;s{if(a||!r&&l.isAtom&&l.isInline&&c>=o.pos&&c+l.nodeSize<=s.pos)return!1;a=l.inlineContent&&l.type.allowsMarkType(t)}),a)return!0}return!1}(s.doc,u,n,i))return!1;if(a)if(c)n.isInSet(s.storedMarks||c.marks())?a(s.tr.removeStoredMark(n)):a(s.tr.addStoredMark(n.create(e)));else{let d,f=s.tr;i||(u=function EVe(n){let e=[];for(let t=0;t{if(o.isAtom&&o.content.size&&o.isInline&&s>=r.pos&&s+o.nodeSize<=i.pos)return s+1>r.pos&&e.push(new UO(r,r.doc.resolve(s+1))),r=r.doc.resolve(s+1+o.content.size),!1}),r.poss.doc.rangeHasMark(p.$from.pos,p.$to.pos,n)):!u.every(p=>{let m=!1;return f.doc.nodesBetween(p.$from.pos,p.$to.pos,(_,v,E)=>{if(m)return!1;m=!n.isInSet(_.marks)&&!!E&&E.type.allowsMarkType(n)&&!(_.isText&&/^\s*$/.test(_.textBetween(Math.max(0,p.$from.pos-v),Math.min(_.nodeSize,p.$to.pos-v))))}),!m});for(let p=0;p{let r=function NZ(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}(n,t);if(!r)return!1;let i=mF(r);if(!i){let s=r.blockRange(),a=s&&k_(s);return null!=a&&(e&&e(n.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(UZ(n,i,e,-1))return!0;if(0==r.parent.content.size&&(Rf(o,"end")||Ie.isSelectable(o)))for(let s=r.depth;;s--){let a=FO(n.doc,r.before(s),r.after(s),ie.empty);if(a&&a.slice.size1)break}return!(!o.isAtom||i.depth!=r.depth-1||(e&&e(n.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),0))},(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;o=mF(r)}let s=o&&o.nodeBefore;return!(!s||!Ie.isSelectable(s)||(e&&e(n.tr.setSelection(Ie.create(n.doc,o.pos-s.nodeSize)).scrollIntoView()),0))}),jZ=G_(kZ,(n,e,t)=>{let r=function OZ(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset(e&&e(n.tr.setSelection(new Oi(n.doc))),!0)},HZ={"Ctrl-h":ia.Backspace,"Alt-Backspace":ia["Mod-Backspace"],"Ctrl-d":ia.Delete,"Ctrl-Alt-Backspace":ia["Mod-Delete"],"Alt-Delete":ia["Mod-Delete"],"Alt-d":ia["Mod-Delete"],"Ctrl-a":yVe,"Ctrl-e":vVe};for(let n in ia)HZ[n]=ia[n];const TVe=(typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&"darwin"==os.platform())?HZ:ia;class oa{constructor(e,t,r={}){this.match=e,this.match=e,this.handler="string"==typeof t?function CVe(n){return function(e,t,r,i){let o=n;if(t[1]){let s=t[0].lastIndexOf(t[1]);o+=t[0].slice(s+t[1].length);let a=(r+=s)-i;a>0&&(o=t[0].slice(s-a,s)+o,r=i)}return e.tr.insertText(o,r,i)}}(t):t,this.undoable=!1!==r.undoable,this.inCode=r.inCode||!1}}function $Z(n,e,t,r,i,o){if(n.composing)return!1;let s=n.state,a=s.doc.resolve(e),l=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"\ufffc")+r;for(let c=0;c{let l=t instanceof Function?t(o):t,c=i.tr.delete(s,a),d=c.doc.resolve(s).blockRange(),f=d&&OO(d,e,l);if(!f)return null;c.wrap(d,f);let p=c.doc.resolve(s-1).nodeBefore;return p&&p.type==e&&yT(c.doc,s-1)&&(!r||r(o,p))&&c.join(s-1),c})}function qZ(n,e,t=null){return new oa(n,(r,i,o,s)=>{let a=r.doc.resolve(o),l=t instanceof Function?t(i):t;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),e)?r.tr.delete(o,s).setBlockType(o,o,e,l):null})}const EF=(n,e)=>{const{from:t,$from:r,to:i,empty:o}=n.selection;return o?!!e.isInSet(n.storedMarks||r.marks()):n.doc.rangeHasMark(t,i,e)},WZ=(n,e,t={})=>{const{selection:r}=n,{$from:i,to:o}=r,s=((n,e)=>{for(let t=e.depth;t>0;t-=1)if(e.node(t).type===n)return e.node(t).type;return null})(e,i);return Object.entries(t).length&&s?o<=i.end()&&i.parent.hasMarkup(e,t):!!s},GZ=n=>{const e=[],{selection:{from:t,to:r}}=n;return n.doc.nodesBetween(t,r,i=>{e.push(i)}),e},KZ=(n,e,t)=>{for(const r of e){const{$from:i,$to:o}=r;let s=0===i.depth&&n.type.allowsMarkType(t);if(n.nodesBetween(i.pos,o.pos,a=>!s&&(s=a.inlineContent&&a.type.allowsMarkType(t),!0)),s)return!0}return!1},QZ=(n,e,t)=>new oa(n,(r,i,o,s)=>{const{tr:a}=r,l=o;let c=s;const[u,,d]=i,f=u.search(/\S/);if(d){const p=o+u.indexOf(d),m=p+d.length;mo&&a.delete(o+f,p),c=o+d.length+f}return a.addMark(l,c,e.create(t)),a.removeStoredMark(e),a}),YZ=(n,e={})=>(t,r)=>{const{tr:i,selection:o}=t,{empty:s,ranges:a,$from:l,$to:c}=o;if(s&&o instanceof lt){const{$cursor:u}=o;if(!u||!KZ(t.doc,a,n)||(i.addStoredMark(n.create(e)),!i.storedMarksSet))return!1;r?.(i)}else{if(i.addMark(l.pos,c.pos,n.create(e)),!i.docChanged)return!1;r?.(i.scrollIntoView())}return!0};var dr=function(){};dr.prototype.append=function(e){return e.length?(e=dr.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},dr.prototype.prepend=function(e){return e.length?dr.from(e).append(this):this},dr.prototype.appendInner=function(e){return new UVe(this,e)},dr.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?dr.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},dr.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},dr.prototype.forEach=function(e,t,r){void 0===t&&(t=0),void 0===r&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)},dr.prototype.map=function(e,t,r){void 0===t&&(t=0),void 0===r&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},t,r),i},dr.from=function(e){return e instanceof dr?e:e&&e.length?new XZ(e):dr.empty};var XZ=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),(e.prototype=Object.create(n&&n.prototype)).constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return 0==i&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,a){for(var l=o;l=s;l--)if(!1===i(this.values[l],a+l))return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=200)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=200)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(dr);dr.empty=new XZ([]);var UVe=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),(e.prototype=Object.create(n&&n.prototype)).constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return ra&&!1===this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a))return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var a=this.left.length;if(i>a&&!1===this.right.forEachInvertedInner(r,i-a,Math.max(o,a)-a,s+a)||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(dr);const ZZ=dr;class Io{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let i,o,r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a,l,s=e.tr,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step)return i||(i=this.remapping(r,f+1),o=i.maps.length),o--,void u.push(d);if(i){u.push(new cs(d.map));let m,p=d.step.map(i.slice(o));p&&s.maybeStep(p).doc&&(m=s.mapping.maps[s.mapping.maps.length-1],c.push(new cs(m,void 0,void 0,c.length+u.length))),o--,m&&i.appendMap(m,o)}else s.maybeStep(d.step);return d.selection?(a=i?d.selection.map(i.slice(o)):d.selection,l=new Io(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1):void 0},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,t,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let u=0;uHVe&&(a=function jVe(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&0==e--)return t=i,!1}),n.slice(t)}(a,c),s-=c),new Io(a.append(o),s)}remapping(e,t){let r=new yf;return this.items.forEach((i,o)=>{r.appendMap(i.map,null!=i.mirrorOffset&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0)},e,t),r}addMaps(e){return 0==this.eventCount?this:new Io(this.items.append(e.map(t=>new cs(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},i);let l=t;this.items.forEach(f=>{let p=o.getMirror(--l);if(null==p)return;s=Math.min(s,p);let m=o.maps[p];if(f.step){let _=e.steps[p].invert(e.docs[p]),v=f.selection&&f.selection.map(o.slice(l+1,p));v&&a++,r.push(new cs(m,_,v))}else r.push(new cs(m))},i);let c=[];for(let f=t;f500&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(t.slice(r)),c=l&&l.getMap();if(r--,c&&t.appendMap(c,r),l){let u=s.selection&&s.selection.map(t.slice(r));u&&o++;let f,d=new cs(c.invert(),l,u),p=i.length-1;(f=i.length&&i[p].merge(d))?i[p]=f:i.push(d)}}else s.map&&r--},this.items.length,0),new Io(ZZ.from(i.reverse()),o)}}Io.empty=new Io(ZZ.empty,0);class cs{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new cs(t.getMap().invert(),t,this.selection)}}}class Pl{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const HVe=20;function JZ(n){let e=[];for(let t=n.length-1;t>=0&&0==e.length;t--)n[t].forEach((r,i,o,s)=>e.push(o,s));return e}function IF(n,e){if(!n)return null;let t=[];for(let r=0;r{let i=sa.getState(t);if(!i||0==(n?i.undone:i.done).eventCount)return!1;if(r){let o=function WVe(n,e,t){let r=MT(e),i=sa.get(e).spec.config,o=(t?n.undone:n.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(t?n.done:n.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),l=new Pl(t?a:o.remaining,t?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(sa,{redo:t,historyState:l})}(i,t,n);o&&r(e?o.scrollIntoView():o)}return!0}}const CF=kT(!1,!0),NT=kT(!0,!0);kT(!1,!1),kT(!0,!1);for(var Ol={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},PT={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},KVe=typeof navigator<"u"&&/Mac/.test(navigator.platform),QVe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),hr=0;hr<10;hr++)Ol[48+hr]=Ol[96+hr]=String(hr);for(hr=1;hr<=24;hr++)Ol[hr+111]="F"+hr;for(hr=65;hr<=90;hr++)Ol[hr]=String.fromCharCode(hr+32),PT[hr]=String.fromCharCode(hr);for(var xF in Ol)PT.hasOwnProperty(xF)||(PT[xF]=Ol[xF]);const XVe=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function ZVe(n){let r,i,o,s,e=n.split(/-(?!$)/),t=e[e.length-1];"Space"==t&&(t=" ");for(let a=0;a127)&&(o=Ol[r.keyCode])&&o!=i){let a=e[SF(o,r)];if(a&&a(t.state,t.dispatch,t))return!0}}return!1}}const t2e=["imgEl"],n2e=n=>({"NgxEditor__Resizer--Active":n});function r2e(n,e){if(1&n){const t=La();W(0,"span",4)(1,"span",5),Ve("mousedown",function(i){return vi(t),bi(Ln().startResizing(i,"left"))}),K(),W(2,"span",6),Ve("mousedown",function(i){return vi(t),bi(Ln().startResizing(i,"right"))}),K(),W(3,"span",7),Ve("mousedown",function(i){return vi(t),bi(Ln().startResizing(i,"left"))}),K(),W(4,"span",8),Ve("mousedown",function(i){return vi(t),bi(Ln().startResizing(i,"right"))}),K()()}}const i2e=["ngxEditor"],o2e=["*"],R2e=(n=!0)=>new ss({key:new Js("editable"),state:{init:()=>n,apply:(e,t)=>e.getMeta("UPDATE_EDITABLE")??t},props:{editable(e){return this.getState(e)},attributes(e){return this.getState(e)?null:{class:"NgxEditor__Content--Disabled"}}}}),k2e=n=>new ss({key:new Js("placeholder"),state:{init:()=>n??"",apply:(e,t)=>e.getMeta("UPDATE_PLACEHOLDER")??t},props:{decorations(e){const{doc:t}=e,{textContent:r,childCount:i}=t,o=this.getState(e);if(!o||i>1)return Rn.empty;const s=[];return t.descendants((l,c)=>{if(l.type.isBlock&&0===l.childCount&&0===r.length){const f=io.node(c,c+l.nodeSize,{class:"NgxEditor__Placeholder","data-placeholder":o,"data-align":l.attrs.align??null});s.push(f)}return!1}),Rn.create(t,s)}}});let F2e=(()=>{class n{src;alt="";title="";outerWidth="";selected=!1;view;imageResize=new nt;imgEl;startResizing(t,r){t.preventDefault(),this.resizeImage(t,r)}resizeImage(t,r){const i=t.pageX,o=this.imgEl.nativeElement.clientWidth,s="left"===r,{width:a}=window.getComputedStyle(this.view.dom),l=parseInt(a,10),c=d=>{const p=d.pageX-i,m=s?o-p:o+p;m>l||m<20||(this.outerWidth=`${m}px`)},u=d=>{d.preventDefault(),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u),this.imageResize.emit()};document.addEventListener("mousemove",c),document.addEventListener("mouseup",u)}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["ngx-image-view"]],viewQuery:function(r,i){if(1&r&&qn(t2e,7),2&r){let o;Qe(o=Ye())&&(i.imgEl=o.first)}},inputs:{src:"src",alt:"alt",title:"title",outerWidth:"outerWidth",selected:"selected",view:"view"},outputs:{imageResize:"imageResize"},standalone:!1,decls:4,vars:9,consts:[["imgEl",""],[1,"NgxEditor__ImageWrapper",3,"ngClass"],["class","NgxEditor__ResizeHandle",4,"ngIf"],[3,"src","alt","title"],[1,"NgxEditor__ResizeHandle"],[1,"NgxEditor__ResizeHandle--TL",3,"mousedown"],[1,"NgxEditor__ResizeHandle--TR",3,"mousedown"],[1,"NgxEditor__ResizeHandle--BL",3,"mousedown"],[1,"NgxEditor__ResizeHandle--BR",3,"mousedown"]],template:function(r,i){1&r&&(W(0,"span",1),et(1,r2e,5,0,"span",2),Pe(2,"img",3,0),K()),2&r&&(Bd("width",i.outerWidth),De("ngClass",t$(7,n2e,i.selected)),re(),De("ngIf",i.selected),re(),De("src",i.src,vx)("alt",i.alt)("title",i.title))},dependencies:[RD,Bb],styles:["*[_ngcontent-%COMP%], *[_ngcontent-%COMP%]:before, *[_ngcontent-%COMP%]:after{box-sizing:border-box}img[_ngcontent-%COMP%]{width:100%;height:100%}.NgxEditor__ImageWrapper[_ngcontent-%COMP%]{position:relative;display:inline-block;line-height:0;padding:2px}.NgxEditor__ImageWrapper.NgxEditor__Resizer--Active[_ngcontent-%COMP%]{padding:1px;border:1px solid #1a73e8}.NgxEditor__ImageWrapper[_ngcontent-%COMP%] .NgxEditor__ResizeHandle[_ngcontent-%COMP%]{position:absolute;height:100%;width:100%}.NgxEditor__ImageWrapper[_ngcontent-%COMP%] .NgxEditor__ResizeHandle[_ngcontent-%COMP%] .NgxEditor__ResizeHandle--TL[_ngcontent-%COMP%], .NgxEditor__ImageWrapper[_ngcontent-%COMP%] .NgxEditor__ResizeHandle[_ngcontent-%COMP%] .NgxEditor__ResizeHandle--BL[_ngcontent-%COMP%], .NgxEditor__ImageWrapper[_ngcontent-%COMP%] .NgxEditor__ResizeHandle[_ngcontent-%COMP%] .NgxEditor__ResizeHandle--TR[_ngcontent-%COMP%], .NgxEditor__ImageWrapper[_ngcontent-%COMP%] .NgxEditor__ResizeHandle[_ngcontent-%COMP%] .NgxEditor__ResizeHandle--BR[_ngcontent-%COMP%]{position:absolute;width:7px;height:7px;background-color:#1a73e8;border:1px solid white}.NgxEditor__ImageWrapper[_ngcontent-%COMP%] .NgxEditor__ResizeHandle[_ngcontent-%COMP%] .NgxEditor__ResizeHandle--BR[_ngcontent-%COMP%]{bottom:-5px;right:-5px;cursor:se-resize}.NgxEditor__ImageWrapper[_ngcontent-%COMP%] .NgxEditor__ResizeHandle[_ngcontent-%COMP%] .NgxEditor__ResizeHandle--TR[_ngcontent-%COMP%]{top:-5px;right:-5px;cursor:ne-resize}.NgxEditor__ImageWrapper[_ngcontent-%COMP%] .NgxEditor__ResizeHandle[_ngcontent-%COMP%] .NgxEditor__ResizeHandle--TL[_ngcontent-%COMP%]{top:-5px;left:-5px;cursor:nw-resize}.NgxEditor__ImageWrapper[_ngcontent-%COMP%] .NgxEditor__ResizeHandle[_ngcontent-%COMP%] .NgxEditor__ResizeHandle--BL[_ngcontent-%COMP%]{bottom:-5px;left:-5px;cursor:sw-resize}"]})}return n})();class L2e{dom;view;getPos;applicationRef;imageComponentRef;resizeSubscription;node;updating=!1;constructor(e,t,r,i){this.applicationRef=i.get(tr),this.imageComponentRef=vD(F2e,{environmentInjector:this.applicationRef.injector}),this.applicationRef.attachView(this.imageComponentRef.hostView),this.setNodeAttributes(e.attrs),this.imageComponentRef.instance.view=t,this.dom=this.imageComponentRef.location.nativeElement,this.view=t,this.node=e,this.getPos=r,this.resizeSubscription=this.imageComponentRef.instance.imageResize.subscribe(()=>{this.handleResize()})}computeChanges(e,t){return JSON.stringify(e)===JSON.stringify(t)}setNodeAttributes(e){this.imageComponentRef.instance.src=e.src,this.imageComponentRef.instance.alt=e.alt,this.imageComponentRef.instance.title=e.title,this.imageComponentRef.instance.outerWidth=e.width}handleResize=()=>{if(this.updating)return;const{state:e,dispatch:t}=this.view,{tr:r}=e,i=r.setNodeMarkup(this.getPos(),void 0,{...this.node.attrs,width:this.imageComponentRef.instance.outerWidth}),o=i.doc.resolve(this.getPos()),s=new Ie(o);i.setSelection(s),t(i)};update(e){return e.type===this.node.type&&(this.node=e,this.computeChanges(this.node.attrs,e.attrs)&&(this.updating=!0,this.setNodeAttributes(e.attrs),this.updating=!1),!0)}ignoreMutation(){return!0}selectNode(){this.imageComponentRef.instance.selected=!0}deselectNode(){this.imageComponentRef.instance.selected=!1}destroy(){this.resizeSubscription.unsubscribe(),this.applicationRef.detachView(this.imageComponentRef.hostView)}}const B2e=/(?:https?:\/\/)?[\w-]+(?:\.[\w-]+)+\.?(?:\d+)?(?:\/\S*)?$/,nJ=n=>{const e=[];return n.forEach(t=>{if(t.isText){const r=t.text;let i=0;const o=B2e.exec(r);if(o){const s=o.index,a=s+o[0].length,{link:l}=t.type.schema.marks;s>0&&e.push(t.cut(i,s));const c=r.slice(s,a);e.push(t.cut(s,a).mark(l.create({href:c}).addToSet(t.marks))),i=a}i"string"==typeof n,iJ=n=>window.trustedTypes?.isHTML(n)??!1,oJ=n=>rJ(n)||iJ(n),sJ={type:"doc",content:[{type:"paragraph"}]},K_=(n,e,t)=>{if(!n)return e.nodeFromJSON(sJ);if(!oJ(n))return e.nodeFromJSON(n);const r=((n,e,t)=>{const r=e??AT,i=document.createElement("div");return i.innerHTML=n,bu.fromSchema(r).parse(i,t).toJSON()})(n,e,t);return e.nodeFromJSON(r)};let $2e=(()=>{class n{renderer;injector;elementRef;constructor(t,r,i){this.renderer=t,this.injector=r,this.elementRef=i}ngxEditor;editor;outputFormat;placeholder="Type Here...";focusOut=new nt;focusIn=new nt;unsubscribe=new fe;onChange=()=>{};onTouched=()=>{};writeValue(t){!this.outputFormat&&oJ(t)&&(this.outputFormat="html"),this.editor.setContent(t??sJ)}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.setMeta("UPDATE_EDITABLE",!t),this.renderer.setProperty(this.elementRef.nativeElement,"disabled",t)}handleChange(t){if("html"!==this.outputFormat)this.onChange(t);else{const r=(n=>{const t=this.editor.schema??AT,r=t.nodeFromJSON(n),i=wu.fromSchema(t).serializeFragment(r.content),o=document.createElement("div");return o.appendChild(i),o.innerHTML})(t);this.onChange(r)}}setMeta(t,r){const{dispatch:i,state:{tr:o}}=this.editor.view;i(o.setMeta(t,r))}setPlaceholder(t){this.setMeta("UPDATE_PLACEHOLDER",t)}registerPlugins(){this.editor.registerPlugin(R2e()),this.editor.registerPlugin(k2e(this.placeholder)),this.editor.registerPlugin(((n={})=>new ss({key:new Js("attributes"),props:{attributes:n}}))({class:"NgxEditor__Content"})),this.editor.registerPlugin((n=>new ss({key:new Js("focus"),props:{handleDOMEvents:{focus:()=>(n(),!1)}}}))(()=>{this.focusIn.emit()})),this.editor.registerPlugin((n=>new ss({key:new Js("blur"),props:{handleDOMEvents:{blur:()=>(n(),!1)}}}))(()=>{this.focusOut.emit(),this.onTouched()})),this.editor.features.resizeImage&&this.editor.registerPlugin((n=>new ss({key:new Js("image-resize"),props:{nodeViews:{image:(e,t,r)=>new L2e(e,t,r,n)}}}))(this.injector)),this.editor.features.linkOnPaste&&this.editor.registerPlugin(new ss({key:new Js("linkify"),props:{transformPasted:n=>new ie(nJ(n.content),n.openStart,n.openEnd)}}))}ngOnInit(){if(!this.editor)throw new yY("Required editor instance for initializing editor component");this.registerPlugins(),this.renderer.appendChild(this.ngxEditor.nativeElement,this.editor.view.dom),this.editor.valueChanges.pipe(At(this.unsubscribe)).subscribe(t=>{this.handleChange(t)})}ngOnChanges(t){t.placeholder&&!t.placeholder.isFirstChange()&&this.setPlaceholder(t.placeholder.currentValue)}ngOnDestroy(){this.unsubscribe.next(),this.unsubscribe.complete()}static \u0275fac=function(r){return new(r||n)($(Ti),$(ze),$(je))};static \u0275cmp=He({type:n,selectors:[["ngx-editor"]],viewQuery:function(r,i){if(1&r&&qn(i2e,7),2&r){let o;Qe(o=Ye())&&(i.ngxEditor=o.first)}},inputs:{editor:"editor",outputFormat:"outputFormat",placeholder:"placeholder"},outputs:{focusOut:"focusOut",focusIn:"focusIn"},standalone:!1,features:[$e([{provide:Yi,useExisting:ft(()=>n),multi:!0}]),ei],ngContentSelectors:o2e,decls:3,vars:0,consts:[["ngxEditor",""],[1,"NgxEditor"]],template:function(r,i){1&r&&(Hn(),W(0,"div",1,0),Ae(2),K())},styles:[':root{--ngx-editor-border-radius: 4px;--ngx-editor-background-color: #fff;--ngx-editor-text-color: #000;--ngx-editor-placeholder-color: #6c757d;--ngx-editor-border-color: rgba(0, 0, 0, .2);--ngx-editor-wrapper-border-color: rgba(0, 0, 0, .2);--ngx-editor-menubar-bg-color: #fff;--ngx-editor-menubar-padding: 3px;--ngx-editor-menubar-height: 30px;--ngx-editor-blockquote-color: #ddd;--ngx-editor-blockquote-border-width: 3px;--ngx-editor-icon-size: 30px;--ngx-editor-popup-bg-color: #fff;--ngx-editor-popup-border-radius: 4px;--ngx-editor-popup-shadow: rgba(60, 64, 67, .15) 0px 2px 6px 2px;--ngx-editor-menu-item-border-radius: 2px;--ngx-editor-menu-item-active-color: #1a73e8;--ngx-editor-menu-item-hover-bg-color: #f1f1f1;--ngx-editor-menu-item-active-bg-color: #e8f0fe;--ngx-editor-seperator-color: #ccc;--ngx-editor-bubble-bg-color: #000;--ngx-editor-bubble-text-color: #fff;--ngx-editor-bubble-item-hover-color: #636262;--ngx-editor-bubble-seperator-color: #fff;--ngx-editor-focus-ring-color: #5e9ed6;--ngx-editor-error-color: red;--ngx-editor-click-pointer: default}.NgxEditor{background:var(--ngx-editor-background-color);color:var(--ngx-editor-text-color);background-clip:padding-box;border-radius:var(--ngx-editor-border-radius);border:1px solid var(--ngx-editor-border-color);position:relative}.NgxEditor--Disabled{opacity:.5!important;pointer-events:none!important}.NgxEditor__Placeholder:before{color:var(--ngx-editor-placeholder-color);opacity:1;-webkit-user-select:none;user-select:none;position:absolute;cursor:text;content:attr(data-placeholder)}.NgxEditor__Placeholder[data-align=right]:before{position:relative}.NgxEditor__Content{padding:8px;white-space:pre-wrap;outline:none;font-variant-ligatures:none;font-feature-settings:"liga" 0}.NgxEditor__Content p{margin:0 0 10px}.NgxEditor__Content blockquote{padding-left:16px;border-left:var(--ngx-editor-blockquote-border-width) solid var(--ngx-editor-blockquote-color);margin-left:0;margin-right:0}.NgxEditor__Content--Disabled{-webkit-user-select:none;user-select:none;pointer-events:none}.NgxEditor__Wrapper{border:1px solid var(--ngx-editor-wrapper-border-color);border-radius:var(--ngx-editor-border-radius)}.NgxEditor__Wrapper .NgxEditor__MenuBar{border-top-left-radius:var(--ngx-editor-border-radius);border-top-right-radius:var(--ngx-editor-border-radius);border-bottom:1px solid var(--ngx-editor-border-color)}.NgxEditor__Wrapper .NgxEditor{border-top-left-radius:0;border-top-right-radius:0;border:none}.NgxEditor__MenuBar{display:flex;flex-wrap:wrap;padding:var(--ngx-editor-menubar-padding);background-color:var(--ngx-editor-menubar-bg-color);gap:.25rem .1rem}.NgxEditor__MenuBar button:not(:disabled),.NgxEditor__MenuBar [role=button]:not(:disabled){cursor:var(--ngx-editor-click-pointer, default)}.NgxEditor__MenuItem{display:flex;align-items:center;justify-content:center;position:relative;flex-shrink:0}.NgxEditor__MenuItem.NgxEditor__MenuItem--IconContainer{display:flex;align-items:center;justify-content:center}.NgxEditor__MenuItem .NgxEditor__MenuItem--Icon{all:unset;appearance:none;height:var(--ngx-editor-icon-size);width:var(--ngx-editor-icon-size);transition:.2s ease-in-out;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--ngx-editor-menu-item-border-radius)}.NgxEditor__MenuItem .NgxEditor__MenuItem--Icon+.NgxEditor__MenuItem--Icon{margin-left:2px}.NgxEditor__MenuItem .NgxEditor__MenuItem--Icon:focus-visible{outline:1px solid var(--ngx-editor-focus-ring-color)}.NgxEditor__MenuItem .NgxEditor__MenuItem--Icon:hover{background-color:var(--ngx-editor-menu-item-hover-bg-color)}.NgxEditor__MenuItem.NgxEditor__MenuItem--Text{padding:0 5px}.NgxEditor__MenuItem.NgxEditor__MenuItem--Active,.NgxEditor__MenuItem .NgxEditor__MenuItem--Active{background-color:var(--ngx-editor-menu-item-active-bg-color);color:var(--ngx-editor-menu-item-active-color)}.NgxEditor__Dropdown{min-width:64px;position:relative;display:flex;align-items:center;flex-shrink:0}.NgxEditor__Dropdown:hover{background-color:var(--ngx-editor-menu-item-hover-bg-color)}.NgxEditor__Dropdown .NgxEditor__Dropdown--Text{all:unset;appearance:none;display:flex;align-items:center;justify-content:center;padding:0 5px;height:100%;width:100%}.NgxEditor__Dropdown .NgxEditor__Dropdown--Text:focus-visible{outline:1px solid var(--ngx-editor-focus-ring-color)}.NgxEditor__Dropdown .NgxEditor__Dropdown--Text:after{display:inline-block;content:"";margin-left:24px;vertical-align:4px;border-top:4px solid;border-right:4px solid transparent;border-bottom:0;border-left:4px solid transparent}.NgxEditor__Dropdown .NgxEditor__Dropdown--DropdownMenu{position:absolute;left:0;box-shadow:var(--ngx-editor-popup-shadow);border-radius:var(--ngx-editor-popup-border-radius);background-color:var(--ngx-editor-popup-bg-color);z-index:10;width:100%;top:calc(var(--ngx-editor-menubar-height) + 2px);display:flex;flex-direction:column}.NgxEditor__Dropdown .NgxEditor__Dropdown--Item{all:unset;appearance:none;padding:8px;white-space:nowrap;color:inherit}.NgxEditor__Dropdown .NgxEditor__Dropdown--Item:focus-visible{outline:1px solid var(--ngx-editor-focus-ring-color)}.NgxEditor__Dropdown .NgxEditor__Dropdown--Item:hover{background-color:var(--ngx-editor-menu-item-hover-bg-color)}.NgxEditor__Dropdown .NgxEditor__Dropdown--Selected,.NgxEditor__Dropdown .NgxEditor__Dropdown--Open{color:var(--ngx-editor-menu-item-active-color);background-color:var(--ngx-editor-menu-item-active-bg-color)}.NgxEditor__Dropdown .NgxEditor__Dropdown--Active{background-color:var(--ngx-editor-menu-item-active-bg-color)}.NgxEditor__Dropdown .NgxEditor__Dropdown--Active:hover{background-color:var(--ngx-editor-menu-item-hover-bg-color)}.NgxEditor__MenuBar--Reverse .NgxEditor__Dropdown--DropdownMenu{top:unset;bottom:calc(var(--ngx-editor-menubar-height) + 2px)}.NgxEditor__MenuBar--Reverse .NgxEditor__Dropdown--Text:after{transform:rotate(180deg)}.NgxEditor__MenuBar--Reverse .NgxEditor__Popup{top:unset;bottom:calc(var(--ngx-editor-menubar-height) + 2px)}.NgxEditor__Popup{position:absolute;top:calc(var(--ngx-editor-menubar-height) + 2px);box-shadow:var(--ngx-editor-popup-shadow);border-radius:var(--ngx-editor-popup-border-radius);background-color:var(--ngx-editor-popup-bg-color);z-index:10;min-width:192px;padding:8px}.NgxEditor__Popup .NgxEditor__Popup--FormGroup{margin-bottom:8px}.NgxEditor__Popup .NgxEditor__Popup--FormGroup label{margin-bottom:3px}.NgxEditor__Popup .NgxEditor__Popup--FormGroup input[type=text],.NgxEditor__Popup .NgxEditor__Popup--FormGroup input[type=url]{padding:2px 4px}.NgxEditor__Popup .NgxEditor__Popup--Col{display:flex;flex-direction:column;position:relative}.NgxEditor__Popup .NgxEditor__Popup--Label{font-size:85%}.NgxEditor__Seperator{border-left:1px solid var(--ngx-editor-seperator-color);margin:0 5px}.NgxEditor__HelpText{font-size:80%}.NgxEditor__HelpText.NgxEditor__HelpText--Error{color:var(--ngx-editor-error-color)}\n'],encapsulation:2})}return n})();class Fl{name;constructor(e){this.name=e}apply(){return(e,t)=>{const{schema:r}=e,i=r.marks[this.name];return!!i&&YZ(i)(e,t)}}toggle(){return(e,t)=>{const{schema:r}=e,i=r.marks[this.name];return!!i&&Mf(i)(e,t)}}isActive(e){const{schema:t}=e,r=t.marks[this.name];return!!r&&EF(e,r)}canExecute(e){return this.toggle()(e)}}class FT{isBulletList=!1;constructor(e=!1){this.isBulletList=e}getType(e){return this.isBulletList?e.nodes.bullet_list:e.nodes.ordered_list}toggle(){return(e,t)=>{const{schema:r}=e,i=this.getType(r);return!!i&&(this.isActive(e)?RZ(r.nodes.list_item)(e,t):function qLe(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,s=i.blockRange(o);if(!s)return!1;let a=r?t.tr:null;return!!function WLe(n,e,t,r=null){let i=!1,o=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&0==e.startIndex){if(0==e.$from.index(e.depth-1))return!1;let l=s.resolve(e.start-2);o=new dT(l,l,e.depth),e.endIndex=0;u--)o=Y.from(t[u].type.create(t[u].attrs,o));n.step(new cr(e.start-(r?2:0),e.end,e.start,e.end,new ie(o,0,0),t.length,!0));let s=0;for(let u=0;u{const{schema:r}=e,i=r.nodes.heading;return!!i&&vF(i)(e,t)}}toggle(){return(e,t)=>{const{schema:r,selection:i,doc:o}=e,s=r.nodes.heading;if(!s)return!1;const a=i.$from.before(1),c=o.nodeAt(a)?.attrs??{};return this.isActive(e)?vF(r.nodes.paragraph,c)(e,t):vF(s,{...c,level:this.level})(e,t)}}isActive(e){const{schema:t}=e,r=GZ(e),i=t.nodes.heading;if(!i)return!1;const o=[i,t.nodes.text,t.nodes.blockquote];return!!r.filter(l=>o.includes(l.type)).find(l=>l.attrs.level===this.level)}canExecute(e){return this.toggle()(e)}}class Q_{align;constructor(e){this.align=e}toggle(){return(e,t)=>{const{doc:r,selection:i,tr:o,schema:s}=e,{from:a,to:l}=i;let c=!1;return r.nodesBetween(a,l,(u,d)=>{const f=u.type;return[s.nodes.paragraph,s.nodes.heading].includes(f)&&(c=!0,o.setNodeMarkup(d,f,{...u.attrs,align:u.attrs.align===this.align?null:this.align})),!0}),!!c&&(o.docChanged&&t?.(o),!0)}}isActive(e){return!!GZ(e).find(i=>i.attrs.align===this.align)}canExecute(e){return this.toggle()(e)}}const G2e={strict:!0};let DF=class{update(e){return(t,r)=>{const{schema:i,selection:o}=t,s=i.marks.link;return!(!s||o.empty)&&Mf(s,e)(t,r)}}insert(e,t){return(r,i)=>{const{schema:o,tr:s}=r;if(!o.marks.link)return!1;const c=o.text(e,[o.marks.link.create({href:t.href,title:t.title??e,target:t.target??"_blank"})]);return s.replaceSelectionWith(c,!1).scrollIntoView(),!!s.docChanged&&(i?.(s),!0)}}isActive(e,t=G2e){if(t.strict)return!0;const{schema:r}=e,i=r.marks.link;return!!i&&EF(e,i)}remove(e,t){return((n,e)=>{const{doc:t,selection:r,tr:i,schema:o}=n,{$head:{pos:s},from:a,to:l}=r,c=o.marks.link;if(a===l){const u=t.resolve(s),d=s-u.textOffset,f=d+u.parent.child(u.index()).nodeSize;i.removeMark(d,f,c)}else i.removeMark(a,l,c);return!!i.docChanged&&(e?.(i),!0)})(e,t)}canExecute(e){const t={href:""};return this.insert("Exec",t)(e)||this.update(t)(e)}},aJ=class{insert(e,t){return(r,i)=>{const{schema:o,tr:s,selection:a}=r,l=o.nodes.image;if(!l)return!1;const c={width:null,src:e,...t};!c.width&&a instanceof Ie&&a.node.type===l&&(c.width=a.node.attrs.width),s.replaceSelectionWith(l.createAndFill(c));const u=s.doc.resolve(s.selection.anchor-s.selection.$anchor.nodeBefore.nodeSize);return s.setSelection(new Ie(u)).scrollIntoView(),!!s.docChanged&&(i?.(s),!0)}}isActive(e){const{selection:t}=e;return t instanceof Ie&&"image"===t.node.type.name}},kf=class{name;attrName;constructor(e,t="color"){this.name=e,this.attrName=t}apply(e){return(t,r)=>{const{schema:i,selection:o,doc:s}=t,a=i.marks[this.name];if(!a)return!1;const{from:l,to:c,empty:u}=o;if(!u&&l+1===c){const d=s.nodeAt(l);if(d?.isAtom&&!d.isText&&d.isLeaf)return!1}return YZ(a,e)(t,r)}}isActive(e){const{schema:t}=e,r=t.marks[this.name];return!!r&&EF(e,r)}getActiveColors(e){if(!this.isActive(e))return[];const{schema:t}=e;return(n=>{let e=[];const{selection:t,storedMarks:r}=n,{from:i,to:o,empty:s,$from:a}=t;return s?e=r||a.marks():n.doc.nodesBetween(i,o,l=>{e=[...e,...l.marks]}),e})(e).filter(o=>o.type===t.marks[this.name]).map(o=>o.attrs[this.attrName]).filter(Boolean)}remove(){return(e,t)=>{const{schema:r}=e,i=r.marks[this.name];return!!i&&(n=i,(e,t)=>{const{tr:r,selection:i,storedMarks:o,doc:s}=e,{empty:a,ranges:l}=i;if(a&&i instanceof lt){const{$cursor:c}=i;if(!c||!KZ(e.doc,l,n))return!1;if(n.isInSet(o||c.marks()))return r.removeStoredMark(n),t?.(r),!0}else{for(const c of l){const{$from:u,$to:d}=c;s.rangeHasMark(u.pos,d.pos,n)&&r.removeMark(u.pos,d.pos,n)}if(!r.docChanged)return!1;t?.(r.scrollIntoView())}return!1})(e,t);var n}}canExecute(e){return this.apply("text_color"===this.name?{color:""}:{backgroundColor:""})(e)}};const K2e=["link"],Y2e=["paragraph","heading","blockquote"];class LT{method="increase";constructor(e){this.method=e}insert(){return(e,t)=>{const{tr:r,doc:i}=e,{from:o,to:s}=r.selection;let a=!1;return i.nodesBetween(o,s,(l,c)=>Y2e.includes(l.type.name)?(a=((n,e,t)=>{const r=n.doc.nodeAt(e);if(!r)return!1;const i=r.attrs.indent??0,o=(n=>Math.min(Math.max(n,0),10))(i+("increase"===t?1:-1));if(o===i||o<0||o>10)return!1;const s={...r.attrs,indent:o};return n.setNodeMarkup(e,r.type,s),!0})(r,c,this.method),!1):!l.type.name.includes("list")),!!a&&(r.docChanged&&t?.(r),!0)}}canExecute(e){return this.insert()(e)}}class uJ{mode="undo";constructor(e){this.mode=e}insert(){return(e,t)=>"undo"===this.mode?CF(e,t):NT(e,t)}canExecute(e){return this.insert()(e)}}new Fl("strong"),new Fl("em"),new Fl("code"),new Fl("u"),new Fl("s"),new class q2e{toggle(){return(e,t)=>{const{schema:r}=e,i=r.nodes.blockquote;return!!i&&(this.isActive(e)?((n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&k_(i);return null!=o&&(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)})(e,t):function bVe(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,s=i.blockRange(o),a=s&&OO(s,n,e);return!!a&&(r&&r(t.tr.wrap(s,a).scrollIntoView()),!0)}}(i)(e,t))}}isActive(e){const{schema:t}=e,r=t.nodes.blockquote;return!!r&&WZ(e,r)}canExecute(e){return this.toggle()(e)}},new class W2e{insert(){return(e,t)=>{const{schema:r,tr:i}=e,o=r.nodes.horizontal_rule;return!!o&&(t(i.replaceSelectionWith(o.create()).scrollIntoView()),!0)}}canExecute(e){return((n,e)=>{const{$from:t}=n.selection;for(let r=t.depth;r>=0;r-=1){const i=t.index(r);if(t.node(r).canReplaceWith(i,i,e))return!0}return!1})(e,e.schema.nodes.horizontal_rule)}},new class Q2e{insert(){return(e,t)=>{const{tr:r}=e,{ranges:i,empty:o}=r.selection;return o||(Object.entries(e.schema.marks).forEach(([s,a])=>{K2e.includes(s)||i.forEach(l=>{r.removeMark(l.$from.pos,l.$to.pos,a)})}),t(r)),!0}}canExecute(){return!0}},new FT(!0),new FT(!1),new Au(1),new Au(2),new Au(3),new Au(4),new Au(5),new Au(6),new Q_("left"),new Q_("center"),new Q_("right"),new Q_("justify"),new DF,new aJ,new kf("text_color","color"),new kf("text_background_color","backgroundColor"),new LT("increase"),new LT("decrease"),new Fl("sup"),new Fl("sub"),new uJ("undo"),new uJ("redo");const AF={bold:"Bold",italic:"Italic",code:"Code",underline:"Underline",strike:"Strike",blockquote:"Blockquote",bullet_list:"Bullet List",ordered_list:"Ordered List",heading:"Heading",h1:"Header 1",h2:"Header 2",h3:"Header 3",h4:"Header 4",h5:"Header 5",h6:"Header 6",align_left:"Left Align",align_center:"Center Align",align_right:"Right Align",align_justify:"Justify",text_color:"Text Color",background_color:"Background Color",horizontal_rule:"Horizontal rule",format_clear:"Clear Formatting",insertLink:"Insert Link",removeLink:"Remove Link",insertImage:"Insert Image",indent:"Increase Indent",outdent:"Decrease Indent",superscript:"Superscript",subscript:"Subscript",undo:"Undo",redo:"Redo",url:"URL",text:"Text",openInNewTab:"Open in new tab",insert:"Insert",altText:"Alt Text",title:"Title",remove:"Remove",enterValidUrl:"Please enter a valid URL"};class TBe{locals=AF;constructor(e={}){this.locals={...AF,...e}}get=e=>{const t=this.locals[e];return t?qb(t)?t:de(t):de("")}}const dJ={bold:'\n \n',italic:'\n \n',code:'\n\n',underline:'\n\n',strike:'\n\n',ordered_list:'\n\n',bullet_list:'\n\n',blockquote:'\n\n',link:'\n\n',unlink:'\n\n',image:'\n\n',align_left:'\n\n',align_center:'\n\n',align_right:'\n\n',align_justify:'\n\n',text_color:'\n\n',color_fill:'\n\n',horizontal_rule:'\n \n \n \n \n',format_clear:'\n\n',indent:'',outdent:'',superscript:'',subscript:'',undo:'',redo:'',path:""};class JBe{static get(e,t="currentColor"){const r=dJ[e];return r&&(r.includes("\n ${r}\n \n `:r}}let RF=(()=>{class n{locals={};icons={};static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),eUe=(()=>{class n{config;constructor(t){this.config=t}get locals(){return new TBe(this.config.locals)}getIcon(t){return this.config.icons[t]?this.config.icons[t]:JBe.get(t)}static \u0275fac=function(r){return new(r||n)(me(RF,8))};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const hJ=n=>({locals:n.locals??{},icons:n.icons??{}});let tUe=(()=>{class n{sanitizer;constructor(t){this.sanitizer=t}transform(t){return iJ(t)?t:this.sanitizer.bypassSecurityTrustHtml(t)}static \u0275fac=function(r){return new(r||n)($($b,16))};static \u0275pipe=Fr({name:"sanitizeHtml",type:n,pure:!0,standalone:!1})}return n})(),nUe=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({providers:[tUe],imports:[za,Pw]})}return n})();const VT=new B("NgxEditorConfig"),fJ={locals:AF,icons:dJ};let rUe=(()=>{class n{static forRoot(t=fJ){return{ngModule:n,providers:[{provide:VT,useValue:t},{provide:RF,useFactory:hJ,deps:[VT]}]}}static forChild(t=fJ){return{ngModule:n,providers:[{provide:VT,useValue:t},{provide:RF,useFactory:hJ,deps:[VT]},eUe]}}static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[za,nUe]})}return n})();const hi=(n,e=!1)=>(t,r)=>{const i=new Fl(n);return e?i.toggle()(t,r):i.apply()(t,r)};class sUe{view;state;tr;constructor(e){if(!e)throw new yY("Required view to initialize commands.");this.view=e,this.state=e.state,this.tr=this.view.state.tr}applyTrx=e=>{this.state=this.state.apply(e??this.tr),this.tr=this.state.tr,this.tr.setMeta("APPLIED_TRX",!0)};dispatch=e=>{this.applyTrx(e)};exec(){if(!this.tr.getMeta("APPLIED_TRX"))return!1;const e=!this.view.state.doc.eq(this.state.doc);this.view.updateState(this.state);const t=this.tr.setMeta("FORCE_EMIT",e);return this.view.dispatch(t),!0}focus(e="end"){const t="start"===e?rt.atStart(this.state.doc):rt.atEnd(this.state.doc);return this.tr.setSelection(t),this.applyTrx(),this.view.focus(),this}scrollIntoView(){return this.tr.scrollIntoView(),this.applyTrx(),this}insertText(e){return this.tr.insertText(e),this.applyTrx(),this}insertNewLine(){return G_(FZ,VZ,BZ,yF)(this.state,this.dispatch),this}applyMark(e){return hi(e,!1)(this.state,this.dispatch),this}toggleMark(e){return hi(e,!0)(this.state,this.dispatch),this}bold(){return hi("strong")(this.state,this.dispatch),this}toggleBold(){return hi("strong",!0)(this.state,this.dispatch),this}italics(){return hi("em")(this.state,this.dispatch),this}toggleItalics(){return hi("em",!0)(this.state,this.dispatch),this}underline(){return hi("u")(this.state,this.dispatch),this}toggleUnderline(){return hi("u",!0)(this.state,this.dispatch),this}strike(){return hi("s")(this.state,this.dispatch),this}toggleStrike(){return hi("s",!0)(this.state,this.dispatch),this}code(){return hi("code")(this.state,this.dispatch),this}toggleCode(){return hi("code",!0)(this.state,this.dispatch),this}superscript(){return hi("sup")(this.state,this.dispatch),this}subscript(){return hi("sub")(this.state,this.dispatch),this}toggleOrderedList(){return new FT(!1).toggle()(this.state,this.dispatch),this}toggleBulletList(){return new FT(!0).toggle()(this.state,this.dispatch),this}toggleHeading(e){return new Au(e).toggle()(this.state,this.dispatch),this}insertLink(e,t){return(new DF).insert(e,t)(this.state,this.dispatch),this}updateLink(e){return(new DF).update(e)(this.state,this.dispatch),this}insertImage(e,t={}){return(new aJ).insert(e,t)(this.state,this.dispatch),this}textColor(e){return new kf("text_color").apply({color:e})(this.state,this.dispatch),this}backgroundColor(e){return new kf("text_background_color").apply({backgroundColor:e})(this.state,this.dispatch),this}removeTextColor(){return new kf("text_color").remove()(this.state,this.dispatch),this}removeBackgroundColor(){return new kf("text_background_color").remove()(this.state,this.dispatch),this}align(e){return new Q_(e).toggle()(this.state,this.dispatch),this}insertHTML(e){const{selection:t,schema:r,tr:i}=this.state,{from:o,to:s}=t,a=document.createElement("div");a.innerHTML=rJ(e)?e.trim():e;const l=bu.fromSchema(r).parseSlice(a),c=i.replaceRange(o,s,l);return this.applyTrx(c),this}indent(){return new LT("increase").insert()(this.state,this.dispatch),this}outdent(){return new LT("decrease").insert()(this.state,this.dispatch),this}}const aUe=typeof navigator<"u"&&/Mac/.test(navigator.platform),mUe=n=>{const e=PVe.concat(AVe,DVe);return e.push((n=>QZ(/(?:^|\s)(?:(\*\*|__)(?:([^*_]+))(\*\*|__))$/,n))(n.marks.strong)),e.push((n=>QZ(/(?:^|\s)(?:(\*|_)(?:([^*_]+))(\*|_))$/,n))(n.marks.em)),e.push((n=>wF(/^\s*>\s$/,n))(n.nodes.blockquote)),e.push((n=>wF(/^(?:\d+)\.\s$/,n,e=>({order:Number(e[1])}),(e,t)=>t.childCount+t.attrs.order===Number(e[1])))(n.nodes.ordered_list)),e.push((n=>wF(/^\s*(?:[-+*])\s$/,n))(n.nodes.bullet_list)),e.push((n=>qZ(/^```$/,n))(n.nodes.code_block)),e.push((n=>qZ(new RegExp("^(#{1,6})\\s$"),n,t=>({level:t[1].length})))(n.nodes.heading)),function SVe({rules:n}){let e=new ss({state:{init:()=>null,apply(t,r){return t.getMeta(this)||(t.selectionSet||t.docChanged?null:r)}},props:{handleTextInput:(t,r,i,o)=>$Z(t,r,i,o,n,e),handleDOMEvents:{compositionend:t=>{setTimeout(()=>{let{$cursor:r}=t.state.selection;r&&$Z(t,r.pos,r.pos,"",n,e)})}}},isInputRules:!0});return e}({rules:e})},_Ue=(n,e)=>{const t=[];return e.keyboardShortcuts&&t.push(...((n,e)=>{const t={};t["Mod-z"]=CF,aUe?t["Shift-Mod-z"]=NT:t["Mod-y"]=NT;const r=[OT({"Mod-b":Mf(n.marks.strong),"Mod-i":Mf(n.marks.em),"Mod-u":Mf(n.marks.u),"Mod-`":Mf(n.marks.code)}),OT({Enter:AZ(n.nodes.list_item),"Shift-Enter":G_(LZ,(i,o)=>{const{tr:s}=i;return o(s.replaceSelectionWith(n.nodes.hard_break.create()).scrollIntoView()),!0}),"Mod-[":RZ(n.nodes.list_item),"Mod-]":MZ(n.nodes.list_item),Tab:MZ(n.nodes.list_item)}),OT(TVe)];return e.history&&r.push(OT(t)),r})(n,{history:e.history})),e.history&&t.push(function GVe(n={}){return new ss({key:sa,state:{init:()=>new Pl(Io.empty,Io.empty,null,0,-1),apply:(e,t,r)=>function $Ve(n,e,t,r){let o,i=t.getMeta(sa);if(i)return i.historyState;t.getMeta(tJ)&&(n=new Pl(n.done,n.undone,null,0,-1));let s=t.getMeta("appendedTransaction");if(0==t.steps.length)return n;if(s&&s.getMeta(sa))return s.getMeta(sa).redo?new Pl(n.done.addTransform(t,void 0,r,MT(e)),n.undone,JZ(t.mapping.maps),n.prevTime,n.prevComposition):new Pl(n.done,n.undone.addTransform(t,void 0,r,MT(e)),null,n.prevTime,n.prevComposition);if(!1===t.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=t.getMeta("rebased"))?new Pl(n.done.rebased(t,o),n.undone.rebased(t,o),IF(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new Pl(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),IF(n.prevRanges,t.mapping),n.prevTime,n.prevComposition);{let a=t.getMeta("composition"),l=0==n.prevTime||!s&&n.prevComposition!=a&&(n.prevTime<(t.time||0)-r.newGroupDelay||!function qVe(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=e[o]&&(t=!0)}),t}(t,n.prevRanges)),c=s?IF(n.prevRanges,t.mapping):JZ(t.mapping.maps);return new Pl(n.done.addTransform(t,l?e.selection.getBookmark():void 0,r,MT(e)),Io.empty,c,t.time,a??n.prevComposition)}}(t,r,e,n)},config:n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i="historyUndo"==r?CF:"historyRedo"==r?NT:null;return!!i&&(t.preventDefault(),i(e.state,e.dispatch))}}}})}()),e.inputRules&&t.push(mUe(n)),t},mJ={linkOnPaste:!0,resizeImage:!0},gJ={content:null,history:!0,keyboardShortcuts:!0,inputRules:!0,schema:AT,plugins:[],nodeViews:{},attributes:{},features:mJ,handleScrollToSelection:null,linkValidationPattern:"(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/??([^#\n\r]*)?#?([^\n\r]*)|(mailto:.*[@].*)"};class yUe{options;view;constructor(e=gJ){this.options={...gJ,...e},this.createEditor()}valueChangesSubject=new fe;updateSubject=new fe;get valueChanges(){return this.valueChangesSubject.asObservable()}get update(){return this.updateSubject.asObservable()}get schema(){return this.options.schema||AT}get linkValidationPattern(){return this.options.linkValidationPattern}get commands(){return new sUe(this.view)}get features(){return{...mJ,...this.options.features}}handleTransactions(e){const t=this.view.state.apply(e);if(this.view.updateState(t),this.updateSubject.next(this.view),!e.docChanged&&!e.getMeta("FORCE_EMIT"))return;const r=t.doc.toJSON();this.valueChangesSubject.next(r)}createEditor(){const{options:e,schema:t}=this,{content:r=null,nodeViews:i}=e,{history:o=!0,keyboardShortcuts:s=!0,inputRules:a=!0}=e,l=K_(r,t,e.parseOptions),c=e.plugins??[],u=e.attributes??{},d=_Ue(t,{history:o,keyboardShortcuts:s,inputRules:a});this.view=new BLe(null,{state:Tf.create({doc:l,schema:t,plugins:[...d,...c]}),nodeViews:i,dispatchTransaction:this.handleTransactions.bind(this),attributes:u,handleScrollToSelection:e.handleScrollToSelection})}setContent(e){if(typeof(n=e)>"u"||null===n)return;var n;const{state:t}=this.view,{tr:r,doc:i}=t,o=K_(e,this.schema,this.options.parseOptions);r.replaceWith(0,t.doc.content.size,o),!i.eq(r.doc)&&r.docChanged&&this.view.dispatch(r)}registerPlugin(e){const{state:t}=this.view,r=[...t.plugins,e],i=t.reconfigure({plugins:r});this.view.updateState(i)}destroy(){this.view.destroy()}}let vUe=(()=>{class n{firestore=b(I_);authService=b(mf);createPost(t){var r=this;return T(function*(){const i=r.authService.currentUser();if(!i)throw new Error("Must be logged in to create a post");const o=j1e(r.firestore,"posts"),s={...t,authorId:i.uid,authorName:i.displayName||"Anonymous",createdAt:E_(),updatedAt:E_(),publishedAt:"published"===t.status?E_():null};return(yield z1e(o,s)).id})()}updatePost(t,r){var i=this;return T(function*(){const o=tO(i.firestore,"posts",t);yield G1e(o,{...r,updatedAt:E_(),publishedAt:"published"===r.status?E_():null})})()}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function bUe(n,e){1&n&&(W(0,"mat-error"),Oe(1," Title is required "),K())}function wUe(n,e){1&n&&(W(0,"mat-error"),Oe(1," Content is required "),K())}function EUe(n,e){if(1&n){const t=La();W(0,"mat-chip-row",14),Ve("removed",function(){const i=vi(t).$implicit;return bi(Ln().removeTag(i))}),Oe(1),W(2,"button",15)(3,"mat-icon"),Oe(4,"cancel"),K()()()}if(2&n){const t=e.$implicit;re(),Va(" ",t," ")}}const IUe=[{path:"auth",children:[{path:"login",component:qNe},{path:"signup",component:WNe},{path:"",redirectTo:"login",pathMatch:"full"}]},{path:"blog",canActivate:[lY],children:[{path:"create",component:(()=>{class n{fb=b(Nw);blogService=b(vUe);editor;separatorKeysCodes=[13,188];tags=ti([]);saving=ti(!1);postForm=this.fb.group({title:["",Ri.required],content:["",Ri.required],tags:[[]]});ngOnInit(){this.editor=new yUe}ngOnDestroy(){this.editor.destroy()}addTag(t){const r=(t.value||"").trim();r&&this.tags.update(i=>[...i,r]),t.chipInput.clear()}removeTag(t){this.tags.update(r=>r.filter(i=>i!==t))}saveDraft(){var t=this;return T(function*(){if(t.postForm.valid)try{t.saving.set(!0);const r=t.postForm.getRawValue();yield t.blogService.createPost({title:r.title||"",content:r.content||"",tags:t.tags(),status:"draft"})}finally{t.saving.set(!1)}})()}onSubmit(){var t=this;return T(function*(){if(t.postForm.valid)try{t.saving.set(!0);const r=t.postForm.getRawValue();yield t.blogService.createPost({title:r.title||"",content:r.content||"",tags:t.tags(),status:"published"})}finally{t.saving.set(!1)}})()}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["app-create-post"]],decls:30,vars:9,consts:[["chipGrid",""],[1,"container","p-4"],[1,"max-w-4xl","mx-auto"],[1,"p-4"],[1,"flex","flex-col","gap-4",3,"ngSubmit","formGroup"],["appearance","outline"],["matInput","","formControlName","title","placeholder","Enter post title"],[4,"ngIf"],["formControlName","content",3,"editor","placeholder"],["aria-label","Tag selection"],["placeholder","Add tags...",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],[1,"flex","gap-4","justify-end"],["mat-stroked-button","","type","button",3,"click","disabled"],["mat-raised-button","","color","primary","type","submit",3,"disabled"],[3,"removed"],["matChipRemove",""]],template:function(r,i){if(1&r){const o=La();W(0,"div",1)(1,"mat-card",2)(2,"mat-card-header")(3,"mat-card-title"),Oe(4,"Create New Post"),K()(),W(5,"mat-card-content",3)(6,"form",4),Ve("ngSubmit",function(){return vi(o),bi(i.onSubmit())}),W(7,"mat-form-field",5)(8,"mat-label"),Oe(9,"Title"),K(),Pe(10,"input",6),et(11,bUe,2,0,"mat-error",7),K(),W(12,"mat-form-field",5)(13,"mat-label"),Oe(14,"Content"),K(),Pe(15,"ngx-editor",8),et(16,wUe,2,0,"mat-error",7),K(),W(17,"mat-form-field",5)(18,"mat-label"),Oe(19,"Tags"),K(),W(20,"mat-chip-grid",9,0),function Wj(n,e,t,r,i,o,s,a,l,c,u,d,f){On("NgControlFlow");const p=L(),m=ve(),_=void 0!==l,v=L(),E=a?s.bind(v[15][8]):s,C=new Ede(_,E);v[25+n]=C,qp(p,m,n+1,e,t,r,i,$i(m.consts,o)),_&&qp(p,m,n+2,l,c,u,d,$i(m.consts,f))}(22,EUe,5,1,"mat-chip-row",null,qj),K(),W(24,"input",10),Ve("matChipInputTokenEnd",function(a){return vi(o),bi(i.addTag(a))}),K()(),W(25,"div",11)(26,"button",12),Ve("click",function(){return vi(o),bi(i.saveDraft())}),Oe(27," Save as Draft "),K(),W(28,"button",13),Oe(29," Publish Post "),K()()()()()()}if(2&r){let o,s;const a=rm(21);re(6),De("formGroup",i.postForm),re(5),De("ngIf",null==(o=i.postForm.get("title"))?null:o.hasError("required")),re(4),De("editor",i.editor)("placeholder","Write your post content here..."),re(),De("ngIf",null==(s=i.postForm.get("content"))?null:s.hasError("required")),re(6),function Gj(n){const e=Se(null),t=Jn();try{const r=L(),i=r[1],o=r[t],s=t+1,a=sb(r,s);if(void 0===o.liveCollection){const c=zS(i,s);o.liveCollection=new Ide(a,r,c)}else o.liveCollection.reset();const l=o.liveCollection;if(function vde(n,e,t){let r,i,o=0,s=n.length-1;if(Array.isArray(e)){let l=e.length-1;for(;o<=s&&o<=l;){const c=n.at(o),u=e[o],d=BS(o,c,o,u,t);if(0!==d){d<0&&n.updateValue(o,u),o++;continue}const f=n.at(s),p=e[l],m=BS(s,f,l,p,t);if(0!==m){m<0&&n.updateValue(s,p),s--,l--;continue}const _=t(o,c),v=t(s,f),E=t(o,u);if(Object.is(E,v)){const C=t(l,p);Object.is(C,_)?(n.swap(o,s),n.updateValue(s,p),l--,s--):n.move(s,o),n.updateValue(o,u),o++}else if(r??=new $j,i??=Hj(n,o,s,t),US(n,r,o,E))n.updateValue(o,u),o++,s++;else if(i.has(E))r.set(_,n.detach(o)),s--;else{const C=n.create(o,e[o]);n.attach(o,C),o++,s++}}for(;o<=l;)jj(n,r,t,o,e[o]),o++}else if(null!=e){const l=e[Symbol.iterator]();let c=l.next();for(;!c.done&&o<=s;){const u=n.at(o),d=c.value,f=BS(o,u,o,d,t);if(0!==f)f<0&&n.updateValue(o,d),o++,c=l.next();else{r??=new $j,i??=Hj(n,o,s,t);const p=t(o,d);if(US(n,r,o,p))n.updateValue(o,d),o++,s++,c=l.next();else if(i.has(p)){const m=t(o,u);r.set(m,n.detach(o)),s--}else n.attach(o,n.create(o,d)),o++,s++,c=l.next()}}for(;!c.done;)jj(n,r,t,n.length,c.value),c=l.next()}for(;o<=s;)n.destroy(n.detach(s--));r?.forEach(l=>{n.destroy(l)})}(l,n,o.trackByFn),l.updateIndexes(),o.hasEmptyBlock){const c=qi(),u=0===l.length;if(rn(r,c,u)){const d=t+2,f=sb(r,d);if(u){const p=zS(i,d),m=null;Ed(f,vd(r,p,void 0,{dehydratedView:m}),0,hc(p,m))}else Hx(f,0)}}}finally{Se(e)}}(i.tags()),re(2),De("matChipInputFor",a)("matChipInputSeparatorKeyCodes",i.separatorKeysCodes),re(2),De("disabled",i.saving()),re(2),De("disabled",!i.postForm.valid||i.saving())}},dependencies:[za,Bb,Pw,kw,nh,bw,ww,Ga,$m,oR,Xw,Jw,eE,Zw,ng,dR,tg,SW,fR,hR,hh,dh,sOe,gY,_Y,fY,IO,yO,_O,qW,rUe,$2e],styles:["[_nghost-%COMP%]{display:block}.container[_ngcontent-%COMP%]{margin:0 auto;max-width:1200px}ngx-editor[_ngcontent-%COMP%]{height:400px;border:1px solid var(--border-color);border-radius:4px}"]})}return n})()},{path:"",redirectTo:"list",pathMatch:"full"}]},{path:"",component:zPe,canActivate:[lY]}];function _J(n){return new O(3e3,!1)}function Ll(n){switch(n.length){case 0:return new eg;case 1:return n[0];default:return new CW(n)}}function yJ(n,e,t=new Map,r=new Map){const i=[],o=[];let s=-1,a=null;if(e.forEach(l=>{const c=l.get("offset"),u=c==s,d=u&&a||new Map;l.forEach((f,p)=>{let m=p,_=f;if("offset"!==p)switch(m=n.normalizePropertyName(m,i),_){case"!":_=t.get(p);break;case Ns:_=r.get(p);break;default:_=n.normalizeStyleValue(p,m,_,i)}d.set(m,_)}),u||o.push(d),a=d,s=c}),i.length)throw function WUe(){return new O(3502,!1)}();return o}function MF(n,e,t,r){switch(e){case"start":n.onStart(()=>r(t&&kF(t,"start",n)));break;case"done":n.onDone(()=>r(t&&kF(t,"done",n)));break;case"destroy":n.onDestroy(()=>r(t&&kF(t,"destroy",n)))}}function kF(n,e,t){const o=NF(n.element,n.triggerName,n.fromState,n.toState,e||n.phaseName,t.totalTime??n.totalTime,!!t.disabled),s=n._data;return null!=s&&(o._data=s),o}function NF(n,e,t,r,i="",o=0,s){return{element:n,triggerName:e,fromState:t,toState:r,phaseName:i,totalTime:o,disabled:!!s}}function Fi(n,e,t){let r=n.get(e);return r||n.set(e,r=t),r}function vJ(n){const e=n.indexOf(":");return[n.substring(1,e),n.slice(e+1)]}const ize=typeof document>"u"?null:document.documentElement;function PF(n){const e=n.parentNode||n.host||null;return e===ize?null:e}let Ru=null,bJ=!1;function wJ(n,e){for(;e;){if(e===n)return!0;e=PF(e)}return!1}function EJ(n,e,t){if(t)return Array.from(n.querySelectorAll(e));const r=n.querySelector(e);return r?[r]:[]}let OF=(()=>{class n{validateStyleProperty(t){return function sze(n){Ru||(Ru=function aze(){return typeof document<"u"?document.body:null}()||{},bJ=!!Ru.style&&"WebkitAppearance"in Ru.style);let e=!0;return Ru.style&&!function oze(n){return"ebkit"==n.substring(1,6)}(n)&&(e=n in Ru.style,!e&&bJ&&(e="Webkit"+n.charAt(0).toUpperCase()+n.slice(1)in Ru.style)),e}(t)}containsElement(t,r){return wJ(t,r)}getParentElement(t){return PF(t)}query(t,r,i){return EJ(t,r,i)}computeStyle(t,r,i){return i||""}animate(t,r,i,o,s,a=[],l){return new eg(i,o)}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac})}return n})();class FF{static NOOP=new OF}class LF{}const VF="ng-enter",BT="ng-leave",UT="ng-trigger",zT=".ng-trigger",TJ="ng-animating",BF=".ng-animating";function aa(n){if("number"==typeof n)return n;const e=n.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:UF(parseFloat(e[1]),e[2])}function UF(n,e){return"s"===e?1e3*n:n}function jT(n,e,t){return n.hasOwnProperty("duration")?n:function dze(n,e,t){let i,o=0,s="";if("string"==typeof n){const a=n.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===a)return e.push(_J()),{duration:0,delay:0,easing:""};i=UF(parseFloat(a[1]),a[2]);const l=a[3];null!=l&&(o=UF(parseFloat(l),a[4]));const c=a[5];c&&(s=c)}else i=n;if(!t){let a=!1,l=e.length;i<0&&(e.push(function TUe(){return new O(3100,!1)}()),a=!0),o<0&&(e.push(function CUe(){return new O(3101,!1)}()),a=!0),a&&e.splice(l,0,_J())}return{duration:i,delay:o,easing:s}}(n,e,t)}function us(n,e,t){e.forEach((r,i)=>{const o=jF(i);t&&!t.has(i)&&t.set(i,n.style[o]),n.style[o]=r})}function Mu(n,e){e.forEach((t,r)=>{const i=jF(r);n.style[i]=""})}function Y_(n){return Array.isArray(n)?1==n.length?n[0]:function MIe(n,e=null){return{type:we.Sequence,steps:n,options:e}}(n):n}const zF=new RegExp("{{\\s*(.+?)\\s*}}","g");function xJ(n){let e=[];if("string"==typeof n){let t;for(;t=zF.exec(n);)e.push(t[1]);zF.lastIndex=0}return e}function X_(n,e,t){const r=`${n}`,i=r.replace(zF,(o,s)=>{let a=e[s];return null==a&&(t.push(function SUe(){return new O(3003,!1)}()),a=""),a.toString()});return i==r?n:i}const pze=/-+([a-z0-9])/g;function jF(n){return n.replace(pze,(...e)=>e[1].toUpperCase())}function Li(n,e,t){switch(e.type){case we.Trigger:return n.visitTrigger(e,t);case we.State:return n.visitState(e,t);case we.Transition:return n.visitTransition(e,t);case we.Sequence:return n.visitSequence(e,t);case we.Group:return n.visitGroup(e,t);case we.Animate:return n.visitAnimate(e,t);case we.Keyframes:return n.visitKeyframes(e,t);case we.Style:return n.visitStyle(e,t);case we.Reference:return n.visitReference(e,t);case we.AnimateChild:return n.visitAnimateChild(e,t);case we.AnimateRef:return n.visitAnimateRef(e,t);case we.Query:return n.visitQuery(e,t);case we.Stagger:return n.visitStagger(e,t);default:throw function DUe(){return new O(3004,!1)}()}}function HF(n,e){return window.getComputedStyle(n)[e]}const _ze=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 SJ extends LF{normalizePropertyName(e,t){return jF(e)}normalizeStyleValue(e,t,r,i){let o="";const s=r.toString().trim();if(_ze.has(t)&&0!==r&&"0"!==r)if("number"==typeof r)o="px";else{const a=r.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&0==a[1].length&&i.push(function AUe(){return new O(3005,!1)}())}return s+o}}const qT=new Set(["true","1"]),WT=new Set(["false","0"]);function DJ(n,e){const t=qT.has(n)||WT.has(n),r=qT.has(e)||WT.has(e);return(i,o)=>{let s="*"==n||n==i,a="*"==e||e==o;return!s&&t&&"boolean"==typeof i&&(s=i?qT.has(n):WT.has(n)),!a&&r&&"boolean"==typeof o&&(a=o?qT.has(e):WT.has(e)),s&&a}}const wze=new RegExp("s*:selfs*,?","g");function $F(n,e,t,r){return new Eze(n).build(e,t,r)}class Eze{_driver;constructor(e){this._driver=e}build(e,t,r){const i=new Cze(t);return this._resetContextStyleTimingState(i),Li(this,Y_(e),i)}_resetContextStyleTimingState(e){e.currentQuerySelector="",e.collectedStyles=new Map,e.collectedStyles.set("",new Map),e.currentTime=0}visitTrigger(e,t){let r=t.queryCount=0,i=t.depCount=0;const o=[],s=[];return"@"==e.name.charAt(0)&&t.errors.push(function RUe(){return new O(3006,!1)}()),e.definitions.forEach(a=>{if(this._resetContextStyleTimingState(t),a.type==we.State){const l=a,c=l.name;c.toString().split(/\s*,\s*/).forEach(u=>{l.name=u,o.push(this.visitState(l,t))}),l.name=c}else if(a.type==we.Transition){const l=this.visitTransition(a,t);r+=l.queryCount,i+=l.depCount,s.push(l)}else t.errors.push(function MUe(){return new O(3007,!1)}())}),{type:we.Trigger,name:e.name,states:o,transitions:s,queryCount:r,depCount:i,options:null}}visitState(e,t){const r=this.visitStyle(e.styles,t),i=e.options&&e.options.params||null;if(r.containsDynamicStyles){const o=new Set,s=i||{};r.styles.forEach(a=>{a instanceof Map&&a.forEach(l=>{xJ(l).forEach(c=>{s.hasOwnProperty(c)||o.add(c)})})}),o.size&&t.errors.push(function kUe(){return new O(3008,!1)}(0,o.values()))}return{type:we.State,name:e.name,style:r,options:i?{params:i}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;const r=Li(this,Y_(e.animation),t),i=function yze(n,e){const t=[];return"string"==typeof n?n.split(/\s*,\s*/).forEach(r=>function vze(n,e,t){if(":"==n[0]){const l=function bze(n,e){switch(n){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,r)=>parseFloat(r)>parseFloat(t);case":decrement":return(t,r)=>parseFloat(r) *"}}(n,t);if("function"==typeof l)return void e.push(l);n=l}const r=n.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==r||r.length<4)return t.push(function zUe(){return new O(3015,!1)}()),e;const i=r[1],o=r[2],s=r[3];e.push(DJ(i,s)),"<"==o[0]&&("*"!=i||"*"!=s)&&e.push(DJ(s,i))}(r,t,e)):t.push(n),t}(e.expr,t.errors);return{type:we.Transition,matchers:i,animation:r,queryCount:t.queryCount,depCount:t.depCount,options:ku(e.options)}}visitSequence(e,t){return{type:we.Sequence,steps:e.steps.map(r=>Li(this,r,t)),options:ku(e.options)}}visitGroup(e,t){const r=t.currentTime;let i=0;const o=e.steps.map(s=>{t.currentTime=r;const a=Li(this,s,t);return i=Math.max(i,t.currentTime),a});return t.currentTime=i,{type:we.Group,steps:o,options:ku(e.options)}}visitAnimate(e,t){const r=function Sze(n,e){if(n.hasOwnProperty("duration"))return n;if("number"==typeof n)return qF(jT(n,e).duration,0,"");const t=n;if(t.split(/\s+/).some(o=>"{"==o.charAt(0)&&"{"==o.charAt(1))){const o=qF(0,0,"");return o.dynamic=!0,o.strValue=t,o}const i=jT(t,e);return qF(i.duration,i.delay,i.easing)}(e.timings,t.errors);t.currentAnimateTimings=r;let i,o=e.styles?e.styles:Ps({});if(o.type==we.Keyframes)i=this.visitKeyframes(o,t);else{let s=e.styles,a=!1;if(!s){a=!0;const c={};r.easing&&(c.easing=r.easing),s=Ps(c)}t.currentTime+=r.duration+r.delay;const l=this.visitStyle(s,t);l.isEmptyStep=a,i=l}return t.currentAnimateTimings=null,{type:we.Animate,timings:r,style:i,options:null}}visitStyle(e,t){const r=this._makeStyleAst(e,t);return this._validateStyleAst(r,t),r}_makeStyleAst(e,t){const r=[],i=Array.isArray(e.styles)?e.styles:[e.styles];for(let a of i)"string"==typeof a?a===Ns?r.push(a):t.errors.push(new O(3002,!1)):r.push(new Map(Object.entries(a)));let o=!1,s=null;return r.forEach(a=>{if(a instanceof Map&&(a.has("easing")&&(s=a.get("easing"),a.delete("easing")),!o))for(let l of a.values())if(l.toString().indexOf("{{")>=0){o=!0;break}}),{type:we.Style,styles:r,easing:s,offset:e.offset,containsDynamicStyles:o,options:null}}_validateStyleAst(e,t){const r=t.currentAnimateTimings;let i=t.currentTime,o=t.currentTime;r&&o>0&&(o-=r.duration+r.delay),e.styles.forEach(s=>{"string"!=typeof s&&s.forEach((a,l)=>{const c=t.collectedStyles.get(t.currentQuerySelector),u=c.get(l);let d=!0;u&&(o!=i&&o>=u.startTime&&i<=u.endTime&&(t.errors.push(function PUe(){return new O(3010,!1)}()),d=!1),o=u.startTime),d&&c.set(l,{startTime:o,endTime:i}),t.options&&function fze(n,e,t){const r=e.params||{},i=xJ(n);i.length&&i.forEach(o=>{r.hasOwnProperty(o)||t.push(function xUe(){return new O(3001,!1)}())})}(a,t.options,t.errors)})})}visitKeyframes(e,t){const r={type:we.Keyframes,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push(function OUe(){return new O(3011,!1)}()),r;let o=0;const s=[];let a=!1,l=!1,c=0;const u=e.steps.map(E=>{const C=this._makeStyleAst(E,t);let R=null!=C.offset?C.offset:function xze(n){if("string"==typeof n)return null;let e=null;if(Array.isArray(n))n.forEach(t=>{if(t instanceof Map&&t.has("offset")){const r=t;e=parseFloat(r.get("offset")),r.delete("offset")}});else if(n instanceof Map&&n.has("offset")){const t=n;e=parseFloat(t.get("offset")),t.delete("offset")}return e}(C.styles),V=0;return null!=R&&(o++,V=C.offset=R),l=l||V<0||V>1,a=a||V0&&o{const R=f>0?C==p?1:f*C:s[C],V=R*v;t.currentTime=m+_.delay+V,_.duration=V,this._validateStyleAst(E,t),E.offset=R,r.styles.push(E)}),r}visitReference(e,t){return{type:we.Reference,animation:Li(this,Y_(e.animation),t),options:ku(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:we.AnimateChild,options:ku(e.options)}}visitAnimateRef(e,t){return{type:we.AnimateRef,animation:this.visitReference(e.animation,t),options:ku(e.options)}}visitQuery(e,t){const r=t.currentQuerySelector,i=e.options||{};t.queryCount++,t.currentQuery=e;const[o,s]=function Ize(n){const e=!!n.split(/\s*,\s*/).find(t=>":self"==t);return e&&(n=n.replace(wze,"")),n=n.replace(/@\*/g,zT).replace(/@\w+/g,t=>zT+"-"+t.slice(1)).replace(/:animating/g,BF),[n,e]}(e.selector);t.currentQuerySelector=r.length?r+" "+o:o,Fi(t.collectedStyles,t.currentQuerySelector,new Map);const a=Li(this,Y_(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=r,{type:we.Query,selector:o,limit:i.limit||0,optional:!!i.optional,includeSelf:s,animation:a,originalSelector:e.selector,options:ku(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push(function BUe(){return new O(3013,!1)}());const r="full"===e.timings?{duration:0,delay:0,easing:"full"}:jT(e.timings,t.errors,!0);return{type:we.Stagger,animation:Li(this,Y_(e.animation),t),timings:r,options:null}}}class Cze{errors;queryCount=0;depCount=0;currentTransition=null;currentQuery=null;currentQuerySelector=null;currentAnimateTimings=null;currentTime=0;collectedStyles=new Map;options=null;unsupportedCSSPropertiesFound=new Set;constructor(e){this.errors=e}}function ku(n){return n?(n={...n}).params&&(n.params=function Tze(n){return n?{...n}:null}(n.params)):n={},n}function qF(n,e,t){return{duration:n,delay:e,easing:t}}function WF(n,e,t,r,i,o,s=null,a=!1){return{type:1,element:n,keyframes:e,preStyleProps:t,postStyleProps:r,duration:i,delay:o,totalTime:i+o,easing:s,subTimeline:a}}class GT{_map=new Map;get(e){return this._map.get(e)||[]}append(e,t){let r=this._map.get(e);r||this._map.set(e,r=[]),r.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}}const Rze=new RegExp(":enter","g"),kze=new RegExp(":leave","g");function GF(n,e,t,r,i,o=new Map,s=new Map,a,l,c=[]){return(new Nze).buildKeyframes(n,e,t,r,i,o,s,a,l,c)}class Nze{buildKeyframes(e,t,r,i,o,s,a,l,c,u=[]){c=c||new GT;const d=new KF(e,t,c,i,o,u,[]);d.options=l;const f=l.delay?aa(l.delay):0;d.currentTimeline.delayNextStep(f),d.currentTimeline.setStyles([s],null,d.errors,l),Li(this,r,d);const p=d.timelines.filter(m=>m.containsAnimation());if(p.length&&a.size){let m;for(let _=p.length-1;_>=0;_--){const v=p[_];if(v.element===t){m=v;break}}m&&!m.allowOnlyTimelineStyles()&&m.setStyles([a],null,d.errors,l)}return p.length?p.map(m=>m.buildKeyframes()):[WF(t,[],[],[],0,f,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){const r=t.subInstructions.get(t.element);if(r){const i=t.createSubContext(e.options),o=t.currentTimeline.currentTime,s=this._visitSubInstructions(r,i,i.options);o!=s&&t.transformIntoNewTimeline(s)}t.previousNode=e}visitAnimateRef(e,t){const r=t.createSubContext(e.options);r.transformIntoNewTimeline(),this._applyAnimationRefDelays([e.options,e.animation.options],t,r),this.visitReference(e.animation,r),t.transformIntoNewTimeline(r.currentTimeline.currentTime),t.previousNode=e}_applyAnimationRefDelays(e,t,r){for(const i of e){const o=i?.delay;if(o){const s="number"==typeof o?o:aa(X_(o,i?.params??{},t.errors));r.delayNextStep(s)}}}_visitSubInstructions(e,t,r){let o=t.currentTimeline.currentTime;const s=null!=r.duration?aa(r.duration):null,a=null!=r.delay?aa(r.delay):null;return 0!==s&&e.forEach(l=>{const c=t.appendInstructionToTimeline(l,s,a);o=Math.max(o,c.duration+c.delay)}),o}visitReference(e,t){t.updateOptions(e.options,!0),Li(this,e.animation,t),t.previousNode=e}visitSequence(e,t){const r=t.subContextCount;let i=t;const o=e.options;if(o&&(o.params||o.delay)&&(i=t.createSubContext(o),i.transformIntoNewTimeline(),null!=o.delay)){i.previousNode.type==we.Style&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=KT);const s=aa(o.delay);i.delayNextStep(s)}e.steps.length&&(e.steps.forEach(s=>Li(this,s,i)),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>r&&i.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){const r=[];let i=t.currentTimeline.currentTime;const o=e.options&&e.options.delay?aa(e.options.delay):0;e.steps.forEach(s=>{const a=t.createSubContext(e.options);o&&a.delayNextStep(o),Li(this,s,a),i=Math.max(i,a.currentTimeline.currentTime),r.push(a.currentTimeline)}),r.forEach(s=>t.currentTimeline.mergeTimelineCollectedStyles(s)),t.transformIntoNewTimeline(i),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){const r=e.strValue;return jT(t.params?X_(r,t.params,t.errors):r,t.errors)}return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){const r=t.currentAnimateTimings=this._visitTiming(e.timings,t),i=t.currentTimeline;r.delay&&(t.incrementTime(r.delay),i.snapshotCurrentStyles());const o=e.style;o.type==we.Keyframes?this.visitKeyframes(o,t):(t.incrementTime(r.duration),this.visitStyle(o,t),i.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){const r=t.currentTimeline,i=t.currentAnimateTimings;!i&&r.hasCurrentStyleProperties()&&r.forwardFrame();const o=i&&i.easing||e.easing;e.isEmptyStep?r.applyEmptyStep(o):r.setStyles(e.styles,o,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){const r=t.currentAnimateTimings,i=t.currentTimeline.duration,o=r.duration,a=t.createSubContext().currentTimeline;a.easing=r.easing,e.styles.forEach(l=>{a.forwardTime((l.offset||0)*o),a.setStyles(l.styles,l.easing,t.errors,t.options),a.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(a),t.transformIntoNewTimeline(i+o),t.previousNode=e}visitQuery(e,t){const r=t.currentTimeline.currentTime,i=e.options||{},o=i.delay?aa(i.delay):0;o&&(t.previousNode.type===we.Style||0==r&&t.currentTimeline.hasCurrentStyleProperties())&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=KT);let s=r;const a=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!i.optional,t.errors);t.currentQueryTotal=a.length;let l=null;a.forEach((c,u)=>{t.currentQueryIndex=u;const d=t.createSubContext(e.options,c);o&&d.delayNextStep(o),c===t.element&&(l=d.currentTimeline),Li(this,e.animation,d),d.currentTimeline.applyStylesToKeyframe(),s=Math.max(s,d.currentTimeline.currentTime)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(s),l&&(t.currentTimeline.mergeTimelineCollectedStyles(l),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){const r=t.parentContext,i=t.currentTimeline,o=e.timings,s=Math.abs(o.duration),a=s*(t.currentQueryTotal-1);let l=s*t.currentQueryIndex;switch(o.duration<0?"reverse":o.easing){case"reverse":l=a-l;break;case"full":l=r.currentStaggerTime}const u=t.currentTimeline;l&&u.delayNextStep(l);const d=u.currentTime;Li(this,e.animation,t),t.previousNode=e,r.currentStaggerTime=i.currentTime-d+(i.startTime-r.currentTimeline.startTime)}}const KT={};class KF{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=KT;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(e,t,r,i,o,s,a,l){this._driver=e,this.element=t,this.subInstructions=r,this._enterClassName=i,this._leaveClassName=o,this.errors=s,this.timelines=a,this.currentTimeline=l||new QT(this._driver,t,0),a.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;const r=e;let i=this.options;null!=r.duration&&(i.duration=aa(r.duration)),null!=r.delay&&(i.delay=aa(r.delay));const o=r.params;if(o){let s=i.params;s||(s=this.options.params={}),Object.keys(o).forEach(a=>{(!t||!s.hasOwnProperty(a))&&(s[a]=X_(o[a],s,this.errors))})}}_copyOptions(){const e={};if(this.options){const t=this.options.params;if(t){const r=e.params={};Object.keys(t).forEach(i=>{r[i]=t[i]})}}return e}createSubContext(e=null,t,r){const i=t||this.element,o=new KF(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,r||0));return o.previousNode=this.previousNode,o.currentAnimateTimings=this.currentAnimateTimings,o.options=this._copyOptions(),o.updateOptions(e),o.currentQueryIndex=this.currentQueryIndex,o.currentQueryTotal=this.currentQueryTotal,o.parentContext=this,this.subContextCount++,o}transformIntoNewTimeline(e){return this.previousNode=KT,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,r){const i={duration:t??e.duration,delay:this.currentTimeline.currentTime+(r??0)+e.delay,easing:""},o=new Pze(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,i,e.stretchStartingKeyframe);return this.timelines.push(o),i}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,r,i,o,s){let a=[];if(i&&a.push(this.element),e.length>0){e=(e=e.replace(Rze,"."+this._enterClassName)).replace(kze,"."+this._leaveClassName);let c=this._driver.query(this.element,e,1!=r);0!==r&&(c=r<0?c.slice(c.length+r,c.length):c.slice(0,r)),a.push(...c)}return!o&&0==a.length&&s.push(function UUe(){return new O(3014,!1)}()),a}}class QT{_driver;element;startTime;_elementTimelineStylesLookup;duration=0;easing=null;_previousKeyframe=new Map;_currentKeyframe=new Map;_keyframes=new Map;_styleSummary=new Map;_localTimelineStyles=new Map;_globalTimelineStyles;_pendingStyles=new Map;_backFill=new Map;_currentEmptyStepKeyframe=null;constructor(e,t,r,i){this._driver=e,this.element=t,this.startTime=r,this._elementTimelineStylesLookup=i,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,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(e){const t=1===this._keyframes.size&&this._pendingStyles.size;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new QT(this._driver,e,t||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(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles.set(e,t),this._globalTimelineStyles.set(e,t),this._styleSummary.set(e,{time:this.currentTime,value:t})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&this._previousKeyframe.set("easing",e);for(let[t,r]of this._globalTimelineStyles)this._backFill.set(t,r||Ns),this._currentKeyframe.set(t,Ns);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,r,i){t&&this._previousKeyframe.set("easing",t);const o=i&&i.params||{},s=function Oze(n,e){const t=new Map;let r;return n.forEach(i=>{if("*"===i){r??=e.keys();for(let o of r)t.set(o,Ns)}else for(let[o,s]of i)t.set(o,s)}),t}(e,this._globalTimelineStyles);for(let[a,l]of s){const c=X_(l,o,r);this._pendingStyles.set(a,c),this._localTimelineStyles.has(a)||this._backFill.set(a,this._globalTimelineStyles.get(a)??Ns),this._updateStyle(a,c)}}applyStylesToKeyframe(){0!=this._pendingStyles.size&&(this._pendingStyles.forEach((e,t)=>{this._currentKeyframe.set(t,e)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((e,t)=>{this._currentKeyframe.has(t)||this._currentKeyframe.set(t,e)}))}snapshotCurrentStyles(){for(let[e,t]of this._localTimelineStyles)this._pendingStyles.set(e,t),this._updateStyle(e,t)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){e._styleSummary.forEach((t,r)=>{const i=this._styleSummary.get(r);(!i||t.time>i.time)&&this._updateStyle(r,t.value)})}buildKeyframes(){this.applyStylesToKeyframe();const e=new Set,t=new Set,r=1===this._keyframes.size&&0===this.duration;let i=[];this._keyframes.forEach((a,l)=>{const c=new Map([...this._backFill,...a]);c.forEach((u,d)=>{"!"===u?e.add(d):u===Ns&&t.add(d)}),r||c.set("offset",l/this.duration),i.push(c)});const o=[...e.values()],s=[...t.values()];if(r){const a=i[0],l=new Map(a);a.set("offset",0),l.set("offset",1),i=[a,l]}return WF(this.element,i,o,s,this.duration,this.startTime,this.easing,!1)}}class Pze extends QT{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(e,t,r,i,o,s,a=!1){super(e,t,s.delay),this.keyframes=r,this.preStyleProps=i,this.postStyleProps=o,this._stretchStartingKeyframe=a,this.timings={duration:s.duration,delay:s.delay,easing:s.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:r,easing:i}=this.timings;if(this._stretchStartingKeyframe&&t){const o=[],s=r+t,a=t/s,l=new Map(e[0]);l.set("offset",0),o.push(l);const c=new Map(e[0]);c.set("offset",MJ(a)),o.push(c);const u=e.length-1;for(let d=1;d<=u;d++){let f=new Map(e[d]);const p=f.get("offset");f.set("offset",MJ((t+p*r)/s)),o.push(f)}r=s,t=0,i="",e=o}return WF(this.element,e,this.preStyleProps,this.postStyleProps,r,t,i,!0)}}function MJ(n,e=3){const t=Math.pow(10,e-1);return Math.round(n*t)/t}function kJ(n,e,t,r,i,o,s,a,l,c,u,d,f){return{type:0,element:n,triggerName:e,isRemovalTransition:i,fromState:t,fromStyles:o,toState:r,toStyles:s,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:u,totalTime:d,errors:f}}const QF={};class NJ{_triggerName;ast;_stateStyles;constructor(e,t,r){this._triggerName=e,this.ast=t,this._stateStyles=r}match(e,t,r,i){return function Fze(n,e,t,r,i){return n.some(o=>o(e,t,r,i))}(this.ast.matchers,e,t,r,i)}buildStyles(e,t,r){let i=this._stateStyles.get("*");return void 0!==e&&(i=this._stateStyles.get(e?.toString())||i),i?i.buildStyles(t,r):new Map}build(e,t,r,i,o,s,a,l,c,u){const d=[],f=this.ast.options&&this.ast.options.params||QF,m=this.buildStyles(r,a&&a.params||QF,d),_=l&&l.params||QF,v=this.buildStyles(i,_,d),E=new Set,C=new Map,R=new Map,V="void"===i,H={params:PJ(_,f),delay:this.ast.options?.delay},Q=u?[]:GF(e,t,this.ast.animation,o,s,m,v,H,c,d);let S=0;return Q.forEach(I=>{S=Math.max(I.duration+I.delay,S)}),d.length?kJ(t,this._triggerName,r,i,V,m,v,[],[],C,R,S,d):(Q.forEach(I=>{const x=I.element,A=Fi(C,x,new Set);I.preStyleProps.forEach(P=>A.add(P));const M=Fi(R,x,new Set);I.postStyleProps.forEach(P=>M.add(P)),x!==t&&E.add(x)}),kJ(t,this._triggerName,r,i,V,m,v,Q,[...E.values()],C,R,S))}}function PJ(n,e){const t={...e};return Object.entries(n).forEach(([r,i])=>{null!=i&&(t[r]=i)}),t}class Lze{styles;defaultParams;normalizer;constructor(e,t,r){this.styles=e,this.defaultParams=t,this.normalizer=r}buildStyles(e,t){const r=new Map,i=PJ(e,this.defaultParams);return this.styles.styles.forEach(o=>{"string"!=typeof o&&o.forEach((s,a)=>{s&&(s=X_(s,i,t));const l=this.normalizer.normalizePropertyName(a,t);s=this.normalizer.normalizeStyleValue(a,l,s,t),r.set(a,s)})}),r}}class Bze{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(e,t,r){this.name=e,this.ast=t,this._normalizer=r,t.states.forEach(i=>{this.states.set(i.name,new Lze(i.style,i.options&&i.options.params||{},r))}),OJ(this.states,"true","1"),OJ(this.states,"false","0"),t.transitions.forEach(i=>{this.transitionFactories.push(new NJ(e,i,this.states))}),this.fallbackTransition=function Uze(n,e){return new NJ(n,{type:we.Transition,animation:{type:we.Sequence,steps:[],options:null},matchers:[(s,a)=>!0],options:null,queryCount:0,depCount:0},e)}(e,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,r,i){return this.transitionFactories.find(s=>s.match(e,t,r,i))||null}matchStyles(e,t,r){return this.fallbackTransition.buildStyles(e,t,r)}}function OJ(n,e,t){n.has(e)?n.has(t)||n.set(t,n.get(e)):n.has(t)&&n.set(e,n.get(t))}const zze=new GT;class jze{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(e,t,r){this.bodyNode=e,this._driver=t,this._normalizer=r}register(e,t){const r=[],o=$F(this._driver,t,r,[]);if(r.length)throw function GUe(){return new O(3503,!1)}();this._animations.set(e,o)}_buildPlayer(e,t,r){const i=e.element,o=yJ(this._normalizer,e.keyframes,t,r);return this._driver.animate(i,o,e.duration,e.delay,e.easing,[],!0)}create(e,t,r={}){const i=[],o=this._animations.get(e);let s;const a=new Map;if(o?(s=GF(this._driver,t,o,VF,BT,new Map,new Map,r,zze,i),s.forEach(u=>{const d=Fi(a,u.element,new Map);u.postStyleProps.forEach(f=>d.set(f,null))})):(i.push(function KUe(){return new O(3300,!1)}()),s=[]),i.length)throw function QUe(){return new O(3504,!1)}();a.forEach((u,d)=>{u.forEach((f,p)=>{u.set(p,this._driver.computeStyle(d,p,Ns))})});const c=Ll(s.map(u=>{const d=a.get(u.element);return this._buildPlayer(u,new Map,d)}));return this._playersById.set(e,c),c.onDestroy(()=>this.destroy(e)),this.players.push(c),c}destroy(e){const t=this._getPlayer(e);t.destroy(),this._playersById.delete(e);const r=this.players.indexOf(t);r>=0&&this.players.splice(r,1)}_getPlayer(e){const t=this._playersById.get(e);if(!t)throw function YUe(){return new O(3301,!1)}();return t}listen(e,t,r,i){const o=NF(t,"","","");return MF(this._getPlayer(e),r,o,i),()=>{}}command(e,t,r,i){if("register"==r)return void this.register(e,i[0]);if("create"==r)return void this.create(e,t,i[0]||{});const o=this._getPlayer(e);switch(r){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(i[0]));break;case"destroy":this.destroy(e)}}}const FJ="ng-animate-queued",YF="ng-animate-disabled",Gze=[],LJ={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Kze={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},To="__ng_removed";class XF{namespaceId;value;options;get params(){return this.options.params}constructor(e,t=""){this.namespaceId=t;const r=e&&e.hasOwnProperty("value");if(this.value=function Zze(n){return n??null}(r?e.value:e),r){const{value:o,...s}=e;this.options=s}else this.options={};this.options.params||(this.options.params={})}absorbOptions(e){const t=e.params;if(t){const r=this.options.params;Object.keys(t).forEach(i=>{null==r[i]&&(r[i]=t[i])})}}}const Z_="void",ZF=new XF(Z_);class Qze{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(e,t,r){this.id=e,this.hostElement=t,this._engine=r,this._hostClassName="ng-tns-"+e,oo(t,this._hostClassName)}listen(e,t,r,i){if(!this._triggers.has(t))throw function XUe(){return new O(3302,!1)}();if(null==r||0==r.length)throw function ZUe(){return new O(3303,!1)}();if(!function Jze(n){return"start"==n||"done"==n}(r))throw function JUe(){return new O(3400,!1)}();const o=Fi(this._elementListeners,e,[]),s={name:t,phase:r,callback:i};o.push(s);const a=Fi(this._engine.statesByElement,e,new Map);return a.has(t)||(oo(e,UT),oo(e,UT+"-"+t),a.set(t,ZF)),()=>{this._engine.afterFlush(()=>{const l=o.indexOf(s);l>=0&&o.splice(l,1),this._triggers.has(t)||a.delete(t)})}}register(e,t){return!this._triggers.has(e)&&(this._triggers.set(e,t),!0)}_getTrigger(e){const t=this._triggers.get(e);if(!t)throw function eze(){return new O(3401,!1)}();return t}trigger(e,t,r,i=!0){const o=this._getTrigger(t),s=new JF(this.id,t,e);let a=this._engine.statesByElement.get(e);a||(oo(e,UT),oo(e,UT+"-"+t),this._engine.statesByElement.set(e,a=new Map));let l=a.get(t);const c=new XF(r,this.id);if(!(r&&r.hasOwnProperty("value"))&&l&&c.absorbOptions(l.options),a.set(t,c),l||(l=ZF),c.value!==Z_&&l.value===c.value){if(!function nje(n,e){const t=Object.keys(n),r=Object.keys(e);if(t.length!=r.length)return!1;for(let i=0;i{Mu(e,v),us(e,E)})}return}const f=Fi(this._engine.playersByElement,e,[]);f.forEach(_=>{_.namespaceId==this.id&&_.triggerName==t&&_.queued&&_.destroy()});let p=o.matchTransition(l.value,c.value,e,c.params),m=!1;if(!p){if(!i)return;p=o.fallbackTransition,m=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:p,fromState:l,toState:c,player:s,isFallbackTransition:m}),m||(oo(e,FJ),s.onStart(()=>{Nf(e,FJ)})),s.onDone(()=>{let _=this.players.indexOf(s);_>=0&&this.players.splice(_,1);const v=this._engine.playersByElement.get(e);if(v){let E=v.indexOf(s);E>=0&&v.splice(E,1)}}),this.players.push(s),f.push(s),s}deregister(e){this._triggers.delete(e),this._engine.statesByElement.forEach(t=>t.delete(e)),this._elementListeners.forEach((t,r)=>{this._elementListeners.set(r,t.filter(i=>i.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);const t=this._engine.playersByElement.get(e);t&&(t.forEach(r=>r.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){const r=this._engine.driver.query(e,zT,!0);r.forEach(i=>{if(i[To])return;const o=this._engine.fetchNamespacesByElement(i);o.size?o.forEach(s=>s.triggerLeaveAnimation(i,t,!1,!0)):this.clearElementCache(i)}),this._engine.afterFlushAnimationsDone(()=>r.forEach(i=>this.clearElementCache(i)))}triggerLeaveAnimation(e,t,r,i){const o=this._engine.statesByElement.get(e),s=new Map;if(o){const a=[];if(o.forEach((l,c)=>{if(s.set(c,l.value),this._triggers.has(c)){const u=this.trigger(e,c,Z_,i);u&&a.push(u)}}),a.length)return this._engine.markElementAsRemoved(this.id,e,!0,t,s),r&&Ll(a).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){const t=this._elementListeners.get(e),r=this._engine.statesByElement.get(e);if(t&&r){const i=new Set;t.forEach(o=>{const s=o.name;if(i.has(s))return;i.add(s);const l=this._triggers.get(s).fallbackTransition,c=r.get(s)||ZF,u=new XF(Z_),d=new JF(this.id,s,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:s,transition:l,fromState:c,toState:u,player:d,isFallbackTransition:!0})})}}removeNode(e,t){const r=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let i=!1;if(r.totalAnimations){const o=r.players.length?r.playersByQueriedElement.get(e):[];if(o&&o.length)i=!0;else{let s=e;for(;s=s.parentNode;)if(r.statesByElement.get(s)){i=!0;break}}}if(this.prepareLeaveAnimationListeners(e),i)r.markElementAsRemoved(this.id,e,!1,t);else{const o=e[To];(!o||o===LJ)&&(r.afterFlush(()=>this.clearElementCache(e)),r.destroyInnerAnimations(e),r._onRemovalComplete(e,t))}}insertNode(e,t){oo(e,this._hostClassName)}drainQueuedTransitions(e){const t=[];return this._queue.forEach(r=>{const i=r.player;if(i.destroyed)return;const o=r.element,s=this._elementListeners.get(o);s&&s.forEach(a=>{if(a.name==r.triggerName){const l=NF(o,r.triggerName,r.fromState.value,r.toState.value);l._data=e,MF(r.player,a.phase,l,a.callback)}}),i.markedForDestroy?this._engine.afterFlush(()=>{i.destroy()}):t.push(r)}),this._queue=[],t.sort((r,i)=>{const o=r.transition.ast.depCount,s=i.transition.ast.depCount;return 0==o||0==s?o-s:this._engine.driver.containsElement(r.element,i.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}}class Yze{bodyNode;driver;_normalizer;players=[];newHostElements=new Map;playersByElement=new Map;playersByQueriedElement=new Map;statesByElement=new Map;disabledNodes=new Set;totalAnimations=0;totalQueuedPlayers=0;_namespaceLookup={};_namespaceList=[];_flushFns=[];_whenQuietFns=[];namespacesByHostElement=new Map;collectedEnterElements=[];collectedLeaveElements=[];onRemovalComplete=(e,t)=>{};_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}constructor(e,t,r){this.bodyNode=e,this.driver=t,this._normalizer=r}get queuedPlayers(){const e=[];return this._namespaceList.forEach(t=>{t.players.forEach(r=>{r.queued&&e.push(r)})}),e}createNamespace(e,t){const r=new Qze(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(r,t):(this.newHostElements.set(t,r),this.collectEnterElement(t)),this._namespaceLookup[e]=r}_balanceNamespaceList(e,t){const r=this._namespaceList,i=this.namespacesByHostElement;if(r.length-1>=0){let s=!1,a=this.driver.getParentElement(t);for(;a;){const l=i.get(a);if(l){const c=r.indexOf(l);r.splice(c+1,0,e),s=!0;break}a=this.driver.getParentElement(a)}s||r.unshift(e)}else r.push(e);return i.set(t,e),e}register(e,t){let r=this._namespaceLookup[e];return r||(r=this.createNamespace(e,t)),r}registerTrigger(e,t,r){let i=this._namespaceLookup[e];i&&i.register(t,r)&&this.totalAnimations++}destroy(e,t){e&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{const r=this._fetchNamespace(e);this.namespacesByHostElement.delete(r.hostElement);const i=this._namespaceList.indexOf(r);i>=0&&this._namespaceList.splice(i,1),r.destroy(t),delete this._namespaceLookup[e]}))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){const t=new Set,r=this.statesByElement.get(e);if(r)for(let i of r.values())if(i.namespaceId){const o=this._fetchNamespace(i.namespaceId);o&&t.add(o)}return t}trigger(e,t,r,i){if(YT(t)){const o=this._fetchNamespace(e);if(o)return o.trigger(t,r,i),!0}return!1}insertNode(e,t,r,i){if(!YT(t))return;const o=t[To];if(o&&o.setForRemoval){o.setForRemoval=!1,o.setForMove=!0;const s=this.collectedLeaveElements.indexOf(t);s>=0&&this.collectedLeaveElements.splice(s,1)}if(e){const s=this._fetchNamespace(e);s&&s.insertNode(t,r)}i&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),oo(e,YF)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),Nf(e,YF))}removeNode(e,t,r){if(YT(t)){const i=e?this._fetchNamespace(e):null;i?i.removeNode(t,r):this.markElementAsRemoved(e,t,!1,r);const o=this.namespacesByHostElement.get(t);o&&o.id!==e&&o.removeNode(t,r)}else this._onRemovalComplete(t,r)}markElementAsRemoved(e,t,r,i,o){this.collectedLeaveElements.push(t),t[To]={namespaceId:e,setForRemoval:i,hasAnimation:r,removedBeforeQueried:!1,previousTriggersValues:o}}listen(e,t,r,i,o){return YT(t)?this._fetchNamespace(e).listen(t,r,i,o):()=>{}}_buildInstruction(e,t,r,i,o){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,r,i,e.fromState.options,e.toState.options,t,o)}destroyInnerAnimations(e){let t=this.driver.query(e,zT,!0);t.forEach(r=>this.destroyActiveAnimationsForElement(r)),0!=this.playersByQueriedElement.size&&(t=this.driver.query(e,BF,!0),t.forEach(r=>this.finishActiveQueriedAnimationOnElement(r)))}destroyActiveAnimationsForElement(e){const t=this.playersByElement.get(e);t&&t.forEach(r=>{r.queued?r.markedForDestroy=!0:r.destroy()})}finishActiveQueriedAnimationOnElement(e){const t=this.playersByQueriedElement.get(e);t&&t.forEach(r=>r.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return Ll(this.players).onDone(()=>e());e()})}processLeaveNode(e){const t=e[To];if(t&&t.setForRemoval){if(e[To]=LJ,t.namespaceId){this.destroyInnerAnimations(e);const r=this._fetchNamespace(t.namespaceId);r&&r.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}e.classList?.contains(YF)&&this.markElementAsDisabled(e,!1),this.driver.query(e,".ng-animate-disabled",!0).forEach(r=>{this.markElementAsDisabled(r,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((r,i)=>this._balanceNamespaceList(r,i)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let r=0;rr()),this._flushFns=[],this._whenQuietFns.length){const r=this._whenQuietFns;this._whenQuietFns=[],t.length?Ll(t).onDone(()=>{r.forEach(i=>i())}):r.forEach(i=>i())}}reportError(e){throw function tze(){return new O(3402,!1)}()}_flushAnimations(e,t){const r=new GT,i=[],o=new Map,s=[],a=new Map,l=new Map,c=new Map,u=new Set;this.disabledNodes.forEach(ae=>{u.add(ae);const ce=this.driver.query(ae,".ng-animate-queued",!0);for(let he=0;he{const he=VF+_++;m.set(ce,he),ae.forEach(Ue=>oo(Ue,he))});const v=[],E=new Set,C=new Set;for(let ae=0;aeE.add(Ue)):C.add(ce))}const R=new Map,V=UJ(f,Array.from(E));V.forEach((ae,ce)=>{const he=BT+_++;R.set(ce,he),ae.forEach(Ue=>oo(Ue,he))}),e.push(()=>{p.forEach((ae,ce)=>{const he=m.get(ce);ae.forEach(Ue=>Nf(Ue,he))}),V.forEach((ae,ce)=>{const he=R.get(ce);ae.forEach(Ue=>Nf(Ue,he))}),v.forEach(ae=>{this.processLeaveNode(ae)})});const H=[],Q=[];for(let ae=this._namespaceList.length-1;ae>=0;ae--)this._namespaceList[ae].drainQueuedTransitions(t).forEach(he=>{const Ue=he.player,En=he.element;if(H.push(Ue),this.collectedEnterElements.length){const un=En[To];if(un&&un.setForMove){if(un.previousTriggersValues&&un.previousTriggersValues.has(he.triggerName)){const ua=un.previousTriggersValues.get(he.triggerName),pi=this.statesByElement.get(he.element);if(pi&&pi.has(he.triggerName)){const da=pi.get(he.triggerName);da.value=ua,pi.set(he.triggerName,da)}}return void Ue.destroy()}}const ao=!d||!this.driver.containsElement(d,En),cn=R.get(En),Vt=m.get(En),Bt=this._buildInstruction(he,r,Vt,cn,ao);if(Bt.errors&&Bt.errors.length)return void Q.push(Bt);if(ao)return Ue.onStart(()=>Mu(En,Bt.fromStyles)),Ue.onDestroy(()=>us(En,Bt.toStyles)),void i.push(Ue);if(he.isFallbackTransition)return Ue.onStart(()=>Mu(En,Bt.fromStyles)),Ue.onDestroy(()=>us(En,Bt.toStyles)),void i.push(Ue);const Bl=[];Bt.timelines.forEach(un=>{un.stretchStartingKeyframe=!0,this.disabledNodes.has(un.element)||Bl.push(un)}),Bt.timelines=Bl,r.append(En,Bt.timelines),s.push({instruction:Bt,player:Ue,element:En}),Bt.queriedElements.forEach(un=>Fi(a,un,[]).push(Ue)),Bt.preStyleProps.forEach((un,ua)=>{if(un.size){let pi=l.get(ua);pi||l.set(ua,pi=new Set),un.forEach((da,Ul)=>pi.add(Ul))}}),Bt.postStyleProps.forEach((un,ua)=>{let pi=c.get(ua);pi||c.set(ua,pi=new Set),un.forEach((da,Ul)=>pi.add(Ul))})});if(Q.length){const ae=[];Q.forEach(ce=>{ae.push(function nze(){return new O(3505,!1)}())}),H.forEach(ce=>ce.destroy()),this.reportError(ae)}const S=new Map,I=new Map;s.forEach(ae=>{const ce=ae.element;r.has(ce)&&(I.set(ce,ce),this._beforeAnimationBuild(ae.player.namespaceId,ae.instruction,S))}),i.forEach(ae=>{const ce=ae.element;this._getPreviousPlayers(ce,!1,ae.namespaceId,ae.triggerName,null).forEach(Ue=>{Fi(S,ce,[]).push(Ue),Ue.destroy()})});const x=v.filter(ae=>jJ(ae,l,c)),A=new Map;BJ(A,this.driver,C,c,Ns).forEach(ae=>{jJ(ae,l,c)&&x.push(ae)});const P=new Map;p.forEach((ae,ce)=>{BJ(P,this.driver,new Set(ae),l,"!")}),x.forEach(ae=>{const ce=A.get(ae),he=P.get(ae);A.set(ae,new Map([...ce?.entries()??[],...he?.entries()??[]]))});const D=[],so=[],Vl={};s.forEach(ae=>{const{element:ce,player:he,instruction:Ue}=ae;if(r.has(ce)){if(u.has(ce))return he.onDestroy(()=>us(ce,Ue.toStyles)),he.disabled=!0,he.overrideTotalTime(Ue.totalTime),void i.push(he);let En=Vl;if(I.size>1){let cn=ce;const Vt=[];for(;cn=cn.parentNode;){const Bt=I.get(cn);if(Bt){En=Bt;break}Vt.push(cn)}Vt.forEach(Bt=>I.set(Bt,En))}const ao=this._buildAnimation(he.namespaceId,Ue,S,o,P,A);if(he.setRealPlayer(ao),En===Vl)D.push(he);else{const cn=this.playersByElement.get(En);cn&&cn.length&&(he.parentPlayer=Ll(cn)),i.push(he)}}else Mu(ce,Ue.fromStyles),he.onDestroy(()=>us(ce,Ue.toStyles)),so.push(he),u.has(ce)&&i.push(he)}),so.forEach(ae=>{const ce=o.get(ae.element);if(ce&&ce.length){const he=Ll(ce);ae.setRealPlayer(he)}}),i.forEach(ae=>{ae.parentPlayer?ae.syncPlayerEvents(ae.parentPlayer):ae.destroy()});for(let ae=0;ae!ao.destroyed);En.length?eje(this,ce,En):this.processLeaveNode(ce)}return v.length=0,D.forEach(ae=>{this.players.push(ae),ae.onDone(()=>{ae.destroy();const ce=this.players.indexOf(ae);this.players.splice(ce,1)}),ae.play()}),D}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,r,i,o){let s=[];if(t){const a=this.playersByQueriedElement.get(e);a&&(s=a)}else{const a=this.playersByElement.get(e);if(a){const l=!o||o==Z_;a.forEach(c=>{c.queued||!l&&c.triggerName!=i||s.push(c)})}}return(r||i)&&(s=s.filter(a=>!(r&&r!=a.namespaceId||i&&i!=a.triggerName))),s}_beforeAnimationBuild(e,t,r){const o=t.element,s=t.isRemovalTransition?void 0:e,a=t.isRemovalTransition?void 0:t.triggerName;for(const l of t.timelines){const c=l.element,u=c!==o,d=Fi(r,c,[]);this._getPreviousPlayers(c,u,s,a,t.toState).forEach(p=>{const m=p.getRealPlayer();m.beforeDestroy&&m.beforeDestroy(),p.destroy(),d.push(p)})}Mu(o,t.fromStyles)}_buildAnimation(e,t,r,i,o,s){const a=t.triggerName,l=t.element,c=[],u=new Set,d=new Set,f=t.timelines.map(m=>{const _=m.element;u.add(_);const v=_[To];if(v&&v.removedBeforeQueried)return new eg(m.duration,m.delay);const E=_!==l,C=function tje(n){const e=[];return zJ(n,e),e}((r.get(_)||Gze).map(S=>S.getRealPlayer())).filter(S=>!!S.element&&S.element===_),R=o.get(_),V=s.get(_),H=yJ(this._normalizer,m.keyframes,R,V),Q=this._buildPlayer(m,H,C);if(m.subTimeline&&i&&d.add(_),E){const S=new JF(e,a,_);S.setRealPlayer(Q),c.push(S)}return Q});c.forEach(m=>{Fi(this.playersByQueriedElement,m.element,[]).push(m),m.onDone(()=>function Xze(n,e,t){let r=n.get(e);if(r){if(r.length){const i=r.indexOf(t);r.splice(i,1)}0==r.length&&n.delete(e)}return r}(this.playersByQueriedElement,m.element,m))}),u.forEach(m=>oo(m,TJ));const p=Ll(f);return p.onDestroy(()=>{u.forEach(m=>Nf(m,TJ)),us(l,t.toStyles)}),d.forEach(m=>{Fi(i,m,[]).push(p)}),p}_buildPlayer(e,t,r){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,r):new eg(e.duration,e.delay)}}class JF{namespaceId;triggerName;element;_player=new eg;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(e,t,r){this.namespaceId=e,this.triggerName=t,this.element=r}setRealPlayer(e){this._containsRealPlayer||(this._player=e,this._queuedCallbacks.forEach((t,r)=>{t.forEach(i=>MF(e,r,void 0,i))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){const t=this._player;t.triggerCallback&&e.onStart(()=>t.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,t){Fi(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}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(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){const t=this._player;t.triggerCallback&&t.triggerCallback(e)}}function YT(n){return n&&1===n.nodeType}function VJ(n,e){const t=n.style.display;return n.style.display=e??"none",t}function BJ(n,e,t,r,i){const o=[];t.forEach(l=>o.push(VJ(l)));const s=[];r.forEach((l,c)=>{const u=new Map;l.forEach(d=>{const f=e.computeStyle(c,d,i);u.set(d,f),(!f||0==f.length)&&(c[To]=Kze,s.push(c))}),n.set(c,u)});let a=0;return t.forEach(l=>VJ(l,o[a++])),s}function UJ(n,e){const t=new Map;if(n.forEach(a=>t.set(a,[])),0==e.length)return t;const i=new Set(e),o=new Map;function s(a){if(!a)return 1;let l=o.get(a);if(l)return l;const c=a.parentNode;return l=t.has(c)?c:i.has(c)?1:s(c),o.set(a,l),l}return e.forEach(a=>{const l=s(a);1!==l&&t.get(l).push(a)}),t}function oo(n,e){n.classList?.add(e)}function Nf(n,e){n.classList?.remove(e)}function eje(n,e,t){Ll(t).onDone(()=>n.processLeaveNode(e))}function zJ(n,e){for(let t=0;ti.add(o)):e.set(n,r),t.delete(n),!0}class J_{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(e,t)=>{};constructor(e,t,r){this._driver=t,this._normalizer=r,this._transitionEngine=new Yze(e.body,t,r),this._timelineEngine=new jze(e.body,t,r),this._transitionEngine.onRemovalComplete=(i,o)=>this.onRemovalComplete(i,o)}registerTrigger(e,t,r,i,o){const s=e+"-"+i;let a=this._triggerCache[s];if(!a){const l=[],u=$F(this._driver,o,l,[]);if(l.length)throw function qUe(){return new O(3404,!1)}();a=function Vze(n,e,t){return new Bze(n,e,t)}(i,u,this._normalizer),this._triggerCache[s]=a}this._transitionEngine.registerTrigger(t,i,a)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,r,i){this._transitionEngine.insertNode(e,t,r,i)}onRemove(e,t,r){this._transitionEngine.removeNode(e,t,r)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,r,i){if("@"==r.charAt(0)){const[o,s]=vJ(r);this._timelineEngine.command(o,t,s,i)}else this._transitionEngine.trigger(e,t,r,i)}listen(e,t,r,i,o){if("@"==r.charAt(0)){const[s,a]=vJ(r);return this._timelineEngine.listen(s,t,a,o)}return this._transitionEngine.listen(e,t,r,i,o)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(e){this._transitionEngine.afterFlushAnimationsDone(e)}}let ije=(()=>{class n{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(t,r,i){this._element=t,this._startStyles=r,this._endStyles=i;let o=n.initialStylesByElement.get(t);o||n.initialStylesByElement.set(t,o=new Map),this._initialStyles=o}start(){this._state<1&&(this._startStyles&&us(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(us(this._element,this._initialStyles),this._endStyles&&(us(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(n.initialStylesByElement.delete(this._element),this._startStyles&&(Mu(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Mu(this._element,this._endStyles),this._endStyles=null),us(this._element,this._initialStyles),this._state=3)}}return n})();function eL(n){let e=null;return n.forEach((t,r)=>{(function oje(n){return"display"===n||"position"===n})(r)&&(e=e||new Map,e.set(r,t))}),e}class HJ{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(e,t,r,i){this.element=e,this.keyframes=t,this.options=r,this._specialStyles=i,this._duration=r.duration,this._delay=r.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:new Map;const t=()=>this._onFinish();this.domPlayer.addEventListener("finish",t),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",t)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(e){const t=[];return e.forEach(r=>{t.push(Object.fromEntries(r))}),t}_triggerWebAnimation(e,t,r){return e.animate(this._convertKeyframesToObject(t),r)}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),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(e=>e()),this._onDestroyFns=[])}setPosition(e){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const e=new Map;this.hasStarted()&&this._finalKeyframe.forEach((r,i)=>{"offset"!==i&&e.set(i,this._finished?r:HF(this.element,i))}),this.currentSnapshot=e}triggerCallback(e){const t="start"===e?this._onStartFns:this._onDoneFns;t.forEach(r=>r()),t.length=0}}class $J{validateStyleProperty(e){return!0}validateAnimatableStyleProperty(e){return!0}containsElement(e,t){return wJ(e,t)}getParentElement(e){return PF(e)}query(e,t,r){return EJ(e,t,r)}computeStyle(e,t,r){return HF(e,t)}animate(e,t,r,i,o,s=[]){const l={duration:r,delay:i,fill:0==i?"both":"forwards"};o&&(l.easing=o);const c=new Map,u=s.filter(p=>p instanceof HJ);(function mze(n,e){return 0===n||0===e})(r,i)&&u.forEach(p=>{p.currentSnapshot.forEach((m,_)=>c.set(_,m))});let d=function hze(n){return n.length?n[0]instanceof Map?n:n.map(e=>new Map(Object.entries(e))):[]}(t).map(p=>new Map(p));d=function gze(n,e,t){if(t.size&&e.length){let r=e[0],i=[];if(t.forEach((o,s)=>{r.has(s)||i.push(s),r.set(s,o)}),i.length)for(let o=1;os.set(a,HF(n,a)))}}return e}(e,d,c);const f=function rje(n,e){let t=null,r=null;return Array.isArray(e)&&e.length?(t=eL(e[0]),e.length>1&&(r=eL(e[e.length-1]))):e instanceof Map&&(t=eL(e)),t||r?new ije(n,t,r):null}(e,d);return new HJ(e,d,l,f)}}const qJ="@.disabled";class WJ{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(e,t,r,i){this.namespaceId=e,this.delegate=t,this.engine=r,this._onDestroy=i}get data(){return this.delegate.data}destroyNode(e){this.delegate.destroyNode?.(e)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,r,i=!0){this.delegate.insertBefore(e,t,r),this.engine.onInsert(this.namespaceId,t,e,i)}removeChild(e,t,r){this.parentNode(t)&&this.engine.onRemove(this.namespaceId,t,this.delegate)}selectRootElement(e,t){return this.delegate.selectRootElement(e,t)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,t,r,i){this.delegate.setAttribute(e,t,r,i)}removeAttribute(e,t,r){this.delegate.removeAttribute(e,t,r)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,r,i){this.delegate.setStyle(e,t,r,i)}removeStyle(e,t,r){this.delegate.removeStyle(e,t,r)}setProperty(e,t,r){"@"==t.charAt(0)&&t==qJ?this.disableAnimations(e,!!r):this.delegate.setProperty(e,t,r)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,r,i){return this.delegate.listen(e,t,r,i)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}}class sje extends WJ{factory;constructor(e,t,r,i,o){super(t,r,i,o),this.factory=e,this.namespaceId=t}setProperty(e,t,r){"@"==t.charAt(0)?"."==t.charAt(1)&&t==qJ?this.disableAnimations(e,r=void 0===r||!!r):this.engine.process(this.namespaceId,e,t.slice(1),r):this.delegate.setProperty(e,t,r)}listen(e,t,r,i){if("@"==t.charAt(0)){const o=function aje(n){switch(n){case"body":return document.body;case"document":return document;case"window":return window;default:return n}}(e);let s=t.slice(1),a="";return"@"!=s.charAt(0)&&([s,a]=function lje(n){const e=n.indexOf(".");return[n.substring(0,e),n.slice(e+1)]}(s)),this.engine.listen(this.namespaceId,o,s,a,l=>{this.factory.scheduleListenerCallback(l._data||-1,r,l)})}return this.delegate.listen(e,t,r,i)}}class cje{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(e,t,r){this.delegate=e,this.engine=t,this._zone=r,t.onRemovalComplete=(i,o)=>{o?.removeChild(null,i)}}createRenderer(e,t){const i=this.delegate.createRenderer(e,t);if(!e||!t?.data?.animation){const c=this._rendererCache;let u=c.get(i);return u||(u=new WJ("",i,this.engine,()=>c.delete(i)),c.set(i,u)),u}const o=t.id,s=t.id+"-"+this._currentId;this._currentId++,this.engine.register(s,e);const a=c=>{Array.isArray(c)?c.forEach(a):this.engine.registerTrigger(o,s,e,c.name,c)};return t.data.animation.forEach(a),new sje(this,s,i,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(e,t,r){if(e>=0&&et(r));const i=this._animationCallbacksBuffer;0==i.length&&queueMicrotask(()=>{this._zone.run(()=>{i.forEach(o=>{const[s,a]=o;s(a)}),this._animationCallbacksBuffer=[]})}),i.push([t,r])}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()}componentReplaced(e){this.engine.flush(),this.delegate.componentReplaced?.(e)}}const fje=[{provide:FF,useFactory:()=>new $J},{provide:Ts,useValue:"BrowserAnimations"},...[{provide:LF,useFactory:function dje(){return new SJ}},{provide:J_,useClass:(()=>{class n extends J_{constructor(t,r,i){super(t,r,i)}ngOnDestroy(){this.flush()}static \u0275fac=function(r){return new(r||n)(me(Xe),me(FF),me(LF))};static \u0275prov=G({token:n,factory:n.\u0275fac})}return n})()},{provide:Aa,useFactory:function hje(n,e,t){return new cje(n,e,t)},deps:[$D,J_,ue]}]],KJ="firebasestorage.googleapis.com";class Zt extends Wo{constructor(e,t,r=0){super(tL(e),`Firebase Storage: ${t} (${tL(e)})`),this.status_=r,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,Zt.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return tL(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.message=this.customData.serverResponse?`${this._baseMessage}\n${this.customData.serverResponse}`:this._baseMessage}}var Gt=function(n){return n.UNKNOWN="unknown",n.OBJECT_NOT_FOUND="object-not-found",n.BUCKET_NOT_FOUND="bucket-not-found",n.PROJECT_NOT_FOUND="project-not-found",n.QUOTA_EXCEEDED="quota-exceeded",n.UNAUTHENTICATED="unauthenticated",n.UNAUTHORIZED="unauthorized",n.UNAUTHORIZED_APP="unauthorized-app",n.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",n.INVALID_CHECKSUM="invalid-checksum",n.CANCELED="canceled",n.INVALID_EVENT_NAME="invalid-event-name",n.INVALID_URL="invalid-url",n.INVALID_DEFAULT_BUCKET="invalid-default-bucket",n.NO_DEFAULT_BUCKET="no-default-bucket",n.CANNOT_SLICE_BLOB="cannot-slice-blob",n.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",n.NO_DOWNLOAD_URL="no-download-url",n.INVALID_ARGUMENT="invalid-argument",n.INVALID_ARGUMENT_COUNT="invalid-argument-count",n.APP_DELETED="app-deleted",n.INVALID_ROOT_OPERATION="invalid-root-operation",n.INVALID_FORMAT="invalid-format",n.INTERNAL_ERROR="internal-error",n.UNSUPPORTED_ENVIRONMENT="unsupported-environment",n}(Gt||{});function tL(n){return"storage/"+n}function rL(n){return new Zt(Gt.INVALID_ARGUMENT,n)}function JJ(){return new Zt(Gt.APP_DELETED,"The Firebase app was deleted.")}class Wr{constructor(e,t){this.bucket=e,this.path_=t}get path(){return this.path_}get isRoot(){return 0===this.path.length}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,t){let r;try{r=Wr.makeFromUrl(e,t)}catch{return new Wr(e,"")}if(""===r.path)return r;throw function Cje(n){return new Zt(Gt.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+n+"'.")}(e)}static makeFromUrl(e,t){let r=null;const i="([A-Za-z0-9.\\-_]+)",a=new RegExp("^gs://"+i+"(/(.*))?$","i");function c(V){V.path_=decodeURIComponent(V.path)}const d=t.replace(/[.]/g,"\\."),R=[{regex:a,indices:{bucket:1,path:3},postModify:function o(V){"/"===V.path.charAt(V.path.length-1)&&(V.path_=V.path_.slice(0,-1))}},{regex:new RegExp(`^https?://${d}/v[A-Za-z0-9_]+/b/${i}/o(/([^?#]*).*)?$`,"i"),indices:{bucket:1,path:3},postModify:c},{regex:new RegExp(`^https?://${t===KJ?"(?:storage.googleapis.com|storage.cloud.google.com)":t}/${i}/([^?#]*)`,"i"),indices:{bucket:1,path:2},postModify:c}];for(let V=0;Vt)throw rL(`Invalid value for '${n}'. Expected ${t} or less.`)}var Pf=function(n){return n[n.NO_ERROR=0]="NO_ERROR",n[n.NETWORK_ERROR=1]="NETWORK_ERROR",n[n.ABORT=2]="ABORT",n}(Pf||{});class Lje{constructor(e,t,r,i,o,s,a,l,c,u,d,f=!0){this.url_=e,this.method_=t,this.headers_=r,this.body_=i,this.successCodes_=o,this.additionalRetryCodes_=s,this.callback_=a,this.errorCallback_=l,this.timeout_=c,this.progressCallback_=u,this.connectionFactory_=d,this.retry=f,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((p,m)=>{this.resolve_=p,this.reject_=m,this.start_()})}start_(){const t=(r,i)=>{const o=this.resolve_,s=this.reject_,a=i.connection;if(i.wasSuccessCode)try{const l=this.callback_(a,a.getResponse());!function Pje(n){return void 0!==n}(l)?o():o(l)}catch(l){s(l)}else if(null!==a){const l=function nL(){return new Zt(Gt.UNKNOWN,"An unknown error occurred, please check the error payload for server response.")}();l.serverResponse=a.getErrorText(),s(this.errorCallback_?this.errorCallback_(a,l):l)}else s(i.canceled?this.appDelete_?JJ():function XJ(){return new Zt(Gt.CANCELED,"User canceled the upload/download.")}():function YJ(){return new Zt(Gt.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}())};this.canceled_?t(0,new JT(!1,null,!0)):this.backoffId_=function kje(n,e,t){let r=1,i=null,o=null,s=!1,a=0;function l(){return 2===a}let c=!1;function u(...v){c||(c=!0,e.apply(null,v))}function d(v){i=setTimeout(()=>{i=null,n(p,l())},v)}function f(){o&&clearTimeout(o)}function p(v,...E){if(c)return void f();if(v)return f(),void u.call(null,v,...E);if(l()||s)return f(),void u.call(null,v,...E);let R;r<64&&(r*=2),1===a?(a=2,R=0):R=1e3*(r+Math.random()),d(R)}let m=!1;function _(v){m||(m=!0,f(),!c&&(null!==i?(v||(a=2),clearTimeout(i),d(0)):v||(a=1)))}return d(0),o=setTimeout(()=>{s=!0,_(!0)},t),_}((r,i)=>{if(i)return void r(!1,new JT(!1,null,!0));const o=this.connectionFactory_();this.pendingConnection_=o;const s=a=>{null!==this.progressCallback_&&this.progressCallback_(a.loaded,a.lengthComputable?a.total:-1)};null!==this.progressCallback_&&o.addUploadProgressListener(s),o.send(this.url_,this.method_,this.body_,this.headers_).then(()=>{null!==this.progressCallback_&&o.removeUploadProgressListener(s),this.pendingConnection_=null;const a=o.getErrorCode()===Pf.NO_ERROR,l=o.getStatus();if(!a||function nee(n,e){const t=n>=500&&n<600,i=-1!==[408,429].indexOf(n),o=-1!==e.indexOf(n);return t||i||o}(l,this.additionalRetryCodes_)&&this.retry){const u=o.getErrorCode()===Pf.ABORT;return void r(!1,new JT(!1,null,u))}const c=-1!==this.successCodes_.indexOf(l);r(!0,new JT(c,o))})},t,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,null!==this.backoffId_&&function Nje(n){n(!1)}(this.backoffId_),null!==this.pendingConnection_&&this.pendingConnection_.abort()}}class JT{constructor(e,t,r){this.wasSuccessCode=e,this.connection=t,this.canceled=!!r}}class Nu{constructor(e,t){this._service=e,this._location=t instanceof Wr?t:Wr.makeFromUrl(t,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,t){return new Nu(e,t)}get root(){const e=new Wr(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return function aee(n){const e=n.lastIndexOf("/",n.length-2);return-1===e?n:n.slice(e+1)}(this._location.path)}get storage(){return this._service}get parent(){const e=function Xje(n){if(0===n.length)return null;const e=n.lastIndexOf("/");return-1===e?"":n.slice(0,e)}(this._location.path);if(null===e)return null;const t=new Wr(this._location.bucket,e);return new Nu(this._service,t)}_throwIfRoot(e){if(""===this._location.path)throw function Rje(n){return new Zt(Gt.INVALID_ROOT_OPERATION,"The operation '"+n+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}(e)}}function Eee(n,e){const t=e?.storageBucket;return null==t?null:Wr.makeFromBucketSpec(t,n)}class hL{constructor(e,t,r,i,o){this.app=e,this._authProvider=t,this._appCheckProvider=r,this._url=i,this._firebaseVersion=o,this._bucket=null,this._host=KJ,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,this._bucket=null!=i?Wr.makeFromBucketSpec(i,this._host):Eee(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,this._bucket=null!=this._url?Wr.makeFromBucketSpec(this._url,e):Eee(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){oL("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){oL("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}_getAuthToken(){var e=this;return T(function*(){if(e._overrideAuthToken)return e._overrideAuthToken;const t=e._authProvider.getImmediate({optional:!0});if(t){const r=yield t.getToken();if(null!==r)return r.accessToken}return null})()}_getAppCheckToken(){var e=this;return T(function*(){if(ai(e.app)&&e.app.settings.appCheckToken)return e.app.settings.appCheckToken;const t=e._appCheckProvider.getImmediate({optional:!0});return t?(yield t.getToken()).token:null})()}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new Nu(this,e)}_makeRequest(e,t,r,i,o=!0){if(this._deleted)return new Mje(JJ());{const s=function jje(n,e,t,r,i,o,s=!0){const a=function tee(n){const e=encodeURIComponent;let t="?";for(const r in n)n.hasOwnProperty(r)&&(t=t+(e(r)+"=")+e(n[r])+"&");return t=t.slice(0,-1),t}(n.urlParams),l=n.url+a,c=Object.assign({},n.headers);return function Uje(n,e){e&&(n["X-Firebase-GMPID"]=e)}(c,e),function Vje(n,e){null!==e&&e.length>0&&(n.Authorization="Firebase "+e)}(c,t),function Bje(n,e){n["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}(c,o),function zje(n,e){null!==e&&(n["X-Firebase-AppCheck"]=e)}(c,r),new Lje(l,n.method,c,n.body,n.successCodes,n.additionalRetryCodes,n.handler,n.errorHandler,n.timeout,n.progressCallback,i,s)}(e,this._appId,r,i,t,this._firebaseVersion,o);return this._requests.add(s),s.getPromise().then(()=>this._requests.delete(s),()=>this._requests.delete(s)),s}}makeRequestWithTokens(e,t){var r=this;return T(function*(){const[i,o]=yield Promise.all([r._getAuthToken(),r._getAppCheckToken()]);return r._makeRequest(e,t,i,o).getPromise()})()}}const Iee="@firebase/storage";function FHe(n=cE(),e){const r=cg(n=sn(n),"storage").getImmediate({identifier:e}),i=QW("storage");return i&&function LHe(n,e,t,r={}){!function OHe(n,e,t,r={}){n.host=`${e}:${t}`,n._protocol="http";const{mockUserToken:i}=r;i&&(n._overrideAuthToken="string"==typeof i?i:ZW(i,n.app.options.projectId))}(n,e,t,r)}(r,...i),r}function VHe(n,{instanceIdentifier:e}){const t=n.getProvider("app").getImmediate(),r=n.getProvider("auth-internal"),i=n.getProvider("app-check-internal");return new hL(t,r,i,e,Lc)}!function BHe(){Fs(new Go("storage",VHe,"PUBLIC").setMultipleInstances(!0)),Gn(Iee,"0.13.6",""),Gn(Iee,"0.13.6","esm2017")}();class fL{constructor(e){return e}}const pL=new B("angularfire2.storage-instances");function jHe(n){return(e,t)=>{const r=e.runOutsideAngular(()=>n(t));return new fL(r)}}const HHe={provide:class UHe{constructor(){return dE("storage")}},deps:[[new fn,pL]]},$He={provide:fL,useFactory:function zHe(n,e){const t=uE("storage",n,e);return t&&new fL(t)},deps:[[new fn,pL],Bc]},WHe=ir(FHe,!0),GHe_firebase={apiKey:"AIzaSyBETSM_xLRYrcFjoeslZt9YfRq2aR0E7I0",authDomain:"beaubuckman-e8c64.firebaseapp.com",projectId:"beaubuckman-e8c64",storageBucket:"beaubuckman-e",messagingSenderId:"780030349868",appId:"1:780030349868:web:943115deb9886538777789",measurementId:"G-T1JE9QZP8Z"},KHe={providers:[function Jbe(n,...e){return Ui([{provide:gw,multi:!0,useValue:n},[],{provide:Xd,useFactory:Rq,deps:[bo]},{provide:Kp,multi:!0,useFactory:Mq},e.map(t=>t.\u0275providers)])}(IUe),function mje(){return On("NgEagerAnimations"),[...fje]}(),function O0e(n,...e){return Ui([k0e,N0e,{provide:PR,useFactory:P0e(n),multi:!0,deps:[ue,ze,hg,...e]}])}(()=>F0e(GHe_firebase)),function EAe(n,...e){return Gn("angularfire",dg.full,"auth"),Ui([wAe,bAe,{provide:p1,useFactory:vAe(n),multi:!0,deps:[ue,ze,hg,hE,[new fn,bE],...e]}])}(()=>CAe()),function B1e(n,...e){return Gn("angularfire",dg.full,"fst"),Ui([V1e,L1e,{provide:eO,useFactory:F1e(n),multi:!0,deps:[ue,ze,hg,hE,[new fn,f1],[new fn,bE],...e]}])}(()=>q1e()),function qHe(n,...e){return Gn("angularfire",dg.full,"gcs"),Ui([$He,HHe,{provide:pL,useFactory:jHe(n),multi:!0,deps:[ue,ze,hg,hE,[new fn,f1],[new fn,bE],...e]}])}(()=>WHe())]},QHe=["*",[["mat-toolbar-row"]]],YHe=["*","mat-toolbar-row"];let XHe=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["mat-toolbar-row"]],hostAttrs:[1,"mat-toolbar-row"],exportAs:["matToolbarRow"]})}return n})(),ZHe=(()=>{class n{_elementRef=b(je);_platform=b(rr);_document=b(Xe);color;_toolbarRows;constructor(){}ngAfterViewInit(){this._platform.isBrowser&&(this._checkToolbarMixedModes(),this._toolbarRows.changes.subscribe(()=>this._checkToolbarMixedModes()))}_checkToolbarMixedModes(){}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-toolbar"]],contentQueries:function(r,i,o){if(1&r&&$n(o,XHe,5),2&r){let s;Qe(s=Ye())&&(i._toolbarRows=s)}},hostAttrs:[1,"mat-toolbar"],hostVars:6,hostBindings:function(r,i){2&r&&(Fa(i.color?"mat-"+i.color:""),at("mat-toolbar-multiple-rows",i._toolbarRows.length>0)("mat-toolbar-single-row",0===i._toolbarRows.length))},inputs:{color:"color"},exportAs:["matToolbar"],ngContentSelectors:YHe,decls:2,vars:0,template:function(r,i){1&r&&(Hn(QHe),Ae(0),Ae(1,1))},styles:[".mat-toolbar{background:var(--mat-toolbar-container-background-color, var(--mat-sys-surface));color:var(--mat-toolbar-container-text-color, var(--mat-sys-on-surface))}.mat-toolbar,.mat-toolbar h1,.mat-toolbar h2,.mat-toolbar h3,.mat-toolbar h4,.mat-toolbar h5,.mat-toolbar h6{font-family:var(--mat-toolbar-title-text-font, var(--mat-sys-title-large-font));font-size:var(--mat-toolbar-title-text-size, var(--mat-sys-title-large-size));line-height:var(--mat-toolbar-title-text-line-height, var(--mat-sys-title-large-line-height));font-weight:var(--mat-toolbar-title-text-weight, var(--mat-sys-title-large-weight));letter-spacing:var(--mat-toolbar-title-text-tracking, var(--mat-sys-title-large-tracking));margin:0}@media(forced-colors: active){.mat-toolbar{outline:solid 1px}}.mat-toolbar .mat-form-field-underline,.mat-toolbar .mat-form-field-ripple,.mat-toolbar .mat-focused .mat-form-field-ripple{background-color:currentColor}.mat-toolbar .mat-form-field-label,.mat-toolbar .mat-focused .mat-form-field-label,.mat-toolbar .mat-select-value,.mat-toolbar .mat-select-arrow,.mat-toolbar .mat-form-field.mat-focused .mat-select-arrow{color:inherit}.mat-toolbar .mat-input-element{caret-color:currentColor}.mat-toolbar .mat-mdc-button-base.mat-mdc-button-base.mat-unthemed{--mdc-text-button-label-text-color:var(--mat-toolbar-container-text-color, var(--mat-sys-on-surface));--mdc-outlined-button-label-text-color:var(--mat-toolbar-container-text-color, var(--mat-sys-on-surface))}.mat-toolbar-row,.mat-toolbar-single-row{display:flex;box-sizing:border-box;padding:0 16px;width:100%;flex-direction:row;align-items:center;white-space:nowrap;height:var(--mat-toolbar-standard-height, 64px)}@media(max-width: 599px){.mat-toolbar-row,.mat-toolbar-single-row{height:var(--mat-toolbar-mobile-height, 56px)}}.mat-toolbar-multiple-rows{display:flex;box-sizing:border-box;flex-direction:column;width:100%;min-height:var(--mat-toolbar-standard-height, 64px)}@media(max-width: 599px){.mat-toolbar-multiple-rows{min-height:var(--mat-toolbar-mobile-height, 56px)}}"],encapsulation:2,changeDetection:0})}return n})(),JHe=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({imports:[gn,gn]})}return n})();const e$e=["tooltip"],Dee=new B("mat-tooltip-scroll-strategy",{providedIn:"root",factory:()=>{const n=b(pu);return()=>n.scrollStrategies.reposition({scrollThrottle:20})}}),n$e={provide:Dee,deps:[pu],useFactory:function t$e(n){return()=>n.scrollStrategies.reposition({scrollThrottle:20})}},i$e=new B("mat-tooltip-default-options",{providedIn:"root",factory:function r$e(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}}),Aee="tooltip-panel",Ree=ah({passive:!0});let c$e=(()=>{class n{_elementRef=b(je);_ngZone=b(ue);_platform=b(rr);_ariaDescriber=b(PEe);_focusMonitor=b(ZA);_dir=b(Gw);_injector=b(ze);_viewContainerRef=b(Ci);_defaultOptions=b(i$e,{optional:!0});_overlayRef;_tooltipInstance;_portal;_position="below";_positionAtOrigin=!1;_disabled=!1;_tooltipClass;_viewInitialized=!1;_pointerExitEventsInitialized=!1;_tooltipComponent=u$e;_viewportMargin=8;_currentPosition;_cssClassPrefix="mat-mdc";_ariaDescriptionPending;_dirSubscribed=!1;get position(){return this._position}set position(t){t!==this._position&&(this._position=t,this._overlayRef&&(this._updatePosition(this._overlayRef),this._tooltipInstance?.show(0),this._overlayRef.updatePosition()))}get positionAtOrigin(){return this._positionAtOrigin}set positionAtOrigin(t){this._positionAtOrigin=Qa(t),this._detach(),this._overlayRef=null}get disabled(){return this._disabled}set disabled(t){const r=Qa(t);this._disabled!==r&&(this._disabled=r,r?this.hide(0):this._setupPointerEnterEventsIfNeeded(),this._syncAriaDescription(this.message))}get showDelay(){return this._showDelay}set showDelay(t){this._showDelay=Y5(t)}_showDelay;get hideDelay(){return this._hideDelay}set hideDelay(t){this._hideDelay=Y5(t),this._tooltipInstance&&(this._tooltipInstance._mouseLeaveHideDelay=this._hideDelay)}_hideDelay;touchGestures="auto";get message(){return this._message}set message(t){const r=this._message;this._message=null!=t?String(t).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage()),this._syncAriaDescription(r)}_message="";get tooltipClass(){return this._tooltipClass}set tooltipClass(t){this._tooltipClass=t,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass)}_passiveListeners=[];_touchstartTimeout=null;_destroyed=new fe;_isDestroyed=!1;constructor(){const t=this._defaultOptions;t&&(this._showDelay=t.showDelay,this._hideDelay=t.hideDelay,t.position&&(this.position=t.position),t.positionAtOrigin&&(this.positionAtOrigin=t.positionAtOrigin),t.touchGestures&&(this.touchGestures=t.touchGestures),t.tooltipClass&&(this.tooltipClass=t.tooltipClass)),this._viewportMargin=8}ngAfterViewInit(){this._viewInitialized=!0,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(At(this._destroyed)).subscribe(t=>{t?"keyboard"===t&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0))})}ngOnDestroy(){const t=this._elementRef.nativeElement;this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),this._passiveListeners.forEach(([r,i])=>{t.removeEventListener(r,i,Ree)}),this._passiveListeners.length=0,this._destroyed.next(),this._destroyed.complete(),this._isDestroyed=!0,this._ariaDescriber.removeDescription(t,this.message,"tooltip"),this._focusMonitor.stopMonitoring(t)}show(t=this.showDelay,r){if(this.disabled||!this.message||this._isTooltipVisible())return void this._tooltipInstance?._cancelPendingAnimations();const i=this._createOverlay(r);this._detach(),this._portal=this._portal||new QI(this._tooltipComponent,this._viewContainerRef);const o=this._tooltipInstance=i.attach(this._portal).instance;o._triggerElement=this._elementRef.nativeElement,o._mouseLeaveHideDelay=this._hideDelay,o.afterHidden().pipe(At(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),o.show(t)}hide(t=this.hideDelay){const r=this._tooltipInstance;r&&(r.isVisible()?r.hide(t):(r._cancelPendingAnimations(),this._detach()))}toggle(t){this._isTooltipVisible()?this.hide():this.show(void 0,t)}_isTooltipVisible(){return!!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(t){if(this._overlayRef){const s=this._overlayRef.getConfig().positionStrategy;if((!this.positionAtOrigin||!t)&&s._origin instanceof je)return this._overlayRef;this._detach()}const r=this._injector.get(EQ).getAncestorScrollContainers(this._elementRef),i=this._injector.get(pu),o=i.position().flexibleConnectedTo(this.positionAtOrigin&&t||this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(r);return o.positionChanges.pipe(At(this._destroyed)).subscribe(s=>{this._updateCurrentPositionClass(s.connectionPair),this._tooltipInstance&&s.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0))}),this._overlayRef=i.create({direction:this._dir,positionStrategy:o,panelClass:`${this._cssClassPrefix}-${Aee}`,scrollStrategy:this._injector.get(Dee)()}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(At(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(At(this._destroyed)).subscribe(()=>this._tooltipInstance?._handleBodyInteraction()),this._overlayRef.keydownEvents().pipe(At(this._destroyed)).subscribe(s=>{this._isTooltipVisible()&&27===s.keyCode&&!Lw(s)&&(s.preventDefault(),s.stopPropagation(),this._ngZone.run(()=>this.hide(0)))}),this._defaultOptions?.disableTooltipInteractivity&&this._overlayRef.addPanelClass(`${this._cssClassPrefix}-tooltip-panel-non-interactive`),this._dirSubscribed||(this._dirSubscribed=!0,this._dir.change.pipe(At(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef)})),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}_updatePosition(t){const r=t.getConfig().positionStrategy,i=this._getOrigin(),o=this._getOverlayPosition();r.withPositions([this._addOffset({...i.main,...o.main}),this._addOffset({...i.fallback,...o.fallback})])}_addOffset(t){const i=!this._dir||"ltr"==this._dir.value;return"top"===t.originY?t.offsetY=-8:"bottom"===t.originY?t.offsetY=8:"start"===t.originX?t.offsetX=i?-8:8:"end"===t.originX&&(t.offsetX=i?8:-8),t}_getOrigin(){const t=!this._dir||"ltr"==this._dir.value,r=this.position;let i;"above"==r||"below"==r?i={originX:"center",originY:"above"==r?"top":"bottom"}:"before"==r||"left"==r&&t||"right"==r&&!t?i={originX:"start",originY:"center"}:("after"==r||"right"==r&&t||"left"==r&&!t)&&(i={originX:"end",originY:"center"});const{x:o,y:s}=this._invertPosition(i.originX,i.originY);return{main:i,fallback:{originX:o,originY:s}}}_getOverlayPosition(){const t=!this._dir||"ltr"==this._dir.value,r=this.position;let i;"above"==r?i={overlayX:"center",overlayY:"bottom"}:"below"==r?i={overlayX:"center",overlayY:"top"}:"before"==r||"left"==r&&t||"right"==r&&!t?i={overlayX:"end",overlayY:"center"}:("after"==r||"right"==r&&t||"left"==r&&!t)&&(i={overlayX:"start",overlayY:"center"});const{x:o,y:s}=this._invertPosition(i.overlayX,i.overlayY);return{main:i,fallback:{overlayX:o,overlayY:s}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),Cs(()=>{this._tooltipInstance&&this._overlayRef.updatePosition()},{injector:this._injector}))}_setTooltipClass(t){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=t,this._tooltipInstance._markForCheck())}_invertPosition(t,r){return"above"===this.position||"below"===this.position?"top"===r?r="bottom":"bottom"===r&&(r="top"):"end"===t?t="start":"start"===t&&(t="end"),{x:t,y:r}}_updateCurrentPositionClass(t){const{overlayY:r,originX:i,originY:o}=t;let s;if(s="center"===r?this._dir&&"rtl"===this._dir.value?"end"===i?"left":"right":"start"===i?"left":"right":"bottom"===r&&"top"===o?"above":"below",s!==this._currentPosition){const a=this._overlayRef;if(a){const l=`${this._cssClassPrefix}-${Aee}-`;a.removePanelClass(l+this._currentPosition),a.addPanelClass(l+s)}this._currentPosition=s}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._passiveListeners.length||(this._platformSupportsMouseEvents()?this._passiveListeners.push(["mouseenter",t=>{let r;this._setupPointerExitEventsIfNeeded(),void 0!==t.x&&void 0!==t.y&&(r=t),this.show(void 0,r)}]):"off"!==this.touchGestures&&(this._disableNativeGesturesIfNecessary(),this._passiveListeners.push(["touchstart",t=>{const r=t.targetTouches?.[0],i=r?{x:r.clientX,y:r.clientY}:void 0;this._setupPointerExitEventsIfNeeded(),this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this._touchstartTimeout=setTimeout(()=>{this._touchstartTimeout=null,this.show(void 0,i)},this._defaultOptions?.touchLongPressShowDelay??500)}])),this._addListeners(this._passiveListeners))}_setupPointerExitEventsIfNeeded(){if(this._pointerExitEventsInitialized)return;this._pointerExitEventsInitialized=!0;const t=[];if(this._platformSupportsMouseEvents())t.push(["mouseleave",r=>{const i=r.relatedTarget;(!i||!this._overlayRef?.overlayElement.contains(i))&&this.hide()}],["wheel",r=>this._wheelListener(r)]);else if("off"!==this.touchGestures){this._disableNativeGesturesIfNecessary();const r=()=>{this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions?.touchendHideDelay)};t.push(["touchend",r],["touchcancel",r])}this._addListeners(t),this._passiveListeners.push(...t)}_addListeners(t){t.forEach(([r,i])=>{this._elementRef.nativeElement.addEventListener(r,i,Ree)})}_platformSupportsMouseEvents(){return!this._platform.IOS&&!this._platform.ANDROID}_wheelListener(t){if(this._isTooltipVisible()){const r=this._injector.get(Xe).elementFromPoint(t.clientX,t.clientY),i=this._elementRef.nativeElement;r!==i&&!i.contains(r)&&this.hide()}}_disableNativeGesturesIfNecessary(){const t=this.touchGestures;if("off"!==t){const r=this._elementRef.nativeElement,i=r.style;("on"===t||"INPUT"!==r.nodeName&&"TEXTAREA"!==r.nodeName)&&(i.userSelect=i.msUserSelect=i.webkitUserSelect=i.MozUserSelect="none"),("on"===t||!r.draggable)&&(i.webkitUserDrag="none"),i.touchAction="none",i.webkitTapHighlightColor="transparent"}}_syncAriaDescription(t){this._ariaDescriptionPending||(this._ariaDescriptionPending=!0,this._ariaDescriber.removeDescription(this._elementRef.nativeElement,t,"tooltip"),this._isDestroyed||Cs({write:()=>{this._ariaDescriptionPending=!1,this.message&&!this.disabled&&this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip")}},{injector:this._injector}))}static \u0275fac=function(r){return new(r||n)};static \u0275dir=ee({type:n,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-mdc-tooltip-trigger"],hostVars:2,hostBindings:function(r,i){2&r&&at("mat-mdc-tooltip-disabled",i.disabled)},inputs:{position:[0,"matTooltipPosition","position"],positionAtOrigin:[0,"matTooltipPositionAtOrigin","positionAtOrigin"],disabled:[0,"matTooltipDisabled","disabled"],showDelay:[0,"matTooltipShowDelay","showDelay"],hideDelay:[0,"matTooltipHideDelay","hideDelay"],touchGestures:[0,"matTooltipTouchGestures","touchGestures"],message:[0,"matTooltip","message"],tooltipClass:[0,"matTooltipClass","tooltipClass"]},exportAs:["matTooltip"]})}return n})(),u$e=(()=>{class n{_changeDetectorRef=b(Uo);_elementRef=b(je);_isMultiline=!1;message;tooltipClass;_showTimeoutId;_hideTimeoutId;_triggerElement;_mouseLeaveHideDelay;_animationsDisabled;_tooltip;_closeOnInteraction=!1;_isVisible=!1;_onHide=new fe;_showAnimation="mat-mdc-tooltip-show";_hideAnimation="mat-mdc-tooltip-hide";constructor(){const t=b(Ts,{optional:!0});this._animationsDisabled="NoopAnimations"===t}show(t){null!=this._hideTimeoutId&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=setTimeout(()=>{this._toggleVisibility(!0),this._showTimeoutId=void 0},t)}hide(t){null!=this._showTimeoutId&&clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._toggleVisibility(!1),this._hideTimeoutId=void 0},t)}afterHidden(){return this._onHide}isVisible(){return this._isVisible}ngOnDestroy(){this._cancelPendingAnimations(),this._onHide.complete(),this._triggerElement=null}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0)}_markForCheck(){this._changeDetectorRef.markForCheck()}_handleMouseLeave({relatedTarget:t}){(!t||!this._triggerElement.contains(t))&&(this.isVisible()?this.hide(this._mouseLeaveHideDelay):this._finalizeAnimation(!1))}_onShow(){this._isMultiline=this._isTooltipMultiline(),this._markForCheck()}_isTooltipMultiline(){const t=this._elementRef.nativeElement.getBoundingClientRect();return t.height>24&&t.width>=200}_handleAnimationEnd({animationName:t}){(t===this._showAnimation||t===this._hideAnimation)&&this._finalizeAnimation(t===this._showAnimation)}_cancelPendingAnimations(){null!=this._showTimeoutId&&clearTimeout(this._showTimeoutId),null!=this._hideTimeoutId&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=this._hideTimeoutId=void 0}_finalizeAnimation(t){t?this._closeOnInteraction=!0:this.isVisible()||this._onHide.next()}_toggleVisibility(t){const r=this._tooltip.nativeElement,i=this._showAnimation,o=this._hideAnimation;if(r.classList.remove(t?o:i),r.classList.add(t?i:o),this._isVisible!==t&&(this._isVisible=t,this._changeDetectorRef.markForCheck()),t&&!this._animationsDisabled&&"function"==typeof getComputedStyle){const s=getComputedStyle(r);("0s"===s.getPropertyValue("animation-duration")||"none"===s.getPropertyValue("animation-name"))&&(this._animationsDisabled=!0)}t&&this._onShow(),this._animationsDisabled&&(r.classList.add("_mat-animation-noopable"),this._finalizeAnimation(t))}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["mat-tooltip-component"]],viewQuery:function(r,i){if(1&r&&qn(e$e,7),2&r){let o;Qe(o=Ye())&&(i._tooltip=o.first)}},hostAttrs:["aria-hidden","true"],hostBindings:function(r,i){1&r&&Ve("mouseleave",function(s){return i._handleMouseLeave(s)})},decls:4,vars:4,consts:[["tooltip",""],[1,"mdc-tooltip","mat-mdc-tooltip",3,"animationend","ngClass"],[1,"mat-mdc-tooltip-surface","mdc-tooltip__surface"]],template:function(r,i){if(1&r){const o=La();W(0,"div",1,0),Ve("animationend",function(a){return vi(o),bi(i._handleAnimationEnd(a))}),W(2,"div",2),Oe(3),K()()}2&r&&(at("mdc-tooltip--multiline",i._isMultiline),De("ngClass",i.tooltipClass),re(3),zd(i.message))},dependencies:[RD],styles:['.mat-mdc-tooltip{position:relative;transform:scale(0);display:inline-flex}.mat-mdc-tooltip::before{content:"";top:0;right:0;bottom:0;left:0;z-index:-1;position:absolute}.mat-mdc-tooltip-panel-below .mat-mdc-tooltip::before{top:-8px}.mat-mdc-tooltip-panel-above .mat-mdc-tooltip::before{bottom:-8px}.mat-mdc-tooltip-panel-right .mat-mdc-tooltip::before{left:-8px}.mat-mdc-tooltip-panel-left .mat-mdc-tooltip::before{right:-8px}.mat-mdc-tooltip._mat-animation-noopable{animation:none;transform:scale(1)}.mat-mdc-tooltip-surface{word-break:normal;overflow-wrap:anywhere;padding:4px 8px;min-width:40px;max-width:200px;min-height:24px;max-height:40vh;box-sizing:border-box;overflow:hidden;text-align:center;will-change:transform,opacity;background-color:var(--mdc-plain-tooltip-container-color, var(--mat-sys-inverse-surface));color:var(--mdc-plain-tooltip-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mdc-plain-tooltip-container-shape, var(--mat-sys-corner-extra-small));font-family:var(--mdc-plain-tooltip-supporting-text-font, var(--mat-sys-body-small-font));font-size:var(--mdc-plain-tooltip-supporting-text-size, var(--mat-sys-body-small-size));font-weight:var(--mdc-plain-tooltip-supporting-text-weight, var(--mat-sys-body-small-weight));line-height:var(--mdc-plain-tooltip-supporting-text-line-height, var(--mat-sys-body-small-line-height));letter-spacing:var(--mdc-plain-tooltip-supporting-text-tracking, var(--mat-sys-body-small-tracking))}.mat-mdc-tooltip-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:left}[dir=rtl] .mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:right}.mat-mdc-tooltip-panel{line-height:normal}.mat-mdc-tooltip-panel.mat-mdc-tooltip-panel-non-interactive{pointer-events:none}@keyframes mat-mdc-tooltip-show{0%{opacity:0;transform:scale(0.8)}100%{opacity:1;transform:scale(1)}}@keyframes mat-mdc-tooltip-hide{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(0.8)}}.mat-mdc-tooltip-show{animation:mat-mdc-tooltip-show 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-mdc-tooltip-hide{animation:mat-mdc-tooltip-hide 75ms cubic-bezier(0.4, 0, 1, 1) forwards}'],encapsulation:2,changeDetection:0})}return n})(),d$e=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=Et({type:n});static \u0275inj=pt({providers:[n$e],imports:[nIe,ANe,gn,gn,oO]})}return n})(),h$e=(()=>{class n{document=b(Xe);THEME_KEY="preferred-theme";currentTheme=ti(this.getInitialTheme());constructor(){pm(()=>{this.document.body.classList.remove("light-theme","dark-theme"),this.document.body.classList.add(this.currentTheme()),localStorage.setItem(this.THEME_KEY,this.currentTheme())}),this.watchSystemTheme()}toggleTheme(){this.currentTheme.set("light-theme"===this.currentTheme()?"dark-theme":"light-theme")}getInitialTheme(){return localStorage.getItem(this.THEME_KEY)||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark-theme":"light-theme")}watchSystemTheme(){window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{localStorage.getItem(this.THEME_KEY)||this.currentTheme.set(t.matches?"dark-theme":"light-theme")})}static \u0275fac=function(r){return new(r||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),f$e=(()=>{class n{themeService=b(h$e);static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["app-theme-toggle"]],decls:3,vars:2,consts:[["mat-icon-button","",1,"theme-toggle",3,"click","matTooltip"],[1,"theme-icon"]],template:function(r,i){1&r&&(W(0,"button",0),Ve("click",function(){return i.themeService.toggleTheme()}),W(1,"mat-icon",1),Oe(2),K()()),2&r&&(De("matTooltip","dark-theme"===i.themeService.currentTheme()?"Switch to light mode":"Switch to dark mode"),re(2),Va(" ","dark-theme"===i.themeService.currentTheme()?"light_mode":"dark_mode"," "))},dependencies:[za,yO,_O,hh,ATe,d$e,c$e],styles:[".theme-toggle[_ngcontent-%COMP%]{transition:transform .3s ease}.theme-toggle[_ngcontent-%COMP%]:hover{transform:rotate(15deg)}.theme-icon[_ngcontent-%COMP%]{transition:all .3s ease}"]})}return n})();function p$e(n,e){if(1&n){const t=La();W(0,"button",6),Ve("click",function(){return vi(t),bi(Ln().authService.signOut())}),Oe(1," Sign Out "),K()}}(function F_e(n,e){return xpe({rootComponent:n,...l4(e)})})((()=>{class n{authService=b(mf);static \u0275fac=function(r){return new(r||n)};static \u0275cmp=He({type:n,selectors:[["app-root"]],decls:9,vars:1,consts:[[1,"app-container"],["color","primary",1,"app-toolbar"],[1,"app-title"],[1,"toolbar-spacer"],["mat-flat-button","","color","primary"],[1,"app-content"],["mat-flat-button","","color","primary",3,"click"]],template:function(r,i){1&r&&(W(0,"div",0)(1,"mat-toolbar",1)(2,"span",2),Oe(3,"Blog App"),K(),Pe(4,"div",3)(5,"app-theme-toggle"),et(6,p$e,2,0,"button",4),K(),W(7,"main",5),Pe(8,"router-outlet"),K()()),2&r&&(re(6),Pt(i.authService.currentUser()?6:-1))},dependencies:[za,gA,JHe,ZHe,hh,dh,f$e],styles:[".app-container[_ngcontent-%COMP%]{min-height:100vh;display:flex;flex-direction:column}.app-toolbar[_ngcontent-%COMP%]{position:fixed;top:0;left:0;right:0;z-index:1000;transition:background-color .3s ease}.toolbar-spacer[_ngcontent-%COMP%]{flex:1 1 auto}.app-title[_ngcontent-%COMP%]{font-size:1.5rem;font-weight:300;letter-spacing:.5px}.app-content[_ngcontent-%COMP%]{margin-top:64px;flex:1;padding:20px;max-width:1200px;width:100%;margin-left:auto;margin-right:auto;box-sizing:border-box}"]})}return n})(),KHe).catch(n=>console.error(n))}},zf=>{zf(zf.s=791)}]); \ No newline at end of file